PageSourceSearch

https://app.slaydigital.ai/static/react/9206.6745c607d804e5a4b100.js

js slaydigital.ai collected 2026-10-05 14:40:30 UTC 15,278 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkStammer_ai=self.webpackChunkStammer_ai||[]).push([[9206],{9206:function(e,t,n){n.r(t),n.d(t,{AdminVoiceAnalyticsPage:function(){return Z}});var r=n(78685),o=n(2057),i=n(10219),s=n(31547),l=n(13066),a=n(41175),c=n(10838),d=n(38588),u=n(88458),x=n(26400),h=n(50616),p=n(59492),f=n(76776),m=n(45924),b=n(67076),j=n(96509),g=n(64901),y=n(77040),A=n(93610),v=n(65179),C=n(69656),S=n(93715),k=n(34994),w=n(53630),D=n(77214),W=n(81304),I=n(89543),z=n(42683),O=n(95550),M=n(57390),F=n(64778),P=n(34369),R=n(968),_=(0,n(81056).A)((0,r.jsx)("path",{d:"M11.8 10.9c-2.27-.59-3-1.2-3-2.15 0-1.09 1.01-1.85 2.7-1.85 1.78 0 2.44.85 2.5 2.1h2.21c-.07-1.72-1.12-3.3-3.21-3.81V3h-3v2.16c-1.94.42-3.5 1.68-3.5 3.61 0 2.31 1.91 3.46 4.7 4.13 2.5.6 3 1.48 3 2.41 0 .69-.49 1.79-2.7 1.79-2.06 0-2.87-.92-2.98-2.1h-2.2c.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c1.95-.37 3.5-1.5 3.5-3.55 0-2.84-2.43-3.81-4.7-4.4"}),"AttachMoney"),N=n(52811),U=n(601),L=n(54007),E=n(21120),Y=n(19124),B=n(63294),V=n(67340),T=n.n(V),K=n(19423),$=function(){return $=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},$.apply(this,arguments)},q=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function l(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,l)}a((r=r.apply(e,t||[])).next())}))},G=function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=l(0),s.throw=l(1),s.return=l(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function l(l){return function(a){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,a])}}},X=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},H=function(e){var t=e.children,n=X(e,["children"]);return(0,r.jsx)(s.A,$({component:"td",sx:function(e){return{p:2,borderBottom:"1px solid ".concat(e.palette.divider),backgroundColor:e.palette.background.paper}}},n,{children:t}))},J=function(e){var t=e.children,n=e.onClick,o=X(e,["children","onClick"]);return(0,r.jsx)(s.A,$({component:"tr",sx:function(e){return{"&:hover":{bgcolor:e.palette.action.hover,cursor:n?"pointer":"default"},transition:"background-color 0.2s"}},onClick:n},o,{children:t}))},Q=function(){var e,t,n=(0,Y.jr)().phoneNumber,i=(0,o.useState)(n||""),V=i[0],X=i[1],Q=(0,o.useState)(1),Z=Q[0],ee=Q[1],te=(0,o.useState)(10),ne=te[0],re=te[1],oe=(0,o.useState)(!1),ie=oe[0],se=oe[1],le=(0,o.useState)({startDate:T()().startOf("month").format("YYYY-MM-DD"),endDate:T()().format("YYYY-MM-DD")}),ae=le[0],ce=le[1],de=(0,o.useState)(ae),ue=de[0],xe=de[1],he=(0,o.useState)("daily_minutes_used"),pe=he[0],fe=he[1],me=(0,o.useState)("desc"),be=me[0],je=me[1],ge=(0,N.qX)({page:Z,pageSize:ne,search:V,filters:ae,ordering:pe?"".concat("desc"===be?"-":"").concat(pe):void 0}),ye=ge.data,Ae=ge.isLoading,ve=ge.error,Ce=(0,N.cx)({search:V,filters:ae}).data,Se=(0,N.mC)(),ke=(null==ye?void 0:ye.results)||[],we=(null==ye?void 0:ye.count)||0,De=(null==ye?void 0:ye.totalPages)||0,We=function(e){pe===e?je("asc"===be?"desc":"asc"):(fe(e),je("desc"))},Ie=function(e,t){xe((function(n){var r;return $($({},n),((r={})[e]=t,r))}))},ze=function(e){return pe!==e?null:"asc"===be?(0,r.jsx)(O.A,{fontSize:"small"}):(0,r.jsx)(z.A,{fontSize:"small"})},Oe=0===we?0:(Z-1)*ne+1,Me=Math.min(Z*ne,we);return(0,r.jsx)(l.A,{maxWidth:"xl",sx:{py:4},children:(0,r.jsxs)(a.A,{elevation:0,sx:function(e){return{p:4,borderRadius:2,border:"1px solid ".concat(e.palette.divider),backgroundColor:e.palette.background.paper,boxShadow:"dark"===e.palette.mode?"0 12px 24px rgba(0, 0, 0, 0.24)":"0 1px 3px rgba(15, 23, 42, 0.08)"}},children:[(0,r.jsx)(s.A,{sx:{mb:4},children:(0,r.jsx)(c.A,{variant:"h5",component:"h1",sx:{fontWeight:600,color:"text.primary"},children:"Voice Analytics"})}),(0,r.jsxs)(s.A,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3,gap:2},children:[(0,r.jsx)(d.A,{size:"small",value:V,onChange:function(e){X(e.target.value),ee(1)},placeholder:"Search...",InputProps:{startAdornment:(0,r.jsx)(u.A,{position:"start",children:(0,r.jsx)(D.A,{fontSize:"small"})})},sx:{width:300}}),(0,r.jsxs)(s.A,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,r.jsx)(x.A,{variant:"outlined",color:"primary",startIcon:(0,r.jsx)(W.A,{}),onClick:function(){return se(!0)},children:"Filters"}),(0,r.jsx)(x.A,{variant:"outlined",color:"primary",startIcon:Se.isPending?(0,r.jsx)(h.A,{size:16}):(0,r.jsx)(M.A,{}),onClick:function(){return q(void 0,void 0,void 0,(function(){var e,t,n,r;return G(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,Se.mutateAsync({search:V,filters:ae,ordering:pe?"".concat("desc"===be?"-":"").concat(pe):void 0})];case 1:return e=o.sent(),t=window.URL.createObjectURL(e),(n=document.createElement("a")).href=t,n.download="voice-analytics-".concat((new Date).toISOString(),".csv"),document.body.appendChild(n),n.click(),document.body.removeChild(n),window.URL.revokeObjectURL(t),[3,3];case 2:return r=o.sent(),console.error("Export failed:",r),[3,3];case 3:return[2]}}
1))}))},disabled:0===ke.length||Se.isPending,children:Se.isPending?"Exporting...":"Export CSV"})]})]}),(0,r.jsxs)(p.Ay,{container:!0,spacing:2,sx:{mb:3},children:[(0,r.jsx)(p.Ay,{item:!0,xs:12,sm:6,md:3,children:(0,r.jsxs)(a.A,{elevation:0,sx:function(e){return{p:2,border:"1px solid ".concat(e.palette.divider),borderRadius:2,backgroundColor:e.palette.background.paper}},children:[(0,r.jsxs)(s.A,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[(0,r.jsx)(R.A,{sx:{color:"#094ddfff",fontSize:20}}),(0,r.jsx)(c.A,{variant:"body2",color:"text.secondary",fontWeight:500,children:"Total KBs"})]}),(0,r.jsx)(c.A,{variant:"h6",fontWeight:600,color:"text.primary",children:null!==(e=Number(null==Ce?void 0:Ce.totalKbs).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2}))&&void 0!==e?e:0})]})}),(0,r.jsx)(p.Ay,{item:!0,xs:12,sm:6,md:3,children:(0,r.jsxs)(a.A,{elevation:0,sx:function(e){return{p:2,border:"1px solid ".concat(e.palette.divider),borderRadius:2,backgroundColor:e.palette.background.paper}},children:[(0,r.jsxs)(s.A,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[(0,r.jsx)(P.A,{sx:{color:"#094ddfff",fontSize:20}}),(0,r.jsx)(c.A,{variant:"body2",color:"text.secondary",fontWeight:500,children:"Total Minutes"})]}),(0,r.jsxs)(c.A,{variant:"h6",fontWeight:600,color:"#111827",children:[(null==Ce?void 0:Ce.totalDailyMinutesUsed)?Number(Ce.totalDailyMinutesUsed).toLocaleString(void 0,{minimumFractionDigits:1,maximumFractionDigits:1}):"0.0"," ","mins"]})]})}),(0,r.jsx)(p.Ay,{item:!0,xs:12,sm:6,md:3,children:(0,r.jsxs)(a.A,{elevation:0,sx:function(e){return{p:2,border:"1px solid ".concat(e.palette.divider),borderRadius:2,backgroundColor:e.palette.background.paper}},children:[(0,r.jsxs)(s.A,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[(0,r.jsx)(_,{sx:{color:"#094ddfff",fontSize:20}}),(0,r.jsx)(c.A,{variant:"body2",color:"text.secondary",fontWeight:500,children:"Total Cost"})]}),(0,r.jsxs)(c.A,{variant:"h6",fontWeight:600,color:"success.main",children:["$",(null==Ce?void 0:Ce.totalDailyCost)?Number(Ce.totalDailyCost).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2}):"0.00"]})]})}),(0,r.jsx)(p.Ay,{item:!0,xs:12,sm:6,md:3,children:(0,r.jsxs)(a.A,{elevation:0,sx:function(e){return{p:2,border:"1px solid ".concat(e.palette.divider),borderRadius:2,backgroundColor:e.palette.background.paper}},children:[(0,r.jsxs)(s.A,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[(0,r.jsx)(F.A,{sx:{color:"#094ddfff",fontSize:20}}),(0,r.jsx)(c.A,{variant:"body2",color:"text.secondary",fontWeight:500,children:"Concurrent Calls"})]}),(0,r.jsx)(c.A,{variant:"h6",fontWeight:600,color:"text.primary",children:null!==(t=Number(null==Ce?void 0:Ce.totalConcurrentCalls).toLocaleString(void 0))&&void 0!==t?t:0})]})})]}),(0,r.jsx)(f.A,{component:a.A,elevation:0,sx:function(e){return{border:"1px solid ".concat(e.palette.divider),backgroundColor:e.palette.background.paper}},children:(0,r.jsxs)(m.A,{component:"table",children:[(0,r.jsx)(b.A,{component:"thead",children:(0,r.jsxs)(j.A,{component:"tr",children:[(0,r.jsx)(B.h5,{children:"Voice Agent Name"}),(0,r.jsx)(B.h5,{children:(0,r.jsx)(s.A,{sx:{display:"flex",alignItems:"center",gap:.5},children:"Concurrent Calls"})}),(0,r.jsx)(B.h5,{children:"KB Enabled"}),(0,r.jsx)(B.h5,{children:"Price"}),(0,r.jsx)(B.h5,{onClick:function(){return We("daily_minutes_used")},style:{cursor:"pointer"},children:(0,r.jsxs)(s.A,{sx:{display:"flex",alignItems:"center",gap:.5},children:["Minutes Used ",ze("daily_minutes_used")]})}),(0,r.jsx)(B.h5,{style:{cursor:"pointer"},children:(0,r.jsx)(s.A,{sx:{display:"flex",alignItems:"center",gap:.5},children:"Price Per Minute"})}),(0,r.jsx)(B.h5,{onClick:function(){return We("total_daily_cost")},style:{cursor:"pointer"},children:(0,r.jsxs)(s.A,{sx:{display:"flex",alignItems:"center",gap:.5},children:["Total Charges ",ze("total_daily_cost")]})})]})}),(0,r.jsx)(g.A,{component:"tbody",children:Ae?(0,r.jsx)(K.bU,{rows:6,columns:6}):ve?(0,r.jsx)(j.A,{component:"tr",children:(0,r.jsx)(H,{colSpan:6,sx:{textAlign:"center"},children:(0,r.jsx)(c.A,{color:"error",children:"Failed to load voice analytics data. Please try again."})})}):0===ke.length?(0,r.jsx)(j.A,{component:"tr",children:(0,r.jsx)(H,{colSpan:6,sx:{textAlign:"center"},children:(0,r.jsx)(c.A,{color:"text.secondary",children:V||ae.startDate||ae.endDate?"No matching calls found":"No call data available"})})}):(0,r.jsx)(r.Fragment,{children:ke.map((function(e){return(0,r.jsxs)(J,{children:[(0,r.jsx)(H,{children:(0,r.jsxs)(c.A,{variant:"body2",fontWeight:500,children:[e.name," ",(0,r.jsx)("br",{}),e.phoneNumber]})}),(0,r.jsx)(H,{children:(0,r.jsx)(c.A,{variant:"body2",fontWeight:500,children:e.concurrentCalls})}),(0,r.jsx)(H,{children:(0,r.jsx)(c.A,{variant:"body2",fontWeight:500,children:e.isUsingKnowledgeBase?(0,r.jsx)(E.A,{color:"success",fontSize:"small"}):(0,r.jsx)(I.A,{color:"error",fontSize:"small"})})}),(0,r.jsx)(H,{children:(0,r.jsx)(c.A,{variant:"body2",fontWeight:500,sx:{backgroundColor:null===e.price?"#d4edda":"#fff3cd",color:null==e.price?"#155724":"#856404",borderRadius:"4px",px:1,display:"inline-block"},children:null==e.price?"Free":"$".concat(e.price)})}),(0,r.jsx)(H,{children:(0,r.jsxs)(c.A,{variant:"body2",children:[parseFloat(e.dailyMinutesUsed).toFixed(1)," mins"]})}),(0,r.jsx)(H,{children:(0,r.jsxs)(c.A,{variant:"body2",children:["$",parseFloat(((Number(null==e?void 0:e.totalDailyCost)||0)/(Number(null==e?void 0:e.dailyMinutesUsed)||1)).toString()).toFixed(2)," ","/ min"]})}),(0,r.jsx)(H,{children:(0,r.jsxs)(c.A,{variant:"body2",fontWeight:700,color:"success.main",children:["$",parseFloat(e.totalDailyCost).toFixed(2)]})})]},e.id)}))})})]})}),(0,r.jsxs)(s.A,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mt:3},children:[(0,r.jsxs)(s.A,{sx:{display:"flex",alignItems:"center"},children:[(0,r.jsx)(c.A,{variant:"body2",sx:{mr:1},children:"Show"}),(0,r.jsx)(y.A,{variant:"outlined",size:"small",sx:{minWidth:80},children:(0,r.jsx)(A.A,{value:ne,onChange:function(e){re(e.target.value),ee(1)},displayEmpty:!0,children:U.A3.map((function(e){return(0,r.jsx)(v.A,{value:e,children:e},e)}))})}),(0,r.jsx)(c.A,{variant:"body2",sx:{ml:1},children:"entries"})]}),(0,r.jsxs)(c.A,{variant:"body2",color:"text.secondary",children:["Showing ",Oe," to ",Me," of ",we," results"]}),(0,r.jsx)(C.A,{count:De,page:Z,onChange:function(e,t){ee(t)},color:"primary",shape:"rounded",showFirstButton:!0,showLastButton:!0})]}),(0,r.jsx)(S.A,{open:ie,onClose:function(){return se(!1)},maxWidth:"xs",fullWidth:!0,BackdropProps:{sx:{backgroundColor:"transparent"}},PaperProps:{sx:{width:280,border:"1px solid #e5e7eb",borderRadius:"8px",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",m:0,position:"absolute",right:220,top:300}},sx:{"& .MuiDialog-container":{alignItems:"flex-start",justifyContent:"flex-end"}},children:(0,r.jsxs)(s.A,{sx:{p:2},children:[(0,r.jsxs)(s.A,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[(0,r.jsx)(c.A,{variant:"h6",sx:{fontWeight:600,fontSize:"16px"},children:"Filters"}),(0,r.jsx)(k.A,{onClick:function(){return se(!1)},size:"small",children:(0,r.jsx)(I.A,{fontSize:"small"})})]}),(0,r.jsxs)(s.A,{sx:{mb:2},children:[(0,r.jsx)(c.A,{variant:"subtitle2",sx:{mb:1,fontWeight:600,color:"#374151"},children:"Duration"}),(0,r.jsxs)(s.A,{sx:{display:"flex",flexDirection:"column",gap:1},children:[(0,r.jsxs)(s.A,{children:[(0,r.jsx)(c.A,{variant:"body2",sx:{mb:.5,fontWeight:500,color:"#6b7280",fontSize:"12px"},children:"Start Date"}),(0,r.jsx)(d.A,{fullWidth:!0,size:"small",type:"date",value:ue.startDate,onChange:function(e){return Ie("startDate",e.target.value)},sx:{"& .MuiOutlinedInput-root":{backgroundColor:"white","& fieldset":{borderColor:"#d1d5db"},"&:hover fieldset":{borderColor:"#9ca3af"},"&.Mui-focused fieldset":{borderColor:"#3b82f6"}}}})]}),(0,r.jsxs)(s.A,{children:[(0,r.jsx)(c.A,{variant:"body2",sx:{mb:.5,fontWeight:500,color:"#6b7280",fontSize:"12px"},children:"End Date"}),(0,r.jsx)(d.A,{fullWidth:!0,size:"small",type:"date",value:ue.endDate,onChange:function(e){return Ie("endDate",e.target.value)},sx:{"& .MuiOutlinedInput-root":{backgroundColor:"white","& fieldset":{borderColor:"#d1d5db"},"&:hover fieldset":{borderColor:"#9ca3af"},"&.Mui-focused fieldset":{borderColor:"#3b82f6"}}}})]})]})]}),(0,r.jsx)(w.A,{sx:{my:1.5}}),(0,r.jsxs)(s.A,{sx:{display:"flex",gap:1},children:[(0,r.jsx)(x.A,{onClick:function(){xe({}),ce({}),se(!1),ee(1)},variant:"outlined",color:"secondary",startIcon:(0,r.jsx)(L.A,{}),fullWidth:!0,sx:{fontSize:"12px",py:1},children:"Reset"}),(0,r.jsx)(x.A,{onClick:function(){ce(ue),se(!1),ee(1)},variant:"contained",color:"primary",startIcon:(0,r.jsx)(E.A,{}),fullWidth:!0,sx:{fontSize:"12px",py:1},children:"Apply"})]})]})})]})})};function Z(){return(0,r.jsx)(i.i,{children:(0,r.jsx)(Q,{})})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.