@overmap-ai/core 1.0.78-procedures.0 → 1.0.78-procedures.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/overmap-core.js +5867 -5728
- package/dist/overmap-core.umd.cjs +6 -6
- package/dist/sdk/services/IssueUpdateService.d.ts +2 -0
- package/dist/sdk/services/ProcedureTypeAttachmentService.d.ts +30 -0
- package/dist/sdk/services/index.d.ts +1 -0
- package/dist/store/reducers.d.ts +3 -0
- package/dist/store/slices/assetProcedureSlice.d.ts +1 -0
- package/dist/store/slices/assetProcedureStepFieldValuesAttachmentSlice.d.ts +1 -0
- package/dist/store/slices/assetProcedureStepFieldValuesSlice.d.ts +1 -0
- package/dist/store/slices/assetProcedureStepFieldsAttachmentSlice.d.ts +1 -0
- package/dist/store/slices/assetProcedureStepFieldsSlice.d.ts +2 -0
- package/dist/store/slices/assetProcedureStepSlice.d.ts +1 -0
- package/dist/store/slices/assetProcedureTypeAttachmentSlice.d.ts +1 -0
- package/dist/store/slices/assetProcedureTypeFieldValuesAttachmentSlice.d.ts +1 -0
- package/dist/store/slices/assetProcedureTypeFieldValuesSlice.d.ts +1 -0
- package/dist/store/slices/assetProcedureTypeFieldsAttachmentSlice.d.ts +1 -0
- package/dist/store/slices/assetSlice.d.ts +1 -0
- package/dist/store/slices/assetStageCompletionSlice.d.ts +1 -0
- package/dist/store/slices/assetStageSlice.d.ts +1 -0
- package/dist/store/slices/assetTypeFieldValuesAttachmentSlice.d.ts +1 -0
- package/dist/store/slices/assetTypeFieldValuesSlice.d.ts +1 -0
- package/dist/store/slices/assetTypeFieldsAttachmentSlice.d.ts +1 -0
- package/dist/store/slices/assetTypeFieldsSlice.d.ts +1 -0
- package/dist/store/slices/assetTypeStatusSlice.d.ts +1 -0
- package/dist/store/slices/emailDomainsSlice.d.ts +1 -0
- package/dist/store/slices/formRevisionAttachmentSlice.d.ts +1 -0
- package/dist/store/slices/formRevisionSlice.d.ts +1 -0
- package/dist/store/slices/formSlice.d.ts +1 -0
- package/dist/store/slices/geoImageSlice.d.ts +1 -0
- package/dist/store/slices/index.d.ts +1 -0
- package/dist/store/slices/issueAssociationSlice.d.ts +1 -0
- package/dist/store/slices/issueTypeFieldValuesAttachmentSlice.d.ts +1 -0
- package/dist/store/slices/issueTypeFieldValuesSlice.d.ts +1 -0
- package/dist/store/slices/issueTypeFieldsAttachmentSlice.d.ts +1 -0
- package/dist/store/slices/issueTypeFieldsSlice.d.ts +1 -0
- package/dist/store/slices/issueTypeStatusSlice.d.ts +1 -0
- package/dist/store/slices/issueUpdateSlice.d.ts +3 -0
- package/dist/store/slices/organizationSlice.d.ts +1 -0
- package/dist/store/slices/procedureStepAssigneeSlice.d.ts +1 -0
- package/dist/store/slices/procedureStepCommentSlice.d.ts +1 -0
- package/dist/store/slices/procedureStepDefaultAssigneeSlice.d.ts +1 -0
- package/dist/store/slices/procedureStepDefaultReviewerSlice.d.ts +1 -0
- package/dist/store/slices/procedureStepEventSlice.d.ts +1 -0
- package/dist/store/slices/procedureStepFieldValuesAttachmentSlice.d.ts +1 -0
- package/dist/store/slices/procedureStepFieldValuesReviewRequestSlice.d.ts +1 -0
- package/dist/store/slices/procedureStepFieldValuesReviewSlice.d.ts +1 -0
- package/dist/store/slices/procedureStepFieldValuesSlice.d.ts +1 -0
- package/dist/store/slices/procedureStepFieldsAttachmentSlice.d.ts +1 -0
- package/dist/store/slices/procedureStepFieldsSlice.d.ts +2 -0
- package/dist/store/slices/procedureStepReviewerSlice.d.ts +1 -0
- package/dist/store/slices/procedureStepSlice.d.ts +1 -0
- package/dist/store/slices/procedureTypeAttachmentSlice.d.ts +127 -0
- package/dist/store/slices/procedureTypeFieldValuesAttachmentSlice.d.ts +1 -0
- package/dist/store/slices/procedureTypeFieldValuesSlice.d.ts +1 -0
- package/dist/store/slices/procedureTypeFieldsAttachmentSlice.d.ts +1 -0
- package/dist/store/slices/projectFileSlice.d.ts +1 -0
- package/dist/store/slices/projectSlice.d.ts +1 -0
- package/dist/store/slices/userSlice.d.ts +1 -0
- package/dist/store/slices/workflowIssueLinkSlice.d.ts +1 -0
- package/dist/store/slices/workflowStepAssigneeSlice.d.ts +1 -0
- package/dist/store/slices/workflowStepCommentSlice.d.ts +1 -0
- package/dist/store/slices/workflowStepDefaultAssigneeSlice.d.ts +1 -0
- package/dist/store/slices/workflowStepDefaultReviewerSlice.d.ts +1 -0
- package/dist/store/slices/workflowStepEventSlice.d.ts +1 -0
- package/dist/store/slices/workflowStepFieldValuesAttachmentSlice.d.ts +1 -0
- package/dist/store/slices/workflowStepFieldValuesReviewRequestSlice.d.ts +1 -0
- package/dist/store/slices/workflowStepFieldValuesReviewSlice.d.ts +1 -0
- package/dist/store/slices/workflowStepFieldValuesSlice.d.ts +1 -0
- package/dist/store/slices/workflowStepFieldsAttachmentSlice.d.ts +1 -0
- package/dist/store/slices/workflowStepFieldsSlice.d.ts +1 -0
- package/dist/store/slices/workflowStepReviewerSlice.d.ts +1 -0
- package/dist/typings/models/procedures.d.ts +7 -1
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
(function(i,U){typeof exports=="object"&&typeof module<"u"?U(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"],U):(i=typeof globalThis<"u"?globalThis:i||self,U(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,U,o,Lt,Bt,VV,kV,Js,Nt,BV,dr,DV,WV,Iq,Fq,zV,qV,jV){"use strict";var Tq=Object.defineProperty;var Oq=(i,U,o)=>U in i?Tq(i,U,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[U]=o;var p=(i,U,o)=>Oq(i,typeof U!="symbol"?U+"":U,o);var vV;const lr=Object.freeze([]),ur=Object.freeze({});var or=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))(or||{}),h=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(h||{}),hr=(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))(hr||{}),pr=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(pr||{}),Zs=(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))(Zs||{}),$=(t=>(t.STATUS="status",t.PRIORITY="priority",t.DESCRIPTION="description",t.TITLE="title",t.ASSIGNED_TO="assigned_to",t.DUE_DATE="due_date",t))($||{}),yr=(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))(yr||{}),Sr=(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[t.ADD_REVIEW_REQUEST=8]="ADD_REVIEW_REQUEST",t[t.REMOVE_REVIEW_REQUEST=10]="REMOVE_REVIEW_REQUEST",t))(Sr||{}),Ht=(t=>(t[t.ACTIVE=0]="ACTIVE",t[t.COMPLETED=2]="COMPLETED",t[t.CANCELLED=4]="CANCELLED",t))(Ht||{}),es=(t=>(t[t.APPROVED=0]="APPROVED",t[t.REJECTED=2]="REJECTED",t[t.CHANGES_REQUESTED=4]="CHANGES_REQUESTED",t))(es||{}),mr=(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[t.ADD_REVIEW_REQUEST=8]="ADD_REVIEW_REQUEST",t[t.REMOVE_REVIEW_REQUEST=10]="REMOVE_REVIEW_REQUEST",t))(mr||{}),fr=(t=>(t[t.APPROVED=0]="APPROVED",t[t.REJECTED=2]="REJECTED",t[t.CHANGES_REQUESTED=4]="CHANGES_REQUESTED",t))(fr||{});const $V=Zs.MEDIUM,Ar=6e4,CV=[es.APPROVED,es.REJECTED,es.CHANGES_REQUESTED],UV=[Ht.ACTIVE,Ht.COMPLETED,Ht.CANCELLED],LV=Ht.ACTIVE;function O(t){return{addOne:(y,S)=>{const f=t(S.payload);y.instances[f]=S.payload},addMany:(y,S)=>{for(const f of S.payload){const F=t(f);y.instances[F]=f}},setOne:(y,S)=>{const f=t(S.payload);y.instances[f]=S.payload},setMany:(y,S)=>{for(const f of S.payload){const F=t(f);y.instances[F]=f}},updateOne:(y,S)=>{const f=t(S.payload);y.instances[f]=S.payload},updateMany:(y,S)=>{for(const f of S.payload){const F=t(f);y.instances[F]=f}},deleteOne:(y,S)=>{delete y.instances[S.payload]},deleteMany:(y,S)=>{for(const f of S.payload)delete y.instances[f]},initialize:(y,S)=>{y.instances={};const f=new Set;for(const F of S.payload){const g=t(F);f.add(g),y.instances[g]=F}f.size!==S.payload.length&&console.warn("duplicate ids detected when initializing model instances.")}}}function NV(){return{initializeSelection:(l,u)=>{l.selection=Array.from(new Set(u.payload))},selectOne:(l,u)=>{new Set(l.selection).has(u.payload)||l.selection.push(u.payload)},selectMany:(l,u)=>{const y=new Set(l.selection);for(const S of u.payload)y.has(S)||y.add(S);l.selection=Array.from(y)},unselectOne:(l,u)=>{const y=new Set(l.selection);y.has(u.payload)&&(y.delete(u.payload),l.selection=Array.from(y))},unselectMany:(l,u)=>{const y=new Set(l.selection);for(const S of u.payload)y.has(S)&&y.delete(S);l.selection=Array.from(y)},toggleOne:(l,u)=>{const y=new Set(l.selection);y.has(u.payload)?y.delete(u.payload):y.add(u.payload),l.selection=Array.from(y)},toggleMany:(l,u)=>{const y=new Set(l.selection);for(const S of u.payload)y.has(S)?y.delete(S):y.add(S);l.selection=Array.from(y)},getInitialState:l=>({...l,selection:[]})}}const ts="versioning",T=o.createAction("RESET"),B=o.createAction("RESET_PROJECT_STATE"),I=o.createAction("RESET_ORGANIZATION_STATE");function HV(t,s){return VV.useMemo(t,s)}vV=Symbol.toStringTag;class Xs{constructor(){p(this,vV,"Promise");p(this,"_promise");p(this,"_resolve");p(this,"_reject");p(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 xs=!1;["true","1"].includes("".toLowerCase())&&(xs=!0);function GV(t,s){if(t===s)return!0;if(typeof t!=typeof s)return!1;const e=Object.keys(t),n=Object.keys(s),a=e.length;if(a!==n.length)return!1;for(let c=0;c<a;c++){const r=e[c];if(!Object.prototype.hasOwnProperty.call(s,r)||t[r]!==s[r])return!1}return!0}function ei(t){const s={};return function(){const e=Array.prototype.slice.call(arguments);return e in s?(xs&&console.debug(`Memoization debug: Using memorized return value for ${t.toString()}(`,e,")"),s[e]):(xs&&console.debug(`Memoization debug: Cache miss! Memoizing ${t.toString()}(`,e,")"),s[e]=t.apply(this,e))}}function KV(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 A=t=>t.length===0?lr:t,ss=t=>Object.keys(t).length===0?ur:t,wr=ei(t=>{if(!t)return"";const s=new Date(t),e=s.getFullYear()===ti.getFullYear(),n={day:"numeric",month:"short"};return e||(n.year="numeric"),s.toLocaleDateString([],n)}),YV=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),QV=1e3*86400,ti=new Date,JV=t=>new Date(t).toDateString()===ti.toDateString(),ZV=ei((t,s,e)=>{const n=Math.round((new Date(t).getTime()-ti.getTime())/QV);return n<s||n>e?wr(t):YV.format(n,"days")});function XV(t){return new Uint8Array(t).reduce((e,n)=>e+n.toString(16).padStart(2,"0"),"")}function Ps(t){return new Promise((s,e)=>{const n=new FileReader;n.onload=()=>{const a=n.result;if(!a){e(new Error("FileReader did not return a valid ArrayBuffer."));return}crypto.subtle.digest("SHA-1",a).then(c=>{const r=XV(c);s(r)})},n.readAsArrayBuffer(t)})}const xV=(t,s)=>`${t}${s?`.${s}`:""}`;function ek(t,s){return new File([t],s,{type:t.type})}function Pr(t){const s=t.name;return s.includes(".")?s.split(".").pop():""}const Tr=async t=>(await fetch(t)).blob(),Or=async(t,s)=>{const e=await Tr(t);return new File([e],s,{type:e.type})};function tk(t){const s=new Blob([t]);kV.saveAs(s,t.name)}function Ir(t){return typeof t=="string"&&t.startsWith("blob:")}function sk(t){return t.type.startsWith("image/")}const Fr={};function ik(t,s,e,...n){const a=Fr[t];let c=!1;a?a[s]||(a[s]=!0,c=!0):(Fr[t]={[s]:!0},c=!0),c&&console[e](...n)}const _r=["created_at","updated_at","index","revision"];function P(t){return{...t,uuid:Bt.v4()}}function nk(t){const s={};for(const e of t)s[e.uuid]=e;return s}function E(t){return t.map(({uuid:s})=>s)}function Ts(t,s){return t.localeCompare(s)}function si(t,s){return Ts(t.uuid,s.uuid)}function ak(t,s=void 0,e=255){let n=t.replace(/[^a-z0-9_\-.]/gi,"_").replace(/_{2,}/g,"_");if(!s){const c=t.split(".");c.length>1&&(s=c[c.length-1])}s&&!s.startsWith(".")&&(s="."+s);const a=s?s.length:0;return n.length+a>e&&(n=n.slice(0,e-a)+(s||"")),n}function ck(t){return t.toLowerCase().replace(" ","-")}function rk(t,s=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,s?"_":"-")}function dk(t,s){if(t.length<=s)return t;const e=t.slice(0,s-1);return e.slice(0,e.lastIndexOf(" "))+"…"}const lk=/^.+@.+\..+$/;function R(t){const s={...t};for(const e of[..._r,"created_by"])e in s&&delete s[e];return s}const gr=t=>{const s=t.toSorted((e,n)=>e.order-n.order);return Js(s,{id:e=>e.uuid,parentId:e=>e.parent,includeEmptyChildrenArray:!0,valueKey:!1})},uk=t=>{const{roots:s}=gr(t);return s.map(e=>new Nt.Tree(e))},Rr=(t,s)=>{const{nodes:e}=gr(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in asset procedure step tree.`);return new Nt.Tree(n)},br=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,Mr=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,vr=t=>Js(t,{id:s=>s.uuid,parentId:s=>s.parent_document,includeEmptyChildrenArray:!0,valueKey:!1}),ok=t=>{const{roots:s}=vr(t);return s.map(e=>new Nt.Tree(e))},Er=(t,s)=>{const{nodes:e}=vr(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in document tree.`);return new Nt.Tree(n)},Vr=t=>{const s=t.toSorted((e,n)=>e.order-n.order);return Js(s,{id:e=>e.uuid,parentId:e=>e.parent,includeEmptyChildrenArray:!0,valueKey:!1})},hk=t=>{const{roots:s}=Vr(t);return s.map(e=>new Nt.Tree(e))},kr=(t,s)=>{const{nodes:e}=Vr(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in procedure step tree.`);return new Nt.Tree(n)};class pk{constructor(s){p(this,"operations",[]);p(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(a=>a[s]===e)),this}exclude(s,e){return this.operations.push(n=>n.filter(a=>a[s]!==e)),this}orderBy(s){return this.operations.push(e=>[...e].sort((n,a)=>n[s]<=a[s]?1:-1)),this}reverse(){return this.operations.push(s=>[...s].reverse()),this}all(){return this.operations.push(s=>s),this}get(s,e){return o.createSelector([this.getData],n=>this.performOperations(n).find(a=>a[s]===e))}count(){return o.createSelector([this.getData],s=>this.performOperations(s).length)}first(){return o.createSelector([this.getData],s=>this.performOperations(s)[0])}last(){return o.createSelector([this.getData],s=>{const e=this.performOperations(s);return e[e.length-1]})}exists(){return o.createSelector([this.getData],s=>this.performOperations(s).length>0)}toSelector(){return o.createSelector([this.getData],s=>A(this.performOperations(s)))}}const m=t=>(...s)=>e=>t(e,...s),G=O(t=>t.uuid),Br={instances:{}},ii=o.createSlice({name:"agents",initialState:Br,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Br)),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:Dr,addConversation:Wr,addConversations:yk,setConversation:zr,setConversations:Sk,updateConversation:qr,updateConversations:mk,deleteConversation:fk,deleteConversations:Ak}=ii.actions,ni=t=>t.agentsReducer.instances,wk=o.createSelector([ni],t=>Object.values(t)),Pk=m(o.createSelector([ni,(t,s)=>s],(t,s)=>t[s])),jr=ii.reducer,K=O(t=>t.uuid),$r={instances:{}},ai=o.createSlice({name:"assetAttachments",initialState:$r,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,$r)),reducers:{initializeAssetAttachments:K.initialize,addAssetAttachment:K.addOne,addAssetAttachments:K.addMany,setAssetAttachment:K.setOne,setAssetAttachments:K.setMany,updateAssetAttachment:K.updateOne,updateAssetAttachments:K.updateMany,deleteAssetAttachment:K.deleteOne,deleteAssetAttachments:K.deleteMany}}),{initializeAssetAttachments:Cr,addAssetAttachment:Ur,addAssetAttachments:ci,setAssetAttachment:Lr,setAssetAttachments:Nr,updateAssetAttachment:Hr,updateAssetAttachments:Gr,deleteAssetAttachment:Kr,deleteAssetAttachments:ri}=ai.actions,Yr=t=>t.assetAttachmentReducer.instances,di=o.createSelector([Yr],t=>Object.values(t)),Qr=t=>s=>s.assetAttachmentReducer.instances[t],Jr=m(o.createSelector([di,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Zr=m(o.createSelector([di,(t,s)=>s],(t,s)=>A(t.filter(({asset:e})=>s===e)))),Xr=ai.reducer,Y=O(({uuid:t})=>t),xr={instances:{}},li=o.createSlice({name:"assetProcedureTypeAttachments",initialState:xr,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,xr)),reducers:{initializeAssetProcedureTypeAttachments:Y.initialize,addAssetProcedureTypeAttachment:Y.addOne,addAssetProcedureTypeAttachments:Y.addMany,setAssetProcedureTypeAttachment:Y.setOne,setAssetProcedureTypeAttachments:Y.setMany,updateAssetProcedureTypeAttachment:Y.updateOne,updateAssetProcedureTypeAttachments:Y.updateMany,deleteAssetProcedureTypeAttachment:Y.deleteOne,deleteAssetProcedureTypeAttachments:Y.deleteMany}}),{initializeAssetProcedureTypeAttachments:ed,addAssetProcedureTypeAttachment:td,addAssetProcedureTypeAttachments:sd,setAssetProcedureTypeAttachment:id,setAssetProcedureTypeAttachments:nd,updateAssetProcedureTypeAttachment:ad,updateAssetProcedureTypeAttachments:cd,deleteAssetProcedureTypeAttachment:rd,deleteAssetProcedureTypeAttachments:dd}=li.actions,ld=li.reducer,ud=t=>t.assetProcedureTypeAttachmentReducer.instances,ui=o.createSelector([ud],t=>Object.values(t)),od=t=>s=>s.assetProcedureTypeAttachmentReducer.instances[t],hd=m(o.createSelector([ui,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Tk=m(o.createSelector([ui,(t,s)=>s],(t,s)=>A(t.filter(({asset_procedure_type:e})=>s===e)))),Q=O(({uuid:t})=>t),pd={instances:{}},oi=o.createSlice({name:"assetProcedureTypeFieldsAttachments",initialState:pd,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,pd)),reducers:{initializeAssetProcedureTypeFieldsAttachments:Q.initialize,addAssetProcedureTypeFieldsAttachment:Q.addOne,addAssetProcedureTypeFieldsAttachments:Q.addMany,setAssetProcedureTypeFieldsAttachment:Q.setOne,setAssetProcedureTypeFieldsAttachments:Q.setMany,updateAssetProcedureTypeFieldsAttachment:Q.updateOne,updateAssetProcedureTypeFieldsAttachments:Q.updateMany,deleteAssetProcedureTypeFieldsAttachment:Q.deleteOne,deleteAssetProcedureTypeFieldsAttachments:Q.deleteMany}}),{initializeAssetProcedureTypeFieldsAttachments:yd,addAssetProcedureTypeFieldsAttachment:Sd,addAssetProcedureTypeFieldsAttachments:md,setAssetProcedureTypeFieldsAttachment:fd,setAssetProcedureTypeFieldsAttachments:Ad,updateAssetProcedureTypeFieldsAttachment:wd,updateAssetProcedureTypeFieldsAttachments:Pd,deleteAssetProcedureTypeFieldsAttachment:Td,deleteAssetProcedureTypeFieldsAttachments:Od}=oi.actions,Id=oi.reducer,Fd=t=>t.assetProcedureTypeFieldsAttachmentReducer.instances,hi=o.createSelector([Fd],t=>Object.values(t)),Ok=m(o.createSelector([hi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),_d=t=>s=>s.assetProcedureTypeFieldsAttachmentReducer.instances[t],gd=m(o.createSelector([hi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),J=O(({uuid:t})=>t),Rd={instances:{}},pi=o.createSlice({name:"assetProcedureTypeFields",initialState:Rd,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Rd)),reducers:{initializeAssetProcedureTypeFields:J.initialize,addAssetProcedureTypeFields:J.addOne,addAssetProcedureTypeFieldsMany:J.addMany,setAssetProcedureTypeFields:J.setOne,setAssetProcedureTypeFieldsMany:J.setMany,updateAssetProcedureTypeFields:J.updateOne,updateAssetProcedureTypeFieldsMany:J.updateMany,deleteAssetProcedureTypeFields:J.deleteOne,deleteAssetProcedureTypeFieldsMany:J.deleteMany}}),{initializeAssetProcedureTypeFields:bd,addAssetProcedureTypeFields:Md,addAssetProcedureTypeFieldsMany:vd,setAssetProcedureTypeFields:Ed,setAssetProcedureTypeFieldsMany:Vd,updateAssetProcedureTypeFields:kd,updateAssetProcedureTypeFieldsMany:Bd,deleteAssetProcedureTypeFields:Dd,deleteAssetProcedureTypeFieldsMany:Wd}=pi.actions,zd=pi.reducer,qd=t=>t.assetProcedureTypeFieldsReducer.instances,Os=o.createSelector([qd],t=>Object.values(t)),Ik=m(o.createSelector([Os,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),Fk=m(o.createSelector([Os,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_procedure_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),jd=t=>s=>s.assetProcedureTypeFieldsReducer.instances[t],$d=m(o.createSelector([Os,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Z=O(({uuid:t})=>t),Cd={instances:{}},yi=o.createSlice({name:"assetProcedureTypeFieldValuesAttachments",initialState:Cd,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Cd)),reducers:{initializeAssetProcedureTypeFieldValuesAttachments:Z.initialize,addAssetProcedureTypeFieldValuesAttachment:Z.addOne,addAssetProcedureTypeFieldValuesAttachments:Z.addMany,setAssetProcedureTypeFieldValuesAttachment:Z.setOne,setAssetProcedureTypeFieldValuesAttachments:Z.setMany,updateAssetProcedureTypeFieldValuesAttachment:Z.updateOne,updateAssetProcedureTypeFieldValuesAttachments:Z.updateMany,deleteAssetProcedureTypeFieldValuesAttachment:Z.deleteOne,deleteAssetProcedureTypeFieldValuesAttachments:Z.deleteMany}}),{initializeAssetProcedureTypeFieldValuesAttachments:Ud,addAssetProcedureTypeFieldValuesAttachment:Ld,addAssetProcedureTypeFieldValuesAttachments:Si,setAssetProcedureTypeFieldValuesAttachment:Nd,setAssetProcedureTypeFieldValuesAttachments:Hd,updateAssetProcedureTypeFieldValuesAttachment:Gd,updateAssetProcedureTypeFieldValuesAttachments:Kd,deleteAssetProcedureTypeFieldValuesAttachment:Yd,deleteAssetProcedureTypeFieldValuesAttachments:mi}=yi.actions,Qd=yi.reducer,Jd=t=>t.assetProcedureTypeFieldValuesAttachmentReducer.instances,fi=o.createSelector([Jd],t=>Object.values(t)),Zd=t=>s=>s.assetProcedureTypeFieldValuesAttachmentReducer.instances[t],Xd=m(o.createSelector([fi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),xd=m(o.createSelector([fi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),X=O(({uuid:t})=>t),el={instances:{}},Ai=o.createSlice({name:"assetProcedureTypeFieldValues",initialState:el,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,el)),reducers:{initializeAssetProcedureTypeFieldValues:X.initialize,addAssetProcedureTypeFieldValues:X.addOne,addAssetProcedureTypeFieldValuesMany:X.addMany,setAssetProcedureTypeFieldValues:X.setOne,setAssetProcedureTypeFieldValuesMany:X.setMany,updateAssetProcedureTypeFieldValues:X.updateOne,updateAssetProcedureTypeFieldValuesMany:X.updateMany,deleteAssetProcedureTypeFieldValues:X.deleteOne,deleteAssetProcedureTypeFieldValuesMany:X.deleteMany}}),{initializeAssetProcedureTypeFieldValues:tl,addAssetProcedureTypeFieldValues:sl,addAssetProcedureTypeFieldValuesMany:il,setAssetProcedureTypeFieldValues:nl,setAssetProcedureTypeFieldValuesMany:al,updateAssetProcedureTypeFieldValues:cl,updateAssetProcedureTypeFieldValuesMany:rl,deleteAssetProcedureTypeFieldValues:dl,deleteAssetProcedureTypeFieldValuesMany:ll}=Ai.actions,ul=Ai.reducer,ol=t=>t.assetProcedureTypeFieldValuesReducer.instances,Is=o.createSelector([ol],t=>Object.values(t)),_k=m(o.createSelector([Is,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),gk=m(o.createSelector([Is,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure===s)))),hl=t=>s=>s.assetProcedureTypeFieldValuesReducer.instances[t],pl=m(o.createSelector([Is,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),x=O(({uuid:t})=>t),yl={instances:{}},wi=o.createSlice({name:"assetProcedures",initialState:yl,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,yl)),reducers:{initializeAssetProcedures:x.initialize,addAssetProcedure:x.addOne,addAssetProcedures:x.addMany,setAssetProcedure:x.setOne,setAssetProcedures:x.setMany,updateAssetProcedure:x.updateOne,updateAssetProcedures:x.updateMany,deleteAssetProcedure:x.deleteOne,deleteAssetProcedures:x.deleteMany}}),{initializeAssetProcedures:Sl,addAssetProcedure:ml,addAssetProcedures:Pi,updateAssetProcedure:fl,updateAssetProcedures:Al,deleteAssetProcedure:wl,deleteAssetProcedures:Ti,setAssetProcedure:Pl,setAssetProcedures:Tl}=wi.actions,Ol=wi.reducer,Il=t=>t.assetProcedureReducer.instances,Fs=o.createSelector([Il],t=>Object.values(t)),Fl=m(o.createSelector([Fs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),Rk=m(o.createSelector([Fs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),_l=t=>s=>s.assetProcedureReducer.instances[t],gl=m(o.createSelector([Fs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ee=O(t=>t.uuid),Rl={instances:{}},Oi=o.createSlice({name:"assetProcedureTypes",initialState:Rl,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Rl)),reducers:{initializeAssetProcedureTypes:ee.initialize,addAssetProcedureType:ee.addOne,addAssetProcedureTypes:ee.addMany,setAssetProcedureType:ee.setOne,setAssetProcedureTypes:ee.setMany,updateAssetProcedureType:ee.updateOne,updateAssetProcedureTypes:ee.updateMany,deleteAssetProcedureType:ee.deleteOne,deleteAssetProcedureTypes:ee.deleteMany}}),{initializeAssetProcedureTypes:bl,addAssetProcedureType:Ml,addAssetProcedureTypes:vl,updateAssetProcedureType:El,updateAssetProcedureTypes:Vl,deleteAssetProcedureType:kl,deleteAssetProcedureTypes:Bl,setAssetProcedureType:Dl,setAssetProcedureTypes:Wl}=Oi.actions,zl=Oi.reducer,ql=t=>t.assetProcedureTypeReducer.instances,Ii=o.createSelector([ql],t=>Object.values(t)),jl=t=>s=>s.assetProcedureTypeReducer.instances[t],$l=m(o.createSelector([Ii,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),bk=m(o.createSelector([Ii,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),te=O(t=>t.uuid),Cl={instances:{}},Fi=o.createSlice({name:"assetProcedureStepFieldsAttachments",initialState:Cl,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Cl)),reducers:{initializeAssetProcedureStepFieldsAttachments:te.initialize,addAssetProcedureStepFieldsAttachment:te.addOne,addAssetProcedureStepFieldsAttachments:te.addMany,setAssetProcedureStepFieldsAttachment:te.setOne,setAssetProcedureStepFieldsAttachments:te.setMany,updateAssetProcedureStepFieldsAttachment:te.updateOne,updateAssetProcedureStepFieldsAttachments:te.updateMany,deleteAssetProcedureStepFieldsAttachment:te.deleteOne,deleteAssetProcedureStepFieldsAttachments:te.deleteMany}}),{initializeAssetProcedureStepFieldsAttachments:Ul,addAssetProcedureStepFieldsAttachment:Ll,addAssetProcedureStepFieldsAttachments:Nl,setAssetProcedureStepFieldsAttachment:Hl,setAssetProcedureStepFieldsAttachments:Gl,updateAssetProcedureStepFieldsAttachment:Kl,updateAssetProcedureStepFieldsAttachments:Yl,deleteAssetProcedureStepFieldsAttachment:Ql,deleteAssetProcedureStepFieldsAttachments:Jl}=Fi.actions,Zl=t=>t.assetProcedureStepFieldsAttachmentReducer.instances,_i=o.createSelector([Zl],t=>Object.values(t)),Mk=m(o.createSelector([_i,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),Xl=t=>s=>s.assetProcedureStepFieldsAttachmentReducer.instances[t],xl=m(o.createSelector([_i,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),eu=Fi.reducer,se=O(t=>t.uuid),tu={instances:{}},gi=o.createSlice({name:"assetProcedureStepFields",initialState:tu,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,tu)),reducers:{initializeAssetProcedureStepFields:se.initialize,addAssetProcedureStepFields:se.addOne,addAssetProcedureStepFieldsMany:se.addMany,setAssetProcedureStepFields:se.setOne,setAssetProcedureStepFieldsMany:se.setMany,updateAssetProcedureStepFields:se.updateOne,updateAssetProcedureStepFieldsMany:se.updateMany,deleteAssetProcedureStepFields:se.deleteOne,deleteAssetProcedureStepFieldsMany:se.deleteMany}}),{initializeAssetProcedureStepFields:su,addAssetProcedureStepFields:iu,addAssetProcedureStepFieldsMany:nu,setAssetProcedureStepFields:au,setAssetProcedureStepFieldsMany:cu,updateAssetProcedureStepFields:ru,updateAssetProcedureStepFieldsMany:du,deleteAssetProcedureStepFields:lu,deleteAssetProcedureStepFieldsMany:uu}=gi.actions,Ri=t=>t.assetProcedureStepFieldsReducer.instances,_s=o.createSelector([Ri],t=>Object.values(t)),vk=m(o.createSelector([_s,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_step===s)))),Ek=m(o.createSelector([_s,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_procedure_step===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Vk=o.createSelector([Ri],t=>{const s={};for(const e of Object.values(t)){const n=s[e.asset_procedure_step];(!n||n.submitted_at<e.submitted_at)&&(s[e.asset_procedure_step]=e)}return s}),ou=t=>s=>s.assetProcedureStepFieldsReducer.instances[t],hu=m(o.createSelector([_s,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),pu=gi.reducer,ie=O(t=>t.uuid),yu={instances:{}},bi=o.createSlice({name:"assetProcedureStepFieldValuesAttachments",initialState:yu,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,yu)),reducers:{initializeAssetProcedureStepFieldValuesAttachments:ie.initialize,addAssetProcedureStepFieldValuesAttachment:ie.addOne,addAssetProcedureStepFieldValuesAttachments:ie.addMany,setAssetProcedureStepFieldValuesAttachment:ie.setOne,setAssetProcedureStepFieldValuesAttachments:ie.setMany,updateAssetProcedureStepFieldValuesAttachment:ie.updateOne,updateAssetProcedureStepFieldValuesAttachments:ie.updateMany,deleteAssetProcedureStepFieldValuesAttachment:ie.deleteOne,deleteAssetProcedureStepFieldValuesAttachments:ie.deleteMany}}),{initializeAssetProcedureStepFieldValuesAttachments:Su,addAssetProcedureStepFieldValuesAttachment:mu,addAssetProcedureStepFieldValuesAttachments:Mi,setAssetProcedureStepFieldValuesAttachment:fu,setAssetProcedureStepFieldValuesAttachments:Au,updateAssetProcedureStepFieldValuesAttachment:wu,updateAssetProcedureStepFieldValuesAttachments:Pu,deleteAssetProcedureStepFieldValuesAttachment:Tu,deleteAssetProcedureStepFieldValuesAttachments:vi}=bi.actions,Ou=t=>t.assetProcedureStepFieldValuesAttachmentReducer.instances,Ei=o.createSelector([Ou],t=>Object.values(t)),Iu=t=>s=>s.assetProcedureStepFieldValuesAttachmentReducer.instances[t],Fu=m(o.createSelector([Ei,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),_u=m(o.createSelector([Ei,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),gu=bi.reducer,ne=O(t=>t.uuid),Ru={instances:{}},Vi=o.createSlice({name:"assetProcedureStepFieldValues",initialState:Ru,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Ru)),reducers:{initializeAssetProcedureStepFieldValues:ne.initialize,addAssetProcedureStepFieldValues:ne.addOne,addAssetProcedureStepFieldValuesMany:ne.addMany,setAssetProcedureStepFieldValues:ne.setOne,setAssetProcedureStepFieldValuesMany:ne.setMany,updateAssetProcedureStepFieldValues:ne.updateOne,updateAssetProcedureStepFieldValuesMany:ne.updateMany,deleteAssetProcedureStepFieldValues:ne.deleteOne,deleteAssetProcedureStepFieldValuesMany:ne.deleteMany}}),{initializeAssetProcedureStepFieldValues:bu,addAssetProcedureStepFieldValues:Mu,addAssetProcedureStepFieldValuesMany:vu,setAssetProcedureStepFieldValues:Eu,setAssetProcedureStepFieldValuesMany:Vu,updateAssetProcedureStepFieldValues:ku,updateAssetProcedureStepFieldValuesMany:Bu,deleteAssetProcedureStepFieldValues:Du,deleteAssetProcedureStepFieldValuesMany:Wu}=Vi.actions,zu=t=>t.assetProcedureStepFieldValuesReducer.instances,is=o.createSelector([zu],t=>Object.values(t)),kk=m(o.createSelector([is,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),Bk=m(o.createSelector([is,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure===s)))),Dk=m(o.createSelector([is,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_step===s)))),qu=t=>s=>s.assetProcedureStepFieldValuesReducer.instances[t],ju=m(o.createSelector([is,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),$u=Vi.reducer,ae=O(t=>t.uuid),Cu={instances:{}},ki=o.createSlice({name:"assetProcedureSteps",initialState:Cu,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Cu)),reducers:{initializeAssetProcedureSteps:ae.initialize,setAssetProcedureStep:ae.setOne,setAssetProcedureSteps:ae.setMany,addAssetProcedureStep:ae.addOne,addAssetProcedureSteps:ae.addMany,updateAssetProcedureStep:ae.updateOne,updateAssetProcedureSteps:ae.updateMany,deleteAssetProcedureStep:ae.deleteOne,deleteAssetProcedureSteps:ae.deleteMany}}),{initializeAssetProcedureSteps:Uu,setAssetProcedureStep:Lu,setAssetProcedureSteps:Nu,addAssetProcedureStep:Hu,addAssetProcedureSteps:Gu,updateAssetProcedureStep:Ku,updateAssetProcedureSteps:Yu,deleteAssetProcedureStep:Qu,deleteAssetProcedureSteps:Ju}=ki.actions,Zu=ki.reducer,gs=t=>t.assetProcedureStepReducer.instances,Xu=t=>s=>s.assetProcedureStepReducer.instances[t],Bi=o.createSelector([gs],t=>Object.values(t)),Wk=m(o.createSelector([gs,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return ss(e)})),zk=m(o.createSelector([Bi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),xu=m(o.createSelector([Bi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),eo=m(o.createSelector([gs,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=Rr(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),ce=O(t=>t.uuid),to={instances:{}},Di=o.createSlice({name:"assets",initialState:to,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,to)),reducers:{initializeAssets:ce.initialize,addAsset:ce.addOne,addAssets:ce.addMany,setAsset:ce.setOne,setAssets:ce.setMany,updateAsset:ce.updateOne,updateAssets:ce.updateMany,deleteAsset:ce.deleteOne,deleteAssets:ce.deleteMany}}),{initializeAssets:so,addAsset:io,addAssets:Wi,updateAsset:no,updateAssets:ao,deleteAsset:co,deleteAssets:zi,setAsset:ro,setAssets:lo}=Di.actions,uo=t=>t.assetReducer.instances,Rs=o.createSelector([uo],t=>A(Object.values(t))),qk=m(o.createSelector([Rs,(t,s)=>s],(t,s)=>A(t.filter(({project:e})=>e===s)))),oo=m(o.createSelector([Rs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),ho=t=>s=>s.assetReducer.instances[t],po=m(o.createSelector([Rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yo=Di.reducer,re=O(t=>t.uuid),So={instances:{}},qi=o.createSlice({name:"assetStageCompletions",initialState:So,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,So)),reducers:{initializeAssetStageCompletions:re.initialize,addAssetStageCompletion:re.addOne,addAssetStageCompletions:re.addMany,setAssetStageCompletion:re.setOne,setAssetStageCompletions:re.setMany,updateAssetStageCompletion:re.updateOne,updateAssetStageCompletions:re.updateMany,deleteAssetStageCompletion:re.deleteOne,deleteAssetStageCompletions:re.deleteMany}}),{initializeAssetStageCompletions:mo,addAssetStageCompletion:fo,addAssetStageCompletions:Ao,setAssetStageCompletion:wo,setAssetStageCompletions:Po,updateAssetStageCompletion:To,updateAssetStageCompletions:Oo,deleteAssetStageCompletion:Io,deleteAssetStageCompletions:Fo}=qi.actions,_o=qi.reducer,go=t=>t.assetStageCompletionReducer.instances,Ro=o.createSelector([go],t=>Object.values(t)),bo=t=>s=>s.assetStageCompletionReducer.instances[t],Mo=m(o.createSelector([Ro,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),de=O(t=>t.uuid),vo={instances:{}},ji=o.createSlice({name:"assetStages",initialState:vo,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,vo)),reducers:{initializeAssetStages:de.initialize,setAssetStage:de.setOne,setAssetStages:de.setMany,addAssetStage:de.addOne,addAssetStages:de.addMany,updateAssetStage:de.updateOne,updateAssetStages:de.updateMany,deleteAssetStage:de.deleteOne,deleteAssetStages:de.deleteMany}}),{initializeAssetStages:Eo,setAssetStage:Vo,setAssetStages:ko,addAssetStage:Bo,addAssetStages:Do,updateAssetStage:Wo,updateAssetStages:zo,deleteAssetStage:qo,deleteAssetStages:jo}=ji.actions,$o=ji.reducer,$i=t=>t.assetStageReducer.instances,Co=t=>s=>s.assetStageReducer.instances[t],Ci=o.createSelector([$i],t=>Object.values(t)),jk=m(o.createSelector([$i,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return ss(e)})),$k=m(o.createSelector([Ci,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),Uo=m(o.createSelector([Ci,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),le=O(t=>t.uuid),Lo={instances:{}},Ui=o.createSlice({name:"assetTypeAttachments",initialState:Lo,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Lo)),reducers:{initializeAssetTypeAttachments:le.initialize,addAssetTypeAttachment:le.addOne,addAssetTypeAttachments:le.addMany,setAssetTypeAttachment:le.setOne,setAssetTypeAttachments:le.setMany,updateAssetTypeAttachment:le.updateOne,updateAssetTypeAttachments:le.updateMany,deleteAssetTypeAttachment:le.deleteOne,deleteAssetTypeAttachments:le.deleteMany}}),{initializeAssetTypeAttachments:No,addAssetTypeAttachment:Ho,addAssetTypeAttachments:Li,setAssetTypeAttachment:Go,setAssetTypeAttachments:Ko,updateAssetTypeAttachment:Yo,updateAssetTypeAttachments:Qo,deleteAssetTypeAttachment:Jo,deleteAssetTypeAttachments:Ni}=Ui.actions,Zo=t=>t.assetTypeAttachmentReducer.instances,Hi=o.createSelector([Zo],t=>Object.values(t)),Xo=t=>s=>s.assetTypeAttachmentReducer.instances[t],xo=m(o.createSelector([Hi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),eh=m(o.createSelector([Hi,(t,s)=>s],(t,s)=>A(t.filter(({asset_type:e})=>s===e)))),th=Ui.reducer,ue=O(t=>t.uuid),sh={instances:{}},Gi=o.createSlice({name:"assetTypeFieldsAttachments",initialState:sh,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,sh)),reducers:{initializeAssetTypeFieldsAttachments:ue.initialize,addAssetTypeFieldsAttachment:ue.addOne,addAssetTypeFieldsAttachments:ue.addMany,setAssetTypeFieldsAttachment:ue.setOne,setAssetTypeFieldsAttachments:ue.setMany,updateAssetTypeFieldsAttachment:ue.updateOne,updateAssetTypeFieldsAttachments:ue.updateMany,deleteAssetTypeFieldsAttachment:ue.deleteOne,deleteAssetTypeFieldsAttachments:ue.deleteMany}}),{initializeAssetTypeFieldsAttachments:ih,addAssetTypeFieldsAttachment:nh,addAssetTypeFieldsAttachments:ah,setAssetTypeFieldsAttachment:ch,setAssetTypeFieldsAttachments:rh,updateAssetTypeFieldsAttachment:dh,updateAssetTypeFieldsAttachments:lh,deleteAssetTypeFieldsAttachment:uh,deleteAssetTypeFieldsAttachments:oh}=Gi.actions,hh=t=>t.assetTypeFieldsAttachmentReducer.instances,Ki=o.createSelector([hh],t=>Object.values(t)),Ck=m(o.createSelector([Ki,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),ph=t=>s=>s.assetTypeFieldsAttachmentReducer.instances[t],yh=m(o.createSelector([Ki,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Sh=Gi.reducer,oe=O(t=>t.uuid),mh={instances:{}},Yi=o.createSlice({name:"assetTypeFields",initialState:mh,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,mh)),reducers:{initializeAssetTypeFields:oe.initialize,addAssetTypeFields:oe.addOne,addAssetTypeFieldsMany:oe.addMany,setAssetTypeFields:oe.setOne,setAssetTypeFieldsMany:oe.setMany,updateAssetTypeFields:oe.updateOne,updateAssetTypeFieldsMany:oe.updateMany,deleteAssetTypeFields:oe.deleteOne,deleteAssetTypeFieldsMany:oe.deleteMany}}),{initializeAssetTypeFields:fh,addAssetTypeFields:Ah,addAssetTypeFieldsMany:wh,setAssetTypeFields:Ph,setAssetTypeFieldsMany:Th,updateAssetTypeFields:Oh,updateAssetTypeFieldsMany:Ih,deleteAssetTypeFields:Fh,deleteAssetTypeFieldsMany:_h}=Yi.actions,gh=t=>t.assetTypeFieldsReducer.instances,ns=o.createSelector([gh],t=>Object.values(t)),Uk=m(o.createSelector([ns,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Lk=m(o.createSelector([ns,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Rh=t=>s=>s.assetTypeFieldsReducer.instances[t],bh=m(o.createSelector([ns,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Mh=Yi.reducer,he=O(t=>t.uuid),vh={instances:{}},Qi=o.createSlice({name:"assetTypeFieldValuesAttachments",initialState:vh,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,vh)),reducers:{initializeAssetTypeFieldValuesAttachments:he.initialize,addAssetTypeFieldValuesAttachment:he.addOne,addAssetTypeFieldValuesAttachments:he.addMany,setAssetTypeFieldValuesAttachment:he.setOne,setAssetTypeFieldValuesAttachments:he.setMany,updateAssetTypeFieldValuesAttachment:he.updateOne,updateAssetTypeFieldValuesAttachments:he.updateMany,deleteAssetTypeFieldValuesAttachment:he.deleteOne,deleteAssetTypeFieldValuesAttachments:he.deleteMany}}),{initializeAssetTypeFieldValuesAttachments:Eh,addAssetTypeFieldValuesAttachment:Vh,addAssetTypeFieldValuesAttachments:Ji,setAssetTypeFieldValuesAttachment:kh,setAssetTypeFieldValuesAttachments:Bh,updateAssetTypeFieldValuesAttachment:Dh,updateAssetTypeFieldValuesAttachments:Wh,deleteAssetTypeFieldValuesAttachment:zh,deleteAssetTypeFieldValuesAttachments:Zi}=Qi.actions,qh=t=>t.assetTypeFieldValuesAttachmentReducer.instances,Xi=o.createSelector([qh],t=>Object.values(t)),jh=t=>s=>s.assetTypeFieldValuesAttachmentReducer.instances[t],$h=m(o.createSelector([Xi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ch=m(o.createSelector([Xi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Uh=Qi.reducer,pe=O(t=>t.uuid),Lh={instances:{}},xi=o.createSlice({name:"assetTypeFieldValues",initialState:Lh,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Lh)),reducers:{initializeAssetTypeFieldValues:pe.initialize,addAssetTypeFieldValues:pe.addOne,addAssetTypeFieldValuesMany:pe.addMany,setAssetTypeFieldValues:pe.setOne,setAssetTypeFieldValuesMany:pe.setMany,updateAssetTypeFieldValues:pe.updateOne,updateAssetTypeFieldValuesMany:pe.updateMany,deleteAssetTypeFieldValues:pe.deleteOne,deleteAssetTypeFieldValuesMany:pe.deleteMany}}),{initializeAssetTypeFieldValues:Nh,addAssetTypeFieldValues:Hh,addAssetTypeFieldValuesMany:Gh,setAssetTypeFieldValues:Kh,setAssetTypeFieldValuesMany:Yh,updateAssetTypeFieldValues:Qh,updateAssetTypeFieldValuesMany:Jh,deleteAssetTypeFieldValues:Zh,deleteAssetTypeFieldValuesMany:Xh}=xi.actions,xh=t=>t.assetTypeFieldValuesReducer.instances,bs=o.createSelector([xh],t=>Object.values(t)),Nk=m(o.createSelector([bs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),Hk=m(o.createSelector([ns,bs,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(a=>a.asset_type===e).map(a=>a.uuid));return A(s.filter(a=>n.has(a.fields_revision)))})),ep=t=>s=>s.assetTypeFieldValuesReducer.instances[t],tp=m(o.createSelector([bs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),sp=xi.reducer,ye=O(t=>t.uuid),ip={instances:{}},en=o.createSlice({name:"assetTypeIdentifiers",initialState:ip,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,ip)),reducers:{initializeAssetTypeIdentifiers:ye.initialize,addAssetTypeIdentifier:ye.addOne,addAssetTypeIdentifiers:ye.addMany,setAssetTypeIdentifier:ye.setOne,setAssetTypeIdentifiers:ye.setMany,updateAssetTypeIdentifier:ye.updateOne,updateAssetTypeIdentifiers:ye.updateMany,deleteAssetTypeIdentifier:ye.deleteOne,deleteAssetTypeIdentifiers:ye.deleteMany}}),{initializeAssetTypeIdentifiers:np,addAssetTypeIdentifier:ap,addAssetTypeIdentifiers:cp,setAssetTypeIdentifier:rp,setAssetTypeIdentifiers:dp,updateAssetTypeIdentifier:lp,updateAssetTypeIdentifiers:up,deleteAssetTypeIdentifier:op,deleteAssetTypeIdentifiers:hp}=en.actions,pp=t=>t.assetTypeIdentifierReducer.instances,tn=o.createSelector([pp],t=>Object.values(t)),yp=t=>s=>s.assetTypeIdentifierReducer.instances[t],Sp=m(o.createSelector([tn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Gk=m(o.createSelector([tn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),mp=en.reducer,Se=O(t=>t.uuid),fp={instances:{}},sn=o.createSlice({name:"assetTypeIdentifierValues",initialState:fp,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,fp)),reducers:{initializeAssetTypeIdentifierValues:Se.initialize,addAssetTypeIdentifierValue:Se.addOne,addAssetTypeIdentifierValues:Se.addMany,setAssetTypeIdentifierValue:Se.setOne,setAssetTypeIdentifierValues:Se.setMany,updateAssetTypeIdentifierValue:Se.updateOne,updateAssetTypeIdentifierValues:Se.updateMany,deleteAssetTypeIdentifierValue:Se.deleteOne,deleteAssetTypeIdentifierValues:Se.deleteMany}}),{initializeAssetTypeIdentifierValues:Ap,addAssetTypeIdentifierValue:wp,addAssetTypeIdentifierValues:Pp,setAssetTypeIdentifierValue:Tp,setAssetTypeIdentifierValues:Op,updateAssetTypeIdentifierValue:Ip,updateAssetTypeIdentifierValues:Fp,deleteAssetTypeIdentifierValue:_p,deleteAssetTypeIdentifierValues:gp}=sn.actions,Rp=t=>t.assetTypeIdentifierValueReducer.instances,Ms=o.createSelector([Rp],t=>Object.values(t)),bp=t=>s=>s.assetTypeIdentifierValueReducer.instances[t],Mp=m(o.createSelector([Ms,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Kk=m(o.createSelector([Ms,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),Yk=m(o.createSelector([Ms,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type_identifier===s)))),vp=sn.reducer,me=O(t=>t.uuid),Ep={instances:{}},nn=o.createSlice({name:"assetTypes",initialState:Ep,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Ep)),reducers:{initializeAssetTypes:me.initialize,setAssetType:me.setOne,setAssetTypes:me.setMany,addAssetType:me.addOne,addAssetTypes:me.addMany,updateAssetType:me.updateOne,updateAssetTypes:me.updateMany,deleteAssetType:me.deleteOne,deleteAssetTypes:me.deleteMany}}),{initializeAssetTypes:Vp,setAssetType:kp,setAssetTypes:Bp,addAssetType:Dp,addAssetTypes:Wp,updateAssetType:zp,updateAssetTypes:qp,deleteAssetType:jp,deleteAssetTypes:$p}=nn.actions,Cp=t=>t.assetTypeReducer.instances,an=o.createSelector([Cp],t=>Object.values(t)),Up=t=>s=>s.assetTypeReducer.instances[t],Lp=m(o.createSelector([an,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Qk=m(o.createSelector([an,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Np=nn.reducer,fe=O(t=>t.uuid),Hp={instances:{}},cn=o.createSlice({name:"assetTypeStatuses",initialState:Hp,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Hp)),reducers:{initializeAssetTypeStatuses:fe.initialize,addAssetTypeStatus:fe.addOne,addAssetTypeStatuses:fe.addMany,setAssetTypeStatus:fe.setOne,setAssetTypeStatuses:fe.setMany,updateAssetTypeStatus:fe.updateOne,updateAssetTypeStatuses:fe.updateMany,deleteAssetTypeStatus:fe.deleteOne,deleteAssetTypeStatuses:fe.deleteMany}}),{initializeAssetTypeStatuses:Gp,addAssetTypeStatus:Kp,addAssetTypeStatuses:Yp,setAssetTypeStatus:Qp,setAssetTypeStatuses:Jp,updateAssetTypeStatus:Zp,updateAssetTypeStatuses:Xp,deleteAssetTypeStatus:xp,deleteAssetTypeStatuses:ey}=cn.actions,ty=t=>t.assetTypeStatusReducer.instances,rn=o.createSelector([ty],t=>A(Object.values(t).toSorted(br))),sy=t=>s=>s.assetTypeStatusReducer.instances[t],iy=m(o.createSelector([rn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Jk=m(o.createSelector([rn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),ny=cn.reducer,ay={accessToken:"",refreshToken:"",isLoggedIn:!1},vs=o.createSlice({name:"auth",initialState:ay,extraReducers:t=>t.addCase(T,s=>Object.assign(s,ay)),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||vs.caseReducers.clearTokens(t),t.isLoggedIn=s.payload}}}),{setTokens:Zk,clearTokens:Xk,setLoggedIn:cy}=vs.actions,xk=t=>t.authReducer.accessToken,eB=t=>t.authReducer.isLoggedIn,ry=vs.reducer,Ae=O(t=>t.uuid),dy={instances:{}},dn=o.createSlice({name:"documentAttachments",initialState:dy,extraReducers:t=>t.addCase(T,s=>Object.assign(s,dy)),reducers:{initializeDocumentAttachments:Ae.initialize,addDocumentAttachment:Ae.addOne,addDocumentAttachments:Ae.addMany,setDocumentAttachment:Ae.setOne,setDocumentAttachments:Ae.setMany,updateDocumentAttachment:Ae.updateOne,updateDocumentAttachments:Ae.updateMany,deleteDocumentAttachment:Ae.deleteOne,deleteDocumentAttachments:Ae.deleteMany}}),{initializeDocumentAttachments:ly,addDocumentAttachment:uy,addDocumentAttachments:oy,setDocumentAttachment:hy,setDocumentAttachments:py,updateDocumentAttachment:yy,updateDocumentAttachments:Sy,deleteDocumentAttachment:my,deleteDocumentAttachments:fy}=dn.actions,Ay=t=>t.documentAttachmentReducer.instances,ln=o.createSelector([Ay],t=>Object.values(t)),wy=t=>s=>s.documentAttachmentReducer.instances[t],Py=m(o.createSelector([ln,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),tB=m(o.createSelector([ln,(t,s)=>s],(t,s)=>A(t.filter(({document:e})=>s===e)))),Ty=dn.reducer,we=O(({uuid:t})=>t),Oy={instances:{}},un=o.createSlice({name:"documents",initialState:Oy,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>{Object.assign(s,Oy)}),reducers:{initializeDocuments:we.initialize,addDocument:we.addOne,addDocuments:we.addMany,setDocument:we.setOne,setDocuments:we.setMany,updateDocument:we.updateOne,updateDocuments:we.updateMany,deleteDocument:we.deleteOne,deleteDocuments:we.deleteMany}}),{initializeDocuments:Iy,addDocument:Fy,addDocuments:_y,setDocument:gy,setDocuments:Ry,updateDocument:by,updateDocuments:My,deleteDocument:vy,deleteDocuments:Ey}=un.actions,Vy=un.reducer,on=t=>t.documentsReducer.instances,Es=o.createSelector([on],t=>Object.values(t)),ky=t=>s=>s.documentsReducer.instances[t],By=m(o.createSelector([Es,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),sB=m(o.createSelector([Es,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),iB=m(o.createSelector([Es,(t,s)=>s],(t,s)=>t.filter(e=>e.organization===s))),Dy=m(o.createSelector([on,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=Er(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),Pe=O(t=>t.uuid),Wy={instances:{}},hn=o.createSlice({name:"emailDomains",initialState:Wy,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Wy)),reducers:{initializeEmailDomains:Pe.initialize,addEmailDomain:Pe.addOne,addEmailDomains:Pe.addMany,setEmailDomain:Pe.setOne,setEmailDomains:Pe.setMany,updateEmailDomain:Pe.updateOne,updateEmailDomains:Pe.updateMany,deleteEmailDomain:Pe.deleteOne,deleteEmailDomains:Pe.deleteMany}}),{initializeEmailDomains:zy,addEmailDomain:qy,addEmailDomains:jy,setEmailDomain:$y,setEmailDomains:Cy,updateEmailDomain:Uy,updateEmailDomains:Ly,deleteEmailDomain:Ny,deleteEmailDomains:Hy}=hn.actions,Gy=t=>t.emailDomainsReducer.instances,pn=o.createSelector([Gy],t=>Object.values(t)),Ky=t=>s=>s.emailDomainsReducer.instances[t],Yy=m(o.createSelector([pn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),nB=m(o.createSelector([pn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Qy=hn.reducer,Jy={s3Urls:{}},Zy=1e3*60*60,aB=Zy*24*7,yn=o.createSlice({name:"file",initialState:Jy,extraReducers:t=>t.addCase(T,s=>Object.assign(s,Jy)),reducers:{setUploadUrl:(t,s)=>{const{url:e,fields:n,sha1:a}=s.payload,c=new Date,r=new Date(c.getTime()+aB);t.s3Urls[a]={url:e,fields:n,exp:r.getTime()}}}}),{setUploadUrl:cB}=yn.actions,rB=t=>s=>{const e=s.fileReducer.s3Urls[t];if(!e)return;const n=new Date().getTime();if(!((e.exp??n)-n<Zy))return e},Xy=yn.reducer,Te=O(t=>t.uuid),xy={instances:{}},Sn=o.createSlice({name:"formIdentifiers",initialState:xy,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,xy)),reducers:{initializeFormIdentifiers:Te.initialize,addFormIdentifier:Te.addOne,addFormIdentifiers:Te.addMany,setFormIdentifier:Te.setOne,setFormIdentifiers:Te.setMany,updateFormIdentifier:Te.updateOne,updateFormIdentifiers:Te.updateMany,deleteFormIdentifier:Te.deleteOne,deleteFormIdentifiers:Te.deleteMany}}),{initializeFormIdentifiers:eS,addFormIdentifier:tS,addFormIdentifiers:sS,setFormIdentifier:iS,setFormIdentifiers:nS,updateFormIdentifier:aS,updateFormIdentifiers:cS,deleteFormIdentifier:rS,deleteFormIdentifiers:dS}=Sn.actions,lS=t=>t.formIdentifierReducer.instances,mn=o.createSelector([lS],t=>Object.values(t)),uS=t=>s=>s.formIdentifierReducer.instances[t],oS=m(o.createSelector([mn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),dB=m(o.createSelector([mn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form===s)))),hS=Sn.reducer,Oe=O(t=>t.uuid),pS={instances:{}},fn=o.createSlice({name:"formIdentifierValues",initialState:pS,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,pS)),reducers:{initializeFormIdentifierValues:Oe.initialize,addFormIdentifierValue:Oe.addOne,addFormIdentifierValues:Oe.addMany,setFormIdentifierValue:Oe.setOne,setFormIdentifierValues:Oe.setMany,updateFormIdentifierValue:Oe.updateOne,updateFormIdentifierValues:Oe.updateMany,deleteFormIdentifierValue:Oe.deleteOne,deleteFormIdentifierValues:Oe.deleteMany}}),{initializeFormIdentifierValues:yS,addFormIdentifierValue:SS,addFormIdentifierValues:mS,setFormIdentifierValue:fS,setFormIdentifierValues:AS,updateFormIdentifierValue:wS,updateFormIdentifierValues:PS,deleteFormIdentifierValue:TS,deleteFormIdentifierValues:OS}=fn.actions,IS=t=>t.formIdentifierValueReducer.instances,Vs=o.createSelector([IS],t=>Object.values(t)),FS=t=>s=>s.formIdentifierValueReducer.instances[t],_S=m(o.createSelector([Vs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),lB=m(o.createSelector([Vs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_submission===s)))),uB=m(o.createSelector([Vs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_identifier===s)))),gS=fn.reducer,Ie=O(t=>t.uuid),RS={instances:{}},An=o.createSlice({name:"formRevisionAttachments",initialState:RS,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,RS)),reducers:{initializeFormRevisionAttachments:Ie.initialize,addFormRevisionAttachment:Ie.addOne,addFormRevisionAttachments:Ie.addMany,setFormRevisionAttachment:Ie.setOne,setFormRevisionAttachments:Ie.setMany,updateFormRevisionAttachment:Ie.updateOne,updateFormRevisionAttachments:Ie.updateMany,deleteFormRevisionAttachment:Ie.deleteOne,deleteFormRevisionAttachments:Ie.deleteMany}}),{initializeFormRevisionAttachments:bS,addFormRevisionAttachment:MS,addFormRevisionAttachments:vS,setFormRevisionAttachment:ES,setFormRevisionAttachments:VS,updateFormRevisionAttachment:kS,updateFormRevisionAttachments:BS,deleteFormRevisionAttachment:DS,deleteFormRevisionAttachments:WS}=An.actions,ks=t=>t.formRevisionAttachmentReducer.instances,zS=o.createSelector([ks],t=>Object.values(t)),qS=m(o.createSelector([ks,(t,s)=>s],(t,s)=>t[s])),jS=m(o.createSelector([zS,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),oB=m(o.createSelector([ks,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.form_revision===s)))),$S=An.reducer,Fe=O(t=>t.uuid),CS={instances:{}},wn=o.createSlice({name:"formRevisions",initialState:CS,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,CS)),reducers:{initializeFormRevisions:Fe.initialize,addFormRevision:Fe.addOne,addFormRevisions:Fe.addMany,setFormRevision:Fe.setOne,setFormRevisions:Fe.setMany,updateFormRevision:Fe.updateOne,updateFormRevisions:Fe.updateMany,deleteFormRevision:Fe.deleteOne,deleteFormRevisions:Fe.deleteMany}}),{initializeFormRevisions:US,addFormRevision:Pn,addFormRevisions:Tn,setFormRevision:LS,setFormRevisions:NS,updateFormRevision:HS,updateFormRevisions:GS,deleteFormRevision:On,deleteFormRevisions:In}=wn.actions,Fn=t=>t.formRevisionReducer.instances,Bs=o.createSelector([Fn],t=>Object.values(t)),KS=t=>s=>s.formRevisionReducer.instances[t],YS=m(o.createSelector([Bs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),hB=m(o.createSelector([Bs,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),QS=m(o.createSelector([Bs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form===s)))),JS=wn.reducer,_e=O(t=>t.uuid),ZS={instances:{}},_n=o.createSlice({name:"forms",initialState:ZS,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,ZS)),reducers:{initializeForms:_e.initialize,addForm:_e.addOne,addForms:_e.addMany,setForm:_e.setOne,setForms:_e.setMany,updateForm:_e.updateOne,updateForms:_e.updateMany,deleteForm:_e.deleteOne,deleteForms:_e.deleteMany}}),{initializeForms:XS,addForm:xS,addForms:em,setForm:tm,setForms:sm,updateForm:im,updateForms:nm,deleteForm:am,deleteForms:cm}=_n.actions,rm=_n.reducer,dm=t=>t.formReducer.instances,gn=o.createSelector([dm],t=>Object.values(t)),lm=t=>s=>s.formReducer.instances[t],um=m(o.createSelector([gn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),pB=m(o.createSelector([gn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),ge=O(t=>t.uuid),om={instances:{}},Rn=o.createSlice({name:"formSubmissionAttachments",initialState:om,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,om)),reducers:{initializeFormSubmissionAttachments:ge.initialize,addFormSubmissionAttachment:ge.addOne,addFormSubmissionAttachments:ge.addMany,setFormSubmissionAttachment:ge.setOne,setFormSubmissionAttachments:ge.setMany,updateFormSubmissionAttachment:ge.updateOne,updateFormSubmissionAttachments:ge.updateMany,deleteFormSubmissionAttachment:ge.deleteOne,deleteFormSubmissionAttachments:ge.deleteMany}}),{initializeFormSubmissionAttachments:hm,addFormSubmissionAttachment:pm,addFormSubmissionAttachments:bn,setFormSubmissionAttachment:ym,setFormSubmissionAttachments:Sm,updateFormSubmissionAttachment:mm,updateFormSubmissionAttachments:fm,deleteFormSubmissionAttachment:Am,deleteFormSubmissionAttachments:Mn}=Rn.actions,vn=t=>t.formSubmissionAttachmentReducer.instances,En=o.createSelector([vn],t=>Object.values(t)),wm=m(o.createSelector([vn,(t,s)=>s],(t,s)=>t[s])),Vn=m(o.createSelector([En,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(n=>e.has(n.uuid)))})),Pm=Vn,Tm=m(o.createSelector([En,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_submission===s)))),Om=Rn.reducer,Re=O(t=>t.uuid),Im={instances:{}},kn=o.createSlice({name:"formSubmissions",initialState:Im,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Im)),reducers:{initializeFormSubmissions:Re.initialize,setFormSubmission:Re.setOne,setFormSubmissions:Re.setMany,addFormSubmission:Re.addOne,addFormSubmissions:Re.addMany,updateFormSubmission:Re.updateOne,updateFormSubmissions:Re.updateMany,deleteFormSubmission:Re.deleteOne,deleteFormSubmissions:Re.deleteMany}}),{initializeFormSubmissions:Fm,setFormSubmission:_m,setFormSubmissions:gm,addFormSubmission:Rm,addFormSubmissions:Bn,updateFormSubmission:bm,updateFormSubmissions:Mm,deleteFormSubmission:vm,deleteFormSubmissions:Dn}=kn.actions,Wn=t=>t.formSubmissionReducer.instances,Em=o.createSelector([Wn],t=>Object.values(t)),Vm=t=>s=>s.formSubmissionReducer.instances[t],km=m(o.createSelector([Em,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Bm=m(o.createSelector([Wn,Fn,(t,s)=>s],(t,s,e)=>{const n=new Set;for(const a of Object.values(s))a.form===e&&n.add(a.uuid);return Object.values(t).filter(a=>n.has(a.form_revision))})),Dm=kn.reducer,be=O(t=>t.uuid),Wm={instances:{}},zn=o.createSlice({name:"geoImages",initialState:Wm,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Wm)),reducers:{initializeGeoImages:be.initialize,setGeoImage:be.setOne,setGeoImages:be.setMany,addGeoImage:be.addOne,addGeoImages:be.addMany,updateGeoImage:be.updateOne,updateGeoImages:be.updateMany,deleteGeoImage:be.deleteOne,deleteGeoImages:be.deleteMany}}),{initializeGeoImages:zm,setGeoImage:qm,setGeoImages:jm,addGeoImage:$m,addGeoImages:Cm,updateGeoImage:Um,updateGeoImages:Lm,deleteGeoImage:Nm,deleteGeoImages:Hm}=zn.actions,Gm=t=>t.geoImageReducer.instances,qn=o.createSelector([Gm],t=>Object.values(t)),Km=t=>s=>s.geoImageReducer.instances[t],Ym=m(o.createSelector([qn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yB=m(o.createSelector([qn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),Qm=zn.reducer,Me=O(t=>t.uuid),Jm={instances:{}},jn=o.createSlice({name:"issueAssociations",initialState:Jm,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Jm)),reducers:{initializeIssueAssociations:Me.initialize,addIssueAssociation:Me.addOne,addIssueAssociations:Me.addMany,setIssueAssociation:Me.setOne,setIssueAssociations:Me.setMany,updateIssueAssociation:Me.updateOne,updateIssueAssociations:Me.updateMany,deleteIssueAssociation:Me.deleteOne,deleteIssueAssociations:Me.deleteMany}}),{initializeIssueAssociations:Zm,setIssueAssociations:Xm,setIssueAssociation:xm,updateIssueAssociation:ef,updateIssueAssociations:tf,addIssueAssociation:sf,addIssueAssociations:qt,deleteIssueAssociation:nf,deleteIssueAssociations:jt}=jn.actions,af=t=>t.issueAssociationReducer.instances,$t=o.createSelector([af],t=>Object.values(t)),cf=t=>s=>s.issueAssociationReducer.instances[t],rf=m(o.createSelector([$t,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),df=m(o.createSelector([$t,(t,s)=>s],(t,s)=>A(t.filter(({associated_issue:e})=>e===s)))),lf=m(o.createSelector([$t,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({associated_issue:n})=>e.has(n)))})),uf=m(o.createSelector([$t,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({issue:n})=>n&&e.has(n)))})),of=m(o.createSelector([$t,(t,s)=>s],(t,s)=>A(t.filter(({issue:e})=>e===s)))),hf=m(o.createSelector([$t,(t,s)=>s],(t,s)=>A(t.filter(({asset:e})=>e===s)))),pf=jn.reducer,ve=O(t=>t.uuid),yf={instances:{}},$n=o.createSlice({name:"issueAttachments",initialState:yf,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,yf)),reducers:{initializeIssueAttachments:ve.initialize,addIssueAttachment:ve.addOne,addIssueAttachments:ve.addMany,setIssueAttachment:ve.setOne,setIssueAttachments:ve.setMany,updateIssueAttachment:ve.updateOne,updateIssueAttachments:ve.updateMany,deleteIssueAttachment:ve.deleteOne,deleteIssueAttachments:ve.deleteMany}}),{initializeIssueAttachments:Sf,addIssueAttachment:mf,addIssueAttachments:Cn,setIssueAttachment:ff,setIssueAttachments:Af,updateIssueAttachment:wf,updateIssueAttachments:Pf,deleteIssueAttachment:Tf,deleteIssueAttachments:Un}=$n.actions,Of=t=>t.issueAttachmentReducer.instances,Ln=o.createSelector([Of],t=>Object.values(t)),If=m(o.createSelector([Ln,(t,s)=>s],(t,s)=>A(t.filter(({issue:e})=>s===e)))),Ff=t=>s=>s.issueAttachmentReducer.instances[t],_f=m(o.createSelector([Ln,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),gf=$n.reducer,Ee=O(t=>t.uuid),Rf={instances:{}},Nn=o.createSlice({name:"issueCommentAttachments",initialState:Rf,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Rf)),reducers:{initializeIssueCommentAttachments:Ee.initialize,addIssueCommentAttachment:Ee.addOne,addIssueCommentAttachments:Ee.addMany,setIssueCommentAttachment:Ee.setOne,setIssueCommentAttachments:Ee.setMany,updateIssueCommentAttachment:Ee.updateOne,updateIssueCommentAttachments:Ee.updateMany,deleteIssueCommentAttachment:Ee.deleteOne,deleteIssueCommentAttachments:Ee.deleteMany}}),{initializeIssueCommentAttachments:bf,addIssueCommentAttachment:Mf,addIssueCommentAttachments:vf,setIssueCommentAttachment:Ef,setIssueCommentAttachments:Vf,updateIssueCommentAttachment:kf,updateIssueCommentAttachments:Bf,deleteIssueCommentAttachment:Df,deleteIssueCommentAttachments:Wf}=Nn.actions,zf=t=>t.issueCommentAttachmentReducer.instances,Hn=o.createSelector([zf],t=>Object.values(t)),qf=t=>s=>s.issueCommentAttachmentReducer.instances[t],jf=m(o.createSelector([Hn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),SB=m(o.createSelector([Hn,(t,s)=>s],(t,s)=>A(t.filter(({issue_comment:e})=>s===e)))),$f=Nn.reducer,Ve=O(t=>t.uuid),Cf={instances:{}},Gn=o.createSlice({name:"issueComments",initialState:Cf,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Cf)),reducers:{initializeIssueComments:Ve.initialize,addIssueComment:Ve.addOne,addIssueComments:Ve.addMany,setIssueComment:Ve.setOne,setIssueComments:Ve.setMany,updateIssueComment:Ve.updateOne,updateIssueComments:Ve.updateMany,deleteIssueComment:Ve.deleteOne,deleteIssueComments:Ve.deleteMany}}),{initializeIssueComments:Uf,addIssueComment:Lf,addIssueComments:Nf,setIssueComment:Hf,setIssueComments:Gf,updateIssueComment:Kf,updateIssueComments:Yf,deleteIssueComment:Qf,deleteIssueComments:Jf}=Gn.actions,Kn=t=>t.issueCommentReducer.instances,Zf=t=>s=>s.issueCommentReducer.instances[t],Xf=m(o.createSelector([Kn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(Object.values(t).filter(({uuid:n})=>e.has(n)))})),mB=m(o.createSelector([Kn,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.issue===s)))),xf=Gn.reducer,ke=O(t=>t.uuid),eA={instances:{}},Yn=o.createSlice({name:"issues",initialState:eA,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,eA)),reducers:{initializeIssues:ke.initialize,addIssue:ke.addOne,addIssues:ke.addMany,setIssue:ke.setOne,setIssues:ke.setMany,updateIssue:ke.updateOne,updateIssues:ke.updateMany,deleteIssue:ke.deleteOne,deleteIssues:ke.deleteMany}}),{initializeIssues:tA,addIssue:sA,addIssues:Qn,setIssue:iA,setIssues:nA,updateIssue:aA,updateIssues:cA,deleteIssue:rA,deleteIssues:Jn}=Yn.actions,dA=t=>t.issueReducer.instances,Ds=o.createSelector([dA],t=>Object.values(t)),lA=t=>s=>s.issueReducer.instances[t],uA=m(o.createSelector([Ds,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),fB=m(o.createSelector([Ds,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),oA=m(o.createSelector([Ds,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s))),hA=Yn.reducer,Be=O(t=>t.uuid),pA={instances:{}},Zn=o.createSlice({name:"issueTypeAttachments",initialState:pA,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,pA)),reducers:{initializeIssueTypeAttachments:Be.initialize,addIssueTypeAttachment:Be.addOne,addIssueTypeAttachments:Be.addMany,setIssueTypeAttachment:Be.setOne,setIssueTypeAttachments:Be.setMany,updateIssueTypeAttachment:Be.updateOne,updateIssueTypeAttachments:Be.updateMany,deleteIssueTypeAttachment:Be.deleteOne,deleteIssueTypeAttachments:Be.deleteMany}}),{initializeIssueTypeAttachments:yA,addIssueTypeAttachment:SA,addIssueTypeAttachments:mA,setIssueTypeAttachment:fA,setIssueTypeAttachments:AA,updateIssueTypeAttachment:wA,updateIssueTypeAttachments:PA,deleteIssueTypeAttachment:TA,deleteIssueTypeAttachments:OA}=Zn.actions,IA=t=>t.issueTypeAttachmentReducer.instances,Xn=o.createSelector([IA],t=>Object.values(t)),FA=t=>s=>s.issueTypeAttachmentReducer.instances[t],_A=m(o.createSelector([Xn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),AB=m(o.createSelector([Xn,(t,s)=>s],(t,s)=>A(t.filter(({issue_type:e})=>s===e)))),gA=Zn.reducer,De=O(t=>t.uuid),RA={instances:{}},xn=o.createSlice({name:"issueTypeFieldsAttachments",initialState:RA,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,RA)),reducers:{initializeIssueTypeFieldsAttachments:De.initialize,addIssueTypeFieldsAttachment:De.addOne,addIssueTypeFieldsAttachments:De.addMany,setIssueTypeFieldsAttachment:De.setOne,setIssueTypeFieldsAttachments:De.setMany,updateIssueTypeFieldsAttachment:De.updateOne,updateIssueTypeFieldsAttachments:De.updateMany,deleteIssueTypeFieldsAttachment:De.deleteOne,deleteIssueTypeFieldsAttachments:De.deleteMany}}),{initializeIssueTypeFieldsAttachments:bA,addIssueTypeFieldsAttachment:MA,addIssueTypeFieldsAttachments:vA,setIssueTypeFieldsAttachment:EA,setIssueTypeFieldsAttachments:VA,updateIssueTypeFieldsAttachment:kA,updateIssueTypeFieldsAttachments:BA,deleteIssueTypeFieldsAttachment:DA,deleteIssueTypeFieldsAttachments:WA}=xn.actions,zA=t=>t.issueTypeFieldsAttachmentReducer.instances,ea=o.createSelector([zA],t=>Object.values(t)),wB=m(o.createSelector([ea,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),qA=t=>s=>s.issueTypeFieldsAttachmentReducer.instances[t],jA=m(o.createSelector([ea,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),$A=xn.reducer,We=O(t=>t.uuid),CA={instances:{}},ta=o.createSlice({name:"issueTypeFieldValues",initialState:CA,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,CA)),reducers:{initializeIssueTypeFieldValues:We.initialize,addIssueTypeFieldValues:We.addOne,addIssueTypeFieldValuesMany:We.addMany,setIssueTypeFieldValues:We.setOne,setIssueTypeFieldValuesMany:We.setMany,updateIssueTypeFieldValues:We.updateOne,updateIssueTypeFieldValuesMany:We.updateMany,deleteIssueTypeFieldValues:We.deleteOne,deleteIssueTypeFieldValuesMany:We.deleteMany}}),{initializeIssueTypeFieldValues:UA,addIssueTypeFieldValues:LA,addIssueTypeFieldValuesMany:NA,setIssueTypeFieldValues:HA,setIssueTypeFieldValuesMany:GA,updateIssueTypeFieldValues:KA,updateIssueTypeFieldValuesMany:YA,deleteIssueTypeFieldValues:QA,deleteIssueTypeFieldValuesMany:JA}=ta.actions,ZA=t=>t.issueTypeFieldValuesReducer.instances,Ws=o.createSelector([ZA],t=>Object.values(t)),PB=m(o.createSelector([Ws,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),XA=t=>s=>s.issueTypeFieldValuesReducer.instances[t],xA=m(o.createSelector([Ws,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ew=ta.reducer,ze=O(t=>t.uuid),tw={instances:{}},sa=o.createSlice({name:"issueTypeFields",initialState:tw,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,tw)),reducers:{initializeIssueTypeFields:ze.initialize,addIssueTypeFields:ze.addOne,addIssueTypeFieldsMany:ze.addMany,setIssueTypeFields:ze.setOne,setIssueTypeFieldsMany:ze.setMany,updateIssueTypeFields:ze.updateOne,updateIssueTypeFieldsMany:ze.updateMany,deleteIssueTypeFields:ze.deleteOne,deleteIssueTypeFieldsMany:ze.deleteMany}}),{initializeIssueTypeFields:sw,addIssueTypeFields:iw,addIssueTypeFieldsMany:nw,setIssueTypeFields:aw,setIssueTypeFieldsMany:cw,updateIssueTypeFields:rw,updateIssueTypeFieldsMany:dw,deleteIssueTypeFields:lw,deleteIssueTypeFieldsMany:uw}=sa.actions,ow=t=>t.issueTypeFieldsReducer.instances,as=o.createSelector([ow],t=>Object.values(t)),TB=m(o.createSelector([as,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),OB=m(o.createSelector([as,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),IB=m(o.createSelector([as,Ws,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(a=>a.issue_type===e).map(a=>a.uuid));return A(s.filter(a=>n.has(a.fields_revision)))})),hw=t=>s=>s.issueTypeFieldsReducer.instances[t],pw=m(o.createSelector([as,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yw=sa.reducer,qe=O(t=>t.uuid),Sw={instances:{}},ia=o.createSlice({name:"issueTypeFieldValuesAttachments",initialState:Sw,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Sw)),reducers:{initializeIssueTypeFieldValuesAttachments:qe.initialize,addIssueTypeFieldValuesAttachment:qe.addOne,addIssueTypeFieldValuesAttachments:qe.addMany,setIssueTypeFieldValuesAttachment:qe.setOne,setIssueTypeFieldValuesAttachments:qe.setMany,updateIssueTypeFieldValuesAttachment:qe.updateOne,updateIssueTypeFieldValuesAttachments:qe.updateMany,deleteIssueTypeFieldValuesAttachment:qe.deleteOne,deleteIssueTypeFieldValuesAttachments:qe.deleteMany}}),{initializeIssueTypeFieldValuesAttachments:mw,addIssueTypeFieldValuesAttachment:fw,addIssueTypeFieldValuesAttachments:na,setIssueTypeFieldValuesAttachment:Aw,setIssueTypeFieldValuesAttachments:ww,updateIssueTypeFieldValuesAttachment:Pw,updateIssueTypeFieldValuesAttachments:Tw,deleteIssueTypeFieldValuesAttachment:Ow,deleteIssueTypeFieldValuesAttachments:aa}=ia.actions,Iw=t=>t.issueTypeFieldValuesAttachmentReducer.instances,ca=o.createSelector([Iw],t=>Object.values(t)),Fw=t=>s=>s.issueTypeFieldValuesAttachmentReducer.instances[t],_w=m(o.createSelector([ca,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),gw=m(o.createSelector([ca,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Rw=ia.reducer,je=O(t=>t.uuid),bw={instances:{}},ra=o.createSlice({name:"issueTypeIdentifiers",initialState:bw,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,bw)),reducers:{initializeIssueTypeIdentifiers:je.initialize,addIssueTypeIdentifier:je.addOne,addIssueTypeIdentifiers:je.addMany,setIssueTypeIdentifier:je.setOne,setIssueTypeIdentifiers:je.setMany,updateIssueTypeIdentifier:je.updateOne,updateIssueTypeIdentifiers:je.updateMany,deleteIssueTypeIdentifier:je.deleteOne,deleteIssueTypeIdentifiers:je.deleteMany}}),{initializeIssueTypeIdentifiers:Mw,addIssueTypeIdentifier:vw,addIssueTypeIdentifiers:Ew,setIssueTypeIdentifier:Vw,setIssueTypeIdentifiers:kw,updateIssueTypeIdentifier:Bw,updateIssueTypeIdentifiers:Dw,deleteIssueTypeIdentifier:Ww,deleteIssueTypeIdentifiers:zw}=ra.actions,qw=t=>t.issueTypeIdentifierReducer.instances,da=o.createSelector([qw],t=>Object.values(t)),jw=t=>s=>s.issueTypeIdentifierReducer.instances[t],$w=m(o.createSelector([da,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),FB=m(o.createSelector([da,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),Cw=ra.reducer,$e=O(t=>t.uuid),Uw={instances:{}},la=o.createSlice({name:"issueTypeIdentifierValues",initialState:Uw,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Uw)),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:Lw,addIssueTypeIdentifierValue:Nw,addIssueTypeIdentifierValues:Hw,setIssueTypeIdentifierValue:Gw,setIssueTypeIdentifierValues:Kw,updateIssueTypeIdentifierValue:Yw,updateIssueTypeIdentifierValues:Qw,deleteIssueTypeIdentifierValue:Jw,deleteIssueTypeIdentifierValues:Zw}=la.actions,Xw=t=>t.issueTypeIdentifierValueReducer.instances,zs=o.createSelector([Xw],t=>Object.values(t)),xw=t=>s=>s.issueTypeIdentifierValueReducer.instances[t],eP=m(o.createSelector([zs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),_B=m(o.createSelector([zs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),gB=m(o.createSelector([zs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type_identifier===s)))),tP=la.reducer,Ce=O(t=>t.uuid),sP={instances:{}},ua=o.createSlice({name:"issueTypes",initialState:sP,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,sP)),reducers:{initializeIssueTypes:Ce.initialize,addIssueType:Ce.addOne,addIssueTypes:Ce.addMany,setIssueType:Ce.setOne,setIssueTypes:Ce.setMany,updateIssueType:Ce.updateOne,updateIssueTypes:Ce.updateMany,deleteIssueType:Ce.deleteOne,deleteIssueTypes:Ce.deleteMany}}),{initializeIssueTypes:iP,addIssueType:nP,addIssueTypes:aP,setIssueType:cP,setIssueTypes:rP,updateIssueType:dP,updateIssueTypes:lP,deleteIssueType:uP,deleteIssueTypes:oP}=ua.actions,hP=t=>t.issueTypeReducer.instances,oa=o.createSelector(hP,t=>Object.values(t)),pP=t=>s=>s.issueTypeReducer.instances[t],yP=m(o.createSelector([oa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),RB=m(o.createSelector([oa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),SP=ua.reducer,Ue=O(t=>t.uuid),mP={instances:{}},ha=o.createSlice({name:"issueTypeStatuses",initialState:mP,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,mP)),reducers:{initializeIssueTypeStatuses:Ue.initialize,addIssueTypeStatus:Ue.addOne,addIssueTypeStatuses:Ue.addMany,setIssueTypeStatus:Ue.setOne,setIssueTypeStatuses:Ue.setMany,updateIssueTypeStatus:Ue.updateOne,updateIssueTypeStatuses:Ue.updateMany,deleteIssueTypeStatus:Ue.deleteOne,deleteIssueTypeStatuses:Ue.deleteMany}}),{initializeIssueTypeStatuses:fP,addIssueTypeStatus:AP,addIssueTypeStatuses:wP,setIssueTypeStatus:PP,setIssueTypeStatuses:TP,updateIssueTypeStatus:OP,updateIssueTypeStatuses:IP,deleteIssueTypeStatus:FP,deleteIssueTypeStatuses:_P}=ha.actions,gP=t=>t.issueTypeStatusReducer.instances,pa=o.createSelector([gP],t=>A(Object.values(t).toSorted(Mr))),ya=t=>s=>s.issueTypeStatusReducer.instances[t],RP=m(o.createSelector([pa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),bB=m(o.createSelector([pa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),bP=ha.reducer,Le=O(t=>t.uuid),MP={instances:{}},Sa=o.createSlice({name:"issueUpdates",initialState:MP,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,MP)),reducers:{initializeIssueUpdates:Le.initialize,addIssueUpdate:Le.addOne,addIssueUpdates:Le.addMany,setIssueUpdate:Le.setOne,setIssueUpdates:Le.setMany,updateIssueUpdate:Le.updateOne,updateIssueUpdates:Le.updateMany,deleteIssueUpdate:Le.deleteOne,deleteIssueUpdates:Le.deleteMany}}),{initializeIssueUpdates:vP,addIssueUpdate:ma,addIssueUpdates:fa,setIssueUpdate:EP,setIssueUpdates:VP,updateIssueUpdate:kP,updateIssueUpdates:BP,deleteIssueUpdate:Aa,deleteIssueUpdates:wa}=Sa.actions,Pa=t=>t.issueUpdateReducer.instances,Ta=o.createSelector([Pa],t=>Object.values(t)),DP=m(o.createSelector([Pa,(t,s)=>s],(t,s)=>t[s])),WP=m(o.createSelector([Ta,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),zP=m(o.createSelector([Ta,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),qP=Sa.reducer,Ne=O(t=>t.id),jP={instances:{},currentUser:null},Oa=o.createSlice({name:"users",initialState:jP,extraReducers:t=>t.addCase(T,s=>Object.assign(s,jP)).addCase(I,s=>Object.assign(s,{...s,instances:[]})),reducers:{initializeUsers:Ne.initialize,setUsers:Ne.setMany,setUser:Ne.setOne,addUsers:Ne.addMany,addUser:Ne.addOne,updateUsers:Ne.updateMany,updateUser:Ne.updateOne,deleteUser:Ne.deleteOne,deleteUsers:Ne.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:$P,setUsers:CP,setUser:UP,addUsers:LP,addUser:Ia,updateUsers:NP,updateUser:HP,deleteUser:Fa,deleteUsers:GP,setCurrentUser:MB,setCurrentUserProfile:vB}=Oa.actions,KP=Oa.reducer,YP=t=>t.userReducer.currentUser,_a=t=>t.userReducer.instances,qs=o.createSelector([_a],t=>Object.values(t)),js=t=>s=>s.userReducer.instances[t],QP=m(o.createSelector([qs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({id:n})=>e.has(n)))})),He=O(t=>t.uuid),JP={instances:{}},ga=o.createSlice({name:"organizationAccess",initialState:JP,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,JP)),reducers:{initializeOrganizationAccesses:He.initialize,addOrganizationAccess:He.addOne,addOrganizationAccesses:He.addMany,setOrganizationAccess:He.setOne,setOrganizationAccesses:He.setMany,updateOrganizationAccess:He.updateOne,updateOrganizationAccesses:He.updateMany,deleteOrganizationAccess:He.deleteOne,deleteOrganizationAccesses:He.deleteMany}}),{initializeOrganizationAccesses:ZP,addOrganizationAccess:XP,addOrganizationAccesses:xP,setOrganizationAccess:eT,setOrganizationAccesses:tT,updateOrganizationAccess:sT,updateOrganizationAccesses:iT,deleteOrganizationAccess:nT,deleteOrganizationAccesses:aT}=ga.actions,cT=ga.reducer,$s=t=>t.organizationAccessReducer.instances,rT=t=>s=>s.organizationAccessReducer.instances[t],dT=m(o.createSelector([$s,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(Object.values(t).filter(({uuid:n})=>e.has(n)))})),EB=o.createSelector([YP,$s],(t,s)=>Object.values(s).find(n=>n.user===(t==null?void 0:t.id))??null),lT=o.createSelector([$s],t=>{const s={};for(const e of Object.values(t))s[e.user]=e;return ss(s)}),VB=m(o.createSelector([_a,lT,(t,s)=>s],(t,s,e)=>A(Object.values(t).filter(n=>{const a=s[n.id];return!!a&&a.organization===e})))),Ge=O(t=>t.uuid),uT={instances:{}},Ra=o.createSlice({name:"organizations",initialState:uT,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,uT)),reducers:{initializeOrganizations:Ge.initialize,setOrganizations:Ge.setMany,setOrganization:Ge.setOne,addOrganizations:Ge.addMany,addOrganization:Ge.addOne,updateOrganizations:Ge.updateMany,updateOrganization:Ge.updateOne,deleteOrganization:Ge.deleteOne,deleteOrganizations:Ge.deleteMany}}),{initializeOrganizations:oT,setOrganizations:hT,setOrganization:pT,addOrganizations:yT,addOrganization:ST,updateOrganizations:mT,updateOrganization:fT,deleteOrganization:AT,deleteOrganizations:wT}=Ra.actions,PT=t=>t.organizationReducer.instances,TT=o.createSelector([PT],t=>Object.values(t)),OT=t=>s=>s.organizationReducer.instances[t],IT=m(o.createSelector([TT,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),FT=Ra.reducer,_T=(t,s,e)=>{const n=t.uuid?t:{...t,uuid:Bt.v4()};return{payload:n,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:n,BASE_URL:s,serviceName:e}}}}},gT={deletedRequests:[],latestRetryTime:0},ba=o.createSlice({name:"outbox",initialState:gT,extraReducers:t=>t.addCase(T,s=>Object.assign(s,gT)),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 _T(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}}}),kB=t=>t.outboxReducer.deletedRequests,BB=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:RT,markForDeletion:DB,markAsDeleted:bT,_setLatestRetryTime:MT}=ba.actions,vT=ba.reducer,Ke=O(t=>t.uuid),ET={instances:{}},Ma=o.createSlice({name:"projectAccess",initialState:ET,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,ET)),reducers:{initializeProjectAccesses:Ke.initialize,addProjectAccess:Ke.addOne,addProjectAccesses:Ke.addMany,setProjectAccess:Ke.setOne,setProjectAccesses:Ke.setMany,updateProjectAccess:Ke.updateOne,updateProjectAccesses:Ke.updateMany,deleteProjectAccess:Ke.deleteOne,deleteProjectAccesses:Ke.deleteMany}}),{initializeProjectAccesses:VT,addProjectAccess:kT,addProjectAccesses:BT,setProjectAccess:DT,setProjectAccesses:WT,updateProjectAccess:zT,updateProjectAccesses:qT,deleteProjectAccess:jT,deleteProjectAccesses:$T}=Ma.actions,CT=Ma.reducer,va=t=>t.projectAccessReducer.instances,cs=o.createSelector(va,t=>Object.values(t)),UT=t=>s=>s.projectAccessReducer.instances[t],LT=m(o.createSelector([cs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),WB=m(o.createSelector([va,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.project===s)))),zB=m(o.createSelector([cs,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.project===s))e[n.user]=n;return e})),qB=m(o.createSelector([qs,cs,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.project===e).map(a=>a.user));return A(t.filter(a=>n.has(a.id)))})),Ye=O(t=>t.uuid),NT={instances:{}},Ea=o.createSlice({name:"projectAttachments",initialState:NT,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,NT)),reducers:{initializeProjectAttachments:Ye.initialize,addProjectAttachment:Ye.addOne,addProjectAttachments:Ye.addMany,setProjectAttachment:Ye.setOne,setProjectAttachments:Ye.setMany,updateProjectAttachment:Ye.updateOne,updateProjectAttachments:Ye.updateMany,deleteProjectAttachment:Ye.deleteOne,deleteProjectAttachments:Ye.deleteMany}}),{initializeProjectAttachments:HT,addProjectAttachment:GT,addProjectAttachments:KT,setProjectAttachment:YT,setProjectAttachments:QT,updateProjectAttachment:JT,updateProjectAttachments:ZT,deleteProjectAttachment:XT,deleteProjectAttachments:xT}=Ea.actions,eO=t=>t.projectAttachmentReducer.instances,Va=o.createSelector([eO],t=>Object.values(t)),tO=t=>s=>s.projectAttachmentReducer.instances[t],sO=m(o.createSelector([Va,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),jB=m(o.createSelector([Va,(t,s)=>s],(t,s)=>A(t.filter(({project:e})=>s===e)))),iO=Ea.reducer,Qe=O(t=>t.uuid),nO={instances:{}},ka=o.createSlice({name:"projectFiles",initialState:nO,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,nO)),reducers:{initializeProjectFiles:Qe.initialize,setProjectFile:Qe.setOne,setProjectFiles:Qe.setMany,addProjectFile:Qe.addOne,addProjectFiles:Qe.addMany,updateProjectFile:Qe.updateOne,updateProjectFiles:Qe.updateMany,deleteProjectFile:Qe.deleteOne,deleteProjectFiles:Qe.deleteMany}}),{initializeProjectFiles:aO,setProjectFile:cO,setProjectFiles:rO,addProjectFile:dO,addProjectFiles:lO,updateProjectFile:uO,updateProjectFiles:oO,deleteProjectFile:hO,deleteProjectFiles:pO}=ka.actions,yO=t=>t.projectFileReducer.instances,SO=o.createSelector([yO],t=>A(Object.values(t).sort((s,e)=>s.z_index-e.z_index))),mO=t=>s=>s.projectFileReducer.instances[t],fO=m(o.createSelector([SO,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),AO=ka.reducer,Je=O(t=>t.uuid),wO={instances:{}},Ba=o.createSlice({name:"projects",initialState:wO,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,wO)),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:PO,setProjects:TO,setProject:OO,addProjects:IO,addProject:FO,updateProjects:_O,updateProject:gO,deleteProject:RO,deleteProjects:bO}=Ba.actions,MO=Ba.reducer,vO=t=>t.projectReducer.instances,Cs=o.createSelector([vO],t=>Object.values(t)),EO=t=>s=>s.projectReducer.instances[t],VO=m(o.createSelector([Cs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),$B=m(o.createSelector([Cs,cs,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.user===e).map(a=>a.project));return A(t.filter(a=>n.has(a.uuid)))})),CB=m(o.createSelector([Cs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Ze=O(({uuid:t})=>t),kO={instances:{}},Da=o.createSlice({name:"procedures",initialState:kO,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,kO)),reducers:{initializeProcedures:Ze.initialize,addProcedure:Ze.addOne,addProcedures:Ze.addMany,setProcedure:Ze.setOne,setProcedures:Ze.setMany,updateProcedure:Ze.updateOne,updateProcedures:Ze.updateMany,deleteProcedure:Ze.deleteOne,deleteProcedures:Ze.deleteMany}}),{initializeProcedures:BO,addProcedure:DO,addProcedures:Wa,setProcedure:WO,setProcedures:zO,updateProcedure:qO,updateProcedures:jO,deleteProcedure:$O,deleteProcedures:za}=Da.actions,CO=Da.reducer,UO=t=>t.procedureReducer.instances,Gt=o.createSelector([UO],t=>Object.values(t)),LO=t=>s=>s.procedureReducer.instances[t],NO=m(o.createSelector([Gt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),UB=m(o.createSelector([Gt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),HO=m(o.createSelector([Gt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_type===s)))),LB=m(o.createSelector([Gt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),NB=m(o.createSelector([Gt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),Xe=O(t=>t.uuid),GO={instances:{}},qa=o.createSlice({name:"procedureStepAssignees",initialState:GO,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,GO)),reducers:{initializeProcedureStepAssignees:Xe.initialize,addProcedureStepAssignee:Xe.addOne,addProcedureStepAssignees:Xe.addMany,setProcedureStepAssignee:Xe.setOne,setProcedureStepAssignees:Xe.setMany,updateProcedureStepAssignee:Xe.updateOne,updateProcedureStepAssignees:Xe.updateMany,deleteProcedureStepAssignee:Xe.deleteOne,deleteProcedureStepAssignees:Xe.deleteMany}}),{initializeProcedureStepAssignees:KO,addProcedureStepAssignee:YO,addProcedureStepAssignees:QO,setProcedureStepAssignee:JO,setProcedureStepAssignees:ZO,updateProcedureStepAssignee:XO,updateProcedureStepAssignees:xO,deleteProcedureStepAssignee:eI,deleteProcedureStepAssignees:tI}=qa.actions,sI=t=>t.procedureStepAssigneeReducer.instances,rs=o.createSelector([sI],t=>Object.values(t)),iI=t=>s=>s.procedureStepAssigneeReducer.instances[t],nI=m(o.createSelector([rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),HB=m(o.createSelector([rs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),GB=m(o.createSelector([rs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),KB=m(o.createSelector([rs,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({procedure:n,procedure_step:a})=>n===s&&a===e)))),aI=qa.reducer,xe=O(t=>t.uuid),cI={instances:{}},ja=o.createSlice({name:"procedureStepComments",initialState:cI,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,cI)),reducers:{initializeProcedureStepComments:xe.initialize,addProcedureStepComment:xe.addOne,addProcedureStepComments:xe.addMany,setProcedureStepComment:xe.setOne,setProcedureStepComments:xe.setMany,updateProcedureStepComment:xe.updateOne,updateProcedureStepComments:xe.updateMany,deleteProcedureStepComment:xe.deleteOne,deleteProcedureStepComments:xe.deleteMany}}),{initializeProcedureStepComments:rI,addProcedureStepComment:dI,addProcedureStepComments:lI,setProcedureStepComment:uI,setProcedureStepComments:oI,updateProcedureStepComment:hI,updateProcedureStepComments:pI,deleteProcedureStepComment:yI,deleteProcedureStepComments:SI}=ja.actions,mI=t=>t.procedureStepCommentReducer.instances,ds=o.createSelector([mI],t=>Object.values(t)),fI=t=>s=>s.procedureStepCommentReducer.instances[t],AI=m(o.createSelector([ds,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),YB=m(o.createSelector([ds,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),QB=m(o.createSelector([ds,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),JB=m(o.createSelector([ds,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({procedure:n,procedure_step:a})=>n===s&&a===e)))),wI=ja.reducer,et=O(t=>t.uuid),PI={instances:{}},$a=o.createSlice({name:"procedureStepDefaultAssignees",initialState:PI,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,PI)),reducers:{initializeProcedureStepDefaultAssignees:et.initialize,addProcedureStepDefaultAssignee:et.addOne,addProcedureStepDefaultAssignees:et.addMany,setProcedureStepDefaultAssignee:et.setOne,setProcedureStepDefaultAssignees:et.setMany,updateProcedureStepDefaultAssignee:et.updateOne,updateProcedureStepDefaultAssignees:et.updateMany,deleteProcedureStepDefaultAssignee:et.deleteOne,deleteProcedureStepDefaultAssignees:et.deleteMany}}),{initializeProcedureStepDefaultAssignees:TI,addProcedureStepDefaultAssignee:OI,addProcedureStepDefaultAssignees:II,setProcedureStepDefaultAssignee:FI,setProcedureStepDefaultAssignees:_I,updateProcedureStepDefaultAssignee:gI,updateProcedureStepDefaultAssignees:RI,deleteProcedureStepDefaultAssignee:bI,deleteProcedureStepDefaultAssignees:MI}=$a.actions,vI=t=>t.procedureStepDefaultAssigneeReducer.instances,Ca=o.createSelector([vI],t=>Object.values(t)),EI=t=>s=>s.procedureStepDefaultAssigneeReducer.instances[t],VI=m(o.createSelector([Ca,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ZB=m(o.createSelector([Ca,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),kI=$a.reducer,tt=O(t=>t.uuid),BI={instances:{}},Ua=o.createSlice({name:"procedureStepDefaultReviewers",initialState:BI,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,BI)),reducers:{initializeProcedureStepDefaultReviewers:tt.initialize,addProcedureStepDefaultReviewer:tt.addOne,addProcedureStepDefaultReviewers:tt.addMany,setProcedureStepDefaultReviewer:tt.setOne,setProcedureStepDefaultReviewers:tt.setMany,updateProcedureStepDefaultReviewer:tt.updateOne,updateProcedureStepDefaultReviewers:tt.updateMany,deleteProcedureStepDefaultReviewer:tt.deleteOne,deleteProcedureStepDefaultReviewers:tt.deleteMany}}),{initializeProcedureStepDefaultReviewers:DI,addProcedureStepDefaultReviewer:WI,addProcedureStepDefaultReviewers:zI,setProcedureStepDefaultReviewer:qI,setProcedureStepDefaultReviewers:jI,updateProcedureStepDefaultReviewer:$I,updateProcedureStepDefaultReviewers:CI,deleteProcedureStepDefaultReviewer:UI,deleteProcedureStepDefaultReviewers:LI}=Ua.actions,NI=t=>t.procedureStepDefaultReviewerReducer.instances,La=o.createSelector([NI],t=>Object.values(t)),HI=t=>s=>s.procedureStepDefaultReviewerReducer.instances[t],GI=m(o.createSelector([La,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),XB=m(o.createSelector([La,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),KI=Ua.reducer,st=O(t=>t.uuid),YI={instances:{}},Na=o.createSlice({name:"procedureStepEvents",initialState:YI,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,YI)),reducers:{initializeProcedureStepEvents:st.initialize,addProcedureStepEvent:st.addOne,addProcedureStepEvents:st.addMany,setProcedureStepEvent:st.setOne,setProcedureStepEvents:st.setMany,updateProcedureStepEvent:st.updateOne,updateProcedureStepEvents:st.updateMany,deleteProcedureStepEvent:st.deleteOne,deleteProcedureStepEvents:st.deleteMany}}),{initializeProcedureStepEvents:QI,addProcedureStepEvent:JI,addProcedureStepEvents:ZI,setProcedureStepEvent:XI,setProcedureStepEvents:xI,updateProcedureStepEvent:eF,updateProcedureStepEvents:tF,deleteProcedureStepEvent:sF,deleteProcedureStepEvents:iF}=Na.actions,nF=t=>t.procedureStepEventReducer.instances,ls=o.createSelector([nF],t=>Object.values(t)),aF=t=>s=>s.procedureStepEventReducer.instances[t],cF=m(o.createSelector([ls,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),xB=m(o.createSelector([ls,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),eD=m(o.createSelector([ls,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),tD=m(o.createSelector([ls,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({procedure:n,procedure_step:a})=>n===s&&a===e)))),rF=Na.reducer,it=O(t=>t.uuid),dF={instances:{}},Ha=o.createSlice({name:"procedureStepFieldsAttachments",initialState:dF,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,dF)),reducers:{initializeProcedureStepFieldsAttachments:it.initialize,addProcedureStepFieldsAttachment:it.addOne,addProcedureStepFieldsAttachments:it.addMany,setProcedureStepFieldsAttachment:it.setOne,setProcedureStepFieldsAttachments:it.setMany,updateProcedureStepFieldsAttachment:it.updateOne,updateProcedureStepFieldsAttachments:it.updateMany,deleteProcedureStepFieldsAttachment:it.deleteOne,deleteProcedureStepFieldsAttachments:it.deleteMany}}),{initializeProcedureStepFieldsAttachments:lF,addProcedureStepFieldsAttachment:uF,addProcedureStepFieldsAttachments:Ga,setProcedureStepFieldsAttachment:oF,setProcedureStepFieldsAttachments:hF,updateProcedureStepFieldsAttachment:pF,updateProcedureStepFieldsAttachments:yF,deleteProcedureStepFieldsAttachment:SF,deleteProcedureStepFieldsAttachments:Ka}=Ha.actions,mF=t=>t.procedureStepFieldsAttachmentReducer.instances,Ya=o.createSelector([mF],t=>Object.values(t)),fF=m(o.createSelector([Ya,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),AF=t=>s=>s.procedureStepFieldsAttachmentReducer.instances[t],wF=m(o.createSelector([Ya,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),PF=Ha.reducer,nt=O(t=>t.uuid),TF={instances:{}},Qa=o.createSlice({name:"procedureStepFields",initialState:TF,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,TF)),reducers:{initializeProcedureStepFields:nt.initialize,addProcedureStepFields:nt.addOne,addProcedureStepFieldsMany:nt.addMany,setProcedureStepFields:nt.setOne,setProcedureStepFieldsMany:nt.setMany,updateProcedureStepFields:nt.updateOne,updateProcedureStepFieldsMany:nt.updateMany,deleteProcedureStepFields:nt.deleteOne,deleteProcedureStepFieldsMany:nt.deleteMany}}),{initializeProcedureStepFields:OF,addProcedureStepFields:IF,addProcedureStepFieldsMany:FF,setProcedureStepFields:_F,setProcedureStepFieldsMany:gF,updateProcedureStepFields:RF,updateProcedureStepFieldsMany:bF,deleteProcedureStepFields:MF,deleteProcedureStepFieldsMany:vF}=Qa.actions,Ja=t=>t.procedureStepFieldsReducer.instances,Us=o.createSelector([Ja],t=>Object.values(t)),sD=m(o.createSelector([Us,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),iD=m(o.createSelector([Us,(t,s)=>s],(t,s)=>t.filter(e=>e.procedure_step===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),nD=o.createSelector([Ja],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}),EF=t=>s=>s.procedureStepFieldsReducer.instances[t],VF=m(o.createSelector([Us,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),kF=Qa.reducer,at=O(t=>t.uuid),BF={instances:{}},Za=o.createSlice({name:"procedureStepFieldValuesAttachments",initialState:BF,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,BF)),reducers:{initializeProcedureStepFieldValuesAttachments:at.initialize,addProcedureStepFieldValuesAttachment:at.addOne,addProcedureStepFieldValuesAttachments:at.addMany,setProcedureStepFieldValuesAttachment:at.setOne,setProcedureStepFieldValuesAttachments:at.setMany,updateProcedureStepFieldValuesAttachment:at.updateOne,updateProcedureStepFieldValuesAttachments:at.updateMany,deleteProcedureStepFieldValuesAttachment:at.deleteOne,deleteProcedureStepFieldValuesAttachments:at.deleteMany}}),{initializeProcedureStepFieldValuesAttachments:DF,addProcedureStepFieldValuesAttachment:WF,addProcedureStepFieldValuesAttachments:Xa,setProcedureStepFieldValuesAttachment:zF,setProcedureStepFieldValuesAttachments:qF,updateProcedureStepFieldValuesAttachment:jF,updateProcedureStepFieldValuesAttachments:$F,deleteProcedureStepFieldValuesAttachment:CF,deleteProcedureStepFieldValuesAttachments:xa}=Za.actions,UF=t=>t.procedureStepFieldValuesAttachmentReducer.instances,ec=o.createSelector([UF],t=>Object.values(t)),LF=t=>s=>s.procedureStepFieldValuesAttachmentReducer.instances[t],NF=m(o.createSelector([ec,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),HF=m(o.createSelector([ec,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),GF=Za.reducer,ct=O(t=>t.uuid),KF={instances:{}},tc=o.createSlice({name:"procedureStepFieldValues",initialState:KF,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,KF)),reducers:{initializeProcedureStepFieldValues:ct.initialize,addProcedureStepFieldValues:ct.addOne,addProcedureStepFieldValuesMany:ct.addMany,setProcedureStepFieldValues:ct.setOne,setProcedureStepFieldValuesMany:ct.setMany,updateProcedureStepFieldValues:ct.updateOne,updateProcedureStepFieldValuesMany:ct.updateMany,deleteProcedureStepFieldValues:ct.deleteOne,deleteProcedureStepFieldValuesMany:ct.deleteMany}}),{initializeProcedureStepFieldValues:YF,addProcedureStepFieldValues:QF,addProcedureStepFieldValuesMany:JF,setProcedureStepFieldValues:ZF,setProcedureStepFieldValuesMany:XF,updateProcedureStepFieldValues:xF,updateProcedureStepFieldValuesMany:e_,deleteProcedureStepFieldValues:t_,deleteProcedureStepFieldValuesMany:s_}=tc.actions,i_=t=>t.procedureStepFieldValuesReducer.instances,Dt=o.createSelector([i_],t=>Object.values(t)),aD=m(o.createSelector([Dt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),cD=m(o.createSelector([Dt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),n_=t=>s=>s.procedureStepFieldValuesReducer.instances[t],a_=m(o.createSelector([Dt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),rD=m(o.createSelector([Dt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({procedure:n,procedure_step:a})=>n===s&&a===e)))),dD=m(o.createSelector([Dt,(t,s)=>s],(t,s)=>{const e={};for(const n of t){const{procedure:a,procedure_step:c}=n;if(a!==s)continue;const r=e[c];(!r||r.submitted_at<=n.submitted_at)&&(e[c]=n)}return e})),c_=tc.reducer,rt=O(t=>t.uuid),r_={instances:{}},sc=o.createSlice({name:"procedureStepFieldValuesReviewRequests",initialState:r_,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,r_)),reducers:{initializeProcedureStepFieldValuesReviewRequests:rt.initialize,addProcedureStepFieldValuesReviewRequest:rt.addOne,addProcedureStepFieldValuesReviewRequests:rt.addMany,setProcedureStepFieldValuesReviewRequest:rt.setOne,setProcedureStepFieldValuesReviewRequests:rt.setMany,updateProcedureStepFieldValuesReviewRequest:rt.updateOne,updateProcedureStepFieldValuesReviewRequests:rt.updateMany,deleteProcedureStepFieldValuesReviewRequest:rt.deleteOne,deleteProcedureStepFieldValuesReviewRequests:rt.deleteMany}}),{initializeProcedureStepFieldValuesReviewRequests:d_,addProcedureStepFieldValuesReviewRequest:l_,addProcedureStepFieldValuesReviewRequests:ic,setProcedureStepFieldValuesReviewRequest:u_,setProcedureStepFieldValuesReviewRequests:o_,updateProcedureStepFieldValuesReviewRequest:h_,updateProcedureStepFieldValuesReviewRequests:p_,deleteProcedureStepFieldValuesReviewRequest:y_,deleteProcedureStepFieldValuesReviewRequests:nc}=sc.actions,S_=t=>t.procedureStepFieldValuesReviewRequestReducer.instances,us=o.createSelector([S_],t=>Object.values(t)),m_=t=>s=>s.procedureStepFieldValuesReviewRequestReducer.instances[t],f_=m(o.createSelector([us,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),A_=m(o.createSelector([us,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),lD=m(o.createSelector([us,(t,s)=>s],(t,s)=>{let e;for(const n of t){const{field_values:a}=n;a===s&&(!e||e.submitted_at<=n.submitted_at)&&(e=n)}return e})),uD=m(o.createSelector([Dt,us,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(E(t.filter(({procedure_step:c,procedure:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),w_=sc.reducer,dt=O(t=>t.uuid),P_={instances:{}},ac=o.createSlice({name:"procedureStepFieldValuesReviews",initialState:P_,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,P_)),reducers:{initializeProcedureStepFieldValuesReviews:dt.initialize,addProcedureStepFieldValuesReview:dt.addOne,addProcedureStepFieldValuesReviews:dt.addMany,setProcedureStepFieldValuesReview:dt.setOne,setProcedureStepFieldValuesReviews:dt.setMany,updateProcedureStepFieldValuesReview:dt.updateOne,updateProcedureStepFieldValuesReviews:dt.updateMany,deleteProcedureStepFieldValuesReview:dt.deleteOne,deleteProcedureStepFieldValuesReviews:dt.deleteMany}}),{initializeProcedureStepFieldValuesReviews:T_,addProcedureStepFieldValuesReview:O_,addProcedureStepFieldValuesReviews:cc,setProcedureStepFieldValuesReview:I_,setProcedureStepFieldValuesReviews:F_,updateProcedureStepFieldValuesReview:__,updateProcedureStepFieldValuesReviews:g_,deleteProcedureStepFieldValuesReview:R_,deleteProcedureStepFieldValuesReviews:rc}=ac.actions,b_=t=>t.procedureStepFieldValuesReviewReducer.instances,Kt=o.createSelector([b_],t=>Object.values(t)),M_=t=>s=>s.procedureStepFieldValuesReviewReducer.instances[t],v_=m(o.createSelector([Kt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),E_=m(o.createSelector([Kt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),oD=m(o.createSelector([Kt,(t,s)=>s],(t,s)=>{let e;for(const n of t){const{field_values:a}=n;a===s&&(!e||e.submitted_at<=n.submitted_at)&&(e=n)}return e})),hD=m(o.createSelector([Dt,Kt,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(E(t.filter(({procedure_step:c,procedure:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),pD=o.createSelector([Kt],t=>{const s={};for(const e of t){const{field_values:n}=e,a=s[n];(!a||a.submitted_at<=e.submitted_at)&&(s[n]=e)}return s}),V_=ac.reducer,lt=O(t=>t.uuid),k_={instances:{}},dc=o.createSlice({name:"procedureStepReviewers",initialState:k_,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,k_)),reducers:{initializeProcedureStepReviewers:lt.initialize,addProcedureStepReviewer:lt.addOne,addProcedureStepReviewers:lt.addMany,setProcedureStepReviewer:lt.setOne,setProcedureStepReviewers:lt.setMany,updateProcedureStepReviewer:lt.updateOne,updateProcedureStepReviewers:lt.updateMany,deleteProcedureStepReviewer:lt.deleteOne,deleteProcedureStepReviewers:lt.deleteMany}}),{initializeProcedureStepReviewers:B_,addProcedureStepReviewer:D_,addProcedureStepReviewers:W_,setProcedureStepReviewer:z_,setProcedureStepReviewers:q_,updateProcedureStepReviewer:j_,updateProcedureStepReviewers:$_,deleteProcedureStepReviewer:C_,deleteProcedureStepReviewers:U_}=dc.actions,L_=t=>t.procedureStepReviewerReducer.instances,os=o.createSelector([L_],t=>Object.values(t)),N_=t=>s=>s.procedureStepReviewerReducer.instances[t],H_=m(o.createSelector([os,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yD=m(o.createSelector([os,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),SD=m(o.createSelector([os,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),mD=m(o.createSelector([os,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({procedure:n,procedure_step:a})=>n===s&&a===e)))),G_=dc.reducer,ut=O(t=>t.uuid),K_={instances:{}},lc=o.createSlice({name:"procedureSteps",initialState:K_,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,K_)),reducers:{initializeProcedureSteps:ut.initialize,setProcedureStep:ut.setOne,setProcedureSteps:ut.setMany,addProcedureStep:ut.addOne,addProcedureSteps:ut.addMany,updateProcedureStep:ut.updateOne,updateProcedureSteps:ut.updateMany,deleteProcedureStep:ut.deleteOne,deleteProcedureSteps:ut.deleteMany}}),{initializeProcedureSteps:Y_,setProcedureStep:Q_,setProcedureSteps:J_,addProcedureStep:Z_,addProcedureSteps:X_,updateProcedureStep:x_,updateProcedureSteps:eg,deleteProcedureStep:tg,deleteProcedureSteps:sg}=lc.actions,ig=lc.reducer,Ls=t=>t.procedureStepReducer.instances,ng=t=>s=>s.procedureStepReducer.instances[t],uc=o.createSelector([Ls],t=>Object.values(t)),fD=m(o.createSelector([Ls,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.procedure_type===s&&(e[n]=a);return ss(e)})),AD=m(o.createSelector([uc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_type===s)))),ag=m(o.createSelector([uc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),cg=m(o.createSelector([Ls,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=kr(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),ot=O(({uuid:t})=>t),rg={instances:{}},oc=o.createSlice({name:"procedureTypeFieldsAttachments",initialState:rg,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,rg)),reducers:{initializeProcedureTypeFieldsAttachments:ot.initialize,addProcedureTypeFieldsAttachment:ot.addOne,addProcedureTypeFieldsAttachments:ot.addMany,setProcedureTypeFieldsAttachment:ot.setOne,setProcedureTypeFieldsAttachments:ot.setMany,updateProcedureTypeFieldsAttachment:ot.updateOne,updateProcedureTypeFieldsAttachments:ot.updateMany,deleteProcedureTypeFieldsAttachment:ot.deleteOne,deleteProcedureTypeFieldsAttachments:ot.deleteMany}}),{initializeProcedureTypeFieldsAttachments:dg,addProcedureTypeFieldsAttachment:lg,addProcedureTypeFieldsAttachments:ug,setProcedureTypeFieldsAttachment:og,setProcedureTypeFieldsAttachments:hg,updateProcedureTypeFieldsAttachment:pg,updateProcedureTypeFieldsAttachments:yg,deleteProcedureTypeFieldsAttachment:Sg,deleteProcedureTypeFieldsAttachments:mg}=oc.actions,fg=oc.reducer,Ag=t=>t.procedureTypeFieldsAttachmentReducer.instances,hc=o.createSelector([Ag],t=>Object.values(t)),wD=m(o.createSelector([hc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),wg=t=>s=>s.procedureTypeFieldsAttachmentReducer.instances[t],Pg=m(o.createSelector([hc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ht=O(({uuid:t})=>t),Tg={instances:{}},pc=o.createSlice({name:"procedureTypeFields",initialState:Tg,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Tg)),reducers:{initializeProcedureTypeFields:ht.initialize,addProcedureTypeFields:ht.addOne,addProcedureTypeFieldsMany:ht.addMany,setProcedureTypeFields:ht.setOne,setProcedureTypeFieldsMany:ht.setMany,updateProcedureTypeFields:ht.updateOne,updateProcedureTypeFieldsMany:ht.updateMany,deleteProcedureTypeFields:ht.deleteOne,deleteProcedureTypeFieldsMany:ht.deleteMany}}),{initializeProcedureTypeFields:Og,addProcedureTypeFields:Ig,addProcedureTypeFieldsMany:Fg,setProcedureTypeFields:_g,setProcedureTypeFieldsMany:gg,updateProcedureTypeFields:Rg,updateProcedureTypeFieldsMany:bg,deleteProcedureTypeFields:Mg,deleteProcedureTypeFieldsMany:vg}=pc.actions,Eg=pc.reducer,Vg=t=>t.procedureTypeFieldsReducer.instances,Ns=o.createSelector([Vg],t=>Object.values(t)),PD=m(o.createSelector([Ns,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_type===s)))),TD=m(o.createSelector([Ns,(t,s)=>s],(t,s)=>t.filter(e=>e.procedure_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),kg=t=>s=>s.procedureTypeFieldsReducer.instances[t],Bg=m(o.createSelector([Ns,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),pt=O(({uuid:t})=>t),Dg={instances:{}},yc=o.createSlice({name:"procedureTypeFieldValuesAttachments",initialState:Dg,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Dg)),reducers:{initializeProcedureTypeFieldValuesAttachments:pt.initialize,addProcedureTypeFieldValuesAttachment:pt.addOne,addProcedureTypeFieldValuesAttachments:pt.addMany,setProcedureTypeFieldValuesAttachment:pt.setOne,setProcedureTypeFieldValuesAttachments:pt.setMany,updateProcedureTypeFieldValuesAttachment:pt.updateOne,updateProcedureTypeFieldValuesAttachments:pt.updateMany,deleteProcedureTypeFieldValuesAttachment:pt.deleteOne,deleteProcedureTypeFieldValuesAttachments:pt.deleteMany}}),{initializeProcedureTypeFieldValuesAttachments:Wg,addProcedureTypeFieldValuesAttachment:zg,addProcedureTypeFieldValuesAttachments:Sc,setProcedureTypeFieldValuesAttachment:qg,setProcedureTypeFieldValuesAttachments:jg,updateProcedureTypeFieldValuesAttachment:$g,updateProcedureTypeFieldValuesAttachments:Cg,deleteProcedureTypeFieldValuesAttachment:Ug,deleteProcedureTypeFieldValuesAttachments:mc}=yc.actions,Lg=yc.reducer,Ng=t=>t.procedureTypeFieldValuesAttachmentReducer.instances,fc=o.createSelector([Ng],t=>Object.values(t)),Hg=t=>s=>s.procedureTypeFieldValuesAttachmentReducer.instances[t],Gg=m(o.createSelector([fc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Kg=m(o.createSelector([fc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),yt=O(({uuid:t})=>t),Yg={instances:{}},Ac=o.createSlice({name:"procedureTypeFieldValues",initialState:Yg,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Yg)),reducers:{initializeProcedureTypeFieldValues:yt.initialize,addProcedureTypeFieldValues:yt.addOne,addProcedureTypeFieldValuesMany:yt.addMany,setProcedureTypeFieldValues:yt.setOne,setProcedureTypeFieldValuesMany:yt.setMany,updateProcedureTypeFieldValues:yt.updateOne,updateProcedureTypeFieldValuesMany:yt.updateMany,deleteProcedureTypeFieldValues:yt.deleteOne,deleteProcedureTypeFieldValuesMany:yt.deleteMany}}),{initializeProcedureTypeFieldValues:Qg,addProcedureTypeFieldValues:Jg,addProcedureTypeFieldValuesMany:Zg,setProcedureTypeFieldValues:Xg,setProcedureTypeFieldValuesMany:xg,updateProcedureTypeFieldValues:eR,updateProcedureTypeFieldValuesMany:tR,deleteProcedureTypeFieldValues:sR,deleteProcedureTypeFieldValuesMany:iR}=Ac.actions,nR=Ac.reducer,aR=t=>t.procedureTypeFieldValuesReducer.instances,wc=o.createSelector([aR],t=>Object.values(t)),OD=m(o.createSelector([wc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),cR=t=>s=>s.procedureTypeFieldValuesReducer.instances[t],rR=m(o.createSelector([wc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),St=O(t=>t.uuid),dR={instances:{}},Pc=o.createSlice({name:"procedureTypes",initialState:dR,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,dR)),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:lR,addProcedureType:uR,addProcedureTypes:oR,setProcedureType:hR,setProcedureTypes:pR,updateProcedureType:yR,updateProcedureTypes:SR,deleteProcedureType:mR,deleteProcedureTypes:fR}=Pc.actions,AR=Pc.reducer,wR=t=>t.procedureTypeReducer.instances,Hs=o.createSelector([wR],t=>Object.values(t)),PR=t=>s=>s.procedureTypeReducer.instances[t],TR=m(o.createSelector([Hs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ID=m(o.createSelector([Hs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),FD=m(o.createSelector([Hs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),_D={isRehydrated:!1},Tc=o.createSlice({name:"rehydrated",initialState:_D,reducers:{setRehydrated:(t,s)=>{t.isRehydrated=s.payload}}}),{setRehydrated:gD}=Tc.actions,RD=t=>t.rehydratedReducer.isRehydrated,OR=Tc.reducer,mt=O(t=>t.uuid),IR={instances:{}},Oc=o.createSlice({name:"teamMemberships",initialState:IR,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,IR)),reducers:{initializeTeamMemberships:mt.initialize,addTeamMembership:mt.addOne,addTeamMemberships:mt.addMany,setTeamMembership:mt.setOne,setTeamMemberships:mt.setMany,updateTeamMembership:mt.updateOne,updateTeamMemberships:mt.updateMany,deleteTeamMembership:mt.deleteOne,deleteTeamMemberships:mt.deleteMany}}),{initializeTeamMemberships:FR,addTeamMembership:_R,addTeamMemberships:gR,setTeamMembership:RR,setTeamMemberships:bR,updateTeamMembership:MR,updateTeamMemberships:vR,deleteTeamMembership:ER,deleteTeamMemberships:VR}=Oc.actions,kR=Oc.reducer,BR=t=>t.teamMembershipReducer.instances,Gs=o.createSelector([BR],t=>Object.values(t)),DR=t=>s=>s.teamMembershipReducer.instances[t],WR=m(o.createSelector([Gs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),bD=m(o.createSelector([Gs,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.team===s))e[n.user]=n;return e})),MD=m(o.createSelector([qs,Gs,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.team===e).map(a=>a.user));return A(t.filter(a=>n.has(a.id)))})),ft=O(t=>t.uuid),zR={instances:{}},Ic=o.createSlice({name:"teams",initialState:zR,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,zR)),reducers:{initializeTeams:ft.initialize,addTeam:ft.addOne,addTeams:ft.addMany,setTeam:ft.setOne,setTeams:ft.setMany,updateTeam:ft.updateOne,updateTeams:ft.updateMany,deleteTeam:ft.deleteOne,deleteTeams:ft.deleteMany}}),{initializeTeams:qR,addTeam:jR,addTeams:$R,setTeam:CR,setTeams:UR,updateTeam:LR,updateTeams:NR,deleteTeam:HR,deleteTeams:GR}=Ic.actions,KR=t=>t.teamReducer.instances,Fc=o.createSelector([KR],t=>Object.values(t)),YR=t=>s=>s.teamReducer.instances[t],QR=m(o.createSelector([Fc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),vD=m(o.createSelector([Fc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),JR=Ic.reducer,ED={version:0},ZR=o.createSlice({name:"versioning",initialState:ED,reducers:{}}),XR=ZR.reducer,At=O(t=>t.uuid),xR={instances:{}},_c=o.createSlice({name:"workflows",initialState:xR,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,xR)),reducers:{initializeWorkflows:At.initialize,addWorkflow:At.addOne,addWorkflows:At.addMany,setWorkflow:At.setOne,setWorkflows:At.setMany,updateWorkflow:At.updateOne,updateWorkflows:At.updateMany,deleteWorkflow:At.deleteOne,deleteWorkflows:At.deleteMany}}),{initializeWorkflows:eb,addWorkflow:tb,addWorkflows:sb,setWorkflow:ib,setWorkflows:nb,updateWorkflow:ab,updateWorkflows:cb,deleteWorkflow:rb,deleteWorkflows:db}=_c.actions,lb=t=>t.workflowReducer.instances,Ks=o.createSelector([lb],t=>Object.values(t)),ub=t=>s=>s.workflowReducer.instances[t],ob=m(o.createSelector([Ks,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),VD=m(o.createSelector([Ks,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),kD=m(o.createSelector([Ks,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_type===s)))),hb=_c.reducer,wt=O(t=>t.uuid),pb={instances:{}},gc=o.createSlice({name:"workflowIssueLinks",initialState:pb,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,pb)),reducers:{initializeWorkflowIssueLinks:wt.initialize,addWorkflowIssueLink:wt.addOne,addWorkflowIssueLinks:wt.addMany,setWorkflowIssueLink:wt.setOne,setWorkflowIssueLinks:wt.setMany,updateWorkflowIssueLink:wt.updateOne,updateWorkflowIssueLinks:wt.updateMany,deleteWorkflowIssueLink:wt.deleteOne,deleteWorkflowIssueLinks:wt.deleteMany}}),{initializeWorkflowIssueLinks:yb,addWorkflowIssueLink:Sb,addWorkflowIssueLinks:hs,setWorkflowIssueLink:mb,setWorkflowIssueLinks:fb,updateWorkflowIssueLink:Ab,updateWorkflowIssueLinks:wb,deleteWorkflowIssueLink:Pb,deleteWorkflowIssueLinks:ps}=gc.actions,Tb=t=>t.workflowIssueLinkReducer.instances,Yt=o.createSelector([Tb],t=>Object.values(t)),Ob=t=>s=>s.workflowIssueLinkReducer.instances[t],Ib=m(o.createSelector([Yt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Fb=m(o.createSelector([Yt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),_b=m(o.createSelector([Yt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({workflow:n})=>e.has(n)))})),gb=m(o.createSelector([Yt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),BD=m(o.createSelector([Yt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({issue:n})=>e.has(n)))})),Rb=gc.reducer,Pt=O(t=>t.uuid),bb={instances:{}},Rc=o.createSlice({name:"workflowStepAssignees",initialState:bb,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,bb)),reducers:{initializeWorkflowStepAssignees:Pt.initialize,addWorkflowStepAssignee:Pt.addOne,addWorkflowStepAssignees:Pt.addMany,setWorkflowStepAssignee:Pt.setOne,setWorkflowStepAssignees:Pt.setMany,updateWorkflowStepAssignee:Pt.updateOne,updateWorkflowStepAssignees:Pt.updateMany,deleteWorkflowStepAssignee:Pt.deleteOne,deleteWorkflowStepAssignees:Pt.deleteMany}}),{initializeWorkflowStepAssignees:Mb,addWorkflowStepAssignee:vb,addWorkflowStepAssignees:Eb,setWorkflowStepAssignee:Vb,setWorkflowStepAssignees:kb,updateWorkflowStepAssignee:Bb,updateWorkflowStepAssignees:Db,deleteWorkflowStepAssignee:Wb,deleteWorkflowStepAssignees:zb}=Rc.actions,qb=t=>t.workflowStepAssigneeReducer.instances,ys=o.createSelector([qb],t=>Object.values(t)),jb=t=>s=>s.workflowStepAssigneeReducer.instances[t],$b=m(o.createSelector([ys,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),DD=m(o.createSelector([ys,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),WD=m(o.createSelector([ys,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),zD=m(o.createSelector([ys,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),Cb=Rc.reducer,Tt=O(t=>t.uuid),Ub={instances:{}},bc=o.createSlice({name:"workflowStepComments",initialState:Ub,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Ub)),reducers:{initializeWorkflowStepComments:Tt.initialize,addWorkflowStepComment:Tt.addOne,addWorkflowStepComments:Tt.addMany,setWorkflowStepComment:Tt.setOne,setWorkflowStepComments:Tt.setMany,updateWorkflowStepComment:Tt.updateOne,updateWorkflowStepComments:Tt.updateMany,deleteWorkflowStepComment:Tt.deleteOne,deleteWorkflowStepComments:Tt.deleteMany}}),{initializeWorkflowStepComments:Lb,addWorkflowStepComment:Nb,addWorkflowStepComments:Hb,setWorkflowStepComment:Gb,setWorkflowStepComments:Kb,updateWorkflowStepComment:Yb,updateWorkflowStepComments:Qb,deleteWorkflowStepComment:Jb,deleteWorkflowStepComments:Zb}=bc.actions,Xb=t=>t.workflowStepCommentReducer.instances,Ss=o.createSelector([Xb],t=>Object.values(t)),xb=t=>s=>s.workflowStepCommentReducer.instances[t],eM=m(o.createSelector([Ss,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),qD=m(o.createSelector([Ss,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),jD=m(o.createSelector([Ss,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),$D=m(o.createSelector([Ss,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),tM=bc.reducer,Ot=O(t=>t.uuid),sM={instances:{}},Mc=o.createSlice({name:"workflowStepDefaultAssignees",initialState:sM,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,sM)),reducers:{initializeWorkflowStepDefaultAssignees:Ot.initialize,addWorkflowStepDefaultAssignee:Ot.addOne,addWorkflowStepDefaultAssignees:Ot.addMany,setWorkflowStepDefaultAssignee:Ot.setOne,setWorkflowStepDefaultAssignees:Ot.setMany,updateWorkflowStepDefaultAssignee:Ot.updateOne,updateWorkflowStepDefaultAssignees:Ot.updateMany,deleteWorkflowStepDefaultAssignee:Ot.deleteOne,deleteWorkflowStepDefaultAssignees:Ot.deleteMany}}),{initializeWorkflowStepDefaultAssignees:iM,addWorkflowStepDefaultAssignee:nM,addWorkflowStepDefaultAssignees:aM,setWorkflowStepDefaultAssignee:cM,setWorkflowStepDefaultAssignees:rM,updateWorkflowStepDefaultAssignee:dM,updateWorkflowStepDefaultAssignees:lM,deleteWorkflowStepDefaultAssignee:uM,deleteWorkflowStepDefaultAssignees:oM}=Mc.actions,hM=t=>t.workflowStepDefaultAssigneeReducer.instances,vc=o.createSelector([hM],t=>Object.values(t)),pM=t=>s=>s.workflowStepDefaultAssigneeReducer.instances[t],yM=m(o.createSelector([vc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),CD=m(o.createSelector([vc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),SM=Mc.reducer,It=O(t=>t.uuid),mM={instances:{}},Ec=o.createSlice({name:"workflowStepDefaultReviewers",initialState:mM,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,mM)),reducers:{initializeWorkflowStepDefaultReviewers:It.initialize,addWorkflowStepDefaultReviewer:It.addOne,addWorkflowStepDefaultReviewers:It.addMany,setWorkflowStepDefaultReviewer:It.setOne,setWorkflowStepDefaultReviewers:It.setMany,updateWorkflowStepDefaultReviewer:It.updateOne,updateWorkflowStepDefaultReviewers:It.updateMany,deleteWorkflowStepDefaultReviewer:It.deleteOne,deleteWorkflowStepDefaultReviewers:It.deleteMany}}),{initializeWorkflowStepDefaultReviewers:fM,addWorkflowStepDefaultReviewer:AM,addWorkflowStepDefaultReviewers:wM,setWorkflowStepDefaultReviewer:PM,setWorkflowStepDefaultReviewers:TM,updateWorkflowStepDefaultReviewer:OM,updateWorkflowStepDefaultReviewers:IM,deleteWorkflowStepDefaultReviewer:FM,deleteWorkflowStepDefaultReviewers:_M}=Ec.actions,gM=t=>t.workflowStepDefaultReviewerReducer.instances,Vc=o.createSelector([gM],t=>Object.values(t)),RM=t=>s=>s.workflowStepDefaultReviewerReducer.instances[t],bM=m(o.createSelector([Vc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),UD=m(o.createSelector([Vc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),MM=Ec.reducer,Ft=O(t=>t.uuid),vM={instances:{}},kc=o.createSlice({name:"workflowStepEvents",initialState:vM,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,vM)),reducers:{initializeWorkflowStepEvents:Ft.initialize,addWorkflowStepEvent:Ft.addOne,addWorkflowStepEvents:Ft.addMany,setWorkflowStepEvent:Ft.setOne,setWorkflowStepEvents:Ft.setMany,updateWorkflowStepEvent:Ft.updateOne,updateWorkflowStepEvents:Ft.updateMany,deleteWorkflowStepEvent:Ft.deleteOne,deleteWorkflowStepEvents:Ft.deleteMany}}),{initializeWorkflowStepEvents:EM,addWorkflowStepEvent:VM,addWorkflowStepEvents:kM,setWorkflowStepEvent:BM,setWorkflowStepEvents:DM,updateWorkflowStepEvent:WM,updateWorkflowStepEvents:zM,deleteWorkflowStepEvent:qM,deleteWorkflowStepEvents:jM}=kc.actions,$M=t=>t.workflowStepEventReducer.instances,ms=o.createSelector([$M],t=>Object.values(t)),CM=t=>s=>s.workflowStepEventReducer.instances[t],UM=m(o.createSelector([ms,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),LD=m(o.createSelector([ms,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),ND=m(o.createSelector([ms,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),HD=m(o.createSelector([ms,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),LM=kc.reducer,_t=O(t=>t.uuid),NM={instances:{}},Bc=o.createSlice({name:"workflowStepFieldsAttachments",initialState:NM,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,NM)),reducers:{initializeWorkflowStepFieldsAttachments:_t.initialize,addWorkflowStepFieldsAttachment:_t.addOne,addWorkflowStepFieldsAttachments:_t.addMany,setWorkflowStepFieldsAttachment:_t.setOne,setWorkflowStepFieldsAttachments:_t.setMany,updateWorkflowStepFieldsAttachment:_t.updateOne,updateWorkflowStepFieldsAttachments:_t.updateMany,deleteWorkflowStepFieldsAttachment:_t.deleteOne,deleteWorkflowStepFieldsAttachments:_t.deleteMany}}),{initializeWorkflowStepFieldsAttachments:HM,addWorkflowStepFieldsAttachment:GM,addWorkflowStepFieldsAttachments:Dc,setWorkflowStepFieldsAttachment:KM,setWorkflowStepFieldsAttachments:YM,updateWorkflowStepFieldsAttachment:QM,updateWorkflowStepFieldsAttachments:JM,deleteWorkflowStepFieldsAttachment:ZM,deleteWorkflowStepFieldsAttachments:Wc}=Bc.actions,XM=t=>t.workflowStepFieldsAttachmentReducer.instances,zc=o.createSelector([XM],t=>Object.values(t)),xM=m(o.createSelector([zc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),ev=t=>s=>s.workflowStepFieldsAttachmentReducer.instances[t],tv=m(o.createSelector([zc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),sv=Bc.reducer,gt=O(t=>t.uuid),iv={instances:{}},qc=o.createSlice({name:"workflowStepFields",initialState:iv,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,iv)),reducers:{initializeWorkflowStepFields:gt.initialize,addWorkflowStepFields:gt.addOne,addWorkflowStepFieldsMany:gt.addMany,setWorkflowStepFields:gt.setOne,setWorkflowStepFieldsMany:gt.setMany,updateWorkflowStepFields:gt.updateOne,updateWorkflowStepFieldsMany:gt.updateMany,deleteWorkflowStepFields:gt.deleteOne,deleteWorkflowStepFieldsMany:gt.deleteMany}}),{initializeWorkflowStepFields:nv,addWorkflowStepFields:av,addWorkflowStepFieldsMany:cv,setWorkflowStepFields:rv,setWorkflowStepFieldsMany:dv,updateWorkflowStepFields:lv,updateWorkflowStepFieldsMany:uv,deleteWorkflowStepFields:ov,deleteWorkflowStepFieldsMany:hv}=qc.actions,pv=t=>t.workflowStepFieldsReducer.instances,Ys=o.createSelector([pv],t=>Object.values(t)),GD=m(o.createSelector([Ys,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),KD=m(o.createSelector([Ys,(t,s)=>s],(t,s)=>t.filter(e=>e.workflow_step===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),yv=t=>s=>s.workflowStepFieldsReducer.instances[t],Sv=m(o.createSelector([Ys,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),mv=qc.reducer,Rt=O(t=>t.uuid),fv={instances:{}},jc=o.createSlice({name:"workflowStepFieldValuesAttachments",initialState:fv,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,fv)),reducers:{initializeWorkflowStepFieldValuesAttachments:Rt.initialize,addWorkflowStepFieldValuesAttachment:Rt.addOne,addWorkflowStepFieldValuesAttachments:Rt.addMany,setWorkflowStepFieldValuesAttachment:Rt.setOne,setWorkflowStepFieldValuesAttachments:Rt.setMany,updateWorkflowStepFieldValuesAttachment:Rt.updateOne,updateWorkflowStepFieldValuesAttachments:Rt.updateMany,deleteWorkflowStepFieldValuesAttachment:Rt.deleteOne,deleteWorkflowStepFieldValuesAttachments:Rt.deleteMany}}),{initializeWorkflowStepFieldValuesAttachments:Av,addWorkflowStepFieldValuesAttachment:wv,addWorkflowStepFieldValuesAttachments:$c,setWorkflowStepFieldValuesAttachment:Pv,setWorkflowStepFieldValuesAttachments:Tv,updateWorkflowStepFieldValuesAttachment:Ov,updateWorkflowStepFieldValuesAttachments:Iv,deleteWorkflowStepFieldValuesAttachment:Fv,deleteWorkflowStepFieldValuesAttachments:Cc}=jc.actions,_v=t=>t.workflowStepFieldValuesAttachmentReducer.instances,Uc=o.createSelector([_v],t=>Object.values(t)),gv=t=>s=>s.workflowStepFieldValuesAttachmentReducer.instances[t],Rv=m(o.createSelector([Uc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),bv=m(o.createSelector([Uc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Mv=jc.reducer,bt=O(t=>t.uuid),vv={instances:{}},Lc=o.createSlice({name:"workflowStepFieldValues",initialState:vv,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,vv)),reducers:{initializeWorkflowStepFieldValues:bt.initialize,addWorkflowStepFieldValues:bt.addOne,addWorkflowStepFieldValuesMany:bt.addMany,setWorkflowStepFieldValues:bt.setOne,setWorkflowStepFieldValuesMany:bt.setMany,updateWorkflowStepFieldValues:bt.updateOne,updateWorkflowStepFieldValuesMany:bt.updateMany,deleteWorkflowStepFieldValues:bt.deleteOne,deleteWorkflowStepFieldValuesMany:bt.deleteMany}}),{initializeWorkflowStepFieldValues:Ev,addWorkflowStepFieldValues:Vv,addWorkflowStepFieldValuesMany:kv,setWorkflowStepFieldValues:Bv,setWorkflowStepFieldValuesMany:Dv,updateWorkflowStepFieldValues:Wv,updateWorkflowStepFieldValuesMany:zv,deleteWorkflowStepFieldValues:qv,deleteWorkflowStepFieldValuesMany:jv}=Lc.actions,$v=t=>t.workflowStepFieldValuesReducer.instances,Wt=o.createSelector([$v],t=>Object.values(t)),YD=m(o.createSelector([Wt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),QD=m(o.createSelector([Wt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),Cv=t=>s=>s.workflowStepFieldValuesReducer.instances[t],Uv=m(o.createSelector([Wt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),JD=m(o.createSelector([Wt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),ZD=m(o.createSelector([Wt,(t,s)=>s],(t,s)=>{const e={};for(const n of t){const{workflow:a,workflow_step:c}=n;if(a!==s)continue;const r=e[c];(!r||r.submitted_at<=n.submitted_at)&&(e[c]=n)}return e})),Lv=Lc.reducer,Mt=O(t=>t.uuid),Nv={instances:{}},Nc=o.createSlice({name:"workflowStepFieldValuesReviewRequests",initialState:Nv,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Nv)),reducers:{initializeWorkflowStepFieldValuesReviewRequests:Mt.initialize,addWorkflowStepFieldValuesReviewRequest:Mt.addOne,addWorkflowStepFieldValuesReviewRequests:Mt.addMany,setWorkflowStepFieldValuesReviewRequest:Mt.setOne,setWorkflowStepFieldValuesReviewRequests:Mt.setMany,updateWorkflowStepFieldValuesReviewRequest:Mt.updateOne,updateWorkflowStepFieldValuesReviewRequests:Mt.updateMany,deleteWorkflowStepFieldValuesReviewRequest:Mt.deleteOne,deleteWorkflowStepFieldValuesReviewRequests:Mt.deleteMany}}),{initializeWorkflowStepFieldValuesReviewRequests:Hv,addWorkflowStepFieldValuesReviewRequest:Gv,addWorkflowStepFieldValuesReviewRequests:Hc,setWorkflowStepFieldValuesReviewRequest:Kv,setWorkflowStepFieldValuesReviewRequests:Yv,updateWorkflowStepFieldValuesReviewRequest:Qv,updateWorkflowStepFieldValuesReviewRequests:Jv,deleteWorkflowStepFieldValuesReviewRequest:Zv,deleteWorkflowStepFieldValuesReviewRequests:Gc}=Nc.actions,Xv=t=>t.workflowStepFieldValuesReviewRequestReducer.instances,fs=o.createSelector([Xv],t=>Object.values(t)),xv=t=>s=>s.workflowStepFieldValuesReviewRequestReducer.instances[t],eE=m(o.createSelector([fs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),tE=m(o.createSelector([fs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),XD=m(o.createSelector([fs,(t,s)=>s],(t,s)=>{let e;for(const n of t){const{field_values:a}=n;a===s&&(!e||e.submitted_at<=n.submitted_at)&&(e=n)}return e})),xD=m(o.createSelector([Wt,fs,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(E(t.filter(({workflow_step:c,workflow:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),sE=Nc.reducer,vt=O(t=>t.uuid),iE={instances:{}},Kc=o.createSlice({name:"workflowStepFieldValuesReviews",initialState:iE,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,iE)),reducers:{initializeWorkflowStepFieldValuesReviews:vt.initialize,addWorkflowStepFieldValuesReview:vt.addOne,addWorkflowStepFieldValuesReviews:vt.addMany,setWorkflowStepFieldValuesReview:vt.setOne,setWorkflowStepFieldValuesReviews:vt.setMany,updateWorkflowStepFieldValuesReview:vt.updateOne,updateWorkflowStepFieldValuesReviews:vt.updateMany,deleteWorkflowStepFieldValuesReview:vt.deleteOne,deleteWorkflowStepFieldValuesReviews:vt.deleteMany}}),{initializeWorkflowStepFieldValuesReviews:nE,addWorkflowStepFieldValuesReview:aE,addWorkflowStepFieldValuesReviews:Yc,setWorkflowStepFieldValuesReview:cE,setWorkflowStepFieldValuesReviews:rE,updateWorkflowStepFieldValuesReview:dE,updateWorkflowStepFieldValuesReviews:lE,deleteWorkflowStepFieldValuesReview:uE,deleteWorkflowStepFieldValuesReviews:Qc}=Kc.actions,oE=t=>t.workflowStepFieldValuesReviewReducer.instances,Qt=o.createSelector([oE],t=>Object.values(t)),hE=t=>s=>s.workflowStepFieldValuesReviewReducer.instances[t],pE=m(o.createSelector([Qt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yE=m(o.createSelector([Qt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),eW=m(o.createSelector([Qt,(t,s)=>s],(t,s)=>{let e;for(const n of t){const{field_values:a}=n;a===s&&(!e||e.submitted_at<=n.submitted_at)&&(e=n)}return e})),tW=m(o.createSelector([Wt,Qt,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(E(t.filter(({workflow_step:c,workflow:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),sW=o.createSelector([Qt],t=>{const s={};for(const e of t){const{field_values:n}=e,a=s[n];(!a||a.submitted_at<=e.submitted_at)&&(s[n]=e)}return s}),SE=Kc.reducer,Et=O(t=>t.uuid),mE={instances:{}},Jc=o.createSlice({name:"workflowStepReviewers",initialState:mE,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,mE)),reducers:{initializeWorkflowStepReviewers:Et.initialize,addWorkflowStepReviewer:Et.addOne,addWorkflowStepReviewers:Et.addMany,setWorkflowStepReviewer:Et.setOne,setWorkflowStepReviewers:Et.setMany,updateWorkflowStepReviewer:Et.updateOne,updateWorkflowStepReviewers:Et.updateMany,deleteWorkflowStepReviewer:Et.deleteOne,deleteWorkflowStepReviewers:Et.deleteMany}}),{initializeWorkflowStepReviewers:fE,addWorkflowStepReviewer:AE,addWorkflowStepReviewers:wE,setWorkflowStepReviewer:PE,setWorkflowStepReviewers:TE,updateWorkflowStepReviewer:OE,updateWorkflowStepReviewers:IE,deleteWorkflowStepReviewer:FE,deleteWorkflowStepReviewers:_E}=Jc.actions,gE=t=>t.workflowStepReviewerReducer.instances,As=o.createSelector([gE],t=>Object.values(t)),RE=t=>s=>s.workflowStepReviewerReducer.instances[t],bE=m(o.createSelector([As,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),iW=m(o.createSelector([As,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),nW=m(o.createSelector([As,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),aW=m(o.createSelector([As,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),ME=Jc.reducer,Vt=O(t=>t.uuid),vE={instances:{}},Zc=o.createSlice({name:"workflowSteps",initialState:vE,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,vE)),reducers:{initializeWorkflowSteps:Vt.initialize,addWorkflowStep:Vt.addOne,addWorkflowSteps:Vt.addMany,setWorkflowStep:Vt.setOne,setWorkflowSteps:Vt.setMany,updateWorkflowStep:Vt.updateOne,updateWorkflowSteps:Vt.updateMany,deleteWorkflowStep:Vt.deleteOne,deleteWorkflowSteps:Vt.deleteMany}}),{initializeWorkflowSteps:EE,addWorkflowStep:VE,addWorkflowSteps:kE,setWorkflowStep:BE,setWorkflowSteps:DE,updateWorkflowStep:WE,updateWorkflowSteps:zE,deleteWorkflowStep:qE,deleteWorkflowSteps:jE}=Zc.actions,$E=t=>t.workflowStepReducer.instances,Xc=o.createSelector([$E],t=>Object.values(t)),CE=t=>s=>s.workflowStepReducer.instances[t],UE=m(o.createSelector([Xc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),cW=m(o.createSelector([Xc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_type===s)))),LE=Zc.reducer,kt=O(t=>t.uuid),NE={instances:{}},xc=o.createSlice({name:"workflowTypes",initialState:NE,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,NE)),reducers:{initializeWorkflowTypes:kt.initialize,addWorkflowType:kt.addOne,addWorkflowTypes:kt.addMany,setWorkflowType:kt.setOne,setWorkflowTypes:kt.setMany,updateWorkflowType:kt.updateOne,updateWorkflowTypes:kt.updateMany,deleteWorkflowType:kt.deleteOne,deleteWorkflowTypes:kt.deleteMany}}),{initializeWorkflowTypes:HE,addWorkflowType:GE,addWorkflowTypes:KE,setWorkflowType:YE,setWorkflowTypes:QE,updateWorkflowType:JE,updateWorkflowTypes:ZE,deleteWorkflowType:XE,deleteWorkflowTypes:xE}=xc.actions,eV=t=>t.workflowTypeReducer.instances,er=o.createSelector([eV],t=>Object.values(t)),tV=t=>s=>s.workflowTypeReducer.instances[t],sV=m(o.createSelector([er,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),rW=m(o.createSelector([er,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),iV=xc.reducer,tr={outboxReducer:vT,fileReducer:Xy,authReducer:ry},dW=o.combineReducers(tr),nV={...tr,[ts]:XR,assetReducer:yo,assetAttachmentReducer:Xr,assetStageCompletionReducer:_o,assetStageReducer:$o,assetTypeReducer:Np,assetTypeAttachmentReducer:th,issueReducer:hA,issueAttachmentReducer:gf,issueTypeReducer:SP,issueTypeAttachmentReducer:gA,organizationReducer:FT,projectReducer:MO,projectAttachmentReducer:iO,projectAccessReducer:CT,organizationAccessReducer:cT,projectFileReducer:AO,procedureTypeReducer:AR,procedureReducer:CO,procedureTypeFieldsReducer:Eg,procedureTypeFieldValuesReducer:nR,procedureTypeFieldsAttachmentReducer:fg,procedureTypeFieldValuesAttachmentReducer:Lg,procedureStepFieldsAttachmentReducer:PF,procedureStepFieldsReducer:kF,procedureStepFieldValuesAttachmentReducer:GF,procedureStepFieldValuesReducer:c_,procedureStepFieldValuesReviewReducer:V_,procedureStepFieldValuesReviewRequestReducer:w_,procedureStepAssigneeReducer:aI,procedureStepCommentReducer:wI,procedureStepDefaultAssigneeReducer:kI,procedureStepDefaultReviewerReducer:KI,procedureStepEventReducer:rF,procedureStepReviewerReducer:G_,procedureStepReducer:ig,rehydratedReducer:OR,formReducer:rm,formRevisionReducer:JS,formRevisionAttachmentReducer:$S,formSubmissionAttachmentReducer:Om,formSubmissionReducer:Dm,formIdentifierReducer:hS,formIdentifierValueReducer:gS,userReducer:KP,emailDomainsReducer:Qy,documentsReducer:Vy,documentAttachmentReducer:Ty,teamReducer:JR,agentsReducer:jr,issueCommentReducer:xf,issueCommentAttachmentReducer:$f,issueUpdateReducer:qP,geoImageReducer:Qm,issueAssociationReducer:pf,issueTypeFieldsReducer:yw,issueTypeFieldValuesReducer:ew,issueTypeFieldsAttachmentReducer:$A,issueTypeFieldValuesAttachmentReducer:Rw,issueTypeIdentifierReducer:Cw,issueTypeIdentifierValueReducer:tP,issueTypeStatusReducer:bP,assetTypeFieldsReducer:Mh,assetTypeFieldValuesReducer:sp,assetTypeFieldsAttachmentReducer:Sh,assetTypeFieldValuesAttachmentReducer:Uh,assetTypeIdentifierReducer:mp,assetTypeIdentifierValueReducer:vp,assetTypeStatusReducer:ny,assetProcedureTypeReducer:zl,assetProcedureReducer:Ol,assetProcedureTypeFieldsReducer:zd,assetProcedureTypeFieldValuesReducer:ul,assetProcedureTypeFieldsAttachmentReducer:Id,assetProcedureTypeFieldValuesAttachmentReducer:Qd,assetProcedureTypeAttachmentReducer:ld,assetProcedureStepFieldsAttachmentReducer:eu,assetProcedureStepFieldsReducer:pu,assetProcedureStepFieldValuesAttachmentReducer:gu,assetProcedureStepFieldValuesReducer:$u,assetProcedureStepReducer:Zu,teamMembershipReducer:kR,workflowTypeReducer:iV,workflowStepReducer:LE,workflowStepFieldsReducer:mv,workflowStepFieldsAttachmentReducer:sv,workflowReducer:hb,workflowIssueLinkReducer:Rb,workflowStepAssigneeReducer:Cb,workflowStepCommentReducer:tM,workflowStepDefaultAssigneeReducer:SM,workflowStepDefaultReviewerReducer:MM,workflowStepEventReducer:LM,workflowStepFieldValuesReducer:Lv,workflowStepFieldValuesAttachmentReducer:Mv,workflowStepFieldValuesReviewReducer:SE,workflowStepFieldValuesReviewRequestReducer:sE,workflowStepReviewerReducer:ME},lW=o.combineReducers(nV),aV=1e4,cV=200,sr=[400,409,403,404,405,500],L=1e4,rV={};class dV{constructor(s){p(this,"client");p(this,"pageSize",aV);rV[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)}}const lV=()=>hV.length-1,uV=t=>(t[ts]={version:lV()},t),oV=()=>uV({}),uW=t=>(t.outboxReducer&&(t.outboxReducer.deletedRequests=[]),t),oW=t=>s=>{var e;return s===void 0&&(s={}),((e=s[ts])==null?void 0:e.version)===lV()?s:t(s)},hV=[uV,oV,oV,uW],hW=Object.fromEntries(hV.map((t,s)=>[s,oW(t)])),pW=t=>{if(t)throw t;const s=Xt();s?s.dispatch({type:"rehydrated/setRehydrated",payload:!0}):console.error("Client store not set")},pV=(t,s,e)=>{const n=Ut();return n?(n.addRequest(s),n.getQueue()):(console.warn("Outbox coordinator not set; cannot enqueue request yet."),[])},yV=(t,s,e)=>{const n=Ut();if(!n)return console.warn("Outbox coordinator not set; cannot dequeue request yet."),[];const c=s.meta.offlineAction.payload.uuid;return n.remove(c),n.getQueue()};async function yW(t,s){if(!s.payload)throw new Error("Received empty payload");return bV(s)}const SW={...dr,effect:yW,discard:mV,returnPromises:!0,persistCallback:pW,retry:wW,persistOptions:{storage:DV},queue:{...dr.queue,enqueue:pV,dequeue:yV,peek:(...t)=>AW(...t)}},mW=WV(hW,ts),fW=o.compose(BV.offline(SW),mW);async function SV(t,s,e){if(s.store.getState().outboxReducer.deletedRequests.includes(t.payload.uuid))throw new Error("Request was marked for deletion");const a=rV[t.meta.offline.effect.serviceName];if(!a)throw new Error(`Service ${t.meta.offline.effect.serviceName} not found`);return nr(t.meta.offline.effect.BASE_URL,t.meta.offline.effect.request,s,a,e)}function mV(t,s,e=0){var u;if(console.debug("Considering discarding request due to error:",t,`(${typeof t})`,`
|
|
1
|
+
(function(i,U){typeof exports=="object"&&typeof module<"u"?U(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"],U):(i=typeof globalThis<"u"?globalThis:i||self,U(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,U,o,Nt,Dt,QV,JV,Zs,Ht,ZV,or,XV,xV,Uq,Lq,ek,tk,sk){"use strict";var $q=Object.defineProperty;var Cq=(i,U,o)=>U in i?$q(i,U,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[U]=o;var p=(i,U,o)=>Cq(i,typeof U!="symbol"?U+"":U,o);var KV;const hr=Object.freeze([]),pr=Object.freeze({});var yr=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))(yr||{}),h=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(h||{}),Sr=(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))(Sr||{}),mr=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(mr||{}),Xs=(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))(Xs||{}),$=(t=>(t.STATUS="status",t.PRIORITY="priority",t.DESCRIPTION="description",t.TITLE="title",t.ASSIGNED_TO="assigned_to",t.DUE_DATE="due_date",t))($||{}),fr=(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))(fr||{}),Ar=(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[t.ADD_REVIEW_REQUEST=8]="ADD_REVIEW_REQUEST",t[t.REMOVE_REVIEW_REQUEST=10]="REMOVE_REVIEW_REQUEST",t))(Ar||{}),Gt=(t=>(t[t.ACTIVE=0]="ACTIVE",t[t.COMPLETED=2]="COMPLETED",t[t.CANCELLED=4]="CANCELLED",t))(Gt||{}),ts=(t=>(t[t.APPROVED=0]="APPROVED",t[t.REJECTED=2]="REJECTED",t[t.CHANGES_REQUESTED=4]="CHANGES_REQUESTED",t))(ts||{}),wr=(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[t.ADD_REVIEW_REQUEST=8]="ADD_REVIEW_REQUEST",t[t.REMOVE_REVIEW_REQUEST=10]="REMOVE_REVIEW_REQUEST",t))(wr||{}),Pr=(t=>(t[t.APPROVED=0]="APPROVED",t[t.REJECTED=2]="REJECTED",t[t.CHANGES_REQUESTED=4]="CHANGES_REQUESTED",t))(Pr||{});const ik=Xs.MEDIUM,Tr=6e4,nk=[ts.APPROVED,ts.REJECTED,ts.CHANGES_REQUESTED],ak=[Gt.ACTIVE,Gt.COMPLETED,Gt.CANCELLED],ck=Gt.ACTIVE;function O(t){return{addOne:(y,S)=>{const f=t(S.payload);y.instances[f]=S.payload},addMany:(y,S)=>{for(const f of S.payload){const F=t(f);y.instances[F]=f}},setOne:(y,S)=>{const f=t(S.payload);y.instances[f]=S.payload},setMany:(y,S)=>{for(const f of S.payload){const F=t(f);y.instances[F]=f}},updateOne:(y,S)=>{const f=t(S.payload);y.instances[f]=S.payload},updateMany:(y,S)=>{for(const f of S.payload){const F=t(f);y.instances[F]=f}},deleteOne:(y,S)=>{delete y.instances[S.payload]},deleteMany:(y,S)=>{for(const f of S.payload)delete y.instances[f]},initialize:(y,S)=>{y.instances={};const f=new Set;for(const F of S.payload){const g=t(F);f.add(g),y.instances[g]=F}f.size!==S.payload.length&&console.warn("duplicate ids detected when initializing model instances.")}}}function rk(){return{initializeSelection:(l,u)=>{l.selection=Array.from(new Set(u.payload))},selectOne:(l,u)=>{new Set(l.selection).has(u.payload)||l.selection.push(u.payload)},selectMany:(l,u)=>{const y=new Set(l.selection);for(const S of u.payload)y.has(S)||y.add(S);l.selection=Array.from(y)},unselectOne:(l,u)=>{const y=new Set(l.selection);y.has(u.payload)&&(y.delete(u.payload),l.selection=Array.from(y))},unselectMany:(l,u)=>{const y=new Set(l.selection);for(const S of u.payload)y.has(S)&&y.delete(S);l.selection=Array.from(y)},toggleOne:(l,u)=>{const y=new Set(l.selection);y.has(u.payload)?y.delete(u.payload):y.add(u.payload),l.selection=Array.from(y)},toggleMany:(l,u)=>{const y=new Set(l.selection);for(const S of u.payload)y.has(S)?y.delete(S):y.add(S);l.selection=Array.from(y)},getInitialState:l=>({...l,selection:[]})}}const ss="versioning",T=o.createAction("RESET"),B=o.createAction("RESET_PROJECT_STATE"),I=o.createAction("RESET_ORGANIZATION_STATE");function dk(t,s){return QV.useMemo(t,s)}KV=Symbol.toStringTag;class xs{constructor(){p(this,KV,"Promise");p(this,"_promise");p(this,"_resolve");p(this,"_reject");p(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 ei=!1;["true","1"].includes("".toLowerCase())&&(ei=!0);function lk(t,s){if(t===s)return!0;if(typeof t!=typeof s)return!1;const e=Object.keys(t),n=Object.keys(s),a=e.length;if(a!==n.length)return!1;for(let c=0;c<a;c++){const r=e[c];if(!Object.prototype.hasOwnProperty.call(s,r)||t[r]!==s[r])return!1}return!0}function ti(t){const s={};return function(){const e=Array.prototype.slice.call(arguments);return e in s?(ei&&console.debug(`Memoization debug: Using memorized return value for ${t.toString()}(`,e,")"),s[e]):(ei&&console.debug(`Memoization debug: Cache miss! Memoizing ${t.toString()}(`,e,")"),s[e]=t.apply(this,e))}}function uk(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 A=t=>t.length===0?hr:t,is=t=>Object.keys(t).length===0?pr:t,Or=ti(t=>{if(!t)return"";const s=new Date(t),e=s.getFullYear()===si.getFullYear(),n={day:"numeric",month:"short"};return e||(n.year="numeric"),s.toLocaleDateString([],n)}),ok=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),hk=1e3*86400,si=new Date,pk=t=>new Date(t).toDateString()===si.toDateString(),yk=ti((t,s,e)=>{const n=Math.round((new Date(t).getTime()-si.getTime())/hk);return n<s||n>e?Or(t):ok.format(n,"days")});function Sk(t){return new Uint8Array(t).reduce((e,n)=>e+n.toString(16).padStart(2,"0"),"")}function Ts(t){return new Promise((s,e)=>{const n=new FileReader;n.onload=()=>{const a=n.result;if(!a){e(new Error("FileReader did not return a valid ArrayBuffer."));return}crypto.subtle.digest("SHA-1",a).then(c=>{const r=Sk(c);s(r)})},n.readAsArrayBuffer(t)})}const mk=(t,s)=>`${t}${s?`.${s}`:""}`;function fk(t,s){return new File([t],s,{type:t.type})}function Ir(t){const s=t.name;return s.includes(".")?s.split(".").pop():""}const Fr=async t=>(await fetch(t)).blob(),_r=async(t,s)=>{const e=await Fr(t);return new File([e],s,{type:e.type})};function Ak(t){const s=new Blob([t]);JV.saveAs(s,t.name)}function gr(t){return typeof t=="string"&&t.startsWith("blob:")}function wk(t){return t.type.startsWith("image/")}const Rr={};function Pk(t,s,e,...n){const a=Rr[t];let c=!1;a?a[s]||(a[s]=!0,c=!0):(Rr[t]={[s]:!0},c=!0),c&&console[e](...n)}const br=["created_at","updated_at","index","revision"];function P(t){return{...t,uuid:Dt.v4()}}function Tk(t){const s={};for(const e of t)s[e.uuid]=e;return s}function E(t){return t.map(({uuid:s})=>s)}function Os(t,s){return t.localeCompare(s)}function ii(t,s){return Os(t.uuid,s.uuid)}function Ok(t,s=void 0,e=255){let n=t.replace(/[^a-z0-9_\-.]/gi,"_").replace(/_{2,}/g,"_");if(!s){const c=t.split(".");c.length>1&&(s=c[c.length-1])}s&&!s.startsWith(".")&&(s="."+s);const a=s?s.length:0;return n.length+a>e&&(n=n.slice(0,e-a)+(s||"")),n}function Ik(t){return t.toLowerCase().replace(" ","-")}function Fk(t,s=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,s?"_":"-")}function _k(t,s){if(t.length<=s)return t;const e=t.slice(0,s-1);return e.slice(0,e.lastIndexOf(" "))+"…"}const gk=/^.+@.+\..+$/;function R(t){const s={...t};for(const e of[...br,"created_by"])e in s&&delete s[e];return s}const Mr=t=>{const s=t.toSorted((e,n)=>e.order-n.order);return Zs(s,{id:e=>e.uuid,parentId:e=>e.parent,includeEmptyChildrenArray:!0,valueKey:!1})},Rk=t=>{const{roots:s}=Mr(t);return s.map(e=>new Ht.Tree(e))},vr=(t,s)=>{const{nodes:e}=Mr(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in asset procedure step tree.`);return new Ht.Tree(n)},Er=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,Vr=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,kr=t=>Zs(t,{id:s=>s.uuid,parentId:s=>s.parent_document,includeEmptyChildrenArray:!0,valueKey:!1}),bk=t=>{const{roots:s}=kr(t);return s.map(e=>new Ht.Tree(e))},Br=(t,s)=>{const{nodes:e}=kr(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in document tree.`);return new Ht.Tree(n)},Dr=t=>{const s=t.toSorted((e,n)=>e.order-n.order);return Zs(s,{id:e=>e.uuid,parentId:e=>e.parent,includeEmptyChildrenArray:!0,valueKey:!1})},Mk=t=>{const{roots:s}=Dr(t);return s.map(e=>new Ht.Tree(e))},Wr=(t,s)=>{const{nodes:e}=Dr(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in procedure step tree.`);return new Ht.Tree(n)};class vk{constructor(s){p(this,"operations",[]);p(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(a=>a[s]===e)),this}exclude(s,e){return this.operations.push(n=>n.filter(a=>a[s]!==e)),this}orderBy(s){return this.operations.push(e=>[...e].sort((n,a)=>n[s]<=a[s]?1:-1)),this}reverse(){return this.operations.push(s=>[...s].reverse()),this}all(){return this.operations.push(s=>s),this}get(s,e){return o.createSelector([this.getData],n=>this.performOperations(n).find(a=>a[s]===e))}count(){return o.createSelector([this.getData],s=>this.performOperations(s).length)}first(){return o.createSelector([this.getData],s=>this.performOperations(s)[0])}last(){return o.createSelector([this.getData],s=>{const e=this.performOperations(s);return e[e.length-1]})}exists(){return o.createSelector([this.getData],s=>this.performOperations(s).length>0)}toSelector(){return o.createSelector([this.getData],s=>A(this.performOperations(s)))}}const m=t=>(...s)=>e=>t(e,...s),G=O(t=>t.uuid),zr={instances:{}},ni=o.createSlice({name:"agents",initialState:zr,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,zr)),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:qr,addConversation:jr,addConversations:Ek,setConversation:$r,setConversations:Vk,updateConversation:Cr,updateConversations:kk,deleteConversation:Bk,deleteConversations:Dk}=ni.actions,ai=t=>t.agentsReducer.instances,Wk=o.createSelector([ai],t=>Object.values(t)),zk=m(o.createSelector([ai,(t,s)=>s],(t,s)=>t[s])),Ur=ni.reducer,K=O(t=>t.uuid),Lr={instances:{}},ci=o.createSlice({name:"assetAttachments",initialState:Lr,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Lr)),reducers:{initializeAssetAttachments:K.initialize,addAssetAttachment:K.addOne,addAssetAttachments:K.addMany,setAssetAttachment:K.setOne,setAssetAttachments:K.setMany,updateAssetAttachment:K.updateOne,updateAssetAttachments:K.updateMany,deleteAssetAttachment:K.deleteOne,deleteAssetAttachments:K.deleteMany}}),{initializeAssetAttachments:Nr,addAssetAttachment:Hr,addAssetAttachments:ri,setAssetAttachment:Gr,setAssetAttachments:Kr,updateAssetAttachment:Yr,updateAssetAttachments:Qr,deleteAssetAttachment:Jr,deleteAssetAttachments:di}=ci.actions,Zr=t=>t.assetAttachmentReducer.instances,li=o.createSelector([Zr],t=>Object.values(t)),Xr=t=>s=>s.assetAttachmentReducer.instances[t],xr=m(o.createSelector([li,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ed=m(o.createSelector([li,(t,s)=>s],(t,s)=>A(t.filter(({asset:e})=>s===e)))),td=ci.reducer,Y=O(({uuid:t})=>t),sd={instances:{}},ui=o.createSlice({name:"assetProcedureTypeAttachments",initialState:sd,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,sd)),reducers:{initializeAssetProcedureTypeAttachments:Y.initialize,addAssetProcedureTypeAttachment:Y.addOne,addAssetProcedureTypeAttachments:Y.addMany,setAssetProcedureTypeAttachment:Y.setOne,setAssetProcedureTypeAttachments:Y.setMany,updateAssetProcedureTypeAttachment:Y.updateOne,updateAssetProcedureTypeAttachments:Y.updateMany,deleteAssetProcedureTypeAttachment:Y.deleteOne,deleteAssetProcedureTypeAttachments:Y.deleteMany}}),{initializeAssetProcedureTypeAttachments:id,addAssetProcedureTypeAttachment:nd,addAssetProcedureTypeAttachments:ad,setAssetProcedureTypeAttachment:cd,setAssetProcedureTypeAttachments:rd,updateAssetProcedureTypeAttachment:dd,updateAssetProcedureTypeAttachments:ld,deleteAssetProcedureTypeAttachment:ud,deleteAssetProcedureTypeAttachments:od}=ui.actions,hd=ui.reducer,pd=t=>t.assetProcedureTypeAttachmentReducer.instances,oi=o.createSelector([pd],t=>Object.values(t)),yd=t=>s=>s.assetProcedureTypeAttachmentReducer.instances[t],Sd=m(o.createSelector([oi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),qk=m(o.createSelector([oi,(t,s)=>s],(t,s)=>A(t.filter(({asset_procedure_type:e})=>s===e)))),Q=O(({uuid:t})=>t),md={instances:{}},hi=o.createSlice({name:"assetProcedureTypeFieldsAttachments",initialState:md,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,md)),reducers:{initializeAssetProcedureTypeFieldsAttachments:Q.initialize,addAssetProcedureTypeFieldsAttachment:Q.addOne,addAssetProcedureTypeFieldsAttachments:Q.addMany,setAssetProcedureTypeFieldsAttachment:Q.setOne,setAssetProcedureTypeFieldsAttachments:Q.setMany,updateAssetProcedureTypeFieldsAttachment:Q.updateOne,updateAssetProcedureTypeFieldsAttachments:Q.updateMany,deleteAssetProcedureTypeFieldsAttachment:Q.deleteOne,deleteAssetProcedureTypeFieldsAttachments:Q.deleteMany}}),{initializeAssetProcedureTypeFieldsAttachments:fd,addAssetProcedureTypeFieldsAttachment:Ad,addAssetProcedureTypeFieldsAttachments:wd,setAssetProcedureTypeFieldsAttachment:Pd,setAssetProcedureTypeFieldsAttachments:Td,updateAssetProcedureTypeFieldsAttachment:Od,updateAssetProcedureTypeFieldsAttachments:Id,deleteAssetProcedureTypeFieldsAttachment:Fd,deleteAssetProcedureTypeFieldsAttachments:_d}=hi.actions,gd=hi.reducer,Rd=t=>t.assetProcedureTypeFieldsAttachmentReducer.instances,pi=o.createSelector([Rd],t=>Object.values(t)),jk=m(o.createSelector([pi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),bd=t=>s=>s.assetProcedureTypeFieldsAttachmentReducer.instances[t],Md=m(o.createSelector([pi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),J=O(({uuid:t})=>t),vd={instances:{}},yi=o.createSlice({name:"assetProcedureTypeFields",initialState:vd,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,vd)),reducers:{initializeAssetProcedureTypeFields:J.initialize,addAssetProcedureTypeFields:J.addOne,addAssetProcedureTypeFieldsMany:J.addMany,setAssetProcedureTypeFields:J.setOne,setAssetProcedureTypeFieldsMany:J.setMany,updateAssetProcedureTypeFields:J.updateOne,updateAssetProcedureTypeFieldsMany:J.updateMany,deleteAssetProcedureTypeFields:J.deleteOne,deleteAssetProcedureTypeFieldsMany:J.deleteMany}}),{initializeAssetProcedureTypeFields:Ed,addAssetProcedureTypeFields:Vd,addAssetProcedureTypeFieldsMany:kd,setAssetProcedureTypeFields:Bd,setAssetProcedureTypeFieldsMany:Dd,updateAssetProcedureTypeFields:Wd,updateAssetProcedureTypeFieldsMany:zd,deleteAssetProcedureTypeFields:qd,deleteAssetProcedureTypeFieldsMany:jd}=yi.actions,$d=yi.reducer,Cd=t=>t.assetProcedureTypeFieldsReducer.instances,Is=o.createSelector([Cd],t=>Object.values(t)),$k=m(o.createSelector([Is,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),Ck=m(o.createSelector([Is,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_procedure_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Ud=t=>s=>s.assetProcedureTypeFieldsReducer.instances[t],Ld=m(o.createSelector([Is,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Z=O(({uuid:t})=>t),Nd={instances:{}},Si=o.createSlice({name:"assetProcedureTypeFieldValuesAttachments",initialState:Nd,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Nd)),reducers:{initializeAssetProcedureTypeFieldValuesAttachments:Z.initialize,addAssetProcedureTypeFieldValuesAttachment:Z.addOne,addAssetProcedureTypeFieldValuesAttachments:Z.addMany,setAssetProcedureTypeFieldValuesAttachment:Z.setOne,setAssetProcedureTypeFieldValuesAttachments:Z.setMany,updateAssetProcedureTypeFieldValuesAttachment:Z.updateOne,updateAssetProcedureTypeFieldValuesAttachments:Z.updateMany,deleteAssetProcedureTypeFieldValuesAttachment:Z.deleteOne,deleteAssetProcedureTypeFieldValuesAttachments:Z.deleteMany}}),{initializeAssetProcedureTypeFieldValuesAttachments:Hd,addAssetProcedureTypeFieldValuesAttachment:Gd,addAssetProcedureTypeFieldValuesAttachments:mi,setAssetProcedureTypeFieldValuesAttachment:Kd,setAssetProcedureTypeFieldValuesAttachments:Yd,updateAssetProcedureTypeFieldValuesAttachment:Qd,updateAssetProcedureTypeFieldValuesAttachments:Jd,deleteAssetProcedureTypeFieldValuesAttachment:Zd,deleteAssetProcedureTypeFieldValuesAttachments:fi}=Si.actions,Xd=Si.reducer,xd=t=>t.assetProcedureTypeFieldValuesAttachmentReducer.instances,Ai=o.createSelector([xd],t=>Object.values(t)),el=t=>s=>s.assetProcedureTypeFieldValuesAttachmentReducer.instances[t],tl=m(o.createSelector([Ai,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),sl=m(o.createSelector([Ai,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),X=O(({uuid:t})=>t),il={instances:{}},wi=o.createSlice({name:"assetProcedureTypeFieldValues",initialState:il,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,il)),reducers:{initializeAssetProcedureTypeFieldValues:X.initialize,addAssetProcedureTypeFieldValues:X.addOne,addAssetProcedureTypeFieldValuesMany:X.addMany,setAssetProcedureTypeFieldValues:X.setOne,setAssetProcedureTypeFieldValuesMany:X.setMany,updateAssetProcedureTypeFieldValues:X.updateOne,updateAssetProcedureTypeFieldValuesMany:X.updateMany,deleteAssetProcedureTypeFieldValues:X.deleteOne,deleteAssetProcedureTypeFieldValuesMany:X.deleteMany}}),{initializeAssetProcedureTypeFieldValues:nl,addAssetProcedureTypeFieldValues:al,addAssetProcedureTypeFieldValuesMany:cl,setAssetProcedureTypeFieldValues:rl,setAssetProcedureTypeFieldValuesMany:dl,updateAssetProcedureTypeFieldValues:ll,updateAssetProcedureTypeFieldValuesMany:ul,deleteAssetProcedureTypeFieldValues:ol,deleteAssetProcedureTypeFieldValuesMany:hl}=wi.actions,pl=wi.reducer,yl=t=>t.assetProcedureTypeFieldValuesReducer.instances,Fs=o.createSelector([yl],t=>Object.values(t)),Uk=m(o.createSelector([Fs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),Lk=m(o.createSelector([Fs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure===s)))),Sl=t=>s=>s.assetProcedureTypeFieldValuesReducer.instances[t],ml=m(o.createSelector([Fs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),x=O(({uuid:t})=>t),fl={instances:{}},Pi=o.createSlice({name:"assetProcedures",initialState:fl,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,fl)),reducers:{initializeAssetProcedures:x.initialize,addAssetProcedure:x.addOne,addAssetProcedures:x.addMany,setAssetProcedure:x.setOne,setAssetProcedures:x.setMany,updateAssetProcedure:x.updateOne,updateAssetProcedures:x.updateMany,deleteAssetProcedure:x.deleteOne,deleteAssetProcedures:x.deleteMany}}),{initializeAssetProcedures:Al,addAssetProcedure:wl,addAssetProcedures:Ti,updateAssetProcedure:Pl,updateAssetProcedures:Tl,deleteAssetProcedure:Ol,deleteAssetProcedures:Oi,setAssetProcedure:Il,setAssetProcedures:Fl}=Pi.actions,_l=Pi.reducer,gl=t=>t.assetProcedureReducer.instances,_s=o.createSelector([gl],t=>Object.values(t)),Rl=m(o.createSelector([_s,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),Nk=m(o.createSelector([_s,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),bl=t=>s=>s.assetProcedureReducer.instances[t],Ml=m(o.createSelector([_s,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ee=O(t=>t.uuid),vl={instances:{}},Ii=o.createSlice({name:"assetProcedureTypes",initialState:vl,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,vl)),reducers:{initializeAssetProcedureTypes:ee.initialize,addAssetProcedureType:ee.addOne,addAssetProcedureTypes:ee.addMany,setAssetProcedureType:ee.setOne,setAssetProcedureTypes:ee.setMany,updateAssetProcedureType:ee.updateOne,updateAssetProcedureTypes:ee.updateMany,deleteAssetProcedureType:ee.deleteOne,deleteAssetProcedureTypes:ee.deleteMany}}),{initializeAssetProcedureTypes:El,addAssetProcedureType:Vl,addAssetProcedureTypes:kl,updateAssetProcedureType:Bl,updateAssetProcedureTypes:Dl,deleteAssetProcedureType:Wl,deleteAssetProcedureTypes:zl,setAssetProcedureType:ql,setAssetProcedureTypes:jl}=Ii.actions,$l=Ii.reducer,Cl=t=>t.assetProcedureTypeReducer.instances,Fi=o.createSelector([Cl],t=>Object.values(t)),Ul=t=>s=>s.assetProcedureTypeReducer.instances[t],Ll=m(o.createSelector([Fi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Hk=m(o.createSelector([Fi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),te=O(t=>t.uuid),Nl={instances:{}},_i=o.createSlice({name:"assetProcedureStepFieldsAttachments",initialState:Nl,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Nl)),reducers:{initializeAssetProcedureStepFieldsAttachments:te.initialize,addAssetProcedureStepFieldsAttachment:te.addOne,addAssetProcedureStepFieldsAttachments:te.addMany,setAssetProcedureStepFieldsAttachment:te.setOne,setAssetProcedureStepFieldsAttachments:te.setMany,updateAssetProcedureStepFieldsAttachment:te.updateOne,updateAssetProcedureStepFieldsAttachments:te.updateMany,deleteAssetProcedureStepFieldsAttachment:te.deleteOne,deleteAssetProcedureStepFieldsAttachments:te.deleteMany}}),{initializeAssetProcedureStepFieldsAttachments:Hl,addAssetProcedureStepFieldsAttachment:Gl,addAssetProcedureStepFieldsAttachments:Kl,setAssetProcedureStepFieldsAttachment:Yl,setAssetProcedureStepFieldsAttachments:Ql,updateAssetProcedureStepFieldsAttachment:Jl,updateAssetProcedureStepFieldsAttachments:Zl,deleteAssetProcedureStepFieldsAttachment:Xl,deleteAssetProcedureStepFieldsAttachments:xl}=_i.actions,eu=t=>t.assetProcedureStepFieldsAttachmentReducer.instances,gi=o.createSelector([eu],t=>Object.values(t)),Gk=m(o.createSelector([gi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),tu=t=>s=>s.assetProcedureStepFieldsAttachmentReducer.instances[t],su=m(o.createSelector([gi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),iu=_i.reducer,se=O(t=>t.uuid),nu={instances:{}},Ri=o.createSlice({name:"assetProcedureStepFields",initialState:nu,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,nu)),reducers:{initializeAssetProcedureStepFields:se.initialize,addAssetProcedureStepFields:se.addOne,addAssetProcedureStepFieldsMany:se.addMany,setAssetProcedureStepFields:se.setOne,setAssetProcedureStepFieldsMany:se.setMany,updateAssetProcedureStepFields:se.updateOne,updateAssetProcedureStepFieldsMany:se.updateMany,deleteAssetProcedureStepFields:se.deleteOne,deleteAssetProcedureStepFieldsMany:se.deleteMany}}),{initializeAssetProcedureStepFields:au,addAssetProcedureStepFields:cu,addAssetProcedureStepFieldsMany:ru,setAssetProcedureStepFields:du,setAssetProcedureStepFieldsMany:lu,updateAssetProcedureStepFields:uu,updateAssetProcedureStepFieldsMany:ou,deleteAssetProcedureStepFields:hu,deleteAssetProcedureStepFieldsMany:pu}=Ri.actions,bi=t=>t.assetProcedureStepFieldsReducer.instances,gs=o.createSelector([bi],t=>Object.values(t)),Kk=m(o.createSelector([gs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_step===s)))),Yk=m(o.createSelector([gs,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_procedure_step===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Qk=o.createSelector([bi],t=>{const s={};for(const e of Object.values(t)){const n=s[e.asset_procedure_step];(!n||n.submitted_at<e.submitted_at)&&(s[e.asset_procedure_step]=e)}return s}),yu=t=>s=>s.assetProcedureStepFieldsReducer.instances[t],Su=m(o.createSelector([gs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),mu=Ri.reducer,ie=O(t=>t.uuid),fu={instances:{}},Mi=o.createSlice({name:"assetProcedureStepFieldValuesAttachments",initialState:fu,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,fu)),reducers:{initializeAssetProcedureStepFieldValuesAttachments:ie.initialize,addAssetProcedureStepFieldValuesAttachment:ie.addOne,addAssetProcedureStepFieldValuesAttachments:ie.addMany,setAssetProcedureStepFieldValuesAttachment:ie.setOne,setAssetProcedureStepFieldValuesAttachments:ie.setMany,updateAssetProcedureStepFieldValuesAttachment:ie.updateOne,updateAssetProcedureStepFieldValuesAttachments:ie.updateMany,deleteAssetProcedureStepFieldValuesAttachment:ie.deleteOne,deleteAssetProcedureStepFieldValuesAttachments:ie.deleteMany}}),{initializeAssetProcedureStepFieldValuesAttachments:Au,addAssetProcedureStepFieldValuesAttachment:wu,addAssetProcedureStepFieldValuesAttachments:vi,setAssetProcedureStepFieldValuesAttachment:Pu,setAssetProcedureStepFieldValuesAttachments:Tu,updateAssetProcedureStepFieldValuesAttachment:Ou,updateAssetProcedureStepFieldValuesAttachments:Iu,deleteAssetProcedureStepFieldValuesAttachment:Fu,deleteAssetProcedureStepFieldValuesAttachments:Ei}=Mi.actions,_u=t=>t.assetProcedureStepFieldValuesAttachmentReducer.instances,Vi=o.createSelector([_u],t=>Object.values(t)),gu=t=>s=>s.assetProcedureStepFieldValuesAttachmentReducer.instances[t],Ru=m(o.createSelector([Vi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),bu=m(o.createSelector([Vi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Mu=Mi.reducer,ne=O(t=>t.uuid),vu={instances:{}},ki=o.createSlice({name:"assetProcedureStepFieldValues",initialState:vu,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,vu)),reducers:{initializeAssetProcedureStepFieldValues:ne.initialize,addAssetProcedureStepFieldValues:ne.addOne,addAssetProcedureStepFieldValuesMany:ne.addMany,setAssetProcedureStepFieldValues:ne.setOne,setAssetProcedureStepFieldValuesMany:ne.setMany,updateAssetProcedureStepFieldValues:ne.updateOne,updateAssetProcedureStepFieldValuesMany:ne.updateMany,deleteAssetProcedureStepFieldValues:ne.deleteOne,deleteAssetProcedureStepFieldValuesMany:ne.deleteMany}}),{initializeAssetProcedureStepFieldValues:Eu,addAssetProcedureStepFieldValues:Vu,addAssetProcedureStepFieldValuesMany:ku,setAssetProcedureStepFieldValues:Bu,setAssetProcedureStepFieldValuesMany:Du,updateAssetProcedureStepFieldValues:Wu,updateAssetProcedureStepFieldValuesMany:zu,deleteAssetProcedureStepFieldValues:qu,deleteAssetProcedureStepFieldValuesMany:ju}=ki.actions,$u=t=>t.assetProcedureStepFieldValuesReducer.instances,ns=o.createSelector([$u],t=>Object.values(t)),Jk=m(o.createSelector([ns,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),Zk=m(o.createSelector([ns,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure===s)))),Xk=m(o.createSelector([ns,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_step===s)))),Cu=t=>s=>s.assetProcedureStepFieldValuesReducer.instances[t],Uu=m(o.createSelector([ns,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Lu=ki.reducer,ae=O(t=>t.uuid),Nu={instances:{}},Bi=o.createSlice({name:"assetProcedureSteps",initialState:Nu,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Nu)),reducers:{initializeAssetProcedureSteps:ae.initialize,setAssetProcedureStep:ae.setOne,setAssetProcedureSteps:ae.setMany,addAssetProcedureStep:ae.addOne,addAssetProcedureSteps:ae.addMany,updateAssetProcedureStep:ae.updateOne,updateAssetProcedureSteps:ae.updateMany,deleteAssetProcedureStep:ae.deleteOne,deleteAssetProcedureSteps:ae.deleteMany}}),{initializeAssetProcedureSteps:Hu,setAssetProcedureStep:Gu,setAssetProcedureSteps:Ku,addAssetProcedureStep:Yu,addAssetProcedureSteps:Qu,updateAssetProcedureStep:Ju,updateAssetProcedureSteps:Zu,deleteAssetProcedureStep:Xu,deleteAssetProcedureSteps:xu}=Bi.actions,eo=Bi.reducer,Rs=t=>t.assetProcedureStepReducer.instances,to=t=>s=>s.assetProcedureStepReducer.instances[t],Di=o.createSelector([Rs],t=>Object.values(t)),xk=m(o.createSelector([Rs,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return is(e)})),eB=m(o.createSelector([Di,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),so=m(o.createSelector([Di,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),io=m(o.createSelector([Rs,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=vr(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),ce=O(t=>t.uuid),no={instances:{}},Wi=o.createSlice({name:"assets",initialState:no,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,no)),reducers:{initializeAssets:ce.initialize,addAsset:ce.addOne,addAssets:ce.addMany,setAsset:ce.setOne,setAssets:ce.setMany,updateAsset:ce.updateOne,updateAssets:ce.updateMany,deleteAsset:ce.deleteOne,deleteAssets:ce.deleteMany}}),{initializeAssets:ao,addAsset:co,addAssets:zi,updateAsset:ro,updateAssets:lo,deleteAsset:uo,deleteAssets:qi,setAsset:oo,setAssets:ho}=Wi.actions,po=t=>t.assetReducer.instances,bs=o.createSelector([po],t=>A(Object.values(t))),tB=m(o.createSelector([bs,(t,s)=>s],(t,s)=>A(t.filter(({project:e})=>e===s)))),yo=m(o.createSelector([bs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),So=t=>s=>s.assetReducer.instances[t],mo=m(o.createSelector([bs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),fo=Wi.reducer,re=O(t=>t.uuid),Ao={instances:{}},ji=o.createSlice({name:"assetStageCompletions",initialState:Ao,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Ao)),reducers:{initializeAssetStageCompletions:re.initialize,addAssetStageCompletion:re.addOne,addAssetStageCompletions:re.addMany,setAssetStageCompletion:re.setOne,setAssetStageCompletions:re.setMany,updateAssetStageCompletion:re.updateOne,updateAssetStageCompletions:re.updateMany,deleteAssetStageCompletion:re.deleteOne,deleteAssetStageCompletions:re.deleteMany}}),{initializeAssetStageCompletions:wo,addAssetStageCompletion:Po,addAssetStageCompletions:To,setAssetStageCompletion:Oo,setAssetStageCompletions:Io,updateAssetStageCompletion:Fo,updateAssetStageCompletions:_o,deleteAssetStageCompletion:go,deleteAssetStageCompletions:Ro}=ji.actions,bo=ji.reducer,Mo=t=>t.assetStageCompletionReducer.instances,vo=o.createSelector([Mo],t=>Object.values(t)),Eo=t=>s=>s.assetStageCompletionReducer.instances[t],Vo=m(o.createSelector([vo,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),de=O(t=>t.uuid),ko={instances:{}},$i=o.createSlice({name:"assetStages",initialState:ko,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,ko)),reducers:{initializeAssetStages:de.initialize,setAssetStage:de.setOne,setAssetStages:de.setMany,addAssetStage:de.addOne,addAssetStages:de.addMany,updateAssetStage:de.updateOne,updateAssetStages:de.updateMany,deleteAssetStage:de.deleteOne,deleteAssetStages:de.deleteMany}}),{initializeAssetStages:Bo,setAssetStage:Do,setAssetStages:Wo,addAssetStage:zo,addAssetStages:qo,updateAssetStage:jo,updateAssetStages:$o,deleteAssetStage:Co,deleteAssetStages:Uo}=$i.actions,Lo=$i.reducer,Ci=t=>t.assetStageReducer.instances,No=t=>s=>s.assetStageReducer.instances[t],Ui=o.createSelector([Ci],t=>Object.values(t)),sB=m(o.createSelector([Ci,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return is(e)})),iB=m(o.createSelector([Ui,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),Ho=m(o.createSelector([Ui,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),le=O(t=>t.uuid),Go={instances:{}},Li=o.createSlice({name:"assetTypeAttachments",initialState:Go,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Go)),reducers:{initializeAssetTypeAttachments:le.initialize,addAssetTypeAttachment:le.addOne,addAssetTypeAttachments:le.addMany,setAssetTypeAttachment:le.setOne,setAssetTypeAttachments:le.setMany,updateAssetTypeAttachment:le.updateOne,updateAssetTypeAttachments:le.updateMany,deleteAssetTypeAttachment:le.deleteOne,deleteAssetTypeAttachments:le.deleteMany}}),{initializeAssetTypeAttachments:Ko,addAssetTypeAttachment:Yo,addAssetTypeAttachments:Ni,setAssetTypeAttachment:Qo,setAssetTypeAttachments:Jo,updateAssetTypeAttachment:Zo,updateAssetTypeAttachments:Xo,deleteAssetTypeAttachment:xo,deleteAssetTypeAttachments:Hi}=Li.actions,eh=t=>t.assetTypeAttachmentReducer.instances,Gi=o.createSelector([eh],t=>Object.values(t)),th=t=>s=>s.assetTypeAttachmentReducer.instances[t],sh=m(o.createSelector([Gi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ih=m(o.createSelector([Gi,(t,s)=>s],(t,s)=>A(t.filter(({asset_type:e})=>s===e)))),nh=Li.reducer,ue=O(t=>t.uuid),ah={instances:{}},Ki=o.createSlice({name:"assetTypeFieldsAttachments",initialState:ah,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,ah)),reducers:{initializeAssetTypeFieldsAttachments:ue.initialize,addAssetTypeFieldsAttachment:ue.addOne,addAssetTypeFieldsAttachments:ue.addMany,setAssetTypeFieldsAttachment:ue.setOne,setAssetTypeFieldsAttachments:ue.setMany,updateAssetTypeFieldsAttachment:ue.updateOne,updateAssetTypeFieldsAttachments:ue.updateMany,deleteAssetTypeFieldsAttachment:ue.deleteOne,deleteAssetTypeFieldsAttachments:ue.deleteMany}}),{initializeAssetTypeFieldsAttachments:ch,addAssetTypeFieldsAttachment:rh,addAssetTypeFieldsAttachments:dh,setAssetTypeFieldsAttachment:lh,setAssetTypeFieldsAttachments:uh,updateAssetTypeFieldsAttachment:oh,updateAssetTypeFieldsAttachments:hh,deleteAssetTypeFieldsAttachment:ph,deleteAssetTypeFieldsAttachments:yh}=Ki.actions,Sh=t=>t.assetTypeFieldsAttachmentReducer.instances,Yi=o.createSelector([Sh],t=>Object.values(t)),nB=m(o.createSelector([Yi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),mh=t=>s=>s.assetTypeFieldsAttachmentReducer.instances[t],fh=m(o.createSelector([Yi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ah=Ki.reducer,oe=O(t=>t.uuid),wh={instances:{}},Qi=o.createSlice({name:"assetTypeFields",initialState:wh,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,wh)),reducers:{initializeAssetTypeFields:oe.initialize,addAssetTypeFields:oe.addOne,addAssetTypeFieldsMany:oe.addMany,setAssetTypeFields:oe.setOne,setAssetTypeFieldsMany:oe.setMany,updateAssetTypeFields:oe.updateOne,updateAssetTypeFieldsMany:oe.updateMany,deleteAssetTypeFields:oe.deleteOne,deleteAssetTypeFieldsMany:oe.deleteMany}}),{initializeAssetTypeFields:Ph,addAssetTypeFields:Th,addAssetTypeFieldsMany:Oh,setAssetTypeFields:Ih,setAssetTypeFieldsMany:Fh,updateAssetTypeFields:_h,updateAssetTypeFieldsMany:gh,deleteAssetTypeFields:Rh,deleteAssetTypeFieldsMany:bh}=Qi.actions,Mh=t=>t.assetTypeFieldsReducer.instances,as=o.createSelector([Mh],t=>Object.values(t)),aB=m(o.createSelector([as,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),cB=m(o.createSelector([as,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),vh=t=>s=>s.assetTypeFieldsReducer.instances[t],Eh=m(o.createSelector([as,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Vh=Qi.reducer,he=O(t=>t.uuid),kh={instances:{}},Ji=o.createSlice({name:"assetTypeFieldValuesAttachments",initialState:kh,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,kh)),reducers:{initializeAssetTypeFieldValuesAttachments:he.initialize,addAssetTypeFieldValuesAttachment:he.addOne,addAssetTypeFieldValuesAttachments:he.addMany,setAssetTypeFieldValuesAttachment:he.setOne,setAssetTypeFieldValuesAttachments:he.setMany,updateAssetTypeFieldValuesAttachment:he.updateOne,updateAssetTypeFieldValuesAttachments:he.updateMany,deleteAssetTypeFieldValuesAttachment:he.deleteOne,deleteAssetTypeFieldValuesAttachments:he.deleteMany}}),{initializeAssetTypeFieldValuesAttachments:Bh,addAssetTypeFieldValuesAttachment:Dh,addAssetTypeFieldValuesAttachments:Zi,setAssetTypeFieldValuesAttachment:Wh,setAssetTypeFieldValuesAttachments:zh,updateAssetTypeFieldValuesAttachment:qh,updateAssetTypeFieldValuesAttachments:jh,deleteAssetTypeFieldValuesAttachment:$h,deleteAssetTypeFieldValuesAttachments:Xi}=Ji.actions,Ch=t=>t.assetTypeFieldValuesAttachmentReducer.instances,xi=o.createSelector([Ch],t=>Object.values(t)),Uh=t=>s=>s.assetTypeFieldValuesAttachmentReducer.instances[t],Lh=m(o.createSelector([xi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Nh=m(o.createSelector([xi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Hh=Ji.reducer,pe=O(t=>t.uuid),Gh={instances:{}},en=o.createSlice({name:"assetTypeFieldValues",initialState:Gh,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Gh)),reducers:{initializeAssetTypeFieldValues:pe.initialize,addAssetTypeFieldValues:pe.addOne,addAssetTypeFieldValuesMany:pe.addMany,setAssetTypeFieldValues:pe.setOne,setAssetTypeFieldValuesMany:pe.setMany,updateAssetTypeFieldValues:pe.updateOne,updateAssetTypeFieldValuesMany:pe.updateMany,deleteAssetTypeFieldValues:pe.deleteOne,deleteAssetTypeFieldValuesMany:pe.deleteMany}}),{initializeAssetTypeFieldValues:Kh,addAssetTypeFieldValues:Yh,addAssetTypeFieldValuesMany:Qh,setAssetTypeFieldValues:Jh,setAssetTypeFieldValuesMany:Zh,updateAssetTypeFieldValues:Xh,updateAssetTypeFieldValuesMany:xh,deleteAssetTypeFieldValues:ep,deleteAssetTypeFieldValuesMany:tp}=en.actions,sp=t=>t.assetTypeFieldValuesReducer.instances,Ms=o.createSelector([sp],t=>Object.values(t)),rB=m(o.createSelector([Ms,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),dB=m(o.createSelector([as,Ms,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(a=>a.asset_type===e).map(a=>a.uuid));return A(s.filter(a=>n.has(a.fields_revision)))})),ip=t=>s=>s.assetTypeFieldValuesReducer.instances[t],np=m(o.createSelector([Ms,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ap=en.reducer,ye=O(t=>t.uuid),cp={instances:{}},tn=o.createSlice({name:"assetTypeIdentifiers",initialState:cp,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,cp)),reducers:{initializeAssetTypeIdentifiers:ye.initialize,addAssetTypeIdentifier:ye.addOne,addAssetTypeIdentifiers:ye.addMany,setAssetTypeIdentifier:ye.setOne,setAssetTypeIdentifiers:ye.setMany,updateAssetTypeIdentifier:ye.updateOne,updateAssetTypeIdentifiers:ye.updateMany,deleteAssetTypeIdentifier:ye.deleteOne,deleteAssetTypeIdentifiers:ye.deleteMany}}),{initializeAssetTypeIdentifiers:rp,addAssetTypeIdentifier:dp,addAssetTypeIdentifiers:lp,setAssetTypeIdentifier:up,setAssetTypeIdentifiers:op,updateAssetTypeIdentifier:hp,updateAssetTypeIdentifiers:pp,deleteAssetTypeIdentifier:yp,deleteAssetTypeIdentifiers:Sp}=tn.actions,mp=t=>t.assetTypeIdentifierReducer.instances,sn=o.createSelector([mp],t=>Object.values(t)),fp=t=>s=>s.assetTypeIdentifierReducer.instances[t],Ap=m(o.createSelector([sn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),lB=m(o.createSelector([sn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),wp=tn.reducer,Se=O(t=>t.uuid),Pp={instances:{}},nn=o.createSlice({name:"assetTypeIdentifierValues",initialState:Pp,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Pp)),reducers:{initializeAssetTypeIdentifierValues:Se.initialize,addAssetTypeIdentifierValue:Se.addOne,addAssetTypeIdentifierValues:Se.addMany,setAssetTypeIdentifierValue:Se.setOne,setAssetTypeIdentifierValues:Se.setMany,updateAssetTypeIdentifierValue:Se.updateOne,updateAssetTypeIdentifierValues:Se.updateMany,deleteAssetTypeIdentifierValue:Se.deleteOne,deleteAssetTypeIdentifierValues:Se.deleteMany}}),{initializeAssetTypeIdentifierValues:Tp,addAssetTypeIdentifierValue:Op,addAssetTypeIdentifierValues:Ip,setAssetTypeIdentifierValue:Fp,setAssetTypeIdentifierValues:_p,updateAssetTypeIdentifierValue:gp,updateAssetTypeIdentifierValues:Rp,deleteAssetTypeIdentifierValue:bp,deleteAssetTypeIdentifierValues:Mp}=nn.actions,vp=t=>t.assetTypeIdentifierValueReducer.instances,vs=o.createSelector([vp],t=>Object.values(t)),Ep=t=>s=>s.assetTypeIdentifierValueReducer.instances[t],Vp=m(o.createSelector([vs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),uB=m(o.createSelector([vs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),oB=m(o.createSelector([vs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type_identifier===s)))),kp=nn.reducer,me=O(t=>t.uuid),Bp={instances:{}},an=o.createSlice({name:"assetTypes",initialState:Bp,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Bp)),reducers:{initializeAssetTypes:me.initialize,setAssetType:me.setOne,setAssetTypes:me.setMany,addAssetType:me.addOne,addAssetTypes:me.addMany,updateAssetType:me.updateOne,updateAssetTypes:me.updateMany,deleteAssetType:me.deleteOne,deleteAssetTypes:me.deleteMany}}),{initializeAssetTypes:Dp,setAssetType:Wp,setAssetTypes:zp,addAssetType:qp,addAssetTypes:jp,updateAssetType:$p,updateAssetTypes:Cp,deleteAssetType:Up,deleteAssetTypes:Lp}=an.actions,Np=t=>t.assetTypeReducer.instances,cn=o.createSelector([Np],t=>Object.values(t)),Hp=t=>s=>s.assetTypeReducer.instances[t],Gp=m(o.createSelector([cn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),hB=m(o.createSelector([cn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Kp=an.reducer,fe=O(t=>t.uuid),Yp={instances:{}},rn=o.createSlice({name:"assetTypeStatuses",initialState:Yp,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Yp)),reducers:{initializeAssetTypeStatuses:fe.initialize,addAssetTypeStatus:fe.addOne,addAssetTypeStatuses:fe.addMany,setAssetTypeStatus:fe.setOne,setAssetTypeStatuses:fe.setMany,updateAssetTypeStatus:fe.updateOne,updateAssetTypeStatuses:fe.updateMany,deleteAssetTypeStatus:fe.deleteOne,deleteAssetTypeStatuses:fe.deleteMany}}),{initializeAssetTypeStatuses:Qp,addAssetTypeStatus:Jp,addAssetTypeStatuses:Zp,setAssetTypeStatus:Xp,setAssetTypeStatuses:xp,updateAssetTypeStatus:ey,updateAssetTypeStatuses:ty,deleteAssetTypeStatus:sy,deleteAssetTypeStatuses:iy}=rn.actions,ny=t=>t.assetTypeStatusReducer.instances,dn=o.createSelector([ny],t=>A(Object.values(t).toSorted(Er))),ay=t=>s=>s.assetTypeStatusReducer.instances[t],cy=m(o.createSelector([dn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),pB=m(o.createSelector([dn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),ry=rn.reducer,dy={accessToken:"",refreshToken:"",isLoggedIn:!1},Es=o.createSlice({name:"auth",initialState:dy,extraReducers:t=>t.addCase(T,s=>Object.assign(s,dy)),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||Es.caseReducers.clearTokens(t),t.isLoggedIn=s.payload}}}),{setTokens:yB,clearTokens:SB,setLoggedIn:ly}=Es.actions,mB=t=>t.authReducer.accessToken,fB=t=>t.authReducer.isLoggedIn,uy=Es.reducer,Ae=O(t=>t.uuid),oy={instances:{}},ln=o.createSlice({name:"documentAttachments",initialState:oy,extraReducers:t=>t.addCase(T,s=>Object.assign(s,oy)),reducers:{initializeDocumentAttachments:Ae.initialize,addDocumentAttachment:Ae.addOne,addDocumentAttachments:Ae.addMany,setDocumentAttachment:Ae.setOne,setDocumentAttachments:Ae.setMany,updateDocumentAttachment:Ae.updateOne,updateDocumentAttachments:Ae.updateMany,deleteDocumentAttachment:Ae.deleteOne,deleteDocumentAttachments:Ae.deleteMany}}),{initializeDocumentAttachments:hy,addDocumentAttachment:py,addDocumentAttachments:yy,setDocumentAttachment:Sy,setDocumentAttachments:my,updateDocumentAttachment:fy,updateDocumentAttachments:Ay,deleteDocumentAttachment:wy,deleteDocumentAttachments:Py}=ln.actions,Ty=t=>t.documentAttachmentReducer.instances,un=o.createSelector([Ty],t=>Object.values(t)),Oy=t=>s=>s.documentAttachmentReducer.instances[t],Iy=m(o.createSelector([un,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),AB=m(o.createSelector([un,(t,s)=>s],(t,s)=>A(t.filter(({document:e})=>s===e)))),Fy=ln.reducer,we=O(({uuid:t})=>t),_y={instances:{}},on=o.createSlice({name:"documents",initialState:_y,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>{Object.assign(s,_y)}),reducers:{initializeDocuments:we.initialize,addDocument:we.addOne,addDocuments:we.addMany,setDocument:we.setOne,setDocuments:we.setMany,updateDocument:we.updateOne,updateDocuments:we.updateMany,deleteDocument:we.deleteOne,deleteDocuments:we.deleteMany}}),{initializeDocuments:gy,addDocument:Ry,addDocuments:by,setDocument:My,setDocuments:vy,updateDocument:Ey,updateDocuments:Vy,deleteDocument:ky,deleteDocuments:By}=on.actions,Dy=on.reducer,hn=t=>t.documentsReducer.instances,Vs=o.createSelector([hn],t=>Object.values(t)),Wy=t=>s=>s.documentsReducer.instances[t],zy=m(o.createSelector([Vs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),wB=m(o.createSelector([Vs,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),PB=m(o.createSelector([Vs,(t,s)=>s],(t,s)=>t.filter(e=>e.organization===s))),qy=m(o.createSelector([hn,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=Br(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),Pe=O(t=>t.uuid),jy={instances:{}},pn=o.createSlice({name:"emailDomains",initialState:jy,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,jy)),reducers:{initializeEmailDomains:Pe.initialize,addEmailDomain:Pe.addOne,addEmailDomains:Pe.addMany,setEmailDomain:Pe.setOne,setEmailDomains:Pe.setMany,updateEmailDomain:Pe.updateOne,updateEmailDomains:Pe.updateMany,deleteEmailDomain:Pe.deleteOne,deleteEmailDomains:Pe.deleteMany}}),{initializeEmailDomains:$y,addEmailDomain:Cy,addEmailDomains:Uy,setEmailDomain:Ly,setEmailDomains:Ny,updateEmailDomain:Hy,updateEmailDomains:Gy,deleteEmailDomain:Ky,deleteEmailDomains:Yy}=pn.actions,Qy=t=>t.emailDomainsReducer.instances,yn=o.createSelector([Qy],t=>Object.values(t)),Jy=t=>s=>s.emailDomainsReducer.instances[t],Zy=m(o.createSelector([yn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),TB=m(o.createSelector([yn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Xy=pn.reducer,xy={s3Urls:{}},eS=1e3*60*60,OB=eS*24*7,Sn=o.createSlice({name:"file",initialState:xy,extraReducers:t=>t.addCase(T,s=>Object.assign(s,xy)),reducers:{setUploadUrl:(t,s)=>{const{url:e,fields:n,sha1:a}=s.payload,c=new Date,r=new Date(c.getTime()+OB);t.s3Urls[a]={url:e,fields:n,exp:r.getTime()}}}}),{setUploadUrl:IB}=Sn.actions,FB=t=>s=>{const e=s.fileReducer.s3Urls[t];if(!e)return;const n=new Date().getTime();if(!((e.exp??n)-n<eS))return e},tS=Sn.reducer,Te=O(t=>t.uuid),sS={instances:{}},mn=o.createSlice({name:"formIdentifiers",initialState:sS,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,sS)),reducers:{initializeFormIdentifiers:Te.initialize,addFormIdentifier:Te.addOne,addFormIdentifiers:Te.addMany,setFormIdentifier:Te.setOne,setFormIdentifiers:Te.setMany,updateFormIdentifier:Te.updateOne,updateFormIdentifiers:Te.updateMany,deleteFormIdentifier:Te.deleteOne,deleteFormIdentifiers:Te.deleteMany}}),{initializeFormIdentifiers:iS,addFormIdentifier:nS,addFormIdentifiers:aS,setFormIdentifier:cS,setFormIdentifiers:rS,updateFormIdentifier:dS,updateFormIdentifiers:lS,deleteFormIdentifier:uS,deleteFormIdentifiers:oS}=mn.actions,hS=t=>t.formIdentifierReducer.instances,fn=o.createSelector([hS],t=>Object.values(t)),pS=t=>s=>s.formIdentifierReducer.instances[t],yS=m(o.createSelector([fn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),_B=m(o.createSelector([fn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form===s)))),SS=mn.reducer,Oe=O(t=>t.uuid),mS={instances:{}},An=o.createSlice({name:"formIdentifierValues",initialState:mS,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,mS)),reducers:{initializeFormIdentifierValues:Oe.initialize,addFormIdentifierValue:Oe.addOne,addFormIdentifierValues:Oe.addMany,setFormIdentifierValue:Oe.setOne,setFormIdentifierValues:Oe.setMany,updateFormIdentifierValue:Oe.updateOne,updateFormIdentifierValues:Oe.updateMany,deleteFormIdentifierValue:Oe.deleteOne,deleteFormIdentifierValues:Oe.deleteMany}}),{initializeFormIdentifierValues:fS,addFormIdentifierValue:AS,addFormIdentifierValues:wS,setFormIdentifierValue:PS,setFormIdentifierValues:TS,updateFormIdentifierValue:OS,updateFormIdentifierValues:IS,deleteFormIdentifierValue:FS,deleteFormIdentifierValues:_S}=An.actions,gS=t=>t.formIdentifierValueReducer.instances,ks=o.createSelector([gS],t=>Object.values(t)),RS=t=>s=>s.formIdentifierValueReducer.instances[t],bS=m(o.createSelector([ks,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),gB=m(o.createSelector([ks,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_submission===s)))),RB=m(o.createSelector([ks,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_identifier===s)))),MS=An.reducer,Ie=O(t=>t.uuid),vS={instances:{}},wn=o.createSlice({name:"formRevisionAttachments",initialState:vS,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,vS)),reducers:{initializeFormRevisionAttachments:Ie.initialize,addFormRevisionAttachment:Ie.addOne,addFormRevisionAttachments:Ie.addMany,setFormRevisionAttachment:Ie.setOne,setFormRevisionAttachments:Ie.setMany,updateFormRevisionAttachment:Ie.updateOne,updateFormRevisionAttachments:Ie.updateMany,deleteFormRevisionAttachment:Ie.deleteOne,deleteFormRevisionAttachments:Ie.deleteMany}}),{initializeFormRevisionAttachments:ES,addFormRevisionAttachment:VS,addFormRevisionAttachments:kS,setFormRevisionAttachment:BS,setFormRevisionAttachments:DS,updateFormRevisionAttachment:WS,updateFormRevisionAttachments:zS,deleteFormRevisionAttachment:qS,deleteFormRevisionAttachments:jS}=wn.actions,Bs=t=>t.formRevisionAttachmentReducer.instances,$S=o.createSelector([Bs],t=>Object.values(t)),CS=m(o.createSelector([Bs,(t,s)=>s],(t,s)=>t[s])),US=m(o.createSelector([$S,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),bB=m(o.createSelector([Bs,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.form_revision===s)))),LS=wn.reducer,Fe=O(t=>t.uuid),NS={instances:{}},Pn=o.createSlice({name:"formRevisions",initialState:NS,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,NS)),reducers:{initializeFormRevisions:Fe.initialize,addFormRevision:Fe.addOne,addFormRevisions:Fe.addMany,setFormRevision:Fe.setOne,setFormRevisions:Fe.setMany,updateFormRevision:Fe.updateOne,updateFormRevisions:Fe.updateMany,deleteFormRevision:Fe.deleteOne,deleteFormRevisions:Fe.deleteMany}}),{initializeFormRevisions:HS,addFormRevision:Tn,addFormRevisions:On,setFormRevision:GS,setFormRevisions:KS,updateFormRevision:YS,updateFormRevisions:QS,deleteFormRevision:In,deleteFormRevisions:Fn}=Pn.actions,_n=t=>t.formRevisionReducer.instances,Ds=o.createSelector([_n],t=>Object.values(t)),JS=t=>s=>s.formRevisionReducer.instances[t],ZS=m(o.createSelector([Ds,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),MB=m(o.createSelector([Ds,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),XS=m(o.createSelector([Ds,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form===s)))),xS=Pn.reducer,_e=O(t=>t.uuid),em={instances:{}},gn=o.createSlice({name:"forms",initialState:em,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,em)),reducers:{initializeForms:_e.initialize,addForm:_e.addOne,addForms:_e.addMany,setForm:_e.setOne,setForms:_e.setMany,updateForm:_e.updateOne,updateForms:_e.updateMany,deleteForm:_e.deleteOne,deleteForms:_e.deleteMany}}),{initializeForms:tm,addForm:sm,addForms:im,setForm:nm,setForms:am,updateForm:cm,updateForms:rm,deleteForm:dm,deleteForms:lm}=gn.actions,um=gn.reducer,om=t=>t.formReducer.instances,Rn=o.createSelector([om],t=>Object.values(t)),hm=t=>s=>s.formReducer.instances[t],pm=m(o.createSelector([Rn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),vB=m(o.createSelector([Rn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),ge=O(t=>t.uuid),ym={instances:{}},bn=o.createSlice({name:"formSubmissionAttachments",initialState:ym,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,ym)),reducers:{initializeFormSubmissionAttachments:ge.initialize,addFormSubmissionAttachment:ge.addOne,addFormSubmissionAttachments:ge.addMany,setFormSubmissionAttachment:ge.setOne,setFormSubmissionAttachments:ge.setMany,updateFormSubmissionAttachment:ge.updateOne,updateFormSubmissionAttachments:ge.updateMany,deleteFormSubmissionAttachment:ge.deleteOne,deleteFormSubmissionAttachments:ge.deleteMany}}),{initializeFormSubmissionAttachments:Sm,addFormSubmissionAttachment:mm,addFormSubmissionAttachments:Mn,setFormSubmissionAttachment:fm,setFormSubmissionAttachments:Am,updateFormSubmissionAttachment:wm,updateFormSubmissionAttachments:Pm,deleteFormSubmissionAttachment:Tm,deleteFormSubmissionAttachments:vn}=bn.actions,En=t=>t.formSubmissionAttachmentReducer.instances,Vn=o.createSelector([En],t=>Object.values(t)),Om=m(o.createSelector([En,(t,s)=>s],(t,s)=>t[s])),kn=m(o.createSelector([Vn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(n=>e.has(n.uuid)))})),Im=kn,Fm=m(o.createSelector([Vn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_submission===s)))),_m=bn.reducer,Re=O(t=>t.uuid),gm={instances:{}},Bn=o.createSlice({name:"formSubmissions",initialState:gm,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,gm)),reducers:{initializeFormSubmissions:Re.initialize,setFormSubmission:Re.setOne,setFormSubmissions:Re.setMany,addFormSubmission:Re.addOne,addFormSubmissions:Re.addMany,updateFormSubmission:Re.updateOne,updateFormSubmissions:Re.updateMany,deleteFormSubmission:Re.deleteOne,deleteFormSubmissions:Re.deleteMany}}),{initializeFormSubmissions:Rm,setFormSubmission:bm,setFormSubmissions:Mm,addFormSubmission:vm,addFormSubmissions:Dn,updateFormSubmission:Em,updateFormSubmissions:Vm,deleteFormSubmission:km,deleteFormSubmissions:Wn}=Bn.actions,zn=t=>t.formSubmissionReducer.instances,Bm=o.createSelector([zn],t=>Object.values(t)),Dm=t=>s=>s.formSubmissionReducer.instances[t],Wm=m(o.createSelector([Bm,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),zm=m(o.createSelector([zn,_n,(t,s)=>s],(t,s,e)=>{const n=new Set;for(const a of Object.values(s))a.form===e&&n.add(a.uuid);return Object.values(t).filter(a=>n.has(a.form_revision))})),qm=Bn.reducer,be=O(t=>t.uuid),jm={instances:{}},qn=o.createSlice({name:"geoImages",initialState:jm,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,jm)),reducers:{initializeGeoImages:be.initialize,setGeoImage:be.setOne,setGeoImages:be.setMany,addGeoImage:be.addOne,addGeoImages:be.addMany,updateGeoImage:be.updateOne,updateGeoImages:be.updateMany,deleteGeoImage:be.deleteOne,deleteGeoImages:be.deleteMany}}),{initializeGeoImages:$m,setGeoImage:Cm,setGeoImages:Um,addGeoImage:Lm,addGeoImages:Nm,updateGeoImage:Hm,updateGeoImages:Gm,deleteGeoImage:Km,deleteGeoImages:Ym}=qn.actions,Qm=t=>t.geoImageReducer.instances,jn=o.createSelector([Qm],t=>Object.values(t)),Jm=t=>s=>s.geoImageReducer.instances[t],Zm=m(o.createSelector([jn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),EB=m(o.createSelector([jn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),Xm=qn.reducer,Me=O(t=>t.uuid),xm={instances:{}},$n=o.createSlice({name:"issueAssociations",initialState:xm,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,xm)),reducers:{initializeIssueAssociations:Me.initialize,addIssueAssociation:Me.addOne,addIssueAssociations:Me.addMany,setIssueAssociation:Me.setOne,setIssueAssociations:Me.setMany,updateIssueAssociation:Me.updateOne,updateIssueAssociations:Me.updateMany,deleteIssueAssociation:Me.deleteOne,deleteIssueAssociations:Me.deleteMany}}),{initializeIssueAssociations:ef,setIssueAssociations:tf,setIssueAssociation:sf,updateIssueAssociation:nf,updateIssueAssociations:af,addIssueAssociation:cf,addIssueAssociations:jt,deleteIssueAssociation:rf,deleteIssueAssociations:$t}=$n.actions,df=t=>t.issueAssociationReducer.instances,Ct=o.createSelector([df],t=>Object.values(t)),lf=t=>s=>s.issueAssociationReducer.instances[t],uf=m(o.createSelector([Ct,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),of=m(o.createSelector([Ct,(t,s)=>s],(t,s)=>A(t.filter(({associated_issue:e})=>e===s)))),hf=m(o.createSelector([Ct,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({associated_issue:n})=>e.has(n)))})),pf=m(o.createSelector([Ct,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({issue:n})=>n&&e.has(n)))})),yf=m(o.createSelector([Ct,(t,s)=>s],(t,s)=>A(t.filter(({issue:e})=>e===s)))),Sf=m(o.createSelector([Ct,(t,s)=>s],(t,s)=>A(t.filter(({asset:e})=>e===s)))),mf=$n.reducer,ve=O(t=>t.uuid),ff={instances:{}},Cn=o.createSlice({name:"issueAttachments",initialState:ff,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,ff)),reducers:{initializeIssueAttachments:ve.initialize,addIssueAttachment:ve.addOne,addIssueAttachments:ve.addMany,setIssueAttachment:ve.setOne,setIssueAttachments:ve.setMany,updateIssueAttachment:ve.updateOne,updateIssueAttachments:ve.updateMany,deleteIssueAttachment:ve.deleteOne,deleteIssueAttachments:ve.deleteMany}}),{initializeIssueAttachments:Af,addIssueAttachment:wf,addIssueAttachments:Un,setIssueAttachment:Pf,setIssueAttachments:Tf,updateIssueAttachment:Of,updateIssueAttachments:If,deleteIssueAttachment:Ff,deleteIssueAttachments:Ln}=Cn.actions,_f=t=>t.issueAttachmentReducer.instances,Nn=o.createSelector([_f],t=>Object.values(t)),gf=m(o.createSelector([Nn,(t,s)=>s],(t,s)=>A(t.filter(({issue:e})=>s===e)))),Rf=t=>s=>s.issueAttachmentReducer.instances[t],bf=m(o.createSelector([Nn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Mf=Cn.reducer,Ee=O(t=>t.uuid),vf={instances:{}},Hn=o.createSlice({name:"issueCommentAttachments",initialState:vf,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,vf)),reducers:{initializeIssueCommentAttachments:Ee.initialize,addIssueCommentAttachment:Ee.addOne,addIssueCommentAttachments:Ee.addMany,setIssueCommentAttachment:Ee.setOne,setIssueCommentAttachments:Ee.setMany,updateIssueCommentAttachment:Ee.updateOne,updateIssueCommentAttachments:Ee.updateMany,deleteIssueCommentAttachment:Ee.deleteOne,deleteIssueCommentAttachments:Ee.deleteMany}}),{initializeIssueCommentAttachments:Ef,addIssueCommentAttachment:Vf,addIssueCommentAttachments:kf,setIssueCommentAttachment:Bf,setIssueCommentAttachments:Df,updateIssueCommentAttachment:Wf,updateIssueCommentAttachments:zf,deleteIssueCommentAttachment:qf,deleteIssueCommentAttachments:jf}=Hn.actions,$f=t=>t.issueCommentAttachmentReducer.instances,Gn=o.createSelector([$f],t=>Object.values(t)),Cf=t=>s=>s.issueCommentAttachmentReducer.instances[t],Uf=m(o.createSelector([Gn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),VB=m(o.createSelector([Gn,(t,s)=>s],(t,s)=>A(t.filter(({issue_comment:e})=>s===e)))),Lf=Hn.reducer,Ve=O(t=>t.uuid),Nf={instances:{}},Kn=o.createSlice({name:"issueComments",initialState:Nf,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Nf)),reducers:{initializeIssueComments:Ve.initialize,addIssueComment:Ve.addOne,addIssueComments:Ve.addMany,setIssueComment:Ve.setOne,setIssueComments:Ve.setMany,updateIssueComment:Ve.updateOne,updateIssueComments:Ve.updateMany,deleteIssueComment:Ve.deleteOne,deleteIssueComments:Ve.deleteMany}}),{initializeIssueComments:Hf,addIssueComment:Gf,addIssueComments:Kf,setIssueComment:Yf,setIssueComments:Qf,updateIssueComment:Jf,updateIssueComments:Zf,deleteIssueComment:Xf,deleteIssueComments:xf}=Kn.actions,Yn=t=>t.issueCommentReducer.instances,eA=t=>s=>s.issueCommentReducer.instances[t],tA=m(o.createSelector([Yn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(Object.values(t).filter(({uuid:n})=>e.has(n)))})),kB=m(o.createSelector([Yn,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.issue===s)))),sA=Kn.reducer,ke=O(t=>t.uuid),iA={instances:{}},Qn=o.createSlice({name:"issues",initialState:iA,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,iA)),reducers:{initializeIssues:ke.initialize,addIssue:ke.addOne,addIssues:ke.addMany,setIssue:ke.setOne,setIssues:ke.setMany,updateIssue:ke.updateOne,updateIssues:ke.updateMany,deleteIssue:ke.deleteOne,deleteIssues:ke.deleteMany}}),{initializeIssues:nA,addIssue:aA,addIssues:Jn,setIssue:cA,setIssues:rA,updateIssue:dA,updateIssues:lA,deleteIssue:uA,deleteIssues:Zn}=Qn.actions,oA=t=>t.issueReducer.instances,Ws=o.createSelector([oA],t=>Object.values(t)),hA=t=>s=>s.issueReducer.instances[t],pA=m(o.createSelector([Ws,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),BB=m(o.createSelector([Ws,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),yA=m(o.createSelector([Ws,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s))),SA=Qn.reducer,Be=O(t=>t.uuid),mA={instances:{}},Xn=o.createSlice({name:"issueTypeAttachments",initialState:mA,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,mA)),reducers:{initializeIssueTypeAttachments:Be.initialize,addIssueTypeAttachment:Be.addOne,addIssueTypeAttachments:Be.addMany,setIssueTypeAttachment:Be.setOne,setIssueTypeAttachments:Be.setMany,updateIssueTypeAttachment:Be.updateOne,updateIssueTypeAttachments:Be.updateMany,deleteIssueTypeAttachment:Be.deleteOne,deleteIssueTypeAttachments:Be.deleteMany}}),{initializeIssueTypeAttachments:fA,addIssueTypeAttachment:AA,addIssueTypeAttachments:wA,setIssueTypeAttachment:PA,setIssueTypeAttachments:TA,updateIssueTypeAttachment:OA,updateIssueTypeAttachments:IA,deleteIssueTypeAttachment:FA,deleteIssueTypeAttachments:_A}=Xn.actions,gA=t=>t.issueTypeAttachmentReducer.instances,xn=o.createSelector([gA],t=>Object.values(t)),RA=t=>s=>s.issueTypeAttachmentReducer.instances[t],bA=m(o.createSelector([xn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),DB=m(o.createSelector([xn,(t,s)=>s],(t,s)=>A(t.filter(({issue_type:e})=>s===e)))),MA=Xn.reducer,De=O(t=>t.uuid),vA={instances:{}},ea=o.createSlice({name:"issueTypeFieldsAttachments",initialState:vA,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,vA)),reducers:{initializeIssueTypeFieldsAttachments:De.initialize,addIssueTypeFieldsAttachment:De.addOne,addIssueTypeFieldsAttachments:De.addMany,setIssueTypeFieldsAttachment:De.setOne,setIssueTypeFieldsAttachments:De.setMany,updateIssueTypeFieldsAttachment:De.updateOne,updateIssueTypeFieldsAttachments:De.updateMany,deleteIssueTypeFieldsAttachment:De.deleteOne,deleteIssueTypeFieldsAttachments:De.deleteMany}}),{initializeIssueTypeFieldsAttachments:EA,addIssueTypeFieldsAttachment:VA,addIssueTypeFieldsAttachments:kA,setIssueTypeFieldsAttachment:BA,setIssueTypeFieldsAttachments:DA,updateIssueTypeFieldsAttachment:WA,updateIssueTypeFieldsAttachments:zA,deleteIssueTypeFieldsAttachment:qA,deleteIssueTypeFieldsAttachments:jA}=ea.actions,$A=t=>t.issueTypeFieldsAttachmentReducer.instances,ta=o.createSelector([$A],t=>Object.values(t)),WB=m(o.createSelector([ta,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),CA=t=>s=>s.issueTypeFieldsAttachmentReducer.instances[t],UA=m(o.createSelector([ta,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),LA=ea.reducer,We=O(t=>t.uuid),NA={instances:{}},sa=o.createSlice({name:"issueTypeFieldValues",initialState:NA,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,NA)),reducers:{initializeIssueTypeFieldValues:We.initialize,addIssueTypeFieldValues:We.addOne,addIssueTypeFieldValuesMany:We.addMany,setIssueTypeFieldValues:We.setOne,setIssueTypeFieldValuesMany:We.setMany,updateIssueTypeFieldValues:We.updateOne,updateIssueTypeFieldValuesMany:We.updateMany,deleteIssueTypeFieldValues:We.deleteOne,deleteIssueTypeFieldValuesMany:We.deleteMany}}),{initializeIssueTypeFieldValues:HA,addIssueTypeFieldValues:GA,addIssueTypeFieldValuesMany:KA,setIssueTypeFieldValues:YA,setIssueTypeFieldValuesMany:QA,updateIssueTypeFieldValues:JA,updateIssueTypeFieldValuesMany:ZA,deleteIssueTypeFieldValues:XA,deleteIssueTypeFieldValuesMany:xA}=sa.actions,ew=t=>t.issueTypeFieldValuesReducer.instances,zs=o.createSelector([ew],t=>Object.values(t)),zB=m(o.createSelector([zs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),tw=t=>s=>s.issueTypeFieldValuesReducer.instances[t],sw=m(o.createSelector([zs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),iw=sa.reducer,ze=O(t=>t.uuid),nw={instances:{}},ia=o.createSlice({name:"issueTypeFields",initialState:nw,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,nw)),reducers:{initializeIssueTypeFields:ze.initialize,addIssueTypeFields:ze.addOne,addIssueTypeFieldsMany:ze.addMany,setIssueTypeFields:ze.setOne,setIssueTypeFieldsMany:ze.setMany,updateIssueTypeFields:ze.updateOne,updateIssueTypeFieldsMany:ze.updateMany,deleteIssueTypeFields:ze.deleteOne,deleteIssueTypeFieldsMany:ze.deleteMany}}),{initializeIssueTypeFields:aw,addIssueTypeFields:cw,addIssueTypeFieldsMany:rw,setIssueTypeFields:dw,setIssueTypeFieldsMany:lw,updateIssueTypeFields:uw,updateIssueTypeFieldsMany:ow,deleteIssueTypeFields:hw,deleteIssueTypeFieldsMany:pw}=ia.actions,yw=t=>t.issueTypeFieldsReducer.instances,cs=o.createSelector([yw],t=>Object.values(t)),qB=m(o.createSelector([cs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),jB=m(o.createSelector([cs,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),$B=m(o.createSelector([cs,zs,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(a=>a.issue_type===e).map(a=>a.uuid));return A(s.filter(a=>n.has(a.fields_revision)))})),Sw=t=>s=>s.issueTypeFieldsReducer.instances[t],mw=m(o.createSelector([cs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),fw=ia.reducer,qe=O(t=>t.uuid),Aw={instances:{}},na=o.createSlice({name:"issueTypeFieldValuesAttachments",initialState:Aw,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Aw)),reducers:{initializeIssueTypeFieldValuesAttachments:qe.initialize,addIssueTypeFieldValuesAttachment:qe.addOne,addIssueTypeFieldValuesAttachments:qe.addMany,setIssueTypeFieldValuesAttachment:qe.setOne,setIssueTypeFieldValuesAttachments:qe.setMany,updateIssueTypeFieldValuesAttachment:qe.updateOne,updateIssueTypeFieldValuesAttachments:qe.updateMany,deleteIssueTypeFieldValuesAttachment:qe.deleteOne,deleteIssueTypeFieldValuesAttachments:qe.deleteMany}}),{initializeIssueTypeFieldValuesAttachments:ww,addIssueTypeFieldValuesAttachment:Pw,addIssueTypeFieldValuesAttachments:aa,setIssueTypeFieldValuesAttachment:Tw,setIssueTypeFieldValuesAttachments:Ow,updateIssueTypeFieldValuesAttachment:Iw,updateIssueTypeFieldValuesAttachments:Fw,deleteIssueTypeFieldValuesAttachment:_w,deleteIssueTypeFieldValuesAttachments:ca}=na.actions,gw=t=>t.issueTypeFieldValuesAttachmentReducer.instances,ra=o.createSelector([gw],t=>Object.values(t)),Rw=t=>s=>s.issueTypeFieldValuesAttachmentReducer.instances[t],bw=m(o.createSelector([ra,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Mw=m(o.createSelector([ra,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),vw=na.reducer,je=O(t=>t.uuid),Ew={instances:{}},da=o.createSlice({name:"issueTypeIdentifiers",initialState:Ew,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Ew)),reducers:{initializeIssueTypeIdentifiers:je.initialize,addIssueTypeIdentifier:je.addOne,addIssueTypeIdentifiers:je.addMany,setIssueTypeIdentifier:je.setOne,setIssueTypeIdentifiers:je.setMany,updateIssueTypeIdentifier:je.updateOne,updateIssueTypeIdentifiers:je.updateMany,deleteIssueTypeIdentifier:je.deleteOne,deleteIssueTypeIdentifiers:je.deleteMany}}),{initializeIssueTypeIdentifiers:Vw,addIssueTypeIdentifier:kw,addIssueTypeIdentifiers:Bw,setIssueTypeIdentifier:Dw,setIssueTypeIdentifiers:Ww,updateIssueTypeIdentifier:zw,updateIssueTypeIdentifiers:qw,deleteIssueTypeIdentifier:jw,deleteIssueTypeIdentifiers:$w}=da.actions,Cw=t=>t.issueTypeIdentifierReducer.instances,la=o.createSelector([Cw],t=>Object.values(t)),Uw=t=>s=>s.issueTypeIdentifierReducer.instances[t],Lw=m(o.createSelector([la,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),CB=m(o.createSelector([la,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),Nw=da.reducer,$e=O(t=>t.uuid),Hw={instances:{}},ua=o.createSlice({name:"issueTypeIdentifierValues",initialState:Hw,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Hw)),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:Gw,addIssueTypeIdentifierValue:Kw,addIssueTypeIdentifierValues:Yw,setIssueTypeIdentifierValue:Qw,setIssueTypeIdentifierValues:Jw,updateIssueTypeIdentifierValue:Zw,updateIssueTypeIdentifierValues:Xw,deleteIssueTypeIdentifierValue:xw,deleteIssueTypeIdentifierValues:eP}=ua.actions,tP=t=>t.issueTypeIdentifierValueReducer.instances,qs=o.createSelector([tP],t=>Object.values(t)),sP=t=>s=>s.issueTypeIdentifierValueReducer.instances[t],iP=m(o.createSelector([qs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),UB=m(o.createSelector([qs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),LB=m(o.createSelector([qs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type_identifier===s)))),nP=ua.reducer,Ce=O(t=>t.uuid),aP={instances:{}},oa=o.createSlice({name:"issueTypes",initialState:aP,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,aP)),reducers:{initializeIssueTypes:Ce.initialize,addIssueType:Ce.addOne,addIssueTypes:Ce.addMany,setIssueType:Ce.setOne,setIssueTypes:Ce.setMany,updateIssueType:Ce.updateOne,updateIssueTypes:Ce.updateMany,deleteIssueType:Ce.deleteOne,deleteIssueTypes:Ce.deleteMany}}),{initializeIssueTypes:cP,addIssueType:rP,addIssueTypes:dP,setIssueType:lP,setIssueTypes:uP,updateIssueType:oP,updateIssueTypes:hP,deleteIssueType:pP,deleteIssueTypes:yP}=oa.actions,SP=t=>t.issueTypeReducer.instances,ha=o.createSelector(SP,t=>Object.values(t)),mP=t=>s=>s.issueTypeReducer.instances[t],fP=m(o.createSelector([ha,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),NB=m(o.createSelector([ha,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),AP=oa.reducer,Ue=O(t=>t.uuid),wP={instances:{}},pa=o.createSlice({name:"issueTypeStatuses",initialState:wP,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,wP)),reducers:{initializeIssueTypeStatuses:Ue.initialize,addIssueTypeStatus:Ue.addOne,addIssueTypeStatuses:Ue.addMany,setIssueTypeStatus:Ue.setOne,setIssueTypeStatuses:Ue.setMany,updateIssueTypeStatus:Ue.updateOne,updateIssueTypeStatuses:Ue.updateMany,deleteIssueTypeStatus:Ue.deleteOne,deleteIssueTypeStatuses:Ue.deleteMany}}),{initializeIssueTypeStatuses:PP,addIssueTypeStatus:TP,addIssueTypeStatuses:OP,setIssueTypeStatus:IP,setIssueTypeStatuses:FP,updateIssueTypeStatus:_P,updateIssueTypeStatuses:gP,deleteIssueTypeStatus:RP,deleteIssueTypeStatuses:bP}=pa.actions,MP=t=>t.issueTypeStatusReducer.instances,ya=o.createSelector([MP],t=>A(Object.values(t).toSorted(Vr))),Sa=t=>s=>s.issueTypeStatusReducer.instances[t],vP=m(o.createSelector([ya,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),HB=m(o.createSelector([ya,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),EP=pa.reducer,Le=O(t=>t.uuid),VP={instances:{}},ma=o.createSlice({name:"issueUpdates",initialState:VP,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,VP)),reducers:{initializeIssueUpdates:Le.initialize,addIssueUpdate:Le.addOne,addIssueUpdates:Le.addMany,setIssueUpdate:Le.setOne,setIssueUpdates:Le.setMany,updateIssueUpdate:Le.updateOne,updateIssueUpdates:Le.updateMany,deleteIssueUpdate:Le.deleteOne,deleteIssueUpdates:Le.deleteMany}}),{initializeIssueUpdates:kP,addIssueUpdate:fa,addIssueUpdates:Aa,setIssueUpdate:BP,setIssueUpdates:DP,updateIssueUpdate:WP,updateIssueUpdates:zP,deleteIssueUpdate:wa,deleteIssueUpdates:Pa}=ma.actions,Ta=t=>t.issueUpdateReducer.instances,Oa=o.createSelector([Ta],t=>Object.values(t)),qP=m(o.createSelector([Ta,(t,s)=>s],(t,s)=>t[s])),jP=m(o.createSelector([Oa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),$P=m(o.createSelector([Oa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),CP=ma.reducer,Ne=O(t=>t.id),UP={instances:{},currentUser:null},Ia=o.createSlice({name:"users",initialState:UP,extraReducers:t=>t.addCase(T,s=>Object.assign(s,UP)).addCase(I,s=>Object.assign(s,{...s,instances:[]})),reducers:{initializeUsers:Ne.initialize,setUsers:Ne.setMany,setUser:Ne.setOne,addUsers:Ne.addMany,addUser:Ne.addOne,updateUsers:Ne.updateMany,updateUser:Ne.updateOne,deleteUser:Ne.deleteOne,deleteUsers:Ne.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:LP,setUsers:NP,setUser:HP,addUsers:GP,addUser:Fa,updateUsers:KP,updateUser:YP,deleteUser:_a,deleteUsers:QP,setCurrentUser:GB,setCurrentUserProfile:KB}=Ia.actions,JP=Ia.reducer,ZP=t=>t.userReducer.currentUser,ga=t=>t.userReducer.instances,js=o.createSelector([ga],t=>Object.values(t)),$s=t=>s=>s.userReducer.instances[t],XP=m(o.createSelector([js,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({id:n})=>e.has(n)))})),He=O(t=>t.uuid),xP={instances:{}},Ra=o.createSlice({name:"organizationAccess",initialState:xP,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,xP)),reducers:{initializeOrganizationAccesses:He.initialize,addOrganizationAccess:He.addOne,addOrganizationAccesses:He.addMany,setOrganizationAccess:He.setOne,setOrganizationAccesses:He.setMany,updateOrganizationAccess:He.updateOne,updateOrganizationAccesses:He.updateMany,deleteOrganizationAccess:He.deleteOne,deleteOrganizationAccesses:He.deleteMany}}),{initializeOrganizationAccesses:eT,addOrganizationAccess:tT,addOrganizationAccesses:sT,setOrganizationAccess:iT,setOrganizationAccesses:nT,updateOrganizationAccess:aT,updateOrganizationAccesses:cT,deleteOrganizationAccess:rT,deleteOrganizationAccesses:dT}=Ra.actions,lT=Ra.reducer,Cs=t=>t.organizationAccessReducer.instances,uT=t=>s=>s.organizationAccessReducer.instances[t],oT=m(o.createSelector([Cs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(Object.values(t).filter(({uuid:n})=>e.has(n)))})),YB=o.createSelector([ZP,Cs],(t,s)=>Object.values(s).find(n=>n.user===(t==null?void 0:t.id))??null),hT=o.createSelector([Cs],t=>{const s={};for(const e of Object.values(t))s[e.user]=e;return is(s)}),QB=m(o.createSelector([ga,hT,(t,s)=>s],(t,s,e)=>A(Object.values(t).filter(n=>{const a=s[n.id];return!!a&&a.organization===e})))),Ge=O(t=>t.uuid),pT={instances:{}},ba=o.createSlice({name:"organizations",initialState:pT,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,pT)),reducers:{initializeOrganizations:Ge.initialize,setOrganizations:Ge.setMany,setOrganization:Ge.setOne,addOrganizations:Ge.addMany,addOrganization:Ge.addOne,updateOrganizations:Ge.updateMany,updateOrganization:Ge.updateOne,deleteOrganization:Ge.deleteOne,deleteOrganizations:Ge.deleteMany}}),{initializeOrganizations:yT,setOrganizations:ST,setOrganization:mT,addOrganizations:fT,addOrganization:AT,updateOrganizations:wT,updateOrganization:PT,deleteOrganization:TT,deleteOrganizations:OT}=ba.actions,IT=t=>t.organizationReducer.instances,FT=o.createSelector([IT],t=>Object.values(t)),_T=t=>s=>s.organizationReducer.instances[t],gT=m(o.createSelector([FT,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),RT=ba.reducer,bT=(t,s,e)=>{const n=t.uuid?t:{...t,uuid:Dt.v4()};return{payload:n,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:n,BASE_URL:s,serviceName:e}}}}},MT={deletedRequests:[],latestRetryTime:0},Ma=o.createSlice({name:"outbox",initialState:MT,extraReducers:t=>t.addCase(T,s=>Object.assign(s,MT)),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 bT(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}}}),JB=t=>t.outboxReducer.deletedRequests,ZB=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:vT,markForDeletion:XB,markAsDeleted:ET,_setLatestRetryTime:VT}=Ma.actions,kT=Ma.reducer,Ke=O(t=>t.uuid),BT={instances:{}},va=o.createSlice({name:"projectAccess",initialState:BT,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,BT)),reducers:{initializeProjectAccesses:Ke.initialize,addProjectAccess:Ke.addOne,addProjectAccesses:Ke.addMany,setProjectAccess:Ke.setOne,setProjectAccesses:Ke.setMany,updateProjectAccess:Ke.updateOne,updateProjectAccesses:Ke.updateMany,deleteProjectAccess:Ke.deleteOne,deleteProjectAccesses:Ke.deleteMany}}),{initializeProjectAccesses:DT,addProjectAccess:WT,addProjectAccesses:zT,setProjectAccess:qT,setProjectAccesses:jT,updateProjectAccess:$T,updateProjectAccesses:CT,deleteProjectAccess:UT,deleteProjectAccesses:LT}=va.actions,NT=va.reducer,Ea=t=>t.projectAccessReducer.instances,rs=o.createSelector(Ea,t=>Object.values(t)),HT=t=>s=>s.projectAccessReducer.instances[t],GT=m(o.createSelector([rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),xB=m(o.createSelector([Ea,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.project===s)))),eD=m(o.createSelector([rs,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.project===s))e[n.user]=n;return e})),tD=m(o.createSelector([js,rs,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.project===e).map(a=>a.user));return A(t.filter(a=>n.has(a.id)))})),Ye=O(t=>t.uuid),KT={instances:{}},Va=o.createSlice({name:"projectAttachments",initialState:KT,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,KT)),reducers:{initializeProjectAttachments:Ye.initialize,addProjectAttachment:Ye.addOne,addProjectAttachments:Ye.addMany,setProjectAttachment:Ye.setOne,setProjectAttachments:Ye.setMany,updateProjectAttachment:Ye.updateOne,updateProjectAttachments:Ye.updateMany,deleteProjectAttachment:Ye.deleteOne,deleteProjectAttachments:Ye.deleteMany}}),{initializeProjectAttachments:YT,addProjectAttachment:QT,addProjectAttachments:JT,setProjectAttachment:ZT,setProjectAttachments:XT,updateProjectAttachment:xT,updateProjectAttachments:eO,deleteProjectAttachment:tO,deleteProjectAttachments:sO}=Va.actions,iO=t=>t.projectAttachmentReducer.instances,ka=o.createSelector([iO],t=>Object.values(t)),nO=t=>s=>s.projectAttachmentReducer.instances[t],aO=m(o.createSelector([ka,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),sD=m(o.createSelector([ka,(t,s)=>s],(t,s)=>A(t.filter(({project:e})=>s===e)))),cO=Va.reducer,Qe=O(t=>t.uuid),rO={instances:{}},Ba=o.createSlice({name:"projectFiles",initialState:rO,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,rO)),reducers:{initializeProjectFiles:Qe.initialize,setProjectFile:Qe.setOne,setProjectFiles:Qe.setMany,addProjectFile:Qe.addOne,addProjectFiles:Qe.addMany,updateProjectFile:Qe.updateOne,updateProjectFiles:Qe.updateMany,deleteProjectFile:Qe.deleteOne,deleteProjectFiles:Qe.deleteMany}}),{initializeProjectFiles:dO,setProjectFile:lO,setProjectFiles:uO,addProjectFile:oO,addProjectFiles:hO,updateProjectFile:pO,updateProjectFiles:yO,deleteProjectFile:SO,deleteProjectFiles:mO}=Ba.actions,fO=t=>t.projectFileReducer.instances,AO=o.createSelector([fO],t=>A(Object.values(t).sort((s,e)=>s.z_index-e.z_index))),wO=t=>s=>s.projectFileReducer.instances[t],PO=m(o.createSelector([AO,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),TO=Ba.reducer,Je=O(t=>t.uuid),OO={instances:{}},Da=o.createSlice({name:"projects",initialState:OO,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,OO)),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:IO,setProjects:FO,setProject:_O,addProjects:gO,addProject:RO,updateProjects:bO,updateProject:MO,deleteProject:vO,deleteProjects:EO}=Da.actions,VO=Da.reducer,kO=t=>t.projectReducer.instances,Us=o.createSelector([kO],t=>Object.values(t)),BO=t=>s=>s.projectReducer.instances[t],DO=m(o.createSelector([Us,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),iD=m(o.createSelector([Us,rs,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.user===e).map(a=>a.project));return A(t.filter(a=>n.has(a.uuid)))})),nD=m(o.createSelector([Us,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Ze=O(({uuid:t})=>t),WO={instances:{}},Wa=o.createSlice({name:"procedures",initialState:WO,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,WO)),reducers:{initializeProcedures:Ze.initialize,addProcedure:Ze.addOne,addProcedures:Ze.addMany,setProcedure:Ze.setOne,setProcedures:Ze.setMany,updateProcedure:Ze.updateOne,updateProcedures:Ze.updateMany,deleteProcedure:Ze.deleteOne,deleteProcedures:Ze.deleteMany}}),{initializeProcedures:zO,addProcedure:qO,addProcedures:za,setProcedure:jO,setProcedures:$O,updateProcedure:CO,updateProcedures:UO,deleteProcedure:LO,deleteProcedures:qa}=Wa.actions,NO=Wa.reducer,HO=t=>t.procedureReducer.instances,Kt=o.createSelector([HO],t=>Object.values(t)),GO=t=>s=>s.procedureReducer.instances[t],KO=m(o.createSelector([Kt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),aD=m(o.createSelector([Kt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),YO=m(o.createSelector([Kt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_type===s)))),cD=m(o.createSelector([Kt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),rD=m(o.createSelector([Kt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),Xe=O(t=>t.uuid),QO={instances:{}},ja=o.createSlice({name:"procedureStepAssignees",initialState:QO,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,QO)),reducers:{initializeProcedureStepAssignees:Xe.initialize,addProcedureStepAssignee:Xe.addOne,addProcedureStepAssignees:Xe.addMany,setProcedureStepAssignee:Xe.setOne,setProcedureStepAssignees:Xe.setMany,updateProcedureStepAssignee:Xe.updateOne,updateProcedureStepAssignees:Xe.updateMany,deleteProcedureStepAssignee:Xe.deleteOne,deleteProcedureStepAssignees:Xe.deleteMany}}),{initializeProcedureStepAssignees:JO,addProcedureStepAssignee:ZO,addProcedureStepAssignees:XO,setProcedureStepAssignee:xO,setProcedureStepAssignees:eI,updateProcedureStepAssignee:tI,updateProcedureStepAssignees:sI,deleteProcedureStepAssignee:iI,deleteProcedureStepAssignees:nI}=ja.actions,aI=t=>t.procedureStepAssigneeReducer.instances,ds=o.createSelector([aI],t=>Object.values(t)),cI=t=>s=>s.procedureStepAssigneeReducer.instances[t],rI=m(o.createSelector([ds,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),dD=m(o.createSelector([ds,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),lD=m(o.createSelector([ds,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),uD=m(o.createSelector([ds,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({procedure:n,procedure_step:a})=>n===s&&a===e)))),dI=ja.reducer,xe=O(t=>t.uuid),lI={instances:{}},$a=o.createSlice({name:"procedureStepComments",initialState:lI,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,lI)),reducers:{initializeProcedureStepComments:xe.initialize,addProcedureStepComment:xe.addOne,addProcedureStepComments:xe.addMany,setProcedureStepComment:xe.setOne,setProcedureStepComments:xe.setMany,updateProcedureStepComment:xe.updateOne,updateProcedureStepComments:xe.updateMany,deleteProcedureStepComment:xe.deleteOne,deleteProcedureStepComments:xe.deleteMany}}),{initializeProcedureStepComments:uI,addProcedureStepComment:oI,addProcedureStepComments:hI,setProcedureStepComment:pI,setProcedureStepComments:yI,updateProcedureStepComment:SI,updateProcedureStepComments:mI,deleteProcedureStepComment:fI,deleteProcedureStepComments:AI}=$a.actions,wI=t=>t.procedureStepCommentReducer.instances,ls=o.createSelector([wI],t=>Object.values(t)),PI=t=>s=>s.procedureStepCommentReducer.instances[t],TI=m(o.createSelector([ls,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),oD=m(o.createSelector([ls,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),hD=m(o.createSelector([ls,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),pD=m(o.createSelector([ls,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({procedure:n,procedure_step:a})=>n===s&&a===e)))),OI=$a.reducer,et=O(t=>t.uuid),II={instances:{}},Ca=o.createSlice({name:"procedureStepDefaultAssignees",initialState:II,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,II)),reducers:{initializeProcedureStepDefaultAssignees:et.initialize,addProcedureStepDefaultAssignee:et.addOne,addProcedureStepDefaultAssignees:et.addMany,setProcedureStepDefaultAssignee:et.setOne,setProcedureStepDefaultAssignees:et.setMany,updateProcedureStepDefaultAssignee:et.updateOne,updateProcedureStepDefaultAssignees:et.updateMany,deleteProcedureStepDefaultAssignee:et.deleteOne,deleteProcedureStepDefaultAssignees:et.deleteMany}}),{initializeProcedureStepDefaultAssignees:FI,addProcedureStepDefaultAssignee:_I,addProcedureStepDefaultAssignees:gI,setProcedureStepDefaultAssignee:RI,setProcedureStepDefaultAssignees:bI,updateProcedureStepDefaultAssignee:MI,updateProcedureStepDefaultAssignees:vI,deleteProcedureStepDefaultAssignee:EI,deleteProcedureStepDefaultAssignees:VI}=Ca.actions,kI=t=>t.procedureStepDefaultAssigneeReducer.instances,Ua=o.createSelector([kI],t=>Object.values(t)),BI=t=>s=>s.procedureStepDefaultAssigneeReducer.instances[t],DI=m(o.createSelector([Ua,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yD=m(o.createSelector([Ua,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),WI=Ca.reducer,tt=O(t=>t.uuid),zI={instances:{}},La=o.createSlice({name:"procedureStepDefaultReviewers",initialState:zI,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,zI)),reducers:{initializeProcedureStepDefaultReviewers:tt.initialize,addProcedureStepDefaultReviewer:tt.addOne,addProcedureStepDefaultReviewers:tt.addMany,setProcedureStepDefaultReviewer:tt.setOne,setProcedureStepDefaultReviewers:tt.setMany,updateProcedureStepDefaultReviewer:tt.updateOne,updateProcedureStepDefaultReviewers:tt.updateMany,deleteProcedureStepDefaultReviewer:tt.deleteOne,deleteProcedureStepDefaultReviewers:tt.deleteMany}}),{initializeProcedureStepDefaultReviewers:qI,addProcedureStepDefaultReviewer:jI,addProcedureStepDefaultReviewers:$I,setProcedureStepDefaultReviewer:CI,setProcedureStepDefaultReviewers:UI,updateProcedureStepDefaultReviewer:LI,updateProcedureStepDefaultReviewers:NI,deleteProcedureStepDefaultReviewer:HI,deleteProcedureStepDefaultReviewers:GI}=La.actions,KI=t=>t.procedureStepDefaultReviewerReducer.instances,Na=o.createSelector([KI],t=>Object.values(t)),YI=t=>s=>s.procedureStepDefaultReviewerReducer.instances[t],QI=m(o.createSelector([Na,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),SD=m(o.createSelector([Na,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),JI=La.reducer,st=O(t=>t.uuid),ZI={instances:{}},Ha=o.createSlice({name:"procedureStepEvents",initialState:ZI,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,ZI)),reducers:{initializeProcedureStepEvents:st.initialize,addProcedureStepEvent:st.addOne,addProcedureStepEvents:st.addMany,setProcedureStepEvent:st.setOne,setProcedureStepEvents:st.setMany,updateProcedureStepEvent:st.updateOne,updateProcedureStepEvents:st.updateMany,deleteProcedureStepEvent:st.deleteOne,deleteProcedureStepEvents:st.deleteMany}}),{initializeProcedureStepEvents:XI,addProcedureStepEvent:xI,addProcedureStepEvents:eF,setProcedureStepEvent:tF,setProcedureStepEvents:sF,updateProcedureStepEvent:iF,updateProcedureStepEvents:nF,deleteProcedureStepEvent:aF,deleteProcedureStepEvents:cF}=Ha.actions,rF=t=>t.procedureStepEventReducer.instances,us=o.createSelector([rF],t=>Object.values(t)),dF=t=>s=>s.procedureStepEventReducer.instances[t],lF=m(o.createSelector([us,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),mD=m(o.createSelector([us,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),fD=m(o.createSelector([us,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),AD=m(o.createSelector([us,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({procedure:n,procedure_step:a})=>n===s&&a===e)))),uF=Ha.reducer,it=O(t=>t.uuid),oF={instances:{}},Ga=o.createSlice({name:"procedureStepFieldsAttachments",initialState:oF,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,oF)),reducers:{initializeProcedureStepFieldsAttachments:it.initialize,addProcedureStepFieldsAttachment:it.addOne,addProcedureStepFieldsAttachments:it.addMany,setProcedureStepFieldsAttachment:it.setOne,setProcedureStepFieldsAttachments:it.setMany,updateProcedureStepFieldsAttachment:it.updateOne,updateProcedureStepFieldsAttachments:it.updateMany,deleteProcedureStepFieldsAttachment:it.deleteOne,deleteProcedureStepFieldsAttachments:it.deleteMany}}),{initializeProcedureStepFieldsAttachments:hF,addProcedureStepFieldsAttachment:pF,addProcedureStepFieldsAttachments:Ka,setProcedureStepFieldsAttachment:yF,setProcedureStepFieldsAttachments:SF,updateProcedureStepFieldsAttachment:mF,updateProcedureStepFieldsAttachments:fF,deleteProcedureStepFieldsAttachment:AF,deleteProcedureStepFieldsAttachments:Ya}=Ga.actions,wF=t=>t.procedureStepFieldsAttachmentReducer.instances,Qa=o.createSelector([wF],t=>Object.values(t)),PF=m(o.createSelector([Qa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),TF=t=>s=>s.procedureStepFieldsAttachmentReducer.instances[t],OF=m(o.createSelector([Qa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),IF=Ga.reducer,nt=O(t=>t.uuid),FF={instances:{}},Ja=o.createSlice({name:"procedureStepFields",initialState:FF,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,FF)),reducers:{initializeProcedureStepFields:nt.initialize,addProcedureStepFields:nt.addOne,addProcedureStepFieldsMany:nt.addMany,setProcedureStepFields:nt.setOne,setProcedureStepFieldsMany:nt.setMany,updateProcedureStepFields:nt.updateOne,updateProcedureStepFieldsMany:nt.updateMany,deleteProcedureStepFields:nt.deleteOne,deleteProcedureStepFieldsMany:nt.deleteMany}}),{initializeProcedureStepFields:_F,addProcedureStepFields:gF,addProcedureStepFieldsMany:RF,setProcedureStepFields:bF,setProcedureStepFieldsMany:MF,updateProcedureStepFields:vF,updateProcedureStepFieldsMany:EF,deleteProcedureStepFields:VF,deleteProcedureStepFieldsMany:kF}=Ja.actions,Za=t=>t.procedureStepFieldsReducer.instances,Ls=o.createSelector([Za],t=>Object.values(t)),wD=m(o.createSelector([Ls,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),PD=m(o.createSelector([Ls,(t,s)=>s],(t,s)=>t.filter(e=>e.procedure_step===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),TD=o.createSelector([Za],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}),BF=t=>s=>s.procedureStepFieldsReducer.instances[t],DF=m(o.createSelector([Ls,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),WF=Ja.reducer,at=O(t=>t.uuid),zF={instances:{}},Xa=o.createSlice({name:"procedureStepFieldValuesAttachments",initialState:zF,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,zF)),reducers:{initializeProcedureStepFieldValuesAttachments:at.initialize,addProcedureStepFieldValuesAttachment:at.addOne,addProcedureStepFieldValuesAttachments:at.addMany,setProcedureStepFieldValuesAttachment:at.setOne,setProcedureStepFieldValuesAttachments:at.setMany,updateProcedureStepFieldValuesAttachment:at.updateOne,updateProcedureStepFieldValuesAttachments:at.updateMany,deleteProcedureStepFieldValuesAttachment:at.deleteOne,deleteProcedureStepFieldValuesAttachments:at.deleteMany}}),{initializeProcedureStepFieldValuesAttachments:qF,addProcedureStepFieldValuesAttachment:jF,addProcedureStepFieldValuesAttachments:xa,setProcedureStepFieldValuesAttachment:$F,setProcedureStepFieldValuesAttachments:CF,updateProcedureStepFieldValuesAttachment:UF,updateProcedureStepFieldValuesAttachments:LF,deleteProcedureStepFieldValuesAttachment:NF,deleteProcedureStepFieldValuesAttachments:ec}=Xa.actions,HF=t=>t.procedureStepFieldValuesAttachmentReducer.instances,tc=o.createSelector([HF],t=>Object.values(t)),GF=t=>s=>s.procedureStepFieldValuesAttachmentReducer.instances[t],KF=m(o.createSelector([tc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),YF=m(o.createSelector([tc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),QF=Xa.reducer,ct=O(t=>t.uuid),JF={instances:{}},sc=o.createSlice({name:"procedureStepFieldValues",initialState:JF,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,JF)),reducers:{initializeProcedureStepFieldValues:ct.initialize,addProcedureStepFieldValues:ct.addOne,addProcedureStepFieldValuesMany:ct.addMany,setProcedureStepFieldValues:ct.setOne,setProcedureStepFieldValuesMany:ct.setMany,updateProcedureStepFieldValues:ct.updateOne,updateProcedureStepFieldValuesMany:ct.updateMany,deleteProcedureStepFieldValues:ct.deleteOne,deleteProcedureStepFieldValuesMany:ct.deleteMany}}),{initializeProcedureStepFieldValues:ZF,addProcedureStepFieldValues:XF,addProcedureStepFieldValuesMany:xF,setProcedureStepFieldValues:e_,setProcedureStepFieldValuesMany:t_,updateProcedureStepFieldValues:s_,updateProcedureStepFieldValuesMany:i_,deleteProcedureStepFieldValues:n_,deleteProcedureStepFieldValuesMany:a_}=sc.actions,c_=t=>t.procedureStepFieldValuesReducer.instances,Wt=o.createSelector([c_],t=>Object.values(t)),OD=m(o.createSelector([Wt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),ID=m(o.createSelector([Wt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),r_=t=>s=>s.procedureStepFieldValuesReducer.instances[t],d_=m(o.createSelector([Wt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),FD=m(o.createSelector([Wt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({procedure:n,procedure_step:a})=>n===s&&a===e)))),_D=m(o.createSelector([Wt,(t,s)=>s],(t,s)=>{const e={};for(const n of t){const{procedure:a,procedure_step:c}=n;if(a!==s)continue;const r=e[c];(!r||r.submitted_at<=n.submitted_at)&&(e[c]=n)}return e})),l_=sc.reducer,rt=O(t=>t.uuid),u_={instances:{}},ic=o.createSlice({name:"procedureStepFieldValuesReviewRequests",initialState:u_,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,u_)),reducers:{initializeProcedureStepFieldValuesReviewRequests:rt.initialize,addProcedureStepFieldValuesReviewRequest:rt.addOne,addProcedureStepFieldValuesReviewRequests:rt.addMany,setProcedureStepFieldValuesReviewRequest:rt.setOne,setProcedureStepFieldValuesReviewRequests:rt.setMany,updateProcedureStepFieldValuesReviewRequest:rt.updateOne,updateProcedureStepFieldValuesReviewRequests:rt.updateMany,deleteProcedureStepFieldValuesReviewRequest:rt.deleteOne,deleteProcedureStepFieldValuesReviewRequests:rt.deleteMany}}),{initializeProcedureStepFieldValuesReviewRequests:o_,addProcedureStepFieldValuesReviewRequest:h_,addProcedureStepFieldValuesReviewRequests:nc,setProcedureStepFieldValuesReviewRequest:p_,setProcedureStepFieldValuesReviewRequests:y_,updateProcedureStepFieldValuesReviewRequest:S_,updateProcedureStepFieldValuesReviewRequests:m_,deleteProcedureStepFieldValuesReviewRequest:f_,deleteProcedureStepFieldValuesReviewRequests:ac}=ic.actions,A_=t=>t.procedureStepFieldValuesReviewRequestReducer.instances,os=o.createSelector([A_],t=>Object.values(t)),w_=t=>s=>s.procedureStepFieldValuesReviewRequestReducer.instances[t],P_=m(o.createSelector([os,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),T_=m(o.createSelector([os,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),gD=m(o.createSelector([os,(t,s)=>s],(t,s)=>{let e;for(const n of t){const{field_values:a}=n;a===s&&(!e||e.submitted_at<=n.submitted_at)&&(e=n)}return e})),RD=m(o.createSelector([Wt,os,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(E(t.filter(({procedure_step:c,procedure:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),O_=ic.reducer,dt=O(t=>t.uuid),I_={instances:{}},cc=o.createSlice({name:"procedureStepFieldValuesReviews",initialState:I_,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,I_)),reducers:{initializeProcedureStepFieldValuesReviews:dt.initialize,addProcedureStepFieldValuesReview:dt.addOne,addProcedureStepFieldValuesReviews:dt.addMany,setProcedureStepFieldValuesReview:dt.setOne,setProcedureStepFieldValuesReviews:dt.setMany,updateProcedureStepFieldValuesReview:dt.updateOne,updateProcedureStepFieldValuesReviews:dt.updateMany,deleteProcedureStepFieldValuesReview:dt.deleteOne,deleteProcedureStepFieldValuesReviews:dt.deleteMany}}),{initializeProcedureStepFieldValuesReviews:F_,addProcedureStepFieldValuesReview:__,addProcedureStepFieldValuesReviews:rc,setProcedureStepFieldValuesReview:g_,setProcedureStepFieldValuesReviews:R_,updateProcedureStepFieldValuesReview:b_,updateProcedureStepFieldValuesReviews:M_,deleteProcedureStepFieldValuesReview:v_,deleteProcedureStepFieldValuesReviews:dc}=cc.actions,E_=t=>t.procedureStepFieldValuesReviewReducer.instances,Yt=o.createSelector([E_],t=>Object.values(t)),V_=t=>s=>s.procedureStepFieldValuesReviewReducer.instances[t],k_=m(o.createSelector([Yt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),B_=m(o.createSelector([Yt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),bD=m(o.createSelector([Yt,(t,s)=>s],(t,s)=>{let e;for(const n of t){const{field_values:a}=n;a===s&&(!e||e.submitted_at<=n.submitted_at)&&(e=n)}return e})),MD=m(o.createSelector([Wt,Yt,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(E(t.filter(({procedure_step:c,procedure:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),vD=o.createSelector([Yt],t=>{const s={};for(const e of t){const{field_values:n}=e,a=s[n];(!a||a.submitted_at<=e.submitted_at)&&(s[n]=e)}return s}),D_=cc.reducer,lt=O(t=>t.uuid),W_={instances:{}},lc=o.createSlice({name:"procedureStepReviewers",initialState:W_,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,W_)),reducers:{initializeProcedureStepReviewers:lt.initialize,addProcedureStepReviewer:lt.addOne,addProcedureStepReviewers:lt.addMany,setProcedureStepReviewer:lt.setOne,setProcedureStepReviewers:lt.setMany,updateProcedureStepReviewer:lt.updateOne,updateProcedureStepReviewers:lt.updateMany,deleteProcedureStepReviewer:lt.deleteOne,deleteProcedureStepReviewers:lt.deleteMany}}),{initializeProcedureStepReviewers:z_,addProcedureStepReviewer:q_,addProcedureStepReviewers:j_,setProcedureStepReviewer:$_,setProcedureStepReviewers:C_,updateProcedureStepReviewer:U_,updateProcedureStepReviewers:L_,deleteProcedureStepReviewer:N_,deleteProcedureStepReviewers:H_}=lc.actions,G_=t=>t.procedureStepReviewerReducer.instances,hs=o.createSelector([G_],t=>Object.values(t)),K_=t=>s=>s.procedureStepReviewerReducer.instances[t],Y_=m(o.createSelector([hs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ED=m(o.createSelector([hs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),VD=m(o.createSelector([hs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),kD=m(o.createSelector([hs,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({procedure:n,procedure_step:a})=>n===s&&a===e)))),Q_=lc.reducer,ut=O(t=>t.uuid),J_={instances:{}},uc=o.createSlice({name:"procedureSteps",initialState:J_,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,J_)),reducers:{initializeProcedureSteps:ut.initialize,setProcedureStep:ut.setOne,setProcedureSteps:ut.setMany,addProcedureStep:ut.addOne,addProcedureSteps:ut.addMany,updateProcedureStep:ut.updateOne,updateProcedureSteps:ut.updateMany,deleteProcedureStep:ut.deleteOne,deleteProcedureSteps:ut.deleteMany}}),{initializeProcedureSteps:Z_,setProcedureStep:X_,setProcedureSteps:x_,addProcedureStep:eg,addProcedureSteps:tg,updateProcedureStep:sg,updateProcedureSteps:ig,deleteProcedureStep:ng,deleteProcedureSteps:ag}=uc.actions,cg=uc.reducer,Ns=t=>t.procedureStepReducer.instances,rg=t=>s=>s.procedureStepReducer.instances[t],oc=o.createSelector([Ns],t=>Object.values(t)),BD=m(o.createSelector([Ns,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.procedure_type===s&&(e[n]=a);return is(e)})),DD=m(o.createSelector([oc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_type===s)))),dg=m(o.createSelector([oc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),lg=m(o.createSelector([Ns,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=Wr(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),ot=O(({uuid:t})=>t),ug={instances:{}},hc=o.createSlice({name:"procedureTypeAttachments",initialState:ug,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,ug)),reducers:{initializeProcedureTypeAttachments:ot.initialize,addProcedureTypeAttachment:ot.addOne,addProcedureTypeAttachments:ot.addMany,setProcedureTypeAttachment:ot.setOne,setProcedureTypeAttachments:ot.setMany,updateProcedureTypeAttachment:ot.updateOne,updateProcedureTypeAttachments:ot.updateMany,deleteProcedureTypeAttachment:ot.deleteOne,deleteProcedureTypeAttachments:ot.deleteMany}}),{initializeProcedureTypeAttachments:og,addProcedureTypeAttachment:hg,addProcedureTypeAttachments:pg,setProcedureTypeAttachment:yg,setProcedureTypeAttachments:Sg,updateProcedureTypeAttachment:mg,updateProcedureTypeAttachments:fg,deleteProcedureTypeAttachment:Ag,deleteProcedureTypeAttachments:wg}=hc.actions,Pg=hc.reducer,Tg=t=>t.procedureTypeAttachmentReducer.instances,pc=o.createSelector([Tg],t=>Object.values(t)),Og=t=>s=>s.procedureTypeAttachmentReducer.instances[t],Ig=m(o.createSelector([pc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),WD=m(o.createSelector([pc,(t,s)=>s],(t,s)=>A(t.filter(({procedure_type:e})=>s===e)))),ht=O(({uuid:t})=>t),Fg={instances:{}},yc=o.createSlice({name:"procedureTypeFieldsAttachments",initialState:Fg,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Fg)),reducers:{initializeProcedureTypeFieldsAttachments:ht.initialize,addProcedureTypeFieldsAttachment:ht.addOne,addProcedureTypeFieldsAttachments:ht.addMany,setProcedureTypeFieldsAttachment:ht.setOne,setProcedureTypeFieldsAttachments:ht.setMany,updateProcedureTypeFieldsAttachment:ht.updateOne,updateProcedureTypeFieldsAttachments:ht.updateMany,deleteProcedureTypeFieldsAttachment:ht.deleteOne,deleteProcedureTypeFieldsAttachments:ht.deleteMany}}),{initializeProcedureTypeFieldsAttachments:_g,addProcedureTypeFieldsAttachment:gg,addProcedureTypeFieldsAttachments:Rg,setProcedureTypeFieldsAttachment:bg,setProcedureTypeFieldsAttachments:Mg,updateProcedureTypeFieldsAttachment:vg,updateProcedureTypeFieldsAttachments:Eg,deleteProcedureTypeFieldsAttachment:Vg,deleteProcedureTypeFieldsAttachments:kg}=yc.actions,Bg=yc.reducer,Dg=t=>t.procedureTypeFieldsAttachmentReducer.instances,Sc=o.createSelector([Dg],t=>Object.values(t)),zD=m(o.createSelector([Sc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),Wg=t=>s=>s.procedureTypeFieldsAttachmentReducer.instances[t],zg=m(o.createSelector([Sc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),pt=O(({uuid:t})=>t),qg={instances:{}},mc=o.createSlice({name:"procedureTypeFields",initialState:qg,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,qg)),reducers:{initializeProcedureTypeFields:pt.initialize,addProcedureTypeFields:pt.addOne,addProcedureTypeFieldsMany:pt.addMany,setProcedureTypeFields:pt.setOne,setProcedureTypeFieldsMany:pt.setMany,updateProcedureTypeFields:pt.updateOne,updateProcedureTypeFieldsMany:pt.updateMany,deleteProcedureTypeFields:pt.deleteOne,deleteProcedureTypeFieldsMany:pt.deleteMany}}),{initializeProcedureTypeFields:jg,addProcedureTypeFields:$g,addProcedureTypeFieldsMany:Cg,setProcedureTypeFields:Ug,setProcedureTypeFieldsMany:Lg,updateProcedureTypeFields:Ng,updateProcedureTypeFieldsMany:Hg,deleteProcedureTypeFields:Gg,deleteProcedureTypeFieldsMany:Kg}=mc.actions,Yg=mc.reducer,Qg=t=>t.procedureTypeFieldsReducer.instances,Hs=o.createSelector([Qg],t=>Object.values(t)),qD=m(o.createSelector([Hs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_type===s)))),jD=m(o.createSelector([Hs,(t,s)=>s],(t,s)=>t.filter(e=>e.procedure_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Jg=t=>s=>s.procedureTypeFieldsReducer.instances[t],Zg=m(o.createSelector([Hs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yt=O(({uuid:t})=>t),Xg={instances:{}},fc=o.createSlice({name:"procedureTypeFieldValuesAttachments",initialState:Xg,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Xg)),reducers:{initializeProcedureTypeFieldValuesAttachments:yt.initialize,addProcedureTypeFieldValuesAttachment:yt.addOne,addProcedureTypeFieldValuesAttachments:yt.addMany,setProcedureTypeFieldValuesAttachment:yt.setOne,setProcedureTypeFieldValuesAttachments:yt.setMany,updateProcedureTypeFieldValuesAttachment:yt.updateOne,updateProcedureTypeFieldValuesAttachments:yt.updateMany,deleteProcedureTypeFieldValuesAttachment:yt.deleteOne,deleteProcedureTypeFieldValuesAttachments:yt.deleteMany}}),{initializeProcedureTypeFieldValuesAttachments:xg,addProcedureTypeFieldValuesAttachment:eR,addProcedureTypeFieldValuesAttachments:Ac,setProcedureTypeFieldValuesAttachment:tR,setProcedureTypeFieldValuesAttachments:sR,updateProcedureTypeFieldValuesAttachment:iR,updateProcedureTypeFieldValuesAttachments:nR,deleteProcedureTypeFieldValuesAttachment:aR,deleteProcedureTypeFieldValuesAttachments:wc}=fc.actions,cR=fc.reducer,rR=t=>t.procedureTypeFieldValuesAttachmentReducer.instances,Pc=o.createSelector([rR],t=>Object.values(t)),dR=t=>s=>s.procedureTypeFieldValuesAttachmentReducer.instances[t],lR=m(o.createSelector([Pc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),uR=m(o.createSelector([Pc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),St=O(({uuid:t})=>t),oR={instances:{}},Tc=o.createSlice({name:"procedureTypeFieldValues",initialState:oR,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,oR)),reducers:{initializeProcedureTypeFieldValues:St.initialize,addProcedureTypeFieldValues:St.addOne,addProcedureTypeFieldValuesMany:St.addMany,setProcedureTypeFieldValues:St.setOne,setProcedureTypeFieldValuesMany:St.setMany,updateProcedureTypeFieldValues:St.updateOne,updateProcedureTypeFieldValuesMany:St.updateMany,deleteProcedureTypeFieldValues:St.deleteOne,deleteProcedureTypeFieldValuesMany:St.deleteMany}}),{initializeProcedureTypeFieldValues:hR,addProcedureTypeFieldValues:pR,addProcedureTypeFieldValuesMany:yR,setProcedureTypeFieldValues:SR,setProcedureTypeFieldValuesMany:mR,updateProcedureTypeFieldValues:fR,updateProcedureTypeFieldValuesMany:AR,deleteProcedureTypeFieldValues:wR,deleteProcedureTypeFieldValuesMany:PR}=Tc.actions,TR=Tc.reducer,OR=t=>t.procedureTypeFieldValuesReducer.instances,Oc=o.createSelector([OR],t=>Object.values(t)),$D=m(o.createSelector([Oc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),IR=t=>s=>s.procedureTypeFieldValuesReducer.instances[t],FR=m(o.createSelector([Oc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),mt=O(t=>t.uuid),_R={instances:{}},Ic=o.createSlice({name:"procedureTypes",initialState:_R,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,_R)),reducers:{initializeProcedureTypes:mt.initialize,addProcedureType:mt.addOne,addProcedureTypes:mt.addMany,setProcedureType:mt.setOne,setProcedureTypes:mt.setMany,updateProcedureType:mt.updateOne,updateProcedureTypes:mt.updateMany,deleteProcedureType:mt.deleteOne,deleteProcedureTypes:mt.deleteMany}}),{initializeProcedureTypes:gR,addProcedureType:RR,addProcedureTypes:bR,setProcedureType:MR,setProcedureTypes:vR,updateProcedureType:ER,updateProcedureTypes:VR,deleteProcedureType:kR,deleteProcedureTypes:BR}=Ic.actions,DR=Ic.reducer,WR=t=>t.procedureTypeReducer.instances,Gs=o.createSelector([WR],t=>Object.values(t)),zR=t=>s=>s.procedureTypeReducer.instances[t],qR=m(o.createSelector([Gs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),CD=m(o.createSelector([Gs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),UD=m(o.createSelector([Gs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),LD={isRehydrated:!1},Fc=o.createSlice({name:"rehydrated",initialState:LD,reducers:{setRehydrated:(t,s)=>{t.isRehydrated=s.payload}}}),{setRehydrated:ND}=Fc.actions,HD=t=>t.rehydratedReducer.isRehydrated,jR=Fc.reducer,ft=O(t=>t.uuid),$R={instances:{}},_c=o.createSlice({name:"teamMemberships",initialState:$R,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,$R)),reducers:{initializeTeamMemberships:ft.initialize,addTeamMembership:ft.addOne,addTeamMemberships:ft.addMany,setTeamMembership:ft.setOne,setTeamMemberships:ft.setMany,updateTeamMembership:ft.updateOne,updateTeamMemberships:ft.updateMany,deleteTeamMembership:ft.deleteOne,deleteTeamMemberships:ft.deleteMany}}),{initializeTeamMemberships:CR,addTeamMembership:UR,addTeamMemberships:LR,setTeamMembership:NR,setTeamMemberships:HR,updateTeamMembership:GR,updateTeamMemberships:KR,deleteTeamMembership:YR,deleteTeamMemberships:QR}=_c.actions,JR=_c.reducer,ZR=t=>t.teamMembershipReducer.instances,Ks=o.createSelector([ZR],t=>Object.values(t)),XR=t=>s=>s.teamMembershipReducer.instances[t],xR=m(o.createSelector([Ks,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),GD=m(o.createSelector([Ks,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.team===s))e[n.user]=n;return e})),KD=m(o.createSelector([js,Ks,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.team===e).map(a=>a.user));return A(t.filter(a=>n.has(a.id)))})),At=O(t=>t.uuid),eb={instances:{}},gc=o.createSlice({name:"teams",initialState:eb,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,eb)),reducers:{initializeTeams:At.initialize,addTeam:At.addOne,addTeams:At.addMany,setTeam:At.setOne,setTeams:At.setMany,updateTeam:At.updateOne,updateTeams:At.updateMany,deleteTeam:At.deleteOne,deleteTeams:At.deleteMany}}),{initializeTeams:tb,addTeam:sb,addTeams:ib,setTeam:nb,setTeams:ab,updateTeam:cb,updateTeams:rb,deleteTeam:db,deleteTeams:lb}=gc.actions,ub=t=>t.teamReducer.instances,Rc=o.createSelector([ub],t=>Object.values(t)),ob=t=>s=>s.teamReducer.instances[t],hb=m(o.createSelector([Rc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),YD=m(o.createSelector([Rc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),pb=gc.reducer,QD={version:0},yb=o.createSlice({name:"versioning",initialState:QD,reducers:{}}),Sb=yb.reducer,wt=O(t=>t.uuid),mb={instances:{}},bc=o.createSlice({name:"workflows",initialState:mb,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,mb)),reducers:{initializeWorkflows:wt.initialize,addWorkflow:wt.addOne,addWorkflows:wt.addMany,setWorkflow:wt.setOne,setWorkflows:wt.setMany,updateWorkflow:wt.updateOne,updateWorkflows:wt.updateMany,deleteWorkflow:wt.deleteOne,deleteWorkflows:wt.deleteMany}}),{initializeWorkflows:fb,addWorkflow:Ab,addWorkflows:wb,setWorkflow:Pb,setWorkflows:Tb,updateWorkflow:Ob,updateWorkflows:Ib,deleteWorkflow:Fb,deleteWorkflows:_b}=bc.actions,gb=t=>t.workflowReducer.instances,Ys=o.createSelector([gb],t=>Object.values(t)),Rb=t=>s=>s.workflowReducer.instances[t],bb=m(o.createSelector([Ys,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),JD=m(o.createSelector([Ys,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),ZD=m(o.createSelector([Ys,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_type===s)))),Mb=bc.reducer,Pt=O(t=>t.uuid),vb={instances:{}},Mc=o.createSlice({name:"workflowIssueLinks",initialState:vb,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,vb)),reducers:{initializeWorkflowIssueLinks:Pt.initialize,addWorkflowIssueLink:Pt.addOne,addWorkflowIssueLinks:Pt.addMany,setWorkflowIssueLink:Pt.setOne,setWorkflowIssueLinks:Pt.setMany,updateWorkflowIssueLink:Pt.updateOne,updateWorkflowIssueLinks:Pt.updateMany,deleteWorkflowIssueLink:Pt.deleteOne,deleteWorkflowIssueLinks:Pt.deleteMany}}),{initializeWorkflowIssueLinks:Eb,addWorkflowIssueLink:Vb,addWorkflowIssueLinks:ps,setWorkflowIssueLink:kb,setWorkflowIssueLinks:Bb,updateWorkflowIssueLink:Db,updateWorkflowIssueLinks:Wb,deleteWorkflowIssueLink:zb,deleteWorkflowIssueLinks:ys}=Mc.actions,qb=t=>t.workflowIssueLinkReducer.instances,Qt=o.createSelector([qb],t=>Object.values(t)),jb=t=>s=>s.workflowIssueLinkReducer.instances[t],$b=m(o.createSelector([Qt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Cb=m(o.createSelector([Qt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),Ub=m(o.createSelector([Qt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({workflow:n})=>e.has(n)))})),Lb=m(o.createSelector([Qt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),XD=m(o.createSelector([Qt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({issue:n})=>e.has(n)))})),Nb=Mc.reducer,Tt=O(t=>t.uuid),Hb={instances:{}},vc=o.createSlice({name:"workflowStepAssignees",initialState:Hb,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Hb)),reducers:{initializeWorkflowStepAssignees:Tt.initialize,addWorkflowStepAssignee:Tt.addOne,addWorkflowStepAssignees:Tt.addMany,setWorkflowStepAssignee:Tt.setOne,setWorkflowStepAssignees:Tt.setMany,updateWorkflowStepAssignee:Tt.updateOne,updateWorkflowStepAssignees:Tt.updateMany,deleteWorkflowStepAssignee:Tt.deleteOne,deleteWorkflowStepAssignees:Tt.deleteMany}}),{initializeWorkflowStepAssignees:Gb,addWorkflowStepAssignee:Kb,addWorkflowStepAssignees:Yb,setWorkflowStepAssignee:Qb,setWorkflowStepAssignees:Jb,updateWorkflowStepAssignee:Zb,updateWorkflowStepAssignees:Xb,deleteWorkflowStepAssignee:xb,deleteWorkflowStepAssignees:eM}=vc.actions,tM=t=>t.workflowStepAssigneeReducer.instances,Ss=o.createSelector([tM],t=>Object.values(t)),sM=t=>s=>s.workflowStepAssigneeReducer.instances[t],iM=m(o.createSelector([Ss,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),xD=m(o.createSelector([Ss,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),eW=m(o.createSelector([Ss,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),tW=m(o.createSelector([Ss,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),nM=vc.reducer,Ot=O(t=>t.uuid),aM={instances:{}},Ec=o.createSlice({name:"workflowStepComments",initialState:aM,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,aM)),reducers:{initializeWorkflowStepComments:Ot.initialize,addWorkflowStepComment:Ot.addOne,addWorkflowStepComments:Ot.addMany,setWorkflowStepComment:Ot.setOne,setWorkflowStepComments:Ot.setMany,updateWorkflowStepComment:Ot.updateOne,updateWorkflowStepComments:Ot.updateMany,deleteWorkflowStepComment:Ot.deleteOne,deleteWorkflowStepComments:Ot.deleteMany}}),{initializeWorkflowStepComments:cM,addWorkflowStepComment:rM,addWorkflowStepComments:dM,setWorkflowStepComment:lM,setWorkflowStepComments:uM,updateWorkflowStepComment:oM,updateWorkflowStepComments:hM,deleteWorkflowStepComment:pM,deleteWorkflowStepComments:yM}=Ec.actions,SM=t=>t.workflowStepCommentReducer.instances,ms=o.createSelector([SM],t=>Object.values(t)),mM=t=>s=>s.workflowStepCommentReducer.instances[t],fM=m(o.createSelector([ms,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),sW=m(o.createSelector([ms,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),iW=m(o.createSelector([ms,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),nW=m(o.createSelector([ms,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),AM=Ec.reducer,It=O(t=>t.uuid),wM={instances:{}},Vc=o.createSlice({name:"workflowStepDefaultAssignees",initialState:wM,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,wM)),reducers:{initializeWorkflowStepDefaultAssignees:It.initialize,addWorkflowStepDefaultAssignee:It.addOne,addWorkflowStepDefaultAssignees:It.addMany,setWorkflowStepDefaultAssignee:It.setOne,setWorkflowStepDefaultAssignees:It.setMany,updateWorkflowStepDefaultAssignee:It.updateOne,updateWorkflowStepDefaultAssignees:It.updateMany,deleteWorkflowStepDefaultAssignee:It.deleteOne,deleteWorkflowStepDefaultAssignees:It.deleteMany}}),{initializeWorkflowStepDefaultAssignees:PM,addWorkflowStepDefaultAssignee:TM,addWorkflowStepDefaultAssignees:OM,setWorkflowStepDefaultAssignee:IM,setWorkflowStepDefaultAssignees:FM,updateWorkflowStepDefaultAssignee:_M,updateWorkflowStepDefaultAssignees:gM,deleteWorkflowStepDefaultAssignee:RM,deleteWorkflowStepDefaultAssignees:bM}=Vc.actions,MM=t=>t.workflowStepDefaultAssigneeReducer.instances,kc=o.createSelector([MM],t=>Object.values(t)),vM=t=>s=>s.workflowStepDefaultAssigneeReducer.instances[t],EM=m(o.createSelector([kc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),aW=m(o.createSelector([kc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),VM=Vc.reducer,Ft=O(t=>t.uuid),kM={instances:{}},Bc=o.createSlice({name:"workflowStepDefaultReviewers",initialState:kM,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,kM)),reducers:{initializeWorkflowStepDefaultReviewers:Ft.initialize,addWorkflowStepDefaultReviewer:Ft.addOne,addWorkflowStepDefaultReviewers:Ft.addMany,setWorkflowStepDefaultReviewer:Ft.setOne,setWorkflowStepDefaultReviewers:Ft.setMany,updateWorkflowStepDefaultReviewer:Ft.updateOne,updateWorkflowStepDefaultReviewers:Ft.updateMany,deleteWorkflowStepDefaultReviewer:Ft.deleteOne,deleteWorkflowStepDefaultReviewers:Ft.deleteMany}}),{initializeWorkflowStepDefaultReviewers:BM,addWorkflowStepDefaultReviewer:DM,addWorkflowStepDefaultReviewers:WM,setWorkflowStepDefaultReviewer:zM,setWorkflowStepDefaultReviewers:qM,updateWorkflowStepDefaultReviewer:jM,updateWorkflowStepDefaultReviewers:$M,deleteWorkflowStepDefaultReviewer:CM,deleteWorkflowStepDefaultReviewers:UM}=Bc.actions,LM=t=>t.workflowStepDefaultReviewerReducer.instances,Dc=o.createSelector([LM],t=>Object.values(t)),NM=t=>s=>s.workflowStepDefaultReviewerReducer.instances[t],HM=m(o.createSelector([Dc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),cW=m(o.createSelector([Dc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),GM=Bc.reducer,_t=O(t=>t.uuid),KM={instances:{}},Wc=o.createSlice({name:"workflowStepEvents",initialState:KM,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,KM)),reducers:{initializeWorkflowStepEvents:_t.initialize,addWorkflowStepEvent:_t.addOne,addWorkflowStepEvents:_t.addMany,setWorkflowStepEvent:_t.setOne,setWorkflowStepEvents:_t.setMany,updateWorkflowStepEvent:_t.updateOne,updateWorkflowStepEvents:_t.updateMany,deleteWorkflowStepEvent:_t.deleteOne,deleteWorkflowStepEvents:_t.deleteMany}}),{initializeWorkflowStepEvents:YM,addWorkflowStepEvent:QM,addWorkflowStepEvents:JM,setWorkflowStepEvent:ZM,setWorkflowStepEvents:XM,updateWorkflowStepEvent:xM,updateWorkflowStepEvents:ev,deleteWorkflowStepEvent:tv,deleteWorkflowStepEvents:sv}=Wc.actions,iv=t=>t.workflowStepEventReducer.instances,fs=o.createSelector([iv],t=>Object.values(t)),nv=t=>s=>s.workflowStepEventReducer.instances[t],av=m(o.createSelector([fs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),rW=m(o.createSelector([fs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),dW=m(o.createSelector([fs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),lW=m(o.createSelector([fs,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),cv=Wc.reducer,gt=O(t=>t.uuid),rv={instances:{}},zc=o.createSlice({name:"workflowStepFieldsAttachments",initialState:rv,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,rv)),reducers:{initializeWorkflowStepFieldsAttachments:gt.initialize,addWorkflowStepFieldsAttachment:gt.addOne,addWorkflowStepFieldsAttachments:gt.addMany,setWorkflowStepFieldsAttachment:gt.setOne,setWorkflowStepFieldsAttachments:gt.setMany,updateWorkflowStepFieldsAttachment:gt.updateOne,updateWorkflowStepFieldsAttachments:gt.updateMany,deleteWorkflowStepFieldsAttachment:gt.deleteOne,deleteWorkflowStepFieldsAttachments:gt.deleteMany}}),{initializeWorkflowStepFieldsAttachments:dv,addWorkflowStepFieldsAttachment:lv,addWorkflowStepFieldsAttachments:qc,setWorkflowStepFieldsAttachment:uv,setWorkflowStepFieldsAttachments:ov,updateWorkflowStepFieldsAttachment:hv,updateWorkflowStepFieldsAttachments:pv,deleteWorkflowStepFieldsAttachment:yv,deleteWorkflowStepFieldsAttachments:jc}=zc.actions,Sv=t=>t.workflowStepFieldsAttachmentReducer.instances,$c=o.createSelector([Sv],t=>Object.values(t)),mv=m(o.createSelector([$c,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),fv=t=>s=>s.workflowStepFieldsAttachmentReducer.instances[t],Av=m(o.createSelector([$c,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),wv=zc.reducer,Rt=O(t=>t.uuid),Pv={instances:{}},Cc=o.createSlice({name:"workflowStepFields",initialState:Pv,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Pv)),reducers:{initializeWorkflowStepFields:Rt.initialize,addWorkflowStepFields:Rt.addOne,addWorkflowStepFieldsMany:Rt.addMany,setWorkflowStepFields:Rt.setOne,setWorkflowStepFieldsMany:Rt.setMany,updateWorkflowStepFields:Rt.updateOne,updateWorkflowStepFieldsMany:Rt.updateMany,deleteWorkflowStepFields:Rt.deleteOne,deleteWorkflowStepFieldsMany:Rt.deleteMany}}),{initializeWorkflowStepFields:Tv,addWorkflowStepFields:Ov,addWorkflowStepFieldsMany:Iv,setWorkflowStepFields:Fv,setWorkflowStepFieldsMany:_v,updateWorkflowStepFields:gv,updateWorkflowStepFieldsMany:Rv,deleteWorkflowStepFields:bv,deleteWorkflowStepFieldsMany:Mv}=Cc.actions,vv=t=>t.workflowStepFieldsReducer.instances,Qs=o.createSelector([vv],t=>Object.values(t)),uW=m(o.createSelector([Qs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),oW=m(o.createSelector([Qs,(t,s)=>s],(t,s)=>t.filter(e=>e.workflow_step===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Ev=t=>s=>s.workflowStepFieldsReducer.instances[t],Vv=m(o.createSelector([Qs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),kv=Cc.reducer,bt=O(t=>t.uuid),Bv={instances:{}},Uc=o.createSlice({name:"workflowStepFieldValuesAttachments",initialState:Bv,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Bv)),reducers:{initializeWorkflowStepFieldValuesAttachments:bt.initialize,addWorkflowStepFieldValuesAttachment:bt.addOne,addWorkflowStepFieldValuesAttachments:bt.addMany,setWorkflowStepFieldValuesAttachment:bt.setOne,setWorkflowStepFieldValuesAttachments:bt.setMany,updateWorkflowStepFieldValuesAttachment:bt.updateOne,updateWorkflowStepFieldValuesAttachments:bt.updateMany,deleteWorkflowStepFieldValuesAttachment:bt.deleteOne,deleteWorkflowStepFieldValuesAttachments:bt.deleteMany}}),{initializeWorkflowStepFieldValuesAttachments:Dv,addWorkflowStepFieldValuesAttachment:Wv,addWorkflowStepFieldValuesAttachments:Lc,setWorkflowStepFieldValuesAttachment:zv,setWorkflowStepFieldValuesAttachments:qv,updateWorkflowStepFieldValuesAttachment:jv,updateWorkflowStepFieldValuesAttachments:$v,deleteWorkflowStepFieldValuesAttachment:Cv,deleteWorkflowStepFieldValuesAttachments:Nc}=Uc.actions,Uv=t=>t.workflowStepFieldValuesAttachmentReducer.instances,Hc=o.createSelector([Uv],t=>Object.values(t)),Lv=t=>s=>s.workflowStepFieldValuesAttachmentReducer.instances[t],Nv=m(o.createSelector([Hc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Hv=m(o.createSelector([Hc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Gv=Uc.reducer,Mt=O(t=>t.uuid),Kv={instances:{}},Gc=o.createSlice({name:"workflowStepFieldValues",initialState:Kv,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Kv)),reducers:{initializeWorkflowStepFieldValues:Mt.initialize,addWorkflowStepFieldValues:Mt.addOne,addWorkflowStepFieldValuesMany:Mt.addMany,setWorkflowStepFieldValues:Mt.setOne,setWorkflowStepFieldValuesMany:Mt.setMany,updateWorkflowStepFieldValues:Mt.updateOne,updateWorkflowStepFieldValuesMany:Mt.updateMany,deleteWorkflowStepFieldValues:Mt.deleteOne,deleteWorkflowStepFieldValuesMany:Mt.deleteMany}}),{initializeWorkflowStepFieldValues:Yv,addWorkflowStepFieldValues:Qv,addWorkflowStepFieldValuesMany:Jv,setWorkflowStepFieldValues:Zv,setWorkflowStepFieldValuesMany:Xv,updateWorkflowStepFieldValues:xv,updateWorkflowStepFieldValuesMany:eE,deleteWorkflowStepFieldValues:tE,deleteWorkflowStepFieldValuesMany:sE}=Gc.actions,iE=t=>t.workflowStepFieldValuesReducer.instances,zt=o.createSelector([iE],t=>Object.values(t)),hW=m(o.createSelector([zt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),pW=m(o.createSelector([zt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),nE=t=>s=>s.workflowStepFieldValuesReducer.instances[t],aE=m(o.createSelector([zt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yW=m(o.createSelector([zt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),SW=m(o.createSelector([zt,(t,s)=>s],(t,s)=>{const e={};for(const n of t){const{workflow:a,workflow_step:c}=n;if(a!==s)continue;const r=e[c];(!r||r.submitted_at<=n.submitted_at)&&(e[c]=n)}return e})),cE=Gc.reducer,vt=O(t=>t.uuid),rE={instances:{}},Kc=o.createSlice({name:"workflowStepFieldValuesReviewRequests",initialState:rE,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,rE)),reducers:{initializeWorkflowStepFieldValuesReviewRequests:vt.initialize,addWorkflowStepFieldValuesReviewRequest:vt.addOne,addWorkflowStepFieldValuesReviewRequests:vt.addMany,setWorkflowStepFieldValuesReviewRequest:vt.setOne,setWorkflowStepFieldValuesReviewRequests:vt.setMany,updateWorkflowStepFieldValuesReviewRequest:vt.updateOne,updateWorkflowStepFieldValuesReviewRequests:vt.updateMany,deleteWorkflowStepFieldValuesReviewRequest:vt.deleteOne,deleteWorkflowStepFieldValuesReviewRequests:vt.deleteMany}}),{initializeWorkflowStepFieldValuesReviewRequests:dE,addWorkflowStepFieldValuesReviewRequest:lE,addWorkflowStepFieldValuesReviewRequests:Yc,setWorkflowStepFieldValuesReviewRequest:uE,setWorkflowStepFieldValuesReviewRequests:oE,updateWorkflowStepFieldValuesReviewRequest:hE,updateWorkflowStepFieldValuesReviewRequests:pE,deleteWorkflowStepFieldValuesReviewRequest:yE,deleteWorkflowStepFieldValuesReviewRequests:Qc}=Kc.actions,SE=t=>t.workflowStepFieldValuesReviewRequestReducer.instances,As=o.createSelector([SE],t=>Object.values(t)),mE=t=>s=>s.workflowStepFieldValuesReviewRequestReducer.instances[t],fE=m(o.createSelector([As,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),AE=m(o.createSelector([As,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),mW=m(o.createSelector([As,(t,s)=>s],(t,s)=>{let e;for(const n of t){const{field_values:a}=n;a===s&&(!e||e.submitted_at<=n.submitted_at)&&(e=n)}return e})),fW=m(o.createSelector([zt,As,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(E(t.filter(({workflow_step:c,workflow:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),wE=Kc.reducer,Et=O(t=>t.uuid),PE={instances:{}},Jc=o.createSlice({name:"workflowStepFieldValuesReviews",initialState:PE,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,PE)),reducers:{initializeWorkflowStepFieldValuesReviews:Et.initialize,addWorkflowStepFieldValuesReview:Et.addOne,addWorkflowStepFieldValuesReviews:Et.addMany,setWorkflowStepFieldValuesReview:Et.setOne,setWorkflowStepFieldValuesReviews:Et.setMany,updateWorkflowStepFieldValuesReview:Et.updateOne,updateWorkflowStepFieldValuesReviews:Et.updateMany,deleteWorkflowStepFieldValuesReview:Et.deleteOne,deleteWorkflowStepFieldValuesReviews:Et.deleteMany}}),{initializeWorkflowStepFieldValuesReviews:TE,addWorkflowStepFieldValuesReview:OE,addWorkflowStepFieldValuesReviews:Zc,setWorkflowStepFieldValuesReview:IE,setWorkflowStepFieldValuesReviews:FE,updateWorkflowStepFieldValuesReview:_E,updateWorkflowStepFieldValuesReviews:gE,deleteWorkflowStepFieldValuesReview:RE,deleteWorkflowStepFieldValuesReviews:Xc}=Jc.actions,bE=t=>t.workflowStepFieldValuesReviewReducer.instances,Jt=o.createSelector([bE],t=>Object.values(t)),ME=t=>s=>s.workflowStepFieldValuesReviewReducer.instances[t],vE=m(o.createSelector([Jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),EE=m(o.createSelector([Jt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),AW=m(o.createSelector([Jt,(t,s)=>s],(t,s)=>{let e;for(const n of t){const{field_values:a}=n;a===s&&(!e||e.submitted_at<=n.submitted_at)&&(e=n)}return e})),wW=m(o.createSelector([zt,Jt,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(E(t.filter(({workflow_step:c,workflow:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),PW=o.createSelector([Jt],t=>{const s={};for(const e of t){const{field_values:n}=e,a=s[n];(!a||a.submitted_at<=e.submitted_at)&&(s[n]=e)}return s}),VE=Jc.reducer,Vt=O(t=>t.uuid),kE={instances:{}},xc=o.createSlice({name:"workflowStepReviewers",initialState:kE,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,kE)),reducers:{initializeWorkflowStepReviewers:Vt.initialize,addWorkflowStepReviewer:Vt.addOne,addWorkflowStepReviewers:Vt.addMany,setWorkflowStepReviewer:Vt.setOne,setWorkflowStepReviewers:Vt.setMany,updateWorkflowStepReviewer:Vt.updateOne,updateWorkflowStepReviewers:Vt.updateMany,deleteWorkflowStepReviewer:Vt.deleteOne,deleteWorkflowStepReviewers:Vt.deleteMany}}),{initializeWorkflowStepReviewers:BE,addWorkflowStepReviewer:DE,addWorkflowStepReviewers:WE,setWorkflowStepReviewer:zE,setWorkflowStepReviewers:qE,updateWorkflowStepReviewer:jE,updateWorkflowStepReviewers:$E,deleteWorkflowStepReviewer:CE,deleteWorkflowStepReviewers:UE}=xc.actions,LE=t=>t.workflowStepReviewerReducer.instances,ws=o.createSelector([LE],t=>Object.values(t)),NE=t=>s=>s.workflowStepReviewerReducer.instances[t],HE=m(o.createSelector([ws,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),TW=m(o.createSelector([ws,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),OW=m(o.createSelector([ws,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),IW=m(o.createSelector([ws,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),GE=xc.reducer,kt=O(t=>t.uuid),KE={instances:{}},er=o.createSlice({name:"workflowSteps",initialState:KE,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,KE)),reducers:{initializeWorkflowSteps:kt.initialize,addWorkflowStep:kt.addOne,addWorkflowSteps:kt.addMany,setWorkflowStep:kt.setOne,setWorkflowSteps:kt.setMany,updateWorkflowStep:kt.updateOne,updateWorkflowSteps:kt.updateMany,deleteWorkflowStep:kt.deleteOne,deleteWorkflowSteps:kt.deleteMany}}),{initializeWorkflowSteps:YE,addWorkflowStep:QE,addWorkflowSteps:JE,setWorkflowStep:ZE,setWorkflowSteps:XE,updateWorkflowStep:xE,updateWorkflowSteps:eV,deleteWorkflowStep:tV,deleteWorkflowSteps:sV}=er.actions,iV=t=>t.workflowStepReducer.instances,tr=o.createSelector([iV],t=>Object.values(t)),nV=t=>s=>s.workflowStepReducer.instances[t],aV=m(o.createSelector([tr,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),FW=m(o.createSelector([tr,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_type===s)))),cV=er.reducer,Bt=O(t=>t.uuid),rV={instances:{}},sr=o.createSlice({name:"workflowTypes",initialState:rV,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,rV)),reducers:{initializeWorkflowTypes:Bt.initialize,addWorkflowType:Bt.addOne,addWorkflowTypes:Bt.addMany,setWorkflowType:Bt.setOne,setWorkflowTypes:Bt.setMany,updateWorkflowType:Bt.updateOne,updateWorkflowTypes:Bt.updateMany,deleteWorkflowType:Bt.deleteOne,deleteWorkflowTypes:Bt.deleteMany}}),{initializeWorkflowTypes:dV,addWorkflowType:lV,addWorkflowTypes:uV,setWorkflowType:oV,setWorkflowTypes:hV,updateWorkflowType:pV,updateWorkflowTypes:yV,deleteWorkflowType:SV,deleteWorkflowTypes:mV}=sr.actions,fV=t=>t.workflowTypeReducer.instances,ir=o.createSelector([fV],t=>Object.values(t)),AV=t=>s=>s.workflowTypeReducer.instances[t],wV=m(o.createSelector([ir,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),_W=m(o.createSelector([ir,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),PV=sr.reducer,nr={outboxReducer:kT,fileReducer:tS,authReducer:uy},gW=o.combineReducers(nr),TV={...nr,[ss]:Sb,assetReducer:fo,assetAttachmentReducer:td,assetStageCompletionReducer:bo,assetStageReducer:Lo,assetTypeReducer:Kp,assetTypeAttachmentReducer:nh,issueReducer:SA,issueAttachmentReducer:Mf,issueTypeReducer:AP,issueTypeAttachmentReducer:MA,organizationReducer:RT,projectReducer:VO,projectAttachmentReducer:cO,projectAccessReducer:NT,organizationAccessReducer:lT,projectFileReducer:TO,procedureTypeReducer:DR,procedureReducer:NO,procedureTypeFieldsReducer:Yg,procedureTypeFieldValuesReducer:TR,procedureTypeAttachmentReducer:Pg,procedureTypeFieldsAttachmentReducer:Bg,procedureTypeFieldValuesAttachmentReducer:cR,procedureStepFieldsAttachmentReducer:IF,procedureStepFieldsReducer:WF,procedureStepFieldValuesAttachmentReducer:QF,procedureStepFieldValuesReducer:l_,procedureStepFieldValuesReviewReducer:D_,procedureStepFieldValuesReviewRequestReducer:O_,procedureStepAssigneeReducer:dI,procedureStepCommentReducer:OI,procedureStepDefaultAssigneeReducer:WI,procedureStepDefaultReviewerReducer:JI,procedureStepEventReducer:uF,procedureStepReviewerReducer:Q_,procedureStepReducer:cg,rehydratedReducer:jR,formReducer:um,formRevisionReducer:xS,formRevisionAttachmentReducer:LS,formSubmissionAttachmentReducer:_m,formSubmissionReducer:qm,formIdentifierReducer:SS,formIdentifierValueReducer:MS,userReducer:JP,emailDomainsReducer:Xy,documentsReducer:Dy,documentAttachmentReducer:Fy,teamReducer:pb,agentsReducer:Ur,issueCommentReducer:sA,issueCommentAttachmentReducer:Lf,issueUpdateReducer:CP,geoImageReducer:Xm,issueAssociationReducer:mf,issueTypeFieldsReducer:fw,issueTypeFieldValuesReducer:iw,issueTypeFieldsAttachmentReducer:LA,issueTypeFieldValuesAttachmentReducer:vw,issueTypeIdentifierReducer:Nw,issueTypeIdentifierValueReducer:nP,issueTypeStatusReducer:EP,assetTypeFieldsReducer:Vh,assetTypeFieldValuesReducer:ap,assetTypeFieldsAttachmentReducer:Ah,assetTypeFieldValuesAttachmentReducer:Hh,assetTypeIdentifierReducer:wp,assetTypeIdentifierValueReducer:kp,assetTypeStatusReducer:ry,assetProcedureTypeReducer:$l,assetProcedureReducer:_l,assetProcedureTypeFieldsReducer:$d,assetProcedureTypeFieldValuesReducer:pl,assetProcedureTypeFieldsAttachmentReducer:gd,assetProcedureTypeFieldValuesAttachmentReducer:Xd,assetProcedureTypeAttachmentReducer:hd,assetProcedureStepFieldsAttachmentReducer:iu,assetProcedureStepFieldsReducer:mu,assetProcedureStepFieldValuesAttachmentReducer:Mu,assetProcedureStepFieldValuesReducer:Lu,assetProcedureStepReducer:eo,teamMembershipReducer:JR,workflowTypeReducer:PV,workflowStepReducer:cV,workflowStepFieldsReducer:kv,workflowStepFieldsAttachmentReducer:wv,workflowReducer:Mb,workflowIssueLinkReducer:Nb,workflowStepAssigneeReducer:nM,workflowStepCommentReducer:AM,workflowStepDefaultAssigneeReducer:VM,workflowStepDefaultReviewerReducer:GM,workflowStepEventReducer:cv,workflowStepFieldValuesReducer:cE,workflowStepFieldValuesAttachmentReducer:Gv,workflowStepFieldValuesReviewReducer:VE,workflowStepFieldValuesReviewRequestReducer:wE,workflowStepReviewerReducer:GE},RW=o.combineReducers(TV),OV=1e4,IV=200,ar=[400,409,403,404,405,500],L=1e4,FV={};class _V{constructor(s){p(this,"client");p(this,"pageSize",OV);FV[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)}}const gV=()=>MV.length-1,RV=t=>(t[ss]={version:gV()},t),bV=()=>RV({}),bW=t=>(t.outboxReducer&&(t.outboxReducer.deletedRequests=[]),t),MW=t=>s=>{var e;return s===void 0&&(s={}),((e=s[ss])==null?void 0:e.version)===gV()?s:t(s)},MV=[RV,bV,bV,bW],vW=Object.fromEntries(MV.map((t,s)=>[s,MW(t)])),EW=t=>{if(t)throw t;const s=xt();s?s.dispatch({type:"rehydrated/setRehydrated",payload:!0}):console.error("Client store not set")},vV=(t,s,e)=>{const n=Lt();return n?(n.addRequest(s),n.getQueue()):(console.warn("Outbox coordinator not set; cannot enqueue request yet."),[])},EV=(t,s,e)=>{const n=Lt();if(!n)return console.warn("Outbox coordinator not set; cannot dequeue request yet."),[];const c=s.meta.offlineAction.payload.uuid;return n.remove(c),n.getQueue()};async function VW(t,s){if(!s.payload)throw new Error("Received empty payload");return HV(s)}const kW={...or,effect:VW,discard:kV,returnPromises:!0,persistCallback:EW,retry:zW,persistOptions:{storage:XV},queue:{...or.queue,enqueue:vV,dequeue:EV,peek:(...t)=>WW(...t)}},BW=xV(vW,ss),DW=o.compose(ZV.offline(kW),BW);async function VV(t,s,e){if(s.store.getState().outboxReducer.deletedRequests.includes(t.payload.uuid))throw new Error("Request was marked for deletion");const a=FV[t.meta.offline.effect.serviceName];if(!a)throw new Error(`Service ${t.meta.offline.effect.serviceName} not found`);return rr(t.meta.offline.effect.BASE_URL,t.meta.offline.effect.request,s,a,e)}function kV(t,s,e=0){var u;if(console.debug("Considering discarding request due to error:",t,`(${typeof t})`,`
|
|
2
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=
|
|
4
|
-
Action:`,s);const S=
|
|
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=xt(),c=n.getState().outboxReducer.deletedRequests,r=s.payload.uuid;function d(){n.dispatch(ET(r));const y=Lt();if(!y)throw new Error("Outbox coordinator not set");y.remove(s.payload.uuid);const S=s.meta.offline.rollback;throw S&&(console.warn("Rolling back request due to SDK error:",s),n.dispatch(S)),t}if(t instanceof C&&t.options.discard&&(console.debug("Discarding request due to explicit discard:",s.payload.url),d()),c.includes(r)&&(console.debug("Discarding request due to deletion:",s.payload.url),d()),t instanceof C){const y=t.status||((u=t.response)==null?void 0:u.status);if(y||console.warn("Error has no status code:",t),y!==void 0&&ar.includes(y)){console.warn("Discarding request due to error:",t,`
|
|
4
|
+
Action:`,s);const S=Lt();if(!S)throw new Error("Outbox coordinator not set");S.remove(s.payload.uuid),t.options.discard=!0,d()}}console.debug("Registering a retry for request:",s.payload.uuid);const l=Lt();if(!l)throw new Error("Outbox coordinator not set");return l.registerRetry(s.payload.uuid),!1}function WW(t,s,e){var n;return(n=Lt())==null?void 0:n.peek()}function zW(t,s){return xt().dispatch(VT(new Date().getTime())),Tr}const Zt="An unknown error occurred",qW=500,BV=["non_field_errors","detail"];function jW(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(([a,c])=>typeof c=="string"?BV.includes(a)?c:`${a}: ${c}`:Array.isArray(c)?BV.includes(a)?c.join(`
|
|
5
5
|
`):c.map(r=>`${a}: ${r}`).join(`
|
|
6
6
|
`):`${a}: ${JSON.stringify(c)}`).join(`
|
|
7
|
-
`)}catch(a){console.error("Failed to extract error message from response body",a)}}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>PW?Jt:e}class C extends Error{constructor(e){super(Jt);p(this,"status");p(this,"response");p(this,"message");p(this,"options");const{response:n,innerError:a}=e;this.message=e.message??TW(n,a)??Jt,this.status=(n==null?void 0:n.status)??0,this.response=n,e.discard=e.discard??!1,this.options=e}}function AV(t){function s(e){return typeof e=="object"&&e!==null&&["ok","redirect","clientError","serverError","error"].every(a=>a 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 OW extends dV{constructor(s){super(s)}}class Ct extends dV{constructor(e,n){super(e);p(this,"auth");this.auth=n}}class IW extends Ct{async startConversation(s,e){return this.enqueueRequest({description:"Start agent conversation",method:h.POST,url:"/agents/prompt/",payload:{prompt:s,active_project:e},blockers:["prompt"],blocks:["prompt"]}).then(n=>(this.dispatch(Wr(n)),n))}async continueConversation(s,e,n){return this.enqueueRequest({description:"Prompt agent",method:h.POST,url:"/agents/prompt/",payload:{prompt:s,active_project:n},blockers:["prompt"],blocks:["prompt"],queryParams:{conversation_id:e}}).then(a=>{this.dispatch(qr(a))})}async fetchDetails(s){return this.enqueueRequest({description:"Get agent conversation",method:h.GET,url:`/agents/conversations/${s}/`,blockers:["conversation"],blocks:["conversation"]}).then(e=>{this.dispatch(zr(e))})}async rate(s,e){return this.enqueueRequest({description:"Rate agent response",method:h.PUT,url:`/agents/responses/${s}/rate/`,payload:{rating:e},blockers:["rate"],blocks:["rate"]})}async list(s,e){return this.performRequest({method:h.GET,url:"/agents/conversations/",...s},e)}async refreshStore(s,e){const n=await this.list({queryParams:{project:s}},e);return this.dispatch(Dr(n)),n}}function N(t,s){const e=[];let n=0;const a=t.length;for(;n<a;)e.push(t.slice(n,n+=s));return e}function w(t,s,e){const n=`${s}${e?"s":""}`;switch(t){case h.GET:return`Get ${n}`;case h.POST:return`Create ${n}`;case h.PATCH:return`Update ${n}`;case h.PUT:return`Update ${n}`;case h.DELETE:return`Delete ${n}`}}class M extends Ct{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:h.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:h.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:h.GET,...s},e)}}class z extends M{constructor(){super(...arguments);p(this,"pageSize",cV)}async add(e){const{addOne:n,updateOne:a,deleteOne:c}=this.actions;let r,d=null,l=null;if("file"in e){const{file:g,...V}=e;d=await this.client.files.getFilePayload(g),l=URL.createObjectURL(g),r={...V,file_sha1:d.sha1,file_type:d.file_type,file_name:g.name,file_extension:d.extension,file_url:l}}else r=e;const u=this.buildModel(r),y=this.buildPayload(u);this.dispatch(n(u));const S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:{...y,...d?{file:d}:{}},blockers:this.getBlockers(u),blocks:this.getBlocks(u)});S.then(({instance:g})=>{this.dispatch(a(g))}).catch(g=>{throw this.dispatch(c(this.getId(u))),g}).finally(()=>{l&&URL.revokeObjectURL(l)});const f=S.then(({instance:g})=>g),F=S.then(async({instance:g,presigned_url:V})=>{try{return V&&await this.client.files.processPresignedUrl(g.file_sha1,V),g.file_sha1}catch(_){throw console.error("Upload to s3 using presigned url failed.",_),_}});return[u,f,F]}async bulkAdd(e,n){const{addMany:a,updateMany:c,deleteMany:r}=this.actions,d=new Date().toISOString(),l=[],u=new Set,y=N(e,Math.min(n??e.length,L)),S=[];for(const V of y){const _=[],v={},b=[],D=[];for(const W of V){let q;if("file"in W){const{file:rr,...Pq}=W,xt=await this.client.files.getFilePayload(rr);xt.sha1 in v||(v[xt.sha1]=xt);const EV=URL.createObjectURL(rr);u.add(EV),q={...Pq,file_sha1:xt.sha1,file_type:xt.file_type,file_name:rr.name,file_extension:xt.extension,file_url:EV}}else q=W;const k=this.buildModel(q);l.push(k);const H=this.buildBulkPayload(k);_.push(H);const Qs=this.getBlockers(k);b.push(...Qs);const wq=this.getBlocks(k);D.push(...wq)}const j={payloads:_,submittedAt:d,files:Object.values(v),blockers:b,blocks:D};S.push(j)}this.dispatch(a(l));const f=S.map(V=>{const{submittedAt:_,files:v,payloads:b,blocks:D,blockers:j}=V;return this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:_,files:v,payloads:b},blockers:j,blocks:D})});Promise.all(f).then(V=>{const _=V.flatMap(v=>v.instances);this.dispatch(c(_))}).catch(V=>{throw this.dispatch(r(l.map(_=>this.getId(_)))),console.error(V),V}).finally(()=>{for(const V of u)URL.revokeObjectURL(V)});const F=Promise.all(f).then(V=>V.flatMap(({instances:_})=>_)),g=Promise.all(f).then(async V=>{const _=[];for(const{presigned_urls:v}of V){const b=this.client.files.processPresignedUrls(v);for(const[D,j]of Object.entries(b))try{await j,_.push(D)}catch(W){throw console.error("Upload to s3 using presigned url failed.",W),W}}return _});return[l,F,g]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Attempting to delete ${this.name} with pk ${e} that does not exist in the store`);this.dispatch(c(this.getId(d)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(a(d)),l}}}class FW extends z{constructor(){super(...arguments);p(this,"name","Asset attachment");p(this,"url","/asset-attachments");p(this,"actions",{addOne:Ur,addMany:ci,setOne:Lr,setMany:Nr,updateOne:Hr,updateMany:Gr,deleteOne:Kr,deleteMany:ri,initialize:Cr});p(this,"selectors",{selectById:Qr,selectByIds:Jr})}getId(e){return e.uuid}getBlockers(e){const{asset:n}=e;return[n]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,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:a}=this.actions,r=(await this.listPaginated({queryParams:{asset__project:e}},n)).flat();return this.dispatch(a(r)),r}}class _W extends z{constructor(){super(...arguments);p(this,"name","Asset Procedure Attachment");p(this,"url","/asset-procedure-type-attachments");p(this,"actions",{addOne:td,addMany:sd,setOne:id,setMany:nd,updateOne:ad,updateMany:cd,deleteOne:rd,deleteMany:dd,initialize:ed});p(this,"selectors",{selectById:od,selectByIds:hd})}getId(e){return e.uuid}getBlockers(e){return[e.asset_procedure_type]}getBlocks(e){return[e.uuid]}buildModel(e){var f;const{store:n}=this.client,{asset_procedure_type:a,file_sha1:c,file_extension:r,file_name:d,file_type:l,file_url:u}=e,y=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,S=new Date().toISOString();return P({file_url:u,file_sha1:c,file_extension:r,file_name:d,file_type:l,created_by:y,submitted_at:S,asset_procedure_type:a})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_procedure_type:e.asset_procedure_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_procedure_type:e.asset_procedure_type}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class gW extends z{constructor(){super(...arguments);p(this,"name","Asset Procedure Type Fields Attachment");p(this,"url","/asset-procedure-type-fields-attachments");p(this,"actions",{addOne:Sd,addMany:md,setOne:fd,setMany:Ad,updateOne:wd,updateMany:Pd,deleteOne:Td,deleteMany:Od,initialize:yd});p(this,"selectors",{selectById:_d,selectByIds:gd})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class RW extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure Type Fields");p(this,"url","/asset-procedure-type-fields");p(this,"actions",{addOne:Md,addMany:vd,setOne:Ed,setMany:Vd,updateOne:kd,updateMany:Bd,deleteOne:Dd,deleteMany:Wd,initialize:bd});p(this,"selectors",{selectById:jd,selectByIds:$d})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,y]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class bW extends z{constructor(){super(...arguments);p(this,"name","Asset Procedure Type Field Values Attachment");p(this,"url","/asset-procedure-type-field-values-attachments");p(this,"actions",{addOne:Ld,addMany:Si,setOne:Nd,setMany:Hd,updateOne:Gd,updateMany:Kd,deleteOne:Yd,deleteMany:mi,initialize:Ud});p(this,"selectors",{selectById:Zd,selectByIds:Xd})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class MW extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure Type Field Values");p(this,"url","/asset-procedure-type-field-values");p(this,"actions",{addOne:sl,addMany:il,setOne:nl,setMany:al,updateOne:cl,updateMany:rl,deleteOne:dl,deleteMany:ll,initialize:tl});p(this,"selectors",{selectById:hl,selectByIds:pl})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),y=P({...e,created_by:l,submitted_at:u}),S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[y.uuid]});return this.dispatch(a(y)),S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}bulkAdd(e,n){var V;const{values:a,payloads:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),y=((V=this.client.store.getState().userReducer.currentUser)==null?void 0:V.id)??null,S=[],f=N(c,Math.min(n??c.length,L)),F=[];for(const _ of f){const v=[];for(const b of _){const D=P({...b,values:b.values,created_by:y,submitted_at:u});S.push(D),v.push({uuid:D.uuid,asset:b.asset,fields_revision:b.fields_revision,asset_procedure:b.asset_procedure,published_at:b.published_at,values:D.values})}F.push({submitted_at:u,values:a,field_values:v})}this.dispatch(r(S));const g=[];for(const _ of F){const{field_values:v}=_,b=v.map(({asset:k})=>k),D=v.map(({fields_revision:k})=>k),j=v.map(({asset_procedure:k})=>k),W=v.map(({uuid:k})=>k),q=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:_,blockers:b.concat(D).concat(j),blocks:W});g.push(q)}return Promise.all(g).then(_=>{this.dispatch(d(_.flat()))}).catch(()=>{this.dispatch(l(E(S)))}),[S,g]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected AssetProcedureTypeFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.fields_revision,l.asset,l.asset_procedure],blocks:[l.uuid]});return u.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=xd(e)(d);this.dispatch(a(e)),this.dispatch(mi(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Si(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class vW extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure");p(this,"url","/asset-procedures");p(this,"actions",{addOne:ml,addMany:Pi,setOne:Pl,setMany:Tl,updateOne:fl,updateMany:Al,deleteOne:wl,deleteMany:Ti,initialize:Sl});p(this,"selectors",{selectById:_l,selectByIds:gl})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset_procedure_type,e.asset_type],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset procedure with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset procedure with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class EW extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure Type");p(this,"url","/asset-procedure-types");p(this,"actions",{addOne:Ml,addMany:vl,setOne:Dl,setMany:Wl,updateOne:El,updateMany:Vl,deleteOne:kl,deleteMany:Bl,initialize:bl});p(this,"selectors",{selectById:jl,selectByIds:$l})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset procedure type with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset procedure type with uuid ${e} to exist`);const u=Fl(e)(d);this.dispatch(a(e)),this.dispatch(Ti(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Pi(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class VW extends z{constructor(){super(...arguments);p(this,"name","Asset Procedure Step Fields Attachment");p(this,"url","/asset-procedure-step-fields-attachments");p(this,"actions",{addOne:Ll,addMany:Nl,setOne:Hl,setMany:Gl,updateOne:Kl,updateMany:Yl,deleteOne:Ql,deleteMany:Jl,initialize:Ul});p(this,"selectors",{selectById:Xl,selectByIds:xl})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,field_identifier:e.field_identifier,fields_revision:e.fields_revision,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension}}buildBulkPayload(e){return{uuid:e.uuid,field_identifier:e.field_identifier,fields_revision:e.fields_revision,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__asset_procedure_step__organization:e}},n);return this.dispatch(a(c)),c}}class kW extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure Step Fields");p(this,"url","/asset-procedure-step-fields");p(this,"actions",{addOne:iu,addMany:nu,setOne:au,setMany:cu,updateOne:ru,updateMany:du,deleteOne:lu,deleteMany:uu,initialize:su});p(this,"selectors",{selectById:ou,selectByIds:hu})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_step],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,c=n.getState().assetProcedureStepFieldsReducer.instances[e.uuid];if(!c)throw new Error(`AssetProcedureStepFields with uuid ${e.uuid} not found`);const r={...c,...e};this.dispatch(a(r));const d=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${c.uuid}/`,payload:e,blockers:[c.uuid],blocks:[c.uuid]});return d.then(l=>{this.dispatch(a(l))}).catch(l=>{throw this.dispatch(a(c)),l}),[r,d]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,r=n.getState().assetProcedureStepFieldsReducer.instances[e];if(!r)throw new Error(`AssetProcedureStepFields with uuid ${e} not found`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(d){throw this.dispatch(c(r)),d}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_step__asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class BW extends z{constructor(){super(...arguments);p(this,"name","Asset Procedure Step Field Values Attachment");p(this,"url","/asset-procedure-step-field-values-attachments");p(this,"actions",{addOne:mu,addMany:Mi,setOne:fu,setMany:Au,updateOne:wu,updateMany:Pu,deleteOne:Tu,deleteMany:vi,initialize:Su});p(this,"selectors",{selectById:Iu,selectByIds:Fu})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class DW extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure Step Field Values");p(this,"url","/asset-procedure-step-field-values");p(this,"actions",{addOne:Mu,addMany:vu,setOne:Eu,setMany:Vu,updateOne:ku,updateMany:Bu,deleteOne:Du,deleteMany:Wu,initialize:bu});p(this,"selectors",{selectById:qu,selectByIds:ju})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),y=P({...e,created_by:l,submitted_at:u}),S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[y.uuid]});return this.dispatch(a(y)),S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}bulkAdd(e,n){var V;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),y=((V=this.client.store.getState().userReducer.currentUser)==null?void 0:V.id)??null,S=[],f=N(a,Math.min(n??a.length,L)),F=[];for(const _ of f){const v=[];for(const b of _){const D=P({...b,values:b.values,created_by:y,submitted_at:u});S.push(D),v.push({uuid:D.uuid,asset:b.asset,fields_revision:b.fields_revision,asset_procedure:b.asset_procedure,asset_procedure_step:b.asset_procedure_step,published_at:b.published_at,values:D.values})}F.push({submitted_at:u,values:c,field_values:v})}this.dispatch(r(S));const g=[];for(const _ of F){const{field_values:v}=_,b=v.map(({asset:k})=>k),D=v.map(({fields_revision:k})=>k),j=v.map(({asset_procedure:k})=>k),W=v.map(({uuid:k})=>k),q=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:_,blockers:b.concat(D).concat(j),blocks:W});g.push(q)}return Promise.all(g).then(_=>{this.dispatch(d(_.flat()))}).catch(()=>{this.dispatch(l(E(S)))}),[S,g]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected AssetProcedureStepFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.fields_revision,l.asset,l.asset_procedure],blocks:[l.uuid]});return u.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=_u(e)(d);this.dispatch(a(e)),this.dispatch(vi(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Mi(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class WW extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure Step");p(this,"url","/asset-procedure-steps");p(this,"actions",{addOne:Hu,addMany:Gu,setOne:Lu,setMany:Nu,updateOne:Ku,updateMany:Yu,deleteOne:Qu,deleteMany:Ju,initialize:Uu});p(this,"selectors",{selectById:Xu,selectByIds:xu})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`No asset procedure step with uuid ${e.uuid} found in the store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${r.uuid}/`,payload:{name:e.name,description:e.description,priority:e.order,color:e.color},blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteMany:a,addMany:c,addOne:r,deleteOne:d}=this.actions,{selectById:l}=this.selectors,u=n.getState(),y=l(e)(u);if(!y)throw new Error(`No asset procedure step with uuid ${e} found in the store`);const S=eo(e)(u);this.dispatch(d(e)),this.dispatch(a(E(S)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(r(y)),this.dispatch(c(S)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class zW extends M{constructor(){super(...arguments);p(this,"url","/assets");p(this,"name","Asset");p(this,"actions",{addOne:io,addMany:Wi,setOne:ro,setMany:lo,updateOne:no,updateMany:ao,deleteOne:co,deleteMany:zi,initialize:so});p(this,"selectors",{selectById:ho,selectByIds:po})}add(e){var S;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_type],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`No asset with uuid ${e.uuid} found in the store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No asset with uuid ${e} found in the store`);const u=Zr(e)(d),y=hf(e)(d);this.dispatch(c(e)),this.dispatch(ri(E(u))),this.dispatch(jt(E(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(S){throw this.dispatch(a(l)),this.dispatch(ci(u)),this.dispatch(qt(y)),S}}bulkAdd(e,n){const{addMany:a}=this.actions,c=new Date().toISOString(),r=Bt.v4(),d=N(e,Math.min(n??e.length,L)).map(y=>{const S=y.map(f=>P(f));return{batchId:Bt.v4(),payload:{transaction_id:r,submitted_at:c,assets:S}}}),l=[];let u=null;for(const y of d){const{batchId:S,payload:f}=y,F=f.assets.map(({uuid:b})=>b),g=f.assets.map(({asset_type:b})=>b),V=f.assets.map(({project:b})=>b),_=f.assets.map(({status:b})=>b),v=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:f,blockers:(u?[u]:[]).concat(g).concat(V).concat(_),blocks:[S].concat(F)});u=y.batchId,l.push(v)}return Promise.all(l).then(y=>{const S=y.flat();this.dispatch(a(S))}),l}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,d=E(e).toSorted(Ts);if(d.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=r(d)(a.getState()).toSorted(si);if(d.length!=l.length)throw new Error(`Attempting to bulk update ${d.length-l.length} assets that dont exist in the store`);const u=[];for(let F=0;F<d.length;F++)u.push({...l[F],...e[F]});this.dispatch(c(u));const y=N(e,Math.min(n??e.length,L)),S=[];let f=null;for(const F of y){const g=Bt.v4(),V=E(F),_=F.map(({status:b})=>b).filter(Boolean),v=this.enqueueRequest({description:w(h.PATCH,this.name,!0),method:h.PATCH,url:`${this.url}/bulk/`,payload:{payloads:F},blockers:(f?[f]:[]).concat(V).concat(_),blocks:[g].concat(V)});S.push(v),f=g}return Promise.all(S).then(F=>{this.dispatch(c(F.flat()))}).catch(()=>{this.dispatch(c(l))}),[u,S]}async bulkDelete(e){const{store:n}=this.client,{addMany:a,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(c(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(a(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class qW extends M{constructor(){super(...arguments);p(this,"name","Asset Stage Completion");p(this,"url","/asset-stage-completions");p(this,"actions",{addOne:fo,addMany:Ao,setOne:wo,setMany:Po,updateOne:To,updateMany:Oo,deleteOne:Io,deleteMany:Fo,initialize:mo});p(this,"selectors",{selectById:bo,selectByIds:Mo})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset,e.asset_stage],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected asset stage completion with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}bulkAdd(e){var F;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=new Date().toISOString(),l=((F=n.getState().userReducer.currentUser)==null?void 0:F.id)??null,u=e.map(g=>P(g)),y=u.map(g=>({...g,created_by:l,submitted_at:d})),S=y.map(({uuid:g})=>g);this.dispatch(a(y));const f=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,completions:u},blockers:[...e.map(g=>g.asset_procedure),...e.map(g=>g.asset_stage),...e.map(g=>g.asset)],blocks:S});return f.then(g=>{this.dispatch(c(g))}).catch(()=>{this.dispatch(r(S))}),[y,f]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset_procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class jW extends M{constructor(){super(...arguments);p(this,"name","Asset Stage");p(this,"url","/asset-stages");p(this,"actions",{addOne:Bo,addMany:Do,setOne:Vo,setMany:ko,updateOne:Wo,updateMany:zo,deleteOne:qo,deleteMany:jo,initialize:Eo});p(this,"selectors",{selectById:Co,selectByIds:Uo})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`No asset stage with uuid ${e.uuid} found in the store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${r.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No asset stage with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class $W extends z{constructor(){super(...arguments);p(this,"name","Asset Type Attachment");p(this,"url","/asset-type-attachments");p(this,"actions",{addOne:Ho,addMany:Li,setOne:Go,setMany:Ko,updateOne:Yo,updateMany:Qo,deleteOne:Jo,deleteMany:Ni,initialize:No});p(this,"selectors",{selectById:Xo,selectByIds:xo})}getId(e){return e.uuid}getBlockers(e){return[e.asset_type]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,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:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class CW extends z{constructor(){super(...arguments);p(this,"name","Asset Type Fields Attachment");p(this,"url","/asset-type-fields-attachments");p(this,"actions",{addOne:nh,addMany:ah,setOne:ch,setMany:rh,updateOne:dh,updateMany:lh,deleteOne:uh,deleteMany:oh,initialize:ih});p(this,"selectors",{selectById:ph,selectByIds:yh})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class UW extends M{constructor(){super(...arguments);p(this,"name","Asset Type Fields");p(this,"url","/asset-type-fields");p(this,"actions",{addOne:Ah,addMany:wh,setOne:Ph,setMany:Th,updateOne:Oh,updateMany:Ih,deleteOne:Fh,deleteMany:_h,initialize:fh});p(this,"selectors",{selectById:Rh,selectByIds:bh})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_type],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,y]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class LW extends z{constructor(){super(...arguments);p(this,"name","Asset Type Field Values Attachment");p(this,"url","/asset-type-field-values-attachments");p(this,"actions",{addOne:Vh,addMany:Ji,setOne:kh,setMany:Bh,updateOne:Dh,updateMany:Wh,deleteOne:zh,deleteMany:Zi,initialize:Eh});p(this,"selectors",{selectById:jh,selectByIds:$h})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class NW extends M{constructor(){super(...arguments);p(this,"name","Asset Type Field Values");p(this,"url","/asset-type-field-values");p(this,"actions",{addOne:Hh,addMany:Gh,setOne:Kh,setMany:Yh,updateOne:Qh,updateMany:Jh,deleteOne:Zh,deleteMany:Xh,initialize:Nh});p(this,"selectors",{selectById:ep,selectByIds:tp})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),y=P({...e,created_by:l,submitted_at:u}),S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.asset,e.fields_revision],blocks:[y.uuid]});return this.dispatch(a(y)),S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}bulkAdd(e,n){var g;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),y=[],S=N(a,Math.min(n??a.length,L)),f=[];for(const V of S){const _=[];for(const v of V){const b=P({...v,values:v.values,created_by:((g=this.client.store.getState().userReducer.currentUser)==null?void 0:g.id)??null,submitted_at:u});y.push(b),_.push({uuid:b.uuid,asset:v.asset,fields_revision:v.fields_revision,published_at:v.published_at,values:b.values})}f.push({submitted_at:u,values:c,field_values:_})}this.dispatch(r(y));const F=[];for(const V of f){const{field_values:_}=V,v=_.map(({asset:W})=>W),b=_.map(({fields_revision:W})=>W),D=_.map(({uuid:W})=>W),j=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:V,blockers:v.concat(b),blocks:D});F.push(j)}return Promise.all(F).then(V=>{this.dispatch(d(V.flat()))}).catch(()=>{this.dispatch(l(E(y)))}),[y,F]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected AssetTypeFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.asset],blocks:[l.uuid]});return u.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=Ch(e)(d);this.dispatch(a(e)),this.dispatch(Zi(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Ji(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class HW extends M{constructor(){super(...arguments);p(this,"name","Asset Type Identifier");p(this,"url","/asset-type-identifiers");p(this,"actions",{addOne:ap,addMany:cp,setOne:rp,setMany:dp,updateOne:lp,updateMany:up,deleteOne:op,deleteMany:hp,initialize:np});p(this,"selectors",{selectById:yp,selectByIds:Sp})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_type],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset type identifier with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class GW extends M{constructor(){super(...arguments);p(this,"name","Asset Type Identifier Value");p(this,"url","/asset-type-identifier-values");p(this,"actions",{addOne:wp,addMany:Pp,setOne:Tp,setMany:Op,updateOne:Ip,updateMany:Fp,deleteOne:_p,deleteMany:gp,initialize:Ap});p(this,"selectors",{selectById:bp,selectByIds:Mp})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset,e.asset_type_identifier],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}bulkAdd(e,n){var V;const{store:a}=this.client,{addMany:c,updateMany:r,deleteMany:d}=this.actions,l=new Date().toISOString(),u=((V=a.getState().userReducer.currentUser)==null?void 0:V.id)??null,y=N(e,Math.min(n??e.length,L)),S=[],f=[];for(const _ of y){const v=[],b=[],D=[];for(const W of _){const q=P({...W,submitted_at:l,created_by:u});f.push(q);const k={uuid:q.uuid,asset:q.asset,asset_type_identifier:q.asset_type_identifier,value:q.value};v.push(k),b.push(q.asset),b.push(q.asset_type_identifier),D.push(q.uuid)}const j={payloads:v,submitted_at:l,blockers:b,blocks:D};S.push(j)}this.dispatch(c(f));const F=S.map(_=>{const{payloads:v,submitted_at:b,blockers:D,blocks:j}=_;return this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:b,payloads:v},blockers:D,blocks:j})});Promise.all(F).then(_=>{this.dispatch(r(_.flat()))}).catch(_=>{throw this.dispatch(d(E(f))),_});const g=Promise.all(F).then(_=>_.flat());return[f,g]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class KW extends M{constructor(){super(...arguments);p(this,"name","Asset Type");p(this,"url","/asset-types");p(this,"actions",{addOne:Dp,addMany:Wp,setOne:kp,setMany:Bp,updateOne:zp,updateMany:qp,deleteOne:jp,deleteMany:$p,initialize:Vp});p(this,"selectors",{selectById:Up,selectByIds:Lp})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset type with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset type with uuid ${e} to exist`);const u=oo(e)(d),y=eh(e)(d);this.dispatch(a(e)),this.dispatch(zi(E(u))),this.dispatch(Ni(E(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(S){throw this.dispatch(c(l)),this.dispatch(Wi(u)),this.dispatch(Li(y)),S}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class YW extends M{constructor(){super(...arguments);p(this,"name","Asset Type Status");p(this,"url","/asset-type-statuses");p(this,"actions",{addOne:Kp,addMany:Yp,setOne:Qp,setMany:Jp,updateOne:Zp,updateMany:Xp,deleteOne:xp,deleteMany:ey,initialize:Gp});p(this,"selectors",{selectById:sy,selectByIds:iy})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset_type],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}update(e){const{setOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),r=a(e.uuid)(c);if(!r)throw new Error(`Expected an existing asset type status with uuid ${e.uuid}`);const d={...r,...e};this.dispatch(n(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(n(u))}).catch(()=>{this.dispatch(n(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`No asset type status with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class QW extends z{constructor(){super(...arguments);p(this,"name","Document Attachment");p(this,"url","/document-attachments");p(this,"actions",{addOne:uy,addMany:oy,setOne:hy,setMany:py,updateOne:yy,updateMany:Sy,deleteOne:my,deleteMany:fy,initialize:ly});p(this,"selectors",{selectById:wy,selectByIds:Py})}getId(e){return e.uuid}getBlockers(e){return[e.document]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,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[a,c,r]=await super.bulkAdd(e,n),d={};for(const{file_sha1:l,uuid:u}of a)l in d||(d[l]=[]),d[l].push(u);return r.then(l=>{const u=l.flatMap(y=>d[y]??[]);for(const y of u)this.makeReadable(y)}),[a,c,r]}makeReadable(e){this.enqueueRequest({description:"Add attachment to AI assistant",method:h.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:a}=this.actions,c=this.list({queryParams:{document__project__organization:e}},n),r=this.list({queryParams:{document__organization:e}},n),l=(await Promise.all([c,r])).flat();return this.dispatch(a(l)),l}}class JW extends M{constructor(){super(...arguments);p(this,"name","Document");p(this,"url","/documents");p(this,"actions",{addOne:Fy,addMany:_y,setOne:gy,setMany:Ry,updateOne:by,updateMany:My,deleteOne:vy,deleteMany:Ey,initialize:Iy});p(this,"selectors",{selectById:ky,selectByIds:By})}add(e){var S;const{store:n}=this.client,{addOne:a,deleteOne:c,updateOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:u.parent_document?[u.parent_document]:[],blocks:[u.uuid]});return y.then(f=>{this.dispatch(r(f))}).catch(()=>{this.dispatch(c(u.uuid))}),[u,y]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`attempting to update a document with uuid ${e.uuid} that does not exist in store.documents`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c,addMany:r,deleteMany:d}=this.actions,{selectById:l}=this.selectors,u=n.getState(),y=l(e)(u);if(!y)throw new Error(`attempting to delete a document with uuid ${e} that does not exist in store.documents`);const S=Dy(e)(u);this.dispatch(a(e)),this.dispatch(d(E(S)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(c(y)),this.dispatch(r(S)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,c=this.list({queryParams:{project__organization:e}},n),r=this.list({queryParams:{organization:e}},n),l=(await Promise.all([c,r])).flat();return this.dispatch(a(l)),l}}class zt extends Ct{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:h.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:h.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:h.GET,...s},e)}}class ZW extends zt{constructor(){super(...arguments);p(this,"name","Email Domains");p(this,"url","/organization-email-domains");p(this,"actions",{addOne:qy,addMany:jy,setOne:$y,setMany:Cy,updateOne:Uy,updateMany:Ly,deleteOne:Ny,deleteMany:Hy,initialize:zy});p(this,"selectors",{selectById:Ky,selectByIds:Yy})}async add(e,n){return this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:{email:n,organization:e},blockers:[e,"create-org"],blocks:[]})}async delete(e){const{deleteOne:n,addOne:a}=this.actions;this.dispatch(n(e.uuid));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e.uuid}/`,blockers:[e.domain],blocks:[]})}catch(c){throw this.dispatch(a(e)),c}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class XW extends Ct{async getVerificationCode(s){return this.enqueueRequest({description:"Get verification code",method:h.GET,url:`/verification/email-verification/${s}/`,isAuthNeeded:!1,blockers:[],blocks:[]})}validateVerificationCode(s,e=void 0){return this.enqueueRequest({description:"Validate verification code",method:h.POST,url:`/verification/email-verification/${s}/`,isAuthNeeded:!1,payload:e,blockers:[],blocks:[]})}}const ws={},ir=new Set;class xW extends Ct{constructor(){super(...arguments);p(this,"host");p(this,"dbPromise",zV.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 Ps(e);if(ir.has(n))return;const a=await this.getDB();!!await a.get("files",n)?console.warn(`Attempting to add a file already cached, ${e.name}`):await a.put("files",e,n),ir.add(n)}async removeCache(e){await(await this.getDB()).delete("files",e),ir.delete(e)}async fetchCache(e){return(await this.getDB()).get("files",e)}async fetchFileFromUrl(e,n,a=n){const c=e.split("?")[0]??e,r=await this.fetchCache(n);if(r)return r;let d;c in ws?d=ws[c]:Ir(e)?(d=Or(e,a),ws[c]=d):(d=new Promise(y=>{this.performRequest({method:h.GET,url:e,isExternalUrl:!0,isResponseBlob:!0,isAuthNeeded:!1}).then(S=>{const f=new File([S],a,{type:S.type});y(f)})}),ws[c]=d);let l;try{l=await d}catch(y){throw y instanceof C&&delete ws[c],y}const u=await Ps(l);if(u!==n){const y=`The hash of the file returned from the server (${u}) does not match the
|
|
7
|
+
`)}catch(a){console.error("Failed to extract error message from response body",a)}}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>qW?Zt:e}class C extends Error{constructor(e){super(Zt);p(this,"status");p(this,"response");p(this,"message");p(this,"options");const{response:n,innerError:a}=e;this.message=e.message??jW(n,a)??Zt,this.status=(n==null?void 0:n.status)??0,this.response=n,e.discard=e.discard??!1,this.options=e}}function DV(t){function s(e){return typeof e=="object"&&e!==null&&["ok","redirect","clientError","serverError","error"].every(a=>a 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 $W extends _V{constructor(s){super(s)}}class Ut extends _V{constructor(e,n){super(e);p(this,"auth");this.auth=n}}class CW extends Ut{async startConversation(s,e){return this.enqueueRequest({description:"Start agent conversation",method:h.POST,url:"/agents/prompt/",payload:{prompt:s,active_project:e},blockers:["prompt"],blocks:["prompt"]}).then(n=>(this.dispatch(jr(n)),n))}async continueConversation(s,e,n){return this.enqueueRequest({description:"Prompt agent",method:h.POST,url:"/agents/prompt/",payload:{prompt:s,active_project:n},blockers:["prompt"],blocks:["prompt"],queryParams:{conversation_id:e}}).then(a=>{this.dispatch(Cr(a))})}async fetchDetails(s){return this.enqueueRequest({description:"Get agent conversation",method:h.GET,url:`/agents/conversations/${s}/`,blockers:["conversation"],blocks:["conversation"]}).then(e=>{this.dispatch($r(e))})}async rate(s,e){return this.enqueueRequest({description:"Rate agent response",method:h.PUT,url:`/agents/responses/${s}/rate/`,payload:{rating:e},blockers:["rate"],blocks:["rate"]})}async list(s,e){return this.performRequest({method:h.GET,url:"/agents/conversations/",...s},e)}async refreshStore(s,e){const n=await this.list({queryParams:{project:s}},e);return this.dispatch(qr(n)),n}}function N(t,s){const e=[];let n=0;const a=t.length;for(;n<a;)e.push(t.slice(n,n+=s));return e}function w(t,s,e){const n=`${s}${e?"s":""}`;switch(t){case h.GET:return`Get ${n}`;case h.POST:return`Create ${n}`;case h.PATCH:return`Update ${n}`;case h.PUT:return`Update ${n}`;case h.DELETE:return`Delete ${n}`}}class M extends Ut{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:h.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:h.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:h.GET,...s},e)}}class z extends M{constructor(){super(...arguments);p(this,"pageSize",IV)}async add(e){const{addOne:n,updateOne:a,deleteOne:c}=this.actions;let r,d=null,l=null;if("file"in e){const{file:g,...V}=e;d=await this.client.files.getFilePayload(g),l=URL.createObjectURL(g),r={...V,file_sha1:d.sha1,file_type:d.file_type,file_name:g.name,file_extension:d.extension,file_url:l}}else r=e;const u=this.buildModel(r),y=this.buildPayload(u);this.dispatch(n(u));const S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:{...y,...d?{file:d}:{}},blockers:this.getBlockers(u),blocks:this.getBlocks(u)});S.then(({instance:g})=>{this.dispatch(a(g))}).catch(g=>{throw this.dispatch(c(this.getId(u))),g}).finally(()=>{l&&URL.revokeObjectURL(l)});const f=S.then(({instance:g})=>g),F=S.then(async({instance:g,presigned_url:V})=>{try{return V&&await this.client.files.processPresignedUrl(g.file_sha1,V),g.file_sha1}catch(_){throw console.error("Upload to s3 using presigned url failed.",_),_}});return[u,f,F]}async bulkAdd(e,n){const{addMany:a,updateMany:c,deleteMany:r}=this.actions,d=new Date().toISOString(),l=[],u=new Set,y=N(e,Math.min(n??e.length,L)),S=[];for(const V of y){const _=[],v={},b=[],D=[];for(const W of V){let q;if("file"in W){const{file:ur,...jq}=W,es=await this.client.files.getFilePayload(ur);es.sha1 in v||(v[es.sha1]=es);const YV=URL.createObjectURL(ur);u.add(YV),q={...jq,file_sha1:es.sha1,file_type:es.file_type,file_name:ur.name,file_extension:es.extension,file_url:YV}}else q=W;const k=this.buildModel(q);l.push(k);const H=this.buildBulkPayload(k);_.push(H);const Js=this.getBlockers(k);b.push(...Js);const qq=this.getBlocks(k);D.push(...qq)}const j={payloads:_,submittedAt:d,files:Object.values(v),blockers:b,blocks:D};S.push(j)}this.dispatch(a(l));const f=S.map(V=>{const{submittedAt:_,files:v,payloads:b,blocks:D,blockers:j}=V;return this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:_,files:v,payloads:b},blockers:j,blocks:D})});Promise.all(f).then(V=>{const _=V.flatMap(v=>v.instances);this.dispatch(c(_))}).catch(V=>{throw this.dispatch(r(l.map(_=>this.getId(_)))),console.error(V),V}).finally(()=>{for(const V of u)URL.revokeObjectURL(V)});const F=Promise.all(f).then(V=>V.flatMap(({instances:_})=>_)),g=Promise.all(f).then(async V=>{const _=[];for(const{presigned_urls:v}of V){const b=this.client.files.processPresignedUrls(v);for(const[D,j]of Object.entries(b))try{await j,_.push(D)}catch(W){throw console.error("Upload to s3 using presigned url failed.",W),W}}return _});return[l,F,g]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Attempting to delete ${this.name} with pk ${e} that does not exist in the store`);this.dispatch(c(this.getId(d)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(a(d)),l}}}class UW extends z{constructor(){super(...arguments);p(this,"name","Asset attachment");p(this,"url","/asset-attachments");p(this,"actions",{addOne:Hr,addMany:ri,setOne:Gr,setMany:Kr,updateOne:Yr,updateMany:Qr,deleteOne:Jr,deleteMany:di,initialize:Nr});p(this,"selectors",{selectById:Xr,selectByIds:xr})}getId(e){return e.uuid}getBlockers(e){const{asset:n}=e;return[n]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,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:a}=this.actions,r=(await this.listPaginated({queryParams:{asset__project:e}},n)).flat();return this.dispatch(a(r)),r}}class LW extends z{constructor(){super(...arguments);p(this,"name","Asset Procedure Attachment");p(this,"url","/asset-procedure-type-attachments");p(this,"actions",{addOne:nd,addMany:ad,setOne:cd,setMany:rd,updateOne:dd,updateMany:ld,deleteOne:ud,deleteMany:od,initialize:id});p(this,"selectors",{selectById:yd,selectByIds:Sd})}getId(e){return e.uuid}getBlockers(e){return[e.asset_procedure_type]}getBlocks(e){return[e.uuid]}buildModel(e){var f;const{store:n}=this.client,{asset_procedure_type:a,file_sha1:c,file_extension:r,file_name:d,file_type:l,file_url:u}=e,y=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,S=new Date().toISOString();return P({file_url:u,file_sha1:c,file_extension:r,file_name:d,file_type:l,created_by:y,submitted_at:S,asset_procedure_type:a})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_procedure_type:e.asset_procedure_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_procedure_type:e.asset_procedure_type}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class NW extends z{constructor(){super(...arguments);p(this,"name","Asset Procedure Type Fields Attachment");p(this,"url","/asset-procedure-type-fields-attachments");p(this,"actions",{addOne:Ad,addMany:wd,setOne:Pd,setMany:Td,updateOne:Od,updateMany:Id,deleteOne:Fd,deleteMany:_d,initialize:fd});p(this,"selectors",{selectById:bd,selectByIds:Md})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class HW extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure Type Fields");p(this,"url","/asset-procedure-type-fields");p(this,"actions",{addOne:Vd,addMany:kd,setOne:Bd,setMany:Dd,updateOne:Wd,updateMany:zd,deleteOne:qd,deleteMany:jd,initialize:Ed});p(this,"selectors",{selectById:Ud,selectByIds:Ld})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,y]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class GW extends z{constructor(){super(...arguments);p(this,"name","Asset Procedure Type Field Values Attachment");p(this,"url","/asset-procedure-type-field-values-attachments");p(this,"actions",{addOne:Gd,addMany:mi,setOne:Kd,setMany:Yd,updateOne:Qd,updateMany:Jd,deleteOne:Zd,deleteMany:fi,initialize:Hd});p(this,"selectors",{selectById:el,selectByIds:tl})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class KW extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure Type Field Values");p(this,"url","/asset-procedure-type-field-values");p(this,"actions",{addOne:al,addMany:cl,setOne:rl,setMany:dl,updateOne:ll,updateMany:ul,deleteOne:ol,deleteMany:hl,initialize:nl});p(this,"selectors",{selectById:Sl,selectByIds:ml})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),y=P({...e,created_by:l,submitted_at:u}),S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[y.uuid]});return this.dispatch(a(y)),S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}bulkAdd(e,n){var V;const{values:a,payloads:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),y=((V=this.client.store.getState().userReducer.currentUser)==null?void 0:V.id)??null,S=[],f=N(c,Math.min(n??c.length,L)),F=[];for(const _ of f){const v=[];for(const b of _){const D=P({...b,values:b.values,created_by:y,submitted_at:u});S.push(D),v.push({uuid:D.uuid,asset:b.asset,fields_revision:b.fields_revision,asset_procedure:b.asset_procedure,published_at:b.published_at,values:D.values})}F.push({submitted_at:u,values:a,field_values:v})}this.dispatch(r(S));const g=[];for(const _ of F){const{field_values:v}=_,b=v.map(({asset:k})=>k),D=v.map(({fields_revision:k})=>k),j=v.map(({asset_procedure:k})=>k),W=v.map(({uuid:k})=>k),q=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:_,blockers:b.concat(D).concat(j),blocks:W});g.push(q)}return Promise.all(g).then(_=>{this.dispatch(d(_.flat()))}).catch(()=>{this.dispatch(l(E(S)))}),[S,g]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected AssetProcedureTypeFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.fields_revision,l.asset,l.asset_procedure],blocks:[l.uuid]});return u.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=sl(e)(d);this.dispatch(a(e)),this.dispatch(fi(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(mi(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class YW extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure");p(this,"url","/asset-procedures");p(this,"actions",{addOne:wl,addMany:Ti,setOne:Il,setMany:Fl,updateOne:Pl,updateMany:Tl,deleteOne:Ol,deleteMany:Oi,initialize:Al});p(this,"selectors",{selectById:bl,selectByIds:Ml})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset_procedure_type,e.asset_type],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset procedure with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset procedure with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class QW extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure Type");p(this,"url","/asset-procedure-types");p(this,"actions",{addOne:Vl,addMany:kl,setOne:ql,setMany:jl,updateOne:Bl,updateMany:Dl,deleteOne:Wl,deleteMany:zl,initialize:El});p(this,"selectors",{selectById:Ul,selectByIds:Ll})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset procedure type with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset procedure type with uuid ${e} to exist`);const u=Rl(e)(d);this.dispatch(a(e)),this.dispatch(Oi(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Ti(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class JW extends z{constructor(){super(...arguments);p(this,"name","Asset Procedure Step Fields Attachment");p(this,"url","/asset-procedure-step-fields-attachments");p(this,"actions",{addOne:Gl,addMany:Kl,setOne:Yl,setMany:Ql,updateOne:Jl,updateMany:Zl,deleteOne:Xl,deleteMany:xl,initialize:Hl});p(this,"selectors",{selectById:tu,selectByIds:su})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,field_identifier:e.field_identifier,fields_revision:e.fields_revision,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension}}buildBulkPayload(e){return{uuid:e.uuid,field_identifier:e.field_identifier,fields_revision:e.fields_revision,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__asset_procedure_step__organization:e}},n);return this.dispatch(a(c)),c}}class ZW extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure Step Fields");p(this,"url","/asset-procedure-step-fields");p(this,"actions",{addOne:cu,addMany:ru,setOne:du,setMany:lu,updateOne:uu,updateMany:ou,deleteOne:hu,deleteMany:pu,initialize:au});p(this,"selectors",{selectById:yu,selectByIds:Su})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_step],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,c=n.getState().assetProcedureStepFieldsReducer.instances[e.uuid];if(!c)throw new Error(`AssetProcedureStepFields with uuid ${e.uuid} not found`);const r={...c,...e};this.dispatch(a(r));const d=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${c.uuid}/`,payload:e,blockers:[c.uuid],blocks:[c.uuid]});return d.then(l=>{this.dispatch(a(l))}).catch(l=>{throw this.dispatch(a(c)),l}),[r,d]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,r=n.getState().assetProcedureStepFieldsReducer.instances[e];if(!r)throw new Error(`AssetProcedureStepFields with uuid ${e} not found`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(d){throw this.dispatch(c(r)),d}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_step__asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class XW extends z{constructor(){super(...arguments);p(this,"name","Asset Procedure Step Field Values Attachment");p(this,"url","/asset-procedure-step-field-values-attachments");p(this,"actions",{addOne:wu,addMany:vi,setOne:Pu,setMany:Tu,updateOne:Ou,updateMany:Iu,deleteOne:Fu,deleteMany:Ei,initialize:Au});p(this,"selectors",{selectById:gu,selectByIds:Ru})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class xW extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure Step Field Values");p(this,"url","/asset-procedure-step-field-values");p(this,"actions",{addOne:Vu,addMany:ku,setOne:Bu,setMany:Du,updateOne:Wu,updateMany:zu,deleteOne:qu,deleteMany:ju,initialize:Eu});p(this,"selectors",{selectById:Cu,selectByIds:Uu})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),y=P({...e,created_by:l,submitted_at:u}),S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[y.uuid]});return this.dispatch(a(y)),S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}bulkAdd(e,n){var V;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),y=((V=this.client.store.getState().userReducer.currentUser)==null?void 0:V.id)??null,S=[],f=N(a,Math.min(n??a.length,L)),F=[];for(const _ of f){const v=[];for(const b of _){const D=P({...b,values:b.values,created_by:y,submitted_at:u});S.push(D),v.push({uuid:D.uuid,asset:b.asset,fields_revision:b.fields_revision,asset_procedure:b.asset_procedure,asset_procedure_step:b.asset_procedure_step,published_at:b.published_at,values:D.values})}F.push({submitted_at:u,values:c,field_values:v})}this.dispatch(r(S));const g=[];for(const _ of F){const{field_values:v}=_,b=v.map(({asset:k})=>k),D=v.map(({fields_revision:k})=>k),j=v.map(({asset_procedure:k})=>k),W=v.map(({uuid:k})=>k),q=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:_,blockers:b.concat(D).concat(j),blocks:W});g.push(q)}return Promise.all(g).then(_=>{this.dispatch(d(_.flat()))}).catch(()=>{this.dispatch(l(E(S)))}),[S,g]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected AssetProcedureStepFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.fields_revision,l.asset,l.asset_procedure],blocks:[l.uuid]});return u.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=bu(e)(d);this.dispatch(a(e)),this.dispatch(Ei(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(vi(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class ez extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure Step");p(this,"url","/asset-procedure-steps");p(this,"actions",{addOne:Yu,addMany:Qu,setOne:Gu,setMany:Ku,updateOne:Ju,updateMany:Zu,deleteOne:Xu,deleteMany:xu,initialize:Hu});p(this,"selectors",{selectById:to,selectByIds:so})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`No asset procedure step with uuid ${e.uuid} found in the store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${r.uuid}/`,payload:{name:e.name,description:e.description,priority:e.order,color:e.color},blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteMany:a,addMany:c,addOne:r,deleteOne:d}=this.actions,{selectById:l}=this.selectors,u=n.getState(),y=l(e)(u);if(!y)throw new Error(`No asset procedure step with uuid ${e} found in the store`);const S=io(e)(u);this.dispatch(d(e)),this.dispatch(a(E(S)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(r(y)),this.dispatch(c(S)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class tz extends M{constructor(){super(...arguments);p(this,"url","/assets");p(this,"name","Asset");p(this,"actions",{addOne:co,addMany:zi,setOne:oo,setMany:ho,updateOne:ro,updateMany:lo,deleteOne:uo,deleteMany:qi,initialize:ao});p(this,"selectors",{selectById:So,selectByIds:mo})}add(e){var S;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_type],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`No asset with uuid ${e.uuid} found in the store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No asset with uuid ${e} found in the store`);const u=ed(e)(d),y=Sf(e)(d);this.dispatch(c(e)),this.dispatch(di(E(u))),this.dispatch($t(E(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(S){throw this.dispatch(a(l)),this.dispatch(ri(u)),this.dispatch(jt(y)),S}}bulkAdd(e,n){const{addMany:a}=this.actions,c=new Date().toISOString(),r=Dt.v4(),d=N(e,Math.min(n??e.length,L)).map(y=>{const S=y.map(f=>P(f));return{batchId:Dt.v4(),payload:{transaction_id:r,submitted_at:c,assets:S}}}),l=[];let u=null;for(const y of d){const{batchId:S,payload:f}=y,F=f.assets.map(({uuid:b})=>b),g=f.assets.map(({asset_type:b})=>b),V=f.assets.map(({project:b})=>b),_=f.assets.map(({status:b})=>b),v=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:f,blockers:(u?[u]:[]).concat(g).concat(V).concat(_),blocks:[S].concat(F)});u=y.batchId,l.push(v)}return Promise.all(l).then(y=>{const S=y.flat();this.dispatch(a(S))}),l}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,d=E(e).toSorted(Os);if(d.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=r(d)(a.getState()).toSorted(ii);if(d.length!=l.length)throw new Error(`Attempting to bulk update ${d.length-l.length} assets that dont exist in the store`);const u=[];for(let F=0;F<d.length;F++)u.push({...l[F],...e[F]});this.dispatch(c(u));const y=N(e,Math.min(n??e.length,L)),S=[];let f=null;for(const F of y){const g=Dt.v4(),V=E(F),_=F.map(({status:b})=>b).filter(Boolean),v=this.enqueueRequest({description:w(h.PATCH,this.name,!0),method:h.PATCH,url:`${this.url}/bulk/`,payload:{payloads:F},blockers:(f?[f]:[]).concat(V).concat(_),blocks:[g].concat(V)});S.push(v),f=g}return Promise.all(S).then(F=>{this.dispatch(c(F.flat()))}).catch(()=>{this.dispatch(c(l))}),[u,S]}async bulkDelete(e){const{store:n}=this.client,{addMany:a,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(c(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(a(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class sz extends M{constructor(){super(...arguments);p(this,"name","Asset Stage Completion");p(this,"url","/asset-stage-completions");p(this,"actions",{addOne:Po,addMany:To,setOne:Oo,setMany:Io,updateOne:Fo,updateMany:_o,deleteOne:go,deleteMany:Ro,initialize:wo});p(this,"selectors",{selectById:Eo,selectByIds:Vo})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset,e.asset_stage],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected asset stage completion with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}bulkAdd(e){var F;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=new Date().toISOString(),l=((F=n.getState().userReducer.currentUser)==null?void 0:F.id)??null,u=e.map(g=>P(g)),y=u.map(g=>({...g,created_by:l,submitted_at:d})),S=y.map(({uuid:g})=>g);this.dispatch(a(y));const f=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,completions:u},blockers:[...e.map(g=>g.asset_procedure),...e.map(g=>g.asset_stage),...e.map(g=>g.asset)],blocks:S});return f.then(g=>{this.dispatch(c(g))}).catch(()=>{this.dispatch(r(S))}),[y,f]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset_procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class iz extends M{constructor(){super(...arguments);p(this,"name","Asset Stage");p(this,"url","/asset-stages");p(this,"actions",{addOne:zo,addMany:qo,setOne:Do,setMany:Wo,updateOne:jo,updateMany:$o,deleteOne:Co,deleteMany:Uo,initialize:Bo});p(this,"selectors",{selectById:No,selectByIds:Ho})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`No asset stage with uuid ${e.uuid} found in the store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${r.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No asset stage with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class nz extends z{constructor(){super(...arguments);p(this,"name","Asset Type Attachment");p(this,"url","/asset-type-attachments");p(this,"actions",{addOne:Yo,addMany:Ni,setOne:Qo,setMany:Jo,updateOne:Zo,updateMany:Xo,deleteOne:xo,deleteMany:Hi,initialize:Ko});p(this,"selectors",{selectById:th,selectByIds:sh})}getId(e){return e.uuid}getBlockers(e){return[e.asset_type]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,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:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class az extends z{constructor(){super(...arguments);p(this,"name","Asset Type Fields Attachment");p(this,"url","/asset-type-fields-attachments");p(this,"actions",{addOne:rh,addMany:dh,setOne:lh,setMany:uh,updateOne:oh,updateMany:hh,deleteOne:ph,deleteMany:yh,initialize:ch});p(this,"selectors",{selectById:mh,selectByIds:fh})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class cz extends M{constructor(){super(...arguments);p(this,"name","Asset Type Fields");p(this,"url","/asset-type-fields");p(this,"actions",{addOne:Th,addMany:Oh,setOne:Ih,setMany:Fh,updateOne:_h,updateMany:gh,deleteOne:Rh,deleteMany:bh,initialize:Ph});p(this,"selectors",{selectById:vh,selectByIds:Eh})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_type],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,y]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class rz extends z{constructor(){super(...arguments);p(this,"name","Asset Type Field Values Attachment");p(this,"url","/asset-type-field-values-attachments");p(this,"actions",{addOne:Dh,addMany:Zi,setOne:Wh,setMany:zh,updateOne:qh,updateMany:jh,deleteOne:$h,deleteMany:Xi,initialize:Bh});p(this,"selectors",{selectById:Uh,selectByIds:Lh})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class dz extends M{constructor(){super(...arguments);p(this,"name","Asset Type Field Values");p(this,"url","/asset-type-field-values");p(this,"actions",{addOne:Yh,addMany:Qh,setOne:Jh,setMany:Zh,updateOne:Xh,updateMany:xh,deleteOne:ep,deleteMany:tp,initialize:Kh});p(this,"selectors",{selectById:ip,selectByIds:np})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),y=P({...e,created_by:l,submitted_at:u}),S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.asset,e.fields_revision],blocks:[y.uuid]});return this.dispatch(a(y)),S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}bulkAdd(e,n){var g;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),y=[],S=N(a,Math.min(n??a.length,L)),f=[];for(const V of S){const _=[];for(const v of V){const b=P({...v,values:v.values,created_by:((g=this.client.store.getState().userReducer.currentUser)==null?void 0:g.id)??null,submitted_at:u});y.push(b),_.push({uuid:b.uuid,asset:v.asset,fields_revision:v.fields_revision,published_at:v.published_at,values:b.values})}f.push({submitted_at:u,values:c,field_values:_})}this.dispatch(r(y));const F=[];for(const V of f){const{field_values:_}=V,v=_.map(({asset:W})=>W),b=_.map(({fields_revision:W})=>W),D=_.map(({uuid:W})=>W),j=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:V,blockers:v.concat(b),blocks:D});F.push(j)}return Promise.all(F).then(V=>{this.dispatch(d(V.flat()))}).catch(()=>{this.dispatch(l(E(y)))}),[y,F]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected AssetTypeFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.asset],blocks:[l.uuid]});return u.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=Nh(e)(d);this.dispatch(a(e)),this.dispatch(Xi(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Zi(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class lz extends M{constructor(){super(...arguments);p(this,"name","Asset Type Identifier");p(this,"url","/asset-type-identifiers");p(this,"actions",{addOne:dp,addMany:lp,setOne:up,setMany:op,updateOne:hp,updateMany:pp,deleteOne:yp,deleteMany:Sp,initialize:rp});p(this,"selectors",{selectById:fp,selectByIds:Ap})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_type],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset type identifier with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class uz extends M{constructor(){super(...arguments);p(this,"name","Asset Type Identifier Value");p(this,"url","/asset-type-identifier-values");p(this,"actions",{addOne:Op,addMany:Ip,setOne:Fp,setMany:_p,updateOne:gp,updateMany:Rp,deleteOne:bp,deleteMany:Mp,initialize:Tp});p(this,"selectors",{selectById:Ep,selectByIds:Vp})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset,e.asset_type_identifier],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}bulkAdd(e,n){var V;const{store:a}=this.client,{addMany:c,updateMany:r,deleteMany:d}=this.actions,l=new Date().toISOString(),u=((V=a.getState().userReducer.currentUser)==null?void 0:V.id)??null,y=N(e,Math.min(n??e.length,L)),S=[],f=[];for(const _ of y){const v=[],b=[],D=[];for(const W of _){const q=P({...W,submitted_at:l,created_by:u});f.push(q);const k={uuid:q.uuid,asset:q.asset,asset_type_identifier:q.asset_type_identifier,value:q.value};v.push(k),b.push(q.asset),b.push(q.asset_type_identifier),D.push(q.uuid)}const j={payloads:v,submitted_at:l,blockers:b,blocks:D};S.push(j)}this.dispatch(c(f));const F=S.map(_=>{const{payloads:v,submitted_at:b,blockers:D,blocks:j}=_;return this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:b,payloads:v},blockers:D,blocks:j})});Promise.all(F).then(_=>{this.dispatch(r(_.flat()))}).catch(_=>{throw this.dispatch(d(E(f))),_});const g=Promise.all(F).then(_=>_.flat());return[f,g]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class oz extends M{constructor(){super(...arguments);p(this,"name","Asset Type");p(this,"url","/asset-types");p(this,"actions",{addOne:qp,addMany:jp,setOne:Wp,setMany:zp,updateOne:$p,updateMany:Cp,deleteOne:Up,deleteMany:Lp,initialize:Dp});p(this,"selectors",{selectById:Hp,selectByIds:Gp})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset type with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset type with uuid ${e} to exist`);const u=yo(e)(d),y=ih(e)(d);this.dispatch(a(e)),this.dispatch(qi(E(u))),this.dispatch(Hi(E(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(S){throw this.dispatch(c(l)),this.dispatch(zi(u)),this.dispatch(Ni(y)),S}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class hz extends M{constructor(){super(...arguments);p(this,"name","Asset Type Status");p(this,"url","/asset-type-statuses");p(this,"actions",{addOne:Jp,addMany:Zp,setOne:Xp,setMany:xp,updateOne:ey,updateMany:ty,deleteOne:sy,deleteMany:iy,initialize:Qp});p(this,"selectors",{selectById:ay,selectByIds:cy})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset_type],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}update(e){const{setOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),r=a(e.uuid)(c);if(!r)throw new Error(`Expected an existing asset type status with uuid ${e.uuid}`);const d={...r,...e};this.dispatch(n(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(n(u))}).catch(()=>{this.dispatch(n(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`No asset type status with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class pz extends z{constructor(){super(...arguments);p(this,"name","Document Attachment");p(this,"url","/document-attachments");p(this,"actions",{addOne:py,addMany:yy,setOne:Sy,setMany:my,updateOne:fy,updateMany:Ay,deleteOne:wy,deleteMany:Py,initialize:hy});p(this,"selectors",{selectById:Oy,selectByIds:Iy})}getId(e){return e.uuid}getBlockers(e){return[e.document]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,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[a,c,r]=await super.bulkAdd(e,n),d={};for(const{file_sha1:l,uuid:u}of a)l in d||(d[l]=[]),d[l].push(u);return r.then(l=>{const u=l.flatMap(y=>d[y]??[]);for(const y of u)this.makeReadable(y)}),[a,c,r]}makeReadable(e){this.enqueueRequest({description:"Add attachment to AI assistant",method:h.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:a}=this.actions,c=this.list({queryParams:{document__project__organization:e}},n),r=this.list({queryParams:{document__organization:e}},n),l=(await Promise.all([c,r])).flat();return this.dispatch(a(l)),l}}class yz extends M{constructor(){super(...arguments);p(this,"name","Document");p(this,"url","/documents");p(this,"actions",{addOne:Ry,addMany:by,setOne:My,setMany:vy,updateOne:Ey,updateMany:Vy,deleteOne:ky,deleteMany:By,initialize:gy});p(this,"selectors",{selectById:Wy,selectByIds:zy})}add(e){var S;const{store:n}=this.client,{addOne:a,deleteOne:c,updateOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:u.parent_document?[u.parent_document]:[],blocks:[u.uuid]});return y.then(f=>{this.dispatch(r(f))}).catch(()=>{this.dispatch(c(u.uuid))}),[u,y]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`attempting to update a document with uuid ${e.uuid} that does not exist in store.documents`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c,addMany:r,deleteMany:d}=this.actions,{selectById:l}=this.selectors,u=n.getState(),y=l(e)(u);if(!y)throw new Error(`attempting to delete a document with uuid ${e} that does not exist in store.documents`);const S=qy(e)(u);this.dispatch(a(e)),this.dispatch(d(E(S)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(c(y)),this.dispatch(r(S)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,c=this.list({queryParams:{project__organization:e}},n),r=this.list({queryParams:{organization:e}},n),l=(await Promise.all([c,r])).flat();return this.dispatch(a(l)),l}}class qt extends Ut{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:h.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:h.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:h.GET,...s},e)}}class Sz extends qt{constructor(){super(...arguments);p(this,"name","Email Domains");p(this,"url","/organization-email-domains");p(this,"actions",{addOne:Cy,addMany:Uy,setOne:Ly,setMany:Ny,updateOne:Hy,updateMany:Gy,deleteOne:Ky,deleteMany:Yy,initialize:$y});p(this,"selectors",{selectById:Jy,selectByIds:Zy})}async add(e,n){return this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:{email:n,organization:e},blockers:[e,"create-org"],blocks:[]})}async delete(e){const{deleteOne:n,addOne:a}=this.actions;this.dispatch(n(e.uuid));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e.uuid}/`,blockers:[e.domain],blocks:[]})}catch(c){throw this.dispatch(a(e)),c}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class mz extends Ut{async getVerificationCode(s){return this.enqueueRequest({description:"Get verification code",method:h.GET,url:`/verification/email-verification/${s}/`,isAuthNeeded:!1,blockers:[],blocks:[]})}validateVerificationCode(s,e=void 0){return this.enqueueRequest({description:"Validate verification code",method:h.POST,url:`/verification/email-verification/${s}/`,isAuthNeeded:!1,payload:e,blockers:[],blocks:[]})}}const Ps={},cr=new Set;class fz extends Ut{constructor(){super(...arguments);p(this,"host");p(this,"dbPromise",ek.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 Ts(e);if(cr.has(n))return;const a=await this.getDB();!!await a.get("files",n)?console.warn(`Attempting to add a file already cached, ${e.name}`):await a.put("files",e,n),cr.add(n)}async removeCache(e){await(await this.getDB()).delete("files",e),cr.delete(e)}async fetchCache(e){return(await this.getDB()).get("files",e)}async fetchFileFromUrl(e,n,a=n){const c=e.split("?")[0]??e,r=await this.fetchCache(n);if(r)return r;let d;c in Ps?d=Ps[c]:gr(e)?(d=_r(e,a),Ps[c]=d):(d=new Promise(y=>{this.performRequest({method:h.GET,url:e,isExternalUrl:!0,isResponseBlob:!0,isAuthNeeded:!1}).then(S=>{const f=new File([S],a,{type:S.type});y(f)})}),Ps[c]=d);let l;try{l=await d}catch(y){throw y instanceof C&&delete Ps[c],y}const u=await Ts(l);if(u!==n){const y=`The hash of the file returned from the server (${u}) does not match the
|
|
8
8
|
expected hash (${n}). This can happen if you're using a local development server and the
|
|
9
9
|
isExternalUrl flag in the request details is set to true, because instead of requesting the local
|
|
10
10
|
REST API, you will be requesting localhost:80 (where this app runs), resulting in a transformed blob
|
|
11
11
|
(with an uuid attached) being returned. Alternatively, you may be running with
|
|
12
12
|
import.meta.env.PROD, which will result in some file requests being treated as
|
|
13
|
-
external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(y)}return await this.addCache(l),l}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:h.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:e,blockers:[`s3-${n.fields.key}`],blocks:[e],s3url:n})}processPresignedUrls(e){const n={};for(const[a,c]of Object.entries(e))n[a]=this.processPresignedUrl(a,c);return n}async getFilePayload(e){const a={sha1:await Ps(e),file_type:e.type,extension:Pr(e),size:e.size};return await this.client.files.addCache(e),a}}class ez extends M{constructor(){super(...arguments);p(this,"name","Form Identifier");p(this,"url","/form-identifiers");p(this,"actions",{addOne:tS,addMany:sS,setOne:iS,setMany:nS,updateOne:aS,updateMany:cS,deleteOne:rS,deleteMany:dS,initialize:eS});p(this,"selectors",{selectById:uS,selectByIds:oS})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.form],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected form identifier with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(a(c)),c}}class tz extends M{constructor(){super(...arguments);p(this,"name","Form Identifier Value");p(this,"url","/form-identifier-values");p(this,"actions",{addOne:SS,addMany:mS,setOne:fS,setMany:AS,updateOne:wS,updateMany:PS,deleteOne:TS,deleteMany:OS,initialize:yS});p(this,"selectors",{selectById:FS,selectByIds:_S})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.form_submission,e.form_identifier],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{form_submission__form_revision__form__organization:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class sz extends z{constructor(){super(...arguments);p(this,"name","Form Revision Attachment");p(this,"url","/form-revision-attachments");p(this,"actions",{addOne:MS,addMany:vS,setOne:ES,setMany:VS,updateOne:kS,updateMany:BS,deleteOne:DS,deleteMany:WS,initialize:bS});p(this,"selectors",{selectById:qS,selectByIds:jS})}getId(e){return e.uuid}getBlockers(e){return[e.form_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form_revision__form__organization:e}},n);return this.dispatch(a(c)),c}}class iz extends M{constructor(){super(...arguments);p(this,"name","Form Revision");p(this,"url","/form-revisions");p(this,"actions",{addOne:Pn,addMany:Tn,setOne:LS,setMany:NS,updateOne:HS,updateMany:GS,deleteOne:On,deleteMany:In,initialize:US});p(this,"selectors",{selectById:KS,selectByIds:YS})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),y=P({...e,created_by:l,submitted_at:u});this.dispatch(a(y));const S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.form],blocks:[y.uuid]});return S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(a(c)),c}}class nz extends M{constructor(){super(...arguments);p(this,"name","Form");p(this,"url","/forms");p(this,"actions",{addOne:xS,addMany:em,setOne:tm,setMany:sm,updateOne:im,updateMany:nm,deleteOne:am,deleteMany:cm,initialize:XS});p(this,"selectors",{selectById:lm,selectByIds:um})}add(e,n){var f;const{store:a}=this.client,{addOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((f=a.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=P({...e,submitted_at:d,created_by:l}),y=P({...n,form:u.uuid,submitted_at:d,created_by:l});this.dispatch(c(u)),this.dispatch(Pn(y));const S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:{...R(u),initial_revision:{uuid:y.uuid,submitted_at:y.submitted_at,title:y.title,description:y.description,fields:y.fields}},blockers:[],blocks:[u.uuid,y.uuid]});return S.catch(F=>{throw this.dispatch(r(u.uuid)),this.dispatch(On(y.uuid)),F}),[u,y,S]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error("Expected form to exist");const u=Bm(e)(d),y=QS(e)(d);this.dispatch(a(e)),this.dispatch(Dn(E(u))),this.dispatch(In(E(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(S){throw this.dispatch(c(l)),this.dispatch(Tn(y)),this.dispatch(Bn(u)),S}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class az extends z{constructor(){super(...arguments);p(this,"name","Form Submission Attachment");p(this,"url","/form-submission-attachments");p(this,"actions",{addOne:pm,addMany:bn,setOne:ym,setMany:Sm,updateOne:mm,updateMany:fm,deleteOne:Am,deleteMany:Mn,initialize:hm});p(this,"selectors",{selectById:wm,selectByIds:Pm})}getId(e){return e.uuid}getBlockers(e){return[e.form_submission]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,r=n.getState(),d=Vn(e)(r);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{form_submission__form_revision__form__organization:e}},n)).flat();return this.dispatch(a(r)),r}}class cz extends M{constructor(){super(...arguments);p(this,"name","Form Submission");p(this,"url","/form-submissions");p(this,"actions",{addOne:Rm,addMany:Bn,setOne:_m,setMany:gm,updateOne:bm,updateMany:Mm,deleteOne:vm,deleteMany:Dn,initialize:Fm});p(this,"selectors",{selectById:Vm,selectByIds:km})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),y=P({...e,created_by:l,submitted_at:u}),S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.form_revision],blocks:[y.uuid]});return this.dispatch(a(y)),S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${l.uuid}/`,payload:e,blockers:[l.uuid],blocks:[l.uuid]});return u.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=Tm(e)(d);this.dispatch(a(e)),this.dispatch(Mn(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(bn(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,form_revision__form_organization:e}},n)).flat();return this.dispatch(a(r)),r}}class rz extends z{constructor(){super(...arguments);p(this,"name","Geo Image");p(this,"url","/geo-images");p(this,"actions",{addOne:$m,addMany:Cm,setOne:qm,setMany:jm,updateOne:Um,updateMany:Lm,deleteOne:Nm,deleteMany:Hm,initialize:zm});p(this,"selectors",{selectById:Km,selectByIds:Ym})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,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{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Geo image with uuid ${e.uuid} does not exist in the store`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return u.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project:e}},n);return this.dispatch(a(c)),c}}class dz extends M{constructor(){super(...arguments);p(this,"name","Issue Association");p(this,"url","/issue-associations");p(this,"actions",{addOne:sf,addMany:qt,setOne:xm,setMany:Xm,updateOne:ef,updateMany:tf,deleteOne:nf,deleteMany:jt,initialize:Zm});p(this,"selectors",{selectById:cf,selectByIds:rf})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=P({...e,submitted_at:d,created_by:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{associated_issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class lz extends z{constructor(){super(...arguments);p(this,"name","Issue Attachment");p(this,"url","/issue-attachments");p(this,"actions",{addOne:mf,addMany:Cn,setOne:ff,setMany:Af,updateOne:wf,updateMany:Pf,deleteOne:Tf,deleteMany:Un,initialize:Sf});p(this,"selectors",{selectById:Ff,selectByIds:_f})}getId(e){return e.uuid}getBlockers(e){return[e.issue]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,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:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class uz extends z{constructor(){super(...arguments);p(this,"name","Issue Comment Attachment");p(this,"url","/issue-comment-attachments");p(this,"actions",{addOne:Mf,addMany:vf,setOne:Ef,setMany:Vf,updateOne:kf,updateMany:Bf,deleteOne:Df,deleteMany:Wf,initialize:bf});p(this,"selectors",{selectById:qf,selectByIds:jf})}getId(e){return e.uuid}getBlockers(e){return[e.issue_comment]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,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:a}=this.actions,r=(await this.listPaginated({queryParams:{issue_comment__issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class oz extends M{constructor(){super(...arguments);p(this,"name","Issue Comment");p(this,"url","/issue-comments");p(this,"actions",{addOne:Lf,addMany:Nf,setOne:Hf,setMany:Gf,updateOne:Kf,updateMany:Yf,deleteOne:Qf,deleteMany:Jf,initialize:Uf});p(this,"selectors",{selectById:Zf,selectByIds:Xf})}add(e){const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=P({...e,author:n.getState().userReducer.currentUser.id,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[e.issue],blocks:[d.uuid]});return l.then(u=>{this.dispatch(c(u))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{setMany:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class hz extends M{constructor(){super(...arguments);p(this,"name","Issue");p(this,"url","/issues");p(this,"actions",{addOne:sA,addMany:Qn,setOne:iA,setMany:nA,updateOne:aA,updateMany:cA,deleteOne:rA,deleteMany:Jn,initialize:tA});p(this,"selectors",{selectById:lA,selectByIds:uA})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=new Date().toISOString(),u=((f=d.userReducer.currentUser)==null?void 0:f.id)??null,y=P({...e,submitted_at:l,created_by:u});this.dispatch(a(y));const S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[y.project,y.issue_type,y.status],blocks:[y.uuid]});return S.then(F=>{this.dispatch(c(F))}).catch(F=>{throw this.dispatch(r(y.uuid)),F}),[y,S]}update(e){var S;const{updateOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),r=a(e.uuid)(c);if(!r)throw new Error(`Attempting to update an issue with uuid ${e.uuid} that doesn't exist in the store`);const d={...r,...e};this.dispatch(n(d));const l={};for(const f of[$.TITLE,$.DESCRIPTION,$.STATUS,$.PRIORITY,$.ASSIGNED_TO,$.DUE_DATE])if(f in e&&e[f]!==r[f])switch(f){case $.PRIORITY:l[f]=e[f];break;case $.DUE_DATE:l[f]=e[f];break;case $.DESCRIPTION:l[f]=e[f];break;case $.TITLE:l[f]=e[f];break;case $.STATUS:{const F=e[f],g=ya(F)(c);if(!g)throw new Error(`Trying to update issue type status with ${F} which does not exist in store`);l[f]={name:g.name,color:g.color,uuid:g.uuid};break}case $.ASSIGNED_TO:{const F=e[f];if(F===null)l[f]=null;else{const g=js(F)(c);if(!g)throw new Error(`Trying to update assigned to with ${F} which does not exist in store.`);l[f]={full_name:g.username,id:g.id}}break}}const u=P({created_by:((S=c.userReducer.currentUser)==null?void 0:S.id)??null,submitted_at:new Date().toISOString(),issue:r.uuid,changes:l});this.dispatch(ma(u));const y=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return y.then(f=>{this.dispatch(n(f))}).catch(()=>{this.dispatch(n(r)),this.dispatch(Aa(u.uuid))}),[d,y]}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,d=E(e).toSorted(Ts);if(d.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=r(d)(a.getState()).toSorted(si);if(d.length!=l.length)throw new Error(`Attempting to bulk update ${d.length-l.length} issues that dont exist in the store`);const u=[];for(let F=0;F<d.length;F++)u.push({...l[F],...e[F]});this.dispatch(c(u));const y=N(e,Math.min(n??e.length,L)),S=[];let f=null;for(const F of y){const g=Bt.v4(),V=E(F),_=F.map(({status:b})=>b).filter(Boolean),v=this.enqueueRequest({description:w(h.PATCH,this.name,!0),method:h.PATCH,url:`${this.url}/bulk/`,payload:{payloads:F},blockers:(f?[f]:[]).concat(V).concat(_),blocks:[g].concat(V)});S.push(v),f=g}return Promise.all(S).then(F=>{this.dispatch(c(F.flat()))}).catch(()=>{this.dispatch(c(l))}),[u,S]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No issue with uuid ${e} found in the store`);const u=df(e)(d),y=of(e)(d),S=gb(e)(d),f=If(e)(d),F=zP(e)(d);this.dispatch(a(e)),this.dispatch(Un(E(f))),this.dispatch(wa(E(F))),this.dispatch(jt(E(u))),this.dispatch(jt(E(y))),this.dispatch(ps(E(S)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(g){throw this.dispatch(c(l)),this.dispatch(Cn(f)),this.dispatch(fa(F)),this.dispatch(qt(u)),this.dispatch(qt(y)),this.dispatch(hs(S)),g}}async bulkDelete(e){const{store:n}=this.client,{addMany:a,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d),u=lf(e)(d),y=uf(e)(d),S=_b(e)(d);this.dispatch(c(e)),this.dispatch(jt(E(u))),this.dispatch(jt(E(y))),this.dispatch(ps(E(S)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(f){throw this.dispatch(a(l)),this.dispatch(qt(u)),this.dispatch(qt(y)),this.dispatch(hs(S)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class pz extends z{constructor(){super(...arguments);p(this,"name","Issue Type Attachment");p(this,"url","/issue-type-attachments");p(this,"actions",{addOne:SA,addMany:mA,setOne:fA,setMany:AA,updateOne:wA,updateMany:PA,deleteOne:TA,deleteMany:OA,initialize:yA});p(this,"selectors",{selectById:FA,selectByIds:_A})}getId(e){return e.uuid}getBlockers(e){return[e.issue_type]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,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:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class yz extends z{constructor(){super(...arguments);p(this,"name","Issue Type Fields Attachment");p(this,"url","/issue-type-fields-attachments");p(this,"actions",{addOne:MA,addMany:vA,setOne:EA,setMany:VA,updateOne:kA,updateMany:BA,deleteOne:DA,deleteMany:WA,initialize:bA});p(this,"selectors",{selectById:qA,selectByIds:jA})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class Sz extends M{constructor(){super(...arguments);p(this,"name","Issue Type Fields");p(this,"url","/issue-type-fields");p(this,"actions",{addOne:iw,addMany:nw,setOne:aw,setMany:cw,updateOne:rw,updateMany:dw,deleteOne:lw,deleteMany:uw,initialize:sw});p(this,"selectors",{selectById:hw,selectByIds:pw})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.issue_type],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,y]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class mz extends z{constructor(){super(...arguments);p(this,"name","Issue Type Field Values Attachment");p(this,"url","/issue-type-field-values-attachments");p(this,"actions",{addOne:fw,addMany:na,setOne:Aw,setMany:ww,updateOne:Pw,updateMany:Tw,deleteOne:Ow,deleteMany:aa,initialize:mw});p(this,"selectors",{selectById:Fw,selectByIds:_w})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class fz extends M{constructor(){super(...arguments);p(this,"name","Issue Type Field Values");p(this,"url","/issue-type-field-values");p(this,"actions",{addOne:LA,addMany:NA,setOne:HA,setMany:GA,updateOne:KA,updateMany:YA,deleteOne:QA,deleteMany:JA,initialize:UA});p(this,"selectors",{selectById:XA,selectByIds:xA})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),y=P({...e,created_by:l,submitted_at:u}),S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.issue,e.fields_revision],blocks:[y.uuid]});return this.dispatch(a(y)),S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.issue],blocks:[l.uuid]});return u.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=gw(e)(d);this.dispatch(a(e)),this.dispatch(aa(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(na(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class Az extends M{constructor(){super(...arguments);p(this,"name","Issue Type Identifier");p(this,"url","/issue-type-identifiers");p(this,"actions",{addOne:vw,addMany:Ew,setOne:Vw,setMany:kw,updateOne:Bw,updateMany:Dw,deleteOne:Ww,deleteMany:zw,initialize:Mw});p(this,"selectors",{selectById:jw,selectByIds:$w})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.issue_type],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected issue type identifier with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class wz extends M{constructor(){super(...arguments);p(this,"name","Issue Type Identifier Value");p(this,"url","/issue-type-identifier-values");p(this,"actions",{addOne:Nw,addMany:Hw,setOne:Gw,setMany:Kw,updateOne:Yw,updateMany:Qw,deleteOne:Jw,deleteMany:Zw,initialize:Lw});p(this,"selectors",{selectById:xw,selectByIds:eP})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.issue,e.issue_type_identifier],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class Pz extends M{constructor(){super(...arguments);p(this,"name","Issue Type");p(this,"url","/issue-types");p(this,"actions",{addOne:nP,addMany:aP,setOne:cP,setMany:rP,updateOne:dP,updateMany:lP,deleteOne:uP,deleteMany:oP,initialize:iP});p(this,"selectors",{selectById:pP,selectByIds:yP})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),y=P({...e,submitted_at:u,created_by:l});this.dispatch(a(y));const S=this.enqueueRequest({method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[],blocks:[y.uuid]});return S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const u=oA(e)(d);this.dispatch(a(e)),this.dispatch(Jn(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Qn(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class Tz extends M{constructor(){super(...arguments);p(this,"name","Issue Type Status");p(this,"url","/issue-type-statuses");p(this,"actions",{addOne:AP,addMany:wP,setOne:PP,setMany:TP,updateOne:OP,updateMany:IP,deleteOne:FP,deleteMany:_P,initialize:fP});p(this,"selectors",{selectById:ya,selectByIds:RP})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.issue_type],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}update(e){const{setOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),r=a(e.uuid)(c);if(!r)throw new Error(`Expected an existing issue type status with uuid ${e.uuid}`);const d={...r,...e};this.dispatch(n(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(n(u))}).catch(()=>{this.dispatch(n(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`No issue type status with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class Oz extends M{constructor(){super(...arguments);p(this,"name","Issue Update");p(this,"url","/issue-updates");p(this,"actions",{addOne:ma,addMany:fa,setOne:EP,setMany:VP,updateOne:kP,updateMany:BP,deleteOne:Aa,deleteMany:wa,initialize:vP});p(this,"selectors",{selectById:DP,selectByIds:WP})}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}const Iz=1800;function Fz(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 _z extends OW{constructor(){super(...arguments);p(this,"_getRenewedTokens",async e=>{const n=this.performRequest({method:h.POST,url:this.refreshTokensUrl,payload:{refresh:e},isAuthNeeded:!1,checkAuth:!1});let a;try{a=await n}catch(c){console.error("Could not renew tokens; clearing auth",c),this.clearAuth();return}if(!a.access)throw new Error("Missing access token");return{accessToken:a.access,refreshToken:a.refresh??this.getRefreshToken()}})}clearAuth(){console.debug(this.constructor.name,"clearing auth;"),this.dispatch(cy(!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 a;try{a=qV(e).exp??n}catch{a=n}return a-n<Iz}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 C&&this.clearAuth(),e instanceof Error?Promise.reject(e):Promise.reject(new Error((e??Jt).toString()))}}}async handleUnauthorized(e,n){const a=this.client.store.getState();if(e.url.endsWith("/token/refresh/"))throw a.authReducer.isLoggedIn&&console.warn("No signed-in user to sign out."),this.clearAuth(),new C({message:"You have been signed out due to inactivity.",response:n,discard:!0});if(a.authReducer.isLoggedIn)await this.renewTokens();else throw console.debug("Forbidden; user is not logged in."),new C({message:"Incorrect username or password.",response:n,discard:!0})}async initAuth(e){const n=Bt.v4();return console.debug(this.constructor.name,"Initiating auth"),this.performRequest({uuid:n,method:h.POST,url:this.initTokensUrl,payload:e,isAuthNeeded:!1,checkAuth:!1}).then(a=>{this.setTokens(Fz(a))})}}class gz extends zt{constructor(){super(...arguments);p(this,"name","Organization Access");p(this,"url","/organization-accesses");p(this,"actions",{addOne:XP,addMany:xP,setOne:eT,setMany:tT,updateOne:sT,updateMany:iT,deleteOne:nT,deleteMany:aT,initialize:ZP});p(this,"selectors",{selectById:rT,selectByIds:dT})}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState()),d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(u=>{throw this.dispatch(a(r)),u}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d),u=js(l.user)(d);this.dispatch(a(l.uuid)),this.dispatch(Fa(l.user));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${l.uuid}/`,blockers:[l.uuid],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Ia(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class Rz extends zt{constructor(){super(...arguments);p(this,"name","Organization");p(this,"url","/organizations");p(this,"actions",{addOne:ST,addMany:yT,setOne:pT,setMany:hT,updateOne:fT,updateMany:mT,deleteOne:AT,deleteMany:wT,initialize:oT});p(this,"selectors",{selectById:OT,selectByIds:IT})}async add(e){const{addOne:n}=this.actions,a=await this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:e,blockers:[],blocks:[]});return this.dispatch(n(a)),a}async update(e){const{setOne:n}=this.actions,a=await this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return this.dispatch(n(a)),a}async invite(e,n){return this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/${e}/invite/${n}/`,blockers:[],blocks:[]})}async refreshStore(e){const{initialize:n}=this.actions,a=await this.list({},e);return this.dispatch(n(a)),a}}class bz extends M{constructor(){super(...arguments);p(this,"name","Project Access");p(this,"url","/project-accesses");p(this,"actions",{addOne:kT,addMany:BT,setOne:DT,setMany:WT,updateOne:zT,updateMany:qT,deleteOne:jT,deleteMany:$T,initialize:VT});p(this,"selectors",{selectById:UT,selectByIds:LT})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.organization_access,d.project],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(y=>{throw this.dispatch(r(d.uuid)),y}),[d,l]}bulkAdd(e){var y;const{store:n}=this.client,{addMany:a,deleteMany:c,updateMany:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=e.map(S=>P({...S,created_by:d}));this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{project_accesses:l.map(S=>R(S))},blockers:l.flatMap(S=>[S.project,S.organization_access]),blocks:l.map(S=>S.uuid)});return u.then(S=>{this.dispatch(r(S))}).catch(S=>{throw this.dispatch(c(l.map(f=>f.uuid))),S}),[l,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState()),d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return l.then(u=>{this.dispatch(a(u))}).catch(u=>{throw this.dispatch(a(r)),u}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(a(c)),c}}class Mz extends z{constructor(){super(...arguments);p(this,"name","Project Attachment");p(this,"url","/project-attachments");p(this,"actions",{addOne:GT,addMany:KT,setOne:YT,setMany:QT,updateOne:JT,updateMany:ZT,deleteOne:XT,deleteMany:xT,initialize:HT});p(this,"selectors",{selectById:tO,selectByIds:sO})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,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:a}=this.actions,c=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(a(c)),c}}class vz extends z{constructor(){super(...arguments);p(this,"name","Project File");p(this,"url","/project-files");p(this,"actions",{addOne:dO,addMany:lO,setOne:cO,setMany:rO,updateOne:uO,updateMany:oO,deleteOne:hO,deleteMany:pO,initialize:aO});p(this,"selectors",{selectById:mO,selectByIds:fO})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,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{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`${this.name} with uuid ${e.uuid} does not exist in the store`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return u.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class Ez extends zt{constructor(){super(...arguments);p(this,"name","Project");p(this,"url","/projects");p(this,"actions",{addOne:FO,addMany:IO,setOne:OO,setMany:TO,updateOne:gO,updateMany:_O,deleteOne:RO,deleteMany:bO,initialize:PO});p(this,"selectors",{selectById:EO,selectByIds:VO})}async add(e){const{addOne:n}=this.actions,a=await this.performRequest({method:h.POST,url:`${this.url}/`,payload:R(e)});return this.dispatch(n(a)),a}async update(e){const{updateOne:n}=this.actions,a=await this.performRequest({method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:R(e)});return this.dispatch(n(a)),a}async delete(e){const{deleteOne:n}=this.actions,a=await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]});return this.dispatch(n(e)),a}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}const wV=(...t)=>t.filter(s=>s!==null);class Vz extends M{constructor(){super(...arguments);p(this,"name","Procedure");p(this,"url","/procedures");p(this,"actions",{addOne:DO,addMany:Wa,setOne:WO,setMany:zO,updateOne:qO,updateMany:jO,deleteOne:$O,deleteMany:za,initialize:BO});p(this,"selectors",{selectById:LO,selectByIds:NO})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:wV(d.procedure_type,d.project,d.asset,d.issue),blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected procedure with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:wV(r.uuid,d.procedure_type,d.project,d.asset,d.issue),blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected procedure with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class kz extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Assignee");p(this,"url","/procedure-step-assignees");p(this,"actions",{addOne:YO,addMany:QO,setOne:JO,setMany:ZO,updateOne:XO,updateMany:xO,deleteOne:eI,deleteMany:tI,initialize:KO});p(this,"selectors",{selectById:iI,selectByIds:nI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.procedure,d.procedure_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var S;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=e.map(f=>P({...f,created_by:d,submitted_at:l}));this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{procedure_step_assignees:u.map(f=>R(f)),submitted_at:l},blockers:u.flatMap(f=>[f.procedure,f.procedure_step]),blocks:u.map(f=>f.uuid)});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(E(u)))}),[u,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected procedure step assignee with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Bz extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Comment");p(this,"url","/procedure-step-comments");p(this,"actions",{addOne:dI,addMany:lI,setOne:uI,setMany:oI,updateOne:hI,updateMany:pI,deleteOne:yI,deleteMany:SI,initialize:rI});p(this,"selectors",{selectById:fI,selectByIds:AI})}add(e){var u;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.procedure,d.procedure_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Procedure step comment with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Procedure step comment with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Dz extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Default Assignee");p(this,"url","/procedure-step-default-assignees");p(this,"actions",{addOne:OI,addMany:II,setOne:FI,setMany:_I,updateOne:gI,updateMany:RI,deleteOne:bI,deleteMany:MI,initialize:TI});p(this,"selectors",{selectById:EI,selectByIds:VI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.procedure_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected procedure step default assignee with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class Wz extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Default Reviewer");p(this,"url","/procedure-step-default-reviewers");p(this,"actions",{addOne:WI,addMany:zI,setOne:qI,setMany:jI,updateOne:$I,updateMany:CI,deleteOne:UI,deleteMany:LI,initialize:DI});p(this,"selectors",{selectById:HI,selectByIds:GI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.procedure_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected procedure step default reviewer with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class zz extends zt{constructor(){super(...arguments);p(this,"name","Procedure Step Event");p(this,"url","/procedure-step-events");p(this,"actions",{addOne:JI,addMany:ZI,setOne:XI,setMany:xI,updateOne:eF,updateMany:tF,deleteOne:sF,deleteMany:iF,initialize:QI});p(this,"selectors",{selectById:aF,selectByIds:cF})}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class qz extends z{constructor(){super(...arguments);p(this,"name","Procedure Step Fields Attachment");p(this,"url","/procedure-step-fields-attachments");p(this,"actions",{addOne:uF,addMany:Ga,setOne:oF,setMany:hF,updateOne:pF,updateMany:yF,deleteOne:SF,deleteMany:Ka,initialize:lF});p(this,"selectors",{selectById:AF,selectByIds:wF})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var a;const{store:n}=this.client;return P({...e,created_by:((a=n.getState().userReducer.currentUser)==null?void 0:a.id)??null,submitted_at:new Date().toISOString()})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__procedure_step__procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class jz extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Fields");p(this,"url","/procedure-step-fields");p(this,"actions",{addOne:IF,addMany:FF,setOne:_F,setMany:gF,updateOne:RF,updateMany:bF,deleteOne:MF,deleteMany:vF,initialize:OF});p(this,"selectors",{selectById:EF,selectByIds:VF})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.procedure_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected procedure step fields with uuid ${e} to exist`);const u=fF(e)(d);this.dispatch(a(e)),this.dispatch(Ka(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Ga(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class $z extends z{constructor(){super(...arguments);p(this,"name","Procedure Step Field Values Attachment");p(this,"url","/procedure-step-field-values-attachments");p(this,"actions",{addOne:WF,addMany:Xa,setOne:zF,setMany:qF,updateOne:jF,updateMany:$F,deleteOne:CF,deleteMany:xa,initialize:DF});p(this,"selectors",{selectById:LF,selectByIds:NF})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class Cz extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Field Values Review Request");p(this,"url","/procedure-step-field-values-review-requests");p(this,"actions",{addOne:l_,addMany:ic,setOne:u_,setMany:o_,updateOne:h_,updateMany:p_,deleteOne:y_,deleteMany:nc,initialize:d_});p(this,"selectors",{selectById:m_,selectByIds:f_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.field_values],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Procedure step field values review request with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Uz extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Field Values Review");p(this,"url","/procedure-step-field-values-reviews");p(this,"actions",{addOne:O_,addMany:cc,setOne:I_,setMany:F_,updateOne:__,updateMany:g_,deleteOne:R_,deleteMany:rc,initialize:T_});p(this,"selectors",{selectById:M_,selectByIds:v_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.field_values],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Procedure step field values review with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Procedure step field values review with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Lz extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Field Values");p(this,"url","/procedure-step-field-values");p(this,"actions",{addOne:QF,addMany:JF,setOne:ZF,setMany:XF,updateOne:xF,updateMany:e_,deleteOne:t_,deleteMany:s_,initialize:YF});p(this,"selectors",{selectById:n_,selectByIds:a_})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),y=P({...e,created_by:l,submitted_at:u}),S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.procedure,e.procedure_step,e.fields_revision],blocks:[y.uuid]});return this.dispatch(a(y)),S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}bulkAdd(e,n){var V;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),y=((V=this.client.store.getState().userReducer.currentUser)==null?void 0:V.id)??null,S=[],f=N(a,Math.min(n??a.length,L)),F=[];for(const _ of f){const v=[];for(const b of _){const D=P({...b,values:b.values,created_by:y,submitted_at:u});S.push(D),v.push({uuid:D.uuid,fields_revision:b.fields_revision,procedure:b.procedure,procedure_step:b.procedure_step,published_at:b.published_at,values:D.values})}F.push({submitted_at:u,values:c,field_values:v})}this.dispatch(r(S));const g=[];for(const _ of F){const{field_values:v}=_,b=v.map(({fields_revision:k})=>k),D=v.map(({procedure:k})=>k),j=v.map(({procedure_step:k})=>k),W=v.map(({uuid:k})=>k),q=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:_,blockers:b.concat(D).concat(j),blocks:W});g.push(q)}return Promise.all(g).then(_=>{this.dispatch(d(_.flat()))}).catch(()=>{this.dispatch(l(E(S)))}),[S,g]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected ProcedureStepFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.procedure,l.procedure_step,l.fields_revision],blocks:[l.uuid]});return u.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected ProcedureStepFieldValues with uuid ${e} to exist`);const u=HF(e)(d),y=E_(e)(d),S=A_(e)(d);this.dispatch(a(e)),this.dispatch(xa(E(u))),this.dispatch(rc(E(y))),this.dispatch(nc(E(S)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(c(l)),this.dispatch(Xa(u)),this.dispatch(cc(y)),this.dispatch(ic(S)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Nz extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Reviewer");p(this,"url","/procedure-step-reviewers");p(this,"actions",{addOne:D_,addMany:W_,setOne:z_,setMany:q_,updateOne:j_,updateMany:$_,deleteOne:C_,deleteMany:U_,initialize:B_});p(this,"selectors",{selectById:N_,selectByIds:H_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.procedure,d.procedure_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var S;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=e.map(f=>P({...f,created_by:d,submitted_at:l}));this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{procedure_step_reviewers:u.map(f=>R(f)),submitted_at:l},blockers:u.flatMap(f=>[f.procedure,f.procedure_step]),blocks:u.map(f=>f.uuid)});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.map(f=>f.uuid)))}),[u,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected procedure step reviewer with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Hz extends M{constructor(){super(...arguments);p(this,"name","Procedure Step");p(this,"url","/procedure-steps");p(this,"actions",{addOne:Z_,addMany:X_,setOne:Q_,setMany:J_,updateOne:x_,updateMany:eg,deleteOne:tg,deleteMany:sg,initialize:Y_});p(this,"selectors",{selectById:ng,selectByIds:ag})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.procedure_type],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`No procedure step with uuid ${e.uuid} found in the store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${r.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteMany:a,addMany:c,addOne:r,deleteOne:d}=this.actions,{selectById:l}=this.selectors,u=n.getState(),y=l(e)(u);if(!y)throw new Error(`No procedure step with uuid ${e} found in the store`);const S=cg(e)(u);this.dispatch(d(e)),this.dispatch(a(E(S)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(r(y)),this.dispatch(c(S)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class Gz extends z{constructor(){super(...arguments);p(this,"name","Procedure Type Fields Attachment");p(this,"url","/procedure-type-fields-attachments");p(this,"actions",{addOne:lg,addMany:ug,setOne:og,setMany:hg,updateOne:pg,updateMany:yg,deleteOne:Sg,deleteMany:mg,initialize:dg});p(this,"selectors",{selectById:wg,selectByIds:Pg})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class Kz extends M{constructor(){super(...arguments);p(this,"name","Procedure Type Fields");p(this,"url","/procedure-type-fields");p(this,"actions",{addOne:Ig,addMany:Fg,setOne:_g,setMany:gg,updateOne:Rg,updateMany:bg,deleteOne:Mg,deleteMany:vg,initialize:Og});p(this,"selectors",{selectById:kg,selectByIds:Bg})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.procedure_type],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,y]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class Yz extends z{constructor(){super(...arguments);p(this,"name","Procedure Type Field Values Attachment");p(this,"url","/procedure-type-field-values-attachments");p(this,"actions",{addOne:zg,addMany:Sc,setOne:qg,setMany:jg,updateOne:$g,updateMany:Cg,deleteOne:Ug,deleteMany:mc,initialize:Wg});p(this,"selectors",{selectById:Hg,selectByIds:Gg})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class Qz extends M{constructor(){super(...arguments);p(this,"name","Procedure Type Field Values");p(this,"url","/procedure-type-field-values");p(this,"actions",{addOne:Jg,addMany:Zg,setOne:Xg,setMany:xg,updateOne:eR,updateMany:tR,deleteOne:sR,deleteMany:iR,initialize:Qg});p(this,"selectors",{selectById:cR,selectByIds:rR})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),y=P({...e,created_by:l,submitted_at:u}),S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.fields_revision,e.procedure],blocks:[y.uuid]});return this.dispatch(a(y)),S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}bulkAdd(e,n){var V;const{values:a,payloads:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),y=((V=this.client.store.getState().userReducer.currentUser)==null?void 0:V.id)??null,S=[],f=N(c,Math.min(n??c.length,L)),F=[];for(const _ of f){const v=[];for(const b of _){const D=P({...b,values:b.values,created_by:y,submitted_at:u});S.push(D),v.push({uuid:D.uuid,fields_revision:b.fields_revision,procedure:b.procedure,published_at:b.published_at,values:D.values})}F.push({submitted_at:u,values:a,field_values:v})}this.dispatch(r(S));const g=[];for(const _ of F){const{field_values:v}=_,b=v.map(({fields_revision:q})=>q),D=v.map(({procedure:q})=>q),j=v.map(({uuid:q})=>q),W=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:_,blockers:b.concat(D),blocks:j});g.push(W)}return Promise.all(g).then(_=>{this.dispatch(d(_.flat()))}).catch(()=>{this.dispatch(l(E(S)))}),[S,g]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected ProcedureTypeFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.fields_revision,l.procedure],blocks:[l.uuid]});return u.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=Kg(e)(d);this.dispatch(a(e)),this.dispatch(mc(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Sc(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class Jz extends M{constructor(){super(...arguments);p(this,"name","Procedure Type");p(this,"url","/procedure-types");p(this,"actions",{addOne:uR,addMany:oR,setOne:hR,setMany:pR,updateOne:yR,updateMany:SR,deleteOne:mR,deleteMany:fR,initialize:lR});p(this,"selectors",{selectById:PR,selectByIds:TR})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=P({...e,created_by:((y=d.userReducer.currentUser)==null?void 0:y.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[],blocks:[l.uuid]});return u.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected procedure type with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected procedure type with uuid ${e} to exist`);const u=HO(e)(d);this.dispatch(a(e)),this.dispatch(za(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Wa(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class Zz extends M{constructor(){super(...arguments);p(this,"name","Team Membership");p(this,"url","/team-memberships");p(this,"actions",{addOne:_R,addMany:gR,setOne:RR,setMany:bR,updateOne:MR,updateMany:vR,deleteOne:ER,deleteMany:VR,initialize:FR});p(this,"selectors",{selectById:DR,selectByIds:WR})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[e.team],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var y;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=e.map(S=>P({...S,created_by:d}));this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{team_memberships:l.map(S=>R(S))},blockers:l.map(S=>S.team),blocks:l.map(S=>S.uuid)});return u.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(r(l.map(S=>S.uuid)))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{team__organization:e}},n);return this.dispatch(a(c)),c}}class Xz extends M{constructor(){super(...arguments);p(this,"name","Team");p(this,"url","/teams");p(this,"actions",{addOne:jR,addMany:$R,setOne:CR,setMany:UR,updateOne:LR,updateMany:NR,deleteOne:HR,deleteMany:GR,initialize:qR});p(this,"selectors",{selectById:YR,selectByIds:QR})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,submitted_at:new Date().toISOString(),created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:R(e),blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class xz extends zt{constructor(){super(...arguments);p(this,"name","User");p(this,"url","/user");p(this,"actions",{addOne:Ia,addMany:LP,setOne:UP,setMany:CP,updateOne:HP,updateMany:NP,deleteOne:Fa,deleteMany:GP,initialize:$P});p(this,"selectors",{selectById:js,selectByIds:QP})}async list(e,n){const{organizationUuid:a,...c}=e,r=a?`/organizations/${a}${this.url}s/`:`/${this.url}`;return this.performRequest({method:h.GET,url:r,...c},n)}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({organizationUuid:e},n);return this.dispatch(a(c)),c}}class eq extends M{constructor(){super(...arguments);p(this,"name","Workflow");p(this,"url","/workflows");p(this,"actions",{addOne:tb,addMany:sb,setOne:ib,setMany:nb,updateOne:ab,updateMany:cb,deleteOne:rb,deleteMany:db,initialize:eb});p(this,"selectors",{selectById:ub,selectByIds:ob})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow_type,d.project],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected workflow with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid,d.workflow_type,d.project],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected workflow with uuid ${e} to exist`);const u=Fb(e)(d);this.dispatch(a(e)),this.dispatch(ps(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(hs(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class tq extends M{constructor(){super(...arguments);p(this,"name","Workflow Issue Link");p(this,"url","/workflow-issue-links");p(this,"actions",{addOne:Sb,addMany:hs,setOne:mb,setMany:fb,updateOne:Ab,updateMany:wb,deleteOne:Pb,deleteMany:ps,initialize:yb});p(this,"selectors",{selectById:Ob,selectByIds:Ib})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=P({...e,submitted_at:d,created_by:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.workflow,e.issue],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow issue link with uuid ${e} not found in store.`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class sq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Assignee");p(this,"url","/workflow-step-assignees");p(this,"actions",{addOne:vb,addMany:Eb,setOne:Vb,setMany:kb,updateOne:Bb,updateMany:Db,deleteOne:Wb,deleteMany:zb,initialize:Mb});p(this,"selectors",{selectById:jb,selectByIds:$b})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow,d.workflow_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var S;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=e.map(f=>P({...f,created_by:d,submitted_at:l}));this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{workflow_step_assignees:u.map(f=>R(f)),submitted_at:l},blockers:u.flatMap(f=>[f.workflow,f.workflow_step]),blocks:u.map(f=>f.uuid)});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(E(u)))}),[u,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step assignee with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class iq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Comment");p(this,"url","/workflow-step-comments");p(this,"actions",{addOne:Nb,addMany:Hb,setOne:Gb,setMany:Kb,updateOne:Yb,updateMany:Qb,deleteOne:Jb,deleteMany:Zb,initialize:Lb});p(this,"selectors",{selectById:xb,selectByIds:eM})}add(e){var u;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow,d.workflow_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Workflow step comment with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow step comment with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class nq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Default Assignee");p(this,"url","/workflow-step-default-assignees");p(this,"actions",{addOne:nM,addMany:aM,setOne:cM,setMany:rM,updateOne:dM,updateMany:lM,deleteOne:uM,deleteMany:oM,initialize:iM});p(this,"selectors",{selectById:pM,selectByIds:yM})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step default assignee with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class aq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Default Reviewer");p(this,"url","/workflow-step-default-reviewers");p(this,"actions",{addOne:AM,addMany:wM,setOne:PM,setMany:TM,updateOne:OM,updateMany:IM,deleteOne:FM,deleteMany:_M,initialize:fM});p(this,"selectors",{selectById:RM,selectByIds:bM})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step default reviewer with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class cq extends zt{constructor(){super(...arguments);p(this,"name","Workflow Step Event");p(this,"url","/workflow-step-events");p(this,"actions",{addOne:VM,addMany:kM,setOne:BM,setMany:DM,updateOne:WM,updateMany:zM,deleteOne:qM,deleteMany:jM,initialize:EM});p(this,"selectors",{selectById:CM,selectByIds:UM})}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class rq extends z{constructor(){super(...arguments);p(this,"name","Workflow Step Fields Attachment");p(this,"url","/workflow-step-fields-attachments");p(this,"actions",{addOne:GM,addMany:Dc,setOne:KM,setMany:YM,updateOne:QM,updateMany:JM,deleteOne:ZM,deleteMany:Wc,initialize:HM});p(this,"selectors",{selectById:ev,selectByIds:tv})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var a;const{store:n}=this.client;return P({...e,created_by:((a=n.getState().userReducer.currentUser)==null?void 0:a.id)??null,submitted_at:new Date().toISOString()})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class dq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Fields");p(this,"url","/workflow-step-fields");p(this,"actions",{addOne:av,addMany:cv,setOne:rv,setMany:dv,updateOne:lv,updateMany:uv,deleteOne:ov,deleteMany:hv,initialize:nv});p(this,"selectors",{selectById:yv,selectByIds:Sv})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected workflow step fields with uuid ${e} to exist`);const u=xM(e)(d);this.dispatch(a(e)),this.dispatch(Wc(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Dc(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class lq extends z{constructor(){super(...arguments);p(this,"name","Workflow Step Field Values Attachment");p(this,"url","/workflow-step-field-values-attachments");p(this,"actions",{addOne:wv,addMany:$c,setOne:Pv,setMany:Tv,updateOne:Ov,updateMany:Iv,deleteOne:Fv,deleteMany:Cc,initialize:Av});p(this,"selectors",{selectById:gv,selectByIds:Rv})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var a;const{store:n}=this.client;return P({...e,created_by:((a=n.getState().userReducer.currentUser)==null?void 0:a.id)??null,submitted_at:new Date().toISOString()})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__workflow__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class uq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Field Values Review Request");p(this,"url","/workflow-step-field-values-review-requests");p(this,"actions",{addOne:Gv,addMany:Hc,setOne:Kv,setMany:Yv,updateOne:Qv,updateMany:Jv,deleteOne:Zv,deleteMany:Gc,initialize:Hv});p(this,"selectors",{selectById:xv,selectByIds:eE})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.field_values],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow step field values review request with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class oq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Field Values Review");p(this,"url","/workflow-step-field-values-reviews");p(this,"actions",{addOne:aE,addMany:Yc,setOne:cE,setMany:rE,updateOne:dE,updateMany:lE,deleteOne:uE,deleteMany:Qc,initialize:nE});p(this,"selectors",{selectById:hE,selectByIds:pE})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.field_values],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Workflow step field values review with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow step field values review with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class hq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Field Values");p(this,"url","/workflow-step-field-values");p(this,"actions",{addOne:Vv,addMany:kv,setOne:Bv,setMany:Dv,updateOne:Wv,updateMany:zv,deleteOne:qv,deleteMany:jv,initialize:Ev});p(this,"selectors",{selectById:Cv,selectByIds:Uv})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=P({...e,created_by:((y=d.userReducer.currentUser)==null?void 0:y.id)??null,submitted_at:new Date().toISOString()}),u=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[e.workflow,e.workflow_step,e.fields_revision],blocks:[l.uuid]});return this.dispatch(a(l)),u.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected WorkflowStepFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.workflow,l.workflow_step,l.fields_revision],blocks:[l.uuid]});return u.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected WorkflowStepFieldValues with uuid ${e} to exist`);const u=bv(e)(d),y=yE(e)(d),S=tE(e)(d);this.dispatch(a(e)),this.dispatch(Cc(E(u))),this.dispatch(Qc(E(y))),this.dispatch(Gc(E(S)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(c(l)),this.dispatch($c(u)),this.dispatch(Yc(y)),this.dispatch(Hc(S)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class pq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Reviewer");p(this,"url","/workflow-step-reviewers");p(this,"actions",{addOne:AE,addMany:wE,setOne:PE,setMany:TE,updateOne:OE,updateMany:IE,deleteOne:FE,deleteMany:_E,initialize:fE});p(this,"selectors",{selectById:RE,selectByIds:bE})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow,d.workflow_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var S;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=e.map(f=>P({...f,created_by:d,submitted_at:l}));this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{workflow_step_reviewers:u.map(f=>R(f)),submitted_at:l},blockers:u.flatMap(f=>[f.workflow,f.workflow_step]),blocks:u.map(f=>f.uuid)});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.map(f=>f.uuid)))}),[u,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step reviewer with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class yq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step");p(this,"url","/workflow-steps");p(this,"actions",{addOne:VE,addMany:kE,setOne:BE,setMany:DE,updateOne:WE,updateMany:zE,deleteOne:qE,deleteMany:jE,initialize:EE});p(this,"selectors",{selectById:CE,selectByIds:UE})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow_type],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected workflow step with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid,d.workflow_type],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class Sq extends M{constructor(){super(...arguments);p(this,"name","Workflow Type");p(this,"url","/workflow-types");p(this,"actions",{addOne:GE,addMany:KE,setOne:YE,setMany:QE,updateOne:JE,updateMany:ZE,deleteOne:XE,deleteMany:xE,initialize:HE});p(this,"selectors",{selectById:tV,selectByIds:sV})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=P({...e,created_by:((y=d.userReducer.currentUser)==null?void 0:y.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[],blocks:[l.uuid]});return u.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected workflow type with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow type with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}async function nr(t,s,e,n,a){const c=n instanceof Ct;c&&s.checkAuth!==!1&&await n.auth.prepareAuth();const r={queryParams:"",isAuthNeeded:!0},{s3url:d,payload:l,headers:u,method:y,queryParams:S,attachmentHash:f,isExternalUrl:F,isAuthNeeded:g,isResponseBlob:V}={...r,...s};let _=s.url;const v=f?await e.files.fetchCache(f):void 0;if(f&&!v)throw new Error(`Cannot upload file ${f} because it's not cached.`);!F&&!_.startsWith("http")&&(!_.startsWith("/")&&!_.startsWith("blob:")&&(_="/"+_),_=t+_);const b=k=>{if(f){if(!d)throw new Error(`No S3 URL for file ${f}`);if("warning"in d)throw new Error(`S3 URL warning for file ${f}`);if(!v)throw new Error(`No file for file ${f}`);const H=d.fields["x-amz-checksum-sha1"];if(!H)throw new Error(`No checksum for file ${f}`);return k.set("x-amz-checksum-sha1",H).field({...l,...d.fields}).attach("file",v)}return k.send(l)},j={[h.GET]:()=>V?Lt.get(_.toString()).responseType("blob"):Lt.get(_.toString()),[h.POST]:()=>{const k=Lt.post(_.toString());return b(k)},[h.PATCH]:()=>{const k=Lt.patch(_.toString());return b(k)},[h.PUT]:()=>{const k=Lt.put(_.toString());return b(k)},[h.DELETE]:()=>{const k=Lt.delete(_.toString());return b(k)}}[y];let W=j();const q=()=>{console.debug("aborting request:",s.url),W.abort()};if(a==null||a.addEventListener("abort",q),g&&c){const k=n.auth.getAuthHeader();W=W.set("Authorization",k)}u&&(W=W.set(u));try{return await W.query(S)}catch(k){const H=AV(k),Qs=H==null?void 0:H.status;if(c&&Qs===401)return await n.auth.handleUnauthorized(W,H),W.query(S);throw new C({response:H,innerError:k,discard:sr.includes(Qs)})}finally{a==null||a.removeEventListener("abort",q)}}class mq{constructor(s){p(this,"store");this.store=s}_performRequest(s,e,n,a){const c=new Xs,r={...e,uuid:e.uuid??Bt.v4()};return nr(s,r,this,n,a).then(d=>{c.resolve(d.body)}).catch(d=>{d instanceof Error?c.reject(d):c.reject(new Error((d??Jt).toString()))}),c}async performRequest(s,e,n,a){return this._performRequest(s,e,n,a).then(c=>{if(c instanceof C)throw c;return c})}async enqueueRequest(s,e,n){return this._enqueueRequest(s,e,n).then(a=>{if(a instanceof C)throw a;return a})}_enqueueRequest(s,e,n){const a=new Xs,c={...s,BASE_URL:e,serviceName:n},r=this.store.dispatch(RT(c)),d=u=>{if(u)a.resolve(u.body);else{const y=new C({message:"Could not get a response from the server.",response:u,discard:!0});a.reject(y)}},l=u=>{u instanceof C?u.options.discard=!0:(console.error("Received an unexpected error while processing a request:",u,`
|
|
14
|
-
Converting error to APIError and discarding.`),u=new C({message:"An error occurred while processing the request.",innerError:u,discard:!0})),a.reject(u)};return r.then(d,l),a}async performPagination(s,e,n,a,c){const r={...e,queryParams:{...e.queryParams,paginate:!0,limit:n}},{method:d}=r,l=[];let u=await this.performRequest(s,r,a,c);for(l.push(u.results);u.next;)u=await this.performRequest(s,{url:u.next,method:d},a,c),l.push(u.results);return l}}class Zt{constructor(){p(this,"graph");p(this,"requestAttemptCounter");this.graph=new jV.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(s){const e=new Zt;for(let n=0;n<s.length;n++){const a=s[n];if(!a){console.error("Outbox item was undefined");continue}e.sneakRequest(a);for(let c=0;c<n;c++){const r=s[c];if(!r){console.error("Previous outbox item was undefined");continue}r.payload.uuid!==a.payload.uuid&&r.payload.blocks.some(d=>a.payload.blockers.includes(d))&&Zt._addDependency(a.payload.uuid,r.payload.uuid,e.graph)}}return e}_addDependency(s,e){Zt._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),a=new Set(n.payload.blocks);s.payload.blockers.some(c=>a.has(c))&&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),a=new Set(s.payload.blocks);n.payload.blockers.some(c=>a.has(c))&&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 a of s){const c=this.requestAttemptCounter[a]||0;c<e&&(e=c,n=a)}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),a=s.findIndex(c=>c.payload.uuid===n.payload.uuid);a!==-1&&(s.splice(a,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 a=this.requestAttemptCounter[e.payload.uuid]||0,c=this.requestAttemptCounter[n.payload.uuid]||0;return a-c}),s}registerRetry(s){this.requestAttemptCounter[s]=(this.requestAttemptCounter[s]||0)+1}}let PV;function TV(t){PV=t}function Xt(){return PV}let OV;function IV(t){OV=t}function FV(){return OV}let ar=null;function Ut(){const t=Xt();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(ar)return ar;const s=t.getState().offline.outbox,e=Zt._fromOutbox(s);return ar=e,e}const fq=(t,s)=>{const e=new s(t);return IV(e),TV(t),e};class Aq{constructor(s){p(this,"_all");p(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 cr{constructor(){p(this,"next");this.next=null}then(s){return new Aq(this).then(s)}async run(s){if(this.next)return this.next.run(s);{if(console.debug("Middleware finished. Performing request:",s.payload.url),!Xt())throw new Error("Client store not set");const n=FV();if(!n)throw new Error("Client SDK not set");return SV(s,n)}}}class _V extends cr{async run(s){return super.run(s)}}class gV extends cr{async run(s){return super.run(s)}}const RV=new _V().then(new gV).compile();function bV(t){var s;return(s=RV[0])==null?void 0:s.run(t)}var MV=(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))(MV||{});i.ALL_MIDDLEWARE=RV,i.APIError=C,i.AgentService=IW,i.AssetAttachmentService=FW,i.AssetProcedureService=vW,i.AssetProcedureStepFieldValuesAttachmentService=BW,i.AssetProcedureStepFieldValuesService=DW,i.AssetProcedureStepFieldsAttachmentService=VW,i.AssetProcedureStepFieldsService=kW,i.AssetProcedureStepService=WW,i.AssetProcedureTypeAttachmentService=_W,i.AssetProcedureTypeFieldValuesAttachmentService=bW,i.AssetProcedureTypeFieldValuesService=MW,i.AssetProcedureTypeFieldsAttachmentService=gW,i.AssetProcedureTypeFieldsService=RW,i.AssetProcedureTypeService=EW,i.AssetService=zW,i.AssetStageCompletionService=qW,i.AssetStageService=jW,i.AssetStatusType=hr,i.AssetTypeAttachmentService=$W,i.AssetTypeFieldValuesAttachmentService=LW,i.AssetTypeFieldValuesService=NW,i.AssetTypeFieldsAttachmentService=CW,i.AssetTypeFieldsService=UW,i.AssetTypeIdentifierService=HW,i.AssetTypeIdentifierValueService=GW,i.AssetTypeService=KW,i.AssetTypeStatusService=YW,i.AttachmentModel=pr,i.BaseApiService=Ct,i.BaseModelApiService=zt,i.BaseOfflineFileModelApiService=z,i.BaseOfflineModelApiService=M,i.BaseSDK=mq,i.COMMON_AUTO_FIELDS=_r,i.DEFAULT_ISSUE_PRIORITY=$V,i.DEFAULT_PAGE_SIZE=aV,i.DEFAULT_WORKFLOW_STATUS=LV,i.DISCARD_HTTP_STATUSES=sr,i.DeferredPromise=Xs,i.DocumentAttachmentService=QW,i.DocumentService=JW,i.EMPTY_ARRAY=lr,i.EMPTY_OBJECT=ur,i.EmailDomainsService=ZW,i.EmailVerificationService=XW,i.FILE_MODEL_DEFAULT_PAGE_SIZE=cV,i.FileService=xW,i.FormIdentifierService=ez,i.FormIdentifierValueService=tz,i.FormRevisionAttachmentService=sz,i.FormRevisionService=iz,i.FormService=nz,i.FormSubmissionAttachmentService=az,i.FormSubmissionService=cz,i.GeoImageService=rz,i.HttpMethod=h,i.IssueAssociationService=dz,i.IssueAttachmentService=lz,i.IssueCommentAttachmentService=uz,i.IssueCommentService=oz,i.IssuePriority=Zs,i.IssueService=hz,i.IssueStatusType=yr,i.IssueTypeAttachmentService=pz,i.IssueTypeFieldValuesAttachmentService=mz,i.IssueTypeFieldValuesService=fz,i.IssueTypeFieldsAttachmentService=yz,i.IssueTypeFieldsService=Sz,i.IssueTypeIdentifierService=Az,i.IssueTypeIdentifierValueService=wz,i.IssueTypeService=Pz,i.IssueTypeStatusService=Tz,i.IssueUpdateChange=$,i.IssueUpdateService=Oz,i.JWTService=_z,i.MAX_SERVICE_BATCH_SIZE=L,i.OUTBOX_RETRY_DELAY=Ar,i.OfflineAnalyticsMiddleware=_V,i.OfflineMiddleware=cr,i.OrganizationAccessLevel=or,i.OrganizationAccessService=gz,i.OrganizationService=Rz,i.OutboxCoordinator=Zt,i.ProcedureService=Vz,i.ProcedureStepAssigneeService=kz,i.ProcedureStepCommentService=Bz,i.ProcedureStepDefaultAssigneeService=Dz,i.ProcedureStepDefaultReviewerService=Wz,i.ProcedureStepEventService=zz,i.ProcedureStepEventType=mr,i.ProcedureStepFieldValuesAttachmentService=$z,i.ProcedureStepFieldValuesReviewRequestService=Cz,i.ProcedureStepFieldValuesReviewService=Uz,i.ProcedureStepFieldValuesReviewType=fr,i.ProcedureStepFieldValuesService=Lz,i.ProcedureStepFieldsAttachmentService=qz,i.ProcedureStepFieldsService=jz,i.ProcedureStepReviewerService=Nz,i.ProcedureStepService=Hz,i.ProcedureTypeFieldValuesAttachmentService=Yz,i.ProcedureTypeFieldValuesService=Qz,i.ProcedureTypeFieldsAttachmentService=Gz,i.ProcedureTypeFieldsService=Kz,i.ProcedureTypeService=Jz,i.ProjectAccessService=bz,i.ProjectAttachmentService=Mz,i.ProjectFileService=vz,i.ProjectService=Ez,i.RESET_ORGANIZATION_STATE=I,i.RESET_PROJECT_STATE=B,i.RESET_STATE=T,i.RateLimitingMiddleware=gV,i.SelectorBuilder=pk,i.TeamMembershipService=Zz,i.TeamService=Xz,i.UNKNOWN_ERROR_MESSAGE=Jt,i.UserService=xz,i.VERSION_REDUCER_KEY=ts,i.VerificationCodeType=MV,i.WORKFLOW_STATUSES=UV,i.WORKFLOW_STEP_FIELD_VALUES_REVIEW_TYPES=CV,i.WorkflowIssueLinkService=tq,i.WorkflowService=eq,i.WorkflowStatus=Ht,i.WorkflowStepAssigneeService=sq,i.WorkflowStepCommentService=iq,i.WorkflowStepDefaultAssigneeService=nq,i.WorkflowStepDefaultReviewerService=aq,i.WorkflowStepEventService=cq,i.WorkflowStepEventType=Sr,i.WorkflowStepFieldValuesAttachmentService=lq,i.WorkflowStepFieldValuesReviewRequestService=uq,i.WorkflowStepFieldValuesReviewService=oq,i.WorkflowStepFieldValuesReviewType=es,i.WorkflowStepFieldValuesService=hq,i.WorkflowStepFieldsAttachmentService=rq,i.WorkflowStepFieldsService=dq,i.WorkflowStepReviewerService=pq,i.WorkflowStepService=yq,i.WorkflowTypeService=Sq,i._setLatestRetryTime=MT,i.addAsset=io,i.addAssetAttachment=Ur,i.addAssetAttachments=ci,i.addAssetProcedure=ml,i.addAssetProcedureStep=Hu,i.addAssetProcedureStepFieldValues=Mu,i.addAssetProcedureStepFieldValuesAttachment=mu,i.addAssetProcedureStepFieldValuesAttachments=Mi,i.addAssetProcedureStepFieldValuesMany=vu,i.addAssetProcedureStepFields=iu,i.addAssetProcedureStepFieldsAttachment=Ll,i.addAssetProcedureStepFieldsAttachments=Nl,i.addAssetProcedureStepFieldsMany=nu,i.addAssetProcedureSteps=Gu,i.addAssetProcedureType=Ml,i.addAssetProcedureTypeAttachment=td,i.addAssetProcedureTypeAttachments=sd,i.addAssetProcedureTypeFieldValues=sl,i.addAssetProcedureTypeFieldValuesAttachment=Ld,i.addAssetProcedureTypeFieldValuesAttachments=Si,i.addAssetProcedureTypeFieldValuesMany=il,i.addAssetProcedureTypeFields=Md,i.addAssetProcedureTypeFieldsAttachment=Sd,i.addAssetProcedureTypeFieldsAttachments=md,i.addAssetProcedureTypeFieldsMany=vd,i.addAssetProcedureTypes=vl,i.addAssetProcedures=Pi,i.addAssetStage=Bo,i.addAssetStageCompletion=fo,i.addAssetStageCompletions=Ao,i.addAssetStages=Do,i.addAssetType=Dp,i.addAssetTypeAttachment=Ho,i.addAssetTypeAttachments=Li,i.addAssetTypeFieldValues=Hh,i.addAssetTypeFieldValuesAttachment=Vh,i.addAssetTypeFieldValuesAttachments=Ji,i.addAssetTypeFieldValuesMany=Gh,i.addAssetTypeFields=Ah,i.addAssetTypeFieldsAttachment=nh,i.addAssetTypeFieldsAttachments=ah,i.addAssetTypeFieldsMany=wh,i.addAssetTypeIdentifier=ap,i.addAssetTypeIdentifierValue=wp,i.addAssetTypeIdentifierValues=Pp,i.addAssetTypeIdentifiers=cp,i.addAssetTypeStatus=Kp,i.addAssetTypeStatuses=Yp,i.addAssetTypes=Wp,i.addAssets=Wi,i.addConversation=Wr,i.addConversations=yk,i.addDocument=Fy,i.addDocumentAttachment=uy,i.addDocumentAttachments=oy,i.addDocuments=_y,i.addEmailDomain=qy,i.addEmailDomains=jy,i.addForm=xS,i.addFormIdentifier=tS,i.addFormIdentifierValue=SS,i.addFormIdentifierValues=mS,i.addFormIdentifiers=sS,i.addFormRevision=Pn,i.addFormRevisionAttachment=MS,i.addFormRevisionAttachments=vS,i.addFormRevisions=Tn,i.addFormSubmission=Rm,i.addFormSubmissionAttachment=pm,i.addFormSubmissionAttachments=bn,i.addFormSubmissions=Bn,i.addForms=em,i.addGeoImage=$m,i.addGeoImages=Cm,i.addIssue=sA,i.addIssueAssociation=sf,i.addIssueAssociations=qt,i.addIssueAttachment=mf,i.addIssueAttachments=Cn,i.addIssueComment=Lf,i.addIssueCommentAttachment=Mf,i.addIssueCommentAttachments=vf,i.addIssueComments=Nf,i.addIssueType=nP,i.addIssueTypeAttachment=SA,i.addIssueTypeAttachments=mA,i.addIssueTypeFieldValues=LA,i.addIssueTypeFieldValuesAttachment=fw,i.addIssueTypeFieldValuesAttachments=na,i.addIssueTypeFieldValuesMany=NA,i.addIssueTypeFields=iw,i.addIssueTypeFieldsAttachment=MA,i.addIssueTypeFieldsAttachments=vA,i.addIssueTypeFieldsMany=nw,i.addIssueTypeIdentifier=vw,i.addIssueTypeIdentifierValue=Nw,i.addIssueTypeIdentifierValues=Hw,i.addIssueTypeIdentifiers=Ew,i.addIssueTypeStatus=AP,i.addIssueTypeStatuses=wP,i.addIssueTypes=aP,i.addIssueUpdate=ma,i.addIssueUpdates=fa,i.addIssues=Qn,i.addOrganization=ST,i.addOrganizationAccess=XP,i.addOrganizationAccesses=xP,i.addOrganizations=yT,i.addProcedure=DO,i.addProcedureStep=Z_,i.addProcedureStepAssignee=YO,i.addProcedureStepAssignees=QO,i.addProcedureStepComment=dI,i.addProcedureStepComments=lI,i.addProcedureStepDefaultAssignee=OI,i.addProcedureStepDefaultAssignees=II,i.addProcedureStepDefaultReviewer=WI,i.addProcedureStepDefaultReviewers=zI,i.addProcedureStepEvent=JI,i.addProcedureStepEvents=ZI,i.addProcedureStepFieldValues=QF,i.addProcedureStepFieldValuesAttachment=WF,i.addProcedureStepFieldValuesAttachments=Xa,i.addProcedureStepFieldValuesMany=JF,i.addProcedureStepFieldValuesReview=O_,i.addProcedureStepFieldValuesReviewRequest=l_,i.addProcedureStepFieldValuesReviewRequests=ic,i.addProcedureStepFieldValuesReviews=cc,i.addProcedureStepFields=IF,i.addProcedureStepFieldsAttachment=uF,i.addProcedureStepFieldsAttachments=Ga,i.addProcedureStepFieldsMany=FF,i.addProcedureStepReviewer=D_,i.addProcedureStepReviewers=W_,i.addProcedureSteps=X_,i.addProcedureType=uR,i.addProcedureTypeFieldValues=Jg,i.addProcedureTypeFieldValuesAttachment=zg,i.addProcedureTypeFieldValuesAttachments=Sc,i.addProcedureTypeFieldValuesMany=Zg,i.addProcedureTypeFields=Ig,i.addProcedureTypeFieldsAttachment=lg,i.addProcedureTypeFieldsAttachments=ug,i.addProcedureTypeFieldsMany=Fg,i.addProcedureTypes=oR,i.addProcedures=Wa,i.addProject=FO,i.addProjectAccess=kT,i.addProjectAccesses=BT,i.addProjectAttachment=GT,i.addProjectAttachments=KT,i.addProjectFile=dO,i.addProjectFiles=lO,i.addProjects=IO,i.addTeam=jR,i.addTeamMembership=_R,i.addTeamMemberships=gR,i.addTeams=$R,i.addUser=Ia,i.addUsers=LP,i.addWorkflow=tb,i.addWorkflowIssueLink=Sb,i.addWorkflowIssueLinks=hs,i.addWorkflowStep=VE,i.addWorkflowStepAssignee=vb,i.addWorkflowStepAssignees=Eb,i.addWorkflowStepComment=Nb,i.addWorkflowStepComments=Hb,i.addWorkflowStepDefaultAssignee=nM,i.addWorkflowStepDefaultAssignees=aM,i.addWorkflowStepDefaultReviewer=AM,i.addWorkflowStepDefaultReviewers=wM,i.addWorkflowStepEvent=VM,i.addWorkflowStepEvents=kM,i.addWorkflowStepFieldValues=Vv,i.addWorkflowStepFieldValuesAttachment=wv,i.addWorkflowStepFieldValuesAttachments=$c,i.addWorkflowStepFieldValuesMany=kv,i.addWorkflowStepFieldValuesReview=aE,i.addWorkflowStepFieldValuesReviewRequest=Gv,i.addWorkflowStepFieldValuesReviewRequests=Hc,i.addWorkflowStepFieldValuesReviews=Yc,i.addWorkflowStepFields=av,i.addWorkflowStepFieldsAttachment=GM,i.addWorkflowStepFieldsAttachments=Dc,i.addWorkflowStepFieldsMany=cv,i.addWorkflowStepReviewer=AE,i.addWorkflowStepReviewers=wE,i.addWorkflowSteps=kE,i.addWorkflowType=GE,i.addWorkflowTypes=KE,i.addWorkflows=sb,i.agentsReducer=jr,i.agentsSlice=ii,i.areArraysEqual=KV,i.assetAttachmentReducer=Xr,i.assetAttachmentSlice=ai,i.assetProcedureReducer=Ol,i.assetProcedureSlice=wi,i.assetProcedureStepFieldValuesAttachmentReducer=gu,i.assetProcedureStepFieldValuesAttachmentSlice=bi,i.assetProcedureStepFieldValuesReducer=$u,i.assetProcedureStepFieldValuesSlice=Vi,i.assetProcedureStepFieldsAttachmentReducer=eu,i.assetProcedureStepFieldsAttachmentSlice=Fi,i.assetProcedureStepFieldsReducer=pu,i.assetProcedureStepFieldsSlice=gi,i.assetProcedureStepReducer=Zu,i.assetProcedureStepSlice=ki,i.assetProcedureTypeAttachmentReducer=ld,i.assetProcedureTypeAttachmentSlice=li,i.assetProcedureTypeFieldValuesAttachmentReducer=Qd,i.assetProcedureTypeFieldValuesAttachmentSlice=yi,i.assetProcedureTypeFieldValuesReducer=ul,i.assetProcedureTypeFieldValuesSlice=Ai,i.assetProcedureTypeFieldsAttachmentReducer=Id,i.assetProcedureTypeFieldsAttachmentSlice=oi,i.assetProcedureTypeFieldsReducer=zd,i.assetProcedureTypeFieldsSlice=pi,i.assetProcedureTypeReducer=zl,i.assetProcedureTypeSlice=Oi,i.assetReducer=yo,i.assetSlice=Di,i.assetStageCompletionReducer=_o,i.assetStageCompletionSlice=qi,i.assetStageReducer=$o,i.assetStageSlice=ji,i.assetTypeAttachmentReducer=th,i.assetTypeAttachmentSlice=Ui,i.assetTypeFieldValuesAttachmentReducer=Uh,i.assetTypeFieldValuesAttachmentSlice=Qi,i.assetTypeFieldValuesReducer=sp,i.assetTypeFieldValuesSlice=xi,i.assetTypeFieldsAttachmentReducer=Sh,i.assetTypeFieldsAttachmentSlice=Gi,i.assetTypeFieldsReducer=Mh,i.assetTypeFieldsSlice=Yi,i.assetTypeIdentifierReducer=mp,i.assetTypeIdentifierSlice=en,i.assetTypeIdentifierValueReducer=vp,i.assetTypeIdentifierValueSlice=sn,i.assetTypeReducer=Np,i.assetTypeSlice=nn,i.assetTypeStatusReducer=ny,i.assetTypeStatusSlice=cn,i.assetTypeStatusSortFn=br,i.authReducer=ry,i.authSlice=vs,i.baseReducer=dW,i.baseReducers=tr,i.clearTokens=Xk,i.createModelAdapter=O,i.createOfflineAction=_T,i.createPayload=R,i.createSelectionAdapter=NV,i.deleteAsset=co,i.deleteAssetAttachment=Kr,i.deleteAssetAttachments=ri,i.deleteAssetProcedure=wl,i.deleteAssetProcedureStep=Qu,i.deleteAssetProcedureStepFieldValues=Du,i.deleteAssetProcedureStepFieldValuesAttachment=Tu,i.deleteAssetProcedureStepFieldValuesAttachments=vi,i.deleteAssetProcedureStepFieldValuesMany=Wu,i.deleteAssetProcedureStepFields=lu,i.deleteAssetProcedureStepFieldsAttachment=Ql,i.deleteAssetProcedureStepFieldsAttachments=Jl,i.deleteAssetProcedureStepFieldsMany=uu,i.deleteAssetProcedureSteps=Ju,i.deleteAssetProcedureType=kl,i.deleteAssetProcedureTypeAttachment=rd,i.deleteAssetProcedureTypeAttachments=dd,i.deleteAssetProcedureTypeFieldValues=dl,i.deleteAssetProcedureTypeFieldValuesAttachment=Yd,i.deleteAssetProcedureTypeFieldValuesAttachments=mi,i.deleteAssetProcedureTypeFieldValuesMany=ll,i.deleteAssetProcedureTypeFields=Dd,i.deleteAssetProcedureTypeFieldsAttachment=Td,i.deleteAssetProcedureTypeFieldsAttachments=Od,i.deleteAssetProcedureTypeFieldsMany=Wd,i.deleteAssetProcedureTypes=Bl,i.deleteAssetProcedures=Ti,i.deleteAssetStage=qo,i.deleteAssetStageCompletion=Io,i.deleteAssetStageCompletions=Fo,i.deleteAssetStages=jo,i.deleteAssetType=jp,i.deleteAssetTypeAttachment=Jo,i.deleteAssetTypeAttachments=Ni,i.deleteAssetTypeFieldValues=Zh,i.deleteAssetTypeFieldValuesAttachment=zh,i.deleteAssetTypeFieldValuesAttachments=Zi,i.deleteAssetTypeFieldValuesMany=Xh,i.deleteAssetTypeFields=Fh,i.deleteAssetTypeFieldsAttachment=uh,i.deleteAssetTypeFieldsAttachments=oh,i.deleteAssetTypeFieldsMany=_h,i.deleteAssetTypeIdentifier=op,i.deleteAssetTypeIdentifierValue=_p,i.deleteAssetTypeIdentifierValues=gp,i.deleteAssetTypeIdentifiers=hp,i.deleteAssetTypeStatus=xp,i.deleteAssetTypeStatuses=ey,i.deleteAssetTypes=$p,i.deleteAssets=zi,i.deleteConversation=fk,i.deleteConversations=Ak,i.deleteDocument=vy,i.deleteDocumentAttachment=my,i.deleteDocumentAttachments=fy,i.deleteDocuments=Ey,i.deleteEmailDomain=Ny,i.deleteEmailDomains=Hy,i.deleteForm=am,i.deleteFormIdentifier=rS,i.deleteFormIdentifierValue=TS,i.deleteFormIdentifierValues=OS,i.deleteFormIdentifiers=dS,i.deleteFormRevision=On,i.deleteFormRevisionAttachment=DS,i.deleteFormRevisionAttachments=WS,i.deleteFormRevisions=In,i.deleteFormSubmission=vm,i.deleteFormSubmissionAttachment=Am,i.deleteFormSubmissionAttachments=Mn,i.deleteFormSubmissions=Dn,i.deleteForms=cm,i.deleteGeoImage=Nm,i.deleteGeoImages=Hm,i.deleteIssue=rA,i.deleteIssueAssociation=nf,i.deleteIssueAssociations=jt,i.deleteIssueAttachment=Tf,i.deleteIssueAttachments=Un,i.deleteIssueComment=Qf,i.deleteIssueCommentAttachment=Df,i.deleteIssueCommentAttachments=Wf,i.deleteIssueComments=Jf,i.deleteIssueType=uP,i.deleteIssueTypeAttachment=TA,i.deleteIssueTypeAttachments=OA,i.deleteIssueTypeFieldValues=QA,i.deleteIssueTypeFieldValuesAttachment=Ow,i.deleteIssueTypeFieldValuesAttachments=aa,i.deleteIssueTypeFieldValuesMany=JA,i.deleteIssueTypeFields=lw,i.deleteIssueTypeFieldsAttachment=DA,i.deleteIssueTypeFieldsAttachments=WA,i.deleteIssueTypeFieldsMany=uw,i.deleteIssueTypeIdentifier=Ww,i.deleteIssueTypeIdentifierValue=Jw,i.deleteIssueTypeIdentifierValues=Zw,i.deleteIssueTypeIdentifiers=zw,i.deleteIssueTypeStatus=FP,i.deleteIssueTypeStatuses=_P,i.deleteIssueTypes=oP,i.deleteIssueUpdate=Aa,i.deleteIssueUpdates=wa,i.deleteIssues=Jn,i.deleteOrganization=AT,i.deleteOrganizationAccess=nT,i.deleteOrganizationAccesses=aT,i.deleteOrganizations=wT,i.deleteProcedure=$O,i.deleteProcedureStep=tg,i.deleteProcedureStepAssignee=eI,i.deleteProcedureStepAssignees=tI,i.deleteProcedureStepComment=yI,i.deleteProcedureStepComments=SI,i.deleteProcedureStepDefaultAssignee=bI,i.deleteProcedureStepDefaultAssignees=MI,i.deleteProcedureStepDefaultReviewer=UI,i.deleteProcedureStepDefaultReviewers=LI,i.deleteProcedureStepEvent=sF,i.deleteProcedureStepEvents=iF,i.deleteProcedureStepFieldValues=t_,i.deleteProcedureStepFieldValuesAttachment=CF,i.deleteProcedureStepFieldValuesAttachments=xa,i.deleteProcedureStepFieldValuesMany=s_,i.deleteProcedureStepFieldValuesReview=R_,i.deleteProcedureStepFieldValuesReviewRequest=y_,i.deleteProcedureStepFieldValuesReviewRequests=nc,i.deleteProcedureStepFieldValuesReviews=rc,i.deleteProcedureStepFields=MF,i.deleteProcedureStepFieldsAttachment=SF,i.deleteProcedureStepFieldsAttachments=Ka,i.deleteProcedureStepFieldsMany=vF,i.deleteProcedureStepReviewer=C_,i.deleteProcedureStepReviewers=U_,i.deleteProcedureSteps=sg,i.deleteProcedureType=mR,i.deleteProcedureTypeFieldValues=sR,i.deleteProcedureTypeFieldValuesAttachment=Ug,i.deleteProcedureTypeFieldValuesAttachments=mc,i.deleteProcedureTypeFieldValuesMany=iR,i.deleteProcedureTypeFields=Mg,i.deleteProcedureTypeFieldsAttachment=Sg,i.deleteProcedureTypeFieldsAttachments=mg,i.deleteProcedureTypeFieldsMany=vg,i.deleteProcedureTypes=fR,i.deleteProcedures=za,i.deleteProject=RO,i.deleteProjectAccess=jT,i.deleteProjectAccesses=$T,i.deleteProjectAttachment=XT,i.deleteProjectAttachments=xT,i.deleteProjectFile=hO,i.deleteProjectFiles=pO,i.deleteProjects=bO,i.deleteTeam=HR,i.deleteTeamMembership=ER,i.deleteTeamMemberships=VR,i.deleteTeams=GR,i.deleteUser=Fa,i.deleteUsers=GP,i.deleteWorkflow=rb,i.deleteWorkflowIssueLink=Pb,i.deleteWorkflowIssueLinks=ps,i.deleteWorkflowStep=qE,i.deleteWorkflowStepAssignee=Wb,i.deleteWorkflowStepAssignees=zb,i.deleteWorkflowStepComment=Jb,i.deleteWorkflowStepComments=Zb,i.deleteWorkflowStepDefaultAssignee=uM,i.deleteWorkflowStepDefaultAssignees=oM,i.deleteWorkflowStepDefaultReviewer=FM,i.deleteWorkflowStepDefaultReviewers=_M,i.deleteWorkflowStepEvent=qM,i.deleteWorkflowStepEvents=jM,i.deleteWorkflowStepFieldValues=qv,i.deleteWorkflowStepFieldValuesAttachment=Fv,i.deleteWorkflowStepFieldValuesAttachments=Cc,i.deleteWorkflowStepFieldValuesMany=jv,i.deleteWorkflowStepFieldValuesReview=uE,i.deleteWorkflowStepFieldValuesReviewRequest=Zv,i.deleteWorkflowStepFieldValuesReviewRequests=Gc,i.deleteWorkflowStepFieldValuesReviews=Qc,i.deleteWorkflowStepFields=ov,i.deleteWorkflowStepFieldsAttachment=ZM,i.deleteWorkflowStepFieldsAttachments=Wc,i.deleteWorkflowStepFieldsMany=hv,i.deleteWorkflowStepReviewer=FE,i.deleteWorkflowStepReviewers=_E,i.deleteWorkflowSteps=jE,i.deleteWorkflowType=XE,i.deleteWorkflowTypes=xE,i.deleteWorkflows=db,i.dequeue=yV,i.discard=mV,i.documentAttachmentReducer=Ty,i.documentAttachmentSlice=dn,i.documentSlice=un,i.documentsReducer=Vy,i.downloadFile=tk,i.emailDomainsReducer=Qy,i.emailDomainsSlice=hn,i.emailRegex=lk,i.enqueue=pV,i.enqueueRequest=RT,i.extractResponseFromError=AV,i.fallbackToEmptyArray=A,i.fallbackToEmptyObject=ss,i.fetchBlobFromObjectUrl=Tr,i.fetchFileFromObjectUrl=Or,i.fileReducer=Xy,i.fileSlice=yn,i.formIdentifierReducer=hS,i.formIdentifierSlice=Sn,i.formIdentifierValueReducer=gS,i.formIdentifierValueSlice=fn,i.formReducer=rm,i.formRevisionAttachmentReducer=$S,i.formRevisionAttachmentSlice=An,i.formRevisionReducer=JS,i.formRevisionsSlice=wn,i.formSlice=_n,i.formSubmissionAttachmentReducer=Om,i.formSubmissionAttachmentSlice=Rn,i.formSubmissionReducer=Dm,i.formSubmissionSlice=kn,i.geoImageReducer=Qm,i.geoImageSlice=zn,i.getAssetProcedureStepSubTree=Rr,i.getAssetProcedureStepTrees=uk,i.getClientSDK=FV,i.getClientStore=Xt,i.getDocumentSubTree=Er,i.getDocumentTrees=ok,i.getFileExtension=Pr,i.getLocalDateString=wr,i.getLocalRelativeDateString=ZV,i.getOutboxCoordinator=Ut,i.getProcedureStepSubTree=kr,i.getProcedureStepTrees=hk,i.getRenamedFile=ek,i.getRequestDescription=w,i.getS3FileKey=xV,i.hashFile=Ps,i.initSDK=fq,i.initializeAssetAttachments=Cr,i.initializeAssetProcedureStepFieldValues=bu,i.initializeAssetProcedureStepFieldValuesAttachments=Su,i.initializeAssetProcedureStepFields=su,i.initializeAssetProcedureStepFieldsAttachments=Ul,i.initializeAssetProcedureSteps=Uu,i.initializeAssetProcedureTypeAttachments=ed,i.initializeAssetProcedureTypeFieldValues=tl,i.initializeAssetProcedureTypeFieldValuesAttachments=Ud,i.initializeAssetProcedureTypeFields=bd,i.initializeAssetProcedureTypeFieldsAttachments=yd,i.initializeAssetProcedureTypes=bl,i.initializeAssetProcedures=Sl,i.initializeAssetStageCompletions=mo,i.initializeAssetStages=Eo,i.initializeAssetTypeAttachments=No,i.initializeAssetTypeFieldValues=Nh,i.initializeAssetTypeFieldValuesAttachments=Eh,i.initializeAssetTypeFields=fh,i.initializeAssetTypeFieldsAttachments=ih,i.initializeAssetTypeIdentifierValues=Ap,i.initializeAssetTypeIdentifiers=np,i.initializeAssetTypeStatuses=Gp,i.initializeAssetTypes=Vp,i.initializeAssets=so,i.initializeConversations=Dr,i.initializeDocumentAttachments=ly,i.initializeDocuments=Iy,i.initializeEmailDomains=zy,i.initializeFormIdentifierValues=yS,i.initializeFormIdentifiers=eS,i.initializeFormRevisionAttachments=bS,i.initializeFormRevisions=US,i.initializeFormSubmissionAttachments=hm,i.initializeFormSubmissions=Fm,i.initializeForms=XS,i.initializeGeoImages=zm,i.initializeIssueAssociations=Zm,i.initializeIssueAttachments=Sf,i.initializeIssueCommentAttachments=bf,i.initializeIssueComments=Uf,i.initializeIssueTypeAttachments=yA,i.initializeIssueTypeFieldValues=UA,i.initializeIssueTypeFieldValuesAttachments=mw,i.initializeIssueTypeFields=sw,i.initializeIssueTypeFieldsAttachments=bA,i.initializeIssueTypeIdentifierValues=Lw,i.initializeIssueTypeIdentifiers=Mw,i.initializeIssueTypeStatuses=fP,i.initializeIssueTypes=iP,i.initializeIssueUpdates=vP,i.initializeIssues=tA,i.initializeOrganizationAccesses=ZP,i.initializeOrganizations=oT,i.initializeProcedureStepAssignees=KO,i.initializeProcedureStepComments=rI,i.initializeProcedureStepDefaultAssignees=TI,i.initializeProcedureStepDefaultReviewers=DI,i.initializeProcedureStepEvents=QI,i.initializeProcedureStepFieldValues=YF,i.initializeProcedureStepFieldValuesAttachments=DF,i.initializeProcedureStepFieldValuesReviewRequests=d_,i.initializeProcedureStepFieldValuesReviews=T_,i.initializeProcedureStepFields=OF,i.initializeProcedureStepFieldsAttachments=lF,i.initializeProcedureStepReviewers=B_,i.initializeProcedureSteps=Y_,i.initializeProcedureTypeFieldValues=Qg,i.initializeProcedureTypeFieldValuesAttachments=Wg,i.initializeProcedureTypeFields=Og,i.initializeProcedureTypeFieldsAttachments=dg,i.initializeProcedureTypes=lR,i.initializeProcedures=BO,i.initializeProjectAccesses=VT,i.initializeProjectAttachments=HT,i.initializeProjectFiles=aO,i.initializeProjects=PO,i.initializeTeamMemberships=FR,i.initializeTeams=qR,i.initializeUsers=$P,i.initializeWorkflowIssueLinks=yb,i.initializeWorkflowStepAssignees=Mb,i.initializeWorkflowStepComments=Lb,i.initializeWorkflowStepDefaultAssignees=iM,i.initializeWorkflowStepDefaultReviewers=fM,i.initializeWorkflowStepEvents=EM,i.initializeWorkflowStepFieldValues=Ev,i.initializeWorkflowStepFieldValuesAttachments=Av,i.initializeWorkflowStepFieldValuesReviewRequests=Hv,i.initializeWorkflowStepFieldValuesReviews=nE,i.initializeWorkflowStepFields=nv,i.initializeWorkflowStepFieldsAttachments=HM,i.initializeWorkflowStepReviewers=fE,i.initializeWorkflowSteps=EE,i.initializeWorkflowTypes=HE,i.initializeWorkflows=eb,i.isImageFile=sk,i.isObjectUrl=Ir,i.isToday=JV,i.issueAssociationReducer=pf,i.issueAssociationSlice=jn,i.issueAttachmentReducer=gf,i.issueAttachmentSlice=$n,i.issueCommentAttachmentReducer=$f,i.issueCommentAttachmentSlice=Nn,i.issueCommentReducer=xf,i.issueCommentSlice=Gn,i.issueReducer=hA,i.issueSlice=Yn,i.issueTypeAttachmentReducer=gA,i.issueTypeAttachmentSlice=Zn,i.issueTypeFieldValuesAttachmentReducer=Rw,i.issueTypeFieldValuesAttachmentSlice=ia,i.issueTypeFieldValuesReducer=ew,i.issueTypeFieldValuesSlice=ta,i.issueTypeFieldsAttachmentReducer=$A,i.issueTypeFieldsAttachmentSlice=xn,i.issueTypeFieldsReducer=yw,i.issueTypeFieldsSlice=sa,i.issueTypeIdentifierReducer=Cw,i.issueTypeIdentifierSlice=ra,i.issueTypeIdentifierValueReducer=tP,i.issueTypeIdentifierValueSlice=la,i.issueTypeReducer=SP,i.issueTypeSlice=ua,i.issueTypeStatusReducer=bP,i.issueTypeStatusSlice=ha,i.issueTypeStatusSortFn=Mr,i.issueUpdateReducer=qP,i.issueUpdateSlice=Sa,i.logOnlyOnce=ik,i.markAsDeleted=bT,i.markForDeletion=DB,i.memoize=ei,i.organizationAccessReducer=cT,i.organizationAccessSlice=ga,i.organizationReducer=FT,i.organizationSlice=Ra,i.outboxReducer=vT,i.outboxSlice=ba,i.overmapEnhancer=fW,i.overmapReducer=lW,i.overmapReducers=nV,i.performRequest=nr,i.performRequestFromAction=SV,i.procedureReducer=CO,i.procedureSlice=Da,i.procedureStepAssigneeReducer=aI,i.procedureStepAssigneeSlice=qa,i.procedureStepCommentReducer=wI,i.procedureStepCommentSlice=ja,i.procedureStepDefaultAssigneeReducer=kI,i.procedureStepDefaultAssigneeSlice=$a,i.procedureStepDefaultReviewerReducer=KI,i.procedureStepDefaultReviewerSlice=Ua,i.procedureStepEventReducer=rF,i.procedureStepEventSlice=Na,i.procedureStepFieldValuesAttachmentReducer=GF,i.procedureStepFieldValuesAttachmentSlice=Za,i.procedureStepFieldValuesReducer=c_,i.procedureStepFieldValuesReviewReducer=V_,i.procedureStepFieldValuesReviewRequestReducer=w_,i.procedureStepFieldValuesReviewRequestSlice=sc,i.procedureStepFieldValuesReviewSlice=ac,i.procedureStepFieldValuesSlice=tc,i.procedureStepFieldsAttachmentReducer=PF,i.procedureStepFieldsAttachmentSlice=Ha,i.procedureStepFieldsReducer=kF,i.procedureStepFieldsSlice=Qa,i.procedureStepReducer=ig,i.procedureStepReviewerReducer=G_,i.procedureStepReviewerSlice=dc,i.procedureStepSlice=lc,i.procedureTypeFieldValuesAttachmentReducer=Lg,i.procedureTypeFieldValuesAttachmentSlice=yc,i.procedureTypeFieldValuesReducer=nR,i.procedureTypeFieldValuesSlice=Ac,i.procedureTypeFieldsAttachmentReducer=fg,i.procedureTypeFieldsAttachmentSlice=oc,i.procedureTypeFieldsReducer=Eg,i.procedureTypeFieldsSlice=pc,i.procedureTypeReducer=AR,i.procedureTypeSlice=Pc,i.projectAccessReducer=CT,i.projectAccessSlice=Ma,i.projectAttachmentReducer=iO,i.projectAttachmentSlice=Ea,i.projectFileReducer=AO,i.projectFileSlice=ka,i.projectReducer=MO,i.projectSlice=Ba,i.rehydratedReducer=OR,i.rehydratedSlice=Tc,i.restructureSelectorWithArgs=m,i.runMiddleware=bV,i.selectAccessToken=xk,i.selectAccessesByUserOfProject=zB,i.selectAccessibleProjects=$B,i.selectActiveOrganizationAccess=EB,i.selectAllDocumentAttachments=ln,i.selectAssetAttachmentById=Qr,i.selectAssetAttachmentMapping=Yr,i.selectAssetAttachments=di,i.selectAssetAttachmentsByIds=Jr,i.selectAssetById=ho,i.selectAssetProcedureById=_l,i.selectAssetProcedureStepById=Xu,i.selectAssetProcedureStepFieldValues=is,i.selectAssetProcedureStepFieldValuesAttachmentById=Iu,i.selectAssetProcedureStepFieldValuesAttachments=Ei,i.selectAssetProcedureStepFieldValuesAttachmentsByIds=Fu,i.selectAssetProcedureStepFieldValuesAttachmentsMapping=Ou,i.selectAssetProcedureStepFieldValuesById=qu,i.selectAssetProcedureStepFieldValuesByIds=ju,i.selectAssetProcedureStepFieldValuesMapping=zu,i.selectAssetProcedureStepFieldValuesOfAsset=kk,i.selectAssetProcedureStepFieldValuesOfAssetProcedure=Bk,i.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=Dk,i.selectAssetProcedureStepFields=_s,i.selectAssetProcedureStepFieldsAttachmentById=Xl,i.selectAssetProcedureStepFieldsAttachments=_i,i.selectAssetProcedureStepFieldsAttachmentsByIds=xl,i.selectAssetProcedureStepFieldsAttachmentsMapping=Zl,i.selectAssetProcedureStepFieldsById=ou,i.selectAssetProcedureStepFieldsByIds=hu,i.selectAssetProcedureStepFieldsMapping=Ri,i.selectAssetProcedureStepFieldsOfAssetProcedureStep=vk,i.selectAssetProcedureStepMapping=gs,i.selectAssetProcedureSteps=Bi,i.selectAssetProcedureStepsByIds=xu,i.selectAssetProcedureStepsMappingOfAssetProcedureType=Wk,i.selectAssetProcedureStepsOfAssetProcedureType=zk,i.selectAssetProcedureTypeAttachmentById=od,i.selectAssetProcedureTypeAttachmentMapping=ud,i.selectAssetProcedureTypeAttachments=ui,i.selectAssetProcedureTypeAttachmentsByIds=hd,i.selectAssetProcedureTypeById=jl,i.selectAssetProcedureTypeFieldValues=Is,i.selectAssetProcedureTypeFieldValuesAttachmentById=Zd,i.selectAssetProcedureTypeFieldValuesAttachments=fi,i.selectAssetProcedureTypeFieldValuesAttachmentsByIds=Xd,i.selectAssetProcedureTypeFieldValuesAttachmentsMapping=Jd,i.selectAssetProcedureTypeFieldValuesById=hl,i.selectAssetProcedureTypeFieldValuesByIds=pl,i.selectAssetProcedureTypeFieldValuesMapping=ol,i.selectAssetProcedureTypeFieldValuesOfAsset=_k,i.selectAssetProcedureTypeFields=Os,i.selectAssetProcedureTypeFieldsAttachmentById=_d,i.selectAssetProcedureTypeFieldsAttachments=hi,i.selectAssetProcedureTypeFieldsAttachmentsByIds=gd,i.selectAssetProcedureTypeFieldsAttachmentsMapping=Fd,i.selectAssetProcedureTypeFieldsById=jd,i.selectAssetProcedureTypeFieldsByIds=$d,i.selectAssetProcedureTypeFieldsMapping=qd,i.selectAssetProcedureTypeFieldsOfAssetProcedureType=Ik,i.selectAssetProcedureTypes=Ii,i.selectAssetProcedureTypesByIds=$l,i.selectAssetProcedureTypesMapping=ql,i.selectAssetProcedureTypesOfOrganization=bk,i.selectAssetProcedures=Fs,i.selectAssetProceduresByIds=gl,i.selectAssetProceduresMapping=Il,i.selectAssetProceduresOfAssetProcedureType=Fl,i.selectAssetProceduresOfAssetType=Rk,i.selectAssetStageById=Co,i.selectAssetStageCompletionById=bo,i.selectAssetStageCompletionMapping=go,i.selectAssetStageCompletions=Ro,i.selectAssetStageCompletionsByIds=Mo,i.selectAssetStages=Ci,i.selectAssetStagesByIds=Uo,i.selectAssetStagesMappingOfAssetProcedureType=jk,i.selectAssetStagesOfAssetProcedureType=$k,i.selectAssetTypeAttachmentById=Xo,i.selectAssetTypeAttachmentMapping=Zo,i.selectAssetTypeAttachments=Hi,i.selectAssetTypeAttachmentsByIds=xo,i.selectAssetTypeById=Up,i.selectAssetTypeFieldValues=bs,i.selectAssetTypeFieldValuesAttachmentById=jh,i.selectAssetTypeFieldValuesAttachments=Xi,i.selectAssetTypeFieldValuesAttachmentsByIds=$h,i.selectAssetTypeFieldValuesAttachmentsMapping=qh,i.selectAssetTypeFieldValuesById=ep,i.selectAssetTypeFieldValuesByIds=tp,i.selectAssetTypeFieldValuesMapping=xh,i.selectAssetTypeFieldValuesOfAsset=Nk,i.selectAssetTypeFields=ns,i.selectAssetTypeFieldsAttachmentById=ph,i.selectAssetTypeFieldsAttachments=Ki,i.selectAssetTypeFieldsAttachmentsByIds=yh,i.selectAssetTypeFieldsAttachmentsMapping=hh,i.selectAssetTypeFieldsById=Rh,i.selectAssetTypeFieldsByIds=bh,i.selectAssetTypeFieldsMapping=gh,i.selectAssetTypeFieldsOfAssetType=Uk,i.selectAssetTypeIdentifierById=yp,i.selectAssetTypeIdentifierMapping=pp,i.selectAssetTypeIdentifierValueById=bp,i.selectAssetTypeIdentifierValueMapping=Rp,i.selectAssetTypeIdentifierValues=Ms,i.selectAssetTypeIdentifierValuesByIds=Mp,i.selectAssetTypeIdentifierValuesOfAsset=Kk,i.selectAssetTypeIdentifierValuesOfIdentifier=Yk,i.selectAssetTypeIdentifiers=tn,i.selectAssetTypeIdentifiersByIds=Sp,i.selectAssetTypeIdentifiersOfAssetType=Gk,i.selectAssetTypeStatusById=sy,i.selectAssetTypeStatusMapping=ty,i.selectAssetTypeStatuses=rn,i.selectAssetTypeStatusesByIds=iy,i.selectAssetTypeStatusesOfAssetType=Jk,i.selectAssetTypeValuesOfAssetType=Hk,i.selectAssetTypes=an,i.selectAssetTypesByIds=Lp,i.selectAssetTypesMapping=Cp,i.selectAssetTypesOfOrganization=Qk,i.selectAssets=Rs,i.selectAssetsByIds=po,i.selectAssetsMapping=uo,i.selectAssetsOfAssetType=oo,i.selectAssetsOfProject=qk,i.selectAttachmentsOfAsset=Zr,i.selectAttachmentsOfAssetProcedureStepFieldValues=_u,i.selectAttachmentsOfAssetProcedureStepFields=Mk,i.selectAttachmentsOfAssetProcedureType=Tk,i.selectAttachmentsOfAssetProcedureTypeFieldValues=xd,i.selectAttachmentsOfAssetProcedureTypeFields=Ok,i.selectAttachmentsOfAssetType=eh,i.selectAttachmentsOfAssetTypeFieldValues=Ch,i.selectAttachmentsOfAssetTypeFields=Ck,i.selectAttachmentsOfDocument=tB,i.selectAttachmentsOfFormRevision=oB,i.selectAttachmentsOfFormSubmission=Tm,i.selectAttachmentsOfIssue=If,i.selectAttachmentsOfIssueComment=SB,i.selectAttachmentsOfIssueType=AB,i.selectAttachmentsOfIssueTypeFieldValues=gw,i.selectAttachmentsOfIssueTypeFields=wB,i.selectAttachmentsOfProcedureStepFieldValues=HF,i.selectAttachmentsOfProcedureStepFields=fF,i.selectAttachmentsOfProcedureTypeFieldValues=Kg,i.selectAttachmentsOfProcedureTypeFields=wD,i.selectAttachmentsOfProject=jB,i.selectAttachmentsOfWorkflowStepFieldValues=bv,i.selectAttachmentsOfWorkflowStepFields=xM,i.selectCommentsOfIssue=mB,i.selectConversation=Pk,i.selectConversationMapping=ni,i.selectConversations=wk,i.selectCurrentUser=YP,i.selectDeletedRequests=kB,i.selectDescendantsOfAssetProcedureStep=eo,i.selectDescendantsOfDocument=Dy,i.selectDescendantsOfProcedureStep=cg,i.selectDocumentAttachmentById=wy,i.selectDocumentAttachmentMapping=Ay,i.selectDocumentAttachmentsByIds=Py,i.selectDocumentById=ky,i.selectDocuments=Es,i.selectDocumentsByIds=By,i.selectDocumentsMapping=on,i.selectEmailDomainById=Ky,i.selectEmailDomains=pn,i.selectEmailDomainsAsMapping=Gy,i.selectEmailDomainsByIds=Yy,i.selectEmailDomainsOfOrganization=nB,i.selectFieldValuesOfAssetProcedure=gk,i.selectFieldValuesOfProcedure=OD,i.selectFormById=lm,i.selectFormIdentifierById=uS,i.selectFormIdentifierMapping=lS,i.selectFormIdentifierValueById=FS,i.selectFormIdentifierValueMapping=IS,i.selectFormIdentifierValues=Vs,i.selectFormIdentifierValuesByIds=_S,i.selectFormIdentifierValuesOfFormSubmission=lB,i.selectFormIdentifierValuesOfIdentifier=uB,i.selectFormIdentifiers=mn,i.selectFormIdentifiersByIds=oS,i.selectFormIdentifiersOfForm=dB,i.selectFormMapping=dm,i.selectFormRevisionAttachmentById=qS,i.selectFormRevisionAttachments=zS,i.selectFormRevisionAttachmentsByIds=jS,i.selectFormRevisionAttachmentsMapping=ks,i.selectFormRevisionById=KS,i.selectFormRevisionMapping=Fn,i.selectFormRevisions=Bs,i.selectFormRevisionsByIds=YS,i.selectFormRevisionsOfForm=QS,i.selectFormSubmissionAttachemntsByIds=Vn,i.selectFormSubmissionAttachmentById=wm,i.selectFormSubmissionAttachments=En,i.selectFormSubmissionAttachmentsByIds=Pm,i.selectFormSubmissionAttachmentsMapping=vn,i.selectFormSubmissionById=Vm,i.selectFormSubmissions=Em,i.selectFormSubmissionsByIds=km,i.selectFormSubmissionsMapping=Wn,i.selectFormSubmissionsOfForm=Bm,i.selectForms=gn,i.selectFormsByIds=um,i.selectFormsOfOrganization=pB,i.selectGeoImageById=Km,i.selectGeoImageMapping=Gm,i.selectGeoImages=qn,i.selectGeoImagesByIds=Ym,i.selectGeoImagesOfProject=yB,i.selectIsLoggedIn=eB,i.selectIssueAssociationById=cf,i.selectIssueAssociationMapping=af,i.selectIssueAssociations=$t,i.selectIssueAssociationsByIds=rf,i.selectIssueAssociationsOfAsset=hf,i.selectIssueAssociationsOfIssue=of,i.selectIssueAssociationsOfIssues=uf,i.selectIssueAssociationsToIssue=df,i.selectIssueAssociationsToIssues=lf,i.selectIssueAttachmentById=Ff,i.selectIssueAttachmentMapping=Of,i.selectIssueAttachments=Ln,i.selectIssueAttachmentsByIds=_f,i.selectIssueById=lA,i.selectIssueCommentAttachmentById=qf,i.selectIssueCommentAttachmentMapping=zf,i.selectIssueCommentAttachments=Hn,i.selectIssueCommentAttachmentsByIds=jf,i.selectIssueCommentById=Zf,i.selectIssueCommentMapping=Kn,i.selectIssueCommentsByIds=Xf,i.selectIssueMapping=dA,i.selectIssueTypeAttachmentById=FA,i.selectIssueTypeAttachmentMapping=IA,i.selectIssueTypeAttachments=Xn,i.selectIssueTypeAttachmentsByIds=_A,i.selectIssueTypeById=pP,i.selectIssueTypeFieldValues=Ws,i.selectIssueTypeFieldValuesAttachmentById=Fw,i.selectIssueTypeFieldValuesAttachments=ca,i.selectIssueTypeFieldValuesAttachmentsByIds=_w,i.selectIssueTypeFieldValuesAttachmentsMapping=Iw,i.selectIssueTypeFieldValuesById=XA,i.selectIssueTypeFieldValuesByIds=xA,i.selectIssueTypeFieldValuesMapping=ZA,i.selectIssueTypeFieldValuesOfIssue=PB,i.selectIssueTypeFields=as,i.selectIssueTypeFieldsAttachmentById=qA,i.selectIssueTypeFieldsAttachments=ea,i.selectIssueTypeFieldsAttachmentsByIds=jA,i.selectIssueTypeFieldsAttachmentsMapping=zA,i.selectIssueTypeFieldsById=hw,i.selectIssueTypeFieldsByIds=pw,i.selectIssueTypeFieldsMapping=ow,i.selectIssueTypeFieldsOfIssueType=TB,i.selectIssueTypeIdentifierById=jw,i.selectIssueTypeIdentifierMapping=qw,i.selectIssueTypeIdentifierValueById=xw,i.selectIssueTypeIdentifierValueMapping=Xw,i.selectIssueTypeIdentifierValues=zs,i.selectIssueTypeIdentifierValuesByIds=eP,i.selectIssueTypeIdentifierValuesOfIdentifier=gB,i.selectIssueTypeIdentifierValuesOfIssue=_B,i.selectIssueTypeIdentifiers=da,i.selectIssueTypeIdentifiersByIds=$w,i.selectIssueTypeIdentifiersOfIssueType=FB,i.selectIssueTypeMapping=hP,i.selectIssueTypeStatusById=ya,i.selectIssueTypeStatusMapping=gP,i.selectIssueTypeStatuses=pa,i.selectIssueTypeStatusesByIds=RP,i.selectIssueTypeStatusesOfIssueType=bB,i.selectIssueTypeValuesOfIssueType=IB,i.selectIssueTypes=oa,i.selectIssueTypesByIds=yP,i.selectIssueTypesOfOrganization=RB,i.selectIssueUpdateById=DP,i.selectIssueUpdateMapping=Pa,i.selectIssueUpdates=Ta,i.selectIssueUpdatesByIds=WP,i.selectIssueUpdatesOfIssue=zP,i.selectIssues=Ds,i.selectIssuesByIds=uA,i.selectIssuesOfIssueType=oA,i.selectIssuesOfProject=fB,i.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=Ek,i.selectLatestAssetProcedureTypeFieldsOfAssetProcedureType=Fk,i.selectLatestAssetTypeFieldsOfAssetType=Lk,i.selectLatestFieldsByAssetProcedureStep=Vk,i.selectLatestFieldsByProcedureStep=nD,i.selectLatestFormRevisionOfForm=hB,i.selectLatestIssueTypeFieldsOfIssueType=OB,i.selectLatestProcedureStepFieldValuesByProcedureStepOfProcedure=dD,i.selectLatestProcedureStepFieldValuesReviewByProcedureStepFieldValues=pD,i.selectLatestProcedureStepFieldsOfProcedureStep=iD,i.selectLatestProcedureTypeFieldsOfProcedureType=TD,i.selectLatestRetryTime=BB,i.selectLatestReviewOfProcedureStepFieldValues=oD,i.selectLatestReviewOfWorkflowStepFieldValues=eW,i.selectLatestReviewRequestOfProcedureStepFieldValues=lD,i.selectLatestReviewRequestOfWorkflowStepFieldValues=XD,i.selectLatestWorkflowStepFieldValuesByWorkflowStepOfWorkflow=ZD,i.selectLatestWorkflowStepFieldValuesReviewByWorkflowStepFieldValues=sW,i.selectLatestWorkflowStepFieldsOfWorkflowStep=KD,i.selectMembershipsByUserOfTeam=bD,i.selectOrganizationAccessById=rT,i.selectOrganizationAccessMapping=$s,i.selectOrganizationAccessUserMapping=lT,i.selectOrganizationAccessesByIds=dT,i.selectOrganizationById=OT,i.selectOrganizationDocuments=iB,i.selectOrganizations=TT,i.selectOrganizationsByIds=IT,i.selectOrganizationsMapping=PT,i.selectProcedureById=LO,i.selectProcedureStepAssigneeById=iI,i.selectProcedureStepAssignees=rs,i.selectProcedureStepAssigneesByIds=nI,i.selectProcedureStepAssigneesMapping=sI,i.selectProcedureStepAssigneesOfProcedure=HB,i.selectProcedureStepAssigneesOfProcedureAndProcedureStep=KB,i.selectProcedureStepAssigneesOfProcedureStep=GB,i.selectProcedureStepById=ng,i.selectProcedureStepCommentById=fI,i.selectProcedureStepComments=ds,i.selectProcedureStepCommentsByIds=AI,i.selectProcedureStepCommentsMapping=mI,i.selectProcedureStepCommentsOfProcedure=YB,i.selectProcedureStepCommentsOfProcedureAndProcedureStep=JB,i.selectProcedureStepCommentsOfProcedureStep=QB,i.selectProcedureStepDefaultAssigneeById=EI,i.selectProcedureStepDefaultAssignees=Ca,i.selectProcedureStepDefaultAssigneesByIds=VI,i.selectProcedureStepDefaultAssigneesMapping=vI,i.selectProcedureStepDefaultAssigneesOfProcedureStep=ZB,i.selectProcedureStepDefaultReviewerById=HI,i.selectProcedureStepDefaultReviewers=La,i.selectProcedureStepDefaultReviewersByIds=GI,i.selectProcedureStepDefaultReviewersMapping=NI,i.selectProcedureStepDefaultReviewersOfProcedureStep=XB,i.selectProcedureStepEventById=aF,i.selectProcedureStepEvents=ls,i.selectProcedureStepEventsByIds=cF,i.selectProcedureStepEventsMapping=nF,i.selectProcedureStepEventsOfProcedure=xB,i.selectProcedureStepEventsOfProcedureAndProcedureStep=tD,i.selectProcedureStepEventsOfProcedureStep=eD,i.selectProcedureStepFieldValues=Dt,i.selectProcedureStepFieldValuesAttachmentById=LF,i.selectProcedureStepFieldValuesAttachments=ec,i.selectProcedureStepFieldValuesAttachmentsByIds=NF,i.selectProcedureStepFieldValuesAttachmentsMapping=UF,i.selectProcedureStepFieldValuesById=n_,i.selectProcedureStepFieldValuesByIds=a_,i.selectProcedureStepFieldValuesMapping=i_,i.selectProcedureStepFieldValuesOfProcedure=aD,i.selectProcedureStepFieldValuesOfProcedureAndProcedureStep=rD,i.selectProcedureStepFieldValuesOfProcedureStep=cD,i.selectProcedureStepFieldValuesReviewById=M_,i.selectProcedureStepFieldValuesReviewRequestById=m_,i.selectProcedureStepFieldValuesReviewRequests=us,i.selectProcedureStepFieldValuesReviewRequestsByIds=f_,i.selectProcedureStepFieldValuesReviewRequestsMapping=S_,i.selectProcedureStepFieldValuesReviewRequestsOfProcedureAndProcedureStep=uD,i.selectProcedureStepFieldValuesReviews=Kt,i.selectProcedureStepFieldValuesReviewsByIds=v_,i.selectProcedureStepFieldValuesReviewsMapping=b_,i.selectProcedureStepFieldValuesReviewsOfProcedureAndProcedureStep=hD,i.selectProcedureStepFields=Us,i.selectProcedureStepFieldsAttachmentById=AF,i.selectProcedureStepFieldsAttachments=Ya,i.selectProcedureStepFieldsAttachmentsByIds=wF,i.selectProcedureStepFieldsAttachmentsMapping=mF,i.selectProcedureStepFieldsById=EF,i.selectProcedureStepFieldsByIds=VF,i.selectProcedureStepFieldsMapping=Ja,i.selectProcedureStepFieldsOfProcedureStep=sD,i.selectProcedureStepReviewerById=N_,i.selectProcedureStepReviewers=os,i.selectProcedureStepReviewersByIds=H_,i.selectProcedureStepReviewersMapping=L_,i.selectProcedureStepReviewersOfProcedure=yD,i.selectProcedureStepReviewersOfProcedureAndProcedureStep=mD,i.selectProcedureStepReviewersOfProcedureStep=SD,i.selectProcedureSteps=uc,i.selectProcedureStepsByIds=ag,i.selectProcedureStepsMapping=Ls,i.selectProcedureStepsMappingOfProcedureType=fD,i.selectProcedureStepsOfProcedureType=AD,i.selectProcedureTypeById=PR,i.selectProcedureTypeFieldValues=wc,i.selectProcedureTypeFieldValuesAttachmentById=Hg,i.selectProcedureTypeFieldValuesAttachments=fc,i.selectProcedureTypeFieldValuesAttachmentsByIds=Gg,i.selectProcedureTypeFieldValuesAttachmentsMapping=Ng,i.selectProcedureTypeFieldValuesById=cR,i.selectProcedureTypeFieldValuesByIds=rR,i.selectProcedureTypeFieldValuesMapping=aR,i.selectProcedureTypeFields=Ns,i.selectProcedureTypeFieldsAttachmentById=wg,i.selectProcedureTypeFieldsAttachments=hc,i.selectProcedureTypeFieldsAttachmentsByIds=Pg,i.selectProcedureTypeFieldsAttachmentsMapping=Ag,i.selectProcedureTypeFieldsById=kg,i.selectProcedureTypeFieldsByIds=Bg,i.selectProcedureTypeFieldsMapping=Vg,i.selectProcedureTypeFieldsOfProcedureType=PD,i.selectProcedureTypes=Hs,i.selectProcedureTypesByIds=TR,i.selectProcedureTypesMapping=wR,i.selectProcedureTypesOfAssetType=ID,i.selectProcedureTypesOfIssueType=FD,i.selectProcedures=Gt,i.selectProceduresByIds=NO,i.selectProceduresMapping=UO,i.selectProceduresOfAsset=LB,i.selectProceduresOfIssue=NB,i.selectProceduresOfProcedureType=HO,i.selectProceduresOfProject=UB,i.selectProjectAccessById=UT,i.selectProjectAccessMapping=va,i.selectProjectAccesses=cs,i.selectProjectAccessesByIds=LT,i.selectProjectAccessesOfProject=WB,i.selectProjectAttachmentById=tO,i.selectProjectAttachmentMapping=eO,i.selectProjectAttachments=Va,i.selectProjectAttachmentsByIds=sO,i.selectProjectById=EO,i.selectProjectDocuments=sB,i.selectProjectFileById=mO,i.selectProjectFileMapping=yO,i.selectProjectFiles=SO,i.selectProjectFilesByIds=fO,i.selectProjectMapping=vO,i.selectProjects=Cs,i.selectProjectsByIds=VO,i.selectProjectsOfOrganization=CB,i.selectRehydrated=RD,i.selectReviewRequestsOfProcedureStepFieldValues=A_,i.selectReviewRequestsOfWorkflowStepFieldValues=tE,i.selectReviewsOfProcedureStepFieldValues=E_,i.selectReviewsOfWorkflowStepFieldValues=yE,i.selectStageMapping=$i,i.selectTeamById=YR,i.selectTeamMembershipById=DR,i.selectTeamMemberships=Gs,i.selectTeamMembershipsByIds=WR,i.selectTeamMembershipsMapping=BR,i.selectTeams=Fc,i.selectTeamsByIds=QR,i.selectTeamsMapping=KR,i.selectTeamsOfOrganization=vD,i.selectUploadUrl=rB,i.selectUserById=js,i.selectUsers=qs,i.selectUsersByIds=QP,i.selectUsersMapping=_a,i.selectUsersOfOrganization=VB,i.selectUsersOfProject=qB,i.selectUsersOfTeam=MD,i.selectWorkflowById=ub,i.selectWorkflowIssueLinkById=Ob,i.selectWorkflowIssueLinks=Yt,i.selectWorkflowIssueLinksByIds=Ib,i.selectWorkflowIssueLinksMapping=Tb,i.selectWorkflowIssueLinksOfIssue=gb,i.selectWorkflowIssueLinksOfIssues=BD,i.selectWorkflowIssueLinksOfWorkflow=Fb,i.selectWorkflowIssueLinksOfWorkflows=_b,i.selectWorkflowMapping=lb,i.selectWorkflowStepAssigneeById=jb,i.selectWorkflowStepAssignees=ys,i.selectWorkflowStepAssigneesByIds=$b,i.selectWorkflowStepAssigneesMapping=qb,i.selectWorkflowStepAssigneesOfWorkflow=DD,i.selectWorkflowStepAssigneesOfWorkflowAndWorkflowStep=zD,i.selectWorkflowStepAssigneesOfWorkflowStep=WD,i.selectWorkflowStepById=CE,i.selectWorkflowStepCommentById=xb,i.selectWorkflowStepComments=Ss,i.selectWorkflowStepCommentsByIds=eM,i.selectWorkflowStepCommentsMapping=Xb,i.selectWorkflowStepCommentsOfWorkflow=qD,i.selectWorkflowStepCommentsOfWorkflowAndWorkflowStep=$D,i.selectWorkflowStepCommentsOfWorkflowStep=jD,i.selectWorkflowStepDefaultAssigneeById=pM,i.selectWorkflowStepDefaultAssignees=vc,i.selectWorkflowStepDefaultAssigneesByIds=yM,i.selectWorkflowStepDefaultAssigneesMapping=hM,i.selectWorkflowStepDefaultAssigneesOfWorkflowStep=CD,i.selectWorkflowStepDefaultReviewerById=RM,i.selectWorkflowStepDefaultReviewers=Vc,i.selectWorkflowStepDefaultReviewersByIds=bM,i.selectWorkflowStepDefaultReviewersMapping=gM,i.selectWorkflowStepDefaultReviewersOfWorkflowStep=UD,i.selectWorkflowStepEventById=CM,i.selectWorkflowStepEvents=ms,i.selectWorkflowStepEventsByIds=UM,i.selectWorkflowStepEventsMapping=$M,i.selectWorkflowStepEventsOfWorkflow=LD,i.selectWorkflowStepEventsOfWorkflowAndWorkflowStep=HD,i.selectWorkflowStepEventsOfWorkflowStep=ND,i.selectWorkflowStepFieldValues=Wt,i.selectWorkflowStepFieldValuesAttachmentById=gv,i.selectWorkflowStepFieldValuesAttachments=Uc,i.selectWorkflowStepFieldValuesAttachmentsByIds=Rv,i.selectWorkflowStepFieldValuesAttachmentsMapping=_v,i.selectWorkflowStepFieldValuesById=Cv,i.selectWorkflowStepFieldValuesByIds=Uv,i.selectWorkflowStepFieldValuesMapping=$v,i.selectWorkflowStepFieldValuesOfWorkflow=YD,i.selectWorkflowStepFieldValuesOfWorkflowAndWorkflowStep=JD,i.selectWorkflowStepFieldValuesOfWorkflowStep=QD,i.selectWorkflowStepFieldValuesReviewById=hE,i.selectWorkflowStepFieldValuesReviewRequestById=xv,i.selectWorkflowStepFieldValuesReviewRequests=fs,i.selectWorkflowStepFieldValuesReviewRequestsByIds=eE,i.selectWorkflowStepFieldValuesReviewRequestsMapping=Xv,i.selectWorkflowStepFieldValuesReviewRequestsOfWorkflowAndWorkflowStep=xD,i.selectWorkflowStepFieldValuesReviews=Qt,i.selectWorkflowStepFieldValuesReviewsByIds=pE,i.selectWorkflowStepFieldValuesReviewsMapping=oE,i.selectWorkflowStepFieldValuesReviewsOfWorkflowAndWorkflowStep=tW,i.selectWorkflowStepFields=Ys,i.selectWorkflowStepFieldsAttachmentById=ev,i.selectWorkflowStepFieldsAttachments=zc,i.selectWorkflowStepFieldsAttachmentsByIds=tv,i.selectWorkflowStepFieldsAttachmentsMapping=XM,i.selectWorkflowStepFieldsById=yv,i.selectWorkflowStepFieldsByIds=Sv,i.selectWorkflowStepFieldsMapping=pv,i.selectWorkflowStepFieldsOfWorkflowStep=GD,i.selectWorkflowStepReviewerById=RE,i.selectWorkflowStepReviewers=As,i.selectWorkflowStepReviewersByIds=bE,i.selectWorkflowStepReviewersMapping=gE,i.selectWorkflowStepReviewersOfWorkflow=iW,i.selectWorkflowStepReviewersOfWorkflowAndWorkflowStep=aW,i.selectWorkflowStepReviewersOfWorkflowStep=nW,i.selectWorkflowSteps=Xc,i.selectWorkflowStepsByIds=UE,i.selectWorkflowStepsMapping=$E,i.selectWorkflowStepsOfWorkflowType=cW,i.selectWorkflowTypeById=tV,i.selectWorkflowTypeMapping=eV,i.selectWorkflowTypes=er,i.selectWorkflowTypesByIds=sV,i.selectWorkflowTypesOfOrganization=rW,i.selectWorkflows=Ks,i.selectWorkflowsByIds=ob,i.selectWorkflowsOfProject=VD,i.selectWorkflowsOfWorkflowType=kD,i.setAsset=ro,i.setAssetAttachment=Lr,i.setAssetAttachments=Nr,i.setAssetProcedure=Pl,i.setAssetProcedureStep=Lu,i.setAssetProcedureStepFieldValues=Eu,i.setAssetProcedureStepFieldValuesAttachment=fu,i.setAssetProcedureStepFieldValuesAttachments=Au,i.setAssetProcedureStepFieldValuesMany=Vu,i.setAssetProcedureStepFields=au,i.setAssetProcedureStepFieldsAttachment=Hl,i.setAssetProcedureStepFieldsAttachments=Gl,i.setAssetProcedureStepFieldsMany=cu,i.setAssetProcedureSteps=Nu,i.setAssetProcedureType=Dl,i.setAssetProcedureTypeAttachment=id,i.setAssetProcedureTypeAttachments=nd,i.setAssetProcedureTypeFieldValues=nl,i.setAssetProcedureTypeFieldValuesAttachment=Nd,i.setAssetProcedureTypeFieldValuesAttachments=Hd,i.setAssetProcedureTypeFieldValuesMany=al,i.setAssetProcedureTypeFields=Ed,i.setAssetProcedureTypeFieldsAttachment=fd,i.setAssetProcedureTypeFieldsAttachments=Ad,i.setAssetProcedureTypeFieldsMany=Vd,i.setAssetProcedureTypes=Wl,i.setAssetProcedures=Tl,i.setAssetStage=Vo,i.setAssetStageCompletion=wo,i.setAssetStageCompletions=Po,i.setAssetStages=ko,i.setAssetType=kp,i.setAssetTypeAttachment=Go,i.setAssetTypeAttachments=Ko,i.setAssetTypeFieldValues=Kh,i.setAssetTypeFieldValuesAttachment=kh,i.setAssetTypeFieldValuesAttachments=Bh,i.setAssetTypeFieldValuesMany=Yh,i.setAssetTypeFields=Ph,i.setAssetTypeFieldsAttachment=ch,i.setAssetTypeFieldsAttachments=rh,i.setAssetTypeFieldsMany=Th,i.setAssetTypeIdentifier=rp,i.setAssetTypeIdentifierValue=Tp,i.setAssetTypeIdentifierValues=Op,i.setAssetTypeIdentifiers=dp,i.setAssetTypeStatus=Qp,i.setAssetTypeStatuses=Jp,i.setAssetTypes=Bp,i.setAssets=lo,i.setClientSDK=IV,i.setClientStore=TV,i.setConversation=zr,i.setConversations=Sk,i.setCurrentUser=MB,i.setCurrentUserProfile=vB,i.setDocument=gy,i.setDocumentAttachment=hy,i.setDocumentAttachments=py,i.setDocuments=Ry,i.setEmailDomain=$y,i.setEmailDomains=Cy,i.setForm=tm,i.setFormIdentifier=iS,i.setFormIdentifierValue=fS,i.setFormIdentifierValues=AS,i.setFormIdentifiers=nS,i.setFormRevision=LS,i.setFormRevisionAttachment=ES,i.setFormRevisionAttachments=VS,i.setFormRevisions=NS,i.setFormSubmission=_m,i.setFormSubmissionAttachment=ym,i.setFormSubmissionAttachments=Sm,i.setFormSubmissions=gm,i.setForms=sm,i.setGeoImage=qm,i.setGeoImages=jm,i.setIssue=iA,i.setIssueAssociation=xm,i.setIssueAssociations=Xm,i.setIssueAttachment=ff,i.setIssueAttachments=Af,i.setIssueComment=Hf,i.setIssueCommentAttachment=Ef,i.setIssueCommentAttachments=Vf,i.setIssueComments=Gf,i.setIssueType=cP,i.setIssueTypeAttachment=fA,i.setIssueTypeAttachments=AA,i.setIssueTypeFieldValues=HA,i.setIssueTypeFieldValuesAttachment=Aw,i.setIssueTypeFieldValuesAttachments=ww,i.setIssueTypeFieldValuesMany=GA,i.setIssueTypeFields=aw,i.setIssueTypeFieldsAttachment=EA,i.setIssueTypeFieldsAttachments=VA,i.setIssueTypeFieldsMany=cw,i.setIssueTypeIdentifier=Vw,i.setIssueTypeIdentifierValue=Gw,i.setIssueTypeIdentifierValues=Kw,i.setIssueTypeIdentifiers=kw,i.setIssueTypeStatus=PP,i.setIssueTypeStatuses=TP,i.setIssueTypes=rP,i.setIssueUpdate=EP,i.setIssueUpdates=VP,i.setIssues=nA,i.setLoggedIn=cy,i.setOrganization=pT,i.setOrganizationAccess=eT,i.setOrganizationAccesses=tT,i.setOrganizations=hT,i.setProcedure=WO,i.setProcedureStep=Q_,i.setProcedureStepAssignee=JO,i.setProcedureStepAssignees=ZO,i.setProcedureStepComment=uI,i.setProcedureStepComments=oI,i.setProcedureStepDefaultAssignee=FI,i.setProcedureStepDefaultAssignees=_I,i.setProcedureStepDefaultReviewer=qI,i.setProcedureStepDefaultReviewers=jI,i.setProcedureStepEvent=XI,i.setProcedureStepEvents=xI,i.setProcedureStepFieldValues=ZF,i.setProcedureStepFieldValuesAttachment=zF,i.setProcedureStepFieldValuesAttachments=qF,i.setProcedureStepFieldValuesMany=XF,i.setProcedureStepFieldValuesReview=I_,i.setProcedureStepFieldValuesReviewRequest=u_,i.setProcedureStepFieldValuesReviewRequests=o_,i.setProcedureStepFieldValuesReviews=F_,i.setProcedureStepFields=_F,i.setProcedureStepFieldsAttachment=oF,i.setProcedureStepFieldsAttachments=hF,i.setProcedureStepFieldsMany=gF,i.setProcedureStepReviewer=z_,i.setProcedureStepReviewers=q_,i.setProcedureSteps=J_,i.setProcedureType=hR,i.setProcedureTypeFieldValues=Xg,i.setProcedureTypeFieldValuesAttachment=qg,i.setProcedureTypeFieldValuesAttachments=jg,i.setProcedureTypeFieldValuesMany=xg,i.setProcedureTypeFields=_g,i.setProcedureTypeFieldsAttachment=og,i.setProcedureTypeFieldsAttachments=hg,i.setProcedureTypeFieldsMany=gg,i.setProcedureTypes=pR,i.setProcedures=zO,i.setProject=OO,i.setProjectAccess=DT,i.setProjectAccesses=WT,i.setProjectAttachment=YT,i.setProjectAttachments=QT,i.setProjectFile=cO,i.setProjectFiles=rO,i.setProjects=TO,i.setRehydrated=gD,i.setTeam=CR,i.setTeamMembership=RR,i.setTeamMemberships=bR,i.setTeams=UR,i.setTokens=Zk,i.setUploadUrl=cB,i.setUser=UP,i.setUsers=CP,i.setWorkflow=ib,i.setWorkflowIssueLink=mb,i.setWorkflowIssueLinks=fb,i.setWorkflowStep=BE,i.setWorkflowStepAssignee=Vb,i.setWorkflowStepAssignees=kb,i.setWorkflowStepComment=Gb,i.setWorkflowStepComments=Kb,i.setWorkflowStepDefaultAssignee=cM,i.setWorkflowStepDefaultAssignees=rM,i.setWorkflowStepDefaultReviewer=PM,i.setWorkflowStepDefaultReviewers=TM,i.setWorkflowStepEvent=BM,i.setWorkflowStepEvents=DM,i.setWorkflowStepFieldValues=Bv,i.setWorkflowStepFieldValuesAttachment=Pv,i.setWorkflowStepFieldValuesAttachments=Tv,i.setWorkflowStepFieldValuesMany=Dv,i.setWorkflowStepFieldValuesReview=cE,i.setWorkflowStepFieldValuesReviewRequest=Kv,i.setWorkflowStepFieldValuesReviewRequests=Yv,i.setWorkflowStepFieldValuesReviews=rE,i.setWorkflowStepFields=rv,i.setWorkflowStepFieldsAttachment=KM,i.setWorkflowStepFieldsAttachments=YM,i.setWorkflowStepFieldsMany=dv,i.setWorkflowStepReviewer=PE,i.setWorkflowStepReviewers=TE,i.setWorkflowSteps=DE,i.setWorkflowType=YE,i.setWorkflowTypes=QE,i.setWorkflows=nb,i.shallowEqual=GV,i.slugify=rk,i.spacesToDashesLower=ck,i.teamMembershipReducer=kR,i.teamMembershipSlice=Oc,i.teamReducer=JR,i.teamSlice=Ic,i.toFileNameSafeString=ak,i.toUuidArray=E,i.toUuidIdRecord=nk,i.truncate=dk,i.updateAsset=no,i.updateAssetAttachment=Hr,i.updateAssetAttachments=Gr,i.updateAssetProcedure=fl,i.updateAssetProcedureStep=Ku,i.updateAssetProcedureStepFieldValues=ku,i.updateAssetProcedureStepFieldValuesAttachment=wu,i.updateAssetProcedureStepFieldValuesAttachments=Pu,i.updateAssetProcedureStepFieldValuesMany=Bu,i.updateAssetProcedureStepFields=ru,i.updateAssetProcedureStepFieldsAttachment=Kl,i.updateAssetProcedureStepFieldsAttachments=Yl,i.updateAssetProcedureStepFieldsMany=du,i.updateAssetProcedureSteps=Yu,i.updateAssetProcedureType=El,i.updateAssetProcedureTypeAttachment=ad,i.updateAssetProcedureTypeAttachments=cd,i.updateAssetProcedureTypeFieldValues=cl,i.updateAssetProcedureTypeFieldValuesAttachment=Gd,i.updateAssetProcedureTypeFieldValuesAttachments=Kd,i.updateAssetProcedureTypeFieldValuesMany=rl,i.updateAssetProcedureTypeFields=kd,i.updateAssetProcedureTypeFieldsAttachment=wd,i.updateAssetProcedureTypeFieldsAttachments=Pd,i.updateAssetProcedureTypeFieldsMany=Bd,i.updateAssetProcedureTypes=Vl,i.updateAssetProcedures=Al,i.updateAssetStage=Wo,i.updateAssetStageCompletion=To,i.updateAssetStageCompletions=Oo,i.updateAssetStages=zo,i.updateAssetType=zp,i.updateAssetTypeAttachment=Yo,i.updateAssetTypeAttachments=Qo,i.updateAssetTypeFieldValues=Qh,i.updateAssetTypeFieldValuesAttachment=Dh,i.updateAssetTypeFieldValuesAttachments=Wh,i.updateAssetTypeFieldValuesMany=Jh,i.updateAssetTypeFields=Oh,i.updateAssetTypeFieldsAttachment=dh,i.updateAssetTypeFieldsAttachments=lh,i.updateAssetTypeFieldsMany=Ih,i.updateAssetTypeIdentifier=lp,i.updateAssetTypeIdentifierValue=Ip,i.updateAssetTypeIdentifierValues=Fp,i.updateAssetTypeIdentifiers=up,i.updateAssetTypeStatus=Zp,i.updateAssetTypeStatuses=Xp,i.updateAssetTypes=qp,i.updateAssets=ao,i.updateConversation=qr,i.updateConversations=mk,i.updateDocument=by,i.updateDocumentAttachment=yy,i.updateDocumentAttachments=Sy,i.updateDocuments=My,i.updateEmailDomain=Uy,i.updateEmailDomains=Ly,i.updateForm=im,i.updateFormIdentifier=aS,i.updateFormIdentifierValue=wS,i.updateFormIdentifierValues=PS,i.updateFormIdentifiers=cS,i.updateFormRevision=HS,i.updateFormRevisionAttachment=kS,i.updateFormRevisionAttachments=BS,i.updateFormRevisions=GS,i.updateFormSubmission=bm,i.updateFormSubmissionAttachment=mm,i.updateFormSubmissionAttachments=fm,i.updateFormSubmissions=Mm,i.updateForms=nm,i.updateGeoImage=Um,i.updateGeoImages=Lm,i.updateIssue=aA,i.updateIssueAssociation=ef,i.updateIssueAssociations=tf,i.updateIssueAttachment=wf,i.updateIssueAttachments=Pf,i.updateIssueComment=Kf,i.updateIssueCommentAttachment=kf,i.updateIssueCommentAttachments=Bf,i.updateIssueComments=Yf,i.updateIssueType=dP,i.updateIssueTypeAttachment=wA,i.updateIssueTypeAttachments=PA,i.updateIssueTypeFieldValues=KA,i.updateIssueTypeFieldValuesAttachment=Pw,i.updateIssueTypeFieldValuesAttachments=Tw,i.updateIssueTypeFieldValuesMany=YA,i.updateIssueTypeFields=rw,i.updateIssueTypeFieldsAttachment=kA,i.updateIssueTypeFieldsAttachments=BA,i.updateIssueTypeFieldsMany=dw,i.updateIssueTypeIdentifier=Bw,i.updateIssueTypeIdentifierValue=Yw,i.updateIssueTypeIdentifierValues=Qw,i.updateIssueTypeIdentifiers=Dw,i.updateIssueTypeStatus=OP,i.updateIssueTypeStatuses=IP,i.updateIssueTypes=lP,i.updateIssueUpdate=kP,i.updateIssueUpdates=BP,i.updateIssues=cA,i.updateOrganization=fT,i.updateOrganizationAccess=sT,i.updateOrganizationAccesses=iT,i.updateOrganizations=mT,i.updateProcedure=qO,i.updateProcedureStep=x_,i.updateProcedureStepAssignee=XO,i.updateProcedureStepAssignees=xO,i.updateProcedureStepComment=hI,i.updateProcedureStepComments=pI,i.updateProcedureStepDefaultAssignee=gI,i.updateProcedureStepDefaultAssignees=RI,i.updateProcedureStepDefaultReviewer=$I,i.updateProcedureStepDefaultReviewers=CI,i.updateProcedureStepEvent=eF,i.updateProcedureStepEvents=tF,i.updateProcedureStepFieldValues=xF,i.updateProcedureStepFieldValuesAttachment=jF,i.updateProcedureStepFieldValuesAttachments=$F,i.updateProcedureStepFieldValuesMany=e_,i.updateProcedureStepFieldValuesReview=__,i.updateProcedureStepFieldValuesReviewRequest=h_,i.updateProcedureStepFieldValuesReviewRequests=p_,i.updateProcedureStepFieldValuesReviews=g_,i.updateProcedureStepFields=RF,i.updateProcedureStepFieldsAttachment=pF,i.updateProcedureStepFieldsAttachments=yF,i.updateProcedureStepFieldsMany=bF,i.updateProcedureStepReviewer=j_,i.updateProcedureStepReviewers=$_,i.updateProcedureSteps=eg,i.updateProcedureType=yR,i.updateProcedureTypeFieldValues=eR,i.updateProcedureTypeFieldValuesAttachment=$g,i.updateProcedureTypeFieldValuesAttachments=Cg,i.updateProcedureTypeFieldValuesMany=tR,i.updateProcedureTypeFields=Rg,i.updateProcedureTypeFieldsAttachment=pg,i.updateProcedureTypeFieldsAttachments=yg,i.updateProcedureTypeFieldsMany=bg,i.updateProcedureTypes=SR,i.updateProcedures=jO,i.updateProject=gO,i.updateProjectAccess=zT,i.updateProjectAccesses=qT,i.updateProjectAttachment=JT,i.updateProjectAttachments=ZT,i.updateProjectFile=uO,i.updateProjectFiles=oO,i.updateProjects=_O,i.updateTeam=LR,i.updateTeamMembership=MR,i.updateTeamMemberships=vR,i.updateTeams=NR,i.updateUser=HP,i.updateUsers=NP,i.updateWorkflow=ab,i.updateWorkflowIssueLink=Ab,i.updateWorkflowIssueLinks=wb,i.updateWorkflowStep=WE,i.updateWorkflowStepAssignee=Bb,i.updateWorkflowStepAssignees=Db,i.updateWorkflowStepComment=Yb,i.updateWorkflowStepComments=Qb,i.updateWorkflowStepDefaultAssignee=dM,i.updateWorkflowStepDefaultAssignees=lM,i.updateWorkflowStepDefaultReviewer=OM,i.updateWorkflowStepDefaultReviewers=IM,i.updateWorkflowStepEvent=WM,i.updateWorkflowStepEvents=zM,i.updateWorkflowStepFieldValues=Wv,i.updateWorkflowStepFieldValuesAttachment=Ov,i.updateWorkflowStepFieldValuesAttachments=Iv,i.updateWorkflowStepFieldValuesMany=zv,i.updateWorkflowStepFieldValuesReview=dE,i.updateWorkflowStepFieldValuesReviewRequest=Qv,i.updateWorkflowStepFieldValuesReviewRequests=Jv,i.updateWorkflowStepFieldValuesReviews=lE,i.updateWorkflowStepFields=lv,i.updateWorkflowStepFieldsAttachment=QM,i.updateWorkflowStepFieldsAttachments=JM,i.updateWorkflowStepFieldsMany=uv,i.updateWorkflowStepReviewer=OE,i.updateWorkflowStepReviewers=IE,i.updateWorkflowSteps=zE,i.updateWorkflowType=JE,i.updateWorkflowTypes=ZE,i.updateWorkflows=cb,i.useSelectorBuilder=HV,i.userReducer=KP,i.userSlice=Oa,i.uuidObj=P,i.uuidObjSortFn=si,i.uuidSortFn=Ts,i.versioningReducer=XR,i.versioningSlice=ZR,i.workflowIssueLinkReducer=Rb,i.workflowIssueLinkSlice=gc,i.workflowReducer=hb,i.workflowSlice=_c,i.workflowStepAssigneeReducer=Cb,i.workflowStepAssigneeSlice=Rc,i.workflowStepCommentReducer=tM,i.workflowStepCommentSlice=bc,i.workflowStepDefaultAssigneeReducer=SM,i.workflowStepDefaultAssigneeSlice=Mc,i.workflowStepDefaultReviewerReducer=MM,i.workflowStepDefaultReviewerSlice=Ec,i.workflowStepEventReducer=LM,i.workflowStepEventSlice=kc,i.workflowStepFieldValuesAttachmentReducer=Mv,i.workflowStepFieldValuesAttachmentSlice=jc,i.workflowStepFieldValuesReducer=Lv,i.workflowStepFieldValuesReviewReducer=SE,i.workflowStepFieldValuesReviewRequestReducer=sE,i.workflowStepFieldValuesReviewRequestSlice=Nc,i.workflowStepFieldValuesReviewSlice=Kc,i.workflowStepFieldValuesSlice=Lc,i.workflowStepFieldsAttachmentReducer=sv,i.workflowStepFieldsAttachmentSlice=Bc,i.workflowStepFieldsReducer=mv,i.workflowStepFieldsSlice=qc,i.workflowStepReducer=LE,i.workflowStepReviewerReducer=ME,i.workflowStepReviewerSlice=Jc,i.workflowStepSlice=Zc,i.workflowTypeReducer=iV,i.workflowTypeSlice=xc,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
|
|
13
|
+
external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(y)}return await this.addCache(l),l}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:h.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:e,blockers:[`s3-${n.fields.key}`],blocks:[e],s3url:n})}processPresignedUrls(e){const n={};for(const[a,c]of Object.entries(e))n[a]=this.processPresignedUrl(a,c);return n}async getFilePayload(e){const a={sha1:await Ts(e),file_type:e.type,extension:Ir(e),size:e.size};return await this.client.files.addCache(e),a}}class Az extends M{constructor(){super(...arguments);p(this,"name","Form Identifier");p(this,"url","/form-identifiers");p(this,"actions",{addOne:nS,addMany:aS,setOne:cS,setMany:rS,updateOne:dS,updateMany:lS,deleteOne:uS,deleteMany:oS,initialize:iS});p(this,"selectors",{selectById:pS,selectByIds:yS})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.form],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected form identifier with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(a(c)),c}}class wz extends M{constructor(){super(...arguments);p(this,"name","Form Identifier Value");p(this,"url","/form-identifier-values");p(this,"actions",{addOne:AS,addMany:wS,setOne:PS,setMany:TS,updateOne:OS,updateMany:IS,deleteOne:FS,deleteMany:_S,initialize:fS});p(this,"selectors",{selectById:RS,selectByIds:bS})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.form_submission,e.form_identifier],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{form_submission__form_revision__form__organization:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class Pz extends z{constructor(){super(...arguments);p(this,"name","Form Revision Attachment");p(this,"url","/form-revision-attachments");p(this,"actions",{addOne:VS,addMany:kS,setOne:BS,setMany:DS,updateOne:WS,updateMany:zS,deleteOne:qS,deleteMany:jS,initialize:ES});p(this,"selectors",{selectById:CS,selectByIds:US})}getId(e){return e.uuid}getBlockers(e){return[e.form_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form_revision__form__organization:e}},n);return this.dispatch(a(c)),c}}class Tz extends M{constructor(){super(...arguments);p(this,"name","Form Revision");p(this,"url","/form-revisions");p(this,"actions",{addOne:Tn,addMany:On,setOne:GS,setMany:KS,updateOne:YS,updateMany:QS,deleteOne:In,deleteMany:Fn,initialize:HS});p(this,"selectors",{selectById:JS,selectByIds:ZS})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),y=P({...e,created_by:l,submitted_at:u});this.dispatch(a(y));const S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.form],blocks:[y.uuid]});return S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(a(c)),c}}class Oz extends M{constructor(){super(...arguments);p(this,"name","Form");p(this,"url","/forms");p(this,"actions",{addOne:sm,addMany:im,setOne:nm,setMany:am,updateOne:cm,updateMany:rm,deleteOne:dm,deleteMany:lm,initialize:tm});p(this,"selectors",{selectById:hm,selectByIds:pm})}add(e,n){var f;const{store:a}=this.client,{addOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((f=a.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=P({...e,submitted_at:d,created_by:l}),y=P({...n,form:u.uuid,submitted_at:d,created_by:l});this.dispatch(c(u)),this.dispatch(Tn(y));const S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:{...R(u),initial_revision:{uuid:y.uuid,submitted_at:y.submitted_at,title:y.title,description:y.description,fields:y.fields}},blockers:[],blocks:[u.uuid,y.uuid]});return S.catch(F=>{throw this.dispatch(r(u.uuid)),this.dispatch(In(y.uuid)),F}),[u,y,S]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error("Expected form to exist");const u=zm(e)(d),y=XS(e)(d);this.dispatch(a(e)),this.dispatch(Wn(E(u))),this.dispatch(Fn(E(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(S){throw this.dispatch(c(l)),this.dispatch(On(y)),this.dispatch(Dn(u)),S}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class Iz extends z{constructor(){super(...arguments);p(this,"name","Form Submission Attachment");p(this,"url","/form-submission-attachments");p(this,"actions",{addOne:mm,addMany:Mn,setOne:fm,setMany:Am,updateOne:wm,updateMany:Pm,deleteOne:Tm,deleteMany:vn,initialize:Sm});p(this,"selectors",{selectById:Om,selectByIds:Im})}getId(e){return e.uuid}getBlockers(e){return[e.form_submission]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,r=n.getState(),d=kn(e)(r);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{form_submission__form_revision__form__organization:e}},n)).flat();return this.dispatch(a(r)),r}}class Fz extends M{constructor(){super(...arguments);p(this,"name","Form Submission");p(this,"url","/form-submissions");p(this,"actions",{addOne:vm,addMany:Dn,setOne:bm,setMany:Mm,updateOne:Em,updateMany:Vm,deleteOne:km,deleteMany:Wn,initialize:Rm});p(this,"selectors",{selectById:Dm,selectByIds:Wm})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),y=P({...e,created_by:l,submitted_at:u}),S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.form_revision],blocks:[y.uuid]});return this.dispatch(a(y)),S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${l.uuid}/`,payload:e,blockers:[l.uuid],blocks:[l.uuid]});return u.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=Fm(e)(d);this.dispatch(a(e)),this.dispatch(vn(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Mn(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,form_revision__form_organization:e}},n)).flat();return this.dispatch(a(r)),r}}class _z extends z{constructor(){super(...arguments);p(this,"name","Geo Image");p(this,"url","/geo-images");p(this,"actions",{addOne:Lm,addMany:Nm,setOne:Cm,setMany:Um,updateOne:Hm,updateMany:Gm,deleteOne:Km,deleteMany:Ym,initialize:$m});p(this,"selectors",{selectById:Jm,selectByIds:Zm})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,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{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Geo image with uuid ${e.uuid} does not exist in the store`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return u.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project:e}},n);return this.dispatch(a(c)),c}}class gz extends M{constructor(){super(...arguments);p(this,"name","Issue Association");p(this,"url","/issue-associations");p(this,"actions",{addOne:cf,addMany:jt,setOne:sf,setMany:tf,updateOne:nf,updateMany:af,deleteOne:rf,deleteMany:$t,initialize:ef});p(this,"selectors",{selectById:lf,selectByIds:uf})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=P({...e,submitted_at:d,created_by:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{associated_issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Rz extends z{constructor(){super(...arguments);p(this,"name","Issue Attachment");p(this,"url","/issue-attachments");p(this,"actions",{addOne:wf,addMany:Un,setOne:Pf,setMany:Tf,updateOne:Of,updateMany:If,deleteOne:Ff,deleteMany:Ln,initialize:Af});p(this,"selectors",{selectById:Rf,selectByIds:bf})}getId(e){return e.uuid}getBlockers(e){return[e.issue]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,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:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class bz extends z{constructor(){super(...arguments);p(this,"name","Issue Comment Attachment");p(this,"url","/issue-comment-attachments");p(this,"actions",{addOne:Vf,addMany:kf,setOne:Bf,setMany:Df,updateOne:Wf,updateMany:zf,deleteOne:qf,deleteMany:jf,initialize:Ef});p(this,"selectors",{selectById:Cf,selectByIds:Uf})}getId(e){return e.uuid}getBlockers(e){return[e.issue_comment]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,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:a}=this.actions,r=(await this.listPaginated({queryParams:{issue_comment__issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Mz extends M{constructor(){super(...arguments);p(this,"name","Issue Comment");p(this,"url","/issue-comments");p(this,"actions",{addOne:Gf,addMany:Kf,setOne:Yf,setMany:Qf,updateOne:Jf,updateMany:Zf,deleteOne:Xf,deleteMany:xf,initialize:Hf});p(this,"selectors",{selectById:eA,selectByIds:tA})}add(e){const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=P({...e,author:n.getState().userReducer.currentUser.id,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[e.issue],blocks:[d.uuid]});return l.then(u=>{this.dispatch(c(u))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{setMany:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class vz extends M{constructor(){super(...arguments);p(this,"name","Issue");p(this,"url","/issues");p(this,"actions",{addOne:aA,addMany:Jn,setOne:cA,setMany:rA,updateOne:dA,updateMany:lA,deleteOne:uA,deleteMany:Zn,initialize:nA});p(this,"selectors",{selectById:hA,selectByIds:pA})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=new Date().toISOString(),u=((f=d.userReducer.currentUser)==null?void 0:f.id)??null,y=P({...e,submitted_at:l,created_by:u});this.dispatch(a(y));const S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[y.project,y.issue_type,y.status],blocks:[y.uuid]});return S.then(F=>{this.dispatch(c(F))}).catch(F=>{throw this.dispatch(r(y.uuid)),F}),[y,S]}update(e){var S;const{updateOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),r=a(e.uuid)(c);if(!r)throw new Error(`Attempting to update an issue with uuid ${e.uuid} that doesn't exist in the store`);const d={...r,...e};this.dispatch(n(d));const l={};for(const f of[$.TITLE,$.DESCRIPTION,$.STATUS,$.PRIORITY,$.ASSIGNED_TO,$.DUE_DATE])if(f in e&&e[f]!==r[f])switch(f){case $.PRIORITY:l[f]=e[f];break;case $.DUE_DATE:l[f]=e[f];break;case $.DESCRIPTION:l[f]=e[f];break;case $.TITLE:l[f]=e[f];break;case $.STATUS:{const F=e[f],g=Sa(F)(c);if(!g)throw new Error(`Trying to update issue type status with ${F} which does not exist in store`);l[f]={name:g.name,color:g.color,uuid:g.uuid};break}case $.ASSIGNED_TO:{const F=e[f];if(F===null)l[f]=null;else{const g=$s(F)(c);if(!g)throw new Error(`Trying to update assigned to with ${F} which does not exist in store.`);l[f]={full_name:g.username,id:g.id}}break}}const u=P({created_by:((S=c.userReducer.currentUser)==null?void 0:S.id)??null,submitted_at:new Date().toISOString(),issue:r.uuid,changes:l});this.dispatch(fa(u));const y=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return y.then(f=>{this.dispatch(n(f))}).catch(()=>{this.dispatch(n(r)),this.dispatch(wa(u.uuid))}),[d,y]}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,d=E(e).toSorted(Os);if(d.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=r(d)(a.getState()).toSorted(ii);if(d.length!=l.length)throw new Error(`Attempting to bulk update ${d.length-l.length} issues that dont exist in the store`);const u=[];for(let F=0;F<d.length;F++)u.push({...l[F],...e[F]});this.dispatch(c(u));const y=N(e,Math.min(n??e.length,L)),S=[];let f=null;for(const F of y){const g=Dt.v4(),V=E(F),_=F.map(({status:b})=>b).filter(Boolean),v=this.enqueueRequest({description:w(h.PATCH,this.name,!0),method:h.PATCH,url:`${this.url}/bulk/`,payload:{payloads:F},blockers:(f?[f]:[]).concat(V).concat(_),blocks:[g].concat(V)});S.push(v),f=g}return Promise.all(S).then(F=>{this.dispatch(c(F.flat()))}).catch(()=>{this.dispatch(c(l))}),[u,S]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No issue with uuid ${e} found in the store`);const u=of(e)(d),y=yf(e)(d),S=Lb(e)(d),f=gf(e)(d),F=$P(e)(d);this.dispatch(a(e)),this.dispatch(Ln(E(f))),this.dispatch(Pa(E(F))),this.dispatch($t(E(u))),this.dispatch($t(E(y))),this.dispatch(ys(E(S)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(g){throw this.dispatch(c(l)),this.dispatch(Un(f)),this.dispatch(Aa(F)),this.dispatch(jt(u)),this.dispatch(jt(y)),this.dispatch(ps(S)),g}}async bulkDelete(e){const{store:n}=this.client,{addMany:a,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d),u=hf(e)(d),y=pf(e)(d),S=Ub(e)(d);this.dispatch(c(e)),this.dispatch($t(E(u))),this.dispatch($t(E(y))),this.dispatch(ys(E(S)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(f){throw this.dispatch(a(l)),this.dispatch(jt(u)),this.dispatch(jt(y)),this.dispatch(ps(S)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class Ez extends z{constructor(){super(...arguments);p(this,"name","Issue Type Attachment");p(this,"url","/issue-type-attachments");p(this,"actions",{addOne:AA,addMany:wA,setOne:PA,setMany:TA,updateOne:OA,updateMany:IA,deleteOne:FA,deleteMany:_A,initialize:fA});p(this,"selectors",{selectById:RA,selectByIds:bA})}getId(e){return e.uuid}getBlockers(e){return[e.issue_type]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,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:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class Vz extends z{constructor(){super(...arguments);p(this,"name","Issue Type Fields Attachment");p(this,"url","/issue-type-fields-attachments");p(this,"actions",{addOne:VA,addMany:kA,setOne:BA,setMany:DA,updateOne:WA,updateMany:zA,deleteOne:qA,deleteMany:jA,initialize:EA});p(this,"selectors",{selectById:CA,selectByIds:UA})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class kz extends M{constructor(){super(...arguments);p(this,"name","Issue Type Fields");p(this,"url","/issue-type-fields");p(this,"actions",{addOne:cw,addMany:rw,setOne:dw,setMany:lw,updateOne:uw,updateMany:ow,deleteOne:hw,deleteMany:pw,initialize:aw});p(this,"selectors",{selectById:Sw,selectByIds:mw})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.issue_type],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,y]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class Bz extends z{constructor(){super(...arguments);p(this,"name","Issue Type Field Values Attachment");p(this,"url","/issue-type-field-values-attachments");p(this,"actions",{addOne:Pw,addMany:aa,setOne:Tw,setMany:Ow,updateOne:Iw,updateMany:Fw,deleteOne:_w,deleteMany:ca,initialize:ww});p(this,"selectors",{selectById:Rw,selectByIds:bw})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class Dz extends M{constructor(){super(...arguments);p(this,"name","Issue Type Field Values");p(this,"url","/issue-type-field-values");p(this,"actions",{addOne:GA,addMany:KA,setOne:YA,setMany:QA,updateOne:JA,updateMany:ZA,deleteOne:XA,deleteMany:xA,initialize:HA});p(this,"selectors",{selectById:tw,selectByIds:sw})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),y=P({...e,created_by:l,submitted_at:u}),S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.issue,e.fields_revision],blocks:[y.uuid]});return this.dispatch(a(y)),S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.issue],blocks:[l.uuid]});return u.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=Mw(e)(d);this.dispatch(a(e)),this.dispatch(ca(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(aa(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class Wz extends M{constructor(){super(...arguments);p(this,"name","Issue Type Identifier");p(this,"url","/issue-type-identifiers");p(this,"actions",{addOne:kw,addMany:Bw,setOne:Dw,setMany:Ww,updateOne:zw,updateMany:qw,deleteOne:jw,deleteMany:$w,initialize:Vw});p(this,"selectors",{selectById:Uw,selectByIds:Lw})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.issue_type],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected issue type identifier with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class zz extends M{constructor(){super(...arguments);p(this,"name","Issue Type Identifier Value");p(this,"url","/issue-type-identifier-values");p(this,"actions",{addOne:Kw,addMany:Yw,setOne:Qw,setMany:Jw,updateOne:Zw,updateMany:Xw,deleteOne:xw,deleteMany:eP,initialize:Gw});p(this,"selectors",{selectById:sP,selectByIds:iP})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.issue,e.issue_type_identifier],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class qz extends M{constructor(){super(...arguments);p(this,"name","Issue Type");p(this,"url","/issue-types");p(this,"actions",{addOne:rP,addMany:dP,setOne:lP,setMany:uP,updateOne:oP,updateMany:hP,deleteOne:pP,deleteMany:yP,initialize:cP});p(this,"selectors",{selectById:mP,selectByIds:fP})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),y=P({...e,submitted_at:u,created_by:l});this.dispatch(a(y));const S=this.enqueueRequest({method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[],blocks:[y.uuid]});return S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const u=yA(e)(d);this.dispatch(a(e)),this.dispatch(Zn(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Jn(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class jz extends M{constructor(){super(...arguments);p(this,"name","Issue Type Status");p(this,"url","/issue-type-statuses");p(this,"actions",{addOne:TP,addMany:OP,setOne:IP,setMany:FP,updateOne:_P,updateMany:gP,deleteOne:RP,deleteMany:bP,initialize:PP});p(this,"selectors",{selectById:Sa,selectByIds:vP})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.issue_type],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}update(e){const{setOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),r=a(e.uuid)(c);if(!r)throw new Error(`Expected an existing issue type status with uuid ${e.uuid}`);const d={...r,...e};this.dispatch(n(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(n(u))}).catch(()=>{this.dispatch(n(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`No issue type status with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class $z extends M{constructor(){super(...arguments);p(this,"name","Issue Update");p(this,"url","/issue-updates");p(this,"actions",{addOne:fa,addMany:Aa,setOne:BP,setMany:DP,updateOne:WP,updateMany:zP,deleteOne:wa,deleteMany:Pa,initialize:kP});p(this,"selectors",{selectById:qP,selectByIds:jP})}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}const Cz=1800;function Uz(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 Lz extends $W{constructor(){super(...arguments);p(this,"_getRenewedTokens",async e=>{const n=this.performRequest({method:h.POST,url:this.refreshTokensUrl,payload:{refresh:e},isAuthNeeded:!1,checkAuth:!1});let a;try{a=await n}catch(c){console.error("Could not renew tokens; clearing auth",c),this.clearAuth();return}if(!a.access)throw new Error("Missing access token");return{accessToken:a.access,refreshToken:a.refresh??this.getRefreshToken()}})}clearAuth(){console.debug(this.constructor.name,"clearing auth;"),this.dispatch(ly(!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 a;try{a=tk(e).exp??n}catch{a=n}return a-n<Cz}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 C&&this.clearAuth(),e instanceof Error?Promise.reject(e):Promise.reject(new Error((e??Zt).toString()))}}}async handleUnauthorized(e,n){const a=this.client.store.getState();if(e.url.endsWith("/token/refresh/"))throw a.authReducer.isLoggedIn&&console.warn("No signed-in user to sign out."),this.clearAuth(),new C({message:"You have been signed out due to inactivity.",response:n,discard:!0});if(a.authReducer.isLoggedIn)await this.renewTokens();else throw console.debug("Forbidden; user is not logged in."),new C({message:"Incorrect username or password.",response:n,discard:!0})}async initAuth(e){const n=Dt.v4();return console.debug(this.constructor.name,"Initiating auth"),this.performRequest({uuid:n,method:h.POST,url:this.initTokensUrl,payload:e,isAuthNeeded:!1,checkAuth:!1}).then(a=>{this.setTokens(Uz(a))})}}class Nz extends qt{constructor(){super(...arguments);p(this,"name","Organization Access");p(this,"url","/organization-accesses");p(this,"actions",{addOne:tT,addMany:sT,setOne:iT,setMany:nT,updateOne:aT,updateMany:cT,deleteOne:rT,deleteMany:dT,initialize:eT});p(this,"selectors",{selectById:uT,selectByIds:oT})}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState()),d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(u=>{throw this.dispatch(a(r)),u}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d),u=$s(l.user)(d);this.dispatch(a(l.uuid)),this.dispatch(_a(l.user));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${l.uuid}/`,blockers:[l.uuid],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Fa(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class Hz extends qt{constructor(){super(...arguments);p(this,"name","Organization");p(this,"url","/organizations");p(this,"actions",{addOne:AT,addMany:fT,setOne:mT,setMany:ST,updateOne:PT,updateMany:wT,deleteOne:TT,deleteMany:OT,initialize:yT});p(this,"selectors",{selectById:_T,selectByIds:gT})}async add(e){const{addOne:n}=this.actions,a=await this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:e,blockers:[],blocks:[]});return this.dispatch(n(a)),a}async update(e){const{setOne:n}=this.actions,a=await this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return this.dispatch(n(a)),a}async invite(e,n){return this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/${e}/invite/${n}/`,blockers:[],blocks:[]})}async refreshStore(e){const{initialize:n}=this.actions,a=await this.list({},e);return this.dispatch(n(a)),a}}class Gz extends M{constructor(){super(...arguments);p(this,"name","Project Access");p(this,"url","/project-accesses");p(this,"actions",{addOne:WT,addMany:zT,setOne:qT,setMany:jT,updateOne:$T,updateMany:CT,deleteOne:UT,deleteMany:LT,initialize:DT});p(this,"selectors",{selectById:HT,selectByIds:GT})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.organization_access,d.project],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(y=>{throw this.dispatch(r(d.uuid)),y}),[d,l]}bulkAdd(e){var y;const{store:n}=this.client,{addMany:a,deleteMany:c,updateMany:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=e.map(S=>P({...S,created_by:d}));this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{project_accesses:l.map(S=>R(S))},blockers:l.flatMap(S=>[S.project,S.organization_access]),blocks:l.map(S=>S.uuid)});return u.then(S=>{this.dispatch(r(S))}).catch(S=>{throw this.dispatch(c(l.map(f=>f.uuid))),S}),[l,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState()),d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return l.then(u=>{this.dispatch(a(u))}).catch(u=>{throw this.dispatch(a(r)),u}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(a(c)),c}}class Kz extends z{constructor(){super(...arguments);p(this,"name","Project Attachment");p(this,"url","/project-attachments");p(this,"actions",{addOne:QT,addMany:JT,setOne:ZT,setMany:XT,updateOne:xT,updateMany:eO,deleteOne:tO,deleteMany:sO,initialize:YT});p(this,"selectors",{selectById:nO,selectByIds:aO})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,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:a}=this.actions,c=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(a(c)),c}}class Yz extends z{constructor(){super(...arguments);p(this,"name","Project File");p(this,"url","/project-files");p(this,"actions",{addOne:oO,addMany:hO,setOne:lO,setMany:uO,updateOne:pO,updateMany:yO,deleteOne:SO,deleteMany:mO,initialize:dO});p(this,"selectors",{selectById:wO,selectByIds:PO})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,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{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`${this.name} with uuid ${e.uuid} does not exist in the store`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return u.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class Qz extends qt{constructor(){super(...arguments);p(this,"name","Project");p(this,"url","/projects");p(this,"actions",{addOne:RO,addMany:gO,setOne:_O,setMany:FO,updateOne:MO,updateMany:bO,deleteOne:vO,deleteMany:EO,initialize:IO});p(this,"selectors",{selectById:BO,selectByIds:DO})}async add(e){const{addOne:n}=this.actions,a=await this.performRequest({method:h.POST,url:`${this.url}/`,payload:R(e)});return this.dispatch(n(a)),a}async update(e){const{updateOne:n}=this.actions,a=await this.performRequest({method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:R(e)});return this.dispatch(n(a)),a}async delete(e){const{deleteOne:n}=this.actions,a=await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]});return this.dispatch(n(e)),a}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}const WV=(...t)=>t.filter(s=>s!==null);class Jz extends M{constructor(){super(...arguments);p(this,"name","Procedure");p(this,"url","/procedures");p(this,"actions",{addOne:qO,addMany:za,setOne:jO,setMany:$O,updateOne:CO,updateMany:UO,deleteOne:LO,deleteMany:qa,initialize:zO});p(this,"selectors",{selectById:GO,selectByIds:KO})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:WV(d.procedure_type,d.project,d.asset,d.issue),blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected procedure with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:WV(r.uuid,d.procedure_type,d.project,d.asset,d.issue),blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected procedure with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class Zz extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Assignee");p(this,"url","/procedure-step-assignees");p(this,"actions",{addOne:ZO,addMany:XO,setOne:xO,setMany:eI,updateOne:tI,updateMany:sI,deleteOne:iI,deleteMany:nI,initialize:JO});p(this,"selectors",{selectById:cI,selectByIds:rI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.procedure,d.procedure_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var S;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=e.map(f=>P({...f,created_by:d,submitted_at:l}));this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{procedure_step_assignees:u.map(f=>R(f)),submitted_at:l},blockers:u.flatMap(f=>[f.procedure,f.procedure_step]),blocks:u.map(f=>f.uuid)});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(E(u)))}),[u,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected procedure step assignee with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Xz extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Comment");p(this,"url","/procedure-step-comments");p(this,"actions",{addOne:oI,addMany:hI,setOne:pI,setMany:yI,updateOne:SI,updateMany:mI,deleteOne:fI,deleteMany:AI,initialize:uI});p(this,"selectors",{selectById:PI,selectByIds:TI})}add(e){var u;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.procedure,d.procedure_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Procedure step comment with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Procedure step comment with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class xz extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Default Assignee");p(this,"url","/procedure-step-default-assignees");p(this,"actions",{addOne:_I,addMany:gI,setOne:RI,setMany:bI,updateOne:MI,updateMany:vI,deleteOne:EI,deleteMany:VI,initialize:FI});p(this,"selectors",{selectById:BI,selectByIds:DI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.procedure_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected procedure step default assignee with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class eq extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Default Reviewer");p(this,"url","/procedure-step-default-reviewers");p(this,"actions",{addOne:jI,addMany:$I,setOne:CI,setMany:UI,updateOne:LI,updateMany:NI,deleteOne:HI,deleteMany:GI,initialize:qI});p(this,"selectors",{selectById:YI,selectByIds:QI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.procedure_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected procedure step default reviewer with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class tq extends qt{constructor(){super(...arguments);p(this,"name","Procedure Step Event");p(this,"url","/procedure-step-events");p(this,"actions",{addOne:xI,addMany:eF,setOne:tF,setMany:sF,updateOne:iF,updateMany:nF,deleteOne:aF,deleteMany:cF,initialize:XI});p(this,"selectors",{selectById:dF,selectByIds:lF})}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class sq extends z{constructor(){super(...arguments);p(this,"name","Procedure Step Fields Attachment");p(this,"url","/procedure-step-fields-attachments");p(this,"actions",{addOne:pF,addMany:Ka,setOne:yF,setMany:SF,updateOne:mF,updateMany:fF,deleteOne:AF,deleteMany:Ya,initialize:hF});p(this,"selectors",{selectById:TF,selectByIds:OF})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var a;const{store:n}=this.client;return P({...e,created_by:((a=n.getState().userReducer.currentUser)==null?void 0:a.id)??null,submitted_at:new Date().toISOString()})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__procedure_step__procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class iq extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Fields");p(this,"url","/procedure-step-fields");p(this,"actions",{addOne:gF,addMany:RF,setOne:bF,setMany:MF,updateOne:vF,updateMany:EF,deleteOne:VF,deleteMany:kF,initialize:_F});p(this,"selectors",{selectById:BF,selectByIds:DF})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.procedure_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected procedure step fields with uuid ${e} to exist`);const u=PF(e)(d);this.dispatch(a(e)),this.dispatch(Ya(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Ka(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class nq extends z{constructor(){super(...arguments);p(this,"name","Procedure Step Field Values Attachment");p(this,"url","/procedure-step-field-values-attachments");p(this,"actions",{addOne:jF,addMany:xa,setOne:$F,setMany:CF,updateOne:UF,updateMany:LF,deleteOne:NF,deleteMany:ec,initialize:qF});p(this,"selectors",{selectById:GF,selectByIds:KF})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class aq extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Field Values Review Request");p(this,"url","/procedure-step-field-values-review-requests");p(this,"actions",{addOne:h_,addMany:nc,setOne:p_,setMany:y_,updateOne:S_,updateMany:m_,deleteOne:f_,deleteMany:ac,initialize:o_});p(this,"selectors",{selectById:w_,selectByIds:P_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.field_values],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Procedure step field values review request with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class cq extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Field Values Review");p(this,"url","/procedure-step-field-values-reviews");p(this,"actions",{addOne:__,addMany:rc,setOne:g_,setMany:R_,updateOne:b_,updateMany:M_,deleteOne:v_,deleteMany:dc,initialize:F_});p(this,"selectors",{selectById:V_,selectByIds:k_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.field_values],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Procedure step field values review with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Procedure step field values review with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class rq extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Field Values");p(this,"url","/procedure-step-field-values");p(this,"actions",{addOne:XF,addMany:xF,setOne:e_,setMany:t_,updateOne:s_,updateMany:i_,deleteOne:n_,deleteMany:a_,initialize:ZF});p(this,"selectors",{selectById:r_,selectByIds:d_})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),y=P({...e,created_by:l,submitted_at:u}),S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.procedure,e.procedure_step,e.fields_revision],blocks:[y.uuid]});return this.dispatch(a(y)),S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}bulkAdd(e,n){var V;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),y=((V=this.client.store.getState().userReducer.currentUser)==null?void 0:V.id)??null,S=[],f=N(a,Math.min(n??a.length,L)),F=[];for(const _ of f){const v=[];for(const b of _){const D=P({...b,values:b.values,created_by:y,submitted_at:u});S.push(D),v.push({uuid:D.uuid,fields_revision:b.fields_revision,procedure:b.procedure,procedure_step:b.procedure_step,published_at:b.published_at,values:D.values})}F.push({submitted_at:u,values:c,field_values:v})}this.dispatch(r(S));const g=[];for(const _ of F){const{field_values:v}=_,b=v.map(({fields_revision:k})=>k),D=v.map(({procedure:k})=>k),j=v.map(({procedure_step:k})=>k),W=v.map(({uuid:k})=>k),q=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:_,blockers:b.concat(D).concat(j),blocks:W});g.push(q)}return Promise.all(g).then(_=>{this.dispatch(d(_.flat()))}).catch(()=>{this.dispatch(l(E(S)))}),[S,g]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected ProcedureStepFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.procedure,l.procedure_step,l.fields_revision],blocks:[l.uuid]});return u.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected ProcedureStepFieldValues with uuid ${e} to exist`);const u=YF(e)(d),y=B_(e)(d),S=T_(e)(d);this.dispatch(a(e)),this.dispatch(ec(E(u))),this.dispatch(dc(E(y))),this.dispatch(ac(E(S)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(c(l)),this.dispatch(xa(u)),this.dispatch(rc(y)),this.dispatch(nc(S)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class dq extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Reviewer");p(this,"url","/procedure-step-reviewers");p(this,"actions",{addOne:q_,addMany:j_,setOne:$_,setMany:C_,updateOne:U_,updateMany:L_,deleteOne:N_,deleteMany:H_,initialize:z_});p(this,"selectors",{selectById:K_,selectByIds:Y_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.procedure,d.procedure_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var S;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=e.map(f=>P({...f,created_by:d,submitted_at:l}));this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{procedure_step_reviewers:u.map(f=>R(f)),submitted_at:l},blockers:u.flatMap(f=>[f.procedure,f.procedure_step]),blocks:u.map(f=>f.uuid)});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.map(f=>f.uuid)))}),[u,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected procedure step reviewer with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class lq extends M{constructor(){super(...arguments);p(this,"name","Procedure Step");p(this,"url","/procedure-steps");p(this,"actions",{addOne:eg,addMany:tg,setOne:X_,setMany:x_,updateOne:sg,updateMany:ig,deleteOne:ng,deleteMany:ag,initialize:Z_});p(this,"selectors",{selectById:rg,selectByIds:dg})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.procedure_type],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`No procedure step with uuid ${e.uuid} found in the store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${r.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteMany:a,addMany:c,addOne:r,deleteOne:d}=this.actions,{selectById:l}=this.selectors,u=n.getState(),y=l(e)(u);if(!y)throw new Error(`No procedure step with uuid ${e} found in the store`);const S=lg(e)(u);this.dispatch(d(e)),this.dispatch(a(E(S)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(r(y)),this.dispatch(c(S)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class uq extends z{constructor(){super(...arguments);p(this,"name","Procedure Type Attachment");p(this,"url","/procedure-type-attachments");p(this,"actions",{addOne:hg,addMany:pg,setOne:yg,setMany:Sg,updateOne:mg,updateMany:fg,deleteOne:Ag,deleteMany:wg,initialize:og});p(this,"selectors",{selectById:Og,selectByIds:Ig})}getId(e){return e.uuid}getBlockers(e){return[e.procedure_type]}getBlocks(e){return[e.uuid]}buildModel(e){var f;const{store:n}=this.client,{procedure_type:a,file_sha1:c,file_extension:r,file_name:d,file_type:l,file_url:u}=e,y=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,S=new Date().toISOString();return P({file_url:u,file_sha1:c,file_extension:r,file_name:d,file_type:l,created_by:y,submitted_at:S,procedure_type:a})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,procedure_type:e.procedure_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,procedure_type:e.procedure_type}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class oq extends z{constructor(){super(...arguments);p(this,"name","Procedure Type Fields Attachment");p(this,"url","/procedure-type-fields-attachments");p(this,"actions",{addOne:gg,addMany:Rg,setOne:bg,setMany:Mg,updateOne:vg,updateMany:Eg,deleteOne:Vg,deleteMany:kg,initialize:_g});p(this,"selectors",{selectById:Wg,selectByIds:zg})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class hq extends M{constructor(){super(...arguments);p(this,"name","Procedure Type Fields");p(this,"url","/procedure-type-fields");p(this,"actions",{addOne:$g,addMany:Cg,setOne:Ug,setMany:Lg,updateOne:Ng,updateMany:Hg,deleteOne:Gg,deleteMany:Kg,initialize:jg});p(this,"selectors",{selectById:Jg,selectByIds:Zg})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=P({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.procedure_type],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,y]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class pq extends z{constructor(){super(...arguments);p(this,"name","Procedure Type Field Values Attachment");p(this,"url","/procedure-type-field-values-attachments");p(this,"actions",{addOne:eR,addMany:Ac,setOne:tR,setMany:sR,updateOne:iR,updateMany:nR,deleteOne:aR,deleteMany:wc,initialize:xg});p(this,"selectors",{selectById:dR,selectByIds:lR})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return P({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class yq extends M{constructor(){super(...arguments);p(this,"name","Procedure Type Field Values");p(this,"url","/procedure-type-field-values");p(this,"actions",{addOne:pR,addMany:yR,setOne:SR,setMany:mR,updateOne:fR,updateMany:AR,deleteOne:wR,deleteMany:PR,initialize:hR});p(this,"selectors",{selectById:IR,selectByIds:FR})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),y=P({...e,created_by:l,submitted_at:u}),S=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(y),blockers:[e.fields_revision,e.procedure],blocks:[y.uuid]});return this.dispatch(a(y)),S.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,S]}bulkAdd(e,n){var V;const{values:a,payloads:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),y=((V=this.client.store.getState().userReducer.currentUser)==null?void 0:V.id)??null,S=[],f=N(c,Math.min(n??c.length,L)),F=[];for(const _ of f){const v=[];for(const b of _){const D=P({...b,values:b.values,created_by:y,submitted_at:u});S.push(D),v.push({uuid:D.uuid,fields_revision:b.fields_revision,procedure:b.procedure,published_at:b.published_at,values:D.values})}F.push({submitted_at:u,values:a,field_values:v})}this.dispatch(r(S));const g=[];for(const _ of F){const{field_values:v}=_,b=v.map(({fields_revision:q})=>q),D=v.map(({procedure:q})=>q),j=v.map(({uuid:q})=>q),W=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:_,blockers:b.concat(D),blocks:j});g.push(W)}return Promise.all(g).then(_=>{this.dispatch(d(_.flat()))}).catch(()=>{this.dispatch(l(E(S)))}),[S,g]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected ProcedureTypeFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.fields_revision,l.procedure],blocks:[l.uuid]});return u.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=uR(e)(d);this.dispatch(a(e)),this.dispatch(wc(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Ac(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class Sq extends M{constructor(){super(...arguments);p(this,"name","Procedure Type");p(this,"url","/procedure-types");p(this,"actions",{addOne:RR,addMany:bR,setOne:MR,setMany:vR,updateOne:ER,updateMany:VR,deleteOne:kR,deleteMany:BR,initialize:gR});p(this,"selectors",{selectById:zR,selectByIds:qR})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=P({...e,created_by:((y=d.userReducer.currentUser)==null?void 0:y.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[],blocks:[l.uuid]});return u.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected procedure type with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected procedure type with uuid ${e} to exist`);const u=YO(e)(d);this.dispatch(a(e)),this.dispatch(qa(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(za(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class mq extends M{constructor(){super(...arguments);p(this,"name","Team Membership");p(this,"url","/team-memberships");p(this,"actions",{addOne:UR,addMany:LR,setOne:NR,setMany:HR,updateOne:GR,updateMany:KR,deleteOne:YR,deleteMany:QR,initialize:CR});p(this,"selectors",{selectById:XR,selectByIds:xR})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[e.team],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var y;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=e.map(S=>P({...S,created_by:d}));this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{team_memberships:l.map(S=>R(S))},blockers:l.map(S=>S.team),blocks:l.map(S=>S.uuid)});return u.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(r(l.map(S=>S.uuid)))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{team__organization:e}},n);return this.dispatch(a(c)),c}}class fq extends M{constructor(){super(...arguments);p(this,"name","Team");p(this,"url","/teams");p(this,"actions",{addOne:sb,addMany:ib,setOne:nb,setMany:ab,updateOne:cb,updateMany:rb,deleteOne:db,deleteMany:lb,initialize:tb});p(this,"selectors",{selectById:ob,selectByIds:hb})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,submitted_at:new Date().toISOString(),created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:R(e),blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class Aq extends qt{constructor(){super(...arguments);p(this,"name","User");p(this,"url","/user");p(this,"actions",{addOne:Fa,addMany:GP,setOne:HP,setMany:NP,updateOne:YP,updateMany:KP,deleteOne:_a,deleteMany:QP,initialize:LP});p(this,"selectors",{selectById:$s,selectByIds:XP})}async list(e,n){const{organizationUuid:a,...c}=e,r=a?`/organizations/${a}${this.url}s/`:`/${this.url}`;return this.performRequest({method:h.GET,url:r,...c},n)}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({organizationUuid:e},n);return this.dispatch(a(c)),c}}class wq extends M{constructor(){super(...arguments);p(this,"name","Workflow");p(this,"url","/workflows");p(this,"actions",{addOne:Ab,addMany:wb,setOne:Pb,setMany:Tb,updateOne:Ob,updateMany:Ib,deleteOne:Fb,deleteMany:_b,initialize:fb});p(this,"selectors",{selectById:Rb,selectByIds:bb})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow_type,d.project],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected workflow with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid,d.workflow_type,d.project],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected workflow with uuid ${e} to exist`);const u=Cb(e)(d);this.dispatch(a(e)),this.dispatch(ys(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(ps(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class Pq extends M{constructor(){super(...arguments);p(this,"name","Workflow Issue Link");p(this,"url","/workflow-issue-links");p(this,"actions",{addOne:Vb,addMany:ps,setOne:kb,setMany:Bb,updateOne:Db,updateMany:Wb,deleteOne:zb,deleteMany:ys,initialize:Eb});p(this,"selectors",{selectById:jb,selectByIds:$b})}add(e){var S;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,u=P({...e,submitted_at:d,created_by:l});this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.workflow,e.issue],blocks:[u.uuid]});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow issue link with uuid ${e} not found in store.`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Tq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Assignee");p(this,"url","/workflow-step-assignees");p(this,"actions",{addOne:Kb,addMany:Yb,setOne:Qb,setMany:Jb,updateOne:Zb,updateMany:Xb,deleteOne:xb,deleteMany:eM,initialize:Gb});p(this,"selectors",{selectById:sM,selectByIds:iM})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow,d.workflow_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var S;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=e.map(f=>P({...f,created_by:d,submitted_at:l}));this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{workflow_step_assignees:u.map(f=>R(f)),submitted_at:l},blockers:u.flatMap(f=>[f.workflow,f.workflow_step]),blocks:u.map(f=>f.uuid)});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(E(u)))}),[u,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step assignee with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Oq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Comment");p(this,"url","/workflow-step-comments");p(this,"actions",{addOne:rM,addMany:dM,setOne:lM,setMany:uM,updateOne:oM,updateMany:hM,deleteOne:pM,deleteMany:yM,initialize:cM});p(this,"selectors",{selectById:mM,selectByIds:fM})}add(e){var u;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow,d.workflow_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Workflow step comment with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow step comment with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Iq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Default Assignee");p(this,"url","/workflow-step-default-assignees");p(this,"actions",{addOne:TM,addMany:OM,setOne:IM,setMany:FM,updateOne:_M,updateMany:gM,deleteOne:RM,deleteMany:bM,initialize:PM});p(this,"selectors",{selectById:vM,selectByIds:EM})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step default assignee with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class Fq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Default Reviewer");p(this,"url","/workflow-step-default-reviewers");p(this,"actions",{addOne:DM,addMany:WM,setOne:zM,setMany:qM,updateOne:jM,updateMany:$M,deleteOne:CM,deleteMany:UM,initialize:BM});p(this,"selectors",{selectById:NM,selectByIds:HM})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step default reviewer with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class _q extends qt{constructor(){super(...arguments);p(this,"name","Workflow Step Event");p(this,"url","/workflow-step-events");p(this,"actions",{addOne:QM,addMany:JM,setOne:ZM,setMany:XM,updateOne:xM,updateMany:ev,deleteOne:tv,deleteMany:sv,initialize:YM});p(this,"selectors",{selectById:nv,selectByIds:av})}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class gq extends z{constructor(){super(...arguments);p(this,"name","Workflow Step Fields Attachment");p(this,"url","/workflow-step-fields-attachments");p(this,"actions",{addOne:lv,addMany:qc,setOne:uv,setMany:ov,updateOne:hv,updateMany:pv,deleteOne:yv,deleteMany:jc,initialize:dv});p(this,"selectors",{selectById:fv,selectByIds:Av})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var a;const{store:n}=this.client;return P({...e,created_by:((a=n.getState().userReducer.currentUser)==null?void 0:a.id)??null,submitted_at:new Date().toISOString()})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class Rq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Fields");p(this,"url","/workflow-step-fields");p(this,"actions",{addOne:Ov,addMany:Iv,setOne:Fv,setMany:_v,updateOne:gv,updateMany:Rv,deleteOne:bv,deleteMany:Mv,initialize:Tv});p(this,"selectors",{selectById:Ev,selectByIds:Vv})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected workflow step fields with uuid ${e} to exist`);const u=mv(e)(d);this.dispatch(a(e)),this.dispatch(jc(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(qc(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class bq extends z{constructor(){super(...arguments);p(this,"name","Workflow Step Field Values Attachment");p(this,"url","/workflow-step-field-values-attachments");p(this,"actions",{addOne:Wv,addMany:Lc,setOne:zv,setMany:qv,updateOne:jv,updateMany:$v,deleteOne:Cv,deleteMany:Nc,initialize:Dv});p(this,"selectors",{selectById:Lv,selectByIds:Nv})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var a;const{store:n}=this.client;return P({...e,created_by:((a=n.getState().userReducer.currentUser)==null?void 0:a.id)??null,submitted_at:new Date().toISOString()})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__workflow__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class Mq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Field Values Review Request");p(this,"url","/workflow-step-field-values-review-requests");p(this,"actions",{addOne:lE,addMany:Yc,setOne:uE,setMany:oE,updateOne:hE,updateMany:pE,deleteOne:yE,deleteMany:Qc,initialize:dE});p(this,"selectors",{selectById:mE,selectByIds:fE})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.field_values],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow step field values review request with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class vq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Field Values Review");p(this,"url","/workflow-step-field-values-reviews");p(this,"actions",{addOne:OE,addMany:Zc,setOne:IE,setMany:FE,updateOne:_E,updateMany:gE,deleteOne:RE,deleteMany:Xc,initialize:TE});p(this,"selectors",{selectById:ME,selectByIds:vE})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.field_values],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Workflow step field values review with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow step field values review with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Eq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Field Values");p(this,"url","/workflow-step-field-values");p(this,"actions",{addOne:Qv,addMany:Jv,setOne:Zv,setMany:Xv,updateOne:xv,updateMany:eE,deleteOne:tE,deleteMany:sE,initialize:Yv});p(this,"selectors",{selectById:nE,selectByIds:aE})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=P({...e,created_by:((y=d.userReducer.currentUser)==null?void 0:y.id)??null,submitted_at:new Date().toISOString()}),u=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[e.workflow,e.workflow_step,e.fields_revision],blocks:[l.uuid]});return this.dispatch(a(l)),u.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected WorkflowStepFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.workflow,l.workflow_step,l.fields_revision],blocks:[l.uuid]});return u.then(y=>{this.dispatch(a(y))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected WorkflowStepFieldValues with uuid ${e} to exist`);const u=Hv(e)(d),y=EE(e)(d),S=AE(e)(d);this.dispatch(a(e)),this.dispatch(Nc(E(u))),this.dispatch(Xc(E(y))),this.dispatch(Qc(E(S)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(c(l)),this.dispatch(Lc(u)),this.dispatch(Zc(y)),this.dispatch(Yc(S)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Vq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Reviewer");p(this,"url","/workflow-step-reviewers");p(this,"actions",{addOne:DE,addMany:WE,setOne:zE,setMany:qE,updateOne:jE,updateMany:$E,deleteOne:CE,deleteMany:UE,initialize:BE});p(this,"selectors",{selectById:NE,selectByIds:HE})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow,d.workflow_step],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var S;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),u=e.map(f=>P({...f,created_by:d,submitted_at:l}));this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{workflow_step_reviewers:u.map(f=>R(f)),submitted_at:l},blockers:u.flatMap(f=>[f.workflow,f.workflow_step]),blocks:u.map(f=>f.uuid)});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.map(f=>f.uuid)))}),[u,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step reviewer with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class kq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step");p(this,"url","/workflow-steps");p(this,"actions",{addOne:QE,addMany:JE,setOne:ZE,setMany:XE,updateOne:xE,updateMany:eV,deleteOne:tV,deleteMany:sV,initialize:YE});p(this,"selectors",{selectById:nV,selectByIds:aV})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=P({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow_type],blocks:[d.uuid]});return l.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected workflow step with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid,d.workflow_type],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class Bq extends M{constructor(){super(...arguments);p(this,"name","Workflow Type");p(this,"url","/workflow-types");p(this,"actions",{addOne:lV,addMany:uV,setOne:oV,setMany:hV,updateOne:pV,updateMany:yV,deleteOne:SV,deleteMany:mV,initialize:dV});p(this,"selectors",{selectById:AV,selectByIds:wV})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=P({...e,created_by:((y=d.userReducer.currentUser)==null?void 0:y.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[],blocks:[l.uuid]});return u.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected workflow type with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow type with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}async function rr(t,s,e,n,a){const c=n instanceof Ut;c&&s.checkAuth!==!1&&await n.auth.prepareAuth();const r={queryParams:"",isAuthNeeded:!0},{s3url:d,payload:l,headers:u,method:y,queryParams:S,attachmentHash:f,isExternalUrl:F,isAuthNeeded:g,isResponseBlob:V}={...r,...s};let _=s.url;const v=f?await e.files.fetchCache(f):void 0;if(f&&!v)throw new Error(`Cannot upload file ${f} because it's not cached.`);!F&&!_.startsWith("http")&&(!_.startsWith("/")&&!_.startsWith("blob:")&&(_="/"+_),_=t+_);const b=k=>{if(f){if(!d)throw new Error(`No S3 URL for file ${f}`);if("warning"in d)throw new Error(`S3 URL warning for file ${f}`);if(!v)throw new Error(`No file for file ${f}`);const H=d.fields["x-amz-checksum-sha1"];if(!H)throw new Error(`No checksum for file ${f}`);return k.set("x-amz-checksum-sha1",H).field({...l,...d.fields}).attach("file",v)}return k.send(l)},j={[h.GET]:()=>V?Nt.get(_.toString()).responseType("blob"):Nt.get(_.toString()),[h.POST]:()=>{const k=Nt.post(_.toString());return b(k)},[h.PATCH]:()=>{const k=Nt.patch(_.toString());return b(k)},[h.PUT]:()=>{const k=Nt.put(_.toString());return b(k)},[h.DELETE]:()=>{const k=Nt.delete(_.toString());return b(k)}}[y];let W=j();const q=()=>{console.debug("aborting request:",s.url),W.abort()};if(a==null||a.addEventListener("abort",q),g&&c){const k=n.auth.getAuthHeader();W=W.set("Authorization",k)}u&&(W=W.set(u));try{return await W.query(S)}catch(k){const H=DV(k),Js=H==null?void 0:H.status;if(c&&Js===401)return await n.auth.handleUnauthorized(W,H),W.query(S);throw new C({response:H,innerError:k,discard:ar.includes(Js)})}finally{a==null||a.removeEventListener("abort",q)}}class Dq{constructor(s){p(this,"store");this.store=s}_performRequest(s,e,n,a){const c=new xs,r={...e,uuid:e.uuid??Dt.v4()};return rr(s,r,this,n,a).then(d=>{c.resolve(d.body)}).catch(d=>{d instanceof Error?c.reject(d):c.reject(new Error((d??Zt).toString()))}),c}async performRequest(s,e,n,a){return this._performRequest(s,e,n,a).then(c=>{if(c instanceof C)throw c;return c})}async enqueueRequest(s,e,n){return this._enqueueRequest(s,e,n).then(a=>{if(a instanceof C)throw a;return a})}_enqueueRequest(s,e,n){const a=new xs,c={...s,BASE_URL:e,serviceName:n},r=this.store.dispatch(vT(c)),d=u=>{if(u)a.resolve(u.body);else{const y=new C({message:"Could not get a response from the server.",response:u,discard:!0});a.reject(y)}},l=u=>{u instanceof C?u.options.discard=!0:(console.error("Received an unexpected error while processing a request:",u,`
|
|
14
|
+
Converting error to APIError and discarding.`),u=new C({message:"An error occurred while processing the request.",innerError:u,discard:!0})),a.reject(u)};return r.then(d,l),a}async performPagination(s,e,n,a,c){const r={...e,queryParams:{...e.queryParams,paginate:!0,limit:n}},{method:d}=r,l=[];let u=await this.performRequest(s,r,a,c);for(l.push(u.results);u.next;)u=await this.performRequest(s,{url:u.next,method:d},a,c),l.push(u.results);return l}}class Xt{constructor(){p(this,"graph");p(this,"requestAttemptCounter");this.graph=new sk.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(s){const e=new Xt;for(let n=0;n<s.length;n++){const a=s[n];if(!a){console.error("Outbox item was undefined");continue}e.sneakRequest(a);for(let c=0;c<n;c++){const r=s[c];if(!r){console.error("Previous outbox item was undefined");continue}r.payload.uuid!==a.payload.uuid&&r.payload.blocks.some(d=>a.payload.blockers.includes(d))&&Xt._addDependency(a.payload.uuid,r.payload.uuid,e.graph)}}return e}_addDependency(s,e){Xt._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),a=new Set(n.payload.blocks);s.payload.blockers.some(c=>a.has(c))&&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),a=new Set(s.payload.blocks);n.payload.blockers.some(c=>a.has(c))&&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 a of s){const c=this.requestAttemptCounter[a]||0;c<e&&(e=c,n=a)}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),a=s.findIndex(c=>c.payload.uuid===n.payload.uuid);a!==-1&&(s.splice(a,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 a=this.requestAttemptCounter[e.payload.uuid]||0,c=this.requestAttemptCounter[n.payload.uuid]||0;return a-c}),s}registerRetry(s){this.requestAttemptCounter[s]=(this.requestAttemptCounter[s]||0)+1}}let zV;function qV(t){zV=t}function xt(){return zV}let jV;function $V(t){jV=t}function CV(){return jV}let dr=null;function Lt(){const t=xt();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(dr)return dr;const s=t.getState().offline.outbox,e=Xt._fromOutbox(s);return dr=e,e}const Wq=(t,s)=>{const e=new s(t);return $V(e),qV(t),e};class zq{constructor(s){p(this,"_all");p(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 lr{constructor(){p(this,"next");this.next=null}then(s){return new zq(this).then(s)}async run(s){if(this.next)return this.next.run(s);{if(console.debug("Middleware finished. Performing request:",s.payload.url),!xt())throw new Error("Client store not set");const n=CV();if(!n)throw new Error("Client SDK not set");return VV(s,n)}}}class UV extends lr{async run(s){return super.run(s)}}class LV extends lr{async run(s){return super.run(s)}}const NV=new UV().then(new LV).compile();function HV(t){var s;return(s=NV[0])==null?void 0:s.run(t)}var GV=(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))(GV||{});i.ALL_MIDDLEWARE=NV,i.APIError=C,i.AgentService=CW,i.AssetAttachmentService=UW,i.AssetProcedureService=YW,i.AssetProcedureStepFieldValuesAttachmentService=XW,i.AssetProcedureStepFieldValuesService=xW,i.AssetProcedureStepFieldsAttachmentService=JW,i.AssetProcedureStepFieldsService=ZW,i.AssetProcedureStepService=ez,i.AssetProcedureTypeAttachmentService=LW,i.AssetProcedureTypeFieldValuesAttachmentService=GW,i.AssetProcedureTypeFieldValuesService=KW,i.AssetProcedureTypeFieldsAttachmentService=NW,i.AssetProcedureTypeFieldsService=HW,i.AssetProcedureTypeService=QW,i.AssetService=tz,i.AssetStageCompletionService=sz,i.AssetStageService=iz,i.AssetStatusType=Sr,i.AssetTypeAttachmentService=nz,i.AssetTypeFieldValuesAttachmentService=rz,i.AssetTypeFieldValuesService=dz,i.AssetTypeFieldsAttachmentService=az,i.AssetTypeFieldsService=cz,i.AssetTypeIdentifierService=lz,i.AssetTypeIdentifierValueService=uz,i.AssetTypeService=oz,i.AssetTypeStatusService=hz,i.AttachmentModel=mr,i.BaseApiService=Ut,i.BaseModelApiService=qt,i.BaseOfflineFileModelApiService=z,i.BaseOfflineModelApiService=M,i.BaseSDK=Dq,i.COMMON_AUTO_FIELDS=br,i.DEFAULT_ISSUE_PRIORITY=ik,i.DEFAULT_PAGE_SIZE=OV,i.DEFAULT_WORKFLOW_STATUS=ck,i.DISCARD_HTTP_STATUSES=ar,i.DeferredPromise=xs,i.DocumentAttachmentService=pz,i.DocumentService=yz,i.EMPTY_ARRAY=hr,i.EMPTY_OBJECT=pr,i.EmailDomainsService=Sz,i.EmailVerificationService=mz,i.FILE_MODEL_DEFAULT_PAGE_SIZE=IV,i.FileService=fz,i.FormIdentifierService=Az,i.FormIdentifierValueService=wz,i.FormRevisionAttachmentService=Pz,i.FormRevisionService=Tz,i.FormService=Oz,i.FormSubmissionAttachmentService=Iz,i.FormSubmissionService=Fz,i.GeoImageService=_z,i.HttpMethod=h,i.IssueAssociationService=gz,i.IssueAttachmentService=Rz,i.IssueCommentAttachmentService=bz,i.IssueCommentService=Mz,i.IssuePriority=Xs,i.IssueService=vz,i.IssueStatusType=fr,i.IssueTypeAttachmentService=Ez,i.IssueTypeFieldValuesAttachmentService=Bz,i.IssueTypeFieldValuesService=Dz,i.IssueTypeFieldsAttachmentService=Vz,i.IssueTypeFieldsService=kz,i.IssueTypeIdentifierService=Wz,i.IssueTypeIdentifierValueService=zz,i.IssueTypeService=qz,i.IssueTypeStatusService=jz,i.IssueUpdateChange=$,i.IssueUpdateService=$z,i.JWTService=Lz,i.MAX_SERVICE_BATCH_SIZE=L,i.OUTBOX_RETRY_DELAY=Tr,i.OfflineAnalyticsMiddleware=UV,i.OfflineMiddleware=lr,i.OrganizationAccessLevel=yr,i.OrganizationAccessService=Nz,i.OrganizationService=Hz,i.OutboxCoordinator=Xt,i.ProcedureService=Jz,i.ProcedureStepAssigneeService=Zz,i.ProcedureStepCommentService=Xz,i.ProcedureStepDefaultAssigneeService=xz,i.ProcedureStepDefaultReviewerService=eq,i.ProcedureStepEventService=tq,i.ProcedureStepEventType=wr,i.ProcedureStepFieldValuesAttachmentService=nq,i.ProcedureStepFieldValuesReviewRequestService=aq,i.ProcedureStepFieldValuesReviewService=cq,i.ProcedureStepFieldValuesReviewType=Pr,i.ProcedureStepFieldValuesService=rq,i.ProcedureStepFieldsAttachmentService=sq,i.ProcedureStepFieldsService=iq,i.ProcedureStepReviewerService=dq,i.ProcedureStepService=lq,i.ProcedureTypeAttachmentService=uq,i.ProcedureTypeFieldValuesAttachmentService=pq,i.ProcedureTypeFieldValuesService=yq,i.ProcedureTypeFieldsAttachmentService=oq,i.ProcedureTypeFieldsService=hq,i.ProcedureTypeService=Sq,i.ProjectAccessService=Gz,i.ProjectAttachmentService=Kz,i.ProjectFileService=Yz,i.ProjectService=Qz,i.RESET_ORGANIZATION_STATE=I,i.RESET_PROJECT_STATE=B,i.RESET_STATE=T,i.RateLimitingMiddleware=LV,i.SelectorBuilder=vk,i.TeamMembershipService=mq,i.TeamService=fq,i.UNKNOWN_ERROR_MESSAGE=Zt,i.UserService=Aq,i.VERSION_REDUCER_KEY=ss,i.VerificationCodeType=GV,i.WORKFLOW_STATUSES=ak,i.WORKFLOW_STEP_FIELD_VALUES_REVIEW_TYPES=nk,i.WorkflowIssueLinkService=Pq,i.WorkflowService=wq,i.WorkflowStatus=Gt,i.WorkflowStepAssigneeService=Tq,i.WorkflowStepCommentService=Oq,i.WorkflowStepDefaultAssigneeService=Iq,i.WorkflowStepDefaultReviewerService=Fq,i.WorkflowStepEventService=_q,i.WorkflowStepEventType=Ar,i.WorkflowStepFieldValuesAttachmentService=bq,i.WorkflowStepFieldValuesReviewRequestService=Mq,i.WorkflowStepFieldValuesReviewService=vq,i.WorkflowStepFieldValuesReviewType=ts,i.WorkflowStepFieldValuesService=Eq,i.WorkflowStepFieldsAttachmentService=gq,i.WorkflowStepFieldsService=Rq,i.WorkflowStepReviewerService=Vq,i.WorkflowStepService=kq,i.WorkflowTypeService=Bq,i._setLatestRetryTime=VT,i.addAsset=co,i.addAssetAttachment=Hr,i.addAssetAttachments=ri,i.addAssetProcedure=wl,i.addAssetProcedureStep=Yu,i.addAssetProcedureStepFieldValues=Vu,i.addAssetProcedureStepFieldValuesAttachment=wu,i.addAssetProcedureStepFieldValuesAttachments=vi,i.addAssetProcedureStepFieldValuesMany=ku,i.addAssetProcedureStepFields=cu,i.addAssetProcedureStepFieldsAttachment=Gl,i.addAssetProcedureStepFieldsAttachments=Kl,i.addAssetProcedureStepFieldsMany=ru,i.addAssetProcedureSteps=Qu,i.addAssetProcedureType=Vl,i.addAssetProcedureTypeAttachment=nd,i.addAssetProcedureTypeAttachments=ad,i.addAssetProcedureTypeFieldValues=al,i.addAssetProcedureTypeFieldValuesAttachment=Gd,i.addAssetProcedureTypeFieldValuesAttachments=mi,i.addAssetProcedureTypeFieldValuesMany=cl,i.addAssetProcedureTypeFields=Vd,i.addAssetProcedureTypeFieldsAttachment=Ad,i.addAssetProcedureTypeFieldsAttachments=wd,i.addAssetProcedureTypeFieldsMany=kd,i.addAssetProcedureTypes=kl,i.addAssetProcedures=Ti,i.addAssetStage=zo,i.addAssetStageCompletion=Po,i.addAssetStageCompletions=To,i.addAssetStages=qo,i.addAssetType=qp,i.addAssetTypeAttachment=Yo,i.addAssetTypeAttachments=Ni,i.addAssetTypeFieldValues=Yh,i.addAssetTypeFieldValuesAttachment=Dh,i.addAssetTypeFieldValuesAttachments=Zi,i.addAssetTypeFieldValuesMany=Qh,i.addAssetTypeFields=Th,i.addAssetTypeFieldsAttachment=rh,i.addAssetTypeFieldsAttachments=dh,i.addAssetTypeFieldsMany=Oh,i.addAssetTypeIdentifier=dp,i.addAssetTypeIdentifierValue=Op,i.addAssetTypeIdentifierValues=Ip,i.addAssetTypeIdentifiers=lp,i.addAssetTypeStatus=Jp,i.addAssetTypeStatuses=Zp,i.addAssetTypes=jp,i.addAssets=zi,i.addConversation=jr,i.addConversations=Ek,i.addDocument=Ry,i.addDocumentAttachment=py,i.addDocumentAttachments=yy,i.addDocuments=by,i.addEmailDomain=Cy,i.addEmailDomains=Uy,i.addForm=sm,i.addFormIdentifier=nS,i.addFormIdentifierValue=AS,i.addFormIdentifierValues=wS,i.addFormIdentifiers=aS,i.addFormRevision=Tn,i.addFormRevisionAttachment=VS,i.addFormRevisionAttachments=kS,i.addFormRevisions=On,i.addFormSubmission=vm,i.addFormSubmissionAttachment=mm,i.addFormSubmissionAttachments=Mn,i.addFormSubmissions=Dn,i.addForms=im,i.addGeoImage=Lm,i.addGeoImages=Nm,i.addIssue=aA,i.addIssueAssociation=cf,i.addIssueAssociations=jt,i.addIssueAttachment=wf,i.addIssueAttachments=Un,i.addIssueComment=Gf,i.addIssueCommentAttachment=Vf,i.addIssueCommentAttachments=kf,i.addIssueComments=Kf,i.addIssueType=rP,i.addIssueTypeAttachment=AA,i.addIssueTypeAttachments=wA,i.addIssueTypeFieldValues=GA,i.addIssueTypeFieldValuesAttachment=Pw,i.addIssueTypeFieldValuesAttachments=aa,i.addIssueTypeFieldValuesMany=KA,i.addIssueTypeFields=cw,i.addIssueTypeFieldsAttachment=VA,i.addIssueTypeFieldsAttachments=kA,i.addIssueTypeFieldsMany=rw,i.addIssueTypeIdentifier=kw,i.addIssueTypeIdentifierValue=Kw,i.addIssueTypeIdentifierValues=Yw,i.addIssueTypeIdentifiers=Bw,i.addIssueTypeStatus=TP,i.addIssueTypeStatuses=OP,i.addIssueTypes=dP,i.addIssueUpdate=fa,i.addIssueUpdates=Aa,i.addIssues=Jn,i.addOrganization=AT,i.addOrganizationAccess=tT,i.addOrganizationAccesses=sT,i.addOrganizations=fT,i.addProcedure=qO,i.addProcedureStep=eg,i.addProcedureStepAssignee=ZO,i.addProcedureStepAssignees=XO,i.addProcedureStepComment=oI,i.addProcedureStepComments=hI,i.addProcedureStepDefaultAssignee=_I,i.addProcedureStepDefaultAssignees=gI,i.addProcedureStepDefaultReviewer=jI,i.addProcedureStepDefaultReviewers=$I,i.addProcedureStepEvent=xI,i.addProcedureStepEvents=eF,i.addProcedureStepFieldValues=XF,i.addProcedureStepFieldValuesAttachment=jF,i.addProcedureStepFieldValuesAttachments=xa,i.addProcedureStepFieldValuesMany=xF,i.addProcedureStepFieldValuesReview=__,i.addProcedureStepFieldValuesReviewRequest=h_,i.addProcedureStepFieldValuesReviewRequests=nc,i.addProcedureStepFieldValuesReviews=rc,i.addProcedureStepFields=gF,i.addProcedureStepFieldsAttachment=pF,i.addProcedureStepFieldsAttachments=Ka,i.addProcedureStepFieldsMany=RF,i.addProcedureStepReviewer=q_,i.addProcedureStepReviewers=j_,i.addProcedureSteps=tg,i.addProcedureType=RR,i.addProcedureTypeAttachment=hg,i.addProcedureTypeAttachments=pg,i.addProcedureTypeFieldValues=pR,i.addProcedureTypeFieldValuesAttachment=eR,i.addProcedureTypeFieldValuesAttachments=Ac,i.addProcedureTypeFieldValuesMany=yR,i.addProcedureTypeFields=$g,i.addProcedureTypeFieldsAttachment=gg,i.addProcedureTypeFieldsAttachments=Rg,i.addProcedureTypeFieldsMany=Cg,i.addProcedureTypes=bR,i.addProcedures=za,i.addProject=RO,i.addProjectAccess=WT,i.addProjectAccesses=zT,i.addProjectAttachment=QT,i.addProjectAttachments=JT,i.addProjectFile=oO,i.addProjectFiles=hO,i.addProjects=gO,i.addTeam=sb,i.addTeamMembership=UR,i.addTeamMemberships=LR,i.addTeams=ib,i.addUser=Fa,i.addUsers=GP,i.addWorkflow=Ab,i.addWorkflowIssueLink=Vb,i.addWorkflowIssueLinks=ps,i.addWorkflowStep=QE,i.addWorkflowStepAssignee=Kb,i.addWorkflowStepAssignees=Yb,i.addWorkflowStepComment=rM,i.addWorkflowStepComments=dM,i.addWorkflowStepDefaultAssignee=TM,i.addWorkflowStepDefaultAssignees=OM,i.addWorkflowStepDefaultReviewer=DM,i.addWorkflowStepDefaultReviewers=WM,i.addWorkflowStepEvent=QM,i.addWorkflowStepEvents=JM,i.addWorkflowStepFieldValues=Qv,i.addWorkflowStepFieldValuesAttachment=Wv,i.addWorkflowStepFieldValuesAttachments=Lc,i.addWorkflowStepFieldValuesMany=Jv,i.addWorkflowStepFieldValuesReview=OE,i.addWorkflowStepFieldValuesReviewRequest=lE,i.addWorkflowStepFieldValuesReviewRequests=Yc,i.addWorkflowStepFieldValuesReviews=Zc,i.addWorkflowStepFields=Ov,i.addWorkflowStepFieldsAttachment=lv,i.addWorkflowStepFieldsAttachments=qc,i.addWorkflowStepFieldsMany=Iv,i.addWorkflowStepReviewer=DE,i.addWorkflowStepReviewers=WE,i.addWorkflowSteps=JE,i.addWorkflowType=lV,i.addWorkflowTypes=uV,i.addWorkflows=wb,i.agentsReducer=Ur,i.agentsSlice=ni,i.areArraysEqual=uk,i.assetAttachmentReducer=td,i.assetAttachmentSlice=ci,i.assetProcedureReducer=_l,i.assetProcedureSlice=Pi,i.assetProcedureStepFieldValuesAttachmentReducer=Mu,i.assetProcedureStepFieldValuesAttachmentSlice=Mi,i.assetProcedureStepFieldValuesReducer=Lu,i.assetProcedureStepFieldValuesSlice=ki,i.assetProcedureStepFieldsAttachmentReducer=iu,i.assetProcedureStepFieldsAttachmentSlice=_i,i.assetProcedureStepFieldsReducer=mu,i.assetProcedureStepFieldsSlice=Ri,i.assetProcedureStepReducer=eo,i.assetProcedureStepSlice=Bi,i.assetProcedureTypeAttachmentReducer=hd,i.assetProcedureTypeAttachmentSlice=ui,i.assetProcedureTypeFieldValuesAttachmentReducer=Xd,i.assetProcedureTypeFieldValuesAttachmentSlice=Si,i.assetProcedureTypeFieldValuesReducer=pl,i.assetProcedureTypeFieldValuesSlice=wi,i.assetProcedureTypeFieldsAttachmentReducer=gd,i.assetProcedureTypeFieldsAttachmentSlice=hi,i.assetProcedureTypeFieldsReducer=$d,i.assetProcedureTypeFieldsSlice=yi,i.assetProcedureTypeReducer=$l,i.assetProcedureTypeSlice=Ii,i.assetReducer=fo,i.assetSlice=Wi,i.assetStageCompletionReducer=bo,i.assetStageCompletionSlice=ji,i.assetStageReducer=Lo,i.assetStageSlice=$i,i.assetTypeAttachmentReducer=nh,i.assetTypeAttachmentSlice=Li,i.assetTypeFieldValuesAttachmentReducer=Hh,i.assetTypeFieldValuesAttachmentSlice=Ji,i.assetTypeFieldValuesReducer=ap,i.assetTypeFieldValuesSlice=en,i.assetTypeFieldsAttachmentReducer=Ah,i.assetTypeFieldsAttachmentSlice=Ki,i.assetTypeFieldsReducer=Vh,i.assetTypeFieldsSlice=Qi,i.assetTypeIdentifierReducer=wp,i.assetTypeIdentifierSlice=tn,i.assetTypeIdentifierValueReducer=kp,i.assetTypeIdentifierValueSlice=nn,i.assetTypeReducer=Kp,i.assetTypeSlice=an,i.assetTypeStatusReducer=ry,i.assetTypeStatusSlice=rn,i.assetTypeStatusSortFn=Er,i.authReducer=uy,i.authSlice=Es,i.baseReducer=gW,i.baseReducers=nr,i.clearTokens=SB,i.createModelAdapter=O,i.createOfflineAction=bT,i.createPayload=R,i.createSelectionAdapter=rk,i.deleteAsset=uo,i.deleteAssetAttachment=Jr,i.deleteAssetAttachments=di,i.deleteAssetProcedure=Ol,i.deleteAssetProcedureStep=Xu,i.deleteAssetProcedureStepFieldValues=qu,i.deleteAssetProcedureStepFieldValuesAttachment=Fu,i.deleteAssetProcedureStepFieldValuesAttachments=Ei,i.deleteAssetProcedureStepFieldValuesMany=ju,i.deleteAssetProcedureStepFields=hu,i.deleteAssetProcedureStepFieldsAttachment=Xl,i.deleteAssetProcedureStepFieldsAttachments=xl,i.deleteAssetProcedureStepFieldsMany=pu,i.deleteAssetProcedureSteps=xu,i.deleteAssetProcedureType=Wl,i.deleteAssetProcedureTypeAttachment=ud,i.deleteAssetProcedureTypeAttachments=od,i.deleteAssetProcedureTypeFieldValues=ol,i.deleteAssetProcedureTypeFieldValuesAttachment=Zd,i.deleteAssetProcedureTypeFieldValuesAttachments=fi,i.deleteAssetProcedureTypeFieldValuesMany=hl,i.deleteAssetProcedureTypeFields=qd,i.deleteAssetProcedureTypeFieldsAttachment=Fd,i.deleteAssetProcedureTypeFieldsAttachments=_d,i.deleteAssetProcedureTypeFieldsMany=jd,i.deleteAssetProcedureTypes=zl,i.deleteAssetProcedures=Oi,i.deleteAssetStage=Co,i.deleteAssetStageCompletion=go,i.deleteAssetStageCompletions=Ro,i.deleteAssetStages=Uo,i.deleteAssetType=Up,i.deleteAssetTypeAttachment=xo,i.deleteAssetTypeAttachments=Hi,i.deleteAssetTypeFieldValues=ep,i.deleteAssetTypeFieldValuesAttachment=$h,i.deleteAssetTypeFieldValuesAttachments=Xi,i.deleteAssetTypeFieldValuesMany=tp,i.deleteAssetTypeFields=Rh,i.deleteAssetTypeFieldsAttachment=ph,i.deleteAssetTypeFieldsAttachments=yh,i.deleteAssetTypeFieldsMany=bh,i.deleteAssetTypeIdentifier=yp,i.deleteAssetTypeIdentifierValue=bp,i.deleteAssetTypeIdentifierValues=Mp,i.deleteAssetTypeIdentifiers=Sp,i.deleteAssetTypeStatus=sy,i.deleteAssetTypeStatuses=iy,i.deleteAssetTypes=Lp,i.deleteAssets=qi,i.deleteConversation=Bk,i.deleteConversations=Dk,i.deleteDocument=ky,i.deleteDocumentAttachment=wy,i.deleteDocumentAttachments=Py,i.deleteDocuments=By,i.deleteEmailDomain=Ky,i.deleteEmailDomains=Yy,i.deleteForm=dm,i.deleteFormIdentifier=uS,i.deleteFormIdentifierValue=FS,i.deleteFormIdentifierValues=_S,i.deleteFormIdentifiers=oS,i.deleteFormRevision=In,i.deleteFormRevisionAttachment=qS,i.deleteFormRevisionAttachments=jS,i.deleteFormRevisions=Fn,i.deleteFormSubmission=km,i.deleteFormSubmissionAttachment=Tm,i.deleteFormSubmissionAttachments=vn,i.deleteFormSubmissions=Wn,i.deleteForms=lm,i.deleteGeoImage=Km,i.deleteGeoImages=Ym,i.deleteIssue=uA,i.deleteIssueAssociation=rf,i.deleteIssueAssociations=$t,i.deleteIssueAttachment=Ff,i.deleteIssueAttachments=Ln,i.deleteIssueComment=Xf,i.deleteIssueCommentAttachment=qf,i.deleteIssueCommentAttachments=jf,i.deleteIssueComments=xf,i.deleteIssueType=pP,i.deleteIssueTypeAttachment=FA,i.deleteIssueTypeAttachments=_A,i.deleteIssueTypeFieldValues=XA,i.deleteIssueTypeFieldValuesAttachment=_w,i.deleteIssueTypeFieldValuesAttachments=ca,i.deleteIssueTypeFieldValuesMany=xA,i.deleteIssueTypeFields=hw,i.deleteIssueTypeFieldsAttachment=qA,i.deleteIssueTypeFieldsAttachments=jA,i.deleteIssueTypeFieldsMany=pw,i.deleteIssueTypeIdentifier=jw,i.deleteIssueTypeIdentifierValue=xw,i.deleteIssueTypeIdentifierValues=eP,i.deleteIssueTypeIdentifiers=$w,i.deleteIssueTypeStatus=RP,i.deleteIssueTypeStatuses=bP,i.deleteIssueTypes=yP,i.deleteIssueUpdate=wa,i.deleteIssueUpdates=Pa,i.deleteIssues=Zn,i.deleteOrganization=TT,i.deleteOrganizationAccess=rT,i.deleteOrganizationAccesses=dT,i.deleteOrganizations=OT,i.deleteProcedure=LO,i.deleteProcedureStep=ng,i.deleteProcedureStepAssignee=iI,i.deleteProcedureStepAssignees=nI,i.deleteProcedureStepComment=fI,i.deleteProcedureStepComments=AI,i.deleteProcedureStepDefaultAssignee=EI,i.deleteProcedureStepDefaultAssignees=VI,i.deleteProcedureStepDefaultReviewer=HI,i.deleteProcedureStepDefaultReviewers=GI,i.deleteProcedureStepEvent=aF,i.deleteProcedureStepEvents=cF,i.deleteProcedureStepFieldValues=n_,i.deleteProcedureStepFieldValuesAttachment=NF,i.deleteProcedureStepFieldValuesAttachments=ec,i.deleteProcedureStepFieldValuesMany=a_,i.deleteProcedureStepFieldValuesReview=v_,i.deleteProcedureStepFieldValuesReviewRequest=f_,i.deleteProcedureStepFieldValuesReviewRequests=ac,i.deleteProcedureStepFieldValuesReviews=dc,i.deleteProcedureStepFields=VF,i.deleteProcedureStepFieldsAttachment=AF,i.deleteProcedureStepFieldsAttachments=Ya,i.deleteProcedureStepFieldsMany=kF,i.deleteProcedureStepReviewer=N_,i.deleteProcedureStepReviewers=H_,i.deleteProcedureSteps=ag,i.deleteProcedureType=kR,i.deleteProcedureTypeAttachment=Ag,i.deleteProcedureTypeAttachments=wg,i.deleteProcedureTypeFieldValues=wR,i.deleteProcedureTypeFieldValuesAttachment=aR,i.deleteProcedureTypeFieldValuesAttachments=wc,i.deleteProcedureTypeFieldValuesMany=PR,i.deleteProcedureTypeFields=Gg,i.deleteProcedureTypeFieldsAttachment=Vg,i.deleteProcedureTypeFieldsAttachments=kg,i.deleteProcedureTypeFieldsMany=Kg,i.deleteProcedureTypes=BR,i.deleteProcedures=qa,i.deleteProject=vO,i.deleteProjectAccess=UT,i.deleteProjectAccesses=LT,i.deleteProjectAttachment=tO,i.deleteProjectAttachments=sO,i.deleteProjectFile=SO,i.deleteProjectFiles=mO,i.deleteProjects=EO,i.deleteTeam=db,i.deleteTeamMembership=YR,i.deleteTeamMemberships=QR,i.deleteTeams=lb,i.deleteUser=_a,i.deleteUsers=QP,i.deleteWorkflow=Fb,i.deleteWorkflowIssueLink=zb,i.deleteWorkflowIssueLinks=ys,i.deleteWorkflowStep=tV,i.deleteWorkflowStepAssignee=xb,i.deleteWorkflowStepAssignees=eM,i.deleteWorkflowStepComment=pM,i.deleteWorkflowStepComments=yM,i.deleteWorkflowStepDefaultAssignee=RM,i.deleteWorkflowStepDefaultAssignees=bM,i.deleteWorkflowStepDefaultReviewer=CM,i.deleteWorkflowStepDefaultReviewers=UM,i.deleteWorkflowStepEvent=tv,i.deleteWorkflowStepEvents=sv,i.deleteWorkflowStepFieldValues=tE,i.deleteWorkflowStepFieldValuesAttachment=Cv,i.deleteWorkflowStepFieldValuesAttachments=Nc,i.deleteWorkflowStepFieldValuesMany=sE,i.deleteWorkflowStepFieldValuesReview=RE,i.deleteWorkflowStepFieldValuesReviewRequest=yE,i.deleteWorkflowStepFieldValuesReviewRequests=Qc,i.deleteWorkflowStepFieldValuesReviews=Xc,i.deleteWorkflowStepFields=bv,i.deleteWorkflowStepFieldsAttachment=yv,i.deleteWorkflowStepFieldsAttachments=jc,i.deleteWorkflowStepFieldsMany=Mv,i.deleteWorkflowStepReviewer=CE,i.deleteWorkflowStepReviewers=UE,i.deleteWorkflowSteps=sV,i.deleteWorkflowType=SV,i.deleteWorkflowTypes=mV,i.deleteWorkflows=_b,i.dequeue=EV,i.discard=kV,i.documentAttachmentReducer=Fy,i.documentAttachmentSlice=ln,i.documentSlice=on,i.documentsReducer=Dy,i.downloadFile=Ak,i.emailDomainsReducer=Xy,i.emailDomainsSlice=pn,i.emailRegex=gk,i.enqueue=vV,i.enqueueRequest=vT,i.extractResponseFromError=DV,i.fallbackToEmptyArray=A,i.fallbackToEmptyObject=is,i.fetchBlobFromObjectUrl=Fr,i.fetchFileFromObjectUrl=_r,i.fileReducer=tS,i.fileSlice=Sn,i.formIdentifierReducer=SS,i.formIdentifierSlice=mn,i.formIdentifierValueReducer=MS,i.formIdentifierValueSlice=An,i.formReducer=um,i.formRevisionAttachmentReducer=LS,i.formRevisionAttachmentSlice=wn,i.formRevisionReducer=xS,i.formRevisionsSlice=Pn,i.formSlice=gn,i.formSubmissionAttachmentReducer=_m,i.formSubmissionAttachmentSlice=bn,i.formSubmissionReducer=qm,i.formSubmissionSlice=Bn,i.geoImageReducer=Xm,i.geoImageSlice=qn,i.getAssetProcedureStepSubTree=vr,i.getAssetProcedureStepTrees=Rk,i.getClientSDK=CV,i.getClientStore=xt,i.getDocumentSubTree=Br,i.getDocumentTrees=bk,i.getFileExtension=Ir,i.getLocalDateString=Or,i.getLocalRelativeDateString=yk,i.getOutboxCoordinator=Lt,i.getProcedureStepSubTree=Wr,i.getProcedureStepTrees=Mk,i.getRenamedFile=fk,i.getRequestDescription=w,i.getS3FileKey=mk,i.hashFile=Ts,i.initSDK=Wq,i.initializeAssetAttachments=Nr,i.initializeAssetProcedureStepFieldValues=Eu,i.initializeAssetProcedureStepFieldValuesAttachments=Au,i.initializeAssetProcedureStepFields=au,i.initializeAssetProcedureStepFieldsAttachments=Hl,i.initializeAssetProcedureSteps=Hu,i.initializeAssetProcedureTypeAttachments=id,i.initializeAssetProcedureTypeFieldValues=nl,i.initializeAssetProcedureTypeFieldValuesAttachments=Hd,i.initializeAssetProcedureTypeFields=Ed,i.initializeAssetProcedureTypeFieldsAttachments=fd,i.initializeAssetProcedureTypes=El,i.initializeAssetProcedures=Al,i.initializeAssetStageCompletions=wo,i.initializeAssetStages=Bo,i.initializeAssetTypeAttachments=Ko,i.initializeAssetTypeFieldValues=Kh,i.initializeAssetTypeFieldValuesAttachments=Bh,i.initializeAssetTypeFields=Ph,i.initializeAssetTypeFieldsAttachments=ch,i.initializeAssetTypeIdentifierValues=Tp,i.initializeAssetTypeIdentifiers=rp,i.initializeAssetTypeStatuses=Qp,i.initializeAssetTypes=Dp,i.initializeAssets=ao,i.initializeConversations=qr,i.initializeDocumentAttachments=hy,i.initializeDocuments=gy,i.initializeEmailDomains=$y,i.initializeFormIdentifierValues=fS,i.initializeFormIdentifiers=iS,i.initializeFormRevisionAttachments=ES,i.initializeFormRevisions=HS,i.initializeFormSubmissionAttachments=Sm,i.initializeFormSubmissions=Rm,i.initializeForms=tm,i.initializeGeoImages=$m,i.initializeIssueAssociations=ef,i.initializeIssueAttachments=Af,i.initializeIssueCommentAttachments=Ef,i.initializeIssueComments=Hf,i.initializeIssueTypeAttachments=fA,i.initializeIssueTypeFieldValues=HA,i.initializeIssueTypeFieldValuesAttachments=ww,i.initializeIssueTypeFields=aw,i.initializeIssueTypeFieldsAttachments=EA,i.initializeIssueTypeIdentifierValues=Gw,i.initializeIssueTypeIdentifiers=Vw,i.initializeIssueTypeStatuses=PP,i.initializeIssueTypes=cP,i.initializeIssueUpdates=kP,i.initializeIssues=nA,i.initializeOrganizationAccesses=eT,i.initializeOrganizations=yT,i.initializeProcedureStepAssignees=JO,i.initializeProcedureStepComments=uI,i.initializeProcedureStepDefaultAssignees=FI,i.initializeProcedureStepDefaultReviewers=qI,i.initializeProcedureStepEvents=XI,i.initializeProcedureStepFieldValues=ZF,i.initializeProcedureStepFieldValuesAttachments=qF,i.initializeProcedureStepFieldValuesReviewRequests=o_,i.initializeProcedureStepFieldValuesReviews=F_,i.initializeProcedureStepFields=_F,i.initializeProcedureStepFieldsAttachments=hF,i.initializeProcedureStepReviewers=z_,i.initializeProcedureSteps=Z_,i.initializeProcedureTypeAttachments=og,i.initializeProcedureTypeFieldValues=hR,i.initializeProcedureTypeFieldValuesAttachments=xg,i.initializeProcedureTypeFields=jg,i.initializeProcedureTypeFieldsAttachments=_g,i.initializeProcedureTypes=gR,i.initializeProcedures=zO,i.initializeProjectAccesses=DT,i.initializeProjectAttachments=YT,i.initializeProjectFiles=dO,i.initializeProjects=IO,i.initializeTeamMemberships=CR,i.initializeTeams=tb,i.initializeUsers=LP,i.initializeWorkflowIssueLinks=Eb,i.initializeWorkflowStepAssignees=Gb,i.initializeWorkflowStepComments=cM,i.initializeWorkflowStepDefaultAssignees=PM,i.initializeWorkflowStepDefaultReviewers=BM,i.initializeWorkflowStepEvents=YM,i.initializeWorkflowStepFieldValues=Yv,i.initializeWorkflowStepFieldValuesAttachments=Dv,i.initializeWorkflowStepFieldValuesReviewRequests=dE,i.initializeWorkflowStepFieldValuesReviews=TE,i.initializeWorkflowStepFields=Tv,i.initializeWorkflowStepFieldsAttachments=dv,i.initializeWorkflowStepReviewers=BE,i.initializeWorkflowSteps=YE,i.initializeWorkflowTypes=dV,i.initializeWorkflows=fb,i.isImageFile=wk,i.isObjectUrl=gr,i.isToday=pk,i.issueAssociationReducer=mf,i.issueAssociationSlice=$n,i.issueAttachmentReducer=Mf,i.issueAttachmentSlice=Cn,i.issueCommentAttachmentReducer=Lf,i.issueCommentAttachmentSlice=Hn,i.issueCommentReducer=sA,i.issueCommentSlice=Kn,i.issueReducer=SA,i.issueSlice=Qn,i.issueTypeAttachmentReducer=MA,i.issueTypeAttachmentSlice=Xn,i.issueTypeFieldValuesAttachmentReducer=vw,i.issueTypeFieldValuesAttachmentSlice=na,i.issueTypeFieldValuesReducer=iw,i.issueTypeFieldValuesSlice=sa,i.issueTypeFieldsAttachmentReducer=LA,i.issueTypeFieldsAttachmentSlice=ea,i.issueTypeFieldsReducer=fw,i.issueTypeFieldsSlice=ia,i.issueTypeIdentifierReducer=Nw,i.issueTypeIdentifierSlice=da,i.issueTypeIdentifierValueReducer=nP,i.issueTypeIdentifierValueSlice=ua,i.issueTypeReducer=AP,i.issueTypeSlice=oa,i.issueTypeStatusReducer=EP,i.issueTypeStatusSlice=pa,i.issueTypeStatusSortFn=Vr,i.issueUpdateReducer=CP,i.issueUpdateSlice=ma,i.logOnlyOnce=Pk,i.markAsDeleted=ET,i.markForDeletion=XB,i.memoize=ti,i.organizationAccessReducer=lT,i.organizationAccessSlice=Ra,i.organizationReducer=RT,i.organizationSlice=ba,i.outboxReducer=kT,i.outboxSlice=Ma,i.overmapEnhancer=DW,i.overmapReducer=RW,i.overmapReducers=TV,i.performRequest=rr,i.performRequestFromAction=VV,i.procedureReducer=NO,i.procedureSlice=Wa,i.procedureStepAssigneeReducer=dI,i.procedureStepAssigneeSlice=ja,i.procedureStepCommentReducer=OI,i.procedureStepCommentSlice=$a,i.procedureStepDefaultAssigneeReducer=WI,i.procedureStepDefaultAssigneeSlice=Ca,i.procedureStepDefaultReviewerReducer=JI,i.procedureStepDefaultReviewerSlice=La,i.procedureStepEventReducer=uF,i.procedureStepEventSlice=Ha,i.procedureStepFieldValuesAttachmentReducer=QF,i.procedureStepFieldValuesAttachmentSlice=Xa,i.procedureStepFieldValuesReducer=l_,i.procedureStepFieldValuesReviewReducer=D_,i.procedureStepFieldValuesReviewRequestReducer=O_,i.procedureStepFieldValuesReviewRequestSlice=ic,i.procedureStepFieldValuesReviewSlice=cc,i.procedureStepFieldValuesSlice=sc,i.procedureStepFieldsAttachmentReducer=IF,i.procedureStepFieldsAttachmentSlice=Ga,i.procedureStepFieldsReducer=WF,i.procedureStepFieldsSlice=Ja,i.procedureStepReducer=cg,i.procedureStepReviewerReducer=Q_,i.procedureStepReviewerSlice=lc,i.procedureStepSlice=uc,i.procedureTypeAttachmentReducer=Pg,i.procedureTypeAttachmentSlice=hc,i.procedureTypeFieldValuesAttachmentReducer=cR,i.procedureTypeFieldValuesAttachmentSlice=fc,i.procedureTypeFieldValuesReducer=TR,i.procedureTypeFieldValuesSlice=Tc,i.procedureTypeFieldsAttachmentReducer=Bg,i.procedureTypeFieldsAttachmentSlice=yc,i.procedureTypeFieldsReducer=Yg,i.procedureTypeFieldsSlice=mc,i.procedureTypeReducer=DR,i.procedureTypeSlice=Ic,i.projectAccessReducer=NT,i.projectAccessSlice=va,i.projectAttachmentReducer=cO,i.projectAttachmentSlice=Va,i.projectFileReducer=TO,i.projectFileSlice=Ba,i.projectReducer=VO,i.projectSlice=Da,i.rehydratedReducer=jR,i.rehydratedSlice=Fc,i.restructureSelectorWithArgs=m,i.runMiddleware=HV,i.selectAccessToken=mB,i.selectAccessesByUserOfProject=eD,i.selectAccessibleProjects=iD,i.selectActiveOrganizationAccess=YB,i.selectAllDocumentAttachments=un,i.selectAssetAttachmentById=Xr,i.selectAssetAttachmentMapping=Zr,i.selectAssetAttachments=li,i.selectAssetAttachmentsByIds=xr,i.selectAssetById=So,i.selectAssetProcedureById=bl,i.selectAssetProcedureStepById=to,i.selectAssetProcedureStepFieldValues=ns,i.selectAssetProcedureStepFieldValuesAttachmentById=gu,i.selectAssetProcedureStepFieldValuesAttachments=Vi,i.selectAssetProcedureStepFieldValuesAttachmentsByIds=Ru,i.selectAssetProcedureStepFieldValuesAttachmentsMapping=_u,i.selectAssetProcedureStepFieldValuesById=Cu,i.selectAssetProcedureStepFieldValuesByIds=Uu,i.selectAssetProcedureStepFieldValuesMapping=$u,i.selectAssetProcedureStepFieldValuesOfAsset=Jk,i.selectAssetProcedureStepFieldValuesOfAssetProcedure=Zk,i.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=Xk,i.selectAssetProcedureStepFields=gs,i.selectAssetProcedureStepFieldsAttachmentById=tu,i.selectAssetProcedureStepFieldsAttachments=gi,i.selectAssetProcedureStepFieldsAttachmentsByIds=su,i.selectAssetProcedureStepFieldsAttachmentsMapping=eu,i.selectAssetProcedureStepFieldsById=yu,i.selectAssetProcedureStepFieldsByIds=Su,i.selectAssetProcedureStepFieldsMapping=bi,i.selectAssetProcedureStepFieldsOfAssetProcedureStep=Kk,i.selectAssetProcedureStepMapping=Rs,i.selectAssetProcedureSteps=Di,i.selectAssetProcedureStepsByIds=so,i.selectAssetProcedureStepsMappingOfAssetProcedureType=xk,i.selectAssetProcedureStepsOfAssetProcedureType=eB,i.selectAssetProcedureTypeAttachmentById=yd,i.selectAssetProcedureTypeAttachmentMapping=pd,i.selectAssetProcedureTypeAttachments=oi,i.selectAssetProcedureTypeAttachmentsByIds=Sd,i.selectAssetProcedureTypeById=Ul,i.selectAssetProcedureTypeFieldValues=Fs,i.selectAssetProcedureTypeFieldValuesAttachmentById=el,i.selectAssetProcedureTypeFieldValuesAttachments=Ai,i.selectAssetProcedureTypeFieldValuesAttachmentsByIds=tl,i.selectAssetProcedureTypeFieldValuesAttachmentsMapping=xd,i.selectAssetProcedureTypeFieldValuesById=Sl,i.selectAssetProcedureTypeFieldValuesByIds=ml,i.selectAssetProcedureTypeFieldValuesMapping=yl,i.selectAssetProcedureTypeFieldValuesOfAsset=Uk,i.selectAssetProcedureTypeFields=Is,i.selectAssetProcedureTypeFieldsAttachmentById=bd,i.selectAssetProcedureTypeFieldsAttachments=pi,i.selectAssetProcedureTypeFieldsAttachmentsByIds=Md,i.selectAssetProcedureTypeFieldsAttachmentsMapping=Rd,i.selectAssetProcedureTypeFieldsById=Ud,i.selectAssetProcedureTypeFieldsByIds=Ld,i.selectAssetProcedureTypeFieldsMapping=Cd,i.selectAssetProcedureTypeFieldsOfAssetProcedureType=$k,i.selectAssetProcedureTypes=Fi,i.selectAssetProcedureTypesByIds=Ll,i.selectAssetProcedureTypesMapping=Cl,i.selectAssetProcedureTypesOfOrganization=Hk,i.selectAssetProcedures=_s,i.selectAssetProceduresByIds=Ml,i.selectAssetProceduresMapping=gl,i.selectAssetProceduresOfAssetProcedureType=Rl,i.selectAssetProceduresOfAssetType=Nk,i.selectAssetStageById=No,i.selectAssetStageCompletionById=Eo,i.selectAssetStageCompletionMapping=Mo,i.selectAssetStageCompletions=vo,i.selectAssetStageCompletionsByIds=Vo,i.selectAssetStages=Ui,i.selectAssetStagesByIds=Ho,i.selectAssetStagesMappingOfAssetProcedureType=sB,i.selectAssetStagesOfAssetProcedureType=iB,i.selectAssetTypeAttachmentById=th,i.selectAssetTypeAttachmentMapping=eh,i.selectAssetTypeAttachments=Gi,i.selectAssetTypeAttachmentsByIds=sh,i.selectAssetTypeById=Hp,i.selectAssetTypeFieldValues=Ms,i.selectAssetTypeFieldValuesAttachmentById=Uh,i.selectAssetTypeFieldValuesAttachments=xi,i.selectAssetTypeFieldValuesAttachmentsByIds=Lh,i.selectAssetTypeFieldValuesAttachmentsMapping=Ch,i.selectAssetTypeFieldValuesById=ip,i.selectAssetTypeFieldValuesByIds=np,i.selectAssetTypeFieldValuesMapping=sp,i.selectAssetTypeFieldValuesOfAsset=rB,i.selectAssetTypeFields=as,i.selectAssetTypeFieldsAttachmentById=mh,i.selectAssetTypeFieldsAttachments=Yi,i.selectAssetTypeFieldsAttachmentsByIds=fh,i.selectAssetTypeFieldsAttachmentsMapping=Sh,i.selectAssetTypeFieldsById=vh,i.selectAssetTypeFieldsByIds=Eh,i.selectAssetTypeFieldsMapping=Mh,i.selectAssetTypeFieldsOfAssetType=aB,i.selectAssetTypeIdentifierById=fp,i.selectAssetTypeIdentifierMapping=mp,i.selectAssetTypeIdentifierValueById=Ep,i.selectAssetTypeIdentifierValueMapping=vp,i.selectAssetTypeIdentifierValues=vs,i.selectAssetTypeIdentifierValuesByIds=Vp,i.selectAssetTypeIdentifierValuesOfAsset=uB,i.selectAssetTypeIdentifierValuesOfIdentifier=oB,i.selectAssetTypeIdentifiers=sn,i.selectAssetTypeIdentifiersByIds=Ap,i.selectAssetTypeIdentifiersOfAssetType=lB,i.selectAssetTypeStatusById=ay,i.selectAssetTypeStatusMapping=ny,i.selectAssetTypeStatuses=dn,i.selectAssetTypeStatusesByIds=cy,i.selectAssetTypeStatusesOfAssetType=pB,i.selectAssetTypeValuesOfAssetType=dB,i.selectAssetTypes=cn,i.selectAssetTypesByIds=Gp,i.selectAssetTypesMapping=Np,i.selectAssetTypesOfOrganization=hB,i.selectAssets=bs,i.selectAssetsByIds=mo,i.selectAssetsMapping=po,i.selectAssetsOfAssetType=yo,i.selectAssetsOfProject=tB,i.selectAttachmentsOfAsset=ed,i.selectAttachmentsOfAssetProcedureStepFieldValues=bu,i.selectAttachmentsOfAssetProcedureStepFields=Gk,i.selectAttachmentsOfAssetProcedureType=qk,i.selectAttachmentsOfAssetProcedureTypeFieldValues=sl,i.selectAttachmentsOfAssetProcedureTypeFields=jk,i.selectAttachmentsOfAssetType=ih,i.selectAttachmentsOfAssetTypeFieldValues=Nh,i.selectAttachmentsOfAssetTypeFields=nB,i.selectAttachmentsOfDocument=AB,i.selectAttachmentsOfFormRevision=bB,i.selectAttachmentsOfFormSubmission=Fm,i.selectAttachmentsOfIssue=gf,i.selectAttachmentsOfIssueComment=VB,i.selectAttachmentsOfIssueType=DB,i.selectAttachmentsOfIssueTypeFieldValues=Mw,i.selectAttachmentsOfIssueTypeFields=WB,i.selectAttachmentsOfProcedureStepFieldValues=YF,i.selectAttachmentsOfProcedureStepFields=PF,i.selectAttachmentsOfProcedureType=WD,i.selectAttachmentsOfProcedureTypeFieldValues=uR,i.selectAttachmentsOfProcedureTypeFields=zD,i.selectAttachmentsOfProject=sD,i.selectAttachmentsOfWorkflowStepFieldValues=Hv,i.selectAttachmentsOfWorkflowStepFields=mv,i.selectCommentsOfIssue=kB,i.selectConversation=zk,i.selectConversationMapping=ai,i.selectConversations=Wk,i.selectCurrentUser=ZP,i.selectDeletedRequests=JB,i.selectDescendantsOfAssetProcedureStep=io,i.selectDescendantsOfDocument=qy,i.selectDescendantsOfProcedureStep=lg,i.selectDocumentAttachmentById=Oy,i.selectDocumentAttachmentMapping=Ty,i.selectDocumentAttachmentsByIds=Iy,i.selectDocumentById=Wy,i.selectDocuments=Vs,i.selectDocumentsByIds=zy,i.selectDocumentsMapping=hn,i.selectEmailDomainById=Jy,i.selectEmailDomains=yn,i.selectEmailDomainsAsMapping=Qy,i.selectEmailDomainsByIds=Zy,i.selectEmailDomainsOfOrganization=TB,i.selectFieldValuesOfAssetProcedure=Lk,i.selectFieldValuesOfProcedure=$D,i.selectFormById=hm,i.selectFormIdentifierById=pS,i.selectFormIdentifierMapping=hS,i.selectFormIdentifierValueById=RS,i.selectFormIdentifierValueMapping=gS,i.selectFormIdentifierValues=ks,i.selectFormIdentifierValuesByIds=bS,i.selectFormIdentifierValuesOfFormSubmission=gB,i.selectFormIdentifierValuesOfIdentifier=RB,i.selectFormIdentifiers=fn,i.selectFormIdentifiersByIds=yS,i.selectFormIdentifiersOfForm=_B,i.selectFormMapping=om,i.selectFormRevisionAttachmentById=CS,i.selectFormRevisionAttachments=$S,i.selectFormRevisionAttachmentsByIds=US,i.selectFormRevisionAttachmentsMapping=Bs,i.selectFormRevisionById=JS,i.selectFormRevisionMapping=_n,i.selectFormRevisions=Ds,i.selectFormRevisionsByIds=ZS,i.selectFormRevisionsOfForm=XS,i.selectFormSubmissionAttachemntsByIds=kn,i.selectFormSubmissionAttachmentById=Om,i.selectFormSubmissionAttachments=Vn,i.selectFormSubmissionAttachmentsByIds=Im,i.selectFormSubmissionAttachmentsMapping=En,i.selectFormSubmissionById=Dm,i.selectFormSubmissions=Bm,i.selectFormSubmissionsByIds=Wm,i.selectFormSubmissionsMapping=zn,i.selectFormSubmissionsOfForm=zm,i.selectForms=Rn,i.selectFormsByIds=pm,i.selectFormsOfOrganization=vB,i.selectGeoImageById=Jm,i.selectGeoImageMapping=Qm,i.selectGeoImages=jn,i.selectGeoImagesByIds=Zm,i.selectGeoImagesOfProject=EB,i.selectIsLoggedIn=fB,i.selectIssueAssociationById=lf,i.selectIssueAssociationMapping=df,i.selectIssueAssociations=Ct,i.selectIssueAssociationsByIds=uf,i.selectIssueAssociationsOfAsset=Sf,i.selectIssueAssociationsOfIssue=yf,i.selectIssueAssociationsOfIssues=pf,i.selectIssueAssociationsToIssue=of,i.selectIssueAssociationsToIssues=hf,i.selectIssueAttachmentById=Rf,i.selectIssueAttachmentMapping=_f,i.selectIssueAttachments=Nn,i.selectIssueAttachmentsByIds=bf,i.selectIssueById=hA,i.selectIssueCommentAttachmentById=Cf,i.selectIssueCommentAttachmentMapping=$f,i.selectIssueCommentAttachments=Gn,i.selectIssueCommentAttachmentsByIds=Uf,i.selectIssueCommentById=eA,i.selectIssueCommentMapping=Yn,i.selectIssueCommentsByIds=tA,i.selectIssueMapping=oA,i.selectIssueTypeAttachmentById=RA,i.selectIssueTypeAttachmentMapping=gA,i.selectIssueTypeAttachments=xn,i.selectIssueTypeAttachmentsByIds=bA,i.selectIssueTypeById=mP,i.selectIssueTypeFieldValues=zs,i.selectIssueTypeFieldValuesAttachmentById=Rw,i.selectIssueTypeFieldValuesAttachments=ra,i.selectIssueTypeFieldValuesAttachmentsByIds=bw,i.selectIssueTypeFieldValuesAttachmentsMapping=gw,i.selectIssueTypeFieldValuesById=tw,i.selectIssueTypeFieldValuesByIds=sw,i.selectIssueTypeFieldValuesMapping=ew,i.selectIssueTypeFieldValuesOfIssue=zB,i.selectIssueTypeFields=cs,i.selectIssueTypeFieldsAttachmentById=CA,i.selectIssueTypeFieldsAttachments=ta,i.selectIssueTypeFieldsAttachmentsByIds=UA,i.selectIssueTypeFieldsAttachmentsMapping=$A,i.selectIssueTypeFieldsById=Sw,i.selectIssueTypeFieldsByIds=mw,i.selectIssueTypeFieldsMapping=yw,i.selectIssueTypeFieldsOfIssueType=qB,i.selectIssueTypeIdentifierById=Uw,i.selectIssueTypeIdentifierMapping=Cw,i.selectIssueTypeIdentifierValueById=sP,i.selectIssueTypeIdentifierValueMapping=tP,i.selectIssueTypeIdentifierValues=qs,i.selectIssueTypeIdentifierValuesByIds=iP,i.selectIssueTypeIdentifierValuesOfIdentifier=LB,i.selectIssueTypeIdentifierValuesOfIssue=UB,i.selectIssueTypeIdentifiers=la,i.selectIssueTypeIdentifiersByIds=Lw,i.selectIssueTypeIdentifiersOfIssueType=CB,i.selectIssueTypeMapping=SP,i.selectIssueTypeStatusById=Sa,i.selectIssueTypeStatusMapping=MP,i.selectIssueTypeStatuses=ya,i.selectIssueTypeStatusesByIds=vP,i.selectIssueTypeStatusesOfIssueType=HB,i.selectIssueTypeValuesOfIssueType=$B,i.selectIssueTypes=ha,i.selectIssueTypesByIds=fP,i.selectIssueTypesOfOrganization=NB,i.selectIssueUpdateById=qP,i.selectIssueUpdateMapping=Ta,i.selectIssueUpdates=Oa,i.selectIssueUpdatesByIds=jP,i.selectIssueUpdatesOfIssue=$P,i.selectIssues=Ws,i.selectIssuesByIds=pA,i.selectIssuesOfIssueType=yA,i.selectIssuesOfProject=BB,i.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=Yk,i.selectLatestAssetProcedureTypeFieldsOfAssetProcedureType=Ck,i.selectLatestAssetTypeFieldsOfAssetType=cB,i.selectLatestFieldsByAssetProcedureStep=Qk,i.selectLatestFieldsByProcedureStep=TD,i.selectLatestFormRevisionOfForm=MB,i.selectLatestIssueTypeFieldsOfIssueType=jB,i.selectLatestProcedureStepFieldValuesByProcedureStepOfProcedure=_D,i.selectLatestProcedureStepFieldValuesReviewByProcedureStepFieldValues=vD,i.selectLatestProcedureStepFieldsOfProcedureStep=PD,i.selectLatestProcedureTypeFieldsOfProcedureType=jD,i.selectLatestRetryTime=ZB,i.selectLatestReviewOfProcedureStepFieldValues=bD,i.selectLatestReviewOfWorkflowStepFieldValues=AW,i.selectLatestReviewRequestOfProcedureStepFieldValues=gD,i.selectLatestReviewRequestOfWorkflowStepFieldValues=mW,i.selectLatestWorkflowStepFieldValuesByWorkflowStepOfWorkflow=SW,i.selectLatestWorkflowStepFieldValuesReviewByWorkflowStepFieldValues=PW,i.selectLatestWorkflowStepFieldsOfWorkflowStep=oW,i.selectMembershipsByUserOfTeam=GD,i.selectOrganizationAccessById=uT,i.selectOrganizationAccessMapping=Cs,i.selectOrganizationAccessUserMapping=hT,i.selectOrganizationAccessesByIds=oT,i.selectOrganizationById=_T,i.selectOrganizationDocuments=PB,i.selectOrganizations=FT,i.selectOrganizationsByIds=gT,i.selectOrganizationsMapping=IT,i.selectProcedureById=GO,i.selectProcedureStepAssigneeById=cI,i.selectProcedureStepAssignees=ds,i.selectProcedureStepAssigneesByIds=rI,i.selectProcedureStepAssigneesMapping=aI,i.selectProcedureStepAssigneesOfProcedure=dD,i.selectProcedureStepAssigneesOfProcedureAndProcedureStep=uD,i.selectProcedureStepAssigneesOfProcedureStep=lD,i.selectProcedureStepById=rg,i.selectProcedureStepCommentById=PI,i.selectProcedureStepComments=ls,i.selectProcedureStepCommentsByIds=TI,i.selectProcedureStepCommentsMapping=wI,i.selectProcedureStepCommentsOfProcedure=oD,i.selectProcedureStepCommentsOfProcedureAndProcedureStep=pD,i.selectProcedureStepCommentsOfProcedureStep=hD,i.selectProcedureStepDefaultAssigneeById=BI,i.selectProcedureStepDefaultAssignees=Ua,i.selectProcedureStepDefaultAssigneesByIds=DI,i.selectProcedureStepDefaultAssigneesMapping=kI,i.selectProcedureStepDefaultAssigneesOfProcedureStep=yD,i.selectProcedureStepDefaultReviewerById=YI,i.selectProcedureStepDefaultReviewers=Na,i.selectProcedureStepDefaultReviewersByIds=QI,i.selectProcedureStepDefaultReviewersMapping=KI,i.selectProcedureStepDefaultReviewersOfProcedureStep=SD,i.selectProcedureStepEventById=dF,i.selectProcedureStepEvents=us,i.selectProcedureStepEventsByIds=lF,i.selectProcedureStepEventsMapping=rF,i.selectProcedureStepEventsOfProcedure=mD,i.selectProcedureStepEventsOfProcedureAndProcedureStep=AD,i.selectProcedureStepEventsOfProcedureStep=fD,i.selectProcedureStepFieldValues=Wt,i.selectProcedureStepFieldValuesAttachmentById=GF,i.selectProcedureStepFieldValuesAttachments=tc,i.selectProcedureStepFieldValuesAttachmentsByIds=KF,i.selectProcedureStepFieldValuesAttachmentsMapping=HF,i.selectProcedureStepFieldValuesById=r_,i.selectProcedureStepFieldValuesByIds=d_,i.selectProcedureStepFieldValuesMapping=c_,i.selectProcedureStepFieldValuesOfProcedure=OD,i.selectProcedureStepFieldValuesOfProcedureAndProcedureStep=FD,i.selectProcedureStepFieldValuesOfProcedureStep=ID,i.selectProcedureStepFieldValuesReviewById=V_,i.selectProcedureStepFieldValuesReviewRequestById=w_,i.selectProcedureStepFieldValuesReviewRequests=os,i.selectProcedureStepFieldValuesReviewRequestsByIds=P_,i.selectProcedureStepFieldValuesReviewRequestsMapping=A_,i.selectProcedureStepFieldValuesReviewRequestsOfProcedureAndProcedureStep=RD,i.selectProcedureStepFieldValuesReviews=Yt,i.selectProcedureStepFieldValuesReviewsByIds=k_,i.selectProcedureStepFieldValuesReviewsMapping=E_,i.selectProcedureStepFieldValuesReviewsOfProcedureAndProcedureStep=MD,i.selectProcedureStepFields=Ls,i.selectProcedureStepFieldsAttachmentById=TF,i.selectProcedureStepFieldsAttachments=Qa,i.selectProcedureStepFieldsAttachmentsByIds=OF,i.selectProcedureStepFieldsAttachmentsMapping=wF,i.selectProcedureStepFieldsById=BF,i.selectProcedureStepFieldsByIds=DF,i.selectProcedureStepFieldsMapping=Za,i.selectProcedureStepFieldsOfProcedureStep=wD,i.selectProcedureStepReviewerById=K_,i.selectProcedureStepReviewers=hs,i.selectProcedureStepReviewersByIds=Y_,i.selectProcedureStepReviewersMapping=G_,i.selectProcedureStepReviewersOfProcedure=ED,i.selectProcedureStepReviewersOfProcedureAndProcedureStep=kD,i.selectProcedureStepReviewersOfProcedureStep=VD,i.selectProcedureSteps=oc,i.selectProcedureStepsByIds=dg,i.selectProcedureStepsMapping=Ns,i.selectProcedureStepsMappingOfProcedureType=BD,i.selectProcedureStepsOfProcedureType=DD,i.selectProcedureTypeAttachmentById=Og,i.selectProcedureTypeAttachmentMapping=Tg,i.selectProcedureTypeAttachments=pc,i.selectProcedureTypeAttachmentsByIds=Ig,i.selectProcedureTypeById=zR,i.selectProcedureTypeFieldValues=Oc,i.selectProcedureTypeFieldValuesAttachmentById=dR,i.selectProcedureTypeFieldValuesAttachments=Pc,i.selectProcedureTypeFieldValuesAttachmentsByIds=lR,i.selectProcedureTypeFieldValuesAttachmentsMapping=rR,i.selectProcedureTypeFieldValuesById=IR,i.selectProcedureTypeFieldValuesByIds=FR,i.selectProcedureTypeFieldValuesMapping=OR,i.selectProcedureTypeFields=Hs,i.selectProcedureTypeFieldsAttachmentById=Wg,i.selectProcedureTypeFieldsAttachments=Sc,i.selectProcedureTypeFieldsAttachmentsByIds=zg,i.selectProcedureTypeFieldsAttachmentsMapping=Dg,i.selectProcedureTypeFieldsById=Jg,i.selectProcedureTypeFieldsByIds=Zg,i.selectProcedureTypeFieldsMapping=Qg,i.selectProcedureTypeFieldsOfProcedureType=qD,i.selectProcedureTypes=Gs,i.selectProcedureTypesByIds=qR,i.selectProcedureTypesMapping=WR,i.selectProcedureTypesOfAssetType=CD,i.selectProcedureTypesOfIssueType=UD,i.selectProcedures=Kt,i.selectProceduresByIds=KO,i.selectProceduresMapping=HO,i.selectProceduresOfAsset=cD,i.selectProceduresOfIssue=rD,i.selectProceduresOfProcedureType=YO,i.selectProceduresOfProject=aD,i.selectProjectAccessById=HT,i.selectProjectAccessMapping=Ea,i.selectProjectAccesses=rs,i.selectProjectAccessesByIds=GT,i.selectProjectAccessesOfProject=xB,i.selectProjectAttachmentById=nO,i.selectProjectAttachmentMapping=iO,i.selectProjectAttachments=ka,i.selectProjectAttachmentsByIds=aO,i.selectProjectById=BO,i.selectProjectDocuments=wB,i.selectProjectFileById=wO,i.selectProjectFileMapping=fO,i.selectProjectFiles=AO,i.selectProjectFilesByIds=PO,i.selectProjectMapping=kO,i.selectProjects=Us,i.selectProjectsByIds=DO,i.selectProjectsOfOrganization=nD,i.selectRehydrated=HD,i.selectReviewRequestsOfProcedureStepFieldValues=T_,i.selectReviewRequestsOfWorkflowStepFieldValues=AE,i.selectReviewsOfProcedureStepFieldValues=B_,i.selectReviewsOfWorkflowStepFieldValues=EE,i.selectStageMapping=Ci,i.selectTeamById=ob,i.selectTeamMembershipById=XR,i.selectTeamMemberships=Ks,i.selectTeamMembershipsByIds=xR,i.selectTeamMembershipsMapping=ZR,i.selectTeams=Rc,i.selectTeamsByIds=hb,i.selectTeamsMapping=ub,i.selectTeamsOfOrganization=YD,i.selectUploadUrl=FB,i.selectUserById=$s,i.selectUsers=js,i.selectUsersByIds=XP,i.selectUsersMapping=ga,i.selectUsersOfOrganization=QB,i.selectUsersOfProject=tD,i.selectUsersOfTeam=KD,i.selectWorkflowById=Rb,i.selectWorkflowIssueLinkById=jb,i.selectWorkflowIssueLinks=Qt,i.selectWorkflowIssueLinksByIds=$b,i.selectWorkflowIssueLinksMapping=qb,i.selectWorkflowIssueLinksOfIssue=Lb,i.selectWorkflowIssueLinksOfIssues=XD,i.selectWorkflowIssueLinksOfWorkflow=Cb,i.selectWorkflowIssueLinksOfWorkflows=Ub,i.selectWorkflowMapping=gb,i.selectWorkflowStepAssigneeById=sM,i.selectWorkflowStepAssignees=Ss,i.selectWorkflowStepAssigneesByIds=iM,i.selectWorkflowStepAssigneesMapping=tM,i.selectWorkflowStepAssigneesOfWorkflow=xD,i.selectWorkflowStepAssigneesOfWorkflowAndWorkflowStep=tW,i.selectWorkflowStepAssigneesOfWorkflowStep=eW,i.selectWorkflowStepById=nV,i.selectWorkflowStepCommentById=mM,i.selectWorkflowStepComments=ms,i.selectWorkflowStepCommentsByIds=fM,i.selectWorkflowStepCommentsMapping=SM,i.selectWorkflowStepCommentsOfWorkflow=sW,i.selectWorkflowStepCommentsOfWorkflowAndWorkflowStep=nW,i.selectWorkflowStepCommentsOfWorkflowStep=iW,i.selectWorkflowStepDefaultAssigneeById=vM,i.selectWorkflowStepDefaultAssignees=kc,i.selectWorkflowStepDefaultAssigneesByIds=EM,i.selectWorkflowStepDefaultAssigneesMapping=MM,i.selectWorkflowStepDefaultAssigneesOfWorkflowStep=aW,i.selectWorkflowStepDefaultReviewerById=NM,i.selectWorkflowStepDefaultReviewers=Dc,i.selectWorkflowStepDefaultReviewersByIds=HM,i.selectWorkflowStepDefaultReviewersMapping=LM,i.selectWorkflowStepDefaultReviewersOfWorkflowStep=cW,i.selectWorkflowStepEventById=nv,i.selectWorkflowStepEvents=fs,i.selectWorkflowStepEventsByIds=av,i.selectWorkflowStepEventsMapping=iv,i.selectWorkflowStepEventsOfWorkflow=rW,i.selectWorkflowStepEventsOfWorkflowAndWorkflowStep=lW,i.selectWorkflowStepEventsOfWorkflowStep=dW,i.selectWorkflowStepFieldValues=zt,i.selectWorkflowStepFieldValuesAttachmentById=Lv,i.selectWorkflowStepFieldValuesAttachments=Hc,i.selectWorkflowStepFieldValuesAttachmentsByIds=Nv,i.selectWorkflowStepFieldValuesAttachmentsMapping=Uv,i.selectWorkflowStepFieldValuesById=nE,i.selectWorkflowStepFieldValuesByIds=aE,i.selectWorkflowStepFieldValuesMapping=iE,i.selectWorkflowStepFieldValuesOfWorkflow=hW,i.selectWorkflowStepFieldValuesOfWorkflowAndWorkflowStep=yW,i.selectWorkflowStepFieldValuesOfWorkflowStep=pW,i.selectWorkflowStepFieldValuesReviewById=ME,i.selectWorkflowStepFieldValuesReviewRequestById=mE,i.selectWorkflowStepFieldValuesReviewRequests=As,i.selectWorkflowStepFieldValuesReviewRequestsByIds=fE,i.selectWorkflowStepFieldValuesReviewRequestsMapping=SE,i.selectWorkflowStepFieldValuesReviewRequestsOfWorkflowAndWorkflowStep=fW,i.selectWorkflowStepFieldValuesReviews=Jt,i.selectWorkflowStepFieldValuesReviewsByIds=vE,i.selectWorkflowStepFieldValuesReviewsMapping=bE,i.selectWorkflowStepFieldValuesReviewsOfWorkflowAndWorkflowStep=wW,i.selectWorkflowStepFields=Qs,i.selectWorkflowStepFieldsAttachmentById=fv,i.selectWorkflowStepFieldsAttachments=$c,i.selectWorkflowStepFieldsAttachmentsByIds=Av,i.selectWorkflowStepFieldsAttachmentsMapping=Sv,i.selectWorkflowStepFieldsById=Ev,i.selectWorkflowStepFieldsByIds=Vv,i.selectWorkflowStepFieldsMapping=vv,i.selectWorkflowStepFieldsOfWorkflowStep=uW,i.selectWorkflowStepReviewerById=NE,i.selectWorkflowStepReviewers=ws,i.selectWorkflowStepReviewersByIds=HE,i.selectWorkflowStepReviewersMapping=LE,i.selectWorkflowStepReviewersOfWorkflow=TW,i.selectWorkflowStepReviewersOfWorkflowAndWorkflowStep=IW,i.selectWorkflowStepReviewersOfWorkflowStep=OW,i.selectWorkflowSteps=tr,i.selectWorkflowStepsByIds=aV,i.selectWorkflowStepsMapping=iV,i.selectWorkflowStepsOfWorkflowType=FW,i.selectWorkflowTypeById=AV,i.selectWorkflowTypeMapping=fV,i.selectWorkflowTypes=ir,i.selectWorkflowTypesByIds=wV,i.selectWorkflowTypesOfOrganization=_W,i.selectWorkflows=Ys,i.selectWorkflowsByIds=bb,i.selectWorkflowsOfProject=JD,i.selectWorkflowsOfWorkflowType=ZD,i.setAsset=oo,i.setAssetAttachment=Gr,i.setAssetAttachments=Kr,i.setAssetProcedure=Il,i.setAssetProcedureStep=Gu,i.setAssetProcedureStepFieldValues=Bu,i.setAssetProcedureStepFieldValuesAttachment=Pu,i.setAssetProcedureStepFieldValuesAttachments=Tu,i.setAssetProcedureStepFieldValuesMany=Du,i.setAssetProcedureStepFields=du,i.setAssetProcedureStepFieldsAttachment=Yl,i.setAssetProcedureStepFieldsAttachments=Ql,i.setAssetProcedureStepFieldsMany=lu,i.setAssetProcedureSteps=Ku,i.setAssetProcedureType=ql,i.setAssetProcedureTypeAttachment=cd,i.setAssetProcedureTypeAttachments=rd,i.setAssetProcedureTypeFieldValues=rl,i.setAssetProcedureTypeFieldValuesAttachment=Kd,i.setAssetProcedureTypeFieldValuesAttachments=Yd,i.setAssetProcedureTypeFieldValuesMany=dl,i.setAssetProcedureTypeFields=Bd,i.setAssetProcedureTypeFieldsAttachment=Pd,i.setAssetProcedureTypeFieldsAttachments=Td,i.setAssetProcedureTypeFieldsMany=Dd,i.setAssetProcedureTypes=jl,i.setAssetProcedures=Fl,i.setAssetStage=Do,i.setAssetStageCompletion=Oo,i.setAssetStageCompletions=Io,i.setAssetStages=Wo,i.setAssetType=Wp,i.setAssetTypeAttachment=Qo,i.setAssetTypeAttachments=Jo,i.setAssetTypeFieldValues=Jh,i.setAssetTypeFieldValuesAttachment=Wh,i.setAssetTypeFieldValuesAttachments=zh,i.setAssetTypeFieldValuesMany=Zh,i.setAssetTypeFields=Ih,i.setAssetTypeFieldsAttachment=lh,i.setAssetTypeFieldsAttachments=uh,i.setAssetTypeFieldsMany=Fh,i.setAssetTypeIdentifier=up,i.setAssetTypeIdentifierValue=Fp,i.setAssetTypeIdentifierValues=_p,i.setAssetTypeIdentifiers=op,i.setAssetTypeStatus=Xp,i.setAssetTypeStatuses=xp,i.setAssetTypes=zp,i.setAssets=ho,i.setClientSDK=$V,i.setClientStore=qV,i.setConversation=$r,i.setConversations=Vk,i.setCurrentUser=GB,i.setCurrentUserProfile=KB,i.setDocument=My,i.setDocumentAttachment=Sy,i.setDocumentAttachments=my,i.setDocuments=vy,i.setEmailDomain=Ly,i.setEmailDomains=Ny,i.setForm=nm,i.setFormIdentifier=cS,i.setFormIdentifierValue=PS,i.setFormIdentifierValues=TS,i.setFormIdentifiers=rS,i.setFormRevision=GS,i.setFormRevisionAttachment=BS,i.setFormRevisionAttachments=DS,i.setFormRevisions=KS,i.setFormSubmission=bm,i.setFormSubmissionAttachment=fm,i.setFormSubmissionAttachments=Am,i.setFormSubmissions=Mm,i.setForms=am,i.setGeoImage=Cm,i.setGeoImages=Um,i.setIssue=cA,i.setIssueAssociation=sf,i.setIssueAssociations=tf,i.setIssueAttachment=Pf,i.setIssueAttachments=Tf,i.setIssueComment=Yf,i.setIssueCommentAttachment=Bf,i.setIssueCommentAttachments=Df,i.setIssueComments=Qf,i.setIssueType=lP,i.setIssueTypeAttachment=PA,i.setIssueTypeAttachments=TA,i.setIssueTypeFieldValues=YA,i.setIssueTypeFieldValuesAttachment=Tw,i.setIssueTypeFieldValuesAttachments=Ow,i.setIssueTypeFieldValuesMany=QA,i.setIssueTypeFields=dw,i.setIssueTypeFieldsAttachment=BA,i.setIssueTypeFieldsAttachments=DA,i.setIssueTypeFieldsMany=lw,i.setIssueTypeIdentifier=Dw,i.setIssueTypeIdentifierValue=Qw,i.setIssueTypeIdentifierValues=Jw,i.setIssueTypeIdentifiers=Ww,i.setIssueTypeStatus=IP,i.setIssueTypeStatuses=FP,i.setIssueTypes=uP,i.setIssueUpdate=BP,i.setIssueUpdates=DP,i.setIssues=rA,i.setLoggedIn=ly,i.setOrganization=mT,i.setOrganizationAccess=iT,i.setOrganizationAccesses=nT,i.setOrganizations=ST,i.setProcedure=jO,i.setProcedureStep=X_,i.setProcedureStepAssignee=xO,i.setProcedureStepAssignees=eI,i.setProcedureStepComment=pI,i.setProcedureStepComments=yI,i.setProcedureStepDefaultAssignee=RI,i.setProcedureStepDefaultAssignees=bI,i.setProcedureStepDefaultReviewer=CI,i.setProcedureStepDefaultReviewers=UI,i.setProcedureStepEvent=tF,i.setProcedureStepEvents=sF,i.setProcedureStepFieldValues=e_,i.setProcedureStepFieldValuesAttachment=$F,i.setProcedureStepFieldValuesAttachments=CF,i.setProcedureStepFieldValuesMany=t_,i.setProcedureStepFieldValuesReview=g_,i.setProcedureStepFieldValuesReviewRequest=p_,i.setProcedureStepFieldValuesReviewRequests=y_,i.setProcedureStepFieldValuesReviews=R_,i.setProcedureStepFields=bF,i.setProcedureStepFieldsAttachment=yF,i.setProcedureStepFieldsAttachments=SF,i.setProcedureStepFieldsMany=MF,i.setProcedureStepReviewer=$_,i.setProcedureStepReviewers=C_,i.setProcedureSteps=x_,i.setProcedureType=MR,i.setProcedureTypeAttachment=yg,i.setProcedureTypeAttachments=Sg,i.setProcedureTypeFieldValues=SR,i.setProcedureTypeFieldValuesAttachment=tR,i.setProcedureTypeFieldValuesAttachments=sR,i.setProcedureTypeFieldValuesMany=mR,i.setProcedureTypeFields=Ug,i.setProcedureTypeFieldsAttachment=bg,i.setProcedureTypeFieldsAttachments=Mg,i.setProcedureTypeFieldsMany=Lg,i.setProcedureTypes=vR,i.setProcedures=$O,i.setProject=_O,i.setProjectAccess=qT,i.setProjectAccesses=jT,i.setProjectAttachment=ZT,i.setProjectAttachments=XT,i.setProjectFile=lO,i.setProjectFiles=uO,i.setProjects=FO,i.setRehydrated=ND,i.setTeam=nb,i.setTeamMembership=NR,i.setTeamMemberships=HR,i.setTeams=ab,i.setTokens=yB,i.setUploadUrl=IB,i.setUser=HP,i.setUsers=NP,i.setWorkflow=Pb,i.setWorkflowIssueLink=kb,i.setWorkflowIssueLinks=Bb,i.setWorkflowStep=ZE,i.setWorkflowStepAssignee=Qb,i.setWorkflowStepAssignees=Jb,i.setWorkflowStepComment=lM,i.setWorkflowStepComments=uM,i.setWorkflowStepDefaultAssignee=IM,i.setWorkflowStepDefaultAssignees=FM,i.setWorkflowStepDefaultReviewer=zM,i.setWorkflowStepDefaultReviewers=qM,i.setWorkflowStepEvent=ZM,i.setWorkflowStepEvents=XM,i.setWorkflowStepFieldValues=Zv,i.setWorkflowStepFieldValuesAttachment=zv,i.setWorkflowStepFieldValuesAttachments=qv,i.setWorkflowStepFieldValuesMany=Xv,i.setWorkflowStepFieldValuesReview=IE,i.setWorkflowStepFieldValuesReviewRequest=uE,i.setWorkflowStepFieldValuesReviewRequests=oE,i.setWorkflowStepFieldValuesReviews=FE,i.setWorkflowStepFields=Fv,i.setWorkflowStepFieldsAttachment=uv,i.setWorkflowStepFieldsAttachments=ov,i.setWorkflowStepFieldsMany=_v,i.setWorkflowStepReviewer=zE,i.setWorkflowStepReviewers=qE,i.setWorkflowSteps=XE,i.setWorkflowType=oV,i.setWorkflowTypes=hV,i.setWorkflows=Tb,i.shallowEqual=lk,i.slugify=Fk,i.spacesToDashesLower=Ik,i.teamMembershipReducer=JR,i.teamMembershipSlice=_c,i.teamReducer=pb,i.teamSlice=gc,i.toFileNameSafeString=Ok,i.toUuidArray=E,i.toUuidIdRecord=Tk,i.truncate=_k,i.updateAsset=ro,i.updateAssetAttachment=Yr,i.updateAssetAttachments=Qr,i.updateAssetProcedure=Pl,i.updateAssetProcedureStep=Ju,i.updateAssetProcedureStepFieldValues=Wu,i.updateAssetProcedureStepFieldValuesAttachment=Ou,i.updateAssetProcedureStepFieldValuesAttachments=Iu,i.updateAssetProcedureStepFieldValuesMany=zu,i.updateAssetProcedureStepFields=uu,i.updateAssetProcedureStepFieldsAttachment=Jl,i.updateAssetProcedureStepFieldsAttachments=Zl,i.updateAssetProcedureStepFieldsMany=ou,i.updateAssetProcedureSteps=Zu,i.updateAssetProcedureType=Bl,i.updateAssetProcedureTypeAttachment=dd,i.updateAssetProcedureTypeAttachments=ld,i.updateAssetProcedureTypeFieldValues=ll,i.updateAssetProcedureTypeFieldValuesAttachment=Qd,i.updateAssetProcedureTypeFieldValuesAttachments=Jd,i.updateAssetProcedureTypeFieldValuesMany=ul,i.updateAssetProcedureTypeFields=Wd,i.updateAssetProcedureTypeFieldsAttachment=Od,i.updateAssetProcedureTypeFieldsAttachments=Id,i.updateAssetProcedureTypeFieldsMany=zd,i.updateAssetProcedureTypes=Dl,i.updateAssetProcedures=Tl,i.updateAssetStage=jo,i.updateAssetStageCompletion=Fo,i.updateAssetStageCompletions=_o,i.updateAssetStages=$o,i.updateAssetType=$p,i.updateAssetTypeAttachment=Zo,i.updateAssetTypeAttachments=Xo,i.updateAssetTypeFieldValues=Xh,i.updateAssetTypeFieldValuesAttachment=qh,i.updateAssetTypeFieldValuesAttachments=jh,i.updateAssetTypeFieldValuesMany=xh,i.updateAssetTypeFields=_h,i.updateAssetTypeFieldsAttachment=oh,i.updateAssetTypeFieldsAttachments=hh,i.updateAssetTypeFieldsMany=gh,i.updateAssetTypeIdentifier=hp,i.updateAssetTypeIdentifierValue=gp,i.updateAssetTypeIdentifierValues=Rp,i.updateAssetTypeIdentifiers=pp,i.updateAssetTypeStatus=ey,i.updateAssetTypeStatuses=ty,i.updateAssetTypes=Cp,i.updateAssets=lo,i.updateConversation=Cr,i.updateConversations=kk,i.updateDocument=Ey,i.updateDocumentAttachment=fy,i.updateDocumentAttachments=Ay,i.updateDocuments=Vy,i.updateEmailDomain=Hy,i.updateEmailDomains=Gy,i.updateForm=cm,i.updateFormIdentifier=dS,i.updateFormIdentifierValue=OS,i.updateFormIdentifierValues=IS,i.updateFormIdentifiers=lS,i.updateFormRevision=YS,i.updateFormRevisionAttachment=WS,i.updateFormRevisionAttachments=zS,i.updateFormRevisions=QS,i.updateFormSubmission=Em,i.updateFormSubmissionAttachment=wm,i.updateFormSubmissionAttachments=Pm,i.updateFormSubmissions=Vm,i.updateForms=rm,i.updateGeoImage=Hm,i.updateGeoImages=Gm,i.updateIssue=dA,i.updateIssueAssociation=nf,i.updateIssueAssociations=af,i.updateIssueAttachment=Of,i.updateIssueAttachments=If,i.updateIssueComment=Jf,i.updateIssueCommentAttachment=Wf,i.updateIssueCommentAttachments=zf,i.updateIssueComments=Zf,i.updateIssueType=oP,i.updateIssueTypeAttachment=OA,i.updateIssueTypeAttachments=IA,i.updateIssueTypeFieldValues=JA,i.updateIssueTypeFieldValuesAttachment=Iw,i.updateIssueTypeFieldValuesAttachments=Fw,i.updateIssueTypeFieldValuesMany=ZA,i.updateIssueTypeFields=uw,i.updateIssueTypeFieldsAttachment=WA,i.updateIssueTypeFieldsAttachments=zA,i.updateIssueTypeFieldsMany=ow,i.updateIssueTypeIdentifier=zw,i.updateIssueTypeIdentifierValue=Zw,i.updateIssueTypeIdentifierValues=Xw,i.updateIssueTypeIdentifiers=qw,i.updateIssueTypeStatus=_P,i.updateIssueTypeStatuses=gP,i.updateIssueTypes=hP,i.updateIssueUpdate=WP,i.updateIssueUpdates=zP,i.updateIssues=lA,i.updateOrganization=PT,i.updateOrganizationAccess=aT,i.updateOrganizationAccesses=cT,i.updateOrganizations=wT,i.updateProcedure=CO,i.updateProcedureStep=sg,i.updateProcedureStepAssignee=tI,i.updateProcedureStepAssignees=sI,i.updateProcedureStepComment=SI,i.updateProcedureStepComments=mI,i.updateProcedureStepDefaultAssignee=MI,i.updateProcedureStepDefaultAssignees=vI,i.updateProcedureStepDefaultReviewer=LI,i.updateProcedureStepDefaultReviewers=NI,i.updateProcedureStepEvent=iF,i.updateProcedureStepEvents=nF,i.updateProcedureStepFieldValues=s_,i.updateProcedureStepFieldValuesAttachment=UF,i.updateProcedureStepFieldValuesAttachments=LF,i.updateProcedureStepFieldValuesMany=i_,i.updateProcedureStepFieldValuesReview=b_,i.updateProcedureStepFieldValuesReviewRequest=S_,i.updateProcedureStepFieldValuesReviewRequests=m_,i.updateProcedureStepFieldValuesReviews=M_,i.updateProcedureStepFields=vF,i.updateProcedureStepFieldsAttachment=mF,i.updateProcedureStepFieldsAttachments=fF,i.updateProcedureStepFieldsMany=EF,i.updateProcedureStepReviewer=U_,i.updateProcedureStepReviewers=L_,i.updateProcedureSteps=ig,i.updateProcedureType=ER,i.updateProcedureTypeAttachment=mg,i.updateProcedureTypeAttachments=fg,i.updateProcedureTypeFieldValues=fR,i.updateProcedureTypeFieldValuesAttachment=iR,i.updateProcedureTypeFieldValuesAttachments=nR,i.updateProcedureTypeFieldValuesMany=AR,i.updateProcedureTypeFields=Ng,i.updateProcedureTypeFieldsAttachment=vg,i.updateProcedureTypeFieldsAttachments=Eg,i.updateProcedureTypeFieldsMany=Hg,i.updateProcedureTypes=VR,i.updateProcedures=UO,i.updateProject=MO,i.updateProjectAccess=$T,i.updateProjectAccesses=CT,i.updateProjectAttachment=xT,i.updateProjectAttachments=eO,i.updateProjectFile=pO,i.updateProjectFiles=yO,i.updateProjects=bO,i.updateTeam=cb,i.updateTeamMembership=GR,i.updateTeamMemberships=KR,i.updateTeams=rb,i.updateUser=YP,i.updateUsers=KP,i.updateWorkflow=Ob,i.updateWorkflowIssueLink=Db,i.updateWorkflowIssueLinks=Wb,i.updateWorkflowStep=xE,i.updateWorkflowStepAssignee=Zb,i.updateWorkflowStepAssignees=Xb,i.updateWorkflowStepComment=oM,i.updateWorkflowStepComments=hM,i.updateWorkflowStepDefaultAssignee=_M,i.updateWorkflowStepDefaultAssignees=gM,i.updateWorkflowStepDefaultReviewer=jM,i.updateWorkflowStepDefaultReviewers=$M,i.updateWorkflowStepEvent=xM,i.updateWorkflowStepEvents=ev,i.updateWorkflowStepFieldValues=xv,i.updateWorkflowStepFieldValuesAttachment=jv,i.updateWorkflowStepFieldValuesAttachments=$v,i.updateWorkflowStepFieldValuesMany=eE,i.updateWorkflowStepFieldValuesReview=_E,i.updateWorkflowStepFieldValuesReviewRequest=hE,i.updateWorkflowStepFieldValuesReviewRequests=pE,i.updateWorkflowStepFieldValuesReviews=gE,i.updateWorkflowStepFields=gv,i.updateWorkflowStepFieldsAttachment=hv,i.updateWorkflowStepFieldsAttachments=pv,i.updateWorkflowStepFieldsMany=Rv,i.updateWorkflowStepReviewer=jE,i.updateWorkflowStepReviewers=$E,i.updateWorkflowSteps=eV,i.updateWorkflowType=pV,i.updateWorkflowTypes=yV,i.updateWorkflows=Ib,i.useSelectorBuilder=dk,i.userReducer=JP,i.userSlice=Ia,i.uuidObj=P,i.uuidObjSortFn=ii,i.uuidSortFn=Os,i.versioningReducer=Sb,i.versioningSlice=yb,i.workflowIssueLinkReducer=Nb,i.workflowIssueLinkSlice=Mc,i.workflowReducer=Mb,i.workflowSlice=bc,i.workflowStepAssigneeReducer=nM,i.workflowStepAssigneeSlice=vc,i.workflowStepCommentReducer=AM,i.workflowStepCommentSlice=Ec,i.workflowStepDefaultAssigneeReducer=VM,i.workflowStepDefaultAssigneeSlice=Vc,i.workflowStepDefaultReviewerReducer=GM,i.workflowStepDefaultReviewerSlice=Bc,i.workflowStepEventReducer=cv,i.workflowStepEventSlice=Wc,i.workflowStepFieldValuesAttachmentReducer=Gv,i.workflowStepFieldValuesAttachmentSlice=Uc,i.workflowStepFieldValuesReducer=cE,i.workflowStepFieldValuesReviewReducer=VE,i.workflowStepFieldValuesReviewRequestReducer=wE,i.workflowStepFieldValuesReviewRequestSlice=Kc,i.workflowStepFieldValuesReviewSlice=Jc,i.workflowStepFieldValuesSlice=Gc,i.workflowStepFieldsAttachmentReducer=wv,i.workflowStepFieldsAttachmentSlice=zc,i.workflowStepFieldsReducer=kv,i.workflowStepFieldsSlice=Cc,i.workflowStepReducer=cV,i.workflowStepReviewerReducer=GE,i.workflowStepReviewerSlice=xc,i.workflowStepSlice=er,i.workflowTypeReducer=PV,i.workflowTypeSlice=sr,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
|