@overmap-ai/core 1.0.79-project-folder.1 → 1.0.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -0
- package/dist/constants/array.d.ts +0 -1
- package/dist/constants/index.d.ts +0 -1
- package/dist/enums/asset.d.ts +8 -0
- package/dist/enums/index.d.ts +2 -0
- package/dist/enums/issue.d.ts +14 -13
- package/dist/enums/procedures.d.ts +11 -0
- package/dist/overmap-core.js +11026 -8618
- package/dist/overmap-core.umd.cjs +10 -11
- package/dist/sdk/base.d.ts +6 -2
- package/dist/sdk/constants.d.ts +3 -3
- package/dist/sdk/errors.d.ts +5 -0
- package/dist/sdk/index.d.ts +2 -0
- package/dist/sdk/performRequest.d.ts +6 -0
- package/dist/sdk/services/AgentService.d.ts +1 -0
- package/dist/sdk/services/AssetAttachmentService.d.ts +23 -24
- package/dist/sdk/services/AssetCommentService.d.ts +28 -0
- package/dist/sdk/services/AssetService.d.ts +22 -4
- package/dist/sdk/services/AssetTypeAttachmentService.d.ts +23 -24
- package/dist/sdk/services/AssetTypeFieldValuesAttachmentService.d.ts +26 -8
- package/dist/sdk/services/AssetTypeFieldValuesService.d.ts +21 -9
- package/dist/sdk/services/AssetTypeFieldsAttachmentService.d.ts +26 -9
- package/dist/sdk/services/AssetTypeFieldsService.d.ts +19 -2
- package/dist/sdk/services/AssetTypeIdentifierService.d.ts +20 -3
- package/dist/sdk/services/AssetTypeIdentifierValueService.d.ts +22 -5
- package/dist/sdk/services/AssetTypeService.d.ts +20 -3
- package/dist/sdk/services/AssetTypeStatusService.d.ts +28 -0
- package/dist/sdk/services/BaseModelApiService.d.ts +27 -0
- package/dist/sdk/services/BaseOfflineFileModelApiService.d.ts +17 -0
- package/dist/sdk/services/BaseOfflineModelApiService.d.ts +27 -0
- package/dist/sdk/services/BaseService.d.ts +6 -4
- package/dist/sdk/services/DocumentAttachmentService.d.ts +25 -24
- package/dist/sdk/services/DocumentService.d.ts +21 -4
- package/dist/sdk/services/EmailDomainsService.d.ts +20 -3
- package/dist/sdk/services/FileService.d.ts +7 -25
- package/dist/sdk/services/FormIdentifierService.d.ts +20 -3
- package/dist/sdk/services/FormIdentifierValueService.d.ts +20 -4
- package/dist/sdk/services/FormRevisionAttachmentService.d.ts +26 -9
- package/dist/sdk/services/FormRevisionService.d.ts +19 -2
- package/dist/sdk/services/FormService.d.ts +23 -4
- package/dist/sdk/services/FormSubmissionAttachmentService.d.ts +26 -9
- package/dist/sdk/services/FormSubmissionService.d.ts +20 -3
- package/dist/sdk/services/GeoImageService.d.ts +27 -7
- package/dist/sdk/services/IssueAssociationService.d.ts +22 -4
- package/dist/sdk/services/IssueAttachmentService.d.ts +23 -24
- package/dist/sdk/services/IssueCommentAttachmentService.d.ts +23 -24
- package/dist/sdk/services/IssueCommentService.d.ts +21 -4
- package/dist/sdk/services/IssueService.d.ts +23 -4
- package/dist/sdk/services/IssueTypeAttachmentService.d.ts +23 -24
- package/dist/sdk/services/IssueTypeFieldValuesAttachmentService.d.ts +26 -9
- package/dist/sdk/services/IssueTypeFieldValuesService.d.ts +20 -3
- package/dist/sdk/services/IssueTypeFieldsAttachmentService.d.ts +26 -9
- package/dist/sdk/services/IssueTypeFieldsService.d.ts +20 -3
- package/dist/sdk/services/IssueTypeIdentifierService.d.ts +20 -3
- package/dist/sdk/services/IssueTypeIdentifierValueService.d.ts +20 -4
- package/dist/sdk/services/IssueTypePriorityService.d.ts +28 -0
- package/dist/sdk/services/IssueTypeService.d.ts +20 -3
- package/dist/sdk/services/IssueTypeStatusService.d.ts +28 -0
- package/dist/sdk/services/IssueUpdateService.d.ts +175 -2
- package/dist/sdk/services/OrganizationAccessService.d.ts +20 -3
- package/dist/sdk/services/OrganizationService.d.ts +19 -2
- package/dist/sdk/services/ProcdureInitiativeService.d.ts +28 -0
- package/dist/sdk/services/ProcedureFieldValuesAttachmentService.d.ts +31 -0
- package/dist/sdk/services/ProcedureFieldValuesService.d.ts +29 -0
- package/dist/sdk/services/ProcedureService.d.ts +30 -0
- package/dist/sdk/services/ProcedureStepAssigneeService.d.ts +29 -0
- package/dist/sdk/services/ProcedureStepCommentService.d.ts +28 -0
- package/dist/sdk/services/ProcedureStepDefaultAssigneeService.d.ts +27 -0
- package/dist/sdk/services/ProcedureStepDefaultReviewerService.d.ts +27 -0
- package/dist/sdk/services/ProcedureStepEventService.d.ts +24 -0
- package/dist/sdk/services/ProcedureStepFieldValuesAttachmentService.d.ts +31 -0
- package/dist/sdk/services/ProcedureStepFieldValuesReviewService.d.ts +28 -0
- package/dist/sdk/services/ProcedureStepFieldValuesService.d.ts +29 -0
- package/dist/sdk/services/ProcedureStepFieldsAttachmentService.d.ts +30 -0
- package/dist/sdk/services/ProcedureStepFieldsService.d.ts +27 -0
- package/dist/sdk/services/ProcedureStepReviewerService.d.ts +29 -0
- package/dist/sdk/services/ProcedureStepService.d.ts +28 -0
- package/dist/sdk/services/ProcedureTypeAttachmentService.d.ts +30 -0
- package/dist/sdk/services/ProcedureTypeFieldsAttachmentService.d.ts +30 -0
- package/dist/sdk/services/ProcedureTypeFieldsService.d.ts +26 -0
- package/dist/sdk/services/ProcedureTypeService.d.ts +28 -0
- package/dist/sdk/services/ProjectAccessService.d.ts +22 -5
- package/dist/sdk/services/ProjectAttachmentService.d.ts +23 -24
- package/dist/sdk/services/ProjectCommentService.d.ts +28 -0
- package/dist/sdk/services/ProjectFileService.d.ts +28 -7
- package/dist/sdk/services/ProjectService.d.ts +21 -4
- package/dist/sdk/services/TeamMembershipService.d.ts +19 -2
- package/dist/sdk/services/TeamService.d.ts +20 -3
- package/dist/sdk/services/UserService.d.ts +23 -2
- package/dist/sdk/services/index.d.ts +28 -16
- package/dist/sdk/typings.d.ts +26 -61
- package/dist/sdk/utils.d.ts +2 -0
- package/dist/store/adapters/modelAdapter.d.ts +13 -14
- package/dist/store/adapters/selectionAdapter.d.ts +9 -10
- package/dist/store/adapters/typings.d.ts +20 -3
- package/dist/store/reducers.d.ts +75 -48
- package/dist/store/selectors/index.d.ts +1 -0
- package/dist/store/selectors/utils.d.ts +1 -0
- package/dist/store/slices/agentsSlice.d.ts +10 -37
- package/dist/store/slices/assetAttachmentSlice.d.ts +10 -36
- package/dist/store/slices/assetCommentSlice.d.ts +23 -0
- package/dist/store/slices/assetSlice.d.ts +36 -54
- package/dist/store/slices/assetTypeAttachmentSlice.d.ts +10 -36
- package/dist/store/slices/assetTypeFieldValuesAttachmentSlice.d.ts +35 -53
- package/dist/store/slices/assetTypeFieldValuesSlice.d.ts +35 -52
- package/dist/store/slices/assetTypeFieldsAttachmentSlice.d.ts +35 -52
- package/dist/store/slices/assetTypeFieldsSlice.d.ts +35 -52
- package/dist/store/slices/assetTypeIdentifierSlice.d.ts +10 -36
- package/dist/store/slices/assetTypeIdentifierValueSlice.d.ts +10 -36
- package/dist/store/slices/assetTypeSlice.d.ts +11 -38
- package/dist/store/slices/assetTypeStatusSlice.d.ts +120 -0
- package/dist/store/slices/documentAttachmentSlice.d.ts +10 -36
- package/dist/store/slices/documentSlice.d.ts +17 -24
- package/dist/store/slices/emailDomainsSlice.d.ts +38 -54
- package/dist/store/slices/fileSlice.d.ts +0 -3
- package/dist/store/slices/formIdentifierSlice.d.ts +10 -36
- package/dist/store/slices/formIdentifierValueSlice.d.ts +10 -36
- package/dist/store/slices/formRevisionAttachmentSlice.d.ts +110 -36
- package/dist/store/slices/formRevisionSlice.d.ts +35 -52
- package/dist/store/slices/formSlice.d.ts +35 -52
- package/dist/store/slices/formSubmissionAttachmentSlice.d.ts +12 -37
- package/dist/store/slices/formSubmissionSlice.d.ts +10 -36
- package/dist/store/slices/geoImageSlice.d.ts +35 -52
- package/dist/store/slices/index.d.ts +25 -16
- package/dist/store/slices/issueAssociationSlice.d.ts +37 -53
- package/dist/store/slices/issueAttachmentSlice.d.ts +10 -36
- package/dist/store/slices/issueCommentAttachmentSlice.d.ts +10 -36
- package/dist/store/slices/issueCommentSlice.d.ts +10 -36
- package/dist/store/slices/issueSlice.d.ts +10 -37
- package/dist/store/slices/issueTypeAttachmentSlice.d.ts +11 -37
- package/dist/store/slices/issueTypeFieldValuesAttachmentSlice.d.ts +35 -53
- package/dist/store/slices/issueTypeFieldValuesSlice.d.ts +35 -52
- package/dist/store/slices/issueTypeFieldsAttachmentSlice.d.ts +35 -52
- package/dist/store/slices/issueTypeFieldsSlice.d.ts +35 -52
- package/dist/store/slices/issueTypeIdentifierSlice.d.ts +10 -36
- package/dist/store/slices/issueTypeIdentifierValueSlice.d.ts +10 -36
- package/dist/store/slices/issueTypePrioritySlice.d.ts +120 -0
- package/dist/store/slices/issueTypeSlice.d.ts +11 -42
- package/dist/store/slices/issueTypeStatusSlice.d.ts +120 -0
- package/dist/store/slices/issueUpdateSlice.d.ts +246 -37
- package/dist/store/slices/organizationAccessSlice.d.ts +10 -36
- package/dist/store/slices/organizationSlice.d.ts +35 -52
- package/dist/store/slices/outboxSlice.d.ts +6 -7
- package/dist/store/slices/procedureFieldValuesSlice.d.ts +120 -0
- package/dist/store/slices/procedureInitiativeSlice.d.ts +23 -0
- package/dist/store/slices/procedureSlice.d.ts +26 -0
- package/dist/store/slices/procedureStepAssigneeSlice.d.ts +122 -0
- package/dist/store/slices/procedureStepCommentSlice.d.ts +122 -0
- package/dist/store/slices/procedureStepDefaultAssigneeSlice.d.ts +120 -0
- package/dist/store/slices/procedureStepDefaultReviewerSlice.d.ts +120 -0
- package/dist/store/slices/procedureStepEventSlice.d.ts +122 -0
- package/dist/store/slices/procedureStepFieldValuesAttachmentSlice.d.ts +120 -0
- package/dist/store/slices/procedureStepFieldValuesReviewSlice.d.ts +124 -0
- package/dist/store/slices/procedureStepFieldValuesSlice.d.ts +122 -0
- package/dist/store/slices/procedureStepFieldsAttachmentSlice.d.ts +120 -0
- package/dist/store/slices/procedureStepFieldsSlice.d.ts +220 -0
- package/dist/store/slices/procedureStepReviewerSlice.d.ts +122 -0
- package/dist/store/slices/procedureStepSlice.d.ts +121 -0
- package/dist/store/slices/procedureTypeAttachmentSlice.d.ts +100 -0
- package/dist/store/slices/procedureTypeFieldValuesAttachmentSlice.d.ts +120 -0
- package/dist/store/slices/procedureTypeFieldsAttachmentSlice.d.ts +120 -0
- package/dist/store/slices/procedureTypeFieldsSlice.d.ts +23 -0
- package/dist/store/slices/procedureTypeSlice.d.ts +22 -0
- package/dist/store/slices/projectAccessSlice.d.ts +10 -36
- package/dist/store/slices/projectAttachmentSlice.d.ts +12 -38
- package/dist/store/slices/projectCommentSlice.d.ts +23 -0
- package/dist/store/slices/projectFileSlice.d.ts +37 -68
- package/dist/store/slices/projectSlice.d.ts +35 -52
- package/dist/store/slices/teamMembershipSlice.d.ts +10 -36
- package/dist/store/slices/teamSlice.d.ts +10 -37
- package/dist/store/slices/userSlice.d.ts +38 -62
- package/dist/store/store.d.ts +4 -13
- package/dist/store/typings.d.ts +18 -1
- package/dist/typings/files.d.ts +27 -14
- package/dist/typings/models/assets.d.ts +19 -67
- package/dist/typings/models/base.d.ts +5 -2
- package/dist/typings/models/documents.d.ts +4 -5
- package/dist/typings/models/fields.d.ts +4 -4
- package/dist/typings/models/forms.d.ts +3 -2
- package/dist/typings/models/geoImages.d.ts +7 -7
- package/dist/typings/models/index.d.ts +1 -1
- package/dist/typings/models/issues.d.ts +47 -31
- package/dist/typings/models/procedures.d.ts +106 -0
- package/dist/typings/models/projects.d.ts +12 -11
- package/dist/typings/models/teams.d.ts +2 -3
- package/dist/typings/models/users.d.ts +0 -1
- package/dist/utils/file.d.ts +7 -11
- package/dist/utils/models/assets.d.ts +2 -4
- package/dist/utils/models/base.d.ts +2 -0
- package/dist/utils/models/documents.d.ts +4 -0
- package/dist/utils/models/index.d.ts +3 -1
- package/dist/utils/models/issues.d.ts +3 -0
- package/dist/utils/optimization.d.ts +0 -1
- package/dist/utils/utils.d.ts +0 -7
- package/dist/utils/uuid.d.ts +2 -0
- package/package.json +39 -42
- package/dist/constants/defaults.d.ts +0 -3
- package/dist/sdk/services/AssetProcedureService.d.ts +0 -11
- package/dist/sdk/services/AssetProcedureStepFieldValuesAttachmentService.d.ts +0 -16
- package/dist/sdk/services/AssetProcedureStepFieldValuesService.d.ts +0 -23
- package/dist/sdk/services/AssetProcedureStepFieldsAttachmentService.d.ts +0 -13
- package/dist/sdk/services/AssetProcedureStepFieldsService.d.ts +0 -11
- package/dist/sdk/services/AssetProcedureStepService.d.ts +0 -11
- package/dist/sdk/services/AssetProcedureTypeAttachmentService.d.ts +0 -31
- package/dist/sdk/services/AssetProcedureTypeFieldValuesAttachmentService.d.ts +0 -16
- package/dist/sdk/services/AssetProcedureTypeFieldValuesService.d.ts +0 -22
- package/dist/sdk/services/AssetProcedureTypeFieldsAttachmentService.d.ts +0 -13
- package/dist/sdk/services/AssetProcedureTypeFieldsService.d.ts +0 -9
- package/dist/sdk/services/AssetProcedureTypeService.d.ts +0 -11
- package/dist/sdk/services/AssetStageCompletionService.d.ts +0 -12
- package/dist/sdk/services/AssetStageService.d.ts +0 -11
- package/dist/sdk/services/BaseAttachmentService.d.ts +0 -32
- package/dist/sdk/services/BaseUploadService.d.ts +0 -10
- package/dist/sdk/services/CategoryService.d.ts +0 -11
- package/dist/sdk/services/ProjectFolderService.d.ts +0 -11
- package/dist/store/slices/assetProcedureSlice.d.ts +0 -139
- package/dist/store/slices/assetProcedureStepFieldValuesAttachmentSlice.d.ts +0 -138
- package/dist/store/slices/assetProcedureStepFieldValuesSlice.d.ts +0 -139
- package/dist/store/slices/assetProcedureStepFieldsAttachmentSlice.d.ts +0 -137
- package/dist/store/slices/assetProcedureStepFieldsSlice.d.ts +0 -228
- package/dist/store/slices/assetProcedureStepSlice.d.ts +0 -140
- package/dist/store/slices/assetProcedureTypeAttachmentSlice.d.ts +0 -48
- package/dist/store/slices/assetProcedureTypeFieldValuesAttachmentSlice.d.ts +0 -138
- package/dist/store/slices/assetProcedureTypeFieldValuesSlice.d.ts +0 -138
- package/dist/store/slices/assetProcedureTypeFieldsAttachmentSlice.d.ts +0 -137
- package/dist/store/slices/assetProcedureTypeFieldsSlice.d.ts +0 -49
- package/dist/store/slices/assetProcedureTypeSlice.d.ts +0 -49
- package/dist/store/slices/assetStageCompletionSlice.d.ts +0 -137
- package/dist/store/slices/assetStageSlice.d.ts +0 -139
- package/dist/store/slices/categorySlice.d.ts +0 -138
- package/dist/store/slices/projectFolderSlice.d.ts +0 -138
- package/dist/typings/models/categories.d.ts +0 -7
- package/dist/utils/models/projectFolders.d.ts +0 -4
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
(function(s,z){typeof exports=="object"&&typeof module<"u"?z(exports,require("@redux-offline/redux-offline/lib/types"),require("@reduxjs/toolkit"),require("superagent"),require("uuid"),require("file-saver"),require("fast-tree-builder"),require("ts-tree-lib"),require("react"),require("@redux-offline/redux-offline"),require("@redux-offline/redux-offline/lib/defaults"),require("buffer"),require("localforage"),require("redux-persist-migrate"),require("@overmap-ai/forms"),require("idb"),require("jwt-decode"),require("dependency-graph"),require("@tiptap/core")):typeof define=="function"&&define.amd?define(["exports","@redux-offline/redux-offline/lib/types","@reduxjs/toolkit","superagent","uuid","file-saver","fast-tree-builder","ts-tree-lib","react","@redux-offline/redux-offline","@redux-offline/redux-offline/lib/defaults","buffer","localforage","redux-persist-migrate","@overmap-ai/forms","idb","jwt-decode","dependency-graph","@tiptap/core"],z):(s=typeof globalThis<"u"?globalThis:s||self,z(s["overmap-core"]={},null,s.toolkit,s.request,s.uuid,s.fileSaver,s.buildTree,s.tsTreeLib,s.react,s.reduxOffline,s.offlineConfig,null,s.localforage,s.createMigration,null,s.idb,s.jwtDecode,s.dependencyGraph))})(this,function(s,z,d,Je,Xe,sy,un,Rt,iy,ay,on,eP,cy,ny,tP,ry,dy,uy){"use strict";var QF=Object.defineProperty;var xF=(s,z,d)=>z in s?QF(s,z,{enumerable:!0,configurable:!0,writable:!0,value:d}):s[z]=d;var S=(s,z,d)=>xF(s,typeof z!="symbol"?z+"":z,d);var ty;const ln=Object.freeze([]),hn=Object.freeze({}),mn=Object.freeze(new Set);var pn=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))(pn||{}),l=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(l||{}),yn=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(yn||{}),ts=(t=>(t[t.LOWEST=0]="LOWEST",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=6]="HIGH",t[t.HIGHEST=8]="HIGHEST",t))(ts||{}),ss=(t=>(t[t.BACKLOG=0]="BACKLOG",t[t.SELECTED=2]="SELECTED",t[t.DONE=4]="DONE",t))(ss||{}),E=(t=>(t.STATUS="status",t.PRIORITY="priority",t.CATEGORY="category",t.DESCRIPTION="description",t.TITLE="title",t.ASSIGNED_TO="assigned_to",t.DUE_DATE="due_date",t))(E||{});const oy=ss.BACKLOG,ly=ts.MEDIUM,An=6e4;function P(t){return{addOne:(p,y)=>{const f=t(y.payload);p.instances[f]=y.payload},addMany:(p,y)=>{for(const f of y.payload){const I=t(f);p.instances[I]=f}},setOne:(p,y)=>{const f=t(y.payload);p.instances[f]=y.payload},setMany:(p,y)=>{for(const f of y.payload){const I=t(f);p.instances[I]=f}},updateOne:(p,y)=>{const f=t(y.payload);p.instances[f]=y.payload},updateMany:(p,y)=>{for(const f of y.payload){const I=t(f);p.instances[I]=f}},deleteOne:(p,y)=>{delete p.instances[y.payload]},deleteMany:(p,y)=>{for(const f of y.payload)delete p.instances[f]},initialize:(p,y)=>{p.instances={};const f=new Set;for(const I of y.payload){const b=t(I);f.add(b),p.instances[b]=I}f.size!==y.payload.length&&console.warn("duplicate ids detected when initializing model instances.")},getInitialState:p=>({...p,instances:{}})}}function hy(){return{initializeSelection:(m,o)=>{m.selection=Array.from(new Set(o.payload))},selectOne:(m,o)=>{new Set(m.selection).has(o.payload)||m.selection.push(o.payload)},selectMany:(m,o)=>{const h=new Set(m.selection);for(const p of o.payload)h.has(p)||h.add(p);m.selection=Array.from(h)},unselectOne:(m,o)=>{const h=new Set(m.selection);h.has(o.payload)&&(h.delete(o.payload),m.selection=Array.from(h))},unselectMany:(m,o)=>{const h=new Set(m.selection);for(const p of o.payload)h.has(p)&&h.delete(p);m.selection=Array.from(h)},toggleOne:(m,o)=>{const h=new Set(m.selection);h.has(o.payload)?h.delete(o.payload):h.add(o.payload),m.selection=Array.from(h)},toggleMany:(m,o)=>{const h=new Set(m.selection);for(const p of o.payload)h.has(p)?h.delete(p):h.add(p);m.selection=Array.from(h)},getInitialState:m=>({...m,selection:[]})}}const it="versioning",g=d.createAction("RESET"),M=d.createAction("RESET_PROJECT_STATE"),_=d.createAction("RESET_ORGANIZATION_STATE");ty=Symbol.toStringTag;class fn{constructor(){S(this,ty,"Promise");S(this,"_promise");S(this,"_resolve");S(this,"_reject");S(this,"_state","pending");this._resolve=null,this._reject=null,this._promise=new Promise((e,i)=>{this._resolve=e,this._reject=i})}get state(){return this._state}then(e,i){return this._promise.then(e,i)}catch(e){return this._promise.catch(e)}resolve(e){if(!this._resolve)throw new Error("No resolve callback");this._resolve(e),this._state="fulfilled"}reject(e){if(!this._reject)throw e;this._reject(e),this._state="rejected"}finally(e){throw new Error("`finally` not implemented")}}let is=!1;["true","1"].includes("".toLowerCase())&&(is=!0);function my(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;const i=Object.keys(t),a=Object.keys(e),c=i.length;if(c!==a.length)return!1;for(let n=0;n<c;n++){const r=i[n];if(!Object.prototype.hasOwnProperty.call(e,r)||t[r]!==e[r])return!1}return!0}function as(t){const e={};return function(){const i=Array.prototype.slice.call(arguments);return i in e?(is&&console.debug(`Memoization debug: Using memorized return value for ${t.toString()}(`,i,")"),e[i]):(is&&console.debug(`Memoization debug: Cache miss! Memoizing ${t.toString()}(`,i,")"),e[i]=t.apply(this,i))}}function py(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}const T=t=>t.length===0?ln:t,vt=t=>Object.keys(t).length===0?hn:t,yy=t=>t.size===0?mn:t,Sn=as(t=>{if(!t)return"";const e=new Date(t),i=e.getFullYear()===cs.getFullYear(),a={day:"numeric",month:"short"};return i||(a.year="numeric"),e.toLocaleDateString([],a)}),Ay=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),fy=1e3*86400,cs=new Date,Sy=t=>new Date(t).toDateString()===cs.toDateString(),Ty=as((t,e,i)=>{const a=Math.round((new Date(t).getTime()-cs.getTime())/fy);return a<e||a>i?Sn(t):Ay.format(a,"days")});function gy(t){return new Uint8Array(t).reduce((i,a)=>i+a.toString(16).padStart(2,"0"),"")}const ns=async(t,e)=>{e||(e=await Qe(t));let i=t.type;if(i.includes("/")&&(i=i.split("/")[1]),!i)throw new Error(`Could not extract file type from ${t.type}`);return`${e}.${i}`};function Qe(t){return new Promise((e,i)=>{const a=new FileReader;a.onload=()=>{const c=a.result;if(!c){i(new Error("FileReader did not return a valid ArrayBuffer."));return}crypto.subtle.digest("SHA-1",c).then(n=>{const r=gy(n);e(r)})},a.readAsArrayBuffer(t)})}function Iy(t){if(!t.name||!t.type||!t.size){const e="File has no name, type, and/or size";throw new Error(e)}return`${t.name}&${t.type}${t.size}`}function Tn(t,e){return new File([t],e,{type:t.type})}function by(t,e){const i=document.createElement("a");i.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(e)),i.setAttribute("download",t),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)}const Fy=async t=>{const e={};for(const i of t){const a=await Qe(i);e[a]={sha1:a,extension:i.name.split(".").pop()||"",file_type:i.type,size:i.size}}return Object.values(e)},gn=async t=>(await fetch(t)).blob(),Py=t=>new Promise((e,i)=>{const a=new FileReader;a.onloadend=()=>{var c;e(((c=a.result)==null?void 0:c.toString())||"")},a.readAsDataURL(t)});function _y(t){const e=new Blob([t]);sy.saveAs(e,t.name)}const In={};function Oy(t,e,i,...a){const c=In[t];let n=!1;c?c[e]||(c[e]=!0,n=!0):(In[t]={[e]:!0},n=!0),n&&console[i](...a)}const bn=["created_at","updated_at","index","revision"];function F(t){return{...t,uuid:Xe.v4()}}function Fn(t){const e={};for(const i of t)e[i.uuid]=i;return e}function Pn(t){return t.map(({uuid:e})=>e)}function Ry(t,e=void 0,i=255){let a=t.replace(/[^a-z0-9_\-.]/gi,"_").replace(/_{2,}/g,"_");if(!e){const n=t.split(".");n.length>1&&(e=n[n.length-1])}e&&!e.startsWith(".")&&(e="."+e);const c=e?e.length:0;return a.length+c>i&&(a=a.slice(0,i-c)+(e||"")),a}function vy(t){return t.toLowerCase().replace(" ","-")}function wy(t,e=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,e?"_":"-")}function My(t,e){if(t.length<=e)return t;const i=t.slice(0,e-1);return i.slice(0,i.lastIndexOf(" "))+"…"}const A=t=>e=>i=>t(i,e);function _n(t,e,i){return i.findIndex(a=>a.uuid===t.uuid)===e}function Ey(t,e,i){return i.findIndex(a=>a.file_sha1===t.file_sha1)===e}const jy=/^.+@.+\..+$/;function v(t){const e={...t};for(const i of[...bn,"created_by"])i in e&&delete e[i];return e}const On=t=>{const e=t.toSorted((i,a)=>i.order-a.order);return un(e,{id:i=>i.uuid,parentId:i=>i.parent,includeEmptyChildrenArray:!0,valueKey:!1})},Vy=t=>{const{roots:e}=On(t);return e.map(i=>new Rt.Tree(i))},Rn=(t,e)=>{const{nodes:i}=On(e),a=i.get(t);if(!a)throw new Error(`Node with uuid ${t} does not exist in asset procedure step tree.`);return new Rt.Tree(a)},vn=t=>{const e=t.toSorted((i,a)=>i.name.localeCompare(a.name));return un(e,{id:i=>i.uuid,parentId:i=>i.parent,includeEmptyChildrenArray:!0,valueKey:!1})},qy=t=>{const{roots:e}=vn(t);return e.map(i=>new Rt.Tree(i))},zy=(t,e)=>{const{nodes:i}=vn(e),a=i.get(t);if(!a)throw new Error(`Node with uuid ${t} does not exist in project folder tree.`);return new Rt.Tree(a)},C=P(t=>t.uuid),wn=C.getInitialState({}),rs=d.createSlice({name:"agents",initialState:wn,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,wn)),reducers:{initializeConversations:C.initialize,addConversation:C.addOne,addConversations:C.addMany,setConversation:C.setOne,setConversations:C.setMany,updateConversation:C.updateOne,updateConversations:C.updateMany,deleteConversation:C.deleteOne,deleteConversations:C.deleteMany}}),{initializeConversations:Mn,addConversation:En,addConversations:Dy,setConversation:jn,setConversations:Uy,updateConversation:Vn,updateConversations:Cy,deleteConversation:ky,deleteConversations:By}=rs.actions,ds=t=>t.agentsReducer.instances,$y=d.createSelector([ds],t=>Object.values(t)),Gy=A(d.createSelector([ds,(t,e)=>e],(t,e)=>t[e])),qn=rs.reducer,k=P(t=>t.uuid),zn=k.getInitialState({}),us=d.createSlice({name:"assetAttachments",initialState:zn,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,zn)),reducers:{initializeAssetAttachments:k.initialize,addAssetAttachment:k.addOne,addAssetAttachments:k.addMany,setAssetAttachment:k.setOne,setAssetAttachments:k.setMany,updateAssetAttachment:k.updateOne,updateAssetAttachments:k.updateMany,deleteAssetAttachment:k.deleteOne,deleteAssetAttachments:k.deleteMany}}),{initializeAssetAttachments:os,addAssetAttachment:Ly,addAssetAttachments:ls,setAssetAttachment:Dn,setAssetAttachments:Ny,updateAssetAttachment:Hy,updateAssetAttachments:Un,deleteAssetAttachment:Cn,deleteAssetAttachments:hs}=us.actions,kn=t=>t.assetAttachmentReducer.instances,Bn=d.createSelector([kn],t=>Object.values(t)),$n=t=>e=>e.assetAttachmentReducer.instances[t],Gn=A(d.createSelector([Bn,(t,e)=>e],(t,e)=>T(t.filter(({asset:i})=>e===i)))),Ln=us.reducer,B=P(({uuid:t})=>t),Nn=B.getInitialState({}),ms=d.createSlice({name:"assetProcedureTypeAttachments",initialState:Nn,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Nn)),reducers:{initializeAssetProcedureTypeAttachments:B.initialize,addAssetProcedureTypeAttachment:B.addOne,addAssetProcedureTypeAttachments:B.addMany,setAssetProcedureTypeAttachment:B.setOne,setAssetProcedureTypeAttachments:B.setMany,updateAssetProcedureTypeAttachment:B.updateOne,updateAssetProcedureTypeAttachments:B.updateMany,deleteAssetProcedureTypeAttachment:B.deleteOne,deleteAssetProcedureTypeAttachments:B.deleteMany}}),{initializeAssetProcedureTypeAttachments:ps,addAssetProcedureTypeAttachment:Wy,addAssetProcedureTypeAttachments:Hn,setAssetProcedureTypeAttachment:Wn,setAssetProcedureTypeAttachments:Ky,updateAssetProcedureTypeAttachment:Yy,updateAssetProcedureTypeAttachments:Kn,deleteAssetProcedureTypeAttachment:Yn,deleteAssetProcedureTypeAttachments:Zn}=ms.actions,Jn=ms.reducer,Xn=t=>t.assetProcedureTypeAttachmentReducer.instances,Qn=d.createSelector([Xn],t=>Object.values(t)),xn=t=>e=>e.assetProcedureTypeAttachmentReducer.instances[t],Zy=A(d.createSelector([Qn,(t,e)=>e],(t,e)=>T(t.filter(({asset_procedure_type:i})=>e===i)))),$=P(({uuid:t})=>t),er=$.getInitialState({}),ys=d.createSlice({name:"assetProcedureTypeFieldsAttachments",initialState:er,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,er)),reducers:{initializeAssetProcedureTypeFieldsAttachments:$.initialize,addAssetProcedureTypeFieldsAttachment:$.addOne,addAssetProcedureTypeFieldsAttachments:$.addMany,setAssetProcedureTypeFieldsAttachment:$.setOne,setAssetProcedureTypeFieldsAttachments:$.setMany,updateAssetProcedureTypeFieldsAttachment:$.updateOne,updateAssetProcedureTypeFieldsAttachments:$.updateMany,deleteAssetProcedureTypeFieldsAttachment:$.deleteOne,deleteAssetProcedureTypeFieldsAttachments:$.deleteMany}}),{initializeAssetProcedureTypeFieldsAttachments:tr,addAssetProcedureTypeFieldsAttachment:Jy,addAssetProcedureTypeFieldsAttachments:sr,setAssetProcedureTypeFieldsAttachment:Xy,setAssetProcedureTypeFieldsAttachments:Qy,updateAssetProcedureTypeFieldsAttachment:xy,updateAssetProcedureTypeFieldsAttachments:ir,deleteAssetProcedureTypeFieldsAttachment:eA,deleteAssetProcedureTypeFieldsAttachments:ar}=ys.actions,cr=ys.reducer,nr=t=>t.assetProcedureTypeFieldsAttachmentReducer.instances,rr=d.createSelector([nr],t=>Object.values(t)),tA=A(d.createSelector([rr,(t,e)=>e],(t,e)=>T(t.filter(i=>i.fields_revision===e)))),sA=t=>e=>e.assetProcedureTypeFieldsAttachmentReducer.instances[t],G=P(({uuid:t})=>t),dr=G.getInitialState({}),As=d.createSlice({name:"assetProcedureTypeFields",initialState:dr,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,dr)),reducers:{initializeAssetProcedureTypeFields:G.initialize,addAssetProcedureTypeFields:G.addOne,addAssetProcedureTypeFieldsMany:G.addMany,setAssetProcedureTypeFields:G.setOne,setAssetProcedureTypeFieldsMany:G.setMany,updateAssetProcedureTypeFields:G.updateOne,updateAssetProcedureTypeFieldsMany:G.updateMany,deleteAssetProcedureTypeFields:G.deleteOne,deleteAssetProcedureTypeFieldsMany:G.deleteMany}}),{initializeAssetProcedureTypeFields:ur,addAssetProcedureTypeFields:or,addAssetProcedureTypeFieldsMany:iA,setAssetProcedureTypeFields:aA,setAssetProcedureTypeFieldsMany:cA,updateAssetProcedureTypeFields:lr,updateAssetProcedureTypeFieldsMany:nA,deleteAssetProcedureTypeFields:hr,deleteAssetProcedureTypeFieldsMany:rA}=As.actions,mr=As.reducer,pr=t=>t.assetProcedureTypeFieldsReducer.instances,fs=d.createSelector([pr],t=>Object.values(t)),dA=A(d.createSelector([fs,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_type===e)))),uA=A(d.createSelector([fs,(t,e)=>e],(t,e)=>t.filter(i=>i.asset_procedure_type===e).sort((i,a)=>i.submitted_at>a.submitted_at?-1:1)[0])),oA=t=>e=>e.assetProcedureTypeFieldsReducer.instances[t],L=P(({uuid:t})=>t),yr=L.getInitialState({}),Ss=d.createSlice({name:"assetProcedureTypeFieldValuesAttachments",initialState:yr,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,yr)),reducers:{initializeAssetProcedureTypeFieldValuesAttachments:L.initialize,addAssetProcedureTypeFieldValuesAttachment:L.addOne,addAssetProcedureTypeFieldValuesAttachments:L.addMany,setAssetProcedureTypeFieldValuesAttachment:L.setOne,setAssetProcedureTypeFieldValuesAttachments:L.setMany,updateAssetProcedureTypeFieldValuesAttachment:L.updateOne,updateAssetProcedureTypeFieldValuesAttachments:L.updateMany,deleteAssetProcedureTypeFieldValuesAttachment:L.deleteOne,deleteAssetProcedureTypeFieldValuesAttachments:L.deleteMany}}),{initializeAssetProcedureTypeFieldValuesAttachments:Ar,addAssetProcedureTypeFieldValuesAttachment:lA,addAssetProcedureTypeFieldValuesAttachments:wt,setAssetProcedureTypeFieldValuesAttachment:hA,setAssetProcedureTypeFieldValuesAttachments:mA,updateAssetProcedureTypeFieldValuesAttachment:pA,updateAssetProcedureTypeFieldValuesAttachments:fr,deleteAssetProcedureTypeFieldValuesAttachment:yA,deleteAssetProcedureTypeFieldValuesAttachments:Mt}=Ss.actions,Sr=Ss.reducer,Ts=t=>t.assetProcedureTypeFieldValuesAttachmentReducer.instances,Tr=d.createSelector([Ts],t=>Object.values(t)),AA=t=>e=>e.assetProcedureTypeFieldValuesAttachmentReducer.instances[t],gr=A(d.createSelector([Ts,(t,e)=>e],(t,e)=>{const i=new Set(e);return T(Object.values(t).filter(a=>i.has(a.uuid)))})),Ir=A(d.createSelector([Tr,(t,e)=>e],(t,e)=>T(t.filter(i=>i.field_values===e)))),N=P(({uuid:t})=>t),br=N.getInitialState({}),gs=d.createSlice({name:"assetProcedureTypeFieldValues",initialState:br,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,br)),reducers:{initializeAssetProcedureTypeFieldValues:N.initialize,addAssetProcedureTypeFieldValues:N.addOne,addAssetProcedureTypeFieldValuesMany:N.addMany,setAssetProcedureTypeFieldValues:N.setOne,setAssetProcedureTypeFieldValuesMany:N.setMany,updateAssetProcedureTypeFieldValues:N.updateOne,updateAssetProcedureTypeFieldValuesMany:N.updateMany,deleteAssetProcedureTypeFieldValues:N.deleteOne,deleteAssetProcedureTypeFieldValuesMany:N.deleteMany}}),{initializeAssetProcedureTypeFieldValues:Fr,addAssetProcedureTypeFieldValues:Is,addAssetProcedureTypeFieldValuesMany:Pr,setAssetProcedureTypeFieldValues:fA,setAssetProcedureTypeFieldValuesMany:SA,updateAssetProcedureTypeFieldValues:at,updateAssetProcedureTypeFieldValuesMany:_r,deleteAssetProcedureTypeFieldValues:bs,deleteAssetProcedureTypeFieldValuesMany:Or}=gs.actions,Rr=gs.reducer,vr=t=>t.assetProcedureFieldValuesReducer.instances,Fs=d.createSelector([vr],t=>Object.values(t)),TA=A(d.createSelector([Fs,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset===e)))),gA=A(d.createSelector([Fs,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure===e)))),Ps=t=>e=>e.assetProcedureFieldValuesReducer.instances[t],H=P(({uuid:t})=>t),wr=H.getInitialState({}),_s=d.createSlice({name:"assetProcedures",initialState:wr,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,wr)),reducers:{initializeAssetProcedures:H.initialize,addAssetProcedure:H.addOne,addAssetProcedures:H.addMany,setAssetProcedure:H.setOne,setAssetProcedures:H.setMany,updateAssetProcedure:H.updateOne,updateAssetProcedures:H.updateMany,deleteAssetProcedure:H.deleteOne,deleteAssetProcedures:H.deleteMany}}),{initializeAssetProcedures:Mr,addAssetProcedure:Os,addAssetProcedures:Er,updateAssetProcedure:ct,updateAssetProcedures:IA,deleteAssetProcedure:Rs,deleteAssetProcedures:jr,setAssetProcedure:bA,setAssetProcedures:FA}=_s.actions,Vr=_s.reducer,vs=t=>t.assetProcedureReducer.instances,ws=d.createSelector([vs],t=>Object.values(t)),qr=A(d.createSelector([ws,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_type===e)))),PA=A(d.createSelector([ws,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_type===e)))),Ms=t=>e=>e.assetProcedureReducer.instances[t],_A=A(d.createSelector([vs,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c&&i.push(c)}return T(i)})),W=P(t=>t.uuid),zr=W.getInitialState({}),Es=d.createSlice({name:"assetProcedureTypes",initialState:zr,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,zr)),reducers:{initializeAssetProcedureTypes:W.initialize,addAssetProcedureType:W.addOne,addAssetProcedureTypes:W.addMany,setAssetProcedureType:W.setOne,setAssetProcedureTypes:W.setMany,updateAssetProcedureType:W.updateOne,updateAssetProcedureTypes:W.updateMany,deleteAssetProcedureType:W.deleteOne,deleteAssetProcedureTypes:W.deleteMany}}),{initializeAssetProcedureTypes:Dr,addAssetProcedureType:js,addAssetProcedureTypes:OA,updateAssetProcedureType:nt,updateAssetProcedureTypes:RA,deleteAssetProcedureType:Vs,deleteAssetProcedureTypes:vA,setAssetProcedureType:wA,setAssetProcedureTypes:MA}=Es.actions,Ur=Es.reducer,qs=t=>t.assetProcedureTypeReducer.instances,Cr=d.createSelector([qs],t=>Object.values(t)),zs=t=>e=>e.assetProcedureTypeReducer.instances[t],EA=A(d.createSelector([qs,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c&&i.push(c)}return T(i)})),jA=A(d.createSelector([Cr,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),K=P(t=>t.uuid),kr=K.getInitialState({}),Ds=d.createSlice({name:"assetProcedureStepFieldsAttachments",initialState:kr,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,kr)),reducers:{initializeAssetProcedureStepFieldsAttachments:K.initialize,addAssetProcedureStepFieldsAttachment:K.addOne,addAssetProcedureStepFieldsAttachments:K.addMany,setAssetProcedureStepFieldsAttachment:K.setOne,setAssetProcedureStepFieldsAttachments:K.setMany,updateAssetProcedureStepFieldsAttachment:K.updateOne,updateAssetProcedureStepFieldsAttachments:K.updateMany,deleteAssetProcedureStepFieldsAttachment:K.deleteOne,deleteAssetProcedureStepFieldsAttachments:K.deleteMany}}),{initializeAssetProcedureStepFieldsAttachments:Br,addAssetProcedureStepFieldsAttachment:VA,addAssetProcedureStepFieldsAttachments:$r,setAssetProcedureStepFieldsAttachment:qA,setAssetProcedureStepFieldsAttachments:zA,updateAssetProcedureStepFieldsAttachment:DA,updateAssetProcedureStepFieldsAttachments:Gr,deleteAssetProcedureStepFieldsAttachment:UA,deleteAssetProcedureStepFieldsAttachments:Lr}=Ds.actions,Nr=t=>t.assetProcedureStepFieldsAttachmentReducer.instances,Hr=d.createSelector([Nr],t=>Object.values(t)),CA=A(d.createSelector([Hr,(t,e)=>e],(t,e)=>T(t.filter(i=>i.fields_revision===e)))),kA=t=>e=>e.assetProcedureStepFieldsAttachmentReducer.instances[t],Wr=Ds.reducer,Y=P(t=>t.uuid),Kr=Y.getInitialState({}),Us=d.createSlice({name:"assetProcedureStepFields",initialState:Kr,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Kr)),reducers:{initializeAssetProcedureStepFields:Y.initialize,addAssetProcedureStepFields:Y.addOne,addAssetProcedureStepFieldsMany:Y.addMany,setAssetProcedureStepFields:Y.setOne,setAssetProcedureStepFieldsMany:Y.setMany,updateAssetProcedureStepFields:Y.updateOne,updateAssetProcedureStepFieldsMany:Y.updateMany,deleteAssetProcedureStepFields:Y.deleteOne,deleteAssetProcedureStepFieldsMany:Y.deleteMany}}),{initializeAssetProcedureStepFields:Yr,addAssetProcedureStepFields:Cs,addAssetProcedureStepFieldsMany:BA,setAssetProcedureStepFields:$A,setAssetProcedureStepFieldsMany:GA,updateAssetProcedureStepFields:rt,updateAssetProcedureStepFieldsMany:LA,deleteAssetProcedureStepFields:ks,deleteAssetProcedureStepFieldsMany:NA}=Us.actions,Bs=t=>t.assetProcedureStepFieldsReducer.instances,$s=d.createSelector([Bs],t=>Object.values(t)),HA=A(d.createSelector([$s,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_step===e)))),WA=A(d.createSelector([$s,(t,e)=>e],(t,e)=>t.filter(i=>i.asset_procedure_step===e).sort((i,a)=>i.submitted_at>a.submitted_at?-1:1)[0])),KA=d.createSelector([Bs],t=>{const e={};for(const i of Object.values(t)){const a=e[i.asset_procedure_step];(!a||a.submitted_at<i.submitted_at)&&(e[i.asset_procedure_step]=i)}return e}),YA=t=>e=>e.assetProcedureStepFieldsReducer.instances[t],Zr=Us.reducer,Z=P(t=>t.uuid),Jr=Z.getInitialState({}),Gs=d.createSlice({name:"assetProcedureStepFieldValuesAttachments",initialState:Jr,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,Jr)),reducers:{initializeAssetProcedureStepFieldValuesAttachments:Z.initialize,addAssetProcedureStepFieldValuesAttachment:Z.addOne,addAssetProcedureStepFieldValuesAttachments:Z.addMany,setAssetProcedureStepFieldValuesAttachment:Z.setOne,setAssetProcedureStepFieldValuesAttachments:Z.setMany,updateAssetProcedureStepFieldValuesAttachment:Z.updateOne,updateAssetProcedureStepFieldValuesAttachments:Z.updateMany,deleteAssetProcedureStepFieldValuesAttachment:Z.deleteOne,deleteAssetProcedureStepFieldValuesAttachments:Z.deleteMany}}),{initializeAssetProcedureStepFieldValuesAttachments:Xr,addAssetProcedureStepFieldValuesAttachment:ZA,addAssetProcedureStepFieldValuesAttachments:Et,setAssetProcedureStepFieldValuesAttachment:JA,setAssetProcedureStepFieldValuesAttachments:XA,updateAssetProcedureStepFieldValuesAttachment:QA,updateAssetProcedureStepFieldValuesAttachments:Qr,deleteAssetProcedureStepFieldValuesAttachment:xA,deleteAssetProcedureStepFieldValuesAttachments:jt}=Gs.actions,Ls=t=>t.assetProcedureStepFieldValuesAttachmentReducer.instances,xr=d.createSelector([Ls],t=>Object.values(t)),ef=t=>e=>e.assetProcedureStepFieldValuesAttachmentReducer.instances[t],ed=A(d.createSelector([Ls,(t,e)=>e],(t,e)=>{const i=new Set(e);return T(Object.values(t).filter(a=>i.has(a.uuid)))})),td=A(d.createSelector([xr,(t,e)=>e],(t,e)=>T(t.filter(i=>i.field_values===e)))),sd=Gs.reducer,J=P(t=>t.uuid),id=J.getInitialState({}),Ns=d.createSlice({name:"assetProcedureStepFieldValues",initialState:id,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,id)),reducers:{initializeAssetProcedureStepFieldValues:J.initialize,addAssetProcedureStepFieldValues:J.addOne,addAssetProcedureStepFieldValuesMany:J.addMany,setAssetProcedureStepFieldValues:J.setOne,setAssetProcedureStepFieldValuesMany:J.setMany,updateAssetProcedureStepFieldValues:J.updateOne,updateAssetProcedureStepFieldValuesMany:J.updateMany,deleteAssetProcedureStepFieldValues:J.deleteOne,deleteAssetProcedureStepFieldValuesMany:J.deleteMany}}),{initializeAssetProcedureStepFieldValues:ad,addAssetProcedureStepFieldValues:Hs,addAssetProcedureStepFieldValuesMany:cd,setAssetProcedureStepFieldValues:tf,setAssetProcedureStepFieldValuesMany:sf,updateAssetProcedureStepFieldValues:dt,updateAssetProcedureStepFieldValuesMany:nd,deleteAssetProcedureStepFieldValues:Ws,deleteAssetProcedureStepFieldValuesMany:rd}=Ns.actions,dd=t=>t.assetProcedureStepFieldValuesReducer.instances,Vt=d.createSelector([dd],t=>Object.values(t)),af=A(d.createSelector([Vt,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset===e)))),cf=A(d.createSelector([Vt,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure===e)))),nf=A(d.createSelector([Vt,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_step===e)))),Ks=t=>e=>e.assetProcedureStepFieldValuesReducer.instances[t],ud=Ns.reducer,X=P(t=>t.uuid),od=X.getInitialState({}),Ys=d.createSlice({name:"assetProcedureSteps",initialState:od,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,od)),reducers:{initializeAssetProcedureSteps:X.initialize,setAssetProcedureStep:X.setOne,setAssetProcedureSteps:X.setMany,addAssetProcedureStep:X.addOne,addAssetProcedureSteps:X.addMany,updateAssetProcedureStep:X.updateOne,updateAssetProcedureSteps:X.updateMany,deleteAssetProcedureStep:X.deleteOne,deleteAssetProcedureSteps:X.deleteMany}}),{initializeAssetProcedureSteps:ld,setAssetProcedureStep:hd,setAssetProcedureSteps:rf,addAssetProcedureStep:md,addAssetProcedureSteps:pd,updateAssetProcedureStep:qt,updateAssetProcedureSteps:df,deleteAssetProcedureStep:yd,deleteAssetProcedureSteps:Ad}=Ys.actions,fd=Ys.reducer,ut=t=>t.assetProcedureStepReducer.instances,Zs=t=>e=>e.assetProcedureStepReducer.instances[t],Sd=d.createSelector([ut],t=>Object.values(t)),uf=A(d.createSelector([ut,(t,e)=>e],(t,e)=>{const i={};for(const[a,c]of Object.entries(t))c.asset_procedure_type===e&&(i[a]=c);return vt(i)})),of=A(d.createSelector([Sd,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_type===e)))),lf=A(d.createSelector([ut,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c?i.push(c):console.warn("selectAssetProcedureStepsByIds: No step exists with the id",a)}return T(i)})),Td=A(d.createSelector([ut,(t,e)=>e],(t,e)=>{if(!t[e])return T([]);const c=Rn(e,Object.values(t)).all().map(({model:n})=>n);return T(c)})),Q=P(t=>t.uuid),gd=Q.getInitialState({}),Js=d.createSlice({name:"assets",initialState:gd,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,gd)),reducers:{initializeAssets:Q.initialize,addAsset:Q.addOne,addAssets:Q.addMany,setAsset:Q.setOne,setAssets:Q.setMany,updateAsset:Q.updateOne,updateAssets:Q.updateMany,deleteAsset:Q.deleteOne,deleteAssets:Q.deleteMany}}),{initializeAssets:Id,addAsset:Xs,addAssets:zt,updateAsset:ot,updateAssets:hf,deleteAsset:Qs,deleteAssets:xs,setAsset:mf,setAssets:pf}=Js.actions,ei=t=>t.assetReducer.instances,bd=d.createSelector([ei],t=>T(Object.values(t))),ti=A(d.createSelector([bd,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_type===e)))),si=t=>e=>e.assetReducer.instances[t],Fd=A(d.createSelector([ei,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c&&i.push(c)}return T(i)})),yf=t=>e=>ti(t)(e).length,Pd=Js.reducer,x=P(t=>t.uuid),_d=x.getInitialState({}),ii=d.createSlice({name:"assetStageCompletions",initialState:_d,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,_d)),reducers:{initializeAssetStageCompletions:x.initialize,addAssetStageCompletion:x.addOne,addAssetStageCompletions:x.addMany,setAssetStageCompletion:x.setOne,setAssetStageCompletions:x.setMany,updateAssetStageCompletion:x.updateOne,updateAssetStageCompletions:x.updateMany,deleteAssetStageCompletion:x.deleteOne,deleteAssetStageCompletions:x.deleteMany}}),{initializeAssetStageCompletions:Od,addAssetStageCompletion:ai,addAssetStageCompletions:ci,setAssetStageCompletion:Af,setAssetStageCompletions:ff,updateAssetStageCompletion:Rd,updateAssetStageCompletions:vd,deleteAssetStageCompletion:ni,deleteAssetStageCompletions:ri}=ii.actions,wd=ii.reducer,di=t=>t.assetStageCompletionReducer.instances,Sf=d.createSelector([di],t=>Object.values(t)),Md=t=>e=>e.assetStageCompletionReducer.instances[t],Ed=A(d.createSelector([di,(t,e)=>e],(t,e)=>{const i=new Set(e);return T(Object.values(t).filter(a=>i.has(a.uuid)))})),ee=P(t=>t.uuid),jd=ee.getInitialState({}),ui=d.createSlice({name:"assetStages",initialState:jd,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,jd)),reducers:{initializeAssetStages:ee.initialize,setAssetStage:ee.setOne,setAssetStages:ee.setMany,addAssetStage:ee.addOne,addAssetStages:ee.addMany,updateAssetStage:ee.updateOne,updateAssetStages:ee.updateMany,deleteAssetStage:ee.deleteOne,deleteAssetStages:ee.deleteMany}}),{initializeAssetStages:Vd,setAssetStage:qd,setAssetStages:Tf,addAssetStage:oi,addAssetStages:gf,updateAssetStage:Dt,updateAssetStages:If,deleteAssetStage:li,deleteAssetStages:bf}=ui.actions,zd=ui.reducer,Ut=t=>t.assetStageReducer.instances,hi=t=>e=>e.assetStageReducer.instances[t],Dd=d.createSelector([Ut],t=>Object.values(t)),Ff=A(d.createSelector([Ut,(t,e)=>e],(t,e)=>{const i={};for(const[a,c]of Object.entries(t))c.asset_procedure_type===e&&(i[a]=c);return vt(i)})),Pf=A(d.createSelector([Dd,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_type===e)))),_f=A(d.createSelector([Ut,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c?i.push(c):console.warn("selectStagesFromStageIds: No stage exists with the id",a)}return T(i)})),te=P(t=>t.uuid),Ud=te.getInitialState({}),mi=d.createSlice({name:"assetTypeAttachments",initialState:Ud,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Ud)),reducers:{initializeAssetTypeAttachments:te.initialize,addAssetTypeAttachment:te.addOne,addAssetTypeAttachments:te.addMany,setAssetTypeAttachment:te.setOne,setAssetTypeAttachments:te.setMany,updateAssetTypeAttachment:te.updateOne,updateAssetTypeAttachments:te.updateMany,deleteAssetTypeAttachment:te.deleteOne,deleteAssetTypeAttachments:te.deleteMany}}),{initializeAssetTypeAttachments:pi,addAssetTypeAttachment:Of,addAssetTypeAttachments:yi,setAssetTypeAttachment:Cd,setAssetTypeAttachments:Rf,updateAssetTypeAttachment:vf,updateAssetTypeAttachments:kd,deleteAssetTypeAttachment:Bd,deleteAssetTypeAttachments:Ai}=mi.actions,$d=t=>t.assetTypeAttachmentReducer.instances,Gd=d.createSelector([$d],t=>Object.values(t)),Ld=t=>e=>e.assetTypeAttachmentReducer.instances[t],Nd=A(d.createSelector([Gd,(t,e)=>e],(t,e)=>T(t.filter(({asset_type:i})=>e===i)))),Hd=mi.reducer,se=P(t=>t.uuid),Wd=se.getInitialState({}),fi=d.createSlice({name:"assetTypeFieldsAttachments",initialState:Wd,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Wd)),reducers:{initializeAssetTypeFieldsAttachments:se.initialize,addAssetTypeFieldsAttachment:se.addOne,addAssetTypeFieldsAttachments:se.addMany,setAssetTypeFieldsAttachment:se.setOne,setAssetTypeFieldsAttachments:se.setMany,updateAssetTypeFieldsAttachment:se.updateOne,updateAssetTypeFieldsAttachments:se.updateMany,deleteAssetTypeFieldsAttachment:se.deleteOne,deleteAssetTypeFieldsAttachments:se.deleteMany}}),{initializeAssetTypeFieldsAttachments:Kd,addAssetTypeFieldsAttachment:wf,addAssetTypeFieldsAttachments:Yd,setAssetTypeFieldsAttachment:Mf,setAssetTypeFieldsAttachments:Ef,updateAssetTypeFieldsAttachment:jf,updateAssetTypeFieldsAttachments:Zd,deleteAssetTypeFieldsAttachment:Vf,deleteAssetTypeFieldsAttachments:Jd}=fi.actions,Xd=t=>t.assetTypeFieldsAttachmentReducer.instances,Qd=d.createSelector([Xd],t=>Object.values(t)),qf=A(d.createSelector([Qd,(t,e)=>e],(t,e)=>T(t.filter(i=>i.fields_revision===e)))),zf=t=>e=>e.assetTypeFieldsAttachmentReducer.instances[t],xd=fi.reducer,ie=P(t=>t.uuid),eu=ie.getInitialState({}),Si=d.createSlice({name:"assetTypeFields",initialState:eu,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,eu)),reducers:{initializeAssetTypeFields:ie.initialize,addAssetTypeFields:ie.addOne,addAssetTypeFieldsMany:ie.addMany,setAssetTypeFields:ie.setOne,setAssetTypeFieldsMany:ie.setMany,updateAssetTypeFields:ie.updateOne,updateAssetTypeFieldsMany:ie.updateMany,deleteAssetTypeFields:ie.deleteOne,deleteAssetTypeFieldsMany:ie.deleteMany}}),{initializeAssetTypeFields:tu,addAssetTypeFields:su,addAssetTypeFieldsMany:Df,setAssetTypeFields:Uf,setAssetTypeFieldsMany:Cf,updateAssetTypeFields:iu,updateAssetTypeFieldsMany:kf,deleteAssetTypeFields:au,deleteAssetTypeFieldsMany:Bf}=Si.actions,cu=t=>t.assetTypeFieldsReducer.instances,Ct=d.createSelector([cu],t=>Object.values(t)),$f=A(d.createSelector([Ct,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_type===e)))),Gf=A(d.createSelector([Ct,(t,e)=>e],(t,e)=>t.filter(i=>i.asset_type===e).sort((i,a)=>i.submitted_at>a.submitted_at?-1:1)[0])),Lf=t=>e=>e.assetTypeFieldsReducer.instances[t],nu=Si.reducer,ae=P(t=>t.uuid),ru=ae.getInitialState({}),Ti=d.createSlice({name:"assetTypeFieldValuesAttachments",initialState:ru,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,ru)),reducers:{initializeAssetTypeFieldValuesAttachments:ae.initialize,addAssetTypeFieldValuesAttachment:ae.addOne,addAssetTypeFieldValuesAttachments:ae.addMany,setAssetTypeFieldValuesAttachment:ae.setOne,setAssetTypeFieldValuesAttachments:ae.setMany,updateAssetTypeFieldValuesAttachment:ae.updateOne,updateAssetTypeFieldValuesAttachments:ae.updateMany,deleteAssetTypeFieldValuesAttachment:ae.deleteOne,deleteAssetTypeFieldValuesAttachments:ae.deleteMany}}),{initializeAssetTypeFieldValuesAttachments:du,addAssetTypeFieldValuesAttachment:Nf,addAssetTypeFieldValuesAttachments:kt,setAssetTypeFieldValuesAttachment:Hf,setAssetTypeFieldValuesAttachments:Wf,updateAssetTypeFieldValuesAttachment:Kf,updateAssetTypeFieldValuesAttachments:uu,deleteAssetTypeFieldValuesAttachment:Yf,deleteAssetTypeFieldValuesAttachments:Bt}=Ti.actions,gi=t=>t.assetTypeFieldValuesAttachmentReducer.instances,ou=d.createSelector([gi],t=>Object.values(t)),Zf=t=>e=>e.assetTypeFieldValuesAttachmentReducer.instances[t],lu=A(d.createSelector([gi,(t,e)=>e],(t,e)=>{const i=new Set(e);return T(Object.values(t).filter(a=>i.has(a.uuid)))})),hu=A(d.createSelector([ou,(t,e)=>e],(t,e)=>T(t.filter(i=>i.field_values===e)))),mu=Ti.reducer,ce=P(t=>t.uuid),pu=ce.getInitialState({}),Ii=d.createSlice({name:"assetTypeFieldValues",initialState:pu,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,pu)),reducers:{initializeAssetTypeFieldValues:ce.initialize,addAssetTypeFieldValues:ce.addOne,addAssetTypeFieldValuesMany:ce.addMany,setAssetTypeFieldValues:ce.setOne,setAssetTypeFieldValuesMany:ce.setMany,updateAssetTypeFieldValues:ce.updateOne,updateAssetTypeFieldValuesMany:ce.updateMany,deleteAssetTypeFieldValues:ce.deleteOne,deleteAssetTypeFieldValuesMany:ce.deleteMany}}),{initializeAssetTypeFieldValues:yu,addAssetTypeFieldValues:bi,addAssetTypeFieldValuesMany:Au,setAssetTypeFieldValues:Jf,setAssetTypeFieldValuesMany:Xf,updateAssetTypeFieldValues:lt,updateAssetTypeFieldValuesMany:fu,deleteAssetTypeFieldValues:Fi,deleteAssetTypeFieldValuesMany:Su}=Ii.actions,Tu=t=>t.assetTypeFieldValuesReducer.instances,Pi=d.createSelector([Tu],t=>Object.values(t)),Qf=A(d.createSelector([Pi,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset===e)))),xf=A(d.createSelector([Ct,Pi,(t,e)=>e],(t,e,i)=>{const a=new Set(t.filter(c=>c.asset_type===i).map(c=>c.uuid));return T(e.filter(c=>a.has(c.fields_revision)))})),_i=t=>e=>e.assetTypeFieldValuesReducer.instances[t],gu=Ii.reducer,ne=P(t=>t.uuid),Iu=ne.getInitialState({}),Oi=d.createSlice({name:"assetTypeIdentifiers",initialState:Iu,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Iu)),reducers:{initializeAssetTypeIdentifiers:ne.initialize,addAssetTypeIdentifier:ne.addOne,addAssetTypeIdentifiers:ne.addMany,setAssetTypeIdentifier:ne.setOne,setAssetTypeIdentifiers:ne.setMany,updateAssetTypeIdentifier:ne.updateOne,updateAssetTypeIdentifiers:ne.updateMany,deleteAssetTypeIdentifier:ne.deleteOne,deleteAssetTypeIdentifiers:ne.deleteMany}}),{initializeAssetTypeIdentifiers:bu,addAssetTypeIdentifier:Ri,addAssetTypeIdentifiers:eS,setAssetTypeIdentifier:tS,setAssetTypeIdentifiers:sS,updateAssetTypeIdentifier:ht,updateAssetTypeIdentifiers:iS,deleteAssetTypeIdentifier:vi,deleteAssetTypeIdentifiers:aS}=Oi.actions,Fu=t=>t.assetTypeIdentifierReducer.instances,Pu=d.createSelector([Fu],t=>Object.values(t)),wi=t=>e=>e.assetTypeIdentifierReducer.instances[t],cS=A(d.createSelector([Pu,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_type===e)))),_u=Oi.reducer,re=P(t=>t.uuid),Ou=re.getInitialState({}),Mi=d.createSlice({name:"assetTypeIdentifierValues",initialState:Ou,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,Ou)),reducers:{initializeAssetTypeIdentifierValues:re.initialize,addAssetTypeIdentifierValue:re.addOne,addAssetTypeIdentifierValues:re.addMany,setAssetTypeIdentifierValue:re.setOne,setAssetTypeIdentifierValues:re.setMany,updateAssetTypeIdentifierValue:re.updateOne,updateAssetTypeIdentifierValues:re.updateMany,deleteAssetTypeIdentifierValue:re.deleteOne,deleteAssetTypeIdentifierValues:re.deleteMany}}),{initializeAssetTypeIdentifierValues:Ru,addAssetTypeIdentifierValue:Ei,addAssetTypeIdentifierValues:nS,setAssetTypeIdentifierValue:rS,setAssetTypeIdentifierValues:dS,updateAssetTypeIdentifierValue:mt,updateAssetTypeIdentifierValues:uS,deleteAssetTypeIdentifierValue:ji,deleteAssetTypeIdentifierValues:oS}=Mi.actions,vu=t=>t.assetTypeIdentifierValueReducer.instances,Vi=d.createSelector([vu],t=>Object.values(t)),qi=t=>e=>e.assetTypeIdentifierValueReducer.instances[t],lS=A(d.createSelector([Vi,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset===e)))),hS=A(d.createSelector([Vi,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_type_identifier===e)))),wu=Mi.reducer,de=P(t=>t.uuid),Mu=de.getInitialState({}),zi=d.createSlice({name:"assetTypes",initialState:Mu,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Mu)),reducers:{initializeAssetTypes:de.initialize,setAssetType:de.setOne,setAssetTypes:de.setMany,addAssetType:de.addOne,addAssetTypes:de.addMany,updateAssetType:de.updateOne,updateAssetTypes:de.updateMany,deleteAssetType:de.deleteOne,deleteAssetTypes:de.deleteMany}}),{initializeAssetTypes:Eu,setAssetType:mS,setAssetTypes:pS,addAssetType:Di,addAssetTypes:yS,updateAssetType:pt,updateAssetTypes:AS,deleteAssetType:Ui,deleteAssetTypes:fS}=zi.actions,Ci=t=>t.assetTypeReducer.instances,ju=d.createSelector([Ci],t=>Object.values(t)),ki=t=>e=>e.assetTypeReducer.instances[t],SS=A(d.createSelector([Ci,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c?i.push(c):console.warn("selectAssetTypesByIds: No assetType exists with the id",a)}return T(i)})),TS=A(d.createSelector([ju,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),Vu=zi.reducer,qu={accessToken:"",refreshToken:"",isLoggedIn:!1},$t=d.createSlice({name:"auth",initialState:qu,extraReducers:t=>t.addCase(g,e=>Object.assign(e,qu)),reducers:{setTokens:(t,e)=>{t.accessToken=e.payload.accessToken,t.refreshToken=e.payload.refreshToken},clearTokens:t=>{t.accessToken="",t.refreshToken=""},setLoggedIn:(t,e)=>{e.payload||$t.caseReducers.clearTokens(t),t.isLoggedIn=e.payload}}}),{setTokens:gS,clearTokens:IS,setLoggedIn:zu}=$t.actions,bS=t=>t.authReducer.accessToken,FS=t=>t.authReducer.isLoggedIn,Du=$t.reducer,ue=P(t=>t.uuid),Uu=ue.getInitialState({}),Bi=d.createSlice({name:"categories",initialState:Uu,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Uu)),reducers:{initializeCategories:ue.initialize,addCategory:ue.addOne,addCategories:ue.addMany,setCategory:ue.setOne,setCategories:ue.setMany,updateCategory:ue.updateOne,updateCategories:ue.updateMany,deleteCategory:ue.deleteOne,deleteCategories:ue.deleteMany}}),{initializeCategories:Cu,addCategory:$i,addCategories:PS,setCategory:_S,setCategories:OS,updateCategory:ku,updateCategories:RS,deleteCategory:Bu,deleteCategories:vS}=Bi.actions,Gi=t=>t.categoryReducer.instances,$u=d.createSelector([Gi],t=>Object.values(t)),Li=t=>e=>e.categoryReducer.instances[t],wS=A(d.createSelector([Gi,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c?i.push(c):console.warn("selectCategoryByIds: No category exists with the id",a)}return T(i)})),MS=A(d.createSelector([$u,(t,e)=>e],(t,e)=>T(t.filter(i=>i.project===e)))),Gu=Bi.reducer,oe=P(t=>t.uuid),Lu=oe.getInitialState({}),Ni=d.createSlice({name:"documentAttachments",initialState:Lu,extraReducers:t=>t.addCase(g,e=>Object.assign(e,Lu)),reducers:{initializeDocumentAttachments:oe.initialize,addDocumentAttachment:oe.addOne,addDocumentAttachments:oe.addMany,setDocumentAttachment:oe.setOne,setDocumentAttachments:oe.setMany,updateDocumentAttachment:oe.updateOne,updateDocumentAttachments:oe.updateMany,deleteDocumentAttachment:oe.deleteOne,deleteDocumentAttachments:oe.deleteMany}}),{initializeDocumentAttachments:Hi,addDocumentAttachment:ES,addDocumentAttachments:Nu,setDocumentAttachment:Hu,setDocumentAttachments:jS,updateDocumentAttachment:VS,updateDocumentAttachments:Wu,deleteDocumentAttachment:Ku,deleteDocumentAttachments:Yu}=Ni.actions,Zu=t=>t.documentAttachmentReducer.instances,Ju=d.createSelector([Zu],t=>Object.values(t)),Xu=t=>e=>e.documentAttachmentReducer.instances[t],qS=A(d.createSelector([Ju,(t,e)=>e],(t,e)=>T(t.filter(({document:i})=>e===i)))),Qu=Ni.reducer,xu={documents:{}},Wi=d.createSlice({name:"documents",initialState:xu,extraReducers:t=>t.addCase(g,e=>{Object.assign(e,xu)}),reducers:{setDocuments:(t,e)=>{if(e.payload.filter(_n).length!==e.payload.length)throw new Error("Tried to use setIssues reducer with duplicate ID's");t.documents=Fn(e.payload)},addDocuments:(t,e)=>{for(const i of e.payload)if(i.uuid in t.documents)throw new Error(`attempting to add a document with uuid ${i.uuid} which already exists in state.documents.`);for(const i of e.payload){if(i.parent_document&&t.documents[i.parent_document]){const a=t.documents[i.parent_document];t.documents[i.parent_document]={...a,children_documents:[...a.children_documents,i.uuid]}}t.documents[i.uuid]=i}},updateDocuments:(t,e)=>{for(const i of e.payload)if(!(i.uuid in t.documents))throw new Error(`attempting to update a document with uuid ${i.uuid} which doesn't exists in state.documents.`);for(const i of e.payload){const a=t.documents[i.uuid];if(i.organization!==void 0&&i.organization!==a.organization)throw new Error("organization cannot be updated");if(i.project!==void 0&&i.project!==a.project)throw new Error("project cannot be updated");t.documents[i.uuid]={...a,...i}}},removeDocuments:(t,e)=>{for(const i of e.payload)if(!(i in t.documents))throw new Error(`attempting to delete a document with uuid ${i} which doesn't exists in state.documents.`);for(const i of e.payload){const a=t.documents[i];if(a.parent_document&&t.documents[a.parent_document]){const c=t.documents[a.parent_document];t.documents[a.parent_document]={...c,children_documents:c.children_documents.filter(n=>n!==a.uuid)}}delete t.documents[i]}}}}),{setDocuments:eo,addDocuments:to,updateDocuments:xe,removeDocuments:Ki}=Wi.actions,Gt=t=>t.documentsReducer.documents,Yi=d.createSelector([Gt],t=>Object.values(t)),so=t=>e=>e.documentsReducer.documents[t],zS=A(d.createSelector([Gt,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c?i.push(c):console.warn("selectDocumentByIds: No document exists with the id",a)}return T(i)})),DS=A(d.createSelector([Yi,(t,e)=>e],(t,e)=>t.filter(i=>i.project===e))),US=A(d.createSelector([Yi,(t,e)=>e],(t,e)=>t.filter(i=>i.organization===e))),io=Wi.reducer,le=P(t=>t.uuid),ao=le.getInitialState({}),Zi=d.createSlice({name:"emailDomains",initialState:ao,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,ao)),reducers:{initializeEmailDomains:le.initialize,addEmailDomain:le.addOne,addEmailDomains:le.addMany,setEmailDomain:le.setOne,setEmailDomains:le.setMany,updateEmailDomain:le.updateOne,updateEmailDomains:le.updateMany,deleteEmailDomain:le.deleteOne,deleteEmailDomains:le.deleteMany}}),{initializeEmailDomains:co,addEmailDomain:no,addEmailDomains:CS,setEmailDomain:kS,setEmailDomains:BS,updateEmailDomain:$S,updateEmailDomains:GS,deleteEmailDomain:ro,deleteEmailDomains:LS}=Zi.actions,uo=t=>t.emailDomainsReducer.instances,oo=d.createSelector([uo],t=>Object.values(t)),NS=A(d.createSelector([oo,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),lo=Zi.reducer,ho={s3Urls:{}},mo=1e3*60*60,HS=mo*24*7,Ji=d.createSlice({name:"file",initialState:ho,extraReducers:t=>t.addCase(g,e=>Object.assign(e,ho)),reducers:{setUploadUrl:(t,e)=>{const{url:i,fields:a,sha1:c}=e.payload,n=new Date,r=new Date(n.getTime()+HS);t.s3Urls[c]={url:i,fields:a,exp:r.getTime()}}}}),{setUploadUrl:po}=Ji.actions,yo=t=>e=>{const i=e.fileReducer.s3Urls[t];if(!i)return;const a=new Date().getTime();if(!((i.exp??a)-a<mo))return i},Ao=Ji.reducer,he=P(t=>t.uuid),fo=he.getInitialState({}),Xi=d.createSlice({name:"formIdentifiers",initialState:fo,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,fo)),reducers:{initializeFormIdentifiers:he.initialize,addFormIdentifier:he.addOne,addFormIdentifiers:he.addMany,setFormIdentifier:he.setOne,setFormIdentifiers:he.setMany,updateFormIdentifier:he.updateOne,updateFormIdentifiers:he.updateMany,deleteFormIdentifier:he.deleteOne,deleteFormIdentifiers:he.deleteMany}}),{initializeFormIdentifiers:So,addFormIdentifier:Qi,addFormIdentifiers:WS,setFormIdentifier:KS,setFormIdentifiers:YS,updateFormIdentifier:yt,updateFormIdentifiers:ZS,deleteFormIdentifier:xi,deleteFormIdentifiers:JS}=Xi.actions,To=t=>t.formIdentifierReducer.instances,go=d.createSelector([To],t=>Object.values(t)),ea=t=>e=>e.formIdentifierReducer.instances[t],XS=A(d.createSelector([go,(t,e)=>e],(t,e)=>T(t.filter(i=>i.form===e)))),Io=Xi.reducer,me=P(t=>t.uuid),bo=me.getInitialState({}),ta=d.createSlice({name:"formIdentifierValues",initialState:bo,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,bo)),reducers:{initializeFormIdentifierValues:me.initialize,addFormIdentifierValue:me.addOne,addFormIdentifierValues:me.addMany,setFormIdentifierValue:me.setOne,setFormIdentifierValues:me.setMany,updateFormIdentifierValue:me.updateOne,updateFormIdentifierValues:me.updateMany,deleteFormIdentifierValue:me.deleteOne,deleteFormIdentifierValues:me.deleteMany}}),{initializeFormIdentifierValues:Fo,addFormIdentifierValue:sa,addFormIdentifierValues:QS,setFormIdentifierValue:xS,setFormIdentifierValues:eT,updateFormIdentifierValue:At,updateFormIdentifierValues:tT,deleteFormIdentifierValue:ia,deleteFormIdentifierValues:sT}=ta.actions,Po=t=>t.formIdentifierValueReducer.instances,aa=d.createSelector([Po],t=>Object.values(t)),ca=t=>e=>e.formIdentifierValueReducer.instances[t],iT=A(d.createSelector([aa,(t,e)=>e],(t,e)=>T(t.filter(i=>i.form_submission===e)))),aT=A(d.createSelector([aa,(t,e)=>e],(t,e)=>T(t.filter(i=>i.form_identifier===e)))),_o=ta.reducer,pe=P(t=>t.uuid),Oo=pe.getInitialState({}),na=d.createSlice({name:"formRevisionAttachments",initialState:Oo,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Oo)),reducers:{initializeFormRevisionAttachments:pe.initialize,addFormRevisionAttachment:pe.addOne,addFormRevisionAttachments:pe.addMany,setFormRevisionAttachment:pe.setOne,setFormRevisionAttachments:pe.setMany,updateFormRevisionAttachment:pe.updateOne,updateFormRevisionAttachments:pe.updateMany,deleteFormRevisionAttachment:pe.deleteOne,deleteFormRevisionAttachments:pe.deleteMany}}),{initializeFormRevisionAttachments:Ro,addFormRevisionAttachment:cT,addFormRevisionAttachments:vo,setFormRevisionAttachment:nT,setFormRevisionAttachments:rT,updateFormRevisionAttachment:dT,updateFormRevisionAttachments:wo,deleteFormRevisionAttachment:uT,deleteFormRevisionAttachments:Mo}=na.actions,Eo=t=>t.formRevisionAttachmentReducer.instances,oT=A(d.createSelector([Eo,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.form_revision===e)))),jo=na.reducer,ye=P(t=>t.uuid),Vo=ye.getInitialState({}),ra=d.createSlice({name:"formRevisions",initialState:Vo,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Vo)),reducers:{initializeFormRevisions:ye.initialize,addFormRevision:ye.addOne,addFormRevisions:ye.addMany,setFormRevision:ye.setOne,setFormRevisions:ye.setMany,updateFormRevision:ye.updateOne,updateFormRevisions:ye.updateMany,deleteFormRevision:ye.deleteOne,deleteFormRevisions:ye.deleteMany}}),{initializeFormRevisions:qo,addFormRevision:da,addFormRevisions:zo,setFormRevision:Do,setFormRevisions:lT,updateFormRevision:hT,updateFormRevisions:mT,deleteFormRevision:ua,deleteFormRevisions:Uo}=ra.actions,oa=t=>t.formRevisionReducer.instances,la=d.createSelector([oa],t=>Object.values(t)),pT=t=>e=>e.formRevisionReducer.instances[t],yT=A(d.createSelector([la,(t,e)=>e],(t,e)=>t.filter(i=>i.form===e).sort((i,a)=>i.submitted_at>a.submitted_at?-1:1)[0])),Co=A(d.createSelector([la,(t,e)=>e],(t,e)=>T(t.filter(i=>i.form===e)))),ko=ra.reducer,Ae=P(t=>t.uuid),Bo=Ae.getInitialState({}),ha=d.createSlice({name:"forms",initialState:Bo,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Bo)),reducers:{initializeForms:Ae.initialize,addForm:Ae.addOne,addForms:Ae.addMany,setForm:Ae.setOne,setForms:Ae.setMany,updateForm:Ae.updateOne,updateForms:Ae.updateMany,deleteForm:Ae.deleteOne,deleteForms:Ae.deleteMany}}),{initializeForms:$o,addForm:ma,addForms:AT,setForm:fT,setForms:ST,updateForm:TT,updateForms:gT,deleteForm:pa,deleteForms:IT}=ha.actions,Go=ha.reducer,Lo=t=>t.formReducer.instances,No=d.createSelector([Lo],t=>Object.values(t)),Ho=t=>e=>e.formReducer.instances[t],bT=A(d.createSelector([No,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),fe=P(t=>t.uuid),Wo=fe.getInitialState({}),ya=d.createSlice({name:"formSubmissionAttachments",initialState:Wo,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Wo)),reducers:{initializeFormSubmissionAttachments:fe.initialize,addFormSubmissionAttachment:fe.addOne,addFormSubmissionAttachments:fe.addMany,setFormSubmissionAttachment:fe.setOne,setFormSubmissionAttachments:fe.setMany,updateFormSubmissionAttachment:fe.updateOne,updateFormSubmissionAttachments:fe.updateMany,deleteFormSubmissionAttachment:fe.deleteOne,deleteFormSubmissionAttachments:fe.deleteMany}}),{initializeFormSubmissionAttachments:Ko,addFormSubmissionAttachment:FT,addFormSubmissionAttachments:Lt,setFormSubmissionAttachment:PT,setFormSubmissionAttachments:_T,updateFormSubmissionAttachment:OT,updateFormSubmissionAttachments:Yo,deleteFormSubmissionAttachment:RT,deleteFormSubmissionAttachments:Nt}=ya.actions,Zo=t=>t.formSubmissionAttachmentReducer.instances,Aa=d.createSelector([Zo],t=>Object.values(t)),Jo=A(d.createSelector([Aa,(t,e)=>e],(t,e)=>{const i=new Set(e);return T(t.filter(a=>i.has(a.uuid)))})),Xo=A(d.createSelector([Aa,(t,e)=>e],(t,e)=>T(t.filter(i=>i.form_submission===e)))),Qo=ya.reducer,Se=P(t=>t.uuid),xo=Se.getInitialState({}),fa=d.createSlice({name:"formSubmissions",initialState:xo,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,xo)),reducers:{initializeFormSubmissions:Se.initialize,setFormSubmission:Se.setOne,setFormSubmissions:Se.setMany,addFormSubmission:Se.addOne,addFormSubmissions:Se.addMany,updateFormSubmission:Se.updateOne,updateFormSubmissions:Se.updateMany,deleteFormSubmission:Se.deleteOne,deleteFormSubmissions:Se.deleteMany}}),{initializeFormSubmissions:el,setFormSubmission:Ht,setFormSubmissions:vT,addFormSubmission:Sa,addFormSubmissions:tl,updateFormSubmission:sl,updateFormSubmissions:wT,deleteFormSubmission:Ta,deleteFormSubmissions:il}=fa.actions,ga=t=>t.formSubmissionReducer.instances,MT=d.createSelector([ga],t=>Object.values(t)),Ia=t=>e=>e.formSubmissionReducer.instances[t],al=A(d.createSelector([ga,oa,(t,e)=>e],(t,e,i)=>{const a=new Set;for(const c of Object.values(e))c.form===i&&a.add(c.uuid);return Object.values(t).filter(c=>a.has(c.form_revision))})),cl=fa.reducer,Te=P(t=>t.uuid),nl=Te.getInitialState({}),ba=d.createSlice({name:"geoImages",initialState:nl,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,nl)),reducers:{initializeGeoImages:Te.initialize,setGeoImage:Te.setOne,setGeoImages:Te.setMany,addGeoImage:Te.addOne,addGeoImages:Te.addMany,updateGeoImage:Te.updateOne,updateGeoImages:Te.updateMany,deleteGeoImage:Te.deleteOne,deleteGeoImages:Te.deleteMany}}),{initializeGeoImages:rl,setGeoImage:ft,setGeoImages:dl,addGeoImage:ul,addGeoImages:ol,updateGeoImage:ll,updateGeoImages:ET,deleteGeoImage:Fa,deleteGeoImages:hl}=ba.actions,ml=t=>t.geoImageReducer.instances,pl=d.createSelector([ml],t=>Object.values(t)),Pa=t=>e=>e.geoImageReducer.instances[t],jT=A(d.createSelector([pl,(t,e)=>e],(t,e)=>T(t.filter(i=>i.project===e)))),yl=ba.reducer,ge=P(t=>t.uuid),Al=ge.getInitialState({}),_a=d.createSlice({name:"issueAssociations",initialState:Al,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,Al)),reducers:{initializeIssueAssociations:ge.initialize,addIssueAssociation:ge.addOne,addIssueAssociations:ge.addMany,setIssueAssociation:ge.setOne,setIssueAssociations:ge.setMany,updateIssueAssociation:ge.updateOne,updateIssueAssociations:ge.updateMany,deleteIssueAssociation:ge.deleteOne,deleteIssueAssociations:ge.deleteMany}}),{initializeIssueAssociations:fl,setIssueAssociations:VT,setIssueAssociation:qT,updateIssueAssociation:Sl,updateIssueAssociations:zT,addIssueAssociation:Oa,addIssueAssociations:Ra,deleteIssueAssociation:va,deleteIssueAssociations:wa}=_a.actions,St=t=>t.issueAssociationReducer.instances,DT=d.createSelector([St],t=>Object.values(t)),Tl=t=>e=>e.issueAssociationReducer.instances[t],gl=A(d.createSelector([St,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.associated_issue===e)))),Il=A(d.createSelector([St,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.issue===e)))),bl=A(d.createSelector([St,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.asset===e)))),Fl=_a.reducer,Ie=P(t=>t.uuid),Pl=Ie.getInitialState({}),Ma=d.createSlice({name:"issueAttachments",initialState:Pl,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,Pl)),reducers:{initializeIssueAttachments:Ie.initialize,addIssueAttachment:Ie.addOne,addIssueAttachments:Ie.addMany,setIssueAttachment:Ie.setOne,setIssueAttachments:Ie.setMany,updateIssueAttachment:Ie.updateOne,updateIssueAttachments:Ie.updateMany,deleteIssueAttachment:Ie.deleteOne,deleteIssueAttachments:Ie.deleteMany}}),{initializeIssueAttachments:Ea,addIssueAttachment:UT,addIssueAttachments:ja,setIssueAttachment:_l,setIssueAttachments:CT,updateIssueAttachment:kT,updateIssueAttachments:Ol,deleteIssueAttachment:Rl,deleteIssueAttachments:Va}=Ma.actions,vl=t=>t.issueAttachmentReducer.instances,wl=d.createSelector([vl],t=>Object.values(t)),Ml=A(d.createSelector([wl,(t,e)=>e],(t,e)=>T(t.filter(({issue:i})=>e===i)))),El=t=>e=>e.issueAttachmentReducer.instances[t],jl=Ma.reducer,be=P(t=>t.uuid),Vl=be.getInitialState({}),qa=d.createSlice({name:"issueCommentAttachments",initialState:Vl,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,Vl)),reducers:{initializeIssueCommentAttachments:be.initialize,addIssueCommentAttachment:be.addOne,addIssueCommentAttachments:be.addMany,setIssueCommentAttachment:be.setOne,setIssueCommentAttachments:be.setMany,updateIssueCommentAttachment:be.updateOne,updateIssueCommentAttachments:be.updateMany,deleteIssueCommentAttachment:be.deleteOne,deleteIssueCommentAttachments:be.deleteMany}}),{initializeIssueCommentAttachments:za,addIssueCommentAttachment:BT,addIssueCommentAttachments:ql,setIssueCommentAttachment:zl,setIssueCommentAttachments:$T,updateIssueCommentAttachment:GT,updateIssueCommentAttachments:Dl,deleteIssueCommentAttachment:Ul,deleteIssueCommentAttachments:Cl}=qa.actions,kl=t=>t.issueCommentAttachmentReducer.instances,Bl=d.createSelector([kl],t=>Object.values(t)),$l=t=>e=>e.issueCommentAttachmentReducer.instances[t],LT=A(d.createSelector([Bl,(t,e)=>e],(t,e)=>T(t.filter(({issue_comment:i})=>e===i)))),Gl=qa.reducer,Fe=P(t=>t.uuid),Ll=Fe.getInitialState({}),Da=d.createSlice({name:"issueComments",initialState:Ll,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,Ll)),reducers:{initializeIssueComments:Fe.initialize,addIssueComment:Fe.addOne,addIssueComments:Fe.addMany,setIssueComment:Fe.setOne,setIssueComments:Fe.setMany,updateIssueComment:Fe.updateOne,updateIssueComments:Fe.updateMany,deleteIssueComment:Fe.deleteOne,deleteIssueComments:Fe.deleteMany}}),{initializeIssueComments:NT,addIssueComment:Ua,addIssueComments:HT,setIssueComment:Ca,setIssueComments:Nl,updateIssueComment:WT,updateIssueComments:KT,deleteIssueComment:ka,deleteIssueComments:YT}=Da.actions,Hl=t=>t.issueCommentReducer.instances,Ba=t=>e=>e.issueCommentReducer.instances[t],ZT=A(d.createSelector([Hl,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.issue===e)))),Wl=Da.reducer,Pe=P(t=>t.uuid),Kl=Pe.getInitialState({}),$a=d.createSlice({name:"issues",initialState:Kl,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,Kl)),reducers:{initializeIssues:Pe.initialize,addIssue:Pe.addOne,addIssues:Pe.addMany,setIssue:Pe.setOne,setIssues:Pe.setMany,updateIssue:Pe.updateOne,updateIssues:Pe.updateMany,deleteIssue:Pe.deleteOne,deleteIssues:Pe.deleteMany}}),{initializeIssues:Yl,addIssue:Ga,addIssues:Zl,setIssue:JT,setIssues:XT,updateIssue:Wt,updateIssues:QT,deleteIssue:La,deleteIssues:Jl}=$a.actions,Na=t=>t.issueReducer.instances,Ha=d.createSelector([Na],t=>Object.values(t)),Wa=t=>e=>e.issueReducer.instances[t],xT=A(d.createSelector([Na,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c?i.push(c):console.warn("selectIssuesByIds: No issue exists with the id",a)}return T(i)})),eg=A(d.createSelector([Ha,(t,e)=>e],(t,e)=>t.filter(i=>i.project===e))),Xl=A(d.createSelector([Ha,(t,e)=>e],(t,e)=>t.filter(i=>i.issue_type===e))),Ql=$a.reducer,_e=P(t=>t.uuid),xl=_e.getInitialState({}),Ka=d.createSlice({name:"issueTypeAttachments",initialState:xl,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,xl)),reducers:{initializeIssueTypeAttachments:_e.initialize,addIssueTypeAttachment:_e.addOne,addIssueTypeAttachments:_e.addMany,setIssueTypeAttachment:_e.setOne,setIssueTypeAttachments:_e.setMany,updateIssueTypeAttachment:_e.updateOne,updateIssueTypeAttachments:_e.updateMany,deleteIssueTypeAttachment:_e.deleteOne,deleteIssueTypeAttachments:_e.deleteMany}}),{initializeIssueTypeAttachments:Ya,addIssueTypeAttachment:tg,addIssueTypeAttachments:eh,setIssueTypeAttachment:th,setIssueTypeAttachments:sg,updateIssueTypeAttachment:ig,updateIssueTypeAttachments:sh,deleteIssueTypeAttachment:ih,deleteIssueTypeAttachments:ah}=Ka.actions,ch=t=>t.issueTypeAttachmentReducer.instances,nh=d.createSelector([ch],t=>Object.values(t)),rh=t=>e=>e.issueTypeAttachmentReducer.instances[t],ag=A(d.createSelector([nh,(t,e)=>e],(t,e)=>T(t.filter(({issue_type:i})=>e===i)))),dh=Ka.reducer,Oe=P(t=>t.uuid),uh=Oe.getInitialState({}),Za=d.createSlice({name:"issueTypeFieldsAttachments",initialState:uh,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,uh)),reducers:{initializeIssueTypeFieldsAttachments:Oe.initialize,addIssueTypeFieldsAttachment:Oe.addOne,addIssueTypeFieldsAttachments:Oe.addMany,setIssueTypeFieldsAttachment:Oe.setOne,setIssueTypeFieldsAttachments:Oe.setMany,updateIssueTypeFieldsAttachment:Oe.updateOne,updateIssueTypeFieldsAttachments:Oe.updateMany,deleteIssueTypeFieldsAttachment:Oe.deleteOne,deleteIssueTypeFieldsAttachments:Oe.deleteMany}}),{initializeIssueTypeFieldsAttachments:oh,addIssueTypeFieldsAttachment:cg,addIssueTypeFieldsAttachments:lh,setIssueTypeFieldsAttachment:ng,setIssueTypeFieldsAttachments:rg,updateIssueTypeFieldsAttachment:dg,updateIssueTypeFieldsAttachments:hh,deleteIssueTypeFieldsAttachment:ug,deleteIssueTypeFieldsAttachments:mh}=Za.actions,ph=t=>t.issueTypeFieldsAttachmentReducer.instances,yh=d.createSelector([ph],t=>Object.values(t)),og=A(d.createSelector([yh,(t,e)=>e],(t,e)=>T(t.filter(i=>i.fields_revision===e)))),lg=t=>e=>e.issueTypeFieldsAttachmentReducer.instances[t],Ah=Za.reducer,Re=P(t=>t.uuid),fh=Re.getInitialState({}),Ja=d.createSlice({name:"issueTypeFieldValues",initialState:fh,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,fh)),reducers:{initializeIssueTypeFieldValues:Re.initialize,addIssueTypeFieldValues:Re.addOne,addIssueTypeFieldValuesMany:Re.addMany,setIssueTypeFieldValues:Re.setOne,setIssueTypeFieldValuesMany:Re.setMany,updateIssueTypeFieldValues:Re.updateOne,updateIssueTypeFieldValuesMany:Re.updateMany,deleteIssueTypeFieldValues:Re.deleteOne,deleteIssueTypeFieldValuesMany:Re.deleteMany}}),{initializeIssueTypeFieldValues:Sh,addIssueTypeFieldValues:Xa,addIssueTypeFieldValuesMany:hg,setIssueTypeFieldValues:mg,setIssueTypeFieldValuesMany:pg,updateIssueTypeFieldValues:Tt,updateIssueTypeFieldValuesMany:yg,deleteIssueTypeFieldValues:Qa,deleteIssueTypeFieldValuesMany:Ag}=Ja.actions,Th=t=>t.issueTypeFieldValuesReducer.instances,xa=d.createSelector([Th],t=>Object.values(t)),fg=A(d.createSelector([xa,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue===e)))),ec=t=>e=>e.issueTypeFieldValuesReducer.instances[t],gh=Ja.reducer,ve=P(t=>t.uuid),Ih=ve.getInitialState({}),tc=d.createSlice({name:"issueTypeFields",initialState:Ih,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Ih)),reducers:{initializeIssueTypeFields:ve.initialize,addIssueTypeFields:ve.addOne,addIssueTypeFieldsMany:ve.addMany,setIssueTypeFields:ve.setOne,setIssueTypeFieldsMany:ve.setMany,updateIssueTypeFields:ve.updateOne,updateIssueTypeFieldsMany:ve.updateMany,deleteIssueTypeFields:ve.deleteOne,deleteIssueTypeFieldsMany:ve.deleteMany}}),{initializeIssueTypeFields:bh,addIssueTypeFields:Fh,addIssueTypeFieldsMany:Sg,setIssueTypeFields:Tg,setIssueTypeFieldsMany:gg,updateIssueTypeFields:Ph,updateIssueTypeFieldsMany:Ig,deleteIssueTypeFields:_h,deleteIssueTypeFieldsMany:bg}=tc.actions,Oh=t=>t.issueTypeFieldsReducer.instances,Kt=d.createSelector([Oh],t=>Object.values(t)),Fg=A(d.createSelector([Kt,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue_type===e)))),Pg=A(d.createSelector([Kt,(t,e)=>e],(t,e)=>t.filter(i=>i.issue_type===e).sort((i,a)=>i.submitted_at>a.submitted_at?-1:1)[0])),_g=A(d.createSelector([Kt,xa,(t,e)=>e],(t,e,i)=>{const a=new Set(t.filter(c=>c.issue_type===i).map(c=>c.uuid));return T(e.filter(c=>a.has(c.fields_revision)))})),Og=t=>e=>e.issueTypeFieldsReducer.instances[t],Rh=tc.reducer,we=P(t=>t.uuid),vh=we.getInitialState({}),sc=d.createSlice({name:"issueTypeFieldValuesAttachments",initialState:vh,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,vh)),reducers:{initializeIssueTypeFieldValuesAttachments:we.initialize,addIssueTypeFieldValuesAttachment:we.addOne,addIssueTypeFieldValuesAttachments:we.addMany,setIssueTypeFieldValuesAttachment:we.setOne,setIssueTypeFieldValuesAttachments:we.setMany,updateIssueTypeFieldValuesAttachment:we.updateOne,updateIssueTypeFieldValuesAttachments:we.updateMany,deleteIssueTypeFieldValuesAttachment:we.deleteOne,deleteIssueTypeFieldValuesAttachments:we.deleteMany}}),{initializeIssueTypeFieldValuesAttachments:wh,addIssueTypeFieldValuesAttachment:Rg,addIssueTypeFieldValuesAttachments:Yt,setIssueTypeFieldValuesAttachment:vg,setIssueTypeFieldValuesAttachments:wg,updateIssueTypeFieldValuesAttachment:Mg,updateIssueTypeFieldValuesAttachments:Mh,deleteIssueTypeFieldValuesAttachment:Eg,deleteIssueTypeFieldValuesAttachments:Zt}=sc.actions,Eh=t=>t.issueTypeFieldValuesAttachmentReducer.instances,ic=d.createSelector([Eh],t=>Object.values(t)),jg=t=>e=>e.issueTypeFieldValuesAttachmentReducer.instances[t],jh=A(d.createSelector([ic,(t,e)=>e],(t,e)=>{const i=new Set(e);return T(t.filter(a=>i.has(a.uuid)))})),Vh=A(d.createSelector([ic,(t,e)=>e],(t,e)=>T(t.filter(i=>i.field_values===e)))),qh=sc.reducer,Me=P(t=>t.uuid),zh=Me.getInitialState({}),ac=d.createSlice({name:"issueTypeIdentifiers",initialState:zh,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,zh)),reducers:{initializeIssueTypeIdentifiers:Me.initialize,addIssueTypeIdentifier:Me.addOne,addIssueTypeIdentifiers:Me.addMany,setIssueTypeIdentifier:Me.setOne,setIssueTypeIdentifiers:Me.setMany,updateIssueTypeIdentifier:Me.updateOne,updateIssueTypeIdentifiers:Me.updateMany,deleteIssueTypeIdentifier:Me.deleteOne,deleteIssueTypeIdentifiers:Me.deleteMany}}),{initializeIssueTypeIdentifiers:Dh,addIssueTypeIdentifier:cc,addIssueTypeIdentifiers:Vg,setIssueTypeIdentifier:qg,setIssueTypeIdentifiers:zg,updateIssueTypeIdentifier:gt,updateIssueTypeIdentifiers:Dg,deleteIssueTypeIdentifier:nc,deleteIssueTypeIdentifiers:Ug}=ac.actions,Uh=t=>t.issueTypeIdentifierReducer.instances,Ch=d.createSelector([Uh],t=>Object.values(t)),rc=t=>e=>e.issueTypeIdentifierReducer.instances[t],Cg=A(d.createSelector([Ch,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue_type===e)))),kh=ac.reducer,Ee=P(t=>t.uuid),Bh=Ee.getInitialState({}),dc=d.createSlice({name:"issueTypeIdentifierValues",initialState:Bh,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,Bh)),reducers:{initializeIssueTypeIdentifierValues:Ee.initialize,addIssueTypeIdentifierValue:Ee.addOne,addIssueTypeIdentifierValues:Ee.addMany,setIssueTypeIdentifierValue:Ee.setOne,setIssueTypeIdentifierValues:Ee.setMany,updateIssueTypeIdentifierValue:Ee.updateOne,updateIssueTypeIdentifierValues:Ee.updateMany,deleteIssueTypeIdentifierValue:Ee.deleteOne,deleteIssueTypeIdentifierValues:Ee.deleteMany}}),{initializeIssueTypeIdentifierValues:$h,addIssueTypeIdentifierValue:uc,addIssueTypeIdentifierValues:kg,setIssueTypeIdentifierValue:Bg,setIssueTypeIdentifierValues:$g,updateIssueTypeIdentifierValue:It,updateIssueTypeIdentifierValues:Gg,deleteIssueTypeIdentifierValue:oc,deleteIssueTypeIdentifierValues:Lg}=dc.actions,Gh=t=>t.issueTypeIdentifierValueReducer.instances,lc=d.createSelector([Gh],t=>Object.values(t)),hc=t=>e=>e.issueTypeIdentifierValueReducer.instances[t],Ng=A(d.createSelector([lc,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue===e)))),Hg=A(d.createSelector([lc,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue_type_identifier===e)))),Lh=dc.reducer,U=P(t=>t.uuid),Nh=U.getInitialState({}),mc=d.createSlice({name:"issueTypes",initialState:Nh,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Nh)),reducers:{initializeIssueTypes:U.initialize,addIssueType:U.addOne,addIssueTypes:U.addMany,setIssueType:U.setOne,setIssueTypes:U.setMany,updateIssueType:U.updateOne,updateIssueTypes:U.updateMany,deleteIssueType:U.deleteOne,deleteIssueTypes:U.deleteMany,removeIssueType:U.deleteOne}}),{initializeIssueTypes:Hh,addIssueType:Wh,addIssueTypes:Wg,setIssueType:bt,setIssueTypes:Kg,updateIssueType:Kh,updateIssueTypes:Yg,deleteIssueType:Zg,deleteIssueTypes:Jg,removeIssueType:pc}=mc.actions,yc=t=>t.issueTypeReducer.instances,Yh=d.createSelector(yc,t=>Object.values(t)),Ac=t=>e=>e.issueTypeReducer.instances[t],Xg=A(d.createSelector([yc,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c?i.push(c):console.warn("selectIssueTypesByIds: No issue type exists with the id",a)}return i})),Qg=A(d.createSelector([Yh,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),Zh=mc.reducer,je=P(t=>t.uuid),Jh=je.getInitialState({}),fc=d.createSlice({name:"issueUpdates",initialState:Jh,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,Jh)),reducers:{initializeIssueUpdates:je.initialize,addIssueUpdate:je.addOne,addIssueUpdates:je.addMany,setIssueUpdate:je.setOne,setIssueUpdates:je.setMany,updateIssueUpdate:je.updateOne,updateIssueUpdates:je.updateMany,deleteIssueUpdate:je.deleteOne,deleteIssueUpdates:je.deleteMany}}),{initializeIssueUpdates:Xh,addIssueUpdate:Qh,addIssueUpdates:xh,setIssueUpdate:xg,setIssueUpdates:eI,updateIssueUpdate:tI,updateIssueUpdates:sI,deleteIssueUpdate:em,deleteIssueUpdates:tm}=fc.actions,sm=t=>t.issueUpdateReducer.instances,im=d.createSelector([sm],t=>Object.values(t)),am=A(d.createSelector([im,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue===e)))),cm=fc.reducer,Ve=P(t=>t.id),nm=Ve.getInitialState({currentUser:null}),Sc=d.createSlice({name:"users",initialState:nm,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,nm)),reducers:{initializeUsers:Ve.initialize,setUsers:Ve.setMany,setUser:Ve.setOne,addUsers:Ve.addMany,addUser:Ve.addOne,updateUsers:Ve.updateMany,updateUser:Ve.updateOne,deleteUser:Ve.deleteOne,deleteUsers:Ve.deleteMany,setCurrentUser:(t,e)=>{t.currentUser=e.payload},setProfilePicture:(t,e)=>{if(!t.currentUser)return;t.currentUser.profile.file=e.payload.file??null,t.currentUser.profile.file_sha1=e.payload.file_sha1??null;const i=t.instances[t.currentUser.id];if(!i)throw new Error("Unable to find current user in users slice");i.profile.file=e.payload.file??null,i.profile.file_sha1=e.payload.file_sha1??null}}}),{initializeUsers:rm,setUsers:iI,setUser:aI,addUsers:cI,addUser:dm,updateUsers:nI,updateUser:rI,deleteUser:um,deleteUsers:dI,setCurrentUser:uI,setProfilePicture:oI}=Sc.actions,om=Sc.reducer,lm=t=>t.userReducer.currentUser,Jt=t=>t.userReducer.instances,Tc=d.createSelector([Jt],t=>Object.values(t)),hm=t=>e=>e.userReducer.instances[t],lI=A(d.createSelector([Jt,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c?i.push(c):console.warn("selectUsersByIds: No user exists with the id",a)}return T(i)})),qe=P(t=>t.uuid),mm=qe.getInitialState({}),gc=d.createSlice({name:"organizationAccess",initialState:mm,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,mm)),reducers:{initializeOrganizationAccesses:qe.initialize,addOrganizationAccess:qe.addOne,addOrganizationAccesses:qe.addMany,setOrganizationAccess:qe.setOne,setOrganizationAccesses:qe.setMany,updateOrganizationAccess:qe.updateOne,updateOrganizationAccesses:qe.updateMany,deleteOrganizationAccess:qe.deleteOne,deleteOrganizationAccesses:qe.deleteMany}}),{initializeOrganizationAccesses:pm,addOrganizationAccess:ym,addOrganizationAccesses:hI,setOrganizationAccess:mI,setOrganizationAccesses:pI,updateOrganizationAccess:Xt,updateOrganizationAccesses:yI,deleteOrganizationAccess:Am,deleteOrganizationAccesses:AI}=gc.actions,fm=gc.reducer,Ic=t=>t.organizationAccessReducer.instances,bc=t=>e=>e.organizationAccessReducer.instances[t],fI=d.createSelector([lm,Ic],(t,e)=>Object.values(e).find(a=>a.user===(t==null?void 0:t.id))??null),Sm=d.createSelector([Ic],t=>{const e={};for(const i of Object.values(t))e[i.user]=i;return vt(e)}),SI=A(d.createSelector([Jt,Sm,(t,e)=>e],(t,e,i)=>T(Object.values(t).filter(a=>{const c=e[a.id];return!!c&&c.organization===i})))),ze=P(t=>t.uuid),Tm=ze.getInitialState({}),Fc=d.createSlice({name:"organizations",initialState:Tm,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Tm)),reducers:{initializeOrganizations:ze.initialize,setOrganizations:ze.setMany,setOrganization:ze.setOne,addOrganizations:ze.addMany,addOrganization:ze.addOne,updateOrganizations:ze.updateMany,updateOrganization:ze.updateOne,deleteOrganization:ze.deleteOne,deleteOrganizations:ze.deleteMany}}),{initializeOrganizations:gm,setOrganizations:TI,setOrganization:gI,addOrganizations:II,addOrganization:Im,updateOrganizations:bI,updateOrganization:bm,deleteOrganization:FI,deleteOrganizations:PI}=Fc.actions,Fm=t=>t.organizationReducer.instances,_I=d.createSelector([Fm],t=>Object.values(t)),OI=t=>e=>e.organizationReducer.instances[t],Pm=Fc.reducer,_m=(t,e,i)=>{const a=t.uuid?t:{...t,uuid:Xe.v4()};return{payload:a,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:a,BASE_URL:e,serviceName:i}}}}},Om={deletedRequests:[],latestRetryTime:0},Pc=d.createSlice({name:"outbox",initialState:Om,extraReducers:t=>t.addCase(g,e=>Object.assign(e,Om)),reducers:{enqueueRequest:{reducer:(t,e)=>t,prepare:t=>{console.debug("Preparing to enqueue request",t);const{BASE_URL:e,serviceName:i,...a}=t;return _m(a,e,i)}},markForDeletion(t,e){t.deletedRequests.push(e.payload)},markAsDeleted(t,e){const i=t.deletedRequests.indexOf(e.payload);i!==-1&&t.deletedRequests.splice(i,1)},_setLatestRetryTime:(t,e)=>{t.latestRetryTime=e.payload}}}),RI=t=>t.outboxReducer.deletedRequests,vI=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:Rm,markForDeletion:wI,markAsDeleted:vm,_setLatestRetryTime:wm}=Pc.actions,Mm=Pc.reducer,De=P(t=>t.uuid),Em=De.getInitialState({}),_c=d.createSlice({name:"projectAccess",initialState:Em,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Em)),reducers:{initializeProjectAccesses:De.initialize,addProjectAccess:De.addOne,addProjectAccesses:De.addMany,setProjectAccess:De.setOne,setProjectAccesses:De.setMany,updateProjectAccess:De.updateOne,updateProjectAccesses:De.updateMany,deleteProjectAccess:De.deleteOne,deleteProjectAccesses:De.deleteMany}}),{initializeProjectAccesses:jm,addProjectAccess:Oc,addProjectAccesses:Rc,setProjectAccess:MI,setProjectAccesses:EI,updateProjectAccess:Ft,updateProjectAccesses:Vm,deleteProjectAccess:vc,deleteProjectAccesses:wc}=_c.actions,qm=_c.reducer,Mc=t=>t.projectAccessReducer.instances,Qt=d.createSelector(Mc,t=>Object.values(t)),Ec=t=>e=>e.projectAccessReducer.instances[t],zm=A(d.createSelector([Mc,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.project===e)))),jI=A(d.createSelector([Qt,(t,e)=>e],(t,e)=>{const i={};for(const a of t.filter(c=>c.project===e))i[a.user]=a;return i})),VI=A(d.createSelector([Tc,Qt,(t,e)=>e],(t,e,i)=>{const a=new Set(e.filter(c=>c.project===i).map(c=>c.user));return T(t.filter(c=>a.has(c.id)))})),Ue=P(t=>t.uuid),Dm=Ue.getInitialState({}),jc=d.createSlice({name:"projectAttachments",initialState:Dm,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Dm)),reducers:{initializeProjectAttachments:Ue.initialize,addProjectAttachment:Ue.addOne,addProjectAttachments:Ue.addMany,setProjectAttachment:Ue.setOne,setProjectAttachments:Ue.setMany,updateProjectAttachment:Ue.updateOne,updateProjectAttachments:Ue.updateMany,deleteProjectAttachment:Ue.deleteOne,deleteProjectAttachments:Ue.deleteMany}}),{initializeProjectAttachments:Vc,addProjectAttachment:qI,addProjectAttachments:Um,setProjectAttachment:Cm,setProjectAttachments:km,updateProjectAttachment:zI,updateProjectAttachments:Bm,deleteProjectAttachment:$m,deleteProjectAttachments:qc}=jc.actions,Gm=t=>t.projectAttachmentReducer.instances,Lm=d.createSelector([Gm],t=>Object.values(t)),Nm=t=>e=>e.projectAttachmentReducer.instances[t],Hm=A(d.createSelector([Lm,(t,e)=>e],(t,e)=>T(t.filter(({project:i})=>e===i)))),Wm=jc.reducer,Ce=P(t=>t.uuid),Km=Ce.getInitialState({activeProjectFileId:null,isImportingProjectFile:!1}),zc=d.createSlice({name:"projectFiles",initialState:Km,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,_),e=>Object.assign(e,Km)),reducers:{initializeProjectFiles:Ce.initialize,setProjectFile:Ce.setOne,setProjectFiles:Ce.setMany,addProjectFile:Ce.addOne,addProjectFiles:Ce.addMany,updateProjectFile:Ce.updateOne,updateProjectFiles:Ce.updateMany,deleteProjectFile:Ce.deleteOne,deleteProjectFiles:Ce.deleteMany,setIsImportingProjectFile:(t,e)=>{t.isImportingProjectFile=e.payload},saveActiveProjectFileBounds:(t,e)=>{const i=t.activeProjectFileId;if(!i)throw new Error("Tried to save bounds for active project file, but no active project file was set.");if(!t.instances[i])throw new Error(`Tried to save bounds for active project file, but project file with ID ${i}
|
|
2
|
-
doesn't exist.`);t.instances[i].bounds=e.payload},setActiveProjectFileId:(t,e)=>{t.activeProjectFileId=e.payload}}}),{initializeProjectFiles:Ym,setProjectFile:DI,setProjectFiles:UI,addProjectFile:CI,addProjectFiles:Zm,updateProjectFile:Dc,updateProjectFiles:kI,deleteProjectFile:Jm,deleteProjectFiles:Xm,setIsImportingProjectFile:Qm,setActiveProjectFileId:xm,saveActiveProjectFileBounds:ep}=zc.actions,tp=t=>t.projectFileReducer.instances,sp=d.createSelector([tp],t=>T(Object.values(t).sort((e,i)=>e.z_index-i.z_index))),BI=t=>e=>e.projectFileReducer.instances[t],$I=t=>t.projectFileReducer.activeProjectFileId,GI=t=>t.projectFileReducer.isImportingProjectFile,ip=zc.reducer,ke=P(t=>t.uuid),ap=ke.getInitialState({}),Uc=d.createSlice({name:"projectFolders",initialState:ap,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,ap)),reducers:{initializeProjectFolders:ke.initialize,addProjectFolder:ke.addOne,addProjectFolders:ke.addMany,setProjectFolder:ke.setOne,setProjectFolders:ke.setMany,updateProjectFolder:ke.updateOne,updateProjectFolders:ke.updateMany,deleteProjectFolder:ke.deleteOne,deleteProjectFolders:ke.deleteMany}}),{initializeProjectFolders:cp,addProjectFolder:Cc,addProjectFolders:LI,setProjectFolder:NI,setProjectFolders:HI,updateProjectFolder:Pt,updateProjectFolders:WI,deleteProjectFolder:kc,deleteProjectFolders:KI}=Uc.actions,Bc=t=>t.projectFolderReducer.instances,np=d.createSelector([Bc],t=>Object.values(t)),$c=t=>e=>e.projectFolderReducer.instances[t],YI=A(d.createSelector([Bc,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c?i.push(c):console.warn("selectProjectFoldersByIds: No project folder exists with the id",a)}return T(i)})),ZI=A(d.createSelector([np,(t,e)=>e],(t,e)=>T(t.filter(i=>i.project===e)))),rp=Uc.reducer,Be=P(t=>t.uuid),dp=Be.getInitialState({}),Gc=d.createSlice({name:"projects",initialState:dp,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,dp)),reducers:{initializeProjects:Be.initialize,setProjects:Be.setMany,setProject:Be.setOne,addProjects:Be.addMany,addProject:Be.addOne,updateProjects:Be.updateMany,updateProject:Be.updateOne,deleteProject:Be.deleteOne,deleteProjects:Be.deleteMany}}),{initializeProjects:up,setProjects:JI,setProject:XI,addProjects:QI,addProject:Lc,updateProjects:xI,updateProject:op,deleteProject:Nc,deleteProjects:eb}=Gc.actions,lp=Gc.reducer,hp=t=>t.projectReducer.instances,Hc=d.createSelector([hp],t=>T(Object.values(t))),mp=t=>e=>e.projectReducer.instances[t],tb=A(d.createSelector([Hc,Qt,(t,e)=>e],(t,e,i)=>{const a=new Set(e.filter(c=>c.user===i).map(c=>c.project));return T(t.filter(c=>a.has(c.uuid)))})),sb=A(d.createSelector([Hc,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),ib={isRehydrated:!1},Wc=d.createSlice({name:"rehydrated",initialState:ib,reducers:{setRehydrated:(t,e)=>{t.isRehydrated=e.payload}}}),{setRehydrated:ab}=Wc.actions,cb=t=>t.rehydratedReducer.isRehydrated,pp=Wc.reducer,$e=P(t=>t.uuid),yp=$e.getInitialState({}),Kc=d.createSlice({name:"teamMemberships",initialState:yp,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,yp)),reducers:{initializeTeamMemberships:$e.initialize,addTeamMembership:$e.addOne,addTeamMemberships:$e.addMany,setTeamMembership:$e.setOne,setTeamMemberships:$e.setMany,updateTeamMembership:$e.updateOne,updateTeamMemberships:$e.updateMany,deleteTeamMembership:$e.deleteOne,deleteTeamMemberships:$e.deleteMany}}),{initializeTeamMemberships:Ap,addTeamMembership:fp,addTeamMemberships:Sp,setTeamMembership:Yc,setTeamMemberships:Tp,updateTeamMembership:nb,updateTeamMemberships:rb,deleteTeamMembership:Zc,deleteTeamMemberships:gp}=Kc.actions,Ip=Kc.reducer,bp=t=>t.teamMembershipReducer.instances,Jc=d.createSelector([bp],t=>Object.values(t)),Fp=t=>e=>e.teamMembershipReducer.instances[t],db=A(d.createSelector([Jc,(t,e)=>e],(t,e)=>{const i={};for(const a of t.filter(c=>c.team===e))i[a.user]=a;return i})),ub=A(d.createSelector([Tc,Jc,(t,e)=>e],(t,e,i)=>{const a=new Set(e.filter(c=>c.team===i).map(c=>c.user));return T(t.filter(c=>a.has(c.id)))})),Ge=P(t=>t.uuid),Pp=Ge.getInitialState({}),Xc=d.createSlice({name:"teams",initialState:Pp,extraReducers:t=>t.addMatcher(d.isAnyOf(g,_),e=>Object.assign(e,Pp)),reducers:{initializeTeams:Ge.initialize,addTeam:Ge.addOne,addTeams:Ge.addMany,setTeam:Ge.setOne,setTeams:Ge.setMany,updateTeam:Ge.updateOne,updateTeams:Ge.updateMany,deleteTeam:Ge.deleteOne,deleteTeams:Ge.deleteMany}}),{initializeTeams:_p,addTeam:Op,addTeams:ob,setTeam:_t,setTeams:lb,updateTeam:Rp,updateTeams:hb,deleteTeam:Qc,deleteTeams:mb}=Xc.actions,xc=t=>t.teamReducer.instances,vp=d.createSelector([xc],t=>Object.values(t)),en=t=>e=>e.teamReducer.instances[t],pb=A(d.createSelector([xc,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c?i.push(c):console.warn("selectTeamsByIds: No team exists with the id",a)}return T(i)})),yb=A(d.createSelector([vp,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),wp=Xc.reducer,Ab={version:0},Mp=d.createSlice({name:"versioning",initialState:Ab,reducers:{}}),Ep=Mp.reducer,tn={outboxReducer:Mm,fileReducer:Ao,authReducer:Du},fb=d.combineReducers(tn),jp={...tn,[it]:Ep,categoryReducer:Gu,assetReducer:Pd,assetAttachmentReducer:Ln,assetStageCompletionReducer:wd,assetStageReducer:zd,assetTypeReducer:Vu,assetTypeAttachmentReducer:Hd,issueReducer:Ql,issueAttachmentReducer:jl,issueTypeReducer:Zh,issueTypeAttachmentReducer:dh,organizationReducer:Pm,projectReducer:lp,projectAttachmentReducer:Wm,projectAccessReducer:qm,organizationAccessReducer:fm,projectFileReducer:ip,projectFolderReducer:rp,rehydratedReducer:pp,formReducer:Go,formRevisionReducer:ko,formRevisionAttachmentReducer:jo,formSubmissionAttachmentReducer:Qo,formSubmissionReducer:cl,formIdentifierReducer:Io,formIdentifierValueReducer:_o,userReducer:om,emailDomainsReducer:lo,documentsReducer:io,documentAttachmentReducer:Qu,teamReducer:wp,agentsReducer:qn,issueCommentReducer:Wl,issueCommentAttachmentReducer:Gl,issueUpdateReducer:cm,geoImageReducer:yl,issueAssociationReducer:Fl,issueTypeFieldsReducer:Rh,issueTypeFieldValuesReducer:gh,issueTypeFieldsAttachmentReducer:Ah,issueTypeFieldValuesAttachmentReducer:qh,issueTypeIdentifierReducer:kh,issueTypeIdentifierValueReducer:Lh,assetTypeFieldsReducer:nu,assetTypeFieldValuesReducer:gu,assetTypeFieldsAttachmentReducer:xd,assetTypeFieldValuesAttachmentReducer:mu,assetTypeIdentifierReducer:_u,assetTypeIdentifierValueReducer:wu,assetProcedureTypeReducer:Ur,assetProcedureReducer:Vr,assetProcedureTypeFieldsReducer:mr,assetProcedureFieldValuesReducer:Rr,assetProcedureTypeFieldsAttachmentReducer:cr,assetProcedureTypeFieldValuesAttachmentReducer:Sr,assetProcedureTypeAttachmentReducer:Jn,assetProcedureStepFieldsAttachmentReducer:Wr,assetProcedureStepFieldsReducer:Zr,assetProcedureStepFieldValuesAttachmentReducer:sd,assetProcedureStepFieldValuesReducer:ud,assetProcedureStepReducer:fd,teamMembershipReducer:Ip},Sb=d.combineReducers(jp);function Tb(t,e){return iy.useMemo(t,e)}class gb{constructor(e){S(this,"operations",[]);S(this,"getData");this.getData=e}performOperations(e){let i=e;for(const a of this.operations)i=a(i);return i}filter(e,i){return this.operations.push(a=>a.filter(c=>c[e]===i)),this}exclude(e,i){return this.operations.push(a=>a.filter(c=>c[e]!==i)),this}orderBy(e){return this.operations.push(i=>[...i].sort((a,c)=>a[e]<=c[e]?1:-1)),this}reverse(){return this.operations.push(e=>[...e].reverse()),this}all(){return this.operations.push(e=>e),this}get(e,i){return d.createSelector([this.getData],a=>this.performOperations(a).find(c=>c[e]===i))}count(){return d.createSelector([this.getData],e=>this.performOperations(e).length)}first(){return d.createSelector([this.getData],e=>this.performOperations(e)[0])}last(){return d.createSelector([this.getData],e=>{const i=this.performOperations(e);return i[i.length-1]})}exists(){return d.createSelector([this.getData],e=>this.performOperations(e).length>0)}toSelector(){return d.createSelector([this.getData],e=>T(this.performOperations(e)))}}const Vp=1e4,Le=200,qp={};class zp{constructor(e){S(this,"client");S(this,"pageSize",Vp);qp[this.constructor.name]=this,this.client=e}async enqueueRequest(e,i){return this.client.enqueueRequest(e,this.host,this.constructor.name,i)}async performPagination(e,i,a){const c=[];let n=await this.client.enqueueRequest(e,this.host,this.constructor.name,a);for(c.push(n.results);n.next;)n=await this.client.enqueueRequest(i(n.next),this.host,this.constructor.name,a),c.push(n.results);return c}dispatch(e){this.client.store.dispatch(e)}}const Dp=()=>kp.length-1,Up=t=>(t[it]={version:Dp()},t),Cp=()=>Up({}),Ib=t=>(t.outboxReducer&&(t.outboxReducer.deletedRequests=[]),t),bb=t=>e=>{var i;return e===void 0&&(e={}),((i=e[it])==null?void 0:i.version)===Dp()?e:t(e)},kp=[Up,Cp,Cp,Ib],Fb=Object.fromEntries(kp.map((t,e)=>[e,bb(t)])),Pb=t=>{if(t)throw t;const e=st();e?e.dispatch({type:"rehydrated/setRehydrated",payload:!0}):console.error("Client store not set")},Bp=(t,e,i)=>{const a=Ze();return a?(a.addRequest(e),a.getQueue()):(console.warn("Outbox coordinator not set; cannot enqueue request yet."),[])},$p=(t,e,i)=>{const a=Ze();if(!a)return console.warn("Outbox coordinator not set; cannot dequeue request yet."),[];const n=e.meta.offlineAction.payload.uuid;return a.remove(n),a.getQueue()};async function _b(t,e){if(!e.payload)throw new Error("Received empty payload");return xp(e)}const Ob={...on,effect:_b,discard:Lp,returnPromises:!0,persistCallback:Pb,retry:Eb,persistOptions:{storage:cy},queue:{...on.queue,enqueue:Bp,dequeue:$p,peek:(...t)=>Mb(...t)}},Rb=ny(Fb,it),vb=d.compose(ay.offline(Ob),Rb);function wb(t){function e(i){return typeof i=="object"&&i!==null&&["ok","redirect","clientError","serverError","error"].every(c=>c in i)}if(e(t))return t;if(typeof t=="object"&&t!==null){const i=t;if(e(i.response))return i.response;if(i.response&&e(i.response.response))return i.response.response}}async function sn(t,e,i){if(e.store.getState().outboxReducer.deletedRequests.includes(t.payload.uuid))throw new Error("Request was marked for deletion");const c=qp[t.meta.offline.effect.serviceName];if(!c)throw new Error(`Service ${t.meta.offline.effect.serviceName} not found`);const n=c instanceof O;n&&t.payload.checkAuth!==!1&&await c.auth.prepareAuth();const r={queryParams:"",isAuthNeeded:!0},u=t.meta.offline.effect,{payload:m,headers:o,method:h,queryParams:p,attachmentHash:y,isExternalUrl:f,isAuthNeeded:I,isResponseBlob:b}={...r,...u.request},R=u.request;let w=R.url;const q=y?await e.files.fetchCache(y):void 0;if(y&&!q)throw new Error(`Cannot upload file ${y} because it's not cached.`);!f&&!w.startsWith("http")&&(!w.startsWith("/")&&!w.startsWith("blob:")&&(w="/"+w),w=t.meta.offline.effect.BASE_URL+w);const Ne=V=>{if(y){const He=R.s3url;if(!He)throw new Error(`No S3 URL for file ${y}`);if("warning"in He)throw new Error(`S3 URL warning for file ${y}`);if(!q)throw new Error(`No file for file ${y}`);const Ot=He.fields["x-amz-checksum-sha1"];if(!Ot)throw new Error(`No checksum for file ${y}`);return V.set("x-amz-checksum-sha1",Ot).field({...m,...He.fields}).attach("file",q)}return V.send(m)},XF={[l.GET]:()=>b?Je.get(w.toString()).responseType("blob"):Je.get(w.toString()),[l.POST]:()=>{const V=Je.post(w.toString());return Ne(V)},[l.PATCH]:()=>{const V=Je.patch(w.toString());return Ne(V)},[l.PUT]:()=>{const V=Je.put(w.toString());return Ne(V)},[l.DELETE]:()=>{const V=Je.delete(w.toString());return Ne(V)}}[h];let Ke=XF();if(i==null||i.addEventListener("abort",()=>{console.debug("aborting request:",R),Ke.abort()}),I&&n){const V=c.auth.getAuthHeader();Ke=Ke.set("Authorization",V)}o&&(Ke=Ke.set(o));try{return await Ke.query(p)}catch(V){const He=wb(V),Ot=He==null?void 0:He.status;if(n&&Ot===401)return await c.auth.handleUnauthorized(Ke,He),Ke.query(p);throw new D({response:He,innerError:V,discard:Gp.includes(Ot)})}}const Gp=[400,409,403,404,405,500];function Lp(t,e,i=0){var o;if(console.debug("Considering discarding request due to error:",t,`(${typeof t})`,`
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
`)
|
|
7
|
-
`):`${c}: ${JSON.stringify(n)}`).join(`
|
|
8
|
-
`)}catch(c){console.error("Failed to extract error message from response body",c)}}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>jb?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:c}=i;this.message=i.message??Vb(a,c)??et,this.status=(a==null?void 0:a.status)??0,this.response=a,i.discard=i.discard??!1,this.options=i}}class qb extends zp{constructor(e){super(e)}}class O extends zp{constructor(i,a){super(i);S(this,"auth");this.auth=a}}class zb extends O{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(En(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(c=>{this.dispatch(Vn(c))})}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(jn(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(Mn(a)),a}}class j extends O{getNumberOfAttachmentsWithSha1(e){const{issueAttachmentReducer:i,assetAttachmentReducer:a,assetTypeAttachmentReducer:c,documentAttachmentReducer:n,projectAttachmentReducer:r,formRevisionAttachmentReducer:u,formSubmissionAttachmentReducer:m,geoImageReducer:o,assetTypeFieldsAttachmentReducer:h,assetTypeFieldValuesAttachmentReducer:p,issueTypeFieldsAttachmentReducer:y,issueTypeFieldValuesAttachmentReducer:f}=this.client.store.getState();return[].concat(Object.values(i.instances),Object.values(a.instances),Object.values(c.instances),Object.values(n.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(y.instances),Object.values(f.instances)).filter(b=>b.file_sha1===e).length}processPresignedUrls(e){const i={};for(const[a,c]of Object.entries(e))i[a]=this.enqueueRequest({url:c.url,description:"Upload file to S3",method:l.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:a,blockers:[`s3-${c.fields.key}`],blocks:[a],s3url:c});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{constructor(){super(...arguments);S(this,"pageSize",Le)}async _bulkAdd(i){var h;const{store:a}=this.client,c=(h=a.getState().userReducer.currentUser)==null?void 0:h.id,n=new Date().toISOString(),r=[],u=[],m={};for(const p of i){const{modelUuid:y,file:f}=p,I=await this.getFilePayload(f);I.sha1 in m||(m[I.sha1]=I);const b=this.buildModel({file:f,file_sha1:I.sha1,submitted_at:n,created_by:c,modelUuid:y});r.push(b),u.push(this.buildPayload(b,I))}this.dispatch(this.addAttachments(r));const o=this.enqueueRequest({description:`Add ${this.name}`,method:l.POST,url:`${this.url}/bulk/`,payload:{submitted_at:n,attachments:u,files:Object.values(m)},blocks:r.map(p=>this.getId(p)),blockers:r.map(p=>p.file_sha1)});return o.then(({attachments:p,presigned_urls:y})=>{this.dispatch(this.updateAttachments(p)),this.processPresignedUrls(y)}).catch(()=>{this.dispatch(this.removeAttachments(r.map(p=>this.getId(p))))}),[r,o.then(({attachments:p})=>p)]}async _delete(i){const{store:a}=this.client,c=this.selectAttachment(i)(a.getState());if(!c)throw new Error(`Attempting to delete attachment with uuid ${i} that does not exist in the store`);this.dispatch(this.removeAttachment(this.getId(c)));const n=this.enqueueRequest({description:`Delete ${this.name}`,method:l.DELETE,url:`${this.url}/${i}/`,blockers:[i],blocks:[]});return n.then(()=>{this.getNumberOfAttachmentsWithSha1(c.file_sha1)===0&&this.client.files.removeCache(c.file_sha1)}).catch(()=>{this.dispatch(this.setAttachment(c))}),n}}class Db extends We{constructor(){super(...arguments);S(this,"name","Asset Attachment");S(this,"url","/asset-attachments");S(this,"initializeAttachments",os);S(this,"addAttachments",ls);S(this,"updateAttachments",Un);S(this,"removeAttachments",hs);S(this,"removeAttachment",Cn);S(this,"setAttachment",Dn);S(this,"selectAttachment",$n)}getId(i){return i.uuid}buildModel(i){return F({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,asset:i.modelUuid})}buildPayload(i,a){return{uuid:i.uuid,file_name:i.file_name,file_sha1:i.file_sha1,file_extension:a.extension,asset:i.asset}}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 n=(await this.performPagination({immediate:!0,description:"Get asset attachments",method:l.GET,url:`${this.url}/`,queryParams:{limit:Le,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(os(n)),n}}class Ub extends We{constructor(){super(...arguments);S(this,"name","Asset Procedure Attachment");S(this,"url","/asset-procedure-type-attachments");S(this,"initializeAttachments",ps);S(this,"addAttachments",Hn);S(this,"updateAttachments",Kn);S(this,"removeAttachments",Zn);S(this,"removeAttachment",Yn);S(this,"setAttachment",Wn);S(this,"selectAttachment",xn)}getId(i){return i.uuid}buildModel(i){return F({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,asset_procedure_type:i.modelUuid})}buildPayload(i,a){return{uuid:i.uuid,file_name:i.file_name,file_sha1:i.file_sha1,file_extension:a.extension,asset_procedure_type:i.asset_procedure_type}}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 c=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(ps(c)),c}}class Cb 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,c={},n=[],r=[];for(const o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:y}=o,f=await this.getFilePayload(y);f.sha1 in c||(c[f.sha1]=f);const I=F({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:f.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});n.push(I);const b={uuid:I.uuid,file_name:y.name,field_identifier:p,file_extension:f.extension,file_sha1:f.sha1,fields_revision:h};r.push(b)}this.dispatch(sr(n));const u=this.enqueueRequest({description:"Add asset procedure type fields attachments",method:l.POST,url:"/asset-procedure-type-fields-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(o=>o.fields_revision),blocks:n.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(ir(o.attachments))}).catch(()=>{this.dispatch(ar(n.map(o=>o.uuid)))}),[n,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset procedure type fields attachments",method:l.GET,url:"/asset-procedure-type-fields-attachments/",queryParams:{fields_revision__asset_procedure_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(tr(a)),a}}class kb extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(or(n));const r=this.enqueueRequest({description:"Add Asset Procedure Type Fields",method:l.POST,url:"/asset-procedure-type-fields/",payload:v(n),blockers:[n.asset_procedure_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(lr(m))}).catch(m=>{throw this.dispatch(hr(n.uuid)),m}),[n,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Asset Procedure Type Fields",method:l.GET,url:"/asset-procedure-type-fields/",queryParams:{asset_procedure_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(ur(a)),a}}function Ye(t,e){const i=[];let a=0;const c=t.length;for(;a<c;)i.push(t.slice(a,a+=e));return i}class Bb extends j{async bulkAdd(e,i){var o;const a=new Date().toISOString(),c=(o=this.client.store.getState().userReducer.currentUser)==null?void 0:o.id,n=Ye(e,i??e.length),r=[],u=[];for(const h of n){const p={},y=[];for(const f of h){const{fieldValuesUuid:I,fieldIdentifier:b,file:R}=f,w=await this.getFilePayload(R);w.sha1 in p||(p[w.sha1]=w);const q=F({file:URL.createObjectURL(R),file_type:R.type,file_name:R.name,file_sha1:w.sha1,created_by:c,field_values:I,submitted_at:a,field_identifier:b});r.push(q);const Ne={uuid:q.uuid,file_name:R.name,file_sha1:w.sha1,file_extension:w.extension,field_identifier:b,field_values:I};y.push(Ne)}u.push({submitted_at:a,attachments:y,files:Object.values(p)})}this.dispatch(wt(r));const m=u.map(h=>this.enqueueRequest({description:"Add asset procedure type field values attachments",method:l.POST,url:"/asset-procedure-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 y of h)this.processPresignedUrls(y.presigned_urls);const p=h.flatMap(y=>y.attachments);this.dispatch(fr(p))}).catch(h=>{throw this.dispatch(Mt(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(),c=gr(e)(a);this.dispatch(Mt(e));try{await this.enqueueRequest({description:"Delete asset procedure type field values attachments",method:l.DELETE,url:"/asset-procedure-type-field-values-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(n){throw this.dispatch(wt(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset procedure type field values attachments",method:l.GET,url:"/asset-procedure-type-field-values-attachments/",queryParams:{limit:Le,paginate:!0,field_values__asset_procedure__project:e,latest:!0},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset procedure type field values attachments",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Ar(c)),c}}class $b extends O{add(e){var r;const{store:i}=this.client,a=i.getState(),c=F({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),n=this.enqueueRequest({description:"Add asset procedure type field values",method:l.POST,url:"/asset-procedure-type-field-values/",payload:v(c),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[c.uuid]});return this.dispatch(Is(c)),n.then(u=>(this.dispatch(at(u)),u)).catch(()=>{this.dispatch(bs(c.uuid))}),[c,n]}bulkAdd(e,i){var m;const a=new Date().toISOString(),c=[],n=Ye(e.payloads,i??e.payloads.length),r=[];for(const o of n){const h=[];for(const p of o){const y=F({...p,values:p.values,created_by:(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,submitted_at:a});c.push(y),h.push({uuid:y.uuid,asset:p.asset,fields_revision:p.fields_revision,asset_procedure:p.asset_procedure,published_at:p.published_at,values:y.values})}r.push({submitted_at:a,values:e.values,field_values:h})}this.dispatch(Pr(c));const u=[];for(const o of r){const h=o.field_values.map(b=>b.asset),p=o.field_values.map(b=>b.fields_revision),y=o.field_values.map(b=>b.asset_procedure),f=o.field_values.map(b=>b.uuid),I=this.enqueueRequest({description:"Bulk add asset procedure type field values",method:l.POST,url:"/asset-procedure-type-field-values/bulk/",payload:o,blockers:[...h,...p,...y],blocks:f});u.push(I)}return Promise.all(u).then(o=>{this.dispatch(_r(o.flat()))}).catch(()=>{this.dispatch(Or(c.map(o=>o.uuid)))}),[c,u]}update(e){const{store:i}=this.client,a=i.getState(),c=Ps(e.uuid)(a);if(!c)throw new Error(`Expected AssetProcedureTypeFieldValues with uuid ${e.uuid} to exist`);const n={...c,...e};this.dispatch(at(n));const r=this.enqueueRequest({description:"Update asset procedure type field values",method:l.PATCH,url:`/asset-procedure-type-field-values/${e.uuid}/`,payload:e,blockers:[n.fields_revision,n.asset,n.asset_procedure],blocks:[n.uuid]});return r.then(u=>{this.dispatch(at(u))}).catch(()=>{this.dispatch(at(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Ps(e)(a);if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const n=Ir(e)(a);this.dispatch(bs(e)),this.dispatch(Mt(n.map(r=>r.uuid)));try{await this.enqueueRequest({description:"Delete asset procedure type field values",method:l.DELETE,url:`/asset-procedure-type-field-values/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(Is(c)),this.dispatch(wt(n)),r}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset procedure type field values",method:l.GET,url:"/asset-procedure-type-field-values/",queryParams:{limit:this.pageSize,paginate:!0,asset_procedure__project:e,latest:!0},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset procedure type field values",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Fr(c)),c}}class Gb extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(Os(n));const r=this.enqueueRequest({description:"Create asset procedure",method:l.POST,url:"/asset-procedures/",payload:v(n),blockers:[e.asset_procedure_type,e.asset_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(ct(m))}).catch(()=>{this.dispatch(Rs(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=Ms(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset procedure with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(ct(c));const n=this.enqueueRequest({description:"Update asset procedure",method:l.PATCH,url:`/asset-procedures/${e.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return n.then(r=>{this.dispatch(ct(r))}).catch(()=>{this.dispatch(ct(a))}),[c,n]}async remove(e){const{store:i}=this.client,a=i.getState(),c=Ms(e)(a);if(!c)throw new Error(`Expected asset procedure with uuid ${e} to exist`);return this.dispatch(Rs(e)),this.enqueueRequest({description:"Delete asset procedure",method:l.DELETE,url:`/asset-procedures/${e}/`,blockers:[e],blocks:[]}).catch(n=>{throw this.dispatch(Os(c)),n})}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset procedures",method:l.GET,url:"/asset-procedures/",queryParams:{limit:this.pageSize,paginate:!0,project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset procedures",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Mr(c)),c}}class Lb extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(js(n));const r=this.enqueueRequest({description:"Create asset procedure type",method:l.POST,url:"/asset-procedure-types/",payload:v(n),blockers:[],blocks:[n.uuid]});return r.then(m=>{this.dispatch(nt(m))}).catch(()=>{this.dispatch(Vs(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=zs(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset procedure type with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(nt(c));const n=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 n.then(r=>{this.dispatch(nt(r))}).catch(()=>{this.dispatch(nt(a))}),[c,n]}async remove(e){const{store:i}=this.client,a=i.getState(),c=zs(e)(a);if(!c)throw new Error(`Expected asset procedure type with uuid ${e} to exist`);const n=qr(e)(a);return this.dispatch(Vs(e)),this.dispatch(jr(n.map(({uuid:r})=>r))),this.enqueueRequest({description:"Delete asset procedure type",method:l.DELETE,url:`/asset-procedure-types/${e}/`,blockers:[e],blocks:[]}).catch(r=>{throw this.dispatch(js(c)),this.dispatch(Er(n)),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(Dr(a)),a}}class Nb 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,c={},n=[],r=[];for(const o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:y}=o,f=await this.getFilePayload(y);f.sha1 in c||(c[f.sha1]=f);const I=F({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:f.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});n.push(I);const b={uuid:I.uuid,file_name:y.name,field_identifier:p,file_extension:f.extension,file_sha1:f.sha1,fields_revision:h};r.push(b)}this.dispatch($r(n));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(c)},blockers:n.map(o=>o.fields_revision),blocks:n.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(Gr(o.attachments))}).catch(()=>{this.dispatch(Lr(n.map(o=>o.uuid)))}),[n,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(Br(a)),a}}class Hb extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(Cs(n));const r=this.enqueueRequest({description:"Add Asset Procedure Step Fields",method:l.POST,url:"/asset-procedure-step-fields/",payload:v(n),blockers:[n.asset_procedure_step],blocks:[n.uuid]});return r.then(m=>{this.dispatch(rt(m))}).catch(m=>{throw this.dispatch(ks(n.uuid)),m}),[n,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 c={...a,...e};this.dispatch(rt(c));const n=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 n.then(r=>{this.dispatch(rt(r))}).catch(r=>{throw this.dispatch(rt(a)),r}),[c,n]}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(ks(e));const c=this.enqueueRequest({description:"Delete Asset Procedure Step Fields",method:l.DELETE,url:`/asset-procedure-step-fields/${e}/`,blockers:[e],blocks:[e]});return c.catch(n=>{throw this.dispatch(Cs(a)),n}),c}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(Yr(a)),a}}class Wb extends j{async bulkAdd(e,i){var o;const a=new Date().toISOString(),c=(o=this.client.store.getState().userReducer.currentUser)==null?void 0:o.id,n=Ye(e,i??e.length),r=[],u=[];for(const h of n){const p={},y=[];for(const f of h){const{fieldValuesUuid:I,fieldIdentifier:b,file:R}=f,w=await this.getFilePayload(R);w.sha1 in p||(p[w.sha1]=w);const q=F({file:URL.createObjectURL(R),file_type:R.type,file_name:R.name,file_sha1:w.sha1,created_by:c,field_values:I,submitted_at:a,field_identifier:b});r.push(q);const Ne={uuid:q.uuid,file_name:R.name,file_sha1:w.sha1,file_extension:w.extension,field_identifier:b,field_values:I};y.push(Ne)}u.push({submitted_at:a,attachments:y,files:Object.values(p)})}this.dispatch(Et(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 y of h)this.processPresignedUrls(y.presigned_urls);const p=h.flatMap(y=>y.attachments);this.dispatch(Qr(p))}).catch(h=>{throw this.dispatch(jt(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(),c=ed(e)(a);this.dispatch(jt(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(n){throw this.dispatch(Et(c)),n}}async refreshStore(e,i){const c=(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:Le,paginate:!0,field_values__asset_procedure__project:e,latest:!0},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset procedure step field values attachments",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Xr(c)),c}}class Kb extends O{add(e){var r;const{store:i}=this.client,a=i.getState(),c=F({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),n=this.enqueueRequest({description:"Add asset procedure step field values",method:l.POST,url:"/asset-procedure-step-field-values/",payload:v(c),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[c.uuid]});return this.dispatch(Hs(c)),n.then(u=>(this.dispatch(dt(u)),u)).catch(()=>{this.dispatch(Ws(c.uuid))}),[c,n]}bulkAdd(e,i){var m;const a=new Date().toISOString(),c=[],n=Ye(e.payloads,i??e.payloads.length),r=[];for(const o of n){const h=[];for(const p of o){const y=F({...p,values:p.values,created_by:(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,submitted_at:a});c.push(y),h.push({uuid:y.uuid,asset:p.asset,fields_revision:p.fields_revision,asset_procedure:p.asset_procedure,asset_procedure_step:p.asset_procedure_step,published_at:p.published_at,values:y.values})}r.push({submitted_at:a,values:e.values,field_values:h})}this.dispatch(cd(c));const u=[];for(const o of r){const h=o.field_values.map(b=>b.asset),p=o.field_values.map(b=>b.fields_revision),y=o.field_values.map(b=>b.asset_procedure),f=o.field_values.map(b=>b.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,...y],blocks:f});u.push(I)}return Promise.all(u).then(o=>{this.dispatch(nd(o.flat()))}).catch(()=>{this.dispatch(rd(c.map(o=>o.uuid)))}),[c,u]}update(e){const{store:i}=this.client,a=i.getState(),c=Ks(e.uuid)(a);if(!c)throw new Error(`Expected AssetProcedureStepFieldValues with uuid ${e.uuid} to exist`);const n={...c,...e};this.dispatch(dt(n));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:[n.fields_revision,n.asset,n.asset_procedure],blocks:[n.uuid]});return r.then(u=>{this.dispatch(dt(u))}).catch(()=>{this.dispatch(dt(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Ks(e)(a);if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const n=td(e)(a);this.dispatch(Ws(e)),this.dispatch(jt(n.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(Hs(c)),this.dispatch(Et(n)),r}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset procedure step field values",method:l.GET,url:"/asset-procedure-step-field-values/",queryParams:{limit:this.pageSize,paginate:!0,asset_procedure__project:e,latest:!0},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset procedure step field values",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(ad(c)),c}}class Yb extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(md(n));const r=this.enqueueRequest({description:"Create asset procedure step",method:l.POST,url:"/asset-procedure-steps/",payload:v(n),blockers:[n.asset_procedure_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(qt(m))}).catch(()=>{this.dispatch(yd(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=Zs(e.uuid)(i.getState());if(!a)throw new Error(`No asset procedure step with uuid ${e.uuid} found in the store`);const c={...a,...e};this.dispatch(qt(c));const n=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 n.then(r=>{this.dispatch(qt(r))}).catch(()=>{this.dispatch(hd(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Zs(e)(a);if(!c)throw new Error(`No asset procedure step with uuid ${e} found in the store`);const n=Td(e)(a);return this.dispatch(Ad([e,...Pn(n)])),this.enqueueRequest({description:"Delete asset stage",method:l.DELETE,url:`/asset-procedure-steps/${e}/`,blockers:[e],blocks:[]}).catch(r=>{throw this.dispatch(pd([c,...n])),r})}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(ld(a)),a}}class Zb extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(Xs(n));const r=this.enqueueRequest({description:"Create asset",method:l.POST,url:"/assets/",payload:v(n),blockers:[n.asset_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(ot(m))}).catch(()=>{this.dispatch(Qs(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=si(e.uuid)(i.getState());if(!a)throw new Error(`No asset with uuid ${e.uuid} found in the store`);const c={...a,...e};this.dispatch(ot(c));const n=this.enqueueRequest({description:"Edit asset",method:l.PATCH,url:`/assets/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(ot(r))}).catch(()=>{this.dispatch(ot(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=si(e)(a);if(!c)throw new Error(`No asset with uuid ${e} found in the store`);const n=Gn(e)(a),r=bl(e)(a);if(this.dispatch(Qs(e)),n.length>0){const u=n.map(({uuid:m})=>m);this.dispatch(hs(u))}if(r.length>0){const u=r.map(({uuid:m})=>m);this.dispatch(wa(u))}return this.enqueueRequest({description:"Delete asset",method:l.DELETE,url:`/assets/${e}/`,blockers:[e],blocks:[]}).catch(u=>{throw this.dispatch(Xs(c)),this.dispatch(ls(n)),this.dispatch(Ra(r)),u})}bulkAdd(e,i,a,c){const n=new Date().toISOString(),r=Xe.v4(),u=Ye(e,c).map(h=>{const p=h.map(y=>F(y));return{batchId:Xe.v4(),payload:{transaction_id:r,submitted_at:n,asset_type:i,project:a,assets:p}}}),m=[];let o=null;for(const h of u){const{batchId:p,payload:y}=h,f=y.assets.map(w=>w.uuid),I=[i];o&&I.push(o);const b=f;b.push(p);const R=this.enqueueRequest({description:"Batch create assets",method:l.POST,url:"/assets/bulk/",payload:y,blockers:I,blocks:b});o=h.batchId,m.push(R)}return Promise.all(m).then(h=>{const p=h.flat();this.dispatch(zt(p))}),m}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),c=Fd(e)(a);this.dispatch(xs(e));try{await this.enqueueRequest({description:"Bulk delete assets",method:l.DELETE,url:"/assets/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(n){throw this.dispatch(zt(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get assets",method:l.GET,url:"/assets/",queryParams:{limit:this.pageSize,paginate:!0,project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get assets",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Id(c)),c}}class Jb extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(ai(n));const r=this.enqueueRequest({description:"Add asset stage completion",method:l.POST,url:"/asset-stage-completions/",payload:v(n),blockers:[e.asset,e.asset_stage],blocks:[n.uuid]});return r.then(m=>{this.dispatch(Rd(m))}).catch(()=>{this.dispatch(ni(n.uuid))}),[n,r]}delete(e){const{store:i}=this.client,a=Md(e)(i.getState());if(!a)throw new Error(`Expected asset stage completion with uuid ${e} to exist`);this.dispatch(ni(e));const c=this.enqueueRequest({description:"Delete asset stage completion",method:l.DELETE,url:`/asset-stage-completions/${e}/`,blockers:[e],blocks:[]});return c.catch(()=>{this.dispatch(ai(a))}),c}bulkAdd(e){var o;const{store:i}=this.client,a=new Date().toISOString(),c=(o=i.getState().userReducer.currentUser)==null?void 0:o.id,n=e.map(h=>F(h)),r=n.map(h=>({...h,created_by:c,submitted_at:a})),u=r.map(({uuid:h})=>h);this.dispatch(ci(r));const m=this.enqueueRequest({description:"Bulk create asset stage completions",method:l.POST,url:"/asset-stage-completions/bulk/",payload:{submitted_at:a,completions:n},blockers:[...e.map(h=>h.asset_procedure),...e.map(h=>h.asset_stage),...e.map(h=>h.asset)],blocks:u});return m.then(h=>{this.dispatch(vd(h))}).catch(()=>{this.dispatch(ri(u))}),[r,m]}bulkDelete(e){const{store:i}=this.client,a=Ed(e)(i.getState());this.dispatch(ri(e));const c=this.enqueueRequest({description:"Deleting asset stage completions",method:l.DELETE,url:"/asset-stage-completions/bulk/",payload:{uuids:e},blockers:e,blocks:[]});return c.catch(()=>{this.dispatch(ci(a))}),c}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset stage completions",method:l.GET,url:"/asset-stage-completions/",queryParams:{limit:this.pageSize,paginate:!0,asset_procedure__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset stage completions",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Od(c)),c}}class Xb extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(oi(n));const r=this.enqueueRequest({description:"Create asset",method:l.POST,url:"/asset-stages/",payload:v(n),blockers:[n.asset_procedure_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(Dt(m))}).catch(()=>{this.dispatch(li(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=hi(e.uuid)(i.getState());if(!a)throw new Error(`No asset stage with uuid ${e.uuid} found in the store`);const c={...a,...e};this.dispatch(Dt(c));const n=this.enqueueRequest({description:"Update asset stage",method:l.PATCH,url:`/asset-stages/${a.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return n.then(r=>{this.dispatch(Dt(r))}).catch(()=>{this.dispatch(qd(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=hi(e)(a);if(!c)throw new Error(`No asset stage with uuid ${e} found in the store`);return this.dispatch(li(e)),this.enqueueRequest({description:"Delete asset stage",method:l.DELETE,url:`/asset-stages/${e}/`,blockers:[e],blocks:[]}).catch(n=>{throw this.dispatch(oi(c)),n})}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(Vd(a)),a}}class Qb extends We{constructor(){super(...arguments);S(this,"name","Asset Type Attachment");S(this,"url","/asset-type-attachments");S(this,"initializeAttachments",pi);S(this,"addAttachments",yi);S(this,"updateAttachments",kd);S(this,"removeAttachments",Ai);S(this,"removeAttachment",Bd);S(this,"setAttachment",Cd);S(this,"selectAttachment",Ld)}getId(i){return i.uuid}buildModel(i){return F({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,asset_type:i.modelUuid})}buildPayload(i,a){return{uuid:i.uuid,file_name:i.file_name,file_sha1:i.file_sha1,file_extension:a.extension,asset_type:i.asset_type}}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 c=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(pi(c)),c}}class xb 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,c={},n=[],r=[];for(const o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:y}=o,f=await this.getFilePayload(y);f.sha1 in c||(c[f.sha1]=f);const I=F({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:f.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});n.push(I);const b={uuid:I.uuid,file_name:y.name,field_identifier:p,file_extension:f.extension,file_sha1:f.sha1,fields_revision:h};r.push(b)}this.dispatch(Yd(n));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(c)},blockers:n.map(o=>o.fields_revision),blocks:n.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(Zd(o.attachments))}).catch(()=>{this.dispatch(Jd(n.map(o=>o.uuid)))}),[n,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(Kd(a)),a}}class eF extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(su(n));const r=this.enqueueRequest({description:"Add Asset Type Fields",method:l.POST,url:"/asset-type-fields/",payload:v(n),blockers:[n.asset_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(iu(m))}).catch(m=>{throw this.dispatch(au(n.uuid)),m}),[n,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(tu(a)),a}}class tF extends j{async bulkAdd(e,i){var o;const a=new Date().toISOString(),c=(o=this.client.store.getState().userReducer.currentUser)==null?void 0:o.id,n=Ye(e,i??e.length),r=[],u=[];for(const h of n){const p={},y=[];for(const f of h){const{fieldValuesUuid:I,fieldIdentifier:b,file:R}=f,w=await this.getFilePayload(R);w.sha1 in p||(p[w.sha1]=w);const q=F({file:URL.createObjectURL(R),file_type:R.type,file_name:R.name,file_sha1:w.sha1,created_by:c,field_values:I,submitted_at:a,field_identifier:b});r.push(q);const Ne={uuid:q.uuid,file_name:R.name,file_sha1:w.sha1,file_extension:w.extension,field_identifier:b,field_values:I};y.push(Ne)}u.push({submitted_at:a,attachments:y,files:Object.values(p)})}this.dispatch(kt(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 y of h)this.processPresignedUrls(y.presigned_urls);const p=h.flatMap(y=>y.attachments);this.dispatch(uu(p))}).catch(h=>{throw this.dispatch(Bt(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(),c=lu(e)(a);this.dispatch(Bt(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(n){throw this.dispatch(kt(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset type field values attachments",method:l.GET,url:"/asset-type-field-values-attachments/",queryParams:{limit:Le,paginate:!0,field_values__asset__project:e,latest:!0},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset type field values attachments",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(du(c)),c}}class sF extends O{add(e){var r;const{store:i}=this.client,a=i.getState(),c=F({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),n=this.enqueueRequest({description:"Add asset type field values",method:l.POST,url:"/asset-type-field-values/",payload:v(c),blockers:[e.asset,e.fields_revision],blocks:[c.uuid]});return this.dispatch(bi(c)),n.then(u=>(this.dispatch(lt(u)),u)).catch(()=>{this.dispatch(Fi(c.uuid))}),[c,n]}bulkAdd(e,i){var m;const a=new Date().toISOString(),c=[],n=Ye(e.payloads,i??e.payloads.length),r=[];for(const o of n){const h=[];for(const p of o){const y=F({...p,values:p.values,created_by:(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,submitted_at:a});c.push(y),h.push({uuid:y.uuid,asset:p.asset,fields_revision:p.fields_revision,published_at:p.published_at,values:y.values})}r.push({submitted_at:a,values:e.values,field_values:h})}this.dispatch(Au(c));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),y=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:y});u.push(f)}return Promise.all(u).then(o=>{this.dispatch(fu(o.flat()))}).catch(()=>{this.dispatch(Su(c.map(o=>o.uuid)))}),[c,u]}update(e){const{store:i}=this.client,a=i.getState(),c=_i(e.uuid)(a);if(!c)throw new Error(`Expected AssetTypeFieldValues with uuid ${e.uuid} to exist`);const n={...c,...e};this.dispatch(lt(n));const r=this.enqueueRequest({description:"Delete asset type field values",method:l.PATCH,url:`/asset-type-field-values/${e.uuid}/`,payload:e,blockers:[n.uuid,n.fields_revision,n.asset],blocks:[n.uuid]});return r.then(u=>{this.dispatch(lt(u))}).catch(()=>{this.dispatch(lt(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=_i(e)(a);if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const n=hu(e)(a);this.dispatch(Fi(e)),this.dispatch(Bt(n.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(bi(c)),this.dispatch(kt(n)),r}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset type field values",method:l.GET,url:"/asset-type-field-values/",queryParams:{limit:this.pageSize,paginate:!0,asset__project:e,latest:!0},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset type field values",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(yu(c)),c}}class iF extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(Ri(n));const r=this.enqueueRequest({description:"Create asset type identifier",method:l.POST,url:"/asset-type-identifiers/",payload:v(n),blockers:[n.asset_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(ht(m))}).catch(()=>{this.dispatch(vi(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=wi(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset type identifier with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(ht(c));const n=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 n.then(r=>{this.dispatch(ht(r))}).catch(()=>{this.dispatch(ht(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=wi(e)(a);if(!c)throw new Error(`Expected asset type identifier with uuid ${e} to exist`);this.dispatch(vi(e));try{return await this.enqueueRequest({description:"Delete asset type identifier",method:l.DELETE,url:`/asset-type-identifiers/${e}/`,blockers:[e],blocks:[]})}catch(n){throw this.dispatch(Ri(c)),n}}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(bu(a)),a}}class aF extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(Ei(n));const r=this.enqueueRequest({description:"Create asset type identifier value",method:l.POST,url:"/asset-type-identifier-values/",payload:v(n),blockers:[e.asset,e.asset_type_identifier],blocks:[n.uuid]});return r.then(m=>{this.dispatch(mt(m))}).catch(()=>{this.dispatch(ji(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=qi(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset type identifier value with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(mt(c));const n=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 n.then(r=>{this.dispatch(mt(r))}).catch(()=>{this.dispatch(mt(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=qi(e)(a);if(!c)throw new Error(`Expected asset type identifier value with uuid ${e} to exist`);this.dispatch(ji(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(n){throw this.dispatch(Ei(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset type identifier values",method:l.GET,url:"/asset-type-identifier-values/",queryParams:{limit:this.pageSize,paginate:!0,asset__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset type identifier values",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Ru(c)),c}}class cF extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(Di(n));const r=this.enqueueRequest({description:"Create asset type",method:l.POST,url:"/asset-types/",payload:v(n),blockers:[],blocks:[n.uuid]});return r.then(m=>{this.dispatch(pt(m))}).catch(()=>{this.dispatch(Ui(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=ki(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset type with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(pt(c));const n=this.enqueueRequest({description:"Update asset type",method:l.PATCH,url:`/asset-types/${e.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return n.then(r=>{this.dispatch(pt(r))}).catch(()=>{this.dispatch(pt(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=ki(e)(a);if(!c)throw new Error(`Expected asset type with uuid ${e} to exist`);const n=ti(e)(a),r=Nd(e)(a);return this.dispatch(Ui(e)),this.dispatch(xs(n.map(u=>u.uuid))),this.dispatch(Ai(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(Di(c)),this.dispatch(zt(n)),this.dispatch(yi(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(Eu(a)),a}}class nF extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch($i(n));const r=this.enqueueRequest({description:"Create Category",method:l.POST,url:"/categories/",payload:v(n),blockers:[e.project],blocks:[n.uuid]});return[n,r]}update(e){const i=this.client.store.getState(),a=Li(e.uuid)(i);if(!a)throw new Error(`Expected an existing category with uuid ${e.uuid}`);const c={...a,...e};this.dispatch(ku(c));const n=this.enqueueRequest({description:"Edit Category",method:l.PATCH,url:`/categories/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return[c,n]}remove(e){const{store:i}=this.client,a=Li(e)(i.getState());if(!a)throw new Error(`No category with uuid ${e} found in the store`);this.dispatch(Bu(e));const c=this.enqueueRequest({description:"Delete Category",method:l.DELETE,url:`/categories/${a.uuid}/`,blockers:[a.uuid],blocks:[]});return c.catch(()=>{this.dispatch($i(a))}),c}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(Cu(a)),a}}class rF extends We{constructor(){super(...arguments);S(this,"name","Document Attachment");S(this,"url","/document-attachments");S(this,"initializeAttachments",Hi);S(this,"addAttachments",Nu);S(this,"updateAttachments",Wu);S(this,"removeAttachments",Yu);S(this,"removeAttachment",Ku);S(this,"setAttachment",Hu);S(this,"selectAttachment",Xu)}getId(i){return i.uuid}buildModel(i){return F({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,document:i.modelUuid})}buildPayload(i,a){return{uuid:i.uuid,file_name:i.file_name,file_sha1:i.file_sha1,file_extension:a.extension,document:i.document}}async bulkAdd(i){var p;const{store:a}=this.client,c=(p=a.getState().userReducer.currentUser)==null?void 0:p.id,n=new Date().toISOString(),r=[],u=[],m={},o={};for(const y of i){const{documentUuid:f,file:I}=y,b=await this.getFilePayload(I);b.sha1 in m||(m[b.sha1]=b,o[b.sha1]=[]);const R=this.buildModel({file:I,file_sha1:b.sha1,submitted_at:n,created_by:c,modelUuid:f});r.push(R),u.push(this.buildPayload(R,b)),o[b.sha1].push(R.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:n,attachments:u,files:Object.values(m)},blocks:r.map(y=>y.uuid),blockers:r.map(y=>y.file_sha1)});return h.then(({attachments:y,presigned_urls:f})=>{this.dispatch(this.updateAttachments(y));const I=this.processPresignedUrls(f);for(const[b,R]of Object.entries(I))R.then(()=>{const w=o[b];for(const q of w)this.makeReadable(q)})}).catch(()=>{this.dispatch(this.removeAttachments(r.map(y=>y.uuid)))}),[r,h.then(({attachments:y})=>y)]}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 c=await this.enqueueRequest({immediate:!0,description:"Get document attachments",method:l.GET,url:"/document-attachments/",queryParams:{document__project__organization:i},blocks:[],blockers:[]},a),n=await this.enqueueRequest({immediate:!0,description:"Get document attachments",method:l.GET,url:"/document-attachments/",queryParams:{document__organization:i},blocks:[],blockers:[]},a),r=[...c,...n];return this.dispatch(Hi(r)),r}}class dF extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(to([n]));const r=this.enqueueRequest({description:"Create Document",method:l.POST,url:"/documents/",payload:v(n),queryParams:{parent_document:n.parent_document??void 0},blockers:n.parent_document?[n.parent_document]:[],blocks:[n.uuid]});return r.catch(()=>{this.dispatch(Ki([n.uuid]))}),[n,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 c={...a,...e};this.dispatch(xe([c]));const n=this.enqueueRequest({description:"Update Document",method:l.PATCH,url:`/documents/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.catch(()=>{xe([a])}),[c,n]}delete(e){const{store:i}=this.client,a=Gt(i.getState()),c=so(e)(i.getState());if(!c)throw new Error(`attempting to delete a document with uuid ${e} that does not exist in store.documents`);const n=c.parent_document?a[c.parent_document]:void 0;this.dispatch(Ki([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([c])),n&&this.dispatch(xe([n]))}),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),c=this.enqueueRequest({immediate:!0,description:"Get organization documents",method:l.GET,url:"/documents/",queryParams:{organization:e},blockers:[],blocks:[]},i),n=[...await a,...await c];return this.dispatch(eo(n)),n}}class uF extends O{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(ro(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(no(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(co(a)),a}}class oF extends O{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={},an=new Set;let es=0,cn=0,nn=0;const lF=20;class hF extends O{constructor(){super(...arguments);S(this,"host");S(this,"_dbPromise",ry.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 c=await ns(a,i),n=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-${c}`]});return"url"in n&&this.dispatch(po({sha1:i,...n})),n}async addCache(i,a){if(an.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 c=await this._dbPromise;!!await c.get("files",a)?(console.error("File already cached (this is unexpected at this point):",i.name,a),es++):(await c.put("files",i,a),cn++),an.add(a),nn++,nn%lF===0&&console.debug(`File cache summary: ${es} hits and ${cn} misses, ${es/(es+cn)*100}% hit rate over ${nn} calls to addCache.`)}async removeCache(i){await(await this._dbPromise).delete("files",i),an.delete(i)}async fetchCache(i){return(await this._dbPromise).get("files",i)}async getOrRenewUploadUrl(i){const a=this.client.store.getState();return yo(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 c=await ns(a,i),n={file_name:a.name,file_sha1:i,file:c},r=await this.getOrRenewUploadUrl(i);if("warning"in r){if(r.warning==="already_uploaded")return[n,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-${c}`],blocks:[i],s3url:r});return[n,m]}async fetchFileFromUrl(i,a,c){const n=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 gn(i),p=new File([h],c??a,{type:h.type});return await this.addCache(p,a),p}let u=xt[n],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 y=new File([p],c??a,{type:p.type});h(y)})}),xt[n]=u);let o;try{o=await u}catch(h){throw m&&h instanceof D&&delete xt[n],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
|
-
expected hash (${a}). This can happen if you're using a local development server and the
|
|
1
|
+
(function(i,L){typeof exports=="object"&&typeof module<"u"?L(exports,require("@redux-offline/redux-offline/lib/types"),require("@reduxjs/toolkit"),require("superagent"),require("uuid"),require("react"),require("file-saver"),require("fast-tree-builder"),require("ts-tree-lib"),require("@redux-offline/redux-offline"),require("@redux-offline/redux-offline/lib/defaults"),require("localforage"),require("redux-persist-migrate"),require("buffer"),require("@overmap-ai/forms"),require("idb"),require("jwt-decode"),require("dependency-graph"),require("@tiptap/core")):typeof define=="function"&&define.amd?define(["exports","@redux-offline/redux-offline/lib/types","@reduxjs/toolkit","superagent","uuid","react","file-saver","fast-tree-builder","ts-tree-lib","@redux-offline/redux-offline","@redux-offline/redux-offline/lib/defaults","localforage","redux-persist-migrate","buffer","@overmap-ai/forms","idb","jwt-decode","dependency-graph","@tiptap/core"],L):(i=typeof globalThis<"u"?globalThis:i||self,L(i["overmap-core"]={},null,i.toolkit,i.request,i.uuid,i.react,i.fileSaver,i.buildTree,i.tsTreeLib,i.reduxOffline,i.offlineConfig,i.localforage,i.createMigration,null,null,i.idb,i.jwtDecode,i.dependencyGraph))})(this,function(i,L,l,pt,rt,ab,rb,db,pc,ub,yc,lb,ob,gR,MR,hb,mb,pb){"use strict";var bR=Object.defineProperty;var _R=(i,L,l)=>L in i?bR(i,L,{enumerable:!0,configurable:!0,writable:!0,value:l}):i[L]=l;var h=(i,L,l)=>_R(i,typeof L!="symbol"?L+"":L,l);var nb;const fc=Object.freeze([]),Sc=Object.freeze({}),Ac=6e4;var Ic=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))(Ic||{}),o=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(o||{}),Tc=(t=>(t[t.PLANNED=0]="PLANNED",t[t.ACTIVE=1]="ACTIVE",t[t.MAINTENANCE=2]="MAINTENANCE",t[t.INACTIVE=3]="INACTIVE",t[t.RETIRED=4]="RETIRED",t[t.DISPOSED=5]="DISPOSED",t))(Tc||{}),Pc=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(Pc||{}),$=(t=>(t.STATUS="status",t.PRIORITY="priority",t.DESCRIPTION="description",t.TITLE="title",t.ASSIGNED_TO="assigned_to",t.DUE_DATE="due_date",t))($||{}),Oc=(t=>(t[t.BACKLOG=0]="BACKLOG",t[t.PLANNED=1]="PLANNED",t[t.IN_PROGRESS=2]="IN_PROGRESS",t[t.COMPLETED=3]="COMPLETED",t[t.CANCELLED=4]="CANCELLED",t))(Oc||{}),Fc=(t=>(t[t.LOWEST=0]="LOWEST",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=6]="HIGH",t[t.HIGHEST=8]="HIGHEST",t))(Fc||{}),bc=(t=>(t[t.ADD_ASSIGNEE=0]="ADD_ASSIGNEE",t[t.REMOVE_ASSIGNEE=2]="REMOVE_ASSIGNEE",t[t.ADD_REVIEWER=4]="ADD_REVIEWER",t[t.REMOVE_REVIEWER=6]="REMOVE_REVIEWER",t))(bc||{}),_c=(t=>(t[t.APPROVED=0]="APPROVED",t[t.REJECTED=2]="REJECTED",t[t.CHANGES_REQUESTED=4]="CHANGES_REQUESTED",t))(_c||{});function O(t){return{addOne:(m,f)=>{const I=t(f.payload);m.instances[I]=f.payload},addMany:(m,f)=>{for(const I of f.payload){const R=t(I);m.instances[R]=I}},setOne:(m,f)=>{const I=t(f.payload);m.instances[I]=f.payload},setMany:(m,f)=>{for(const I of f.payload){const R=t(I);m.instances[R]=I}},updateOne:(m,f)=>{const I=t(f.payload);m.instances[I]=f.payload},updateMany:(m,f)=>{for(const I of f.payload){const R=t(I);m.instances[R]=I}},deleteOne:(m,f)=>{delete m.instances[f.payload]},deleteMany:(m,f)=>{for(const I of f.payload)delete m.instances[I]},initialize:(m,f)=>{m.instances={};const I=new Set;for(const R of f.payload){const b=t(R);I.add(b),m.instances[b]=R}I.size!==f.payload.length&&console.warn("duplicate ids detected when initializing model instances.")}}}function yb(t){return{initializeSelection:(d,p)=>{d[t]=Array.from(new Set(p.payload))},selectOne:(d,p)=>{console.debug(d,d[t]),!new Set(d[t]).has(p.payload)&&d[t].push(p.payload)},selectMany:(d,p)=>{const m=new Set(d[t]);for(const f of p.payload)m.has(f)||m.add(f);d[t]=Array.from(m)},unselectOne:(d,p)=>{const m=new Set(d[t]);m.has(p.payload)&&(m.delete(p.payload),d[t]=Array.from(m))},unselectMany:(d,p)=>{const m=new Set(d[t]);for(const f of p.payload)m.has(f)&&m.delete(f);d[t]=Array.from(m)},toggleOne:(d,p)=>{const m=new Set(d[t]);m.has(p.payload)?m.delete(p.payload):m.add(p.payload),d[t]=Array.from(m)},toggleMany:(d,p)=>{const m=new Set(d[t]);for(const f of p.payload)m.has(f)?m.delete(f):m.add(f);d[t]=Array.from(m)}}}const gt="versioning",T=l.createAction("RESET"),V=l.createAction("RESET_PROJECT_STATE"),F=l.createAction("RESET_ORGANIZATION_STATE");function fb(t,s){return ab.useMemo(t,s)}nb=Symbol.toStringTag;class rs{constructor(){h(this,nb,"Promise");h(this,"_promise");h(this,"_resolve");h(this,"_reject");h(this,"_state","pending");this._resolve=null,this._reject=null,this._promise=new Promise((s,e)=>{this._resolve=s,this._reject=e})}get state(){return this._state}then(s,e){return this._promise.then(s,e)}catch(s){return this._promise.catch(s)}resolve(s){if(!this._resolve)throw new Error("No resolve callback");this._resolve(s),this._state="fulfilled"}reject(s){if(!this._reject)throw s;this._reject(s),this._state="rejected"}finally(s){throw new Error("`finally` not implemented")}}let ds=!1;["true","1"].includes("".toLowerCase())&&(ds=!0);function Sb(t,s){if(t===s)return!0;if(typeof t!=typeof s)return!1;const e=Object.keys(t),n=Object.keys(s),c=e.length;if(c!==n.length)return!1;for(let r=0;r<c;r++){const a=e[r];if(!Object.prototype.hasOwnProperty.call(s,a)||t[a]!==s[a])return!1}return!0}function us(t){const s={};return function(){const e=Array.prototype.slice.call(arguments);return e in s?(ds&&console.debug(`Memoization debug: Using memorized return value for ${t.toString()}(`,e,")"),s[e]):(ds&&console.debug(`Memoization debug: Cache miss! Memoizing ${t.toString()}(`,e,")"),s[e]=t.apply(this,e))}}function Ab(t,s){if(t.length!==s.length)return!1;for(let e=0;e<t.length;e++)if(t[e]!==s[e])return!1;return!0}const S=t=>t.length===0?fc:t,ls=t=>Object.keys(t).length===0?Sc:t,gc=us(t=>{if(!t)return"";const s=new Date(t),e=s.getFullYear()===os.getFullYear(),n={day:"numeric",month:"short"};return e||(n.year="numeric"),s.toLocaleDateString([],n)}),Ib=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),Tb=1e3*86400,os=new Date,Pb=t=>new Date(t).toDateString()===os.toDateString(),Ob=us((t,s,e)=>{const n=Math.round((new Date(t).getTime()-os.getTime())/Tb);return n<s||n>e?gc(t):Ib.format(n,"days")});function Fb(t){return new Uint8Array(t).reduce((e,n)=>e+n.toString(16).padStart(2,"0"),"")}function Dt(t){return new Promise((s,e)=>{const n=new FileReader;n.onload=()=>{const c=n.result;if(!c){e(new Error("FileReader did not return a valid ArrayBuffer."));return}crypto.subtle.digest("SHA-1",c).then(r=>{const a=Fb(r);s(a)})},n.readAsArrayBuffer(t)})}const bb=(t,s)=>`${t}${s?`.${s}`:""}`;function _b(t,s){return new File([t],s,{type:t.type})}function Mc(t){const s=t.name;return s.includes(".")?s.split(".").pop():""}const Rc=async t=>(await fetch(t)).blob(),wc=async(t,s)=>{const e=await Rc(t);return new File([e],s,{type:e.type})};function gb(t){const s=new Blob([t]);rb.saveAs(s,t.name)}function vc(t){return typeof t=="string"&&t.startsWith("blob:")}function Mb(t){return t.type.startsWith("image/")}const Ec={};function Rb(t,s,e,...n){const c=Ec[t];let r=!1;c?c[s]||(c[s]=!0,r=!0):(Ec[t]={[s]:!0},r=!0),r&&console[e](...n)}const Bc=["created_at","updated_at","index","revision"];function P(t){return{...t,uuid:rt.v4()}}function wb(t){const s={};for(const e of t)s[e.uuid]=e;return s}function E(t){return t.map(({uuid:s})=>s)}function jt(t,s){return t.localeCompare(s)}function hs(t,s){return jt(t.uuid,s.uuid)}function vb(t,s=void 0,e=255){let n=t.replace(/[^a-z0-9_\-.]/gi,"_").replace(/_{2,}/g,"_");if(!s){const r=t.split(".");r.length>1&&(s=r[r.length-1])}s&&!s.startsWith(".")&&(s="."+s);const c=s?s.length:0;return n.length+c>e&&(n=n.slice(0,e-c)+(s||"")),n}function Eb(t){return t.toLowerCase().replace(" ","-")}function Bb(t,s=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,s?"_":"-")}function Vb(t,s){if(t.length<=s)return t;const e=t.slice(0,s-1);return e.slice(0,e.lastIndexOf(" "))+"…"}const zb=/^.+@.+\..+$/;function M(t){const s={...t};for(const e of[...Bc,"created_by"])e in s&&delete s[e];return s}const Vc=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,zc=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,Dc=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,jc=t=>db(t,{id:s=>s.uuid,parentId:s=>s.parent_document,includeEmptyChildrenArray:!0,valueKey:!1}),Db=t=>{const{roots:s}=jc(t);return s.map(e=>new pc.Tree(e))},qc=(t,s)=>{const{nodes:e}=jc(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in document tree.`);return new pc.Tree(n)},yt=(t,s)=>t.submitted_at===s.submitted_at?0:t.submitted_at<s.submitted_at?-1:1;class jb{constructor(s){h(this,"operations",[]);h(this,"getData");this.getData=s}performOperations(s){let e=s;for(const n of this.operations)e=n(e);return e}filter(s,e){return this.operations.push(n=>n.filter(c=>c[s]===e)),this}exclude(s,e){return this.operations.push(n=>n.filter(c=>c[s]!==e)),this}orderBy(s){return this.operations.push(e=>e.toSorted((n,c)=>n[s]<=c[s]?1:-1)),this}reverse(){return this.operations.push(s=>s.toReversed()),this}all(){return this.operations.push(s=>s),this}get(s,e){return l.createSelector([this.getData],n=>this.performOperations(n).find(c=>c[s]===e))}count(){return l.createSelector([this.getData],s=>this.performOperations(s).length)}first(){return l.createSelector([this.getData],s=>this.performOperations(s)[0])}last(){return l.createSelector([this.getData],s=>{const e=this.performOperations(s);return e[e.length-1]})}exists(){return l.createSelector([this.getData],s=>this.performOperations(s).length>0)}toSelector(){return l.createSelector([this.getData],s=>S(this.performOperations(s)))}}const y=t=>(...s)=>e=>t(e,...s),G=O(t=>t.uuid),Cc={instances:{}},ms=l.createSlice({name:"agents",initialState:Cc,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Cc)),reducers:{initializeConversations:G.initialize,addConversation:G.addOne,addConversations:G.addMany,setConversation:G.setOne,setConversations:G.setMany,updateConversation:G.updateOne,updateConversations:G.updateMany,deleteConversation:G.deleteOne,deleteConversations:G.deleteMany}}),{initializeConversations:$c,addConversation:Uc,addConversations:qb,setConversation:Lc,setConversations:Cb,updateConversation:kc,updateConversations:$b,deleteConversation:Ub,deleteConversations:Lb}=ms.actions,ps=t=>t.agentsReducer.instances,kb=l.createSelector([ps],t=>Object.values(t)),Nb=y(l.createSelector([ps,(t,s)=>s],(t,s)=>t[s])),Nc=ms.reducer,H=O(t=>t.uuid),Gc={instances:{}},ys=l.createSlice({name:"assetAttachments",initialState:Gc,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Gc)),reducers:{initializeAssetAttachments:H.initialize,addAssetAttachment:H.addOne,addAssetAttachments:H.addMany,setAssetAttachment:H.setOne,setAssetAttachments:H.setMany,updateAssetAttachment:H.updateOne,updateAssetAttachments:H.updateMany,deleteAssetAttachment:H.deleteOne,deleteAssetAttachments:H.deleteMany}}),{initializeAssetAttachments:Hc,addAssetAttachment:Wc,addAssetAttachments:fs,setAssetAttachment:Kc,setAssetAttachments:Yc,updateAssetAttachment:Zc,updateAssetAttachments:Jc,deleteAssetAttachment:Xc,deleteAssetAttachments:Ss}=ys.actions,Qc=t=>t.assetAttachmentReducer.instances,As=l.createSelector([Qc],t=>Object.values(t)),xc=t=>s=>s.assetAttachmentReducer.instances[t],ea=y(l.createSelector([As,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),ta=y(l.createSelector([As,(t,s)=>s],(t,s)=>S(t.filter(({asset:e})=>s===e)))),sa=ys.reducer,W=O(t=>t.uuid),ia={instances:{}},Is=l.createSlice({name:"assetComments",initialState:ia,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,ia)),reducers:{initializeAssetComments:W.initialize,addAssetComment:W.addOne,addAssetComments:W.addMany,setAssetComment:W.setOne,setAssetComments:W.setMany,updateAssetComment:W.updateOne,updateAssetComments:W.updateMany,deleteAssetComment:W.deleteOne,deleteAssetComments:W.deleteMany}}),{initializeAssetComments:na,addAssetComment:ca,addAssetComments:qt,setAssetComment:aa,setAssetComments:ra,updateAssetComment:da,updateAssetComments:ua,deleteAssetComment:la,deleteAssetComments:Ct}=Is.actions,oa=t=>t.assetCommentReducer.instances,$t=l.createSelector([oa],t=>S(Object.values(t).toSorted(yt))),ha=t=>s=>s.assetCommentReducer.instances[t],ma=y(l.createSelector([$t,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),pa=y(l.createSelector([$t,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset===s)))),ya=y(l.createSelector([$t,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(n=>e.has(n.asset)))})),fa=Is.reducer,K=O(t=>t.uuid),Sa={instances:{}},Ts=l.createSlice({name:"assets",initialState:Sa,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Sa)),reducers:{initializeAssets:K.initialize,addAsset:K.addOne,addAssets:K.addMany,setAsset:K.setOne,setAssets:K.setMany,updateAsset:K.updateOne,updateAssets:K.updateMany,deleteAsset:K.deleteOne,deleteAssets:K.deleteMany}}),{initializeAssets:Aa,addAsset:Ia,addAssets:Ps,updateAsset:Ta,updateAssets:Pa,deleteAsset:Oa,deleteAssets:Os,setAsset:Fa,setAssets:ba}=Ts.actions,_a=t=>t.assetReducer.instances,Ut=l.createSelector([_a],t=>S(Object.values(t))),Gb=y(l.createSelector([Ut,(t,s)=>s],(t,s)=>S(t.filter(({project:e})=>e===s)))),ga=y(l.createSelector([Ut,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_type===s)))),Ma=t=>s=>s.assetReducer.instances[t],Ra=y(l.createSelector([Ut,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),wa=Ts.reducer,Y=O(t=>t.uuid),va={instances:{}},Fs=l.createSlice({name:"assetTypeAttachments",initialState:va,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,va)),reducers:{initializeAssetTypeAttachments:Y.initialize,addAssetTypeAttachment:Y.addOne,addAssetTypeAttachments:Y.addMany,setAssetTypeAttachment:Y.setOne,setAssetTypeAttachments:Y.setMany,updateAssetTypeAttachment:Y.updateOne,updateAssetTypeAttachments:Y.updateMany,deleteAssetTypeAttachment:Y.deleteOne,deleteAssetTypeAttachments:Y.deleteMany}}),{initializeAssetTypeAttachments:Ea,addAssetTypeAttachment:Ba,addAssetTypeAttachments:bs,setAssetTypeAttachment:Va,setAssetTypeAttachments:za,updateAssetTypeAttachment:Da,updateAssetTypeAttachments:ja,deleteAssetTypeAttachment:qa,deleteAssetTypeAttachments:_s}=Fs.actions,Ca=t=>t.assetTypeAttachmentReducer.instances,gs=l.createSelector([Ca],t=>Object.values(t)),$a=t=>s=>s.assetTypeAttachmentReducer.instances[t],Ua=y(l.createSelector([gs,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),La=y(l.createSelector([gs,(t,s)=>s],(t,s)=>S(t.filter(({asset_type:e})=>s===e)))),ka=Fs.reducer,Z=O(t=>t.uuid),Na={instances:{}},Ms=l.createSlice({name:"assetTypeFieldsAttachments",initialState:Na,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Na)),reducers:{initializeAssetTypeFieldsAttachments:Z.initialize,addAssetTypeFieldsAttachment:Z.addOne,addAssetTypeFieldsAttachments:Z.addMany,setAssetTypeFieldsAttachment:Z.setOne,setAssetTypeFieldsAttachments:Z.setMany,updateAssetTypeFieldsAttachment:Z.updateOne,updateAssetTypeFieldsAttachments:Z.updateMany,deleteAssetTypeFieldsAttachment:Z.deleteOne,deleteAssetTypeFieldsAttachments:Z.deleteMany}}),{initializeAssetTypeFieldsAttachments:Ga,addAssetTypeFieldsAttachment:Ha,addAssetTypeFieldsAttachments:Wa,setAssetTypeFieldsAttachment:Ka,setAssetTypeFieldsAttachments:Ya,updateAssetTypeFieldsAttachment:Za,updateAssetTypeFieldsAttachments:Ja,deleteAssetTypeFieldsAttachment:Xa,deleteAssetTypeFieldsAttachments:Qa}=Ms.actions,xa=t=>t.assetTypeFieldsAttachmentReducer.instances,Rs=l.createSelector([xa],t=>Object.values(t)),Hb=y(l.createSelector([Rs,(t,s)=>s],(t,s)=>S(t.filter(e=>e.fields_revision===s)))),er=t=>s=>s.assetTypeFieldsAttachmentReducer.instances[t],tr=y(l.createSelector([Rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),sr=Ms.reducer,J=O(t=>t.uuid),ir={instances:{}},ws=l.createSlice({name:"assetTypeFields",initialState:ir,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,ir)),reducers:{initializeAssetTypeFields:J.initialize,addAssetTypeFields:J.addOne,addAssetTypeFieldsMany:J.addMany,setAssetTypeFields:J.setOne,setAssetTypeFieldsMany:J.setMany,updateAssetTypeFields:J.updateOne,updateAssetTypeFieldsMany:J.updateMany,deleteAssetTypeFields:J.deleteOne,deleteAssetTypeFieldsMany:J.deleteMany}}),{initializeAssetTypeFields:nr,addAssetTypeFields:cr,addAssetTypeFieldsMany:ar,setAssetTypeFields:rr,setAssetTypeFieldsMany:dr,updateAssetTypeFields:ur,updateAssetTypeFieldsMany:lr,deleteAssetTypeFields:or,deleteAssetTypeFieldsMany:hr}=ws.actions,mr=t=>t.assetTypeFieldsReducer.instances,Mt=l.createSelector([mr],t=>Object.values(t)),Wb=y(l.createSelector([Mt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_type===s)))),Kb=y(l.createSelector([Mt,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_type===s).toSorted(yt).pop())),pr=t=>s=>s.assetTypeFieldsReducer.instances[t],yr=y(l.createSelector([Mt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),fr=ws.reducer,X=O(t=>t.uuid),Sr={instances:{}},vs=l.createSlice({name:"assetTypeFieldValuesAttachments",initialState:Sr,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Sr)),reducers:{initializeAssetTypeFieldValuesAttachments:X.initialize,addAssetTypeFieldValuesAttachment:X.addOne,addAssetTypeFieldValuesAttachments:X.addMany,setAssetTypeFieldValuesAttachment:X.setOne,setAssetTypeFieldValuesAttachments:X.setMany,updateAssetTypeFieldValuesAttachment:X.updateOne,updateAssetTypeFieldValuesAttachments:X.updateMany,deleteAssetTypeFieldValuesAttachment:X.deleteOne,deleteAssetTypeFieldValuesAttachments:X.deleteMany}}),{initializeAssetTypeFieldValuesAttachments:Ar,addAssetTypeFieldValuesAttachment:Ir,addAssetTypeFieldValuesAttachments:Es,setAssetTypeFieldValuesAttachment:Tr,setAssetTypeFieldValuesAttachments:Pr,updateAssetTypeFieldValuesAttachment:Or,updateAssetTypeFieldValuesAttachments:Fr,deleteAssetTypeFieldValuesAttachment:br,deleteAssetTypeFieldValuesAttachments:Bs}=vs.actions,_r=t=>t.assetTypeFieldValuesAttachmentReducer.instances,Vs=l.createSelector([_r],t=>Object.values(t)),gr=t=>s=>s.assetTypeFieldValuesAttachmentReducer.instances[t],Mr=y(l.createSelector([Vs,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Rr=y(l.createSelector([Vs,(t,s)=>s],(t,s)=>S(t.filter(e=>e.field_values===s)))),wr=vs.reducer,Q=O(t=>t.uuid),vr={instances:{}},zs=l.createSlice({name:"assetTypeFieldValues",initialState:vr,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,vr)),reducers:{initializeAssetTypeFieldValues:Q.initialize,addAssetTypeFieldValues:Q.addOne,addAssetTypeFieldValuesMany:Q.addMany,setAssetTypeFieldValues:Q.setOne,setAssetTypeFieldValuesMany:Q.setMany,updateAssetTypeFieldValues:Q.updateOne,updateAssetTypeFieldValuesMany:Q.updateMany,deleteAssetTypeFieldValues:Q.deleteOne,deleteAssetTypeFieldValuesMany:Q.deleteMany}}),{initializeAssetTypeFieldValues:Er,addAssetTypeFieldValues:Br,addAssetTypeFieldValuesMany:Vr,setAssetTypeFieldValues:zr,setAssetTypeFieldValuesMany:Dr,updateAssetTypeFieldValues:jr,updateAssetTypeFieldValuesMany:qr,deleteAssetTypeFieldValues:Cr,deleteAssetTypeFieldValuesMany:$r}=zs.actions,Ur=t=>t.assetTypeFieldValuesReducer.instances,Lt=l.createSelector([Ur],t=>Object.values(t)),Yb=y(l.createSelector([Lt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset===s)))),Zb=y(l.createSelector([Mt,Lt,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(c=>c.asset_type===e).map(c=>c.uuid));return S(s.filter(c=>n.has(c.fields_revision)))})),Lr=t=>s=>s.assetTypeFieldValuesReducer.instances[t],kr=y(l.createSelector([Lt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Nr=zs.reducer,x=O(t=>t.uuid),Gr={instances:{}},Ds=l.createSlice({name:"assetTypeIdentifiers",initialState:Gr,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Gr)),reducers:{initializeAssetTypeIdentifiers:x.initialize,addAssetTypeIdentifier:x.addOne,addAssetTypeIdentifiers:x.addMany,setAssetTypeIdentifier:x.setOne,setAssetTypeIdentifiers:x.setMany,updateAssetTypeIdentifier:x.updateOne,updateAssetTypeIdentifiers:x.updateMany,deleteAssetTypeIdentifier:x.deleteOne,deleteAssetTypeIdentifiers:x.deleteMany}}),{initializeAssetTypeIdentifiers:Hr,addAssetTypeIdentifier:Wr,addAssetTypeIdentifiers:Kr,setAssetTypeIdentifier:Yr,setAssetTypeIdentifiers:Zr,updateAssetTypeIdentifier:Jr,updateAssetTypeIdentifiers:Xr,deleteAssetTypeIdentifier:Qr,deleteAssetTypeIdentifiers:xr}=Ds.actions,ed=t=>t.assetTypeIdentifierReducer.instances,js=l.createSelector([ed],t=>Object.values(t)),td=t=>s=>s.assetTypeIdentifierReducer.instances[t],sd=y(l.createSelector([js,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Jb=y(l.createSelector([js,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_type===s)))),id=Ds.reducer,ee=O(t=>t.uuid),nd={instances:{}},qs=l.createSlice({name:"assetTypeIdentifierValues",initialState:nd,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,nd)),reducers:{initializeAssetTypeIdentifierValues:ee.initialize,addAssetTypeIdentifierValue:ee.addOne,addAssetTypeIdentifierValues:ee.addMany,setAssetTypeIdentifierValue:ee.setOne,setAssetTypeIdentifierValues:ee.setMany,updateAssetTypeIdentifierValue:ee.updateOne,updateAssetTypeIdentifierValues:ee.updateMany,deleteAssetTypeIdentifierValue:ee.deleteOne,deleteAssetTypeIdentifierValues:ee.deleteMany}}),{initializeAssetTypeIdentifierValues:cd,addAssetTypeIdentifierValue:ad,addAssetTypeIdentifierValues:rd,setAssetTypeIdentifierValue:dd,setAssetTypeIdentifierValues:ud,updateAssetTypeIdentifierValue:ld,updateAssetTypeIdentifierValues:od,deleteAssetTypeIdentifierValue:hd,deleteAssetTypeIdentifierValues:md}=qs.actions,pd=t=>t.assetTypeIdentifierValueReducer.instances,kt=l.createSelector([pd],t=>Object.values(t)),yd=t=>s=>s.assetTypeIdentifierValueReducer.instances[t],fd=y(l.createSelector([kt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Xb=y(l.createSelector([kt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset===s)))),Qb=y(l.createSelector([kt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_type_identifier===s)))),Sd=qs.reducer,te=O(t=>t.uuid),Ad={instances:{}},Cs=l.createSlice({name:"assetTypes",initialState:Ad,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Ad)),reducers:{initializeAssetTypes:te.initialize,setAssetType:te.setOne,setAssetTypes:te.setMany,addAssetType:te.addOne,addAssetTypes:te.addMany,updateAssetType:te.updateOne,updateAssetTypes:te.updateMany,deleteAssetType:te.deleteOne,deleteAssetTypes:te.deleteMany}}),{initializeAssetTypes:Id,setAssetType:Td,setAssetTypes:Pd,addAssetType:Od,addAssetTypes:Fd,updateAssetType:bd,updateAssetTypes:_d,deleteAssetType:gd,deleteAssetTypes:Md}=Cs.actions,Rd=t=>t.assetTypeReducer.instances,$s=l.createSelector([Rd],t=>Object.values(t)),wd=t=>s=>s.assetTypeReducer.instances[t],vd=y(l.createSelector([$s,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),xb=y(l.createSelector([$s,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),Ed=Cs.reducer,se=O(t=>t.uuid),Bd={instances:{}},Us=l.createSlice({name:"assetTypeStatuses",initialState:Bd,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Bd)),reducers:{initializeAssetTypeStatuses:se.initialize,addAssetTypeStatus:se.addOne,addAssetTypeStatuses:se.addMany,setAssetTypeStatus:se.setOne,setAssetTypeStatuses:se.setMany,updateAssetTypeStatus:se.updateOne,updateAssetTypeStatuses:se.updateMany,deleteAssetTypeStatus:se.deleteOne,deleteAssetTypeStatuses:se.deleteMany}}),{initializeAssetTypeStatuses:Vd,addAssetTypeStatus:zd,addAssetTypeStatuses:Dd,setAssetTypeStatus:jd,setAssetTypeStatuses:qd,updateAssetTypeStatus:Cd,updateAssetTypeStatuses:$d,deleteAssetTypeStatus:Ud,deleteAssetTypeStatuses:Ld}=Us.actions,kd=t=>t.assetTypeStatusReducer.instances,Ls=l.createSelector([kd],t=>S(Object.values(t).toSorted(Vc))),Nd=t=>s=>s.assetTypeStatusReducer.instances[t],Gd=y(l.createSelector([Ls,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),e_=y(l.createSelector([Ls,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_type===s)))),Hd=Us.reducer,Wd={accessToken:"",refreshToken:"",isLoggedIn:!1},Nt=l.createSlice({name:"auth",initialState:Wd,extraReducers:t=>t.addCase(T,s=>Object.assign(s,Wd)),reducers:{setTokens:(t,s)=>{t.accessToken=s.payload.accessToken,t.refreshToken=s.payload.refreshToken},clearTokens:t=>{t.accessToken="",t.refreshToken=""},setLoggedIn:(t,s)=>{s.payload||Nt.caseReducers.clearTokens(t),t.isLoggedIn=s.payload}}}),{setTokens:t_,clearTokens:s_,setLoggedIn:Kd}=Nt.actions,i_=t=>t.authReducer.accessToken,n_=t=>t.authReducer.isLoggedIn,Yd=Nt.reducer,ie=O(t=>t.uuid),Zd={instances:{}},ks=l.createSlice({name:"documentAttachments",initialState:Zd,extraReducers:t=>t.addCase(T,s=>Object.assign(s,Zd)),reducers:{initializeDocumentAttachments:ie.initialize,addDocumentAttachment:ie.addOne,addDocumentAttachments:ie.addMany,setDocumentAttachment:ie.setOne,setDocumentAttachments:ie.setMany,updateDocumentAttachment:ie.updateOne,updateDocumentAttachments:ie.updateMany,deleteDocumentAttachment:ie.deleteOne,deleteDocumentAttachments:ie.deleteMany}}),{initializeDocumentAttachments:Jd,addDocumentAttachment:Xd,addDocumentAttachments:Qd,setDocumentAttachment:xd,setDocumentAttachments:eu,updateDocumentAttachment:tu,updateDocumentAttachments:su,deleteDocumentAttachment:iu,deleteDocumentAttachments:nu}=ks.actions,cu=t=>t.documentAttachmentReducer.instances,Ns=l.createSelector([cu],t=>Object.values(t)),au=t=>s=>s.documentAttachmentReducer.instances[t],ru=y(l.createSelector([Ns,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),c_=y(l.createSelector([Ns,(t,s)=>s],(t,s)=>S(t.filter(({document:e})=>s===e)))),du=ks.reducer,ne=O(({uuid:t})=>t),uu={instances:{}},Gs=l.createSlice({name:"documents",initialState:uu,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>{Object.assign(s,uu)}),reducers:{initializeDocuments:ne.initialize,addDocument:ne.addOne,addDocuments:ne.addMany,setDocument:ne.setOne,setDocuments:ne.setMany,updateDocument:ne.updateOne,updateDocuments:ne.updateMany,deleteDocument:ne.deleteOne,deleteDocuments:ne.deleteMany}}),{initializeDocuments:lu,addDocument:ou,addDocuments:hu,setDocument:mu,setDocuments:pu,updateDocument:yu,updateDocuments:fu,deleteDocument:Su,deleteDocuments:Au}=Gs.actions,Iu=Gs.reducer,Hs=t=>t.documentsReducer.instances,Gt=l.createSelector([Hs],t=>Object.values(t)),Tu=t=>s=>s.documentsReducer.instances[t],Pu=y(l.createSelector([Gt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),a_=y(l.createSelector([Gt,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),r_=y(l.createSelector([Gt,(t,s)=>s],(t,s)=>t.filter(e=>e.organization===s))),Ou=y(l.createSelector([Hs,(t,s)=>s],(t,s)=>{if(!t[s])return S([]);const c=qc(s,Object.values(t)).all().map(({model:r})=>r);return S(c)})),ce=O(t=>t.uuid),Fu={instances:{}},Ws=l.createSlice({name:"emailDomains",initialState:Fu,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Fu)),reducers:{initializeEmailDomains:ce.initialize,addEmailDomain:ce.addOne,addEmailDomains:ce.addMany,setEmailDomain:ce.setOne,setEmailDomains:ce.setMany,updateEmailDomain:ce.updateOne,updateEmailDomains:ce.updateMany,deleteEmailDomain:ce.deleteOne,deleteEmailDomains:ce.deleteMany}}),{initializeEmailDomains:bu,addEmailDomain:_u,addEmailDomains:gu,setEmailDomain:Mu,setEmailDomains:Ru,updateEmailDomain:wu,updateEmailDomains:vu,deleteEmailDomain:Eu,deleteEmailDomains:Bu}=Ws.actions,Vu=t=>t.emailDomainsReducer.instances,Ks=l.createSelector([Vu],t=>Object.values(t)),zu=t=>s=>s.emailDomainsReducer.instances[t],Du=y(l.createSelector([Ks,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),d_=y(l.createSelector([Ks,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),ju=Ws.reducer,qu={s3Urls:{}},Cu=1e3*60*60,u_=Cu*24*7,Ys=l.createSlice({name:"file",initialState:qu,extraReducers:t=>t.addCase(T,s=>Object.assign(s,qu)),reducers:{setUploadUrl:(t,s)=>{const{url:e,fields:n,sha1:c}=s.payload,r=new Date,a=new Date(r.getTime()+u_);t.s3Urls[c]={url:e,fields:n,exp:a.getTime()}}}}),{setUploadUrl:l_}=Ys.actions,o_=t=>s=>{const e=s.fileReducer.s3Urls[t];if(!e)return;const n=new Date().getTime();if(!((e.exp??n)-n<Cu))return e},$u=Ys.reducer,ae=O(t=>t.uuid),Uu={instances:{}},Zs=l.createSlice({name:"formIdentifiers",initialState:Uu,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Uu)),reducers:{initializeFormIdentifiers:ae.initialize,addFormIdentifier:ae.addOne,addFormIdentifiers:ae.addMany,setFormIdentifier:ae.setOne,setFormIdentifiers:ae.setMany,updateFormIdentifier:ae.updateOne,updateFormIdentifiers:ae.updateMany,deleteFormIdentifier:ae.deleteOne,deleteFormIdentifiers:ae.deleteMany}}),{initializeFormIdentifiers:Lu,addFormIdentifier:ku,addFormIdentifiers:Nu,setFormIdentifier:Gu,setFormIdentifiers:Hu,updateFormIdentifier:Wu,updateFormIdentifiers:Ku,deleteFormIdentifier:Yu,deleteFormIdentifiers:Zu}=Zs.actions,Ju=t=>t.formIdentifierReducer.instances,Js=l.createSelector([Ju],t=>Object.values(t)),Xu=t=>s=>s.formIdentifierReducer.instances[t],Qu=y(l.createSelector([Js,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),h_=y(l.createSelector([Js,(t,s)=>s],(t,s)=>S(t.filter(e=>e.form===s)))),xu=Zs.reducer,re=O(t=>t.uuid),el={instances:{}},Xs=l.createSlice({name:"formIdentifierValues",initialState:el,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,el)),reducers:{initializeFormIdentifierValues:re.initialize,addFormIdentifierValue:re.addOne,addFormIdentifierValues:re.addMany,setFormIdentifierValue:re.setOne,setFormIdentifierValues:re.setMany,updateFormIdentifierValue:re.updateOne,updateFormIdentifierValues:re.updateMany,deleteFormIdentifierValue:re.deleteOne,deleteFormIdentifierValues:re.deleteMany}}),{initializeFormIdentifierValues:tl,addFormIdentifierValue:sl,addFormIdentifierValues:il,setFormIdentifierValue:nl,setFormIdentifierValues:cl,updateFormIdentifierValue:al,updateFormIdentifierValues:rl,deleteFormIdentifierValue:dl,deleteFormIdentifierValues:ul}=Xs.actions,ll=t=>t.formIdentifierValueReducer.instances,Ht=l.createSelector([ll],t=>Object.values(t)),ol=t=>s=>s.formIdentifierValueReducer.instances[t],hl=y(l.createSelector([Ht,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),m_=y(l.createSelector([Ht,(t,s)=>s],(t,s)=>S(t.filter(e=>e.form_submission===s)))),p_=y(l.createSelector([Ht,(t,s)=>s],(t,s)=>S(t.filter(e=>e.form_identifier===s)))),ml=Xs.reducer,de=O(t=>t.uuid),pl={instances:{}},Qs=l.createSlice({name:"formRevisionAttachments",initialState:pl,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,pl)),reducers:{initializeFormRevisionAttachments:de.initialize,addFormRevisionAttachment:de.addOne,addFormRevisionAttachments:de.addMany,setFormRevisionAttachment:de.setOne,setFormRevisionAttachments:de.setMany,updateFormRevisionAttachment:de.updateOne,updateFormRevisionAttachments:de.updateMany,deleteFormRevisionAttachment:de.deleteOne,deleteFormRevisionAttachments:de.deleteMany}}),{initializeFormRevisionAttachments:yl,addFormRevisionAttachment:fl,addFormRevisionAttachments:Sl,setFormRevisionAttachment:Al,setFormRevisionAttachments:Il,updateFormRevisionAttachment:Tl,updateFormRevisionAttachments:Pl,deleteFormRevisionAttachment:Ol,deleteFormRevisionAttachments:Fl}=Qs.actions,Wt=t=>t.formRevisionAttachmentReducer.instances,bl=l.createSelector([Wt],t=>Object.values(t)),_l=y(l.createSelector([Wt,(t,s)=>s],(t,s)=>t[s])),gl=y(l.createSelector([bl,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),y_=y(l.createSelector([Wt,(t,s)=>s],(t,s)=>S(Object.values(t).filter(e=>e.form_revision===s)))),Ml=Qs.reducer,ue=O(t=>t.uuid),Rl={instances:{}},xs=l.createSlice({name:"formRevisions",initialState:Rl,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Rl)),reducers:{initializeFormRevisions:ue.initialize,addFormRevision:ue.addOne,addFormRevisions:ue.addMany,setFormRevision:ue.setOne,setFormRevisions:ue.setMany,updateFormRevision:ue.updateOne,updateFormRevisions:ue.updateMany,deleteFormRevision:ue.deleteOne,deleteFormRevisions:ue.deleteMany}}),{initializeFormRevisions:wl,addFormRevision:vl,addFormRevisions:ei,setFormRevision:El,setFormRevisions:Bl,updateFormRevision:Vl,updateFormRevisions:zl,deleteFormRevision:Dl,deleteFormRevisions:ti}=xs.actions,jl=t=>t.formRevisionReducer.instances,Kt=l.createSelector([jl],t=>Object.values(t)),ql=t=>s=>s.formRevisionReducer.instances[t],Cl=y(l.createSelector([Kt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),f_=y(l.createSelector([Kt,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s).toSorted(yt).pop())),$l=y(l.createSelector([Kt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.form===s)))),Ul=xs.reducer,le=O(t=>t.uuid),Ll={instances:{}},si=l.createSlice({name:"forms",initialState:Ll,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Ll)),reducers:{initializeForms:le.initialize,addForm:le.addOne,addForms:le.addMany,setForm:le.setOne,setForms:le.setMany,updateForm:le.updateOne,updateForms:le.updateMany,deleteForm:le.deleteOne,deleteForms:le.deleteMany}}),{initializeForms:kl,addForm:Nl,addForms:Gl,setForm:Hl,setForms:Wl,updateForm:Kl,updateForms:Yl,deleteForm:Zl,deleteForms:Jl}=si.actions,Xl=si.reducer,Ql=t=>t.formReducer.instances,ii=l.createSelector([Ql],t=>Object.values(t)),xl=t=>s=>s.formReducer.instances[t],eo=y(l.createSelector([ii,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),S_=y(l.createSelector([ii,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),oe=O(t=>t.uuid),to={instances:{}},ni=l.createSlice({name:"formSubmissionAttachments",initialState:to,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,to)),reducers:{initializeFormSubmissionAttachments:oe.initialize,addFormSubmissionAttachment:oe.addOne,addFormSubmissionAttachments:oe.addMany,setFormSubmissionAttachment:oe.setOne,setFormSubmissionAttachments:oe.setMany,updateFormSubmissionAttachment:oe.updateOne,updateFormSubmissionAttachments:oe.updateMany,deleteFormSubmissionAttachment:oe.deleteOne,deleteFormSubmissionAttachments:oe.deleteMany}}),{initializeFormSubmissionAttachments:so,addFormSubmissionAttachment:io,addFormSubmissionAttachments:ci,setFormSubmissionAttachment:no,setFormSubmissionAttachments:co,updateFormSubmissionAttachment:ao,updateFormSubmissionAttachments:ro,deleteFormSubmissionAttachment:uo,deleteFormSubmissionAttachments:ai}=ni.actions,ri=t=>t.formSubmissionAttachmentReducer.instances,di=l.createSelector([ri],t=>Object.values(t)),lo=y(l.createSelector([ri,(t,s)=>s],(t,s)=>t[s])),ui=y(l.createSelector([di,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(n=>e.has(n.uuid)))})),oo=ui,ho=y(l.createSelector([di,(t,s)=>s],(t,s)=>S(t.filter(e=>e.form_submission===s)))),mo=ni.reducer,he=O(t=>t.uuid),po={instances:{}},li=l.createSlice({name:"formSubmissions",initialState:po,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,po)),reducers:{initializeFormSubmissions:he.initialize,setFormSubmission:he.setOne,setFormSubmissions:he.setMany,addFormSubmission:he.addOne,addFormSubmissions:he.addMany,updateFormSubmission:he.updateOne,updateFormSubmissions:he.updateMany,deleteFormSubmission:he.deleteOne,deleteFormSubmissions:he.deleteMany}}),{initializeFormSubmissions:yo,setFormSubmission:fo,setFormSubmissions:So,addFormSubmission:Ao,addFormSubmissions:oi,updateFormSubmission:Io,updateFormSubmissions:To,deleteFormSubmission:Po,deleteFormSubmissions:hi}=li.actions,Oo=t=>t.formSubmissionReducer.instances,mi=l.createSelector([Oo],t=>Object.values(t)),Fo=t=>s=>s.formSubmissionReducer.instances[t],bo=y(l.createSelector([mi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),_o=y(l.createSelector([mi,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s))),go=li.reducer,me=O(t=>t.uuid),Mo={instances:{}},pi=l.createSlice({name:"geoImages",initialState:Mo,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Mo)),reducers:{initializeGeoImages:me.initialize,setGeoImage:me.setOne,setGeoImages:me.setMany,addGeoImage:me.addOne,addGeoImages:me.addMany,updateGeoImage:me.updateOne,updateGeoImages:me.updateMany,deleteGeoImage:me.deleteOne,deleteGeoImages:me.deleteMany}}),{initializeGeoImages:Ro,setGeoImage:wo,setGeoImages:vo,addGeoImage:Eo,addGeoImages:Bo,updateGeoImage:Vo,updateGeoImages:zo,deleteGeoImage:Do,deleteGeoImages:jo}=pi.actions,qo=t=>t.geoImageReducer.instances,yi=l.createSelector([qo],t=>Object.values(t)),Co=t=>s=>s.geoImageReducer.instances[t],$o=y(l.createSelector([yi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),A_=y(l.createSelector([yi,(t,s)=>s],(t,s)=>S(t.filter(e=>e.project===s)))),Uo=pi.reducer,pe=O(t=>t.uuid),Lo={instances:{}},fi=l.createSlice({name:"issueAssociations",initialState:Lo,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Lo)),reducers:{initializeIssueAssociations:pe.initialize,addIssueAssociation:pe.addOne,addIssueAssociations:pe.addMany,setIssueAssociation:pe.setOne,setIssueAssociations:pe.setMany,updateIssueAssociation:pe.updateOne,updateIssueAssociations:pe.updateMany,deleteIssueAssociation:pe.deleteOne,deleteIssueAssociations:pe.deleteMany}}),{initializeIssueAssociations:ko,setIssueAssociations:No,setIssueAssociation:Go,updateIssueAssociation:Ho,updateIssueAssociations:Wo,addIssueAssociation:Ko,addIssueAssociations:ft,deleteIssueAssociation:Yo,deleteIssueAssociations:St}=fi.actions,Zo=t=>t.issueAssociationReducer.instances,At=l.createSelector([Zo],t=>Object.values(t)),Jo=t=>s=>s.issueAssociationReducer.instances[t],Xo=y(l.createSelector([At,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Qo=y(l.createSelector([At,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({issue:n})=>e.has(n)))})),xo=y(l.createSelector([At,(t,s)=>s],(t,s)=>S(t.filter(({issue:e})=>e===s)))),eh=y(l.createSelector([At,(t,s)=>s],(t,s)=>S(t.filter(({asset:e})=>e===s)))),th=y(l.createSelector([At,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({asset:n})=>e.has(n)))})),sh=fi.reducer,ye=O(t=>t.uuid),ih={instances:{}},Si=l.createSlice({name:"issueAttachments",initialState:ih,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,ih)),reducers:{initializeIssueAttachments:ye.initialize,addIssueAttachment:ye.addOne,addIssueAttachments:ye.addMany,setIssueAttachment:ye.setOne,setIssueAttachments:ye.setMany,updateIssueAttachment:ye.updateOne,updateIssueAttachments:ye.updateMany,deleteIssueAttachment:ye.deleteOne,deleteIssueAttachments:ye.deleteMany}}),{initializeIssueAttachments:nh,addIssueAttachment:ch,addIssueAttachments:Ai,setIssueAttachment:ah,setIssueAttachments:rh,updateIssueAttachment:dh,updateIssueAttachments:uh,deleteIssueAttachment:lh,deleteIssueAttachments:Ii}=Si.actions,oh=t=>t.issueAttachmentReducer.instances,Ti=l.createSelector([oh],t=>Object.values(t)),hh=y(l.createSelector([Ti,(t,s)=>s],(t,s)=>S(t.filter(({issue:e})=>s===e)))),mh=t=>s=>s.issueAttachmentReducer.instances[t],ph=y(l.createSelector([Ti,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),yh=Si.reducer,fe=O(t=>t.uuid),fh={instances:{}},Pi=l.createSlice({name:"issueCommentAttachments",initialState:fh,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,fh)),reducers:{initializeIssueCommentAttachments:fe.initialize,addIssueCommentAttachment:fe.addOne,addIssueCommentAttachments:fe.addMany,setIssueCommentAttachment:fe.setOne,setIssueCommentAttachments:fe.setMany,updateIssueCommentAttachment:fe.updateOne,updateIssueCommentAttachments:fe.updateMany,deleteIssueCommentAttachment:fe.deleteOne,deleteIssueCommentAttachments:fe.deleteMany}}),{initializeIssueCommentAttachments:Sh,addIssueCommentAttachment:Ah,addIssueCommentAttachments:Ih,setIssueCommentAttachment:Th,setIssueCommentAttachments:Ph,updateIssueCommentAttachment:Oh,updateIssueCommentAttachments:Fh,deleteIssueCommentAttachment:bh,deleteIssueCommentAttachments:_h}=Pi.actions,gh=t=>t.issueCommentAttachmentReducer.instances,Oi=l.createSelector([gh],t=>Object.values(t)),Mh=t=>s=>s.issueCommentAttachmentReducer.instances[t],Rh=y(l.createSelector([Oi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),I_=y(l.createSelector([Oi,(t,s)=>s],(t,s)=>S(t.filter(({issue_comment:e})=>s===e)))),wh=Pi.reducer,Se=O(t=>t.uuid),vh={instances:{}},Fi=l.createSlice({name:"issueComments",initialState:vh,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,vh)),reducers:{initializeIssueComments:Se.initialize,addIssueComment:Se.addOne,addIssueComments:Se.addMany,setIssueComment:Se.setOne,setIssueComments:Se.setMany,updateIssueComment:Se.updateOne,updateIssueComments:Se.updateMany,deleteIssueComment:Se.deleteOne,deleteIssueComments:Se.deleteMany}}),{initializeIssueComments:Eh,addIssueComment:Bh,addIssueComments:Vh,setIssueComment:zh,setIssueComments:Dh,updateIssueComment:jh,updateIssueComments:qh,deleteIssueComment:Ch,deleteIssueComments:$h}=Fi.actions,bi=t=>t.issueCommentReducer.instances,Uh=t=>s=>s.issueCommentReducer.instances[t],Lh=y(l.createSelector([bi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(Object.values(t).filter(({uuid:n})=>e.has(n)))})),T_=y(l.createSelector([bi,(t,s)=>s],(t,s)=>S(Object.values(t).filter(e=>e.issue===s)))),kh=Fi.reducer,Ae=O(t=>t.uuid),Nh={instances:{}},_i=l.createSlice({name:"issues",initialState:Nh,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Nh)),reducers:{initializeIssues:Ae.initialize,addIssue:Ae.addOne,addIssues:Ae.addMany,setIssue:Ae.setOne,setIssues:Ae.setMany,updateIssue:Ae.updateOne,updateIssues:Ae.updateMany,deleteIssue:Ae.deleteOne,deleteIssues:Ae.deleteMany}}),{initializeIssues:Gh,addIssue:Hh,addIssues:gi,setIssue:Wh,setIssues:Kh,updateIssue:Yh,updateIssues:Zh,deleteIssue:Jh,deleteIssues:Mi}=_i.actions,Xh=t=>t.issueReducer.instances,Yt=l.createSelector([Xh],t=>Object.values(t)),Qh=t=>s=>s.issueReducer.instances[t],xh=y(l.createSelector([Yt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),P_=y(l.createSelector([Yt,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),em=y(l.createSelector([Yt,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s))),tm=_i.reducer,Ie=O(t=>t.uuid),sm={instances:{}},Ri=l.createSlice({name:"issueTypeAttachments",initialState:sm,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,sm)),reducers:{initializeIssueTypeAttachments:Ie.initialize,addIssueTypeAttachment:Ie.addOne,addIssueTypeAttachments:Ie.addMany,setIssueTypeAttachment:Ie.setOne,setIssueTypeAttachments:Ie.setMany,updateIssueTypeAttachment:Ie.updateOne,updateIssueTypeAttachments:Ie.updateMany,deleteIssueTypeAttachment:Ie.deleteOne,deleteIssueTypeAttachments:Ie.deleteMany}}),{initializeIssueTypeAttachments:im,addIssueTypeAttachment:nm,addIssueTypeAttachments:cm,setIssueTypeAttachment:am,setIssueTypeAttachments:rm,updateIssueTypeAttachment:dm,updateIssueTypeAttachments:um,deleteIssueTypeAttachment:lm,deleteIssueTypeAttachments:om}=Ri.actions,hm=t=>t.issueTypeAttachmentReducer.instances,wi=l.createSelector([hm],t=>Object.values(t)),mm=t=>s=>s.issueTypeAttachmentReducer.instances[t],pm=y(l.createSelector([wi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),O_=y(l.createSelector([wi,(t,s)=>s],(t,s)=>S(t.filter(({issue_type:e})=>s===e)))),ym=Ri.reducer,Te=O(t=>t.uuid),fm={instances:{}},vi=l.createSlice({name:"issueTypeFieldsAttachments",initialState:fm,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,fm)),reducers:{initializeIssueTypeFieldsAttachments:Te.initialize,addIssueTypeFieldsAttachment:Te.addOne,addIssueTypeFieldsAttachments:Te.addMany,setIssueTypeFieldsAttachment:Te.setOne,setIssueTypeFieldsAttachments:Te.setMany,updateIssueTypeFieldsAttachment:Te.updateOne,updateIssueTypeFieldsAttachments:Te.updateMany,deleteIssueTypeFieldsAttachment:Te.deleteOne,deleteIssueTypeFieldsAttachments:Te.deleteMany}}),{initializeIssueTypeFieldsAttachments:Sm,addIssueTypeFieldsAttachment:Am,addIssueTypeFieldsAttachments:Im,setIssueTypeFieldsAttachment:Tm,setIssueTypeFieldsAttachments:Pm,updateIssueTypeFieldsAttachment:Om,updateIssueTypeFieldsAttachments:Fm,deleteIssueTypeFieldsAttachment:bm,deleteIssueTypeFieldsAttachments:_m}=vi.actions,gm=t=>t.issueTypeFieldsAttachmentReducer.instances,Ei=l.createSelector([gm],t=>Object.values(t)),F_=y(l.createSelector([Ei,(t,s)=>s],(t,s)=>S(t.filter(e=>e.fields_revision===s)))),Mm=t=>s=>s.issueTypeFieldsAttachmentReducer.instances[t],Rm=y(l.createSelector([Ei,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),wm=vi.reducer,Pe=O(t=>t.uuid),vm={instances:{}},Bi=l.createSlice({name:"issueTypeFieldValues",initialState:vm,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,vm)),reducers:{initializeIssueTypeFieldValues:Pe.initialize,addIssueTypeFieldValues:Pe.addOne,addIssueTypeFieldValuesMany:Pe.addMany,setIssueTypeFieldValues:Pe.setOne,setIssueTypeFieldValuesMany:Pe.setMany,updateIssueTypeFieldValues:Pe.updateOne,updateIssueTypeFieldValuesMany:Pe.updateMany,deleteIssueTypeFieldValues:Pe.deleteOne,deleteIssueTypeFieldValuesMany:Pe.deleteMany}}),{initializeIssueTypeFieldValues:Em,addIssueTypeFieldValues:Bm,addIssueTypeFieldValuesMany:Vm,setIssueTypeFieldValues:zm,setIssueTypeFieldValuesMany:Dm,updateIssueTypeFieldValues:jm,updateIssueTypeFieldValuesMany:qm,deleteIssueTypeFieldValues:Cm,deleteIssueTypeFieldValuesMany:$m}=Bi.actions,Um=t=>t.issueTypeFieldValuesReducer.instances,Zt=l.createSelector([Um],t=>Object.values(t)),b_=y(l.createSelector([Zt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue===s)))),Lm=t=>s=>s.issueTypeFieldValuesReducer.instances[t],km=y(l.createSelector([Zt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Nm=Bi.reducer,Oe=O(t=>t.uuid),Gm={instances:{}},Vi=l.createSlice({name:"issueTypeFields",initialState:Gm,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Gm)),reducers:{initializeIssueTypeFields:Oe.initialize,addIssueTypeFields:Oe.addOne,addIssueTypeFieldsMany:Oe.addMany,setIssueTypeFields:Oe.setOne,setIssueTypeFieldsMany:Oe.setMany,updateIssueTypeFields:Oe.updateOne,updateIssueTypeFieldsMany:Oe.updateMany,deleteIssueTypeFields:Oe.deleteOne,deleteIssueTypeFieldsMany:Oe.deleteMany}}),{initializeIssueTypeFields:Hm,addIssueTypeFields:Wm,addIssueTypeFieldsMany:Km,setIssueTypeFields:Ym,setIssueTypeFieldsMany:Zm,updateIssueTypeFields:Jm,updateIssueTypeFieldsMany:Xm,deleteIssueTypeFields:Qm,deleteIssueTypeFieldsMany:xm}=Vi.actions,ep=t=>t.issueTypeFieldsReducer.instances,Rt=l.createSelector([ep],t=>Object.values(t)),__=y(l.createSelector([Rt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue_type===s)))),g_=y(l.createSelector([Rt,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),M_=y(l.createSelector([Rt,Zt,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(c=>c.issue_type===e).map(c=>c.uuid));return S(s.filter(c=>n.has(c.fields_revision)))})),tp=t=>s=>s.issueTypeFieldsReducer.instances[t],sp=y(l.createSelector([Rt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),ip=Vi.reducer,Fe=O(t=>t.uuid),np={instances:{}},zi=l.createSlice({name:"issueTypeFieldValuesAttachments",initialState:np,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,np)),reducers:{initializeIssueTypeFieldValuesAttachments:Fe.initialize,addIssueTypeFieldValuesAttachment:Fe.addOne,addIssueTypeFieldValuesAttachments:Fe.addMany,setIssueTypeFieldValuesAttachment:Fe.setOne,setIssueTypeFieldValuesAttachments:Fe.setMany,updateIssueTypeFieldValuesAttachment:Fe.updateOne,updateIssueTypeFieldValuesAttachments:Fe.updateMany,deleteIssueTypeFieldValuesAttachment:Fe.deleteOne,deleteIssueTypeFieldValuesAttachments:Fe.deleteMany}}),{initializeIssueTypeFieldValuesAttachments:cp,addIssueTypeFieldValuesAttachment:ap,addIssueTypeFieldValuesAttachments:Di,setIssueTypeFieldValuesAttachment:rp,setIssueTypeFieldValuesAttachments:dp,updateIssueTypeFieldValuesAttachment:up,updateIssueTypeFieldValuesAttachments:lp,deleteIssueTypeFieldValuesAttachment:op,deleteIssueTypeFieldValuesAttachments:ji}=zi.actions,hp=t=>t.issueTypeFieldValuesAttachmentReducer.instances,qi=l.createSelector([hp],t=>Object.values(t)),mp=t=>s=>s.issueTypeFieldValuesAttachmentReducer.instances[t],pp=y(l.createSelector([qi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),yp=y(l.createSelector([qi,(t,s)=>s],(t,s)=>S(t.filter(e=>e.field_values===s)))),fp=zi.reducer,be=O(t=>t.uuid),Sp={instances:{}},Ci=l.createSlice({name:"issueTypeIdentifiers",initialState:Sp,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Sp)),reducers:{initializeIssueTypeIdentifiers:be.initialize,addIssueTypeIdentifier:be.addOne,addIssueTypeIdentifiers:be.addMany,setIssueTypeIdentifier:be.setOne,setIssueTypeIdentifiers:be.setMany,updateIssueTypeIdentifier:be.updateOne,updateIssueTypeIdentifiers:be.updateMany,deleteIssueTypeIdentifier:be.deleteOne,deleteIssueTypeIdentifiers:be.deleteMany}}),{initializeIssueTypeIdentifiers:Ap,addIssueTypeIdentifier:Ip,addIssueTypeIdentifiers:Tp,setIssueTypeIdentifier:Pp,setIssueTypeIdentifiers:Op,updateIssueTypeIdentifier:Fp,updateIssueTypeIdentifiers:bp,deleteIssueTypeIdentifier:_p,deleteIssueTypeIdentifiers:gp}=Ci.actions,Mp=t=>t.issueTypeIdentifierReducer.instances,$i=l.createSelector([Mp],t=>Object.values(t)),Rp=t=>s=>s.issueTypeIdentifierReducer.instances[t],wp=y(l.createSelector([$i,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),R_=y(l.createSelector([$i,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue_type===s)))),vp=Ci.reducer,_e=O(t=>t.uuid),Ep={instances:{}},Ui=l.createSlice({name:"issueTypeIdentifierValues",initialState:Ep,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Ep)),reducers:{initializeIssueTypeIdentifierValues:_e.initialize,addIssueTypeIdentifierValue:_e.addOne,addIssueTypeIdentifierValues:_e.addMany,setIssueTypeIdentifierValue:_e.setOne,setIssueTypeIdentifierValues:_e.setMany,updateIssueTypeIdentifierValue:_e.updateOne,updateIssueTypeIdentifierValues:_e.updateMany,deleteIssueTypeIdentifierValue:_e.deleteOne,deleteIssueTypeIdentifierValues:_e.deleteMany}}),{initializeIssueTypeIdentifierValues:Bp,addIssueTypeIdentifierValue:Vp,addIssueTypeIdentifierValues:zp,setIssueTypeIdentifierValue:Dp,setIssueTypeIdentifierValues:jp,updateIssueTypeIdentifierValue:qp,updateIssueTypeIdentifierValues:Cp,deleteIssueTypeIdentifierValue:$p,deleteIssueTypeIdentifierValues:Up}=Ui.actions,Lp=t=>t.issueTypeIdentifierValueReducer.instances,Jt=l.createSelector([Lp],t=>Object.values(t)),kp=t=>s=>s.issueTypeIdentifierValueReducer.instances[t],Np=y(l.createSelector([Jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),w_=y(l.createSelector([Jt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue===s)))),v_=y(l.createSelector([Jt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue_type_identifier===s)))),Gp=Ui.reducer,ge=O(t=>t.uuid),Hp={instances:{}},Li=l.createSlice({name:"issueTypePriorities",initialState:Hp,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Hp)),reducers:{initializeIssueTypePriorities:ge.initialize,addIssueTypePriority:ge.addOne,addIssueTypePriorities:ge.addMany,setIssueTypePriority:ge.setOne,setIssueTypePriorities:ge.setMany,updateIssueTypePriority:ge.updateOne,updateIssueTypePriorities:ge.updateMany,deleteIssueTypePriority:ge.deleteOne,deleteIssueTypePriorities:ge.deleteMany}}),{initializeIssueTypePriorities:Wp,addIssueTypePriority:Kp,addIssueTypePriorities:Yp,setIssueTypePriority:Zp,setIssueTypePriorities:Jp,updateIssueTypePriority:Xp,updateIssueTypePriorities:Qp,deleteIssueTypePriority:xp,deleteIssueTypePriorities:ey}=Li.actions,ty=t=>t.issueTypePriorityReducer.instances,ki=l.createSelector([ty],t=>S(Object.values(t).toSorted(Dc))),Ni=t=>s=>s.issueTypePriorityReducer.instances[t],sy=y(l.createSelector([ki,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),E_=y(l.createSelector([ki,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue_type===s)))),iy=Li.reducer,Me=O(t=>t.uuid),ny={instances:{}},Gi=l.createSlice({name:"issueTypes",initialState:ny,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,ny)),reducers:{initializeIssueTypes:Me.initialize,addIssueType:Me.addOne,addIssueTypes:Me.addMany,setIssueType:Me.setOne,setIssueTypes:Me.setMany,updateIssueType:Me.updateOne,updateIssueTypes:Me.updateMany,deleteIssueType:Me.deleteOne,deleteIssueTypes:Me.deleteMany}}),{initializeIssueTypes:cy,addIssueType:ay,addIssueTypes:ry,setIssueType:dy,setIssueTypes:uy,updateIssueType:ly,updateIssueTypes:oy,deleteIssueType:hy,deleteIssueTypes:my}=Gi.actions,py=t=>t.issueTypeReducer.instances,Hi=l.createSelector(py,t=>Object.values(t)),yy=t=>s=>s.issueTypeReducer.instances[t],fy=y(l.createSelector([Hi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),B_=y(l.createSelector([Hi,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),Sy=Gi.reducer,Re=O(t=>t.uuid),Ay={instances:{}},Wi=l.createSlice({name:"issueTypeStatuses",initialState:Ay,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Ay)),reducers:{initializeIssueTypeStatuses:Re.initialize,addIssueTypeStatus:Re.addOne,addIssueTypeStatuses:Re.addMany,setIssueTypeStatus:Re.setOne,setIssueTypeStatuses:Re.setMany,updateIssueTypeStatus:Re.updateOne,updateIssueTypeStatuses:Re.updateMany,deleteIssueTypeStatus:Re.deleteOne,deleteIssueTypeStatuses:Re.deleteMany}}),{initializeIssueTypeStatuses:Iy,addIssueTypeStatus:Ty,addIssueTypeStatuses:Py,setIssueTypeStatus:Oy,setIssueTypeStatuses:Fy,updateIssueTypeStatus:by,updateIssueTypeStatuses:_y,deleteIssueTypeStatus:gy,deleteIssueTypeStatuses:My}=Wi.actions,Ry=t=>t.issueTypeStatusReducer.instances,Ki=l.createSelector([Ry],t=>S(Object.values(t).toSorted(zc))),Yi=t=>s=>s.issueTypeStatusReducer.instances[t],wy=y(l.createSelector([Ki,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),V_=y(l.createSelector([Ki,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue_type===s)))),vy=Wi.reducer,we=O(t=>t.uuid),Ey={instances:{}},Zi=l.createSlice({name:"issueUpdates",initialState:Ey,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Ey)),reducers:{initializeIssueUpdates:we.initialize,addIssueUpdate:we.addOne,addIssueUpdates:we.addMany,setIssueUpdate:we.setOne,setIssueUpdates:we.setMany,updateIssueUpdate:we.updateOne,updateIssueUpdates:we.updateMany,deleteIssueUpdate:we.deleteOne,deleteIssueUpdates:we.deleteMany}}),{initializeIssueUpdates:By,addIssueUpdate:Ji,addIssueUpdates:Xi,setIssueUpdate:Vy,setIssueUpdates:zy,updateIssueUpdate:Dy,updateIssueUpdates:jy,deleteIssueUpdate:Qi,deleteIssueUpdates:xi}=Zi.actions,en=t=>t.issueUpdateReducer.instances,tn=l.createSelector([en],t=>Object.values(t)),qy=y(l.createSelector([en,(t,s)=>s],(t,s)=>t[s])),Cy=y(l.createSelector([tn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),$y=y(l.createSelector([tn,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue===s)))),Uy=Zi.reducer,ve=O(t=>t.id),Ly={instances:{},currentUser:null},sn=l.createSlice({name:"users",initialState:Ly,extraReducers:t=>t.addCase(T,s=>Object.assign(s,Ly)).addCase(F,s=>Object.assign(s,{...s,instances:[]})),reducers:{initializeUsers:ve.initialize,setUsers:ve.setMany,setUser:ve.setOne,addUsers:ve.addMany,addUser:ve.addOne,updateUsers:ve.updateMany,updateUser:ve.updateOne,deleteUser:ve.deleteOne,deleteUsers:ve.deleteMany,setCurrentUser:(t,s)=>{t.currentUser=s.payload},setCurrentUserProfile:(t,s)=>{if(!t.currentUser)return;t.currentUser.profile=s.payload;const e=t.instances[t.currentUser.id];if(!e)throw new Error("Unable to find current user in users slice");e.profile=s.payload}}}),{initializeUsers:ky,setUsers:Ny,setUser:Gy,addUsers:Hy,addUser:nn,updateUsers:Wy,updateUser:Ky,deleteUser:cn,deleteUsers:Yy,setCurrentUser:z_,setCurrentUserProfile:D_}=sn.actions,Zy=sn.reducer,Jy=t=>t.userReducer.currentUser,an=t=>t.userReducer.instances,Xt=l.createSelector([an],t=>Object.values(t)),Qt=t=>s=>s.userReducer.instances[t],Xy=y(l.createSelector([Xt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({id:n})=>e.has(n)))})),Ee=O(t=>t.uuid),Qy={instances:{}},rn=l.createSlice({name:"organizationAccess",initialState:Qy,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Qy)),reducers:{initializeOrganizationAccesses:Ee.initialize,addOrganizationAccess:Ee.addOne,addOrganizationAccesses:Ee.addMany,setOrganizationAccess:Ee.setOne,setOrganizationAccesses:Ee.setMany,updateOrganizationAccess:Ee.updateOne,updateOrganizationAccesses:Ee.updateMany,deleteOrganizationAccess:Ee.deleteOne,deleteOrganizationAccesses:Ee.deleteMany}}),{initializeOrganizationAccesses:xy,addOrganizationAccess:ef,addOrganizationAccesses:tf,setOrganizationAccess:sf,setOrganizationAccesses:nf,updateOrganizationAccess:cf,updateOrganizationAccesses:af,deleteOrganizationAccess:rf,deleteOrganizationAccesses:df}=rn.actions,uf=rn.reducer,xt=t=>t.organizationAccessReducer.instances,lf=t=>s=>s.organizationAccessReducer.instances[t],of=y(l.createSelector([xt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(Object.values(t).filter(({uuid:n})=>e.has(n)))})),j_=l.createSelector([Jy,xt],(t,s)=>Object.values(s).find(n=>n.user===(t==null?void 0:t.id))??null),hf=l.createSelector([xt],t=>{const s={};for(const e of Object.values(t))s[e.user]=e;return ls(s)}),q_=y(l.createSelector([an,hf,(t,s)=>s],(t,s,e)=>S(Object.values(t).filter(n=>{const c=s[n.id];return!!c&&c.organization===e})))),Be=O(t=>t.uuid),mf={instances:{}},dn=l.createSlice({name:"organizations",initialState:mf,extraReducers:t=>t.addMatcher(l.isAnyOf(T),s=>Object.assign(s,mf)),reducers:{initializeOrganizations:Be.initialize,setOrganizations:Be.setMany,setOrganization:Be.setOne,addOrganizations:Be.addMany,addOrganization:Be.addOne,updateOrganizations:Be.updateMany,updateOrganization:Be.updateOne,deleteOrganization:Be.deleteOne,deleteOrganizations:Be.deleteMany}}),{initializeOrganizations:pf,setOrganizations:yf,setOrganization:ff,addOrganizations:Sf,addOrganization:Af,updateOrganizations:If,updateOrganization:Tf,deleteOrganization:Pf,deleteOrganizations:Of}=dn.actions,Ff=t=>t.organizationReducer.instances,bf=l.createSelector([Ff],t=>Object.values(t)),_f=t=>s=>s.organizationReducer.instances[t],gf=y(l.createSelector([bf,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Mf=dn.reducer,Rf=(t,s,e)=>{const n=t.uuid?t:{...t,uuid:rt.v4()};return{payload:n,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:n,BASE_URL:s,serviceName:e}}}}},wf={deletedRequests:[],latestRetryTime:0},un=l.createSlice({name:"outbox",initialState:wf,extraReducers:t=>t.addCase(T,s=>Object.assign(s,wf)),reducers:{enqueueRequest:{reducer:(t,s)=>t,prepare:t=>{console.debug("Preparing to enqueue request",t.url);const{BASE_URL:s,serviceName:e,...n}=t;return Rf(n,s,e)}},markForDeletion(t,s){t.deletedRequests.push(s.payload)},markAsDeleted(t,s){const e=t.deletedRequests.indexOf(s.payload);e!==-1&&t.deletedRequests.splice(e,1)},_setLatestRetryTime:(t,s)=>{t.latestRetryTime=s.payload}}}),C_=t=>t.outboxReducer.deletedRequests,$_=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:vf,markForDeletion:U_,markAsDeleted:Ef,_setLatestRetryTime:Bf}=un.actions,Vf=un.reducer,Ve=O(t=>t.uuid),zf={instances:{}},ln=l.createSlice({name:"projectAccess",initialState:zf,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,zf)),reducers:{initializeProjectAccesses:Ve.initialize,addProjectAccess:Ve.addOne,addProjectAccesses:Ve.addMany,setProjectAccess:Ve.setOne,setProjectAccesses:Ve.setMany,updateProjectAccess:Ve.updateOne,updateProjectAccesses:Ve.updateMany,deleteProjectAccess:Ve.deleteOne,deleteProjectAccesses:Ve.deleteMany}}),{initializeProjectAccesses:Df,addProjectAccess:jf,addProjectAccesses:qf,setProjectAccess:Cf,setProjectAccesses:$f,updateProjectAccess:Uf,updateProjectAccesses:Lf,deleteProjectAccess:kf,deleteProjectAccesses:Nf}=ln.actions,Gf=ln.reducer,on=t=>t.projectAccessReducer.instances,wt=l.createSelector(on,t=>Object.values(t)),Hf=t=>s=>s.projectAccessReducer.instances[t],Wf=y(l.createSelector([wt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),L_=y(l.createSelector([on,(t,s)=>s],(t,s)=>S(Object.values(t).filter(e=>e.project===s)))),k_=y(l.createSelector([wt,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(c=>c.project===s))e[n.user]=n;return e})),N_=y(l.createSelector([Xt,wt,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(c=>c.project===e).map(c=>c.user));return S(t.filter(c=>n.has(c.id)))})),ze=O(t=>t.uuid),Kf={instances:{}},hn=l.createSlice({name:"projectAttachments",initialState:Kf,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Kf)),reducers:{initializeProjectAttachments:ze.initialize,addProjectAttachment:ze.addOne,addProjectAttachments:ze.addMany,setProjectAttachment:ze.setOne,setProjectAttachments:ze.setMany,updateProjectAttachment:ze.updateOne,updateProjectAttachments:ze.updateMany,deleteProjectAttachment:ze.deleteOne,deleteProjectAttachments:ze.deleteMany}}),{initializeProjectAttachments:Yf,addProjectAttachment:Zf,addProjectAttachments:Jf,setProjectAttachment:Xf,setProjectAttachments:Qf,updateProjectAttachment:xf,updateProjectAttachments:eS,deleteProjectAttachment:tS,deleteProjectAttachments:sS}=hn.actions,iS=t=>t.projectAttachmentReducer.instances,mn=l.createSelector([iS],t=>Object.values(t)),nS=t=>s=>s.projectAttachmentReducer.instances[t],cS=y(l.createSelector([mn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),G_=y(l.createSelector([mn,(t,s)=>s],(t,s)=>S(t.filter(({project:e})=>s===e)))),aS=hn.reducer,De=O(t=>t.uuid),rS={instances:{}},pn=l.createSlice({name:"projectComments",initialState:rS,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,rS)),reducers:{initializeProjectComments:De.initialize,addProjectComment:De.addOne,addProjectComments:De.addMany,setProjectComment:De.setOne,setProjectComments:De.setMany,updateProjectComment:De.updateOne,updateProjectComments:De.updateMany,deleteProjectComment:De.deleteOne,deleteProjectComments:De.deleteMany}}),{initializeProjectComments:dS,addProjectComment:uS,addProjectComments:lS,setProjectComment:oS,setProjectComments:hS,updateProjectComment:mS,updateProjectComments:pS,deleteProjectComment:yS,deleteProjectComments:fS}=pn.actions,SS=t=>t.projectCommentReducer.instances,es=l.createSelector([SS],t=>S(Object.values(t).toSorted(yt))),AS=t=>s=>s.projectCommentReducer.instances[t],IS=y(l.createSelector([es,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),H_=y(l.createSelector([es,(t,s)=>s],(t,s)=>S(t.filter(e=>e.project===s)))),W_=y(l.createSelector([es,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(n=>e.has(n.project)))})),TS=pn.reducer,je=O(t=>t.uuid),PS={instances:{}},yn=l.createSlice({name:"projectFiles",initialState:PS,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,PS)),reducers:{initializeProjectFiles:je.initialize,setProjectFile:je.setOne,setProjectFiles:je.setMany,addProjectFile:je.addOne,addProjectFiles:je.addMany,updateProjectFile:je.updateOne,updateProjectFiles:je.updateMany,deleteProjectFile:je.deleteOne,deleteProjectFiles:je.deleteMany}}),{initializeProjectFiles:OS,setProjectFile:FS,setProjectFiles:bS,addProjectFile:_S,addProjectFiles:gS,updateProjectFile:MS,updateProjectFiles:RS,deleteProjectFile:wS,deleteProjectFiles:vS}=yn.actions,ES=t=>t.projectFileReducer.instances,BS=l.createSelector([ES],t=>S(Object.values(t).toSorted((s,e)=>s.z_index-e.z_index))),VS=t=>s=>s.projectFileReducer.instances[t],zS=y(l.createSelector([BS,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),DS=yn.reducer,qe=O(t=>t.uuid),jS={instances:{}},fn=l.createSlice({name:"projects",initialState:jS,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,jS)),reducers:{initializeProjects:qe.initialize,setProjects:qe.setMany,setProject:qe.setOne,addProjects:qe.addMany,addProject:qe.addOne,updateProjects:qe.updateMany,updateProject:qe.updateOne,deleteProject:qe.deleteOne,deleteProjects:qe.deleteMany}}),{initializeProjects:qS,setProjects:CS,setProject:$S,addProjects:US,addProject:LS,updateProjects:kS,updateProject:NS,deleteProject:GS,deleteProjects:HS}=fn.actions,WS=fn.reducer,KS=t=>t.projectReducer.instances,ts=l.createSelector([KS],t=>Object.values(t)),YS=t=>s=>s.projectReducer.instances[t],ZS=y(l.createSelector([ts,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),K_=y(l.createSelector([ts,wt,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(c=>c.user===e).map(c=>c.project));return S(t.filter(c=>n.has(c.uuid)))})),Y_=y(l.createSelector([ts,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),Ce=O(({uuid:t})=>t),JS={instances:{}},Sn=l.createSlice({name:"procedureInitiatives",initialState:JS,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,JS)),reducers:{initializeProcedureInitiatives:Ce.initialize,addProcedureInitiative:Ce.addOne,addProcedureInitiatives:Ce.addMany,setProcedureInitiative:Ce.setOne,setProcedureInitiatives:Ce.setMany,updateProcedureInitiative:Ce.updateOne,updateProcedureInitiatives:Ce.updateMany,deleteProcedureInitiative:Ce.deleteOne,deleteProcedureInitiatives:Ce.deleteMany}}),{initializeProcedureInitiatives:XS,addProcedureInitiative:QS,addProcedureInitiatives:xS,setProcedureInitiative:eA,setProcedureInitiatives:tA,updateProcedureInitiative:sA,updateProcedureInitiatives:iA,deleteProcedureInitiative:nA,deleteProcedureInitiatives:cA}=Sn.actions,aA=Sn.reducer,rA=t=>t.procedureInitiativeReducer.instances,ss=l.createSelector([rA],t=>Object.values(t)),dA=t=>s=>s.procedureInitiativeReducer.instances[t],uA=y(l.createSelector([ss,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Z_=y(l.createSelector([ss,(t,s)=>s],(t,s)=>S(t.filter(e=>e.project===s)))),J_=y(l.createSelector([ss,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_type===s)))),$e=O(({uuid:t})=>t),lA={instances:{}},An=l.createSlice({name:"procedures",initialState:lA,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,lA)),reducers:{initializeProcedures:$e.initialize,addProcedure:$e.addOne,addProcedures:$e.addMany,setProcedure:$e.setOne,setProcedures:$e.setMany,updateProcedure:$e.updateOne,updateProcedures:$e.updateMany,deleteProcedure:$e.deleteOne,deleteProcedures:$e.deleteMany}}),{initializeProcedures:oA,addProcedure:hA,addProcedures:It,setProcedure:mA,setProcedures:pA,updateProcedure:yA,updateProcedures:fA,deleteProcedure:SA,deleteProcedures:Tt}=An.actions,AA=An.reducer,IA=t=>t.procedureReducer.instances,dt=l.createSelector([IA],t=>Object.values(t)),TA=t=>s=>s.procedureReducer.instances[t],PA=y(l.createSelector([dt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),X_=y(l.createSelector([dt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.project===s)))),OA=y(l.createSelector([dt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_type===s)))),FA=y(l.createSelector([dt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset===s)))),bA=y(l.createSelector([dt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({asset:n})=>e.has(n)))})),_A=y(l.createSelector([dt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_initiative===s)))),Ue=O(t=>t.uuid),gA={instances:{}},In=l.createSlice({name:"procedureStepAssignees",initialState:gA,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,gA)),reducers:{initializeProcedureStepAssignees:Ue.initialize,addProcedureStepAssignee:Ue.addOne,addProcedureStepAssignees:Ue.addMany,setProcedureStepAssignee:Ue.setOne,setProcedureStepAssignees:Ue.setMany,updateProcedureStepAssignee:Ue.updateOne,updateProcedureStepAssignees:Ue.updateMany,deleteProcedureStepAssignee:Ue.deleteOne,deleteProcedureStepAssignees:Ue.deleteMany}}),{initializeProcedureStepAssignees:MA,addProcedureStepAssignee:RA,addProcedureStepAssignees:wA,setProcedureStepAssignee:vA,setProcedureStepAssignees:EA,updateProcedureStepAssignee:BA,updateProcedureStepAssignees:VA,deleteProcedureStepAssignee:zA,deleteProcedureStepAssignees:DA}=In.actions,jA=t=>t.procedureStepAssigneeReducer.instances,vt=l.createSelector([jA],t=>Object.values(t)),qA=t=>s=>s.procedureStepAssigneeReducer.instances[t],CA=y(l.createSelector([vt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Q_=y(l.createSelector([vt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure===s)))),x_=y(l.createSelector([vt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),eg=y(l.createSelector([vt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>S(t.filter(({procedure:n,procedure_step:c})=>n===s&&c===e)))),$A=In.reducer,Le=O(t=>t.uuid),UA={instances:{}},Tn=l.createSlice({name:"procedureStepComments",initialState:UA,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,UA)),reducers:{initializeProcedureStepComments:Le.initialize,addProcedureStepComment:Le.addOne,addProcedureStepComments:Le.addMany,setProcedureStepComment:Le.setOne,setProcedureStepComments:Le.setMany,updateProcedureStepComment:Le.updateOne,updateProcedureStepComments:Le.updateMany,deleteProcedureStepComment:Le.deleteOne,deleteProcedureStepComments:Le.deleteMany}}),{initializeProcedureStepComments:LA,addProcedureStepComment:kA,addProcedureStepComments:NA,setProcedureStepComment:GA,setProcedureStepComments:HA,updateProcedureStepComment:WA,updateProcedureStepComments:KA,deleteProcedureStepComment:YA,deleteProcedureStepComments:ZA}=Tn.actions,JA=t=>t.procedureStepCommentReducer.instances,Et=l.createSelector([JA],t=>Object.values(t)),XA=t=>s=>s.procedureStepCommentReducer.instances[t],QA=y(l.createSelector([Et,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),tg=y(l.createSelector([Et,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure===s)))),sg=y(l.createSelector([Et,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),ig=y(l.createSelector([Et,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>S(t.filter(({procedure:n,procedure_step:c})=>n===s&&c===e)))),xA=Tn.reducer,ke=O(t=>t.uuid),eI={instances:{}},Pn=l.createSlice({name:"procedureStepDefaultAssignees",initialState:eI,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,eI)),reducers:{initializeProcedureStepDefaultAssignees:ke.initialize,addProcedureStepDefaultAssignee:ke.addOne,addProcedureStepDefaultAssignees:ke.addMany,setProcedureStepDefaultAssignee:ke.setOne,setProcedureStepDefaultAssignees:ke.setMany,updateProcedureStepDefaultAssignee:ke.updateOne,updateProcedureStepDefaultAssignees:ke.updateMany,deleteProcedureStepDefaultAssignee:ke.deleteOne,deleteProcedureStepDefaultAssignees:ke.deleteMany}}),{initializeProcedureStepDefaultAssignees:tI,addProcedureStepDefaultAssignee:sI,addProcedureStepDefaultAssignees:iI,setProcedureStepDefaultAssignee:nI,setProcedureStepDefaultAssignees:cI,updateProcedureStepDefaultAssignee:aI,updateProcedureStepDefaultAssignees:rI,deleteProcedureStepDefaultAssignee:dI,deleteProcedureStepDefaultAssignees:uI}=Pn.actions,lI=t=>t.procedureStepDefaultAssigneeReducer.instances,On=l.createSelector([lI],t=>Object.values(t)),oI=t=>s=>s.procedureStepDefaultAssigneeReducer.instances[t],hI=y(l.createSelector([On,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),ng=y(l.createSelector([On,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),mI=Pn.reducer,Ne=O(t=>t.uuid),pI={instances:{}},Fn=l.createSlice({name:"procedureStepDefaultReviewers",initialState:pI,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,pI)),reducers:{initializeProcedureStepDefaultReviewers:Ne.initialize,addProcedureStepDefaultReviewer:Ne.addOne,addProcedureStepDefaultReviewers:Ne.addMany,setProcedureStepDefaultReviewer:Ne.setOne,setProcedureStepDefaultReviewers:Ne.setMany,updateProcedureStepDefaultReviewer:Ne.updateOne,updateProcedureStepDefaultReviewers:Ne.updateMany,deleteProcedureStepDefaultReviewer:Ne.deleteOne,deleteProcedureStepDefaultReviewers:Ne.deleteMany}}),{initializeProcedureStepDefaultReviewers:yI,addProcedureStepDefaultReviewer:fI,addProcedureStepDefaultReviewers:SI,setProcedureStepDefaultReviewer:AI,setProcedureStepDefaultReviewers:II,updateProcedureStepDefaultReviewer:TI,updateProcedureStepDefaultReviewers:PI,deleteProcedureStepDefaultReviewer:OI,deleteProcedureStepDefaultReviewers:FI}=Fn.actions,bI=t=>t.procedureStepDefaultReviewerReducer.instances,bn=l.createSelector([bI],t=>Object.values(t)),_I=t=>s=>s.procedureStepDefaultReviewerReducer.instances[t],gI=y(l.createSelector([bn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),cg=y(l.createSelector([bn,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),MI=Fn.reducer,Ge=O(t=>t.uuid),RI={instances:{}},_n=l.createSlice({name:"procedureStepEvents",initialState:RI,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,RI)),reducers:{initializeProcedureStepEvents:Ge.initialize,addProcedureStepEvent:Ge.addOne,addProcedureStepEvents:Ge.addMany,setProcedureStepEvent:Ge.setOne,setProcedureStepEvents:Ge.setMany,updateProcedureStepEvent:Ge.updateOne,updateProcedureStepEvents:Ge.updateMany,deleteProcedureStepEvent:Ge.deleteOne,deleteProcedureStepEvents:Ge.deleteMany}}),{initializeProcedureStepEvents:wI,addProcedureStepEvent:vI,addProcedureStepEvents:EI,setProcedureStepEvent:BI,setProcedureStepEvents:VI,updateProcedureStepEvent:zI,updateProcedureStepEvents:DI,deleteProcedureStepEvent:jI,deleteProcedureStepEvents:qI}=_n.actions,CI=t=>t.procedureStepEventReducer.instances,Bt=l.createSelector([CI],t=>Object.values(t)),$I=t=>s=>s.procedureStepEventReducer.instances[t],UI=y(l.createSelector([Bt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),ag=y(l.createSelector([Bt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure===s)))),rg=y(l.createSelector([Bt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),dg=y(l.createSelector([Bt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>S(t.filter(({procedure:n,procedure_step:c})=>n===s&&c===e)))),LI=_n.reducer,He=O(t=>t.uuid),kI={instances:{}},gn=l.createSlice({name:"procedureStepFieldsAttachments",initialState:kI,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,kI)),reducers:{initializeProcedureStepFieldsAttachments:He.initialize,addProcedureStepFieldsAttachment:He.addOne,addProcedureStepFieldsAttachments:He.addMany,setProcedureStepFieldsAttachment:He.setOne,setProcedureStepFieldsAttachments:He.setMany,updateProcedureStepFieldsAttachment:He.updateOne,updateProcedureStepFieldsAttachments:He.updateMany,deleteProcedureStepFieldsAttachment:He.deleteOne,deleteProcedureStepFieldsAttachments:He.deleteMany}}),{initializeProcedureStepFieldsAttachments:NI,addProcedureStepFieldsAttachment:GI,addProcedureStepFieldsAttachments:Mn,setProcedureStepFieldsAttachment:HI,setProcedureStepFieldsAttachments:WI,updateProcedureStepFieldsAttachment:KI,updateProcedureStepFieldsAttachments:YI,deleteProcedureStepFieldsAttachment:ZI,deleteProcedureStepFieldsAttachments:Rn}=gn.actions,JI=t=>t.procedureStepFieldsAttachmentReducer.instances,wn=l.createSelector([JI],t=>Object.values(t)),XI=y(l.createSelector([wn,(t,s)=>s],(t,s)=>S(t.filter(e=>e.fields_revision===s)))),QI=t=>s=>s.procedureStepFieldsAttachmentReducer.instances[t],xI=y(l.createSelector([wn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),eT=gn.reducer,We=O(t=>t.uuid),tT={instances:{}},vn=l.createSlice({name:"procedureStepFields",initialState:tT,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,tT)),reducers:{initializeProcedureStepFields:We.initialize,addProcedureStepFields:We.addOne,addProcedureStepFieldsMany:We.addMany,setProcedureStepFields:We.setOne,setProcedureStepFieldsMany:We.setMany,updateProcedureStepFields:We.updateOne,updateProcedureStepFieldsMany:We.updateMany,deleteProcedureStepFields:We.deleteOne,deleteProcedureStepFieldsMany:We.deleteMany}}),{initializeProcedureStepFields:sT,addProcedureStepFields:iT,addProcedureStepFieldsMany:nT,setProcedureStepFields:cT,setProcedureStepFieldsMany:aT,updateProcedureStepFields:rT,updateProcedureStepFieldsMany:dT,deleteProcedureStepFields:uT,deleteProcedureStepFieldsMany:lT}=vn.actions,En=t=>t.procedureStepFieldsReducer.instances,is=l.createSelector([En],t=>Object.values(t)),ug=y(l.createSelector([is,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),lg=y(l.createSelector([is,(t,s)=>s],(t,s)=>t.filter(e=>e.procedure_step===s).toSorted(yt).pop())),og=l.createSelector([En],t=>{const s={};for(const e of Object.values(t)){const n=s[e.procedure_step];(!n||n.submitted_at<e.submitted_at)&&(s[e.procedure_step]=e)}return s}),oT=t=>s=>s.procedureStepFieldsReducer.instances[t],hT=y(l.createSelector([is,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),mT=vn.reducer,Ke=O(t=>t.uuid),pT={instances:{}},Bn=l.createSlice({name:"procedureStepFieldValuesAttachments",initialState:pT,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,pT)),reducers:{initializeProcedureStepFieldValuesAttachments:Ke.initialize,addProcedureStepFieldValuesAttachment:Ke.addOne,addProcedureStepFieldValuesAttachments:Ke.addMany,setProcedureStepFieldValuesAttachment:Ke.setOne,setProcedureStepFieldValuesAttachments:Ke.setMany,updateProcedureStepFieldValuesAttachment:Ke.updateOne,updateProcedureStepFieldValuesAttachments:Ke.updateMany,deleteProcedureStepFieldValuesAttachment:Ke.deleteOne,deleteProcedureStepFieldValuesAttachments:Ke.deleteMany}}),{initializeProcedureStepFieldValuesAttachments:yT,addProcedureStepFieldValuesAttachment:fT,addProcedureStepFieldValuesAttachments:Vn,setProcedureStepFieldValuesAttachment:ST,setProcedureStepFieldValuesAttachments:AT,updateProcedureStepFieldValuesAttachment:IT,updateProcedureStepFieldValuesAttachments:TT,deleteProcedureStepFieldValuesAttachment:PT,deleteProcedureStepFieldValuesAttachments:zn}=Bn.actions,OT=t=>t.procedureStepFieldValuesAttachmentReducer.instances,Dn=l.createSelector([OT],t=>Object.values(t)),FT=t=>s=>s.procedureStepFieldValuesAttachmentReducer.instances[t],bT=y(l.createSelector([Dn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),_T=y(l.createSelector([Dn,(t,s)=>s],(t,s)=>S(t.filter(e=>e.field_values===s)))),gT=Bn.reducer,Ye=O(t=>t.uuid),MT={instances:{}},jn=l.createSlice({name:"procedureStepFieldValues",initialState:MT,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,MT)),reducers:{initializeProcedureStepFieldValues:Ye.initialize,addProcedureStepFieldValues:Ye.addOne,addProcedureStepFieldValuesMany:Ye.addMany,setProcedureStepFieldValues:Ye.setOne,setProcedureStepFieldValuesMany:Ye.setMany,updateProcedureStepFieldValues:Ye.updateOne,updateProcedureStepFieldValuesMany:Ye.updateMany,deleteProcedureStepFieldValues:Ye.deleteOne,deleteProcedureStepFieldValuesMany:Ye.deleteMany}}),{initializeProcedureStepFieldValues:RT,addProcedureStepFieldValues:wT,addProcedureStepFieldValuesMany:vT,setProcedureStepFieldValues:ET,setProcedureStepFieldValuesMany:BT,updateProcedureStepFieldValues:VT,updateProcedureStepFieldValuesMany:zT,deleteProcedureStepFieldValues:DT,deleteProcedureStepFieldValuesMany:jT}=jn.actions,qT=jn.reducer,CT=t=>t.procedureStepFieldValuesReducer.instances,ut=l.createSelector([CT],t=>Object.values(t)),hg=y(l.createSelector([ut,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure===s)))),mg=y(l.createSelector([ut,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),$T=t=>s=>s.procedureStepFieldValuesReducer.instances[t],UT=y(l.createSelector([ut,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),pg=y(l.createSelector([ut,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>S(t.filter(({procedure:n,procedure_step:c})=>n===s&&c===e)))),Ze=O(t=>t.uuid),LT={instances:{}},qn=l.createSlice({name:"procedureStepFieldValuesReviews",initialState:LT,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,LT)),reducers:{initializeProcedureStepFieldValuesReviews:Ze.initialize,addProcedureStepFieldValuesReview:Ze.addOne,addProcedureStepFieldValuesReviews:Ze.addMany,setProcedureStepFieldValuesReview:Ze.setOne,setProcedureStepFieldValuesReviews:Ze.setMany,updateProcedureStepFieldValuesReview:Ze.updateOne,updateProcedureStepFieldValuesReviews:Ze.updateMany,deleteProcedureStepFieldValuesReview:Ze.deleteOne,deleteProcedureStepFieldValuesReviews:Ze.deleteMany}}),{initializeProcedureStepFieldValuesReviews:kT,addProcedureStepFieldValuesReview:NT,addProcedureStepFieldValuesReviews:Cn,setProcedureStepFieldValuesReview:GT,setProcedureStepFieldValuesReviews:HT,updateProcedureStepFieldValuesReview:WT,updateProcedureStepFieldValuesReviews:KT,deleteProcedureStepFieldValuesReview:YT,deleteProcedureStepFieldValuesReviews:$n}=qn.actions,ZT=t=>t.procedureStepFieldValuesReviewReducer.instances,lt=l.createSelector([ZT],t=>Object.values(t)),JT=t=>s=>s.procedureStepFieldValuesReviewReducer.instances[t],XT=y(l.createSelector([lt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),QT=y(l.createSelector([lt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.field_values===s)))),yg=y(l.createSelector([lt,(t,s)=>s],(t,s)=>{let e;for(const n of t){const{field_values:c}=n;c===s&&(!e||e.submitted_at<=n.submitted_at)&&(e=n)}return e})),fg=y(l.createSelector([ut,lt,(t,s)=>s],(t,s,e)=>{const n=new Set(E(t.filter(({procedure:c})=>e===c)));return S(s.filter(({field_values:c})=>n.has(c)))})),Sg=y(l.createSelector([ut,lt,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const c=new Set(E(t.filter(({procedure_step:r,procedure:a})=>e===a&&r===n)));return S(s.filter(({field_values:r})=>c.has(r)))})),Ag=l.createSelector([lt],t=>{const s={};for(const e of t){const{field_values:n}=e,c=s[n];(!c||c.submitted_at<=e.submitted_at)&&(s[n]=e)}return s}),xT=qn.reducer,Je=O(t=>t.uuid),eP={instances:{}},Un=l.createSlice({name:"procedureStepReviewers",initialState:eP,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,eP)),reducers:{initializeProcedureStepReviewers:Je.initialize,addProcedureStepReviewer:Je.addOne,addProcedureStepReviewers:Je.addMany,setProcedureStepReviewer:Je.setOne,setProcedureStepReviewers:Je.setMany,updateProcedureStepReviewer:Je.updateOne,updateProcedureStepReviewers:Je.updateMany,deleteProcedureStepReviewer:Je.deleteOne,deleteProcedureStepReviewers:Je.deleteMany}}),{initializeProcedureStepReviewers:tP,addProcedureStepReviewer:sP,addProcedureStepReviewers:iP,setProcedureStepReviewer:nP,setProcedureStepReviewers:cP,updateProcedureStepReviewer:aP,updateProcedureStepReviewers:rP,deleteProcedureStepReviewer:dP,deleteProcedureStepReviewers:uP}=Un.actions,lP=t=>t.procedureStepReviewerReducer.instances,Vt=l.createSelector([lP],t=>Object.values(t)),oP=t=>s=>s.procedureStepReviewerReducer.instances[t],hP=y(l.createSelector([Vt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Ig=y(l.createSelector([Vt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure===s)))),Tg=y(l.createSelector([Vt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),Pg=y(l.createSelector([Vt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>S(t.filter(({procedure:n,procedure_step:c})=>n===s&&c===e)))),mP=Un.reducer,Xe=O(t=>t.uuid),pP={instances:{}},Ln=l.createSlice({name:"procedureSteps",initialState:pP,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,pP)),reducers:{initializeProcedureSteps:Xe.initialize,setProcedureStep:Xe.setOne,setProcedureSteps:Xe.setMany,addProcedureStep:Xe.addOne,addProcedureSteps:Xe.addMany,updateProcedureStep:Xe.updateOne,updateProcedureSteps:Xe.updateMany,deleteProcedureStep:Xe.deleteOne,deleteProcedureSteps:Xe.deleteMany}}),{initializeProcedureSteps:yP,setProcedureStep:fP,setProcedureSteps:SP,addProcedureStep:AP,addProcedureSteps:IP,updateProcedureStep:TP,updateProcedureSteps:PP,deleteProcedureStep:OP,deleteProcedureSteps:FP}=Ln.actions,bP=Ln.reducer,kn=t=>t.procedureStepReducer.instances,_P=t=>s=>s.procedureStepReducer.instances[t],Nn=l.createSelector([kn],t=>Object.values(t).toSorted((s,e)=>s.order-e.order)),Og=y(l.createSelector([kn,(t,s)=>s],(t,s)=>{const e={};for(const[n,c]of Object.entries(t))c.procedure_type===s&&(e[n]=c);return ls(e)})),Fg=y(l.createSelector([Nn,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_type===s)))),gP=y(l.createSelector([Nn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Qe=O(({uuid:t})=>t),MP={instances:{}},Gn=l.createSlice({name:"procedureTypeAttachments",initialState:MP,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,MP)),reducers:{initializeProcedureTypeAttachments:Qe.initialize,addProcedureTypeAttachment:Qe.addOne,addProcedureTypeAttachments:Qe.addMany,setProcedureTypeAttachment:Qe.setOne,setProcedureTypeAttachments:Qe.setMany,updateProcedureTypeAttachment:Qe.updateOne,updateProcedureTypeAttachments:Qe.updateMany,deleteProcedureTypeAttachment:Qe.deleteOne,deleteProcedureTypeAttachments:Qe.deleteMany}}),{initializeProcedureTypeAttachments:RP,addProcedureTypeAttachment:wP,addProcedureTypeAttachments:vP,setProcedureTypeAttachment:EP,setProcedureTypeAttachments:BP,updateProcedureTypeAttachment:VP,updateProcedureTypeAttachments:zP,deleteProcedureTypeAttachment:DP,deleteProcedureTypeAttachments:jP}=Gn.actions,qP=Gn.reducer,CP=t=>t.procedureTypeAttachmentReducer.instances,Hn=l.createSelector([CP],t=>Object.values(t)),$P=t=>s=>s.procedureTypeAttachmentReducer.instances[t],UP=y(l.createSelector([Hn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),bg=y(l.createSelector([Hn,(t,s)=>s],(t,s)=>S(t.filter(({procedure_type:e})=>s===e)))),xe=O(({uuid:t})=>t),LP={instances:{}},Wn=l.createSlice({name:"procedureTypeFieldsAttachments",initialState:LP,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,LP)),reducers:{initializeProcedureTypeFieldsAttachments:xe.initialize,addProcedureTypeFieldsAttachment:xe.addOne,addProcedureTypeFieldsAttachments:xe.addMany,setProcedureTypeFieldsAttachment:xe.setOne,setProcedureTypeFieldsAttachments:xe.setMany,updateProcedureTypeFieldsAttachment:xe.updateOne,updateProcedureTypeFieldsAttachments:xe.updateMany,deleteProcedureTypeFieldsAttachment:xe.deleteOne,deleteProcedureTypeFieldsAttachments:xe.deleteMany}}),{initializeProcedureTypeFieldsAttachments:kP,addProcedureTypeFieldsAttachment:NP,addProcedureTypeFieldsAttachments:GP,setProcedureTypeFieldsAttachment:HP,setProcedureTypeFieldsAttachments:WP,updateProcedureTypeFieldsAttachment:KP,updateProcedureTypeFieldsAttachments:YP,deleteProcedureTypeFieldsAttachment:ZP,deleteProcedureTypeFieldsAttachments:JP}=Wn.actions,XP=Wn.reducer,QP=t=>t.procedureTypeFieldsAttachmentReducer.instances,Kn=l.createSelector([QP],t=>Object.values(t)),_g=y(l.createSelector([Kn,(t,s)=>s],(t,s)=>S(t.filter(e=>e.fields_revision===s)))),xP=t=>s=>s.procedureTypeFieldsAttachmentReducer.instances[t],eO=y(l.createSelector([Kn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),et=O(({uuid:t})=>t),tO={instances:{}},Yn=l.createSlice({name:"procedureTypeFields",initialState:tO,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,tO)),reducers:{initializeProcedureTypeFields:et.initialize,addProcedureTypeFields:et.addOne,addProcedureTypeFieldsMany:et.addMany,setProcedureTypeFields:et.setOne,setProcedureTypeFieldsMany:et.setMany,updateProcedureTypeFields:et.updateOne,updateProcedureTypeFieldsMany:et.updateMany,deleteProcedureTypeFields:et.deleteOne,deleteProcedureTypeFieldsMany:et.deleteMany}}),{initializeProcedureTypeFields:sO,addProcedureTypeFields:iO,addProcedureTypeFieldsMany:nO,setProcedureTypeFields:cO,setProcedureTypeFieldsMany:aO,updateProcedureTypeFields:rO,updateProcedureTypeFieldsMany:dO,deleteProcedureTypeFields:uO,deleteProcedureTypeFieldsMany:lO}=Yn.actions,oO=Yn.reducer,hO=t=>t.procedureTypeFieldsReducer.instances,ns=l.createSelector([hO],t=>Object.values(t)),gg=y(l.createSelector([ns,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_type===s)))),Mg=y(l.createSelector([ns,(t,s)=>s],(t,s)=>t.filter(e=>e.procedure_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),mO=t=>s=>s.procedureTypeFieldsReducer.instances[t],pO=y(l.createSelector([ns,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),tt=O(({uuid:t})=>t),yO={instances:{}},Zn=l.createSlice({name:"procedureFieldValuesAttachments",initialState:yO,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,yO)),reducers:{initializeProcedureFieldValuesAttachments:tt.initialize,addProcedureFieldValuesAttachment:tt.addOne,addProcedureFieldValuesAttachments:tt.addMany,setProcedureFieldValuesAttachment:tt.setOne,setProcedureFieldValuesAttachments:tt.setMany,updateProcedureFieldValuesAttachment:tt.updateOne,updateProcedureFieldValuesAttachments:tt.updateMany,deleteProcedureFieldValuesAttachment:tt.deleteOne,deleteProcedureFieldValuesAttachments:tt.deleteMany}}),{initializeProcedureFieldValuesAttachments:fO,addProcedureFieldValuesAttachment:SO,addProcedureFieldValuesAttachments:Jn,setProcedureFieldValuesAttachment:AO,setProcedureFieldValuesAttachments:IO,updateProcedureFieldValuesAttachment:TO,updateProcedureFieldValuesAttachments:PO,deleteProcedureFieldValuesAttachment:OO,deleteProcedureFieldValuesAttachments:Xn}=Zn.actions,FO=Zn.reducer,bO=t=>t.procedureFieldValuesAttachmentReducer.instances,Qn=l.createSelector([bO],t=>Object.values(t)),_O=t=>s=>s.procedureFieldValuesAttachmentReducer.instances[t],gO=y(l.createSelector([Qn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),MO=y(l.createSelector([Qn,(t,s)=>s],(t,s)=>S(t.filter(e=>e.field_values===s)))),st=O(({uuid:t})=>t),RO={instances:{}},xn=l.createSlice({name:"procedureFieldValues",initialState:RO,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,RO)),reducers:{initializeProcedureFieldValues:st.initialize,addProcedureFieldValues:st.addOne,addProcedureFieldValuesMany:st.addMany,setProcedureFieldValues:st.setOne,setProcedureFieldValuesMany:st.setMany,updateProcedureFieldValues:st.updateOne,updateProcedureFieldValuesMany:st.updateMany,deleteProcedureFieldValues:st.deleteOne,deleteProcedureFieldValuesMany:st.deleteMany}}),{initializeProcedureFieldValues:wO,addProcedureFieldValues:vO,addProcedureFieldValuesMany:EO,setProcedureFieldValues:BO,setProcedureFieldValuesMany:VO,updateProcedureFieldValues:zO,updateProcedureFieldValuesMany:DO,deleteProcedureFieldValues:jO,deleteProcedureFieldValuesMany:qO}=xn.actions,CO=xn.reducer,$O=t=>t.procedureFieldValuesReducer.instances,ec=l.createSelector([$O],t=>Object.values(t)),Rg=y(l.createSelector([ec,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure===s)))),UO=t=>s=>s.procedureFieldValuesReducer.instances[t],LO=y(l.createSelector([ec,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),it=O(t=>t.uuid),kO={instances:{}},tc=l.createSlice({name:"procedureTypes",initialState:kO,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,kO)),reducers:{initializeProcedureTypes:it.initialize,addProcedureType:it.addOne,addProcedureTypes:it.addMany,setProcedureType:it.setOne,setProcedureTypes:it.setMany,updateProcedureType:it.updateOne,updateProcedureTypes:it.updateMany,deleteProcedureType:it.deleteOne,deleteProcedureTypes:it.deleteMany}}),{initializeProcedureTypes:NO,addProcedureType:GO,addProcedureTypes:HO,setProcedureType:WO,setProcedureTypes:KO,updateProcedureType:YO,updateProcedureTypes:ZO,deleteProcedureType:JO,deleteProcedureTypes:XO}=tc.actions,QO=tc.reducer,xO=t=>t.procedureTypeReducer.instances,sc=l.createSelector([xO],t=>Object.values(t)),eF=t=>s=>s.procedureTypeReducer.instances[t],tF=y(l.createSelector([sc,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),wg=y(l.createSelector([sc,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),vg={isRehydrated:!1},ic=l.createSlice({name:"rehydrated",initialState:vg,reducers:{setRehydrated:(t,s)=>{t.isRehydrated=s.payload}}}),{setRehydrated:Eg}=ic.actions,Bg=t=>t.rehydratedReducer.isRehydrated,sF=ic.reducer,nt=O(t=>t.uuid),iF={instances:{}},nc=l.createSlice({name:"teamMemberships",initialState:iF,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,iF)),reducers:{initializeTeamMemberships:nt.initialize,addTeamMembership:nt.addOne,addTeamMemberships:nt.addMany,setTeamMembership:nt.setOne,setTeamMemberships:nt.setMany,updateTeamMembership:nt.updateOne,updateTeamMemberships:nt.updateMany,deleteTeamMembership:nt.deleteOne,deleteTeamMemberships:nt.deleteMany}}),{initializeTeamMemberships:nF,addTeamMembership:cF,addTeamMemberships:aF,setTeamMembership:rF,setTeamMemberships:dF,updateTeamMembership:uF,updateTeamMemberships:lF,deleteTeamMembership:oF,deleteTeamMemberships:hF}=nc.actions,mF=nc.reducer,pF=t=>t.teamMembershipReducer.instances,cs=l.createSelector([pF],t=>Object.values(t)),yF=t=>s=>s.teamMembershipReducer.instances[t],fF=y(l.createSelector([cs,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Vg=y(l.createSelector([cs,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(c=>c.team===s))e[n.user]=n;return e})),zg=y(l.createSelector([Xt,cs,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(c=>c.team===e).map(c=>c.user));return S(t.filter(c=>n.has(c.id)))})),ct=O(t=>t.uuid),SF={instances:{}},cc=l.createSlice({name:"teams",initialState:SF,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,SF)),reducers:{initializeTeams:ct.initialize,addTeam:ct.addOne,addTeams:ct.addMany,setTeam:ct.setOne,setTeams:ct.setMany,updateTeam:ct.updateOne,updateTeams:ct.updateMany,deleteTeam:ct.deleteOne,deleteTeams:ct.deleteMany}}),{initializeTeams:AF,addTeam:IF,addTeams:TF,setTeam:PF,setTeams:OF,updateTeam:FF,updateTeams:bF,deleteTeam:_F,deleteTeams:gF}=cc.actions,MF=t=>t.teamReducer.instances,ac=l.createSelector([MF],t=>Object.values(t)),RF=t=>s=>s.teamReducer.instances[t],wF=y(l.createSelector([ac,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Dg=y(l.createSelector([ac,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),vF=cc.reducer,jg={version:0},EF=l.createSlice({name:"versioning",initialState:jg,reducers:{}}),BF=EF.reducer,rc={outboxReducer:Vf,fileReducer:$u,authReducer:Yd},qg=l.combineReducers(rc),VF={...rc,[gt]:BF,assetReducer:wa,assetAttachmentReducer:sa,assetCommentReducer:fa,assetTypeReducer:Ed,assetTypeAttachmentReducer:ka,issueReducer:tm,issueAttachmentReducer:yh,issueTypeReducer:Sy,issueTypeAttachmentReducer:ym,organizationReducer:Mf,projectReducer:WS,projectAttachmentReducer:aS,projectCommentReducer:TS,projectAccessReducer:Gf,organizationAccessReducer:uf,projectFileReducer:DS,procedureTypeReducer:QO,procedureInitiativeReducer:aA,procedureReducer:AA,procedureTypeFieldsReducer:oO,procedureFieldValuesReducer:CO,procedureTypeAttachmentReducer:qP,procedureTypeFieldsAttachmentReducer:XP,procedureFieldValuesAttachmentReducer:FO,procedureStepFieldsAttachmentReducer:eT,procedureStepFieldsReducer:mT,procedureStepFieldValuesAttachmentReducer:gT,procedureStepFieldValuesReducer:qT,procedureStepFieldValuesReviewReducer:xT,procedureStepAssigneeReducer:$A,procedureStepCommentReducer:xA,procedureStepDefaultAssigneeReducer:mI,procedureStepDefaultReviewerReducer:MI,procedureStepEventReducer:LI,procedureStepReviewerReducer:mP,procedureStepReducer:bP,rehydratedReducer:sF,formReducer:Xl,formRevisionReducer:Ul,formRevisionAttachmentReducer:Ml,formSubmissionAttachmentReducer:mo,formSubmissionReducer:go,formIdentifierReducer:xu,formIdentifierValueReducer:ml,userReducer:Zy,emailDomainsReducer:ju,documentsReducer:Iu,documentAttachmentReducer:du,teamReducer:vF,agentsReducer:Nc,issueCommentReducer:kh,issueCommentAttachmentReducer:wh,issueUpdateReducer:Uy,geoImageReducer:Uo,issueAssociationReducer:sh,issueTypeFieldsReducer:ip,issueTypeFieldValuesReducer:Nm,issueTypeFieldsAttachmentReducer:wm,issueTypeFieldValuesAttachmentReducer:fp,issueTypeIdentifierReducer:vp,issueTypeIdentifierValueReducer:Gp,issueTypePriorityReducer:iy,issueTypeStatusReducer:vy,assetTypeFieldsReducer:fr,assetTypeFieldValuesReducer:Nr,assetTypeFieldsAttachmentReducer:sr,assetTypeFieldValuesAttachmentReducer:wr,assetTypeIdentifierReducer:id,assetTypeIdentifierValueReducer:Sd,assetTypeStatusReducer:Hd,teamMembershipReducer:mF},Cg=l.combineReducers(VF),zF=1e4,DF=200,dc=[400,409,403,404,405,500],k=1e4,jF={};class qF{constructor(s){h(this,"client");h(this,"pageSize",zF);jF[this.constructor.name]=this,this.client=s}async performRequest(s,e){return this.client.performRequest(this.host,s,this,e)}async enqueueRequest(s){return this.client.enqueueRequest(s,this.host,this.constructor.name)}async performPagination(s,e){return this.client.performPagination(this.host,s,this.pageSize,this,e)}dispatch(s){this.client.store.dispatch(s)}select(s){return s(this.client.store.getState())}}const CF=()=>LF.length-1,$F=t=>(t[gt]={version:CF()},t),UF=()=>$F({}),$g=t=>(t.outboxReducer&&(t.outboxReducer.deletedRequests=[]),t),Ug=t=>s=>{var e;return s===void 0&&(s={}),((e=s[gt])==null?void 0:e.version)===CF()?s:t(s)},LF=[$F,UF,UF,$g],Lg=Object.fromEntries(LF.map((t,s)=>[s,Ug(t)])),kg=t=>{if(t)throw t;const s=Ft();s?s.dispatch({type:"rehydrated/setRehydrated",payload:!0}):console.error("Client store not set")},kF=(t,s,e)=>{const n=mt();return n?(n.addRequest(s),n.getQueue()):(console.warn("Outbox coordinator not set; cannot enqueue request yet."),[])},NF=(t,s,e)=>{const n=mt();if(!n)return console.warn("Outbox coordinator not set; cannot dequeue request yet."),[];const r=s.meta.offlineAction.payload.uuid;return n.remove(r),n.getQueue()};async function Ng(t,s){if(!s.payload)throw new Error("Received empty payload");return sb(s)}const Gg={...yc,effect:Ng,discard:HF,returnPromises:!0,persistCallback:kg,retry:Yg,persistOptions:{storage:lb},queue:{...yc.queue,enqueue:kF,dequeue:NF,peek:(...t)=>Kg(...t)}},Hg=ob(Lg,gt),Wg=l.compose(ub.offline(Gg),Hg);async function GF(t,s,e){if(s.store.getState().outboxReducer.deletedRequests.includes(t.payload.uuid))throw new Error("Request was marked for deletion");const c=jF[t.meta.offline.effect.serviceName];if(!c)throw new Error(`Service ${t.meta.offline.effect.serviceName} not found`);return lc(t.meta.offline.effect.BASE_URL,t.meta.offline.effect.request,s,c,e)}function HF(t,s,e=0){var p;if(console.debug("Considering discarding request due to error:",t,`(${typeof t})`,`
|
|
2
|
+
Url:`,s.payload.url,`
|
|
3
|
+
Retries:`,e),!(t instanceof Error))throw console.error("ENCOUNTERED NON-ERROR ERROR:",t,"(throwing immediately, which may lead to unexpected behavior)"),t;const n=Ft(),r=n.getState().outboxReducer.deletedRequests,a=s.payload.uuid;function u(){n.dispatch(Ef(a));const m=mt();if(!m)throw new Error("Outbox coordinator not set");m.remove(s.payload.uuid);const f=s.meta.offline.rollback;throw f&&(console.warn("Rolling back request due to SDK error:",s),n.dispatch(f)),t}if(t instanceof U&&t.options.discard&&(console.debug("Discarding request due to explicit discard:",s.payload.url),u()),r.includes(a)&&(console.debug("Discarding request due to deletion:",s.payload.url),u()),t instanceof U){const m=t.status||((p=t.response)==null?void 0:p.status);if(m||console.warn("Error has no status code:",t),m!==void 0&&dc.includes(m)){console.warn("Discarding request due to error:",t,`
|
|
4
|
+
Action:`,s);const f=mt();if(!f)throw new Error("Outbox coordinator not set");f.remove(s.payload.uuid),t.options.discard=!0,u()}}console.debug("Registering a retry for request:",s.payload.uuid);const d=mt();if(!d)throw new Error("Outbox coordinator not set");return d.registerRetry(s.payload.uuid),!1}function Kg(t,s,e){var n;return(n=mt())==null?void 0:n.peek()}function Yg(t,s){return Ft().dispatch(Bf(new Date().getTime())),Ac}const Pt="An unknown error occurred",Zg=500,WF=["non_field_errors","detail"];function Jg(t,s){let e;if(t!=null&&t.body)if(typeof t.body=="object"){const n=t.body;if(typeof n.error=="string")e=n.error;else if(typeof n.message=="string")e=n.message;else try{e=Object.entries(n).map(([c,r])=>typeof r=="string"?WF.includes(c)?r:`${c}: ${r}`:Array.isArray(r)?WF.includes(c)?r.join(`
|
|
5
|
+
`):r.map(a=>`${c}: ${a}`).join(`
|
|
6
|
+
`):`${c}: ${JSON.stringify(r)}`).join(`
|
|
7
|
+
`)}catch(c){console.error("Failed to extract error message from response body",c)}}else typeof t.body=="string"&&(e=t.body);else t!=null&&t.text?e=t.text:s instanceof Error&&(e=s.message);return!e||e.length>Zg?Pt:e}class U extends Error{constructor(e){super(Pt);h(this,"status");h(this,"response");h(this,"message");h(this,"options");const{response:n,innerError:c}=e;this.message=e.message??Jg(n,c)??Pt,this.status=(n==null?void 0:n.status)??0,this.response=n,e.discard=e.discard??!1,this.options=e}}function KF(t){function s(e){return typeof e=="object"&&e!==null&&["ok","redirect","clientError","serverError","error"].every(c=>c in e)}if(s(t))return t;if(typeof t=="object"&&t!==null){const e=t;if(s(e.response))return e.response;if(e.response&&s(e.response.response))return e.response.response}}class Xg extends qF{constructor(s){super(s)}}class ot extends qF{constructor(e,n){super(e);h(this,"auth");this.auth=n}}class Qg extends ot{async startConversation(s,e){return this.enqueueRequest({description:"Start agent conversation",method:o.POST,url:"/agents/prompt/",payload:{prompt:s,active_project:e},blockers:["prompt"],blocks:["prompt"]}).then(n=>(this.dispatch(Uc(n)),n))}async continueConversation(s,e,n){return this.enqueueRequest({description:"Prompt agent",method:o.POST,url:"/agents/prompt/",payload:{prompt:s,active_project:n},blockers:["prompt"],blocks:["prompt"],queryParams:{conversation_id:e}}).then(c=>{this.dispatch(kc(c))})}async fetchDetails(s){return this.enqueueRequest({description:"Get agent conversation",method:o.GET,url:`/agents/conversations/${s}/`,blockers:["conversation"],blocks:["conversation"]}).then(e=>{this.dispatch(Lc(e))})}async rate(s,e){return this.enqueueRequest({description:"Rate agent response",method:o.PUT,url:`/agents/responses/${s}/rate/`,payload:{rating:e},blockers:["rate"],blocks:["rate"]})}async list(s,e){return this.performRequest({method:o.GET,url:"/agents/conversations/",...s},e)}async refreshStore(s,e){const n=await this.list({queryParams:{project:s}},e);return this.dispatch($c(n)),n}}function at(t,s){const e=[];let n=0;const c=t.length;for(;n<c;)e.push(t.slice(n,n+=s));return e}function A(t,s,e){const n=`${s}${e?"s":""}`;switch(t){case o.GET:return`Get ${n}`;case o.POST:return`Create ${n}`;case o.PATCH:return`Update ${n}`;case o.PUT:return`Update ${n}`;case o.DELETE:return`Delete ${n}`}}class v extends ot{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:o.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:o.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:o.GET,...s},e)}}class j extends v{constructor(){super(...arguments);h(this,"pageSize",DF)}async add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions;let a,u=null,d=null;if("file"in e){const{file:b,...g}=e;u=await this.client.files.getFilePayload(b),d=URL.createObjectURL(b),a={...g,file_sha1:u.sha1,file_type:u.file_type,file_name:b.name,file_extension:u.extension,file_url:d}}else a=e;const p=this.buildModel(a),m=this.buildPayload(p);this.dispatch(n(p));const f=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:{...m,...u?{file:u}:{}},blockers:this.getBlockers(p),blocks:this.getBlocks(p)});f.then(({instance:b})=>{this.dispatch(c(b))}).catch(b=>{throw this.dispatch(r(this.getId(p))),b}).finally(()=>{d&&URL.revokeObjectURL(d)});const I=f.then(({instance:b})=>b),R=f.then(async({instance:b,presigned_url:g})=>{try{return g&&await this.client.files.processPresignedUrl(b.file_sha1,g),b.file_sha1}catch(_){throw console.error("Upload to s3 using presigned url failed.",_),_}});return[p,I,R]}async bulkAdd(e,n){const{addMany:c,updateMany:r,deleteMany:a}=this.actions,u=new Date().toISOString(),d=[],p=new Set,m=at(e,Math.min(n??e.length,k)),f=[];for(const g of m){const _=[],w={},B=[],C=[];for(const z of g){let bt;if("file"in z){const{file:mc,...FR}=z,_t=await this.client.files.getFilePayload(mc);_t.sha1 in w||(w[_t.sha1]=_t);const cb=URL.createObjectURL(mc);p.add(cb),bt={...FR,file_sha1:_t.sha1,file_type:_t.file_type,file_name:mc.name,file_extension:_t.extension,file_url:cb}}else bt=z;const q=this.buildModel(bt);d.push(q);const N=this.buildBulkPayload(q);_.push(N);const as=this.getBlockers(q);B.push(...as);const OR=this.getBlocks(q);C.push(...OR)}const D={payloads:_,submittedAt:u,files:Object.values(w),blockers:B,blocks:C};f.push(D)}this.dispatch(c(d));const I=f.map(g=>{const{submittedAt:_,files:w,payloads:B,blocks:C,blockers:D}=g;return this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{submitted_at:_,files:w,payloads:B},blockers:D,blocks:C})});Promise.all(I).then(g=>{const _=g.flatMap(w=>w.instances);this.dispatch(r(_))}).catch(g=>{throw this.dispatch(a(d.map(_=>this.getId(_)))),console.error(g),g}).finally(()=>{for(const g of p)URL.revokeObjectURL(g)});const R=Promise.all(I).then(g=>g.flatMap(({instances:_})=>_)),b=Promise.all(I).then(async g=>{const _=[];for(const{presigned_urls:w}of g){const B=this.client.files.processPresignedUrls(w);for(const[C,D]of Object.entries(B))try{await D,_.push(C)}catch(z){throw console.error("Upload to s3 using presigned url failed.",z),z}}return _});return[d,R,b]}async delete(e){const{addOne:n,deleteOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Attempting to delete ${this.name} with pk ${e} that does not exist in the store`);this.dispatch(c(this.getId(a)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(n(a)),u}}}class xg extends j{constructor(){super(...arguments);h(this,"name","Asset attachment");h(this,"url","/asset-attachments");h(this,"actions",{addOne:Wc,addMany:fs,setOne:Kc,setMany:Yc,updateOne:Zc,updateMany:Jc,deleteOne:Xc,deleteMany:Ss,initialize:Hc});h(this,"selectors",{selectById:xc,selectByIds:ea})}getId(e){return e.uuid}getBlockers(e){const{asset:n}=e;return[n]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return P({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset:e.asset}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset:e.asset}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{asset__project:e}},n)).flat();return this.dispatch(c(a)),a}}class eM extends v{constructor(){super(...arguments);h(this,"name","Asset Comment");h(this,"url","/asset-comments");h(this,"actions",{addOne:ca,addMany:qt,setOne:aa,setMany:ra,updateOne:da,updateMany:ua,deleteOne:la,deleteMany:Ct,initialize:na});h(this,"selectors",{selectById:ha,selectByIds:ma})}add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions,a=P({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[a.asset],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Asset comment with uuid ${e.uuid} not found in store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Asset comment with uuid ${e} not found in store`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{asset__project:e}},n)).flat();return this.dispatch(c(a)),a}}class tM extends v{constructor(){super(...arguments);h(this,"url","/assets");h(this,"name","Asset");h(this,"actions",{addOne:Ia,addMany:Ps,setOne:Fa,setMany:ba,updateOne:Ta,updateMany:Pa,deleteOne:Oa,deleteMany:Os,initialize:Aa});h(this,"selectors",{selectById:Ma,selectByIds:Ra})}add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=P({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[d.asset_type],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`No asset with uuid ${e.uuid} found in the store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{addOne:n,deleteOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`No asset with uuid ${e} found in the store`);const u=this.select(ta(e)),d=this.select(pa(e)),p=this.select(eh(e)),m=this.select(FA(e));this.dispatch(c(e)),this.dispatch(Ss(E(u))),this.dispatch(Ct(E(d))),this.dispatch(St(E(p))),this.dispatch(Tt(E(m)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(n(a)),this.dispatch(fs(u)),this.dispatch(qt(d)),this.dispatch(ft(p)),this.dispatch(It(m)),f}}bulkAdd(e,n){const{addMany:c}=this.actions,r=new Date().toISOString(),a=at(e,Math.min(n??e.length,k)).map(p=>{const m=p.map(f=>P(f));return{batchId:rt.v4(),payload:{submitted_at:r,assets:m}}}),u=[];let d=null;for(const p of a){const{batchId:m,payload:f}=p,I=f.assets.map(({uuid:w})=>w),R=f.assets.map(({asset_type:w})=>w),b=f.assets.map(({project:w})=>w),g=f.assets.map(({status:w})=>w),_=this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:f,blockers:(d?[d]:[]).concat(R).concat(b).concat(g),blocks:[m].concat(I)});d=p.batchId,u.push(_)}return Promise.all(u).then(p=>{const m=p.flat();this.dispatch(c(m))}),u}bulkUpdate(e,n){const{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,a=E(e).toSorted(jt);if(a.length!==e.length)throw new Error("payloads contains duplicate uuids.");const u=this.select(r(a)).toSorted(hs);if(a.length!=u.length)throw new Error(`Attempting to bulk update ${a.length-u.length} assets that dont exist in the store`);const d=[];for(let I=0;I<a.length;I++)d.push({...u[I],...e[I]});this.dispatch(c(d));const p=at(e,Math.min(n??e.length,k)),m=[];let f=null;for(const I of p){const R=rt.v4(),b=E(I),g=I.map(({status:w})=>w).filter(Boolean),_=this.enqueueRequest({description:A(o.PATCH,this.name,!0),method:o.PATCH,url:`${this.url}/bulk/`,payload:{payloads:I},blockers:(f?[f]:[]).concat(b).concat(g),blocks:[R].concat(b)});m.push(_),f=R}return Promise.all(m).then(I=>{this.dispatch(c(I.flat()))}).catch(()=>{this.dispatch(c(u))}),[d,m]}async bulkDelete(e){const{addMany:n,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e)),u=this.select(ya(e)),d=this.select(th(e)),p=this.select(bA(e));this.dispatch(c(e)),this.dispatch(Ct(E(u))),this.dispatch(St(E(d))),this.dispatch(Tt(E(p)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(m){throw this.dispatch(n(a)),this.dispatch(qt(u)),this.dispatch(ft(d)),this.dispatch(It(p)),m}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(c(a)),a}}class sM extends j{constructor(){super(...arguments);h(this,"name","Asset Type Attachment");h(this,"url","/asset-type-attachments");h(this,"actions",{addOne:Ba,addMany:bs,setOne:Va,setMany:za,updateOne:Da,updateMany:ja,deleteOne:qa,deleteMany:_s,initialize:Ea});h(this,"selectors",{selectById:$a,selectByIds:Ua})}getId(e){return e.uuid}getBlockers(e){return[e.asset_type]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return P({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_type:e.asset_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_type:e.asset_type}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(c(r)),r}}class iM extends j{constructor(){super(...arguments);h(this,"name","Asset Type Fields Attachment");h(this,"url","/asset-type-fields-attachments");h(this,"actions",{addOne:Ha,addMany:Wa,setOne:Ka,setMany:Ya,updateOne:Za,updateMany:Ja,deleteOne:Xa,deleteMany:Qa,initialize:Ga});h(this,"selectors",{selectById:er,selectByIds:tr})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return P({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{fields_revision__asset_type__organization:e}},n);return this.dispatch(c(r)),r}}class nM extends v{constructor(){super(...arguments);h(this,"name","Asset Type Fields");h(this,"url","/asset-type-fields");h(this,"actions",{addOne:cr,addMany:ar,setOne:rr,setMany:dr,updateOne:ur,updateMany:lr,deleteOne:or,deleteMany:hr,initialize:nr});h(this,"selectors",{selectById:pr,selectByIds:yr})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=P({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[d.asset_type],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(m=>{throw this.dispatch(r(d.uuid)),m}),[d,p]}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(c(r)),r}}class cM extends j{constructor(){super(...arguments);h(this,"name","Asset Type Field Values Attachment");h(this,"url","/asset-type-field-values-attachments");h(this,"actions",{addOne:Ir,addMany:Es,setOne:Tr,setMany:Pr,updateOne:Or,updateMany:Fr,deleteOne:br,deleteMany:Bs,initialize:Ar});h(this,"selectors",{selectById:gr,selectByIds:Mr})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return P({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}}async bulkDelete(e){const{deleteMany:n,addMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{field_values__asset__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class aM extends v{constructor(){super(...arguments);h(this,"name","Asset Type Field Values");h(this,"url","/asset-type-field-values");h(this,"actions",{addOne:Br,addMany:Vr,setOne:zr,setMany:Dr,updateOne:jr,updateMany:qr,deleteOne:Cr,deleteMany:$r,initialize:Er});h(this,"selectors",{selectById:Lr,selectByIds:kr})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=P({...e,created_by:a,submitted_at:u}),p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[e.asset,e.fields_revision],blocks:[d.uuid]});return this.dispatch(n(d)),p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}bulkAdd(e,n){const{payloads:c,values:r}=e,{addMany:a,setMany:u,deleteMany:d}=this.actions,p=new Date().toISOString(),m=[],f=at(c,Math.min(n??c.length,k)),I=[];for(const b of f){const g=[];for(const _ of b){const w=P({..._,values:_.values,created_by:this.select(B=>{var C;return((C=B.userReducer.currentUser)==null?void 0:C.id)??null}),submitted_at:p});m.push(w),g.push({uuid:w.uuid,asset:_.asset,fields_revision:_.fields_revision,published_at:_.published_at,values:w.values})}I.push({submitted_at:p,values:r,field_values:g})}this.dispatch(a(m));const R=[];for(const b of I){const{field_values:g}=b,_=g.map(({asset:D})=>D),w=g.map(({fields_revision:D})=>D),B=g.map(({uuid:D})=>D),C=this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:b,blockers:_.concat(w),blocks:B});R.push(C)}return Promise.all(R).then(b=>{this.dispatch(u(b.flat()))}).catch(()=>{this.dispatch(d(E(m)))}),[m,R]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected AssetTypeFieldValues with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[a.uuid,a.fields_revision,a.asset],blocks:[a.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected submission with uuid ${e} to exist`);const u=this.select(Rr(e));this.dispatch(n(e)),this.dispatch(Bs(E(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(Es(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{asset__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class rM extends v{constructor(){super(...arguments);h(this,"name","Asset Type Identifier");h(this,"url","/asset-type-identifiers");h(this,"actions",{addOne:Wr,addMany:Kr,setOne:Yr,setMany:Zr,updateOne:Jr,updateMany:Xr,deleteOne:Qr,deleteMany:xr,initialize:Hr});h(this,"selectors",{selectById:td,selectByIds:sd})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=P({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[d.asset_type],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected asset type identifier with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected asset type identifier with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(c(r)),r}}class dM extends v{constructor(){super(...arguments);h(this,"name","Asset Type Identifier Value");h(this,"url","/asset-type-identifier-values");h(this,"actions",{addOne:ad,addMany:rd,setOne:dd,setMany:ud,updateOne:ld,updateMany:od,deleteOne:hd,deleteMany:md,initialize:cd});h(this,"selectors",{selectById:yd,selectByIds:fd})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=P({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[e.asset,e.asset_type_identifier],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}bulkAdd(e,n){const{addMany:c,updateMany:r,deleteMany:a}=this.actions,u=new Date().toISOString(),d=this.select(b=>{var g;return((g=b.userReducer.currentUser)==null?void 0:g.id)??null}),p=at(e,Math.min(n??e.length,k)),m=[],f=[];for(const b of p){const g=[],_=[],w=[];for(const C of b){const D=P({...C,submitted_at:u,created_by:d});f.push(D);const z={uuid:D.uuid,asset:D.asset,asset_type_identifier:D.asset_type_identifier,value:D.value};g.push(z),_.push(D.asset),_.push(D.asset_type_identifier),w.push(D.uuid)}const B={payloads:g,submitted_at:u,blockers:_,blocks:w};m.push(B)}this.dispatch(c(f));const I=m.map(b=>{const{payloads:g,submitted_at:_,blockers:w,blocks:B}=b;return this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{submitted_at:_,payloads:g},blockers:w,blocks:B})});Promise.all(I).then(b=>{this.dispatch(r(b.flat()))}).catch(b=>{throw this.dispatch(a(E(f))),b});const R=Promise.all(I).then(b=>b.flat());return[f,R]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected asset type identifier value with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{asset__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class uM extends v{constructor(){super(...arguments);h(this,"name","Asset Type");h(this,"url","/asset-types");h(this,"actions",{addOne:Od,addMany:Fd,setOne:Td,setMany:Pd,updateOne:bd,updateMany:_d,deleteOne:gd,deleteMany:Md,initialize:Id});h(this,"selectors",{selectById:wd,selectByIds:vd})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=P({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected asset type with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected asset type with uuid ${e} to exist`);const u=this.select(ga(e)),d=this.select(La(e));this.dispatch(n(e)),this.dispatch(Os(E(u))),this.dispatch(_s(E(d)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(a)),this.dispatch(Ps(u)),this.dispatch(bs(d)),p}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{organization:e}},n);return this.dispatch(c(r)),r}}class lM extends v{constructor(){super(...arguments);h(this,"name","Asset Type Status");h(this,"url","/asset-type-statuses");h(this,"actions",{addOne:zd,addMany:Dd,setOne:jd,setMany:qd,updateOne:Cd,updateMany:$d,deleteOne:Ud,deleteMany:Ld,initialize:Vd});h(this,"selectors",{selectById:Nd,selectByIds:Gd})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=P({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[e.asset_type],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected an existing asset type status with uuid ${e.uuid}`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`No asset type status with uuid ${e} found in the store`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(c(r)),r}}class oM extends j{constructor(){super(...arguments);h(this,"name","Document Attachment");h(this,"url","/document-attachments");h(this,"actions",{addOne:Xd,addMany:Qd,setOne:xd,setMany:eu,updateOne:tu,updateMany:su,deleteOne:iu,deleteMany:nu,initialize:Jd});h(this,"selectors",{selectById:au,selectByIds:ru})}getId(e){return e.uuid}getBlockers(e){return[e.document]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return P({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,document:e.document}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,document:e.document}}async bulkAdd(e,n){const[c,r,a]=await super.bulkAdd(e,n),u={};for(const{file_sha1:d,uuid:p}of c)d in u||(u[d]=[]),u[d].push(p);return a.then(d=>{const p=d.flatMap(m=>u[m]??[]);for(const m of p)this.makeReadable(m)}),[c,r,a]}makeReadable(e){this.enqueueRequest({description:"Add attachment to AI assistant",method:o.PATCH,url:`${this.url}/${e}/`,payload:{readable_to_assistant:!0},blockers:["index-document-attachment",e],blocks:["index-document-attachment"]})}async refreshStore(e,n){const{initialize:c}=this.actions,r=this.list({queryParams:{document__project__organization:e}},n),a=this.list({queryParams:{document__organization:e}},n),d=(await Promise.all([r,a])).flat();return this.dispatch(c(d)),d}}class hM extends v{constructor(){super(...arguments);h(this,"name","Document");h(this,"url","/documents");h(this,"actions",{addOne:ou,addMany:hu,setOne:mu,setMany:pu,updateOne:yu,updateMany:fu,deleteOne:Su,deleteMany:Au,initialize:lu});h(this,"selectors",{selectById:Tu,selectByIds:Pu})}add(e){const{addOne:n,deleteOne:c,updateOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=P({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:d.parent_document?[d.parent_document]:[],blocks:[d.uuid]});return p.then(m=>{this.dispatch(r(m))}).catch(()=>{this.dispatch(c(d.uuid))}),[d,p]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`attempting to update a document with uuid ${e.uuid} that does not exist in store.documents`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c,addMany:r,deleteMany:a}=this.actions,{selectById:u}=this.selectors,d=this.select(u(e));if(!d)throw new Error(`attempting to delete a document with uuid ${e} that does not exist in store.documents`);const p=this.select(Ou(e));this.dispatch(n(e)),this.dispatch(a(E(p)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(m){throw this.dispatch(c(d)),this.dispatch(r(p)),m}}async refreshStore(e,n){const{initialize:c}=this.actions,r=this.list({queryParams:{project__organization:e}},n),a=this.list({queryParams:{organization:e}},n),d=(await Promise.all([r,a])).flat();return this.dispatch(c(d)),d}}class ht extends ot{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:o.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:o.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:o.GET,...s},e)}}class mM extends ht{constructor(){super(...arguments);h(this,"name","Email Domains");h(this,"url","/organization-email-domains");h(this,"actions",{addOne:_u,addMany:gu,setOne:Mu,setMany:Ru,updateOne:wu,updateMany:vu,deleteOne:Eu,deleteMany:Bu,initialize:bu});h(this,"selectors",{selectById:zu,selectByIds:Du})}async add(e,n){return this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:{email:n,organization:e},blockers:[e,"create-org"],blocks:[]})}async delete(e){const{deleteOne:n,addOne:c}=this.actions;this.dispatch(n(e.uuid));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e.uuid}/`,blockers:[e.domain],blocks:[]})}catch(r){throw this.dispatch(c(e)),r}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{organization:e}},n);return this.dispatch(c(r)),r}}class pM extends ot{async getVerificationCode(s){return this.enqueueRequest({description:"Get verification code",method:o.GET,url:`/verification/email-verification/${s}/`,isAuthNeeded:!1,blockers:[],blocks:[]})}validateVerificationCode(s,e=void 0){return this.enqueueRequest({description:"Validate verification code",method:o.POST,url:`/verification/email-verification/${s}/`,isAuthNeeded:!1,payload:e,blockers:[],blocks:[]})}}const zt={},uc=new Set;class yM extends ot{constructor(){super(...arguments);h(this,"host");h(this,"dbPromise",hb.openDB("fileCache",1,{upgrade(e){e.createObjectStore("files")}}))}async getDB(){return await this.dbPromise}async addCache(e){if(!e.name)throw new Error(`Cant add a file without a name to cache: ${e.name}`);if(!e.type)throw new Error(`Cant add a file without a type to cache: ${e.name}`);if(!e.size)throw new Error(`Cant add an empty file to cache: ${e.name}`);const n=await Dt(e);if(uc.has(n))return;const c=await this.getDB();!!await c.get("files",n)?console.warn(`Attempting to add a file already cached, ${e.name}`):await c.put("files",e,n),uc.add(n)}async removeCache(e){await(await this.getDB()).delete("files",e),uc.delete(e)}async fetchCache(e){return(await this.getDB()).get("files",e)}async fetchFileFromUrl(e,n,c=n){const r=e.split("?")[0]??e,a=await this.fetchCache(n);if(a)return a;let u;r in zt?u=zt[r]:vc(e)?(u=wc(e,c),zt[r]=u):(u=new Promise(m=>{this.performRequest({method:o.GET,url:e,isExternalUrl:!0,isResponseBlob:!0,isAuthNeeded:!1}).then(f=>{const I=new File([f],c,{type:f.type});m(I)})}),zt[r]=u);let d;try{d=await u}catch(m){throw m instanceof U&&delete zt[r],m}const p=await Dt(d);if(p!==n){const m=`The hash of the file returned from the server (${p}) does not match the
|
|
8
|
+
expected hash (${n}). This can happen if you're using a local development server and the
|
|
10
9
|
isExternalUrl flag in the request details is set to true, because instead of requesting the local
|
|
11
10
|
REST API, you will be requesting localhost:80 (where this app runs), resulting in a transformed blob
|
|
12
11
|
(with an uuid attached) being returned. Alternatively, you may be running with
|
|
13
12
|
import.meta.env.PROD, which will result in some file requests being treated as
|
|
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 y=c??h+"."+p;if(o=Tn(o,y),!o.name)throw new Error("Failed to set file's name");await this.addCache(o,h),xt[n]=new Promise(f=>{f(o)})}return o}}class mF extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(Qi(n));const r=this.enqueueRequest({description:"Create form identifier",method:l.POST,url:"/form-identifiers/",payload:v(n),blockers:[n.form],blocks:[n.uuid]});return r.then(m=>{this.dispatch(yt(m))}).catch(()=>{this.dispatch(xi(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=ea(e.uuid)(i.getState());if(!a)throw new Error(`Expected form identifier with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(yt(c));const n=this.enqueueRequest({description:"Update form identifier",method:l.PATCH,url:`/form-identifiers/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(yt(r))}).catch(()=>{this.dispatch(yt(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=ea(e)(a);if(!c)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(xi(e));try{return await this.enqueueRequest({description:"Delete form identifier",method:l.DELETE,url:`/form-identifiers/${e}/`,blockers:[e],blocks:[]})}catch(n){throw this.dispatch(Qi(c)),n}}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(So(a)),a}}class pF extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(sa(n));const r=this.enqueueRequest({description:"Create form identifier value",method:l.POST,url:"/form-identifier-values/",payload:v(n),blockers:[e.form_submission,e.form_identifier],blocks:[n.uuid]});return r.then(m=>{this.dispatch(At(m))}).catch(()=>{this.dispatch(ia(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=ca(e.uuid)(i.getState());if(!a)throw new Error(`Expected form identifier value with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(At(c));const n=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 n.then(r=>{this.dispatch(At(r))}).catch(()=>{this.dispatch(At(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=ca(e)(a);if(!c)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(ia(e));try{return await this.enqueueRequest({description:"Delete form identifier value",method:l.DELETE,url:`/form-identifier-values/${e}/`,blockers:[e],blocks:[]})}catch(n){throw this.dispatch(sa(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get form identifier values",method:l.GET,url:"/form-identifier-values/",queryParams:{limit:this.pageSize,paginate:!0,form_submission__form_revision__form__organization:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get form identifier values",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Fo(c)),c}}class yF 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,c={},n=[],r=[];for(const o of e){const{revisionUuid:h,fieldIdentifier:p,file:y}=o,f=await this.getFilePayload(y);f.sha1 in c||(c[f.sha1]=f);const I=F({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:f.sha1,created_by:a,form_revision:h,submitted_at:i,field_identifier:p});n.push(I);const b={uuid:I.uuid,file_name:y.name,field_identifier:p,file_extension:f.extension,file_sha1:f.sha1,form_revision:h};r.push(b)}this.dispatch(vo(n));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(c)},blockers:n.map(o=>o.form_revision),blocks:n.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(wo(o.attachments))}).catch(()=>{this.dispatch(Mo(n.map(o=>o.uuid)))}),[n,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(Ro(a)),a}}class AF extends j{add(e){var u;const{store:i}=this.client,c=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=F({...e,created_by:c,submitted_at:new Date().toISOString()});this.dispatch(da(n));const r=this.enqueueRequest({description:"Create form revision",method:l.POST,url:"/form-revisions/",payload:v(n),blockers:[e.form],blocks:[n.uuid]});return r.then(m=>{this.dispatch(Do(m))}).catch(()=>{this.dispatch(ua(n.uuid))}),[n,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(qo(a)),a}}class fF extends j{add(e,i){var o;const{store:a}=this.client,c=new Date().toISOString(),n=(o=a.getState().userReducer.currentUser)==null?void 0:o.id,r=F({...e,submitted_at:c,created_by:n}),u=F({...i,form:r.uuid,submitted_at:c,created_by:n});this.dispatch(ma(r)),this.dispatch(da(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(pa(r.uuid)),this.dispatch(ua(u.uuid)),h}),[r,u,m]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Ho(e)(a);if(!c)throw new Error("Expected form to exist");const n=al(e)(a);n.length>0&&this.dispatch(il(n.map(({uuid:u})=>u)));const r=Co(e)(a);r.length>0&&this.dispatch(Uo(r.map(({uuid:u})=>u))),this.dispatch(pa(e));try{return await this.enqueueRequest({description:"Delete form",method:l.DELETE,url:`/forms/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(ma(c)),r.length>0&&this.dispatch(zo(r)),n.length>0&&this.dispatch(tl(n)),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 SF 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,c={},n=[],r=[];for(const o of e){const{submissionUuid:h,fieldIdentifier:p,file:y}=o,f=await this.getFilePayload(y);f.sha1 in c||(c[f.sha1]=f);const I=F({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:f.sha1,created_by:a,form_submission:h,submitted_at:i,field_identifier:p});n.push(I);const b={uuid:I.uuid,file_name:y.name,file_sha1:f.sha1,file_extension:f.extension,field_identifier:p,form_submission:h};r.push(b)}this.dispatch(Lt(n));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(c)},blockers:n.map(o=>o.form_submission),blocks:n.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(Yo(o.attachments))}).catch(o=>{throw this.dispatch(Nt(n.map(h=>h.uuid))),o}),[n,u.then(({attachments:o})=>o)]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),c=Jo(e)(a);this.dispatch(Nt(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(n){throw this.dispatch(Lt(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get form submission attachments",method:l.GET,url:"/form-submission-attachments/",queryParams:{limit:Le,paginate:!0,form_submission__form_revision__form__organization:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get form submission attachments",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Ko(c)),c}}class TF extends j{add(e){var r;const{store:i}=this.client,a=i.getState(),c=F({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),n=this.enqueueRequest({description:"Add form submission",method:l.POST,url:"/form-submissions/",payload:v(c),blockers:[e.form_revision],blocks:[c.uuid]});return this.dispatch(Sa(c)),n.then(u=>(this.dispatch(Ht(u)),u)).catch(()=>{this.dispatch(Ta(c.uuid))}),[c,n]}update(e){const{store:i}=this.client,a=i.getState(),c=Ia(e.uuid)(a);if(!c)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const n={...c,...e};this.dispatch(sl(n));const r=this.enqueueRequest({description:"Delete user form submissions",method:l.PATCH,url:`/form-submissions/${n.uuid}/`,payload:e,blockers:[n.uuid],blocks:[n.uuid]});return r.then(u=>{this.dispatch(Ht(u))}).catch(()=>{this.dispatch(Ht(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Ia(e)(a);if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const n=Xo(e)(a);this.dispatch(Ta(e)),this.dispatch(Nt(n.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(Sa(c)),this.dispatch(Lt(n)),r}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Fetch form submissions",method:l.GET,url:"/form-submissions/",queryParams:{limit:this.pageSize,paginate:!0,form_revision__form_organization:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Fetch form submissions",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(el(c)),c}}class gF extends j{async add(e){var p;const{store:i}=this.client,{file:a,...c}=e,n=new Date().toISOString(),r=(p=i.getState().userReducer.currentUser)==null?void 0:p.id,u=c.project,m=await this.getFilePayload(a),o=F({...c,file_name:a.name,file_sha1:m.sha1,file_type:a.type,file:URL.createObjectURL(a),submitted_at:n,created_by:r});this.dispatch(ul(o));const h=this.enqueueRequest({description:"Add geo image",method:l.POST,url:"/geo-images/",payload:{uuid:o.uuid,submitted_at:n,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(y=>{this.processPresignedUrls(y.presigned_urls),this.dispatch(ft(y.geo_image))}).catch(()=>{this.dispatch(Fa(o.uuid))}),[o,h.then(y=>y.geo_image)]}async bulkAdd(e,i){var p;const{store:a}=this.client,c=new Date().toISOString(),n=(p=a.getState().userReducer.currentUser)==null?void 0:p.id,r=[],u=[],m=[],o={};for(const y of e){const{file:f,...I}=y,b=await this.getFilePayload(f);b.sha1 in o||(o[b.sha1]=b);const R=F({...I,file_name:f.name,file_sha1:b.sha1,file_type:f.type,file:URL.createObjectURL(f),submitted_at:c,created_by:n,project:i});r.push(R),u.push(R.uuid),m.push({uuid:R.uuid,sha1:R.file_sha1,file_name:R.file_name,title:R.title,description:R.description,geo_marker:R.geo_marker,canvas_marker:R.canvas_marker,direction:R.direction,original_date:R.original_date})}this.dispatch(ol(r));const h=this.enqueueRequest({description:"Bulk add geo images",method:l.POST,url:"/geo-images/bulk/",payload:{submitted_at:c,project:i,geo_images:m,files:Object.values(o)},blocks:[i],blockers:u});return h.then(y=>{this.processPresignedUrls(y.presigned_urls),this.dispatch(dl(y.geo_images))}).catch(()=>{this.dispatch(hl(u))}),[r,h.then(y=>y.geo_images)]}update(e){const{store:i}=this.client,a=i.getState(),c=Pa(e.uuid)(a);if(!c)throw new Error(`Map image with uuid ${e.uuid} does not exist in the store`);const n={...c,...e};this.dispatch(ll(n));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(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Pa(e)(a);if(!c)throw new Error(`Map image with uuid ${e} does not exist in the store`);this.dispatch(Fa(e));const n=this.enqueueRequest({description:"Delete geo image",method:l.DELETE,url:`/geo-images/${e}/`,blocks:[e],blockers:[e]});return n.catch(()=>{this.dispatch(ft(c))}),n}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(rl(a)),a}}class IF extends O{add(e){var u;const{store:i}=this.client,a=new Date().toISOString(),c=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=F({...e,submitted_at:a,created_by:c});this.dispatch(Oa(n));const r=this.enqueueRequest({description:"Add issue association",method:l.POST,url:"/issue-associations/",payload:v(n),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[n.uuid]});return r.then(m=>{this.dispatch(Sl(m))}).catch(()=>{this.dispatch(va(n.uuid))}),[n,r]}async delete(e){const{store:i}=this.client,a=Tl(e)(i.getState());if(!a)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(va(e));const c=this.enqueueRequest({description:"Delete issue association",method:l.DELETE,url:`/issue-associations/${e}/`,blockers:[e],blocks:[]});return c.catch(()=>{this.dispatch(Oa(a))}),c}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Fetch issue associations",method:l.GET,url:"/issue-associations/",queryParams:{limit:this.pageSize,paginate:!0,associated_issue__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Fetch issue associations",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(fl(c)),c}}class bF extends We{constructor(){super(...arguments);S(this,"name","Issue Attachment");S(this,"url","/issue-attachments");S(this,"initializeAttachments",Ea);S(this,"addAttachments",ja);S(this,"updateAttachments",Ol);S(this,"removeAttachments",Va);S(this,"removeAttachment",Rl);S(this,"setAttachment",_l);S(this,"selectAttachment",El)}getId(i){return i.uuid}buildModel(i){return F({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,issue:i.modelUuid})}buildPayload(i,a){return{uuid:i.uuid,file_name:i.file_name,file_sha1:i.file_sha1,file_extension:a.extension,issue:i.issue}}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 n=(await this.performPagination({immediate:!0,description:"Get issue attachments",method:l.GET,url:`${this.url}/`,queryParams:{limit:Le,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(Ea(n)),n}}class FF extends We{constructor(){super(...arguments);S(this,"name","Issue Comment Attachment");S(this,"url","/issue-comment-attachments");S(this,"initializeAttachments",za);S(this,"addAttachments",ql);S(this,"updateAttachments",Dl);S(this,"removeAttachments",Cl);S(this,"removeAttachment",Ul);S(this,"setAttachment",zl);S(this,"selectAttachment",$l)}getId(i){return i.uuid}buildModel(i){return F({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,issue_comment:i.modelUuid})}buildPayload(i,a){return{uuid:i.uuid,file_name:i.file_name,file_sha1:i.file_sha1,file_extension:a.extension,issue_comment:i.issue_comment}}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 n=(await this.performPagination({immediate:!0,description:"Get issue comment attachments",method:l.GET,url:`${this.url}/`,queryParams:{limit:Le,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(za(n)),n}}class PF extends O{add(e){var n;const{store:i}=this.client,a=F({...e,author:(n=i.getState().userReducer.currentUser)==null?void 0:n.id,submitted_at:new Date().toISOString()});this.dispatch(Ua(a));const c=this.enqueueRequest({description:"Add issue comment",method:l.POST,url:"/issue-comments/",payload:v(a),blockers:[e.issue],blocks:[a.uuid]});return c.catch(()=>{this.dispatch(ka(a.uuid))}),[a,c]}update(e){const{store:i}=this.client,a=Ba(e.uuid)(i.getState());if(!a)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const c={...a,...e};this.dispatch(Ca(c));const n=this.enqueueRequest({description:"Edit issue comment",method:l.PATCH,url:`/issue-comments/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.catch(()=>{this.dispatch(Ca(a))}),[c,n]}remove(e){const{store:i}=this.client,a=Ba(e)(i.getState());if(!a)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(ka(e));const c=this.enqueueRequest({description:"Delete comment",method:l.DELETE,url:`/issue-comments/${e}/`,blockers:[e],blocks:[]});return c.catch(()=>{this.dispatch(Ua(a))}),c}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(Nl(a)),a}}class _F extends O{add(e){var m;const{store:i}=this.client,a=i.getState(),c=new Date().toISOString(),n=(m=a.userReducer.currentUser)==null?void 0:m.id,r=F({...e,submitted_at:c,created_by:n});this.dispatch(Ga(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(Wt(o))}).catch(o=>{throw this.dispatch(La(r.uuid)),o}),[r,u]}update(e){var m;const i=this.client.store.getState(),a=Wa(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 c={...a,...e};this.dispatch(Wt(c));const n={};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];n[o]=h!==void 0?Number(h):null;break}case E.DUE_DATE:case E.DESCRIPTION:case E.TITLE:n[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`);n[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`);n[o]=h?{full_name:h.username,id:h.id}:null;break}}const r=F({created_by:(m=i.userReducer.currentUser)==null?void 0:m.id,submitted_at:new Date().toISOString(),issue:a.uuid,changes:n});this.dispatch(Qh(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(Wt(a)),this.dispatch(em(r.uuid))}),[c,u]}async remove(e){const{store:i}=this.client,a=i.getState(),c=Wa(e)(a);if(!c)throw new Error(`No issue with uuid ${e} found in the store`);const n=Ml(e)(a),r=am(e)(a),u={};for(const o of gl(e)(a))u[o.uuid]=o;for(const o of Il(e)(a))u[o.uuid]=o;const m=Object.values(u);this.dispatch(La(e)),n.length>0&&this.dispatch(Va(n.map(({uuid:o})=>o))),r.length>0&&this.dispatch(tm(r.map(({uuid:o})=>o))),m.length>0&&this.dispatch(wa(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(Ga(c)),this.dispatch(ja(n)),this.dispatch(xh(r)),this.dispatch(Ra(m)),o}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get issues",method:l.GET,url:"/issues/",queryParams:{limit:this.pageSize,paginate:!0,project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get issues",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Yl(c)),c}}class OF extends We{constructor(){super(...arguments);S(this,"name","Issue Type Attachment");S(this,"url","/issue-type-attachments");S(this,"initializeAttachments",Ya);S(this,"addAttachments",eh);S(this,"updateAttachments",sh);S(this,"removeAttachments",ah);S(this,"removeAttachment",ih);S(this,"setAttachment",th);S(this,"selectAttachment",rh)}getId(i){return i.uuid}buildModel(i){return F({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,issue_type:i.modelUuid})}buildPayload(i,a){return{uuid:i.uuid,file_name:i.file_name,file_sha1:i.file_sha1,file_extension:a.extension,issue_type:i.issue_type}}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 c=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(Ya(c)),c}}class RF 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,c={},n=[],r=[];for(const o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:y}=o,f=await this.getFilePayload(y);f.sha1 in c||(c[f.sha1]=f);const I=F({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:f.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});n.push(I);const b={uuid:I.uuid,file_name:y.name,file_extension:f.extension,field_identifier:p,file_sha1:f.sha1,fields_revision:h};r.push(b)}this.dispatch(lh(n));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(c)},blockers:n.map(o=>o.fields_revision),blocks:n.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(hh(o.attachments))}).catch(()=>{this.dispatch(mh(n.map(o=>o.uuid)))}),[n,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(oh(a)),a}}class vF extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(Fh(n));const r=this.enqueueRequest({description:"Add Issue Type Fields",method:l.POST,url:"/issue-type-fields/",payload:v(n),blockers:[n.issue_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(Ph(m))}).catch(m=>{throw this.dispatch(_h(n.uuid)),m}),[n,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(bh(a)),a}}class wF 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,c={},n=[],r=[];for(const o of e){const{fieldValuesUuid:h,fieldIdentifier:p,file:y}=o,f=await this.getFilePayload(y);f.sha1 in c||(c[f.sha1]=f);const I=F({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:f.sha1,created_by:a,field_values:h,submitted_at:i,field_identifier:p});n.push(I);const b={uuid:I.uuid,file_name:y.name,file_sha1:f.sha1,file_extension:f.extension,field_identifier:p,field_values:h};r.push(b)}this.dispatch(Yt(n));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(c)},blockers:n.map(o=>o.field_values),blocks:n.map(o=>o.uuid)});return u.then(({presigned_urls:o,attachments:h})=>{this.processPresignedUrls(o),this.dispatch(Mh(h))}).catch(o=>{throw this.dispatch(Zt(n.map(h=>h.uuid))),o}),[n,u.then(({attachments:o})=>o)]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),c=jh(e)(a);this.dispatch(Zt(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(n){throw this.dispatch(Yt(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get issue type field values attachments",method:l.GET,url:"/issue-type-field-values-attachments/",queryParams:{limit:Le,paginate:!0,field_values__issue__project:e,latest:!0},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get issue type field values attachments",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(wh(c)),c}}class MF extends O{add(e){var r;const{store:i}=this.client,a=i.getState(),c=F({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),n=this.enqueueRequest({description:"Add issue type field values",method:l.POST,url:"/issue-type-field-values/",payload:v(c),blockers:[e.issue,e.fields_revision],blocks:[c.uuid]});return this.dispatch(Xa(c)),n.then(u=>(this.dispatch(Tt(u)),u)).catch(()=>{this.dispatch(Qa(c.uuid))}),[c,n]}update(e){const{store:i}=this.client,a=i.getState(),c=ec(e.uuid)(a);if(!c)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const n={...c,...e};this.dispatch(Tt(n));const r=this.enqueueRequest({description:"Update issue type field values",method:l.PATCH,url:`/issue-type-field-values/${e.uuid}/`,payload:e,blockers:[n.uuid,n.fields_revision,n.issue],blocks:[n.uuid]});return r.then(u=>{this.dispatch(Tt(u))}).catch(()=>{this.dispatch(Tt(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=ec(e)(a);if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const n=Vh(e)(a);this.dispatch(Qa(e)),this.dispatch(Zt(n.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(Xa(c)),this.dispatch(Yt(n)),r}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get issue type field values",method:l.GET,url:"/issue-type-field-values/",queryParams:{limit:this.pageSize,paginate:!0,issue__project:e,latest:!0},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get issue type field values",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Sh(c)),c}}class EF extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(cc(n));const r=this.enqueueRequest({description:"Create issue type identifier",method:l.POST,url:"/issue-type-identifiers/",payload:v(n),blockers:[n.issue_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(gt(m))}).catch(()=>{this.dispatch(nc(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=rc(e.uuid)(i.getState());if(!a)throw new Error(`Expected issue type identifier with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(gt(c));const n=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 n.then(r=>{this.dispatch(gt(r))}).catch(()=>{this.dispatch(gt(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=rc(e)(a);if(!c)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(nc(e));try{return await this.enqueueRequest({description:"Delete issue type identifier",method:l.DELETE,url:`/issue-type-identifiers/${e}/`,blockers:[e],blocks:[]})}catch(n){throw this.dispatch(cc(c)),n}}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(Dh(a)),a}}class jF extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(uc(n));const r=this.enqueueRequest({description:"Create issue type identifier value",method:l.POST,url:"/issue-type-identifier-values/",payload:v(n),blockers:[e.issue,e.issue_type_identifier],blocks:[n.uuid]});return r.then(m=>{this.dispatch(It(m))}).catch(()=>{this.dispatch(oc(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=hc(e.uuid)(i.getState());if(!a)throw new Error(`Expected issue type identifier value with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(It(c));const n=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 n.then(r=>{this.dispatch(It(r))}).catch(()=>{this.dispatch(It(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=hc(e)(a);if(!c)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(oc(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(n){throw this.dispatch(uc(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get issue type identifier values",method:l.GET,url:"/issue-type-identifier-values/",queryParams:{limit:this.pageSize,paginate:!0,issue__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get issue type identifier values",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch($h(c)),c}}class VF extends O{add(e){var r;const{store:i}=this.client,a=i.getState(),c=F({...e,submitted_at:new Date().toISOString(),created_by:(r=a.userReducer.currentUser)==null?void 0:r.id});this.dispatch(Wh(c));const n=this.enqueueRequest({method:l.POST,url:"/issue-types/",payload:v(c),blockers:[],blocks:[c.uuid]});return n.then(u=>{this.dispatch(bt(u))}).catch(()=>{this.dispatch(pc(c.uuid))}),[c,n]}update(e){const{store:i}=this.client,a=i.getState(),c=Ac(e.uuid)(a);if(!c)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const n={...c,...e};this.dispatch(Kh(n));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(bt(u))}).catch(()=>{this.dispatch(bt(c))}),[n,r]}delete(e){const{store:i}=this.client,a=i.getState(),c=Ac(e)(a);if(!c)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const n=Xl(e)(a);this.dispatch(pc(e)),this.dispatch(Jl(n.map(u=>u.uuid)));const r=this.enqueueRequest({method:l.DELETE,url:`/issue-types/${e}/`,blockers:[e],blocks:[]});return r.catch(()=>{this.dispatch(bt(c)),this.dispatch(Zl(n))}),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(Hh(a)),a}}class qF extends O{async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get issue updates",method:l.GET,url:"/issue-updates/",queryParams:{limit:this.pageSize,paginate:!0,issue__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get issue updates",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Xh(c)),c}}const zF=1800;function DF(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 UF extends qb{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 c;try{c=await a}catch(n){console.error("Could not renew tokens; clearing auth",n),this.clearAuth();return}if(!c.access)throw new Error("Missing access token");return{accessToken:c.access,refreshToken:c.refresh??this.getRefreshToken()}})}clearAuth(){console.debug(this.constructor.name,"clearing auth;"),this.dispatch(zu(!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 c;try{c=dy(i).exp??a}catch{c=a}return c-a<zF}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 c=this.client.store.getState();if(i.url.endsWith("/token/refresh/"))throw c.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(c.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(c=>{this.setTokens(DF(c))})}}class CF extends O{update(e){const{store:i}=this.client,a=bc(e.uuid)(i.getState()),c={...a,...e};this.dispatch(Xt(c));const n=this.enqueueRequest({description:"Edit organization access",method:l.PATCH,url:`/organization-accesses/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(Xt(r))}).catch(r=>{throw this.dispatch(Xt(a)),r}),[c,n]}async remove(e){const{store:i}=this.client,a=i.getState(),c=bc(e)(a),n=hm(c.user)(a);this.dispatch(Am(c.uuid)),this.dispatch(um(c.user));try{await this.enqueueRequest({description:"Remove organization access",method:l.DELETE,url:`/organization-accesses/${c.uuid}/`,blockers:[c.uuid],blocks:[]})}catch(r){throw this.dispatch(ym(c)),this.dispatch(dm(n)),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(pm(a)),a}}class kF extends O{async add(e){const i=await this.enqueueRequest({description:"Create organization",method:l.POST,url:"/organizations/",payload:e,blockers:[],blocks:[]});return this.dispatch(Im(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(bm(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(gm(i)),i}}class BF extends O{add(e){var n;const{store:i}=this.client,a=F({...e,created_by:(n=i.getState().userReducer.currentUser)==null?void 0:n.id});this.dispatch(Oc(a));const c=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 c.then(r=>{this.dispatch(Ft(r))}).catch(r=>{throw this.dispatch(vc(a.uuid)),r}),[a,c]}bulkAdd(e){var r;const{store:i}=this.client,a=(r=i.getState().userReducer.currentUser)==null?void 0:r.id,c=e.map(u=>F({...u,created_by:a}));this.dispatch(Rc(c));const n=this.enqueueRequest({description:"Add project accesses",method:l.POST,url:"/project-accesses/bulk/",payload:{project_accesses:c.map(u=>v(u))},blockers:c.flatMap(u=>[u.project,u.organization_access]),blocks:c.map(u=>u.uuid)});return n.then(u=>{this.dispatch(Vm(u))}).catch(u=>{throw this.dispatch(wc(c.map(m=>m.uuid))),u}),[c,n]}update(e){const{store:i}=this.client,a=Ec(e.uuid)(i.getState()),c={...a,...e};this.dispatch(Ft(c));const n=this.enqueueRequest({description:"Edit project access",method:l.PATCH,url:`/project-accesses/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return n.then(r=>{this.dispatch(Ft(r))}).catch(r=>{throw this.dispatch(Ft(a)),r}),[c,n]}async remove(e){const{store:i}=this.client,a=Ec(e)(i.getState());this.dispatch(vc(e));try{await this.enqueueRequest({description:"Delete project access",method:l.DELETE,url:`/project-accesses/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(Oc(a)),c}}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(jm(a)),a}}class $F extends We{constructor(){super(...arguments);S(this,"name","Project Attachment");S(this,"url","/project-attachments");S(this,"initializeAttachments",Vc);S(this,"addAttachments",Um);S(this,"updateAttachments",Bm);S(this,"removeAttachments",qc);S(this,"removeAttachment",$m);S(this,"setAttachment",Cm);S(this,"selectAttachment",Nm)}getId(i){return i.uuid}buildModel(i){return F({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,project:i.modelUuid})}buildPayload(i,a){return{uuid:i.uuid,file_name:i.file_name,file_sha1:i.file_sha1,file_extension:a.extension,project:i.project}}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 c=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(Vc(c)),c}}class GF extends O{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(c=>{this.dispatch(Dc(c))}),a}saveActive(){const{store:e}=this.client,i=e.getState(),a=i.projectFileReducer.activeProjectFileId;if(!a)throw new Error("No active project file");const c=i.projectFileReducer.instances[a];if(!c)throw new Error("No active project file");if(!c.bounds&&!c.canvas_bounds)throw new Error("Project file must either have bounds or canvas_bounds set");let n;if(typeof c.file=="string"&&!c.file.startsWith("blob:")){const m={...c};delete m.file,n={method:l.PATCH,url:`/project-files/${a}/`,payload:m,blockers:[a],blocks:[a]}}else n=new Promise((m,o)=>{this.client.files.uploadFileToS3(c.file_sha1).then(([h])=>{m({method:l.POST,url:"/project-files/",payload:{...c,...h},blockers:[a],blocks:[a]})}).catch(o)});const u=Promise.resolve(n).then(m=>this.enqueueRequest(m));return u.then(m=>{this.dispatch(Dc(m))}),this.dispatch(ep),this.dispatch(xm(null)),this.dispatch(Qm(!1)),[c,u]}delete(e){return this.dispatch(Jm(e)),this.enqueueRequest({method:l.DELETE,url:`/project-files/${e}`,blockers:[e],blocks:[]})}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get project files",method:l.GET,url:"/project-files/",queryParams:{limit:this.pageSize,paginate:!0,project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get project files",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Ym(c)),c}}class LF extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(Cc(n));const r=this.enqueueRequest({description:"Create project folder",method:l.POST,url:"/project-folders/",payload:v(n),blockers:[e.project],blocks:[n.uuid]});return r.then(m=>{this.dispatch(Pt(m))}).catch(m=>{throw this.dispatch(kc(n.uuid)),m}),[n,r]}update(e){const i=this.client.store.getState(),a=$c(e.uuid)(i);if(!a)throw new Error(`Expected an existing project folder with uuid ${e.uuid}`);const c={...a,...e};this.dispatch(Pt(c));const n=this.enqueueRequest({description:"Edit project folder",method:l.PATCH,url:`/project-folders/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(Pt(r))}).catch(()=>{this.dispatch(Pt(a))}),[c,n]}remove(e){const{store:i}=this.client,a=$c(e)(i.getState());if(!a)throw new Error(`No project folder with uuid ${e} found in the store`);this.dispatch(kc(e));const c=this.enqueueRequest({description:"Delete project folder",method:l.DELETE,url:`/project-folders/${a.uuid}/`,blockers:[a.uuid],blocks:[]});return c.catch(()=>{this.dispatch(Cc(a))}),c}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get project folders",method:l.GET,url:"/project-folders/",queryParams:{project__organization:e},blocks:[],blockers:[]},i);return this.dispatch(cp(a)),a}}class NF extends O{async add(e){const i=await this.enqueueRequest({description:"Create project",method:l.POST,url:"/projects/",payload:v(e),blockers:[],blocks:[]});return this.dispatch(Lc(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(op(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(),c=mp(e)(a);if(!c)throw new Error("Expected project to exist");const n=sp(a).filter(m=>m.project===e);this.dispatch(Xm(n.map(({uuid:m})=>m)));const r=Hm(c.uuid)(a);this.dispatch(qc(r.map(({uuid:m})=>m)));const u=zm(e)(a);this.dispatch(wc(u.map(({uuid:m})=>m))),this.dispatch(Nc(c.uuid));try{await this.enqueueRequest({description:"Delete project",method:l.DELETE,url:`/projects/${e}/`,blockers:[e],blocks:[]}),this.dispatch(Nc(c.uuid))}catch(m){throw this.dispatch(Lc(c)),this.dispatch(Rc(Object.values(u))),this.dispatch(Zm(n)),this.dispatch(km(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(up(a)),a}}class HF extends O{add(e){var n;const{store:i}=this.client,a=F({...e,created_by:(n=i.getState().userReducer.currentUser)==null?void 0:n.id});this.dispatch(fp(a));const c=this.enqueueRequest({description:"Create team membership",method:l.POST,url:"/team-memberships/",payload:v(a),blockers:[e.team],blocks:[a.uuid]});return c.then(r=>{this.dispatch(Yc(r))}).catch(()=>{this.dispatch(Zc(a.uuid))}),[a,c]}bulkAdd(e){var r;const{store:i}=this.client,a=(r=i.getState().userReducer.currentUser)==null?void 0:r.id,c=e.map(u=>F({...u,created_by:a}));this.dispatch(Sp(c));const n=this.enqueueRequest({description:"Create team memberships",method:l.POST,url:"/team-memberships/bulk/",payload:{team_memberships:c.map(u=>v(u))},blockers:c.map(u=>u.team),blocks:c.map(u=>u.uuid)});return n.then(u=>{this.dispatch(Tp(u))}).catch(()=>{this.dispatch(gp(c.map(u=>u.uuid)))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Fp(e)(a);if(!c)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(Zc(e));try{return await this.enqueueRequest({description:"Delete team membership",method:l.DELETE,url:`/team-memberships/${e}/`,blockers:[e],blocks:[e]})}catch(n){throw this.dispatch(Yc(c)),n}}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(Ap(a)),a}}class WF extends O{add(e){var n;const{store:i}=this.client,a=F({...e,submitted_at:new Date().toISOString(),created_by:(n=i.getState().userReducer.currentUser)==null?void 0:n.id});this.dispatch(Op(a));const c=this.enqueueRequest({description:"Create team",method:l.POST,url:"/teams/",payload:v(a),blockers:[],blocks:[a.uuid]});return c.then(r=>{this.dispatch(_t(r))}).catch(()=>{this.dispatch(Qc(a.uuid))}),[a,c]}update(e){const{store:i}=this.client,a=en(e.uuid)(i.getState());if(!a)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(Rp(c));const n=this.enqueueRequest({description:"Update team",method:l.PATCH,url:`/teams/${e.uuid}/`,payload:v(e),blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(_t(r))}).catch(()=>{this.dispatch(_t(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=en(e)(a);if(!c)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(Qc(e));try{return await this.enqueueRequest({description:"Delete team",method:l.DELETE,url:`/teams/${e}/`,blockers:[e],blocks:[e]})}catch(n){throw this.dispatch(_t(c)),n}}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(_p(a)),a}}class KF extends O{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(rm(a)),a}}class YF{constructor(e){S(this,"store");this.store=e}async enqueueRequest(e,i,a,c){return this._enqueueRequest(e,i,a,c).then(n=>{if(n instanceof D)throw n;return n})}_enqueueRequest(e,i,a,c){const n=new fn,r={...e,BASE_URL:i,serviceName:a};if(e.immediate){const u={...r,uuid:e.uuid??Xe.v4()},m={payload:u,meta:{offline:{effect:{timestamp:new Date().toISOString(),request:u,BASE_URL:i,serviceName:a}}}};sn(m,this,c).then(o=>{n.resolve(o.body)}).catch(o=>{o instanceof Error?n.reject(o):n.reject(new Error((o??et).toString()))})}else{const u=this.store.dispatch(Rm(r)),m=h=>{if(h)n.resolve(h.body);else{const p=new D({message:"Could not get a response from the server.",response:h,discard:!0});n.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})),n.reject(h)};u.then(m,o)}return n}}class tt{constructor(){S(this,"graph");S(this,"requestAttemptCounter");this.graph=new uy.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(e){const i=new tt;for(let a=0;a<e.length;a++){const c=e[a];if(!c){console.error("Outbox item was undefined");continue}i.sneakRequest(c);for(let n=0;n<a;n++){const r=e[n];if(!r){console.error("Previous outbox item was undefined");continue}r.payload.uuid!==c.payload.uuid&&r.payload.blocks.some(u=>c.payload.blockers.includes(u))&&tt._addDependency(c.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(c=>a.payload.blocks.includes(c))&&this._addDependency(e.payload.uuid,i)}}insertRequest(e){this.graph.addNode(e.payload.uuid,e);for(const i of this.graph.overallOrder()){if(i===e.payload.uuid)continue;this.graph.getNodeData(i).payload.blockers.some(c=>e.payload.blocks.includes(c))&&this._addDependency(i,e.payload.uuid)}}sneakRequest(e){this.graph.addNode(e.payload.uuid,e)}_getNextNode(){const e=this.graph.overallOrder(!0);let i=1/0,a;for(const c of e){const n=this.requestAttemptCounter[c]||0;n<i&&(i=n,a=c)}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),c=e.findIndex(n=>n.payload.uuid===a.payload.uuid);c!==-1&&(e.splice(c,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 c=this.requestAttemptCounter[i.payload.uuid]||0,n=this.requestAttemptCounter[a.payload.uuid]||0;return c-n}),e}registerRetry(e){this.requestAttemptCounter[e]=(this.requestAttemptCounter[e]||0)+1}}let Hp;function Wp(t){Hp=t}function st(){return Hp}let Kp;function Yp(t){Kp=t}function Zp(){return Kp}let rn=null;function Ze(){const t=st();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(rn)return rn;const e=t.getState().offline.outbox,i=tt._fromOutbox(e);return rn=i,i}const ZF=(t,e)=>{const i=new e(t);return Yp(i),Wp(t),i};class JF{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 dn{constructor(){S(this,"next");this.next=null}then(e){return new JF(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=Zp();if(!a)throw new Error("Client SDK not set");return sn(e,a)}}}class Jp extends dn{async run(e){return super.run(e)}}class Xp extends dn{async run(e){return super.run(e)}}const Qp=new Jp().then(new Xp).compile();function xp(t){var e;return(e=Qp[0])==null?void 0:e.run(t)}var ey=(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))(ey||{});s.ALL_MIDDLEWARE=Qp,s.APIError=D,s.ATTACHMENT_MODEL_DEFAULT_PAGE_SIZE=Le,s.AgentService=zb,s.AssetAttachmentService=Db,s.AssetProcedureService=Gb,s.AssetProcedureStepFieldValuesAttachmentService=Wb,s.AssetProcedureStepFieldValuesService=Kb,s.AssetProcedureStepFieldsAttachmentService=Nb,s.AssetProcedureStepFieldsService=Hb,s.AssetProcedureStepService=Yb,s.AssetProcedureTypeAttachmentService=Ub,s.AssetProcedureTypeFieldValuesAttachmentService=Bb,s.AssetProcedureTypeFieldValuesService=$b,s.AssetProcedureTypeFieldsAttachmentService=Cb,s.AssetProcedureTypeFieldsService=kb,s.AssetProcedureTypeService=Lb,s.AssetService=Zb,s.AssetStageCompletionService=Jb,s.AssetStageService=Xb,s.AssetTypeAttachmentService=Qb,s.AssetTypeFieldValuesAttachmentService=tF,s.AssetTypeFieldValuesService=sF,s.AssetTypeFieldsAttachmentService=xb,s.AssetTypeFieldsService=eF,s.AssetTypeIdentifierService=iF,s.AssetTypeIdentifierValueService=aF,s.AssetTypeService=cF,s.AttachmentModel=yn,s.BaseApiService=O,s.BaseSDK=YF,s.COMMON_AUTO_FIELDS=bn,s.CategoryService=nF,s.DEFAULT_ISSUE_PRIORITY=ly,s.DEFAULT_ISSUE_STATUS=oy,s.DEFAULT_PAGE_SIZE=Vp,s.DeferredPromise=fn,s.DocumentAttachmentService=rF,s.DocumentService=dF,s.EMPTY_ARRAY=ln,s.EMPTY_OBJECT=hn,s.EMPTY_SET=mn,s.EmailDomainsService=uF,s.EmailVerificationService=oF,s.FileService=hF,s.FormIdentifierService=mF,s.FormIdentifierValueService=pF,s.FormRevisionAttachmentService=yF,s.FormRevisionService=AF,s.FormService=fF,s.FormSubmissionAttachmentService=SF,s.FormSubmissionService=TF,s.GeoImageService=gF,s.HttpMethod=l,s.IssueAssociationService=IF,s.IssueAttachmentService=bF,s.IssueCommentAttachmentService=FF,s.IssueCommentService=PF,s.IssuePriority=ts,s.IssueService=_F,s.IssueStatus=ss,s.IssueTypeAttachmentService=OF,s.IssueTypeFieldValuesAttachmentService=wF,s.IssueTypeFieldValuesService=MF,s.IssueTypeFieldsAttachmentService=RF,s.IssueTypeFieldsService=vF,s.IssueTypeIdentifierService=EF,s.IssueTypeIdentifierValueService=jF,s.IssueTypeService=VF,s.IssueUpdateChange=E,s.IssueUpdateService=qF,s.JWTService=UF,s.OUTBOX_RETRY_DELAY=An,s.OfflineAnalyticsMiddleware=Jp,s.OfflineMiddleware=dn,s.OrganizationAccessLevel=pn,s.OrganizationAccessService=CF,s.OrganizationService=kF,s.OutboxCoordinator=tt,s.ProjectAccessService=BF,s.ProjectAttachmentService=$F,s.ProjectFileService=GF,s.ProjectFolderService=LF,s.ProjectService=NF,s.RESET_ORGANIZATION_STATE=_,s.RESET_PROJECT_STATE=M,s.RESET_STATE=g,s.RateLimitingMiddleware=Xp,s.SelectorBuilder=gb,s.TeamMembershipService=HF,s.TeamService=WF,s.UNKNOWN_ERROR_MESSAGE=et,s.UserService=KF,s.VERSION_REDUCER_KEY=it,s.VerificationCodeType=ey,s._setLatestRetryTime=wm,s.addAsset=Xs,s.addAssetAttachment=Ly,s.addAssetAttachments=ls,s.addAssetProcedure=Os,s.addAssetProcedureStep=md,s.addAssetProcedureStepFieldValues=Hs,s.addAssetProcedureStepFieldValuesAttachment=ZA,s.addAssetProcedureStepFieldValuesAttachments=Et,s.addAssetProcedureStepFieldValuesMany=cd,s.addAssetProcedureStepFields=Cs,s.addAssetProcedureStepFieldsAttachment=VA,s.addAssetProcedureStepFieldsAttachments=$r,s.addAssetProcedureStepFieldsMany=BA,s.addAssetProcedureSteps=pd,s.addAssetProcedureType=js,s.addAssetProcedureTypeAttachment=Wy,s.addAssetProcedureTypeAttachments=Hn,s.addAssetProcedureTypeFieldValues=Is,s.addAssetProcedureTypeFieldValuesAttachment=lA,s.addAssetProcedureTypeFieldValuesAttachments=wt,s.addAssetProcedureTypeFieldValuesMany=Pr,s.addAssetProcedureTypeFields=or,s.addAssetProcedureTypeFieldsAttachment=Jy,s.addAssetProcedureTypeFieldsAttachments=sr,s.addAssetProcedureTypeFieldsMany=iA,s.addAssetProcedureTypes=OA,s.addAssetProcedures=Er,s.addAssetStage=oi,s.addAssetStageCompletion=ai,s.addAssetStageCompletions=ci,s.addAssetStages=gf,s.addAssetType=Di,s.addAssetTypeAttachment=Of,s.addAssetTypeAttachments=yi,s.addAssetTypeFieldValues=bi,s.addAssetTypeFieldValuesAttachment=Nf,s.addAssetTypeFieldValuesAttachments=kt,s.addAssetTypeFieldValuesMany=Au,s.addAssetTypeFields=su,s.addAssetTypeFieldsAttachment=wf,s.addAssetTypeFieldsAttachments=Yd,s.addAssetTypeFieldsMany=Df,s.addAssetTypeIdentifier=Ri,s.addAssetTypeIdentifierValue=Ei,s.addAssetTypeIdentifierValues=nS,s.addAssetTypeIdentifiers=eS,s.addAssetTypes=yS,s.addAssets=zt,s.addCategories=PS,s.addCategory=$i,s.addConversation=En,s.addConversations=Dy,s.addDocumentAttachment=ES,s.addDocumentAttachments=Nu,s.addDocuments=to,s.addEmailDomain=no,s.addEmailDomains=CS,s.addForm=ma,s.addFormIdentifier=Qi,s.addFormIdentifierValue=sa,s.addFormIdentifierValues=QS,s.addFormIdentifiers=WS,s.addFormRevision=da,s.addFormRevisionAttachment=cT,s.addFormRevisionAttachments=vo,s.addFormRevisions=zo,s.addFormSubmission=Sa,s.addFormSubmissionAttachment=FT,s.addFormSubmissionAttachments=Lt,s.addFormSubmissions=tl,s.addForms=AT,s.addGeoImage=ul,s.addGeoImages=ol,s.addIssue=Ga,s.addIssueAssociation=Oa,s.addIssueAssociations=Ra,s.addIssueAttachment=UT,s.addIssueAttachments=ja,s.addIssueComment=Ua,s.addIssueCommentAttachment=BT,s.addIssueCommentAttachments=ql,s.addIssueComments=HT,s.addIssueType=Wh,s.addIssueTypeAttachment=tg,s.addIssueTypeAttachments=eh,s.addIssueTypeFieldValues=Xa,s.addIssueTypeFieldValuesAttachment=Rg,s.addIssueTypeFieldValuesAttachments=Yt,s.addIssueTypeFieldValuesMany=hg,s.addIssueTypeFields=Fh,s.addIssueTypeFieldsAttachment=cg,s.addIssueTypeFieldsAttachments=lh,s.addIssueTypeFieldsMany=Sg,s.addIssueTypeIdentifier=cc,s.addIssueTypeIdentifierValue=uc,s.addIssueTypeIdentifierValues=kg,s.addIssueTypeIdentifiers=Vg,s.addIssueTypes=Wg,s.addIssueUpdate=Qh,s.addIssueUpdates=xh,s.addIssues=Zl,s.addOrganization=Im,s.addOrganizationAccess=ym,s.addOrganizationAccesses=hI,s.addOrganizations=II,s.addProject=Lc,s.addProjectAccess=Oc,s.addProjectAccesses=Rc,s.addProjectAttachment=qI,s.addProjectAttachments=Um,s.addProjectFile=CI,s.addProjectFiles=Zm,s.addProjectFolder=Cc,s.addProjectFolders=LI,s.addProjects=QI,s.addTeam=Op,s.addTeamMembership=fp,s.addTeamMemberships=Sp,s.addTeams=ob,s.addUser=dm,s.addUsers=cI,s.agentsReducer=qn,s.agentsSlice=rs,s.areArraysEqual=py,s.assetAttachmentReducer=Ln,s.assetAttachmentSlice=us,s.assetProcedureReducer=Vr,s.assetProcedureSlice=_s,s.assetProcedureStepFieldValuesAttachmentReducer=sd,s.assetProcedureStepFieldValuesAttachmentSlice=Gs,s.assetProcedureStepFieldValuesReducer=ud,s.assetProcedureStepFieldValuesSlice=Ns,s.assetProcedureStepFieldsAttachmentReducer=Wr,s.assetProcedureStepFieldsAttachmentSlice=Ds,s.assetProcedureStepFieldsReducer=Zr,s.assetProcedureStepFieldsSlice=Us,s.assetProcedureStepReducer=fd,s.assetProcedureStepSlice=Ys,s.assetProcedureTypeAttachmentReducer=Jn,s.assetProcedureTypeAttachmentSlice=ms,s.assetProcedureTypeFieldValuesAttachmentReducer=Sr,s.assetProcedureTypeFieldValuesAttachmentSlice=Ss,s.assetProcedureTypeFieldValuesReducer=Rr,s.assetProcedureTypeFieldValuesSlice=gs,s.assetProcedureTypeFieldsAttachmentReducer=cr,s.assetProcedureTypeFieldsAttachmentSlice=ys,s.assetProcedureTypeFieldsReducer=mr,s.assetProcedureTypeFieldsSlice=As,s.assetProcedureTypeReducer=Ur,s.assetProcedureTypeSlice=Es,s.assetReducer=Pd,s.assetSlice=Js,s.assetStageCompletionReducer=wd,s.assetStageCompletionSlice=ii,s.assetStageReducer=zd,s.assetStageSlice=ui,s.assetTypeAttachmentReducer=Hd,s.assetTypeAttachmentSlice=mi,s.assetTypeFieldValuesAttachmentReducer=mu,s.assetTypeFieldValuesAttachmentSlice=Ti,s.assetTypeFieldValuesReducer=gu,s.assetTypeFieldValuesSlice=Ii,s.assetTypeFieldsAttachmentReducer=xd,s.assetTypeFieldsAttachmentSlice=fi,s.assetTypeFieldsReducer=nu,s.assetTypeFieldsSlice=Si,s.assetTypeIdentifierReducer=_u,s.assetTypeIdentifierSlice=Oi,s.assetTypeIdentifierValueReducer=wu,s.assetTypeIdentifierValueSlice=Mi,s.assetTypeReducer=Vu,s.assetTypeSlice=zi,s.authReducer=Du,s.authSlice=$t,s.baseReducer=fb,s.baseReducers=tn,s.blobToBase64=Py,s.categoryReducer=Gu,s.categorySlice=Bi,s.clearTokens=IS,s.constructUploadedFilePayloads=Fy,s.createModelAdapter=P,s.createOfflineAction=_m,s.createPayload=v,s.createSelectionAdapter=hy,s.deleteAsset=Qs,s.deleteAssetAttachment=Cn,s.deleteAssetAttachments=hs,s.deleteAssetProcedure=Rs,s.deleteAssetProcedureStep=yd,s.deleteAssetProcedureStepFieldValues=Ws,s.deleteAssetProcedureStepFieldValuesAttachment=xA,s.deleteAssetProcedureStepFieldValuesAttachments=jt,s.deleteAssetProcedureStepFieldValuesMany=rd,s.deleteAssetProcedureStepFields=ks,s.deleteAssetProcedureStepFieldsAttachment=UA,s.deleteAssetProcedureStepFieldsAttachments=Lr,s.deleteAssetProcedureStepFieldsMany=NA,s.deleteAssetProcedureSteps=Ad,s.deleteAssetProcedureType=Vs,s.deleteAssetProcedureTypeAttachment=Yn,s.deleteAssetProcedureTypeAttachments=Zn,s.deleteAssetProcedureTypeFieldValues=bs,s.deleteAssetProcedureTypeFieldValuesAttachment=yA,s.deleteAssetProcedureTypeFieldValuesAttachments=Mt,s.deleteAssetProcedureTypeFieldValuesMany=Or,s.deleteAssetProcedureTypeFields=hr,s.deleteAssetProcedureTypeFieldsAttachment=eA,s.deleteAssetProcedureTypeFieldsAttachments=ar,s.deleteAssetProcedureTypeFieldsMany=rA,s.deleteAssetProcedureTypes=vA,s.deleteAssetProcedures=jr,s.deleteAssetStage=li,s.deleteAssetStageCompletion=ni,s.deleteAssetStageCompletions=ri,s.deleteAssetStages=bf,s.deleteAssetType=Ui,s.deleteAssetTypeAttachment=Bd,s.deleteAssetTypeAttachments=Ai,s.deleteAssetTypeFieldValues=Fi,s.deleteAssetTypeFieldValuesAttachment=Yf,s.deleteAssetTypeFieldValuesAttachments=Bt,s.deleteAssetTypeFieldValuesMany=Su,s.deleteAssetTypeFields=au,s.deleteAssetTypeFieldsAttachment=Vf,s.deleteAssetTypeFieldsAttachments=Jd,s.deleteAssetTypeFieldsMany=Bf,s.deleteAssetTypeIdentifier=vi,s.deleteAssetTypeIdentifierValue=ji,s.deleteAssetTypeIdentifierValues=oS,s.deleteAssetTypeIdentifiers=aS,s.deleteAssetTypes=fS,s.deleteAssets=xs,s.deleteCategories=vS,s.deleteCategory=Bu,s.deleteConversation=ky,s.deleteConversations=By,s.deleteDocumentAttachment=Ku,s.deleteDocumentAttachments=Yu,s.deleteEmailDomain=ro,s.deleteEmailDomains=LS,s.deleteForm=pa,s.deleteFormIdentifier=xi,s.deleteFormIdentifierValue=ia,s.deleteFormIdentifierValues=sT,s.deleteFormIdentifiers=JS,s.deleteFormRevision=ua,s.deleteFormRevisionAttachment=uT,s.deleteFormRevisionAttachments=Mo,s.deleteFormRevisions=Uo,s.deleteFormSubmission=Ta,s.deleteFormSubmissionAttachment=RT,s.deleteFormSubmissionAttachments=Nt,s.deleteFormSubmissions=il,s.deleteForms=IT,s.deleteGeoImage=Fa,s.deleteGeoImages=hl,s.deleteIssue=La,s.deleteIssueAssociation=va,s.deleteIssueAssociations=wa,s.deleteIssueAttachment=Rl,s.deleteIssueAttachments=Va,s.deleteIssueComment=ka,s.deleteIssueCommentAttachment=Ul,s.deleteIssueCommentAttachments=Cl,s.deleteIssueComments=YT,s.deleteIssueType=Zg,s.deleteIssueTypeAttachment=ih,s.deleteIssueTypeAttachments=ah,s.deleteIssueTypeFieldValues=Qa,s.deleteIssueTypeFieldValuesAttachment=Eg,s.deleteIssueTypeFieldValuesAttachments=Zt,s.deleteIssueTypeFieldValuesMany=Ag,s.deleteIssueTypeFields=_h,s.deleteIssueTypeFieldsAttachment=ug,s.deleteIssueTypeFieldsAttachments=mh,s.deleteIssueTypeFieldsMany=bg,s.deleteIssueTypeIdentifier=nc,s.deleteIssueTypeIdentifierValue=oc,s.deleteIssueTypeIdentifierValues=Lg,s.deleteIssueTypeIdentifiers=Ug,s.deleteIssueTypes=Jg,s.deleteIssueUpdate=em,s.deleteIssueUpdates=tm,s.deleteIssues=Jl,s.deleteOrganization=FI,s.deleteOrganizationAccess=Am,s.deleteOrganizationAccesses=AI,s.deleteOrganizations=PI,s.deleteProject=Nc,s.deleteProjectAccess=vc,s.deleteProjectAccesses=wc,s.deleteProjectAttachment=$m,s.deleteProjectAttachments=qc,s.deleteProjectFile=Jm,s.deleteProjectFiles=Xm,s.deleteProjectFolder=kc,s.deleteProjectFolders=KI,s.deleteProjects=eb,s.deleteTeam=Qc,s.deleteTeamMembership=Zc,s.deleteTeamMemberships=gp,s.deleteTeams=mb,s.deleteUser=um,s.deleteUsers=dI,s.dequeue=$p,s.discard=Lp,s.documentAttachmentReducer=Qu,s.documentAttachmentSlice=Ni,s.documentSlice=Wi,s.documentsReducer=io,s.downloadFile=_y,s.downloadInMemoryFile=by,s.emailDomainsReducer=lo,s.emailDomainsSlice=Zi,s.emailRegex=jy,s.enqueue=Bp,s.enqueueRequest=Rm,s.fallbackToEmptyArray=T,s.fallbackToEmptyObject=vt,s.fallbackToEmptySet=yy,s.fileReducer=Ao,s.fileSlice=Ji,s.fileToBlob=gn,s.formIdentifierReducer=Io,s.formIdentifierSlice=Xi,s.formIdentifierValueReducer=_o,s.formIdentifierValueSlice=ta,s.formReducer=Go,s.formRevisionAttachmentReducer=jo,s.formRevisionAttachmentSlice=na,s.formRevisionReducer=ko,s.formRevisionsSlice=ra,s.formSlice=ha,s.formSubmissionAttachmentReducer=Qo,s.formSubmissionAttachmentSlice=ya,s.formSubmissionReducer=cl,s.formSubmissionSlice=fa,s.geoImageReducer=yl,s.geoImageSlice=ba,s.getAssetProcedureStepSubTree=Rn,s.getAssetProcedureStepTrees=Vy,s.getClientSDK=Zp,s.getClientStore=st,s.getFileIdentifier=Iy,s.getFileS3Key=ns,s.getLocalDateString=Sn,s.getLocalRelativeDateString=Ty,s.getOutboxCoordinator=Ze,s.getProjectFolderSubTree=zy,s.getProjectFolderTrees=qy,s.getRenamedFile=Tn,s.hashFile=Qe,s.initSDK=ZF,s.initializeAssetAttachments=os,s.initializeAssetProcedureStepFieldValues=ad,s.initializeAssetProcedureStepFieldValuesAttachments=Xr,s.initializeAssetProcedureStepFields=Yr,s.initializeAssetProcedureStepFieldsAttachments=Br,s.initializeAssetProcedureSteps=ld,s.initializeAssetProcedureTypeAttachments=ps,s.initializeAssetProcedureTypeFieldValues=Fr,s.initializeAssetProcedureTypeFieldValuesAttachments=Ar,s.initializeAssetProcedureTypeFields=ur,s.initializeAssetProcedureTypeFieldsAttachments=tr,s.initializeAssetProcedureTypes=Dr,s.initializeAssetProcedures=Mr,s.initializeAssetStageCompletions=Od,s.initializeAssetStages=Vd,s.initializeAssetTypeAttachments=pi,s.initializeAssetTypeFieldValues=yu,s.initializeAssetTypeFieldValuesAttachments=du,s.initializeAssetTypeFields=tu,s.initializeAssetTypeFieldsAttachments=Kd,s.initializeAssetTypeIdentifierValues=Ru,s.initializeAssetTypeIdentifiers=bu,s.initializeAssetTypes=Eu,s.initializeAssets=Id,s.initializeCategories=Cu,s.initializeConversations=Mn,s.initializeDocumentAttachments=Hi,s.initializeEmailDomains=co,s.initializeFormIdentifierValues=Fo,s.initializeFormIdentifiers=So,s.initializeFormRevisionAttachments=Ro,s.initializeFormRevisions=qo,s.initializeFormSubmissionAttachments=Ko,s.initializeFormSubmissions=el,s.initializeForms=$o,s.initializeGeoImages=rl,s.initializeIssueAssociations=fl,s.initializeIssueAttachments=Ea,s.initializeIssueCommentAttachments=za,s.initializeIssueComments=NT,s.initializeIssueTypeAttachments=Ya,s.initializeIssueTypeFieldValues=Sh,s.initializeIssueTypeFieldValuesAttachments=wh,s.initializeIssueTypeFields=bh,s.initializeIssueTypeFieldsAttachments=oh,s.initializeIssueTypeIdentifierValues=$h,s.initializeIssueTypeIdentifiers=Dh,s.initializeIssueTypes=Hh,s.initializeIssueUpdates=Xh,s.initializeIssues=Yl,s.initializeOrganizationAccesses=pm,s.initializeOrganizations=gm,s.initializeProjectAccesses=jm,s.initializeProjectAttachments=Vc,s.initializeProjectFiles=Ym,s.initializeProjectFolders=cp,s.initializeProjects=up,s.initializeTeamMemberships=Ap,s.initializeTeams=_p,s.initializeUsers=rm,s.isToday=Sy,s.issueAssociationReducer=Fl,s.issueAssociationSlice=_a,s.issueAttachmentReducer=jl,s.issueAttachmentSlice=Ma,s.issueCommentAttachmentReducer=Gl,s.issueCommentAttachmentSlice=qa,s.issueCommentReducer=Wl,s.issueCommentSlice=Da,s.issueReducer=Ql,s.issueSlice=$a,s.issueTypeAttachmentReducer=dh,s.issueTypeAttachmentSlice=Ka,s.issueTypeFieldValuesAttachmentReducer=qh,s.issueTypeFieldValuesAttachmentSlice=sc,s.issueTypeFieldValuesReducer=gh,s.issueTypeFieldValuesSlice=Ja,s.issueTypeFieldsAttachmentReducer=Ah,s.issueTypeFieldsAttachmentSlice=Za,s.issueTypeFieldsReducer=Rh,s.issueTypeFieldsSlice=tc,s.issueTypeIdentifierReducer=kh,s.issueTypeIdentifierSlice=ac,s.issueTypeIdentifierValueReducer=Lh,s.issueTypeIdentifierValueSlice=dc,s.issueTypeReducer=Zh,s.issueTypeSlice=mc,s.issueUpdateReducer=cm,s.issueUpdateSlice=fc,s.logOnlyOnce=Oy,s.markAsDeleted=vm,s.markForDeletion=wI,s.memoize=as,s.onlyUniqueHashes=Ey,s.onlyUniqueOfflineIds=_n,s.organizationAccessReducer=fm,s.organizationAccessSlice=gc,s.organizationReducer=Pm,s.organizationSlice=Fc,s.outboxReducer=Mm,s.outboxSlice=Pc,s.overmapEnhancer=vb,s.overmapReducer=Sb,s.overmapReducers=jp,s.performRequest=sn,s.projectAccessReducer=qm,s.projectAccessSlice=_c,s.projectAttachmentReducer=Wm,s.projectAttachmentSlice=jc,s.projectFileReducer=ip,s.projectFileSlice=zc,s.projectFolderReducer=rp,s.projectFolderSlice=Uc,s.projectReducer=lp,s.projectSlice=Gc,s.rehydratedReducer=pp,s.rehydratedSlice=Wc,s.removeDocuments=Ki,s.removeIssueType=pc,s.restructureCreateSelectorWithArgs=A,s.runMiddleware=xp,s.saveActiveProjectFileBounds=ep,s.selectAccessToken=bS,s.selectAccessesByUserOfProject=jI,s.selectAccessibleProjects=tb,s.selectActiveOrganizationAccess=fI,s.selectActiveProjectFileId=$I,s.selectAllDocumentAttachments=Ju,s.selectAllProjectAttachments=Lm,s.selectAssetAttachmentById=$n,s.selectAssetAttachmentMapping=kn,s.selectAssetAttachments=Bn,s.selectAssetById=si,s.selectAssetProcedureById=Ms,s.selectAssetProcedureStepById=Zs,s.selectAssetProcedureStepFieldValues=Vt,s.selectAssetProcedureStepFieldValuesAttachmentById=ef,s.selectAssetProcedureStepFieldValuesAttachments=xr,s.selectAssetProcedureStepFieldValuesAttachmentsByIds=ed,s.selectAssetProcedureStepFieldValuesAttachmentsMapping=Ls,s.selectAssetProcedureStepFieldValuesById=Ks,s.selectAssetProcedureStepFieldValuesMapping=dd,s.selectAssetProcedureStepFieldValuesOfAsset=af,s.selectAssetProcedureStepFieldValuesOfAssetProcedure=cf,s.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=nf,s.selectAssetProcedureStepFields=$s,s.selectAssetProcedureStepFieldsAttachmentById=kA,s.selectAssetProcedureStepFieldsAttachments=Hr,s.selectAssetProcedureStepFieldsAttachmentsMapping=Nr,s.selectAssetProcedureStepFieldsById=YA,s.selectAssetProcedureStepFieldsMapping=Bs,s.selectAssetProcedureStepFieldsOfAssetProcedureStep=HA,s.selectAssetProcedureStepMapping=ut,s.selectAssetProcedureSteps=Sd,s.selectAssetProcedureStepsByIds=lf,s.selectAssetProcedureStepsMappingOfAssetProcedureType=uf,s.selectAssetProcedureStepsOfAssetProcedureType=of,s.selectAssetProcedureTypeAttachmentById=xn,s.selectAssetProcedureTypeAttachmentMapping=Xn,s.selectAssetProcedureTypeAttachments=Qn,s.selectAssetProcedureTypeById=zs,s.selectAssetProcedureTypeFieldValues=Fs,s.selectAssetProcedureTypeFieldValuesAttachmentById=AA,s.selectAssetProcedureTypeFieldValuesAttachments=Tr,s.selectAssetProcedureTypeFieldValuesAttachmentsByIds=gr,s.selectAssetProcedureTypeFieldValuesAttachmentsMapping=Ts,s.selectAssetProcedureTypeFieldValuesById=Ps,s.selectAssetProcedureTypeFieldValuesMapping=vr,s.selectAssetProcedureTypeFieldValuesOfAsset=TA,s.selectAssetProcedureTypeFields=fs,s.selectAssetProcedureTypeFieldsAttachmentById=sA,s.selectAssetProcedureTypeFieldsAttachments=rr,s.selectAssetProcedureTypeFieldsAttachmentsMapping=nr,s.selectAssetProcedureTypeFieldsById=oA,s.selectAssetProcedureTypeFieldsMapping=pr,s.selectAssetProcedureTypeFieldsOfAssetProcedureType=dA,s.selectAssetProcedureTypes=Cr,s.selectAssetProcedureTypesByIds=EA,s.selectAssetProcedureTypesMapping=qs,s.selectAssetProcedureTypesOfOrganization=jA,s.selectAssetProcedures=ws,s.selectAssetProceduresByIds=_A,s.selectAssetProceduresMapping=vs,s.selectAssetProceduresOfAssetProcedureType=qr,s.selectAssetProceduresOfAssetType=PA,s.selectAssetStageById=hi,s.selectAssetStageCompletionById=Md,s.selectAssetStageCompletionMapping=di,s.selectAssetStageCompletions=Sf,s.selectAssetStageCompletionsByIds=Ed,s.selectAssetStages=Dd,s.selectAssetStagesByIds=_f,s.selectAssetStagesMappingOfAssetProcedureType=Ff,s.selectAssetStagesOfAssetProcedureType=Pf,s.selectAssetTypeAttachmentById=Ld,s.selectAssetTypeAttachmentMapping=$d,s.selectAssetTypeAttachments=Gd,s.selectAssetTypeById=ki,s.selectAssetTypeFieldValues=Pi,s.selectAssetTypeFieldValuesAttachmentById=Zf,s.selectAssetTypeFieldValuesAttachments=ou,s.selectAssetTypeFieldValuesAttachmentsByIds=lu,s.selectAssetTypeFieldValuesAttachmentsMapping=gi,s.selectAssetTypeFieldValuesById=_i,s.selectAssetTypeFieldValuesMapping=Tu,s.selectAssetTypeFieldValuesOfAsset=Qf,s.selectAssetTypeFields=Ct,s.selectAssetTypeFieldsAttachmentById=zf,s.selectAssetTypeFieldsAttachments=Qd,s.selectAssetTypeFieldsAttachmentsMapping=Xd,s.selectAssetTypeFieldsById=Lf,s.selectAssetTypeFieldsMapping=cu,s.selectAssetTypeFieldsOfAssetType=$f,s.selectAssetTypeIdentifierById=wi,s.selectAssetTypeIdentifierMapping=Fu,s.selectAssetTypeIdentifierValueById=qi,s.selectAssetTypeIdentifierValueMapping=vu,s.selectAssetTypeIdentifierValues=Vi,s.selectAssetTypeIdentifierValuesOfAsset=lS,s.selectAssetTypeIdentifierValuesOfIdentifier=hS,s.selectAssetTypeIdentifiers=Pu,s.selectAssetTypeIdentifiersOfAssetType=cS,s.selectAssetTypeValuesOfAssetType=xf,s.selectAssetTypes=ju,s.selectAssetTypesByIds=SS,s.selectAssetTypesMapping=Ci,s.selectAssetTypesOfOrganization=TS,s.selectAssets=bd,s.selectAssetsByIds=Fd,s.selectAssetsMapping=ei,s.selectAssetsOfAssetType=ti,s.selectAttachmentsOfAsset=Gn,s.selectAttachmentsOfAssetProcedureStepFieldValues=td,s.selectAttachmentsOfAssetProcedureStepFields=CA,s.selectAttachmentsOfAssetProcedureType=Zy,s.selectAttachmentsOfAssetProcedureTypeFieldValues=Ir,s.selectAttachmentsOfAssetProcedureTypeFields=tA,s.selectAttachmentsOfAssetType=Nd,s.selectAttachmentsOfAssetTypeFieldValues=hu,s.selectAttachmentsOfAssetTypeFields=qf,s.selectAttachmentsOfDocument=qS,s.selectAttachmentsOfFormRevision=oT,s.selectAttachmentsOfFormSubmission=Xo,s.selectAttachmentsOfIssue=Ml,s.selectAttachmentsOfIssueComment=LT,s.selectAttachmentsOfIssueType=ag,s.selectAttachmentsOfIssueTypeFieldValues=Vh,s.selectAttachmentsOfIssueTypeFields=og,s.selectAttachmentsOfProject=Hm,s.selectCategories=$u,s.selectCategoriesByIds=wS,s.selectCategoriesOfProject=MS,s.selectCategoryById=Li,s.selectCategoryMapping=Gi,s.selectCommentsOfIssue=ZT,s.selectConversation=Gy,s.selectConversationMapping=ds,s.selectConversations=$y,s.selectCurrentUser=lm,s.selectDeletedRequests=RI,s.selectDescendantsOfAssetProcedureStep=Td,s.selectDocumentAttachmentById=Xu,s.selectDocumentAttachmentMapping=Zu,s.selectDocumentById=so,s.selectDocuments=Yi,s.selectDocumentsByIds=zS,s.selectDocumentsMapping=Gt,s.selectEmailDomains=oo,s.selectEmailDomainsAsMapping=uo,s.selectEmailDomainsOfOrganization=NS,s.selectFieldValuesOfAssetProcedure=gA,s.selectFormById=Ho,s.selectFormIdentifierById=ea,s.selectFormIdentifierMapping=To,s.selectFormIdentifierValueById=ca,s.selectFormIdentifierValueMapping=Po,s.selectFormIdentifierValues=aa,s.selectFormIdentifierValuesOfFormSubmission=iT,s.selectFormIdentifierValuesOfIdentifier=aT,s.selectFormIdentifiers=go,s.selectFormIdentifiersOfForm=XS,s.selectFormMapping=Lo,s.selectFormRevisionAttachmentsMapping=Eo,s.selectFormRevisionById=pT,s.selectFormRevisionMapping=oa,s.selectFormRevisions=la,s.selectFormRevisionsOfForm=Co,s.selectFormSubmissionAttachemntsByIds=Jo,s.selectFormSubmissionAttachments=Aa,s.selectFormSubmissionAttachmentsMapping=Zo,s.selectFormSubmissionById=Ia,s.selectFormSubmissions=MT,s.selectFormSubmissionsMapping=ga,s.selectFormSubmissionsOfForm=al,s.selectForms=No,s.selectFormsOfOrganization=bT,s.selectGeoImageById=Pa,s.selectGeoImageMapping=ml,s.selectGeoImages=pl,s.selectGeoImagesOfProject=jT,s.selectIsImportingProjectFile=GI,s.selectIsLoggedIn=FS,s.selectIssueAssociationById=Tl,s.selectIssueAssociationMapping=St,s.selectIssueAssociations=DT,s.selectIssueAssociationsOfAsset=bl,s.selectIssueAssociationsOfIssue=Il,s.selectIssueAssociationsToIssue=gl,s.selectIssueAttachmentById=El,s.selectIssueAttachmentMapping=vl,s.selectIssueAttachments=wl,s.selectIssueById=Wa,s.selectIssueCommentAttachmentById=$l,s.selectIssueCommentAttachmentMapping=kl,s.selectIssueCommentAttachments=Bl,s.selectIssueCommentById=Ba,s.selectIssueCommentMapping=Hl,s.selectIssueMapping=Na,s.selectIssueTypeAttachmentById=rh,s.selectIssueTypeAttachmentMapping=ch,s.selectIssueTypeAttachments=nh,s.selectIssueTypeById=Ac,s.selectIssueTypeFieldValues=xa,s.selectIssueTypeFieldValuesAttachmentById=jg,s.selectIssueTypeFieldValuesAttachments=ic,s.selectIssueTypeFieldValuesAttachmentsByIds=jh,s.selectIssueTypeFieldValuesAttachmentsMapping=Eh,s.selectIssueTypeFieldValuesById=ec,s.selectIssueTypeFieldValuesMapping=Th,s.selectIssueTypeFieldValuesOfIssue=fg,s.selectIssueTypeFields=Kt,s.selectIssueTypeFieldsAttachmentById=lg,s.selectIssueTypeFieldsAttachments=yh,s.selectIssueTypeFieldsAttachmentsMapping=ph,s.selectIssueTypeFieldsById=Og,s.selectIssueTypeFieldsMapping=Oh,s.selectIssueTypeFieldsOfIssueType=Fg,s.selectIssueTypeIdentifierById=rc,s.selectIssueTypeIdentifierMapping=Uh,s.selectIssueTypeIdentifierValueById=hc,s.selectIssueTypeIdentifierValueMapping=Gh,s.selectIssueTypeIdentifierValues=lc,s.selectIssueTypeIdentifierValuesOfIdentifier=Hg,s.selectIssueTypeIdentifierValuesOfIssue=Ng,s.selectIssueTypeIdentifiers=Ch,s.selectIssueTypeIdentifiersOfIssueType=Cg,s.selectIssueTypeMapping=yc,s.selectIssueTypeValuesOfIssueType=_g,s.selectIssueTypes=Yh,s.selectIssueTypesByIds=Xg,s.selectIssueTypesOfOrganization=Qg,s.selectIssueUpdateMapping=sm,s.selectIssueUpdates=im,s.selectIssueUpdatesOfIssue=am,s.selectIssues=Ha,s.selectIssuesByIds=xT,s.selectIssuesOfIssueType=Xl,s.selectIssuesOfProject=eg,s.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=WA,s.selectLatestAssetProcedureTypeFieldsOfAssetProcedureType=uA,s.selectLatestAssetTypeFieldsOfAssetType=Gf,s.selectLatestFieldsByAssetProcedureStep=KA,s.selectLatestFormRevisionOfForm=yT,s.selectLatestIssueTypeFieldsOfIssueType=Pg,s.selectLatestRetryTime=vI,s.selectMembershipsByUserOfTeam=db,s.selectNumberOfAssetsOfAssetType=yf,s.selectOrganizationAccessById=bc,s.selectOrganizationAccessMapping=Ic,s.selectOrganizationAccessUserMapping=Sm,s.selectOrganizationById=OI,s.selectOrganizationDocuments=US,s.selectOrganizations=_I,s.selectOrganizationsMapping=Fm,s.selectProjectAccessById=Ec,s.selectProjectAccessMapping=Mc,s.selectProjectAccesses=Qt,s.selectProjectAccessesOfProject=zm,s.selectProjectAttachmentById=Nm,s.selectProjectAttachmentMapping=Gm,s.selectProjectById=mp,s.selectProjectDocuments=DS,s.selectProjectFileById=BI,s.selectProjectFileMapping=tp,s.selectProjectFiles=sp,s.selectProjectFolderById=$c,s.selectProjectFolderMapping=Bc,s.selectProjectFolders=np,s.selectProjectFoldersByIds=YI,s.selectProjectFoldersOfProject=ZI,s.selectProjectMapping=hp,s.selectProjects=Hc,s.selectProjectsOfOrganization=sb,s.selectRehydrated=cb,s.selectStageMapping=Ut,s.selectTeamById=en,s.selectTeamMembershipById=Fp,s.selectTeamMemberships=Jc,s.selectTeamMembershipsMapping=bp,s.selectTeams=vp,s.selectTeamsByIds=pb,s.selectTeamsMapping=xc,s.selectTeamsOfOrganization=yb,s.selectUploadUrl=yo,s.selectUserById=hm,s.selectUsers=Tc,s.selectUsersByIds=lI,s.selectUsersMapping=Jt,s.selectUsersOfOrganization=SI,s.selectUsersOfProject=VI,s.selectUsersOfTeam=ub,s.setActiveProjectFileId=xm,s.setAsset=mf,s.setAssetAttachment=Dn,s.setAssetAttachments=Ny,s.setAssetProcedure=bA,s.setAssetProcedureStep=hd,s.setAssetProcedureStepFieldValues=tf,s.setAssetProcedureStepFieldValuesAttachment=JA,s.setAssetProcedureStepFieldValuesAttachments=XA,s.setAssetProcedureStepFieldValuesMany=sf,s.setAssetProcedureStepFields=$A,s.setAssetProcedureStepFieldsAttachment=qA,s.setAssetProcedureStepFieldsAttachments=zA,s.setAssetProcedureStepFieldsMany=GA,s.setAssetProcedureSteps=rf,s.setAssetProcedureType=wA,s.setAssetProcedureTypeAttachment=Wn,s.setAssetProcedureTypeAttachments=Ky,s.setAssetProcedureTypeFieldValues=fA,s.setAssetProcedureTypeFieldValuesAttachment=hA,s.setAssetProcedureTypeFieldValuesAttachments=mA,s.setAssetProcedureTypeFieldValuesMany=SA,s.setAssetProcedureTypeFields=aA,s.setAssetProcedureTypeFieldsAttachment=Xy,s.setAssetProcedureTypeFieldsAttachments=Qy,s.setAssetProcedureTypeFieldsMany=cA,s.setAssetProcedureTypes=MA,s.setAssetProcedures=FA,s.setAssetStage=qd,s.setAssetStageCompletion=Af,s.setAssetStageCompletions=ff,s.setAssetStages=Tf,s.setAssetType=mS,s.setAssetTypeAttachment=Cd,s.setAssetTypeAttachments=Rf,s.setAssetTypeFieldValues=Jf,s.setAssetTypeFieldValuesAttachment=Hf,s.setAssetTypeFieldValuesAttachments=Wf,s.setAssetTypeFieldValuesMany=Xf,s.setAssetTypeFields=Uf,s.setAssetTypeFieldsAttachment=Mf,s.setAssetTypeFieldsAttachments=Ef,s.setAssetTypeFieldsMany=Cf,s.setAssetTypeIdentifier=tS,s.setAssetTypeIdentifierValue=rS,s.setAssetTypeIdentifierValues=dS,s.setAssetTypeIdentifiers=sS,s.setAssetTypes=pS,s.setAssets=pf,s.setCategories=OS,s.setCategory=_S,s.setClientSDK=Yp,s.setClientStore=Wp,s.setConversation=jn,s.setConversations=Uy,s.setCurrentUser=uI,s.setDocumentAttachment=Hu,s.setDocumentAttachments=jS,s.setDocuments=eo,s.setEmailDomain=kS,s.setEmailDomains=BS,s.setForm=fT,s.setFormIdentifier=KS,s.setFormIdentifierValue=xS,s.setFormIdentifierValues=eT,s.setFormIdentifiers=YS,s.setFormRevision=Do,s.setFormRevisionAttachment=nT,s.setFormRevisionAttachments=rT,s.setFormRevisions=lT,s.setFormSubmission=Ht,s.setFormSubmissionAttachment=PT,s.setFormSubmissionAttachments=_T,s.setFormSubmissions=vT,s.setForms=ST,s.setGeoImage=ft,s.setGeoImages=dl,s.setIsImportingProjectFile=Qm,s.setIssue=JT,s.setIssueAssociation=qT,s.setIssueAssociations=VT,s.setIssueAttachment=_l,s.setIssueAttachments=CT,s.setIssueComment=Ca,s.setIssueCommentAttachment=zl,s.setIssueCommentAttachments=$T,s.setIssueComments=Nl,s.setIssueType=bt,s.setIssueTypeAttachment=th,s.setIssueTypeAttachments=sg,s.setIssueTypeFieldValues=mg,s.setIssueTypeFieldValuesAttachment=vg,s.setIssueTypeFieldValuesAttachments=wg,s.setIssueTypeFieldValuesMany=pg,s.setIssueTypeFields=Tg,s.setIssueTypeFieldsAttachment=ng,s.setIssueTypeFieldsAttachments=rg,s.setIssueTypeFieldsMany=gg,s.setIssueTypeIdentifier=qg,s.setIssueTypeIdentifierValue=Bg,s.setIssueTypeIdentifierValues=$g,s.setIssueTypeIdentifiers=zg,s.setIssueTypes=Kg,s.setIssueUpdate=xg,s.setIssueUpdates=eI,s.setIssues=XT,s.setLoggedIn=zu,s.setOrganization=gI,s.setOrganizationAccess=mI,s.setOrganizationAccesses=pI,s.setOrganizations=TI,s.setProfilePicture=oI,s.setProject=XI,s.setProjectAccess=MI,s.setProjectAccesses=EI,s.setProjectAttachment=Cm,s.setProjectAttachments=km,s.setProjectFile=DI,s.setProjectFiles=UI,s.setProjectFolder=NI,s.setProjectFolders=HI,s.setProjects=JI,s.setRehydrated=ab,s.setTeam=_t,s.setTeamMembership=Yc,s.setTeamMemberships=Tp,s.setTeams=lb,s.setTokens=gS,s.setUploadUrl=po,s.setUser=aI,s.setUsers=iI,s.shallowEqual=my,s.slugify=wy,s.spacesToDashesLower=vy,s.teamMembershipReducer=Ip,s.teamMembershipSlice=Kc,s.teamReducer=wp,s.teamSlice=Xc,s.toFileNameSafeString=Ry,s.toUuidArray=Pn,s.toUuidIdRecord=Fn,s.truncate=My,s.updateAsset=ot,s.updateAssetAttachment=Hy,s.updateAssetAttachments=Un,s.updateAssetProcedure=ct,s.updateAssetProcedureStep=qt,s.updateAssetProcedureStepFieldValues=dt,s.updateAssetProcedureStepFieldValuesAttachment=QA,s.updateAssetProcedureStepFieldValuesAttachments=Qr,s.updateAssetProcedureStepFieldValuesMany=nd,s.updateAssetProcedureStepFields=rt,s.updateAssetProcedureStepFieldsAttachment=DA,s.updateAssetProcedureStepFieldsAttachments=Gr,s.updateAssetProcedureStepFieldsMany=LA,s.updateAssetProcedureSteps=df,s.updateAssetProcedureType=nt,s.updateAssetProcedureTypeAttachment=Yy,s.updateAssetProcedureTypeAttachments=Kn,s.updateAssetProcedureTypeFieldValues=at,s.updateAssetProcedureTypeFieldValuesAttachment=pA,s.updateAssetProcedureTypeFieldValuesAttachments=fr,s.updateAssetProcedureTypeFieldValuesMany=_r,s.updateAssetProcedureTypeFields=lr,s.updateAssetProcedureTypeFieldsAttachment=xy,s.updateAssetProcedureTypeFieldsAttachments=ir,s.updateAssetProcedureTypeFieldsMany=nA,s.updateAssetProcedureTypes=RA,s.updateAssetProcedures=IA,s.updateAssetStage=Dt,s.updateAssetStageCompletion=Rd,s.updateAssetStageCompletions=vd,s.updateAssetStages=If,s.updateAssetType=pt,s.updateAssetTypeAttachment=vf,s.updateAssetTypeAttachments=kd,s.updateAssetTypeFieldValues=lt,s.updateAssetTypeFieldValuesAttachment=Kf,s.updateAssetTypeFieldValuesAttachments=uu,s.updateAssetTypeFieldValuesMany=fu,s.updateAssetTypeFields=iu,s.updateAssetTypeFieldsAttachment=jf,s.updateAssetTypeFieldsAttachments=Zd,s.updateAssetTypeFieldsMany=kf,s.updateAssetTypeIdentifier=ht,s.updateAssetTypeIdentifierValue=mt,s.updateAssetTypeIdentifierValues=uS,s.updateAssetTypeIdentifiers=iS,s.updateAssetTypes=AS,s.updateAssets=hf,s.updateCategories=RS,s.updateCategory=ku,s.updateConversation=Vn,s.updateConversations=Cy,s.updateDocumentAttachment=VS,s.updateDocumentAttachments=Wu,s.updateDocuments=xe,s.updateEmailDomain=$S,s.updateEmailDomains=GS,s.updateForm=TT,s.updateFormIdentifier=yt,s.updateFormIdentifierValue=At,s.updateFormIdentifierValues=tT,s.updateFormIdentifiers=ZS,s.updateFormRevision=hT,s.updateFormRevisionAttachment=dT,s.updateFormRevisionAttachments=wo,s.updateFormRevisions=mT,s.updateFormSubmission=sl,s.updateFormSubmissionAttachment=OT,s.updateFormSubmissionAttachments=Yo,s.updateFormSubmissions=wT,s.updateForms=gT,s.updateGeoImage=ll,s.updateGeoImages=ET,s.updateIssue=Wt,s.updateIssueAssociation=Sl,s.updateIssueAssociations=zT,s.updateIssueAttachment=kT,s.updateIssueAttachments=Ol,s.updateIssueComment=WT,s.updateIssueCommentAttachment=GT,s.updateIssueCommentAttachments=Dl,s.updateIssueComments=KT,s.updateIssueType=Kh,s.updateIssueTypeAttachment=ig,s.updateIssueTypeAttachments=sh,s.updateIssueTypeFieldValues=Tt,s.updateIssueTypeFieldValuesAttachment=Mg,s.updateIssueTypeFieldValuesAttachments=Mh,s.updateIssueTypeFieldValuesMany=yg,s.updateIssueTypeFields=Ph,s.updateIssueTypeFieldsAttachment=dg,s.updateIssueTypeFieldsAttachments=hh,s.updateIssueTypeFieldsMany=Ig,s.updateIssueTypeIdentifier=gt,s.updateIssueTypeIdentifierValue=It,s.updateIssueTypeIdentifierValues=Gg,s.updateIssueTypeIdentifiers=Dg,s.updateIssueTypes=Yg,s.updateIssueUpdate=tI,s.updateIssueUpdates=sI,s.updateIssues=QT,s.updateOrganization=bm,s.updateOrganizationAccess=Xt,s.updateOrganizationAccesses=yI,s.updateOrganizations=bI,s.updateProject=op,s.updateProjectAccess=Ft,s.updateProjectAccesses=Vm,s.updateProjectAttachment=zI,s.updateProjectAttachments=Bm,s.updateProjectFile=Dc,s.updateProjectFiles=kI,s.updateProjectFolder=Pt,s.updateProjectFolders=WI,s.updateProjects=xI,s.updateTeam=Rp,s.updateTeamMembership=nb,s.updateTeamMemberships=rb,s.updateTeams=hb,s.updateUser=rI,s.updateUsers=nI,s.useSelectorBuilder=Tb,s.userReducer=om,s.userSlice=Sc,s.uuidObj=F,s.versioningReducer=Ep,s.versioningSlice=Mp,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
|
|
13
|
+
external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(m)}return await this.addCache(d),d}processPresignedUrl(e,n){if("warning"in n){if(n.warning==="already_uploaded")return Promise.resolve(void 0);throw console.error(n.warning),new Error(n.warning)}return this.enqueueRequest({url:n.url,description:"Upload file to S3",method:o.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:e,blockers:[`s3-${n.fields.key}`],blocks:[e],s3url:n})}processPresignedUrls(e){const n={};for(const[c,r]of Object.entries(e))n[c]=this.processPresignedUrl(c,r);return n}async getFilePayload(e){const c={sha1:await Dt(e),file_type:e.type,extension:Mc(e),size:e.size};return await this.client.files.addCache(e),c}}class fM extends v{constructor(){super(...arguments);h(this,"name","Form Identifier");h(this,"url","/form-identifiers");h(this,"actions",{addOne:ku,addMany:Nu,setOne:Gu,setMany:Hu,updateOne:Wu,updateMany:Ku,deleteOne:Yu,deleteMany:Zu,initialize:Lu});h(this,"selectors",{selectById:Xu,selectByIds:Qu})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=P({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[d.form],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected form identifier with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(c(r)),r}}class SM extends v{constructor(){super(...arguments);h(this,"name","Form Identifier Value");h(this,"url","/form-identifier-values");h(this,"actions",{addOne:sl,addMany:il,setOne:nl,setMany:cl,updateOne:al,updateMany:rl,deleteOne:dl,deleteMany:ul,initialize:tl});h(this,"selectors",{selectById:ol,selectByIds:hl})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=P({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[e.form_submission,e.form_identifier],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{form_submission__form_revision__form__organization:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class AM extends j{constructor(){super(...arguments);h(this,"name","Form Revision Attachment");h(this,"url","/form-revision-attachments");h(this,"actions",{addOne:fl,addMany:Sl,setOne:Al,setMany:Il,updateOne:Tl,updateMany:Pl,deleteOne:Ol,deleteMany:Fl,initialize:yl});h(this,"selectors",{selectById:_l,selectByIds:gl})}getId(e){return e.uuid}getBlockers(e){return[e.form_revision]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return P({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,form_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,form_revision:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,form_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,form_revision:r,file_sha1:a,file_name:u,file_extension:d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{form_revision__form__organization:e}},n);return this.dispatch(c(r)),r}}class IM extends v{constructor(){super(...arguments);h(this,"name","Form Revision");h(this,"url","/form-revisions");h(this,"actions",{addOne:vl,addMany:ei,setOne:El,setMany:Bl,updateOne:Vl,updateMany:zl,deleteOne:Dl,deleteMany:ti,initialize:wl});h(this,"selectors",{selectById:ql,selectByIds:Cl})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=P({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[e.form],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(c(r)),r}}class TM extends v{constructor(){super(...arguments);h(this,"name","Form");h(this,"url","/forms");h(this,"actions",{addOne:Nl,addMany:Gl,setOne:Hl,setMany:Wl,updateOne:Kl,updateMany:Yl,deleteOne:Zl,deleteMany:Jl,initialize:kl});h(this,"selectors",{selectById:xl,selectByIds:eo})}add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions,a=new Date().toISOString(),u=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),d=P({...e,submitted_at:a,created_by:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected form with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error("Expected form to exist");const u=this.select(_o(e)),d=this.select($l(e));this.dispatch(n(e)),this.dispatch(hi(E(u))),this.dispatch(ti(E(d)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(a)),this.dispatch(ei(d)),this.dispatch(oi(u)),p}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{organization:e}},n);return this.dispatch(c(r)),r}}class PM extends j{constructor(){super(...arguments);h(this,"name","Form Submission Attachment");h(this,"url","/form-submission-attachments");h(this,"actions",{addOne:io,addMany:ci,setOne:no,setMany:co,updateOne:ao,updateMany:ro,deleteOne:uo,deleteMany:ai,initialize:so});h(this,"selectors",{selectById:lo,selectByIds:oo})}getId(e){return e.uuid}getBlockers(e){return[e.form_submission]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return P({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,form_submission:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,form_submission:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,form_submission:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,form_submission:r,file_sha1:a,file_name:u,file_extension:d}}async bulkDelete(e){const{deleteMany:n,addMany:c}=this.actions,r=this.select(ui(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(a){throw this.dispatch(c(r)),a}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{form_submission__form_revision__form__organization:e}},n)).flat();return this.dispatch(c(a)),a}}class OM extends v{constructor(){super(...arguments);h(this,"name","Form Submission");h(this,"url","/form-submissions");h(this,"actions",{addOne:Ao,addMany:oi,setOne:fo,setMany:So,updateOne:Io,updateMany:To,deleteOne:Po,deleteMany:hi,initialize:yo});h(this,"selectors",{selectById:Fo,selectByIds:bo})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=P({...e,created_by:a,submitted_at:u}),p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[e.form_revision],blocks:[d.uuid]});return this.dispatch(n(d)),p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${a.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected submission with uuid ${e} to exist`);const u=this.select(ho(e));this.dispatch(n(e)),this.dispatch(ai(E(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(ci(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,form_revision__form_organization:e}},n)).flat();return this.dispatch(c(a)),a}}class FM extends j{constructor(){super(...arguments);h(this,"name","Geo Image");h(this,"url","/geo-images");h(this,"actions",{addOne:Eo,addMany:Bo,setOne:wo,setMany:vo,updateOne:Vo,updateMany:zo,deleteOne:Do,deleteMany:jo,initialize:Ro});h(this,"selectors",{selectById:Co,selectByIds:$o})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return P({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,title:e.title,description:e.description,geo_marker:e.geo_marker,canvas_marker:e.canvas_marker,direction:e.direction,original_date:e.original_date,project:e.project}}buildBulkPayload(e){return{uuid:e.uuid,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,title:e.title,description:e.description,geo_marker:e.geo_marker,canvas_marker:e.canvas_marker,direction:e.direction,original_date:e.original_date,project:e.project}}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Geo image with uuid ${e.uuid} does not exist in the store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{project:e}},n);return this.dispatch(c(r)),r}}class bM extends v{constructor(){super(...arguments);h(this,"name","Issue Association");h(this,"url","/issue-associations");h(this,"actions",{addOne:Ko,addMany:ft,setOne:Go,setMany:No,updateOne:Ho,updateMany:Wo,deleteOne:Yo,deleteMany:St,initialize:ko});h(this,"selectors",{selectById:Jo,selectByIds:Xo})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=new Date().toISOString(),u=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),d=P({...e,submitted_at:a,created_by:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[e.issue,e.asset],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}bulkAdd(e){const{addMany:n,deleteMany:c,updateMany:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=e.map(m=>P({...m,submitted_at:u,created_by:a}));this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{payloads:d.map(m=>M(m)),submitted_at:u},blockers:d.flatMap(m=>[m.issue,m.asset]),blocks:E(d)});return p.then(m=>{this.dispatch(r(m))}).catch(()=>{this.dispatch(c(E(d)))}),[d,p]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(c(a)),a}}class _M extends j{constructor(){super(...arguments);h(this,"name","Issue Attachment");h(this,"url","/issue-attachments");h(this,"actions",{addOne:ch,addMany:Ai,setOne:ah,setMany:rh,updateOne:dh,updateMany:uh,deleteOne:lh,deleteMany:Ii,initialize:nh});h(this,"selectors",{selectById:mh,selectByIds:ph})}getId(e){return e.uuid}getBlockers(e){return[e.issue]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return P({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue:e.issue}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue:e.issue}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(c(a)),a}}class gM extends j{constructor(){super(...arguments);h(this,"name","Issue Comment Attachment");h(this,"url","/issue-comment-attachments");h(this,"actions",{addOne:Ah,addMany:Ih,setOne:Th,setMany:Ph,updateOne:Oh,updateMany:Fh,deleteOne:bh,deleteMany:_h,initialize:Sh});h(this,"selectors",{selectById:Mh,selectByIds:Rh})}getId(e){return e.uuid}getBlockers(e){return[e.issue_comment]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return P({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_comment:e.issue_comment}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_comment:e.issue_comment}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{issue_comment__issue__project:e}},n)).flat();return this.dispatch(c(a)),a}}class MM extends v{constructor(){super(...arguments);h(this,"name","Issue Comment");h(this,"url","/issue-comments");h(this,"actions",{addOne:Bh,addMany:Vh,setOne:zh,setMany:Dh,updateOne:jh,updateMany:qh,deleteOne:Ch,deleteMany:$h,initialize:Eh});h(this,"selectors",{selectById:Uh,selectByIds:Lh})}add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions,a=P({...e,created_by:this.select(d=>d.userReducer.currentUser.id),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[e.issue],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{setMany:c}=this.actions,a=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(c(a)),a}}class RM extends v{constructor(){super(...arguments);h(this,"name","Issue");h(this,"url","/issues");h(this,"actions",{addOne:Hh,addMany:gi,setOne:Wh,setMany:Kh,updateOne:Yh,updateMany:Zh,deleteOne:Jh,deleteMany:Mi,initialize:Gh});h(this,"selectors",{selectById:Qh,selectByIds:xh})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=new Date().toISOString(),u=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),d=P({...e,submitted_at:a,created_by:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[d.project,d.issue_type,d.status,d.priority],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(m=>{throw this.dispatch(r(d.uuid)),m}),[d,p]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Attempting to update an issue with uuid ${e.uuid} that doesn't exist in the store`);const a={...r,...e};this.dispatch(n(a));const u={};for(const m of[$.TITLE,$.DESCRIPTION,$.STATUS,$.PRIORITY,$.ASSIGNED_TO,$.DUE_DATE])if(m in e&&e[m]!==r[m])switch(m){case $.PRIORITY:{const f=e[m],I=this.select(Ni(f));if(!I)throw new Error(`Trying to update issue type priority with ${f} which does not exist in store`);u[m]={name:I.name,color:I.color,uuid:I.uuid};break}case $.DUE_DATE:u[m]=e.due_date;break;case $.DESCRIPTION:u[m]=e.description??"";break;case $.TITLE:u[m]=e.title??"";break;case $.STATUS:{const f=e[m],I=this.select(Yi(f));if(!I)throw new Error(`Trying to update issue type status with ${f} which does not exist in store`);u[m]={name:I.name,color:I.color,uuid:I.uuid};break}case $.ASSIGNED_TO:{const f=e[m];if(f===null)u[m]=null;else{const I=this.select(Qt(f));if(!I)throw new Error(`Trying to update assigned to with ${f} which does not exist in store.`);u[m]={full_name:I.username,id:I.id}}break}}const d=P({created_by:this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),submitted_at:new Date().toISOString(),issue:r.uuid,changes:u});this.dispatch(Ji(d));const p=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return p.then(m=>{this.dispatch(n(m))}).catch(()=>{this.dispatch(n(r)),this.dispatch(Qi(d.uuid))}),[a,p]}bulkUpdate(e,n){const{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,a=E(e).toSorted(jt);if(a.length!==e.length)throw new Error("payloads contains duplicate uuids.");const u=this.select(r(a)).toSorted(hs);if(a.length!=u.length)throw new Error(`Attempting to bulk update ${a.length-u.length} issues that dont exist in the store`);const d=[];for(let I=0;I<a.length;I++)d.push({...u[I],...e[I]});this.dispatch(c(d));const p=at(e,Math.min(n??e.length,k)),m=[];let f=null;for(const I of p){const R=rt.v4(),b=E(I),g=I.map(({status:B})=>B).filter(Boolean),_=I.map(({priority:B})=>B).filter(Boolean),w=this.enqueueRequest({description:A(o.PATCH,this.name,!0),method:o.PATCH,url:`${this.url}/bulk/`,payload:{payloads:I},blockers:(f?[f]:[]).concat(b).concat(g).concat(_),blocks:[R].concat(b)});m.push(w),f=R}return Promise.all(m).then(I=>{this.dispatch(c(I.flat()))}).catch(()=>{this.dispatch(c(u))}),[d,m]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`No issue with uuid ${e} found in the store`);const u=this.select(xo(e)),d=this.select(hh(e)),p=this.select($y(e));this.dispatch(n(e)),this.dispatch(Ii(E(d))),this.dispatch(xi(E(p))),this.dispatch(St(E(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(m){throw this.dispatch(c(a)),this.dispatch(Ai(d)),this.dispatch(Xi(p)),this.dispatch(ft(u)),m}}async bulkDelete(e){const{addMany:n,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e)),u=this.select(Qo(e));this.dispatch(c(e)),this.dispatch(St(E(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(d){throw this.dispatch(n(a)),this.dispatch(ft(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(c(a)),a}}class wM extends j{constructor(){super(...arguments);h(this,"name","Issue Type Attachment");h(this,"url","/issue-type-attachments");h(this,"actions",{addOne:nm,addMany:cm,setOne:am,setMany:rm,updateOne:dm,updateMany:um,deleteOne:lm,deleteMany:om,initialize:im});h(this,"selectors",{selectById:mm,selectByIds:pm})}getId(e){return e.uuid}getBlockers(e){return[e.issue_type]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return P({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_type:e.issue_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_type:e.issue_type}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(c(r)),r}}class vM extends j{constructor(){super(...arguments);h(this,"name","Issue Type Fields Attachment");h(this,"url","/issue-type-fields-attachments");h(this,"actions",{addOne:Am,addMany:Im,setOne:Tm,setMany:Pm,updateOne:Om,updateMany:Fm,deleteOne:bm,deleteMany:_m,initialize:Sm});h(this,"selectors",{selectById:Mm,selectByIds:Rm})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return P({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{fields_revision__issue_type__organization:e}},n);return this.dispatch(c(r)),r}}class EM extends v{constructor(){super(...arguments);h(this,"name","Issue Type Fields");h(this,"url","/issue-type-fields");h(this,"actions",{addOne:Wm,addMany:Km,setOne:Ym,setMany:Zm,updateOne:Jm,updateMany:Xm,deleteOne:Qm,deleteMany:xm,initialize:Hm});h(this,"selectors",{selectById:tp,selectByIds:sp})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=P({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[d.issue_type],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(m=>{throw this.dispatch(r(d.uuid)),m}),[d,p]}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(c(r)),r}}class BM extends j{constructor(){super(...arguments);h(this,"name","Issue Type Field Values Attachment");h(this,"url","/issue-type-field-values-attachments");h(this,"actions",{addOne:ap,addMany:Di,setOne:rp,setMany:dp,updateOne:up,updateMany:lp,deleteOne:op,deleteMany:ji,initialize:cp});h(this,"selectors",{selectById:mp,selectByIds:pp})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return P({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}}async bulkDelete(e){const{deleteMany:n,addMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{field_values__issue__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class VM extends v{constructor(){super(...arguments);h(this,"name","Issue Type Field Values");h(this,"url","/issue-type-field-values");h(this,"actions",{addOne:Bm,addMany:Vm,setOne:zm,setMany:Dm,updateOne:jm,updateMany:qm,deleteOne:Cm,deleteMany:$m,initialize:Em});h(this,"selectors",{selectById:Lm,selectByIds:km})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=P({...e,created_by:a,submitted_at:u}),p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[e.issue,e.fields_revision],blocks:[d.uuid]});return this.dispatch(n(d)),p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[a.uuid,a.fields_revision,a.issue],blocks:[a.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected submission with uuid ${e} to exist`);const u=this.select(yp(e));this.dispatch(n(e)),this.dispatch(ji(E(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(Di(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class zM extends v{constructor(){super(...arguments);h(this,"name","Issue Type Identifier");h(this,"url","/issue-type-identifiers");h(this,"actions",{addOne:Ip,addMany:Tp,setOne:Pp,setMany:Op,updateOne:Fp,updateMany:bp,deleteOne:_p,deleteMany:gp,initialize:Ap});h(this,"selectors",{selectById:Rp,selectByIds:wp})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=P({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[d.issue_type],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected issue type identifier with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(c(r)),r}}class DM extends v{constructor(){super(...arguments);h(this,"name","Issue Type Identifier Value");h(this,"url","/issue-type-identifier-values");h(this,"actions",{addOne:Vp,addMany:zp,setOne:Dp,setMany:jp,updateOne:qp,updateMany:Cp,deleteOne:$p,deleteMany:Up,initialize:Bp});h(this,"selectors",{selectById:kp,selectByIds:Np})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=P({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[e.issue,e.issue_type_identifier],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class jM extends v{constructor(){super(...arguments);h(this,"name","Issue Type Priority");h(this,"url","/issue-type-priorities");h(this,"actions",{addOne:Kp,addMany:Yp,setOne:Zp,setMany:Jp,updateOne:Xp,updateMany:Qp,deleteOne:xp,deleteMany:ey,initialize:Wp});h(this,"selectors",{selectById:Ni,selectByIds:sy})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=P({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[e.issue_type],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected an existing issue type priority with uuid ${e.uuid}`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`No issue type priority with uuid ${e} found in the store`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(c(r)),r}}class qM extends v{constructor(){super(...arguments);h(this,"name","Issue Type");h(this,"url","/issue-types");h(this,"actions",{addOne:ay,addMany:ry,setOne:dy,setMany:uy,updateOne:ly,updateMany:oy,deleteOne:hy,deleteMany:my,initialize:cy});h(this,"selectors",{selectById:yy,selectByIds:fy})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=P({...e,submitted_at:u,created_by:a});this.dispatch(n(d));const p=this.enqueueRequest({method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,setOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const u=this.select(em(e));this.dispatch(n(e)),this.dispatch(Mi(E(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(gi(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{organization:e}},n);return this.dispatch(c(r)),r}}class CM extends v{constructor(){super(...arguments);h(this,"name","Issue Type Status");h(this,"url","/issue-type-statuses");h(this,"actions",{addOne:Ty,addMany:Py,setOne:Oy,setMany:Fy,updateOne:by,updateMany:_y,deleteOne:gy,deleteMany:My,initialize:Iy});h(this,"selectors",{selectById:Yi,selectByIds:wy})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=P({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[e.issue_type],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected an existing issue type status with uuid ${e.uuid}`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`No issue type status with uuid ${e} found in the store`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(c(r)),r}}class $M extends v{constructor(){super(...arguments);h(this,"name","Issue Update");h(this,"url","/issue-updates");h(this,"actions",{addOne:Ji,addMany:Xi,setOne:Vy,setMany:zy,updateOne:Dy,updateMany:jy,deleteOne:Qi,deleteMany:xi,initialize:By});h(this,"selectors",{selectById:qy,selectByIds:Cy})}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(c(a)),a}}const UM=1800;function LM(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 kM extends Xg{constructor(){super(...arguments);h(this,"_getRenewedTokens",async e=>{const n=this.performRequest({method:o.POST,url:this.refreshTokensUrl,payload:{refresh:e},isAuthNeeded:!1,checkAuth:!1});let c;try{c=await n}catch(r){console.error("Could not renew tokens; clearing auth",r),this.clearAuth();return}if(!c.access)throw new Error("Missing access token");return{accessToken:c.access,refreshToken:c.refresh??this.getRefreshToken()}})}clearAuth(){console.debug(this.constructor.name,"clearing auth;"),this.dispatch(Kd(!1)),this.clearTokens(),this.dispatch(T()),this.dispatch(T())}async renewTokens(){const e=this.getRefreshToken();if(!e)throw new Error("No refresh token found");console.debug(this.constructor.name,"renewing tokens");try{const n=await this._getRenewedTokens(e);if(!n)return;console.debug("Got renewed tokens"),this.setTokens(n)}catch(n){throw console.error("Could not renew tokens; clearing auth",n),this.clearAuth(),n}}tokenIsExpiringSoon(){const e=this.getAccessToken();if(!e)return!1;const n=Date.now()/1e3;let c;try{c=mb(e).exp??n}catch{c=n}return c-n<UM}getAuthHeader(){return`Bearer ${this.getAccessToken()}`}async prepareAuth(){if(this.tokenIsExpiringSoon()){console.debug(this.constructor.name,"preparing auth");try{await this.renewTokens()}catch(e){return e instanceof U&&this.clearAuth(),e instanceof Error?Promise.reject(e):Promise.reject(new Error((e??Pt).toString()))}}}async handleUnauthorized(e,n){if(e.url.endsWith("/token/refresh/"))throw this.select(c=>c.authReducer.isLoggedIn)&&console.warn("No signed-in user to sign out."),this.clearAuth(),new U({message:"You have been signed out due to inactivity.",response:n,discard:!0});if(this.select(c=>c.authReducer.isLoggedIn))await this.renewTokens();else throw console.debug("Forbidden; user is not logged in."),new U({message:"Incorrect username or password.",response:n,discard:!0})}async initAuth(e){const n=rt.v4();return console.debug(this.constructor.name,"Initiating auth"),this.performRequest({uuid:n,method:o.POST,url:this.initTokensUrl,payload:e,isAuthNeeded:!1,checkAuth:!1}).then(c=>{this.setTokens(LM(c))})}}class NM extends ht{constructor(){super(...arguments);h(this,"name","Organization Access");h(this,"url","/organization-accesses");h(this,"actions",{addOne:ef,addMany:tf,setOne:sf,setMany:nf,updateOne:cf,updateMany:af,deleteOne:rf,deleteMany:df,initialize:xy});h(this,"selectors",{selectById:lf,selectByIds:of})}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid)),a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(d=>{throw this.dispatch(n(r)),d}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e)),u=this.select(Qt(a.user));this.dispatch(n(a.uuid)),this.dispatch(cn(a.user));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${a.uuid}/`,blockers:[a.uuid],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(nn(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{organization:e}},n);return this.dispatch(c(r)),r}}class GM extends ht{constructor(){super(...arguments);h(this,"name","Organization");h(this,"url","/organizations");h(this,"actions",{addOne:Af,addMany:Sf,setOne:ff,setMany:yf,updateOne:Tf,updateMany:If,deleteOne:Pf,deleteMany:Of,initialize:pf});h(this,"selectors",{selectById:_f,selectByIds:gf})}async add(e){const{addOne:n}=this.actions,c=await this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:e,blockers:[],blocks:[]});return this.dispatch(n(c)),c}async update(e){const{setOne:n}=this.actions,c=await this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return this.dispatch(n(c)),c}async invite(e,n){return this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/${e}/invite/${n}/`,blockers:[],blocks:[]})}async refreshStore(e){const{initialize:n}=this.actions,c=await this.list({},e);return this.dispatch(n(c)),c}}class HM extends v{constructor(){super(...arguments);h(this,"name","Project Access");h(this,"url","/project-accesses");h(this,"actions",{addOne:jf,addMany:qf,setOne:Cf,setMany:$f,updateOne:Uf,updateMany:Lf,deleteOne:kf,deleteMany:Nf,initialize:Df});h(this,"selectors",{selectById:Hf,selectByIds:Wf})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=P({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null})});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[a.organization_access,a.project],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(d=>{throw this.dispatch(r(a.uuid)),d}),[a,u]}bulkAdd(e){const{addMany:n,deleteMany:c,updateMany:r}=this.actions,a=this.select(p=>{var m;return((m=p.userReducer.currentUser)==null?void 0:m.id)??null}),u=e.map(p=>P({...p,created_by:a}));this.dispatch(n(u));const d=this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{project_accesses:u.map(p=>M(p))},blockers:u.flatMap(p=>[p.project,p.organization_access]),blocks:u.map(p=>p.uuid)});return d.then(p=>{this.dispatch(r(p))}).catch(p=>{throw this.dispatch(c(u.map(m=>m.uuid))),p}),[u,d]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid)),a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return u.then(d=>{this.dispatch(n(d))}).catch(d=>{throw this.dispatch(n(r)),d}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(c(r)),r}}class WM extends j{constructor(){super(...arguments);h(this,"name","Project Attachment");h(this,"url","/project-attachments");h(this,"actions",{addOne:Zf,addMany:Jf,setOne:Xf,setMany:Qf,updateOne:xf,updateMany:eS,deleteOne:tS,deleteMany:sS,initialize:Yf});h(this,"selectors",{selectById:nS,selectByIds:cS})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return P({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,project:e.project}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,project:e.project}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(c(r)),r}}class KM extends v{constructor(){super(...arguments);h(this,"name","Project Comment");h(this,"url","/project-comments");h(this,"actions",{addOne:uS,addMany:lS,setOne:oS,setMany:hS,updateOne:mS,updateMany:pS,deleteOne:yS,deleteMany:fS,initialize:dS});h(this,"selectors",{selectById:AS,selectByIds:IS})}add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions,a=P({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[a.project],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Project comment with uuid ${e.uuid} not found in store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Project comment with uuid ${e} not found in store`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(c(a)),a}}class YM extends j{constructor(){super(...arguments);h(this,"name","Project File");h(this,"url","/project-files");h(this,"actions",{addOne:_S,addMany:gS,setOne:FS,setMany:bS,updateOne:MS,updateMany:RS,deleteOne:wS,deleteMany:vS,initialize:OS});h(this,"selectors",{selectById:VS,selectByIds:zS})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return P({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,project:e.project,z_index:e.z_index,canvas_bounds:e.canvas_bounds,bounds:e.bounds}}buildBulkPayload(e){return{uuid:e.uuid,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,project:e.project,z_index:e.z_index,canvas_bounds:e.canvas_bounds,bounds:e.bounds}}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`${this.name} with uuid ${e.uuid} does not exist in the store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(c(a)),a}}class ZM extends ht{constructor(){super(...arguments);h(this,"name","Project");h(this,"url","/projects");h(this,"actions",{addOne:LS,addMany:US,setOne:$S,setMany:CS,updateOne:NS,updateMany:kS,deleteOne:GS,deleteMany:HS,initialize:qS});h(this,"selectors",{selectById:YS,selectByIds:ZS})}async add(e){const{addOne:n}=this.actions,c=await this.performRequest({method:o.POST,url:`${this.url}/`,payload:M(e)});return this.dispatch(n(c)),c}async update(e){const{updateOne:n}=this.actions,c=await this.performRequest({method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:M(e)});return this.dispatch(n(c)),c}async delete(e){const{deleteOne:n}=this.actions,c=await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]});return this.dispatch(n(e)),c}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{organization:e}},n);return this.dispatch(c(r)),r}}class JM extends v{constructor(){super(...arguments);h(this,"name","Procedure");h(this,"url","/procedures");h(this,"actions",{addOne:hA,addMany:It,setOne:mA,setMany:pA,updateOne:yA,updateMany:fA,deleteOne:SA,deleteMany:Tt,initialize:oA});h(this,"selectors",{selectById:TA,selectByIds:PA})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=P({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[a.procedure_type,a.project,a.asset,...a.procedure_initiative?[a.procedure_initiative]:[]],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}bulkAdd(e,n){var b;const{store:c}=this.client,{addMany:r,updateMany:a,deleteMany:u}=this.actions,d=new Date().toISOString(),p=((b=c.getState().userReducer.currentUser)==null?void 0:b.id)??null,m=[],f=at(e,Math.min(n??e.length,k)),I=[];for(const g of f){const _=[],w=[],B=[];for(const D of g){const z=P({...D,submitted_at:d,created_by:p});m.push(z),_.push(M(z)),w.push(z.procedure_type,z.project,z.asset,...z.procedure_initiative?[z.procedure_initiative]:[]),B.push(z.uuid)}const C={payload:{submitted_at:d,payloads:_},blockers:w,blocks:B};I.push(C)}this.dispatch(r(m));const R=I.map(g=>{const{payload:_,blocks:w,blockers:B}=g;return this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:_,blockers:B,blocks:w})});return Promise.all(R).then(g=>{this.dispatch(a(g.flat()))}).catch(()=>{this.dispatch(u(E(m)))}),[m,Promise.all(R).then(g=>g.flat())]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected procedure with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected procedure with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async bulkDelete(e){const{addMany:n,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e));this.dispatch(c(E(a)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(n(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(c(a)),a}}class XM extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Assignee");h(this,"url","/procedure-step-assignees");h(this,"actions",{addOne:RA,addMany:wA,setOne:vA,setMany:EA,updateOne:BA,updateMany:VA,deleteOne:zA,deleteMany:DA,initialize:MA});h(this,"selectors",{selectById:qA,selectByIds:CA})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=P({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[a.procedure,a.procedure_step],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}bulkAdd(e){const{addMany:n,setMany:c,deleteMany:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=e.map(m=>P({...m,created_by:a,submitted_at:u}));this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{procedure_step_assignees:d.map(m=>M(m)),submitted_at:u},blockers:d.flatMap(m=>[m.procedure,m.procedure_step]),blocks:E(d)});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(E(d)))}),[d,p]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected procedure step assignee with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async bulkDelete(e){const{deleteMany:n,addMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(c(a)),a}}class QM extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Comment");h(this,"url","/procedure-step-comments");h(this,"actions",{addOne:kA,addMany:NA,setOne:GA,setMany:HA,updateOne:WA,updateMany:KA,deleteOne:YA,deleteMany:ZA,initialize:LA});h(this,"selectors",{selectById:XA,selectByIds:QA})}add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions,a=P({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[a.procedure,a.procedure_step],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Procedure step comment with uuid ${e.uuid} not found in store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Procedure step comment with uuid ${e} not found in store`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(c(a)),a}}class xM extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Default Assignee");h(this,"url","/procedure-step-default-assignees");h(this,"actions",{addOne:sI,addMany:iI,setOne:nI,setMany:cI,updateOne:aI,updateMany:rI,deleteOne:dI,deleteMany:uI,initialize:tI});h(this,"selectors",{selectById:oI,selectByIds:hI})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=P({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[a.procedure_step],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected procedure step default assignee with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class eR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Default Reviewer");h(this,"url","/procedure-step-default-reviewers");h(this,"actions",{addOne:fI,addMany:SI,setOne:AI,setMany:II,updateOne:TI,updateMany:PI,deleteOne:OI,deleteMany:FI,initialize:yI});h(this,"selectors",{selectById:_I,selectByIds:gI})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=P({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[a.procedure_step],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected procedure step default reviewer with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class tR extends ht{constructor(){super(...arguments);h(this,"name","Procedure Step Event");h(this,"url","/procedure-step-events");h(this,"actions",{addOne:vI,addMany:EI,setOne:BI,setMany:VI,updateOne:zI,updateMany:DI,deleteOne:jI,deleteMany:qI,initialize:wI});h(this,"selectors",{selectById:$I,selectByIds:UI})}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(c(a)),a}}class sR extends j{constructor(){super(...arguments);h(this,"name","Procedure Step Fields Attachment");h(this,"url","/procedure-step-fields-attachments");h(this,"actions",{addOne:GI,addMany:Mn,setOne:HI,setMany:WI,updateOne:KI,updateMany:YI,deleteOne:ZI,deleteMany:Rn,initialize:NI});h(this,"selectors",{selectById:QI,selectByIds:xI})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){return P({...e,created_by:this.select(n=>{var c;return((c=n.userReducer.currentUser)==null?void 0:c.id)??null}),submitted_at:new Date().toISOString()})}buildPayload(e){const{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{fields_revision__procedure_step__procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class iR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Fields");h(this,"url","/procedure-step-fields");h(this,"actions",{addOne:iT,addMany:nT,setOne:cT,setMany:aT,updateOne:rT,updateMany:dT,deleteOne:uT,deleteMany:lT,initialize:sT});h(this,"selectors",{selectById:oT,selectByIds:hT})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=P({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[a.procedure_step],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected procedure step fields with uuid ${e} to exist`);const u=this.select(XI(e));this.dispatch(n(e)),this.dispatch(Rn(E(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(Mn(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class nR extends j{constructor(){super(...arguments);h(this,"name","Procedure Step Field Values Attachment");h(this,"url","/procedure-step-field-values-attachments");h(this,"actions",{addOne:fT,addMany:Vn,setOne:ST,setMany:AT,updateOne:IT,updateMany:TT,deleteOne:PT,deleteMany:zn,initialize:yT});h(this,"selectors",{selectById:FT,selectByIds:bT})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return P({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}}async bulkDelete(e){const{deleteMany:n,addMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{field_values__procedure__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class cR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Field Values Review");h(this,"url","/procedure-step-field-values-reviews");h(this,"actions",{addOne:NT,addMany:Cn,setOne:GT,setMany:HT,updateOne:WT,updateMany:KT,deleteOne:YT,deleteMany:$n,initialize:kT});h(this,"selectors",{selectById:JT,selectByIds:XT})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=P({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[a.field_values],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Procedure step field values review with uuid ${e.uuid} not found in store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Procedure step field values review with uuid ${e} not found in store`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{field_values__procedure__project:e}},n)).flat();return this.dispatch(c(a)),a}}class aR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Field Values");h(this,"url","/procedure-step-field-values");h(this,"actions",{addOne:wT,addMany:vT,setOne:ET,setMany:BT,updateOne:VT,updateMany:zT,deleteOne:DT,deleteMany:jT,initialize:RT});h(this,"selectors",{selectById:$T,selectByIds:UT})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=P({...e,created_by:a,submitted_at:u}),p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[e.procedure,e.procedure_step,e.fields_revision],blocks:[d.uuid]});return this.dispatch(n(d)),p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}bulkAdd(e,n){const{addMany:c,updateMany:r,deleteMany:a}=this.actions,u=new Date().toISOString(),d=this.select(R=>{var b;return((b=R.userReducer.currentUser)==null?void 0:b.id)??null}),p=[],m=at(e,Math.min(n??e.length,k)),f=[];for(const R of m){const b=[],g=[],_=[];for(const w of R){const B=P({...w,values:w.values,created_by:d,submitted_at:u});p.push(B),b.push(M(B)),g.push(B.procedure_step,B.procedure,B.fields_revision),_.push(B.uuid)}f.push({payload:{payloads:b,submitted_at:u},blockers:g,blocks:_})}this.dispatch(c(p));const I=f.map(R=>{const{payload:b,blocks:g,blockers:_}=R;return this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:b,blockers:_,blocks:g})});return Promise.all(I).then(R=>{this.dispatch(r(R.flat()))}).catch(()=>{this.dispatch(a(E(p)))}),[p,Promise.all(I).then(R=>R.flat())]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected ProcedureStepFieldValues with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[a.uuid,a.procedure,a.procedure_step,a.fields_revision],blocks:[a.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected ProcedureStepFieldValues with uuid ${e} to exist`);const u=this.select(_T(e)),d=this.select(QT(e));this.dispatch(n(e)),this.dispatch(zn(E(u))),this.dispatch($n(E(d)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(a)),this.dispatch(Vn(u)),this.dispatch(Cn(d)),p}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(c(a)),a}}class rR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Reviewer");h(this,"url","/procedure-step-reviewers");h(this,"actions",{addOne:sP,addMany:iP,setOne:nP,setMany:cP,updateOne:aP,updateMany:rP,deleteOne:dP,deleteMany:uP,initialize:tP});h(this,"selectors",{selectById:oP,selectByIds:hP})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=P({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[a.procedure,a.procedure_step],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}bulkAdd(e){const{addMany:n,setMany:c,deleteMany:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=e.map(m=>P({...m,created_by:a,submitted_at:u}));this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{procedure_step_reviewers:d.map(m=>M(m)),submitted_at:u},blockers:d.flatMap(m=>[m.procedure,m.procedure_step]),blocks:d.map(m=>m.uuid)});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.map(m=>m.uuid)))}),[d,p]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected procedure step reviewer with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async bulkDelete(e){const{deleteMany:n,addMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(c(a)),a}}class dR extends v{constructor(){super(...arguments);h(this,"name","Procedure Initiative");h(this,"url","/procedure-initiatives");h(this,"actions",{addOne:QS,addMany:xS,setOne:eA,setMany:tA,updateOne:sA,updateMany:iA,deleteOne:nA,deleteMany:cA,initialize:XS});h(this,"selectors",{selectById:dA,selectByIds:uA})}add(e){var p;const{store:n}=this.client,{addOne:c,setOne:r,deleteOne:a}=this.actions,u=P({...e,created_by:((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,submitted_at:new Date().toISOString()});this.dispatch(c(u));const d=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(u),blockers:[u.procedure_type,u.project],blocks:[u.uuid]});return d.then(m=>{this.dispatch(r(m))}).catch(()=>{this.dispatch(a(u.uuid))}),[u,d]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected ${this.name} with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected ${this.name} with uuid ${e} to exist`);const u=this.select(_A(e));this.dispatch(n(e)),this.dispatch(Tt(E(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(It(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(c(a)),a}}class uR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step");h(this,"url","/procedure-steps");h(this,"actions",{addOne:AP,addMany:IP,setOne:fP,setMany:SP,updateOne:TP,updateMany:PP,deleteOne:OP,deleteMany:FP,initialize:yP});h(this,"selectors",{selectById:_P,selectByIds:gP})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=P({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[a.procedure_type],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`No procedure step with uuid ${e.uuid} found in the store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${r.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{addOne:n,deleteOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`No procedure step with uuid ${e} found in the store`);this.dispatch(c(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(n(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class lR extends j{constructor(){super(...arguments);h(this,"name","Procedure Type Attachment");h(this,"url","/procedure-type-attachments");h(this,"actions",{addOne:wP,addMany:vP,setOne:EP,setMany:BP,updateOne:VP,updateMany:zP,deleteOne:DP,deleteMany:jP,initialize:RP});h(this,"selectors",{selectById:$P,selectByIds:UP})}getId(e){return e.uuid}getBlockers(e){return[e.procedure_type]}getBlocks(e){return[e.uuid]}buildModel(e){const{procedure_type:n,file_sha1:c,file_extension:r,file_name:a,file_type:u,file_url:d}=e,p=this.select(f=>{var I;return((I=f.userReducer.currentUser)==null?void 0:I.id)??null}),m=new Date().toISOString();return P({file_url:d,file_sha1:c,file_extension:r,file_name:a,file_type:u,created_by:p,submitted_at:m,procedure_type:n})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,procedure_type:e.procedure_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,procedure_type:e.procedure_type}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class oR extends j{constructor(){super(...arguments);h(this,"name","Procedure Type Fields Attachment");h(this,"url","/procedure-type-fields-attachments");h(this,"actions",{addOne:NP,addMany:GP,setOne:HP,setMany:WP,updateOne:KP,updateMany:YP,deleteOne:ZP,deleteMany:JP,initialize:kP});h(this,"selectors",{selectById:xP,selectByIds:eO})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return P({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{fields_revision__procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class hR extends v{constructor(){super(...arguments);h(this,"name","Procedure Type Fields");h(this,"url","/procedure-type-fields");h(this,"actions",{addOne:iO,addMany:nO,setOne:cO,setMany:aO,updateOne:rO,updateMany:dO,deleteOne:uO,deleteMany:lO,initialize:sO});h(this,"selectors",{selectById:mO,selectByIds:pO})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=P({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[d.procedure_type],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(m=>{throw this.dispatch(r(d.uuid)),m}),[d,p]}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class mR extends j{constructor(){super(...arguments);h(this,"name","Procedure Field Values Attachment");h(this,"url","/procedure-field-values-attachments");h(this,"actions",{addOne:SO,addMany:Jn,setOne:AO,setMany:IO,updateOne:TO,updateMany:PO,deleteOne:OO,deleteMany:Xn,initialize:fO});h(this,"selectors",{selectById:_O,selectByIds:gO})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return P({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}}async bulkDelete(e){const{deleteMany:n,addMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{field_values__procedure__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class pR extends v{constructor(){super(...arguments);h(this,"name","Procedure Field Values");h(this,"url","/procedure-field-values");h(this,"actions",{addOne:vO,addMany:EO,setOne:BO,setMany:VO,updateOne:zO,updateMany:DO,deleteOne:jO,deleteMany:qO,initialize:wO});h(this,"selectors",{selectById:UO,selectByIds:LO})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var f;return((f=m.userReducer.currentUser)==null?void 0:f.id)??null}),u=new Date().toISOString(),d=P({...e,created_by:a,submitted_at:u}),p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(d),blockers:[e.fields_revision,e.procedure],blocks:[d.uuid]});return this.dispatch(n(d)),p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}bulkAdd(e,n){const{addMany:c,updateMany:r,deleteMany:a}=this.actions,u=new Date().toISOString(),d=this.select(R=>{var b;return((b=R.userReducer.currentUser)==null?void 0:b.id)??null}),p=[],m=at(e,Math.min(n??e.length,k)),f=[];for(const R of m){const b=[],g=[],_=[];for(const w of R){const B=P({...w,values:w.values,created_by:d,submitted_at:u});p.push(B),b.push(M(B)),g.push(B.procedure,B.fields_revision),_.push(B.uuid)}f.push({payload:{payloads:b,submitted_at:u},blockers:g,blocks:_})}this.dispatch(c(p));const I=f.map(R=>{const{payload:b,blocks:g,blockers:_}=R;return this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:b,blockers:_,blocks:g})});return Promise.all(I).then(R=>{this.dispatch(r(R.flat()))}).catch(()=>{this.dispatch(a(E(p)))}),[p,Promise.all(I).then(R=>R.flat())]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected ProcedureFieldValues with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[a.fields_revision,a.procedure],blocks:[a.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected submission with uuid ${e} to exist`);const u=this.select(MO(e));this.dispatch(n(e)),this.dispatch(Xn(E(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(Jn(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{procedure__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class yR extends v{constructor(){super(...arguments);h(this,"name","Procedure Type");h(this,"url","/procedure-types");h(this,"actions",{addOne:GO,addMany:HO,setOne:WO,setMany:KO,updateOne:YO,updateMany:ZO,deleteOne:JO,deleteMany:XO,initialize:NO});h(this,"selectors",{selectById:eF,selectByIds:tF})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=P({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected procedure type with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected procedure type with uuid ${e} to exist`);const u=this.select(OA(e));this.dispatch(n(e)),this.dispatch(Tt(E(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(It(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{organization:e}},n);return this.dispatch(c(r)),r}}class fR extends v{constructor(){super(...arguments);h(this,"name","Team Membership");h(this,"url","/team-memberships");h(this,"actions",{addOne:cF,addMany:aF,setOne:rF,setMany:dF,updateOne:uF,updateMany:lF,deleteOne:oF,deleteMany:hF,initialize:nF});h(this,"selectors",{selectById:yF,selectByIds:fF})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=P({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null})});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[e.team],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}bulkAdd(e){const{addMany:n,setMany:c,deleteMany:r}=this.actions,a=this.select(p=>{var m;return((m=p.userReducer.currentUser)==null?void 0:m.id)??null}),u=e.map(p=>P({...p,created_by:a}));this.dispatch(n(u));const d=this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{team_memberships:u.map(p=>M(p))},blockers:u.map(p=>p.team),blocks:u.map(p=>p.uuid)});return d.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(u.map(p=>p.uuid)))}),[u,d]}async delete(e){const{deleteOne:n,setOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{team__organization:e}},n);return this.dispatch(c(r)),r}}class SR extends v{constructor(){super(...arguments);h(this,"name","Team");h(this,"url","/teams");h(this,"actions",{addOne:IF,addMany:TF,setOne:PF,setMany:OF,updateOne:FF,updateMany:bF,deleteOne:_F,deleteMany:gF,initialize:AF});h(this,"selectors",{selectById:RF,selectByIds:wF})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=P({...e,submitted_at:new Date().toISOString(),created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null})});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:M(a),blockers:[],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:M(e),blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,setOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{organization:e}},n);return this.dispatch(c(r)),r}}class AR extends ht{constructor(){super(...arguments);h(this,"name","User");h(this,"url","/user");h(this,"actions",{addOne:nn,addMany:Hy,setOne:Gy,setMany:Ny,updateOne:Ky,updateMany:Wy,deleteOne:cn,deleteMany:Yy,initialize:ky});h(this,"selectors",{selectById:Qt,selectByIds:Xy})}async list(e,n){const{organizationUuid:c,...r}=e,a=c?`/organizations/${c}${this.url}s/`:`/${this.url}`;return this.performRequest({method:o.GET,url:a,...r},n)}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({organizationUuid:e},n);return this.dispatch(c(r)),r}}async function lc(t,s,e,n,c){const r=n instanceof ot;r&&s.checkAuth!==!1&&await n.auth.prepareAuth();const a={queryParams:"",isAuthNeeded:!0},{s3url:u,payload:d,headers:p,method:m,queryParams:f,attachmentHash:I,isExternalUrl:R,isAuthNeeded:b,isResponseBlob:g}={...a,...s};let _=s.url;const w=I?await e.files.fetchCache(I):void 0;if(I&&!w)throw new Error(`Cannot upload file ${I} because it's not cached.`);!R&&!_.startsWith("http")&&(!_.startsWith("/")&&!_.startsWith("blob:")&&(_="/"+_),_=t+_);const B=q=>{if(I){if(!u)throw new Error(`No S3 URL for file ${I}`);if("warning"in u)throw new Error(`S3 URL warning for file ${I}`);if(!w)throw new Error(`No file for file ${I}`);const N=u.fields["x-amz-checksum-sha1"];if(!N)throw new Error(`No checksum for file ${I}`);return q.set("x-amz-checksum-sha1",N).field({...d,...u.fields}).attach("file",w)}return q.send(d)},D={[o.GET]:()=>g?pt.get(_.toString()).responseType("blob"):pt.get(_.toString()),[o.POST]:()=>{const q=pt.post(_.toString());return B(q)},[o.PATCH]:()=>{const q=pt.patch(_.toString());return B(q)},[o.PUT]:()=>{const q=pt.put(_.toString());return B(q)},[o.DELETE]:()=>{const q=pt.delete(_.toString());return B(q)}}[m];let z=D();const bt=()=>{console.debug("aborting request:",s.url),z.abort()};if(c==null||c.addEventListener("abort",bt),b&&r){const q=n.auth.getAuthHeader();z=z.set("Authorization",q)}p&&(z=z.set(p));try{return await z.query(f)}catch(q){const N=KF(q),as=N==null?void 0:N.status;if(r&&as===401)return await n.auth.handleUnauthorized(z,N),z.query(f);throw new U({response:N,innerError:q,discard:dc.includes(as)})}finally{c==null||c.removeEventListener("abort",bt)}}class IR{constructor(s){h(this,"store");this.store=s}_performRequest(s,e,n,c){const r=new rs,a={...e,uuid:e.uuid??rt.v4()};return lc(s,a,this,n,c).then(u=>{r.resolve(u.body)}).catch(u=>{u instanceof Error?r.reject(u):r.reject(new Error((u??Pt).toString()))}),r}async performRequest(s,e,n,c){return this._performRequest(s,e,n,c).then(r=>{if(r instanceof U)throw r;return r})}async enqueueRequest(s,e,n){return this._enqueueRequest(s,e,n).then(c=>{if(c instanceof U)throw c;return c})}_enqueueRequest(s,e,n){const c=new rs,r={...s,BASE_URL:e,serviceName:n},a=this.store.dispatch(vf(r)),u=p=>{if(p)c.resolve(p.body);else{const m=new U({message:"Could not get a response from the server.",response:p,discard:!0});c.reject(m)}},d=p=>{p instanceof U?p.options.discard=!0:(console.error("Received an unexpected error while processing a request:",p,`
|
|
14
|
+
Converting error to APIError and discarding.`),p=new U({message:"An error occurred while processing the request.",innerError:p,discard:!0})),c.reject(p)};return a.then(u,d),c}async performPagination(s,e,n,c,r){const a={...e,queryParams:{...e.queryParams,paginate:!0,limit:n}},{method:u}=a,d=[];let p=await this.performRequest(s,a,c,r);for(d.push(p.results);p.next;)p=await this.performRequest(s,{url:p.next,method:u},c,r),d.push(p.results);return d}}class Ot{constructor(){h(this,"graph");h(this,"requestAttemptCounter");this.graph=new pb.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(s){const e=new Ot;for(let n=0;n<s.length;n++){const c=s[n];if(!c){console.error("Outbox item was undefined");continue}e.sneakRequest(c);for(let r=0;r<n;r++){const a=s[r];if(!a){console.error("Previous outbox item was undefined");continue}a.payload.uuid!==c.payload.uuid&&a.payload.blocks.some(u=>c.payload.blockers.includes(u))&&Ot._addDependency(c.payload.uuid,a.payload.uuid,e.graph)}}return e}_addDependency(s,e){Ot._addDependency(s,e,this.graph)}static _addDependency(s,e,n){if(s===e)throw new Error(`Tried to add dependency from node to itself: ${s}`);if(!n.hasNode(s))throw new Error(`Tried to add dependency from non-existent node: ${s} (to node: ${e})`);if(!n.hasNode(e))throw new Error(`Tried to add dependency to non-existent node: ${e} (from node: ${s})`);n.addDependency(s,e)}addRequest(s){if(this.graph.addNode(s.payload.uuid,s),!(s.payload.blockers.length===0||this.graph.size()===1))for(const e of this.graph.overallOrder()){if(e===s.payload.uuid)continue;const n=this.graph.getNodeData(e),c=new Set(n.payload.blocks);s.payload.blockers.some(r=>c.has(r))&&this._addDependency(s.payload.uuid,e)}}insertRequest(s){this.graph.addNode(s.payload.uuid,s);for(const e of this.graph.overallOrder()){if(e===s.payload.uuid)continue;const n=this.graph.getNodeData(e),c=new Set(s.payload.blocks);n.payload.blockers.some(r=>c.has(r))&&this._addDependency(e,s.payload.uuid)}}sneakRequest(s){this.graph.addNode(s.payload.uuid,s)}_getNextNode(){const s=this.graph.overallOrder(!0);let e=1/0,n;for(const c of s){const r=this.requestAttemptCounter[c]||0;r<e&&(e=r,n=c)}return n}peek(){const s=this._getNextNode();if(s)return this.graph.getNodeData(s)}remove(s){this.graph.removeNode(s),delete this.requestAttemptCounter[s]}pop(){const s=this.peek();return s&&this.graph.removeNode(s.payload.uuid),s}getQueue(){const s=this.graph.overallOrder().map(n=>this.graph.getNodeData(n)),e=this._getNextNode();if(e){const n=this.graph.getNodeData(e),c=s.findIndex(r=>r.payload.uuid===n.payload.uuid);c!==-1&&(s.splice(c,1),s.unshift(n))}return s}getReady(){let s=this.graph.overallOrder(!0).map(e=>this.graph.getNodeData(e));return s=s.sort((e,n)=>e.meta.offline.effect.timestamp.localeCompare(n.meta.offline.effect.timestamp)),s=s.sort((e,n)=>{const c=this.requestAttemptCounter[e.payload.uuid]||0,r=this.requestAttemptCounter[n.payload.uuid]||0;return c-r}),s}registerRetry(s){this.requestAttemptCounter[s]=(this.requestAttemptCounter[s]||0)+1}}let YF;function ZF(t){YF=t}function Ft(){return YF}let JF;function XF(t){JF=t}function QF(){return JF}let oc=null;function mt(){const t=Ft();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(oc)return oc;const s=t.getState().offline.outbox,e=Ot._fromOutbox(s);return oc=e,e}const TR=(t,s)=>{const e=new s(t);return XF(e),ZF(t),e};class PR{constructor(s){h(this,"_all");h(this,"_previous");this._all=[s],this._previous=s,this.then=this.then.bind(this),this.compile=this.compile.bind(this)}then(s){return this._previous&&(this._previous.next=s),this._all.push(s),this._previous=s,{then:this.then,compile:this.compile}}compile(){return this._all}}class hc{constructor(){h(this,"next");this.next=null}then(s){return new PR(this).then(s)}async run(s){if(this.next)return this.next.run(s);{if(console.debug("Middleware finished. Performing request:",s.payload.url),!Ft())throw new Error("Client store not set");const n=QF();if(!n)throw new Error("Client SDK not set");return GF(s,n)}}}class xF extends hc{async run(s){return super.run(s)}}class eb extends hc{async run(s){return super.run(s)}}const tb=new xF().then(new eb).compile();function sb(t){var s;return(s=tb[0])==null?void 0:s.run(t)}var ib=(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))(ib||{});i.ALL_MIDDLEWARE=tb,i.APIError=U,i.AgentService=Qg,i.AssetAttachmentService=xg,i.AssetCommentService=eM,i.AssetService=tM,i.AssetStatusType=Tc,i.AssetTypeAttachmentService=sM,i.AssetTypeFieldValuesAttachmentService=cM,i.AssetTypeFieldValuesService=aM,i.AssetTypeFieldsAttachmentService=iM,i.AssetTypeFieldsService=nM,i.AssetTypeIdentifierService=rM,i.AssetTypeIdentifierValueService=dM,i.AssetTypeService=uM,i.AssetTypeStatusService=lM,i.AttachmentModel=Pc,i.BaseApiService=ot,i.BaseModelApiService=ht,i.BaseOfflineFileModelApiService=j,i.BaseOfflineModelApiService=v,i.BaseSDK=IR,i.COMMON_AUTO_FIELDS=Bc,i.DEFAULT_PAGE_SIZE=zF,i.DISCARD_HTTP_STATUSES=dc,i.DeferredPromise=rs,i.DocumentAttachmentService=oM,i.DocumentService=hM,i.EMPTY_ARRAY=fc,i.EMPTY_OBJECT=Sc,i.EmailDomainsService=mM,i.EmailVerificationService=pM,i.FILE_MODEL_DEFAULT_PAGE_SIZE=DF,i.FileService=yM,i.FormIdentifierService=fM,i.FormIdentifierValueService=SM,i.FormRevisionAttachmentService=AM,i.FormRevisionService=IM,i.FormService=TM,i.FormSubmissionAttachmentService=PM,i.FormSubmissionService=OM,i.GeoImageService=FM,i.HttpMethod=o,i.IssueAssociationService=bM,i.IssueAttachmentService=_M,i.IssueCommentAttachmentService=gM,i.IssueCommentService=MM,i.IssuePriorityType=Fc,i.IssueService=RM,i.IssueStatusType=Oc,i.IssueTypeAttachmentService=wM,i.IssueTypeFieldValuesAttachmentService=BM,i.IssueTypeFieldValuesService=VM,i.IssueTypeFieldsAttachmentService=vM,i.IssueTypeFieldsService=EM,i.IssueTypeIdentifierService=zM,i.IssueTypeIdentifierValueService=DM,i.IssueTypePriorityService=jM,i.IssueTypeService=qM,i.IssueTypeStatusService=CM,i.IssueUpdateChange=$,i.IssueUpdateService=$M,i.JWTService=kM,i.MAX_SERVICE_BATCH_SIZE=k,i.OUTBOX_RETRY_DELAY=Ac,i.OfflineAnalyticsMiddleware=xF,i.OfflineMiddleware=hc,i.OrganizationAccessLevel=Ic,i.OrganizationAccessService=NM,i.OrganizationService=GM,i.OutboxCoordinator=Ot,i.ProcdureInitiativeService=dR,i.ProcedureFieldValuesAttachmentService=mR,i.ProcedureFieldValuesService=pR,i.ProcedureService=JM,i.ProcedureStepAssigneeService=XM,i.ProcedureStepCommentService=QM,i.ProcedureStepDefaultAssigneeService=xM,i.ProcedureStepDefaultReviewerService=eR,i.ProcedureStepEventService=tR,i.ProcedureStepEventType=bc,i.ProcedureStepFieldValuesAttachmentService=nR,i.ProcedureStepFieldValuesReviewService=cR,i.ProcedureStepFieldValuesReviewType=_c,i.ProcedureStepFieldValuesService=aR,i.ProcedureStepFieldsAttachmentService=sR,i.ProcedureStepFieldsService=iR,i.ProcedureStepReviewerService=rR,i.ProcedureStepService=uR,i.ProcedureTypeAttachmentService=lR,i.ProcedureTypeFieldsAttachmentService=oR,i.ProcedureTypeFieldsService=hR,i.ProcedureTypeService=yR,i.ProjectAccessService=HM,i.ProjectAttachmentService=WM,i.ProjectCommentService=KM,i.ProjectFileService=YM,i.ProjectService=ZM,i.RESET_ORGANIZATION_STATE=F,i.RESET_PROJECT_STATE=V,i.RESET_STATE=T,i.RateLimitingMiddleware=eb,i.SelectorBuilder=jb,i.TeamMembershipService=fR,i.TeamService=SR,i.UNKNOWN_ERROR_MESSAGE=Pt,i.UserService=AR,i.VERSION_REDUCER_KEY=gt,i.VerificationCodeType=ib,i._setLatestRetryTime=Bf,i.addAsset=Ia,i.addAssetAttachment=Wc,i.addAssetAttachments=fs,i.addAssetComment=ca,i.addAssetComments=qt,i.addAssetType=Od,i.addAssetTypeAttachment=Ba,i.addAssetTypeAttachments=bs,i.addAssetTypeFieldValues=Br,i.addAssetTypeFieldValuesAttachment=Ir,i.addAssetTypeFieldValuesAttachments=Es,i.addAssetTypeFieldValuesMany=Vr,i.addAssetTypeFields=cr,i.addAssetTypeFieldsAttachment=Ha,i.addAssetTypeFieldsAttachments=Wa,i.addAssetTypeFieldsMany=ar,i.addAssetTypeIdentifier=Wr,i.addAssetTypeIdentifierValue=ad,i.addAssetTypeIdentifierValues=rd,i.addAssetTypeIdentifiers=Kr,i.addAssetTypeStatus=zd,i.addAssetTypeStatuses=Dd,i.addAssetTypes=Fd,i.addAssets=Ps,i.addConversation=Uc,i.addConversations=qb,i.addDocument=ou,i.addDocumentAttachment=Xd,i.addDocumentAttachments=Qd,i.addDocuments=hu,i.addEmailDomain=_u,i.addEmailDomains=gu,i.addForm=Nl,i.addFormIdentifier=ku,i.addFormIdentifierValue=sl,i.addFormIdentifierValues=il,i.addFormIdentifiers=Nu,i.addFormRevision=vl,i.addFormRevisionAttachment=fl,i.addFormRevisionAttachments=Sl,i.addFormRevisions=ei,i.addFormSubmission=Ao,i.addFormSubmissionAttachment=io,i.addFormSubmissionAttachments=ci,i.addFormSubmissions=oi,i.addForms=Gl,i.addGeoImage=Eo,i.addGeoImages=Bo,i.addIssue=Hh,i.addIssueAssociation=Ko,i.addIssueAssociations=ft,i.addIssueAttachment=ch,i.addIssueAttachments=Ai,i.addIssueComment=Bh,i.addIssueCommentAttachment=Ah,i.addIssueCommentAttachments=Ih,i.addIssueComments=Vh,i.addIssueType=ay,i.addIssueTypeAttachment=nm,i.addIssueTypeAttachments=cm,i.addIssueTypeFieldValues=Bm,i.addIssueTypeFieldValuesAttachment=ap,i.addIssueTypeFieldValuesAttachments=Di,i.addIssueTypeFieldValuesMany=Vm,i.addIssueTypeFields=Wm,i.addIssueTypeFieldsAttachment=Am,i.addIssueTypeFieldsAttachments=Im,i.addIssueTypeFieldsMany=Km,i.addIssueTypeIdentifier=Ip,i.addIssueTypeIdentifierValue=Vp,i.addIssueTypeIdentifierValues=zp,i.addIssueTypeIdentifiers=Tp,i.addIssueTypePriorities=Yp,i.addIssueTypePriority=Kp,i.addIssueTypeStatus=Ty,i.addIssueTypeStatuses=Py,i.addIssueTypes=ry,i.addIssueUpdate=Ji,i.addIssueUpdates=Xi,i.addIssues=gi,i.addOrganization=Af,i.addOrganizationAccess=ef,i.addOrganizationAccesses=tf,i.addOrganizations=Sf,i.addProcedure=hA,i.addProcedureFieldValues=vO,i.addProcedureFieldValuesAttachment=SO,i.addProcedureFieldValuesAttachments=Jn,i.addProcedureFieldValuesMany=EO,i.addProcedureInitiative=QS,i.addProcedureInitiatives=xS,i.addProcedureStep=AP,i.addProcedureStepAssignee=RA,i.addProcedureStepAssignees=wA,i.addProcedureStepComment=kA,i.addProcedureStepComments=NA,i.addProcedureStepDefaultAssignee=sI,i.addProcedureStepDefaultAssignees=iI,i.addProcedureStepDefaultReviewer=fI,i.addProcedureStepDefaultReviewers=SI,i.addProcedureStepEvent=vI,i.addProcedureStepEvents=EI,i.addProcedureStepFieldValues=wT,i.addProcedureStepFieldValuesAttachment=fT,i.addProcedureStepFieldValuesAttachments=Vn,i.addProcedureStepFieldValuesMany=vT,i.addProcedureStepFieldValuesReview=NT,i.addProcedureStepFieldValuesReviews=Cn,i.addProcedureStepFields=iT,i.addProcedureStepFieldsAttachment=GI,i.addProcedureStepFieldsAttachments=Mn,i.addProcedureStepFieldsMany=nT,i.addProcedureStepReviewer=sP,i.addProcedureStepReviewers=iP,i.addProcedureSteps=IP,i.addProcedureType=GO,i.addProcedureTypeAttachment=wP,i.addProcedureTypeAttachments=vP,i.addProcedureTypeFields=iO,i.addProcedureTypeFieldsAttachment=NP,i.addProcedureTypeFieldsAttachments=GP,i.addProcedureTypeFieldsMany=nO,i.addProcedureTypes=HO,i.addProcedures=It,i.addProject=LS,i.addProjectAccess=jf,i.addProjectAccesses=qf,i.addProjectAttachment=Zf,i.addProjectAttachments=Jf,i.addProjectComment=uS,i.addProjectComments=lS,i.addProjectFile=_S,i.addProjectFiles=gS,i.addProjects=US,i.addTeam=IF,i.addTeamMembership=cF,i.addTeamMemberships=aF,i.addTeams=TF,i.addUser=nn,i.addUsers=Hy,i.agentsReducer=Nc,i.agentsSlice=ms,i.areArraysEqual=Ab,i.assetAttachmentReducer=sa,i.assetAttachmentSlice=ys,i.assetCommentReducer=fa,i.assetCommentSlice=Is,i.assetReducer=wa,i.assetSlice=Ts,i.assetTypeAttachmentReducer=ka,i.assetTypeAttachmentSlice=Fs,i.assetTypeFieldValuesAttachmentReducer=wr,i.assetTypeFieldValuesAttachmentSlice=vs,i.assetTypeFieldValuesReducer=Nr,i.assetTypeFieldValuesSlice=zs,i.assetTypeFieldsAttachmentReducer=sr,i.assetTypeFieldsAttachmentSlice=Ms,i.assetTypeFieldsReducer=fr,i.assetTypeFieldsSlice=ws,i.assetTypeIdentifierReducer=id,i.assetTypeIdentifierSlice=Ds,i.assetTypeIdentifierValueReducer=Sd,i.assetTypeIdentifierValueSlice=qs,i.assetTypeReducer=Ed,i.assetTypeSlice=Cs,i.assetTypeStatusReducer=Hd,i.assetTypeStatusSlice=Us,i.assetTypeStatusSortFn=Vc,i.authReducer=Yd,i.authSlice=Nt,i.baseReducer=qg,i.baseReducers=rc,i.clearTokens=s_,i.createModelAdapter=O,i.createOfflineAction=Rf,i.createPayload=M,i.createSelectionAdapter=yb,i.deleteAsset=Oa,i.deleteAssetAttachment=Xc,i.deleteAssetAttachments=Ss,i.deleteAssetComment=la,i.deleteAssetComments=Ct,i.deleteAssetType=gd,i.deleteAssetTypeAttachment=qa,i.deleteAssetTypeAttachments=_s,i.deleteAssetTypeFieldValues=Cr,i.deleteAssetTypeFieldValuesAttachment=br,i.deleteAssetTypeFieldValuesAttachments=Bs,i.deleteAssetTypeFieldValuesMany=$r,i.deleteAssetTypeFields=or,i.deleteAssetTypeFieldsAttachment=Xa,i.deleteAssetTypeFieldsAttachments=Qa,i.deleteAssetTypeFieldsMany=hr,i.deleteAssetTypeIdentifier=Qr,i.deleteAssetTypeIdentifierValue=hd,i.deleteAssetTypeIdentifierValues=md,i.deleteAssetTypeIdentifiers=xr,i.deleteAssetTypeStatus=Ud,i.deleteAssetTypeStatuses=Ld,i.deleteAssetTypes=Md,i.deleteAssets=Os,i.deleteConversation=Ub,i.deleteConversations=Lb,i.deleteDocument=Su,i.deleteDocumentAttachment=iu,i.deleteDocumentAttachments=nu,i.deleteDocuments=Au,i.deleteEmailDomain=Eu,i.deleteEmailDomains=Bu,i.deleteForm=Zl,i.deleteFormIdentifier=Yu,i.deleteFormIdentifierValue=dl,i.deleteFormIdentifierValues=ul,i.deleteFormIdentifiers=Zu,i.deleteFormRevision=Dl,i.deleteFormRevisionAttachment=Ol,i.deleteFormRevisionAttachments=Fl,i.deleteFormRevisions=ti,i.deleteFormSubmission=Po,i.deleteFormSubmissionAttachment=uo,i.deleteFormSubmissionAttachments=ai,i.deleteFormSubmissions=hi,i.deleteForms=Jl,i.deleteGeoImage=Do,i.deleteGeoImages=jo,i.deleteIssue=Jh,i.deleteIssueAssociation=Yo,i.deleteIssueAssociations=St,i.deleteIssueAttachment=lh,i.deleteIssueAttachments=Ii,i.deleteIssueComment=Ch,i.deleteIssueCommentAttachment=bh,i.deleteIssueCommentAttachments=_h,i.deleteIssueComments=$h,i.deleteIssueType=hy,i.deleteIssueTypeAttachment=lm,i.deleteIssueTypeAttachments=om,i.deleteIssueTypeFieldValues=Cm,i.deleteIssueTypeFieldValuesAttachment=op,i.deleteIssueTypeFieldValuesAttachments=ji,i.deleteIssueTypeFieldValuesMany=$m,i.deleteIssueTypeFields=Qm,i.deleteIssueTypeFieldsAttachment=bm,i.deleteIssueTypeFieldsAttachments=_m,i.deleteIssueTypeFieldsMany=xm,i.deleteIssueTypeIdentifier=_p,i.deleteIssueTypeIdentifierValue=$p,i.deleteIssueTypeIdentifierValues=Up,i.deleteIssueTypeIdentifiers=gp,i.deleteIssueTypePriorities=ey,i.deleteIssueTypePriority=xp,i.deleteIssueTypeStatus=gy,i.deleteIssueTypeStatuses=My,i.deleteIssueTypes=my,i.deleteIssueUpdate=Qi,i.deleteIssueUpdates=xi,i.deleteIssues=Mi,i.deleteOrganization=Pf,i.deleteOrganizationAccess=rf,i.deleteOrganizationAccesses=df,i.deleteOrganizations=Of,i.deleteProcedure=SA,i.deleteProcedureFieldValues=jO,i.deleteProcedureFieldValuesAttachment=OO,i.deleteProcedureFieldValuesAttachments=Xn,i.deleteProcedureFieldValuesMany=qO,i.deleteProcedureInitiative=nA,i.deleteProcedureInitiatives=cA,i.deleteProcedureStep=OP,i.deleteProcedureStepAssignee=zA,i.deleteProcedureStepAssignees=DA,i.deleteProcedureStepComment=YA,i.deleteProcedureStepComments=ZA,i.deleteProcedureStepDefaultAssignee=dI,i.deleteProcedureStepDefaultAssignees=uI,i.deleteProcedureStepDefaultReviewer=OI,i.deleteProcedureStepDefaultReviewers=FI,i.deleteProcedureStepEvent=jI,i.deleteProcedureStepEvents=qI,i.deleteProcedureStepFieldValues=DT,i.deleteProcedureStepFieldValuesAttachment=PT,i.deleteProcedureStepFieldValuesAttachments=zn,i.deleteProcedureStepFieldValuesMany=jT,i.deleteProcedureStepFieldValuesReview=YT,i.deleteProcedureStepFieldValuesReviews=$n,i.deleteProcedureStepFields=uT,i.deleteProcedureStepFieldsAttachment=ZI,i.deleteProcedureStepFieldsAttachments=Rn,i.deleteProcedureStepFieldsMany=lT,i.deleteProcedureStepReviewer=dP,i.deleteProcedureStepReviewers=uP,i.deleteProcedureSteps=FP,i.deleteProcedureType=JO,i.deleteProcedureTypeAttachment=DP,i.deleteProcedureTypeAttachments=jP,i.deleteProcedureTypeFields=uO,i.deleteProcedureTypeFieldsAttachment=ZP,i.deleteProcedureTypeFieldsAttachments=JP,i.deleteProcedureTypeFieldsMany=lO,i.deleteProcedureTypes=XO,i.deleteProcedures=Tt,i.deleteProject=GS,i.deleteProjectAccess=kf,i.deleteProjectAccesses=Nf,i.deleteProjectAttachment=tS,i.deleteProjectAttachments=sS,i.deleteProjectComment=yS,i.deleteProjectComments=fS,i.deleteProjectFile=wS,i.deleteProjectFiles=vS,i.deleteProjects=HS,i.deleteTeam=_F,i.deleteTeamMembership=oF,i.deleteTeamMemberships=hF,i.deleteTeams=gF,i.deleteUser=cn,i.deleteUsers=Yy,i.dequeue=NF,i.discard=HF,i.documentAttachmentReducer=du,i.documentAttachmentSlice=ks,i.documentSlice=Gs,i.documentsReducer=Iu,i.downloadFile=gb,i.emailDomainsReducer=ju,i.emailDomainsSlice=Ws,i.emailRegex=zb,i.enqueue=kF,i.enqueueRequest=vf,i.extractResponseFromError=KF,i.fallbackToEmptyArray=S,i.fallbackToEmptyObject=ls,i.fetchBlobFromObjectUrl=Rc,i.fetchFileFromObjectUrl=wc,i.fileReducer=$u,i.fileSlice=Ys,i.formIdentifierReducer=xu,i.formIdentifierSlice=Zs,i.formIdentifierValueReducer=ml,i.formIdentifierValueSlice=Xs,i.formReducer=Xl,i.formRevisionAttachmentReducer=Ml,i.formRevisionAttachmentSlice=Qs,i.formRevisionReducer=Ul,i.formRevisionsSlice=xs,i.formSlice=si,i.formSubmissionAttachmentReducer=mo,i.formSubmissionAttachmentSlice=ni,i.formSubmissionReducer=go,i.formSubmissionSlice=li,i.geoImageReducer=Uo,i.geoImageSlice=pi,i.getClientSDK=QF,i.getClientStore=Ft,i.getDocumentSubTree=qc,i.getDocumentTrees=Db,i.getFileExtension=Mc,i.getLocalDateString=gc,i.getLocalRelativeDateString=Ob,i.getOutboxCoordinator=mt,i.getRenamedFile=_b,i.getRequestDescription=A,i.getS3FileKey=bb,i.hashFile=Dt,i.initSDK=TR,i.initializeAssetAttachments=Hc,i.initializeAssetComments=na,i.initializeAssetTypeAttachments=Ea,i.initializeAssetTypeFieldValues=Er,i.initializeAssetTypeFieldValuesAttachments=Ar,i.initializeAssetTypeFields=nr,i.initializeAssetTypeFieldsAttachments=Ga,i.initializeAssetTypeIdentifierValues=cd,i.initializeAssetTypeIdentifiers=Hr,i.initializeAssetTypeStatuses=Vd,i.initializeAssetTypes=Id,i.initializeAssets=Aa,i.initializeConversations=$c,i.initializeDocumentAttachments=Jd,i.initializeDocuments=lu,i.initializeEmailDomains=bu,i.initializeFormIdentifierValues=tl,i.initializeFormIdentifiers=Lu,i.initializeFormRevisionAttachments=yl,i.initializeFormRevisions=wl,i.initializeFormSubmissionAttachments=so,i.initializeFormSubmissions=yo,i.initializeForms=kl,i.initializeGeoImages=Ro,i.initializeIssueAssociations=ko,i.initializeIssueAttachments=nh,i.initializeIssueCommentAttachments=Sh,i.initializeIssueComments=Eh,i.initializeIssueTypeAttachments=im,i.initializeIssueTypeFieldValues=Em,i.initializeIssueTypeFieldValuesAttachments=cp,i.initializeIssueTypeFields=Hm,i.initializeIssueTypeFieldsAttachments=Sm,i.initializeIssueTypeIdentifierValues=Bp,i.initializeIssueTypeIdentifiers=Ap,i.initializeIssueTypePriorities=Wp,i.initializeIssueTypeStatuses=Iy,i.initializeIssueTypes=cy,i.initializeIssueUpdates=By,i.initializeIssues=Gh,i.initializeOrganizationAccesses=xy,i.initializeOrganizations=pf,i.initializeProcedureFieldValues=wO,i.initializeProcedureFieldValuesAttachments=fO,i.initializeProcedureInitiatives=XS,i.initializeProcedureStepAssignees=MA,i.initializeProcedureStepComments=LA,i.initializeProcedureStepDefaultAssignees=tI,i.initializeProcedureStepDefaultReviewers=yI,i.initializeProcedureStepEvents=wI,i.initializeProcedureStepFieldValues=RT,i.initializeProcedureStepFieldValuesAttachments=yT,i.initializeProcedureStepFieldValuesReviews=kT,i.initializeProcedureStepFields=sT,i.initializeProcedureStepFieldsAttachments=NI,i.initializeProcedureStepReviewers=tP,i.initializeProcedureSteps=yP,i.initializeProcedureTypeAttachments=RP,i.initializeProcedureTypeFields=sO,i.initializeProcedureTypeFieldsAttachments=kP,i.initializeProcedureTypes=NO,i.initializeProcedures=oA,i.initializeProjectAccesses=Df,i.initializeProjectAttachments=Yf,i.initializeProjectComments=dS,i.initializeProjectFiles=OS,i.initializeProjects=qS,i.initializeTeamMemberships=nF,i.initializeTeams=AF,i.initializeUsers=ky,i.isImageFile=Mb,i.isObjectUrl=vc,i.isToday=Pb,i.issueAssociationReducer=sh,i.issueAssociationSlice=fi,i.issueAttachmentReducer=yh,i.issueAttachmentSlice=Si,i.issueCommentAttachmentReducer=wh,i.issueCommentAttachmentSlice=Pi,i.issueCommentReducer=kh,i.issueCommentSlice=Fi,i.issueReducer=tm,i.issueSlice=_i,i.issueTypeAttachmentReducer=ym,i.issueTypeAttachmentSlice=Ri,i.issueTypeFieldValuesAttachmentReducer=fp,i.issueTypeFieldValuesAttachmentSlice=zi,i.issueTypeFieldValuesReducer=Nm,i.issueTypeFieldValuesSlice=Bi,i.issueTypeFieldsAttachmentReducer=wm,i.issueTypeFieldsAttachmentSlice=vi,i.issueTypeFieldsReducer=ip,i.issueTypeFieldsSlice=Vi,i.issueTypeIdentifierReducer=vp,i.issueTypeIdentifierSlice=Ci,i.issueTypeIdentifierValueReducer=Gp,i.issueTypeIdentifierValueSlice=Ui,i.issueTypePriorityReducer=iy,i.issueTypePrioritySlice=Li,i.issueTypePrioritySortFn=Dc,i.issueTypeReducer=Sy,i.issueTypeSlice=Gi,i.issueTypeStatusReducer=vy,i.issueTypeStatusSlice=Wi,i.issueTypeStatusSortFn=zc,i.issueUpdateReducer=Uy,i.issueUpdateSlice=Zi,i.logOnlyOnce=Rb,i.markAsDeleted=Ef,i.markForDeletion=U_,i.memoize=us,i.organizationAccessReducer=uf,i.organizationAccessSlice=rn,i.organizationReducer=Mf,i.organizationSlice=dn,i.outboxReducer=Vf,i.outboxSlice=un,i.overmapEnhancer=Wg,i.overmapReducer=Cg,i.overmapReducers=VF,i.performRequest=lc,i.performRequestFromAction=GF,i.procedureFieldValuesAttachmentReducer=FO,i.procedureFieldValuesAttachmentSlice=Zn,i.procedureFieldValuesReducer=CO,i.procedureFieldValuesSlice=xn,i.procedureInitiativeReducer=aA,i.procedureInitiativeSlice=Sn,i.procedureReducer=AA,i.procedureSlice=An,i.procedureStepAssigneeReducer=$A,i.procedureStepAssigneeSlice=In,i.procedureStepCommentReducer=xA,i.procedureStepCommentSlice=Tn,i.procedureStepDefaultAssigneeReducer=mI,i.procedureStepDefaultAssigneeSlice=Pn,i.procedureStepDefaultReviewerReducer=MI,i.procedureStepDefaultReviewerSlice=Fn,i.procedureStepEventReducer=LI,i.procedureStepEventSlice=_n,i.procedureStepFieldValuesAttachmentReducer=gT,i.procedureStepFieldValuesAttachmentSlice=Bn,i.procedureStepFieldValuesReducer=qT,i.procedureStepFieldValuesReviewReducer=xT,i.procedureStepFieldValuesReviewSlice=qn,i.procedureStepFieldValuesSlice=jn,i.procedureStepFieldsAttachmentReducer=eT,i.procedureStepFieldsAttachmentSlice=gn,i.procedureStepFieldsReducer=mT,i.procedureStepFieldsSlice=vn,i.procedureStepReducer=bP,i.procedureStepReviewerReducer=mP,i.procedureStepReviewerSlice=Un,i.procedureStepSlice=Ln,i.procedureTypeAttachmentReducer=qP,i.procedureTypeAttachmentSlice=Gn,i.procedureTypeFieldsAttachmentReducer=XP,i.procedureTypeFieldsAttachmentSlice=Wn,i.procedureTypeFieldsReducer=oO,i.procedureTypeFieldsSlice=Yn,i.procedureTypeReducer=QO,i.procedureTypeSlice=tc,i.projectAccessReducer=Gf,i.projectAccessSlice=ln,i.projectAttachmentReducer=aS,i.projectAttachmentSlice=hn,i.projectCommentReducer=TS,i.projectCommentSlice=pn,i.projectFileReducer=DS,i.projectFileSlice=yn,i.projectReducer=WS,i.projectSlice=fn,i.rehydratedReducer=sF,i.rehydratedSlice=ic,i.restructureSelectorWithArgs=y,i.runMiddleware=sb,i.selectAccessToken=i_,i.selectAccessesByUserOfProject=k_,i.selectAccessibleProjects=K_,i.selectActiveOrganizationAccess=j_,i.selectAllDocumentAttachments=Ns,i.selectAssetAttachmentById=xc,i.selectAssetAttachmentMapping=Qc,i.selectAssetAttachments=As,i.selectAssetAttachmentsByIds=ea,i.selectAssetById=Ma,i.selectAssetCommentById=ha,i.selectAssetCommentMapping=oa,i.selectAssetComments=$t,i.selectAssetCommentsByIds=ma,i.selectAssetTypeAttachmentById=$a,i.selectAssetTypeAttachmentMapping=Ca,i.selectAssetTypeAttachments=gs,i.selectAssetTypeAttachmentsByIds=Ua,i.selectAssetTypeById=wd,i.selectAssetTypeFieldValues=Lt,i.selectAssetTypeFieldValuesAttachmentById=gr,i.selectAssetTypeFieldValuesAttachments=Vs,i.selectAssetTypeFieldValuesAttachmentsByIds=Mr,i.selectAssetTypeFieldValuesAttachmentsMapping=_r,i.selectAssetTypeFieldValuesById=Lr,i.selectAssetTypeFieldValuesByIds=kr,i.selectAssetTypeFieldValuesMapping=Ur,i.selectAssetTypeFieldValuesOfAsset=Yb,i.selectAssetTypeFields=Mt,i.selectAssetTypeFieldsAttachmentById=er,i.selectAssetTypeFieldsAttachments=Rs,i.selectAssetTypeFieldsAttachmentsByIds=tr,i.selectAssetTypeFieldsAttachmentsMapping=xa,i.selectAssetTypeFieldsById=pr,i.selectAssetTypeFieldsByIds=yr,i.selectAssetTypeFieldsMapping=mr,i.selectAssetTypeFieldsOfAssetType=Wb,i.selectAssetTypeIdentifierById=td,i.selectAssetTypeIdentifierMapping=ed,i.selectAssetTypeIdentifierValueById=yd,i.selectAssetTypeIdentifierValueMapping=pd,i.selectAssetTypeIdentifierValues=kt,i.selectAssetTypeIdentifierValuesByIds=fd,i.selectAssetTypeIdentifierValuesOfAsset=Xb,i.selectAssetTypeIdentifierValuesOfIdentifier=Qb,i.selectAssetTypeIdentifiers=js,i.selectAssetTypeIdentifiersByIds=sd,i.selectAssetTypeIdentifiersOfAssetType=Jb,i.selectAssetTypeStatusById=Nd,i.selectAssetTypeStatusMapping=kd,i.selectAssetTypeStatuses=Ls,i.selectAssetTypeStatusesByIds=Gd,i.selectAssetTypeStatusesOfAssetType=e_,i.selectAssetTypeValuesOfAssetType=Zb,i.selectAssetTypes=$s,i.selectAssetTypesByIds=vd,i.selectAssetTypesMapping=Rd,i.selectAssetTypesOfOrganization=xb,i.selectAssets=Ut,i.selectAssetsByIds=Ra,i.selectAssetsMapping=_a,i.selectAssetsOfAssetType=ga,i.selectAssetsOfProject=Gb,i.selectAttachmentsOfAsset=ta,i.selectAttachmentsOfAssetType=La,i.selectAttachmentsOfAssetTypeFieldValues=Rr,i.selectAttachmentsOfAssetTypeFields=Hb,i.selectAttachmentsOfDocument=c_,i.selectAttachmentsOfFormRevision=y_,i.selectAttachmentsOfFormSubmission=ho,i.selectAttachmentsOfIssue=hh,i.selectAttachmentsOfIssueComment=I_,i.selectAttachmentsOfIssueType=O_,i.selectAttachmentsOfIssueTypeFieldValues=yp,i.selectAttachmentsOfIssueTypeFields=F_,i.selectAttachmentsOfProcedureFieldValues=MO,i.selectAttachmentsOfProcedureStepFieldValues=_T,i.selectAttachmentsOfProcedureStepFields=XI,i.selectAttachmentsOfProcedureType=bg,i.selectAttachmentsOfProcedureTypeFields=_g,i.selectAttachmentsOfProject=G_,i.selectCommentsOfAsset=pa,i.selectCommentsOfAssets=ya,i.selectCommentsOfIssue=T_,i.selectCommentsOfProject=H_,i.selectCommentsOfProjects=W_,i.selectConversation=Nb,i.selectConversationMapping=ps,i.selectConversations=kb,i.selectCurrentUser=Jy,i.selectDeletedRequests=C_,i.selectDescendantsOfDocument=Ou,i.selectDocumentAttachmentById=au,i.selectDocumentAttachmentMapping=cu,i.selectDocumentAttachmentsByIds=ru,i.selectDocumentById=Tu,i.selectDocuments=Gt,i.selectDocumentsByIds=Pu,i.selectDocumentsMapping=Hs,i.selectEmailDomainById=zu,i.selectEmailDomains=Ks,i.selectEmailDomainsAsMapping=Vu,i.selectEmailDomainsByIds=Du,i.selectEmailDomainsOfOrganization=d_,i.selectFieldValuesOfProcedure=Rg,i.selectFormById=xl,i.selectFormIdentifierById=Xu,i.selectFormIdentifierMapping=Ju,i.selectFormIdentifierValueById=ol,i.selectFormIdentifierValueMapping=ll,i.selectFormIdentifierValues=Ht,i.selectFormIdentifierValuesByIds=hl,i.selectFormIdentifierValuesOfFormSubmission=m_,i.selectFormIdentifierValuesOfIdentifier=p_,i.selectFormIdentifiers=Js,i.selectFormIdentifiersByIds=Qu,i.selectFormIdentifiersOfForm=h_,i.selectFormMapping=Ql,i.selectFormRevisionAttachmentById=_l,i.selectFormRevisionAttachments=bl,i.selectFormRevisionAttachmentsByIds=gl,i.selectFormRevisionAttachmentsMapping=Wt,i.selectFormRevisionById=ql,i.selectFormRevisionMapping=jl,i.selectFormRevisions=Kt,i.selectFormRevisionsByIds=Cl,i.selectFormRevisionsOfForm=$l,i.selectFormSubmissionAttachemntsByIds=ui,i.selectFormSubmissionAttachmentById=lo,i.selectFormSubmissionAttachments=di,i.selectFormSubmissionAttachmentsByIds=oo,i.selectFormSubmissionAttachmentsMapping=ri,i.selectFormSubmissionById=Fo,i.selectFormSubmissions=mi,i.selectFormSubmissionsByIds=bo,i.selectFormSubmissionsMapping=Oo,i.selectFormSubmissionsOfForm=_o,i.selectForms=ii,i.selectFormsByIds=eo,i.selectFormsOfOrganization=S_,i.selectGeoImageById=Co,i.selectGeoImageMapping=qo,i.selectGeoImages=yi,i.selectGeoImagesByIds=$o,i.selectGeoImagesOfProject=A_,i.selectIsLoggedIn=n_,i.selectIssueAssociationById=Jo,i.selectIssueAssociationMapping=Zo,i.selectIssueAssociations=At,i.selectIssueAssociationsByIds=Xo,i.selectIssueAssociationsOfAsset=eh,i.selectIssueAssociationsOfAssets=th,i.selectIssueAssociationsOfIssue=xo,i.selectIssueAssociationsOfIssues=Qo,i.selectIssueAttachmentById=mh,i.selectIssueAttachmentMapping=oh,i.selectIssueAttachments=Ti,i.selectIssueAttachmentsByIds=ph,i.selectIssueById=Qh,i.selectIssueCommentAttachmentById=Mh,i.selectIssueCommentAttachmentMapping=gh,i.selectIssueCommentAttachments=Oi,i.selectIssueCommentAttachmentsByIds=Rh,i.selectIssueCommentById=Uh,i.selectIssueCommentMapping=bi,i.selectIssueCommentsByIds=Lh,i.selectIssueMapping=Xh,i.selectIssueTypeAttachmentById=mm,i.selectIssueTypeAttachmentMapping=hm,i.selectIssueTypeAttachments=wi,i.selectIssueTypeAttachmentsByIds=pm,i.selectIssueTypeById=yy,i.selectIssueTypeFieldValues=Zt,i.selectIssueTypeFieldValuesAttachmentById=mp,i.selectIssueTypeFieldValuesAttachments=qi,i.selectIssueTypeFieldValuesAttachmentsByIds=pp,i.selectIssueTypeFieldValuesAttachmentsMapping=hp,i.selectIssueTypeFieldValuesById=Lm,i.selectIssueTypeFieldValuesByIds=km,i.selectIssueTypeFieldValuesMapping=Um,i.selectIssueTypeFieldValuesOfIssue=b_,i.selectIssueTypeFields=Rt,i.selectIssueTypeFieldsAttachmentById=Mm,i.selectIssueTypeFieldsAttachments=Ei,i.selectIssueTypeFieldsAttachmentsByIds=Rm,i.selectIssueTypeFieldsAttachmentsMapping=gm,i.selectIssueTypeFieldsById=tp,i.selectIssueTypeFieldsByIds=sp,i.selectIssueTypeFieldsMapping=ep,i.selectIssueTypeFieldsOfIssueType=__,i.selectIssueTypeIdentifierById=Rp,i.selectIssueTypeIdentifierMapping=Mp,i.selectIssueTypeIdentifierValueById=kp,i.selectIssueTypeIdentifierValueMapping=Lp,i.selectIssueTypeIdentifierValues=Jt,i.selectIssueTypeIdentifierValuesByIds=Np,i.selectIssueTypeIdentifierValuesOfIdentifier=v_,i.selectIssueTypeIdentifierValuesOfIssue=w_,i.selectIssueTypeIdentifiers=$i,i.selectIssueTypeIdentifiersByIds=wp,i.selectIssueTypeIdentifiersOfIssueType=R_,i.selectIssueTypeMapping=py,i.selectIssueTypePriorities=ki,i.selectIssueTypePrioritiesByIds=sy,i.selectIssueTypePrioritiesOfIssueType=E_,i.selectIssueTypePriorityById=Ni,i.selectIssueTypePriorityMapping=ty,i.selectIssueTypeStatusById=Yi,i.selectIssueTypeStatusMapping=Ry,i.selectIssueTypeStatuses=Ki,i.selectIssueTypeStatusesByIds=wy,i.selectIssueTypeStatusesOfIssueType=V_,i.selectIssueTypeValuesOfIssueType=M_,i.selectIssueTypes=Hi,i.selectIssueTypesByIds=fy,i.selectIssueTypesOfOrganization=B_,i.selectIssueUpdateById=qy,i.selectIssueUpdateMapping=en,i.selectIssueUpdates=tn,i.selectIssueUpdatesByIds=Cy,i.selectIssueUpdatesOfIssue=$y,i.selectIssues=Yt,i.selectIssuesByIds=xh,i.selectIssuesOfIssueType=em,i.selectIssuesOfProject=P_,i.selectLatestAssetTypeFieldsOfAssetType=Kb,i.selectLatestFieldsByProcedureStep=og,i.selectLatestFormRevisionOfForm=f_,i.selectLatestIssueTypeFieldsOfIssueType=g_,i.selectLatestProcedureStepFieldValuesReviewByProcedureStepFieldValues=Ag,i.selectLatestProcedureStepFieldsOfProcedureStep=lg,i.selectLatestProcedureTypeFieldsOfProcedureType=Mg,i.selectLatestRetryTime=$_,i.selectLatestReviewOfProcedureStepFieldValues=yg,i.selectMembershipsByUserOfTeam=Vg,i.selectOrganizationAccessById=lf,i.selectOrganizationAccessMapping=xt,i.selectOrganizationAccessUserMapping=hf,i.selectOrganizationAccessesByIds=of,i.selectOrganizationById=_f,i.selectOrganizationDocuments=r_,i.selectOrganizations=bf,i.selectOrganizationsByIds=gf,i.selectOrganizationsMapping=Ff,i.selectProcedureById=TA,i.selectProcedureFieldValues=ec,i.selectProcedureFieldValuesAttachmentById=_O,i.selectProcedureFieldValuesAttachments=Qn,i.selectProcedureFieldValuesAttachmentsByIds=gO,i.selectProcedureFieldValuesAttachmentsMapping=bO,i.selectProcedureFieldValuesById=UO,i.selectProcedureFieldValuesByIds=LO,i.selectProcedureFieldValuesMapping=$O,i.selectProcedureInitiativeById=dA,i.selectProcedureInitiatives=ss,i.selectProcedureInitiativesByIds=uA,i.selectProcedureInitiativesMapping=rA,i.selectProcedureInitiativesOfProcedureType=J_,i.selectProcedureInitiativesOfProject=Z_,i.selectProcedureStepAssigneeById=qA,i.selectProcedureStepAssignees=vt,i.selectProcedureStepAssigneesByIds=CA,i.selectProcedureStepAssigneesMapping=jA,i.selectProcedureStepAssigneesOfProcedure=Q_,i.selectProcedureStepAssigneesOfProcedureAndProcedureStep=eg,i.selectProcedureStepAssigneesOfProcedureStep=x_,i.selectProcedureStepById=_P,i.selectProcedureStepCommentById=XA,i.selectProcedureStepComments=Et,i.selectProcedureStepCommentsByIds=QA,i.selectProcedureStepCommentsMapping=JA,i.selectProcedureStepCommentsOfProcedure=tg,i.selectProcedureStepCommentsOfProcedureAndProcedureStep=ig,i.selectProcedureStepCommentsOfProcedureStep=sg,i.selectProcedureStepDefaultAssigneeById=oI,i.selectProcedureStepDefaultAssignees=On,i.selectProcedureStepDefaultAssigneesByIds=hI,i.selectProcedureStepDefaultAssigneesMapping=lI,i.selectProcedureStepDefaultAssigneesOfProcedureStep=ng,i.selectProcedureStepDefaultReviewerById=_I,i.selectProcedureStepDefaultReviewers=bn,i.selectProcedureStepDefaultReviewersByIds=gI,i.selectProcedureStepDefaultReviewersMapping=bI,i.selectProcedureStepDefaultReviewersOfProcedureStep=cg,i.selectProcedureStepEventById=$I,i.selectProcedureStepEvents=Bt,i.selectProcedureStepEventsByIds=UI,i.selectProcedureStepEventsMapping=CI,i.selectProcedureStepEventsOfProcedure=ag,i.selectProcedureStepEventsOfProcedureAndProcedureStep=dg,i.selectProcedureStepEventsOfProcedureStep=rg,i.selectProcedureStepFieldValues=ut,i.selectProcedureStepFieldValuesAttachmentById=FT,i.selectProcedureStepFieldValuesAttachments=Dn,i.selectProcedureStepFieldValuesAttachmentsByIds=bT,i.selectProcedureStepFieldValuesAttachmentsMapping=OT,i.selectProcedureStepFieldValuesById=$T,i.selectProcedureStepFieldValuesByIds=UT,i.selectProcedureStepFieldValuesMapping=CT,i.selectProcedureStepFieldValuesOfProcedure=hg,i.selectProcedureStepFieldValuesOfProcedureAndProcedureStep=pg,i.selectProcedureStepFieldValuesOfProcedureStep=mg,i.selectProcedureStepFieldValuesReviewById=JT,i.selectProcedureStepFieldValuesReviews=lt,i.selectProcedureStepFieldValuesReviewsByIds=XT,i.selectProcedureStepFieldValuesReviewsMapping=ZT,i.selectProcedureStepFieldValuesReviewsOfProcedure=fg,i.selectProcedureStepFieldValuesReviewsOfProcedureAndProcedureStep=Sg,i.selectProcedureStepFields=is,i.selectProcedureStepFieldsAttachmentById=QI,i.selectProcedureStepFieldsAttachments=wn,i.selectProcedureStepFieldsAttachmentsByIds=xI,i.selectProcedureStepFieldsAttachmentsMapping=JI,i.selectProcedureStepFieldsById=oT,i.selectProcedureStepFieldsByIds=hT,i.selectProcedureStepFieldsMapping=En,i.selectProcedureStepFieldsOfProcedureStep=ug,i.selectProcedureStepReviewerById=oP,i.selectProcedureStepReviewers=Vt,i.selectProcedureStepReviewersByIds=hP,i.selectProcedureStepReviewersMapping=lP,i.selectProcedureStepReviewersOfProcedure=Ig,i.selectProcedureStepReviewersOfProcedureAndProcedureStep=Pg,i.selectProcedureStepReviewersOfProcedureStep=Tg,i.selectProcedureSteps=Nn,i.selectProcedureStepsByIds=gP,i.selectProcedureStepsMapping=kn,i.selectProcedureStepsMappingOfProcedureType=Og,i.selectProcedureStepsOfProcedureType=Fg,i.selectProcedureTypeAttachmentById=$P,i.selectProcedureTypeAttachmentMapping=CP,i.selectProcedureTypeAttachments=Hn,i.selectProcedureTypeAttachmentsByIds=UP,i.selectProcedureTypeById=eF,i.selectProcedureTypeFields=ns,i.selectProcedureTypeFieldsAttachmentById=xP,i.selectProcedureTypeFieldsAttachments=Kn,i.selectProcedureTypeFieldsAttachmentsByIds=eO,i.selectProcedureTypeFieldsAttachmentsMapping=QP,i.selectProcedureTypeFieldsById=mO,i.selectProcedureTypeFieldsByIds=pO,i.selectProcedureTypeFieldsMapping=hO,i.selectProcedureTypeFieldsOfProcedureType=gg,i.selectProcedureTypes=sc,i.selectProcedureTypesByIds=tF,i.selectProcedureTypesMapping=xO,i.selectProcedureTypesOfOrganization=wg,i.selectProcedures=dt,i.selectProceduresByIds=PA,i.selectProceduresMapping=IA,i.selectProceduresOfAsset=FA,i.selectProceduresOfAssets=bA,i.selectProceduresOfProcedureInitiative=_A,i.selectProceduresOfProcedureType=OA,i.selectProceduresOfProject=X_,i.selectProjectAccessById=Hf,i.selectProjectAccessMapping=on,i.selectProjectAccesses=wt,i.selectProjectAccessesByIds=Wf,i.selectProjectAccessesOfProject=L_,i.selectProjectAttachmentById=nS,i.selectProjectAttachmentMapping=iS,i.selectProjectAttachments=mn,i.selectProjectAttachmentsByIds=cS,i.selectProjectById=YS,i.selectProjectCommentById=AS,i.selectProjectCommentMapping=SS,i.selectProjectComments=es,i.selectProjectCommentsByIds=IS,i.selectProjectDocuments=a_,i.selectProjectFileById=VS,i.selectProjectFileMapping=ES,i.selectProjectFiles=BS,i.selectProjectFilesByIds=zS,i.selectProjectMapping=KS,i.selectProjects=ts,i.selectProjectsByIds=ZS,i.selectProjectsOfOrganization=Y_,i.selectRehydrated=Bg,i.selectReviewsOfProcedureStepFieldValues=QT,i.selectTeamById=RF,i.selectTeamMembershipById=yF,i.selectTeamMemberships=cs,i.selectTeamMembershipsByIds=fF,i.selectTeamMembershipsMapping=pF,i.selectTeams=ac,i.selectTeamsByIds=wF,i.selectTeamsMapping=MF,i.selectTeamsOfOrganization=Dg,i.selectUploadUrl=o_,i.selectUserById=Qt,i.selectUsers=Xt,i.selectUsersByIds=Xy,i.selectUsersMapping=an,i.selectUsersOfOrganization=q_,i.selectUsersOfProject=N_,i.selectUsersOfTeam=zg,i.setAsset=Fa,i.setAssetAttachment=Kc,i.setAssetAttachments=Yc,i.setAssetComment=aa,i.setAssetComments=ra,i.setAssetType=Td,i.setAssetTypeAttachment=Va,i.setAssetTypeAttachments=za,i.setAssetTypeFieldValues=zr,i.setAssetTypeFieldValuesAttachment=Tr,i.setAssetTypeFieldValuesAttachments=Pr,i.setAssetTypeFieldValuesMany=Dr,i.setAssetTypeFields=rr,i.setAssetTypeFieldsAttachment=Ka,i.setAssetTypeFieldsAttachments=Ya,i.setAssetTypeFieldsMany=dr,i.setAssetTypeIdentifier=Yr,i.setAssetTypeIdentifierValue=dd,i.setAssetTypeIdentifierValues=ud,i.setAssetTypeIdentifiers=Zr,i.setAssetTypeStatus=jd,i.setAssetTypeStatuses=qd,i.setAssetTypes=Pd,i.setAssets=ba,i.setClientSDK=XF,i.setClientStore=ZF,i.setConversation=Lc,i.setConversations=Cb,i.setCurrentUser=z_,i.setCurrentUserProfile=D_,i.setDocument=mu,i.setDocumentAttachment=xd,i.setDocumentAttachments=eu,i.setDocuments=pu,i.setEmailDomain=Mu,i.setEmailDomains=Ru,i.setForm=Hl,i.setFormIdentifier=Gu,i.setFormIdentifierValue=nl,i.setFormIdentifierValues=cl,i.setFormIdentifiers=Hu,i.setFormRevision=El,i.setFormRevisionAttachment=Al,i.setFormRevisionAttachments=Il,i.setFormRevisions=Bl,i.setFormSubmission=fo,i.setFormSubmissionAttachment=no,i.setFormSubmissionAttachments=co,i.setFormSubmissions=So,i.setForms=Wl,i.setGeoImage=wo,i.setGeoImages=vo,i.setIssue=Wh,i.setIssueAssociation=Go,i.setIssueAssociations=No,i.setIssueAttachment=ah,i.setIssueAttachments=rh,i.setIssueComment=zh,i.setIssueCommentAttachment=Th,i.setIssueCommentAttachments=Ph,i.setIssueComments=Dh,i.setIssueType=dy,i.setIssueTypeAttachment=am,i.setIssueTypeAttachments=rm,i.setIssueTypeFieldValues=zm,i.setIssueTypeFieldValuesAttachment=rp,i.setIssueTypeFieldValuesAttachments=dp,i.setIssueTypeFieldValuesMany=Dm,i.setIssueTypeFields=Ym,i.setIssueTypeFieldsAttachment=Tm,i.setIssueTypeFieldsAttachments=Pm,i.setIssueTypeFieldsMany=Zm,i.setIssueTypeIdentifier=Pp,i.setIssueTypeIdentifierValue=Dp,i.setIssueTypeIdentifierValues=jp,i.setIssueTypeIdentifiers=Op,i.setIssueTypePriorities=Jp,i.setIssueTypePriority=Zp,i.setIssueTypeStatus=Oy,i.setIssueTypeStatuses=Fy,i.setIssueTypes=uy,i.setIssueUpdate=Vy,i.setIssueUpdates=zy,i.setIssues=Kh,i.setLoggedIn=Kd,i.setOrganization=ff,i.setOrganizationAccess=sf,i.setOrganizationAccesses=nf,i.setOrganizations=yf,i.setProcedure=mA,i.setProcedureFieldValues=BO,i.setProcedureFieldValuesAttachment=AO,i.setProcedureFieldValuesAttachments=IO,i.setProcedureFieldValuesMany=VO,i.setProcedureInitiative=eA,i.setProcedureInitiatives=tA,i.setProcedureStep=fP,i.setProcedureStepAssignee=vA,i.setProcedureStepAssignees=EA,i.setProcedureStepComment=GA,i.setProcedureStepComments=HA,i.setProcedureStepDefaultAssignee=nI,i.setProcedureStepDefaultAssignees=cI,i.setProcedureStepDefaultReviewer=AI,i.setProcedureStepDefaultReviewers=II,i.setProcedureStepEvent=BI,i.setProcedureStepEvents=VI,i.setProcedureStepFieldValues=ET,i.setProcedureStepFieldValuesAttachment=ST,i.setProcedureStepFieldValuesAttachments=AT,i.setProcedureStepFieldValuesMany=BT,i.setProcedureStepFieldValuesReview=GT,i.setProcedureStepFieldValuesReviews=HT,i.setProcedureStepFields=cT,i.setProcedureStepFieldsAttachment=HI,i.setProcedureStepFieldsAttachments=WI,i.setProcedureStepFieldsMany=aT,i.setProcedureStepReviewer=nP,i.setProcedureStepReviewers=cP,i.setProcedureSteps=SP,i.setProcedureType=WO,i.setProcedureTypeAttachment=EP,i.setProcedureTypeAttachments=BP,i.setProcedureTypeFields=cO,i.setProcedureTypeFieldsAttachment=HP,i.setProcedureTypeFieldsAttachments=WP,i.setProcedureTypeFieldsMany=aO,i.setProcedureTypes=KO,i.setProcedures=pA,i.setProject=$S,i.setProjectAccess=Cf,i.setProjectAccesses=$f,i.setProjectAttachment=Xf,i.setProjectAttachments=Qf,i.setProjectComment=oS,i.setProjectComments=hS,i.setProjectFile=FS,i.setProjectFiles=bS,i.setProjects=CS,i.setRehydrated=Eg,i.setTeam=PF,i.setTeamMembership=rF,i.setTeamMemberships=dF,i.setTeams=OF,i.setTokens=t_,i.setUploadUrl=l_,i.setUser=Gy,i.setUsers=Ny,i.shallowEqual=Sb,i.slugify=Bb,i.spacesToDashesLower=Eb,i.submittedAtModelSortFn=yt,i.teamMembershipReducer=mF,i.teamMembershipSlice=nc,i.teamReducer=vF,i.teamSlice=cc,i.toFileNameSafeString=vb,i.toUuidArray=E,i.toUuidIdRecord=wb,i.truncate=Vb,i.updateAsset=Ta,i.updateAssetAttachment=Zc,i.updateAssetAttachments=Jc,i.updateAssetComment=da,i.updateAssetComments=ua,i.updateAssetType=bd,i.updateAssetTypeAttachment=Da,i.updateAssetTypeAttachments=ja,i.updateAssetTypeFieldValues=jr,i.updateAssetTypeFieldValuesAttachment=Or,i.updateAssetTypeFieldValuesAttachments=Fr,i.updateAssetTypeFieldValuesMany=qr,i.updateAssetTypeFields=ur,i.updateAssetTypeFieldsAttachment=Za,i.updateAssetTypeFieldsAttachments=Ja,i.updateAssetTypeFieldsMany=lr,i.updateAssetTypeIdentifier=Jr,i.updateAssetTypeIdentifierValue=ld,i.updateAssetTypeIdentifierValues=od,i.updateAssetTypeIdentifiers=Xr,i.updateAssetTypeStatus=Cd,i.updateAssetTypeStatuses=$d,i.updateAssetTypes=_d,i.updateAssets=Pa,i.updateConversation=kc,i.updateConversations=$b,i.updateDocument=yu,i.updateDocumentAttachment=tu,i.updateDocumentAttachments=su,i.updateDocuments=fu,i.updateEmailDomain=wu,i.updateEmailDomains=vu,i.updateForm=Kl,i.updateFormIdentifier=Wu,i.updateFormIdentifierValue=al,i.updateFormIdentifierValues=rl,i.updateFormIdentifiers=Ku,i.updateFormRevision=Vl,i.updateFormRevisionAttachment=Tl,i.updateFormRevisionAttachments=Pl,i.updateFormRevisions=zl,i.updateFormSubmission=Io,i.updateFormSubmissionAttachment=ao,i.updateFormSubmissionAttachments=ro,i.updateFormSubmissions=To,i.updateForms=Yl,i.updateGeoImage=Vo,i.updateGeoImages=zo,i.updateIssue=Yh,i.updateIssueAssociation=Ho,i.updateIssueAssociations=Wo,i.updateIssueAttachment=dh,i.updateIssueAttachments=uh,i.updateIssueComment=jh,i.updateIssueCommentAttachment=Oh,i.updateIssueCommentAttachments=Fh,i.updateIssueComments=qh,i.updateIssueType=ly,i.updateIssueTypeAttachment=dm,i.updateIssueTypeAttachments=um,i.updateIssueTypeFieldValues=jm,i.updateIssueTypeFieldValuesAttachment=up,i.updateIssueTypeFieldValuesAttachments=lp,i.updateIssueTypeFieldValuesMany=qm,i.updateIssueTypeFields=Jm,i.updateIssueTypeFieldsAttachment=Om,i.updateIssueTypeFieldsAttachments=Fm,i.updateIssueTypeFieldsMany=Xm,i.updateIssueTypeIdentifier=Fp,i.updateIssueTypeIdentifierValue=qp,i.updateIssueTypeIdentifierValues=Cp,i.updateIssueTypeIdentifiers=bp,i.updateIssueTypePriorities=Qp,i.updateIssueTypePriority=Xp,i.updateIssueTypeStatus=by,i.updateIssueTypeStatuses=_y,i.updateIssueTypes=oy,i.updateIssueUpdate=Dy,i.updateIssueUpdates=jy,i.updateIssues=Zh,i.updateOrganization=Tf,i.updateOrganizationAccess=cf,i.updateOrganizationAccesses=af,i.updateOrganizations=If,i.updateProcedure=yA,i.updateProcedureFieldValues=zO,i.updateProcedureFieldValuesAttachment=TO,i.updateProcedureFieldValuesAttachments=PO,i.updateProcedureFieldValuesMany=DO,i.updateProcedureInitiative=sA,i.updateProcedureInitiatives=iA,i.updateProcedureStep=TP,i.updateProcedureStepAssignee=BA,i.updateProcedureStepAssignees=VA,i.updateProcedureStepComment=WA,i.updateProcedureStepComments=KA,i.updateProcedureStepDefaultAssignee=aI,i.updateProcedureStepDefaultAssignees=rI,i.updateProcedureStepDefaultReviewer=TI,i.updateProcedureStepDefaultReviewers=PI,i.updateProcedureStepEvent=zI,i.updateProcedureStepEvents=DI,i.updateProcedureStepFieldValues=VT,i.updateProcedureStepFieldValuesAttachment=IT,i.updateProcedureStepFieldValuesAttachments=TT,i.updateProcedureStepFieldValuesMany=zT,i.updateProcedureStepFieldValuesReview=WT,i.updateProcedureStepFieldValuesReviews=KT,i.updateProcedureStepFields=rT,i.updateProcedureStepFieldsAttachment=KI,i.updateProcedureStepFieldsAttachments=YI,i.updateProcedureStepFieldsMany=dT,i.updateProcedureStepReviewer=aP,i.updateProcedureStepReviewers=rP,i.updateProcedureSteps=PP,i.updateProcedureType=YO,i.updateProcedureTypeAttachment=VP,i.updateProcedureTypeAttachments=zP,i.updateProcedureTypeFields=rO,i.updateProcedureTypeFieldsAttachment=KP,i.updateProcedureTypeFieldsAttachments=YP,i.updateProcedureTypeFieldsMany=dO,i.updateProcedureTypes=ZO,i.updateProcedures=fA,i.updateProject=NS,i.updateProjectAccess=Uf,i.updateProjectAccesses=Lf,i.updateProjectAttachment=xf,i.updateProjectAttachments=eS,i.updateProjectComment=mS,i.updateProjectComments=pS,i.updateProjectFile=MS,i.updateProjectFiles=RS,i.updateProjects=kS,i.updateTeam=FF,i.updateTeamMembership=uF,i.updateTeamMemberships=lF,i.updateTeams=bF,i.updateUser=Ky,i.updateUsers=Wy,i.useSelectorBuilder=fb,i.userReducer=Zy,i.userSlice=sn,i.uuidObj=P,i.uuidObjSortFn=hs,i.uuidSortFn=jt,i.versioningReducer=BF,i.versioningSlice=EF,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
|