{"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","path","firstBlank","blank","group","includeAnonymous","kendoDropDownList","template","filter","dataSource","transport","read","getJSON","data","success","fail","supportsOffline","readyState","error","leanformsNext","getOfflineGroups","getOfflineUsersFromGroup","getOfflineUsers","then","listData","value","forEach","item","push","schema","model","id","fillDependantList","sourceObj","sourceId","isLoadingFormData","isSetFilterPage","eventTargets","dropdownTriggers","sourceValue","$sourceObj","prop","name","selectedList","listId","find","compareValue","targetId","dropdownData","newOptions","getDropDownOptions","trg","document","getElementById","innerHTML","getAttribute","firstOption","option","el","createElement","setAttribute","alt","appendChild","length","selected","changeDependentDate","calc","e","console","foundOptions","i","dependencies","dependency","questionId","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","substring","goto","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","shouldShowDropdown","xmlToString","xmlData","xmlString","ActiveXObject","xml","undefined","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","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","switchTabUrl","loadHandler","eventBroadcaster","broadcast","detail","show","broadcasts","LOCK_SCREEN","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,EAASC,EAAiBC,GAChD,MAAMC,EAAmBL,EAAE,qCAAqCM,MAC5DD,GAAyC,KAArBA,GACpBD,EAAIG,iBAAiBC,kBAAmBH,EAEhD,IAEAL,EAAES,UAAU,CACRC,OAAO,IAGXC,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,YAClCC,GAA+B,GAG/BC,aAAEA,GAAiBC,MAAMC,GAAGC,OAChCH,EAAaI,gBAAgBhC,QAAQiC,OAAQ,EAC7CL,EAAaM,gBAAgBlC,QAAQiC,OAAQ,EAE7CJ,MAAMC,GAAGC,OAAOI,GAAGnC,QAAQoC,aAAe,CACtCC,MAAM,EACNC,KAAK,EACLC,iBAAiB,GAGrBV,MAAMC,GAAGU,eAAeL,GAAGnC,QAAQyC,YAAa,EAChDZ,MAAMC,GAAGY,WAAWP,GAAGnC,QAAQyC,YAAa,OAEI,IAArCE,UAAUC,yBACjBf,MAAMC,GAAGU,eAAeL,GAAGnC,QAAQ6C,SAAWF,UAAUC,uBACxDf,MAAMC,GAAGgB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