@overmap-ai/core 1.0.78-bump-page-sizes.1 → 1.0.78-bump-forms.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -0
- package/dist/constants/defaults.d.ts +1 -2
- package/dist/enums/asset.d.ts +8 -0
- package/dist/enums/index.d.ts +2 -0
- package/dist/enums/issue.d.ts +7 -6
- package/dist/enums/procedures.d.ts +11 -0
- package/dist/overmap-core.js +10824 -8396
- package/dist/overmap-core.umd.cjs +10 -11
- package/dist/sdk/base.d.ts +6 -2
- package/dist/sdk/constants.d.ts +4 -4
- 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 -34
- 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 -33
- 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 +7 -4
- package/dist/sdk/services/DocumentAttachmentService.d.ts +25 -33
- 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 -34
- package/dist/sdk/services/IssueCommentAttachmentService.d.ts +23 -34
- 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 -34
- 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/IssueTypeService.d.ts +20 -3
- package/dist/sdk/services/IssueTypeStatusService.d.ts +28 -0
- package/dist/sdk/services/IssueUpdateService.d.ts +173 -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 -33
- 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 +27 -15
- 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 +72 -45
- 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 +35 -53
- package/dist/store/slices/assetTypeAttachmentSlice.d.ts +10 -36
- package/dist/store/slices/assetTypeFieldValuesAttachmentSlice.d.ts +34 -52
- package/dist/store/slices/assetTypeFieldValuesSlice.d.ts +34 -51
- package/dist/store/slices/assetTypeFieldsAttachmentSlice.d.ts +34 -51
- package/dist/store/slices/assetTypeFieldsSlice.d.ts +34 -51
- 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 +119 -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 +37 -53
- 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 +109 -36
- package/dist/store/slices/formRevisionSlice.d.ts +34 -51
- package/dist/store/slices/formSlice.d.ts +34 -51
- 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 +34 -51
- package/dist/store/slices/index.d.ts +24 -15
- package/dist/store/slices/issueAssociationSlice.d.ts +36 -52
- 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 +34 -52
- package/dist/store/slices/issueTypeFieldValuesSlice.d.ts +34 -51
- package/dist/store/slices/issueTypeFieldsAttachmentSlice.d.ts +34 -51
- package/dist/store/slices/issueTypeFieldsSlice.d.ts +34 -51
- package/dist/store/slices/issueTypeIdentifierSlice.d.ts +10 -36
- package/dist/store/slices/issueTypeIdentifierValueSlice.d.ts +10 -36
- package/dist/store/slices/issueTypeSlice.d.ts +11 -42
- package/dist/store/slices/issueTypeStatusSlice.d.ts +119 -0
- package/dist/store/slices/issueUpdateSlice.d.ts +243 -37
- package/dist/store/slices/organizationAccessSlice.d.ts +10 -36
- package/dist/store/slices/organizationSlice.d.ts +34 -51
- package/dist/store/slices/outboxSlice.d.ts +6 -7
- package/dist/store/slices/procedureFieldValuesSlice.d.ts +119 -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 +121 -0
- package/dist/store/slices/procedureStepCommentSlice.d.ts +121 -0
- package/dist/store/slices/procedureStepDefaultAssigneeSlice.d.ts +119 -0
- package/dist/store/slices/procedureStepDefaultReviewerSlice.d.ts +119 -0
- package/dist/store/slices/procedureStepEventSlice.d.ts +121 -0
- package/dist/store/slices/procedureStepFieldValuesAttachmentSlice.d.ts +119 -0
- package/dist/store/slices/procedureStepFieldValuesReviewSlice.d.ts +123 -0
- package/dist/store/slices/procedureStepFieldValuesSlice.d.ts +121 -0
- package/dist/store/slices/procedureStepFieldsAttachmentSlice.d.ts +119 -0
- package/dist/store/slices/{assetProcedureStepFieldsSlice.d.ts → procedureStepFieldsSlice.d.ts} +80 -88
- package/dist/store/slices/procedureStepReviewerSlice.d.ts +121 -0
- package/dist/store/slices/procedureStepSlice.d.ts +120 -0
- package/dist/store/slices/procedureTypeAttachmentSlice.d.ts +99 -0
- package/dist/store/slices/procedureTypeFieldValuesAttachmentSlice.d.ts +119 -0
- package/dist/store/slices/procedureTypeFieldsAttachmentSlice.d.ts +119 -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 +36 -68
- package/dist/store/slices/projectSlice.d.ts +34 -51
- 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 +37 -61
- package/dist/store/store.d.ts +4 -13
- package/dist/store/typings.d.ts +18 -1
- package/dist/typings/files.d.ts +32 -18
- package/dist/typings/models/agents.d.ts +2 -1
- package/dist/typings/models/assets.d.ts +19 -66
- package/dist/typings/models/base.d.ts +5 -12
- package/dist/typings/models/documents.d.ts +5 -8
- 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 +36 -30
- package/dist/typings/models/procedures.d.ts +106 -0
- package/dist/typings/models/projects.d.ts +13 -8
- package/dist/typings/models/teams.d.ts +2 -3
- package/dist/typings/models/users.d.ts +2 -2
- 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 -0
- package/dist/utils/models/issues.d.ts +2 -0
- package/dist/utils/utils.d.ts +0 -7
- package/dist/utils/uuid.d.ts +2 -0
- package/package.json +7 -7
- 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 -40
- 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 -38
- package/dist/sdk/services/BaseUploadService.d.ts +0 -10
- package/dist/sdk/services/CategoryService.d.ts +0 -11
- package/dist/store/slices/assetProcedureSlice.d.ts +0 -138
- package/dist/store/slices/assetProcedureStepFieldValuesAttachmentSlice.d.ts +0 -137
- package/dist/store/slices/assetProcedureStepFieldValuesSlice.d.ts +0 -138
- package/dist/store/slices/assetProcedureStepFieldsAttachmentSlice.d.ts +0 -136
- package/dist/store/slices/assetProcedureStepSlice.d.ts +0 -139
- package/dist/store/slices/assetProcedureTypeAttachmentSlice.d.ts +0 -48
- package/dist/store/slices/assetProcedureTypeFieldValuesAttachmentSlice.d.ts +0 -137
- package/dist/store/slices/assetProcedureTypeFieldValuesSlice.d.ts +0 -137
- package/dist/store/slices/assetProcedureTypeFieldsAttachmentSlice.d.ts +0 -136
- 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 -136
- package/dist/store/slices/assetStageSlice.d.ts +0 -138
- package/dist/store/slices/categorySlice.d.ts +0 -137
- package/dist/typings/models/categories.d.ts +0 -7
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
(function(s,U){typeof exports=="object"&&typeof module<"u"?U(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"],U):(s=typeof globalThis<"u"?globalThis:s||self,U(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,U,d,Je,Xe,Gp,Lp,xn,Np,Hp,ec,EF,Wp,Kp,VF,Yp,Zp,Jp){"use strict";var wF=Object.defineProperty;var MF=(s,U,d)=>U in s?wF(s,U,{enumerable:!0,configurable:!0,writable:!0,value:d}):s[U]=d;var S=(s,U,d)=>MF(s,typeof U!="symbol"?U+"":U,d);var $p;const tc=Object.freeze([]),sc=Object.freeze({});var ic=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))(ic||{}),l=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(l||{}),ac=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(ac||{}),xt=(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))(xt||{}),es=(t=>(t[t.BACKLOG=0]="BACKLOG",t[t.SELECTED=2]="SELECTED",t[t.DONE=4]="DONE",t))(es||{}),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 Xp=es.BACKLOG,Qp=xt.MEDIUM,nc=6e4;function P(t){return{addOne:(p,y)=>{const A=t(y.payload);p.instances[A]=y.payload},addMany:(p,y)=>{for(const A of y.payload){const I=t(A);p.instances[I]=A}},setOne:(p,y)=>{const A=t(y.payload);p.instances[A]=y.payload},setMany:(p,y)=>{for(const A of y.payload){const I=t(A);p.instances[I]=A}},updateOne:(p,y)=>{const A=t(y.payload);p.instances[A]=y.payload},updateMany:(p,y)=>{for(const A of y.payload){const I=t(A);p.instances[I]=A}},deleteOne:(p,y)=>{delete p.instances[y.payload]},deleteMany:(p,y)=>{for(const A of y.payload)delete p.instances[A]},initialize:(p,y)=>{p.instances={};const A=new Set;for(const I of y.payload){const F=t(I);A.add(F),p.instances[F]=I}A.size!==y.payload.length&&console.warn("duplicate ids detected when initializing model instances.")},getInitialState:p=>({...p,instances:{}})}}function xp(){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"),O=d.createAction("RESET_ORGANIZATION_STATE");$p=Symbol.toStringTag;class cc{constructor(){S(this,$p,"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 ts=!1;["true","1"].includes("".toLowerCase())&&(ts=!0);function ey(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;const i=Object.keys(t),a=Object.keys(e),n=i.length;if(n!==a.length)return!1;for(let c=0;c<n;c++){const r=i[c];if(!Object.prototype.hasOwnProperty.call(e,r)||t[r]!==e[r])return!1}return!0}function ss(t){const e={};return function(){const i=Array.prototype.slice.call(arguments);return i in e?(ts&&console.debug(`Memoization debug: Using memorized return value for ${t.toString()}(`,i,")"),e[i]):(ts&&console.debug(`Memoization debug: Cache miss! Memoizing ${t.toString()}(`,i,")"),e[i]=t.apply(this,i))}}function ty(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?tc:t,_t=t=>Object.keys(t).length===0?sc:t,rc=ss(t=>{if(!t)return"";const e=new Date(t),i=e.getFullYear()===is.getFullYear(),a={day:"numeric",month:"short"};return i||(a.year="numeric"),e.toLocaleDateString([],a)}),sy=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),iy=1e3*86400,is=new Date,ay=t=>new Date(t).toDateString()===is.toDateString(),ny=ss((t,e,i)=>{const a=Math.round((new Date(t).getTime()-is.getTime())/iy);return a<e||a>i?rc(t):sy.format(a,"days")});function cy(t){return new Uint8Array(t).reduce((i,a)=>i+a.toString(16).padStart(2,"0"),"")}const as=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 n=a.result;if(!n){i(new Error("FileReader did not return a valid ArrayBuffer."));return}crypto.subtle.digest("SHA-1",n).then(c=>{const r=cy(c);e(r)})},a.readAsArrayBuffer(t)})}function ry(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 dc(t,e){return new File([t],e,{type:t.type})}function dy(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 uy=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)},uc=async t=>(await fetch(t)).blob(),oy=t=>new Promise((e,i)=>{const a=new FileReader;a.onloadend=()=>{var n;e(((n=a.result)==null?void 0:n.toString())||"")},a.readAsDataURL(t)});function ly(t){const e=new Blob([t]);Gp.saveAs(e,t.name)}const oc={};function hy(t,e,i,...a){const n=oc[t];let c=!1;n?n[e]||(n[e]=!0,c=!0):(oc[t]={[e]:!0},c=!0),c&&console[i](...a)}const lc=["created_at","updated_at","index","revision"];function b(t){return{...t,uuid:Xe.v4()}}function hc(t){const e={};for(const i of t)e[i.uuid]=i;return e}function mc(t){return t.map(({uuid:e})=>e)}function my(t,e=void 0,i=255){let a=t.replace(/[^a-z0-9_\-.]/gi,"_").replace(/_{2,}/g,"_");if(!e){const c=t.split(".");c.length>1&&(e=c[c.length-1])}e&&!e.startsWith(".")&&(e="."+e);const n=e?e.length:0;return a.length+n>i&&(a=a.slice(0,i-n)+(e||"")),a}function py(t){return t.toLowerCase().replace(" ","-")}function yy(t,e=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,e?"_":"-")}function Ay(t,e){if(t.length<=e)return t;const i=t.slice(0,e-1);return i.slice(0,i.lastIndexOf(" "))+"…"}const f=t=>e=>i=>t(i,e);function pc(t,e,i){return i.findIndex(a=>a.uuid===t.uuid)===e}function fy(t,e,i){return i.findIndex(a=>a.file_sha1===t.file_sha1)===e}const Sy=/^.+@.+\..+$/;function v(t){const e={...t};for(const i of[...lc,"created_by"])i in e&&delete e[i];return e}const yc=t=>{const e=t.toSorted((i,a)=>i.order-a.order);return Lp(e,{id:i=>i.uuid,parentId:i=>i.parent,includeEmptyChildrenArray:!0,valueKey:!1})},Ty=t=>{const{roots:e}=yc(t);return e.map(i=>new xn.Tree(i))},Ac=(t,e)=>{const{nodes:i}=yc(e),a=i.get(t);if(!a)throw new Error(`Node with uuid ${t} does not exist in asset procedure step tree.`);return new xn.Tree(a)},k=P(t=>t.uuid),fc=k.getInitialState({}),ns=d.createSlice({name:"agents",initialState:fc,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,O),e=>Object.assign(e,fc)),reducers:{initializeConversations:k.initialize,addConversation:k.addOne,addConversations:k.addMany,setConversation:k.setOne,setConversations:k.setMany,updateConversation:k.updateOne,updateConversations:k.updateMany,deleteConversation:k.deleteOne,deleteConversations:k.deleteMany}}),{initializeConversations:Sc,addConversation:Tc,addConversations:Iy,setConversation:Ic,setConversations:gy,updateConversation:gc,updateConversations:by,deleteConversation:Fy,deleteConversations:Py}=ns.actions,cs=t=>t.agentsReducer.instances,Oy=d.createSelector([cs],t=>Object.values(t)),_y=f(d.createSelector([cs,(t,e)=>e],(t,e)=>t[e])),bc=ns.reducer,B=P(t=>t.uuid),Fc=B.getInitialState({}),rs=d.createSlice({name:"assetAttachments",initialState:Fc,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,O),e=>Object.assign(e,Fc)),reducers:{initializeAssetAttachments:B.initialize,addAssetAttachment:B.addOne,addAssetAttachments:B.addMany,setAssetAttachment:B.setOne,setAssetAttachments:B.setMany,updateAssetAttachment:B.updateOne,updateAssetAttachments:B.updateMany,deleteAssetAttachment:B.deleteOne,deleteAssetAttachments:B.deleteMany}}),{initializeAssetAttachments:ds,addAssetAttachment:Ry,addAssetAttachments:us,setAssetAttachment:Pc,setAssetAttachments:vy,updateAssetAttachment:wy,updateAssetAttachments:Oc,deleteAssetAttachment:_c,deleteAssetAttachments:os}=rs.actions,Rc=t=>t.assetAttachmentReducer.instances,vc=d.createSelector([Rc],t=>Object.values(t)),wc=t=>e=>e.assetAttachmentReducer.instances[t],Mc=f(d.createSelector([vc,(t,e)=>e],(t,e)=>T(t.filter(({asset:i})=>e===i)))),Ec=rs.reducer,$=P(({uuid:t})=>t),Vc=$.getInitialState({}),ls=d.createSlice({name:"assetProcedureTypeAttachments",initialState:Vc,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,Vc)),reducers:{initializeAssetProcedureTypeAttachments:$.initialize,addAssetProcedureTypeAttachment:$.addOne,addAssetProcedureTypeAttachments:$.addMany,setAssetProcedureTypeAttachment:$.setOne,setAssetProcedureTypeAttachments:$.setMany,updateAssetProcedureTypeAttachment:$.updateOne,updateAssetProcedureTypeAttachments:$.updateMany,deleteAssetProcedureTypeAttachment:$.deleteOne,deleteAssetProcedureTypeAttachments:$.deleteMany}}),{initializeAssetProcedureTypeAttachments:jc,addAssetProcedureTypeAttachment:My,addAssetProcedureTypeAttachments:qc,setAssetProcedureTypeAttachment:zc,setAssetProcedureTypeAttachments:Ey,updateAssetProcedureTypeAttachment:Vy,updateAssetProcedureTypeAttachments:Uc,deleteAssetProcedureTypeAttachment:Dc,deleteAssetProcedureTypeAttachments:Cc}=ls.actions,kc=ls.reducer,Bc=t=>t.assetProcedureTypeAttachmentReducer.instances,$c=d.createSelector([Bc],t=>Object.values(t)),Gc=t=>e=>e.assetProcedureTypeAttachmentReducer.instances[t],jy=f(d.createSelector([$c,(t,e)=>e],(t,e)=>T(t.filter(({asset_procedure_type:i})=>e===i)))),G=P(({uuid:t})=>t),Lc=G.getInitialState({}),hs=d.createSlice({name:"assetProcedureTypeFieldsAttachments",initialState:Lc,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,Lc)),reducers:{initializeAssetProcedureTypeFieldsAttachments:G.initialize,addAssetProcedureTypeFieldsAttachment:G.addOne,addAssetProcedureTypeFieldsAttachments:G.addMany,setAssetProcedureTypeFieldsAttachment:G.setOne,setAssetProcedureTypeFieldsAttachments:G.setMany,updateAssetProcedureTypeFieldsAttachment:G.updateOne,updateAssetProcedureTypeFieldsAttachments:G.updateMany,deleteAssetProcedureTypeFieldsAttachment:G.deleteOne,deleteAssetProcedureTypeFieldsAttachments:G.deleteMany}}),{initializeAssetProcedureTypeFieldsAttachments:Nc,addAssetProcedureTypeFieldsAttachment:qy,addAssetProcedureTypeFieldsAttachments:Hc,setAssetProcedureTypeFieldsAttachment:zy,setAssetProcedureTypeFieldsAttachments:Uy,updateAssetProcedureTypeFieldsAttachment:Dy,updateAssetProcedureTypeFieldsAttachments:Wc,deleteAssetProcedureTypeFieldsAttachment:Cy,deleteAssetProcedureTypeFieldsAttachments:Kc}=hs.actions,Yc=hs.reducer,Zc=t=>t.assetProcedureTypeFieldsAttachmentReducer.instances,Jc=d.createSelector([Zc],t=>Object.values(t)),ky=f(d.createSelector([Jc,(t,e)=>e],(t,e)=>T(t.filter(i=>i.fields_revision===e)))),By=t=>e=>e.assetProcedureTypeFieldsAttachmentReducer.instances[t],L=P(({uuid:t})=>t),Xc=L.getInitialState({}),ms=d.createSlice({name:"assetProcedureTypeFields",initialState:Xc,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,Xc)),reducers:{initializeAssetProcedureTypeFields:L.initialize,addAssetProcedureTypeFields:L.addOne,addAssetProcedureTypeFieldsMany:L.addMany,setAssetProcedureTypeFields:L.setOne,setAssetProcedureTypeFieldsMany:L.setMany,updateAssetProcedureTypeFields:L.updateOne,updateAssetProcedureTypeFieldsMany:L.updateMany,deleteAssetProcedureTypeFields:L.deleteOne,deleteAssetProcedureTypeFieldsMany:L.deleteMany}}),{initializeAssetProcedureTypeFields:Qc,addAssetProcedureTypeFields:xc,addAssetProcedureTypeFieldsMany:$y,setAssetProcedureTypeFields:Gy,setAssetProcedureTypeFieldsMany:Ly,updateAssetProcedureTypeFields:er,updateAssetProcedureTypeFieldsMany:Ny,deleteAssetProcedureTypeFields:tr,deleteAssetProcedureTypeFieldsMany:Hy}=ms.actions,sr=ms.reducer,ir=t=>t.assetProcedureTypeFieldsReducer.instances,ps=d.createSelector([ir],t=>Object.values(t)),Wy=f(d.createSelector([ps,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_type===e)))),Ky=f(d.createSelector([ps,(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])),Yy=t=>e=>e.assetProcedureTypeFieldsReducer.instances[t],N=P(({uuid:t})=>t),ar=N.getInitialState({}),ys=d.createSlice({name:"assetProcedureTypeFieldValuesAttachments",initialState:ar,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,O),e=>Object.assign(e,ar)),reducers:{initializeAssetProcedureTypeFieldValuesAttachments:N.initialize,addAssetProcedureTypeFieldValuesAttachment:N.addOne,addAssetProcedureTypeFieldValuesAttachments:N.addMany,setAssetProcedureTypeFieldValuesAttachment:N.setOne,setAssetProcedureTypeFieldValuesAttachments:N.setMany,updateAssetProcedureTypeFieldValuesAttachment:N.updateOne,updateAssetProcedureTypeFieldValuesAttachments:N.updateMany,deleteAssetProcedureTypeFieldValuesAttachment:N.deleteOne,deleteAssetProcedureTypeFieldValuesAttachments:N.deleteMany}}),{initializeAssetProcedureTypeFieldValuesAttachments:nr,addAssetProcedureTypeFieldValuesAttachment:Zy,addAssetProcedureTypeFieldValuesAttachments:Rt,setAssetProcedureTypeFieldValuesAttachment:Jy,setAssetProcedureTypeFieldValuesAttachments:Xy,updateAssetProcedureTypeFieldValuesAttachment:Qy,updateAssetProcedureTypeFieldValuesAttachments:cr,deleteAssetProcedureTypeFieldValuesAttachment:xy,deleteAssetProcedureTypeFieldValuesAttachments:vt}=ys.actions,rr=ys.reducer,As=t=>t.assetProcedureTypeFieldValuesAttachmentReducer.instances,dr=d.createSelector([As],t=>Object.values(t)),eA=t=>e=>e.assetProcedureTypeFieldValuesAttachmentReducer.instances[t],ur=f(d.createSelector([As,(t,e)=>e],(t,e)=>{const i=new Set(e);return T(Object.values(t).filter(a=>i.has(a.uuid)))})),or=f(d.createSelector([dr,(t,e)=>e],(t,e)=>T(t.filter(i=>i.field_values===e)))),H=P(({uuid:t})=>t),lr=H.getInitialState({}),fs=d.createSlice({name:"assetProcedureTypeFieldValues",initialState:lr,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,O),e=>Object.assign(e,lr)),reducers:{initializeAssetProcedureTypeFieldValues:H.initialize,addAssetProcedureTypeFieldValues:H.addOne,addAssetProcedureTypeFieldValuesMany:H.addMany,setAssetProcedureTypeFieldValues:H.setOne,setAssetProcedureTypeFieldValuesMany:H.setMany,updateAssetProcedureTypeFieldValues:H.updateOne,updateAssetProcedureTypeFieldValuesMany:H.updateMany,deleteAssetProcedureTypeFieldValues:H.deleteOne,deleteAssetProcedureTypeFieldValuesMany:H.deleteMany}}),{initializeAssetProcedureTypeFieldValues:hr,addAssetProcedureTypeFieldValues:Ss,addAssetProcedureTypeFieldValuesMany:mr,setAssetProcedureTypeFieldValues:tA,setAssetProcedureTypeFieldValuesMany:sA,updateAssetProcedureTypeFieldValues:at,updateAssetProcedureTypeFieldValuesMany:pr,deleteAssetProcedureTypeFieldValues:Ts,deleteAssetProcedureTypeFieldValuesMany:yr}=fs.actions,Ar=fs.reducer,fr=t=>t.assetProcedureFieldValuesReducer.instances,Is=d.createSelector([fr],t=>Object.values(t)),iA=f(d.createSelector([Is,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset===e)))),aA=f(d.createSelector([Is,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure===e)))),gs=t=>e=>e.assetProcedureFieldValuesReducer.instances[t],W=P(({uuid:t})=>t),Sr=W.getInitialState({}),bs=d.createSlice({name:"assetProcedures",initialState:Sr,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,O),e=>Object.assign(e,Sr)),reducers:{initializeAssetProcedures:W.initialize,addAssetProcedure:W.addOne,addAssetProcedures:W.addMany,setAssetProcedure:W.setOne,setAssetProcedures:W.setMany,updateAssetProcedure:W.updateOne,updateAssetProcedures:W.updateMany,deleteAssetProcedure:W.deleteOne,deleteAssetProcedures:W.deleteMany}}),{initializeAssetProcedures:Tr,addAssetProcedure:Fs,addAssetProcedures:Ir,updateAssetProcedure:nt,updateAssetProcedures:nA,deleteAssetProcedure:Ps,deleteAssetProcedures:gr,setAssetProcedure:cA,setAssetProcedures:rA}=bs.actions,br=bs.reducer,Os=t=>t.assetProcedureReducer.instances,_s=d.createSelector([Os],t=>Object.values(t)),Fr=f(d.createSelector([_s,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_type===e)))),dA=f(d.createSelector([_s,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_type===e)))),Rs=t=>e=>e.assetProcedureReducer.instances[t],uA=f(d.createSelector([Os,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const n=t[a];n&&i.push(n)}return T(i)})),K=P(t=>t.uuid),Pr=K.getInitialState({}),vs=d.createSlice({name:"assetProcedureTypes",initialState:Pr,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,Pr)),reducers:{initializeAssetProcedureTypes:K.initialize,addAssetProcedureType:K.addOne,addAssetProcedureTypes:K.addMany,setAssetProcedureType:K.setOne,setAssetProcedureTypes:K.setMany,updateAssetProcedureType:K.updateOne,updateAssetProcedureTypes:K.updateMany,deleteAssetProcedureType:K.deleteOne,deleteAssetProcedureTypes:K.deleteMany}}),{initializeAssetProcedureTypes:Or,addAssetProcedureType:ws,addAssetProcedureTypes:oA,updateAssetProcedureType:ct,updateAssetProcedureTypes:lA,deleteAssetProcedureType:Ms,deleteAssetProcedureTypes:hA,setAssetProcedureType:mA,setAssetProcedureTypes:pA}=vs.actions,_r=vs.reducer,Es=t=>t.assetProcedureTypeReducer.instances,Rr=d.createSelector([Es],t=>Object.values(t)),Vs=t=>e=>e.assetProcedureTypeReducer.instances[t],yA=f(d.createSelector([Es,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const n=t[a];n&&i.push(n)}return T(i)})),AA=f(d.createSelector([Rr,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),Y=P(t=>t.uuid),vr=Y.getInitialState({}),js=d.createSlice({name:"assetProcedureStepFieldsAttachments",initialState:vr,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,vr)),reducers:{initializeAssetProcedureStepFieldsAttachments:Y.initialize,addAssetProcedureStepFieldsAttachment:Y.addOne,addAssetProcedureStepFieldsAttachments:Y.addMany,setAssetProcedureStepFieldsAttachment:Y.setOne,setAssetProcedureStepFieldsAttachments:Y.setMany,updateAssetProcedureStepFieldsAttachment:Y.updateOne,updateAssetProcedureStepFieldsAttachments:Y.updateMany,deleteAssetProcedureStepFieldsAttachment:Y.deleteOne,deleteAssetProcedureStepFieldsAttachments:Y.deleteMany}}),{initializeAssetProcedureStepFieldsAttachments:wr,addAssetProcedureStepFieldsAttachment:fA,addAssetProcedureStepFieldsAttachments:Mr,setAssetProcedureStepFieldsAttachment:SA,setAssetProcedureStepFieldsAttachments:TA,updateAssetProcedureStepFieldsAttachment:IA,updateAssetProcedureStepFieldsAttachments:Er,deleteAssetProcedureStepFieldsAttachment:gA,deleteAssetProcedureStepFieldsAttachments:Vr}=js.actions,jr=t=>t.assetProcedureStepFieldsAttachmentReducer.instances,qr=d.createSelector([jr],t=>Object.values(t)),bA=f(d.createSelector([qr,(t,e)=>e],(t,e)=>T(t.filter(i=>i.fields_revision===e)))),FA=t=>e=>e.assetProcedureStepFieldsAttachmentReducer.instances[t],zr=js.reducer,Z=P(t=>t.uuid),Ur=Z.getInitialState({}),qs=d.createSlice({name:"assetProcedureStepFields",initialState:Ur,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,Ur)),reducers:{initializeAssetProcedureStepFields:Z.initialize,addAssetProcedureStepFields:Z.addOne,addAssetProcedureStepFieldsMany:Z.addMany,setAssetProcedureStepFields:Z.setOne,setAssetProcedureStepFieldsMany:Z.setMany,updateAssetProcedureStepFields:Z.updateOne,updateAssetProcedureStepFieldsMany:Z.updateMany,deleteAssetProcedureStepFields:Z.deleteOne,deleteAssetProcedureStepFieldsMany:Z.deleteMany}}),{initializeAssetProcedureStepFields:Dr,addAssetProcedureStepFields:zs,addAssetProcedureStepFieldsMany:PA,setAssetProcedureStepFields:OA,setAssetProcedureStepFieldsMany:_A,updateAssetProcedureStepFields:rt,updateAssetProcedureStepFieldsMany:RA,deleteAssetProcedureStepFields:Us,deleteAssetProcedureStepFieldsMany:vA}=qs.actions,Ds=t=>t.assetProcedureStepFieldsReducer.instances,Cs=d.createSelector([Ds],t=>Object.values(t)),wA=f(d.createSelector([Cs,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_step===e)))),MA=f(d.createSelector([Cs,(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])),EA=d.createSelector([Ds],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}),VA=t=>e=>e.assetProcedureStepFieldsReducer.instances[t],Cr=qs.reducer,J=P(t=>t.uuid),kr=J.getInitialState({}),ks=d.createSlice({name:"assetProcedureStepFieldValuesAttachments",initialState:kr,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,O),e=>Object.assign(e,kr)),reducers:{initializeAssetProcedureStepFieldValuesAttachments:J.initialize,addAssetProcedureStepFieldValuesAttachment:J.addOne,addAssetProcedureStepFieldValuesAttachments:J.addMany,setAssetProcedureStepFieldValuesAttachment:J.setOne,setAssetProcedureStepFieldValuesAttachments:J.setMany,updateAssetProcedureStepFieldValuesAttachment:J.updateOne,updateAssetProcedureStepFieldValuesAttachments:J.updateMany,deleteAssetProcedureStepFieldValuesAttachment:J.deleteOne,deleteAssetProcedureStepFieldValuesAttachments:J.deleteMany}}),{initializeAssetProcedureStepFieldValuesAttachments:Br,addAssetProcedureStepFieldValuesAttachment:jA,addAssetProcedureStepFieldValuesAttachments:wt,setAssetProcedureStepFieldValuesAttachment:qA,setAssetProcedureStepFieldValuesAttachments:zA,updateAssetProcedureStepFieldValuesAttachment:UA,updateAssetProcedureStepFieldValuesAttachments:$r,deleteAssetProcedureStepFieldValuesAttachment:DA,deleteAssetProcedureStepFieldValuesAttachments:Mt}=ks.actions,Bs=t=>t.assetProcedureStepFieldValuesAttachmentReducer.instances,Gr=d.createSelector([Bs],t=>Object.values(t)),CA=t=>e=>e.assetProcedureStepFieldValuesAttachmentReducer.instances[t],Lr=f(d.createSelector([Bs,(t,e)=>e],(t,e)=>{const i=new Set(e);return T(Object.values(t).filter(a=>i.has(a.uuid)))})),Nr=f(d.createSelector([Gr,(t,e)=>e],(t,e)=>T(t.filter(i=>i.field_values===e)))),Hr=ks.reducer,X=P(t=>t.uuid),Wr=X.getInitialState({}),$s=d.createSlice({name:"assetProcedureStepFieldValues",initialState:Wr,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,O),e=>Object.assign(e,Wr)),reducers:{initializeAssetProcedureStepFieldValues:X.initialize,addAssetProcedureStepFieldValues:X.addOne,addAssetProcedureStepFieldValuesMany:X.addMany,setAssetProcedureStepFieldValues:X.setOne,setAssetProcedureStepFieldValuesMany:X.setMany,updateAssetProcedureStepFieldValues:X.updateOne,updateAssetProcedureStepFieldValuesMany:X.updateMany,deleteAssetProcedureStepFieldValues:X.deleteOne,deleteAssetProcedureStepFieldValuesMany:X.deleteMany}}),{initializeAssetProcedureStepFieldValues:Kr,addAssetProcedureStepFieldValues:Gs,addAssetProcedureStepFieldValuesMany:Yr,setAssetProcedureStepFieldValues:kA,setAssetProcedureStepFieldValuesMany:BA,updateAssetProcedureStepFieldValues:dt,updateAssetProcedureStepFieldValuesMany:Zr,deleteAssetProcedureStepFieldValues:Ls,deleteAssetProcedureStepFieldValuesMany:Jr}=$s.actions,Xr=t=>t.assetProcedureStepFieldValuesReducer.instances,Et=d.createSelector([Xr],t=>Object.values(t)),$A=f(d.createSelector([Et,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset===e)))),GA=f(d.createSelector([Et,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure===e)))),LA=f(d.createSelector([Et,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_step===e)))),Ns=t=>e=>e.assetProcedureStepFieldValuesReducer.instances[t],Qr=$s.reducer,Q=P(t=>t.uuid),xr=Q.getInitialState({}),Hs=d.createSlice({name:"assetProcedureSteps",initialState:xr,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,xr)),reducers:{initializeAssetProcedureSteps:Q.initialize,setAssetProcedureStep:Q.setOne,setAssetProcedureSteps:Q.setMany,addAssetProcedureStep:Q.addOne,addAssetProcedureSteps:Q.addMany,updateAssetProcedureStep:Q.updateOne,updateAssetProcedureSteps:Q.updateMany,deleteAssetProcedureStep:Q.deleteOne,deleteAssetProcedureSteps:Q.deleteMany}}),{initializeAssetProcedureSteps:ed,setAssetProcedureStep:td,setAssetProcedureSteps:NA,addAssetProcedureStep:sd,addAssetProcedureSteps:id,updateAssetProcedureStep:Vt,updateAssetProcedureSteps:HA,deleteAssetProcedureStep:ad,deleteAssetProcedureSteps:nd}=Hs.actions,cd=Hs.reducer,ut=t=>t.assetProcedureStepReducer.instances,Ws=t=>e=>e.assetProcedureStepReducer.instances[t],rd=d.createSelector([ut],t=>Object.values(t)),WA=f(d.createSelector([ut,(t,e)=>e],(t,e)=>{const i={};for(const[a,n]of Object.entries(t))n.asset_procedure_type===e&&(i[a]=n);return _t(i)})),KA=f(d.createSelector([rd,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_type===e)))),YA=f(d.createSelector([ut,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const n=t[a];n?i.push(n):console.warn("selectAssetProcedureStepsByIds: No step exists with the id",a)}return T(i)})),dd=f(d.createSelector([ut,(t,e)=>e],(t,e)=>{if(!t[e])return T([]);const n=Ac(e,Object.values(t)).all().map(({model:c})=>c);return T(n)})),x=P(t=>t.uuid),ud=x.getInitialState({}),Ks=d.createSlice({name:"assets",initialState:ud,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,O),e=>Object.assign(e,ud)),reducers:{initializeAssets:x.initialize,addAsset:x.addOne,addAssets:x.addMany,setAsset:x.setOne,setAssets:x.setMany,updateAsset:x.updateOne,updateAssets:x.updateMany,deleteAsset:x.deleteOne,deleteAssets:x.deleteMany}}),{initializeAssets:od,addAsset:Ys,addAssets:jt,updateAsset:ot,updateAssets:ZA,deleteAsset:Zs,deleteAssets:Js,setAsset:JA,setAssets:XA}=Ks.actions,Xs=t=>t.assetReducer.instances,ld=d.createSelector([Xs],t=>T(Object.values(t))),Qs=f(d.createSelector([ld,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_type===e)))),xs=t=>e=>e.assetReducer.instances[t],hd=f(d.createSelector([Xs,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const n=t[a];n&&i.push(n)}return T(i)})),QA=t=>e=>Qs(t)(e).length,md=Ks.reducer,ee=P(t=>t.uuid),pd=ee.getInitialState({}),ei=d.createSlice({name:"assetStageCompletions",initialState:pd,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,O),e=>Object.assign(e,pd)),reducers:{initializeAssetStageCompletions:ee.initialize,addAssetStageCompletion:ee.addOne,addAssetStageCompletions:ee.addMany,setAssetStageCompletion:ee.setOne,setAssetStageCompletions:ee.setMany,updateAssetStageCompletion:ee.updateOne,updateAssetStageCompletions:ee.updateMany,deleteAssetStageCompletion:ee.deleteOne,deleteAssetStageCompletions:ee.deleteMany}}),{initializeAssetStageCompletions:yd,addAssetStageCompletion:ti,addAssetStageCompletions:si,setAssetStageCompletion:xA,setAssetStageCompletions:ef,updateAssetStageCompletion:Ad,updateAssetStageCompletions:fd,deleteAssetStageCompletion:ii,deleteAssetStageCompletions:ai}=ei.actions,Sd=ei.reducer,ni=t=>t.assetStageCompletionReducer.instances,tf=d.createSelector([ni],t=>Object.values(t)),Td=t=>e=>e.assetStageCompletionReducer.instances[t],Id=f(d.createSelector([ni,(t,e)=>e],(t,e)=>{const i=new Set(e);return T(Object.values(t).filter(a=>i.has(a.uuid)))})),te=P(t=>t.uuid),gd=te.getInitialState({}),ci=d.createSlice({name:"assetStages",initialState:gd,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,gd)),reducers:{initializeAssetStages:te.initialize,setAssetStage:te.setOne,setAssetStages:te.setMany,addAssetStage:te.addOne,addAssetStages:te.addMany,updateAssetStage:te.updateOne,updateAssetStages:te.updateMany,deleteAssetStage:te.deleteOne,deleteAssetStages:te.deleteMany}}),{initializeAssetStages:bd,setAssetStage:Fd,setAssetStages:sf,addAssetStage:ri,addAssetStages:af,updateAssetStage:qt,updateAssetStages:nf,deleteAssetStage:di,deleteAssetStages:cf}=ci.actions,Pd=ci.reducer,zt=t=>t.assetStageReducer.instances,ui=t=>e=>e.assetStageReducer.instances[t],Od=d.createSelector([zt],t=>Object.values(t)),rf=f(d.createSelector([zt,(t,e)=>e],(t,e)=>{const i={};for(const[a,n]of Object.entries(t))n.asset_procedure_type===e&&(i[a]=n);return _t(i)})),df=f(d.createSelector([Od,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_procedure_type===e)))),uf=f(d.createSelector([zt,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const n=t[a];n?i.push(n):console.warn("selectStagesFromStageIds: No stage exists with the id",a)}return T(i)})),se=P(t=>t.uuid),_d=se.getInitialState({}),oi=d.createSlice({name:"assetTypeAttachments",initialState:_d,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,_d)),reducers:{initializeAssetTypeAttachments:se.initialize,addAssetTypeAttachment:se.addOne,addAssetTypeAttachments:se.addMany,setAssetTypeAttachment:se.setOne,setAssetTypeAttachments:se.setMany,updateAssetTypeAttachment:se.updateOne,updateAssetTypeAttachments:se.updateMany,deleteAssetTypeAttachment:se.deleteOne,deleteAssetTypeAttachments:se.deleteMany}}),{initializeAssetTypeAttachments:Rd,addAssetTypeAttachment:of,addAssetTypeAttachments:li,setAssetTypeAttachment:vd,setAssetTypeAttachments:lf,updateAssetTypeAttachment:hf,updateAssetTypeAttachments:wd,deleteAssetTypeAttachment:Md,deleteAssetTypeAttachments:hi}=oi.actions,Ed=t=>t.assetTypeAttachmentReducer.instances,Vd=d.createSelector([Ed],t=>Object.values(t)),jd=t=>e=>e.assetTypeAttachmentReducer.instances[t],qd=f(d.createSelector([Vd,(t,e)=>e],(t,e)=>T(t.filter(({asset_type:i})=>e===i)))),zd=oi.reducer,ie=P(t=>t.uuid),Ud=ie.getInitialState({}),mi=d.createSlice({name:"assetTypeFieldsAttachments",initialState:Ud,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,Ud)),reducers:{initializeAssetTypeFieldsAttachments:ie.initialize,addAssetTypeFieldsAttachment:ie.addOne,addAssetTypeFieldsAttachments:ie.addMany,setAssetTypeFieldsAttachment:ie.setOne,setAssetTypeFieldsAttachments:ie.setMany,updateAssetTypeFieldsAttachment:ie.updateOne,updateAssetTypeFieldsAttachments:ie.updateMany,deleteAssetTypeFieldsAttachment:ie.deleteOne,deleteAssetTypeFieldsAttachments:ie.deleteMany}}),{initializeAssetTypeFieldsAttachments:Dd,addAssetTypeFieldsAttachment:mf,addAssetTypeFieldsAttachments:Cd,setAssetTypeFieldsAttachment:pf,setAssetTypeFieldsAttachments:yf,updateAssetTypeFieldsAttachment:Af,updateAssetTypeFieldsAttachments:kd,deleteAssetTypeFieldsAttachment:ff,deleteAssetTypeFieldsAttachments:Bd}=mi.actions,$d=t=>t.assetTypeFieldsAttachmentReducer.instances,Gd=d.createSelector([$d],t=>Object.values(t)),Sf=f(d.createSelector([Gd,(t,e)=>e],(t,e)=>T(t.filter(i=>i.fields_revision===e)))),Tf=t=>e=>e.assetTypeFieldsAttachmentReducer.instances[t],Ld=mi.reducer,ae=P(t=>t.uuid),Nd=ae.getInitialState({}),pi=d.createSlice({name:"assetTypeFields",initialState:Nd,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,Nd)),reducers:{initializeAssetTypeFields:ae.initialize,addAssetTypeFields:ae.addOne,addAssetTypeFieldsMany:ae.addMany,setAssetTypeFields:ae.setOne,setAssetTypeFieldsMany:ae.setMany,updateAssetTypeFields:ae.updateOne,updateAssetTypeFieldsMany:ae.updateMany,deleteAssetTypeFields:ae.deleteOne,deleteAssetTypeFieldsMany:ae.deleteMany}}),{initializeAssetTypeFields:Hd,addAssetTypeFields:Wd,addAssetTypeFieldsMany:If,setAssetTypeFields:gf,setAssetTypeFieldsMany:bf,updateAssetTypeFields:Kd,updateAssetTypeFieldsMany:Ff,deleteAssetTypeFields:Yd,deleteAssetTypeFieldsMany:Pf}=pi.actions,Zd=t=>t.assetTypeFieldsReducer.instances,Ut=d.createSelector([Zd],t=>Object.values(t)),Of=f(d.createSelector([Ut,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_type===e)))),_f=f(d.createSelector([Ut,(t,e)=>e],(t,e)=>t.filter(i=>i.asset_type===e).sort((i,a)=>i.submitted_at>a.submitted_at?-1:1)[0])),Rf=t=>e=>e.assetTypeFieldsReducer.instances[t],Jd=pi.reducer,ne=P(t=>t.uuid),Xd=ne.getInitialState({}),yi=d.createSlice({name:"assetTypeFieldValuesAttachments",initialState:Xd,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,O),e=>Object.assign(e,Xd)),reducers:{initializeAssetTypeFieldValuesAttachments:ne.initialize,addAssetTypeFieldValuesAttachment:ne.addOne,addAssetTypeFieldValuesAttachments:ne.addMany,setAssetTypeFieldValuesAttachment:ne.setOne,setAssetTypeFieldValuesAttachments:ne.setMany,updateAssetTypeFieldValuesAttachment:ne.updateOne,updateAssetTypeFieldValuesAttachments:ne.updateMany,deleteAssetTypeFieldValuesAttachment:ne.deleteOne,deleteAssetTypeFieldValuesAttachments:ne.deleteMany}}),{initializeAssetTypeFieldValuesAttachments:Qd,addAssetTypeFieldValuesAttachment:vf,addAssetTypeFieldValuesAttachments:Dt,setAssetTypeFieldValuesAttachment:wf,setAssetTypeFieldValuesAttachments:Mf,updateAssetTypeFieldValuesAttachment:Ef,updateAssetTypeFieldValuesAttachments:xd,deleteAssetTypeFieldValuesAttachment:Vf,deleteAssetTypeFieldValuesAttachments:Ct}=yi.actions,Ai=t=>t.assetTypeFieldValuesAttachmentReducer.instances,eu=d.createSelector([Ai],t=>Object.values(t)),jf=t=>e=>e.assetTypeFieldValuesAttachmentReducer.instances[t],tu=f(d.createSelector([Ai,(t,e)=>e],(t,e)=>{const i=new Set(e);return T(Object.values(t).filter(a=>i.has(a.uuid)))})),su=f(d.createSelector([eu,(t,e)=>e],(t,e)=>T(t.filter(i=>i.field_values===e)))),iu=yi.reducer,ce=P(t=>t.uuid),au=ce.getInitialState({}),fi=d.createSlice({name:"assetTypeFieldValues",initialState:au,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,O),e=>Object.assign(e,au)),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:nu,addAssetTypeFieldValues:Si,addAssetTypeFieldValuesMany:cu,setAssetTypeFieldValues:qf,setAssetTypeFieldValuesMany:zf,updateAssetTypeFieldValues:lt,updateAssetTypeFieldValuesMany:ru,deleteAssetTypeFieldValues:Ti,deleteAssetTypeFieldValuesMany:du}=fi.actions,uu=t=>t.assetTypeFieldValuesReducer.instances,Ii=d.createSelector([uu],t=>Object.values(t)),Uf=f(d.createSelector([Ii,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset===e)))),Df=f(d.createSelector([Ut,Ii,(t,e)=>e],(t,e,i)=>{const a=new Set(t.filter(n=>n.asset_type===i).map(n=>n.uuid));return T(e.filter(n=>a.has(n.fields_revision)))})),gi=t=>e=>e.assetTypeFieldValuesReducer.instances[t],ou=fi.reducer,re=P(t=>t.uuid),lu=re.getInitialState({}),bi=d.createSlice({name:"assetTypeIdentifiers",initialState:lu,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,lu)),reducers:{initializeAssetTypeIdentifiers:re.initialize,addAssetTypeIdentifier:re.addOne,addAssetTypeIdentifiers:re.addMany,setAssetTypeIdentifier:re.setOne,setAssetTypeIdentifiers:re.setMany,updateAssetTypeIdentifier:re.updateOne,updateAssetTypeIdentifiers:re.updateMany,deleteAssetTypeIdentifier:re.deleteOne,deleteAssetTypeIdentifiers:re.deleteMany}}),{initializeAssetTypeIdentifiers:hu,addAssetTypeIdentifier:Fi,addAssetTypeIdentifiers:Cf,setAssetTypeIdentifier:kf,setAssetTypeIdentifiers:Bf,updateAssetTypeIdentifier:ht,updateAssetTypeIdentifiers:$f,deleteAssetTypeIdentifier:Pi,deleteAssetTypeIdentifiers:Gf}=bi.actions,mu=t=>t.assetTypeIdentifierReducer.instances,pu=d.createSelector([mu],t=>Object.values(t)),Oi=t=>e=>e.assetTypeIdentifierReducer.instances[t],Lf=f(d.createSelector([pu,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_type===e)))),yu=bi.reducer,de=P(t=>t.uuid),Au=de.getInitialState({}),_i=d.createSlice({name:"assetTypeIdentifierValues",initialState:Au,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,O),e=>Object.assign(e,Au)),reducers:{initializeAssetTypeIdentifierValues:de.initialize,addAssetTypeIdentifierValue:de.addOne,addAssetTypeIdentifierValues:de.addMany,setAssetTypeIdentifierValue:de.setOne,setAssetTypeIdentifierValues:de.setMany,updateAssetTypeIdentifierValue:de.updateOne,updateAssetTypeIdentifierValues:de.updateMany,deleteAssetTypeIdentifierValue:de.deleteOne,deleteAssetTypeIdentifierValues:de.deleteMany}}),{initializeAssetTypeIdentifierValues:fu,addAssetTypeIdentifierValue:Ri,addAssetTypeIdentifierValues:Nf,setAssetTypeIdentifierValue:Hf,setAssetTypeIdentifierValues:Wf,updateAssetTypeIdentifierValue:mt,updateAssetTypeIdentifierValues:Kf,deleteAssetTypeIdentifierValue:vi,deleteAssetTypeIdentifierValues:Yf}=_i.actions,Su=t=>t.assetTypeIdentifierValueReducer.instances,wi=d.createSelector([Su],t=>Object.values(t)),Mi=t=>e=>e.assetTypeIdentifierValueReducer.instances[t],Zf=f(d.createSelector([wi,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset===e)))),Jf=f(d.createSelector([wi,(t,e)=>e],(t,e)=>T(t.filter(i=>i.asset_type_identifier===e)))),Tu=_i.reducer,ue=P(t=>t.uuid),Iu=ue.getInitialState({}),Ei=d.createSlice({name:"assetTypes",initialState:Iu,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,Iu)),reducers:{initializeAssetTypes:ue.initialize,setAssetType:ue.setOne,setAssetTypes:ue.setMany,addAssetType:ue.addOne,addAssetTypes:ue.addMany,updateAssetType:ue.updateOne,updateAssetTypes:ue.updateMany,deleteAssetType:ue.deleteOne,deleteAssetTypes:ue.deleteMany}}),{initializeAssetTypes:gu,setAssetType:Xf,setAssetTypes:Qf,addAssetType:Vi,addAssetTypes:xf,updateAssetType:pt,updateAssetTypes:eS,deleteAssetType:ji,deleteAssetTypes:tS}=Ei.actions,qi=t=>t.assetTypeReducer.instances,bu=d.createSelector([qi],t=>Object.values(t)),zi=t=>e=>e.assetTypeReducer.instances[t],sS=f(d.createSelector([qi,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const n=t[a];n?i.push(n):console.warn("selectAssetTypesByIds: No assetType exists with the id",a)}return T(i)})),iS=f(d.createSelector([bu,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),Fu=Ei.reducer,Pu={accessToken:"",refreshToken:"",isLoggedIn:!1},kt=d.createSlice({name:"auth",initialState:Pu,extraReducers:t=>t.addCase(g,e=>Object.assign(e,Pu)),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||kt.caseReducers.clearTokens(t),t.isLoggedIn=e.payload}}}),{setTokens:aS,clearTokens:nS,setLoggedIn:Ou}=kt.actions,cS=t=>t.authReducer.accessToken,rS=t=>t.authReducer.isLoggedIn,_u=kt.reducer,oe=P(t=>t.uuid),Ru=oe.getInitialState({}),Ui=d.createSlice({name:"categories",initialState:Ru,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,Ru)),reducers:{initializeCategories:oe.initialize,addCategory:oe.addOne,addCategories:oe.addMany,setCategory:oe.setOne,setCategories:oe.setMany,updateCategory:oe.updateOne,updateCategories:oe.updateMany,deleteCategory:oe.deleteOne,deleteCategories:oe.deleteMany}}),{initializeCategories:vu,addCategory:Di,addCategories:dS,setCategory:uS,setCategories:oS,updateCategory:wu,updateCategories:lS,deleteCategory:Mu,deleteCategories:hS}=Ui.actions,Ci=t=>t.categoryReducer.instances,Eu=d.createSelector([Ci],t=>Object.values(t)),ki=t=>e=>e.categoryReducer.instances[t],mS=f(d.createSelector([Ci,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const n=t[a];n?i.push(n):console.warn("selectCategoryByIds: No category exists with the id",a)}return T(i)})),pS=f(d.createSelector([Eu,(t,e)=>e],(t,e)=>T(t.filter(i=>i.project===e)))),Vu=Ui.reducer,le=P(t=>t.uuid),ju=le.getInitialState({}),Bi=d.createSlice({name:"documentAttachments",initialState:ju,extraReducers:t=>t.addCase(g,e=>Object.assign(e,ju)),reducers:{initializeDocumentAttachments:le.initialize,addDocumentAttachment:le.addOne,addDocumentAttachments:le.addMany,setDocumentAttachment:le.setOne,setDocumentAttachments:le.setMany,updateDocumentAttachment:le.updateOne,updateDocumentAttachments:le.updateMany,deleteDocumentAttachment:le.deleteOne,deleteDocumentAttachments:le.deleteMany}}),{initializeDocumentAttachments:qu,addDocumentAttachment:yS,addDocumentAttachments:zu,setDocumentAttachment:Uu,setDocumentAttachments:AS,updateDocumentAttachment:fS,updateDocumentAttachments:Du,deleteDocumentAttachment:Cu,deleteDocumentAttachments:ku}=Bi.actions,Bu=t=>t.documentAttachmentReducer.instances,$u=d.createSelector([Bu],t=>Object.values(t)),Gu=t=>e=>e.documentAttachmentReducer.instances[t],SS=f(d.createSelector([$u,(t,e)=>e],(t,e)=>T(t.filter(({document:i})=>e===i)))),Lu=Bi.reducer,Nu={documents:{}},$i=d.createSlice({name:"documents",initialState:Nu,extraReducers:t=>t.addCase(g,e=>{Object.assign(e,Nu)}),reducers:{setDocuments:(t,e)=>{if(e.payload.filter(pc).length!==e.payload.length)throw new Error("Tried to use setIssues reducer with duplicate ID's");t.documents=hc(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 n=t.documents[a.parent_document];t.documents[a.parent_document]={...n,children_documents:n.children_documents.filter(c=>c!==a.uuid)}}delete t.documents[i]}}}}),{setDocuments:Hu,addDocuments:Wu,updateDocuments:xe,removeDocuments:Gi}=$i.actions,Bt=t=>t.documentsReducer.documents,Li=d.createSelector([Bt],t=>Object.values(t)),Ku=t=>e=>e.documentsReducer.documents[t],TS=f(d.createSelector([Bt,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const n=t[a];n?i.push(n):console.warn("selectDocumentByIds: No document exists with the id",a)}return T(i)})),IS=f(d.createSelector([Li,(t,e)=>e],(t,e)=>t.filter(i=>i.project===e))),gS=f(d.createSelector([Li,(t,e)=>e],(t,e)=>t.filter(i=>i.organization===e))),Yu=$i.reducer,he=P(t=>t.uuid),Zu=he.getInitialState({}),Ni=d.createSlice({name:"emailDomains",initialState:Zu,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,Zu)),reducers:{initializeEmailDomains:he.initialize,addEmailDomain:he.addOne,addEmailDomains:he.addMany,setEmailDomain:he.setOne,setEmailDomains:he.setMany,updateEmailDomain:he.updateOne,updateEmailDomains:he.updateMany,deleteEmailDomain:he.deleteOne,deleteEmailDomains:he.deleteMany}}),{initializeEmailDomains:Ju,addEmailDomain:Xu,addEmailDomains:bS,setEmailDomain:FS,setEmailDomains:PS,updateEmailDomain:OS,updateEmailDomains:_S,deleteEmailDomain:Qu,deleteEmailDomains:RS}=Ni.actions,xu=t=>t.emailDomainsReducer.instances,eo=d.createSelector([xu],t=>Object.values(t)),vS=f(d.createSelector([eo,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),to=Ni.reducer,so={s3Urls:{}},io=1e3*60*60,wS=io*24*7,Hi=d.createSlice({name:"file",initialState:so,extraReducers:t=>t.addCase(g,e=>Object.assign(e,so)),reducers:{setUploadUrl:(t,e)=>{const{url:i,fields:a,sha1:n}=e.payload,c=new Date,r=new Date(c.getTime()+wS);t.s3Urls[n]={url:i,fields:a,exp:r.getTime()}}}}),{setUploadUrl:ao}=Hi.actions,no=t=>e=>{const i=e.fileReducer.s3Urls[t];if(!i)return;const a=new Date().getTime();if(!((i.exp??a)-a<io))return i},co=Hi.reducer,me=P(t=>t.uuid),ro=me.getInitialState({}),Wi=d.createSlice({name:"formIdentifiers",initialState:ro,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,ro)),reducers:{initializeFormIdentifiers:me.initialize,addFormIdentifier:me.addOne,addFormIdentifiers:me.addMany,setFormIdentifier:me.setOne,setFormIdentifiers:me.setMany,updateFormIdentifier:me.updateOne,updateFormIdentifiers:me.updateMany,deleteFormIdentifier:me.deleteOne,deleteFormIdentifiers:me.deleteMany}}),{initializeFormIdentifiers:uo,addFormIdentifier:Ki,addFormIdentifiers:MS,setFormIdentifier:ES,setFormIdentifiers:VS,updateFormIdentifier:yt,updateFormIdentifiers:jS,deleteFormIdentifier:Yi,deleteFormIdentifiers:qS}=Wi.actions,oo=t=>t.formIdentifierReducer.instances,lo=d.createSelector([oo],t=>Object.values(t)),Zi=t=>e=>e.formIdentifierReducer.instances[t],zS=f(d.createSelector([lo,(t,e)=>e],(t,e)=>T(t.filter(i=>i.form===e)))),ho=Wi.reducer,pe=P(t=>t.uuid),mo=pe.getInitialState({}),Ji=d.createSlice({name:"formIdentifierValues",initialState:mo,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,mo)),reducers:{initializeFormIdentifierValues:pe.initialize,addFormIdentifierValue:pe.addOne,addFormIdentifierValues:pe.addMany,setFormIdentifierValue:pe.setOne,setFormIdentifierValues:pe.setMany,updateFormIdentifierValue:pe.updateOne,updateFormIdentifierValues:pe.updateMany,deleteFormIdentifierValue:pe.deleteOne,deleteFormIdentifierValues:pe.deleteMany}}),{initializeFormIdentifierValues:po,addFormIdentifierValue:Xi,addFormIdentifierValues:US,setFormIdentifierValue:DS,setFormIdentifierValues:CS,updateFormIdentifierValue:At,updateFormIdentifierValues:kS,deleteFormIdentifierValue:Qi,deleteFormIdentifierValues:BS}=Ji.actions,yo=t=>t.formIdentifierValueReducer.instances,xi=d.createSelector([yo],t=>Object.values(t)),ea=t=>e=>e.formIdentifierValueReducer.instances[t],$S=f(d.createSelector([xi,(t,e)=>e],(t,e)=>T(t.filter(i=>i.form_submission===e)))),GS=f(d.createSelector([xi,(t,e)=>e],(t,e)=>T(t.filter(i=>i.form_identifier===e)))),Ao=Ji.reducer,ye=P(t=>t.uuid),fo=ye.getInitialState({}),ta=d.createSlice({name:"formRevisionAttachments",initialState:fo,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,fo)),reducers:{initializeFormRevisionAttachments:ye.initialize,addFormRevisionAttachment:ye.addOne,addFormRevisionAttachments:ye.addMany,setFormRevisionAttachment:ye.setOne,setFormRevisionAttachments:ye.setMany,updateFormRevisionAttachment:ye.updateOne,updateFormRevisionAttachments:ye.updateMany,deleteFormRevisionAttachment:ye.deleteOne,deleteFormRevisionAttachments:ye.deleteMany}}),{initializeFormRevisionAttachments:So,addFormRevisionAttachment:LS,addFormRevisionAttachments:To,setFormRevisionAttachment:NS,setFormRevisionAttachments:HS,updateFormRevisionAttachment:WS,updateFormRevisionAttachments:Io,deleteFormRevisionAttachment:KS,deleteFormRevisionAttachments:go}=ta.actions,bo=t=>t.formRevisionAttachmentReducer.instances,YS=f(d.createSelector([bo,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.form_revision===e)))),Fo=ta.reducer,Ae=P(t=>t.uuid),Po=Ae.getInitialState({}),sa=d.createSlice({name:"formRevisions",initialState:Po,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,Po)),reducers:{initializeFormRevisions:Ae.initialize,addFormRevision:Ae.addOne,addFormRevisions:Ae.addMany,setFormRevision:Ae.setOne,setFormRevisions:Ae.setMany,updateFormRevision:Ae.updateOne,updateFormRevisions:Ae.updateMany,deleteFormRevision:Ae.deleteOne,deleteFormRevisions:Ae.deleteMany}}),{initializeFormRevisions:Oo,addFormRevision:ia,addFormRevisions:_o,setFormRevision:Ro,setFormRevisions:ZS,updateFormRevision:JS,updateFormRevisions:XS,deleteFormRevision:aa,deleteFormRevisions:vo}=sa.actions,na=t=>t.formRevisionReducer.instances,ca=d.createSelector([na],t=>Object.values(t)),QS=t=>e=>e.formRevisionReducer.instances[t],xS=f(d.createSelector([ca,(t,e)=>e],(t,e)=>t.filter(i=>i.form===e).sort((i,a)=>i.submitted_at>a.submitted_at?-1:1)[0])),wo=f(d.createSelector([ca,(t,e)=>e],(t,e)=>T(t.filter(i=>i.form===e)))),Mo=sa.reducer,fe=P(t=>t.uuid),Eo=fe.getInitialState({}),ra=d.createSlice({name:"forms",initialState:Eo,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,Eo)),reducers:{initializeForms:fe.initialize,addForm:fe.addOne,addForms:fe.addMany,setForm:fe.setOne,setForms:fe.setMany,updateForm:fe.updateOne,updateForms:fe.updateMany,deleteForm:fe.deleteOne,deleteForms:fe.deleteMany}}),{initializeForms:Vo,addForm:da,addForms:eT,setForm:tT,setForms:sT,updateForm:iT,updateForms:aT,deleteForm:ua,deleteForms:nT}=ra.actions,jo=ra.reducer,qo=t=>t.formReducer.instances,zo=d.createSelector([qo],t=>Object.values(t)),Uo=t=>e=>e.formReducer.instances[t],cT=f(d.createSelector([zo,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),Se=P(t=>t.uuid),Do=Se.getInitialState({}),oa=d.createSlice({name:"formSubmissionAttachments",initialState:Do,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,Do)),reducers:{initializeFormSubmissionAttachments:Se.initialize,addFormSubmissionAttachment:Se.addOne,addFormSubmissionAttachments:Se.addMany,setFormSubmissionAttachment:Se.setOne,setFormSubmissionAttachments:Se.setMany,updateFormSubmissionAttachment:Se.updateOne,updateFormSubmissionAttachments:Se.updateMany,deleteFormSubmissionAttachment:Se.deleteOne,deleteFormSubmissionAttachments:Se.deleteMany}}),{initializeFormSubmissionAttachments:Co,addFormSubmissionAttachment:rT,addFormSubmissionAttachments:$t,setFormSubmissionAttachment:dT,setFormSubmissionAttachments:uT,updateFormSubmissionAttachment:oT,updateFormSubmissionAttachments:ko,deleteFormSubmissionAttachment:lT,deleteFormSubmissionAttachments:Gt}=oa.actions,Bo=t=>t.formSubmissionAttachmentReducer.instances,la=d.createSelector([Bo],t=>Object.values(t)),$o=f(d.createSelector([la,(t,e)=>e],(t,e)=>{const i=new Set(e);return T(t.filter(a=>i.has(a.uuid)))})),Go=f(d.createSelector([la,(t,e)=>e],(t,e)=>T(t.filter(i=>i.form_submission===e)))),Lo=oa.reducer,Te=P(t=>t.uuid),No=Te.getInitialState({}),ha=d.createSlice({name:"formSubmissions",initialState:No,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,No)),reducers:{initializeFormSubmissions:Te.initialize,setFormSubmission:Te.setOne,setFormSubmissions:Te.setMany,addFormSubmission:Te.addOne,addFormSubmissions:Te.addMany,updateFormSubmission:Te.updateOne,updateFormSubmissions:Te.updateMany,deleteFormSubmission:Te.deleteOne,deleteFormSubmissions:Te.deleteMany}}),{initializeFormSubmissions:Ho,setFormSubmission:Lt,setFormSubmissions:hT,addFormSubmission:ma,addFormSubmissions:Wo,updateFormSubmission:Ko,updateFormSubmissions:mT,deleteFormSubmission:pa,deleteFormSubmissions:Yo}=ha.actions,ya=t=>t.formSubmissionReducer.instances,pT=d.createSelector([ya],t=>Object.values(t)),Aa=t=>e=>e.formSubmissionReducer.instances[t],Zo=f(d.createSelector([ya,na,(t,e)=>e],(t,e,i)=>{const a=new Set;for(const n of Object.values(e))n.form===i&&a.add(n.uuid);return Object.values(t).filter(n=>a.has(n.form_revision))})),Jo=ha.reducer,Ie=P(t=>t.uuid),Xo=Ie.getInitialState({}),fa=d.createSlice({name:"geoImages",initialState:Xo,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,O),e=>Object.assign(e,Xo)),reducers:{initializeGeoImages:Ie.initialize,setGeoImage:Ie.setOne,setGeoImages:Ie.setMany,addGeoImage:Ie.addOne,addGeoImages:Ie.addMany,updateGeoImage:Ie.updateOne,updateGeoImages:Ie.updateMany,deleteGeoImage:Ie.deleteOne,deleteGeoImages:Ie.deleteMany}}),{initializeGeoImages:Qo,setGeoImage:ft,setGeoImages:xo,addGeoImage:el,addGeoImages:tl,updateGeoImage:sl,updateGeoImages:yT,deleteGeoImage:Sa,deleteGeoImages:il}=fa.actions,al=t=>t.geoImageReducer.instances,nl=d.createSelector([al],t=>Object.values(t)),Ta=t=>e=>e.geoImageReducer.instances[t],AT=f(d.createSelector([nl,(t,e)=>e],(t,e)=>T(t.filter(i=>i.project===e)))),cl=fa.reducer,ge=P(t=>t.uuid),rl=ge.getInitialState({}),Ia=d.createSlice({name:"issueAssociations",initialState:rl,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,O),e=>Object.assign(e,rl)),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:dl,setIssueAssociations:fT,setIssueAssociation:ST,updateIssueAssociation:ul,updateIssueAssociations:TT,addIssueAssociation:ga,addIssueAssociations:ba,deleteIssueAssociation:Fa,deleteIssueAssociations:Pa}=Ia.actions,St=t=>t.issueAssociationReducer.instances,IT=d.createSelector([St],t=>Object.values(t)),ol=t=>e=>e.issueAssociationReducer.instances[t],ll=f(d.createSelector([St,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.associated_issue===e)))),hl=f(d.createSelector([St,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.issue===e)))),ml=f(d.createSelector([St,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.asset===e)))),pl=Ia.reducer,be=P(t=>t.uuid),yl=be.getInitialState({}),Oa=d.createSlice({name:"issueAttachments",initialState:yl,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,O),e=>Object.assign(e,yl)),reducers:{initializeIssueAttachments:be.initialize,addIssueAttachment:be.addOne,addIssueAttachments:be.addMany,setIssueAttachment:be.setOne,setIssueAttachments:be.setMany,updateIssueAttachment:be.updateOne,updateIssueAttachments:be.updateMany,deleteIssueAttachment:be.deleteOne,deleteIssueAttachments:be.deleteMany}}),{initializeIssueAttachments:_a,addIssueAttachment:gT,addIssueAttachments:Ra,setIssueAttachment:Al,setIssueAttachments:bT,updateIssueAttachment:FT,updateIssueAttachments:fl,deleteIssueAttachment:Sl,deleteIssueAttachments:va}=Oa.actions,Tl=t=>t.issueAttachmentReducer.instances,Il=d.createSelector([Tl],t=>Object.values(t)),gl=f(d.createSelector([Il,(t,e)=>e],(t,e)=>T(t.filter(({issue:i})=>e===i)))),bl=t=>e=>e.issueAttachmentReducer.instances[t],Fl=Oa.reducer,Fe=P(t=>t.uuid),Pl=Fe.getInitialState({}),wa=d.createSlice({name:"issueCommentAttachments",initialState:Pl,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,O),e=>Object.assign(e,Pl)),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:Ma,addIssueCommentAttachment:PT,addIssueCommentAttachments:Ol,setIssueCommentAttachment:_l,setIssueCommentAttachments:OT,updateIssueCommentAttachment:_T,updateIssueCommentAttachments:Rl,deleteIssueCommentAttachment:vl,deleteIssueCommentAttachments:wl}=wa.actions,Ml=t=>t.issueCommentAttachmentReducer.instances,El=d.createSelector([Ml],t=>Object.values(t)),Vl=t=>e=>e.issueCommentAttachmentReducer.instances[t],RT=f(d.createSelector([El,(t,e)=>e],(t,e)=>T(t.filter(({issue_comment:i})=>e===i)))),jl=wa.reducer,Pe=P(t=>t.uuid),ql=Pe.getInitialState({}),Ea=d.createSlice({name:"issueComments",initialState:ql,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,O),e=>Object.assign(e,ql)),reducers:{initializeIssueComments:Pe.initialize,addIssueComment:Pe.addOne,addIssueComments:Pe.addMany,setIssueComment:Pe.setOne,setIssueComments:Pe.setMany,updateIssueComment:Pe.updateOne,updateIssueComments:Pe.updateMany,deleteIssueComment:Pe.deleteOne,deleteIssueComments:Pe.deleteMany}}),{initializeIssueComments:vT,addIssueComment:Va,addIssueComments:wT,setIssueComment:ja,setIssueComments:zl,updateIssueComment:MT,updateIssueComments:ET,deleteIssueComment:qa,deleteIssueComments:VT}=Ea.actions,Ul=t=>t.issueCommentReducer.instances,za=t=>e=>e.issueCommentReducer.instances[t],jT=f(d.createSelector([Ul,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.issue===e)))),Dl=Ea.reducer,Oe=P(t=>t.uuid),Cl=Oe.getInitialState({}),Ua=d.createSlice({name:"issues",initialState:Cl,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,O),e=>Object.assign(e,Cl)),reducers:{initializeIssues:Oe.initialize,addIssue:Oe.addOne,addIssues:Oe.addMany,setIssue:Oe.setOne,setIssues:Oe.setMany,updateIssue:Oe.updateOne,updateIssues:Oe.updateMany,deleteIssue:Oe.deleteOne,deleteIssues:Oe.deleteMany}}),{initializeIssues:kl,addIssue:Da,addIssues:Bl,setIssue:qT,setIssues:zT,updateIssue:Nt,updateIssues:UT,deleteIssue:Ca,deleteIssues:$l}=Ua.actions,ka=t=>t.issueReducer.instances,Ba=d.createSelector([ka],t=>Object.values(t)),$a=t=>e=>e.issueReducer.instances[t],DT=f(d.createSelector([ka,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const n=t[a];n?i.push(n):console.warn("selectIssuesByIds: No issue exists with the id",a)}return T(i)})),CT=f(d.createSelector([Ba,(t,e)=>e],(t,e)=>t.filter(i=>i.project===e))),Gl=f(d.createSelector([Ba,(t,e)=>e],(t,e)=>t.filter(i=>i.issue_type===e))),Ll=Ua.reducer,_e=P(t=>t.uuid),Nl=_e.getInitialState({}),Ga=d.createSlice({name:"issueTypeAttachments",initialState:Nl,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,Nl)),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:La,addIssueTypeAttachment:kT,addIssueTypeAttachments:Hl,setIssueTypeAttachment:Wl,setIssueTypeAttachments:BT,updateIssueTypeAttachment:$T,updateIssueTypeAttachments:Kl,deleteIssueTypeAttachment:Yl,deleteIssueTypeAttachments:Zl}=Ga.actions,Jl=t=>t.issueTypeAttachmentReducer.instances,Xl=d.createSelector([Jl],t=>Object.values(t)),Ql=t=>e=>e.issueTypeAttachmentReducer.instances[t],GT=f(d.createSelector([Xl,(t,e)=>e],(t,e)=>T(t.filter(({issue_type:i})=>e===i)))),xl=Ga.reducer,Re=P(t=>t.uuid),eh=Re.getInitialState({}),Na=d.createSlice({name:"issueTypeFieldsAttachments",initialState:eh,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,eh)),reducers:{initializeIssueTypeFieldsAttachments:Re.initialize,addIssueTypeFieldsAttachment:Re.addOne,addIssueTypeFieldsAttachments:Re.addMany,setIssueTypeFieldsAttachment:Re.setOne,setIssueTypeFieldsAttachments:Re.setMany,updateIssueTypeFieldsAttachment:Re.updateOne,updateIssueTypeFieldsAttachments:Re.updateMany,deleteIssueTypeFieldsAttachment:Re.deleteOne,deleteIssueTypeFieldsAttachments:Re.deleteMany}}),{initializeIssueTypeFieldsAttachments:th,addIssueTypeFieldsAttachment:LT,addIssueTypeFieldsAttachments:sh,setIssueTypeFieldsAttachment:NT,setIssueTypeFieldsAttachments:HT,updateIssueTypeFieldsAttachment:WT,updateIssueTypeFieldsAttachments:ih,deleteIssueTypeFieldsAttachment:KT,deleteIssueTypeFieldsAttachments:ah}=Na.actions,nh=t=>t.issueTypeFieldsAttachmentReducer.instances,ch=d.createSelector([nh],t=>Object.values(t)),YT=f(d.createSelector([ch,(t,e)=>e],(t,e)=>T(t.filter(i=>i.fields_revision===e)))),ZT=t=>e=>e.issueTypeFieldsAttachmentReducer.instances[t],rh=Na.reducer,ve=P(t=>t.uuid),dh=ve.getInitialState({}),Ha=d.createSlice({name:"issueTypeFieldValues",initialState:dh,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,O),e=>Object.assign(e,dh)),reducers:{initializeIssueTypeFieldValues:ve.initialize,addIssueTypeFieldValues:ve.addOne,addIssueTypeFieldValuesMany:ve.addMany,setIssueTypeFieldValues:ve.setOne,setIssueTypeFieldValuesMany:ve.setMany,updateIssueTypeFieldValues:ve.updateOne,updateIssueTypeFieldValuesMany:ve.updateMany,deleteIssueTypeFieldValues:ve.deleteOne,deleteIssueTypeFieldValuesMany:ve.deleteMany}}),{initializeIssueTypeFieldValues:uh,addIssueTypeFieldValues:Wa,addIssueTypeFieldValuesMany:JT,setIssueTypeFieldValues:XT,setIssueTypeFieldValuesMany:QT,updateIssueTypeFieldValues:Tt,updateIssueTypeFieldValuesMany:xT,deleteIssueTypeFieldValues:Ka,deleteIssueTypeFieldValuesMany:eI}=Ha.actions,oh=t=>t.issueTypeFieldValuesReducer.instances,Ya=d.createSelector([oh],t=>Object.values(t)),tI=f(d.createSelector([Ya,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue===e)))),Za=t=>e=>e.issueTypeFieldValuesReducer.instances[t],lh=Ha.reducer,we=P(t=>t.uuid),hh=we.getInitialState({}),Ja=d.createSlice({name:"issueTypeFields",initialState:hh,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,hh)),reducers:{initializeIssueTypeFields:we.initialize,addIssueTypeFields:we.addOne,addIssueTypeFieldsMany:we.addMany,setIssueTypeFields:we.setOne,setIssueTypeFieldsMany:we.setMany,updateIssueTypeFields:we.updateOne,updateIssueTypeFieldsMany:we.updateMany,deleteIssueTypeFields:we.deleteOne,deleteIssueTypeFieldsMany:we.deleteMany}}),{initializeIssueTypeFields:mh,addIssueTypeFields:ph,addIssueTypeFieldsMany:sI,setIssueTypeFields:iI,setIssueTypeFieldsMany:aI,updateIssueTypeFields:yh,updateIssueTypeFieldsMany:nI,deleteIssueTypeFields:Ah,deleteIssueTypeFieldsMany:cI}=Ja.actions,fh=t=>t.issueTypeFieldsReducer.instances,Ht=d.createSelector([fh],t=>Object.values(t)),rI=f(d.createSelector([Ht,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue_type===e)))),dI=f(d.createSelector([Ht,(t,e)=>e],(t,e)=>t.filter(i=>i.issue_type===e).sort((i,a)=>i.submitted_at>a.submitted_at?-1:1)[0])),uI=f(d.createSelector([Ht,Ya,(t,e)=>e],(t,e,i)=>{const a=new Set(t.filter(n=>n.issue_type===i).map(n=>n.uuid));return T(e.filter(n=>a.has(n.fields_revision)))})),oI=t=>e=>e.issueTypeFieldsReducer.instances[t],Sh=Ja.reducer,Me=P(t=>t.uuid),Th=Me.getInitialState({}),Xa=d.createSlice({name:"issueTypeFieldValuesAttachments",initialState:Th,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,O),e=>Object.assign(e,Th)),reducers:{initializeIssueTypeFieldValuesAttachments:Me.initialize,addIssueTypeFieldValuesAttachment:Me.addOne,addIssueTypeFieldValuesAttachments:Me.addMany,setIssueTypeFieldValuesAttachment:Me.setOne,setIssueTypeFieldValuesAttachments:Me.setMany,updateIssueTypeFieldValuesAttachment:Me.updateOne,updateIssueTypeFieldValuesAttachments:Me.updateMany,deleteIssueTypeFieldValuesAttachment:Me.deleteOne,deleteIssueTypeFieldValuesAttachments:Me.deleteMany}}),{initializeIssueTypeFieldValuesAttachments:Ih,addIssueTypeFieldValuesAttachment:lI,addIssueTypeFieldValuesAttachments:Wt,setIssueTypeFieldValuesAttachment:hI,setIssueTypeFieldValuesAttachments:mI,updateIssueTypeFieldValuesAttachment:pI,updateIssueTypeFieldValuesAttachments:gh,deleteIssueTypeFieldValuesAttachment:yI,deleteIssueTypeFieldValuesAttachments:Kt}=Xa.actions,bh=t=>t.issueTypeFieldValuesAttachmentReducer.instances,Qa=d.createSelector([bh],t=>Object.values(t)),AI=t=>e=>e.issueTypeFieldValuesAttachmentReducer.instances[t],Fh=f(d.createSelector([Qa,(t,e)=>e],(t,e)=>{const i=new Set(e);return T(t.filter(a=>i.has(a.uuid)))})),Ph=f(d.createSelector([Qa,(t,e)=>e],(t,e)=>T(t.filter(i=>i.field_values===e)))),Oh=Xa.reducer,Ee=P(t=>t.uuid),_h=Ee.getInitialState({}),xa=d.createSlice({name:"issueTypeIdentifiers",initialState:_h,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,_h)),reducers:{initializeIssueTypeIdentifiers:Ee.initialize,addIssueTypeIdentifier:Ee.addOne,addIssueTypeIdentifiers:Ee.addMany,setIssueTypeIdentifier:Ee.setOne,setIssueTypeIdentifiers:Ee.setMany,updateIssueTypeIdentifier:Ee.updateOne,updateIssueTypeIdentifiers:Ee.updateMany,deleteIssueTypeIdentifier:Ee.deleteOne,deleteIssueTypeIdentifiers:Ee.deleteMany}}),{initializeIssueTypeIdentifiers:Rh,addIssueTypeIdentifier:en,addIssueTypeIdentifiers:fI,setIssueTypeIdentifier:SI,setIssueTypeIdentifiers:TI,updateIssueTypeIdentifier:It,updateIssueTypeIdentifiers:II,deleteIssueTypeIdentifier:tn,deleteIssueTypeIdentifiers:gI}=xa.actions,vh=t=>t.issueTypeIdentifierReducer.instances,wh=d.createSelector([vh],t=>Object.values(t)),sn=t=>e=>e.issueTypeIdentifierReducer.instances[t],bI=f(d.createSelector([wh,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue_type===e)))),Mh=xa.reducer,Ve=P(t=>t.uuid),Eh=Ve.getInitialState({}),an=d.createSlice({name:"issueTypeIdentifierValues",initialState:Eh,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,O),e=>Object.assign(e,Eh)),reducers:{initializeIssueTypeIdentifierValues:Ve.initialize,addIssueTypeIdentifierValue:Ve.addOne,addIssueTypeIdentifierValues:Ve.addMany,setIssueTypeIdentifierValue:Ve.setOne,setIssueTypeIdentifierValues:Ve.setMany,updateIssueTypeIdentifierValue:Ve.updateOne,updateIssueTypeIdentifierValues:Ve.updateMany,deleteIssueTypeIdentifierValue:Ve.deleteOne,deleteIssueTypeIdentifierValues:Ve.deleteMany}}),{initializeIssueTypeIdentifierValues:Vh,addIssueTypeIdentifierValue:nn,addIssueTypeIdentifierValues:FI,setIssueTypeIdentifierValue:PI,setIssueTypeIdentifierValues:OI,updateIssueTypeIdentifierValue:gt,updateIssueTypeIdentifierValues:_I,deleteIssueTypeIdentifierValue:cn,deleteIssueTypeIdentifierValues:RI}=an.actions,jh=t=>t.issueTypeIdentifierValueReducer.instances,rn=d.createSelector([jh],t=>Object.values(t)),dn=t=>e=>e.issueTypeIdentifierValueReducer.instances[t],vI=f(d.createSelector([rn,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue===e)))),wI=f(d.createSelector([rn,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue_type_identifier===e)))),qh=an.reducer,C=P(t=>t.uuid),zh=C.getInitialState({}),un=d.createSlice({name:"issueTypes",initialState:zh,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,zh)),reducers:{initializeIssueTypes:C.initialize,addIssueType:C.addOne,addIssueTypes:C.addMany,setIssueType:C.setOne,setIssueTypes:C.setMany,updateIssueType:C.updateOne,updateIssueTypes:C.updateMany,deleteIssueType:C.deleteOne,deleteIssueTypes:C.deleteMany,removeIssueType:C.deleteOne}}),{initializeIssueTypes:Uh,addIssueType:Dh,addIssueTypes:MI,setIssueType:bt,setIssueTypes:EI,updateIssueType:Ch,updateIssueTypes:VI,deleteIssueType:jI,deleteIssueTypes:qI,removeIssueType:on}=un.actions,ln=t=>t.issueTypeReducer.instances,kh=d.createSelector(ln,t=>Object.values(t)),hn=t=>e=>e.issueTypeReducer.instances[t],zI=f(d.createSelector([ln,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const n=t[a];n?i.push(n):console.warn("selectIssueTypesByIds: No issue type exists with the id",a)}return i})),UI=f(d.createSelector([kh,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),Bh=un.reducer,je=P(t=>t.uuid),$h=je.getInitialState({}),mn=d.createSlice({name:"issueUpdates",initialState:$h,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,O),e=>Object.assign(e,$h)),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:Gh,addIssueUpdate:Lh,addIssueUpdates:Nh,setIssueUpdate:DI,setIssueUpdates:CI,updateIssueUpdate:kI,updateIssueUpdates:BI,deleteIssueUpdate:Hh,deleteIssueUpdates:Wh}=mn.actions,Kh=t=>t.issueUpdateReducer.instances,Yh=d.createSelector([Kh],t=>Object.values(t)),Zh=f(d.createSelector([Yh,(t,e)=>e],(t,e)=>T(t.filter(i=>i.issue===e)))),Jh=mn.reducer,qe=P(t=>t.id),Xh=qe.getInitialState({currentUser:null}),pn=d.createSlice({name:"users",initialState:Xh,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,Xh)),reducers:{initializeUsers:qe.initialize,setUsers:qe.setMany,setUser:qe.setOne,addUsers:qe.addMany,addUser:qe.addOne,updateUsers:qe.updateMany,updateUser:qe.updateOne,deleteUser:qe.deleteOne,deleteUsers:qe.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:Qh,setUsers:$I,setUser:GI,addUsers:LI,addUser:xh,updateUsers:NI,updateUser:HI,deleteUser:em,deleteUsers:WI,setCurrentUser:KI,setProfilePicture:YI}=pn.actions,tm=pn.reducer,sm=t=>t.userReducer.currentUser,Yt=t=>t.userReducer.instances,yn=d.createSelector([Yt],t=>Object.values(t)),im=t=>e=>e.userReducer.instances[t],ZI=f(d.createSelector([Yt,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const n=t[a];n?i.push(n):console.warn("selectUsersByIds: No user exists with the id",a)}return T(i)})),ze=P(t=>t.uuid),am=ze.getInitialState({}),An=d.createSlice({name:"organizationAccess",initialState:am,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,am)),reducers:{initializeOrganizationAccesses:ze.initialize,addOrganizationAccess:ze.addOne,addOrganizationAccesses:ze.addMany,setOrganizationAccess:ze.setOne,setOrganizationAccesses:ze.setMany,updateOrganizationAccess:ze.updateOne,updateOrganizationAccesses:ze.updateMany,deleteOrganizationAccess:ze.deleteOne,deleteOrganizationAccesses:ze.deleteMany}}),{initializeOrganizationAccesses:nm,addOrganizationAccess:cm,addOrganizationAccesses:JI,setOrganizationAccess:XI,setOrganizationAccesses:QI,updateOrganizationAccess:Zt,updateOrganizationAccesses:xI,deleteOrganizationAccess:rm,deleteOrganizationAccesses:eg}=An.actions,dm=An.reducer,fn=t=>t.organizationAccessReducer.instances,Sn=t=>e=>e.organizationAccessReducer.instances[t],tg=d.createSelector([sm,fn],(t,e)=>Object.values(e).find(a=>a.user===(t==null?void 0:t.id))??null),um=d.createSelector([fn],t=>{const e={};for(const i of Object.values(t))e[i.user]=i;return _t(e)}),sg=f(d.createSelector([Yt,um,(t,e)=>e],(t,e,i)=>T(Object.values(t).filter(a=>{const n=e[a.id];return!!n&&n.organization===i})))),Ue=P(t=>t.uuid),om=Ue.getInitialState({}),Tn=d.createSlice({name:"organizations",initialState:om,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,om)),reducers:{initializeOrganizations:Ue.initialize,setOrganizations:Ue.setMany,setOrganization:Ue.setOne,addOrganizations:Ue.addMany,addOrganization:Ue.addOne,updateOrganizations:Ue.updateMany,updateOrganization:Ue.updateOne,deleteOrganization:Ue.deleteOne,deleteOrganizations:Ue.deleteMany}}),{initializeOrganizations:lm,setOrganizations:ig,setOrganization:ag,addOrganizations:ng,addOrganization:hm,updateOrganizations:cg,updateOrganization:mm,deleteOrganization:rg,deleteOrganizations:dg}=Tn.actions,pm=t=>t.organizationReducer.instances,ug=d.createSelector([pm],t=>Object.values(t)),og=t=>e=>e.organizationReducer.instances[t],ym=Tn.reducer,Am=(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}}}}},fm={deletedRequests:[],latestRetryTime:0},In=d.createSlice({name:"outbox",initialState:fm,extraReducers:t=>t.addCase(g,e=>Object.assign(e,fm)),reducers:{enqueueRequest:{reducer:(t,e)=>t,prepare:t=>{console.debug("Preparing to enqueue request",t);const{BASE_URL:e,serviceName:i,...a}=t;return Am(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}}}),lg=t=>t.outboxReducer.deletedRequests,hg=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:Sm,markForDeletion:mg,markAsDeleted:Tm,_setLatestRetryTime:Im}=In.actions,gm=In.reducer,De=P(t=>t.uuid),bm=De.getInitialState({}),gn=d.createSlice({name:"projectAccess",initialState:bm,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,bm)),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:Fm,addProjectAccess:bn,addProjectAccesses:Fn,setProjectAccess:pg,setProjectAccesses:yg,updateProjectAccess:Ft,updateProjectAccesses:Pm,deleteProjectAccess:Pn,deleteProjectAccesses:On}=gn.actions,Om=gn.reducer,_n=t=>t.projectAccessReducer.instances,Jt=d.createSelector(_n,t=>Object.values(t)),Rn=t=>e=>e.projectAccessReducer.instances[t],_m=f(d.createSelector([_n,(t,e)=>e],(t,e)=>T(Object.values(t).filter(i=>i.project===e)))),Ag=f(d.createSelector([Jt,(t,e)=>e],(t,e)=>{const i={};for(const a of t.filter(n=>n.project===e))i[a.user]=a;return i})),fg=f(d.createSelector([yn,Jt,(t,e)=>e],(t,e,i)=>{const a=new Set(e.filter(n=>n.project===i).map(n=>n.user));return T(t.filter(n=>a.has(n.id)))})),Ce=P(t=>t.uuid),Rm=Ce.getInitialState({}),vn=d.createSlice({name:"projectAttachments",initialState:Rm,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,Rm)),reducers:{initializeProjectAttachments:Ce.initialize,addProjectAttachment:Ce.addOne,addProjectAttachments:Ce.addMany,setProjectAttachment:Ce.setOne,setProjectAttachments:Ce.setMany,updateProjectAttachment:Ce.updateOne,updateProjectAttachments:Ce.updateMany,deleteProjectAttachment:Ce.deleteOne,deleteProjectAttachments:Ce.deleteMany}}),{initializeProjectAttachments:vm,addProjectAttachment:Sg,addProjectAttachments:wm,setProjectAttachment:Mm,setProjectAttachments:Em,updateProjectAttachment:Tg,updateProjectAttachments:Vm,deleteProjectAttachment:jm,deleteProjectAttachments:wn}=vn.actions,qm=t=>t.projectAttachmentReducer.instances,zm=d.createSelector([qm],t=>Object.values(t)),Um=t=>e=>e.projectAttachmentReducer.instances[t],Dm=f(d.createSelector([zm,(t,e)=>e],(t,e)=>T(t.filter(({project:i})=>e===i)))),Cm=vn.reducer,ke=P(t=>t.uuid),km=ke.getInitialState({activeProjectFileId:null,isImportingProjectFile:!1}),Mn=d.createSlice({name:"projectFiles",initialState:km,extraReducers:t=>t.addMatcher(d.isAnyOf(g,M,O),e=>Object.assign(e,km)),reducers:{initializeProjectFiles:ke.initialize,setProjectFile:ke.setOne,setProjectFiles:ke.setMany,addProjectFile:ke.addOne,addProjectFiles:ke.addMany,updateProjectFile:ke.updateOne,updateProjectFiles:ke.updateMany,deleteProjectFile:ke.deleteOne,deleteProjectFiles:ke.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},resetProjectFileObjectUrls:(t,...e)=>{for(const i in t.instances)delete t.instances[i].objectURL}}}),{initializeProjectFiles:Bm,setProjectFile:Ig,setProjectFiles:gg,addProjectFile:bg,addProjectFiles:$m,updateProjectFile:En,updateProjectFiles:Fg,deleteProjectFile:Gm,deleteProjectFiles:Lm,setIsImportingProjectFile:Nm,setActiveProjectFileId:Hm,saveActiveProjectFileBounds:Wm,resetProjectFileObjectUrls:Pg}=Mn.actions,Km=t=>t.projectFileReducer.instances,Ym=d.createSelector([Km],t=>T(Object.values(t).sort((e,i)=>e.z_index-i.z_index))),Og=t=>e=>e.projectFileReducer.instances[t],_g=t=>t.projectFileReducer.activeProjectFileId,Rg=t=>t.projectFileReducer.isImportingProjectFile,Zm=Mn.reducer,Be=P(t=>t.uuid),Jm=Be.getInitialState({}),Vn=d.createSlice({name:"projects",initialState:Jm,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,Jm)),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:Xm,setProjects:vg,setProject:wg,addProjects:Mg,addProject:jn,updateProjects:Eg,updateProject:Qm,deleteProject:qn,deleteProjects:Vg}=Vn.actions,xm=Vn.reducer,ep=t=>t.projectReducer.instances,zn=d.createSelector([ep],t=>T(Object.values(t))),tp=t=>e=>e.projectReducer.instances[t],jg=f(d.createSelector([zn,Jt,(t,e)=>e],(t,e,i)=>{const a=new Set(e.filter(n=>n.user===i).map(n=>n.project));return T(t.filter(n=>a.has(n.uuid)))})),qg=f(d.createSelector([zn,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),zg={isRehydrated:!1},Un=d.createSlice({name:"rehydrated",initialState:zg,reducers:{setRehydrated:(t,e)=>{t.isRehydrated=e.payload}}}),{setRehydrated:Ug}=Un.actions,Dg=t=>t.rehydratedReducer.isRehydrated,sp=Un.reducer,$e=P(t=>t.uuid),ip=$e.getInitialState({}),Dn=d.createSlice({name:"teamMemberships",initialState:ip,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,ip)),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:np,addTeamMemberships:cp,setTeamMembership:Cn,setTeamMemberships:rp,updateTeamMembership:Cg,updateTeamMemberships:kg,deleteTeamMembership:kn,deleteTeamMemberships:dp}=Dn.actions,up=Dn.reducer,op=t=>t.teamMembershipReducer.instances,Bn=d.createSelector([op],t=>Object.values(t)),lp=t=>e=>e.teamMembershipReducer.instances[t],Bg=f(d.createSelector([Bn,(t,e)=>e],(t,e)=>{const i={};for(const a of t.filter(n=>n.team===e))i[a.user]=a;return i})),$g=f(d.createSelector([yn,Bn,(t,e)=>e],(t,e,i)=>{const a=new Set(e.filter(n=>n.team===i).map(n=>n.user));return T(t.filter(n=>a.has(n.id)))})),Ge=P(t=>t.uuid),hp=Ge.getInitialState({}),$n=d.createSlice({name:"teams",initialState:hp,extraReducers:t=>t.addMatcher(d.isAnyOf(g,O),e=>Object.assign(e,hp)),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:mp,addTeam:pp,addTeams:Gg,setTeam:Pt,setTeams:Lg,updateTeam:yp,updateTeams:Ng,deleteTeam:Gn,deleteTeams:Hg}=$n.actions,Ln=t=>t.teamReducer.instances,Ap=d.createSelector([Ln],t=>Object.values(t)),Nn=t=>e=>e.teamReducer.instances[t],Wg=f(d.createSelector([Ln,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const n=t[a];n?i.push(n):console.warn("selectTeamsByIds: No team exists with the id",a)}return T(i)})),Kg=f(d.createSelector([Ap,(t,e)=>e],(t,e)=>T(t.filter(i=>i.organization===e)))),fp=$n.reducer,Yg={version:0},Sp=d.createSlice({name:"versioning",initialState:Yg,reducers:{}}),Tp=Sp.reducer,Hn={outboxReducer:gm,fileReducer:co,authReducer:_u},Zg=d.combineReducers(Hn),Ip={...Hn,[it]:Tp,categoryReducer:Vu,assetReducer:md,assetAttachmentReducer:Ec,assetStageCompletionReducer:Sd,assetStageReducer:Pd,assetTypeReducer:Fu,assetTypeAttachmentReducer:zd,issueReducer:Ll,issueAttachmentReducer:Fl,issueTypeReducer:Bh,issueTypeAttachmentReducer:xl,organizationReducer:ym,projectReducer:xm,projectAttachmentReducer:Cm,projectAccessReducer:Om,organizationAccessReducer:dm,projectFileReducer:Zm,rehydratedReducer:sp,formReducer:jo,formRevisionReducer:Mo,formRevisionAttachmentReducer:Fo,formSubmissionAttachmentReducer:Lo,formSubmissionReducer:Jo,formIdentifierReducer:ho,formIdentifierValueReducer:Ao,userReducer:tm,emailDomainsReducer:to,documentsReducer:Yu,documentAttachmentReducer:Lu,teamReducer:fp,agentsReducer:bc,issueCommentReducer:Dl,issueCommentAttachmentReducer:jl,issueUpdateReducer:Jh,geoImageReducer:cl,issueAssociationReducer:pl,issueTypeFieldsReducer:Sh,issueTypeFieldValuesReducer:lh,issueTypeFieldsAttachmentReducer:rh,issueTypeFieldValuesAttachmentReducer:Oh,issueTypeIdentifierReducer:Mh,issueTypeIdentifierValueReducer:qh,assetTypeFieldsReducer:Jd,assetTypeFieldValuesReducer:ou,assetTypeFieldsAttachmentReducer:Ld,assetTypeFieldValuesAttachmentReducer:iu,assetTypeIdentifierReducer:yu,assetTypeIdentifierValueReducer:Tu,assetProcedureTypeReducer:_r,assetProcedureReducer:br,assetProcedureTypeFieldsReducer:sr,assetProcedureFieldValuesReducer:Ar,assetProcedureTypeFieldsAttachmentReducer:Yc,assetProcedureTypeFieldValuesAttachmentReducer:rr,assetProcedureTypeAttachmentReducer:kc,assetProcedureStepFieldsAttachmentReducer:zr,assetProcedureStepFieldsReducer:Cr,assetProcedureStepFieldValuesAttachmentReducer:Hr,assetProcedureStepFieldValuesReducer:Qr,assetProcedureStepReducer:cd,teamMembershipReducer:up},Jg=d.combineReducers(Ip);function Xg(t,e){return Np.useMemo(t,e)}class Qg{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(n=>n[e]===i)),this}exclude(e,i){return this.operations.push(a=>a.filter(n=>n[e]!==i)),this}orderBy(e){return this.operations.push(i=>[...i].sort((a,n)=>a[e]<=n[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(n=>n[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 gp={};class bp{constructor(e){S(this,"client");gp[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 n=[];let c=await this.client.enqueueRequest(e,this.host,this.constructor.name,a);for(n.push(c.results);c.next;)c=await this.client.enqueueRequest(i(c.next),this.host,this.constructor.name,a),n.push(c.results);return n}dispatch(e){this.client.store.dispatch(e)}}const Fp=()=>_p.length-1,Pp=t=>(t[it]={version:Fp()},t),Op=()=>Pp({}),xg=t=>(t.outboxReducer&&(t.outboxReducer.deletedRequests=[]),t),eb=t=>e=>{var i;return e===void 0&&(e={}),((i=e[it])==null?void 0:i.version)===Fp()?e:t(e)},_p=[Pp,Op,Op,xg],tb=Object.fromEntries(_p.map((t,e)=>[e,eb(t)])),sb=t=>{if(t)throw t;const e=st();e?e.dispatch({type:"rehydrated/setRehydrated",payload:!0}):console.error("Client store not set")},Rp=(t,e,i)=>{const a=Ze();return a?(a.addRequest(e),a.getQueue()):(console.warn("Outbox coordinator not set; cannot enqueue request yet."),[])},vp=(t,e,i)=>{const a=Ze();if(!a)return console.warn("Outbox coordinator not set; cannot dequeue request yet."),[];const c=e.meta.offlineAction.payload.uuid;return a.remove(c),a.getQueue()};async function ib(t,e){if(!e.payload)throw new Error("Received empty payload");return kp(e)}const ab={...ec,effect:ib,discard:Kn,returnPromises:!0,persistCallback:sb,retry:ub,persistOptions:{storage:Wp},queue:{...ec.queue,enqueue:Rp,dequeue:vp,peek:(...t)=>db(...t)}},nb=Kp(tb,it),cb=d.compose(Hp.offline(ab),nb);function rb(t){function e(i){return typeof i=="object"&&i!==null&&["ok","redirect","clientError","serverError","error"].every(n=>n 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 Wn(t,e,i){const a=gp[t.meta.offline.effect.serviceName];if(!a)throw new Error(`Service ${t.meta.offline.effect.serviceName} not found`);const n=a instanceof R;if(e.store.getState().outboxReducer.deletedRequests.includes(t.payload.uuid))throw new Error("Request was marked for deletion");n&&t.payload.checkAuth!==!1&&await a.auth.prepareAuth();const r={queryParams:"",isAuthNeeded:!0},u=t.meta.offline.effect,{payload:m,headers:o,method:h,queryParams:p,attachmentHash:y,isExternalUrl:A,isAuthNeeded:I,isResponseBlob:F}={...r,...u.request},_=u.request;let w=_.url;const z=y?await e.files.fetchCache(y):void 0;if(y&&!z)throw new Error(`Cannot upload file ${y} because it's not cached.`);!A&&!w.startsWith("http")&&(!w.startsWith("/")&&!w.startsWith("blob:")&&(w="/"+w),w=t.meta.offline.effect.BASE_URL+w);const Le=q=>{if(y){const Ne=_.s3url;if(!Ne)throw new Error(`No S3 URL for file ${y}`);if("warning"in Ne)throw new Error(`S3 URL warning for file ${y}`);if(!z)throw new Error(`No file for file ${y}`);const Ot=Ne.fields["x-amz-checksum-sha1"];if(!Ot)throw new Error(`No checksum for file ${y}`);return q.set("x-amz-checksum-sha1",Ot).field({...m,...Ne.fields}).attach("file",z)}return q.send(m)},vF={[l.GET]:()=>F?Je.get(w.toString()).responseType("blob"):Je.get(w.toString()),[l.POST]:()=>{const q=Je.post(w.toString());return Le(q)},[l.PATCH]:()=>{const q=Je.patch(w.toString());return Le(q)},[l.PUT]:()=>{const q=Je.put(w.toString());return Le(q)},[l.DELETE]:()=>{const q=Je.delete(w.toString());return Le(q)}}[h];let Ke=vF();if(i==null||i.addEventListener("abort",()=>{console.debug("aborting request:",_),Ke.abort()}),I&&n){const q=a.auth.getAuthHeader();Ke=Ke.set("Authorization",q)}o&&(Ke=Ke.set(o));try{return await Ke.query(p)}catch(q){const Ne=rb(q),Ot=Ne==null?void 0:Ne.status;if(n&&Ot===401)return await a.auth.handleUnauthorized(Ke,Ne),Ke.query(p);throw new D({response:Ne,innerError:q,discard:wp.includes(Ot)})}}const wp=[400,409,403,404,405,500];function Kn(t,e,i=0){var o;if(console.debug("Considering discarding request due to error:",t,`(${typeof t})`,`
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
`)
|
|
7
|
-
`):`${n}: ${JSON.stringify(c)}`).join(`
|
|
8
|
-
`)}catch(n){console.error("Failed to extract error message from response body",n)}}else typeof t.body=="string"&&(i=t.body);else t!=null&&t.text?i=t.text:e instanceof Error&&(i=e.message);return!i||i.length>ob?et:i}class D extends Error{constructor(i){super(et);S(this,"status");S(this,"response");S(this,"message");S(this,"options");const{response:a,innerError:n}=i;this.message=i.message??lb(a,n)??et,this.status=(a==null?void 0:a.status)??0,this.response=a,i.discard=i.discard??!1,this.options=i}}class hb extends bp{constructor(e){super(e)}}class R extends bp{constructor(i,a){super(i);S(this,"auth");this.auth=a}}class mb extends R{async startConversation(e,i){return this.enqueueRequest({description:"Start agent conversation",method:l.POST,url:"/agents/prompt/",payload:{prompt:e,active_project:i},blockers:["prompt"],blocks:["prompt"]}).then(a=>(this.dispatch(Tc(a)),a))}async continueConversation(e,i,a){return this.enqueueRequest({description:"Prompt agent",method:l.POST,url:"/agents/prompt/",payload:{prompt:e,active_project:a},blockers:["prompt"],blocks:["prompt"],queryParams:{conversation_id:i}}).then(n=>{this.dispatch(gc(n))})}async fetchDetails(e){return this.enqueueRequest({description:"Get agent conversation",method:l.GET,url:`/agents/conversations/${e}/`,blockers:["conversation"],blocks:["conversation"]}).then(i=>{this.dispatch(Ic(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(Sc(a)),a}}const V=1e4,He=200;class j extends R{getNumberOfAttachmentsWithSha1(e){const{issueAttachmentReducer:i,assetAttachmentReducer:a,assetTypeAttachmentReducer:n,documentAttachmentReducer:c,projectAttachmentReducer:r,formRevisionAttachmentReducer:u,formSubmissionAttachmentReducer:m,geoImageReducer:o,assetTypeFieldsAttachmentReducer:h,assetTypeFieldValuesAttachmentReducer:p,issueTypeFieldsAttachmentReducer:y,issueTypeFieldValuesAttachmentReducer:A}=this.client.store.getState();return[].concat(Object.values(i.instances),Object.values(a.instances),Object.values(n.instances),Object.values(c.instances),Object.values(r.instances),Object.values(u.instances),Object.values(m.instances),Object.values(o.instances),Object.values(h.instances),Object.values(p.instances),Object.values(y.instances),Object.values(A.instances)).filter(F=>F.file_sha1===e).length}processPresignedUrls(e){const i={};for(const[a,n]of Object.entries(e))i[a]=this.enqueueRequest({url:n.url,description:"Upload file to S3",method:l.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:a,blockers:[`s3-${n.fields.key}`],blocks:[a],s3url:n});return i}async getFilePayload(e){const i=await Qe(e),a={sha1:i,file_type:e.type,extension:e.name.split(".").pop(),size:e.size};return await this.client.files.addCache(e,i),a}}class We extends j{async _bulkAdd(e){var o;const{store:i}=this.client,a=(o=i.getState().userReducer.currentUser)==null?void 0:o.id,n=new Date().toISOString(),c=[],r=[],u={};for(const h of e){const{modelUuid:p,file:y}=h,A=await this.getFilePayload(y);A.sha1 in u||(u[A.sha1]=A);const I=this.buildOfflineAttachment({file:y,file_sha1:A.sha1,submitted_at:n,created_by:a,description:"",modelUuid:p});c.push(I),r.push(this.buildAttachmentPayload({uuid:I.uuid,file_name:I.file_name,file_sha1:I.file_sha1,file_extension:A.extension,description:I.description,modelUuid:p}))}this.dispatch(this.addAttachments(c));const m=this.enqueueRequest({description:`Add ${this.name}`,method:l.POST,url:`${this.url}/bulk/`,payload:{submitted_at:n,attachments:r,files:Object.values(u)},blocks:c.map(h=>h.uuid),blockers:c.map(h=>h.file_sha1)});return m.then(({attachments:h,presigned_urls:p})=>{this.dispatch(this.updateAttachments(h)),this.processPresignedUrls(p)}).catch(()=>{this.dispatch(this.removeAttachments(c.map(h=>h.uuid)))}),[c,m.then(({attachments:h})=>h)]}async _delete(e){const{store:i}=this.client,a=this.selectAttachment(e)(i.getState());if(!a)throw new Error(`Attempting to delete attachment with uuid ${e} that does not exist in the store`);this.dispatch(this.removeAttachment(a.uuid));const n=this.enqueueRequest({description:`Delete ${this.name}`,method:l.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]});return n.then(()=>{this.getNumberOfAttachmentsWithSha1(a.file_sha1)===0&&this.client.files.removeCache(a.file_sha1)}).catch(()=>{this.dispatch(this.setAttachment(a))}),n}}class pb extends We{constructor(){super(...arguments);S(this,"name","Asset Attachment");S(this,"url","/asset-attachments");S(this,"initializeAttachments",ds);S(this,"addAttachments",us);S(this,"updateAttachments",Oc);S(this,"removeAttachments",os);S(this,"removeAttachment",_c);S(this,"setAttachment",Pc);S(this,"selectAttachment",wc)}buildOfflineAttachment(i){return b({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,asset:i.modelUuid})}buildAttachmentPayload(i){return{...i,asset:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.assetUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const c=(await this.performPagination({immediate:!0,description:"Get asset attachments",method:l.GET,url:`${this.url}/`,queryParams:{limit:He,paginate:!0,asset__project:i},blocks:[],blockers:[]},r=>({immediate:!0,description:"Get asset attachments",method:l.GET,url:r,blockers:[],blocks:[]}),a)).flat();return this.dispatch(ds(c)),c}}class yb extends We{constructor(){super(...arguments);S(this,"name","Asset Procedure Attachment");S(this,"url","/asset-procedure-type-attachments");S(this,"addAttachments",qc);S(this,"updateAttachments",Uc);S(this,"removeAttachments",Cc);S(this,"removeAttachment",Dc);S(this,"setAttachment",zc);S(this,"selectAttachment",Gc)}buildOfflineAttachment(i){return b({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,asset_procedure_type:i.modelUuid})}buildAttachmentPayload(i){return{...i,asset_procedure_type:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.assetProcedureTypeUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const n=await this.enqueueRequest({immediate:!0,description:"Get asset procedure attachments",method:l.GET,url:`${this.url}/`,queryParams:{asset_procedure_type__organization:i},blocks:[],blockers:[]},a);return this.dispatch(jc(n)),n}}class Ab extends j{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:y}=o,A=await this.getFilePayload(y);A.sha1 in n||(n[A.sha1]=A);const I=b({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:A.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});c.push(I);const F={uuid:I.uuid,file_name:y.name,field_identifier:p,file_extension:A.extension,file_sha1:A.sha1,fields_revision:h};r.push(F)}this.dispatch(Hc(c));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(n)},blockers:c.map(o=>o.fields_revision),blocks:c.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(Wc(o.attachments))}).catch(()=>{this.dispatch(Kc(c.map(o=>o.uuid)))}),[c,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset procedure 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(Nc(a)),a}}class fb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(xc(c));const r=this.enqueueRequest({description:"Add Asset Procedure Type Fields",method:l.POST,url:"/asset-procedure-type-fields/",payload:v(c),blockers:[c.asset_procedure_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(er(m))}).catch(m=>{throw this.dispatch(tr(c.uuid)),m}),[c,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(Qc(a)),a}}function Ye(t,e){const i=[];let a=0;const n=t.length;for(;a<n;)i.push(t.slice(a,a+=e));return i}class Sb extends j{async bulkAdd(e,i){var o;const a=new Date().toISOString(),n=(o=this.client.store.getState().userReducer.currentUser)==null?void 0:o.id,c=Ye(e,i??e.length),r=[],u=[];for(const h of c){const p={},y=[];for(const A of h){const{fieldValuesUuid:I,fieldIdentifier:F,file:_}=A,w=await this.getFilePayload(_);w.sha1 in p||(p[w.sha1]=w);const z=b({file:URL.createObjectURL(_),file_type:_.type,file_name:_.name,file_sha1:w.sha1,created_by:n,field_values:I,submitted_at:a,field_identifier:F});r.push(z);const Le={uuid:z.uuid,file_name:_.name,file_sha1:w.sha1,file_extension:w.extension,field_identifier:F,field_values:I};y.push(Le)}u.push({submitted_at:a,attachments:y,files:Object.values(p)})}this.dispatch(Rt(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(cr(p))}).catch(h=>{throw this.dispatch(vt(r.map(p=>p.uuid))),h}),[r,m.map(h=>h.then(({attachments:p})=>p))]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),n=ur(e)(a);this.dispatch(vt(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(c){throw this.dispatch(Rt(n)),c}}async refreshStore(e,i){const n=(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:He,paginate:!0,field_values__asset_procedure__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset procedure type field values attachments",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(nr(n)),n}}class Tb extends R{add(e){var r;const{store:i}=this.client,a=i.getState(),n=b({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),c=this.enqueueRequest({description:"Add asset procedure type field values",method:l.POST,url:"/asset-procedure-type-field-values/",payload:v(n),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[n.uuid]});return this.dispatch(Ss(n)),c.then(u=>(this.dispatch(at(u)),u)).catch(()=>{this.dispatch(Ts(n.uuid))}),[n,c]}bulkAdd(e,i){var m;const a=new Date().toISOString(),n=[],c=Ye(e.payloads,i??e.payloads.length),r=[];for(const o of c){const h=[];for(const p of o){const y=b({...p,values:p.values,created_by:(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,submitted_at:a});n.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(mr(n));const u=[];for(const o of r){const h=o.field_values.map(F=>F.asset),p=o.field_values.map(F=>F.fields_revision),y=o.field_values.map(F=>F.asset_procedure),A=o.field_values.map(F=>F.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:A});u.push(I)}return Promise.all(u).then(o=>{this.dispatch(pr(o.flat()))}).catch(()=>{this.dispatch(yr(n.map(o=>o.uuid)))}),[n,u]}update(e){const{store:i}=this.client,a=i.getState(),n=gs(e.uuid)(a);if(!n)throw new Error(`Expected AssetProcedureTypeFieldValues with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(at(c));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:[c.fields_revision,c.asset,c.asset_procedure],blocks:[c.uuid]});return r.then(u=>{this.dispatch(at(u))}).catch(()=>{this.dispatch(at(n))}),[c,r]}async delete(e){const{store:i}=this.client,a=i.getState(),n=gs(e)(a);if(!n)throw new Error(`Expected submission with uuid ${e} to exist`);const c=or(e)(a);this.dispatch(Ts(e)),this.dispatch(vt(c.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(Ss(n)),this.dispatch(Rt(c)),r}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset procedure type field values",method:l.GET,url:"/asset-procedure-type-field-values/",queryParams:{limit:V,paginate:!0,asset_procedure__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset procedure type field values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(hr(n)),n}}class Ib extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(Fs(c));const r=this.enqueueRequest({description:"Create asset procedure",method:l.POST,url:"/asset-procedures/",payload:v(c),blockers:[e.asset_procedure_type,e.asset_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(nt(m))}).catch(()=>{this.dispatch(Ps(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=Rs(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset procedure with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(nt(n));const c=this.enqueueRequest({description:"Update asset procedure",method:l.PATCH,url:`/asset-procedures/${e.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return c.then(r=>{this.dispatch(nt(r))}).catch(()=>{this.dispatch(nt(a))}),[n,c]}async remove(e){const{store:i}=this.client,a=i.getState(),n=Rs(e)(a);if(!n)throw new Error(`Expected asset procedure with uuid ${e} to exist`);return this.dispatch(Ps(e)),this.enqueueRequest({description:"Delete asset procedure",method:l.DELETE,url:`/asset-procedures/${e}/`,blockers:[e],blocks:[]}).catch(c=>{throw this.dispatch(Fs(n)),c})}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset procedures",method:l.GET,url:"/asset-procedures/",queryParams:{limit:V,paginate:!0,project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset procedures",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Tr(n)),n}}class gb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(ws(c));const r=this.enqueueRequest({description:"Create asset procedure type",method:l.POST,url:"/asset-procedure-types/",payload:v(c),blockers:[],blocks:[c.uuid]});return r.then(m=>{this.dispatch(ct(m))}).catch(()=>{this.dispatch(Ms(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=Vs(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset procedure type with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(ct(n));const c=this.enqueueRequest({description:"Update asset procedure type",method:l.PATCH,url:`/asset-procedure-types/${e.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return c.then(r=>{this.dispatch(ct(r))}).catch(()=>{this.dispatch(ct(a))}),[n,c]}async remove(e){const{store:i}=this.client,a=i.getState(),n=Vs(e)(a);if(!n)throw new Error(`Expected asset procedure type with uuid ${e} to exist`);const c=Fr(e)(a);return this.dispatch(Ms(e)),this.dispatch(gr(c.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(ws(n)),this.dispatch(Ir(c)),r})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset procedure types",method:l.GET,url:"/asset-procedure-types/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(Or(a)),a}}class bb extends j{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:y}=o,A=await this.getFilePayload(y);A.sha1 in n||(n[A.sha1]=A);const I=b({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:A.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});c.push(I);const F={uuid:I.uuid,file_name:y.name,field_identifier:p,file_extension:A.extension,file_sha1:A.sha1,fields_revision:h};r.push(F)}this.dispatch(Mr(c));const u=this.enqueueRequest({description:"Add asset procedure step fields attachments",method:l.POST,url:"/asset-procedure-step-fields-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(n)},blockers:c.map(o=>o.fields_revision),blocks:c.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(Er(o.attachments))}).catch(()=>{this.dispatch(Vr(c.map(o=>o.uuid)))}),[c,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset procedure step fields attachments",method:l.GET,url:"/asset-procedure-step-fields-attachments/",queryParams:{fields_revision__asset_procedure_step__organization:e},blockers:[],blocks:[]},i);return this.dispatch(wr(a)),a}}class Fb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(zs(c));const r=this.enqueueRequest({description:"Add Asset Procedure Step Fields",method:l.POST,url:"/asset-procedure-step-fields/",payload:v(c),blockers:[c.asset_procedure_step],blocks:[c.uuid]});return r.then(m=>{this.dispatch(rt(m))}).catch(m=>{throw this.dispatch(Us(c.uuid)),m}),[c,r]}update(e){const{store:i}=this.client,a=i.getState().assetProcedureStepFieldsReducer.instances[e.uuid];if(!a)throw new Error(`AssetProcedureStepFields with uuid ${e.uuid} not found`);const n={...a,...e};this.dispatch(rt(n));const c=this.enqueueRequest({description:"Update Asset Procedure Step Fields",method:l.PATCH,url:`/asset-procedure-step-fields/${a.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return c.then(r=>{this.dispatch(rt(r))}).catch(r=>{throw this.dispatch(rt(a)),r}),[n,c]}delete(e){const{store:i}=this.client,a=i.getState().assetProcedureStepFieldsReducer.instances[e];if(!a)throw new Error(`AssetProcedureStepFields with uuid ${e} not found`);this.dispatch(Us(e));const n=this.enqueueRequest({description:"Delete Asset Procedure Step Fields",method:l.DELETE,url:`/asset-procedure-step-fields/${e}/`,blockers:[e],blocks:[e]});return n.catch(c=>{throw this.dispatch(zs(a)),c}),n}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Asset Procedure Step Fields",method:l.GET,url:"/asset-procedure-step-fields/",queryParams:{asset_procedure_step__asset_procedure_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Dr(a)),a}}class Pb extends j{async bulkAdd(e,i){var o;const a=new Date().toISOString(),n=(o=this.client.store.getState().userReducer.currentUser)==null?void 0:o.id,c=Ye(e,i??e.length),r=[],u=[];for(const h of c){const p={},y=[];for(const A of h){const{fieldValuesUuid:I,fieldIdentifier:F,file:_}=A,w=await this.getFilePayload(_);w.sha1 in p||(p[w.sha1]=w);const z=b({file:URL.createObjectURL(_),file_type:_.type,file_name:_.name,file_sha1:w.sha1,created_by:n,field_values:I,submitted_at:a,field_identifier:F});r.push(z);const Le={uuid:z.uuid,file_name:_.name,file_sha1:w.sha1,file_extension:w.extension,field_identifier:F,field_values:I};y.push(Le)}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 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($r(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(),n=Lr(e)(a);this.dispatch(Mt(e));try{await this.enqueueRequest({description:"Delete asset procedure step field values attachments",method:l.DELETE,url:"/asset-procedure-step-field-values-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(c){throw this.dispatch(wt(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset procedure step field values attachments",method:l.GET,url:"/asset-procedure-step-field-values-attachments/",queryParams:{limit:He,paginate:!0,field_values__asset_procedure__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset procedure step field values attachments",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Br(n)),n}}class Ob extends R{add(e){var r;const{store:i}=this.client,a=i.getState(),n=b({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),c=this.enqueueRequest({description:"Add asset procedure step field values",method:l.POST,url:"/asset-procedure-step-field-values/",payload:v(n),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[n.uuid]});return this.dispatch(Gs(n)),c.then(u=>(this.dispatch(dt(u)),u)).catch(()=>{this.dispatch(Ls(n.uuid))}),[n,c]}bulkAdd(e,i){var m;const a=new Date().toISOString(),n=[],c=Ye(e.payloads,i??e.payloads.length),r=[];for(const o of c){const h=[];for(const p of o){const y=b({...p,values:p.values,created_by:(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,submitted_at:a});n.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(Yr(n));const u=[];for(const o of r){const h=o.field_values.map(F=>F.asset),p=o.field_values.map(F=>F.fields_revision),y=o.field_values.map(F=>F.asset_procedure),A=o.field_values.map(F=>F.uuid),I=this.enqueueRequest({description:"Bulk add asset procedure step field values",method:l.POST,url:"/asset-procedure-step-field-values/bulk/",payload:o,blockers:[...h,...p,...y],blocks:A});u.push(I)}return Promise.all(u).then(o=>{this.dispatch(Zr(o.flat()))}).catch(()=>{this.dispatch(Jr(n.map(o=>o.uuid)))}),[n,u]}update(e){const{store:i}=this.client,a=i.getState(),n=Ns(e.uuid)(a);if(!n)throw new Error(`Expected AssetProcedureStepFieldValues with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(dt(c));const r=this.enqueueRequest({description:"Update asset procedure step field values",method:l.PATCH,url:`/asset-procedure-step-field-values/${e.uuid}/`,payload:e,blockers:[c.fields_revision,c.asset,c.asset_procedure],blocks:[c.uuid]});return r.then(u=>{this.dispatch(dt(u))}).catch(()=>{this.dispatch(dt(n))}),[c,r]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Ns(e)(a);if(!n)throw new Error(`Expected submission with uuid ${e} to exist`);const c=Nr(e)(a);this.dispatch(Ls(e)),this.dispatch(Mt(c.map(r=>r.uuid)));try{await this.enqueueRequest({description:"Delete asset procedure step field values",method:l.DELETE,url:`/asset-procedure-step-field-values/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(Gs(n)),this.dispatch(wt(c)),r}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset procedure step field values",method:l.GET,url:"/asset-procedure-step-field-values/",queryParams:{limit:V,paginate:!0,asset_procedure__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset procedure step field values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Kr(n)),n}}class _b extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(sd(c));const r=this.enqueueRequest({description:"Create asset procedure step",method:l.POST,url:"/asset-procedure-steps/",payload:v(c),blockers:[c.asset_procedure_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(Vt(m))}).catch(()=>{this.dispatch(ad(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=Ws(e.uuid)(i.getState());if(!a)throw new Error(`No asset procedure step with uuid ${e.uuid} found in the store`);const n={...a,...e};this.dispatch(Vt(n));const c=this.enqueueRequest({description:"Update asset procedure step",method:l.PATCH,url:`/asset-procedure-steps/${a.uuid}/`,payload:{name:e.name,description:e.description,priority:e.order,color:e.color},blockers:[a.uuid],blocks:[a.uuid]});return c.then(r=>{this.dispatch(Vt(r))}).catch(()=>{this.dispatch(td(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Ws(e)(a);if(!n)throw new Error(`No asset procedure step with uuid ${e} found in the store`);const c=dd(e)(a);return this.dispatch(nd([e,...mc(c)])),this.enqueueRequest({description:"Delete asset stage",method:l.DELETE,url:`/asset-procedure-steps/${e}/`,blockers:[e],blocks:[]}).catch(r=>{throw this.dispatch(id([n,...c])),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(ed(a)),a}}class Rb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(Ys(c));const r=this.enqueueRequest({description:"Create asset",method:l.POST,url:"/assets/",payload:v(c),blockers:[c.asset_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(ot(m))}).catch(()=>{this.dispatch(Zs(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=xs(e.uuid)(i.getState());if(!a)throw new Error(`No asset with uuid ${e.uuid} found in the store`);const n={...a,...e};this.dispatch(ot(n));const c=this.enqueueRequest({description:"Edit asset",method:l.PATCH,url:`/assets/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(ot(r))}).catch(()=>{this.dispatch(ot(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=xs(e)(a);if(!n)throw new Error(`No asset with uuid ${e} found in the store`);const c=Mc(e)(a),r=ml(e)(a);if(this.dispatch(Zs(e)),c.length>0){const u=c.map(({uuid:m})=>m);this.dispatch(os(u))}if(r.length>0){const u=r.map(({uuid:m})=>m);this.dispatch(Pa(u))}return this.enqueueRequest({description:"Delete asset",method:l.DELETE,url:`/assets/${e}/`,blockers:[e],blocks:[]}).catch(u=>{throw this.dispatch(Ys(n)),this.dispatch(us(c)),this.dispatch(ba(r)),u})}bulkAdd(e,i,a,n){const c=new Date().toISOString(),r=Xe.v4(),u=Ye(e,n).map(h=>{const p=h.map(y=>b(y));return{batchId:Xe.v4(),payload:{transaction_id:r,submitted_at:c,asset_type:i,project:a,assets:p}}}),m=[];let o=null;for(const h of u){const{batchId:p,payload:y}=h,A=y.assets.map(w=>w.uuid),I=[i];o&&I.push(o);const F=A;F.push(p);const _=this.enqueueRequest({description:"Batch create assets",method:l.POST,url:"/assets/bulk/",payload:y,blockers:I,blocks:F});o=h.batchId,m.push(_)}return Promise.all(m).then(h=>{const p=h.flat();this.dispatch(jt(p))}),m}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),n=hd(e)(a);this.dispatch(Js(e));try{await this.enqueueRequest({description:"Bulk delete assets",method:l.DELETE,url:"/assets/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(c){throw this.dispatch(jt(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get assets",method:l.GET,url:"/assets/",queryParams:{limit:V,paginate:!0,project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get assets",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(od(n)),n}}class vb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(ti(c));const r=this.enqueueRequest({description:"Add asset stage completion",method:l.POST,url:"/asset-stage-completions/",payload:v(c),blockers:[e.asset,e.asset_stage],blocks:[c.uuid]});return r.then(m=>{this.dispatch(Ad(m))}).catch(()=>{this.dispatch(ii(c.uuid))}),[c,r]}delete(e){const{store:i}=this.client,a=Td(e)(i.getState());if(!a)throw new Error(`Expected asset stage completion with uuid ${e} to exist`);this.dispatch(ii(e));const n=this.enqueueRequest({description:"Delete asset stage completion",method:l.DELETE,url:`/asset-stage-completions/${e}/`,blockers:[e],blocks:[]});return n.catch(()=>{this.dispatch(ti(a))}),n}bulkAdd(e){var o;const{store:i}=this.client,a=new Date().toISOString(),n=(o=i.getState().userReducer.currentUser)==null?void 0:o.id,c=e.map(h=>b(h)),r=c.map(h=>({...h,created_by:n,submitted_at:a})),u=r.map(({uuid:h})=>h);this.dispatch(si(r));const m=this.enqueueRequest({description:"Bulk create asset stage completions",method:l.POST,url:"/asset-stage-completions/bulk/",payload:{submitted_at:a,completions:c},blockers:[...e.map(h=>h.asset_procedure),...e.map(h=>h.asset_stage),...e.map(h=>h.asset)],blocks:u});return m.then(h=>{this.dispatch(fd(h))}).catch(()=>{this.dispatch(ai(u))}),[r,m]}bulkDelete(e){const{store:i}=this.client,a=Id(e)(i.getState());this.dispatch(ai(e));const n=this.enqueueRequest({description:"Deleting asset stage completions",method:l.DELETE,url:"/asset-stage-completions/bulk/",payload:{uuids:e},blockers:e,blocks:[]});return n.catch(()=>{this.dispatch(si(a))}),n}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset stage completions",method:l.GET,url:"/asset-stage-completions/",queryParams:{limit:V,paginate:!0,asset_procedure__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset stage completions",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(yd(n)),n}}class wb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(ri(c));const r=this.enqueueRequest({description:"Create asset",method:l.POST,url:"/asset-stages/",payload:v(c),blockers:[c.asset_procedure_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(qt(m))}).catch(()=>{this.dispatch(di(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=ui(e.uuid)(i.getState());if(!a)throw new Error(`No asset stage with uuid ${e.uuid} found in the store`);const n={...a,...e};this.dispatch(qt(n));const c=this.enqueueRequest({description:"Update asset stage",method:l.PATCH,url:`/asset-stages/${a.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return c.then(r=>{this.dispatch(qt(r))}).catch(()=>{this.dispatch(Fd(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=ui(e)(a);if(!n)throw new Error(`No asset stage with uuid ${e} found in the store`);return this.dispatch(di(e)),this.enqueueRequest({description:"Delete asset stage",method:l.DELETE,url:`/asset-stages/${e}/`,blockers:[e],blocks:[]}).catch(c=>{throw this.dispatch(ri(n)),c})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset stages",method:l.GET,url:"/asset-stages/",queryParams:{asset_procedure_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(bd(a)),a}}class Mb extends We{constructor(){super(...arguments);S(this,"name","Asset Type Attachment");S(this,"url","/asset-type-attachments");S(this,"addAttachments",li);S(this,"updateAttachments",wd);S(this,"removeAttachments",hi);S(this,"removeAttachment",Md);S(this,"setAttachment",vd);S(this,"selectAttachment",jd)}buildOfflineAttachment(i){return b({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,asset_type:i.modelUuid})}buildAttachmentPayload(i){return{...i,asset_type:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.assetTypeUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const n=await this.enqueueRequest({immediate:!0,description:"Get asset type attachments",method:l.GET,url:`${this.url}/`,queryParams:{asset_type__organization:i},blocks:[],blockers:[]},a);return this.dispatch(Rd(n)),n}}class Eb extends j{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:y}=o,A=await this.getFilePayload(y);A.sha1 in n||(n[A.sha1]=A);const I=b({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:A.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});c.push(I);const F={uuid:I.uuid,file_name:y.name,field_identifier:p,file_extension:A.extension,file_sha1:A.sha1,fields_revision:h};r.push(F)}this.dispatch(Cd(c));const u=this.enqueueRequest({description:"Add asset type fields attachments",method:l.POST,url:"/asset-type-fields-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(n)},blockers:c.map(o=>o.fields_revision),blocks:c.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(kd(o.attachments))}).catch(()=>{this.dispatch(Bd(c.map(o=>o.uuid)))}),[c,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset type fields attachments",method:l.GET,url:"/asset-type-fields-attachments/",queryParams:{fields_revision__asset_type__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(Dd(a)),a}}class Vb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(Wd(c));const r=this.enqueueRequest({description:"Add Asset Type Fields",method:l.POST,url:"/asset-type-fields/",payload:v(c),blockers:[c.asset_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(Kd(m))}).catch(m=>{throw this.dispatch(Yd(c.uuid)),m}),[c,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Asset Type Fields",method:l.GET,url:"/asset-type-fields/",queryParams:{asset_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Hd(a)),a}}class jb extends j{async bulkAdd(e,i){var o;const a=new Date().toISOString(),n=(o=this.client.store.getState().userReducer.currentUser)==null?void 0:o.id,c=Ye(e,i??e.length),r=[],u=[];for(const h of c){const p={},y=[];for(const A of h){const{fieldValuesUuid:I,fieldIdentifier:F,file:_}=A,w=await this.getFilePayload(_);w.sha1 in p||(p[w.sha1]=w);const z=b({file:URL.createObjectURL(_),file_type:_.type,file_name:_.name,file_sha1:w.sha1,created_by:n,field_values:I,submitted_at:a,field_identifier:F});r.push(z);const Le={uuid:z.uuid,file_name:_.name,file_sha1:w.sha1,file_extension:w.extension,field_identifier:F,field_values:I};y.push(Le)}u.push({submitted_at:a,attachments:y,files:Object.values(p)})}this.dispatch(Dt(r));const m=u.map(h=>this.enqueueRequest({description:"Add asset type field values attachments",method:l.POST,url:"/asset-type-field-values-attachments/bulk/",payload:h,blockers:h.attachments.map(p=>p.field_values),blocks:h.attachments.map(p=>p.uuid)}));return Promise.all(m).then(h=>{for(const y of h)this.processPresignedUrls(y.presigned_urls);const p=h.flatMap(y=>y.attachments);this.dispatch(xd(p))}).catch(h=>{throw this.dispatch(Ct(r.map(p=>p.uuid))),h}),[r,m.map(h=>h.then(({attachments:p})=>p))]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),n=tu(e)(a);this.dispatch(Ct(e));try{await this.enqueueRequest({description:"Delete asset type field values attachments",method:l.DELETE,url:"/asset-type-field-values-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(c){throw this.dispatch(Dt(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset type field values attachments",method:l.GET,url:"/asset-type-field-values-attachments/",queryParams:{limit:He,paginate:!0,field_values__asset__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset type field values attachments",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Qd(n)),n}}class qb extends R{add(e){var r;const{store:i}=this.client,a=i.getState(),n=b({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),c=this.enqueueRequest({description:"Add asset type field values",method:l.POST,url:"/asset-type-field-values/",payload:v(n),blockers:[e.asset,e.fields_revision],blocks:[n.uuid]});return this.dispatch(Si(n)),c.then(u=>(this.dispatch(lt(u)),u)).catch(()=>{this.dispatch(Ti(n.uuid))}),[n,c]}bulkAdd(e,i){var m;const a=new Date().toISOString(),n=[],c=Ye(e.payloads,i??e.payloads.length),r=[];for(const o of c){const h=[];for(const p of o){const y=b({...p,values:p.values,created_by:(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,submitted_at:a});n.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(cu(n));const u=[];for(const o of r){const h=o.field_values.map(I=>I.asset),p=o.field_values.map(I=>I.fields_revision),y=o.field_values.map(I=>I.uuid),A=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(A)}return Promise.all(u).then(o=>{this.dispatch(ru(o.flat()))}).catch(()=>{this.dispatch(du(n.map(o=>o.uuid)))}),[n,u]}update(e){const{store:i}=this.client,a=i.getState(),n=gi(e.uuid)(a);if(!n)throw new Error(`Expected AssetTypeFieldValues with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(lt(c));const r=this.enqueueRequest({description:"Delete asset type field values",method:l.PATCH,url:`/asset-type-field-values/${e.uuid}/`,payload:e,blockers:[c.uuid,c.fields_revision,c.asset],blocks:[c.uuid]});return r.then(u=>{this.dispatch(lt(u))}).catch(()=>{this.dispatch(lt(n))}),[c,r]}async delete(e){const{store:i}=this.client,a=i.getState(),n=gi(e)(a);if(!n)throw new Error(`Expected submission with uuid ${e} to exist`);const c=su(e)(a);this.dispatch(Ti(e)),this.dispatch(Ct(c.map(r=>r.uuid)));try{await this.enqueueRequest({description:"Delete asset type field values",method:l.DELETE,url:`/asset-type-field-values/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(Si(n)),this.dispatch(Dt(c)),r}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset type field values",method:l.GET,url:"/asset-type-field-values/",queryParams:{limit:V,paginate:!0,asset__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset type field values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(nu(n)),n}}class zb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(Fi(c));const r=this.enqueueRequest({description:"Create asset type identifier",method:l.POST,url:"/asset-type-identifiers/",payload:v(c),blockers:[c.asset_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(ht(m))}).catch(()=>{this.dispatch(Pi(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=Oi(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset type identifier with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(ht(n));const c=this.enqueueRequest({description:"Update asset type identifier",method:l.PATCH,url:`/asset-type-identifiers/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(ht(r))}).catch(()=>{this.dispatch(ht(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Oi(e)(a);if(!n)throw new Error(`Expected asset type identifier with uuid ${e} to exist`);this.dispatch(Pi(e));try{return await this.enqueueRequest({description:"Delete asset type identifier",method:l.DELETE,url:`/asset-type-identifiers/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(Fi(n)),c}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset type identifiers",method:l.GET,url:"/asset-type-identifiers/",queryParams:{asset_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(hu(a)),a}}class Ub extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(Ri(c));const r=this.enqueueRequest({description:"Create asset type identifier value",method:l.POST,url:"/asset-type-identifier-values/",payload:v(c),blockers:[e.asset,e.asset_type_identifier],blocks:[c.uuid]});return r.then(m=>{this.dispatch(mt(m))}).catch(()=>{this.dispatch(vi(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=Mi(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset type identifier value with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(mt(n));const c=this.enqueueRequest({description:"Update asset type identifier value",method:l.PATCH,url:`/asset-type-identifier-values/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(mt(r))}).catch(()=>{this.dispatch(mt(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Mi(e)(a);if(!n)throw new Error(`Expected asset type identifier value with uuid ${e} to exist`);this.dispatch(vi(e));try{return await this.enqueueRequest({description:"Delete asset type identifier value",method:l.DELETE,url:`/asset-type-identifier-values/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(Ri(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get asset type identifier values",method:l.GET,url:"/asset-type-identifier-values/",queryParams:{limit:V,paginate:!0,asset__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get asset type identifier values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(fu(n)),n}}class Db extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(Vi(c));const r=this.enqueueRequest({description:"Create asset type",method:l.POST,url:"/asset-types/",payload:v(c),blockers:[],blocks:[c.uuid]});return r.then(m=>{this.dispatch(pt(m))}).catch(()=>{this.dispatch(ji(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=zi(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset type with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(pt(n));const c=this.enqueueRequest({description:"Update asset type",method:l.PATCH,url:`/asset-types/${e.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return c.then(r=>{this.dispatch(pt(r))}).catch(()=>{this.dispatch(pt(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=zi(e)(a);if(!n)throw new Error(`Expected asset type with uuid ${e} to exist`);const c=Qs(e)(a),r=qd(e)(a);return this.dispatch(ji(e)),this.dispatch(Js(c.map(u=>u.uuid))),this.dispatch(hi(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(Vi(n)),this.dispatch(jt(c)),this.dispatch(li(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(gu(a)),a}}class Cb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(Di(c));const r=this.enqueueRequest({description:"Create Category",method:l.POST,url:"/categories/",payload:v(c),blockers:[e.project],blocks:[c.uuid]});return[c,r]}update(e){const i=this.client.store.getState(),a=ki(e.uuid)(i);if(!a)throw new Error(`Expected an existing category with uuid ${e.uuid}`);const n={...a,...e};this.dispatch(wu(n));const c=this.enqueueRequest({description:"Edit Category",method:l.PATCH,url:`/categories/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return[n,c]}remove(e){const{store:i}=this.client,a=ki(e)(i.getState());if(!a)throw new Error(`No category with uuid ${e} found in the store`);this.dispatch(Mu(e));const n=this.enqueueRequest({description:"Delete Category",method:l.DELETE,url:`/categories/${a.uuid}/`,blockers:[a.uuid],blocks:[]});return n.catch(()=>{this.dispatch(Di(a))}),n}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get categories",method:l.GET,url:"/categories/",queryParams:{project__organization:e},blocks:[],blockers:[]},i);return this.dispatch(vu(a)),a}}class kb extends We{constructor(){super(...arguments);S(this,"name","Document Attachment");S(this,"url","/document-attachments");S(this,"addAttachments",zu);S(this,"updateAttachments",Du);S(this,"removeAttachments",ku);S(this,"removeAttachment",Cu);S(this,"setAttachment",Uu);S(this,"selectAttachment",Gu)}buildOfflineAttachment(i){return b({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,document:i.modelUuid})}buildAttachmentPayload(i){return{...i,document:i.modelUuid}}async bulkAdd(i){var p;const{store:a}=this.client,n=(p=a.getState().userReducer.currentUser)==null?void 0:p.id,c=new Date().toISOString(),r=[],u=[],m={},o={};for(const y of i){const{documentUuid:A,file:I}=y,F=await this.getFilePayload(I);F.sha1 in m||(m[F.sha1]=F,o[F.sha1]=[]);const _=this.buildOfflineAttachment({file:I,file_sha1:F.sha1,submitted_at:c,created_by:n,description:"",modelUuid:A});r.push(_),u.push({uuid:_.uuid,file_name:_.file_name,file_sha1:_.file_sha1,file_extension:F.extension,description:_.description,document:A}),o[F.sha1].push(_.uuid)}this.dispatch(this.addAttachments(r));const h=this.enqueueRequest({description:"Attach files to document",method:l.POST,url:"/document-attachments/bulk/",payload:{submitted_at:c,attachments:u,files:Object.values(m)},blocks:r.map(y=>y.uuid),blockers:r.map(y=>y.file_sha1)});return h.then(({attachments:y,presigned_urls:A})=>{this.dispatch(this.updateAttachments(y));const I=this.processPresignedUrls(A);for(const[F,_]of Object.entries(I))_.then(()=>{const w=o[F];for(const z of w)this.makeReadable(z)})}).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 n=await this.enqueueRequest({immediate:!0,description:"Get document attachments",method:l.GET,url:"/document-attachments/",queryParams:{document__project__organization:i},blocks:[],blockers:[]},a),c=await this.enqueueRequest({immediate:!0,description:"Get document attachments",method:l.GET,url:"/document-attachments/",queryParams:{document__organization:i},blocks:[],blockers:[]},a),r=[...n,...c];return this.dispatch(qu(r)),r}}class Bb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(Wu([c]));const r=this.enqueueRequest({description:"Create Document",method:l.POST,url:"/documents/",payload:v(c),queryParams:{parent_document:c.parent_document??void 0},blockers:c.parent_document?[c.parent_document]:[],blocks:[c.uuid]});return r.catch(()=>{this.dispatch(Gi([c.uuid]))}),[c,r]}update(e){const{store:i}=this.client,a=i.getState().documentsReducer.documents[e.uuid];if(!a)throw new Error(`attempting to update a document with uuid ${e.uuid} that does not exist in store.documents`);const n={...a,...e};this.dispatch(xe([n]));const c=this.enqueueRequest({description:"Update Document",method:l.PATCH,url:`/documents/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.catch(()=>{xe([a])}),[n,c]}delete(e){const{store:i}=this.client,a=Bt(i.getState()),n=Ku(e)(i.getState());if(!n)throw new Error(`attempting to delete a document with uuid ${e} that does not exist in store.documents`);const c=n.parent_document?a[n.parent_document]:void 0;this.dispatch(Gi([e]));const r=this.enqueueRequest({description:"Delete Document",method:l.DELETE,url:`/documents/${e}/`,blockers:[e],blocks:[]});return r.then(u=>{this.dispatch(xe(u))}).catch(()=>{this.dispatch(xe([n])),c&&this.dispatch(xe([c]))}),r}async refreshStore(e,i){const a=this.enqueueRequest({immediate:!0,description:"Get project documents",method:l.GET,url:"/documents/",queryParams:{project__organization:e},blockers:[],blocks:[]},i),n=this.enqueueRequest({immediate:!0,description:"Get organization documents",method:l.GET,url:"/documents/",queryParams:{organization:e},blockers:[],blocks:[]},i),c=[...await a,...await n];return this.dispatch(Hu(c)),c}}class $b extends R{async add(e,i){return this.enqueueRequest({description:"Add email domain to organization",method:l.POST,url:"/organization-email-domains/",payload:{email:i,organization:e},blockers:[e,"create-org"],blocks:[]})}async remove(e){return this.dispatch(Qu(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(Xu(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(Ju(a)),a}}class Gb extends R{async getVerificationCode(e){return this.enqueueRequest({description:"Get verification code",method:l.GET,url:`/verification/email-verification/${e}/`,isAuthNeeded:!1,blockers:[],blocks:[]})}validateVerificationCode(e,i=void 0){return this.enqueueRequest({description:"Validate verification code",method:l.POST,url:`/verification/email-verification/${e}/`,isAuthNeeded:!1,payload:i,blockers:[],blocks:[]})}}const Xt={},Yn=new Set;let Qt=0,Zn=0,Jn=0;const Lb=20;class Nb extends R{constructor(){super(...arguments);S(this,"host");S(this,"_dbPromise",Yp.openDB("fileCache",1,{upgrade(i){i.createObjectStore("files")}}))}async renewUploadUrl(i){const a=await this.fetchCache(i);if(!a)throw new Error(`File with sha1 ${i} not found in cache`);const n=await as(a,i),c=await this.enqueueRequest({description:"Get S3 URL",method:l.GET,url:"/authentication/files/presigned-upload-url/",queryParams:{sha1:await Qe(a),file_type:a.type,extension:a.name.split(".").pop(),size:a.size.toString()},blockers:[],blocks:[`s3-${n}`]});return"url"in c&&this.dispatch(ao({sha1:i,...c})),c}async addCache(i,a){if(Yn.has(a))return;if(!i.type){const r=i.name.split("."),u=r[r.length-1];i=new File([i],i.name,{type:u})}if(!i.name||!i.size||!i.type)throw new Error("Cannot add files to cache that do not have a name, size and type.");const n=await this._dbPromise;!!await n.get("files",a)?(console.error("File already cached (this is unexpected at this point):",i.name,a),Qt++):(await n.put("files",i,a),Zn++),Yn.add(a),Jn++,Jn%Lb===0&&console.debug(`File cache summary: ${Qt} hits and ${Zn} misses, ${Qt/(Qt+Zn)*100}% hit rate over ${Jn} calls to addCache.`)}async removeCache(i){await(await this._dbPromise).delete("files",i),Yn.delete(i)}async fetchCache(i){return(await this._dbPromise).get("files",i)}async getOrRenewUploadUrl(i){const a=this.client.store.getState();return no(i)(a)??await this.renewUploadUrl(i)}async uploadFileToS3(i){const a=await this.fetchCache(i);if(!a)throw new Error(`File with sha1 ${i} not found in cache`);const n=await as(a,i),c={file_name:a.name,file_sha1:i,file:n},r=await this.getOrRenewUploadUrl(i);if("warning"in r){if(r.warning==="already_uploaded")return[c,Promise.resolve(void 0)];throw new Error(r.warning)}const u=r.url,m=this.enqueueRequest({url:u,description:"Upload file",method:l.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:i,blockers:[`s3-${n}`],blocks:[i],s3url:r});return[c,m]}async fetchFileFromUrl(i,a,n){const c=i.split("?")[0]??i,r=await this.fetchCache(a);if(r){if(!r.name)throw new Error("Cached file unexpectedly has no name.");return r}if(i.startsWith("blob:")){const h=await uc(i),p=new File([h],n??a,{type:h.type});return await this.addCache(p,a),p}let u=Xt[c],m=!0;u?m=!1:(u=new Promise(h=>{this.enqueueRequest({description:"Download file",method:l.GET,url:i,isExternalUrl:!0,isResponseBlob:!0,isAuthNeeded:!1,blockers:[a],blocks:[a]}).then(p=>{const y=new File([p],n??a,{type:p.type});h(y)})}),Xt[c]=u);let o;try{o=await u}catch(h){throw m&&h instanceof D&&delete Xt[c],h}if(m){const h=await Qe(o);if(h!==a){const A=`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,mt,at,kF,NF,GF,oc,HF,hc,WF,KF,rR,dR,YF,ZF,JF){"use strict";var cR=Object.defineProperty;var aR=(i,L,l)=>L in i?cR(i,L,{enumerable:!0,configurable:!0,writable:!0,value:l}):i[L]=l;var h=(i,L,l)=>aR(i,typeof L!="symbol"?L+"":L,l);var UF;const mc=Object.freeze([]),pc=Object.freeze({});var yc=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))(yc||{}),o=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(o||{}),fc=(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))(fc||{}),Sc=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(Sc||{}),as=(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))(as||{}),$=(t=>(t.STATUS="status",t.PRIORITY="priority",t.DESCRIPTION="description",t.TITLE="title",t.ASSIGNED_TO="assigned_to",t.DUE_DATE="due_date",t))($||{}),Ac=(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))(Ac||{}),Ic=(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))(Ic||{}),Tc=(t=>(t[t.APPROVED=0]="APPROVED",t[t.REJECTED=2]="REJECTED",t[t.CHANGES_REQUESTED=4]="CHANGES_REQUESTED",t))(Tc||{});const XF=as.MEDIUM,Oc=6e4;function P(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 QF(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 _t="versioning",T=l.createAction("RESET"),V=l.createAction("RESET_PROJECT_STATE"),F=l.createAction("RESET_ORGANIZATION_STATE");function xF(t,s){return kF.useMemo(t,s)}UF=Symbol.toStringTag;class rs{constructor(){h(this,UF,"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 eb(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 tb(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?mc:t,ls=t=>Object.keys(t).length===0?pc:t,Pc=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)}),sb=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),ib=1e3*86400,os=new Date,nb=t=>new Date(t).toDateString()===os.toDateString(),cb=us((t,s,e)=>{const n=Math.round((new Date(t).getTime()-os.getTime())/ib);return n<s||n>e?Pc(t):sb.format(n,"days")});function ab(t){return new Uint8Array(t).reduce((e,n)=>e+n.toString(16).padStart(2,"0"),"")}function zt(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=ab(r);s(a)})},n.readAsArrayBuffer(t)})}const rb=(t,s)=>`${t}${s?`.${s}`:""}`;function db(t,s){return new File([t],s,{type:t.type})}function Fc(t){const s=t.name;return s.includes(".")?s.split(".").pop():""}const bc=async t=>(await fetch(t)).blob(),_c=async(t,s)=>{const e=await bc(t);return new File([e],s,{type:e.type})};function ub(t){const s=new Blob([t]);NF.saveAs(s,t.name)}function gc(t){return typeof t=="string"&&t.startsWith("blob:")}function lb(t){return t.type.startsWith("image/")}const Mc={};function ob(t,s,e,...n){const c=Mc[t];let r=!1;c?c[s]||(c[s]=!0,r=!0):(Mc[t]={[s]:!0},r=!0),r&&console[e](...n)}const Rc=["created_at","updated_at","index","revision"];function O(t){return{...t,uuid:at.v4()}}function hb(t){const s={};for(const e of t)s[e.uuid]=e;return s}function E(t){return t.map(({uuid:s})=>s)}function Dt(t,s){return t.localeCompare(s)}function hs(t,s){return Dt(t.uuid,s.uuid)}function mb(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 pb(t){return t.toLowerCase().replace(" ","-")}function yb(t,s=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,s?"_":"-")}function fb(t,s){if(t.length<=s)return t;const e=t.slice(0,s-1);return e.slice(0,e.lastIndexOf(" "))+"…"}const Sb=/^.+@.+\..+$/;function M(t){const s={...t};for(const e of[...Rc,"created_by"])e in s&&delete s[e];return s}const wc=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,vc=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,Ec=t=>GF(t,{id:s=>s.uuid,parentId:s=>s.parent_document,includeEmptyChildrenArray:!0,valueKey:!1}),Ab=t=>{const{roots:s}=Ec(t);return s.map(e=>new oc.Tree(e))},Bc=(t,s)=>{const{nodes:e}=Ec(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in document tree.`);return new oc.Tree(n)},pt=(t,s)=>t.submitted_at===s.submitted_at?0:t.submitted_at<s.submitted_at?-1:1;class Ib{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=P(t=>t.uuid),Vc={instances:{}},ms=l.createSlice({name:"agents",initialState:Vc,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Vc)),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:zc,addConversation:Dc,addConversations:Tb,setConversation:jc,setConversations:Ob,updateConversation:qc,updateConversations:Pb,deleteConversation:Fb,deleteConversations:bb}=ms.actions,ps=t=>t.agentsReducer.instances,_b=l.createSelector([ps],t=>Object.values(t)),gb=y(l.createSelector([ps,(t,s)=>s],(t,s)=>t[s])),Cc=ms.reducer,H=P(t=>t.uuid),$c={instances:{}},ys=l.createSlice({name:"assetAttachments",initialState:$c,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,$c)),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:Uc,addAssetAttachment:Lc,addAssetAttachments:fs,setAssetAttachment:kc,setAssetAttachments:Nc,updateAssetAttachment:Gc,updateAssetAttachments:Hc,deleteAssetAttachment:Wc,deleteAssetAttachments:Ss}=ys.actions,Kc=t=>t.assetAttachmentReducer.instances,As=l.createSelector([Kc],t=>Object.values(t)),Yc=t=>s=>s.assetAttachmentReducer.instances[t],Zc=y(l.createSelector([As,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Jc=y(l.createSelector([As,(t,s)=>s],(t,s)=>S(t.filter(({asset:e})=>s===e)))),Xc=ys.reducer,W=P(t=>t.uuid),Qc={instances:{}},Is=l.createSlice({name:"assetComments",initialState:Qc,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Qc)),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:xc,addAssetComment:ea,addAssetComments:jt,setAssetComment:ta,setAssetComments:sa,updateAssetComment:ia,updateAssetComments:na,deleteAssetComment:ca,deleteAssetComments:qt}=Is.actions,aa=t=>t.assetCommentReducer.instances,Ct=l.createSelector([aa],t=>S(Object.values(t).toSorted(pt))),ra=t=>s=>s.assetCommentReducer.instances[t],da=y(l.createSelector([Ct,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),ua=y(l.createSelector([Ct,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset===s)))),la=y(l.createSelector([Ct,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(n=>e.has(n.asset)))})),oa=Is.reducer,K=P(t=>t.uuid),ha={instances:{}},Ts=l.createSlice({name:"assets",initialState:ha,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,ha)),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:ma,addAsset:pa,addAssets:Os,updateAsset:ya,updateAssets:fa,deleteAsset:Sa,deleteAssets:Ps,setAsset:Aa,setAssets:Ia}=Ts.actions,Ta=t=>t.assetReducer.instances,$t=l.createSelector([Ta],t=>S(Object.values(t))),Mb=y(l.createSelector([$t,(t,s)=>s],(t,s)=>S(t.filter(({project:e})=>e===s)))),Oa=y(l.createSelector([$t,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_type===s)))),Pa=t=>s=>s.assetReducer.instances[t],Fa=y(l.createSelector([$t,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),ba=Ts.reducer,Y=P(t=>t.uuid),_a={instances:{}},Fs=l.createSlice({name:"assetTypeAttachments",initialState:_a,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,_a)),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:ga,addAssetTypeAttachment:Ma,addAssetTypeAttachments:bs,setAssetTypeAttachment:Ra,setAssetTypeAttachments:wa,updateAssetTypeAttachment:va,updateAssetTypeAttachments:Ea,deleteAssetTypeAttachment:Ba,deleteAssetTypeAttachments:_s}=Fs.actions,Va=t=>t.assetTypeAttachmentReducer.instances,gs=l.createSelector([Va],t=>Object.values(t)),za=t=>s=>s.assetTypeAttachmentReducer.instances[t],Da=y(l.createSelector([gs,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),ja=y(l.createSelector([gs,(t,s)=>s],(t,s)=>S(t.filter(({asset_type:e})=>s===e)))),qa=Fs.reducer,Z=P(t=>t.uuid),Ca={instances:{}},Ms=l.createSlice({name:"assetTypeFieldsAttachments",initialState:Ca,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Ca)),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:$a,addAssetTypeFieldsAttachment:Ua,addAssetTypeFieldsAttachments:La,setAssetTypeFieldsAttachment:ka,setAssetTypeFieldsAttachments:Na,updateAssetTypeFieldsAttachment:Ga,updateAssetTypeFieldsAttachments:Ha,deleteAssetTypeFieldsAttachment:Wa,deleteAssetTypeFieldsAttachments:Ka}=Ms.actions,Ya=t=>t.assetTypeFieldsAttachmentReducer.instances,Rs=l.createSelector([Ya],t=>Object.values(t)),Rb=y(l.createSelector([Rs,(t,s)=>s],(t,s)=>S(t.filter(e=>e.fields_revision===s)))),Za=t=>s=>s.assetTypeFieldsAttachmentReducer.instances[t],Ja=y(l.createSelector([Rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Xa=Ms.reducer,J=P(t=>t.uuid),Qa={instances:{}},ws=l.createSlice({name:"assetTypeFields",initialState:Qa,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Qa)),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:xa,addAssetTypeFields:er,addAssetTypeFieldsMany:tr,setAssetTypeFields:sr,setAssetTypeFieldsMany:ir,updateAssetTypeFields:nr,updateAssetTypeFieldsMany:cr,deleteAssetTypeFields:ar,deleteAssetTypeFieldsMany:rr}=ws.actions,dr=t=>t.assetTypeFieldsReducer.instances,gt=l.createSelector([dr],t=>Object.values(t)),wb=y(l.createSelector([gt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_type===s)))),vb=y(l.createSelector([gt,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_type===s).toSorted(pt).pop())),ur=t=>s=>s.assetTypeFieldsReducer.instances[t],lr=y(l.createSelector([gt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),or=ws.reducer,X=P(t=>t.uuid),hr={instances:{}},vs=l.createSlice({name:"assetTypeFieldValuesAttachments",initialState:hr,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,hr)),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:mr,addAssetTypeFieldValuesAttachment:pr,addAssetTypeFieldValuesAttachments:Es,setAssetTypeFieldValuesAttachment:yr,setAssetTypeFieldValuesAttachments:fr,updateAssetTypeFieldValuesAttachment:Sr,updateAssetTypeFieldValuesAttachments:Ar,deleteAssetTypeFieldValuesAttachment:Ir,deleteAssetTypeFieldValuesAttachments:Bs}=vs.actions,Tr=t=>t.assetTypeFieldValuesAttachmentReducer.instances,Vs=l.createSelector([Tr],t=>Object.values(t)),Or=t=>s=>s.assetTypeFieldValuesAttachmentReducer.instances[t],Pr=y(l.createSelector([Vs,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Fr=y(l.createSelector([Vs,(t,s)=>s],(t,s)=>S(t.filter(e=>e.field_values===s)))),br=vs.reducer,Q=P(t=>t.uuid),_r={instances:{}},zs=l.createSlice({name:"assetTypeFieldValues",initialState:_r,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,_r)),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:gr,addAssetTypeFieldValues:Mr,addAssetTypeFieldValuesMany:Rr,setAssetTypeFieldValues:wr,setAssetTypeFieldValuesMany:vr,updateAssetTypeFieldValues:Er,updateAssetTypeFieldValuesMany:Br,deleteAssetTypeFieldValues:Vr,deleteAssetTypeFieldValuesMany:zr}=zs.actions,Dr=t=>t.assetTypeFieldValuesReducer.instances,Ut=l.createSelector([Dr],t=>Object.values(t)),Eb=y(l.createSelector([Ut,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset===s)))),Bb=y(l.createSelector([gt,Ut,(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)))})),jr=t=>s=>s.assetTypeFieldValuesReducer.instances[t],qr=y(l.createSelector([Ut,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Cr=zs.reducer,x=P(t=>t.uuid),$r={instances:{}},Ds=l.createSlice({name:"assetTypeIdentifiers",initialState:$r,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,$r)),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:Ur,addAssetTypeIdentifier:Lr,addAssetTypeIdentifiers:kr,setAssetTypeIdentifier:Nr,setAssetTypeIdentifiers:Gr,updateAssetTypeIdentifier:Hr,updateAssetTypeIdentifiers:Wr,deleteAssetTypeIdentifier:Kr,deleteAssetTypeIdentifiers:Yr}=Ds.actions,Zr=t=>t.assetTypeIdentifierReducer.instances,js=l.createSelector([Zr],t=>Object.values(t)),Jr=t=>s=>s.assetTypeIdentifierReducer.instances[t],Xr=y(l.createSelector([js,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Vb=y(l.createSelector([js,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_type===s)))),Qr=Ds.reducer,ee=P(t=>t.uuid),xr={instances:{}},qs=l.createSlice({name:"assetTypeIdentifierValues",initialState:xr,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,xr)),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:ed,addAssetTypeIdentifierValue:td,addAssetTypeIdentifierValues:sd,setAssetTypeIdentifierValue:id,setAssetTypeIdentifierValues:nd,updateAssetTypeIdentifierValue:cd,updateAssetTypeIdentifierValues:ad,deleteAssetTypeIdentifierValue:rd,deleteAssetTypeIdentifierValues:dd}=qs.actions,ud=t=>t.assetTypeIdentifierValueReducer.instances,Lt=l.createSelector([ud],t=>Object.values(t)),ld=t=>s=>s.assetTypeIdentifierValueReducer.instances[t],od=y(l.createSelector([Lt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),zb=y(l.createSelector([Lt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset===s)))),Db=y(l.createSelector([Lt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_type_identifier===s)))),hd=qs.reducer,te=P(t=>t.uuid),md={instances:{}},Cs=l.createSlice({name:"assetTypes",initialState:md,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,md)),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:pd,setAssetType:yd,setAssetTypes:fd,addAssetType:Sd,addAssetTypes:Ad,updateAssetType:Id,updateAssetTypes:Td,deleteAssetType:Od,deleteAssetTypes:Pd}=Cs.actions,Fd=t=>t.assetTypeReducer.instances,$s=l.createSelector([Fd],t=>Object.values(t)),bd=t=>s=>s.assetTypeReducer.instances[t],_d=y(l.createSelector([$s,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),jb=y(l.createSelector([$s,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),gd=Cs.reducer,se=P(t=>t.uuid),Md={instances:{}},Us=l.createSlice({name:"assetTypeStatuses",initialState:Md,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Md)),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:Rd,addAssetTypeStatus:wd,addAssetTypeStatuses:vd,setAssetTypeStatus:Ed,setAssetTypeStatuses:Bd,updateAssetTypeStatus:Vd,updateAssetTypeStatuses:zd,deleteAssetTypeStatus:Dd,deleteAssetTypeStatuses:jd}=Us.actions,qd=t=>t.assetTypeStatusReducer.instances,Ls=l.createSelector([qd],t=>S(Object.values(t).toSorted(wc))),Cd=t=>s=>s.assetTypeStatusReducer.instances[t],$d=y(l.createSelector([Ls,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),qb=y(l.createSelector([Ls,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_type===s)))),Ud=Us.reducer,Ld={accessToken:"",refreshToken:"",isLoggedIn:!1},kt=l.createSlice({name:"auth",initialState:Ld,extraReducers:t=>t.addCase(T,s=>Object.assign(s,Ld)),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||kt.caseReducers.clearTokens(t),t.isLoggedIn=s.payload}}}),{setTokens:Cb,clearTokens:$b,setLoggedIn:kd}=kt.actions,Ub=t=>t.authReducer.accessToken,Lb=t=>t.authReducer.isLoggedIn,Nd=kt.reducer,ie=P(t=>t.uuid),Gd={instances:{}},ks=l.createSlice({name:"documentAttachments",initialState:Gd,extraReducers:t=>t.addCase(T,s=>Object.assign(s,Gd)),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:Hd,addDocumentAttachment:Wd,addDocumentAttachments:Kd,setDocumentAttachment:Yd,setDocumentAttachments:Zd,updateDocumentAttachment:Jd,updateDocumentAttachments:Xd,deleteDocumentAttachment:Qd,deleteDocumentAttachments:xd}=ks.actions,eu=t=>t.documentAttachmentReducer.instances,Ns=l.createSelector([eu],t=>Object.values(t)),tu=t=>s=>s.documentAttachmentReducer.instances[t],su=y(l.createSelector([Ns,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),kb=y(l.createSelector([Ns,(t,s)=>s],(t,s)=>S(t.filter(({document:e})=>s===e)))),iu=ks.reducer,ne=P(({uuid:t})=>t),nu={instances:{}},Gs=l.createSlice({name:"documents",initialState:nu,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>{Object.assign(s,nu)}),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:cu,addDocument:au,addDocuments:ru,setDocument:du,setDocuments:uu,updateDocument:lu,updateDocuments:ou,deleteDocument:hu,deleteDocuments:mu}=Gs.actions,pu=Gs.reducer,Hs=t=>t.documentsReducer.instances,Nt=l.createSelector([Hs],t=>Object.values(t)),yu=t=>s=>s.documentsReducer.instances[t],fu=y(l.createSelector([Nt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Nb=y(l.createSelector([Nt,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),Gb=y(l.createSelector([Nt,(t,s)=>s],(t,s)=>t.filter(e=>e.organization===s))),Su=y(l.createSelector([Hs,(t,s)=>s],(t,s)=>{if(!t[s])return S([]);const c=Bc(s,Object.values(t)).all().map(({model:r})=>r);return S(c)})),ce=P(t=>t.uuid),Au={instances:{}},Ws=l.createSlice({name:"emailDomains",initialState:Au,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Au)),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:Iu,addEmailDomain:Tu,addEmailDomains:Ou,setEmailDomain:Pu,setEmailDomains:Fu,updateEmailDomain:bu,updateEmailDomains:_u,deleteEmailDomain:gu,deleteEmailDomains:Mu}=Ws.actions,Ru=t=>t.emailDomainsReducer.instances,Ks=l.createSelector([Ru],t=>Object.values(t)),wu=t=>s=>s.emailDomainsReducer.instances[t],vu=y(l.createSelector([Ks,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Hb=y(l.createSelector([Ks,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),Eu=Ws.reducer,Bu={s3Urls:{}},Vu=1e3*60*60,Wb=Vu*24*7,Ys=l.createSlice({name:"file",initialState:Bu,extraReducers:t=>t.addCase(T,s=>Object.assign(s,Bu)),reducers:{setUploadUrl:(t,s)=>{const{url:e,fields:n,sha1:c}=s.payload,r=new Date,a=new Date(r.getTime()+Wb);t.s3Urls[c]={url:e,fields:n,exp:a.getTime()}}}}),{setUploadUrl:Kb}=Ys.actions,Yb=t=>s=>{const e=s.fileReducer.s3Urls[t];if(!e)return;const n=new Date().getTime();if(!((e.exp??n)-n<Vu))return e},zu=Ys.reducer,ae=P(t=>t.uuid),Du={instances:{}},Zs=l.createSlice({name:"formIdentifiers",initialState:Du,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Du)),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:ju,addFormIdentifier:qu,addFormIdentifiers:Cu,setFormIdentifier:$u,setFormIdentifiers:Uu,updateFormIdentifier:Lu,updateFormIdentifiers:ku,deleteFormIdentifier:Nu,deleteFormIdentifiers:Gu}=Zs.actions,Hu=t=>t.formIdentifierReducer.instances,Js=l.createSelector([Hu],t=>Object.values(t)),Wu=t=>s=>s.formIdentifierReducer.instances[t],Ku=y(l.createSelector([Js,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Zb=y(l.createSelector([Js,(t,s)=>s],(t,s)=>S(t.filter(e=>e.form===s)))),Yu=Zs.reducer,re=P(t=>t.uuid),Zu={instances:{}},Xs=l.createSlice({name:"formIdentifierValues",initialState:Zu,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Zu)),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:Ju,addFormIdentifierValue:Xu,addFormIdentifierValues:Qu,setFormIdentifierValue:xu,setFormIdentifierValues:el,updateFormIdentifierValue:tl,updateFormIdentifierValues:sl,deleteFormIdentifierValue:il,deleteFormIdentifierValues:nl}=Xs.actions,cl=t=>t.formIdentifierValueReducer.instances,Gt=l.createSelector([cl],t=>Object.values(t)),al=t=>s=>s.formIdentifierValueReducer.instances[t],rl=y(l.createSelector([Gt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Jb=y(l.createSelector([Gt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.form_submission===s)))),Xb=y(l.createSelector([Gt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.form_identifier===s)))),dl=Xs.reducer,de=P(t=>t.uuid),ul={instances:{}},Qs=l.createSlice({name:"formRevisionAttachments",initialState:ul,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,ul)),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:ll,addFormRevisionAttachment:ol,addFormRevisionAttachments:hl,setFormRevisionAttachment:ml,setFormRevisionAttachments:pl,updateFormRevisionAttachment:yl,updateFormRevisionAttachments:fl,deleteFormRevisionAttachment:Sl,deleteFormRevisionAttachments:Al}=Qs.actions,Ht=t=>t.formRevisionAttachmentReducer.instances,Il=l.createSelector([Ht],t=>Object.values(t)),Tl=y(l.createSelector([Ht,(t,s)=>s],(t,s)=>t[s])),Ol=y(l.createSelector([Il,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Qb=y(l.createSelector([Ht,(t,s)=>s],(t,s)=>S(Object.values(t).filter(e=>e.form_revision===s)))),Pl=Qs.reducer,ue=P(t=>t.uuid),Fl={instances:{}},xs=l.createSlice({name:"formRevisions",initialState:Fl,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Fl)),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:bl,addFormRevision:_l,addFormRevisions:ei,setFormRevision:gl,setFormRevisions:Ml,updateFormRevision:Rl,updateFormRevisions:wl,deleteFormRevision:vl,deleteFormRevisions:ti}=xs.actions,El=t=>t.formRevisionReducer.instances,Wt=l.createSelector([El],t=>Object.values(t)),Bl=t=>s=>s.formRevisionReducer.instances[t],Vl=y(l.createSelector([Wt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),xb=y(l.createSelector([Wt,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s).toSorted(pt).pop())),zl=y(l.createSelector([Wt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.form===s)))),Dl=xs.reducer,le=P(t=>t.uuid),jl={instances:{}},si=l.createSlice({name:"forms",initialState:jl,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,jl)),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:ql,addForm:Cl,addForms:$l,setForm:Ul,setForms:Ll,updateForm:kl,updateForms:Nl,deleteForm:Gl,deleteForms:Hl}=si.actions,Wl=si.reducer,Kl=t=>t.formReducer.instances,ii=l.createSelector([Kl],t=>Object.values(t)),Yl=t=>s=>s.formReducer.instances[t],Zl=y(l.createSelector([ii,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),e_=y(l.createSelector([ii,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),oe=P(t=>t.uuid),Jl={instances:{}},ni=l.createSlice({name:"formSubmissionAttachments",initialState:Jl,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Jl)),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:Xl,addFormSubmissionAttachment:Ql,addFormSubmissionAttachments:ci,setFormSubmissionAttachment:xl,setFormSubmissionAttachments:eo,updateFormSubmissionAttachment:to,updateFormSubmissionAttachments:so,deleteFormSubmissionAttachment:io,deleteFormSubmissionAttachments:ai}=ni.actions,ri=t=>t.formSubmissionAttachmentReducer.instances,di=l.createSelector([ri],t=>Object.values(t)),no=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)))})),co=ui,ao=y(l.createSelector([di,(t,s)=>s],(t,s)=>S(t.filter(e=>e.form_submission===s)))),ro=ni.reducer,he=P(t=>t.uuid),uo={instances:{}},li=l.createSlice({name:"formSubmissions",initialState:uo,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,uo)),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:lo,setFormSubmission:oo,setFormSubmissions:ho,addFormSubmission:mo,addFormSubmissions:oi,updateFormSubmission:po,updateFormSubmissions:yo,deleteFormSubmission:fo,deleteFormSubmissions:hi}=li.actions,So=t=>t.formSubmissionReducer.instances,mi=l.createSelector([So],t=>Object.values(t)),Ao=t=>s=>s.formSubmissionReducer.instances[t],Io=y(l.createSelector([mi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),To=y(l.createSelector([mi,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s))),Oo=li.reducer,me=P(t=>t.uuid),Po={instances:{}},pi=l.createSlice({name:"geoImages",initialState:Po,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Po)),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:Fo,setGeoImage:bo,setGeoImages:_o,addGeoImage:go,addGeoImages:Mo,updateGeoImage:Ro,updateGeoImages:wo,deleteGeoImage:vo,deleteGeoImages:Eo}=pi.actions,Bo=t=>t.geoImageReducer.instances,yi=l.createSelector([Bo],t=>Object.values(t)),Vo=t=>s=>s.geoImageReducer.instances[t],zo=y(l.createSelector([yi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),t_=y(l.createSelector([yi,(t,s)=>s],(t,s)=>S(t.filter(e=>e.project===s)))),Do=pi.reducer,pe=P(t=>t.uuid),jo={instances:{}},fi=l.createSlice({name:"issueAssociations",initialState:jo,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,jo)),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:qo,setIssueAssociations:Co,setIssueAssociation:$o,updateIssueAssociation:Uo,updateIssueAssociations:Lo,addIssueAssociation:ko,addIssueAssociations:yt,deleteIssueAssociation:No,deleteIssueAssociations:ft}=fi.actions,Go=t=>t.issueAssociationReducer.instances,St=l.createSelector([Go],t=>Object.values(t)),Ho=t=>s=>s.issueAssociationReducer.instances[t],Wo=y(l.createSelector([St,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Ko=y(l.createSelector([St,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({issue:n})=>e.has(n)))})),Yo=y(l.createSelector([St,(t,s)=>s],(t,s)=>S(t.filter(({issue:e})=>e===s)))),Zo=y(l.createSelector([St,(t,s)=>s],(t,s)=>S(t.filter(({asset:e})=>e===s)))),Jo=y(l.createSelector([St,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({asset:n})=>e.has(n)))})),Xo=fi.reducer,ye=P(t=>t.uuid),Qo={instances:{}},Si=l.createSlice({name:"issueAttachments",initialState:Qo,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Qo)),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:xo,addIssueAttachment:eh,addIssueAttachments:Ai,setIssueAttachment:th,setIssueAttachments:sh,updateIssueAttachment:ih,updateIssueAttachments:nh,deleteIssueAttachment:ch,deleteIssueAttachments:Ii}=Si.actions,ah=t=>t.issueAttachmentReducer.instances,Ti=l.createSelector([ah],t=>Object.values(t)),rh=y(l.createSelector([Ti,(t,s)=>s],(t,s)=>S(t.filter(({issue:e})=>s===e)))),dh=t=>s=>s.issueAttachmentReducer.instances[t],uh=y(l.createSelector([Ti,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),lh=Si.reducer,fe=P(t=>t.uuid),oh={instances:{}},Oi=l.createSlice({name:"issueCommentAttachments",initialState:oh,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,oh)),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:hh,addIssueCommentAttachment:mh,addIssueCommentAttachments:ph,setIssueCommentAttachment:yh,setIssueCommentAttachments:fh,updateIssueCommentAttachment:Sh,updateIssueCommentAttachments:Ah,deleteIssueCommentAttachment:Ih,deleteIssueCommentAttachments:Th}=Oi.actions,Oh=t=>t.issueCommentAttachmentReducer.instances,Pi=l.createSelector([Oh],t=>Object.values(t)),Ph=t=>s=>s.issueCommentAttachmentReducer.instances[t],Fh=y(l.createSelector([Pi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),s_=y(l.createSelector([Pi,(t,s)=>s],(t,s)=>S(t.filter(({issue_comment:e})=>s===e)))),bh=Oi.reducer,Se=P(t=>t.uuid),_h={instances:{}},Fi=l.createSlice({name:"issueComments",initialState:_h,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,_h)),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:gh,addIssueComment:Mh,addIssueComments:Rh,setIssueComment:wh,setIssueComments:vh,updateIssueComment:Eh,updateIssueComments:Bh,deleteIssueComment:Vh,deleteIssueComments:zh}=Fi.actions,bi=t=>t.issueCommentReducer.instances,Dh=t=>s=>s.issueCommentReducer.instances[t],jh=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)))})),i_=y(l.createSelector([bi,(t,s)=>s],(t,s)=>S(Object.values(t).filter(e=>e.issue===s)))),qh=Fi.reducer,Ae=P(t=>t.uuid),Ch={instances:{}},_i=l.createSlice({name:"issues",initialState:Ch,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Ch)),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:$h,addIssue:Uh,addIssues:gi,setIssue:Lh,setIssues:kh,updateIssue:Nh,updateIssues:Gh,deleteIssue:Hh,deleteIssues:Mi}=_i.actions,Wh=t=>t.issueReducer.instances,Kt=l.createSelector([Wh],t=>Object.values(t)),Kh=t=>s=>s.issueReducer.instances[t],Yh=y(l.createSelector([Kt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),n_=y(l.createSelector([Kt,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),Zh=y(l.createSelector([Kt,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s))),Jh=_i.reducer,Ie=P(t=>t.uuid),Xh={instances:{}},Ri=l.createSlice({name:"issueTypeAttachments",initialState:Xh,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Xh)),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:Qh,addIssueTypeAttachment:xh,addIssueTypeAttachments:em,setIssueTypeAttachment:tm,setIssueTypeAttachments:sm,updateIssueTypeAttachment:im,updateIssueTypeAttachments:nm,deleteIssueTypeAttachment:cm,deleteIssueTypeAttachments:am}=Ri.actions,rm=t=>t.issueTypeAttachmentReducer.instances,wi=l.createSelector([rm],t=>Object.values(t)),dm=t=>s=>s.issueTypeAttachmentReducer.instances[t],um=y(l.createSelector([wi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),c_=y(l.createSelector([wi,(t,s)=>s],(t,s)=>S(t.filter(({issue_type:e})=>s===e)))),lm=Ri.reducer,Te=P(t=>t.uuid),om={instances:{}},vi=l.createSlice({name:"issueTypeFieldsAttachments",initialState:om,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,om)),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:hm,addIssueTypeFieldsAttachment:mm,addIssueTypeFieldsAttachments:pm,setIssueTypeFieldsAttachment:ym,setIssueTypeFieldsAttachments:fm,updateIssueTypeFieldsAttachment:Sm,updateIssueTypeFieldsAttachments:Am,deleteIssueTypeFieldsAttachment:Im,deleteIssueTypeFieldsAttachments:Tm}=vi.actions,Om=t=>t.issueTypeFieldsAttachmentReducer.instances,Ei=l.createSelector([Om],t=>Object.values(t)),a_=y(l.createSelector([Ei,(t,s)=>s],(t,s)=>S(t.filter(e=>e.fields_revision===s)))),Pm=t=>s=>s.issueTypeFieldsAttachmentReducer.instances[t],Fm=y(l.createSelector([Ei,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),bm=vi.reducer,Oe=P(t=>t.uuid),_m={instances:{}},Bi=l.createSlice({name:"issueTypeFieldValues",initialState:_m,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,_m)),reducers:{initializeIssueTypeFieldValues:Oe.initialize,addIssueTypeFieldValues:Oe.addOne,addIssueTypeFieldValuesMany:Oe.addMany,setIssueTypeFieldValues:Oe.setOne,setIssueTypeFieldValuesMany:Oe.setMany,updateIssueTypeFieldValues:Oe.updateOne,updateIssueTypeFieldValuesMany:Oe.updateMany,deleteIssueTypeFieldValues:Oe.deleteOne,deleteIssueTypeFieldValuesMany:Oe.deleteMany}}),{initializeIssueTypeFieldValues:gm,addIssueTypeFieldValues:Mm,addIssueTypeFieldValuesMany:Rm,setIssueTypeFieldValues:wm,setIssueTypeFieldValuesMany:vm,updateIssueTypeFieldValues:Em,updateIssueTypeFieldValuesMany:Bm,deleteIssueTypeFieldValues:Vm,deleteIssueTypeFieldValuesMany:zm}=Bi.actions,Dm=t=>t.issueTypeFieldValuesReducer.instances,Yt=l.createSelector([Dm],t=>Object.values(t)),r_=y(l.createSelector([Yt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue===s)))),jm=t=>s=>s.issueTypeFieldValuesReducer.instances[t],qm=y(l.createSelector([Yt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Cm=Bi.reducer,Pe=P(t=>t.uuid),$m={instances:{}},Vi=l.createSlice({name:"issueTypeFields",initialState:$m,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,$m)),reducers:{initializeIssueTypeFields:Pe.initialize,addIssueTypeFields:Pe.addOne,addIssueTypeFieldsMany:Pe.addMany,setIssueTypeFields:Pe.setOne,setIssueTypeFieldsMany:Pe.setMany,updateIssueTypeFields:Pe.updateOne,updateIssueTypeFieldsMany:Pe.updateMany,deleteIssueTypeFields:Pe.deleteOne,deleteIssueTypeFieldsMany:Pe.deleteMany}}),{initializeIssueTypeFields:Um,addIssueTypeFields:Lm,addIssueTypeFieldsMany:km,setIssueTypeFields:Nm,setIssueTypeFieldsMany:Gm,updateIssueTypeFields:Hm,updateIssueTypeFieldsMany:Wm,deleteIssueTypeFields:Km,deleteIssueTypeFieldsMany:Ym}=Vi.actions,Zm=t=>t.issueTypeFieldsReducer.instances,Mt=l.createSelector([Zm],t=>Object.values(t)),d_=y(l.createSelector([Mt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue_type===s)))),u_=y(l.createSelector([Mt,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),l_=y(l.createSelector([Mt,Yt,(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)))})),Jm=t=>s=>s.issueTypeFieldsReducer.instances[t],Xm=y(l.createSelector([Mt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Qm=Vi.reducer,Fe=P(t=>t.uuid),xm={instances:{}},zi=l.createSlice({name:"issueTypeFieldValuesAttachments",initialState:xm,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,xm)),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:ep,addIssueTypeFieldValuesAttachment:tp,addIssueTypeFieldValuesAttachments:Di,setIssueTypeFieldValuesAttachment:sp,setIssueTypeFieldValuesAttachments:ip,updateIssueTypeFieldValuesAttachment:np,updateIssueTypeFieldValuesAttachments:cp,deleteIssueTypeFieldValuesAttachment:ap,deleteIssueTypeFieldValuesAttachments:ji}=zi.actions,rp=t=>t.issueTypeFieldValuesAttachmentReducer.instances,qi=l.createSelector([rp],t=>Object.values(t)),dp=t=>s=>s.issueTypeFieldValuesAttachmentReducer.instances[t],up=y(l.createSelector([qi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),lp=y(l.createSelector([qi,(t,s)=>s],(t,s)=>S(t.filter(e=>e.field_values===s)))),op=zi.reducer,be=P(t=>t.uuid),hp={instances:{}},Ci=l.createSlice({name:"issueTypeIdentifiers",initialState:hp,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,hp)),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:mp,addIssueTypeIdentifier:pp,addIssueTypeIdentifiers:yp,setIssueTypeIdentifier:fp,setIssueTypeIdentifiers:Sp,updateIssueTypeIdentifier:Ap,updateIssueTypeIdentifiers:Ip,deleteIssueTypeIdentifier:Tp,deleteIssueTypeIdentifiers:Op}=Ci.actions,Pp=t=>t.issueTypeIdentifierReducer.instances,$i=l.createSelector([Pp],t=>Object.values(t)),Fp=t=>s=>s.issueTypeIdentifierReducer.instances[t],bp=y(l.createSelector([$i,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),o_=y(l.createSelector([$i,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue_type===s)))),_p=Ci.reducer,_e=P(t=>t.uuid),gp={instances:{}},Ui=l.createSlice({name:"issueTypeIdentifierValues",initialState:gp,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,gp)),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:Mp,addIssueTypeIdentifierValue:Rp,addIssueTypeIdentifierValues:wp,setIssueTypeIdentifierValue:vp,setIssueTypeIdentifierValues:Ep,updateIssueTypeIdentifierValue:Bp,updateIssueTypeIdentifierValues:Vp,deleteIssueTypeIdentifierValue:zp,deleteIssueTypeIdentifierValues:Dp}=Ui.actions,jp=t=>t.issueTypeIdentifierValueReducer.instances,Zt=l.createSelector([jp],t=>Object.values(t)),qp=t=>s=>s.issueTypeIdentifierValueReducer.instances[t],Cp=y(l.createSelector([Zt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),h_=y(l.createSelector([Zt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue===s)))),m_=y(l.createSelector([Zt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue_type_identifier===s)))),$p=Ui.reducer,ge=P(t=>t.uuid),Up={instances:{}},Li=l.createSlice({name:"issueTypes",initialState:Up,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,Up)),reducers:{initializeIssueTypes:ge.initialize,addIssueType:ge.addOne,addIssueTypes:ge.addMany,setIssueType:ge.setOne,setIssueTypes:ge.setMany,updateIssueType:ge.updateOne,updateIssueTypes:ge.updateMany,deleteIssueType:ge.deleteOne,deleteIssueTypes:ge.deleteMany}}),{initializeIssueTypes:Lp,addIssueType:kp,addIssueTypes:Np,setIssueType:Gp,setIssueTypes:Hp,updateIssueType:Wp,updateIssueTypes:Kp,deleteIssueType:Yp,deleteIssueTypes:Zp}=Li.actions,Jp=t=>t.issueTypeReducer.instances,ki=l.createSelector(Jp,t=>Object.values(t)),Xp=t=>s=>s.issueTypeReducer.instances[t],Qp=y(l.createSelector([ki,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),p_=y(l.createSelector([ki,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),xp=Li.reducer,Me=P(t=>t.uuid),ey={instances:{}},Ni=l.createSlice({name:"issueTypeStatuses",initialState:ey,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,ey)),reducers:{initializeIssueTypeStatuses:Me.initialize,addIssueTypeStatus:Me.addOne,addIssueTypeStatuses:Me.addMany,setIssueTypeStatus:Me.setOne,setIssueTypeStatuses:Me.setMany,updateIssueTypeStatus:Me.updateOne,updateIssueTypeStatuses:Me.updateMany,deleteIssueTypeStatus:Me.deleteOne,deleteIssueTypeStatuses:Me.deleteMany}}),{initializeIssueTypeStatuses:ty,addIssueTypeStatus:sy,addIssueTypeStatuses:iy,setIssueTypeStatus:ny,setIssueTypeStatuses:cy,updateIssueTypeStatus:ay,updateIssueTypeStatuses:ry,deleteIssueTypeStatus:dy,deleteIssueTypeStatuses:uy}=Ni.actions,ly=t=>t.issueTypeStatusReducer.instances,Gi=l.createSelector([ly],t=>S(Object.values(t).toSorted(vc))),Hi=t=>s=>s.issueTypeStatusReducer.instances[t],oy=y(l.createSelector([Gi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),y_=y(l.createSelector([Gi,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue_type===s)))),hy=Ni.reducer,Re=P(t=>t.uuid),my={instances:{}},Wi=l.createSlice({name:"issueUpdates",initialState:my,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,my)),reducers:{initializeIssueUpdates:Re.initialize,addIssueUpdate:Re.addOne,addIssueUpdates:Re.addMany,setIssueUpdate:Re.setOne,setIssueUpdates:Re.setMany,updateIssueUpdate:Re.updateOne,updateIssueUpdates:Re.updateMany,deleteIssueUpdate:Re.deleteOne,deleteIssueUpdates:Re.deleteMany}}),{initializeIssueUpdates:py,addIssueUpdate:Ki,addIssueUpdates:Yi,setIssueUpdate:yy,setIssueUpdates:fy,updateIssueUpdate:Sy,updateIssueUpdates:Ay,deleteIssueUpdate:Zi,deleteIssueUpdates:Ji}=Wi.actions,Xi=t=>t.issueUpdateReducer.instances,Qi=l.createSelector([Xi],t=>Object.values(t)),Iy=y(l.createSelector([Xi,(t,s)=>s],(t,s)=>t[s])),Ty=y(l.createSelector([Qi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Oy=y(l.createSelector([Qi,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue===s)))),Py=Wi.reducer,we=P(t=>t.id),Fy={instances:{},currentUser:null},xi=l.createSlice({name:"users",initialState:Fy,extraReducers:t=>t.addCase(T,s=>Object.assign(s,Fy)).addCase(F,s=>Object.assign(s,{...s,instances:[]})),reducers:{initializeUsers:we.initialize,setUsers:we.setMany,setUser:we.setOne,addUsers:we.addMany,addUser:we.addOne,updateUsers:we.updateMany,updateUser:we.updateOne,deleteUser:we.deleteOne,deleteUsers:we.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:by,setUsers:_y,setUser:gy,addUsers:My,addUser:en,updateUsers:Ry,updateUser:wy,deleteUser:tn,deleteUsers:vy,setCurrentUser:f_,setCurrentUserProfile:S_}=xi.actions,Ey=xi.reducer,By=t=>t.userReducer.currentUser,sn=t=>t.userReducer.instances,Jt=l.createSelector([sn],t=>Object.values(t)),Xt=t=>s=>s.userReducer.instances[t],Vy=y(l.createSelector([Jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({id:n})=>e.has(n)))})),ve=P(t=>t.uuid),zy={instances:{}},nn=l.createSlice({name:"organizationAccess",initialState:zy,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,zy)),reducers:{initializeOrganizationAccesses:ve.initialize,addOrganizationAccess:ve.addOne,addOrganizationAccesses:ve.addMany,setOrganizationAccess:ve.setOne,setOrganizationAccesses:ve.setMany,updateOrganizationAccess:ve.updateOne,updateOrganizationAccesses:ve.updateMany,deleteOrganizationAccess:ve.deleteOne,deleteOrganizationAccesses:ve.deleteMany}}),{initializeOrganizationAccesses:Dy,addOrganizationAccess:jy,addOrganizationAccesses:qy,setOrganizationAccess:Cy,setOrganizationAccesses:$y,updateOrganizationAccess:Uy,updateOrganizationAccesses:Ly,deleteOrganizationAccess:ky,deleteOrganizationAccesses:Ny}=nn.actions,Gy=nn.reducer,Qt=t=>t.organizationAccessReducer.instances,Hy=t=>s=>s.organizationAccessReducer.instances[t],Wy=y(l.createSelector([Qt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(Object.values(t).filter(({uuid:n})=>e.has(n)))})),A_=l.createSelector([By,Qt],(t,s)=>Object.values(s).find(n=>n.user===(t==null?void 0:t.id))??null),Ky=l.createSelector([Qt],t=>{const s={};for(const e of Object.values(t))s[e.user]=e;return ls(s)}),I_=y(l.createSelector([sn,Ky,(t,s)=>s],(t,s,e)=>S(Object.values(t).filter(n=>{const c=s[n.id];return!!c&&c.organization===e})))),Ee=P(t=>t.uuid),Yy={instances:{}},cn=l.createSlice({name:"organizations",initialState:Yy,extraReducers:t=>t.addMatcher(l.isAnyOf(T),s=>Object.assign(s,Yy)),reducers:{initializeOrganizations:Ee.initialize,setOrganizations:Ee.setMany,setOrganization:Ee.setOne,addOrganizations:Ee.addMany,addOrganization:Ee.addOne,updateOrganizations:Ee.updateMany,updateOrganization:Ee.updateOne,deleteOrganization:Ee.deleteOne,deleteOrganizations:Ee.deleteMany}}),{initializeOrganizations:Zy,setOrganizations:Jy,setOrganization:Xy,addOrganizations:Qy,addOrganization:xy,updateOrganizations:ef,updateOrganization:tf,deleteOrganization:sf,deleteOrganizations:nf}=cn.actions,cf=t=>t.organizationReducer.instances,af=l.createSelector([cf],t=>Object.values(t)),rf=t=>s=>s.organizationReducer.instances[t],df=y(l.createSelector([af,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),uf=cn.reducer,lf=(t,s,e)=>{const n=t.uuid?t:{...t,uuid:at.v4()};return{payload:n,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:n,BASE_URL:s,serviceName:e}}}}},of={deletedRequests:[],latestRetryTime:0},an=l.createSlice({name:"outbox",initialState:of,extraReducers:t=>t.addCase(T,s=>Object.assign(s,of)),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 lf(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}}}),T_=t=>t.outboxReducer.deletedRequests,O_=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:hf,markForDeletion:P_,markAsDeleted:mf,_setLatestRetryTime:pf}=an.actions,yf=an.reducer,Be=P(t=>t.uuid),ff={instances:{}},rn=l.createSlice({name:"projectAccess",initialState:ff,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,ff)),reducers:{initializeProjectAccesses:Be.initialize,addProjectAccess:Be.addOne,addProjectAccesses:Be.addMany,setProjectAccess:Be.setOne,setProjectAccesses:Be.setMany,updateProjectAccess:Be.updateOne,updateProjectAccesses:Be.updateMany,deleteProjectAccess:Be.deleteOne,deleteProjectAccesses:Be.deleteMany}}),{initializeProjectAccesses:Sf,addProjectAccess:Af,addProjectAccesses:If,setProjectAccess:Tf,setProjectAccesses:Of,updateProjectAccess:Pf,updateProjectAccesses:Ff,deleteProjectAccess:bf,deleteProjectAccesses:_f}=rn.actions,gf=rn.reducer,dn=t=>t.projectAccessReducer.instances,Rt=l.createSelector(dn,t=>Object.values(t)),Mf=t=>s=>s.projectAccessReducer.instances[t],Rf=y(l.createSelector([Rt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),F_=y(l.createSelector([dn,(t,s)=>s],(t,s)=>S(Object.values(t).filter(e=>e.project===s)))),b_=y(l.createSelector([Rt,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(c=>c.project===s))e[n.user]=n;return e})),__=y(l.createSelector([Jt,Rt,(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)))})),Ve=P(t=>t.uuid),wf={instances:{}},un=l.createSlice({name:"projectAttachments",initialState:wf,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,wf)),reducers:{initializeProjectAttachments:Ve.initialize,addProjectAttachment:Ve.addOne,addProjectAttachments:Ve.addMany,setProjectAttachment:Ve.setOne,setProjectAttachments:Ve.setMany,updateProjectAttachment:Ve.updateOne,updateProjectAttachments:Ve.updateMany,deleteProjectAttachment:Ve.deleteOne,deleteProjectAttachments:Ve.deleteMany}}),{initializeProjectAttachments:vf,addProjectAttachment:Ef,addProjectAttachments:Bf,setProjectAttachment:Vf,setProjectAttachments:zf,updateProjectAttachment:Df,updateProjectAttachments:jf,deleteProjectAttachment:qf,deleteProjectAttachments:Cf}=un.actions,$f=t=>t.projectAttachmentReducer.instances,ln=l.createSelector([$f],t=>Object.values(t)),Uf=t=>s=>s.projectAttachmentReducer.instances[t],Lf=y(l.createSelector([ln,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),g_=y(l.createSelector([ln,(t,s)=>s],(t,s)=>S(t.filter(({project:e})=>s===e)))),kf=un.reducer,ze=P(t=>t.uuid),Nf={instances:{}},on=l.createSlice({name:"projectComments",initialState:Nf,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,Nf)),reducers:{initializeProjectComments:ze.initialize,addProjectComment:ze.addOne,addProjectComments:ze.addMany,setProjectComment:ze.setOne,setProjectComments:ze.setMany,updateProjectComment:ze.updateOne,updateProjectComments:ze.updateMany,deleteProjectComment:ze.deleteOne,deleteProjectComments:ze.deleteMany}}),{initializeProjectComments:Gf,addProjectComment:Hf,addProjectComments:Wf,setProjectComment:Kf,setProjectComments:Yf,updateProjectComment:Zf,updateProjectComments:Jf,deleteProjectComment:Xf,deleteProjectComments:Qf}=on.actions,xf=t=>t.projectCommentReducer.instances,xt=l.createSelector([xf],t=>S(Object.values(t).toSorted(pt))),eS=t=>s=>s.projectCommentReducer.instances[t],tS=y(l.createSelector([xt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),M_=y(l.createSelector([xt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.project===s)))),R_=y(l.createSelector([xt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(n=>e.has(n.project)))})),sS=on.reducer,De=P(t=>t.uuid),iS={instances:{}},hn=l.createSlice({name:"projectFiles",initialState:iS,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,iS)),reducers:{initializeProjectFiles:De.initialize,setProjectFile:De.setOne,setProjectFiles:De.setMany,addProjectFile:De.addOne,addProjectFiles:De.addMany,updateProjectFile:De.updateOne,updateProjectFiles:De.updateMany,deleteProjectFile:De.deleteOne,deleteProjectFiles:De.deleteMany}}),{initializeProjectFiles:nS,setProjectFile:cS,setProjectFiles:aS,addProjectFile:rS,addProjectFiles:dS,updateProjectFile:uS,updateProjectFiles:lS,deleteProjectFile:oS,deleteProjectFiles:hS}=hn.actions,mS=t=>t.projectFileReducer.instances,pS=l.createSelector([mS],t=>S(Object.values(t).toSorted((s,e)=>s.z_index-e.z_index))),yS=t=>s=>s.projectFileReducer.instances[t],fS=y(l.createSelector([pS,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),SS=hn.reducer,je=P(t=>t.uuid),AS={instances:{}},mn=l.createSlice({name:"projects",initialState:AS,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,AS)),reducers:{initializeProjects:je.initialize,setProjects:je.setMany,setProject:je.setOne,addProjects:je.addMany,addProject:je.addOne,updateProjects:je.updateMany,updateProject:je.updateOne,deleteProject:je.deleteOne,deleteProjects:je.deleteMany}}),{initializeProjects:IS,setProjects:TS,setProject:OS,addProjects:PS,addProject:FS,updateProjects:bS,updateProject:_S,deleteProject:gS,deleteProjects:MS}=mn.actions,RS=mn.reducer,wS=t=>t.projectReducer.instances,es=l.createSelector([wS],t=>Object.values(t)),vS=t=>s=>s.projectReducer.instances[t],ES=y(l.createSelector([es,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),w_=y(l.createSelector([es,Rt,(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)))})),v_=y(l.createSelector([es,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),qe=P(({uuid:t})=>t),BS={instances:{}},pn=l.createSlice({name:"procedureInitiatives",initialState:BS,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,BS)),reducers:{initializeProcedureInitiatives:qe.initialize,addProcedureInitiative:qe.addOne,addProcedureInitiatives:qe.addMany,setProcedureInitiative:qe.setOne,setProcedureInitiatives:qe.setMany,updateProcedureInitiative:qe.updateOne,updateProcedureInitiatives:qe.updateMany,deleteProcedureInitiative:qe.deleteOne,deleteProcedureInitiatives:qe.deleteMany}}),{initializeProcedureInitiatives:VS,addProcedureInitiative:zS,addProcedureInitiatives:DS,setProcedureInitiative:jS,setProcedureInitiatives:qS,updateProcedureInitiative:CS,updateProcedureInitiatives:$S,deleteProcedureInitiative:US,deleteProcedureInitiatives:LS}=pn.actions,kS=pn.reducer,NS=t=>t.procedureInitiativeReducer.instances,ts=l.createSelector([NS],t=>Object.values(t)),GS=t=>s=>s.procedureInitiativeReducer.instances[t],HS=y(l.createSelector([ts,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),E_=y(l.createSelector([ts,(t,s)=>s],(t,s)=>S(t.filter(e=>e.project===s)))),B_=y(l.createSelector([ts,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_type===s)))),Ce=P(({uuid:t})=>t),WS={instances:{}},yn=l.createSlice({name:"procedures",initialState:WS,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,WS)),reducers:{initializeProcedures:Ce.initialize,addProcedure:Ce.addOne,addProcedures:Ce.addMany,setProcedure:Ce.setOne,setProcedures:Ce.setMany,updateProcedure:Ce.updateOne,updateProcedures:Ce.updateMany,deleteProcedure:Ce.deleteOne,deleteProcedures:Ce.deleteMany}}),{initializeProcedures:KS,addProcedure:YS,addProcedures:At,setProcedure:ZS,setProcedures:JS,updateProcedure:XS,updateProcedures:QS,deleteProcedure:xS,deleteProcedures:It}=yn.actions,eA=yn.reducer,tA=t=>t.procedureReducer.instances,rt=l.createSelector([tA],t=>Object.values(t)),sA=t=>s=>s.procedureReducer.instances[t],iA=y(l.createSelector([rt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),V_=y(l.createSelector([rt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.project===s)))),nA=y(l.createSelector([rt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_type===s)))),cA=y(l.createSelector([rt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset===s)))),aA=y(l.createSelector([rt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({asset:n})=>e.has(n)))})),rA=y(l.createSelector([rt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_initiative===s)))),$e=P(t=>t.uuid),dA={instances:{}},fn=l.createSlice({name:"procedureStepAssignees",initialState:dA,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,dA)),reducers:{initializeProcedureStepAssignees:$e.initialize,addProcedureStepAssignee:$e.addOne,addProcedureStepAssignees:$e.addMany,setProcedureStepAssignee:$e.setOne,setProcedureStepAssignees:$e.setMany,updateProcedureStepAssignee:$e.updateOne,updateProcedureStepAssignees:$e.updateMany,deleteProcedureStepAssignee:$e.deleteOne,deleteProcedureStepAssignees:$e.deleteMany}}),{initializeProcedureStepAssignees:uA,addProcedureStepAssignee:lA,addProcedureStepAssignees:oA,setProcedureStepAssignee:hA,setProcedureStepAssignees:mA,updateProcedureStepAssignee:pA,updateProcedureStepAssignees:yA,deleteProcedureStepAssignee:fA,deleteProcedureStepAssignees:SA}=fn.actions,AA=t=>t.procedureStepAssigneeReducer.instances,wt=l.createSelector([AA],t=>Object.values(t)),IA=t=>s=>s.procedureStepAssigneeReducer.instances[t],TA=y(l.createSelector([wt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),z_=y(l.createSelector([wt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure===s)))),D_=y(l.createSelector([wt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),j_=y(l.createSelector([wt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>S(t.filter(({procedure:n,procedure_step:c})=>n===s&&c===e)))),OA=fn.reducer,Ue=P(t=>t.uuid),PA={instances:{}},Sn=l.createSlice({name:"procedureStepComments",initialState:PA,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,PA)),reducers:{initializeProcedureStepComments:Ue.initialize,addProcedureStepComment:Ue.addOne,addProcedureStepComments:Ue.addMany,setProcedureStepComment:Ue.setOne,setProcedureStepComments:Ue.setMany,updateProcedureStepComment:Ue.updateOne,updateProcedureStepComments:Ue.updateMany,deleteProcedureStepComment:Ue.deleteOne,deleteProcedureStepComments:Ue.deleteMany}}),{initializeProcedureStepComments:FA,addProcedureStepComment:bA,addProcedureStepComments:_A,setProcedureStepComment:gA,setProcedureStepComments:MA,updateProcedureStepComment:RA,updateProcedureStepComments:wA,deleteProcedureStepComment:vA,deleteProcedureStepComments:EA}=Sn.actions,BA=t=>t.procedureStepCommentReducer.instances,vt=l.createSelector([BA],t=>Object.values(t)),VA=t=>s=>s.procedureStepCommentReducer.instances[t],zA=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)))),C_=y(l.createSelector([vt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),$_=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)))),DA=Sn.reducer,Le=P(t=>t.uuid),jA={instances:{}},An=l.createSlice({name:"procedureStepDefaultAssignees",initialState:jA,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,jA)),reducers:{initializeProcedureStepDefaultAssignees:Le.initialize,addProcedureStepDefaultAssignee:Le.addOne,addProcedureStepDefaultAssignees:Le.addMany,setProcedureStepDefaultAssignee:Le.setOne,setProcedureStepDefaultAssignees:Le.setMany,updateProcedureStepDefaultAssignee:Le.updateOne,updateProcedureStepDefaultAssignees:Le.updateMany,deleteProcedureStepDefaultAssignee:Le.deleteOne,deleteProcedureStepDefaultAssignees:Le.deleteMany}}),{initializeProcedureStepDefaultAssignees:qA,addProcedureStepDefaultAssignee:CA,addProcedureStepDefaultAssignees:$A,setProcedureStepDefaultAssignee:UA,setProcedureStepDefaultAssignees:LA,updateProcedureStepDefaultAssignee:kA,updateProcedureStepDefaultAssignees:NA,deleteProcedureStepDefaultAssignee:GA,deleteProcedureStepDefaultAssignees:HA}=An.actions,WA=t=>t.procedureStepDefaultAssigneeReducer.instances,In=l.createSelector([WA],t=>Object.values(t)),KA=t=>s=>s.procedureStepDefaultAssigneeReducer.instances[t],YA=y(l.createSelector([In,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),U_=y(l.createSelector([In,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),ZA=An.reducer,ke=P(t=>t.uuid),JA={instances:{}},Tn=l.createSlice({name:"procedureStepDefaultReviewers",initialState:JA,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,JA)),reducers:{initializeProcedureStepDefaultReviewers:ke.initialize,addProcedureStepDefaultReviewer:ke.addOne,addProcedureStepDefaultReviewers:ke.addMany,setProcedureStepDefaultReviewer:ke.setOne,setProcedureStepDefaultReviewers:ke.setMany,updateProcedureStepDefaultReviewer:ke.updateOne,updateProcedureStepDefaultReviewers:ke.updateMany,deleteProcedureStepDefaultReviewer:ke.deleteOne,deleteProcedureStepDefaultReviewers:ke.deleteMany}}),{initializeProcedureStepDefaultReviewers:XA,addProcedureStepDefaultReviewer:QA,addProcedureStepDefaultReviewers:xA,setProcedureStepDefaultReviewer:eI,setProcedureStepDefaultReviewers:tI,updateProcedureStepDefaultReviewer:sI,updateProcedureStepDefaultReviewers:iI,deleteProcedureStepDefaultReviewer:nI,deleteProcedureStepDefaultReviewers:cI}=Tn.actions,aI=t=>t.procedureStepDefaultReviewerReducer.instances,On=l.createSelector([aI],t=>Object.values(t)),rI=t=>s=>s.procedureStepDefaultReviewerReducer.instances[t],dI=y(l.createSelector([On,(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(t.filter(e=>e.procedure_step===s)))),uI=Tn.reducer,Ne=P(t=>t.uuid),lI={instances:{}},Pn=l.createSlice({name:"procedureStepEvents",initialState:lI,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,lI)),reducers:{initializeProcedureStepEvents:Ne.initialize,addProcedureStepEvent:Ne.addOne,addProcedureStepEvents:Ne.addMany,setProcedureStepEvent:Ne.setOne,setProcedureStepEvents:Ne.setMany,updateProcedureStepEvent:Ne.updateOne,updateProcedureStepEvents:Ne.updateMany,deleteProcedureStepEvent:Ne.deleteOne,deleteProcedureStepEvents:Ne.deleteMany}}),{initializeProcedureStepEvents:oI,addProcedureStepEvent:hI,addProcedureStepEvents:mI,setProcedureStepEvent:pI,setProcedureStepEvents:yI,updateProcedureStepEvent:fI,updateProcedureStepEvents:SI,deleteProcedureStepEvent:AI,deleteProcedureStepEvents:II}=Pn.actions,TI=t=>t.procedureStepEventReducer.instances,Et=l.createSelector([TI],t=>Object.values(t)),OI=t=>s=>s.procedureStepEventReducer.instances[t],PI=y(l.createSelector([Et,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),k_=y(l.createSelector([Et,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure===s)))),N_=y(l.createSelector([Et,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),G_=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)))),FI=Pn.reducer,Ge=P(t=>t.uuid),bI={instances:{}},Fn=l.createSlice({name:"procedureStepFieldsAttachments",initialState:bI,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,bI)),reducers:{initializeProcedureStepFieldsAttachments:Ge.initialize,addProcedureStepFieldsAttachment:Ge.addOne,addProcedureStepFieldsAttachments:Ge.addMany,setProcedureStepFieldsAttachment:Ge.setOne,setProcedureStepFieldsAttachments:Ge.setMany,updateProcedureStepFieldsAttachment:Ge.updateOne,updateProcedureStepFieldsAttachments:Ge.updateMany,deleteProcedureStepFieldsAttachment:Ge.deleteOne,deleteProcedureStepFieldsAttachments:Ge.deleteMany}}),{initializeProcedureStepFieldsAttachments:_I,addProcedureStepFieldsAttachment:gI,addProcedureStepFieldsAttachments:bn,setProcedureStepFieldsAttachment:MI,setProcedureStepFieldsAttachments:RI,updateProcedureStepFieldsAttachment:wI,updateProcedureStepFieldsAttachments:vI,deleteProcedureStepFieldsAttachment:EI,deleteProcedureStepFieldsAttachments:_n}=Fn.actions,BI=t=>t.procedureStepFieldsAttachmentReducer.instances,gn=l.createSelector([BI],t=>Object.values(t)),VI=y(l.createSelector([gn,(t,s)=>s],(t,s)=>S(t.filter(e=>e.fields_revision===s)))),zI=t=>s=>s.procedureStepFieldsAttachmentReducer.instances[t],DI=y(l.createSelector([gn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),jI=Fn.reducer,He=P(t=>t.uuid),qI={instances:{}},Mn=l.createSlice({name:"procedureStepFields",initialState:qI,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,qI)),reducers:{initializeProcedureStepFields:He.initialize,addProcedureStepFields:He.addOne,addProcedureStepFieldsMany:He.addMany,setProcedureStepFields:He.setOne,setProcedureStepFieldsMany:He.setMany,updateProcedureStepFields:He.updateOne,updateProcedureStepFieldsMany:He.updateMany,deleteProcedureStepFields:He.deleteOne,deleteProcedureStepFieldsMany:He.deleteMany}}),{initializeProcedureStepFields:CI,addProcedureStepFields:$I,addProcedureStepFieldsMany:UI,setProcedureStepFields:LI,setProcedureStepFieldsMany:kI,updateProcedureStepFields:NI,updateProcedureStepFieldsMany:GI,deleteProcedureStepFields:HI,deleteProcedureStepFieldsMany:WI}=Mn.actions,Rn=t=>t.procedureStepFieldsReducer.instances,ss=l.createSelector([Rn],t=>Object.values(t)),H_=y(l.createSelector([ss,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),W_=y(l.createSelector([ss,(t,s)=>s],(t,s)=>t.filter(e=>e.procedure_step===s).toSorted(pt).pop())),K_=l.createSelector([Rn],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}),KI=t=>s=>s.procedureStepFieldsReducer.instances[t],YI=y(l.createSelector([ss,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),ZI=Mn.reducer,We=P(t=>t.uuid),JI={instances:{}},wn=l.createSlice({name:"procedureStepFieldValuesAttachments",initialState:JI,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,JI)),reducers:{initializeProcedureStepFieldValuesAttachments:We.initialize,addProcedureStepFieldValuesAttachment:We.addOne,addProcedureStepFieldValuesAttachments:We.addMany,setProcedureStepFieldValuesAttachment:We.setOne,setProcedureStepFieldValuesAttachments:We.setMany,updateProcedureStepFieldValuesAttachment:We.updateOne,updateProcedureStepFieldValuesAttachments:We.updateMany,deleteProcedureStepFieldValuesAttachment:We.deleteOne,deleteProcedureStepFieldValuesAttachments:We.deleteMany}}),{initializeProcedureStepFieldValuesAttachments:XI,addProcedureStepFieldValuesAttachment:QI,addProcedureStepFieldValuesAttachments:vn,setProcedureStepFieldValuesAttachment:xI,setProcedureStepFieldValuesAttachments:eT,updateProcedureStepFieldValuesAttachment:tT,updateProcedureStepFieldValuesAttachments:sT,deleteProcedureStepFieldValuesAttachment:iT,deleteProcedureStepFieldValuesAttachments:En}=wn.actions,nT=t=>t.procedureStepFieldValuesAttachmentReducer.instances,Bn=l.createSelector([nT],t=>Object.values(t)),cT=t=>s=>s.procedureStepFieldValuesAttachmentReducer.instances[t],aT=y(l.createSelector([Bn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),rT=y(l.createSelector([Bn,(t,s)=>s],(t,s)=>S(t.filter(e=>e.field_values===s)))),dT=wn.reducer,Ke=P(t=>t.uuid),uT={instances:{}},Vn=l.createSlice({name:"procedureStepFieldValues",initialState:uT,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,uT)),reducers:{initializeProcedureStepFieldValues:Ke.initialize,addProcedureStepFieldValues:Ke.addOne,addProcedureStepFieldValuesMany:Ke.addMany,setProcedureStepFieldValues:Ke.setOne,setProcedureStepFieldValuesMany:Ke.setMany,updateProcedureStepFieldValues:Ke.updateOne,updateProcedureStepFieldValuesMany:Ke.updateMany,deleteProcedureStepFieldValues:Ke.deleteOne,deleteProcedureStepFieldValuesMany:Ke.deleteMany}}),{initializeProcedureStepFieldValues:lT,addProcedureStepFieldValues:oT,addProcedureStepFieldValuesMany:hT,setProcedureStepFieldValues:mT,setProcedureStepFieldValuesMany:pT,updateProcedureStepFieldValues:yT,updateProcedureStepFieldValuesMany:fT,deleteProcedureStepFieldValues:ST,deleteProcedureStepFieldValuesMany:AT}=Vn.actions,IT=Vn.reducer,TT=t=>t.procedureStepFieldValuesReducer.instances,dt=l.createSelector([TT],t=>Object.values(t)),Y_=y(l.createSelector([dt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure===s)))),Z_=y(l.createSelector([dt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),OT=t=>s=>s.procedureStepFieldValuesReducer.instances[t],PT=y(l.createSelector([dt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),J_=y(l.createSelector([dt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>S(t.filter(({procedure:n,procedure_step:c})=>n===s&&c===e)))),Ye=P(t=>t.uuid),FT={instances:{}},zn=l.createSlice({name:"procedureStepFieldValuesReviews",initialState:FT,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,FT)),reducers:{initializeProcedureStepFieldValuesReviews:Ye.initialize,addProcedureStepFieldValuesReview:Ye.addOne,addProcedureStepFieldValuesReviews:Ye.addMany,setProcedureStepFieldValuesReview:Ye.setOne,setProcedureStepFieldValuesReviews:Ye.setMany,updateProcedureStepFieldValuesReview:Ye.updateOne,updateProcedureStepFieldValuesReviews:Ye.updateMany,deleteProcedureStepFieldValuesReview:Ye.deleteOne,deleteProcedureStepFieldValuesReviews:Ye.deleteMany}}),{initializeProcedureStepFieldValuesReviews:bT,addProcedureStepFieldValuesReview:_T,addProcedureStepFieldValuesReviews:Dn,setProcedureStepFieldValuesReview:gT,setProcedureStepFieldValuesReviews:MT,updateProcedureStepFieldValuesReview:RT,updateProcedureStepFieldValuesReviews:wT,deleteProcedureStepFieldValuesReview:vT,deleteProcedureStepFieldValuesReviews:jn}=zn.actions,ET=t=>t.procedureStepFieldValuesReviewReducer.instances,ut=l.createSelector([ET],t=>Object.values(t)),BT=t=>s=>s.procedureStepFieldValuesReviewReducer.instances[t],VT=y(l.createSelector([ut,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),zT=y(l.createSelector([ut,(t,s)=>s],(t,s)=>S(t.filter(e=>e.field_values===s)))),X_=y(l.createSelector([ut,(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})),Q_=y(l.createSelector([dt,ut,(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)))})),x_=y(l.createSelector([dt,ut,(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)))})),eg=l.createSelector([ut],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}),DT=zn.reducer,Ze=P(t=>t.uuid),jT={instances:{}},qn=l.createSlice({name:"procedureStepReviewers",initialState:jT,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,jT)),reducers:{initializeProcedureStepReviewers:Ze.initialize,addProcedureStepReviewer:Ze.addOne,addProcedureStepReviewers:Ze.addMany,setProcedureStepReviewer:Ze.setOne,setProcedureStepReviewers:Ze.setMany,updateProcedureStepReviewer:Ze.updateOne,updateProcedureStepReviewers:Ze.updateMany,deleteProcedureStepReviewer:Ze.deleteOne,deleteProcedureStepReviewers:Ze.deleteMany}}),{initializeProcedureStepReviewers:qT,addProcedureStepReviewer:CT,addProcedureStepReviewers:$T,setProcedureStepReviewer:UT,setProcedureStepReviewers:LT,updateProcedureStepReviewer:kT,updateProcedureStepReviewers:NT,deleteProcedureStepReviewer:GT,deleteProcedureStepReviewers:HT}=qn.actions,WT=t=>t.procedureStepReviewerReducer.instances,Bt=l.createSelector([WT],t=>Object.values(t)),KT=t=>s=>s.procedureStepReviewerReducer.instances[t],YT=y(l.createSelector([Bt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),tg=y(l.createSelector([Bt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure===s)))),sg=y(l.createSelector([Bt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_step===s)))),ig=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)))),ZT=qn.reducer,Je=P(t=>t.uuid),JT={instances:{}},Cn=l.createSlice({name:"procedureSteps",initialState:JT,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,JT)),reducers:{initializeProcedureSteps:Je.initialize,setProcedureStep:Je.setOne,setProcedureSteps:Je.setMany,addProcedureStep:Je.addOne,addProcedureSteps:Je.addMany,updateProcedureStep:Je.updateOne,updateProcedureSteps:Je.updateMany,deleteProcedureStep:Je.deleteOne,deleteProcedureSteps:Je.deleteMany}}),{initializeProcedureSteps:XT,setProcedureStep:QT,setProcedureSteps:xT,addProcedureStep:eO,addProcedureSteps:tO,updateProcedureStep:sO,updateProcedureSteps:iO,deleteProcedureStep:nO,deleteProcedureSteps:cO}=Cn.actions,aO=Cn.reducer,$n=t=>t.procedureStepReducer.instances,rO=t=>s=>s.procedureStepReducer.instances[t],Un=l.createSelector([$n],t=>Object.values(t).toSorted((s,e)=>s.order-e.order)),ng=y(l.createSelector([$n,(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)})),cg=y(l.createSelector([Un,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_type===s)))),dO=y(l.createSelector([Un,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Xe=P(({uuid:t})=>t),uO={instances:{}},Ln=l.createSlice({name:"procedureTypeAttachments",initialState:uO,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,uO)),reducers:{initializeProcedureTypeAttachments:Xe.initialize,addProcedureTypeAttachment:Xe.addOne,addProcedureTypeAttachments:Xe.addMany,setProcedureTypeAttachment:Xe.setOne,setProcedureTypeAttachments:Xe.setMany,updateProcedureTypeAttachment:Xe.updateOne,updateProcedureTypeAttachments:Xe.updateMany,deleteProcedureTypeAttachment:Xe.deleteOne,deleteProcedureTypeAttachments:Xe.deleteMany}}),{initializeProcedureTypeAttachments:lO,addProcedureTypeAttachment:oO,addProcedureTypeAttachments:hO,setProcedureTypeAttachment:mO,setProcedureTypeAttachments:pO,updateProcedureTypeAttachment:yO,updateProcedureTypeAttachments:fO,deleteProcedureTypeAttachment:SO,deleteProcedureTypeAttachments:AO}=Ln.actions,IO=Ln.reducer,TO=t=>t.procedureTypeAttachmentReducer.instances,kn=l.createSelector([TO],t=>Object.values(t)),OO=t=>s=>s.procedureTypeAttachmentReducer.instances[t],PO=y(l.createSelector([kn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),ag=y(l.createSelector([kn,(t,s)=>s],(t,s)=>S(t.filter(({procedure_type:e})=>s===e)))),Qe=P(({uuid:t})=>t),FO={instances:{}},Nn=l.createSlice({name:"procedureTypeFieldsAttachments",initialState:FO,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,FO)),reducers:{initializeProcedureTypeFieldsAttachments:Qe.initialize,addProcedureTypeFieldsAttachment:Qe.addOne,addProcedureTypeFieldsAttachments:Qe.addMany,setProcedureTypeFieldsAttachment:Qe.setOne,setProcedureTypeFieldsAttachments:Qe.setMany,updateProcedureTypeFieldsAttachment:Qe.updateOne,updateProcedureTypeFieldsAttachments:Qe.updateMany,deleteProcedureTypeFieldsAttachment:Qe.deleteOne,deleteProcedureTypeFieldsAttachments:Qe.deleteMany}}),{initializeProcedureTypeFieldsAttachments:bO,addProcedureTypeFieldsAttachment:_O,addProcedureTypeFieldsAttachments:gO,setProcedureTypeFieldsAttachment:MO,setProcedureTypeFieldsAttachments:RO,updateProcedureTypeFieldsAttachment:wO,updateProcedureTypeFieldsAttachments:vO,deleteProcedureTypeFieldsAttachment:EO,deleteProcedureTypeFieldsAttachments:BO}=Nn.actions,VO=Nn.reducer,zO=t=>t.procedureTypeFieldsAttachmentReducer.instances,Gn=l.createSelector([zO],t=>Object.values(t)),rg=y(l.createSelector([Gn,(t,s)=>s],(t,s)=>S(t.filter(e=>e.fields_revision===s)))),DO=t=>s=>s.procedureTypeFieldsAttachmentReducer.instances[t],jO=y(l.createSelector([Gn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),xe=P(({uuid:t})=>t),qO={instances:{}},Hn=l.createSlice({name:"procedureTypeFields",initialState:qO,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,qO)),reducers:{initializeProcedureTypeFields:xe.initialize,addProcedureTypeFields:xe.addOne,addProcedureTypeFieldsMany:xe.addMany,setProcedureTypeFields:xe.setOne,setProcedureTypeFieldsMany:xe.setMany,updateProcedureTypeFields:xe.updateOne,updateProcedureTypeFieldsMany:xe.updateMany,deleteProcedureTypeFields:xe.deleteOne,deleteProcedureTypeFieldsMany:xe.deleteMany}}),{initializeProcedureTypeFields:CO,addProcedureTypeFields:$O,addProcedureTypeFieldsMany:UO,setProcedureTypeFields:LO,setProcedureTypeFieldsMany:kO,updateProcedureTypeFields:NO,updateProcedureTypeFieldsMany:GO,deleteProcedureTypeFields:HO,deleteProcedureTypeFieldsMany:WO}=Hn.actions,KO=Hn.reducer,YO=t=>t.procedureTypeFieldsReducer.instances,is=l.createSelector([YO],t=>Object.values(t)),dg=y(l.createSelector([is,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure_type===s)))),ug=y(l.createSelector([is,(t,s)=>s],(t,s)=>t.filter(e=>e.procedure_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),ZO=t=>s=>s.procedureTypeFieldsReducer.instances[t],JO=y(l.createSelector([is,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),et=P(({uuid:t})=>t),XO={instances:{}},Wn=l.createSlice({name:"procedureFieldValuesAttachments",initialState:XO,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,XO)),reducers:{initializeProcedureFieldValuesAttachments:et.initialize,addProcedureFieldValuesAttachment:et.addOne,addProcedureFieldValuesAttachments:et.addMany,setProcedureFieldValuesAttachment:et.setOne,setProcedureFieldValuesAttachments:et.setMany,updateProcedureFieldValuesAttachment:et.updateOne,updateProcedureFieldValuesAttachments:et.updateMany,deleteProcedureFieldValuesAttachment:et.deleteOne,deleteProcedureFieldValuesAttachments:et.deleteMany}}),{initializeProcedureFieldValuesAttachments:QO,addProcedureFieldValuesAttachment:xO,addProcedureFieldValuesAttachments:Kn,setProcedureFieldValuesAttachment:eP,setProcedureFieldValuesAttachments:tP,updateProcedureFieldValuesAttachment:sP,updateProcedureFieldValuesAttachments:iP,deleteProcedureFieldValuesAttachment:nP,deleteProcedureFieldValuesAttachments:Yn}=Wn.actions,cP=Wn.reducer,aP=t=>t.procedureFieldValuesAttachmentReducer.instances,Zn=l.createSelector([aP],t=>Object.values(t)),rP=t=>s=>s.procedureFieldValuesAttachmentReducer.instances[t],dP=y(l.createSelector([Zn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),uP=y(l.createSelector([Zn,(t,s)=>s],(t,s)=>S(t.filter(e=>e.field_values===s)))),tt=P(({uuid:t})=>t),lP={instances:{}},Jn=l.createSlice({name:"procedureFieldValues",initialState:lP,extraReducers:t=>t.addMatcher(l.isAnyOf(T,V,F),s=>Object.assign(s,lP)),reducers:{initializeProcedureFieldValues:tt.initialize,addProcedureFieldValues:tt.addOne,addProcedureFieldValuesMany:tt.addMany,setProcedureFieldValues:tt.setOne,setProcedureFieldValuesMany:tt.setMany,updateProcedureFieldValues:tt.updateOne,updateProcedureFieldValuesMany:tt.updateMany,deleteProcedureFieldValues:tt.deleteOne,deleteProcedureFieldValuesMany:tt.deleteMany}}),{initializeProcedureFieldValues:oP,addProcedureFieldValues:hP,addProcedureFieldValuesMany:mP,setProcedureFieldValues:pP,setProcedureFieldValuesMany:yP,updateProcedureFieldValues:fP,updateProcedureFieldValuesMany:SP,deleteProcedureFieldValues:AP,deleteProcedureFieldValuesMany:IP}=Jn.actions,TP=Jn.reducer,OP=t=>t.procedureFieldValuesReducer.instances,Xn=l.createSelector([OP],t=>Object.values(t)),lg=y(l.createSelector([Xn,(t,s)=>s],(t,s)=>S(t.filter(e=>e.procedure===s)))),PP=t=>s=>s.procedureFieldValuesReducer.instances[t],FP=y(l.createSelector([Xn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),st=P(t=>t.uuid),bP={instances:{}},Qn=l.createSlice({name:"procedureTypes",initialState:bP,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,bP)),reducers:{initializeProcedureTypes:st.initialize,addProcedureType:st.addOne,addProcedureTypes:st.addMany,setProcedureType:st.setOne,setProcedureTypes:st.setMany,updateProcedureType:st.updateOne,updateProcedureTypes:st.updateMany,deleteProcedureType:st.deleteOne,deleteProcedureTypes:st.deleteMany}}),{initializeProcedureTypes:_P,addProcedureType:gP,addProcedureTypes:MP,setProcedureType:RP,setProcedureTypes:wP,updateProcedureType:vP,updateProcedureTypes:EP,deleteProcedureType:BP,deleteProcedureTypes:VP}=Qn.actions,zP=Qn.reducer,DP=t=>t.procedureTypeReducer.instances,xn=l.createSelector([DP],t=>Object.values(t)),jP=t=>s=>s.procedureTypeReducer.instances[t],qP=y(l.createSelector([xn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),og=y(l.createSelector([xn,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),hg={isRehydrated:!1},ec=l.createSlice({name:"rehydrated",initialState:hg,reducers:{setRehydrated:(t,s)=>{t.isRehydrated=s.payload}}}),{setRehydrated:mg}=ec.actions,pg=t=>t.rehydratedReducer.isRehydrated,CP=ec.reducer,it=P(t=>t.uuid),$P={instances:{}},tc=l.createSlice({name:"teamMemberships",initialState:$P,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,$P)),reducers:{initializeTeamMemberships:it.initialize,addTeamMembership:it.addOne,addTeamMemberships:it.addMany,setTeamMembership:it.setOne,setTeamMemberships:it.setMany,updateTeamMembership:it.updateOne,updateTeamMemberships:it.updateMany,deleteTeamMembership:it.deleteOne,deleteTeamMemberships:it.deleteMany}}),{initializeTeamMemberships:UP,addTeamMembership:LP,addTeamMemberships:kP,setTeamMembership:NP,setTeamMemberships:GP,updateTeamMembership:HP,updateTeamMemberships:WP,deleteTeamMembership:KP,deleteTeamMemberships:YP}=tc.actions,ZP=tc.reducer,JP=t=>t.teamMembershipReducer.instances,ns=l.createSelector([JP],t=>Object.values(t)),XP=t=>s=>s.teamMembershipReducer.instances[t],QP=y(l.createSelector([ns,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),yg=y(l.createSelector([ns,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(c=>c.team===s))e[n.user]=n;return e})),fg=y(l.createSelector([Jt,ns,(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)))})),nt=P(t=>t.uuid),xP={instances:{}},sc=l.createSlice({name:"teams",initialState:xP,extraReducers:t=>t.addMatcher(l.isAnyOf(T,F),s=>Object.assign(s,xP)),reducers:{initializeTeams:nt.initialize,addTeam:nt.addOne,addTeams:nt.addMany,setTeam:nt.setOne,setTeams:nt.setMany,updateTeam:nt.updateOne,updateTeams:nt.updateMany,deleteTeam:nt.deleteOne,deleteTeams:nt.deleteMany}}),{initializeTeams:eF,addTeam:tF,addTeams:sF,setTeam:iF,setTeams:nF,updateTeam:cF,updateTeams:aF,deleteTeam:rF,deleteTeams:dF}=sc.actions,uF=t=>t.teamReducer.instances,ic=l.createSelector([uF],t=>Object.values(t)),lF=t=>s=>s.teamReducer.instances[t],oF=y(l.createSelector([ic,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Sg=y(l.createSelector([ic,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),hF=sc.reducer,Ag={version:0},mF=l.createSlice({name:"versioning",initialState:Ag,reducers:{}}),pF=mF.reducer,nc={outboxReducer:yf,fileReducer:zu,authReducer:Nd},Ig=l.combineReducers(nc),yF={...nc,[_t]:pF,assetReducer:ba,assetAttachmentReducer:Xc,assetCommentReducer:oa,assetTypeReducer:gd,assetTypeAttachmentReducer:qa,issueReducer:Jh,issueAttachmentReducer:lh,issueTypeReducer:xp,issueTypeAttachmentReducer:lm,organizationReducer:uf,projectReducer:RS,projectAttachmentReducer:kf,projectCommentReducer:sS,projectAccessReducer:gf,organizationAccessReducer:Gy,projectFileReducer:SS,procedureTypeReducer:zP,procedureInitiativeReducer:kS,procedureReducer:eA,procedureTypeFieldsReducer:KO,procedureFieldValuesReducer:TP,procedureTypeAttachmentReducer:IO,procedureTypeFieldsAttachmentReducer:VO,procedureFieldValuesAttachmentReducer:cP,procedureStepFieldsAttachmentReducer:jI,procedureStepFieldsReducer:ZI,procedureStepFieldValuesAttachmentReducer:dT,procedureStepFieldValuesReducer:IT,procedureStepFieldValuesReviewReducer:DT,procedureStepAssigneeReducer:OA,procedureStepCommentReducer:DA,procedureStepDefaultAssigneeReducer:ZA,procedureStepDefaultReviewerReducer:uI,procedureStepEventReducer:FI,procedureStepReviewerReducer:ZT,procedureStepReducer:aO,rehydratedReducer:CP,formReducer:Wl,formRevisionReducer:Dl,formRevisionAttachmentReducer:Pl,formSubmissionAttachmentReducer:ro,formSubmissionReducer:Oo,formIdentifierReducer:Yu,formIdentifierValueReducer:dl,userReducer:Ey,emailDomainsReducer:Eu,documentsReducer:pu,documentAttachmentReducer:iu,teamReducer:hF,agentsReducer:Cc,issueCommentReducer:qh,issueCommentAttachmentReducer:bh,issueUpdateReducer:Py,geoImageReducer:Do,issueAssociationReducer:Xo,issueTypeFieldsReducer:Qm,issueTypeFieldValuesReducer:Cm,issueTypeFieldsAttachmentReducer:bm,issueTypeFieldValuesAttachmentReducer:op,issueTypeIdentifierReducer:_p,issueTypeIdentifierValueReducer:$p,issueTypeStatusReducer:hy,assetTypeFieldsReducer:or,assetTypeFieldValuesReducer:Cr,assetTypeFieldsAttachmentReducer:Xa,assetTypeFieldValuesAttachmentReducer:br,assetTypeIdentifierReducer:Qr,assetTypeIdentifierValueReducer:hd,assetTypeStatusReducer:Ud,teamMembershipReducer:ZP},Tg=l.combineReducers(yF),fF=1e4,SF=200,cc=[400,409,403,404,405,500],k=1e4,AF={};class IF{constructor(s){h(this,"client");h(this,"pageSize",fF);AF[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 TF=()=>FF.length-1,OF=t=>(t[_t]={version:TF()},t),PF=()=>OF({}),Og=t=>(t.outboxReducer&&(t.outboxReducer.deletedRequests=[]),t),Pg=t=>s=>{var e;return s===void 0&&(s={}),((e=s[_t])==null?void 0:e.version)===TF()?s:t(s)},FF=[OF,PF,PF,Og],Fg=Object.fromEntries(FF.map((t,s)=>[s,Pg(t)])),bg=t=>{if(t)throw t;const s=Pt();s?s.dispatch({type:"rehydrated/setRehydrated",payload:!0}):console.error("Client store not set")},bF=(t,s,e)=>{const n=ht();return n?(n.addRequest(s),n.getQueue()):(console.warn("Outbox coordinator not set; cannot enqueue request yet."),[])},_F=(t,s,e)=>{const n=ht();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 _g(t,s){if(!s.payload)throw new Error("Received empty payload");return CF(s)}const gg={...hc,effect:_g,discard:MF,returnPromises:!0,persistCallback:bg,retry:vg,persistOptions:{storage:WF},queue:{...hc.queue,enqueue:bF,dequeue:_F,peek:(...t)=>wg(...t)}},Mg=KF(Fg,_t),Rg=l.compose(HF.offline(gg),Mg);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=AF[t.meta.offline.effect.serviceName];if(!c)throw new Error(`Service ${t.meta.offline.effect.serviceName} not found`);return rc(t.meta.offline.effect.BASE_URL,t.meta.offline.effect.request,s,c,e)}function MF(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=Pt(),r=n.getState().outboxReducer.deletedRequests,a=s.payload.uuid;function u(){n.dispatch(mf(a));const m=ht();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&&cc.includes(m)){console.warn("Discarding request due to error:",t,`
|
|
4
|
+
Action:`,s);const f=ht();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=ht();if(!d)throw new Error("Outbox coordinator not set");return d.registerRetry(s.payload.uuid),!1}function wg(t,s,e){var n;return(n=ht())==null?void 0:n.peek()}function vg(t,s){return Pt().dispatch(pf(new Date().getTime())),Oc}const Tt="An unknown error occurred",Eg=500,RF=["non_field_errors","detail"];function Bg(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"?RF.includes(c)?r:`${c}: ${r}`:Array.isArray(r)?RF.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>Eg?Tt:e}class U extends Error{constructor(e){super(Tt);h(this,"status");h(this,"response");h(this,"message");h(this,"options");const{response:n,innerError:c}=e;this.message=e.message??Bg(n,c)??Tt,this.status=(n==null?void 0:n.status)??0,this.response=n,e.discard=e.discard??!1,this.options=e}}function wF(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 Vg extends IF{constructor(s){super(s)}}class lt extends IF{constructor(e,n){super(e);h(this,"auth");this.auth=n}}class zg extends lt{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(Dc(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(qc(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(jc(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(zc(n)),n}}function ct(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 lt{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",SF)}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=ct(e,Math.min(n??e.length,k)),f=[];for(const g of m){const _=[],w={},B=[],C=[];for(const z of g){let Ft;if("file"in z){const{file:lc,...nR}=z,bt=await this.client.files.getFilePayload(lc);bt.sha1 in w||(w[bt.sha1]=bt);const LF=URL.createObjectURL(lc);p.add(LF),Ft={...nR,file_sha1:bt.sha1,file_type:bt.file_type,file_name:lc.name,file_extension:bt.extension,file_url:LF}}else Ft=z;const q=this.buildModel(Ft);d.push(q);const N=this.buildBulkPayload(q);_.push(N);const cs=this.getBlockers(q);B.push(...cs);const iR=this.getBlocks(q);C.push(...iR)}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 Dg extends j{constructor(){super(...arguments);h(this,"name","Asset attachment");h(this,"url","/asset-attachments");h(this,"actions",{addOne:Lc,addMany:fs,setOne:kc,setMany:Nc,updateOne:Gc,updateMany:Hc,deleteOne:Wc,deleteMany:Ss,initialize:Uc});h(this,"selectors",{selectById:Yc,selectByIds:Zc})}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 O({...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 jg extends v{constructor(){super(...arguments);h(this,"name","Asset Comment");h(this,"url","/asset-comments");h(this,"actions",{addOne:ea,addMany:jt,setOne:ta,setMany:sa,updateOne:ia,updateMany:na,deleteOne:ca,deleteMany:qt,initialize:xc});h(this,"selectors",{selectById:ra,selectByIds:da})}add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions,a=O({...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 qg extends v{constructor(){super(...arguments);h(this,"url","/assets");h(this,"name","Asset");h(this,"actions",{addOne:pa,addMany:Os,setOne:Aa,setMany:Ia,updateOne:ya,updateMany:fa,deleteOne:Sa,deleteMany:Ps,initialize:ma});h(this,"selectors",{selectById:Pa,selectByIds:Fa})}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=O({...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(Jc(e)),d=this.select(ua(e)),p=this.select(Zo(e)),m=this.select(cA(e));this.dispatch(c(e)),this.dispatch(Ss(E(u))),this.dispatch(qt(E(d))),this.dispatch(ft(E(p))),this.dispatch(It(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(jt(d)),this.dispatch(yt(p)),this.dispatch(At(m)),f}}bulkAdd(e,n){const{addMany:c}=this.actions,r=new Date().toISOString(),a=ct(e,Math.min(n??e.length,k)).map(p=>{const m=p.map(f=>O(f));return{batchId:at.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(Dt);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=ct(e,Math.min(n??e.length,k)),m=[];let f=null;for(const I of p){const R=at.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(la(e)),d=this.select(Jo(e)),p=this.select(aA(e));this.dispatch(c(e)),this.dispatch(qt(E(u))),this.dispatch(ft(E(d))),this.dispatch(It(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(jt(u)),this.dispatch(yt(d)),this.dispatch(At(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 Cg extends j{constructor(){super(...arguments);h(this,"name","Asset Type Attachment");h(this,"url","/asset-type-attachments");h(this,"actions",{addOne:Ma,addMany:bs,setOne:Ra,setMany:wa,updateOne:va,updateMany:Ea,deleteOne:Ba,deleteMany:_s,initialize:ga});h(this,"selectors",{selectById:za,selectByIds:Da})}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 O({...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 $g extends j{constructor(){super(...arguments);h(this,"name","Asset Type Fields Attachment");h(this,"url","/asset-type-fields-attachments");h(this,"actions",{addOne:Ua,addMany:La,setOne:ka,setMany:Na,updateOne:Ga,updateMany:Ha,deleteOne:Wa,deleteMany:Ka,initialize:$a});h(this,"selectors",{selectById:Za,selectByIds:Ja})}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 O({...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 Ug extends v{constructor(){super(...arguments);h(this,"name","Asset Type Fields");h(this,"url","/asset-type-fields");h(this,"actions",{addOne:er,addMany:tr,setOne:sr,setMany:ir,updateOne:nr,updateMany:cr,deleteOne:ar,deleteMany:rr,initialize:xa});h(this,"selectors",{selectById:ur,selectByIds:lr})}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=O({...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 Lg 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:pr,addMany:Es,setOne:yr,setMany:fr,updateOne:Sr,updateMany:Ar,deleteOne:Ir,deleteMany:Bs,initialize:mr});h(this,"selectors",{selectById:Or,selectByIds:Pr})}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 O({...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 kg extends v{constructor(){super(...arguments);h(this,"name","Asset Type Field Values");h(this,"url","/asset-type-field-values");h(this,"actions",{addOne:Mr,addMany:Rr,setOne:wr,setMany:vr,updateOne:Er,updateMany:Br,deleteOne:Vr,deleteMany:zr,initialize:gr});h(this,"selectors",{selectById:jr,selectByIds:qr})}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=O({...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=ct(c,Math.min(n??c.length,k)),I=[];for(const b of f){const g=[];for(const _ of b){const w=O({..._,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(Fr(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 Ng extends v{constructor(){super(...arguments);h(this,"name","Asset Type Identifier");h(this,"url","/asset-type-identifiers");h(this,"actions",{addOne:Lr,addMany:kr,setOne:Nr,setMany:Gr,updateOne:Hr,updateMany:Wr,deleteOne:Kr,deleteMany:Yr,initialize:Ur});h(this,"selectors",{selectById:Jr,selectByIds:Xr})}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=O({...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 Gg extends v{constructor(){super(...arguments);h(this,"name","Asset Type Identifier Value");h(this,"url","/asset-type-identifier-values");h(this,"actions",{addOne:td,addMany:sd,setOne:id,setMany:nd,updateOne:cd,updateMany:ad,deleteOne:rd,deleteMany:dd,initialize:ed});h(this,"selectors",{selectById:ld,selectByIds:od})}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=O({...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=ct(e,Math.min(n??e.length,k)),m=[],f=[];for(const b of p){const g=[],_=[],w=[];for(const C of b){const D=O({...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 Hg extends v{constructor(){super(...arguments);h(this,"name","Asset Type");h(this,"url","/asset-types");h(this,"actions",{addOne:Sd,addMany:Ad,setOne:yd,setMany:fd,updateOne:Id,updateMany:Td,deleteOne:Od,deleteMany:Pd,initialize:pd});h(this,"selectors",{selectById:bd,selectByIds:_d})}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=O({...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(Oa(e)),d=this.select(ja(e));this.dispatch(n(e)),this.dispatch(Ps(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(Os(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 Wg extends v{constructor(){super(...arguments);h(this,"name","Asset Type Status");h(this,"url","/asset-type-statuses");h(this,"actions",{addOne:wd,addMany:vd,setOne:Ed,setMany:Bd,updateOne:Vd,updateMany:zd,deleteOne:Dd,deleteMany:jd,initialize:Rd});h(this,"selectors",{selectById:Cd,selectByIds:$d})}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=O({...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 Kg extends j{constructor(){super(...arguments);h(this,"name","Document Attachment");h(this,"url","/document-attachments");h(this,"actions",{addOne:Wd,addMany:Kd,setOne:Yd,setMany:Zd,updateOne:Jd,updateMany:Xd,deleteOne:Qd,deleteMany:xd,initialize:Hd});h(this,"selectors",{selectById:tu,selectByIds:su})}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 O({...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 Yg extends v{constructor(){super(...arguments);h(this,"name","Document");h(this,"url","/documents");h(this,"actions",{addOne:au,addMany:ru,setOne:du,setMany:uu,updateOne:lu,updateMany:ou,deleteOne:hu,deleteMany:mu,initialize:cu});h(this,"selectors",{selectById:yu,selectByIds:fu})}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=O({...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(Su(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 ot extends lt{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 Zg extends ot{constructor(){super(...arguments);h(this,"name","Email Domains");h(this,"url","/organization-email-domains");h(this,"actions",{addOne:Tu,addMany:Ou,setOne:Pu,setMany:Fu,updateOne:bu,updateMany:_u,deleteOne:gu,deleteMany:Mu,initialize:Iu});h(this,"selectors",{selectById:wu,selectByIds:vu})}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 Jg extends lt{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 Vt={},ac=new Set;class Xg extends lt{constructor(){super(...arguments);h(this,"host");h(this,"dbPromise",YF.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 zt(e);if(ac.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),ac.add(n)}async removeCache(e){await(await this.getDB()).delete("files",e),ac.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 Vt?u=Vt[r]:gc(e)?(u=_c(e,c),Vt[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)})}),Vt[r]=u);let d;try{d=await u}catch(m){throw m instanceof U&&delete Vt[r],m}const p=await zt(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(A)}const p=o.type.split("/")[1];if(!p)throw new Error("File has no extension");const y=n??h+"."+p;if(o=dc(o,y),!o.name)throw new Error("Failed to set file's name");await this.addCache(o,h),Xt[c]=new Promise(A=>{A(o)})}return o}}class Hb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(Ki(c));const r=this.enqueueRequest({description:"Create form identifier",method:l.POST,url:"/form-identifiers/",payload:v(c),blockers:[c.form],blocks:[c.uuid]});return r.then(m=>{this.dispatch(yt(m))}).catch(()=>{this.dispatch(Yi(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=Zi(e.uuid)(i.getState());if(!a)throw new Error(`Expected form identifier with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(yt(n));const c=this.enqueueRequest({description:"Update form identifier",method:l.PATCH,url:`/form-identifiers/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(yt(r))}).catch(()=>{this.dispatch(yt(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Zi(e)(a);if(!n)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(Yi(e));try{return await this.enqueueRequest({description:"Delete form identifier",method:l.DELETE,url:`/form-identifiers/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(Ki(n)),c}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get form identifiers",method:l.GET,url:"/form-identifiers/",queryParams:{form__organization:e},blockers:[],blocks:[]},i);return this.dispatch(uo(a)),a}}class Wb extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(Xi(c));const r=this.enqueueRequest({description:"Create form identifier value",method:l.POST,url:"/form-identifier-values/",payload:v(c),blockers:[e.form_submission,e.form_identifier],blocks:[c.uuid]});return r.then(m=>{this.dispatch(At(m))}).catch(()=>{this.dispatch(Qi(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=ea(e.uuid)(i.getState());if(!a)throw new Error(`Expected form identifier value with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(At(n));const c=this.enqueueRequest({description:"Update form identifier value",method:l.PATCH,url:`/form-identifier-values/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(At(r))}).catch(()=>{this.dispatch(At(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=ea(e)(a);if(!n)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(Qi(e));try{return await this.enqueueRequest({description:"Delete form identifier value",method:l.DELETE,url:`/form-identifier-values/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(Xi(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get form identifier values",method:l.GET,url:"/form-identifier-values/",queryParams:{limit:V,paginate:!0,form_submission__form_revision__form__organization:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get form identifier values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(po(n)),n}}class Kb extends j{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{revisionUuid:h,fieldIdentifier:p,file:y}=o,A=await this.getFilePayload(y);A.sha1 in n||(n[A.sha1]=A);const I=b({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:A.sha1,created_by:a,form_revision:h,submitted_at:i,field_identifier:p});c.push(I);const F={uuid:I.uuid,file_name:y.name,field_identifier:p,file_extension:A.extension,file_sha1:A.sha1,form_revision:h};r.push(F)}this.dispatch(To(c));const u=this.enqueueRequest({description:"Attach files to form revision",method:l.POST,url:"/form-revision-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(n)},blockers:c.map(o=>o.form_revision),blocks:c.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(Io(o.attachments))}).catch(()=>{this.dispatch(go(c.map(o=>o.uuid)))}),[c,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization form revision attachments",method:l.GET,url:"/form-revision-attachments/",queryParams:{form_revision__form__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(So(a)),a}}class Yb extends j{add(e){var u;const{store:i}=this.client,n=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=b({...e,created_by:n,submitted_at:new Date().toISOString()});this.dispatch(ia(c));const r=this.enqueueRequest({description:"Create form revision",method:l.POST,url:"/form-revisions/",payload:v(c),blockers:[e.form],blocks:[c.uuid]});return r.then(m=>{this.dispatch(Ro(m))}).catch(()=>{this.dispatch(aa(c.uuid))}),[c,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get organization form revisions",method:l.GET,url:"/form-revisions/",queryParams:{form__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(Oo(a)),a}}class Zb extends j{add(e,i){var o;const{store:a}=this.client,n=new Date().toISOString(),c=(o=a.getState().userReducer.currentUser)==null?void 0:o.id,r=b({...e,submitted_at:n,created_by:c}),u=b({...i,form:r.uuid,submitted_at:n,created_by:c});this.dispatch(da(r)),this.dispatch(ia(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(ua(r.uuid)),this.dispatch(aa(u.uuid)),h}),[r,u,m]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Uo(e)(a);if(!n)throw new Error("Expected form to exist");const c=Zo(e)(a);c.length>0&&this.dispatch(Yo(c.map(({uuid:u})=>u)));const r=wo(e)(a);r.length>0&&this.dispatch(vo(r.map(({uuid:u})=>u))),this.dispatch(ua(e));try{return await this.enqueueRequest({description:"Delete form",method:l.DELETE,url:`/forms/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(da(n)),r.length>0&&this.dispatch(_o(r)),c.length>0&&this.dispatch(Wo(c)),u}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization forms",method:l.GET,url:"/forms/",queryParams:{organization:e},blockers:[e],blocks:[]},i);return this.dispatch(Vo(a)),a}}class Jb extends j{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{submissionUuid:h,fieldIdentifier:p,file:y}=o,A=await this.getFilePayload(y);A.sha1 in n||(n[A.sha1]=A);const I=b({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:A.sha1,created_by:a,form_submission:h,submitted_at:i,field_identifier:p});c.push(I);const F={uuid:I.uuid,file_name:y.name,file_sha1:A.sha1,file_extension:A.extension,field_identifier:p,form_submission:h};r.push(F)}this.dispatch($t(c));const u=this.enqueueRequest({description:"Attach files to form submission",method:l.POST,url:"/form-submission-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(n)},blockers:c.map(o=>o.form_submission),blocks:c.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(ko(o.attachments))}).catch(o=>{throw this.dispatch(Gt(c.map(h=>h.uuid))),o}),[c,u.then(({attachments:o})=>o)]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),n=$o(e)(a);this.dispatch(Gt(e));try{await this.enqueueRequest({description:"Delete form submission attachments",method:l.DELETE,url:"/form-submission-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(c){throw this.dispatch($t(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get form submission attachments",method:l.GET,url:"/form-submission-attachments/",queryParams:{limit:He,paginate:!0,form_submission__form_revision__form__organization:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get form submission attachments",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Co(n)),n}}class Xb extends j{add(e){var r;const{store:i}=this.client,a=i.getState(),n=b({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),c=this.enqueueRequest({description:"Add form submission",method:l.POST,url:"/form-submissions/",payload:v(n),blockers:[e.form_revision],blocks:[n.uuid]});return this.dispatch(ma(n)),c.then(u=>(this.dispatch(Lt(u)),u)).catch(()=>{this.dispatch(pa(n.uuid))}),[n,c]}update(e){const{store:i}=this.client,a=i.getState(),n=Aa(e.uuid)(a);if(!n)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(Ko(c));const r=this.enqueueRequest({description:"Delete user form submissions",method:l.PATCH,url:`/form-submissions/${c.uuid}/`,payload:e,blockers:[c.uuid],blocks:[c.uuid]});return r.then(u=>{this.dispatch(Lt(u))}).catch(()=>{this.dispatch(Lt(n))}),[c,r]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Aa(e)(a);if(!n)throw new Error(`Expected submission with uuid ${e} to exist`);const c=Go(e)(a);this.dispatch(pa(e)),this.dispatch(Gt(c.map(r=>r.uuid)));try{return await this.enqueueRequest({description:"Delete user form submissions",method:l.DELETE,url:`/form-submissions/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(ma(n)),this.dispatch($t(c)),r}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Fetch form submissions",method:l.GET,url:"/form-submissions/",queryParams:{limit:V,paginate:!0,form_revision__form_organization:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Fetch form submissions",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Ho(n)),n}}class Qb extends j{async add(e){var p;const{store:i}=this.client,{file:a,...n}=e,c=new Date().toISOString(),r=(p=i.getState().userReducer.currentUser)==null?void 0:p.id,u=n.project,m=await this.getFilePayload(a),o=b({...n,file_name:a.name,file_sha1:m.sha1,file:URL.createObjectURL(a),submitted_at:c,created_by:r});this.dispatch(el(o));const h=this.enqueueRequest({description:"Add geo image",method:l.POST,url:"/geo-images/",payload:{uuid:o.uuid,submitted_at:c,title:o.title,description:o.description,geo_marker:o.geo_marker,canvas_marker:o.canvas_marker,sha1:o.file_sha1,project:o.project,file_name:o.file_name,direction:o.direction,original_date:o.original_date,file:m},blocks:[u],blockers:[u]});return h.then(y=>{this.processPresignedUrls(y.presigned_urls),this.dispatch(ft(y.geo_image))}).catch(()=>{this.dispatch(Sa(o.uuid))}),[o,h.then(y=>y.geo_image)]}async bulkAdd(e,i){var p;const{store:a}=this.client,n=new Date().toISOString(),c=(p=a.getState().userReducer.currentUser)==null?void 0:p.id,r=[],u=[],m=[],o={};for(const y of e){const{file:A,...I}=y,F=await this.getFilePayload(A);F.sha1 in o||(o[F.sha1]=F);const _=b({...I,file_name:A.name,file_sha1:F.sha1,file:URL.createObjectURL(A),submitted_at:n,created_by:c,project:i});r.push(_),u.push(_.uuid),m.push({uuid:_.uuid,sha1:_.file_sha1,file_name:_.file_name,title:_.title,description:_.description,geo_marker:_.geo_marker,canvas_marker:_.canvas_marker,direction:_.direction,original_date:_.original_date})}this.dispatch(tl(r));const h=this.enqueueRequest({description:"Bulk add geo images",method:l.POST,url:"/geo-images/bulk/",payload:{submitted_at:n,project:i,geo_images:m,files:Object.values(o)},blocks:[i],blockers:u});return h.then(y=>{this.processPresignedUrls(y.presigned_urls),this.dispatch(xo(y.geo_images))}).catch(()=>{this.dispatch(il(u))}),[r,h.then(y=>y.geo_images)]}update(e){const{store:i}=this.client,a=i.getState(),n=Ta(e.uuid)(a);if(!n)throw new Error(`Map image with uuid ${e.uuid} does not exist in the store`);const c={...n,...e};this.dispatch(sl(c));const r=this.enqueueRequest({description:"Update geo image",method:l.PATCH,url:`/geo-images/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return r.then(u=>{this.dispatch(ft(u))}).catch(()=>{this.dispatch(ft(n))}),[c,r]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Ta(e)(a);if(!n)throw new Error(`Map image with uuid ${e} does not exist in the store`);this.dispatch(Sa(e));const c=this.enqueueRequest({description:"Delete geo image",method:l.DELETE,url:`/geo-images/${e}/`,blocks:[e],blockers:[e]});return c.catch(()=>{this.dispatch(ft(n))}),c}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get geo images",method:l.GET,url:"/geo-images/",queryParams:{project:e},blocks:[e],blockers:[]},i);return this.dispatch(Qo(a)),a}}class xb extends R{add(e){var u;const{store:i}=this.client,a=new Date().toISOString(),n=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=b({...e,submitted_at:a,created_by:n});this.dispatch(ga(c));const r=this.enqueueRequest({description:"Add issue association",method:l.POST,url:"/issue-associations/",payload:v(c),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[c.uuid]});return r.then(m=>{this.dispatch(ul(m))}).catch(()=>{this.dispatch(Fa(c.uuid))}),[c,r]}async delete(e){const{store:i}=this.client,a=ol(e)(i.getState());if(!a)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(Fa(e));const n=this.enqueueRequest({description:"Delete issue association",method:l.DELETE,url:`/issue-associations/${e}/`,blockers:[e],blocks:[]});return n.catch(()=>{this.dispatch(ga(a))}),n}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Fetch issue associations",method:l.GET,url:"/issue-associations/",queryParams:{limit:V,paginate:!0,associated_issue__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Fetch issue associations",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(dl(n)),n}}class eF extends We{constructor(){super(...arguments);S(this,"name","Issue Attachment");S(this,"url","/issue-attachments");S(this,"initializeAttachments",_a);S(this,"addAttachments",Ra);S(this,"updateAttachments",fl);S(this,"removeAttachments",va);S(this,"removeAttachment",Sl);S(this,"setAttachment",Al);S(this,"selectAttachment",bl)}buildOfflineAttachment(i){return b({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,issue:i.modelUuid})}buildAttachmentPayload(i){return{...i,issue:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.issueUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const c=(await this.performPagination({immediate:!0,description:"Get issue attachments",method:l.GET,url:`${this.url}/`,queryParams:{limit:He,paginate:!0,issue__project:i},blocks:[],blockers:[]},r=>({immediate:!0,description:"Get issue attachments",method:l.GET,url:r,blockers:[],blocks:[]}),a)).flat();return this.dispatch(_a(c)),c}}class tF extends We{constructor(){super(...arguments);S(this,"name","Issue Comment Attachment");S(this,"url","/issue-comment-attachments");S(this,"initializeAttachments",Ma);S(this,"addAttachments",Ol);S(this,"updateAttachments",Rl);S(this,"removeAttachments",wl);S(this,"removeAttachment",vl);S(this,"setAttachment",_l);S(this,"selectAttachment",Vl)}buildOfflineAttachment(i){return b({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,issue_comment:i.modelUuid})}buildAttachmentPayload(i){return{...i,issue_comment:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.issueCommentUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const c=(await this.performPagination({immediate:!0,description:"Get issue comment attachments",method:l.GET,url:`${this.url}/`,queryParams:{limit:He,paginate:!0,issue_comment__issue__project:i},blocks:[],blockers:[]},r=>({immediate:!0,description:"Get issue comment attachments",method:l.GET,url:r,blockers:[],blocks:[]}),a)).flat();return this.dispatch(Ma(c)),c}}class sF extends R{add(e){var c;const{store:i}=this.client,a=b({...e,author:(c=i.getState().userReducer.currentUser)==null?void 0:c.id,submitted_at:new Date().toISOString()});this.dispatch(Va(a));const n=this.enqueueRequest({description:"Add issue comment",method:l.POST,url:"/issue-comments/",payload:v(a),blockers:[e.issue],blocks:[a.uuid]});return n.catch(()=>{this.dispatch(qa(a.uuid))}),[a,n]}update(e){const{store:i}=this.client,a=za(e.uuid)(i.getState());if(!a)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const n={...a,...e};this.dispatch(ja(n));const c=this.enqueueRequest({description:"Edit issue comment",method:l.PATCH,url:`/issue-comments/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.catch(()=>{this.dispatch(ja(a))}),[n,c]}remove(e){const{store:i}=this.client,a=za(e)(i.getState());if(!a)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(qa(e));const n=this.enqueueRequest({description:"Delete comment",method:l.DELETE,url:`/issue-comments/${e}/`,blockers:[e],blocks:[]});return n.catch(()=>{this.dispatch(Va(a))}),n}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get comments",method:l.GET,url:"/issue-comments/",queryParams:{issue__project:e},blockers:[],blocks:[]},i);return this.dispatch(zl(a)),a}}class iF extends R{add(e){var m;const{store:i}=this.client,a=i.getState(),n=new Date().toISOString(),c=(m=a.userReducer.currentUser)==null?void 0:m.id,r=b({...e,submitted_at:n,created_by:c});this.dispatch(Da(r));const u=this.enqueueRequest({description:"Create issue",method:l.POST,url:"/issues/",payload:v(r),blockers:[r.project,r.issue_type,...r.category?[r.category]:[]],blocks:[r.uuid]});return u.then(o=>{this.dispatch(Nt(o))}).catch(o=>{throw this.dispatch(Ca(r.uuid)),o}),[r,u]}update(e){var m;const i=this.client.store.getState(),a=$a(e.uuid)(i);if(!a)throw new Error(`Attempting to update an issue with uuid ${e.uuid} that doesn't exist in the store`);const n={...a,...e};this.dispatch(Nt(n));const c={};for(const o of[E.TITLE,E.DESCRIPTION,E.STATUS,E.CATEGORY,E.PRIORITY,E.ASSIGNED_TO,E.DUE_DATE])if(o in e&&e[o]!==a[o])switch(o){case E.PRIORITY:case E.STATUS:{const h=e[o];c[o]=h!==void 0?Number(h):null;break}case E.DUE_DATE:case E.DESCRIPTION:case E.TITLE:c[o]=e[o]??null;break;case E.CATEGORY:{let h=null;const p=e[o];if(p&&(h=i.categoryReducer.instances[p]??null,!h))throw new Error(`Trying to update issue category to ${p} which does not exist in store`);c[o]=h?{name:h.name,color:h.color,uuid:h.uuid}:null;break}case E.ASSIGNED_TO:{let h=null;const p=e[o];if(p&&(h=i.userReducer.instances[p]??null,!h))throw new Error(`Trying to update issue assigned_to to ${p} which does not exist in store`);c[o]=h?{full_name:h.username,id:h.id}:null;break}}const r=b({created_by:(m=i.userReducer.currentUser)==null?void 0:m.id,submitted_at:new Date().toISOString(),issue:a.uuid,changes:c});this.dispatch(Lh(r));const u=this.enqueueRequest({description:"Edit issue",method:l.PATCH,url:`/issues/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.catch(()=>{this.dispatch(Nt(a)),this.dispatch(Hh(r.uuid))}),[n,u]}async remove(e){const{store:i}=this.client,a=i.getState(),n=$a(e)(a);if(!n)throw new Error(`No issue with uuid ${e} found in the store`);const c=gl(e)(a),r=Zh(e)(a),u={};for(const o of ll(e)(a))u[o.uuid]=o;for(const o of hl(e)(a))u[o.uuid]=o;const m=Object.values(u);this.dispatch(Ca(e)),c.length>0&&this.dispatch(va(c.map(({uuid:o})=>o))),r.length>0&&this.dispatch(Wh(r.map(({uuid:o})=>o))),m.length>0&&this.dispatch(Pa(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(Da(n)),this.dispatch(Ra(c)),this.dispatch(Nh(r)),this.dispatch(ba(m)),o}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get issues",method:l.GET,url:"/issues/",queryParams:{limit:V,paginate:!0,project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get issues",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(kl(n)),n}}class aF extends We{constructor(){super(...arguments);S(this,"name","Issue Type Attachment");S(this,"url","/issue-type-attachments");S(this,"initializeAttachments",La);S(this,"addAttachments",Hl);S(this,"updateAttachments",Kl);S(this,"removeAttachments",Zl);S(this,"removeAttachment",Yl);S(this,"setAttachment",Wl);S(this,"selectAttachment",Ql)}buildOfflineAttachment(i){return b({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,issue_type:i.modelUuid})}buildAttachmentPayload(i){return{...i,issue_type:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.issueTypeUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const n=await this.enqueueRequest({immediate:!0,description:"Get issue type attachments",method:l.GET,url:`${this.url}/`,queryParams:{issue_type__organization:i},blocks:[],blockers:[]},a);return this.dispatch(La(n)),n}}class nF extends j{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,n={},c=[],r=[];for(const o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:y}=o,A=await this.getFilePayload(y);A.sha1 in n||(n[A.sha1]=A);const I=b({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:A.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});c.push(I);const F={uuid:I.uuid,file_name:y.name,file_extension:A.extension,field_identifier:p,file_sha1:A.sha1,fields_revision:h};r.push(F)}this.dispatch(sh(c));const u=this.enqueueRequest({description:"Add issue type fields attachments",method:l.POST,url:"/issue-type-fields-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(n)},blockers:c.map(o=>o.fields_revision),blocks:c.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(ih(o.attachments))}).catch(()=>{this.dispatch(ah(c.map(o=>o.uuid)))}),[c,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"get issue type fields attachments",method:l.GET,url:"/issue-type-fields-attachments/",queryParams:{fields_revision__issue_type__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(th(a)),a}}class cF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(ph(c));const r=this.enqueueRequest({description:"Add Issue Type Fields",method:l.POST,url:"/issue-type-fields/",payload:v(c),blockers:[c.issue_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(yh(m))}).catch(m=>{throw this.dispatch(Ah(c.uuid)),m}),[c,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Issue Type Fields",method:l.GET,url:"/issue-type-fields/",queryParams:{issue_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(mh(a)),a}}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,n={},c=[],r=[];for(const o of e){const{fieldValuesUuid:h,fieldIdentifier:p,file:y}=o,A=await this.getFilePayload(y);A.sha1 in n||(n[A.sha1]=A);const I=b({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:A.sha1,created_by:a,field_values:h,submitted_at:i,field_identifier:p});c.push(I);const F={uuid:I.uuid,file_name:y.name,file_sha1:A.sha1,file_extension:A.extension,field_identifier:p,field_values:h};r.push(F)}this.dispatch(Wt(c));const u=this.enqueueRequest({description:"Add issue type field values attachments",method:l.POST,url:"/issue-type-field-values-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(n)},blockers:c.map(o=>o.field_values),blocks:c.map(o=>o.uuid)});return u.then(({presigned_urls:o,attachments:h})=>{this.processPresignedUrls(o),this.dispatch(gh(h))}).catch(o=>{throw this.dispatch(Kt(c.map(h=>h.uuid))),o}),[c,u.then(({attachments:o})=>o)]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),n=Fh(e)(a);this.dispatch(Kt(e));try{await this.enqueueRequest({description:"Delete issue type field values attachments",method:l.DELETE,url:"/issue-type-field-values-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(c){throw this.dispatch(Wt(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get issue type field values attachments",method:l.GET,url:"/issue-type-field-values-attachments/",queryParams:{limit:He,paginate:!0,field_values__issue__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get issue type field values attachments",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Ih(n)),n}}class dF extends R{add(e){var r;const{store:i}=this.client,a=i.getState(),n=b({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),c=this.enqueueRequest({description:"Add issue type field values",method:l.POST,url:"/issue-type-field-values/",payload:v(n),blockers:[e.issue,e.fields_revision],blocks:[n.uuid]});return this.dispatch(Wa(n)),c.then(u=>(this.dispatch(Tt(u)),u)).catch(()=>{this.dispatch(Ka(n.uuid))}),[n,c]}update(e){const{store:i}=this.client,a=i.getState(),n=Za(e.uuid)(a);if(!n)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const c={...n,...e};this.dispatch(Tt(c));const r=this.enqueueRequest({description:"Update issue type field values",method:l.PATCH,url:`/issue-type-field-values/${e.uuid}/`,payload:e,blockers:[c.uuid,c.fields_revision,c.issue],blocks:[c.uuid]});return r.then(u=>{this.dispatch(Tt(u))}).catch(()=>{this.dispatch(Tt(n))}),[c,r]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Za(e)(a);if(!n)throw new Error(`Expected submission with uuid ${e} to exist`);const c=Ph(e)(a);this.dispatch(Ka(e)),this.dispatch(Kt(c.map(r=>r.uuid)));try{await this.enqueueRequest({description:"Delete issue type field values",method:l.DELETE,url:`/issue-type-field-values/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(Wa(n)),this.dispatch(Wt(c)),r}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get issue type field values",method:l.GET,url:"/issue-type-field-values/",queryParams:{limit:V,paginate:!0,issue__project:e,latest:!0},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get issue type field values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(uh(n)),n}}class uF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(en(c));const r=this.enqueueRequest({description:"Create issue type identifier",method:l.POST,url:"/issue-type-identifiers/",payload:v(c),blockers:[c.issue_type],blocks:[c.uuid]});return r.then(m=>{this.dispatch(It(m))}).catch(()=>{this.dispatch(tn(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=sn(e.uuid)(i.getState());if(!a)throw new Error(`Expected issue type identifier with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(It(n));const c=this.enqueueRequest({description:"Update issue type identifier",method:l.PATCH,url:`/issue-type-identifiers/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(It(r))}).catch(()=>{this.dispatch(It(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=sn(e)(a);if(!n)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(tn(e));try{return await this.enqueueRequest({description:"Delete issue type identifier",method:l.DELETE,url:`/issue-type-identifiers/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(en(n)),c}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get issue type identifiers",method:l.GET,url:"/issue-type-identifiers/",queryParams:{issue_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Rh(a)),a}}class oF extends R{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=new Date().toISOString(),c=b({...e,created_by:a,submitted_at:n});this.dispatch(nn(c));const r=this.enqueueRequest({description:"Create issue type identifier value",method:l.POST,url:"/issue-type-identifier-values/",payload:v(c),blockers:[e.issue,e.issue_type_identifier],blocks:[c.uuid]});return r.then(m=>{this.dispatch(gt(m))}).catch(()=>{this.dispatch(cn(c.uuid))}),[c,r]}update(e){const{store:i}=this.client,a=dn(e.uuid)(i.getState());if(!a)throw new Error(`Expected issue type identifier value with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(gt(n));const c=this.enqueueRequest({description:"Update issue type identifier value",method:l.PATCH,url:`/issue-type-identifier-values/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(gt(r))}).catch(()=>{this.dispatch(gt(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=dn(e)(a);if(!n)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(cn(e));try{return await this.enqueueRequest({description:"Delete issue type identifier value",method:l.DELETE,url:`/issue-type-identifier-values/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(nn(n)),c}}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get issue type identifier values",method:l.GET,url:"/issue-type-identifier-values/",queryParams:{limit:V,paginate:!0,issue__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get issue type identifier values",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Vh(n)),n}}class lF extends R{add(e){var r;const{store:i}=this.client,a=i.getState(),n=b({...e,submitted_at:new Date().toISOString(),created_by:(r=a.userReducer.currentUser)==null?void 0:r.id});this.dispatch(Dh(n));const c=this.enqueueRequest({method:l.POST,url:"/issue-types/",payload:v(n),blockers:[],blocks:[n.uuid]});return c.then(u=>{this.dispatch(bt(u))}).catch(()=>{this.dispatch(on(n.uuid))}),[n,c]}update(e){const{store:i}=this.client,a=i.getState(),n=hn(e.uuid)(a);if(!n)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const c={...n,...e};this.dispatch(Ch(c));const r=this.enqueueRequest({method:l.PATCH,url:`/issue-types/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return r.then(u=>{this.dispatch(bt(u))}).catch(()=>{this.dispatch(bt(n))}),[c,r]}delete(e){const{store:i}=this.client,a=i.getState(),n=hn(e)(a);if(!n)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const c=Gl(e)(a);this.dispatch(on(e)),this.dispatch($l(c.map(u=>u.uuid)));const r=this.enqueueRequest({method:l.DELETE,url:`/issue-types/${e}/`,blockers:[e],blocks:[]});return r.catch(()=>{this.dispatch(bt(n)),this.dispatch(Bl(c))}),r}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,method:l.GET,url:"/issue-types/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(Uh(a)),a}}class hF extends R{async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get issue updates",method:l.GET,url:"/issue-updates/",queryParams:{limit:V,paginate:!0,issue__project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get issue updates",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Gh(n)),n}}const mF=1800;function pF(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 yF extends hb{constructor(){super(...arguments);S(this,"_getRenewedTokens",async i=>{const a=this.enqueueRequest({description:"Get renewed tokens",method:l.POST,url:this.refreshTokensUrl,payload:{refresh:i},isAuthNeeded:!1,blockers:[],blocks:[],checkAuth:!1,immediate:!0});let n;try{n=await a}catch(c){console.error("Could not renew tokens; clearing auth",c),this.clearAuth();return}if(!n.access)throw new Error("Missing access token");return{accessToken:n.access,refreshToken:n.refresh??this.getRefreshToken()}})}clearAuth(){console.debug(this.constructor.name,"clearing auth;"),this.dispatch(Ou(!1)),this.clearTokens(),this.dispatch(g()),this.dispatch(g())}async renewTokens(){const i=this.getRefreshToken();if(!i)throw new Error("No refresh token found");console.debug(this.constructor.name,"renewing tokens");try{const a=await this._getRenewedTokens(i);if(!a)return;console.log("Got renewed tokens"),this.setTokens(a)}catch(a){throw console.error("Could not renew tokens; clearing auth",a),this.clearAuth(),a}}tokenIsExpiringSoon(){const i=this.getAccessToken();if(!i)return!1;const a=Date.now()/1e3;let n;try{n=Zp(i).exp??a}catch{n=a}return n-a<mF}getAuthHeader(){return`Bearer ${this.getAccessToken()}`}async prepareAuth(){if(this.tokenIsExpiringSoon()){console.debug(this.constructor.name,"preparing auth");try{await this.renewTokens()}catch(i){return i instanceof D&&this.clearAuth(),i instanceof Error?Promise.reject(i):Promise.reject(new Error((i??et).toString()))}}}async handleUnauthorized(i,a){const n=this.client.store.getState();if(i.url.endsWith("/token/refresh/"))throw n.authReducer.isLoggedIn&&console.warn("No signed-in user to sign out."),this.clearAuth(),new D({message:"You have been signed out due to inactivity.",response:a,discard:!0});if(n.authReducer.isLoggedIn)await this.renewTokens();else throw console.debug("Forbidden; user is not logged in."),new D({message:"Incorrect username or password.",response:a,discard:!0})}async initAuth(i){const a=Xe.v4();return console.debug(this.constructor.name,"Initiating auth"),this.enqueueRequest({uuid:a,description:"Get token pair",method:l.POST,url:this.initTokensUrl,payload:i,isAuthNeeded:!1,checkAuth:!1,immediate:!0,blockers:[],blocks:[]}).then(n=>{this.setTokens(pF(n))})}}class AF extends R{update(e){const{store:i}=this.client,a=Sn(e.uuid)(i.getState()),n={...a,...e};this.dispatch(Zt(n));const c=this.enqueueRequest({description:"Edit organization access",method:l.PATCH,url:`/organization-accesses/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(Zt(r))}).catch(r=>{throw this.dispatch(Zt(a)),r}),[n,c]}async remove(e){const{store:i}=this.client,a=i.getState(),n=Sn(e)(a),c=im(n.user)(a);this.dispatch(rm(n.uuid)),this.dispatch(em(n.user));try{await this.enqueueRequest({description:"Remove organization access",method:l.DELETE,url:`/organization-accesses/${n.uuid}/`,blockers:[n.uuid],blocks:[]})}catch(r){throw this.dispatch(cm(n)),this.dispatch(xh(c)),r}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get organization accesses",method:l.GET,url:"/organization-accesses/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(nm(a)),a}}class fF extends R{async add(e){const i=await this.enqueueRequest({description:"Create organization",method:l.POST,url:"/organizations/",payload:e,blockers:[],blocks:[]});return this.dispatch(hm(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(mm(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(lm(i)),i}}class SF extends R{add(e){var c;const{store:i}=this.client,a=b({...e,created_by:(c=i.getState().userReducer.currentUser)==null?void 0:c.id});this.dispatch(bn(a));const n=this.enqueueRequest({description:"Add project access",method:l.POST,url:"/project-accesses/",payload:v(a),blockers:[a.organization_access,a.project],blocks:[a.uuid]});return n.then(r=>{this.dispatch(Ft(r))}).catch(r=>{throw this.dispatch(Pn(a.uuid)),r}),[a,n]}bulkAdd(e){var r;const{store:i}=this.client,a=(r=i.getState().userReducer.currentUser)==null?void 0:r.id,n=e.map(u=>b({...u,created_by:a}));this.dispatch(Fn(n));const c=this.enqueueRequest({description:"Add project accesses",method:l.POST,url:"/project-accesses/bulk/",payload:{project_accesses:n.map(u=>v(u))},blockers:n.flatMap(u=>[u.project,u.organization_access]),blocks:n.map(u=>u.uuid)});return c.then(u=>{this.dispatch(Pm(u))}).catch(u=>{throw this.dispatch(On(n.map(m=>m.uuid))),u}),[n,c]}update(e){const{store:i}=this.client,a=Rn(e.uuid)(i.getState()),n={...a,...e};this.dispatch(Ft(n));const c=this.enqueueRequest({description:"Edit project access",method:l.PATCH,url:`/project-accesses/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return c.then(r=>{this.dispatch(Ft(r))}).catch(r=>{throw this.dispatch(Ft(a)),r}),[n,c]}async remove(e){const{store:i}=this.client,a=Rn(e)(i.getState());this.dispatch(Pn(e));try{await this.enqueueRequest({description:"Delete project access",method:l.DELETE,url:`/project-accesses/${e}/`,blockers:[e],blocks:[]})}catch(n){throw this.dispatch(bn(a)),n}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get project accesses",method:l.GET,url:"/project-accesses/",queryParams:{project__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Fm(a)),a}}class TF extends We{constructor(){super(...arguments);S(this,"name","Project Attachment");S(this,"url","/project-attachments");S(this,"addAttachments",wm);S(this,"updateAttachments",Vm);S(this,"removeAttachments",wn);S(this,"removeAttachment",jm);S(this,"setAttachment",Mm);S(this,"selectAttachment",Um)}buildOfflineAttachment(i){return b({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,project:i.modelUuid})}buildAttachmentPayload(i){return{...i,project:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.projectUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const n=await this.enqueueRequest({immediate:!0,description:"Get project attachments",method:l.GET,url:`${this.url}/`,queryParams:{project__organization:i},blockers:[],blocks:[]},a);return this.dispatch(vm(n)),n}}class IF extends R{async saveExisting(e){if(!e.uuid)throw new Error("You can only use this method to save existing project files. The one provided has no uuid.");const i={...e};delete i.file;const a=this.enqueueRequest({method:l.PATCH,url:`/project-files/${e.uuid}/`,payload:i,blockers:[e.uuid],blocks:[e.uuid]});return a.then(n=>{this.dispatch(En(n))}),a}saveActive(){const{store:e}=this.client,i=e.getState(),a=i.projectFileReducer.activeProjectFileId;if(!a)throw new Error("No active project file");const n=i.projectFileReducer.instances[a];if(!n)throw new Error("No active project file");if(!n.bounds&&!n.canvas_bounds)throw new Error("Project file must either have bounds or canvas_bounds set");let c;if(typeof n.file=="string"&&!n.file.startsWith("blob:")){const m={...n};delete m.file,c={method:l.PATCH,url:`/project-files/${a}/`,payload:m,blockers:[a],blocks:[a]}}else c=new Promise((m,o)=>{this.client.files.uploadFileToS3(n.file_sha1).then(([h])=>{m({method:l.POST,url:"/project-files/",payload:{...n,...h},blockers:[a],blocks:[a]})}).catch(o)});const u=Promise.resolve(c).then(m=>this.enqueueRequest(m));return u.then(m=>{this.dispatch(En(m))}),this.dispatch(Wm),this.dispatch(Hm(null)),this.dispatch(Nm(!1)),[n,u]}delete(e){return this.dispatch(Gm(e)),this.enqueueRequest({method:l.DELETE,url:`/project-files/${e}`,blockers:[e],blocks:[]})}async refreshStore(e,i){const n=(await this.performPagination({immediate:!0,description:"Get project files",method:l.GET,url:"/project-files/",queryParams:{limit:V,paginate:!0,project:e},blockers:[],blocks:[]},c=>({immediate:!0,description:"Get project files",method:l.GET,url:c,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Bm(n)),n}}class gF extends R{async add(e){const i=await this.enqueueRequest({description:"Create project",method:l.POST,url:"/projects/",payload:v(e),blockers:[],blocks:[]});return this.dispatch(jn(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(Qm(e)),await this.enqueueRequest({description:"Update project",method:l.PATCH,url:`/projects/${e.uuid}/`,payload:{name:e.name,bounds:e.bounds},blockers:[e.uuid],blocks:[e.uuid]})}async delete(e){const{store:i}=this.client,a=i.getState(),n=tp(e)(a);if(!n)throw new Error("Expected project to exist");const c=Ym(a).filter(m=>m.project===e);this.dispatch(Lm(c.map(({uuid:m})=>m)));const r=Dm(n.uuid)(a);this.dispatch(wn(r.map(({uuid:m})=>m)));const u=_m(e)(a);this.dispatch(On(u.map(({uuid:m})=>m))),this.dispatch(qn(n.uuid));try{await this.enqueueRequest({description:"Delete project",method:l.DELETE,url:`/projects/${e}/`,blockers:[e],blocks:[]}),this.dispatch(qn(n.uuid))}catch(m){throw this.dispatch(jn(n)),this.dispatch(Fn(Object.values(u))),this.dispatch($m(c)),this.dispatch(Em(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(Xm(a)),a}}class bF extends R{add(e){var c;const{store:i}=this.client,a=b({...e,created_by:(c=i.getState().userReducer.currentUser)==null?void 0:c.id});this.dispatch(np(a));const n=this.enqueueRequest({description:"Create team membership",method:l.POST,url:"/team-memberships/",payload:v(a),blockers:[e.team],blocks:[a.uuid]});return n.then(r=>{this.dispatch(Cn(r))}).catch(()=>{this.dispatch(kn(a.uuid))}),[a,n]}bulkAdd(e){var r;const{store:i}=this.client,a=(r=i.getState().userReducer.currentUser)==null?void 0:r.id,n=e.map(u=>b({...u,created_by:a}));this.dispatch(cp(n));const c=this.enqueueRequest({description:"Create team memberships",method:l.POST,url:"/team-memberships/bulk/",payload:{team_memberships:n.map(u=>v(u))},blockers:n.map(u=>u.team),blocks:n.map(u=>u.uuid)});return c.then(u=>{this.dispatch(rp(u))}).catch(()=>{this.dispatch(dp(n.map(u=>u.uuid)))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=lp(e)(a);if(!n)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(kn(e));try{return await this.enqueueRequest({description:"Delete team membership",method:l.DELETE,url:`/team-memberships/${e}/`,blockers:[e],blocks:[e]})}catch(c){throw this.dispatch(Cn(n)),c}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch team memberships",method:l.GET,url:"/team-memberships/",queryParams:{team__organization:e},blockers:[],blocks:[]},i);return this.dispatch(ap(a)),a}}class FF extends R{add(e){var c;const{store:i}=this.client,a=b({...e,submitted_at:new Date().toISOString(),created_by:(c=i.getState().userReducer.currentUser)==null?void 0:c.id});this.dispatch(pp(a));const n=this.enqueueRequest({description:"Create team",method:l.POST,url:"/teams/",payload:v(a),blockers:[],blocks:[a.uuid]});return n.then(r=>{this.dispatch(Pt(r))}).catch(()=>{this.dispatch(Gn(a.uuid))}),[a,n]}update(e){const{store:i}=this.client,a=Nn(e.uuid)(i.getState());if(!a)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const n={...a,...e};this.dispatch(yp(n));const c=this.enqueueRequest({description:"Update team",method:l.PATCH,url:`/teams/${e.uuid}/`,payload:v(e),blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(Pt(r))}).catch(()=>{this.dispatch(Pt(a))}),[n,c]}async delete(e){const{store:i}=this.client,a=i.getState(),n=Nn(e)(a);if(!n)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(Gn(e));try{return await this.enqueueRequest({description:"Delete team",method:l.DELETE,url:`/teams/${e}/`,blockers:[e],blocks:[e]})}catch(c){throw this.dispatch(Pt(n)),c}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch teams",method:l.GET,url:"/teams/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(mp(a)),a}}class PF extends R{async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization users",method:l.GET,url:`/organizations/${e}/users/`,blockers:[],blocks:[]},i);return this.dispatch(Qh(a)),a}}class OF{constructor(e){S(this,"store");this.store=e}async enqueueRequest(e,i,a,n){return this._enqueueRequest(e,i,a,n).then(c=>{if(c instanceof D)throw c;return c})}_enqueueRequest(e,i,a,n){const c=new cc,r={...e,BASE_URL:i,serviceName:a};if(e.immediate){const u={...r,uuid:e.uuid??Xe.v4()},m={payload:u,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:u,BASE_URL:i,serviceName:a}}}};Wn(m,this,n).then(o=>{c.resolve(o.body)}).catch(o=>{Kn(o,m),o instanceof Error?c.reject(o):c.reject(new Error((o??et).toString()))})}else{const u=this.store.dispatch(Sm(r)),m=h=>{if(h)c.resolve(h.body);else{const p=new D({message:"Could not get a response from the server.",response:h,discard:!0});c.reject(p)}},o=h=>{h instanceof D?h.options.discard=!0:(console.error("Received an unexpected error while processing a request:",h,`
|
|
15
|
-
Converting error to APIError and discarding.`),h=new D({message:"An error occurred while processing the request.",innerError:h,discard:!0})),c.reject(h)};u.then(m,o)}return c}}class tt{constructor(){S(this,"graph");S(this,"requestAttemptCounter");this.graph=new Jp.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(e){const i=new tt;for(let a=0;a<e.length;a++){const n=e[a];if(!n){console.error("Outbox item was undefined");continue}i.sneakRequest(n);for(let c=0;c<a;c++){const r=e[c];if(!r){console.error("Previous outbox item was undefined");continue}r.payload.uuid!==n.payload.uuid&&r.payload.blocks.some(u=>n.payload.blockers.includes(u))&&tt._addDependency(n.payload.uuid,r.payload.uuid,i.graph)}}return i}_addDependency(e,i){tt._addDependency(e,i,this.graph)}static _addDependency(e,i,a){if(e===i)throw new Error(`Tried to add dependency from node to itself: ${e}`);if(!a.hasNode(e))throw new Error(`Tried to add dependency from non-existent node: ${e} (to node: ${i})`);if(!a.hasNode(i))throw new Error(`Tried to add dependency to non-existent node: ${i} (from node: ${e})`);a.addDependency(e,i)}addRequest(e){if(this.graph.addNode(e.payload.uuid,e),!(e.payload.blockers.length===0||this.graph.size()===1))for(const i of this.graph.overallOrder()){if(i===e.payload.uuid)continue;const a=this.graph.getNodeData(i);e.payload.blockers.some(n=>a.payload.blocks.includes(n))&&this._addDependency(e.payload.uuid,i)}}insertRequest(e){this.graph.addNode(e.payload.uuid,e);for(const i of this.graph.overallOrder()){if(i===e.payload.uuid)continue;this.graph.getNodeData(i).payload.blockers.some(n=>e.payload.blocks.includes(n))&&this._addDependency(i,e.payload.uuid)}}sneakRequest(e){this.graph.addNode(e.payload.uuid,e)}_getNextNode(){const e=this.graph.overallOrder(!0);let i=1/0,a;for(const n of e){const c=this.requestAttemptCounter[n]||0;c<i&&(i=c,a=n)}return a}peek(){const e=this._getNextNode();if(e)return this.graph.getNodeData(e)}remove(e){this.graph.removeNode(e),delete this.requestAttemptCounter[e]}pop(){const e=this.peek();return e&&this.graph.removeNode(e.payload.uuid),e}getQueue(){const e=this.graph.overallOrder().map(a=>this.graph.getNodeData(a)),i=this._getNextNode();if(i){const a=this.graph.getNodeData(i),n=e.findIndex(c=>c.payload.uuid===a.payload.uuid);n!==-1&&(e.splice(n,1),e.unshift(a))}return e}getReady(){let e=this.graph.overallOrder(!0).map(i=>this.graph.getNodeData(i));return e=e.sort((i,a)=>i.meta.offline.effect.timestamp.localeCompare(a.meta.offline.effect.timestamp)),e=e.sort((i,a)=>{const n=this.requestAttemptCounter[i.payload.uuid]||0,c=this.requestAttemptCounter[a.payload.uuid]||0;return n-c}),e}registerRetry(e){this.requestAttemptCounter[e]=(this.requestAttemptCounter[e]||0)+1}}let Ep;function Vp(t){Ep=t}function st(){return Ep}let jp;function qp(t){jp=t}function zp(){return jp}let Xn=null;function Ze(){const t=st();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(Xn)return Xn;const e=t.getState().offline.outbox,i=tt._fromOutbox(e);return Xn=i,i}const _F=(t,e)=>{const i=new e(t);return qp(i),Vp(t),i};class RF{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 Qn{constructor(){S(this,"next");this.next=null}then(e){return new RF(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 Wn(e,a)}}}class Up extends Qn{async run(e){return super.run(e)}}class Dp extends Qn{async run(e){return super.run(e)}}const Cp=new Up().then(new Dp).compile();function kp(t){var e;return(e=Cp[0])==null?void 0:e.run(t)}var Bp=(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))(Bp||{});s.ALL_MIDDLEWARE=Cp,s.APIError=D,s.ATTACHMENT_PAGINATION_PAGE_SIZE=He,s.AgentService=mb,s.AssetAttachmentService=pb,s.AssetProcedureService=Ib,s.AssetProcedureStepFieldValuesAttachmentService=Pb,s.AssetProcedureStepFieldValuesService=Ob,s.AssetProcedureStepFieldsAttachmentService=bb,s.AssetProcedureStepFieldsService=Fb,s.AssetProcedureStepService=_b,s.AssetProcedureTypeAttachmentService=yb,s.AssetProcedureTypeFieldValuesAttachmentService=Sb,s.AssetProcedureTypeFieldValuesService=Tb,s.AssetProcedureTypeFieldsAttachmentService=Ab,s.AssetProcedureTypeFieldsService=fb,s.AssetProcedureTypeService=gb,s.AssetService=Rb,s.AssetStageCompletionService=vb,s.AssetStageService=wb,s.AssetTypeAttachmentService=Mb,s.AssetTypeFieldValuesAttachmentService=jb,s.AssetTypeFieldValuesService=qb,s.AssetTypeFieldsAttachmentService=Eb,s.AssetTypeFieldsService=Vb,s.AssetTypeIdentifierService=zb,s.AssetTypeIdentifierValueService=Ub,s.AssetTypeService=Db,s.AttachmentModel=ac,s.BaseApiService=R,s.BaseSDK=OF,s.COMMON_AUTO_FIELDS=lc,s.CategoryService=Cb,s.DEFAULT_ISSUE_PRIORITY=Qp,s.DEFAULT_ISSUE_STATUS=Xp,s.DEFAULT_PAGINATION_PAGE_SIZE=V,s.DeferredPromise=cc,s.DocumentAttachmentService=kb,s.DocumentService=Bb,s.EMPTY_ARRAY=tc,s.EMPTY_OBJECT=sc,s.EmailDomainsService=$b,s.EmailVerificationService=Gb,s.FileService=Nb,s.FormIdentifierService=Hb,s.FormIdentifierValueService=Wb,s.FormRevisionAttachmentService=Kb,s.FormRevisionService=Yb,s.FormService=Zb,s.FormSubmissionAttachmentService=Jb,s.FormSubmissionService=Xb,s.GeoImageService=Qb,s.HttpMethod=l,s.IssueAssociationService=xb,s.IssueAttachmentService=eF,s.IssueCommentAttachmentService=tF,s.IssueCommentService=sF,s.IssuePriority=xt,s.IssueService=iF,s.IssueStatus=es,s.IssueTypeAttachmentService=aF,s.IssueTypeFieldValuesAttachmentService=rF,s.IssueTypeFieldValuesService=dF,s.IssueTypeFieldsAttachmentService=nF,s.IssueTypeFieldsService=cF,s.IssueTypeIdentifierService=uF,s.IssueTypeIdentifierValueService=oF,s.IssueTypeService=lF,s.IssueUpdateChange=E,s.IssueUpdateService=hF,s.JWTService=yF,s.OUTBOX_RETRY_DELAY=nc,s.OfflineAnalyticsMiddleware=Up,s.OfflineMiddleware=Qn,s.OrganizationAccessLevel=ic,s.OrganizationAccessService=AF,s.OrganizationService=fF,s.OutboxCoordinator=tt,s.ProjectAccessService=SF,s.ProjectAttachmentService=TF,s.ProjectFileService=IF,s.ProjectService=gF,s.RESET_ORGANIZATION_STATE=O,s.RESET_PROJECT_STATE=M,s.RESET_STATE=g,s.RateLimitingMiddleware=Dp,s.SelectorBuilder=Qg,s.TeamMembershipService=bF,s.TeamService=FF,s.UNKNOWN_ERROR_MESSAGE=et,s.UserService=PF,s.VERSION_REDUCER_KEY=it,s.VerificationCodeType=Bp,s._setLatestRetryTime=Im,s.addAsset=Ys,s.addAssetAttachment=Ry,s.addAssetAttachments=us,s.addAssetProcedure=Fs,s.addAssetProcedureStep=sd,s.addAssetProcedureStepFieldValues=Gs,s.addAssetProcedureStepFieldValuesAttachment=jA,s.addAssetProcedureStepFieldValuesAttachments=wt,s.addAssetProcedureStepFieldValuesMany=Yr,s.addAssetProcedureStepFields=zs,s.addAssetProcedureStepFieldsAttachment=fA,s.addAssetProcedureStepFieldsAttachments=Mr,s.addAssetProcedureStepFieldsMany=PA,s.addAssetProcedureSteps=id,s.addAssetProcedureType=ws,s.addAssetProcedureTypeAttachment=My,s.addAssetProcedureTypeAttachments=qc,s.addAssetProcedureTypeFieldValues=Ss,s.addAssetProcedureTypeFieldValuesAttachment=Zy,s.addAssetProcedureTypeFieldValuesAttachments=Rt,s.addAssetProcedureTypeFieldValuesMany=mr,s.addAssetProcedureTypeFields=xc,s.addAssetProcedureTypeFieldsAttachment=qy,s.addAssetProcedureTypeFieldsAttachments=Hc,s.addAssetProcedureTypeFieldsMany=$y,s.addAssetProcedureTypes=oA,s.addAssetProcedures=Ir,s.addAssetStage=ri,s.addAssetStageCompletion=ti,s.addAssetStageCompletions=si,s.addAssetStages=af,s.addAssetType=Vi,s.addAssetTypeAttachment=of,s.addAssetTypeAttachments=li,s.addAssetTypeFieldValues=Si,s.addAssetTypeFieldValuesAttachment=vf,s.addAssetTypeFieldValuesAttachments=Dt,s.addAssetTypeFieldValuesMany=cu,s.addAssetTypeFields=Wd,s.addAssetTypeFieldsAttachment=mf,s.addAssetTypeFieldsAttachments=Cd,s.addAssetTypeFieldsMany=If,s.addAssetTypeIdentifier=Fi,s.addAssetTypeIdentifierValue=Ri,s.addAssetTypeIdentifierValues=Nf,s.addAssetTypeIdentifiers=Cf,s.addAssetTypes=xf,s.addAssets=jt,s.addCategories=dS,s.addCategory=Di,s.addConversation=Tc,s.addConversations=Iy,s.addDocumentAttachment=yS,s.addDocumentAttachments=zu,s.addDocuments=Wu,s.addEmailDomain=Xu,s.addEmailDomains=bS,s.addForm=da,s.addFormIdentifier=Ki,s.addFormIdentifierValue=Xi,s.addFormIdentifierValues=US,s.addFormIdentifiers=MS,s.addFormRevision=ia,s.addFormRevisionAttachment=LS,s.addFormRevisionAttachments=To,s.addFormRevisions=_o,s.addFormSubmission=ma,s.addFormSubmissionAttachment=rT,s.addFormSubmissionAttachments=$t,s.addFormSubmissions=Wo,s.addForms=eT,s.addGeoImage=el,s.addGeoImages=tl,s.addIssue=Da,s.addIssueAssociation=ga,s.addIssueAssociations=ba,s.addIssueAttachment=gT,s.addIssueAttachments=Ra,s.addIssueComment=Va,s.addIssueCommentAttachment=PT,s.addIssueCommentAttachments=Ol,s.addIssueComments=wT,s.addIssueType=Dh,s.addIssueTypeAttachment=kT,s.addIssueTypeAttachments=Hl,s.addIssueTypeFieldValues=Wa,s.addIssueTypeFieldValuesAttachment=lI,s.addIssueTypeFieldValuesAttachments=Wt,s.addIssueTypeFieldValuesMany=JT,s.addIssueTypeFields=ph,s.addIssueTypeFieldsAttachment=LT,s.addIssueTypeFieldsAttachments=sh,s.addIssueTypeFieldsMany=sI,s.addIssueTypeIdentifier=en,s.addIssueTypeIdentifierValue=nn,s.addIssueTypeIdentifierValues=FI,s.addIssueTypeIdentifiers=fI,s.addIssueTypes=MI,s.addIssueUpdate=Lh,s.addIssueUpdates=Nh,s.addIssues=Bl,s.addOrganization=hm,s.addOrganizationAccess=cm,s.addOrganizationAccesses=JI,s.addOrganizations=ng,s.addProject=jn,s.addProjectAccess=bn,s.addProjectAccesses=Fn,s.addProjectAttachment=Sg,s.addProjectAttachments=wm,s.addProjectFile=bg,s.addProjectFiles=$m,s.addProjects=Mg,s.addTeam=pp,s.addTeamMembership=np,s.addTeamMemberships=cp,s.addTeams=Gg,s.addUser=xh,s.addUsers=LI,s.agentsReducer=bc,s.agentsSlice=ns,s.areArraysEqual=ty,s.assetAttachmentReducer=Ec,s.assetAttachmentSlice=rs,s.assetProcedureReducer=br,s.assetProcedureSlice=bs,s.assetProcedureStepFieldValuesAttachmentReducer=Hr,s.assetProcedureStepFieldValuesAttachmentSlice=ks,s.assetProcedureStepFieldValuesReducer=Qr,s.assetProcedureStepFieldValuesSlice=$s,s.assetProcedureStepFieldsAttachmentReducer=zr,s.assetProcedureStepFieldsAttachmentSlice=js,s.assetProcedureStepFieldsReducer=Cr,s.assetProcedureStepFieldsSlice=qs,s.assetProcedureStepReducer=cd,s.assetProcedureStepSlice=Hs,s.assetProcedureTypeAttachmentReducer=kc,s.assetProcedureTypeAttachmentSlice=ls,s.assetProcedureTypeFieldValuesAttachmentReducer=rr,s.assetProcedureTypeFieldValuesAttachmentSlice=ys,s.assetProcedureTypeFieldValuesReducer=Ar,s.assetProcedureTypeFieldValuesSlice=fs,s.assetProcedureTypeFieldsAttachmentReducer=Yc,s.assetProcedureTypeFieldsAttachmentSlice=hs,s.assetProcedureTypeFieldsReducer=sr,s.assetProcedureTypeFieldsSlice=ms,s.assetProcedureTypeReducer=_r,s.assetProcedureTypeSlice=vs,s.assetReducer=md,s.assetSlice=Ks,s.assetStageCompletionReducer=Sd,s.assetStageCompletionSlice=ei,s.assetStageReducer=Pd,s.assetStageSlice=ci,s.assetTypeAttachmentReducer=zd,s.assetTypeAttachmentSlice=oi,s.assetTypeFieldValuesAttachmentReducer=iu,s.assetTypeFieldValuesAttachmentSlice=yi,s.assetTypeFieldValuesReducer=ou,s.assetTypeFieldValuesSlice=fi,s.assetTypeFieldsAttachmentReducer=Ld,s.assetTypeFieldsAttachmentSlice=mi,s.assetTypeFieldsReducer=Jd,s.assetTypeFieldsSlice=pi,s.assetTypeIdentifierReducer=yu,s.assetTypeIdentifierSlice=bi,s.assetTypeIdentifierValueReducer=Tu,s.assetTypeIdentifierValueSlice=_i,s.assetTypeReducer=Fu,s.assetTypeSlice=Ei,s.authReducer=_u,s.authSlice=kt,s.baseReducer=Zg,s.baseReducers=Hn,s.blobToBase64=oy,s.categoryReducer=Vu,s.categorySlice=Ui,s.clearTokens=nS,s.constructUploadedFilePayloads=uy,s.createModelAdapter=P,s.createOfflineAction=Am,s.createPayload=v,s.createSelectionAdapter=xp,s.deleteAsset=Zs,s.deleteAssetAttachment=_c,s.deleteAssetAttachments=os,s.deleteAssetProcedure=Ps,s.deleteAssetProcedureStep=ad,s.deleteAssetProcedureStepFieldValues=Ls,s.deleteAssetProcedureStepFieldValuesAttachment=DA,s.deleteAssetProcedureStepFieldValuesAttachments=Mt,s.deleteAssetProcedureStepFieldValuesMany=Jr,s.deleteAssetProcedureStepFields=Us,s.deleteAssetProcedureStepFieldsAttachment=gA,s.deleteAssetProcedureStepFieldsAttachments=Vr,s.deleteAssetProcedureStepFieldsMany=vA,s.deleteAssetProcedureSteps=nd,s.deleteAssetProcedureType=Ms,s.deleteAssetProcedureTypeAttachment=Dc,s.deleteAssetProcedureTypeAttachments=Cc,s.deleteAssetProcedureTypeFieldValues=Ts,s.deleteAssetProcedureTypeFieldValuesAttachment=xy,s.deleteAssetProcedureTypeFieldValuesAttachments=vt,s.deleteAssetProcedureTypeFieldValuesMany=yr,s.deleteAssetProcedureTypeFields=tr,s.deleteAssetProcedureTypeFieldsAttachment=Cy,s.deleteAssetProcedureTypeFieldsAttachments=Kc,s.deleteAssetProcedureTypeFieldsMany=Hy,s.deleteAssetProcedureTypes=hA,s.deleteAssetProcedures=gr,s.deleteAssetStage=di,s.deleteAssetStageCompletion=ii,s.deleteAssetStageCompletions=ai,s.deleteAssetStages=cf,s.deleteAssetType=ji,s.deleteAssetTypeAttachment=Md,s.deleteAssetTypeAttachments=hi,s.deleteAssetTypeFieldValues=Ti,s.deleteAssetTypeFieldValuesAttachment=Vf,s.deleteAssetTypeFieldValuesAttachments=Ct,s.deleteAssetTypeFieldValuesMany=du,s.deleteAssetTypeFields=Yd,s.deleteAssetTypeFieldsAttachment=ff,s.deleteAssetTypeFieldsAttachments=Bd,s.deleteAssetTypeFieldsMany=Pf,s.deleteAssetTypeIdentifier=Pi,s.deleteAssetTypeIdentifierValue=vi,s.deleteAssetTypeIdentifierValues=Yf,s.deleteAssetTypeIdentifiers=Gf,s.deleteAssetTypes=tS,s.deleteAssets=Js,s.deleteCategories=hS,s.deleteCategory=Mu,s.deleteConversation=Fy,s.deleteConversations=Py,s.deleteDocumentAttachment=Cu,s.deleteDocumentAttachments=ku,s.deleteEmailDomain=Qu,s.deleteEmailDomains=RS,s.deleteForm=ua,s.deleteFormIdentifier=Yi,s.deleteFormIdentifierValue=Qi,s.deleteFormIdentifierValues=BS,s.deleteFormIdentifiers=qS,s.deleteFormRevision=aa,s.deleteFormRevisionAttachment=KS,s.deleteFormRevisionAttachments=go,s.deleteFormRevisions=vo,s.deleteFormSubmission=pa,s.deleteFormSubmissionAttachment=lT,s.deleteFormSubmissionAttachments=Gt,s.deleteFormSubmissions=Yo,s.deleteForms=nT,s.deleteGeoImage=Sa,s.deleteGeoImages=il,s.deleteIssue=Ca,s.deleteIssueAssociation=Fa,s.deleteIssueAssociations=Pa,s.deleteIssueAttachment=Sl,s.deleteIssueAttachments=va,s.deleteIssueComment=qa,s.deleteIssueCommentAttachment=vl,s.deleteIssueCommentAttachments=wl,s.deleteIssueComments=VT,s.deleteIssueType=jI,s.deleteIssueTypeAttachment=Yl,s.deleteIssueTypeAttachments=Zl,s.deleteIssueTypeFieldValues=Ka,s.deleteIssueTypeFieldValuesAttachment=yI,s.deleteIssueTypeFieldValuesAttachments=Kt,s.deleteIssueTypeFieldValuesMany=eI,s.deleteIssueTypeFields=Ah,s.deleteIssueTypeFieldsAttachment=KT,s.deleteIssueTypeFieldsAttachments=ah,s.deleteIssueTypeFieldsMany=cI,s.deleteIssueTypeIdentifier=tn,s.deleteIssueTypeIdentifierValue=cn,s.deleteIssueTypeIdentifierValues=RI,s.deleteIssueTypeIdentifiers=gI,s.deleteIssueTypes=qI,s.deleteIssueUpdate=Hh,s.deleteIssueUpdates=Wh,s.deleteIssues=$l,s.deleteOrganization=rg,s.deleteOrganizationAccess=rm,s.deleteOrganizationAccesses=eg,s.deleteOrganizations=dg,s.deleteProject=qn,s.deleteProjectAccess=Pn,s.deleteProjectAccesses=On,s.deleteProjectAttachment=jm,s.deleteProjectAttachments=wn,s.deleteProjectFile=Gm,s.deleteProjectFiles=Lm,s.deleteProjects=Vg,s.deleteTeam=Gn,s.deleteTeamMembership=kn,s.deleteTeamMemberships=dp,s.deleteTeams=Hg,s.deleteUser=em,s.deleteUsers=WI,s.dequeue=vp,s.discard=Kn,s.documentAttachmentReducer=Lu,s.documentAttachmentSlice=Bi,s.documentSlice=$i,s.documentsReducer=Yu,s.downloadFile=ly,s.downloadInMemoryFile=dy,s.emailDomainsReducer=to,s.emailDomainsSlice=Ni,s.emailRegex=Sy,s.enqueue=Rp,s.enqueueRequest=Sm,s.fallbackToEmptyArray=T,s.fallbackToEmptyObject=_t,s.fileReducer=co,s.fileSlice=Hi,s.fileToBlob=uc,s.formIdentifierReducer=ho,s.formIdentifierSlice=Wi,s.formIdentifierValueReducer=Ao,s.formIdentifierValueSlice=Ji,s.formReducer=jo,s.formRevisionAttachmentReducer=Fo,s.formRevisionAttachmentSlice=ta,s.formRevisionReducer=Mo,s.formRevisionsSlice=sa,s.formSlice=ra,s.formSubmissionAttachmentReducer=Lo,s.formSubmissionAttachmentSlice=oa,s.formSubmissionReducer=Jo,s.formSubmissionSlice=ha,s.geoImageReducer=cl,s.geoImageSlice=fa,s.getAssetProcedureStepSubTree=Ac,s.getAssetProcedureStepTrees=Ty,s.getClientSDK=zp,s.getClientStore=st,s.getFileIdentifier=ry,s.getFileS3Key=as,s.getLocalDateString=rc,s.getLocalRelativeDateString=ny,s.getOutboxCoordinator=Ze,s.getRenamedFile=dc,s.hashFile=Qe,s.initSDK=_F,s.initializeAssetAttachments=ds,s.initializeAssetProcedureStepFieldValues=Kr,s.initializeAssetProcedureStepFieldValuesAttachments=Br,s.initializeAssetProcedureStepFields=Dr,s.initializeAssetProcedureStepFieldsAttachments=wr,s.initializeAssetProcedureSteps=ed,s.initializeAssetProcedureTypeAttachments=jc,s.initializeAssetProcedureTypeFieldValues=hr,s.initializeAssetProcedureTypeFieldValuesAttachments=nr,s.initializeAssetProcedureTypeFields=Qc,s.initializeAssetProcedureTypeFieldsAttachments=Nc,s.initializeAssetProcedureTypes=Or,s.initializeAssetProcedures=Tr,s.initializeAssetStageCompletions=yd,s.initializeAssetStages=bd,s.initializeAssetTypeAttachments=Rd,s.initializeAssetTypeFieldValues=nu,s.initializeAssetTypeFieldValuesAttachments=Qd,s.initializeAssetTypeFields=Hd,s.initializeAssetTypeFieldsAttachments=Dd,s.initializeAssetTypeIdentifierValues=fu,s.initializeAssetTypeIdentifiers=hu,s.initializeAssetTypes=gu,s.initializeAssets=od,s.initializeCategories=vu,s.initializeConversations=Sc,s.initializeDocumentAttachments=qu,s.initializeEmailDomains=Ju,s.initializeFormIdentifierValues=po,s.initializeFormIdentifiers=uo,s.initializeFormRevisionAttachments=So,s.initializeFormRevisions=Oo,s.initializeFormSubmissionAttachments=Co,s.initializeFormSubmissions=Ho,s.initializeForms=Vo,s.initializeGeoImages=Qo,s.initializeIssueAssociations=dl,s.initializeIssueAttachments=_a,s.initializeIssueCommentAttachments=Ma,s.initializeIssueComments=vT,s.initializeIssueTypeAttachments=La,s.initializeIssueTypeFieldValues=uh,s.initializeIssueTypeFieldValuesAttachments=Ih,s.initializeIssueTypeFields=mh,s.initializeIssueTypeFieldsAttachments=th,s.initializeIssueTypeIdentifierValues=Vh,s.initializeIssueTypeIdentifiers=Rh,s.initializeIssueTypes=Uh,s.initializeIssueUpdates=Gh,s.initializeIssues=kl,s.initializeOrganizationAccesses=nm,s.initializeOrganizations=lm,s.initializeProjectAccesses=Fm,s.initializeProjectAttachments=vm,s.initializeProjectFiles=Bm,s.initializeProjects=Xm,s.initializeTeamMemberships=ap,s.initializeTeams=mp,s.initializeUsers=Qh,s.isToday=ay,s.issueAssociationReducer=pl,s.issueAssociationSlice=Ia,s.issueAttachmentReducer=Fl,s.issueAttachmentSlice=Oa,s.issueCommentAttachmentReducer=jl,s.issueCommentAttachmentSlice=wa,s.issueCommentReducer=Dl,s.issueCommentSlice=Ea,s.issueReducer=Ll,s.issueSlice=Ua,s.issueTypeAttachmentReducer=xl,s.issueTypeAttachmentSlice=Ga,s.issueTypeFieldValuesAttachmentReducer=Oh,s.issueTypeFieldValuesAttachmentSlice=Xa,s.issueTypeFieldValuesReducer=lh,s.issueTypeFieldValuesSlice=Ha,s.issueTypeFieldsAttachmentReducer=rh,s.issueTypeFieldsAttachmentSlice=Na,s.issueTypeFieldsReducer=Sh,s.issueTypeFieldsSlice=Ja,s.issueTypeIdentifierReducer=Mh,s.issueTypeIdentifierSlice=xa,s.issueTypeIdentifierValueReducer=qh,s.issueTypeIdentifierValueSlice=an,s.issueTypeReducer=Bh,s.issueTypeSlice=un,s.issueUpdateReducer=Jh,s.issueUpdateSlice=mn,s.logOnlyOnce=hy,s.markAsDeleted=Tm,s.markForDeletion=mg,s.memoize=ss,s.onlyUniqueHashes=fy,s.onlyUniqueOfflineIds=pc,s.organizationAccessReducer=dm,s.organizationAccessSlice=An,s.organizationReducer=ym,s.organizationSlice=Tn,s.outboxReducer=gm,s.outboxSlice=In,s.overmapEnhancer=cb,s.overmapReducer=Jg,s.overmapReducers=Ip,s.performRequest=Wn,s.projectAccessReducer=Om,s.projectAccessSlice=gn,s.projectAttachmentReducer=Cm,s.projectAttachmentSlice=vn,s.projectFileReducer=Zm,s.projectFileSlice=Mn,s.projectReducer=xm,s.projectSlice=Vn,s.rehydratedReducer=sp,s.rehydratedSlice=Un,s.removeDocuments=Gi,s.removeIssueType=on,s.resetProjectFileObjectUrls=Pg,s.restructureCreateSelectorWithArgs=f,s.runMiddleware=kp,s.saveActiveProjectFileBounds=Wm,s.selectAccessToken=cS,s.selectAccessesByUserOfProject=Ag,s.selectAccessibleProjects=jg,s.selectActiveOrganizationAccess=tg,s.selectActiveProjectFileId=_g,s.selectAllDocumentAttachments=$u,s.selectAllProjectAttachments=zm,s.selectAssetAttachmentById=wc,s.selectAssetAttachmentMapping=Rc,s.selectAssetAttachments=vc,s.selectAssetById=xs,s.selectAssetProcedureById=Rs,s.selectAssetProcedureStepById=Ws,s.selectAssetProcedureStepFieldValues=Et,s.selectAssetProcedureStepFieldValuesAttachmentById=CA,s.selectAssetProcedureStepFieldValuesAttachments=Gr,s.selectAssetProcedureStepFieldValuesAttachmentsByIds=Lr,s.selectAssetProcedureStepFieldValuesAttachmentsMapping=Bs,s.selectAssetProcedureStepFieldValuesById=Ns,s.selectAssetProcedureStepFieldValuesMapping=Xr,s.selectAssetProcedureStepFieldValuesOfAsset=$A,s.selectAssetProcedureStepFieldValuesOfAssetProcedure=GA,s.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=LA,s.selectAssetProcedureStepFields=Cs,s.selectAssetProcedureStepFieldsAttachmentById=FA,s.selectAssetProcedureStepFieldsAttachments=qr,s.selectAssetProcedureStepFieldsAttachmentsMapping=jr,s.selectAssetProcedureStepFieldsById=VA,s.selectAssetProcedureStepFieldsMapping=Ds,s.selectAssetProcedureStepFieldsOfAssetProcedureStep=wA,s.selectAssetProcedureStepMapping=ut,s.selectAssetProcedureSteps=rd,s.selectAssetProcedureStepsByIds=YA,s.selectAssetProcedureStepsMappingOfAssetProcedureType=WA,s.selectAssetProcedureStepsOfAssetProcedureType=KA,s.selectAssetProcedureTypeAttachmentById=Gc,s.selectAssetProcedureTypeAttachmentMapping=Bc,s.selectAssetProcedureTypeAttachments=$c,s.selectAssetProcedureTypeById=Vs,s.selectAssetProcedureTypeFieldValues=Is,s.selectAssetProcedureTypeFieldValuesAttachmentById=eA,s.selectAssetProcedureTypeFieldValuesAttachments=dr,s.selectAssetProcedureTypeFieldValuesAttachmentsByIds=ur,s.selectAssetProcedureTypeFieldValuesAttachmentsMapping=As,s.selectAssetProcedureTypeFieldValuesById=gs,s.selectAssetProcedureTypeFieldValuesMapping=fr,s.selectAssetProcedureTypeFieldValuesOfAsset=iA,s.selectAssetProcedureTypeFields=ps,s.selectAssetProcedureTypeFieldsAttachmentById=By,s.selectAssetProcedureTypeFieldsAttachments=Jc,s.selectAssetProcedureTypeFieldsAttachmentsMapping=Zc,s.selectAssetProcedureTypeFieldsById=Yy,s.selectAssetProcedureTypeFieldsMapping=ir,s.selectAssetProcedureTypeFieldsOfAssetProcedureType=Wy,s.selectAssetProcedureTypes=Rr,s.selectAssetProcedureTypesByIds=yA,s.selectAssetProcedureTypesMapping=Es,s.selectAssetProcedureTypesOfOrganization=AA,s.selectAssetProcedures=_s,s.selectAssetProceduresByIds=uA,s.selectAssetProceduresMapping=Os,s.selectAssetProceduresOfAssetProcedureType=Fr,s.selectAssetProceduresOfAssetType=dA,s.selectAssetStageById=ui,s.selectAssetStageCompletionById=Td,s.selectAssetStageCompletionMapping=ni,s.selectAssetStageCompletions=tf,s.selectAssetStageCompletionsByIds=Id,s.selectAssetStages=Od,s.selectAssetStagesByIds=uf,s.selectAssetStagesMappingOfAssetProcedureType=rf,s.selectAssetStagesOfAssetProcedureType=df,s.selectAssetTypeAttachmentById=jd,s.selectAssetTypeAttachmentMapping=Ed,s.selectAssetTypeAttachments=Vd,s.selectAssetTypeById=zi,s.selectAssetTypeFieldValues=Ii,s.selectAssetTypeFieldValuesAttachmentById=jf,s.selectAssetTypeFieldValuesAttachments=eu,s.selectAssetTypeFieldValuesAttachmentsByIds=tu,s.selectAssetTypeFieldValuesAttachmentsMapping=Ai,s.selectAssetTypeFieldValuesById=gi,s.selectAssetTypeFieldValuesMapping=uu,s.selectAssetTypeFieldValuesOfAsset=Uf,s.selectAssetTypeFields=Ut,s.selectAssetTypeFieldsAttachmentById=Tf,s.selectAssetTypeFieldsAttachments=Gd,s.selectAssetTypeFieldsAttachmentsMapping=$d,s.selectAssetTypeFieldsById=Rf,s.selectAssetTypeFieldsMapping=Zd,s.selectAssetTypeFieldsOfAssetType=Of,s.selectAssetTypeIdentifierById=Oi,s.selectAssetTypeIdentifierMapping=mu,s.selectAssetTypeIdentifierValueById=Mi,s.selectAssetTypeIdentifierValueMapping=Su,s.selectAssetTypeIdentifierValues=wi,s.selectAssetTypeIdentifierValuesOfAsset=Zf,s.selectAssetTypeIdentifierValuesOfIdentifier=Jf,s.selectAssetTypeIdentifiers=pu,s.selectAssetTypeIdentifiersOfAssetType=Lf,s.selectAssetTypeValuesOfAssetType=Df,s.selectAssetTypes=bu,s.selectAssetTypesByIds=sS,s.selectAssetTypesMapping=qi,s.selectAssetTypesOfOrganization=iS,s.selectAssets=ld,s.selectAssetsByIds=hd,s.selectAssetsMapping=Xs,s.selectAssetsOfAssetType=Qs,s.selectAttachmentsOfAsset=Mc,s.selectAttachmentsOfAssetProcedureStepFieldValues=Nr,s.selectAttachmentsOfAssetProcedureStepFields=bA,s.selectAttachmentsOfAssetProcedureType=jy,s.selectAttachmentsOfAssetProcedureTypeFieldValues=or,s.selectAttachmentsOfAssetProcedureTypeFields=ky,s.selectAttachmentsOfAssetType=qd,s.selectAttachmentsOfAssetTypeFieldValues=su,s.selectAttachmentsOfAssetTypeFields=Sf,s.selectAttachmentsOfDocument=SS,s.selectAttachmentsOfFormRevision=YS,s.selectAttachmentsOfFormSubmission=Go,s.selectAttachmentsOfIssue=gl,s.selectAttachmentsOfIssueComment=RT,s.selectAttachmentsOfIssueType=GT,s.selectAttachmentsOfIssueTypeFieldValues=Ph,s.selectAttachmentsOfIssueTypeFields=YT,s.selectAttachmentsOfProject=Dm,s.selectCategories=Eu,s.selectCategoriesByIds=mS,s.selectCategoriesOfProject=pS,s.selectCategoryById=ki,s.selectCategoryMapping=Ci,s.selectCommentsOfIssue=jT,s.selectConversation=_y,s.selectConversationMapping=cs,s.selectConversations=Oy,s.selectCurrentUser=sm,s.selectDeletedRequests=lg,s.selectDescendantsOfAssetProcedureStep=dd,s.selectDocumentAttachmentById=Gu,s.selectDocumentAttachmentMapping=Bu,s.selectDocumentById=Ku,s.selectDocuments=Li,s.selectDocumentsByIds=TS,s.selectDocumentsMapping=Bt,s.selectEmailDomains=eo,s.selectEmailDomainsAsMapping=xu,s.selectEmailDomainsOfOrganization=vS,s.selectFieldValuesOfAssetProcedure=aA,s.selectFormById=Uo,s.selectFormIdentifierById=Zi,s.selectFormIdentifierMapping=oo,s.selectFormIdentifierValueById=ea,s.selectFormIdentifierValueMapping=yo,s.selectFormIdentifierValues=xi,s.selectFormIdentifierValuesOfFormSubmission=$S,s.selectFormIdentifierValuesOfIdentifier=GS,s.selectFormIdentifiers=lo,s.selectFormIdentifiersOfForm=zS,s.selectFormMapping=qo,s.selectFormRevisionAttachmentsMapping=bo,s.selectFormRevisionById=QS,s.selectFormRevisionMapping=na,s.selectFormRevisions=ca,s.selectFormRevisionsOfForm=wo,s.selectFormSubmissionAttachemntsByIds=$o,s.selectFormSubmissionAttachments=la,s.selectFormSubmissionAttachmentsMapping=Bo,s.selectFormSubmissionById=Aa,s.selectFormSubmissions=pT,s.selectFormSubmissionsMapping=ya,s.selectFormSubmissionsOfForm=Zo,s.selectForms=zo,s.selectFormsOfOrganization=cT,s.selectGeoImageById=Ta,s.selectGeoImageMapping=al,s.selectGeoImages=nl,s.selectGeoImagesOfProject=AT,s.selectIsImportingProjectFile=Rg,s.selectIsLoggedIn=rS,s.selectIssueAssociationById=ol,s.selectIssueAssociationMapping=St,s.selectIssueAssociations=IT,s.selectIssueAssociationsOfAsset=ml,s.selectIssueAssociationsOfIssue=hl,s.selectIssueAssociationsToIssue=ll,s.selectIssueAttachmentById=bl,s.selectIssueAttachmentMapping=Tl,s.selectIssueAttachments=Il,s.selectIssueById=$a,s.selectIssueCommentAttachmentById=Vl,s.selectIssueCommentAttachmentMapping=Ml,s.selectIssueCommentAttachments=El,s.selectIssueCommentById=za,s.selectIssueCommentMapping=Ul,s.selectIssueMapping=ka,s.selectIssueTypeAttachmentById=Ql,s.selectIssueTypeAttachmentMapping=Jl,s.selectIssueTypeAttachments=Xl,s.selectIssueTypeById=hn,s.selectIssueTypeFieldValues=Ya,s.selectIssueTypeFieldValuesAttachmentById=AI,s.selectIssueTypeFieldValuesAttachments=Qa,s.selectIssueTypeFieldValuesAttachmentsByIds=Fh,s.selectIssueTypeFieldValuesAttachmentsMapping=bh,s.selectIssueTypeFieldValuesById=Za,s.selectIssueTypeFieldValuesMapping=oh,s.selectIssueTypeFieldValuesOfIssue=tI,s.selectIssueTypeFields=Ht,s.selectIssueTypeFieldsAttachmentById=ZT,s.selectIssueTypeFieldsAttachments=ch,s.selectIssueTypeFieldsAttachmentsMapping=nh,s.selectIssueTypeFieldsById=oI,s.selectIssueTypeFieldsMapping=fh,s.selectIssueTypeFieldsOfIssueType=rI,s.selectIssueTypeIdentifierById=sn,s.selectIssueTypeIdentifierMapping=vh,s.selectIssueTypeIdentifierValueById=dn,s.selectIssueTypeIdentifierValueMapping=jh,s.selectIssueTypeIdentifierValues=rn,s.selectIssueTypeIdentifierValuesOfIdentifier=wI,s.selectIssueTypeIdentifierValuesOfIssue=vI,s.selectIssueTypeIdentifiers=wh,s.selectIssueTypeIdentifiersOfIssueType=bI,s.selectIssueTypeMapping=ln,s.selectIssueTypeValuesOfIssueType=uI,s.selectIssueTypes=kh,s.selectIssueTypesByIds=zI,s.selectIssueTypesOfOrganization=UI,s.selectIssueUpdateMapping=Kh,s.selectIssueUpdates=Yh,s.selectIssueUpdatesOfIssue=Zh,s.selectIssues=Ba,s.selectIssuesByIds=DT,s.selectIssuesOfIssueType=Gl,s.selectIssuesOfProject=CT,s.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=MA,s.selectLatestAssetProcedureTypeFieldsOfAssetProcedureType=Ky,s.selectLatestAssetTypeFieldsOfAssetType=_f,s.selectLatestFieldsByAssetProcedureStep=EA,s.selectLatestFormRevisionOfForm=xS,s.selectLatestIssueTypeFieldsOfIssueType=dI,s.selectLatestRetryTime=hg,s.selectMembershipsByUserOfTeam=Bg,s.selectNumberOfAssetsOfAssetType=QA,s.selectOrganizationAccessById=Sn,s.selectOrganizationAccessMapping=fn,s.selectOrganizationAccessUserMapping=um,s.selectOrganizationById=og,s.selectOrganizationDocuments=gS,s.selectOrganizations=ug,s.selectOrganizationsMapping=pm,s.selectProjectAccessById=Rn,s.selectProjectAccessMapping=_n,s.selectProjectAccesses=Jt,s.selectProjectAccessesOfProject=_m,s.selectProjectAttachmentById=Um,s.selectProjectAttachmentMapping=qm,s.selectProjectById=tp,s.selectProjectDocuments=IS,s.selectProjectFileById=Og,s.selectProjectFileMapping=Km,s.selectProjectFiles=Ym,s.selectProjectMapping=ep,s.selectProjects=zn,s.selectProjectsOfOrganization=qg,s.selectRehydrated=Dg,s.selectStageMapping=zt,s.selectTeamById=Nn,s.selectTeamMembershipById=lp,s.selectTeamMemberships=Bn,s.selectTeamMembershipsMapping=op,s.selectTeams=Ap,s.selectTeamsByIds=Wg,s.selectTeamsMapping=Ln,s.selectTeamsOfOrganization=Kg,s.selectUploadUrl=no,s.selectUserById=im,s.selectUsers=yn,s.selectUsersByIds=ZI,s.selectUsersMapping=Yt,s.selectUsersOfOrganization=sg,s.selectUsersOfProject=fg,s.selectUsersOfTeam=$g,s.setActiveProjectFileId=Hm,s.setAsset=JA,s.setAssetAttachment=Pc,s.setAssetAttachments=vy,s.setAssetProcedure=cA,s.setAssetProcedureStep=td,s.setAssetProcedureStepFieldValues=kA,s.setAssetProcedureStepFieldValuesAttachment=qA,s.setAssetProcedureStepFieldValuesAttachments=zA,s.setAssetProcedureStepFieldValuesMany=BA,s.setAssetProcedureStepFields=OA,s.setAssetProcedureStepFieldsAttachment=SA,s.setAssetProcedureStepFieldsAttachments=TA,s.setAssetProcedureStepFieldsMany=_A,s.setAssetProcedureSteps=NA,s.setAssetProcedureType=mA,s.setAssetProcedureTypeAttachment=zc,s.setAssetProcedureTypeAttachments=Ey,s.setAssetProcedureTypeFieldValues=tA,s.setAssetProcedureTypeFieldValuesAttachment=Jy,s.setAssetProcedureTypeFieldValuesAttachments=Xy,s.setAssetProcedureTypeFieldValuesMany=sA,s.setAssetProcedureTypeFields=Gy,s.setAssetProcedureTypeFieldsAttachment=zy,s.setAssetProcedureTypeFieldsAttachments=Uy,s.setAssetProcedureTypeFieldsMany=Ly,s.setAssetProcedureTypes=pA,s.setAssetProcedures=rA,s.setAssetStage=Fd,s.setAssetStageCompletion=xA,s.setAssetStageCompletions=ef,s.setAssetStages=sf,s.setAssetType=Xf,s.setAssetTypeAttachment=vd,s.setAssetTypeAttachments=lf,s.setAssetTypeFieldValues=qf,s.setAssetTypeFieldValuesAttachment=wf,s.setAssetTypeFieldValuesAttachments=Mf,s.setAssetTypeFieldValuesMany=zf,s.setAssetTypeFields=gf,s.setAssetTypeFieldsAttachment=pf,s.setAssetTypeFieldsAttachments=yf,s.setAssetTypeFieldsMany=bf,s.setAssetTypeIdentifier=kf,s.setAssetTypeIdentifierValue=Hf,s.setAssetTypeIdentifierValues=Wf,s.setAssetTypeIdentifiers=Bf,s.setAssetTypes=Qf,s.setAssets=XA,s.setCategories=oS,s.setCategory=uS,s.setClientSDK=qp,s.setClientStore=Vp,s.setConversation=Ic,s.setConversations=gy,s.setCurrentUser=KI,s.setDocumentAttachment=Uu,s.setDocumentAttachments=AS,s.setDocuments=Hu,s.setEmailDomain=FS,s.setEmailDomains=PS,s.setForm=tT,s.setFormIdentifier=ES,s.setFormIdentifierValue=DS,s.setFormIdentifierValues=CS,s.setFormIdentifiers=VS,s.setFormRevision=Ro,s.setFormRevisionAttachment=NS,s.setFormRevisionAttachments=HS,s.setFormRevisions=ZS,s.setFormSubmission=Lt,s.setFormSubmissionAttachment=dT,s.setFormSubmissionAttachments=uT,s.setFormSubmissions=hT,s.setForms=sT,s.setGeoImage=ft,s.setGeoImages=xo,s.setIsImportingProjectFile=Nm,s.setIssue=qT,s.setIssueAssociation=ST,s.setIssueAssociations=fT,s.setIssueAttachment=Al,s.setIssueAttachments=bT,s.setIssueComment=ja,s.setIssueCommentAttachment=_l,s.setIssueCommentAttachments=OT,s.setIssueComments=zl,s.setIssueType=bt,s.setIssueTypeAttachment=Wl,s.setIssueTypeAttachments=BT,s.setIssueTypeFieldValues=XT,s.setIssueTypeFieldValuesAttachment=hI,s.setIssueTypeFieldValuesAttachments=mI,s.setIssueTypeFieldValuesMany=QT,s.setIssueTypeFields=iI,s.setIssueTypeFieldsAttachment=NT,s.setIssueTypeFieldsAttachments=HT,s.setIssueTypeFieldsMany=aI,s.setIssueTypeIdentifier=SI,s.setIssueTypeIdentifierValue=PI,s.setIssueTypeIdentifierValues=OI,s.setIssueTypeIdentifiers=TI,s.setIssueTypes=EI,s.setIssueUpdate=DI,s.setIssueUpdates=CI,s.setIssues=zT,s.setLoggedIn=Ou,s.setOrganization=ag,s.setOrganizationAccess=XI,s.setOrganizationAccesses=QI,s.setOrganizations=ig,s.setProfilePicture=YI,s.setProject=wg,s.setProjectAccess=pg,s.setProjectAccesses=yg,s.setProjectAttachment=Mm,s.setProjectAttachments=Em,s.setProjectFile=Ig,s.setProjectFiles=gg,s.setProjects=vg,s.setRehydrated=Ug,s.setTeam=Pt,s.setTeamMembership=Cn,s.setTeamMemberships=rp,s.setTeams=Lg,s.setTokens=aS,s.setUploadUrl=ao,s.setUser=GI,s.setUsers=$I,s.shallowEqual=ey,s.slugify=yy,s.spacesToDashesLower=py,s.teamMembershipReducer=up,s.teamMembershipSlice=Dn,s.teamReducer=fp,s.teamSlice=$n,s.toFileNameSafeString=my,s.toUuidArray=mc,s.toUuidIdRecord=hc,s.truncate=Ay,s.updateAsset=ot,s.updateAssetAttachment=wy,s.updateAssetAttachments=Oc,s.updateAssetProcedure=nt,s.updateAssetProcedureStep=Vt,s.updateAssetProcedureStepFieldValues=dt,s.updateAssetProcedureStepFieldValuesAttachment=UA,s.updateAssetProcedureStepFieldValuesAttachments=$r,s.updateAssetProcedureStepFieldValuesMany=Zr,s.updateAssetProcedureStepFields=rt,s.updateAssetProcedureStepFieldsAttachment=IA,s.updateAssetProcedureStepFieldsAttachments=Er,s.updateAssetProcedureStepFieldsMany=RA,s.updateAssetProcedureSteps=HA,s.updateAssetProcedureType=ct,s.updateAssetProcedureTypeAttachment=Vy,s.updateAssetProcedureTypeAttachments=Uc,s.updateAssetProcedureTypeFieldValues=at,s.updateAssetProcedureTypeFieldValuesAttachment=Qy,s.updateAssetProcedureTypeFieldValuesAttachments=cr,s.updateAssetProcedureTypeFieldValuesMany=pr,s.updateAssetProcedureTypeFields=er,s.updateAssetProcedureTypeFieldsAttachment=Dy,s.updateAssetProcedureTypeFieldsAttachments=Wc,s.updateAssetProcedureTypeFieldsMany=Ny,s.updateAssetProcedureTypes=lA,s.updateAssetProcedures=nA,s.updateAssetStage=qt,s.updateAssetStageCompletion=Ad,s.updateAssetStageCompletions=fd,s.updateAssetStages=nf,s.updateAssetType=pt,s.updateAssetTypeAttachment=hf,s.updateAssetTypeAttachments=wd,s.updateAssetTypeFieldValues=lt,s.updateAssetTypeFieldValuesAttachment=Ef,s.updateAssetTypeFieldValuesAttachments=xd,s.updateAssetTypeFieldValuesMany=ru,s.updateAssetTypeFields=Kd,s.updateAssetTypeFieldsAttachment=Af,s.updateAssetTypeFieldsAttachments=kd,s.updateAssetTypeFieldsMany=Ff,s.updateAssetTypeIdentifier=ht,s.updateAssetTypeIdentifierValue=mt,s.updateAssetTypeIdentifierValues=Kf,s.updateAssetTypeIdentifiers=$f,s.updateAssetTypes=eS,s.updateAssets=ZA,s.updateCategories=lS,s.updateCategory=wu,s.updateConversation=gc,s.updateConversations=by,s.updateDocumentAttachment=fS,s.updateDocumentAttachments=Du,s.updateDocuments=xe,s.updateEmailDomain=OS,s.updateEmailDomains=_S,s.updateForm=iT,s.updateFormIdentifier=yt,s.updateFormIdentifierValue=At,s.updateFormIdentifierValues=kS,s.updateFormIdentifiers=jS,s.updateFormRevision=JS,s.updateFormRevisionAttachment=WS,s.updateFormRevisionAttachments=Io,s.updateFormRevisions=XS,s.updateFormSubmission=Ko,s.updateFormSubmissionAttachment=oT,s.updateFormSubmissionAttachments=ko,s.updateFormSubmissions=mT,s.updateForms=aT,s.updateGeoImage=sl,s.updateGeoImages=yT,s.updateIssue=Nt,s.updateIssueAssociation=ul,s.updateIssueAssociations=TT,s.updateIssueAttachment=FT,s.updateIssueAttachments=fl,s.updateIssueComment=MT,s.updateIssueCommentAttachment=_T,s.updateIssueCommentAttachments=Rl,s.updateIssueComments=ET,s.updateIssueType=Ch,s.updateIssueTypeAttachment=$T,s.updateIssueTypeAttachments=Kl,s.updateIssueTypeFieldValues=Tt,s.updateIssueTypeFieldValuesAttachment=pI,s.updateIssueTypeFieldValuesAttachments=gh,s.updateIssueTypeFieldValuesMany=xT,s.updateIssueTypeFields=yh,s.updateIssueTypeFieldsAttachment=WT,s.updateIssueTypeFieldsAttachments=ih,s.updateIssueTypeFieldsMany=nI,s.updateIssueTypeIdentifier=It,s.updateIssueTypeIdentifierValue=gt,s.updateIssueTypeIdentifierValues=_I,s.updateIssueTypeIdentifiers=II,s.updateIssueTypes=VI,s.updateIssueUpdate=kI,s.updateIssueUpdates=BI,s.updateIssues=UT,s.updateOrganization=mm,s.updateOrganizationAccess=Zt,s.updateOrganizationAccesses=xI,s.updateOrganizations=cg,s.updateProject=Qm,s.updateProjectAccess=Ft,s.updateProjectAccesses=Pm,s.updateProjectAttachment=Tg,s.updateProjectAttachments=Vm,s.updateProjectFile=En,s.updateProjectFiles=Fg,s.updateProjects=Eg,s.updateTeam=yp,s.updateTeamMembership=Cg,s.updateTeamMemberships=kg,s.updateTeams=Ng,s.updateUser=HI,s.updateUsers=NI,s.useSelectorBuilder=Xg,s.userReducer=tm,s.userSlice=pn,s.uuidObj=b,s.versioningReducer=Tp,s.versioningSlice=Sp,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 zt(e),file_type:e.type,extension:Fc(e),size:e.size};return await this.client.files.addCache(e),c}}class Qg extends v{constructor(){super(...arguments);h(this,"name","Form Identifier");h(this,"url","/form-identifiers");h(this,"actions",{addOne:qu,addMany:Cu,setOne:$u,setMany:Uu,updateOne:Lu,updateMany:ku,deleteOne:Nu,deleteMany:Gu,initialize:ju});h(this,"selectors",{selectById:Wu,selectByIds:Ku})}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=O({...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 xg extends v{constructor(){super(...arguments);h(this,"name","Form Identifier Value");h(this,"url","/form-identifier-values");h(this,"actions",{addOne:Xu,addMany:Qu,setOne:xu,setMany:el,updateOne:tl,updateMany:sl,deleteOne:il,deleteMany:nl,initialize:Ju});h(this,"selectors",{selectById:al,selectByIds:rl})}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=O({...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 eM extends j{constructor(){super(...arguments);h(this,"name","Form Revision Attachment");h(this,"url","/form-revision-attachments");h(this,"actions",{addOne:ol,addMany:hl,setOne:ml,setMany:pl,updateOne:yl,updateMany:fl,deleteOne:Sl,deleteMany:Al,initialize:ll});h(this,"selectors",{selectById:Tl,selectByIds:Ol})}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 O({...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 tM extends v{constructor(){super(...arguments);h(this,"name","Form Revision");h(this,"url","/form-revisions");h(this,"actions",{addOne:_l,addMany:ei,setOne:gl,setMany:Ml,updateOne:Rl,updateMany:wl,deleteOne:vl,deleteMany:ti,initialize:bl});h(this,"selectors",{selectById:Bl,selectByIds:Vl})}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=O({...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 sM extends v{constructor(){super(...arguments);h(this,"name","Form");h(this,"url","/forms");h(this,"actions",{addOne:Cl,addMany:$l,setOne:Ul,setMany:Ll,updateOne:kl,updateMany:Nl,deleteOne:Gl,deleteMany:Hl,initialize:ql});h(this,"selectors",{selectById:Yl,selectByIds:Zl})}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=O({...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(To(e)),d=this.select(zl(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 iM extends j{constructor(){super(...arguments);h(this,"name","Form Submission Attachment");h(this,"url","/form-submission-attachments");h(this,"actions",{addOne:Ql,addMany:ci,setOne:xl,setMany:eo,updateOne:to,updateMany:so,deleteOne:io,deleteMany:ai,initialize:Xl});h(this,"selectors",{selectById:no,selectByIds:co})}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 O({...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 nM extends v{constructor(){super(...arguments);h(this,"name","Form Submission");h(this,"url","/form-submissions");h(this,"actions",{addOne:mo,addMany:oi,setOne:oo,setMany:ho,updateOne:po,updateMany:yo,deleteOne:fo,deleteMany:hi,initialize:lo});h(this,"selectors",{selectById:Ao,selectByIds:Io})}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=O({...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(ao(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 cM extends j{constructor(){super(...arguments);h(this,"name","Geo Image");h(this,"url","/geo-images");h(this,"actions",{addOne:go,addMany:Mo,setOne:bo,setMany:_o,updateOne:Ro,updateMany:wo,deleteOne:vo,deleteMany:Eo,initialize:Fo});h(this,"selectors",{selectById:Vo,selectByIds:zo})}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 O({...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 aM extends v{constructor(){super(...arguments);h(this,"name","Issue Association");h(this,"url","/issue-associations");h(this,"actions",{addOne:ko,addMany:yt,setOne:$o,setMany:Co,updateOne:Uo,updateMany:Lo,deleteOne:No,deleteMany:ft,initialize:qo});h(this,"selectors",{selectById:Ho,selectByIds:Wo})}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=O({...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=>O({...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 rM extends j{constructor(){super(...arguments);h(this,"name","Issue Attachment");h(this,"url","/issue-attachments");h(this,"actions",{addOne:eh,addMany:Ai,setOne:th,setMany:sh,updateOne:ih,updateMany:nh,deleteOne:ch,deleteMany:Ii,initialize:xo});h(this,"selectors",{selectById:dh,selectByIds:uh})}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 O({...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 dM extends j{constructor(){super(...arguments);h(this,"name","Issue Comment Attachment");h(this,"url","/issue-comment-attachments");h(this,"actions",{addOne:mh,addMany:ph,setOne:yh,setMany:fh,updateOne:Sh,updateMany:Ah,deleteOne:Ih,deleteMany:Th,initialize:hh});h(this,"selectors",{selectById:Ph,selectByIds:Fh})}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 O({...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 uM extends v{constructor(){super(...arguments);h(this,"name","Issue Comment");h(this,"url","/issue-comments");h(this,"actions",{addOne:Mh,addMany:Rh,setOne:wh,setMany:vh,updateOne:Eh,updateMany:Bh,deleteOne:Vh,deleteMany:zh,initialize:gh});h(this,"selectors",{selectById:Dh,selectByIds:jh})}add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions,a=O({...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 lM extends v{constructor(){super(...arguments);h(this,"name","Issue");h(this,"url","/issues");h(this,"actions",{addOne:Uh,addMany:gi,setOne:Lh,setMany:kh,updateOne:Nh,updateMany:Gh,deleteOne:Hh,deleteMany:Mi,initialize:$h});h(this,"selectors",{selectById:Kh,selectByIds:Yh})}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=O({...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],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:u[m]=e.priority;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(Hi(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(Xt(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=O({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(Ki(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(Zi(d.uuid))}),[a,p]}bulkUpdate(e,n){const{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,a=E(e).toSorted(Dt);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=ct(e,Math.min(n??e.length,k)),m=[];let f=null;for(const I of p){const R=at.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 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(Yo(e)),d=this.select(rh(e)),p=this.select(Oy(e));this.dispatch(n(e)),this.dispatch(Ii(E(d))),this.dispatch(Ji(E(p))),this.dispatch(ft(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(Yi(p)),this.dispatch(yt(u)),m}}async bulkDelete(e){const{addMany:n,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e)),u=this.select(Ko(e));this.dispatch(c(e)),this.dispatch(ft(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(yt(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 oM extends j{constructor(){super(...arguments);h(this,"name","Issue Type Attachment");h(this,"url","/issue-type-attachments");h(this,"actions",{addOne:xh,addMany:em,setOne:tm,setMany:sm,updateOne:im,updateMany:nm,deleteOne:cm,deleteMany:am,initialize:Qh});h(this,"selectors",{selectById:dm,selectByIds:um})}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 O({...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 hM extends j{constructor(){super(...arguments);h(this,"name","Issue Type Fields Attachment");h(this,"url","/issue-type-fields-attachments");h(this,"actions",{addOne:mm,addMany:pm,setOne:ym,setMany:fm,updateOne:Sm,updateMany:Am,deleteOne:Im,deleteMany:Tm,initialize:hm});h(this,"selectors",{selectById:Pm,selectByIds:Fm})}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 O({...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 mM extends v{constructor(){super(...arguments);h(this,"name","Issue Type Fields");h(this,"url","/issue-type-fields");h(this,"actions",{addOne:Lm,addMany:km,setOne:Nm,setMany:Gm,updateOne:Hm,updateMany:Wm,deleteOne:Km,deleteMany:Ym,initialize:Um});h(this,"selectors",{selectById:Jm,selectByIds:Xm})}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=O({...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 pM 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:tp,addMany:Di,setOne:sp,setMany:ip,updateOne:np,updateMany:cp,deleteOne:ap,deleteMany:ji,initialize:ep});h(this,"selectors",{selectById:dp,selectByIds:up})}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 O({...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 yM extends v{constructor(){super(...arguments);h(this,"name","Issue Type Field Values");h(this,"url","/issue-type-field-values");h(this,"actions",{addOne:Mm,addMany:Rm,setOne:wm,setMany:vm,updateOne:Em,updateMany:Bm,deleteOne:Vm,deleteMany:zm,initialize:gm});h(this,"selectors",{selectById:jm,selectByIds:qm})}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=O({...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(lp(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 fM extends v{constructor(){super(...arguments);h(this,"name","Issue Type Identifier");h(this,"url","/issue-type-identifiers");h(this,"actions",{addOne:pp,addMany:yp,setOne:fp,setMany:Sp,updateOne:Ap,updateMany:Ip,deleteOne:Tp,deleteMany:Op,initialize:mp});h(this,"selectors",{selectById:Fp,selectByIds:bp})}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=O({...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 SM extends v{constructor(){super(...arguments);h(this,"name","Issue Type Identifier Value");h(this,"url","/issue-type-identifier-values");h(this,"actions",{addOne:Rp,addMany:wp,setOne:vp,setMany:Ep,updateOne:Bp,updateMany:Vp,deleteOne:zp,deleteMany:Dp,initialize:Mp});h(this,"selectors",{selectById:qp,selectByIds:Cp})}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=O({...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 AM extends v{constructor(){super(...arguments);h(this,"name","Issue Type");h(this,"url","/issue-types");h(this,"actions",{addOne:kp,addMany:Np,setOne:Gp,setMany:Hp,updateOne:Wp,updateMany:Kp,deleteOne:Yp,deleteMany:Zp,initialize:Lp});h(this,"selectors",{selectById:Xp,selectByIds:Qp})}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=O({...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(Zh(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 IM extends v{constructor(){super(...arguments);h(this,"name","Issue Type Status");h(this,"url","/issue-type-statuses");h(this,"actions",{addOne:sy,addMany:iy,setOne:ny,setMany:cy,updateOne:ay,updateMany:ry,deleteOne:dy,deleteMany:uy,initialize:ty});h(this,"selectors",{selectById:Hi,selectByIds:oy})}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=O({...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 TM extends v{constructor(){super(...arguments);h(this,"name","Issue Update");h(this,"url","/issue-updates");h(this,"actions",{addOne:Ki,addMany:Yi,setOne:yy,setMany:fy,updateOne:Sy,updateMany:Ay,deleteOne:Zi,deleteMany:Ji,initialize:py});h(this,"selectors",{selectById:Iy,selectByIds:Ty})}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 OM=1800;function PM(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 FM extends Vg{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=ZF(e).exp??n}catch{c=n}return c-n<OM}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??Tt).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=at.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(PM(c))})}}class bM extends ot{constructor(){super(...arguments);h(this,"name","Organization Access");h(this,"url","/organization-accesses");h(this,"actions",{addOne:jy,addMany:qy,setOne:Cy,setMany:$y,updateOne:Uy,updateMany:Ly,deleteOne:ky,deleteMany:Ny,initialize:Dy});h(this,"selectors",{selectById:Hy,selectByIds:Wy})}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(Xt(a.user));this.dispatch(n(a.uuid)),this.dispatch(tn(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(en(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 _M extends ot{constructor(){super(...arguments);h(this,"name","Organization");h(this,"url","/organizations");h(this,"actions",{addOne:xy,addMany:Qy,setOne:Xy,setMany:Jy,updateOne:tf,updateMany:ef,deleteOne:sf,deleteMany:nf,initialize:Zy});h(this,"selectors",{selectById:rf,selectByIds:df})}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 gM extends v{constructor(){super(...arguments);h(this,"name","Project Access");h(this,"url","/project-accesses");h(this,"actions",{addOne:Af,addMany:If,setOne:Tf,setMany:Of,updateOne:Pf,updateMany:Ff,deleteOne:bf,deleteMany:_f,initialize:Sf});h(this,"selectors",{selectById:Mf,selectByIds:Rf})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...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=>O({...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 MM extends j{constructor(){super(...arguments);h(this,"name","Project Attachment");h(this,"url","/project-attachments");h(this,"actions",{addOne:Ef,addMany:Bf,setOne:Vf,setMany:zf,updateOne:Df,updateMany:jf,deleteOne:qf,deleteMany:Cf,initialize:vf});h(this,"selectors",{selectById:Uf,selectByIds:Lf})}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 O({...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 RM extends v{constructor(){super(...arguments);h(this,"name","Project Comment");h(this,"url","/project-comments");h(this,"actions",{addOne:Hf,addMany:Wf,setOne:Kf,setMany:Yf,updateOne:Zf,updateMany:Jf,deleteOne:Xf,deleteMany:Qf,initialize:Gf});h(this,"selectors",{selectById:eS,selectByIds:tS})}add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions,a=O({...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 wM extends j{constructor(){super(...arguments);h(this,"name","Project File");h(this,"url","/project-files");h(this,"actions",{addOne:rS,addMany:dS,setOne:cS,setMany:aS,updateOne:uS,updateMany:lS,deleteOne:oS,deleteMany:hS,initialize:nS});h(this,"selectors",{selectById:yS,selectByIds:fS})}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 O({...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 vM extends ot{constructor(){super(...arguments);h(this,"name","Project");h(this,"url","/projects");h(this,"actions",{addOne:FS,addMany:PS,setOne:OS,setMany:TS,updateOne:_S,updateMany:bS,deleteOne:gS,deleteMany:MS,initialize:IS});h(this,"selectors",{selectById:vS,selectByIds:ES})}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 EM extends v{constructor(){super(...arguments);h(this,"name","Procedure");h(this,"url","/procedures");h(this,"actions",{addOne:YS,addMany:At,setOne:ZS,setMany:JS,updateOne:XS,updateMany:QS,deleteOne:xS,deleteMany:It,initialize:KS});h(this,"selectors",{selectById:sA,selectByIds:iA})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...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=ct(e,Math.min(n??e.length,k)),I=[];for(const g of f){const _=[],w=[],B=[];for(const D of g){const z=O({...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 BM extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Assignee");h(this,"url","/procedure-step-assignees");h(this,"actions",{addOne:lA,addMany:oA,setOne:hA,setMany:mA,updateOne:pA,updateMany:yA,deleteOne:fA,deleteMany:SA,initialize:uA});h(this,"selectors",{selectById:IA,selectByIds:TA})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...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=>O({...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 VM extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Comment");h(this,"url","/procedure-step-comments");h(this,"actions",{addOne:bA,addMany:_A,setOne:gA,setMany:MA,updateOne:RA,updateMany:wA,deleteOne:vA,deleteMany:EA,initialize:FA});h(this,"selectors",{selectById:VA,selectByIds:zA})}add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions,a=O({...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 zM extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Default Assignee");h(this,"url","/procedure-step-default-assignees");h(this,"actions",{addOne:CA,addMany:$A,setOne:UA,setMany:LA,updateOne:kA,updateMany:NA,deleteOne:GA,deleteMany:HA,initialize:qA});h(this,"selectors",{selectById:KA,selectByIds:YA})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...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 DM extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Default Reviewer");h(this,"url","/procedure-step-default-reviewers");h(this,"actions",{addOne:QA,addMany:xA,setOne:eI,setMany:tI,updateOne:sI,updateMany:iI,deleteOne:nI,deleteMany:cI,initialize:XA});h(this,"selectors",{selectById:rI,selectByIds:dI})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...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 jM extends ot{constructor(){super(...arguments);h(this,"name","Procedure Step Event");h(this,"url","/procedure-step-events");h(this,"actions",{addOne:hI,addMany:mI,setOne:pI,setMany:yI,updateOne:fI,updateMany:SI,deleteOne:AI,deleteMany:II,initialize:oI});h(this,"selectors",{selectById:OI,selectByIds:PI})}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 j{constructor(){super(...arguments);h(this,"name","Procedure Step Fields Attachment");h(this,"url","/procedure-step-fields-attachments");h(this,"actions",{addOne:gI,addMany:bn,setOne:MI,setMany:RI,updateOne:wI,updateMany:vI,deleteOne:EI,deleteMany:_n,initialize:_I});h(this,"selectors",{selectById:zI,selectByIds:DI})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){return O({...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 CM extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Fields");h(this,"url","/procedure-step-fields");h(this,"actions",{addOne:$I,addMany:UI,setOne:LI,setMany:kI,updateOne:NI,updateMany:GI,deleteOne:HI,deleteMany:WI,initialize:CI});h(this,"selectors",{selectById:KI,selectByIds:YI})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...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(VI(e));this.dispatch(n(e)),this.dispatch(_n(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(bn(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 $M 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:QI,addMany:vn,setOne:xI,setMany:eT,updateOne:tT,updateMany:sT,deleteOne:iT,deleteMany:En,initialize:XI});h(this,"selectors",{selectById:cT,selectByIds:aT})}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 O({...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 UM 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:_T,addMany:Dn,setOne:gT,setMany:MT,updateOne:RT,updateMany:wT,deleteOne:vT,deleteMany:jn,initialize:bT});h(this,"selectors",{selectById:BT,selectByIds:VT})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...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 LM extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Field Values");h(this,"url","/procedure-step-field-values");h(this,"actions",{addOne:oT,addMany:hT,setOne:mT,setMany:pT,updateOne:yT,updateMany:fT,deleteOne:ST,deleteMany:AT,initialize:lT});h(this,"selectors",{selectById:OT,selectByIds:PT})}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=O({...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=ct(e,Math.min(n??e.length,k)),f=[];for(const R of m){const b=[],g=[],_=[];for(const w of R){const B=O({...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(rT(e)),d=this.select(zT(e));this.dispatch(n(e)),this.dispatch(En(E(u))),this.dispatch(jn(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(Dn(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 kM extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Reviewer");h(this,"url","/procedure-step-reviewers");h(this,"actions",{addOne:CT,addMany:$T,setOne:UT,setMany:LT,updateOne:kT,updateMany:NT,deleteOne:GT,deleteMany:HT,initialize:qT});h(this,"selectors",{selectById:KT,selectByIds:YT})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...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=>O({...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 NM extends v{constructor(){super(...arguments);h(this,"name","Procedure Initiative");h(this,"url","/procedure-initiatives");h(this,"actions",{addOne:zS,addMany:DS,setOne:jS,setMany:qS,updateOne:CS,updateMany:$S,deleteOne:US,deleteMany:LS,initialize:VS});h(this,"selectors",{selectById:GS,selectByIds:HS})}add(e){var p;const{store:n}=this.client,{addOne:c,setOne:r,deleteOne:a}=this.actions,u=O({...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(rA(e));this.dispatch(n(e)),this.dispatch(It(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(At(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 GM extends v{constructor(){super(...arguments);h(this,"name","Procedure Step");h(this,"url","/procedure-steps");h(this,"actions",{addOne:eO,addMany:tO,setOne:QT,setMany:xT,updateOne:sO,updateMany:iO,deleteOne:nO,deleteMany:cO,initialize:XT});h(this,"selectors",{selectById:rO,selectByIds:dO})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...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 HM extends j{constructor(){super(...arguments);h(this,"name","Procedure Type Attachment");h(this,"url","/procedure-type-attachments");h(this,"actions",{addOne:oO,addMany:hO,setOne:mO,setMany:pO,updateOne:yO,updateMany:fO,deleteOne:SO,deleteMany:AO,initialize:lO});h(this,"selectors",{selectById:OO,selectByIds:PO})}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 O({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 WM extends j{constructor(){super(...arguments);h(this,"name","Procedure Type Fields Attachment");h(this,"url","/procedure-type-fields-attachments");h(this,"actions",{addOne:_O,addMany:gO,setOne:MO,setMany:RO,updateOne:wO,updateMany:vO,deleteOne:EO,deleteMany:BO,initialize:bO});h(this,"selectors",{selectById:DO,selectByIds:jO})}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 O({...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 KM extends v{constructor(){super(...arguments);h(this,"name","Procedure Type Fields");h(this,"url","/procedure-type-fields");h(this,"actions",{addOne:$O,addMany:UO,setOne:LO,setMany:kO,updateOne:NO,updateMany:GO,deleteOne:HO,deleteMany:WO,initialize:CO});h(this,"selectors",{selectById:ZO,selectByIds:JO})}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=O({...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 YM extends j{constructor(){super(...arguments);h(this,"name","Procedure Field Values Attachment");h(this,"url","/procedure-field-values-attachments");h(this,"actions",{addOne:xO,addMany:Kn,setOne:eP,setMany:tP,updateOne:sP,updateMany:iP,deleteOne:nP,deleteMany:Yn,initialize:QO});h(this,"selectors",{selectById:rP,selectByIds:dP})}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 O({...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 ZM extends v{constructor(){super(...arguments);h(this,"name","Procedure Field Values");h(this,"url","/procedure-field-values");h(this,"actions",{addOne:hP,addMany:mP,setOne:pP,setMany:yP,updateOne:fP,updateMany:SP,deleteOne:AP,deleteMany:IP,initialize:oP});h(this,"selectors",{selectById:PP,selectByIds:FP})}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=O({...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=ct(e,Math.min(n??e.length,k)),f=[];for(const R of m){const b=[],g=[],_=[];for(const w of R){const B=O({...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(uP(e));this.dispatch(n(e)),this.dispatch(Yn(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(Kn(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 JM extends v{constructor(){super(...arguments);h(this,"name","Procedure Type");h(this,"url","/procedure-types");h(this,"actions",{addOne:gP,addMany:MP,setOne:RP,setMany:wP,updateOne:vP,updateMany:EP,deleteOne:BP,deleteMany:VP,initialize:_P});h(this,"selectors",{selectById:jP,selectByIds:qP})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...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(nA(e));this.dispatch(n(e)),this.dispatch(It(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(At(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 XM extends v{constructor(){super(...arguments);h(this,"name","Team Membership");h(this,"url","/team-memberships");h(this,"actions",{addOne:LP,addMany:kP,setOne:NP,setMany:GP,updateOne:HP,updateMany:WP,deleteOne:KP,deleteMany:YP,initialize:UP});h(this,"selectors",{selectById:XP,selectByIds:QP})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...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=>O({...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 QM extends v{constructor(){super(...arguments);h(this,"name","Team");h(this,"url","/teams");h(this,"actions",{addOne:tF,addMany:sF,setOne:iF,setMany:nF,updateOne:cF,updateMany:aF,deleteOne:rF,deleteMany:dF,initialize:eF});h(this,"selectors",{selectById:lF,selectByIds:oF})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...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 xM extends ot{constructor(){super(...arguments);h(this,"name","User");h(this,"url","/user");h(this,"actions",{addOne:en,addMany:My,setOne:gy,setMany:_y,updateOne:wy,updateMany:Ry,deleteOne:tn,deleteMany:vy,initialize:by});h(this,"selectors",{selectById:Xt,selectByIds:Vy})}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 rc(t,s,e,n,c){const r=n instanceof lt;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?mt.get(_.toString()).responseType("blob"):mt.get(_.toString()),[o.POST]:()=>{const q=mt.post(_.toString());return B(q)},[o.PATCH]:()=>{const q=mt.patch(_.toString());return B(q)},[o.PUT]:()=>{const q=mt.put(_.toString());return B(q)},[o.DELETE]:()=>{const q=mt.delete(_.toString());return B(q)}}[m];let z=D();const Ft=()=>{console.debug("aborting request:",s.url),z.abort()};if(c==null||c.addEventListener("abort",Ft),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=wF(q),cs=N==null?void 0:N.status;if(r&&cs===401)return await n.auth.handleUnauthorized(z,N),z.query(f);throw new U({response:N,innerError:q,discard:cc.includes(cs)})}finally{c==null||c.removeEventListener("abort",Ft)}}class eR{constructor(s){h(this,"store");this.store=s}_performRequest(s,e,n,c){const r=new rs,a={...e,uuid:e.uuid??at.v4()};return rc(s,a,this,n,c).then(u=>{r.resolve(u.body)}).catch(u=>{u instanceof Error?r.reject(u):r.reject(new Error((u??Tt).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(hf(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 JF.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 vF;function EF(t){vF=t}function Pt(){return vF}let BF;function VF(t){BF=t}function zF(){return BF}let dc=null;function ht(){const t=Pt();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(dc)return dc;const s=t.getState().offline.outbox,e=Ot._fromOutbox(s);return dc=e,e}const tR=(t,s)=>{const e=new s(t);return VF(e),EF(t),e};class sR{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 uc{constructor(){h(this,"next");this.next=null}then(s){return new sR(this).then(s)}async run(s){if(this.next)return this.next.run(s);{if(console.debug("Middleware finished. Performing request:",s.payload.url),!Pt())throw new Error("Client store not set");const n=zF();if(!n)throw new Error("Client SDK not set");return gF(s,n)}}}class DF extends uc{async run(s){return super.run(s)}}class jF extends uc{async run(s){return super.run(s)}}const qF=new DF().then(new jF).compile();function CF(t){var s;return(s=qF[0])==null?void 0:s.run(t)}var $F=(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))($F||{});i.ALL_MIDDLEWARE=qF,i.APIError=U,i.AgentService=zg,i.AssetAttachmentService=Dg,i.AssetCommentService=jg,i.AssetService=qg,i.AssetStatusType=fc,i.AssetTypeAttachmentService=Cg,i.AssetTypeFieldValuesAttachmentService=Lg,i.AssetTypeFieldValuesService=kg,i.AssetTypeFieldsAttachmentService=$g,i.AssetTypeFieldsService=Ug,i.AssetTypeIdentifierService=Ng,i.AssetTypeIdentifierValueService=Gg,i.AssetTypeService=Hg,i.AssetTypeStatusService=Wg,i.AttachmentModel=Sc,i.BaseApiService=lt,i.BaseModelApiService=ot,i.BaseOfflineFileModelApiService=j,i.BaseOfflineModelApiService=v,i.BaseSDK=eR,i.COMMON_AUTO_FIELDS=Rc,i.DEFAULT_ISSUE_PRIORITY=XF,i.DEFAULT_PAGE_SIZE=fF,i.DISCARD_HTTP_STATUSES=cc,i.DeferredPromise=rs,i.DocumentAttachmentService=Kg,i.DocumentService=Yg,i.EMPTY_ARRAY=mc,i.EMPTY_OBJECT=pc,i.EmailDomainsService=Zg,i.EmailVerificationService=Jg,i.FILE_MODEL_DEFAULT_PAGE_SIZE=SF,i.FileService=Xg,i.FormIdentifierService=Qg,i.FormIdentifierValueService=xg,i.FormRevisionAttachmentService=eM,i.FormRevisionService=tM,i.FormService=sM,i.FormSubmissionAttachmentService=iM,i.FormSubmissionService=nM,i.GeoImageService=cM,i.HttpMethod=o,i.IssueAssociationService=aM,i.IssueAttachmentService=rM,i.IssueCommentAttachmentService=dM,i.IssueCommentService=uM,i.IssuePriority=as,i.IssueService=lM,i.IssueStatusType=Ac,i.IssueTypeAttachmentService=oM,i.IssueTypeFieldValuesAttachmentService=pM,i.IssueTypeFieldValuesService=yM,i.IssueTypeFieldsAttachmentService=hM,i.IssueTypeFieldsService=mM,i.IssueTypeIdentifierService=fM,i.IssueTypeIdentifierValueService=SM,i.IssueTypeService=AM,i.IssueTypeStatusService=IM,i.IssueUpdateChange=$,i.IssueUpdateService=TM,i.JWTService=FM,i.MAX_SERVICE_BATCH_SIZE=k,i.OUTBOX_RETRY_DELAY=Oc,i.OfflineAnalyticsMiddleware=DF,i.OfflineMiddleware=uc,i.OrganizationAccessLevel=yc,i.OrganizationAccessService=bM,i.OrganizationService=_M,i.OutboxCoordinator=Ot,i.ProcdureInitiativeService=NM,i.ProcedureFieldValuesAttachmentService=YM,i.ProcedureFieldValuesService=ZM,i.ProcedureService=EM,i.ProcedureStepAssigneeService=BM,i.ProcedureStepCommentService=VM,i.ProcedureStepDefaultAssigneeService=zM,i.ProcedureStepDefaultReviewerService=DM,i.ProcedureStepEventService=jM,i.ProcedureStepEventType=Ic,i.ProcedureStepFieldValuesAttachmentService=$M,i.ProcedureStepFieldValuesReviewService=UM,i.ProcedureStepFieldValuesReviewType=Tc,i.ProcedureStepFieldValuesService=LM,i.ProcedureStepFieldsAttachmentService=qM,i.ProcedureStepFieldsService=CM,i.ProcedureStepReviewerService=kM,i.ProcedureStepService=GM,i.ProcedureTypeAttachmentService=HM,i.ProcedureTypeFieldsAttachmentService=WM,i.ProcedureTypeFieldsService=KM,i.ProcedureTypeService=JM,i.ProjectAccessService=gM,i.ProjectAttachmentService=MM,i.ProjectCommentService=RM,i.ProjectFileService=wM,i.ProjectService=vM,i.RESET_ORGANIZATION_STATE=F,i.RESET_PROJECT_STATE=V,i.RESET_STATE=T,i.RateLimitingMiddleware=jF,i.SelectorBuilder=Ib,i.TeamMembershipService=XM,i.TeamService=QM,i.UNKNOWN_ERROR_MESSAGE=Tt,i.UserService=xM,i.VERSION_REDUCER_KEY=_t,i.VerificationCodeType=$F,i._setLatestRetryTime=pf,i.addAsset=pa,i.addAssetAttachment=Lc,i.addAssetAttachments=fs,i.addAssetComment=ea,i.addAssetComments=jt,i.addAssetType=Sd,i.addAssetTypeAttachment=Ma,i.addAssetTypeAttachments=bs,i.addAssetTypeFieldValues=Mr,i.addAssetTypeFieldValuesAttachment=pr,i.addAssetTypeFieldValuesAttachments=Es,i.addAssetTypeFieldValuesMany=Rr,i.addAssetTypeFields=er,i.addAssetTypeFieldsAttachment=Ua,i.addAssetTypeFieldsAttachments=La,i.addAssetTypeFieldsMany=tr,i.addAssetTypeIdentifier=Lr,i.addAssetTypeIdentifierValue=td,i.addAssetTypeIdentifierValues=sd,i.addAssetTypeIdentifiers=kr,i.addAssetTypeStatus=wd,i.addAssetTypeStatuses=vd,i.addAssetTypes=Ad,i.addAssets=Os,i.addConversation=Dc,i.addConversations=Tb,i.addDocument=au,i.addDocumentAttachment=Wd,i.addDocumentAttachments=Kd,i.addDocuments=ru,i.addEmailDomain=Tu,i.addEmailDomains=Ou,i.addForm=Cl,i.addFormIdentifier=qu,i.addFormIdentifierValue=Xu,i.addFormIdentifierValues=Qu,i.addFormIdentifiers=Cu,i.addFormRevision=_l,i.addFormRevisionAttachment=ol,i.addFormRevisionAttachments=hl,i.addFormRevisions=ei,i.addFormSubmission=mo,i.addFormSubmissionAttachment=Ql,i.addFormSubmissionAttachments=ci,i.addFormSubmissions=oi,i.addForms=$l,i.addGeoImage=go,i.addGeoImages=Mo,i.addIssue=Uh,i.addIssueAssociation=ko,i.addIssueAssociations=yt,i.addIssueAttachment=eh,i.addIssueAttachments=Ai,i.addIssueComment=Mh,i.addIssueCommentAttachment=mh,i.addIssueCommentAttachments=ph,i.addIssueComments=Rh,i.addIssueType=kp,i.addIssueTypeAttachment=xh,i.addIssueTypeAttachments=em,i.addIssueTypeFieldValues=Mm,i.addIssueTypeFieldValuesAttachment=tp,i.addIssueTypeFieldValuesAttachments=Di,i.addIssueTypeFieldValuesMany=Rm,i.addIssueTypeFields=Lm,i.addIssueTypeFieldsAttachment=mm,i.addIssueTypeFieldsAttachments=pm,i.addIssueTypeFieldsMany=km,i.addIssueTypeIdentifier=pp,i.addIssueTypeIdentifierValue=Rp,i.addIssueTypeIdentifierValues=wp,i.addIssueTypeIdentifiers=yp,i.addIssueTypeStatus=sy,i.addIssueTypeStatuses=iy,i.addIssueTypes=Np,i.addIssueUpdate=Ki,i.addIssueUpdates=Yi,i.addIssues=gi,i.addOrganization=xy,i.addOrganizationAccess=jy,i.addOrganizationAccesses=qy,i.addOrganizations=Qy,i.addProcedure=YS,i.addProcedureFieldValues=hP,i.addProcedureFieldValuesAttachment=xO,i.addProcedureFieldValuesAttachments=Kn,i.addProcedureFieldValuesMany=mP,i.addProcedureInitiative=zS,i.addProcedureInitiatives=DS,i.addProcedureStep=eO,i.addProcedureStepAssignee=lA,i.addProcedureStepAssignees=oA,i.addProcedureStepComment=bA,i.addProcedureStepComments=_A,i.addProcedureStepDefaultAssignee=CA,i.addProcedureStepDefaultAssignees=$A,i.addProcedureStepDefaultReviewer=QA,i.addProcedureStepDefaultReviewers=xA,i.addProcedureStepEvent=hI,i.addProcedureStepEvents=mI,i.addProcedureStepFieldValues=oT,i.addProcedureStepFieldValuesAttachment=QI,i.addProcedureStepFieldValuesAttachments=vn,i.addProcedureStepFieldValuesMany=hT,i.addProcedureStepFieldValuesReview=_T,i.addProcedureStepFieldValuesReviews=Dn,i.addProcedureStepFields=$I,i.addProcedureStepFieldsAttachment=gI,i.addProcedureStepFieldsAttachments=bn,i.addProcedureStepFieldsMany=UI,i.addProcedureStepReviewer=CT,i.addProcedureStepReviewers=$T,i.addProcedureSteps=tO,i.addProcedureType=gP,i.addProcedureTypeAttachment=oO,i.addProcedureTypeAttachments=hO,i.addProcedureTypeFields=$O,i.addProcedureTypeFieldsAttachment=_O,i.addProcedureTypeFieldsAttachments=gO,i.addProcedureTypeFieldsMany=UO,i.addProcedureTypes=MP,i.addProcedures=At,i.addProject=FS,i.addProjectAccess=Af,i.addProjectAccesses=If,i.addProjectAttachment=Ef,i.addProjectAttachments=Bf,i.addProjectComment=Hf,i.addProjectComments=Wf,i.addProjectFile=rS,i.addProjectFiles=dS,i.addProjects=PS,i.addTeam=tF,i.addTeamMembership=LP,i.addTeamMemberships=kP,i.addTeams=sF,i.addUser=en,i.addUsers=My,i.agentsReducer=Cc,i.agentsSlice=ms,i.areArraysEqual=tb,i.assetAttachmentReducer=Xc,i.assetAttachmentSlice=ys,i.assetCommentReducer=oa,i.assetCommentSlice=Is,i.assetReducer=ba,i.assetSlice=Ts,i.assetTypeAttachmentReducer=qa,i.assetTypeAttachmentSlice=Fs,i.assetTypeFieldValuesAttachmentReducer=br,i.assetTypeFieldValuesAttachmentSlice=vs,i.assetTypeFieldValuesReducer=Cr,i.assetTypeFieldValuesSlice=zs,i.assetTypeFieldsAttachmentReducer=Xa,i.assetTypeFieldsAttachmentSlice=Ms,i.assetTypeFieldsReducer=or,i.assetTypeFieldsSlice=ws,i.assetTypeIdentifierReducer=Qr,i.assetTypeIdentifierSlice=Ds,i.assetTypeIdentifierValueReducer=hd,i.assetTypeIdentifierValueSlice=qs,i.assetTypeReducer=gd,i.assetTypeSlice=Cs,i.assetTypeStatusReducer=Ud,i.assetTypeStatusSlice=Us,i.assetTypeStatusSortFn=wc,i.authReducer=Nd,i.authSlice=kt,i.baseReducer=Ig,i.baseReducers=nc,i.clearTokens=$b,i.createModelAdapter=P,i.createOfflineAction=lf,i.createPayload=M,i.createSelectionAdapter=QF,i.deleteAsset=Sa,i.deleteAssetAttachment=Wc,i.deleteAssetAttachments=Ss,i.deleteAssetComment=ca,i.deleteAssetComments=qt,i.deleteAssetType=Od,i.deleteAssetTypeAttachment=Ba,i.deleteAssetTypeAttachments=_s,i.deleteAssetTypeFieldValues=Vr,i.deleteAssetTypeFieldValuesAttachment=Ir,i.deleteAssetTypeFieldValuesAttachments=Bs,i.deleteAssetTypeFieldValuesMany=zr,i.deleteAssetTypeFields=ar,i.deleteAssetTypeFieldsAttachment=Wa,i.deleteAssetTypeFieldsAttachments=Ka,i.deleteAssetTypeFieldsMany=rr,i.deleteAssetTypeIdentifier=Kr,i.deleteAssetTypeIdentifierValue=rd,i.deleteAssetTypeIdentifierValues=dd,i.deleteAssetTypeIdentifiers=Yr,i.deleteAssetTypeStatus=Dd,i.deleteAssetTypeStatuses=jd,i.deleteAssetTypes=Pd,i.deleteAssets=Ps,i.deleteConversation=Fb,i.deleteConversations=bb,i.deleteDocument=hu,i.deleteDocumentAttachment=Qd,i.deleteDocumentAttachments=xd,i.deleteDocuments=mu,i.deleteEmailDomain=gu,i.deleteEmailDomains=Mu,i.deleteForm=Gl,i.deleteFormIdentifier=Nu,i.deleteFormIdentifierValue=il,i.deleteFormIdentifierValues=nl,i.deleteFormIdentifiers=Gu,i.deleteFormRevision=vl,i.deleteFormRevisionAttachment=Sl,i.deleteFormRevisionAttachments=Al,i.deleteFormRevisions=ti,i.deleteFormSubmission=fo,i.deleteFormSubmissionAttachment=io,i.deleteFormSubmissionAttachments=ai,i.deleteFormSubmissions=hi,i.deleteForms=Hl,i.deleteGeoImage=vo,i.deleteGeoImages=Eo,i.deleteIssue=Hh,i.deleteIssueAssociation=No,i.deleteIssueAssociations=ft,i.deleteIssueAttachment=ch,i.deleteIssueAttachments=Ii,i.deleteIssueComment=Vh,i.deleteIssueCommentAttachment=Ih,i.deleteIssueCommentAttachments=Th,i.deleteIssueComments=zh,i.deleteIssueType=Yp,i.deleteIssueTypeAttachment=cm,i.deleteIssueTypeAttachments=am,i.deleteIssueTypeFieldValues=Vm,i.deleteIssueTypeFieldValuesAttachment=ap,i.deleteIssueTypeFieldValuesAttachments=ji,i.deleteIssueTypeFieldValuesMany=zm,i.deleteIssueTypeFields=Km,i.deleteIssueTypeFieldsAttachment=Im,i.deleteIssueTypeFieldsAttachments=Tm,i.deleteIssueTypeFieldsMany=Ym,i.deleteIssueTypeIdentifier=Tp,i.deleteIssueTypeIdentifierValue=zp,i.deleteIssueTypeIdentifierValues=Dp,i.deleteIssueTypeIdentifiers=Op,i.deleteIssueTypeStatus=dy,i.deleteIssueTypeStatuses=uy,i.deleteIssueTypes=Zp,i.deleteIssueUpdate=Zi,i.deleteIssueUpdates=Ji,i.deleteIssues=Mi,i.deleteOrganization=sf,i.deleteOrganizationAccess=ky,i.deleteOrganizationAccesses=Ny,i.deleteOrganizations=nf,i.deleteProcedure=xS,i.deleteProcedureFieldValues=AP,i.deleteProcedureFieldValuesAttachment=nP,i.deleteProcedureFieldValuesAttachments=Yn,i.deleteProcedureFieldValuesMany=IP,i.deleteProcedureInitiative=US,i.deleteProcedureInitiatives=LS,i.deleteProcedureStep=nO,i.deleteProcedureStepAssignee=fA,i.deleteProcedureStepAssignees=SA,i.deleteProcedureStepComment=vA,i.deleteProcedureStepComments=EA,i.deleteProcedureStepDefaultAssignee=GA,i.deleteProcedureStepDefaultAssignees=HA,i.deleteProcedureStepDefaultReviewer=nI,i.deleteProcedureStepDefaultReviewers=cI,i.deleteProcedureStepEvent=AI,i.deleteProcedureStepEvents=II,i.deleteProcedureStepFieldValues=ST,i.deleteProcedureStepFieldValuesAttachment=iT,i.deleteProcedureStepFieldValuesAttachments=En,i.deleteProcedureStepFieldValuesMany=AT,i.deleteProcedureStepFieldValuesReview=vT,i.deleteProcedureStepFieldValuesReviews=jn,i.deleteProcedureStepFields=HI,i.deleteProcedureStepFieldsAttachment=EI,i.deleteProcedureStepFieldsAttachments=_n,i.deleteProcedureStepFieldsMany=WI,i.deleteProcedureStepReviewer=GT,i.deleteProcedureStepReviewers=HT,i.deleteProcedureSteps=cO,i.deleteProcedureType=BP,i.deleteProcedureTypeAttachment=SO,i.deleteProcedureTypeAttachments=AO,i.deleteProcedureTypeFields=HO,i.deleteProcedureTypeFieldsAttachment=EO,i.deleteProcedureTypeFieldsAttachments=BO,i.deleteProcedureTypeFieldsMany=WO,i.deleteProcedureTypes=VP,i.deleteProcedures=It,i.deleteProject=gS,i.deleteProjectAccess=bf,i.deleteProjectAccesses=_f,i.deleteProjectAttachment=qf,i.deleteProjectAttachments=Cf,i.deleteProjectComment=Xf,i.deleteProjectComments=Qf,i.deleteProjectFile=oS,i.deleteProjectFiles=hS,i.deleteProjects=MS,i.deleteTeam=rF,i.deleteTeamMembership=KP,i.deleteTeamMemberships=YP,i.deleteTeams=dF,i.deleteUser=tn,i.deleteUsers=vy,i.dequeue=_F,i.discard=MF,i.documentAttachmentReducer=iu,i.documentAttachmentSlice=ks,i.documentSlice=Gs,i.documentsReducer=pu,i.downloadFile=ub,i.emailDomainsReducer=Eu,i.emailDomainsSlice=Ws,i.emailRegex=Sb,i.enqueue=bF,i.enqueueRequest=hf,i.extractResponseFromError=wF,i.fallbackToEmptyArray=S,i.fallbackToEmptyObject=ls,i.fetchBlobFromObjectUrl=bc,i.fetchFileFromObjectUrl=_c,i.fileReducer=zu,i.fileSlice=Ys,i.formIdentifierReducer=Yu,i.formIdentifierSlice=Zs,i.formIdentifierValueReducer=dl,i.formIdentifierValueSlice=Xs,i.formReducer=Wl,i.formRevisionAttachmentReducer=Pl,i.formRevisionAttachmentSlice=Qs,i.formRevisionReducer=Dl,i.formRevisionsSlice=xs,i.formSlice=si,i.formSubmissionAttachmentReducer=ro,i.formSubmissionAttachmentSlice=ni,i.formSubmissionReducer=Oo,i.formSubmissionSlice=li,i.geoImageReducer=Do,i.geoImageSlice=pi,i.getClientSDK=zF,i.getClientStore=Pt,i.getDocumentSubTree=Bc,i.getDocumentTrees=Ab,i.getFileExtension=Fc,i.getLocalDateString=Pc,i.getLocalRelativeDateString=cb,i.getOutboxCoordinator=ht,i.getRenamedFile=db,i.getRequestDescription=A,i.getS3FileKey=rb,i.hashFile=zt,i.initSDK=tR,i.initializeAssetAttachments=Uc,i.initializeAssetComments=xc,i.initializeAssetTypeAttachments=ga,i.initializeAssetTypeFieldValues=gr,i.initializeAssetTypeFieldValuesAttachments=mr,i.initializeAssetTypeFields=xa,i.initializeAssetTypeFieldsAttachments=$a,i.initializeAssetTypeIdentifierValues=ed,i.initializeAssetTypeIdentifiers=Ur,i.initializeAssetTypeStatuses=Rd,i.initializeAssetTypes=pd,i.initializeAssets=ma,i.initializeConversations=zc,i.initializeDocumentAttachments=Hd,i.initializeDocuments=cu,i.initializeEmailDomains=Iu,i.initializeFormIdentifierValues=Ju,i.initializeFormIdentifiers=ju,i.initializeFormRevisionAttachments=ll,i.initializeFormRevisions=bl,i.initializeFormSubmissionAttachments=Xl,i.initializeFormSubmissions=lo,i.initializeForms=ql,i.initializeGeoImages=Fo,i.initializeIssueAssociations=qo,i.initializeIssueAttachments=xo,i.initializeIssueCommentAttachments=hh,i.initializeIssueComments=gh,i.initializeIssueTypeAttachments=Qh,i.initializeIssueTypeFieldValues=gm,i.initializeIssueTypeFieldValuesAttachments=ep,i.initializeIssueTypeFields=Um,i.initializeIssueTypeFieldsAttachments=hm,i.initializeIssueTypeIdentifierValues=Mp,i.initializeIssueTypeIdentifiers=mp,i.initializeIssueTypeStatuses=ty,i.initializeIssueTypes=Lp,i.initializeIssueUpdates=py,i.initializeIssues=$h,i.initializeOrganizationAccesses=Dy,i.initializeOrganizations=Zy,i.initializeProcedureFieldValues=oP,i.initializeProcedureFieldValuesAttachments=QO,i.initializeProcedureInitiatives=VS,i.initializeProcedureStepAssignees=uA,i.initializeProcedureStepComments=FA,i.initializeProcedureStepDefaultAssignees=qA,i.initializeProcedureStepDefaultReviewers=XA,i.initializeProcedureStepEvents=oI,i.initializeProcedureStepFieldValues=lT,i.initializeProcedureStepFieldValuesAttachments=XI,i.initializeProcedureStepFieldValuesReviews=bT,i.initializeProcedureStepFields=CI,i.initializeProcedureStepFieldsAttachments=_I,i.initializeProcedureStepReviewers=qT,i.initializeProcedureSteps=XT,i.initializeProcedureTypeAttachments=lO,i.initializeProcedureTypeFields=CO,i.initializeProcedureTypeFieldsAttachments=bO,i.initializeProcedureTypes=_P,i.initializeProcedures=KS,i.initializeProjectAccesses=Sf,i.initializeProjectAttachments=vf,i.initializeProjectComments=Gf,i.initializeProjectFiles=nS,i.initializeProjects=IS,i.initializeTeamMemberships=UP,i.initializeTeams=eF,i.initializeUsers=by,i.isImageFile=lb,i.isObjectUrl=gc,i.isToday=nb,i.issueAssociationReducer=Xo,i.issueAssociationSlice=fi,i.issueAttachmentReducer=lh,i.issueAttachmentSlice=Si,i.issueCommentAttachmentReducer=bh,i.issueCommentAttachmentSlice=Oi,i.issueCommentReducer=qh,i.issueCommentSlice=Fi,i.issueReducer=Jh,i.issueSlice=_i,i.issueTypeAttachmentReducer=lm,i.issueTypeAttachmentSlice=Ri,i.issueTypeFieldValuesAttachmentReducer=op,i.issueTypeFieldValuesAttachmentSlice=zi,i.issueTypeFieldValuesReducer=Cm,i.issueTypeFieldValuesSlice=Bi,i.issueTypeFieldsAttachmentReducer=bm,i.issueTypeFieldsAttachmentSlice=vi,i.issueTypeFieldsReducer=Qm,i.issueTypeFieldsSlice=Vi,i.issueTypeIdentifierReducer=_p,i.issueTypeIdentifierSlice=Ci,i.issueTypeIdentifierValueReducer=$p,i.issueTypeIdentifierValueSlice=Ui,i.issueTypeReducer=xp,i.issueTypeSlice=Li,i.issueTypeStatusReducer=hy,i.issueTypeStatusSlice=Ni,i.issueTypeStatusSortFn=vc,i.issueUpdateReducer=Py,i.issueUpdateSlice=Wi,i.logOnlyOnce=ob,i.markAsDeleted=mf,i.markForDeletion=P_,i.memoize=us,i.organizationAccessReducer=Gy,i.organizationAccessSlice=nn,i.organizationReducer=uf,i.organizationSlice=cn,i.outboxReducer=yf,i.outboxSlice=an,i.overmapEnhancer=Rg,i.overmapReducer=Tg,i.overmapReducers=yF,i.performRequest=rc,i.performRequestFromAction=gF,i.procedureFieldValuesAttachmentReducer=cP,i.procedureFieldValuesAttachmentSlice=Wn,i.procedureFieldValuesReducer=TP,i.procedureFieldValuesSlice=Jn,i.procedureInitiativeReducer=kS,i.procedureInitiativeSlice=pn,i.procedureReducer=eA,i.procedureSlice=yn,i.procedureStepAssigneeReducer=OA,i.procedureStepAssigneeSlice=fn,i.procedureStepCommentReducer=DA,i.procedureStepCommentSlice=Sn,i.procedureStepDefaultAssigneeReducer=ZA,i.procedureStepDefaultAssigneeSlice=An,i.procedureStepDefaultReviewerReducer=uI,i.procedureStepDefaultReviewerSlice=Tn,i.procedureStepEventReducer=FI,i.procedureStepEventSlice=Pn,i.procedureStepFieldValuesAttachmentReducer=dT,i.procedureStepFieldValuesAttachmentSlice=wn,i.procedureStepFieldValuesReducer=IT,i.procedureStepFieldValuesReviewReducer=DT,i.procedureStepFieldValuesReviewSlice=zn,i.procedureStepFieldValuesSlice=Vn,i.procedureStepFieldsAttachmentReducer=jI,i.procedureStepFieldsAttachmentSlice=Fn,i.procedureStepFieldsReducer=ZI,i.procedureStepFieldsSlice=Mn,i.procedureStepReducer=aO,i.procedureStepReviewerReducer=ZT,i.procedureStepReviewerSlice=qn,i.procedureStepSlice=Cn,i.procedureTypeAttachmentReducer=IO,i.procedureTypeAttachmentSlice=Ln,i.procedureTypeFieldsAttachmentReducer=VO,i.procedureTypeFieldsAttachmentSlice=Nn,i.procedureTypeFieldsReducer=KO,i.procedureTypeFieldsSlice=Hn,i.procedureTypeReducer=zP,i.procedureTypeSlice=Qn,i.projectAccessReducer=gf,i.projectAccessSlice=rn,i.projectAttachmentReducer=kf,i.projectAttachmentSlice=un,i.projectCommentReducer=sS,i.projectCommentSlice=on,i.projectFileReducer=SS,i.projectFileSlice=hn,i.projectReducer=RS,i.projectSlice=mn,i.rehydratedReducer=CP,i.rehydratedSlice=ec,i.restructureSelectorWithArgs=y,i.runMiddleware=CF,i.selectAccessToken=Ub,i.selectAccessesByUserOfProject=b_,i.selectAccessibleProjects=w_,i.selectActiveOrganizationAccess=A_,i.selectAllDocumentAttachments=Ns,i.selectAssetAttachmentById=Yc,i.selectAssetAttachmentMapping=Kc,i.selectAssetAttachments=As,i.selectAssetAttachmentsByIds=Zc,i.selectAssetById=Pa,i.selectAssetCommentById=ra,i.selectAssetCommentMapping=aa,i.selectAssetComments=Ct,i.selectAssetCommentsByIds=da,i.selectAssetTypeAttachmentById=za,i.selectAssetTypeAttachmentMapping=Va,i.selectAssetTypeAttachments=gs,i.selectAssetTypeAttachmentsByIds=Da,i.selectAssetTypeById=bd,i.selectAssetTypeFieldValues=Ut,i.selectAssetTypeFieldValuesAttachmentById=Or,i.selectAssetTypeFieldValuesAttachments=Vs,i.selectAssetTypeFieldValuesAttachmentsByIds=Pr,i.selectAssetTypeFieldValuesAttachmentsMapping=Tr,i.selectAssetTypeFieldValuesById=jr,i.selectAssetTypeFieldValuesByIds=qr,i.selectAssetTypeFieldValuesMapping=Dr,i.selectAssetTypeFieldValuesOfAsset=Eb,i.selectAssetTypeFields=gt,i.selectAssetTypeFieldsAttachmentById=Za,i.selectAssetTypeFieldsAttachments=Rs,i.selectAssetTypeFieldsAttachmentsByIds=Ja,i.selectAssetTypeFieldsAttachmentsMapping=Ya,i.selectAssetTypeFieldsById=ur,i.selectAssetTypeFieldsByIds=lr,i.selectAssetTypeFieldsMapping=dr,i.selectAssetTypeFieldsOfAssetType=wb,i.selectAssetTypeIdentifierById=Jr,i.selectAssetTypeIdentifierMapping=Zr,i.selectAssetTypeIdentifierValueById=ld,i.selectAssetTypeIdentifierValueMapping=ud,i.selectAssetTypeIdentifierValues=Lt,i.selectAssetTypeIdentifierValuesByIds=od,i.selectAssetTypeIdentifierValuesOfAsset=zb,i.selectAssetTypeIdentifierValuesOfIdentifier=Db,i.selectAssetTypeIdentifiers=js,i.selectAssetTypeIdentifiersByIds=Xr,i.selectAssetTypeIdentifiersOfAssetType=Vb,i.selectAssetTypeStatusById=Cd,i.selectAssetTypeStatusMapping=qd,i.selectAssetTypeStatuses=Ls,i.selectAssetTypeStatusesByIds=$d,i.selectAssetTypeStatusesOfAssetType=qb,i.selectAssetTypeValuesOfAssetType=Bb,i.selectAssetTypes=$s,i.selectAssetTypesByIds=_d,i.selectAssetTypesMapping=Fd,i.selectAssetTypesOfOrganization=jb,i.selectAssets=$t,i.selectAssetsByIds=Fa,i.selectAssetsMapping=Ta,i.selectAssetsOfAssetType=Oa,i.selectAssetsOfProject=Mb,i.selectAttachmentsOfAsset=Jc,i.selectAttachmentsOfAssetType=ja,i.selectAttachmentsOfAssetTypeFieldValues=Fr,i.selectAttachmentsOfAssetTypeFields=Rb,i.selectAttachmentsOfDocument=kb,i.selectAttachmentsOfFormRevision=Qb,i.selectAttachmentsOfFormSubmission=ao,i.selectAttachmentsOfIssue=rh,i.selectAttachmentsOfIssueComment=s_,i.selectAttachmentsOfIssueType=c_,i.selectAttachmentsOfIssueTypeFieldValues=lp,i.selectAttachmentsOfIssueTypeFields=a_,i.selectAttachmentsOfProcedureFieldValues=uP,i.selectAttachmentsOfProcedureStepFieldValues=rT,i.selectAttachmentsOfProcedureStepFields=VI,i.selectAttachmentsOfProcedureType=ag,i.selectAttachmentsOfProcedureTypeFields=rg,i.selectAttachmentsOfProject=g_,i.selectCommentsOfAsset=ua,i.selectCommentsOfAssets=la,i.selectCommentsOfIssue=i_,i.selectCommentsOfProject=M_,i.selectCommentsOfProjects=R_,i.selectConversation=gb,i.selectConversationMapping=ps,i.selectConversations=_b,i.selectCurrentUser=By,i.selectDeletedRequests=T_,i.selectDescendantsOfDocument=Su,i.selectDocumentAttachmentById=tu,i.selectDocumentAttachmentMapping=eu,i.selectDocumentAttachmentsByIds=su,i.selectDocumentById=yu,i.selectDocuments=Nt,i.selectDocumentsByIds=fu,i.selectDocumentsMapping=Hs,i.selectEmailDomainById=wu,i.selectEmailDomains=Ks,i.selectEmailDomainsAsMapping=Ru,i.selectEmailDomainsByIds=vu,i.selectEmailDomainsOfOrganization=Hb,i.selectFieldValuesOfProcedure=lg,i.selectFormById=Yl,i.selectFormIdentifierById=Wu,i.selectFormIdentifierMapping=Hu,i.selectFormIdentifierValueById=al,i.selectFormIdentifierValueMapping=cl,i.selectFormIdentifierValues=Gt,i.selectFormIdentifierValuesByIds=rl,i.selectFormIdentifierValuesOfFormSubmission=Jb,i.selectFormIdentifierValuesOfIdentifier=Xb,i.selectFormIdentifiers=Js,i.selectFormIdentifiersByIds=Ku,i.selectFormIdentifiersOfForm=Zb,i.selectFormMapping=Kl,i.selectFormRevisionAttachmentById=Tl,i.selectFormRevisionAttachments=Il,i.selectFormRevisionAttachmentsByIds=Ol,i.selectFormRevisionAttachmentsMapping=Ht,i.selectFormRevisionById=Bl,i.selectFormRevisionMapping=El,i.selectFormRevisions=Wt,i.selectFormRevisionsByIds=Vl,i.selectFormRevisionsOfForm=zl,i.selectFormSubmissionAttachemntsByIds=ui,i.selectFormSubmissionAttachmentById=no,i.selectFormSubmissionAttachments=di,i.selectFormSubmissionAttachmentsByIds=co,i.selectFormSubmissionAttachmentsMapping=ri,i.selectFormSubmissionById=Ao,i.selectFormSubmissions=mi,i.selectFormSubmissionsByIds=Io,i.selectFormSubmissionsMapping=So,i.selectFormSubmissionsOfForm=To,i.selectForms=ii,i.selectFormsByIds=Zl,i.selectFormsOfOrganization=e_,i.selectGeoImageById=Vo,i.selectGeoImageMapping=Bo,i.selectGeoImages=yi,i.selectGeoImagesByIds=zo,i.selectGeoImagesOfProject=t_,i.selectIsLoggedIn=Lb,i.selectIssueAssociationById=Ho,i.selectIssueAssociationMapping=Go,i.selectIssueAssociations=St,i.selectIssueAssociationsByIds=Wo,i.selectIssueAssociationsOfAsset=Zo,i.selectIssueAssociationsOfAssets=Jo,i.selectIssueAssociationsOfIssue=Yo,i.selectIssueAssociationsOfIssues=Ko,i.selectIssueAttachmentById=dh,i.selectIssueAttachmentMapping=ah,i.selectIssueAttachments=Ti,i.selectIssueAttachmentsByIds=uh,i.selectIssueById=Kh,i.selectIssueCommentAttachmentById=Ph,i.selectIssueCommentAttachmentMapping=Oh,i.selectIssueCommentAttachments=Pi,i.selectIssueCommentAttachmentsByIds=Fh,i.selectIssueCommentById=Dh,i.selectIssueCommentMapping=bi,i.selectIssueCommentsByIds=jh,i.selectIssueMapping=Wh,i.selectIssueTypeAttachmentById=dm,i.selectIssueTypeAttachmentMapping=rm,i.selectIssueTypeAttachments=wi,i.selectIssueTypeAttachmentsByIds=um,i.selectIssueTypeById=Xp,i.selectIssueTypeFieldValues=Yt,i.selectIssueTypeFieldValuesAttachmentById=dp,i.selectIssueTypeFieldValuesAttachments=qi,i.selectIssueTypeFieldValuesAttachmentsByIds=up,i.selectIssueTypeFieldValuesAttachmentsMapping=rp,i.selectIssueTypeFieldValuesById=jm,i.selectIssueTypeFieldValuesByIds=qm,i.selectIssueTypeFieldValuesMapping=Dm,i.selectIssueTypeFieldValuesOfIssue=r_,i.selectIssueTypeFields=Mt,i.selectIssueTypeFieldsAttachmentById=Pm,i.selectIssueTypeFieldsAttachments=Ei,i.selectIssueTypeFieldsAttachmentsByIds=Fm,i.selectIssueTypeFieldsAttachmentsMapping=Om,i.selectIssueTypeFieldsById=Jm,i.selectIssueTypeFieldsByIds=Xm,i.selectIssueTypeFieldsMapping=Zm,i.selectIssueTypeFieldsOfIssueType=d_,i.selectIssueTypeIdentifierById=Fp,i.selectIssueTypeIdentifierMapping=Pp,i.selectIssueTypeIdentifierValueById=qp,i.selectIssueTypeIdentifierValueMapping=jp,i.selectIssueTypeIdentifierValues=Zt,i.selectIssueTypeIdentifierValuesByIds=Cp,i.selectIssueTypeIdentifierValuesOfIdentifier=m_,i.selectIssueTypeIdentifierValuesOfIssue=h_,i.selectIssueTypeIdentifiers=$i,i.selectIssueTypeIdentifiersByIds=bp,i.selectIssueTypeIdentifiersOfIssueType=o_,i.selectIssueTypeMapping=Jp,i.selectIssueTypeStatusById=Hi,i.selectIssueTypeStatusMapping=ly,i.selectIssueTypeStatuses=Gi,i.selectIssueTypeStatusesByIds=oy,i.selectIssueTypeStatusesOfIssueType=y_,i.selectIssueTypeValuesOfIssueType=l_,i.selectIssueTypes=ki,i.selectIssueTypesByIds=Qp,i.selectIssueTypesOfOrganization=p_,i.selectIssueUpdateById=Iy,i.selectIssueUpdateMapping=Xi,i.selectIssueUpdates=Qi,i.selectIssueUpdatesByIds=Ty,i.selectIssueUpdatesOfIssue=Oy,i.selectIssues=Kt,i.selectIssuesByIds=Yh,i.selectIssuesOfIssueType=Zh,i.selectIssuesOfProject=n_,i.selectLatestAssetTypeFieldsOfAssetType=vb,i.selectLatestFieldsByProcedureStep=K_,i.selectLatestFormRevisionOfForm=xb,i.selectLatestIssueTypeFieldsOfIssueType=u_,i.selectLatestProcedureStepFieldValuesReviewByProcedureStepFieldValues=eg,i.selectLatestProcedureStepFieldsOfProcedureStep=W_,i.selectLatestProcedureTypeFieldsOfProcedureType=ug,i.selectLatestRetryTime=O_,i.selectLatestReviewOfProcedureStepFieldValues=X_,i.selectMembershipsByUserOfTeam=yg,i.selectOrganizationAccessById=Hy,i.selectOrganizationAccessMapping=Qt,i.selectOrganizationAccessUserMapping=Ky,i.selectOrganizationAccessesByIds=Wy,i.selectOrganizationById=rf,i.selectOrganizationDocuments=Gb,i.selectOrganizations=af,i.selectOrganizationsByIds=df,i.selectOrganizationsMapping=cf,i.selectProcedureById=sA,i.selectProcedureFieldValues=Xn,i.selectProcedureFieldValuesAttachmentById=rP,i.selectProcedureFieldValuesAttachments=Zn,i.selectProcedureFieldValuesAttachmentsByIds=dP,i.selectProcedureFieldValuesAttachmentsMapping=aP,i.selectProcedureFieldValuesById=PP,i.selectProcedureFieldValuesByIds=FP,i.selectProcedureFieldValuesMapping=OP,i.selectProcedureInitiativeById=GS,i.selectProcedureInitiatives=ts,i.selectProcedureInitiativesByIds=HS,i.selectProcedureInitiativesMapping=NS,i.selectProcedureInitiativesOfProcedureType=B_,i.selectProcedureInitiativesOfProject=E_,i.selectProcedureStepAssigneeById=IA,i.selectProcedureStepAssignees=wt,i.selectProcedureStepAssigneesByIds=TA,i.selectProcedureStepAssigneesMapping=AA,i.selectProcedureStepAssigneesOfProcedure=z_,i.selectProcedureStepAssigneesOfProcedureAndProcedureStep=j_,i.selectProcedureStepAssigneesOfProcedureStep=D_,i.selectProcedureStepById=rO,i.selectProcedureStepCommentById=VA,i.selectProcedureStepComments=vt,i.selectProcedureStepCommentsByIds=zA,i.selectProcedureStepCommentsMapping=BA,i.selectProcedureStepCommentsOfProcedure=q_,i.selectProcedureStepCommentsOfProcedureAndProcedureStep=$_,i.selectProcedureStepCommentsOfProcedureStep=C_,i.selectProcedureStepDefaultAssigneeById=KA,i.selectProcedureStepDefaultAssignees=In,i.selectProcedureStepDefaultAssigneesByIds=YA,i.selectProcedureStepDefaultAssigneesMapping=WA,i.selectProcedureStepDefaultAssigneesOfProcedureStep=U_,i.selectProcedureStepDefaultReviewerById=rI,i.selectProcedureStepDefaultReviewers=On,i.selectProcedureStepDefaultReviewersByIds=dI,i.selectProcedureStepDefaultReviewersMapping=aI,i.selectProcedureStepDefaultReviewersOfProcedureStep=L_,i.selectProcedureStepEventById=OI,i.selectProcedureStepEvents=Et,i.selectProcedureStepEventsByIds=PI,i.selectProcedureStepEventsMapping=TI,i.selectProcedureStepEventsOfProcedure=k_,i.selectProcedureStepEventsOfProcedureAndProcedureStep=G_,i.selectProcedureStepEventsOfProcedureStep=N_,i.selectProcedureStepFieldValues=dt,i.selectProcedureStepFieldValuesAttachmentById=cT,i.selectProcedureStepFieldValuesAttachments=Bn,i.selectProcedureStepFieldValuesAttachmentsByIds=aT,i.selectProcedureStepFieldValuesAttachmentsMapping=nT,i.selectProcedureStepFieldValuesById=OT,i.selectProcedureStepFieldValuesByIds=PT,i.selectProcedureStepFieldValuesMapping=TT,i.selectProcedureStepFieldValuesOfProcedure=Y_,i.selectProcedureStepFieldValuesOfProcedureAndProcedureStep=J_,i.selectProcedureStepFieldValuesOfProcedureStep=Z_,i.selectProcedureStepFieldValuesReviewById=BT,i.selectProcedureStepFieldValuesReviews=ut,i.selectProcedureStepFieldValuesReviewsByIds=VT,i.selectProcedureStepFieldValuesReviewsMapping=ET,i.selectProcedureStepFieldValuesReviewsOfProcedure=Q_,i.selectProcedureStepFieldValuesReviewsOfProcedureAndProcedureStep=x_,i.selectProcedureStepFields=ss,i.selectProcedureStepFieldsAttachmentById=zI,i.selectProcedureStepFieldsAttachments=gn,i.selectProcedureStepFieldsAttachmentsByIds=DI,i.selectProcedureStepFieldsAttachmentsMapping=BI,i.selectProcedureStepFieldsById=KI,i.selectProcedureStepFieldsByIds=YI,i.selectProcedureStepFieldsMapping=Rn,i.selectProcedureStepFieldsOfProcedureStep=H_,i.selectProcedureStepReviewerById=KT,i.selectProcedureStepReviewers=Bt,i.selectProcedureStepReviewersByIds=YT,i.selectProcedureStepReviewersMapping=WT,i.selectProcedureStepReviewersOfProcedure=tg,i.selectProcedureStepReviewersOfProcedureAndProcedureStep=ig,i.selectProcedureStepReviewersOfProcedureStep=sg,i.selectProcedureSteps=Un,i.selectProcedureStepsByIds=dO,i.selectProcedureStepsMapping=$n,i.selectProcedureStepsMappingOfProcedureType=ng,i.selectProcedureStepsOfProcedureType=cg,i.selectProcedureTypeAttachmentById=OO,i.selectProcedureTypeAttachmentMapping=TO,i.selectProcedureTypeAttachments=kn,i.selectProcedureTypeAttachmentsByIds=PO,i.selectProcedureTypeById=jP,i.selectProcedureTypeFields=is,i.selectProcedureTypeFieldsAttachmentById=DO,i.selectProcedureTypeFieldsAttachments=Gn,i.selectProcedureTypeFieldsAttachmentsByIds=jO,i.selectProcedureTypeFieldsAttachmentsMapping=zO,i.selectProcedureTypeFieldsById=ZO,i.selectProcedureTypeFieldsByIds=JO,i.selectProcedureTypeFieldsMapping=YO,i.selectProcedureTypeFieldsOfProcedureType=dg,i.selectProcedureTypes=xn,i.selectProcedureTypesByIds=qP,i.selectProcedureTypesMapping=DP,i.selectProcedureTypesOfOrganization=og,i.selectProcedures=rt,i.selectProceduresByIds=iA,i.selectProceduresMapping=tA,i.selectProceduresOfAsset=cA,i.selectProceduresOfAssets=aA,i.selectProceduresOfProcedureInitiative=rA,i.selectProceduresOfProcedureType=nA,i.selectProceduresOfProject=V_,i.selectProjectAccessById=Mf,i.selectProjectAccessMapping=dn,i.selectProjectAccesses=Rt,i.selectProjectAccessesByIds=Rf,i.selectProjectAccessesOfProject=F_,i.selectProjectAttachmentById=Uf,i.selectProjectAttachmentMapping=$f,i.selectProjectAttachments=ln,i.selectProjectAttachmentsByIds=Lf,i.selectProjectById=vS,i.selectProjectCommentById=eS,i.selectProjectCommentMapping=xf,i.selectProjectComments=xt,i.selectProjectCommentsByIds=tS,i.selectProjectDocuments=Nb,i.selectProjectFileById=yS,i.selectProjectFileMapping=mS,i.selectProjectFiles=pS,i.selectProjectFilesByIds=fS,i.selectProjectMapping=wS,i.selectProjects=es,i.selectProjectsByIds=ES,i.selectProjectsOfOrganization=v_,i.selectRehydrated=pg,i.selectReviewsOfProcedureStepFieldValues=zT,i.selectTeamById=lF,i.selectTeamMembershipById=XP,i.selectTeamMemberships=ns,i.selectTeamMembershipsByIds=QP,i.selectTeamMembershipsMapping=JP,i.selectTeams=ic,i.selectTeamsByIds=oF,i.selectTeamsMapping=uF,i.selectTeamsOfOrganization=Sg,i.selectUploadUrl=Yb,i.selectUserById=Xt,i.selectUsers=Jt,i.selectUsersByIds=Vy,i.selectUsersMapping=sn,i.selectUsersOfOrganization=I_,i.selectUsersOfProject=__,i.selectUsersOfTeam=fg,i.setAsset=Aa,i.setAssetAttachment=kc,i.setAssetAttachments=Nc,i.setAssetComment=ta,i.setAssetComments=sa,i.setAssetType=yd,i.setAssetTypeAttachment=Ra,i.setAssetTypeAttachments=wa,i.setAssetTypeFieldValues=wr,i.setAssetTypeFieldValuesAttachment=yr,i.setAssetTypeFieldValuesAttachments=fr,i.setAssetTypeFieldValuesMany=vr,i.setAssetTypeFields=sr,i.setAssetTypeFieldsAttachment=ka,i.setAssetTypeFieldsAttachments=Na,i.setAssetTypeFieldsMany=ir,i.setAssetTypeIdentifier=Nr,i.setAssetTypeIdentifierValue=id,i.setAssetTypeIdentifierValues=nd,i.setAssetTypeIdentifiers=Gr,i.setAssetTypeStatus=Ed,i.setAssetTypeStatuses=Bd,i.setAssetTypes=fd,i.setAssets=Ia,i.setClientSDK=VF,i.setClientStore=EF,i.setConversation=jc,i.setConversations=Ob,i.setCurrentUser=f_,i.setCurrentUserProfile=S_,i.setDocument=du,i.setDocumentAttachment=Yd,i.setDocumentAttachments=Zd,i.setDocuments=uu,i.setEmailDomain=Pu,i.setEmailDomains=Fu,i.setForm=Ul,i.setFormIdentifier=$u,i.setFormIdentifierValue=xu,i.setFormIdentifierValues=el,i.setFormIdentifiers=Uu,i.setFormRevision=gl,i.setFormRevisionAttachment=ml,i.setFormRevisionAttachments=pl,i.setFormRevisions=Ml,i.setFormSubmission=oo,i.setFormSubmissionAttachment=xl,i.setFormSubmissionAttachments=eo,i.setFormSubmissions=ho,i.setForms=Ll,i.setGeoImage=bo,i.setGeoImages=_o,i.setIssue=Lh,i.setIssueAssociation=$o,i.setIssueAssociations=Co,i.setIssueAttachment=th,i.setIssueAttachments=sh,i.setIssueComment=wh,i.setIssueCommentAttachment=yh,i.setIssueCommentAttachments=fh,i.setIssueComments=vh,i.setIssueType=Gp,i.setIssueTypeAttachment=tm,i.setIssueTypeAttachments=sm,i.setIssueTypeFieldValues=wm,i.setIssueTypeFieldValuesAttachment=sp,i.setIssueTypeFieldValuesAttachments=ip,i.setIssueTypeFieldValuesMany=vm,i.setIssueTypeFields=Nm,i.setIssueTypeFieldsAttachment=ym,i.setIssueTypeFieldsAttachments=fm,i.setIssueTypeFieldsMany=Gm,i.setIssueTypeIdentifier=fp,i.setIssueTypeIdentifierValue=vp,i.setIssueTypeIdentifierValues=Ep,i.setIssueTypeIdentifiers=Sp,i.setIssueTypeStatus=ny,i.setIssueTypeStatuses=cy,i.setIssueTypes=Hp,i.setIssueUpdate=yy,i.setIssueUpdates=fy,i.setIssues=kh,i.setLoggedIn=kd,i.setOrganization=Xy,i.setOrganizationAccess=Cy,i.setOrganizationAccesses=$y,i.setOrganizations=Jy,i.setProcedure=ZS,i.setProcedureFieldValues=pP,i.setProcedureFieldValuesAttachment=eP,i.setProcedureFieldValuesAttachments=tP,i.setProcedureFieldValuesMany=yP,i.setProcedureInitiative=jS,i.setProcedureInitiatives=qS,i.setProcedureStep=QT,i.setProcedureStepAssignee=hA,i.setProcedureStepAssignees=mA,i.setProcedureStepComment=gA,i.setProcedureStepComments=MA,i.setProcedureStepDefaultAssignee=UA,i.setProcedureStepDefaultAssignees=LA,i.setProcedureStepDefaultReviewer=eI,i.setProcedureStepDefaultReviewers=tI,i.setProcedureStepEvent=pI,i.setProcedureStepEvents=yI,i.setProcedureStepFieldValues=mT,i.setProcedureStepFieldValuesAttachment=xI,i.setProcedureStepFieldValuesAttachments=eT,i.setProcedureStepFieldValuesMany=pT,i.setProcedureStepFieldValuesReview=gT,i.setProcedureStepFieldValuesReviews=MT,i.setProcedureStepFields=LI,i.setProcedureStepFieldsAttachment=MI,i.setProcedureStepFieldsAttachments=RI,i.setProcedureStepFieldsMany=kI,i.setProcedureStepReviewer=UT,i.setProcedureStepReviewers=LT,i.setProcedureSteps=xT,i.setProcedureType=RP,i.setProcedureTypeAttachment=mO,i.setProcedureTypeAttachments=pO,i.setProcedureTypeFields=LO,i.setProcedureTypeFieldsAttachment=MO,i.setProcedureTypeFieldsAttachments=RO,i.setProcedureTypeFieldsMany=kO,i.setProcedureTypes=wP,i.setProcedures=JS,i.setProject=OS,i.setProjectAccess=Tf,i.setProjectAccesses=Of,i.setProjectAttachment=Vf,i.setProjectAttachments=zf,i.setProjectComment=Kf,i.setProjectComments=Yf,i.setProjectFile=cS,i.setProjectFiles=aS,i.setProjects=TS,i.setRehydrated=mg,i.setTeam=iF,i.setTeamMembership=NP,i.setTeamMemberships=GP,i.setTeams=nF,i.setTokens=Cb,i.setUploadUrl=Kb,i.setUser=gy,i.setUsers=_y,i.shallowEqual=eb,i.slugify=yb,i.spacesToDashesLower=pb,i.submittedAtModelSortFn=pt,i.teamMembershipReducer=ZP,i.teamMembershipSlice=tc,i.teamReducer=hF,i.teamSlice=sc,i.toFileNameSafeString=mb,i.toUuidArray=E,i.toUuidIdRecord=hb,i.truncate=fb,i.updateAsset=ya,i.updateAssetAttachment=Gc,i.updateAssetAttachments=Hc,i.updateAssetComment=ia,i.updateAssetComments=na,i.updateAssetType=Id,i.updateAssetTypeAttachment=va,i.updateAssetTypeAttachments=Ea,i.updateAssetTypeFieldValues=Er,i.updateAssetTypeFieldValuesAttachment=Sr,i.updateAssetTypeFieldValuesAttachments=Ar,i.updateAssetTypeFieldValuesMany=Br,i.updateAssetTypeFields=nr,i.updateAssetTypeFieldsAttachment=Ga,i.updateAssetTypeFieldsAttachments=Ha,i.updateAssetTypeFieldsMany=cr,i.updateAssetTypeIdentifier=Hr,i.updateAssetTypeIdentifierValue=cd,i.updateAssetTypeIdentifierValues=ad,i.updateAssetTypeIdentifiers=Wr,i.updateAssetTypeStatus=Vd,i.updateAssetTypeStatuses=zd,i.updateAssetTypes=Td,i.updateAssets=fa,i.updateConversation=qc,i.updateConversations=Pb,i.updateDocument=lu,i.updateDocumentAttachment=Jd,i.updateDocumentAttachments=Xd,i.updateDocuments=ou,i.updateEmailDomain=bu,i.updateEmailDomains=_u,i.updateForm=kl,i.updateFormIdentifier=Lu,i.updateFormIdentifierValue=tl,i.updateFormIdentifierValues=sl,i.updateFormIdentifiers=ku,i.updateFormRevision=Rl,i.updateFormRevisionAttachment=yl,i.updateFormRevisionAttachments=fl,i.updateFormRevisions=wl,i.updateFormSubmission=po,i.updateFormSubmissionAttachment=to,i.updateFormSubmissionAttachments=so,i.updateFormSubmissions=yo,i.updateForms=Nl,i.updateGeoImage=Ro,i.updateGeoImages=wo,i.updateIssue=Nh,i.updateIssueAssociation=Uo,i.updateIssueAssociations=Lo,i.updateIssueAttachment=ih,i.updateIssueAttachments=nh,i.updateIssueComment=Eh,i.updateIssueCommentAttachment=Sh,i.updateIssueCommentAttachments=Ah,i.updateIssueComments=Bh,i.updateIssueType=Wp,i.updateIssueTypeAttachment=im,i.updateIssueTypeAttachments=nm,i.updateIssueTypeFieldValues=Em,i.updateIssueTypeFieldValuesAttachment=np,i.updateIssueTypeFieldValuesAttachments=cp,i.updateIssueTypeFieldValuesMany=Bm,i.updateIssueTypeFields=Hm,i.updateIssueTypeFieldsAttachment=Sm,i.updateIssueTypeFieldsAttachments=Am,i.updateIssueTypeFieldsMany=Wm,i.updateIssueTypeIdentifier=Ap,i.updateIssueTypeIdentifierValue=Bp,i.updateIssueTypeIdentifierValues=Vp,i.updateIssueTypeIdentifiers=Ip,i.updateIssueTypeStatus=ay,i.updateIssueTypeStatuses=ry,i.updateIssueTypes=Kp,i.updateIssueUpdate=Sy,i.updateIssueUpdates=Ay,i.updateIssues=Gh,i.updateOrganization=tf,i.updateOrganizationAccess=Uy,i.updateOrganizationAccesses=Ly,i.updateOrganizations=ef,i.updateProcedure=XS,i.updateProcedureFieldValues=fP,i.updateProcedureFieldValuesAttachment=sP,i.updateProcedureFieldValuesAttachments=iP,i.updateProcedureFieldValuesMany=SP,i.updateProcedureInitiative=CS,i.updateProcedureInitiatives=$S,i.updateProcedureStep=sO,i.updateProcedureStepAssignee=pA,i.updateProcedureStepAssignees=yA,i.updateProcedureStepComment=RA,i.updateProcedureStepComments=wA,i.updateProcedureStepDefaultAssignee=kA,i.updateProcedureStepDefaultAssignees=NA,i.updateProcedureStepDefaultReviewer=sI,i.updateProcedureStepDefaultReviewers=iI,i.updateProcedureStepEvent=fI,i.updateProcedureStepEvents=SI,i.updateProcedureStepFieldValues=yT,i.updateProcedureStepFieldValuesAttachment=tT,i.updateProcedureStepFieldValuesAttachments=sT,i.updateProcedureStepFieldValuesMany=fT,i.updateProcedureStepFieldValuesReview=RT,i.updateProcedureStepFieldValuesReviews=wT,i.updateProcedureStepFields=NI,i.updateProcedureStepFieldsAttachment=wI,i.updateProcedureStepFieldsAttachments=vI,i.updateProcedureStepFieldsMany=GI,i.updateProcedureStepReviewer=kT,i.updateProcedureStepReviewers=NT,i.updateProcedureSteps=iO,i.updateProcedureType=vP,i.updateProcedureTypeAttachment=yO,i.updateProcedureTypeAttachments=fO,i.updateProcedureTypeFields=NO,i.updateProcedureTypeFieldsAttachment=wO,i.updateProcedureTypeFieldsAttachments=vO,i.updateProcedureTypeFieldsMany=GO,i.updateProcedureTypes=EP,i.updateProcedures=QS,i.updateProject=_S,i.updateProjectAccess=Pf,i.updateProjectAccesses=Ff,i.updateProjectAttachment=Df,i.updateProjectAttachments=jf,i.updateProjectComment=Zf,i.updateProjectComments=Jf,i.updateProjectFile=uS,i.updateProjectFiles=lS,i.updateProjects=bS,i.updateTeam=cF,i.updateTeamMembership=HP,i.updateTeamMemberships=WP,i.updateTeams=aF,i.updateUser=wy,i.updateUsers=Ry,i.useSelectorBuilder=xF,i.userReducer=Ey,i.userSlice=xi,i.uuidObj=O,i.uuidObjSortFn=hs,i.uuidSortFn=Dt,i.versioningReducer=pF,i.versioningSlice=mF,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
|