"use strict";(function(){// app/javascript/src/javascripts/index.js var params=new URL(document.location).searchParams;var frameName=params.get("name")||"";var eventName=params.get("event_name")||"";var frameType=params.get("type")||"";$(".custom-select").each(function(){var url=new URL(document.location);var params2=url.searchParams;var fieldText;if(params2.get($(this).attr("id"))===null||params2.get($(this).attr("id"))===""){fieldText=$(this).attr("placeholder")}else fieldText=params2.get($(this).attr("id")).charAt(0).toUpperCase()+params2.get($(this).attr("id")).slice(1);$(this).val(params2.get($(this).attr("id"))).prop("selected",true);var classes=$(this).attr("class"),id=$(this).attr("id"),name=$(this).attr("name");var template="
";template+=""+fieldText.replace("_"," ")+"";template+="
";$(this).find("option").each(function(){template+=""+$(this).html()+""});template+="
";$(this).wrap("
");$(this).hide();$(this).after(template)});$(".custom-option:first-of-type").hover(function(){$(this).parents(".custom-options").addClass("option-hover")},function(){$(this).parents(".custom-options").removeClass("option-hover")});$(".form__filters-title").on("click",function(){$(".custom-select-wrapper").css("z-index","100");$("html").one("click",function(){$(".custom-select").removeClass("opened");$(".custom-select-wrapper").css("z-index","100")});if($(this).css("cursor")==="not-allowed")return;$(this).find(".custom-select").toggleClass("opened");$(this).find(".custom-select-wrapper").css("z-index","200");event.stopPropagation()});$(".custom-option").on("click",function(){event.stopPropagation();var selection=$(this).data("value");var validDisableSelections=["basic","carousel","special","ranked","monthly"];$(".custom-select-wrapper").css("z-index","100");if(validDisableSelections.includes(selection)){$("#disableable--event_name").css("cursor","not-allowed");$("#disableable--event_year").css("cursor","not-allowed");$("#event_name .custom-select-trigger").css("pointer-events","none");$("#event_year .custom-select-trigger").css("pointer-events","none");$(".custom-select").each(function(){$(this).val("").prop("selected",true);$(this).children(".custom-select-trigger").html("Any")})}else{$("#disableable--event_name").css("cursor","pointer");$("#disableable--event_year").css("cursor","pointer");$("#event_name .custom-select-trigger").css("pointer-events","all");$("#event_year .custom-select-trigger").css("pointer-events","all")}$(this).parents(".custom-select-wrapper").find("select").val(selection);$(this).parents(".custom-options").find(".custom-option").removeClass("selection");$(this).addClass("selection");$("div.custom-select.opened").removeClass("opened");$(this).parents(".custom-select").find(".custom-select-trigger").text($(this).text())});$(document).ready(function(){$(".field__input").val(frameName);$("#event_name").val(eventName);$("#type-sel").val(frameType);if(frameType!==null&&frameType!==""&&frameType!=="event"){$("#disableable--event_name").css("cursor","not-allowed");$("#disableable--event_year").css("cursor","not-allowed");$("#event_name .custom-select-trigger").css("pointer-events","none");$("#event_year .custom-select-trigger").css("pointer-events","none")}});$(document).on("click",".form__filters-buttons--clear",function(){$(".custom-select").each(function(){$(this).val("").prop("selected",true);$(this).children(".custom-options").find(".custom-option").removeClass("selection");$(this).children(".custom-select-trigger").html("Any");$("#disableable--event_name").css("cursor","pointer");$("#disableable--event_year").css("cursor","pointer");$("#event_name .custom-select-trigger").css("pointer-events","all");$("#event_year .custom-select-trigger").css("pointer-events","all")})});$("#toggle").click(function(){$("#hide").toggle()})})(); //# sourceMappingURL=kf_index.jsout-103b27905b94f58fb0552755bade011b4ae1dbdb4afcb0362b42d67f66c2175e.map