ACMS.Dispatch.Edit._item=function(item,$unit){var Edit=this;$(".js-remove-unit",item).on("click",function(){if(confirm(ACMS.i18n("unit.message1"))){Edit._remove(item,$unit)}});var onToggle=function($button){if($button.attr("aria-expanded")==="true"){$button.data("acms-tooltip",ACMS.i18n("unit.message2"));$button.attr("aria-label",ACMS.i18n("unit.message2"));$button.find(".material-symbols-outlined").text("close_fullscreen")}else{$button.data("acms-tooltip",ACMS.i18n("unit.message3"));$button.attr("aria-label",ACMS.i18n("unit.message3"));$button.find(".material-symbols-outlined").text("open_in_full")}};$(".js-collapse-unit",item).on("click",function(event){event.stopImmediatePropagation();var $body=$(this).closest(ACMS.Config.unitFormEditorItemMark).find(ACMS.Config.unitFormEditorItemBodyMark);var nextStatus=$body.is(":hidden")?"Close":"Open";if(event.shiftKey){$(ACMS.Config.unitFormEditorItemMark,$unit).each(function(){var $button=$(this);var $item=$button.closest(ACMS.Config.unitFormEditorItemMark);var slide=nextStatus=="Close"?"slideDown":"slideUp";$(ACMS.Config.unitFormEditorItemBodyMark,this)[slide](function(){$button.attr("aria-expanded",nextStatus==="Close"?"true":"false");$item.attr("data-unit-collapsed",nextStatus==="Close"?"false":"true");onToggle($button)})})}else{var $button=$(this);var $item=$button.closest(ACMS.Config.unitFormEditorItemMark);$body.slideToggle("fast",function(){$button.attr("aria-expanded",nextStatus==="Close"?"true":"false");$item.attr("data-unit-collapsed",nextStatus==="Close"?"false":"true");onToggle($button)})}});var insertAddUnitParts=function(){var $tgt=$unit.$target;$tgt.hide().detach();$(item).after($tgt);$tgt.fadeIn("fast")};$(ACMS.Config.unitFormEditorItemHeadMark,item).on("dblclick",function(){insertAddUnitParts()});$(".js-add-unit-parts",item).on("click",function(){insertAddUnitParts()});$(ACMS.Config.fieldgroupSortableMark,item).each(function(){ACMS.Dispatch.fieldgroupSortable(this)})};