@clickview/reports 0.85.0-rc.1 → 0.85.0-rc.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.
Files changed (68) hide show
  1. package/dist/.vite/manifest.json +284 -284
  2. package/dist/bundles.json +1 -1
  3. package/dist/en.json +1 -1
  4. package/dist/scripts/{DMI-Lxl02.chunk.js → BCcIdtcy2.chunk.js} +2 -2
  5. package/dist/scripts/{DMI-Lxl02.chunk.js.map → BCcIdtcy2.chunk.js.map} +1 -1
  6. package/dist/scripts/{ClOZ7MLV.chunk.js → BIlepbnA.chunk.js} +2 -2
  7. package/dist/scripts/{ClOZ7MLV.chunk.js.map → BIlepbnA.chunk.js.map} +1 -1
  8. package/dist/scripts/{3EzrYsbw2.chunk.js → BX5YDJVD2.chunk.js} +2 -2
  9. package/dist/scripts/{3EzrYsbw2.chunk.js.map → BX5YDJVD2.chunk.js.map} +1 -1
  10. package/dist/scripts/{Bua2prVk2.chunk.js → BY9ZIRoW2.chunk.js} +2 -2
  11. package/dist/scripts/{Bua2prVk2.chunk.js.map → BY9ZIRoW2.chunk.js.map} +1 -1
  12. package/dist/scripts/{CowZxgkl2.chunk.js → BkkPVinl2.chunk.js} +2 -2
  13. package/dist/scripts/{CowZxgkl2.chunk.js.map → BkkPVinl2.chunk.js.map} +1 -1
  14. package/dist/scripts/{Udxe63DQ.chunk.js → BsAss53i.chunk.js} +2 -2
  15. package/dist/scripts/{Udxe63DQ.chunk.js.map → BsAss53i.chunk.js.map} +1 -1
  16. package/dist/scripts/{CJIwkABI.chunk.js → BsTmrvS_.chunk.js} +2 -2
  17. package/dist/scripts/{CJIwkABI.chunk.js.map → BsTmrvS_.chunk.js.map} +1 -1
  18. package/dist/scripts/{1pdbKMyH.chunk.js → BzSZm3J1.chunk.js} +2 -2
  19. package/dist/scripts/{1pdbKMyH.chunk.js.map → BzSZm3J1.chunk.js.map} +1 -1
  20. package/dist/scripts/{c7dUmf3R.chunk.js → C5k6lVOP.chunk.js} +2 -2
  21. package/dist/scripts/{c7dUmf3R.chunk.js.map → C5k6lVOP.chunk.js.map} +1 -1
  22. package/dist/scripts/{DTy5e0Yv2.chunk.js → CPp4jaPB2.chunk.js} +2 -2
  23. package/dist/scripts/{DTy5e0Yv2.chunk.js.map → CPp4jaPB2.chunk.js.map} +1 -1
  24. package/dist/scripts/{r-dVoZ7W2.chunk.js → Cdlk0Qkj2.chunk.js} +2 -2
  25. package/dist/scripts/{r-dVoZ7W2.chunk.js.map → Cdlk0Qkj2.chunk.js.map} +1 -1
  26. package/dist/scripts/ClX2mOw_.chunk.js +1 -0
  27. package/dist/scripts/{CMKPCLR42.chunk.js → D0fFZDhm2.chunk.js} +2 -2
  28. package/dist/scripts/{CMKPCLR42.chunk.js.map → D0fFZDhm2.chunk.js.map} +1 -1
  29. package/dist/scripts/{B9S_LeFP.chunk.js → DMuXCE-z.chunk.js} +2 -2
  30. package/dist/scripts/{B9S_LeFP.chunk.js.map → DMuXCE-z.chunk.js.map} +1 -1
  31. package/dist/scripts/{3q7nyVif2.chunk.js → DNZvrGV22.chunk.js} +2 -2
  32. package/dist/scripts/{3q7nyVif2.chunk.js.map → DNZvrGV22.chunk.js.map} +1 -1
  33. package/dist/scripts/{2MxiB_er.chunk.js → DUzAx5n_.chunk.js} +2 -2
  34. package/dist/scripts/{2MxiB_er.chunk.js.map → DUzAx5n_.chunk.js.map} +1 -1
  35. package/dist/scripts/DaBzvZF9.chunk.js +1 -0
  36. package/dist/scripts/{Cpm-LpwK.chunk.js → DkhktXkG.chunk.js} +2 -2
  37. package/dist/scripts/{Cpm-LpwK.chunk.js.map → DkhktXkG.chunk.js.map} +1 -1
  38. package/dist/scripts/{Bx5qk-PZ.chunk.js → DtSAu9Xt.chunk.js} +3 -3
  39. package/dist/scripts/{Bx5qk-PZ.chunk.js.map → DtSAu9Xt.chunk.js.map} +1 -1
  40. package/dist/scripts/{ktNy7dHM2.chunk.js → DvxtrAxT2.chunk.js} +2 -2
  41. package/dist/scripts/{ktNy7dHM2.chunk.js.map → DvxtrAxT2.chunk.js.map} +1 -1
  42. package/dist/scripts/{BvNaANAO2.chunk.js → DxD2uVzf2.chunk.js} +2 -2
  43. package/dist/scripts/{BvNaANAO2.chunk.js.map → DxD2uVzf2.chunk.js.map} +1 -1
  44. package/dist/scripts/{DgPadkLi2.chunk.js → I9MVVxo82.chunk.js} +2 -2
  45. package/dist/scripts/{DgPadkLi2.chunk.js.map → I9MVVxo82.chunk.js.map} +1 -1
  46. package/dist/scripts/{BnfA2fln.chunk.js → IH7D3jLI.chunk.js} +2 -2
  47. package/dist/scripts/{BnfA2fln.chunk.js.map → IH7D3jLI.chunk.js.map} +1 -1
  48. package/dist/scripts/{CKRKdk5U.chunk.js → OU_kRJz_.chunk.js} +2 -2
  49. package/dist/scripts/{CKRKdk5U.chunk.js.map → OU_kRJz_.chunk.js.map} +1 -1
  50. package/dist/scripts/{n2iCrpxU.chunk.js → P4zTQoDZ.chunk.js} +2 -2
  51. package/dist/scripts/{n2iCrpxU.chunk.js.map → P4zTQoDZ.chunk.js.map} +1 -1
  52. package/dist/scripts/{CqCz1X85.chunk.js → PZOjj17O.chunk.js} +2 -2
  53. package/dist/scripts/{CqCz1X85.chunk.js.map → PZOjj17O.chunk.js.map} +1 -1
  54. package/dist/scripts/{CCLDpjnt2.chunk.js → XgwoBT6z2.chunk.js} +2 -2
  55. package/dist/scripts/{CCLDpjnt2.chunk.js.map → XgwoBT6z2.chunk.js.map} +1 -1
  56. package/dist/scripts/{app-BigOHyYp.js → app-m6P7KXE1.js} +3 -3
  57. package/dist/scripts/{app-BigOHyYp.js.map → app-m6P7KXE1.js.map} +1 -1
  58. package/dist/scripts/{BpzXy-5d.chunk.js → bNV2NeSi.chunk.js} +2 -2
  59. package/dist/scripts/{BpzXy-5d.chunk.js.map → bNV2NeSi.chunk.js.map} +1 -1
  60. package/dist/scripts/{BKW2JeVr.chunk.js → fIFpt-kC.chunk.js} +2 -2
  61. package/dist/scripts/{BKW2JeVr.chunk.js.map → fIFpt-kC.chunk.js.map} +1 -1
  62. package/dist/scripts/{CKVaLGJC.chunk.js → fOHWXn7-.chunk.js} +2 -2
  63. package/dist/scripts/{CKVaLGJC.chunk.js.map → fOHWXn7-.chunk.js.map} +1 -1
  64. package/dist/scripts/{BfhdSOSX2.chunk.js → jXHCFC1j2.chunk.js} +2 -2
  65. package/dist/scripts/{BfhdSOSX2.chunk.js.map → jXHCFC1j2.chunk.js.map} +1 -1
  66. package/package.json +1 -1
  67. package/dist/scripts/Bs1YLdQb.chunk.js +0 -1
  68. package/dist/scripts/Cah5ISd-.chunk.js +0 -1
