From adabf21d34eca60fec022f4042183068488a97cb Mon Sep 17 00:00:00 2001 From: Matthias Opitz Date: Mon, 29 Jan 2024 09:38:10 +0000 Subject: [PATCH 1/2] updates to comply latest GHA requirements --- tests/freezecontext_test.php | 6 ++--- tests/manager_test.php | 39 ++++++++++++++++++--------------- tests/privacy_provider_test.php | 2 +- 3 files changed, 25 insertions(+), 22 deletions(-) diff --git a/tests/freezecontext_test.php b/tests/freezecontext_test.php index b69e8bd..b015e80 100644 --- a/tests/freezecontext_test.php +++ b/tests/freezecontext_test.php @@ -52,7 +52,7 @@ protected function setUp(): void { * @covers \block_lifecycle\task\freezecontext::get_name() * @return void */ - public function test_get_name() { + public function test_get_name(): void { $task = new freezecontext(); $this->assertEquals('Task to freeze course context', $task->get_name()); } @@ -61,10 +61,10 @@ public function test_get_name() { * Test execute. * * @covers \block_lifecycle\task\freezecontext::execute() - * @throws \coding_exception + * @return void * @throws \dml_exception */ - public function test_execute() { + public function test_execute(): void { // Suppress text output during tests. $this->setOutputCallback(function(){ }); diff --git a/tests/manager_test.php b/tests/manager_test.php index 1381289..03c6aee 100644 --- a/tests/manager_test.php +++ b/tests/manager_test.php @@ -94,7 +94,7 @@ protected function setUp(): void { * @return void * @throws \dml_exception */ - public function test_get_potential_academic_years() { + public function test_get_potential_academic_years(): void { $years = manager::get_potential_academic_years(); $this->assertCount(4, $years); @@ -112,7 +112,7 @@ public function test_get_potential_academic_years() { * @return void * @throws \dml_exception */ - public function test_get_clc_custom_course_fields() { + public function test_get_clc_custom_course_fields(): void { $fields = manager::get_clc_custom_course_fields(); $this->assertCount(2, $fields); } @@ -121,9 +121,10 @@ public function test_get_clc_custom_course_fields() { * Test get_courses_for_context_freezing * * @covers \block_lifecycle\manager::get_courses_for_context_freezing() + * @return void * @throws \dml_exception */ - public function test_get_courses_for_context_freezing() { + public function test_get_courses_for_context_freezing(): void { $coursestofreeze = manager::get_courses_for_context_freezing(); // Test only one valid course can be found. @@ -131,14 +132,14 @@ public function test_get_courses_for_context_freezing() { $this->assertEquals($this->courseshouldbefrozen->id, $coursestofreeze[0]->id); } - /** * Test freeze_course. * * @covers \block_lifecycle\manager::freeze_course() - * @throws \coding_exception + * @return void + * @throws coding_exception */ - public function test_freeze_course() { + public function test_freeze_course(): void { $dg = $this->getDataGenerator(); // Create course, set start date 2020-09-01, end date 2021-06-30. $course = $dg->create_course(['startdate' => 1598914800, 'enddate' => 1625007600, 'customfield_course_year' => '2020']); @@ -164,9 +165,11 @@ public function test_freeze_course() { * Test check_course_is_eligible_for_context_freezing. * * @covers \block_lifecycle\manager::check_course_is_eligible_for_context_freezing() + * @return void * @throws \ReflectionException + * @throws coding_exception */ - public function test_check_course_is_eligible_for_context_freezing() { + public function test_check_course_is_eligible_for_context_freezing(): void { $mockedinstance = $this->getMockBuilder(manager::class) ->disableOriginalConstructor() ->getMock(); @@ -233,9 +236,10 @@ public function test_check_course_is_eligible_for_context_freezing() { * Test get_course_clc_academic_year. * * @covers \block_lifecycle\manager::get_course_clc_academic_year() + * @return void * @throws \ReflectionException */ - public function test_get_course_clc_academic_year() { + public function test_get_course_clc_academic_year(): void { $mockedinstance = $this->getMockBuilder(manager::class) ->disableOriginalConstructor() ->getMock(); @@ -269,7 +273,7 @@ public function test_get_course_clc_academic_year() { * @return void * @throws \ReflectionException */ - public function test_get_course_lifecycle_info() { + public function test_get_course_lifecycle_info(): void { // Test course academic year is 2020. $result = manager::get_course_lifecycle_info($this->course1->id); $this->assertEquals(['class' => '', 'text' => 'Moodle 2020/21'], $result); @@ -291,7 +295,7 @@ public function test_get_course_lifecycle_info() { * @throws \dml_exception * @throws coding_exception */ - public function test_should_show_ay_label() { + public function test_should_show_ay_label(): void { $dg = $this->getDataGenerator(); // Create courses. // Start date 2021-09-01. @@ -327,7 +331,6 @@ public function test_should_show_ay_label() { $this->assertFalse($result); } - /** * Test should_show_auto_freezing_preferences(). * @@ -336,7 +339,7 @@ public function test_should_show_ay_label() { * @throws \dml_exception * @throws coding_exception */ - public function test_should_show_auto_freezing_preferences() { + public function test_should_show_auto_freezing_preferences(): void { $dg = $this->getDataGenerator(); // Test teacher can see the block options. @@ -375,7 +378,7 @@ public function test_should_show_auto_freezing_preferences() { * @throws \dml_exception * @throws coding_exception */ - public function test_update_auto_freezing_preferences() { + public function test_update_auto_freezing_preferences(): void { $dg = $this->getDataGenerator(); $course = $dg->create_course(); $preferences = new \stdClass(); @@ -411,7 +414,7 @@ public function test_update_auto_freezing_preferences() { * @covers \block_lifecycle\manager::is_course_frozen() * @return void */ - public function test_is_course_frozen() { + public function test_is_course_frozen(): void { // Test course is not frozen. $result = manager::is_course_frozen($this->course1->id); $this->assertFalse($result); @@ -430,7 +433,7 @@ public function test_is_course_frozen() { * @return void * @throws \dml_exception */ - public function test_get_auto_context_freezing_preferences() { + public function test_get_auto_context_freezing_preferences(): void { $result = manager::get_auto_context_freezing_preferences($this->courseshouldbefrozen->id); $this->assertEquals('0', $result->freezeexcluded); $this->assertEquals(strtotime('2022-10-31'), $result->freezedate); @@ -443,7 +446,7 @@ public function test_get_auto_context_freezing_preferences() { * @return void * @throws \dml_exception */ - public function test_get_scheduled_freeze_date() { + public function test_get_scheduled_freeze_date(): void { global $DB; // Test course without CLC academic year, no scheduled freeze date should be returned. @@ -480,7 +483,7 @@ public function test_get_scheduled_freeze_date() { * @return void * @throws \dml_exception */ - public function test_get_weeks_delay_in_seconds() { + public function test_get_weeks_delay_in_seconds(): void { // Test week delay config is 0. $result = manager::get_weeks_delay_in_seconds(); $this->assertEquals('0', $result); @@ -498,7 +501,7 @@ public function test_get_weeks_delay_in_seconds() { * @return void * @throws \ReflectionException */ - public function test_get_furthest_date() { + public function test_get_furthest_date(): void { $mockedinstance = $this->getMockBuilder(manager::class) ->disableOriginalConstructor() ->getMock(); diff --git a/tests/privacy_provider_test.php b/tests/privacy_provider_test.php index b94647d..136f00a 100644 --- a/tests/privacy_provider_test.php +++ b/tests/privacy_provider_test.php @@ -39,7 +39,7 @@ protected function setUp(): void { * @return void * @throws \coding_exception */ - public function test_get_reason() { + public function test_get_reason(): void { $reason = get_string(provider::get_reason(), 'block_lifecycle'); $this->assertEquals('The Lifecycle block does not store personal data', $reason); } From ae21cd4111c722af0496d1bb228516255e6c934f Mon Sep 17 00:00:00 2001 From: Matthias Opitz Date: Mon, 29 Jan 2024 09:44:42 +0000 Subject: [PATCH 2/2] re-grunted --- amd/build/lifecycle.min.js | 2 +- amd/build/lifecycle.min.js.map | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/amd/build/lifecycle.min.js b/amd/build/lifecycle.min.js index c1b2e5c..d5691ff 100644 --- a/amd/build/lifecycle.min.js +++ b/amd/build/lifecycle.min.js @@ -1,3 +1,3 @@ -define("block_lifecycle/lifecycle",["exports","core/ajax","core/notification"],(function(_exports,_ajax,_notification){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=void 0,_ajax=_interopRequireDefault(_ajax),_notification=_interopRequireDefault(_notification);var defaultfreezedate="",originalfreezedatevalue="";function togglefreezebutton(checked){var readonlydateinput=document.getElementById("delayfreezedate");checked?(readonlydateinput.value="",readonlydateinput.disabled=!0):readonlydateinput.disabled=!1}function togglesettings(){var content=document.getElementById("automatic-read-only-settings");document.getElementById("override-freeze-date-button").classList.toggle("active"),content.style.maxHeight?content.style.maxHeight=null:content.style.maxHeight=content.scrollHeight+"px"}function initscheduledfreezedateblock(courseid){var scheduledfreezedatecontainer=document.getElementById("scheduled-freeze-date-container");originalfreezedatevalue=document.getElementById("delayfreezedate").value,scheduledfreezedatecontainer.style.display="none",_ajax.default.call([{methodname:"block_lifecycle_get_scheduled_freeze_date",args:{courseid:courseid}}])[0].done((function(response){document.getElementById("togglefreezebutton").checked?togglefreezebutton(!0):(document.getElementById("scheduled-freeze-date").innerHTML=response.scheduledfreezedate,scheduledfreezedatecontainer.style.display="block"),"true"===response.success&&(defaultfreezedate=response.defaultfreezedate)})).fail((function(err){window.console.log(err)}))}_exports.init=function(courseid){document.getElementById("lifecycle-settings-container")&&(initscheduledfreezedateblock(courseid),document.getElementById("togglefreezebutton").addEventListener("click",(function(event){togglefreezebutton(event.target.checked)})),document.getElementById("update_auto_freezing_preferences_button").addEventListener("click",(function(){!function(courseid){var preferences={togglefreeze:document.getElementById("togglefreezebutton").checked,delayfreezedate:document.getElementById("delayfreezedate").value};(function(){var freezedateelement=document.getElementById("delayfreezedate");if(freezedateelement.value.length>0){if(""===defaultfreezedate)return _notification.default.alert("Error","Could not get the automatically suggested date, please try again later.","OK"),freezedateelement.value=originalfreezedatevalue,!1;var defaultfreezedateobj=new Date(defaultfreezedate),freezedateobj=new Date(freezedateelement.value);if(freezedateobj{document.getElementById("lifecycle-settings-container")&&(initscheduledfreezedateblock(courseid),document.getElementById("togglefreezebutton").addEventListener("click",(event=>{togglefreezebutton(event.target.checked)})),document.getElementById("update_auto_freezing_preferences_button").addEventListener("click",(()=>{!function(courseid){let preferences={togglefreeze:document.getElementById("togglefreezebutton").checked,delayfreezedate:document.getElementById("delayfreezedate").value};(function(){let freezedateelement=document.getElementById("delayfreezedate");if(freezedateelement.value.length>0){if(""===defaultfreezedate)return _notification.default.alert("Error","Could not get the automatically suggested date, please try again later.","OK"),freezedateelement.value=originalfreezedatevalue,!1;{let defaultfreezedateobj=new Date(defaultfreezedate),freezedateobj=new Date(freezedateelement.value);if(freezedateobj {\n // The course is read-only. Do nothing.\n if (!document.getElementById('lifecycle-settings-container')) {\n return;\n }\n\n initscheduledfreezedateblock(courseid);\n // On click listener for \"Disable Automatic Read-Only\" toggle.\n document.getElementById('togglefreezebutton').addEventListener('click', (event) => {\n togglefreezebutton(event.target.checked);\n });\n\n // Save button.\n document.getElementById('update_auto_freezing_preferences_button').addEventListener('click', () => {\n updatepreferences(courseid);\n });\n\n // Drop down settings button.\n document.getElementById('override-freeze-date-button').addEventListener(\"click\", function(e) {\n e.preventDefault();\n togglesettings();\n });\n};\n\n/**\n * Disable read-only date input when \"Disable Automatic Read-Only button\" is on.\n *\n * @param {boolean} checked\n */\nfunction togglefreezebutton(checked) {\n let readonlydateinput = document.getElementById('delayfreezedate');\n if (checked) {\n readonlydateinput.value = '';\n readonlydateinput.disabled = true;\n } else {\n readonlydateinput.disabled = false;\n }\n}\n\n/**\n * Toggle the automatic read only settings container.\n */\nfunction togglesettings() {\n let content = document.getElementById('automatic-read-only-settings');\n document.getElementById('override-freeze-date-button').classList.toggle('active');\n if (content.style.maxHeight) {\n content.style.maxHeight = null;\n } else {\n content.style.maxHeight = content.scrollHeight + \"px\";\n }\n}\n\n/**\n * Validate the preferences.\n * @return {boolean}\n */\nfunction validate() {\n let freezedateelement = document.getElementById('delayfreezedate');\n\n if (freezedateelement.value.length > 0) {\n // The default suggested date is not initialized, so cannot continue the checking.\n if (defaultfreezedate === '') {\n notification.alert(\n 'Error',\n 'Could not get the automatically suggested date, please try again later.',\n 'OK'\n );\n freezedateelement.value = originalfreezedatevalue;\n return false;\n } else {\n let defaultfreezedateobj = new Date(defaultfreezedate);\n let freezedateobj = new Date(freezedateelement.value);\n\n // The override freeze date should not be saved when it is earlier than the default suggested date.\n if (freezedateobj < defaultfreezedateobj || freezedateobj < new Date()) {\n notification.alert(\n 'Invalid Selection',\n 'The date for a Read-Only override must be post the automatically suggested date (' +\n defaultfreezedateobj.toLocaleDateString() +\n '), earlier dates may not be used.',\n 'OK'\n );\n freezedateelement.value = originalfreezedatevalue;\n return false;\n }\n }\n }\n\n return true;\n}\n\n/**\n * Initialize the scheduled freeze date container.\n *\n * @param {int} courseid\n */\nfunction initscheduledfreezedateblock(courseid) {\n let scheduledfreezedatecontainer = document.getElementById('scheduled-freeze-date-container');\n originalfreezedatevalue = document.getElementById('delayfreezedate').value;\n\n // Hide scheduled read-only date text at the beginning.\n scheduledfreezedatecontainer.style.display = 'none';\n\n // Get scheduled read-only dates.\n Ajax.call([{\n methodname: 'block_lifecycle_get_scheduled_freeze_date',\n args: {\n 'courseid': courseid\n },\n }])[0].done(function(response) {\n // Show scheduled date.\n if (!document.getElementById('togglefreezebutton').checked) {\n document.getElementById('scheduled-freeze-date').innerHTML = response.scheduledfreezedate;\n scheduledfreezedatecontainer.style.display = 'block';\n } else {\n // Disable read-only date input depends on freeze button status.\n togglefreezebutton(true);\n }\n // Set the default suggested date.\n if (response.success === 'true') {\n defaultfreezedate = response.defaultfreezedate;\n }\n }).fail(function(err) {\n window.console.log(err);\n });\n}\n\n/**\n * Update the auto context freezing preferences.\n * @param {int} courseid\n */\nfunction updatepreferences(courseid) {\n let preferences = {\n togglefreeze: document.getElementById('togglefreezebutton').checked,\n delayfreezedate: document.getElementById('delayfreezedate').value\n };\n\n if (validate()) {\n Ajax.call([{\n methodname: 'block_lifecycle_update_auto_freezing_preferences',\n args: {\n 'courseid': courseid,\n 'preferences': JSON.stringify(preferences)\n },\n }])[0].done(function(response) {\n notification.addNotification({\n message: response.message,\n type: response.success ? 'success' : 'error'\n });\n initscheduledfreezedateblock(courseid);\n togglesettings();\n }).fail(function(err) {\n window.console.log(err);\n });\n }\n}\n"],"names":["defaultfreezedate","originalfreezedatevalue","togglefreezebutton","checked","readonlydateinput","document","getElementById","value","disabled","togglesettings","content","classList","toggle","style","maxHeight","scrollHeight","initscheduledfreezedateblock","courseid","scheduledfreezedatecontainer","display","call","methodname","args","done","response","innerHTML","scheduledfreezedate","success","fail","err","window","console","log","addEventListener","event","target","preferences","togglefreeze","delayfreezedate","freezedateelement","length","alert","defaultfreezedateobj","Date","freezedateobj","toLocaleDateString","validate","JSON","stringify","addNotification","message","type","updatepreferences","e","preventDefault"],"mappings":"kXAIIA,kBAAoB,GAEpBC,wBAA0B,YA+BrBC,mBAAmBC,aACpBC,kBAAoBC,SAASC,eAAe,mBAC5CH,SACAC,kBAAkBG,MAAQ,GAC1BH,kBAAkBI,UAAW,GAE7BJ,kBAAkBI,UAAW,WAO5BC,qBACDC,QAAUL,SAASC,eAAe,gCACtCD,SAASC,eAAe,+BAA+BK,UAAUC,OAAO,UACpEF,QAA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,iBAElC,GAAGb,MAAK,SAASC,gCACJyB,gBAAgB,CACzBC,QAAS1B,SAAS0B,QAClBC,KAAM3B,SAASG,QAAU,UAAY,UAEzCX,6BAA6BC,UAC7BR,oBACDmB,MAAK,SAASC,KACbC,OAAOC,QAAQC,IAAIH,QA1IvBuB,CAAkBnC,aAItBZ,SAASC,eAAe,+BAA+B2B,iBAAiB,SAAS,SAASoB,GACtFA,EAAEC,iBACF7C"} \ No newline at end of file +{"version":3,"file":"lifecycle.min.js","sources":["../src/lifecycle.js"],"sourcesContent":["import Ajax from 'core/ajax';\nimport notification from 'core/notification';\n\n// Default auto suggested read-only date.\nlet defaultfreezedate = '';\n// The datepicker original value before user make any changes.\nlet originalfreezedatevalue = '';\n\nexport const init = (courseid) => {\n // The course is read-only. Do nothing.\n if (!document.getElementById('lifecycle-settings-container')) {\n return;\n }\n\n initscheduledfreezedateblock(courseid);\n // On click listener for \"Disable Automatic Read-Only\" toggle.\n document.getElementById('togglefreezebutton').addEventListener('click', (event) => {\n togglefreezebutton(event.target.checked);\n });\n\n // Save button.\n document.getElementById('update_auto_freezing_preferences_button').addEventListener('click', () => {\n updatepreferences(courseid);\n });\n\n // Drop down settings button.\n document.getElementById('override-freeze-date-button').addEventListener(\"click\", function(e) {\n e.preventDefault();\n togglesettings();\n });\n};\n\n/**\n * Disable read-only date input when \"Disable Automatic Read-Only button\" is on.\n *\n * @param {boolean} checked\n */\nfunction togglefreezebutton(checked) {\n let readonlydateinput = document.getElementById('delayfreezedate');\n if (checked) {\n readonlydateinput.value = '';\n readonlydateinput.disabled = true;\n } else {\n readonlydateinput.disabled = false;\n }\n}\n\n/**\n * Toggle the automatic read only settings container.\n */\nfunction togglesettings() {\n let content = document.getElementById('automatic-read-only-settings');\n document.getElementById('override-freeze-date-button').classList.toggle('active');\n if (content.style.maxHeight) {\n content.style.maxHeight = null;\n } else {\n content.style.maxHeight = content.scrollHeight + \"px\";\n }\n}\n\n/**\n * Validate the preferences.\n * @return {boolean}\n */\nfunction validate() {\n let freezedateelement = document.getElementById('delayfreezedate');\n\n if (freezedateelement.value.length > 0) {\n // The default suggested date is not initialized, so cannot continue the checking.\n if (defaultfreezedate === '') {\n notification.alert(\n 'Error',\n 'Could not get the automatically suggested date, please try again later.',\n 'OK'\n );\n freezedateelement.value = originalfreezedatevalue;\n return false;\n } else {\n let defaultfreezedateobj = new Date(defaultfreezedate);\n let freezedateobj = new Date(freezedateelement.value);\n\n // The override freeze date should not be saved when it is earlier than the default suggested date.\n if (freezedateobj < defaultfreezedateobj || freezedateobj < new Date()) {\n notification.alert(\n 'Invalid Selection',\n 'The date for a Read-Only override must be post the automatically suggested date (' +\n defaultfreezedateobj.toLocaleDateString() +\n '), earlier dates may not be used.',\n 'OK'\n );\n freezedateelement.value = originalfreezedatevalue;\n return false;\n }\n }\n }\n\n return true;\n}\n\n/**\n * Initialize the scheduled freeze date container.\n *\n * @param {int} courseid\n */\nfunction initscheduledfreezedateblock(courseid) {\n let scheduledfreezedatecontainer = document.getElementById('scheduled-freeze-date-container');\n originalfreezedatevalue = document.getElementById('delayfreezedate').value;\n\n // Hide scheduled read-only date text at the beginning.\n scheduledfreezedatecontainer.style.display = 'none';\n\n // Get scheduled read-only dates.\n Ajax.call([{\n methodname: 'block_lifecycle_get_scheduled_freeze_date',\n args: {\n 'courseid': courseid\n },\n }])[0].done(function(response) {\n // Show scheduled date.\n if (!document.getElementById('togglefreezebutton').checked) {\n document.getElementById('scheduled-freeze-date').innerHTML = response.scheduledfreezedate;\n scheduledfreezedatecontainer.style.display = 'block';\n } else {\n // Disable read-only date input depends on freeze button status.\n togglefreezebutton(true);\n }\n // Set the default suggested date.\n if (response.success === 'true') {\n defaultfreezedate = response.defaultfreezedate;\n }\n }).fail(function(err) {\n window.console.log(err);\n });\n}\n\n/**\n * Update the auto context freezing preferences.\n * @param {int} courseid\n */\nfunction updatepreferences(courseid) {\n let preferences = {\n togglefreeze: document.getElementById('togglefreezebutton').checked,\n delayfreezedate: document.getElementById('delayfreezedate').value\n };\n\n if (validate()) {\n Ajax.call([{\n methodname: 'block_lifecycle_update_auto_freezing_preferences',\n args: {\n 'courseid': courseid,\n 'preferences': JSON.stringify(preferences)\n },\n }])[0].done(function(response) {\n notification.addNotification({\n message: response.message,\n type: response.success ? 'success' : 'error'\n });\n initscheduledfreezedateblock(courseid);\n togglesettings();\n }).fail(function(err) {\n window.console.log(err);\n });\n }\n}\n"],"names":["defaultfreezedate","originalfreezedatevalue","togglefreezebutton","checked","readonlydateinput","document","getElementById","value","disabled","togglesettings","content","classList","toggle","style","maxHeight","scrollHeight","initscheduledfreezedateblock","courseid","scheduledfreezedatecontainer","display","call","methodname","args","done","response","innerHTML","scheduledfreezedate","success","fail","err","window","console","log","addEventListener","event","target","preferences","togglefreeze","delayfreezedate","freezedateelement","length","alert","defaultfreezedateobj","Date","freezedateobj","toLocaleDateString","validate","JSON","stringify","addNotification","message","type","updatepreferences","e","preventDefault"],"mappings":"kXAIIA,kBAAoB,GAEpBC,wBAA0B,YA+BrBC,mBAAmBC,aACpBC,kBAAoBC,SAASC,eAAe,mBAC5CH,SACAC,kBAAkBG,MAAQ,GAC1BH,kBAAkBI,UAAW,GAE7BJ,kBAAkBI,UAAW,WAO5BC,qBACDC,QAAUL,SAASC,eAAe,gCACtCD,SAASC,eAAe,+BAA+BK,UAAUC,OAAO,UACpEF,QAAQG,MAAMC,UACdJ,QAAQG,MAAMC,UAAY,KAE1BJ,QAAQG,MAAMC,UAAYJ,QAAQK,aAAe,cAgDhDC,6BAA6BC,cAC9BC,6BAA+Bb,SAASC,eAAe,mCAC3DL,wBAA0BI,SAASC,eAAe,mBAAmBC,MAGrEW,6BAA6BL,MAAMM,QAAU,qBAGxCC,KAAK,CAAC,CACPC,WAAY,4CACZC,KAAM,UACUL,aAEhB,GAAGM,MAAK,SAASC,UAEZnB,SAASC,eAAe,sBAAsBH,QAK/CD,oBAAmB,IAJnBG,SAASC,eAAe,yBAAyBmB,UAAYD,SAASE,oBACtER,6BA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