1 2{ 3 const form = document.querySelector(".contact-form"); 4 5 const inquirySelect = form?.querySelector( 6 'select[name="inquiry_category"]' 7 ); 8 9 const inquiryRadioList = form?.querySelector( 10 'input[name="inquiry_detail"]' 11 )?.closest("ul"); 12 13 if (inquirySelect && inquiryRadioList) { 14 15 const inquiryOptions = { 16 "": [], 17 18 "建è¨ãµã¼ãã¹ã«é¢ãã¦": [ 19 "æè¡ã»ãµã¼ãã¹ã«ã¤ãã¦", 20 "æ å ±æä¾", 21 "æ¡ç¨ã«ã¤ãã¦", 22 "ãã®ä»", 23 ], 24 25 "é²ç½å®å ¨ãµã¼ãã¹ã«é¢ãã¦": [ 26 "æè¡ã»ãµã¼ãã¹ã«ã¤ãã¦", 27 "ECãµã¤ãã«ã¤ãã¦", 28 "æ å ±æä¾", 29 "æ¡ç¨ã«ã¤ãã¦", 30 "ãã®ä»", 31 ], 32 33 "ããããã¼ãã«é¢ãã¦": [ 34 "æè¡ã»ãµã¼ãã¹ã«ã¤ãã¦", 35 "æ å ±æä¾", 36 "æ¡ç¨ã«ã¤ãã¦", 37 "ãã®ä»", 38 ], 39 40 "æ¡ç¨ã«é¢ãã¦": [ 41 "æ¡ç¨ã«ã¤ãã¦", 42 "å人æ å ±ä¿è·ã«é¢ãããåãåãã", 43 "ãã®ä»", 44 ], 45 46 "IRã«é¢ãã¦": [ 47 "IR", 48 ], 49 50 "ãã®ä»": [ 51 "ãã®ä»", 52 ], 53 }; 54 55 const updateInquiryRadioList = (reset = false) => { 56 57 const selectedValue = inquirySelect.value; 58 59 const visibleOptions = 60 inquiryOptions[selectedValue] || []; 61 62 // Limpar seleção quando o select mudar 63 if (reset) { 64 inquiryRadioList 65 .querySelectorAll('input[name="inquiry_detail"]') 66 .forEach((radio) => { 67 radio.checked = false; 68 }); 69 } 70 71 inquiryRadioList.querySelectorAll("li").forEach((li) => { 72 73 const text = li.querySelector(".txt") 74 ?.textContent.trim(); 75 76 if (visibleOptions.includes(text)) { 77 li.style.display = ""; 78 } else { 79 li.style.display = "none"; 80 81 const radio = li.querySelector( 82 'input[name="inquiry_detail"]' 83 ); 84 85 if (radio) { 86 radio.checked = false; 87 } 88 } 89 }); 90 91 inquiryRadioList.style.display = 92 visibleOptions.length > 0 ? "flex" : "none"; 93 94 // Ocultar a mensagem quando o campo estiver escondido 95 const wrap = inquiryRadioList.closest( 96 ".wpcf7-form-control-wrap" 97 ); 98 99 const errorMessage = wrap?.querySelector( 100 ".wpcf7-not-valid-tip" 101 ); 102 103 if (errorMessage) { 104 errorMessage.style.display = 105 visibleOptions.length > 0 ? "" : "none"; 106 } 107 }; 108 109 inquirySelect.addEventListener("change", () => { 110 updateInquiryRadioList(true); 111 }); 112 113 updateInquiryRadioList(); 114 } 115} 116 117
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.