diff --git a/lib/Controller/Campaign.php b/lib/Controller/Campaign.php index 6b8117dc03..cb8cc4b77e 100644 --- a/lib/Controller/Campaign.php +++ b/lib/Controller/Campaign.php @@ -2,7 +2,7 @@ /* * Copyright (C) 2023 Xibo Signage Ltd * - * Xibo - Digital Signage - http://www.xibo.org.uk + * Xibo - Digital Signage - https://xibosignage.com * * This file is part of Xibo. * @@ -319,7 +319,7 @@ public function grid(Request $request, Response $response) 'url' => $this->urlFor($request, 'campaign.edit.form', ['id' => $campaign->campaignId]), 'text' => __('Edit'), ); - } else if ($campaign->type === 'ad' && $this->getUser()->featureEnabled('ad.campaigns')) { + } else if ($campaign->type === 'ad' && $this->getUser()->featureEnabled('ad.campaign')) { $campaign->buttons[] = [ 'id' => 'campaign_button_edit', 'linkType' => '_self', diff --git a/lib/Controller/Folder.php b/lib/Controller/Folder.php index 27e7ca0858..50cc2d2087 100644 --- a/lib/Controller/Folder.php +++ b/lib/Controller/Folder.php @@ -1,8 +1,8 @@ getSanitizer($request->getParams()); // Should we return information for a specific folder? if ($folderId !== null) { $folder = $this->folderFactory->getById($folderId); @@ -99,7 +100,15 @@ public function grid(Request $request, Response $response, $folderId = null) // Show a tree view of all folders. $rootFolder = $this->folderFactory->getById(1); $rootFolder->a_attr['title'] = __('Right click a Folder for further Options'); - $this->buildTreeView($rootFolder, $this->getUser()->homeFolderId); + + // homeFolderId, + // do we show tree for current user + // or a specified user? + $homeFolderId = ($params->getInt('homeFolderId') !== null) + ? $params->getInt('homeFolderId') + : $this->getUser()->homeFolderId; + + $this->buildTreeView($rootFolder, $homeFolderId); return $response->withJson([$rootFolder]); } } @@ -357,7 +366,10 @@ private function decorateWithButtons($folder) { $user = $this->getUser(); - if ($user->featureEnabled('folder.add') && $user->checkViewable($folder)) { + if ($user->featureEnabled('folder.add') + && $user->checkViewable($folder) + && (!$folder->isRoot() || $user->isSuperAdmin()) + ) { $folder->buttons['create'] = true; } @@ -430,12 +442,7 @@ public function move(Request $request, Response $response, $folderId) } if ($folder->parentId === $newParentFolder->getId() && $params->getCheckbox('merge') !== 1) { - throw new InvalidArgumentException( - __( - 'This Folder is already a sub-folder of the selected Folder, - if you wish to move its content to the parent Folder, please check the merge checkbox.' - ) - ); + throw new InvalidArgumentException(__('This Folder is already a sub-folder of the selected Folder, if you wish to move its content to the parent Folder, please check the merge checkbox.'));//phpcs:ignore } // if we need to merge contents of the folder, dispatch an event that will move every object inside the folder diff --git a/lib/Controller/Library.php b/lib/Controller/Library.php index fe7f3666d7..2ffca6cc43 100644 --- a/lib/Controller/Library.php +++ b/lib/Controller/Library.php @@ -1034,7 +1034,7 @@ public function delete(Request $request, Response $response, $id) * name="playlistId", * in="formData", * description="A playlistId to add this uploaded media to", - * type="int", + * type="integer", * required=false * ), * @SWG\Parameter( diff --git a/lib/Controller/User.php b/lib/Controller/User.php index 045bac844e..2ebe0e3514 100644 --- a/lib/Controller/User.php +++ b/lib/Controller/User.php @@ -1,8 +1,8 @@ canChangeOwner()) { $object->setOwner($ownerId); - $object->save(['notify' => false, 'manageDynamicDisplayLinks' => false]); + $object->save(['notify' => false, 'manageDynamicDisplayLinks' => false, 'validate' => false]); } else { throw new ConfigurationException(__('Cannot change owner on this Object')); } diff --git a/lib/Entity/User.php b/lib/Entity/User.php index f4b8e72f39..39a20e8f11 100644 --- a/lib/Entity/User.php +++ b/lib/Entity/User.php @@ -764,7 +764,10 @@ public function save($options = []) } else if ($options['passwordUpdate']) { $this->updatePassword(); $this->audit($this->userId, 'User updated password', false); - } else if ($this->hash() != $this->hash || $this->hasPropertyChanged('twoFactorRecoveryCodes')) { + } else if ($this->hash() != $this->hash + || $this->hasPropertyChanged('twoFactorRecoveryCodes') + || $this->hasPropertyChanged('password') + ) { $this->update(); $this->audit($this->userId, 'User updated'); } diff --git a/lib/Factory/DisplayFactory.php b/lib/Factory/DisplayFactory.php index e289e8a2db..f209ca28fc 100644 --- a/lib/Factory/DisplayFactory.php +++ b/lib/Factory/DisplayFactory.php @@ -2,7 +2,7 @@ /* * Copyright (C) 2023 Xibo Signage Ltd * - * Xibo - Digital Signage - http://www.xibo.org.uk + * Xibo - Digital Signage - https://xibosignage.com * * This file is part of Xibo. * @@ -620,7 +620,7 @@ public function query($sortOrder = null, $filterBy = []) } } - if (is_array($sortOrder) && ($sortOrder != ['`member`'] && $sortOrder != ['`member` DESC'] )) { + if (is_array($sortOrder) && (!in_array('`member`', $sortOrder) && !in_array('`member` DESC', $sortOrder))) { $order .= 'ORDER BY ' . implode(',', $sortOrder); } diff --git a/lib/Factory/DisplayGroupFactory.php b/lib/Factory/DisplayGroupFactory.php index 7ed1d78ec0..956727276e 100644 --- a/lib/Factory/DisplayGroupFactory.php +++ b/lib/Factory/DisplayGroupFactory.php @@ -1,8 +1,8 @@ getInt('displayGroupIdMembers') !== null) { $members = []; foreach ($this->getStore()->select($select . $body, $params) as $row) { - $displayGroupId = $parsedBody->getInt($row['displayGroupId']); + $displayGroupId = $this->getSanitizer($row)->getInt('displayGroupId'); $parentId = $parsedBody->getInt('displayGroupIdMembers'); if ($this->getStore()->exists('SELECT `childId` FROM `lkdgdg` WHERE `parentId` = :parentId AND `childId` = :childId AND `depth` = 1', @@ -513,7 +513,7 @@ public function query($sortOrder = null, $filterBy = []) } } - if (is_array($sortOrder) && ($sortOrder != ['`member`'] && $sortOrder != ['`member` DESC'] )) { + if (is_array($sortOrder) && (!in_array('`member`', $sortOrder) && !in_array('`member` DESC', $sortOrder))) { $order .= ' ORDER BY ' . implode(',', $sortOrder); } diff --git a/lib/Factory/UserGroupFactory.php b/lib/Factory/UserGroupFactory.php index d5fe57891f..1280c8defb 100644 --- a/lib/Factory/UserGroupFactory.php +++ b/lib/Factory/UserGroupFactory.php @@ -1,8 +1,8 @@ [ 'feature' => 'folder.add', 'group' => 'folders', - 'title' => __('Create new Folders') + 'title' => __('Allow users to create Sub-Folders under Folders they have access to. (Except the Root Folder)') ], 'folder.modify' => [ 'feature' => 'folder.modify', diff --git a/lib/Helper/Environment.php b/lib/Helper/Environment.php index ed8b062692..c3defb4172 100644 --- a/lib/Helper/Environment.php +++ b/lib/Helper/Environment.php @@ -30,7 +30,7 @@ */ class Environment { - public static $WEBSITE_VERSION_NAME = '3.3.6'; + public static $WEBSITE_VERSION_NAME = '3.3.7'; public static $XMDS_VERSION = '6'; public static $XLF_VERSION = 3; public static $VERSION_REQUIRED = '7.2.9'; diff --git a/lib/Middleware/Handlers.php b/lib/Middleware/Handlers.php index 1704c8a7c8..905f8f95b6 100644 --- a/lib/Middleware/Handlers.php +++ b/lib/Middleware/Handlers.php @@ -1,8 +1,8 @@ render($response, $template . '.twig', array_merge($viewParams, $exceptionData)) - ->withStatus($statusCode); + try { + return $twig->render($response, $template . '.twig', array_merge($viewParams, $exceptionData)) + ->withStatus($statusCode); + } catch (\Exception $exception) { + $response->getBody()->write('Fatal error'); + return $response->withStatus(500); + } } } }; diff --git a/locale/af.mo b/locale/af.mo index f7c3b3630e..544634748a 100644 Binary files a/locale/af.mo and b/locale/af.mo differ diff --git a/locale/ar.mo b/locale/ar.mo index 0247bc3399..5ef7e2f927 100644 Binary files a/locale/ar.mo and b/locale/ar.mo differ diff --git a/locale/bg.mo b/locale/bg.mo index f284226904..926c7c997d 100644 Binary files a/locale/bg.mo and b/locale/bg.mo differ diff --git a/locale/ca.mo b/locale/ca.mo index c0028edf6a..d2ab6b7c86 100644 Binary files a/locale/ca.mo and b/locale/ca.mo differ diff --git a/locale/cs.mo b/locale/cs.mo index 01c652c21c..03f06eee76 100644 Binary files a/locale/cs.mo and b/locale/cs.mo differ diff --git a/locale/da.mo b/locale/da.mo index 613f06d8d0..07a65f0a95 100644 Binary files a/locale/da.mo and b/locale/da.mo differ diff --git a/locale/de.mo b/locale/de.mo index 703ed6d8a5..4db948177b 100644 Binary files a/locale/de.mo and b/locale/de.mo differ diff --git a/locale/default.pot b/locale/default.pot index 0874bd417c..f6c6082643 100644 --- a/locale/default.pot +++ b/locale/default.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-06 11:51+0100\n" +"POT-Creation-Date: 2023-07-31 17:51+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -15299,7 +15299,7 @@ msgid "Cannot modify root folder." msgstr "" #: cache/e1/e12568f445a23579c43fcfebd85ce8eee11d450b2050aad01f770f474b1d3218.php:430 -#: lib/Controller/Folder.php:329 +#: lib/Controller/Folder.php:338 msgid "Cannot remove Folder with content" msgstr "" @@ -18714,7 +18714,7 @@ msgstr "" #: lib/Controller/DisplayGroup.php:706 lib/Controller/DisplayGroup.php:2531 #: lib/Controller/DataSet.php:622 lib/Controller/Notification.php:575 #: lib/Controller/Campaign.php:605 lib/Controller/Campaign.php:1337 -#: lib/Controller/Module.php:735 lib/Controller/Folder.php:204 +#: lib/Controller/Module.php:735 lib/Controller/Folder.php:213 #: lib/Controller/Playlist.php:707 lib/Controller/DataSetColumn.php:386 #: lib/Controller/Tag.php:356 lib/Controller/Layout.php:549 #: lib/Controller/Help.php:191 lib/Controller/DisplayProfile.php:303 @@ -18731,7 +18731,7 @@ msgstr "" #: lib/Controller/DataSet.php:917 lib/Controller/ScheduleReport.php:429 #: lib/Controller/Notification.php:705 lib/Controller/Campaign.php:912 #: lib/Controller/MenuBoard.php:465 lib/Controller/Module.php:379 -#: lib/Controller/Module.php:848 lib/Controller/Folder.php:272 +#: lib/Controller/Module.php:848 lib/Controller/Folder.php:281 #: lib/Controller/Playlist.php:892 lib/Controller/Transition.php:159 #: lib/Controller/Library.php:1353 lib/Controller/DataSetColumn.php:594 #: lib/Controller/Tag.php:506 lib/Controller/Connector.php:201 @@ -18753,7 +18753,7 @@ msgstr "" #: lib/Controller/DataSet.php:1008 lib/Controller/ScheduleReport.php:467 #: lib/Controller/Notification.php:764 lib/Controller/Campaign.php:991 #: lib/Controller/SavedReport.php:290 lib/Controller/MenuBoard.php:542 -#: lib/Controller/Module.php:983 lib/Controller/Folder.php:334 +#: lib/Controller/Module.php:983 lib/Controller/Folder.php:343 #: lib/Controller/Playlist.php:973 lib/Controller/Library.php:961 #: lib/Controller/DataSetColumn.php:684 lib/Controller/Tag.php:632 #: lib/Controller/Layout.php:967 lib/Controller/MenuBoardCategory.php:498 @@ -19436,41 +19436,40 @@ msgstr "" msgid "Switched to Normal Mode" msgstr "" -#: lib/Controller/Folder.php:101 +#: lib/Controller/Folder.php:102 msgid "Right click a Folder for further Options" msgstr "" -#: lib/Controller/Folder.php:136 +#: lib/Controller/Folder.php:145 msgid "Private Folder" msgstr "" -#: lib/Controller/Folder.php:259 +#: lib/Controller/Folder.php:268 msgid "Cannot edit root Folder" msgstr "" -#: lib/Controller/Folder.php:318 +#: lib/Controller/Folder.php:327 msgid "Cannot remove root Folder" msgstr "" -#: lib/Controller/Folder.php:329 +#: lib/Controller/Folder.php:338 msgid "Reassign objects from this Folder before deleting." msgstr "" -#: lib/Controller/Folder.php:422 +#: lib/Controller/Folder.php:434 msgid "Please select different folder, cannot move Folder to the same Folder" msgstr "" -#: lib/Controller/Folder.php:428 +#: lib/Controller/Folder.php:440 msgid "" "Please select different folder, cannot move Folder inside of one of its sub-" "folders" msgstr "" -#: lib/Controller/Folder.php:435 +#: lib/Controller/Folder.php:445 msgid "" -"This Folder is already a sub-folder of the selected Folder,\n" -" if you wish to move its content to the parent Folder, " -"please check the merge checkbox." +"This Folder is already a sub-folder of the selected Folder, if you wish to " +"move its content to the parent Folder, please check the merge checkbox." msgstr "" #: lib/Controller/DataSetData.php:156 @@ -21125,15 +21124,15 @@ msgstr "" msgid "Library Quota must be a positive number." msgstr "" -#: lib/Entity/User.php:1083 +#: lib/Entity/User.php:1086 msgid "Provided Object not under permission management" msgstr "" -#: lib/Entity/User.php:1340 +#: lib/Entity/User.php:1343 msgid "You have exceeded your library quota" msgstr "" -#: lib/Entity/User.php:1358 +#: lib/Entity/User.php:1361 msgid "Your password does not meet the required complexity" msgstr "" @@ -22197,7 +22196,9 @@ msgid "View Folder Tree on Grids and Forms" msgstr "" #: lib/Factory/UserGroupFactory.php:790 -msgid "Create new Folders" +msgid "" +"Allow users to create Sub-Folders under Folders they have access to. (Except " +"the Root Folder)" msgstr "" #: lib/Factory/UserGroupFactory.php:795 diff --git a/locale/el.mo b/locale/el.mo index 3d39a75e12..9b5d7b6c6e 100644 Binary files a/locale/el.mo and b/locale/el.mo differ diff --git a/locale/en_GB.mo b/locale/en_GB.mo index 17d14a8fb9..3f141c1b55 100644 Binary files a/locale/en_GB.mo and b/locale/en_GB.mo differ diff --git a/locale/es.mo b/locale/es.mo index 0afd6a2a6d..e1d6f1f127 100644 Binary files a/locale/es.mo and b/locale/es.mo differ diff --git a/locale/et.mo b/locale/et.mo index ba796677f4..051b892fb2 100644 Binary files a/locale/et.mo and b/locale/et.mo differ diff --git a/locale/eu.mo b/locale/eu.mo index 5c62b96cf9..76d4e482e9 100644 Binary files a/locale/eu.mo and b/locale/eu.mo differ diff --git a/locale/fa.mo b/locale/fa.mo index c87e4fe7a3..ee3d2872ea 100644 Binary files a/locale/fa.mo and b/locale/fa.mo differ diff --git a/locale/fi.mo b/locale/fi.mo index 0f08a2cb18..404794a0b6 100644 Binary files a/locale/fi.mo and b/locale/fi.mo differ diff --git a/locale/fr.mo b/locale/fr.mo index 2056e7982f..aee18c9a03 100644 Binary files a/locale/fr.mo and b/locale/fr.mo differ diff --git a/locale/he.mo b/locale/he.mo index 5d1aa234bb..a175f77a25 100644 Binary files a/locale/he.mo and b/locale/he.mo differ diff --git a/locale/hi.mo b/locale/hi.mo index 17cbb3f601..802d9e2e8a 100644 Binary files a/locale/hi.mo and b/locale/hi.mo differ diff --git a/locale/hr.mo b/locale/hr.mo index d89d99dd50..e6be0b25e7 100644 Binary files a/locale/hr.mo and b/locale/hr.mo differ diff --git a/locale/hu.mo b/locale/hu.mo index a5f11eff67..74774f7c5d 100644 Binary files a/locale/hu.mo and b/locale/hu.mo differ diff --git a/locale/id.mo b/locale/id.mo index 333bda53a9..b6f93a1a79 100644 Binary files a/locale/id.mo and b/locale/id.mo differ diff --git a/locale/it.mo b/locale/it.mo index fe76ea3647..73bd641cf8 100644 Binary files a/locale/it.mo and b/locale/it.mo differ diff --git a/locale/ja.mo b/locale/ja.mo index 0ceb682eb0..80b4f45073 100644 Binary files a/locale/ja.mo and b/locale/ja.mo differ diff --git a/locale/ko.mo b/locale/ko.mo index 65c394dd1e..8108b0c1da 100644 Binary files a/locale/ko.mo and b/locale/ko.mo differ diff --git a/locale/ku.mo b/locale/ku.mo index aaeaa3cd7f..0103520ae2 100644 Binary files a/locale/ku.mo and b/locale/ku.mo differ diff --git a/locale/lb.mo b/locale/lb.mo index ccd16398d7..c34cecab1e 100644 Binary files a/locale/lb.mo and b/locale/lb.mo differ diff --git a/locale/lo.mo b/locale/lo.mo index 7a1ca2330a..5b7bf23e22 100644 Binary files a/locale/lo.mo and b/locale/lo.mo differ diff --git a/locale/lt.mo b/locale/lt.mo index 7abba8fb7e..621942af8f 100644 Binary files a/locale/lt.mo and b/locale/lt.mo differ diff --git a/locale/nb.mo b/locale/nb.mo index 5cdeaa326a..f6c0fac6af 100644 Binary files a/locale/nb.mo and b/locale/nb.mo differ diff --git a/locale/nl.mo b/locale/nl.mo index 4e3deeb097..cc839933dd 100644 Binary files a/locale/nl.mo and b/locale/nl.mo differ diff --git a/locale/nl_NL.mo b/locale/nl_NL.mo index cf227bb8fa..78e3c0ab19 100644 Binary files a/locale/nl_NL.mo and b/locale/nl_NL.mo differ diff --git a/locale/pl.mo b/locale/pl.mo index 31063c75d6..0c1f2dad5f 100644 Binary files a/locale/pl.mo and b/locale/pl.mo differ diff --git a/locale/pt.mo b/locale/pt.mo index ca42986b93..4a2898c244 100644 Binary files a/locale/pt.mo and b/locale/pt.mo differ diff --git a/locale/pt_BR.mo b/locale/pt_BR.mo index 74cf380188..3873436fc3 100644 Binary files a/locale/pt_BR.mo and b/locale/pt_BR.mo differ diff --git a/locale/ro.mo b/locale/ro.mo index b557edd0bf..52cc480cfd 100644 Binary files a/locale/ro.mo and b/locale/ro.mo differ diff --git a/locale/ru.mo b/locale/ru.mo index f2279a204b..808ba17190 100644 Binary files a/locale/ru.mo and b/locale/ru.mo differ diff --git a/locale/sk.mo b/locale/sk.mo index ce9d5ee00b..81839559bc 100644 Binary files a/locale/sk.mo and b/locale/sk.mo differ diff --git a/locale/sl.mo b/locale/sl.mo index 97696f9d4f..bcf8e462a4 100644 Binary files a/locale/sl.mo and b/locale/sl.mo differ diff --git a/locale/sr@latin.mo b/locale/sr@latin.mo index 8424738c40..d24f0217d0 100644 Binary files a/locale/sr@latin.mo and b/locale/sr@latin.mo differ diff --git a/locale/sv.mo b/locale/sv.mo index 63f71cdecf..bcdfccf198 100644 Binary files a/locale/sv.mo and b/locale/sv.mo differ diff --git a/locale/th.mo b/locale/th.mo index 7ba91676da..9cb7b82cf2 100644 Binary files a/locale/th.mo and b/locale/th.mo differ diff --git a/locale/tr.mo b/locale/tr.mo index 20e9d60cee..975359c263 100644 Binary files a/locale/tr.mo and b/locale/tr.mo differ diff --git a/locale/vi.mo b/locale/vi.mo index c8d3e0774e..309c0846fa 100644 Binary files a/locale/vi.mo and b/locale/vi.mo differ diff --git a/locale/zh_CN.mo b/locale/zh_CN.mo index 144e174b40..87a3f0a6c8 100644 Binary files a/locale/zh_CN.mo and b/locale/zh_CN.mo differ diff --git a/locale/zh_TW.mo b/locale/zh_TW.mo index a098ad1ca9..9e517de38f 100644 Binary files a/locale/zh_TW.mo and b/locale/zh_TW.mo differ diff --git a/modules/xibo-interactive-control.min.js b/modules/xibo-interactive-control.min.js index b2540da525..7d8bbd08ec 100644 --- a/modules/xibo-interactive-control.min.js +++ b/modules/xibo-interactive-control.min.js @@ -1 +1 @@ -!function(e){var t={};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}window.xiboIC=function(){"use strict";var e={protocol:"",hostName:"",port:"",headers:[],timelimit:5e3,callbackQueue:[],isVisible:!0,isPreview:!1,targetId:"undefined"!=typeof xiboICTargetId?xiboICTargetId:void 0,getOriginURL:function(){return""!=this.protocol&&""!=this.hostName?this.protocol+"://"+this.hostName+(""!=this.port?":"+this.port:""):""},makeRequest:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.type,r=t.headers,i=t.data,a=t.done,u=t.error;if(this.isPreview)"function"==typeof parent.previewActionTrigger?parent.previewActionTrigger(e,i,a):"function"==typeof a&&a({status:200,responseText:"OK"});else{var c=this.getOriginURL()+e,l=n||"GET",s=r||this.headers,d=new XMLHttpRequest;d.timeout=this.timelimit,d.open(l,c,!0),"POST"==n&&d.setRequestHeader("Content-Type","application/json;charset=UTF-8"),s.forEach((function(e){d.setRequestHeader(e.key,e.value)}));var f=null;"object"==o(i)&&(f=JSON.stringify(i)),d.onload=function(){d.status>=200&&d.status<=299?"function"==typeof a&&a(this):"function"==typeof u&&u(this)},d.send(f)}}},t={checkVisible:function(){return $.urlParam=function(e){var t=new RegExp("[?&]"+e+"=([^&#]*)").exec(window.location.href);return null==t?null:decodeURI(t[1])||0},e.isVisible=!$.urlParam("visible")||1==$.urlParam("visible"),e.isVisible},checkIsPreview:function(){var t=new URLSearchParams(window.location.search);return(t.has("preview")&&1==t.get("preview")||void 0!==window.parent.lD||void 0!==window.parent.parent.lD)&&(e.isPreview=!0,!0)},config:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=t.hostName,n=t.port,r=t.headers,i=t.protocol;e.hostName=o||e.hostName,e.port=n||e.port,e.headers=r||e.headers,e.protocol=i||e.protocol},info:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=t.done,n=t.error;e.makeRequest("/info",{done:o,error:n})},trigger:function(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=o.targetId,r=o.done,i=o.error,a=void 0!==n?n:e.targetId;e.makeRequest("/trigger",{type:"POST",data:{id:a,trigger:t},done:r,error:i})},expireNow:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=t.targetId,n=t.done,r=t.error,i=void 0!==o?o:e.targetId;e.makeRequest("/duration/expire",{type:"POST",data:{id:i},done:n,error:r})},extendWidgetDuration:function(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=o.targetId,r=o.done,i=o.error,a=void 0!==n?n:e.targetId;e.makeRequest("/duration/extend",{type:"POST",data:{id:a,duration:t},done:r,error:i})},setWidgetDuration:function(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=o.targetId,r=o.done,i=o.error,a=void 0!==n?n:e.targetId;e.makeRequest("/duration/set",{type:"POST",data:{id:a,duration:t},done:r,error:i})},addToQueue:function(t){"function"!=typeof t&&console.error("Invalid callback function");for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r0&&void 0!==arguments[0]&&!arguments[0]?$("style.lock-text-selection-style").remove():$('