import{H as u}from"./app-k0jcl5PQ.js";function c(e,s,n){if(!s)return e;let a=`${e}:${s.start}:${s.end}`;const r=Array.isArray(s.userId)?s.userId.sort().join(":"):s.userId,o=Array.isArray(s.groupId)?s.groupId.sort().join(":"):s.groupId,t=Array.isArray(s.customerId)?s.customerId.sort().join(":"):s.customerId;return r&&(a+=`:${r}`),o&&(a+=`:${o}`),t&&(a+=`:${t}`),s.classroomSize&&(a+=`:cs${s.classroomSize}`),s.schoolStartTime&&(a+=`:ss${s.schoolStartTime}`),s.schoolEndTime&&(a+=`:se${s.schoolEndTime}`),s.timezone&&(a+=`:tz${s.timezone}`),a}function m(e,s,n){return{currentUserId:e.id,currentCustomerId:e.customerId,dateRange:s?{start:s.start,end:s.end}:void 0,userIds:s==null?void 0:s.userId,classroomsAndGroups:s==null?void 0:s.groupId,shareId:n}}const y={interactiveResultSet(e,s,n,a,r,o,t,i){return{url:r?`/api/domain/v3/analytics/interactives/${e}/metadata/${s}`:`/api/domain/v2/analytics/interactives/${e}/metadata/${s}`,key:c(`interactive:result:set:${e}:${s}:${r}`,a),data:m(n,a,r),type:u.POST,normalize:!1,success:o,error:t,always:i}},mark(e,s,n,a,r,o,t){return{url:`/api/domain/v1/analytics/answers/${n}`,key:`mark:answer:${n}:${a.resultId}`,type:u.PUT,data:a,normalize:!1,invalidationKeys:`interactive:result:set:${e}:${s}`,success:r,error:o,always:t}},pendingReviews(e){return{url:"/api/domain/v1/analytics/interactives/pending-reviews/summary",key:`interactives:pending:reviews:${e.interactives.map(n=>`${n.interactiveId}:${n.metadataId}:${n.shareId}`).join(",")}`,type:u.POST,data:e,normalize:!1}},interactiveResultsReport(e){return{url:"/api/domain/v3/analytics/interactives/report",key:"interactive:results:report",data:e,type:u.POST,normalize:!1}}};export{y as I};
//# sourceMappingURL=s-4A5pEU.chunk.js.map
