!function(){"use strict";jQuery(document).on("contentloaded",function(t){var e=jQuery(t.target);e.find(".field[data-trigger]").each(function(t,n){var a=jQuery(n),i=a.attr("data-trigger"),r=a.find("input"),c=e.find("[data-trigger-name="+i+"]");if(r.length&&c.length){var d=function(){c.removeClass("selected");var t=r.filter(":checked").val()||0;c.filter('[data-trigger-value="'+t+'"]').addClass("selected")};r.on("change",d),d()}})})}(),function(){"use strict";jQuery(document).on("contentloaded",function(t){var e=jQuery(t.target),n=e.find(".collision.vehicle .damages"),a=n.find(".scheme svg"),i=n.find(".field"),r=n.find("ol.selection"),c=n.data("selectionRemoveText"),d=function(t){var e=jQuery("#"+t),n=e.find("title").text(),a=jQuery("<li>"+n+'<button class="remove" type="button" title="'+c+'"><span class="text">'+c+"</button></li>");a.data("partId",t),r.append(a)},o=function(t){r.find("li").filter(function(){return jQuery(this).data("partId")==t}).remove()},l=function(){a.on("part:toggle",".part[id]",function(t,e){var n=jQuery(t.target),a=n.attr("id");void 0===e&&(e=!n.is(".selected")),n.toggleClass("selected",e),i.filter('[data-name="'+a+'_damage"]').find("input").prop("checked",e),e?d(a):o(a)}),a.on("part:select",".part[id]",function(t){jQuery(t.target).trigger("part:toggle",!0)}),a.on("part:deselect",".part[id]",function(t){jQuery(t.target).trigger("part:toggle",!1)}),a.on("click",".part[id]",function(t){jQuery(this).trigger("part:toggle")}),n.on("change",'input[type="checkbox"]',function(t){var e=jQuery(this).closest(".field").data("name").replace("_damage","");jQuery("#"+e).click()}),n.on("click","button.remove",function(t){var e=jQuery(this).closest("li");jQuery("#"+e.data("partId")).trigger("part:deselect")})};!function(){r.length||(r=jQuery('<ol class="selection">'),n.append(r)),a.find(".part[id]").each(function(){var t=jQuery(this),e=t.attr("id"),n=i.filter('[data-name="'+e+'_damage"]').find("label").text();if(n&&!t.find("title").length){var a=document.createElementNS("http://www.w3.org/2000/svg","title");jQuery(a).text(n).appendTo(t)}}),l(),i.find("input:checked").trigger("change")}()})}();