PluginProbe ʕ •ᴥ•ʔ
Secure Custom Fields / 6.9.3
Secure Custom Fields v6.9.3
6.9.5 6.9.4 6.9.3 6.9.2 6.9.1 6.9.0 6.8.9 6.8.7 6.8.8 6.8.6 6.8.4 6.8.5 trunk 6.4.0-beta1 6.4.0-beta2 6.4.1 6.4.1-beta3 6.4.1-beta4 6.4.1-beta5 6.4.1-beta6 6.4.1-beta7 6.4.2 6.5.0 6.5.1 6.5.2 6.5.3 6.5.4 6.5.5 6.5.6 6.5.7 6.6.0 6.7.0 6.7.1 6.8.0 6.8.1 6.8.2 6.8.3
secure-custom-fields / assets / build / js / acf-field-group.js
secure-custom-fields / assets / build / js Last commit date
commands 1 month ago pro 4 weeks ago acf-escaped-html-notice.asset.php 1 year ago acf-escaped-html-notice.js 1 year ago acf-escaped-html-notice.js.map 1 year ago acf-escaped-html-notice.min.asset.php 9 months ago acf-escaped-html-notice.min.js 9 months ago acf-field-group.asset.php 4 months ago acf-field-group.js 4 months ago acf-field-group.js.map 4 months ago acf-field-group.min.asset.php 4 months ago acf-field-group.min.js 4 months ago acf-input.asset.php 4 weeks ago acf-input.js 4 weeks ago acf-input.js.map 4 weeks ago acf-input.min.asset.php 4 weeks ago acf-input.min.js 4 weeks ago acf-internal-post-type.asset.php 9 months ago acf-internal-post-type.js 9 months ago acf-internal-post-type.js.map 9 months ago acf-internal-post-type.min.asset.php 9 months ago acf-internal-post-type.min.js 9 months ago acf.asset.php 4 weeks ago acf.js 4 weeks ago acf.js.map 4 weeks ago acf.min.asset.php 4 weeks ago acf.min.js 4 weeks ago index.php 1 year ago scf-bindings.asset.php 1 month ago scf-bindings.js 1 month ago scf-bindings.js.map 1 month ago scf-bindings.min.asset.php 1 month ago scf-bindings.min.js 1 month ago
acf-field-group.js
3142 lines
1 /******/ (() => { // webpackBootstrap
2 /******/ var __webpack_modules__ = ({
3
4 /***/ "./assets/src/js/_browse-fields-modal.js":
5 /*!***********************************************!*\
6 !*** ./assets/src/js/_browse-fields-modal.js ***!
7 \***********************************************/
8 /***/ (() => {
9
10 /**
11 * Extends acf.models.Modal to create the field browser.
12 */
13
14 (function ($, undefined, acf) {
15 const browseFieldsModal = {
16 data: {
17 openedBy: null,
18 currentFieldType: null,
19 popularFieldTypes: ['text', 'textarea', 'email', 'url', 'file', 'gallery', 'select', 'true_false', 'link', 'post_object', 'relationship', 'repeater', 'flexible_content', 'clone']
20 },
21 events: {
22 'click .acf-modal-close': 'onClickClose',
23 'keydown .acf-browse-fields-modal': 'onPressEscapeClose',
24 'click .acf-select-field': 'onClickSelectField',
25 'click .acf-field-type': 'onClickFieldType',
26 'changed:currentFieldType': 'onChangeFieldType',
27 'input .acf-search-field-types': 'onSearchFieldTypes',
28 'click .acf-browse-popular-fields': 'onClickBrowsePopular'
29 },
30 setup: function (props) {
31 $.extend(this.data, props);
32 this.$el = $(this.tmpl());
33 this.render();
34 },
35 initialize: function () {
36 this.open();
37 this.lockFocusToModal(true);
38 this.$el.find('.acf-modal-title').trigger('focus');
39 acf.doAction('show', this.$el);
40 },
41 tmpl: function () {
42 return $('#tmpl-acf-browse-fields-modal').html();
43 },
44 getFieldTypes: function (category, search) {
45 let fieldTypes;
46 if (!acf.get('is_pro')) {
47 // Add in the pro fields.
48 fieldTypes = Object.values({
49 ...acf.get('fieldTypes'),
50 ...acf.get('PROFieldTypes')
51 });
52 } else {
53 fieldTypes = Object.values(acf.get('fieldTypes'));
54 }
55 if (category) {
56 if ('popular' === category) {
57 return fieldTypes.filter(fieldType => this.get('popularFieldTypes').includes(fieldType.name));
58 }
59 if ('pro' === category) {
60 return fieldTypes.filter(fieldType => fieldType.pro);
61 }
62 fieldTypes = fieldTypes.filter(fieldType => fieldType.category === category);
63 }
64 if (search) {
65 fieldTypes = fieldTypes.filter(fieldType => {
66 const label = fieldType.label.toLowerCase();
67 const labelParts = label.split(' ');
68 let match = false;
69 if (label.startsWith(search.toLowerCase())) {
70 match = true;
71 } else if (labelParts.length > 1) {
72 labelParts.forEach(part => {
73 if (part.startsWith(search.toLowerCase())) {
74 match = true;
75 }
76 });
77 }
78 return match;
79 });
80 }
81 return fieldTypes;
82 },
83 render: function () {
84 acf.doAction('append', this.$el);
85 const $tabs = this.$el.find('.acf-field-types-tab');
86 const self = this;
87 $tabs.each(function () {
88 const category = $(this).data('category');
89 const fieldTypes = self.getFieldTypes(category);
90 fieldTypes.forEach(fieldType => {
91 $(this).append(self.getFieldTypeHTML(fieldType));
92 });
93 });
94 this.initializeFieldLabel();
95 this.initializeFieldType();
96 this.onChangeFieldType();
97 },
98 getFieldTypeHTML: function (fieldType) {
99 const iconName = fieldType.name.replaceAll('_', '-');
100 return `
101 <a href="#" class="acf-field-type" data-field-type="${fieldType.name}">
102 <i class="field-type-icon field-type-icon-${iconName}"></i>
103 <span class="field-type-label">${fieldType.label}</span>
104 </a>
105 `;
106 },
107 decodeFieldTypeURL: function (url) {
108 if (typeof url != 'string') return url;
109 return url.replaceAll('&#038;', '&');
110 },
111 renderFieldTypeDesc: function (fieldType) {
112 const fieldTypeInfo = this.getFieldTypes().filter(fieldTypeFilter => fieldTypeFilter.name === fieldType)[0] || {};
113 const args = acf.parseArgs(fieldTypeInfo, {
114 label: '',
115 description: '',
116 doc_url: false,
117 tutorial_url: false,
118 preview_image: false,
119 pro: false
120 });
121 this.$el.find('.field-type-name').text(args.label);
122 this.$el.find('.field-type-desc').text(args.description);
123 if (args.doc_url) {
124 this.$el.find('.field-type-doc').attr('href', this.decodeFieldTypeURL(args.doc_url)).show();
125 } else {
126 this.$el.find('.field-type-doc').hide();
127 }
128 if (args.tutorial_url) {
129 this.$el.find('.field-type-tutorial').attr('href', this.decodeFieldTypeURL(args.tutorial_url)).parent().show();
130 } else {
131 this.$el.find('.field-type-tutorial').parent().hide();
132 }
133 if (args.preview_image) {
134 this.$el.find('.field-type-image').attr('src', args.preview_image).show();
135 } else {
136 this.$el.find('.field-type-image').hide();
137 }
138 const isPro = true;
139 const isActive = true;
140 const $upgateToProButton = this.$el.find('.acf-btn-pro');
141 const $upgradeToUnlockButton = this.$el.find('.field-type-upgrade-to-unlock');
142 if (args.pro && (!isPro || !isActive)) {
143 $upgateToProButton.show();
144 $upgateToProButton.attr('href', $upgateToProButton.data('urlBase') + fieldType);
145 $upgradeToUnlockButton.show();
146 $upgradeToUnlockButton.attr('href', $upgradeToUnlockButton.data('urlBase') + fieldType);
147 this.$el.find('.acf-insert-field-label').attr('disabled', true);
148 this.$el.find('.acf-select-field').hide();
149 } else {
150 $upgateToProButton.hide();
151 $upgradeToUnlockButton.hide();
152 this.$el.find('.acf-insert-field-label').attr('disabled', false);
153 this.$el.find('.acf-select-field').show();
154 }
155 },
156 initializeFieldType: function () {
157 const fieldObject = this.get('openedBy');
158 const fieldType = fieldObject?.data?.type;
159
160 // Select default field type
161 if (fieldType) {
162 this.set('currentFieldType', fieldType);
163 } else {
164 this.set('currentFieldType', 'text');
165 }
166
167 // Select first tab with selected field type
168 // If type selected is within Popular, select Popular Tab
169 // Else select first tab the type belongs
170 const fieldTypes = this.getFieldTypes();
171 const isFieldTypePopular = this.get('popularFieldTypes').includes(fieldType);
172 let category = '';
173 if (isFieldTypePopular) {
174 category = 'popular';
175 } else {
176 const selectedFieldType = fieldTypes.find(x => {
177 return x.name === fieldType;
178 });
179 category = selectedFieldType.category;
180 }
181 const uppercaseCategory = category[0].toUpperCase() + category.slice(1);
182 const searchTabElement = `.acf-modal-content .acf-tab-wrap a:contains('${uppercaseCategory}')`;
183 setTimeout(() => {
184 $(searchTabElement).click();
185 }, 0);
186 },
187 initializeFieldLabel: function () {
188 const fieldObject = this.get('openedBy');
189 const labelText = fieldObject.$fieldLabel().val();
190 const $fieldLabel = this.$el.find('.acf-insert-field-label');
191 if (labelText) {
192 $fieldLabel.val(labelText);
193 } else {
194 $fieldLabel.val('');
195 }
196 },
197 updateFieldObjectFieldLabel: function () {
198 const label = this.$el.find('.acf-insert-field-label').val();
199 const fieldObject = this.get('openedBy');
200 fieldObject.$fieldLabel().val(label);
201 fieldObject.$fieldLabel().trigger('blur');
202 },
203 onChangeFieldType: function () {
204 const fieldType = this.get('currentFieldType');
205 this.$el.find('.selected').removeClass('selected');
206 this.$el.find('.acf-field-type[data-field-type="' + fieldType + '"]').addClass('selected');
207 this.renderFieldTypeDesc(fieldType);
208 },
209 onSearchFieldTypes: function (e) {
210 const $modal = this.$el.find('.acf-browse-fields-modal');
211 const inputVal = this.$el.find('.acf-search-field-types').val();
212 const self = this;
213 let searchString,
214 resultsHtml = '';
215 let matches = [];
216 if ('string' === typeof inputVal) {
217 searchString = inputVal.trim();
218 matches = this.getFieldTypes(false, searchString);
219 }
220 if (searchString.length && matches.length) {
221 $modal.addClass('is-searching');
222 } else {
223 $modal.removeClass('is-searching');
224 }
225 if (!matches.length) {
226 $modal.addClass('no-results-found');
227 this.$el.find('.acf-invalid-search-term').text(searchString);
228 return;
229 } else {
230 $modal.removeClass('no-results-found');
231 }
232 matches.forEach(fieldType => {
233 resultsHtml = resultsHtml + self.getFieldTypeHTML(fieldType);
234 });
235 $('.acf-field-type-search-results').html(resultsHtml);
236 this.set('currentFieldType', matches[0].name);
237 this.onChangeFieldType();
238 },
239 onClickBrowsePopular: function () {
240 this.$el.find('.acf-search-field-types').val('').trigger('input');
241 this.$el.find('.acf-tab-wrap a').first().trigger('click');
242 },
243 onClickSelectField: function (e) {
244 const fieldObject = this.get('openedBy');
245 fieldObject.$fieldTypeSelect().val(this.get('currentFieldType'));
246 fieldObject.$fieldTypeSelect().trigger('change');
247 this.updateFieldObjectFieldLabel();
248 this.close();
249 },
250 onClickFieldType: function (e) {
251 const $fieldType = $(e.currentTarget);
252 this.set('currentFieldType', $fieldType.data('field-type'));
253 },
254 onClickClose: function () {
255 this.close();
256 },
257 onPressEscapeClose: function (e) {
258 if (e.key === 'Escape') {
259 this.close();
260 }
261 },
262 close: function () {
263 this.lockFocusToModal(false);
264 this.returnFocusToOrigin();
265 this.remove();
266 },
267 focus: function () {
268 this.$el.find('button').first().trigger('focus');
269 }
270 };
271 acf.models.browseFieldsModal = acf.models.Modal.extend(browseFieldsModal);
272 acf.newBrowseFieldsModal = props => new acf.models.browseFieldsModal(props);
273 })(window.jQuery, undefined, window.acf);
274
275 /***/ }),
276
277 /***/ "./assets/src/js/_field-group-compatibility.js":
278 /*!*****************************************************!*\
279 !*** ./assets/src/js/_field-group-compatibility.js ***!
280 \*****************************************************/
281 /***/ (() => {
282
283 (function ($, undefined) {
284 var _acf = acf.getCompatibility(acf);
285
286 /**
287 * fieldGroupCompatibility
288 *
289 * Compatibility layer for extinct acf.field_group
290 *
291 * @date 15/12/17
292 * @since ACF 5.7.0
293 *
294 * @param void
295 * @return void
296 */
297
298 _acf.field_group = {
299 save_field: function ($field, type) {
300 type = type !== undefined ? type : 'settings';
301 acf.getFieldObject($field).save(type);
302 },
303 delete_field: function ($field, animate) {
304 animate = animate !== undefined ? animate : true;
305 acf.getFieldObject($field).delete({
306 animate: animate
307 });
308 },
309 update_field_meta: function ($field, name, value) {
310 acf.getFieldObject($field).prop(name, value);
311 },
312 delete_field_meta: function ($field, name) {
313 acf.getFieldObject($field).prop(name, null);
314 }
315 };
316
317 /**
318 * fieldGroupCompatibility.field_object
319 *
320 * Compatibility layer for extinct acf.field_group.field_object
321 *
322 * @date 15/12/17
323 * @since ACF 5.7.0
324 *
325 * @param void
326 * @return void
327 */
328
329 _acf.field_group.field_object = acf.model.extend({
330 // vars
331 type: '',
332 o: {},
333 $field: null,
334 $settings: null,
335 tag: function (tag) {
336 // vars
337 var type = this.type;
338
339 // explode, add 'field' and implode
340 // - open => open_field
341 // - change_type => change_field_type
342 var tags = tag.split('_');
343 tags.splice(1, 0, 'field');
344 tag = tags.join('_');
345
346 // add type
347 if (type) {
348 tag += '/type=' + type;
349 }
350
351 // return
352 return tag;
353 },
354 selector: function () {
355 // vars
356 var selector = '.acf-field-object';
357 var type = this.type;
358
359 // add type
360 if (type) {
361 selector += '-' + type;
362 selector = acf.str_replace('_', '-', selector);
363 }
364
365 // return
366 return selector;
367 },
368 _add_action: function (name, callback) {
369 // vars
370 var model = this;
371
372 // add action
373 acf.add_action(this.tag(name), function ($field) {
374 // focus
375 model.set('$field', $field);
376
377 // callback
378 model[callback].apply(model, arguments);
379 });
380 },
381 _add_filter: function (name, callback) {
382 // vars
383 var model = this;
384
385 // add action
386 acf.add_filter(this.tag(name), function ($field) {
387 // focus
388 model.set('$field', $field);
389
390 // callback
391 model[callback].apply(model, arguments);
392 });
393 },
394 _add_event: function (name, callback) {
395 // vars
396 var model = this;
397 var event = name.substr(0, name.indexOf(' '));
398 var selector = name.substr(name.indexOf(' ') + 1);
399 var context = this.selector();
400
401 // add event
402 $(document).on(event, context + ' ' + selector, function (e) {
403 // append $el to event object
404 e.$el = $(this);
405 e.$field = e.$el.closest('.acf-field-object');
406
407 // focus
408 model.set('$field', e.$field);
409
410 // callback
411 model[callback].apply(model, [e]);
412 });
413 },
414 _set_$field: function () {
415 // vars
416 this.o = this.$field.data();
417
418 // els
419 this.$settings = this.$field.find('> .settings > table > tbody');
420
421 // focus
422 this.focus();
423 },
424 focus: function () {
425 // do nothing
426 },
427 setting: function (name) {
428 return this.$settings.find('> .acf-field-setting-' + name);
429 }
430 });
431
432 /*
433 * field
434 *
435 * This model fires actions and filters for registered fields
436 *
437 * @type function
438 * @date 21/02/2014
439 * @since ACF 3.5.1
440 *
441 * @param n/a
442 * @return n/a
443 */
444
445 var actionManager = new acf.Model({
446 actions: {
447 open_field_object: 'onOpenFieldObject',
448 close_field_object: 'onCloseFieldObject',
449 add_field_object: 'onAddFieldObject',
450 duplicate_field_object: 'onDuplicateFieldObject',
451 delete_field_object: 'onDeleteFieldObject',
452 change_field_object_type: 'onChangeFieldObjectType',
453 change_field_object_label: 'onChangeFieldObjectLabel',
454 change_field_object_name: 'onChangeFieldObjectName',
455 change_field_object_parent: 'onChangeFieldObjectParent',
456 sortstop_field_object: 'onChangeFieldObjectParent'
457 },
458 onOpenFieldObject: function (field) {
459 acf.doAction('open_field', field.$el);
460 acf.doAction('open_field/type=' + field.get('type'), field.$el);
461 acf.doAction('render_field_settings', field.$el);
462 acf.doAction('render_field_settings/type=' + field.get('type'), field.$el);
463 },
464 onCloseFieldObject: function (field) {
465 acf.doAction('close_field', field.$el);
466 acf.doAction('close_field/type=' + field.get('type'), field.$el);
467 },
468 onAddFieldObject: function (field) {
469 acf.doAction('add_field', field.$el);
470 acf.doAction('add_field/type=' + field.get('type'), field.$el);
471 },
472 onDuplicateFieldObject: function (field) {
473 acf.doAction('duplicate_field', field.$el);
474 acf.doAction('duplicate_field/type=' + field.get('type'), field.$el);
475 },
476 onDeleteFieldObject: function (field) {
477 acf.doAction('delete_field', field.$el);
478 acf.doAction('delete_field/type=' + field.get('type'), field.$el);
479 },
480 onChangeFieldObjectType: function (field) {
481 acf.doAction('change_field_type', field.$el);
482 acf.doAction('change_field_type/type=' + field.get('type'), field.$el);
483 acf.doAction('render_field_settings', field.$el);
484 acf.doAction('render_field_settings/type=' + field.get('type'), field.$el);
485 },
486 onChangeFieldObjectLabel: function (field) {
487 acf.doAction('change_field_label', field.$el);
488 acf.doAction('change_field_label/type=' + field.get('type'), field.$el);
489 },
490 onChangeFieldObjectName: function (field) {
491 acf.doAction('change_field_name', field.$el);
492 acf.doAction('change_field_name/type=' + field.get('type'), field.$el);
493 },
494 onChangeFieldObjectParent: function (field) {
495 acf.doAction('update_field_parent', field.$el);
496 }
497 });
498 })(jQuery);
499
500 /***/ }),
501
502 /***/ "./assets/src/js/_field-group-conditions.js":
503 /*!**************************************************!*\
504 !*** ./assets/src/js/_field-group-conditions.js ***!
505 \**************************************************/
506 /***/ (() => {
507
508 (function ($, undefined) {
509 /**
510 * ConditionalLogicFieldSetting
511 *
512 * description
513 *
514 * @date 3/2/18
515 * @since ACF 5.6.5
516 *
517 * @param type $var Description. Default.
518 * @return type Description.
519 */
520
521 var ConditionalLogicFieldSetting = acf.FieldSetting.extend({
522 type: '',
523 name: 'conditional_logic',
524 events: {
525 'change .conditions-toggle': 'onChangeToggle',
526 'click .add-conditional-group': 'onClickAddGroup',
527 'focus .condition-rule-field': 'onFocusField',
528 'change .condition-rule-field': 'onChangeField',
529 'change .condition-rule-operator': 'onChangeOperator',
530 'click .add-conditional-rule': 'onClickAdd',
531 'click .remove-conditional-rule': 'onClickRemove'
532 },
533 $rule: false,
534 scope: function ($rule) {
535 this.$rule = $rule;
536 return this;
537 },
538 ruleData: function (name, value) {
539 return this.$rule.data.apply(this.$rule, arguments);
540 },
541 $input: function (name) {
542 return this.$rule.find('.condition-rule-' + name);
543 },
544 $td: function (name) {
545 return this.$rule.find('td.' + name);
546 },
547 $toggle: function () {
548 return this.$('.conditions-toggle');
549 },
550 $control: function () {
551 return this.$('.rule-groups');
552 },
553 $groups: function () {
554 return this.$('.rule-group');
555 },
556 $rules: function () {
557 return this.$('.rule');
558 },
559 $tabLabel: function () {
560 return this.fieldObject.$el.find('.conditional-logic-badge');
561 },
562 $conditionalValueSelect: function () {
563 return this.$('.condition-rule-value');
564 },
565 open: function () {
566 var $div = this.$control();
567 $div.show();
568 acf.enable($div);
569 },
570 close: function () {
571 var $div = this.$control();
572 $div.hide();
573 acf.disable($div);
574 },
575 render: function () {
576 // show
577 if (this.$toggle().prop('checked')) {
578 this.$tabLabel().addClass('is-enabled');
579 this.renderRules();
580 this.open();
581
582 // hide
583 } else {
584 this.$tabLabel().removeClass('is-enabled');
585 this.close();
586 }
587 },
588 renderRules: function () {
589 // vars
590 var self = this;
591
592 // loop
593 this.$rules().each(function () {
594 self.renderRule($(this));
595 });
596 },
597 renderRule: function ($rule) {
598 this.scope($rule);
599 this.renderField();
600 this.renderOperator();
601 this.renderValue();
602 },
603 renderField: function () {
604 // vars
605 var choices = [];
606 var validFieldTypes = [];
607 var cid = this.fieldObject.cid;
608 var $select = this.$input('field');
609
610 // loop
611 acf.getFieldObjects().map(function (fieldObject) {
612 // vars
613 var choice = {
614 id: fieldObject.getKey(),
615 text: fieldObject.getLabel()
616 };
617
618 // bail early if is self
619 if (fieldObject.cid === cid) {
620 choice.text += ' ' + acf.__('(this field)');
621 choice.disabled = true;
622 }
623
624 // get selected field conditions
625 var conditionTypes = acf.getConditionTypes({
626 fieldType: fieldObject.getType()
627 });
628
629 // bail early if no types
630 if (!conditionTypes.length) {
631 choice.disabled = true;
632 }
633
634 // calculate indents
635 var indents = fieldObject.getParents().length;
636 choice.text = '- '.repeat(indents) + choice.text;
637
638 // append
639 choices.push(choice);
640 });
641
642 // allow for scenario where only one field exists
643 if (!choices.length) {
644 choices.push({
645 id: '',
646 text: acf.__('No toggle fields available')
647 });
648 }
649
650 // render
651 acf.renderSelect($select, choices);
652
653 // set
654 this.ruleData('field', $select.val());
655 },
656 renderOperator: function () {
657 // bail early if no field selected
658 if (!this.ruleData('field')) {
659 return;
660 }
661
662 // vars
663 var $select = this.$input('operator');
664 var val = $select.val();
665 var choices = [];
666
667 // set saved value on first render
668 // - this allows the 2nd render to correctly select an option
669 if ($select.val() === null) {
670 acf.renderSelect($select, [{
671 id: this.ruleData('operator'),
672 text: ''
673 }]);
674 }
675
676 // get selected field
677 var $field = acf.findFieldObject(this.ruleData('field'));
678 var field = acf.getFieldObject($field);
679
680 // get selected field conditions
681 var conditionTypes = acf.getConditionTypes({
682 fieldType: field.getType()
683 });
684
685 // html
686 conditionTypes.map(function (model) {
687 choices.push({
688 id: model.prototype.operator,
689 text: model.prototype.label
690 });
691 });
692
693 // render
694 acf.renderSelect($select, choices);
695
696 // set
697 this.ruleData('operator', $select.val());
698 },
699 renderValue: function () {
700 // bail early if no field selected
701 if (!this.ruleData('field') || !this.ruleData('operator')) {
702 return;
703 }
704 var $select = this.$input('value');
705 var $td = this.$td('value');
706 var currentVal = $select.val();
707 var savedValue = this.$rule[0].getAttribute('data-value');
708
709 // get selected field
710 var $field = acf.findFieldObject(this.ruleData('field'));
711 var field = acf.getFieldObject($field);
712 // get selected field conditions
713 var conditionTypes = acf.getConditionTypes({
714 fieldType: field.getType(),
715 operator: this.ruleData('operator')
716 });
717 var conditionType = conditionTypes[0].prototype;
718 var choices = conditionType.choices(field);
719 let $newSelect;
720 if (choices instanceof jQuery && !!choices.data('acfSelect2Props')) {
721 $newSelect = $select.clone();
722 // If converting from a disabled input, we need to convert it to an active select.
723 if ($newSelect.is('input')) {
724 var classes = $select.attr('class');
725 const $rebuiltSelect = $('<select></select>').addClass(classes).val(savedValue);
726 $newSelect = $rebuiltSelect;
727 }
728 acf.addAction('acf_conditional_value_rendered', function () {
729 acf.newSelect2($newSelect, choices.data('acfSelect2Props'));
730 });
731 } else if (choices instanceof Array) {
732 this.$conditionalValueSelect().removeClass('select2-hidden-accessible');
733 $newSelect = $('<select></select>');
734 acf.renderSelect($newSelect, choices);
735 } else {
736 this.$conditionalValueSelect().removeClass('select2-hidden-accessible');
737 $newSelect = $(choices);
738 }
739
740 // append
741 $select.detach();
742 $td.html($newSelect);
743
744 // timeout needed to avoid browser bug where "disabled" attribute is not applied
745 setTimeout(function () {
746 ['class', 'name', 'id'].map(function (attr) {
747 $newSelect.attr(attr, $select.attr(attr));
748 });
749 $select.val(savedValue);
750 acf.doAction('acf_conditional_value_rendered');
751 }, 0);
752 // select existing value (if not a disabled input)
753 if (!$newSelect.prop('disabled')) {
754 acf.val($newSelect, currentVal, true);
755 }
756
757 // set
758 this.ruleData('value', $newSelect.val());
759 },
760 onChangeToggle: function () {
761 this.render();
762 },
763 onClickAddGroup: function (e, $el) {
764 this.addGroup();
765 },
766 addGroup: function () {
767 // vars
768 var $group = this.$('.rule-group:last');
769
770 // duplicate
771 var $group2 = acf.duplicate($group);
772
773 // update h4
774 $group2.find('h4').text(acf.__('or'));
775
776 // remove all tr's except the first one
777 $group2.find('tr').not(':first').remove();
778
779 // Find the remaining tr and render
780 var $tr = $group2.find('tr');
781 this.renderRule($tr);
782
783 // save field
784 this.fieldObject.save();
785 },
786 onFocusField: function (e, $el) {
787 this.renderField();
788 },
789 onChangeField: function (e, $el) {
790 // scope
791 this.scope($el.closest('.rule'));
792
793 // set data
794 this.ruleData('field', $el.val());
795
796 // render
797 this.renderOperator();
798 this.renderValue();
799 },
800 onChangeOperator: function (e, $el) {
801 // scope
802 this.scope($el.closest('.rule'));
803
804 // set data
805 this.ruleData('operator', $el.val());
806
807 // render
808 this.renderValue();
809 },
810 onClickAdd: function (e, $el) {
811 // duplicate
812 var $rule = acf.duplicate($el.closest('.rule'));
813
814 // render
815 this.renderRule($rule);
816 },
817 onClickRemove: function (e, $el) {
818 // vars
819 var $rule = $el.closest('.rule');
820
821 // save field
822 this.fieldObject.save();
823
824 // remove group
825 if ($rule.siblings('.rule').length == 0) {
826 $rule.closest('.rule-group').remove();
827 }
828
829 // remove
830 $rule.remove();
831 }
832 });
833 acf.registerFieldSetting(ConditionalLogicFieldSetting);
834
835 /**
836 * conditionalLogicHelper
837 *
838 * description
839 *
840 * @date 20/4/18
841 * @since ACF 5.6.9
842 *
843 * @param type $var Description. Default.
844 * @return type Description.
845 */
846
847 var conditionalLogicHelper = new acf.Model({
848 actions: {
849 duplicate_field_objects: 'onDuplicateFieldObjects'
850 },
851 onDuplicateFieldObjects: function (children, newField, prevField) {
852 // vars
853 var data = {};
854 var $selects = $();
855
856 // reference change in key
857 children.map(function (child) {
858 // store reference of changed key
859 data[child.get('prevKey')] = child.get('key');
860
861 // append condition select
862 $selects = $selects.add(child.$('.condition-rule-field'));
863 });
864
865 // loop
866 $selects.each(function () {
867 // vars
868 var $select = $(this);
869 var val = $select.val();
870
871 // bail early if val is not a ref key
872 if (!val || !data[val]) {
873 return;
874 }
875
876 // modify selected option
877 $select.find('option:selected').attr('value', data[val]);
878
879 // set new val
880 $select.val(data[val]);
881 });
882 }
883 });
884 })(jQuery);
885
886 /***/ }),
887
888 /***/ "./assets/src/js/_field-group-field.js":
889 /*!*********************************************!*\
890 !*** ./assets/src/js/_field-group-field.js ***!
891 \*********************************************/
892 /***/ (() => {
893
894 (function ($, undefined) {
895 acf.FieldObject = acf.Model.extend({
896 // class used to avoid nested event triggers
897 eventScope: '.acf-field-object',
898 // variable for field type select2
899 fieldTypeSelect2: false,
900 // events
901 events: {
902 'click .copyable': 'onClickCopy',
903 'click .handle': 'onClickEdit',
904 'click .close-field': 'onClickEdit',
905 'click a[data-key="acf_field_settings_tabs"]': 'onChangeSettingsTab',
906 'click .delete-field': 'onClickDelete',
907 'click .duplicate-field': 'duplicate',
908 'click .move-field': 'move',
909 'click .browse-fields': 'browseFields',
910 'focus .edit-field': 'onFocusEdit',
911 'blur .edit-field, .row-options a': 'onBlurEdit',
912 'change .field-type': 'onChangeType',
913 'change .field-required': 'onChangeRequired',
914 'blur .field-label': 'onChangeLabel',
915 'blur .field-name': 'onChangeName',
916 change: 'onChange',
917 changed: 'onChanged'
918 },
919 // data
920 data: {
921 // Similar to ID, but used for HTML purposes.
922 // It is possible for a new field to have an ID of 0, but an id of 'field_123' */
923 id: 0,
924 // The field key ('field_123')
925 key: '',
926 // The field type (text, image, etc)
927 type: ''
928
929 // The $post->ID of this field
930 //ID: 0,
931
932 // The field's parent
933 //parent: 0,
934
935 // The menu order
936 //menu_order: 0
937 },
938 setup: function ($field) {
939 // set $el
940 this.$el = $field;
941
942 // inherit $field data (id, key, type)
943 this.inherit($field);
944
945 // load additional props
946 // - this won't trigger 'changed'
947 this.prop('ID');
948 this.prop('parent');
949 this.prop('menu_order');
950 },
951 $input: function (name) {
952 return $('#' + this.getInputId() + '-' + name);
953 },
954 $meta: function () {
955 return this.$('.meta:first');
956 },
957 $handle: function () {
958 return this.$('.handle:first');
959 },
960 $settings: function () {
961 return this.$('.settings:first');
962 },
963 $setting: function (name) {
964 return this.$('.acf-field-settings:first .acf-field-setting-' + name);
965 },
966 $fieldTypeSelect: function () {
967 return this.$('.field-type');
968 },
969 $fieldLabel: function () {
970 return this.$('.field-label');
971 },
972 getParent: function () {
973 return acf.getFieldObjects({
974 child: this.$el,
975 limit: 1
976 }).pop();
977 },
978 getParents: function () {
979 return acf.getFieldObjects({
980 child: this.$el
981 });
982 },
983 getFields: function () {
984 return acf.getFieldObjects({
985 parent: this.$el
986 });
987 },
988 getInputName: function () {
989 return 'acf_fields[' + this.get('id') + ']';
990 },
991 getInputId: function () {
992 return 'acf_fields-' + this.get('id');
993 },
994 newInput: function (name, value) {
995 // vars
996 var inputId = this.getInputId();
997 var inputName = this.getInputName();
998
999 // append name
1000 if (name) {
1001 inputId += '-' + name;
1002 inputName += '[' + name + ']';
1003 }
1004
1005 // create input (avoid HTML + JSON value issues)
1006 var $input = $('<input />').attr({
1007 id: inputId,
1008 name: inputName,
1009 value: value
1010 });
1011 this.$('> .meta').append($input);
1012
1013 // return
1014 return $input;
1015 },
1016 getProp: function (name) {
1017 // check data
1018 if (this.has(name)) {
1019 return this.get(name);
1020 }
1021
1022 // get input value
1023 var $input = this.$input(name);
1024 var value = $input.length ? $input.val() : null;
1025
1026 // set data silently (cache)
1027 this.set(name, value, true);
1028
1029 // return
1030 return value;
1031 },
1032 setProp: function (name, value) {
1033 // get input
1034 var $input = this.$input(name);
1035 var prevVal = $input.val();
1036
1037 // create if new
1038 if (!$input.length) {
1039 $input = this.newInput(name, value);
1040 }
1041
1042 // remove
1043 if (value === null) {
1044 $input.remove();
1045
1046 // update
1047 } else {
1048 $input.val(value);
1049 }
1050
1051 //console.log('setProp', name, value, this);
1052
1053 // set data silently (cache)
1054 if (!this.has(name)) {
1055 //console.log('setting silently');
1056 this.set(name, value, true);
1057
1058 // set data allowing 'change' event to fire
1059 } else {
1060 //console.log('setting loudly!');
1061 this.set(name, value);
1062 }
1063
1064 // return
1065 return this;
1066 },
1067 prop: function (name, value) {
1068 if (value !== undefined) {
1069 return this.setProp(name, value);
1070 } else {
1071 return this.getProp(name);
1072 }
1073 },
1074 props: function (props) {
1075 Object.keys(props).map(function (key) {
1076 this.setProp(key, props[key]);
1077 }, this);
1078 },
1079 getLabel: function () {
1080 // get label with empty default
1081 var label = this.prop('label');
1082 if (label === '') {
1083 label = acf.__('(no label)');
1084 }
1085
1086 // return
1087 return label;
1088 },
1089 getName: function () {
1090 return this.prop('name');
1091 },
1092 getType: function () {
1093 return this.prop('type');
1094 },
1095 getTypeLabel: function () {
1096 var type = this.prop('type');
1097 var types = acf.get('fieldTypes');
1098 return types[type] ? types[type].label : type;
1099 },
1100 getKey: function () {
1101 return this.prop('key');
1102 },
1103 initialize: function () {
1104 this.checkCopyable();
1105 },
1106 makeCopyable: function (text) {
1107 if (!navigator.clipboard) return '<span class="copyable copy-unsupported">' + text + '</span>';
1108 return '<span class="copyable">' + text + '</span>';
1109 },
1110 checkCopyable: function () {
1111 if (!navigator.clipboard) {
1112 this.$el.find('.copyable').addClass('copy-unsupported');
1113 }
1114 },
1115 initializeFieldTypeSelect2: function () {
1116 if (this.fieldTypeSelect2) return;
1117
1118 // Support disabling via filter.
1119 if (this.$fieldTypeSelect().hasClass('disable-select2')) return;
1120
1121 // Check for a full modern version of select2, bail loading if not found with a console warning.
1122 try {
1123 $.fn.select2.amd.require('select2/compat/dropdownCss');
1124 } catch (err) {
1125 console.warn('ACF was not able to load the full version of select2 due to a conflicting version provided by another plugin or theme taking precedence. Select2 fields may not work as expected.');
1126 return;
1127 }
1128 this.fieldTypeSelect2 = acf.newSelect2(this.$fieldTypeSelect(), {
1129 field: false,
1130 ajax: false,
1131 multiple: false,
1132 allowNull: false,
1133 suppressFilters: true,
1134 dropdownCssClass: 'field-type-select-results',
1135 templateResult: function (selection) {
1136 if (selection.loading || selection.element && selection.element.nodeName === 'OPTGROUP') {
1137 var $selection = $('<span class="acf-selection"></span>');
1138 $selection.html(acf.strEscape(selection.text));
1139 } else {
1140 var $selection = $('<i class="field-type-icon field-type-icon-' + selection.id.replaceAll('_', '-') + '"></i><span class="acf-selection has-icon">' + acf.strEscape(selection.text) + '</span>');
1141 }
1142 $selection.data('element', selection.element);
1143 return $selection;
1144 },
1145 templateSelection: function (selection) {
1146 var $selection = $('<i class="field-type-icon field-type-icon-' + selection.id.replaceAll('_', '-') + '"></i><span class="acf-selection has-icon">' + acf.strEscape(selection.text) + '</span>');
1147 $selection.data('element', selection.element);
1148 return $selection;
1149 }
1150 });
1151 this.fieldTypeSelect2.on('select2:open', function () {
1152 $('.field-type-select-results input.select2-search__field').attr('placeholder', acf.__('Type to search...'));
1153 });
1154 this.fieldTypeSelect2.on('change', function (e) {
1155 $(e.target).parents('ul:first').find('button.browse-fields').prop('disabled', true);
1156 });
1157
1158 // When typing happens on the li element above the select2.
1159 this.fieldTypeSelect2.$el.parent().on('keydown', '.select2-selection.select2-selection--single', this.onKeyDownSelect);
1160 },
1161 addProFields: function () {
1162 // Don't run if on pro.
1163 if (acf.get('is_pro')) {
1164 return;
1165 }
1166
1167 // Make sure we haven't appended these fields before.
1168 var $fieldTypeSelect = this.$fieldTypeSelect();
1169 if ($fieldTypeSelect.hasClass('acf-free-field-type')) return;
1170
1171 // Loop over each pro field type and append it to the select.
1172 const PROFieldTypes = acf.get('PROFieldTypes');
1173 if (typeof PROFieldTypes !== 'object') return;
1174 const $layoutGroup = $fieldTypeSelect.find('optgroup option[value="group"]').parent();
1175 const $contentGroup = $fieldTypeSelect.find('optgroup option[value="image"]').parent();
1176 for (const [name, field] of Object.entries(PROFieldTypes)) {
1177 const $useGroup = field.category === 'content' ? $contentGroup : $layoutGroup;
1178 const $existing = $useGroup.children('[value="' + name + '"]');
1179 const label = `${acf.strEscape(field.label)} (${acf.strEscape(acf.__('PRO Only'))})`;
1180 if ($existing.length) {
1181 // Already added by pro, update existing option.
1182 $existing.text(label);
1183
1184 // Don't disable if already selected (prevents re-save from overriding field type).
1185 if ($fieldTypeSelect.val() !== name) {
1186 $existing.attr('disabled', 'disabled');
1187 }
1188 } else {
1189 // Append new disabled option.
1190 $useGroup.append(`<option value="null" disabled="disabled">${label}</option>`);
1191 }
1192 }
1193 $fieldTypeSelect.addClass('acf-free-field-type');
1194 },
1195 render: function () {
1196 // vars
1197 var $handle = this.$('.handle:first');
1198 var menu_order = this.prop('menu_order');
1199 var label = acf.strEscape(this.getLabel());
1200 var name = this.prop('name');
1201 var type = this.getTypeLabel();
1202 var key = this.prop('key');
1203 var required = this.$input('required').prop('checked');
1204
1205 // update menu order
1206 $handle.find('.acf-icon').html(parseInt(menu_order) + 1);
1207
1208 // update required
1209 if (required) {
1210 label += ' <span class="acf-required">*</span>';
1211 }
1212
1213 // update label
1214 $handle.find('.li-field-label strong a').html(label);
1215 let shouldConvertToLowercase = name === name.toLowerCase();
1216 shouldConvertToLowercase = acf.applyFilters('convert_field_name_to_lowercase', shouldConvertToLowercase, this);
1217
1218 // update name
1219 $handle.find('.li-field-name').html(this.makeCopyable(acf.strSanitize(name, shouldConvertToLowercase)));
1220
1221 // update type
1222 const iconName = acf.strSlugify(this.getType());
1223 $handle.find('.field-type-label').text(' ' + type);
1224 $handle.find('.field-type-icon').removeClass().addClass('field-type-icon field-type-icon-' + iconName);
1225
1226 // update key
1227 $handle.find('.li-field-key').html(this.makeCopyable(key));
1228
1229 // action for 3rd party customization
1230 acf.doAction('render_field_object', this);
1231 },
1232 refresh: function () {
1233 acf.doAction('refresh_field_object', this);
1234 },
1235 isOpen: function () {
1236 return this.$el.hasClass('open');
1237 },
1238 onClickCopy: function (e) {
1239 e.stopPropagation();
1240 if (!navigator.clipboard || $(e.target).is('input')) return;
1241
1242 // Find the value to copy depending on input or text elements.
1243 let copyValue;
1244 if ($(e.target).hasClass('acf-input-wrap')) {
1245 copyValue = $(e.target).find('input').first().val();
1246 } else {
1247 copyValue = $(e.target).text().trim();
1248 }
1249 navigator.clipboard.writeText(copyValue).then(() => {
1250 $(e.target).closest('.copyable').addClass('copied');
1251 setTimeout(function () {
1252 $(e.target).closest('.copyable').removeClass('copied');
1253 }, 2000);
1254 });
1255 },
1256 onClickEdit: function (e) {
1257 const $target = $(e.target);
1258 if ($target.parent().hasClass('row-options') && !$target.hasClass('edit-field')) {
1259 return;
1260 }
1261 this.isOpen() ? this.close() : this.open();
1262 },
1263 onChangeSettingsTab: function () {
1264 const $settings = this.$el.children('.settings');
1265 acf.doAction('show', $settings);
1266 },
1267 /**
1268 * Adds 'active' class to row options nearest to the target.
1269 */
1270 onFocusEdit: function (e) {
1271 var $rowOptions = $(e.target).closest('li').find('.row-options');
1272 $rowOptions.addClass('active');
1273 },
1274 /**
1275 * Removes 'active' class from row options if links in same row options area are no longer in focus.
1276 */
1277 onBlurEdit: function (e) {
1278 var focusDelayMilliseconds = 50;
1279 var $rowOptionsBlurElement = $(e.target).closest('li').find('.row-options');
1280
1281 // Timeout so that `activeElement` gives the new element in focus instead of the body.
1282 setTimeout(function () {
1283 var $rowOptionsFocusElement = $(document.activeElement).closest('li').find('.row-options');
1284 if (!$rowOptionsBlurElement.is($rowOptionsFocusElement)) {
1285 $rowOptionsBlurElement.removeClass('active');
1286 }
1287 }, focusDelayMilliseconds);
1288 },
1289 open: function () {
1290 // vars
1291 var $settings = this.$el.children('.settings');
1292
1293 // initialise field type select
1294 this.addProFields();
1295 this.initializeFieldTypeSelect2();
1296
1297 // action (open)
1298 acf.doAction('open_field_object', this);
1299 this.trigger('openFieldObject');
1300
1301 // action (show)
1302 acf.doAction('show', $settings);
1303 this.hideEmptyTabs();
1304
1305 // open
1306 $settings.slideDown();
1307 this.$el.addClass('open');
1308 },
1309 onKeyDownSelect: function (e) {
1310 // Omit events from special keys.
1311 if (!(e.which >= 186 && e.which <= 222 ||
1312 // punctuation and special characters
1313 [8, 9, 13, 16, 17, 18, 19, 20, 27, 32, 33, 34, 35, 36, 37, 38, 39, 40, 45, 46, 91, 92, 93, 144, 145].includes(e.which) ||
1314 // Special keys
1315 e.which >= 112 && e.which <= 123)) {
1316 // Function keys
1317 $(this).closest('.select2-container').siblings('select:enabled').select2('open');
1318 return;
1319 }
1320 },
1321 close: function () {
1322 // vars
1323 var $settings = this.$el.children('.settings');
1324
1325 // close
1326 $settings.slideUp();
1327 this.$el.removeClass('open');
1328
1329 // action (close)
1330 acf.doAction('close_field_object', this);
1331 this.trigger('closeFieldObject');
1332
1333 // action (hide)
1334 acf.doAction('hide', $settings);
1335 },
1336 serialize: function () {
1337 return acf.serialize(this.$el, this.getInputName());
1338 },
1339 save: function (type) {
1340 // defaults
1341 type = type || 'settings'; // meta, settings
1342
1343 // vars
1344 var save = this.getProp('save');
1345
1346 // bail if already saving settings
1347 if (save === 'settings') {
1348 return;
1349 }
1350
1351 // prop
1352 this.setProp('save', type);
1353
1354 // debug
1355 this.$el.attr('data-save', type);
1356
1357 // action
1358 acf.doAction('save_field_object', this, type);
1359 },
1360 submit: function () {
1361 // vars
1362 var inputName = this.getInputName();
1363 var save = this.get('save');
1364
1365 // close
1366 if (this.isOpen()) {
1367 this.close();
1368 }
1369
1370 // allow all inputs to save
1371 if (save == 'settings') {
1372 // do nothing
1373 // allow only meta inputs to save
1374 } else if (save == 'meta') {
1375 this.$('> .settings [name^="' + inputName + '"]').remove();
1376
1377 // prevent all inputs from saving
1378 } else {
1379 this.$('[name^="' + inputName + '"]').remove();
1380 }
1381
1382 // action
1383 acf.doAction('submit_field_object', this);
1384 },
1385 onChange: function (e, $el) {
1386 // save settings
1387 this.save();
1388
1389 // action for 3rd party customization
1390 acf.doAction('change_field_object', this);
1391 },
1392 onChanged: function (e, $el, name, value) {
1393 if (this.getType() === $el.attr('data-type')) {
1394 $('button.acf-btn.browse-fields').prop('disabled', false);
1395 }
1396
1397 // ignore 'save'
1398 if (name == 'save') {
1399 return;
1400 }
1401
1402 // save meta
1403 if (['menu_order', 'parent'].indexOf(name) > -1) {
1404 this.save('meta');
1405
1406 // save field
1407 } else {
1408 this.save();
1409 }
1410
1411 // render
1412 if (['menu_order', 'label', 'required', 'name', 'type', 'key'].indexOf(name) > -1) {
1413 this.render();
1414 }
1415
1416 // action for 3rd party customization
1417 acf.doAction('change_field_object_' + name, this, value);
1418 },
1419 onChangeLabel: function (e, $el) {
1420 // set
1421 const label = $el.val();
1422 const safeLabel = acf.strEscape(label);
1423 this.set('label', safeLabel);
1424
1425 // render name
1426 if (this.prop('name') == '') {
1427 var name = acf.applyFilters('generate_field_object_name', acf.strSanitize(label), this);
1428 this.prop('name', name);
1429 }
1430 },
1431 onChangeName: function (e, $el) {
1432 const id = this.get('id');
1433 let forceSanitize = false;
1434 // If id is not a number or is zero, force sanitize
1435 if (typeof id !== 'number' || id === 0) {
1436 forceSanitize = true;
1437 }
1438
1439 // Get the input's value attribute
1440 const valueAttr = $el.val();
1441
1442 // If value is a lowercase string, force sanitize
1443 if (typeof valueAttr === 'string' && valueAttr === valueAttr.toLowerCase()) {
1444 forceSanitize = true;
1445 }
1446 forceSanitize = acf.applyFilters('convert_field_name_to_lowercase', forceSanitize, this);
1447
1448 // Sanitize the input value (force if needed)
1449 const sanitized = acf.strSanitize($el.val(), forceSanitize);
1450
1451 // Set the sanitized value back to the input
1452 $el.val(sanitized);
1453
1454 // Update the field's name property
1455 this.set('name', sanitized);
1456
1457 // Warn if the name starts with "field_"
1458 if (sanitized.startsWith('field_')) {
1459 alert(acf.__('The string "field_" may not be used at the start of a field name'));
1460 }
1461 },
1462 onChangeRequired: function (e, $el) {
1463 // set
1464 var required = $el.prop('checked') ? 1 : 0;
1465 this.set('required', required);
1466 },
1467 delete: function (args) {
1468 // defaults
1469 args = acf.parseArgs(args, {
1470 animate: true
1471 });
1472
1473 // add to remove list
1474 var id = this.prop('ID');
1475 if (id) {
1476 var $input = $('#_acf_delete_fields');
1477 var newVal = $input.val() + '|' + id;
1478 $input.val(newVal);
1479 }
1480
1481 // action
1482 acf.doAction('delete_field_object', this);
1483
1484 // animate
1485 if (args.animate) {
1486 this.removeAnimate();
1487 } else {
1488 this.remove();
1489 }
1490 },
1491 onClickDelete: function (e, $el) {
1492 // Bypass confirmation when holding down "shift" key.
1493 if (e.shiftKey) {
1494 return this.delete();
1495 }
1496
1497 // add class
1498 this.$el.addClass('-hover');
1499
1500 // add tooltip
1501 var tooltip = acf.newTooltip({
1502 confirmRemove: true,
1503 target: $el,
1504 context: this,
1505 confirm: function () {
1506 this.delete();
1507 },
1508 cancel: function () {
1509 this.$el.removeClass('-hover');
1510 }
1511 });
1512 },
1513 removeAnimate: function () {
1514 // vars
1515 var field = this;
1516 var $list = this.$el.parent();
1517 var $fields = acf.findFieldObjects({
1518 sibling: this.$el
1519 });
1520
1521 // remove
1522 acf.remove({
1523 target: this.$el,
1524 endHeight: $fields.length ? 0 : 50,
1525 complete: function () {
1526 field.remove();
1527 acf.doAction('removed_field_object', field, $list);
1528 }
1529 });
1530
1531 // action
1532 acf.doAction('remove_field_object', field, $list);
1533 },
1534 duplicate: function () {
1535 // vars
1536 var newKey = acf.uniqid('field_');
1537
1538 // duplicate
1539 var $newField = acf.duplicate({
1540 target: this.$el,
1541 search: this.get('id'),
1542 replace: newKey
1543 });
1544
1545 // set new key
1546 $newField.attr('data-key', newKey);
1547
1548 // get instance
1549 var newField = acf.getFieldObject($newField);
1550
1551 // update newField label / name
1552 var label = newField.prop('label');
1553 var name = newField.prop('name');
1554 var end = name.split('_').pop();
1555 var copy = acf.__('copy');
1556
1557 // increase suffix "1"
1558 if (acf.isNumeric(end)) {
1559 var i = end * 1 + 1;
1560 label = label.replace(end, i);
1561 name = name.replace(end, i);
1562
1563 // increase suffix "(copy1)"
1564 } else if (end.indexOf(copy) === 0) {
1565 var i = end.replace(copy, '') * 1;
1566 i = i ? i + 1 : 2;
1567
1568 // replace
1569 label = label.replace(end, copy + i);
1570 name = name.replace(end, copy + i);
1571
1572 // add default "(copy)"
1573 } else {
1574 label += ' (' + copy + ')';
1575 name += '_' + copy;
1576 }
1577 newField.prop('ID', 0);
1578 newField.prop('label', label);
1579 newField.prop('name', name);
1580 newField.prop('key', newKey);
1581
1582 // close the current field if it's open.
1583 if (this.isOpen()) {
1584 this.close();
1585 }
1586
1587 // open the new field and initialise correctly.
1588 newField.open();
1589
1590 // focus label
1591 var $label = newField.$setting('label input');
1592 setTimeout(function () {
1593 $label.trigger('focus');
1594 }, 251);
1595
1596 // action
1597 acf.doAction('duplicate_field_object', this, newField);
1598 acf.doAction('append_field_object', newField);
1599 },
1600 wipe: function () {
1601 // vars
1602 var prevId = this.get('id');
1603 var prevKey = this.get('key');
1604 var newKey = acf.uniqid('field_');
1605
1606 // rename
1607 acf.rename({
1608 target: this.$el,
1609 search: prevId,
1610 replace: newKey
1611 });
1612
1613 // data
1614 this.set('id', newKey);
1615 this.set('prevId', prevId);
1616 this.set('prevKey', prevKey);
1617
1618 // props
1619 this.prop('key', newKey);
1620 this.prop('ID', 0);
1621
1622 // attr
1623 this.$el.attr('data-key', newKey);
1624 this.$el.attr('data-id', newKey);
1625
1626 // action
1627 acf.doAction('wipe_field_object', this);
1628 },
1629 move: function () {
1630 // helper
1631 var hasChanged = function (field) {
1632 return field.get('save') == 'settings';
1633 };
1634
1635 // vars
1636 var changed = hasChanged(this);
1637
1638 // has sub fields changed
1639 if (!changed) {
1640 acf.getFieldObjects({
1641 parent: this.$el
1642 }).map(function (field) {
1643 changed = hasChanged(field) || field.changed;
1644 });
1645 }
1646
1647 // bail early if changed
1648 if (changed) {
1649 alert(acf.__('This field cannot be moved until its changes have been saved'));
1650 return;
1651 }
1652
1653 // step 1.
1654 var id = this.prop('ID');
1655 var field = this;
1656 var popup = false;
1657 var step1 = function () {
1658 // popup
1659 popup = acf.newPopup({
1660 title: acf.__('Move Custom Field'),
1661 loading: true,
1662 width: '300px',
1663 openedBy: field.$el.find('.move-field')
1664 });
1665
1666 // ajax
1667 var ajaxData = {
1668 action: 'acf/field_group/move_field',
1669 field_id: id
1670 };
1671
1672 // get HTML
1673 $.ajax({
1674 url: acf.get('ajaxurl'),
1675 data: acf.prepareForAjax(ajaxData),
1676 type: 'post',
1677 dataType: 'html',
1678 success: step2
1679 });
1680 };
1681 var step2 = function (html) {
1682 // update popup
1683 popup.loading(false);
1684 popup.content(html);
1685
1686 // submit form
1687 popup.on('submit', 'form', step3);
1688 };
1689 var step3 = function (e, $el) {
1690 // prevent
1691 e.preventDefault();
1692
1693 // disable
1694 acf.startButtonLoading(popup.$('.button'));
1695
1696 // ajax
1697 var ajaxData = {
1698 action: 'acf/field_group/move_field',
1699 field_id: id,
1700 field_group_id: popup.$('select').val()
1701 };
1702
1703 // get HTML
1704 $.ajax({
1705 url: acf.get('ajaxurl'),
1706 data: acf.prepareForAjax(ajaxData),
1707 type: 'post',
1708 dataType: 'html',
1709 success: step4
1710 });
1711 };
1712 var step4 = function (html) {
1713 popup.content(html);
1714 if (wp.a11y && wp.a11y.speak && acf.__) {
1715 wp.a11y.speak(acf.__('Field moved to other group'), 'polite');
1716 }
1717 popup.$('.acf-close-popup').trigger('focus');
1718 field.removeAnimate();
1719 };
1720
1721 // start
1722 step1();
1723 },
1724 browseFields: function (e, $el) {
1725 e.preventDefault();
1726 const modal = acf.newBrowseFieldsModal({
1727 openedBy: this
1728 });
1729 },
1730 onChangeType: function (e, $el) {
1731 // clea previous timout
1732 if (this.changeTimeout) {
1733 clearTimeout(this.changeTimeout);
1734 }
1735
1736 // set new timeout
1737 // - prevents changing type multiple times whilst user types in newType
1738 this.changeTimeout = this.setTimeout(function () {
1739 this.changeType($el.val());
1740 }, 300);
1741 },
1742 changeType: function (newType) {
1743 var prevType = this.prop('type');
1744 var prevClass = acf.strSlugify('acf-field-object-' + prevType);
1745 var newClass = acf.strSlugify('acf-field-object-' + newType);
1746
1747 // Update props.
1748 this.$el.removeClass(prevClass).addClass(newClass);
1749 this.$el.attr('data-type', newType);
1750 this.$el.data('type', newType);
1751
1752 // Abort XHR if this field is already loading AJAX data.
1753 if (this.has('xhr')) {
1754 this.get('xhr').abort();
1755 }
1756
1757 // Store old settings so they can be reused later.
1758 const $oldSettings = {};
1759 this.$el.find('.acf-field-settings:first > .acf-field-settings-main > .acf-field-type-settings').each(function () {
1760 let tab = $(this).data('parent-tab');
1761 let $tabSettings = $(this).children().removeData();
1762 $oldSettings[tab] = $tabSettings;
1763 $tabSettings.detach();
1764 });
1765 this.set('settings-' + prevType, $oldSettings);
1766
1767 // Show the settings if we already have them cached.
1768 if (this.has('settings-' + newType)) {
1769 let $newSettings = this.get('settings-' + newType);
1770 this.showFieldTypeSettings($newSettings);
1771 this.set('type', newType);
1772 return;
1773 }
1774
1775 // Add loading spinner.
1776 const $loading = $('<div class="acf-field"><div class="acf-input"><div class="acf-loading"></div></div></div>');
1777 this.$el.find('.acf-field-settings-main-general .acf-field-type-settings').before($loading);
1778 const ajaxData = {
1779 action: 'acf/field_group/render_field_settings',
1780 field: this.serialize(),
1781 prefix: this.getInputName()
1782 };
1783
1784 // Get the settings for this field type over AJAX.
1785 var xhr = $.ajax({
1786 url: acf.get('ajaxurl'),
1787 data: acf.prepareForAjax(ajaxData),
1788 type: 'post',
1789 dataType: 'json',
1790 context: this,
1791 success: function (response) {
1792 if (!acf.isAjaxSuccess(response)) {
1793 return;
1794 }
1795 this.showFieldTypeSettings(response.data);
1796 },
1797 complete: function () {
1798 // also triggered by xhr.abort();
1799 $loading.remove();
1800 this.set('type', newType);
1801 //this.refresh();
1802 }
1803 });
1804
1805 // set
1806 this.set('xhr', xhr);
1807 },
1808 showFieldTypeSettings: function (settings) {
1809 if ('object' !== typeof settings) {
1810 return;
1811 }
1812 const self = this;
1813 const tabs = Object.keys(settings);
1814 tabs.forEach(tab => {
1815 const $tab = self.$el.find('.acf-field-settings-main-' + tab.replace('_', '-') + ' .acf-field-type-settings');
1816 let tabContent = '';
1817 if (['object', 'string'].includes(typeof settings[tab])) {
1818 tabContent = settings[tab];
1819 }
1820 $tab.prepend(tabContent);
1821 acf.doAction('append', $tab);
1822 });
1823 this.hideEmptyTabs();
1824 },
1825 updateParent: function () {
1826 // vars
1827 var ID = acf.get('post_id');
1828
1829 // check parent
1830 var parent = this.getParent();
1831 if (parent) {
1832 ID = parseInt(parent.prop('ID')) || parent.prop('key');
1833 }
1834
1835 // update
1836 this.prop('parent', ID);
1837 },
1838 hideEmptyTabs: function () {
1839 const $settings = this.$settings();
1840 const $tabs = $settings.find('.acf-field-settings:first > .acf-field-settings-main');
1841 $tabs.each(function () {
1842 const $tabContent = $(this);
1843 const tabName = $tabContent.find('.acf-field-type-settings:first').data('parentTab');
1844 const $tabLink = $settings.find('.acf-settings-type-' + tabName).first();
1845 if ($.trim($tabContent.text()) === '') {
1846 $tabLink.hide();
1847 } else if ($tabLink.is(':hidden')) {
1848 $tabLink.show();
1849 }
1850 });
1851 }
1852 });
1853 })(jQuery);
1854
1855 /***/ }),
1856
1857 /***/ "./assets/src/js/_field-group-fields.js":
1858 /*!**********************************************!*\
1859 !*** ./assets/src/js/_field-group-fields.js ***!
1860 \**********************************************/
1861 /***/ (() => {
1862
1863 (function ($, undefined) {
1864 /**
1865 * acf.findFieldObject
1866 *
1867 * Returns a single fieldObject $el for a given field key
1868 *
1869 * @date 1/2/18
1870 * @since ACF 5.7.0
1871 *
1872 * @param string key The field key
1873 * @return jQuery
1874 */
1875
1876 acf.findFieldObject = function (key) {
1877 return acf.findFieldObjects({
1878 key: key,
1879 limit: 1
1880 });
1881 };
1882
1883 /**
1884 * acf.findFieldObjects
1885 *
1886 * Returns an array of fieldObject $el for the given args
1887 *
1888 * @date 1/2/18
1889 * @since ACF 5.7.0
1890 *
1891 * @param object args
1892 * @return jQuery
1893 */
1894
1895 acf.findFieldObjects = function (args) {
1896 // vars
1897 args = args || {};
1898 var selector = '.acf-field-object';
1899 var $fields = false;
1900
1901 // args
1902 args = acf.parseArgs(args, {
1903 id: '',
1904 key: '',
1905 type: '',
1906 limit: false,
1907 list: null,
1908 parent: false,
1909 sibling: false,
1910 child: false
1911 });
1912
1913 // id
1914 if (args.id) {
1915 selector += '[data-id="' + args.id + '"]';
1916 }
1917
1918 // key
1919 if (args.key) {
1920 selector += '[data-key="' + args.key + '"]';
1921 }
1922
1923 // type
1924 if (args.type) {
1925 selector += '[data-type="' + args.type + '"]';
1926 }
1927
1928 // query
1929 if (args.list) {
1930 $fields = args.list.children(selector);
1931 } else if (args.parent) {
1932 $fields = args.parent.find(selector);
1933 } else if (args.sibling) {
1934 $fields = args.sibling.siblings(selector);
1935 } else if (args.child) {
1936 $fields = args.child.parents(selector);
1937 } else {
1938 $fields = $(selector);
1939 }
1940
1941 // limit
1942 if (args.limit) {
1943 $fields = $fields.slice(0, args.limit);
1944 }
1945
1946 // return
1947 return $fields;
1948 };
1949
1950 /**
1951 * acf.getFieldObject
1952 *
1953 * Returns a single fieldObject instance for a given $el|key
1954 *
1955 * @date 1/2/18
1956 * @since ACF 5.7.0
1957 *
1958 * @param string|jQuery $field The field $el or key
1959 * @return jQuery
1960 */
1961
1962 acf.getFieldObject = function ($field) {
1963 // allow key
1964 if (typeof $field === 'string') {
1965 $field = acf.findFieldObject($field);
1966 }
1967
1968 // instantiate
1969 var field = $field.data('acf');
1970 if (!field) {
1971 field = acf.newFieldObject($field);
1972 }
1973
1974 // return
1975 return field;
1976 };
1977
1978 /**
1979 * acf.getFieldObjects
1980 *
1981 * Returns an array of fieldObject instances for the given args
1982 *
1983 * @date 1/2/18
1984 * @since ACF 5.7.0
1985 *
1986 * @param object args
1987 * @return array
1988 */
1989
1990 acf.getFieldObjects = function (args) {
1991 // query
1992 var $fields = acf.findFieldObjects(args);
1993
1994 // loop
1995 var fields = [];
1996 $fields.each(function () {
1997 var field = acf.getFieldObject($(this));
1998 fields.push(field);
1999 });
2000
2001 // return
2002 return fields;
2003 };
2004
2005 /**
2006 * acf.newFieldObject
2007 *
2008 * Initializes and returns a new FieldObject instance
2009 *
2010 * @date 1/2/18
2011 * @since ACF 5.7.0
2012 *
2013 * @param jQuery $field The field $el
2014 * @return object
2015 */
2016
2017 acf.newFieldObject = function ($field) {
2018 // instantiate
2019 var field = new acf.FieldObject($field);
2020
2021 // action
2022 acf.doAction('new_field_object', field);
2023
2024 // return
2025 return field;
2026 };
2027
2028 /**
2029 * actionManager
2030 *
2031 * description
2032 *
2033 * @date 15/12/17
2034 * @since ACF 5.6.5
2035 *
2036 * @param type $var Description. Default.
2037 * @return type Description.
2038 */
2039
2040 var eventManager = new acf.Model({
2041 priority: 5,
2042 initialize: function () {
2043 // actions
2044 var actions = ['prepare', 'ready', 'append', 'remove'];
2045
2046 // loop
2047 actions.map(function (action) {
2048 this.addFieldActions(action);
2049 }, this);
2050 },
2051 addFieldActions: function (action) {
2052 // vars
2053 var pluralAction = action + '_field_objects'; // ready_field_objects
2054 var singleAction = action + '_field_object'; // ready_field_object
2055 var singleEvent = action + 'FieldObject'; // readyFieldObject
2056
2057 // global action
2058 var callback = function ($el /*, arg1, arg2, etc*/) {
2059 // vars
2060 var fieldObjects = acf.getFieldObjects({
2061 parent: $el
2062 });
2063
2064 // call plural
2065 if (fieldObjects.length) {
2066 /// get args [$el, arg1]
2067 var args = acf.arrayArgs(arguments);
2068
2069 // modify args [pluralAction, fields, arg1]
2070 args.splice(0, 1, pluralAction, fieldObjects);
2071 acf.doAction.apply(null, args);
2072 }
2073 };
2074
2075 // plural action
2076 var pluralCallback = function (fieldObjects /*, arg1, arg2, etc*/) {
2077 /// get args [fields, arg1]
2078 var args = acf.arrayArgs(arguments);
2079
2080 // modify args [singleAction, fields, arg1]
2081 args.unshift(singleAction);
2082
2083 // loop
2084 fieldObjects.map(function (fieldObject) {
2085 // modify args [singleAction, field, arg1]
2086 args[1] = fieldObject;
2087 acf.doAction.apply(null, args);
2088 });
2089 };
2090
2091 // single action
2092 var singleCallback = function (fieldObject /*, arg1, arg2, etc*/) {
2093 /// get args [$field, arg1]
2094 var args = acf.arrayArgs(arguments);
2095
2096 // modify args [singleAction, $field, arg1]
2097 args.unshift(singleAction);
2098
2099 // action variations (ready_field/type=image)
2100 var variations = ['type', 'name', 'key'];
2101 variations.map(function (variation) {
2102 args[0] = singleAction + '/' + variation + '=' + fieldObject.get(variation);
2103 acf.doAction.apply(null, args);
2104 });
2105
2106 // modify args [arg1]
2107 args.splice(0, 2);
2108
2109 // event
2110 fieldObject.trigger(singleEvent, args);
2111 };
2112
2113 // add actions
2114 acf.addAction(action, callback, 5);
2115 acf.addAction(pluralAction, pluralCallback, 5);
2116 acf.addAction(singleAction, singleCallback, 5);
2117 }
2118 });
2119
2120 /**
2121 * fieldManager
2122 *
2123 * description
2124 *
2125 * @date 4/1/18
2126 * @since ACF 5.6.5
2127 *
2128 * @param type $var Description. Default.
2129 * @return type Description.
2130 */
2131
2132 var fieldManager = new acf.Model({
2133 id: 'fieldManager',
2134 events: {
2135 'submit #post': 'onSubmit',
2136 'mouseenter .acf-field-list': 'onHoverSortable',
2137 'click .add-field': 'onClickAdd'
2138 },
2139 actions: {
2140 removed_field_object: 'onRemovedField',
2141 sortstop_field_object: 'onReorderField',
2142 delete_field_object: 'onDeleteField',
2143 change_field_object_type: 'onChangeFieldType',
2144 duplicate_field_object: 'onDuplicateField'
2145 },
2146 onSubmit: function (e, $el) {
2147 // vars
2148 var fields = acf.getFieldObjects();
2149
2150 // loop
2151 fields.map(function (field) {
2152 field.submit();
2153 });
2154 },
2155 setFieldMenuOrder: function (field) {
2156 this.renderFields(field.$el.parent());
2157 },
2158 onHoverSortable: function (e, $el) {
2159 // bail early if already sortable
2160 if ($el.hasClass('ui-sortable')) return;
2161
2162 // sortable
2163 $el.sortable({
2164 helper: function (event, element) {
2165 // https://core.trac.wordpress.org/ticket/16972#comment:22
2166 return element.clone().find(':input').attr('name', function (i, currentName) {
2167 return 'sort_' + parseInt(Math.random() * 100000, 10).toString() + '_' + currentName;
2168 }).end();
2169 },
2170 handle: '.acf-sortable-handle',
2171 zIndex: 9999,
2172 connectWith: '.acf-field-list',
2173 start: function (e, ui) {
2174 var field = acf.getFieldObject(ui.item);
2175 ui.placeholder.height(ui.item.height());
2176 acf.doAction('sortstart_field_object', field, $el);
2177 },
2178 update: function (e, ui) {
2179 var field = acf.getFieldObject(ui.item);
2180 acf.doAction('sortstop_field_object', field, $el);
2181 }
2182 });
2183 },
2184 onRemovedField: function (field, $list) {
2185 this.renderFields($list);
2186 },
2187 onReorderField: function (field, $list) {
2188 field.updateParent();
2189 this.renderFields($list);
2190 },
2191 onDeleteField: function (field) {
2192 // delete children
2193 field.getFields().map(function (child) {
2194 child.delete({
2195 animate: false
2196 });
2197 });
2198 },
2199 onChangeFieldType: function (field) {
2200 // enable browse field modal button
2201 field.$el.find('button.browse-fields').prop('disabled', false);
2202 },
2203 onDuplicateField: function (field, newField) {
2204 // check for children
2205 var children = newField.getFields();
2206 if (children.length) {
2207 // loop
2208 children.map(function (child) {
2209 // wipe field
2210 child.wipe();
2211
2212 // if the child is open, re-fire the open method to ensure it's initialised correctly.
2213 if (child.isOpen()) {
2214 child.open();
2215 }
2216
2217 // update parent
2218 child.updateParent();
2219 });
2220
2221 // action
2222 acf.doAction('duplicate_field_objects', children, newField, field);
2223 }
2224
2225 // set menu order
2226 this.setFieldMenuOrder(newField);
2227 },
2228 renderFields: function ($list) {
2229 // vars
2230 var fields = acf.getFieldObjects({
2231 list: $list
2232 });
2233
2234 // no fields
2235 if (!fields.length) {
2236 $list.addClass('-empty');
2237 $list.parents('.acf-field-list-wrap').first().addClass('-empty');
2238 return;
2239 }
2240
2241 // has fields
2242 $list.removeClass('-empty');
2243 $list.parents('.acf-field-list-wrap').first().removeClass('-empty');
2244
2245 // prop
2246 fields.map(function (field, i) {
2247 field.prop('menu_order', i);
2248 });
2249 },
2250 onClickAdd: function (e, $el) {
2251 let $list;
2252 if ($el.hasClass('add-first-field')) {
2253 $list = $el.parents('.acf-field-list').eq(0);
2254 } else if ($el.parent().hasClass('acf-headerbar-actions') || $el.parent().hasClass('no-fields-message-inner')) {
2255 $list = $('.acf-field-list:first');
2256 } else if ($el.parent().hasClass('acf-sub-field-list-header')) {
2257 $list = $el.parents('.acf-input:first').find('.acf-field-list:first');
2258 } else {
2259 $list = $el.closest('.acf-tfoot').siblings('.acf-field-list');
2260 }
2261 this.addField($list);
2262 },
2263 addField: function ($list) {
2264 // vars
2265 var html = $('#tmpl-acf-field').html();
2266 var $el = $(html);
2267 var prevId = $el.data('id');
2268 var newKey = acf.uniqid('field_');
2269
2270 // duplicate
2271 var $newField = acf.duplicate({
2272 target: $el,
2273 search: prevId,
2274 replace: newKey,
2275 append: function ($el, $el2) {
2276 $list.append($el2);
2277 }
2278 });
2279
2280 // get instance
2281 var newField = acf.getFieldObject($newField);
2282
2283 // props
2284 newField.prop('key', newKey);
2285 newField.prop('ID', 0);
2286 newField.prop('label', '');
2287 newField.prop('name', '');
2288
2289 // attr
2290 $newField.attr('data-key', newKey);
2291 $newField.attr('data-id', newKey);
2292
2293 // update parent prop
2294 newField.updateParent();
2295
2296 // focus type
2297 var $type = newField.$input('type');
2298 setTimeout(function () {
2299 if ($list.hasClass('acf-auto-add-field')) {
2300 $list.removeClass('acf-auto-add-field');
2301 } else {
2302 $type.trigger('focus');
2303 }
2304 }, 251);
2305
2306 // open
2307 newField.open();
2308
2309 // set menu order
2310 this.renderFields($list);
2311
2312 // action
2313 acf.doAction('add_field_object', newField);
2314 acf.doAction('append_field_object', newField);
2315 }
2316 });
2317 })(jQuery);
2318
2319 /***/ }),
2320
2321 /***/ "./assets/src/js/_field-group-locations.js":
2322 /*!*************************************************!*\
2323 !*** ./assets/src/js/_field-group-locations.js ***!
2324 \*************************************************/
2325 /***/ (() => {
2326
2327 (function ($, undefined) {
2328 /**
2329 * locationManager
2330 *
2331 * Field group location rules functionality
2332 *
2333 * @date 15/12/17
2334 * @since ACF 5.7.0
2335 *
2336 * @param void
2337 * @return void
2338 */
2339
2340 var locationManager = new acf.Model({
2341 id: 'locationManager',
2342 wait: 'ready',
2343 events: {
2344 'click .add-location-rule': 'onClickAddRule',
2345 'click .add-location-group': 'onClickAddGroup',
2346 'click .remove-location-rule': 'onClickRemoveRule',
2347 'change .refresh-location-rule': 'onChangeRemoveRule'
2348 },
2349 initialize: function () {
2350 this.$el = $('#acf-field-group-options');
2351 this.updateGroupsClass();
2352 },
2353 onClickAddRule: function (e, $el) {
2354 this.addRule($el.closest('tr'));
2355 },
2356 onClickRemoveRule: function (e, $el) {
2357 this.removeRule($el.closest('tr'));
2358 },
2359 onChangeRemoveRule: function (e, $el) {
2360 this.changeRule($el.closest('tr'));
2361 },
2362 onClickAddGroup: function (e, $el) {
2363 this.addGroup();
2364 },
2365 addRule: function ($tr) {
2366 acf.duplicate($tr);
2367 this.updateGroupsClass();
2368 },
2369 removeRule: function ($tr) {
2370 if ($tr.siblings('tr').length == 0) {
2371 $tr.closest('.rule-group').remove();
2372 } else {
2373 $tr.remove();
2374 }
2375
2376 // Update h4
2377 var $group = this.$('.rule-group:first');
2378 $group.find('h4').text(acf.__('Show this field group if'));
2379 this.updateGroupsClass();
2380 },
2381 changeRule: function ($rule) {
2382 // vars
2383 var $group = $rule.closest('.rule-group');
2384 var prefix = $rule.find('td.param select').attr('name').replace('[param]', '');
2385
2386 // ajaxdata
2387 var ajaxdata = {};
2388 ajaxdata.action = 'acf/field_group/render_location_rule';
2389 ajaxdata.rule = acf.serialize($rule, prefix);
2390 ajaxdata.rule.id = $rule.data('id');
2391 ajaxdata.rule.group = $group.data('id');
2392
2393 // temp disable
2394 acf.disable($rule.find('td.value'));
2395 const self = this;
2396
2397 // ajax
2398 $.ajax({
2399 url: acf.get('ajaxurl'),
2400 data: acf.prepareForAjax(ajaxdata),
2401 type: 'post',
2402 dataType: 'html',
2403 success: function (html) {
2404 if (!html) return;
2405 $rule.replaceWith(html);
2406 }
2407 });
2408 },
2409 addGroup: function () {
2410 // vars
2411 var $group = this.$('.rule-group:last');
2412
2413 // duplicate
2414 $group2 = acf.duplicate($group);
2415
2416 // update h4
2417 $group2.find('h4').text(acf.__('or'));
2418
2419 // remove all tr's except the first one
2420 $group2.find('tr').not(':first').remove();
2421
2422 // update the groups class
2423 this.updateGroupsClass();
2424 },
2425 updateGroupsClass: function () {
2426 var $group = this.$('.rule-group:last');
2427 var $ruleGroups = $group.closest('.rule-groups');
2428 var rows_count = $ruleGroups.find('.acf-table tr').length;
2429 if (rows_count > 1) {
2430 $ruleGroups.addClass('rule-groups-multiple');
2431 } else {
2432 $ruleGroups.removeClass('rule-groups-multiple');
2433 }
2434 }
2435 });
2436 })(jQuery);
2437
2438 /***/ }),
2439
2440 /***/ "./assets/src/js/_field-group-settings.js":
2441 /*!************************************************!*\
2442 !*** ./assets/src/js/_field-group-settings.js ***!
2443 \************************************************/
2444 /***/ (() => {
2445
2446 (function ($, undefined) {
2447 /**
2448 * mid
2449 *
2450 * Calculates the model ID for a field type
2451 *
2452 * @date 15/12/17
2453 * @since ACF 5.6.5
2454 *
2455 * @param string type
2456 * @return string
2457 */
2458
2459 var modelId = function (type) {
2460 return acf.strPascalCase(type || '') + 'FieldSetting';
2461 };
2462
2463 /**
2464 * registerFieldType
2465 *
2466 * description
2467 *
2468 * @date 14/12/17
2469 * @since ACF 5.6.5
2470 *
2471 * @param type $var Description. Default.
2472 * @return type Description.
2473 */
2474
2475 acf.registerFieldSetting = function (model) {
2476 var proto = model.prototype;
2477 var mid = modelId(proto.type + ' ' + proto.name);
2478 this.models[mid] = model;
2479 };
2480
2481 /**
2482 * newField
2483 *
2484 * description
2485 *
2486 * @date 14/12/17
2487 * @since ACF 5.6.5
2488 *
2489 * @param type $var Description. Default.
2490 * @return type Description.
2491 */
2492
2493 acf.newFieldSetting = function (field) {
2494 // vars
2495 var type = field.get('setting') || '';
2496 var name = field.get('name') || '';
2497 var mid = modelId(type + ' ' + name);
2498 var model = acf.models[mid] || null;
2499
2500 // bail early if no setting
2501 if (model === null) return false;
2502
2503 // instantiate
2504 var setting = new model(field);
2505
2506 // return
2507 return setting;
2508 };
2509
2510 /**
2511 * acf.getFieldSetting
2512 *
2513 * description
2514 *
2515 * @date 19/4/18
2516 * @since ACF 5.6.9
2517 *
2518 * @param type $var Description. Default.
2519 * @return type Description.
2520 */
2521
2522 acf.getFieldSetting = function (field) {
2523 // allow jQuery
2524 if (field instanceof jQuery) {
2525 field = acf.getField(field);
2526 }
2527
2528 // return
2529 return field.setting;
2530 };
2531
2532 /**
2533 * settingsManager
2534 *
2535 * @since ACF 5.6.5
2536 *
2537 * @param object The object containing the extended variables and methods.
2538 * @return void
2539 */
2540 var settingsManager = new acf.Model({
2541 actions: {
2542 new_field: 'onNewField'
2543 },
2544 onNewField: function (field) {
2545 field.setting = acf.newFieldSetting(field);
2546 }
2547 });
2548
2549 /**
2550 * acf.FieldSetting
2551 *
2552 * @since ACF 5.6.5
2553 *
2554 * @param object The object containing the extended variables and methods.
2555 * @return void
2556 */
2557 acf.FieldSetting = acf.Model.extend({
2558 field: false,
2559 type: '',
2560 name: '',
2561 wait: 'ready',
2562 eventScope: '.acf-field',
2563 events: {
2564 change: 'render'
2565 },
2566 setup: function (field) {
2567 // vars
2568 var $field = field.$el;
2569
2570 // set props
2571 this.$el = $field;
2572 this.field = field;
2573 this.$fieldObject = $field.closest('.acf-field-object');
2574 this.fieldObject = acf.getFieldObject(this.$fieldObject);
2575
2576 // inherit data
2577 $.extend(this.data, field.data);
2578 },
2579 initialize: function () {
2580 this.render();
2581 },
2582 render: function () {
2583 // do nothing
2584 }
2585 });
2586
2587 /**
2588 * Accordion and Tab Endpoint Settings
2589 *
2590 * The 'endpoint' setting on accordions and tabs requires an additional class on the
2591 * field object row when enabled.
2592 *
2593 * @since ACF 6.0.0
2594 *
2595 * @param object The object containing the extended variables and methods.
2596 * @return void
2597 */
2598 var EndpointFieldSetting = acf.FieldSetting.extend({
2599 type: '',
2600 name: '',
2601 render: function () {
2602 var $endpoint_setting = this.fieldObject.$setting('endpoint');
2603 var $endpoint_field = $endpoint_setting.find('input[type="checkbox"]:first');
2604 if ($endpoint_field.is(':checked')) {
2605 this.fieldObject.$el.addClass('acf-field-is-endpoint');
2606 } else {
2607 this.fieldObject.$el.removeClass('acf-field-is-endpoint');
2608 }
2609 }
2610 });
2611 var AccordionEndpointFieldSetting = EndpointFieldSetting.extend({
2612 type: 'accordion',
2613 name: 'endpoint'
2614 });
2615 var TabEndpointFieldSetting = EndpointFieldSetting.extend({
2616 type: 'tab',
2617 name: 'endpoint'
2618 });
2619 acf.registerFieldSetting(AccordionEndpointFieldSetting);
2620 acf.registerFieldSetting(TabEndpointFieldSetting);
2621
2622 /**
2623 * Date Picker
2624 *
2625 * This field type requires some extra logic for its settings
2626 *
2627 * @since ACF 5.0.0
2628 *
2629 * @param object The object containing the extended variables and methods.
2630 * @return void
2631 */
2632 var DisplayFormatFieldSetting = acf.FieldSetting.extend({
2633 type: '',
2634 name: '',
2635 render: function () {
2636 var $input = this.$('input[type="radio"]:checked');
2637 if ($input.val() != 'other') {
2638 this.$('input[type="text"]').val($input.val());
2639 }
2640 }
2641 });
2642 var DatePickerDisplayFormatFieldSetting = DisplayFormatFieldSetting.extend({
2643 type: 'date_picker',
2644 name: 'display_format'
2645 });
2646 var DatePickerReturnFormatFieldSetting = DisplayFormatFieldSetting.extend({
2647 type: 'date_picker',
2648 name: 'return_format'
2649 });
2650 acf.registerFieldSetting(DatePickerDisplayFormatFieldSetting);
2651 acf.registerFieldSetting(DatePickerReturnFormatFieldSetting);
2652
2653 /**
2654 * Date Time Picker
2655 *
2656 * This field type requires some extra logic for its settings
2657 *
2658 * @since ACF 5.0.0
2659 *
2660 * @param object The object containing the extended variables and methods.
2661 * @return void
2662 */
2663 var DateTimePickerDisplayFormatFieldSetting = DisplayFormatFieldSetting.extend({
2664 type: 'date_time_picker',
2665 name: 'display_format'
2666 });
2667 var DateTimePickerReturnFormatFieldSetting = DisplayFormatFieldSetting.extend({
2668 type: 'date_time_picker',
2669 name: 'return_format'
2670 });
2671 acf.registerFieldSetting(DateTimePickerDisplayFormatFieldSetting);
2672 acf.registerFieldSetting(DateTimePickerReturnFormatFieldSetting);
2673
2674 /**
2675 * Time Picker
2676 *
2677 * This field type requires some extra logic for its settings
2678 *
2679 * @since ACF 5.0.0
2680 *
2681 * @param object The object containing the extended variables and methods.
2682 * @return void
2683 */
2684 var TimePickerDisplayFormatFieldSetting = DisplayFormatFieldSetting.extend({
2685 type: 'time_picker',
2686 name: 'display_format'
2687 });
2688 var TimePickerReturnFormatFieldSetting = DisplayFormatFieldSetting.extend({
2689 type: 'time_picker',
2690 name: 'return_format'
2691 });
2692 acf.registerFieldSetting(TimePickerDisplayFormatFieldSetting);
2693 acf.registerFieldSetting(TimePickerReturnFormatFieldSetting);
2694
2695 /**
2696 * Color Picker Settings.
2697 *
2698 * @date 16/12/20
2699 * @since ACF 5.9.4
2700 *
2701 * @param object The object containing the extended variables and methods.
2702 * @return void
2703 */
2704 var ColorPickerReturnFormat = acf.FieldSetting.extend({
2705 type: 'color_picker',
2706 name: 'enable_opacity',
2707 render: function () {
2708 var $return_format_setting = this.fieldObject.$setting('return_format');
2709 var $default_value_setting = this.fieldObject.$setting('default_value');
2710 var $labelText = $return_format_setting.find('input[type="radio"][value="string"]').parent('label').contents().last();
2711 var $defaultPlaceholder = $default_value_setting.find('input[type="text"]');
2712 var l10n = acf.get('colorPickerL10n');
2713 if (this.field.val()) {
2714 $labelText.replaceWith(l10n.rgba_string);
2715 $defaultPlaceholder.attr('placeholder', 'rgba(255,255,255,0.8)');
2716 } else {
2717 $labelText.replaceWith(l10n.hex_string);
2718 $defaultPlaceholder.attr('placeholder', '#FFFFFF');
2719 }
2720 }
2721 });
2722 acf.registerFieldSetting(ColorPickerReturnFormat);
2723 })(jQuery);
2724
2725 /***/ }),
2726
2727 /***/ "./assets/src/js/_field-group.js":
2728 /*!***************************************!*\
2729 !*** ./assets/src/js/_field-group.js ***!
2730 \***************************************/
2731 /***/ (() => {
2732
2733 (function ($, undefined) {
2734 /**
2735 * fieldGroupManager
2736 *
2737 * Generic field group functionality
2738 *
2739 * @date 15/12/17
2740 * @since ACF 5.7.0
2741 *
2742 * @param void
2743 * @return void
2744 */
2745
2746 var fieldGroupManager = new acf.Model({
2747 id: 'fieldGroupManager',
2748 events: {
2749 'submit #post': 'onSubmit',
2750 'click a[href="#"]': 'onClick',
2751 'click .acf-delete-field-group': 'onClickDeleteFieldGroup',
2752 'blur input#title': 'validateTitle',
2753 'input input#title': 'validateTitle'
2754 },
2755 filters: {
2756 find_fields_args: 'filterFindFieldArgs',
2757 find_fields_selector: 'filterFindFieldsSelector'
2758 },
2759 initialize: function () {
2760 acf.addAction('prepare', this.maybeInitNewFieldGroup);
2761 acf.add_filter('select2_args', this.setBidirectionalSelect2Args);
2762 acf.add_filter('select2_ajax_data', this.setBidirectionalSelect2AjaxDataArgs);
2763 },
2764 setBidirectionalSelect2Args: function (args, $select, settings, field, instance) {
2765 if (field?.data?.('key') !== 'bidirectional_target') return args;
2766 args.dropdownCssClass = 'field-type-select-results';
2767
2768 // Check for a full modern version of select2 like the one provided by ACF.
2769 try {
2770 $.fn.select2.amd.require('select2/compat/dropdownCss');
2771 } catch (err) {
2772 console.warn('ACF was not able to load the full version of select2 due to a conflicting version provided by another plugin or theme taking precedence. Skipping styling of bidirectional settings.');
2773 delete args.dropdownCssClass;
2774 }
2775 args.templateResult = function (selection) {
2776 if ('undefined' !== typeof selection.element) {
2777 return selection;
2778 }
2779 if (selection.children) {
2780 return selection.text;
2781 }
2782 if (selection.loading || selection.element && selection.element.nodeName === 'OPTGROUP') {
2783 var $selection = $('<span class="acf-selection"></span>');
2784 $selection.html(acf.strEscape(selection.text));
2785 return $selection;
2786 }
2787 if ('undefined' === typeof selection.human_field_type || 'undefined' === typeof selection.field_type || 'undefined' === typeof selection.this_field) {
2788 return selection.text;
2789 }
2790 var $selection = $('<i title="' + acf.escAttr(selection.human_field_type) + '" class="field-type-icon field-type-icon-' + acf.strEscape(selection.field_type.replaceAll('_', '-')) + '"></i><span class="acf-selection has-icon">' + acf.strEscape(selection.text) + '</span>');
2791 if (selection.this_field) {
2792 $selection.last().append('<span class="acf-select2-default-pill">' + acf.__('This Field') + '</span>');
2793 }
2794 $selection.data('element', selection.element);
2795 return $selection;
2796 };
2797 return args;
2798 },
2799 setBidirectionalSelect2AjaxDataArgs: function (data, args, $input, field, instance) {
2800 if (data.field_key !== 'bidirectional_target') return data;
2801 const $fieldObject = acf.findFieldObjects({
2802 child: field
2803 });
2804 const fieldObject = acf.getFieldObject($fieldObject);
2805 data.field_key = '_acf_bidirectional_target';
2806 data.parent_key = fieldObject.get('key');
2807 data.field_type = fieldObject.get('type');
2808
2809 // This might not be needed, but I wanted to figure out how to get a field setting in the JS API when the key isn't unique.
2810 data.post_type = acf.getField(acf.findFields({
2811 parent: $fieldObject,
2812 key: 'post_type'
2813 })).val();
2814 return data;
2815 },
2816 maybeInitNewFieldGroup: function () {
2817 let $field_list_wrapper = $('#acf-field-group-fields > .inside > .acf-field-list-wrap.acf-auto-add-field');
2818 if ($field_list_wrapper.length) {
2819 $('.acf-headerbar-actions .add-field').trigger('click');
2820 $('.acf-title-wrap #title').trigger('focus');
2821 }
2822 },
2823 onSubmit: function (e, $el) {
2824 // vars
2825 var $title = $('.acf-title-wrap #title');
2826
2827 // empty
2828 if (!$title.val()) {
2829 // prevent default
2830 e.preventDefault();
2831
2832 // unlock form
2833 acf.unlockForm($el);
2834
2835 // focus
2836 $title.trigger('focus');
2837 }
2838 },
2839 onClick: function (e) {
2840 e.preventDefault();
2841 },
2842 onClickDeleteFieldGroup: function (e, $el) {
2843 e.preventDefault();
2844 $el.addClass('-hover');
2845
2846 // Add confirmation tooltip.
2847 acf.newTooltip({
2848 confirm: true,
2849 target: $el,
2850 context: this,
2851 text: acf.__('Move field group to trash?'),
2852 confirm: function () {
2853 window.location.href = $el.attr('href');
2854 },
2855 cancel: function () {
2856 $el.removeClass('-hover');
2857 }
2858 });
2859 },
2860 validateTitle: function (e, $el) {
2861 let $submitButton = $('.acf-publish');
2862 if (!$el.val()) {
2863 $el.addClass('acf-input-error');
2864 $submitButton.addClass('disabled');
2865 $('.acf-publish').addClass('disabled');
2866 } else {
2867 $el.removeClass('acf-input-error');
2868 $submitButton.removeClass('disabled');
2869 $('.acf-publish').removeClass('disabled');
2870 }
2871 },
2872 filterFindFieldArgs: function (args) {
2873 args.visible = true;
2874 if (args.parent && (args.parent.hasClass('acf-field-object') || args.parent.hasClass('acf-browse-fields-modal-wrap') || args.parent.parents('.acf-field-object').length)) {
2875 args.visible = false;
2876 args.excludeSubFields = true;
2877 }
2878
2879 // If the field has any open subfields, don't exclude subfields as they're already being displayed.
2880 if (args.parent && args.parent.find('.acf-field-object.open').length) {
2881 args.excludeSubFields = false;
2882 }
2883 return args;
2884 },
2885 filterFindFieldsSelector: function (selector) {
2886 return selector + ', .acf-field-acf-field-group-settings-tabs';
2887 }
2888 });
2889
2890 /**
2891 * screenOptionsManager
2892 *
2893 * Screen options functionality
2894 *
2895 * @date 15/12/17
2896 * @since ACF 5.7.0
2897 *
2898 * @param void
2899 * @return void
2900 */
2901
2902 var screenOptionsManager = new acf.Model({
2903 id: 'screenOptionsManager',
2904 wait: 'prepare',
2905 events: {
2906 'change #acf-field-key-hide': 'onFieldKeysChange',
2907 'change #acf-field-settings-tabs': 'onFieldSettingsTabsChange',
2908 'change [name="screen_columns"]': 'render'
2909 },
2910 initialize: function () {
2911 // vars
2912 var $div = $('#adv-settings');
2913 var $append = $('#acf-append-show-on-screen');
2914
2915 // append
2916 $div.find('.metabox-prefs').append($append.html());
2917 $div.find('.metabox-prefs br').remove();
2918
2919 // clean up
2920 $append.remove();
2921
2922 // initialize
2923 this.$el = $('#screen-options-wrap');
2924
2925 // render
2926 this.render();
2927 },
2928 isFieldKeysChecked: function () {
2929 return this.$el.find('#acf-field-key-hide').prop('checked');
2930 },
2931 isFieldSettingsTabsChecked: function () {
2932 const $input = this.$el.find('#acf-field-settings-tabs');
2933
2934 // Screen option is hidden by filter.
2935 if (!$input.length) {
2936 return false;
2937 }
2938 return $input.prop('checked');
2939 },
2940 getSelectedColumnCount: function () {
2941 return this.$el.find('input[name="screen_columns"]:checked').val();
2942 },
2943 onFieldKeysChange: function (e, $el) {
2944 var val = this.isFieldKeysChecked() ? 1 : 0;
2945 acf.updateUserSetting('show_field_keys', val);
2946 this.render();
2947 },
2948 onFieldSettingsTabsChange: function () {
2949 const val = this.isFieldSettingsTabsChecked() ? 1 : 0;
2950 acf.updateUserSetting('show_field_settings_tabs', val);
2951 this.render();
2952 },
2953 render: function () {
2954 if (this.isFieldKeysChecked()) {
2955 $('#acf-field-group-fields').addClass('show-field-keys');
2956 } else {
2957 $('#acf-field-group-fields').removeClass('show-field-keys');
2958 }
2959 if (!this.isFieldSettingsTabsChecked()) {
2960 $('#acf-field-group-fields').addClass('hide-tabs');
2961 $('.acf-field-settings-main').removeClass('acf-hidden').prop('hidden', false);
2962 } else {
2963 $('#acf-field-group-fields').removeClass('hide-tabs');
2964 $('.acf-field-object').each(function () {
2965 const tabFields = acf.getFields({
2966 type: 'tab',
2967 parent: $(this),
2968 excludeSubFields: true,
2969 limit: 1
2970 });
2971 if (tabFields.length) {
2972 tabFields[0].tabs.set('initialized', false);
2973 }
2974 acf.doAction('show', $(this));
2975 });
2976 }
2977 if (this.getSelectedColumnCount() == 1) {
2978 $('body').removeClass('columns-2');
2979 $('body').addClass('columns-1');
2980 } else {
2981 $('body').removeClass('columns-1');
2982 $('body').addClass('columns-2');
2983 }
2984 }
2985 });
2986
2987 /**
2988 * appendFieldManager
2989 *
2990 * Appends fields together
2991 *
2992 * @date 15/12/17
2993 * @since ACF 5.7.0
2994 *
2995 * @param void
2996 * @return void
2997 */
2998
2999 var appendFieldManager = new acf.Model({
3000 actions: {
3001 new_field: 'onNewField'
3002 },
3003 onNewField: function (field) {
3004 // bail early if not append
3005 if (!field.has('append')) return;
3006
3007 // vars
3008 var append = field.get('append');
3009 var $sibling = field.$el.siblings('[data-name="' + append + '"]').first();
3010
3011 // bail early if no sibling
3012 if (!$sibling.length) return;
3013
3014 // ul
3015 var $div = $sibling.children('.acf-input');
3016 var $ul = $div.children('ul');
3017
3018 // create ul
3019 if (!$ul.length) {
3020 $div.wrapInner('<ul class="acf-hl"><li></li></ul>');
3021 $ul = $div.children('ul');
3022 }
3023
3024 // li
3025 var html = field.$('.acf-input').html();
3026 var $li = $('<li>' + html + '</li>');
3027 $ul.append($li);
3028 $ul.attr('data-cols', $ul.children().length);
3029
3030 // clean up
3031 field.remove();
3032 }
3033 });
3034 })(jQuery);
3035
3036 /***/ })
3037
3038 /******/ });
3039 /************************************************************************/
3040 /******/ // The module cache
3041 /******/ var __webpack_module_cache__ = {};
3042 /******/
3043 /******/ // The require function
3044 /******/ function __webpack_require__(moduleId) {
3045 /******/ // Check if module is in cache
3046 /******/ var cachedModule = __webpack_module_cache__[moduleId];
3047 /******/ if (cachedModule !== undefined) {
3048 /******/ return cachedModule.exports;
3049 /******/ }
3050 /******/ // Create a new module (and put it into the cache)
3051 /******/ var module = __webpack_module_cache__[moduleId] = {
3052 /******/ // no module.id needed
3053 /******/ // no module.loaded needed
3054 /******/ exports: {}
3055 /******/ };
3056 /******/
3057 /******/ // Execute the module function
3058 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
3059 /******/
3060 /******/ // Return the exports of the module
3061 /******/ return module.exports;
3062 /******/ }
3063 /******/
3064 /************************************************************************/
3065 /******/ /* webpack/runtime/compat get default export */
3066 /******/ (() => {
3067 /******/ // getDefaultExport function for compatibility with non-harmony modules
3068 /******/ __webpack_require__.n = (module) => {
3069 /******/ var getter = module && module.__esModule ?
3070 /******/ () => (module['default']) :
3071 /******/ () => (module);
3072 /******/ __webpack_require__.d(getter, { a: getter });
3073 /******/ return getter;
3074 /******/ };
3075 /******/ })();
3076 /******/
3077 /******/ /* webpack/runtime/define property getters */
3078 /******/ (() => {
3079 /******/ // define getter functions for harmony exports
3080 /******/ __webpack_require__.d = (exports, definition) => {
3081 /******/ for(var key in definition) {
3082 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
3083 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
3084 /******/ }
3085 /******/ }
3086 /******/ };
3087 /******/ })();
3088 /******/
3089 /******/ /* webpack/runtime/hasOwnProperty shorthand */
3090 /******/ (() => {
3091 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
3092 /******/ })();
3093 /******/
3094 /******/ /* webpack/runtime/make namespace object */
3095 /******/ (() => {
3096 /******/ // define __esModule on exports
3097 /******/ __webpack_require__.r = (exports) => {
3098 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
3099 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3100 /******/ }
3101 /******/ Object.defineProperty(exports, '__esModule', { value: true });
3102 /******/ };
3103 /******/ })();
3104 /******/
3105 /************************************************************************/
3106 var __webpack_exports__ = {};
3107 // This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
3108 (() => {
3109 "use strict";
3110 /*!******************************************!*\
3111 !*** ./assets/src/js/acf-field-group.js ***!
3112 \******************************************/
3113 __webpack_require__.r(__webpack_exports__);
3114 /* harmony import */ var _field_group_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_field-group.js */ "./assets/src/js/_field-group.js");
3115 /* harmony import */ var _field_group_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_field_group_js__WEBPACK_IMPORTED_MODULE_0__);
3116 /* harmony import */ var _field_group_field_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_field-group-field.js */ "./assets/src/js/_field-group-field.js");
3117 /* harmony import */ var _field_group_field_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_field_group_field_js__WEBPACK_IMPORTED_MODULE_1__);
3118 /* harmony import */ var _field_group_settings_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_field-group-settings.js */ "./assets/src/js/_field-group-settings.js");
3119 /* harmony import */ var _field_group_settings_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_field_group_settings_js__WEBPACK_IMPORTED_MODULE_2__);
3120 /* harmony import */ var _field_group_conditions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_field-group-conditions.js */ "./assets/src/js/_field-group-conditions.js");
3121 /* harmony import */ var _field_group_conditions_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_field_group_conditions_js__WEBPACK_IMPORTED_MODULE_3__);
3122 /* harmony import */ var _field_group_fields_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_field-group-fields.js */ "./assets/src/js/_field-group-fields.js");
3123 /* harmony import */ var _field_group_fields_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_field_group_fields_js__WEBPACK_IMPORTED_MODULE_4__);
3124 /* harmony import */ var _field_group_locations_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_field-group-locations.js */ "./assets/src/js/_field-group-locations.js");
3125 /* harmony import */ var _field_group_locations_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_field_group_locations_js__WEBPACK_IMPORTED_MODULE_5__);
3126 /* harmony import */ var _field_group_compatibility_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_field-group-compatibility.js */ "./assets/src/js/_field-group-compatibility.js");
3127 /* harmony import */ var _field_group_compatibility_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_field_group_compatibility_js__WEBPACK_IMPORTED_MODULE_6__);
3128 /* harmony import */ var _browse_fields_modal_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./_browse-fields-modal.js */ "./assets/src/js/_browse-fields-modal.js");
3129 /* harmony import */ var _browse_fields_modal_js__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_browse_fields_modal_js__WEBPACK_IMPORTED_MODULE_7__);
3130
3131
3132
3133
3134
3135
3136
3137
3138 })();
3139
3140 /******/ })()
3141 ;
3142 //# sourceMappingURL=acf-field-group.js.map