@@ -1,2 +1,2 @@
1
- import{Jn as e,st as t}from"./CM0wW4AE.chunk.js";import{n}from"./KyOyA3o8.chunk.js";import{M as r}from"./app-BigOHyYp.js";var i=e(t());function a(e){let[,t]=n(r.HEADER_TITLE);(0,i.useEffect)(()=>(t(e),()=>{t(null)}),[e])}function o(e,t,n){if(!t)return e;let r=`${e}:${t.start}:${t.end}`,i=Array.isArray(t.userId)?t.userId.sort().join(`:`):t.userId,a=Array.isArray(t.groupId)?t.groupId.sort().join(`:`):t.groupId,o=Array.isArray(t.customerId)?t.customerId.sort().join(`:`):t.customerId;return i&&(r+=`:${i}`),a&&(r+=`:${a}`),o&&(r+=`:${o}`),t.classroomSize&&(r+=`:cs${t.classroomSize}`),t.schoolStartTime&&(r+=`:ss${t.schoolStartTime}`),t.schoolEndTime&&(r+=`:se${t.schoolEndTime}`),t.timezone&&(r+=`:tz${t.timezone}`),n&&(r+=`:${n}`),r}export{a as n,o as t};
2
- //# sourceMappingURL=DgPadkLi2.chunk.js.map
1
+ import{Jn as e,st as t}from"./CM0wW4AE.chunk.js";import{n}from"./KyOyA3o8.chunk.js";import{M as r}from"./app-m6P7KXE1.js";var i=e(t());function a(e){let[,t]=n(r.HEADER_TITLE);(0,i.useEffect)(()=>(t(e),()=>{t(null)}),[e])}function o(e,t,n){if(!t)return e;let r=`${e}:${t.start}:${t.end}`,i=Array.isArray(t.userId)?t.userId.sort().join(`:`):t.userId,a=Array.isArray(t.groupId)?t.groupId.sort().join(`:`):t.groupId,o=Array.isArray(t.customerId)?t.customerId.sort().join(`:`):t.customerId;return i&&(r+=`:${i}`),a&&(r+=`:${a}`),o&&(r+=`:${o}`),t.classroomSize&&(r+=`:cs${t.classroomSize}`),t.schoolStartTime&&(r+=`:ss${t.schoolStartTime}`),t.schoolEndTime&&(r+=`:se${t.schoolEndTime}`),t.timezone&&(r+=`:tz${t.timezone}`),n&&(r+=`:${n}`),r}export{a as n,o as t};
2
+ //# sourceMappingURL=I9MVVxo82.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DgPadkLi2.chunk.js","names":[],"sources":["../../src/shared/hooks/UseSetHeaderTitle.ts","../../../../libs/shared/src/utils/AnalyticsRequestUtils.ts"],"sourcesContent":["import { useEffect } from 'react';\n\nimport { useViewModel } from 'libs/common/react/hooks/UseViewModel';\n\nimport { ViewModelKeys } from 'shared/constants/ReportsViewModels';\n\nexport function useSetHeaderTitle(title?: string): void {\n const [ , setTitle ] = useViewModel<string>(ViewModelKeys.HEADER_TITLE);\n\n useEffect(() => {\n setTitle(title);\n\n return () => {\n setTitle(null);\n };\n }, [title]);\n}\n","import { AnalyticsRequestFilter } from 'libs/shared/interfaces';\n\nexport function getAnalyticsRequestKey(baseKey: string, filter: AnalyticsRequestFilter, extra?: string): string {\n if (!filter)\n return baseKey;\n\n let key = `${baseKey}:${filter.start}:${filter.end}`;\n\n const userIdKey = Array.isArray(filter.userId) ? filter.userId.sort().join(':') : filter.userId;\n const groupIdKey = Array.isArray(filter.groupId) ? filter.groupId.sort().join(':') : filter.groupId;\n const customerIdKey = Array.isArray(filter.customerId) ? filter.customerId.sort().join(':') : filter.customerId;\n\n if (userIdKey)\n key += `:${userIdKey}`;\n\n if (groupIdKey)\n key += `:${groupIdKey}`;\n\n if (customerIdKey)\n key += `:${customerIdKey}`;\n\n if (filter.classroomSize)\n key += `:cs${filter.classroomSize}`;\n\n if (filter.schoolStartTime)\n key += `:ss${filter.schoolStartTime}`;\n\n if (filter.schoolEndTime)\n key += `:se${filter.schoolEndTime}`;\n\n if (filter.timezone)\n key += `:tz${filter.timezone}`;\n\n if (extra)\n key += `:${extra}`;\n\n return key;\n}\n"],"mappings":"uIAMA,SAAgB,EAAkB,EAAsB,CACtD,GAAM,EAAI,GAAa,EAAqB,EAAc,aAAa,EAEvE,EAAA,EAAA,gBACE,EAAS,EAAM,KAEF,CACX,EAAS,KAAK,GAEf,CAAC,EAAM,CAAC,CCbb,SAAgB,EAAuB,EAAiB,EAAgC,EAAwB,CAC9G,GAAI,CAAC,EACH,OAAO,EAET,IAAI,EAAM,GAAG,EAAQ,GAAG,EAAO,MAAM,GAAG,EAAO,MAEzC,EAAY,MAAM,QAAQ,EAAO,OAAO,CAAG,EAAO,OAAO,MAAM,CAAC,KAAK,IAAI,CAAG,EAAO,OACnF,EAAa,MAAM,QAAQ,EAAO,QAAQ,CAAG,EAAO,QAAQ,MAAM,CAAC,KAAK,IAAI,CAAG,EAAO,QACtF,EAAgB,MAAM,QAAQ,EAAO,WAAW,CAAG,EAAO,WAAW,MAAM,CAAC,KAAK,IAAI,CAAG,EAAO,WA0BrG,OAxBI,IACF,GAAO,IAAI,KAET,IACF,GAAO,IAAI,KAET,IACF,GAAO,IAAI,KAET,EAAO,gBACT,GAAO,MAAM,EAAO,iBAElB,EAAO,kBACT,GAAO,MAAM,EAAO,mBAElB,EAAO,gBACT,GAAO,MAAM,EAAO,iBAElB,EAAO,WACT,GAAO,MAAM,EAAO,YAElB,IACF,GAAO,IAAI,KAEN"}
1
+ {"version":3,"file":"I9MVVxo82.chunk.js","names":[],"sources":["../../src/shared/hooks/UseSetHeaderTitle.ts","../../../../libs/shared/src/utils/AnalyticsRequestUtils.ts"],"sourcesContent":["import { useEffect } from 'react';\n\nimport { useViewModel } from 'libs/common/react/hooks/UseViewModel';\n\nimport { ViewModelKeys } from 'shared/constants/ReportsViewModels';\n\nexport function useSetHeaderTitle(title?: string): void {\n const [ , setTitle ] = useViewModel<string>(ViewModelKeys.HEADER_TITLE);\n\n useEffect(() => {\n setTitle(title);\n\n return () => {\n setTitle(null);\n };\n }, [title]);\n}\n","import { AnalyticsRequestFilter } from 'libs/shared/interfaces';\n\nexport function getAnalyticsRequestKey(baseKey: string, filter: AnalyticsRequestFilter, extra?: string): string {\n if (!filter)\n return baseKey;\n\n let key = `${baseKey}:${filter.start}:${filter.end}`;\n\n const userIdKey = Array.isArray(filter.userId) ? filter.userId.sort().join(':') : filter.userId;\n const groupIdKey = Array.isArray(filter.groupId) ? filter.groupId.sort().join(':') : filter.groupId;\n const customerIdKey = Array.isArray(filter.customerId) ? filter.customerId.sort().join(':') : filter.customerId;\n\n if (userIdKey)\n key += `:${userIdKey}`;\n\n if (groupIdKey)\n key += `:${groupIdKey}`;\n\n if (customerIdKey)\n key += `:${customerIdKey}`;\n\n if (filter.classroomSize)\n key += `:cs${filter.classroomSize}`;\n\n if (filter.schoolStartTime)\n key += `:ss${filter.schoolStartTime}`;\n\n if (filter.schoolEndTime)\n key += `:se${filter.schoolEndTime}`;\n\n if (filter.timezone)\n key += `:tz${filter.timezone}`;\n\n if (extra)\n key += `:${extra}`;\n\n return key;\n}\n"],"mappings":"uIAMA,SAAgB,EAAkB,EAAsB,CACtD,GAAM,EAAI,GAAa,EAAqB,EAAc,aAAa,EAEvE,EAAA,EAAA,gBACE,EAAS,EAAM,KAEF,CACX,EAAS,KAAK,GAEf,CAAC,EAAM,CAAC,CCbb,SAAgB,EAAuB,EAAiB,EAAgC,EAAwB,CAC9G,GAAI,CAAC,EACH,OAAO,EAET,IAAI,EAAM,GAAG,EAAQ,GAAG,EAAO,MAAM,GAAG,EAAO,MAEzC,EAAY,MAAM,QAAQ,EAAO,OAAO,CAAG,EAAO,OAAO,MAAM,CAAC,KAAK,IAAI,CAAG,EAAO,OACnF,EAAa,MAAM,QAAQ,EAAO,QAAQ,CAAG,EAAO,QAAQ,MAAM,CAAC,KAAK,IAAI,CAAG,EAAO,QACtF,EAAgB,MAAM,QAAQ,EAAO,WAAW,CAAG,EAAO,WAAW,MAAM,CAAC,KAAK,IAAI,CAAG,EAAO,WA0BrG,OAxBI,IACF,GAAO,IAAI,KAET,IACF,GAAO,IAAI,KAET,IACF,GAAO,IAAI,KAET,EAAO,gBACT,GAAO,MAAM,EAAO,iBAElB,EAAO,kBACT,GAAO,MAAM,EAAO,mBAElB,EAAO,gBACT,GAAO,MAAM,EAAO,iBAElB,EAAO,WACT,GAAO,MAAM,EAAO,YAElB,IACF,GAAO,IAAI,KAEN"}
@@ -1,2 +1,2 @@
1
- import{Jn as e,P as t,U as n,st as r}from"./CM0wW4AE.chunk.js";import{n as i}from"./B01-hGyk.chunk.js";import{n as a}from"./dUFTODMz.chunk.js";import{t as o}from"./CjM_tQvd.chunk.js";import{t as s}from"./I5Dnl_eN.chunk.js";import{t as c}from"./CnyxksnC.chunk.js";import{l,t as u}from"./dSmIXyxJ.chunk.js";import{N as d,P as f,i as p}from"./app-BigOHyYp.js";import{t as m}from"./C1BFkCSD2.chunk.js";var h=e(r(),1),g=t(),_=`reportsDefault.classroomSizeSelector`,v=10,y=40;function b(e){return(0,g.jsxs)(`div`,{className:i(`border rounded-3 p-3`,e.className),children:[(0,g.jsx)(`h3`,{className:`h6 fw-semibold mb-1`,children:(0,g.jsx)(a,{namespace:_,phrase:`classroomSizeTitle`})}),(0,g.jsx)(`p`,{className:`text-secondary mb-3`,children:(0,g.jsx)(a,{namespace:_,phrase:`classroomSizeDescription`})}),(0,g.jsx)(`label`,{className:`mb-1`,htmlFor:`classroomSize`,children:(0,g.jsx)(a,{namespace:_,phrase:`classroomSizeLabel`})}),(0,g.jsx)(l.Range,{id:`classroomSize`,min:v,max:y,step:1,value:e.classroomSize,onChange:t=>e.onClassroomSizeChanged(Number(t.target.value))}),(0,g.jsxs)(`div`,{className:`d-flex justify-content-between small mb-2`,children:[(0,g.jsx)(`span`,{children:v}),(0,g.jsx)(`span`,{children:y})]}),(0,g.jsx)(`p`,{className:`text-secondary mb-0`,children:(0,g.jsx)(a,{namespace:_,phrase:`classroomSizeSummary`,options:{count:e.classroomSize}})})]})}var x=`reportsDefault.schoolHoursSelector`,S=[6,7,8,9,10,11,12,13,14,15,16,17,18],C=o.getTimezones();function w(e){let[t,n]=h.useState(!1),r=e.startHour<e.endHour;return(0,g.jsxs)(`div`,{className:i(`border rounded-3 p-3`,e.className),children:[(0,g.jsx)(`h3`,{className:`h6 fw-semibold mb-1`,children:(0,g.jsx)(a,{namespace:x,phrase:`schoolHoursTitle`})}),(0,g.jsx)(`p`,{className:`text-secondary mb-3`,children:(0,g.jsx)(a,{namespace:x,phrase:`schoolHoursDescription`})}),(0,g.jsxs)(`div`,{className:`d-flex align-items-end gap-3 mb-2`,children:[(0,g.jsxs)(`div`,{className:`flex-grow-1`,children:[(0,g.jsx)(`label`,{className:`small mb-1 d-block`,children:(0,g.jsx)(a,{namespace:x,phrase:`startTimeLabel`})}),(0,g.jsx)(`select`,{className:`form-select`,value:e.startHour,onChange:t=>e.onStartHourChanged(Number(t.target.value)),children:S.map(e=>(0,g.jsx)(`option`,{value:e,children:o.hourToFriendlyString(e)},e))})]}),(0,g.jsx)(`span`,{className:`pb-2`,children:(0,g.jsx)(a,{namespace:x,phrase:`schoolHoursTo`})}),(0,g.jsxs)(`div`,{className:`flex-grow-1`,children:[(0,g.jsx)(`label`,{className:`small mb-1 d-block`,children:(0,g.jsx)(a,{namespace:x,phrase:`endTimeLabel`})}),(0,g.jsx)(`select`,{className:`form-select`,value:e.endHour,onChange:t=>e.onEndHourChanged(Number(t.target.value)),children:S.map(e=>(0,g.jsx)(`option`,{value:e,children:o.hourToFriendlyString(e)},e))})]})]}),r?(0,g.jsx)(`p`,{className:`text-secondary mb-0`,children:(0,g.jsx)(a,{namespace:x,phrase:`schoolHoursSummary`,options:{startTime:o.hourToFriendlyString(e.startHour),endTime:o.hourToFriendlyString(e.endHour)}})}):(0,g.jsx)(`p`,{className:`text-danger mb-0`,children:(0,g.jsx)(a,{namespace:x,phrase:`schoolHoursValidation`})}),(0,g.jsx)(`div`,{className:`mt-3`,children:t?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`label`,{className:`mb-1 d-block`,children:(0,g.jsx)(a,{namespace:x,phrase:`timezoneLabel`})}),(0,g.jsx)(`select`,{className:`form-select`,value:e.timezone,onChange:t=>e.onTimezoneChanged(t.target.value),children:C.map(e=>(0,g.jsx)(`option`,{value:e,children:e},e))})]}):(0,g.jsxs)(`span`,{className:`text-secondary`,children:[(0,g.jsx)(a,{namespace:x,phrase:`timezoneCurrent`,options:{timezone:e.timezone}}),` — `,(0,g.jsx)(`button`,{className:`btn btn-link text-info p-0 align-baseline`,onClick:()=>n(!0),children:(0,g.jsx)(a,{namespace:x,phrase:`timezoneChange`})})]})})]})}var T=`reports.classroomViewsPopup`,E=s.encloseNamespace(T);function D(e){let t=p(n.ClassroomViewsPopup),r=m(),i=o.timeStringToHour(t.schoolStartTime),s=o.timeStringToHour(t.schoolEndTime),[l,_]=h.useState(t.classroomSize),[v,y]=h.useState(t.timezone),[x,S]=h.useState(i),[C,D]=h.useState(s),[O,k]=h.useState(!1),A=x<C&&v,j=l!==t.classroomSize||v!==t.timezone||x!==i||C!==s;async function M(){try{k(!0),await t.updateSettingsAsync({schoolStartTime:o.hourToTimeString(x),schoolEndTime:o.hourToTimeString(C),timezone:v,classroomSize:l}),r.success(E(`success`)),e.closePopup()}catch{r.error(E(`error`))}finally{k(!1)}}return(0,g.jsxs)(c,{closePopup:e.closePopup,title:E(`title`),size:`lg`,children:[(0,g.jsx)(`p`,{children:(0,g.jsx)(a,{namespace:T,phrase:`description1`})}),(0,g.jsx)(`p`,{children:(0,g.jsx)(a,{namespace:T,phrase:`description2`})}),(0,g.jsx)(b,{className:`my-3`,classroomSize:l,onClassroomSizeChanged:_}),(0,g.jsx)(w,{className:`mb-3`,startHour:x,endHour:C,timezone:v,onStartHourChanged:S,onEndHourChanged:D,onTimezoneChanged:y}),(0,g.jsxs)(u,{className:`justify-content-between`,children:[(0,g.jsx)(`a`,{href:d.getLiteArticle(f.ClassroomViews),target:`_blank`,rel:`noopener noreferrer`,className:`text-info`,children:(0,g.jsx)(a,{namespace:T,phrase:`learnMore`})}),(0,g.jsxs)(`div`,{className:`d-flex`,children:[(0,g.jsx)(u.Cancel,{onClick:e.closePopup,text:E(`close`)}),(0,g.jsx)(u.Submit,{onClick:M,text:E(`save`),showSpinner:O,variant:`dark`,disabled:!A||!j})]})]})]})}export{D as ClassroomViewsPopupView};
2
- //# sourceMappingURL=BnfA2fln.chunk.js.map
1
+ import{Jn as e,P as t,U as n,st as r}from"./CM0wW4AE.chunk.js";import{n as i}from"./B01-hGyk.chunk.js";import{n as a}from"./dUFTODMz.chunk.js";import{t as o}from"./CjM_tQvd.chunk.js";import{t as s}from"./I5Dnl_eN.chunk.js";import{t as c}from"./CnyxksnC.chunk.js";import{l,t as u}from"./dSmIXyxJ.chunk.js";import{N as d,P as f,i as p}from"./app-m6P7KXE1.js";import{t as m}from"./C1BFkCSD2.chunk.js";var h=e(r(),1),g=t(),_=`reportsDefault.classroomSizeSelector`,v=10,y=40;function b(e){return(0,g.jsxs)(`div`,{className:i(`border rounded-3 p-3`,e.className),children:[(0,g.jsx)(`h3`,{className:`h6 fw-semibold mb-1`,children:(0,g.jsx)(a,{namespace:_,phrase:`classroomSizeTitle`})}),(0,g.jsx)(`p`,{className:`text-secondary mb-3`,children:(0,g.jsx)(a,{namespace:_,phrase:`classroomSizeDescription`})}),(0,g.jsx)(`label`,{className:`mb-1`,htmlFor:`classroomSize`,children:(0,g.jsx)(a,{namespace:_,phrase:`classroomSizeLabel`})}),(0,g.jsx)(l.Range,{id:`classroomSize`,min:v,max:y,step:1,value:e.classroomSize,onChange:t=>e.onClassroomSizeChanged(Number(t.target.value))}),(0,g.jsxs)(`div`,{className:`d-flex justify-content-between small mb-2`,children:[(0,g.jsx)(`span`,{children:v}),(0,g.jsx)(`span`,{children:y})]}),(0,g.jsx)(`p`,{className:`text-secondary mb-0`,children:(0,g.jsx)(a,{namespace:_,phrase:`classroomSizeSummary`,options:{count:e.classroomSize}})})]})}var x=`reportsDefault.schoolHoursSelector`,S=[6,7,8,9,10,11,12,13,14,15,16,17,18],C=o.getTimezones();function w(e){let[t,n]=h.useState(!1),r=e.startHour<e.endHour;return(0,g.jsxs)(`div`,{className:i(`border rounded-3 p-3`,e.className),children:[(0,g.jsx)(`h3`,{className:`h6 fw-semibold mb-1`,children:(0,g.jsx)(a,{namespace:x,phrase:`schoolHoursTitle`})}),(0,g.jsx)(`p`,{className:`text-secondary mb-3`,children:(0,g.jsx)(a,{namespace:x,phrase:`schoolHoursDescription`})}),(0,g.jsxs)(`div`,{className:`d-flex align-items-end gap-3 mb-2`,children:[(0,g.jsxs)(`div`,{className:`flex-grow-1`,children:[(0,g.jsx)(`label`,{className:`small mb-1 d-block`,children:(0,g.jsx)(a,{namespace:x,phrase:`startTimeLabel`})}),(0,g.jsx)(`select`,{className:`form-select`,value:e.startHour,onChange:t=>e.onStartHourChanged(Number(t.target.value)),children:S.map(e=>(0,g.jsx)(`option`,{value:e,children:o.hourToFriendlyString(e)},e))})]}),(0,g.jsx)(`span`,{className:`pb-2`,children:(0,g.jsx)(a,{namespace:x,phrase:`schoolHoursTo`})}),(0,g.jsxs)(`div`,{className:`flex-grow-1`,children:[(0,g.jsx)(`label`,{className:`small mb-1 d-block`,children:(0,g.jsx)(a,{namespace:x,phrase:`endTimeLabel`})}),(0,g.jsx)(`select`,{className:`form-select`,value:e.endHour,onChange:t=>e.onEndHourChanged(Number(t.target.value)),children:S.map(e=>(0,g.jsx)(`option`,{value:e,children:o.hourToFriendlyString(e)},e))})]})]}),r?(0,g.jsx)(`p`,{className:`text-secondary mb-0`,children:(0,g.jsx)(a,{namespace:x,phrase:`schoolHoursSummary`,options:{startTime:o.hourToFriendlyString(e.startHour),endTime:o.hourToFriendlyString(e.endHour)}})}):(0,g.jsx)(`p`,{className:`text-danger mb-0`,children:(0,g.jsx)(a,{namespace:x,phrase:`schoolHoursValidation`})}),(0,g.jsx)(`div`,{className:`mt-3`,children:t?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`label`,{className:`mb-1 d-block`,children:(0,g.jsx)(a,{namespace:x,phrase:`timezoneLabel`})}),(0,g.jsx)(`select`,{className:`form-select`,value:e.timezone,onChange:t=>e.onTimezoneChanged(t.target.value),children:C.map(e=>(0,g.jsx)(`option`,{value:e,children:e},e))})]}):(0,g.jsxs)(`span`,{className:`text-secondary`,children:[(0,g.jsx)(a,{namespace:x,phrase:`timezoneCurrent`,options:{timezone:e.timezone}}),` — `,(0,g.jsx)(`button`,{className:`btn btn-link text-info p-0 align-baseline`,onClick:()=>n(!0),children:(0,g.jsx)(a,{namespace:x,phrase:`timezoneChange`})})]})})]})}var T=`reports.classroomViewsPopup`,E=s.encloseNamespace(T);function D(e){let t=p(n.ClassroomViewsPopup),r=m(),i=o.timeStringToHour(t.schoolStartTime),s=o.timeStringToHour(t.schoolEndTime),[l,_]=h.useState(t.classroomSize),[v,y]=h.useState(t.timezone),[x,S]=h.useState(i),[C,D]=h.useState(s),[O,k]=h.useState(!1),A=x<C&&v,j=l!==t.classroomSize||v!==t.timezone||x!==i||C!==s;async function M(){try{k(!0),await t.updateSettingsAsync({schoolStartTime:o.hourToTimeString(x),schoolEndTime:o.hourToTimeString(C),timezone:v,classroomSize:l}),r.success(E(`success`)),e.closePopup()}catch{r.error(E(`error`))}finally{k(!1)}}return(0,g.jsxs)(c,{closePopup:e.closePopup,title:E(`title`),size:`lg`,children:[(0,g.jsx)(`p`,{children:(0,g.jsx)(a,{namespace:T,phrase:`description1`})}),(0,g.jsx)(`p`,{children:(0,g.jsx)(a,{namespace:T,phrase:`description2`})}),(0,g.jsx)(b,{className:`my-3`,classroomSize:l,onClassroomSizeChanged:_}),(0,g.jsx)(w,{className:`mb-3`,startHour:x,endHour:C,timezone:v,onStartHourChanged:S,onEndHourChanged:D,onTimezoneChanged:y}),(0,g.jsxs)(u,{className:`justify-content-between`,children:[(0,g.jsx)(`a`,{href:d.getLiteArticle(f.ClassroomViews),target:`_blank`,rel:`noopener noreferrer`,className:`text-info`,children:(0,g.jsx)(a,{namespace:T,phrase:`learnMore`})}),(0,g.jsxs)(`div`,{className:`d-flex`,children:[(0,g.jsx)(u.Cancel,{onClick:e.closePopup,text:E(`close`)}),(0,g.jsx)(u.Submit,{onClick:M,text:E(`save`),showSpinner:O,variant:`dark`,disabled:!A||!j})]})]})]})}export{D as ClassroomViewsPopupView};
2
+ //# sourceMappingURL=IH7D3jLI.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BnfA2fln.chunk.js","names":[],"sources":["../../src/apps/default/views/classroom-views-popup/components/classroom-size-selector/ClassroomSizeSelector.tsx","../../src/apps/default/views/classroom-views-popup/components/school-hours-selector/SchoolHoursSelector.tsx","../../src/apps/default/views/classroom-views-popup/ClassroomViewsPopupView.tsx"],"sourcesContent":["import React from 'react';\nimport { Form } from 'react-bootstrap';\n\nimport { classNames } from 'libs/common/react/utils/ClassNameHelper';\n\nimport { Text } from 'libs/shared/components/text/Text';\n\nconst namespace = 'reportsDefault.classroomSizeSelector';\n\nconst MIN_CLASSROOM_SIZE = 10;\nconst MAX_CLASSROOM_SIZE = 40;\n\ninterface ClassroomSizeSelectorProps {\n className?: string;\n classroomSize: number;\n onClassroomSizeChanged: (size: number) => void;\n}\n\nexport function ClassroomSizeSelector(props: ClassroomSizeSelectorProps) {\n return (\n <div className={classNames('border rounded-3 p-3', props.className)}>\n <h3 className='h6 fw-semibold mb-1'><Text namespace={namespace} phrase='classroomSizeTitle' /></h3>\n <p className='text-secondary mb-3'><Text namespace={namespace} phrase='classroomSizeDescription' /></p>\n\n <label className='mb-1' htmlFor='classroomSize'><Text namespace={namespace} phrase='classroomSizeLabel' /></label>\n\n <Form.Range\n id='classroomSize'\n min={MIN_CLASSROOM_SIZE}\n max={MAX_CLASSROOM_SIZE}\n step={1}\n value={props.classroomSize}\n onChange={e => props.onClassroomSizeChanged(Number(e.target.value))}\n />\n <div className='d-flex justify-content-between small mb-2'>\n <span>{MIN_CLASSROOM_SIZE}</span>\n <span>{MAX_CLASSROOM_SIZE}</span>\n </div>\n\n <p className='text-secondary mb-0'>\n <Text namespace={namespace} phrase='classroomSizeSummary' options={{ count: props.classroomSize }} />\n </p>\n </div>\n );\n}\n","import React from 'react';\n\nimport { classNames } from 'libs/common/react/utils/ClassNameHelper';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { Text } from 'libs/shared/components/text/Text';\n\nconst namespace = 'reportsDefault.schoolHoursSelector';\n\nconst SCHOOL_HOURS = [ 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 ];\nconst ALL_TIMEZONES = DateHelper.getTimezones();\n\ninterface SchoolHoursSelectorProps {\n className?: string;\n startHour: number;\n endHour: number;\n timezone: string;\n onStartHourChanged: (hour: number) => void;\n onEndHourChanged: (hour: number) => void;\n onTimezoneChanged: (tz: string) => void;\n}\n\nexport function SchoolHoursSelector(props: SchoolHoursSelectorProps) {\n const [ showTimezoneSelect, setShowTimezoneSelect ] = React.useState(false);\n\n const isTimeRangeValid = props.startHour < props.endHour;\n\n return (\n <div className={classNames('border rounded-3 p-3', props.className)}>\n <h3 className='h6 fw-semibold mb-1'><Text namespace={namespace} phrase='schoolHoursTitle' /></h3>\n <p className='text-secondary mb-3'><Text namespace={namespace} phrase='schoolHoursDescription' /></p>\n\n <div className='d-flex align-items-end gap-3 mb-2'>\n <div className='flex-grow-1'>\n <label className='small mb-1 d-block'><Text namespace={namespace} phrase='startTimeLabel' /></label>\n <select\n className='form-select'\n value={props.startHour}\n onChange={e => props.onStartHourChanged(Number(e.target.value))}\n >\n {SCHOOL_HOURS.map(hour => (\n <option key={hour} value={hour}>{DateHelper.hourToFriendlyString(hour)}</option>\n ))}\n </select>\n </div>\n <span className='pb-2'><Text namespace={namespace} phrase='schoolHoursTo' /></span>\n <div className='flex-grow-1'>\n <label className='small mb-1 d-block'><Text namespace={namespace} phrase='endTimeLabel' /></label>\n <select\n className='form-select'\n value={props.endHour}\n onChange={e => props.onEndHourChanged(Number(e.target.value))}\n >\n {SCHOOL_HOURS.map(hour => (\n <option key={hour} value={hour}>{DateHelper.hourToFriendlyString(hour)}</option>\n ))}\n </select>\n </div>\n </div>\n\n {isTimeRangeValid ? (\n <p className='text-secondary mb-0'>\n <Text\n namespace={namespace}\n phrase='schoolHoursSummary'\n options={{\n startTime: DateHelper.hourToFriendlyString(props.startHour),\n endTime: DateHelper.hourToFriendlyString(props.endHour)\n }}\n />\n </p>\n ) : (\n <p className='text-danger mb-0'>\n <Text namespace={namespace} phrase='schoolHoursValidation' />\n </p>\n )}\n\n <div className='mt-3'>\n {showTimezoneSelect ? (\n <>\n <label className='mb-1 d-block'><Text namespace={namespace} phrase='timezoneLabel' /></label>\n <select className='form-select' value={props.timezone} onChange={e => props.onTimezoneChanged(e.target.value)}>\n {ALL_TIMEZONES.map(tz => (\n <option key={tz} value={tz}>{tz}</option>\n ))}\n </select>\n </>\n ) : (\n <span className='text-secondary'>\n <Text namespace={namespace} phrase='timezoneCurrent' options={{ timezone: props.timezone }} />\n {' — '}\n <button className='btn btn-link text-info p-0 align-baseline' onClick={() => setShowTimezoneSelect(true)}>\n <Text namespace={namespace} phrase='timezoneChange' />\n </button>\n </span>\n )}\n </div>\n </div>\n );\n}\n","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { LocationContext } from 'libs/analytics/interfaces';\n\nimport { Popup } from 'libs/shared/components/popup/Popup';\nimport { PopupButtons } from 'libs/shared/components/popup/PopupButtons';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { LiteSupportArticle } from 'libs/shared/enums/SupportArticle';\nimport { useAlerts } from 'libs/shared/hooks/UseAlerts';\nimport { PopupViewProps } from 'libs/shared/interfaces';\nimport { ArticleHelper } from 'libs/shared/utils/ArticleHelper';\n\nimport { useClassroomViewsSettings } from 'shared/hooks/useClassroomViewsSettings';\n\nimport { ClassroomSizeSelector } from './components/classroom-size-selector/ClassroomSizeSelector';\nimport { SchoolHoursSelector } from './components/school-hours-selector/SchoolHoursSelector';\n\nconst namespace = 'reports.classroomViewsPopup';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nexport function ClassroomViewsPopupView(props: PopupViewProps): JSX.Element {\n const classroomViewsSettings = useClassroomViewsSettings(LocationContext.ClassroomViewsPopup);\n const alerts = useAlerts();\n\n const initialStartHour = DateHelper.timeStringToHour(classroomViewsSettings.schoolStartTime);\n const initialEndHour = DateHelper.timeStringToHour(classroomViewsSettings.schoolEndTime);\n \n const [ classroomSize, setClassroomSize ] = React.useState(classroomViewsSettings.classroomSize);\n const [ timezone, setTimezone ] = React.useState(classroomViewsSettings.timezone);\n const [ schoolStartHour, setSchoolStartHour ] = React.useState(initialStartHour);\n const [ schoolEndHour, setSchoolEndHour ] = React.useState(initialEndHour);\n const [ isSaving, setIsSaving ] = React.useState(false);\n \n const isFormValid = schoolStartHour < schoolEndHour && timezone;\n const isDirty = classroomSize !== classroomViewsSettings.classroomSize\n || timezone !== classroomViewsSettings.timezone\n || schoolStartHour !== initialStartHour\n || schoolEndHour !== initialEndHour;\n\n async function onSave() {\n try {\n setIsSaving(true);\n \n await classroomViewsSettings.updateSettingsAsync({\n schoolStartTime: DateHelper.hourToTimeString(schoolStartHour),\n schoolEndTime: DateHelper.hourToTimeString(schoolEndHour),\n timezone,\n classroomSize\n });\n \n alerts.success(getPhrase('success'));\n \n props.closePopup();\n } catch {\n alerts.error(getPhrase('error'));\n } finally {\n setIsSaving(false);\n }\n }\n\n return (\n <Popup\n closePopup={props.closePopup}\n title={getPhrase('title')}\n size='lg'\n >\n <p><Text namespace={namespace} phrase='description1' /></p>\n <p><Text namespace={namespace} phrase='description2' /></p>\n\n <ClassroomSizeSelector\n className='my-3'\n classroomSize={classroomSize}\n onClassroomSizeChanged={setClassroomSize}\n />\n\n <SchoolHoursSelector\n className='mb-3'\n startHour={schoolStartHour}\n endHour={schoolEndHour}\n timezone={timezone}\n onStartHourChanged={setSchoolStartHour}\n onEndHourChanged={setSchoolEndHour}\n onTimezoneChanged={setTimezone}\n />\n\n <PopupButtons className='justify-content-between'>\n <a href={ArticleHelper.getLiteArticle(LiteSupportArticle.ClassroomViews)} target='_blank' rel='noopener noreferrer' className='text-info'>\n <Text namespace={namespace} phrase='learnMore' />\n </a>\n <div className='d-flex'>\n <PopupButtons.Cancel onClick={props.closePopup} text={getPhrase('close')} />\n <PopupButtons.Submit onClick={onSave} text={getPhrase('save')} showSpinner={isSaving} variant='dark' disabled={!isFormValid || !isDirty} />\n </div>\n </PopupButtons>\n </Popup>\n );\n}\n"],"mappings":"maAOM,EAAY,uCAEZ,EAAqB,GACrB,EAAqB,GAQ3B,SAAgB,EAAsB,EAAmC,CACvE,OACE,EAAA,EAAA,MAAC,MAAD,CAAK,UAAW,EAAW,uBAAwB,EAAM,UAAU,UAAnE,EACE,EAAA,EAAA,KAAC,KAAD,CAAI,UAAU,gCAAsB,EAAA,EAAA,KAAC,EAAD,CAAiB,UAAA,EAAW,OAAO,qBAAuB,CAAA,CAAK,CAAA,EACnG,EAAA,EAAA,KAAC,IAAD,CAAG,UAAU,gCAAsB,EAAA,EAAA,KAAC,EAAD,CAAiB,UAAA,EAAW,OAAO,2BAA6B,CAAA,CAAI,CAAA,EAEvG,EAAA,EAAA,KAAC,QAAD,CAAO,UAAU,OAAO,QAAQ,0BAAgB,EAAA,EAAA,KAAC,EAAD,CAAiB,UAAA,EAAW,OAAO,qBAAuB,CAAA,CAAQ,CAAA,EAElH,EAAA,EAAA,KAAC,EAAK,MAAN,CACE,GAAG,gBACH,IAAK,EACL,IAAK,EACL,KAAM,EACN,MAAO,EAAM,cACb,SAAU,GAAK,EAAM,uBAAuB,OAAO,EAAE,OAAO,MAAM,CAAC,CACnE,CAAA,EAC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AO,SAAU,CAAC,GAAe,CAAC,EAAW,CAAA,CACvI,GACO,GACT"}
1
+ {"version":3,"file":"IH7D3jLI.chunk.js","names":[],"sources":["../../src/apps/default/views/classroom-views-popup/components/classroom-size-selector/ClassroomSizeSelector.tsx","../../src/apps/default/views/classroom-views-popup/components/school-hours-selector/SchoolHoursSelector.tsx","../../src/apps/default/views/classroom-views-popup/ClassroomViewsPopupView.tsx"],"sourcesContent":["import React from 'react';\nimport { Form } from 'react-bootstrap';\n\nimport { classNames } from 'libs/common/react/utils/ClassNameHelper';\n\nimport { Text } from 'libs/shared/components/text/Text';\n\nconst namespace = 'reportsDefault.classroomSizeSelector';\n\nconst MIN_CLASSROOM_SIZE = 10;\nconst MAX_CLASSROOM_SIZE = 40;\n\ninterface ClassroomSizeSelectorProps {\n className?: string;\n classroomSize: number;\n onClassroomSizeChanged: (size: number) => void;\n}\n\nexport function ClassroomSizeSelector(props: ClassroomSizeSelectorProps) {\n return (\n <div className={classNames('border rounded-3 p-3', props.className)}>\n <h3 className='h6 fw-semibold mb-1'><Text namespace={namespace} phrase='classroomSizeTitle' /></h3>\n <p className='text-secondary mb-3'><Text namespace={namespace} phrase='classroomSizeDescription' /></p>\n\n <label className='mb-1' htmlFor='classroomSize'><Text namespace={namespace} phrase='classroomSizeLabel' /></label>\n\n <Form.Range\n id='classroomSize'\n min={MIN_CLASSROOM_SIZE}\n max={MAX_CLASSROOM_SIZE}\n step={1}\n value={props.classroomSize}\n onChange={e => props.onClassroomSizeChanged(Number(e.target.value))}\n />\n <div className='d-flex justify-content-between small mb-2'>\n <span>{MIN_CLASSROOM_SIZE}</span>\n <span>{MAX_CLASSROOM_SIZE}</span>\n </div>\n\n <p className='text-secondary mb-0'>\n <Text namespace={namespace} phrase='classroomSizeSummary' options={{ count: props.classroomSize }} />\n </p>\n </div>\n );\n}\n","import React from 'react';\n\nimport { classNames } from 'libs/common/react/utils/ClassNameHelper';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { Text } from 'libs/shared/components/text/Text';\n\nconst namespace = 'reportsDefault.schoolHoursSelector';\n\nconst SCHOOL_HOURS = [ 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 ];\nconst ALL_TIMEZONES = DateHelper.getTimezones();\n\ninterface SchoolHoursSelectorProps {\n className?: string;\n startHour: number;\n endHour: number;\n timezone: string;\n onStartHourChanged: (hour: number) => void;\n onEndHourChanged: (hour: number) => void;\n onTimezoneChanged: (tz: string) => void;\n}\n\nexport function SchoolHoursSelector(props: SchoolHoursSelectorProps) {\n const [ showTimezoneSelect, setShowTimezoneSelect ] = React.useState(false);\n\n const isTimeRangeValid = props.startHour < props.endHour;\n\n return (\n <div className={classNames('border rounded-3 p-3', props.className)}>\n <h3 className='h6 fw-semibold mb-1'><Text namespace={namespace} phrase='schoolHoursTitle' /></h3>\n <p className='text-secondary mb-3'><Text namespace={namespace} phrase='schoolHoursDescription' /></p>\n\n <div className='d-flex align-items-end gap-3 mb-2'>\n <div className='flex-grow-1'>\n <label className='small mb-1 d-block'><Text namespace={namespace} phrase='startTimeLabel' /></label>\n <select\n className='form-select'\n value={props.startHour}\n onChange={e => props.onStartHourChanged(Number(e.target.value))}\n >\n {SCHOOL_HOURS.map(hour => (\n <option key={hour} value={hour}>{DateHelper.hourToFriendlyString(hour)}</option>\n ))}\n </select>\n </div>\n <span className='pb-2'><Text namespace={namespace} phrase='schoolHoursTo' /></span>\n <div className='flex-grow-1'>\n <label className='small mb-1 d-block'><Text namespace={namespace} phrase='endTimeLabel' /></label>\n <select\n className='form-select'\n value={props.endHour}\n onChange={e => props.onEndHourChanged(Number(e.target.value))}\n >\n {SCHOOL_HOURS.map(hour => (\n <option key={hour} value={hour}>{DateHelper.hourToFriendlyString(hour)}</option>\n ))}\n </select>\n </div>\n </div>\n\n {isTimeRangeValid ? (\n <p className='text-secondary mb-0'>\n <Text\n namespace={namespace}\n phrase='schoolHoursSummary'\n options={{\n startTime: DateHelper.hourToFriendlyString(props.startHour),\n endTime: DateHelper.hourToFriendlyString(props.endHour)\n }}\n />\n </p>\n ) : (\n <p className='text-danger mb-0'>\n <Text namespace={namespace} phrase='schoolHoursValidation' />\n </p>\n )}\n\n <div className='mt-3'>\n {showTimezoneSelect ? (\n <>\n <label className='mb-1 d-block'><Text namespace={namespace} phrase='timezoneLabel' /></label>\n <select className='form-select' value={props.timezone} onChange={e => props.onTimezoneChanged(e.target.value)}>\n {ALL_TIMEZONES.map(tz => (\n <option key={tz} value={tz}>{tz}</option>\n ))}\n </select>\n </>\n ) : (\n <span className='text-secondary'>\n <Text namespace={namespace} phrase='timezoneCurrent' options={{ timezone: props.timezone }} />\n {' — '}\n <button className='btn btn-link text-info p-0 align-baseline' onClick={() => setShowTimezoneSelect(true)}>\n <Text namespace={namespace} phrase='timezoneChange' />\n </button>\n </span>\n )}\n </div>\n </div>\n );\n}\n","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { LocationContext } from 'libs/analytics/interfaces';\n\nimport { Popup } from 'libs/shared/components/popup/Popup';\nimport { PopupButtons } from 'libs/shared/components/popup/PopupButtons';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { LiteSupportArticle } from 'libs/shared/enums/SupportArticle';\nimport { useAlerts } from 'libs/shared/hooks/UseAlerts';\nimport { PopupViewProps } from 'libs/shared/interfaces';\nimport { ArticleHelper } from 'libs/shared/utils/ArticleHelper';\n\nimport { useClassroomViewsSettings } from 'shared/hooks/useClassroomViewsSettings';\n\nimport { ClassroomSizeSelector } from './components/classroom-size-selector/ClassroomSizeSelector';\nimport { SchoolHoursSelector } from './components/school-hours-selector/SchoolHoursSelector';\n\nconst namespace = 'reports.classroomViewsPopup';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nexport function ClassroomViewsPopupView(props: PopupViewProps): JSX.Element {\n const classroomViewsSettings = useClassroomViewsSettings(LocationContext.ClassroomViewsPopup);\n const alerts = useAlerts();\n\n const initialStartHour = DateHelper.timeStringToHour(classroomViewsSettings.schoolStartTime);\n const initialEndHour = DateHelper.timeStringToHour(classroomViewsSettings.schoolEndTime);\n \n const [ classroomSize, setClassroomSize ] = React.useState(classroomViewsSettings.classroomSize);\n const [ timezone, setTimezone ] = React.useState(classroomViewsSettings.timezone);\n const [ schoolStartHour, setSchoolStartHour ] = React.useState(initialStartHour);\n const [ schoolEndHour, setSchoolEndHour ] = React.useState(initialEndHour);\n const [ isSaving, setIsSaving ] = React.useState(false);\n \n const isFormValid = schoolStartHour < schoolEndHour && timezone;\n const isDirty = classroomSize !== classroomViewsSettings.classroomSize\n || timezone !== classroomViewsSettings.timezone\n || schoolStartHour !== initialStartHour\n || schoolEndHour !== initialEndHour;\n\n async function onSave() {\n try {\n setIsSaving(true);\n \n await classroomViewsSettings.updateSettingsAsync({\n schoolStartTime: DateHelper.hourToTimeString(schoolStartHour),\n schoolEndTime: DateHelper.hourToTimeString(schoolEndHour),\n timezone,\n classroomSize\n });\n \n alerts.success(getPhrase('success'));\n \n props.closePopup();\n } catch {\n alerts.error(getPhrase('error'));\n } finally {\n setIsSaving(false);\n }\n }\n\n return (\n <Popup\n closePopup={props.closePopup}\n title={getPhrase('title')}\n size='lg'\n >\n <p><Text namespace={namespace} phrase='description1' /></p>\n <p><Text namespace={namespace} phrase='description2' /></p>\n\n <ClassroomSizeSelector\n className='my-3'\n classroomSize={classroomSize}\n onClassroomSizeChanged={setClassroomSize}\n />\n\n <SchoolHoursSelector\n className='mb-3'\n startHour={schoolStartHour}\n endHour={schoolEndHour}\n timezone={timezone}\n onStartHourChanged={setSchoolStartHour}\n onEndHourChanged={setSchoolEndHour}\n onTimezoneChanged={setTimezone}\n />\n\n <PopupButtons className='justify-content-between'>\n <a href={ArticleHelper.getLiteArticle(LiteSupportArticle.ClassroomViews)} target='_blank' rel='noopener noreferrer' className='text-info'>\n <Text namespace={namespace} phrase='learnMore' />\n </a>\n <div className='d-flex'>\n <PopupButtons.Cancel onClick={props.closePopup} text={getPhrase('close')} />\n <PopupButtons.Submit onClick={onSave} text={getPhrase('save')} showSpinner={isSaving} variant='dark' disabled={!isFormValid || !isDirty} />\n </div>\n </PopupButtons>\n </Popup>\n );\n}\n"],"mappings":"maAOM,EAAY,uCAEZ,EAAqB,GACrB,EAAqB,GAQ3B,SAAgB,EAAsB,EAAmC,CACvE,OACE,EAAA,EAAA,MAAC,MAAD,CAAK,UAAW,EAAW,uBAAwB,EAAM,UAAU,UAAnE,EACE,EAAA,EAAA,KAAC,KAAD,CAAI,UAAU,gCAAsB,EAAA,EAAA,KAAC,EAAD,CAAiB,UAAA,EAAW,OAAO,qBAAuB,CAAA,CAAK,CAAA,EACnG,EAAA,EAAA,KAAC,IAAD,CAAG,UAAU,gCAAsB,EAAA,EAAA,KAAC,EAAD,CAAiB,UAAA,EAAW,OAAO,2BAA6B,CAAA,CAAI,CAAA,EAEvG,EAAA,EAAA,KAAC,QAAD,CAAO,UAAU,OAAO,QAAQ,0BAAgB,EAAA,EAAA,KAAC,EAAD,CAAiB,UAAA,EAAW,OAAO,qBAAuB,CAAA,CAAQ,CAAA,EAElH,EAAA,EAAA,KAAC,EAAK,MAAN,CACE,GAAG,gBACH,IAAK,EACL,IAAK,EACL,KAAM,EACN,MAAO,EAAM,cACb,SAAU,GAAK,EAAM,uBAAuB,OAAO,EAAE,OAAO,MAAM,CAAC,CACnE,CAAA,EACF,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,qDAAf,EACE,EAAA,EAAA,KAAC,OAAD,CAAA,SAAO,EAA0B,CAAA,EACjC,EAAA,EAAA,KAAC,OAAD,CAAA,SAAO,EAA0B,CAAA,CAC7B,IAEN,EAAA,EAAA,KAAC,IAAD,CAAG,UAAU,gCACX,EAAA,EAAA,KAAC,EAAD,CAAiB,UAAA,EAAW,OAAO,uBAAuB,QAAS,CAAE,MAAO,EAAM,cAAe,CAAI,CAAA,CACnG,CAAA,CACA,GCnCV,IAAM,EAAY,qCAEZ,E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KAAC,IAAD,CAAA,UAAG,EAAA,EAAA,KAAC,EAAD,CAAiB,YAAW,OAAO,eAAiB,CAAA,CAAI,CAAA,EAC3D,EAAA,EAAA,KAAC,IAAD,CAAA,UAAG,EAAA,EAAA,KAAC,EAAD,CAAiB,YAAW,OAAO,eAAiB,CAAA,CAAI,CAAA,EAE3D,EAAA,EAAA,KAAC,EAAD,CACE,UAAU,OACK,gBACf,uBAAwB,EACxB,CAAA,EAEF,EAAA,EAAA,KAAC,EAAD,CACE,UAAU,OACV,UAAW,EACX,QAAS,EACC,WACV,mBAAoB,EACpB,iBAAkB,EAClB,kBAAmB,EACnB,CAAA,EAEF,EAAA,EAAA,MAAC,EAAD,CAAc,UAAU,mCAAxB,EACE,EAAA,EAAA,KAAC,IAAD,CAAG,KAAM,EAAc,eAAe,EAAmB,eAAe,CAAE,OAAO,SAAS,IAAI,sBAAsB,UAAU,sBAC5H,EAAA,EAAA,KAAC,EAAD,CAAiB,YAAW,OAAO,YAAc,CAAA,CAC/C,CAAA,EACJ,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,kBAAf,EACE,EAAA,EAAA,KAAC,EAAa,OAAd,CAAqB,QAAS,EAAM,WAAY,KAAM,EAAU,QAAQ,CAAI,CAAA,EAC5E,EAAA,EAAA,KAAC,EAAa,OAAd,CAAqB,QAAS,EAAQ,KAAM,EAAU,OAAO,CAAE,YAAa,EAAU,QAAQ,OAAO,SAAU,CAAC,GAAe,CAAC,EAAW,CAAA,CACvI,GACO,GACT"}
@@ -1,2 +1,2 @@
1
- import{E as e,Jn as t,P as n,b as r,st as i,x as a,y as o}from"./CM0wW4AE.chunk.js";import{d as s}from"./dUFTODMz.chunk.js";import{t as c}from"./I5Dnl_eN.chunk.js";import{t as l}from"./H5KLIhR_.chunk.js";import{t as u}from"./CT_mfyYn.chunk.js";import{t as d}from"./C7xZhn-Q.chunk.js";import{t as f}from"./DHk1ZJ0C.chunk.js";import{t as p}from"./DIAxWspB.chunk.js";import{h as m,l as h,n as g,r as _,u as v}from"./app-BigOHyYp.js";import{n as y,r as b,t as x}from"./3q7nyVif2.chunk.js";import{t as S}from"./ktNy7dHM2.chunk.js";import{t as C}from"./mApnhyGa2.chunk.js";import{n as w}from"./DgPadkLi2.chunk.js";import{r as T,t as E}from"./B9S_LeFP.chunk.js";import{t as D}from"./CKVaLGJC.chunk.js";var O=t(e()),k=t(i()),A=n(),j=k.forwardRef(({bsPrefix:e,className:t,as:n=`div`,...i},s)=>{let c=a(e,`row`),l=o(),u=r(),d=`${c}-cols`,f=[];return l.forEach(e=>{let t=i[e];delete i[e];let n;typeof t==`object`&&t?{cols:n}=t:n=t;let r=e===u?``:`-${e}`;n!=null&&f.push(`${d}${r}-${n}`)}),(0,A.jsx)(n,{ref:s,...i,className:(0,O.default)(t,c,...f)})});j.displayName=`Row`;var M={videoTable:`_videoTable_14eqw_1`,interactiveTable:`_interactiveTable_14eqw_4`,userTable:`_userTable_14eqw_7`,header:`_header_14eqw_10`,itemHeader:`_itemHeader_14eqw_13`,videoItemContainer:`_videoItemContainer_14eqw_16`,interactiveItemContainer:`_interactiveItemContainer_14eqw_19`,userItemContainer:`_userItemContainer_14eqw_22`,heatMapItemContainer:`_heatMapItemContainer_14eqw_25`,partialAvatar:`_partialAvatar_14eqw_28`,partialNumber:`_partialNumber_14eqw_33`,partialLongText:`_partialLongText_14eqw_37`,partialMediumText:`_partialMediumText_14eqw_41`,partialShortText:`_partialShortText_14eqw_45`,partialThumbnail:`_partialThumbnail_14eqw_49`,partialHeatMap:`_partialHeatMap_14eqw_53`},N=(0,A.jsxs)(j,{className:`py-3`,children:[(0,A.jsx)(u,{xs:1,className:`d-flex align-items-center justify-content-center`,children:(0,A.jsx)(`div`,{className:`partial-loading-background ${M.partialNumber}`})}),(0,A.jsx)(u,{xs:5,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`partial-loading-background ${M.partialShortText}`})}),(0,A.jsx)(u,{xs:2,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`d-block partial-loading-background mx-4 ${M.partialShortText}`})}),(0,A.jsx)(u,{xs:4,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`d-block partial-loading-background mx-4 ${M.partialShortText}`})})]}),P=(0,A.jsxs)(j,{className:`py-3`,children:[(0,A.jsx)(u,{xs:5,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`partial-loading-background mx-4 ${M.partialShortText}`})}),(0,A.jsx)(u,{xs:2,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`d-block partial-loading-background mx-4 ${M.partialShortText}`})}),(0,A.jsx)(u,{xs:2,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`d-block partial-loading-background mx-4 ${M.partialShortText}`})}),(0,A.jsx)(u,{xs:3,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`d-block partial-loading-background mx-4 ${M.partialShortText}`})})]}),F=(0,A.jsxs)(j,{className:`py-3`,children:[(0,A.jsx)(u,{xs:2,className:`d-flex`,children:(0,A.jsx)(`div`,{className:`partial-loading-background mx-3 ${M.partialShortText}`})}),(0,A.jsx)(u,{xs:2,className:`d-flex justify-content-center`,children:(0,A.jsx)(`div`,{className:`partial-loading-background mx-2 ${M.partialShortText}`})}),(0,A.jsx)(u,{xs:2,className:`d-flex justify-content-center`,children:(0,A.jsx)(`div`,{className:`partial-loading-background ${M.partialShortText}`})}),(0,A.jsx)(u,{xs:6,className:`d-flex justify-content-between`,children:(0,A.jsx)(`div`,{className:`d-block partial-loading-background ${M.heatMapItemContainer} ${M.partialShortText}`})})]});function I(e){switch(e){case`video-views`:return{headerComponent:N,tableStyle:M.videoTable};case`interactives`:return{headerComponent:P,tableStyle:M.interactiveTable};case`engagement-users`:return{headerComponent:F,tableStyle:M.userTable};default:return{headerComponent:(0,A.jsx)(A.Fragment,{}),tableStyle:``}}}function L(e){let{headerComponent:t,tableStyle:n}=I(e.variant);return(0,A.jsxs)(`div`,{className:`bg-white rounded ${n} ${e.className??``}`,children:[(0,A.jsx)(`div`,{className:`border-bottom ${M.header} ${e.headerClassName??``}`,children:t}),e.children]})}function R(){return(0,A.jsxs)(j,{className:`py-1 ${M.videoItemContainer}`,children:[(0,A.jsx)(u,{xs:1,className:`d-flex align-items-center justify-content-center`,children:(0,A.jsx)(`div`,{className:`partial-loading-background ${M.partialNumber}`})}),(0,A.jsx)(u,{xs:2,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`d-block`,children:(0,A.jsx)(`div`,{className:`partial-loading-background rounded ${M.partialThumbnail}`})})}),(0,A.jsx)(u,{xs:3,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`partial-loading-background ms-n2 ${M.partialLongText}`})}),(0,A.jsx)(u,{xs:2,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`d-block partial-loading-background mx-4 ${M.partialShortText}`})}),(0,A.jsx)(u,{xs:4,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`d-block partial-loading-background mx-4 ${M.partialNumber}`})})]})}function z(){return(0,A.jsxs)(j,{className:`py-1 ${M.interactiveItemContainer}`,children:[(0,A.jsx)(u,{xs:1,className:`d-flex align-items-center justify-content-center`,children:(0,A.jsx)(`div`,{className:`partial-loading-background ${M.partialNumber}`})}),(0,A.jsx)(u,{xs:2,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`d-block`,children:(0,A.jsx)(`div`,{className:`partial-loading-background rounded ${M.partialThumbnail}`})})}),(0,A.jsx)(u,{xs:2,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`partial-loading-background ms-n2 ${M.partialMediumText}`})}),(0,A.jsx)(u,{xs:2,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`d-block partial-loading-background mx-4 ${M.partialAvatar}`})}),(0,A.jsx)(u,{xs:2,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`d-block partial-loading-background mx-4 ${M.partialMediumText}`})}),(0,A.jsx)(u,{xs:3,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`d-block partial-loading-background mx-4 ${M.partialNumber}`})})]})}function B(){return(0,A.jsxs)(j,{className:`my-2 ${M.userItemContainer}`,children:[(0,A.jsxs)(u,{xs:2,className:`d-flex align-items-center `,children:[(0,A.jsx)(`div`,{className:`partial-loading-background ms-3 ${M.partialAvatar}`}),(0,A.jsx)(`div`,{className:`partial-loading-background mx-2 ${M.partialShortText}`})]}),(0,A.jsx)(u,{xs:2,className:`d-flex justify-content-center align-items-center`,children:(0,A.jsx)(`div`,{className:`d-block partial-loading-background ${M.partialShortText}`})}),(0,A.jsx)(u,{xs:2,className:`d-flex justify-content-center align-items-center`,children:(0,A.jsx)(`div`,{className:`partial-loading-background ${M.partialShortText}`})}),(0,A.jsx)(u,{xs:6,className:`d-flex justify-content-between align-items-center`,children:(0,A.jsx)(`div`,{className:`partial-loading-background ${M.heatMapItemContainer} ${M.partialHeatMap}`})})]})}function V(e,t){switch(e){case`video-views`:return(0,A.jsx)(R,{},t);case`interactives`:return(0,A.jsx)(z,{},t);case`engagement-users`:return(0,A.jsx)(B,{},t);default:return(0,A.jsx)(A.Fragment,{})}}H.defaultProps={itemCount:7};function H(e){return(0,A.jsx)(`div`,{className:`my-1`,children:Array(e.itemCount).fill(null).map((t,n)=>V(e.variant,n))})}var U=c.encloseNamespace(`reportsVideos.videoViewsTableEmptyState`);function W(){return(0,A.jsxs)(p,{className:`bg-white rounded justify-content-center py-5`,children:[(0,A.jsx)(p.Image,{src:l.EmptyStates.Shared.ViewCount,className:`w-25 h-auto`}),(0,A.jsx)(p.Heading,{children:U(`heading`)}),(0,A.jsx)(p.Info,{children:U(`description`)})]})}var G={title:`_title_3yzlb_1`,thumbnail:`_thumbnail_3yzlb_2`,seeOverview:`_seeOverview_3yzlb_8`,row:`_row_3yzlb_11`},K=c.encloseNamespace(`reportsVideos.videoViewsTable`),q={table:`bg-white rounded`,header:`border-bottom`,headerCell:`p-3`,row:G.row,cell:`p-3`},J=[{Header:()=>(0,A.jsx)(`div`,{className:`d-flex justify-content-end`,children:`#`}),accessor:`object`,id:`index`,Cell:({row:{index:e}})=>(0,A.jsx)(`div`,{className:`d-flex align-items-center justify-content-end h-100`,children:e+1}),width:5,disableSortBy:!0},{Header:e=>(0,A.jsx)(`div`,{className:G.title,children:(0,A.jsxs)(A.Fragment,{children:[K(`title`),` `,e.renderSortIndicator()]})}),accessor:`object`,id:`image`,Cell:({value:e})=>(0,A.jsx)(x,{video:e,imageOptions:{size:f.Small},textPosition:y.Independent,type:`cosmetic`,hideMask:!0,extraClasses:G.thumbnail,newDurationStyle:!0,size:`sm`}),width:30,hideSortIndicator:!0,sortType:(e,t)=>e.original.object.name?.toLowerCase()>t.original.object.name?.toLowerCase()?1:-1},{accessor:`object`,id:`name`,Cell:({value:e})=>(0,A.jsxs)(`div`,{className:`d-flex flex-column justify-content-center h-100`,children:[v.isVideoType(e)&&(0,A.jsx)(b,{type:`series`,video:e,analyticsOptions:null,className:`d-inline clamp-1`}),(0,A.jsx)(`span`,{className:`text-truncate`,children:e.name})]}),width:60,disableSortBy:!0},{Header:()=>(0,A.jsx)(A.Fragment,{children:K(`contentType`)}),accessor:`contentType`,Cell:({value:e})=>(0,A.jsx)(`div`,{className:`d-flex align-items-center h-100`,children:e}),width:30},{Header:()=>(0,A.jsx)(A.Fragment,{children:K(`views`)}),accessor:`combinedCount`,Cell:({value:e})=>(0,A.jsx)(`div`,{className:`d-flex align-items-center h-100`,children:e}),width:30},{accessor:`object`,id:`see-overview`,Cell:()=>(0,A.jsx)(`div`,{className:`${G.seeOverview} align-items-center h-100 text-info`,children:K(`seeAnalytics`)}),width:25,disableSortBy:!0}];function Y(e){let t=g();function n(n){return e.getVideoAppLink(n.original.object,t)}return(0,A.jsx)(E,{columns:J,data:e.videos,theme:q,getRowAppLink:n,enableSort:!0})}var X=c.encloseNamespace(`reportsVideos.schoolTopVideosView`),Z=100;function Q(){let e=_(`video-views`),t=s(S.topStreams(Z,e)),n=C(t.data?.map(e=>e.objectId)??[],m.videos);T(t),d({title:X(`videos`)}),w(X(`videos`));let r=t.hasCompleted&&!n.isFetching,i=!!n.itemsArr?.length,a=t.data?.map(e=>{let t=n.items?.[e?.objectId];return t?{count:e.count,object:t,contentType:e.contentType,combinedCount:e.combinedCount}:null}).filter(e=>!!e);return(0,A.jsxs)(`div`,{className:`pb-3`,children:[(0,A.jsx)(D,{}),!r&&(0,A.jsx)(L,{variant:`video-views`,children:(0,A.jsx)(H,{variant:`video-views`})}),r&&i&&(0,A.jsx)(Y,{videos:a,getVideoAppLink:h}),r&&!i&&(0,A.jsx)(W,{})]})}export{Q as SchoolTopVideosView};
2
- //# sourceMappingURL=CKRKdk5U.chunk.js.map
1
+ import{E as e,Jn as t,P as n,b as r,st as i,x as a,y as o}from"./CM0wW4AE.chunk.js";import{d as s}from"./dUFTODMz.chunk.js";import{t as c}from"./I5Dnl_eN.chunk.js";import{t as l}from"./H5KLIhR_.chunk.js";import{t as u}from"./CT_mfyYn.chunk.js";import{t as d}from"./C7xZhn-Q.chunk.js";import{t as f}from"./DHk1ZJ0C.chunk.js";import{t as p}from"./DIAxWspB.chunk.js";import{h as m,l as h,n as g,r as _,u as v}from"./app-m6P7KXE1.js";import{n as y,r as b,t as x}from"./DNZvrGV22.chunk.js";import{t as S}from"./DvxtrAxT2.chunk.js";import{t as C}from"./mApnhyGa2.chunk.js";import{n as w}from"./I9MVVxo82.chunk.js";import{r as T,t as E}from"./DMuXCE-z.chunk.js";import{t as D}from"./fOHWXn7-.chunk.js";var O=t(e()),k=t(i()),A=n(),j=k.forwardRef(({bsPrefix:e,className:t,as:n=`div`,...i},s)=>{let c=a(e,`row`),l=o(),u=r(),d=`${c}-cols`,f=[];return l.forEach(e=>{let t=i[e];delete i[e];let n;typeof t==`object`&&t?{cols:n}=t:n=t;let r=e===u?``:`-${e}`;n!=null&&f.push(`${d}${r}-${n}`)}),(0,A.jsx)(n,{ref:s,...i,className:(0,O.default)(t,c,...f)})});j.displayName=`Row`;var M={videoTable:`_videoTable_14eqw_1`,interactiveTable:`_interactiveTable_14eqw_4`,userTable:`_userTable_14eqw_7`,header:`_header_14eqw_10`,itemHeader:`_itemHeader_14eqw_13`,videoItemContainer:`_videoItemContainer_14eqw_16`,interactiveItemContainer:`_interactiveItemContainer_14eqw_19`,userItemContainer:`_userItemContainer_14eqw_22`,heatMapItemContainer:`_heatMapItemContainer_14eqw_25`,partialAvatar:`_partialAvatar_14eqw_28`,partialNumber:`_partialNumber_14eqw_33`,partialLongText:`_partialLongText_14eqw_37`,partialMediumText:`_partialMediumText_14eqw_41`,partialShortText:`_partialShortText_14eqw_45`,partialThumbnail:`_partialThumbnail_14eqw_49`,partialHeatMap:`_partialHeatMap_14eqw_53`},N=(0,A.jsxs)(j,{className:`py-3`,children:[(0,A.jsx)(u,{xs:1,className:`d-flex align-items-center justify-content-center`,children:(0,A.jsx)(`div`,{className:`partial-loading-background ${M.partialNumber}`})}),(0,A.jsx)(u,{xs:5,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`partial-loading-background ${M.partialShortText}`})}),(0,A.jsx)(u,{xs:2,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`d-block partial-loading-background mx-4 ${M.partialShortText}`})}),(0,A.jsx)(u,{xs:4,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`d-block partial-loading-background mx-4 ${M.partialShortText}`})})]}),P=(0,A.jsxs)(j,{className:`py-3`,children:[(0,A.jsx)(u,{xs:5,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`partial-loading-background mx-4 ${M.partialShortText}`})}),(0,A.jsx)(u,{xs:2,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`d-block partial-loading-background mx-4 ${M.partialShortText}`})}),(0,A.jsx)(u,{xs:2,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`d-block partial-loading-background mx-4 ${M.partialShortText}`})}),(0,A.jsx)(u,{xs:3,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`d-block partial-loading-background mx-4 ${M.partialShortText}`})})]}),F=(0,A.jsxs)(j,{className:`py-3`,children:[(0,A.jsx)(u,{xs:2,className:`d-flex`,children:(0,A.jsx)(`div`,{className:`partial-loading-background mx-3 ${M.partialShortText}`})}),(0,A.jsx)(u,{xs:2,className:`d-flex justify-content-center`,children:(0,A.jsx)(`div`,{className:`partial-loading-background mx-2 ${M.partialShortText}`})}),(0,A.jsx)(u,{xs:2,className:`d-flex justify-content-center`,children:(0,A.jsx)(`div`,{className:`partial-loading-background ${M.partialShortText}`})}),(0,A.jsx)(u,{xs:6,className:`d-flex justify-content-between`,children:(0,A.jsx)(`div`,{className:`d-block partial-loading-background ${M.heatMapItemContainer} ${M.partialShortText}`})})]});function I(e){switch(e){case`video-views`:return{headerComponent:N,tableStyle:M.videoTable};case`interactives`:return{headerComponent:P,tableStyle:M.interactiveTable};case`engagement-users`:return{headerComponent:F,tableStyle:M.userTable};default:return{headerComponent:(0,A.jsx)(A.Fragment,{}),tableStyle:``}}}function L(e){let{headerComponent:t,tableStyle:n}=I(e.variant);return(0,A.jsxs)(`div`,{className:`bg-white rounded ${n} ${e.className??``}`,children:[(0,A.jsx)(`div`,{className:`border-bottom ${M.header} ${e.headerClassName??``}`,children:t}),e.children]})}function R(){return(0,A.jsxs)(j,{className:`py-1 ${M.videoItemContainer}`,children:[(0,A.jsx)(u,{xs:1,className:`d-flex align-items-center justify-content-center`,children:(0,A.jsx)(`div`,{className:`partial-loading-background ${M.partialNumber}`})}),(0,A.jsx)(u,{xs:2,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`d-block`,children:(0,A.jsx)(`div`,{className:`partial-loading-background rounded ${M.partialThumbnail}`})})}),(0,A.jsx)(u,{xs:3,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`partial-loading-background ms-n2 ${M.partialLongText}`})}),(0,A.jsx)(u,{xs:2,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`d-block partial-loading-background mx-4 ${M.partialShortText}`})}),(0,A.jsx)(u,{xs:4,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`d-block partial-loading-background mx-4 ${M.partialNumber}`})})]})}function z(){return(0,A.jsxs)(j,{className:`py-1 ${M.interactiveItemContainer}`,children:[(0,A.jsx)(u,{xs:1,className:`d-flex align-items-center justify-content-center`,children:(0,A.jsx)(`div`,{className:`partial-loading-background ${M.partialNumber}`})}),(0,A.jsx)(u,{xs:2,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`d-block`,children:(0,A.jsx)(`div`,{className:`partial-loading-background rounded ${M.partialThumbnail}`})})}),(0,A.jsx)(u,{xs:2,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`partial-loading-background ms-n2 ${M.partialMediumText}`})}),(0,A.jsx)(u,{xs:2,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`d-block partial-loading-background mx-4 ${M.partialAvatar}`})}),(0,A.jsx)(u,{xs:2,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`d-block partial-loading-background mx-4 ${M.partialMediumText}`})}),(0,A.jsx)(u,{xs:3,className:`d-flex align-items-center`,children:(0,A.jsx)(`div`,{className:`d-block partial-loading-background mx-4 ${M.partialNumber}`})})]})}function B(){return(0,A.jsxs)(j,{className:`my-2 ${M.userItemContainer}`,children:[(0,A.jsxs)(u,{xs:2,className:`d-flex align-items-center `,children:[(0,A.jsx)(`div`,{className:`partial-loading-background ms-3 ${M.partialAvatar}`}),(0,A.jsx)(`div`,{className:`partial-loading-background mx-2 ${M.partialShortText}`})]}),(0,A.jsx)(u,{xs:2,className:`d-flex justify-content-center align-items-center`,children:(0,A.jsx)(`div`,{className:`d-block partial-loading-background ${M.partialShortText}`})}),(0,A.jsx)(u,{xs:2,className:`d-flex justify-content-center align-items-center`,children:(0,A.jsx)(`div`,{className:`partial-loading-background ${M.partialShortText}`})}),(0,A.jsx)(u,{xs:6,className:`d-flex justify-content-between align-items-center`,children:(0,A.jsx)(`div`,{className:`partial-loading-background ${M.heatMapItemContainer} ${M.partialHeatMap}`})})]})}function V(e,t){switch(e){case`video-views`:return(0,A.jsx)(R,{},t);case`interactives`:return(0,A.jsx)(z,{},t);case`engagement-users`:return(0,A.jsx)(B,{},t);default:return(0,A.jsx)(A.Fragment,{})}}H.defaultProps={itemCount:7};function H(e){return(0,A.jsx)(`div`,{className:`my-1`,children:Array(e.itemCount).fill(null).map((t,n)=>V(e.variant,n))})}var U=c.encloseNamespace(`reportsVideos.videoViewsTableEmptyState`);function W(){return(0,A.jsxs)(p,{className:`bg-white rounded justify-content-center py-5`,children:[(0,A.jsx)(p.Image,{src:l.EmptyStates.Shared.ViewCount,className:`w-25 h-auto`}),(0,A.jsx)(p.Heading,{children:U(`heading`)}),(0,A.jsx)(p.Info,{children:U(`description`)})]})}var G={title:`_title_3yzlb_1`,thumbnail:`_thumbnail_3yzlb_2`,seeOverview:`_seeOverview_3yzlb_8`,row:`_row_3yzlb_11`},K=c.encloseNamespace(`reportsVideos.videoViewsTable`),q={table:`bg-white rounded`,header:`border-bottom`,headerCell:`p-3`,row:G.row,cell:`p-3`},J=[{Header:()=>(0,A.jsx)(`div`,{className:`d-flex justify-content-end`,children:`#`}),accessor:`object`,id:`index`,Cell:({row:{index:e}})=>(0,A.jsx)(`div`,{className:`d-flex align-items-center justify-content-end h-100`,children:e+1}),width:5,disableSortBy:!0},{Header:e=>(0,A.jsx)(`div`,{className:G.title,children:(0,A.jsxs)(A.Fragment,{children:[K(`title`),` `,e.renderSortIndicator()]})}),accessor:`object`,id:`image`,Cell:({value:e})=>(0,A.jsx)(x,{video:e,imageOptions:{size:f.Small},textPosition:y.Independent,type:`cosmetic`,hideMask:!0,extraClasses:G.thumbnail,newDurationStyle:!0,size:`sm`}),width:30,hideSortIndicator:!0,sortType:(e,t)=>e.original.object.name?.toLowerCase()>t.original.object.name?.toLowerCase()?1:-1},{accessor:`object`,id:`name`,Cell:({value:e})=>(0,A.jsxs)(`div`,{className:`d-flex flex-column justify-content-center h-100`,children:[v.isVideoType(e)&&(0,A.jsx)(b,{type:`series`,video:e,analyticsOptions:null,className:`d-inline clamp-1`}),(0,A.jsx)(`span`,{className:`text-truncate`,children:e.name})]}),width:60,disableSortBy:!0},{Header:()=>(0,A.jsx)(A.Fragment,{children:K(`contentType`)}),accessor:`contentType`,Cell:({value:e})=>(0,A.jsx)(`div`,{className:`d-flex align-items-center h-100`,children:e}),width:30},{Header:()=>(0,A.jsx)(A.Fragment,{children:K(`views`)}),accessor:`combinedCount`,Cell:({value:e})=>(0,A.jsx)(`div`,{className:`d-flex align-items-center h-100`,children:e}),width:30},{accessor:`object`,id:`see-overview`,Cell:()=>(0,A.jsx)(`div`,{className:`${G.seeOverview} align-items-center h-100 text-info`,children:K(`seeAnalytics`)}),width:25,disableSortBy:!0}];function Y(e){let t=g();function n(n){return e.getVideoAppLink(n.original.object,t)}return(0,A.jsx)(E,{columns:J,data:e.videos,theme:q,getRowAppLink:n,enableSort:!0})}var X=c.encloseNamespace(`reportsVideos.schoolTopVideosView`),Z=100;function Q(){let e=_(`video-views`),t=s(S.topStreams(Z,e)),n=C(t.data?.map(e=>e.objectId)??[],m.videos);T(t),d({title:X(`videos`)}),w(X(`videos`));let r=t.hasCompleted&&!n.isFetching,i=!!n.itemsArr?.length,a=t.data?.map(e=>{let t=n.items?.[e?.objectId];return t?{count:e.count,object:t,contentType:e.contentType,combinedCount:e.combinedCount}:null}).filter(e=>!!e);return(0,A.jsxs)(`div`,{className:`pb-3`,children:[(0,A.jsx)(D,{}),!r&&(0,A.jsx)(L,{variant:`video-views`,children:(0,A.jsx)(H,{variant:`video-views`})}),r&&i&&(0,A.jsx)(Y,{videos:a,getVideoAppLink:h}),r&&!i&&(0,A.jsx)(W,{})]})}export{Q as SchoolTopVideosView};
2
+ //# sourceMappingURL=OU_kRJz_.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CKRKdk5U.chunk.js","names":[],"sources":["../../../../../node_modules/react-bootstrap/esm/Row.js","../../src/shared/components/partial-loading/partial-loading.module.scss","../../src/shared/components/partial-loading/PartialTable.tsx","../../src/shared/components/partial-loading/PartialTableContent.tsx","../../src/apps/videos/components/video-views-table/video-views-table-empty-state/VideoViewsTableEmptyState.tsx","../../src/apps/videos/components/video-views-table/video-views-table.module.scss","../../src/apps/videos/components/video-views-table/VideoViewsTable.tsx","../../src/apps/videos/views/school-top-videos/SchoolTopVideosView.tsx"],"sourcesContent":["\"use client\";\n\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { useBootstrapPrefix, useBootstrapBreakpoints, useBootstrapMinBreakpoint } from './ThemeProvider';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst Row = /*#__PURE__*/React.forwardRef(({\n bsPrefix,\n className,\n // Need to define the default \"as\" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595\n as: Component = 'div',\n ...props\n}, ref) => {\n const decoratedBsPrefix = useBootstrapPrefix(bsPrefix, 'row');\n const breakpoints = useBootstrapBreakpoints();\n const minBreakpoint = useBootstrapMinBreakpoint();\n const sizePrefix = `${decoratedBsPrefix}-cols`;\n const classes = [];\n breakpoints.forEach(brkPoint => {\n const propValue = props[brkPoint];\n delete props[brkPoint];\n let cols;\n if (propValue != null && typeof propValue === 'object') {\n ({\n cols\n } = propValue);\n } else {\n cols = propValue;\n }\n const infix = brkPoint !== minBreakpoint ? `-${brkPoint}` : '';\n if (cols != null) classes.push(`${sizePrefix}${infix}-${cols}`);\n });\n return /*#__PURE__*/_jsx(Component, {\n ref: ref,\n ...props,\n className: classNames(className, decoratedBsPrefix, ...classes)\n });\n});\nRow.displayName = 'Row';\nexport default Row;",":local {\n // Table styles\n\n .videoTable {\n height: 62rem;\n }\n\n .interactiveTable {\n height: 57rem;\n }\n\n .userTable {\n height: 14rem;\n }\n\n .header {\n height: 3.825rem\n }\n\n .itemHeader {\n height: 3.825rem\n }\n\n // Item styles\n\n .videoItemContainer {\n height: 8.125rem;\n }\n\n .interactiveItemContainer {\n height: 7.375rem;\n }\n\n .userItemContainer {\n height: 2.5625rem;\n }\n\n .heatMapItemContainer {\n margin-left: 6rem;\n }\n\n .partialAvatar {\n width: $avatar-width;\n height: $avatar-width;\n border-radius: 50%;\n }\n\n .partialNumber {\n width: 2rem;\n height: 1.1rem;\n }\n\n .partialLongText {\n width: 16rem;\n height: 1.1rem;\n }\n\n .partialMediumText {\n width: 10rem;\n height: 1.1rem;\n }\n\n .partialShortText {\n width: 5rem;\n height: 1.1rem;\n }\n\n .partialThumbnail {\n width: 10rem;\n padding-bottom: 56.25%;\n }\n\n .partialHeatMap {\n width: 34rem;\n height: 1.1rem;\n }\n}","import React from 'react';\nimport { Col, Row } from 'react-bootstrap';\n\nimport styles from './partial-loading.module.scss';\n\nconst VideoViewsHeader = (\n <Row className='py-3'>\n <Col xs={1} className='d-flex align-items-center justify-content-center'>\n <div className={`partial-loading-background ${styles.partialNumber}`} />\n </Col>\n <Col xs={5} className='d-flex align-items-center'>\n <div className={`partial-loading-background ${styles.partialShortText}`} />\n </Col>\n <Col xs={2} className='d-flex align-items-center' >\n <div className={`d-block partial-loading-background mx-4 ${styles.partialShortText}`} />\n </Col>\n <Col xs={4} className='d-flex align-items-center'>\n <div className={`d-block partial-loading-background mx-4 ${styles.partialShortText}`} />\n </Col>\n </Row>\n);\n\nconst InteractivesHeader = (\n <Row className='py-3'>\n <Col xs={5} className='d-flex align-items-center'>\n <div className={`partial-loading-background mx-4 ${styles.partialShortText}`} />\n </Col>\n <Col xs={2} className='d-flex align-items-center' >\n <div className={`d-block partial-loading-background mx-4 ${styles.partialShortText}`} />\n </Col>\n <Col xs={2} className='d-flex align-items-center'>\n <div className={`d-block partial-loading-background mx-4 ${styles.partialShortText}`} />\n </Col>\n <Col xs={3} className='d-flex align-items-center'>\n <div className={`d-block partial-loading-background mx-4 ${styles.partialShortText}`} />\n </Col>\n </Row>\n);\n\nconst EngagementUsersHeader = (\n <Row className='py-3'>\n <Col xs={2} className='d-flex'>\n <div className={`partial-loading-background mx-3 ${styles.partialShortText}`} />\n </Col>\n <Col xs={2} className='d-flex justify-content-center'>\n <div className={`partial-loading-background mx-2 ${styles.partialShortText}`} />\n </Col>\n <Col xs={2} className='d-flex justify-content-center'>\n <div className={`partial-loading-background ${styles.partialShortText}`} />\n </Col>\n <Col xs={6} className='d-flex justify-content-between'>\n <div className={`d-block partial-loading-background ${styles.heatMapItemContainer} ${styles.partialShortText}`} />\n </Col>\n </Row>\n);\n\nfunction getTableVariant(type: TableVariant) {\n switch (type) {\n case 'video-views':\n return {\n headerComponent: VideoViewsHeader,\n tableStyle: styles.videoTable\n };\n\n case 'interactives':\n return {\n headerComponent: InteractivesHeader,\n tableStyle: styles.interactiveTable\n };\n\n case 'engagement-users':\n return {\n headerComponent: EngagementUsersHeader,\n tableStyle: styles.userTable\n };\n\n default:\n return {\n headerComponent: <></>,\n tableStyle: ''\n };\n }\n}\n\nexport type TableVariant = 'video-views' | 'interactives' | 'engagement-users';\n\ninterface PartialTableProps {\n variant?: TableVariant;\n className?: string;\n headerClassName?: string;\n}\n\nexport function PartialTable(props: React.PropsWithChildren<PartialTableProps>): JSX.Element {\n const { headerComponent, tableStyle } = getTableVariant(props.variant);\n\n return (\n <div className={`bg-white rounded ${tableStyle} ${props.className ?? ''}`}>\n <div className={`border-bottom ${styles.header} ${props.headerClassName ?? ''}`}>\n {headerComponent}\n </div>\n {props.children}\n </div>\n );\n}\n","import React from 'react';\nimport { Col, Row } from 'react-bootstrap';\n\nimport { TableVariant } from 'shared/components/partial-loading/PartialTable';\n\nimport styles from './partial-loading.module.scss';\n\nfunction VideoItem(): JSX.Element {\n return (\n <Row className={`py-1 ${styles.videoItemContainer}`}>\n <Col xs={1} className='d-flex align-items-center justify-content-center'>\n <div className={`partial-loading-background ${styles.partialNumber}`} />\n </Col>\n <Col xs={2} className='d-flex align-items-center'>\n <div className='d-block'>\n <div className={`partial-loading-background rounded ${styles.partialThumbnail}`} />\n </div>\n </Col>\n <Col xs={3} className='d-flex align-items-center'>\n <div className={`partial-loading-background ms-n2 ${styles.partialLongText}`} />\n </Col>\n <Col xs={2} className='d-flex align-items-center'>\n <div className={`d-block partial-loading-background mx-4 ${styles.partialShortText}`} />\n </Col>\n <Col xs={4} className='d-flex align-items-center'>\n <div className={`d-block partial-loading-background mx-4 ${styles.partialNumber}`} />\n </Col>\n </Row>\n );\n}\n\nfunction InteractiveItem(): JSX.Element {\n return (\n <Row className={`py-1 ${styles.interactiveItemContainer}`}>\n <Col xs={1} className='d-flex align-items-center justify-content-center'>\n <div className={`partial-loading-background ${styles.partialNumber}`} />\n </Col>\n <Col xs={2} className='d-flex align-items-center'>\n <div className='d-block'>\n <div className={`partial-loading-background rounded ${styles.partialThumbnail}`} />\n </div>\n </Col>\n <Col xs={2} className='d-flex align-items-center'>\n <div className={`partial-loading-background ms-n2 ${styles.partialMediumText}`} />\n </Col>\n <Col xs={2} className='d-flex align-items-center'>\n <div className={`d-block partial-loading-background mx-4 ${styles.partialAvatar}`} />\n </Col>\n <Col xs={2} className='d-flex align-items-center'>\n <div className={`d-block partial-loading-background mx-4 ${styles.partialMediumText}`} />\n </Col>\n <Col xs={3} className='d-flex align-items-center'>\n <div className={`d-block partial-loading-background mx-4 ${styles.partialNumber}`} />\n </Col>\n </Row>\n );\n}\n\nfunction EngagementUserItem(): JSX.Element {\n return (\n <Row className={`my-2 ${styles.userItemContainer}`}>\n <Col xs={2} className='d-flex align-items-center '>\n <div className={`partial-loading-background ms-3 ${styles.partialAvatar}`} />\n <div className={`partial-loading-background mx-2 ${styles.partialShortText}`} />\n </Col>\n <Col xs={2} className='d-flex justify-content-center align-items-center'>\n <div className={`d-block partial-loading-background ${styles.partialShortText}`} />\n </Col>\n <Col xs={2} className='d-flex justify-content-center align-items-center'>\n <div className={`partial-loading-background ${styles.partialShortText}`} />\n </Col>\n <Col xs={6} className='d-flex justify-content-between align-items-center'>\n <div className={`partial-loading-background ${styles.heatMapItemContainer} ${styles.partialHeatMap}`} />\n </Col>\n </Row>\n );\n}\n\nfunction getPartialItem(type: TableVariant, key: number): JSX.Element {\n switch (type) {\n case 'video-views':\n return <VideoItem key={key} />;\n\n case 'interactives':\n return <InteractiveItem key={key} />;\n\n case 'engagement-users':\n return <EngagementUserItem key={key} />;\n\n default:\n return <></>;\n }\n}\n\ninterface PartialTableContentProps {\n variant: TableVariant;\n itemCount?: number;\n}\n\nPartialTableContent.defaultProps = {\n itemCount: 7\n};\n\nexport function PartialTableContent(props: PartialTableContentProps): JSX.Element {\n return (\n <div className='my-1'>\n {Array(props.itemCount).fill(null).map((_, i) => getPartialItem(props.variant, i))}\n </div>\n );\n}\n","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { EmptyState } from 'libs/shared/components/empty-states/EmptyState';\n\nimport { ImageUrls } from 'shared/constants/ReportsImageUrls';\n\nconst namespace = 'reportsVideos.videoViewsTableEmptyState';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nexport function VideoViewsTableEmptyState(): JSX.Element {\n return (\n <EmptyState className='bg-white rounded justify-content-center py-5'>\n <EmptyState.Image\n src={ImageUrls.EmptyStates.Shared.ViewCount}\n className='w-25 h-auto'\n />\n <EmptyState.Heading>\n {getPhrase('heading')}\n </EmptyState.Heading>\n <EmptyState.Info>\n {getPhrase('description')}\n </EmptyState.Info>\n </EmptyState>\n );\n}\n",":local {\n .title,\n .thumbnail {\n min-width: 8rem;\n max-width: 10rem;\n margin-left: auto; \n margin-right: 0;\n }\n\n .seeOverview {\n display: none;\n }\n\n .row:hover {\n background-color: $light-blue;\n text-decoration: none;\n\n .seeOverview {\n display: flex;\n }\n }\n}","import React from 'react';\nimport { Row } from 'react-table';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Core } from 'libs/common/core';\n\nimport { FilterQueryParams } from 'libs/shared/apps/analytics/interfaces/FilterQueryParams';\nimport { Column, HeaderProps, Table, TableTheme } from 'libs/shared/components/table/Table';\nimport { VideoThumbnail } from 'libs/shared/components/thumbnails/video/VideoThumbnail';\nimport { VideoSubText } from 'libs/shared/components/video-sub-text/VideoSubText';\nimport { ImageSize } from 'libs/shared/enums/Images';\nimport { ThumbnailTextPosition } from 'libs/shared/enums/ThumbnailTextPosition';\nimport { VideoTypes } from 'libs/shared/interfaces';\nimport { VideoHelper } from 'libs/shared/utils/VideoHelper';\n\nimport { useGetAppLinkFilterParams } from 'shared/hooks/UseGetFilterQueryParams';\nimport { TopVideo } from 'shared/interfaces';\n\nimport styles from './video-views-table.module.scss';\n\nconst namespace = 'reportsVideos.videoViewsTable';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nconst theme: TableTheme = {\n table: 'bg-white rounded',\n header: 'border-bottom',\n headerCell: 'p-3',\n row: styles.row,\n cell: 'p-3'\n};\n\nexport const COLUMNS: Column<TopVideo>[] = [\n {\n Header: () => (\n <div className='d-flex justify-content-end'>\n #\n </div>\n ),\n accessor: 'object',\n id: 'index',\n Cell: ({ row: { index } }) => (\n <div className='d-flex align-items-center justify-content-end h-100'>\n {index + 1}\n </div>\n ),\n width: 5,\n disableSortBy: true\n },\n {\n Header: (props: HeaderProps<TopVideo>) => (\n <div className={styles.title}>\n <>{getPhrase('title')} {props.renderSortIndicator()}</>\n </div>\n ),\n accessor: 'object',\n id: 'image',\n Cell: ({ value }) => (\n <VideoThumbnail\n video={value}\n imageOptions={{ size: ImageSize.Small }}\n textPosition={ThumbnailTextPosition.Independent}\n type='cosmetic'\n hideMask\n extraClasses={styles.thumbnail}\n newDurationStyle\n size='sm'\n />\n ),\n width: 30,\n hideSortIndicator: true,\n sortType: (rowA: Row<TopVideo>, rowB: Row<TopVideo>) => {\n return rowA.original.object.name?.toLowerCase() > rowB.original.object.name?.toLowerCase() ? 1 : -1;\n }\n },\n {\n accessor: 'object',\n id: 'name',\n Cell: ({ value }) => (\n <div className='d-flex flex-column justify-content-center h-100'>\n {VideoHelper.isVideoType(value) && (\n <VideoSubText\n type='series'\n video={value}\n analyticsOptions={null}\n className='d-inline clamp-1'\n />\n )}\n <span className='text-truncate'>{value.name}</span>\n </div>\n ),\n width: 60,\n disableSortBy: true\n },\n {\n Header: () => <>{getPhrase('contentType')}</>,\n accessor: 'contentType',\n Cell: ({ value }) => (\n <div className='d-flex align-items-center h-100'>\n {value}\n </div>\n ),\n width: 30\n },\n {\n Header: () => <>{getPhrase('views')}</>,\n accessor: 'combinedCount',\n Cell: ({ value }) => (\n <div className='d-flex align-items-center h-100'>\n {value}\n </div>\n ),\n width: 30\n },\n {\n accessor: 'object',\n id: 'see-overview',\n Cell: () => (\n <div className={`${styles.seeOverview} align-items-center h-100 text-info`}>\n {getPhrase('seeAnalytics')}\n </div>\n ),\n width: 25,\n disableSortBy: true\n }\n];\n\ninterface VideoViewsByVideoTableProps {\n videos: TopVideo[];\n getVideoAppLink: (object: VideoTypes, filterQueryParams: FilterQueryParams) => Core.AppLink;\n}\n\nexport function VideoViewsTable(props: VideoViewsByVideoTableProps): JSX.Element {\n const filterQueryParams = useGetAppLinkFilterParams();\n\n function getRowAppLink(row: Row<TopVideo>): Core.AppLink {\n return props.getVideoAppLink(row.original.object, filterQueryParams);\n }\n\n return (\n <Table\n columns={COLUMNS}\n data={props.videos}\n theme={theme}\n getRowAppLink={getRowAppLink}\n enableSort\n />\n );\n}\n","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Flight } from 'libs/common/flight';\n\nimport { VideoRequests } from 'libs/shared/flight-requests/VideoRequests';\nimport { useBatchFetch } from 'libs/shared/hooks/UseBatchFetch';\nimport { useHandleObjectError } from 'libs/shared/hooks/UseHandleObjectError';\nimport { useSetPageMetadata } from 'libs/shared/hooks/useSetPageMetadata';\nimport { VideoTypes } from 'libs/shared/interfaces';\n\nimport { PartialTable } from 'shared/components/partial-loading/PartialTable';\nimport { PartialTableContent } from 'shared/components/partial-loading/PartialTableContent';\nimport { VideoViewsV2Requests } from 'shared/flight-requests/VideoViewsV2Requests';\nimport { useGetRequestFilter } from 'shared/hooks/UseGetFilterQueryParams';\nimport { useSetHeaderTitle } from 'shared/hooks/UseSetHeaderTitle';\nimport { TopVideo, TopVideoV2 } from 'shared/interfaces';\nimport { getSchoolVideoAppLink } from 'shared/utils/ReportsAppLinkUtils';\n\nimport { SchoolVideosNav } from 'apps/videos/components/school-videos-nav/SchoolVideosNav';\nimport { VideoViewsTableEmptyState } from 'apps/videos/components/video-views-table/video-views-table-empty-state/VideoViewsTableEmptyState';\nimport { VideoViewsTable } from 'apps/videos/components/video-views-table/VideoViewsTable';\n\nconst namespace = 'reportsVideos.schoolTopVideosView';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nconst LIMIT = 100;\n\nexport function SchoolTopVideosView(): JSX.Element {\n const requestFilter = useGetRequestFilter('video-views');\n\n const topStreams = Flight.useBasicFetch<TopVideoV2[]>(VideoViewsV2Requests.topStreams(LIMIT, requestFilter));\n\n const videos = useBatchFetch<VideoTypes>(\n topStreams.data?.map(v => v.objectId) ?? [],\n VideoRequests.videos\n );\n\n useHandleObjectError(topStreams);\n\n useSetPageMetadata({ title: getPhrase('videos') });\n useSetHeaderTitle(getPhrase('videos'));\n\n const hasLoaded = (\n topStreams.hasCompleted &&\n !videos.isFetching\n );\n\n const hasVideoViews = !!videos.itemsArr?.length;\n \n const mappedVideos = topStreams.data?.map<TopVideo>(topStream => {\n const video = videos.items?.[topStream?.objectId];\n\n if (!video)\n return null;\n\n return {\n count: topStream.count,\n object: video,\n contentType: topStream.contentType,\n combinedCount: topStream.combinedCount\n };\n }).filter(v => !!v);\n\n return (\n <div className='pb-3'>\n <SchoolVideosNav />\n {!hasLoaded &&\n <PartialTable variant='video-views'>\n <PartialTableContent variant='video-views' />\n </PartialTable>\n }\n {hasLoaded && hasVideoViews &&\n <VideoViewsTable videos={mappedVideos} getVideoAppLink={getSchoolVideoAppLink} />\n }\n {hasLoaded && !hasVideoViews && <VideoViewsTableEmptyState />}\n </div>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AW,MAAM,IAAI,GAAK,EAAE,SAAS,EAAI,EAAE,CAC3C,EAAc,OACf,CAED,EAAqB,EAAW,CAEhC,EAAmB,CAAE,MAAO,EAAU,SAAS,CAAE,CAAC,CAClD,EAAkB,EAAU,SAAS,CAAC,CAEtC,IAAM,EACJ,EAAW,cACX,CAAC,EAAO,WAGJ,EAAgB,CAAC,CAAC,EAAO,UAAU,OAEnC,EAAe,EAAW,MAAM,IAAc,GAAa,CAC/D,IAAM,EAAQ,EAAO,QAAQ,GAAW,UAKxC,OAHK,EAGE,CACL,MAAO,EAAU,MACjB,OAAQ,EACR,YAAa,EAAU,YACvB,cAAe,EAAU,cAC1B,CAPQ,MAQT,CAAC,OAAO,GAAK,CAAC,CAAC,EAAE,CAEnB,OACE,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,gBAAf,EACE,EAAA,EAAA,KAAC,EAAD,EAAmB,CAAA,CAClB,CAAC,IACA,EAAA,EAAA,KAAC,EAAD,CAAc,QAAQ,wBACpB,EAAA,EAAA,KAAC,EAAD,CAAqB,QAAQ,cAAgB,CAAA,CAChC,CAAA,CAEhB,GAAa,IACZ,EAAA,EAAA,KAAC,EAAD,CAAiB,OAAQ,EAAc,gBAAiB,EAAyB,CAAA,CAElF,GAAa,CAAC,IAAiB,EAAA,EAAA,KAAC,EAAD,EAA6B,CAAA,CACzD"}
1
+ {"version":3,"file":"OU_kRJz_.chunk.js","names":[],"sources":["../../../../../node_modules/react-bootstrap/esm/Row.js","../../src/shared/components/partial-loading/partial-loading.module.scss","../../src/shared/components/partial-loading/PartialTable.tsx","../../src/shared/components/partial-loading/PartialTableContent.tsx","../../src/apps/videos/components/video-views-table/video-views-table-empty-state/VideoViewsTableEmptyState.tsx","../../src/apps/videos/components/video-views-table/video-views-table.module.scss","../../src/apps/videos/components/video-views-table/VideoViewsTable.tsx","../../src/apps/videos/views/school-top-videos/SchoolTopVideosView.tsx"],"sourcesContent":["\"use client\";\n\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { useBootstrapPrefix, useBootstrapBreakpoints, useBootstrapMinBreakpoint } from './ThemeProvider';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst Row = /*#__PURE__*/React.forwardRef(({\n bsPrefix,\n className,\n // Need to define the default \"as\" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595\n as: Component = 'div',\n ...props\n}, ref) => {\n const decoratedBsPrefix = useBootstrapPrefix(bsPrefix, 'row');\n const breakpoints = useBootstrapBreakpoints();\n const minBreakpoint = useBootstrapMinBreakpoint();\n const sizePrefix = `${decoratedBsPrefix}-cols`;\n const classes = [];\n breakpoints.forEach(brkPoint => {\n const propValue = props[brkPoint];\n delete props[brkPoint];\n let cols;\n if (propValue != null && typeof propValue === 'object') {\n ({\n cols\n } = propValue);\n } else {\n cols = propValue;\n }\n const infix = brkPoint !== minBreakpoint ? `-${brkPoint}` : '';\n if (cols != null) classes.push(`${sizePrefix}${infix}-${cols}`);\n });\n return /*#__PURE__*/_jsx(Component, {\n ref: ref,\n ...props,\n className: classNames(className, decoratedBsPrefix, ...classes)\n });\n});\nRow.displayName = 'Row';\nexport default Row;",":local {\n // Table styles\n\n .videoTable {\n height: 62rem;\n }\n\n .interactiveTable {\n height: 57rem;\n }\n\n .userTable {\n height: 14rem;\n }\n\n .header {\n height: 3.825rem\n }\n\n .itemHeader {\n height: 3.825rem\n }\n\n // Item styles\n\n .videoItemContainer {\n height: 8.125rem;\n }\n\n .interactiveItemContainer {\n height: 7.375rem;\n }\n\n .userItemContainer {\n height: 2.5625rem;\n }\n\n .heatMapItemContainer {\n margin-left: 6rem;\n }\n\n .partialAvatar {\n width: $avatar-width;\n height: $avatar-width;\n border-radius: 50%;\n }\n\n .partialNumber {\n width: 2rem;\n height: 1.1rem;\n }\n\n .partialLongText {\n width: 16rem;\n height: 1.1rem;\n }\n\n .partialMediumText {\n width: 10rem;\n height: 1.1rem;\n }\n\n .partialShortText {\n width: 5rem;\n height: 1.1rem;\n }\n\n .partialThumbnail {\n width: 10rem;\n padding-bottom: 56.25%;\n }\n\n .partialHeatMap {\n width: 34rem;\n height: 1.1rem;\n }\n}","import React from 'react';\nimport { Col, Row } from 'react-bootstrap';\n\nimport styles from './partial-loading.module.scss';\n\nconst VideoViewsHeader = (\n <Row className='py-3'>\n <Col xs={1} className='d-flex align-items-center justify-content-center'>\n <div className={`partial-loading-background ${styles.partialNumber}`} />\n </Col>\n <Col xs={5} className='d-flex align-items-center'>\n <div className={`partial-loading-background ${styles.partialShortText}`} />\n </Col>\n <Col xs={2} className='d-flex align-items-center' >\n <div className={`d-block partial-loading-background mx-4 ${styles.partialShortText}`} />\n </Col>\n <Col xs={4} className='d-flex align-items-center'>\n <div className={`d-block partial-loading-background mx-4 ${styles.partialShortText}`} />\n </Col>\n </Row>\n);\n\nconst InteractivesHeader = (\n <Row className='py-3'>\n <Col xs={5} className='d-flex align-items-center'>\n <div className={`partial-loading-background mx-4 ${styles.partialShortText}`} />\n </Col>\n <Col xs={2} className='d-flex align-items-center' >\n <div className={`d-block partial-loading-background mx-4 ${styles.partialShortText}`} />\n </Col>\n <Col xs={2} className='d-flex align-items-center'>\n <div className={`d-block partial-loading-background mx-4 ${styles.partialShortText}`} />\n </Col>\n <Col xs={3} className='d-flex align-items-center'>\n <div className={`d-block partial-loading-background mx-4 ${styles.partialShortText}`} />\n </Col>\n </Row>\n);\n\nconst EngagementUsersHeader = (\n <Row className='py-3'>\n <Col xs={2} className='d-flex'>\n <div className={`partial-loading-background mx-3 ${styles.partialShortText}`} />\n </Col>\n <Col xs={2} className='d-flex justify-content-center'>\n <div className={`partial-loading-background mx-2 ${styles.partialShortText}`} />\n </Col>\n <Col xs={2} className='d-flex justify-content-center'>\n <div className={`partial-loading-background ${styles.partialShortText}`} />\n </Col>\n <Col xs={6} className='d-flex justify-content-between'>\n <div className={`d-block partial-loading-background ${styles.heatMapItemContainer} ${styles.partialShortText}`} />\n </Col>\n </Row>\n);\n\nfunction getTableVariant(type: TableVariant) {\n switch (type) {\n case 'video-views':\n return {\n headerComponent: VideoViewsHeader,\n tableStyle: styles.videoTable\n };\n\n case 'interactives':\n return {\n headerComponent: InteractivesHeader,\n tableStyle: styles.interactiveTable\n };\n\n case 'engagement-users':\n return {\n headerComponent: EngagementUsersHeader,\n tableStyle: styles.userTable\n };\n\n default:\n return {\n headerComponent: <></>,\n tableStyle: ''\n };\n }\n}\n\nexport type TableVariant = 'video-views' | 'interactives' | 'engagement-users';\n\ninterface PartialTableProps {\n variant?: TableVariant;\n className?: string;\n headerClassName?: string;\n}\n\nexport function PartialTable(props: React.PropsWithChildren<PartialTableProps>): JSX.Element {\n const { headerComponent, tableStyle } = getTableVariant(props.variant);\n\n return (\n <div className={`bg-white rounded ${tableStyle} ${props.className ?? ''}`}>\n <div className={`border-bottom ${styles.header} ${props.headerClassName ?? ''}`}>\n {headerComponent}\n </div>\n {props.children}\n </div>\n );\n}\n","import React from 'react';\nimport { Col, Row } from 'react-bootstrap';\n\nimport { TableVariant } from 'shared/components/partial-loading/PartialTable';\n\nimport styles from './partial-loading.module.scss';\n\nfunction VideoItem(): JSX.Element {\n return (\n <Row className={`py-1 ${styles.videoItemContainer}`}>\n <Col xs={1} className='d-flex align-items-center justify-content-center'>\n <div className={`partial-loading-background ${styles.partialNumber}`} />\n </Col>\n <Col xs={2} className='d-flex align-items-center'>\n <div className='d-block'>\n <div className={`partial-loading-background rounded ${styles.partialThumbnail}`} />\n </div>\n </Col>\n <Col xs={3} className='d-flex align-items-center'>\n <div className={`partial-loading-background ms-n2 ${styles.partialLongText}`} />\n </Col>\n <Col xs={2} className='d-flex align-items-center'>\n <div className={`d-block partial-loading-background mx-4 ${styles.partialShortText}`} />\n </Col>\n <Col xs={4} className='d-flex align-items-center'>\n <div className={`d-block partial-loading-background mx-4 ${styles.partialNumber}`} />\n </Col>\n </Row>\n );\n}\n\nfunction InteractiveItem(): JSX.Element {\n return (\n <Row className={`py-1 ${styles.interactiveItemContainer}`}>\n <Col xs={1} className='d-flex align-items-center justify-content-center'>\n <div className={`partial-loading-background ${styles.partialNumber}`} />\n </Col>\n <Col xs={2} className='d-flex align-items-center'>\n <div className='d-block'>\n <div className={`partial-loading-background rounded ${styles.partialThumbnail}`} />\n </div>\n </Col>\n <Col xs={2} className='d-flex align-items-center'>\n <div className={`partial-loading-background ms-n2 ${styles.partialMediumText}`} />\n </Col>\n <Col xs={2} className='d-flex align-items-center'>\n <div className={`d-block partial-loading-background mx-4 ${styles.partialAvatar}`} />\n </Col>\n <Col xs={2} className='d-flex align-items-center'>\n <div className={`d-block partial-loading-background mx-4 ${styles.partialMediumText}`} />\n </Col>\n <Col xs={3} className='d-flex align-items-center'>\n <div className={`d-block partial-loading-background mx-4 ${styles.partialNumber}`} />\n </Col>\n </Row>\n );\n}\n\nfunction EngagementUserItem(): JSX.Element {\n return (\n <Row className={`my-2 ${styles.userItemContainer}`}>\n <Col xs={2} className='d-flex align-items-center '>\n <div className={`partial-loading-background ms-3 ${styles.partialAvatar}`} />\n <div className={`partial-loading-background mx-2 ${styles.partialShortText}`} />\n </Col>\n <Col xs={2} className='d-flex justify-content-center align-items-center'>\n <div className={`d-block partial-loading-background ${styles.partialShortText}`} />\n </Col>\n <Col xs={2} className='d-flex justify-content-center align-items-center'>\n <div className={`partial-loading-background ${styles.partialShortText}`} />\n </Col>\n <Col xs={6} className='d-flex justify-content-between align-items-center'>\n <div className={`partial-loading-background ${styles.heatMapItemContainer} ${styles.partialHeatMap}`} />\n </Col>\n </Row>\n );\n}\n\nfunction getPartialItem(type: TableVariant, key: number): JSX.Element {\n switch (type) {\n case 'video-views':\n return <VideoItem key={key} />;\n\n case 'interactives':\n return <InteractiveItem key={key} />;\n\n case 'engagement-users':\n return <EngagementUserItem key={key} />;\n\n default:\n return <></>;\n }\n}\n\ninterface PartialTableContentProps {\n variant: TableVariant;\n itemCount?: number;\n}\n\nPartialTableContent.defaultProps = {\n itemCount: 7\n};\n\nexport function PartialTableContent(props: PartialTableContentProps): JSX.Element {\n return (\n <div className='my-1'>\n {Array(props.itemCount).fill(null).map((_, i) => getPartialItem(props.variant, i))}\n </div>\n );\n}\n","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { EmptyState } from 'libs/shared/components/empty-states/EmptyState';\n\nimport { ImageUrls } from 'shared/constants/ReportsImageUrls';\n\nconst namespace = 'reportsVideos.videoViewsTableEmptyState';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nexport function VideoViewsTableEmptyState(): JSX.Element {\n return (\n <EmptyState className='bg-white rounded justify-content-center py-5'>\n <EmptyState.Image\n src={ImageUrls.EmptyStates.Shared.ViewCount}\n className='w-25 h-auto'\n />\n <EmptyState.Heading>\n {getPhrase('heading')}\n </EmptyState.Heading>\n <EmptyState.Info>\n {getPhrase('description')}\n </EmptyState.Info>\n </EmptyState>\n );\n}\n",":local {\n .title,\n .thumbnail {\n min-width: 8rem;\n max-width: 10rem;\n margin-left: auto; \n margin-right: 0;\n }\n\n .seeOverview {\n display: none;\n }\n\n .row:hover {\n background-color: $light-blue;\n text-decoration: none;\n\n .seeOverview {\n display: flex;\n }\n }\n}","import React from 'react';\nimport { Row } from 'react-table';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Core } from 'libs/common/core';\n\nimport { FilterQueryParams } from 'libs/shared/apps/analytics/interfaces/FilterQueryParams';\nimport { Column, HeaderProps, Table, TableTheme } from 'libs/shared/components/table/Table';\nimport { VideoThumbnail } from 'libs/shared/components/thumbnails/video/VideoThumbnail';\nimport { VideoSubText } from 'libs/shared/components/video-sub-text/VideoSubText';\nimport { ImageSize } from 'libs/shared/enums/Images';\nimport { ThumbnailTextPosition } from 'libs/shared/enums/ThumbnailTextPosition';\nimport { VideoTypes } from 'libs/shared/interfaces';\nimport { VideoHelper } from 'libs/shared/utils/VideoHelper';\n\nimport { useGetAppLinkFilterParams } from 'shared/hooks/UseGetFilterQueryParams';\nimport { TopVideo } from 'shared/interfaces';\n\nimport styles from './video-views-table.module.scss';\n\nconst namespace = 'reportsVideos.videoViewsTable';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nconst theme: TableTheme = {\n table: 'bg-white rounded',\n header: 'border-bottom',\n headerCell: 'p-3',\n row: styles.row,\n cell: 'p-3'\n};\n\nexport const COLUMNS: Column<TopVideo>[] = [\n {\n Header: () => (\n <div className='d-flex justify-content-end'>\n #\n </div>\n ),\n accessor: 'object',\n id: 'index',\n Cell: ({ row: { index } }) => (\n <div className='d-flex align-items-center justify-content-end h-100'>\n {index + 1}\n </div>\n ),\n width: 5,\n disableSortBy: true\n },\n {\n Header: (props: HeaderProps<TopVideo>) => (\n <div className={styles.title}>\n <>{getPhrase('title')} {props.renderSortIndicator()}</>\n </div>\n ),\n accessor: 'object',\n id: 'image',\n Cell: ({ value }) => (\n <VideoThumbnail\n video={value}\n imageOptions={{ size: ImageSize.Small }}\n textPosition={ThumbnailTextPosition.Independent}\n type='cosmetic'\n hideMask\n extraClasses={styles.thumbnail}\n newDurationStyle\n size='sm'\n />\n ),\n width: 30,\n hideSortIndicator: true,\n sortType: (rowA: Row<TopVideo>, rowB: Row<TopVideo>) => {\n return rowA.original.object.name?.toLowerCase() > rowB.original.object.name?.toLowerCase() ? 1 : -1;\n }\n },\n {\n accessor: 'object',\n id: 'name',\n Cell: ({ value }) => (\n <div className='d-flex flex-column justify-content-center h-100'>\n {VideoHelper.isVideoType(value) && (\n <VideoSubText\n type='series'\n video={value}\n analyticsOptions={null}\n className='d-inline clamp-1'\n />\n )}\n <span className='text-truncate'>{value.name}</span>\n </div>\n ),\n width: 60,\n disableSortBy: true\n },\n {\n Header: () => <>{getPhrase('contentType')}</>,\n accessor: 'contentType',\n Cell: ({ value }) => (\n <div className='d-flex align-items-center h-100'>\n {value}\n </div>\n ),\n width: 30\n },\n {\n Header: () => <>{getPhrase('views')}</>,\n accessor: 'combinedCount',\n Cell: ({ value }) => (\n <div className='d-flex align-items-center h-100'>\n {value}\n </div>\n ),\n width: 30\n },\n {\n accessor: 'object',\n id: 'see-overview',\n Cell: () => (\n <div className={`${styles.seeOverview} align-items-center h-100 text-info`}>\n {getPhrase('seeAnalytics')}\n </div>\n ),\n width: 25,\n disableSortBy: true\n }\n];\n\ninterface VideoViewsByVideoTableProps {\n videos: TopVideo[];\n getVideoAppLink: (object: VideoTypes, filterQueryParams: FilterQueryParams) => Core.AppLink;\n}\n\nexport function VideoViewsTable(props: VideoViewsByVideoTableProps): JSX.Element {\n const filterQueryParams = useGetAppLinkFilterParams();\n\n function getRowAppLink(row: Row<TopVideo>): Core.AppLink {\n return props.getVideoAppLink(row.original.object, filterQueryParams);\n }\n\n return (\n <Table\n columns={COLUMNS}\n data={props.videos}\n theme={theme}\n getRowAppLink={getRowAppLink}\n enableSort\n />\n );\n}\n","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Flight } from 'libs/common/flight';\n\nimport { VideoRequests } from 'libs/shared/flight-requests/VideoRequests';\nimport { useBatchFetch } from 'libs/shared/hooks/UseBatchFetch';\nimport { useHandleObjectError } from 'libs/shared/hooks/UseHandleObjectError';\nimport { useSetPageMetadata } from 'libs/shared/hooks/useSetPageMetadata';\nimport { VideoTypes } from 'libs/shared/interfaces';\n\nimport { PartialTable } from 'shared/components/partial-loading/PartialTable';\nimport { PartialTableContent } from 'shared/components/partial-loading/PartialTableContent';\nimport { VideoViewsV2Requests } from 'shared/flight-requests/VideoViewsV2Requests';\nimport { useGetRequestFilter } from 'shared/hooks/UseGetFilterQueryParams';\nimport { useSetHeaderTitle } from 'shared/hooks/UseSetHeaderTitle';\nimport { TopVideo, TopVideoV2 } from 'shared/interfaces';\nimport { getSchoolVideoAppLink } from 'shared/utils/ReportsAppLinkUtils';\n\nimport { SchoolVideosNav } from 'apps/videos/components/school-videos-nav/SchoolVideosNav';\nimport { VideoViewsTableEmptyState } from 'apps/videos/components/video-views-table/video-views-table-empty-state/VideoViewsTableEmptyState';\nimport { VideoViewsTable } from 'apps/videos/components/video-views-table/VideoViewsTable';\n\nconst namespace = 'reportsVideos.schoolTopVideosView';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nconst LIMIT = 100;\n\nexport function SchoolTopVideosView(): JSX.Element {\n const requestFilter = useGetRequestFilter('video-views');\n\n const topStreams = Flight.useBasicFetch<TopVideoV2[]>(VideoViewsV2Requests.topStreams(LIMIT, requestFilter));\n\n const videos = useBatchFetch<VideoTypes>(\n topStreams.data?.map(v => v.objectId) ?? [],\n VideoRequests.videos\n );\n\n useHandleObjectError(topStreams);\n\n useSetPageMetadata({ title: getPhrase('videos') });\n useSetHeaderTitle(getPhrase('videos'));\n\n const hasLoaded = (\n topStreams.hasCompleted &&\n !videos.isFetching\n );\n\n const hasVideoViews = !!videos.itemsArr?.length;\n \n const mappedVideos = topStreams.data?.map<TopVideo>(topStream => {\n const video = videos.items?.[topStream?.objectId];\n\n if (!video)\n return null;\n\n return {\n count: topStream.count,\n object: video,\n contentType: topStream.contentType,\n combinedCount: topStream.combinedCount\n };\n }).filter(v => !!v);\n\n return (\n <div className='pb-3'>\n <SchoolVideosNav />\n {!hasLoaded &&\n <PartialTable variant='video-views'>\n <PartialTableContent variant='video-views' />\n </PartialTable>\n }\n {hasLoaded && hasVideoViews &&\n <VideoViewsTable videos={mappedVideos} getVideoAppLink={getSchoolVideoAppLink} />\n }\n {hasLoaded && !hasVideoViews && <VideoViewsTableEmptyState />}\n </div>\n );\n}\n"],"x_google_ignoreList":[0],"mappings":"mtBAMM,EAAmB,EAAM,YAAY,CACzC,WACA,YAEA,GAAI,EAAY,MAChB,GAAG,GACF,IAAQ,CACT,IAAM,EAAoB,EAAmB,EAAU,MAAM,CACvD,EAAc,GAAyB,CACvC,EAAgB,GAA2B,CAC3C,EAAa,GAAG,EAAkB,OAClC,EAAU,EAAE,CAelB,OAdA,EAAY,QAAQ,GAAY,CAC9B,IAAM,EAAY,EAAM,GACxB,OAAO,EAAM,GACb,IAAI,EACqB,OAAO,GAAc,UAA1C,E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,EAAU,MACjB,OAAQ,EACR,YAAa,EAAU,YACvB,cAAe,EAAU,cAC1B,CAPQ,MAQT,CAAC,OAAO,GAAK,CAAC,CAAC,EAAE,CAEnB,OACE,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,gBAAf,EACE,EAAA,EAAA,KAAC,EAAD,EAAmB,CAAA,CAClB,CAAC,IACA,EAAA,EAAA,KAAC,EAAD,CAAc,QAAQ,wBACpB,EAAA,EAAA,KAAC,EAAD,CAAqB,QAAQ,cAAgB,CAAA,CAChC,CAAA,CAEhB,GAAa,IACZ,EAAA,EAAA,KAAC,EAAD,CAAiB,OAAQ,EAAc,gBAAiB,EAAyB,CAAA,CAElF,GAAa,CAAC,IAAiB,EAAA,EAAA,KAAC,EAAD,EAA6B,CAAA,CACzD"}
@@ -1,2 +1,2 @@
1
- import{Jn as e,P as t,st as n}from"./CM0wW4AE.chunk.js";import{r}from"./B01-hGyk.chunk.js";import{n as i}from"./KyOyA3o8.chunk.js";import{t as a}from"./I5Dnl_eN.chunk.js";import{n as o,r as s}from"./H5KLIhR_.chunk.js";import{n as c}from"./dSmIXyxJ.chunk.js";import{$ as l,F as u,M as d}from"./app-BigOHyYp.js";import{m as f}from"./CCLDpjnt2.chunk.js";import{t as p}from"./CqCz1X85.chunk.js";var m=e(n());function h(e){let[,t]=i(d.HEADER_ACTIONS);(0,m.useEffect)(()=>(t(e),()=>{t(null)}),[!!e])}var g=t(),_=a.encloseNamespace(`reportsShared.anonymiseAction`);function v(){let[e,t]=i(d.ANONYMISE_USERS,!1);return(0,g.jsxs)(`div`,{className:`d-flex align-items center justify-content-between`,onClick:()=>t(!e),children:[(0,g.jsx)(`span`,{className:`me-3`,children:_(`hideNames`)}),(0,g.jsx)(c,{on:e,onClick:()=>{}})]})}var y=a.encloseNamespace(`reportsShared.utils`);function b(e){let t=f(l.getPrimaryObjectUrl);if(!e)return;let n=[];return t&&n.push({label:()=>(0,g.jsxs)(`span`,{className:`d-flex justify-content-between align-items-center`,children:[(0,g.jsx)(`span`,{className:`me-2`,children:y(`seeVideo`)}),(0,g.jsx)(r,{svg:u})]}),href:t(e),openInNewTab:!0}),n.push({label:()=>(0,g.jsx)(v,{})}),n}function x(){return[{label:y(`generateReport`),appLink:{application:s.DEFAULT,action:o.Default.GENERATE_REPORT,params:{type:p.VideoViews}}}]}function S(){return[{label:y(`generateReport`),appLink:{application:s.DEFAULT,action:o.Default.GENERATE_REPORT,params:{type:p.Logins}}}]}export{h as i,x as n,b as r,S as t};
2
- //# sourceMappingURL=n2iCrpxU.chunk.js.map
1
+ import{Jn as e,P as t,st as n}from"./CM0wW4AE.chunk.js";import{r}from"./B01-hGyk.chunk.js";import{n as i}from"./KyOyA3o8.chunk.js";import{t as a}from"./I5Dnl_eN.chunk.js";import{n as o,r as s}from"./H5KLIhR_.chunk.js";import{n as c}from"./dSmIXyxJ.chunk.js";import{$ as l,F as u,M as d}from"./app-m6P7KXE1.js";import{m as f}from"./XgwoBT6z2.chunk.js";import{t as p}from"./PZOjj17O.chunk.js";var m=e(n());function h(e){let[,t]=i(d.HEADER_ACTIONS);(0,m.useEffect)(()=>(t(e),()=>{t(null)}),[!!e])}var g=t(),_=a.encloseNamespace(`reportsShared.anonymiseAction`);function v(){let[e,t]=i(d.ANONYMISE_USERS,!1);return(0,g.jsxs)(`div`,{className:`d-flex align-items center justify-content-between`,onClick:()=>t(!e),children:[(0,g.jsx)(`span`,{className:`me-3`,children:_(`hideNames`)}),(0,g.jsx)(c,{on:e,onClick:()=>{}})]})}var y=a.encloseNamespace(`reportsShared.utils`);function b(e){let t=f(l.getPrimaryObjectUrl);if(!e)return;let n=[];return t&&n.push({label:()=>(0,g.jsxs)(`span`,{className:`d-flex justify-content-between align-items-center`,children:[(0,g.jsx)(`span`,{className:`me-2`,children:y(`seeVideo`)}),(0,g.jsx)(r,{svg:u})]}),href:t(e),openInNewTab:!0}),n.push({label:()=>(0,g.jsx)(v,{})}),n}function x(){return[{label:y(`generateReport`),appLink:{application:s.DEFAULT,action:o.Default.GENERATE_REPORT,params:{type:p.VideoViews}}}]}function S(){return[{label:y(`generateReport`),appLink:{application:s.DEFAULT,action:o.Default.GENERATE_REPORT,params:{type:p.Logins}}}]}export{h as i,x as n,b as r,S as t};
2
+ //# sourceMappingURL=P4zTQoDZ.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"n2iCrpxU.chunk.js","names":[],"sources":["../../src/shared/hooks/UseSetHeaderActions.ts","../../src/shared/components/anonymise-action/AnonymiseAction.tsx","../../src/shared/utils/HeaderActionUtils.tsx"],"sourcesContent":["import { useEffect } from 'react';\n\nimport { useViewModel } from 'libs/common/react/hooks/UseViewModel';\n\nimport { DropdownActionOptions } from 'libs/shared/components/actions/ActionsDropdown';\n\nimport { ViewModelKeys } from 'shared/constants/ReportsViewModels';\n\n/**\n * This hook will only set the actions on the initial render.\n * If the actions are dynamic, either this hook will need to be updated\n * or useViewModel used directly.\n */\nexport function useSetHeaderActions(actions?: DropdownActionOptions[]): void {\n const [ , setActions ] = useViewModel<DropdownActionOptions[]>(ViewModelKeys.HEADER_ACTIONS);\n\n useEffect(() => {\n setActions(actions);\n\n return () => {\n setActions(null);\n };\n }, [!!actions]);\n}\n","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { useViewModel } from 'libs/common/react/hooks/UseViewModel';\n\nimport { ToggleSwitch } from 'libs/shared/components/toggle-switch/ToggleSwitch';\n\nimport { ViewModelKeys } from 'shared/constants/ReportsViewModels';\n\nconst namespace = 'reportsShared.anonymiseAction';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nexport function AnonymiseAction(): JSX.Element {\n const [ anonymiseUsers, setAnonymiseUsers ] = useViewModel<boolean>(ViewModelKeys.ANONYMISE_USERS, false);\n\n return (\n <div\n className='d-flex align-items center justify-content-between'\n onClick={() => setAnonymiseUsers(!anonymiseUsers)}\n >\n <span className='me-3'>\n {getPhrase('hideNames')}\n </span>\n <ToggleSwitch on={anonymiseUsers} onClick={() => {}} />\n </div>\n );\n}\n","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { DropdownActionOptions } from 'libs/shared/components/actions/ActionsDropdown';\nimport { SvgContainer } from 'libs/shared/components/svg-container/SvgContainer';\nimport { useGetExternalUrl } from 'libs/shared/hooks/UseGetExternalUrl';\nimport { NewWindowSvg } from 'libs/shared/images/svg/actions/NewWindowSvg';\nimport { BaseObject } from 'libs/shared/interfaces';\n\nimport { AnonymiseAction } from 'shared/components/anonymise-action/AnonymiseAction';\nimport { Actions } from 'shared/constants/ReportsActions';\nimport { AppChannels } from 'shared/constants/ReportsRadioChannels';\nimport { GenerateReportType } from 'shared/views/generate-report/GenerateReportView';\n\nimport { ExternalRouteHelper } from './ExternalRouteHelper';\n\nconst namespace = 'reportsShared.utils';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nexport function useGetObjectHeaderActions(object?: BaseObject): DropdownActionOptions[] {\n const getObjectUrl = useGetExternalUrl(ExternalRouteHelper.getPrimaryObjectUrl);\n if (!object)\n return;\n\n const actions: DropdownActionOptions[] = [];\n\n if (getObjectUrl)\n actions.push({\n label: () => (\n <span\n className='d-flex justify-content-between align-items-center'\n >\n <span className='me-2'>\n {/* // TODO: once we have non-video types this will need to be updated. */}\n {getPhrase('seeVideo')}\n </span>\n <SvgContainer svg={NewWindowSvg} />\n </span>\n ),\n href: getObjectUrl(object),\n openInNewTab: true\n });\n\n actions.push({\n label: () => <AnonymiseAction />\n });\n\n return actions;\n}\n\nexport function getVideoHeaderActions(): DropdownActionOptions[] {\n return [{\n label: getPhrase('generateReport'),\n appLink: {\n application: AppChannels.DEFAULT,\n action: Actions.Default.GENERATE_REPORT,\n params: { type: GenerateReportType.VideoViews }\n }\n }];\n}\n\nexport function getLoginHeaderActions(): DropdownActionOptions[] {\n return [{\n label: getPhrase('generateReport'),\n appLink: {\n application: AppChannels.DEFAULT,\n action: Actions.Default.GENERATE_REPORT,\n params: { type: GenerateReportType.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F,CAAC,CAGJ,SAAgB,GAAiD,CAC/D,MAAO,CAAC,CACN,MAAO,EAAU,iBAAiB,CAClC,QAAS,CACP,YAAa,EAAY,QACzB,OAAQ,EAAQ,QAAQ,gBACxB,OAAQ,CAAE,KAAM,EAAmB,OAAQ,CAC5C,CACF,CAAC"}
1
+ {"version":3,"file":"P4zTQoDZ.chunk.js","names":[],"sources":["../../src/shared/hooks/UseSetHeaderActions.ts","../../src/shared/components/anonymise-action/AnonymiseAction.tsx","../../src/shared/utils/HeaderActionUtils.tsx"],"sourcesContent":["import { useEffect } from 'react';\n\nimport { useViewModel } from 'libs/common/react/hooks/UseViewModel';\n\nimport { DropdownActionOptions } from 'libs/shared/components/actions/ActionsDropdown';\n\nimport { ViewModelKeys } from 'shared/constants/ReportsViewModels';\n\n/**\n * This hook will only set the actions on the initial render.\n * If the actions are dynamic, either this hook will need to be updated\n * or useViewModel used directly.\n */\nexport function useSetHeaderActions(actions?: DropdownActionOptions[]): void {\n const [ , setActions ] = useViewModel<DropdownActionOptions[]>(ViewModelKeys.HEADER_ACTIONS);\n\n useEffect(() => {\n setActions(actions);\n\n return () => {\n setActions(null);\n };\n }, [!!actions]);\n}\n","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { useViewModel } from 'libs/common/react/hooks/UseViewModel';\n\nimport { ToggleSwitch } from 'libs/shared/components/toggle-switch/ToggleSwitch';\n\nimport { ViewModelKeys } from 'shared/constants/ReportsViewModels';\n\nconst namespace = 'reportsShared.anonymiseAction';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nexport function AnonymiseAction(): JSX.Element {\n const [ anonymiseUsers, setAnonymiseUsers ] = useViewModel<boolean>(ViewModelKeys.ANONYMISE_USERS, false);\n\n return (\n <div\n className='d-flex align-items center justify-content-between'\n onClick={() => setAnonymiseUsers(!anonymiseUsers)}\n >\n <span className='me-3'>\n {getPhrase('hideNames')}\n </span>\n <ToggleSwitch on={anonymiseUsers} onClick={() => {}} />\n </div>\n );\n}\n","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { DropdownActionOptions } from 'libs/shared/components/actions/ActionsDropdown';\nimport { SvgContainer } from 'libs/shared/components/svg-container/SvgContainer';\nimport { useGetExternalUrl } from 'libs/shared/hooks/UseGetExternalUrl';\nimport { NewWindowSvg } from 'libs/shared/images/svg/actions/NewWindowSvg';\nimport { BaseObject } from 'libs/shared/interfaces';\n\nimport { AnonymiseAction } from 'shared/components/anonymise-action/AnonymiseAction';\nimport { Actions } from 'shared/constants/ReportsActions';\nimport { AppChannels } from 'shared/constants/ReportsRadioChannels';\nimport { GenerateReportType } from 'shared/views/generate-report/GenerateReportView';\n\nimport { ExternalRouteHelper } from './ExternalRouteHelper';\n\nconst namespace = 'reportsShared.utils';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nexport function useGetObjectHeaderActions(object?: BaseObject): DropdownActionOptions[] {\n const getObjectUrl = useGetExternalUrl(ExternalRouteHelper.getPrimaryObjectUrl);\n if (!object)\n return;\n\n const actions: DropdownActionOptions[] = [];\n\n if (getObjectUrl)\n actions.push({\n label: () => (\n <span\n className='d-flex justify-content-between align-items-center'\n >\n <span className='me-2'>\n {/* // TODO: once we have non-video types this will need to be updated. */}\n {getPhrase('seeVideo')}\n </span>\n <SvgContainer svg={NewWindowSvg} />\n </span>\n ),\n href: getObjectUrl(object),\n openInNewTab: true\n });\n\n actions.push({\n label: () => <AnonymiseAction />\n });\n\n return actions;\n}\n\nexport function getVideoHeaderActions(): DropdownActionOptions[] {\n return [{\n label: getPhrase('generateReport'),\n appLink: {\n application: AppChannels.DEFAULT,\n action: Actions.Default.GENERATE_REPORT,\n params: { type: GenerateReportType.VideoViews }\n }\n }];\n}\n\nexport function getLoginHeaderActions(): DropdownActionOptions[] {\n return [{\n label: getPhrase('generateReport'),\n appLink: {\n application: AppChannels.DEFAULT,\n action: Actions.Default.GENERATE_REPORT,\n params: { type: GenerateReportType.Logins }\n }\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AGJ,SAAgB,GAAiD,CAC/D,MAAO,CAAC,CACN,MAAO,EAAU,iBAAiB,CAClC,QAAS,CACP,YAAa,EAAY,QACzB,OAAQ,EAAQ,QAAQ,gBACxB,OAAQ,CAAE,KAAM,EAAmB,OAAQ,CAC5C,CACF,CAAC"}
@@ -1,2 +1,2 @@
1
- import{P as e,Zt as t,st as n}from"./CM0wW4AE.chunk.js";import{i as r}from"./S6AM6CLE.chunk.js";import{b as i,d as a,n as o,p as s,t as c}from"./dUFTODMz.chunk.js";import{t as l}from"./CjM_tQvd.chunk.js";import{n as u}from"./CNQKHXPY.chunk.js";import{t as d}from"./I5Dnl_eN.chunk.js";import{t as f}from"./CO7H3BC5.chunk.js";import{t as p}from"./DGCz68te.chunk.js";import{t as m}from"./CnyxksnC.chunk.js";import{t as h}from"./dSmIXyxJ.chunk.js";import{at as g,r as _,tt as v}from"./app-BigOHyYp.js";import{t as y}from"./C1BFkCSD2.chunk.js";var b=`shared.verifiedEmailError`,x=class extends p{constructor(e,t,n){super(`VerifiedEmailRequiredError`),this.message=e,this.liteUrl=t,this.hasLite=n}get name(){return`VerifiedEmailRequiredError`}get dialogOptions(){let e=u.safeUrlConcat(this.liteUrl,`settings/account`);return{title:d.getPhrase(b,`heading`),text:this.hasLite?`${this.message} ${d.getPhrase(b,`visitSettings`,{href:e})}`:this.message,buttons:[{text:d.getPhrase(b,`close`),className:`btn btn-dark`,success:!0}]}}},S=()=>{let e=a(a(r.currentUser()).data?.isAuthenticated&&v.userProducts()),t=!e.hasCompleted;return{hasProduct:n=>t||e.hasError||!e.data?.length?!1:e.data.some(e=>e.id===n),products:e,isLoadingProducts:t}};function C(){let e=y(),{hasProduct:n,isLoadingProducts:r}=S(),i=a(g.config());function o(r,a,o){if(!r.responseJSON||r.responseJSON?.type!==`no-email`){e.error(a);return}t.throw(new x(o,i.data.liteUrl,n(f.Primary)))}return{handleGenerateReportError:o,loading:!i.hasCompleted||r}}function w(e){return{dateRange:{start:e.start,end:e.end},offsetInMin:Math.abs(new Date().getTimezoneOffset())}}var T={videoViewsReport(e,t){return{url:`{gateway}/v1/analytics/video-views/reports`,key:`video:views:report`,type:i.POST,data:{...w(e),version:t},invalidationKeys:`export`,normalize:!1}},loginsReport(e,t,n,r){return{url:`{gateway}/v1/analytics/logins/reports`,key:`logins:report`,data:w(e),type:i.POST,normalize:!1,success:t,error:n,always:r}}};n();var E=e(),D=`reportsShared.generateReport`,O=d.encloseNamespace(D);function k(e){switch(e){case j.Logins:return`loginsDescription`;case j.VideoViews:return`videosDescription`;default:return``}}function A(e){let t=l.convertUTCToLocal(e).toString();return l.format(t,`Do MMMM YYYY`)}var j=function(e){return e[e.Logins=0]=`Logins`,e[e.VideoViews=1]=`VideoViews`,e}({});function M(e){let t=_(`video-views`),n=_(`logins`),r=e.type===j.VideoViews?t:n,i=y(),{loading:a,handleGenerateReportError:l}=C(),u=s();function d(){switch(e.type){case j.Logins:return T.loginsReport(n);case j.VideoViews:return T.videoViewsReport(t,`v3`);default:return null}}function f(){u(d()).then(()=>i.success(O(`success`))).catch(e=>l(e,O(`error`),O(`noEmailError`))).finally(e.closePopup)}return(0,E.jsx)(c.Provider,{value:D,children:(0,E.jsxs)(m,{title:O(`title`),showLoadingSpinner:a,closePopup:e.closePopup,children:[(0,E.jsx)(`p`,{children:(0,E.jsx)(o,{phrase:k(e.type)})}),(0,E.jsx)(`p`,{children:(0,E.jsx)(o,{phrase:`dateRange`,options:{dateFrom:A(r.start),dateTo:A(r.end)}})}),(0,E.jsx)(`p`,{children:(0,E.jsx)(o,{phrase:`emailDescription`})}),(0,E.jsxs)(h,{children:[(0,E.jsx)(h.Cancel,{onClick:e.closePopup}),(0,E.jsx)(h.Submit,{variant:`dark`,onClick:f,text:O(`generateReport`)})]})]})})}export{M as n,A as r,j as t};
2
- //# sourceMappingURL=CqCz1X85.chunk.js.map
1
+ import{P as e,Zt as t,st as n}from"./CM0wW4AE.chunk.js";import{i as r}from"./S6AM6CLE.chunk.js";import{b as i,d as a,n as o,p as s,t as c}from"./dUFTODMz.chunk.js";import{t as l}from"./CjM_tQvd.chunk.js";import{n as u}from"./CNQKHXPY.chunk.js";import{t as d}from"./I5Dnl_eN.chunk.js";import{t as f}from"./CO7H3BC5.chunk.js";import{t as p}from"./DGCz68te.chunk.js";import{t as m}from"./CnyxksnC.chunk.js";import{t as h}from"./dSmIXyxJ.chunk.js";import{at as g,r as _,tt as v}from"./app-m6P7KXE1.js";import{t as y}from"./C1BFkCSD2.chunk.js";var b=`shared.verifiedEmailError`,x=class extends p{constructor(e,t,n){super(`VerifiedEmailRequiredError`),this.message=e,this.liteUrl=t,this.hasLite=n}get name(){return`VerifiedEmailRequiredError`}get dialogOptions(){let e=u.safeUrlConcat(this.liteUrl,`settings/account`);return{title:d.getPhrase(b,`heading`),text:this.hasLite?`${this.message} ${d.getPhrase(b,`visitSettings`,{href:e})}`:this.message,buttons:[{text:d.getPhrase(b,`close`),className:`btn btn-dark`,success:!0}]}}},S=()=>{let e=a(a(r.currentUser()).data?.isAuthenticated&&v.userProducts()),t=!e.hasCompleted;return{hasProduct:n=>t||e.hasError||!e.data?.length?!1:e.data.some(e=>e.id===n),products:e,isLoadingProducts:t}};function C(){let e=y(),{hasProduct:n,isLoadingProducts:r}=S(),i=a(g.config());function o(r,a,o){if(!r.responseJSON||r.responseJSON?.type!==`no-email`){e.error(a);return}t.throw(new x(o,i.data.liteUrl,n(f.Primary)))}return{handleGenerateReportError:o,loading:!i.hasCompleted||r}}function w(e){return{dateRange:{start:e.start,end:e.end},offsetInMin:Math.abs(new Date().getTimezoneOffset())}}var T={videoViewsReport(e,t){return{url:`{gateway}/v1/analytics/video-views/reports`,key:`video:views:report`,type:i.POST,data:{...w(e),version:t},invalidationKeys:`export`,normalize:!1}},loginsReport(e,t,n,r){return{url:`{gateway}/v1/analytics/logins/reports`,key:`logins:report`,data:w(e),type:i.POST,normalize:!1,success:t,error:n,always:r}}};n();var E=e(),D=`reportsShared.generateReport`,O=d.encloseNamespace(D);function k(e){switch(e){case j.Logins:return`loginsDescription`;case j.VideoViews:return`videosDescription`;default:return``}}function A(e){let t=l.convertUTCToLocal(e).toString();return l.format(t,`Do MMMM YYYY`)}var j=function(e){return e[e.Logins=0]=`Logins`,e[e.VideoViews=1]=`VideoViews`,e}({});function M(e){let t=_(`video-views`),n=_(`logins`),r=e.type===j.VideoViews?t:n,i=y(),{loading:a,handleGenerateReportError:l}=C(),u=s();function d(){switch(e.type){case j.Logins:return T.loginsReport(n);case j.VideoViews:return T.videoViewsReport(t,`v3`);default:return null}}function f(){u(d()).then(()=>i.success(O(`success`))).catch(e=>l(e,O(`error`),O(`noEmailError`))).finally(e.closePopup)}return(0,E.jsx)(c.Provider,{value:D,children:(0,E.jsxs)(m,{title:O(`title`),showLoadingSpinner:a,closePopup:e.closePopup,children:[(0,E.jsx)(`p`,{children:(0,E.jsx)(o,{phrase:k(e.type)})}),(0,E.jsx)(`p`,{children:(0,E.jsx)(o,{phrase:`dateRange`,options:{dateFrom:A(r.start),dateTo:A(r.end)}})}),(0,E.jsx)(`p`,{children:(0,E.jsx)(o,{phrase:`emailDescription`})}),(0,E.jsxs)(h,{children:[(0,E.jsx)(h.Cancel,{onClick:e.closePopup}),(0,E.jsx)(h.Submit,{variant:`dark`,onClick:f,text:O(`generateReport`)})]})]})})}export{M as n,A as r,j as t};
2
+ //# sourceMappingURL=PZOjj17O.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CqCz1X85.chunk.js","names":[],"sources":["../../../../libs/shared/src/errors/general/verified-email/VerifiedEmailRequiredError.ts","../../../../libs/shared/src/hooks/UseProducts.ts","../../../../libs/shared/src/hooks/useVerifiedEmailRequiredErrorHandler.ts","../../src/shared/flight-requests/ReportRequests.ts","../../src/shared/views/generate-report/GenerateReportView.tsx"],"sourcesContent":["import { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { UrlHelper } from 'libs/common/backbone/utils/UrlHelper';\n\nimport { DialogError } from 'libs/shared/errors/primitives/DialogError';\nimport { DialogOptions } from 'libs/shared/interfaces';\n\nconst namespace = 'shared.verifiedEmailError';\n\nexport class VerifiedEmailRequiredError extends DialogError {\n public message: string;\n public liteUrl: string;\n public hasLite: boolean;\n\n constructor(message: string, liteUrl: string, hasLite: boolean) {\n super('VerifiedEmailRequiredError');\n\n this.message = message;\n this.liteUrl = liteUrl;\n this.hasLite = hasLite;\n }\n\n // @ts-ignore\n public get name(): string {\n return 'VerifiedEmailRequiredError';\n }\n\n // @ts-ignore\n public get dialogOptions(): DialogOptions {\n const href = UrlHelper.safeUrlConcat(this.liteUrl, 'settings/account');\n\n return {\n title: LanguageService.getPhrase(namespace, 'heading'),\n text: this.hasLite ?\n `${this.message} ${LanguageService.getPhrase(namespace, 'visitSettings', { href })}` :\n this.message,\n buttons: [{\n text: LanguageService.getPhrase(namespace, 'close'),\n className: 'btn btn-dark',\n success: true\n }]\n };\n }\n}\n","import { Flight } from 'libs/common/flight';\n\nimport { ProductId } from 'libs/shared/enums/ProductId';\nimport { ProductRequests } from 'libs/shared/flight-requests/ProductRequests';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { CurrentUser, Product } from 'libs/shared/interfaces';\n\nexport type HasProductFunc = (productId: ProductId) => boolean;\n\nexport interface UseProductsResponse {\n hasProduct: (product: ProductId) => boolean;\n products: Flight.Response<Product[]>;\n isLoadingProducts: boolean;\n}\n\nexport const useProducts = (): UseProductsResponse => {\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n const products = Flight.useBasicFetch<Product[]>(currentUser.data?.isAuthenticated && ProductRequests.userProducts());\n const isLoadingProducts = !products.hasCompleted;\n\n const hasProduct = (productId: ProductId) => {\n if (isLoadingProducts || products.hasError)\n return false;\n\n if (!products.data?.length)\n return false;\n\n return products.data.some(product => product.id === productId);\n };\n\n return {\n hasProduct,\n products,\n isLoadingProducts\n };\n};\n","import { Core } from 'libs/common/backbone/index';\nimport { Xhr } from 'libs/common/backbone/interfaces';\nimport { Flight } from 'libs/common/react/index';\n\nimport { ProductId } from 'libs/shared/enums/ProductId';\nimport { VerifiedEmailRequiredError } from 'libs/shared/errors/general/verified-email/VerifiedEmailRequiredError';\nimport { ConfigRequests } from 'libs/shared/flight-requests/ConfigRequests';\nimport { useAlerts } from 'libs/shared/hooks/UseAlerts';\nimport { useProducts } from 'libs/shared/hooks/UseProducts';\nimport { Config } from 'libs/shared/interfaces';\n\nexport function useVerifiedEmailRequiredErrorHandler() {\n const alerts = useAlerts();\n const { hasProduct, isLoadingProducts } = useProducts();\n const config = Flight.useBasicFetch<Config>(ConfigRequests.config());\n\n function handleGenerateReportError(xhr: Xhr, message: string, noEmailError: string) {\n if (!xhr.responseJSON || xhr.responseJSON?.type !== 'no-email') {\n alerts.error(message);\n return;\n }\n\n Core.ErrorHelper.throw(\n new VerifiedEmailRequiredError(noEmailError, config.data.liteUrl, hasProduct(ProductId.Primary))\n );\n }\n\n return {\n handleGenerateReportError,\n loading: !config.hasCompleted || isLoadingProducts\n };\n}\n","import { HttpVerbs } from 'libs/common/backbone/enums/HttpVerbs';\nimport { Xhr } from 'libs/common/backbone/interfaces';\nimport { Flight } from 'libs/common/flight';\n\nimport { AnalyticsRequestFilter } from 'libs/shared/interfaces';\n\ntype ReportVersion = 'v2' | 'v3';\n\ninterface DateRange {\n start: string;\n end: string;\n}\n\ninterface ReportRequestPayload {\n dateRange: DateRange;\n offsetInMin: number;\n userIds?: number[];\n groupsIds?: number[];\n}\n\nfunction formatReportRequest(filterParams: AnalyticsRequestFilter): ReportRequestPayload {\n return {\n dateRange: {\n start: filterParams.start,\n end: filterParams.end\n },\n offsetInMin: Math.abs(new Date().getTimezoneOffset())\n };\n}\n\nexport const ReportRequests = {\n videoViewsReport(\n filterParams: AnalyticsRequestFilter,\n version: ReportVersion\n ): Flight.Request {\n return {\n url: '{gateway}/v1/analytics/video-views/reports',\n key: 'video:views:report',\n type: HttpVerbs.POST,\n data: { ...formatReportRequest(filterParams), version },\n invalidationKeys: 'export',\n normalize: false\n };\n },\n\n loginsReport(\n filterParams: AnalyticsRequestFilter,\n success?: () => void,\n error?: (xhr: Xhr) => void,\n always?: () => void\n ): Flight.Request {\n return {\n url: '{gateway}/v1/analytics/logins/reports',\n key: 'logins:report',\n data: formatReportRequest(filterParams),\n type: HttpVerbs.POST,\n normalize: false,\n success,\n error,\n always\n };\n }\n};\n","import React from 'react';\n\nimport { Xhr } from 'libs/common/backbone/interfaces';\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Flight } from 'libs/common/flight';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { Popup } from 'libs/shared/components/popup/Popup';\nimport { PopupButtons } from 'libs/shared/components/popup/PopupButtons';\nimport { LanguageNamespaceContext, Text } from 'libs/shared/components/text/Text';\nimport { useAlerts } from 'libs/shared/hooks/UseAlerts';\nimport { useVerifiedEmailRequiredErrorHandler } from 'libs/shared/hooks/useVerifiedEmailRequiredErrorHandler';\nimport { PropsWithPopupViewProps } from 'libs/shared/interfaces';\n\nimport { ReportRequests } from 'shared/flight-requests/ReportRequests';\nimport { useGetRequestFilter } from 'shared/hooks/UseGetFilterQueryParams';\n\nconst namespace = 'reportsShared.generateReport';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nfunction getLangPhrase(type: GenerateReportType): string {\n switch (type) {\n case GenerateReportType.Logins:\n return 'loginsDescription';\n\n case GenerateReportType.VideoViews:\n return 'videosDescription';\n\n default:\n return '';\n }\n}\n\nexport function getReportFriendlyDate(date: string): string {\n const localDate = DateHelper.convertUTCToLocal(date).toString();\n return DateHelper.format(localDate, 'Do MMMM YYYY');\n}\n\nexport enum GenerateReportType {\n Logins,\n VideoViews\n}\n\ninterface GenerateReportViewProps {\n type: GenerateReportType;\n}\n\nexport function GenerateReportView(props: PropsWithPopupViewProps<GenerateReportViewProps>): JSX.Element {\n const videoViewsFilter = useGetRequestFilter('video-views');\n const loginsFilter = useGetRequestFilter('logins');\n const filterQueryParams = props.type === GenerateReportType.VideoViews ? videoViewsFilter : loginsFilter;\n const alerts = useAlerts();\n const { loading, handleGenerateReportError } = useVerifiedEmailRequiredErrorHandler();\n\n const fetchAsync = Flight.useGetFetchAsync();\n\n function getRequest(): Flight.Request {\n switch (props.type) {\n case GenerateReportType.Logins:\n return ReportRequests.loginsReport(loginsFilter);\n\n case GenerateReportType.VideoViews:\n return ReportRequests.videoViewsReport(videoViewsFilter, 'v3');\n\n default:\n return null;\n }\n }\n\n function onClick() {\n fetchAsync(getRequest())\n .then(() => alerts.success(getPhrase('success')))\n .catch((xhr: Xhr) => handleGenerateReportError(xhr, getPhrase('error'), getPhrase('noEmailError')))\n .finally(props.closePopup);\n }\n\n return (\n <LanguageNamespaceContext.Provider value={namespace}>\n <Popup\n title={getPhrase('title')}\n showLoadingSpinner={loading}\n closePopup={props.closePopup}\n >\n <p>\n <Text phrase={getLangPhrase(props.type)} />\n </p>\n <p>\n <Text phrase='dateRange' options={({\n dateFrom: getReportFriendlyDate(filterQueryParams.start),\n dateTo: getReportFriendlyDate(filterQueryParams.end)\n })} />\n </p>\n <p>\n <Text phrase='emailDescription' />\n </p>\n <PopupButtons>\n <PopupButtons.Cancel onClick={props.closePopup} />\n <PopupButtons.Submit\n variant='dark'\n onClick={onClick}\n text={getPhrase('generateReport')}\n />\n </PopupButtons>\n </Popup>\n </LanguageNamespaceContext.Provider>\n );\n}\n"],"mappings":"2hBAMA,IAAM,EAAY,4BAEL,EAAb,cAAgD,CAAY,CAK1D,YAAY,EAAiB,EAAiB,EAAkB,CAC9D,MAAM,6BAA6B,CAEnC,KAAK,QAAU,EACf,KAAK,QAAU,EACf,KAAK,QAAU,EAIjB,IAAW,MAAe,CACxB,MAAO,6BAIT,IAAW,eAA+B,CACxC,IAAM,EAAO,EAAU,cAAc,KAAK,QAAS,mBAAmB,CAEtE,MAAO,CACL,MAAO,EAAgB,UAAU,EAAW,UAAU,CACtD,KAAM,KAAK,QACT,GAAG,KAAK,QAAQ,GAAG,EAAgB,UAAU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AM,KAAK,CAAI,CAAA,CACzC,CAAA,EACJ,EAAA,EAAA,KAAC,IAAD,CAAA,UACE,EAAA,EAAA,KAAC,EAAD,CAAM,OAAO,YAAY,QAAU,CACjC,SAAU,EAAsB,EAAkB,MAAM,CACxD,OAAQ,EAAsB,EAAkB,IAAI,CACrD,CAAK,CAAA,CACJ,CAAA,EACJ,EAAA,EAAA,KAAC,IAAD,CAAA,UACE,EAAA,EAAA,KAAC,EAAD,CAAM,OAAO,mBAAqB,CAAA,CAChC,CAAA,EACJ,EAAA,EAAA,MAAC,EAAD,CAAA,SAAA,EACE,EAAA,EAAA,KAAC,EAAa,OAAd,CAAqB,QAAS,EAAM,WAAc,CAAA,EAClD,EAAA,EAAA,KAAC,EAAa,OAAd,CACE,QAAQ,OACC,UACT,KAAM,EAAU,iBAAiB,CACjC,CAAA,CACW,CAAA,CAAA,CACT,GAC0B,CAAA"}
1
+ {"version":3,"file":"PZOjj17O.chunk.js","names":[],"sources":["../../../../libs/shared/src/errors/general/verified-email/VerifiedEmailRequiredError.ts","../../../../libs/shared/src/hooks/UseProducts.ts","../../../../libs/shared/src/hooks/useVerifiedEmailRequiredErrorHandler.ts","../../src/shared/flight-requests/ReportRequests.ts","../../src/shared/views/generate-report/GenerateReportView.tsx"],"sourcesContent":["import { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { UrlHelper } from 'libs/common/backbone/utils/UrlHelper';\n\nimport { DialogError } from 'libs/shared/errors/primitives/DialogError';\nimport { DialogOptions } from 'libs/shared/interfaces';\n\nconst namespace = 'shared.verifiedEmailError';\n\nexport class VerifiedEmailRequiredError extends DialogError {\n public message: string;\n public liteUrl: string;\n public hasLite: boolean;\n\n constructor(message: string, liteUrl: string, hasLite: boolean) {\n super('VerifiedEmailRequiredError');\n\n this.message = message;\n this.liteUrl = liteUrl;\n this.hasLite = hasLite;\n }\n\n // @ts-ignore\n public get name(): string {\n return 'VerifiedEmailRequiredError';\n }\n\n // @ts-ignore\n public get dialogOptions(): DialogOptions {\n const href = UrlHelper.safeUrlConcat(this.liteUrl, 'settings/account');\n\n return {\n title: LanguageService.getPhrase(namespace, 'heading'),\n text: this.hasLite ?\n `${this.message} ${LanguageService.getPhrase(namespace, 'visitSettings', { href })}` :\n this.message,\n buttons: [{\n text: LanguageService.getPhrase(namespace, 'close'),\n className: 'btn btn-dark',\n success: true\n }]\n };\n }\n}\n","import { Flight } from 'libs/common/flight';\n\nimport { ProductId } from 'libs/shared/enums/ProductId';\nimport { ProductRequests } from 'libs/shared/flight-requests/ProductRequests';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { CurrentUser, Product } from 'libs/shared/interfaces';\n\nexport type HasProductFunc = (productId: ProductId) => boolean;\n\nexport interface UseProductsResponse {\n hasProduct: (product: ProductId) => boolean;\n products: Flight.Response<Product[]>;\n isLoadingProducts: boolean;\n}\n\nexport const useProducts = (): UseProductsResponse => {\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n const products = Flight.useBasicFetch<Product[]>(currentUser.data?.isAuthenticated && ProductRequests.userProducts());\n const isLoadingProducts = !products.hasCompleted;\n\n const hasProduct = (productId: ProductId) => {\n if (isLoadingProducts || products.hasError)\n return false;\n\n if (!products.data?.length)\n return false;\n\n return products.data.some(product => product.id === productId);\n };\n\n return {\n hasProduct,\n products,\n isLoadingProducts\n };\n};\n","import { Core } from 'libs/common/backbone/index';\nimport { Xhr } from 'libs/common/backbone/interfaces';\nimport { Flight } from 'libs/common/react/index';\n\nimport { ProductId } from 'libs/shared/enums/ProductId';\nimport { VerifiedEmailRequiredError } from 'libs/shared/errors/general/verified-email/VerifiedEmailRequiredError';\nimport { ConfigRequests } from 'libs/shared/flight-requests/ConfigRequests';\nimport { useAlerts } from 'libs/shared/hooks/UseAlerts';\nimport { useProducts } from 'libs/shared/hooks/UseProducts';\nimport { Config } from 'libs/shared/interfaces';\n\nexport function useVerifiedEmailRequiredErrorHandler() {\n const alerts = useAlerts();\n const { hasProduct, isLoadingProducts } = useProducts();\n const config = Flight.useBasicFetch<Config>(ConfigRequests.config());\n\n function handleGenerateReportError(xhr: Xhr, message: string, noEmailError: string) {\n if (!xhr.responseJSON || xhr.responseJSON?.type !== 'no-email') {\n alerts.error(message);\n return;\n }\n\n Core.ErrorHelper.throw(\n new VerifiedEmailRequiredError(noEmailError, config.data.liteUrl, hasProduct(ProductId.Primary))\n );\n }\n\n return {\n handleGenerateReportError,\n loading: !config.hasCompleted || isLoadingProducts\n };\n}\n","import { HttpVerbs } from 'libs/common/backbone/enums/HttpVerbs';\nimport { Xhr } from 'libs/common/backbone/interfaces';\nimport { Flight } from 'libs/common/flight';\n\nimport { AnalyticsRequestFilter } from 'libs/shared/interfaces';\n\ntype ReportVersion = 'v2' | 'v3';\n\ninterface DateRange {\n start: string;\n end: string;\n}\n\ninterface ReportRequestPayload {\n dateRange: DateRange;\n offsetInMin: number;\n userIds?: number[];\n groupsIds?: number[];\n}\n\nfunction formatReportRequest(filterParams: AnalyticsRequestFilter): ReportRequestPayload {\n return {\n dateRange: {\n start: filterParams.start,\n end: filterParams.end\n },\n offsetInMin: Math.abs(new Date().getTimezoneOffset())\n };\n}\n\nexport const ReportRequests = {\n videoViewsReport(\n filterParams: AnalyticsRequestFilter,\n version: ReportVersion\n ): Flight.Request {\n return {\n url: '{gateway}/v1/analytics/video-views/reports',\n key: 'video:views:report',\n type: HttpVerbs.POST,\n data: { ...formatReportRequest(filterParams), version },\n invalidationKeys: 'export',\n normalize: false\n };\n },\n\n loginsReport(\n filterParams: AnalyticsRequestFilter,\n success?: () => void,\n error?: (xhr: Xhr) => void,\n always?: () => void\n ): Flight.Request {\n return {\n url: '{gateway}/v1/analytics/logins/reports',\n key: 'logins:report',\n data: formatReportRequest(filterParams),\n type: HttpVerbs.POST,\n normalize: false,\n success,\n error,\n always\n };\n }\n};\n","import React from 'react';\n\nimport { Xhr } from 'libs/common/backbone/interfaces';\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Flight } from 'libs/common/flight';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { Popup } from 'libs/shared/components/popup/Popup';\nimport { PopupButtons } from 'libs/shared/components/popup/PopupButtons';\nimport { LanguageNamespaceContext, Text } from 'libs/shared/components/text/Text';\nimport { useAlerts } from 'libs/shared/hooks/UseAlerts';\nimport { useVerifiedEmailRequiredErrorHandler } from 'libs/shared/hooks/useVerifiedEmailRequiredErrorHandler';\nimport { PropsWithPopupViewProps } from 'libs/shared/interfaces';\n\nimport { ReportRequests } from 'shared/flight-requests/ReportRequests';\nimport { useGetRequestFilter } from 'shared/hooks/UseGetFilterQueryParams';\n\nconst namespace = 'reportsShared.generateReport';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nfunction getLangPhrase(type: GenerateReportType): string {\n switch (type) {\n case GenerateReportType.Logins:\n return 'loginsDescription';\n\n case GenerateReportType.VideoViews:\n return 'videosDescription';\n\n default:\n return '';\n }\n}\n\nexport function getReportFriendlyDate(date: string): string {\n const localDate = DateHelper.convertUTCToLocal(date).toString();\n return DateHelper.format(localDate, 'Do MMMM YYYY');\n}\n\nexport enum GenerateReportType {\n Logins,\n VideoViews\n}\n\ninterface GenerateReportViewProps {\n type: GenerateReportType;\n}\n\nexport function GenerateReportView(props: PropsWithPopupViewProps<GenerateReportViewProps>): JSX.Element {\n const videoViewsFilter = useGetRequestFilter('video-views');\n const loginsFilter = useGetRequestFilter('logins');\n const filterQueryParams = props.type === GenerateReportType.VideoViews ? videoViewsFilter : loginsFilter;\n const alerts = useAlerts();\n const { loading, handleGenerateReportError } = useVerifiedEmailRequiredErrorHandler();\n\n const fetchAsync = Flight.useGetFetchAsync();\n\n function getRequest(): Flight.Request {\n switch (props.type) {\n case GenerateReportType.Logins:\n return ReportRequests.loginsReport(loginsFilter);\n\n case GenerateReportType.VideoViews:\n return ReportRequests.videoViewsReport(videoViewsFilter, 'v3');\n\n default:\n return null;\n }\n }\n\n function onClick() {\n fetchAsync(getRequest())\n .then(() => alerts.success(getPhrase('success')))\n .catch((xhr: Xhr) => handleGenerateReportError(xhr, getPhrase('error'), getPhrase('noEmailError')))\n .finally(props.closePopup);\n }\n\n return (\n <LanguageNamespaceContext.Provider value={namespace}>\n <Popup\n title={getPhrase('title')}\n showLoadingSpinner={loading}\n closePopup={props.closePopup}\n >\n <p>\n <Text phrase={getLangPhrase(props.type)} />\n </p>\n <p>\n <Text phrase='dateRange' options={({\n dateFrom: getReportFriendlyDate(filterQueryParams.start),\n dateTo: getReportFriendlyDate(filterQueryParams.end)\n })} />\n </p>\n <p>\n <Text phrase='emailDescription' />\n </p>\n <PopupButtons>\n <PopupButtons.Cancel onClick={props.closePopup} />\n <PopupButtons.Submit\n variant='dark'\n onClick={onClick}\n text={getPhrase('generateReport')}\n />\n </PopupButtons>\n </Popup>\n </LanguageNamespaceContext.Provider>\n );\n}\n"],"mappings":"2hBAMA,IAAM,EAAY,4BAEL,EAAb,cAAgD,CAAY,CAK1D,YAAY,EAAiB,EAAiB,EAAkB,CAC9D,MAAM,6BAA6B,CAEnC,KAAK,QAAU,EACf,KAAK,QAAU,EACf,KAAK,QAAU,EAIjB,IAAW,MAAe,CACxB,MAAO,6BAIT,IAAW,eAA+B,CACxC,IAAM,EAAO,EAAU,cAAc,KAAK,QAAS,mBAAmB,CAEtE,MAAO,CACL,MAAO,EAAgB,UAAU,EAAW,UAAU,CACtD,KAAM,KAAK,QACT,GAAG,KAAK,QAAQ,GAAG,EAAgB,UAAU,EAAW,gBAAiB,CAAE,OAAM,CAAC,GAClF,KAAK,QACP,QAAS,CAAC,CACR,KAAM,EAAgB,UAAU,EAAW,QAAQ,CACnD,UAAW,eACX,QAAS,GACV,CAAA,CACF,GCzBQ,MAAyC,CAEpD,IAAM,EAAW,EADG,EAAkC,EAAa,aAAa,CAAC,CACpB,MAAM,iBAAmB,EAAgB,cAAc,CAAC,CAC/G,EAAoB,CAAC,EAAS,aAYpC,MAAO,CACL,WAXkB,GACd,GAAqB,EAAS,UAG9B,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