"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../node_modules/tslib/tslib.es6.js"),a=require("../node_modules/@rematch/core/dist/core.esm.js"),n={byQueue:{},byMember:{},waitingCallersByNumber:{},waitingCallersByChannel:{},waitingCallersById:{},lastUpdatedAt:null};var s=a.createModel()({state:n,reducers:{updateQueue:function(a,n){var s,r=e.__assign(e.__assign({},a.byQueue),((s={})[n.queue]=n,s)),t=function(a){var n={},s={},r={};return Object.values(a).forEach((function(a){Object.values(a.waitingCallers||{}).forEach((function(t){var u=e.__assign(e.__assign({},t),{queueName:a.name});t.num&&(n[t.num]||(n[t.num]=[]),n[t.num].push(u)),t.channel&&(s[t.channel]=u),t.id&&(r[t.id]=u)}))})),{waitingCallersByNumber:n,waitingCallersByChannel:s,waitingCallersById:r}}(r);return e.__assign(e.__assign(e.__assign(e.__assign({},a),{byQueue:r}),t),{lastUpdatedAt:Date.now()})},updateQueueMember:function(a,n){var s;return e.__assign(e.__assign({},a),{byMember:e.__assign(e.__assign({},a.byMember),(s={},s[n.member]=n,s)),lastUpdatedAt:Date.now()})},reset:function(){return n}}});exports.queue=s;
//# sourceMappingURL=queue.js.map
