{"version":3,"file":"form-controls.js","names":["window","formControls","constructor","$","ajaxPrefilter","options","originalOptions","xhr","antiForgeryToken","val","setRequestHeader","antiforgeryHeader","ajaxSetup","cache","this","questionTypes","text","checkbox","dropdown","matrix","dateTime","attachment","radioButton","formula","drawing","valueDropdownConfig","dataTextField","dataValueField","originalEditor","jQuery","prototype","kendoEditor","isSanitizedEditorInitialized","defaultTools","kendo","ui","Editor","insertParagraph","shift","insertLineBreak","fn","pasteCleanup","span","css","msAllFormatting","DateTimePicker","weekNumber","DatePicker","resources","dateTimePickerMessages","messages","TimePicker","Calendar","today","DropDownList","noDataTemplate","animation","Window","open","effects","duration","close","DOMPurify","Error","deserialization","custom","html","core","sanitizeHtml","call","toString","version","cleanUpLinkWithHashtag","currentUrl","location","href","replace","anchorLinkRegex","RegExp","match","groupAnchor","decodeURIComponent","cleanUpImageBrowserUrl","imageBrowserRegex","baseUrl","createUserGroupDropdownList","selectObject","type","firstBlank","blank","path","group","includeAnonymous","kendoDropDownList","template","filter","dataSource","transport","read","getJSON","data","success","fail","supportsOffline","readyState","error","promise","leanformsNext","getOfflineGroups","getOfflineUsersFromGroup","getOfflineUsers","then","listData","value","forEach","item","push","schema","model","id","fillDependantList","sourceObj","sourceId","isLoadingFormData","isSetFilterPage","eventTargets","dropdownTriggers","$sourceObj","sourceValue","prop","name","selectedList","selectedOption","find","listId","compareValue","targetId","dropdownData","newOptions","getDropDownOptions","trg","document","getElementById","innerHTML","isReadOnly","getAttribute","firstOption","option","el","createElement","setAttribute","alt","appendChild","length","selected","changeDependentDate","calc","e","console","foundOptions","i","dependencies","dependency","questionId","isActive","validation","validateValueCompare","leftValue","operator","rightValue","defaultOptions","concat","getEditorTools","colorPickerId","full","editor","foreColor","backColor","getExtendedValues","questionDropdown","operatorDropdown","valueInput","callback","Number","isCurrentStep","isNaN","isContains","wrapper","toggle","get","url","onAjaxError","response","isList","Array","isArray","optionsIsSpecial","showText","list","select","getFileIconSuffix","fileName","indexOf","knownExtensions","extension","split","pop","toLowerCase","isKnownExtension","substring","goto","regexp","isUrl","test","hideNewTabCheckbox","setTimeout","closest","hide","getPasteCleanup","$html","after","contents","unwrap","addTargetBlank","a","removeEncodedImage","initializeBackColorPicker","editorSelector","pickerId","initializeColorPicker","initializeForeColorPicker","isImage","imageExtensions","moveDown","selectedEls","firstEl","first","nextEl","last","next","firstXmlItem","specific","nextXmlItem","before","moveUp","lastEl","previousEl","prev","lastXmlItem","previousXmlItem","preventMulitselectDeselect","$this","previous","target","preventDefault","selectValueOrFirst","dropDown","showConfirmDialog","contentHtml","buttonText","title","buttonClass","append","confirmDialogMessages","delete","confirmationWindow","kendoWindow","width","getPopupWidth","visible","modal","iframe","resizable","deactivate","destroy","content","cancel","element","on","center","showOldConfirmDialog","bodyHtml","dialog","minHeight","getPopupHeight","confirmTemplate","ConfirmText","serialize","toggleValueBox","valueDropdown","valueDropdownKendo","hasOptions","shouldShowDropdown","xmlToString","xmlData","xmlString","undefined","ActiveXObject","xml","oSerializer","XMLSerializer","serializeToString","err","message","pickerSelector","action","palette","editorColors","backColors","foreColors","editorIsInline","body","hasClass","range","preventOpen","picker","kendoColorPicker","apply","preview","columns","view","views","getRange","change","rangeCopy","selection","getSelection","removeAllRanges","addRange","exec","leftButton","color","input","tabstrip","defaultTab","isSwitchingTab","tabs","querySelectorAll","tab","addEventListener","handleTabChange","capture","top","urlTab","isEmbed","getEmbedUrl","searchParams","getQueryParameter","selectTab","enableAllTabs","removeAttribute","getActiveTab","querySelector","newTabId","activeTab","dataset","page","classList","remove","add","checked","contentWindow","includes","loadHandler","eventBroadcaster","broadcast","detail","show","broadcasts","LOCK_SCREEN","switchTabUrl","removeEventListener","bind","src","reloadActiveTab","currentTab","handler","reload","reloadTab","tabId","reloadTabs","frame","resetTabChange","newTab","disabled","click","mainWindow","newTabUrl","setQueryParameter","history","replaceState","embedUrl","removeQueryParameter","setEmbedUrl","newUrl","pushState","topWindow","consoleTitle"],"sources":["../../../scripts/leanforms/form-controls.js","../../../scripts/leanforms/components/tabstrip.js"],"sourcesContent":["// #region: Class definition *********************************************************************/\r\n/**\r\n * Manages form control(s) and its logic.\r\n */\r\nwindow.formControls = new class {\r\n\r\n // #region: Constructor **********************************************************************/\r\n /**\r\n * The constructor does work that needs to be executed exactly once.\r\n */\r\n constructor() {\r\n // Setup CSRF safety for (jQuery) AJAX:\r\n $.ajaxPrefilter(function (options, originalOptions, xhr) {\r\n const antiForgeryToken = $(\"[name=__RequestVerificationToken]\").val();\r\n if (antiForgeryToken && antiForgeryToken !== \"\") {\r\n xhr.setRequestHeader(antiforgeryHeader, antiForgeryToken);\r\n }\r\n });\r\n\r\n $.ajaxSetup({\r\n cache: false\r\n });\r\n\r\n this.questionTypes = {\r\n text: 0,\r\n checkbox: 1,\r\n dropdown: 2,\r\n matrix: 3,\r\n dateTime: 4,\r\n attachment: 5,\r\n radioButton: 6,\r\n formula: 9,\r\n drawing: 20\r\n };\r\n\r\n this.valueDropdownConfig = {\r\n dataTextField: \"text\",\r\n dataValueField: \"value\"\r\n };\r\n\r\n let originalEditor = jQuery.prototype.kendoEditor;\r\n let isSanitizedEditorInitialized = false;\r\n\r\n // Kendo and jQuery init.\r\n let { defaultTools } = kendo.ui.Editor;\r\n defaultTools.insertParagraph.options.shift = true;\r\n defaultTools.insertLineBreak.options.shift = false;\r\n\r\n kendo.ui.Editor.fn.options.pasteCleanup = {\r\n span: true,\r\n css: true,\r\n msAllFormatting: true\r\n };\r\n\r\n kendo.ui.DateTimePicker.fn.options.weekNumber = true;\r\n kendo.ui.DatePicker.fn.options.weekNumber = true;\r\n\r\n if (typeof resources.dateTimePickerMessages !== \"undefined\") {\r\n kendo.ui.DateTimePicker.fn.options.messages = resources.dateTimePickerMessages;\r\n kendo.ui.TimePicker.fn.options.messages = resources.dateTimePickerMessages;\r\n kendo.ui.Calendar.fn.options.messages.today = resources.dateTimePickerMessages.today;\r\n }\r\n\r\n kendo.ui.DropDownList.fn.options.noDataTemplate = \"\";\r\n kendo.ui.DropDownList.fn.options.animation = false;\r\n\r\n kendo.ui.Window.fn.options.animation = {\r\n open: {\r\n effects: \"fade:in\",\r\n duration: 140\r\n },\r\n close: {\r\n effects: \"fade:out\",\r\n duration: 140\r\n }\r\n };\r\n\r\n jQuery.prototype.kendoEditor = function (options) {\r\n if (!window.DOMPurify) {\r\n throw new Error(\"DOMPurify is required to use kendo Editor safely.\");\r\n }\r\n\r\n if (!isSanitizedEditorInitialized) {\r\n kendo.ui.Editor.fn.options.deserialization = {\r\n custom(html) {\r\n // Returning an empty string can make Kendo ignore the output, so we always need to return something.\r\n return core.sanitizeHtml(html) || '\\ufeff';\r\n }\r\n };\r\n\r\n isSanitizedEditorInitialized = true;\r\n }\r\n\r\n return originalEditor.call(this, options);\r\n };\r\n }\r\n // #endregion ********************************************************************************/\r\n\r\n // #region: Build ****************************************************************************/\r\n /**\r\n * Identifies class.\r\n * @returns {string} The string representation of this class.\r\n */\r\n toString() {\r\n return \"[formControls]\";\r\n }\r\n\r\n static toString() {\r\n return \"[formControls]\";\r\n }\r\n\r\n /** \r\n * Identifies the version.\r\n * @returns {string} The version number of this class.\r\n */\r\n static version() {\r\n return \"1.0.0\";\r\n }\r\n // #endregion ********************************************************************************/\r\n\r\n // #region: Public Methods *******************************************************************/\r\n /**\r\n * If a link pasted is custom code (eg #:4 |Formulier link|#) that starts with #, the browser will automatically prepend current URL on copy.\r\n * We just want the code used.\r\n * @param {String} html The html to parse\r\n */\r\n cleanUpLinkWithHashtag(html) {\r\n // If link is custom code (eg #:4 |Formulier link|#) that starts with #, browser will automatically prepend current URL on copy.\r\n let currentUrl = window.location.href.\r\n\r\n // Encode to use in regex.\r\n replace(/(\\/|\\.|\\?)/g, \"\\\\$1\").\r\n\r\n // Encode to match HTML encoded.\r\n replace(/&/g, \"&\").\r\n\r\n // Match ids from other pages.\r\n replace(/[=]\\d+/g, \"=\\\\d+\"),\r\n anchorLinkRegex = new RegExp(\" {\r\n return \"#:data.text#`,\r\n filter: \"contains\",\r\n dataSource: {\r\n transport: {\r\n read(options) {\r\n $.getJSON(\r\n baseUrl + path,\r\n function (data) {\r\n options.success(data);\r\n }\r\n ).fail(function (xhr) {\r\n if (!core.supportsOffline() || xhr.readyState !== 0) {\r\n return options.error(xhr);\r\n }\r\n\r\n var promise;\r\n if (type === \"groups\") {\r\n promise = leanformsNext.getOfflineGroups();\r\n }\r\n else if (type === \"users\" && group > 0) {\r\n promise = leanformsNext.getOfflineUsersFromGroup(+group);\r\n }\r\n else {\r\n promise = leanformsNext.getOfflineUsers();\r\n }\r\n\r\n promise.then((data) => {\r\n const listData = firstBlank ? [{ text: \"\", value: \"-1\" }] : [];\r\n\r\n // Using array.concat fails with Kendo bind.\r\n data.forEach((item) => {\r\n listData.push({ text: item.text, value: item.value });\r\n });\r\n options.success(listData);\r\n });\r\n });\r\n },\r\n schema: {\r\n model: {\r\n id: \"value\"\r\n }\r\n }\r\n }\r\n }\r\n }).data(\"kendoDropDownList\");\r\n }\r\n\r\n /**\r\n * \r\n * @param {any} sourceObj\r\n * @param {any} sourceId\r\n * @param {any} isLoadingFormData\r\n * @param {any} isSetFilterPage\r\n */\r\n fillDependantList(sourceObj, sourceId, isLoadingFormData, isSetFilterPage) {\r\n try {\r\n let eventTargets = dropdownTriggers[sourceId];\r\n\r\n if (!eventTargets) {\r\n return;\r\n }\r\n\r\n let $sourceObj = $(sourceObj),\r\n sourceValue;\r\n\r\n if (sourceObj.type === \"checkbox\") {\r\n sourceValue = $sourceObj.prop(\"checked\") ? \"0\" : \"1\";\r\n }\r\n else if (sourceObj.type === \"radio\") {\r\n sourceValue = $(\"input[name=\\\"\" + sourceObj.name + \"\\\"]:checked\").val();\r\n }\r\n else {\r\n sourceValue = $sourceObj.val();\r\n }\r\n\r\n let selectedList = \"\";\r\n\r\n if (sourceObj.type === \"select-one\") {\r\n let selectedOption = $sourceObj.find(\"option:selected\"),\r\n listId = selectedOption.data(\"list\");\r\n\r\n if (listId) {\r\n selectedList = `${listId}#`;\r\n }\r\n }\r\n\r\n let compareValue = selectedList + sourceValue;\r\n\r\n eventTargets.forEach((targetId) => {\r\n let data = dropdownData[targetId];\r\n let newOptions = this.getDropDownOptions(data, compareValue, sourceId);\r\n let trg = document.getElementById((isSetFilterPage ? \"\" : \"id_\") + targetId);\r\n trg.innerHTML = \"\";\r\n\r\n let isReadOnly = trg.getAttribute(\"readonly\");\r\n\r\n if (isReadOnly) {\r\n let firstOption = newOptions[0];\r\n newOptions = firstOption ? [firstOption] : [];\r\n }\r\n\r\n newOptions.forEach((option) => {\r\n let el = document.createElement(\"option\");\r\n el.text = option.text;\r\n el.value = option.value;\r\n el.setAttribute(\"data-alt\", option.alt || \"\");\r\n el.setAttribute(\"data-list\", option.listId || \"\");\r\n\r\n trg.appendChild(el);\r\n });\r\n\r\n if (newOptions.length) {\r\n trg.options[0].selected = true;\r\n }\r\n\r\n if (!isSetFilterPage) {\r\n // TODO: why !isBlank?\r\n if (!data.firstBlank) { changeDependentDate(trg); }\r\n\r\n if (!isLoadingFormData) {\r\n // TODO: call handleOnChange?\r\n calc(targetId);\r\n }\r\n }\r\n });\r\n }\r\n catch (e) {\r\n console.error(e);\r\n }\r\n }\r\n\r\n /**\r\n * \r\n * @param {any} data\r\n * @param {any} value\r\n * @param {any} sourceId\r\n */\r\n getDropDownOptions(data, value, sourceId) {\r\n let newOptions = [],\r\n foundOptions = false;\r\n\r\n for (let i = 0; i < data.dependencies.length; i++) {\r\n let dependency = data.dependencies[i];\r\n\r\n if (dependency.questionId.toString() !== sourceId) {\r\n continue;\r\n }\r\n\r\n let isActive = validation.validateValueCompare({ leftValue: value, operator: dependency.operator, rightValue: dependency.value });\r\n if (isActive) {\r\n foundOptions = true;\r\n newOptions = dependency.options;\r\n break;\r\n }\r\n }\r\n\r\n if (!foundOptions) {\r\n newOptions = data.defaultOptions;\r\n }\r\n\r\n if (data.firstBlank) {\r\n newOptions = [{ value: \"\", text: \"\", alt: \"\", listId: \"\" }].concat(newOptions);\r\n }\r\n\r\n return newOptions;\r\n }\r\n\r\n /**\r\n * \r\n * @param {any} colorPickerId\r\n * @param {any} full\r\n * @returns\r\n */\r\n getEditorTools(colorPickerId, full = false) {\r\n if (full) {\r\n return [\r\n \"bold\",\r\n \"italic\",\r\n \"underline\",\r\n \"strikethrough\",\r\n {\r\n name: \"fore-Color\",\r\n template: `\r\n
\r\n
\r\n \r\n
`\r\n },\r\n {\r\n name: \"back-Color\",\r\n template: `\r\n
\r\n
\r\n \r\n
`\r\n },\r\n \"cleanFormatting\",\r\n \"createLink\",\r\n \"unlink\",\r\n \"insertImage\",\r\n \"insertUnorderedList\",\r\n \"insertOrderedList\",\r\n \"indent\",\r\n \"outdent\",\r\n \"subscript\",\r\n \"superscript\",\r\n \"justifyLeft\",\r\n \"justifyCenter\",\r\n \"justifyRight\",\r\n \"fontName\",\r\n \"fontSize\",\r\n \"createTable\",\r\n \"addColumnLeft\",\r\n \"addColumnRight\",\r\n \"addRowAbove\",\r\n \"addRowBelow\",\r\n \"deleteRow\",\r\n \"deleteColumn\",\r\n \"viewHtml\"\r\n ];\r\n }\r\n\r\n return [\r\n {\r\n name: \"fore-Color\",\r\n template: `\r\n
\r\n
\r\n \r\n
`\r\n },\r\n \"bold\",\r\n \"italic\",\r\n \"underline\",\r\n \"cleanFormatting\",\r\n \"createLink\",\r\n \"unlink\"\r\n ];\r\n }\r\n\r\n /**\r\n * \r\n * @param {any} questionDropdown\r\n * @param {any} value\r\n * @param {any} operatorDropdown\r\n * @param {any} valueInput\r\n * @param {any} callback\r\n */\r\n getExtendedValues(questionDropdown, value, operatorDropdown, valueInput, callback) {\r\n let questionId = Number(questionDropdown.val());\r\n let isCurrentStep = questionId === -99 || isNaN(questionId),\r\n operator = operatorDropdown.val();\r\n let isContains = operator === \"contains\" || operator === \"doesnotcontain\";\r\n\r\n if (isCurrentStep) {\r\n value.wrapper.toggle(false);\r\n valueInput.toggle(true);\r\n\r\n valueInput.val(\"\");\r\n value.dataSource.data([]);\r\n\r\n callback();\r\n\r\n return;\r\n }\r\n\r\n $.get({\r\n url: `${baseUrl}/api/questions/${questionId}/values/extended`,\r\n error: leanformsNext.onAjaxError,\r\n success(response) {\r\n var options = response.options;\r\n var isList = Array.isArray(options) && options.length > 0;\r\n var optionsIsSpecial = isList && (options[0].value === '#LOGGEDININFO1#' || options[0].value === '#LOGGEDININFO2#')\r\n\r\n if (optionsIsSpecial) {\r\n isList = false;\r\n }\r\n\r\n var showText = isContains || !isList;\r\n\r\n value.wrapper.toggle(!showText);\r\n valueInput.toggle(showText);\r\n\r\n valueInput.val(optionsIsSpecial ? options[0].value : '');\r\n\r\n if (isList) {\r\n options.forEach(function (option) {\r\n if (option.list) {\r\n option.value = option.list + \"#\" + option.value;\r\n }\r\n });\r\n }\r\n\r\n value.dataSource.data(isList ? options : []);\r\n\r\n if (isList) {\r\n value.select(0);\r\n }\r\n\r\n callback(response.type, response.id);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Get's the icon to display for a given filename.\r\n * @param {String} fileName\r\n */\r\n getFileIconSuffix(fileName) {\r\n if (fileName && fileName.indexOf(\".\") > -1) {\r\n // Also used by regular attachments.\r\n const knownExtensions = [ \"doc\", \"docx\", \"pdf\", \"ppt\", \"pptx\", \"txt\", \"xls\", \"xlsx\", \"zip\" ];\r\n\r\n const extension = fileName.split(\".\").pop().toLowerCase();\r\n const isKnownExtension = knownExtensions.indexOf(extension) > -1;\r\n\r\n if (isKnownExtension) {\r\n return \"-\" + extension.substring(0, 3);\r\n }\r\n }\r\n\r\n return \"\";\r\n }\r\n\r\n /**\r\n * \r\n * @param {String} url\r\n */\r\n goto(url) {\r\n const regexp = /^(file|ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/;\r\n const isUrl = regexp.test(url);\r\n\r\n if (isUrl) {\r\n window.open(url);\r\n }\r\n else {\r\n window.open(\"file:///\" + url);\r\n }\r\n }\r\n\r\n /**\r\n * Hides the new tab checkbox on kendo editor link dialog.\r\n * @param {any} e\r\n * @returns\r\n */\r\n hideNewTabCheckbox(e) {\r\n if (e.name !== \"createLink\") {\r\n return;\r\n }\r\n\r\n setTimeout(function () {\r\n $(\"#k-editor-link-target\").prop(\"checked\", true);\r\n $(\"#k-editor-link-target\").closest(\".k-form-field\").hide();\r\n }, 0);\r\n\r\n return;\r\n }\r\n\r\n /**\r\n * Cleans-up pasted content for paragraphs and divs with newlines and add target=\"_blank\" to links.\r\n * @param {String} relativePath A realtive path to use, defaults to '../'.\r\n * @returns {Object} The configuration for the editor.\r\n */\r\n getPasteCleanup(options) {\r\n return {\r\n custom: function (html) {\r\n // Replace paragraphs and divs with newlines. Needed because contents are display inline with flexbox in form, so paragraph doesn't work.\r\n var $html = $(\"
\" + html + \"
\");\r\n $html\r\n .find(\"p, div\")\r\n .after(\"
\")\r\n .contents()\r\n .unwrap();\r\n\r\n html = $html.get(0).innerHTML;\r\n\r\n // Only allowed html.\r\n html = core.sanitizeHtml(html);\r\n\r\n if (options.addTargetBlank) {\r\n html = html.replace(/]*/, function (a) {\r\n return a.replace(/target\\s*=\\s*['\"][^\"']*['\"]/i, '') + ' target=\"_blank\"';\r\n });\r\n }\r\n\r\n if (options.removeEncodedImage) {\r\n html = html.replace(/]+>/, '');\r\n }\r\n\r\n html = formControls.cleanUpImageBrowserUrl(html);\r\n\r\n return html;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * \r\n * @param {String} editorSelector\r\n * @param {String} pickerId\r\n */\r\n initializeBackColorPicker(editorSelector, pickerId) {\r\n this.#initializeColorPicker(\"back\", editorSelector, pickerId);\r\n }\r\n\r\n /**\r\n * \r\n * @param {String} editorSelector\r\n * @param {String} pickerId\r\n */\r\n initializeForeColorPicker(editorSelector, pickerId) {\r\n this.#initializeColorPicker(\"fore\", editorSelector, pickerId);\r\n }\r\n\r\n /**\r\n * \r\n * @param {String} fileName\r\n */\r\n isImage(fileName) {\r\n if (fileName && fileName.indexOf(\".\") > -1) {\r\n const imageExtensions = [\"jpg\", \"jpeg\", \"png\", \"gif\", \"bmp\", \"webp\"];\r\n const extension = fileName.split(\".\").pop().toLowerCase();\r\n\r\n return imageExtensions.indexOf(extension) > -1;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Move an item down in a list control.\r\n * @param {String} listId The id of the list.\r\n */\r\n moveDown(listId) {\r\n // Gets the item after the last selected item and moves it above the first selected item.\r\n var list = $(\"#\" + listId);\r\n var selectedEls = list.find(\":selected\");\r\n var firstEl = selectedEls.first();\r\n var nextEl = selectedEls.last().next();\r\n\r\n if (!nextEl.length) {\r\n return;\r\n }\r\n\r\n var firstXmlItem = $(specific).find(\"item[id='\" + firstEl.val() + \"']\");\r\n var nextXmlItem = $(specific).find(\"item[id='\" + nextEl.val() + \"']\");\r\n \r\n firstXmlItem.before(nextXmlItem);\r\n firstEl.before(nextEl);\r\n }\r\n\r\n /**\r\n * Move an item up in a list control.\r\n * @param {String} listId The id of the list.\r\n */\r\n moveUp(listId) {\r\n // Gets the item before the first selected item and moves it after the last selected item.\r\n var list = $(\"#\" + listId);\r\n var selectedEls = list.find(\":selected\");\r\n var lastEl = selectedEls.last();\r\n var previousEl = selectedEls.first().prev();\r\n\r\n if (!previousEl.length) {\r\n return;\r\n }\r\n\r\n var lastXmlItem = $(specific).find(\"item[id='\" + lastEl.val() + \"']\");\r\n var previousXmlItem = $(specific).find(\"item[id='\" + previousEl.val() + \"']\");\r\n\r\n lastXmlItem.after(previousXmlItem);\r\n lastEl.after(previousEl);\r\n }\r\n \r\n /**\r\n * Prevent deselection of multiselect option on clicking selected option,\r\n * which became possible in Chrome v125 but causes issues with our double click code. \r\n * @param {MouseEvent} e The event.\r\n */\r\n preventMulitselectDeselect(e) {\r\n var $this = $(this);\r\n var selected = $this.find(\"option\").filter(function () {\r\n return this.selected;\r\n });\r\n var previous = $this.data(\"previous-selected\");\r\n\r\n if (selected.length === 1 && e.target.value === previous) {\r\n e.preventDefault();\r\n }\r\n\r\n $this.data(\"previous-selected\", e.target.value);\r\n }\r\n\r\n /**\r\n * \r\n * @param {any} dropDown\r\n * @param {any} value\r\n */\r\n selectValueOrFirst(dropDown, value) {\r\n if (value) {\r\n dropDown.value(value);\r\n\r\n if (!dropDown.value()) {\r\n dropDown.select(0);\r\n }\r\n }\r\n else {\r\n dropDown.select(0);\r\n }\r\n }\r\n\r\n /**\r\n * \r\n * @param {any} contentHtml\r\n * @param {any} callback\r\n * @param {any} buttonText\r\n */\r\n showConfirmDialog(contentHtml, callback, buttonText, title, buttonClass = \"btn-danger\") {\r\n $(\"#windowcontainer\").append(\"
\");\r\n \r\n if (!buttonText) {\r\n buttonText = resources.confirmDialogMessages.delete;\r\n }\r\n\r\n let confirmationWindow = $(\"#confirmdialog\").kendoWindow({\r\n width: leanformsNext.getPopupWidth(300),\r\n title: title ?? resources.confirmDialogMessages.title,\r\n visible: false,\r\n modal: true,\r\n iframe: false,\r\n resizable: false,\r\n deactivate() {\r\n this.destroy();\r\n $(\"#windowcontainer\").html(\"\");\r\n }\r\n }).data(\"kendoWindow\");\r\n\r\n confirmationWindow.content(contentHtml +\r\n \"
\" +\r\n \" \" +\r\n \" \" +\r\n \"
\"\r\n );\r\n\r\n $(confirmationWindow.element).find(\"#btnOk\").on(\"click\", () => {\r\n confirmationWindow.close();\r\n callback();\r\n });\r\n\r\n $(confirmationWindow.element).find(\"#btnCancel\").on(\"click\", () => {\r\n confirmationWindow.close();\r\n });\r\n\r\n confirmationWindow.center().open();\r\n }\r\n\r\n /**\r\n * \r\n * Used by Form delete and DesignWorkflow rename.\r\n * @param {any} title\r\n * @param {any} bodyHtml\r\n * @param {any} callback\r\n */\r\n showOldConfirmDialog(title, bodyHtml, callback) {\r\n $(\"#windowcontainer\").append(\"
\");\r\n\r\n var dialog = $(\"#confirmdialog\").kendoWindow({\r\n title: title,\r\n width: leanformsNext.getPopupWidth(400),\r\n minHeight: leanformsNext.getPopupHeight(150),\r\n visible: false,\r\n modal: true,\r\n deactivate: function () {\r\n this.destroy();\r\n }\r\n }).data(\"kendoWindow\");\r\n\r\n var confirmTemplate = kendo.template($(\"#confirmTemplate\").html());\r\n dialog.content(confirmTemplate({ ConfirmText: bodyHtml }));\r\n\r\n $(dialog.element).find(\"#btnOk\").on(\"click\", function () {\r\n dialog.close();\r\n callback(\"OK\", $(\"#confirmInput :input\").serialize());\r\n });\r\n\r\n $(dialog.element).find(\"#btnCancel\").on(\"click\", function () {\r\n dialog.close();\r\n callback(\"CANCEL\");\r\n });\r\n\r\n dialog.center().open();\r\n }\r\n\r\n /**\r\n * \r\n * @param {any} operatorDropdown\r\n * @param {any} valueDropdown\r\n * @param {any} valueInput\r\n */\r\n toggleValueBox(operatorDropdown, valueDropdown, valueInput) {\r\n let valueDropdownKendo = valueDropdown.data(\"kendoDropDownList\"),\r\n options = valueDropdownKendo.dataSource.data().length,\r\n operator = operatorDropdown.data(\"kendoDropDownList\").value(),\r\n hasOptions = options > 0,\r\n isContains = operator === \"contains\" || operator === \"doesnotcontain\";\r\n\r\n let shouldShowDropdown = hasOptions && !isContains;\r\n valueDropdownKendo.wrapper.toggle(shouldShowDropdown);\r\n valueInput.toggle(!shouldShowDropdown);\r\n }\r\n\r\n /**\r\n * This functions expects jQuery XML.\r\n * @param {any} xmlData\r\n */\r\n xmlToString(xmlData) {\r\n try {\r\n let xmlString = undefined;\r\n\r\n if (window.ActiveXObject) {\r\n xmlString = xmlData[0].xml;\r\n }\r\n\r\n try {\r\n if (xmlString === undefined) {\r\n var oSerializer = new XMLSerializer();\r\n xmlString = oSerializer.serializeToString(xmlData[0]);\r\n }\r\n }\r\n catch (err) {\r\n if (xmlString === undefined) {\r\n var oSerializer = new XMLSerializer();\r\n xmlString = oSerializer.serializeToString(xmlData);\r\n }\r\n }\r\n\r\n return xmlString;\r\n }\r\n catch (error) {\r\n return `${error.message}`;\r\n }\r\n }\r\n // #endregion ********************************************************************************/\r\n\r\n // #region: Private Methods ******************************************************************/\r\n #initializeColorPicker(type, editorSelector, pickerId) {\r\n const pickerSelector = \"#\" + type + pickerId;\r\n const action = type === \"back\" ? \"backColor\" : \"foreColor\";\r\n const palette = type === \"back\" ? editorColors.backColors : editorColors.foreColors;\r\n\r\n // When the editor is not an iframe (but contenteditable div), text selection is lost on click inside the picker.\r\n const editor = $(editorSelector).data(\"kendoEditor\");\r\n const editorIsInline = $(editor.body).hasClass(\"k-editor-inline\");\r\n let range;\r\n let preventOpen;\r\n\r\n const picker = $(pickerSelector).kendoColorPicker({\r\n messages: {\r\n apply: resources.editor.apply,\r\n cancel: resources.editor.cancel\r\n },\r\n preview: false,\r\n palette: palette,\r\n columns: 10,\r\n value: \"rgba(255, 255, 255, 0)\",\r\n view: \"gradient\",\r\n views: [\"gradient\", \"palette\"],\r\n open: function (e) {\r\n if (preventOpen) {\r\n preventOpen = false;\r\n return e.preventDefault();\r\n }\r\n\r\n range = editor.getRange(); \r\n },\r\n close: function () {\r\n range = null;\r\n preventOpen = false;\r\n },\r\n change: function (e) {\r\n var rangeCopy = range;\r\n\r\n // This somehow prevents enter from removing text.\r\n setTimeout(() => { \r\n if (editorIsInline) {\r\n const selection = editor.getSelection();\r\n selection.removeAllRanges();\r\n selection.addRange(rangeCopy);\r\n range = null;\r\n }\r\n\r\n editor.exec(action, { value: e.value });\r\n }, 0);\r\n }\r\n }).data(\"kendoColorPicker\");\r\n\r\n // Allow setting last selected color by clicking left part.\r\n const leftButton = picker.wrapper.find(\".k-input-inner\");\r\n\r\n leftButton.on(\"click\", function () {\r\n if (picker.color().match?.input === 'rgba(255, 255, 255, 0)') {\r\n // Don't prevent opening or set color of no color is set in picker.\r\n return;\r\n }\r\n\r\n preventOpen = true;\r\n\r\n if (editorIsInline && range) {\r\n const selection = editor.getSelection();\r\n selection.removeAllRanges();\r\n selection.addRange(range);\r\n range = null;\r\n }\r\n\r\n editor.exec(action, { value: picker.value() });\r\n });\r\n }\r\n // #endregion ********************************************************************************/\r\n}();\r\n// #endregion ************************************************************************************/\r\n","// #region: Class definition *********************************************************************/\r\n/**\r\n * Handles all logic for a tabstrip.\r\n * A tabstrip is defined in HTML:\r\n * \r\n *
\r\n *
    \r\n *
  • \r\n * \r\n *
  • \r\n * ...more list items with a radio button with name=\"tabs\" and 'data-page' for the url to load.\r\n *
\r\n *
\r\n * \r\n * ...more frames where the (page) id should match the 'tab-id' of the radio button in a list item.\r\n *
\r\n *
\r\n * \r\n * Depends on the core and event-broadcaster class.\r\n */\r\nclass tabstrip {\r\n\r\n // #region: Constructor **********************************************************************/\r\n /**\r\n * The constructor does work that needs to be executed exactly once.\r\n */\r\n constructor(defaultTab, callback) {\r\n\r\n // A callback can be provided that is called on tab click.\r\n this.callback = callback;\r\n\r\n // Is selecting a new tab active.\r\n this.isSwitchingTab = false;\r\n\r\n // All tabs present in this tabstrip.\r\n this.tabs = [...document.querySelectorAll(\".tabstrip input[name=tabs]\")];\r\n\r\n // Add the events to the tabstrip instance.\r\n this.tabs.forEach((tab) => {\r\n // Add the click event on the radio (tab) to (re)load the url.\r\n // We use 'click' as the 'change' event will not fire when we set the selected radio to checked from script.\r\n // We can however reliably fire the click event.\r\n tab.addEventListener(\"click\", (e) => {\r\n if (this.callback && !this.callback(e, tab)) {\r\n return false;\r\n }\r\n \r\n // Select active tab.\r\n this.handleTabChange(tab.id);\r\n }, { capture: false });\r\n });\r\n\r\n // React to url change.\r\n top.window.addEventListener(\"popstate\", () => {\r\n var urlTab = isEmbed ? core.getEmbedUrl().searchParams.get(\"tab\") : core.getQueryParameter(\"tab\");\r\n\r\n this.selectTab(urlTab || defaultTab);\r\n });\r\n\r\n // Set initial tab.\r\n this.selectTab(core.getQueryParameter(\"tab\", window) || defaultTab);\r\n }\r\n // #endregion ********************************************************************************/\r\n\r\n // #region: Build ****************************************************************************/\r\n /**\r\n * Identifies class.\r\n * @returns {string} The string representation of this class.\r\n */\r\n toString() {\r\n return \"[tabstrip]\";\r\n }\r\n\r\n static toString() {\r\n return \"[tabstrip]\";\r\n }\r\n\r\n /** \r\n * Identifies the version.\r\n * @returns {string} The version number of this class.\r\n */\r\n static version() {\r\n return \"1.0.0\";\r\n }\r\n // #endregion ********************************************************************************/\r\n\r\n // #region: Public Methods *******************************************************************/\r\n /**\r\n * Enables all tabs.\r\n */\r\n enableAllTabs() {\r\n this.tabs.forEach((tab) => {\r\n tab.removeAttribute(\"disabled\");\r\n });\r\n }\r\n\r\n /**\r\n * Get the active tab.\r\n * @returns The currently active tab or the first in the list.\r\n */\r\n getActiveTab() {\r\n return document.querySelector(\".frames > iframe.active\") ?? this.tabs[0];\r\n }\r\n\r\n /**\r\n * Performs the action needed to switch tabs.\r\n * @param {String} newTabId The id for the new tab selected.\r\n */\r\n handleTabChange(newTabId) {\r\n const activeTab = this.getActiveTab();\r\n\r\n const url = document.querySelector(`#${newTabId}`).dataset.page;\r\n const iframe = document.querySelector(`#${newTabId}-page`);\r\n\r\n // So no tab is active at all.\r\n activeTab.classList.remove(\"active\");\r\n\r\n // Make this tab active.\r\n iframe.classList.add(\"active\");\r\n document.querySelector(`#${newTabId}`).checked = true;\r\n\r\n // Set new URL if needed.\r\n if (!iframe.contentWindow?.location.href.includes(url)) {\r\n var loadHandler = function () {\r\n eventBroadcaster.broadcast({ detail: { show: false }, message: broadcasts.LOCK_SCREEN });\r\n \r\n this.switchTabUrl(top.window, newTabId, iframe);\r\n this.isSwitchingTab = false;\r\n\r\n iframe.removeEventListener(\"load\", loadHandler);\r\n }.bind(this);\r\n\r\n iframe.addEventListener(\"load\", loadHandler, { capture: false });\r\n\r\n eventBroadcaster.broadcast({ detail: { show: true }, message: broadcasts.LOCK_SCREEN });\r\n iframe.src = baseUrl + url;\r\n }\r\n else {\r\n this.switchTabUrl(top.window, newTabId, iframe);\r\n this.isSwitchingTab = false;\r\n }\r\n }\r\n\r\n /**\r\n * In some cases the current tab may need to be reloaded.\r\n */\r\n reloadActiveTab() {\r\n const currentTab = document.querySelector(\"iframe.active\");\r\n\r\n currentTab.addEventListener(\"load\", function handler() {\r\n eventBroadcaster.broadcast({ detail: { show: false }, message: broadcasts.LOCK_SCREEN });\r\n this.removeEventListener(\"load\", handler);\r\n }, { capture: false });\r\n\r\n eventBroadcaster.broadcast({ detail: { show: true }, message: broadcasts.LOCK_SCREEN });\r\n currentTab.contentWindow.location.reload(true);\r\n }\r\n\r\n /**\r\n * Changing/saving any of the content in any of the tabs (might) need a reload to reflect the change.\r\n * @@param {String} tabId The id of the tab to reload.\r\n */\r\n reloadTab(tabId) {\r\n document.querySelector(`#${tabId}-page`)?.contentWindow.location.reload(true);\r\n }\r\n\r\n /**\r\n * Changing/saving any of the content in any of the tabs (might) need a reload to reflect the change.\r\n */\r\n reloadTabs() {\r\n [...document.querySelectorAll(\"iframe:not(.active)\")].forEach((frame) => {\r\n if (frame.src) {\r\n frame.contentWindow.location.reload(true);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Performs the action needed to undo the switching of the tabs, make the original tab button active again.\r\n * @param {String} newtab The id for the new tab selected.\r\n */\r\n resetTabChange(newTab) {\r\n document.querySelector(`#${this.getActiveTab().id.replace(\"-page\", \"\")}`).checked = true;\r\n newTab.checked = false;\r\n }\r\n\r\n /**\r\n * Select the tab (by its id).\r\n * Also called form the outside (on push state change?).\r\n * @@param {Integer} id The tab to show.\r\n */\r\n selectTab(id) {\r\n if (!id) {\r\n return;\r\n }\r\n\r\n const tab = document.querySelector(\"#\" + id);\r\n\r\n if (tab && !tab.checked) {\r\n this.isSwitchingTab = true;\r\n\r\n tab.disabled = false;\r\n tab.click();\r\n }\r\n }\r\n\r\n /**\r\n * Update tab info om the document and browsing history.\r\n * @param {Window} mainWindow The window reference to use.\r\n * @param {String} id The identifier for the tab to select.\r\n * @param {HTMLIFrameElement} iframe The active selected iFrame.\r\n */\r\n switchTabUrl(mainWindow, id, iframe) {\r\n const newTabUrl = core.setQueryParameter(window.location.href, \"tab\", id);\r\n\r\n // Using replaceState to fix history navigation to specific tab.\r\n window.history.replaceState({ path: newTabUrl }, null, newTabUrl);\r\n\r\n if (!this.isSwitchingTab) {\r\n // Using pushState as a tabstrip is nested iFrames in a main iFrame.\r\n // Because of the nesting there is no history entry created in the parent page.\r\n if (isEmbed) {\r\n const embedUrl = core.removeQueryParameter(newTabUrl, \"embed\");\r\n core.setEmbedUrl(embedUrl, true);\r\n } else {\r\n const newUrl = core.setQueryParameter(mainWindow.location.href, \"tab\", id);\r\n mainWindow.history.pushState({ path: newTabUrl }, null, newUrl);\r\n }\r\n }\r\n\r\n topWindow.document.title = resources.consoleTitle.replace(\"{Page}\", `: ${iframe.contentWindow.document.title}`);\r\n }\r\n // #endregion ********************************************************************************/\r\n\r\n};\r\n// #endregion ************************************************************************************/"],"mappings":"AAIAA,OAAOC,aAAe,IAAI,MAMtB,WAAAC,GAEIC,EAAEC,eAAc,SAAUC,QAASC,gBAAiBC,KAChD,MAAMC,iBAAmBL,EAAE,qCAAqCM,MAChE,GAAID,kBAAoBA,mBAAqB,GAAI,CAC7CD,IAAIG,iBAAiBC,kBAAmBH,iBAC5C,CACJ,IAEAL,EAAES,UAAU,CACRC,MAAO,QAGXC,KAAKC,cAAgB,CACjBC,KAAM,EACNC,SAAU,EACVC,SAAU,EACVC,OAAQ,EACRC,SAAU,EACVC,WAAY,EACZC,YAAa,EACbC,QAAS,EACTC,QAAS,IAGbV,KAAKW,oBAAsB,CACvBC,cAAe,OACfC,eAAgB,SAGpB,IAAIC,eAAiBC,OAAOC,UAAUC,YACtC,IAAIC,6BAA+B,MAGnC,IAAIC,cAAmBC,MAAMC,GAAGC,OAChCH,aAAaI,gBAAgBhC,QAAQiC,MAAQ,KAC7CL,aAAaM,gBAAgBlC,QAAQiC,MAAQ,MAE7CJ,MAAMC,GAAGC,OAAOI,GAAGnC,QAAQoC,aAAe,CACtCC,KAAM,KACNC,IAAK,KACLC,gBAAiB,MAGrBV,MAAMC,GAAGU,eAAeL,GAAGnC,QAAQyC,WAAa,KAChDZ,MAAMC,GAAGY,WAAWP,GAAGnC,QAAQyC,WAAa,KAE5C,UAA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