@overmap-ai/core 1.0.78-gcs.1 → 1.0.78-gcs.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3386,8 +3386,8 @@ function LS(t, s, e = 0) {
3386
3386
  t,
3387
3387
  `(${typeof t})`,
3388
3388
  `
3389
- Action:`,
3390
- s,
3389
+ Url:`,
3390
+ s.payload.url,
3391
3391
  `
3392
3392
  Retries:`,
3393
3393
  e
@@ -3407,7 +3407,7 @@ Retries:`,
3407
3407
  const p = s.meta.offline.rollback;
3408
3408
  throw p && (console.warn("Rolling back request due to SDK error:", s), i.dispatch(p)), t;
3409
3409
  }
3410
- if (t instanceof U && t.options.discard && (console.debug("Discarding request due to explicit discard:", s), o()), a.includes(r) && (console.debug("Discarding request due to deletion:", s), o()), t instanceof U) {
3410
+ if (t instanceof U && t.options.discard && (console.debug("Discarding request due to explicit discard:", s.payload.url), o()), a.includes(r) && (console.debug("Discarding request due to deletion:", s.payload.url), o()), t instanceof U) {
3411
3411
  const u = t.status || ((c = t.response) == null ? void 0 : c.status);
3412
3412
  if (u || console.warn("Error has no status code:", t), u !== void 0 && Ka.includes(u)) {
3413
3413
  console.warn("Discarding request due to error:", t, `
@@ -9338,7 +9338,7 @@ async function ec(t, s, e, i, n) {
9338
9338
  }[u];
9339
9339
  let z = j();
9340
9340
  if (n == null || n.addEventListener("abort", () => {
9341
- console.debug("aborting request:", s), z.abort();
9341
+ console.debug("aborting request:", s.url), z.abort();
9342
9342
  }), O && a) {
9343
9343
  const B = i.auth.getAuthHeader();
9344
9344
  z = z.set("Authorization", B);
@@ -9494,8 +9494,8 @@ class tt {
9494
9494
  if (this.graph.addNode(s.payload.uuid, s), !(s.payload.blockers.length === 0 || this.graph.size() === 1))
9495
9495
  for (const e of this.graph.overallOrder()) {
9496
9496
  if (e === s.payload.uuid) continue;
9497
- const i = this.graph.getNodeData(e);
9498
- s.payload.blockers.some((n) => i.payload.blocks.includes(n)) && this._addDependency(s.payload.uuid, e);
9497
+ const i = this.graph.getNodeData(e), n = new Set(i.payload.blocks);
9498
+ s.payload.blockers.some((a) => n.has(a)) && this._addDependency(s.payload.uuid, e);
9499
9499
  }
9500
9500
  }
9501
9501
  /**
@@ -9509,7 +9509,8 @@ class tt {
9509
9509
  this.graph.addNode(s.payload.uuid, s);
9510
9510
  for (const e of this.graph.overallOrder()) {
9511
9511
  if (e === s.payload.uuid) continue;
9512
- this.graph.getNodeData(e).payload.blockers.some((n) => s.payload.blocks.includes(n)) && this._addDependency(e, s.payload.uuid);
9512
+ const i = this.graph.getNodeData(e), n = new Set(s.payload.blocks);
9513
+ i.payload.blockers.some((a) => n.has(a)) && this._addDependency(e, s.payload.uuid);
9513
9514
  }
9514
9515
  }
9515
9516
  /**
@@ -9640,7 +9641,7 @@ class ic {
9640
9641
  if (this.next)
9641
9642
  return this.next.run(s);
9642
9643
  {
9643
- if (console.debug("Middleware finished. Performing request:", s), !it()) throw new Error("Client store not set");
9644
+ if (console.debug("Middleware finished. Performing request:", s.payload.url), !it()) throw new Error("Client store not set");
9644
9645
  const i = tI();
9645
9646
  if (!i) throw new Error("Client SDK not set");
9646
9647
  return CS(s, i);
@@ -1,7 +1,7 @@
1
1
  (function(i,L){typeof exports=="object"&&typeof module<"u"?L(exports,require("@redux-offline/redux-offline/lib/types"),require("@reduxjs/toolkit"),require("superagent"),require("uuid"),require("react"),require("file-saver"),require("fast-tree-builder"),require("ts-tree-lib"),require("@redux-offline/redux-offline"),require("@redux-offline/redux-offline/lib/defaults"),require("localforage"),require("redux-persist-migrate"),require("buffer"),require("@overmap-ai/forms"),require("idb"),require("jwt-decode"),require("dependency-graph"),require("@tiptap/core")):typeof define=="function"&&define.amd?define(["exports","@redux-offline/redux-offline/lib/types","@reduxjs/toolkit","superagent","uuid","react","file-saver","fast-tree-builder","ts-tree-lib","@redux-offline/redux-offline","@redux-offline/redux-offline/lib/defaults","localforage","redux-persist-migrate","buffer","@overmap-ai/forms","idb","jwt-decode","dependency-graph","@tiptap/core"],L):(i=typeof globalThis<"u"?globalThis:i||self,L(i["overmap-core"]={},null,i.toolkit,i.request,i.uuid,i.react,i.fileSaver,i.buildTree,i.tsTreeLib,i.reduxOffline,i.offlineConfig,i.localforage,i.createMigration,null,null,i.idb,i.jwtDecode,i.dependencyGraph))})(this,function(i,L,o,Qe,xe,_I,MI,En,ot,RI,Vn,wI,vI,Ag,fg,EI,VI,zI){"use strict";var yg=Object.defineProperty;var pg=(i,L,o)=>L in i?yg(i,L,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[L]=o;var y=(i,L,o)=>pg(i,typeof L!="symbol"?L+"":L,o);var gI;const zn=Object.freeze([]),Bn=Object.freeze({});var jn=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))(jn||{}),m=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(m||{}),qn=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(qn||{}),Dt=(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))(Dt||{}),$t=(t=>(t[t.BACKLOG=0]="BACKLOG",t[t.SELECTED=2]="SELECTED",t[t.DONE=4]="DONE",t))($t||{}),$=(t=>(t.STATUS="status",t.PRIORITY="priority",t.CATEGORY="category",t.DESCRIPTION="description",t.TITLE="title",t.ASSIGNED_TO="assigned_to",t.DUE_DATE="due_date",t))($||{});const BI=$t.BACKLOG,jI=Dt.MEDIUM,Cn=6e4;function R(t){return{addOne:(h,p)=>{const A=t(p.payload);h.instances[A]=p.payload},addMany:(h,p)=>{for(const A of p.payload){const f=t(A);h.instances[f]=A}},setOne:(h,p)=>{const A=t(p.payload);h.instances[A]=p.payload},setMany:(h,p)=>{for(const A of p.payload){const f=t(A);h.instances[f]=A}},updateOne:(h,p)=>{const A=t(p.payload);h.instances[A]=p.payload},updateMany:(h,p)=>{for(const A of p.payload){const f=t(A);h.instances[f]=A}},deleteOne:(h,p)=>{delete h.instances[p.payload]},deleteMany:(h,p)=>{for(const A of p.payload)delete h.instances[A]},initialize:(h,p)=>{h.instances={};const A=new Set;for(const f of p.payload){const I=t(f);A.add(I),h.instances[I]=f}A.size!==p.payload.length&&console.warn("duplicate ids detected when initializing model instances.")}}}function qI(){return{initializeSelection:(u,d)=>{u.selection=Array.from(new Set(d.payload))},selectOne:(u,d)=>{new Set(u.selection).has(d.payload)||u.selection.push(d.payload)},selectMany:(u,d)=>{const h=new Set(u.selection);for(const p of d.payload)h.has(p)||h.add(p);u.selection=Array.from(h)},unselectOne:(u,d)=>{const h=new Set(u.selection);h.has(d.payload)&&(h.delete(d.payload),u.selection=Array.from(h))},unselectMany:(u,d)=>{const h=new Set(u.selection);for(const p of d.payload)h.has(p)&&h.delete(p);u.selection=Array.from(h)},toggleOne:(u,d)=>{const h=new Set(u.selection);h.has(d.payload)?h.delete(d.payload):h.add(d.payload),u.selection=Array.from(h)},toggleMany:(u,d)=>{const h=new Set(u.selection);for(const p of d.payload)h.has(p)?h.delete(p):h.add(p);u.selection=Array.from(h)},getInitialState:u=>({...u,selection:[]})}}const nt="versioning",_=o.createAction("RESET"),C=o.createAction("RESET_PROJECT_STATE"),w=o.createAction("RESET_ORGANIZATION_STATE");function CI(t,s){return _I.useMemo(t,s)}gI=Symbol.toStringTag;class Ut{constructor(){y(this,gI,"Promise");y(this,"_promise");y(this,"_resolve");y(this,"_reject");y(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 Lt=!1;["true","1"].includes("".toLowerCase())&&(Lt=!0);function DI(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 kt(t){const s={};return function(){const e=Array.prototype.slice.call(arguments);return e in s?(Lt&&console.debug(`Memoization debug: Using memorized return value for ${t.toString()}(`,e,")"),s[e]):(Lt&&console.debug(`Memoization debug: Cache miss! Memoizing ${t.toString()}(`,e,")"),s[e]=t.apply(this,e))}}function $I(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 T=t=>t.length===0?zn:t,ht=t=>Object.keys(t).length===0?Bn:t,Dn=kt(t=>{if(!t)return"";const s=new Date(t),e=s.getFullYear()===Nt.getFullYear(),n={day:"numeric",month:"short"};return e||(n.year="numeric"),s.toLocaleDateString([],n)}),UI=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),LI=1e3*86400,Nt=new Date,kI=t=>new Date(t).toDateString()===Nt.toDateString(),NI=kt((t,s,e)=>{const n=Math.round((new Date(t).getTime()-Nt.getTime())/LI);return n<s||n>e?Dn(t):UI.format(n,"days")});function GI(t){return new Uint8Array(t).reduce((e,n)=>e+n.toString(16).padStart(2,"0"),"")}const Gt=async(t,s)=>{s||(s=await et(t));let e=t.type;if(e.includes("/")&&(e=e.split("/")[1]),!e)throw new Error(`Could not extract file type from ${t.type}`);return`${s}.${e}`};function et(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=GI(c);s(r)})},n.readAsArrayBuffer(t)})}function HI(t){if(!t.name||!t.type||!t.size){const s="File has no name, type, and/or size";throw new Error(s)}return`${t.name}&${t.type}${t.size}`}function $n(t,s){return new File([t],s,{type:t.type})}function WI(t,s){const e=document.createElement("a");e.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(s)),e.setAttribute("download",t),e.style.display="none",document.body.appendChild(e),e.click(),document.body.removeChild(e)}const KI=async t=>{const s={};for(const e of t){const n=await et(e);s[n]={sha1:n,extension:e.name.split(".").pop()||"",file_type:e.type,size:e.size}}return Object.values(s)},Un=async t=>(await fetch(t)).blob(),YI=t=>new Promise((s,e)=>{const n=new FileReader;n.onloadend=()=>{var a;s(((a=n.result)==null?void 0:a.toString())||"")},n.readAsDataURL(t)});function ZI(t){const s=new Blob([t]);MI.saveAs(s,t.name)}const Ln={};function JI(t,s,e,...n){const a=Ln[t];let c=!1;a?a[s]||(a[s]=!0,c=!0):(Ln[t]={[s]:!0},c=!0),c&&console[e](...n)}const kn=["created_at","updated_at","index","revision"];function M(t){return{...t,uuid:xe.v4()}}function XI(t){const s={};for(const e of t)s[e.uuid]=e;return s}function D(t){return t.map(({uuid:s})=>s)}function Nn(t,s){return t.localeCompare(s)}function QI(t,s){return Nn(t.uuid,s.uuid)}function xI(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 eO(t){return t.toLowerCase().replace(" ","-")}function tO(t,s=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,s?"_":"-")}function sO(t,s){if(t.length<=s)return t;const e=t.slice(0,s-1);return e.slice(0,e.lastIndexOf(" "))+"…"}const iO=/^.+@.+\..+$/;function z(t){const s={...t};for(const e of[...kn,"created_by"])e in s&&delete s[e];return s}const Gn=t=>{const s=t.toSorted((e,n)=>e.order-n.order);return En(s,{id:e=>e.uuid,parentId:e=>e.parent,includeEmptyChildrenArray:!0,valueKey:!1})},nO=t=>{const{roots:s}=Gn(t);return s.map(e=>new ot.Tree(e))},Hn=(t,s)=>{const{nodes:e}=Gn(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in asset procedure step tree.`);return new ot.Tree(n)},Wn=t=>En(t,{id:s=>s.uuid,parentId:s=>s.parent_document,includeEmptyChildrenArray:!0,valueKey:!1}),aO=t=>{const{roots:s}=Wn(t);return s.map(e=>new ot.Tree(e))},Kn=(t,s)=>{const{nodes:e}=Wn(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in document tree.`);return new ot.Tree(n)};class cO{constructor(s){y(this,"operations",[]);y(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=>T(this.performOperations(s)))}}const S=t=>(...s)=>e=>t(e,...s),k=R(t=>t.uuid),Yn={instances:{}},Ht=o.createSlice({name:"agents",initialState:Yn,extraReducers:t=>t.addMatcher(o.isAnyOf(_,C,w),s=>Object.assign(s,Yn)),reducers:{initializeConversations:k.initialize,addConversation:k.addOne,addConversations:k.addMany,setConversation:k.setOne,setConversations:k.setMany,updateConversation:k.updateOne,updateConversations:k.updateMany,deleteConversation:k.deleteOne,deleteConversations:k.deleteMany}}),{initializeConversations:Zn,addConversation:Jn,addConversations:dO,setConversation:Xn,setConversations:rO,updateConversation:Qn,updateConversations:uO,deleteConversation:lO,deleteConversations:oO}=Ht.actions,Wt=t=>t.agentsReducer.instances,hO=o.createSelector([Wt],t=>Object.values(t)),mO=S(o.createSelector([Wt,(t,s)=>s],(t,s)=>t[s])),xn=Ht.reducer,N=R(t=>t.uuid),ea={instances:{}},Kt=o.createSlice({name:"assetAttachments",initialState:ea,extraReducers:t=>t.addMatcher(o.isAnyOf(_,C,w),s=>Object.assign(s,ea)),reducers:{initializeAssetAttachments:N.initialize,addAssetAttachment:N.addOne,addAssetAttachments:N.addMany,setAssetAttachment:N.setOne,setAssetAttachments:N.setMany,updateAssetAttachment:N.updateOne,updateAssetAttachments:N.updateMany,deleteAssetAttachment:N.deleteOne,deleteAssetAttachments:N.deleteMany}}),{initializeAssetAttachments:ta,addAssetAttachment:sa,addAssetAttachments:Yt,setAssetAttachment:ia,setAssetAttachments:na,updateAssetAttachment:aa,updateAssetAttachments:ca,deleteAssetAttachment:da,deleteAssetAttachments:Zt}=Kt.actions,ra=t=>t.assetAttachmentReducer.instances,Jt=o.createSelector([ra],t=>Object.values(t)),ua=t=>s=>s.assetAttachmentReducer.instances[t],la=S(o.createSelector([Jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),oa=S(o.createSelector([Jt,(t,s)=>s],(t,s)=>T(t.filter(({asset:e})=>s===e)))),ha=Kt.reducer,G=R(({uuid:t})=>t),ma={instances:{}},Xt=o.createSlice({name:"assetProcedureTypeAttachments",initialState:ma,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,ma)),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:ya,addAssetProcedureTypeAttachment:pa,addAssetProcedureTypeAttachments:Aa,setAssetProcedureTypeAttachment:fa,setAssetProcedureTypeAttachments:Sa,updateAssetProcedureTypeAttachment:Ta,updateAssetProcedureTypeAttachments:Ia,deleteAssetProcedureTypeAttachment:Oa,deleteAssetProcedureTypeAttachments:Pa}=Xt.actions,Fa=Xt.reducer,ga=t=>t.assetProcedureTypeAttachmentReducer.instances,Qt=o.createSelector([ga],t=>Object.values(t)),ba=t=>s=>s.assetProcedureTypeAttachmentReducer.instances[t],_a=S(o.createSelector([Qt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),yO=S(o.createSelector([Qt,(t,s)=>s],(t,s)=>T(t.filter(({asset_procedure_type:e})=>s===e)))),H=R(({uuid:t})=>t),Ma={instances:{}},xt=o.createSlice({name:"assetProcedureTypeFieldsAttachments",initialState:Ma,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,Ma)),reducers:{initializeAssetProcedureTypeFieldsAttachments:H.initialize,addAssetProcedureTypeFieldsAttachment:H.addOne,addAssetProcedureTypeFieldsAttachments:H.addMany,setAssetProcedureTypeFieldsAttachment:H.setOne,setAssetProcedureTypeFieldsAttachments:H.setMany,updateAssetProcedureTypeFieldsAttachment:H.updateOne,updateAssetProcedureTypeFieldsAttachments:H.updateMany,deleteAssetProcedureTypeFieldsAttachment:H.deleteOne,deleteAssetProcedureTypeFieldsAttachments:H.deleteMany}}),{initializeAssetProcedureTypeFieldsAttachments:Ra,addAssetProcedureTypeFieldsAttachment:wa,addAssetProcedureTypeFieldsAttachments:va,setAssetProcedureTypeFieldsAttachment:Ea,setAssetProcedureTypeFieldsAttachments:Va,updateAssetProcedureTypeFieldsAttachment:za,updateAssetProcedureTypeFieldsAttachments:Ba,deleteAssetProcedureTypeFieldsAttachment:ja,deleteAssetProcedureTypeFieldsAttachments:qa}=xt.actions,Ca=xt.reducer,Da=t=>t.assetProcedureTypeFieldsAttachmentReducer.instances,es=o.createSelector([Da],t=>Object.values(t)),pO=S(o.createSelector([es,(t,s)=>s],(t,s)=>T(t.filter(e=>e.fields_revision===s)))),$a=t=>s=>s.assetProcedureTypeFieldsAttachmentReducer.instances[t],Ua=S(o.createSelector([es,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),W=R(({uuid:t})=>t),La={instances:{}},ts=o.createSlice({name:"assetProcedureTypeFields",initialState:La,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,La)),reducers:{initializeAssetProcedureTypeFields:W.initialize,addAssetProcedureTypeFields:W.addOne,addAssetProcedureTypeFieldsMany:W.addMany,setAssetProcedureTypeFields:W.setOne,setAssetProcedureTypeFieldsMany:W.setMany,updateAssetProcedureTypeFields:W.updateOne,updateAssetProcedureTypeFieldsMany:W.updateMany,deleteAssetProcedureTypeFields:W.deleteOne,deleteAssetProcedureTypeFieldsMany:W.deleteMany}}),{initializeAssetProcedureTypeFields:ka,addAssetProcedureTypeFields:Na,addAssetProcedureTypeFieldsMany:Ga,setAssetProcedureTypeFields:Ha,setAssetProcedureTypeFieldsMany:Wa,updateAssetProcedureTypeFields:Ka,updateAssetProcedureTypeFieldsMany:Ya,deleteAssetProcedureTypeFields:Za,deleteAssetProcedureTypeFieldsMany:Ja}=ts.actions,Xa=ts.reducer,Qa=t=>t.assetProcedureTypeFieldsReducer.instances,mt=o.createSelector([Qa],t=>Object.values(t)),AO=S(o.createSelector([mt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_procedure_type===s)))),fO=S(o.createSelector([mt,(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])),xa=t=>s=>s.assetProcedureTypeFieldsReducer.instances[t],ec=S(o.createSelector([mt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),K=R(({uuid:t})=>t),tc={instances:{}},ss=o.createSlice({name:"assetProcedureTypeFieldValuesAttachments",initialState:tc,extraReducers:t=>t.addMatcher(o.isAnyOf(_,C,w),s=>Object.assign(s,tc)),reducers:{initializeAssetProcedureTypeFieldValuesAttachments:K.initialize,addAssetProcedureTypeFieldValuesAttachment:K.addOne,addAssetProcedureTypeFieldValuesAttachments:K.addMany,setAssetProcedureTypeFieldValuesAttachment:K.setOne,setAssetProcedureTypeFieldValuesAttachments:K.setMany,updateAssetProcedureTypeFieldValuesAttachment:K.updateOne,updateAssetProcedureTypeFieldValuesAttachments:K.updateMany,deleteAssetProcedureTypeFieldValuesAttachment:K.deleteOne,deleteAssetProcedureTypeFieldValuesAttachments:K.deleteMany}}),{initializeAssetProcedureTypeFieldValuesAttachments:sc,addAssetProcedureTypeFieldValuesAttachment:ic,addAssetProcedureTypeFieldValuesAttachments:is,setAssetProcedureTypeFieldValuesAttachment:nc,setAssetProcedureTypeFieldValuesAttachments:ac,updateAssetProcedureTypeFieldValuesAttachment:cc,updateAssetProcedureTypeFieldValuesAttachments:dc,deleteAssetProcedureTypeFieldValuesAttachment:rc,deleteAssetProcedureTypeFieldValuesAttachments:ns}=ss.actions,uc=ss.reducer,lc=t=>t.assetProcedureTypeFieldValuesAttachmentReducer.instances,as=o.createSelector([lc],t=>Object.values(t)),oc=t=>s=>s.assetProcedureTypeFieldValuesAttachmentReducer.instances[t],hc=S(o.createSelector([as,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),mc=S(o.createSelector([as,(t,s)=>s],(t,s)=>T(t.filter(e=>e.field_values===s)))),Y=R(({uuid:t})=>t),yc={instances:{}},cs=o.createSlice({name:"assetProcedureTypeFieldValues",initialState:yc,extraReducers:t=>t.addMatcher(o.isAnyOf(_,C,w),s=>Object.assign(s,yc)),reducers:{initializeAssetProcedureTypeFieldValues:Y.initialize,addAssetProcedureTypeFieldValues:Y.addOne,addAssetProcedureTypeFieldValuesMany:Y.addMany,setAssetProcedureTypeFieldValues:Y.setOne,setAssetProcedureTypeFieldValuesMany:Y.setMany,updateAssetProcedureTypeFieldValues:Y.updateOne,updateAssetProcedureTypeFieldValuesMany:Y.updateMany,deleteAssetProcedureTypeFieldValues:Y.deleteOne,deleteAssetProcedureTypeFieldValuesMany:Y.deleteMany}}),{initializeAssetProcedureTypeFieldValues:pc,addAssetProcedureTypeFieldValues:Ac,addAssetProcedureTypeFieldValuesMany:fc,setAssetProcedureTypeFieldValues:Sc,setAssetProcedureTypeFieldValuesMany:Tc,updateAssetProcedureTypeFieldValues:Ic,updateAssetProcedureTypeFieldValuesMany:Oc,deleteAssetProcedureTypeFieldValues:Pc,deleteAssetProcedureTypeFieldValuesMany:Fc}=cs.actions,gc=cs.reducer,bc=t=>t.assetProcedureTypeFieldValuesReducer.instances,yt=o.createSelector([bc],t=>Object.values(t)),SO=S(o.createSelector([yt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset===s)))),TO=S(o.createSelector([yt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_procedure===s)))),_c=t=>s=>s.assetProcedureTypeFieldValuesReducer.instances[t],Mc=S(o.createSelector([yt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Z=R(({uuid:t})=>t),Rc={instances:{}},ds=o.createSlice({name:"assetProcedures",initialState:Rc,extraReducers:t=>t.addMatcher(o.isAnyOf(_,C,w),s=>Object.assign(s,Rc)),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:wc,addAssetProcedure:vc,addAssetProcedures:rs,updateAssetProcedure:Ec,updateAssetProcedures:Vc,deleteAssetProcedure:zc,deleteAssetProcedures:us,setAssetProcedure:Bc,setAssetProcedures:jc}=ds.actions,qc=ds.reducer,Cc=t=>t.assetProcedureReducer.instances,pt=o.createSelector([Cc],t=>Object.values(t)),Dc=S(o.createSelector([pt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_procedure_type===s)))),IO=S(o.createSelector([pt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_type===s)))),$c=t=>s=>s.assetProcedureReducer.instances[t],Uc=S(o.createSelector([pt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),J=R(t=>t.uuid),Lc={instances:{}},ls=o.createSlice({name:"assetProcedureTypes",initialState:Lc,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,Lc)),reducers:{initializeAssetProcedureTypes:J.initialize,addAssetProcedureType:J.addOne,addAssetProcedureTypes:J.addMany,setAssetProcedureType:J.setOne,setAssetProcedureTypes:J.setMany,updateAssetProcedureType:J.updateOne,updateAssetProcedureTypes:J.updateMany,deleteAssetProcedureType:J.deleteOne,deleteAssetProcedureTypes:J.deleteMany}}),{initializeAssetProcedureTypes:kc,addAssetProcedureType:Nc,addAssetProcedureTypes:Gc,updateAssetProcedureType:Hc,updateAssetProcedureTypes:Wc,deleteAssetProcedureType:Kc,deleteAssetProcedureTypes:Yc,setAssetProcedureType:Zc,setAssetProcedureTypes:Jc}=ls.actions,Xc=ls.reducer,Qc=t=>t.assetProcedureTypeReducer.instances,os=o.createSelector([Qc],t=>Object.values(t)),xc=t=>s=>s.assetProcedureTypeReducer.instances[t],ed=S(o.createSelector([os,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),OO=S(o.createSelector([os,(t,s)=>s],(t,s)=>T(t.filter(e=>e.organization===s)))),X=R(t=>t.uuid),td={instances:{}},hs=o.createSlice({name:"assetProcedureStepFieldsAttachments",initialState:td,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,td)),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:sd,addAssetProcedureStepFieldsAttachment:id,addAssetProcedureStepFieldsAttachments:nd,setAssetProcedureStepFieldsAttachment:ad,setAssetProcedureStepFieldsAttachments:cd,updateAssetProcedureStepFieldsAttachment:dd,updateAssetProcedureStepFieldsAttachments:rd,deleteAssetProcedureStepFieldsAttachment:ud,deleteAssetProcedureStepFieldsAttachments:ld}=hs.actions,od=t=>t.assetProcedureStepFieldsAttachmentReducer.instances,ms=o.createSelector([od],t=>Object.values(t)),PO=S(o.createSelector([ms,(t,s)=>s],(t,s)=>T(t.filter(e=>e.fields_revision===s)))),hd=t=>s=>s.assetProcedureStepFieldsAttachmentReducer.instances[t],md=S(o.createSelector([ms,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),yd=hs.reducer,Q=R(t=>t.uuid),pd={instances:{}},ys=o.createSlice({name:"assetProcedureStepFields",initialState:pd,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,pd)),reducers:{initializeAssetProcedureStepFields:Q.initialize,addAssetProcedureStepFields:Q.addOne,addAssetProcedureStepFieldsMany:Q.addMany,setAssetProcedureStepFields:Q.setOne,setAssetProcedureStepFieldsMany:Q.setMany,updateAssetProcedureStepFields:Q.updateOne,updateAssetProcedureStepFieldsMany:Q.updateMany,deleteAssetProcedureStepFields:Q.deleteOne,deleteAssetProcedureStepFieldsMany:Q.deleteMany}}),{initializeAssetProcedureStepFields:Ad,addAssetProcedureStepFields:fd,addAssetProcedureStepFieldsMany:Sd,setAssetProcedureStepFields:Td,setAssetProcedureStepFieldsMany:Id,updateAssetProcedureStepFields:Od,updateAssetProcedureStepFieldsMany:Pd,deleteAssetProcedureStepFields:Fd,deleteAssetProcedureStepFieldsMany:gd}=ys.actions,ps=t=>t.assetProcedureStepFieldsReducer.instances,At=o.createSelector([ps],t=>Object.values(t)),FO=S(o.createSelector([At,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_procedure_step===s)))),gO=S(o.createSelector([At,(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])),bO=o.createSelector([ps],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}),bd=t=>s=>s.assetProcedureStepFieldsReducer.instances[t],_d=S(o.createSelector([At,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Md=ys.reducer,x=R(t=>t.uuid),Rd={instances:{}},As=o.createSlice({name:"assetProcedureStepFieldValuesAttachments",initialState:Rd,extraReducers:t=>t.addMatcher(o.isAnyOf(_,C,w),s=>Object.assign(s,Rd)),reducers:{initializeAssetProcedureStepFieldValuesAttachments:x.initialize,addAssetProcedureStepFieldValuesAttachment:x.addOne,addAssetProcedureStepFieldValuesAttachments:x.addMany,setAssetProcedureStepFieldValuesAttachment:x.setOne,setAssetProcedureStepFieldValuesAttachments:x.setMany,updateAssetProcedureStepFieldValuesAttachment:x.updateOne,updateAssetProcedureStepFieldValuesAttachments:x.updateMany,deleteAssetProcedureStepFieldValuesAttachment:x.deleteOne,deleteAssetProcedureStepFieldValuesAttachments:x.deleteMany}}),{initializeAssetProcedureStepFieldValuesAttachments:wd,addAssetProcedureStepFieldValuesAttachment:vd,addAssetProcedureStepFieldValuesAttachments:fs,setAssetProcedureStepFieldValuesAttachment:Ed,setAssetProcedureStepFieldValuesAttachments:Vd,updateAssetProcedureStepFieldValuesAttachment:zd,updateAssetProcedureStepFieldValuesAttachments:Bd,deleteAssetProcedureStepFieldValuesAttachment:jd,deleteAssetProcedureStepFieldValuesAttachments:Ss}=As.actions,qd=t=>t.assetProcedureStepFieldValuesAttachmentReducer.instances,Ts=o.createSelector([qd],t=>Object.values(t)),Cd=t=>s=>s.assetProcedureStepFieldValuesAttachmentReducer.instances[t],Dd=S(o.createSelector([Ts,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),$d=S(o.createSelector([Ts,(t,s)=>s],(t,s)=>T(t.filter(e=>e.field_values===s)))),Ud=As.reducer,ee=R(t=>t.uuid),Ld={instances:{}},Is=o.createSlice({name:"assetProcedureStepFieldValues",initialState:Ld,extraReducers:t=>t.addMatcher(o.isAnyOf(_,C,w),s=>Object.assign(s,Ld)),reducers:{initializeAssetProcedureStepFieldValues:ee.initialize,addAssetProcedureStepFieldValues:ee.addOne,addAssetProcedureStepFieldValuesMany:ee.addMany,setAssetProcedureStepFieldValues:ee.setOne,setAssetProcedureStepFieldValuesMany:ee.setMany,updateAssetProcedureStepFieldValues:ee.updateOne,updateAssetProcedureStepFieldValuesMany:ee.updateMany,deleteAssetProcedureStepFieldValues:ee.deleteOne,deleteAssetProcedureStepFieldValuesMany:ee.deleteMany}}),{initializeAssetProcedureStepFieldValues:kd,addAssetProcedureStepFieldValues:Nd,addAssetProcedureStepFieldValuesMany:Gd,setAssetProcedureStepFieldValues:Hd,setAssetProcedureStepFieldValuesMany:Wd,updateAssetProcedureStepFieldValues:Kd,updateAssetProcedureStepFieldValuesMany:Yd,deleteAssetProcedureStepFieldValues:Zd,deleteAssetProcedureStepFieldValuesMany:Jd}=Is.actions,Xd=t=>t.assetProcedureStepFieldValuesReducer.instances,at=o.createSelector([Xd],t=>Object.values(t)),_O=S(o.createSelector([at,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset===s)))),MO=S(o.createSelector([at,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_procedure===s)))),RO=S(o.createSelector([at,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_procedure_step===s)))),Qd=t=>s=>s.assetProcedureStepFieldValuesReducer.instances[t],xd=S(o.createSelector([at,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),er=Is.reducer,te=R(t=>t.uuid),tr={instances:{}},Os=o.createSlice({name:"assetProcedureSteps",initialState:tr,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,tr)),reducers:{initializeAssetProcedureSteps:te.initialize,setAssetProcedureStep:te.setOne,setAssetProcedureSteps:te.setMany,addAssetProcedureStep:te.addOne,addAssetProcedureSteps:te.addMany,updateAssetProcedureStep:te.updateOne,updateAssetProcedureSteps:te.updateMany,deleteAssetProcedureStep:te.deleteOne,deleteAssetProcedureSteps:te.deleteMany}}),{initializeAssetProcedureSteps:sr,setAssetProcedureStep:ir,setAssetProcedureSteps:nr,addAssetProcedureStep:ar,addAssetProcedureSteps:cr,updateAssetProcedureStep:dr,updateAssetProcedureSteps:rr,deleteAssetProcedureStep:ur,deleteAssetProcedureSteps:lr}=Os.actions,or=Os.reducer,ft=t=>t.assetProcedureStepReducer.instances,hr=t=>s=>s.assetProcedureStepReducer.instances[t],Ps=o.createSelector([ft],t=>Object.values(t)),wO=S(o.createSelector([ft,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return ht(e)})),vO=S(o.createSelector([Ps,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_procedure_type===s)))),mr=S(o.createSelector([Ps,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),yr=S(o.createSelector([ft,(t,s)=>s],(t,s)=>{if(!t[s])return T([]);const a=Hn(s,Object.values(t)).all().map(({model:c})=>c);return T(a)})),se=R(t=>t.uuid),pr={instances:{}},Fs=o.createSlice({name:"assets",initialState:pr,extraReducers:t=>t.addMatcher(o.isAnyOf(_,C,w),s=>Object.assign(s,pr)),reducers:{initializeAssets:se.initialize,addAsset:se.addOne,addAssets:se.addMany,setAsset:se.setOne,setAssets:se.setMany,updateAsset:se.updateOne,updateAssets:se.updateMany,deleteAsset:se.deleteOne,deleteAssets:se.deleteMany}}),{initializeAssets:Ar,addAsset:fr,addAssets:gs,updateAsset:Sr,updateAssets:Tr,deleteAsset:Ir,deleteAssets:bs,setAsset:Or,setAssets:Pr}=Fs.actions,Fr=t=>t.assetReducer.instances,St=o.createSelector([Fr],t=>T(Object.values(t))),EO=S(o.createSelector([St,(t,s)=>s],(t,s)=>T(t.filter(({project:e})=>e===s)))),gr=S(o.createSelector([St,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_type===s)))),br=t=>s=>s.assetReducer.instances[t],_r=S(o.createSelector([St,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Mr=Fs.reducer,ie=R(t=>t.uuid),Rr={instances:{}},_s=o.createSlice({name:"assetStageCompletions",initialState:Rr,extraReducers:t=>t.addMatcher(o.isAnyOf(_,C,w),s=>Object.assign(s,Rr)),reducers:{initializeAssetStageCompletions:ie.initialize,addAssetStageCompletion:ie.addOne,addAssetStageCompletions:ie.addMany,setAssetStageCompletion:ie.setOne,setAssetStageCompletions:ie.setMany,updateAssetStageCompletion:ie.updateOne,updateAssetStageCompletions:ie.updateMany,deleteAssetStageCompletion:ie.deleteOne,deleteAssetStageCompletions:ie.deleteMany}}),{initializeAssetStageCompletions:wr,addAssetStageCompletion:vr,addAssetStageCompletions:Er,setAssetStageCompletion:Vr,setAssetStageCompletions:zr,updateAssetStageCompletion:Br,updateAssetStageCompletions:jr,deleteAssetStageCompletion:qr,deleteAssetStageCompletions:Cr}=_s.actions,Dr=_s.reducer,$r=t=>t.assetStageCompletionReducer.instances,Ur=o.createSelector([$r],t=>Object.values(t)),Lr=t=>s=>s.assetStageCompletionReducer.instances[t],kr=S(o.createSelector([Ur,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),ne=R(t=>t.uuid),Nr={instances:{}},Ms=o.createSlice({name:"assetStages",initialState:Nr,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,Nr)),reducers:{initializeAssetStages:ne.initialize,setAssetStage:ne.setOne,setAssetStages:ne.setMany,addAssetStage:ne.addOne,addAssetStages:ne.addMany,updateAssetStage:ne.updateOne,updateAssetStages:ne.updateMany,deleteAssetStage:ne.deleteOne,deleteAssetStages:ne.deleteMany}}),{initializeAssetStages:Gr,setAssetStage:Hr,setAssetStages:Wr,addAssetStage:Kr,addAssetStages:Yr,updateAssetStage:Zr,updateAssetStages:Jr,deleteAssetStage:Xr,deleteAssetStages:Qr}=Ms.actions,xr=Ms.reducer,Rs=t=>t.assetStageReducer.instances,eu=t=>s=>s.assetStageReducer.instances[t],ws=o.createSelector([Rs],t=>Object.values(t)),VO=S(o.createSelector([Rs,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return ht(e)})),zO=S(o.createSelector([ws,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_procedure_type===s)))),tu=S(o.createSelector([ws,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),ae=R(t=>t.uuid),su={instances:{}},vs=o.createSlice({name:"assetTypeAttachments",initialState:su,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,su)),reducers:{initializeAssetTypeAttachments:ae.initialize,addAssetTypeAttachment:ae.addOne,addAssetTypeAttachments:ae.addMany,setAssetTypeAttachment:ae.setOne,setAssetTypeAttachments:ae.setMany,updateAssetTypeAttachment:ae.updateOne,updateAssetTypeAttachments:ae.updateMany,deleteAssetTypeAttachment:ae.deleteOne,deleteAssetTypeAttachments:ae.deleteMany}}),{initializeAssetTypeAttachments:iu,addAssetTypeAttachment:nu,addAssetTypeAttachments:Es,setAssetTypeAttachment:au,setAssetTypeAttachments:cu,updateAssetTypeAttachment:du,updateAssetTypeAttachments:ru,deleteAssetTypeAttachment:uu,deleteAssetTypeAttachments:Vs}=vs.actions,lu=t=>t.assetTypeAttachmentReducer.instances,zs=o.createSelector([lu],t=>Object.values(t)),ou=t=>s=>s.assetTypeAttachmentReducer.instances[t],hu=S(o.createSelector([zs,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),mu=S(o.createSelector([zs,(t,s)=>s],(t,s)=>T(t.filter(({asset_type:e})=>s===e)))),yu=vs.reducer,ce=R(t=>t.uuid),pu={instances:{}},Bs=o.createSlice({name:"assetTypeFieldsAttachments",initialState:pu,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,pu)),reducers:{initializeAssetTypeFieldsAttachments:ce.initialize,addAssetTypeFieldsAttachment:ce.addOne,addAssetTypeFieldsAttachments:ce.addMany,setAssetTypeFieldsAttachment:ce.setOne,setAssetTypeFieldsAttachments:ce.setMany,updateAssetTypeFieldsAttachment:ce.updateOne,updateAssetTypeFieldsAttachments:ce.updateMany,deleteAssetTypeFieldsAttachment:ce.deleteOne,deleteAssetTypeFieldsAttachments:ce.deleteMany}}),{initializeAssetTypeFieldsAttachments:Au,addAssetTypeFieldsAttachment:fu,addAssetTypeFieldsAttachments:Su,setAssetTypeFieldsAttachment:Tu,setAssetTypeFieldsAttachments:Iu,updateAssetTypeFieldsAttachment:Ou,updateAssetTypeFieldsAttachments:Pu,deleteAssetTypeFieldsAttachment:Fu,deleteAssetTypeFieldsAttachments:gu}=Bs.actions,bu=t=>t.assetTypeFieldsAttachmentReducer.instances,js=o.createSelector([bu],t=>Object.values(t)),BO=S(o.createSelector([js,(t,s)=>s],(t,s)=>T(t.filter(e=>e.fields_revision===s)))),_u=t=>s=>s.assetTypeFieldsAttachmentReducer.instances[t],Mu=S(o.createSelector([js,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Ru=Bs.reducer,de=R(t=>t.uuid),wu={instances:{}},qs=o.createSlice({name:"assetTypeFields",initialState:wu,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,wu)),reducers:{initializeAssetTypeFields:de.initialize,addAssetTypeFields:de.addOne,addAssetTypeFieldsMany:de.addMany,setAssetTypeFields:de.setOne,setAssetTypeFieldsMany:de.setMany,updateAssetTypeFields:de.updateOne,updateAssetTypeFieldsMany:de.updateMany,deleteAssetTypeFields:de.deleteOne,deleteAssetTypeFieldsMany:de.deleteMany}}),{initializeAssetTypeFields:vu,addAssetTypeFields:Eu,addAssetTypeFieldsMany:Vu,setAssetTypeFields:zu,setAssetTypeFieldsMany:Bu,updateAssetTypeFields:ju,updateAssetTypeFieldsMany:qu,deleteAssetTypeFields:Cu,deleteAssetTypeFieldsMany:Du}=qs.actions,$u=t=>t.assetTypeFieldsReducer.instances,ct=o.createSelector([$u],t=>Object.values(t)),jO=S(o.createSelector([ct,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_type===s)))),qO=S(o.createSelector([ct,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Uu=t=>s=>s.assetTypeFieldsReducer.instances[t],Lu=S(o.createSelector([ct,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),ku=qs.reducer,re=R(t=>t.uuid),Nu={instances:{}},Cs=o.createSlice({name:"assetTypeFieldValuesAttachments",initialState:Nu,extraReducers:t=>t.addMatcher(o.isAnyOf(_,C,w),s=>Object.assign(s,Nu)),reducers:{initializeAssetTypeFieldValuesAttachments:re.initialize,addAssetTypeFieldValuesAttachment:re.addOne,addAssetTypeFieldValuesAttachments:re.addMany,setAssetTypeFieldValuesAttachment:re.setOne,setAssetTypeFieldValuesAttachments:re.setMany,updateAssetTypeFieldValuesAttachment:re.updateOne,updateAssetTypeFieldValuesAttachments:re.updateMany,deleteAssetTypeFieldValuesAttachment:re.deleteOne,deleteAssetTypeFieldValuesAttachments:re.deleteMany}}),{initializeAssetTypeFieldValuesAttachments:Gu,addAssetTypeFieldValuesAttachment:Hu,addAssetTypeFieldValuesAttachments:Ds,setAssetTypeFieldValuesAttachment:Wu,setAssetTypeFieldValuesAttachments:Ku,updateAssetTypeFieldValuesAttachment:Yu,updateAssetTypeFieldValuesAttachments:Zu,deleteAssetTypeFieldValuesAttachment:Ju,deleteAssetTypeFieldValuesAttachments:$s}=Cs.actions,Xu=t=>t.assetTypeFieldValuesAttachmentReducer.instances,Us=o.createSelector([Xu],t=>Object.values(t)),Qu=t=>s=>s.assetTypeFieldValuesAttachmentReducer.instances[t],xu=S(o.createSelector([Us,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),el=S(o.createSelector([Us,(t,s)=>s],(t,s)=>T(t.filter(e=>e.field_values===s)))),tl=Cs.reducer,ue=R(t=>t.uuid),sl={instances:{}},Ls=o.createSlice({name:"assetTypeFieldValues",initialState:sl,extraReducers:t=>t.addMatcher(o.isAnyOf(_,C,w),s=>Object.assign(s,sl)),reducers:{initializeAssetTypeFieldValues:ue.initialize,addAssetTypeFieldValues:ue.addOne,addAssetTypeFieldValuesMany:ue.addMany,setAssetTypeFieldValues:ue.setOne,setAssetTypeFieldValuesMany:ue.setMany,updateAssetTypeFieldValues:ue.updateOne,updateAssetTypeFieldValuesMany:ue.updateMany,deleteAssetTypeFieldValues:ue.deleteOne,deleteAssetTypeFieldValuesMany:ue.deleteMany}}),{initializeAssetTypeFieldValues:il,addAssetTypeFieldValues:nl,addAssetTypeFieldValuesMany:al,setAssetTypeFieldValues:cl,setAssetTypeFieldValuesMany:dl,updateAssetTypeFieldValues:rl,updateAssetTypeFieldValuesMany:ul,deleteAssetTypeFieldValues:ll,deleteAssetTypeFieldValuesMany:ol}=Ls.actions,hl=t=>t.assetTypeFieldValuesReducer.instances,Tt=o.createSelector([hl],t=>Object.values(t)),CO=S(o.createSelector([Tt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset===s)))),DO=S(o.createSelector([ct,Tt,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(a=>a.asset_type===e).map(a=>a.uuid));return T(s.filter(a=>n.has(a.fields_revision)))})),ml=t=>s=>s.assetTypeFieldValuesReducer.instances[t],yl=S(o.createSelector([Tt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),pl=Ls.reducer,le=R(t=>t.uuid),Al={instances:{}},ks=o.createSlice({name:"assetTypeIdentifiers",initialState:Al,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,Al)),reducers:{initializeAssetTypeIdentifiers:le.initialize,addAssetTypeIdentifier:le.addOne,addAssetTypeIdentifiers:le.addMany,setAssetTypeIdentifier:le.setOne,setAssetTypeIdentifiers:le.setMany,updateAssetTypeIdentifier:le.updateOne,updateAssetTypeIdentifiers:le.updateMany,deleteAssetTypeIdentifier:le.deleteOne,deleteAssetTypeIdentifiers:le.deleteMany}}),{initializeAssetTypeIdentifiers:fl,addAssetTypeIdentifier:Sl,addAssetTypeIdentifiers:Tl,setAssetTypeIdentifier:Il,setAssetTypeIdentifiers:Ol,updateAssetTypeIdentifier:Pl,updateAssetTypeIdentifiers:Fl,deleteAssetTypeIdentifier:gl,deleteAssetTypeIdentifiers:bl}=ks.actions,_l=t=>t.assetTypeIdentifierReducer.instances,Ns=o.createSelector([_l],t=>Object.values(t)),Ml=t=>s=>s.assetTypeIdentifierReducer.instances[t],Rl=S(o.createSelector([Ns,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),$O=S(o.createSelector([Ns,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_type===s)))),wl=ks.reducer,oe=R(t=>t.uuid),vl={instances:{}},Gs=o.createSlice({name:"assetTypeIdentifierValues",initialState:vl,extraReducers:t=>t.addMatcher(o.isAnyOf(_,C,w),s=>Object.assign(s,vl)),reducers:{initializeAssetTypeIdentifierValues:oe.initialize,addAssetTypeIdentifierValue:oe.addOne,addAssetTypeIdentifierValues:oe.addMany,setAssetTypeIdentifierValue:oe.setOne,setAssetTypeIdentifierValues:oe.setMany,updateAssetTypeIdentifierValue:oe.updateOne,updateAssetTypeIdentifierValues:oe.updateMany,deleteAssetTypeIdentifierValue:oe.deleteOne,deleteAssetTypeIdentifierValues:oe.deleteMany}}),{initializeAssetTypeIdentifierValues:El,addAssetTypeIdentifierValue:Vl,addAssetTypeIdentifierValues:zl,setAssetTypeIdentifierValue:Bl,setAssetTypeIdentifierValues:jl,updateAssetTypeIdentifierValue:ql,updateAssetTypeIdentifierValues:Cl,deleteAssetTypeIdentifierValue:Dl,deleteAssetTypeIdentifierValues:$l}=Gs.actions,Ul=t=>t.assetTypeIdentifierValueReducer.instances,It=o.createSelector([Ul],t=>Object.values(t)),Ll=t=>s=>s.assetTypeIdentifierValueReducer.instances[t],kl=S(o.createSelector([It,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),UO=S(o.createSelector([It,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset===s)))),LO=S(o.createSelector([It,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_type_identifier===s)))),Nl=Gs.reducer,he=R(t=>t.uuid),Gl={instances:{}},Hs=o.createSlice({name:"assetTypes",initialState:Gl,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,Gl)),reducers:{initializeAssetTypes:he.initialize,setAssetType:he.setOne,setAssetTypes:he.setMany,addAssetType:he.addOne,addAssetTypes:he.addMany,updateAssetType:he.updateOne,updateAssetTypes:he.updateMany,deleteAssetType:he.deleteOne,deleteAssetTypes:he.deleteMany}}),{initializeAssetTypes:Hl,setAssetType:Wl,setAssetTypes:Kl,addAssetType:Yl,addAssetTypes:Zl,updateAssetType:Jl,updateAssetTypes:Xl,deleteAssetType:Ql,deleteAssetTypes:xl}=Hs.actions,eo=t=>t.assetTypeReducer.instances,Ws=o.createSelector([eo],t=>Object.values(t)),to=t=>s=>s.assetTypeReducer.instances[t],so=S(o.createSelector([Ws,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),kO=S(o.createSelector([Ws,(t,s)=>s],(t,s)=>T(t.filter(e=>e.organization===s)))),io=Hs.reducer,no={accessToken:"",refreshToken:"",isLoggedIn:!1},Ot=o.createSlice({name:"auth",initialState:no,extraReducers:t=>t.addCase(_,s=>Object.assign(s,no)),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||Ot.caseReducers.clearTokens(t),t.isLoggedIn=s.payload}}}),{setTokens:NO,clearTokens:GO,setLoggedIn:ao}=Ot.actions,HO=t=>t.authReducer.accessToken,WO=t=>t.authReducer.isLoggedIn,co=Ot.reducer,me=R(t=>t.uuid),ro={instances:{}},Ks=o.createSlice({name:"categories",initialState:ro,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,ro)),reducers:{initializeCategories:me.initialize,addCategory:me.addOne,addCategories:me.addMany,setCategory:me.setOne,setCategories:me.setMany,updateCategory:me.updateOne,updateCategories:me.updateMany,deleteCategory:me.deleteOne,deleteCategories:me.deleteMany}}),{initializeCategories:uo,addCategory:lo,addCategories:oo,setCategory:ho,setCategories:mo,updateCategory:yo,updateCategories:po,deleteCategory:Ao,deleteCategories:fo}=Ks.actions,So=t=>t.categoryReducer.instances,Ys=o.createSelector([So],t=>Object.values(t)),Zs=t=>s=>s.categoryReducer.instances[t],To=S(o.createSelector([Ys,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),KO=S(o.createSelector([Ys,(t,s)=>s],(t,s)=>T(t.filter(e=>e.project===s)))),Io=Ks.reducer,ye=R(t=>t.uuid),Oo={instances:{}},Js=o.createSlice({name:"documentAttachments",initialState:Oo,extraReducers:t=>t.addCase(_,s=>Object.assign(s,Oo)),reducers:{initializeDocumentAttachments:ye.initialize,addDocumentAttachment:ye.addOne,addDocumentAttachments:ye.addMany,setDocumentAttachment:ye.setOne,setDocumentAttachments:ye.setMany,updateDocumentAttachment:ye.updateOne,updateDocumentAttachments:ye.updateMany,deleteDocumentAttachment:ye.deleteOne,deleteDocumentAttachments:ye.deleteMany}}),{initializeDocumentAttachments:Po,addDocumentAttachment:Fo,addDocumentAttachments:go,setDocumentAttachment:bo,setDocumentAttachments:_o,updateDocumentAttachment:Mo,updateDocumentAttachments:Ro,deleteDocumentAttachment:wo,deleteDocumentAttachments:vo}=Js.actions,Eo=t=>t.documentAttachmentReducer.instances,Xs=o.createSelector([Eo],t=>Object.values(t)),Vo=t=>s=>s.documentAttachmentReducer.instances[t],zo=S(o.createSelector([Xs,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),YO=S(o.createSelector([Xs,(t,s)=>s],(t,s)=>T(t.filter(({document:e})=>s===e)))),Bo=Js.reducer,pe=R(({uuid:t})=>t),jo={instances:{}},Qs=o.createSlice({name:"documents",initialState:jo,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>{Object.assign(s,jo)}),reducers:{initializeDocuments:pe.initialize,addDocument:pe.addOne,addDocuments:pe.addMany,setDocument:pe.setOne,setDocuments:pe.setMany,updateDocument:pe.updateOne,updateDocuments:pe.updateMany,deleteDocument:pe.deleteOne,deleteDocuments:pe.deleteMany}}),{initializeDocuments:qo,addDocument:Co,addDocuments:Do,setDocument:$o,setDocuments:Uo,updateDocument:Lo,updateDocuments:ko,deleteDocument:No,deleteDocuments:Go}=Qs.actions,Ho=Qs.reducer,xs=t=>t.documentsReducer.instances,Pt=o.createSelector([xs],t=>Object.values(t)),Wo=t=>s=>s.documentsReducer.instances[t],Ko=S(o.createSelector([Pt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),ZO=S(o.createSelector([Pt,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),JO=S(o.createSelector([Pt,(t,s)=>s],(t,s)=>t.filter(e=>e.organization===s))),Yo=S(o.createSelector([xs,(t,s)=>s],(t,s)=>{if(!t[s])return T([]);const a=Kn(s,Object.values(t)).all().map(({model:c})=>c);return T(a)})),Zo={s3Urls:{}},Jo=1e3*60*60,XO=Jo*24*7,ei=o.createSlice({name:"file",initialState:Zo,extraReducers:t=>t.addCase(_,s=>Object.assign(s,Zo)),reducers:{setUploadUrl:(t,s)=>{const{url:e,fields:n,sha1:a}=s.payload,c=new Date,r=new Date(c.getTime()+XO);t.s3Urls[a]={url:e,fields:n,exp:r.getTime()}}}}),{setUploadUrl:Xo}=ei.actions,Qo=t=>s=>{const e=s.fileReducer.s3Urls[t];if(!e)return;const n=new Date().getTime();if(!((e.exp??n)-n<Jo))return e},xo=ei.reducer,Ae=R(t=>t.uuid),eh={instances:{}},ti=o.createSlice({name:"formIdentifiers",initialState:eh,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,eh)),reducers:{initializeFormIdentifiers:Ae.initialize,addFormIdentifier:Ae.addOne,addFormIdentifiers:Ae.addMany,setFormIdentifier:Ae.setOne,setFormIdentifiers:Ae.setMany,updateFormIdentifier:Ae.updateOne,updateFormIdentifiers:Ae.updateMany,deleteFormIdentifier:Ae.deleteOne,deleteFormIdentifiers:Ae.deleteMany}}),{initializeFormIdentifiers:th,addFormIdentifier:sh,addFormIdentifiers:ih,setFormIdentifier:nh,setFormIdentifiers:ah,updateFormIdentifier:ch,updateFormIdentifiers:dh,deleteFormIdentifier:rh,deleteFormIdentifiers:uh}=ti.actions,lh=t=>t.formIdentifierReducer.instances,si=o.createSelector([lh],t=>Object.values(t)),oh=t=>s=>s.formIdentifierReducer.instances[t],hh=S(o.createSelector([si,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),QO=S(o.createSelector([si,(t,s)=>s],(t,s)=>T(t.filter(e=>e.form===s)))),mh=ti.reducer,fe=R(t=>t.uuid),yh={instances:{}},ii=o.createSlice({name:"formIdentifierValues",initialState:yh,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,yh)),reducers:{initializeFormIdentifierValues:fe.initialize,addFormIdentifierValue:fe.addOne,addFormIdentifierValues:fe.addMany,setFormIdentifierValue:fe.setOne,setFormIdentifierValues:fe.setMany,updateFormIdentifierValue:fe.updateOne,updateFormIdentifierValues:fe.updateMany,deleteFormIdentifierValue:fe.deleteOne,deleteFormIdentifierValues:fe.deleteMany}}),{initializeFormIdentifierValues:ph,addFormIdentifierValue:Ah,addFormIdentifierValues:fh,setFormIdentifierValue:Sh,setFormIdentifierValues:Th,updateFormIdentifierValue:Ih,updateFormIdentifierValues:Oh,deleteFormIdentifierValue:Ph,deleteFormIdentifierValues:Fh}=ii.actions,gh=t=>t.formIdentifierValueReducer.instances,Ft=o.createSelector([gh],t=>Object.values(t)),bh=t=>s=>s.formIdentifierValueReducer.instances[t],_h=S(o.createSelector([Ft,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),xO=S(o.createSelector([Ft,(t,s)=>s],(t,s)=>T(t.filter(e=>e.form_submission===s)))),eP=S(o.createSelector([Ft,(t,s)=>s],(t,s)=>T(t.filter(e=>e.form_identifier===s)))),Mh=ii.reducer,Se=R(t=>t.uuid),Rh={instances:{}},ni=o.createSlice({name:"formRevisionAttachments",initialState:Rh,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,Rh)),reducers:{initializeFormRevisionAttachments:Se.initialize,addFormRevisionAttachment:Se.addOne,addFormRevisionAttachments:Se.addMany,setFormRevisionAttachment:Se.setOne,setFormRevisionAttachments:Se.setMany,updateFormRevisionAttachment:Se.updateOne,updateFormRevisionAttachments:Se.updateMany,deleteFormRevisionAttachment:Se.deleteOne,deleteFormRevisionAttachments:Se.deleteMany}}),{initializeFormRevisionAttachments:wh,addFormRevisionAttachment:vh,addFormRevisionAttachments:Eh,setFormRevisionAttachment:Vh,setFormRevisionAttachments:zh,updateFormRevisionAttachment:Bh,updateFormRevisionAttachments:jh,deleteFormRevisionAttachment:qh,deleteFormRevisionAttachments:Ch}=ni.actions,gt=t=>t.formRevisionAttachmentReducer.instances,Dh=o.createSelector([gt],t=>Object.values(t)),$h=S(o.createSelector([gt,(t,s)=>s],(t,s)=>t[s])),Uh=S(o.createSelector([Dh,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),tP=S(o.createSelector([gt,(t,s)=>s],(t,s)=>T(Object.values(t).filter(e=>e.form_revision===s)))),Lh=ni.reducer,Te=R(t=>t.uuid),kh={instances:{}},ai=o.createSlice({name:"formRevisions",initialState:kh,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,kh)),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:Nh,addFormRevision:ci,addFormRevisions:di,setFormRevision:Gh,setFormRevisions:Hh,updateFormRevision:Wh,updateFormRevisions:Kh,deleteFormRevision:ri,deleteFormRevisions:ui}=ai.actions,li=t=>t.formRevisionReducer.instances,bt=o.createSelector([li],t=>Object.values(t)),Yh=t=>s=>s.formRevisionReducer.instances[t],Zh=S(o.createSelector([bt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),sP=S(o.createSelector([bt,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Jh=S(o.createSelector([bt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.form===s)))),Xh=ai.reducer,Ie=R(t=>t.uuid),Qh={instances:{}},oi=o.createSlice({name:"forms",initialState:Qh,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,Qh)),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:xh,addForm:em,addForms:tm,setForm:sm,setForms:im,updateForm:nm,updateForms:am,deleteForm:cm,deleteForms:dm}=oi.actions,rm=oi.reducer,um=t=>t.formReducer.instances,hi=o.createSelector([um],t=>Object.values(t)),lm=t=>s=>s.formReducer.instances[t],om=S(o.createSelector([hi,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),iP=S(o.createSelector([hi,(t,s)=>s],(t,s)=>T(t.filter(e=>e.organization===s)))),Oe=R(t=>t.uuid),hm={instances:{}},mi=o.createSlice({name:"formSubmissionAttachments",initialState:hm,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,hm)),reducers:{initializeFormSubmissionAttachments:Oe.initialize,addFormSubmissionAttachment:Oe.addOne,addFormSubmissionAttachments:Oe.addMany,setFormSubmissionAttachment:Oe.setOne,setFormSubmissionAttachments:Oe.setMany,updateFormSubmissionAttachment:Oe.updateOne,updateFormSubmissionAttachments:Oe.updateMany,deleteFormSubmissionAttachment:Oe.deleteOne,deleteFormSubmissionAttachments:Oe.deleteMany}}),{initializeFormSubmissionAttachments:mm,addFormSubmissionAttachment:ym,addFormSubmissionAttachments:yi,setFormSubmissionAttachment:pm,setFormSubmissionAttachments:Am,updateFormSubmissionAttachment:fm,updateFormSubmissionAttachments:Sm,deleteFormSubmissionAttachment:Tm,deleteFormSubmissionAttachments:pi}=mi.actions,Ai=t=>t.formSubmissionAttachmentReducer.instances,fi=o.createSelector([Ai],t=>Object.values(t)),Im=S(o.createSelector([Ai,(t,s)=>s],(t,s)=>t[s])),Si=S(o.createSelector([fi,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(n=>e.has(n.uuid)))})),Om=Si,Pm=S(o.createSelector([fi,(t,s)=>s],(t,s)=>T(t.filter(e=>e.form_submission===s)))),Fm=mi.reducer,Pe=R(t=>t.uuid),gm={instances:{}},Ti=o.createSlice({name:"formSubmissions",initialState:gm,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,gm)),reducers:{initializeFormSubmissions:Pe.initialize,setFormSubmission:Pe.setOne,setFormSubmissions:Pe.setMany,addFormSubmission:Pe.addOne,addFormSubmissions:Pe.addMany,updateFormSubmission:Pe.updateOne,updateFormSubmissions:Pe.updateMany,deleteFormSubmission:Pe.deleteOne,deleteFormSubmissions:Pe.deleteMany}}),{initializeFormSubmissions:bm,setFormSubmission:_m,setFormSubmissions:Mm,addFormSubmission:Rm,addFormSubmissions:Ii,updateFormSubmission:wm,updateFormSubmissions:vm,deleteFormSubmission:Em,deleteFormSubmissions:Oi}=Ti.actions,Pi=t=>t.formSubmissionReducer.instances,Vm=o.createSelector([Pi],t=>Object.values(t)),zm=t=>s=>s.formSubmissionReducer.instances[t],Bm=S(o.createSelector([Vm,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),jm=S(o.createSelector([Pi,li,(t,s)=>s],(t,s,e)=>{const n=new Set;for(const a of Object.values(s))a.form===e&&n.add(a.uuid);return Object.values(t).filter(a=>n.has(a.form_revision))})),qm=Ti.reducer,Fe=R(t=>t.uuid),Cm={instances:{}},Fi=o.createSlice({name:"geoImages",initialState:Cm,extraReducers:t=>t.addMatcher(o.isAnyOf(_,C,w),s=>Object.assign(s,Cm)),reducers:{initializeGeoImages:Fe.initialize,setGeoImage:Fe.setOne,setGeoImages:Fe.setMany,addGeoImage:Fe.addOne,addGeoImages:Fe.addMany,updateGeoImage:Fe.updateOne,updateGeoImages:Fe.updateMany,deleteGeoImage:Fe.deleteOne,deleteGeoImages:Fe.deleteMany}}),{initializeGeoImages:Dm,setGeoImage:$m,setGeoImages:Um,addGeoImage:Lm,addGeoImages:km,updateGeoImage:Nm,updateGeoImages:Gm,deleteGeoImage:Hm,deleteGeoImages:Wm}=Fi.actions,Km=t=>t.geoImageReducer.instances,gi=o.createSelector([Km],t=>Object.values(t)),Ym=t=>s=>s.geoImageReducer.instances[t],Zm=S(o.createSelector([gi,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),nP=S(o.createSelector([gi,(t,s)=>s],(t,s)=>T(t.filter(e=>e.project===s)))),Jm=Fi.reducer,ge=R(t=>t.uuid),Xm={instances:{}},bi=o.createSlice({name:"issueAssociations",initialState:Xm,extraReducers:t=>t.addMatcher(o.isAnyOf(_,C,w),s=>Object.assign(s,Xm)),reducers:{initializeIssueAssociations:ge.initialize,addIssueAssociation:ge.addOne,addIssueAssociations:ge.addMany,setIssueAssociation:ge.setOne,setIssueAssociations:ge.setMany,updateIssueAssociation:ge.updateOne,updateIssueAssociations:ge.updateMany,deleteIssueAssociation:ge.deleteOne,deleteIssueAssociations:ge.deleteMany}}),{initializeIssueAssociations:Qm,setIssueAssociations:xm,setIssueAssociation:ey,updateIssueAssociation:ty,updateIssueAssociations:sy,addIssueAssociation:iy,addIssueAssociations:_t,deleteIssueAssociation:ny,deleteIssueAssociations:Mt}=bi.actions,dt=t=>t.issueAssociationReducer.instances,ay=o.createSelector([dt],t=>Object.values(t)),cy=t=>s=>s.issueAssociationReducer.instances[t],dy=S(o.createSelector([ay,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),ry=S(o.createSelector([dt,(t,s)=>s],(t,s)=>T(Object.values(t).filter(e=>e.associated_issue===s)))),uy=S(o.createSelector([dt,(t,s)=>s],(t,s)=>T(Object.values(t).filter(e=>e.issue===s)))),ly=S(o.createSelector([dt,(t,s)=>s],(t,s)=>T(Object.values(t).filter(e=>e.asset===s)))),oy=bi.reducer,be=R(t=>t.uuid),hy={instances:{}},_i=o.createSlice({name:"issueAttachments",initialState:hy,extraReducers:t=>t.addMatcher(o.isAnyOf(_,C,w),s=>Object.assign(s,hy)),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:my,addIssueAttachment:yy,addIssueAttachments:Mi,setIssueAttachment:py,setIssueAttachments:Ay,updateIssueAttachment:fy,updateIssueAttachments:Sy,deleteIssueAttachment:Ty,deleteIssueAttachments:Ri}=_i.actions,Iy=t=>t.issueAttachmentReducer.instances,wi=o.createSelector([Iy],t=>Object.values(t)),Oy=S(o.createSelector([wi,(t,s)=>s],(t,s)=>T(t.filter(({issue:e})=>s===e)))),Py=t=>s=>s.issueAttachmentReducer.instances[t],Fy=S(o.createSelector([wi,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),gy=_i.reducer,_e=R(t=>t.uuid),by={instances:{}},vi=o.createSlice({name:"issueCommentAttachments",initialState:by,extraReducers:t=>t.addMatcher(o.isAnyOf(_,C,w),s=>Object.assign(s,by)),reducers:{initializeIssueCommentAttachments:_e.initialize,addIssueCommentAttachment:_e.addOne,addIssueCommentAttachments:_e.addMany,setIssueCommentAttachment:_e.setOne,setIssueCommentAttachments:_e.setMany,updateIssueCommentAttachment:_e.updateOne,updateIssueCommentAttachments:_e.updateMany,deleteIssueCommentAttachment:_e.deleteOne,deleteIssueCommentAttachments:_e.deleteMany}}),{initializeIssueCommentAttachments:_y,addIssueCommentAttachment:My,addIssueCommentAttachments:Ry,setIssueCommentAttachment:wy,setIssueCommentAttachments:vy,updateIssueCommentAttachment:Ey,updateIssueCommentAttachments:Vy,deleteIssueCommentAttachment:zy,deleteIssueCommentAttachments:By}=vi.actions,jy=t=>t.issueCommentAttachmentReducer.instances,Ei=o.createSelector([jy],t=>Object.values(t)),qy=t=>s=>s.issueCommentAttachmentReducer.instances[t],Cy=S(o.createSelector([Ei,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),aP=S(o.createSelector([Ei,(t,s)=>s],(t,s)=>T(t.filter(({issue_comment:e})=>s===e)))),Dy=vi.reducer,Me=R(t=>t.uuid),$y={instances:{}},Vi=o.createSlice({name:"issueComments",initialState:$y,extraReducers:t=>t.addMatcher(o.isAnyOf(_,C,w),s=>Object.assign(s,$y)),reducers:{initializeIssueComments:Me.initialize,addIssueComment:Me.addOne,addIssueComments:Me.addMany,setIssueComment:Me.setOne,setIssueComments:Me.setMany,updateIssueComment:Me.updateOne,updateIssueComments:Me.updateMany,deleteIssueComment:Me.deleteOne,deleteIssueComments:Me.deleteMany}}),{initializeIssueComments:Uy,addIssueComment:Ly,addIssueComments:ky,setIssueComment:Ny,setIssueComments:Gy,updateIssueComment:Hy,updateIssueComments:Wy,deleteIssueComment:Ky,deleteIssueComments:Yy}=Vi.actions,zi=t=>t.issueCommentReducer.instances,Zy=t=>s=>s.issueCommentReducer.instances[t],Jy=S(o.createSelector([zi,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(Object.values(t).filter(({uuid:n})=>e.has(n)))})),cP=S(o.createSelector([zi,(t,s)=>s],(t,s)=>T(Object.values(t).filter(e=>e.issue===s)))),Xy=Vi.reducer,Re=R(t=>t.uuid),Qy={instances:{}},Bi=o.createSlice({name:"issues",initialState:Qy,extraReducers:t=>t.addMatcher(o.isAnyOf(_,C,w),s=>Object.assign(s,Qy)),reducers:{initializeIssues:Re.initialize,addIssue:Re.addOne,addIssues:Re.addMany,setIssue:Re.setOne,setIssues:Re.setMany,updateIssue:Re.updateOne,updateIssues:Re.updateMany,deleteIssue:Re.deleteOne,deleteIssues:Re.deleteMany}}),{initializeIssues:xy,addIssue:ep,addIssues:ji,setIssue:tp,setIssues:sp,updateIssue:ip,updateIssues:np,deleteIssue:ap,deleteIssues:qi}=Bi.actions,cp=t=>t.issueReducer.instances,Rt=o.createSelector([cp],t=>Object.values(t)),dp=t=>s=>s.issueReducer.instances[t],rp=S(o.createSelector([Rt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),dP=S(o.createSelector([Rt,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),up=S(o.createSelector([Rt,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s))),lp=Bi.reducer,we=R(t=>t.uuid),op={instances:{}},Ci=o.createSlice({name:"issueTypeAttachments",initialState:op,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,op)),reducers:{initializeIssueTypeAttachments:we.initialize,addIssueTypeAttachment:we.addOne,addIssueTypeAttachments:we.addMany,setIssueTypeAttachment:we.setOne,setIssueTypeAttachments:we.setMany,updateIssueTypeAttachment:we.updateOne,updateIssueTypeAttachments:we.updateMany,deleteIssueTypeAttachment:we.deleteOne,deleteIssueTypeAttachments:we.deleteMany}}),{initializeIssueTypeAttachments:hp,addIssueTypeAttachment:mp,addIssueTypeAttachments:yp,setIssueTypeAttachment:pp,setIssueTypeAttachments:Ap,updateIssueTypeAttachment:fp,updateIssueTypeAttachments:Sp,deleteIssueTypeAttachment:Tp,deleteIssueTypeAttachments:Ip}=Ci.actions,Op=t=>t.issueTypeAttachmentReducer.instances,Di=o.createSelector([Op],t=>Object.values(t)),Pp=t=>s=>s.issueTypeAttachmentReducer.instances[t],Fp=S(o.createSelector([Di,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),rP=S(o.createSelector([Di,(t,s)=>s],(t,s)=>T(t.filter(({issue_type:e})=>s===e)))),gp=Ci.reducer,ve=R(t=>t.uuid),bp={instances:{}},$i=o.createSlice({name:"issueTypeFieldsAttachments",initialState:bp,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,bp)),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:_p,addIssueTypeFieldsAttachment:Mp,addIssueTypeFieldsAttachments:Rp,setIssueTypeFieldsAttachment:wp,setIssueTypeFieldsAttachments:vp,updateIssueTypeFieldsAttachment:Ep,updateIssueTypeFieldsAttachments:Vp,deleteIssueTypeFieldsAttachment:zp,deleteIssueTypeFieldsAttachments:Bp}=$i.actions,jp=t=>t.issueTypeFieldsAttachmentReducer.instances,Ui=o.createSelector([jp],t=>Object.values(t)),uP=S(o.createSelector([Ui,(t,s)=>s],(t,s)=>T(t.filter(e=>e.fields_revision===s)))),qp=t=>s=>s.issueTypeFieldsAttachmentReducer.instances[t],Cp=S(o.createSelector([Ui,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Dp=$i.reducer,Ee=R(t=>t.uuid),$p={instances:{}},Li=o.createSlice({name:"issueTypeFieldValues",initialState:$p,extraReducers:t=>t.addMatcher(o.isAnyOf(_,C,w),s=>Object.assign(s,$p)),reducers:{initializeIssueTypeFieldValues:Ee.initialize,addIssueTypeFieldValues:Ee.addOne,addIssueTypeFieldValuesMany:Ee.addMany,setIssueTypeFieldValues:Ee.setOne,setIssueTypeFieldValuesMany:Ee.setMany,updateIssueTypeFieldValues:Ee.updateOne,updateIssueTypeFieldValuesMany:Ee.updateMany,deleteIssueTypeFieldValues:Ee.deleteOne,deleteIssueTypeFieldValuesMany:Ee.deleteMany}}),{initializeIssueTypeFieldValues:Up,addIssueTypeFieldValues:Lp,addIssueTypeFieldValuesMany:kp,setIssueTypeFieldValues:Np,setIssueTypeFieldValuesMany:Gp,updateIssueTypeFieldValues:Hp,updateIssueTypeFieldValuesMany:Wp,deleteIssueTypeFieldValues:Kp,deleteIssueTypeFieldValuesMany:Yp}=Li.actions,Zp=t=>t.issueTypeFieldValuesReducer.instances,wt=o.createSelector([Zp],t=>Object.values(t)),lP=S(o.createSelector([wt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.issue===s)))),Jp=t=>s=>s.issueTypeFieldValuesReducer.instances[t],Xp=S(o.createSelector([wt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Qp=Li.reducer,Ve=R(t=>t.uuid),xp={instances:{}},ki=o.createSlice({name:"issueTypeFields",initialState:xp,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,xp)),reducers:{initializeIssueTypeFields:Ve.initialize,addIssueTypeFields:Ve.addOne,addIssueTypeFieldsMany:Ve.addMany,setIssueTypeFields:Ve.setOne,setIssueTypeFieldsMany:Ve.setMany,updateIssueTypeFields:Ve.updateOne,updateIssueTypeFieldsMany:Ve.updateMany,deleteIssueTypeFields:Ve.deleteOne,deleteIssueTypeFieldsMany:Ve.deleteMany}}),{initializeIssueTypeFields:eA,addIssueTypeFields:tA,addIssueTypeFieldsMany:sA,setIssueTypeFields:iA,setIssueTypeFieldsMany:nA,updateIssueTypeFields:aA,updateIssueTypeFieldsMany:cA,deleteIssueTypeFields:dA,deleteIssueTypeFieldsMany:rA}=ki.actions,uA=t=>t.issueTypeFieldsReducer.instances,rt=o.createSelector([uA],t=>Object.values(t)),oP=S(o.createSelector([rt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.issue_type===s)))),hP=S(o.createSelector([rt,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),mP=S(o.createSelector([rt,wt,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(a=>a.issue_type===e).map(a=>a.uuid));return T(s.filter(a=>n.has(a.fields_revision)))})),lA=t=>s=>s.issueTypeFieldsReducer.instances[t],oA=S(o.createSelector([rt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),hA=ki.reducer,ze=R(t=>t.uuid),mA={instances:{}},Ni=o.createSlice({name:"issueTypeFieldValuesAttachments",initialState:mA,extraReducers:t=>t.addMatcher(o.isAnyOf(_,C,w),s=>Object.assign(s,mA)),reducers:{initializeIssueTypeFieldValuesAttachments:ze.initialize,addIssueTypeFieldValuesAttachment:ze.addOne,addIssueTypeFieldValuesAttachments:ze.addMany,setIssueTypeFieldValuesAttachment:ze.setOne,setIssueTypeFieldValuesAttachments:ze.setMany,updateIssueTypeFieldValuesAttachment:ze.updateOne,updateIssueTypeFieldValuesAttachments:ze.updateMany,deleteIssueTypeFieldValuesAttachment:ze.deleteOne,deleteIssueTypeFieldValuesAttachments:ze.deleteMany}}),{initializeIssueTypeFieldValuesAttachments:yA,addIssueTypeFieldValuesAttachment:pA,addIssueTypeFieldValuesAttachments:Gi,setIssueTypeFieldValuesAttachment:AA,setIssueTypeFieldValuesAttachments:fA,updateIssueTypeFieldValuesAttachment:SA,updateIssueTypeFieldValuesAttachments:TA,deleteIssueTypeFieldValuesAttachment:IA,deleteIssueTypeFieldValuesAttachments:Hi}=Ni.actions,OA=t=>t.issueTypeFieldValuesAttachmentReducer.instances,Wi=o.createSelector([OA],t=>Object.values(t)),PA=t=>s=>s.issueTypeFieldValuesAttachmentReducer.instances[t],FA=S(o.createSelector([Wi,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),gA=S(o.createSelector([Wi,(t,s)=>s],(t,s)=>T(t.filter(e=>e.field_values===s)))),bA=Ni.reducer,Be=R(t=>t.uuid),_A={instances:{}},Ki=o.createSlice({name:"issueTypeIdentifiers",initialState:_A,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,_A)),reducers:{initializeIssueTypeIdentifiers:Be.initialize,addIssueTypeIdentifier:Be.addOne,addIssueTypeIdentifiers:Be.addMany,setIssueTypeIdentifier:Be.setOne,setIssueTypeIdentifiers:Be.setMany,updateIssueTypeIdentifier:Be.updateOne,updateIssueTypeIdentifiers:Be.updateMany,deleteIssueTypeIdentifier:Be.deleteOne,deleteIssueTypeIdentifiers:Be.deleteMany}}),{initializeIssueTypeIdentifiers:MA,addIssueTypeIdentifier:RA,addIssueTypeIdentifiers:wA,setIssueTypeIdentifier:vA,setIssueTypeIdentifiers:EA,updateIssueTypeIdentifier:VA,updateIssueTypeIdentifiers:zA,deleteIssueTypeIdentifier:BA,deleteIssueTypeIdentifiers:jA}=Ki.actions,qA=t=>t.issueTypeIdentifierReducer.instances,Yi=o.createSelector([qA],t=>Object.values(t)),CA=t=>s=>s.issueTypeIdentifierReducer.instances[t],DA=S(o.createSelector([Yi,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),yP=S(o.createSelector([Yi,(t,s)=>s],(t,s)=>T(t.filter(e=>e.issue_type===s)))),$A=Ki.reducer,je=R(t=>t.uuid),UA={instances:{}},Zi=o.createSlice({name:"issueTypeIdentifierValues",initialState:UA,extraReducers:t=>t.addMatcher(o.isAnyOf(_,C,w),s=>Object.assign(s,UA)),reducers:{initializeIssueTypeIdentifierValues:je.initialize,addIssueTypeIdentifierValue:je.addOne,addIssueTypeIdentifierValues:je.addMany,setIssueTypeIdentifierValue:je.setOne,setIssueTypeIdentifierValues:je.setMany,updateIssueTypeIdentifierValue:je.updateOne,updateIssueTypeIdentifierValues:je.updateMany,deleteIssueTypeIdentifierValue:je.deleteOne,deleteIssueTypeIdentifierValues:je.deleteMany}}),{initializeIssueTypeIdentifierValues:LA,addIssueTypeIdentifierValue:kA,addIssueTypeIdentifierValues:NA,setIssueTypeIdentifierValue:GA,setIssueTypeIdentifierValues:HA,updateIssueTypeIdentifierValue:WA,updateIssueTypeIdentifierValues:KA,deleteIssueTypeIdentifierValue:YA,deleteIssueTypeIdentifierValues:ZA}=Zi.actions,JA=t=>t.issueTypeIdentifierValueReducer.instances,vt=o.createSelector([JA],t=>Object.values(t)),XA=t=>s=>s.issueTypeIdentifierValueReducer.instances[t],QA=S(o.createSelector([vt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),pP=S(o.createSelector([vt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.issue===s)))),AP=S(o.createSelector([vt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.issue_type_identifier===s)))),xA=Zi.reducer,qe=R(t=>t.uuid),ef={instances:{}},Ji=o.createSlice({name:"issueTypes",initialState:ef,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,ef)),reducers:{initializeIssueTypes:qe.initialize,addIssueType:qe.addOne,addIssueTypes:qe.addMany,setIssueType:qe.setOne,setIssueTypes:qe.setMany,updateIssueType:qe.updateOne,updateIssueTypes:qe.updateMany,deleteIssueType:qe.deleteOne,deleteIssueTypes:qe.deleteMany}}),{initializeIssueTypes:tf,addIssueType:sf,addIssueTypes:nf,setIssueType:af,setIssueTypes:cf,updateIssueType:df,updateIssueTypes:rf,deleteIssueType:uf,deleteIssueTypes:lf}=Ji.actions,of=t=>t.issueTypeReducer.instances,Xi=o.createSelector(of,t=>Object.values(t)),hf=t=>s=>s.issueTypeReducer.instances[t],mf=S(o.createSelector([Xi,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),fP=S(o.createSelector([Xi,(t,s)=>s],(t,s)=>T(t.filter(e=>e.organization===s)))),yf=Ji.reducer,Ce=R(t=>t.uuid),pf={instances:{}},Qi=o.createSlice({name:"issueUpdates",initialState:pf,extraReducers:t=>t.addMatcher(o.isAnyOf(_,C,w),s=>Object.assign(s,pf)),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:Af,addIssueUpdate:xi,addIssueUpdates:en,setIssueUpdate:ff,setIssueUpdates:Sf,updateIssueUpdate:Tf,updateIssueUpdates:If,deleteIssueUpdate:tn,deleteIssueUpdates:sn}=Qi.actions,nn=t=>t.issueUpdateReducer.instances,an=o.createSelector([nn],t=>Object.values(t)),Of=S(o.createSelector([nn,(t,s)=>s],(t,s)=>t[s])),Pf=S(o.createSelector([an,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Ff=S(o.createSelector([an,(t,s)=>s],(t,s)=>T(t.filter(e=>e.issue===s)))),gf=Qi.reducer,De=R(t=>t.uuid),bf={instances:{},currentUser:null},cn=o.createSlice({name:"users",initialState:bf,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,bf)),reducers:{initializeUsers:De.initialize,setUsers:De.setMany,setUser:De.setOne,addUsers:De.addMany,addUser:De.addOne,updateUsers:De.updateMany,updateUser:De.updateOne,deleteUser:De.deleteOne,deleteUsers:De.deleteMany,setCurrentUser:(t,s)=>{t.currentUser=s.payload}}}),{initializeUsers:_f,setUsers:Mf,setUser:Rf,addUsers:wf,addUser:dn,updateUsers:vf,updateUser:Ef,deleteUser:rn,deleteUsers:Vf,setCurrentUser:SP}=cn.actions,zf=cn.reducer,Bf=t=>t.userReducer.currentUser,un=t=>t.userReducer.instances,Et=o.createSelector([un],t=>Object.values(t)),Vt=t=>s=>s.userReducer.instances[t],jf=S(o.createSelector([Et,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),$e=R(t=>t.uuid),qf={instances:{}},ln=o.createSlice({name:"organizationAccess",initialState:qf,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,qf)),reducers:{initializeOrganizationAccesses:$e.initialize,addOrganizationAccess:$e.addOne,addOrganizationAccesses:$e.addMany,setOrganizationAccess:$e.setOne,setOrganizationAccesses:$e.setMany,updateOrganizationAccess:$e.updateOne,updateOrganizationAccesses:$e.updateMany,deleteOrganizationAccess:$e.deleteOne,deleteOrganizationAccesses:$e.deleteMany}}),{initializeOrganizationAccesses:Cf,addOrganizationAccess:Df,addOrganizationAccesses:$f,setOrganizationAccess:Uf,setOrganizationAccesses:Lf,updateOrganizationAccess:kf,updateOrganizationAccesses:Nf,deleteOrganizationAccess:Gf,deleteOrganizationAccesses:Hf}=ln.actions,Wf=ln.reducer,zt=t=>t.organizationAccessReducer.instances,Kf=t=>s=>s.organizationAccessReducer.instances[t],Yf=S(o.createSelector([zt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(Object.values(t).filter(({uuid:n})=>e.has(n)))})),TP=o.createSelector([Bf,zt],(t,s)=>Object.values(s).find(n=>n.user===(t==null?void 0:t.uuid))??null),Zf=o.createSelector([zt],t=>{const s={};for(const e of Object.values(t))s[e.user]=e;return ht(s)}),IP=S(o.createSelector([un,Zf,(t,s)=>s],(t,s,e)=>T(Object.values(t).filter(n=>{const a=s[n.uuid];return!!a&&a.organization===e})))),Ue=R(t=>t.uuid),Jf={instances:{}},on=o.createSlice({name:"organizations",initialState:Jf,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,Jf)),reducers:{initializeOrganizations:Ue.initialize,setOrganizations:Ue.setMany,setOrganization:Ue.setOne,addOrganizations:Ue.addMany,addOrganization:Ue.addOne,updateOrganizations:Ue.updateMany,updateOrganization:Ue.updateOne,deleteOrganization:Ue.deleteOne,deleteOrganizations:Ue.deleteMany}}),{initializeOrganizations:Xf,setOrganizations:Qf,setOrganization:xf,addOrganizations:eS,addOrganization:tS,updateOrganizations:sS,updateOrganization:iS,deleteOrganization:nS,deleteOrganizations:aS}=on.actions,cS=t=>t.organizationReducer.instances,dS=o.createSelector([cS],t=>Object.values(t)),rS=t=>s=>s.organizationReducer.instances[t],uS=S(o.createSelector([dS,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),lS=on.reducer,oS=(t,s,e)=>{const n=t.uuid?t:{...t,uuid:xe.v4()};return{payload:n,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:n,BASE_URL:s,serviceName:e}}}}},hS={deletedRequests:[],latestRetryTime:0},hn=o.createSlice({name:"outbox",initialState:hS,extraReducers:t=>t.addCase(_,s=>Object.assign(s,hS)),reducers:{enqueueRequest:{reducer:(t,s)=>t,prepare:t=>{console.debug("Preparing to enqueue request",t);const{BASE_URL:s,serviceName:e,...n}=t;return oS(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}}}),OP=t=>t.outboxReducer.deletedRequests,PP=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:mS,markForDeletion:FP,markAsDeleted:yS,_setLatestRetryTime:pS}=hn.actions,AS=hn.reducer,Le=R(t=>t.uuid),fS={instances:{}},mn=o.createSlice({name:"projectAccess",initialState:fS,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,fS)),reducers:{initializeProjectAccesses:Le.initialize,addProjectAccess:Le.addOne,addProjectAccesses:Le.addMany,setProjectAccess:Le.setOne,setProjectAccesses:Le.setMany,updateProjectAccess:Le.updateOne,updateProjectAccesses:Le.updateMany,deleteProjectAccess:Le.deleteOne,deleteProjectAccesses:Le.deleteMany}}),{initializeProjectAccesses:SS,addProjectAccess:TS,addProjectAccesses:IS,setProjectAccess:OS,setProjectAccesses:PS,updateProjectAccess:FS,updateProjectAccesses:gS,deleteProjectAccess:bS,deleteProjectAccesses:_S}=mn.actions,MS=mn.reducer,yn=t=>t.projectAccessReducer.instances,ut=o.createSelector(yn,t=>Object.values(t)),RS=t=>s=>s.projectAccessReducer.instances[t],wS=S(o.createSelector([ut,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),gP=S(o.createSelector([yn,(t,s)=>s],(t,s)=>T(Object.values(t).filter(e=>e.project===s)))),bP=S(o.createSelector([ut,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.project===s))e[n.user]=n;return e})),_P=S(o.createSelector([Et,ut,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.project===e).map(a=>a.user));return T(t.filter(a=>n.has(a.uuid)))})),ke=R(t=>t.uuid),vS={instances:{}},pn=o.createSlice({name:"projectAttachments",initialState:vS,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,vS)),reducers:{initializeProjectAttachments:ke.initialize,addProjectAttachment:ke.addOne,addProjectAttachments:ke.addMany,setProjectAttachment:ke.setOne,setProjectAttachments:ke.setMany,updateProjectAttachment:ke.updateOne,updateProjectAttachments:ke.updateMany,deleteProjectAttachment:ke.deleteOne,deleteProjectAttachments:ke.deleteMany}}),{initializeProjectAttachments:ES,addProjectAttachment:VS,addProjectAttachments:zS,setProjectAttachment:BS,setProjectAttachments:jS,updateProjectAttachment:qS,updateProjectAttachments:CS,deleteProjectAttachment:DS,deleteProjectAttachments:$S}=pn.actions,US=t=>t.projectAttachmentReducer.instances,An=o.createSelector([US],t=>Object.values(t)),LS=t=>s=>s.projectAttachmentReducer.instances[t],kS=S(o.createSelector([An,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),MP=S(o.createSelector([An,(t,s)=>s],(t,s)=>T(t.filter(({project:e})=>s===e)))),NS=pn.reducer,Ne=R(t=>t.uuid),GS={instances:{},activeProjectFileId:null,isImportingProjectFile:!1},fn=o.createSlice({name:"projectFiles",initialState:GS,extraReducers:t=>t.addMatcher(o.isAnyOf(_,C,w),s=>Object.assign(s,GS)),reducers:{initializeProjectFiles:Ne.initialize,setProjectFile:Ne.setOne,setProjectFiles:Ne.setMany,addProjectFile:Ne.addOne,addProjectFiles:Ne.addMany,updateProjectFile:Ne.updateOne,updateProjectFiles:Ne.updateMany,deleteProjectFile:Ne.deleteOne,deleteProjectFiles:Ne.deleteMany,setIsImportingProjectFile:(t,s)=>{t.isImportingProjectFile=s.payload},saveActiveProjectFileBounds:(t,s)=>{const e=t.activeProjectFileId;if(!e)throw new Error("Tried to save bounds for active project file, but no active project file was set.");if(!t.instances[e])throw new Error(`Tried to save bounds for active project file, but project file with ID ${e}
2
2
  doesn't exist.`);t.instances[e].bounds=s.payload},setActiveProjectFileId:(t,s)=>{t.activeProjectFileId=s.payload}}}),{initializeProjectFiles:HS,setProjectFile:WS,setProjectFiles:KS,addProjectFile:YS,addProjectFiles:ZS,updateProjectFile:JS,updateProjectFiles:XS,deleteProjectFile:QS,deleteProjectFiles:xS,setIsImportingProjectFile:eT,setActiveProjectFileId:tT,saveActiveProjectFileBounds:sT}=fn.actions,iT=t=>t.projectFileReducer.instances,nT=o.createSelector([iT],t=>T(Object.values(t).sort((s,e)=>s.z_index-e.z_index))),aT=t=>s=>s.projectFileReducer.instances[t],cT=S(o.createSelector([nT,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),RP=t=>t.projectFileReducer.activeProjectFileId,wP=t=>t.projectFileReducer.isImportingProjectFile,dT=fn.reducer,Ge=R(t=>t.uuid),rT={instances:{}},Sn=o.createSlice({name:"projects",initialState:rT,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,rT)),reducers:{initializeProjects:Ge.initialize,setProjects:Ge.setMany,setProject:Ge.setOne,addProjects:Ge.addMany,addProject:Ge.addOne,updateProjects:Ge.updateMany,updateProject:Ge.updateOne,deleteProject:Ge.deleteOne,deleteProjects:Ge.deleteMany}}),{initializeProjects:uT,setProjects:lT,setProject:oT,addProjects:hT,addProject:mT,updateProjects:yT,updateProject:pT,deleteProject:AT,deleteProjects:fT}=Sn.actions,ST=Sn.reducer,TT=t=>t.projectReducer.instances,Bt=o.createSelector([TT],t=>Object.values(t)),IT=t=>s=>s.projectReducer.instances[t],OT=S(o.createSelector([Bt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),vP=S(o.createSelector([Bt,ut,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.user===e).map(a=>a.project));return T(t.filter(a=>n.has(a.uuid)))})),EP=S(o.createSelector([Bt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.organization===s)))),VP={isRehydrated:!1},Tn=o.createSlice({name:"rehydrated",initialState:VP,reducers:{setRehydrated:(t,s)=>{t.isRehydrated=s.payload}}}),{setRehydrated:zP}=Tn.actions,BP=t=>t.rehydratedReducer.isRehydrated,PT=Tn.reducer,He=R(t=>t.uuid),FT={instances:{}},In=o.createSlice({name:"teamMemberships",initialState:FT,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,FT)),reducers:{initializeTeamMemberships:He.initialize,addTeamMembership:He.addOne,addTeamMemberships:He.addMany,setTeamMembership:He.setOne,setTeamMemberships:He.setMany,updateTeamMembership:He.updateOne,updateTeamMemberships:He.updateMany,deleteTeamMembership:He.deleteOne,deleteTeamMemberships:He.deleteMany}}),{initializeTeamMemberships:gT,addTeamMembership:bT,addTeamMemberships:_T,setTeamMembership:MT,setTeamMemberships:RT,updateTeamMembership:wT,updateTeamMemberships:vT,deleteTeamMembership:ET,deleteTeamMemberships:VT}=In.actions,zT=In.reducer,BT=t=>t.teamMembershipReducer.instances,jt=o.createSelector([BT],t=>Object.values(t)),jT=t=>s=>s.teamMembershipReducer.instances[t],qT=S(o.createSelector([jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),jP=S(o.createSelector([jt,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.team===s))e[n.user]=n;return e})),qP=S(o.createSelector([Et,jt,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.team===e).map(a=>a.user));return T(t.filter(a=>n.has(a.uuid)))})),We=R(t=>t.uuid),CT={instances:{}},On=o.createSlice({name:"teams",initialState:CT,extraReducers:t=>t.addMatcher(o.isAnyOf(_,w),s=>Object.assign(s,CT)),reducers:{initializeTeams:We.initialize,addTeam:We.addOne,addTeams:We.addMany,setTeam:We.setOne,setTeams:We.setMany,updateTeam:We.updateOne,updateTeams:We.updateMany,deleteTeam:We.deleteOne,deleteTeams:We.deleteMany}}),{initializeTeams:DT,addTeam:$T,addTeams:UT,setTeam:LT,setTeams:kT,updateTeam:NT,updateTeams:GT,deleteTeam:HT,deleteTeams:WT}=On.actions,KT=t=>t.teamReducer.instances,Pn=o.createSelector([KT],t=>Object.values(t)),YT=t=>s=>s.teamReducer.instances[t],ZT=S(o.createSelector([Pn,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),CP=S(o.createSelector([Pn,(t,s)=>s],(t,s)=>T(t.filter(e=>e.organization===s)))),JT=On.reducer,DP={version:0},XT=o.createSlice({name:"versioning",initialState:DP,reducers:{}}),QT=XT.reducer,Fn={outboxReducer:AS,fileReducer:xo,authReducer:co},$P=o.combineReducers(Fn),xT={...Fn,[nt]:QT,categoryReducer:Io,assetReducer:Mr,assetAttachmentReducer:ha,assetStageCompletionReducer:Dr,assetStageReducer:xr,assetTypeReducer:io,assetTypeAttachmentReducer:yu,issueReducer:lp,issueAttachmentReducer:gy,issueTypeReducer:yf,issueTypeAttachmentReducer:gp,organizationReducer:lS,projectReducer:ST,projectAttachmentReducer:NS,projectAccessReducer:MS,organizationAccessReducer:Wf,projectFileReducer:dT,rehydratedReducer:PT,formReducer:rm,formRevisionReducer:Xh,formRevisionAttachmentReducer:Lh,formSubmissionAttachmentReducer:Fm,formSubmissionReducer:qm,formIdentifierReducer:mh,formIdentifierValueReducer:Mh,userReducer:zf,documentsReducer:Ho,documentAttachmentReducer:Bo,teamReducer:JT,agentsReducer:xn,issueCommentReducer:Xy,issueCommentAttachmentReducer:Dy,issueUpdateReducer:gf,geoImageReducer:Jm,issueAssociationReducer:oy,issueTypeFieldsReducer:hA,issueTypeFieldValuesReducer:Qp,issueTypeFieldsAttachmentReducer:Dp,issueTypeFieldValuesAttachmentReducer:bA,issueTypeIdentifierReducer:$A,issueTypeIdentifierValueReducer:xA,assetTypeFieldsReducer:ku,assetTypeFieldValuesReducer:pl,assetTypeFieldsAttachmentReducer:Ru,assetTypeFieldValuesAttachmentReducer:tl,assetTypeIdentifierReducer:wl,assetTypeIdentifierValueReducer:Nl,assetProcedureTypeReducer:Xc,assetProcedureReducer:qc,assetProcedureTypeFieldsReducer:Xa,assetProcedureTypeFieldValuesReducer:gc,assetProcedureTypeFieldsAttachmentReducer:Ca,assetProcedureTypeFieldValuesAttachmentReducer:uc,assetProcedureTypeAttachmentReducer:Fa,assetProcedureStepFieldsAttachmentReducer:yd,assetProcedureStepFieldsReducer:Md,assetProcedureStepFieldValuesAttachmentReducer:Ud,assetProcedureStepFieldValuesReducer:er,assetProcedureStepReducer:or,teamMembershipReducer:zT},UP=o.combineReducers(xT),eI=1e4,tI=200,gn=[400,409,403,404,405,500],Ye=1e4,sI={};class iI{constructor(s){y(this,"client");y(this,"pageSize",eI);sI[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 nI=()=>dI.length-1,aI=t=>(t[nt]={version:nI()},t),cI=()=>aI({}),LP=t=>(t.outboxReducer&&(t.outboxReducer.deletedRequests=[]),t),kP=t=>s=>{var e;return s===void 0&&(s={}),((e=s[nt])==null?void 0:e.version)===nI()?s:t(s)},dI=[aI,cI,cI,LP],NP=Object.fromEntries(dI.map((t,s)=>[s,kP(t)])),GP=t=>{if(t)throw t;const s=it();s?s.dispatch({type:"rehydrated/setRehydrated",payload:!0}):console.error("Client store not set")},rI=(t,s,e)=>{const n=Xe();return n?(n.addRequest(s),n.getQueue()):(console.warn("Outbox coordinator not set; cannot enqueue request yet."),[])},uI=(t,s,e)=>{const n=Xe();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 HP(t,s){if(!s.payload)throw new Error("Received empty payload");return PI(s)}const WP={...Vn,effect:HP,discard:oI,returnPromises:!0,persistCallback:GP,retry:JP,persistOptions:{storage:wI},queue:{...Vn.queue,enqueue:rI,dequeue:uI,peek:(...t)=>ZP(...t)}},KP=vI(NP,nt),YP=o.compose(RI.offline(WP),KP);async function lI(t,s,e){if(s.store.getState().outboxReducer.deletedRequests.includes(t.payload.uuid))throw new Error("Request was marked for deletion");const a=sI[t.meta.offline.effect.serviceName];if(!a)throw new Error(`Service ${t.meta.offline.effect.serviceName} not found`);return Rn(t.meta.offline.effect.BASE_URL,t.meta.offline.effect.request,s,a,e)}function oI(t,s,e=0){var d;if(console.debug("Considering discarding request due to error:",t,`(${typeof t})`,`
3
- Action:`,s,`
4
- Retries:`,e),!(t instanceof Error))throw console.error("ENCOUNTERED NON-ERROR ERROR:",t,"(throwing immediately, which may lead to unexpected behavior)"),t;const n=it(),c=n.getState().outboxReducer.deletedRequests,r=s.payload.uuid;function l(){n.dispatch(yS(r));const h=Xe();if(!h)throw new Error("Outbox coordinator not set");h.remove(s.payload.uuid);const p=s.meta.offline.rollback;throw p&&(console.warn("Rolling back request due to SDK error:",s),n.dispatch(p)),t}if(t instanceof U&&t.options.discard&&(console.debug("Discarding request due to explicit discard:",s),l()),c.includes(r)&&(console.debug("Discarding request due to deletion:",s),l()),t instanceof U){const h=t.status||((d=t.response)==null?void 0:d.status);if(h||console.warn("Error has no status code:",t),h!==void 0&&gn.includes(h)){console.warn("Discarding request due to error:",t,`
3
+ Url:`,s.payload.url,`
4
+ Retries:`,e),!(t instanceof Error))throw console.error("ENCOUNTERED NON-ERROR ERROR:",t,"(throwing immediately, which may lead to unexpected behavior)"),t;const n=it(),c=n.getState().outboxReducer.deletedRequests,r=s.payload.uuid;function l(){n.dispatch(yS(r));const h=Xe();if(!h)throw new Error("Outbox coordinator not set");h.remove(s.payload.uuid);const p=s.meta.offline.rollback;throw p&&(console.warn("Rolling back request due to SDK error:",s),n.dispatch(p)),t}if(t instanceof U&&t.options.discard&&(console.debug("Discarding request due to explicit discard:",s.payload.url),l()),c.includes(r)&&(console.debug("Discarding request due to deletion:",s.payload.url),l()),t instanceof U){const h=t.status||((d=t.response)==null?void 0:d.status);if(h||console.warn("Error has no status code:",t),h!==void 0&&gn.includes(h)){console.warn("Discarding request due to error:",t,`
5
5
  Action:`,s);const p=Xe();if(!p)throw new Error("Outbox coordinator not set");p.remove(s.payload.uuid),t.options.discard=!0,l()}}console.debug("Registering a retry for request:",s.payload.uuid);const u=Xe();if(!u)throw new Error("Outbox coordinator not set");return u.registerRetry(s.payload.uuid),!1}function ZP(t,s,e){var n;return(n=Xe())==null?void 0:n.peek()}function JP(t,s){return it().dispatch(pS(new Date().getTime())),Cn}const tt="An unknown error occurred",XP=500,hI=["non_field_errors","detail"];function QP(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"?hI.includes(a)?c:`${a}: ${c}`:Array.isArray(c)?hI.includes(a)?c.join(`
6
6
  `):c.map(r=>`${a}: ${r}`).join(`
7
7
  `):`${a}: ${JSON.stringify(c)}`).join(`
@@ -11,5 +11,5 @@ Action:`,s);const p=Xe();if(!p)throw new Error("Outbox coordinator not set");p.r
11
11
  REST API, you will be requesting localhost:80 (where this app runs), resulting in a transformed blob
12
12
  (with an uuid attached) being returned. Alternatively, you may be running with
13
13
  import.meta.env.PROD, which will result in some file requests being treated as
14
- external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(f)}const p=d.type.split("/")[1];if(!p)throw new Error("File has no extension");const A=a??h+"."+p;if(d=$n(d,A),!d.name)throw new Error("Failed to set file's name");await this.addCache(d,h),qt[c]=new Promise(f=>{f(d)})}return d}processPresignedUrls(e){const n={};for(const[a,c]of Object.entries(e))n[a]=this.enqueueRequest({url:c.url,description:"Upload file to S3",method:m.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:a,blockers:[`s3-${c.fields.key}`],blocks:[a],s3url:c});return n}async getFilePayload(e){const n=await et(e),a={sha1:n,file_type:e.type,extension:e.name.split(".").pop(),size:e.size};return await this.client.files.addCache(e,n),a}}class EF extends E{constructor(){super(...arguments);y(this,"name","Form Identifier");y(this,"url","/form-identifiers");y(this,"actions",{addOne:sh,addMany:ih,setOne:nh,setMany:ah,updateOne:ch,updateMany:dh,deleteOne:rh,deleteMany:uh,initialize:th});y(this,"selectors",{selectById:oh,selectByIds:hh})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.uuid)??null,u=new Date().toISOString(),d=M({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[d.form],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,h]}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 l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(()=>{this.dispatch(a(r))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(u)),d}}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 VF extends E{constructor(){super(...arguments);y(this,"name","Form Identifier Value");y(this,"url","/form-identifier-values");y(this,"actions",{addOne:Ah,addMany:fh,setOne:Sh,setMany:Th,updateOne:Ih,updateMany:Oh,deleteOne:Ph,deleteMany:Fh,initialize:ph});y(this,"selectors",{selectById:bh,selectByIds:_h})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.uuid)??null,u=new Date().toISOString(),d=M({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[e.form_submission,e.form_identifier],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,h]}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 value with uuid ${e.uuid} to exist`);const l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(()=>{this.dispatch(a(r))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(u)),d}}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 zF extends E{constructor(){super(...arguments);y(this,"name","Form Revision Attachment");y(this,"url","/form-revision-attachments");y(this,"actions",{addOne:vh,addMany:Eh,setOne:Vh,setMany:zh,updateOne:Bh,updateMany:jh,deleteOne:qh,deleteMany:Ch,initialize:wh});y(this,"selectors",{selectById:$h,selectByIds:Uh})}async bulkAdd(e){var A;const{addMany:n,setMany:a,deleteMany:c}=this.actions,r=new Date().toISOString(),l=((A=this.client.store.getState().userReducer.currentUser)==null?void 0:A.uuid)??null,u={},d=[],h=[];for(const f of e){const{revisionUuid:I,fieldIdentifier:F,file:P}=f,g=await this.client.files.getFilePayload(P);g.sha1 in u||(u[g.sha1]=g);const b=M({file:URL.createObjectURL(P),file_type:P.type,file_name:P.name,file_sha1:g.sha1,created_by:l,form_revision:I,submitted_at:r,field_identifier:F});d.push(b);const v={uuid:b.uuid,file_name:P.name,field_identifier:F,file_extension:g.extension,file_sha1:g.sha1,form_revision:I};h.push(v)}this.dispatch(n(d));const p=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:r,attachments:h,files:Object.values(u)},blockers:d.map(f=>f.form_revision),blocks:d.map(f=>f.uuid)});return p.then(f=>{this.client.files.processPresignedUrls(f.presigned_urls),this.dispatch(a(f.attachments))}).catch(()=>{this.dispatch(c(d.map(f=>f.uuid)))}),[d,p.then(({attachments:f})=>f)]}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 BF extends E{constructor(){super(...arguments);y(this,"name","Form Revision");y(this,"url","/form-revisions");y(this,"actions",{addOne:ci,addMany:di,setOne:Gh,setMany:Hh,updateOne:Wh,updateMany:Kh,deleteOne:ri,deleteMany:ui,initialize:Nh});y(this,"selectors",{selectById:Yh,selectByIds:Zh})}add(e){var A;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,u=((A=n.getState().userReducer.currentUser)==null?void 0:A.uuid)??null,d=new Date().toISOString(),h=M({...e,created_by:u,submitted_at:d});this.dispatch(a(h));const p=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(h),blockers:[e.form],blocks:[h.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(h.uuid))}),[h,p]}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 jF extends E{constructor(){super(...arguments);y(this,"name","Form");y(this,"url","/forms");y(this,"actions",{addOne:em,addMany:tm,setOne:sm,setMany:im,updateOne:nm,updateMany:am,deleteOne:cm,deleteMany:dm,initialize:xh});y(this,"selectors",{selectById:lm,selectByIds:om})}add(e,n){var A;const{store:a}=this.client,{addOne:c,deleteOne:r}=this.actions,l=new Date().toISOString(),u=((A=a.getState().userReducer.currentUser)==null?void 0:A.uuid)??null,d=M({...e,submitted_at:l,created_by:u}),h=M({...n,form:d.uuid,submitted_at:l,created_by:u});this.dispatch(c(d)),this.dispatch(ci(h));const p=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:{...z(d),initial_revision:{uuid:h.uuid,submitted_at:h.submitted_at,title:h.title,description:h.description,fields:h.fields}},blockers:[],blocks:[d.uuid,h.uuid]});return p.catch(f=>{throw this.dispatch(r(d.uuid)),this.dispatch(ri(h.uuid)),f}),[d,h,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error("Expected form to exist");const d=jm(e)(l),h=Jh(e)(l);this.dispatch(a(e)),this.dispatch(Oi(D(d))),this.dispatch(ui(D(h)));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(u)),this.dispatch(di(h)),this.dispatch(Ii(d)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class qF extends E{constructor(){super(...arguments);y(this,"name","Form Submission Attachment");y(this,"url","/form-submission-attachments");y(this,"actions",{addOne:ym,addMany:yi,setOne:pm,setMany:Am,updateOne:fm,updateMany:Sm,deleteOne:Tm,deleteMany:pi,initialize:mm});y(this,"selectors",{selectById:Im,selectByIds:Om})}async bulkAdd(e){var A;const{addMany:n,setMany:a,deleteMany:c}=this.actions,r=new Date().toISOString(),l=((A=this.client.store.getState().userReducer.currentUser)==null?void 0:A.uuid)??null,u={},d=[],h=[];for(const f of e){const{submissionUuid:I,fieldIdentifier:F,file:P}=f,g=await this.client.files.getFilePayload(P);g.sha1 in u||(u[g.sha1]=g);const b=M({file:URL.createObjectURL(P),file_type:P.type,file_name:P.name,file_sha1:g.sha1,created_by:l,form_submission:I,submitted_at:r,field_identifier:F});d.push(b);const v={uuid:b.uuid,file_name:P.name,file_sha1:g.sha1,file_extension:g.extension,field_identifier:F,form_submission:I};h.push(v)}this.dispatch(n(d));const p=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:r,attachments:h,files:Object.values(u)},blockers:d.map(f=>f.form_submission),blocks:d.map(f=>f.uuid)});return p.then(f=>{this.client.files.processPresignedUrls(f.presigned_urls),this.dispatch(a(f.attachments))}).catch(f=>{throw this.dispatch(c(d.map(I=>I.uuid))),f}),[d,p.then(({attachments:f})=>f)]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,r=n.getState(),l=Si(e)(r);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!0),method:m.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:{form_submission__form_revision__form__organization:e}},n)).flat();return this.dispatch(a(r)),r}}class CF extends E{constructor(){super(...arguments);y(this,"name","Form Submission");y(this,"url","/form-submissions");y(this,"actions",{addOne:Rm,addMany:Ii,setOne:_m,setMany:Mm,updateOne:wm,updateMany:vm,deleteOne:Em,deleteMany:Oi,initialize:bm});y(this,"selectors",{selectById:zm,selectByIds:Bm})}add(e){var A;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,u=((A=n.getState().userReducer.currentUser)==null?void 0:A.uuid)??null,d=new Date().toISOString(),h=M({...e,created_by:u,submitted_at:d}),p=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(h),blockers:[e.form_revision],blocks:[h.uuid]});return this.dispatch(a(h)),p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(h.uuid))}),[h,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),l=c(e.uuid)(r);if(!l)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const u={...l,...e};this.dispatch(a(u));const d=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${u.uuid}/`,payload:e,blockers:[u.uuid],blocks:[u.uuid]});return d.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(l))}),[u,d]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected submission with uuid ${e} to exist`);const d=Pm(e)(l);this.dispatch(a(e)),this.dispatch(pi(D(d)));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(u)),this.dispatch(yi(d)),h}}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 DF extends E{constructor(){super(...arguments);y(this,"name","Geo Image");y(this,"url","/geo-images");y(this,"actions",{addOne:Lm,addMany:km,setOne:$m,setMany:Um,updateOne:Nm,updateMany:Gm,deleteOne:Hm,deleteMany:Wm,initialize:Dm});y(this,"selectors",{selectById:Ym,selectByIds:Zm})}async add(e){var F;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,{file:l,...u}=e,d=new Date().toISOString(),h=((F=n.getState().userReducer.currentUser)==null?void 0:F.uuid)??null,p=u.project,A=await this.client.files.getFilePayload(l),f=M({...u,file_name:l.name,file_sha1:A.sha1,file_type:l.type,file:URL.createObjectURL(l),submitted_at:d,created_by:h});this.dispatch(a(f));const I=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:{uuid:f.uuid,submitted_at:d,title:f.title,description:f.description,geo_marker:f.geo_marker,canvas_marker:f.canvas_marker,sha1:f.file_sha1,project:f.project,file_name:f.file_name,direction:f.direction,original_date:f.original_date,file:A},blocks:[p],blockers:[p]});return I.then(P=>{this.client.files.processPresignedUrls(P.presigned_urls),this.dispatch(c(P.geo_image))}).catch(()=>{this.dispatch(r(f.uuid))}),[f,I.then(P=>P.geo_image)]}async bulkAdd(e,n){var F;const{store:a}=this.client,{addMany:c,setMany:r,deleteMany:l}=this.actions,u=new Date().toISOString(),d=((F=a.getState().userReducer.currentUser)==null?void 0:F.uuid)??null,h=[],p=[],A=[],f={};for(const P of e){const{file:g,...b}=P,v=await this.client.files.getFilePayload(g);v.sha1 in f||(f[v.sha1]=v);const B=M({...b,file_name:g.name,file_sha1:v.sha1,file_type:g.type,file:URL.createObjectURL(g),submitted_at:u,created_by:d,project:n});h.push(B),p.push(B.uuid),A.push({uuid:B.uuid,sha1:B.file_sha1,file_name:B.file_name,title:B.title,description:B.description,geo_marker:B.geo_marker,canvas_marker:B.canvas_marker,direction:B.direction,original_date:B.original_date})}this.dispatch(c(h));const I=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:u,project:n,geo_images:A,files:Object.values(f)},blocks:[n],blockers:p});return I.then(P=>{this.client.files.processPresignedUrls(P.presigned_urls),this.dispatch(r(P.geo_images))}).catch(()=>{this.dispatch(l(p))}),[h,I.then(P=>P.geo_images)]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),l=c(e.uuid)(r);if(!l)throw new Error(`Map image with uuid ${e.uuid} does not exist in the store`);const u={...l,...e};this.dispatch(a(u));const d=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return d.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(l))}),[u,d]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Map image with uuid ${e} does not exist in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blocks:[e],blockers:[e]})}catch(d){throw this.dispatch(c(u)),d}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project:e}},n);return this.dispatch(a(c)),c}}class $F extends E{constructor(){super(...arguments);y(this,"name","Issue Association");y(this,"url","/issue-associations");y(this,"actions",{addOne:iy,addMany:_t,setOne:ey,setMany:xm,updateOne:ty,updateMany:sy,deleteOne:ny,deleteMany:Mt,initialize:Qm});y(this,"selectors",{selectById:cy,selectByIds:dy})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=new Date().toISOString(),u=((p=n.getState().userReducer.currentUser)==null?void 0:p.uuid)??null,d=M({...e,submitted_at:l,created_by:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,h]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=r(e)(n.getState());if(!l)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.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:{associated_issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class UF extends Ke{constructor(){super(...arguments);y(this,"name","Issue Attachment");y(this,"url","/issue-attachments");y(this,"actions",{addOne:yy,addMany:Mi,setOne:py,setMany:Ay,updateOne:fy,updateMany:Sy,deleteOne:Ty,deleteMany:Ri,initialize:my});y(this,"selectors",{selectById:Py,selectByIds:Fy})}getId(e){return e.uuid}buildModel(e){return M({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,issue:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,issue:e.issue}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.issueUuid,file:n.file})))}async delete(e){return this._delete(e)}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 LF extends Ke{constructor(){super(...arguments);y(this,"name","Issue Comment Attachment");y(this,"url","/issue-comment-attachments");y(this,"actions",{addOne:My,addMany:Ry,setOne:wy,setMany:vy,updateOne:Ey,updateMany:Vy,deleteOne:zy,deleteMany:By,initialize:_y});y(this,"selectors",{selectById:qy,selectByIds:Cy})}getId(e){return e.uuid}buildModel(e){return M({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,issue_comment:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,issue_comment:e.issue_comment}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.issueCommentUuid,file:n.file})))}async delete(e){return this._delete(e)}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 kF extends E{constructor(){super(...arguments);y(this,"name","Issue Comment");y(this,"url","/issue-comments");y(this,"actions",{addOne:Ly,addMany:ky,setOne:Ny,setMany:Gy,updateOne:Hy,updateMany:Wy,deleteOne:Ky,deleteMany:Yy,initialize:Uy});y(this,"selectors",{selectById:Zy,selectByIds:Jy})}add(e){const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,l=M({...e,author:n.getState().userReducer.currentUser.uuid,submitted_at:new Date().toISOString()});this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(l),blockers:[e.issue],blocks:[l.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,u]}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 l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(()=>{this.dispatch(a(r))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=r(e)(n.getState());if(!l)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}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 NF extends E{constructor(){super(...arguments);y(this,"name","Issue");y(this,"url","/issues");y(this,"actions",{addOne:ep,addMany:ji,setOne:tp,setMany:sp,updateOne:ip,updateMany:np,deleteOne:ap,deleteMany:qi,initialize:xy});y(this,"selectors",{selectById:dp,selectByIds:rp})}add(e){var A;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=n.getState(),u=new Date().toISOString(),d=((A=l.userReducer.currentUser)==null?void 0:A.uuid)??null,h=M({...e,submitted_at:u,created_by:d});this.dispatch(a(h));const p=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(h),blockers:[h.project,h.issue_type,...h.category?[h.category]:[]],blocks:[h.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(h.uuid)),f}),[h,p]}update(e){var p;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 l={...r,...e};this.dispatch(n(l));const u={};for(const A of[$.TITLE,$.DESCRIPTION,$.STATUS,$.CATEGORY,$.PRIORITY,$.ASSIGNED_TO,$.DUE_DATE])if(A in e&&e[A]!==r[A])switch(A){case $.PRIORITY:case $.STATUS:{const f=e[A];u[A]=f!==void 0?Number(f):null;break}case $.DUE_DATE:u[A]=e[A];break;case $.DESCRIPTION:u[A]=e[A];break;case $.TITLE:u[A]=e[A];break;case $.CATEGORY:{const f=e[A];if(f===null)u[A]=null;else{const I=Zs(f)(c);if(!I)throw new Error(`Trying to update category with ${f} which does not exist in store.`);u[A]={name:I.name,color:I.color,uuid:I.uuid}}break}case $.ASSIGNED_TO:{const f=e[A];if(f===null)u[A]=null;else{const I=Vt(f)(c);if(!I)throw new Error(`Trying to update assigned to with ${f} which does not exist in store.`);u[A]={email:I.email,uuid:I.uuid}}break}}const d=M({created_by:((p=c.userReducer.currentUser)==null?void 0:p.uuid)??null,submitted_at:new Date().toISOString(),issue:r.uuid,changes:u});this.dispatch(xi(d));const h=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return h.then(A=>{this.dispatch(n(A))}).catch(()=>{this.dispatch(n(r)),this.dispatch(tn(d.uuid))}),[l,h]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`No issue with uuid ${e} found in the store`);const d=Oy(e)(l),h=Ff(e)(l),p={};for(const f of ry(e)(l))p[f.uuid]=f;for(const f of uy(e)(l))p[f.uuid]=f;const A=Object.values(p);this.dispatch(a(e)),this.dispatch(Ri(D(d))),this.dispatch(sn(D(h))),this.dispatch(Mt(D(A)));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(c(u)),this.dispatch(Mi(d)),this.dispatch(en(h)),this.dispatch(_t(A)),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 GF extends Ke{constructor(){super(...arguments);y(this,"name","Issue Type Attachment");y(this,"url","/issue-type-attachments");y(this,"actions",{addOne:mp,addMany:yp,setOne:pp,setMany:Ap,updateOne:fp,updateMany:Sp,deleteOne:Tp,deleteMany:Ip,initialize:hp});y(this,"selectors",{selectById:Pp,selectByIds:Fp})}getId(e){return e.uuid}buildModel(e){return M({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,issue_type:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,issue_type:e.issue_type}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.issueTypeUuid,file:n.file})))}async delete(e){return this._delete(e)}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 HF extends E{constructor(){super(...arguments);y(this,"name","Issue Type Fields Attachment");y(this,"url","/issue-type-fields-attachments");y(this,"actions",{addOne:Mp,addMany:Rp,setOne:wp,setMany:vp,updateOne:Ep,updateMany:Vp,deleteOne:zp,deleteMany:Bp,initialize:_p});y(this,"selectors",{selectById:qp,selectByIds:Cp})}async bulkAdd(e){var A;const{addMany:n,setMany:a,deleteMany:c}=this.actions,r=new Date().toISOString(),l=((A=this.client.store.getState().userReducer.currentUser)==null?void 0:A.uuid)??null,u={},d=[],h=[];for(const f of e){const{fieldsRevisionUuid:I,fieldIdentifier:F,file:P}=f,g=await this.client.files.getFilePayload(P);g.sha1 in u||(u[g.sha1]=g);const b=M({file:URL.createObjectURL(P),file_type:P.type,file_name:P.name,file_sha1:g.sha1,created_by:l,fields_revision:I,submitted_at:r,field_identifier:F});d.push(b);const v={uuid:b.uuid,file_name:P.name,file_extension:g.extension,field_identifier:F,file_sha1:g.sha1,fields_revision:I};h.push(v)}this.dispatch(n(d));const p=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:r,attachments:h,files:Object.values(u)},blockers:d.map(f=>f.fields_revision),blocks:d.map(f=>f.uuid)});return p.then(f=>{this.client.files.processPresignedUrls(f.presigned_urls),this.dispatch(a(f.attachments))}).catch(()=>{this.dispatch(c(d.map(f=>f.uuid)))}),[d,p.then(({attachments:f})=>f)]}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 WF extends E{constructor(){super(...arguments);y(this,"name","Issue Type Fields");y(this,"url","/issue-type-fields");y(this,"actions",{addOne:tA,addMany:sA,setOne:iA,setMany:nA,updateOne:aA,updateMany:cA,deleteOne:dA,deleteMany:rA,initialize:eA});y(this,"selectors",{selectById:lA,selectByIds:oA})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.uuid)??null,u=new Date().toISOString(),d=M({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[d.issue_type],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(A=>{throw this.dispatch(r(d.uuid)),A}),[d,h]}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 KF extends E{constructor(){super(...arguments);y(this,"name","Issue Type Field Values Attachment");y(this,"url","/issue-type-field-values-attachments");y(this,"actions",{addOne:pA,addMany:Gi,setOne:AA,setMany:fA,updateOne:SA,updateMany:TA,deleteOne:IA,deleteMany:Hi,initialize:yA});y(this,"selectors",{selectById:PA,selectByIds:FA})}async bulkAdd(e){var A;const{addMany:n,setMany:a,deleteMany:c}=this.actions,r=new Date().toISOString(),l=((A=this.client.store.getState().userReducer.currentUser)==null?void 0:A.uuid)??null,u={},d=[],h=[];for(const f of e){const{fieldValuesUuid:I,fieldIdentifier:F,file:P}=f,g=await this.client.files.getFilePayload(P);g.sha1 in u||(u[g.sha1]=g);const b=M({file:URL.createObjectURL(P),file_type:P.type,file_name:P.name,file_sha1:g.sha1,created_by:l,field_values:I,submitted_at:r,field_identifier:F});d.push(b);const v={uuid:b.uuid,file_name:P.name,file_sha1:g.sha1,file_extension:g.extension,field_identifier:F,field_values:I};h.push(v)}this.dispatch(n(d));const p=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:r,attachments:h,files:Object.values(u)},blockers:d.map(f=>f.field_values),blocks:d.map(f=>f.uuid)});return p.then(({presigned_urls:f,attachments:I})=>{this.client.files.processPresignedUrls(f),this.dispatch(a(I))}).catch(f=>{throw this.dispatch(c(d.map(I=>I.uuid))),f}),[d,p.then(({attachments:f})=>f)]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,l=n.getState(),u=r(e)(l);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!0),method:m.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(d){throw this.dispatch(c(u)),d}}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 YF extends E{constructor(){super(...arguments);y(this,"name","Issue Type Field Values");y(this,"url","/issue-type-field-values");y(this,"actions",{addOne:Lp,addMany:kp,setOne:Np,setMany:Gp,updateOne:Hp,updateMany:Wp,deleteOne:Kp,deleteMany:Yp,initialize:Up});y(this,"selectors",{selectById:Jp,selectByIds:Xp})}add(e){var A;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,u=((A=n.getState().userReducer.currentUser)==null?void 0:A.uuid)??null,d=new Date().toISOString(),h=M({...e,created_by:u,submitted_at:d}),p=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(h),blockers:[e.issue,e.fields_revision],blocks:[h.uuid]});return this.dispatch(a(h)),p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(h.uuid))}),[h,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),l=c(e.uuid)(r);if(!l)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const u={...l,...e};this.dispatch(a(u));const d=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[u.uuid,u.fields_revision,u.issue],blocks:[u.uuid]});return d.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(l))}),[u,d]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected submission with uuid ${e} to exist`);const d=gA(e)(l);this.dispatch(a(e)),this.dispatch(Hi(D(d)));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(u)),this.dispatch(Gi(d)),h}}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 ZF extends E{constructor(){super(...arguments);y(this,"name","Issue Type Identifier");y(this,"url","/issue-type-identifiers");y(this,"actions",{addOne:RA,addMany:wA,setOne:vA,setMany:EA,updateOne:VA,updateMany:zA,deleteOne:BA,deleteMany:jA,initialize:MA});y(this,"selectors",{selectById:CA,selectByIds:DA})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.uuid)??null,u=new Date().toISOString(),d=M({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[d.issue_type],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,h]}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 l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(()=>{this.dispatch(a(r))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(u)),d}}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 JF extends E{constructor(){super(...arguments);y(this,"name","Issue Type Identifier Value");y(this,"url","/issue-type-identifier-values");y(this,"actions",{addOne:kA,addMany:NA,setOne:GA,setMany:HA,updateOne:WA,updateMany:KA,deleteOne:YA,deleteMany:ZA,initialize:LA});y(this,"selectors",{selectById:XA,selectByIds:QA})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.uuid)??null,u=new Date().toISOString(),d=M({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[e.issue,e.issue_type_identifier],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,h]}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 value with uuid ${e.uuid} to exist`);const l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(()=>{this.dispatch(a(r))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(u)),d}}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 XF extends E{constructor(){super(...arguments);y(this,"name","Issue Type");y(this,"url","/issue-types");y(this,"actions",{addOne:sf,addMany:nf,setOne:af,setMany:cf,updateOne:df,updateMany:rf,deleteOne:uf,deleteMany:lf,initialize:tf});y(this,"selectors",{selectById:hf,selectByIds:mf})}add(e){var A;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,u=((A=n.getState().userReducer.currentUser)==null?void 0:A.uuid)??null,d=new Date().toISOString(),h=M({...e,submitted_at:d,created_by:u});this.dispatch(a(h));const p=this.enqueueRequest({method:m.POST,url:`${this.url}/`,payload:z(h),blockers:[],blocks:[h.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(h.uuid))}),[h,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),l=c(e.uuid)(r);if(!l)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const u={...l,...e};this.dispatch(a(u));const d=this.enqueueRequest({method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return d.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(l))}),[u,d]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const d=up(e)(l);this.dispatch(a(e)),this.dispatch(qi(D(d)));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(u)),this.dispatch(ji(d)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class QF extends E{constructor(){super(...arguments);y(this,"name","Issue Update");y(this,"url","/issue-updates");y(this,"actions",{addOne:xi,addMany:en,setOne:ff,setMany:Sf,updateOne:Tf,updateMany:If,deleteOne:tn,deleteMany:sn,initialize:Af});y(this,"selectors",{selectById:Of,selectByIds:Pf})}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 xF=1800;function eg(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 tg extends xP{constructor(){super(...arguments);y(this,"_getRenewedTokens",async e=>{const n=this.performRequest({method:m.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(ao(!1)),this.clearTokens(),this.dispatch(_()),this.dispatch(_())}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.log("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=VI(e).exp??n}catch{a=n}return a-n<xF}getAuthHeader(){return`Bearer ${this.getAccessToken()}`}async prepareAuth(){if(this.tokenIsExpiringSoon()){console.debug(this.constructor.name,"preparing auth");try{await this.renewTokens()}catch(e){return e instanceof U&&this.clearAuth(),e instanceof Error?Promise.reject(e):Promise.reject(new Error((e??tt).toString()))}}}async handleUnauthorized(e,n){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 U({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 U({message:"Incorrect username or password.",response:n,discard:!0})}async initAuth(e){const n=xe.v4();return console.debug(this.constructor.name,"Initiating auth"),this.performRequest({uuid:n,method:m.POST,url:this.initTokensUrl,payload:e,isAuthNeeded:!1,checkAuth:!1}).then(a=>{this.setTokens(eg(a))})}}class lt extends Ze{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:m.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:m.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:m.GET,...s},e)}}class sg extends lt{constructor(){super(...arguments);y(this,"name","Organization Access");y(this,"url","/organization-accesses");y(this,"actions",{addOne:Df,addMany:$f,setOne:Uf,setMany:Lf,updateOne:kf,updateMany:Nf,deleteOne:Gf,deleteMany:Hf,initialize:Cf});y(this,"selectors",{selectById:Kf,selectByIds:Yf})}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState()),l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(d=>{throw this.dispatch(a(r)),d}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l),d=Vt(u.user)(l);this.dispatch(a(u.uuid)),this.dispatch(rn(u.user));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${u.uuid}/`,blockers:[u.uuid],blocks:[]})}catch(h){throw this.dispatch(c(u)),this.dispatch(dn(d)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class ig extends lt{constructor(){super(...arguments);y(this,"name","Organization");y(this,"url","/organizations");y(this,"actions",{addOne:tS,addMany:eS,setOne:xf,setMany:Qf,updateOne:iS,updateMany:sS,deleteOne:nS,deleteMany:aS,initialize:Xf});y(this,"selectors",{selectById:rS,selectByIds:uS})}async add(e){const{addOne:n}=this.actions,a=await this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.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:O(m.PATCH,this.name,!1),method:m.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:O(m.POST,this.name,!1),method:m.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 ng extends E{constructor(){super(...arguments);y(this,"name","Project Access");y(this,"url","/project-accesses");y(this,"actions",{addOne:TS,addMany:IS,setOne:OS,setMany:PS,updateOne:FS,updateMany:gS,deleteOne:bS,deleteMany:_S,initialize:SS});y(this,"selectors",{selectById:RS,selectByIds:wS})}add(e){var d;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=M({...e,created_by:((d=n.getState().userReducer.currentUser)==null?void 0:d.uuid)??null});this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(l),blockers:[l.organization_access,l.project],blocks:[l.uuid]});return u.then(h=>{this.dispatch(c(h))}).catch(h=>{throw this.dispatch(r(l.uuid)),h}),[l,u]}bulkAdd(e){var h;const{store:n}=this.client,{addMany:a,deleteMany:c,updateMany:r}=this.actions,l=((h=n.getState().userReducer.currentUser)==null?void 0:h.uuid)??null,u=e.map(p=>M({...p,created_by:l}));this.dispatch(a(u));const d=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{project_accesses:u.map(p=>z(p))},blockers:u.flatMap(p=>[p.project,p.organization_access]),blocks:u.map(p=>p.uuid)});return d.then(p=>{this.dispatch(r(p))}).catch(p=>{throw this.dispatch(c(u.map(A=>A.uuid))),p}),[u,d]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState()),l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return u.then(d=>{this.dispatch(a(d))}).catch(d=>{throw this.dispatch(a(r)),d}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.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:{project__organization:e}},n);return this.dispatch(a(c)),c}}class ag extends Ke{constructor(){super(...arguments);y(this,"name","Project Attachment");y(this,"url","/project-attachments");y(this,"actions",{addOne:VS,addMany:zS,setOne:BS,setMany:jS,updateOne:qS,updateMany:CS,deleteOne:DS,deleteMany:$S,initialize:ES});y(this,"selectors",{selectById:LS,selectByIds:kS})}getId(e){return e.uuid}buildModel(e){return M({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,project:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,project:e.project}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.projectUuid,file:n.file})))}async delete(e){return this._delete(e)}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 cg extends E{constructor(){super(...arguments);y(this,"name","Project File");y(this,"url","/project-files");y(this,"actions",{addOne:YS,addMany:ZS,setOne:WS,setMany:KS,updateOne:JS,updateMany:XS,deleteOne:QS,deleteMany:xS,initialize:HS});y(this,"selectors",{selectById:aT,selectByIds:cT})}async saveExisting(e){const{setOne:n}=this.actions;if(!e.uuid)throw new Error("You can only use this method to save existing project files. The one provided has no uuid.");const a={...e};delete a.file;const c=this.enqueueRequest({method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:a,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(n(r))}),c}saveActive(){const{store:e}=this.client,{setOne:n}=this.actions,a=e.getState(),c=a.projectFileReducer.activeProjectFileId;if(!c)throw new Error("No active project file");const r=a.projectFileReducer.instances[c];if(!r)throw new Error("No active project file");if(!r.bounds&&!r.canvas_bounds)throw new Error("Project file must either have bounds or canvas_bounds set");let l;if(typeof r.file=="string"&&!r.file.startsWith("blob:")){const h={...r};delete h.file,l={method:m.PATCH,url:`${this.url}/${c}/`,payload:h,blockers:[c],blocks:[c]}}else l=new Promise((h,p)=>{this.client.files.uploadFileToS3(r.file_sha1).then(([A])=>{h({method:m.POST,url:`${this.url}/`,payload:{...r,...A},blockers:[c],blocks:[c]})}).catch(p)});const d=Promise.resolve(l).then(h=>this.enqueueRequest(h));return d.then(h=>{this.dispatch(n(h))}),this.dispatch(sT),this.dispatch(tT(null)),this.dispatch(eT(!1)),[r,d]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:r}=this.selectors,l=r(e)(n.getState());if(!l)throw new Error(`Expected project file with uuid ${e} to exist in the store.`);this.dispatch(c(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.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,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class dg extends lt{constructor(){super(...arguments);y(this,"name","Project");y(this,"url","/projects");y(this,"actions",{addOne:mT,addMany:hT,setOne:oT,setMany:lT,updateOne:pT,updateMany:yT,deleteOne:AT,deleteMany:fT,initialize:uT});y(this,"selectors",{selectById:IT,selectByIds:OT})}async add(e){const{addOne:n}=this.actions,a=await this.performRequest({method:m.POST,url:`${this.url}/`,payload:z(e)});return this.dispatch(n(a)),a}async update(e){const{updateOne:n}=this.actions,a=await this.performRequest({method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:z(e)});return this.dispatch(n(a)),a}async delete(e){const{deleteOne:n}=this.actions,a=await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.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 rg extends E{constructor(){super(...arguments);y(this,"name","Team Membership");y(this,"url","/team-memberships");y(this,"actions",{addOne:bT,addMany:_T,setOne:MT,setMany:RT,updateOne:wT,updateMany:vT,deleteOne:ET,deleteMany:VT,initialize:gT});y(this,"selectors",{selectById:jT,selectByIds:qT})}add(e){var d;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=M({...e,created_by:((d=n.getState().userReducer.currentUser)==null?void 0:d.uuid)??null});this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(l),blockers:[e.team],blocks:[l.uuid]});return u.then(h=>{this.dispatch(c(h))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,u]}bulkAdd(e){var h;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,l=((h=n.getState().userReducer.currentUser)==null?void 0:h.uuid)??null,u=e.map(p=>M({...p,created_by:l}));this.dispatch(a(u));const d=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{team_memberships:u.map(p=>z(p))},blockers:u.map(p=>p.team),blocks:u.map(p=>p.uuid)});return d.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(u.map(p=>p.uuid)))}),[u,d]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(d){throw this.dispatch(c(u)),d}}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 ug extends E{constructor(){super(...arguments);y(this,"name","Team");y(this,"url","/teams");y(this,"actions",{addOne:$T,addMany:UT,setOne:LT,setMany:kT,updateOne:NT,updateMany:GT,deleteOne:HT,deleteMany:WT,initialize:DT});y(this,"selectors",{selectById:YT,selectByIds:ZT})}add(e){var d;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=M({...e,submitted_at:new Date().toISOString(),created_by:((d=n.getState().userReducer.currentUser)==null?void 0:d.uuid)??null});this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(l),blockers:[],blocks:[l.uuid]});return u.then(h=>{this.dispatch(c(h))}).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 team with uuid ${e.uuid} to exist`);const l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:z(e),blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(()=>{this.dispatch(a(r))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(d){throw this.dispatch(c(u)),d}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class lg extends lt{constructor(){super(...arguments);y(this,"name","User");y(this,"url","/user");y(this,"actions",{addOne:dn,addMany:wf,setOne:Rf,setMany:Mf,updateOne:Ef,updateMany:vf,deleteOne:rn,deleteMany:Vf,initialize:_f});y(this,"selectors",{selectById:Vt,selectByIds:jf})}async list(e,n){const{organizationUuid:a,...c}=e,r=a?`/organizations/${a}${this.url}s/`:`/${this.url}`;return this.performRequest({method:m.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}}async function Rn(t,s,e,n,a){const c=n instanceof Ze;c&&s.checkAuth!==!1&&await n.auth.prepareAuth();const r={queryParams:"",isAuthNeeded:!0},{s3url:l,payload:u,headers:d,method:h,queryParams:p,attachmentHash:A,isExternalUrl:f,isAuthNeeded:I,isResponseBlob:F}={...r,...s};let P=s.url;const g=A?await e.files.fetchCache(A):void 0;if(A&&!g)throw new Error(`Cannot upload file ${A} because it's not cached.`);!f&&!P.startsWith("http")&&(!P.startsWith("/")&&!P.startsWith("blob:")&&(P="/"+P),P=t+P);const b=q=>{if(A){if(!l)throw new Error(`No S3 URL for file ${A}`);if("warning"in l)throw new Error(`S3 URL warning for file ${A}`);if(!g)throw new Error(`No file for file ${A}`);const j=l.fields["x-amz-checksum-sha1"];if(!j)throw new Error(`No checksum for file ${A}`);return q.set("x-amz-checksum-sha1",j).field({...u,...l.fields}).attach("file",g)}return q.send(u)},B={[m.GET]:()=>F?Qe.get(P.toString()).responseType("blob"):Qe.get(P.toString()),[m.POST]:()=>{const q=Qe.post(P.toString());return b(q)},[m.PATCH]:()=>{const q=Qe.patch(P.toString());return b(q)},[m.PUT]:()=>{const q=Qe.put(P.toString());return b(q)},[m.DELETE]:()=>{const q=Qe.delete(P.toString());return b(q)}}[h];let V=B();if(a==null||a.addEventListener("abort",()=>{console.debug("aborting request:",s),V.abort()}),I&&c){const q=n.auth.getAuthHeader();V=V.set("Authorization",q)}d&&(V=V.set(d));try{return await V.query(p)}catch(q){const j=mI(q),bI=j==null?void 0:j.status;if(c&&bI===401)return await n.auth.handleUnauthorized(V,j),V.query(p);throw new U({response:j,innerError:q,discard:gn.includes(bI)})}}class og{constructor(s){y(this,"store");this.store=s}_performRequest(s,e,n,a){const c=new Ut,r={...e,uuid:e.uuid??xe.v4()};return Rn(s,r,this,n,a).then(l=>{c.resolve(l.body)}).catch(l=>{l instanceof Error?c.reject(l):c.reject(new Error((l??tt).toString()))}),c}async performRequest(s,e,n,a){return this._performRequest(s,e,n,a).then(c=>{if(c instanceof U)throw c;return c})}async enqueueRequest(s,e,n){return this._enqueueRequest(s,e,n).then(a=>{if(a instanceof U)throw a;return a})}_enqueueRequest(s,e,n){const a=new Ut,c={...s,BASE_URL:e,serviceName:n},r=this.store.dispatch(mS(c)),l=d=>{if(d)a.resolve(d.body);else{const h=new U({message:"Could not get a response from the server.",response:d,discard:!0});a.reject(h)}},u=d=>{d instanceof U?d.options.discard=!0:(console.error("Received an unexpected error while processing a request:",d,`
15
- Converting error to APIError and discarding.`),d=new U({message:"An error occurred while processing the request.",innerError:d,discard:!0})),a.reject(d)};return r.then(l,u),a}async performPagination(s,e,n,a,c){const r={...e,queryParams:{...e.queryParams,paginate:!0,limit:n}},{method:l}=r,u=[];let d=await this.performRequest(s,r,a,c);for(u.push(d.results);d.next;)d=await this.performRequest(s,{url:d.next,method:l},a,c),u.push(d.results);return u}}class st{constructor(){y(this,"graph");y(this,"requestAttemptCounter");this.graph=new zI.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(s){const e=new st;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(l=>a.payload.blockers.includes(l))&&st._addDependency(a.payload.uuid,r.payload.uuid,e.graph)}}return e}_addDependency(s,e){st._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);s.payload.blockers.some(a=>n.payload.blocks.includes(a))&&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;this.graph.getNodeData(e).payload.blockers.some(a=>s.payload.blocks.includes(a))&&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 yI;function pI(t){yI=t}function it(){return yI}let AI;function fI(t){AI=t}function SI(){return AI}let wn=null;function Xe(){const t=it();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(wn)return wn;const s=t.getState().offline.outbox,e=st._fromOutbox(s);return wn=e,e}const hg=(t,s)=>{const e=new s(t);return fI(e),pI(t),e};class mg{constructor(s){y(this,"_all");y(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 vn{constructor(){y(this,"next");this.next=null}then(s){return new mg(this).then(s)}async run(s){if(this.next)return this.next.run(s);{if(console.debug("Middleware finished. Performing request:",s),!it())throw new Error("Client store not set");const n=SI();if(!n)throw new Error("Client SDK not set");return lI(s,n)}}}class TI extends vn{async run(s){return super.run(s)}}class II extends vn{async run(s){return super.run(s)}}const OI=new TI().then(new II).compile();function PI(t){var s;return(s=OI[0])==null?void 0:s.run(t)}var FI=(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))(FI||{});i.ALL_MIDDLEWARE=OI,i.APIError=U,i.ATTACHMENT_MODEL_DEFAULT_PAGE_SIZE=tI,i.AgentService=eF,i.AssetAttachmentService=tF,i.AssetProcedureService=dF,i.AssetProcedureStepFieldValuesAttachmentService=oF,i.AssetProcedureStepFieldValuesService=hF,i.AssetProcedureStepFieldsAttachmentService=uF,i.AssetProcedureStepFieldsService=lF,i.AssetProcedureStepService=mF,i.AssetProcedureTypeAttachmentService=sF,i.AssetProcedureTypeFieldValuesAttachmentService=aF,i.AssetProcedureTypeFieldValuesService=cF,i.AssetProcedureTypeFieldsAttachmentService=iF,i.AssetProcedureTypeFieldsService=nF,i.AssetProcedureTypeService=rF,i.AssetService=yF,i.AssetStageCompletionService=pF,i.AssetStageService=AF,i.AssetTypeAttachmentService=fF,i.AssetTypeFieldValuesAttachmentService=IF,i.AssetTypeFieldValuesService=OF,i.AssetTypeFieldsAttachmentService=SF,i.AssetTypeFieldsService=TF,i.AssetTypeIdentifierService=PF,i.AssetTypeIdentifierValueService=FF,i.AssetTypeService=gF,i.AttachmentModel=qn,i.BaseApiService=Ze,i.BaseModelApiService=lt,i.BaseOfflineAttachmentModelService=Ke,i.BaseOfflineModelApiService=E,i.BaseSDK=og,i.COMMON_AUTO_FIELDS=kn,i.CategoryService=bF,i.DEFAULT_ISSUE_PRIORITY=jI,i.DEFAULT_ISSUE_STATUS=BI,i.DEFAULT_PAGE_SIZE=eI,i.DISCARD_HTTP_STATUSES=gn,i.DeferredPromise=Ut,i.DocumentAttachmentService=_F,i.DocumentService=MF,i.EMPTY_ARRAY=zn,i.EMPTY_OBJECT=Bn,i.EmailVerificationService=RF,i.FileService=vF,i.FormIdentifierService=EF,i.FormIdentifierValueService=VF,i.FormRevisionAttachmentService=zF,i.FormRevisionService=BF,i.FormService=jF,i.FormSubmissionAttachmentService=qF,i.FormSubmissionService=CF,i.GeoImageService=DF,i.HttpMethod=m,i.IssueAssociationService=$F,i.IssueAttachmentService=UF,i.IssueCommentAttachmentService=LF,i.IssueCommentService=kF,i.IssuePriority=Dt,i.IssueService=NF,i.IssueStatus=$t,i.IssueTypeAttachmentService=GF,i.IssueTypeFieldValuesAttachmentService=KF,i.IssueTypeFieldValuesService=YF,i.IssueTypeFieldsAttachmentService=HF,i.IssueTypeFieldsService=WF,i.IssueTypeIdentifierService=ZF,i.IssueTypeIdentifierValueService=JF,i.IssueTypeService=XF,i.IssueUpdateChange=$,i.IssueUpdateService=QF,i.JWTService=tg,i.MAX_SERVICE_BATCH_SIZE=Ye,i.OUTBOX_RETRY_DELAY=Cn,i.OfflineAnalyticsMiddleware=TI,i.OfflineMiddleware=vn,i.OrganizationAccessLevel=jn,i.OrganizationAccessService=sg,i.OrganizationService=ig,i.OutboxCoordinator=st,i.ProjectAccessService=ng,i.ProjectAttachmentService=ag,i.ProjectFileService=cg,i.ProjectService=dg,i.RESET_ORGANIZATION_STATE=w,i.RESET_PROJECT_STATE=C,i.RESET_STATE=_,i.RateLimitingMiddleware=II,i.SelectorBuilder=cO,i.TeamMembershipService=rg,i.TeamService=ug,i.UNKNOWN_ERROR_MESSAGE=tt,i.UserService=lg,i.VERSION_REDUCER_KEY=nt,i.VerificationCodeType=FI,i._setLatestRetryTime=pS,i.addAsset=fr,i.addAssetAttachment=sa,i.addAssetAttachments=Yt,i.addAssetProcedure=vc,i.addAssetProcedureStep=ar,i.addAssetProcedureStepFieldValues=Nd,i.addAssetProcedureStepFieldValuesAttachment=vd,i.addAssetProcedureStepFieldValuesAttachments=fs,i.addAssetProcedureStepFieldValuesMany=Gd,i.addAssetProcedureStepFields=fd,i.addAssetProcedureStepFieldsAttachment=id,i.addAssetProcedureStepFieldsAttachments=nd,i.addAssetProcedureStepFieldsMany=Sd,i.addAssetProcedureSteps=cr,i.addAssetProcedureType=Nc,i.addAssetProcedureTypeAttachment=pa,i.addAssetProcedureTypeAttachments=Aa,i.addAssetProcedureTypeFieldValues=Ac,i.addAssetProcedureTypeFieldValuesAttachment=ic,i.addAssetProcedureTypeFieldValuesAttachments=is,i.addAssetProcedureTypeFieldValuesMany=fc,i.addAssetProcedureTypeFields=Na,i.addAssetProcedureTypeFieldsAttachment=wa,i.addAssetProcedureTypeFieldsAttachments=va,i.addAssetProcedureTypeFieldsMany=Ga,i.addAssetProcedureTypes=Gc,i.addAssetProcedures=rs,i.addAssetStage=Kr,i.addAssetStageCompletion=vr,i.addAssetStageCompletions=Er,i.addAssetStages=Yr,i.addAssetType=Yl,i.addAssetTypeAttachment=nu,i.addAssetTypeAttachments=Es,i.addAssetTypeFieldValues=nl,i.addAssetTypeFieldValuesAttachment=Hu,i.addAssetTypeFieldValuesAttachments=Ds,i.addAssetTypeFieldValuesMany=al,i.addAssetTypeFields=Eu,i.addAssetTypeFieldsAttachment=fu,i.addAssetTypeFieldsAttachments=Su,i.addAssetTypeFieldsMany=Vu,i.addAssetTypeIdentifier=Sl,i.addAssetTypeIdentifierValue=Vl,i.addAssetTypeIdentifierValues=zl,i.addAssetTypeIdentifiers=Tl,i.addAssetTypes=Zl,i.addAssets=gs,i.addCategories=oo,i.addCategory=lo,i.addConversation=Jn,i.addConversations=dO,i.addDocument=Co,i.addDocumentAttachment=Fo,i.addDocumentAttachments=go,i.addDocuments=Do,i.addForm=em,i.addFormIdentifier=sh,i.addFormIdentifierValue=Ah,i.addFormIdentifierValues=fh,i.addFormIdentifiers=ih,i.addFormRevision=ci,i.addFormRevisionAttachment=vh,i.addFormRevisionAttachments=Eh,i.addFormRevisions=di,i.addFormSubmission=Rm,i.addFormSubmissionAttachment=ym,i.addFormSubmissionAttachments=yi,i.addFormSubmissions=Ii,i.addForms=tm,i.addGeoImage=Lm,i.addGeoImages=km,i.addIssue=ep,i.addIssueAssociation=iy,i.addIssueAssociations=_t,i.addIssueAttachment=yy,i.addIssueAttachments=Mi,i.addIssueComment=Ly,i.addIssueCommentAttachment=My,i.addIssueCommentAttachments=Ry,i.addIssueComments=ky,i.addIssueType=sf,i.addIssueTypeAttachment=mp,i.addIssueTypeAttachments=yp,i.addIssueTypeFieldValues=Lp,i.addIssueTypeFieldValuesAttachment=pA,i.addIssueTypeFieldValuesAttachments=Gi,i.addIssueTypeFieldValuesMany=kp,i.addIssueTypeFields=tA,i.addIssueTypeFieldsAttachment=Mp,i.addIssueTypeFieldsAttachments=Rp,i.addIssueTypeFieldsMany=sA,i.addIssueTypeIdentifier=RA,i.addIssueTypeIdentifierValue=kA,i.addIssueTypeIdentifierValues=NA,i.addIssueTypeIdentifiers=wA,i.addIssueTypes=nf,i.addIssueUpdate=xi,i.addIssueUpdates=en,i.addIssues=ji,i.addOrganization=tS,i.addOrganizationAccess=Df,i.addOrganizationAccesses=$f,i.addOrganizations=eS,i.addProject=mT,i.addProjectAccess=TS,i.addProjectAccesses=IS,i.addProjectAttachment=VS,i.addProjectAttachments=zS,i.addProjectFile=YS,i.addProjectFiles=ZS,i.addProjects=hT,i.addTeam=$T,i.addTeamMembership=bT,i.addTeamMemberships=_T,i.addTeams=UT,i.addUser=dn,i.addUsers=wf,i.agentsReducer=xn,i.agentsSlice=Ht,i.areArraysEqual=$I,i.assetAttachmentReducer=ha,i.assetAttachmentSlice=Kt,i.assetProcedureReducer=qc,i.assetProcedureSlice=ds,i.assetProcedureStepFieldValuesAttachmentReducer=Ud,i.assetProcedureStepFieldValuesAttachmentSlice=As,i.assetProcedureStepFieldValuesReducer=er,i.assetProcedureStepFieldValuesSlice=Is,i.assetProcedureStepFieldsAttachmentReducer=yd,i.assetProcedureStepFieldsAttachmentSlice=hs,i.assetProcedureStepFieldsReducer=Md,i.assetProcedureStepFieldsSlice=ys,i.assetProcedureStepReducer=or,i.assetProcedureStepSlice=Os,i.assetProcedureTypeAttachmentReducer=Fa,i.assetProcedureTypeAttachmentSlice=Xt,i.assetProcedureTypeFieldValuesAttachmentReducer=uc,i.assetProcedureTypeFieldValuesAttachmentSlice=ss,i.assetProcedureTypeFieldValuesReducer=gc,i.assetProcedureTypeFieldValuesSlice=cs,i.assetProcedureTypeFieldsAttachmentReducer=Ca,i.assetProcedureTypeFieldsAttachmentSlice=xt,i.assetProcedureTypeFieldsReducer=Xa,i.assetProcedureTypeFieldsSlice=ts,i.assetProcedureTypeReducer=Xc,i.assetProcedureTypeSlice=ls,i.assetReducer=Mr,i.assetSlice=Fs,i.assetStageCompletionReducer=Dr,i.assetStageCompletionSlice=_s,i.assetStageReducer=xr,i.assetStageSlice=Ms,i.assetTypeAttachmentReducer=yu,i.assetTypeAttachmentSlice=vs,i.assetTypeFieldValuesAttachmentReducer=tl,i.assetTypeFieldValuesAttachmentSlice=Cs,i.assetTypeFieldValuesReducer=pl,i.assetTypeFieldValuesSlice=Ls,i.assetTypeFieldsAttachmentReducer=Ru,i.assetTypeFieldsAttachmentSlice=Bs,i.assetTypeFieldsReducer=ku,i.assetTypeFieldsSlice=qs,i.assetTypeIdentifierReducer=wl,i.assetTypeIdentifierSlice=ks,i.assetTypeIdentifierValueReducer=Nl,i.assetTypeIdentifierValueSlice=Gs,i.assetTypeReducer=io,i.assetTypeSlice=Hs,i.authReducer=co,i.authSlice=Ot,i.baseReducer=$P,i.baseReducers=Fn,i.blobToBase64=YI,i.categoryReducer=Io,i.categorySlice=Ks,i.clearTokens=GO,i.constructUploadedFilePayloads=KI,i.createModelAdapter=R,i.createOfflineAction=oS,i.createPayload=z,i.createSelectionAdapter=qI,i.deleteAsset=Ir,i.deleteAssetAttachment=da,i.deleteAssetAttachments=Zt,i.deleteAssetProcedure=zc,i.deleteAssetProcedureStep=ur,i.deleteAssetProcedureStepFieldValues=Zd,i.deleteAssetProcedureStepFieldValuesAttachment=jd,i.deleteAssetProcedureStepFieldValuesAttachments=Ss,i.deleteAssetProcedureStepFieldValuesMany=Jd,i.deleteAssetProcedureStepFields=Fd,i.deleteAssetProcedureStepFieldsAttachment=ud,i.deleteAssetProcedureStepFieldsAttachments=ld,i.deleteAssetProcedureStepFieldsMany=gd,i.deleteAssetProcedureSteps=lr,i.deleteAssetProcedureType=Kc,i.deleteAssetProcedureTypeAttachment=Oa,i.deleteAssetProcedureTypeAttachments=Pa,i.deleteAssetProcedureTypeFieldValues=Pc,i.deleteAssetProcedureTypeFieldValuesAttachment=rc,i.deleteAssetProcedureTypeFieldValuesAttachments=ns,i.deleteAssetProcedureTypeFieldValuesMany=Fc,i.deleteAssetProcedureTypeFields=Za,i.deleteAssetProcedureTypeFieldsAttachment=ja,i.deleteAssetProcedureTypeFieldsAttachments=qa,i.deleteAssetProcedureTypeFieldsMany=Ja,i.deleteAssetProcedureTypes=Yc,i.deleteAssetProcedures=us,i.deleteAssetStage=Xr,i.deleteAssetStageCompletion=qr,i.deleteAssetStageCompletions=Cr,i.deleteAssetStages=Qr,i.deleteAssetType=Ql,i.deleteAssetTypeAttachment=uu,i.deleteAssetTypeAttachments=Vs,i.deleteAssetTypeFieldValues=ll,i.deleteAssetTypeFieldValuesAttachment=Ju,i.deleteAssetTypeFieldValuesAttachments=$s,i.deleteAssetTypeFieldValuesMany=ol,i.deleteAssetTypeFields=Cu,i.deleteAssetTypeFieldsAttachment=Fu,i.deleteAssetTypeFieldsAttachments=gu,i.deleteAssetTypeFieldsMany=Du,i.deleteAssetTypeIdentifier=gl,i.deleteAssetTypeIdentifierValue=Dl,i.deleteAssetTypeIdentifierValues=$l,i.deleteAssetTypeIdentifiers=bl,i.deleteAssetTypes=xl,i.deleteAssets=bs,i.deleteCategories=fo,i.deleteCategory=Ao,i.deleteConversation=lO,i.deleteConversations=oO,i.deleteDocument=No,i.deleteDocumentAttachment=wo,i.deleteDocumentAttachments=vo,i.deleteDocuments=Go,i.deleteForm=cm,i.deleteFormIdentifier=rh,i.deleteFormIdentifierValue=Ph,i.deleteFormIdentifierValues=Fh,i.deleteFormIdentifiers=uh,i.deleteFormRevision=ri,i.deleteFormRevisionAttachment=qh,i.deleteFormRevisionAttachments=Ch,i.deleteFormRevisions=ui,i.deleteFormSubmission=Em,i.deleteFormSubmissionAttachment=Tm,i.deleteFormSubmissionAttachments=pi,i.deleteFormSubmissions=Oi,i.deleteForms=dm,i.deleteGeoImage=Hm,i.deleteGeoImages=Wm,i.deleteIssue=ap,i.deleteIssueAssociation=ny,i.deleteIssueAssociations=Mt,i.deleteIssueAttachment=Ty,i.deleteIssueAttachments=Ri,i.deleteIssueComment=Ky,i.deleteIssueCommentAttachment=zy,i.deleteIssueCommentAttachments=By,i.deleteIssueComments=Yy,i.deleteIssueType=uf,i.deleteIssueTypeAttachment=Tp,i.deleteIssueTypeAttachments=Ip,i.deleteIssueTypeFieldValues=Kp,i.deleteIssueTypeFieldValuesAttachment=IA,i.deleteIssueTypeFieldValuesAttachments=Hi,i.deleteIssueTypeFieldValuesMany=Yp,i.deleteIssueTypeFields=dA,i.deleteIssueTypeFieldsAttachment=zp,i.deleteIssueTypeFieldsAttachments=Bp,i.deleteIssueTypeFieldsMany=rA,i.deleteIssueTypeIdentifier=BA,i.deleteIssueTypeIdentifierValue=YA,i.deleteIssueTypeIdentifierValues=ZA,i.deleteIssueTypeIdentifiers=jA,i.deleteIssueTypes=lf,i.deleteIssueUpdate=tn,i.deleteIssueUpdates=sn,i.deleteIssues=qi,i.deleteOrganization=nS,i.deleteOrganizationAccess=Gf,i.deleteOrganizationAccesses=Hf,i.deleteOrganizations=aS,i.deleteProject=AT,i.deleteProjectAccess=bS,i.deleteProjectAccesses=_S,i.deleteProjectAttachment=DS,i.deleteProjectAttachments=$S,i.deleteProjectFile=QS,i.deleteProjectFiles=xS,i.deleteProjects=fT,i.deleteTeam=HT,i.deleteTeamMembership=ET,i.deleteTeamMemberships=VT,i.deleteTeams=WT,i.deleteUser=rn,i.deleteUsers=Vf,i.dequeue=uI,i.discard=oI,i.documentAttachmentReducer=Bo,i.documentAttachmentSlice=Js,i.documentSlice=Qs,i.documentsReducer=Ho,i.downloadFile=ZI,i.downloadInMemoryFile=WI,i.emailRegex=iO,i.enqueue=rI,i.enqueueRequest=mS,i.extractResponseFromError=mI,i.fallbackToEmptyArray=T,i.fallbackToEmptyObject=ht,i.fileReducer=xo,i.fileSlice=ei,i.fileToBlob=Un,i.formIdentifierReducer=mh,i.formIdentifierSlice=ti,i.formIdentifierValueReducer=Mh,i.formIdentifierValueSlice=ii,i.formReducer=rm,i.formRevisionAttachmentReducer=Lh,i.formRevisionAttachmentSlice=ni,i.formRevisionReducer=Xh,i.formRevisionsSlice=ai,i.formSlice=oi,i.formSubmissionAttachmentReducer=Fm,i.formSubmissionAttachmentSlice=mi,i.formSubmissionReducer=qm,i.formSubmissionSlice=Ti,i.geoImageReducer=Jm,i.geoImageSlice=Fi,i.getAssetProcedureStepSubTree=Hn,i.getAssetProcedureStepTrees=nO,i.getClientSDK=SI,i.getClientStore=it,i.getDocumentSubTree=Kn,i.getDocumentTrees=aO,i.getFileIdentifier=HI,i.getFileS3Key=Gt,i.getLocalDateString=Dn,i.getLocalRelativeDateString=NI,i.getOutboxCoordinator=Xe,i.getRenamedFile=$n,i.getRequestDescription=O,i.hashFile=et,i.initSDK=hg,i.initializeAssetAttachments=ta,i.initializeAssetProcedureStepFieldValues=kd,i.initializeAssetProcedureStepFieldValuesAttachments=wd,i.initializeAssetProcedureStepFields=Ad,i.initializeAssetProcedureStepFieldsAttachments=sd,i.initializeAssetProcedureSteps=sr,i.initializeAssetProcedureTypeAttachments=ya,i.initializeAssetProcedureTypeFieldValues=pc,i.initializeAssetProcedureTypeFieldValuesAttachments=sc,i.initializeAssetProcedureTypeFields=ka,i.initializeAssetProcedureTypeFieldsAttachments=Ra,i.initializeAssetProcedureTypes=kc,i.initializeAssetProcedures=wc,i.initializeAssetStageCompletions=wr,i.initializeAssetStages=Gr,i.initializeAssetTypeAttachments=iu,i.initializeAssetTypeFieldValues=il,i.initializeAssetTypeFieldValuesAttachments=Gu,i.initializeAssetTypeFields=vu,i.initializeAssetTypeFieldsAttachments=Au,i.initializeAssetTypeIdentifierValues=El,i.initializeAssetTypeIdentifiers=fl,i.initializeAssetTypes=Hl,i.initializeAssets=Ar,i.initializeCategories=uo,i.initializeConversations=Zn,i.initializeDocumentAttachments=Po,i.initializeDocuments=qo,i.initializeFormIdentifierValues=ph,i.initializeFormIdentifiers=th,i.initializeFormRevisionAttachments=wh,i.initializeFormRevisions=Nh,i.initializeFormSubmissionAttachments=mm,i.initializeFormSubmissions=bm,i.initializeForms=xh,i.initializeGeoImages=Dm,i.initializeIssueAssociations=Qm,i.initializeIssueAttachments=my,i.initializeIssueCommentAttachments=_y,i.initializeIssueComments=Uy,i.initializeIssueTypeAttachments=hp,i.initializeIssueTypeFieldValues=Up,i.initializeIssueTypeFieldValuesAttachments=yA,i.initializeIssueTypeFields=eA,i.initializeIssueTypeFieldsAttachments=_p,i.initializeIssueTypeIdentifierValues=LA,i.initializeIssueTypeIdentifiers=MA,i.initializeIssueTypes=tf,i.initializeIssueUpdates=Af,i.initializeIssues=xy,i.initializeOrganizationAccesses=Cf,i.initializeOrganizations=Xf,i.initializeProjectAccesses=SS,i.initializeProjectAttachments=ES,i.initializeProjectFiles=HS,i.initializeProjects=uT,i.initializeTeamMemberships=gT,i.initializeTeams=DT,i.initializeUsers=_f,i.isToday=kI,i.issueAssociationReducer=oy,i.issueAssociationSlice=bi,i.issueAttachmentReducer=gy,i.issueAttachmentSlice=_i,i.issueCommentAttachmentReducer=Dy,i.issueCommentAttachmentSlice=vi,i.issueCommentReducer=Xy,i.issueCommentSlice=Vi,i.issueReducer=lp,i.issueSlice=Bi,i.issueTypeAttachmentReducer=gp,i.issueTypeAttachmentSlice=Ci,i.issueTypeFieldValuesAttachmentReducer=bA,i.issueTypeFieldValuesAttachmentSlice=Ni,i.issueTypeFieldValuesReducer=Qp,i.issueTypeFieldValuesSlice=Li,i.issueTypeFieldsAttachmentReducer=Dp,i.issueTypeFieldsAttachmentSlice=$i,i.issueTypeFieldsReducer=hA,i.issueTypeFieldsSlice=ki,i.issueTypeIdentifierReducer=$A,i.issueTypeIdentifierSlice=Ki,i.issueTypeIdentifierValueReducer=xA,i.issueTypeIdentifierValueSlice=Zi,i.issueTypeReducer=yf,i.issueTypeSlice=Ji,i.issueUpdateReducer=gf,i.issueUpdateSlice=Qi,i.logOnlyOnce=JI,i.markAsDeleted=yS,i.markForDeletion=FP,i.memoize=kt,i.organizationAccessReducer=Wf,i.organizationAccessSlice=ln,i.organizationReducer=lS,i.organizationSlice=on,i.outboxReducer=AS,i.outboxSlice=hn,i.overmapEnhancer=YP,i.overmapReducer=UP,i.overmapReducers=xT,i.performRequest=Rn,i.performRequestFromAction=lI,i.projectAccessReducer=MS,i.projectAccessSlice=mn,i.projectAttachmentReducer=NS,i.projectAttachmentSlice=pn,i.projectFileReducer=dT,i.projectFileSlice=fn,i.projectReducer=ST,i.projectSlice=Sn,i.rehydratedReducer=PT,i.rehydratedSlice=Tn,i.restructureSelectorWithArgs=S,i.runMiddleware=PI,i.saveActiveProjectFileBounds=sT,i.selectAccessToken=HO,i.selectAccessesByUserOfProject=bP,i.selectAccessibleProjects=vP,i.selectActiveOrganizationAccess=TP,i.selectActiveProjectFileId=RP,i.selectAllDocumentAttachments=Xs,i.selectAssetAttachmentById=ua,i.selectAssetAttachmentMapping=ra,i.selectAssetAttachments=Jt,i.selectAssetAttachmentsByIds=la,i.selectAssetById=br,i.selectAssetProcedureById=$c,i.selectAssetProcedureStepById=hr,i.selectAssetProcedureStepFieldValues=at,i.selectAssetProcedureStepFieldValuesAttachmentById=Cd,i.selectAssetProcedureStepFieldValuesAttachments=Ts,i.selectAssetProcedureStepFieldValuesAttachmentsByIds=Dd,i.selectAssetProcedureStepFieldValuesAttachmentsMapping=qd,i.selectAssetProcedureStepFieldValuesById=Qd,i.selectAssetProcedureStepFieldValuesByIds=xd,i.selectAssetProcedureStepFieldValuesMapping=Xd,i.selectAssetProcedureStepFieldValuesOfAsset=_O,i.selectAssetProcedureStepFieldValuesOfAssetProcedure=MO,i.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=RO,i.selectAssetProcedureStepFields=At,i.selectAssetProcedureStepFieldsAttachmentById=hd,i.selectAssetProcedureStepFieldsAttachments=ms,i.selectAssetProcedureStepFieldsAttachmentsByIds=md,i.selectAssetProcedureStepFieldsAttachmentsMapping=od,i.selectAssetProcedureStepFieldsById=bd,i.selectAssetProcedureStepFieldsByIds=_d,i.selectAssetProcedureStepFieldsMapping=ps,i.selectAssetProcedureStepFieldsOfAssetProcedureStep=FO,i.selectAssetProcedureStepMapping=ft,i.selectAssetProcedureSteps=Ps,i.selectAssetProcedureStepsByIds=mr,i.selectAssetProcedureStepsMappingOfAssetProcedureType=wO,i.selectAssetProcedureStepsOfAssetProcedureType=vO,i.selectAssetProcedureTypeAttachmentById=ba,i.selectAssetProcedureTypeAttachmentMapping=ga,i.selectAssetProcedureTypeAttachments=Qt,i.selectAssetProcedureTypeAttachmentsByIds=_a,i.selectAssetProcedureTypeById=xc,i.selectAssetProcedureTypeFieldValues=yt,i.selectAssetProcedureTypeFieldValuesAttachmentById=oc,i.selectAssetProcedureTypeFieldValuesAttachments=as,i.selectAssetProcedureTypeFieldValuesAttachmentsByIds=hc,i.selectAssetProcedureTypeFieldValuesAttachmentsMapping=lc,i.selectAssetProcedureTypeFieldValuesById=_c,i.selectAssetProcedureTypeFieldValuesByIds=Mc,i.selectAssetProcedureTypeFieldValuesMapping=bc,i.selectAssetProcedureTypeFieldValuesOfAsset=SO,i.selectAssetProcedureTypeFields=mt,i.selectAssetProcedureTypeFieldsAttachmentById=$a,i.selectAssetProcedureTypeFieldsAttachments=es,i.selectAssetProcedureTypeFieldsAttachmentsByIds=Ua,i.selectAssetProcedureTypeFieldsAttachmentsMapping=Da,i.selectAssetProcedureTypeFieldsById=xa,i.selectAssetProcedureTypeFieldsByIds=ec,i.selectAssetProcedureTypeFieldsMapping=Qa,i.selectAssetProcedureTypeFieldsOfAssetProcedureType=AO,i.selectAssetProcedureTypes=os,i.selectAssetProcedureTypesByIds=ed,i.selectAssetProcedureTypesMapping=Qc,i.selectAssetProcedureTypesOfOrganization=OO,i.selectAssetProcedures=pt,i.selectAssetProceduresByIds=Uc,i.selectAssetProceduresMapping=Cc,i.selectAssetProceduresOfAssetProcedureType=Dc,i.selectAssetProceduresOfAssetType=IO,i.selectAssetStageById=eu,i.selectAssetStageCompletionById=Lr,i.selectAssetStageCompletionMapping=$r,i.selectAssetStageCompletions=Ur,i.selectAssetStageCompletionsByIds=kr,i.selectAssetStages=ws,i.selectAssetStagesByIds=tu,i.selectAssetStagesMappingOfAssetProcedureType=VO,i.selectAssetStagesOfAssetProcedureType=zO,i.selectAssetTypeAttachmentById=ou,i.selectAssetTypeAttachmentMapping=lu,i.selectAssetTypeAttachments=zs,i.selectAssetTypeAttachmentsByIds=hu,i.selectAssetTypeById=to,i.selectAssetTypeFieldValues=Tt,i.selectAssetTypeFieldValuesAttachmentById=Qu,i.selectAssetTypeFieldValuesAttachments=Us,i.selectAssetTypeFieldValuesAttachmentsByIds=xu,i.selectAssetTypeFieldValuesAttachmentsMapping=Xu,i.selectAssetTypeFieldValuesById=ml,i.selectAssetTypeFieldValuesByIds=yl,i.selectAssetTypeFieldValuesMapping=hl,i.selectAssetTypeFieldValuesOfAsset=CO,i.selectAssetTypeFields=ct,i.selectAssetTypeFieldsAttachmentById=_u,i.selectAssetTypeFieldsAttachments=js,i.selectAssetTypeFieldsAttachmentsByIds=Mu,i.selectAssetTypeFieldsAttachmentsMapping=bu,i.selectAssetTypeFieldsById=Uu,i.selectAssetTypeFieldsByIds=Lu,i.selectAssetTypeFieldsMapping=$u,i.selectAssetTypeFieldsOfAssetType=jO,i.selectAssetTypeIdentifierById=Ml,i.selectAssetTypeIdentifierMapping=_l,i.selectAssetTypeIdentifierValueById=Ll,i.selectAssetTypeIdentifierValueMapping=Ul,i.selectAssetTypeIdentifierValues=It,i.selectAssetTypeIdentifierValuesByIds=kl,i.selectAssetTypeIdentifierValuesOfAsset=UO,i.selectAssetTypeIdentifierValuesOfIdentifier=LO,i.selectAssetTypeIdentifiers=Ns,i.selectAssetTypeIdentifiersByIds=Rl,i.selectAssetTypeIdentifiersOfAssetType=$O,i.selectAssetTypeValuesOfAssetType=DO,i.selectAssetTypes=Ws,i.selectAssetTypesByIds=so,i.selectAssetTypesMapping=eo,i.selectAssetTypesOfOrganization=kO,i.selectAssets=St,i.selectAssetsByIds=_r,i.selectAssetsMapping=Fr,i.selectAssetsOfAssetType=gr,i.selectAssetsOfProject=EO,i.selectAttachmentsOfAsset=oa,i.selectAttachmentsOfAssetProcedureStepFieldValues=$d,i.selectAttachmentsOfAssetProcedureStepFields=PO,i.selectAttachmentsOfAssetProcedureType=yO,i.selectAttachmentsOfAssetProcedureTypeFieldValues=mc,i.selectAttachmentsOfAssetProcedureTypeFields=pO,i.selectAttachmentsOfAssetType=mu,i.selectAttachmentsOfAssetTypeFieldValues=el,i.selectAttachmentsOfAssetTypeFields=BO,i.selectAttachmentsOfDocument=YO,i.selectAttachmentsOfFormRevision=tP,i.selectAttachmentsOfFormSubmission=Pm,i.selectAttachmentsOfIssue=Oy,i.selectAttachmentsOfIssueComment=aP,i.selectAttachmentsOfIssueType=rP,i.selectAttachmentsOfIssueTypeFieldValues=gA,i.selectAttachmentsOfIssueTypeFields=uP,i.selectAttachmentsOfProject=MP,i.selectCategories=Ys,i.selectCategoriesByIds=To,i.selectCategoriesOfProject=KO,i.selectCategoryById=Zs,i.selectCategoryMapping=So,i.selectCommentsOfIssue=cP,i.selectConversation=mO,i.selectConversationMapping=Wt,i.selectConversations=hO,i.selectCurrentUser=Bf,i.selectDeletedRequests=OP,i.selectDescendantsOfAssetProcedureStep=yr,i.selectDescendantsOfDocument=Yo,i.selectDocumentAttachmentById=Vo,i.selectDocumentAttachmentMapping=Eo,i.selectDocumentAttachmentsByIds=zo,i.selectDocumentById=Wo,i.selectDocuments=Pt,i.selectDocumentsByIds=Ko,i.selectDocumentsMapping=xs,i.selectFieldValuesOfAssetProcedure=TO,i.selectFormById=lm,i.selectFormIdentifierById=oh,i.selectFormIdentifierMapping=lh,i.selectFormIdentifierValueById=bh,i.selectFormIdentifierValueMapping=gh,i.selectFormIdentifierValues=Ft,i.selectFormIdentifierValuesByIds=_h,i.selectFormIdentifierValuesOfFormSubmission=xO,i.selectFormIdentifierValuesOfIdentifier=eP,i.selectFormIdentifiers=si,i.selectFormIdentifiersByIds=hh,i.selectFormIdentifiersOfForm=QO,i.selectFormMapping=um,i.selectFormRevisionAttachmentById=$h,i.selectFormRevisionAttachments=Dh,i.selectFormRevisionAttachmentsByIds=Uh,i.selectFormRevisionAttachmentsMapping=gt,i.selectFormRevisionById=Yh,i.selectFormRevisionMapping=li,i.selectFormRevisions=bt,i.selectFormRevisionsByIds=Zh,i.selectFormRevisionsOfForm=Jh,i.selectFormSubmissionAttachemntsByIds=Si,i.selectFormSubmissionAttachmentById=Im,i.selectFormSubmissionAttachments=fi,i.selectFormSubmissionAttachmentsByIds=Om,i.selectFormSubmissionAttachmentsMapping=Ai,i.selectFormSubmissionById=zm,i.selectFormSubmissions=Vm,i.selectFormSubmissionsByIds=Bm,i.selectFormSubmissionsMapping=Pi,i.selectFormSubmissionsOfForm=jm,i.selectForms=hi,i.selectFormsByIds=om,i.selectFormsOfOrganization=iP,i.selectGeoImageById=Ym,i.selectGeoImageMapping=Km,i.selectGeoImages=gi,i.selectGeoImagesByIds=Zm,i.selectGeoImagesOfProject=nP,i.selectIsImportingProjectFile=wP,i.selectIsLoggedIn=WO,i.selectIssueAssociationById=cy,i.selectIssueAssociationMapping=dt,i.selectIssueAssociations=ay,i.selectIssueAssociationsByIds=dy,i.selectIssueAssociationsOfAsset=ly,i.selectIssueAssociationsOfIssue=uy,i.selectIssueAssociationsToIssue=ry,i.selectIssueAttachmentById=Py,i.selectIssueAttachmentMapping=Iy,i.selectIssueAttachments=wi,i.selectIssueAttachmentsByIds=Fy,i.selectIssueById=dp,i.selectIssueCommentAttachmentById=qy,i.selectIssueCommentAttachmentMapping=jy,i.selectIssueCommentAttachments=Ei,i.selectIssueCommentAttachmentsByIds=Cy,i.selectIssueCommentById=Zy,i.selectIssueCommentMapping=zi,i.selectIssueCommentsByIds=Jy,i.selectIssueMapping=cp,i.selectIssueTypeAttachmentById=Pp,i.selectIssueTypeAttachmentMapping=Op,i.selectIssueTypeAttachments=Di,i.selectIssueTypeAttachmentsByIds=Fp,i.selectIssueTypeById=hf,i.selectIssueTypeFieldValues=wt,i.selectIssueTypeFieldValuesAttachmentById=PA,i.selectIssueTypeFieldValuesAttachments=Wi,i.selectIssueTypeFieldValuesAttachmentsByIds=FA,i.selectIssueTypeFieldValuesAttachmentsMapping=OA,i.selectIssueTypeFieldValuesById=Jp,i.selectIssueTypeFieldValuesByIds=Xp,i.selectIssueTypeFieldValuesMapping=Zp,i.selectIssueTypeFieldValuesOfIssue=lP,i.selectIssueTypeFields=rt,i.selectIssueTypeFieldsAttachmentById=qp,i.selectIssueTypeFieldsAttachments=Ui,i.selectIssueTypeFieldsAttachmentsByIds=Cp,i.selectIssueTypeFieldsAttachmentsMapping=jp,i.selectIssueTypeFieldsById=lA,i.selectIssueTypeFieldsByIds=oA,i.selectIssueTypeFieldsMapping=uA,i.selectIssueTypeFieldsOfIssueType=oP,i.selectIssueTypeIdentifierById=CA,i.selectIssueTypeIdentifierMapping=qA,i.selectIssueTypeIdentifierValueById=XA,i.selectIssueTypeIdentifierValueMapping=JA,i.selectIssueTypeIdentifierValues=vt,i.selectIssueTypeIdentifierValuesByIds=QA,i.selectIssueTypeIdentifierValuesOfIdentifier=AP,i.selectIssueTypeIdentifierValuesOfIssue=pP,i.selectIssueTypeIdentifiers=Yi,i.selectIssueTypeIdentifiersByIds=DA,i.selectIssueTypeIdentifiersOfIssueType=yP,i.selectIssueTypeMapping=of,i.selectIssueTypeValuesOfIssueType=mP,i.selectIssueTypes=Xi,i.selectIssueTypesByIds=mf,i.selectIssueTypesOfOrganization=fP,i.selectIssueUpdateById=Of,i.selectIssueUpdateMapping=nn,i.selectIssueUpdates=an,i.selectIssueUpdatesByIds=Pf,i.selectIssueUpdatesOfIssue=Ff,i.selectIssues=Rt,i.selectIssuesByIds=rp,i.selectIssuesOfIssueType=up,i.selectIssuesOfProject=dP,i.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=gO,i.selectLatestAssetProcedureTypeFieldsOfAssetProcedureType=fO,i.selectLatestAssetTypeFieldsOfAssetType=qO,i.selectLatestFieldsByAssetProcedureStep=bO,i.selectLatestFormRevisionOfForm=sP,i.selectLatestIssueTypeFieldsOfIssueType=hP,i.selectLatestRetryTime=PP,i.selectMembershipsByUserOfTeam=jP,i.selectOrganizationAccessById=Kf,i.selectOrganizationAccessMapping=zt,i.selectOrganizationAccessUserMapping=Zf,i.selectOrganizationAccessesByIds=Yf,i.selectOrganizationById=rS,i.selectOrganizationDocuments=JO,i.selectOrganizations=dS,i.selectOrganizationsByIds=uS,i.selectOrganizationsMapping=cS,i.selectProjectAccessById=RS,i.selectProjectAccessMapping=yn,i.selectProjectAccesses=ut,i.selectProjectAccessesByIds=wS,i.selectProjectAccessesOfProject=gP,i.selectProjectAttachmentById=LS,i.selectProjectAttachmentMapping=US,i.selectProjectAttachments=An,i.selectProjectAttachmentsByIds=kS,i.selectProjectById=IT,i.selectProjectDocuments=ZO,i.selectProjectFileById=aT,i.selectProjectFileMapping=iT,i.selectProjectFiles=nT,i.selectProjectFilesByIds=cT,i.selectProjectMapping=TT,i.selectProjects=Bt,i.selectProjectsByIds=OT,i.selectProjectsOfOrganization=EP,i.selectRehydrated=BP,i.selectStageMapping=Rs,i.selectTeamById=YT,i.selectTeamMembershipById=jT,i.selectTeamMemberships=jt,i.selectTeamMembershipsByIds=qT,i.selectTeamMembershipsMapping=BT,i.selectTeams=Pn,i.selectTeamsByIds=ZT,i.selectTeamsMapping=KT,i.selectTeamsOfOrganization=CP,i.selectUploadUrl=Qo,i.selectUserById=Vt,i.selectUsers=Et,i.selectUsersByIds=jf,i.selectUsersMapping=un,i.selectUsersOfOrganization=IP,i.selectUsersOfProject=_P,i.selectUsersOfTeam=qP,i.setActiveProjectFileId=tT,i.setAsset=Or,i.setAssetAttachment=ia,i.setAssetAttachments=na,i.setAssetProcedure=Bc,i.setAssetProcedureStep=ir,i.setAssetProcedureStepFieldValues=Hd,i.setAssetProcedureStepFieldValuesAttachment=Ed,i.setAssetProcedureStepFieldValuesAttachments=Vd,i.setAssetProcedureStepFieldValuesMany=Wd,i.setAssetProcedureStepFields=Td,i.setAssetProcedureStepFieldsAttachment=ad,i.setAssetProcedureStepFieldsAttachments=cd,i.setAssetProcedureStepFieldsMany=Id,i.setAssetProcedureSteps=nr,i.setAssetProcedureType=Zc,i.setAssetProcedureTypeAttachment=fa,i.setAssetProcedureTypeAttachments=Sa,i.setAssetProcedureTypeFieldValues=Sc,i.setAssetProcedureTypeFieldValuesAttachment=nc,i.setAssetProcedureTypeFieldValuesAttachments=ac,i.setAssetProcedureTypeFieldValuesMany=Tc,i.setAssetProcedureTypeFields=Ha,i.setAssetProcedureTypeFieldsAttachment=Ea,i.setAssetProcedureTypeFieldsAttachments=Va,i.setAssetProcedureTypeFieldsMany=Wa,i.setAssetProcedureTypes=Jc,i.setAssetProcedures=jc,i.setAssetStage=Hr,i.setAssetStageCompletion=Vr,i.setAssetStageCompletions=zr,i.setAssetStages=Wr,i.setAssetType=Wl,i.setAssetTypeAttachment=au,i.setAssetTypeAttachments=cu,i.setAssetTypeFieldValues=cl,i.setAssetTypeFieldValuesAttachment=Wu,i.setAssetTypeFieldValuesAttachments=Ku,i.setAssetTypeFieldValuesMany=dl,i.setAssetTypeFields=zu,i.setAssetTypeFieldsAttachment=Tu,i.setAssetTypeFieldsAttachments=Iu,i.setAssetTypeFieldsMany=Bu,i.setAssetTypeIdentifier=Il,i.setAssetTypeIdentifierValue=Bl,i.setAssetTypeIdentifierValues=jl,i.setAssetTypeIdentifiers=Ol,i.setAssetTypes=Kl,i.setAssets=Pr,i.setCategories=mo,i.setCategory=ho,i.setClientSDK=fI,i.setClientStore=pI,i.setConversation=Xn,i.setConversations=rO,i.setCurrentUser=SP,i.setDocument=$o,i.setDocumentAttachment=bo,i.setDocumentAttachments=_o,i.setDocuments=Uo,i.setForm=sm,i.setFormIdentifier=nh,i.setFormIdentifierValue=Sh,i.setFormIdentifierValues=Th,i.setFormIdentifiers=ah,i.setFormRevision=Gh,i.setFormRevisionAttachment=Vh,i.setFormRevisionAttachments=zh,i.setFormRevisions=Hh,i.setFormSubmission=_m,i.setFormSubmissionAttachment=pm,i.setFormSubmissionAttachments=Am,i.setFormSubmissions=Mm,i.setForms=im,i.setGeoImage=$m,i.setGeoImages=Um,i.setIsImportingProjectFile=eT,i.setIssue=tp,i.setIssueAssociation=ey,i.setIssueAssociations=xm,i.setIssueAttachment=py,i.setIssueAttachments=Ay,i.setIssueComment=Ny,i.setIssueCommentAttachment=wy,i.setIssueCommentAttachments=vy,i.setIssueComments=Gy,i.setIssueType=af,i.setIssueTypeAttachment=pp,i.setIssueTypeAttachments=Ap,i.setIssueTypeFieldValues=Np,i.setIssueTypeFieldValuesAttachment=AA,i.setIssueTypeFieldValuesAttachments=fA,i.setIssueTypeFieldValuesMany=Gp,i.setIssueTypeFields=iA,i.setIssueTypeFieldsAttachment=wp,i.setIssueTypeFieldsAttachments=vp,i.setIssueTypeFieldsMany=nA,i.setIssueTypeIdentifier=vA,i.setIssueTypeIdentifierValue=GA,i.setIssueTypeIdentifierValues=HA,i.setIssueTypeIdentifiers=EA,i.setIssueTypes=cf,i.setIssueUpdate=ff,i.setIssueUpdates=Sf,i.setIssues=sp,i.setLoggedIn=ao,i.setOrganization=xf,i.setOrganizationAccess=Uf,i.setOrganizationAccesses=Lf,i.setOrganizations=Qf,i.setProject=oT,i.setProjectAccess=OS,i.setProjectAccesses=PS,i.setProjectAttachment=BS,i.setProjectAttachments=jS,i.setProjectFile=WS,i.setProjectFiles=KS,i.setProjects=lT,i.setRehydrated=zP,i.setTeam=LT,i.setTeamMembership=MT,i.setTeamMemberships=RT,i.setTeams=kT,i.setTokens=NO,i.setUploadUrl=Xo,i.setUser=Rf,i.setUsers=Mf,i.shallowEqual=DI,i.slugify=tO,i.spacesToDashesLower=eO,i.teamMembershipReducer=zT,i.teamMembershipSlice=In,i.teamReducer=JT,i.teamSlice=On,i.toFileNameSafeString=xI,i.toUuidArray=D,i.toUuidIdRecord=XI,i.truncate=sO,i.updateAsset=Sr,i.updateAssetAttachment=aa,i.updateAssetAttachments=ca,i.updateAssetProcedure=Ec,i.updateAssetProcedureStep=dr,i.updateAssetProcedureStepFieldValues=Kd,i.updateAssetProcedureStepFieldValuesAttachment=zd,i.updateAssetProcedureStepFieldValuesAttachments=Bd,i.updateAssetProcedureStepFieldValuesMany=Yd,i.updateAssetProcedureStepFields=Od,i.updateAssetProcedureStepFieldsAttachment=dd,i.updateAssetProcedureStepFieldsAttachments=rd,i.updateAssetProcedureStepFieldsMany=Pd,i.updateAssetProcedureSteps=rr,i.updateAssetProcedureType=Hc,i.updateAssetProcedureTypeAttachment=Ta,i.updateAssetProcedureTypeAttachments=Ia,i.updateAssetProcedureTypeFieldValues=Ic,i.updateAssetProcedureTypeFieldValuesAttachment=cc,i.updateAssetProcedureTypeFieldValuesAttachments=dc,i.updateAssetProcedureTypeFieldValuesMany=Oc,i.updateAssetProcedureTypeFields=Ka,i.updateAssetProcedureTypeFieldsAttachment=za,i.updateAssetProcedureTypeFieldsAttachments=Ba,i.updateAssetProcedureTypeFieldsMany=Ya,i.updateAssetProcedureTypes=Wc,i.updateAssetProcedures=Vc,i.updateAssetStage=Zr,i.updateAssetStageCompletion=Br,i.updateAssetStageCompletions=jr,i.updateAssetStages=Jr,i.updateAssetType=Jl,i.updateAssetTypeAttachment=du,i.updateAssetTypeAttachments=ru,i.updateAssetTypeFieldValues=rl,i.updateAssetTypeFieldValuesAttachment=Yu,i.updateAssetTypeFieldValuesAttachments=Zu,i.updateAssetTypeFieldValuesMany=ul,i.updateAssetTypeFields=ju,i.updateAssetTypeFieldsAttachment=Ou,i.updateAssetTypeFieldsAttachments=Pu,i.updateAssetTypeFieldsMany=qu,i.updateAssetTypeIdentifier=Pl,i.updateAssetTypeIdentifierValue=ql,i.updateAssetTypeIdentifierValues=Cl,i.updateAssetTypeIdentifiers=Fl,i.updateAssetTypes=Xl,i.updateAssets=Tr,i.updateCategories=po,i.updateCategory=yo,i.updateConversation=Qn,i.updateConversations=uO,i.updateDocument=Lo,i.updateDocumentAttachment=Mo,i.updateDocumentAttachments=Ro,i.updateDocuments=ko,i.updateForm=nm,i.updateFormIdentifier=ch,i.updateFormIdentifierValue=Ih,i.updateFormIdentifierValues=Oh,i.updateFormIdentifiers=dh,i.updateFormRevision=Wh,i.updateFormRevisionAttachment=Bh,i.updateFormRevisionAttachments=jh,i.updateFormRevisions=Kh,i.updateFormSubmission=wm,i.updateFormSubmissionAttachment=fm,i.updateFormSubmissionAttachments=Sm,i.updateFormSubmissions=vm,i.updateForms=am,i.updateGeoImage=Nm,i.updateGeoImages=Gm,i.updateIssue=ip,i.updateIssueAssociation=ty,i.updateIssueAssociations=sy,i.updateIssueAttachment=fy,i.updateIssueAttachments=Sy,i.updateIssueComment=Hy,i.updateIssueCommentAttachment=Ey,i.updateIssueCommentAttachments=Vy,i.updateIssueComments=Wy,i.updateIssueType=df,i.updateIssueTypeAttachment=fp,i.updateIssueTypeAttachments=Sp,i.updateIssueTypeFieldValues=Hp,i.updateIssueTypeFieldValuesAttachment=SA,i.updateIssueTypeFieldValuesAttachments=TA,i.updateIssueTypeFieldValuesMany=Wp,i.updateIssueTypeFields=aA,i.updateIssueTypeFieldsAttachment=Ep,i.updateIssueTypeFieldsAttachments=Vp,i.updateIssueTypeFieldsMany=cA,i.updateIssueTypeIdentifier=VA,i.updateIssueTypeIdentifierValue=WA,i.updateIssueTypeIdentifierValues=KA,i.updateIssueTypeIdentifiers=zA,i.updateIssueTypes=rf,i.updateIssueUpdate=Tf,i.updateIssueUpdates=If,i.updateIssues=np,i.updateOrganization=iS,i.updateOrganizationAccess=kf,i.updateOrganizationAccesses=Nf,i.updateOrganizations=sS,i.updateProject=pT,i.updateProjectAccess=FS,i.updateProjectAccesses=gS,i.updateProjectAttachment=qS,i.updateProjectAttachments=CS,i.updateProjectFile=JS,i.updateProjectFiles=XS,i.updateProjects=yT,i.updateTeam=NT,i.updateTeamMembership=wT,i.updateTeamMemberships=vT,i.updateTeams=GT,i.updateUser=Ef,i.updateUsers=vf,i.useSelectorBuilder=CI,i.userReducer=zf,i.userSlice=cn,i.uuidObj=M,i.uuidObjSortFn=QI,i.uuidSortFn=Nn,i.versioningReducer=QT,i.versioningSlice=XT,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
14
+ external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(f)}const p=d.type.split("/")[1];if(!p)throw new Error("File has no extension");const A=a??h+"."+p;if(d=$n(d,A),!d.name)throw new Error("Failed to set file's name");await this.addCache(d,h),qt[c]=new Promise(f=>{f(d)})}return d}processPresignedUrls(e){const n={};for(const[a,c]of Object.entries(e))n[a]=this.enqueueRequest({url:c.url,description:"Upload file to S3",method:m.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:a,blockers:[`s3-${c.fields.key}`],blocks:[a],s3url:c});return n}async getFilePayload(e){const n=await et(e),a={sha1:n,file_type:e.type,extension:e.name.split(".").pop(),size:e.size};return await this.client.files.addCache(e,n),a}}class EF extends E{constructor(){super(...arguments);y(this,"name","Form Identifier");y(this,"url","/form-identifiers");y(this,"actions",{addOne:sh,addMany:ih,setOne:nh,setMany:ah,updateOne:ch,updateMany:dh,deleteOne:rh,deleteMany:uh,initialize:th});y(this,"selectors",{selectById:oh,selectByIds:hh})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.uuid)??null,u=new Date().toISOString(),d=M({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[d.form],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,h]}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 l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(()=>{this.dispatch(a(r))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(u)),d}}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 VF extends E{constructor(){super(...arguments);y(this,"name","Form Identifier Value");y(this,"url","/form-identifier-values");y(this,"actions",{addOne:Ah,addMany:fh,setOne:Sh,setMany:Th,updateOne:Ih,updateMany:Oh,deleteOne:Ph,deleteMany:Fh,initialize:ph});y(this,"selectors",{selectById:bh,selectByIds:_h})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.uuid)??null,u=new Date().toISOString(),d=M({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[e.form_submission,e.form_identifier],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,h]}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 value with uuid ${e.uuid} to exist`);const l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(()=>{this.dispatch(a(r))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(u)),d}}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 zF extends E{constructor(){super(...arguments);y(this,"name","Form Revision Attachment");y(this,"url","/form-revision-attachments");y(this,"actions",{addOne:vh,addMany:Eh,setOne:Vh,setMany:zh,updateOne:Bh,updateMany:jh,deleteOne:qh,deleteMany:Ch,initialize:wh});y(this,"selectors",{selectById:$h,selectByIds:Uh})}async bulkAdd(e){var A;const{addMany:n,setMany:a,deleteMany:c}=this.actions,r=new Date().toISOString(),l=((A=this.client.store.getState().userReducer.currentUser)==null?void 0:A.uuid)??null,u={},d=[],h=[];for(const f of e){const{revisionUuid:I,fieldIdentifier:F,file:P}=f,g=await this.client.files.getFilePayload(P);g.sha1 in u||(u[g.sha1]=g);const b=M({file:URL.createObjectURL(P),file_type:P.type,file_name:P.name,file_sha1:g.sha1,created_by:l,form_revision:I,submitted_at:r,field_identifier:F});d.push(b);const v={uuid:b.uuid,file_name:P.name,field_identifier:F,file_extension:g.extension,file_sha1:g.sha1,form_revision:I};h.push(v)}this.dispatch(n(d));const p=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:r,attachments:h,files:Object.values(u)},blockers:d.map(f=>f.form_revision),blocks:d.map(f=>f.uuid)});return p.then(f=>{this.client.files.processPresignedUrls(f.presigned_urls),this.dispatch(a(f.attachments))}).catch(()=>{this.dispatch(c(d.map(f=>f.uuid)))}),[d,p.then(({attachments:f})=>f)]}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 BF extends E{constructor(){super(...arguments);y(this,"name","Form Revision");y(this,"url","/form-revisions");y(this,"actions",{addOne:ci,addMany:di,setOne:Gh,setMany:Hh,updateOne:Wh,updateMany:Kh,deleteOne:ri,deleteMany:ui,initialize:Nh});y(this,"selectors",{selectById:Yh,selectByIds:Zh})}add(e){var A;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,u=((A=n.getState().userReducer.currentUser)==null?void 0:A.uuid)??null,d=new Date().toISOString(),h=M({...e,created_by:u,submitted_at:d});this.dispatch(a(h));const p=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(h),blockers:[e.form],blocks:[h.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(h.uuid))}),[h,p]}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 jF extends E{constructor(){super(...arguments);y(this,"name","Form");y(this,"url","/forms");y(this,"actions",{addOne:em,addMany:tm,setOne:sm,setMany:im,updateOne:nm,updateMany:am,deleteOne:cm,deleteMany:dm,initialize:xh});y(this,"selectors",{selectById:lm,selectByIds:om})}add(e,n){var A;const{store:a}=this.client,{addOne:c,deleteOne:r}=this.actions,l=new Date().toISOString(),u=((A=a.getState().userReducer.currentUser)==null?void 0:A.uuid)??null,d=M({...e,submitted_at:l,created_by:u}),h=M({...n,form:d.uuid,submitted_at:l,created_by:u});this.dispatch(c(d)),this.dispatch(ci(h));const p=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:{...z(d),initial_revision:{uuid:h.uuid,submitted_at:h.submitted_at,title:h.title,description:h.description,fields:h.fields}},blockers:[],blocks:[d.uuid,h.uuid]});return p.catch(f=>{throw this.dispatch(r(d.uuid)),this.dispatch(ri(h.uuid)),f}),[d,h,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error("Expected form to exist");const d=jm(e)(l),h=Jh(e)(l);this.dispatch(a(e)),this.dispatch(Oi(D(d))),this.dispatch(ui(D(h)));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(u)),this.dispatch(di(h)),this.dispatch(Ii(d)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class qF extends E{constructor(){super(...arguments);y(this,"name","Form Submission Attachment");y(this,"url","/form-submission-attachments");y(this,"actions",{addOne:ym,addMany:yi,setOne:pm,setMany:Am,updateOne:fm,updateMany:Sm,deleteOne:Tm,deleteMany:pi,initialize:mm});y(this,"selectors",{selectById:Im,selectByIds:Om})}async bulkAdd(e){var A;const{addMany:n,setMany:a,deleteMany:c}=this.actions,r=new Date().toISOString(),l=((A=this.client.store.getState().userReducer.currentUser)==null?void 0:A.uuid)??null,u={},d=[],h=[];for(const f of e){const{submissionUuid:I,fieldIdentifier:F,file:P}=f,g=await this.client.files.getFilePayload(P);g.sha1 in u||(u[g.sha1]=g);const b=M({file:URL.createObjectURL(P),file_type:P.type,file_name:P.name,file_sha1:g.sha1,created_by:l,form_submission:I,submitted_at:r,field_identifier:F});d.push(b);const v={uuid:b.uuid,file_name:P.name,file_sha1:g.sha1,file_extension:g.extension,field_identifier:F,form_submission:I};h.push(v)}this.dispatch(n(d));const p=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:r,attachments:h,files:Object.values(u)},blockers:d.map(f=>f.form_submission),blocks:d.map(f=>f.uuid)});return p.then(f=>{this.client.files.processPresignedUrls(f.presigned_urls),this.dispatch(a(f.attachments))}).catch(f=>{throw this.dispatch(c(d.map(I=>I.uuid))),f}),[d,p.then(({attachments:f})=>f)]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,r=n.getState(),l=Si(e)(r);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!0),method:m.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:{form_submission__form_revision__form__organization:e}},n)).flat();return this.dispatch(a(r)),r}}class CF extends E{constructor(){super(...arguments);y(this,"name","Form Submission");y(this,"url","/form-submissions");y(this,"actions",{addOne:Rm,addMany:Ii,setOne:_m,setMany:Mm,updateOne:wm,updateMany:vm,deleteOne:Em,deleteMany:Oi,initialize:bm});y(this,"selectors",{selectById:zm,selectByIds:Bm})}add(e){var A;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,u=((A=n.getState().userReducer.currentUser)==null?void 0:A.uuid)??null,d=new Date().toISOString(),h=M({...e,created_by:u,submitted_at:d}),p=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(h),blockers:[e.form_revision],blocks:[h.uuid]});return this.dispatch(a(h)),p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(h.uuid))}),[h,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),l=c(e.uuid)(r);if(!l)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const u={...l,...e};this.dispatch(a(u));const d=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${u.uuid}/`,payload:e,blockers:[u.uuid],blocks:[u.uuid]});return d.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(l))}),[u,d]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected submission with uuid ${e} to exist`);const d=Pm(e)(l);this.dispatch(a(e)),this.dispatch(pi(D(d)));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(u)),this.dispatch(yi(d)),h}}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 DF extends E{constructor(){super(...arguments);y(this,"name","Geo Image");y(this,"url","/geo-images");y(this,"actions",{addOne:Lm,addMany:km,setOne:$m,setMany:Um,updateOne:Nm,updateMany:Gm,deleteOne:Hm,deleteMany:Wm,initialize:Dm});y(this,"selectors",{selectById:Ym,selectByIds:Zm})}async add(e){var F;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,{file:l,...u}=e,d=new Date().toISOString(),h=((F=n.getState().userReducer.currentUser)==null?void 0:F.uuid)??null,p=u.project,A=await this.client.files.getFilePayload(l),f=M({...u,file_name:l.name,file_sha1:A.sha1,file_type:l.type,file:URL.createObjectURL(l),submitted_at:d,created_by:h});this.dispatch(a(f));const I=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:{uuid:f.uuid,submitted_at:d,title:f.title,description:f.description,geo_marker:f.geo_marker,canvas_marker:f.canvas_marker,sha1:f.file_sha1,project:f.project,file_name:f.file_name,direction:f.direction,original_date:f.original_date,file:A},blocks:[p],blockers:[p]});return I.then(P=>{this.client.files.processPresignedUrls(P.presigned_urls),this.dispatch(c(P.geo_image))}).catch(()=>{this.dispatch(r(f.uuid))}),[f,I.then(P=>P.geo_image)]}async bulkAdd(e,n){var F;const{store:a}=this.client,{addMany:c,setMany:r,deleteMany:l}=this.actions,u=new Date().toISOString(),d=((F=a.getState().userReducer.currentUser)==null?void 0:F.uuid)??null,h=[],p=[],A=[],f={};for(const P of e){const{file:g,...b}=P,v=await this.client.files.getFilePayload(g);v.sha1 in f||(f[v.sha1]=v);const B=M({...b,file_name:g.name,file_sha1:v.sha1,file_type:g.type,file:URL.createObjectURL(g),submitted_at:u,created_by:d,project:n});h.push(B),p.push(B.uuid),A.push({uuid:B.uuid,sha1:B.file_sha1,file_name:B.file_name,title:B.title,description:B.description,geo_marker:B.geo_marker,canvas_marker:B.canvas_marker,direction:B.direction,original_date:B.original_date})}this.dispatch(c(h));const I=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:u,project:n,geo_images:A,files:Object.values(f)},blocks:[n],blockers:p});return I.then(P=>{this.client.files.processPresignedUrls(P.presigned_urls),this.dispatch(r(P.geo_images))}).catch(()=>{this.dispatch(l(p))}),[h,I.then(P=>P.geo_images)]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),l=c(e.uuid)(r);if(!l)throw new Error(`Map image with uuid ${e.uuid} does not exist in the store`);const u={...l,...e};this.dispatch(a(u));const d=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return d.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(l))}),[u,d]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Map image with uuid ${e} does not exist in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blocks:[e],blockers:[e]})}catch(d){throw this.dispatch(c(u)),d}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project:e}},n);return this.dispatch(a(c)),c}}class $F extends E{constructor(){super(...arguments);y(this,"name","Issue Association");y(this,"url","/issue-associations");y(this,"actions",{addOne:iy,addMany:_t,setOne:ey,setMany:xm,updateOne:ty,updateMany:sy,deleteOne:ny,deleteMany:Mt,initialize:Qm});y(this,"selectors",{selectById:cy,selectByIds:dy})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=new Date().toISOString(),u=((p=n.getState().userReducer.currentUser)==null?void 0:p.uuid)??null,d=M({...e,submitted_at:l,created_by:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,h]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=r(e)(n.getState());if(!l)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.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:{associated_issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class UF extends Ke{constructor(){super(...arguments);y(this,"name","Issue Attachment");y(this,"url","/issue-attachments");y(this,"actions",{addOne:yy,addMany:Mi,setOne:py,setMany:Ay,updateOne:fy,updateMany:Sy,deleteOne:Ty,deleteMany:Ri,initialize:my});y(this,"selectors",{selectById:Py,selectByIds:Fy})}getId(e){return e.uuid}buildModel(e){return M({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,issue:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,issue:e.issue}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.issueUuid,file:n.file})))}async delete(e){return this._delete(e)}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 LF extends Ke{constructor(){super(...arguments);y(this,"name","Issue Comment Attachment");y(this,"url","/issue-comment-attachments");y(this,"actions",{addOne:My,addMany:Ry,setOne:wy,setMany:vy,updateOne:Ey,updateMany:Vy,deleteOne:zy,deleteMany:By,initialize:_y});y(this,"selectors",{selectById:qy,selectByIds:Cy})}getId(e){return e.uuid}buildModel(e){return M({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,issue_comment:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,issue_comment:e.issue_comment}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.issueCommentUuid,file:n.file})))}async delete(e){return this._delete(e)}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 kF extends E{constructor(){super(...arguments);y(this,"name","Issue Comment");y(this,"url","/issue-comments");y(this,"actions",{addOne:Ly,addMany:ky,setOne:Ny,setMany:Gy,updateOne:Hy,updateMany:Wy,deleteOne:Ky,deleteMany:Yy,initialize:Uy});y(this,"selectors",{selectById:Zy,selectByIds:Jy})}add(e){const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,l=M({...e,author:n.getState().userReducer.currentUser.uuid,submitted_at:new Date().toISOString()});this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(l),blockers:[e.issue],blocks:[l.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,u]}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 l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(()=>{this.dispatch(a(r))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=r(e)(n.getState());if(!l)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}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 NF extends E{constructor(){super(...arguments);y(this,"name","Issue");y(this,"url","/issues");y(this,"actions",{addOne:ep,addMany:ji,setOne:tp,setMany:sp,updateOne:ip,updateMany:np,deleteOne:ap,deleteMany:qi,initialize:xy});y(this,"selectors",{selectById:dp,selectByIds:rp})}add(e){var A;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=n.getState(),u=new Date().toISOString(),d=((A=l.userReducer.currentUser)==null?void 0:A.uuid)??null,h=M({...e,submitted_at:u,created_by:d});this.dispatch(a(h));const p=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(h),blockers:[h.project,h.issue_type,...h.category?[h.category]:[]],blocks:[h.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(h.uuid)),f}),[h,p]}update(e){var p;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 l={...r,...e};this.dispatch(n(l));const u={};for(const A of[$.TITLE,$.DESCRIPTION,$.STATUS,$.CATEGORY,$.PRIORITY,$.ASSIGNED_TO,$.DUE_DATE])if(A in e&&e[A]!==r[A])switch(A){case $.PRIORITY:case $.STATUS:{const f=e[A];u[A]=f!==void 0?Number(f):null;break}case $.DUE_DATE:u[A]=e[A];break;case $.DESCRIPTION:u[A]=e[A];break;case $.TITLE:u[A]=e[A];break;case $.CATEGORY:{const f=e[A];if(f===null)u[A]=null;else{const I=Zs(f)(c);if(!I)throw new Error(`Trying to update category with ${f} which does not exist in store.`);u[A]={name:I.name,color:I.color,uuid:I.uuid}}break}case $.ASSIGNED_TO:{const f=e[A];if(f===null)u[A]=null;else{const I=Vt(f)(c);if(!I)throw new Error(`Trying to update assigned to with ${f} which does not exist in store.`);u[A]={email:I.email,uuid:I.uuid}}break}}const d=M({created_by:((p=c.userReducer.currentUser)==null?void 0:p.uuid)??null,submitted_at:new Date().toISOString(),issue:r.uuid,changes:u});this.dispatch(xi(d));const h=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return h.then(A=>{this.dispatch(n(A))}).catch(()=>{this.dispatch(n(r)),this.dispatch(tn(d.uuid))}),[l,h]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`No issue with uuid ${e} found in the store`);const d=Oy(e)(l),h=Ff(e)(l),p={};for(const f of ry(e)(l))p[f.uuid]=f;for(const f of uy(e)(l))p[f.uuid]=f;const A=Object.values(p);this.dispatch(a(e)),this.dispatch(Ri(D(d))),this.dispatch(sn(D(h))),this.dispatch(Mt(D(A)));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(c(u)),this.dispatch(Mi(d)),this.dispatch(en(h)),this.dispatch(_t(A)),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 GF extends Ke{constructor(){super(...arguments);y(this,"name","Issue Type Attachment");y(this,"url","/issue-type-attachments");y(this,"actions",{addOne:mp,addMany:yp,setOne:pp,setMany:Ap,updateOne:fp,updateMany:Sp,deleteOne:Tp,deleteMany:Ip,initialize:hp});y(this,"selectors",{selectById:Pp,selectByIds:Fp})}getId(e){return e.uuid}buildModel(e){return M({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,issue_type:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,issue_type:e.issue_type}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.issueTypeUuid,file:n.file})))}async delete(e){return this._delete(e)}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 HF extends E{constructor(){super(...arguments);y(this,"name","Issue Type Fields Attachment");y(this,"url","/issue-type-fields-attachments");y(this,"actions",{addOne:Mp,addMany:Rp,setOne:wp,setMany:vp,updateOne:Ep,updateMany:Vp,deleteOne:zp,deleteMany:Bp,initialize:_p});y(this,"selectors",{selectById:qp,selectByIds:Cp})}async bulkAdd(e){var A;const{addMany:n,setMany:a,deleteMany:c}=this.actions,r=new Date().toISOString(),l=((A=this.client.store.getState().userReducer.currentUser)==null?void 0:A.uuid)??null,u={},d=[],h=[];for(const f of e){const{fieldsRevisionUuid:I,fieldIdentifier:F,file:P}=f,g=await this.client.files.getFilePayload(P);g.sha1 in u||(u[g.sha1]=g);const b=M({file:URL.createObjectURL(P),file_type:P.type,file_name:P.name,file_sha1:g.sha1,created_by:l,fields_revision:I,submitted_at:r,field_identifier:F});d.push(b);const v={uuid:b.uuid,file_name:P.name,file_extension:g.extension,field_identifier:F,file_sha1:g.sha1,fields_revision:I};h.push(v)}this.dispatch(n(d));const p=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:r,attachments:h,files:Object.values(u)},blockers:d.map(f=>f.fields_revision),blocks:d.map(f=>f.uuid)});return p.then(f=>{this.client.files.processPresignedUrls(f.presigned_urls),this.dispatch(a(f.attachments))}).catch(()=>{this.dispatch(c(d.map(f=>f.uuid)))}),[d,p.then(({attachments:f})=>f)]}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 WF extends E{constructor(){super(...arguments);y(this,"name","Issue Type Fields");y(this,"url","/issue-type-fields");y(this,"actions",{addOne:tA,addMany:sA,setOne:iA,setMany:nA,updateOne:aA,updateMany:cA,deleteOne:dA,deleteMany:rA,initialize:eA});y(this,"selectors",{selectById:lA,selectByIds:oA})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.uuid)??null,u=new Date().toISOString(),d=M({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[d.issue_type],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(A=>{throw this.dispatch(r(d.uuid)),A}),[d,h]}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 KF extends E{constructor(){super(...arguments);y(this,"name","Issue Type Field Values Attachment");y(this,"url","/issue-type-field-values-attachments");y(this,"actions",{addOne:pA,addMany:Gi,setOne:AA,setMany:fA,updateOne:SA,updateMany:TA,deleteOne:IA,deleteMany:Hi,initialize:yA});y(this,"selectors",{selectById:PA,selectByIds:FA})}async bulkAdd(e){var A;const{addMany:n,setMany:a,deleteMany:c}=this.actions,r=new Date().toISOString(),l=((A=this.client.store.getState().userReducer.currentUser)==null?void 0:A.uuid)??null,u={},d=[],h=[];for(const f of e){const{fieldValuesUuid:I,fieldIdentifier:F,file:P}=f,g=await this.client.files.getFilePayload(P);g.sha1 in u||(u[g.sha1]=g);const b=M({file:URL.createObjectURL(P),file_type:P.type,file_name:P.name,file_sha1:g.sha1,created_by:l,field_values:I,submitted_at:r,field_identifier:F});d.push(b);const v={uuid:b.uuid,file_name:P.name,file_sha1:g.sha1,file_extension:g.extension,field_identifier:F,field_values:I};h.push(v)}this.dispatch(n(d));const p=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:r,attachments:h,files:Object.values(u)},blockers:d.map(f=>f.field_values),blocks:d.map(f=>f.uuid)});return p.then(({presigned_urls:f,attachments:I})=>{this.client.files.processPresignedUrls(f),this.dispatch(a(I))}).catch(f=>{throw this.dispatch(c(d.map(I=>I.uuid))),f}),[d,p.then(({attachments:f})=>f)]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,l=n.getState(),u=r(e)(l);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!0),method:m.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(d){throw this.dispatch(c(u)),d}}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 YF extends E{constructor(){super(...arguments);y(this,"name","Issue Type Field Values");y(this,"url","/issue-type-field-values");y(this,"actions",{addOne:Lp,addMany:kp,setOne:Np,setMany:Gp,updateOne:Hp,updateMany:Wp,deleteOne:Kp,deleteMany:Yp,initialize:Up});y(this,"selectors",{selectById:Jp,selectByIds:Xp})}add(e){var A;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,u=((A=n.getState().userReducer.currentUser)==null?void 0:A.uuid)??null,d=new Date().toISOString(),h=M({...e,created_by:u,submitted_at:d}),p=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(h),blockers:[e.issue,e.fields_revision],blocks:[h.uuid]});return this.dispatch(a(h)),p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(h.uuid))}),[h,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),l=c(e.uuid)(r);if(!l)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const u={...l,...e};this.dispatch(a(u));const d=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[u.uuid,u.fields_revision,u.issue],blocks:[u.uuid]});return d.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(l))}),[u,d]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected submission with uuid ${e} to exist`);const d=gA(e)(l);this.dispatch(a(e)),this.dispatch(Hi(D(d)));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(u)),this.dispatch(Gi(d)),h}}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 ZF extends E{constructor(){super(...arguments);y(this,"name","Issue Type Identifier");y(this,"url","/issue-type-identifiers");y(this,"actions",{addOne:RA,addMany:wA,setOne:vA,setMany:EA,updateOne:VA,updateMany:zA,deleteOne:BA,deleteMany:jA,initialize:MA});y(this,"selectors",{selectById:CA,selectByIds:DA})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.uuid)??null,u=new Date().toISOString(),d=M({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[d.issue_type],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,h]}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 l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(()=>{this.dispatch(a(r))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(u)),d}}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 JF extends E{constructor(){super(...arguments);y(this,"name","Issue Type Identifier Value");y(this,"url","/issue-type-identifier-values");y(this,"actions",{addOne:kA,addMany:NA,setOne:GA,setMany:HA,updateOne:WA,updateMany:KA,deleteOne:YA,deleteMany:ZA,initialize:LA});y(this,"selectors",{selectById:XA,selectByIds:QA})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.uuid)??null,u=new Date().toISOString(),d=M({...e,created_by:l,submitted_at:u});this.dispatch(a(d));const h=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(d),blockers:[e.issue,e.issue_type_identifier],blocks:[d.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,h]}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 value with uuid ${e.uuid} to exist`);const l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(()=>{this.dispatch(a(r))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(u)),d}}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 XF extends E{constructor(){super(...arguments);y(this,"name","Issue Type");y(this,"url","/issue-types");y(this,"actions",{addOne:sf,addMany:nf,setOne:af,setMany:cf,updateOne:df,updateMany:rf,deleteOne:uf,deleteMany:lf,initialize:tf});y(this,"selectors",{selectById:hf,selectByIds:mf})}add(e){var A;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,u=((A=n.getState().userReducer.currentUser)==null?void 0:A.uuid)??null,d=new Date().toISOString(),h=M({...e,submitted_at:d,created_by:u});this.dispatch(a(h));const p=this.enqueueRequest({method:m.POST,url:`${this.url}/`,payload:z(h),blockers:[],blocks:[h.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(h.uuid))}),[h,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),l=c(e.uuid)(r);if(!l)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const u={...l,...e};this.dispatch(a(u));const d=this.enqueueRequest({method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return d.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(l))}),[u,d]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const d=up(e)(l);this.dispatch(a(e)),this.dispatch(qi(D(d)));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(u)),this.dispatch(ji(d)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class QF extends E{constructor(){super(...arguments);y(this,"name","Issue Update");y(this,"url","/issue-updates");y(this,"actions",{addOne:xi,addMany:en,setOne:ff,setMany:Sf,updateOne:Tf,updateMany:If,deleteOne:tn,deleteMany:sn,initialize:Af});y(this,"selectors",{selectById:Of,selectByIds:Pf})}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 xF=1800;function eg(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 tg extends xP{constructor(){super(...arguments);y(this,"_getRenewedTokens",async e=>{const n=this.performRequest({method:m.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(ao(!1)),this.clearTokens(),this.dispatch(_()),this.dispatch(_())}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.log("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=VI(e).exp??n}catch{a=n}return a-n<xF}getAuthHeader(){return`Bearer ${this.getAccessToken()}`}async prepareAuth(){if(this.tokenIsExpiringSoon()){console.debug(this.constructor.name,"preparing auth");try{await this.renewTokens()}catch(e){return e instanceof U&&this.clearAuth(),e instanceof Error?Promise.reject(e):Promise.reject(new Error((e??tt).toString()))}}}async handleUnauthorized(e,n){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 U({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 U({message:"Incorrect username or password.",response:n,discard:!0})}async initAuth(e){const n=xe.v4();return console.debug(this.constructor.name,"Initiating auth"),this.performRequest({uuid:n,method:m.POST,url:this.initTokensUrl,payload:e,isAuthNeeded:!1,checkAuth:!1}).then(a=>{this.setTokens(eg(a))})}}class lt extends Ze{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:m.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:m.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:m.GET,...s},e)}}class sg extends lt{constructor(){super(...arguments);y(this,"name","Organization Access");y(this,"url","/organization-accesses");y(this,"actions",{addOne:Df,addMany:$f,setOne:Uf,setMany:Lf,updateOne:kf,updateMany:Nf,deleteOne:Gf,deleteMany:Hf,initialize:Cf});y(this,"selectors",{selectById:Kf,selectByIds:Yf})}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState()),l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(d=>{throw this.dispatch(a(r)),d}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l),d=Vt(u.user)(l);this.dispatch(a(u.uuid)),this.dispatch(rn(u.user));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${u.uuid}/`,blockers:[u.uuid],blocks:[]})}catch(h){throw this.dispatch(c(u)),this.dispatch(dn(d)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class ig extends lt{constructor(){super(...arguments);y(this,"name","Organization");y(this,"url","/organizations");y(this,"actions",{addOne:tS,addMany:eS,setOne:xf,setMany:Qf,updateOne:iS,updateMany:sS,deleteOne:nS,deleteMany:aS,initialize:Xf});y(this,"selectors",{selectById:rS,selectByIds:uS})}async add(e){const{addOne:n}=this.actions,a=await this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.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:O(m.PATCH,this.name,!1),method:m.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:O(m.POST,this.name,!1),method:m.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 ng extends E{constructor(){super(...arguments);y(this,"name","Project Access");y(this,"url","/project-accesses");y(this,"actions",{addOne:TS,addMany:IS,setOne:OS,setMany:PS,updateOne:FS,updateMany:gS,deleteOne:bS,deleteMany:_S,initialize:SS});y(this,"selectors",{selectById:RS,selectByIds:wS})}add(e){var d;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=M({...e,created_by:((d=n.getState().userReducer.currentUser)==null?void 0:d.uuid)??null});this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(l),blockers:[l.organization_access,l.project],blocks:[l.uuid]});return u.then(h=>{this.dispatch(c(h))}).catch(h=>{throw this.dispatch(r(l.uuid)),h}),[l,u]}bulkAdd(e){var h;const{store:n}=this.client,{addMany:a,deleteMany:c,updateMany:r}=this.actions,l=((h=n.getState().userReducer.currentUser)==null?void 0:h.uuid)??null,u=e.map(p=>M({...p,created_by:l}));this.dispatch(a(u));const d=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{project_accesses:u.map(p=>z(p))},blockers:u.flatMap(p=>[p.project,p.organization_access]),blocks:u.map(p=>p.uuid)});return d.then(p=>{this.dispatch(r(p))}).catch(p=>{throw this.dispatch(c(u.map(A=>A.uuid))),p}),[u,d]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState()),l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return u.then(d=>{this.dispatch(a(d))}).catch(d=>{throw this.dispatch(a(r)),d}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,l=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.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:{project__organization:e}},n);return this.dispatch(a(c)),c}}class ag extends Ke{constructor(){super(...arguments);y(this,"name","Project Attachment");y(this,"url","/project-attachments");y(this,"actions",{addOne:VS,addMany:zS,setOne:BS,setMany:jS,updateOne:qS,updateMany:CS,deleteOne:DS,deleteMany:$S,initialize:ES});y(this,"selectors",{selectById:LS,selectByIds:kS})}getId(e){return e.uuid}buildModel(e){return M({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,project:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,project:e.project}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.projectUuid,file:n.file})))}async delete(e){return this._delete(e)}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 cg extends E{constructor(){super(...arguments);y(this,"name","Project File");y(this,"url","/project-files");y(this,"actions",{addOne:YS,addMany:ZS,setOne:WS,setMany:KS,updateOne:JS,updateMany:XS,deleteOne:QS,deleteMany:xS,initialize:HS});y(this,"selectors",{selectById:aT,selectByIds:cT})}async saveExisting(e){const{setOne:n}=this.actions;if(!e.uuid)throw new Error("You can only use this method to save existing project files. The one provided has no uuid.");const a={...e};delete a.file;const c=this.enqueueRequest({method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:a,blockers:[e.uuid],blocks:[e.uuid]});return c.then(r=>{this.dispatch(n(r))}),c}saveActive(){const{store:e}=this.client,{setOne:n}=this.actions,a=e.getState(),c=a.projectFileReducer.activeProjectFileId;if(!c)throw new Error("No active project file");const r=a.projectFileReducer.instances[c];if(!r)throw new Error("No active project file");if(!r.bounds&&!r.canvas_bounds)throw new Error("Project file must either have bounds or canvas_bounds set");let l;if(typeof r.file=="string"&&!r.file.startsWith("blob:")){const h={...r};delete h.file,l={method:m.PATCH,url:`${this.url}/${c}/`,payload:h,blockers:[c],blocks:[c]}}else l=new Promise((h,p)=>{this.client.files.uploadFileToS3(r.file_sha1).then(([A])=>{h({method:m.POST,url:`${this.url}/`,payload:{...r,...A},blockers:[c],blocks:[c]})}).catch(p)});const d=Promise.resolve(l).then(h=>this.enqueueRequest(h));return d.then(h=>{this.dispatch(n(h))}),this.dispatch(sT),this.dispatch(tT(null)),this.dispatch(eT(!1)),[r,d]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:r}=this.selectors,l=r(e)(n.getState());if(!l)throw new Error(`Expected project file with uuid ${e} to exist in the store.`);this.dispatch(c(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.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,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class dg extends lt{constructor(){super(...arguments);y(this,"name","Project");y(this,"url","/projects");y(this,"actions",{addOne:mT,addMany:hT,setOne:oT,setMany:lT,updateOne:pT,updateMany:yT,deleteOne:AT,deleteMany:fT,initialize:uT});y(this,"selectors",{selectById:IT,selectByIds:OT})}async add(e){const{addOne:n}=this.actions,a=await this.performRequest({method:m.POST,url:`${this.url}/`,payload:z(e)});return this.dispatch(n(a)),a}async update(e){const{updateOne:n}=this.actions,a=await this.performRequest({method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:z(e)});return this.dispatch(n(a)),a}async delete(e){const{deleteOne:n}=this.actions,a=await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.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 rg extends E{constructor(){super(...arguments);y(this,"name","Team Membership");y(this,"url","/team-memberships");y(this,"actions",{addOne:bT,addMany:_T,setOne:MT,setMany:RT,updateOne:wT,updateMany:vT,deleteOne:ET,deleteMany:VT,initialize:gT});y(this,"selectors",{selectById:jT,selectByIds:qT})}add(e){var d;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=M({...e,created_by:((d=n.getState().userReducer.currentUser)==null?void 0:d.uuid)??null});this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(l),blockers:[e.team],blocks:[l.uuid]});return u.then(h=>{this.dispatch(c(h))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,u]}bulkAdd(e){var h;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,l=((h=n.getState().userReducer.currentUser)==null?void 0:h.uuid)??null,u=e.map(p=>M({...p,created_by:l}));this.dispatch(a(u));const d=this.enqueueRequest({description:O(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{team_memberships:u.map(p=>z(p))},blockers:u.map(p=>p.team),blocks:u.map(p=>p.uuid)});return d.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(u.map(p=>p.uuid)))}),[u,d]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(d){throw this.dispatch(c(u)),d}}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 ug extends E{constructor(){super(...arguments);y(this,"name","Team");y(this,"url","/teams");y(this,"actions",{addOne:$T,addMany:UT,setOne:LT,setMany:kT,updateOne:NT,updateMany:GT,deleteOne:HT,deleteMany:WT,initialize:DT});y(this,"selectors",{selectById:YT,selectByIds:ZT})}add(e){var d;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=M({...e,submitted_at:new Date().toISOString(),created_by:((d=n.getState().userReducer.currentUser)==null?void 0:d.uuid)??null});this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:z(l),blockers:[],blocks:[l.uuid]});return u.then(h=>{this.dispatch(c(h))}).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 team with uuid ${e.uuid} to exist`);const l={...r,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:O(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:z(e),blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(a(d))}).catch(()=>{this.dispatch(a(r))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,l=n.getState(),u=r(e)(l);if(!u)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:O(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(d){throw this.dispatch(c(u)),d}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class lg extends lt{constructor(){super(...arguments);y(this,"name","User");y(this,"url","/user");y(this,"actions",{addOne:dn,addMany:wf,setOne:Rf,setMany:Mf,updateOne:Ef,updateMany:vf,deleteOne:rn,deleteMany:Vf,initialize:_f});y(this,"selectors",{selectById:Vt,selectByIds:jf})}async list(e,n){const{organizationUuid:a,...c}=e,r=a?`/organizations/${a}${this.url}s/`:`/${this.url}`;return this.performRequest({method:m.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}}async function Rn(t,s,e,n,a){const c=n instanceof Ze;c&&s.checkAuth!==!1&&await n.auth.prepareAuth();const r={queryParams:"",isAuthNeeded:!0},{s3url:l,payload:u,headers:d,method:h,queryParams:p,attachmentHash:A,isExternalUrl:f,isAuthNeeded:I,isResponseBlob:F}={...r,...s};let P=s.url;const g=A?await e.files.fetchCache(A):void 0;if(A&&!g)throw new Error(`Cannot upload file ${A} because it's not cached.`);!f&&!P.startsWith("http")&&(!P.startsWith("/")&&!P.startsWith("blob:")&&(P="/"+P),P=t+P);const b=q=>{if(A){if(!l)throw new Error(`No S3 URL for file ${A}`);if("warning"in l)throw new Error(`S3 URL warning for file ${A}`);if(!g)throw new Error(`No file for file ${A}`);const j=l.fields["x-amz-checksum-sha1"];if(!j)throw new Error(`No checksum for file ${A}`);return q.set("x-amz-checksum-sha1",j).field({...u,...l.fields}).attach("file",g)}return q.send(u)},B={[m.GET]:()=>F?Qe.get(P.toString()).responseType("blob"):Qe.get(P.toString()),[m.POST]:()=>{const q=Qe.post(P.toString());return b(q)},[m.PATCH]:()=>{const q=Qe.patch(P.toString());return b(q)},[m.PUT]:()=>{const q=Qe.put(P.toString());return b(q)},[m.DELETE]:()=>{const q=Qe.delete(P.toString());return b(q)}}[h];let V=B();if(a==null||a.addEventListener("abort",()=>{console.debug("aborting request:",s.url),V.abort()}),I&&c){const q=n.auth.getAuthHeader();V=V.set("Authorization",q)}d&&(V=V.set(d));try{return await V.query(p)}catch(q){const j=mI(q),bI=j==null?void 0:j.status;if(c&&bI===401)return await n.auth.handleUnauthorized(V,j),V.query(p);throw new U({response:j,innerError:q,discard:gn.includes(bI)})}}class og{constructor(s){y(this,"store");this.store=s}_performRequest(s,e,n,a){const c=new Ut,r={...e,uuid:e.uuid??xe.v4()};return Rn(s,r,this,n,a).then(l=>{c.resolve(l.body)}).catch(l=>{l instanceof Error?c.reject(l):c.reject(new Error((l??tt).toString()))}),c}async performRequest(s,e,n,a){return this._performRequest(s,e,n,a).then(c=>{if(c instanceof U)throw c;return c})}async enqueueRequest(s,e,n){return this._enqueueRequest(s,e,n).then(a=>{if(a instanceof U)throw a;return a})}_enqueueRequest(s,e,n){const a=new Ut,c={...s,BASE_URL:e,serviceName:n},r=this.store.dispatch(mS(c)),l=d=>{if(d)a.resolve(d.body);else{const h=new U({message:"Could not get a response from the server.",response:d,discard:!0});a.reject(h)}},u=d=>{d instanceof U?d.options.discard=!0:(console.error("Received an unexpected error while processing a request:",d,`
15
+ Converting error to APIError and discarding.`),d=new U({message:"An error occurred while processing the request.",innerError:d,discard:!0})),a.reject(d)};return r.then(l,u),a}async performPagination(s,e,n,a,c){const r={...e,queryParams:{...e.queryParams,paginate:!0,limit:n}},{method:l}=r,u=[];let d=await this.performRequest(s,r,a,c);for(u.push(d.results);d.next;)d=await this.performRequest(s,{url:d.next,method:l},a,c),u.push(d.results);return u}}class st{constructor(){y(this,"graph");y(this,"requestAttemptCounter");this.graph=new zI.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(s){const e=new st;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(l=>a.payload.blockers.includes(l))&&st._addDependency(a.payload.uuid,r.payload.uuid,e.graph)}}return e}_addDependency(s,e){st._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 yI;function pI(t){yI=t}function it(){return yI}let AI;function fI(t){AI=t}function SI(){return AI}let wn=null;function Xe(){const t=it();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(wn)return wn;const s=t.getState().offline.outbox,e=st._fromOutbox(s);return wn=e,e}const hg=(t,s)=>{const e=new s(t);return fI(e),pI(t),e};class mg{constructor(s){y(this,"_all");y(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 vn{constructor(){y(this,"next");this.next=null}then(s){return new mg(this).then(s)}async run(s){if(this.next)return this.next.run(s);{if(console.debug("Middleware finished. Performing request:",s.payload.url),!it())throw new Error("Client store not set");const n=SI();if(!n)throw new Error("Client SDK not set");return lI(s,n)}}}class TI extends vn{async run(s){return super.run(s)}}class II extends vn{async run(s){return super.run(s)}}const OI=new TI().then(new II).compile();function PI(t){var s;return(s=OI[0])==null?void 0:s.run(t)}var FI=(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))(FI||{});i.ALL_MIDDLEWARE=OI,i.APIError=U,i.ATTACHMENT_MODEL_DEFAULT_PAGE_SIZE=tI,i.AgentService=eF,i.AssetAttachmentService=tF,i.AssetProcedureService=dF,i.AssetProcedureStepFieldValuesAttachmentService=oF,i.AssetProcedureStepFieldValuesService=hF,i.AssetProcedureStepFieldsAttachmentService=uF,i.AssetProcedureStepFieldsService=lF,i.AssetProcedureStepService=mF,i.AssetProcedureTypeAttachmentService=sF,i.AssetProcedureTypeFieldValuesAttachmentService=aF,i.AssetProcedureTypeFieldValuesService=cF,i.AssetProcedureTypeFieldsAttachmentService=iF,i.AssetProcedureTypeFieldsService=nF,i.AssetProcedureTypeService=rF,i.AssetService=yF,i.AssetStageCompletionService=pF,i.AssetStageService=AF,i.AssetTypeAttachmentService=fF,i.AssetTypeFieldValuesAttachmentService=IF,i.AssetTypeFieldValuesService=OF,i.AssetTypeFieldsAttachmentService=SF,i.AssetTypeFieldsService=TF,i.AssetTypeIdentifierService=PF,i.AssetTypeIdentifierValueService=FF,i.AssetTypeService=gF,i.AttachmentModel=qn,i.BaseApiService=Ze,i.BaseModelApiService=lt,i.BaseOfflineAttachmentModelService=Ke,i.BaseOfflineModelApiService=E,i.BaseSDK=og,i.COMMON_AUTO_FIELDS=kn,i.CategoryService=bF,i.DEFAULT_ISSUE_PRIORITY=jI,i.DEFAULT_ISSUE_STATUS=BI,i.DEFAULT_PAGE_SIZE=eI,i.DISCARD_HTTP_STATUSES=gn,i.DeferredPromise=Ut,i.DocumentAttachmentService=_F,i.DocumentService=MF,i.EMPTY_ARRAY=zn,i.EMPTY_OBJECT=Bn,i.EmailVerificationService=RF,i.FileService=vF,i.FormIdentifierService=EF,i.FormIdentifierValueService=VF,i.FormRevisionAttachmentService=zF,i.FormRevisionService=BF,i.FormService=jF,i.FormSubmissionAttachmentService=qF,i.FormSubmissionService=CF,i.GeoImageService=DF,i.HttpMethod=m,i.IssueAssociationService=$F,i.IssueAttachmentService=UF,i.IssueCommentAttachmentService=LF,i.IssueCommentService=kF,i.IssuePriority=Dt,i.IssueService=NF,i.IssueStatus=$t,i.IssueTypeAttachmentService=GF,i.IssueTypeFieldValuesAttachmentService=KF,i.IssueTypeFieldValuesService=YF,i.IssueTypeFieldsAttachmentService=HF,i.IssueTypeFieldsService=WF,i.IssueTypeIdentifierService=ZF,i.IssueTypeIdentifierValueService=JF,i.IssueTypeService=XF,i.IssueUpdateChange=$,i.IssueUpdateService=QF,i.JWTService=tg,i.MAX_SERVICE_BATCH_SIZE=Ye,i.OUTBOX_RETRY_DELAY=Cn,i.OfflineAnalyticsMiddleware=TI,i.OfflineMiddleware=vn,i.OrganizationAccessLevel=jn,i.OrganizationAccessService=sg,i.OrganizationService=ig,i.OutboxCoordinator=st,i.ProjectAccessService=ng,i.ProjectAttachmentService=ag,i.ProjectFileService=cg,i.ProjectService=dg,i.RESET_ORGANIZATION_STATE=w,i.RESET_PROJECT_STATE=C,i.RESET_STATE=_,i.RateLimitingMiddleware=II,i.SelectorBuilder=cO,i.TeamMembershipService=rg,i.TeamService=ug,i.UNKNOWN_ERROR_MESSAGE=tt,i.UserService=lg,i.VERSION_REDUCER_KEY=nt,i.VerificationCodeType=FI,i._setLatestRetryTime=pS,i.addAsset=fr,i.addAssetAttachment=sa,i.addAssetAttachments=Yt,i.addAssetProcedure=vc,i.addAssetProcedureStep=ar,i.addAssetProcedureStepFieldValues=Nd,i.addAssetProcedureStepFieldValuesAttachment=vd,i.addAssetProcedureStepFieldValuesAttachments=fs,i.addAssetProcedureStepFieldValuesMany=Gd,i.addAssetProcedureStepFields=fd,i.addAssetProcedureStepFieldsAttachment=id,i.addAssetProcedureStepFieldsAttachments=nd,i.addAssetProcedureStepFieldsMany=Sd,i.addAssetProcedureSteps=cr,i.addAssetProcedureType=Nc,i.addAssetProcedureTypeAttachment=pa,i.addAssetProcedureTypeAttachments=Aa,i.addAssetProcedureTypeFieldValues=Ac,i.addAssetProcedureTypeFieldValuesAttachment=ic,i.addAssetProcedureTypeFieldValuesAttachments=is,i.addAssetProcedureTypeFieldValuesMany=fc,i.addAssetProcedureTypeFields=Na,i.addAssetProcedureTypeFieldsAttachment=wa,i.addAssetProcedureTypeFieldsAttachments=va,i.addAssetProcedureTypeFieldsMany=Ga,i.addAssetProcedureTypes=Gc,i.addAssetProcedures=rs,i.addAssetStage=Kr,i.addAssetStageCompletion=vr,i.addAssetStageCompletions=Er,i.addAssetStages=Yr,i.addAssetType=Yl,i.addAssetTypeAttachment=nu,i.addAssetTypeAttachments=Es,i.addAssetTypeFieldValues=nl,i.addAssetTypeFieldValuesAttachment=Hu,i.addAssetTypeFieldValuesAttachments=Ds,i.addAssetTypeFieldValuesMany=al,i.addAssetTypeFields=Eu,i.addAssetTypeFieldsAttachment=fu,i.addAssetTypeFieldsAttachments=Su,i.addAssetTypeFieldsMany=Vu,i.addAssetTypeIdentifier=Sl,i.addAssetTypeIdentifierValue=Vl,i.addAssetTypeIdentifierValues=zl,i.addAssetTypeIdentifiers=Tl,i.addAssetTypes=Zl,i.addAssets=gs,i.addCategories=oo,i.addCategory=lo,i.addConversation=Jn,i.addConversations=dO,i.addDocument=Co,i.addDocumentAttachment=Fo,i.addDocumentAttachments=go,i.addDocuments=Do,i.addForm=em,i.addFormIdentifier=sh,i.addFormIdentifierValue=Ah,i.addFormIdentifierValues=fh,i.addFormIdentifiers=ih,i.addFormRevision=ci,i.addFormRevisionAttachment=vh,i.addFormRevisionAttachments=Eh,i.addFormRevisions=di,i.addFormSubmission=Rm,i.addFormSubmissionAttachment=ym,i.addFormSubmissionAttachments=yi,i.addFormSubmissions=Ii,i.addForms=tm,i.addGeoImage=Lm,i.addGeoImages=km,i.addIssue=ep,i.addIssueAssociation=iy,i.addIssueAssociations=_t,i.addIssueAttachment=yy,i.addIssueAttachments=Mi,i.addIssueComment=Ly,i.addIssueCommentAttachment=My,i.addIssueCommentAttachments=Ry,i.addIssueComments=ky,i.addIssueType=sf,i.addIssueTypeAttachment=mp,i.addIssueTypeAttachments=yp,i.addIssueTypeFieldValues=Lp,i.addIssueTypeFieldValuesAttachment=pA,i.addIssueTypeFieldValuesAttachments=Gi,i.addIssueTypeFieldValuesMany=kp,i.addIssueTypeFields=tA,i.addIssueTypeFieldsAttachment=Mp,i.addIssueTypeFieldsAttachments=Rp,i.addIssueTypeFieldsMany=sA,i.addIssueTypeIdentifier=RA,i.addIssueTypeIdentifierValue=kA,i.addIssueTypeIdentifierValues=NA,i.addIssueTypeIdentifiers=wA,i.addIssueTypes=nf,i.addIssueUpdate=xi,i.addIssueUpdates=en,i.addIssues=ji,i.addOrganization=tS,i.addOrganizationAccess=Df,i.addOrganizationAccesses=$f,i.addOrganizations=eS,i.addProject=mT,i.addProjectAccess=TS,i.addProjectAccesses=IS,i.addProjectAttachment=VS,i.addProjectAttachments=zS,i.addProjectFile=YS,i.addProjectFiles=ZS,i.addProjects=hT,i.addTeam=$T,i.addTeamMembership=bT,i.addTeamMemberships=_T,i.addTeams=UT,i.addUser=dn,i.addUsers=wf,i.agentsReducer=xn,i.agentsSlice=Ht,i.areArraysEqual=$I,i.assetAttachmentReducer=ha,i.assetAttachmentSlice=Kt,i.assetProcedureReducer=qc,i.assetProcedureSlice=ds,i.assetProcedureStepFieldValuesAttachmentReducer=Ud,i.assetProcedureStepFieldValuesAttachmentSlice=As,i.assetProcedureStepFieldValuesReducer=er,i.assetProcedureStepFieldValuesSlice=Is,i.assetProcedureStepFieldsAttachmentReducer=yd,i.assetProcedureStepFieldsAttachmentSlice=hs,i.assetProcedureStepFieldsReducer=Md,i.assetProcedureStepFieldsSlice=ys,i.assetProcedureStepReducer=or,i.assetProcedureStepSlice=Os,i.assetProcedureTypeAttachmentReducer=Fa,i.assetProcedureTypeAttachmentSlice=Xt,i.assetProcedureTypeFieldValuesAttachmentReducer=uc,i.assetProcedureTypeFieldValuesAttachmentSlice=ss,i.assetProcedureTypeFieldValuesReducer=gc,i.assetProcedureTypeFieldValuesSlice=cs,i.assetProcedureTypeFieldsAttachmentReducer=Ca,i.assetProcedureTypeFieldsAttachmentSlice=xt,i.assetProcedureTypeFieldsReducer=Xa,i.assetProcedureTypeFieldsSlice=ts,i.assetProcedureTypeReducer=Xc,i.assetProcedureTypeSlice=ls,i.assetReducer=Mr,i.assetSlice=Fs,i.assetStageCompletionReducer=Dr,i.assetStageCompletionSlice=_s,i.assetStageReducer=xr,i.assetStageSlice=Ms,i.assetTypeAttachmentReducer=yu,i.assetTypeAttachmentSlice=vs,i.assetTypeFieldValuesAttachmentReducer=tl,i.assetTypeFieldValuesAttachmentSlice=Cs,i.assetTypeFieldValuesReducer=pl,i.assetTypeFieldValuesSlice=Ls,i.assetTypeFieldsAttachmentReducer=Ru,i.assetTypeFieldsAttachmentSlice=Bs,i.assetTypeFieldsReducer=ku,i.assetTypeFieldsSlice=qs,i.assetTypeIdentifierReducer=wl,i.assetTypeIdentifierSlice=ks,i.assetTypeIdentifierValueReducer=Nl,i.assetTypeIdentifierValueSlice=Gs,i.assetTypeReducer=io,i.assetTypeSlice=Hs,i.authReducer=co,i.authSlice=Ot,i.baseReducer=$P,i.baseReducers=Fn,i.blobToBase64=YI,i.categoryReducer=Io,i.categorySlice=Ks,i.clearTokens=GO,i.constructUploadedFilePayloads=KI,i.createModelAdapter=R,i.createOfflineAction=oS,i.createPayload=z,i.createSelectionAdapter=qI,i.deleteAsset=Ir,i.deleteAssetAttachment=da,i.deleteAssetAttachments=Zt,i.deleteAssetProcedure=zc,i.deleteAssetProcedureStep=ur,i.deleteAssetProcedureStepFieldValues=Zd,i.deleteAssetProcedureStepFieldValuesAttachment=jd,i.deleteAssetProcedureStepFieldValuesAttachments=Ss,i.deleteAssetProcedureStepFieldValuesMany=Jd,i.deleteAssetProcedureStepFields=Fd,i.deleteAssetProcedureStepFieldsAttachment=ud,i.deleteAssetProcedureStepFieldsAttachments=ld,i.deleteAssetProcedureStepFieldsMany=gd,i.deleteAssetProcedureSteps=lr,i.deleteAssetProcedureType=Kc,i.deleteAssetProcedureTypeAttachment=Oa,i.deleteAssetProcedureTypeAttachments=Pa,i.deleteAssetProcedureTypeFieldValues=Pc,i.deleteAssetProcedureTypeFieldValuesAttachment=rc,i.deleteAssetProcedureTypeFieldValuesAttachments=ns,i.deleteAssetProcedureTypeFieldValuesMany=Fc,i.deleteAssetProcedureTypeFields=Za,i.deleteAssetProcedureTypeFieldsAttachment=ja,i.deleteAssetProcedureTypeFieldsAttachments=qa,i.deleteAssetProcedureTypeFieldsMany=Ja,i.deleteAssetProcedureTypes=Yc,i.deleteAssetProcedures=us,i.deleteAssetStage=Xr,i.deleteAssetStageCompletion=qr,i.deleteAssetStageCompletions=Cr,i.deleteAssetStages=Qr,i.deleteAssetType=Ql,i.deleteAssetTypeAttachment=uu,i.deleteAssetTypeAttachments=Vs,i.deleteAssetTypeFieldValues=ll,i.deleteAssetTypeFieldValuesAttachment=Ju,i.deleteAssetTypeFieldValuesAttachments=$s,i.deleteAssetTypeFieldValuesMany=ol,i.deleteAssetTypeFields=Cu,i.deleteAssetTypeFieldsAttachment=Fu,i.deleteAssetTypeFieldsAttachments=gu,i.deleteAssetTypeFieldsMany=Du,i.deleteAssetTypeIdentifier=gl,i.deleteAssetTypeIdentifierValue=Dl,i.deleteAssetTypeIdentifierValues=$l,i.deleteAssetTypeIdentifiers=bl,i.deleteAssetTypes=xl,i.deleteAssets=bs,i.deleteCategories=fo,i.deleteCategory=Ao,i.deleteConversation=lO,i.deleteConversations=oO,i.deleteDocument=No,i.deleteDocumentAttachment=wo,i.deleteDocumentAttachments=vo,i.deleteDocuments=Go,i.deleteForm=cm,i.deleteFormIdentifier=rh,i.deleteFormIdentifierValue=Ph,i.deleteFormIdentifierValues=Fh,i.deleteFormIdentifiers=uh,i.deleteFormRevision=ri,i.deleteFormRevisionAttachment=qh,i.deleteFormRevisionAttachments=Ch,i.deleteFormRevisions=ui,i.deleteFormSubmission=Em,i.deleteFormSubmissionAttachment=Tm,i.deleteFormSubmissionAttachments=pi,i.deleteFormSubmissions=Oi,i.deleteForms=dm,i.deleteGeoImage=Hm,i.deleteGeoImages=Wm,i.deleteIssue=ap,i.deleteIssueAssociation=ny,i.deleteIssueAssociations=Mt,i.deleteIssueAttachment=Ty,i.deleteIssueAttachments=Ri,i.deleteIssueComment=Ky,i.deleteIssueCommentAttachment=zy,i.deleteIssueCommentAttachments=By,i.deleteIssueComments=Yy,i.deleteIssueType=uf,i.deleteIssueTypeAttachment=Tp,i.deleteIssueTypeAttachments=Ip,i.deleteIssueTypeFieldValues=Kp,i.deleteIssueTypeFieldValuesAttachment=IA,i.deleteIssueTypeFieldValuesAttachments=Hi,i.deleteIssueTypeFieldValuesMany=Yp,i.deleteIssueTypeFields=dA,i.deleteIssueTypeFieldsAttachment=zp,i.deleteIssueTypeFieldsAttachments=Bp,i.deleteIssueTypeFieldsMany=rA,i.deleteIssueTypeIdentifier=BA,i.deleteIssueTypeIdentifierValue=YA,i.deleteIssueTypeIdentifierValues=ZA,i.deleteIssueTypeIdentifiers=jA,i.deleteIssueTypes=lf,i.deleteIssueUpdate=tn,i.deleteIssueUpdates=sn,i.deleteIssues=qi,i.deleteOrganization=nS,i.deleteOrganizationAccess=Gf,i.deleteOrganizationAccesses=Hf,i.deleteOrganizations=aS,i.deleteProject=AT,i.deleteProjectAccess=bS,i.deleteProjectAccesses=_S,i.deleteProjectAttachment=DS,i.deleteProjectAttachments=$S,i.deleteProjectFile=QS,i.deleteProjectFiles=xS,i.deleteProjects=fT,i.deleteTeam=HT,i.deleteTeamMembership=ET,i.deleteTeamMemberships=VT,i.deleteTeams=WT,i.deleteUser=rn,i.deleteUsers=Vf,i.dequeue=uI,i.discard=oI,i.documentAttachmentReducer=Bo,i.documentAttachmentSlice=Js,i.documentSlice=Qs,i.documentsReducer=Ho,i.downloadFile=ZI,i.downloadInMemoryFile=WI,i.emailRegex=iO,i.enqueue=rI,i.enqueueRequest=mS,i.extractResponseFromError=mI,i.fallbackToEmptyArray=T,i.fallbackToEmptyObject=ht,i.fileReducer=xo,i.fileSlice=ei,i.fileToBlob=Un,i.formIdentifierReducer=mh,i.formIdentifierSlice=ti,i.formIdentifierValueReducer=Mh,i.formIdentifierValueSlice=ii,i.formReducer=rm,i.formRevisionAttachmentReducer=Lh,i.formRevisionAttachmentSlice=ni,i.formRevisionReducer=Xh,i.formRevisionsSlice=ai,i.formSlice=oi,i.formSubmissionAttachmentReducer=Fm,i.formSubmissionAttachmentSlice=mi,i.formSubmissionReducer=qm,i.formSubmissionSlice=Ti,i.geoImageReducer=Jm,i.geoImageSlice=Fi,i.getAssetProcedureStepSubTree=Hn,i.getAssetProcedureStepTrees=nO,i.getClientSDK=SI,i.getClientStore=it,i.getDocumentSubTree=Kn,i.getDocumentTrees=aO,i.getFileIdentifier=HI,i.getFileS3Key=Gt,i.getLocalDateString=Dn,i.getLocalRelativeDateString=NI,i.getOutboxCoordinator=Xe,i.getRenamedFile=$n,i.getRequestDescription=O,i.hashFile=et,i.initSDK=hg,i.initializeAssetAttachments=ta,i.initializeAssetProcedureStepFieldValues=kd,i.initializeAssetProcedureStepFieldValuesAttachments=wd,i.initializeAssetProcedureStepFields=Ad,i.initializeAssetProcedureStepFieldsAttachments=sd,i.initializeAssetProcedureSteps=sr,i.initializeAssetProcedureTypeAttachments=ya,i.initializeAssetProcedureTypeFieldValues=pc,i.initializeAssetProcedureTypeFieldValuesAttachments=sc,i.initializeAssetProcedureTypeFields=ka,i.initializeAssetProcedureTypeFieldsAttachments=Ra,i.initializeAssetProcedureTypes=kc,i.initializeAssetProcedures=wc,i.initializeAssetStageCompletions=wr,i.initializeAssetStages=Gr,i.initializeAssetTypeAttachments=iu,i.initializeAssetTypeFieldValues=il,i.initializeAssetTypeFieldValuesAttachments=Gu,i.initializeAssetTypeFields=vu,i.initializeAssetTypeFieldsAttachments=Au,i.initializeAssetTypeIdentifierValues=El,i.initializeAssetTypeIdentifiers=fl,i.initializeAssetTypes=Hl,i.initializeAssets=Ar,i.initializeCategories=uo,i.initializeConversations=Zn,i.initializeDocumentAttachments=Po,i.initializeDocuments=qo,i.initializeFormIdentifierValues=ph,i.initializeFormIdentifiers=th,i.initializeFormRevisionAttachments=wh,i.initializeFormRevisions=Nh,i.initializeFormSubmissionAttachments=mm,i.initializeFormSubmissions=bm,i.initializeForms=xh,i.initializeGeoImages=Dm,i.initializeIssueAssociations=Qm,i.initializeIssueAttachments=my,i.initializeIssueCommentAttachments=_y,i.initializeIssueComments=Uy,i.initializeIssueTypeAttachments=hp,i.initializeIssueTypeFieldValues=Up,i.initializeIssueTypeFieldValuesAttachments=yA,i.initializeIssueTypeFields=eA,i.initializeIssueTypeFieldsAttachments=_p,i.initializeIssueTypeIdentifierValues=LA,i.initializeIssueTypeIdentifiers=MA,i.initializeIssueTypes=tf,i.initializeIssueUpdates=Af,i.initializeIssues=xy,i.initializeOrganizationAccesses=Cf,i.initializeOrganizations=Xf,i.initializeProjectAccesses=SS,i.initializeProjectAttachments=ES,i.initializeProjectFiles=HS,i.initializeProjects=uT,i.initializeTeamMemberships=gT,i.initializeTeams=DT,i.initializeUsers=_f,i.isToday=kI,i.issueAssociationReducer=oy,i.issueAssociationSlice=bi,i.issueAttachmentReducer=gy,i.issueAttachmentSlice=_i,i.issueCommentAttachmentReducer=Dy,i.issueCommentAttachmentSlice=vi,i.issueCommentReducer=Xy,i.issueCommentSlice=Vi,i.issueReducer=lp,i.issueSlice=Bi,i.issueTypeAttachmentReducer=gp,i.issueTypeAttachmentSlice=Ci,i.issueTypeFieldValuesAttachmentReducer=bA,i.issueTypeFieldValuesAttachmentSlice=Ni,i.issueTypeFieldValuesReducer=Qp,i.issueTypeFieldValuesSlice=Li,i.issueTypeFieldsAttachmentReducer=Dp,i.issueTypeFieldsAttachmentSlice=$i,i.issueTypeFieldsReducer=hA,i.issueTypeFieldsSlice=ki,i.issueTypeIdentifierReducer=$A,i.issueTypeIdentifierSlice=Ki,i.issueTypeIdentifierValueReducer=xA,i.issueTypeIdentifierValueSlice=Zi,i.issueTypeReducer=yf,i.issueTypeSlice=Ji,i.issueUpdateReducer=gf,i.issueUpdateSlice=Qi,i.logOnlyOnce=JI,i.markAsDeleted=yS,i.markForDeletion=FP,i.memoize=kt,i.organizationAccessReducer=Wf,i.organizationAccessSlice=ln,i.organizationReducer=lS,i.organizationSlice=on,i.outboxReducer=AS,i.outboxSlice=hn,i.overmapEnhancer=YP,i.overmapReducer=UP,i.overmapReducers=xT,i.performRequest=Rn,i.performRequestFromAction=lI,i.projectAccessReducer=MS,i.projectAccessSlice=mn,i.projectAttachmentReducer=NS,i.projectAttachmentSlice=pn,i.projectFileReducer=dT,i.projectFileSlice=fn,i.projectReducer=ST,i.projectSlice=Sn,i.rehydratedReducer=PT,i.rehydratedSlice=Tn,i.restructureSelectorWithArgs=S,i.runMiddleware=PI,i.saveActiveProjectFileBounds=sT,i.selectAccessToken=HO,i.selectAccessesByUserOfProject=bP,i.selectAccessibleProjects=vP,i.selectActiveOrganizationAccess=TP,i.selectActiveProjectFileId=RP,i.selectAllDocumentAttachments=Xs,i.selectAssetAttachmentById=ua,i.selectAssetAttachmentMapping=ra,i.selectAssetAttachments=Jt,i.selectAssetAttachmentsByIds=la,i.selectAssetById=br,i.selectAssetProcedureById=$c,i.selectAssetProcedureStepById=hr,i.selectAssetProcedureStepFieldValues=at,i.selectAssetProcedureStepFieldValuesAttachmentById=Cd,i.selectAssetProcedureStepFieldValuesAttachments=Ts,i.selectAssetProcedureStepFieldValuesAttachmentsByIds=Dd,i.selectAssetProcedureStepFieldValuesAttachmentsMapping=qd,i.selectAssetProcedureStepFieldValuesById=Qd,i.selectAssetProcedureStepFieldValuesByIds=xd,i.selectAssetProcedureStepFieldValuesMapping=Xd,i.selectAssetProcedureStepFieldValuesOfAsset=_O,i.selectAssetProcedureStepFieldValuesOfAssetProcedure=MO,i.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=RO,i.selectAssetProcedureStepFields=At,i.selectAssetProcedureStepFieldsAttachmentById=hd,i.selectAssetProcedureStepFieldsAttachments=ms,i.selectAssetProcedureStepFieldsAttachmentsByIds=md,i.selectAssetProcedureStepFieldsAttachmentsMapping=od,i.selectAssetProcedureStepFieldsById=bd,i.selectAssetProcedureStepFieldsByIds=_d,i.selectAssetProcedureStepFieldsMapping=ps,i.selectAssetProcedureStepFieldsOfAssetProcedureStep=FO,i.selectAssetProcedureStepMapping=ft,i.selectAssetProcedureSteps=Ps,i.selectAssetProcedureStepsByIds=mr,i.selectAssetProcedureStepsMappingOfAssetProcedureType=wO,i.selectAssetProcedureStepsOfAssetProcedureType=vO,i.selectAssetProcedureTypeAttachmentById=ba,i.selectAssetProcedureTypeAttachmentMapping=ga,i.selectAssetProcedureTypeAttachments=Qt,i.selectAssetProcedureTypeAttachmentsByIds=_a,i.selectAssetProcedureTypeById=xc,i.selectAssetProcedureTypeFieldValues=yt,i.selectAssetProcedureTypeFieldValuesAttachmentById=oc,i.selectAssetProcedureTypeFieldValuesAttachments=as,i.selectAssetProcedureTypeFieldValuesAttachmentsByIds=hc,i.selectAssetProcedureTypeFieldValuesAttachmentsMapping=lc,i.selectAssetProcedureTypeFieldValuesById=_c,i.selectAssetProcedureTypeFieldValuesByIds=Mc,i.selectAssetProcedureTypeFieldValuesMapping=bc,i.selectAssetProcedureTypeFieldValuesOfAsset=SO,i.selectAssetProcedureTypeFields=mt,i.selectAssetProcedureTypeFieldsAttachmentById=$a,i.selectAssetProcedureTypeFieldsAttachments=es,i.selectAssetProcedureTypeFieldsAttachmentsByIds=Ua,i.selectAssetProcedureTypeFieldsAttachmentsMapping=Da,i.selectAssetProcedureTypeFieldsById=xa,i.selectAssetProcedureTypeFieldsByIds=ec,i.selectAssetProcedureTypeFieldsMapping=Qa,i.selectAssetProcedureTypeFieldsOfAssetProcedureType=AO,i.selectAssetProcedureTypes=os,i.selectAssetProcedureTypesByIds=ed,i.selectAssetProcedureTypesMapping=Qc,i.selectAssetProcedureTypesOfOrganization=OO,i.selectAssetProcedures=pt,i.selectAssetProceduresByIds=Uc,i.selectAssetProceduresMapping=Cc,i.selectAssetProceduresOfAssetProcedureType=Dc,i.selectAssetProceduresOfAssetType=IO,i.selectAssetStageById=eu,i.selectAssetStageCompletionById=Lr,i.selectAssetStageCompletionMapping=$r,i.selectAssetStageCompletions=Ur,i.selectAssetStageCompletionsByIds=kr,i.selectAssetStages=ws,i.selectAssetStagesByIds=tu,i.selectAssetStagesMappingOfAssetProcedureType=VO,i.selectAssetStagesOfAssetProcedureType=zO,i.selectAssetTypeAttachmentById=ou,i.selectAssetTypeAttachmentMapping=lu,i.selectAssetTypeAttachments=zs,i.selectAssetTypeAttachmentsByIds=hu,i.selectAssetTypeById=to,i.selectAssetTypeFieldValues=Tt,i.selectAssetTypeFieldValuesAttachmentById=Qu,i.selectAssetTypeFieldValuesAttachments=Us,i.selectAssetTypeFieldValuesAttachmentsByIds=xu,i.selectAssetTypeFieldValuesAttachmentsMapping=Xu,i.selectAssetTypeFieldValuesById=ml,i.selectAssetTypeFieldValuesByIds=yl,i.selectAssetTypeFieldValuesMapping=hl,i.selectAssetTypeFieldValuesOfAsset=CO,i.selectAssetTypeFields=ct,i.selectAssetTypeFieldsAttachmentById=_u,i.selectAssetTypeFieldsAttachments=js,i.selectAssetTypeFieldsAttachmentsByIds=Mu,i.selectAssetTypeFieldsAttachmentsMapping=bu,i.selectAssetTypeFieldsById=Uu,i.selectAssetTypeFieldsByIds=Lu,i.selectAssetTypeFieldsMapping=$u,i.selectAssetTypeFieldsOfAssetType=jO,i.selectAssetTypeIdentifierById=Ml,i.selectAssetTypeIdentifierMapping=_l,i.selectAssetTypeIdentifierValueById=Ll,i.selectAssetTypeIdentifierValueMapping=Ul,i.selectAssetTypeIdentifierValues=It,i.selectAssetTypeIdentifierValuesByIds=kl,i.selectAssetTypeIdentifierValuesOfAsset=UO,i.selectAssetTypeIdentifierValuesOfIdentifier=LO,i.selectAssetTypeIdentifiers=Ns,i.selectAssetTypeIdentifiersByIds=Rl,i.selectAssetTypeIdentifiersOfAssetType=$O,i.selectAssetTypeValuesOfAssetType=DO,i.selectAssetTypes=Ws,i.selectAssetTypesByIds=so,i.selectAssetTypesMapping=eo,i.selectAssetTypesOfOrganization=kO,i.selectAssets=St,i.selectAssetsByIds=_r,i.selectAssetsMapping=Fr,i.selectAssetsOfAssetType=gr,i.selectAssetsOfProject=EO,i.selectAttachmentsOfAsset=oa,i.selectAttachmentsOfAssetProcedureStepFieldValues=$d,i.selectAttachmentsOfAssetProcedureStepFields=PO,i.selectAttachmentsOfAssetProcedureType=yO,i.selectAttachmentsOfAssetProcedureTypeFieldValues=mc,i.selectAttachmentsOfAssetProcedureTypeFields=pO,i.selectAttachmentsOfAssetType=mu,i.selectAttachmentsOfAssetTypeFieldValues=el,i.selectAttachmentsOfAssetTypeFields=BO,i.selectAttachmentsOfDocument=YO,i.selectAttachmentsOfFormRevision=tP,i.selectAttachmentsOfFormSubmission=Pm,i.selectAttachmentsOfIssue=Oy,i.selectAttachmentsOfIssueComment=aP,i.selectAttachmentsOfIssueType=rP,i.selectAttachmentsOfIssueTypeFieldValues=gA,i.selectAttachmentsOfIssueTypeFields=uP,i.selectAttachmentsOfProject=MP,i.selectCategories=Ys,i.selectCategoriesByIds=To,i.selectCategoriesOfProject=KO,i.selectCategoryById=Zs,i.selectCategoryMapping=So,i.selectCommentsOfIssue=cP,i.selectConversation=mO,i.selectConversationMapping=Wt,i.selectConversations=hO,i.selectCurrentUser=Bf,i.selectDeletedRequests=OP,i.selectDescendantsOfAssetProcedureStep=yr,i.selectDescendantsOfDocument=Yo,i.selectDocumentAttachmentById=Vo,i.selectDocumentAttachmentMapping=Eo,i.selectDocumentAttachmentsByIds=zo,i.selectDocumentById=Wo,i.selectDocuments=Pt,i.selectDocumentsByIds=Ko,i.selectDocumentsMapping=xs,i.selectFieldValuesOfAssetProcedure=TO,i.selectFormById=lm,i.selectFormIdentifierById=oh,i.selectFormIdentifierMapping=lh,i.selectFormIdentifierValueById=bh,i.selectFormIdentifierValueMapping=gh,i.selectFormIdentifierValues=Ft,i.selectFormIdentifierValuesByIds=_h,i.selectFormIdentifierValuesOfFormSubmission=xO,i.selectFormIdentifierValuesOfIdentifier=eP,i.selectFormIdentifiers=si,i.selectFormIdentifiersByIds=hh,i.selectFormIdentifiersOfForm=QO,i.selectFormMapping=um,i.selectFormRevisionAttachmentById=$h,i.selectFormRevisionAttachments=Dh,i.selectFormRevisionAttachmentsByIds=Uh,i.selectFormRevisionAttachmentsMapping=gt,i.selectFormRevisionById=Yh,i.selectFormRevisionMapping=li,i.selectFormRevisions=bt,i.selectFormRevisionsByIds=Zh,i.selectFormRevisionsOfForm=Jh,i.selectFormSubmissionAttachemntsByIds=Si,i.selectFormSubmissionAttachmentById=Im,i.selectFormSubmissionAttachments=fi,i.selectFormSubmissionAttachmentsByIds=Om,i.selectFormSubmissionAttachmentsMapping=Ai,i.selectFormSubmissionById=zm,i.selectFormSubmissions=Vm,i.selectFormSubmissionsByIds=Bm,i.selectFormSubmissionsMapping=Pi,i.selectFormSubmissionsOfForm=jm,i.selectForms=hi,i.selectFormsByIds=om,i.selectFormsOfOrganization=iP,i.selectGeoImageById=Ym,i.selectGeoImageMapping=Km,i.selectGeoImages=gi,i.selectGeoImagesByIds=Zm,i.selectGeoImagesOfProject=nP,i.selectIsImportingProjectFile=wP,i.selectIsLoggedIn=WO,i.selectIssueAssociationById=cy,i.selectIssueAssociationMapping=dt,i.selectIssueAssociations=ay,i.selectIssueAssociationsByIds=dy,i.selectIssueAssociationsOfAsset=ly,i.selectIssueAssociationsOfIssue=uy,i.selectIssueAssociationsToIssue=ry,i.selectIssueAttachmentById=Py,i.selectIssueAttachmentMapping=Iy,i.selectIssueAttachments=wi,i.selectIssueAttachmentsByIds=Fy,i.selectIssueById=dp,i.selectIssueCommentAttachmentById=qy,i.selectIssueCommentAttachmentMapping=jy,i.selectIssueCommentAttachments=Ei,i.selectIssueCommentAttachmentsByIds=Cy,i.selectIssueCommentById=Zy,i.selectIssueCommentMapping=zi,i.selectIssueCommentsByIds=Jy,i.selectIssueMapping=cp,i.selectIssueTypeAttachmentById=Pp,i.selectIssueTypeAttachmentMapping=Op,i.selectIssueTypeAttachments=Di,i.selectIssueTypeAttachmentsByIds=Fp,i.selectIssueTypeById=hf,i.selectIssueTypeFieldValues=wt,i.selectIssueTypeFieldValuesAttachmentById=PA,i.selectIssueTypeFieldValuesAttachments=Wi,i.selectIssueTypeFieldValuesAttachmentsByIds=FA,i.selectIssueTypeFieldValuesAttachmentsMapping=OA,i.selectIssueTypeFieldValuesById=Jp,i.selectIssueTypeFieldValuesByIds=Xp,i.selectIssueTypeFieldValuesMapping=Zp,i.selectIssueTypeFieldValuesOfIssue=lP,i.selectIssueTypeFields=rt,i.selectIssueTypeFieldsAttachmentById=qp,i.selectIssueTypeFieldsAttachments=Ui,i.selectIssueTypeFieldsAttachmentsByIds=Cp,i.selectIssueTypeFieldsAttachmentsMapping=jp,i.selectIssueTypeFieldsById=lA,i.selectIssueTypeFieldsByIds=oA,i.selectIssueTypeFieldsMapping=uA,i.selectIssueTypeFieldsOfIssueType=oP,i.selectIssueTypeIdentifierById=CA,i.selectIssueTypeIdentifierMapping=qA,i.selectIssueTypeIdentifierValueById=XA,i.selectIssueTypeIdentifierValueMapping=JA,i.selectIssueTypeIdentifierValues=vt,i.selectIssueTypeIdentifierValuesByIds=QA,i.selectIssueTypeIdentifierValuesOfIdentifier=AP,i.selectIssueTypeIdentifierValuesOfIssue=pP,i.selectIssueTypeIdentifiers=Yi,i.selectIssueTypeIdentifiersByIds=DA,i.selectIssueTypeIdentifiersOfIssueType=yP,i.selectIssueTypeMapping=of,i.selectIssueTypeValuesOfIssueType=mP,i.selectIssueTypes=Xi,i.selectIssueTypesByIds=mf,i.selectIssueTypesOfOrganization=fP,i.selectIssueUpdateById=Of,i.selectIssueUpdateMapping=nn,i.selectIssueUpdates=an,i.selectIssueUpdatesByIds=Pf,i.selectIssueUpdatesOfIssue=Ff,i.selectIssues=Rt,i.selectIssuesByIds=rp,i.selectIssuesOfIssueType=up,i.selectIssuesOfProject=dP,i.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=gO,i.selectLatestAssetProcedureTypeFieldsOfAssetProcedureType=fO,i.selectLatestAssetTypeFieldsOfAssetType=qO,i.selectLatestFieldsByAssetProcedureStep=bO,i.selectLatestFormRevisionOfForm=sP,i.selectLatestIssueTypeFieldsOfIssueType=hP,i.selectLatestRetryTime=PP,i.selectMembershipsByUserOfTeam=jP,i.selectOrganizationAccessById=Kf,i.selectOrganizationAccessMapping=zt,i.selectOrganizationAccessUserMapping=Zf,i.selectOrganizationAccessesByIds=Yf,i.selectOrganizationById=rS,i.selectOrganizationDocuments=JO,i.selectOrganizations=dS,i.selectOrganizationsByIds=uS,i.selectOrganizationsMapping=cS,i.selectProjectAccessById=RS,i.selectProjectAccessMapping=yn,i.selectProjectAccesses=ut,i.selectProjectAccessesByIds=wS,i.selectProjectAccessesOfProject=gP,i.selectProjectAttachmentById=LS,i.selectProjectAttachmentMapping=US,i.selectProjectAttachments=An,i.selectProjectAttachmentsByIds=kS,i.selectProjectById=IT,i.selectProjectDocuments=ZO,i.selectProjectFileById=aT,i.selectProjectFileMapping=iT,i.selectProjectFiles=nT,i.selectProjectFilesByIds=cT,i.selectProjectMapping=TT,i.selectProjects=Bt,i.selectProjectsByIds=OT,i.selectProjectsOfOrganization=EP,i.selectRehydrated=BP,i.selectStageMapping=Rs,i.selectTeamById=YT,i.selectTeamMembershipById=jT,i.selectTeamMemberships=jt,i.selectTeamMembershipsByIds=qT,i.selectTeamMembershipsMapping=BT,i.selectTeams=Pn,i.selectTeamsByIds=ZT,i.selectTeamsMapping=KT,i.selectTeamsOfOrganization=CP,i.selectUploadUrl=Qo,i.selectUserById=Vt,i.selectUsers=Et,i.selectUsersByIds=jf,i.selectUsersMapping=un,i.selectUsersOfOrganization=IP,i.selectUsersOfProject=_P,i.selectUsersOfTeam=qP,i.setActiveProjectFileId=tT,i.setAsset=Or,i.setAssetAttachment=ia,i.setAssetAttachments=na,i.setAssetProcedure=Bc,i.setAssetProcedureStep=ir,i.setAssetProcedureStepFieldValues=Hd,i.setAssetProcedureStepFieldValuesAttachment=Ed,i.setAssetProcedureStepFieldValuesAttachments=Vd,i.setAssetProcedureStepFieldValuesMany=Wd,i.setAssetProcedureStepFields=Td,i.setAssetProcedureStepFieldsAttachment=ad,i.setAssetProcedureStepFieldsAttachments=cd,i.setAssetProcedureStepFieldsMany=Id,i.setAssetProcedureSteps=nr,i.setAssetProcedureType=Zc,i.setAssetProcedureTypeAttachment=fa,i.setAssetProcedureTypeAttachments=Sa,i.setAssetProcedureTypeFieldValues=Sc,i.setAssetProcedureTypeFieldValuesAttachment=nc,i.setAssetProcedureTypeFieldValuesAttachments=ac,i.setAssetProcedureTypeFieldValuesMany=Tc,i.setAssetProcedureTypeFields=Ha,i.setAssetProcedureTypeFieldsAttachment=Ea,i.setAssetProcedureTypeFieldsAttachments=Va,i.setAssetProcedureTypeFieldsMany=Wa,i.setAssetProcedureTypes=Jc,i.setAssetProcedures=jc,i.setAssetStage=Hr,i.setAssetStageCompletion=Vr,i.setAssetStageCompletions=zr,i.setAssetStages=Wr,i.setAssetType=Wl,i.setAssetTypeAttachment=au,i.setAssetTypeAttachments=cu,i.setAssetTypeFieldValues=cl,i.setAssetTypeFieldValuesAttachment=Wu,i.setAssetTypeFieldValuesAttachments=Ku,i.setAssetTypeFieldValuesMany=dl,i.setAssetTypeFields=zu,i.setAssetTypeFieldsAttachment=Tu,i.setAssetTypeFieldsAttachments=Iu,i.setAssetTypeFieldsMany=Bu,i.setAssetTypeIdentifier=Il,i.setAssetTypeIdentifierValue=Bl,i.setAssetTypeIdentifierValues=jl,i.setAssetTypeIdentifiers=Ol,i.setAssetTypes=Kl,i.setAssets=Pr,i.setCategories=mo,i.setCategory=ho,i.setClientSDK=fI,i.setClientStore=pI,i.setConversation=Xn,i.setConversations=rO,i.setCurrentUser=SP,i.setDocument=$o,i.setDocumentAttachment=bo,i.setDocumentAttachments=_o,i.setDocuments=Uo,i.setForm=sm,i.setFormIdentifier=nh,i.setFormIdentifierValue=Sh,i.setFormIdentifierValues=Th,i.setFormIdentifiers=ah,i.setFormRevision=Gh,i.setFormRevisionAttachment=Vh,i.setFormRevisionAttachments=zh,i.setFormRevisions=Hh,i.setFormSubmission=_m,i.setFormSubmissionAttachment=pm,i.setFormSubmissionAttachments=Am,i.setFormSubmissions=Mm,i.setForms=im,i.setGeoImage=$m,i.setGeoImages=Um,i.setIsImportingProjectFile=eT,i.setIssue=tp,i.setIssueAssociation=ey,i.setIssueAssociations=xm,i.setIssueAttachment=py,i.setIssueAttachments=Ay,i.setIssueComment=Ny,i.setIssueCommentAttachment=wy,i.setIssueCommentAttachments=vy,i.setIssueComments=Gy,i.setIssueType=af,i.setIssueTypeAttachment=pp,i.setIssueTypeAttachments=Ap,i.setIssueTypeFieldValues=Np,i.setIssueTypeFieldValuesAttachment=AA,i.setIssueTypeFieldValuesAttachments=fA,i.setIssueTypeFieldValuesMany=Gp,i.setIssueTypeFields=iA,i.setIssueTypeFieldsAttachment=wp,i.setIssueTypeFieldsAttachments=vp,i.setIssueTypeFieldsMany=nA,i.setIssueTypeIdentifier=vA,i.setIssueTypeIdentifierValue=GA,i.setIssueTypeIdentifierValues=HA,i.setIssueTypeIdentifiers=EA,i.setIssueTypes=cf,i.setIssueUpdate=ff,i.setIssueUpdates=Sf,i.setIssues=sp,i.setLoggedIn=ao,i.setOrganization=xf,i.setOrganizationAccess=Uf,i.setOrganizationAccesses=Lf,i.setOrganizations=Qf,i.setProject=oT,i.setProjectAccess=OS,i.setProjectAccesses=PS,i.setProjectAttachment=BS,i.setProjectAttachments=jS,i.setProjectFile=WS,i.setProjectFiles=KS,i.setProjects=lT,i.setRehydrated=zP,i.setTeam=LT,i.setTeamMembership=MT,i.setTeamMemberships=RT,i.setTeams=kT,i.setTokens=NO,i.setUploadUrl=Xo,i.setUser=Rf,i.setUsers=Mf,i.shallowEqual=DI,i.slugify=tO,i.spacesToDashesLower=eO,i.teamMembershipReducer=zT,i.teamMembershipSlice=In,i.teamReducer=JT,i.teamSlice=On,i.toFileNameSafeString=xI,i.toUuidArray=D,i.toUuidIdRecord=XI,i.truncate=sO,i.updateAsset=Sr,i.updateAssetAttachment=aa,i.updateAssetAttachments=ca,i.updateAssetProcedure=Ec,i.updateAssetProcedureStep=dr,i.updateAssetProcedureStepFieldValues=Kd,i.updateAssetProcedureStepFieldValuesAttachment=zd,i.updateAssetProcedureStepFieldValuesAttachments=Bd,i.updateAssetProcedureStepFieldValuesMany=Yd,i.updateAssetProcedureStepFields=Od,i.updateAssetProcedureStepFieldsAttachment=dd,i.updateAssetProcedureStepFieldsAttachments=rd,i.updateAssetProcedureStepFieldsMany=Pd,i.updateAssetProcedureSteps=rr,i.updateAssetProcedureType=Hc,i.updateAssetProcedureTypeAttachment=Ta,i.updateAssetProcedureTypeAttachments=Ia,i.updateAssetProcedureTypeFieldValues=Ic,i.updateAssetProcedureTypeFieldValuesAttachment=cc,i.updateAssetProcedureTypeFieldValuesAttachments=dc,i.updateAssetProcedureTypeFieldValuesMany=Oc,i.updateAssetProcedureTypeFields=Ka,i.updateAssetProcedureTypeFieldsAttachment=za,i.updateAssetProcedureTypeFieldsAttachments=Ba,i.updateAssetProcedureTypeFieldsMany=Ya,i.updateAssetProcedureTypes=Wc,i.updateAssetProcedures=Vc,i.updateAssetStage=Zr,i.updateAssetStageCompletion=Br,i.updateAssetStageCompletions=jr,i.updateAssetStages=Jr,i.updateAssetType=Jl,i.updateAssetTypeAttachment=du,i.updateAssetTypeAttachments=ru,i.updateAssetTypeFieldValues=rl,i.updateAssetTypeFieldValuesAttachment=Yu,i.updateAssetTypeFieldValuesAttachments=Zu,i.updateAssetTypeFieldValuesMany=ul,i.updateAssetTypeFields=ju,i.updateAssetTypeFieldsAttachment=Ou,i.updateAssetTypeFieldsAttachments=Pu,i.updateAssetTypeFieldsMany=qu,i.updateAssetTypeIdentifier=Pl,i.updateAssetTypeIdentifierValue=ql,i.updateAssetTypeIdentifierValues=Cl,i.updateAssetTypeIdentifiers=Fl,i.updateAssetTypes=Xl,i.updateAssets=Tr,i.updateCategories=po,i.updateCategory=yo,i.updateConversation=Qn,i.updateConversations=uO,i.updateDocument=Lo,i.updateDocumentAttachment=Mo,i.updateDocumentAttachments=Ro,i.updateDocuments=ko,i.updateForm=nm,i.updateFormIdentifier=ch,i.updateFormIdentifierValue=Ih,i.updateFormIdentifierValues=Oh,i.updateFormIdentifiers=dh,i.updateFormRevision=Wh,i.updateFormRevisionAttachment=Bh,i.updateFormRevisionAttachments=jh,i.updateFormRevisions=Kh,i.updateFormSubmission=wm,i.updateFormSubmissionAttachment=fm,i.updateFormSubmissionAttachments=Sm,i.updateFormSubmissions=vm,i.updateForms=am,i.updateGeoImage=Nm,i.updateGeoImages=Gm,i.updateIssue=ip,i.updateIssueAssociation=ty,i.updateIssueAssociations=sy,i.updateIssueAttachment=fy,i.updateIssueAttachments=Sy,i.updateIssueComment=Hy,i.updateIssueCommentAttachment=Ey,i.updateIssueCommentAttachments=Vy,i.updateIssueComments=Wy,i.updateIssueType=df,i.updateIssueTypeAttachment=fp,i.updateIssueTypeAttachments=Sp,i.updateIssueTypeFieldValues=Hp,i.updateIssueTypeFieldValuesAttachment=SA,i.updateIssueTypeFieldValuesAttachments=TA,i.updateIssueTypeFieldValuesMany=Wp,i.updateIssueTypeFields=aA,i.updateIssueTypeFieldsAttachment=Ep,i.updateIssueTypeFieldsAttachments=Vp,i.updateIssueTypeFieldsMany=cA,i.updateIssueTypeIdentifier=VA,i.updateIssueTypeIdentifierValue=WA,i.updateIssueTypeIdentifierValues=KA,i.updateIssueTypeIdentifiers=zA,i.updateIssueTypes=rf,i.updateIssueUpdate=Tf,i.updateIssueUpdates=If,i.updateIssues=np,i.updateOrganization=iS,i.updateOrganizationAccess=kf,i.updateOrganizationAccesses=Nf,i.updateOrganizations=sS,i.updateProject=pT,i.updateProjectAccess=FS,i.updateProjectAccesses=gS,i.updateProjectAttachment=qS,i.updateProjectAttachments=CS,i.updateProjectFile=JS,i.updateProjectFiles=XS,i.updateProjects=yT,i.updateTeam=NT,i.updateTeamMembership=wT,i.updateTeamMemberships=vT,i.updateTeams=GT,i.updateUser=Ef,i.updateUsers=vf,i.useSelectorBuilder=CI,i.userReducer=zf,i.userSlice=cn,i.uuidObj=M,i.uuidObjSortFn=QI,i.uuidSortFn=Nn,i.versioningReducer=QT,i.versioningSlice=XT,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@overmap-ai/core",
3
- "version": "1.0.78-gcs.1",
3
+ "version": "1.0.78-gcs.2",
4
4
  "description": "Core functionality for Overmap",
5
5
  "keywords": [
6
6
  "components",