@overmap-ai/core 1.0.78-procedures.7 → 1.0.78-procedures.9

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.
@@ -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,bE,ME,sr,As,vE,ir,kE,EE,fq,Aq,VE,BE,DE){"use strict";var mq=Object.defineProperty;var Sq=(i,U,o)=>U in i?mq(i,U,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[U]=o;var p=(i,U,o)=>Sq(i,typeof U!="symbol"?U+"":U,o);var gE;const nr=Object.freeze([]),ar=Object.freeze({});var cr=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))(cr||{}),h=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(h||{}),rr=(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))(rr||{}),dr=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(dr||{}),Ys=(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))(Ys||{}),$=(t=>(t.STATUS="status",t.PRIORITY="priority",t.DESCRIPTION="description",t.TITLE="title",t.ASSIGNED_TO="assigned_to",t.DUE_DATE="due_date",t))($||{}),lr=(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))(lr||{}),ur=(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))(ur||{}),Nt=(t=>(t[t.ACTIVE=0]="ACTIVE",t[t.COMPLETED=2]="COMPLETED",t[t.CANCELLED=4]="CANCELLED",t))(Nt||{}),xt=(t=>(t[t.APPROVED=0]="APPROVED",t[t.REJECTED=2]="REJECTED",t[t.CHANGES_REQUESTED=4]="CHANGES_REQUESTED",t))(xt||{}),or=(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))(or||{}),hr=(t=>(t[t.APPROVED=0]="APPROVED",t[t.REJECTED=2]="REJECTED",t[t.CHANGES_REQUESTED=4]="CHANGES_REQUESTED",t))(hr||{});const WE=Ys.MEDIUM,pr=6e4,zE=[xt.APPROVED,xt.REJECTED,xt.CHANGES_REQUESTED],qE=[Nt.ACTIVE,Nt.COMPLETED,Nt.CANCELLED],jE=Nt.ACTIVE;function O(t){return{addOne:(y,m)=>{const f=t(m.payload);y.instances[f]=m.payload},addMany:(y,m)=>{for(const f of m.payload){const F=t(f);y.instances[F]=f}},setOne:(y,m)=>{const f=t(m.payload);y.instances[f]=m.payload},setMany:(y,m)=>{for(const f of m.payload){const F=t(f);y.instances[F]=f}},updateOne:(y,m)=>{const f=t(m.payload);y.instances[f]=m.payload},updateMany:(y,m)=>{for(const f of m.payload){const F=t(f);y.instances[F]=f}},deleteOne:(y,m)=>{delete y.instances[m.payload]},deleteMany:(y,m)=>{for(const f of m.payload)delete y.instances[f]},initialize:(y,m)=>{y.instances={};const f=new Set;for(const F of m.payload){const g=t(F);f.add(g),y.instances[g]=F}f.size!==m.payload.length&&console.warn("duplicate ids detected when initializing model instances.")}}}function $E(){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 m of u.payload)y.has(m)||y.add(m);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 m of u.payload)y.has(m)&&y.delete(m);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 m of u.payload)y.has(m)?y.delete(m):y.add(m);l.selection=Array.from(y)},getInitialState:l=>({...l,selection:[]})}}const es="versioning",T=o.createAction("RESET"),B=o.createAction("RESET_PROJECT_STATE"),I=o.createAction("RESET_ORGANIZATION_STATE");function CE(t,s){return bE.useMemo(t,s)}gE=Symbol.toStringTag;class Js{constructor(){p(this,gE,"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 Qs=!1;["true","1"].includes("".toLowerCase())&&(Qs=!0);function UE(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 Zs(t){const s={};return function(){const e=Array.prototype.slice.call(arguments);return e in s?(Qs&&console.debug(`Memoization debug: Using memorized return value for ${t.toString()}(`,e,")"),s[e]):(Qs&&console.debug(`Memoization debug: Cache miss! Memoizing ${t.toString()}(`,e,")"),s[e]=t.apply(this,e))}}function LE(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?nr:t,ts=t=>Object.keys(t).length===0?ar:t,yr=Zs(t=>{if(!t)return"";const s=new Date(t),e=s.getFullYear()===Xs.getFullYear(),n={day:"numeric",month:"short"};return e||(n.year="numeric"),s.toLocaleDateString([],n)}),NE=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),HE=1e3*86400,Xs=new Date,GE=t=>new Date(t).toDateString()===Xs.toDateString(),KE=Zs((t,s,e)=>{const n=Math.round((new Date(t).getTime()-Xs.getTime())/HE);return n<s||n>e?yr(t):NE.format(n,"days")});function YE(t){return new Uint8Array(t).reduce((e,n)=>e+n.toString(16).padStart(2,"0"),"")}function ws(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=YE(c);s(r)})},n.readAsArrayBuffer(t)})}const JE=(t,s)=>`${t}${s?`.${s}`:""}`;function QE(t,s){return new File([t],s,{type:t.type})}function mr(t){const s=t.name;return s.includes(".")?s.split(".").pop():""}const Sr=async t=>(await fetch(t)).blob(),fr=async(t,s)=>{const e=await Sr(t);return new File([e],s,{type:e.type})};function ZE(t){const s=new Blob([t]);ME.saveAs(s,t.name)}function Ar(t){return typeof t=="string"&&t.startsWith("blob:")}function XE(t){return t.type.startsWith("image/")}const wr={};function xE(t,s,e,...n){const a=wr[t];let c=!1;a?a[s]||(a[s]=!0,c=!0):(wr[t]={[s]:!0},c=!0),c&&console[e](...n)}const Pr=["created_at","updated_at","index","revision"];function P(t){return{...t,uuid:Bt.v4()}}function eV(t){const s={};for(const e of t)s[e.uuid]=e;return s}function E(t){return t.map(({uuid:s})=>s)}function Ps(t,s){return t.localeCompare(s)}function xs(t,s){return Ps(t.uuid,s.uuid)}function tV(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 sV(t){return t.toLowerCase().replace(" ","-")}function iV(t,s=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,s?"_":"-")}function nV(t,s){if(t.length<=s)return t;const e=t.slice(0,s-1);return e.slice(0,e.lastIndexOf(" "))+"…"}const aV=/^.+@.+\..+$/;function b(t){const s={...t};for(const e of[...Pr,"created_by"])e in s&&delete s[e];return s}const Tr=t=>{const s=t.toSorted((e,n)=>e.order-n.order);return sr(s,{id:e=>e.uuid,parentId:e=>e.parent,includeEmptyChildrenArray:!0,valueKey:!1})},cV=t=>{const{roots:s}=Tr(t);return s.map(e=>new As.Tree(e))},Or=(t,s)=>{const{nodes:e}=Tr(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in asset procedure step tree.`);return new As.Tree(n)},Ir=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,Fr=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,_r=t=>sr(t,{id:s=>s.uuid,parentId:s=>s.parent_document,includeEmptyChildrenArray:!0,valueKey:!1}),rV=t=>{const{roots:s}=_r(t);return s.map(e=>new As.Tree(e))},gr=(t,s)=>{const{nodes:e}=_r(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in document tree.`);return new As.Tree(n)};class dV{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 S=t=>(...s)=>e=>t(e,...s),G=O(t=>t.uuid),Rr={instances:{}},ei=o.createSlice({name:"agents",initialState:Rr,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Rr)),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:br,addConversation:Mr,addConversations:lV,setConversation:vr,setConversations:uV,updateConversation:kr,updateConversations:oV,deleteConversation:hV,deleteConversations:pV}=ei.actions,ti=t=>t.agentsReducer.instances,yV=o.createSelector([ti],t=>Object.values(t)),mV=S(o.createSelector([ti,(t,s)=>s],(t,s)=>t[s])),Er=ei.reducer,K=O(t=>t.uuid),Vr={instances:{}},si=o.createSlice({name:"assetAttachments",initialState:Vr,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Vr)),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:Br,addAssetAttachment:Dr,addAssetAttachments:ii,setAssetAttachment:Wr,setAssetAttachments:zr,updateAssetAttachment:qr,updateAssetAttachments:jr,deleteAssetAttachment:$r,deleteAssetAttachments:ni}=si.actions,Cr=t=>t.assetAttachmentReducer.instances,ai=o.createSelector([Cr],t=>Object.values(t)),Ur=t=>s=>s.assetAttachmentReducer.instances[t],Lr=S(o.createSelector([ai,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Nr=S(o.createSelector([ai,(t,s)=>s],(t,s)=>A(t.filter(({asset:e})=>s===e)))),Hr=si.reducer,Y=O(({uuid:t})=>t),Gr={instances:{}},ci=o.createSlice({name:"assetProcedureTypeAttachments",initialState:Gr,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Gr)),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:Kr,addAssetProcedureTypeAttachment:Yr,addAssetProcedureTypeAttachments:Jr,setAssetProcedureTypeAttachment:Qr,setAssetProcedureTypeAttachments:Zr,updateAssetProcedureTypeAttachment:Xr,updateAssetProcedureTypeAttachments:xr,deleteAssetProcedureTypeAttachment:ed,deleteAssetProcedureTypeAttachments:td}=ci.actions,sd=ci.reducer,id=t=>t.assetProcedureTypeAttachmentReducer.instances,ri=o.createSelector([id],t=>Object.values(t)),nd=t=>s=>s.assetProcedureTypeAttachmentReducer.instances[t],ad=S(o.createSelector([ri,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),SV=S(o.createSelector([ri,(t,s)=>s],(t,s)=>A(t.filter(({asset_procedure_type:e})=>s===e)))),J=O(({uuid:t})=>t),cd={instances:{}},di=o.createSlice({name:"assetProcedureTypeFieldsAttachments",initialState:cd,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,cd)),reducers:{initializeAssetProcedureTypeFieldsAttachments:J.initialize,addAssetProcedureTypeFieldsAttachment:J.addOne,addAssetProcedureTypeFieldsAttachments:J.addMany,setAssetProcedureTypeFieldsAttachment:J.setOne,setAssetProcedureTypeFieldsAttachments:J.setMany,updateAssetProcedureTypeFieldsAttachment:J.updateOne,updateAssetProcedureTypeFieldsAttachments:J.updateMany,deleteAssetProcedureTypeFieldsAttachment:J.deleteOne,deleteAssetProcedureTypeFieldsAttachments:J.deleteMany}}),{initializeAssetProcedureTypeFieldsAttachments:rd,addAssetProcedureTypeFieldsAttachment:dd,addAssetProcedureTypeFieldsAttachments:ld,setAssetProcedureTypeFieldsAttachment:ud,setAssetProcedureTypeFieldsAttachments:od,updateAssetProcedureTypeFieldsAttachment:hd,updateAssetProcedureTypeFieldsAttachments:pd,deleteAssetProcedureTypeFieldsAttachment:yd,deleteAssetProcedureTypeFieldsAttachments:md}=di.actions,Sd=di.reducer,fd=t=>t.assetProcedureTypeFieldsAttachmentReducer.instances,li=o.createSelector([fd],t=>Object.values(t)),fV=S(o.createSelector([li,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),Ad=t=>s=>s.assetProcedureTypeFieldsAttachmentReducer.instances[t],wd=S(o.createSelector([li,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Q=O(({uuid:t})=>t),Pd={instances:{}},ui=o.createSlice({name:"assetProcedureTypeFields",initialState:Pd,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Pd)),reducers:{initializeAssetProcedureTypeFields:Q.initialize,addAssetProcedureTypeFields:Q.addOne,addAssetProcedureTypeFieldsMany:Q.addMany,setAssetProcedureTypeFields:Q.setOne,setAssetProcedureTypeFieldsMany:Q.setMany,updateAssetProcedureTypeFields:Q.updateOne,updateAssetProcedureTypeFieldsMany:Q.updateMany,deleteAssetProcedureTypeFields:Q.deleteOne,deleteAssetProcedureTypeFieldsMany:Q.deleteMany}}),{initializeAssetProcedureTypeFields:Td,addAssetProcedureTypeFields:Od,addAssetProcedureTypeFieldsMany:Id,setAssetProcedureTypeFields:Fd,setAssetProcedureTypeFieldsMany:_d,updateAssetProcedureTypeFields:gd,updateAssetProcedureTypeFieldsMany:Rd,deleteAssetProcedureTypeFields:bd,deleteAssetProcedureTypeFieldsMany:Md}=ui.actions,vd=ui.reducer,kd=t=>t.assetProcedureTypeFieldsReducer.instances,Ts=o.createSelector([kd],t=>Object.values(t)),AV=S(o.createSelector([Ts,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),wV=S(o.createSelector([Ts,(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])),Ed=t=>s=>s.assetProcedureTypeFieldsReducer.instances[t],Vd=S(o.createSelector([Ts,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Z=O(({uuid:t})=>t),Bd={instances:{}},oi=o.createSlice({name:"assetProcedureTypeFieldValuesAttachments",initialState:Bd,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Bd)),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:Dd,addAssetProcedureTypeFieldValuesAttachment:Wd,addAssetProcedureTypeFieldValuesAttachments:hi,setAssetProcedureTypeFieldValuesAttachment:zd,setAssetProcedureTypeFieldValuesAttachments:qd,updateAssetProcedureTypeFieldValuesAttachment:jd,updateAssetProcedureTypeFieldValuesAttachments:$d,deleteAssetProcedureTypeFieldValuesAttachment:Cd,deleteAssetProcedureTypeFieldValuesAttachments:pi}=oi.actions,Ud=oi.reducer,Ld=t=>t.assetProcedureTypeFieldValuesAttachmentReducer.instances,yi=o.createSelector([Ld],t=>Object.values(t)),Nd=t=>s=>s.assetProcedureTypeFieldValuesAttachmentReducer.instances[t],Hd=S(o.createSelector([yi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Gd=S(o.createSelector([yi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),X=O(({uuid:t})=>t),Kd={instances:{}},mi=o.createSlice({name:"assetProcedureTypeFieldValues",initialState:Kd,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Kd)),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:Yd,addAssetProcedureTypeFieldValues:Jd,addAssetProcedureTypeFieldValuesMany:Qd,setAssetProcedureTypeFieldValues:Zd,setAssetProcedureTypeFieldValuesMany:Xd,updateAssetProcedureTypeFieldValues:xd,updateAssetProcedureTypeFieldValuesMany:el,deleteAssetProcedureTypeFieldValues:tl,deleteAssetProcedureTypeFieldValuesMany:sl}=mi.actions,il=mi.reducer,nl=t=>t.assetProcedureTypeFieldValuesReducer.instances,Os=o.createSelector([nl],t=>Object.values(t)),PV=S(o.createSelector([Os,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),TV=S(o.createSelector([Os,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure===s)))),al=t=>s=>s.assetProcedureTypeFieldValuesReducer.instances[t],cl=S(o.createSelector([Os,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),x=O(({uuid:t})=>t),rl={instances:{}},Si=o.createSlice({name:"assetProcedures",initialState:rl,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,rl)),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:dl,addAssetProcedure:ll,addAssetProcedures:fi,updateAssetProcedure:ul,updateAssetProcedures:ol,deleteAssetProcedure:hl,deleteAssetProcedures:Ai,setAssetProcedure:pl,setAssetProcedures:yl}=Si.actions,ml=Si.reducer,Sl=t=>t.assetProcedureReducer.instances,Is=o.createSelector([Sl],t=>Object.values(t)),fl=S(o.createSelector([Is,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),OV=S(o.createSelector([Is,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Al=t=>s=>s.assetProcedureReducer.instances[t],wl=S(o.createSelector([Is,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ee=O(t=>t.uuid),Pl={instances:{}},wi=o.createSlice({name:"assetProcedureTypes",initialState:Pl,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Pl)),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:Tl,addAssetProcedureType:Ol,addAssetProcedureTypes:Il,updateAssetProcedureType:Fl,updateAssetProcedureTypes:_l,deleteAssetProcedureType:gl,deleteAssetProcedureTypes:Rl,setAssetProcedureType:bl,setAssetProcedureTypes:Ml}=wi.actions,vl=wi.reducer,kl=t=>t.assetProcedureTypeReducer.instances,Pi=o.createSelector([kl],t=>Object.values(t)),El=t=>s=>s.assetProcedureTypeReducer.instances[t],Vl=S(o.createSelector([Pi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),IV=S(o.createSelector([Pi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),te=O(t=>t.uuid),Bl={instances:{}},Ti=o.createSlice({name:"assetProcedureStepFieldsAttachments",initialState:Bl,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Bl)),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:Dl,addAssetProcedureStepFieldsAttachment:Wl,addAssetProcedureStepFieldsAttachments:zl,setAssetProcedureStepFieldsAttachment:ql,setAssetProcedureStepFieldsAttachments:jl,updateAssetProcedureStepFieldsAttachment:$l,updateAssetProcedureStepFieldsAttachments:Cl,deleteAssetProcedureStepFieldsAttachment:Ul,deleteAssetProcedureStepFieldsAttachments:Ll}=Ti.actions,Nl=t=>t.assetProcedureStepFieldsAttachmentReducer.instances,Oi=o.createSelector([Nl],t=>Object.values(t)),FV=S(o.createSelector([Oi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),Hl=t=>s=>s.assetProcedureStepFieldsAttachmentReducer.instances[t],Gl=S(o.createSelector([Oi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Kl=Ti.reducer,se=O(t=>t.uuid),Yl={instances:{}},Ii=o.createSlice({name:"assetProcedureStepFields",initialState:Yl,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Yl)),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:Jl,addAssetProcedureStepFields:Ql,addAssetProcedureStepFieldsMany:Zl,setAssetProcedureStepFields:Xl,setAssetProcedureStepFieldsMany:xl,updateAssetProcedureStepFields:eu,updateAssetProcedureStepFieldsMany:tu,deleteAssetProcedureStepFields:su,deleteAssetProcedureStepFieldsMany:iu}=Ii.actions,Fi=t=>t.assetProcedureStepFieldsReducer.instances,Fs=o.createSelector([Fi],t=>Object.values(t)),_V=S(o.createSelector([Fs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_step===s)))),gV=S(o.createSelector([Fs,(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])),RV=o.createSelector([Fi],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}),nu=t=>s=>s.assetProcedureStepFieldsReducer.instances[t],au=S(o.createSelector([Fs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),cu=Ii.reducer,ie=O(t=>t.uuid),ru={instances:{}},_i=o.createSlice({name:"assetProcedureStepFieldValuesAttachments",initialState:ru,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,ru)),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:du,addAssetProcedureStepFieldValuesAttachment:lu,addAssetProcedureStepFieldValuesAttachments:gi,setAssetProcedureStepFieldValuesAttachment:uu,setAssetProcedureStepFieldValuesAttachments:ou,updateAssetProcedureStepFieldValuesAttachment:hu,updateAssetProcedureStepFieldValuesAttachments:pu,deleteAssetProcedureStepFieldValuesAttachment:yu,deleteAssetProcedureStepFieldValuesAttachments:Ri}=_i.actions,mu=t=>t.assetProcedureStepFieldValuesAttachmentReducer.instances,bi=o.createSelector([mu],t=>Object.values(t)),Su=t=>s=>s.assetProcedureStepFieldValuesAttachmentReducer.instances[t],fu=S(o.createSelector([bi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Au=S(o.createSelector([bi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),wu=_i.reducer,ne=O(t=>t.uuid),Pu={instances:{}},Mi=o.createSlice({name:"assetProcedureStepFieldValues",initialState:Pu,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Pu)),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:Tu,addAssetProcedureStepFieldValues:Ou,addAssetProcedureStepFieldValuesMany:Iu,setAssetProcedureStepFieldValues:Fu,setAssetProcedureStepFieldValuesMany:_u,updateAssetProcedureStepFieldValues:gu,updateAssetProcedureStepFieldValuesMany:Ru,deleteAssetProcedureStepFieldValues:bu,deleteAssetProcedureStepFieldValuesMany:Mu}=Mi.actions,vu=t=>t.assetProcedureStepFieldValuesReducer.instances,ss=o.createSelector([vu],t=>Object.values(t)),bV=S(o.createSelector([ss,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),MV=S(o.createSelector([ss,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure===s)))),vV=S(o.createSelector([ss,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_step===s)))),ku=t=>s=>s.assetProcedureStepFieldValuesReducer.instances[t],Eu=S(o.createSelector([ss,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Vu=Mi.reducer,ae=O(t=>t.uuid),Bu={instances:{}},vi=o.createSlice({name:"assetProcedureSteps",initialState:Bu,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Bu)),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:Du,setAssetProcedureStep:Wu,setAssetProcedureSteps:zu,addAssetProcedureStep:qu,addAssetProcedureSteps:ju,updateAssetProcedureStep:$u,updateAssetProcedureSteps:Cu,deleteAssetProcedureStep:Uu,deleteAssetProcedureSteps:Lu}=vi.actions,Nu=vi.reducer,_s=t=>t.assetProcedureStepReducer.instances,Hu=t=>s=>s.assetProcedureStepReducer.instances[t],ki=o.createSelector([_s],t=>Object.values(t)),kV=S(o.createSelector([_s,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return ts(e)})),EV=S(o.createSelector([ki,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),Gu=S(o.createSelector([ki,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ku=S(o.createSelector([_s,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=Or(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),ce=O(t=>t.uuid),Yu={instances:{}},Ei=o.createSlice({name:"assets",initialState:Yu,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Yu)),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:Ju,addAsset:Qu,addAssets:Vi,updateAsset:Zu,updateAssets:Xu,deleteAsset:xu,deleteAssets:Bi,setAsset:eo,setAssets:to}=Ei.actions,so=t=>t.assetReducer.instances,gs=o.createSelector([so],t=>A(Object.values(t))),VV=S(o.createSelector([gs,(t,s)=>s],(t,s)=>A(t.filter(({project:e})=>e===s)))),io=S(o.createSelector([gs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),no=t=>s=>s.assetReducer.instances[t],ao=S(o.createSelector([gs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),co=Ei.reducer,re=O(t=>t.uuid),ro={instances:{}},Di=o.createSlice({name:"assetStageCompletions",initialState:ro,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,ro)),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:lo,addAssetStageCompletion:uo,addAssetStageCompletions:oo,setAssetStageCompletion:ho,setAssetStageCompletions:po,updateAssetStageCompletion:yo,updateAssetStageCompletions:mo,deleteAssetStageCompletion:So,deleteAssetStageCompletions:fo}=Di.actions,Ao=Di.reducer,wo=t=>t.assetStageCompletionReducer.instances,Po=o.createSelector([wo],t=>Object.values(t)),To=t=>s=>s.assetStageCompletionReducer.instances[t],Oo=S(o.createSelector([Po,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),de=O(t=>t.uuid),Io={instances:{}},Wi=o.createSlice({name:"assetStages",initialState:Io,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Io)),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:Fo,setAssetStage:_o,setAssetStages:go,addAssetStage:Ro,addAssetStages:bo,updateAssetStage:Mo,updateAssetStages:vo,deleteAssetStage:ko,deleteAssetStages:Eo}=Wi.actions,Vo=Wi.reducer,zi=t=>t.assetStageReducer.instances,Bo=t=>s=>s.assetStageReducer.instances[t],qi=o.createSelector([zi],t=>Object.values(t)),BV=S(o.createSelector([zi,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return ts(e)})),DV=S(o.createSelector([qi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),Do=S(o.createSelector([qi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),le=O(t=>t.uuid),Wo={instances:{}},ji=o.createSlice({name:"assetTypeAttachments",initialState:Wo,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Wo)),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:zo,addAssetTypeAttachment:qo,addAssetTypeAttachments:$i,setAssetTypeAttachment:jo,setAssetTypeAttachments:$o,updateAssetTypeAttachment:Co,updateAssetTypeAttachments:Uo,deleteAssetTypeAttachment:Lo,deleteAssetTypeAttachments:Ci}=ji.actions,No=t=>t.assetTypeAttachmentReducer.instances,Ui=o.createSelector([No],t=>Object.values(t)),Ho=t=>s=>s.assetTypeAttachmentReducer.instances[t],Go=S(o.createSelector([Ui,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ko=S(o.createSelector([Ui,(t,s)=>s],(t,s)=>A(t.filter(({asset_type:e})=>s===e)))),Yo=ji.reducer,ue=O(t=>t.uuid),Jo={instances:{}},Li=o.createSlice({name:"assetTypeFieldsAttachments",initialState:Jo,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Jo)),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:Qo,addAssetTypeFieldsAttachment:Zo,addAssetTypeFieldsAttachments:Xo,setAssetTypeFieldsAttachment:xo,setAssetTypeFieldsAttachments:eh,updateAssetTypeFieldsAttachment:th,updateAssetTypeFieldsAttachments:sh,deleteAssetTypeFieldsAttachment:ih,deleteAssetTypeFieldsAttachments:nh}=Li.actions,ah=t=>t.assetTypeFieldsAttachmentReducer.instances,Ni=o.createSelector([ah],t=>Object.values(t)),WV=S(o.createSelector([Ni,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),ch=t=>s=>s.assetTypeFieldsAttachmentReducer.instances[t],rh=S(o.createSelector([Ni,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),dh=Li.reducer,oe=O(t=>t.uuid),lh={instances:{}},Hi=o.createSlice({name:"assetTypeFields",initialState:lh,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,lh)),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:uh,addAssetTypeFields:oh,addAssetTypeFieldsMany:hh,setAssetTypeFields:ph,setAssetTypeFieldsMany:yh,updateAssetTypeFields:mh,updateAssetTypeFieldsMany:Sh,deleteAssetTypeFields:fh,deleteAssetTypeFieldsMany:Ah}=Hi.actions,wh=t=>t.assetTypeFieldsReducer.instances,is=o.createSelector([wh],t=>Object.values(t)),zV=S(o.createSelector([is,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),qV=S(o.createSelector([is,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Ph=t=>s=>s.assetTypeFieldsReducer.instances[t],Th=S(o.createSelector([is,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Oh=Hi.reducer,he=O(t=>t.uuid),Ih={instances:{}},Gi=o.createSlice({name:"assetTypeFieldValuesAttachments",initialState:Ih,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Ih)),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:Fh,addAssetTypeFieldValuesAttachment:_h,addAssetTypeFieldValuesAttachments:Ki,setAssetTypeFieldValuesAttachment:gh,setAssetTypeFieldValuesAttachments:Rh,updateAssetTypeFieldValuesAttachment:bh,updateAssetTypeFieldValuesAttachments:Mh,deleteAssetTypeFieldValuesAttachment:vh,deleteAssetTypeFieldValuesAttachments:Yi}=Gi.actions,kh=t=>t.assetTypeFieldValuesAttachmentReducer.instances,Ji=o.createSelector([kh],t=>Object.values(t)),Eh=t=>s=>s.assetTypeFieldValuesAttachmentReducer.instances[t],Vh=S(o.createSelector([Ji,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Bh=S(o.createSelector([Ji,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Dh=Gi.reducer,pe=O(t=>t.uuid),Wh={instances:{}},Qi=o.createSlice({name:"assetTypeFieldValues",initialState:Wh,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Wh)),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:zh,addAssetTypeFieldValues:qh,addAssetTypeFieldValuesMany:jh,setAssetTypeFieldValues:$h,setAssetTypeFieldValuesMany:Ch,updateAssetTypeFieldValues:Uh,updateAssetTypeFieldValuesMany:Lh,deleteAssetTypeFieldValues:Nh,deleteAssetTypeFieldValuesMany:Hh}=Qi.actions,Gh=t=>t.assetTypeFieldValuesReducer.instances,Rs=o.createSelector([Gh],t=>Object.values(t)),jV=S(o.createSelector([Rs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),$V=S(o.createSelector([is,Rs,(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)))})),Kh=t=>s=>s.assetTypeFieldValuesReducer.instances[t],Yh=S(o.createSelector([Rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Jh=Qi.reducer,ye=O(t=>t.uuid),Qh={instances:{}},Zi=o.createSlice({name:"assetTypeIdentifiers",initialState:Qh,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Qh)),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:Zh,addAssetTypeIdentifier:Xh,addAssetTypeIdentifiers:xh,setAssetTypeIdentifier:ep,setAssetTypeIdentifiers:tp,updateAssetTypeIdentifier:sp,updateAssetTypeIdentifiers:ip,deleteAssetTypeIdentifier:np,deleteAssetTypeIdentifiers:ap}=Zi.actions,cp=t=>t.assetTypeIdentifierReducer.instances,Xi=o.createSelector([cp],t=>Object.values(t)),rp=t=>s=>s.assetTypeIdentifierReducer.instances[t],dp=S(o.createSelector([Xi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),CV=S(o.createSelector([Xi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),lp=Zi.reducer,me=O(t=>t.uuid),up={instances:{}},xi=o.createSlice({name:"assetTypeIdentifierValues",initialState:up,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,up)),reducers:{initializeAssetTypeIdentifierValues:me.initialize,addAssetTypeIdentifierValue:me.addOne,addAssetTypeIdentifierValues:me.addMany,setAssetTypeIdentifierValue:me.setOne,setAssetTypeIdentifierValues:me.setMany,updateAssetTypeIdentifierValue:me.updateOne,updateAssetTypeIdentifierValues:me.updateMany,deleteAssetTypeIdentifierValue:me.deleteOne,deleteAssetTypeIdentifierValues:me.deleteMany}}),{initializeAssetTypeIdentifierValues:op,addAssetTypeIdentifierValue:hp,addAssetTypeIdentifierValues:pp,setAssetTypeIdentifierValue:yp,setAssetTypeIdentifierValues:mp,updateAssetTypeIdentifierValue:Sp,updateAssetTypeIdentifierValues:fp,deleteAssetTypeIdentifierValue:Ap,deleteAssetTypeIdentifierValues:wp}=xi.actions,Pp=t=>t.assetTypeIdentifierValueReducer.instances,bs=o.createSelector([Pp],t=>Object.values(t)),Tp=t=>s=>s.assetTypeIdentifierValueReducer.instances[t],Op=S(o.createSelector([bs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),UV=S(o.createSelector([bs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),LV=S(o.createSelector([bs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type_identifier===s)))),Ip=xi.reducer,Se=O(t=>t.uuid),Fp={instances:{}},en=o.createSlice({name:"assetTypes",initialState:Fp,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Fp)),reducers:{initializeAssetTypes:Se.initialize,setAssetType:Se.setOne,setAssetTypes:Se.setMany,addAssetType:Se.addOne,addAssetTypes:Se.addMany,updateAssetType:Se.updateOne,updateAssetTypes:Se.updateMany,deleteAssetType:Se.deleteOne,deleteAssetTypes:Se.deleteMany}}),{initializeAssetTypes:_p,setAssetType:gp,setAssetTypes:Rp,addAssetType:bp,addAssetTypes:Mp,updateAssetType:vp,updateAssetTypes:kp,deleteAssetType:Ep,deleteAssetTypes:Vp}=en.actions,Bp=t=>t.assetTypeReducer.instances,tn=o.createSelector([Bp],t=>Object.values(t)),Dp=t=>s=>s.assetTypeReducer.instances[t],Wp=S(o.createSelector([tn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),NV=S(o.createSelector([tn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),zp=en.reducer,fe=O(t=>t.uuid),qp={instances:{}},sn=o.createSlice({name:"assetTypeStatuses",initialState:qp,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,qp)),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:jp,addAssetTypeStatus:$p,addAssetTypeStatuses:Cp,setAssetTypeStatus:Up,setAssetTypeStatuses:Lp,updateAssetTypeStatus:Np,updateAssetTypeStatuses:Hp,deleteAssetTypeStatus:Gp,deleteAssetTypeStatuses:Kp}=sn.actions,Yp=t=>t.assetTypeStatusReducer.instances,nn=o.createSelector([Yp],t=>A(Object.values(t).toSorted(Ir))),Jp=t=>s=>s.assetTypeStatusReducer.instances[t],Qp=S(o.createSelector([nn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),HV=S(o.createSelector([nn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Zp=sn.reducer,Xp={accessToken:"",refreshToken:"",isLoggedIn:!1},Ms=o.createSlice({name:"auth",initialState:Xp,extraReducers:t=>t.addCase(T,s=>Object.assign(s,Xp)),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||Ms.caseReducers.clearTokens(t),t.isLoggedIn=s.payload}}}),{setTokens:GV,clearTokens:KV,setLoggedIn:xp}=Ms.actions,YV=t=>t.authReducer.accessToken,JV=t=>t.authReducer.isLoggedIn,ey=Ms.reducer,Ae=O(t=>t.uuid),ty={instances:{}},an=o.createSlice({name:"documentAttachments",initialState:ty,extraReducers:t=>t.addCase(T,s=>Object.assign(s,ty)),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:sy,addDocumentAttachment:iy,addDocumentAttachments:ny,setDocumentAttachment:ay,setDocumentAttachments:cy,updateDocumentAttachment:ry,updateDocumentAttachments:dy,deleteDocumentAttachment:ly,deleteDocumentAttachments:uy}=an.actions,oy=t=>t.documentAttachmentReducer.instances,cn=o.createSelector([oy],t=>Object.values(t)),hy=t=>s=>s.documentAttachmentReducer.instances[t],py=S(o.createSelector([cn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),QV=S(o.createSelector([cn,(t,s)=>s],(t,s)=>A(t.filter(({document:e})=>s===e)))),yy=an.reducer,we=O(({uuid:t})=>t),my={instances:{}},rn=o.createSlice({name:"documents",initialState:my,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>{Object.assign(s,my)}),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:Sy,addDocument:fy,addDocuments:Ay,setDocument:wy,setDocuments:Py,updateDocument:Ty,updateDocuments:Oy,deleteDocument:Iy,deleteDocuments:Fy}=rn.actions,_y=rn.reducer,dn=t=>t.documentsReducer.instances,vs=o.createSelector([dn],t=>Object.values(t)),gy=t=>s=>s.documentsReducer.instances[t],Ry=S(o.createSelector([vs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ZV=S(o.createSelector([vs,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),XV=S(o.createSelector([vs,(t,s)=>s],(t,s)=>t.filter(e=>e.organization===s))),by=S(o.createSelector([dn,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=gr(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),Pe=O(t=>t.uuid),My={instances:{}},ln=o.createSlice({name:"emailDomains",initialState:My,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,My)),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:vy,addEmailDomain:ky,addEmailDomains:Ey,setEmailDomain:Vy,setEmailDomains:By,updateEmailDomain:Dy,updateEmailDomains:Wy,deleteEmailDomain:zy,deleteEmailDomains:qy}=ln.actions,jy=t=>t.emailDomainsReducer.instances,un=o.createSelector([jy],t=>Object.values(t)),$y=t=>s=>s.emailDomainsReducer.instances[t],Cy=S(o.createSelector([un,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),xV=S(o.createSelector([un,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Uy=ln.reducer,Ly={s3Urls:{}},Ny=1e3*60*60,eB=Ny*24*7,on=o.createSlice({name:"file",initialState:Ly,extraReducers:t=>t.addCase(T,s=>Object.assign(s,Ly)),reducers:{setUploadUrl:(t,s)=>{const{url:e,fields:n,sha1:a}=s.payload,c=new Date,r=new Date(c.getTime()+eB);t.s3Urls[a]={url:e,fields:n,exp:r.getTime()}}}}),{setUploadUrl:tB}=on.actions,sB=t=>s=>{const e=s.fileReducer.s3Urls[t];if(!e)return;const n=new Date().getTime();if(!((e.exp??n)-n<Ny))return e},Hy=on.reducer,Te=O(t=>t.uuid),Gy={instances:{}},hn=o.createSlice({name:"formIdentifiers",initialState:Gy,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Gy)),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:Ky,addFormIdentifier:Yy,addFormIdentifiers:Jy,setFormIdentifier:Qy,setFormIdentifiers:Zy,updateFormIdentifier:Xy,updateFormIdentifiers:xy,deleteFormIdentifier:em,deleteFormIdentifiers:tm}=hn.actions,sm=t=>t.formIdentifierReducer.instances,pn=o.createSelector([sm],t=>Object.values(t)),im=t=>s=>s.formIdentifierReducer.instances[t],nm=S(o.createSelector([pn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),iB=S(o.createSelector([pn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form===s)))),am=hn.reducer,Oe=O(t=>t.uuid),cm={instances:{}},yn=o.createSlice({name:"formIdentifierValues",initialState:cm,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,cm)),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:rm,addFormIdentifierValue:dm,addFormIdentifierValues:lm,setFormIdentifierValue:um,setFormIdentifierValues:om,updateFormIdentifierValue:hm,updateFormIdentifierValues:pm,deleteFormIdentifierValue:ym,deleteFormIdentifierValues:mm}=yn.actions,Sm=t=>t.formIdentifierValueReducer.instances,ks=o.createSelector([Sm],t=>Object.values(t)),fm=t=>s=>s.formIdentifierValueReducer.instances[t],Am=S(o.createSelector([ks,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),nB=S(o.createSelector([ks,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_submission===s)))),aB=S(o.createSelector([ks,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_identifier===s)))),wm=yn.reducer,Ie=O(t=>t.uuid),Pm={instances:{}},mn=o.createSlice({name:"formRevisionAttachments",initialState:Pm,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Pm)),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:Tm,addFormRevisionAttachment:Om,addFormRevisionAttachments:Im,setFormRevisionAttachment:Fm,setFormRevisionAttachments:_m,updateFormRevisionAttachment:gm,updateFormRevisionAttachments:Rm,deleteFormRevisionAttachment:bm,deleteFormRevisionAttachments:Mm}=mn.actions,Es=t=>t.formRevisionAttachmentReducer.instances,vm=o.createSelector([Es],t=>Object.values(t)),km=S(o.createSelector([Es,(t,s)=>s],(t,s)=>t[s])),Em=S(o.createSelector([vm,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),cB=S(o.createSelector([Es,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.form_revision===s)))),Vm=mn.reducer,Fe=O(t=>t.uuid),Bm={instances:{}},Sn=o.createSlice({name:"formRevisions",initialState:Bm,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Bm)),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:Dm,addFormRevision:Wm,addFormRevisions:fn,setFormRevision:zm,setFormRevisions:qm,updateFormRevision:jm,updateFormRevisions:$m,deleteFormRevision:Cm,deleteFormRevisions:An}=Sn.actions,Um=t=>t.formRevisionReducer.instances,Vs=o.createSelector([Um],t=>Object.values(t)),Lm=t=>s=>s.formRevisionReducer.instances[t],Nm=S(o.createSelector([Vs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),rB=S(o.createSelector([Vs,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Hm=S(o.createSelector([Vs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form===s)))),Gm=Sn.reducer,_e=O(t=>t.uuid),Km={instances:{}},wn=o.createSlice({name:"forms",initialState:Km,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Km)),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:Ym,addForm:Jm,addForms:Qm,setForm:Zm,setForms:Xm,updateForm:xm,updateForms:eS,deleteForm:tS,deleteForms:sS}=wn.actions,iS=wn.reducer,nS=t=>t.formReducer.instances,Pn=o.createSelector([nS],t=>Object.values(t)),aS=t=>s=>s.formReducer.instances[t],cS=S(o.createSelector([Pn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),dB=S(o.createSelector([Pn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),ge=O(t=>t.uuid),rS={instances:{}},Tn=o.createSlice({name:"formSubmissionAttachments",initialState:rS,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,rS)),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:dS,addFormSubmissionAttachment:lS,addFormSubmissionAttachments:On,setFormSubmissionAttachment:uS,setFormSubmissionAttachments:oS,updateFormSubmissionAttachment:hS,updateFormSubmissionAttachments:pS,deleteFormSubmissionAttachment:yS,deleteFormSubmissionAttachments:In}=Tn.actions,Fn=t=>t.formSubmissionAttachmentReducer.instances,_n=o.createSelector([Fn],t=>Object.values(t)),mS=S(o.createSelector([Fn,(t,s)=>s],(t,s)=>t[s])),gn=S(o.createSelector([_n,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(n=>e.has(n.uuid)))})),SS=gn,fS=S(o.createSelector([_n,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_submission===s)))),AS=Tn.reducer,Re=O(t=>t.uuid),wS={instances:{}},Rn=o.createSlice({name:"formSubmissions",initialState:wS,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,wS)),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:PS,setFormSubmission:TS,setFormSubmissions:OS,addFormSubmission:IS,addFormSubmissions:bn,updateFormSubmission:FS,updateFormSubmissions:_S,deleteFormSubmission:gS,deleteFormSubmissions:Mn}=Rn.actions,RS=t=>t.formSubmissionReducer.instances,vn=o.createSelector([RS],t=>Object.values(t)),bS=t=>s=>s.formSubmissionReducer.instances[t],MS=S(o.createSelector([vn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),vS=S(o.createSelector([vn,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s))),kS=Rn.reducer,be=O(t=>t.uuid),ES={instances:{}},kn=o.createSlice({name:"geoImages",initialState:ES,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,ES)),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:VS,setGeoImage:BS,setGeoImages:DS,addGeoImage:WS,addGeoImages:zS,updateGeoImage:qS,updateGeoImages:jS,deleteGeoImage:$S,deleteGeoImages:CS}=kn.actions,US=t=>t.geoImageReducer.instances,En=o.createSelector([US],t=>Object.values(t)),LS=t=>s=>s.geoImageReducer.instances[t],NS=S(o.createSelector([En,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),lB=S(o.createSelector([En,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),HS=kn.reducer,Me=O(t=>t.uuid),GS={instances:{}},Vn=o.createSlice({name:"issueAssociations",initialState:GS,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,GS)),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:KS,setIssueAssociations:YS,setIssueAssociation:JS,updateIssueAssociation:QS,updateIssueAssociations:ZS,addIssueAssociation:XS,addIssueAssociations:zt,deleteIssueAssociation:xS,deleteIssueAssociations:qt}=Vn.actions,ef=t=>t.issueAssociationReducer.instances,jt=o.createSelector([ef],t=>Object.values(t)),tf=t=>s=>s.issueAssociationReducer.instances[t],sf=S(o.createSelector([jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),nf=S(o.createSelector([jt,(t,s)=>s],(t,s)=>A(t.filter(({associated_issue:e})=>e===s)))),af=S(o.createSelector([jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({associated_issue:n})=>e.has(n)))})),cf=S(o.createSelector([jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({issue:n})=>n&&e.has(n)))})),rf=S(o.createSelector([jt,(t,s)=>s],(t,s)=>A(t.filter(({issue:e})=>e===s)))),df=S(o.createSelector([jt,(t,s)=>s],(t,s)=>A(t.filter(({asset:e})=>e===s)))),lf=Vn.reducer,ve=O(t=>t.uuid),uf={instances:{}},Bn=o.createSlice({name:"issueAttachments",initialState:uf,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,uf)),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:of,addIssueAttachment:hf,addIssueAttachments:Dn,setIssueAttachment:pf,setIssueAttachments:yf,updateIssueAttachment:mf,updateIssueAttachments:Sf,deleteIssueAttachment:ff,deleteIssueAttachments:Wn}=Bn.actions,Af=t=>t.issueAttachmentReducer.instances,zn=o.createSelector([Af],t=>Object.values(t)),wf=S(o.createSelector([zn,(t,s)=>s],(t,s)=>A(t.filter(({issue:e})=>s===e)))),Pf=t=>s=>s.issueAttachmentReducer.instances[t],Tf=S(o.createSelector([zn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Of=Bn.reducer,ke=O(t=>t.uuid),If={instances:{}},qn=o.createSlice({name:"issueCommentAttachments",initialState:If,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,If)),reducers:{initializeIssueCommentAttachments:ke.initialize,addIssueCommentAttachment:ke.addOne,addIssueCommentAttachments:ke.addMany,setIssueCommentAttachment:ke.setOne,setIssueCommentAttachments:ke.setMany,updateIssueCommentAttachment:ke.updateOne,updateIssueCommentAttachments:ke.updateMany,deleteIssueCommentAttachment:ke.deleteOne,deleteIssueCommentAttachments:ke.deleteMany}}),{initializeIssueCommentAttachments:Ff,addIssueCommentAttachment:_f,addIssueCommentAttachments:gf,setIssueCommentAttachment:Rf,setIssueCommentAttachments:bf,updateIssueCommentAttachment:Mf,updateIssueCommentAttachments:vf,deleteIssueCommentAttachment:kf,deleteIssueCommentAttachments:Ef}=qn.actions,Vf=t=>t.issueCommentAttachmentReducer.instances,jn=o.createSelector([Vf],t=>Object.values(t)),Bf=t=>s=>s.issueCommentAttachmentReducer.instances[t],Df=S(o.createSelector([jn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),uB=S(o.createSelector([jn,(t,s)=>s],(t,s)=>A(t.filter(({issue_comment:e})=>s===e)))),Wf=qn.reducer,Ee=O(t=>t.uuid),zf={instances:{}},$n=o.createSlice({name:"issueComments",initialState:zf,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,zf)),reducers:{initializeIssueComments:Ee.initialize,addIssueComment:Ee.addOne,addIssueComments:Ee.addMany,setIssueComment:Ee.setOne,setIssueComments:Ee.setMany,updateIssueComment:Ee.updateOne,updateIssueComments:Ee.updateMany,deleteIssueComment:Ee.deleteOne,deleteIssueComments:Ee.deleteMany}}),{initializeIssueComments:qf,addIssueComment:jf,addIssueComments:$f,setIssueComment:Cf,setIssueComments:Uf,updateIssueComment:Lf,updateIssueComments:Nf,deleteIssueComment:Hf,deleteIssueComments:Gf}=$n.actions,Cn=t=>t.issueCommentReducer.instances,Kf=t=>s=>s.issueCommentReducer.instances[t],Yf=S(o.createSelector([Cn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(Object.values(t).filter(({uuid:n})=>e.has(n)))})),oB=S(o.createSelector([Cn,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.issue===s)))),Jf=$n.reducer,Ve=O(t=>t.uuid),Qf={instances:{}},Un=o.createSlice({name:"issues",initialState:Qf,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Qf)),reducers:{initializeIssues:Ve.initialize,addIssue:Ve.addOne,addIssues:Ve.addMany,setIssue:Ve.setOne,setIssues:Ve.setMany,updateIssue:Ve.updateOne,updateIssues:Ve.updateMany,deleteIssue:Ve.deleteOne,deleteIssues:Ve.deleteMany}}),{initializeIssues:Zf,addIssue:Xf,addIssues:Ln,setIssue:xf,setIssues:eA,updateIssue:tA,updateIssues:sA,deleteIssue:iA,deleteIssues:Nn}=Un.actions,nA=t=>t.issueReducer.instances,Bs=o.createSelector([nA],t=>Object.values(t)),aA=t=>s=>s.issueReducer.instances[t],cA=S(o.createSelector([Bs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),hB=S(o.createSelector([Bs,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),rA=S(o.createSelector([Bs,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s))),dA=Un.reducer,Be=O(t=>t.uuid),lA={instances:{}},Hn=o.createSlice({name:"issueTypeAttachments",initialState:lA,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,lA)),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:uA,addIssueTypeAttachment:oA,addIssueTypeAttachments:hA,setIssueTypeAttachment:pA,setIssueTypeAttachments:yA,updateIssueTypeAttachment:mA,updateIssueTypeAttachments:SA,deleteIssueTypeAttachment:fA,deleteIssueTypeAttachments:AA}=Hn.actions,wA=t=>t.issueTypeAttachmentReducer.instances,Gn=o.createSelector([wA],t=>Object.values(t)),PA=t=>s=>s.issueTypeAttachmentReducer.instances[t],TA=S(o.createSelector([Gn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),pB=S(o.createSelector([Gn,(t,s)=>s],(t,s)=>A(t.filter(({issue_type:e})=>s===e)))),OA=Hn.reducer,De=O(t=>t.uuid),IA={instances:{}},Kn=o.createSlice({name:"issueTypeFieldsAttachments",initialState:IA,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,IA)),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:FA,addIssueTypeFieldsAttachment:_A,addIssueTypeFieldsAttachments:gA,setIssueTypeFieldsAttachment:RA,setIssueTypeFieldsAttachments:bA,updateIssueTypeFieldsAttachment:MA,updateIssueTypeFieldsAttachments:vA,deleteIssueTypeFieldsAttachment:kA,deleteIssueTypeFieldsAttachments:EA}=Kn.actions,VA=t=>t.issueTypeFieldsAttachmentReducer.instances,Yn=o.createSelector([VA],t=>Object.values(t)),yB=S(o.createSelector([Yn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),BA=t=>s=>s.issueTypeFieldsAttachmentReducer.instances[t],DA=S(o.createSelector([Yn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),WA=Kn.reducer,We=O(t=>t.uuid),zA={instances:{}},Jn=o.createSlice({name:"issueTypeFieldValues",initialState:zA,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,zA)),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:qA,addIssueTypeFieldValues:jA,addIssueTypeFieldValuesMany:$A,setIssueTypeFieldValues:CA,setIssueTypeFieldValuesMany:UA,updateIssueTypeFieldValues:LA,updateIssueTypeFieldValuesMany:NA,deleteIssueTypeFieldValues:HA,deleteIssueTypeFieldValuesMany:GA}=Jn.actions,KA=t=>t.issueTypeFieldValuesReducer.instances,Ds=o.createSelector([KA],t=>Object.values(t)),mB=S(o.createSelector([Ds,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),YA=t=>s=>s.issueTypeFieldValuesReducer.instances[t],JA=S(o.createSelector([Ds,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),QA=Jn.reducer,ze=O(t=>t.uuid),ZA={instances:{}},Qn=o.createSlice({name:"issueTypeFields",initialState:ZA,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,ZA)),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:XA,addIssueTypeFields:xA,addIssueTypeFieldsMany:ew,setIssueTypeFields:tw,setIssueTypeFieldsMany:sw,updateIssueTypeFields:iw,updateIssueTypeFieldsMany:nw,deleteIssueTypeFields:aw,deleteIssueTypeFieldsMany:cw}=Qn.actions,rw=t=>t.issueTypeFieldsReducer.instances,ns=o.createSelector([rw],t=>Object.values(t)),SB=S(o.createSelector([ns,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),fB=S(o.createSelector([ns,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),AB=S(o.createSelector([ns,Ds,(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)))})),dw=t=>s=>s.issueTypeFieldsReducer.instances[t],lw=S(o.createSelector([ns,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),uw=Qn.reducer,qe=O(t=>t.uuid),ow={instances:{}},Zn=o.createSlice({name:"issueTypeFieldValuesAttachments",initialState:ow,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,ow)),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:hw,addIssueTypeFieldValuesAttachment:pw,addIssueTypeFieldValuesAttachments:Xn,setIssueTypeFieldValuesAttachment:yw,setIssueTypeFieldValuesAttachments:mw,updateIssueTypeFieldValuesAttachment:Sw,updateIssueTypeFieldValuesAttachments:fw,deleteIssueTypeFieldValuesAttachment:Aw,deleteIssueTypeFieldValuesAttachments:xn}=Zn.actions,ww=t=>t.issueTypeFieldValuesAttachmentReducer.instances,ea=o.createSelector([ww],t=>Object.values(t)),Pw=t=>s=>s.issueTypeFieldValuesAttachmentReducer.instances[t],Tw=S(o.createSelector([ea,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ow=S(o.createSelector([ea,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Iw=Zn.reducer,je=O(t=>t.uuid),Fw={instances:{}},ta=o.createSlice({name:"issueTypeIdentifiers",initialState:Fw,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Fw)),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:_w,addIssueTypeIdentifier:gw,addIssueTypeIdentifiers:Rw,setIssueTypeIdentifier:bw,setIssueTypeIdentifiers:Mw,updateIssueTypeIdentifier:vw,updateIssueTypeIdentifiers:kw,deleteIssueTypeIdentifier:Ew,deleteIssueTypeIdentifiers:Vw}=ta.actions,Bw=t=>t.issueTypeIdentifierReducer.instances,sa=o.createSelector([Bw],t=>Object.values(t)),Dw=t=>s=>s.issueTypeIdentifierReducer.instances[t],Ww=S(o.createSelector([sa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),wB=S(o.createSelector([sa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),zw=ta.reducer,$e=O(t=>t.uuid),qw={instances:{}},ia=o.createSlice({name:"issueTypeIdentifierValues",initialState:qw,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,qw)),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:jw,addIssueTypeIdentifierValue:$w,addIssueTypeIdentifierValues:Cw,setIssueTypeIdentifierValue:Uw,setIssueTypeIdentifierValues:Lw,updateIssueTypeIdentifierValue:Nw,updateIssueTypeIdentifierValues:Hw,deleteIssueTypeIdentifierValue:Gw,deleteIssueTypeIdentifierValues:Kw}=ia.actions,Yw=t=>t.issueTypeIdentifierValueReducer.instances,Ws=o.createSelector([Yw],t=>Object.values(t)),Jw=t=>s=>s.issueTypeIdentifierValueReducer.instances[t],Qw=S(o.createSelector([Ws,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),PB=S(o.createSelector([Ws,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),TB=S(o.createSelector([Ws,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type_identifier===s)))),Zw=ia.reducer,Ce=O(t=>t.uuid),Xw={instances:{}},na=o.createSlice({name:"issueTypes",initialState:Xw,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Xw)),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:xw,addIssueType:eP,addIssueTypes:tP,setIssueType:sP,setIssueTypes:iP,updateIssueType:nP,updateIssueTypes:aP,deleteIssueType:cP,deleteIssueTypes:rP}=na.actions,dP=t=>t.issueTypeReducer.instances,aa=o.createSelector(dP,t=>Object.values(t)),lP=t=>s=>s.issueTypeReducer.instances[t],uP=S(o.createSelector([aa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),OB=S(o.createSelector([aa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),oP=na.reducer,Ue=O(t=>t.uuid),hP={instances:{}},ca=o.createSlice({name:"issueTypeStatuses",initialState:hP,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,hP)),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:yP,addIssueTypeStatuses:mP,setIssueTypeStatus:SP,setIssueTypeStatuses:fP,updateIssueTypeStatus:AP,updateIssueTypeStatuses:wP,deleteIssueTypeStatus:PP,deleteIssueTypeStatuses:TP}=ca.actions,OP=t=>t.issueTypeStatusReducer.instances,ra=o.createSelector([OP],t=>A(Object.values(t).toSorted(Fr))),da=t=>s=>s.issueTypeStatusReducer.instances[t],IP=S(o.createSelector([ra,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),IB=S(o.createSelector([ra,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),FP=ca.reducer,Le=O(t=>t.uuid),_P={instances:{}},la=o.createSlice({name:"issueUpdates",initialState:_P,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,_P)),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:gP,addIssueUpdate:ua,addIssueUpdates:oa,setIssueUpdate:RP,setIssueUpdates:bP,updateIssueUpdate:MP,updateIssueUpdates:vP,deleteIssueUpdate:ha,deleteIssueUpdates:pa}=la.actions,ya=t=>t.issueUpdateReducer.instances,ma=o.createSelector([ya],t=>Object.values(t)),kP=S(o.createSelector([ya,(t,s)=>s],(t,s)=>t[s])),EP=S(o.createSelector([ma,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),VP=S(o.createSelector([ma,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),BP=la.reducer,Ne=O(t=>t.id),DP={instances:{},currentUser:null},Sa=o.createSlice({name:"users",initialState:DP,extraReducers:t=>t.addCase(T,s=>Object.assign(s,DP)).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:WP,setUsers:zP,setUser:qP,addUsers:jP,addUser:fa,updateUsers:$P,updateUser:CP,deleteUser:Aa,deleteUsers:UP,setCurrentUser:FB,setCurrentUserProfile:_B}=Sa.actions,LP=Sa.reducer,NP=t=>t.userReducer.currentUser,wa=t=>t.userReducer.instances,zs=o.createSelector([wa],t=>Object.values(t)),qs=t=>s=>s.userReducer.instances[t],HP=S(o.createSelector([zs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({id:n})=>e.has(n)))})),He=O(t=>t.uuid),GP={instances:{}},Pa=o.createSlice({name:"organizationAccess",initialState:GP,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,GP)),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:KP,addOrganizationAccess:YP,addOrganizationAccesses:JP,setOrganizationAccess:QP,setOrganizationAccesses:ZP,updateOrganizationAccess:XP,updateOrganizationAccesses:xP,deleteOrganizationAccess:eT,deleteOrganizationAccesses:tT}=Pa.actions,sT=Pa.reducer,js=t=>t.organizationAccessReducer.instances,iT=t=>s=>s.organizationAccessReducer.instances[t],nT=S(o.createSelector([js,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(Object.values(t).filter(({uuid:n})=>e.has(n)))})),gB=o.createSelector([NP,js],(t,s)=>Object.values(s).find(n=>n.user===(t==null?void 0:t.id))??null),aT=o.createSelector([js],t=>{const s={};for(const e of Object.values(t))s[e.user]=e;return ts(s)}),RB=S(o.createSelector([wa,aT,(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),cT={instances:{}},Ta=o.createSlice({name:"organizations",initialState:cT,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,cT)),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:rT,setOrganizations:dT,setOrganization:lT,addOrganizations:uT,addOrganization:oT,updateOrganizations:hT,updateOrganization:pT,deleteOrganization:yT,deleteOrganizations:mT}=Ta.actions,ST=t=>t.organizationReducer.instances,fT=o.createSelector([ST],t=>Object.values(t)),AT=t=>s=>s.organizationReducer.instances[t],wT=S(o.createSelector([fT,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),PT=Ta.reducer,TT=(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}}}}},OT={deletedRequests:[],latestRetryTime:0},Oa=o.createSlice({name:"outbox",initialState:OT,extraReducers:t=>t.addCase(T,s=>Object.assign(s,OT)),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 TT(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}}}),bB=t=>t.outboxReducer.deletedRequests,MB=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:IT,markForDeletion:vB,markAsDeleted:FT,_setLatestRetryTime:_T}=Oa.actions,gT=Oa.reducer,Ke=O(t=>t.uuid),RT={instances:{}},Ia=o.createSlice({name:"projectAccess",initialState:RT,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,RT)),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:bT,addProjectAccess:MT,addProjectAccesses:vT,setProjectAccess:kT,setProjectAccesses:ET,updateProjectAccess:VT,updateProjectAccesses:BT,deleteProjectAccess:DT,deleteProjectAccesses:WT}=Ia.actions,zT=Ia.reducer,Fa=t=>t.projectAccessReducer.instances,as=o.createSelector(Fa,t=>Object.values(t)),qT=t=>s=>s.projectAccessReducer.instances[t],jT=S(o.createSelector([as,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),kB=S(o.createSelector([Fa,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.project===s)))),EB=S(o.createSelector([as,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.project===s))e[n.user]=n;return e})),VB=S(o.createSelector([zs,as,(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),$T={instances:{}},_a=o.createSlice({name:"projectAttachments",initialState:$T,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,$T)),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:CT,addProjectAttachment:UT,addProjectAttachments:LT,setProjectAttachment:NT,setProjectAttachments:HT,updateProjectAttachment:GT,updateProjectAttachments:KT,deleteProjectAttachment:YT,deleteProjectAttachments:JT}=_a.actions,QT=t=>t.projectAttachmentReducer.instances,ga=o.createSelector([QT],t=>Object.values(t)),ZT=t=>s=>s.projectAttachmentReducer.instances[t],XT=S(o.createSelector([ga,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),BB=S(o.createSelector([ga,(t,s)=>s],(t,s)=>A(t.filter(({project:e})=>s===e)))),xT=_a.reducer,Je=O(t=>t.uuid),eO={instances:{}},Ra=o.createSlice({name:"projectFiles",initialState:eO,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,eO)),reducers:{initializeProjectFiles:Je.initialize,setProjectFile:Je.setOne,setProjectFiles:Je.setMany,addProjectFile:Je.addOne,addProjectFiles:Je.addMany,updateProjectFile:Je.updateOne,updateProjectFiles:Je.updateMany,deleteProjectFile:Je.deleteOne,deleteProjectFiles:Je.deleteMany}}),{initializeProjectFiles:tO,setProjectFile:sO,setProjectFiles:iO,addProjectFile:nO,addProjectFiles:aO,updateProjectFile:cO,updateProjectFiles:rO,deleteProjectFile:dO,deleteProjectFiles:lO}=Ra.actions,uO=t=>t.projectFileReducer.instances,oO=o.createSelector([uO],t=>A(Object.values(t).sort((s,e)=>s.z_index-e.z_index))),hO=t=>s=>s.projectFileReducer.instances[t],pO=S(o.createSelector([oO,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yO=Ra.reducer,Qe=O(t=>t.uuid),mO={instances:{}},ba=o.createSlice({name:"projects",initialState:mO,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,mO)),reducers:{initializeProjects:Qe.initialize,setProjects:Qe.setMany,setProject:Qe.setOne,addProjects:Qe.addMany,addProject:Qe.addOne,updateProjects:Qe.updateMany,updateProject:Qe.updateOne,deleteProject:Qe.deleteOne,deleteProjects:Qe.deleteMany}}),{initializeProjects:SO,setProjects:fO,setProject:AO,addProjects:wO,addProject:PO,updateProjects:TO,updateProject:OO,deleteProject:IO,deleteProjects:FO}=ba.actions,_O=ba.reducer,gO=t=>t.projectReducer.instances,$s=o.createSelector([gO],t=>Object.values(t)),RO=t=>s=>s.projectReducer.instances[t],bO=S(o.createSelector([$s,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),DB=S(o.createSelector([$s,as,(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)))})),WB=S(o.createSelector([$s,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Ze=O(({uuid:t})=>t),MO={instances:{}},Ma=o.createSlice({name:"procedures",initialState:MO,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,MO)),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:vO,addProcedure:kO,addProcedures:va,setProcedure:EO,setProcedures:VO,updateProcedure:BO,updateProcedures:DO,deleteProcedure:WO,deleteProcedures:ka}=Ma.actions,zO=Ma.reducer,qO=t=>t.procedureReducer.instances,Ht=o.createSelector([qO],t=>Object.values(t)),jO=t=>s=>s.procedureReducer.instances[t],$O=S(o.createSelector([Ht,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),zB=S(o.createSelector([Ht,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),CO=S(o.createSelector([Ht,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_type===s)))),qB=S(o.createSelector([Ht,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),jB=S(o.createSelector([Ht,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),Xe=O(t=>t.uuid),UO={instances:{}},Ea=o.createSlice({name:"procedureStepAssignees",initialState:UO,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,UO)),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:LO,addProcedureStepAssignee:NO,addProcedureStepAssignees:HO,setProcedureStepAssignee:GO,setProcedureStepAssignees:KO,updateProcedureStepAssignee:YO,updateProcedureStepAssignees:JO,deleteProcedureStepAssignee:QO,deleteProcedureStepAssignees:ZO}=Ea.actions,XO=t=>t.procedureStepAssigneeReducer.instances,cs=o.createSelector([XO],t=>Object.values(t)),xO=t=>s=>s.procedureStepAssigneeReducer.instances[t],eI=S(o.createSelector([cs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),$B=S(o.createSelector([cs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),CB=S(o.createSelector([cs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),UB=S(o.createSelector([cs,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({procedure:n,procedure_step:a})=>n===s&&a===e)))),tI=Ea.reducer,xe=O(t=>t.uuid),sI={instances:{}},Va=o.createSlice({name:"procedureStepComments",initialState:sI,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,sI)),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:iI,addProcedureStepComment:nI,addProcedureStepComments:aI,setProcedureStepComment:cI,setProcedureStepComments:rI,updateProcedureStepComment:dI,updateProcedureStepComments:lI,deleteProcedureStepComment:uI,deleteProcedureStepComments:oI}=Va.actions,hI=t=>t.procedureStepCommentReducer.instances,rs=o.createSelector([hI],t=>Object.values(t)),pI=t=>s=>s.procedureStepCommentReducer.instances[t],yI=S(o.createSelector([rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),LB=S(o.createSelector([rs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),NB=S(o.createSelector([rs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),HB=S(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)))),mI=Va.reducer,et=O(t=>t.uuid),SI={instances:{}},Ba=o.createSlice({name:"procedureStepDefaultAssignees",initialState:SI,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,SI)),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:AI,addProcedureStepDefaultAssignees:wI,setProcedureStepDefaultAssignee:PI,setProcedureStepDefaultAssignees:TI,updateProcedureStepDefaultAssignee:OI,updateProcedureStepDefaultAssignees:II,deleteProcedureStepDefaultAssignee:FI,deleteProcedureStepDefaultAssignees:_I}=Ba.actions,gI=t=>t.procedureStepDefaultAssigneeReducer.instances,Da=o.createSelector([gI],t=>Object.values(t)),RI=t=>s=>s.procedureStepDefaultAssigneeReducer.instances[t],bI=S(o.createSelector([Da,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),GB=S(o.createSelector([Da,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),MI=Ba.reducer,tt=O(t=>t.uuid),vI={instances:{}},Wa=o.createSlice({name:"procedureStepDefaultReviewers",initialState:vI,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,vI)),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:kI,addProcedureStepDefaultReviewer:EI,addProcedureStepDefaultReviewers:VI,setProcedureStepDefaultReviewer:BI,setProcedureStepDefaultReviewers:DI,updateProcedureStepDefaultReviewer:WI,updateProcedureStepDefaultReviewers:zI,deleteProcedureStepDefaultReviewer:qI,deleteProcedureStepDefaultReviewers:jI}=Wa.actions,$I=t=>t.procedureStepDefaultReviewerReducer.instances,za=o.createSelector([$I],t=>Object.values(t)),CI=t=>s=>s.procedureStepDefaultReviewerReducer.instances[t],UI=S(o.createSelector([za,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),KB=S(o.createSelector([za,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),LI=Wa.reducer,st=O(t=>t.uuid),NI={instances:{}},qa=o.createSlice({name:"procedureStepEvents",initialState:NI,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,NI)),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:HI,addProcedureStepEvent:GI,addProcedureStepEvents:KI,setProcedureStepEvent:YI,setProcedureStepEvents:JI,updateProcedureStepEvent:QI,updateProcedureStepEvents:ZI,deleteProcedureStepEvent:XI,deleteProcedureStepEvents:xI}=qa.actions,eF=t=>t.procedureStepEventReducer.instances,ds=o.createSelector([eF],t=>Object.values(t)),tF=t=>s=>s.procedureStepEventReducer.instances[t],sF=S(o.createSelector([ds,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),YB=S(o.createSelector([ds,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),JB=S(o.createSelector([ds,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),QB=S(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)))),iF=qa.reducer,it=O(t=>t.uuid),nF={instances:{}},ja=o.createSlice({name:"procedureStepFieldsAttachments",initialState:nF,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,nF)),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:aF,addProcedureStepFieldsAttachment:cF,addProcedureStepFieldsAttachments:$a,setProcedureStepFieldsAttachment:rF,setProcedureStepFieldsAttachments:dF,updateProcedureStepFieldsAttachment:lF,updateProcedureStepFieldsAttachments:uF,deleteProcedureStepFieldsAttachment:oF,deleteProcedureStepFieldsAttachments:Ca}=ja.actions,hF=t=>t.procedureStepFieldsAttachmentReducer.instances,Ua=o.createSelector([hF],t=>Object.values(t)),pF=S(o.createSelector([Ua,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),yF=t=>s=>s.procedureStepFieldsAttachmentReducer.instances[t],mF=S(o.createSelector([Ua,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),SF=ja.reducer,nt=O(t=>t.uuid),fF={instances:{}},La=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:AF,addProcedureStepFields:wF,addProcedureStepFieldsMany:PF,setProcedureStepFields:TF,setProcedureStepFieldsMany:OF,updateProcedureStepFields:IF,updateProcedureStepFieldsMany:FF,deleteProcedureStepFields:_F,deleteProcedureStepFieldsMany:gF}=La.actions,Na=t=>t.procedureStepFieldsReducer.instances,Cs=o.createSelector([Na],t=>Object.values(t)),ZB=S(o.createSelector([Cs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),XB=S(o.createSelector([Cs,(t,s)=>s],(t,s)=>t.filter(e=>e.procedure_step===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),xB=o.createSelector([Na],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}),RF=t=>s=>s.procedureStepFieldsReducer.instances[t],bF=S(o.createSelector([Cs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),MF=La.reducer,at=O(t=>t.uuid),vF={instances:{}},Ha=o.createSlice({name:"procedureStepFieldValuesAttachments",initialState:vF,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,vF)),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:kF,addProcedureStepFieldValuesAttachment:EF,addProcedureStepFieldValuesAttachments:Ga,setProcedureStepFieldValuesAttachment:VF,setProcedureStepFieldValuesAttachments:BF,updateProcedureStepFieldValuesAttachment:DF,updateProcedureStepFieldValuesAttachments:WF,deleteProcedureStepFieldValuesAttachment:zF,deleteProcedureStepFieldValuesAttachments:Ka}=Ha.actions,qF=t=>t.procedureStepFieldValuesAttachmentReducer.instances,Ya=o.createSelector([qF],t=>Object.values(t)),jF=t=>s=>s.procedureStepFieldValuesAttachmentReducer.instances[t],$F=S(o.createSelector([Ya,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),CF=S(o.createSelector([Ya,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),UF=Ha.reducer,ct=O(t=>t.uuid),LF={instances:{}},Ja=o.createSlice({name:"procedureStepFieldValues",initialState:LF,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,LF)),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:NF,addProcedureStepFieldValues:HF,addProcedureStepFieldValuesMany:GF,setProcedureStepFieldValues:KF,setProcedureStepFieldValuesMany:YF,updateProcedureStepFieldValues:JF,updateProcedureStepFieldValuesMany:QF,deleteProcedureStepFieldValues:ZF,deleteProcedureStepFieldValuesMany:XF}=Ja.actions,xF=t=>t.procedureStepFieldValuesReducer.instances,$t=o.createSelector([xF],t=>Object.values(t)),eD=S(o.createSelector([$t,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),tD=S(o.createSelector([$t,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),e_=t=>s=>s.procedureStepFieldValuesReducer.instances[t],t_=S(o.createSelector([$t,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),sD=S(o.createSelector([$t,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({procedure:n,procedure_step:a})=>n===s&&a===e)))),iD=S(o.createSelector([$t,(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})),s_=Ja.reducer,rt=O(t=>t.uuid),i_={instances:{}},Qa=o.createSlice({name:"procedureStepFieldValuesReviews",initialState:i_,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,i_)),reducers:{initializeProcedureStepFieldValuesReviews:rt.initialize,addProcedureStepFieldValuesReview:rt.addOne,addProcedureStepFieldValuesReviews:rt.addMany,setProcedureStepFieldValuesReview:rt.setOne,setProcedureStepFieldValuesReviews:rt.setMany,updateProcedureStepFieldValuesReview:rt.updateOne,updateProcedureStepFieldValuesReviews:rt.updateMany,deleteProcedureStepFieldValuesReview:rt.deleteOne,deleteProcedureStepFieldValuesReviews:rt.deleteMany}}),{initializeProcedureStepFieldValuesReviews:n_,addProcedureStepFieldValuesReview:a_,addProcedureStepFieldValuesReviews:Za,setProcedureStepFieldValuesReview:c_,setProcedureStepFieldValuesReviews:r_,updateProcedureStepFieldValuesReview:d_,updateProcedureStepFieldValuesReviews:l_,deleteProcedureStepFieldValuesReview:u_,deleteProcedureStepFieldValuesReviews:Xa}=Qa.actions,o_=t=>t.procedureStepFieldValuesReviewReducer.instances,Gt=o.createSelector([o_],t=>Object.values(t)),h_=t=>s=>s.procedureStepFieldValuesReviewReducer.instances[t],p_=S(o.createSelector([Gt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),y_=S(o.createSelector([Gt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),nD=S(o.createSelector([Gt,(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})),aD=S(o.createSelector([$t,Gt,(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)))})),cD=o.createSelector([Gt],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}),m_=Qa.reducer,dt=O(t=>t.uuid),S_={instances:{}},xa=o.createSlice({name:"procedureStepReviewers",initialState:S_,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,S_)),reducers:{initializeProcedureStepReviewers:dt.initialize,addProcedureStepReviewer:dt.addOne,addProcedureStepReviewers:dt.addMany,setProcedureStepReviewer:dt.setOne,setProcedureStepReviewers:dt.setMany,updateProcedureStepReviewer:dt.updateOne,updateProcedureStepReviewers:dt.updateMany,deleteProcedureStepReviewer:dt.deleteOne,deleteProcedureStepReviewers:dt.deleteMany}}),{initializeProcedureStepReviewers:f_,addProcedureStepReviewer:A_,addProcedureStepReviewers:w_,setProcedureStepReviewer:P_,setProcedureStepReviewers:T_,updateProcedureStepReviewer:O_,updateProcedureStepReviewers:I_,deleteProcedureStepReviewer:F_,deleteProcedureStepReviewers:__}=xa.actions,g_=t=>t.procedureStepReviewerReducer.instances,ls=o.createSelector([g_],t=>Object.values(t)),R_=t=>s=>s.procedureStepReviewerReducer.instances[t],b_=S(o.createSelector([ls,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),rD=S(o.createSelector([ls,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),dD=S(o.createSelector([ls,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),lD=S(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)))),M_=xa.reducer,lt=O(t=>t.uuid),v_={instances:{}},ec=o.createSlice({name:"procedureSteps",initialState:v_,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,v_)),reducers:{initializeProcedureSteps:lt.initialize,setProcedureStep:lt.setOne,setProcedureSteps:lt.setMany,addProcedureStep:lt.addOne,addProcedureSteps:lt.addMany,updateProcedureStep:lt.updateOne,updateProcedureSteps:lt.updateMany,deleteProcedureStep:lt.deleteOne,deleteProcedureSteps:lt.deleteMany}}),{initializeProcedureSteps:k_,setProcedureStep:E_,setProcedureSteps:V_,addProcedureStep:B_,addProcedureSteps:D_,updateProcedureStep:W_,updateProcedureSteps:z_,deleteProcedureStep:q_,deleteProcedureSteps:j_}=ec.actions,$_=ec.reducer,tc=t=>t.procedureStepReducer.instances,C_=t=>s=>s.procedureStepReducer.instances[t],sc=o.createSelector([tc],t=>Object.values(t)),uD=S(o.createSelector([tc,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.procedure_type===s&&(e[n]=a);return ts(e)})),oD=S(o.createSelector([sc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_type===s)))),U_=S(o.createSelector([sc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ut=O(({uuid:t})=>t),L_={instances:{}},ic=o.createSlice({name:"procedureTypeAttachments",initialState:L_,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,L_)),reducers:{initializeProcedureTypeAttachments:ut.initialize,addProcedureTypeAttachment:ut.addOne,addProcedureTypeAttachments:ut.addMany,setProcedureTypeAttachment:ut.setOne,setProcedureTypeAttachments:ut.setMany,updateProcedureTypeAttachment:ut.updateOne,updateProcedureTypeAttachments:ut.updateMany,deleteProcedureTypeAttachment:ut.deleteOne,deleteProcedureTypeAttachments:ut.deleteMany}}),{initializeProcedureTypeAttachments:N_,addProcedureTypeAttachment:H_,addProcedureTypeAttachments:G_,setProcedureTypeAttachment:K_,setProcedureTypeAttachments:Y_,updateProcedureTypeAttachment:J_,updateProcedureTypeAttachments:Q_,deleteProcedureTypeAttachment:Z_,deleteProcedureTypeAttachments:X_}=ic.actions,x_=ic.reducer,eg=t=>t.procedureTypeAttachmentReducer.instances,nc=o.createSelector([eg],t=>Object.values(t)),tg=t=>s=>s.procedureTypeAttachmentReducer.instances[t],sg=S(o.createSelector([nc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),hD=S(o.createSelector([nc,(t,s)=>s],(t,s)=>A(t.filter(({procedure_type:e})=>s===e)))),ot=O(({uuid:t})=>t),ig={instances:{}},ac=o.createSlice({name:"procedureTypeFieldsAttachments",initialState:ig,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,ig)),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:ng,addProcedureTypeFieldsAttachment:ag,addProcedureTypeFieldsAttachments:cg,setProcedureTypeFieldsAttachment:rg,setProcedureTypeFieldsAttachments:dg,updateProcedureTypeFieldsAttachment:lg,updateProcedureTypeFieldsAttachments:ug,deleteProcedureTypeFieldsAttachment:og,deleteProcedureTypeFieldsAttachments:hg}=ac.actions,pg=ac.reducer,yg=t=>t.procedureTypeFieldsAttachmentReducer.instances,cc=o.createSelector([yg],t=>Object.values(t)),pD=S(o.createSelector([cc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),mg=t=>s=>s.procedureTypeFieldsAttachmentReducer.instances[t],Sg=S(o.createSelector([cc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ht=O(({uuid:t})=>t),fg={instances:{}},rc=o.createSlice({name:"procedureTypeFields",initialState:fg,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,fg)),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:Ag,addProcedureTypeFields:wg,addProcedureTypeFieldsMany:Pg,setProcedureTypeFields:Tg,setProcedureTypeFieldsMany:Og,updateProcedureTypeFields:Ig,updateProcedureTypeFieldsMany:Fg,deleteProcedureTypeFields:_g,deleteProcedureTypeFieldsMany:gg}=rc.actions,Rg=rc.reducer,bg=t=>t.procedureTypeFieldsReducer.instances,Us=o.createSelector([bg],t=>Object.values(t)),yD=S(o.createSelector([Us,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_type===s)))),mD=S(o.createSelector([Us,(t,s)=>s],(t,s)=>t.filter(e=>e.procedure_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Mg=t=>s=>s.procedureTypeFieldsReducer.instances[t],vg=S(o.createSelector([Us,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),pt=O(({uuid:t})=>t),kg={instances:{}},dc=o.createSlice({name:"procedureFieldValuesAttachments",initialState:kg,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,kg)),reducers:{initializeProcedureFieldValuesAttachments:pt.initialize,addProcedureFieldValuesAttachment:pt.addOne,addProcedureFieldValuesAttachments:pt.addMany,setProcedureFieldValuesAttachment:pt.setOne,setProcedureFieldValuesAttachments:pt.setMany,updateProcedureFieldValuesAttachment:pt.updateOne,updateProcedureFieldValuesAttachments:pt.updateMany,deleteProcedureFieldValuesAttachment:pt.deleteOne,deleteProcedureFieldValuesAttachments:pt.deleteMany}}),{initializeProcedureFieldValuesAttachments:Eg,addProcedureFieldValuesAttachment:Vg,addProcedureFieldValuesAttachments:lc,setProcedureFieldValuesAttachment:Bg,setProcedureFieldValuesAttachments:Dg,updateProcedureFieldValuesAttachment:Wg,updateProcedureFieldValuesAttachments:zg,deleteProcedureFieldValuesAttachment:qg,deleteProcedureFieldValuesAttachments:uc}=dc.actions,jg=dc.reducer,$g=t=>t.procedureFieldValuesAttachmentReducer.instances,oc=o.createSelector([$g],t=>Object.values(t)),Cg=t=>s=>s.procedureFieldValuesAttachmentReducer.instances[t],Ug=S(o.createSelector([oc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Lg=S(o.createSelector([oc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),yt=O(({uuid:t})=>t),Ng={instances:{}},hc=o.createSlice({name:"procedureFieldValues",initialState:Ng,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Ng)),reducers:{initializeProcedureFieldValues:yt.initialize,addProcedureFieldValues:yt.addOne,addProcedureFieldValuesMany:yt.addMany,setProcedureFieldValues:yt.setOne,setProcedureFieldValuesMany:yt.setMany,updateProcedureFieldValues:yt.updateOne,updateProcedureFieldValuesMany:yt.updateMany,deleteProcedureFieldValues:yt.deleteOne,deleteProcedureFieldValuesMany:yt.deleteMany}}),{initializeProcedureFieldValues:Hg,addProcedureFieldValues:Gg,addProcedureFieldValuesMany:Kg,setProcedureFieldValues:Yg,setProcedureFieldValuesMany:Jg,updateProcedureFieldValues:Qg,updateProcedureFieldValuesMany:Zg,deleteProcedureFieldValues:Xg,deleteProcedureFieldValuesMany:xg}=hc.actions,eR=hc.reducer,tR=t=>t.procedureFieldValuesReducer.instances,pc=o.createSelector([tR],t=>Object.values(t)),SD=S(o.createSelector([pc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),sR=t=>s=>s.procedureFieldValuesReducer.instances[t],iR=S(o.createSelector([pc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),mt=O(t=>t.uuid),nR={instances:{}},yc=o.createSlice({name:"procedureTypes",initialState:nR,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,nR)),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:aR,addProcedureType:cR,addProcedureTypes:rR,setProcedureType:dR,setProcedureTypes:lR,updateProcedureType:uR,updateProcedureTypes:oR,deleteProcedureType:hR,deleteProcedureTypes:pR}=yc.actions,yR=yc.reducer,mR=t=>t.procedureTypeReducer.instances,Ls=o.createSelector([mR],t=>Object.values(t)),SR=t=>s=>s.procedureTypeReducer.instances[t],fR=S(o.createSelector([Ls,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),fD=S(o.createSelector([Ls,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),AD=S(o.createSelector([Ls,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),wD={isRehydrated:!1},mc=o.createSlice({name:"rehydrated",initialState:wD,reducers:{setRehydrated:(t,s)=>{t.isRehydrated=s.payload}}}),{setRehydrated:PD}=mc.actions,TD=t=>t.rehydratedReducer.isRehydrated,AR=mc.reducer,St=O(t=>t.uuid),wR={instances:{}},Sc=o.createSlice({name:"teamMemberships",initialState:wR,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,wR)),reducers:{initializeTeamMemberships:St.initialize,addTeamMembership:St.addOne,addTeamMemberships:St.addMany,setTeamMembership:St.setOne,setTeamMemberships:St.setMany,updateTeamMembership:St.updateOne,updateTeamMemberships:St.updateMany,deleteTeamMembership:St.deleteOne,deleteTeamMemberships:St.deleteMany}}),{initializeTeamMemberships:PR,addTeamMembership:TR,addTeamMemberships:OR,setTeamMembership:IR,setTeamMemberships:FR,updateTeamMembership:_R,updateTeamMemberships:gR,deleteTeamMembership:RR,deleteTeamMemberships:bR}=Sc.actions,MR=Sc.reducer,vR=t=>t.teamMembershipReducer.instances,Ns=o.createSelector([vR],t=>Object.values(t)),kR=t=>s=>s.teamMembershipReducer.instances[t],ER=S(o.createSelector([Ns,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),OD=S(o.createSelector([Ns,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.team===s))e[n.user]=n;return e})),ID=S(o.createSelector([zs,Ns,(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),VR={instances:{}},fc=o.createSlice({name:"teams",initialState:VR,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,VR)),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:BR,addTeam:DR,addTeams:WR,setTeam:zR,setTeams:qR,updateTeam:jR,updateTeams:$R,deleteTeam:CR,deleteTeams:UR}=fc.actions,LR=t=>t.teamReducer.instances,Ac=o.createSelector([LR],t=>Object.values(t)),NR=t=>s=>s.teamReducer.instances[t],HR=S(o.createSelector([Ac,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),FD=S(o.createSelector([Ac,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),GR=fc.reducer,_D={version:0},KR=o.createSlice({name:"versioning",initialState:_D,reducers:{}}),YR=KR.reducer,At=O(t=>t.uuid),JR={instances:{}},wc=o.createSlice({name:"workflows",initialState:JR,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,JR)),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:QR,addWorkflow:ZR,addWorkflows:XR,setWorkflow:xR,setWorkflows:eb,updateWorkflow:tb,updateWorkflows:sb,deleteWorkflow:ib,deleteWorkflows:nb}=wc.actions,ab=t=>t.workflowReducer.instances,Hs=o.createSelector([ab],t=>Object.values(t)),cb=t=>s=>s.workflowReducer.instances[t],rb=S(o.createSelector([Hs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),gD=S(o.createSelector([Hs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),RD=S(o.createSelector([Hs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_type===s)))),db=wc.reducer,wt=O(t=>t.uuid),lb={instances:{}},Pc=o.createSlice({name:"workflowIssueLinks",initialState:lb,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,lb)),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:ub,addWorkflowIssueLink:ob,addWorkflowIssueLinks:us,setWorkflowIssueLink:hb,setWorkflowIssueLinks:pb,updateWorkflowIssueLink:yb,updateWorkflowIssueLinks:mb,deleteWorkflowIssueLink:Sb,deleteWorkflowIssueLinks:os}=Pc.actions,fb=t=>t.workflowIssueLinkReducer.instances,Kt=o.createSelector([fb],t=>Object.values(t)),Ab=t=>s=>s.workflowIssueLinkReducer.instances[t],wb=S(o.createSelector([Kt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Pb=S(o.createSelector([Kt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),Tb=S(o.createSelector([Kt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({workflow:n})=>e.has(n)))})),Ob=S(o.createSelector([Kt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),bD=S(o.createSelector([Kt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({issue:n})=>e.has(n)))})),Ib=Pc.reducer,Pt=O(t=>t.uuid),Fb={instances:{}},Tc=o.createSlice({name:"workflowStepAssignees",initialState:Fb,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,Fb)),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:_b,addWorkflowStepAssignee:gb,addWorkflowStepAssignees:Rb,setWorkflowStepAssignee:bb,setWorkflowStepAssignees:Mb,updateWorkflowStepAssignee:vb,updateWorkflowStepAssignees:kb,deleteWorkflowStepAssignee:Eb,deleteWorkflowStepAssignees:Vb}=Tc.actions,Bb=t=>t.workflowStepAssigneeReducer.instances,hs=o.createSelector([Bb],t=>Object.values(t)),Db=t=>s=>s.workflowStepAssigneeReducer.instances[t],Wb=S(o.createSelector([hs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),MD=S(o.createSelector([hs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),vD=S(o.createSelector([hs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),kD=S(o.createSelector([hs,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),zb=Tc.reducer,Tt=O(t=>t.uuid),qb={instances:{}},Oc=o.createSlice({name:"workflowStepComments",initialState:qb,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,qb)),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:jb,addWorkflowStepComment:$b,addWorkflowStepComments:Cb,setWorkflowStepComment:Ub,setWorkflowStepComments:Lb,updateWorkflowStepComment:Nb,updateWorkflowStepComments:Hb,deleteWorkflowStepComment:Gb,deleteWorkflowStepComments:Kb}=Oc.actions,Yb=t=>t.workflowStepCommentReducer.instances,ps=o.createSelector([Yb],t=>Object.values(t)),Jb=t=>s=>s.workflowStepCommentReducer.instances[t],Qb=S(o.createSelector([ps,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ED=S(o.createSelector([ps,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),VD=S(o.createSelector([ps,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),BD=S(o.createSelector([ps,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),Zb=Oc.reducer,Ot=O(t=>t.uuid),Xb={instances:{}},Ic=o.createSlice({name:"workflowStepDefaultAssignees",initialState:Xb,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,Xb)),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:xb,addWorkflowStepDefaultAssignee:eM,addWorkflowStepDefaultAssignees:tM,setWorkflowStepDefaultAssignee:sM,setWorkflowStepDefaultAssignees:iM,updateWorkflowStepDefaultAssignee:nM,updateWorkflowStepDefaultAssignees:aM,deleteWorkflowStepDefaultAssignee:cM,deleteWorkflowStepDefaultAssignees:rM}=Ic.actions,dM=t=>t.workflowStepDefaultAssigneeReducer.instances,Fc=o.createSelector([dM],t=>Object.values(t)),lM=t=>s=>s.workflowStepDefaultAssigneeReducer.instances[t],uM=S(o.createSelector([Fc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),DD=S(o.createSelector([Fc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),oM=Ic.reducer,It=O(t=>t.uuid),hM={instances:{}},_c=o.createSlice({name:"workflowStepDefaultReviewers",initialState:hM,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,hM)),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:pM,addWorkflowStepDefaultReviewer:yM,addWorkflowStepDefaultReviewers:mM,setWorkflowStepDefaultReviewer:SM,setWorkflowStepDefaultReviewers:fM,updateWorkflowStepDefaultReviewer:AM,updateWorkflowStepDefaultReviewers:wM,deleteWorkflowStepDefaultReviewer:PM,deleteWorkflowStepDefaultReviewers:TM}=_c.actions,OM=t=>t.workflowStepDefaultReviewerReducer.instances,gc=o.createSelector([OM],t=>Object.values(t)),IM=t=>s=>s.workflowStepDefaultReviewerReducer.instances[t],FM=S(o.createSelector([gc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),WD=S(o.createSelector([gc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),_M=_c.reducer,Ft=O(t=>t.uuid),gM={instances:{}},Rc=o.createSlice({name:"workflowStepEvents",initialState:gM,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,gM)),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:RM,addWorkflowStepEvent:bM,addWorkflowStepEvents:MM,setWorkflowStepEvent:vM,setWorkflowStepEvents:kM,updateWorkflowStepEvent:EM,updateWorkflowStepEvents:VM,deleteWorkflowStepEvent:BM,deleteWorkflowStepEvents:DM}=Rc.actions,WM=t=>t.workflowStepEventReducer.instances,ys=o.createSelector([WM],t=>Object.values(t)),zM=t=>s=>s.workflowStepEventReducer.instances[t],qM=S(o.createSelector([ys,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),zD=S(o.createSelector([ys,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),qD=S(o.createSelector([ys,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),jD=S(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)))),jM=Rc.reducer,_t=O(t=>t.uuid),$M={instances:{}},bc=o.createSlice({name:"workflowStepFieldsAttachments",initialState:$M,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,$M)),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:CM,addWorkflowStepFieldsAttachment:UM,addWorkflowStepFieldsAttachments:Mc,setWorkflowStepFieldsAttachment:LM,setWorkflowStepFieldsAttachments:NM,updateWorkflowStepFieldsAttachment:HM,updateWorkflowStepFieldsAttachments:GM,deleteWorkflowStepFieldsAttachment:KM,deleteWorkflowStepFieldsAttachments:vc}=bc.actions,YM=t=>t.workflowStepFieldsAttachmentReducer.instances,kc=o.createSelector([YM],t=>Object.values(t)),JM=S(o.createSelector([kc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),QM=t=>s=>s.workflowStepFieldsAttachmentReducer.instances[t],ZM=S(o.createSelector([kc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),XM=bc.reducer,gt=O(t=>t.uuid),xM={instances:{}},Ec=o.createSlice({name:"workflowStepFields",initialState:xM,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,xM)),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:ev,addWorkflowStepFields:tv,addWorkflowStepFieldsMany:sv,setWorkflowStepFields:iv,setWorkflowStepFieldsMany:nv,updateWorkflowStepFields:av,updateWorkflowStepFieldsMany:cv,deleteWorkflowStepFields:rv,deleteWorkflowStepFieldsMany:dv}=Ec.actions,lv=t=>t.workflowStepFieldsReducer.instances,Gs=o.createSelector([lv],t=>Object.values(t)),$D=S(o.createSelector([Gs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),CD=S(o.createSelector([Gs,(t,s)=>s],(t,s)=>t.filter(e=>e.workflow_step===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),uv=t=>s=>s.workflowStepFieldsReducer.instances[t],ov=S(o.createSelector([Gs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),hv=Ec.reducer,Rt=O(t=>t.uuid),pv={instances:{}},Vc=o.createSlice({name:"workflowStepFieldValuesAttachments",initialState:pv,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,pv)),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:yv,addWorkflowStepFieldValuesAttachment:mv,addWorkflowStepFieldValuesAttachments:Bc,setWorkflowStepFieldValuesAttachment:Sv,setWorkflowStepFieldValuesAttachments:fv,updateWorkflowStepFieldValuesAttachment:Av,updateWorkflowStepFieldValuesAttachments:wv,deleteWorkflowStepFieldValuesAttachment:Pv,deleteWorkflowStepFieldValuesAttachments:Dc}=Vc.actions,Tv=t=>t.workflowStepFieldValuesAttachmentReducer.instances,Wc=o.createSelector([Tv],t=>Object.values(t)),Ov=t=>s=>s.workflowStepFieldValuesAttachmentReducer.instances[t],Iv=S(o.createSelector([Wc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Fv=S(o.createSelector([Wc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),_v=Vc.reducer,bt=O(t=>t.uuid),gv={instances:{}},zc=o.createSlice({name:"workflowStepFieldValues",initialState:gv,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,gv)),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:Rv,addWorkflowStepFieldValues:bv,addWorkflowStepFieldValuesMany:Mv,setWorkflowStepFieldValues:vv,setWorkflowStepFieldValuesMany:kv,updateWorkflowStepFieldValues:Ev,updateWorkflowStepFieldValuesMany:Vv,deleteWorkflowStepFieldValues:Bv,deleteWorkflowStepFieldValuesMany:Dv}=zc.actions,Wv=t=>t.workflowStepFieldValuesReducer.instances,Dt=o.createSelector([Wv],t=>Object.values(t)),UD=S(o.createSelector([Dt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),LD=S(o.createSelector([Dt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),zv=t=>s=>s.workflowStepFieldValuesReducer.instances[t],qv=S(o.createSelector([Dt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ND=S(o.createSelector([Dt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),HD=S(o.createSelector([Dt,(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})),jv=zc.reducer,Mt=O(t=>t.uuid),$v={instances:{}},qc=o.createSlice({name:"workflowStepFieldValuesReviewRequests",initialState:$v,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,$v)),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:Cv,addWorkflowStepFieldValuesReviewRequest:Uv,addWorkflowStepFieldValuesReviewRequests:jc,setWorkflowStepFieldValuesReviewRequest:Lv,setWorkflowStepFieldValuesReviewRequests:Nv,updateWorkflowStepFieldValuesReviewRequest:Hv,updateWorkflowStepFieldValuesReviewRequests:Gv,deleteWorkflowStepFieldValuesReviewRequest:Kv,deleteWorkflowStepFieldValuesReviewRequests:$c}=qc.actions,Yv=t=>t.workflowStepFieldValuesReviewRequestReducer.instances,ms=o.createSelector([Yv],t=>Object.values(t)),Jv=t=>s=>s.workflowStepFieldValuesReviewRequestReducer.instances[t],Qv=S(o.createSelector([ms,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Zv=S(o.createSelector([ms,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),GD=S(o.createSelector([ms,(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})),KD=S(o.createSelector([Dt,ms,(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)))})),Xv=qc.reducer,vt=O(t=>t.uuid),xv={instances:{}},Cc=o.createSlice({name:"workflowStepFieldValuesReviews",initialState:xv,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,xv)),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:ek,addWorkflowStepFieldValuesReview:tk,addWorkflowStepFieldValuesReviews:Uc,setWorkflowStepFieldValuesReview:sk,setWorkflowStepFieldValuesReviews:ik,updateWorkflowStepFieldValuesReview:nk,updateWorkflowStepFieldValuesReviews:ak,deleteWorkflowStepFieldValuesReview:ck,deleteWorkflowStepFieldValuesReviews:Lc}=Cc.actions,rk=t=>t.workflowStepFieldValuesReviewReducer.instances,Yt=o.createSelector([rk],t=>Object.values(t)),dk=t=>s=>s.workflowStepFieldValuesReviewReducer.instances[t],lk=S(o.createSelector([Yt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),uk=S(o.createSelector([Yt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),YD=S(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})),JD=S(o.createSelector([Dt,Yt,(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)))})),QD=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}),ok=Cc.reducer,kt=O(t=>t.uuid),hk={instances:{}},Nc=o.createSlice({name:"workflowStepReviewers",initialState:hk,extraReducers:t=>t.addMatcher(o.isAnyOf(T,B,I),s=>Object.assign(s,hk)),reducers:{initializeWorkflowStepReviewers:kt.initialize,addWorkflowStepReviewer:kt.addOne,addWorkflowStepReviewers:kt.addMany,setWorkflowStepReviewer:kt.setOne,setWorkflowStepReviewers:kt.setMany,updateWorkflowStepReviewer:kt.updateOne,updateWorkflowStepReviewers:kt.updateMany,deleteWorkflowStepReviewer:kt.deleteOne,deleteWorkflowStepReviewers:kt.deleteMany}}),{initializeWorkflowStepReviewers:pk,addWorkflowStepReviewer:yk,addWorkflowStepReviewers:mk,setWorkflowStepReviewer:Sk,setWorkflowStepReviewers:fk,updateWorkflowStepReviewer:Ak,updateWorkflowStepReviewers:wk,deleteWorkflowStepReviewer:Pk,deleteWorkflowStepReviewers:Tk}=Nc.actions,Ok=t=>t.workflowStepReviewerReducer.instances,Ss=o.createSelector([Ok],t=>Object.values(t)),Ik=t=>s=>s.workflowStepReviewerReducer.instances[t],Fk=S(o.createSelector([Ss,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ZD=S(o.createSelector([Ss,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),XD=S(o.createSelector([Ss,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),xD=S(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)))),_k=Nc.reducer,Et=O(t=>t.uuid),gk={instances:{}},Hc=o.createSlice({name:"workflowSteps",initialState:gk,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,gk)),reducers:{initializeWorkflowSteps:Et.initialize,addWorkflowStep:Et.addOne,addWorkflowSteps:Et.addMany,setWorkflowStep:Et.setOne,setWorkflowSteps:Et.setMany,updateWorkflowStep:Et.updateOne,updateWorkflowSteps:Et.updateMany,deleteWorkflowStep:Et.deleteOne,deleteWorkflowSteps:Et.deleteMany}}),{initializeWorkflowSteps:Rk,addWorkflowStep:bk,addWorkflowSteps:Mk,setWorkflowStep:vk,setWorkflowSteps:kk,updateWorkflowStep:Ek,updateWorkflowSteps:Vk,deleteWorkflowStep:Bk,deleteWorkflowSteps:Dk}=Hc.actions,Wk=t=>t.workflowStepReducer.instances,Gc=o.createSelector([Wk],t=>Object.values(t)),zk=t=>s=>s.workflowStepReducer.instances[t],qk=S(o.createSelector([Gc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),eW=S(o.createSelector([Gc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_type===s)))),jk=Hc.reducer,Vt=O(t=>t.uuid),$k={instances:{}},Kc=o.createSlice({name:"workflowTypes",initialState:$k,extraReducers:t=>t.addMatcher(o.isAnyOf(T,I),s=>Object.assign(s,$k)),reducers:{initializeWorkflowTypes:Vt.initialize,addWorkflowType:Vt.addOne,addWorkflowTypes:Vt.addMany,setWorkflowType:Vt.setOne,setWorkflowTypes:Vt.setMany,updateWorkflowType:Vt.updateOne,updateWorkflowTypes:Vt.updateMany,deleteWorkflowType:Vt.deleteOne,deleteWorkflowTypes:Vt.deleteMany}}),{initializeWorkflowTypes:Ck,addWorkflowType:Uk,addWorkflowTypes:Lk,setWorkflowType:Nk,setWorkflowTypes:Hk,updateWorkflowType:Gk,updateWorkflowTypes:Kk,deleteWorkflowType:Yk,deleteWorkflowTypes:Jk}=Kc.actions,Qk=t=>t.workflowTypeReducer.instances,Yc=o.createSelector([Qk],t=>Object.values(t)),Zk=t=>s=>s.workflowTypeReducer.instances[t],Xk=S(o.createSelector([Yc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),tW=S(o.createSelector([Yc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),xk=Kc.reducer,Jc={outboxReducer:gT,fileReducer:Hy,authReducer:ey},sW=o.combineReducers(Jc),eE={...Jc,[es]:YR,assetReducer:co,assetAttachmentReducer:Hr,assetStageCompletionReducer:Ao,assetStageReducer:Vo,assetTypeReducer:zp,assetTypeAttachmentReducer:Yo,issueReducer:dA,issueAttachmentReducer:Of,issueTypeReducer:oP,issueTypeAttachmentReducer:OA,organizationReducer:PT,projectReducer:_O,projectAttachmentReducer:xT,projectAccessReducer:zT,organizationAccessReducer:sT,projectFileReducer:yO,procedureTypeReducer:yR,procedureReducer:zO,procedureTypeFieldsReducer:Rg,procedureFieldValuesReducer:eR,procedureTypeAttachmentReducer:x_,procedureTypeFieldsAttachmentReducer:pg,procedureFieldValuesAttachmentReducer:jg,procedureStepFieldsAttachmentReducer:SF,procedureStepFieldsReducer:MF,procedureStepFieldValuesAttachmentReducer:UF,procedureStepFieldValuesReducer:s_,procedureStepFieldValuesReviewReducer:m_,procedureStepAssigneeReducer:tI,procedureStepCommentReducer:mI,procedureStepDefaultAssigneeReducer:MI,procedureStepDefaultReviewerReducer:LI,procedureStepEventReducer:iF,procedureStepReviewerReducer:M_,procedureStepReducer:$_,rehydratedReducer:AR,formReducer:iS,formRevisionReducer:Gm,formRevisionAttachmentReducer:Vm,formSubmissionAttachmentReducer:AS,formSubmissionReducer:kS,formIdentifierReducer:am,formIdentifierValueReducer:wm,userReducer:LP,emailDomainsReducer:Uy,documentsReducer:_y,documentAttachmentReducer:yy,teamReducer:GR,agentsReducer:Er,issueCommentReducer:Jf,issueCommentAttachmentReducer:Wf,issueUpdateReducer:BP,geoImageReducer:HS,issueAssociationReducer:lf,issueTypeFieldsReducer:uw,issueTypeFieldValuesReducer:QA,issueTypeFieldsAttachmentReducer:WA,issueTypeFieldValuesAttachmentReducer:Iw,issueTypeIdentifierReducer:zw,issueTypeIdentifierValueReducer:Zw,issueTypeStatusReducer:FP,assetTypeFieldsReducer:Oh,assetTypeFieldValuesReducer:Jh,assetTypeFieldsAttachmentReducer:dh,assetTypeFieldValuesAttachmentReducer:Dh,assetTypeIdentifierReducer:lp,assetTypeIdentifierValueReducer:Ip,assetTypeStatusReducer:Zp,assetProcedureTypeReducer:vl,assetProcedureReducer:ml,assetProcedureTypeFieldsReducer:vd,assetProcedureTypeFieldValuesReducer:il,assetProcedureTypeFieldsAttachmentReducer:Sd,assetProcedureTypeFieldValuesAttachmentReducer:Ud,assetProcedureTypeAttachmentReducer:sd,assetProcedureStepFieldsAttachmentReducer:Kl,assetProcedureStepFieldsReducer:cu,assetProcedureStepFieldValuesAttachmentReducer:wu,assetProcedureStepFieldValuesReducer:Vu,assetProcedureStepReducer:Nu,teamMembershipReducer:MR,workflowTypeReducer:xk,workflowStepReducer:jk,workflowStepFieldsReducer:hv,workflowStepFieldsAttachmentReducer:XM,workflowReducer:db,workflowIssueLinkReducer:Ib,workflowStepAssigneeReducer:zb,workflowStepCommentReducer:Zb,workflowStepDefaultAssigneeReducer:oM,workflowStepDefaultReviewerReducer:_M,workflowStepEventReducer:jM,workflowStepFieldValuesReducer:jv,workflowStepFieldValuesAttachmentReducer:_v,workflowStepFieldValuesReviewReducer:ok,workflowStepFieldValuesReviewRequestReducer:Xv,workflowStepReviewerReducer:_k},iW=o.combineReducers(eE),tE=1e4,sE=200,Qc=[400,409,403,404,405,500],L=1e4,iE={};class nE{constructor(s){p(this,"client");p(this,"pageSize",tE);iE[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 aE=()=>dE.length-1,cE=t=>(t[es]={version:aE()},t),rE=()=>cE({}),nW=t=>(t.outboxReducer&&(t.outboxReducer.deletedRequests=[]),t),aW=t=>s=>{var e;return s===void 0&&(s={}),((e=s[es])==null?void 0:e.version)===aE()?s:t(s)},dE=[cE,rE,rE,nW],cW=Object.fromEntries(dE.map((t,s)=>[s,aW(t)])),rW=t=>{if(t)throw t;const s=Zt();s?s.dispatch({type:"rehydrated/setRehydrated",payload:!0}):console.error("Client store not set")},lE=(t,s,e)=>{const n=Ut();return n?(n.addRequest(s),n.getQueue()):(console.warn("Outbox coordinator not set; cannot enqueue request yet."),[])},uE=(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 dW(t,s){if(!s.payload)throw new Error("Received empty payload");return FE(s)}const lW={...ir,effect:dW,discard:hE,returnPromises:!0,persistCallback:rW,retry:pW,persistOptions:{storage:kE},queue:{...ir.queue,enqueue:lE,dequeue:uE,peek:(...t)=>hW(...t)}},uW=EE(cW,es),oW=o.compose(vE.offline(lW),uW);async function oE(t,s,e){if(s.store.getState().outboxReducer.deletedRequests.includes(t.payload.uuid))throw new Error("Request was marked for deletion");const a=iE[t.meta.offline.effect.serviceName];if(!a)throw new Error(`Service ${t.meta.offline.effect.serviceName} not found`);return Xc(t.meta.offline.effect.BASE_URL,t.meta.offline.effect.request,s,a,e)}function hE(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,Ut,Vt,Rk,bk,sr,As,Mk,ir,vk,Ek,yq,mq,kk,Vk,Bk){"use strict";var hq=Object.defineProperty;var pq=(i,U,o)=>U in i?hq(i,U,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[U]=o;var p=(i,U,o)=>pq(i,typeof U!="symbol"?U+"":U,o);var _k;const nr=Object.freeze([]),ar=Object.freeze({});var cr=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))(cr||{}),h=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(h||{}),rr=(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))(rr||{}),dr=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(dr||{}),Ks=(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))(Ks||{}),$=(t=>(t.STATUS="status",t.PRIORITY="priority",t.DESCRIPTION="description",t.TITLE="title",t.ASSIGNED_TO="assigned_to",t.DUE_DATE="due_date",t))($||{}),lr=(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))(lr||{}),ur=(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))(ur||{}),Lt=(t=>(t[t.ACTIVE=0]="ACTIVE",t[t.COMPLETED=2]="COMPLETED",t[t.CANCELLED=4]="CANCELLED",t))(Lt||{}),xt=(t=>(t[t.APPROVED=0]="APPROVED",t[t.REJECTED=2]="REJECTED",t[t.CHANGES_REQUESTED=4]="CHANGES_REQUESTED",t))(xt||{}),or=(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))(or||{}),hr=(t=>(t[t.APPROVED=0]="APPROVED",t[t.REJECTED=2]="REJECTED",t[t.CHANGES_REQUESTED=4]="CHANGES_REQUESTED",t))(hr||{});const Dk=Ks.MEDIUM,pr=6e4,Wk=[xt.APPROVED,xt.REJECTED,xt.CHANGES_REQUESTED],zk=[Lt.ACTIVE,Lt.COMPLETED,Lt.CANCELLED],qk=Lt.ACTIVE;function T(t){return{addOne:(y,m)=>{const f=t(m.payload);y.instances[f]=m.payload},addMany:(y,m)=>{for(const f of m.payload){const F=t(f);y.instances[F]=f}},setOne:(y,m)=>{const f=t(m.payload);y.instances[f]=m.payload},setMany:(y,m)=>{for(const f of m.payload){const F=t(f);y.instances[F]=f}},updateOne:(y,m)=>{const f=t(m.payload);y.instances[f]=m.payload},updateMany:(y,m)=>{for(const f of m.payload){const F=t(f);y.instances[F]=f}},deleteOne:(y,m)=>{delete y.instances[m.payload]},deleteMany:(y,m)=>{for(const f of m.payload)delete y.instances[f]},initialize:(y,m)=>{y.instances={};const f=new Set;for(const F of m.payload){const R=t(F);f.add(R),y.instances[R]=F}f.size!==m.payload.length&&console.warn("duplicate ids detected when initializing model instances.")}}}function jk(t){return{initializeSelection:(l,u)=>{l[t]=Array.from(new Set(u.payload))},selectOne:(l,u)=>{console.debug(l,l[t]),!new Set(l[t]).has(u.payload)&&l[t].push(u.payload)},selectMany:(l,u)=>{const y=new Set(l[t]);for(const m of u.payload)y.has(m)||y.add(m);l[t]=Array.from(y)},unselectOne:(l,u)=>{const y=new Set(l[t]);y.has(u.payload)&&(y.delete(u.payload),l[t]=Array.from(y))},unselectMany:(l,u)=>{const y=new Set(l[t]);for(const m of u.payload)y.has(m)&&y.delete(m);l[t]=Array.from(y)},toggleOne:(l,u)=>{const y=new Set(l[t]);y.has(u.payload)?y.delete(u.payload):y.add(u.payload),l[t]=Array.from(y)},toggleMany:(l,u)=>{const y=new Set(l[t]);for(const m of u.payload)y.has(m)?y.delete(m):y.add(m);l[t]=Array.from(y)}}}const es="versioning",P=o.createAction("RESET"),V=o.createAction("RESET_PROJECT_STATE"),I=o.createAction("RESET_ORGANIZATION_STATE");function $k(t,s){return Rk.useMemo(t,s)}_k=Symbol.toStringTag;class Ys{constructor(){p(this,_k,"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 Js=!1;["true","1"].includes("".toLowerCase())&&(Js=!0);function Ck(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 Qs(t){const s={};return function(){const e=Array.prototype.slice.call(arguments);return e in s?(Js&&console.debug(`Memoization debug: Using memorized return value for ${t.toString()}(`,e,")"),s[e]):(Js&&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?nr:t,ts=t=>Object.keys(t).length===0?ar:t,yr=Qs(t=>{if(!t)return"";const s=new Date(t),e=s.getFullYear()===Zs.getFullYear(),n={day:"numeric",month:"short"};return e||(n.year="numeric"),s.toLocaleDateString([],n)}),Lk=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),Nk=1e3*86400,Zs=new Date,Hk=t=>new Date(t).toDateString()===Zs.toDateString(),Gk=Qs((t,s,e)=>{const n=Math.round((new Date(t).getTime()-Zs.getTime())/Nk);return n<s||n>e?yr(t):Lk.format(n,"days")});function Kk(t){return new Uint8Array(t).reduce((e,n)=>e+n.toString(16).padStart(2,"0"),"")}function ws(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=Kk(c);s(r)})},n.readAsArrayBuffer(t)})}const Yk=(t,s)=>`${t}${s?`.${s}`:""}`;function Jk(t,s){return new File([t],s,{type:t.type})}function mr(t){const s=t.name;return s.includes(".")?s.split(".").pop():""}const Sr=async t=>(await fetch(t)).blob(),fr=async(t,s)=>{const e=await Sr(t);return new File([e],s,{type:e.type})};function Qk(t){const s=new Blob([t]);bk.saveAs(s,t.name)}function Ar(t){return typeof t=="string"&&t.startsWith("blob:")}function Zk(t){return t.type.startsWith("image/")}const wr={};function Xk(t,s,e,...n){const a=wr[t];let c=!1;a?a[s]||(a[s]=!0,c=!0):(wr[t]={[s]:!0},c=!0),c&&console[e](...n)}const Pr=["created_at","updated_at","index","revision"];function O(t){return{...t,uuid:Vt.v4()}}function xk(t){const s={};for(const e of t)s[e.uuid]=e;return s}function v(t){return t.map(({uuid:s})=>s)}function Ps(t,s){return t.localeCompare(s)}function Xs(t,s){return Ps(t.uuid,s.uuid)}function eV(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 tV(t){return t.toLowerCase().replace(" ","-")}function sV(t,s=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,s?"_":"-")}function iV(t,s){if(t.length<=s)return t;const e=t.slice(0,s-1);return e.slice(0,e.lastIndexOf(" "))+"…"}const nV=/^.+@.+\..+$/;function _(t){const s={...t};for(const e of[...Pr,"created_by"])e in s&&delete s[e];return s}const Or=t=>{const s=t.toSorted((e,n)=>e.order-n.order);return sr(s,{id:e=>e.uuid,parentId:e=>e.parent,includeEmptyChildrenArray:!0,valueKey:!1})},aV=t=>{const{roots:s}=Or(t);return s.map(e=>new As.Tree(e))},Tr=(t,s)=>{const{nodes:e}=Or(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in asset procedure step tree.`);return new As.Tree(n)},Ir=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,Fr=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,_r=t=>sr(t,{id:s=>s.uuid,parentId:s=>s.parent_document,includeEmptyChildrenArray:!0,valueKey:!1}),cV=t=>{const{roots:s}=_r(t);return s.map(e=>new As.Tree(e))},gr=(t,s)=>{const{nodes:e}=_r(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in document tree.`);return new As.Tree(n)};class rV{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 S=t=>(...s)=>e=>t(e,...s),N=T(t=>t.uuid),Rr={instances:{}},xs=o.createSlice({name:"agents",initialState:Rr,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,Rr)),reducers:{initializeConversations:N.initialize,addConversation:N.addOne,addConversations:N.addMany,setConversation:N.setOne,setConversations:N.setMany,updateConversation:N.updateOne,updateConversations:N.updateMany,deleteConversation:N.deleteOne,deleteConversations:N.deleteMany}}),{initializeConversations:br,addConversation:Mr,addConversations:dV,setConversation:vr,setConversations:lV,updateConversation:Er,updateConversations:uV,deleteConversation:oV,deleteConversations:hV}=xs.actions,ei=t=>t.agentsReducer.instances,pV=o.createSelector([ei],t=>Object.values(t)),yV=S(o.createSelector([ei,(t,s)=>s],(t,s)=>t[s])),kr=xs.reducer,H=T(t=>t.uuid),Vr={instances:{}},ti=o.createSlice({name:"assetAttachments",initialState:Vr,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,Vr)),reducers:{initializeAssetAttachments:H.initialize,addAssetAttachment:H.addOne,addAssetAttachments:H.addMany,setAssetAttachment:H.setOne,setAssetAttachments:H.setMany,updateAssetAttachment:H.updateOne,updateAssetAttachments:H.updateMany,deleteAssetAttachment:H.deleteOne,deleteAssetAttachments:H.deleteMany}}),{initializeAssetAttachments:Br,addAssetAttachment:Dr,addAssetAttachments:si,setAssetAttachment:Wr,setAssetAttachments:zr,updateAssetAttachment:qr,updateAssetAttachments:jr,deleteAssetAttachment:$r,deleteAssetAttachments:ii}=ti.actions,Cr=t=>t.assetAttachmentReducer.instances,ni=o.createSelector([Cr],t=>Object.values(t)),Ur=t=>s=>s.assetAttachmentReducer.instances[t],Lr=S(o.createSelector([ni,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Nr=S(o.createSelector([ni,(t,s)=>s],(t,s)=>A(t.filter(({asset:e})=>s===e)))),Hr=ti.reducer,G=T(({uuid:t})=>t),Gr={instances:{}},ai=o.createSlice({name:"assetProcedureTypeAttachments",initialState:Gr,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,Gr)),reducers:{initializeAssetProcedureTypeAttachments:G.initialize,addAssetProcedureTypeAttachment:G.addOne,addAssetProcedureTypeAttachments:G.addMany,setAssetProcedureTypeAttachment:G.setOne,setAssetProcedureTypeAttachments:G.setMany,updateAssetProcedureTypeAttachment:G.updateOne,updateAssetProcedureTypeAttachments:G.updateMany,deleteAssetProcedureTypeAttachment:G.deleteOne,deleteAssetProcedureTypeAttachments:G.deleteMany}}),{initializeAssetProcedureTypeAttachments:Kr,addAssetProcedureTypeAttachment:Yr,addAssetProcedureTypeAttachments:Jr,setAssetProcedureTypeAttachment:Qr,setAssetProcedureTypeAttachments:Zr,updateAssetProcedureTypeAttachment:Xr,updateAssetProcedureTypeAttachments:xr,deleteAssetProcedureTypeAttachment:ed,deleteAssetProcedureTypeAttachments:td}=ai.actions,sd=ai.reducer,id=t=>t.assetProcedureTypeAttachmentReducer.instances,ci=o.createSelector([id],t=>Object.values(t)),nd=t=>s=>s.assetProcedureTypeAttachmentReducer.instances[t],ad=S(o.createSelector([ci,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),mV=S(o.createSelector([ci,(t,s)=>s],(t,s)=>A(t.filter(({asset_procedure_type:e})=>s===e)))),K=T(({uuid:t})=>t),cd={instances:{}},ri=o.createSlice({name:"assetProcedureTypeFieldsAttachments",initialState:cd,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,cd)),reducers:{initializeAssetProcedureTypeFieldsAttachments:K.initialize,addAssetProcedureTypeFieldsAttachment:K.addOne,addAssetProcedureTypeFieldsAttachments:K.addMany,setAssetProcedureTypeFieldsAttachment:K.setOne,setAssetProcedureTypeFieldsAttachments:K.setMany,updateAssetProcedureTypeFieldsAttachment:K.updateOne,updateAssetProcedureTypeFieldsAttachments:K.updateMany,deleteAssetProcedureTypeFieldsAttachment:K.deleteOne,deleteAssetProcedureTypeFieldsAttachments:K.deleteMany}}),{initializeAssetProcedureTypeFieldsAttachments:rd,addAssetProcedureTypeFieldsAttachment:dd,addAssetProcedureTypeFieldsAttachments:ld,setAssetProcedureTypeFieldsAttachment:ud,setAssetProcedureTypeFieldsAttachments:od,updateAssetProcedureTypeFieldsAttachment:hd,updateAssetProcedureTypeFieldsAttachments:pd,deleteAssetProcedureTypeFieldsAttachment:yd,deleteAssetProcedureTypeFieldsAttachments:md}=ri.actions,Sd=ri.reducer,fd=t=>t.assetProcedureTypeFieldsAttachmentReducer.instances,di=o.createSelector([fd],t=>Object.values(t)),SV=S(o.createSelector([di,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),Ad=t=>s=>s.assetProcedureTypeFieldsAttachmentReducer.instances[t],wd=S(o.createSelector([di,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Y=T(({uuid:t})=>t),Pd={instances:{}},li=o.createSlice({name:"assetProcedureTypeFields",initialState:Pd,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,Pd)),reducers:{initializeAssetProcedureTypeFields:Y.initialize,addAssetProcedureTypeFields:Y.addOne,addAssetProcedureTypeFieldsMany:Y.addMany,setAssetProcedureTypeFields:Y.setOne,setAssetProcedureTypeFieldsMany:Y.setMany,updateAssetProcedureTypeFields:Y.updateOne,updateAssetProcedureTypeFieldsMany:Y.updateMany,deleteAssetProcedureTypeFields:Y.deleteOne,deleteAssetProcedureTypeFieldsMany:Y.deleteMany}}),{initializeAssetProcedureTypeFields:Od,addAssetProcedureTypeFields:Td,addAssetProcedureTypeFieldsMany:Id,setAssetProcedureTypeFields:Fd,setAssetProcedureTypeFieldsMany:_d,updateAssetProcedureTypeFields:gd,updateAssetProcedureTypeFieldsMany:Rd,deleteAssetProcedureTypeFields:bd,deleteAssetProcedureTypeFieldsMany:Md}=li.actions,vd=li.reducer,Ed=t=>t.assetProcedureTypeFieldsReducer.instances,Os=o.createSelector([Ed],t=>Object.values(t)),fV=S(o.createSelector([Os,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),AV=S(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])),kd=t=>s=>s.assetProcedureTypeFieldsReducer.instances[t],Vd=S(o.createSelector([Os,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),J=T(({uuid:t})=>t),Bd={instances:{}},ui=o.createSlice({name:"assetProcedureTypeFieldValuesAttachments",initialState:Bd,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,Bd)),reducers:{initializeAssetProcedureTypeFieldValuesAttachments:J.initialize,addAssetProcedureTypeFieldValuesAttachment:J.addOne,addAssetProcedureTypeFieldValuesAttachments:J.addMany,setAssetProcedureTypeFieldValuesAttachment:J.setOne,setAssetProcedureTypeFieldValuesAttachments:J.setMany,updateAssetProcedureTypeFieldValuesAttachment:J.updateOne,updateAssetProcedureTypeFieldValuesAttachments:J.updateMany,deleteAssetProcedureTypeFieldValuesAttachment:J.deleteOne,deleteAssetProcedureTypeFieldValuesAttachments:J.deleteMany}}),{initializeAssetProcedureTypeFieldValuesAttachments:Dd,addAssetProcedureTypeFieldValuesAttachment:Wd,addAssetProcedureTypeFieldValuesAttachments:oi,setAssetProcedureTypeFieldValuesAttachment:zd,setAssetProcedureTypeFieldValuesAttachments:qd,updateAssetProcedureTypeFieldValuesAttachment:jd,updateAssetProcedureTypeFieldValuesAttachments:$d,deleteAssetProcedureTypeFieldValuesAttachment:Cd,deleteAssetProcedureTypeFieldValuesAttachments:hi}=ui.actions,Ud=ui.reducer,Ld=t=>t.assetProcedureTypeFieldValuesAttachmentReducer.instances,pi=o.createSelector([Ld],t=>Object.values(t)),Nd=t=>s=>s.assetProcedureTypeFieldValuesAttachmentReducer.instances[t],Hd=S(o.createSelector([pi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Gd=S(o.createSelector([pi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Q=T(({uuid:t})=>t),Kd={instances:{}},yi=o.createSlice({name:"assetProcedureTypeFieldValues",initialState:Kd,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,Kd)),reducers:{initializeAssetProcedureTypeFieldValues:Q.initialize,addAssetProcedureTypeFieldValues:Q.addOne,addAssetProcedureTypeFieldValuesMany:Q.addMany,setAssetProcedureTypeFieldValues:Q.setOne,setAssetProcedureTypeFieldValuesMany:Q.setMany,updateAssetProcedureTypeFieldValues:Q.updateOne,updateAssetProcedureTypeFieldValuesMany:Q.updateMany,deleteAssetProcedureTypeFieldValues:Q.deleteOne,deleteAssetProcedureTypeFieldValuesMany:Q.deleteMany}}),{initializeAssetProcedureTypeFieldValues:Yd,addAssetProcedureTypeFieldValues:Jd,addAssetProcedureTypeFieldValuesMany:Qd,setAssetProcedureTypeFieldValues:Zd,setAssetProcedureTypeFieldValuesMany:Xd,updateAssetProcedureTypeFieldValues:xd,updateAssetProcedureTypeFieldValuesMany:el,deleteAssetProcedureTypeFieldValues:tl,deleteAssetProcedureTypeFieldValuesMany:sl}=yi.actions,il=yi.reducer,nl=t=>t.assetProcedureTypeFieldValuesReducer.instances,Ts=o.createSelector([nl],t=>Object.values(t)),wV=S(o.createSelector([Ts,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),PV=S(o.createSelector([Ts,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure===s)))),al=t=>s=>s.assetProcedureTypeFieldValuesReducer.instances[t],cl=S(o.createSelector([Ts,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Z=T(({uuid:t})=>t),rl={instances:{}},mi=o.createSlice({name:"assetProcedures",initialState:rl,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,rl)),reducers:{initializeAssetProcedures:Z.initialize,addAssetProcedure:Z.addOne,addAssetProcedures:Z.addMany,setAssetProcedure:Z.setOne,setAssetProcedures:Z.setMany,updateAssetProcedure:Z.updateOne,updateAssetProcedures:Z.updateMany,deleteAssetProcedure:Z.deleteOne,deleteAssetProcedures:Z.deleteMany}}),{initializeAssetProcedures:dl,addAssetProcedure:ll,addAssetProcedures:Si,updateAssetProcedure:ul,updateAssetProcedures:ol,deleteAssetProcedure:hl,deleteAssetProcedures:fi,setAssetProcedure:pl,setAssetProcedures:yl}=mi.actions,ml=mi.reducer,Sl=t=>t.assetProcedureReducer.instances,Is=o.createSelector([Sl],t=>Object.values(t)),fl=S(o.createSelector([Is,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),OV=S(o.createSelector([Is,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Al=t=>s=>s.assetProcedureReducer.instances[t],wl=S(o.createSelector([Is,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),X=T(t=>t.uuid),Pl={instances:{}},Ai=o.createSlice({name:"assetProcedureTypes",initialState:Pl,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,Pl)),reducers:{initializeAssetProcedureTypes:X.initialize,addAssetProcedureType:X.addOne,addAssetProcedureTypes:X.addMany,setAssetProcedureType:X.setOne,setAssetProcedureTypes:X.setMany,updateAssetProcedureType:X.updateOne,updateAssetProcedureTypes:X.updateMany,deleteAssetProcedureType:X.deleteOne,deleteAssetProcedureTypes:X.deleteMany}}),{initializeAssetProcedureTypes:Ol,addAssetProcedureType:Tl,addAssetProcedureTypes:Il,updateAssetProcedureType:Fl,updateAssetProcedureTypes:_l,deleteAssetProcedureType:gl,deleteAssetProcedureTypes:Rl,setAssetProcedureType:bl,setAssetProcedureTypes:Ml}=Ai.actions,vl=Ai.reducer,El=t=>t.assetProcedureTypeReducer.instances,wi=o.createSelector([El],t=>Object.values(t)),kl=t=>s=>s.assetProcedureTypeReducer.instances[t],Vl=S(o.createSelector([wi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),TV=S(o.createSelector([wi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),x=T(t=>t.uuid),Bl={instances:{}},Pi=o.createSlice({name:"assetProcedureStepFieldsAttachments",initialState:Bl,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,Bl)),reducers:{initializeAssetProcedureStepFieldsAttachments:x.initialize,addAssetProcedureStepFieldsAttachment:x.addOne,addAssetProcedureStepFieldsAttachments:x.addMany,setAssetProcedureStepFieldsAttachment:x.setOne,setAssetProcedureStepFieldsAttachments:x.setMany,updateAssetProcedureStepFieldsAttachment:x.updateOne,updateAssetProcedureStepFieldsAttachments:x.updateMany,deleteAssetProcedureStepFieldsAttachment:x.deleteOne,deleteAssetProcedureStepFieldsAttachments:x.deleteMany}}),{initializeAssetProcedureStepFieldsAttachments:Dl,addAssetProcedureStepFieldsAttachment:Wl,addAssetProcedureStepFieldsAttachments:zl,setAssetProcedureStepFieldsAttachment:ql,setAssetProcedureStepFieldsAttachments:jl,updateAssetProcedureStepFieldsAttachment:$l,updateAssetProcedureStepFieldsAttachments:Cl,deleteAssetProcedureStepFieldsAttachment:Ul,deleteAssetProcedureStepFieldsAttachments:Ll}=Pi.actions,Nl=t=>t.assetProcedureStepFieldsAttachmentReducer.instances,Oi=o.createSelector([Nl],t=>Object.values(t)),IV=S(o.createSelector([Oi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),Hl=t=>s=>s.assetProcedureStepFieldsAttachmentReducer.instances[t],Gl=S(o.createSelector([Oi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Kl=Pi.reducer,ee=T(t=>t.uuid),Yl={instances:{}},Ti=o.createSlice({name:"assetProcedureStepFields",initialState:Yl,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,Yl)),reducers:{initializeAssetProcedureStepFields:ee.initialize,addAssetProcedureStepFields:ee.addOne,addAssetProcedureStepFieldsMany:ee.addMany,setAssetProcedureStepFields:ee.setOne,setAssetProcedureStepFieldsMany:ee.setMany,updateAssetProcedureStepFields:ee.updateOne,updateAssetProcedureStepFieldsMany:ee.updateMany,deleteAssetProcedureStepFields:ee.deleteOne,deleteAssetProcedureStepFieldsMany:ee.deleteMany}}),{initializeAssetProcedureStepFields:Jl,addAssetProcedureStepFields:Ql,addAssetProcedureStepFieldsMany:Zl,setAssetProcedureStepFields:Xl,setAssetProcedureStepFieldsMany:xl,updateAssetProcedureStepFields:eu,updateAssetProcedureStepFieldsMany:tu,deleteAssetProcedureStepFields:su,deleteAssetProcedureStepFieldsMany:iu}=Ti.actions,Ii=t=>t.assetProcedureStepFieldsReducer.instances,Fs=o.createSelector([Ii],t=>Object.values(t)),FV=S(o.createSelector([Fs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_step===s)))),_V=S(o.createSelector([Fs,(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])),gV=o.createSelector([Ii],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}),nu=t=>s=>s.assetProcedureStepFieldsReducer.instances[t],au=S(o.createSelector([Fs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),cu=Ti.reducer,te=T(t=>t.uuid),ru={instances:{}},Fi=o.createSlice({name:"assetProcedureStepFieldValuesAttachments",initialState:ru,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,ru)),reducers:{initializeAssetProcedureStepFieldValuesAttachments:te.initialize,addAssetProcedureStepFieldValuesAttachment:te.addOne,addAssetProcedureStepFieldValuesAttachments:te.addMany,setAssetProcedureStepFieldValuesAttachment:te.setOne,setAssetProcedureStepFieldValuesAttachments:te.setMany,updateAssetProcedureStepFieldValuesAttachment:te.updateOne,updateAssetProcedureStepFieldValuesAttachments:te.updateMany,deleteAssetProcedureStepFieldValuesAttachment:te.deleteOne,deleteAssetProcedureStepFieldValuesAttachments:te.deleteMany}}),{initializeAssetProcedureStepFieldValuesAttachments:du,addAssetProcedureStepFieldValuesAttachment:lu,addAssetProcedureStepFieldValuesAttachments:_i,setAssetProcedureStepFieldValuesAttachment:uu,setAssetProcedureStepFieldValuesAttachments:ou,updateAssetProcedureStepFieldValuesAttachment:hu,updateAssetProcedureStepFieldValuesAttachments:pu,deleteAssetProcedureStepFieldValuesAttachment:yu,deleteAssetProcedureStepFieldValuesAttachments:gi}=Fi.actions,mu=t=>t.assetProcedureStepFieldValuesAttachmentReducer.instances,Ri=o.createSelector([mu],t=>Object.values(t)),Su=t=>s=>s.assetProcedureStepFieldValuesAttachmentReducer.instances[t],fu=S(o.createSelector([Ri,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Au=S(o.createSelector([Ri,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),wu=Fi.reducer,se=T(t=>t.uuid),Pu={instances:{}},bi=o.createSlice({name:"assetProcedureStepFieldValues",initialState:Pu,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,Pu)),reducers:{initializeAssetProcedureStepFieldValues:se.initialize,addAssetProcedureStepFieldValues:se.addOne,addAssetProcedureStepFieldValuesMany:se.addMany,setAssetProcedureStepFieldValues:se.setOne,setAssetProcedureStepFieldValuesMany:se.setMany,updateAssetProcedureStepFieldValues:se.updateOne,updateAssetProcedureStepFieldValuesMany:se.updateMany,deleteAssetProcedureStepFieldValues:se.deleteOne,deleteAssetProcedureStepFieldValuesMany:se.deleteMany}}),{initializeAssetProcedureStepFieldValues:Ou,addAssetProcedureStepFieldValues:Tu,addAssetProcedureStepFieldValuesMany:Iu,setAssetProcedureStepFieldValues:Fu,setAssetProcedureStepFieldValuesMany:_u,updateAssetProcedureStepFieldValues:gu,updateAssetProcedureStepFieldValuesMany:Ru,deleteAssetProcedureStepFieldValues:bu,deleteAssetProcedureStepFieldValuesMany:Mu}=bi.actions,vu=t=>t.assetProcedureStepFieldValuesReducer.instances,ss=o.createSelector([vu],t=>Object.values(t)),RV=S(o.createSelector([ss,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),bV=S(o.createSelector([ss,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure===s)))),MV=S(o.createSelector([ss,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_step===s)))),Eu=t=>s=>s.assetProcedureStepFieldValuesReducer.instances[t],ku=S(o.createSelector([ss,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Vu=bi.reducer,ie=T(t=>t.uuid),Bu={instances:{}},Mi=o.createSlice({name:"assetProcedureSteps",initialState:Bu,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,Bu)),reducers:{initializeAssetProcedureSteps:ie.initialize,setAssetProcedureStep:ie.setOne,setAssetProcedureSteps:ie.setMany,addAssetProcedureStep:ie.addOne,addAssetProcedureSteps:ie.addMany,updateAssetProcedureStep:ie.updateOne,updateAssetProcedureSteps:ie.updateMany,deleteAssetProcedureStep:ie.deleteOne,deleteAssetProcedureSteps:ie.deleteMany}}),{initializeAssetProcedureSteps:Du,setAssetProcedureStep:Wu,setAssetProcedureSteps:zu,addAssetProcedureStep:qu,addAssetProcedureSteps:ju,updateAssetProcedureStep:$u,updateAssetProcedureSteps:Cu,deleteAssetProcedureStep:Uu,deleteAssetProcedureSteps:Lu}=Mi.actions,Nu=Mi.reducer,_s=t=>t.assetProcedureStepReducer.instances,Hu=t=>s=>s.assetProcedureStepReducer.instances[t],vi=o.createSelector([_s],t=>Object.values(t)),vV=S(o.createSelector([_s,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return ts(e)})),EV=S(o.createSelector([vi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),Gu=S(o.createSelector([vi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ku=S(o.createSelector([_s,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=Tr(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),ne=T(t=>t.uuid),Yu={instances:{}},Ei=o.createSlice({name:"assets",initialState:Yu,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,Yu)),reducers:{initializeAssets:ne.initialize,addAsset:ne.addOne,addAssets:ne.addMany,setAsset:ne.setOne,setAssets:ne.setMany,updateAsset:ne.updateOne,updateAssets:ne.updateMany,deleteAsset:ne.deleteOne,deleteAssets:ne.deleteMany}}),{initializeAssets:Ju,addAsset:Qu,addAssets:ki,updateAsset:Zu,updateAssets:Xu,deleteAsset:xu,deleteAssets:Vi,setAsset:eo,setAssets:to}=Ei.actions,so=t=>t.assetReducer.instances,gs=o.createSelector([so],t=>A(Object.values(t))),kV=S(o.createSelector([gs,(t,s)=>s],(t,s)=>A(t.filter(({project:e})=>e===s)))),io=S(o.createSelector([gs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),no=t=>s=>s.assetReducer.instances[t],ao=S(o.createSelector([gs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),co=Ei.reducer,ae=T(t=>t.uuid),ro={instances:{}},Bi=o.createSlice({name:"assetStageCompletions",initialState:ro,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,ro)),reducers:{initializeAssetStageCompletions:ae.initialize,addAssetStageCompletion:ae.addOne,addAssetStageCompletions:ae.addMany,setAssetStageCompletion:ae.setOne,setAssetStageCompletions:ae.setMany,updateAssetStageCompletion:ae.updateOne,updateAssetStageCompletions:ae.updateMany,deleteAssetStageCompletion:ae.deleteOne,deleteAssetStageCompletions:ae.deleteMany}}),{initializeAssetStageCompletions:lo,addAssetStageCompletion:uo,addAssetStageCompletions:oo,setAssetStageCompletion:ho,setAssetStageCompletions:po,updateAssetStageCompletion:yo,updateAssetStageCompletions:mo,deleteAssetStageCompletion:So,deleteAssetStageCompletions:fo}=Bi.actions,Ao=Bi.reducer,wo=t=>t.assetStageCompletionReducer.instances,Po=o.createSelector([wo],t=>Object.values(t)),Oo=t=>s=>s.assetStageCompletionReducer.instances[t],To=S(o.createSelector([Po,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ce=T(t=>t.uuid),Io={instances:{}},Di=o.createSlice({name:"assetStages",initialState:Io,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,Io)),reducers:{initializeAssetStages:ce.initialize,setAssetStage:ce.setOne,setAssetStages:ce.setMany,addAssetStage:ce.addOne,addAssetStages:ce.addMany,updateAssetStage:ce.updateOne,updateAssetStages:ce.updateMany,deleteAssetStage:ce.deleteOne,deleteAssetStages:ce.deleteMany}}),{initializeAssetStages:Fo,setAssetStage:_o,setAssetStages:go,addAssetStage:Ro,addAssetStages:bo,updateAssetStage:Mo,updateAssetStages:vo,deleteAssetStage:Eo,deleteAssetStages:ko}=Di.actions,Vo=Di.reducer,Wi=t=>t.assetStageReducer.instances,Bo=t=>s=>s.assetStageReducer.instances[t],zi=o.createSelector([Wi],t=>Object.values(t)),VV=S(o.createSelector([Wi,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return ts(e)})),BV=S(o.createSelector([zi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),Do=S(o.createSelector([zi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),re=T(t=>t.uuid),Wo={instances:{}},qi=o.createSlice({name:"assetTypeAttachments",initialState:Wo,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,Wo)),reducers:{initializeAssetTypeAttachments:re.initialize,addAssetTypeAttachment:re.addOne,addAssetTypeAttachments:re.addMany,setAssetTypeAttachment:re.setOne,setAssetTypeAttachments:re.setMany,updateAssetTypeAttachment:re.updateOne,updateAssetTypeAttachments:re.updateMany,deleteAssetTypeAttachment:re.deleteOne,deleteAssetTypeAttachments:re.deleteMany}}),{initializeAssetTypeAttachments:zo,addAssetTypeAttachment:qo,addAssetTypeAttachments:ji,setAssetTypeAttachment:jo,setAssetTypeAttachments:$o,updateAssetTypeAttachment:Co,updateAssetTypeAttachments:Uo,deleteAssetTypeAttachment:Lo,deleteAssetTypeAttachments:$i}=qi.actions,No=t=>t.assetTypeAttachmentReducer.instances,Ci=o.createSelector([No],t=>Object.values(t)),Ho=t=>s=>s.assetTypeAttachmentReducer.instances[t],Go=S(o.createSelector([Ci,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ko=S(o.createSelector([Ci,(t,s)=>s],(t,s)=>A(t.filter(({asset_type:e})=>s===e)))),Yo=qi.reducer,de=T(t=>t.uuid),Jo={instances:{}},Ui=o.createSlice({name:"assetTypeFieldsAttachments",initialState:Jo,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,Jo)),reducers:{initializeAssetTypeFieldsAttachments:de.initialize,addAssetTypeFieldsAttachment:de.addOne,addAssetTypeFieldsAttachments:de.addMany,setAssetTypeFieldsAttachment:de.setOne,setAssetTypeFieldsAttachments:de.setMany,updateAssetTypeFieldsAttachment:de.updateOne,updateAssetTypeFieldsAttachments:de.updateMany,deleteAssetTypeFieldsAttachment:de.deleteOne,deleteAssetTypeFieldsAttachments:de.deleteMany}}),{initializeAssetTypeFieldsAttachments:Qo,addAssetTypeFieldsAttachment:Zo,addAssetTypeFieldsAttachments:Xo,setAssetTypeFieldsAttachment:xo,setAssetTypeFieldsAttachments:eh,updateAssetTypeFieldsAttachment:th,updateAssetTypeFieldsAttachments:sh,deleteAssetTypeFieldsAttachment:ih,deleteAssetTypeFieldsAttachments:nh}=Ui.actions,ah=t=>t.assetTypeFieldsAttachmentReducer.instances,Li=o.createSelector([ah],t=>Object.values(t)),DV=S(o.createSelector([Li,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),ch=t=>s=>s.assetTypeFieldsAttachmentReducer.instances[t],rh=S(o.createSelector([Li,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),dh=Ui.reducer,le=T(t=>t.uuid),lh={instances:{}},Ni=o.createSlice({name:"assetTypeFields",initialState:lh,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,lh)),reducers:{initializeAssetTypeFields:le.initialize,addAssetTypeFields:le.addOne,addAssetTypeFieldsMany:le.addMany,setAssetTypeFields:le.setOne,setAssetTypeFieldsMany:le.setMany,updateAssetTypeFields:le.updateOne,updateAssetTypeFieldsMany:le.updateMany,deleteAssetTypeFields:le.deleteOne,deleteAssetTypeFieldsMany:le.deleteMany}}),{initializeAssetTypeFields:uh,addAssetTypeFields:oh,addAssetTypeFieldsMany:hh,setAssetTypeFields:ph,setAssetTypeFieldsMany:yh,updateAssetTypeFields:mh,updateAssetTypeFieldsMany:Sh,deleteAssetTypeFields:fh,deleteAssetTypeFieldsMany:Ah}=Ni.actions,wh=t=>t.assetTypeFieldsReducer.instances,is=o.createSelector([wh],t=>Object.values(t)),WV=S(o.createSelector([is,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),zV=S(o.createSelector([is,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Ph=t=>s=>s.assetTypeFieldsReducer.instances[t],Oh=S(o.createSelector([is,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Th=Ni.reducer,ue=T(t=>t.uuid),Ih={instances:{}},Hi=o.createSlice({name:"assetTypeFieldValuesAttachments",initialState:Ih,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,Ih)),reducers:{initializeAssetTypeFieldValuesAttachments:ue.initialize,addAssetTypeFieldValuesAttachment:ue.addOne,addAssetTypeFieldValuesAttachments:ue.addMany,setAssetTypeFieldValuesAttachment:ue.setOne,setAssetTypeFieldValuesAttachments:ue.setMany,updateAssetTypeFieldValuesAttachment:ue.updateOne,updateAssetTypeFieldValuesAttachments:ue.updateMany,deleteAssetTypeFieldValuesAttachment:ue.deleteOne,deleteAssetTypeFieldValuesAttachments:ue.deleteMany}}),{initializeAssetTypeFieldValuesAttachments:Fh,addAssetTypeFieldValuesAttachment:_h,addAssetTypeFieldValuesAttachments:Gi,setAssetTypeFieldValuesAttachment:gh,setAssetTypeFieldValuesAttachments:Rh,updateAssetTypeFieldValuesAttachment:bh,updateAssetTypeFieldValuesAttachments:Mh,deleteAssetTypeFieldValuesAttachment:vh,deleteAssetTypeFieldValuesAttachments:Ki}=Hi.actions,Eh=t=>t.assetTypeFieldValuesAttachmentReducer.instances,Yi=o.createSelector([Eh],t=>Object.values(t)),kh=t=>s=>s.assetTypeFieldValuesAttachmentReducer.instances[t],Vh=S(o.createSelector([Yi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Bh=S(o.createSelector([Yi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Dh=Hi.reducer,oe=T(t=>t.uuid),Wh={instances:{}},Ji=o.createSlice({name:"assetTypeFieldValues",initialState:Wh,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,Wh)),reducers:{initializeAssetTypeFieldValues:oe.initialize,addAssetTypeFieldValues:oe.addOne,addAssetTypeFieldValuesMany:oe.addMany,setAssetTypeFieldValues:oe.setOne,setAssetTypeFieldValuesMany:oe.setMany,updateAssetTypeFieldValues:oe.updateOne,updateAssetTypeFieldValuesMany:oe.updateMany,deleteAssetTypeFieldValues:oe.deleteOne,deleteAssetTypeFieldValuesMany:oe.deleteMany}}),{initializeAssetTypeFieldValues:zh,addAssetTypeFieldValues:qh,addAssetTypeFieldValuesMany:jh,setAssetTypeFieldValues:$h,setAssetTypeFieldValuesMany:Ch,updateAssetTypeFieldValues:Uh,updateAssetTypeFieldValuesMany:Lh,deleteAssetTypeFieldValues:Nh,deleteAssetTypeFieldValuesMany:Hh}=Ji.actions,Gh=t=>t.assetTypeFieldValuesReducer.instances,Rs=o.createSelector([Gh],t=>Object.values(t)),qV=S(o.createSelector([Rs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),jV=S(o.createSelector([is,Rs,(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)))})),Kh=t=>s=>s.assetTypeFieldValuesReducer.instances[t],Yh=S(o.createSelector([Rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Jh=Ji.reducer,he=T(t=>t.uuid),Qh={instances:{}},Qi=o.createSlice({name:"assetTypeIdentifiers",initialState:Qh,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,Qh)),reducers:{initializeAssetTypeIdentifiers:he.initialize,addAssetTypeIdentifier:he.addOne,addAssetTypeIdentifiers:he.addMany,setAssetTypeIdentifier:he.setOne,setAssetTypeIdentifiers:he.setMany,updateAssetTypeIdentifier:he.updateOne,updateAssetTypeIdentifiers:he.updateMany,deleteAssetTypeIdentifier:he.deleteOne,deleteAssetTypeIdentifiers:he.deleteMany}}),{initializeAssetTypeIdentifiers:Zh,addAssetTypeIdentifier:Xh,addAssetTypeIdentifiers:xh,setAssetTypeIdentifier:ep,setAssetTypeIdentifiers:tp,updateAssetTypeIdentifier:sp,updateAssetTypeIdentifiers:ip,deleteAssetTypeIdentifier:np,deleteAssetTypeIdentifiers:ap}=Qi.actions,cp=t=>t.assetTypeIdentifierReducer.instances,Zi=o.createSelector([cp],t=>Object.values(t)),rp=t=>s=>s.assetTypeIdentifierReducer.instances[t],dp=S(o.createSelector([Zi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),$V=S(o.createSelector([Zi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),lp=Qi.reducer,pe=T(t=>t.uuid),up={instances:{}},Xi=o.createSlice({name:"assetTypeIdentifierValues",initialState:up,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,up)),reducers:{initializeAssetTypeIdentifierValues:pe.initialize,addAssetTypeIdentifierValue:pe.addOne,addAssetTypeIdentifierValues:pe.addMany,setAssetTypeIdentifierValue:pe.setOne,setAssetTypeIdentifierValues:pe.setMany,updateAssetTypeIdentifierValue:pe.updateOne,updateAssetTypeIdentifierValues:pe.updateMany,deleteAssetTypeIdentifierValue:pe.deleteOne,deleteAssetTypeIdentifierValues:pe.deleteMany}}),{initializeAssetTypeIdentifierValues:op,addAssetTypeIdentifierValue:hp,addAssetTypeIdentifierValues:pp,setAssetTypeIdentifierValue:yp,setAssetTypeIdentifierValues:mp,updateAssetTypeIdentifierValue:Sp,updateAssetTypeIdentifierValues:fp,deleteAssetTypeIdentifierValue:Ap,deleteAssetTypeIdentifierValues:wp}=Xi.actions,Pp=t=>t.assetTypeIdentifierValueReducer.instances,bs=o.createSelector([Pp],t=>Object.values(t)),Op=t=>s=>s.assetTypeIdentifierValueReducer.instances[t],Tp=S(o.createSelector([bs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),CV=S(o.createSelector([bs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),UV=S(o.createSelector([bs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type_identifier===s)))),Ip=Xi.reducer,ye=T(t=>t.uuid),Fp={instances:{}},xi=o.createSlice({name:"assetTypes",initialState:Fp,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,Fp)),reducers:{initializeAssetTypes:ye.initialize,setAssetType:ye.setOne,setAssetTypes:ye.setMany,addAssetType:ye.addOne,addAssetTypes:ye.addMany,updateAssetType:ye.updateOne,updateAssetTypes:ye.updateMany,deleteAssetType:ye.deleteOne,deleteAssetTypes:ye.deleteMany}}),{initializeAssetTypes:_p,setAssetType:gp,setAssetTypes:Rp,addAssetType:bp,addAssetTypes:Mp,updateAssetType:vp,updateAssetTypes:Ep,deleteAssetType:kp,deleteAssetTypes:Vp}=xi.actions,Bp=t=>t.assetTypeReducer.instances,en=o.createSelector([Bp],t=>Object.values(t)),Dp=t=>s=>s.assetTypeReducer.instances[t],Wp=S(o.createSelector([en,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),LV=S(o.createSelector([en,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),zp=xi.reducer,me=T(t=>t.uuid),qp={instances:{}},tn=o.createSlice({name:"assetTypeStatuses",initialState:qp,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,qp)),reducers:{initializeAssetTypeStatuses:me.initialize,addAssetTypeStatus:me.addOne,addAssetTypeStatuses:me.addMany,setAssetTypeStatus:me.setOne,setAssetTypeStatuses:me.setMany,updateAssetTypeStatus:me.updateOne,updateAssetTypeStatuses:me.updateMany,deleteAssetTypeStatus:me.deleteOne,deleteAssetTypeStatuses:me.deleteMany}}),{initializeAssetTypeStatuses:jp,addAssetTypeStatus:$p,addAssetTypeStatuses:Cp,setAssetTypeStatus:Up,setAssetTypeStatuses:Lp,updateAssetTypeStatus:Np,updateAssetTypeStatuses:Hp,deleteAssetTypeStatus:Gp,deleteAssetTypeStatuses:Kp}=tn.actions,Yp=t=>t.assetTypeStatusReducer.instances,sn=o.createSelector([Yp],t=>A(Object.values(t).toSorted(Ir))),Jp=t=>s=>s.assetTypeStatusReducer.instances[t],Qp=S(o.createSelector([sn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),NV=S(o.createSelector([sn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Zp=tn.reducer,Xp={accessToken:"",refreshToken:"",isLoggedIn:!1},Ms=o.createSlice({name:"auth",initialState:Xp,extraReducers:t=>t.addCase(P,s=>Object.assign(s,Xp)),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||Ms.caseReducers.clearTokens(t),t.isLoggedIn=s.payload}}}),{setTokens:HV,clearTokens:GV,setLoggedIn:xp}=Ms.actions,KV=t=>t.authReducer.accessToken,YV=t=>t.authReducer.isLoggedIn,ey=Ms.reducer,Se=T(t=>t.uuid),ty={instances:{}},nn=o.createSlice({name:"documentAttachments",initialState:ty,extraReducers:t=>t.addCase(P,s=>Object.assign(s,ty)),reducers:{initializeDocumentAttachments:Se.initialize,addDocumentAttachment:Se.addOne,addDocumentAttachments:Se.addMany,setDocumentAttachment:Se.setOne,setDocumentAttachments:Se.setMany,updateDocumentAttachment:Se.updateOne,updateDocumentAttachments:Se.updateMany,deleteDocumentAttachment:Se.deleteOne,deleteDocumentAttachments:Se.deleteMany}}),{initializeDocumentAttachments:sy,addDocumentAttachment:iy,addDocumentAttachments:ny,setDocumentAttachment:ay,setDocumentAttachments:cy,updateDocumentAttachment:ry,updateDocumentAttachments:dy,deleteDocumentAttachment:ly,deleteDocumentAttachments:uy}=nn.actions,oy=t=>t.documentAttachmentReducer.instances,an=o.createSelector([oy],t=>Object.values(t)),hy=t=>s=>s.documentAttachmentReducer.instances[t],py=S(o.createSelector([an,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),JV=S(o.createSelector([an,(t,s)=>s],(t,s)=>A(t.filter(({document:e})=>s===e)))),yy=nn.reducer,fe=T(({uuid:t})=>t),my={instances:{}},cn=o.createSlice({name:"documents",initialState:my,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>{Object.assign(s,my)}),reducers:{initializeDocuments:fe.initialize,addDocument:fe.addOne,addDocuments:fe.addMany,setDocument:fe.setOne,setDocuments:fe.setMany,updateDocument:fe.updateOne,updateDocuments:fe.updateMany,deleteDocument:fe.deleteOne,deleteDocuments:fe.deleteMany}}),{initializeDocuments:Sy,addDocument:fy,addDocuments:Ay,setDocument:wy,setDocuments:Py,updateDocument:Oy,updateDocuments:Ty,deleteDocument:Iy,deleteDocuments:Fy}=cn.actions,_y=cn.reducer,rn=t=>t.documentsReducer.instances,vs=o.createSelector([rn],t=>Object.values(t)),gy=t=>s=>s.documentsReducer.instances[t],Ry=S(o.createSelector([vs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),QV=S(o.createSelector([vs,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),ZV=S(o.createSelector([vs,(t,s)=>s],(t,s)=>t.filter(e=>e.organization===s))),by=S(o.createSelector([rn,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=gr(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),Ae=T(t=>t.uuid),My={instances:{}},dn=o.createSlice({name:"emailDomains",initialState:My,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,My)),reducers:{initializeEmailDomains:Ae.initialize,addEmailDomain:Ae.addOne,addEmailDomains:Ae.addMany,setEmailDomain:Ae.setOne,setEmailDomains:Ae.setMany,updateEmailDomain:Ae.updateOne,updateEmailDomains:Ae.updateMany,deleteEmailDomain:Ae.deleteOne,deleteEmailDomains:Ae.deleteMany}}),{initializeEmailDomains:vy,addEmailDomain:Ey,addEmailDomains:ky,setEmailDomain:Vy,setEmailDomains:By,updateEmailDomain:Dy,updateEmailDomains:Wy,deleteEmailDomain:zy,deleteEmailDomains:qy}=dn.actions,jy=t=>t.emailDomainsReducer.instances,ln=o.createSelector([jy],t=>Object.values(t)),$y=t=>s=>s.emailDomainsReducer.instances[t],Cy=S(o.createSelector([ln,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),XV=S(o.createSelector([ln,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Uy=dn.reducer,Ly={s3Urls:{}},Ny=1e3*60*60,xV=Ny*24*7,un=o.createSlice({name:"file",initialState:Ly,extraReducers:t=>t.addCase(P,s=>Object.assign(s,Ly)),reducers:{setUploadUrl:(t,s)=>{const{url:e,fields:n,sha1:a}=s.payload,c=new Date,r=new Date(c.getTime()+xV);t.s3Urls[a]={url:e,fields:n,exp:r.getTime()}}}}),{setUploadUrl:eB}=un.actions,tB=t=>s=>{const e=s.fileReducer.s3Urls[t];if(!e)return;const n=new Date().getTime();if(!((e.exp??n)-n<Ny))return e},Hy=un.reducer,we=T(t=>t.uuid),Gy={instances:{}},on=o.createSlice({name:"formIdentifiers",initialState:Gy,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,Gy)),reducers:{initializeFormIdentifiers:we.initialize,addFormIdentifier:we.addOne,addFormIdentifiers:we.addMany,setFormIdentifier:we.setOne,setFormIdentifiers:we.setMany,updateFormIdentifier:we.updateOne,updateFormIdentifiers:we.updateMany,deleteFormIdentifier:we.deleteOne,deleteFormIdentifiers:we.deleteMany}}),{initializeFormIdentifiers:Ky,addFormIdentifier:Yy,addFormIdentifiers:Jy,setFormIdentifier:Qy,setFormIdentifiers:Zy,updateFormIdentifier:Xy,updateFormIdentifiers:xy,deleteFormIdentifier:em,deleteFormIdentifiers:tm}=on.actions,sm=t=>t.formIdentifierReducer.instances,hn=o.createSelector([sm],t=>Object.values(t)),im=t=>s=>s.formIdentifierReducer.instances[t],nm=S(o.createSelector([hn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),sB=S(o.createSelector([hn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form===s)))),am=on.reducer,Pe=T(t=>t.uuid),cm={instances:{}},pn=o.createSlice({name:"formIdentifierValues",initialState:cm,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,cm)),reducers:{initializeFormIdentifierValues:Pe.initialize,addFormIdentifierValue:Pe.addOne,addFormIdentifierValues:Pe.addMany,setFormIdentifierValue:Pe.setOne,setFormIdentifierValues:Pe.setMany,updateFormIdentifierValue:Pe.updateOne,updateFormIdentifierValues:Pe.updateMany,deleteFormIdentifierValue:Pe.deleteOne,deleteFormIdentifierValues:Pe.deleteMany}}),{initializeFormIdentifierValues:rm,addFormIdentifierValue:dm,addFormIdentifierValues:lm,setFormIdentifierValue:um,setFormIdentifierValues:om,updateFormIdentifierValue:hm,updateFormIdentifierValues:pm,deleteFormIdentifierValue:ym,deleteFormIdentifierValues:mm}=pn.actions,Sm=t=>t.formIdentifierValueReducer.instances,Es=o.createSelector([Sm],t=>Object.values(t)),fm=t=>s=>s.formIdentifierValueReducer.instances[t],Am=S(o.createSelector([Es,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),iB=S(o.createSelector([Es,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_submission===s)))),nB=S(o.createSelector([Es,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_identifier===s)))),wm=pn.reducer,Oe=T(t=>t.uuid),Pm={instances:{}},yn=o.createSlice({name:"formRevisionAttachments",initialState:Pm,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,Pm)),reducers:{initializeFormRevisionAttachments:Oe.initialize,addFormRevisionAttachment:Oe.addOne,addFormRevisionAttachments:Oe.addMany,setFormRevisionAttachment:Oe.setOne,setFormRevisionAttachments:Oe.setMany,updateFormRevisionAttachment:Oe.updateOne,updateFormRevisionAttachments:Oe.updateMany,deleteFormRevisionAttachment:Oe.deleteOne,deleteFormRevisionAttachments:Oe.deleteMany}}),{initializeFormRevisionAttachments:Om,addFormRevisionAttachment:Tm,addFormRevisionAttachments:Im,setFormRevisionAttachment:Fm,setFormRevisionAttachments:_m,updateFormRevisionAttachment:gm,updateFormRevisionAttachments:Rm,deleteFormRevisionAttachment:bm,deleteFormRevisionAttachments:Mm}=yn.actions,ks=t=>t.formRevisionAttachmentReducer.instances,vm=o.createSelector([ks],t=>Object.values(t)),Em=S(o.createSelector([ks,(t,s)=>s],(t,s)=>t[s])),km=S(o.createSelector([vm,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),aB=S(o.createSelector([ks,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.form_revision===s)))),Vm=yn.reducer,Te=T(t=>t.uuid),Bm={instances:{}},mn=o.createSlice({name:"formRevisions",initialState:Bm,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,Bm)),reducers:{initializeFormRevisions:Te.initialize,addFormRevision:Te.addOne,addFormRevisions:Te.addMany,setFormRevision:Te.setOne,setFormRevisions:Te.setMany,updateFormRevision:Te.updateOne,updateFormRevisions:Te.updateMany,deleteFormRevision:Te.deleteOne,deleteFormRevisions:Te.deleteMany}}),{initializeFormRevisions:Dm,addFormRevision:Wm,addFormRevisions:Sn,setFormRevision:zm,setFormRevisions:qm,updateFormRevision:jm,updateFormRevisions:$m,deleteFormRevision:Cm,deleteFormRevisions:fn}=mn.actions,Um=t=>t.formRevisionReducer.instances,Vs=o.createSelector([Um],t=>Object.values(t)),Lm=t=>s=>s.formRevisionReducer.instances[t],Nm=S(o.createSelector([Vs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),cB=S(o.createSelector([Vs,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Hm=S(o.createSelector([Vs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form===s)))),Gm=mn.reducer,Ie=T(t=>t.uuid),Km={instances:{}},An=o.createSlice({name:"forms",initialState:Km,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,Km)),reducers:{initializeForms:Ie.initialize,addForm:Ie.addOne,addForms:Ie.addMany,setForm:Ie.setOne,setForms:Ie.setMany,updateForm:Ie.updateOne,updateForms:Ie.updateMany,deleteForm:Ie.deleteOne,deleteForms:Ie.deleteMany}}),{initializeForms:Ym,addForm:Jm,addForms:Qm,setForm:Zm,setForms:Xm,updateForm:xm,updateForms:eS,deleteForm:tS,deleteForms:sS}=An.actions,iS=An.reducer,nS=t=>t.formReducer.instances,wn=o.createSelector([nS],t=>Object.values(t)),aS=t=>s=>s.formReducer.instances[t],cS=S(o.createSelector([wn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),rB=S(o.createSelector([wn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Fe=T(t=>t.uuid),rS={instances:{}},Pn=o.createSlice({name:"formSubmissionAttachments",initialState:rS,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,rS)),reducers:{initializeFormSubmissionAttachments:Fe.initialize,addFormSubmissionAttachment:Fe.addOne,addFormSubmissionAttachments:Fe.addMany,setFormSubmissionAttachment:Fe.setOne,setFormSubmissionAttachments:Fe.setMany,updateFormSubmissionAttachment:Fe.updateOne,updateFormSubmissionAttachments:Fe.updateMany,deleteFormSubmissionAttachment:Fe.deleteOne,deleteFormSubmissionAttachments:Fe.deleteMany}}),{initializeFormSubmissionAttachments:dS,addFormSubmissionAttachment:lS,addFormSubmissionAttachments:On,setFormSubmissionAttachment:uS,setFormSubmissionAttachments:oS,updateFormSubmissionAttachment:hS,updateFormSubmissionAttachments:pS,deleteFormSubmissionAttachment:yS,deleteFormSubmissionAttachments:Tn}=Pn.actions,In=t=>t.formSubmissionAttachmentReducer.instances,Fn=o.createSelector([In],t=>Object.values(t)),mS=S(o.createSelector([In,(t,s)=>s],(t,s)=>t[s])),_n=S(o.createSelector([Fn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(n=>e.has(n.uuid)))})),SS=_n,fS=S(o.createSelector([Fn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_submission===s)))),AS=Pn.reducer,_e=T(t=>t.uuid),wS={instances:{}},gn=o.createSlice({name:"formSubmissions",initialState:wS,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,wS)),reducers:{initializeFormSubmissions:_e.initialize,setFormSubmission:_e.setOne,setFormSubmissions:_e.setMany,addFormSubmission:_e.addOne,addFormSubmissions:_e.addMany,updateFormSubmission:_e.updateOne,updateFormSubmissions:_e.updateMany,deleteFormSubmission:_e.deleteOne,deleteFormSubmissions:_e.deleteMany}}),{initializeFormSubmissions:PS,setFormSubmission:OS,setFormSubmissions:TS,addFormSubmission:IS,addFormSubmissions:Rn,updateFormSubmission:FS,updateFormSubmissions:_S,deleteFormSubmission:gS,deleteFormSubmissions:bn}=gn.actions,RS=t=>t.formSubmissionReducer.instances,Mn=o.createSelector([RS],t=>Object.values(t)),bS=t=>s=>s.formSubmissionReducer.instances[t],MS=S(o.createSelector([Mn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),vS=S(o.createSelector([Mn,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s))),ES=gn.reducer,ge=T(t=>t.uuid),kS={instances:{}},vn=o.createSlice({name:"geoImages",initialState:kS,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,kS)),reducers:{initializeGeoImages:ge.initialize,setGeoImage:ge.setOne,setGeoImages:ge.setMany,addGeoImage:ge.addOne,addGeoImages:ge.addMany,updateGeoImage:ge.updateOne,updateGeoImages:ge.updateMany,deleteGeoImage:ge.deleteOne,deleteGeoImages:ge.deleteMany}}),{initializeGeoImages:VS,setGeoImage:BS,setGeoImages:DS,addGeoImage:WS,addGeoImages:zS,updateGeoImage:qS,updateGeoImages:jS,deleteGeoImage:$S,deleteGeoImages:CS}=vn.actions,US=t=>t.geoImageReducer.instances,En=o.createSelector([US],t=>Object.values(t)),LS=t=>s=>s.geoImageReducer.instances[t],NS=S(o.createSelector([En,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),dB=S(o.createSelector([En,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),HS=vn.reducer,Re=T(t=>t.uuid),GS={instances:{}},kn=o.createSlice({name:"issueAssociations",initialState:GS,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,GS)),reducers:{initializeIssueAssociations:Re.initialize,addIssueAssociation:Re.addOne,addIssueAssociations:Re.addMany,setIssueAssociation:Re.setOne,setIssueAssociations:Re.setMany,updateIssueAssociation:Re.updateOne,updateIssueAssociations:Re.updateMany,deleteIssueAssociation:Re.deleteOne,deleteIssueAssociations:Re.deleteMany}}),{initializeIssueAssociations:KS,setIssueAssociations:YS,setIssueAssociation:JS,updateIssueAssociation:QS,updateIssueAssociations:ZS,addIssueAssociation:XS,addIssueAssociations:zt,deleteIssueAssociation:xS,deleteIssueAssociations:qt}=kn.actions,ef=t=>t.issueAssociationReducer.instances,jt=o.createSelector([ef],t=>Object.values(t)),tf=t=>s=>s.issueAssociationReducer.instances[t],sf=S(o.createSelector([jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),nf=S(o.createSelector([jt,(t,s)=>s],(t,s)=>A(t.filter(({associated_issue:e})=>e===s)))),af=S(o.createSelector([jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({associated_issue:n})=>e.has(n)))})),cf=S(o.createSelector([jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({issue:n})=>n&&e.has(n)))})),rf=S(o.createSelector([jt,(t,s)=>s],(t,s)=>A(t.filter(({issue:e})=>e===s)))),df=S(o.createSelector([jt,(t,s)=>s],(t,s)=>A(t.filter(({asset:e})=>e===s)))),lf=kn.reducer,be=T(t=>t.uuid),uf={instances:{}},Vn=o.createSlice({name:"issueAttachments",initialState:uf,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,uf)),reducers:{initializeIssueAttachments:be.initialize,addIssueAttachment:be.addOne,addIssueAttachments:be.addMany,setIssueAttachment:be.setOne,setIssueAttachments:be.setMany,updateIssueAttachment:be.updateOne,updateIssueAttachments:be.updateMany,deleteIssueAttachment:be.deleteOne,deleteIssueAttachments:be.deleteMany}}),{initializeIssueAttachments:of,addIssueAttachment:hf,addIssueAttachments:Bn,setIssueAttachment:pf,setIssueAttachments:yf,updateIssueAttachment:mf,updateIssueAttachments:Sf,deleteIssueAttachment:ff,deleteIssueAttachments:Dn}=Vn.actions,Af=t=>t.issueAttachmentReducer.instances,Wn=o.createSelector([Af],t=>Object.values(t)),wf=S(o.createSelector([Wn,(t,s)=>s],(t,s)=>A(t.filter(({issue:e})=>s===e)))),Pf=t=>s=>s.issueAttachmentReducer.instances[t],Of=S(o.createSelector([Wn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Tf=Vn.reducer,Me=T(t=>t.uuid),If={instances:{}},zn=o.createSlice({name:"issueCommentAttachments",initialState:If,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,If)),reducers:{initializeIssueCommentAttachments:Me.initialize,addIssueCommentAttachment:Me.addOne,addIssueCommentAttachments:Me.addMany,setIssueCommentAttachment:Me.setOne,setIssueCommentAttachments:Me.setMany,updateIssueCommentAttachment:Me.updateOne,updateIssueCommentAttachments:Me.updateMany,deleteIssueCommentAttachment:Me.deleteOne,deleteIssueCommentAttachments:Me.deleteMany}}),{initializeIssueCommentAttachments:Ff,addIssueCommentAttachment:_f,addIssueCommentAttachments:gf,setIssueCommentAttachment:Rf,setIssueCommentAttachments:bf,updateIssueCommentAttachment:Mf,updateIssueCommentAttachments:vf,deleteIssueCommentAttachment:Ef,deleteIssueCommentAttachments:kf}=zn.actions,Vf=t=>t.issueCommentAttachmentReducer.instances,qn=o.createSelector([Vf],t=>Object.values(t)),Bf=t=>s=>s.issueCommentAttachmentReducer.instances[t],Df=S(o.createSelector([qn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),lB=S(o.createSelector([qn,(t,s)=>s],(t,s)=>A(t.filter(({issue_comment:e})=>s===e)))),Wf=zn.reducer,ve=T(t=>t.uuid),zf={instances:{}},jn=o.createSlice({name:"issueComments",initialState:zf,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,zf)),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:qf,addIssueComment:jf,addIssueComments:$f,setIssueComment:Cf,setIssueComments:Uf,updateIssueComment:Lf,updateIssueComments:Nf,deleteIssueComment:Hf,deleteIssueComments:Gf}=jn.actions,$n=t=>t.issueCommentReducer.instances,Kf=t=>s=>s.issueCommentReducer.instances[t],Yf=S(o.createSelector([$n,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(Object.values(t).filter(({uuid:n})=>e.has(n)))})),uB=S(o.createSelector([$n,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.issue===s)))),Jf=jn.reducer,Ee=T(t=>t.uuid),Qf={instances:{}},Cn=o.createSlice({name:"issues",initialState:Qf,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,Qf)),reducers:{initializeIssues:Ee.initialize,addIssue:Ee.addOne,addIssues:Ee.addMany,setIssue:Ee.setOne,setIssues:Ee.setMany,updateIssue:Ee.updateOne,updateIssues:Ee.updateMany,deleteIssue:Ee.deleteOne,deleteIssues:Ee.deleteMany}}),{initializeIssues:Zf,addIssue:Xf,addIssues:Un,setIssue:xf,setIssues:eA,updateIssue:tA,updateIssues:sA,deleteIssue:iA,deleteIssues:Ln}=Cn.actions,nA=t=>t.issueReducer.instances,Bs=o.createSelector([nA],t=>Object.values(t)),aA=t=>s=>s.issueReducer.instances[t],cA=S(o.createSelector([Bs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),oB=S(o.createSelector([Bs,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),rA=S(o.createSelector([Bs,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s))),dA=Cn.reducer,ke=T(t=>t.uuid),lA={instances:{}},Nn=o.createSlice({name:"issueTypeAttachments",initialState:lA,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,lA)),reducers:{initializeIssueTypeAttachments:ke.initialize,addIssueTypeAttachment:ke.addOne,addIssueTypeAttachments:ke.addMany,setIssueTypeAttachment:ke.setOne,setIssueTypeAttachments:ke.setMany,updateIssueTypeAttachment:ke.updateOne,updateIssueTypeAttachments:ke.updateMany,deleteIssueTypeAttachment:ke.deleteOne,deleteIssueTypeAttachments:ke.deleteMany}}),{initializeIssueTypeAttachments:uA,addIssueTypeAttachment:oA,addIssueTypeAttachments:hA,setIssueTypeAttachment:pA,setIssueTypeAttachments:yA,updateIssueTypeAttachment:mA,updateIssueTypeAttachments:SA,deleteIssueTypeAttachment:fA,deleteIssueTypeAttachments:AA}=Nn.actions,wA=t=>t.issueTypeAttachmentReducer.instances,Hn=o.createSelector([wA],t=>Object.values(t)),PA=t=>s=>s.issueTypeAttachmentReducer.instances[t],OA=S(o.createSelector([Hn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),hB=S(o.createSelector([Hn,(t,s)=>s],(t,s)=>A(t.filter(({issue_type:e})=>s===e)))),TA=Nn.reducer,Ve=T(t=>t.uuid),IA={instances:{}},Gn=o.createSlice({name:"issueTypeFieldsAttachments",initialState:IA,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,IA)),reducers:{initializeIssueTypeFieldsAttachments:Ve.initialize,addIssueTypeFieldsAttachment:Ve.addOne,addIssueTypeFieldsAttachments:Ve.addMany,setIssueTypeFieldsAttachment:Ve.setOne,setIssueTypeFieldsAttachments:Ve.setMany,updateIssueTypeFieldsAttachment:Ve.updateOne,updateIssueTypeFieldsAttachments:Ve.updateMany,deleteIssueTypeFieldsAttachment:Ve.deleteOne,deleteIssueTypeFieldsAttachments:Ve.deleteMany}}),{initializeIssueTypeFieldsAttachments:FA,addIssueTypeFieldsAttachment:_A,addIssueTypeFieldsAttachments:gA,setIssueTypeFieldsAttachment:RA,setIssueTypeFieldsAttachments:bA,updateIssueTypeFieldsAttachment:MA,updateIssueTypeFieldsAttachments:vA,deleteIssueTypeFieldsAttachment:EA,deleteIssueTypeFieldsAttachments:kA}=Gn.actions,VA=t=>t.issueTypeFieldsAttachmentReducer.instances,Kn=o.createSelector([VA],t=>Object.values(t)),pB=S(o.createSelector([Kn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),BA=t=>s=>s.issueTypeFieldsAttachmentReducer.instances[t],DA=S(o.createSelector([Kn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),WA=Gn.reducer,Be=T(t=>t.uuid),zA={instances:{}},Yn=o.createSlice({name:"issueTypeFieldValues",initialState:zA,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,zA)),reducers:{initializeIssueTypeFieldValues:Be.initialize,addIssueTypeFieldValues:Be.addOne,addIssueTypeFieldValuesMany:Be.addMany,setIssueTypeFieldValues:Be.setOne,setIssueTypeFieldValuesMany:Be.setMany,updateIssueTypeFieldValues:Be.updateOne,updateIssueTypeFieldValuesMany:Be.updateMany,deleteIssueTypeFieldValues:Be.deleteOne,deleteIssueTypeFieldValuesMany:Be.deleteMany}}),{initializeIssueTypeFieldValues:qA,addIssueTypeFieldValues:jA,addIssueTypeFieldValuesMany:$A,setIssueTypeFieldValues:CA,setIssueTypeFieldValuesMany:UA,updateIssueTypeFieldValues:LA,updateIssueTypeFieldValuesMany:NA,deleteIssueTypeFieldValues:HA,deleteIssueTypeFieldValuesMany:GA}=Yn.actions,KA=t=>t.issueTypeFieldValuesReducer.instances,Ds=o.createSelector([KA],t=>Object.values(t)),yB=S(o.createSelector([Ds,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),YA=t=>s=>s.issueTypeFieldValuesReducer.instances[t],JA=S(o.createSelector([Ds,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),QA=Yn.reducer,De=T(t=>t.uuid),ZA={instances:{}},Jn=o.createSlice({name:"issueTypeFields",initialState:ZA,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,ZA)),reducers:{initializeIssueTypeFields:De.initialize,addIssueTypeFields:De.addOne,addIssueTypeFieldsMany:De.addMany,setIssueTypeFields:De.setOne,setIssueTypeFieldsMany:De.setMany,updateIssueTypeFields:De.updateOne,updateIssueTypeFieldsMany:De.updateMany,deleteIssueTypeFields:De.deleteOne,deleteIssueTypeFieldsMany:De.deleteMany}}),{initializeIssueTypeFields:XA,addIssueTypeFields:xA,addIssueTypeFieldsMany:ew,setIssueTypeFields:tw,setIssueTypeFieldsMany:sw,updateIssueTypeFields:iw,updateIssueTypeFieldsMany:nw,deleteIssueTypeFields:aw,deleteIssueTypeFieldsMany:cw}=Jn.actions,rw=t=>t.issueTypeFieldsReducer.instances,ns=o.createSelector([rw],t=>Object.values(t)),mB=S(o.createSelector([ns,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),SB=S(o.createSelector([ns,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),fB=S(o.createSelector([ns,Ds,(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)))})),dw=t=>s=>s.issueTypeFieldsReducer.instances[t],lw=S(o.createSelector([ns,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),uw=Jn.reducer,We=T(t=>t.uuid),ow={instances:{}},Qn=o.createSlice({name:"issueTypeFieldValuesAttachments",initialState:ow,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,ow)),reducers:{initializeIssueTypeFieldValuesAttachments:We.initialize,addIssueTypeFieldValuesAttachment:We.addOne,addIssueTypeFieldValuesAttachments:We.addMany,setIssueTypeFieldValuesAttachment:We.setOne,setIssueTypeFieldValuesAttachments:We.setMany,updateIssueTypeFieldValuesAttachment:We.updateOne,updateIssueTypeFieldValuesAttachments:We.updateMany,deleteIssueTypeFieldValuesAttachment:We.deleteOne,deleteIssueTypeFieldValuesAttachments:We.deleteMany}}),{initializeIssueTypeFieldValuesAttachments:hw,addIssueTypeFieldValuesAttachment:pw,addIssueTypeFieldValuesAttachments:Zn,setIssueTypeFieldValuesAttachment:yw,setIssueTypeFieldValuesAttachments:mw,updateIssueTypeFieldValuesAttachment:Sw,updateIssueTypeFieldValuesAttachments:fw,deleteIssueTypeFieldValuesAttachment:Aw,deleteIssueTypeFieldValuesAttachments:Xn}=Qn.actions,ww=t=>t.issueTypeFieldValuesAttachmentReducer.instances,xn=o.createSelector([ww],t=>Object.values(t)),Pw=t=>s=>s.issueTypeFieldValuesAttachmentReducer.instances[t],Ow=S(o.createSelector([xn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Tw=S(o.createSelector([xn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Iw=Qn.reducer,ze=T(t=>t.uuid),Fw={instances:{}},ea=o.createSlice({name:"issueTypeIdentifiers",initialState:Fw,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,Fw)),reducers:{initializeIssueTypeIdentifiers:ze.initialize,addIssueTypeIdentifier:ze.addOne,addIssueTypeIdentifiers:ze.addMany,setIssueTypeIdentifier:ze.setOne,setIssueTypeIdentifiers:ze.setMany,updateIssueTypeIdentifier:ze.updateOne,updateIssueTypeIdentifiers:ze.updateMany,deleteIssueTypeIdentifier:ze.deleteOne,deleteIssueTypeIdentifiers:ze.deleteMany}}),{initializeIssueTypeIdentifiers:_w,addIssueTypeIdentifier:gw,addIssueTypeIdentifiers:Rw,setIssueTypeIdentifier:bw,setIssueTypeIdentifiers:Mw,updateIssueTypeIdentifier:vw,updateIssueTypeIdentifiers:Ew,deleteIssueTypeIdentifier:kw,deleteIssueTypeIdentifiers:Vw}=ea.actions,Bw=t=>t.issueTypeIdentifierReducer.instances,ta=o.createSelector([Bw],t=>Object.values(t)),Dw=t=>s=>s.issueTypeIdentifierReducer.instances[t],Ww=S(o.createSelector([ta,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),AB=S(o.createSelector([ta,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),zw=ea.reducer,qe=T(t=>t.uuid),qw={instances:{}},sa=o.createSlice({name:"issueTypeIdentifierValues",initialState:qw,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,qw)),reducers:{initializeIssueTypeIdentifierValues:qe.initialize,addIssueTypeIdentifierValue:qe.addOne,addIssueTypeIdentifierValues:qe.addMany,setIssueTypeIdentifierValue:qe.setOne,setIssueTypeIdentifierValues:qe.setMany,updateIssueTypeIdentifierValue:qe.updateOne,updateIssueTypeIdentifierValues:qe.updateMany,deleteIssueTypeIdentifierValue:qe.deleteOne,deleteIssueTypeIdentifierValues:qe.deleteMany}}),{initializeIssueTypeIdentifierValues:jw,addIssueTypeIdentifierValue:$w,addIssueTypeIdentifierValues:Cw,setIssueTypeIdentifierValue:Uw,setIssueTypeIdentifierValues:Lw,updateIssueTypeIdentifierValue:Nw,updateIssueTypeIdentifierValues:Hw,deleteIssueTypeIdentifierValue:Gw,deleteIssueTypeIdentifierValues:Kw}=sa.actions,Yw=t=>t.issueTypeIdentifierValueReducer.instances,Ws=o.createSelector([Yw],t=>Object.values(t)),Jw=t=>s=>s.issueTypeIdentifierValueReducer.instances[t],Qw=S(o.createSelector([Ws,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),wB=S(o.createSelector([Ws,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),PB=S(o.createSelector([Ws,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type_identifier===s)))),Zw=sa.reducer,je=T(t=>t.uuid),Xw={instances:{}},ia=o.createSlice({name:"issueTypes",initialState:Xw,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,Xw)),reducers:{initializeIssueTypes:je.initialize,addIssueType:je.addOne,addIssueTypes:je.addMany,setIssueType:je.setOne,setIssueTypes:je.setMany,updateIssueType:je.updateOne,updateIssueTypes:je.updateMany,deleteIssueType:je.deleteOne,deleteIssueTypes:je.deleteMany}}),{initializeIssueTypes:xw,addIssueType:eP,addIssueTypes:tP,setIssueType:sP,setIssueTypes:iP,updateIssueType:nP,updateIssueTypes:aP,deleteIssueType:cP,deleteIssueTypes:rP}=ia.actions,dP=t=>t.issueTypeReducer.instances,na=o.createSelector(dP,t=>Object.values(t)),lP=t=>s=>s.issueTypeReducer.instances[t],uP=S(o.createSelector([na,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),OB=S(o.createSelector([na,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),oP=ia.reducer,$e=T(t=>t.uuid),hP={instances:{}},aa=o.createSlice({name:"issueTypeStatuses",initialState:hP,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,hP)),reducers:{initializeIssueTypeStatuses:$e.initialize,addIssueTypeStatus:$e.addOne,addIssueTypeStatuses:$e.addMany,setIssueTypeStatus:$e.setOne,setIssueTypeStatuses:$e.setMany,updateIssueTypeStatus:$e.updateOne,updateIssueTypeStatuses:$e.updateMany,deleteIssueTypeStatus:$e.deleteOne,deleteIssueTypeStatuses:$e.deleteMany}}),{initializeIssueTypeStatuses:pP,addIssueTypeStatus:yP,addIssueTypeStatuses:mP,setIssueTypeStatus:SP,setIssueTypeStatuses:fP,updateIssueTypeStatus:AP,updateIssueTypeStatuses:wP,deleteIssueTypeStatus:PP,deleteIssueTypeStatuses:OP}=aa.actions,TP=t=>t.issueTypeStatusReducer.instances,ca=o.createSelector([TP],t=>A(Object.values(t).toSorted(Fr))),ra=t=>s=>s.issueTypeStatusReducer.instances[t],IP=S(o.createSelector([ca,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),TB=S(o.createSelector([ca,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),FP=aa.reducer,Ce=T(t=>t.uuid),_P={instances:{}},da=o.createSlice({name:"issueUpdates",initialState:_P,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,_P)),reducers:{initializeIssueUpdates:Ce.initialize,addIssueUpdate:Ce.addOne,addIssueUpdates:Ce.addMany,setIssueUpdate:Ce.setOne,setIssueUpdates:Ce.setMany,updateIssueUpdate:Ce.updateOne,updateIssueUpdates:Ce.updateMany,deleteIssueUpdate:Ce.deleteOne,deleteIssueUpdates:Ce.deleteMany}}),{initializeIssueUpdates:gP,addIssueUpdate:la,addIssueUpdates:ua,setIssueUpdate:RP,setIssueUpdates:bP,updateIssueUpdate:MP,updateIssueUpdates:vP,deleteIssueUpdate:oa,deleteIssueUpdates:ha}=da.actions,pa=t=>t.issueUpdateReducer.instances,ya=o.createSelector([pa],t=>Object.values(t)),EP=S(o.createSelector([pa,(t,s)=>s],(t,s)=>t[s])),kP=S(o.createSelector([ya,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),VP=S(o.createSelector([ya,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),BP=da.reducer,Ue=T(t=>t.id),DP={instances:{},currentUser:null},ma=o.createSlice({name:"users",initialState:DP,extraReducers:t=>t.addCase(P,s=>Object.assign(s,DP)).addCase(I,s=>Object.assign(s,{...s,instances:[]})),reducers:{initializeUsers:Ue.initialize,setUsers:Ue.setMany,setUser:Ue.setOne,addUsers:Ue.addMany,addUser:Ue.addOne,updateUsers:Ue.updateMany,updateUser:Ue.updateOne,deleteUser:Ue.deleteOne,deleteUsers:Ue.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:WP,setUsers:zP,setUser:qP,addUsers:jP,addUser:Sa,updateUsers:$P,updateUser:CP,deleteUser:fa,deleteUsers:UP,setCurrentUser:IB,setCurrentUserProfile:FB}=ma.actions,LP=ma.reducer,NP=t=>t.userReducer.currentUser,Aa=t=>t.userReducer.instances,zs=o.createSelector([Aa],t=>Object.values(t)),qs=t=>s=>s.userReducer.instances[t],HP=S(o.createSelector([zs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({id:n})=>e.has(n)))})),Le=T(t=>t.uuid),GP={instances:{}},wa=o.createSlice({name:"organizationAccess",initialState:GP,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,GP)),reducers:{initializeOrganizationAccesses:Le.initialize,addOrganizationAccess:Le.addOne,addOrganizationAccesses:Le.addMany,setOrganizationAccess:Le.setOne,setOrganizationAccesses:Le.setMany,updateOrganizationAccess:Le.updateOne,updateOrganizationAccesses:Le.updateMany,deleteOrganizationAccess:Le.deleteOne,deleteOrganizationAccesses:Le.deleteMany}}),{initializeOrganizationAccesses:KP,addOrganizationAccess:YP,addOrganizationAccesses:JP,setOrganizationAccess:QP,setOrganizationAccesses:ZP,updateOrganizationAccess:XP,updateOrganizationAccesses:xP,deleteOrganizationAccess:eO,deleteOrganizationAccesses:tO}=wa.actions,sO=wa.reducer,js=t=>t.organizationAccessReducer.instances,iO=t=>s=>s.organizationAccessReducer.instances[t],nO=S(o.createSelector([js,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(Object.values(t).filter(({uuid:n})=>e.has(n)))})),_B=o.createSelector([NP,js],(t,s)=>Object.values(s).find(n=>n.user===(t==null?void 0:t.id))??null),aO=o.createSelector([js],t=>{const s={};for(const e of Object.values(t))s[e.user]=e;return ts(s)}),gB=S(o.createSelector([Aa,aO,(t,s)=>s],(t,s,e)=>A(Object.values(t).filter(n=>{const a=s[n.id];return!!a&&a.organization===e})))),Ne=T(t=>t.uuid),cO={instances:{}},Pa=o.createSlice({name:"organizations",initialState:cO,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,cO)),reducers:{initializeOrganizations:Ne.initialize,setOrganizations:Ne.setMany,setOrganization:Ne.setOne,addOrganizations:Ne.addMany,addOrganization:Ne.addOne,updateOrganizations:Ne.updateMany,updateOrganization:Ne.updateOne,deleteOrganization:Ne.deleteOne,deleteOrganizations:Ne.deleteMany}}),{initializeOrganizations:rO,setOrganizations:dO,setOrganization:lO,addOrganizations:uO,addOrganization:oO,updateOrganizations:hO,updateOrganization:pO,deleteOrganization:yO,deleteOrganizations:mO}=Pa.actions,SO=t=>t.organizationReducer.instances,fO=o.createSelector([SO],t=>Object.values(t)),AO=t=>s=>s.organizationReducer.instances[t],wO=S(o.createSelector([fO,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),PO=Pa.reducer,OO=(t,s,e)=>{const n=t.uuid?t:{...t,uuid:Vt.v4()};return{payload:n,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:n,BASE_URL:s,serviceName:e}}}}},TO={deletedRequests:[],latestRetryTime:0},Oa=o.createSlice({name:"outbox",initialState:TO,extraReducers:t=>t.addCase(P,s=>Object.assign(s,TO)),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 OO(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}}}),RB=t=>t.outboxReducer.deletedRequests,bB=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:IO,markForDeletion:MB,markAsDeleted:FO,_setLatestRetryTime:_O}=Oa.actions,gO=Oa.reducer,He=T(t=>t.uuid),RO={instances:{}},Ta=o.createSlice({name:"projectAccess",initialState:RO,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,RO)),reducers:{initializeProjectAccesses:He.initialize,addProjectAccess:He.addOne,addProjectAccesses:He.addMany,setProjectAccess:He.setOne,setProjectAccesses:He.setMany,updateProjectAccess:He.updateOne,updateProjectAccesses:He.updateMany,deleteProjectAccess:He.deleteOne,deleteProjectAccesses:He.deleteMany}}),{initializeProjectAccesses:bO,addProjectAccess:MO,addProjectAccesses:vO,setProjectAccess:EO,setProjectAccesses:kO,updateProjectAccess:VO,updateProjectAccesses:BO,deleteProjectAccess:DO,deleteProjectAccesses:WO}=Ta.actions,zO=Ta.reducer,Ia=t=>t.projectAccessReducer.instances,as=o.createSelector(Ia,t=>Object.values(t)),qO=t=>s=>s.projectAccessReducer.instances[t],jO=S(o.createSelector([as,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),vB=S(o.createSelector([Ia,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.project===s)))),EB=S(o.createSelector([as,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.project===s))e[n.user]=n;return e})),kB=S(o.createSelector([zs,as,(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)))})),Ge=T(t=>t.uuid),$O={instances:{}},Fa=o.createSlice({name:"projectAttachments",initialState:$O,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,$O)),reducers:{initializeProjectAttachments:Ge.initialize,addProjectAttachment:Ge.addOne,addProjectAttachments:Ge.addMany,setProjectAttachment:Ge.setOne,setProjectAttachments:Ge.setMany,updateProjectAttachment:Ge.updateOne,updateProjectAttachments:Ge.updateMany,deleteProjectAttachment:Ge.deleteOne,deleteProjectAttachments:Ge.deleteMany}}),{initializeProjectAttachments:CO,addProjectAttachment:UO,addProjectAttachments:LO,setProjectAttachment:NO,setProjectAttachments:HO,updateProjectAttachment:GO,updateProjectAttachments:KO,deleteProjectAttachment:YO,deleteProjectAttachments:JO}=Fa.actions,QO=t=>t.projectAttachmentReducer.instances,_a=o.createSelector([QO],t=>Object.values(t)),ZO=t=>s=>s.projectAttachmentReducer.instances[t],XO=S(o.createSelector([_a,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),VB=S(o.createSelector([_a,(t,s)=>s],(t,s)=>A(t.filter(({project:e})=>s===e)))),xO=Fa.reducer,Ke=T(t=>t.uuid),eT={instances:{}},ga=o.createSlice({name:"projectFiles",initialState:eT,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,eT)),reducers:{initializeProjectFiles:Ke.initialize,setProjectFile:Ke.setOne,setProjectFiles:Ke.setMany,addProjectFile:Ke.addOne,addProjectFiles:Ke.addMany,updateProjectFile:Ke.updateOne,updateProjectFiles:Ke.updateMany,deleteProjectFile:Ke.deleteOne,deleteProjectFiles:Ke.deleteMany}}),{initializeProjectFiles:tT,setProjectFile:sT,setProjectFiles:iT,addProjectFile:nT,addProjectFiles:aT,updateProjectFile:cT,updateProjectFiles:rT,deleteProjectFile:dT,deleteProjectFiles:lT}=ga.actions,uT=t=>t.projectFileReducer.instances,oT=o.createSelector([uT],t=>A(Object.values(t).sort((s,e)=>s.z_index-e.z_index))),hT=t=>s=>s.projectFileReducer.instances[t],pT=S(o.createSelector([oT,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yT=ga.reducer,Ye=T(t=>t.uuid),mT={instances:{}},Ra=o.createSlice({name:"projects",initialState:mT,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,mT)),reducers:{initializeProjects:Ye.initialize,setProjects:Ye.setMany,setProject:Ye.setOne,addProjects:Ye.addMany,addProject:Ye.addOne,updateProjects:Ye.updateMany,updateProject:Ye.updateOne,deleteProject:Ye.deleteOne,deleteProjects:Ye.deleteMany}}),{initializeProjects:ST,setProjects:fT,setProject:AT,addProjects:wT,addProject:PT,updateProjects:OT,updateProject:TT,deleteProject:IT,deleteProjects:FT}=Ra.actions,_T=Ra.reducer,gT=t=>t.projectReducer.instances,$s=o.createSelector([gT],t=>Object.values(t)),RT=t=>s=>s.projectReducer.instances[t],bT=S(o.createSelector([$s,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),BB=S(o.createSelector([$s,as,(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)))})),DB=S(o.createSelector([$s,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Je=T(({uuid:t})=>t),MT={instances:{}},ba=o.createSlice({name:"procedures",initialState:MT,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,MT)),reducers:{initializeProcedures:Je.initialize,addProcedure:Je.addOne,addProcedures:Je.addMany,setProcedure:Je.setOne,setProcedures:Je.setMany,updateProcedure:Je.updateOne,updateProcedures:Je.updateMany,deleteProcedure:Je.deleteOne,deleteProcedures:Je.deleteMany}}),{initializeProcedures:vT,addProcedure:ET,addProcedures:Ma,setProcedure:kT,setProcedures:VT,updateProcedure:BT,updateProcedures:DT,deleteProcedure:WT,deleteProcedures:va}=ba.actions,zT=ba.reducer,qT=t=>t.procedureReducer.instances,Nt=o.createSelector([qT],t=>Object.values(t)),jT=t=>s=>s.procedureReducer.instances[t],$T=S(o.createSelector([Nt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),WB=S(o.createSelector([Nt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),CT=S(o.createSelector([Nt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_type===s)))),zB=S(o.createSelector([Nt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),qB=S(o.createSelector([Nt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),Qe=T(t=>t.uuid),UT={instances:{}},Ea=o.createSlice({name:"procedureStepAssignees",initialState:UT,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,UT)),reducers:{initializeProcedureStepAssignees:Qe.initialize,addProcedureStepAssignee:Qe.addOne,addProcedureStepAssignees:Qe.addMany,setProcedureStepAssignee:Qe.setOne,setProcedureStepAssignees:Qe.setMany,updateProcedureStepAssignee:Qe.updateOne,updateProcedureStepAssignees:Qe.updateMany,deleteProcedureStepAssignee:Qe.deleteOne,deleteProcedureStepAssignees:Qe.deleteMany}}),{initializeProcedureStepAssignees:LT,addProcedureStepAssignee:NT,addProcedureStepAssignees:HT,setProcedureStepAssignee:GT,setProcedureStepAssignees:KT,updateProcedureStepAssignee:YT,updateProcedureStepAssignees:JT,deleteProcedureStepAssignee:QT,deleteProcedureStepAssignees:ZT}=Ea.actions,XT=t=>t.procedureStepAssigneeReducer.instances,cs=o.createSelector([XT],t=>Object.values(t)),xT=t=>s=>s.procedureStepAssigneeReducer.instances[t],eI=S(o.createSelector([cs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),jB=S(o.createSelector([cs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),$B=S(o.createSelector([cs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),CB=S(o.createSelector([cs,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({procedure:n,procedure_step:a})=>n===s&&a===e)))),tI=Ea.reducer,Ze=T(t=>t.uuid),sI={instances:{}},ka=o.createSlice({name:"procedureStepComments",initialState:sI,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,sI)),reducers:{initializeProcedureStepComments:Ze.initialize,addProcedureStepComment:Ze.addOne,addProcedureStepComments:Ze.addMany,setProcedureStepComment:Ze.setOne,setProcedureStepComments:Ze.setMany,updateProcedureStepComment:Ze.updateOne,updateProcedureStepComments:Ze.updateMany,deleteProcedureStepComment:Ze.deleteOne,deleteProcedureStepComments:Ze.deleteMany}}),{initializeProcedureStepComments:iI,addProcedureStepComment:nI,addProcedureStepComments:aI,setProcedureStepComment:cI,setProcedureStepComments:rI,updateProcedureStepComment:dI,updateProcedureStepComments:lI,deleteProcedureStepComment:uI,deleteProcedureStepComments:oI}=ka.actions,hI=t=>t.procedureStepCommentReducer.instances,rs=o.createSelector([hI],t=>Object.values(t)),pI=t=>s=>s.procedureStepCommentReducer.instances[t],yI=S(o.createSelector([rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),UB=S(o.createSelector([rs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),LB=S(o.createSelector([rs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),NB=S(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)))),mI=ka.reducer,Xe=T(t=>t.uuid),SI={instances:{}},Va=o.createSlice({name:"procedureStepDefaultAssignees",initialState:SI,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,SI)),reducers:{initializeProcedureStepDefaultAssignees:Xe.initialize,addProcedureStepDefaultAssignee:Xe.addOne,addProcedureStepDefaultAssignees:Xe.addMany,setProcedureStepDefaultAssignee:Xe.setOne,setProcedureStepDefaultAssignees:Xe.setMany,updateProcedureStepDefaultAssignee:Xe.updateOne,updateProcedureStepDefaultAssignees:Xe.updateMany,deleteProcedureStepDefaultAssignee:Xe.deleteOne,deleteProcedureStepDefaultAssignees:Xe.deleteMany}}),{initializeProcedureStepDefaultAssignees:fI,addProcedureStepDefaultAssignee:AI,addProcedureStepDefaultAssignees:wI,setProcedureStepDefaultAssignee:PI,setProcedureStepDefaultAssignees:OI,updateProcedureStepDefaultAssignee:TI,updateProcedureStepDefaultAssignees:II,deleteProcedureStepDefaultAssignee:FI,deleteProcedureStepDefaultAssignees:_I}=Va.actions,gI=t=>t.procedureStepDefaultAssigneeReducer.instances,Ba=o.createSelector([gI],t=>Object.values(t)),RI=t=>s=>s.procedureStepDefaultAssigneeReducer.instances[t],bI=S(o.createSelector([Ba,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),HB=S(o.createSelector([Ba,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),MI=Va.reducer,xe=T(t=>t.uuid),vI={instances:{}},Da=o.createSlice({name:"procedureStepDefaultReviewers",initialState:vI,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,vI)),reducers:{initializeProcedureStepDefaultReviewers:xe.initialize,addProcedureStepDefaultReviewer:xe.addOne,addProcedureStepDefaultReviewers:xe.addMany,setProcedureStepDefaultReviewer:xe.setOne,setProcedureStepDefaultReviewers:xe.setMany,updateProcedureStepDefaultReviewer:xe.updateOne,updateProcedureStepDefaultReviewers:xe.updateMany,deleteProcedureStepDefaultReviewer:xe.deleteOne,deleteProcedureStepDefaultReviewers:xe.deleteMany}}),{initializeProcedureStepDefaultReviewers:EI,addProcedureStepDefaultReviewer:kI,addProcedureStepDefaultReviewers:VI,setProcedureStepDefaultReviewer:BI,setProcedureStepDefaultReviewers:DI,updateProcedureStepDefaultReviewer:WI,updateProcedureStepDefaultReviewers:zI,deleteProcedureStepDefaultReviewer:qI,deleteProcedureStepDefaultReviewers:jI}=Da.actions,$I=t=>t.procedureStepDefaultReviewerReducer.instances,Wa=o.createSelector([$I],t=>Object.values(t)),CI=t=>s=>s.procedureStepDefaultReviewerReducer.instances[t],UI=S(o.createSelector([Wa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),GB=S(o.createSelector([Wa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),LI=Da.reducer,et=T(t=>t.uuid),NI={instances:{}},za=o.createSlice({name:"procedureStepEvents",initialState:NI,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,NI)),reducers:{initializeProcedureStepEvents:et.initialize,addProcedureStepEvent:et.addOne,addProcedureStepEvents:et.addMany,setProcedureStepEvent:et.setOne,setProcedureStepEvents:et.setMany,updateProcedureStepEvent:et.updateOne,updateProcedureStepEvents:et.updateMany,deleteProcedureStepEvent:et.deleteOne,deleteProcedureStepEvents:et.deleteMany}}),{initializeProcedureStepEvents:HI,addProcedureStepEvent:GI,addProcedureStepEvents:KI,setProcedureStepEvent:YI,setProcedureStepEvents:JI,updateProcedureStepEvent:QI,updateProcedureStepEvents:ZI,deleteProcedureStepEvent:XI,deleteProcedureStepEvents:xI}=za.actions,eF=t=>t.procedureStepEventReducer.instances,ds=o.createSelector([eF],t=>Object.values(t)),tF=t=>s=>s.procedureStepEventReducer.instances[t],sF=S(o.createSelector([ds,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),KB=S(o.createSelector([ds,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),YB=S(o.createSelector([ds,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),JB=S(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)))),iF=za.reducer,tt=T(t=>t.uuid),nF={instances:{}},qa=o.createSlice({name:"procedureStepFieldsAttachments",initialState:nF,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,nF)),reducers:{initializeProcedureStepFieldsAttachments:tt.initialize,addProcedureStepFieldsAttachment:tt.addOne,addProcedureStepFieldsAttachments:tt.addMany,setProcedureStepFieldsAttachment:tt.setOne,setProcedureStepFieldsAttachments:tt.setMany,updateProcedureStepFieldsAttachment:tt.updateOne,updateProcedureStepFieldsAttachments:tt.updateMany,deleteProcedureStepFieldsAttachment:tt.deleteOne,deleteProcedureStepFieldsAttachments:tt.deleteMany}}),{initializeProcedureStepFieldsAttachments:aF,addProcedureStepFieldsAttachment:cF,addProcedureStepFieldsAttachments:ja,setProcedureStepFieldsAttachment:rF,setProcedureStepFieldsAttachments:dF,updateProcedureStepFieldsAttachment:lF,updateProcedureStepFieldsAttachments:uF,deleteProcedureStepFieldsAttachment:oF,deleteProcedureStepFieldsAttachments:$a}=qa.actions,hF=t=>t.procedureStepFieldsAttachmentReducer.instances,Ca=o.createSelector([hF],t=>Object.values(t)),pF=S(o.createSelector([Ca,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),yF=t=>s=>s.procedureStepFieldsAttachmentReducer.instances[t],mF=S(o.createSelector([Ca,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),SF=qa.reducer,st=T(t=>t.uuid),fF={instances:{}},Ua=o.createSlice({name:"procedureStepFields",initialState:fF,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,fF)),reducers:{initializeProcedureStepFields:st.initialize,addProcedureStepFields:st.addOne,addProcedureStepFieldsMany:st.addMany,setProcedureStepFields:st.setOne,setProcedureStepFieldsMany:st.setMany,updateProcedureStepFields:st.updateOne,updateProcedureStepFieldsMany:st.updateMany,deleteProcedureStepFields:st.deleteOne,deleteProcedureStepFieldsMany:st.deleteMany}}),{initializeProcedureStepFields:AF,addProcedureStepFields:wF,addProcedureStepFieldsMany:PF,setProcedureStepFields:OF,setProcedureStepFieldsMany:TF,updateProcedureStepFields:IF,updateProcedureStepFieldsMany:FF,deleteProcedureStepFields:_F,deleteProcedureStepFieldsMany:gF}=Ua.actions,La=t=>t.procedureStepFieldsReducer.instances,Cs=o.createSelector([La],t=>Object.values(t)),QB=S(o.createSelector([Cs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),ZB=S(o.createSelector([Cs,(t,s)=>s],(t,s)=>t.filter(e=>e.procedure_step===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),XB=o.createSelector([La],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}),RF=t=>s=>s.procedureStepFieldsReducer.instances[t],bF=S(o.createSelector([Cs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),MF=Ua.reducer,it=T(t=>t.uuid),vF={instances:{}},Na=o.createSlice({name:"procedureStepFieldValuesAttachments",initialState:vF,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,vF)),reducers:{initializeProcedureStepFieldValuesAttachments:it.initialize,addProcedureStepFieldValuesAttachment:it.addOne,addProcedureStepFieldValuesAttachments:it.addMany,setProcedureStepFieldValuesAttachment:it.setOne,setProcedureStepFieldValuesAttachments:it.setMany,updateProcedureStepFieldValuesAttachment:it.updateOne,updateProcedureStepFieldValuesAttachments:it.updateMany,deleteProcedureStepFieldValuesAttachment:it.deleteOne,deleteProcedureStepFieldValuesAttachments:it.deleteMany}}),{initializeProcedureStepFieldValuesAttachments:EF,addProcedureStepFieldValuesAttachment:kF,addProcedureStepFieldValuesAttachments:Ha,setProcedureStepFieldValuesAttachment:VF,setProcedureStepFieldValuesAttachments:BF,updateProcedureStepFieldValuesAttachment:DF,updateProcedureStepFieldValuesAttachments:WF,deleteProcedureStepFieldValuesAttachment:zF,deleteProcedureStepFieldValuesAttachments:Ga}=Na.actions,qF=t=>t.procedureStepFieldValuesAttachmentReducer.instances,Ka=o.createSelector([qF],t=>Object.values(t)),jF=t=>s=>s.procedureStepFieldValuesAttachmentReducer.instances[t],$F=S(o.createSelector([Ka,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),CF=S(o.createSelector([Ka,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),UF=Na.reducer,nt=T(t=>t.uuid),LF={instances:{}},Ya=o.createSlice({name:"procedureStepFieldValues",initialState:LF,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,LF)),reducers:{initializeProcedureStepFieldValues:nt.initialize,addProcedureStepFieldValues:nt.addOne,addProcedureStepFieldValuesMany:nt.addMany,setProcedureStepFieldValues:nt.setOne,setProcedureStepFieldValuesMany:nt.setMany,updateProcedureStepFieldValues:nt.updateOne,updateProcedureStepFieldValuesMany:nt.updateMany,deleteProcedureStepFieldValues:nt.deleteOne,deleteProcedureStepFieldValuesMany:nt.deleteMany}}),{initializeProcedureStepFieldValues:NF,addProcedureStepFieldValues:HF,addProcedureStepFieldValuesMany:GF,setProcedureStepFieldValues:KF,setProcedureStepFieldValuesMany:YF,updateProcedureStepFieldValues:JF,updateProcedureStepFieldValuesMany:QF,deleteProcedureStepFieldValues:ZF,deleteProcedureStepFieldValuesMany:XF}=Ya.actions,xF=Ya.reducer,e_=t=>t.procedureStepFieldValuesReducer.instances,Ht=o.createSelector([e_],t=>Object.values(t)),xB=S(o.createSelector([Ht,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),eD=S(o.createSelector([Ht,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),t_=t=>s=>s.procedureStepFieldValuesReducer.instances[t],s_=S(o.createSelector([Ht,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),tD=S(o.createSelector([Ht,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({procedure:n,procedure_step:a})=>n===s&&a===e)))),at=T(t=>t.uuid),i_={instances:{}},Ja=o.createSlice({name:"procedureStepFieldValuesReviews",initialState:i_,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,i_)),reducers:{initializeProcedureStepFieldValuesReviews:at.initialize,addProcedureStepFieldValuesReview:at.addOne,addProcedureStepFieldValuesReviews:at.addMany,setProcedureStepFieldValuesReview:at.setOne,setProcedureStepFieldValuesReviews:at.setMany,updateProcedureStepFieldValuesReview:at.updateOne,updateProcedureStepFieldValuesReviews:at.updateMany,deleteProcedureStepFieldValuesReview:at.deleteOne,deleteProcedureStepFieldValuesReviews:at.deleteMany}}),{initializeProcedureStepFieldValuesReviews:n_,addProcedureStepFieldValuesReview:a_,addProcedureStepFieldValuesReviews:Qa,setProcedureStepFieldValuesReview:c_,setProcedureStepFieldValuesReviews:r_,updateProcedureStepFieldValuesReview:d_,updateProcedureStepFieldValuesReviews:l_,deleteProcedureStepFieldValuesReview:u_,deleteProcedureStepFieldValuesReviews:Za}=Ja.actions,o_=t=>t.procedureStepFieldValuesReviewReducer.instances,Gt=o.createSelector([o_],t=>Object.values(t)),h_=t=>s=>s.procedureStepFieldValuesReviewReducer.instances[t],p_=S(o.createSelector([Gt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),y_=S(o.createSelector([Gt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),sD=S(o.createSelector([Gt,(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})),iD=S(o.createSelector([Ht,Gt,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(v(t.filter(({procedure_step:c,procedure:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),nD=o.createSelector([Gt],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}),m_=Ja.reducer,ct=T(t=>t.uuid),S_={instances:{}},Xa=o.createSlice({name:"procedureStepReviewers",initialState:S_,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,S_)),reducers:{initializeProcedureStepReviewers:ct.initialize,addProcedureStepReviewer:ct.addOne,addProcedureStepReviewers:ct.addMany,setProcedureStepReviewer:ct.setOne,setProcedureStepReviewers:ct.setMany,updateProcedureStepReviewer:ct.updateOne,updateProcedureStepReviewers:ct.updateMany,deleteProcedureStepReviewer:ct.deleteOne,deleteProcedureStepReviewers:ct.deleteMany}}),{initializeProcedureStepReviewers:f_,addProcedureStepReviewer:A_,addProcedureStepReviewers:w_,setProcedureStepReviewer:P_,setProcedureStepReviewers:O_,updateProcedureStepReviewer:T_,updateProcedureStepReviewers:I_,deleteProcedureStepReviewer:F_,deleteProcedureStepReviewers:__}=Xa.actions,g_=t=>t.procedureStepReviewerReducer.instances,ls=o.createSelector([g_],t=>Object.values(t)),R_=t=>s=>s.procedureStepReviewerReducer.instances[t],b_=S(o.createSelector([ls,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),aD=S(o.createSelector([ls,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),cD=S(o.createSelector([ls,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_step===s)))),rD=S(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)))),M_=Xa.reducer,rt=T(t=>t.uuid),v_={instances:{}},xa=o.createSlice({name:"procedureSteps",initialState:v_,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,v_)),reducers:{initializeProcedureSteps:rt.initialize,setProcedureStep:rt.setOne,setProcedureSteps:rt.setMany,addProcedureStep:rt.addOne,addProcedureSteps:rt.addMany,updateProcedureStep:rt.updateOne,updateProcedureSteps:rt.updateMany,deleteProcedureStep:rt.deleteOne,deleteProcedureSteps:rt.deleteMany}}),{initializeProcedureSteps:E_,setProcedureStep:k_,setProcedureSteps:V_,addProcedureStep:B_,addProcedureSteps:D_,updateProcedureStep:W_,updateProcedureSteps:z_,deleteProcedureStep:q_,deleteProcedureSteps:j_}=xa.actions,$_=xa.reducer,ec=t=>t.procedureStepReducer.instances,C_=t=>s=>s.procedureStepReducer.instances[t],tc=o.createSelector([ec],t=>Object.values(t)),dD=S(o.createSelector([ec,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.procedure_type===s&&(e[n]=a);return ts(e)})),lD=S(o.createSelector([tc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_type===s)))),U_=S(o.createSelector([tc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),dt=T(({uuid:t})=>t),L_={instances:{}},sc=o.createSlice({name:"procedureTypeAttachments",initialState:L_,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,L_)),reducers:{initializeProcedureTypeAttachments:dt.initialize,addProcedureTypeAttachment:dt.addOne,addProcedureTypeAttachments:dt.addMany,setProcedureTypeAttachment:dt.setOne,setProcedureTypeAttachments:dt.setMany,updateProcedureTypeAttachment:dt.updateOne,updateProcedureTypeAttachments:dt.updateMany,deleteProcedureTypeAttachment:dt.deleteOne,deleteProcedureTypeAttachments:dt.deleteMany}}),{initializeProcedureTypeAttachments:N_,addProcedureTypeAttachment:H_,addProcedureTypeAttachments:G_,setProcedureTypeAttachment:K_,setProcedureTypeAttachments:Y_,updateProcedureTypeAttachment:J_,updateProcedureTypeAttachments:Q_,deleteProcedureTypeAttachment:Z_,deleteProcedureTypeAttachments:X_}=sc.actions,x_=sc.reducer,eg=t=>t.procedureTypeAttachmentReducer.instances,ic=o.createSelector([eg],t=>Object.values(t)),tg=t=>s=>s.procedureTypeAttachmentReducer.instances[t],sg=S(o.createSelector([ic,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),uD=S(o.createSelector([ic,(t,s)=>s],(t,s)=>A(t.filter(({procedure_type:e})=>s===e)))),lt=T(({uuid:t})=>t),ig={instances:{}},nc=o.createSlice({name:"procedureTypeFieldsAttachments",initialState:ig,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,ig)),reducers:{initializeProcedureTypeFieldsAttachments:lt.initialize,addProcedureTypeFieldsAttachment:lt.addOne,addProcedureTypeFieldsAttachments:lt.addMany,setProcedureTypeFieldsAttachment:lt.setOne,setProcedureTypeFieldsAttachments:lt.setMany,updateProcedureTypeFieldsAttachment:lt.updateOne,updateProcedureTypeFieldsAttachments:lt.updateMany,deleteProcedureTypeFieldsAttachment:lt.deleteOne,deleteProcedureTypeFieldsAttachments:lt.deleteMany}}),{initializeProcedureTypeFieldsAttachments:ng,addProcedureTypeFieldsAttachment:ag,addProcedureTypeFieldsAttachments:cg,setProcedureTypeFieldsAttachment:rg,setProcedureTypeFieldsAttachments:dg,updateProcedureTypeFieldsAttachment:lg,updateProcedureTypeFieldsAttachments:ug,deleteProcedureTypeFieldsAttachment:og,deleteProcedureTypeFieldsAttachments:hg}=nc.actions,pg=nc.reducer,yg=t=>t.procedureTypeFieldsAttachmentReducer.instances,ac=o.createSelector([yg],t=>Object.values(t)),oD=S(o.createSelector([ac,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),mg=t=>s=>s.procedureTypeFieldsAttachmentReducer.instances[t],Sg=S(o.createSelector([ac,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ut=T(({uuid:t})=>t),fg={instances:{}},cc=o.createSlice({name:"procedureTypeFields",initialState:fg,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,fg)),reducers:{initializeProcedureTypeFields:ut.initialize,addProcedureTypeFields:ut.addOne,addProcedureTypeFieldsMany:ut.addMany,setProcedureTypeFields:ut.setOne,setProcedureTypeFieldsMany:ut.setMany,updateProcedureTypeFields:ut.updateOne,updateProcedureTypeFieldsMany:ut.updateMany,deleteProcedureTypeFields:ut.deleteOne,deleteProcedureTypeFieldsMany:ut.deleteMany}}),{initializeProcedureTypeFields:Ag,addProcedureTypeFields:wg,addProcedureTypeFieldsMany:Pg,setProcedureTypeFields:Og,setProcedureTypeFieldsMany:Tg,updateProcedureTypeFields:Ig,updateProcedureTypeFieldsMany:Fg,deleteProcedureTypeFields:_g,deleteProcedureTypeFieldsMany:gg}=cc.actions,Rg=cc.reducer,bg=t=>t.procedureTypeFieldsReducer.instances,Us=o.createSelector([bg],t=>Object.values(t)),hD=S(o.createSelector([Us,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure_type===s)))),pD=S(o.createSelector([Us,(t,s)=>s],(t,s)=>t.filter(e=>e.procedure_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Mg=t=>s=>s.procedureTypeFieldsReducer.instances[t],vg=S(o.createSelector([Us,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ot=T(({uuid:t})=>t),Eg={instances:{}},rc=o.createSlice({name:"procedureFieldValuesAttachments",initialState:Eg,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,Eg)),reducers:{initializeProcedureFieldValuesAttachments:ot.initialize,addProcedureFieldValuesAttachment:ot.addOne,addProcedureFieldValuesAttachments:ot.addMany,setProcedureFieldValuesAttachment:ot.setOne,setProcedureFieldValuesAttachments:ot.setMany,updateProcedureFieldValuesAttachment:ot.updateOne,updateProcedureFieldValuesAttachments:ot.updateMany,deleteProcedureFieldValuesAttachment:ot.deleteOne,deleteProcedureFieldValuesAttachments:ot.deleteMany}}),{initializeProcedureFieldValuesAttachments:kg,addProcedureFieldValuesAttachment:Vg,addProcedureFieldValuesAttachments:dc,setProcedureFieldValuesAttachment:Bg,setProcedureFieldValuesAttachments:Dg,updateProcedureFieldValuesAttachment:Wg,updateProcedureFieldValuesAttachments:zg,deleteProcedureFieldValuesAttachment:qg,deleteProcedureFieldValuesAttachments:lc}=rc.actions,jg=rc.reducer,$g=t=>t.procedureFieldValuesAttachmentReducer.instances,uc=o.createSelector([$g],t=>Object.values(t)),Cg=t=>s=>s.procedureFieldValuesAttachmentReducer.instances[t],Ug=S(o.createSelector([uc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Lg=S(o.createSelector([uc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),ht=T(({uuid:t})=>t),Ng={instances:{}},oc=o.createSlice({name:"procedureFieldValues",initialState:Ng,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,Ng)),reducers:{initializeProcedureFieldValues:ht.initialize,addProcedureFieldValues:ht.addOne,addProcedureFieldValuesMany:ht.addMany,setProcedureFieldValues:ht.setOne,setProcedureFieldValuesMany:ht.setMany,updateProcedureFieldValues:ht.updateOne,updateProcedureFieldValuesMany:ht.updateMany,deleteProcedureFieldValues:ht.deleteOne,deleteProcedureFieldValuesMany:ht.deleteMany}}),{initializeProcedureFieldValues:Hg,addProcedureFieldValues:Gg,addProcedureFieldValuesMany:Kg,setProcedureFieldValues:Yg,setProcedureFieldValuesMany:Jg,updateProcedureFieldValues:Qg,updateProcedureFieldValuesMany:Zg,deleteProcedureFieldValues:Xg,deleteProcedureFieldValuesMany:xg}=oc.actions,eR=oc.reducer,tR=t=>t.procedureFieldValuesReducer.instances,hc=o.createSelector([tR],t=>Object.values(t)),yD=S(o.createSelector([hc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.procedure===s)))),sR=t=>s=>s.procedureFieldValuesReducer.instances[t],iR=S(o.createSelector([hc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),pt=T(t=>t.uuid),nR={instances:{}},pc=o.createSlice({name:"procedureTypes",initialState:nR,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,nR)),reducers:{initializeProcedureTypes:pt.initialize,addProcedureType:pt.addOne,addProcedureTypes:pt.addMany,setProcedureType:pt.setOne,setProcedureTypes:pt.setMany,updateProcedureType:pt.updateOne,updateProcedureTypes:pt.updateMany,deleteProcedureType:pt.deleteOne,deleteProcedureTypes:pt.deleteMany}}),{initializeProcedureTypes:aR,addProcedureType:cR,addProcedureTypes:rR,setProcedureType:dR,setProcedureTypes:lR,updateProcedureType:uR,updateProcedureTypes:oR,deleteProcedureType:hR,deleteProcedureTypes:pR}=pc.actions,yR=pc.reducer,mR=t=>t.procedureTypeReducer.instances,yc=o.createSelector([mR],t=>Object.values(t)),SR=t=>s=>s.procedureTypeReducer.instances[t],fR=S(o.createSelector([yc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),mD=S(o.createSelector([yc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),SD={isRehydrated:!1},mc=o.createSlice({name:"rehydrated",initialState:SD,reducers:{setRehydrated:(t,s)=>{t.isRehydrated=s.payload}}}),{setRehydrated:fD}=mc.actions,AD=t=>t.rehydratedReducer.isRehydrated,AR=mc.reducer,yt=T(t=>t.uuid),wR={instances:{}},Sc=o.createSlice({name:"teamMemberships",initialState:wR,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,wR)),reducers:{initializeTeamMemberships:yt.initialize,addTeamMembership:yt.addOne,addTeamMemberships:yt.addMany,setTeamMembership:yt.setOne,setTeamMemberships:yt.setMany,updateTeamMembership:yt.updateOne,updateTeamMemberships:yt.updateMany,deleteTeamMembership:yt.deleteOne,deleteTeamMemberships:yt.deleteMany}}),{initializeTeamMemberships:PR,addTeamMembership:OR,addTeamMemberships:TR,setTeamMembership:IR,setTeamMemberships:FR,updateTeamMembership:_R,updateTeamMemberships:gR,deleteTeamMembership:RR,deleteTeamMemberships:bR}=Sc.actions,MR=Sc.reducer,vR=t=>t.teamMembershipReducer.instances,Ls=o.createSelector([vR],t=>Object.values(t)),ER=t=>s=>s.teamMembershipReducer.instances[t],kR=S(o.createSelector([Ls,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),wD=S(o.createSelector([Ls,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.team===s))e[n.user]=n;return e})),PD=S(o.createSelector([zs,Ls,(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)))})),mt=T(t=>t.uuid),VR={instances:{}},fc=o.createSlice({name:"teams",initialState:VR,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,VR)),reducers:{initializeTeams:mt.initialize,addTeam:mt.addOne,addTeams:mt.addMany,setTeam:mt.setOne,setTeams:mt.setMany,updateTeam:mt.updateOne,updateTeams:mt.updateMany,deleteTeam:mt.deleteOne,deleteTeams:mt.deleteMany}}),{initializeTeams:BR,addTeam:DR,addTeams:WR,setTeam:zR,setTeams:qR,updateTeam:jR,updateTeams:$R,deleteTeam:CR,deleteTeams:UR}=fc.actions,LR=t=>t.teamReducer.instances,Ac=o.createSelector([LR],t=>Object.values(t)),NR=t=>s=>s.teamReducer.instances[t],HR=S(o.createSelector([Ac,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),OD=S(o.createSelector([Ac,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),GR=fc.reducer,TD={version:0},KR=o.createSlice({name:"versioning",initialState:TD,reducers:{}}),YR=KR.reducer,St=T(t=>t.uuid),JR={instances:{}},wc=o.createSlice({name:"workflows",initialState:JR,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,JR)),reducers:{initializeWorkflows:St.initialize,addWorkflow:St.addOne,addWorkflows:St.addMany,setWorkflow:St.setOne,setWorkflows:St.setMany,updateWorkflow:St.updateOne,updateWorkflows:St.updateMany,deleteWorkflow:St.deleteOne,deleteWorkflows:St.deleteMany}}),{initializeWorkflows:QR,addWorkflow:ZR,addWorkflows:XR,setWorkflow:xR,setWorkflows:eb,updateWorkflow:tb,updateWorkflows:sb,deleteWorkflow:ib,deleteWorkflows:nb}=wc.actions,ab=t=>t.workflowReducer.instances,Ns=o.createSelector([ab],t=>Object.values(t)),cb=t=>s=>s.workflowReducer.instances[t],rb=S(o.createSelector([Ns,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ID=S(o.createSelector([Ns,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),FD=S(o.createSelector([Ns,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_type===s)))),db=wc.reducer,ft=T(t=>t.uuid),lb={instances:{}},Pc=o.createSlice({name:"workflowIssueLinks",initialState:lb,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,lb)),reducers:{initializeWorkflowIssueLinks:ft.initialize,addWorkflowIssueLink:ft.addOne,addWorkflowIssueLinks:ft.addMany,setWorkflowIssueLink:ft.setOne,setWorkflowIssueLinks:ft.setMany,updateWorkflowIssueLink:ft.updateOne,updateWorkflowIssueLinks:ft.updateMany,deleteWorkflowIssueLink:ft.deleteOne,deleteWorkflowIssueLinks:ft.deleteMany}}),{initializeWorkflowIssueLinks:ub,addWorkflowIssueLink:ob,addWorkflowIssueLinks:us,setWorkflowIssueLink:hb,setWorkflowIssueLinks:pb,updateWorkflowIssueLink:yb,updateWorkflowIssueLinks:mb,deleteWorkflowIssueLink:Sb,deleteWorkflowIssueLinks:os}=Pc.actions,fb=t=>t.workflowIssueLinkReducer.instances,Kt=o.createSelector([fb],t=>Object.values(t)),Ab=t=>s=>s.workflowIssueLinkReducer.instances[t],wb=S(o.createSelector([Kt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Pb=S(o.createSelector([Kt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),Ob=S(o.createSelector([Kt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({workflow:n})=>e.has(n)))})),Tb=S(o.createSelector([Kt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),_D=S(o.createSelector([Kt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({issue:n})=>e.has(n)))})),Ib=Pc.reducer,At=T(t=>t.uuid),Fb={instances:{}},Oc=o.createSlice({name:"workflowStepAssignees",initialState:Fb,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,Fb)),reducers:{initializeWorkflowStepAssignees:At.initialize,addWorkflowStepAssignee:At.addOne,addWorkflowStepAssignees:At.addMany,setWorkflowStepAssignee:At.setOne,setWorkflowStepAssignees:At.setMany,updateWorkflowStepAssignee:At.updateOne,updateWorkflowStepAssignees:At.updateMany,deleteWorkflowStepAssignee:At.deleteOne,deleteWorkflowStepAssignees:At.deleteMany}}),{initializeWorkflowStepAssignees:_b,addWorkflowStepAssignee:gb,addWorkflowStepAssignees:Rb,setWorkflowStepAssignee:bb,setWorkflowStepAssignees:Mb,updateWorkflowStepAssignee:vb,updateWorkflowStepAssignees:Eb,deleteWorkflowStepAssignee:kb,deleteWorkflowStepAssignees:Vb}=Oc.actions,Bb=t=>t.workflowStepAssigneeReducer.instances,hs=o.createSelector([Bb],t=>Object.values(t)),Db=t=>s=>s.workflowStepAssigneeReducer.instances[t],Wb=S(o.createSelector([hs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),gD=S(o.createSelector([hs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),RD=S(o.createSelector([hs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),bD=S(o.createSelector([hs,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),zb=Oc.reducer,wt=T(t=>t.uuid),qb={instances:{}},Tc=o.createSlice({name:"workflowStepComments",initialState:qb,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,qb)),reducers:{initializeWorkflowStepComments:wt.initialize,addWorkflowStepComment:wt.addOne,addWorkflowStepComments:wt.addMany,setWorkflowStepComment:wt.setOne,setWorkflowStepComments:wt.setMany,updateWorkflowStepComment:wt.updateOne,updateWorkflowStepComments:wt.updateMany,deleteWorkflowStepComment:wt.deleteOne,deleteWorkflowStepComments:wt.deleteMany}}),{initializeWorkflowStepComments:jb,addWorkflowStepComment:$b,addWorkflowStepComments:Cb,setWorkflowStepComment:Ub,setWorkflowStepComments:Lb,updateWorkflowStepComment:Nb,updateWorkflowStepComments:Hb,deleteWorkflowStepComment:Gb,deleteWorkflowStepComments:Kb}=Tc.actions,Yb=t=>t.workflowStepCommentReducer.instances,ps=o.createSelector([Yb],t=>Object.values(t)),Jb=t=>s=>s.workflowStepCommentReducer.instances[t],Qb=S(o.createSelector([ps,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),MD=S(o.createSelector([ps,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),vD=S(o.createSelector([ps,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),ED=S(o.createSelector([ps,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),Zb=Tc.reducer,Pt=T(t=>t.uuid),Xb={instances:{}},Ic=o.createSlice({name:"workflowStepDefaultAssignees",initialState:Xb,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,Xb)),reducers:{initializeWorkflowStepDefaultAssignees:Pt.initialize,addWorkflowStepDefaultAssignee:Pt.addOne,addWorkflowStepDefaultAssignees:Pt.addMany,setWorkflowStepDefaultAssignee:Pt.setOne,setWorkflowStepDefaultAssignees:Pt.setMany,updateWorkflowStepDefaultAssignee:Pt.updateOne,updateWorkflowStepDefaultAssignees:Pt.updateMany,deleteWorkflowStepDefaultAssignee:Pt.deleteOne,deleteWorkflowStepDefaultAssignees:Pt.deleteMany}}),{initializeWorkflowStepDefaultAssignees:xb,addWorkflowStepDefaultAssignee:eM,addWorkflowStepDefaultAssignees:tM,setWorkflowStepDefaultAssignee:sM,setWorkflowStepDefaultAssignees:iM,updateWorkflowStepDefaultAssignee:nM,updateWorkflowStepDefaultAssignees:aM,deleteWorkflowStepDefaultAssignee:cM,deleteWorkflowStepDefaultAssignees:rM}=Ic.actions,dM=t=>t.workflowStepDefaultAssigneeReducer.instances,Fc=o.createSelector([dM],t=>Object.values(t)),lM=t=>s=>s.workflowStepDefaultAssigneeReducer.instances[t],uM=S(o.createSelector([Fc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),kD=S(o.createSelector([Fc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),oM=Ic.reducer,Ot=T(t=>t.uuid),hM={instances:{}},_c=o.createSlice({name:"workflowStepDefaultReviewers",initialState:hM,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,hM)),reducers:{initializeWorkflowStepDefaultReviewers:Ot.initialize,addWorkflowStepDefaultReviewer:Ot.addOne,addWorkflowStepDefaultReviewers:Ot.addMany,setWorkflowStepDefaultReviewer:Ot.setOne,setWorkflowStepDefaultReviewers:Ot.setMany,updateWorkflowStepDefaultReviewer:Ot.updateOne,updateWorkflowStepDefaultReviewers:Ot.updateMany,deleteWorkflowStepDefaultReviewer:Ot.deleteOne,deleteWorkflowStepDefaultReviewers:Ot.deleteMany}}),{initializeWorkflowStepDefaultReviewers:pM,addWorkflowStepDefaultReviewer:yM,addWorkflowStepDefaultReviewers:mM,setWorkflowStepDefaultReviewer:SM,setWorkflowStepDefaultReviewers:fM,updateWorkflowStepDefaultReviewer:AM,updateWorkflowStepDefaultReviewers:wM,deleteWorkflowStepDefaultReviewer:PM,deleteWorkflowStepDefaultReviewers:OM}=_c.actions,TM=t=>t.workflowStepDefaultReviewerReducer.instances,gc=o.createSelector([TM],t=>Object.values(t)),IM=t=>s=>s.workflowStepDefaultReviewerReducer.instances[t],FM=S(o.createSelector([gc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),VD=S(o.createSelector([gc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),_M=_c.reducer,Tt=T(t=>t.uuid),gM={instances:{}},Rc=o.createSlice({name:"workflowStepEvents",initialState:gM,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,gM)),reducers:{initializeWorkflowStepEvents:Tt.initialize,addWorkflowStepEvent:Tt.addOne,addWorkflowStepEvents:Tt.addMany,setWorkflowStepEvent:Tt.setOne,setWorkflowStepEvents:Tt.setMany,updateWorkflowStepEvent:Tt.updateOne,updateWorkflowStepEvents:Tt.updateMany,deleteWorkflowStepEvent:Tt.deleteOne,deleteWorkflowStepEvents:Tt.deleteMany}}),{initializeWorkflowStepEvents:RM,addWorkflowStepEvent:bM,addWorkflowStepEvents:MM,setWorkflowStepEvent:vM,setWorkflowStepEvents:EM,updateWorkflowStepEvent:kM,updateWorkflowStepEvents:VM,deleteWorkflowStepEvent:BM,deleteWorkflowStepEvents:DM}=Rc.actions,WM=t=>t.workflowStepEventReducer.instances,ys=o.createSelector([WM],t=>Object.values(t)),zM=t=>s=>s.workflowStepEventReducer.instances[t],qM=S(o.createSelector([ys,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),BD=S(o.createSelector([ys,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),DD=S(o.createSelector([ys,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),WD=S(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)))),jM=Rc.reducer,It=T(t=>t.uuid),$M={instances:{}},bc=o.createSlice({name:"workflowStepFieldsAttachments",initialState:$M,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,$M)),reducers:{initializeWorkflowStepFieldsAttachments:It.initialize,addWorkflowStepFieldsAttachment:It.addOne,addWorkflowStepFieldsAttachments:It.addMany,setWorkflowStepFieldsAttachment:It.setOne,setWorkflowStepFieldsAttachments:It.setMany,updateWorkflowStepFieldsAttachment:It.updateOne,updateWorkflowStepFieldsAttachments:It.updateMany,deleteWorkflowStepFieldsAttachment:It.deleteOne,deleteWorkflowStepFieldsAttachments:It.deleteMany}}),{initializeWorkflowStepFieldsAttachments:CM,addWorkflowStepFieldsAttachment:UM,addWorkflowStepFieldsAttachments:Mc,setWorkflowStepFieldsAttachment:LM,setWorkflowStepFieldsAttachments:NM,updateWorkflowStepFieldsAttachment:HM,updateWorkflowStepFieldsAttachments:GM,deleteWorkflowStepFieldsAttachment:KM,deleteWorkflowStepFieldsAttachments:vc}=bc.actions,YM=t=>t.workflowStepFieldsAttachmentReducer.instances,Ec=o.createSelector([YM],t=>Object.values(t)),JM=S(o.createSelector([Ec,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),QM=t=>s=>s.workflowStepFieldsAttachmentReducer.instances[t],ZM=S(o.createSelector([Ec,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),XM=bc.reducer,Ft=T(t=>t.uuid),xM={instances:{}},kc=o.createSlice({name:"workflowStepFields",initialState:xM,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,xM)),reducers:{initializeWorkflowStepFields:Ft.initialize,addWorkflowStepFields:Ft.addOne,addWorkflowStepFieldsMany:Ft.addMany,setWorkflowStepFields:Ft.setOne,setWorkflowStepFieldsMany:Ft.setMany,updateWorkflowStepFields:Ft.updateOne,updateWorkflowStepFieldsMany:Ft.updateMany,deleteWorkflowStepFields:Ft.deleteOne,deleteWorkflowStepFieldsMany:Ft.deleteMany}}),{initializeWorkflowStepFields:ev,addWorkflowStepFields:tv,addWorkflowStepFieldsMany:sv,setWorkflowStepFields:iv,setWorkflowStepFieldsMany:nv,updateWorkflowStepFields:av,updateWorkflowStepFieldsMany:cv,deleteWorkflowStepFields:rv,deleteWorkflowStepFieldsMany:dv}=kc.actions,lv=t=>t.workflowStepFieldsReducer.instances,Hs=o.createSelector([lv],t=>Object.values(t)),zD=S(o.createSelector([Hs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),qD=S(o.createSelector([Hs,(t,s)=>s],(t,s)=>t.filter(e=>e.workflow_step===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),uv=t=>s=>s.workflowStepFieldsReducer.instances[t],ov=S(o.createSelector([Hs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),hv=kc.reducer,_t=T(t=>t.uuid),pv={instances:{}},Vc=o.createSlice({name:"workflowStepFieldValuesAttachments",initialState:pv,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,pv)),reducers:{initializeWorkflowStepFieldValuesAttachments:_t.initialize,addWorkflowStepFieldValuesAttachment:_t.addOne,addWorkflowStepFieldValuesAttachments:_t.addMany,setWorkflowStepFieldValuesAttachment:_t.setOne,setWorkflowStepFieldValuesAttachments:_t.setMany,updateWorkflowStepFieldValuesAttachment:_t.updateOne,updateWorkflowStepFieldValuesAttachments:_t.updateMany,deleteWorkflowStepFieldValuesAttachment:_t.deleteOne,deleteWorkflowStepFieldValuesAttachments:_t.deleteMany}}),{initializeWorkflowStepFieldValuesAttachments:yv,addWorkflowStepFieldValuesAttachment:mv,addWorkflowStepFieldValuesAttachments:Bc,setWorkflowStepFieldValuesAttachment:Sv,setWorkflowStepFieldValuesAttachments:fv,updateWorkflowStepFieldValuesAttachment:Av,updateWorkflowStepFieldValuesAttachments:wv,deleteWorkflowStepFieldValuesAttachment:Pv,deleteWorkflowStepFieldValuesAttachments:Dc}=Vc.actions,Ov=t=>t.workflowStepFieldValuesAttachmentReducer.instances,Wc=o.createSelector([Ov],t=>Object.values(t)),Tv=t=>s=>s.workflowStepFieldValuesAttachmentReducer.instances[t],Iv=S(o.createSelector([Wc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Fv=S(o.createSelector([Wc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),_v=Vc.reducer,gt=T(t=>t.uuid),gv={instances:{}},zc=o.createSlice({name:"workflowStepFieldValues",initialState:gv,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,gv)),reducers:{initializeWorkflowStepFieldValues:gt.initialize,addWorkflowStepFieldValues:gt.addOne,addWorkflowStepFieldValuesMany:gt.addMany,setWorkflowStepFieldValues:gt.setOne,setWorkflowStepFieldValuesMany:gt.setMany,updateWorkflowStepFieldValues:gt.updateOne,updateWorkflowStepFieldValuesMany:gt.updateMany,deleteWorkflowStepFieldValues:gt.deleteOne,deleteWorkflowStepFieldValuesMany:gt.deleteMany}}),{initializeWorkflowStepFieldValues:Rv,addWorkflowStepFieldValues:bv,addWorkflowStepFieldValuesMany:Mv,setWorkflowStepFieldValues:vv,setWorkflowStepFieldValuesMany:Ev,updateWorkflowStepFieldValues:kv,updateWorkflowStepFieldValuesMany:Vv,deleteWorkflowStepFieldValues:Bv,deleteWorkflowStepFieldValuesMany:Dv}=zc.actions,Wv=t=>t.workflowStepFieldValuesReducer.instances,Bt=o.createSelector([Wv],t=>Object.values(t)),jD=S(o.createSelector([Bt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),$D=S(o.createSelector([Bt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),zv=t=>s=>s.workflowStepFieldValuesReducer.instances[t],qv=S(o.createSelector([Bt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),CD=S(o.createSelector([Bt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),UD=S(o.createSelector([Bt,(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})),jv=zc.reducer,Rt=T(t=>t.uuid),$v={instances:{}},qc=o.createSlice({name:"workflowStepFieldValuesReviewRequests",initialState:$v,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,$v)),reducers:{initializeWorkflowStepFieldValuesReviewRequests:Rt.initialize,addWorkflowStepFieldValuesReviewRequest:Rt.addOne,addWorkflowStepFieldValuesReviewRequests:Rt.addMany,setWorkflowStepFieldValuesReviewRequest:Rt.setOne,setWorkflowStepFieldValuesReviewRequests:Rt.setMany,updateWorkflowStepFieldValuesReviewRequest:Rt.updateOne,updateWorkflowStepFieldValuesReviewRequests:Rt.updateMany,deleteWorkflowStepFieldValuesReviewRequest:Rt.deleteOne,deleteWorkflowStepFieldValuesReviewRequests:Rt.deleteMany}}),{initializeWorkflowStepFieldValuesReviewRequests:Cv,addWorkflowStepFieldValuesReviewRequest:Uv,addWorkflowStepFieldValuesReviewRequests:jc,setWorkflowStepFieldValuesReviewRequest:Lv,setWorkflowStepFieldValuesReviewRequests:Nv,updateWorkflowStepFieldValuesReviewRequest:Hv,updateWorkflowStepFieldValuesReviewRequests:Gv,deleteWorkflowStepFieldValuesReviewRequest:Kv,deleteWorkflowStepFieldValuesReviewRequests:$c}=qc.actions,Yv=t=>t.workflowStepFieldValuesReviewRequestReducer.instances,ms=o.createSelector([Yv],t=>Object.values(t)),Jv=t=>s=>s.workflowStepFieldValuesReviewRequestReducer.instances[t],Qv=S(o.createSelector([ms,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Zv=S(o.createSelector([ms,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),LD=S(o.createSelector([ms,(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})),ND=S(o.createSelector([Bt,ms,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(v(t.filter(({workflow_step:c,workflow:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),Xv=qc.reducer,bt=T(t=>t.uuid),xv={instances:{}},Cc=o.createSlice({name:"workflowStepFieldValuesReviews",initialState:xv,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,xv)),reducers:{initializeWorkflowStepFieldValuesReviews:bt.initialize,addWorkflowStepFieldValuesReview:bt.addOne,addWorkflowStepFieldValuesReviews:bt.addMany,setWorkflowStepFieldValuesReview:bt.setOne,setWorkflowStepFieldValuesReviews:bt.setMany,updateWorkflowStepFieldValuesReview:bt.updateOne,updateWorkflowStepFieldValuesReviews:bt.updateMany,deleteWorkflowStepFieldValuesReview:bt.deleteOne,deleteWorkflowStepFieldValuesReviews:bt.deleteMany}}),{initializeWorkflowStepFieldValuesReviews:eE,addWorkflowStepFieldValuesReview:tE,addWorkflowStepFieldValuesReviews:Uc,setWorkflowStepFieldValuesReview:sE,setWorkflowStepFieldValuesReviews:iE,updateWorkflowStepFieldValuesReview:nE,updateWorkflowStepFieldValuesReviews:aE,deleteWorkflowStepFieldValuesReview:cE,deleteWorkflowStepFieldValuesReviews:Lc}=Cc.actions,rE=t=>t.workflowStepFieldValuesReviewReducer.instances,Yt=o.createSelector([rE],t=>Object.values(t)),dE=t=>s=>s.workflowStepFieldValuesReviewReducer.instances[t],lE=S(o.createSelector([Yt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),uE=S(o.createSelector([Yt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),HD=S(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})),GD=S(o.createSelector([Bt,Yt,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(v(t.filter(({workflow_step:c,workflow:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),KD=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}),oE=Cc.reducer,Mt=T(t=>t.uuid),hE={instances:{}},Nc=o.createSlice({name:"workflowStepReviewers",initialState:hE,extraReducers:t=>t.addMatcher(o.isAnyOf(P,V,I),s=>Object.assign(s,hE)),reducers:{initializeWorkflowStepReviewers:Mt.initialize,addWorkflowStepReviewer:Mt.addOne,addWorkflowStepReviewers:Mt.addMany,setWorkflowStepReviewer:Mt.setOne,setWorkflowStepReviewers:Mt.setMany,updateWorkflowStepReviewer:Mt.updateOne,updateWorkflowStepReviewers:Mt.updateMany,deleteWorkflowStepReviewer:Mt.deleteOne,deleteWorkflowStepReviewers:Mt.deleteMany}}),{initializeWorkflowStepReviewers:pE,addWorkflowStepReviewer:yE,addWorkflowStepReviewers:mE,setWorkflowStepReviewer:SE,setWorkflowStepReviewers:fE,updateWorkflowStepReviewer:AE,updateWorkflowStepReviewers:wE,deleteWorkflowStepReviewer:PE,deleteWorkflowStepReviewers:OE}=Nc.actions,TE=t=>t.workflowStepReviewerReducer.instances,Ss=o.createSelector([TE],t=>Object.values(t)),IE=t=>s=>s.workflowStepReviewerReducer.instances[t],FE=S(o.createSelector([Ss,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),YD=S(o.createSelector([Ss,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),JD=S(o.createSelector([Ss,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),QD=S(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)))),_E=Nc.reducer,vt=T(t=>t.uuid),gE={instances:{}},Hc=o.createSlice({name:"workflowSteps",initialState:gE,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,gE)),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:RE,addWorkflowStep:bE,addWorkflowSteps:ME,setWorkflowStep:vE,setWorkflowSteps:EE,updateWorkflowStep:kE,updateWorkflowSteps:VE,deleteWorkflowStep:BE,deleteWorkflowSteps:DE}=Hc.actions,WE=t=>t.workflowStepReducer.instances,Gc=o.createSelector([WE],t=>Object.values(t)),zE=t=>s=>s.workflowStepReducer.instances[t],qE=S(o.createSelector([Gc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ZD=S(o.createSelector([Gc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_type===s)))),jE=Hc.reducer,Et=T(t=>t.uuid),$E={instances:{}},Kc=o.createSlice({name:"workflowTypes",initialState:$E,extraReducers:t=>t.addMatcher(o.isAnyOf(P,I),s=>Object.assign(s,$E)),reducers:{initializeWorkflowTypes:Et.initialize,addWorkflowType:Et.addOne,addWorkflowTypes:Et.addMany,setWorkflowType:Et.setOne,setWorkflowTypes:Et.setMany,updateWorkflowType:Et.updateOne,updateWorkflowTypes:Et.updateMany,deleteWorkflowType:Et.deleteOne,deleteWorkflowTypes:Et.deleteMany}}),{initializeWorkflowTypes:CE,addWorkflowType:UE,addWorkflowTypes:LE,setWorkflowType:NE,setWorkflowTypes:HE,updateWorkflowType:GE,updateWorkflowTypes:KE,deleteWorkflowType:YE,deleteWorkflowTypes:JE}=Kc.actions,QE=t=>t.workflowTypeReducer.instances,Yc=o.createSelector([QE],t=>Object.values(t)),ZE=t=>s=>s.workflowTypeReducer.instances[t],XE=S(o.createSelector([Yc,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),XD=S(o.createSelector([Yc,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),xE=Kc.reducer,Jc={outboxReducer:gO,fileReducer:Hy,authReducer:ey},xD=o.combineReducers(Jc),ek={...Jc,[es]:YR,assetReducer:co,assetAttachmentReducer:Hr,assetStageCompletionReducer:Ao,assetStageReducer:Vo,assetTypeReducer:zp,assetTypeAttachmentReducer:Yo,issueReducer:dA,issueAttachmentReducer:Tf,issueTypeReducer:oP,issueTypeAttachmentReducer:TA,organizationReducer:PO,projectReducer:_T,projectAttachmentReducer:xO,projectAccessReducer:zO,organizationAccessReducer:sO,projectFileReducer:yT,procedureTypeReducer:yR,procedureReducer:zT,procedureTypeFieldsReducer:Rg,procedureFieldValuesReducer:eR,procedureTypeAttachmentReducer:x_,procedureTypeFieldsAttachmentReducer:pg,procedureFieldValuesAttachmentReducer:jg,procedureStepFieldsAttachmentReducer:SF,procedureStepFieldsReducer:MF,procedureStepFieldValuesAttachmentReducer:UF,procedureStepFieldValuesReducer:xF,procedureStepFieldValuesReviewReducer:m_,procedureStepAssigneeReducer:tI,procedureStepCommentReducer:mI,procedureStepDefaultAssigneeReducer:MI,procedureStepDefaultReviewerReducer:LI,procedureStepEventReducer:iF,procedureStepReviewerReducer:M_,procedureStepReducer:$_,rehydratedReducer:AR,formReducer:iS,formRevisionReducer:Gm,formRevisionAttachmentReducer:Vm,formSubmissionAttachmentReducer:AS,formSubmissionReducer:ES,formIdentifierReducer:am,formIdentifierValueReducer:wm,userReducer:LP,emailDomainsReducer:Uy,documentsReducer:_y,documentAttachmentReducer:yy,teamReducer:GR,agentsReducer:kr,issueCommentReducer:Jf,issueCommentAttachmentReducer:Wf,issueUpdateReducer:BP,geoImageReducer:HS,issueAssociationReducer:lf,issueTypeFieldsReducer:uw,issueTypeFieldValuesReducer:QA,issueTypeFieldsAttachmentReducer:WA,issueTypeFieldValuesAttachmentReducer:Iw,issueTypeIdentifierReducer:zw,issueTypeIdentifierValueReducer:Zw,issueTypeStatusReducer:FP,assetTypeFieldsReducer:Th,assetTypeFieldValuesReducer:Jh,assetTypeFieldsAttachmentReducer:dh,assetTypeFieldValuesAttachmentReducer:Dh,assetTypeIdentifierReducer:lp,assetTypeIdentifierValueReducer:Ip,assetTypeStatusReducer:Zp,assetProcedureTypeReducer:vl,assetProcedureReducer:ml,assetProcedureTypeFieldsReducer:vd,assetProcedureTypeFieldValuesReducer:il,assetProcedureTypeFieldsAttachmentReducer:Sd,assetProcedureTypeFieldValuesAttachmentReducer:Ud,assetProcedureTypeAttachmentReducer:sd,assetProcedureStepFieldsAttachmentReducer:Kl,assetProcedureStepFieldsReducer:cu,assetProcedureStepFieldValuesAttachmentReducer:wu,assetProcedureStepFieldValuesReducer:Vu,assetProcedureStepReducer:Nu,teamMembershipReducer:MR,workflowTypeReducer:xE,workflowStepReducer:jE,workflowStepFieldsReducer:hv,workflowStepFieldsAttachmentReducer:XM,workflowReducer:db,workflowIssueLinkReducer:Ib,workflowStepAssigneeReducer:zb,workflowStepCommentReducer:Zb,workflowStepDefaultAssigneeReducer:oM,workflowStepDefaultReviewerReducer:_M,workflowStepEventReducer:jM,workflowStepFieldValuesReducer:jv,workflowStepFieldValuesAttachmentReducer:_v,workflowStepFieldValuesReviewReducer:oE,workflowStepFieldValuesReviewRequestReducer:Xv,workflowStepReviewerReducer:_E},eW=o.combineReducers(ek),tk=1e4,sk=200,Qc=[400,409,403,404,405,500],kt=1e4,ik={};class nk{constructor(s){p(this,"client");p(this,"pageSize",tk);ik[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 ak=()=>dk.length-1,ck=t=>(t[es]={version:ak()},t),rk=()=>ck({}),tW=t=>(t.outboxReducer&&(t.outboxReducer.deletedRequests=[]),t),sW=t=>s=>{var e;return s===void 0&&(s={}),((e=s[es])==null?void 0:e.version)===ak()?s:t(s)},dk=[ck,rk,rk,tW],iW=Object.fromEntries(dk.map((t,s)=>[s,sW(t)])),nW=t=>{if(t)throw t;const s=Zt();s?s.dispatch({type:"rehydrated/setRehydrated",payload:!0}):console.error("Client store not set")},lk=(t,s,e)=>{const n=Ct();return n?(n.addRequest(s),n.getQueue()):(console.warn("Outbox coordinator not set; cannot enqueue request yet."),[])},uk=(t,s,e)=>{const n=Ct();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 aW(t,s){if(!s.payload)throw new Error("Received empty payload");return Ik(s)}const cW={...ir,effect:aW,discard:hk,returnPromises:!0,persistCallback:nW,retry:uW,persistOptions:{storage:vk},queue:{...ir.queue,enqueue:lk,dequeue:uk,peek:(...t)=>lW(...t)}},rW=Ek(iW,es),dW=o.compose(Mk.offline(cW),rW);async function ok(t,s,e){if(s.store.getState().outboxReducer.deletedRequests.includes(t.payload.uuid))throw new Error("Request was marked for deletion");const a=ik[t.meta.offline.effect.serviceName];if(!a)throw new Error(`Service ${t.meta.offline.effect.serviceName} not found`);return Xc(t.meta.offline.effect.BASE_URL,t.meta.offline.effect.request,s,a,e)}function hk(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=Zt(),c=n.getState().outboxReducer.deletedRequests,r=s.payload.uuid;function d(){n.dispatch(FT(r));const y=Ut();if(!y)throw new Error("Outbox coordinator not set");y.remove(s.payload.uuid);const m=s.meta.offline.rollback;throw m&&(console.warn("Rolling back request due to SDK error:",s),n.dispatch(m)),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&&Qc.includes(y)){console.warn("Discarding request due to error:",t,`
4
- Action:`,s);const m=Ut();if(!m)throw new Error("Outbox coordinator not set");m.remove(s.payload.uuid),t.options.discard=!0,d()}}console.debug("Registering a retry for request:",s.payload.uuid);const l=Ut();if(!l)throw new Error("Outbox coordinator not set");return l.registerRetry(s.payload.uuid),!1}function hW(t,s,e){var n;return(n=Ut())==null?void 0:n.peek()}function pW(t,s){return Zt().dispatch(_T(new Date().getTime())),pr}const Jt="An unknown error occurred",yW=500,pE=["non_field_errors","detail"];function mW(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"?pE.includes(a)?c:`${a}: ${c}`:Array.isArray(c)?pE.includes(a)?c.join(`
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=Zt(),c=n.getState().outboxReducer.deletedRequests,r=s.payload.uuid;function d(){n.dispatch(FO(r));const y=Ct();if(!y)throw new Error("Outbox coordinator not set");y.remove(s.payload.uuid);const m=s.meta.offline.rollback;throw m&&(console.warn("Rolling back request due to SDK error:",s),n.dispatch(m)),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&&Qc.includes(y)){console.warn("Discarding request due to error:",t,`
4
+ Action:`,s);const m=Ct();if(!m)throw new Error("Outbox coordinator not set");m.remove(s.payload.uuid),t.options.discard=!0,d()}}console.debug("Registering a retry for request:",s.payload.uuid);const l=Ct();if(!l)throw new Error("Outbox coordinator not set");return l.registerRetry(s.payload.uuid),!1}function lW(t,s,e){var n;return(n=Ct())==null?void 0:n.peek()}function uW(t,s){return Zt().dispatch(_O(new Date().getTime())),pr}const Jt="An unknown error occurred",oW=500,pk=["non_field_errors","detail"];function hW(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"?pk.includes(a)?c:`${a}: ${c}`:Array.isArray(c)?pk.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>yW?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??mW(n,a)??Jt,this.status=(n==null?void 0:n.status)??0,this.response=n,e.discard=e.discard??!1,this.options=e}}function yE(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 SW extends nE{constructor(s){super(s)}}class Ct extends nE{constructor(e,n){super(e);p(this,"auth");this.auth=n}}class fW 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(Mr(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(kr(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(vr(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(br(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",sE)}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,...k}=e;d=await this.client.files.getFilePayload(g),l=URL.createObjectURL(g),r={...k,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 m=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)});m.then(({instance:g})=>{this.dispatch(a(g))}).catch(g=>{throw this.dispatch(c(this.getId(u))),g}).finally(()=>{l&&URL.revokeObjectURL(l)});const f=m.then(({instance:g})=>g),F=m.then(async({instance:g,presigned_url:k})=>{try{return k&&await this.client.files.processPresignedUrl(g.file_sha1,k),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)),m=[];for(const k of y){const _=[],v={},R=[],D=[];for(const W of k){let q;if("file"in W){const{file:tr,...yq}=W,Xt=await this.client.files.getFilePayload(tr);Xt.sha1 in v||(v[Xt.sha1]=Xt);const RE=URL.createObjectURL(tr);u.add(RE),q={...yq,file_sha1:Xt.sha1,file_type:Xt.file_type,file_name:tr.name,file_extension:Xt.extension,file_url:RE}}else q=W;const V=this.buildModel(q);l.push(V);const H=this.buildBulkPayload(V);_.push(H);const Ks=this.getBlockers(V);R.push(...Ks);const pq=this.getBlocks(V);D.push(...pq)}const j={payloads:_,submittedAt:d,files:Object.values(v),blockers:R,blocks:D};m.push(j)}this.dispatch(a(l));const f=m.map(k=>{const{submittedAt:_,files:v,payloads:R,blocks:D,blockers:j}=k;return this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:_,files:v,payloads:R},blockers:j,blocks:D})});Promise.all(f).then(k=>{const _=k.flatMap(v=>v.instances);this.dispatch(c(_))}).catch(k=>{throw this.dispatch(r(l.map(_=>this.getId(_)))),console.error(k),k}).finally(()=>{for(const k of u)URL.revokeObjectURL(k)});const F=Promise.all(f).then(k=>k.flatMap(({instances:_})=>_)),g=Promise.all(f).then(async k=>{const _=[];for(const{presigned_urls:v}of k){const R=this.client.files.processPresignedUrls(v);for(const[D,j]of Object.entries(R))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 AW extends z{constructor(){super(...arguments);p(this,"name","Asset attachment");p(this,"url","/asset-attachments");p(this,"actions",{addOne:Dr,addMany:ii,setOne:Wr,setMany:zr,updateOne:qr,updateMany:jr,deleteOne:$r,deleteMany:ni,initialize:Br});p(this,"selectors",{selectById:Ur,selectByIds:Lr})}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 wW extends z{constructor(){super(...arguments);p(this,"name","Asset Procedure Attachment");p(this,"url","/asset-procedure-type-attachments");p(this,"actions",{addOne:Yr,addMany:Jr,setOne:Qr,setMany:Zr,updateOne:Xr,updateMany:xr,deleteOne:ed,deleteMany:td,initialize:Kr});p(this,"selectors",{selectById:nd,selectByIds:ad})}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,m=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:m,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 PW 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:dd,addMany:ld,setOne:ud,setMany:od,updateOne:hd,updateMany:pd,deleteOne:yd,deleteMany:md,initialize:rd});p(this,"selectors",{selectById:Ad,selectByIds:wd})}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 TW extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure Type Fields");p(this,"url","/asset-procedure-type-fields");p(this,"actions",{addOne:Od,addMany:Id,setOne:Fd,setMany:_d,updateOne:gd,updateMany:Rd,deleteOne:bd,deleteMany:Md,initialize:Td});p(this,"selectors",{selectById:Ed,selectByIds:Vd})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.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:b(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 OW 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:Wd,addMany:hi,setOne:zd,setMany:qd,updateOne:jd,updateMany:$d,deleteOne:Cd,deleteMany:pi,initialize:Dd});p(this,"selectors",{selectById:Nd,selectByIds:Hd})}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 IW 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:Jd,addMany:Qd,setOne:Zd,setMany:Xd,updateOne:xd,updateMany:el,deleteOne:tl,deleteMany:sl,initialize:Yd});p(this,"selectors",{selectById:al,selectByIds:cl})}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}),m=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(y),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[y.uuid]});return this.dispatch(a(y)),m.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,m]}bulkAdd(e,n){var k;const{values:a,payloads:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),y=((k=this.client.store.getState().userReducer.currentUser)==null?void 0:k.id)??null,m=[],f=N(c,Math.min(n??c.length,L)),F=[];for(const _ of f){const v=[];for(const R of _){const D=P({...R,values:R.values,created_by:y,submitted_at:u});m.push(D),v.push({uuid:D.uuid,asset:R.asset,fields_revision:R.fields_revision,asset_procedure:R.asset_procedure,published_at:R.published_at,values:D.values})}F.push({submitted_at:u,values:a,field_values:v})}this.dispatch(r(m));const g=[];for(const _ of F){const{field_values:v}=_,R=v.map(({asset:V})=>V),D=v.map(({fields_revision:V})=>V),j=v.map(({asset_procedure:V})=>V),W=v.map(({uuid:V})=>V),q=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:_,blockers:R.concat(D).concat(j),blocks:W});g.push(q)}return Promise.all(g).then(_=>{this.dispatch(d(_.flat()))}).catch(()=>{this.dispatch(l(E(m)))}),[m,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=Gd(e)(d);this.dispatch(a(e)),this.dispatch(pi(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(hi(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 FW extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure");p(this,"url","/asset-procedures");p(this,"actions",{addOne:ll,addMany:fi,setOne:pl,setMany:yl,updateOne:ul,updateMany:ol,deleteOne:hl,deleteMany:Ai,initialize:dl});p(this,"selectors",{selectById:Al,selectByIds:wl})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.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:b(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 _W extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure Type");p(this,"url","/asset-procedure-types");p(this,"actions",{addOne:Ol,addMany:Il,setOne:bl,setMany:Ml,updateOne:Fl,updateMany:_l,deleteOne:gl,deleteMany:Rl,initialize:Tl});p(this,"selectors",{selectById:El,selectByIds:Vl})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.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:b(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(Ai(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(fi(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 gW 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:Wl,addMany:zl,setOne:ql,setMany:jl,updateOne:$l,updateMany:Cl,deleteOne:Ul,deleteMany:Ll,initialize:Dl});p(this,"selectors",{selectById:Hl,selectByIds:Gl})}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 RW extends M{constructor(){super(...arguments);p(this,"name","Asset Procedure Step Fields");p(this,"url","/asset-procedure-step-fields");p(this,"actions",{addOne:Ql,addMany:Zl,setOne:Xl,setMany:xl,updateOne:eu,updateMany:tu,deleteOne:su,deleteMany:iu,initialize:Jl});p(this,"selectors",{selectById:nu,selectByIds:au})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.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:b(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:lu,addMany:gi,setOne:uu,setMany:ou,updateOne:hu,updateMany:pu,deleteOne:yu,deleteMany:Ri,initialize:du});p(this,"selectors",{selectById:Su,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 MW 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:Ou,addMany:Iu,setOne:Fu,setMany:_u,updateOne:gu,updateMany:Ru,deleteOne:bu,deleteMany:Mu,initialize:Tu});p(this,"selectors",{selectById:ku,selectByIds:Eu})}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}),m=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(y),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[y.uuid]});return this.dispatch(a(y)),m.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,m]}bulkAdd(e,n){var k;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),y=((k=this.client.store.getState().userReducer.currentUser)==null?void 0:k.id)??null,m=[],f=N(a,Math.min(n??a.length,L)),F=[];for(const _ of f){const v=[];for(const R of _){const D=P({...R,values:R.values,created_by:y,submitted_at:u});m.push(D),v.push({uuid:D.uuid,asset:R.asset,fields_revision:R.fields_revision,asset_procedure:R.asset_procedure,asset_procedure_step:R.asset_procedure_step,published_at:R.published_at,values:D.values})}F.push({submitted_at:u,values:c,field_values:v})}this.dispatch(r(m));const g=[];for(const _ of F){const{field_values:v}=_,R=v.map(({asset:V})=>V),D=v.map(({fields_revision:V})=>V),j=v.map(({asset_procedure:V})=>V),W=v.map(({uuid:V})=>V),q=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:_,blockers:R.concat(D).concat(j),blocks:W});g.push(q)}return Promise.all(g).then(_=>{this.dispatch(d(_.flat()))}).catch(()=>{this.dispatch(l(E(m)))}),[m,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=Au(e)(d);this.dispatch(a(e)),this.dispatch(Ri(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(gi(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 Step");p(this,"url","/asset-procedure-steps");p(this,"actions",{addOne:qu,addMany:ju,setOne:Wu,setMany:zu,updateOne:$u,updateMany:Cu,deleteOne:Uu,deleteMany:Lu,initialize:Du});p(this,"selectors",{selectById:Hu,selectByIds:Gu})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.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:b(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 m=Ku(e)(u);this.dispatch(d(e)),this.dispatch(a(E(m)));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(m)),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 kW extends M{constructor(){super(...arguments);p(this,"url","/assets");p(this,"name","Asset");p(this,"actions",{addOne:Qu,addMany:Vi,setOne:eo,setMany:to,updateOne:Zu,updateMany:Xu,deleteOne:xu,deleteMany:Bi,initialize:Ju});p(this,"selectors",{selectById:no,selectByIds:ao})}add(e){var m;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.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:b(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=Nr(e)(d),y=df(e)(d);this.dispatch(c(e)),this.dispatch(ni(E(u))),this.dispatch(qt(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(m){throw this.dispatch(a(l)),this.dispatch(ii(u)),this.dispatch(zt(y)),m}}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 m=y.map(f=>P(f));return{batchId:Bt.v4(),payload:{transaction_id:r,submitted_at:c,assets:m}}}),l=[];let u=null;for(const y of d){const{batchId:m,payload:f}=y,F=f.assets.map(({uuid:R})=>R),g=f.assets.map(({asset_type:R})=>R),k=f.assets.map(({project:R})=>R),_=f.assets.map(({status:R})=>R),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(k).concat(_),blocks:[m].concat(F)});u=y.batchId,l.push(v)}return Promise.all(l).then(y=>{const m=y.flat();this.dispatch(a(m))}),l}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,d=E(e).toSorted(Ps);if(d.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=r(d)(a.getState()).toSorted(xs);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)),m=[];let f=null;for(const F of y){const g=Bt.v4(),k=E(F),_=F.map(({status:R})=>R).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(k).concat(_),blocks:[g].concat(k)});m.push(v),f=g}return Promise.all(m).then(F=>{this.dispatch(c(F.flat()))}).catch(()=>{this.dispatch(c(l))}),[u,m]}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 EW extends M{constructor(){super(...arguments);p(this,"name","Asset Stage Completion");p(this,"url","/asset-stage-completions");p(this,"actions",{addOne:uo,addMany:oo,setOne:ho,setMany:po,updateOne:yo,updateMany:mo,deleteOne:So,deleteMany:fo,initialize:lo});p(this,"selectors",{selectById:To,selectByIds:Oo})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.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:b(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})),m=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:m});return f.then(g=>{this.dispatch(c(g))}).catch(()=>{this.dispatch(r(m))}),[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 VW extends M{constructor(){super(...arguments);p(this,"name","Asset Stage");p(this,"url","/asset-stages");p(this,"actions",{addOne:Ro,addMany:bo,setOne:_o,setMany:go,updateOne:Mo,updateMany:vo,deleteOne:ko,deleteMany:Eo,initialize:Fo});p(this,"selectors",{selectById:Bo,selectByIds:Do})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.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:b(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 BW extends z{constructor(){super(...arguments);p(this,"name","Asset Type Attachment");p(this,"url","/asset-type-attachments");p(this,"actions",{addOne:qo,addMany:$i,setOne:jo,setMany:$o,updateOne:Co,updateMany:Uo,deleteOne:Lo,deleteMany:Ci,initialize:zo});p(this,"selectors",{selectById:Ho,selectByIds:Go})}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 DW extends z{constructor(){super(...arguments);p(this,"name","Asset Type Fields Attachment");p(this,"url","/asset-type-fields-attachments");p(this,"actions",{addOne:Zo,addMany:Xo,setOne:xo,setMany:eh,updateOne:th,updateMany:sh,deleteOne:ih,deleteMany:nh,initialize:Qo});p(this,"selectors",{selectById:ch,selectByIds:rh})}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 WW extends M{constructor(){super(...arguments);p(this,"name","Asset Type Fields");p(this,"url","/asset-type-fields");p(this,"actions",{addOne:oh,addMany:hh,setOne:ph,setMany:yh,updateOne:mh,updateMany:Sh,deleteOne:fh,deleteMany:Ah,initialize:uh});p(this,"selectors",{selectById:Ph,selectByIds:Th})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.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:b(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 zW 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:_h,addMany:Ki,setOne:gh,setMany:Rh,updateOne:bh,updateMany:Mh,deleteOne:vh,deleteMany:Yi,initialize:Fh});p(this,"selectors",{selectById:Eh,selectByIds:Vh})}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 qW extends M{constructor(){super(...arguments);p(this,"name","Asset Type Field Values");p(this,"url","/asset-type-field-values");p(this,"actions",{addOne:qh,addMany:jh,setOne:$h,setMany:Ch,updateOne:Uh,updateMany:Lh,deleteOne:Nh,deleteMany:Hh,initialize:zh});p(this,"selectors",{selectById:Kh,selectByIds:Yh})}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}),m=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(y),blockers:[e.asset,e.fields_revision],blocks:[y.uuid]});return this.dispatch(a(y)),m.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,m]}bulkAdd(e,n){var g;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),y=[],m=N(a,Math.min(n??a.length,L)),f=[];for(const k of m){const _=[];for(const v of k){const R=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(R),_.push({uuid:R.uuid,asset:v.asset,fields_revision:v.fields_revision,published_at:v.published_at,values:R.values})}f.push({submitted_at:u,values:c,field_values:_})}this.dispatch(r(y));const F=[];for(const k of f){const{field_values:_}=k,v=_.map(({asset:W})=>W),R=_.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:k,blockers:v.concat(R),blocks:D});F.push(j)}return Promise.all(F).then(k=>{this.dispatch(d(k.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=Bh(e)(d);this.dispatch(a(e)),this.dispatch(Yi(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(Ki(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 jW extends M{constructor(){super(...arguments);p(this,"name","Asset Type Identifier");p(this,"url","/asset-type-identifiers");p(this,"actions",{addOne:Xh,addMany:xh,setOne:ep,setMany:tp,updateOne:sp,updateMany:ip,deleteOne:np,deleteMany:ap,initialize:Zh});p(this,"selectors",{selectById:rp,selectByIds:dp})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.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:b(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 $W extends M{constructor(){super(...arguments);p(this,"name","Asset Type Identifier Value");p(this,"url","/asset-type-identifier-values");p(this,"actions",{addOne:hp,addMany:pp,setOne:yp,setMany:mp,updateOne:Sp,updateMany:fp,deleteOne:Ap,deleteMany:wp,initialize:op});p(this,"selectors",{selectById:Tp,selectByIds:Op})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.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:b(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 k;const{store:a}=this.client,{addMany:c,updateMany:r,deleteMany:d}=this.actions,l=new Date().toISOString(),u=((k=a.getState().userReducer.currentUser)==null?void 0:k.id)??null,y=N(e,Math.min(n??e.length,L)),m=[],f=[];for(const _ of y){const v=[],R=[],D=[];for(const W of _){const q=P({...W,submitted_at:l,created_by:u});f.push(q);const V={uuid:q.uuid,asset:q.asset,asset_type_identifier:q.asset_type_identifier,value:q.value};v.push(V),R.push(q.asset),R.push(q.asset_type_identifier),D.push(q.uuid)}const j={payloads:v,submitted_at:l,blockers:R,blocks:D};m.push(j)}this.dispatch(c(f));const F=m.map(_=>{const{payloads:v,submitted_at:R,blockers:D,blocks:j}=_;return this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:R,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 CW extends M{constructor(){super(...arguments);p(this,"name","Asset Type");p(this,"url","/asset-types");p(this,"actions",{addOne:bp,addMany:Mp,setOne:gp,setMany:Rp,updateOne:vp,updateMany:kp,deleteOne:Ep,deleteMany:Vp,initialize:_p});p(this,"selectors",{selectById:Dp,selectByIds:Wp})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.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:b(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=io(e)(d),y=Ko(e)(d);this.dispatch(a(e)),this.dispatch(Bi(E(u))),this.dispatch(Ci(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(m){throw this.dispatch(c(l)),this.dispatch(Vi(u)),this.dispatch($i(y)),m}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class UW extends M{constructor(){super(...arguments);p(this,"name","Asset Type Status");p(this,"url","/asset-type-statuses");p(this,"actions",{addOne:$p,addMany:Cp,setOne:Up,setMany:Lp,updateOne:Np,updateMany:Hp,deleteOne:Gp,deleteMany:Kp,initialize:jp});p(this,"selectors",{selectById:Jp,selectByIds:Qp})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.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:b(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 LW extends z{constructor(){super(...arguments);p(this,"name","Document Attachment");p(this,"url","/document-attachments");p(this,"actions",{addOne:iy,addMany:ny,setOne:ay,setMany:cy,updateOne:ry,updateMany:dy,deleteOne:ly,deleteMany:uy,initialize:sy});p(this,"selectors",{selectById:hy,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 NW extends M{constructor(){super(...arguments);p(this,"name","Document");p(this,"url","/documents");p(this,"actions",{addOne:fy,addMany:Ay,setOne:wy,setMany:Py,updateOne:Ty,updateMany:Oy,deleteOne:Iy,deleteMany:Fy,initialize:Sy});p(this,"selectors",{selectById:gy,selectByIds:Ry})}add(e){var m;const{store:n}=this.client,{addOne:a,deleteOne:c,updateOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.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:b(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 m=by(e)(u);this.dispatch(a(e)),this.dispatch(d(E(m)));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(m)),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 Wt 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 HW extends Wt{constructor(){super(...arguments);p(this,"name","Email Domains");p(this,"url","/organization-email-domains");p(this,"actions",{addOne:ky,addMany:Ey,setOne:Vy,setMany:By,updateOne:Dy,updateMany:Wy,deleteOne:zy,deleteMany:qy,initialize:vy});p(this,"selectors",{selectById:$y,selectByIds:Cy})}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 GW 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 fs={},Zc=new Set;class KW extends Ct{constructor(){super(...arguments);p(this,"host");p(this,"dbPromise",VE.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 ws(e);if(Zc.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),Zc.add(n)}async removeCache(e){await(await this.getDB()).delete("files",e),Zc.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 fs?d=fs[c]:Ar(e)?(d=fr(e,a),fs[c]=d):(d=new Promise(y=>{this.performRequest({method:h.GET,url:e,isExternalUrl:!0,isResponseBlob:!0,isAuthNeeded:!1}).then(m=>{const f=new File([m],a,{type:m.type});y(f)})}),fs[c]=d);let l;try{l=await d}catch(y){throw y instanceof C&&delete fs[c],y}const u=await ws(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>oW?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??hW(n,a)??Jt,this.status=(n==null?void 0:n.status)??0,this.response=n,e.discard=e.discard??!1,this.options=e}}function yk(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 pW extends nk{constructor(s){super(s)}}class $t extends nk{constructor(e,n){super(e);p(this,"auth");this.auth=n}}class yW extends $t{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(Mr(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(Er(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(vr(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(br(n)),n}}function Dt(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 b extends $t{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 D extends b{constructor(){super(...arguments);p(this,"pageSize",sk)}async add(e){const{addOne:n,updateOne:a,deleteOne:c}=this.actions;let r,d=null,l=null;if("file"in e){const{file:R,...k}=e;d=await this.client.files.getFilePayload(R),l=URL.createObjectURL(R),r={...k,file_sha1:d.sha1,file_type:d.file_type,file_name:R.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 m=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)});m.then(({instance:R})=>{this.dispatch(a(R))}).catch(R=>{throw this.dispatch(c(this.getId(u))),R}).finally(()=>{l&&URL.revokeObjectURL(l)});const f=m.then(({instance:R})=>R),F=m.then(async({instance:R,presigned_url:k})=>{try{return k&&await this.client.files.processPresignedUrl(R.file_sha1,k),R.file_sha1}catch(g){throw console.error("Upload to s3 using presigned url failed.",g),g}});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=Dt(e,Math.min(n??e.length,kt)),m=[];for(const k of y){const g=[],E={},M=[],z=[];for(const W of k){let q;if("file"in W){const{file:tr,...oq}=W,Xt=await this.client.files.getFilePayload(tr);Xt.sha1 in E||(E[Xt.sha1]=Xt);const gk=URL.createObjectURL(tr);u.add(gk),q={...oq,file_sha1:Xt.sha1,file_type:Xt.file_type,file_name:tr.name,file_extension:Xt.extension,file_url:gk}}else q=W;const B=this.buildModel(q);l.push(B);const L=this.buildBulkPayload(B);g.push(L);const Gs=this.getBlockers(B);M.push(...Gs);const uq=this.getBlocks(B);z.push(...uq)}const j={payloads:g,submittedAt:d,files:Object.values(E),blockers:M,blocks:z};m.push(j)}this.dispatch(a(l));const f=m.map(k=>{const{submittedAt:g,files:E,payloads:M,blocks:z,blockers:j}=k;return this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:g,files:E,payloads:M},blockers:j,blocks:z})});Promise.all(f).then(k=>{const g=k.flatMap(E=>E.instances);this.dispatch(c(g))}).catch(k=>{throw this.dispatch(r(l.map(g=>this.getId(g)))),console.error(k),k}).finally(()=>{for(const k of u)URL.revokeObjectURL(k)});const F=Promise.all(f).then(k=>k.flatMap(({instances:g})=>g)),R=Promise.all(f).then(async k=>{const g=[];for(const{presigned_urls:E}of k){const M=this.client.files.processPresignedUrls(E);for(const[z,j]of Object.entries(M))try{await j,g.push(z)}catch(W){throw console.error("Upload to s3 using presigned url failed.",W),W}}return g});return[l,F,R]}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 mW extends D{constructor(){super(...arguments);p(this,"name","Asset attachment");p(this,"url","/asset-attachments");p(this,"actions",{addOne:Dr,addMany:si,setOne:Wr,setMany:zr,updateOne:qr,updateMany:jr,deleteOne:$r,deleteMany:ii,initialize:Br});p(this,"selectors",{selectById:Ur,selectByIds:Lr})}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 O({...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 SW extends D{constructor(){super(...arguments);p(this,"name","Asset Procedure Attachment");p(this,"url","/asset-procedure-type-attachments");p(this,"actions",{addOne:Yr,addMany:Jr,setOne:Qr,setMany:Zr,updateOne:Xr,updateMany:xr,deleteOne:ed,deleteMany:td,initialize:Kr});p(this,"selectors",{selectById:nd,selectByIds:ad})}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,m=new Date().toISOString();return O({file_url:u,file_sha1:c,file_extension:r,file_name:d,file_type:l,created_by:y,submitted_at:m,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 fW extends D{constructor(){super(...arguments);p(this,"name","Asset Procedure Type Fields Attachment");p(this,"url","/asset-procedure-type-fields-attachments");p(this,"actions",{addOne:dd,addMany:ld,setOne:ud,setMany:od,updateOne:hd,updateMany:pd,deleteOne:yd,deleteMany:md,initialize:rd});p(this,"selectors",{selectById:Ad,selectByIds:wd})}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 O({...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 AW extends b{constructor(){super(...arguments);p(this,"name","Asset Procedure Type Fields");p(this,"url","/asset-procedure-type-fields");p(this,"actions",{addOne:Td,addMany:Id,setOne:Fd,setMany:_d,updateOne:gd,updateMany:Rd,deleteOne:bd,deleteMany:Md,initialize:Od});p(this,"selectors",{selectById:kd,selectByIds:Vd})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,l=new Date().toISOString(),u=O({...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:_(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 wW extends D{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:Wd,addMany:oi,setOne:zd,setMany:qd,updateOne:jd,updateMany:$d,deleteOne:Cd,deleteMany:hi,initialize:Dd});p(this,"selectors",{selectById:Nd,selectByIds:Hd})}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 O({...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 PW extends b{constructor(){super(...arguments);p(this,"name","Asset Procedure Type Field Values");p(this,"url","/asset-procedure-type-field-values");p(this,"actions",{addOne:Jd,addMany:Qd,setOne:Zd,setMany:Xd,updateOne:xd,updateMany:el,deleteOne:tl,deleteMany:sl,initialize:Yd});p(this,"selectors",{selectById:al,selectByIds:cl})}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=O({...e,created_by:l,submitted_at:u}),m=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:_(y),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[y.uuid]});return this.dispatch(a(y)),m.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,m]}bulkAdd(e,n){var k;const{values:a,payloads:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),y=((k=this.client.store.getState().userReducer.currentUser)==null?void 0:k.id)??null,m=[],f=Dt(c,Math.min(n??c.length,kt)),F=[];for(const g of f){const E=[];for(const M of g){const z=O({...M,values:M.values,created_by:y,submitted_at:u});m.push(z),E.push({uuid:z.uuid,asset:M.asset,fields_revision:M.fields_revision,asset_procedure:M.asset_procedure,published_at:M.published_at,values:z.values})}F.push({submitted_at:u,values:a,field_values:E})}this.dispatch(r(m));const R=[];for(const g of F){const{field_values:E}=g,M=E.map(({asset:B})=>B),z=E.map(({fields_revision:B})=>B),j=E.map(({asset_procedure:B})=>B),W=E.map(({uuid:B})=>B),q=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:g,blockers:M.concat(z).concat(j),blocks:W});R.push(q)}return Promise.all(R).then(g=>{this.dispatch(d(g.flat()))}).catch(()=>{this.dispatch(l(v(m)))}),[m,R]}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=Gd(e)(d);this.dispatch(a(e)),this.dispatch(hi(v(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(oi(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 OW extends b{constructor(){super(...arguments);p(this,"name","Asset Procedure");p(this,"url","/asset-procedures");p(this,"actions",{addOne:ll,addMany:Si,setOne:pl,setMany:yl,updateOne:ul,updateMany:ol,deleteOne:hl,deleteMany:fi,initialize:dl});p(this,"selectors",{selectById:Al,selectByIds:wl})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,l=new Date().toISOString(),u=O({...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:_(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 TW extends b{constructor(){super(...arguments);p(this,"name","Asset Procedure Type");p(this,"url","/asset-procedure-types");p(this,"actions",{addOne:Tl,addMany:Il,setOne:bl,setMany:Ml,updateOne:Fl,updateMany:_l,deleteOne:gl,deleteMany:Rl,initialize:Ol});p(this,"selectors",{selectById:kl,selectByIds:Vl})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,l=new Date().toISOString(),u=O({...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:_(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(fi(v(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,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class IW extends D{constructor(){super(...arguments);p(this,"name","Asset Procedure Step Fields Attachment");p(this,"url","/asset-procedure-step-fields-attachments");p(this,"actions",{addOne:Wl,addMany:zl,setOne:ql,setMany:jl,updateOne:$l,updateMany:Cl,deleteOne:Ul,deleteMany:Ll,initialize:Dl});p(this,"selectors",{selectById:Hl,selectByIds:Gl})}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 O({...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 FW extends b{constructor(){super(...arguments);p(this,"name","Asset Procedure Step Fields");p(this,"url","/asset-procedure-step-fields");p(this,"actions",{addOne:Ql,addMany:Zl,setOne:Xl,setMany:xl,updateOne:eu,updateMany:tu,deleteOne:su,deleteMany:iu,initialize:Jl});p(this,"selectors",{selectById:nu,selectByIds:au})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,l=new Date().toISOString(),u=O({...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:_(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 _W extends D{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:lu,addMany:_i,setOne:uu,setMany:ou,updateOne:hu,updateMany:pu,deleteOne:yu,deleteMany:gi,initialize:du});p(this,"selectors",{selectById:Su,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 O({...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 gW extends b{constructor(){super(...arguments);p(this,"name","Asset Procedure Step Field Values");p(this,"url","/asset-procedure-step-field-values");p(this,"actions",{addOne:Tu,addMany:Iu,setOne:Fu,setMany:_u,updateOne:gu,updateMany:Ru,deleteOne:bu,deleteMany:Mu,initialize:Ou});p(this,"selectors",{selectById:Eu,selectByIds:ku})}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=O({...e,created_by:l,submitted_at:u}),m=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:_(y),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[y.uuid]});return this.dispatch(a(y)),m.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,m]}bulkAdd(e,n){var k;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),y=((k=this.client.store.getState().userReducer.currentUser)==null?void 0:k.id)??null,m=[],f=Dt(a,Math.min(n??a.length,kt)),F=[];for(const g of f){const E=[];for(const M of g){const z=O({...M,values:M.values,created_by:y,submitted_at:u});m.push(z),E.push({uuid:z.uuid,asset:M.asset,fields_revision:M.fields_revision,asset_procedure:M.asset_procedure,asset_procedure_step:M.asset_procedure_step,published_at:M.published_at,values:z.values})}F.push({submitted_at:u,values:c,field_values:E})}this.dispatch(r(m));const R=[];for(const g of F){const{field_values:E}=g,M=E.map(({asset:B})=>B),z=E.map(({fields_revision:B})=>B),j=E.map(({asset_procedure:B})=>B),W=E.map(({uuid:B})=>B),q=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:g,blockers:M.concat(z).concat(j),blocks:W});R.push(q)}return Promise.all(R).then(g=>{this.dispatch(d(g.flat()))}).catch(()=>{this.dispatch(l(v(m)))}),[m,R]}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=Au(e)(d);this.dispatch(a(e)),this.dispatch(gi(v(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(_i(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 RW extends b{constructor(){super(...arguments);p(this,"name","Asset Procedure Step");p(this,"url","/asset-procedure-steps");p(this,"actions",{addOne:qu,addMany:ju,setOne:Wu,setMany:zu,updateOne:$u,updateMany:Cu,deleteOne:Uu,deleteMany:Lu,initialize:Du});p(this,"selectors",{selectById:Hu,selectByIds:Gu})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,l=new Date().toISOString(),u=O({...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:_(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 m=Ku(e)(u);this.dispatch(d(e)),this.dispatch(a(v(m)));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(m)),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 bW extends b{constructor(){super(...arguments);p(this,"url","/assets");p(this,"name","Asset");p(this,"actions",{addOne:Qu,addMany:ki,setOne:eo,setMany:to,updateOne:Zu,updateMany:Xu,deleteOne:xu,deleteMany:Vi,initialize:Ju});p(this,"selectors",{selectById:no,selectByIds:ao})}add(e){var m;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,l=new Date().toISOString(),u=O({...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:_(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=Nr(e)(d),y=df(e)(d);this.dispatch(c(e)),this.dispatch(ii(v(u))),this.dispatch(qt(v(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(m){throw this.dispatch(a(l)),this.dispatch(si(u)),this.dispatch(zt(y)),m}}bulkAdd(e,n){const{addMany:a}=this.actions,c=new Date().toISOString(),r=Vt.v4(),d=Dt(e,Math.min(n??e.length,kt)).map(y=>{const m=y.map(f=>O(f));return{batchId:Vt.v4(),payload:{transaction_id:r,submitted_at:c,assets:m}}}),l=[];let u=null;for(const y of d){const{batchId:m,payload:f}=y,F=f.assets.map(({uuid:M})=>M),R=f.assets.map(({asset_type:M})=>M),k=f.assets.map(({project:M})=>M),g=f.assets.map(({status:M})=>M),E=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:f,blockers:(u?[u]:[]).concat(R).concat(k).concat(g),blocks:[m].concat(F)});u=y.batchId,l.push(E)}return Promise.all(l).then(y=>{const m=y.flat();this.dispatch(a(m))}),l}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,d=v(e).toSorted(Ps);if(d.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=r(d)(a.getState()).toSorted(Xs);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=Dt(e,Math.min(n??e.length,kt)),m=[];let f=null;for(const F of y){const R=Vt.v4(),k=v(F),g=F.map(({status:M})=>M).filter(Boolean),E=this.enqueueRequest({description:w(h.PATCH,this.name,!0),method:h.PATCH,url:`${this.url}/bulk/`,payload:{payloads:F},blockers:(f?[f]:[]).concat(k).concat(g),blocks:[R].concat(k)});m.push(E),f=R}return Promise.all(m).then(F=>{this.dispatch(c(F.flat()))}).catch(()=>{this.dispatch(c(l))}),[u,m]}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 MW extends b{constructor(){super(...arguments);p(this,"name","Asset Stage Completion");p(this,"url","/asset-stage-completions");p(this,"actions",{addOne:uo,addMany:oo,setOne:ho,setMany:po,updateOne:yo,updateMany:mo,deleteOne:So,deleteMany:fo,initialize:lo});p(this,"selectors",{selectById:Oo,selectByIds:To})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,l=new Date().toISOString(),u=O({...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:_(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(R=>O(R)),y=u.map(R=>({...R,created_by:l,submitted_at:d})),m=y.map(({uuid:R})=>R);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(R=>R.asset_procedure),...e.map(R=>R.asset_stage),...e.map(R=>R.asset)],blocks:m});return f.then(R=>{this.dispatch(c(R))}).catch(()=>{this.dispatch(r(m))}),[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 vW extends b{constructor(){super(...arguments);p(this,"name","Asset Stage");p(this,"url","/asset-stages");p(this,"actions",{addOne:Ro,addMany:bo,setOne:_o,setMany:go,updateOne:Mo,updateMany:vo,deleteOne:Eo,deleteMany:ko,initialize:Fo});p(this,"selectors",{selectById:Bo,selectByIds:Do})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,l=new Date().toISOString(),u=O({...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:_(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 EW extends D{constructor(){super(...arguments);p(this,"name","Asset Type Attachment");p(this,"url","/asset-type-attachments");p(this,"actions",{addOne:qo,addMany:ji,setOne:jo,setMany:$o,updateOne:Co,updateMany:Uo,deleteOne:Lo,deleteMany:$i,initialize:zo});p(this,"selectors",{selectById:Ho,selectByIds:Go})}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 O({...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 kW extends D{constructor(){super(...arguments);p(this,"name","Asset Type Fields Attachment");p(this,"url","/asset-type-fields-attachments");p(this,"actions",{addOne:Zo,addMany:Xo,setOne:xo,setMany:eh,updateOne:th,updateMany:sh,deleteOne:ih,deleteMany:nh,initialize:Qo});p(this,"selectors",{selectById:ch,selectByIds:rh})}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 O({...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 VW extends b{constructor(){super(...arguments);p(this,"name","Asset Type Fields");p(this,"url","/asset-type-fields");p(this,"actions",{addOne:oh,addMany:hh,setOne:ph,setMany:yh,updateOne:mh,updateMany:Sh,deleteOne:fh,deleteMany:Ah,initialize:uh});p(this,"selectors",{selectById:Ph,selectByIds:Oh})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,l=new Date().toISOString(),u=O({...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:_(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 BW extends D{constructor(){super(...arguments);p(this,"name","Asset Type Field Values Attachment");p(this,"url","/asset-type-field-values-attachments");p(this,"actions",{addOne:_h,addMany:Gi,setOne:gh,setMany:Rh,updateOne:bh,updateMany:Mh,deleteOne:vh,deleteMany:Ki,initialize:Fh});p(this,"selectors",{selectById:kh,selectByIds:Vh})}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 O({...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 DW extends b{constructor(){super(...arguments);p(this,"name","Asset Type Field Values");p(this,"url","/asset-type-field-values");p(this,"actions",{addOne:qh,addMany:jh,setOne:$h,setMany:Ch,updateOne:Uh,updateMany:Lh,deleteOne:Nh,deleteMany:Hh,initialize:zh});p(this,"selectors",{selectById:Kh,selectByIds:Yh})}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=O({...e,created_by:l,submitted_at:u}),m=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:_(y),blockers:[e.asset,e.fields_revision],blocks:[y.uuid]});return this.dispatch(a(y)),m.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,m]}bulkAdd(e,n){var R;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),y=[],m=Dt(a,Math.min(n??a.length,kt)),f=[];for(const k of m){const g=[];for(const E of k){const M=O({...E,values:E.values,created_by:((R=this.client.store.getState().userReducer.currentUser)==null?void 0:R.id)??null,submitted_at:u});y.push(M),g.push({uuid:M.uuid,asset:E.asset,fields_revision:E.fields_revision,published_at:E.published_at,values:M.values})}f.push({submitted_at:u,values:c,field_values:g})}this.dispatch(r(y));const F=[];for(const k of f){const{field_values:g}=k,E=g.map(({asset:W})=>W),M=g.map(({fields_revision:W})=>W),z=g.map(({uuid:W})=>W),j=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:k,blockers:E.concat(M),blocks:z});F.push(j)}return Promise.all(F).then(k=>{this.dispatch(d(k.flat()))}).catch(()=>{this.dispatch(l(v(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=Bh(e)(d);this.dispatch(a(e)),this.dispatch(Ki(v(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(Gi(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 WW extends b{constructor(){super(...arguments);p(this,"name","Asset Type Identifier");p(this,"url","/asset-type-identifiers");p(this,"actions",{addOne:Xh,addMany:xh,setOne:ep,setMany:tp,updateOne:sp,updateMany:ip,deleteOne:np,deleteMany:ap,initialize:Zh});p(this,"selectors",{selectById:rp,selectByIds:dp})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,l=new Date().toISOString(),u=O({...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:_(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 zW extends b{constructor(){super(...arguments);p(this,"name","Asset Type Identifier Value");p(this,"url","/asset-type-identifier-values");p(this,"actions",{addOne:hp,addMany:pp,setOne:yp,setMany:mp,updateOne:Sp,updateMany:fp,deleteOne:Ap,deleteMany:wp,initialize:op});p(this,"selectors",{selectById:Op,selectByIds:Tp})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,l=new Date().toISOString(),u=O({...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:_(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 k;const{store:a}=this.client,{addMany:c,updateMany:r,deleteMany:d}=this.actions,l=new Date().toISOString(),u=((k=a.getState().userReducer.currentUser)==null?void 0:k.id)??null,y=Dt(e,Math.min(n??e.length,kt)),m=[],f=[];for(const g of y){const E=[],M=[],z=[];for(const W of g){const q=O({...W,submitted_at:l,created_by:u});f.push(q);const B={uuid:q.uuid,asset:q.asset,asset_type_identifier:q.asset_type_identifier,value:q.value};E.push(B),M.push(q.asset),M.push(q.asset_type_identifier),z.push(q.uuid)}const j={payloads:E,submitted_at:l,blockers:M,blocks:z};m.push(j)}this.dispatch(c(f));const F=m.map(g=>{const{payloads:E,submitted_at:M,blockers:z,blocks:j}=g;return this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:M,payloads:E},blockers:z,blocks:j})});Promise.all(F).then(g=>{this.dispatch(r(g.flat()))}).catch(g=>{throw this.dispatch(d(v(f))),g});const R=Promise.all(F).then(g=>g.flat());return[f,R]}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 qW extends b{constructor(){super(...arguments);p(this,"name","Asset Type");p(this,"url","/asset-types");p(this,"actions",{addOne:bp,addMany:Mp,setOne:gp,setMany:Rp,updateOne:vp,updateMany:Ep,deleteOne:kp,deleteMany:Vp,initialize:_p});p(this,"selectors",{selectById:Dp,selectByIds:Wp})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,l=new Date().toISOString(),u=O({...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:_(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=io(e)(d),y=Ko(e)(d);this.dispatch(a(e)),this.dispatch(Vi(v(u))),this.dispatch($i(v(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(m){throw this.dispatch(c(l)),this.dispatch(ki(u)),this.dispatch(ji(y)),m}}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 b{constructor(){super(...arguments);p(this,"name","Asset Type Status");p(this,"url","/asset-type-statuses");p(this,"actions",{addOne:$p,addMany:Cp,setOne:Up,setMany:Lp,updateOne:Np,updateMany:Hp,deleteOne:Gp,deleteMany:Kp,initialize:jp});p(this,"selectors",{selectById:Jp,selectByIds:Qp})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,l=new Date().toISOString(),u=O({...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:_(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 $W extends D{constructor(){super(...arguments);p(this,"name","Document Attachment");p(this,"url","/document-attachments");p(this,"actions",{addOne:iy,addMany:ny,setOne:ay,setMany:cy,updateOne:ry,updateMany:dy,deleteOne:ly,deleteMany:uy,initialize:sy});p(this,"selectors",{selectById:hy,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 O({...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 CW extends b{constructor(){super(...arguments);p(this,"name","Document");p(this,"url","/documents");p(this,"actions",{addOne:fy,addMany:Ay,setOne:wy,setMany:Py,updateOne:Oy,updateMany:Ty,deleteOne:Iy,deleteMany:Fy,initialize:Sy});p(this,"selectors",{selectById:gy,selectByIds:Ry})}add(e){var m;const{store:n}=this.client,{addOne:a,deleteOne:c,updateOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,l=new Date().toISOString(),u=O({...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:_(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 m=by(e)(u);this.dispatch(a(e)),this.dispatch(d(v(m)));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(m)),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 Wt extends $t{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 UW extends Wt{constructor(){super(...arguments);p(this,"name","Email Domains");p(this,"url","/organization-email-domains");p(this,"actions",{addOne:Ey,addMany:ky,setOne:Vy,setMany:By,updateOne:Dy,updateMany:Wy,deleteOne:zy,deleteMany:qy,initialize:vy});p(this,"selectors",{selectById:$y,selectByIds:Cy})}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 LW extends $t{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 fs={},Zc=new Set;class NW extends $t{constructor(){super(...arguments);p(this,"host");p(this,"dbPromise",kk.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 ws(e);if(Zc.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),Zc.add(n)}async removeCache(e){await(await this.getDB()).delete("files",e),Zc.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 fs?d=fs[c]:Ar(e)?(d=fr(e,a),fs[c]=d):(d=new Promise(y=>{this.performRequest({method:h.GET,url:e,isExternalUrl:!0,isResponseBlob:!0,isAuthNeeded:!1}).then(m=>{const f=new File([m],a,{type:m.type});y(f)})}),fs[c]=d);let l;try{l=await d}catch(y){throw y instanceof C&&delete fs[c],y}const u=await ws(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 ws(e),file_type:e.type,extension:mr(e),size:e.size};return await this.client.files.addCache(e),a}}class YW extends M{constructor(){super(...arguments);p(this,"name","Form Identifier");p(this,"url","/form-identifiers");p(this,"actions",{addOne:Yy,addMany:Jy,setOne:Qy,setMany:Zy,updateOne:Xy,updateMany:xy,deleteOne:em,deleteMany:tm,initialize:Ky});p(this,"selectors",{selectById:im,selectByIds:nm})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.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:b(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 JW extends M{constructor(){super(...arguments);p(this,"name","Form Identifier Value");p(this,"url","/form-identifier-values");p(this,"actions",{addOne:dm,addMany:lm,setOne:um,setMany:om,updateOne:hm,updateMany:pm,deleteOne:ym,deleteMany:mm,initialize:rm});p(this,"selectors",{selectById:fm,selectByIds:Am})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.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:b(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 QW extends z{constructor(){super(...arguments);p(this,"name","Form Revision Attachment");p(this,"url","/form-revision-attachments");p(this,"actions",{addOne:Om,addMany:Im,setOne:Fm,setMany:_m,updateOne:gm,updateMany:Rm,deleteOne:bm,deleteMany:Mm,initialize:Tm});p(this,"selectors",{selectById:km,selectByIds:Em})}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 ZW extends M{constructor(){super(...arguments);p(this,"name","Form Revision");p(this,"url","/form-revisions");p(this,"actions",{addOne:Wm,addMany:fn,setOne:zm,setMany:qm,updateOne:jm,updateMany:$m,deleteOne:Cm,deleteMany:An,initialize:Dm});p(this,"selectors",{selectById:Lm,selectByIds:Nm})}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 m=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(y),blockers:[e.form],blocks:[y.uuid]});return m.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,m]}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 XW extends M{constructor(){super(...arguments);p(this,"name","Form");p(this,"url","/forms");p(this,"actions",{addOne:Jm,addMany:Qm,setOne:Zm,setMany:Xm,updateOne:xm,updateMany:eS,deleteOne:tS,deleteMany:sS,initialize:Ym});p(this,"selectors",{selectById:aS,selectByIds:cS})}add(e){var m;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((m=n.getState().userReducer.currentUser)==null?void 0:m.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:b(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 form 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 form to exist");const u=vS(e)(d),y=Hm(e)(d);this.dispatch(a(e)),this.dispatch(Mn(E(u))),this.dispatch(An(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(m){throw this.dispatch(c(l)),this.dispatch(fn(y)),this.dispatch(bn(u)),m}}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 z{constructor(){super(...arguments);p(this,"name","Form Submission Attachment");p(this,"url","/form-submission-attachments");p(this,"actions",{addOne:lS,addMany:On,setOne:uS,setMany:oS,updateOne:hS,updateMany:pS,deleteOne:yS,deleteMany:In,initialize:dS});p(this,"selectors",{selectById:mS,selectByIds:SS})}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=gn(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 ez extends M{constructor(){super(...arguments);p(this,"name","Form Submission");p(this,"url","/form-submissions");p(this,"actions",{addOne:IS,addMany:bn,setOne:TS,setMany:OS,updateOne:FS,updateMany:_S,deleteOne:gS,deleteMany:Mn,initialize:PS});p(this,"selectors",{selectById:bS,selectByIds:MS})}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}),m=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(y),blockers:[e.form_revision],blocks:[y.uuid]});return this.dispatch(a(y)),m.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,m]}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=fS(e)(d);this.dispatch(a(e)),this.dispatch(In(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(On(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 tz extends z{constructor(){super(...arguments);p(this,"name","Geo Image");p(this,"url","/geo-images");p(this,"actions",{addOne:WS,addMany:zS,setOne:BS,setMany:DS,updateOne:qS,updateMany:jS,deleteOne:$S,deleteMany:CS,initialize:VS});p(this,"selectors",{selectById:LS,selectByIds:NS})}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 sz extends M{constructor(){super(...arguments);p(this,"name","Issue Association");p(this,"url","/issue-associations");p(this,"actions",{addOne:XS,addMany:zt,setOne:JS,setMany:YS,updateOne:QS,updateMany:ZS,deleteOne:xS,deleteMany:qt,initialize:KS});p(this,"selectors",{selectById:tf,selectByIds:sf})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((m=n.getState().userReducer.currentUser)==null?void 0:m.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:b(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 iz extends z{constructor(){super(...arguments);p(this,"name","Issue Attachment");p(this,"url","/issue-attachments");p(this,"actions",{addOne:hf,addMany:Dn,setOne:pf,setMany:yf,updateOne:mf,updateMany:Sf,deleteOne:ff,deleteMany:Wn,initialize:of});p(this,"selectors",{selectById:Pf,selectByIds:Tf})}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 nz extends z{constructor(){super(...arguments);p(this,"name","Issue Comment Attachment");p(this,"url","/issue-comment-attachments");p(this,"actions",{addOne:_f,addMany:gf,setOne:Rf,setMany:bf,updateOne:Mf,updateMany:vf,deleteOne:kf,deleteMany:Ef,initialize:Ff});p(this,"selectors",{selectById:Bf,selectByIds:Df})}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 az extends M{constructor(){super(...arguments);p(this,"name","Issue Comment");p(this,"url","/issue-comments");p(this,"actions",{addOne:jf,addMany:$f,setOne:Cf,setMany:Uf,updateOne:Lf,updateMany:Nf,deleteOne:Hf,deleteMany:Gf,initialize:qf});p(this,"selectors",{selectById:Kf,selectByIds:Yf})}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:b(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 cz extends M{constructor(){super(...arguments);p(this,"name","Issue");p(this,"url","/issues");p(this,"actions",{addOne:Xf,addMany:Ln,setOne:xf,setMany:eA,updateOne:tA,updateMany:sA,deleteOne:iA,deleteMany:Nn,initialize:Zf});p(this,"selectors",{selectById:aA,selectByIds:cA})}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 m=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(y),blockers:[y.project,y.issue_type,y.status],blocks:[y.uuid]});return m.then(F=>{this.dispatch(c(F))}).catch(F=>{throw this.dispatch(r(y.uuid)),F}),[y,m]}update(e){var m;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=da(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=qs(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:((m=c.userReducer.currentUser)==null?void 0:m.id)??null,submitted_at:new Date().toISOString(),issue:r.uuid,changes:l});this.dispatch(ua(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(ha(u.uuid))}),[d,y]}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,d=E(e).toSorted(Ps);if(d.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=r(d)(a.getState()).toSorted(xs);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)),m=[];let f=null;for(const F of y){const g=Bt.v4(),k=E(F),_=F.map(({status:R})=>R).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(k).concat(_),blocks:[g].concat(k)});m.push(v),f=g}return Promise.all(m).then(F=>{this.dispatch(c(F.flat()))}).catch(()=>{this.dispatch(c(l))}),[u,m]}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=nf(e)(d),y=rf(e)(d),m=Ob(e)(d),f=wf(e)(d),F=VP(e)(d);this.dispatch(a(e)),this.dispatch(Wn(E(f))),this.dispatch(pa(E(F))),this.dispatch(qt(E(u))),this.dispatch(qt(E(y))),this.dispatch(os(E(m)));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(Dn(f)),this.dispatch(oa(F)),this.dispatch(zt(u)),this.dispatch(zt(y)),this.dispatch(us(m)),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=af(e)(d),y=cf(e)(d),m=Tb(e)(d);this.dispatch(c(e)),this.dispatch(qt(E(u))),this.dispatch(qt(E(y))),this.dispatch(os(E(m)));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(zt(u)),this.dispatch(zt(y)),this.dispatch(us(m)),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 rz extends z{constructor(){super(...arguments);p(this,"name","Issue Type Attachment");p(this,"url","/issue-type-attachments");p(this,"actions",{addOne:oA,addMany:hA,setOne:pA,setMany:yA,updateOne:mA,updateMany:SA,deleteOne:fA,deleteMany:AA,initialize:uA});p(this,"selectors",{selectById:PA,selectByIds:TA})}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 dz extends z{constructor(){super(...arguments);p(this,"name","Issue Type Fields Attachment");p(this,"url","/issue-type-fields-attachments");p(this,"actions",{addOne:_A,addMany:gA,setOne:RA,setMany:bA,updateOne:MA,updateMany:vA,deleteOne:kA,deleteMany:EA,initialize:FA});p(this,"selectors",{selectById:BA,selectByIds:DA})}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 lz extends M{constructor(){super(...arguments);p(this,"name","Issue Type Fields");p(this,"url","/issue-type-fields");p(this,"actions",{addOne:xA,addMany:ew,setOne:tw,setMany:sw,updateOne:iw,updateMany:nw,deleteOne:aw,deleteMany:cw,initialize:XA});p(this,"selectors",{selectById:dw,selectByIds:lw})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.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:b(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 uz 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:Xn,setOne:yw,setMany:mw,updateOne:Sw,updateMany:fw,deleteOne:Aw,deleteMany:xn,initialize:hw});p(this,"selectors",{selectById:Pw,selectByIds:Tw})}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 oz extends M{constructor(){super(...arguments);p(this,"name","Issue Type Field Values");p(this,"url","/issue-type-field-values");p(this,"actions",{addOne:jA,addMany:$A,setOne:CA,setMany:UA,updateOne:LA,updateMany:NA,deleteOne:HA,deleteMany:GA,initialize:qA});p(this,"selectors",{selectById:YA,selectByIds:JA})}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}),m=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(y),blockers:[e.issue,e.fields_revision],blocks:[y.uuid]});return this.dispatch(a(y)),m.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,m]}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=Ow(e)(d);this.dispatch(a(e)),this.dispatch(xn(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(Xn(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 hz extends M{constructor(){super(...arguments);p(this,"name","Issue Type Identifier");p(this,"url","/issue-type-identifiers");p(this,"actions",{addOne:gw,addMany:Rw,setOne:bw,setMany:Mw,updateOne:vw,updateMany:kw,deleteOne:Ew,deleteMany:Vw,initialize:_w});p(this,"selectors",{selectById:Dw,selectByIds:Ww})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.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:b(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 pz extends M{constructor(){super(...arguments);p(this,"name","Issue Type Identifier Value");p(this,"url","/issue-type-identifier-values");p(this,"actions",{addOne:$w,addMany:Cw,setOne:Uw,setMany:Lw,updateOne:Nw,updateMany:Hw,deleteOne:Gw,deleteMany:Kw,initialize:jw});p(this,"selectors",{selectById:Jw,selectByIds:Qw})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.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:b(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 yz extends M{constructor(){super(...arguments);p(this,"name","Issue Type");p(this,"url","/issue-types");p(this,"actions",{addOne:eP,addMany:tP,setOne:sP,setMany:iP,updateOne:nP,updateMany:aP,deleteOne:cP,deleteMany:rP,initialize:xw});p(this,"selectors",{selectById:lP,selectByIds:uP})}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 m=this.enqueueRequest({method:h.POST,url:`${this.url}/`,payload:b(y),blockers:[],blocks:[y.uuid]});return m.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,m]}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=rA(e)(d);this.dispatch(a(e)),this.dispatch(Nn(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(Ln(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 mz extends M{constructor(){super(...arguments);p(this,"name","Issue Type Status");p(this,"url","/issue-type-statuses");p(this,"actions",{addOne:yP,addMany:mP,setOne:SP,setMany:fP,updateOne:AP,updateMany:wP,deleteOne:PP,deleteMany:TP,initialize:pP});p(this,"selectors",{selectById:da,selectByIds:IP})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.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:b(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 Sz extends M{constructor(){super(...arguments);p(this,"name","Issue Update");p(this,"url","/issue-updates");p(this,"actions",{addOne:ua,addMany:oa,setOne:RP,setMany:bP,updateOne:MP,updateMany:vP,deleteOne:ha,deleteMany:pa,initialize:gP});p(this,"selectors",{selectById:kP,selectByIds:EP})}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 fz=1800;function Az(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 wz extends SW{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(xp(!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=BE(e).exp??n}catch{a=n}return a-n<fz}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(Az(a))})}}class Pz extends Wt{constructor(){super(...arguments);p(this,"name","Organization Access");p(this,"url","/organization-accesses");p(this,"actions",{addOne:YP,addMany:JP,setOne:QP,setMany:ZP,updateOne:XP,updateMany:xP,deleteOne:eT,deleteMany:tT,initialize:KP});p(this,"selectors",{selectById:iT,selectByIds:nT})}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=qs(l.user)(d);this.dispatch(a(l.uuid)),this.dispatch(Aa(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 Tz extends Wt{constructor(){super(...arguments);p(this,"name","Organization");p(this,"url","/organizations");p(this,"actions",{addOne:oT,addMany:uT,setOne:lT,setMany:dT,updateOne:pT,updateMany:hT,deleteOne:yT,deleteMany:mT,initialize:rT});p(this,"selectors",{selectById:AT,selectByIds:wT})}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 Oz extends M{constructor(){super(...arguments);p(this,"name","Project Access");p(this,"url","/project-accesses");p(this,"actions",{addOne:MT,addMany:vT,setOne:kT,setMany:ET,updateOne:VT,updateMany:BT,deleteOne:DT,deleteMany:WT,initialize:bT});p(this,"selectors",{selectById:qT,selectByIds:jT})}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:b(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(m=>P({...m,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(m=>b(m))},blockers:l.flatMap(m=>[m.project,m.organization_access]),blocks:l.map(m=>m.uuid)});return u.then(m=>{this.dispatch(r(m))}).catch(m=>{throw this.dispatch(c(l.map(f=>f.uuid))),m}),[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 Iz extends z{constructor(){super(...arguments);p(this,"name","Project Attachment");p(this,"url","/project-attachments");p(this,"actions",{addOne:UT,addMany:LT,setOne:NT,setMany:HT,updateOne:GT,updateMany:KT,deleteOne:YT,deleteMany:JT,initialize:CT});p(this,"selectors",{selectById:ZT,selectByIds:XT})}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 Fz extends z{constructor(){super(...arguments);p(this,"name","Project File");p(this,"url","/project-files");p(this,"actions",{addOne:nO,addMany:aO,setOne:sO,setMany:iO,updateOne:cO,updateMany:rO,deleteOne:dO,deleteMany:lO,initialize:tO});p(this,"selectors",{selectById:hO,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 _z extends Wt{constructor(){super(...arguments);p(this,"name","Project");p(this,"url","/projects");p(this,"actions",{addOne:PO,addMany:wO,setOne:AO,setMany:fO,updateOne:OO,updateMany:TO,deleteOne:IO,deleteMany:FO,initialize:SO});p(this,"selectors",{selectById:RO,selectByIds:bO})}async add(e){const{addOne:n}=this.actions,a=await this.performRequest({method:h.POST,url:`${this.url}/`,payload:b(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:b(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 mE=(...t)=>t.filter(s=>s!==null);class gz extends M{constructor(){super(...arguments);p(this,"name","Procedure");p(this,"url","/procedures");p(this,"actions",{addOne:kO,addMany:va,setOne:EO,setMany:VO,updateOne:BO,updateMany:DO,deleteOne:WO,deleteMany:ka,initialize:vO});p(this,"selectors",{selectById:jO,selectByIds:$O})}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:b(d),blockers:mE(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:mE(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 Rz extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Assignee");p(this,"url","/procedure-step-assignees");p(this,"actions",{addOne:NO,addMany:HO,setOne:GO,setMany:KO,updateOne:YO,updateMany:JO,deleteOne:QO,deleteMany:ZO,initialize:LO});p(this,"selectors",{selectById:xO,selectByIds:eI})}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:b(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 m;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.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=>b(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:nI,addMany:aI,setOne:cI,setMany:rI,updateOne:dI,updateMany:lI,deleteOne:uI,deleteMany:oI,initialize:iI});p(this,"selectors",{selectById:pI,selectByIds:yI})}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:b(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 Mz extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Default Assignee");p(this,"url","/procedure-step-default-assignees");p(this,"actions",{addOne:AI,addMany:wI,setOne:PI,setMany:TI,updateOne:OI,updateMany:II,deleteOne:FI,deleteMany:_I,initialize:fI});p(this,"selectors",{selectById:RI,selectByIds:bI})}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:b(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 vz extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Default Reviewer");p(this,"url","/procedure-step-default-reviewers");p(this,"actions",{addOne:EI,addMany:VI,setOne:BI,setMany:DI,updateOne:WI,updateMany:zI,deleteOne:qI,deleteMany:jI,initialize:kI});p(this,"selectors",{selectById:CI,selectByIds:UI})}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:b(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 kz extends Wt{constructor(){super(...arguments);p(this,"name","Procedure Step Event");p(this,"url","/procedure-step-events");p(this,"actions",{addOne:GI,addMany:KI,setOne:YI,setMany:JI,updateOne:QI,updateMany:ZI,deleteOne:XI,deleteMany:xI,initialize:HI});p(this,"selectors",{selectById:tF,selectByIds:sF})}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 Ez extends z{constructor(){super(...arguments);p(this,"name","Procedure Step Fields Attachment");p(this,"url","/procedure-step-fields-attachments");p(this,"actions",{addOne:cF,addMany:$a,setOne:rF,setMany:dF,updateOne:lF,updateMany:uF,deleteOne:oF,deleteMany:Ca,initialize:aF});p(this,"selectors",{selectById:yF,selectByIds:mF})}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 Vz extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Fields");p(this,"url","/procedure-step-fields");p(this,"actions",{addOne:wF,addMany:PF,setOne:TF,setMany:OF,updateOne:IF,updateMany:FF,deleteOne:_F,deleteMany:gF,initialize:AF});p(this,"selectors",{selectById:RF,selectByIds:bF})}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:b(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(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($a(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 Bz 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:EF,addMany:Ga,setOne:VF,setMany:BF,updateOne:DF,updateMany:WF,deleteOne:zF,deleteMany:Ka,initialize:kF});p(this,"selectors",{selectById:jF,selectByIds:$F})}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 Dz 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:a_,addMany:Za,setOne:c_,setMany:r_,updateOne:d_,updateMany:l_,deleteOne:u_,deleteMany:Xa,initialize:n_});p(this,"selectors",{selectById:h_,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:b(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 Wz extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Field Values");p(this,"url","/procedure-step-field-values");p(this,"actions",{addOne:HF,addMany:GF,setOne:KF,setMany:YF,updateOne:JF,updateMany:QF,deleteOne:ZF,deleteMany:XF,initialize:NF});p(this,"selectors",{selectById:e_,selectByIds:t_})}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}),m=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(y),blockers:[e.procedure,e.procedure_step,e.fields_revision],blocks:[y.uuid]});return this.dispatch(a(y)),m.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,m]}bulkAdd(e,n){var k;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),y=((k=this.client.store.getState().userReducer.currentUser)==null?void 0:k.id)??null,m=[],f=N(a,Math.min(n??a.length,L)),F=[];for(const _ of f){const v=[];for(const R of _){const D=P({...R,values:R.values,created_by:y,submitted_at:u});m.push(D),v.push({uuid:D.uuid,fields_revision:R.fields_revision,procedure:R.procedure,procedure_step:R.procedure_step,published_at:R.published_at,values:D.values})}F.push({submitted_at:u,values:c,field_values:v})}this.dispatch(r(m));const g=[];for(const _ of F){const{field_values:v}=_,R=v.map(({fields_revision:V})=>V),D=v.map(({procedure:V})=>V),j=v.map(({procedure_step:V})=>V),W=v.map(({uuid:V})=>V),q=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:_,blockers:R.concat(D).concat(j),blocks:W});g.push(q)}return Promise.all(g).then(_=>{this.dispatch(d(_.flat()))}).catch(()=>{this.dispatch(l(E(m)))}),[m,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=CF(e)(d),y=y_(e)(d);this.dispatch(a(e)),this.dispatch(Ka(E(u))),this.dispatch(Xa(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(m){throw this.dispatch(c(l)),this.dispatch(Ga(u)),this.dispatch(Za(y)),m}}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 zz extends M{constructor(){super(...arguments);p(this,"name","Procedure Step Reviewer");p(this,"url","/procedure-step-reviewers");p(this,"actions",{addOne:A_,addMany:w_,setOne:P_,setMany:T_,updateOne:O_,updateMany:I_,deleteOne:F_,deleteMany:__,initialize:f_});p(this,"selectors",{selectById:R_,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:b(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 m;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.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=>b(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 qz extends M{constructor(){super(...arguments);p(this,"name","Procedure Step");p(this,"url","/procedure-steps");p(this,"actions",{addOne:B_,addMany:D_,setOne:E_,setMany:V_,updateOne:W_,updateMany:z_,deleteOne:q_,deleteMany:j_,initialize:k_});p(this,"selectors",{selectById:C_,selectByIds:U_})}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:b(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,{addOne:a,deleteOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No procedure step with uuid ${e} found in the store`);this.dispatch(c(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(a(l)),u}}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 jz extends z{constructor(){super(...arguments);p(this,"name","Procedure Type Attachment");p(this,"url","/procedure-type-attachments");p(this,"actions",{addOne:H_,addMany:G_,setOne:K_,setMany:Y_,updateOne:J_,updateMany:Q_,deleteOne:Z_,deleteMany:X_,initialize:N_});p(this,"selectors",{selectById:tg,selectByIds:sg})}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,m=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:m,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 $z extends z{constructor(){super(...arguments);p(this,"name","Procedure Type Fields Attachment");p(this,"url","/procedure-type-fields-attachments");p(this,"actions",{addOne:ag,addMany:cg,setOne:rg,setMany:dg,updateOne:lg,updateMany:ug,deleteOne:og,deleteMany:hg,initialize:ng});p(this,"selectors",{selectById:mg,selectByIds:Sg})}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 Cz extends M{constructor(){super(...arguments);p(this,"name","Procedure Type Fields");p(this,"url","/procedure-type-fields");p(this,"actions",{addOne:wg,addMany:Pg,setOne:Tg,setMany:Og,updateOne:Ig,updateMany:Fg,deleteOne:_g,deleteMany:gg,initialize:Ag});p(this,"selectors",{selectById:Mg,selectByIds:vg})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.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:b(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 Uz extends z{constructor(){super(...arguments);p(this,"name","Procedure Field Values Attachment");p(this,"url","/procedure-field-values-attachments");p(this,"actions",{addOne:Vg,addMany:lc,setOne:Bg,setMany:Dg,updateOne:Wg,updateMany:zg,deleteOne:qg,deleteMany:uc,initialize:Eg});p(this,"selectors",{selectById:Cg,selectByIds:Ug})}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 Lz extends M{constructor(){super(...arguments);p(this,"name","Procedure Field Values");p(this,"url","/procedure-field-values");p(this,"actions",{addOne:Gg,addMany:Kg,setOne:Yg,setMany:Jg,updateOne:Qg,updateMany:Zg,deleteOne:Xg,deleteMany:xg,initialize:Hg});p(this,"selectors",{selectById:sR,selectByIds:iR})}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}),m=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(y),blockers:[e.fields_revision,e.procedure],blocks:[y.uuid]});return this.dispatch(a(y)),m.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,m]}bulkAdd(e,n){var k;const{values:a,payloads:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),y=((k=this.client.store.getState().userReducer.currentUser)==null?void 0:k.id)??null,m=[],f=N(c,Math.min(n??c.length,L)),F=[];for(const _ of f){const v=[];for(const R of _){const D=P({...R,values:R.values,created_by:y,submitted_at:u});m.push(D),v.push({uuid:D.uuid,fields_revision:R.fields_revision,procedure:R.procedure,published_at:R.published_at,values:D.values})}F.push({submitted_at:u,values:a,field_values:v})}this.dispatch(r(m));const g=[];for(const _ of F){const{field_values:v}=_,R=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:R.concat(D),blocks:j});g.push(W)}return Promise.all(g).then(_=>{this.dispatch(d(_.flat()))}).catch(()=>{this.dispatch(l(E(m)))}),[m,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 ProcedureFieldValues 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=Lg(e)(d);this.dispatch(a(e)),this.dispatch(uc(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(lc(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 Nz extends M{constructor(){super(...arguments);p(this,"name","Procedure Type");p(this,"url","/procedure-types");p(this,"actions",{addOne:cR,addMany:rR,setOne:dR,setMany:lR,updateOne:uR,updateMany:oR,deleteOne:hR,deleteMany:pR,initialize:aR});p(this,"selectors",{selectById:SR,selectByIds:fR})}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:b(l),blockers:[],blocks:[l.uuid]});return u.then(m=>{this.dispatch(c(m))}).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=CO(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(va(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 M{constructor(){super(...arguments);p(this,"name","Team Membership");p(this,"url","/team-memberships");p(this,"actions",{addOne:TR,addMany:OR,setOne:IR,setMany:FR,updateOne:_R,updateMany:gR,deleteOne:RR,deleteMany:bR,initialize:PR});p(this,"selectors",{selectById:kR,selectByIds:ER})}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:b(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(m=>P({...m,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(m=>b(m))},blockers:l.map(m=>m.team),blocks:l.map(m=>m.uuid)});return u.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(l.map(m=>m.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 Gz extends M{constructor(){super(...arguments);p(this,"name","Team");p(this,"url","/teams");p(this,"actions",{addOne:DR,addMany:WR,setOne:zR,setMany:qR,updateOne:jR,updateMany:$R,deleteOne:CR,deleteMany:UR,initialize:BR});p(this,"selectors",{selectById:NR,selectByIds:HR})}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:b(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:b(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 Kz extends Wt{constructor(){super(...arguments);p(this,"name","User");p(this,"url","/user");p(this,"actions",{addOne:fa,addMany:jP,setOne:qP,setMany:zP,updateOne:CP,updateMany:$P,deleteOne:Aa,deleteMany:UP,initialize:WP});p(this,"selectors",{selectById:qs,selectByIds:HP})}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 Yz extends M{constructor(){super(...arguments);p(this,"name","Workflow");p(this,"url","/workflows");p(this,"actions",{addOne:ZR,addMany:XR,setOne:xR,setMany:eb,updateOne:tb,updateMany:sb,deleteOne:ib,deleteMany:nb,initialize:QR});p(this,"selectors",{selectById:cb,selectByIds:rb})}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:b(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=Pb(e)(d);this.dispatch(a(e)),this.dispatch(os(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(us(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 Jz extends M{constructor(){super(...arguments);p(this,"name","Workflow Issue Link");p(this,"url","/workflow-issue-links");p(this,"actions",{addOne:ob,addMany:us,setOne:hb,setMany:pb,updateOne:yb,updateMany:mb,deleteOne:Sb,deleteMany:os,initialize:ub});p(this,"selectors",{selectById:Ab,selectByIds:wb})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((m=n.getState().userReducer.currentUser)==null?void 0:m.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:b(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 Qz extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Assignee");p(this,"url","/workflow-step-assignees");p(this,"actions",{addOne:gb,addMany:Rb,setOne:bb,setMany:Mb,updateOne:vb,updateMany:kb,deleteOne:Eb,deleteMany:Vb,initialize:_b});p(this,"selectors",{selectById:Db,selectByIds:Wb})}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:b(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 m;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.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=>b(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 Zz extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Comment");p(this,"url","/workflow-step-comments");p(this,"actions",{addOne:$b,addMany:Cb,setOne:Ub,setMany:Lb,updateOne:Nb,updateMany:Hb,deleteOne:Gb,deleteMany:Kb,initialize:jb});p(this,"selectors",{selectById:Jb,selectByIds:Qb})}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:b(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 Xz extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Default Assignee");p(this,"url","/workflow-step-default-assignees");p(this,"actions",{addOne:eM,addMany:tM,setOne:sM,setMany:iM,updateOne:nM,updateMany:aM,deleteOne:cM,deleteMany:rM,initialize:xb});p(this,"selectors",{selectById:lM,selectByIds:uM})}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:b(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 xz extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Default Reviewer");p(this,"url","/workflow-step-default-reviewers");p(this,"actions",{addOne:yM,addMany:mM,setOne:SM,setMany:fM,updateOne:AM,updateMany:wM,deleteOne:PM,deleteMany:TM,initialize:pM});p(this,"selectors",{selectById:IM,selectByIds:FM})}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:b(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 eq extends Wt{constructor(){super(...arguments);p(this,"name","Workflow Step Event");p(this,"url","/workflow-step-events");p(this,"actions",{addOne:bM,addMany:MM,setOne:vM,setMany:kM,updateOne:EM,updateMany:VM,deleteOne:BM,deleteMany:DM,initialize:RM});p(this,"selectors",{selectById:zM,selectByIds:qM})}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 z{constructor(){super(...arguments);p(this,"name","Workflow Step Fields Attachment");p(this,"url","/workflow-step-fields-attachments");p(this,"actions",{addOne:UM,addMany:Mc,setOne:LM,setMany:NM,updateOne:HM,updateMany:GM,deleteOne:KM,deleteMany:vc,initialize:CM});p(this,"selectors",{selectById:QM,selectByIds:ZM})}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 sq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Fields");p(this,"url","/workflow-step-fields");p(this,"actions",{addOne:tv,addMany:sv,setOne:iv,setMany:nv,updateOne:av,updateMany:cv,deleteOne:rv,deleteMany:dv,initialize:ev});p(this,"selectors",{selectById:uv,selectByIds:ov})}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:b(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=JM(e)(d);this.dispatch(a(e)),this.dispatch(vc(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(Mc(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 iq 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:mv,addMany:Bc,setOne:Sv,setMany:fv,updateOne:Av,updateMany:wv,deleteOne:Pv,deleteMany:Dc,initialize:yv});p(this,"selectors",{selectById:Ov,selectByIds:Iv})}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 nq 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:Uv,addMany:jc,setOne:Lv,setMany:Nv,updateOne:Hv,updateMany:Gv,deleteOne:Kv,deleteMany:$c,initialize:Cv});p(this,"selectors",{selectById:Jv,selectByIds:Qv})}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:b(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 aq 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:tk,addMany:Uc,setOne:sk,setMany:ik,updateOne:nk,updateMany:ak,deleteOne:ck,deleteMany:Lc,initialize:ek});p(this,"selectors",{selectById:dk,selectByIds:lk})}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:b(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 cq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Field Values");p(this,"url","/workflow-step-field-values");p(this,"actions",{addOne:bv,addMany:Mv,setOne:vv,setMany:kv,updateOne:Ev,updateMany:Vv,deleteOne:Bv,deleteMany:Dv,initialize:Rv});p(this,"selectors",{selectById:zv,selectByIds:qv})}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:b(l),blockers:[e.workflow,e.workflow_step,e.fields_revision],blocks:[l.uuid]});return this.dispatch(a(l)),u.then(m=>{this.dispatch(c(m))}).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=Fv(e)(d),y=uk(e)(d),m=Zv(e)(d);this.dispatch(a(e)),this.dispatch(Dc(E(u))),this.dispatch(Lc(E(y))),this.dispatch($c(E(m)));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(Bc(u)),this.dispatch(Uc(y)),this.dispatch(jc(m)),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 rq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Reviewer");p(this,"url","/workflow-step-reviewers");p(this,"actions",{addOne:yk,addMany:mk,setOne:Sk,setMany:fk,updateOne:Ak,updateMany:wk,deleteOne:Pk,deleteMany:Tk,initialize:pk});p(this,"selectors",{selectById:Ik,selectByIds:Fk})}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:b(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 m;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.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=>b(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 dq extends M{constructor(){super(...arguments);p(this,"name","Workflow Step");p(this,"url","/workflow-steps");p(this,"actions",{addOne:bk,addMany:Mk,setOne:vk,setMany:kk,updateOne:Ek,updateMany:Vk,deleteOne:Bk,deleteMany:Dk,initialize:Rk});p(this,"selectors",{selectById:zk,selectByIds:qk})}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:b(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 lq extends M{constructor(){super(...arguments);p(this,"name","Workflow Type");p(this,"url","/workflow-types");p(this,"actions",{addOne:Uk,addMany:Lk,setOne:Nk,setMany:Hk,updateOne:Gk,updateMany:Kk,deleteOne:Yk,deleteMany:Jk,initialize:Ck});p(this,"selectors",{selectById:Zk,selectByIds:Xk})}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:b(l),blockers:[],blocks:[l.uuid]});return u.then(m=>{this.dispatch(c(m))}).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 Xc(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:m,attachmentHash:f,isExternalUrl:F,isAuthNeeded:g,isResponseBlob:k}={...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 R=V=>{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 V.set("x-amz-checksum-sha1",H).field({...l,...d.fields}).attach("file",v)}return V.send(l)},j={[h.GET]:()=>k?Lt.get(_.toString()).responseType("blob"):Lt.get(_.toString()),[h.POST]:()=>{const V=Lt.post(_.toString());return R(V)},[h.PATCH]:()=>{const V=Lt.patch(_.toString());return R(V)},[h.PUT]:()=>{const V=Lt.put(_.toString());return R(V)},[h.DELETE]:()=>{const V=Lt.delete(_.toString());return R(V)}}[y];let W=j();const q=()=>{console.debug("aborting request:",s.url),W.abort()};if(a==null||a.addEventListener("abort",q),g&&c){const V=n.auth.getAuthHeader();W=W.set("Authorization",V)}u&&(W=W.set(u));try{return await W.query(m)}catch(V){const H=yE(V),Ks=H==null?void 0:H.status;if(c&&Ks===401)return await n.auth.handleUnauthorized(W,H),W.query(m);throw new C({response:H,innerError:V,discard:Qc.includes(Ks)})}finally{a==null||a.removeEventListener("abort",q)}}class uq{constructor(s){p(this,"store");this.store=s}_performRequest(s,e,n,a){const c=new Js,r={...e,uuid:e.uuid??Bt.v4()};return Xc(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 Js,c={...s,BASE_URL:e,serviceName:n},r=this.store.dispatch(IT(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 Qt{constructor(){p(this,"graph");p(this,"requestAttemptCounter");this.graph=new DE.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(s){const e=new Qt;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))&&Qt._addDependency(a.payload.uuid,r.payload.uuid,e.graph)}}return e}_addDependency(s,e){Qt._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 SE;function fE(t){SE=t}function Zt(){return SE}let AE;function wE(t){AE=t}function PE(){return AE}let xc=null;function Ut(){const t=Zt();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(xc)return xc;const s=t.getState().offline.outbox,e=Qt._fromOutbox(s);return xc=e,e}const oq=(t,s)=>{const e=new s(t);return wE(e),fE(t),e};class hq{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 er{constructor(){p(this,"next");this.next=null}then(s){return new hq(this).then(s)}async run(s){if(this.next)return this.next.run(s);{if(console.debug("Middleware finished. Performing request:",s.payload.url),!Zt())throw new Error("Client store not set");const n=PE();if(!n)throw new Error("Client SDK not set");return oE(s,n)}}}class TE extends er{async run(s){return super.run(s)}}class OE extends er{async run(s){return super.run(s)}}const IE=new TE().then(new OE).compile();function FE(t){var s;return(s=IE[0])==null?void 0:s.run(t)}var _E=(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))(_E||{});i.ALL_MIDDLEWARE=IE,i.APIError=C,i.AgentService=fW,i.AssetAttachmentService=AW,i.AssetProcedureService=FW,i.AssetProcedureStepFieldValuesAttachmentService=bW,i.AssetProcedureStepFieldValuesService=MW,i.AssetProcedureStepFieldsAttachmentService=gW,i.AssetProcedureStepFieldsService=RW,i.AssetProcedureStepService=vW,i.AssetProcedureTypeAttachmentService=wW,i.AssetProcedureTypeFieldValuesAttachmentService=OW,i.AssetProcedureTypeFieldValuesService=IW,i.AssetProcedureTypeFieldsAttachmentService=PW,i.AssetProcedureTypeFieldsService=TW,i.AssetProcedureTypeService=_W,i.AssetService=kW,i.AssetStageCompletionService=EW,i.AssetStageService=VW,i.AssetStatusType=rr,i.AssetTypeAttachmentService=BW,i.AssetTypeFieldValuesAttachmentService=zW,i.AssetTypeFieldValuesService=qW,i.AssetTypeFieldsAttachmentService=DW,i.AssetTypeFieldsService=WW,i.AssetTypeIdentifierService=jW,i.AssetTypeIdentifierValueService=$W,i.AssetTypeService=CW,i.AssetTypeStatusService=UW,i.AttachmentModel=dr,i.BaseApiService=Ct,i.BaseModelApiService=Wt,i.BaseOfflineFileModelApiService=z,i.BaseOfflineModelApiService=M,i.BaseSDK=uq,i.COMMON_AUTO_FIELDS=Pr,i.DEFAULT_ISSUE_PRIORITY=WE,i.DEFAULT_PAGE_SIZE=tE,i.DEFAULT_WORKFLOW_STATUS=jE,i.DISCARD_HTTP_STATUSES=Qc,i.DeferredPromise=Js,i.DocumentAttachmentService=LW,i.DocumentService=NW,i.EMPTY_ARRAY=nr,i.EMPTY_OBJECT=ar,i.EmailDomainsService=HW,i.EmailVerificationService=GW,i.FILE_MODEL_DEFAULT_PAGE_SIZE=sE,i.FileService=KW,i.FormIdentifierService=YW,i.FormIdentifierValueService=JW,i.FormRevisionAttachmentService=QW,i.FormRevisionService=ZW,i.FormService=XW,i.FormSubmissionAttachmentService=xW,i.FormSubmissionService=ez,i.GeoImageService=tz,i.HttpMethod=h,i.IssueAssociationService=sz,i.IssueAttachmentService=iz,i.IssueCommentAttachmentService=nz,i.IssueCommentService=az,i.IssuePriority=Ys,i.IssueService=cz,i.IssueStatusType=lr,i.IssueTypeAttachmentService=rz,i.IssueTypeFieldValuesAttachmentService=uz,i.IssueTypeFieldValuesService=oz,i.IssueTypeFieldsAttachmentService=dz,i.IssueTypeFieldsService=lz,i.IssueTypeIdentifierService=hz,i.IssueTypeIdentifierValueService=pz,i.IssueTypeService=yz,i.IssueTypeStatusService=mz,i.IssueUpdateChange=$,i.IssueUpdateService=Sz,i.JWTService=wz,i.MAX_SERVICE_BATCH_SIZE=L,i.OUTBOX_RETRY_DELAY=pr,i.OfflineAnalyticsMiddleware=TE,i.OfflineMiddleware=er,i.OrganizationAccessLevel=cr,i.OrganizationAccessService=Pz,i.OrganizationService=Tz,i.OutboxCoordinator=Qt,i.ProcedureFieldValuesAttachmentService=Uz,i.ProcedureFieldValuesService=Lz,i.ProcedureService=gz,i.ProcedureStepAssigneeService=Rz,i.ProcedureStepCommentService=bz,i.ProcedureStepDefaultAssigneeService=Mz,i.ProcedureStepDefaultReviewerService=vz,i.ProcedureStepEventService=kz,i.ProcedureStepEventType=or,i.ProcedureStepFieldValuesAttachmentService=Bz,i.ProcedureStepFieldValuesReviewService=Dz,i.ProcedureStepFieldValuesReviewType=hr,i.ProcedureStepFieldValuesService=Wz,i.ProcedureStepFieldsAttachmentService=Ez,i.ProcedureStepFieldsService=Vz,i.ProcedureStepReviewerService=zz,i.ProcedureStepService=qz,i.ProcedureTypeAttachmentService=jz,i.ProcedureTypeFieldsAttachmentService=$z,i.ProcedureTypeFieldsService=Cz,i.ProcedureTypeService=Nz,i.ProjectAccessService=Oz,i.ProjectAttachmentService=Iz,i.ProjectFileService=Fz,i.ProjectService=_z,i.RESET_ORGANIZATION_STATE=I,i.RESET_PROJECT_STATE=B,i.RESET_STATE=T,i.RateLimitingMiddleware=OE,i.SelectorBuilder=dV,i.TeamMembershipService=Hz,i.TeamService=Gz,i.UNKNOWN_ERROR_MESSAGE=Jt,i.UserService=Kz,i.VERSION_REDUCER_KEY=es,i.VerificationCodeType=_E,i.WORKFLOW_STATUSES=qE,i.WORKFLOW_STEP_FIELD_VALUES_REVIEW_TYPES=zE,i.WorkflowIssueLinkService=Jz,i.WorkflowService=Yz,i.WorkflowStatus=Nt,i.WorkflowStepAssigneeService=Qz,i.WorkflowStepCommentService=Zz,i.WorkflowStepDefaultAssigneeService=Xz,i.WorkflowStepDefaultReviewerService=xz,i.WorkflowStepEventService=eq,i.WorkflowStepEventType=ur,i.WorkflowStepFieldValuesAttachmentService=iq,i.WorkflowStepFieldValuesReviewRequestService=nq,i.WorkflowStepFieldValuesReviewService=aq,i.WorkflowStepFieldValuesReviewType=xt,i.WorkflowStepFieldValuesService=cq,i.WorkflowStepFieldsAttachmentService=tq,i.WorkflowStepFieldsService=sq,i.WorkflowStepReviewerService=rq,i.WorkflowStepService=dq,i.WorkflowTypeService=lq,i._setLatestRetryTime=_T,i.addAsset=Qu,i.addAssetAttachment=Dr,i.addAssetAttachments=ii,i.addAssetProcedure=ll,i.addAssetProcedureStep=qu,i.addAssetProcedureStepFieldValues=Ou,i.addAssetProcedureStepFieldValuesAttachment=lu,i.addAssetProcedureStepFieldValuesAttachments=gi,i.addAssetProcedureStepFieldValuesMany=Iu,i.addAssetProcedureStepFields=Ql,i.addAssetProcedureStepFieldsAttachment=Wl,i.addAssetProcedureStepFieldsAttachments=zl,i.addAssetProcedureStepFieldsMany=Zl,i.addAssetProcedureSteps=ju,i.addAssetProcedureType=Ol,i.addAssetProcedureTypeAttachment=Yr,i.addAssetProcedureTypeAttachments=Jr,i.addAssetProcedureTypeFieldValues=Jd,i.addAssetProcedureTypeFieldValuesAttachment=Wd,i.addAssetProcedureTypeFieldValuesAttachments=hi,i.addAssetProcedureTypeFieldValuesMany=Qd,i.addAssetProcedureTypeFields=Od,i.addAssetProcedureTypeFieldsAttachment=dd,i.addAssetProcedureTypeFieldsAttachments=ld,i.addAssetProcedureTypeFieldsMany=Id,i.addAssetProcedureTypes=Il,i.addAssetProcedures=fi,i.addAssetStage=Ro,i.addAssetStageCompletion=uo,i.addAssetStageCompletions=oo,i.addAssetStages=bo,i.addAssetType=bp,i.addAssetTypeAttachment=qo,i.addAssetTypeAttachments=$i,i.addAssetTypeFieldValues=qh,i.addAssetTypeFieldValuesAttachment=_h,i.addAssetTypeFieldValuesAttachments=Ki,i.addAssetTypeFieldValuesMany=jh,i.addAssetTypeFields=oh,i.addAssetTypeFieldsAttachment=Zo,i.addAssetTypeFieldsAttachments=Xo,i.addAssetTypeFieldsMany=hh,i.addAssetTypeIdentifier=Xh,i.addAssetTypeIdentifierValue=hp,i.addAssetTypeIdentifierValues=pp,i.addAssetTypeIdentifiers=xh,i.addAssetTypeStatus=$p,i.addAssetTypeStatuses=Cp,i.addAssetTypes=Mp,i.addAssets=Vi,i.addConversation=Mr,i.addConversations=lV,i.addDocument=fy,i.addDocumentAttachment=iy,i.addDocumentAttachments=ny,i.addDocuments=Ay,i.addEmailDomain=ky,i.addEmailDomains=Ey,i.addForm=Jm,i.addFormIdentifier=Yy,i.addFormIdentifierValue=dm,i.addFormIdentifierValues=lm,i.addFormIdentifiers=Jy,i.addFormRevision=Wm,i.addFormRevisionAttachment=Om,i.addFormRevisionAttachments=Im,i.addFormRevisions=fn,i.addFormSubmission=IS,i.addFormSubmissionAttachment=lS,i.addFormSubmissionAttachments=On,i.addFormSubmissions=bn,i.addForms=Qm,i.addGeoImage=WS,i.addGeoImages=zS,i.addIssue=Xf,i.addIssueAssociation=XS,i.addIssueAssociations=zt,i.addIssueAttachment=hf,i.addIssueAttachments=Dn,i.addIssueComment=jf,i.addIssueCommentAttachment=_f,i.addIssueCommentAttachments=gf,i.addIssueComments=$f,i.addIssueType=eP,i.addIssueTypeAttachment=oA,i.addIssueTypeAttachments=hA,i.addIssueTypeFieldValues=jA,i.addIssueTypeFieldValuesAttachment=pw,i.addIssueTypeFieldValuesAttachments=Xn,i.addIssueTypeFieldValuesMany=$A,i.addIssueTypeFields=xA,i.addIssueTypeFieldsAttachment=_A,i.addIssueTypeFieldsAttachments=gA,i.addIssueTypeFieldsMany=ew,i.addIssueTypeIdentifier=gw,i.addIssueTypeIdentifierValue=$w,i.addIssueTypeIdentifierValues=Cw,i.addIssueTypeIdentifiers=Rw,i.addIssueTypeStatus=yP,i.addIssueTypeStatuses=mP,i.addIssueTypes=tP,i.addIssueUpdate=ua,i.addIssueUpdates=oa,i.addIssues=Ln,i.addOrganization=oT,i.addOrganizationAccess=YP,i.addOrganizationAccesses=JP,i.addOrganizations=uT,i.addProcedure=kO,i.addProcedureFieldValues=Gg,i.addProcedureFieldValuesAttachment=Vg,i.addProcedureFieldValuesAttachments=lc,i.addProcedureFieldValuesMany=Kg,i.addProcedureStep=B_,i.addProcedureStepAssignee=NO,i.addProcedureStepAssignees=HO,i.addProcedureStepComment=nI,i.addProcedureStepComments=aI,i.addProcedureStepDefaultAssignee=AI,i.addProcedureStepDefaultAssignees=wI,i.addProcedureStepDefaultReviewer=EI,i.addProcedureStepDefaultReviewers=VI,i.addProcedureStepEvent=GI,i.addProcedureStepEvents=KI,i.addProcedureStepFieldValues=HF,i.addProcedureStepFieldValuesAttachment=EF,i.addProcedureStepFieldValuesAttachments=Ga,i.addProcedureStepFieldValuesMany=GF,i.addProcedureStepFieldValuesReview=a_,i.addProcedureStepFieldValuesReviews=Za,i.addProcedureStepFields=wF,i.addProcedureStepFieldsAttachment=cF,i.addProcedureStepFieldsAttachments=$a,i.addProcedureStepFieldsMany=PF,i.addProcedureStepReviewer=A_,i.addProcedureStepReviewers=w_,i.addProcedureSteps=D_,i.addProcedureType=cR,i.addProcedureTypeAttachment=H_,i.addProcedureTypeAttachments=G_,i.addProcedureTypeFields=wg,i.addProcedureTypeFieldsAttachment=ag,i.addProcedureTypeFieldsAttachments=cg,i.addProcedureTypeFieldsMany=Pg,i.addProcedureTypes=rR,i.addProcedures=va,i.addProject=PO,i.addProjectAccess=MT,i.addProjectAccesses=vT,i.addProjectAttachment=UT,i.addProjectAttachments=LT,i.addProjectFile=nO,i.addProjectFiles=aO,i.addProjects=wO,i.addTeam=DR,i.addTeamMembership=TR,i.addTeamMemberships=OR,i.addTeams=WR,i.addUser=fa,i.addUsers=jP,i.addWorkflow=ZR,i.addWorkflowIssueLink=ob,i.addWorkflowIssueLinks=us,i.addWorkflowStep=bk,i.addWorkflowStepAssignee=gb,i.addWorkflowStepAssignees=Rb,i.addWorkflowStepComment=$b,i.addWorkflowStepComments=Cb,i.addWorkflowStepDefaultAssignee=eM,i.addWorkflowStepDefaultAssignees=tM,i.addWorkflowStepDefaultReviewer=yM,i.addWorkflowStepDefaultReviewers=mM,i.addWorkflowStepEvent=bM,i.addWorkflowStepEvents=MM,i.addWorkflowStepFieldValues=bv,i.addWorkflowStepFieldValuesAttachment=mv,i.addWorkflowStepFieldValuesAttachments=Bc,i.addWorkflowStepFieldValuesMany=Mv,i.addWorkflowStepFieldValuesReview=tk,i.addWorkflowStepFieldValuesReviewRequest=Uv,i.addWorkflowStepFieldValuesReviewRequests=jc,i.addWorkflowStepFieldValuesReviews=Uc,i.addWorkflowStepFields=tv,i.addWorkflowStepFieldsAttachment=UM,i.addWorkflowStepFieldsAttachments=Mc,i.addWorkflowStepFieldsMany=sv,i.addWorkflowStepReviewer=yk,i.addWorkflowStepReviewers=mk,i.addWorkflowSteps=Mk,i.addWorkflowType=Uk,i.addWorkflowTypes=Lk,i.addWorkflows=XR,i.agentsReducer=Er,i.agentsSlice=ei,i.areArraysEqual=LE,i.assetAttachmentReducer=Hr,i.assetAttachmentSlice=si,i.assetProcedureReducer=ml,i.assetProcedureSlice=Si,i.assetProcedureStepFieldValuesAttachmentReducer=wu,i.assetProcedureStepFieldValuesAttachmentSlice=_i,i.assetProcedureStepFieldValuesReducer=Vu,i.assetProcedureStepFieldValuesSlice=Mi,i.assetProcedureStepFieldsAttachmentReducer=Kl,i.assetProcedureStepFieldsAttachmentSlice=Ti,i.assetProcedureStepFieldsReducer=cu,i.assetProcedureStepFieldsSlice=Ii,i.assetProcedureStepReducer=Nu,i.assetProcedureStepSlice=vi,i.assetProcedureTypeAttachmentReducer=sd,i.assetProcedureTypeAttachmentSlice=ci,i.assetProcedureTypeFieldValuesAttachmentReducer=Ud,i.assetProcedureTypeFieldValuesAttachmentSlice=oi,i.assetProcedureTypeFieldValuesReducer=il,i.assetProcedureTypeFieldValuesSlice=mi,i.assetProcedureTypeFieldsAttachmentReducer=Sd,i.assetProcedureTypeFieldsAttachmentSlice=di,i.assetProcedureTypeFieldsReducer=vd,i.assetProcedureTypeFieldsSlice=ui,i.assetProcedureTypeReducer=vl,i.assetProcedureTypeSlice=wi,i.assetReducer=co,i.assetSlice=Ei,i.assetStageCompletionReducer=Ao,i.assetStageCompletionSlice=Di,i.assetStageReducer=Vo,i.assetStageSlice=Wi,i.assetTypeAttachmentReducer=Yo,i.assetTypeAttachmentSlice=ji,i.assetTypeFieldValuesAttachmentReducer=Dh,i.assetTypeFieldValuesAttachmentSlice=Gi,i.assetTypeFieldValuesReducer=Jh,i.assetTypeFieldValuesSlice=Qi,i.assetTypeFieldsAttachmentReducer=dh,i.assetTypeFieldsAttachmentSlice=Li,i.assetTypeFieldsReducer=Oh,i.assetTypeFieldsSlice=Hi,i.assetTypeIdentifierReducer=lp,i.assetTypeIdentifierSlice=Zi,i.assetTypeIdentifierValueReducer=Ip,i.assetTypeIdentifierValueSlice=xi,i.assetTypeReducer=zp,i.assetTypeSlice=en,i.assetTypeStatusReducer=Zp,i.assetTypeStatusSlice=sn,i.assetTypeStatusSortFn=Ir,i.authReducer=ey,i.authSlice=Ms,i.baseReducer=sW,i.baseReducers=Jc,i.clearTokens=KV,i.createModelAdapter=O,i.createOfflineAction=TT,i.createPayload=b,i.createSelectionAdapter=$E,i.deleteAsset=xu,i.deleteAssetAttachment=$r,i.deleteAssetAttachments=ni,i.deleteAssetProcedure=hl,i.deleteAssetProcedureStep=Uu,i.deleteAssetProcedureStepFieldValues=bu,i.deleteAssetProcedureStepFieldValuesAttachment=yu,i.deleteAssetProcedureStepFieldValuesAttachments=Ri,i.deleteAssetProcedureStepFieldValuesMany=Mu,i.deleteAssetProcedureStepFields=su,i.deleteAssetProcedureStepFieldsAttachment=Ul,i.deleteAssetProcedureStepFieldsAttachments=Ll,i.deleteAssetProcedureStepFieldsMany=iu,i.deleteAssetProcedureSteps=Lu,i.deleteAssetProcedureType=gl,i.deleteAssetProcedureTypeAttachment=ed,i.deleteAssetProcedureTypeAttachments=td,i.deleteAssetProcedureTypeFieldValues=tl,i.deleteAssetProcedureTypeFieldValuesAttachment=Cd,i.deleteAssetProcedureTypeFieldValuesAttachments=pi,i.deleteAssetProcedureTypeFieldValuesMany=sl,i.deleteAssetProcedureTypeFields=bd,i.deleteAssetProcedureTypeFieldsAttachment=yd,i.deleteAssetProcedureTypeFieldsAttachments=md,i.deleteAssetProcedureTypeFieldsMany=Md,i.deleteAssetProcedureTypes=Rl,i.deleteAssetProcedures=Ai,i.deleteAssetStage=ko,i.deleteAssetStageCompletion=So,i.deleteAssetStageCompletions=fo,i.deleteAssetStages=Eo,i.deleteAssetType=Ep,i.deleteAssetTypeAttachment=Lo,i.deleteAssetTypeAttachments=Ci,i.deleteAssetTypeFieldValues=Nh,i.deleteAssetTypeFieldValuesAttachment=vh,i.deleteAssetTypeFieldValuesAttachments=Yi,i.deleteAssetTypeFieldValuesMany=Hh,i.deleteAssetTypeFields=fh,i.deleteAssetTypeFieldsAttachment=ih,i.deleteAssetTypeFieldsAttachments=nh,i.deleteAssetTypeFieldsMany=Ah,i.deleteAssetTypeIdentifier=np,i.deleteAssetTypeIdentifierValue=Ap,i.deleteAssetTypeIdentifierValues=wp,i.deleteAssetTypeIdentifiers=ap,i.deleteAssetTypeStatus=Gp,i.deleteAssetTypeStatuses=Kp,i.deleteAssetTypes=Vp,i.deleteAssets=Bi,i.deleteConversation=hV,i.deleteConversations=pV,i.deleteDocument=Iy,i.deleteDocumentAttachment=ly,i.deleteDocumentAttachments=uy,i.deleteDocuments=Fy,i.deleteEmailDomain=zy,i.deleteEmailDomains=qy,i.deleteForm=tS,i.deleteFormIdentifier=em,i.deleteFormIdentifierValue=ym,i.deleteFormIdentifierValues=mm,i.deleteFormIdentifiers=tm,i.deleteFormRevision=Cm,i.deleteFormRevisionAttachment=bm,i.deleteFormRevisionAttachments=Mm,i.deleteFormRevisions=An,i.deleteFormSubmission=gS,i.deleteFormSubmissionAttachment=yS,i.deleteFormSubmissionAttachments=In,i.deleteFormSubmissions=Mn,i.deleteForms=sS,i.deleteGeoImage=$S,i.deleteGeoImages=CS,i.deleteIssue=iA,i.deleteIssueAssociation=xS,i.deleteIssueAssociations=qt,i.deleteIssueAttachment=ff,i.deleteIssueAttachments=Wn,i.deleteIssueComment=Hf,i.deleteIssueCommentAttachment=kf,i.deleteIssueCommentAttachments=Ef,i.deleteIssueComments=Gf,i.deleteIssueType=cP,i.deleteIssueTypeAttachment=fA,i.deleteIssueTypeAttachments=AA,i.deleteIssueTypeFieldValues=HA,i.deleteIssueTypeFieldValuesAttachment=Aw,i.deleteIssueTypeFieldValuesAttachments=xn,i.deleteIssueTypeFieldValuesMany=GA,i.deleteIssueTypeFields=aw,i.deleteIssueTypeFieldsAttachment=kA,i.deleteIssueTypeFieldsAttachments=EA,i.deleteIssueTypeFieldsMany=cw,i.deleteIssueTypeIdentifier=Ew,i.deleteIssueTypeIdentifierValue=Gw,i.deleteIssueTypeIdentifierValues=Kw,i.deleteIssueTypeIdentifiers=Vw,i.deleteIssueTypeStatus=PP,i.deleteIssueTypeStatuses=TP,i.deleteIssueTypes=rP,i.deleteIssueUpdate=ha,i.deleteIssueUpdates=pa,i.deleteIssues=Nn,i.deleteOrganization=yT,i.deleteOrganizationAccess=eT,i.deleteOrganizationAccesses=tT,i.deleteOrganizations=mT,i.deleteProcedure=WO,i.deleteProcedureFieldValues=Xg,i.deleteProcedureFieldValuesAttachment=qg,i.deleteProcedureFieldValuesAttachments=uc,i.deleteProcedureFieldValuesMany=xg,i.deleteProcedureStep=q_,i.deleteProcedureStepAssignee=QO,i.deleteProcedureStepAssignees=ZO,i.deleteProcedureStepComment=uI,i.deleteProcedureStepComments=oI,i.deleteProcedureStepDefaultAssignee=FI,i.deleteProcedureStepDefaultAssignees=_I,i.deleteProcedureStepDefaultReviewer=qI,i.deleteProcedureStepDefaultReviewers=jI,i.deleteProcedureStepEvent=XI,i.deleteProcedureStepEvents=xI,i.deleteProcedureStepFieldValues=ZF,i.deleteProcedureStepFieldValuesAttachment=zF,i.deleteProcedureStepFieldValuesAttachments=Ka,i.deleteProcedureStepFieldValuesMany=XF,i.deleteProcedureStepFieldValuesReview=u_,i.deleteProcedureStepFieldValuesReviews=Xa,i.deleteProcedureStepFields=_F,i.deleteProcedureStepFieldsAttachment=oF,i.deleteProcedureStepFieldsAttachments=Ca,i.deleteProcedureStepFieldsMany=gF,i.deleteProcedureStepReviewer=F_,i.deleteProcedureStepReviewers=__,i.deleteProcedureSteps=j_,i.deleteProcedureType=hR,i.deleteProcedureTypeAttachment=Z_,i.deleteProcedureTypeAttachments=X_,i.deleteProcedureTypeFields=_g,i.deleteProcedureTypeFieldsAttachment=og,i.deleteProcedureTypeFieldsAttachments=hg,i.deleteProcedureTypeFieldsMany=gg,i.deleteProcedureTypes=pR,i.deleteProcedures=ka,i.deleteProject=IO,i.deleteProjectAccess=DT,i.deleteProjectAccesses=WT,i.deleteProjectAttachment=YT,i.deleteProjectAttachments=JT,i.deleteProjectFile=dO,i.deleteProjectFiles=lO,i.deleteProjects=FO,i.deleteTeam=CR,i.deleteTeamMembership=RR,i.deleteTeamMemberships=bR,i.deleteTeams=UR,i.deleteUser=Aa,i.deleteUsers=UP,i.deleteWorkflow=ib,i.deleteWorkflowIssueLink=Sb,i.deleteWorkflowIssueLinks=os,i.deleteWorkflowStep=Bk,i.deleteWorkflowStepAssignee=Eb,i.deleteWorkflowStepAssignees=Vb,i.deleteWorkflowStepComment=Gb,i.deleteWorkflowStepComments=Kb,i.deleteWorkflowStepDefaultAssignee=cM,i.deleteWorkflowStepDefaultAssignees=rM,i.deleteWorkflowStepDefaultReviewer=PM,i.deleteWorkflowStepDefaultReviewers=TM,i.deleteWorkflowStepEvent=BM,i.deleteWorkflowStepEvents=DM,i.deleteWorkflowStepFieldValues=Bv,i.deleteWorkflowStepFieldValuesAttachment=Pv,i.deleteWorkflowStepFieldValuesAttachments=Dc,i.deleteWorkflowStepFieldValuesMany=Dv,i.deleteWorkflowStepFieldValuesReview=ck,i.deleteWorkflowStepFieldValuesReviewRequest=Kv,i.deleteWorkflowStepFieldValuesReviewRequests=$c,i.deleteWorkflowStepFieldValuesReviews=Lc,i.deleteWorkflowStepFields=rv,i.deleteWorkflowStepFieldsAttachment=KM,i.deleteWorkflowStepFieldsAttachments=vc,i.deleteWorkflowStepFieldsMany=dv,i.deleteWorkflowStepReviewer=Pk,i.deleteWorkflowStepReviewers=Tk,i.deleteWorkflowSteps=Dk,i.deleteWorkflowType=Yk,i.deleteWorkflowTypes=Jk,i.deleteWorkflows=nb,i.dequeue=uE,i.discard=hE,i.documentAttachmentReducer=yy,i.documentAttachmentSlice=an,i.documentSlice=rn,i.documentsReducer=_y,i.downloadFile=ZE,i.emailDomainsReducer=Uy,i.emailDomainsSlice=ln,i.emailRegex=aV,i.enqueue=lE,i.enqueueRequest=IT,i.extractResponseFromError=yE,i.fallbackToEmptyArray=A,i.fallbackToEmptyObject=ts,i.fetchBlobFromObjectUrl=Sr,i.fetchFileFromObjectUrl=fr,i.fileReducer=Hy,i.fileSlice=on,i.formIdentifierReducer=am,i.formIdentifierSlice=hn,i.formIdentifierValueReducer=wm,i.formIdentifierValueSlice=yn,i.formReducer=iS,i.formRevisionAttachmentReducer=Vm,i.formRevisionAttachmentSlice=mn,i.formRevisionReducer=Gm,i.formRevisionsSlice=Sn,i.formSlice=wn,i.formSubmissionAttachmentReducer=AS,i.formSubmissionAttachmentSlice=Tn,i.formSubmissionReducer=kS,i.formSubmissionSlice=Rn,i.geoImageReducer=HS,i.geoImageSlice=kn,i.getAssetProcedureStepSubTree=Or,i.getAssetProcedureStepTrees=cV,i.getClientSDK=PE,i.getClientStore=Zt,i.getDocumentSubTree=gr,i.getDocumentTrees=rV,i.getFileExtension=mr,i.getLocalDateString=yr,i.getLocalRelativeDateString=KE,i.getOutboxCoordinator=Ut,i.getRenamedFile=QE,i.getRequestDescription=w,i.getS3FileKey=JE,i.hashFile=ws,i.initSDK=oq,i.initializeAssetAttachments=Br,i.initializeAssetProcedureStepFieldValues=Tu,i.initializeAssetProcedureStepFieldValuesAttachments=du,i.initializeAssetProcedureStepFields=Jl,i.initializeAssetProcedureStepFieldsAttachments=Dl,i.initializeAssetProcedureSteps=Du,i.initializeAssetProcedureTypeAttachments=Kr,i.initializeAssetProcedureTypeFieldValues=Yd,i.initializeAssetProcedureTypeFieldValuesAttachments=Dd,i.initializeAssetProcedureTypeFields=Td,i.initializeAssetProcedureTypeFieldsAttachments=rd,i.initializeAssetProcedureTypes=Tl,i.initializeAssetProcedures=dl,i.initializeAssetStageCompletions=lo,i.initializeAssetStages=Fo,i.initializeAssetTypeAttachments=zo,i.initializeAssetTypeFieldValues=zh,i.initializeAssetTypeFieldValuesAttachments=Fh,i.initializeAssetTypeFields=uh,i.initializeAssetTypeFieldsAttachments=Qo,i.initializeAssetTypeIdentifierValues=op,i.initializeAssetTypeIdentifiers=Zh,i.initializeAssetTypeStatuses=jp,i.initializeAssetTypes=_p,i.initializeAssets=Ju,i.initializeConversations=br,i.initializeDocumentAttachments=sy,i.initializeDocuments=Sy,i.initializeEmailDomains=vy,i.initializeFormIdentifierValues=rm,i.initializeFormIdentifiers=Ky,i.initializeFormRevisionAttachments=Tm,i.initializeFormRevisions=Dm,i.initializeFormSubmissionAttachments=dS,i.initializeFormSubmissions=PS,i.initializeForms=Ym,i.initializeGeoImages=VS,i.initializeIssueAssociations=KS,i.initializeIssueAttachments=of,i.initializeIssueCommentAttachments=Ff,i.initializeIssueComments=qf,i.initializeIssueTypeAttachments=uA,i.initializeIssueTypeFieldValues=qA,i.initializeIssueTypeFieldValuesAttachments=hw,i.initializeIssueTypeFields=XA,i.initializeIssueTypeFieldsAttachments=FA,i.initializeIssueTypeIdentifierValues=jw,i.initializeIssueTypeIdentifiers=_w,i.initializeIssueTypeStatuses=pP,i.initializeIssueTypes=xw,i.initializeIssueUpdates=gP,i.initializeIssues=Zf,i.initializeOrganizationAccesses=KP,i.initializeOrganizations=rT,i.initializeProcedureFieldValues=Hg,i.initializeProcedureFieldValuesAttachments=Eg,i.initializeProcedureStepAssignees=LO,i.initializeProcedureStepComments=iI,i.initializeProcedureStepDefaultAssignees=fI,i.initializeProcedureStepDefaultReviewers=kI,i.initializeProcedureStepEvents=HI,i.initializeProcedureStepFieldValues=NF,i.initializeProcedureStepFieldValuesAttachments=kF,i.initializeProcedureStepFieldValuesReviews=n_,i.initializeProcedureStepFields=AF,i.initializeProcedureStepFieldsAttachments=aF,i.initializeProcedureStepReviewers=f_,i.initializeProcedureSteps=k_,i.initializeProcedureTypeAttachments=N_,i.initializeProcedureTypeFields=Ag,i.initializeProcedureTypeFieldsAttachments=ng,i.initializeProcedureTypes=aR,i.initializeProcedures=vO,i.initializeProjectAccesses=bT,i.initializeProjectAttachments=CT,i.initializeProjectFiles=tO,i.initializeProjects=SO,i.initializeTeamMemberships=PR,i.initializeTeams=BR,i.initializeUsers=WP,i.initializeWorkflowIssueLinks=ub,i.initializeWorkflowStepAssignees=_b,i.initializeWorkflowStepComments=jb,i.initializeWorkflowStepDefaultAssignees=xb,i.initializeWorkflowStepDefaultReviewers=pM,i.initializeWorkflowStepEvents=RM,i.initializeWorkflowStepFieldValues=Rv,i.initializeWorkflowStepFieldValuesAttachments=yv,i.initializeWorkflowStepFieldValuesReviewRequests=Cv,i.initializeWorkflowStepFieldValuesReviews=ek,i.initializeWorkflowStepFields=ev,i.initializeWorkflowStepFieldsAttachments=CM,i.initializeWorkflowStepReviewers=pk,i.initializeWorkflowSteps=Rk,i.initializeWorkflowTypes=Ck,i.initializeWorkflows=QR,i.isImageFile=XE,i.isObjectUrl=Ar,i.isToday=GE,i.issueAssociationReducer=lf,i.issueAssociationSlice=Vn,i.issueAttachmentReducer=Of,i.issueAttachmentSlice=Bn,i.issueCommentAttachmentReducer=Wf,i.issueCommentAttachmentSlice=qn,i.issueCommentReducer=Jf,i.issueCommentSlice=$n,i.issueReducer=dA,i.issueSlice=Un,i.issueTypeAttachmentReducer=OA,i.issueTypeAttachmentSlice=Hn,i.issueTypeFieldValuesAttachmentReducer=Iw,i.issueTypeFieldValuesAttachmentSlice=Zn,i.issueTypeFieldValuesReducer=QA,i.issueTypeFieldValuesSlice=Jn,i.issueTypeFieldsAttachmentReducer=WA,i.issueTypeFieldsAttachmentSlice=Kn,i.issueTypeFieldsReducer=uw,i.issueTypeFieldsSlice=Qn,i.issueTypeIdentifierReducer=zw,i.issueTypeIdentifierSlice=ta,i.issueTypeIdentifierValueReducer=Zw,i.issueTypeIdentifierValueSlice=ia,i.issueTypeReducer=oP,i.issueTypeSlice=na,i.issueTypeStatusReducer=FP,i.issueTypeStatusSlice=ca,i.issueTypeStatusSortFn=Fr,i.issueUpdateReducer=BP,i.issueUpdateSlice=la,i.logOnlyOnce=xE,i.markAsDeleted=FT,i.markForDeletion=vB,i.memoize=Zs,i.organizationAccessReducer=sT,i.organizationAccessSlice=Pa,i.organizationReducer=PT,i.organizationSlice=Ta,i.outboxReducer=gT,i.outboxSlice=Oa,i.overmapEnhancer=oW,i.overmapReducer=iW,i.overmapReducers=eE,i.performRequest=Xc,i.performRequestFromAction=oE,i.procedureFieldValuesAttachmentReducer=jg,i.procedureFieldValuesAttachmentSlice=dc,i.procedureFieldValuesReducer=eR,i.procedureFieldValuesSlice=hc,i.procedureReducer=zO,i.procedureSlice=Ma,i.procedureStepAssigneeReducer=tI,i.procedureStepAssigneeSlice=Ea,i.procedureStepCommentReducer=mI,i.procedureStepCommentSlice=Va,i.procedureStepDefaultAssigneeReducer=MI,i.procedureStepDefaultAssigneeSlice=Ba,i.procedureStepDefaultReviewerReducer=LI,i.procedureStepDefaultReviewerSlice=Wa,i.procedureStepEventReducer=iF,i.procedureStepEventSlice=qa,i.procedureStepFieldValuesAttachmentReducer=UF,i.procedureStepFieldValuesAttachmentSlice=Ha,i.procedureStepFieldValuesReducer=s_,i.procedureStepFieldValuesReviewReducer=m_,i.procedureStepFieldValuesReviewSlice=Qa,i.procedureStepFieldValuesSlice=Ja,i.procedureStepFieldsAttachmentReducer=SF,i.procedureStepFieldsAttachmentSlice=ja,i.procedureStepFieldsReducer=MF,i.procedureStepFieldsSlice=La,i.procedureStepReducer=$_,i.procedureStepReviewerReducer=M_,i.procedureStepReviewerSlice=xa,i.procedureStepSlice=ec,i.procedureTypeAttachmentReducer=x_,i.procedureTypeAttachmentSlice=ic,i.procedureTypeFieldsAttachmentReducer=pg,i.procedureTypeFieldsAttachmentSlice=ac,i.procedureTypeFieldsReducer=Rg,i.procedureTypeFieldsSlice=rc,i.procedureTypeReducer=yR,i.procedureTypeSlice=yc,i.projectAccessReducer=zT,i.projectAccessSlice=Ia,i.projectAttachmentReducer=xT,i.projectAttachmentSlice=_a,i.projectFileReducer=yO,i.projectFileSlice=Ra,i.projectReducer=_O,i.projectSlice=ba,i.rehydratedReducer=AR,i.rehydratedSlice=mc,i.restructureSelectorWithArgs=S,i.runMiddleware=FE,i.selectAccessToken=YV,i.selectAccessesByUserOfProject=EB,i.selectAccessibleProjects=DB,i.selectActiveOrganizationAccess=gB,i.selectAllDocumentAttachments=cn,i.selectAssetAttachmentById=Ur,i.selectAssetAttachmentMapping=Cr,i.selectAssetAttachments=ai,i.selectAssetAttachmentsByIds=Lr,i.selectAssetById=no,i.selectAssetProcedureById=Al,i.selectAssetProcedureStepById=Hu,i.selectAssetProcedureStepFieldValues=ss,i.selectAssetProcedureStepFieldValuesAttachmentById=Su,i.selectAssetProcedureStepFieldValuesAttachments=bi,i.selectAssetProcedureStepFieldValuesAttachmentsByIds=fu,i.selectAssetProcedureStepFieldValuesAttachmentsMapping=mu,i.selectAssetProcedureStepFieldValuesById=ku,i.selectAssetProcedureStepFieldValuesByIds=Eu,i.selectAssetProcedureStepFieldValuesMapping=vu,i.selectAssetProcedureStepFieldValuesOfAsset=bV,i.selectAssetProcedureStepFieldValuesOfAssetProcedure=MV,i.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=vV,i.selectAssetProcedureStepFields=Fs,i.selectAssetProcedureStepFieldsAttachmentById=Hl,i.selectAssetProcedureStepFieldsAttachments=Oi,i.selectAssetProcedureStepFieldsAttachmentsByIds=Gl,i.selectAssetProcedureStepFieldsAttachmentsMapping=Nl,i.selectAssetProcedureStepFieldsById=nu,i.selectAssetProcedureStepFieldsByIds=au,i.selectAssetProcedureStepFieldsMapping=Fi,i.selectAssetProcedureStepFieldsOfAssetProcedureStep=_V,i.selectAssetProcedureStepMapping=_s,i.selectAssetProcedureSteps=ki,i.selectAssetProcedureStepsByIds=Gu,i.selectAssetProcedureStepsMappingOfAssetProcedureType=kV,i.selectAssetProcedureStepsOfAssetProcedureType=EV,i.selectAssetProcedureTypeAttachmentById=nd,i.selectAssetProcedureTypeAttachmentMapping=id,i.selectAssetProcedureTypeAttachments=ri,i.selectAssetProcedureTypeAttachmentsByIds=ad,i.selectAssetProcedureTypeById=El,i.selectAssetProcedureTypeFieldValues=Os,i.selectAssetProcedureTypeFieldValuesAttachmentById=Nd,i.selectAssetProcedureTypeFieldValuesAttachments=yi,i.selectAssetProcedureTypeFieldValuesAttachmentsByIds=Hd,i.selectAssetProcedureTypeFieldValuesAttachmentsMapping=Ld,i.selectAssetProcedureTypeFieldValuesById=al,i.selectAssetProcedureTypeFieldValuesByIds=cl,i.selectAssetProcedureTypeFieldValuesMapping=nl,i.selectAssetProcedureTypeFieldValuesOfAsset=PV,i.selectAssetProcedureTypeFields=Ts,i.selectAssetProcedureTypeFieldsAttachmentById=Ad,i.selectAssetProcedureTypeFieldsAttachments=li,i.selectAssetProcedureTypeFieldsAttachmentsByIds=wd,i.selectAssetProcedureTypeFieldsAttachmentsMapping=fd,i.selectAssetProcedureTypeFieldsById=Ed,i.selectAssetProcedureTypeFieldsByIds=Vd,i.selectAssetProcedureTypeFieldsMapping=kd,i.selectAssetProcedureTypeFieldsOfAssetProcedureType=AV,i.selectAssetProcedureTypes=Pi,i.selectAssetProcedureTypesByIds=Vl,i.selectAssetProcedureTypesMapping=kl,i.selectAssetProcedureTypesOfOrganization=IV,i.selectAssetProcedures=Is,i.selectAssetProceduresByIds=wl,i.selectAssetProceduresMapping=Sl,i.selectAssetProceduresOfAssetProcedureType=fl,i.selectAssetProceduresOfAssetType=OV,i.selectAssetStageById=Bo,i.selectAssetStageCompletionById=To,i.selectAssetStageCompletionMapping=wo,i.selectAssetStageCompletions=Po,i.selectAssetStageCompletionsByIds=Oo,i.selectAssetStages=qi,i.selectAssetStagesByIds=Do,i.selectAssetStagesMappingOfAssetProcedureType=BV,i.selectAssetStagesOfAssetProcedureType=DV,i.selectAssetTypeAttachmentById=Ho,i.selectAssetTypeAttachmentMapping=No,i.selectAssetTypeAttachments=Ui,i.selectAssetTypeAttachmentsByIds=Go,i.selectAssetTypeById=Dp,i.selectAssetTypeFieldValues=Rs,i.selectAssetTypeFieldValuesAttachmentById=Eh,i.selectAssetTypeFieldValuesAttachments=Ji,i.selectAssetTypeFieldValuesAttachmentsByIds=Vh,i.selectAssetTypeFieldValuesAttachmentsMapping=kh,i.selectAssetTypeFieldValuesById=Kh,i.selectAssetTypeFieldValuesByIds=Yh,i.selectAssetTypeFieldValuesMapping=Gh,i.selectAssetTypeFieldValuesOfAsset=jV,i.selectAssetTypeFields=is,i.selectAssetTypeFieldsAttachmentById=ch,i.selectAssetTypeFieldsAttachments=Ni,i.selectAssetTypeFieldsAttachmentsByIds=rh,i.selectAssetTypeFieldsAttachmentsMapping=ah,i.selectAssetTypeFieldsById=Ph,i.selectAssetTypeFieldsByIds=Th,i.selectAssetTypeFieldsMapping=wh,i.selectAssetTypeFieldsOfAssetType=zV,i.selectAssetTypeIdentifierById=rp,i.selectAssetTypeIdentifierMapping=cp,i.selectAssetTypeIdentifierValueById=Tp,i.selectAssetTypeIdentifierValueMapping=Pp,i.selectAssetTypeIdentifierValues=bs,i.selectAssetTypeIdentifierValuesByIds=Op,i.selectAssetTypeIdentifierValuesOfAsset=UV,i.selectAssetTypeIdentifierValuesOfIdentifier=LV,i.selectAssetTypeIdentifiers=Xi,i.selectAssetTypeIdentifiersByIds=dp,i.selectAssetTypeIdentifiersOfAssetType=CV,i.selectAssetTypeStatusById=Jp,i.selectAssetTypeStatusMapping=Yp,i.selectAssetTypeStatuses=nn,i.selectAssetTypeStatusesByIds=Qp,i.selectAssetTypeStatusesOfAssetType=HV,i.selectAssetTypeValuesOfAssetType=$V,i.selectAssetTypes=tn,i.selectAssetTypesByIds=Wp,i.selectAssetTypesMapping=Bp,i.selectAssetTypesOfOrganization=NV,i.selectAssets=gs,i.selectAssetsByIds=ao,i.selectAssetsMapping=so,i.selectAssetsOfAssetType=io,i.selectAssetsOfProject=VV,i.selectAttachmentsOfAsset=Nr,i.selectAttachmentsOfAssetProcedureStepFieldValues=Au,i.selectAttachmentsOfAssetProcedureStepFields=FV,i.selectAttachmentsOfAssetProcedureType=SV,i.selectAttachmentsOfAssetProcedureTypeFieldValues=Gd,i.selectAttachmentsOfAssetProcedureTypeFields=fV,i.selectAttachmentsOfAssetType=Ko,i.selectAttachmentsOfAssetTypeFieldValues=Bh,i.selectAttachmentsOfAssetTypeFields=WV,i.selectAttachmentsOfDocument=QV,i.selectAttachmentsOfFormRevision=cB,i.selectAttachmentsOfFormSubmission=fS,i.selectAttachmentsOfIssue=wf,i.selectAttachmentsOfIssueComment=uB,i.selectAttachmentsOfIssueType=pB,i.selectAttachmentsOfIssueTypeFieldValues=Ow,i.selectAttachmentsOfIssueTypeFields=yB,i.selectAttachmentsOfProcedureFieldValues=Lg,i.selectAttachmentsOfProcedureStepFieldValues=CF,i.selectAttachmentsOfProcedureStepFields=pF,i.selectAttachmentsOfProcedureType=hD,i.selectAttachmentsOfProcedureTypeFields=pD,i.selectAttachmentsOfProject=BB,i.selectAttachmentsOfWorkflowStepFieldValues=Fv,i.selectAttachmentsOfWorkflowStepFields=JM,i.selectCommentsOfIssue=oB,i.selectConversation=mV,i.selectConversationMapping=ti,i.selectConversations=yV,i.selectCurrentUser=NP,i.selectDeletedRequests=bB,i.selectDescendantsOfAssetProcedureStep=Ku,i.selectDescendantsOfDocument=by,i.selectDocumentAttachmentById=hy,i.selectDocumentAttachmentMapping=oy,i.selectDocumentAttachmentsByIds=py,i.selectDocumentById=gy,i.selectDocuments=vs,i.selectDocumentsByIds=Ry,i.selectDocumentsMapping=dn,i.selectEmailDomainById=$y,i.selectEmailDomains=un,i.selectEmailDomainsAsMapping=jy,i.selectEmailDomainsByIds=Cy,i.selectEmailDomainsOfOrganization=xV,i.selectFieldValuesOfAssetProcedure=TV,i.selectFieldValuesOfProcedure=SD,i.selectFormById=aS,i.selectFormIdentifierById=im,i.selectFormIdentifierMapping=sm,i.selectFormIdentifierValueById=fm,i.selectFormIdentifierValueMapping=Sm,i.selectFormIdentifierValues=ks,i.selectFormIdentifierValuesByIds=Am,i.selectFormIdentifierValuesOfFormSubmission=nB,i.selectFormIdentifierValuesOfIdentifier=aB,i.selectFormIdentifiers=pn,i.selectFormIdentifiersByIds=nm,i.selectFormIdentifiersOfForm=iB,i.selectFormMapping=nS,i.selectFormRevisionAttachmentById=km,i.selectFormRevisionAttachments=vm,i.selectFormRevisionAttachmentsByIds=Em,i.selectFormRevisionAttachmentsMapping=Es,i.selectFormRevisionById=Lm,i.selectFormRevisionMapping=Um,i.selectFormRevisions=Vs,i.selectFormRevisionsByIds=Nm,i.selectFormRevisionsOfForm=Hm,i.selectFormSubmissionAttachemntsByIds=gn,i.selectFormSubmissionAttachmentById=mS,i.selectFormSubmissionAttachments=_n,i.selectFormSubmissionAttachmentsByIds=SS,i.selectFormSubmissionAttachmentsMapping=Fn,i.selectFormSubmissionById=bS,i.selectFormSubmissions=vn,i.selectFormSubmissionsByIds=MS,i.selectFormSubmissionsMapping=RS,i.selectFormSubmissionsOfForm=vS,i.selectForms=Pn,i.selectFormsByIds=cS,i.selectFormsOfOrganization=dB,i.selectGeoImageById=LS,i.selectGeoImageMapping=US,i.selectGeoImages=En,i.selectGeoImagesByIds=NS,i.selectGeoImagesOfProject=lB,i.selectIsLoggedIn=JV,i.selectIssueAssociationById=tf,i.selectIssueAssociationMapping=ef,i.selectIssueAssociations=jt,i.selectIssueAssociationsByIds=sf,i.selectIssueAssociationsOfAsset=df,i.selectIssueAssociationsOfIssue=rf,i.selectIssueAssociationsOfIssues=cf,i.selectIssueAssociationsToIssue=nf,i.selectIssueAssociationsToIssues=af,i.selectIssueAttachmentById=Pf,i.selectIssueAttachmentMapping=Af,i.selectIssueAttachments=zn,i.selectIssueAttachmentsByIds=Tf,i.selectIssueById=aA,i.selectIssueCommentAttachmentById=Bf,i.selectIssueCommentAttachmentMapping=Vf,i.selectIssueCommentAttachments=jn,i.selectIssueCommentAttachmentsByIds=Df,i.selectIssueCommentById=Kf,i.selectIssueCommentMapping=Cn,i.selectIssueCommentsByIds=Yf,i.selectIssueMapping=nA,i.selectIssueTypeAttachmentById=PA,i.selectIssueTypeAttachmentMapping=wA,i.selectIssueTypeAttachments=Gn,i.selectIssueTypeAttachmentsByIds=TA,i.selectIssueTypeById=lP,i.selectIssueTypeFieldValues=Ds,i.selectIssueTypeFieldValuesAttachmentById=Pw,i.selectIssueTypeFieldValuesAttachments=ea,i.selectIssueTypeFieldValuesAttachmentsByIds=Tw,i.selectIssueTypeFieldValuesAttachmentsMapping=ww,i.selectIssueTypeFieldValuesById=YA,i.selectIssueTypeFieldValuesByIds=JA,i.selectIssueTypeFieldValuesMapping=KA,i.selectIssueTypeFieldValuesOfIssue=mB,i.selectIssueTypeFields=ns,i.selectIssueTypeFieldsAttachmentById=BA,i.selectIssueTypeFieldsAttachments=Yn,i.selectIssueTypeFieldsAttachmentsByIds=DA,i.selectIssueTypeFieldsAttachmentsMapping=VA,i.selectIssueTypeFieldsById=dw,i.selectIssueTypeFieldsByIds=lw,i.selectIssueTypeFieldsMapping=rw,i.selectIssueTypeFieldsOfIssueType=SB,i.selectIssueTypeIdentifierById=Dw,i.selectIssueTypeIdentifierMapping=Bw,i.selectIssueTypeIdentifierValueById=Jw,i.selectIssueTypeIdentifierValueMapping=Yw,i.selectIssueTypeIdentifierValues=Ws,i.selectIssueTypeIdentifierValuesByIds=Qw,i.selectIssueTypeIdentifierValuesOfIdentifier=TB,i.selectIssueTypeIdentifierValuesOfIssue=PB,i.selectIssueTypeIdentifiers=sa,i.selectIssueTypeIdentifiersByIds=Ww,i.selectIssueTypeIdentifiersOfIssueType=wB,i.selectIssueTypeMapping=dP,i.selectIssueTypeStatusById=da,i.selectIssueTypeStatusMapping=OP,i.selectIssueTypeStatuses=ra,i.selectIssueTypeStatusesByIds=IP,i.selectIssueTypeStatusesOfIssueType=IB,i.selectIssueTypeValuesOfIssueType=AB,i.selectIssueTypes=aa,i.selectIssueTypesByIds=uP,i.selectIssueTypesOfOrganization=OB,i.selectIssueUpdateById=kP,i.selectIssueUpdateMapping=ya,i.selectIssueUpdates=ma,i.selectIssueUpdatesByIds=EP,i.selectIssueUpdatesOfIssue=VP,i.selectIssues=Bs,i.selectIssuesByIds=cA,i.selectIssuesOfIssueType=rA,i.selectIssuesOfProject=hB,i.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=gV,i.selectLatestAssetProcedureTypeFieldsOfAssetProcedureType=wV,i.selectLatestAssetTypeFieldsOfAssetType=qV,i.selectLatestFieldsByAssetProcedureStep=RV,i.selectLatestFieldsByProcedureStep=xB,i.selectLatestFormRevisionOfForm=rB,i.selectLatestIssueTypeFieldsOfIssueType=fB,i.selectLatestProcedureStepFieldValuesByProcedureStepOfProcedure=iD,i.selectLatestProcedureStepFieldValuesReviewByProcedureStepFieldValues=cD,i.selectLatestProcedureStepFieldsOfProcedureStep=XB,i.selectLatestProcedureTypeFieldsOfProcedureType=mD,i.selectLatestRetryTime=MB,i.selectLatestReviewOfProcedureStepFieldValues=nD,i.selectLatestReviewOfWorkflowStepFieldValues=YD,i.selectLatestReviewRequestOfWorkflowStepFieldValues=GD,i.selectLatestWorkflowStepFieldValuesByWorkflowStepOfWorkflow=HD,i.selectLatestWorkflowStepFieldValuesReviewByWorkflowStepFieldValues=QD,i.selectLatestWorkflowStepFieldsOfWorkflowStep=CD,i.selectMembershipsByUserOfTeam=OD,i.selectOrganizationAccessById=iT,i.selectOrganizationAccessMapping=js,i.selectOrganizationAccessUserMapping=aT,i.selectOrganizationAccessesByIds=nT,i.selectOrganizationById=AT,i.selectOrganizationDocuments=XV,i.selectOrganizations=fT,i.selectOrganizationsByIds=wT,i.selectOrganizationsMapping=ST,i.selectProcedureById=jO,i.selectProcedureFieldValues=pc,i.selectProcedureFieldValuesAttachmentById=Cg,i.selectProcedureFieldValuesAttachments=oc,i.selectProcedureFieldValuesAttachmentsByIds=Ug,i.selectProcedureFieldValuesAttachmentsMapping=$g,i.selectProcedureFieldValuesById=sR,i.selectProcedureFieldValuesByIds=iR,i.selectProcedureFieldValuesMapping=tR,i.selectProcedureStepAssigneeById=xO,i.selectProcedureStepAssignees=cs,i.selectProcedureStepAssigneesByIds=eI,i.selectProcedureStepAssigneesMapping=XO,i.selectProcedureStepAssigneesOfProcedure=$B,i.selectProcedureStepAssigneesOfProcedureAndProcedureStep=UB,i.selectProcedureStepAssigneesOfProcedureStep=CB,i.selectProcedureStepById=C_,i.selectProcedureStepCommentById=pI,i.selectProcedureStepComments=rs,i.selectProcedureStepCommentsByIds=yI,i.selectProcedureStepCommentsMapping=hI,i.selectProcedureStepCommentsOfProcedure=LB,i.selectProcedureStepCommentsOfProcedureAndProcedureStep=HB,i.selectProcedureStepCommentsOfProcedureStep=NB,i.selectProcedureStepDefaultAssigneeById=RI,i.selectProcedureStepDefaultAssignees=Da,i.selectProcedureStepDefaultAssigneesByIds=bI,i.selectProcedureStepDefaultAssigneesMapping=gI,i.selectProcedureStepDefaultAssigneesOfProcedureStep=GB,i.selectProcedureStepDefaultReviewerById=CI,i.selectProcedureStepDefaultReviewers=za,i.selectProcedureStepDefaultReviewersByIds=UI,i.selectProcedureStepDefaultReviewersMapping=$I,i.selectProcedureStepDefaultReviewersOfProcedureStep=KB,i.selectProcedureStepEventById=tF,i.selectProcedureStepEvents=ds,i.selectProcedureStepEventsByIds=sF,i.selectProcedureStepEventsMapping=eF,i.selectProcedureStepEventsOfProcedure=YB,i.selectProcedureStepEventsOfProcedureAndProcedureStep=QB,i.selectProcedureStepEventsOfProcedureStep=JB,i.selectProcedureStepFieldValues=$t,i.selectProcedureStepFieldValuesAttachmentById=jF,i.selectProcedureStepFieldValuesAttachments=Ya,i.selectProcedureStepFieldValuesAttachmentsByIds=$F,i.selectProcedureStepFieldValuesAttachmentsMapping=qF,i.selectProcedureStepFieldValuesById=e_,i.selectProcedureStepFieldValuesByIds=t_,i.selectProcedureStepFieldValuesMapping=xF,i.selectProcedureStepFieldValuesOfProcedure=eD,i.selectProcedureStepFieldValuesOfProcedureAndProcedureStep=sD,i.selectProcedureStepFieldValuesOfProcedureStep=tD,i.selectProcedureStepFieldValuesReviewById=h_,i.selectProcedureStepFieldValuesReviews=Gt,i.selectProcedureStepFieldValuesReviewsByIds=p_,i.selectProcedureStepFieldValuesReviewsMapping=o_,i.selectProcedureStepFieldValuesReviewsOfProcedureAndProcedureStep=aD,i.selectProcedureStepFields=Cs,i.selectProcedureStepFieldsAttachmentById=yF,i.selectProcedureStepFieldsAttachments=Ua,i.selectProcedureStepFieldsAttachmentsByIds=mF,i.selectProcedureStepFieldsAttachmentsMapping=hF,i.selectProcedureStepFieldsById=RF,i.selectProcedureStepFieldsByIds=bF,i.selectProcedureStepFieldsMapping=Na,i.selectProcedureStepFieldsOfProcedureStep=ZB,i.selectProcedureStepReviewerById=R_,i.selectProcedureStepReviewers=ls,i.selectProcedureStepReviewersByIds=b_,i.selectProcedureStepReviewersMapping=g_,i.selectProcedureStepReviewersOfProcedure=rD,i.selectProcedureStepReviewersOfProcedureAndProcedureStep=lD,i.selectProcedureStepReviewersOfProcedureStep=dD,i.selectProcedureSteps=sc,i.selectProcedureStepsByIds=U_,i.selectProcedureStepsMapping=tc,i.selectProcedureStepsMappingOfProcedureType=uD,i.selectProcedureStepsOfProcedureType=oD,i.selectProcedureTypeAttachmentById=tg,i.selectProcedureTypeAttachmentMapping=eg,i.selectProcedureTypeAttachments=nc,i.selectProcedureTypeAttachmentsByIds=sg,i.selectProcedureTypeById=SR,i.selectProcedureTypeFields=Us,i.selectProcedureTypeFieldsAttachmentById=mg,i.selectProcedureTypeFieldsAttachments=cc,i.selectProcedureTypeFieldsAttachmentsByIds=Sg,i.selectProcedureTypeFieldsAttachmentsMapping=yg,i.selectProcedureTypeFieldsById=Mg,i.selectProcedureTypeFieldsByIds=vg,i.selectProcedureTypeFieldsMapping=bg,i.selectProcedureTypeFieldsOfProcedureType=yD,i.selectProcedureTypes=Ls,i.selectProcedureTypesByIds=fR,i.selectProcedureTypesMapping=mR,i.selectProcedureTypesOfAssetType=fD,i.selectProcedureTypesOfIssueType=AD,i.selectProcedures=Ht,i.selectProceduresByIds=$O,i.selectProceduresMapping=qO,i.selectProceduresOfAsset=qB,i.selectProceduresOfIssue=jB,i.selectProceduresOfProcedureType=CO,i.selectProceduresOfProject=zB,i.selectProjectAccessById=qT,i.selectProjectAccessMapping=Fa,i.selectProjectAccesses=as,i.selectProjectAccessesByIds=jT,i.selectProjectAccessesOfProject=kB,i.selectProjectAttachmentById=ZT,i.selectProjectAttachmentMapping=QT,i.selectProjectAttachments=ga,i.selectProjectAttachmentsByIds=XT,i.selectProjectById=RO,i.selectProjectDocuments=ZV,i.selectProjectFileById=hO,i.selectProjectFileMapping=uO,i.selectProjectFiles=oO,i.selectProjectFilesByIds=pO,i.selectProjectMapping=gO,i.selectProjects=$s,i.selectProjectsByIds=bO,i.selectProjectsOfOrganization=WB,i.selectRehydrated=TD,i.selectReviewRequestsOfWorkflowStepFieldValues=Zv,i.selectReviewsOfProcedureStepFieldValues=y_,i.selectReviewsOfWorkflowStepFieldValues=uk,i.selectStageMapping=zi,i.selectTeamById=NR,i.selectTeamMembershipById=kR,i.selectTeamMemberships=Ns,i.selectTeamMembershipsByIds=ER,i.selectTeamMembershipsMapping=vR,i.selectTeams=Ac,i.selectTeamsByIds=HR,i.selectTeamsMapping=LR,i.selectTeamsOfOrganization=FD,i.selectUploadUrl=sB,i.selectUserById=qs,i.selectUsers=zs,i.selectUsersByIds=HP,i.selectUsersMapping=wa,i.selectUsersOfOrganization=RB,i.selectUsersOfProject=VB,i.selectUsersOfTeam=ID,i.selectWorkflowById=cb,i.selectWorkflowIssueLinkById=Ab,i.selectWorkflowIssueLinks=Kt,i.selectWorkflowIssueLinksByIds=wb,i.selectWorkflowIssueLinksMapping=fb,i.selectWorkflowIssueLinksOfIssue=Ob,i.selectWorkflowIssueLinksOfIssues=bD,i.selectWorkflowIssueLinksOfWorkflow=Pb,i.selectWorkflowIssueLinksOfWorkflows=Tb,i.selectWorkflowMapping=ab,i.selectWorkflowStepAssigneeById=Db,i.selectWorkflowStepAssignees=hs,i.selectWorkflowStepAssigneesByIds=Wb,i.selectWorkflowStepAssigneesMapping=Bb,i.selectWorkflowStepAssigneesOfWorkflow=MD,i.selectWorkflowStepAssigneesOfWorkflowAndWorkflowStep=kD,i.selectWorkflowStepAssigneesOfWorkflowStep=vD,i.selectWorkflowStepById=zk,i.selectWorkflowStepCommentById=Jb,i.selectWorkflowStepComments=ps,i.selectWorkflowStepCommentsByIds=Qb,i.selectWorkflowStepCommentsMapping=Yb,i.selectWorkflowStepCommentsOfWorkflow=ED,i.selectWorkflowStepCommentsOfWorkflowAndWorkflowStep=BD,i.selectWorkflowStepCommentsOfWorkflowStep=VD,i.selectWorkflowStepDefaultAssigneeById=lM,i.selectWorkflowStepDefaultAssignees=Fc,i.selectWorkflowStepDefaultAssigneesByIds=uM,i.selectWorkflowStepDefaultAssigneesMapping=dM,i.selectWorkflowStepDefaultAssigneesOfWorkflowStep=DD,i.selectWorkflowStepDefaultReviewerById=IM,i.selectWorkflowStepDefaultReviewers=gc,i.selectWorkflowStepDefaultReviewersByIds=FM,i.selectWorkflowStepDefaultReviewersMapping=OM,i.selectWorkflowStepDefaultReviewersOfWorkflowStep=WD,i.selectWorkflowStepEventById=zM,i.selectWorkflowStepEvents=ys,i.selectWorkflowStepEventsByIds=qM,i.selectWorkflowStepEventsMapping=WM,i.selectWorkflowStepEventsOfWorkflow=zD,i.selectWorkflowStepEventsOfWorkflowAndWorkflowStep=jD,i.selectWorkflowStepEventsOfWorkflowStep=qD,i.selectWorkflowStepFieldValues=Dt,i.selectWorkflowStepFieldValuesAttachmentById=Ov,i.selectWorkflowStepFieldValuesAttachments=Wc,i.selectWorkflowStepFieldValuesAttachmentsByIds=Iv,i.selectWorkflowStepFieldValuesAttachmentsMapping=Tv,i.selectWorkflowStepFieldValuesById=zv,i.selectWorkflowStepFieldValuesByIds=qv,i.selectWorkflowStepFieldValuesMapping=Wv,i.selectWorkflowStepFieldValuesOfWorkflow=UD,i.selectWorkflowStepFieldValuesOfWorkflowAndWorkflowStep=ND,i.selectWorkflowStepFieldValuesOfWorkflowStep=LD,i.selectWorkflowStepFieldValuesReviewById=dk,i.selectWorkflowStepFieldValuesReviewRequestById=Jv,i.selectWorkflowStepFieldValuesReviewRequests=ms,i.selectWorkflowStepFieldValuesReviewRequestsByIds=Qv,i.selectWorkflowStepFieldValuesReviewRequestsMapping=Yv,i.selectWorkflowStepFieldValuesReviewRequestsOfWorkflowAndWorkflowStep=KD,i.selectWorkflowStepFieldValuesReviews=Yt,i.selectWorkflowStepFieldValuesReviewsByIds=lk,i.selectWorkflowStepFieldValuesReviewsMapping=rk,i.selectWorkflowStepFieldValuesReviewsOfWorkflowAndWorkflowStep=JD,i.selectWorkflowStepFields=Gs,i.selectWorkflowStepFieldsAttachmentById=QM,i.selectWorkflowStepFieldsAttachments=kc,i.selectWorkflowStepFieldsAttachmentsByIds=ZM,i.selectWorkflowStepFieldsAttachmentsMapping=YM,i.selectWorkflowStepFieldsById=uv,i.selectWorkflowStepFieldsByIds=ov,i.selectWorkflowStepFieldsMapping=lv,i.selectWorkflowStepFieldsOfWorkflowStep=$D,i.selectWorkflowStepReviewerById=Ik,i.selectWorkflowStepReviewers=Ss,i.selectWorkflowStepReviewersByIds=Fk,i.selectWorkflowStepReviewersMapping=Ok,i.selectWorkflowStepReviewersOfWorkflow=ZD,i.selectWorkflowStepReviewersOfWorkflowAndWorkflowStep=xD,i.selectWorkflowStepReviewersOfWorkflowStep=XD,i.selectWorkflowSteps=Gc,i.selectWorkflowStepsByIds=qk,i.selectWorkflowStepsMapping=Wk,i.selectWorkflowStepsOfWorkflowType=eW,i.selectWorkflowTypeById=Zk,i.selectWorkflowTypeMapping=Qk,i.selectWorkflowTypes=Yc,i.selectWorkflowTypesByIds=Xk,i.selectWorkflowTypesOfOrganization=tW,i.selectWorkflows=Hs,i.selectWorkflowsByIds=rb,i.selectWorkflowsOfProject=gD,i.selectWorkflowsOfWorkflowType=RD,i.setAsset=eo,i.setAssetAttachment=Wr,i.setAssetAttachments=zr,i.setAssetProcedure=pl,i.setAssetProcedureStep=Wu,i.setAssetProcedureStepFieldValues=Fu,i.setAssetProcedureStepFieldValuesAttachment=uu,i.setAssetProcedureStepFieldValuesAttachments=ou,i.setAssetProcedureStepFieldValuesMany=_u,i.setAssetProcedureStepFields=Xl,i.setAssetProcedureStepFieldsAttachment=ql,i.setAssetProcedureStepFieldsAttachments=jl,i.setAssetProcedureStepFieldsMany=xl,i.setAssetProcedureSteps=zu,i.setAssetProcedureType=bl,i.setAssetProcedureTypeAttachment=Qr,i.setAssetProcedureTypeAttachments=Zr,i.setAssetProcedureTypeFieldValues=Zd,i.setAssetProcedureTypeFieldValuesAttachment=zd,i.setAssetProcedureTypeFieldValuesAttachments=qd,i.setAssetProcedureTypeFieldValuesMany=Xd,i.setAssetProcedureTypeFields=Fd,i.setAssetProcedureTypeFieldsAttachment=ud,i.setAssetProcedureTypeFieldsAttachments=od,i.setAssetProcedureTypeFieldsMany=_d,i.setAssetProcedureTypes=Ml,i.setAssetProcedures=yl,i.setAssetStage=_o,i.setAssetStageCompletion=ho,i.setAssetStageCompletions=po,i.setAssetStages=go,i.setAssetType=gp,i.setAssetTypeAttachment=jo,i.setAssetTypeAttachments=$o,i.setAssetTypeFieldValues=$h,i.setAssetTypeFieldValuesAttachment=gh,i.setAssetTypeFieldValuesAttachments=Rh,i.setAssetTypeFieldValuesMany=Ch,i.setAssetTypeFields=ph,i.setAssetTypeFieldsAttachment=xo,i.setAssetTypeFieldsAttachments=eh,i.setAssetTypeFieldsMany=yh,i.setAssetTypeIdentifier=ep,i.setAssetTypeIdentifierValue=yp,i.setAssetTypeIdentifierValues=mp,i.setAssetTypeIdentifiers=tp,i.setAssetTypeStatus=Up,i.setAssetTypeStatuses=Lp,i.setAssetTypes=Rp,i.setAssets=to,i.setClientSDK=wE,i.setClientStore=fE,i.setConversation=vr,i.setConversations=uV,i.setCurrentUser=FB,i.setCurrentUserProfile=_B,i.setDocument=wy,i.setDocumentAttachment=ay,i.setDocumentAttachments=cy,i.setDocuments=Py,i.setEmailDomain=Vy,i.setEmailDomains=By,i.setForm=Zm,i.setFormIdentifier=Qy,i.setFormIdentifierValue=um,i.setFormIdentifierValues=om,i.setFormIdentifiers=Zy,i.setFormRevision=zm,i.setFormRevisionAttachment=Fm,i.setFormRevisionAttachments=_m,i.setFormRevisions=qm,i.setFormSubmission=TS,i.setFormSubmissionAttachment=uS,i.setFormSubmissionAttachments=oS,i.setFormSubmissions=OS,i.setForms=Xm,i.setGeoImage=BS,i.setGeoImages=DS,i.setIssue=xf,i.setIssueAssociation=JS,i.setIssueAssociations=YS,i.setIssueAttachment=pf,i.setIssueAttachments=yf,i.setIssueComment=Cf,i.setIssueCommentAttachment=Rf,i.setIssueCommentAttachments=bf,i.setIssueComments=Uf,i.setIssueType=sP,i.setIssueTypeAttachment=pA,i.setIssueTypeAttachments=yA,i.setIssueTypeFieldValues=CA,i.setIssueTypeFieldValuesAttachment=yw,i.setIssueTypeFieldValuesAttachments=mw,i.setIssueTypeFieldValuesMany=UA,i.setIssueTypeFields=tw,i.setIssueTypeFieldsAttachment=RA,i.setIssueTypeFieldsAttachments=bA,i.setIssueTypeFieldsMany=sw,i.setIssueTypeIdentifier=bw,i.setIssueTypeIdentifierValue=Uw,i.setIssueTypeIdentifierValues=Lw,i.setIssueTypeIdentifiers=Mw,i.setIssueTypeStatus=SP,i.setIssueTypeStatuses=fP,i.setIssueTypes=iP,i.setIssueUpdate=RP,i.setIssueUpdates=bP,i.setIssues=eA,i.setLoggedIn=xp,i.setOrganization=lT,i.setOrganizationAccess=QP,i.setOrganizationAccesses=ZP,i.setOrganizations=dT,i.setProcedure=EO,i.setProcedureFieldValues=Yg,i.setProcedureFieldValuesAttachment=Bg,i.setProcedureFieldValuesAttachments=Dg,i.setProcedureFieldValuesMany=Jg,i.setProcedureStep=E_,i.setProcedureStepAssignee=GO,i.setProcedureStepAssignees=KO,i.setProcedureStepComment=cI,i.setProcedureStepComments=rI,i.setProcedureStepDefaultAssignee=PI,i.setProcedureStepDefaultAssignees=TI,i.setProcedureStepDefaultReviewer=BI,i.setProcedureStepDefaultReviewers=DI,i.setProcedureStepEvent=YI,i.setProcedureStepEvents=JI,i.setProcedureStepFieldValues=KF,i.setProcedureStepFieldValuesAttachment=VF,i.setProcedureStepFieldValuesAttachments=BF,i.setProcedureStepFieldValuesMany=YF,i.setProcedureStepFieldValuesReview=c_,i.setProcedureStepFieldValuesReviews=r_,i.setProcedureStepFields=TF,i.setProcedureStepFieldsAttachment=rF,i.setProcedureStepFieldsAttachments=dF,i.setProcedureStepFieldsMany=OF,i.setProcedureStepReviewer=P_,i.setProcedureStepReviewers=T_,i.setProcedureSteps=V_,i.setProcedureType=dR,i.setProcedureTypeAttachment=K_,i.setProcedureTypeAttachments=Y_,i.setProcedureTypeFields=Tg,i.setProcedureTypeFieldsAttachment=rg,i.setProcedureTypeFieldsAttachments=dg,i.setProcedureTypeFieldsMany=Og,i.setProcedureTypes=lR,i.setProcedures=VO,i.setProject=AO,i.setProjectAccess=kT,i.setProjectAccesses=ET,i.setProjectAttachment=NT,i.setProjectAttachments=HT,i.setProjectFile=sO,i.setProjectFiles=iO,i.setProjects=fO,i.setRehydrated=PD,i.setTeam=zR,i.setTeamMembership=IR,i.setTeamMemberships=FR,i.setTeams=qR,i.setTokens=GV,i.setUploadUrl=tB,i.setUser=qP,i.setUsers=zP,i.setWorkflow=xR,i.setWorkflowIssueLink=hb,i.setWorkflowIssueLinks=pb,i.setWorkflowStep=vk,i.setWorkflowStepAssignee=bb,i.setWorkflowStepAssignees=Mb,i.setWorkflowStepComment=Ub,i.setWorkflowStepComments=Lb,i.setWorkflowStepDefaultAssignee=sM,i.setWorkflowStepDefaultAssignees=iM,i.setWorkflowStepDefaultReviewer=SM,i.setWorkflowStepDefaultReviewers=fM,i.setWorkflowStepEvent=vM,i.setWorkflowStepEvents=kM,i.setWorkflowStepFieldValues=vv,i.setWorkflowStepFieldValuesAttachment=Sv,i.setWorkflowStepFieldValuesAttachments=fv,i.setWorkflowStepFieldValuesMany=kv,i.setWorkflowStepFieldValuesReview=sk,i.setWorkflowStepFieldValuesReviewRequest=Lv,i.setWorkflowStepFieldValuesReviewRequests=Nv,i.setWorkflowStepFieldValuesReviews=ik,i.setWorkflowStepFields=iv,i.setWorkflowStepFieldsAttachment=LM,i.setWorkflowStepFieldsAttachments=NM,i.setWorkflowStepFieldsMany=nv,i.setWorkflowStepReviewer=Sk,i.setWorkflowStepReviewers=fk,i.setWorkflowSteps=kk,i.setWorkflowType=Nk,i.setWorkflowTypes=Hk,i.setWorkflows=eb,i.shallowEqual=UE,i.slugify=iV,i.spacesToDashesLower=sV,i.teamMembershipReducer=MR,i.teamMembershipSlice=Sc,i.teamReducer=GR,i.teamSlice=fc,i.toFileNameSafeString=tV,i.toUuidArray=E,i.toUuidIdRecord=eV,i.truncate=nV,i.updateAsset=Zu,i.updateAssetAttachment=qr,i.updateAssetAttachments=jr,i.updateAssetProcedure=ul,i.updateAssetProcedureStep=$u,i.updateAssetProcedureStepFieldValues=gu,i.updateAssetProcedureStepFieldValuesAttachment=hu,i.updateAssetProcedureStepFieldValuesAttachments=pu,i.updateAssetProcedureStepFieldValuesMany=Ru,i.updateAssetProcedureStepFields=eu,i.updateAssetProcedureStepFieldsAttachment=$l,i.updateAssetProcedureStepFieldsAttachments=Cl,i.updateAssetProcedureStepFieldsMany=tu,i.updateAssetProcedureSteps=Cu,i.updateAssetProcedureType=Fl,i.updateAssetProcedureTypeAttachment=Xr,i.updateAssetProcedureTypeAttachments=xr,i.updateAssetProcedureTypeFieldValues=xd,i.updateAssetProcedureTypeFieldValuesAttachment=jd,i.updateAssetProcedureTypeFieldValuesAttachments=$d,i.updateAssetProcedureTypeFieldValuesMany=el,i.updateAssetProcedureTypeFields=gd,i.updateAssetProcedureTypeFieldsAttachment=hd,i.updateAssetProcedureTypeFieldsAttachments=pd,i.updateAssetProcedureTypeFieldsMany=Rd,i.updateAssetProcedureTypes=_l,i.updateAssetProcedures=ol,i.updateAssetStage=Mo,i.updateAssetStageCompletion=yo,i.updateAssetStageCompletions=mo,i.updateAssetStages=vo,i.updateAssetType=vp,i.updateAssetTypeAttachment=Co,i.updateAssetTypeAttachments=Uo,i.updateAssetTypeFieldValues=Uh,i.updateAssetTypeFieldValuesAttachment=bh,i.updateAssetTypeFieldValuesAttachments=Mh,i.updateAssetTypeFieldValuesMany=Lh,i.updateAssetTypeFields=mh,i.updateAssetTypeFieldsAttachment=th,i.updateAssetTypeFieldsAttachments=sh,i.updateAssetTypeFieldsMany=Sh,i.updateAssetTypeIdentifier=sp,i.updateAssetTypeIdentifierValue=Sp,i.updateAssetTypeIdentifierValues=fp,i.updateAssetTypeIdentifiers=ip,i.updateAssetTypeStatus=Np,i.updateAssetTypeStatuses=Hp,i.updateAssetTypes=kp,i.updateAssets=Xu,i.updateConversation=kr,i.updateConversations=oV,i.updateDocument=Ty,i.updateDocumentAttachment=ry,i.updateDocumentAttachments=dy,i.updateDocuments=Oy,i.updateEmailDomain=Dy,i.updateEmailDomains=Wy,i.updateForm=xm,i.updateFormIdentifier=Xy,i.updateFormIdentifierValue=hm,i.updateFormIdentifierValues=pm,i.updateFormIdentifiers=xy,i.updateFormRevision=jm,i.updateFormRevisionAttachment=gm,i.updateFormRevisionAttachments=Rm,i.updateFormRevisions=$m,i.updateFormSubmission=FS,i.updateFormSubmissionAttachment=hS,i.updateFormSubmissionAttachments=pS,i.updateFormSubmissions=_S,i.updateForms=eS,i.updateGeoImage=qS,i.updateGeoImages=jS,i.updateIssue=tA,i.updateIssueAssociation=QS,i.updateIssueAssociations=ZS,i.updateIssueAttachment=mf,i.updateIssueAttachments=Sf,i.updateIssueComment=Lf,i.updateIssueCommentAttachment=Mf,i.updateIssueCommentAttachments=vf,i.updateIssueComments=Nf,i.updateIssueType=nP,i.updateIssueTypeAttachment=mA,i.updateIssueTypeAttachments=SA,i.updateIssueTypeFieldValues=LA,i.updateIssueTypeFieldValuesAttachment=Sw,i.updateIssueTypeFieldValuesAttachments=fw,i.updateIssueTypeFieldValuesMany=NA,i.updateIssueTypeFields=iw,i.updateIssueTypeFieldsAttachment=MA,i.updateIssueTypeFieldsAttachments=vA,i.updateIssueTypeFieldsMany=nw,i.updateIssueTypeIdentifier=vw,i.updateIssueTypeIdentifierValue=Nw,i.updateIssueTypeIdentifierValues=Hw,i.updateIssueTypeIdentifiers=kw,i.updateIssueTypeStatus=AP,i.updateIssueTypeStatuses=wP,i.updateIssueTypes=aP,i.updateIssueUpdate=MP,i.updateIssueUpdates=vP,i.updateIssues=sA,i.updateOrganization=pT,i.updateOrganizationAccess=XP,i.updateOrganizationAccesses=xP,i.updateOrganizations=hT,i.updateProcedure=BO,i.updateProcedureFieldValues=Qg,i.updateProcedureFieldValuesAttachment=Wg,i.updateProcedureFieldValuesAttachments=zg,i.updateProcedureFieldValuesMany=Zg,i.updateProcedureStep=W_,i.updateProcedureStepAssignee=YO,i.updateProcedureStepAssignees=JO,i.updateProcedureStepComment=dI,i.updateProcedureStepComments=lI,i.updateProcedureStepDefaultAssignee=OI,i.updateProcedureStepDefaultAssignees=II,i.updateProcedureStepDefaultReviewer=WI,i.updateProcedureStepDefaultReviewers=zI,i.updateProcedureStepEvent=QI,i.updateProcedureStepEvents=ZI,i.updateProcedureStepFieldValues=JF,i.updateProcedureStepFieldValuesAttachment=DF,i.updateProcedureStepFieldValuesAttachments=WF,i.updateProcedureStepFieldValuesMany=QF,i.updateProcedureStepFieldValuesReview=d_,i.updateProcedureStepFieldValuesReviews=l_,i.updateProcedureStepFields=IF,i.updateProcedureStepFieldsAttachment=lF,i.updateProcedureStepFieldsAttachments=uF,i.updateProcedureStepFieldsMany=FF,i.updateProcedureStepReviewer=O_,i.updateProcedureStepReviewers=I_,i.updateProcedureSteps=z_,i.updateProcedureType=uR,i.updateProcedureTypeAttachment=J_,i.updateProcedureTypeAttachments=Q_,i.updateProcedureTypeFields=Ig,i.updateProcedureTypeFieldsAttachment=lg,i.updateProcedureTypeFieldsAttachments=ug,i.updateProcedureTypeFieldsMany=Fg,i.updateProcedureTypes=oR,i.updateProcedures=DO,i.updateProject=OO,i.updateProjectAccess=VT,i.updateProjectAccesses=BT,i.updateProjectAttachment=GT,i.updateProjectAttachments=KT,i.updateProjectFile=cO,i.updateProjectFiles=rO,i.updateProjects=TO,i.updateTeam=jR,i.updateTeamMembership=_R,i.updateTeamMemberships=gR,i.updateTeams=$R,i.updateUser=CP,i.updateUsers=$P,i.updateWorkflow=tb,i.updateWorkflowIssueLink=yb,i.updateWorkflowIssueLinks=mb,i.updateWorkflowStep=Ek,i.updateWorkflowStepAssignee=vb,i.updateWorkflowStepAssignees=kb,i.updateWorkflowStepComment=Nb,i.updateWorkflowStepComments=Hb,i.updateWorkflowStepDefaultAssignee=nM,i.updateWorkflowStepDefaultAssignees=aM,i.updateWorkflowStepDefaultReviewer=AM,i.updateWorkflowStepDefaultReviewers=wM,i.updateWorkflowStepEvent=EM,i.updateWorkflowStepEvents=VM,i.updateWorkflowStepFieldValues=Ev,i.updateWorkflowStepFieldValuesAttachment=Av,i.updateWorkflowStepFieldValuesAttachments=wv,i.updateWorkflowStepFieldValuesMany=Vv,i.updateWorkflowStepFieldValuesReview=nk,i.updateWorkflowStepFieldValuesReviewRequest=Hv,i.updateWorkflowStepFieldValuesReviewRequests=Gv,i.updateWorkflowStepFieldValuesReviews=ak,i.updateWorkflowStepFields=av,i.updateWorkflowStepFieldsAttachment=HM,i.updateWorkflowStepFieldsAttachments=GM,i.updateWorkflowStepFieldsMany=cv,i.updateWorkflowStepReviewer=Ak,i.updateWorkflowStepReviewers=wk,i.updateWorkflowSteps=Vk,i.updateWorkflowType=Gk,i.updateWorkflowTypes=Kk,i.updateWorkflows=sb,i.useSelectorBuilder=CE,i.userReducer=LP,i.userSlice=Sa,i.uuidObj=P,i.uuidObjSortFn=xs,i.uuidSortFn=Ps,i.versioningReducer=YR,i.versioningSlice=KR,i.workflowIssueLinkReducer=Ib,i.workflowIssueLinkSlice=Pc,i.workflowReducer=db,i.workflowSlice=wc,i.workflowStepAssigneeReducer=zb,i.workflowStepAssigneeSlice=Tc,i.workflowStepCommentReducer=Zb,i.workflowStepCommentSlice=Oc,i.workflowStepDefaultAssigneeReducer=oM,i.workflowStepDefaultAssigneeSlice=Ic,i.workflowStepDefaultReviewerReducer=_M,i.workflowStepDefaultReviewerSlice=_c,i.workflowStepEventReducer=jM,i.workflowStepEventSlice=Rc,i.workflowStepFieldValuesAttachmentReducer=_v,i.workflowStepFieldValuesAttachmentSlice=Vc,i.workflowStepFieldValuesReducer=jv,i.workflowStepFieldValuesReviewReducer=ok,i.workflowStepFieldValuesReviewRequestReducer=Xv,i.workflowStepFieldValuesReviewRequestSlice=qc,i.workflowStepFieldValuesReviewSlice=Cc,i.workflowStepFieldValuesSlice=zc,i.workflowStepFieldsAttachmentReducer=XM,i.workflowStepFieldsAttachmentSlice=bc,i.workflowStepFieldsReducer=hv,i.workflowStepFieldsSlice=Ec,i.workflowStepReducer=jk,i.workflowStepReviewerReducer=_k,i.workflowStepReviewerSlice=Nc,i.workflowStepSlice=Hc,i.workflowTypeReducer=xk,i.workflowTypeSlice=Kc,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 ws(e),file_type:e.type,extension:mr(e),size:e.size};return await this.client.files.addCache(e),a}}class HW extends b{constructor(){super(...arguments);p(this,"name","Form Identifier");p(this,"url","/form-identifiers");p(this,"actions",{addOne:Yy,addMany:Jy,setOne:Qy,setMany:Zy,updateOne:Xy,updateMany:xy,deleteOne:em,deleteMany:tm,initialize:Ky});p(this,"selectors",{selectById:im,selectByIds:nm})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,l=new Date().toISOString(),u=O({...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:_(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 GW extends b{constructor(){super(...arguments);p(this,"name","Form Identifier Value");p(this,"url","/form-identifier-values");p(this,"actions",{addOne:dm,addMany:lm,setOne:um,setMany:om,updateOne:hm,updateMany:pm,deleteOne:ym,deleteMany:mm,initialize:rm});p(this,"selectors",{selectById:fm,selectByIds:Am})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,l=new Date().toISOString(),u=O({...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:_(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 KW extends D{constructor(){super(...arguments);p(this,"name","Form Revision Attachment");p(this,"url","/form-revision-attachments");p(this,"actions",{addOne:Tm,addMany:Im,setOne:Fm,setMany:_m,updateOne:gm,updateMany:Rm,deleteOne:bm,deleteMany:Mm,initialize:Om});p(this,"selectors",{selectById:Em,selectByIds:km})}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 O({...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 YW extends b{constructor(){super(...arguments);p(this,"name","Form Revision");p(this,"url","/form-revisions");p(this,"actions",{addOne:Wm,addMany:Sn,setOne:zm,setMany:qm,updateOne:jm,updateMany:$m,deleteOne:Cm,deleteMany:fn,initialize:Dm});p(this,"selectors",{selectById:Lm,selectByIds:Nm})}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=O({...e,created_by:l,submitted_at:u});this.dispatch(a(y));const m=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:_(y),blockers:[e.form],blocks:[y.uuid]});return m.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,m]}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 JW extends b{constructor(){super(...arguments);p(this,"name","Form");p(this,"url","/forms");p(this,"actions",{addOne:Jm,addMany:Qm,setOne:Zm,setMany:Xm,updateOne:xm,updateMany:eS,deleteOne:tS,deleteMany:sS,initialize:Ym});p(this,"selectors",{selectById:aS,selectByIds:cS})}add(e){var m;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,u=O({...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:_(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 form 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 form to exist");const u=vS(e)(d),y=Hm(e)(d);this.dispatch(a(e)),this.dispatch(bn(v(u))),this.dispatch(fn(v(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(m){throw this.dispatch(c(l)),this.dispatch(Sn(y)),this.dispatch(Rn(u)),m}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class QW extends D{constructor(){super(...arguments);p(this,"name","Form Submission Attachment");p(this,"url","/form-submission-attachments");p(this,"actions",{addOne:lS,addMany:On,setOne:uS,setMany:oS,updateOne:hS,updateMany:pS,deleteOne:yS,deleteMany:Tn,initialize:dS});p(this,"selectors",{selectById:mS,selectByIds:SS})}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 O({...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=_n(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 ZW extends b{constructor(){super(...arguments);p(this,"name","Form Submission");p(this,"url","/form-submissions");p(this,"actions",{addOne:IS,addMany:Rn,setOne:OS,setMany:TS,updateOne:FS,updateMany:_S,deleteOne:gS,deleteMany:bn,initialize:PS});p(this,"selectors",{selectById:bS,selectByIds:MS})}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=O({...e,created_by:l,submitted_at:u}),m=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:_(y),blockers:[e.form_revision],blocks:[y.uuid]});return this.dispatch(a(y)),m.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,m]}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=fS(e)(d);this.dispatch(a(e)),this.dispatch(Tn(v(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(On(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 XW extends D{constructor(){super(...arguments);p(this,"name","Geo Image");p(this,"url","/geo-images");p(this,"actions",{addOne:WS,addMany:zS,setOne:BS,setMany:DS,updateOne:qS,updateMany:jS,deleteOne:$S,deleteMany:CS,initialize:VS});p(this,"selectors",{selectById:LS,selectByIds:NS})}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 O({...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 xW extends b{constructor(){super(...arguments);p(this,"name","Issue Association");p(this,"url","/issue-associations");p(this,"actions",{addOne:XS,addMany:zt,setOne:JS,setMany:YS,updateOne:QS,updateMany:ZS,deleteOne:xS,deleteMany:qt,initialize:KS});p(this,"selectors",{selectById:tf,selectByIds:sf})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,u=O({...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:_(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]}bulkAdd(e){var m;const{store:n}=this.client,{addMany:a,deleteMany:c,updateMany:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,l=new Date().toISOString(),u=e.map(f=>O({...f,submitted_at:l,created_by:d}));this.dispatch(a(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{payloads:u.map(f=>_(f)),submitted_at:l},blockers:u.flatMap(f=>[f.associated_issue,...f.issue?[f.issue]:[],...f.asset?[f.asset]:[]]),blocks:v(u)});return y.then(f=>{this.dispatch(r(f))}).catch(()=>{this.dispatch(c(v(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(`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 ez extends D{constructor(){super(...arguments);p(this,"name","Issue Attachment");p(this,"url","/issue-attachments");p(this,"actions",{addOne:hf,addMany:Bn,setOne:pf,setMany:yf,updateOne:mf,updateMany:Sf,deleteOne:ff,deleteMany:Dn,initialize:of});p(this,"selectors",{selectById:Pf,selectByIds:Of})}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 O({...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 tz extends D{constructor(){super(...arguments);p(this,"name","Issue Comment Attachment");p(this,"url","/issue-comment-attachments");p(this,"actions",{addOne:_f,addMany:gf,setOne:Rf,setMany:bf,updateOne:Mf,updateMany:vf,deleteOne:Ef,deleteMany:kf,initialize:Ff});p(this,"selectors",{selectById:Bf,selectByIds:Df})}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 O({...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 sz extends b{constructor(){super(...arguments);p(this,"name","Issue Comment");p(this,"url","/issue-comments");p(this,"actions",{addOne:jf,addMany:$f,setOne:Cf,setMany:Uf,updateOne:Lf,updateMany:Nf,deleteOne:Hf,deleteMany:Gf,initialize:qf});p(this,"selectors",{selectById:Kf,selectByIds:Yf})}add(e){const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=O({...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:_(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 iz extends b{constructor(){super(...arguments);p(this,"name","Issue");p(this,"url","/issues");p(this,"actions",{addOne:Xf,addMany:Un,setOne:xf,setMany:eA,updateOne:tA,updateMany:sA,deleteOne:iA,deleteMany:Ln,initialize:Zf});p(this,"selectors",{selectById:aA,selectByIds:cA})}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=O({...e,submitted_at:l,created_by:u});this.dispatch(a(y));const m=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:_(y),blockers:[y.project,y.issue_type,y.status],blocks:[y.uuid]});return m.then(F=>{this.dispatch(c(F))}).catch(F=>{throw this.dispatch(r(y.uuid)),F}),[y,m]}update(e){var m;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],R=ra(F)(c);if(!R)throw new Error(`Trying to update issue type status with ${F} which does not exist in store`);l[f]={name:R.name,color:R.color,uuid:R.uuid};break}case $.ASSIGNED_TO:{const F=e[f];if(F===null)l[f]=null;else{const R=qs(F)(c);if(!R)throw new Error(`Trying to update assigned to with ${F} which does not exist in store.`);l[f]={full_name:R.username,id:R.id}}break}}const u=O({created_by:((m=c.userReducer.currentUser)==null?void 0:m.id)??null,submitted_at:new Date().toISOString(),issue:r.uuid,changes:l});this.dispatch(la(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(oa(u.uuid))}),[d,y]}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,d=v(e).toSorted(Ps);if(d.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=r(d)(a.getState()).toSorted(Xs);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=Dt(e,Math.min(n??e.length,kt)),m=[];let f=null;for(const F of y){const R=Vt.v4(),k=v(F),g=F.map(({status:M})=>M).filter(Boolean),E=this.enqueueRequest({description:w(h.PATCH,this.name,!0),method:h.PATCH,url:`${this.url}/bulk/`,payload:{payloads:F},blockers:(f?[f]:[]).concat(k).concat(g),blocks:[R].concat(k)});m.push(E),f=R}return Promise.all(m).then(F=>{this.dispatch(c(F.flat()))}).catch(()=>{this.dispatch(c(l))}),[u,m]}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=nf(e)(d),y=rf(e)(d),m=Tb(e)(d),f=wf(e)(d),F=VP(e)(d);this.dispatch(a(e)),this.dispatch(Dn(v(f))),this.dispatch(ha(v(F))),this.dispatch(qt(v(u))),this.dispatch(qt(v(y))),this.dispatch(os(v(m)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(R){throw this.dispatch(c(l)),this.dispatch(Bn(f)),this.dispatch(ua(F)),this.dispatch(zt(u)),this.dispatch(zt(y)),this.dispatch(us(m)),R}}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=af(e)(d),y=cf(e)(d),m=Ob(e)(d);this.dispatch(c(e)),this.dispatch(qt(v(u))),this.dispatch(qt(v(y))),this.dispatch(os(v(m)));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(zt(u)),this.dispatch(zt(y)),this.dispatch(us(m)),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 nz extends D{constructor(){super(...arguments);p(this,"name","Issue Type Attachment");p(this,"url","/issue-type-attachments");p(this,"actions",{addOne:oA,addMany:hA,setOne:pA,setMany:yA,updateOne:mA,updateMany:SA,deleteOne:fA,deleteMany:AA,initialize:uA});p(this,"selectors",{selectById:PA,selectByIds:OA})}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 O({...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 az extends D{constructor(){super(...arguments);p(this,"name","Issue Type Fields Attachment");p(this,"url","/issue-type-fields-attachments");p(this,"actions",{addOne:_A,addMany:gA,setOne:RA,setMany:bA,updateOne:MA,updateMany:vA,deleteOne:EA,deleteMany:kA,initialize:FA});p(this,"selectors",{selectById:BA,selectByIds:DA})}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 O({...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 cz extends b{constructor(){super(...arguments);p(this,"name","Issue Type Fields");p(this,"url","/issue-type-fields");p(this,"actions",{addOne:xA,addMany:ew,setOne:tw,setMany:sw,updateOne:iw,updateMany:nw,deleteOne:aw,deleteMany:cw,initialize:XA});p(this,"selectors",{selectById:dw,selectByIds:lw})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,l=new Date().toISOString(),u=O({...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:_(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 rz extends D{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:Zn,setOne:yw,setMany:mw,updateOne:Sw,updateMany:fw,deleteOne:Aw,deleteMany:Xn,initialize:hw});p(this,"selectors",{selectById:Pw,selectByIds:Ow})}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 O({...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 b{constructor(){super(...arguments);p(this,"name","Issue Type Field Values");p(this,"url","/issue-type-field-values");p(this,"actions",{addOne:jA,addMany:$A,setOne:CA,setMany:UA,updateOne:LA,updateMany:NA,deleteOne:HA,deleteMany:GA,initialize:qA});p(this,"selectors",{selectById:YA,selectByIds:JA})}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=O({...e,created_by:l,submitted_at:u}),m=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:_(y),blockers:[e.issue,e.fields_revision],blocks:[y.uuid]});return this.dispatch(a(y)),m.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,m]}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=Tw(e)(d);this.dispatch(a(e)),this.dispatch(Xn(v(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(Zn(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 lz extends b{constructor(){super(...arguments);p(this,"name","Issue Type Identifier");p(this,"url","/issue-type-identifiers");p(this,"actions",{addOne:gw,addMany:Rw,setOne:bw,setMany:Mw,updateOne:vw,updateMany:Ew,deleteOne:kw,deleteMany:Vw,initialize:_w});p(this,"selectors",{selectById:Dw,selectByIds:Ww})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,l=new Date().toISOString(),u=O({...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:_(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 uz extends b{constructor(){super(...arguments);p(this,"name","Issue Type Identifier Value");p(this,"url","/issue-type-identifier-values");p(this,"actions",{addOne:$w,addMany:Cw,setOne:Uw,setMany:Lw,updateOne:Nw,updateMany:Hw,deleteOne:Gw,deleteMany:Kw,initialize:jw});p(this,"selectors",{selectById:Jw,selectByIds:Qw})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,l=new Date().toISOString(),u=O({...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:_(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 oz extends b{constructor(){super(...arguments);p(this,"name","Issue Type");p(this,"url","/issue-types");p(this,"actions",{addOne:eP,addMany:tP,setOne:sP,setMany:iP,updateOne:nP,updateMany:aP,deleteOne:cP,deleteMany:rP,initialize:xw});p(this,"selectors",{selectById:lP,selectByIds:uP})}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=O({...e,submitted_at:u,created_by:l});this.dispatch(a(y));const m=this.enqueueRequest({method:h.POST,url:`${this.url}/`,payload:_(y),blockers:[],blocks:[y.uuid]});return m.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,m]}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=rA(e)(d);this.dispatch(a(e)),this.dispatch(Ln(v(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(Un(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 b{constructor(){super(...arguments);p(this,"name","Issue Type Status");p(this,"url","/issue-type-statuses");p(this,"actions",{addOne:yP,addMany:mP,setOne:SP,setMany:fP,updateOne:AP,updateMany:wP,deleteOne:PP,deleteMany:OP,initialize:pP});p(this,"selectors",{selectById:ra,selectByIds:IP})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,l=new Date().toISOString(),u=O({...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:_(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 pz extends b{constructor(){super(...arguments);p(this,"name","Issue Update");p(this,"url","/issue-updates");p(this,"actions",{addOne:la,addMany:ua,setOne:RP,setMany:bP,updateOne:MP,updateMany:vP,deleteOne:oa,deleteMany:ha,initialize:gP});p(this,"selectors",{selectById:EP,selectByIds:kP})}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 yz=1800;function mz(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 Sz extends pW{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(xp(!1)),this.clearTokens(),this.dispatch(P()),this.dispatch(P())}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=Vk(e).exp??n}catch{a=n}return a-n<yz}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=Vt.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(mz(a))})}}class fz extends Wt{constructor(){super(...arguments);p(this,"name","Organization Access");p(this,"url","/organization-accesses");p(this,"actions",{addOne:YP,addMany:JP,setOne:QP,setMany:ZP,updateOne:XP,updateMany:xP,deleteOne:eO,deleteMany:tO,initialize:KP});p(this,"selectors",{selectById:iO,selectByIds:nO})}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=qs(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(Sa(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 Az extends Wt{constructor(){super(...arguments);p(this,"name","Organization");p(this,"url","/organizations");p(this,"actions",{addOne:oO,addMany:uO,setOne:lO,setMany:dO,updateOne:pO,updateMany:hO,deleteOne:yO,deleteMany:mO,initialize:rO});p(this,"selectors",{selectById:AO,selectByIds:wO})}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 wz extends b{constructor(){super(...arguments);p(this,"name","Project Access");p(this,"url","/project-accesses");p(this,"actions",{addOne:MO,addMany:vO,setOne:EO,setMany:kO,updateOne:VO,updateMany:BO,deleteOne:DO,deleteMany:WO,initialize:bO});p(this,"selectors",{selectById:qO,selectByIds:jO})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...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:_(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(m=>O({...m,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(m=>_(m))},blockers:l.flatMap(m=>[m.project,m.organization_access]),blocks:l.map(m=>m.uuid)});return u.then(m=>{this.dispatch(r(m))}).catch(m=>{throw this.dispatch(c(l.map(f=>f.uuid))),m}),[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 Pz extends D{constructor(){super(...arguments);p(this,"name","Project Attachment");p(this,"url","/project-attachments");p(this,"actions",{addOne:UO,addMany:LO,setOne:NO,setMany:HO,updateOne:GO,updateMany:KO,deleteOne:YO,deleteMany:JO,initialize:CO});p(this,"selectors",{selectById:ZO,selectByIds:XO})}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 O({...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 Oz extends D{constructor(){super(...arguments);p(this,"name","Project File");p(this,"url","/project-files");p(this,"actions",{addOne:nT,addMany:aT,setOne:sT,setMany:iT,updateOne:cT,updateMany:rT,deleteOne:dT,deleteMany:lT,initialize:tT});p(this,"selectors",{selectById:hT,selectByIds:pT})}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 O({...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 Tz extends Wt{constructor(){super(...arguments);p(this,"name","Project");p(this,"url","/projects");p(this,"actions",{addOne:PT,addMany:wT,setOne:AT,setMany:fT,updateOne:TT,updateMany:OT,deleteOne:IT,deleteMany:FT,initialize:ST});p(this,"selectors",{selectById:RT,selectByIds:bT})}async add(e){const{addOne:n}=this.actions,a=await this.performRequest({method:h.POST,url:`${this.url}/`,payload:_(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:_(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}}class Iz extends b{constructor(){super(...arguments);p(this,"name","Procedure");p(this,"url","/procedures");p(this,"actions",{addOne:ET,addMany:Ma,setOne:kT,setMany:VT,updateOne:BT,updateMany:DT,deleteOne:WT,deleteMany:va,initialize:vT});p(this,"selectors",{selectById:jT,selectByIds:$T})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...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:_(d),blockers:[d.procedure_type,d.project,...d.asset?[d.asset]:[],...d.issue?[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:[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 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 Fz extends b{constructor(){super(...arguments);p(this,"name","Procedure Step Assignee");p(this,"url","/procedure-step-assignees");p(this,"actions",{addOne:NT,addMany:HT,setOne:GT,setMany:KT,updateOne:YT,updateMany:JT,deleteOne:QT,deleteMany:ZT,initialize:LT});p(this,"selectors",{selectById:xT,selectByIds:eI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...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:_(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 m;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,l=new Date().toISOString(),u=e.map(f=>O({...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=>_(f)),submitted_at:l},blockers:u.flatMap(f=>[f.procedure,f.procedure_step]),blocks:v(u)});return y.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(v(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 _z extends b{constructor(){super(...arguments);p(this,"name","Procedure Step Comment");p(this,"url","/procedure-step-comments");p(this,"actions",{addOne:nI,addMany:aI,setOne:cI,setMany:rI,updateOne:dI,updateMany:lI,deleteOne:uI,deleteMany:oI,initialize:iI});p(this,"selectors",{selectById:pI,selectByIds:yI})}add(e){var u;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=O({...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:_(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 gz extends b{constructor(){super(...arguments);p(this,"name","Procedure Step Default Assignee");p(this,"url","/procedure-step-default-assignees");p(this,"actions",{addOne:AI,addMany:wI,setOne:PI,setMany:OI,updateOne:TI,updateMany:II,deleteOne:FI,deleteMany:_I,initialize:fI});p(this,"selectors",{selectById:RI,selectByIds:bI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...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:_(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 Rz extends b{constructor(){super(...arguments);p(this,"name","Procedure Step Default Reviewer");p(this,"url","/procedure-step-default-reviewers");p(this,"actions",{addOne:kI,addMany:VI,setOne:BI,setMany:DI,updateOne:WI,updateMany:zI,deleteOne:qI,deleteMany:jI,initialize:EI});p(this,"selectors",{selectById:CI,selectByIds:UI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...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:_(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 bz extends Wt{constructor(){super(...arguments);p(this,"name","Procedure Step Event");p(this,"url","/procedure-step-events");p(this,"actions",{addOne:GI,addMany:KI,setOne:YI,setMany:JI,updateOne:QI,updateMany:ZI,deleteOne:XI,deleteMany:xI,initialize:HI});p(this,"selectors",{selectById:tF,selectByIds:sF})}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 Mz extends D{constructor(){super(...arguments);p(this,"name","Procedure Step Fields Attachment");p(this,"url","/procedure-step-fields-attachments");p(this,"actions",{addOne:cF,addMany:ja,setOne:rF,setMany:dF,updateOne:lF,updateMany:uF,deleteOne:oF,deleteMany:$a,initialize:aF});p(this,"selectors",{selectById:yF,selectByIds:mF})}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 O({...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 vz extends b{constructor(){super(...arguments);p(this,"name","Procedure Step Fields");p(this,"url","/procedure-step-fields");p(this,"actions",{addOne:wF,addMany:PF,setOne:OF,setMany:TF,updateOne:IF,updateMany:FF,deleteOne:_F,deleteMany:gF,initialize:AF});p(this,"selectors",{selectById:RF,selectByIds:bF})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...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:_(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($a(v(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(ja(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 Ez extends D{constructor(){super(...arguments);p(this,"name","Procedure Step Field Values Attachment");p(this,"url","/procedure-step-field-values-attachments");p(this,"actions",{addOne:kF,addMany:Ha,setOne:VF,setMany:BF,updateOne:DF,updateMany:WF,deleteOne:zF,deleteMany:Ga,initialize:EF});p(this,"selectors",{selectById:jF,selectByIds:$F})}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 O({...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 kz extends b{constructor(){super(...arguments);p(this,"name","Procedure Step Field Values Review");p(this,"url","/procedure-step-field-values-reviews");p(this,"actions",{addOne:a_,addMany:Qa,setOne:c_,setMany:r_,updateOne:d_,updateMany:l_,deleteOne:u_,deleteMany:Za,initialize:n_});p(this,"selectors",{selectById:h_,selectByIds:p_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...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:_(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 Vz extends b{constructor(){super(...arguments);p(this,"name","Procedure Step Field Values");p(this,"url","/procedure-step-field-values");p(this,"actions",{addOne:HF,addMany:GF,setOne:KF,setMany:YF,updateOne:JF,updateMany:QF,deleteOne:ZF,deleteMany:XF,initialize:NF});p(this,"selectors",{selectById:t_,selectByIds:s_})}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=O({...e,created_by:l,submitted_at:u}),m=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:_(y),blockers:[e.procedure,e.procedure_step,e.fields_revision],blocks:[y.uuid]});return this.dispatch(a(y)),m.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,m]}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=CF(e)(d),y=y_(e)(d);this.dispatch(a(e)),this.dispatch(Ga(v(u))),this.dispatch(Za(v(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(m){throw this.dispatch(c(l)),this.dispatch(Ha(u)),this.dispatch(Qa(y)),m}}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 b{constructor(){super(...arguments);p(this,"name","Procedure Step Reviewer");p(this,"url","/procedure-step-reviewers");p(this,"actions",{addOne:A_,addMany:w_,setOne:P_,setMany:O_,updateOne:T_,updateMany:I_,deleteOne:F_,deleteMany:__,initialize:f_});p(this,"selectors",{selectById:R_,selectByIds:b_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...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:_(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 m;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,l=new Date().toISOString(),u=e.map(f=>O({...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=>_(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 Dz extends b{constructor(){super(...arguments);p(this,"name","Procedure Step");p(this,"url","/procedure-steps");p(this,"actions",{addOne:B_,addMany:D_,setOne:k_,setMany:V_,updateOne:W_,updateMany:z_,deleteOne:q_,deleteMany:j_,initialize:E_});p(this,"selectors",{selectById:C_,selectByIds:U_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...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:_(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,{addOne:a,deleteOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No procedure step with uuid ${e} found in the store`);this.dispatch(c(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(a(l)),u}}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 Wz extends D{constructor(){super(...arguments);p(this,"name","Procedure Type Attachment");p(this,"url","/procedure-type-attachments");p(this,"actions",{addOne:H_,addMany:G_,setOne:K_,setMany:Y_,updateOne:J_,updateMany:Q_,deleteOne:Z_,deleteMany:X_,initialize:N_});p(this,"selectors",{selectById:tg,selectByIds:sg})}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,m=new Date().toISOString();return O({file_url:u,file_sha1:c,file_extension:r,file_name:d,file_type:l,created_by:y,submitted_at:m,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 zz extends D{constructor(){super(...arguments);p(this,"name","Procedure Type Fields Attachment");p(this,"url","/procedure-type-fields-attachments");p(this,"actions",{addOne:ag,addMany:cg,setOne:rg,setMany:dg,updateOne:lg,updateMany:ug,deleteOne:og,deleteMany:hg,initialize:ng});p(this,"selectors",{selectById:mg,selectByIds:Sg})}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 O({...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 qz extends b{constructor(){super(...arguments);p(this,"name","Procedure Type Fields");p(this,"url","/procedure-type-fields");p(this,"actions",{addOne:wg,addMany:Pg,setOne:Og,setMany:Tg,updateOne:Ig,updateMany:Fg,deleteOne:_g,deleteMany:gg,initialize:Ag});p(this,"selectors",{selectById:Mg,selectByIds:vg})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,l=new Date().toISOString(),u=O({...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:_(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 jz extends D{constructor(){super(...arguments);p(this,"name","Procedure Field Values Attachment");p(this,"url","/procedure-field-values-attachments");p(this,"actions",{addOne:Vg,addMany:dc,setOne:Bg,setMany:Dg,updateOne:Wg,updateMany:zg,deleteOne:qg,deleteMany:lc,initialize:kg});p(this,"selectors",{selectById:Cg,selectByIds:Ug})}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 O({...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 $z extends b{constructor(){super(...arguments);p(this,"name","Procedure Field Values");p(this,"url","/procedure-field-values");p(this,"actions",{addOne:Gg,addMany:Kg,setOne:Yg,setMany:Jg,updateOne:Qg,updateMany:Zg,deleteOne:Xg,deleteMany:xg,initialize:Hg});p(this,"selectors",{selectById:sR,selectByIds:iR})}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=O({...e,created_by:l,submitted_at:u}),m=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:_(y),blockers:[e.fields_revision,e.procedure],blocks:[y.uuid]});return this.dispatch(a(y)),m.then(F=>{this.dispatch(c(F))}).catch(()=>{this.dispatch(r(y.uuid))}),[y,m]}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 ProcedureFieldValues 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=Lg(e)(d);this.dispatch(a(e)),this.dispatch(lc(v(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,r=(await this.listPaginated({queryParams:{procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class Cz extends b{constructor(){super(...arguments);p(this,"name","Procedure Type");p(this,"url","/procedure-types");p(this,"actions",{addOne:cR,addMany:rR,setOne:dR,setMany:lR,updateOne:uR,updateMany:oR,deleteOne:hR,deleteMany:pR,initialize:aR});p(this,"selectors",{selectById:SR,selectByIds:fR})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=O({...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:_(l),blockers:[],blocks:[l.uuid]});return u.then(m=>{this.dispatch(c(m))}).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=CT(e)(d);this.dispatch(a(e)),this.dispatch(va(v(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(Ma(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 Uz extends b{constructor(){super(...arguments);p(this,"name","Team Membership");p(this,"url","/team-memberships");p(this,"actions",{addOne:OR,addMany:TR,setOne:IR,setMany:FR,updateOne:_R,updateMany:gR,deleteOne:RR,deleteMany:bR,initialize:PR});p(this,"selectors",{selectById:ER,selectByIds:kR})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...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:_(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(m=>O({...m,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(m=>_(m))},blockers:l.map(m=>m.team),blocks:l.map(m=>m.uuid)});return u.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(l.map(m=>m.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 Lz extends b{constructor(){super(...arguments);p(this,"name","Team");p(this,"url","/teams");p(this,"actions",{addOne:DR,addMany:WR,setOne:zR,setMany:qR,updateOne:jR,updateMany:$R,deleteOne:CR,deleteMany:UR,initialize:BR});p(this,"selectors",{selectById:NR,selectByIds:HR})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...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:_(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:_(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 Nz extends Wt{constructor(){super(...arguments);p(this,"name","User");p(this,"url","/user");p(this,"actions",{addOne:Sa,addMany:jP,setOne:qP,setMany:zP,updateOne:CP,updateMany:$P,deleteOne:fa,deleteMany:UP,initialize:WP});p(this,"selectors",{selectById:qs,selectByIds:HP})}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 Hz extends b{constructor(){super(...arguments);p(this,"name","Workflow");p(this,"url","/workflows");p(this,"actions",{addOne:ZR,addMany:XR,setOne:xR,setMany:eb,updateOne:tb,updateMany:sb,deleteOne:ib,deleteMany:nb,initialize:QR});p(this,"selectors",{selectById:cb,selectByIds:rb})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...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:_(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=Pb(e)(d);this.dispatch(a(e)),this.dispatch(os(v(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(us(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 Gz extends b{constructor(){super(...arguments);p(this,"name","Workflow Issue Link");p(this,"url","/workflow-issue-links");p(this,"actions",{addOne:ob,addMany:us,setOne:hb,setMany:pb,updateOne:yb,updateMany:mb,deleteOne:Sb,deleteMany:os,initialize:ub});p(this,"selectors",{selectById:Ab,selectByIds:wb})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,u=O({...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:_(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 Kz extends b{constructor(){super(...arguments);p(this,"name","Workflow Step Assignee");p(this,"url","/workflow-step-assignees");p(this,"actions",{addOne:gb,addMany:Rb,setOne:bb,setMany:Mb,updateOne:vb,updateMany:Eb,deleteOne:kb,deleteMany:Vb,initialize:_b});p(this,"selectors",{selectById:Db,selectByIds:Wb})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...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:_(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 m;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,l=new Date().toISOString(),u=e.map(f=>O({...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=>_(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(v(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 Yz extends b{constructor(){super(...arguments);p(this,"name","Workflow Step Comment");p(this,"url","/workflow-step-comments");p(this,"actions",{addOne:$b,addMany:Cb,setOne:Ub,setMany:Lb,updateOne:Nb,updateMany:Hb,deleteOne:Gb,deleteMany:Kb,initialize:jb});p(this,"selectors",{selectById:Jb,selectByIds:Qb})}add(e){var u;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=O({...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:_(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 Jz extends b{constructor(){super(...arguments);p(this,"name","Workflow Step Default Assignee");p(this,"url","/workflow-step-default-assignees");p(this,"actions",{addOne:eM,addMany:tM,setOne:sM,setMany:iM,updateOne:nM,updateMany:aM,deleteOne:cM,deleteMany:rM,initialize:xb});p(this,"selectors",{selectById:lM,selectByIds:uM})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...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:_(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 Qz extends b{constructor(){super(...arguments);p(this,"name","Workflow Step Default Reviewer");p(this,"url","/workflow-step-default-reviewers");p(this,"actions",{addOne:yM,addMany:mM,setOne:SM,setMany:fM,updateOne:AM,updateMany:wM,deleteOne:PM,deleteMany:OM,initialize:pM});p(this,"selectors",{selectById:IM,selectByIds:FM})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...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:_(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 Zz extends Wt{constructor(){super(...arguments);p(this,"name","Workflow Step Event");p(this,"url","/workflow-step-events");p(this,"actions",{addOne:bM,addMany:MM,setOne:vM,setMany:EM,updateOne:kM,updateMany:VM,deleteOne:BM,deleteMany:DM,initialize:RM});p(this,"selectors",{selectById:zM,selectByIds:qM})}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 Xz extends D{constructor(){super(...arguments);p(this,"name","Workflow Step Fields Attachment");p(this,"url","/workflow-step-fields-attachments");p(this,"actions",{addOne:UM,addMany:Mc,setOne:LM,setMany:NM,updateOne:HM,updateMany:GM,deleteOne:KM,deleteMany:vc,initialize:CM});p(this,"selectors",{selectById:QM,selectByIds:ZM})}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 O({...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 xz extends b{constructor(){super(...arguments);p(this,"name","Workflow Step Fields");p(this,"url","/workflow-step-fields");p(this,"actions",{addOne:tv,addMany:sv,setOne:iv,setMany:nv,updateOne:av,updateMany:cv,deleteOne:rv,deleteMany:dv,initialize:ev});p(this,"selectors",{selectById:uv,selectByIds:ov})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...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:_(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=JM(e)(d);this.dispatch(a(e)),this.dispatch(vc(v(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(Mc(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 eq extends D{constructor(){super(...arguments);p(this,"name","Workflow Step Field Values Attachment");p(this,"url","/workflow-step-field-values-attachments");p(this,"actions",{addOne:mv,addMany:Bc,setOne:Sv,setMany:fv,updateOne:Av,updateMany:wv,deleteOne:Pv,deleteMany:Dc,initialize:yv});p(this,"selectors",{selectById:Tv,selectByIds:Iv})}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 O({...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 tq extends b{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:Uv,addMany:jc,setOne:Lv,setMany:Nv,updateOne:Hv,updateMany:Gv,deleteOne:Kv,deleteMany:$c,initialize:Cv});p(this,"selectors",{selectById:Jv,selectByIds:Qv})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...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:_(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 sq extends b{constructor(){super(...arguments);p(this,"name","Workflow Step Field Values Review");p(this,"url","/workflow-step-field-values-reviews");p(this,"actions",{addOne:tE,addMany:Uc,setOne:sE,setMany:iE,updateOne:nE,updateMany:aE,deleteOne:cE,deleteMany:Lc,initialize:eE});p(this,"selectors",{selectById:dE,selectByIds:lE})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...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:_(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 iq extends b{constructor(){super(...arguments);p(this,"name","Workflow Step Field Values");p(this,"url","/workflow-step-field-values");p(this,"actions",{addOne:bv,addMany:Mv,setOne:vv,setMany:Ev,updateOne:kv,updateMany:Vv,deleteOne:Bv,deleteMany:Dv,initialize:Rv});p(this,"selectors",{selectById:zv,selectByIds:qv})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=O({...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:_(l),blockers:[e.workflow,e.workflow_step,e.fields_revision],blocks:[l.uuid]});return this.dispatch(a(l)),u.then(m=>{this.dispatch(c(m))}).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=Fv(e)(d),y=uE(e)(d),m=Zv(e)(d);this.dispatch(a(e)),this.dispatch(Dc(v(u))),this.dispatch(Lc(v(y))),this.dispatch($c(v(m)));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(Bc(u)),this.dispatch(Uc(y)),this.dispatch(jc(m)),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 nq extends b{constructor(){super(...arguments);p(this,"name","Workflow Step Reviewer");p(this,"url","/workflow-step-reviewers");p(this,"actions",{addOne:yE,addMany:mE,setOne:SE,setMany:fE,updateOne:AE,updateMany:wE,deleteOne:PE,deleteMany:OE,initialize:pE});p(this,"selectors",{selectById:IE,selectByIds:FE})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...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:_(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 m;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,l=new Date().toISOString(),u=e.map(f=>O({...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=>_(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 aq extends b{constructor(){super(...arguments);p(this,"name","Workflow Step");p(this,"url","/workflow-steps");p(this,"actions",{addOne:bE,addMany:ME,setOne:vE,setMany:EE,updateOne:kE,updateMany:VE,deleteOne:BE,deleteMany:DE,initialize:RE});p(this,"selectors",{selectById:zE,selectByIds:qE})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...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:_(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 cq extends b{constructor(){super(...arguments);p(this,"name","Workflow Type");p(this,"url","/workflow-types");p(this,"actions",{addOne:UE,addMany:LE,setOne:NE,setMany:HE,updateOne:GE,updateMany:KE,deleteOne:YE,deleteMany:JE,initialize:CE});p(this,"selectors",{selectById:ZE,selectByIds:XE})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=O({...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:_(l),blockers:[],blocks:[l.uuid]});return u.then(m=>{this.dispatch(c(m))}).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 Xc(t,s,e,n,a){const c=n instanceof $t;c&&s.checkAuth!==!1&&await n.auth.prepareAuth();const r={queryParams:"",isAuthNeeded:!0},{s3url:d,payload:l,headers:u,method:y,queryParams:m,attachmentHash:f,isExternalUrl:F,isAuthNeeded:R,isResponseBlob:k}={...r,...s};let g=s.url;const E=f?await e.files.fetchCache(f):void 0;if(f&&!E)throw new Error(`Cannot upload file ${f} because it's not cached.`);!F&&!g.startsWith("http")&&(!g.startsWith("/")&&!g.startsWith("blob:")&&(g="/"+g),g=t+g);const M=B=>{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(!E)throw new Error(`No file for file ${f}`);const L=d.fields["x-amz-checksum-sha1"];if(!L)throw new Error(`No checksum for file ${f}`);return B.set("x-amz-checksum-sha1",L).field({...l,...d.fields}).attach("file",E)}return B.send(l)},j={[h.GET]:()=>k?Ut.get(g.toString()).responseType("blob"):Ut.get(g.toString()),[h.POST]:()=>{const B=Ut.post(g.toString());return M(B)},[h.PATCH]:()=>{const B=Ut.patch(g.toString());return M(B)},[h.PUT]:()=>{const B=Ut.put(g.toString());return M(B)},[h.DELETE]:()=>{const B=Ut.delete(g.toString());return M(B)}}[y];let W=j();const q=()=>{console.debug("aborting request:",s.url),W.abort()};if(a==null||a.addEventListener("abort",q),R&&c){const B=n.auth.getAuthHeader();W=W.set("Authorization",B)}u&&(W=W.set(u));try{return await W.query(m)}catch(B){const L=yk(B),Gs=L==null?void 0:L.status;if(c&&Gs===401)return await n.auth.handleUnauthorized(W,L),W.query(m);throw new C({response:L,innerError:B,discard:Qc.includes(Gs)})}finally{a==null||a.removeEventListener("abort",q)}}class rq{constructor(s){p(this,"store");this.store=s}_performRequest(s,e,n,a){const c=new Ys,r={...e,uuid:e.uuid??Vt.v4()};return Xc(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 Ys,c={...s,BASE_URL:e,serviceName:n},r=this.store.dispatch(IO(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 Qt{constructor(){p(this,"graph");p(this,"requestAttemptCounter");this.graph=new Bk.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(s){const e=new Qt;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))&&Qt._addDependency(a.payload.uuid,r.payload.uuid,e.graph)}}return e}_addDependency(s,e){Qt._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 mk;function Sk(t){mk=t}function Zt(){return mk}let fk;function Ak(t){fk=t}function wk(){return fk}let xc=null;function Ct(){const t=Zt();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(xc)return xc;const s=t.getState().offline.outbox,e=Qt._fromOutbox(s);return xc=e,e}const dq=(t,s)=>{const e=new s(t);return Ak(e),Sk(t),e};class lq{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 er{constructor(){p(this,"next");this.next=null}then(s){return new lq(this).then(s)}async run(s){if(this.next)return this.next.run(s);{if(console.debug("Middleware finished. Performing request:",s.payload.url),!Zt())throw new Error("Client store not set");const n=wk();if(!n)throw new Error("Client SDK not set");return ok(s,n)}}}class Pk extends er{async run(s){return super.run(s)}}class Ok extends er{async run(s){return super.run(s)}}const Tk=new Pk().then(new Ok).compile();function Ik(t){var s;return(s=Tk[0])==null?void 0:s.run(t)}var Fk=(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))(Fk||{});i.ALL_MIDDLEWARE=Tk,i.APIError=C,i.AgentService=yW,i.AssetAttachmentService=mW,i.AssetProcedureService=OW,i.AssetProcedureStepFieldValuesAttachmentService=_W,i.AssetProcedureStepFieldValuesService=gW,i.AssetProcedureStepFieldsAttachmentService=IW,i.AssetProcedureStepFieldsService=FW,i.AssetProcedureStepService=RW,i.AssetProcedureTypeAttachmentService=SW,i.AssetProcedureTypeFieldValuesAttachmentService=wW,i.AssetProcedureTypeFieldValuesService=PW,i.AssetProcedureTypeFieldsAttachmentService=fW,i.AssetProcedureTypeFieldsService=AW,i.AssetProcedureTypeService=TW,i.AssetService=bW,i.AssetStageCompletionService=MW,i.AssetStageService=vW,i.AssetStatusType=rr,i.AssetTypeAttachmentService=EW,i.AssetTypeFieldValuesAttachmentService=BW,i.AssetTypeFieldValuesService=DW,i.AssetTypeFieldsAttachmentService=kW,i.AssetTypeFieldsService=VW,i.AssetTypeIdentifierService=WW,i.AssetTypeIdentifierValueService=zW,i.AssetTypeService=qW,i.AssetTypeStatusService=jW,i.AttachmentModel=dr,i.BaseApiService=$t,i.BaseModelApiService=Wt,i.BaseOfflineFileModelApiService=D,i.BaseOfflineModelApiService=b,i.BaseSDK=rq,i.COMMON_AUTO_FIELDS=Pr,i.DEFAULT_ISSUE_PRIORITY=Dk,i.DEFAULT_PAGE_SIZE=tk,i.DEFAULT_WORKFLOW_STATUS=qk,i.DISCARD_HTTP_STATUSES=Qc,i.DeferredPromise=Ys,i.DocumentAttachmentService=$W,i.DocumentService=CW,i.EMPTY_ARRAY=nr,i.EMPTY_OBJECT=ar,i.EmailDomainsService=UW,i.EmailVerificationService=LW,i.FILE_MODEL_DEFAULT_PAGE_SIZE=sk,i.FileService=NW,i.FormIdentifierService=HW,i.FormIdentifierValueService=GW,i.FormRevisionAttachmentService=KW,i.FormRevisionService=YW,i.FormService=JW,i.FormSubmissionAttachmentService=QW,i.FormSubmissionService=ZW,i.GeoImageService=XW,i.HttpMethod=h,i.IssueAssociationService=xW,i.IssueAttachmentService=ez,i.IssueCommentAttachmentService=tz,i.IssueCommentService=sz,i.IssuePriority=Ks,i.IssueService=iz,i.IssueStatusType=lr,i.IssueTypeAttachmentService=nz,i.IssueTypeFieldValuesAttachmentService=rz,i.IssueTypeFieldValuesService=dz,i.IssueTypeFieldsAttachmentService=az,i.IssueTypeFieldsService=cz,i.IssueTypeIdentifierService=lz,i.IssueTypeIdentifierValueService=uz,i.IssueTypeService=oz,i.IssueTypeStatusService=hz,i.IssueUpdateChange=$,i.IssueUpdateService=pz,i.JWTService=Sz,i.MAX_SERVICE_BATCH_SIZE=kt,i.OUTBOX_RETRY_DELAY=pr,i.OfflineAnalyticsMiddleware=Pk,i.OfflineMiddleware=er,i.OrganizationAccessLevel=cr,i.OrganizationAccessService=fz,i.OrganizationService=Az,i.OutboxCoordinator=Qt,i.ProcedureFieldValuesAttachmentService=jz,i.ProcedureFieldValuesService=$z,i.ProcedureService=Iz,i.ProcedureStepAssigneeService=Fz,i.ProcedureStepCommentService=_z,i.ProcedureStepDefaultAssigneeService=gz,i.ProcedureStepDefaultReviewerService=Rz,i.ProcedureStepEventService=bz,i.ProcedureStepEventType=or,i.ProcedureStepFieldValuesAttachmentService=Ez,i.ProcedureStepFieldValuesReviewService=kz,i.ProcedureStepFieldValuesReviewType=hr,i.ProcedureStepFieldValuesService=Vz,i.ProcedureStepFieldsAttachmentService=Mz,i.ProcedureStepFieldsService=vz,i.ProcedureStepReviewerService=Bz,i.ProcedureStepService=Dz,i.ProcedureTypeAttachmentService=Wz,i.ProcedureTypeFieldsAttachmentService=zz,i.ProcedureTypeFieldsService=qz,i.ProcedureTypeService=Cz,i.ProjectAccessService=wz,i.ProjectAttachmentService=Pz,i.ProjectFileService=Oz,i.ProjectService=Tz,i.RESET_ORGANIZATION_STATE=I,i.RESET_PROJECT_STATE=V,i.RESET_STATE=P,i.RateLimitingMiddleware=Ok,i.SelectorBuilder=rV,i.TeamMembershipService=Uz,i.TeamService=Lz,i.UNKNOWN_ERROR_MESSAGE=Jt,i.UserService=Nz,i.VERSION_REDUCER_KEY=es,i.VerificationCodeType=Fk,i.WORKFLOW_STATUSES=zk,i.WORKFLOW_STEP_FIELD_VALUES_REVIEW_TYPES=Wk,i.WorkflowIssueLinkService=Gz,i.WorkflowService=Hz,i.WorkflowStatus=Lt,i.WorkflowStepAssigneeService=Kz,i.WorkflowStepCommentService=Yz,i.WorkflowStepDefaultAssigneeService=Jz,i.WorkflowStepDefaultReviewerService=Qz,i.WorkflowStepEventService=Zz,i.WorkflowStepEventType=ur,i.WorkflowStepFieldValuesAttachmentService=eq,i.WorkflowStepFieldValuesReviewRequestService=tq,i.WorkflowStepFieldValuesReviewService=sq,i.WorkflowStepFieldValuesReviewType=xt,i.WorkflowStepFieldValuesService=iq,i.WorkflowStepFieldsAttachmentService=Xz,i.WorkflowStepFieldsService=xz,i.WorkflowStepReviewerService=nq,i.WorkflowStepService=aq,i.WorkflowTypeService=cq,i._setLatestRetryTime=_O,i.addAsset=Qu,i.addAssetAttachment=Dr,i.addAssetAttachments=si,i.addAssetProcedure=ll,i.addAssetProcedureStep=qu,i.addAssetProcedureStepFieldValues=Tu,i.addAssetProcedureStepFieldValuesAttachment=lu,i.addAssetProcedureStepFieldValuesAttachments=_i,i.addAssetProcedureStepFieldValuesMany=Iu,i.addAssetProcedureStepFields=Ql,i.addAssetProcedureStepFieldsAttachment=Wl,i.addAssetProcedureStepFieldsAttachments=zl,i.addAssetProcedureStepFieldsMany=Zl,i.addAssetProcedureSteps=ju,i.addAssetProcedureType=Tl,i.addAssetProcedureTypeAttachment=Yr,i.addAssetProcedureTypeAttachments=Jr,i.addAssetProcedureTypeFieldValues=Jd,i.addAssetProcedureTypeFieldValuesAttachment=Wd,i.addAssetProcedureTypeFieldValuesAttachments=oi,i.addAssetProcedureTypeFieldValuesMany=Qd,i.addAssetProcedureTypeFields=Td,i.addAssetProcedureTypeFieldsAttachment=dd,i.addAssetProcedureTypeFieldsAttachments=ld,i.addAssetProcedureTypeFieldsMany=Id,i.addAssetProcedureTypes=Il,i.addAssetProcedures=Si,i.addAssetStage=Ro,i.addAssetStageCompletion=uo,i.addAssetStageCompletions=oo,i.addAssetStages=bo,i.addAssetType=bp,i.addAssetTypeAttachment=qo,i.addAssetTypeAttachments=ji,i.addAssetTypeFieldValues=qh,i.addAssetTypeFieldValuesAttachment=_h,i.addAssetTypeFieldValuesAttachments=Gi,i.addAssetTypeFieldValuesMany=jh,i.addAssetTypeFields=oh,i.addAssetTypeFieldsAttachment=Zo,i.addAssetTypeFieldsAttachments=Xo,i.addAssetTypeFieldsMany=hh,i.addAssetTypeIdentifier=Xh,i.addAssetTypeIdentifierValue=hp,i.addAssetTypeIdentifierValues=pp,i.addAssetTypeIdentifiers=xh,i.addAssetTypeStatus=$p,i.addAssetTypeStatuses=Cp,i.addAssetTypes=Mp,i.addAssets=ki,i.addConversation=Mr,i.addConversations=dV,i.addDocument=fy,i.addDocumentAttachment=iy,i.addDocumentAttachments=ny,i.addDocuments=Ay,i.addEmailDomain=Ey,i.addEmailDomains=ky,i.addForm=Jm,i.addFormIdentifier=Yy,i.addFormIdentifierValue=dm,i.addFormIdentifierValues=lm,i.addFormIdentifiers=Jy,i.addFormRevision=Wm,i.addFormRevisionAttachment=Tm,i.addFormRevisionAttachments=Im,i.addFormRevisions=Sn,i.addFormSubmission=IS,i.addFormSubmissionAttachment=lS,i.addFormSubmissionAttachments=On,i.addFormSubmissions=Rn,i.addForms=Qm,i.addGeoImage=WS,i.addGeoImages=zS,i.addIssue=Xf,i.addIssueAssociation=XS,i.addIssueAssociations=zt,i.addIssueAttachment=hf,i.addIssueAttachments=Bn,i.addIssueComment=jf,i.addIssueCommentAttachment=_f,i.addIssueCommentAttachments=gf,i.addIssueComments=$f,i.addIssueType=eP,i.addIssueTypeAttachment=oA,i.addIssueTypeAttachments=hA,i.addIssueTypeFieldValues=jA,i.addIssueTypeFieldValuesAttachment=pw,i.addIssueTypeFieldValuesAttachments=Zn,i.addIssueTypeFieldValuesMany=$A,i.addIssueTypeFields=xA,i.addIssueTypeFieldsAttachment=_A,i.addIssueTypeFieldsAttachments=gA,i.addIssueTypeFieldsMany=ew,i.addIssueTypeIdentifier=gw,i.addIssueTypeIdentifierValue=$w,i.addIssueTypeIdentifierValues=Cw,i.addIssueTypeIdentifiers=Rw,i.addIssueTypeStatus=yP,i.addIssueTypeStatuses=mP,i.addIssueTypes=tP,i.addIssueUpdate=la,i.addIssueUpdates=ua,i.addIssues=Un,i.addOrganization=oO,i.addOrganizationAccess=YP,i.addOrganizationAccesses=JP,i.addOrganizations=uO,i.addProcedure=ET,i.addProcedureFieldValues=Gg,i.addProcedureFieldValuesAttachment=Vg,i.addProcedureFieldValuesAttachments=dc,i.addProcedureFieldValuesMany=Kg,i.addProcedureStep=B_,i.addProcedureStepAssignee=NT,i.addProcedureStepAssignees=HT,i.addProcedureStepComment=nI,i.addProcedureStepComments=aI,i.addProcedureStepDefaultAssignee=AI,i.addProcedureStepDefaultAssignees=wI,i.addProcedureStepDefaultReviewer=kI,i.addProcedureStepDefaultReviewers=VI,i.addProcedureStepEvent=GI,i.addProcedureStepEvents=KI,i.addProcedureStepFieldValues=HF,i.addProcedureStepFieldValuesAttachment=kF,i.addProcedureStepFieldValuesAttachments=Ha,i.addProcedureStepFieldValuesMany=GF,i.addProcedureStepFieldValuesReview=a_,i.addProcedureStepFieldValuesReviews=Qa,i.addProcedureStepFields=wF,i.addProcedureStepFieldsAttachment=cF,i.addProcedureStepFieldsAttachments=ja,i.addProcedureStepFieldsMany=PF,i.addProcedureStepReviewer=A_,i.addProcedureStepReviewers=w_,i.addProcedureSteps=D_,i.addProcedureType=cR,i.addProcedureTypeAttachment=H_,i.addProcedureTypeAttachments=G_,i.addProcedureTypeFields=wg,i.addProcedureTypeFieldsAttachment=ag,i.addProcedureTypeFieldsAttachments=cg,i.addProcedureTypeFieldsMany=Pg,i.addProcedureTypes=rR,i.addProcedures=Ma,i.addProject=PT,i.addProjectAccess=MO,i.addProjectAccesses=vO,i.addProjectAttachment=UO,i.addProjectAttachments=LO,i.addProjectFile=nT,i.addProjectFiles=aT,i.addProjects=wT,i.addTeam=DR,i.addTeamMembership=OR,i.addTeamMemberships=TR,i.addTeams=WR,i.addUser=Sa,i.addUsers=jP,i.addWorkflow=ZR,i.addWorkflowIssueLink=ob,i.addWorkflowIssueLinks=us,i.addWorkflowStep=bE,i.addWorkflowStepAssignee=gb,i.addWorkflowStepAssignees=Rb,i.addWorkflowStepComment=$b,i.addWorkflowStepComments=Cb,i.addWorkflowStepDefaultAssignee=eM,i.addWorkflowStepDefaultAssignees=tM,i.addWorkflowStepDefaultReviewer=yM,i.addWorkflowStepDefaultReviewers=mM,i.addWorkflowStepEvent=bM,i.addWorkflowStepEvents=MM,i.addWorkflowStepFieldValues=bv,i.addWorkflowStepFieldValuesAttachment=mv,i.addWorkflowStepFieldValuesAttachments=Bc,i.addWorkflowStepFieldValuesMany=Mv,i.addWorkflowStepFieldValuesReview=tE,i.addWorkflowStepFieldValuesReviewRequest=Uv,i.addWorkflowStepFieldValuesReviewRequests=jc,i.addWorkflowStepFieldValuesReviews=Uc,i.addWorkflowStepFields=tv,i.addWorkflowStepFieldsAttachment=UM,i.addWorkflowStepFieldsAttachments=Mc,i.addWorkflowStepFieldsMany=sv,i.addWorkflowStepReviewer=yE,i.addWorkflowStepReviewers=mE,i.addWorkflowSteps=ME,i.addWorkflowType=UE,i.addWorkflowTypes=LE,i.addWorkflows=XR,i.agentsReducer=kr,i.agentsSlice=xs,i.areArraysEqual=Uk,i.assetAttachmentReducer=Hr,i.assetAttachmentSlice=ti,i.assetProcedureReducer=ml,i.assetProcedureSlice=mi,i.assetProcedureStepFieldValuesAttachmentReducer=wu,i.assetProcedureStepFieldValuesAttachmentSlice=Fi,i.assetProcedureStepFieldValuesReducer=Vu,i.assetProcedureStepFieldValuesSlice=bi,i.assetProcedureStepFieldsAttachmentReducer=Kl,i.assetProcedureStepFieldsAttachmentSlice=Pi,i.assetProcedureStepFieldsReducer=cu,i.assetProcedureStepFieldsSlice=Ti,i.assetProcedureStepReducer=Nu,i.assetProcedureStepSlice=Mi,i.assetProcedureTypeAttachmentReducer=sd,i.assetProcedureTypeAttachmentSlice=ai,i.assetProcedureTypeFieldValuesAttachmentReducer=Ud,i.assetProcedureTypeFieldValuesAttachmentSlice=ui,i.assetProcedureTypeFieldValuesReducer=il,i.assetProcedureTypeFieldValuesSlice=yi,i.assetProcedureTypeFieldsAttachmentReducer=Sd,i.assetProcedureTypeFieldsAttachmentSlice=ri,i.assetProcedureTypeFieldsReducer=vd,i.assetProcedureTypeFieldsSlice=li,i.assetProcedureTypeReducer=vl,i.assetProcedureTypeSlice=Ai,i.assetReducer=co,i.assetSlice=Ei,i.assetStageCompletionReducer=Ao,i.assetStageCompletionSlice=Bi,i.assetStageReducer=Vo,i.assetStageSlice=Di,i.assetTypeAttachmentReducer=Yo,i.assetTypeAttachmentSlice=qi,i.assetTypeFieldValuesAttachmentReducer=Dh,i.assetTypeFieldValuesAttachmentSlice=Hi,i.assetTypeFieldValuesReducer=Jh,i.assetTypeFieldValuesSlice=Ji,i.assetTypeFieldsAttachmentReducer=dh,i.assetTypeFieldsAttachmentSlice=Ui,i.assetTypeFieldsReducer=Th,i.assetTypeFieldsSlice=Ni,i.assetTypeIdentifierReducer=lp,i.assetTypeIdentifierSlice=Qi,i.assetTypeIdentifierValueReducer=Ip,i.assetTypeIdentifierValueSlice=Xi,i.assetTypeReducer=zp,i.assetTypeSlice=xi,i.assetTypeStatusReducer=Zp,i.assetTypeStatusSlice=tn,i.assetTypeStatusSortFn=Ir,i.authReducer=ey,i.authSlice=Ms,i.baseReducer=xD,i.baseReducers=Jc,i.clearTokens=GV,i.createModelAdapter=T,i.createOfflineAction=OO,i.createPayload=_,i.createSelectionAdapter=jk,i.deleteAsset=xu,i.deleteAssetAttachment=$r,i.deleteAssetAttachments=ii,i.deleteAssetProcedure=hl,i.deleteAssetProcedureStep=Uu,i.deleteAssetProcedureStepFieldValues=bu,i.deleteAssetProcedureStepFieldValuesAttachment=yu,i.deleteAssetProcedureStepFieldValuesAttachments=gi,i.deleteAssetProcedureStepFieldValuesMany=Mu,i.deleteAssetProcedureStepFields=su,i.deleteAssetProcedureStepFieldsAttachment=Ul,i.deleteAssetProcedureStepFieldsAttachments=Ll,i.deleteAssetProcedureStepFieldsMany=iu,i.deleteAssetProcedureSteps=Lu,i.deleteAssetProcedureType=gl,i.deleteAssetProcedureTypeAttachment=ed,i.deleteAssetProcedureTypeAttachments=td,i.deleteAssetProcedureTypeFieldValues=tl,i.deleteAssetProcedureTypeFieldValuesAttachment=Cd,i.deleteAssetProcedureTypeFieldValuesAttachments=hi,i.deleteAssetProcedureTypeFieldValuesMany=sl,i.deleteAssetProcedureTypeFields=bd,i.deleteAssetProcedureTypeFieldsAttachment=yd,i.deleteAssetProcedureTypeFieldsAttachments=md,i.deleteAssetProcedureTypeFieldsMany=Md,i.deleteAssetProcedureTypes=Rl,i.deleteAssetProcedures=fi,i.deleteAssetStage=Eo,i.deleteAssetStageCompletion=So,i.deleteAssetStageCompletions=fo,i.deleteAssetStages=ko,i.deleteAssetType=kp,i.deleteAssetTypeAttachment=Lo,i.deleteAssetTypeAttachments=$i,i.deleteAssetTypeFieldValues=Nh,i.deleteAssetTypeFieldValuesAttachment=vh,i.deleteAssetTypeFieldValuesAttachments=Ki,i.deleteAssetTypeFieldValuesMany=Hh,i.deleteAssetTypeFields=fh,i.deleteAssetTypeFieldsAttachment=ih,i.deleteAssetTypeFieldsAttachments=nh,i.deleteAssetTypeFieldsMany=Ah,i.deleteAssetTypeIdentifier=np,i.deleteAssetTypeIdentifierValue=Ap,i.deleteAssetTypeIdentifierValues=wp,i.deleteAssetTypeIdentifiers=ap,i.deleteAssetTypeStatus=Gp,i.deleteAssetTypeStatuses=Kp,i.deleteAssetTypes=Vp,i.deleteAssets=Vi,i.deleteConversation=oV,i.deleteConversations=hV,i.deleteDocument=Iy,i.deleteDocumentAttachment=ly,i.deleteDocumentAttachments=uy,i.deleteDocuments=Fy,i.deleteEmailDomain=zy,i.deleteEmailDomains=qy,i.deleteForm=tS,i.deleteFormIdentifier=em,i.deleteFormIdentifierValue=ym,i.deleteFormIdentifierValues=mm,i.deleteFormIdentifiers=tm,i.deleteFormRevision=Cm,i.deleteFormRevisionAttachment=bm,i.deleteFormRevisionAttachments=Mm,i.deleteFormRevisions=fn,i.deleteFormSubmission=gS,i.deleteFormSubmissionAttachment=yS,i.deleteFormSubmissionAttachments=Tn,i.deleteFormSubmissions=bn,i.deleteForms=sS,i.deleteGeoImage=$S,i.deleteGeoImages=CS,i.deleteIssue=iA,i.deleteIssueAssociation=xS,i.deleteIssueAssociations=qt,i.deleteIssueAttachment=ff,i.deleteIssueAttachments=Dn,i.deleteIssueComment=Hf,i.deleteIssueCommentAttachment=Ef,i.deleteIssueCommentAttachments=kf,i.deleteIssueComments=Gf,i.deleteIssueType=cP,i.deleteIssueTypeAttachment=fA,i.deleteIssueTypeAttachments=AA,i.deleteIssueTypeFieldValues=HA,i.deleteIssueTypeFieldValuesAttachment=Aw,i.deleteIssueTypeFieldValuesAttachments=Xn,i.deleteIssueTypeFieldValuesMany=GA,i.deleteIssueTypeFields=aw,i.deleteIssueTypeFieldsAttachment=EA,i.deleteIssueTypeFieldsAttachments=kA,i.deleteIssueTypeFieldsMany=cw,i.deleteIssueTypeIdentifier=kw,i.deleteIssueTypeIdentifierValue=Gw,i.deleteIssueTypeIdentifierValues=Kw,i.deleteIssueTypeIdentifiers=Vw,i.deleteIssueTypeStatus=PP,i.deleteIssueTypeStatuses=OP,i.deleteIssueTypes=rP,i.deleteIssueUpdate=oa,i.deleteIssueUpdates=ha,i.deleteIssues=Ln,i.deleteOrganization=yO,i.deleteOrganizationAccess=eO,i.deleteOrganizationAccesses=tO,i.deleteOrganizations=mO,i.deleteProcedure=WT,i.deleteProcedureFieldValues=Xg,i.deleteProcedureFieldValuesAttachment=qg,i.deleteProcedureFieldValuesAttachments=lc,i.deleteProcedureFieldValuesMany=xg,i.deleteProcedureStep=q_,i.deleteProcedureStepAssignee=QT,i.deleteProcedureStepAssignees=ZT,i.deleteProcedureStepComment=uI,i.deleteProcedureStepComments=oI,i.deleteProcedureStepDefaultAssignee=FI,i.deleteProcedureStepDefaultAssignees=_I,i.deleteProcedureStepDefaultReviewer=qI,i.deleteProcedureStepDefaultReviewers=jI,i.deleteProcedureStepEvent=XI,i.deleteProcedureStepEvents=xI,i.deleteProcedureStepFieldValues=ZF,i.deleteProcedureStepFieldValuesAttachment=zF,i.deleteProcedureStepFieldValuesAttachments=Ga,i.deleteProcedureStepFieldValuesMany=XF,i.deleteProcedureStepFieldValuesReview=u_,i.deleteProcedureStepFieldValuesReviews=Za,i.deleteProcedureStepFields=_F,i.deleteProcedureStepFieldsAttachment=oF,i.deleteProcedureStepFieldsAttachments=$a,i.deleteProcedureStepFieldsMany=gF,i.deleteProcedureStepReviewer=F_,i.deleteProcedureStepReviewers=__,i.deleteProcedureSteps=j_,i.deleteProcedureType=hR,i.deleteProcedureTypeAttachment=Z_,i.deleteProcedureTypeAttachments=X_,i.deleteProcedureTypeFields=_g,i.deleteProcedureTypeFieldsAttachment=og,i.deleteProcedureTypeFieldsAttachments=hg,i.deleteProcedureTypeFieldsMany=gg,i.deleteProcedureTypes=pR,i.deleteProcedures=va,i.deleteProject=IT,i.deleteProjectAccess=DO,i.deleteProjectAccesses=WO,i.deleteProjectAttachment=YO,i.deleteProjectAttachments=JO,i.deleteProjectFile=dT,i.deleteProjectFiles=lT,i.deleteProjects=FT,i.deleteTeam=CR,i.deleteTeamMembership=RR,i.deleteTeamMemberships=bR,i.deleteTeams=UR,i.deleteUser=fa,i.deleteUsers=UP,i.deleteWorkflow=ib,i.deleteWorkflowIssueLink=Sb,i.deleteWorkflowIssueLinks=os,i.deleteWorkflowStep=BE,i.deleteWorkflowStepAssignee=kb,i.deleteWorkflowStepAssignees=Vb,i.deleteWorkflowStepComment=Gb,i.deleteWorkflowStepComments=Kb,i.deleteWorkflowStepDefaultAssignee=cM,i.deleteWorkflowStepDefaultAssignees=rM,i.deleteWorkflowStepDefaultReviewer=PM,i.deleteWorkflowStepDefaultReviewers=OM,i.deleteWorkflowStepEvent=BM,i.deleteWorkflowStepEvents=DM,i.deleteWorkflowStepFieldValues=Bv,i.deleteWorkflowStepFieldValuesAttachment=Pv,i.deleteWorkflowStepFieldValuesAttachments=Dc,i.deleteWorkflowStepFieldValuesMany=Dv,i.deleteWorkflowStepFieldValuesReview=cE,i.deleteWorkflowStepFieldValuesReviewRequest=Kv,i.deleteWorkflowStepFieldValuesReviewRequests=$c,i.deleteWorkflowStepFieldValuesReviews=Lc,i.deleteWorkflowStepFields=rv,i.deleteWorkflowStepFieldsAttachment=KM,i.deleteWorkflowStepFieldsAttachments=vc,i.deleteWorkflowStepFieldsMany=dv,i.deleteWorkflowStepReviewer=PE,i.deleteWorkflowStepReviewers=OE,i.deleteWorkflowSteps=DE,i.deleteWorkflowType=YE,i.deleteWorkflowTypes=JE,i.deleteWorkflows=nb,i.dequeue=uk,i.discard=hk,i.documentAttachmentReducer=yy,i.documentAttachmentSlice=nn,i.documentSlice=cn,i.documentsReducer=_y,i.downloadFile=Qk,i.emailDomainsReducer=Uy,i.emailDomainsSlice=dn,i.emailRegex=nV,i.enqueue=lk,i.enqueueRequest=IO,i.extractResponseFromError=yk,i.fallbackToEmptyArray=A,i.fallbackToEmptyObject=ts,i.fetchBlobFromObjectUrl=Sr,i.fetchFileFromObjectUrl=fr,i.fileReducer=Hy,i.fileSlice=un,i.formIdentifierReducer=am,i.formIdentifierSlice=on,i.formIdentifierValueReducer=wm,i.formIdentifierValueSlice=pn,i.formReducer=iS,i.formRevisionAttachmentReducer=Vm,i.formRevisionAttachmentSlice=yn,i.formRevisionReducer=Gm,i.formRevisionsSlice=mn,i.formSlice=An,i.formSubmissionAttachmentReducer=AS,i.formSubmissionAttachmentSlice=Pn,i.formSubmissionReducer=ES,i.formSubmissionSlice=gn,i.geoImageReducer=HS,i.geoImageSlice=vn,i.getAssetProcedureStepSubTree=Tr,i.getAssetProcedureStepTrees=aV,i.getClientSDK=wk,i.getClientStore=Zt,i.getDocumentSubTree=gr,i.getDocumentTrees=cV,i.getFileExtension=mr,i.getLocalDateString=yr,i.getLocalRelativeDateString=Gk,i.getOutboxCoordinator=Ct,i.getRenamedFile=Jk,i.getRequestDescription=w,i.getS3FileKey=Yk,i.hashFile=ws,i.initSDK=dq,i.initializeAssetAttachments=Br,i.initializeAssetProcedureStepFieldValues=Ou,i.initializeAssetProcedureStepFieldValuesAttachments=du,i.initializeAssetProcedureStepFields=Jl,i.initializeAssetProcedureStepFieldsAttachments=Dl,i.initializeAssetProcedureSteps=Du,i.initializeAssetProcedureTypeAttachments=Kr,i.initializeAssetProcedureTypeFieldValues=Yd,i.initializeAssetProcedureTypeFieldValuesAttachments=Dd,i.initializeAssetProcedureTypeFields=Od,i.initializeAssetProcedureTypeFieldsAttachments=rd,i.initializeAssetProcedureTypes=Ol,i.initializeAssetProcedures=dl,i.initializeAssetStageCompletions=lo,i.initializeAssetStages=Fo,i.initializeAssetTypeAttachments=zo,i.initializeAssetTypeFieldValues=zh,i.initializeAssetTypeFieldValuesAttachments=Fh,i.initializeAssetTypeFields=uh,i.initializeAssetTypeFieldsAttachments=Qo,i.initializeAssetTypeIdentifierValues=op,i.initializeAssetTypeIdentifiers=Zh,i.initializeAssetTypeStatuses=jp,i.initializeAssetTypes=_p,i.initializeAssets=Ju,i.initializeConversations=br,i.initializeDocumentAttachments=sy,i.initializeDocuments=Sy,i.initializeEmailDomains=vy,i.initializeFormIdentifierValues=rm,i.initializeFormIdentifiers=Ky,i.initializeFormRevisionAttachments=Om,i.initializeFormRevisions=Dm,i.initializeFormSubmissionAttachments=dS,i.initializeFormSubmissions=PS,i.initializeForms=Ym,i.initializeGeoImages=VS,i.initializeIssueAssociations=KS,i.initializeIssueAttachments=of,i.initializeIssueCommentAttachments=Ff,i.initializeIssueComments=qf,i.initializeIssueTypeAttachments=uA,i.initializeIssueTypeFieldValues=qA,i.initializeIssueTypeFieldValuesAttachments=hw,i.initializeIssueTypeFields=XA,i.initializeIssueTypeFieldsAttachments=FA,i.initializeIssueTypeIdentifierValues=jw,i.initializeIssueTypeIdentifiers=_w,i.initializeIssueTypeStatuses=pP,i.initializeIssueTypes=xw,i.initializeIssueUpdates=gP,i.initializeIssues=Zf,i.initializeOrganizationAccesses=KP,i.initializeOrganizations=rO,i.initializeProcedureFieldValues=Hg,i.initializeProcedureFieldValuesAttachments=kg,i.initializeProcedureStepAssignees=LT,i.initializeProcedureStepComments=iI,i.initializeProcedureStepDefaultAssignees=fI,i.initializeProcedureStepDefaultReviewers=EI,i.initializeProcedureStepEvents=HI,i.initializeProcedureStepFieldValues=NF,i.initializeProcedureStepFieldValuesAttachments=EF,i.initializeProcedureStepFieldValuesReviews=n_,i.initializeProcedureStepFields=AF,i.initializeProcedureStepFieldsAttachments=aF,i.initializeProcedureStepReviewers=f_,i.initializeProcedureSteps=E_,i.initializeProcedureTypeAttachments=N_,i.initializeProcedureTypeFields=Ag,i.initializeProcedureTypeFieldsAttachments=ng,i.initializeProcedureTypes=aR,i.initializeProcedures=vT,i.initializeProjectAccesses=bO,i.initializeProjectAttachments=CO,i.initializeProjectFiles=tT,i.initializeProjects=ST,i.initializeTeamMemberships=PR,i.initializeTeams=BR,i.initializeUsers=WP,i.initializeWorkflowIssueLinks=ub,i.initializeWorkflowStepAssignees=_b,i.initializeWorkflowStepComments=jb,i.initializeWorkflowStepDefaultAssignees=xb,i.initializeWorkflowStepDefaultReviewers=pM,i.initializeWorkflowStepEvents=RM,i.initializeWorkflowStepFieldValues=Rv,i.initializeWorkflowStepFieldValuesAttachments=yv,i.initializeWorkflowStepFieldValuesReviewRequests=Cv,i.initializeWorkflowStepFieldValuesReviews=eE,i.initializeWorkflowStepFields=ev,i.initializeWorkflowStepFieldsAttachments=CM,i.initializeWorkflowStepReviewers=pE,i.initializeWorkflowSteps=RE,i.initializeWorkflowTypes=CE,i.initializeWorkflows=QR,i.isImageFile=Zk,i.isObjectUrl=Ar,i.isToday=Hk,i.issueAssociationReducer=lf,i.issueAssociationSlice=kn,i.issueAttachmentReducer=Tf,i.issueAttachmentSlice=Vn,i.issueCommentAttachmentReducer=Wf,i.issueCommentAttachmentSlice=zn,i.issueCommentReducer=Jf,i.issueCommentSlice=jn,i.issueReducer=dA,i.issueSlice=Cn,i.issueTypeAttachmentReducer=TA,i.issueTypeAttachmentSlice=Nn,i.issueTypeFieldValuesAttachmentReducer=Iw,i.issueTypeFieldValuesAttachmentSlice=Qn,i.issueTypeFieldValuesReducer=QA,i.issueTypeFieldValuesSlice=Yn,i.issueTypeFieldsAttachmentReducer=WA,i.issueTypeFieldsAttachmentSlice=Gn,i.issueTypeFieldsReducer=uw,i.issueTypeFieldsSlice=Jn,i.issueTypeIdentifierReducer=zw,i.issueTypeIdentifierSlice=ea,i.issueTypeIdentifierValueReducer=Zw,i.issueTypeIdentifierValueSlice=sa,i.issueTypeReducer=oP,i.issueTypeSlice=ia,i.issueTypeStatusReducer=FP,i.issueTypeStatusSlice=aa,i.issueTypeStatusSortFn=Fr,i.issueUpdateReducer=BP,i.issueUpdateSlice=da,i.logOnlyOnce=Xk,i.markAsDeleted=FO,i.markForDeletion=MB,i.memoize=Qs,i.organizationAccessReducer=sO,i.organizationAccessSlice=wa,i.organizationReducer=PO,i.organizationSlice=Pa,i.outboxReducer=gO,i.outboxSlice=Oa,i.overmapEnhancer=dW,i.overmapReducer=eW,i.overmapReducers=ek,i.performRequest=Xc,i.performRequestFromAction=ok,i.procedureFieldValuesAttachmentReducer=jg,i.procedureFieldValuesAttachmentSlice=rc,i.procedureFieldValuesReducer=eR,i.procedureFieldValuesSlice=oc,i.procedureReducer=zT,i.procedureSlice=ba,i.procedureStepAssigneeReducer=tI,i.procedureStepAssigneeSlice=Ea,i.procedureStepCommentReducer=mI,i.procedureStepCommentSlice=ka,i.procedureStepDefaultAssigneeReducer=MI,i.procedureStepDefaultAssigneeSlice=Va,i.procedureStepDefaultReviewerReducer=LI,i.procedureStepDefaultReviewerSlice=Da,i.procedureStepEventReducer=iF,i.procedureStepEventSlice=za,i.procedureStepFieldValuesAttachmentReducer=UF,i.procedureStepFieldValuesAttachmentSlice=Na,i.procedureStepFieldValuesReducer=xF,i.procedureStepFieldValuesReviewReducer=m_,i.procedureStepFieldValuesReviewSlice=Ja,i.procedureStepFieldValuesSlice=Ya,i.procedureStepFieldsAttachmentReducer=SF,i.procedureStepFieldsAttachmentSlice=qa,i.procedureStepFieldsReducer=MF,i.procedureStepFieldsSlice=Ua,i.procedureStepReducer=$_,i.procedureStepReviewerReducer=M_,i.procedureStepReviewerSlice=Xa,i.procedureStepSlice=xa,i.procedureTypeAttachmentReducer=x_,i.procedureTypeAttachmentSlice=sc,i.procedureTypeFieldsAttachmentReducer=pg,i.procedureTypeFieldsAttachmentSlice=nc,i.procedureTypeFieldsReducer=Rg,i.procedureTypeFieldsSlice=cc,i.procedureTypeReducer=yR,i.procedureTypeSlice=pc,i.projectAccessReducer=zO,i.projectAccessSlice=Ta,i.projectAttachmentReducer=xO,i.projectAttachmentSlice=Fa,i.projectFileReducer=yT,i.projectFileSlice=ga,i.projectReducer=_T,i.projectSlice=Ra,i.rehydratedReducer=AR,i.rehydratedSlice=mc,i.restructureSelectorWithArgs=S,i.runMiddleware=Ik,i.selectAccessToken=KV,i.selectAccessesByUserOfProject=EB,i.selectAccessibleProjects=BB,i.selectActiveOrganizationAccess=_B,i.selectAllDocumentAttachments=an,i.selectAssetAttachmentById=Ur,i.selectAssetAttachmentMapping=Cr,i.selectAssetAttachments=ni,i.selectAssetAttachmentsByIds=Lr,i.selectAssetById=no,i.selectAssetProcedureById=Al,i.selectAssetProcedureStepById=Hu,i.selectAssetProcedureStepFieldValues=ss,i.selectAssetProcedureStepFieldValuesAttachmentById=Su,i.selectAssetProcedureStepFieldValuesAttachments=Ri,i.selectAssetProcedureStepFieldValuesAttachmentsByIds=fu,i.selectAssetProcedureStepFieldValuesAttachmentsMapping=mu,i.selectAssetProcedureStepFieldValuesById=Eu,i.selectAssetProcedureStepFieldValuesByIds=ku,i.selectAssetProcedureStepFieldValuesMapping=vu,i.selectAssetProcedureStepFieldValuesOfAsset=RV,i.selectAssetProcedureStepFieldValuesOfAssetProcedure=bV,i.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=MV,i.selectAssetProcedureStepFields=Fs,i.selectAssetProcedureStepFieldsAttachmentById=Hl,i.selectAssetProcedureStepFieldsAttachments=Oi,i.selectAssetProcedureStepFieldsAttachmentsByIds=Gl,i.selectAssetProcedureStepFieldsAttachmentsMapping=Nl,i.selectAssetProcedureStepFieldsById=nu,i.selectAssetProcedureStepFieldsByIds=au,i.selectAssetProcedureStepFieldsMapping=Ii,i.selectAssetProcedureStepFieldsOfAssetProcedureStep=FV,i.selectAssetProcedureStepMapping=_s,i.selectAssetProcedureSteps=vi,i.selectAssetProcedureStepsByIds=Gu,i.selectAssetProcedureStepsMappingOfAssetProcedureType=vV,i.selectAssetProcedureStepsOfAssetProcedureType=EV,i.selectAssetProcedureTypeAttachmentById=nd,i.selectAssetProcedureTypeAttachmentMapping=id,i.selectAssetProcedureTypeAttachments=ci,i.selectAssetProcedureTypeAttachmentsByIds=ad,i.selectAssetProcedureTypeById=kl,i.selectAssetProcedureTypeFieldValues=Ts,i.selectAssetProcedureTypeFieldValuesAttachmentById=Nd,i.selectAssetProcedureTypeFieldValuesAttachments=pi,i.selectAssetProcedureTypeFieldValuesAttachmentsByIds=Hd,i.selectAssetProcedureTypeFieldValuesAttachmentsMapping=Ld,i.selectAssetProcedureTypeFieldValuesById=al,i.selectAssetProcedureTypeFieldValuesByIds=cl,i.selectAssetProcedureTypeFieldValuesMapping=nl,i.selectAssetProcedureTypeFieldValuesOfAsset=wV,i.selectAssetProcedureTypeFields=Os,i.selectAssetProcedureTypeFieldsAttachmentById=Ad,i.selectAssetProcedureTypeFieldsAttachments=di,i.selectAssetProcedureTypeFieldsAttachmentsByIds=wd,i.selectAssetProcedureTypeFieldsAttachmentsMapping=fd,i.selectAssetProcedureTypeFieldsById=kd,i.selectAssetProcedureTypeFieldsByIds=Vd,i.selectAssetProcedureTypeFieldsMapping=Ed,i.selectAssetProcedureTypeFieldsOfAssetProcedureType=fV,i.selectAssetProcedureTypes=wi,i.selectAssetProcedureTypesByIds=Vl,i.selectAssetProcedureTypesMapping=El,i.selectAssetProcedureTypesOfOrganization=TV,i.selectAssetProcedures=Is,i.selectAssetProceduresByIds=wl,i.selectAssetProceduresMapping=Sl,i.selectAssetProceduresOfAssetProcedureType=fl,i.selectAssetProceduresOfAssetType=OV,i.selectAssetStageById=Bo,i.selectAssetStageCompletionById=Oo,i.selectAssetStageCompletionMapping=wo,i.selectAssetStageCompletions=Po,i.selectAssetStageCompletionsByIds=To,i.selectAssetStages=zi,i.selectAssetStagesByIds=Do,i.selectAssetStagesMappingOfAssetProcedureType=VV,i.selectAssetStagesOfAssetProcedureType=BV,i.selectAssetTypeAttachmentById=Ho,i.selectAssetTypeAttachmentMapping=No,i.selectAssetTypeAttachments=Ci,i.selectAssetTypeAttachmentsByIds=Go,i.selectAssetTypeById=Dp,i.selectAssetTypeFieldValues=Rs,i.selectAssetTypeFieldValuesAttachmentById=kh,i.selectAssetTypeFieldValuesAttachments=Yi,i.selectAssetTypeFieldValuesAttachmentsByIds=Vh,i.selectAssetTypeFieldValuesAttachmentsMapping=Eh,i.selectAssetTypeFieldValuesById=Kh,i.selectAssetTypeFieldValuesByIds=Yh,i.selectAssetTypeFieldValuesMapping=Gh,i.selectAssetTypeFieldValuesOfAsset=qV,i.selectAssetTypeFields=is,i.selectAssetTypeFieldsAttachmentById=ch,i.selectAssetTypeFieldsAttachments=Li,i.selectAssetTypeFieldsAttachmentsByIds=rh,i.selectAssetTypeFieldsAttachmentsMapping=ah,i.selectAssetTypeFieldsById=Ph,i.selectAssetTypeFieldsByIds=Oh,i.selectAssetTypeFieldsMapping=wh,i.selectAssetTypeFieldsOfAssetType=WV,i.selectAssetTypeIdentifierById=rp,i.selectAssetTypeIdentifierMapping=cp,i.selectAssetTypeIdentifierValueById=Op,i.selectAssetTypeIdentifierValueMapping=Pp,i.selectAssetTypeIdentifierValues=bs,i.selectAssetTypeIdentifierValuesByIds=Tp,i.selectAssetTypeIdentifierValuesOfAsset=CV,i.selectAssetTypeIdentifierValuesOfIdentifier=UV,i.selectAssetTypeIdentifiers=Zi,i.selectAssetTypeIdentifiersByIds=dp,i.selectAssetTypeIdentifiersOfAssetType=$V,i.selectAssetTypeStatusById=Jp,i.selectAssetTypeStatusMapping=Yp,i.selectAssetTypeStatuses=sn,i.selectAssetTypeStatusesByIds=Qp,i.selectAssetTypeStatusesOfAssetType=NV,i.selectAssetTypeValuesOfAssetType=jV,i.selectAssetTypes=en,i.selectAssetTypesByIds=Wp,i.selectAssetTypesMapping=Bp,i.selectAssetTypesOfOrganization=LV,i.selectAssets=gs,i.selectAssetsByIds=ao,i.selectAssetsMapping=so,i.selectAssetsOfAssetType=io,i.selectAssetsOfProject=kV,i.selectAttachmentsOfAsset=Nr,i.selectAttachmentsOfAssetProcedureStepFieldValues=Au,i.selectAttachmentsOfAssetProcedureStepFields=IV,i.selectAttachmentsOfAssetProcedureType=mV,i.selectAttachmentsOfAssetProcedureTypeFieldValues=Gd,i.selectAttachmentsOfAssetProcedureTypeFields=SV,i.selectAttachmentsOfAssetType=Ko,i.selectAttachmentsOfAssetTypeFieldValues=Bh,i.selectAttachmentsOfAssetTypeFields=DV,i.selectAttachmentsOfDocument=JV,i.selectAttachmentsOfFormRevision=aB,i.selectAttachmentsOfFormSubmission=fS,i.selectAttachmentsOfIssue=wf,i.selectAttachmentsOfIssueComment=lB,i.selectAttachmentsOfIssueType=hB,i.selectAttachmentsOfIssueTypeFieldValues=Tw,i.selectAttachmentsOfIssueTypeFields=pB,i.selectAttachmentsOfProcedureFieldValues=Lg,i.selectAttachmentsOfProcedureStepFieldValues=CF,i.selectAttachmentsOfProcedureStepFields=pF,i.selectAttachmentsOfProcedureType=uD,i.selectAttachmentsOfProcedureTypeFields=oD,i.selectAttachmentsOfProject=VB,i.selectAttachmentsOfWorkflowStepFieldValues=Fv,i.selectAttachmentsOfWorkflowStepFields=JM,i.selectCommentsOfIssue=uB,i.selectConversation=yV,i.selectConversationMapping=ei,i.selectConversations=pV,i.selectCurrentUser=NP,i.selectDeletedRequests=RB,i.selectDescendantsOfAssetProcedureStep=Ku,i.selectDescendantsOfDocument=by,i.selectDocumentAttachmentById=hy,i.selectDocumentAttachmentMapping=oy,i.selectDocumentAttachmentsByIds=py,i.selectDocumentById=gy,i.selectDocuments=vs,i.selectDocumentsByIds=Ry,i.selectDocumentsMapping=rn,i.selectEmailDomainById=$y,i.selectEmailDomains=ln,i.selectEmailDomainsAsMapping=jy,i.selectEmailDomainsByIds=Cy,i.selectEmailDomainsOfOrganization=XV,i.selectFieldValuesOfAssetProcedure=PV,i.selectFieldValuesOfProcedure=yD,i.selectFormById=aS,i.selectFormIdentifierById=im,i.selectFormIdentifierMapping=sm,i.selectFormIdentifierValueById=fm,i.selectFormIdentifierValueMapping=Sm,i.selectFormIdentifierValues=Es,i.selectFormIdentifierValuesByIds=Am,i.selectFormIdentifierValuesOfFormSubmission=iB,i.selectFormIdentifierValuesOfIdentifier=nB,i.selectFormIdentifiers=hn,i.selectFormIdentifiersByIds=nm,i.selectFormIdentifiersOfForm=sB,i.selectFormMapping=nS,i.selectFormRevisionAttachmentById=Em,i.selectFormRevisionAttachments=vm,i.selectFormRevisionAttachmentsByIds=km,i.selectFormRevisionAttachmentsMapping=ks,i.selectFormRevisionById=Lm,i.selectFormRevisionMapping=Um,i.selectFormRevisions=Vs,i.selectFormRevisionsByIds=Nm,i.selectFormRevisionsOfForm=Hm,i.selectFormSubmissionAttachemntsByIds=_n,i.selectFormSubmissionAttachmentById=mS,i.selectFormSubmissionAttachments=Fn,i.selectFormSubmissionAttachmentsByIds=SS,i.selectFormSubmissionAttachmentsMapping=In,i.selectFormSubmissionById=bS,i.selectFormSubmissions=Mn,i.selectFormSubmissionsByIds=MS,i.selectFormSubmissionsMapping=RS,i.selectFormSubmissionsOfForm=vS,i.selectForms=wn,i.selectFormsByIds=cS,i.selectFormsOfOrganization=rB,i.selectGeoImageById=LS,i.selectGeoImageMapping=US,i.selectGeoImages=En,i.selectGeoImagesByIds=NS,i.selectGeoImagesOfProject=dB,i.selectIsLoggedIn=YV,i.selectIssueAssociationById=tf,i.selectIssueAssociationMapping=ef,i.selectIssueAssociations=jt,i.selectIssueAssociationsByIds=sf,i.selectIssueAssociationsOfAsset=df,i.selectIssueAssociationsOfIssue=rf,i.selectIssueAssociationsOfIssues=cf,i.selectIssueAssociationsToIssue=nf,i.selectIssueAssociationsToIssues=af,i.selectIssueAttachmentById=Pf,i.selectIssueAttachmentMapping=Af,i.selectIssueAttachments=Wn,i.selectIssueAttachmentsByIds=Of,i.selectIssueById=aA,i.selectIssueCommentAttachmentById=Bf,i.selectIssueCommentAttachmentMapping=Vf,i.selectIssueCommentAttachments=qn,i.selectIssueCommentAttachmentsByIds=Df,i.selectIssueCommentById=Kf,i.selectIssueCommentMapping=$n,i.selectIssueCommentsByIds=Yf,i.selectIssueMapping=nA,i.selectIssueTypeAttachmentById=PA,i.selectIssueTypeAttachmentMapping=wA,i.selectIssueTypeAttachments=Hn,i.selectIssueTypeAttachmentsByIds=OA,i.selectIssueTypeById=lP,i.selectIssueTypeFieldValues=Ds,i.selectIssueTypeFieldValuesAttachmentById=Pw,i.selectIssueTypeFieldValuesAttachments=xn,i.selectIssueTypeFieldValuesAttachmentsByIds=Ow,i.selectIssueTypeFieldValuesAttachmentsMapping=ww,i.selectIssueTypeFieldValuesById=YA,i.selectIssueTypeFieldValuesByIds=JA,i.selectIssueTypeFieldValuesMapping=KA,i.selectIssueTypeFieldValuesOfIssue=yB,i.selectIssueTypeFields=ns,i.selectIssueTypeFieldsAttachmentById=BA,i.selectIssueTypeFieldsAttachments=Kn,i.selectIssueTypeFieldsAttachmentsByIds=DA,i.selectIssueTypeFieldsAttachmentsMapping=VA,i.selectIssueTypeFieldsById=dw,i.selectIssueTypeFieldsByIds=lw,i.selectIssueTypeFieldsMapping=rw,i.selectIssueTypeFieldsOfIssueType=mB,i.selectIssueTypeIdentifierById=Dw,i.selectIssueTypeIdentifierMapping=Bw,i.selectIssueTypeIdentifierValueById=Jw,i.selectIssueTypeIdentifierValueMapping=Yw,i.selectIssueTypeIdentifierValues=Ws,i.selectIssueTypeIdentifierValuesByIds=Qw,i.selectIssueTypeIdentifierValuesOfIdentifier=PB,i.selectIssueTypeIdentifierValuesOfIssue=wB,i.selectIssueTypeIdentifiers=ta,i.selectIssueTypeIdentifiersByIds=Ww,i.selectIssueTypeIdentifiersOfIssueType=AB,i.selectIssueTypeMapping=dP,i.selectIssueTypeStatusById=ra,i.selectIssueTypeStatusMapping=TP,i.selectIssueTypeStatuses=ca,i.selectIssueTypeStatusesByIds=IP,i.selectIssueTypeStatusesOfIssueType=TB,i.selectIssueTypeValuesOfIssueType=fB,i.selectIssueTypes=na,i.selectIssueTypesByIds=uP,i.selectIssueTypesOfOrganization=OB,i.selectIssueUpdateById=EP,i.selectIssueUpdateMapping=pa,i.selectIssueUpdates=ya,i.selectIssueUpdatesByIds=kP,i.selectIssueUpdatesOfIssue=VP,i.selectIssues=Bs,i.selectIssuesByIds=cA,i.selectIssuesOfIssueType=rA,i.selectIssuesOfProject=oB,i.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=_V,i.selectLatestAssetProcedureTypeFieldsOfAssetProcedureType=AV,i.selectLatestAssetTypeFieldsOfAssetType=zV,i.selectLatestFieldsByAssetProcedureStep=gV,i.selectLatestFieldsByProcedureStep=XB,i.selectLatestFormRevisionOfForm=cB,i.selectLatestIssueTypeFieldsOfIssueType=SB,i.selectLatestProcedureStepFieldValuesReviewByProcedureStepFieldValues=nD,i.selectLatestProcedureStepFieldsOfProcedureStep=ZB,i.selectLatestProcedureTypeFieldsOfProcedureType=pD,i.selectLatestRetryTime=bB,i.selectLatestReviewOfProcedureStepFieldValues=sD,i.selectLatestReviewOfWorkflowStepFieldValues=HD,i.selectLatestReviewRequestOfWorkflowStepFieldValues=LD,i.selectLatestWorkflowStepFieldValuesByWorkflowStepOfWorkflow=UD,i.selectLatestWorkflowStepFieldValuesReviewByWorkflowStepFieldValues=KD,i.selectLatestWorkflowStepFieldsOfWorkflowStep=qD,i.selectMembershipsByUserOfTeam=wD,i.selectOrganizationAccessById=iO,i.selectOrganizationAccessMapping=js,i.selectOrganizationAccessUserMapping=aO,i.selectOrganizationAccessesByIds=nO,i.selectOrganizationById=AO,i.selectOrganizationDocuments=ZV,i.selectOrganizations=fO,i.selectOrganizationsByIds=wO,i.selectOrganizationsMapping=SO,i.selectProcedureById=jT,i.selectProcedureFieldValues=hc,i.selectProcedureFieldValuesAttachmentById=Cg,i.selectProcedureFieldValuesAttachments=uc,i.selectProcedureFieldValuesAttachmentsByIds=Ug,i.selectProcedureFieldValuesAttachmentsMapping=$g,i.selectProcedureFieldValuesById=sR,i.selectProcedureFieldValuesByIds=iR,i.selectProcedureFieldValuesMapping=tR,i.selectProcedureStepAssigneeById=xT,i.selectProcedureStepAssignees=cs,i.selectProcedureStepAssigneesByIds=eI,i.selectProcedureStepAssigneesMapping=XT,i.selectProcedureStepAssigneesOfProcedure=jB,i.selectProcedureStepAssigneesOfProcedureAndProcedureStep=CB,i.selectProcedureStepAssigneesOfProcedureStep=$B,i.selectProcedureStepById=C_,i.selectProcedureStepCommentById=pI,i.selectProcedureStepComments=rs,i.selectProcedureStepCommentsByIds=yI,i.selectProcedureStepCommentsMapping=hI,i.selectProcedureStepCommentsOfProcedure=UB,i.selectProcedureStepCommentsOfProcedureAndProcedureStep=NB,i.selectProcedureStepCommentsOfProcedureStep=LB,i.selectProcedureStepDefaultAssigneeById=RI,i.selectProcedureStepDefaultAssignees=Ba,i.selectProcedureStepDefaultAssigneesByIds=bI,i.selectProcedureStepDefaultAssigneesMapping=gI,i.selectProcedureStepDefaultAssigneesOfProcedureStep=HB,i.selectProcedureStepDefaultReviewerById=CI,i.selectProcedureStepDefaultReviewers=Wa,i.selectProcedureStepDefaultReviewersByIds=UI,i.selectProcedureStepDefaultReviewersMapping=$I,i.selectProcedureStepDefaultReviewersOfProcedureStep=GB,i.selectProcedureStepEventById=tF,i.selectProcedureStepEvents=ds,i.selectProcedureStepEventsByIds=sF,i.selectProcedureStepEventsMapping=eF,i.selectProcedureStepEventsOfProcedure=KB,i.selectProcedureStepEventsOfProcedureAndProcedureStep=JB,i.selectProcedureStepEventsOfProcedureStep=YB,i.selectProcedureStepFieldValues=Ht,i.selectProcedureStepFieldValuesAttachmentById=jF,i.selectProcedureStepFieldValuesAttachments=Ka,i.selectProcedureStepFieldValuesAttachmentsByIds=$F,i.selectProcedureStepFieldValuesAttachmentsMapping=qF,i.selectProcedureStepFieldValuesById=t_,i.selectProcedureStepFieldValuesByIds=s_,i.selectProcedureStepFieldValuesMapping=e_,i.selectProcedureStepFieldValuesOfProcedure=xB,i.selectProcedureStepFieldValuesOfProcedureAndProcedureStep=tD,i.selectProcedureStepFieldValuesOfProcedureStep=eD,i.selectProcedureStepFieldValuesReviewById=h_,i.selectProcedureStepFieldValuesReviews=Gt,i.selectProcedureStepFieldValuesReviewsByIds=p_,i.selectProcedureStepFieldValuesReviewsMapping=o_,i.selectProcedureStepFieldValuesReviewsOfProcedureAndProcedureStep=iD,i.selectProcedureStepFields=Cs,i.selectProcedureStepFieldsAttachmentById=yF,i.selectProcedureStepFieldsAttachments=Ca,i.selectProcedureStepFieldsAttachmentsByIds=mF,i.selectProcedureStepFieldsAttachmentsMapping=hF,i.selectProcedureStepFieldsById=RF,i.selectProcedureStepFieldsByIds=bF,i.selectProcedureStepFieldsMapping=La,i.selectProcedureStepFieldsOfProcedureStep=QB,i.selectProcedureStepReviewerById=R_,i.selectProcedureStepReviewers=ls,i.selectProcedureStepReviewersByIds=b_,i.selectProcedureStepReviewersMapping=g_,i.selectProcedureStepReviewersOfProcedure=aD,i.selectProcedureStepReviewersOfProcedureAndProcedureStep=rD,i.selectProcedureStepReviewersOfProcedureStep=cD,i.selectProcedureSteps=tc,i.selectProcedureStepsByIds=U_,i.selectProcedureStepsMapping=ec,i.selectProcedureStepsMappingOfProcedureType=dD,i.selectProcedureStepsOfProcedureType=lD,i.selectProcedureTypeAttachmentById=tg,i.selectProcedureTypeAttachmentMapping=eg,i.selectProcedureTypeAttachments=ic,i.selectProcedureTypeAttachmentsByIds=sg,i.selectProcedureTypeById=SR,i.selectProcedureTypeFields=Us,i.selectProcedureTypeFieldsAttachmentById=mg,i.selectProcedureTypeFieldsAttachments=ac,i.selectProcedureTypeFieldsAttachmentsByIds=Sg,i.selectProcedureTypeFieldsAttachmentsMapping=yg,i.selectProcedureTypeFieldsById=Mg,i.selectProcedureTypeFieldsByIds=vg,i.selectProcedureTypeFieldsMapping=bg,i.selectProcedureTypeFieldsOfProcedureType=hD,i.selectProcedureTypes=yc,i.selectProcedureTypesByIds=fR,i.selectProcedureTypesMapping=mR,i.selectProcedureTypesOfOrganization=mD,i.selectProcedures=Nt,i.selectProceduresByIds=$T,i.selectProceduresMapping=qT,i.selectProceduresOfAsset=zB,i.selectProceduresOfIssue=qB,i.selectProceduresOfProcedureType=CT,i.selectProceduresOfProject=WB,i.selectProjectAccessById=qO,i.selectProjectAccessMapping=Ia,i.selectProjectAccesses=as,i.selectProjectAccessesByIds=jO,i.selectProjectAccessesOfProject=vB,i.selectProjectAttachmentById=ZO,i.selectProjectAttachmentMapping=QO,i.selectProjectAttachments=_a,i.selectProjectAttachmentsByIds=XO,i.selectProjectById=RT,i.selectProjectDocuments=QV,i.selectProjectFileById=hT,i.selectProjectFileMapping=uT,i.selectProjectFiles=oT,i.selectProjectFilesByIds=pT,i.selectProjectMapping=gT,i.selectProjects=$s,i.selectProjectsByIds=bT,i.selectProjectsOfOrganization=DB,i.selectRehydrated=AD,i.selectReviewRequestsOfWorkflowStepFieldValues=Zv,i.selectReviewsOfProcedureStepFieldValues=y_,i.selectReviewsOfWorkflowStepFieldValues=uE,i.selectStageMapping=Wi,i.selectTeamById=NR,i.selectTeamMembershipById=ER,i.selectTeamMemberships=Ls,i.selectTeamMembershipsByIds=kR,i.selectTeamMembershipsMapping=vR,i.selectTeams=Ac,i.selectTeamsByIds=HR,i.selectTeamsMapping=LR,i.selectTeamsOfOrganization=OD,i.selectUploadUrl=tB,i.selectUserById=qs,i.selectUsers=zs,i.selectUsersByIds=HP,i.selectUsersMapping=Aa,i.selectUsersOfOrganization=gB,i.selectUsersOfProject=kB,i.selectUsersOfTeam=PD,i.selectWorkflowById=cb,i.selectWorkflowIssueLinkById=Ab,i.selectWorkflowIssueLinks=Kt,i.selectWorkflowIssueLinksByIds=wb,i.selectWorkflowIssueLinksMapping=fb,i.selectWorkflowIssueLinksOfIssue=Tb,i.selectWorkflowIssueLinksOfIssues=_D,i.selectWorkflowIssueLinksOfWorkflow=Pb,i.selectWorkflowIssueLinksOfWorkflows=Ob,i.selectWorkflowMapping=ab,i.selectWorkflowStepAssigneeById=Db,i.selectWorkflowStepAssignees=hs,i.selectWorkflowStepAssigneesByIds=Wb,i.selectWorkflowStepAssigneesMapping=Bb,i.selectWorkflowStepAssigneesOfWorkflow=gD,i.selectWorkflowStepAssigneesOfWorkflowAndWorkflowStep=bD,i.selectWorkflowStepAssigneesOfWorkflowStep=RD,i.selectWorkflowStepById=zE,i.selectWorkflowStepCommentById=Jb,i.selectWorkflowStepComments=ps,i.selectWorkflowStepCommentsByIds=Qb,i.selectWorkflowStepCommentsMapping=Yb,i.selectWorkflowStepCommentsOfWorkflow=MD,i.selectWorkflowStepCommentsOfWorkflowAndWorkflowStep=ED,i.selectWorkflowStepCommentsOfWorkflowStep=vD,i.selectWorkflowStepDefaultAssigneeById=lM,i.selectWorkflowStepDefaultAssignees=Fc,i.selectWorkflowStepDefaultAssigneesByIds=uM,i.selectWorkflowStepDefaultAssigneesMapping=dM,i.selectWorkflowStepDefaultAssigneesOfWorkflowStep=kD,i.selectWorkflowStepDefaultReviewerById=IM,i.selectWorkflowStepDefaultReviewers=gc,i.selectWorkflowStepDefaultReviewersByIds=FM,i.selectWorkflowStepDefaultReviewersMapping=TM,i.selectWorkflowStepDefaultReviewersOfWorkflowStep=VD,i.selectWorkflowStepEventById=zM,i.selectWorkflowStepEvents=ys,i.selectWorkflowStepEventsByIds=qM,i.selectWorkflowStepEventsMapping=WM,i.selectWorkflowStepEventsOfWorkflow=BD,i.selectWorkflowStepEventsOfWorkflowAndWorkflowStep=WD,i.selectWorkflowStepEventsOfWorkflowStep=DD,i.selectWorkflowStepFieldValues=Bt,i.selectWorkflowStepFieldValuesAttachmentById=Tv,i.selectWorkflowStepFieldValuesAttachments=Wc,i.selectWorkflowStepFieldValuesAttachmentsByIds=Iv,i.selectWorkflowStepFieldValuesAttachmentsMapping=Ov,i.selectWorkflowStepFieldValuesById=zv,i.selectWorkflowStepFieldValuesByIds=qv,i.selectWorkflowStepFieldValuesMapping=Wv,i.selectWorkflowStepFieldValuesOfWorkflow=jD,i.selectWorkflowStepFieldValuesOfWorkflowAndWorkflowStep=CD,i.selectWorkflowStepFieldValuesOfWorkflowStep=$D,i.selectWorkflowStepFieldValuesReviewById=dE,i.selectWorkflowStepFieldValuesReviewRequestById=Jv,i.selectWorkflowStepFieldValuesReviewRequests=ms,i.selectWorkflowStepFieldValuesReviewRequestsByIds=Qv,i.selectWorkflowStepFieldValuesReviewRequestsMapping=Yv,i.selectWorkflowStepFieldValuesReviewRequestsOfWorkflowAndWorkflowStep=ND,i.selectWorkflowStepFieldValuesReviews=Yt,i.selectWorkflowStepFieldValuesReviewsByIds=lE,i.selectWorkflowStepFieldValuesReviewsMapping=rE,i.selectWorkflowStepFieldValuesReviewsOfWorkflowAndWorkflowStep=GD,i.selectWorkflowStepFields=Hs,i.selectWorkflowStepFieldsAttachmentById=QM,i.selectWorkflowStepFieldsAttachments=Ec,i.selectWorkflowStepFieldsAttachmentsByIds=ZM,i.selectWorkflowStepFieldsAttachmentsMapping=YM,i.selectWorkflowStepFieldsById=uv,i.selectWorkflowStepFieldsByIds=ov,i.selectWorkflowStepFieldsMapping=lv,i.selectWorkflowStepFieldsOfWorkflowStep=zD,i.selectWorkflowStepReviewerById=IE,i.selectWorkflowStepReviewers=Ss,i.selectWorkflowStepReviewersByIds=FE,i.selectWorkflowStepReviewersMapping=TE,i.selectWorkflowStepReviewersOfWorkflow=YD,i.selectWorkflowStepReviewersOfWorkflowAndWorkflowStep=QD,i.selectWorkflowStepReviewersOfWorkflowStep=JD,i.selectWorkflowSteps=Gc,i.selectWorkflowStepsByIds=qE,i.selectWorkflowStepsMapping=WE,i.selectWorkflowStepsOfWorkflowType=ZD,i.selectWorkflowTypeById=ZE,i.selectWorkflowTypeMapping=QE,i.selectWorkflowTypes=Yc,i.selectWorkflowTypesByIds=XE,i.selectWorkflowTypesOfOrganization=XD,i.selectWorkflows=Ns,i.selectWorkflowsByIds=rb,i.selectWorkflowsOfProject=ID,i.selectWorkflowsOfWorkflowType=FD,i.setAsset=eo,i.setAssetAttachment=Wr,i.setAssetAttachments=zr,i.setAssetProcedure=pl,i.setAssetProcedureStep=Wu,i.setAssetProcedureStepFieldValues=Fu,i.setAssetProcedureStepFieldValuesAttachment=uu,i.setAssetProcedureStepFieldValuesAttachments=ou,i.setAssetProcedureStepFieldValuesMany=_u,i.setAssetProcedureStepFields=Xl,i.setAssetProcedureStepFieldsAttachment=ql,i.setAssetProcedureStepFieldsAttachments=jl,i.setAssetProcedureStepFieldsMany=xl,i.setAssetProcedureSteps=zu,i.setAssetProcedureType=bl,i.setAssetProcedureTypeAttachment=Qr,i.setAssetProcedureTypeAttachments=Zr,i.setAssetProcedureTypeFieldValues=Zd,i.setAssetProcedureTypeFieldValuesAttachment=zd,i.setAssetProcedureTypeFieldValuesAttachments=qd,i.setAssetProcedureTypeFieldValuesMany=Xd,i.setAssetProcedureTypeFields=Fd,i.setAssetProcedureTypeFieldsAttachment=ud,i.setAssetProcedureTypeFieldsAttachments=od,i.setAssetProcedureTypeFieldsMany=_d,i.setAssetProcedureTypes=Ml,i.setAssetProcedures=yl,i.setAssetStage=_o,i.setAssetStageCompletion=ho,i.setAssetStageCompletions=po,i.setAssetStages=go,i.setAssetType=gp,i.setAssetTypeAttachment=jo,i.setAssetTypeAttachments=$o,i.setAssetTypeFieldValues=$h,i.setAssetTypeFieldValuesAttachment=gh,i.setAssetTypeFieldValuesAttachments=Rh,i.setAssetTypeFieldValuesMany=Ch,i.setAssetTypeFields=ph,i.setAssetTypeFieldsAttachment=xo,i.setAssetTypeFieldsAttachments=eh,i.setAssetTypeFieldsMany=yh,i.setAssetTypeIdentifier=ep,i.setAssetTypeIdentifierValue=yp,i.setAssetTypeIdentifierValues=mp,i.setAssetTypeIdentifiers=tp,i.setAssetTypeStatus=Up,i.setAssetTypeStatuses=Lp,i.setAssetTypes=Rp,i.setAssets=to,i.setClientSDK=Ak,i.setClientStore=Sk,i.setConversation=vr,i.setConversations=lV,i.setCurrentUser=IB,i.setCurrentUserProfile=FB,i.setDocument=wy,i.setDocumentAttachment=ay,i.setDocumentAttachments=cy,i.setDocuments=Py,i.setEmailDomain=Vy,i.setEmailDomains=By,i.setForm=Zm,i.setFormIdentifier=Qy,i.setFormIdentifierValue=um,i.setFormIdentifierValues=om,i.setFormIdentifiers=Zy,i.setFormRevision=zm,i.setFormRevisionAttachment=Fm,i.setFormRevisionAttachments=_m,i.setFormRevisions=qm,i.setFormSubmission=OS,i.setFormSubmissionAttachment=uS,i.setFormSubmissionAttachments=oS,i.setFormSubmissions=TS,i.setForms=Xm,i.setGeoImage=BS,i.setGeoImages=DS,i.setIssue=xf,i.setIssueAssociation=JS,i.setIssueAssociations=YS,i.setIssueAttachment=pf,i.setIssueAttachments=yf,i.setIssueComment=Cf,i.setIssueCommentAttachment=Rf,i.setIssueCommentAttachments=bf,i.setIssueComments=Uf,i.setIssueType=sP,i.setIssueTypeAttachment=pA,i.setIssueTypeAttachments=yA,i.setIssueTypeFieldValues=CA,i.setIssueTypeFieldValuesAttachment=yw,i.setIssueTypeFieldValuesAttachments=mw,i.setIssueTypeFieldValuesMany=UA,i.setIssueTypeFields=tw,i.setIssueTypeFieldsAttachment=RA,i.setIssueTypeFieldsAttachments=bA,i.setIssueTypeFieldsMany=sw,i.setIssueTypeIdentifier=bw,i.setIssueTypeIdentifierValue=Uw,i.setIssueTypeIdentifierValues=Lw,i.setIssueTypeIdentifiers=Mw,i.setIssueTypeStatus=SP,i.setIssueTypeStatuses=fP,i.setIssueTypes=iP,i.setIssueUpdate=RP,i.setIssueUpdates=bP,i.setIssues=eA,i.setLoggedIn=xp,i.setOrganization=lO,i.setOrganizationAccess=QP,i.setOrganizationAccesses=ZP,i.setOrganizations=dO,i.setProcedure=kT,i.setProcedureFieldValues=Yg,i.setProcedureFieldValuesAttachment=Bg,i.setProcedureFieldValuesAttachments=Dg,i.setProcedureFieldValuesMany=Jg,i.setProcedureStep=k_,i.setProcedureStepAssignee=GT,i.setProcedureStepAssignees=KT,i.setProcedureStepComment=cI,i.setProcedureStepComments=rI,i.setProcedureStepDefaultAssignee=PI,i.setProcedureStepDefaultAssignees=OI,i.setProcedureStepDefaultReviewer=BI,i.setProcedureStepDefaultReviewers=DI,i.setProcedureStepEvent=YI,i.setProcedureStepEvents=JI,i.setProcedureStepFieldValues=KF,i.setProcedureStepFieldValuesAttachment=VF,i.setProcedureStepFieldValuesAttachments=BF,i.setProcedureStepFieldValuesMany=YF,i.setProcedureStepFieldValuesReview=c_,i.setProcedureStepFieldValuesReviews=r_,i.setProcedureStepFields=OF,i.setProcedureStepFieldsAttachment=rF,i.setProcedureStepFieldsAttachments=dF,i.setProcedureStepFieldsMany=TF,i.setProcedureStepReviewer=P_,i.setProcedureStepReviewers=O_,i.setProcedureSteps=V_,i.setProcedureType=dR,i.setProcedureTypeAttachment=K_,i.setProcedureTypeAttachments=Y_,i.setProcedureTypeFields=Og,i.setProcedureTypeFieldsAttachment=rg,i.setProcedureTypeFieldsAttachments=dg,i.setProcedureTypeFieldsMany=Tg,i.setProcedureTypes=lR,i.setProcedures=VT,i.setProject=AT,i.setProjectAccess=EO,i.setProjectAccesses=kO,i.setProjectAttachment=NO,i.setProjectAttachments=HO,i.setProjectFile=sT,i.setProjectFiles=iT,i.setProjects=fT,i.setRehydrated=fD,i.setTeam=zR,i.setTeamMembership=IR,i.setTeamMemberships=FR,i.setTeams=qR,i.setTokens=HV,i.setUploadUrl=eB,i.setUser=qP,i.setUsers=zP,i.setWorkflow=xR,i.setWorkflowIssueLink=hb,i.setWorkflowIssueLinks=pb,i.setWorkflowStep=vE,i.setWorkflowStepAssignee=bb,i.setWorkflowStepAssignees=Mb,i.setWorkflowStepComment=Ub,i.setWorkflowStepComments=Lb,i.setWorkflowStepDefaultAssignee=sM,i.setWorkflowStepDefaultAssignees=iM,i.setWorkflowStepDefaultReviewer=SM,i.setWorkflowStepDefaultReviewers=fM,i.setWorkflowStepEvent=vM,i.setWorkflowStepEvents=EM,i.setWorkflowStepFieldValues=vv,i.setWorkflowStepFieldValuesAttachment=Sv,i.setWorkflowStepFieldValuesAttachments=fv,i.setWorkflowStepFieldValuesMany=Ev,i.setWorkflowStepFieldValuesReview=sE,i.setWorkflowStepFieldValuesReviewRequest=Lv,i.setWorkflowStepFieldValuesReviewRequests=Nv,i.setWorkflowStepFieldValuesReviews=iE,i.setWorkflowStepFields=iv,i.setWorkflowStepFieldsAttachment=LM,i.setWorkflowStepFieldsAttachments=NM,i.setWorkflowStepFieldsMany=nv,i.setWorkflowStepReviewer=SE,i.setWorkflowStepReviewers=fE,i.setWorkflowSteps=EE,i.setWorkflowType=NE,i.setWorkflowTypes=HE,i.setWorkflows=eb,i.shallowEqual=Ck,i.slugify=sV,i.spacesToDashesLower=tV,i.teamMembershipReducer=MR,i.teamMembershipSlice=Sc,i.teamReducer=GR,i.teamSlice=fc,i.toFileNameSafeString=eV,i.toUuidArray=v,i.toUuidIdRecord=xk,i.truncate=iV,i.updateAsset=Zu,i.updateAssetAttachment=qr,i.updateAssetAttachments=jr,i.updateAssetProcedure=ul,i.updateAssetProcedureStep=$u,i.updateAssetProcedureStepFieldValues=gu,i.updateAssetProcedureStepFieldValuesAttachment=hu,i.updateAssetProcedureStepFieldValuesAttachments=pu,i.updateAssetProcedureStepFieldValuesMany=Ru,i.updateAssetProcedureStepFields=eu,i.updateAssetProcedureStepFieldsAttachment=$l,i.updateAssetProcedureStepFieldsAttachments=Cl,i.updateAssetProcedureStepFieldsMany=tu,i.updateAssetProcedureSteps=Cu,i.updateAssetProcedureType=Fl,i.updateAssetProcedureTypeAttachment=Xr,i.updateAssetProcedureTypeAttachments=xr,i.updateAssetProcedureTypeFieldValues=xd,i.updateAssetProcedureTypeFieldValuesAttachment=jd,i.updateAssetProcedureTypeFieldValuesAttachments=$d,i.updateAssetProcedureTypeFieldValuesMany=el,i.updateAssetProcedureTypeFields=gd,i.updateAssetProcedureTypeFieldsAttachment=hd,i.updateAssetProcedureTypeFieldsAttachments=pd,i.updateAssetProcedureTypeFieldsMany=Rd,i.updateAssetProcedureTypes=_l,i.updateAssetProcedures=ol,i.updateAssetStage=Mo,i.updateAssetStageCompletion=yo,i.updateAssetStageCompletions=mo,i.updateAssetStages=vo,i.updateAssetType=vp,i.updateAssetTypeAttachment=Co,i.updateAssetTypeAttachments=Uo,i.updateAssetTypeFieldValues=Uh,i.updateAssetTypeFieldValuesAttachment=bh,i.updateAssetTypeFieldValuesAttachments=Mh,i.updateAssetTypeFieldValuesMany=Lh,i.updateAssetTypeFields=mh,i.updateAssetTypeFieldsAttachment=th,i.updateAssetTypeFieldsAttachments=sh,i.updateAssetTypeFieldsMany=Sh,i.updateAssetTypeIdentifier=sp,i.updateAssetTypeIdentifierValue=Sp,i.updateAssetTypeIdentifierValues=fp,i.updateAssetTypeIdentifiers=ip,i.updateAssetTypeStatus=Np,i.updateAssetTypeStatuses=Hp,i.updateAssetTypes=Ep,i.updateAssets=Xu,i.updateConversation=Er,i.updateConversations=uV,i.updateDocument=Oy,i.updateDocumentAttachment=ry,i.updateDocumentAttachments=dy,i.updateDocuments=Ty,i.updateEmailDomain=Dy,i.updateEmailDomains=Wy,i.updateForm=xm,i.updateFormIdentifier=Xy,i.updateFormIdentifierValue=hm,i.updateFormIdentifierValues=pm,i.updateFormIdentifiers=xy,i.updateFormRevision=jm,i.updateFormRevisionAttachment=gm,i.updateFormRevisionAttachments=Rm,i.updateFormRevisions=$m,i.updateFormSubmission=FS,i.updateFormSubmissionAttachment=hS,i.updateFormSubmissionAttachments=pS,i.updateFormSubmissions=_S,i.updateForms=eS,i.updateGeoImage=qS,i.updateGeoImages=jS,i.updateIssue=tA,i.updateIssueAssociation=QS,i.updateIssueAssociations=ZS,i.updateIssueAttachment=mf,i.updateIssueAttachments=Sf,i.updateIssueComment=Lf,i.updateIssueCommentAttachment=Mf,i.updateIssueCommentAttachments=vf,i.updateIssueComments=Nf,i.updateIssueType=nP,i.updateIssueTypeAttachment=mA,i.updateIssueTypeAttachments=SA,i.updateIssueTypeFieldValues=LA,i.updateIssueTypeFieldValuesAttachment=Sw,i.updateIssueTypeFieldValuesAttachments=fw,i.updateIssueTypeFieldValuesMany=NA,i.updateIssueTypeFields=iw,i.updateIssueTypeFieldsAttachment=MA,i.updateIssueTypeFieldsAttachments=vA,i.updateIssueTypeFieldsMany=nw,i.updateIssueTypeIdentifier=vw,i.updateIssueTypeIdentifierValue=Nw,i.updateIssueTypeIdentifierValues=Hw,i.updateIssueTypeIdentifiers=Ew,i.updateIssueTypeStatus=AP,i.updateIssueTypeStatuses=wP,i.updateIssueTypes=aP,i.updateIssueUpdate=MP,i.updateIssueUpdates=vP,i.updateIssues=sA,i.updateOrganization=pO,i.updateOrganizationAccess=XP,i.updateOrganizationAccesses=xP,i.updateOrganizations=hO,i.updateProcedure=BT,i.updateProcedureFieldValues=Qg,i.updateProcedureFieldValuesAttachment=Wg,i.updateProcedureFieldValuesAttachments=zg,i.updateProcedureFieldValuesMany=Zg,i.updateProcedureStep=W_,i.updateProcedureStepAssignee=YT,i.updateProcedureStepAssignees=JT,i.updateProcedureStepComment=dI,i.updateProcedureStepComments=lI,i.updateProcedureStepDefaultAssignee=TI,i.updateProcedureStepDefaultAssignees=II,i.updateProcedureStepDefaultReviewer=WI,i.updateProcedureStepDefaultReviewers=zI,i.updateProcedureStepEvent=QI,i.updateProcedureStepEvents=ZI,i.updateProcedureStepFieldValues=JF,i.updateProcedureStepFieldValuesAttachment=DF,i.updateProcedureStepFieldValuesAttachments=WF,i.updateProcedureStepFieldValuesMany=QF,i.updateProcedureStepFieldValuesReview=d_,i.updateProcedureStepFieldValuesReviews=l_,i.updateProcedureStepFields=IF,i.updateProcedureStepFieldsAttachment=lF,i.updateProcedureStepFieldsAttachments=uF,i.updateProcedureStepFieldsMany=FF,i.updateProcedureStepReviewer=T_,i.updateProcedureStepReviewers=I_,i.updateProcedureSteps=z_,i.updateProcedureType=uR,i.updateProcedureTypeAttachment=J_,i.updateProcedureTypeAttachments=Q_,i.updateProcedureTypeFields=Ig,i.updateProcedureTypeFieldsAttachment=lg,i.updateProcedureTypeFieldsAttachments=ug,i.updateProcedureTypeFieldsMany=Fg,i.updateProcedureTypes=oR,i.updateProcedures=DT,i.updateProject=TT,i.updateProjectAccess=VO,i.updateProjectAccesses=BO,i.updateProjectAttachment=GO,i.updateProjectAttachments=KO,i.updateProjectFile=cT,i.updateProjectFiles=rT,i.updateProjects=OT,i.updateTeam=jR,i.updateTeamMembership=_R,i.updateTeamMemberships=gR,i.updateTeams=$R,i.updateUser=CP,i.updateUsers=$P,i.updateWorkflow=tb,i.updateWorkflowIssueLink=yb,i.updateWorkflowIssueLinks=mb,i.updateWorkflowStep=kE,i.updateWorkflowStepAssignee=vb,i.updateWorkflowStepAssignees=Eb,i.updateWorkflowStepComment=Nb,i.updateWorkflowStepComments=Hb,i.updateWorkflowStepDefaultAssignee=nM,i.updateWorkflowStepDefaultAssignees=aM,i.updateWorkflowStepDefaultReviewer=AM,i.updateWorkflowStepDefaultReviewers=wM,i.updateWorkflowStepEvent=kM,i.updateWorkflowStepEvents=VM,i.updateWorkflowStepFieldValues=kv,i.updateWorkflowStepFieldValuesAttachment=Av,i.updateWorkflowStepFieldValuesAttachments=wv,i.updateWorkflowStepFieldValuesMany=Vv,i.updateWorkflowStepFieldValuesReview=nE,i.updateWorkflowStepFieldValuesReviewRequest=Hv,i.updateWorkflowStepFieldValuesReviewRequests=Gv,i.updateWorkflowStepFieldValuesReviews=aE,i.updateWorkflowStepFields=av,i.updateWorkflowStepFieldsAttachment=HM,i.updateWorkflowStepFieldsAttachments=GM,i.updateWorkflowStepFieldsMany=cv,i.updateWorkflowStepReviewer=AE,i.updateWorkflowStepReviewers=wE,i.updateWorkflowSteps=VE,i.updateWorkflowType=GE,i.updateWorkflowTypes=KE,i.updateWorkflows=sb,i.useSelectorBuilder=$k,i.userReducer=LP,i.userSlice=ma,i.uuidObj=O,i.uuidObjSortFn=Xs,i.uuidSortFn=Ps,i.versioningReducer=YR,i.versioningSlice=KR,i.workflowIssueLinkReducer=Ib,i.workflowIssueLinkSlice=Pc,i.workflowReducer=db,i.workflowSlice=wc,i.workflowStepAssigneeReducer=zb,i.workflowStepAssigneeSlice=Oc,i.workflowStepCommentReducer=Zb,i.workflowStepCommentSlice=Tc,i.workflowStepDefaultAssigneeReducer=oM,i.workflowStepDefaultAssigneeSlice=Ic,i.workflowStepDefaultReviewerReducer=_M,i.workflowStepDefaultReviewerSlice=_c,i.workflowStepEventReducer=jM,i.workflowStepEventSlice=Rc,i.workflowStepFieldValuesAttachmentReducer=_v,i.workflowStepFieldValuesAttachmentSlice=Vc,i.workflowStepFieldValuesReducer=jv,i.workflowStepFieldValuesReviewReducer=oE,i.workflowStepFieldValuesReviewRequestReducer=Xv,i.workflowStepFieldValuesReviewRequestSlice=qc,i.workflowStepFieldValuesReviewSlice=Cc,i.workflowStepFieldValuesSlice=zc,i.workflowStepFieldsAttachmentReducer=XM,i.workflowStepFieldsAttachmentSlice=bc,i.workflowStepFieldsReducer=hv,i.workflowStepFieldsSlice=kc,i.workflowStepReducer=jE,i.workflowStepReviewerReducer=_E,i.workflowStepReviewerSlice=Nc,i.workflowStepSlice=Hc,i.workflowTypeReducer=xE,i.workflowTypeSlice=Kc,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});