PluginProbe ʕ •ᴥ•ʔ
Secure Custom Fields / 6.4.1-beta5
Secure Custom Fields v6.4.1-beta5
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
pro 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.js 1 year ago acf-field-group.js 1 year ago acf-field-group.js.map 1 year ago acf-field-group.min.js 1 year ago acf-input.js 1 year ago acf-input.js.map 1 year ago acf-input.min.js 1 year ago acf-internal-post-type.js 1 year ago acf-internal-post-type.js.map 1 year ago acf-internal-post-type.min.js 1 year ago acf.js 1 year ago acf.js.map 1 year ago acf.min.js 1 year ago index.php 1 year ago
acf-field-group.js
3116 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').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 wthin 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 // calulate 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 // duplciate
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 puposes.
922 // It is possbile 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 = 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
1216 // update name
1217 $handle.find('.li-field-name').html(this.makeCopyable(acf.strSanitize(name)));
1218
1219 // update type
1220 const iconName = acf.strSlugify(this.getType());
1221 $handle.find('.field-type-label').text(' ' + type);
1222 $handle.find('.field-type-icon').removeClass().addClass('field-type-icon field-type-icon-' + iconName);
1223
1224 // update key
1225 $handle.find('.li-field-key').html(this.makeCopyable(key));
1226
1227 // action for 3rd party customization
1228 acf.doAction('render_field_object', this);
1229 },
1230 refresh: function () {
1231 acf.doAction('refresh_field_object', this);
1232 },
1233 isOpen: function () {
1234 return this.$el.hasClass('open');
1235 },
1236 onClickCopy: function (e) {
1237 e.stopPropagation();
1238 if (!navigator.clipboard || $(e.target).is('input')) return;
1239
1240 // Find the value to copy depending on input or text elements.
1241 let copyValue;
1242 if ($(e.target).hasClass('acf-input-wrap')) {
1243 copyValue = $(e.target).find('input').first().val();
1244 } else {
1245 copyValue = $(e.target).text().trim();
1246 }
1247 navigator.clipboard.writeText(copyValue).then(() => {
1248 $(e.target).closest('.copyable').addClass('copied');
1249 setTimeout(function () {
1250 $(e.target).closest('.copyable').removeClass('copied');
1251 }, 2000);
1252 });
1253 },
1254 onClickEdit: function (e) {
1255 const $target = $(e.target);
1256 if ($target.parent().hasClass('row-options') && !$target.hasClass('edit-field')) {
1257 return;
1258 }
1259 this.isOpen() ? this.close() : this.open();
1260 },
1261 onChangeSettingsTab: function () {
1262 const $settings = this.$el.children('.settings');
1263 acf.doAction('show', $settings);
1264 },
1265 /**
1266 * Adds 'active' class to row options nearest to the target.
1267 */
1268 onFocusEdit: function (e) {
1269 var $rowOptions = $(e.target).closest('li').find('.row-options');
1270 $rowOptions.addClass('active');
1271 },
1272 /**
1273 * Removes 'active' class from row options if links in same row options area are no longer in focus.
1274 */
1275 onBlurEdit: function (e) {
1276 var focusDelayMilliseconds = 50;
1277 var $rowOptionsBlurElement = $(e.target).closest('li').find('.row-options');
1278
1279 // Timeout so that `activeElement` gives the new element in focus instead of the body.
1280 setTimeout(function () {
1281 var $rowOptionsFocusElement = $(document.activeElement).closest('li').find('.row-options');
1282 if (!$rowOptionsBlurElement.is($rowOptionsFocusElement)) {
1283 $rowOptionsBlurElement.removeClass('active');
1284 }
1285 }, focusDelayMilliseconds);
1286 },
1287 open: function () {
1288 // vars
1289 var $settings = this.$el.children('.settings');
1290
1291 // initialise field type select
1292 this.addProFields();
1293 this.initializeFieldTypeSelect2();
1294
1295 // action (open)
1296 acf.doAction('open_field_object', this);
1297 this.trigger('openFieldObject');
1298
1299 // action (show)
1300 acf.doAction('show', $settings);
1301 this.hideEmptyTabs();
1302
1303 // open
1304 $settings.slideDown();
1305 this.$el.addClass('open');
1306 },
1307 onKeyDownSelect: function (e) {
1308 // Omit events from special keys.
1309 if (!(e.which >= 186 && e.which <= 222 ||
1310 // punctuation and special characters
1311 [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) ||
1312 // Special keys
1313 e.which >= 112 && e.which <= 123)) {
1314 // Function keys
1315 $(this).closest('.select2-container').siblings('select:enabled').select2('open');
1316 return;
1317 }
1318 },
1319 close: function () {
1320 // vars
1321 var $settings = this.$el.children('.settings');
1322
1323 // close
1324 $settings.slideUp();
1325 this.$el.removeClass('open');
1326
1327 // action (close)
1328 acf.doAction('close_field_object', this);
1329 this.trigger('closeFieldObject');
1330
1331 // action (hide)
1332 acf.doAction('hide', $settings);
1333 },
1334 serialize: function () {
1335 return acf.serialize(this.$el, this.getInputName());
1336 },
1337 save: function (type) {
1338 // defaults
1339 type = type || 'settings'; // meta, settings
1340
1341 // vars
1342 var save = this.getProp('save');
1343
1344 // bail if already saving settings
1345 if (save === 'settings') {
1346 return;
1347 }
1348
1349 // prop
1350 this.setProp('save', type);
1351
1352 // debug
1353 this.$el.attr('data-save', type);
1354
1355 // action
1356 acf.doAction('save_field_object', this, type);
1357 },
1358 submit: function () {
1359 // vars
1360 var inputName = this.getInputName();
1361 var save = this.get('save');
1362
1363 // close
1364 if (this.isOpen()) {
1365 this.close();
1366 }
1367
1368 // allow all inputs to save
1369 if (save == 'settings') {
1370 // do nothing
1371 // allow only meta inputs to save
1372 } else if (save == 'meta') {
1373 this.$('> .settings [name^="' + inputName + '"]').remove();
1374
1375 // prevent all inputs from saving
1376 } else {
1377 this.$('[name^="' + inputName + '"]').remove();
1378 }
1379
1380 // action
1381 acf.doAction('submit_field_object', this);
1382 },
1383 onChange: function (e, $el) {
1384 // save settings
1385 this.save();
1386
1387 // action for 3rd party customization
1388 acf.doAction('change_field_object', this);
1389 },
1390 onChanged: function (e, $el, name, value) {
1391 if (this.getType() === $el.attr('data-type')) {
1392 $('button.acf-btn.browse-fields').prop('disabled', false);
1393 }
1394
1395 // ignore 'save'
1396 if (name == 'save') {
1397 return;
1398 }
1399
1400 // save meta
1401 if (['menu_order', 'parent'].indexOf(name) > -1) {
1402 this.save('meta');
1403
1404 // save field
1405 } else {
1406 this.save();
1407 }
1408
1409 // render
1410 if (['menu_order', 'label', 'required', 'name', 'type', 'key'].indexOf(name) > -1) {
1411 this.render();
1412 }
1413
1414 // action for 3rd party customization
1415 acf.doAction('change_field_object_' + name, this, value);
1416 },
1417 onChangeLabel: function (e, $el) {
1418 // set
1419 const label = $el.val();
1420 const safeLabel = acf.encode(label);
1421 this.set('label', safeLabel);
1422
1423 // render name
1424 if (this.prop('name') == '') {
1425 var name = acf.applyFilters('generate_field_object_name', acf.strSanitize(label), this);
1426 this.prop('name', name);
1427 }
1428 },
1429 onChangeName: function (e, $el) {
1430 const sanitizedName = acf.strSanitize($el.val(), false);
1431 $el.val(sanitizedName);
1432 this.set('name', sanitizedName);
1433 if (sanitizedName.startsWith('field_')) {
1434 alert(acf.__('The string "field_" may not be used at the start of a field name'));
1435 }
1436 },
1437 onChangeRequired: function (e, $el) {
1438 // set
1439 var required = $el.prop('checked') ? 1 : 0;
1440 this.set('required', required);
1441 },
1442 delete: function (args) {
1443 // defaults
1444 args = acf.parseArgs(args, {
1445 animate: true
1446 });
1447
1448 // add to remove list
1449 var id = this.prop('ID');
1450 if (id) {
1451 var $input = $('#_acf_delete_fields');
1452 var newVal = $input.val() + '|' + id;
1453 $input.val(newVal);
1454 }
1455
1456 // action
1457 acf.doAction('delete_field_object', this);
1458
1459 // animate
1460 if (args.animate) {
1461 this.removeAnimate();
1462 } else {
1463 this.remove();
1464 }
1465 },
1466 onClickDelete: function (e, $el) {
1467 // Bypass confirmation when holding down "shift" key.
1468 if (e.shiftKey) {
1469 return this.delete();
1470 }
1471
1472 // add class
1473 this.$el.addClass('-hover');
1474
1475 // add tooltip
1476 var tooltip = acf.newTooltip({
1477 confirmRemove: true,
1478 target: $el,
1479 context: this,
1480 confirm: function () {
1481 this.delete();
1482 },
1483 cancel: function () {
1484 this.$el.removeClass('-hover');
1485 }
1486 });
1487 },
1488 removeAnimate: function () {
1489 // vars
1490 var field = this;
1491 var $list = this.$el.parent();
1492 var $fields = acf.findFieldObjects({
1493 sibling: this.$el
1494 });
1495
1496 // remove
1497 acf.remove({
1498 target: this.$el,
1499 endHeight: $fields.length ? 0 : 50,
1500 complete: function () {
1501 field.remove();
1502 acf.doAction('removed_field_object', field, $list);
1503 }
1504 });
1505
1506 // action
1507 acf.doAction('remove_field_object', field, $list);
1508 },
1509 duplicate: function () {
1510 // vars
1511 var newKey = acf.uniqid('field_');
1512
1513 // duplicate
1514 var $newField = acf.duplicate({
1515 target: this.$el,
1516 search: this.get('id'),
1517 replace: newKey
1518 });
1519
1520 // set new key
1521 $newField.attr('data-key', newKey);
1522
1523 // get instance
1524 var newField = acf.getFieldObject($newField);
1525
1526 // update newField label / name
1527 var label = newField.prop('label');
1528 var name = newField.prop('name');
1529 var end = name.split('_').pop();
1530 var copy = acf.__('copy');
1531
1532 // increase suffix "1"
1533 if (acf.isNumeric(end)) {
1534 var i = end * 1 + 1;
1535 label = label.replace(end, i);
1536 name = name.replace(end, i);
1537
1538 // increase suffix "(copy1)"
1539 } else if (end.indexOf(copy) === 0) {
1540 var i = end.replace(copy, '') * 1;
1541 i = i ? i + 1 : 2;
1542
1543 // replace
1544 label = label.replace(end, copy + i);
1545 name = name.replace(end, copy + i);
1546
1547 // add default "(copy)"
1548 } else {
1549 label += ' (' + copy + ')';
1550 name += '_' + copy;
1551 }
1552 newField.prop('ID', 0);
1553 newField.prop('label', label);
1554 newField.prop('name', name);
1555 newField.prop('key', newKey);
1556
1557 // close the current field if it's open.
1558 if (this.isOpen()) {
1559 this.close();
1560 }
1561
1562 // open the new field and initialise correctly.
1563 newField.open();
1564
1565 // focus label
1566 var $label = newField.$setting('label input');
1567 setTimeout(function () {
1568 $label.trigger('focus');
1569 }, 251);
1570
1571 // action
1572 acf.doAction('duplicate_field_object', this, newField);
1573 acf.doAction('append_field_object', newField);
1574 },
1575 wipe: function () {
1576 // vars
1577 var prevId = this.get('id');
1578 var prevKey = this.get('key');
1579 var newKey = acf.uniqid('field_');
1580
1581 // rename
1582 acf.rename({
1583 target: this.$el,
1584 search: prevId,
1585 replace: newKey
1586 });
1587
1588 // data
1589 this.set('id', newKey);
1590 this.set('prevId', prevId);
1591 this.set('prevKey', prevKey);
1592
1593 // props
1594 this.prop('key', newKey);
1595 this.prop('ID', 0);
1596
1597 // attr
1598 this.$el.attr('data-key', newKey);
1599 this.$el.attr('data-id', newKey);
1600
1601 // action
1602 acf.doAction('wipe_field_object', this);
1603 },
1604 move: function () {
1605 // helper
1606 var hasChanged = function (field) {
1607 return field.get('save') == 'settings';
1608 };
1609
1610 // vars
1611 var changed = hasChanged(this);
1612
1613 // has sub fields changed
1614 if (!changed) {
1615 acf.getFieldObjects({
1616 parent: this.$el
1617 }).map(function (field) {
1618 changed = hasChanged(field) || field.changed;
1619 });
1620 }
1621
1622 // bail early if changed
1623 if (changed) {
1624 alert(acf.__('This field cannot be moved until its changes have been saved'));
1625 return;
1626 }
1627
1628 // step 1.
1629 var id = this.prop('ID');
1630 var field = this;
1631 var popup = false;
1632 var step1 = function () {
1633 // popup
1634 popup = acf.newPopup({
1635 title: acf.__('Move Custom Field'),
1636 loading: true,
1637 width: '300px',
1638 openedBy: field.$el.find('.move-field')
1639 });
1640
1641 // ajax
1642 var ajaxData = {
1643 action: 'acf/field_group/move_field',
1644 field_id: id
1645 };
1646
1647 // get HTML
1648 $.ajax({
1649 url: acf.get('ajaxurl'),
1650 data: acf.prepareForAjax(ajaxData),
1651 type: 'post',
1652 dataType: 'html',
1653 success: step2
1654 });
1655 };
1656 var step2 = function (html) {
1657 // update popup
1658 popup.loading(false);
1659 popup.content(html);
1660
1661 // submit form
1662 popup.on('submit', 'form', step3);
1663 };
1664 var step3 = function (e, $el) {
1665 // prevent
1666 e.preventDefault();
1667
1668 // disable
1669 acf.startButtonLoading(popup.$('.button'));
1670
1671 // ajax
1672 var ajaxData = {
1673 action: 'acf/field_group/move_field',
1674 field_id: id,
1675 field_group_id: popup.$('select').val()
1676 };
1677
1678 // get HTML
1679 $.ajax({
1680 url: acf.get('ajaxurl'),
1681 data: acf.prepareForAjax(ajaxData),
1682 type: 'post',
1683 dataType: 'html',
1684 success: step4
1685 });
1686 };
1687 var step4 = function (html) {
1688 popup.content(html);
1689 if (wp.a11y && wp.a11y.speak && acf.__) {
1690 wp.a11y.speak(acf.__('Field moved to other group'), 'polite');
1691 }
1692 popup.$('.acf-close-popup').focus();
1693 field.removeAnimate();
1694 };
1695
1696 // start
1697 step1();
1698 },
1699 browseFields: function (e, $el) {
1700 e.preventDefault();
1701 const modal = acf.newBrowseFieldsModal({
1702 openedBy: this
1703 });
1704 },
1705 onChangeType: function (e, $el) {
1706 // clea previous timout
1707 if (this.changeTimeout) {
1708 clearTimeout(this.changeTimeout);
1709 }
1710
1711 // set new timeout
1712 // - prevents changing type multiple times whilst user types in newType
1713 this.changeTimeout = this.setTimeout(function () {
1714 this.changeType($el.val());
1715 }, 300);
1716 },
1717 changeType: function (newType) {
1718 var prevType = this.prop('type');
1719 var prevClass = acf.strSlugify('acf-field-object-' + prevType);
1720 var newClass = acf.strSlugify('acf-field-object-' + newType);
1721
1722 // Update props.
1723 this.$el.removeClass(prevClass).addClass(newClass);
1724 this.$el.attr('data-type', newType);
1725 this.$el.data('type', newType);
1726
1727 // Abort XHR if this field is already loading AJAX data.
1728 if (this.has('xhr')) {
1729 this.get('xhr').abort();
1730 }
1731
1732 // Store old settings so they can be reused later.
1733 const $oldSettings = {};
1734 this.$el.find('.acf-field-settings:first > .acf-field-settings-main > .acf-field-type-settings').each(function () {
1735 let tab = $(this).data('parent-tab');
1736 let $tabSettings = $(this).children().removeData();
1737 $oldSettings[tab] = $tabSettings;
1738 $tabSettings.detach();
1739 });
1740 this.set('settings-' + prevType, $oldSettings);
1741
1742 // Show the settings if we already have them cached.
1743 if (this.has('settings-' + newType)) {
1744 let $newSettings = this.get('settings-' + newType);
1745 this.showFieldTypeSettings($newSettings);
1746 this.set('type', newType);
1747 return;
1748 }
1749
1750 // Add loading spinner.
1751 const $loading = $('<div class="acf-field"><div class="acf-input"><div class="acf-loading"></div></div></div>');
1752 this.$el.find('.acf-field-settings-main-general .acf-field-type-settings').before($loading);
1753 const ajaxData = {
1754 action: 'acf/field_group/render_field_settings',
1755 field: this.serialize(),
1756 prefix: this.getInputName()
1757 };
1758
1759 // Get the settings for this field type over AJAX.
1760 var xhr = $.ajax({
1761 url: acf.get('ajaxurl'),
1762 data: acf.prepareForAjax(ajaxData),
1763 type: 'post',
1764 dataType: 'json',
1765 context: this,
1766 success: function (response) {
1767 if (!acf.isAjaxSuccess(response)) {
1768 return;
1769 }
1770 this.showFieldTypeSettings(response.data);
1771 },
1772 complete: function () {
1773 // also triggered by xhr.abort();
1774 $loading.remove();
1775 this.set('type', newType);
1776 //this.refresh();
1777 }
1778 });
1779
1780 // set
1781 this.set('xhr', xhr);
1782 },
1783 showFieldTypeSettings: function (settings) {
1784 if ('object' !== typeof settings) {
1785 return;
1786 }
1787 const self = this;
1788 const tabs = Object.keys(settings);
1789 tabs.forEach(tab => {
1790 const $tab = self.$el.find('.acf-field-settings-main-' + tab.replace('_', '-') + ' .acf-field-type-settings');
1791 let tabContent = '';
1792 if (['object', 'string'].includes(typeof settings[tab])) {
1793 tabContent = settings[tab];
1794 }
1795 $tab.prepend(tabContent);
1796 acf.doAction('append', $tab);
1797 });
1798 this.hideEmptyTabs();
1799 },
1800 updateParent: function () {
1801 // vars
1802 var ID = acf.get('post_id');
1803
1804 // check parent
1805 var parent = this.getParent();
1806 if (parent) {
1807 ID = parseInt(parent.prop('ID')) || parent.prop('key');
1808 }
1809
1810 // update
1811 this.prop('parent', ID);
1812 },
1813 hideEmptyTabs: function () {
1814 const $settings = this.$settings();
1815 const $tabs = $settings.find('.acf-field-settings:first > .acf-field-settings-main');
1816 $tabs.each(function () {
1817 const $tabContent = $(this);
1818 const tabName = $tabContent.find('.acf-field-type-settings:first').data('parentTab');
1819 const $tabLink = $settings.find('.acf-settings-type-' + tabName).first();
1820 if ($.trim($tabContent.text()) === '') {
1821 $tabLink.hide();
1822 } else if ($tabLink.is(':hidden')) {
1823 $tabLink.show();
1824 }
1825 });
1826 }
1827 });
1828 })(jQuery);
1829
1830 /***/ }),
1831
1832 /***/ "./assets/src/js/_field-group-fields.js":
1833 /*!**********************************************!*\
1834 !*** ./assets/src/js/_field-group-fields.js ***!
1835 \**********************************************/
1836 /***/ (() => {
1837
1838 (function ($, undefined) {
1839 /**
1840 * acf.findFieldObject
1841 *
1842 * Returns a single fieldObject $el for a given field key
1843 *
1844 * @date 1/2/18
1845 * @since ACF 5.7.0
1846 *
1847 * @param string key The field key
1848 * @return jQuery
1849 */
1850
1851 acf.findFieldObject = function (key) {
1852 return acf.findFieldObjects({
1853 key: key,
1854 limit: 1
1855 });
1856 };
1857
1858 /**
1859 * acf.findFieldObjects
1860 *
1861 * Returns an array of fieldObject $el for the given args
1862 *
1863 * @date 1/2/18
1864 * @since ACF 5.7.0
1865 *
1866 * @param object args
1867 * @return jQuery
1868 */
1869
1870 acf.findFieldObjects = function (args) {
1871 // vars
1872 args = args || {};
1873 var selector = '.acf-field-object';
1874 var $fields = false;
1875
1876 // args
1877 args = acf.parseArgs(args, {
1878 id: '',
1879 key: '',
1880 type: '',
1881 limit: false,
1882 list: null,
1883 parent: false,
1884 sibling: false,
1885 child: false
1886 });
1887
1888 // id
1889 if (args.id) {
1890 selector += '[data-id="' + args.id + '"]';
1891 }
1892
1893 // key
1894 if (args.key) {
1895 selector += '[data-key="' + args.key + '"]';
1896 }
1897
1898 // type
1899 if (args.type) {
1900 selector += '[data-type="' + args.type + '"]';
1901 }
1902
1903 // query
1904 if (args.list) {
1905 $fields = args.list.children(selector);
1906 } else if (args.parent) {
1907 $fields = args.parent.find(selector);
1908 } else if (args.sibling) {
1909 $fields = args.sibling.siblings(selector);
1910 } else if (args.child) {
1911 $fields = args.child.parents(selector);
1912 } else {
1913 $fields = $(selector);
1914 }
1915
1916 // limit
1917 if (args.limit) {
1918 $fields = $fields.slice(0, args.limit);
1919 }
1920
1921 // return
1922 return $fields;
1923 };
1924
1925 /**
1926 * acf.getFieldObject
1927 *
1928 * Returns a single fieldObject instance for a given $el|key
1929 *
1930 * @date 1/2/18
1931 * @since ACF 5.7.0
1932 *
1933 * @param string|jQuery $field The field $el or key
1934 * @return jQuery
1935 */
1936
1937 acf.getFieldObject = function ($field) {
1938 // allow key
1939 if (typeof $field === 'string') {
1940 $field = acf.findFieldObject($field);
1941 }
1942
1943 // instantiate
1944 var field = $field.data('acf');
1945 if (!field) {
1946 field = acf.newFieldObject($field);
1947 }
1948
1949 // return
1950 return field;
1951 };
1952
1953 /**
1954 * acf.getFieldObjects
1955 *
1956 * Returns an array of fieldObject instances for the given args
1957 *
1958 * @date 1/2/18
1959 * @since ACF 5.7.0
1960 *
1961 * @param object args
1962 * @return array
1963 */
1964
1965 acf.getFieldObjects = function (args) {
1966 // query
1967 var $fields = acf.findFieldObjects(args);
1968
1969 // loop
1970 var fields = [];
1971 $fields.each(function () {
1972 var field = acf.getFieldObject($(this));
1973 fields.push(field);
1974 });
1975
1976 // return
1977 return fields;
1978 };
1979
1980 /**
1981 * acf.newFieldObject
1982 *
1983 * Initializes and returns a new FieldObject instance
1984 *
1985 * @date 1/2/18
1986 * @since ACF 5.7.0
1987 *
1988 * @param jQuery $field The field $el
1989 * @return object
1990 */
1991
1992 acf.newFieldObject = function ($field) {
1993 // instantiate
1994 var field = new acf.FieldObject($field);
1995
1996 // action
1997 acf.doAction('new_field_object', field);
1998
1999 // return
2000 return field;
2001 };
2002
2003 /**
2004 * actionManager
2005 *
2006 * description
2007 *
2008 * @date 15/12/17
2009 * @since ACF 5.6.5
2010 *
2011 * @param type $var Description. Default.
2012 * @return type Description.
2013 */
2014
2015 var eventManager = new acf.Model({
2016 priority: 5,
2017 initialize: function () {
2018 // actions
2019 var actions = ['prepare', 'ready', 'append', 'remove'];
2020
2021 // loop
2022 actions.map(function (action) {
2023 this.addFieldActions(action);
2024 }, this);
2025 },
2026 addFieldActions: function (action) {
2027 // vars
2028 var pluralAction = action + '_field_objects'; // ready_field_objects
2029 var singleAction = action + '_field_object'; // ready_field_object
2030 var singleEvent = action + 'FieldObject'; // readyFieldObject
2031
2032 // global action
2033 var callback = function ($el /*, arg1, arg2, etc*/) {
2034 // vars
2035 var fieldObjects = acf.getFieldObjects({
2036 parent: $el
2037 });
2038
2039 // call plural
2040 if (fieldObjects.length) {
2041 /// get args [$el, arg1]
2042 var args = acf.arrayArgs(arguments);
2043
2044 // modify args [pluralAction, fields, arg1]
2045 args.splice(0, 1, pluralAction, fieldObjects);
2046 acf.doAction.apply(null, args);
2047 }
2048 };
2049
2050 // plural action
2051 var pluralCallback = function (fieldObjects /*, arg1, arg2, etc*/) {
2052 /// get args [fields, arg1]
2053 var args = acf.arrayArgs(arguments);
2054
2055 // modify args [singleAction, fields, arg1]
2056 args.unshift(singleAction);
2057
2058 // loop
2059 fieldObjects.map(function (fieldObject) {
2060 // modify args [singleAction, field, arg1]
2061 args[1] = fieldObject;
2062 acf.doAction.apply(null, args);
2063 });
2064 };
2065
2066 // single action
2067 var singleCallback = function (fieldObject /*, arg1, arg2, etc*/) {
2068 /// get args [$field, arg1]
2069 var args = acf.arrayArgs(arguments);
2070
2071 // modify args [singleAction, $field, arg1]
2072 args.unshift(singleAction);
2073
2074 // action variations (ready_field/type=image)
2075 var variations = ['type', 'name', 'key'];
2076 variations.map(function (variation) {
2077 args[0] = singleAction + '/' + variation + '=' + fieldObject.get(variation);
2078 acf.doAction.apply(null, args);
2079 });
2080
2081 // modify args [arg1]
2082 args.splice(0, 2);
2083
2084 // event
2085 fieldObject.trigger(singleEvent, args);
2086 };
2087
2088 // add actions
2089 acf.addAction(action, callback, 5);
2090 acf.addAction(pluralAction, pluralCallback, 5);
2091 acf.addAction(singleAction, singleCallback, 5);
2092 }
2093 });
2094
2095 /**
2096 * fieldManager
2097 *
2098 * description
2099 *
2100 * @date 4/1/18
2101 * @since ACF 5.6.5
2102 *
2103 * @param type $var Description. Default.
2104 * @return type Description.
2105 */
2106
2107 var fieldManager = new acf.Model({
2108 id: 'fieldManager',
2109 events: {
2110 'submit #post': 'onSubmit',
2111 'mouseenter .acf-field-list': 'onHoverSortable',
2112 'click .add-field': 'onClickAdd'
2113 },
2114 actions: {
2115 removed_field_object: 'onRemovedField',
2116 sortstop_field_object: 'onReorderField',
2117 delete_field_object: 'onDeleteField',
2118 change_field_object_type: 'onChangeFieldType',
2119 duplicate_field_object: 'onDuplicateField'
2120 },
2121 onSubmit: function (e, $el) {
2122 // vars
2123 var fields = acf.getFieldObjects();
2124
2125 // loop
2126 fields.map(function (field) {
2127 field.submit();
2128 });
2129 },
2130 setFieldMenuOrder: function (field) {
2131 this.renderFields(field.$el.parent());
2132 },
2133 onHoverSortable: function (e, $el) {
2134 // bail early if already sortable
2135 if ($el.hasClass('ui-sortable')) return;
2136
2137 // sortable
2138 $el.sortable({
2139 helper: function (event, element) {
2140 // https://core.trac.wordpress.org/ticket/16972#comment:22
2141 return element.clone().find(':input').attr('name', function (i, currentName) {
2142 return 'sort_' + parseInt(Math.random() * 100000, 10).toString() + '_' + currentName;
2143 }).end();
2144 },
2145 handle: '.acf-sortable-handle',
2146 connectWith: '.acf-field-list',
2147 start: function (e, ui) {
2148 var field = acf.getFieldObject(ui.item);
2149 ui.placeholder.height(ui.item.height());
2150 acf.doAction('sortstart_field_object', field, $el);
2151 },
2152 update: function (e, ui) {
2153 var field = acf.getFieldObject(ui.item);
2154 acf.doAction('sortstop_field_object', field, $el);
2155 }
2156 });
2157 },
2158 onRemovedField: function (field, $list) {
2159 this.renderFields($list);
2160 },
2161 onReorderField: function (field, $list) {
2162 field.updateParent();
2163 this.renderFields($list);
2164 },
2165 onDeleteField: function (field) {
2166 // delete children
2167 field.getFields().map(function (child) {
2168 child.delete({
2169 animate: false
2170 });
2171 });
2172 },
2173 onChangeFieldType: function (field) {
2174 // enable browse field modal button
2175 field.$el.find('button.browse-fields').prop('disabled', false);
2176 },
2177 onDuplicateField: function (field, newField) {
2178 // check for children
2179 var children = newField.getFields();
2180 if (children.length) {
2181 // loop
2182 children.map(function (child) {
2183 // wipe field
2184 child.wipe();
2185
2186 // if the child is open, re-fire the open method to ensure it's initialised correctly.
2187 if (child.isOpen()) {
2188 child.open();
2189 }
2190
2191 // update parent
2192 child.updateParent();
2193 });
2194
2195 // action
2196 acf.doAction('duplicate_field_objects', children, newField, field);
2197 }
2198
2199 // set menu order
2200 this.setFieldMenuOrder(newField);
2201 },
2202 renderFields: function ($list) {
2203 // vars
2204 var fields = acf.getFieldObjects({
2205 list: $list
2206 });
2207
2208 // no fields
2209 if (!fields.length) {
2210 $list.addClass('-empty');
2211 $list.parents('.acf-field-list-wrap').first().addClass('-empty');
2212 return;
2213 }
2214
2215 // has fields
2216 $list.removeClass('-empty');
2217 $list.parents('.acf-field-list-wrap').first().removeClass('-empty');
2218
2219 // prop
2220 fields.map(function (field, i) {
2221 field.prop('menu_order', i);
2222 });
2223 },
2224 onClickAdd: function (e, $el) {
2225 let $list;
2226 if ($el.hasClass('add-first-field')) {
2227 $list = $el.parents('.acf-field-list').eq(0);
2228 } else if ($el.parent().hasClass('acf-headerbar-actions') || $el.parent().hasClass('no-fields-message-inner')) {
2229 $list = $('.acf-field-list:first');
2230 } else if ($el.parent().hasClass('acf-sub-field-list-header')) {
2231 $list = $el.parents('.acf-input:first').find('.acf-field-list:first');
2232 } else {
2233 $list = $el.closest('.acf-tfoot').siblings('.acf-field-list');
2234 }
2235 this.addField($list);
2236 },
2237 addField: function ($list) {
2238 // vars
2239 var html = $('#tmpl-acf-field').html();
2240 var $el = $(html);
2241 var prevId = $el.data('id');
2242 var newKey = acf.uniqid('field_');
2243
2244 // duplicate
2245 var $newField = acf.duplicate({
2246 target: $el,
2247 search: prevId,
2248 replace: newKey,
2249 append: function ($el, $el2) {
2250 $list.append($el2);
2251 }
2252 });
2253
2254 // get instance
2255 var newField = acf.getFieldObject($newField);
2256
2257 // props
2258 newField.prop('key', newKey);
2259 newField.prop('ID', 0);
2260 newField.prop('label', '');
2261 newField.prop('name', '');
2262
2263 // attr
2264 $newField.attr('data-key', newKey);
2265 $newField.attr('data-id', newKey);
2266
2267 // update parent prop
2268 newField.updateParent();
2269
2270 // focus type
2271 var $type = newField.$input('type');
2272 setTimeout(function () {
2273 if ($list.hasClass('acf-auto-add-field')) {
2274 $list.removeClass('acf-auto-add-field');
2275 } else {
2276 $type.trigger('focus');
2277 }
2278 }, 251);
2279
2280 // open
2281 newField.open();
2282
2283 // set menu order
2284 this.renderFields($list);
2285
2286 // action
2287 acf.doAction('add_field_object', newField);
2288 acf.doAction('append_field_object', newField);
2289 }
2290 });
2291 })(jQuery);
2292
2293 /***/ }),
2294
2295 /***/ "./assets/src/js/_field-group-locations.js":
2296 /*!*************************************************!*\
2297 !*** ./assets/src/js/_field-group-locations.js ***!
2298 \*************************************************/
2299 /***/ (() => {
2300
2301 (function ($, undefined) {
2302 /**
2303 * locationManager
2304 *
2305 * Field group location rules functionality
2306 *
2307 * @date 15/12/17
2308 * @since ACF 5.7.0
2309 *
2310 * @param void
2311 * @return void
2312 */
2313
2314 var locationManager = new acf.Model({
2315 id: 'locationManager',
2316 wait: 'ready',
2317 events: {
2318 'click .add-location-rule': 'onClickAddRule',
2319 'click .add-location-group': 'onClickAddGroup',
2320 'click .remove-location-rule': 'onClickRemoveRule',
2321 'change .refresh-location-rule': 'onChangeRemoveRule'
2322 },
2323 initialize: function () {
2324 this.$el = $('#acf-field-group-options');
2325 this.updateGroupsClass();
2326 },
2327 onClickAddRule: function (e, $el) {
2328 this.addRule($el.closest('tr'));
2329 },
2330 onClickRemoveRule: function (e, $el) {
2331 this.removeRule($el.closest('tr'));
2332 },
2333 onChangeRemoveRule: function (e, $el) {
2334 this.changeRule($el.closest('tr'));
2335 },
2336 onClickAddGroup: function (e, $el) {
2337 this.addGroup();
2338 },
2339 addRule: function ($tr) {
2340 acf.duplicate($tr);
2341 this.updateGroupsClass();
2342 },
2343 removeRule: function ($tr) {
2344 if ($tr.siblings('tr').length == 0) {
2345 $tr.closest('.rule-group').remove();
2346 } else {
2347 $tr.remove();
2348 }
2349
2350 // Update h4
2351 var $group = this.$('.rule-group:first');
2352 $group.find('h4').text(acf.__('Show this field group if'));
2353 this.updateGroupsClass();
2354 },
2355 changeRule: function ($rule) {
2356 // vars
2357 var $group = $rule.closest('.rule-group');
2358 var prefix = $rule.find('td.param select').attr('name').replace('[param]', '');
2359
2360 // ajaxdata
2361 var ajaxdata = {};
2362 ajaxdata.action = 'acf/field_group/render_location_rule';
2363 ajaxdata.rule = acf.serialize($rule, prefix);
2364 ajaxdata.rule.id = $rule.data('id');
2365 ajaxdata.rule.group = $group.data('id');
2366
2367 // temp disable
2368 acf.disable($rule.find('td.value'));
2369 const self = this;
2370
2371 // ajax
2372 $.ajax({
2373 url: acf.get('ajaxurl'),
2374 data: acf.prepareForAjax(ajaxdata),
2375 type: 'post',
2376 dataType: 'html',
2377 success: function (html) {
2378 if (!html) return;
2379 $rule.replaceWith(html);
2380 }
2381 });
2382 },
2383 addGroup: function () {
2384 // vars
2385 var $group = this.$('.rule-group:last');
2386
2387 // duplicate
2388 $group2 = acf.duplicate($group);
2389
2390 // update h4
2391 $group2.find('h4').text(acf.__('or'));
2392
2393 // remove all tr's except the first one
2394 $group2.find('tr').not(':first').remove();
2395
2396 // update the groups class
2397 this.updateGroupsClass();
2398 },
2399 updateGroupsClass: function () {
2400 var $group = this.$('.rule-group:last');
2401 var $ruleGroups = $group.closest('.rule-groups');
2402 var rows_count = $ruleGroups.find('.acf-table tr').length;
2403 if (rows_count > 1) {
2404 $ruleGroups.addClass('rule-groups-multiple');
2405 } else {
2406 $ruleGroups.removeClass('rule-groups-multiple');
2407 }
2408 }
2409 });
2410 })(jQuery);
2411
2412 /***/ }),
2413
2414 /***/ "./assets/src/js/_field-group-settings.js":
2415 /*!************************************************!*\
2416 !*** ./assets/src/js/_field-group-settings.js ***!
2417 \************************************************/
2418 /***/ (() => {
2419
2420 (function ($, undefined) {
2421 /**
2422 * mid
2423 *
2424 * Calculates the model ID for a field type
2425 *
2426 * @date 15/12/17
2427 * @since ACF 5.6.5
2428 *
2429 * @param string type
2430 * @return string
2431 */
2432
2433 var modelId = function (type) {
2434 return acf.strPascalCase(type || '') + 'FieldSetting';
2435 };
2436
2437 /**
2438 * registerFieldType
2439 *
2440 * description
2441 *
2442 * @date 14/12/17
2443 * @since ACF 5.6.5
2444 *
2445 * @param type $var Description. Default.
2446 * @return type Description.
2447 */
2448
2449 acf.registerFieldSetting = function (model) {
2450 var proto = model.prototype;
2451 var mid = modelId(proto.type + ' ' + proto.name);
2452 this.models[mid] = model;
2453 };
2454
2455 /**
2456 * newField
2457 *
2458 * description
2459 *
2460 * @date 14/12/17
2461 * @since ACF 5.6.5
2462 *
2463 * @param type $var Description. Default.
2464 * @return type Description.
2465 */
2466
2467 acf.newFieldSetting = function (field) {
2468 // vars
2469 var type = field.get('setting') || '';
2470 var name = field.get('name') || '';
2471 var mid = modelId(type + ' ' + name);
2472 var model = acf.models[mid] || null;
2473
2474 // bail early if no setting
2475 if (model === null) return false;
2476
2477 // instantiate
2478 var setting = new model(field);
2479
2480 // return
2481 return setting;
2482 };
2483
2484 /**
2485 * acf.getFieldSetting
2486 *
2487 * description
2488 *
2489 * @date 19/4/18
2490 * @since ACF 5.6.9
2491 *
2492 * @param type $var Description. Default.
2493 * @return type Description.
2494 */
2495
2496 acf.getFieldSetting = function (field) {
2497 // allow jQuery
2498 if (field instanceof jQuery) {
2499 field = acf.getField(field);
2500 }
2501
2502 // return
2503 return field.setting;
2504 };
2505
2506 /**
2507 * settingsManager
2508 *
2509 * @since ACF 5.6.5
2510 *
2511 * @param object The object containing the extended variables and methods.
2512 * @return void
2513 */
2514 var settingsManager = new acf.Model({
2515 actions: {
2516 new_field: 'onNewField'
2517 },
2518 onNewField: function (field) {
2519 field.setting = acf.newFieldSetting(field);
2520 }
2521 });
2522
2523 /**
2524 * acf.FieldSetting
2525 *
2526 * @since ACF 5.6.5
2527 *
2528 * @param object The object containing the extended variables and methods.
2529 * @return void
2530 */
2531 acf.FieldSetting = acf.Model.extend({
2532 field: false,
2533 type: '',
2534 name: '',
2535 wait: 'ready',
2536 eventScope: '.acf-field',
2537 events: {
2538 change: 'render'
2539 },
2540 setup: function (field) {
2541 // vars
2542 var $field = field.$el;
2543
2544 // set props
2545 this.$el = $field;
2546 this.field = field;
2547 this.$fieldObject = $field.closest('.acf-field-object');
2548 this.fieldObject = acf.getFieldObject(this.$fieldObject);
2549
2550 // inherit data
2551 $.extend(this.data, field.data);
2552 },
2553 initialize: function () {
2554 this.render();
2555 },
2556 render: function () {
2557 // do nothing
2558 }
2559 });
2560
2561 /**
2562 * Accordion and Tab Endpoint Settings
2563 *
2564 * The 'endpoint' setting on accordions and tabs requires an additional class on the
2565 * field object row when enabled.
2566 *
2567 * @since ACF 6.0.0
2568 *
2569 * @param object The object containing the extended variables and methods.
2570 * @return void
2571 */
2572 var EndpointFieldSetting = acf.FieldSetting.extend({
2573 type: '',
2574 name: '',
2575 render: function () {
2576 var $endpoint_setting = this.fieldObject.$setting('endpoint');
2577 var $endpoint_field = $endpoint_setting.find('input[type="checkbox"]:first');
2578 if ($endpoint_field.is(':checked')) {
2579 this.fieldObject.$el.addClass('acf-field-is-endpoint');
2580 } else {
2581 this.fieldObject.$el.removeClass('acf-field-is-endpoint');
2582 }
2583 }
2584 });
2585 var AccordionEndpointFieldSetting = EndpointFieldSetting.extend({
2586 type: 'accordion',
2587 name: 'endpoint'
2588 });
2589 var TabEndpointFieldSetting = EndpointFieldSetting.extend({
2590 type: 'tab',
2591 name: 'endpoint'
2592 });
2593 acf.registerFieldSetting(AccordionEndpointFieldSetting);
2594 acf.registerFieldSetting(TabEndpointFieldSetting);
2595
2596 /**
2597 * Date Picker
2598 *
2599 * This field type requires some extra logic for its settings
2600 *
2601 * @since ACF 5.0.0
2602 *
2603 * @param object The object containing the extended variables and methods.
2604 * @return void
2605 */
2606 var DisplayFormatFieldSetting = acf.FieldSetting.extend({
2607 type: '',
2608 name: '',
2609 render: function () {
2610 var $input = this.$('input[type="radio"]:checked');
2611 if ($input.val() != 'other') {
2612 this.$('input[type="text"]').val($input.val());
2613 }
2614 }
2615 });
2616 var DatePickerDisplayFormatFieldSetting = DisplayFormatFieldSetting.extend({
2617 type: 'date_picker',
2618 name: 'display_format'
2619 });
2620 var DatePickerReturnFormatFieldSetting = DisplayFormatFieldSetting.extend({
2621 type: 'date_picker',
2622 name: 'return_format'
2623 });
2624 acf.registerFieldSetting(DatePickerDisplayFormatFieldSetting);
2625 acf.registerFieldSetting(DatePickerReturnFormatFieldSetting);
2626
2627 /**
2628 * Date Time Picker
2629 *
2630 * This field type requires some extra logic for its settings
2631 *
2632 * @since ACF 5.0.0
2633 *
2634 * @param object The object containing the extended variables and methods.
2635 * @return void
2636 */
2637 var DateTimePickerDisplayFormatFieldSetting = DisplayFormatFieldSetting.extend({
2638 type: 'date_time_picker',
2639 name: 'display_format'
2640 });
2641 var DateTimePickerReturnFormatFieldSetting = DisplayFormatFieldSetting.extend({
2642 type: 'date_time_picker',
2643 name: 'return_format'
2644 });
2645 acf.registerFieldSetting(DateTimePickerDisplayFormatFieldSetting);
2646 acf.registerFieldSetting(DateTimePickerReturnFormatFieldSetting);
2647
2648 /**
2649 * Time Picker
2650 *
2651 * This field type requires some extra logic for its settings
2652 *
2653 * @since ACF 5.0.0
2654 *
2655 * @param object The object containing the extended variables and methods.
2656 * @return void
2657 */
2658 var TimePickerDisplayFormatFieldSetting = DisplayFormatFieldSetting.extend({
2659 type: 'time_picker',
2660 name: 'display_format'
2661 });
2662 var TimePickerReturnFormatFieldSetting = DisplayFormatFieldSetting.extend({
2663 type: 'time_picker',
2664 name: 'return_format'
2665 });
2666 acf.registerFieldSetting(TimePickerDisplayFormatFieldSetting);
2667 acf.registerFieldSetting(TimePickerReturnFormatFieldSetting);
2668
2669 /**
2670 * Color Picker Settings.
2671 *
2672 * @date 16/12/20
2673 * @since ACF 5.9.4
2674 *
2675 * @param object The object containing the extended variables and methods.
2676 * @return void
2677 */
2678 var ColorPickerReturnFormat = acf.FieldSetting.extend({
2679 type: 'color_picker',
2680 name: 'enable_opacity',
2681 render: function () {
2682 var $return_format_setting = this.fieldObject.$setting('return_format');
2683 var $default_value_setting = this.fieldObject.$setting('default_value');
2684 var $labelText = $return_format_setting.find('input[type="radio"][value="string"]').parent('label').contents().last();
2685 var $defaultPlaceholder = $default_value_setting.find('input[type="text"]');
2686 var l10n = acf.get('colorPickerL10n');
2687 if (this.field.val()) {
2688 $labelText.replaceWith(l10n.rgba_string);
2689 $defaultPlaceholder.attr('placeholder', 'rgba(255,255,255,0.8)');
2690 } else {
2691 $labelText.replaceWith(l10n.hex_string);
2692 $defaultPlaceholder.attr('placeholder', '#FFFFFF');
2693 }
2694 }
2695 });
2696 acf.registerFieldSetting(ColorPickerReturnFormat);
2697 })(jQuery);
2698
2699 /***/ }),
2700
2701 /***/ "./assets/src/js/_field-group.js":
2702 /*!***************************************!*\
2703 !*** ./assets/src/js/_field-group.js ***!
2704 \***************************************/
2705 /***/ (() => {
2706
2707 (function ($, undefined) {
2708 /**
2709 * fieldGroupManager
2710 *
2711 * Generic field group functionality
2712 *
2713 * @date 15/12/17
2714 * @since ACF 5.7.0
2715 *
2716 * @param void
2717 * @return void
2718 */
2719
2720 var fieldGroupManager = new acf.Model({
2721 id: 'fieldGroupManager',
2722 events: {
2723 'submit #post': 'onSubmit',
2724 'click a[href="#"]': 'onClick',
2725 'click .acf-delete-field-group': 'onClickDeleteFieldGroup',
2726 'blur input#title': 'validateTitle',
2727 'input input#title': 'validateTitle'
2728 },
2729 filters: {
2730 find_fields_args: 'filterFindFieldArgs',
2731 find_fields_selector: 'filterFindFieldsSelector'
2732 },
2733 initialize: function () {
2734 acf.addAction('prepare', this.maybeInitNewFieldGroup);
2735 acf.add_filter('select2_args', this.setBidirectionalSelect2Args);
2736 acf.add_filter('select2_ajax_data', this.setBidirectionalSelect2AjaxDataArgs);
2737 },
2738 setBidirectionalSelect2Args: function (args, $select, settings, field, instance) {
2739 if (field?.data?.('key') !== 'bidirectional_target') return args;
2740 args.dropdownCssClass = 'field-type-select-results';
2741
2742 // Check for a full modern version of select2 like the one provided by ACF.
2743 try {
2744 $.fn.select2.amd.require('select2/compat/dropdownCss');
2745 } catch (err) {
2746 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.');
2747 delete args.dropdownCssClass;
2748 }
2749 args.templateResult = function (selection) {
2750 if ('undefined' !== typeof selection.element) {
2751 return selection;
2752 }
2753 if (selection.children) {
2754 return selection.text;
2755 }
2756 if (selection.loading || selection.element && selection.element.nodeName === 'OPTGROUP') {
2757 var $selection = $('<span class="acf-selection"></span>');
2758 $selection.html(acf.escHtml(selection.text));
2759 return $selection;
2760 }
2761 if ('undefined' === typeof selection.human_field_type || 'undefined' === typeof selection.field_type || 'undefined' === typeof selection.this_field) {
2762 return selection.text;
2763 }
2764 var $selection = $('<i title="' + acf.escHtml(selection.human_field_type) + '" class="field-type-icon field-type-icon-' + acf.escHtml(selection.field_type.replaceAll('_', '-')) + '"></i><span class="acf-selection has-icon">' + acf.escHtml(selection.text) + '</span>');
2765 if (selection.this_field) {
2766 $selection.last().append('<span class="acf-select2-default-pill">' + acf.__('This Field') + '</span>');
2767 }
2768 $selection.data('element', selection.element);
2769 return $selection;
2770 };
2771 return args;
2772 },
2773 setBidirectionalSelect2AjaxDataArgs: function (data, args, $input, field, instance) {
2774 if (data.field_key !== 'bidirectional_target') return data;
2775 const $fieldObject = acf.findFieldObjects({
2776 child: field
2777 });
2778 const fieldObject = acf.getFieldObject($fieldObject);
2779 data.field_key = '_acf_bidirectional_target';
2780 data.parent_key = fieldObject.get('key');
2781 data.field_type = fieldObject.get('type');
2782
2783 // 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.
2784 data.post_type = acf.getField(acf.findFields({
2785 parent: $fieldObject,
2786 key: 'post_type'
2787 })).val();
2788 return data;
2789 },
2790 maybeInitNewFieldGroup: function () {
2791 let $field_list_wrapper = $('#acf-field-group-fields > .inside > .acf-field-list-wrap.acf-auto-add-field');
2792 if ($field_list_wrapper.length) {
2793 $('.acf-headerbar-actions .add-field').trigger('click');
2794 $('.acf-title-wrap #title').trigger('focus');
2795 }
2796 },
2797 onSubmit: function (e, $el) {
2798 // vars
2799 var $title = $('.acf-title-wrap #title');
2800
2801 // empty
2802 if (!$title.val()) {
2803 // prevent default
2804 e.preventDefault();
2805
2806 // unlock form
2807 acf.unlockForm($el);
2808
2809 // focus
2810 $title.trigger('focus');
2811 }
2812 },
2813 onClick: function (e) {
2814 e.preventDefault();
2815 },
2816 onClickDeleteFieldGroup: function (e, $el) {
2817 e.preventDefault();
2818 $el.addClass('-hover');
2819
2820 // Add confirmation tooltip.
2821 acf.newTooltip({
2822 confirm: true,
2823 target: $el,
2824 context: this,
2825 text: acf.__('Move field group to trash?'),
2826 confirm: function () {
2827 window.location.href = $el.attr('href');
2828 },
2829 cancel: function () {
2830 $el.removeClass('-hover');
2831 }
2832 });
2833 },
2834 validateTitle: function (e, $el) {
2835 let $submitButton = $('.acf-publish');
2836 if (!$el.val()) {
2837 $el.addClass('acf-input-error');
2838 $submitButton.addClass('disabled');
2839 $('.acf-publish').addClass('disabled');
2840 } else {
2841 $el.removeClass('acf-input-error');
2842 $submitButton.removeClass('disabled');
2843 $('.acf-publish').removeClass('disabled');
2844 }
2845 },
2846 filterFindFieldArgs: function (args) {
2847 args.visible = true;
2848 if (args.parent && (args.parent.hasClass('acf-field-object') || args.parent.hasClass('acf-browse-fields-modal-wrap') || args.parent.parents('.acf-field-object').length)) {
2849 args.visible = false;
2850 args.excludeSubFields = true;
2851 }
2852
2853 // If the field has any open subfields, don't exclude subfields as they're already being displayed.
2854 if (args.parent && args.parent.find('.acf-field-object.open').length) {
2855 args.excludeSubFields = false;
2856 }
2857 return args;
2858 },
2859 filterFindFieldsSelector: function (selector) {
2860 return selector + ', .acf-field-acf-field-group-settings-tabs';
2861 }
2862 });
2863
2864 /**
2865 * screenOptionsManager
2866 *
2867 * Screen options functionality
2868 *
2869 * @date 15/12/17
2870 * @since ACF 5.7.0
2871 *
2872 * @param void
2873 * @return void
2874 */
2875
2876 var screenOptionsManager = new acf.Model({
2877 id: 'screenOptionsManager',
2878 wait: 'prepare',
2879 events: {
2880 'change #acf-field-key-hide': 'onFieldKeysChange',
2881 'change #acf-field-settings-tabs': 'onFieldSettingsTabsChange',
2882 'change [name="screen_columns"]': 'render'
2883 },
2884 initialize: function () {
2885 // vars
2886 var $div = $('#adv-settings');
2887 var $append = $('#acf-append-show-on-screen');
2888
2889 // append
2890 $div.find('.metabox-prefs').append($append.html());
2891 $div.find('.metabox-prefs br').remove();
2892
2893 // clean up
2894 $append.remove();
2895
2896 // initialize
2897 this.$el = $('#screen-options-wrap');
2898
2899 // render
2900 this.render();
2901 },
2902 isFieldKeysChecked: function () {
2903 return this.$el.find('#acf-field-key-hide').prop('checked');
2904 },
2905 isFieldSettingsTabsChecked: function () {
2906 const $input = this.$el.find('#acf-field-settings-tabs');
2907
2908 // Screen option is hidden by filter.
2909 if (!$input.length) {
2910 return false;
2911 }
2912 return $input.prop('checked');
2913 },
2914 getSelectedColumnCount: function () {
2915 return this.$el.find('input[name="screen_columns"]:checked').val();
2916 },
2917 onFieldKeysChange: function (e, $el) {
2918 var val = this.isFieldKeysChecked() ? 1 : 0;
2919 acf.updateUserSetting('show_field_keys', val);
2920 this.render();
2921 },
2922 onFieldSettingsTabsChange: function () {
2923 const val = this.isFieldSettingsTabsChecked() ? 1 : 0;
2924 acf.updateUserSetting('show_field_settings_tabs', val);
2925 this.render();
2926 },
2927 render: function () {
2928 if (this.isFieldKeysChecked()) {
2929 $('#acf-field-group-fields').addClass('show-field-keys');
2930 } else {
2931 $('#acf-field-group-fields').removeClass('show-field-keys');
2932 }
2933 if (!this.isFieldSettingsTabsChecked()) {
2934 $('#acf-field-group-fields').addClass('hide-tabs');
2935 $('.acf-field-settings-main').removeClass('acf-hidden').prop('hidden', false);
2936 } else {
2937 $('#acf-field-group-fields').removeClass('hide-tabs');
2938 $('.acf-field-object').each(function () {
2939 const tabFields = acf.getFields({
2940 type: 'tab',
2941 parent: $(this),
2942 excludeSubFields: true,
2943 limit: 1
2944 });
2945 if (tabFields.length) {
2946 tabFields[0].tabs.set('initialized', false);
2947 }
2948 acf.doAction('show', $(this));
2949 });
2950 }
2951 if (this.getSelectedColumnCount() == 1) {
2952 $('body').removeClass('columns-2');
2953 $('body').addClass('columns-1');
2954 } else {
2955 $('body').removeClass('columns-1');
2956 $('body').addClass('columns-2');
2957 }
2958 }
2959 });
2960
2961 /**
2962 * appendFieldManager
2963 *
2964 * Appends fields together
2965 *
2966 * @date 15/12/17
2967 * @since ACF 5.7.0
2968 *
2969 * @param void
2970 * @return void
2971 */
2972
2973 var appendFieldManager = new acf.Model({
2974 actions: {
2975 new_field: 'onNewField'
2976 },
2977 onNewField: function (field) {
2978 // bail early if not append
2979 if (!field.has('append')) return;
2980
2981 // vars
2982 var append = field.get('append');
2983 var $sibling = field.$el.siblings('[data-name="' + append + '"]').first();
2984
2985 // bail early if no sibling
2986 if (!$sibling.length) return;
2987
2988 // ul
2989 var $div = $sibling.children('.acf-input');
2990 var $ul = $div.children('ul');
2991
2992 // create ul
2993 if (!$ul.length) {
2994 $div.wrapInner('<ul class="acf-hl"><li></li></ul>');
2995 $ul = $div.children('ul');
2996 }
2997
2998 // li
2999 var html = field.$('.acf-input').html();
3000 var $li = $('<li>' + html + '</li>');
3001 $ul.append($li);
3002 $ul.attr('data-cols', $ul.children().length);
3003
3004 // clean up
3005 field.remove();
3006 }
3007 });
3008 })(jQuery);
3009
3010 /***/ })
3011
3012 /******/ });
3013 /************************************************************************/
3014 /******/ // The module cache
3015 /******/ var __webpack_module_cache__ = {};
3016 /******/
3017 /******/ // The require function
3018 /******/ function __webpack_require__(moduleId) {
3019 /******/ // Check if module is in cache
3020 /******/ var cachedModule = __webpack_module_cache__[moduleId];
3021 /******/ if (cachedModule !== undefined) {
3022 /******/ return cachedModule.exports;
3023 /******/ }
3024 /******/ // Create a new module (and put it into the cache)
3025 /******/ var module = __webpack_module_cache__[moduleId] = {
3026 /******/ // no module.id needed
3027 /******/ // no module.loaded needed
3028 /******/ exports: {}
3029 /******/ };
3030 /******/
3031 /******/ // Execute the module function
3032 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
3033 /******/
3034 /******/ // Return the exports of the module
3035 /******/ return module.exports;
3036 /******/ }
3037 /******/
3038 /************************************************************************/
3039 /******/ /* webpack/runtime/compat get default export */
3040 /******/ (() => {
3041 /******/ // getDefaultExport function for compatibility with non-harmony modules
3042 /******/ __webpack_require__.n = (module) => {
3043 /******/ var getter = module && module.__esModule ?
3044 /******/ () => (module['default']) :
3045 /******/ () => (module);
3046 /******/ __webpack_require__.d(getter, { a: getter });
3047 /******/ return getter;
3048 /******/ };
3049 /******/ })();
3050 /******/
3051 /******/ /* webpack/runtime/define property getters */
3052 /******/ (() => {
3053 /******/ // define getter functions for harmony exports
3054 /******/ __webpack_require__.d = (exports, definition) => {
3055 /******/ for(var key in definition) {
3056 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
3057 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
3058 /******/ }
3059 /******/ }
3060 /******/ };
3061 /******/ })();
3062 /******/
3063 /******/ /* webpack/runtime/hasOwnProperty shorthand */
3064 /******/ (() => {
3065 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
3066 /******/ })();
3067 /******/
3068 /******/ /* webpack/runtime/make namespace object */
3069 /******/ (() => {
3070 /******/ // define __esModule on exports
3071 /******/ __webpack_require__.r = (exports) => {
3072 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
3073 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3074 /******/ }
3075 /******/ Object.defineProperty(exports, '__esModule', { value: true });
3076 /******/ };
3077 /******/ })();
3078 /******/
3079 /************************************************************************/
3080 var __webpack_exports__ = {};
3081 // This entry need to be wrapped in an IIFE because it need to be in strict mode.
3082 (() => {
3083 "use strict";
3084 /*!******************************************!*\
3085 !*** ./assets/src/js/acf-field-group.js ***!
3086 \******************************************/
3087 __webpack_require__.r(__webpack_exports__);
3088 /* harmony import */ var _field_group_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_field-group.js */ "./assets/src/js/_field-group.js");
3089 /* harmony import */ var _field_group_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_field_group_js__WEBPACK_IMPORTED_MODULE_0__);
3090 /* harmony import */ var _field_group_field_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_field-group-field.js */ "./assets/src/js/_field-group-field.js");
3091 /* harmony import */ var _field_group_field_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_field_group_field_js__WEBPACK_IMPORTED_MODULE_1__);
3092 /* harmony import */ var _field_group_settings_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_field-group-settings.js */ "./assets/src/js/_field-group-settings.js");
3093 /* harmony import */ var _field_group_settings_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_field_group_settings_js__WEBPACK_IMPORTED_MODULE_2__);
3094 /* harmony import */ var _field_group_conditions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_field-group-conditions.js */ "./assets/src/js/_field-group-conditions.js");
3095 /* harmony import */ var _field_group_conditions_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_field_group_conditions_js__WEBPACK_IMPORTED_MODULE_3__);
3096 /* harmony import */ var _field_group_fields_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_field-group-fields.js */ "./assets/src/js/_field-group-fields.js");
3097 /* harmony import */ var _field_group_fields_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_field_group_fields_js__WEBPACK_IMPORTED_MODULE_4__);
3098 /* harmony import */ var _field_group_locations_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_field-group-locations.js */ "./assets/src/js/_field-group-locations.js");
3099 /* harmony import */ var _field_group_locations_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_field_group_locations_js__WEBPACK_IMPORTED_MODULE_5__);
3100 /* harmony import */ var _field_group_compatibility_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_field-group-compatibility.js */ "./assets/src/js/_field-group-compatibility.js");
3101 /* harmony import */ var _field_group_compatibility_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_field_group_compatibility_js__WEBPACK_IMPORTED_MODULE_6__);
3102 /* harmony import */ var _browse_fields_modal_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./_browse-fields-modal.js */ "./assets/src/js/_browse-fields-modal.js");
3103 /* harmony import */ var _browse_fields_modal_js__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_browse_fields_modal_js__WEBPACK_IMPORTED_MODULE_7__);
3104
3105
3106
3107
3108
3109
3110
3111
3112 })();
3113
3114 /******/ })()
3115 ;
3116 //# sourceMappingURL=acf-field-group.js.map