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B,IAEEiN,EAFE7N,EAAUE,KACZ4N,EAAWhL,EAAUhD,UAAUM,KAAK,0BAGlC,IAAM0N,EAASnJ,SAInBkJ,EAAYC,EAASlN,KAAK,SAC1BuF,SAAWzF,OAAOoN,GAAUlN,KAAK,aAEjCA,EAAOA,GAAQ,IACViN,GAAajN,EAAKiN,IAAc,GAErCnN,OAAOoN,GAAUnM,IAAIf,EAAKiN,IAAcnN,OAAOoN,GAAUnM,OAEzDzB,KAAKJ,UAAUO,GAAG,SAAU,0BAA0B,SAAU6E,GAC9D,IAAI6I,EAAkBrN,OAAOwE,EAAMvE,QAEjCd,EADMkO,EAAgB1I,QAAQ,iBACfzE,KAAK,OACpBkM,EAAkB9M,EAAQ0K,WAE5BoC,EAAgBjN,GAAUkO,EAAgBnN,KAAK,UAC7CF,OAAOR,MAAMyB,MACf3B,EAAQkD,SAAS4J","sources":["packages/kirki-framework/control-repeater/src/control.js"],"sourcesContent":["import \"./control.scss\";\n\n/* global kirkiControlLoader */\n/* eslint max-depth: 0 */\n/* eslint no-useless-escape: 0 */\nvar RepeaterRow = function (rowIndex, container, label, control) {\n var self = this;\n this.rowIndex = rowIndex;\n this.container = container;\n this.label = label;\n this.header = this.container.find(\".repeater-row-header\");\n\n this.header.on(\"click\", function () {\n self.toggleMinimize();\n });\n\n this.container.on(\"click\", \".repeater-row-remove\", function () {\n self.remove();\n });\n\n this.header.on(\"mousedown\", function () {\n self.container.trigger(\"row:start-dragging\");\n });\n\n this.container.on(\"keyup change\", \"input, select, textarea\", function (e) {\n self.container.trigger(\"row:update\", [\n self.rowIndex,\n jQuery(e.target).data(\"field\"),\n e.target,\n ]);\n });\n\n this.setRowIndex = function (rowNum) {\n this.rowIndex = rowNum;\n this.container.attr(\"data-row\", rowNum);\n this.container.data(\"row\", rowNum);\n this.updateLabel();\n };\n\n this.toggleMinimize = function () {\n // Store the previous state.\n this.container.toggleClass(\"minimized\");\n this.header\n .find(\".dashicons\")\n .toggleClass(\"dashicons-arrow-up\")\n .toggleClass(\"dashicons-arrow-down\");\n };\n\n this.remove = function () {\n this.container.slideUp(300, function () {\n jQuery(this).detach();\n });\n this.container.trigger(\"row:remove\", [this.rowIndex]);\n };\n\n this.updateLabel = function () {\n var rowLabelField, rowLabel, rowLabelSelector;\n\n if (\"field\" === this.label.type) {\n rowLabelField = this.container.find(\n '.repeater-field [data-field=\"' + this.label.field + '\"]'\n );\n if (_.isFunction(rowLabelField.val)) {\n rowLabel = rowLabelField.val();\n if (\"\" !== rowLabel) {\n if (!_.isUndefined(control.params.fields[this.label.field])) {\n if (!_.isUndefined(control.params.fields[this.label.field].type)) {\n if (\"select\" === control.params.fields[this.label.field].type) {\n if (\n !_.isUndefined(\n control.params.fields[this.label.field].choices\n ) &&\n !_.isUndefined(\n control.params.fields[this.label.field].choices[\n rowLabelField.val()\n ]\n )\n ) {\n rowLabel =\n control.params.fields[this.label.field].choices[\n rowLabelField.val()\n ];\n }\n } else if (\n \"radio\" === control.params.fields[this.label.field].type ||\n \"radio-image\" === control.params.fields[this.label.field].type\n ) {\n rowLabelSelector =\n control.selector +\n ' [data-row=\"' +\n this.rowIndex +\n '\"] .repeater-field [data-field=\"' +\n this.label.field +\n '\"]:checked';\n rowLabel = jQuery(rowLabelSelector).val();\n }\n }\n }\n this.header.find(\".repeater-row-label\").text(rowLabel);\n return;\n }\n }\n }\n this.header\n .find(\".repeater-row-label\")\n .text(this.label.value + \" \" + (this.rowIndex + 1));\n };\n this.updateLabel();\n};\n\nwp.customize.controlConstructor.repeater = wp.customize.Control.extend({\n // When we're finished loading continue processing\n ready: function () {\n var control = this;\n\n // Init the control.\n if (\n !_.isUndefined(window.kirkiControlLoader) &&\n _.isFunction(kirkiControlLoader)\n ) {\n kirkiControlLoader(control);\n } else {\n control.initKirkiControl();\n }\n },\n\n initKirkiControl: function (control) {\n var limit, theNewRow, settingValue;\n control = control || this;\n\n // The current value set in Control Class (set in Kirki_Customize_Repeater_Control::to_json() function)\n settingValue = control.params.value;\n\n // The hidden field that keeps the data saved (though we never update it)\n control.settingField = control.container\n .find(\"[data-customize-setting-link]\")\n .first();\n\n // Set the field value for the first time, we'll fill it up later\n control.setValue([], false);\n\n // The DIV that holds all the rows\n control.repeaterFieldsContainer = control.container\n .find(\".repeater-fields\")\n .first();\n\n // Set number of rows to 0\n control.currentIndex = 0;\n\n // Save the rows objects\n control.rows = [];\n\n // Default limit choice\n limit = false;\n if (!_.isUndefined(control.params.choices.limit)) {\n limit =\n 0 >= control.params.choices.limit\n ? false\n : parseInt(control.params.choices.limit, 10);\n }\n\n control.container.on(\"click\", \"button.repeater-add\", function (e) {\n e.preventDefault();\n if (!limit || control.currentIndex < limit) {\n theNewRow = control.addRow();\n theNewRow.toggleMinimize();\n control.initColorPicker();\n control.initSelect(theNewRow);\n } else {\n jQuery(control.selector + \" .limit\").addClass(\"highlight\");\n }\n });\n\n control.container.on(\"click\", \".repeater-row-remove\", function () {\n control.currentIndex--;\n if (!limit || control.currentIndex < limit) {\n jQuery(control.selector + \" .limit\").removeClass(\"highlight\");\n }\n });\n\n control.container.on(\n \"click keypress\",\n \".repeater-field-image .upload-button,.repeater-field-cropped_image .upload-button,.repeater-field-upload .upload-button\",\n function (e) {\n e.preventDefault();\n control.$thisButton = jQuery(this);\n control.openFrame(e);\n }\n );\n\n control.container.on(\n \"click keypress\",\n \".repeater-field-image .remove-button,.repeater-field-cropped_image .remove-button\",\n function (e) {\n e.preventDefault();\n control.$thisButton = jQuery(this);\n control.removeImage(e);\n }\n );\n\n control.container.on(\n \"click keypress\",\n \".repeater-field-upload .remove-button\",\n function (e) {\n e.preventDefault();\n control.$thisButton = jQuery(this);\n control.removeFile(e);\n }\n );\n\n /**\n * Function that loads the Mustache template\n */\n control.repeaterTemplate = _.memoize(function () {\n var compiled,\n /*\n * Underscore's default ERB-style templates are incompatible with PHP\n * when asp_tags is enabled, so WordPress uses Mustache-inspired templating syntax.\n *\n * @see trac ticket #22344.\n */\n options = {\n evaluate: /<#([\\s\\S]+?)#>/g,\n interpolate: /\\{\\{\\{([\\s\\S]+?)\\}\\}\\}/g,\n escape: /\\{\\{([^\\}]+?)\\}\\}(?!\\})/g,\n variable: \"data\",\n };\n\n return function (data) {\n compiled = _.template(\n control.container\n .find(\".customize-control-repeater-content\")\n .first()\n .html(),\n null,\n options\n );\n return compiled(data);\n };\n });\n\n // When we load the control, the fields have not been filled up\n // This is the first time that we create all the rows\n if (settingValue.length) {\n _.each(settingValue, function (subValue) {\n theNewRow = control.addRow(subValue);\n control.initColorPicker();\n control.initSelect(theNewRow, subValue);\n });\n }\n\n control.repeaterFieldsContainer.sortable({\n handle: \".repeater-row-header\",\n update: function () {\n control.sort();\n },\n });\n },\n\n /**\n * Open the media modal.\n *\n * @param {Object} event - The JS event.\n * @returns {void}\n */\n openFrame: function (event) {\n if (wp.customize.utils.isKeydownButNotEnterEvent(event)) {\n return;\n }\n\n if (\n this.$thisButton\n .closest(\".repeater-field\")\n .hasClass(\"repeater-field-cropped_image\")\n ) {\n this.initCropperFrame();\n } else {\n this.initFrame();\n }\n\n this.frame.open();\n },\n\n initFrame: function () {\n var libMediaType = this.getMimeType();\n\n this.frame = wp.media({\n states: [\n new wp.media.controller.Library({\n library: wp.media.query({ type: libMediaType }),\n multiple: false,\n date: false,\n }),\n ],\n });\n\n // When a file is selected, run a callback.\n this.frame.on(\"select\", this.onSelect, this);\n },\n\n /**\n * Create a media modal select frame, and store it so the instance can be reused when needed.\n * This is mostly a copy/paste of Core api.CroppedImageControl in /wp-admin/js/customize-control.js\n *\n * @returns {void}\n */\n initCropperFrame: function () {\n // We get the field id from which this was called\n var currentFieldId = this.$thisButton\n .siblings(\"input.hidden-field\")\n .attr(\"data-field\"),\n attrs = [\"width\", \"height\", \"flex_width\", \"flex_height\"], // A list of attributes to look for\n libMediaType = this.getMimeType();\n\n // Make sure we got it\n if (_.isString(currentFieldId) && \"\" !== currentFieldId) {\n // Make fields is defined and only do the hack for cropped_image\n if (\n _.isObject(this.params.fields[currentFieldId]) &&\n \"cropped_image\" === this.params.fields[currentFieldId].type\n ) {\n //Iterate over the list of attributes\n attrs.forEach(\n function (el) {\n // If the attribute exists in the field\n if (!_.isUndefined(this.params.fields[currentFieldId][el])) {\n // Set the attribute in the main object\n this.params[el] = this.params.fields[currentFieldId][el];\n }\n }.bind(this)\n );\n }\n }\n\n this.frame = wp.media({\n button: {\n text: \"Select and Crop\",\n close: false,\n },\n states: [\n new wp.media.controller.Library({\n library: wp.media.query({ type: libMediaType }),\n multiple: false,\n date: false,\n suggestedWidth: this.params.width,\n suggestedHeight: this.params.height,\n }),\n new wp.media.controller.CustomizeImageCropper({\n imgSelectOptions: this.calculateImageSelectOptions,\n control: this,\n }),\n ],\n });\n\n this.frame.on(\"select\", this.onSelectForCrop, this);\n this.frame.on(\"cropped\", this.onCropped, this);\n this.frame.on(\"skippedcrop\", this.onSkippedCrop, this);\n },\n\n onSelect: function () {\n var attachment = this.frame.state().get(\"selection\").first().toJSON();\n\n if (\n this.$thisButton\n .closest(\".repeater-field\")\n .hasClass(\"repeater-field-upload\")\n ) {\n this.setFileInRepeaterField(attachment);\n } else {\n this.setImageInRepeaterField(attachment);\n }\n },\n\n /**\n * After an image is selected in the media modal, switch to the cropper\n * state if the image isn't the right size.\n */\n\n onSelectForCrop: function () {\n var attachment = this.frame.state().get(\"selection\").first().toJSON();\n\n if (\n this.params.width === attachment.width &&\n this.params.height === attachment.height &&\n !this.params.flex_width &&\n !this.params.flex_height\n ) {\n this.setImageInRepeaterField(attachment);\n } else {\n this.frame.setState(\"cropper\");\n }\n },\n\n /**\n * After the image has been cropped, apply the cropped image data to the setting.\n *\n * @param {object} croppedImage Cropped attachment data.\n * @returns {void}\n */\n onCropped: function (croppedImage) {\n this.setImageInRepeaterField(croppedImage);\n },\n\n /**\n * Returns a set of options, computed from the attached image data and\n * control-specific data, to be fed to the imgAreaSelect plugin in\n * wp.media.view.Cropper.\n *\n * @param {wp.media.model.Attachment} attachment - The attachment from the WP API.\n * @param {wp.media.controller.Cropper} controller - Media controller.\n * @returns {Object} - Options.\n */\n calculateImageSelectOptions: function (attachment, controller) {\n var control = controller.get(\"control\"),\n flexWidth = !!parseInt(control.params.flex_width, 10),\n flexHeight = !!parseInt(control.params.flex_height, 10),\n realWidth = attachment.get(\"width\"),\n realHeight = attachment.get(\"height\"),\n xInit = parseInt(control.params.width, 10),\n yInit = parseInt(control.params.height, 10),\n ratio = xInit / yInit,\n xImg = realWidth,\n yImg = realHeight,\n x1,\n y1,\n imgSelectOptions;\n\n controller.set(\n \"canSkipCrop\",\n !control.mustBeCropped(\n flexWidth,\n flexHeight,\n xInit,\n yInit,\n realWidth,\n realHeight\n )\n );\n\n if (xImg / yImg > ratio) {\n yInit = yImg;\n xInit = yInit * ratio;\n } else {\n xInit = xImg;\n yInit = xInit / ratio;\n }\n\n x1 = (xImg - xInit) / 2;\n y1 = (yImg - yInit) / 2;\n\n imgSelectOptions = {\n handles: true,\n keys: true,\n instance: true,\n persistent: true,\n imageWidth: realWidth,\n imageHeight: realHeight,\n x1: x1,\n y1: y1,\n x2: xInit + x1,\n y2: yInit + y1,\n };\n\n if (false === flexHeight && false === flexWidth) {\n imgSelectOptions.aspectRatio = xInit + \":\" + yInit;\n }\n if (false === flexHeight) {\n imgSelectOptions.maxHeight = yInit;\n }\n if (false === flexWidth) {\n imgSelectOptions.maxWidth = xInit;\n }\n\n return imgSelectOptions;\n },\n\n /**\n * Return whether the image must be cropped, based on required dimensions.\n *\n * @param {bool} flexW - The flex-width.\n * @param {bool} flexH - The flex-height.\n * @param {int} dstW - Initial point distance in the X axis.\n * @param {int} dstH - Initial point distance in the Y axis.\n * @param {int} imgW - Width.\n * @param {int} imgH - Height.\n * @returns {bool} - Whether the image must be cropped or not based on required dimensions.\n */\n mustBeCropped: function (flexW, flexH, dstW, dstH, imgW, imgH) {\n return !(\n (true === flexW && true === flexH) ||\n (true === flexW && dstH === imgH) ||\n (true === flexH && dstW === imgW) ||\n (dstW === imgW && dstH === imgH) ||\n imgW <= dstW\n );\n },\n\n /**\n * If cropping was skipped, apply the image data directly to the setting.\n *\n * @returns {void}\n */\n onSkippedCrop: function () {\n var attachment = this.frame.state().get(\"selection\").first().toJSON();\n this.setImageInRepeaterField(attachment);\n },\n\n /**\n * Updates the setting and re-renders the control UI.\n *\n * @param {object} attachment - The attachment object.\n * @returns {void}\n */\n setImageInRepeaterField: function (attachment) {\n var $targetDiv = this.$thisButton.closest(\n \".repeater-field-image,.repeater-field-cropped_image\"\n );\n\n $targetDiv\n .find(\".kirki-image-attachment\")\n .html('<img src=\"' + attachment.url + '\">')\n .hide()\n .slideDown(\"slow\");\n\n $targetDiv.find(\".hidden-field\").val(attachment.id);\n this.$thisButton.text(this.$thisButton.data(\"alt-label\"));\n $targetDiv.find(\".remove-button\").show();\n\n //This will activate the save button\n $targetDiv.find(\"input, textarea, select\").trigger(\"change\");\n this.frame.close();\n },\n\n /**\n * Updates the setting and re-renders the control UI.\n *\n * @param {object} attachment - The attachment object.\n * @returns {void}\n */\n setFileInRepeaterField: function (attachment) {\n var $targetDiv = this.$thisButton.closest(\".repeater-field-upload\");\n\n $targetDiv\n .find(\".kirki-file-attachment\")\n .html(\n '<span class=\"file\"><span class=\"dashicons dashicons-media-default\"></span> ' +\n attachment.filename +\n \"</span>\"\n )\n .hide()\n .slideDown(\"slow\");\n\n $targetDiv.find(\".hidden-field\").val(attachment.id);\n this.$thisButton.text(this.$thisButton.data(\"alt-label\"));\n $targetDiv.find(\".upload-button\").show();\n $targetDiv.find(\".remove-button\").show();\n\n //This will activate the save button\n $targetDiv.find(\"input, textarea, select\").trigger(\"change\");\n this.frame.close();\n },\n\n getMimeType: function () {\n // We get the field id from which this was called\n var currentFieldId = this.$thisButton\n .siblings(\"input.hidden-field\")\n .attr(\"data-field\");\n\n // Make sure we got it\n if (_.isString(currentFieldId) && \"\" !== currentFieldId) {\n // Make fields is defined and only do the hack for cropped_image\n if (\n _.isObject(this.params.fields[currentFieldId]) &&\n \"upload\" === this.params.fields[currentFieldId].type\n ) {\n // If the attribute exists in the field\n if (!_.isUndefined(this.params.fields[currentFieldId].mime_type)) {\n // Set the attribute in the main object\n return this.params.fields[currentFieldId].mime_type;\n }\n }\n }\n return \"image\";\n },\n\n removeImage: function (event) {\n var $targetDiv, $uploadButton;\n\n if (wp.customize.utils.isKeydownButNotEnterEvent(event)) {\n return;\n }\n\n $targetDiv = this.$thisButton.closest(\n \".repeater-field-image,.repeater-field-cropped_image,.repeater-field-upload\"\n );\n $uploadButton = $targetDiv.find(\".upload-button\");\n\n $targetDiv.find(\".kirki-image-attachment\").slideUp(\"fast\", function () {\n jQuery(this).show().html(jQuery(this).data(\"placeholder\"));\n });\n $targetDiv.find(\".hidden-field\").val(\"\");\n $uploadButton.text($uploadButton.data(\"label\"));\n this.$thisButton.hide();\n\n $targetDiv.find(\"input, textarea, select\").trigger(\"change\");\n },\n\n removeFile: function (event) {\n var $targetDiv, $uploadButton;\n\n if (wp.customize.utils.isKeydownButNotEnterEvent(event)) {\n return;\n }\n\n $targetDiv = this.$thisButton.closest(\".repeater-field-upload\");\n $uploadButton = $targetDiv.find(\".upload-button\");\n\n $targetDiv.find(\".kirki-file-attachment\").slideUp(\"fast\", function () {\n jQuery(this).show().html(jQuery(this).data(\"placeholder\"));\n });\n $targetDiv.find(\".hidden-field\").val(\"\");\n $uploadButton.text($uploadButton.data(\"label\"));\n this.$thisButton.hide();\n\n $targetDiv.find(\"input, textarea, select\").trigger(\"change\");\n },\n\n /**\n * Get the current value of the setting\n *\n * @returns {Object} - Returns the value.\n */\n getValue: function () {\n // The setting is saved in JSON\n return JSON.parse(decodeURI(this.setting.get()));\n },\n\n /**\n * Set a new value for the setting\n *\n * @param {Object} newValue - The new value.\n * @param {bool} refresh - If we want to refresh the previewer or not\n * @param {bool} filtering - If we want to filter or not.\n * @returns {void}\n */\n setValue: function (newValue, refresh, filtering) {\n // We need to filter the values after the first load to remove data requrired for diplay but that we don't want to save in DB\n var filteredValue = newValue,\n filter = [];\n\n if (filtering) {\n jQuery.each(this.params.fields, function (index, value) {\n if (\n \"image\" === value.type ||\n \"cropped_image\" === value.type ||\n \"upload\" === value.type\n ) {\n filter.push(index);\n }\n });\n jQuery.each(newValue, function (index, value) {\n jQuery.each(filter, function (ind, field) {\n if (!_.isUndefined(value[field]) && !_.isUndefined(value[field].id)) {\n filteredValue[index][field] = value[field].id;\n }\n });\n });\n }\n\n this.setting.set(encodeURI(JSON.stringify(filteredValue)));\n\n if (refresh) {\n // Trigger the change event on the hidden field so\n // previewer refresh the website on Customizer\n this.settingField.trigger(\"change\");\n }\n },\n\n /**\n * Add a new row to repeater settings based on the structure.\n *\n * @param {Object} data - (Optional) Object of field => value pairs (undefined if you want to get the default values)\n * @returns {Object} - Returns the new row.\n */\n addRow: function (data) {\n var control = this,\n template = control.repeaterTemplate(), // The template for the new row (defined on Kirki_Customize_Repeater_Control::render_content() ).\n settingValue = this.getValue(), // Get the current setting value.\n newRowSetting = {}, // Saves the new setting data.\n templateData, // Data to pass to the template\n newRow,\n i;\n\n if (template) {\n // The control structure is going to define the new fields\n // We need to clone control.params.fields. Assigning it\n // ould result in a reference assignment.\n templateData = jQuery.extend(true, {}, control.params.fields);\n\n // But if we have passed data, we'll use the data values instead\n if (data) {\n for (i in data) {\n if (data.hasOwnProperty(i) && templateData.hasOwnProperty(i)) {\n templateData[i].default = data[i];\n }\n }\n }\n\n templateData.index = this.currentIndex;\n\n // Append the template content\n template = template(templateData);\n\n // Create a new row object and append the element\n newRow = new RepeaterRow(\n control.currentIndex,\n jQuery(template).appendTo(control.repeaterFieldsContainer),\n control.params.row_label,\n control\n );\n\n newRow.container.on(\"row:remove\", function (e, rowIndex) {\n control.deleteRow(rowIndex);\n });\n\n newRow.container.on(\n \"row:update\",\n function (e, rowIndex, fieldName, element) {\n control.updateField.call(control, e, rowIndex, fieldName, element); // eslint-disable-line no-useless-call\n newRow.updateLabel();\n }\n );\n\n // Add the row to rows collection\n this.rows[this.currentIndex] = newRow;\n\n for (i in templateData) {\n if (templateData.hasOwnProperty(i)) {\n newRowSetting[i] = templateData[i].default;\n }\n }\n\n settingValue[this.currentIndex] = newRowSetting;\n this.setValue(settingValue, true);\n\n this.currentIndex++;\n\n return newRow;\n }\n },\n\n sort: function () {\n var control = this,\n $rows = this.repeaterFieldsContainer.find(\".repeater-row\"),\n newOrder = [],\n settings = control.getValue(),\n newRows = [],\n newSettings = [];\n\n $rows.each(function (i, element) {\n newOrder.push(jQuery(element).data(\"row\"));\n });\n\n jQuery.each(newOrder, function (newPosition, oldPosition) {\n newRows[newPosition] = control.rows[oldPosition];\n newRows[newPosition].setRowIndex(newPosition);\n\n newSettings[newPosition] = settings[oldPosition];\n });\n\n control.rows = newRows;\n control.setValue(newSettings);\n },\n\n /**\n * Delete a row in the repeater setting\n *\n * @param {int} index - Position of the row in the complete Setting Array\n * @returns {void}\n */\n deleteRow: function (index) {\n var currentSettings = this.getValue(),\n row,\n prop;\n\n if (currentSettings[index]) {\n // Find the row\n row = this.rows[index];\n if (row) {\n // Remove the row settings\n delete currentSettings[index];\n\n // Remove the row from the rows collection\n delete this.rows[index];\n\n // Update the new setting values\n this.setValue(currentSettings, true);\n }\n }\n\n // Remap the row numbers\n for (prop in this.rows) {\n if (this.rows.hasOwnProperty(prop) && this.rows[prop]) {\n this.rows[prop].updateLabel();\n }\n }\n },\n\n /**\n * Update a single field inside a row.\n * Triggered when a field has changed\n *\n * @param {Object} e - Event Object\n * @param {int} rowIndex - The row's index as an integer.\n * @param {string} fieldId - The field ID.\n * @param {string|Object} element - The element's identifier, or jQuery Object of the element.\n * @returns {void}\n */\n updateField: function (e, rowIndex, fieldId, element) {\n var type, row, currentSettings;\n\n if (!this.rows[rowIndex]) {\n return;\n }\n\n if (!this.params.fields[fieldId]) {\n return;\n }\n\n type = this.params.fields[fieldId].type;\n row = this.rows[rowIndex];\n currentSettings = this.getValue();\n\n element = jQuery(element);\n\n if (_.isUndefined(currentSettings[row.rowIndex][fieldId])) {\n return;\n }\n\n if (\"checkbox\" === type) {\n currentSettings[row.rowIndex][fieldId] = element.is(\":checked\");\n } else {\n // Update the settings\n currentSettings[row.rowIndex][fieldId] = element.val();\n }\n this.setValue(currentSettings, true);\n },\n\n /**\n * Init the color picker on color fields\n * Called after AddRow\n *\n * @returns {void}\n */\n initColorPicker: function () {\n var control = this;\n var colorPicker = control.container.find(\".kirki-classic-color-picker\");\n var fieldId = colorPicker.data(\"field\");\n var options = {};\n\n // We check if the color palette parameter is defined.\n if (\n !_.isUndefined(fieldId) &&\n !_.isUndefined(control.params.fields[fieldId]) &&\n !_.isUndefined(control.params.fields[fieldId].palettes) &&\n _.isObject(control.params.fields[fieldId].palettes)\n ) {\n options.palettes = control.params.fields[fieldId].palettes;\n }\n\n // When the color picker value is changed we update the value of the field\n options.change = function (event, ui) {\n var currentPicker = jQuery(event.target);\n var row = currentPicker.closest(\".repeater-row\");\n var rowIndex = row.data(\"row\");\n var currentSettings = control.getValue();\n var value = ui.color._alpha < 1 ? ui.color.to_s() : ui.color.toString();\n\n currentSettings[rowIndex][currentPicker.data(\"field\")] = value;\n control.setValue(currentSettings, true);\n\n\t\t\t// By default if the alpha is 1, the input will be rgb.\n\t\t\t// We setTimeout to 50ms to prevent race value set.\n\t\t\tsetTimeout(function() {\n\t\t\t\tevent.target.value = value;\n\t\t\t}, 50);\n };\n\n // Init the color picker\n if (colorPicker.length && 0 !== colorPicker.length) {\n colorPicker.wpColorPicker(options);\n }\n },\n\n /**\n * Init the dropdown-pages field.\n * Called after AddRow\n *\n * @param {object} theNewRow the row that was added to the repeater\n * @param {object} data the data for the row if we're initializing a pre-existing row\n * @returns {void}\n */\n initSelect: function (theNewRow, data) {\n var control = this,\n dropdown = theNewRow.container.find(\".repeater-field select\"),\n dataField;\n\n if (0 === dropdown.length) {\n return;\n }\n\n dataField = dropdown.data(\"field\");\n multiple = jQuery(dropdown).data(\"multiple\");\n\n data = data || {};\n data[dataField] = data[dataField] || \"\";\n\n jQuery(dropdown).val(data[dataField] || jQuery(dropdown).val());\n\n this.container.on(\"change\", \".repeater-field select\", function (event) {\n var currentDropdown = jQuery(event.target),\n row = currentDropdown.closest(\".repeater-row\"),\n rowIndex = row.data(\"row\"),\n currentSettings = control.getValue();\n\n currentSettings[rowIndex][currentDropdown.data(\"field\")] =\n jQuery(this).val();\n control.setValue(currentSettings);\n });\n },\n});\n"],"names":["$c32ddecb66401709$var$RepeaterRow","rowIndex","container","label","control","self","this","header","find","on","toggleMinimize","remove","trigger","e","jQuery","target","data","setRowIndex","rowNum","attr","updateLabel","toggleClass","slideUp","detach","rowLabelField","rowLabel","rowLabelSelector","type","field","_","isFunction","val","isUndefined","params","fields","choices","selector","text","value","wp","customize","controlConstructor","repeater","Control","extend","ready","window","kirkiControlLoader","initKirkiControl","limit","theNewRow","settingValue","settingField","first","setValue","repeaterFieldsContainer","currentIndex","rows","parseInt","preventDefault","addRow","initColorPicker","initSelect","addClass","removeClass","$thisButton","openFrame","removeImage","removeFile","repeaterTemplate","memoize","options","evaluate","interpolate","escape","variable","template","html","compiled","length","each","subValue","sortable","handle","update","sort","event","utils","isKeydownButNotEnterEvent","closest","hasClass","initCropperFrame","initFrame","frame","open","libMediaType","getMimeType","media","states","controller","Library","library","query","multiple","date","onSelect","currentFieldId","siblings","isString","isObject","forEach","el","bind","button","close","suggestedWidth","width","suggestedHeight","height","CustomizeImageCropper","imgSelectOptions","calculateImageSelectOptions","onSelectForCrop","onCropped","onSkippedCrop","attachment","state","get","toJSON","setFileInRepeaterField","setImageInRepeaterField","flex_width","flex_height","setState","croppedImage","x1","y1","flexWidth","flexHeight","realWidth","realHeight","xInit","yInit","ratio","xImg","yImg","set","mustBeCropped","handles","keys","instance","persistent","imageWidth","imageHeight","x2","y2","aspectRatio","maxHeight","maxWidth","flexW","flexH","dstW","dstH","imgW","imgH","$targetDiv","url","hide","slideDown","id","show","filename","mime_type","$uploadButton","getValue","JSON","parse","decodeURI","setting","newValue","refresh","filtering","filteredValue","filter","index","push","ind","encodeURI","stringify","templateData","newRow","i","newRowSetting","hasOwnProperty","default","appendTo","row_label","deleteRow","fieldName","element","updateField","call","$rows","newOrder","settings","newRows","newSettings","newPosition","oldPosition","prop","currentSettings","fieldId","row","is","colorPicker","palettes","change","ui","currentPicker","color","_alpha","to_s","toString","setTimeout","wpColorPicker","dataField","dropdown","currentDropdown"],"version":3,"file":"control.js.map"}