@clickview/lite 0.17.1 → 0.17.2-dev.0

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 (124) hide show
  1. package/dist/bundles.json +2 -2
  2. package/dist/css/{1053-lite-254fccec9d.chunk.css → 1053-lite-1694ef4285.chunk.css} +1 -1
  3. package/dist/css/{2153-lite-a3205bb6ab.chunk.css → 2153-lite-88c82db673.chunk.css} +1 -1
  4. package/dist/css/{9482-lite-1bdec3348c.chunk.css → 2191-lite-7ff818466d.chunk.css} +2 -2
  5. package/dist/css/{2319-lite-54f4169718.chunk.css → 2319-lite-d11335bef9.chunk.css} +2 -2
  6. package/dist/css/{249-lite-04c1bcf306.chunk.css → 249-lite-68eb3d78fd.chunk.css} +2 -2
  7. package/dist/css/{2851-lite-39147b2607.chunk.css → 2851-lite-e2160bfafd.chunk.css} +2 -2
  8. package/dist/css/{885-lite-aded4bdc6a.chunk.css → 309-lite-058a518c6d.chunk.css} +5 -4
  9. package/dist/css/{3177-lite-5f73117448.chunk.css → 3177-lite-4782b30176.chunk.css} +3 -3
  10. package/dist/css/{3626-lite-e89a23b5f8.chunk.css → 3626-lite-281b5d8cf1.chunk.css} +2 -2
  11. package/dist/css/{3994-lite-8e72471f8d.chunk.css → 3994-lite-c0284aa568.chunk.css} +2 -2
  12. package/dist/css/{9424-lite-c46fec7779.chunk.css → 4233-lite-da8d343988.chunk.css} +2 -2
  13. package/dist/css/{4453-lite-4f2aba4837.chunk.css → 4453-lite-8140e3b34f.chunk.css} +2 -2
  14. package/dist/css/{5985-lite-3ee0455feb.chunk.css → 4471-lite-9ab2d5e09d.chunk.css} +3 -3
  15. package/dist/css/{4484-lite-18f77e6767.chunk.css → 4484-lite-79cae540c6.chunk.css} +2 -2
  16. package/dist/css/{4519-lite-38288f9a4b.chunk.css → 4519-lite-6edbee8c07.chunk.css} +2 -2
  17. package/dist/css/{5104-lite-1145a0fa5f.chunk.css → 5104-lite-e0b42a9281.chunk.css} +1 -1
  18. package/dist/css/{4471-lite-f6e681eb00.chunk.css → 5985-lite-411dbea6f2.chunk.css} +3 -3
  19. package/dist/css/{6255-lite-497af69e9e.chunk.css → 6255-lite-08ea742390.chunk.css} +2 -2
  20. package/dist/css/6330-lite-46ed6be11f.chunk.css +7 -0
  21. package/dist/css/{6369-lite-af3f2910ba.chunk.css → 6369-lite-b43857e49a.chunk.css} +2 -2
  22. package/dist/css/{7007-lite-841c17f2bd.chunk.css → 7007-lite-0ca1b89c2b.chunk.css} +2 -2
  23. package/dist/css/{7756-lite-f2632cebd5.chunk.css → 7756-lite-d9505ae9c9.chunk.css} +2 -2
  24. package/dist/css/{777-lite-8e72471f8d.chunk.css → 777-lite-c0284aa568.chunk.css} +2 -2
  25. package/dist/css/{7958-lite-a7940e7abe.chunk.css → 7958-lite-1a4d8b8dd4.chunk.css} +3 -3
  26. package/dist/css/{8300-lite-6599e352a8.chunk.css → 8300-lite-cc73e26bd7.chunk.css} +2 -2
  27. package/dist/css/{8898-lite-54f4169718.chunk.css → 8898-lite-d11335bef9.chunk.css} +2 -2
  28. package/dist/css/{4233-lite-c46fec7779.chunk.css → 9424-lite-da8d343988.chunk.css} +2 -2
  29. package/dist/css/{2191-lite-1bdec3348c.chunk.css → 9482-lite-7ff818466d.chunk.css} +2 -2
  30. package/dist/css/{969-lite-84e2be4d4a.chunk.css → 969-lite-a768974cc7.chunk.css} +1 -1
  31. package/dist/css/{9767-lite-258436472d.chunk.css → 9767-lite-8e9338877d.chunk.css} +2 -2
  32. package/dist/css/{169-lite-aab6a30751.chunk.css → 9963-lite-84900b1bda.chunk.css} +3 -3
  33. package/dist/css/{lite-app-24bd7c7d54.css → lite-app-0eddd54de0.css} +1 -1
  34. package/dist/languages/en.json +1 -1
  35. package/dist/scripts/1160-baa6acc98b-lite.chunk.js +1 -0
  36. package/dist/scripts/1442-8ecb7651ae-lite.chunk.js +2 -0
  37. package/dist/scripts/1725-4ef2cef26a-lite.chunk.js +1 -0
  38. package/dist/scripts/249-78644459d5-lite.chunk.js +1 -0
  39. package/dist/scripts/291-98aa4d621e-lite.chunk.js +1 -0
  40. package/dist/scripts/3019-581bb55112-lite.chunk.js +1 -0
  41. package/dist/scripts/{885-451836664e-lite.chunk.js → 309-82a6910606-lite.chunk.js} +1 -1
  42. package/dist/scripts/3143-2855610052-lite.chunk.js +2 -0
  43. package/dist/scripts/{3171-1136ef1490-lite.chunk.js → 3171-ca3656aec1-lite.chunk.js} +1 -1
  44. package/dist/scripts/{3237-7767ad4903-lite.chunk.js → 3237-ba03ae7add-lite.chunk.js} +1 -1
  45. package/dist/scripts/{3468-bfb42717ec-lite.chunk.js → 3468-852268650b-lite.chunk.js} +1 -1
  46. package/dist/scripts/4182-b6f53a82f6-lite.chunk.js +1 -0
  47. package/dist/scripts/{4484-498704a014-lite.chunk.js → 4484-2e7a219372-lite.chunk.js} +1 -1
  48. package/dist/scripts/{4541-0f34db8eaa-lite.chunk.js → 4541-4d78904280-lite.chunk.js} +1 -1
  49. package/dist/scripts/{4617-ee30946c00-lite.chunk.js → 4617-79257249bf-lite.chunk.js} +1 -1
  50. package/dist/scripts/{482-b5d609eab9-lite.chunk.js → 482-d2d8fd4bda-lite.chunk.js} +1 -1
  51. package/dist/scripts/5606-2f27f2fe34-lite.chunk.js +1 -0
  52. package/dist/scripts/5875-95fbcaaa30-lite.chunk.js +2 -0
  53. package/dist/scripts/5877-ccf5835809-lite.chunk.js +1 -0
  54. package/dist/scripts/{5986-794584619c-lite.chunk.js → 5986-8827c2f2e2-lite.chunk.js} +1 -1
  55. package/dist/scripts/{6263-d5e330bed1-lite.chunk.js → 6263-b99a4903f4-lite.chunk.js} +1 -1
  56. package/dist/scripts/{6274-3043592753-lite.chunk.js → 6274-3f826f9e45-lite.chunk.js} +1 -1
  57. package/dist/scripts/6290-ad8e2d7e0c-lite.chunk.js +1 -0
  58. package/dist/scripts/{8987-c4cd06fd43-lite.chunk.js → 6330-9a7743427a-lite.chunk.js} +1 -1
  59. package/dist/scripts/6381-4aab2942be-lite.chunk.js +1 -0
  60. package/dist/scripts/6450-96d2502ab5-lite.chunk.js +1 -0
  61. package/dist/scripts/{6465-1a5ddad160-lite.chunk.js → 6465-c11641adbe-lite.chunk.js} +1 -1
  62. package/dist/scripts/{6689-520085da6e-lite.chunk.js → 6689-e5d9f27111-lite.chunk.js} +1 -1
  63. package/dist/scripts/{7128-c70c22c18c-lite.chunk.js → 7128-e78381873f-lite.chunk.js} +1 -1
  64. package/dist/scripts/{7172-5ce69097dc-lite.chunk.js → 7172-6b7be396b2-lite.chunk.js} +1 -1
  65. package/dist/scripts/{7939-0fdc3ce530-lite.chunk.js → 7939-36f426cfc9-lite.chunk.js} +1 -1
  66. package/dist/scripts/7989-4762231e68-lite.chunk.js +2 -0
  67. package/dist/scripts/{8025-73a0822c68-lite.chunk.js → 8025-a57448366a-lite.chunk.js} +1 -1
  68. package/dist/scripts/{8038-b236c86736-lite.chunk.js → 8038-4c3d785f60-lite.chunk.js} +1 -1
  69. package/dist/scripts/8801-371bb76921-lite.chunk.js +1 -0
  70. package/dist/scripts/{9060-719bb9c536-lite.chunk.js → 9060-5b1bdb98eb-lite.chunk.js} +1 -1
  71. package/dist/scripts/9455-4200b1193d-lite.chunk.js +1 -0
  72. package/dist/scripts/9963-df1840335f-lite.chunk.js +1 -0
  73. package/dist/scripts/bundle-ac897d6f4d.min.js +2 -0
  74. package/dist/scripts/{bundle-c14ddc53ef.min.js.LICENSE.txt → bundle-ac897d6f4d.min.js.LICENSE.txt} +9 -0
  75. package/package.json +1 -2
  76. package/dist/css/8987-lite-41d75882c6.chunk.css +0 -6
  77. package/dist/scripts/1160-630867953a-lite.chunk.js +0 -1
  78. package/dist/scripts/169-8cc73bfd6c-lite.chunk.js +0 -1
  79. package/dist/scripts/1725-5d4e3584f1-lite.chunk.js +0 -1
  80. package/dist/scripts/249-bff7b5ad3e-lite.chunk.js +0 -1
  81. package/dist/scripts/291-8fa8196cd0-lite.chunk.js +0 -1
  82. package/dist/scripts/3019-32af4287af-lite.chunk.js +0 -1
  83. package/dist/scripts/3143-a28a269db7-lite.chunk.js +0 -2
  84. package/dist/scripts/3588-8694fd9727-lite.chunk.js +0 -2
  85. package/dist/scripts/4182-e06b8cfae1-lite.chunk.js +0 -1
  86. package/dist/scripts/5606-49aa724d72-lite.chunk.js +0 -1
  87. package/dist/scripts/5875-380883e8d7-lite.chunk.js +0 -2
  88. package/dist/scripts/5877-42c1069df3-lite.chunk.js +0 -1
  89. package/dist/scripts/6290-eed85dc221-lite.chunk.js +0 -1
  90. package/dist/scripts/6381-5db2d18554-lite.chunk.js +0 -1
  91. package/dist/scripts/6450-e52e703cd0-lite.chunk.js +0 -1
  92. package/dist/scripts/7989-d27d009387-lite.chunk.js +0 -2
  93. package/dist/scripts/8801-410778ec03-lite.chunk.js +0 -1
  94. package/dist/scripts/9455-0e4f7dffc3-lite.chunk.js +0 -1
  95. package/dist/scripts/bundle-c14ddc53ef.min.js +0 -2
  96. /package/dist/scripts/{1053-6791248c33-lite.chunk.js → 1053-128b9e5e84-lite.chunk.js} +0 -0
  97. /package/dist/scripts/{3143-a28a269db7-lite.chunk.js.LICENSE.txt → 1442-8ecb7651ae-lite.chunk.js.LICENSE.txt} +0 -0
  98. /package/dist/scripts/{2153-afc9a875a0-lite.chunk.js → 2153-901b25046f-lite.chunk.js} +0 -0
  99. /package/dist/scripts/{2319-a42cb2a6e7-lite.chunk.js → 2319-5a70978f17-lite.chunk.js} +0 -0
  100. /package/dist/scripts/{2851-01e85edd27-lite.chunk.js → 2851-ce45e50788-lite.chunk.js} +0 -0
  101. /package/dist/scripts/{3588-8694fd9727-lite.chunk.js.LICENSE.txt → 3143-2855610052-lite.chunk.js.LICENSE.txt} +0 -0
  102. /package/dist/scripts/{3177-2d78857443-lite.chunk.js → 3177-9f72eae804-lite.chunk.js} +0 -0
  103. /package/dist/scripts/{3626-b34a6a7780-lite.chunk.js → 3626-458f2145ae-lite.chunk.js} +0 -0
  104. /package/dist/scripts/{3994-c3c348bad9-lite.chunk.js → 3994-b2a5b4f657-lite.chunk.js} +0 -0
  105. /package/dist/scripts/{4233-e3b428f0c8-lite.chunk.js → 4233-8954941fea-lite.chunk.js} +0 -0
  106. /package/dist/scripts/{4453-9b9a192eb3-lite.chunk.js → 4453-2a7a132c00-lite.chunk.js} +0 -0
  107. /package/dist/scripts/{4471-3064cc798f-lite.chunk.js → 4471-5620ca10ad-lite.chunk.js} +0 -0
  108. /package/dist/scripts/{4519-43f2871344-lite.chunk.js → 4519-88242be1ac-lite.chunk.js} +0 -0
  109. /package/dist/scripts/{5104-9c7133b663-lite.chunk.js → 5104-4b64df3a3c-lite.chunk.js} +0 -0
  110. /package/dist/scripts/{5875-380883e8d7-lite.chunk.js.LICENSE.txt → 5875-95fbcaaa30-lite.chunk.js.LICENSE.txt} +0 -0
  111. /package/dist/scripts/{5985-cec35a1b85-lite.chunk.js → 5985-e829a1f16f-lite.chunk.js} +0 -0
  112. /package/dist/scripts/{6255-f50ef0919b-lite.chunk.js → 6255-0613937a45-lite.chunk.js} +0 -0
  113. /package/dist/scripts/{6369-2e6a9873bc-lite.chunk.js → 6369-72d977b629-lite.chunk.js} +0 -0
  114. /package/dist/scripts/{6801-958fd62c7b-lite.chunk.js → 6801-8e542cded8-lite.chunk.js} +0 -0
  115. /package/dist/scripts/{7007-4162314843-lite.chunk.js → 7007-322fe4cee7-lite.chunk.js} +0 -0
  116. /package/dist/scripts/{7756-75b039e775-lite.chunk.js → 7756-9bffa0ba48-lite.chunk.js} +0 -0
  117. /package/dist/scripts/{777-7da53eafaf-lite.chunk.js → 777-8dad152202-lite.chunk.js} +0 -0
  118. /package/dist/scripts/{7958-de2d43b6cd-lite.chunk.js → 7958-421db1a997-lite.chunk.js} +0 -0
  119. /package/dist/scripts/{7989-d27d009387-lite.chunk.js.LICENSE.txt → 7989-4762231e68-lite.chunk.js.LICENSE.txt} +0 -0
  120. /package/dist/scripts/{8300-1812f33b07-lite.chunk.js → 8300-40617c6125-lite.chunk.js} +0 -0
  121. /package/dist/scripts/{9424-01bf5b0ff5-lite.chunk.js → 9424-26fd2eab2d-lite.chunk.js} +0 -0
  122. /package/dist/scripts/{9482-dcd8e035d8-lite.chunk.js → 9482-d40d77f47f-lite.chunk.js} +0 -0
  123. /package/dist/scripts/{969-dfdef4e7d8-lite.chunk.js → 969-cee5fad6f6-lite.chunk.js} +0 -0
  124. /package/dist/scripts/{9767-c5aaebdd28-lite.chunk.js → 9767-b2d445a86d-lite.chunk.js} +0 -0
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 5875-95fbcaaa30-lite.chunk.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[5875],{80181:(t,e,n)=>{n.d(e,{Z:()=>y});var r=n(1024),o=n.n(r),i=n(54976),a=n(93264),c=n(11607),u=n(83914),l=n(58130),s=n(83345),f=n(28972),d=n(86572);var p="shared.interactiveQuestions";function m(t){var e=t.interaction;switch((0,t.getCorrectness)(e)){case f.w.Correct:return o().createElement("span",{className:"text-success"},o().createElement(u.x,{size:u.S.Medium,svgName:l.vn.Check}));case f.w.Incorrect:return o().createElement("span",{className:"text-danger"},o().createElement(u.x,{size:u.S.Medium,svgName:l.vn.Close}));case f.w.AwaitingMarking:return o().createElement("span",{className:"text-muted italic"},o().createElement("i",null,o().createElement(s.x,{namespace:p,phrase:"pending"})));case f.w.UnAnswered:return o().createElement("button",{className:"btn btn-outline-dark"},o().createElement(s.x,{namespace:p,phrase:"answer"}));case f.w.Answered:return o().createElement("span",{className:"text-muted italic"},o().createElement("i",null,o().createElement(s.x,{namespace:p,phrase:"answered"})));case f.w.NotApplicable:return o().createElement(o().Fragment,null)}}function v(t){var e=t.interaction,n=t.visibleAt,r=t.selectedInteractionId,i=t.goToTimepoint,s=t.scrollTo,f=t.isFirstInteraction,p=e.id.toString()===(null==r?void 0:r.toString()),v=o().useRef();o().useEffect((function(){if(p&&v.current){var t=v.current,e=t.getBoundingClientRect(),n=e.top-t.offsetParent.getBoundingClientRect().top;s(n,e.height)}}),[p]);var h=i?"cursor-pointer":"cursor-default";return o().createElement("div",{ref:v},o().createElement(c.L,{className:"py-2 ".concat(h," ").concat("sGk59"," ").concat(p?"tfrDf":""),onClick:p?function(){}:function(){i&&i(e.id)}},o().createElement("span",{className:"".concat("JDp5N"," mr-2 ").concat(p?"font-weight-bold":"")},f?a.T.ToDisplayDuration(n):""),o().createElement(d.y,{interaction:e,showTypeName:!0,typeNameClassName:"AzIWg",questionClassName:"UhEYq"}),t.onClickDelete&&o().createElement(c.L,{onClick:function(n){n.stopPropagation(),t.onClickDelete(e.id)},className:"".concat("wBqoo")},o().createElement("span",{className:"text-right ".concat("OAQQu")},o().createElement(u.x,{size:u.S.Medium,svgName:l.vn.Delete}))),t.getCorrectness&&o().createElement("span",{className:"text-right ".concat("W5sR9")},o().createElement(m,{interaction:e,getCorrectness:t.getCorrectness}))))}function h(t){var e=t.timepoint,n=t.scrollTo,r=t.onClickDelete,i=t.selectedInteractionId,a=t.getCorrectness;function c(n){t.goToTimepoint(e.id,n)}return e.interactions?o().createElement("div",null,e.interactions.map((function(u,l){return o().createElement(v,{interaction:u,visibleAt:e.visibleAt,goToTimepoint:t.goToTimepoint&&c,onClickDelete:r,scrollTo:n,selectedInteractionId:i,isFirstInteraction:0===l,getCorrectness:a,key:l})}))):o().createElement(o().Fragment,null)}function y(t){var e=t.interactive,n=t.goToTimepoint,r=t.selectedInteractionId,a=t.maxHeight,c=t.onClickDelete,u=t.getCorrectness,l=o().useRef();function s(t,e){if(l.current){var n=l.current.getClientHeight(),r=l.current.getScrollTop(),o=t+r;(o<r||o+e>r+n)&&l.current.scrollTop(o-n/2+e/2)}}var f=n?"border rounded":"";return o().createElement(i.Scrollbars,{autoHeight:!0,autoHeightMax:a,className:f,hideTracksWhenNotNeeded:!0,ref:l},o().createElement("div",{className:"px-3 py-1"},e.timepoints.map((function(t,e){return o().createElement(h,{key:e,timepoint:t,goToTimepoint:n,selectedInteractionId:r,scrollTo:s,onClickDelete:c,getCorrectness:u})}))))}},28972:(t,e,n)=>{var r;n.d(e,{w:()=>r}),function(t){t[t.Correct=0]="Correct",t[t.Incorrect=1]="Incorrect",t[t.AwaitingMarking=2]="AwaitingMarking",t[t.Answered=3]="Answered",t[t.UnAnswered=4]="UnAnswered",t[t.NotApplicable=5]="NotApplicable"}(r||(r={}))},99705:(t,e,n)=>{var r,o;n.d(e,{b:()=>o}),function(t){t.AddToPlaylist="115005679748",t.EditSsoAccounts="8202508040345",t.LibraryEditor="360001974533",t.VideoAccess="360000153947",t.AddFromOnline="360011718234",t.UploadToLibraryEditor="360012069334",t.PBTErrorCodes="360012421153",t.ManuelReview="360020004534",t.LibraryReview="360000163788"}(r||(r={})),function(t){t.Integrations="4407268725529",t.Classrooms="4405362551833",t.MakeInteractive="4405370510873",t.EditSsoAccounts="8202605666073",t.UploadToLibraryEditor="10672936659865",t.AddFromLite="10671345281561",t.ManageSsoYearGroups="12522160412313"}(o||(o={}))},76343:(t,e,n)=>{var r;n.d(e,{A:()=>r}),function(t){t[t.View=0]="View",t[t.Create=1]="Create"}(r||(r={}))},38314:(t,e,n)=>{n.d(e,{InteractiveMode:()=>r.A});var r=n(76343)},57052:(t,e,n)=>{n.d(e,{S:()=>fo});var r=n(1024),o=n.n(r),i=n(81886),a=n(56050),c=(n(16852),n(91242),n(93262),n(24967)),u=n(10463),l=n(38314),s=n(84120);function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function d(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==f(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!==f(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key,"string"),"symbol"===f(o)?o:String(o)),r)}var o}function p(){return p="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=m(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},p.apply(this,arguments)}function m(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=y(t)););return t}function v(t,e){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},v(t,e)}function h(t,e){if(e&&("object"===f(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function y(t){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},y(t)}var g=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&v(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=y(r);if(o){var n=y(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return h(this,t)});function a(t,e){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=i.call(this,t,e)).timepoint_=e.timepoint,n.time_=e.timepoint.visibleAt/1e3;var r=e.timepoint.interactions[0];r||n.hide();var o=s.w.getTypeInfo(r.typeId).bgClassName;return n.$(".vjs-icon-placeholder").classList.add(o),n.controlText(r.name),n.update(),n}return e=a,(n=[{key:"buildCSSClass",value:function(){return"cv-interactive-bar-item ".concat(p(y(a.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(t,e,n){return p(y(a.prototype),"createEl",this).call(this,t,Object.assign(Object.assign({},e),{className:this.buildCSSClass()}),Object.assign(Object.assign({},n),{tabIndex:0}))}},{key:"update",value:function(){var t=this.player_.duration(),e=this.time_/t;this.el().style.left=100*e+"%",e>100||e<0?this.hide():this.show()}},{key:"handleClick",value:function(t){t.stopPropagation(),this.player_.currentTime(this.time_)}}])&&d(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(c.Z.getComponent("Button"));function b(t){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b(t)}function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function E(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==b(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!==b(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key,"string"),"symbol"===b(o)?o:String(o)),r)}var o}function S(){return S="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=x(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},S.apply(this,arguments)}function x(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=j(t)););return t}function I(t,e){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},I(t,e)}function k(t,e){if(e&&("object"===b(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return O(t)}function O(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function j(t){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},j(t)}var C=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&I(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=j(r);if(o){var n=j(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return k(this,t)});function a(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=i.call(this,t,e)).track_=e.track,n.interactive_=e.interactive,n.onDurationChange=n.onDurationChange.bind(O(n)),n.createInteractionItems=n.createInteractionItems.bind(O(n)),n.createInteractionItems(),n.track_.on("cv:cuechange",n.createInteractionItems),n.player_.on("durationchange",n.onDurationChange),n.player_.on("dispose",(function(){n.track_.off("cv:cuechange"),n.player_.off("durationchange",n.onDurationChange)})),n}return e=a,(n=[{key:"buildCSSClass",value:function(){return"cv-interactive-bar-items ".concat(S(j(a.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(t,e,n){return S(j(a.prototype),"createEl",this).call(this,t,Object.assign(Object.assign({},e),{className:this.buildCSSClass()}),n)}},{key:"update",value:function(){this.children_.forEach((function(t){t.update()}))}},{key:"createInteractionItems",value:function(){var t,e,n=this;if(this.track_){(e=this.children_,function(t){if(Array.isArray(t))return w(t)}(e)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||function(t,e){if(t){if("string"==typeof t)return w(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(t,e):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).forEach((function(t){n.removeChild(t)}));for(var r=0;r<this.track_.cues.length;r++){var o=this.track_.cues[r],i=this.getTimepointById(o.text);i&&(null===(t=i.interactions)||void 0===t?void 0:t.length)&&this.addChild(new g(this.player_,{timepoint:i}))}}}},{key:"onDurationChange",value:function(){this.update()}},{key:"getTimepointById",value:function(t){var e;return null===(e=this.interactive_.timepoints)||void 0===e?void 0:e.find((function(e){return e.id.toString()===t.toString()}))}}])&&E(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(c.Z.getComponent("Component")),N=n(14735),T=n(76343);function L(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return P(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?P(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var A=n(89476);function _(t){return!!(null==t?void 0:t.toString().startsWith("new_"))}function F(t){return t.error,t.hasChanges,t.submitted,t.spinner,function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(t,["error","hasChanges","submitted","spinner"])}var R=n(2314);function M(t){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M(t)}function U(){U=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),c=new k(o||[]);return r(a,"_invoke",{value:E(t,n,c)}),a}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function d(){}function p(){}function m(){}var v={};u(v,i,(function(){return this}));var h=Object.getPrototypeOf,y=h&&h(h(O([])));y&&y!==e&&n.call(y,i)&&(v=y);var g=m.prototype=d.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(r,i,a,c){var u=s(t[r],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==M(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function E(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=S(a,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=s(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function S(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=s(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:void 0,done:!0}}return p.prototype=m,r(g,"constructor",{value:m,configurable:!0}),r(m,"constructor",{value:p,configurable:!0}),p.displayName=u(m,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new w(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=O,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(I),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),I(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;I(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:O(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function D(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==M(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!==M(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key,"string"),"symbol"===M(o)?o:String(o)),r)}var o}var G=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function c(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}u((r=r.apply(t,e||[])).next())}))},q=function(t){return"/api/domain/v1/interactions/".concat(t)},B=function(t){return"/api/domain/v1/timepoints/".concat(t)},W={},z=new(function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n;return e=t,(n=[{key:"saveInteraction",value:function(t){return G(this,void 0,void 0,U().mark((function e(){var n,r,o,i,a;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=_(t.id),r=n?"/api/domain/v1/interactions/bulk":(c=t.id,"/api/domain/v1/interactions/bulk/".concat(c)),o={name:t.name,data:t.data,timepointId:t.timepointId,interactiveId:t.interactiveId,typeId:t.typeId,actionableItems:t.actionableItems,order:t.order},n||(o.id=t.id),i=n?R.e.post(r,JSON.stringify(o),W):R.e.put(r,JSON.stringify(o),W),e.next=7,i;case 7:a=e.sent,n&&(t.id=a.id);case 9:case"end":return e.stop()}var c}),e)})))}},{key:"deleteInteraction",value:function(t){return G(this,void 0,void 0,U().mark((function e(){return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,R.e.delete(q(t),W);case 2:case"end":return e.stop()}}),e)})))}},{key:"saveTimepoint",value:function(t){return G(this,void 0,void 0,U().mark((function e(){var n,r;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={interactiveId:t.interactiveId,shouldPause:1,visibleAt:t.visibleAt},e.next=3,R.e.post("/api/domain/v1/timepoints",JSON.stringify(n),W);case 3:r=e.sent,t.id=r.id;case 5:case"end":return e.stop()}}),e)})))}},{key:"updateTimepoint",value:function(t){return G(this,void 0,void 0,U().mark((function e(){return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,R.e.put((n=t.id,"/api/domain/v1/timepoints/".concat(n)),JSON.stringify(t),W);case 2:case"end":return e.stop()}var n}),e)})))}},{key:"deleteTimepoint",value:function(t){return G(this,void 0,void 0,U().mark((function e(){return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,R.e.delete(B(t),W);case 2:case"end":return e.stop()}}),e)})))}}])&&D(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}()),Y=n(497),Z=n(53957),V=n(17082);function H(t){var e=t.error;return t.error?o().createElement("p",{className:"mt-2 small text-danger"},e):o().createElement(o().Fragment,null)}var $=n(11607);function K(t){return K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},K(t)}function Q(){Q=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),c=new k(o||[]);return r(a,"_invoke",{value:E(t,n,c)}),a}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function d(){}function p(){}function m(){}var v={};u(v,i,(function(){return this}));var h=Object.getPrototypeOf,y=h&&h(h(O([])));y&&y!==e&&n.call(y,i)&&(v=y);var g=m.prototype=d.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(r,i,a,c){var u=s(t[r],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==K(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function E(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=S(a,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=s(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function S(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=s(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:void 0,done:!0}}return p.prototype=m,r(g,"constructor",{value:m,configurable:!0}),r(m,"constructor",{value:p,configurable:!0}),p.displayName=u(m,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new w(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=O,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(I),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),I(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;I(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:O(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}var J=/[.\?!,;:\-''\(\)]/g;function X(t){for(var e=t.split("");e.length&&e[0].match(J);)e.shift();for(;e.length&&e[e.length-1].match(J);)e.pop();return e.join("")}function tt(t,e){for(var n=t.split(""),r=[],o=[];n.length&&n[0].match(J);)r.push(n.shift());for(;n.length&&n[n.length-1].match(J);)o.unshift(n.pop());return r.join("")+e+o.join("")}function et(t){return t.map((function(t){if(!t.selected)return t.text;var e=X(t.text).length,n=new Array(e).fill("_").join("");return tt(t.text,n)})).join(" ")}function nt(t){return t.map((function(t){var e;return t.selected?null===(e=tt(t.text,"{".concat(t.order,"}")))||void 0===e?void 0:e.trim():t.text})).join(" ")}var rt=n(56108),ot=n(36532),it=n(83914),at=n(58130);function ct(t){return o().createElement(ot.u,{title:t.tooltipText,spanHack:!0,spanHackClassName:"d-inline-block"},o().createElement(it.x,{svgName:at.vn.Info}))}function ut(t){return ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ut(t)}function lt(){lt=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),c=new k(o||[]);return r(a,"_invoke",{value:E(t,n,c)}),a}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function d(){}function p(){}function m(){}var v={};u(v,i,(function(){return this}));var h=Object.getPrototypeOf,y=h&&h(h(O([])));y&&y!==e&&n.call(y,i)&&(v=y);var g=m.prototype=d.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(r,i,a,c){var u=s(t[r],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==ut(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function E(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=S(a,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=s(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function S(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=s(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:void 0,done:!0}}return p.prototype=m,r(g,"constructor",{value:m,configurable:!0}),r(m,"constructor",{value:p,configurable:!0}),p.displayName=u(m,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new w(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=O,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(I),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),I(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;I(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:O(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}var st=n(75896);function ft(t){var e=o().useRef(null);function n(){t.onChange(Object.assign(Object.assign({},t.answer),{isCorrect:!t.answer.isCorrect}))}return o().createElement("li",{className:"p-1 my-1 w-100 bg-white d-flex align-items-center border rounded"},o().createElement("div",{className:"custom-control ".concat(t.isTrueOrFalse?"custom-radio":"custom-checkbox"),onKeyDown:function(t){return"Enter"===t.key&&n()}},o().createElement("input",{id:"multiple-choice--".concat(t.answer.order),type:t.isTrueOrFalse?"radio":"checkbox",className:"custom-control-input mr-2",name:"multiple-choice-answer",checked:t.answer.isCorrect,onChange:n,disabled:!t.answer.name}),o().createElement("label",{ref:e,htmlFor:"multiple-choice--".concat(t.answer.order),className:"cursor-pointer custom-control-label"})),t.isTrueOrFalse?o().createElement("label",{className:"mb-0",htmlFor:"multiple-choice--".concat(t.answer.order)},t.answer.name):o().createElement("input",{placeholder:"Answer",onChange:function(e){t.onChange(Object.assign(Object.assign({},t.answer),{name:e.target.value}))},value:t.answer.name,className:"border-0 outline-none w-100",autoComplete:"off"}))}function dt(t){return dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dt(t)}function pt(){pt=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),c=new k(o||[]);return r(a,"_invoke",{value:E(t,n,c)}),a}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function d(){}function p(){}function m(){}var v={};u(v,i,(function(){return this}));var h=Object.getPrototypeOf,y=h&&h(h(O([])));y&&y!==e&&n.call(y,i)&&(v=y);var g=m.prototype=d.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(r,i,a,c){var u=s(t[r],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==dt(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function E(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=S(a,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=s(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function S(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=s(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:void 0,done:!0}}return p.prototype=m,r(g,"constructor",{value:m,configurable:!0}),r(m,"constructor",{value:p,configurable:!0}),p.displayName=u(m,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new w(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=O,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(I),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),I(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;I(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:O(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function mt(t){var e;if(!(null===(e=t.question)||void 0===e?void 0:e.trim()))return"Please provide a question";if(!t.answers.find((function(t){return t.isCorrect})))return"Please select the correct answer";var n=t.answers.filter((function(t){var e;return!!(null===(e=t.name)||void 0===e?void 0:e.trim())}));if(n.length<2)return"Please provide at least two answers";var r=!1,o={};return n.forEach((function(t){r||(o[t.name]?r=!0:o[t.name]=!0)})),r?"There are duplicates in your answers":null}function vt(t,e){var n,r,o,i,a;return r=this,o=void 0,i=void 0,a=pt().mark((function r(){return pt().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return e.name=null===(n=t.question)||void 0===n?void 0:n.trim(),e.actionableItems=t.answers.filter((function(t){var e;return!!(null===(e=t.name)||void 0===e?void 0:e.trim())})),t.feedback&&(e.data.feedback=t.feedback),r.next=5,z.saveInteraction(e);case 5:case"end":return r.stop()}}),r)})),new(i||(i=Promise))((function(t,e){function n(t){try{u(a.next(t))}catch(t){e(t)}}function c(t){try{u(a.throw(t))}catch(t){e(t)}}function u(e){var r;e.done?t(e.value):(r=e.value,r instanceof i?r:new i((function(t){t(r)}))).then(n,c)}u((a=a.apply(r,o||[])).next())}))}function ht(t){var e=t.state,n=void 0===e?function(t){var e,n=t.typeId===Z.InteractionTypeId.TrueOrFalse,r=null===(e=t.actionableItems)||void 0===e?void 0:e.map((function(t){return{order:t.order,name:t.name,isCorrect:t.isCorrect}}));return(null==r?void 0:r.length)?!n&&(null==r?void 0:r.length)<4&&r.push({order:r.length,name:"",isCorrect:!1}):r=[{order:0,name:n?"True":"",isCorrect:!1},{order:1,name:n?"False":"",isCorrect:!1}],{question:t.name||"",answers:r,feedback:t.data.feedback||""}}(t.interaction):e,r=t.setState,i=t.interaction,a=t.optionsPortalNode,c=t.showFeedback,u=i.typeId===Z.InteractionTypeId.TrueOrFalse;function l(t){var e,o,i=n.answers.map((function(e){return e.order!==t.order?Object.assign(Object.assign({},e),{isCorrect:!u&&e.isCorrect}):t}));if(i.find((function(t){return!t.name}))&&(o=(e=i).find((function(t){return!t.name})),i=e.length>2?e.filter((function(t){return t.order!==o.order})).map((function(t,e){return Object.assign(Object.assign({},t),{order:e})})):e.map((function(t){return t.order!==o.order?t:Object.assign(Object.assign({},t),{isCorrect:!1})}))),!u&&i.length<4&&!i.find((function(t){return!t.name}))){var a=st.m.last(i);i.push({name:"",order:a.order+1,isCorrect:!1})}r(Object.assign(Object.assign({},n),{answers:i}))}return o().createElement("div",{className:"cv-interactive-question"},o().createElement("div",{className:"form-group"},o().createElement("div",{className:"d-flex justify-content-between align-items-center mb-1"},o().createElement("label",{className:"cv-interaction-field-label mb-0",htmlFor:"multiple-choice-question"},"Question"),o().createElement(V.t0,{node:a})),o().createElement("input",{id:"multiple-choice-question",className:"form-control",placeholder:"Enter your question here",value:n.question,onChange:function(t){r(Object.assign(Object.assign({},n),{question:t.target.value}))},autoComplete:"off"}),!n.question&&o().createElement(H,{error:n.error})),o().createElement("div",{className:"form-group"},o().createElement("label",{className:"cv-interaction-field-label",htmlFor:"multiple-choice-answer"},"Answers"),n.answers.map((function(t){return o().createElement(ft,{key:t.order,answer:t,onChange:l,isTrueOrFalse:u})})),n.question&&o().createElement(H,{error:n.error})),c&&u&&o().createElement("div",{className:"form-group mb-0"},o().createElement("label",{className:"cv-true-or-false-feedback-label cv-interaction-field-label",htmlFor:"true-or-false-feedback"},"Feedback  ",o().createElement("span",{className:"text-muted"},"(optional)")," ",o().createElement(ct,{tooltipText:"Provide answer feedback for your students"})),o().createElement(rt.Z,{id:"true-or-false-feedback",className:"form-control",minRows:2,value:n.feedback||"",onChange:function(t){r(Object.assign(Object.assign({},n),{feedback:t.target.value}))},placeholder:"Give feedback for this question"})))}var yt=n(79483),gt=n(54610),bt=n(45368);function wt(){return o().createElement("svg",{viewBox:"0 0 43 38",className:"cv-upload-image-icon"},o().createElement("g",{transform:"translate(-1193.000000, -185.000000)"},o().createElement("g",{transform:"translate(1183.000000, 173.000000)"},o().createElement("path",{d:"M49.875,12.9166667 C51.3247475,12.9166667 52.5,14.0732644 52.5,15.5 L52.5,46.5 C52.5,47.9267356 51.3247475,49.0833333 49.875,49.0833333 L13.125,49.0833333 C11.6752525,49.0833333 10.5,47.9267356 10.5,46.5 L10.5,15.5 C10.5,14.0732644 11.6752525,12.9166667 13.125,12.9166667 L49.875,12.9166667 Z M49.875,15.5 L13.125,15.5 L13.125,46.5 L49.875,46.5 L49.875,15.5 Z M35.5085905,22.5470241 L45.7260956,38.0470241 C46.1206004,38.6454897 45.9474325,39.445375 45.3393142,39.8336178 C44.731196,40.2218607 43.9184093,40.0514415 43.5239044,39.4529759 L34.3641741,25.5576247 L29.9489593,31.7425222 C29.4803332,32.3989804 28.5233602,32.4806343 27.9469223,31.9133463 L26.3920049,30.38311 L19.425,39.525 C18.9900758,40.0956942 18.167399,40.211354 17.5875,39.7833333 C17.007601,39.3553127 16.8900758,38.5456942 17.325,37.975 L25.2,27.6416667 C25.6792326,27.0128323 26.6132966,26.9475041 27.1780777,27.5033204 L28.6987913,28.9998957 L33.3335357,22.5074778 C33.8680838,21.758675 35.0025121,21.7793009 35.5085905,22.5470241 Z M21,19.375 C23.1746212,19.375 24.9375,21.1098966 24.9375,23.25 C24.9375,25.3901034 23.1746212,27.125 21,27.125 C18.8253788,27.125 17.0625,25.3901034 17.0625,23.25 C17.0625,21.1098966 18.8253788,19.375 21,19.375 Z M21,21.9583333 C20.2751263,21.9583333 19.6875,22.5366322 19.6875,23.25 C19.6875,23.9633678 20.2751263,24.5416667 21,24.5416667 C21.7248737,24.5416667 22.3125,23.9633678 22.3125,23.25 C22.3125,22.5366322 21.7248737,21.9583333 21,21.9583333 Z",id:"Combined-Shape"}))))}function Et(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return St(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?St(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function St(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function xt(t){var e=Et(o().useState(!1),2),n=e[0],r=e[1],i=Et(o().useState(0),2),a=i[0],c=i[1];return o().useEffect((function(){0===a&&n&&r(!1)}),[a,n,r]),o().createElement("div",{onDragOver:function(t){t.preventDefault(),t.stopPropagation()},onDragEnter:function(t){t.preventDefault(),t.stopPropagation(),c((function(t){return t+1})),t.dataTransfer.items&&t.dataTransfer.items.length>0&&!n&&r(!0)},onDragLeave:function(t){t.preventDefault(),t.stopPropagation(),c((function(t){return t-1}))},onDrop:function(e){e.preventDefault(),e.stopPropagation(),r(!1),a>0&&c(0),e.dataTransfer.files&&e.dataTransfer.files.length>0&&(t.onDropImage(e.dataTransfer.files),e.dataTransfer.clearData())},className:n?"cv-image-upload-mask":""},t.children)}function It(t){return It="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},It(t)}function kt(){kt=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),c=new k(o||[]);return r(a,"_invoke",{value:E(t,n,c)}),a}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function d(){}function p(){}function m(){}var v={};u(v,i,(function(){return this}));var h=Object.getPrototypeOf,y=h&&h(h(O([])));y&&y!==e&&n.call(y,i)&&(v=y);var g=m.prototype=d.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(r,i,a,c){var u=s(t[r],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==It(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function E(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=S(a,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=s(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function S(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=s(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:void 0,done:!0}}return p.prototype=m,r(g,"constructor",{value:m,configurable:!0}),r(m,"constructor",{value:p,configurable:!0}),p.displayName=u(m,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new w(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=O,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(I),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),I(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;I(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:O(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}var Ot=n(6880),jt=n(10671),Ct=n(84891),Nt={styleToHTML:function(t){return"SUPERSCRIPT"===t?{start:"<sup>",end:"</sup>"}:"SUBSCRIPT"===t?{start:"<sub>",end:"</sub>"}:void 0},entityToHTML:function(t,e){return"LINK"===t.type?o().createElement("a",{href:t.data.url},e):e},htmlToStyle:function(t,e,n){return"sup"===t?n.add("SUPERSCRIPT"):"sub"===t?n.add("SUBSCRIPT"):n},htmlToEntity:function(t,e,n){if("a"===t)return n("LINK","MUTABLE",{url:e.href})}};function Tt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Lt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lt(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Lt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Pt(t){var e=Tt(o().useState(""),2),n=e[0],r=e[1],i=Tt(o().useState(""),2),a=i[0],c=i[1];return o().createElement("div",{"aria-haspopup":"true","aria-expanded":t.expanded,"aria-label":"rdw-color-picker"},o().createElement("div",{className:"rdw-option-wrapper cv-annotation-toolbar-option cv-annotation-link",onClick:t.onExpandEvent}," "),t.expanded&&o().createElement("div",{className:"rdw-link-modal",onClick:function(t){return t.stopPropagation()}},o().createElement("div",{className:"form-group"},o().createElement("label",{className:"cv-interaction-field-label",htmlFor:"cv-annotation-url"},"URL"),o().createElement("input",{id:"cv-annotation-url",className:"form-control",onChange:function(t){return r(t.target.value)},value:n,placeholder:"Enter URL",autoComplete:"off"})),o().createElement("div",{className:"form-group"},o().createElement("label",{className:"cv-interaction-field-label",htmlFor:"cv-annotation-text"},"Text"),o().createElement("input",{id:"cv-annotation-text",className:"form-control",onChange:function(t){return c(t.target.value)},value:a,placeholder:"Enter Text",autoComplete:"off"})),o().createElement($.L,{onClick:function(){return t.onChange("link",a||n,n,"_blank")},className:"btn btn-dark"},"Add")))}function At(t){return At="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},At(t)}function _t(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Ft(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ft(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ft(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Rt(){Rt=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),c=new k(o||[]);return r(a,"_invoke",{value:E(t,n,c)}),a}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function d(){}function p(){}function m(){}var v={};u(v,i,(function(){return this}));var h=Object.getPrototypeOf,y=h&&h(h(O([])));y&&y!==e&&n.call(y,i)&&(v=y);var g=m.prototype=d.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(r,i,a,c){var u=s(t[r],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==At(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function E(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=S(a,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=s(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function S(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=s(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:void 0,done:!0}}return p.prototype=m,r(g,"constructor",{value:m,configurable:!0}),r(m,"constructor",{value:p,configurable:!0}),p.displayName=u(m,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new w(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=O,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(I),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),I(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;I(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:O(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}var Mt,Ut,Dt;function Gt(t){return Gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gt(t)}function qt(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==Gt(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!==Gt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"===Gt(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Bt=(qt(Mt={},Z.InteractionTypeId.Annotation,(function(t){var e=t.state,n=void 0===e?function(t){var e;return{annotation:(null===(e=t.data)||void 0===e?void 0:e.annotation)||""}}(t.interaction):e,r=t.setState,i=t.interaction,a=t.optionsPortalNode,c=_t(o().useState(function(){var t=i.data.annotation;if(t){var e=(0,Ct.h4)(Nt)(t);return Ot.EditorState.createWithContent(e)}return Ot.EditorState.createEmpty()}()),2),u=c[0],l=c[1],s=_t(o().useState(null),2),f=s[0],d=s[1];return o().createElement("div",{className:"cv-interactive-question"},o().createElement("div",{className:"form-group"},o().createElement("div",{className:"d-flex justify-content-between align-items-center mb-1"},o().createElement("label",{className:"cv-interaction-field-label mb-0",onClick:function(){return null==f?void 0:f.focusEditor()}},"Annotation"),o().createElement(V.t0,{node:a})),o().createElement("div",{className:"cv-annotation ".concat(function(){if(!u)return!1;var t=u.getCurrentContent();return t.hasText()||"unstyled"!==t.getBlockMap().first().getType()}()?"Editor--hide-placeholder":"")},u&&o().createElement(jt.Editor,{editorState:u,onEditorStateChange:function(t){l(t);var e=t.getCurrentContent();if(e.hasText()){var o=(0,Ct.cn)(Nt)(e);r(Object.assign(Object.assign({},n),{annotation:o}))}else r(Object.assign(Object.assign({},n),{annotation:""}))},toolbarClassName:"cv-annotation-toolbar",editorClassName:"form-control cv-annotation-editor",ref:d,placeholder:"Enter your annotation here",spellCheck:!0,toolbar:{options:["inline","list","link"],inline:{options:["bold","italic","underline","superscript","subscript"],bold:{className:"cv-annotation-toolbar-option cv-annotation-bold",icon:""},italic:{className:"cv-annotation-toolbar-option cv-annotation-italic",icon:""},underline:{className:"cv-annotation-toolbar-option cv-annotation-underline",icon:""},superscript:{className:"cv-annotation-toolbar-option cv-annotation-superscript",icon:""},subscript:{className:"cv-annotation-toolbar-option cv-annotation-subscript",icon:""}},list:{options:["unordered","ordered"],unordered:{className:"cv-annotation-toolbar-option cv-annotation-bullet-list",icon:""},ordered:{className:"cv-annotation-toolbar-option cv-annotation-number-list",icon:""}},link:{component:Pt,options:["link"]}}}),o().createElement(H,{error:n.error}))))})),qt(Mt,Z.InteractionTypeId.Image,(function(t){var e=t.state,n=void 0===e?function(t){var e;return{url:(null===(e=t.data)||void 0===e?void 0:e.url)||"",caption:t.data.caption}}(t.interaction):e,r=t.setState,i=t.interaction,a=t.optionsPortalNode;(0,bt.R)();var c=o().useRef(null);function u(t){t&&t[0]&&yt.J.onFileSelect(gt.__.None,t,(function(t){Y.M.renderCropper({src:t.src,alt:"",onClickCrop:l})}))}function l(e,o){var i=e.split(",")[1];R.e.post("".concat(t.imageApi,"v2/thumbnails/base64"),'"'.concat(i,'"'),{tokenName:"gateway"}).then((function(t){r(Object.assign(Object.assign({},n),{url:t.location})),o()})).catch((function(){return alert("Something went wrong while trying to upload image. Please try again.")}))}return o().createElement("div",{className:"cv-interactive-question"},o().createElement("div",{className:"form-group"},o().createElement("div",{className:"d-flex justify-content-between align-items-center mb-1"},o().createElement("label",{className:"cv-interaction-field-label mb-0"},"Image"),o().createElement(V.t0,{node:a})),n.url?o().createElement("div",{className:"text-center"},o().createElement("div",{className:"cv-uploaded-image-container"},o().createElement("img",{className:"img img-fluid",src:n.url,alt:n.caption}),o().createElement($.L,{className:"cv-remove-uploaded-image d-flex justify-content-center align-items-center",onClick:function(){r(Object.assign(Object.assign({},n),{url:""}))}},o().createElement("div",{className:"btn btn-link text-light"},"Remove")))):o().createElement(xt,{onDropImage:u},o().createElement("div",{className:"cv-image-interaction-upload-container rounded py-4 text-center"},o().createElement("div",{className:"svg-container xlg mb-2"},o().createElement(wt,null)),o().createElement("p",{className:"mb-0"},"Drag and drop an image file or"),o().createElement($.L,{type:"button",className:"text-underline d-inline-block",onClick:function(){c.current.value=null,c.current.click(null)}},"upload from your device"),o().createElement("input",{type:"file",autoComplete:"off",className:"file-select d-none",multiple:!1,accept:"image/jpg,image/jpeg,image/png",ref:c,onChange:function(t){return u(t.target.files)}}))),o().createElement(H,{error:n.error})),o().createElement("div",{className:"form-group"},o().createElement("label",{className:"cv-interaction-field-label",htmlFor:"image-caption"},"Caption  ",o().createElement("span",{className:"text-muted"},"(optional)")),o().createElement("textarea",{id:"image-caption",className:"form-control",placeholder:"Caption your image",value:n.caption||i.data.caption||"",onChange:function(t){r(Object.assign(Object.assign({},n),{caption:t.target.value}))},rows:2})))})),qt(Mt,Z.InteractionTypeId.MissingWord,(function(t){var e,n,r,i,a,c,u=t.state,l=void 0===u?(i=(null===(n=(e=t.interaction).data)||void 0===n?void 0:n.sentence)||"",a=i.split(" ").filter(Boolean),c=a.map((function(t,e){return{text:t,order:e,selected:!1}})),null===(r=e.actionableItems)||void 0===r||r.forEach((function(t){var e=t.order,n=tt(a[e],t.name);a[e]=n,c[e].text=n,c[e].selected=!0})),{fullSentence:a.join(" "),sentence:i,preview:e.name,words:c}):u,s=t.setState,f=t.optionsPortalNode,d=!!l.sentence;return o().createElement("div",{className:"cv-interactive-question"},o().createElement("div",{className:"form-group"},o().createElement("div",{className:"d-flex justify-content-between align-items-center mb-1"},o().createElement("label",{className:"cv-interaction-field-label mb-0",htmlFor:"missing-word-sentence"},"Sentence"),o().createElement(V.t0,{node:f})),o().createElement("input",{id:"missing-word-sentence",className:"form-control",placeholder:"Enter your sentence here",value:l.fullSentence||"",onChange:function(t){var e=t.target.value,n=e.split(" ").filter(Boolean).map((function(t,e){return{text:t,order:e,selected:!1}}));s(Object.assign(Object.assign({},l),{fullSentence:e,sentence:nt(n),preview:et(n),words:n}))},autoComplete:"off"})),d&&o().createElement(o().Fragment,null,o().createElement("div",{className:"form-group"},o().createElement("label",{className:"cv-interaction-field-label"},"Select the missing word(s)"),o().createElement("ul",{className:"list-unstyled d-flex flex-wrap mx-n1 mb-n1"},l.words.map((function(t,e){var n;return(null===(n=X(t.text))||void 0===n?void 0:n.trim())?o().createElement("li",{key:"".concat(e,"-").concat(t.text)},o().createElement($.L,{className:"rounded border p-2 mx-1 mb-1 cursor-pointer ".concat(t.selected?"bg-info text-white":"bg-white"),onClick:function(){return t=e,n=l.words.map((function(e){return e.order!==t?e:Object.assign(Object.assign({},e),{selected:!e.selected})})),void s(Object.assign(Object.assign({},l),{words:n,preview:et(n),sentence:nt(n)}));var t,n}},X(t.text))):o().createElement(o().Fragment,{key:"".concat(e,"-").concat(t.text)})})))),o().createElement("div",null,o().createElement("label",{className:"cv-interaction-field-label"},"Preview"),o().createElement("p",null,l.preview))),o().createElement(H,{error:l.error}))})),qt(Mt,Z.InteractionTypeId.MultipleChoice,ht),qt(Mt,Z.InteractionTypeId.ShortAnswer,(function(t){var e=t.state,n=void 0===e?function(t){return{question:t.name,suggestedResponse:t.data.suggestedResponse||""}}(t.interaction):e,r=t.setState,i=t.interaction,a=t.optionsPortalNode,c=t.showFeedback;return o().createElement("div",{className:"cv-interactive-question"},o().createElement("div",{className:"form-group"},o().createElement("div",{className:"d-flex justify-content-between align-items-center mb-1"},o().createElement("label",{className:"cv-interaction-field-label mb-0",htmlFor:"short-answer-question"},"Question"),o().createElement(V.t0,{node:a})),o().createElement("input",{id:"short-answer-question",className:"form-control",onChange:function(t){r(Object.assign(Object.assign({},n),{question:t.target.value}))},value:n.question||i.data.text||"",placeholder:"Enter your question here",autoComplete:"off"}),o().createElement(H,{error:n.error})),c&&o().createElement("div",{className:"form-group"},o().createElement("label",{className:"cv-interaction-field-label",htmlFor:"short-answer-suggested-response"},"Suggested Response  ",o().createElement("span",{className:"text-muted"},"(optional)")," ",o().createElement(ct,{tooltipText:"Provide a suggested response for your students"})),o().createElement(rt.Z,{id:"short-answer-suggested-response",className:"form-control",minRows:2,value:n.suggestedResponse||"",onChange:function(t){r(Object.assign(Object.assign({},n),{suggestedResponse:t.target.value}))},placeholder:"Give a suggested response for this question"})))})),qt(Mt,Z.InteractionTypeId.TrueOrFalse,ht),Mt),Wt=(qt(Ut={},Z.InteractionTypeId.Annotation,(function(t){var e;return(null===(e=t.annotation)||void 0===e?void 0:e.trim())?null:"Please provide an annotation"})),qt(Ut,Z.InteractionTypeId.Image,(function(t){return t.url?null:"Please upload an image"})),qt(Ut,Z.InteractionTypeId.MissingWord,(function(t){var e;return(null===(e=t.sentence)||void 0===e?void 0:e.trim())?t.words.find((function(t){return t.selected}))?null:"Please select a missing word":"Please provide a sentence"})),qt(Ut,Z.InteractionTypeId.MultipleChoice,mt),qt(Ut,Z.InteractionTypeId.ShortAnswer,(function(t){var e;return(null===(e=t.question)||void 0===e?void 0:e.trim())?null:"Please provide a question"})),qt(Ut,Z.InteractionTypeId.TrueOrFalse,mt),Ut),zt=(qt(Dt={},Z.InteractionTypeId.Annotation,(function(t,e){var n,r,o,i,a;return r=this,o=void 0,i=void 0,a=Rt().mark((function r(){return Rt().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return e.name="Annotation",e.data.annotation=null===(n=t.annotation)||void 0===n?void 0:n.trim(),e.actionableItems=[{name:"Answer"}],r.next=5,z.saveInteraction(e);case 5:case"end":return r.stop()}}),r)})),new(i||(i=Promise))((function(t,e){function n(t){try{u(a.next(t))}catch(t){e(t)}}function c(t){try{u(a.throw(t))}catch(t){e(t)}}function u(e){var r;e.done?t(e.value):(r=e.value,r instanceof i?r:new i((function(t){t(r)}))).then(n,c)}u((a=a.apply(r,o||[])).next())}))})),qt(Dt,Z.InteractionTypeId.Image,(function(t,e){var n,r,o,i,a,c;return o=this,i=void 0,a=void 0,c=kt().mark((function o(){return kt().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return e.data.url=t.url,e.name=(null===(n=t.caption)||void 0===n?void 0:n.trim())||"Image",e.data.caption=null===(r=t.caption)||void 0===r?void 0:r.trim(),e.actionableItems=[{name:"Answer"}],o.next=6,z.saveInteraction(e);case 6:case"end":return o.stop()}}),o)})),new(a||(a=Promise))((function(t,e){function n(t){try{u(c.next(t))}catch(t){e(t)}}function r(t){try{u(c.throw(t))}catch(t){e(t)}}function u(e){var o;e.done?t(e.value):(o=e.value,o instanceof a?o:new a((function(t){t(o)}))).then(n,r)}u((c=c.apply(o,i||[])).next())}))})),qt(Dt,Z.InteractionTypeId.MissingWord,(function(t,e){return n=this,r=void 0,o=void 0,i=Q().mark((function n(){var r;return Q().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e.data.sentence=nt(t.words),e.name=t.preview,r=t.words.filter((function(t){return t.selected})),e.actionableItems=r.map((function(t){return{name:X(t.text),order:t.order,isCorrect:!0}})),n.next=6,z.saveInteraction(e);case 6:case"end":return n.stop()}}),n)})),new(o||(o=Promise))((function(t,e){function a(t){try{u(i.next(t))}catch(t){e(t)}}function c(t){try{u(i.throw(t))}catch(t){e(t)}}function u(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(a,c)}u((i=i.apply(n,r||[])).next())}));var n,r,o,i})),qt(Dt,Z.InteractionTypeId.MultipleChoice,vt),qt(Dt,Z.InteractionTypeId.ShortAnswer,(function(t,e){var n,r,o,i,a,c;return o=this,i=void 0,a=void 0,c=lt().mark((function o(){return lt().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return e.name=null===(n=t.question)||void 0===n?void 0:n.trim(),e.data.suggestedResponse=null===(r=t.suggestedResponse)||void 0===r?void 0:r.trim(),e.actionableItems=[{name:"Answer"}],o.next=5,z.saveInteraction(e);case 5:case"end":return o.stop()}}),o)})),new(a||(a=Promise))((function(t,e){function n(t){try{u(c.next(t))}catch(t){e(t)}}function r(t){try{u(c.throw(t))}catch(t){e(t)}}function u(e){var o;e.done?t(e.value):(o=e.value,o instanceof a?o:new a((function(t){t(o)}))).then(n,r)}u((c=c.apply(o,i||[])).next())}))})),qt(Dt,Z.InteractionTypeId.TrueOrFalse,vt),Dt);function Yt(t){return zt[t]}var Zt=n(25723),Vt=n(65858),Ht=["A","B","C","D"];function $t(t){if(!t.enableImmersiveReader)return o().createElement(o().Fragment,null);var e=t.interaction,n=t.className,r=s.w.getTypeInfo(e.typeId),i=r.name,a=r.typeName,c="";switch(e.typeId){case Z.InteractionTypeId.Annotation:c=e.data.annotation;break;case Z.InteractionTypeId.Image:c=e.data.caption;break;case Z.InteractionTypeId.MissingWord:c=e.data.sentence.replace(/{([^{}]*)}/g,(function(){return"<u>&nbsp;&nbsp;&nbsp;&nbsp;</u>"}));break;case Z.InteractionTypeId.MultipleChoice:c=e.name,e.actionableItems.map((function(t,e){return c+="<br />".concat(Ht[e],": ").concat(t.name)}));break;case Z.InteractionTypeId.ShortAnswer:c=e.name;break;case Z.InteractionTypeId.TrueOrFalse:c="True or false: ".concat(e.name)}var u=e.typeId===Z.InteractionTypeId.Annotation||e.typeId===Z.InteractionTypeId.MissingWord||e.typeId===Z.InteractionTypeId.MultipleChoice;return o().createElement(Zt.m,{title:i,text:c,html:u,className:"pr-2 ".concat(n||""),analyticsData:{id:e.interactiveId,type:a},analyticsOptions:{location:Vt.LocationContext.InteractivePlayer,entity:Vt.EntityType.Interactive,actionType:Vt.UserAction.Click,descriptor:Vt.ClickDescriptor.LaunchImmersiveReader}})}function Kt(t){var e=t.error;return t.error?o().createElement("p",{className:"mt-2 small text-danger"},e):o().createElement(o().Fragment,null)}var Qt,Jt,Xt=n(28972);function te(t){return te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},te(t)}function ee(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==te(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!==te(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"===te(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ne(){return Xt.w.NotApplicable}function re(t,e){var n=t.actionableItems.filter((function(t){return t.isCorrect}));return n.every((function(t){return!e(t.id)}))?Xt.w.UnAnswered:n.every((function(t){var n;return t.name.trim().toLowerCase()===(null===(n=e(t.id))||void 0===n?void 0:n.trim().toLowerCase())}))?Xt.w.Correct:Xt.w.Incorrect}function oe(t,e){return t.actionableItems.every((function(t){return!e(t.id)}))?Xt.w.UnAnswered:t.actionableItems.filter((function(t){return t.isCorrect})).every((function(t){return e(t.id)===t.name}))?Xt.w.Correct:Xt.w.Incorrect}function ie(t,e){var n;return t.actionableItems.forEach((function(t){var r=e(t.id);n=r?r.status!==Qt.Correct?r.status!==Qt.Incorrect?Xt.w.AwaitingMarking:Xt.w.Incorrect:Xt.w.Correct:Xt.w.UnAnswered})),n}function ae(t,e){return function(n){var r=e.attempts.find((function(e){return e.id===t.id}));return null==r?void 0:r.answers.find((function(t){return t.id===n}))}}function ce(t,e){var n=ae(t,e);return oe(t,(function(t){var e=n(t);return null==e?void 0:e.text}))}!function(t){t[t.Incorrect=0]="Incorrect",t[t.Correct=1]="Correct",t[t.PendingReview=2]="PendingReview"}(Qt||(Qt={}));var ue=(ee(Jt={},Z.InteractionTypeId.Annotation,ne),ee(Jt,Z.InteractionTypeId.Image,ne),ee(Jt,Z.InteractionTypeId.MissingWord,(function(t,e){var n=ae(t,e);return re(t,(function(t){var e=n(t);return null==e?void 0:e.text}))})),ee(Jt,Z.InteractionTypeId.MultipleChoice,ce),ee(Jt,Z.InteractionTypeId.ShortAnswer,(function(t,e){return ie(t,ae(t,e))})),ee(Jt,Z.InteractionTypeId.TrueOrFalse,ce),Jt),le={notApplicable:ne,awaitingMarking:function(){return Xt.w.AwaitingMarking},isMissingWordCorrect:re,isMultipleChoiceCorrect:oe,isShortAnswerMarkedCorrect:ie,isInteractionCorrect:function(t,e){return(0,ue[t.typeId])(t,e)}};function se(t){return se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},se(t)}var fe="cv-missing-word-",de=n(55452),pe=n(20789);var me=["A","B","C","D"];function ve(t){var e=1===t.interaction.actionableItems.filter((function(t){return t.isCorrect})).length;function n(e,n){t.onSelectAnswer&&t.onSelectAnswer(e,n)}return o().createElement(o().Fragment,null,t.interaction.actionableItems.map((function(r,i){var a=t.getSelectedAnswer(r.id);if(t.onlyShowSelectedAnswer&&!a)return o().createElement(o().Fragment,{key:i});var c=a?"bg-info text-white":t.unCheckedBackground,u=function(){return o().createElement(o().Fragment,null,me[i])};t.showFeedback&&(c=r.isCorrect?"bg-success text-white":"bg-danger text-white ".concat("yodaE"),t.hideFeedbackIcons||(u=function(){return o().createElement(o().Fragment,null,r.isCorrect?o().createElement(it.x,{size:it.S.Small,svgName:at.vn.Check}):o().createElement(it.x,{size:it.S.Small,svgName:at.vn.Close}))}));var l=t.showFeedback?{}:{role:"button",tabIndex:0,onKeyDown:function(t){return"Enter"===t.key&&n(r,!a)}};return o().createElement(o().Fragment,{key:i},o().createElement("input",{id:r.id,type:e?"radio":"checkbox",name:"multiple-choice",checked:!!a,onChange:function(){return n(r,!a)},disabled:t.showFeedback,hidden:!0,tabIndex:-1}),o().createElement("label",Object.assign({className:"\n d-block\n rounded-lg\n shadow-sm\n mb-2\n ".concat("sm"===t.size?"p-2":"p-3","\n d-flex\n justify-content-between\n position-relative\n ").concat(t.showFeedback?"":"cursor-pointer","\n ").concat("KpbWq","\n ").concat(c),key:i,htmlFor:r.id},l),o().createElement("span",{className:"d-inline-block mr-3 cv-multiple-choice-bullet"},o().createElement(u,null)),o().createElement("span",{className:"flex-grow-1 pr-4"},r.name),!t.onlyShowSelectedAnswer&&o().createElement("span",{className:"uKRg2"},a&&o().createElement(pe.q,{imageCdnUrl:t.imageApi,initials:t.userInitials,imageUrl:t.userAvatar}))))})))}function he(t){return he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},he(t)}function ye(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==he(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!==he(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"===he(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}ve.defaultProps={size:"lg",unCheckedBackground:"bg-white"};function ge(t){return ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ge(t)}function be(t){function e(e){t.onSelectAnswer&&t.onSelectAnswer(e)}return o().createElement("div",{className:"d-flex ".concat(t.className?t.className:""," ").concat("sm"===t.size?"mx-n1":"mx-n2")},t.interaction.actionableItems.map((function(n,r){var i=t.getSelectedAnswer(n.id),a=i?"bg-info text-white":t.unCheckedBackground,c=function(){return o().createElement(o().Fragment,null)};t.showFeedback&&(a=n.isCorrect?"bg-success text-white":"bg-danger text-white ".concat("ZCkyL"),t.hideFeedbackIcons||(c=function(){return o().createElement(o().Fragment,null,n.isCorrect?o().createElement(it.x,{size:it.S.Small,svgName:at.vn.Check}):o().createElement(it.x,{size:it.S.Small,svgName:at.vn.Close}))}));var u=t.showFeedback?{}:{role:"button",tabIndex:0,onKeyDown:function(t){return"Enter"===t.key&&e(n)}};return o().createElement("label",Object.assign({key:r,htmlFor:n.id,className:"\n rounded-lg\n shadow-sm\n my-0\n position-relative\n overflow-hidden\n d-flex\n align-items-center\n justify-content-center\n ".concat("sm"===t.size?"".concat("_2qC40"," mx-1 h5"):"".concat("TKjXy"," mx-2 h4"),"\n ").concat(t.showFeedback?"":"cursor-pointer","\n ").concat(a)},u),o().createElement("input",{id:n.id,type:"radio",name:"multiple-choice",checked:!!i,onChange:function(){return e(n)},disabled:t.showFeedback,hidden:!0}),n.name,o().createElement("span",{className:"position-absolute p-2 ".concat("CBgCv")},o().createElement(c,null)),o().createElement("span",{className:"".concat("CVTEm").concat("sm"===t.size?" ".concat("tbPTs"):"")},i&&o().createElement(pe.q,{imageCdnUrl:t.imageApi,initials:t.userInitials,imageUrl:t.userAvatar,extraClasses:"border border-white ".concat("sm"===t.size?"GUAUz":"")})))})))}function we(t){return we="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},we(t)}var Ee,Se,xe,Ie,ke;function Oe(t){return Oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oe(t)}function je(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==Oe(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!==Oe(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"===Oe(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}be.defaultProps={size:"lg",unCheckedBackground:"bg-white"};var Ce=function(){return!0},Ne=function(){return!1},Te=(je(Ee={},Z.InteractionTypeId.Annotation,Ne),je(Ee,Z.InteractionTypeId.Image,Ne),je(Ee,Z.InteractionTypeId.MissingWord,Ce),je(Ee,Z.InteractionTypeId.MultipleChoice,Ce),je(Ee,Z.InteractionTypeId.ShortAnswer,(function(t){return!!t.data.suggestedResponse})),je(Ee,Z.InteractionTypeId.TrueOrFalse,Ce),Ee);function Le(t){return Te[t]}var Pe=(je(Se={},Z.InteractionTypeId.Annotation,(function(t){var e=t.interaction.data.annotation.replace(/<(a)(.*?)>/g,'<$1 target="_blank" $2>');return o().createElement("div",{className:"cv-interactive-question"},o().createElement("div",{className:"mb-2",dangerouslySetInnerHTML:{__html:e}}),o().createElement($t,{interaction:t.interaction,enableImmersiveReader:t.enableImmersiveReader}))})),je(Se,Z.InteractionTypeId.Image,(function(t){var e=t.interaction,n=t.recalculateScroll,r=o().useCallback((function(t){t&&(t.onload=function(){n()})}),[]);return o().createElement("div",{className:"cv-interactive-question cv-image-interactive"},o().createElement("div",{className:"cv-image-container text-center"},o().createElement("img",{className:"img-fluid shadow-lg",src:e.data.url,ref:r}),e.data.caption&&o().createElement(o().Fragment,null,o().createElement("p",{className:"mt-3"},e.data.caption,o().createElement($t,{interaction:t.interaction,className:"ml-2",enableImmersiveReader:t.enableImmersiveReader})))))})),je(Se,Z.InteractionTypeId.MissingWord,(function(t){var e=t.state,n=t.setState,r=t.interaction,i=t.showFeedback,a=r.data.sentence.replace(/{([^{}]*)}/g,(function(t,e){return"{".concat(fe).concat(e,"}")})).split(/{([^{}]*)}/g);return o().createElement("div",{className:"cv-interactive-question"},o().createElement("div",{className:"mb-2"},a.map((function(t,a){var c;if(!t.startsWith(fe))return t;var u=t.replace(fe,""),l=r.actionableItems.find((function(t){return t.order.toString()===u}));if(l){var s,f,d=e[l.id]||"",p=(s=l.name,(f=document.createElement("canvas").getContext("2d")).font="17pt arial",f.measureText(s).width);if(i){var m=l.name.toLowerCase().toString()===(null===(c=e[l.id])||void 0===c?void 0:c.toLowerCase().toString());return o().createElement(o().Fragment,{key:a},!m&&o().createElement(o().Fragment,null,o().createElement("del",{className:"text-danger"},d)," "),o().createElement("span",{className:"text-success"},l.name))}return o().createElement("span",{className:"cv-missing-word-input-container",key:a},o().createElement("input",{style:{width:p/16+"rem"},onChange:function(t){return function(t,r){if(r.stopPropagation(),r.target.value)n(function(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==se(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!==se(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"===se(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}({},t.id,r.target.value));else{var o=e,i=t.id,a=(o[i],function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(o,["symbol"===se(i)?i:i+""]));n(a,!0)}}(l,t)},value:d,disabled:!!e.submitted,className:"cv-missing-word-input",autoComplete:"off"}))}}))),o().createElement(Kt,{error:e.error}),o().createElement($t,{interaction:t.interaction,enableImmersiveReader:t.enableImmersiveReader}))})),je(Se,Z.InteractionTypeId.MultipleChoice,(function(t){var e=t.state,n=t.setState,r=t.interaction,i=t.showFeedback,a=t.imageApi,c=t.currentUser,u=1===r.actionableItems.filter((function(t){return t.isCorrect})).length;return o().createElement("div",{className:"cv-interactive-question"},o().createElement("p",null,r.name,o().createElement($t,{interaction:t.interaction,className:"ml-2",enableImmersiveReader:t.enableImmersiveReader})),!u&&o().createElement("p",{className:"text-muted"},o().createElement("small",null,"This question has multiple correct answers")),o().createElement(ve,{interaction:r,showFeedback:i,onSelectAnswer:function(t,r){if(!e.submitted)if(u)n(ye({},t.id,t.name),!0);else if(r)n(ye({},t.id,t.name));else{var o=e,i=t.id,a=(o[i],function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(o,["symbol"===he(i)?i:i+""]));n(a,!0)}},getSelectedAnswer:function(t){return e[t]},imageApi:a.toString(),userInitials:de.l.getInitials(c.givenName,c.familyName),userAvatar:c.avatar}),o().createElement(Kt,{error:e.error}))})),je(Se,Z.InteractionTypeId.ShortAnswer,(function(t){var e=t.interaction,n=t.state,r=t.setState;return t.showFeedback?o().createElement("div",{className:"cv-interactive-question"},o().createElement("p",null,e.name),o().createElement("label",{className:"cv-interaction-field-label"},"My answer"),o().createElement("p",null,n[e.actionableItems[0].id]),e.data.suggestedResponse&&o().createElement(o().Fragment,null,o().createElement("label",{className:"cv-interaction-field-label mt-1"},"Teacher's suggested answer"),o().createElement("p",null,e.data.suggestedResponse))):o().createElement("div",{className:"cv-interactive-question"},o().createElement("p",null,e.name,o().createElement($t,{interaction:e,className:"ml-2",enableImmersiveReader:t.enableImmersiveReader})),o().createElement(rt.Z,{id:"short-answer-answer",className:"form-control mt-2",minRows:3,value:n[e.actionableItems[0].id]||"",onChange:function(t){var o,i,a;r(Object.assign(Object.assign({},n),(o={},i=e.actionableItems[0].id,a=t.target.value,(i=function(t){var e=function(t,e){if("object"!==ge(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!==ge(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"===ge(e)?e:String(e)}(i))in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a,o)))},disabled:!!n.submitted}),o().createElement(Kt,{error:n.error}))})),je(Se,Z.InteractionTypeId.TrueOrFalse,(function(t){var e=t.state,n=t.setState,r=t.interaction,i=t.showFeedback,a=t.imageApi,c=t.currentUser,u=r.actionableItems.find((function(t){return t.isCorrect}));return o().createElement("div",{className:"cv-interactive-question"},o().createElement("p",null,r.name,o().createElement($t,{interaction:t.interaction,className:"ml-2",enableImmersiveReader:t.enableImmersiveReader})),o().createElement(be,{className:"justify-content-center",interaction:r,showFeedback:i,onSelectAnswer:function(t){var r,o,i;e.submitted||n((r={},o=t.id,i=t.name,(o=function(t){var e=function(t,e){if("object"!==we(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!==we(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"===we(e)?e:String(e)}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i,r),!0)},getSelectedAnswer:function(t){return e[t]},imageApi:a.toString(),userInitials:de.l.getInitials(c.givenName,c.familyName),userAvatar:c.avatar}),i&&o().createElement("div",{className:"text-center px-5 mt-3"},o().createElement("p",null,"The answer is ",o().createElement("strong",null,u.name)),r.data.feedback&&o().createElement("p",null,r.data.feedback)),o().createElement(Kt,{error:e.error}))})),Se);function Ae(){return""}var _e=(je(xe={},Z.InteractionTypeId.Annotation,Ae),je(xe,Z.InteractionTypeId.Image,Ae),je(xe,Z.InteractionTypeId.MissingWord,(function(t,e){var n=Object.keys(t).filter((function(e){var n;return!!(null===(n=t[e])||void 0===n?void 0:n.trim())})).length;return n?n!==e.actionableItems.length?"Please fill in all of the missing words":null:"Please fill in the missing words"})),je(xe,Z.InteractionTypeId.MultipleChoice,(function(t){return Object.keys(t).length?null:"Please choose an answer"})),je(xe,Z.InteractionTypeId.ShortAnswer,(function(t){return Object.keys(t).filter((function(e){var n;return!!(null===(n=t[e])||void 0===n?void 0:n.trim())})).length?null:"Please provide an answer to the question"})),je(xe,Z.InteractionTypeId.TrueOrFalse,(function(t){return Object.keys(t).length?null:"Please choose an answer"})),xe),Fe=(je(Ie={},Z.InteractionTypeId.Annotation,null),je(Ie,Z.InteractionTypeId.Image,null),je(Ie,Z.InteractionTypeId.MissingWord,(function(t,e,n){return n(e.id,Object.keys(t).map((function(e){return{actionableItemId:e,value:t[e].toString()}})))})),je(Ie,Z.InteractionTypeId.MultipleChoice,(function(t,e,n){return n(e.id,Object.keys(t).map((function(e){return{actionableItemId:e,value:t[e]}})))})),je(Ie,Z.InteractionTypeId.ShortAnswer,(function(t,e,n){return n(e.id,Object.keys(t).map((function(e){return{actionableItemId:e,value:t[e].toString()}})))})),je(Ie,Z.InteractionTypeId.TrueOrFalse,(function(t,e,n){return n(e.id,Object.keys(t).map((function(e){return{actionableItemId:e,value:t[e]}})))})),Ie);function Re(t){return Fe[t]}var Me=(je(ke={},Z.InteractionTypeId.Annotation,le.notApplicable),je(ke,Z.InteractionTypeId.Image,le.notApplicable),je(ke,Z.InteractionTypeId.MissingWord,(function(t,e){return le.isMissingWordCorrect(e,(function(e){return t[e]}))})),je(ke,Z.InteractionTypeId.MultipleChoice,(function(t,e){return le.isMultipleChoiceCorrect(e,(function(e){return t[e]}))})),je(ke,Z.InteractionTypeId.ShortAnswer,le.awaitingMarking),je(ke,Z.InteractionTypeId.TrueOrFalse,(function(t,e){return e.actionableItems.filter((function(t){return t.isCorrect})).every((function(e){return t[e.id]===e.name}))?Xt.w.Correct:Xt.w.Incorrect})),ke);function Ue(t){return Me[t]}function De(t){return De="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},De(t)}function Ge(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==De(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!==De(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"===De(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var qe={interactions:{},timepoints:{}};function Be(t,e){return"interaction"===e.type?{timepoints:t.timepoints,interactions:Object.assign(Object.assign({},t.interactions),Ge({},e.id,e.value))}:"timepoint"===e.type?{interactions:t.interactions,timepoints:Object.assign(Object.assign({},t.timepoints),Ge({},e.id,e.value))}:void 0}function We(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var ze={interactionIndex:0},Ye=function(t){var e,n,r=t.mode,i=t.timepoint,a=t.latestSession,c=r===l.InteractiveMode.Create,u=o().useReducer(Be,null,(function(){return function(t){return t?{timepoints:{},interactions:t.actions.reduce((function(t,e){var n;return t[e.interactionId]=Object.assign(Object.assign({},t[e.interactionId]),(Ge(n={},e.actionableItemId,e.data),Ge(n,"submitted",!0),n)),t}),{})}:qe}(a)})),s=(n=2,function(t){if(Array.isArray(t))return t}(e=u)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(e,n)||function(t,e){if(t){if("string"==typeof t)return We(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?We(t,e):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),f=s[0],d=s[1],p=g(null==i?void 0:i.id),m=null==i?void 0:i.interactions[p.interactionIndex],v="number"==typeof p.nextInteractionIndex?null==i?void 0:i.interactions[p.nextInteractionIndex]:null,h=b(null==m?void 0:m.id),y=b(null==v?void 0:v.id);function g(t){return t&&f.timepoints[t]||ze}function b(t){if(!t)return{};var e=f.interactions[t];return e||c?e:{}}function w(t,e,n){var r=b(t);d({type:"interaction",id:t,value:Object.assign(Object.assign({},n?{}:r),e)})}return{state:f,interaction:m,interactionState:h,timepointState:p,nextInteraction:v,nextInteractionState:y,getTimepointState:g,getInteractionState:b,updateTimepointState:function(t,e){var n=g(t);d({type:"timepoint",id:t,value:Object.assign(Object.assign({},n),e)})},updateInteractionState:w,clearTimepointState:function(t){d({type:"timepoint",id:t,value:void 0})},clearInteractionState:function(t){d({type:"interaction",id:t,value:void 0})},userUpdateInteractionState:function(t,e){w(m.id,Object.assign(Object.assign({},t),{hasChanges:!0,error:null}),e)}}};function Ze(t){return Ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ze(t)}function Ve(){Ve=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),c=new k(o||[]);return r(a,"_invoke",{value:E(t,n,c)}),a}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function d(){}function p(){}function m(){}var v={};u(v,i,(function(){return this}));var h=Object.getPrototypeOf,y=h&&h(h(O([])));y&&y!==e&&n.call(y,i)&&(v=y);var g=m.prototype=d.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(r,i,a,c){var u=s(t[r],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==Ze(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function E(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=S(a,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=s(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function S(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=s(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:void 0,done:!0}}return p.prototype=m,r(g,"constructor",{value:m,configurable:!0}),r(m,"constructor",{value:p,configurable:!0}),p.displayName=u(m,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new w(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=O,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(I),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),I(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;I(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:O(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}var He=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function c(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}u((r=r.apply(t,e||[])).next())}))},$e=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n},Ke=!1;function Qe(t){var e="".concat(t.className," ").concat("Mr0S0");t.children?e+=" ".concat("vHTVo"):e+=" ".concat("vIGn0");var n=o().createElement(it.x,{svgName:t.svgName,className:"cDUaE"});return o().createElement($.L,{className:e,onClick:t.onClick},n,t.children)}function Je(t){var e=t.isCreate,n=t.open,r=t.showTypeSelector;return!e||n?o().createElement(o().Fragment,null):o().createElement(Qe,{className:"btn btn-outline-dark cv-add-question",onClick:r,svgName:at.vn.Plus},"Add question")}var Xe=n(80181),tn=n(12778),en=n(99705);function nn(){var t=tn.o.getLiteArticle(en.b.MakeInteractive);return o().createElement("div",{className:"my-5 text-center"},o().createElement("h2",{className:"h3"},"Select an interaction to get started"),o().createElement("p",{className:"mb-0"},"Choose a point in the video and add a question to interact and engage your students."),!!t&&o().createElement("a",{href:t,target:"_blank",className:"btn btn-link text-info"},"How do I make interactives?"))}function rn(t){var e=t.isCreate,n=t.interactive,r=t.interaction,i=t.portalNode,a=t.goToTimepoint,c=t.promptDelete;if(!i)return o().createElement(o().Fragment,null);var u=n.timepoints.reduce((function(t,e){return t+e.interactions.length}),0);return o().createElement(V.Nq,{node:i},u?o().createElement(o().Fragment,null,o().createElement("h2",{className:"h4 mt-3"},"Question List (",u,")"),o().createElement(Xe.Z,{interactive:n,maxHeight:300,goToTimepoint:a,selectedInteractionId:null==r?void 0:r.id,onClickDelete:e?c:void 0})):e?o().createElement(nn,null):o().createElement(o().Fragment,null))}var on=n(4234);var an=n(42503);function cn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var un=[Z.InteractionTypeId.MissingWord,Z.InteractionTypeId.MultipleChoice,Z.InteractionTypeId.TrueOrFalse,Z.InteractionTypeId.ShortAnswer,Z.InteractionTypeId.Image,Z.InteractionTypeId.Annotation];function ln(t){var e,n,r=t.addInteraction,i=t.cancelTypeSelector,a=t.player,c=t.timepoint,u=t.open,l=t.isCreate,f=t.interaction,d=(e=o().useState((0,an.m)(a.currentTime()||0)),n=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(e,n)||function(t,e){if(t){if("string"==typeof t)return cn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cn(t,e):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),p=d[0],m=d[1];return o().useEffect((function(){var t=function(){m((0,an.m)(a.currentTime()))};return a.on("timeupdate",t),function(){return a.off("timeupdate",t)}}),[]),f||!l?o().createElement(o().Fragment,null):o().createElement("div",{className:"d-flex align-items-center justify-content-center h-100"},o().createElement("div",{className:"cv-interactive-type-selector d-flex flex-wrap justify-content-center align-items-center"},o().createElement("div",{className:"text-center font-weight-bold w-100 text-body mb-3 cv-add-question-copy"},c?"Add another question at:":"Add a question at:"," ",p),un.map((function(t,e){var n=s.w.getTypeInfo(t),i=n.name,a=n.bgClassName,c=n.Svg;return o().createElement($.L,{key:e,className:"cv-type-selector rounded py-2 m-1 ".concat(a),onClick:function(){return r(t)}},o().createElement("span",{className:"cv-create-type-icon mb-1"},o().createElement(c,null)),o().createElement("div",{className:"d-flex align-items-center justify-content-center cv-interaction-type-name px-1"},i))})),(c||u)&&o().createElement("div",{className:"text-center w-100 mt-2 ".concat(c?"":"cv-adding-first-cancel")},o().createElement($.L,{className:"btn btn-link",onClick:i},"Cancel"))))}function sn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function fn(t){var e,n,r=t.typeId,i=t.currentIndex,a=t.numberOfInteractions,c=t.changeIndex,u=t.player,l=(e=o().useState((0,an.m)(u.currentTime()||0)),n=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(e,n)||function(t,e){if(t){if("string"==typeof t)return sn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sn(t,e):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),f=l[0],d=l[1];o().useEffect((function(){var t=function(){d((0,an.m)(u.currentTime()))};return u.on("timeupdate",t),function(){return u.off("timeupdate",t)}}),[]);var p=s.w.getTypeInfo(r),m=p.name,v=p.bgClassName,h=i<a-1,y=i>0;return o().createElement("div",{className:"text-center d-flex justify-content-between align-items-center p-1 ".concat(v)},o().createElement($.L,{onClick:function(){y&&c(i-1)},className:y?"":"invisible"},o().createElement(it.x,{size:it.S.Medium,svgName:at.vn.ChevronLeft})),o().createElement("div",null,o().createElement("div",{className:"h6 mb-0"},m),a>1&&o().createElement("div",null,i+1," of ",a," at ",f)),o().createElement($.L,{onClick:function(){h&&c(i+1)},className:h?"":"invisible"},o().createElement(it.x,{size:it.S.Medium,svgName:at.vn.ChevronRight})))}function dn(t){var e=t.typeId,n=s.w.getTypeInfo(e),r=n.name,i=n.prompt,a=n.bgClassName,c=n.Svg;return o().createElement("div",{className:"text-center text-body d-flex justify-content-between align-items-center px-3 pt-3"},o().createElement("div",{className:"d-flex align-items-center"},o().createElement("span",{className:"cv-interaction-icon rounded my-1 text-white ".concat(a)},o().createElement(c,null)),o().createElement("span",{className:"text-left flex-grow-1"},o().createElement("div",{className:"h5 ".concat(i?"":"mb-0")},o().createElement("strong",null,r)),i&&o().createElement("div",{className:"h6 mb-0"},i))))}function pn(t){var e=t.isCreate,n=t.interaction,r=t.player,i=t.changeIndex,a=t.timepointState,c=t.timepoint;return e?o().createElement(fn,{typeId:n.typeId,changeIndex:i,player:r,currentIndex:a.interactionIndex,numberOfInteractions:c.interactions.length}):o().createElement(dn,{typeId:n.typeId})}var mn=n(99910);function vn(t){var e=t.interaction,n=t.interactionState,o=t.onClickContinue,i=t.onClickSave,a=t.onClickCancel,c=t.onClickAddAnother,u=t.onClickDiscard,l=_(e.id),s=!!(null==n?void 0:n.hasChanges),f=!!(null==n?void 0:n.spinner);return r.createElement("div",{className:"cv-timpoint-button-container"},l?r.createElement($.L,{className:"btn btn-link",onClick:a},"Cancel"):s?r.createElement($.L,{className:"btn btn-link",onClick:u},"Discard"):r.createElement($.L,{className:"btn btn-link",onClick:c},"Add another question"),f?r.createElement($.L,{className:"btn btn-dark ml-2 cv-interactive-spinner",onClick:function(){}},r.createElement(mn.Spinner,{as:"span",animation:"border",role:"status",size:"sm"})):l?s?r.createElement($.L,{className:"btn btn-dark ml-2",onClick:i},"Save"):r.createElement($.L,{className:"btn btn-dark ml-2 disabled",onClick:function(){}},"Save"):s?r.createElement($.L,{className:"btn btn-dark ml-2",onClick:i},"Save"):r.createElement(Qe,{className:"btn btn-dark ml-2",onClick:o,svgName:at.vn.Play},"Continue"))}function hn(t){var e=t.typeId,n=t.interactionState,o=t.onClickSkip,i=t.numberOfInteractions,a=t.currentIndex,c=t.changeIndex,u=!!(null==n?void 0:n.submitted),l=!!(null==n?void 0:n.hasChanges),s=!!(null==n?void 0:n.spinner),f=!!Re(e),d=a<i-1;var p=a>0;return r.createElement("div",{className:"cv-timpoint-button-container flex-wrap"},!u&&f&&r.createElement($.L,{className:"btn btn-link",onClick:o},"Come back later"),i>1&&a>0&&r.createElement(Qe,{className:"btn btn-dark ml-2 ".concat(p?"":"disabled"),onClick:function(){p&&c(a-1)},svgName:at.vn.ChevronUp}),s?r.createElement($.L,{className:"btn btn-dark ml-2 cv-interactive-spinner",onClick:function(){}},r.createElement(mn.Spinner,{as:"span",animation:"border",role:"status",size:"sm"})):u||!f?1===i||a===i-1?r.createElement(Qe,{className:"btn btn-dark ml-2",onClick:o,svgName:at.vn.Play},"Continue"):r.createElement($.L,{className:"btn btn-dark ml-2 ".concat(d?"":"disabled"),onClick:function(){d&&c(a+1)}},"Next"):r.createElement($.L,{className:"btn btn-dark ml-2 ".concat(l?"":"disabled"),onClick:function(){l&&t.onClickSubmit()}},"Save"))}function yn(t){var e=t.isCreate,n=t.interaction,r=t.interactionState,i=t.continueInteractive,a=t.saveInteraction,c=t.cancel,u=t.addAnotherQuestion,l=t.discardChanges,s=t.submitInteractionAnswer,f=t.onClickSkip,d=t.changeIndex,p=t.timepoint,m=t.currentIndex;return o().createElement(o().Fragment,null,e?o().createElement(vn,{interaction:n,interactionState:r,onClickContinue:i,onClickSave:a,onClickCancel:c,onClickAddAnother:u,onClickDiscard:function(){return l()}}):o().createElement(hn,{typeId:n.typeId,interactionState:r,onClickSubmit:s,onClickSkip:f,changeIndex:d,currentIndex:m,numberOfInteractions:p.interactions.length}))}var gn=n(86509);function bn(t){var e=t.timepoint,n=t.interaction,r=t.promptDelete,i=t.optionsPortalNode,a=t.setView;if(!n)return o().createElement(o().Fragment,null);var c=[];if(c.push({label:"Move time point",onClick:function(){return a("move")}}),e.interactions.length>1){var u=_(n.id);c.push({label:"Re-order questions",onClick:function(){return a("reorder")},className:u?"disabled":""})}return c.push({label:"Delete",onClick:function(){return r(n.id)},className:"text-danger"}),o().createElement(V.Nq,{node:i},!!n&&o().createElement(gn.m,{actions:c}))}function wn(t){return wn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wn(t)}function En(){En=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),c=new k(o||[]);return r(a,"_invoke",{value:E(t,n,c)}),a}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function d(){}function p(){}function m(){}var v={};u(v,i,(function(){return this}));var h=Object.getPrototypeOf,y=h&&h(h(O([])));y&&y!==e&&n.call(y,i)&&(v=y);var g=m.prototype=d.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(r,i,a,c){var u=s(t[r],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==wn(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function E(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=S(a,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=s(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function S(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=s(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:void 0,done:!0}}return p.prototype=m,r(g,"constructor",{value:m,configurable:!0}),r(m,"constructor",{value:p,configurable:!0}),p.displayName=u(m,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new w(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=O,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(I),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),I(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;I(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:O(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function Sn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return xn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xn(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var In=null,kn=0,On=1;function jn(t){var e=t.timepoint,n=t.updateTimepointTime,r=t.saveTimepoint,i=t.back,a=t.clearTimepointTimeState,c=Sn(o().useState((0,an.m)(e.visibleAt/1e3)),2),u=c[0],l=c[1],s=Sn(o().useState(!1),2),f=s[0],d=s[1];function p(t){n(t*On),l((0,an.m)(e.visibleAt/1e3)),2==++kn?On=5:4===kn?On=20:6===kn?On=60:8===kn&&(On=120),In||(In=window.setInterval((function(){return p(t)}),200),window.addEventListener("mouseup",m))}function m(){window.removeEventListener("mouseup",m),window.clearInterval(In),In=null,kn=0,On=1}return o().useEffect((function(){return m}),[]),o().createElement(o().Fragment,null,o().createElement("div",{className:"cv-timepoint flex-grow-1"},o().createElement("div",{className:"cv-timepoint-padding"},o().createElement("div",{className:"cv-interactive-question"},o().createElement("label",{className:"cv-interaction-field-label mb-0"},"Move time point"),o().createElement("div",{className:"text-center mt-3"},o().createElement($.L,{className:"cv-left-arrow d-inline-block cursor-pointer",onClick:function(){},onMouseDown:function(){return p(-1)},onKeyDown:function(t){t.stopPropagation(),13===t.keyCode&&0===kn&&p(-1)},onKeyUp:m}),o().createElement("input",{className:"form-control text-center d-inline-block cv-move-timepoint-input",value:u,onChange:function(){},onKeyDown:function(t){t.stopPropagation(),37===t.keyCode&&0===kn&&p(-1),39===t.keyCode&&0===kn&&p(1)},onKeyUp:m}),o().createElement($.L,{className:"cv-right-arrow d-inline-block cursor-pointer",onClick:function(){},onMouseDown:function(){return p(1)},onKeyDown:function(t){t.stopPropagation(),13===t.keyCode&&0===kn&&p(1)},onKeyUp:m}))))),o().createElement("div",{className:"cv-timpoint-button-container"},o().createElement($.L,{className:"btn btn-link",onClick:function(){a(!0),i()}},"Cancel"),f?o().createElement($.L,{className:"btn btn-dark ml-2 cv-interactive-spinner",onClick:function(){}},o().createElement(mn.Spinner,{as:"span",animation:"border",role:"status",size:"sm"})):o().createElement($.L,{className:"btn btn-dark",onClick:function(){return t=this,e=void 0,n=void 0,o=En().mark((function t(){return En().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return d(!0),t.next=3,r();case 3:i();case 4:case"end":return t.stop()}}),t)})),new(n||(n=Promise))((function(r,i){function a(t){try{u(o.next(t))}catch(t){i(t)}}function c(t){try{u(o.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}u((o=o.apply(t,e||[])).next())}));var t,e,n,o}},"Save")))}var Cn=n(86572),Nn=n(1287),Tn=n(17808);function Ln(t){return Ln="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ln(t)}function Pn(){Pn=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),c=new k(o||[]);return r(a,"_invoke",{value:E(t,n,c)}),a}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function d(){}function p(){}function m(){}var v={};u(v,i,(function(){return this}));var h=Object.getPrototypeOf,y=h&&h(h(O([])));y&&y!==e&&n.call(y,i)&&(v=y);var g=m.prototype=d.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(r,i,a,c){var u=s(t[r],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==Ln(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function E(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=S(a,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=s(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function S(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=s(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:void 0,done:!0}}return p.prototype=m,r(g,"constructor",{value:m,configurable:!0}),r(m,"constructor",{value:p,configurable:!0}),p.displayName=u(m,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new w(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=O,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(I),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),I(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;I(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:O(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function An(t){return function(t){if(Array.isArray(t))return Rn(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Fn(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||Fn(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fn(t,e){if(t){if("string"==typeof t)return Rn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Rn(t,e):void 0}}function Rn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Mn=function(t){var e=t.interaction,n=s.w.getTypeInfo(e.typeId).bgClassName,r=o().forwardRef((function(t,r){return o().createElement("div",Object.assign({className:"py-2 text-left"},t.dragAttributes,t.dragListeners,{ref:r,style:t.style}),o().createElement("span",{className:"fB8W8"},o().createElement(it.x,{size:it.S.Small,svgName:at.vn.Handle})),o().createElement(Cn.y,{interaction:e,iconClassName:"".concat("GSE1a"," ").concat(n),questionClassName:"".concat("qKMzc"," clamp-1")}))}));return o().createElement(Nn.W,{id:e.id,childComponent:r,childProps:{}})},Un=function(t){var e=t.interactions,n=function(){var t=o().useRef();function e(){document.body.style.cursor="",document.removeEventListener("mouseup",e),t.current&&(t.current.style.cursor="grab")}return{ref:t,style:{cursor:"grab"},onMouseDown:function(){document.body.style.cursor="grabbing",document.addEventListener("mouseup",e),t.current&&(t.current.style.cursor="grabbing")},onMouseUp:e}}();return o().createElement(Tn.Q,{ids:e.map((function(t){return t.id})),getDragOverlay:function(t){return o().createElement(Mn,{key:t,interaction:e.find((function(e){return e.id===t}))})},onSortEnd:t.onSortEnd},o().createElement("div",Object.assign({tabIndex:0},n),e.map((function(t){return o().createElement(Mn,{key:t.id,interaction:t})}))))};function Dn(t){var e=_n(o().useState(!1),2),n=e[0],r=e[1],i=_n(o().useState(An(t.interactions)),2),a=i[0],c=i[1],u=_n(o().useState(!1),2),l=u[0],s=u[1];return o().createElement(o().Fragment,null,o().createElement("div",{className:"cv-timepoint flex-grow-1"},o().createElement("div",{className:"cv-timepoint-padding"},o().createElement("div",{className:"cv-interactive-question"},o().createElement("label",{className:"cv-interaction-field-label mb-0"},"Re-order questions"),o().createElement("div",{className:"text-center mt-3"},o().createElement(Un,{onSortEnd:function(t){var e=t.active,n=t.over,r=a.findIndex((function(t){return t.id.toString()===e.id.toString()})),o=a.findIndex((function(t){return t.id.toString()===n.id.toString()}));r!==o&&(c(An(function(t,e,n){for(;e<0;)e+=t.length;for(;n<0;)n+=t.length;if(n>=t.length)for(var r=n-t.length+1;r--;)t.push(void 0);return t.splice(n,0,t.splice(e,1)[0]),t}(a,r,o))),s(!0))},interactions:a}))))),o().createElement("div",{className:"cv-timpoint-button-container"},o().createElement($.L,{className:"btn btn-link",onClick:function(){c(An(t.interactions)),s(!1),t.back()}},"Cancel"),n?o().createElement($.L,{className:"btn btn-dark ml-2 cv-interactive-spinner",onClick:function(){}},o().createElement(mn.Spinner,{as:"span",animation:"border",role:"status",size:"sm"})):o().createElement($.L,{className:"btn btn-dark ".concat(l?"":"disabled"),onClick:function(){return e=this,n=void 0,o=void 0,i=Pn().mark((function e(){return Pn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l){e.next=2;break}return e.abrupt("return");case 2:return r(!0),e.next=5,t.reOrderQuestions(a);case 5:r(!1),t.back();case 7:case"end":return e.stop()}}),e)})),new(o||(o=Promise))((function(t,r){function a(t){try{u(i.next(t))}catch(t){r(t)}}function c(t){try{u(i.throw(t))}catch(t){r(t)}}function u(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(a,c)}u((i=i.apply(e,n||[])).next())}));var e,n,o,i}},"Save")))}var Gn=n(3747),qn=n(86764);function Bn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Wn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wn(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function zn(t){var e=t.isCreate,n=t.interaction,r=t.mode,i=t.immediateFeedback,a=t.interactionState,c=t.shouldFocus,u=t.delayFocus,s=t.open,f=t.timepoint,d=t.userUpdateInteractionState,p=t.submitInteractionAnswer,m=t.saveInteraction,v=t.skip,h=o().useRef(),y=o().useRef(),g=o().useRef(0),b=(0,Gn.a)(qn.r.XLDown),w=!e||b;function E(){return!!h.current&&!!c&&!!s}function S(){h.current&&(h.current.focus(),k(!0))}var x=Bn(o().useState(!1),2),I=x[0],k=x[1];o().useEffect((function(){E()&&(I||(u&&w?g.current=window.setTimeout((function(){g.current=0,E()&&S()}),400):S()))}),[h.current,I]);var O=Bn(o().useState("question"),2),j=O[0],C=O[1],N=o().useMemo((function(){return(0,V.oD)()}),[]),T=n?function(t,e){if(e===l.InteractiveMode.Create)return function(t){return Bt[t]}(t);if(e===l.InteractiveMode.View)return function(t){return Pe[t]}(t);throw new Error("Cannot find components for the mode ".concat(e))}(n.typeId,r):null,L=i;return e||(L=L&&(null==a?void 0:a.submitted)),o().createElement(o().Fragment,null,o().createElement(bn,Object.assign({optionsPortalNode:N,setView:C},t)),o().createElement(on.Z,{style:{height:"100%"},ref:y},o().createElement(ln,Object.assign({},t)),!!n&&o().createElement("div",{className:"d-flex flex-column h-100"},o().createElement(pn,Object.assign({},t)),"question"===j&&o().createElement(o().Fragment,null,o().createElement("form",{className:"cv-timepoint flex-grow-1",tabIndex:-1,onSubmit:function(t){t.preventDefault(),e?m():p()}},o().createElement("div",{className:"cv-timepoint-padding"},o().createElement("div",{ref:h,tabIndex:0}),o().createElement(T,Object.assign({state:a,setState:d,recalculateScroll:function(){y.current.recalculate()},showFeedback:L,optionsPortalNode:N},t)))),o().createElement(yn,Object.assign({onClickSkip:function(){g.current&&window.clearTimeout(g.current),v()}},t))),"move"===j&&o().createElement(jn,Object.assign({back:function(){return C("question")}},t)),"reorder"===j&&o().createElement(Dn,Object.assign({back:function(){return C("question")},interactions:f.interactions},t)))))}function Yn(t){var e=t.open,n=t.nextInteraction,r=t.nextInteractionState,i=t.timepointState,a=t.interaction,c=t.delayFocus,u=n&&i.nextInteractionIndex<i.interactionIndex,l=n&&i.nextInteractionIndex>i.interactionIndex,s=l&&i.slideIn,f=u&&i.slideIn;return o().createElement("div",{className:"cv-interactive ".concat(e?"cv-open":"")},u&&o().createElement("div",{className:"cv-prev-interaction ".concat(i.slideIn?"cv-slide-in":"")},o().createElement(zn,Object.assign({},t,{currentIndex:i.nextInteractionIndex,interaction:n,interactionState:r}))),o().createElement("div",{className:"\n cv-main-slide\n ".concat(s?"cv-slide-out-up":"","\n ").concat(f?"cv-slide-out-down":"","\n ").concat(n?"cv-transitioning":"","\n ")},o().createElement(zn,Object.assign({key:null==a?void 0:a.id},t,{currentIndex:i.interactionIndex,shouldFocus:a&&!u&&!l,delayFocus:c}))),l&&o().createElement("div",{className:"cv-next-interaction ".concat(i.slideIn?"cv-slide-in":"")},o().createElement(zn,Object.assign({},t,{currentIndex:i.nextInteractionIndex,interaction:n,interactionState:r}))))}function Zn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Vn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Vn(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Hn(t){var e=t.player,n=t.resultsService,r=t.interactive,i=t.setShowSummary,a=t.mobile,c=Zn(o().useState(!1),2),u=c[0],l=c[1],s=Zn(o().useState(!1),2),f=s[0],d=s[1],p=t.player.activePlugins_.activityStatusPlugin,m=t.player.activePlugins_.favouritePlugin;function v(){var t=e.currentTime(),n=r.timepoints[r.timepoints.length-1];f||t>n.visibleAt/1e3+1?l(!0):l(!1)}function h(){d(!0)}if(o().useEffect((function(){return e.on("ended",h),function(){return e.off("ended",h)}}),[]),o().useEffect((function(){if(n&&!a)return e.on("timeupdate",v),function(){return e.off("timeupdate",v)}}),[f]),!u)return null;var y="btn btn-outline-dark cv-show-summary";return m&&(y+=" cv-has-favourite-plugin"),p&&(y+=" cv-has-activity-status-plugin"),o().createElement($.L,{className:y,onClick:function(){i(!0),e.pause(),e.hide()}},e.gradePassbackPlugin().enabled?"Submit answers":"View summary")}function $n(t){var e=t.interactive,n=t.duration;return n?o().createElement(o().Fragment,null,e.timepoints.map((function(e,r){if(!e.interactions.length)return o().createElement(o().Fragment,null);var i=s.w.getTypeInfo(e.interactions[0].typeId).bgClassName,a=e.visibleAt/1e3/n*100;return o().createElement("span",{key:r,className:"".concat("pUo8u"," ").concat(i),style:{left:"".concat(a,"%")},onClick:function(n){return r=e.id,o=e.interactions[0].id,n.stopPropagation(),void t.goToTimepoint(r,o);var r,o}})}))):o().createElement(o().Fragment,null)}var Kn=n(10874),Qn=n(78276);function Jn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Xn(t){var e,n,r=t.duration,i=t.progress,a=t.player,c=(e=o().useState(i.length),n=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(e,n)||function(t,e){if(t){if("string"==typeof t)return Jn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jn(t,e):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[1],u=[];if(i.length){var l=i[0];u.push(l),i.forEach((function(t,e){0!==e&&(l.end.time+1>t.start.time&&l.start.time<t.start.time?l.end=t.end:(l=t,u.push(l)))}))}return o().useEffect((function(){var t=function(){c(i.length)};return a.on("progressflush",t),function(){return a.off("progressflush",t)}}),[]),o().createElement(o().Fragment,null,u.map((function(t,e){var n=t.start.time/r*100,i=100*(1-t.end.time/r);return o().createElement("span",{key:e,className:"BnKli",style:{left:"".concat(n,"%"),right:"".concat(i,"%")}})})))}function tr(t){return st.m.last(t.results)}function er(t,e){return st.m.findWhere(null==e?void 0:e.attempts,{id:t})}var nr="cv-missing-word-";const rr="Y7ls8";var or;function ir(t){return ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ir(t)}function ar(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==ir(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!==ir(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"===ir(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var cr=function(){return o().createElement(o().Fragment,null)},ur=(ar(or={},Z.InteractionTypeId.Annotation,cr),ar(or,Z.InteractionTypeId.Image,cr),ar(or,Z.InteractionTypeId.MissingWord,(function(t){var e=t.interaction.data.sentence.replace(/{([^{}]*)}/g,(function(t,e){return"{".concat(nr).concat(e,"}")})).split(/{([^{}]*)}/g),n="p-2";return t.reportsStyling||(n+=" border rounded"),o().createElement("div",{className:n},e.map((function(e,n){if(!e.startsWith(nr))return e;var r=e.replace(nr,""),i=t.interaction.actionableItems.find((function(t){return t.order.toString()===r}));if(i){var a=t.answers.find((function(t){return t.id==i.id}));if(a){if(!t.showFeedback)return o().createElement("strong",{key:n,className:"text-info"},a.text);var c=a.status===Qt.Correct;return o().createElement(o().Fragment,{key:n},!c&&o().createElement(o().Fragment,null,o().createElement("del",{className:"text-danger"},o().createElement("strong",null,a.text))," "),o().createElement("strong",{className:"text-success"},i.name))}}})))})),ar(or,Z.InteractionTypeId.MultipleChoice,(function(t){var e,n,r,i,a="my-2";return t.reportsStyling&&(a+=" mx-2"),o().createElement("div",{className:a},o().createElement(ve,{interaction:t.interaction,showFeedback:t.showFeedback,getSelectedAnswer:function(e){var n=t.answers.find((function(t){return t.id==e}));return null==n?void 0:n.text},imageApi:t.imageCdnUrl,userInitials:t.anonymisedUserName?de.l.getInitialsFromFullName(t.anonymisedUserName):de.l.getInitials(null===(e=t.user)||void 0===e?void 0:e.name,null===(n=t.user)||void 0===n?void 0:n.surname),userAvatar:t.anonymisedUserName?null:null===(i=null===(r=t.user)||void 0===r?void 0:r.avatar)||void 0===i?void 0:i.url,onlyShowSelectedAnswer:!t.showAvatar,size:"sm",unCheckedBackground:t.showFeedback?"":"".concat(rr," text-white")}))})),ar(or,Z.InteractionTypeId.TrueOrFalse,(function(t){var e,n,r,i,a="justify-content-start";return t.reportsStyling&&(a="justify-content-center"),o().createElement("div",{className:"my-2"},o().createElement(be,{className:a,interaction:t.interaction,showFeedback:t.showFeedback,hideFeedbackIcons:!t.showAvatar,getSelectedAnswer:function(e){var n=t.answers.find((function(t){return t.id==e}));return null==n?void 0:n.text},imageApi:t.imageCdnUrl,userInitials:t.anonymisedUserName?de.l.getInitialsFromFullName(t.anonymisedUserName):de.l.getInitials(null===(e=t.user)||void 0===e?void 0:e.name,null===(n=t.user)||void 0===n?void 0:n.surname),userAvatar:t.anonymisedUserName?null:null===(i=null===(r=t.user)||void 0===r?void 0:r.avatar)||void 0===i?void 0:i.url,size:"sm",unCheckedBackground:t.showFeedback?"":"".concat(rr," text-white")}))})),ar(or,Z.InteractionTypeId.ShortAnswer,(function(t){var e=st.m.first(t.answers);if(!e)return o().createElement(o().Fragment,null);var n="rounded p-2 mb-2";return t.reportsStyling||(n+=" bg-info text-white"),o().createElement("div",{className:n},e.text)})),or),lr=n(23481).T.encloseNamespace("interactives.responseTypes");function sr(){return o().createElement("p",{className:"p-2"},o().createElement("em",null,lr("noResponse")))}function fr(t){return o().createElement(o().Fragment,null,t.correctness===Xt.w.Correct&&o().createElement("div",{className:"ml-2 text-success"},o().createElement(it.x,{svgName:at.vn.Check})),t.correctness===Xt.w.Incorrect&&o().createElement("div",{className:"ml-2 text-danger"},o().createElement(it.x,{svgName:at.vn.Close})))}function dr(t){return o().createElement("div",{className:"d-flex align-items-center justify-content-between"},o().createElement("strong",null,t.anonymisedUserName||de.l.getFullName(t.studentResults.user)),o().createElement(fr,{correctness:t.correctness}))}function pr(t){return t.correctness!==Xt.w.AwaitingMarking?o().createElement(o().Fragment,null):o().createElement("div",{className:"d-flex justify-content-end mt-1"},o().createElement("div",{className:"d-flex flex-column justify-content-end cursor-pointer\n ".concat(t.markedStatus===Qt.Correct?"text-success":"")},o().createElement(it.x,{svgName:t.markedStatus===Qt.Correct?at.vn.CheckCircle:at.vn.CheckCircleOutline,onClick:function(){return t.markInteraction(t.studentAttempt.answers,Qt.Correct)}})),o().createElement("div",{className:"d-flex flex-column justify-content-end cursor-pointer\n ".concat(t.markedStatus===Qt.Incorrect?" text-danger":"")},o().createElement(it.x,{svgName:t.markedStatus===Qt.Incorrect?at.vn.CrossCircleFilled:at.vn.CrossCircle,onClick:function(){return t.markInteraction(t.studentAttempt.answers,Qt.Incorrect)}})))}function mr(t){var e,n,r,i,a,c=ur[t.interaction.typeId];if(!c)return o().createElement(o().Fragment,null);var u=tr(t.studentResults),l=er(t.interaction.id,u),s=le.isInteractionCorrect(t.interaction,u);return o().createElement("div",{className:"rounded ".concat(null!==(e=t.className)&&void 0!==e?e:"")},o().createElement("div",{className:"d-flex"},!!t.showStudentDetails&&o().createElement("div",{className:"mr-2"},o().createElement("div",{className:"FEdgT"},o().createElement(pe.q,{imageCdnUrl:t.imageCdnUrl,initials:t.anonymisedUserName?de.l.getInitialsFromFullName(t.anonymisedUserName):de.l.getInitials(null===(n=t.studentResults.user)||void 0===n?void 0:n.name,null===(r=t.studentResults.user)||void 0===r?void 0:r.surname),imageUrl:t.anonymisedUserName?null:null===(a=null===(i=t.studentResults.user)||void 0===i?void 0:i.avatar)||void 0===a?void 0:a.url}))),o().createElement("div",{className:"flex-grow-1"},!!t.showStudentDetails&&o().createElement(dr,{studentResults:t.studentResults,correctness:s,anonymisedUserName:t.anonymisedUserName}),o().createElement("div",{className:"d-flex justify-content-between"},o().createElement("div",{className:"flex-grow-1 ".concat(t.responseComponentClass?t.responseComponentClass:"")},l?o().createElement(c,{interaction:t.interaction,answers:l.answers,imageCdnUrl:t.imageCdnUrl,user:t.studentResults.user,showFeedback:t.showFeedback,showAvatar:t.showAvatar,reportsStyling:t.reportsStyling}):o().createElement(sr,null)),!t.showStudentDetails&&o().createElement(fr,{correctness:s})))),o().createElement(pr,{studentAttempt:l,correctness:s,markInteraction:t.markInteraction,markedStatus:t.markedStatus}))}function vr(t){var e=t.studentResults,n=t.interaction,r=t.timepoint,i=t.interactive,a=t.state,c=t.goToTimepoint,u=t.interactionNumber,l=t.imageCdnUrl,s=tr(e),f=er(n.id,s),d=a.interactions[n.id],p=Ue(n.typeId)(d||{},n),m=n.typeId!==Z.InteractionTypeId.Annotation&&n.typeId!==Z.InteractionTypeId.Image,v=m;n.typeId===Z.InteractionTypeId.MissingWord&&f&&(v=!1);var h=n.data.suggestedResponse||n.data.feedback;return o().createElement("li",{className:"mb-3 position-relative"},o().createElement("div",{className:"d-flex flex-wrap mb-2 cursor-pointer",onClick:function(){return c(r.id,n.id)}},i.immediateFeedback&&o().createElement("div",{className:"O6oD6"},!!f&&(p===Xt.w.AwaitingMarking?o().createElement("span",{className:"text-muted font-italic"},"Waiting to be marked"):p===Xt.w.Correct?o().createElement("span",{className:"text-success"},"Correct ",o().createElement(it.x,{className:"svg-container align-middle",svgName:at.vn.Check})):p===Xt.w.Incorrect&&o().createElement("span",{className:"text-danger"},"Incorrect ",o().createElement(it.x,{className:"svg-container align-middle",svgName:at.vn.Close})))),o().createElement(Cn.y,{interaction:n,iconClassName:"flex-shrink-0",showQuestion:v,showTypeName:!0,questionClassName:"d-block w-100 mt-2",questionNumber:u})),m&&!f&&o().createElement("button",{className:"btn btn-dark",onClick:function(){return c(r.id,n.id)}},"Answer question"),f&&m&&o().createElement(mr,{interaction:n,studentResults:e,markedStatus:Qt.PendingReview,markInteraction:function(){},imageCdnUrl:l,showFeedback:i.immediateFeedback,showAvatar:!0}),i.immediateFeedback&&f&&h&&o().createElement("div",{className:"bg-light rounded p-2"},o().createElement("div",null,o().createElement("strong",null,n.typeId===Z.InteractionTypeId.TrueOrFalse?"Teacher's feedback":"Teacher's suggested response")),h))}function hr(t){return function(t){if(Array.isArray(t))return gr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||yr(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yr(t,e){if(t){if("string"==typeof t)return gr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gr(t,e):void 0}}function gr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function br(t){var e,n,r=t.showSummary,i=t.setShowSummary,a=t.state,c=t.interactive,u=t.player,l=t.progress,s=t.portalNode,f=o().useRef(),d=(e=o().useState(!1),n=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(e,n)||yr(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),p=d[0],m=d[1];function v(){i(!1),u.show(),u.play()}function h(e,n){v(),t.goToTimepoint(e,n)}if(!s||!r)return o().createElement(o().Fragment,null);var y=function(t){var e=t.state,n=0,r=0,o=0,i=!1,a=[];return t.interactive.timepoints.forEach((function(t){t.interactions.forEach((function(t){var c=e.interactions[t.id],u=Ue(t.typeId)(c||{},t);u===Xt.w.Correct&&n++,u!==Xt.w.NotApplicable&&r++,u!==Xt.w.NotApplicable&&(null==c?void 0:c.submitted)&&o++,u===Xt.w.AwaitingMarking&&(i=!0);var l=F(c||{}),s=Object.keys(l).map((function(t){var e;return{id:t,text:null===(e=l[t])||void 0===e?void 0:e.toString()}}));s.length&&a.push({id:t.id,answeredAt:1,answers:s})}))})),{correctCount:n,total:r,answered:o,studentAttempts:a,awaitingMarking:i}}({interactive:c,state:a}),g=y.correctCount,b=y.total,w=y.answered,E=y.studentAttempts,S=y.awaitingMarking,x={name:t.currentUser.givenName,username:t.currentUser.username,user:{name:t.currentUser.givenName,surname:t.currentUser.familyName,avatar:{url:t.currentUser.avatar}},results:[{id:c.id,attempts:E}]},I=0,k=u.ended(),O=u.duration();return o().createElement(V.Nq,{node:s},o().createElement("div",{className:"row pb-3"},o().createElement("div",{className:"col-4 col-xs-12"},o().createElement(Qn.Z,{data:u.poster(),imageType:gt.__.Thumbnails,imageOptions:{size:gt.h2.Medium}})),o().createElement("div",{className:"col-8 col-xs-12"},o().createElement("span",{className:"float-right"},o().createElement(Kn.h,{svgName:at.vn.Play,className:"btn btn-outline-dark",onClick:function(){v(),u.ended()&&u.currentTime(0)}},k?"Play again":"Continue watching"),u.gradePassbackPlugin().enabled&&(p?o().createElement($.L,{className:"btn btn-dark ml-2",onClick:function(){}},o().createElement(mn.Spinner,{as:"span",animation:"border",role:"status",size:"sm"})):o().createElement(Kn.h,{svgName:at.vn.Check,className:"btn btn-dark ml-2",onClick:function(){m(!0),u.gradePassbackPlugin().submit(g/b,!S)}},"Submit"))),o().createElement("h1",{className:"h3"},t.title),o().createElement("p",null))),o().createElement("div",{className:"border rounder px-2 mb-3"},o().createElement("div",{className:"cursor-pointer my-4 ".concat("gxTA_"),onClick:function(t){if(f.current){var e=f.current.getBoundingClientRect(),n=(t.pageX-e.left)/e.width*O;v(),u.currentTime(n)}},ref:f},o().createElement(Xn,{duration:O,progress:l,interactive:c,player:u}),o().createElement($n,{duration:O,interactive:c,goToTimepoint:h}))),o().createElement("h2",{className:"h4"},"My Answers"),o().createElement("div",{className:"d-flex justify-content-between"},o().createElement("span",null,c.immediateFeedback&&o().createElement("div",null,"Score: ",g,"/",b),o().createElement("div",{className:"mb-3"},"You have answered ",o().createElement("strong",{className:w!==b?"text-danger":""},w)," of ",o().createElement("strong",null,b)," questions"))),o().createElement("div",{className:"row"},o().createElement("div",{className:"col-lg-7 col-12"},o().createElement("ul",{className:"list-unstyled"},c.timepoints.reduce((function(e,n){return[].concat(hr(e),hr(n.interactions.map((function(e){return I++,o().createElement(vr,{key:e.id,studentResults:x,interaction:e,timepoint:n,interactive:c,state:a,goToTimepoint:h,interactionNumber:I,imageCdnUrl:t.imageCdnUrl})}))))}),[])))))}function wr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Er(t){var e,n,r=t.resultsService,i=t.player,a=t.onShowSummary,c=t.mobile,u=(e=o().useState(!1),n=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(e,n)||function(t,e){if(t){if("string"==typeof t)return wr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wr(t,e):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),l=u[0],s=u[1];function f(t){s(t),a&&a(t)}function d(){f(!0),i.hide()}return o().useEffect((function(){if(r&&!c)return i.on("ended",d),function(){return i.off("ended",d)}}),[]),o().useEffect((function(){l&&i.isFullscreen()&&i.exitFullscreen()}),[l]),o().createElement(o().Fragment,null,o().createElement(Hn,Object.assign({setShowSummary:f},t)),o().createElement(br,Object.assign({showSummary:l,setShowSummary:f},t)))}var Sr=n(83657);function xr(t){var e,n,r,i=(e=t.interactive,r=0,null===(n=null==e?void 0:e.timepoints)||void 0===n||n.forEach((function(t){var e;return null===(e=t.interactions)||void 0===e?void 0:e.forEach((function(){return r++}))})),r>0),a=[];return t.onClickEditDetails&&a.push({label:"Edit details",svgName:at.vn.Edit,button:!0,className:"btn btn-outline-dark",onClick:t.onClickEditDetails}),t.onClickPublish&&a.push({label:"Publish",button:!0,className:"btn btn-dark ml-2".concat(i?"":" disabled"),disabled:!i,tooltip:i?"":"Interactives cannot be published without questions",onClick:function(){i&&t.onClickPublish&&t.onClickPublish()}}),a.length?o().createElement(V.Nq,{node:t.portalNode},o().createElement(Sr.e,{actions:a})):o().createElement(o().Fragment,null)}var Ir=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n};function kr(t){var e=t.title,n=t.player,r=t.track,i=t.mode,a=t.interactive,c=t.imageApi,u=t.actionsPortalNode,f=t.questionListPortalNode,d=t.summaryPortalNode,p=t.resultsService,m=t.currentUser,v=t.progress,h=t.latestSession,y=t.clipOffset,g=t.analyticsService,b=t.enableImmersiveReader,w=t.mobile,E=function(t){var e=t.player,n=t.track,r=t.interactive,i=t.clipOffset,a=L(o().useState(!1),2),c=a[0],u=a[1],l=L(o().useState(!1),2),s=l[0],f=l[1],d=L(o().useState(null),2),p=d[0],m=d[1];function v(t){return i?t+i:t}function h(t){f(!!t&&c),u(t)}function y(){var t=n.activeCues;if(!t.length)return h(!1),void m(null);var o=r.timepoints.find((function(e){return e.id.toString()===t[0].text.toString()}));if(!o)return h(!1),void m(null);o.shouldPause&&(e.seeking()?e.one("play",(function(){return e.pause()})):e.pause()),h(!0),m(o)}function g(t){for(var e=0;e<n.cues.length;e++){var r=n.cues[e];if(r.text.toString()===t.toString())return r}}return o().useEffect((function(){return n.addEventListener("cuechange",y),function(){return n.removeEventListener("cuechange",y)}})),{open:c,setOpen:h,wasOpen:s,timepoint:p,continueInteractive:function(){h(!1),e.play()},updateCue:function(t,e){var n=g(t);n.text=e.toString(),n.originalCue_.text=e.toString()},addCue:function(t){var r=e.currentTime();n.addCue({startTime:v(r)-.001,endTime:v(r+1),text:t}),n.trigger("cv:cuechange"),e.paused()&&n.trigger("cuechange")},removeCue:function(t){t=v(t);for(var e=0;e<n.cues.length;){var r=n.cues[e];if(r.startTime<=t&&r.endTime>=t){n.removeCue(r),n.trigger("cv:cuechange"),n.trigger("cuechange");break}e++}},moveTimepoint:function(t){var r=g(p.id);if(r){var o=t/1e3;r.startTime=v(o),r.endTime=v(o+1),e.currentTime(o+.5,!0),p.visibleAt=t,n.trigger("cv:cuechange")}},getClipOffset:v}}({player:n,track:r,interactive:a,mode:i,clipOffset:y}),S=E.open,x=E.timepoint,I=E.wasOpen,k=Ir(E,["open","timepoint","wasOpen"]),O=function(t){var e=t.interactive,n=t.timepoint,r=t.player,i=t.mode,a=t.resultsService,c=t.latestSession,u=t.analyticsService,f=$e(t,["interactive","timepoint","player","mode","resultsService","latestSession","analyticsService"]),d=Ye({mode:i,timepoint:n,latestSession:c}),p=d.state,m=d.interaction,v=d.interactionState,h=d.timepointState,y=d.nextInteraction,g=d.nextInteractionState,b=$e(d,["state","interaction","interactionState","timepointState","nextInteraction","nextInteractionState"]),w=i===l.InteractiveMode.Create;function E(t){for(var n=0;n<e.timepoints.length;){for(var r=e.timepoints[n],o=0;o<r.interactions.length;){var i=r.interactions[o];if(i.id===t)return{localTimepoint:r,localInteraction:i};o++}n++}return{localInteraction:null,localTimepoint:null}}function S(t){var n=s.w.getTypeInfo(t.typeId);return{id:_(t.id)?void 0:t.id,typeId:t.typeId,type:n.typeName,interactiveId:e.id,timepointId:_(t.timepointId)?void 0:t.timepointId,order:t.order}}function x(t){return He(this,void 0,void 0,Ve().mark((function n(){var r,o,i,a,c,l,s;return Ve().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=E(t),o=r.localInteraction,i=r.localTimepoint,o&&i){n.next=3;break}throw new Error("Could not find the interaction and timepoint for the interactionId ".concat(t));case 3:if(a=S(o),_(o.id)){n.next=10;break}return n.next=7,z.deleteInteraction(o.id);case 7:null==u||u.logUserAction(a,{actionType:Vt.UserAction.Delete,entity:Vt.EntityType.Interaction,workflowPhase:Vt.WorkflowPhase.Complete}),n.next=11;break;case 10:null==u||u.logUserAction(a,{actionType:Vt.UserAction.Create,entity:Vt.EntityType.Interaction,workflowPhase:Vt.WorkflowPhase.Discard});case 11:if(c=i.interactions.findIndex((function(t){return t.id===o.id})),i.interactions.splice(c,1),b.clearInteractionState(o.id),l=b.getTimepointState(i.id),c<l.interactionIndex&&b.updateTimepointState(i.id,{interactionIndex:l.interactionIndex-1}),!(i.interactions.length>0)){n.next=18;break}return n.abrupt("return");case 18:if(_(i.id)){n.next=21;break}return n.next=21,z.deleteTimepoint(i.id);case 21:s=e.timepoints.findIndex((function(t){return t.id===i.id})),e.timepoints.splice(s,1),f.removeCue(i.visibleAt/1e3),b.clearTimepointState(i.id);case 25:case"end":return n.stop()}}),n)})))}function I(t){if(m){var e=_(m.id);e||(null==v?void 0:v.hasChanges)||(null==h?void 0:h.hasChanges)?Y.M.render(o().createElement("p",null,"Do you want to discard your changes?"),{title:"Unsaved changes",submitButtonProps:{onClick:function(){(null==h?void 0:h.hasChanges)&&N(!0),e?x(m.id):b.clearInteractionState(m.id),t&&t()},variant:"danger",text:"Discard"},cancelButtonProps:{variant:"link",text:"Cancel"}}):t&&t()}else t&&t()}function k(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(w)I((function(){b.updateTimepointState(n.id,{interactionIndex:t})}));else{var r=function(){b.updateTimepointState(n.id,{nextInteractionIndex:t}),window.requestAnimationFrame((function(){b.updateTimepointState(n.id,{nextInteractionIndex:t,slideIn:!0}),window.setTimeout((function(){b.updateTimepointState(n.id,{interactionIndex:t,nextInteractionIndex:null,slideIn:null})}),400)}))};e?I(r):r()}}function O(){h.interactionIndex+1>=n.interactions.length?f.continueInteractive():k(h.interactionIndex+1,!1)}function j(){e.timepoints.sort((function(t,e){return t.visibleAt>e.visibleAt?1:e.visibleAt>t.visibleAt?-1:0}))}function C(){k(n.interactions.length)}function N(t){(null==h?void 0:h.hasChanges)&&(t&&f.moveTimepoint(h.originalVisibleAt),b.updateTimepointState(n.id,{hasChanges:void 0,originalVisibleAt:void 0}),Ke=!1)}return{state:p,interaction:m,interactionState:v,timepointState:h,nextInteraction:y,nextInteractionState:g,skip:O,cancel:function(){return He(this,void 0,void 0,Ve().mark((function t(){return Ve().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(null==v?void 0:v.hasChanges)){t.next=3;break}return I(),t.abrupt("return");case 3:return t.next=5,x(m.id);case 5:f.setOpen(!0);case 6:case"end":return t.stop()}}),t)})))},addAnotherQuestion:C,goToTimepoint:function(t,n){var o=function(t){for(var n=0;n<e.timepoints.length;){var r=e.timepoints[n];if(r.id===t)return r;n++}return null}(t),i=o.interactions.find((function(t){return t.id.toString()===n.toString()}));r.currentTime(o.visibleAt/1e3),b.updateTimepointState(o.id,{interactionIndex:o.interactions.indexOf(i)})},discardChanges:I,changeIndex:k,promptDelete:function(t){var e=S(E(t).localInteraction);null==u||u.logUserAction(e,{actionType:Vt.UserAction.Delete,entity:Vt.EntityType.Interaction,workflowPhase:Vt.WorkflowPhase.Start}),Y.M.render(o().createElement("p",null,"Are you sure you want to delete this question?"),{title:"Delete question",submitButtonProps:{onClick:function(){return x(t)},variant:"danger",text:"Delete question"},cancelButtonProps:{variant:"link",text:"Cancel"}})},showTypeSelector:function(){r.pause(),f.setOpen(!0),n&&C()},cancelTypeSelector:function(){n?k(h.interactionIndex-1):(f.setOpen(!1),r.play())},deleteInteraction:x,saveInteraction:function(){return He(this,void 0,void 0,Ve().mark((function t(){var e,r,o,i,a,c;return Ve().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(w){t.next=2;break}throw new Error("Should not be calling onClickSave while viewing an interactive");case 2:if(l=m.typeId,!(e=(0,Wt[l])(b.getInteractionState(m.id),m))){t.next=7;break}return b.updateInteractionState(m.id,{error:e}),t.abrupt("return");case 7:if(b.updateInteractionState(m.id,{spinner:!0}),!_(n.id)){t.next=15;break}return r=n.id,t.next=12,z.saveTimepoint(n);case 12:f.updateCue(r,n.id),b.clearTimepointState(r),(null==h?void 0:h.hasChanges)&&(j(),N());case 15:return m.timepointId=n.id,o=m.id,i=Yt(m.typeId),t.next=20,i(b.getInteractionState(m.id),m);case 20:b.clearInteractionState(o),a=_(o),c=S(m),null==u||u.logUserAction(c,{actionType:a?Vt.UserAction.Create:Vt.UserAction.Edit,entity:Vt.EntityType.Interaction,workflowPhase:a?Vt.WorkflowPhase.Complete:Vt.WorkflowPhase.Save});case 24:case"end":return t.stop()}var l}),t)})))},addInteraction:function(t){var o;r.pause();var i=(null==n?void 0:n.id)||"new_".concat(Math.round(Math.random()*Number.MAX_SAFE_INTEGER)),a={id:"new_".concat(Math.round(Math.random()*Number.MAX_SAFE_INTEGER)),timepointId:i,typeId:t,order:(null===(o=null==n?void 0:n.interactions)||void 0===o?void 0:o.length)||0,interactiveId:e.id,data:{}},c=S(a);if(null==u||u.logUserAction(c,{actionType:Vt.UserAction.Create,entity:Vt.EntityType.Interaction,workflowPhase:Vt.WorkflowPhase.Start}),n)return n.interactions.push(a),void k(h.interactionIndex);var l=r.currentTime();e.timepoints||(e.timepoints=[]),e.timepoints.push({id:i,visibleAt:1e3*l,interactiveId:e.id,shouldPause:1,interactions:[a]}),j(),f.addCue(i)},submitInteractionAnswer:function(){return He(this,void 0,void 0,Ve().mark((function t(){var r,o,c,s;return Ve().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i===l.InteractiveMode.View){t.next=2;break}throw new Error("Should not be calling onClickSubmit while creating an interactive");case 2:if(!v.submitted){t.next=8;break}if(!(h.interactionIndex>=n.interactions.length)){t.next=6;break}return f.continueInteractive(),t.abrupt("return");case 6:return k(h.interactionIndex+1),t.abrupt("return");case 8:if(r=F(v),d=m.typeId,!(o=(0,_e[d])(r,m))){t.next=14;break}return b.updateInteractionState(m.id,{error:o}),t.abrupt("return");case 14:if(!a||!v.hasChanges){t.next=22;break}if(c=Re(m.typeId),b.updateInteractionState(m.id,{spinner:!0}),!c){t.next=22;break}return t.next=20,c(r,m,a.save);case 20:s=S(m),null==u||u.logUserAction(s,{actionType:Vt.UserAction.Submit,entity:Vt.EntityType.Interaction});case 22:if(b.updateInteractionState(m.id,{submitted:!0,error:null,hasChanges:!1,spinner:!1}),e.immediateFeedback){t.next=26;break}return O(),t.abrupt("return");case 26:Le(m.typeId)(m)||O();case 29:case"end":return t.stop()}var d}),t)})))},userUpdateInteractionState:b.userUpdateInteractionState,updateTimepointTime:function(t){var o=r.duration(),i=function(t){for(var r=n.visibleAt+1e3*t,o=t>0,i=0;i<e.timepoints.length;i++){var a=e.timepoints[i];r<a.visibleAt-1e3||r>a.visibleAt+1e3||(r=o?a.visibleAt+1001:a.visibleAt-1001,i=0)}return r}(t);if(!(i/1e3>o||i<0)){var a=n.visibleAt;Ke||(Ke=!0,b.updateTimepointState(n.id,{originalVisibleAt:a,hasChanges:!0})),f.moveTimepoint(i)}},saveTimepoint:function(){return He(this,void 0,void 0,Ve().mark((function t(){return Ve().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!_(n.id)){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,z.updateTimepoint(n);case 4:j(),N();case 6:case"end":return t.stop()}}),t)})))},clearTimepointTimeState:N,reOrderQuestions:function(t){return He(this,void 0,void 0,Ve().mark((function e(){var r,o;return Ve().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=0;case 1:if(!(r<t.length)){e.next=7;break}return e.next=4,z.saveInteraction(Object.assign(Object.assign({},t[r]),{order:r}));case 4:r++,e.next=1;break;case 7:o=n.interactions[h.interactionIndex],n.interactions=t,b.updateTimepointState(n.id,{interactionIndex:t.indexOf(o)});case 10:case"end":return e.stop()}}),e)})))}}}(Object.assign({mode:i,interactive:a,timepoint:x,player:n,resultsService:p,latestSession:h,analyticsService:g},k)),j=O.interaction,C=O.interactionState,N=O.nextInteraction,P=O.nextInteractionState,R=O.timepointState,M=O.state,U=Ir(O,["interaction","interactionState","nextInteraction","nextInteractionState","timepointState","state"]);!function(t){var e,n=t.mode,r=t.player,i=t.timepoint,a=t.interaction,c=t.discardChanges,u=t.interactionState,s=t.timepointState,f=(0,A.f)(),d=n===l.InteractiveMode.Create;o().useEffect((function(){if(d){if(_(null==a?void 0:a.id)||(null==u?void 0:u.hasChanges)||(null==s?void 0:s.hasChanges))return f.lock({id:"interactive",title:"Are you sure you want to leave?",text:"Your interactive still has unsaved changes"}),void r.lock((function(t){c(t)}));r.unlock(),f.unlock("interactive")}}),[a,null==u?void 0:u.hasChanges,null===(e=null==i?void 0:i.interactions)||void 0===e?void 0:e.length,null==s?void 0:s.hasChanges])}({mode:i,player:n,timepoint:x,interaction:j,discardChanges:U.discardChanges,interactionState:C,timepointState:R});var D={mode:i,open:S,isCreate:i===T.A.Create,interaction:j,nextInteraction:N,timepoint:x,interactive:a,interactionState:C,nextInteractionState:P,timepointState:R,player:n};return o().createElement(o().Fragment,null,!!u&&o().createElement(xr,{interactive:a,onClickEditDetails:t.onClickEditDetails,onClickPublish:t.onClickPublish,portalNode:u}),o().createElement(Je,Object.assign({},D,U)),o().createElement(Yn,Object.assign({imageApi:c,currentUser:m,immediateFeedback:a.immediateFeedback,delayFocus:!I,enableImmersiveReader:b},D,U,k)),o().createElement(Er,Object.assign({title:e,currentUser:m,state:M,portalNode:d,progress:v,resultsService:p,imageCdnUrl:c.toString(),onShowSummary:t.onShowSummary,mobile:w},D,U)),o().createElement(rn,Object.assign({portalNode:f},D,U)))}c.Z.registerComponent("Interactive",(0,N.Z)((function(t,e){return o().createElement(kr,Object.assign({player:t},e))})));var Or=n(9111),jr=n(13876);function Cr(t){var e=t.player;function n(){var t=e.getChild("ContinueSession");e.removeChild(t),t.dispose()}function r(){t.continue(!0),n()}return o().createElement(Or.G,{title:"Continue interactive?",closePopup:r,dialogClassName:"VVqKz"},o().createElement("p",null,"It looks like you've already started this interactive. Would you like to continue your attempt or start a new one?"),o().createElement(jr.u,{className:"kw8gW"},o().createElement(jr.u.Cancel,{text:"Start again",onClick:function(){t.continue(!1),n()}}),o().createElement(jr.u.Submit,{variant:"dark",text:"Continue",onClick:r})))}function Nr(t){return Nr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nr(t)}function Tr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Nr(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!==Nr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key,"string"),"symbol"===Nr(o)?o:String(o)),r)}var o}function Lr(t,e){return Lr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Lr(t,e)}function Pr(t,e){if(e&&("object"===Nr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Ar(t){return Ar=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ar(t)}c.Z.registerComponent("ContinueSession",(0,N.Z)((function(t,e){return o().createElement(Cr,Object.assign({player:t},e))})));var _r=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Lr(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Ar(r);if(o){var n=Ar(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Pr(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(e=i.call(this,t)).enabled=!1,e.player.ready((function(){return e.initialize()})),e}return e=a,(n=[{key:"initialize",value:function(){this.onReceiveMessage=this.onReceiveMessage.bind(this),window.addEventListener("message",this.onReceiveMessage,!1),window.parent.postMessage(JSON.stringify({type:"cv-app-loaded"}),"*")}},{key:"dispose",value:function(){window.removeEventListener("message",this.onReceiveMessage)}},{key:"onReceiveMessage",value:function(t){var e={};try{e=JSON.parse(t.data)}catch(t){return}"enable-grade-passback"===e.type&&(this.enabled=!0,window.removeEventListener("message",this.onReceiveMessage))}},{key:"submit",value:function(t,e){var n={type:"cv-lms-submit-score",data:{score:t,fullyGraded:e}};window.parent.postMessage(JSON.stringify(n),"*")}}])&&Tr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(c.Z.getPlugin("plugin"));function Fr(t){return Fr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fr(t)}function Rr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Fr(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!==Fr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key,"string"),"symbol"===Fr(o)?o:String(o)),r)}var o}function Mr(t,e){return Mr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Mr(t,e)}function Ur(t,e){if(e&&("object"===Fr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Dr(t){return Dr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Dr(t)}c.Z.registerPlugin("gradePassbackPlugin",_r);var Gr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Mr(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Dr(r);if(o){var n=Dr(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Ur(this,t)});function a(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=i.call(this,t)).continueSession=!1,n.options=e,t.ready((function(){return n.initialize()})),n}return e=a,(n=[{key:"initialize",value:function(){var t=this;this.player.gradePassbackPlugin(),u.O.useTrack(this.player,"metadata","interactive",this.onTrackLoaded.bind(this)),this.player.addClass("cv-interactive-plugin"),this.options.resultsService&&!this.options.latestSession&&(this.startSession=this.startSession.bind(this),this.player.one("play",this.startSession),this.on("dispose",(function(){t.player.off("play",t.startSession)})))}},{key:"startSession",value:function(){var t,e=null===(t=this.options.latestSession)||void 0===t?void 0:t.resultId;this.continueSession||(e=null),this.options.resultsService.start(e)}},{key:"onTrackLoaded",value:function(t){var e=this;this.options.resultsService&&this.options.latestSession?this.player.addChild("ContinueSession",{continue:function(n){var r;null===(r=e.options.analyticsService)||void 0===r||r.logUserAction({},{actionType:Vt.UserAction.Click,entity:Vt.EntityType.Interactive,descriptor:n?Vt.InteractiveSessionDescriptor.ContinueSession:Vt.InteractiveSessionDescriptor.NewSession}),e.continueSession=n,e.startSession(),e.addChildren(t),e.continueSession||e.player.currentTime(0),e.player.play()}}):this.addChildren(t)}},{key:"getClipOffset",value:function(){return this.options.clipOffset?parseFloat(this.options.clipOffset.toPrecision(4)):null}},{key:"addChildren",value:function(t){this.player.addChild("Interactive",Object.assign(Object.assign({},this.options),{track:t,clipOffset:this.getClipOffset(),mode:this.options.mode||l.InteractiveMode.View,latestSession:this.continueSession&&this.options.latestSession})),this.player.controlBar.getChild("progressControl").getChild("SeekBar").addChild(new C(this.player,{interactive:this.options.interactive,track:t}))}}])&&Rr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(c.Z.getPlugin("plugin"));c.Z.registerPlugin("viewInteractivePlugin",Gr),n(1073);var qr=n(47724);function Br(t){return Br="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Br(t)}function Wr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Br(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!==Br(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key,"string"),"symbol"===Br(o)?o:String(o)),r)}var o}function zr(t,e){return zr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},zr(t,e)}function Yr(t,e){if(e&&("object"===Br(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Zr(t){return Zr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Zr(t)}var Vr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&zr(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Zr(r);if(o){var n=Zr(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Yr(this,t)});function a(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),i.call(this,"Could not connect to submit interactive results")}return e=a,(n=[{key:"name",get:function(){return"InternetConnectivityError"}},{key:"dialogOptions",get:function(){return{title:"Connection issues",text:"There seems to be an issue with your internet connection. Refresh the page to try again. ",buttons:[{text:"Refresh",className:"btn btn-dark",success:!0}]}}},{key:"onDone",value:function(){window.location.reload()}}])&&Wr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(n(47663).S);function Hr(t){return Hr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hr(t)}function $r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Kr(){Kr=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),c=new k(o||[]);return r(a,"_invoke",{value:E(t,n,c)}),a}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function d(){}function p(){}function m(){}var v={};u(v,i,(function(){return this}));var h=Object.getPrototypeOf,y=h&&h(h(O([])));y&&y!==e&&n.call(y,i)&&(v=y);var g=m.prototype=d.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(r,i,a,c){var u=s(t[r],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==Hr(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function E(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=S(a,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=s(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function S(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=s(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:void 0,done:!0}}return p.prototype=m,r(g,"constructor",{value:m,configurable:!0}),r(m,"constructor",{value:p,configurable:!0}),p.displayName=u(m,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new w(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=O,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(I),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),I(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;I(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:O(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function Qr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Hr(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!==Hr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key,"string"),"symbol"===Hr(o)?o:String(o)),r)}var o}var Jr=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function c(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}u((r=r.apply(t,e||[])).next())}))},Xr=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.cache=[],this.retryCount=0,this.options=e,this.connection=(new qr.su).withUrl("".concat(e.playerApi.origin,"/hubs/interactives"),{withCredentials:!1}).configureLogging(qr.in.Error).withAutomaticReconnect([0,2e3,1e4,3e4]).build(),this.connection.onreconnecting((function(){n.log("reconnecting"),n.isConnected=!1})),this.connection.onreconnected((function(){n.log("reconnected"),n.isConnected=!0,n.flush()})),this.connection.onclose((function(){n.log("connection closed"),n.isConnected=!1,n.reconnect()})),this.save=this.save.bind(this)}var e,n;return e=t,(n=[{key:"start",value:function(t){var e=this;this.isConnected||(t&&(this.resultId=t),this.log("starting"),this.connection.start().then((function(){return Jr(e,void 0,void 0,Kr().mark((function t(){return Kr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.log("connected"),this.retryCount=0,this.isConnected=!0,t.next=5,this.startSession();case 5:this.flush();case 6:case"end":return t.stop()}}),t,this)})))})).catch((function(){e.reconnect()})))}},{key:"stop",value:function(){return Jr(this,void 0,void 0,Kr().mark((function t(){return Kr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.flush();case 2:this.connection.stop();case 3:case"end":return t.stop()}}),t,this)})))}},{key:"log",value:function(){}},{key:"reconnect",value:function(){this.retryCount>=5?i.Q.ErrorHelper.throw(new Vr):(this.retryCount++,this.start())}},{key:"startSession",value:function(){return Jr(this,void 0,void 0,Kr().mark((function t(){var e,n,r,o,a,c,u;return Kr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.resultId){t.next=2;break}return t.abrupt("return");case 2:return e=this.options,n=e.interactiveId,r=e.mediaId,o=e.userId,a=e.customerId,c=e.shareId,t.prev=3,t.next=6,this.connection.invoke("startSession",n,r,o,a,c);case 6:u=t.sent,this.resultId=u.resultId,t.next=13;break;case 10:t.prev=10,t.t0=t.catch(3),i.Q.ErrorHelper.throw(new Vr);case 13:case"end":return t.stop()}}),t,this,[[3,10]])})))}},{key:"flush",value:function(){return Jr(this,void 0,void 0,Kr().mark((function t(){var e=this;return Kr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.isConnected&&this.resultId){t.next=2;break}return t.abrupt("return");case 2:if(this.cache.length){t.next=4;break}return t.abrupt("return");case 4:(n=this.cache,function(t){if(Array.isArray(t))return $r(t)}(n)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||function(t,e){if(t){if("string"==typeof t)return $r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$r(t,e):void 0}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).forEach((function(t){return Jr(e,void 0,void 0,Kr().mark((function e(){return Kr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.connection.invoke("saveActions",this.resultId,t.interactionId,t.results);case 3:this.cache.splice(this.cache.indexOf(t),1),this.log("Saved result",t),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.error("Failed to save results",t);case 10:case"end":return e.stop()}}),e,this,[[0,7]])})))}));case 5:case"end":return t.stop()}var n}),t,this)})))}},{key:"save",value:function(t,e){return Jr(this,void 0,void 0,Kr().mark((function n(){var r;return Kr().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(this.resultId){n.next=2;break}throw new Error("Session has not started");case 2:return r=e.map((function(t){return{actionableItemId:+t.actionableItemId,value:t.value}})),this.cache.push({interactionId:t,results:r}),n.next=6,this.flush();case 6:case"end":return n.stop()}}),n,this)})))}}])&&Qr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),to=n(85768);function eo(t){return eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eo(t)}function no(){no=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),c=new k(o||[]);return r(a,"_invoke",{value:E(t,n,c)}),a}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function d(){}function p(){}function m(){}var v={};u(v,i,(function(){return this}));var h=Object.getPrototypeOf,y=h&&h(h(O([])));y&&y!==e&&n.call(y,i)&&(v=y);var g=m.prototype=d.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(r,i,a,c){var u=s(t[r],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==eo(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function E(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=S(a,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=s(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function S(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=s(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:void 0,done:!0}}return p.prototype=m,r(g,"constructor",{value:m,configurable:!0}),r(m,"constructor",{value:p,configurable:!0}),p.displayName=u(m,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new w(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,c,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=O,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(I),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),I(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;I(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:O(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function ro(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function oo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==eo(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!==eo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key,"string"),"symbol"===eo(o)?o:String(o)),r)}var o}function io(){return io="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=ao(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},io.apply(this,arguments)}function ao(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=lo(t)););return t}function co(t,e){return co=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},co(t,e)}function uo(t,e){if(e&&("object"===eo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function lo(t){return lo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},lo(t)}var so=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&co(t,e)}(u,t);var e,n,r,o,c=(r=u,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=lo(r);if(o){var n=lo(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return uo(this,t)});function u(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),(n=c.call(this,t,e)).totalProgress=[],R.e.setToken("gateway",n.options.authToken),n.player.one("dispose",(function(){n.resultsService&&n.resultsService.stop()})),n.options.mode===l.InteractiveMode.Create&&n.player.addClass("cv-create-interactives"),n}return e=u,n=[{key:"togglePreviewPreventScrubbing",value:function(){var t=this.player.preventScrubbingPlugin();t&&t.togglePreview(!t.isPreviewing)}},{key:"getPlayerOptions",value:function(){var t=io(lo(u.prototype),"getPlayerOptions",this).call(this);return t.setMaxHeight=!1,this.options.embed||(t.aspectRatio="16:9"),t}},{key:"onFlushProgress",value:function(t){var e,n;io(lo(u.prototype),"onFlushProgress",this).call(this,t),this.options.mode!==l.InteractiveMode.Create&&(e=this.totalProgress).push.apply(e,function(t){if(Array.isArray(t))return ro(t)}(n=t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||function(t,e){if(t){if("string"==typeof t)return ro(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ro(t,e):void 0}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}},{key:"additionalSetup",value:function(t){var e,n,r,o,i=this,a=Object.create(null,{additionalSetup:{get:function(){return io(lo(u.prototype),"additionalSetup",i)}}});return e=this,n=void 0,r=void 0,o=no().mark((function e(){var n=this;return no().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.additionalSetup.call(this,t),this.setupClipPlugin(t),this.setupPreventScrubbingPlugin(t),this.analyticsService||this.options.fetch||this.options.offlinePlaybackObject?this.setupViewInteractivePlugin(t):this.one("config:loaded",(function(){return n.setupViewInteractivePlugin(t)}));case 4:case"end":return e.stop()}}),e,this)})),new(r||(r=Promise))((function(t,i){function a(t){try{u(o.next(t))}catch(t){i(t)}}function c(t){try{u(o.throw(t))}catch(t){i(t)}}function u(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(a,c)}u((o=o.apply(e,n||[])).next())}))}},{key:"handleAutoplay",value:function(t){var e;this.options.collectResults&&this.options.currentUser&&this.options.shareId&&(null===(e=t.additionalData)||void 0===e?void 0:e.latestSession)?this.options.autoplay&&this.showSplash():io(lo(u.prototype),"handleAutoplay",this).call(this,t)}},{key:"setupPreventScrubbingPlugin",value:function(t){var e,n;if(null===(e=t.additionalData)||void 0===e?void 0:e.interactive){var r=t.additionalData.interactive,o=this.options.mode===l.InteractiveMode.Create||!this.options.collectResults;this.player.preventScrubbingPlugin({isEnabled:!o&&r.preventScrubbing,furthestVisitedTime:null!==(n=this.options.furthestVisitedTime)&&void 0!==n?n:0})}}},{key:"setupClipPlugin",value:function(t){var e;if(null===(e=null==t?void 0:t.additionalData)||void 0===e?void 0:e.clipData){var n=t.additionalData.clipData;this.player.clipPlugin({startTime:n.startTime,endTime:n.endTime})}}},{key:"setupViewInteractivePlugin",value:function(t){var e;this.track=function(t,e){var n,r=t.addTextTrack("metadata","interactive"),o=e.additionalData.interactive,i=null===(n=e.additionalData.clipData)||void 0===n?void 0:n.startTime;return o.timepoints.forEach((function(t){var e,n=t.visibleAt/1e3,o=t.visibleFor?n+t.visibleFor/1e3:n+1;i&&(n+=i,o+=i),(null===(e=t.interactions)||void 0===e?void 0:e.length)&&r.addCue({startTime:n-.001,endTime:o,text:t.id})})),r}(this.player,t);var n=t.additionalData.interactive,r=null===(e=t.additionalData.clipData)||void 0===e?void 0:e.startTime;this.options.collectResults&&(this.options.currentUser||i.Q.ErrorHelper.throw(new a.H("Must provide a currentUser in order to collect interactive results")),this.options.shareId||i.Q.ErrorHelper.throw(new a.H("Must provide a shareId in order to collect interactive results")),this.resultsService=new Xr({interactiveId:n.id,mediaId:t.mediaId,userId:this.options.currentUser.id,customerId:this.options.currentUser.customerId,playerApi:this.options.playerApi,shareId:this.options.shareId})),this.player.viewInteractivePlugin({interactive:n,title:t.title,mode:this.options.mode,imageApi:this.options.imageApi,resultsService:this.resultsService,actionsPortalNode:this.options.actionsPortalNode,questionListPortalNode:this.options.questionListPortalNode,summaryPortalNode:this.options.summaryPortalNode,currentUser:this.options.currentUser,latestSession:t.additionalData.latestSession,progress:this.totalProgress,clipOffset:r,analyticsService:this.analyticsService,enableImmersiveReader:this.options.enableImmersiveReader,onShowSummary:this.options.onShowSummary,onClickEditDetails:this.options.onClickEditDetails,onClickPublish:this.options.onClickPublish,mobile:this.options.mobile})}},{key:"getAdditionalAnalyticsData",value:function(t){var e,n,r,o;return(null===(n=null===(e=t.additionalData)||void 0===e?void 0:e.clipData)||void 0===n?void 0:n.clipId)?{clip:{id:null===(o=null===(r=t.additionalData)||void 0===r?void 0:r.clipData)||void 0===o?void 0:o.clipId}}:{}}},{key:"getSeekBarOptions",value:function(){return{ignoreChapters:!0}}},{key:"getAnalyticsPlayerType",value:function(){return"interactive-player"}},{key:"setFavourite",value:function(t,e){this.player.favouritePlugin().setFavourite(t,e)}},{key:"setActivityStatus",value:function(t,e){this.player.activityStatusPlugin().setActivityStatus(t,e)}}],n&&oo(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(to.r);function fo(t){var e=t.onReady,n=t.className,r=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(t,["onReady","className"]),i=o().useRef();return o().useEffect((function(){var t=new so(i.current,r);return e&&t.ready((function(){e(t)})),function(){window.requestAnimationFrame((function(){return t.dispose()}))}}),[]),o().createElement(o().Fragment,null,o().createElement("div",{ref:i,className:n}),o().createElement("div",{id:"popup-region"}))}}}]);