PageSourceSearch

https://kanoiwa-hospital.or.jp/wp-content/themes/theme/js/base.js?ver=582e2b37179cdb3546376e610cac1b18

js kanoiwa-hospital.or.jp collected 2026-09-25 04:39:49 UTC 50,129 bytes, 1,246 lines download raw bytes

1// JavaScript Document
2// 管理画面では、$はjQueryでないとエラーが出る。
3//jQuery(function() {
4window.addEventListener('DOMContentLoaded', function() {
5    var bln_click_num = 0; //バルーンクリックチェック用 2015.05.13追加
6    var player; //Youtube Player 2015.5.21追加
7    var ua = navigator.userAgent;
8
9    if ((ua.indexOf('iPhone') > -1
10        || (ua.indexOf('Android') > -1
11            && ua.indexOf('Mobile') > -1))
12        && window.innerWidth >= 481) {
13        Object.defineProperty(navigator, 'userAgent', {
14            get: function () { return 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'; }
15        });
16    }
17
18    //編集の範囲を表示する
19    jQuery(".edit_link").on('mouseover', function(){
20        jQuery(this).parent().css({
21            'cssText': 'border: 2px #F00 dashed !important; box-sizing: border-box;'
22        });
23    });
24
25    jQuery(".edit_link").on('mouseout', function(){
26        jQuery(this).parent().css({
27            'cssText': 'border: none;'
28        });
29    });
30
31    jQuery(".edit_link_h").on('mouseover', function(){
32        jQuery(this).parent().css({
33            'cssText': 'border: 2px #F00 dashed !important; box-sizing: border-box;'
34        });
35    });
36
37    jQuery(".edit_link_h").on('mouseout', function(){
38        jQuery(this).parent().css({
39            'cssText': 'border: none;'
40        });
41    });
42
43    jQuery(".edit_link_s").on('mouseover', function(){
44        jQuery(this).parent().css({
45            'cssText': 'border: 2px #F00 dashed !important; box-sizing: border-box;'
46        });
47    });
48
49    jQuery(".edit_link_s").on('mouseout', function(){
50        $(this).parent().css({
51            'cssText': 'border: none;'
52        });
53    });
54
55    //説明用バルーンの表示 2015.05.13追加
56    if(jQuery("input[name='assist']").val()==1) {
57        bln_click_num = 0;
58
59        //A
60        jQuery("#wpadminbar").append("<div id='bln_manual' class='balloon topright_balloon'>操作に関するマニュアルはこちらの特設サイトをご活用ください。<img class='ico_close' src='wp-content/themes/theme/img/ico_close.png' /></div><div class='clear_balloon'></div>");
61        //B
62        jQuery("#gNav.editover").append("<div id='bln_navi' class='balloon topright_balloon'>修正したいページに飛んでいただき、タイトルをにマウスポインタをあてると、編集パネルが出現し、修正ができます。<img class='ico_close' src='wp-content/themes/theme/img/ico_close.png' /></div><div class='clear_balloon'></div>");
63        //C
64        jQuery("#wpadminbar").append("<div id='bln_icon' class='balloon topleft_balloon'>このアイコンをクリックすると、管理ページにジャンプします。アクセスの動向や新規のページ追加などができます。<img class='ico_close' src='wp-content/themes/theme/img/ico_close.png' /></div><div class='clear_balloon'></div>");
65
66        jQuery(".infoSec.editover").append("<div class='balloon blnpos_middle left_balloon'>ログイン状態で編集をしたいエリアのタイトルにマウスポインタをあてると、編集バーが出現し追加・修正ができます<img class='ico_close' src='wp-content/themes/theme/img/ico_close.png' /></div><div class='clear_balloon'></div>");
67        //説明用バルーンの消去
68        jQuery(".balloon").on('click', function(){
69            $(this).fadeOut("slow");
70            checkBalloon();
71        });
72    }
73
74    /**** 管理画面表示コントロール ****/ //2015.04.01追加
75    url = location.href;
76    filename = url.match(".+/(.+?)([\?#;].*)?$")[1];
77    param = GetQueryString();
78
79    //Contact Par Dayのタイトル変更
80    if(jQuery('#cpd-metaboxes h2')) {
81        objImg = jQuery('#cpd-metaboxes h2 img');
82
83        //2019.12.11 change start
84        //jQuery('#cpd-metaboxes h2').text('');
85        //jQuery('#cpd-metaboxes h2').append(objImg);
86        //jQuery('#cpd-metaboxes h2').append(' アクセス状況');
87        objCpdTitle = jQuery('#cpd-metaboxes h2').first();
88        objCpdTitle.text('');
89        objCpdTitle.append(objImg);
90        objCpdTitle.append(' アクセス状況');
91        //2019.12.11 change end
92    }
93
94    //診療時間の表リストメニュー変更 2015.4.30追加
95    if(jQuery('.column-table_name .row-actions')) {
96        jQuery('.column-table_name .row-actions .copy').css("display", "none");
97        jQuery('.column-table_name .row-actions .delete').css("display", "none");
98    }
99    //診療時間の表タイトル変更
100    if(jQuery('#tablepress-nav')) {
101        // 2019.12.11 change
102        // jQuery('#tablepress-nav').text('診療時間の表');
103        jQuery('#tablepress-nav').html('<h1>診療時間の表</h1>');
104    }
105    //診療時間の表ようこそ!(アップデート情報?)消す
106    if(jQuery('#tablepress-page') && jQuery('.updated')) {
107        jQuery('.updated').css('display', 'none');
108    }
109    //2019.12.11 add start
110    //診療時間の表ようこそ!(アップデート情報?)消す
111    if(jQuery('#tablepress-page') && jQuery('.notice')) {
112        jQuery('.notice').css('display', 'none');
113    }
114    //2019.12.11 add end
115    //診療時間の表テーブル情報消す 2015.5.8追加
116    if(jQuery('#tablepress_edit-table-information')) {
117        jQuery('#tablepress_edit-table-information').css('display', 'none');
118    }
119    //診療時間説明文消す
120    if(jQuery('#postbox-container-2')) {
121        jQuery('#postbox-container-2 p:eq(0)').css("display", "none");
122        jQuery('#postbox-container-2 p:eq(1)').css("display", "none");
123        jQuery('#tablepress_edit-table-options').css("display", "none");
124        jQuery('#tablepress_edit-datatables-features').css("display", "none");
125        jQuery('#postbox-container-2 p.submit:last').css("display", "none"); // 2015.4.30追加
126    }
127
128    //2018.04.18 add
129    //simple Map , Duplicate Post の警告が表示されてしまうため、一時的に表示(暫定対応)
130    if(jQuery('.is-dismissible')) {
131        jQuery('.is-dismissible').css("display", "none");
132    }
133
134    //メニュー編集の「位置の管理」消す
135    if(filename == 'nav-menus.php') {
136        jQuery('h2.nav-tab-wrapper .nav-tab:eq(1)').css("display", "none");
137
138        //2018.08.13 add
139        //「リンクを新ウィンドウまたはタブで開く」のチェックボックスを表示させる
140        jQuery('p.field-link-target').removeClass("hidden-field");
141
142        setManualNavMenu(); //2015.05.13追加
143    }
144
145    //メニュー編集画面にマニュアルのリンクを追加 2015.05.13追加
146    function setManualNavMenu() {
147        strMetaBox = '<div id="manual_meta_post_page" class="postbox" style="margin-top: 15px;" >\n';
148        strMetaBox = strMetaBox + '<div class="handlediv" title="クリックで切替"><br /></div>\n';
149        strMetaBox = strMetaBox + '<h3 class="hndle"><span>この画面の操作方法</span></h3>\n';
150        strMetaBox = strMetaBox + '<div class="inside">\n';
151        strMetaBox = strMetaBox + '<ul>\n';
152        //マニュアルはここを追加↓↓↓
153        strMetaBox = strMetaBox + '<li><a href="http://manual.wevery.jp/?p=152" target="_blank">メニューからページを削除する</a></li>\n';
154        strMetaBox = strMetaBox + '<li><a href="http://manual.wevery.jp/?p=68" target="_blank">新しくメニューを作る</a></li>\n';
155        strMetaBox = strMetaBox + '<li><a href="http://manual.wevery.jp/?p=62" target="_blank">サイドメニューの並び順を変更する</a></li>\n';
156        strMetaBox = strMetaBox + '<li><a href="http://manual.wevery.jp/?p=60" target="_blank">メニューの項目の並び順を変更する</a></li>\n';
157        strMetaBox = strMetaBox + '<li><a href="http://manual.wevery.jp/?p=51" target="_blank">メニューにページを追加する</a></li>\n';
158        //マニュアルはここを追加↑↑↑
159        strMetaBox = strMetaBox + '</ul>\n';
160        strMetaBox = strMetaBox + '</div>\n';
161        strMetaBox = strMetaBox + '</div>\n';
162
163        jQuery('#menu-settings-column').append(strMetaBox);
164    }
165    
166    jQuery("#mf_3").css("display", "none");
167    jQuery("#list_display_method").insertAfter("#expirationdatediv");
168
169    // トップページ内容編集のMagic Fieldをタイトル下に表示する
170    if(jQuery( '#mf_4' )) {
171        jQuery( '#mf_4' ).insertBefore( '#edit-slug-box' );
172        jQuery( '#mf_4 .hndle' ).css( 'height', '0' );
173        jQuery( '#mf_4 .hndle' ).css( 'display', 'none' );
174    }
175
176    // トップページ内容編集の「表示位置」を表示期限の上に表示する 2015.05.11 add
177    if(jQuery( '#mf_5' )) {
178        jQuery( '#mf_5' ).insertBefore( '#expirationdatediv' );
179    }
180
181    //サイドメニューバナーのMF項目整備
182    if(jQuery('#mf_1')) {
183        jQuery('#mf_1 .hndle').css('display', 'none');
184        jQuery('#mf_1 .field-banner_url').css('width', '80%');
185        jQuery('#mf_1 .field-banner_url .mf-field-title').css('float', 'left');
186        jQuery('#mf_1 .field-banner_url .mf-field-title').next('.clear').remove();
187        jQuery('#mf_1 .field-banner_url .text_field_mf').css('float', 'left');
188        jQuery('#mf_1 .field-banner_url .text_field_mf').css('width', '60%');
189        jQuery('#mf_1 .field-banner_url .text_field_mf input').css('width', '100%');
190        jQuery('#mf_1 .field-banner_target').css('position', 'relative');
191        jQuery('#mf_1 .field-banner_target div:eq(3)').css('position', 'absolute');
192        jQuery('#mf_1 .field-banner_target div:eq(3)').css('top', '0');
193        jQuery('#mf_1 .field-banner_target div:eq(3)').css('left', '0');
194        jQuery('#mf_1 .field-banner_target .mf-field-title').css('padding-left', '30px');
195    }
196
197    //2018.07.05 add
198    //リビジョン(過去の内容)
199    var revisionText = jQuery(".alignright").children("label").html();
200    //2019.12.11 change エラー回避
201    //if(revisionText){
202    if(typeof revisionText != "undefined"){
203        var revisionText = revisionText.replace("リビジョンコントロール:", "");
204        var revisionText = revisionText.replace(/最大 [0-9]{1,} 個のリビジョンを保存します/, "");
205    }
206    jQuery(".alignright").children("label").html(revisionText);
207
208
209
210    if(!param) { return; }
211
212    //管理画面でのバルーン消す 2015.05.13追加
213    if(param['page'] == 'wevery-admin-menu/wv.php') {
214        jQuery('.balloon').css('display', 'none');
215    }
216
217    //Meta Sliderの表示変更・アップグレード・ソーシャル・「スライダー削除」消す
218    //2018.07.05 change add
219    //初期画面もしくはid=133の場合は、非表示にする
220    //if(param['page'] == 'metaslider') {
221    //    jQuery('#screen-options-link-wrap').text("");
222    //    jQuery('#screen-options-link-wrap').css("border", "none");
223    //
224    //    jQuery('#screen-options-switch-view-wrap').text("");
225    //    jQuery('#screen-options-switch-view-wrap').css("border", "none");
226    //
227    //    jQuery('#metaslider_social').css("display", "none");
228    //
229    //    jQuery('.delete-slider').css("display", "none");
230    //}
231    if(param['page'] == 'metaslider') {
232        if(!param['id'] || param['id'] == 133){
233            jQuery('#screen-options-link-wrap').text("");
234            jQuery('#screen-options-link-wrap').css("border", "none");
235
236            jQuery('#screen-options-switch-view-wrap').text("");
237            jQuery('#screen-options-switch-view-wrap').css("border", "none");
238
239            jQuery('#metaslider_social').css("display", "none");
240        }
241        //使い方のPHPタグ記述部分削除
242        var sliderText = jQuery('pre#ms-entire-code').html();
243        // 2019.12.11 change start エラー回避
244        // sliderText = sliderText.replace("&lt;?php echo do_shortcode('<br>","");
245        // sliderText = sliderText.replace("'); ?&gt;","");
246        if(typeof sliderText != "undefined"){
247            sliderText = sliderText.replace("&lt;?php echo do_shortcode('<br>","");
248            sliderText = sliderText.replace("'); ?&gt;","");
249        }
250        // メタスライダー新バージョン警告を非表示
251        jQuery('div.warning').css('display','none');
252        // 2019.12.11 change end
253
254        jQuery('pre#ms-entire-code').html(sliderText);
255    }
256
257    //2018.07.05 change end
258
259    //Meta Managerの「サイドワイド設定」・「タクソノミー設定」・Powered by削除
260    //タイトル変更
261    if(param['page'] == 'meta-manager.php') {
262        jQuery('#wpbody-content h2').text("metaタグの設定");
263
264        jQuery('#wpbody-content h3:eq(0)').css("display", "none");
265        jQuery('#wpbody-content h3:eq(2)').css("display", "none");
266
267        jQuery('#wpbody-content .form-table:eq(1) tr:eq(0)').css("display", "none");
268        jQuery('#wpbody-content .form-table:eq(2)').css("display", "none");
269
270        jQuery('#wpbody-content #developper_information').css("display", "none");
271    }
272
273    //2018.07.05 add
274    //共通タグ・トップページコンテンツ画面にもメッセージを追加する
275    //2015.05.20 add
276    //サイドメニューバナー画面へメッセージ追加
277    //if(param['post_type'] == 'side_banner') {
278    if(param['post_type'] == 'side_banner' || param['post_type'] == 'toppage') {
279        jQuery( '<p id=side_msg>ドラッグ&ドロップで順番の並び替えができます。</p>' ).insertAfter( '.wp-list-table #title a' );
280        jQuery('#side_msg').css("color", "red");
281        jQuery('#side_msg').css("margin-top", "-5px");
282        jQuery('#side_msg').css("margin-bottom", "3px");
283        jQuery('#side_msg').css("margin-left", "7px");
284    }
285
286
287    //Ultimate Google Analyticsの「Check for updates」・「Enable tracker」・「Advanced configuration」削除
288    //タイトル変更
289    regTxt = /ultimate_ga.+/;
290    if(regTxt.test(param['page'])) {
291        jQuery('#wpbody-content h2').text("Googleアナリティクス");
292        objInput = jQuery('input[name="account_id"]');
293
294        jQuery('.editform tr:eq(0) td').text("");
295        jQuery('.editform tr:eq(0) td').append(objInput);
296        jQuery('.editform tr:eq(0) td').append("<br />");
297        //2018.07.05 change
298        //jQuery('.editform tr:eq(0) td').append("Googleアナリティクス測定ID・アカウントIDを入力してください。埋め込みコードは必要ありません。");
299        //2021.01.25 change G-にも対応
300        //jQuery('.editform tr:eq(0) td').append("UA-○○○○○○の形で、Googleアナリティクス測定ID・アカウントIDを入力してください。埋め込みコードは必要ありません。");
301        jQuery('.editform tr:eq(0) td').append("G-○○○○○ または UA-○○○○○の形で、Googleアナリティクス測定ID・アカウントIDを入力してください。埋め込みコードは必要ありません。");
302        jQuery('.editform tr:eq(0) td').append("<br />");
303        jQuery('.editform tr:eq(0) td').append("※設置方法については<a href=\"https://manual.wevery.jp/?p=728\" target=\"_blank\" rel=\"noopener noreferrer\">こちらの操作マニュアル</a>をご覧ください。");
304    }
305
306    //URLからパラメータを取得
307    function GetQueryString() {
308        if (1 < document.location.search.length) {
309            // 最初の1文字 (?記号) を除いた文字列を取得する
310            var query = document.location.search.substring(1);
311
312            // クエリの区切り記号 (&) で文字列を配列に分割する
313            var parameters = query.split('&');
314
315            var result = new Object();
316            for (var i = 0; i < parameters.length; i++) {
317                // パラメータ名とパラメータ値に分割する
318                var element = parameters[i].split('=');
319
320                var paramName = decodeURIComponent(element[0]);
321                var paramValue = decodeURIComponent(element[1]);
322
323                // パラメータ名をキーとして連想配列に追加する
324                result[paramName] = decodeURIComponent(paramValue);
325            }
326            return result;
327        }
328        return null;
329    }
330
331    //バルーンの消した数をチェック 2015.05.13追加
332    function checkBalloon() {
333        bln_click_num++;
334
335        if(bln_click_num < jQuery(".balloon").length) {
336            return;
337        }
338
339        changeAssist(0);
340    }
341
342    //アシスト表示設定変更 2015.05.13追加
343    //assist_val 0:OFF 1:ON
344    function changeAssist(assist_val) {
345        option_data = 'option_val='+assist_val+'&option_name=assist';
346
347        $.ajax({
348                type: "POST",
349                url: "wp-content/themes/theme/change_assist.php",
350                data: option_data
351        });
352    }
353
354    //2018.07.05 add start
355    //GetPremium ボタン消去
356    jQuery('.imgevr-get-premium').css('display', 'none');
357
358
359    //メタ情報の削除
360    var pageTitle = jQuery('h2').html();
361    var deleteTitle = ["コンテンツ内容編集", "共通コード・ショートコードを編集する"];
362    var deleteParam = ["toppage", "script_writing"];
363    var isSearchPage = "s" in param;
364    if(pageTitle) {
365        for(var val = 0; val < deleteParam.length; val++){
366            if(param['post_type'] == deleteParam[val] || pageTitle.indexOf(deleteTitle[val]) != -1){
367                jQuery("#post_meta_box").remove();
368            }
369        }
370    }
371
372    //magic fieldの文言変更
373    var magicCodeTitle = jQuery("#mf_6").children(".hndle").children("span").text();
374    if(magicCodeTitle == "Magic Fields") {
375        jQuery("#mf_6").children(".hndle").children("span").text("コード等を記載");
376    }
377
378    //診療時間の表ページ
379    if(param['page'] == "tablepress") {
380        var path = location.pathname;
381        path = path.replace("/wp-admin/admin.php","");
382        //リンクの追加
383        jQuery('#normal-sortables').before('<a href="'+path+'/wp-admin/admin.php?page=wevery-admin-menu/wv.php#basic_info">診療時間の備考や休診日の設定はこちらへ</a>');
384
385        //お問い合わせ表示の削除
386        jQuery('#footer-left').remove();
387    }
388    //診療時間の表ページからクリニックの基本情報に遷移した場合のみ、診療時間項目にジャンプする
389    if(param['page'] == "wevery-admin-menu/wv.php") {
390        var pageHash = location.hash;
391        if(pageHash){
392            location.href = "#meditime";
393        }
394    }
395
396    //2018.07.05 add end
397
398    //2018.11.06 add start
399    //meta情報の入力部にサムネイル画像の選択フォームを追加
400    if(pageTitle && !isSearchPage) {
401        //2022.04.11 change
402        //postMetaBox = '<dt>サムネイル画像</dt>';
403        postMetaBox = '<dt>Google検索用サムネイル画像</dt>';
404        postMetaBox = postMetaBox + '<dd>';
405        postMetaBox = postMetaBox + '<input type="button" name="meta_media" value="選択">';
406        postMetaBox = postMetaBox + '<input type="button" name="meta_media_clear" value="クリア">';
407        postMetaBox = postMetaBox + '</dd>';
408        postMetaBox = postMetaBox + '<div id="meta_thumbnail">';
409        postMetaBox = postMetaBox + '<img id="meta_thumbnail_img" />';
410        postMetaBox = postMetaBox + '<input type="hidden" id="thumbnail" name="thumbnail"></div>';
411
412        jQuery(postMetaBox).appendTo('#post_meta_box .inside');
413        var meta_thumbnail_img = jQuery("#thumbnail_url").val();
414        jQuery("#post_meta_box #meta_thumbnail_img").attr("src", meta_thumbnail_img);
415        jQuery("#post_meta_box #thumbnail").val(meta_thumbnail_img);
416    }
417
418    var custom_uploader;
419    jQuery("input:button[name=meta_media]").on('click', function(e) {
420        e.preventDefault();
421        if (custom_uploader) {
422            custom_uploader.open();
423            return;
424        }
425
426        custom_uploader = wp.media({
427            title: "画像を選択",
428            //ライブラリの一覧は画像のみにする
429            library: {
430                type: "image"
431            },
432            button: {
433                text: "選択"
434            },
435            //選択できる画像は 1 つだけにする
436            multiple: false
437        });
438
439        custom_uploader.on("select", function() {
440            var images = custom_uploader.state().get("selection");
441
442            //file の中に選択された画像の各種情報が入っている
443            images.each(function(file){
444
445                //hiddenフォームと表示されたサムネイル画像があればクリア
446                jQuery("input:hidden[name=thumbnail]").val("");
447                jQuery("#meta_media").empty();
448                jQuery("#meta_thumbnail_img").val("");
449                jQuery("#meta_thumbnail").empty();
450
451                //hiddenフォームに画像の URL を表示
452                //jQuery("input:hidden[name=thumbnail]").val(file.attributes.sizes.thumbnail.url);
453                var thumbnail_url = file.attributes.sizes.thumbnail.url;
454                jQuery("<input>", {type: "hidden", id: "thumbnail", name: "thumbnail"}).val(thumbnail_url).appendTo("#meta_thumbnail");
455
456                //選択されたサムネイル画像を表示
457                //var imgUrl = <?php //echo update_post_meta( $post_id, '_post_thumbnail' ); ?>
458                jQuery("<img>").attr("src", thumbnail_url).appendTo("#meta_thumbnail");
459
460            });
461        });
462        custom_uploader.open();
463
464    });
465
466    //クリアボタンを押した時の処理
467    jQuery("input:button[name=meta_media_clear]").on('click', function() {
468        //hiddenフォームと表示されたサムネイル画像があればクリア
469        jQuery("input:hidden[name=thumbnail]").val("");
470        jQuery("#meta_thumbnail_img").val("");
471        jQuery("#meta_media").empty();
472        jQuery("#meta_thumbnail").empty();
473    });
474    //2018.11.06 add end
475
476
477    ////////////////////////////////////////
478    // Youtube表示 2015.5.21追加
479    ////////////////////////////////////////
480    //YouTube iFrame Player API
481    var tag=document.createElement('script');
482    tag.src="//www.youtube.com/iframe_api";
483    var firstScriptTag=document.getElementsByTagName('script')[0];
484    firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
485
486    /* プレーヤーの準備完了時 */
487    window.onYouTubeIframeAPIReady=function() {
488        if(jQuery('[name="movie_play"]').val()==1 && param['movie_on']) {
489            $('#mov_intro').css('display', 'block');
490        } else {
491            return;
492        }
493
494        player = new YT.Player(
495            'player',{
496                width: '768',    /* 動画プレーヤーの幅 */
497                height: '468',    /* 動画プレーヤーの高さ */
498                videoId: 'Z5CK1GlqaOg',    /* YouTube動画ID */
499                playerVars: {
500                    autoplay: 1,
501                    rel: 0
502                },
503                events: { /* イベント */
504                    "onReady": onPlayerReady,    /* プレーヤの準備完了時 */
505                    "onStateChange": onPlayerStateChange   /* プレーヤの状態が変化した時 */
506                }
507            }
508        );
509    }
510
511    function movFadeOut() {
512        $('#mov_intro').fadeOut(1000);
513
514        //動画表示OFF
515        option_data = 'option_val=0&option_name=movie_play';
516
517        $.ajax({
518            type: "POST",
519            url: "wp-content/themes/theme/change_assist.php",
520            data: option_data
521        });
522    }
523
524    function onPlayerReady(event){
525        event.target.setVolume(50);    /* 音量調整 */
526    }
527
528    function onPlayerStateChange(event){
529        if(event.data == 0) {
530            setTimeout(movFadeOut, 500);
531        }
532    }
533
534    jQuery('#mov_intro .ico_close').on('click', function(){
535        player.stopVideo();
536        movFadeOut();
537    });
538
539
540//    //--------------------------------------------
541//    //ページ内スクロールを全てスムーズに
542//    //--------------------------------------------
543//    // スクロールのオフセット値
544//    var offsetY = -10;
545//    // スクロールにかかる時間
546//    var time = 500;
547//
548//    // ページ内リンクのみを取得
549//    jQuery('a[href^=#]').on('click', function() {
550//        // 移動先となる要素を取得
551//        var target = $(this.hash);
552//        if (!target.length) return ;
553//
554//        //var target = jQuery(this.hash);
555//
556//        // 移動先となる値
557//        var targetY = target.offset().top+offsetY;
558//        // スクロールアニメーション
559//        jQuery('html,body').animate({scrollTop: targetY}, time, 'swing');
560//        // ハッシュ書き換えとく
561//        window.history.pushState(null, null, this.hash);
562//        // デフォルトの処理はキャンセル
563//        return false;
564//    });
565
566});
567
568//2019.06.10 add start
569//--------------------------------------------
570// aタグに設定されているリンクが外部サイトの場合、
571// 「rel=nofollow」を加える。
572//--------------------------------------------
573//jQuery(function(){
574window.addEventListener('DOMContentLoaded', function() {
575    //閲覧中のサイトドメイン取得
576    var domain = window.location.hostname;
577    //正規表現内容をセット(外部サイトでないことを確認)
578    var internalLinkRegex = new RegExp('^((http:\\/\\/|https:\\/\\/)(www\.)?)');
579    var domaincheckRegex = new RegExp('^(((http:\\/\\/|https:\\/\\/)(www\.)?)?'
580        + domain
581        + ')');
582    var newRel = "";
583    //aタグを正規表現チェック
584    jQuery('a').filter(function() {
585        // 2021.04.22 add start 条件の追加(target = "_blank"が付与されていて、relがnoopener noreferrerであること)
586        var targetCheck = jQuery(this).prop('target');
587        var relCheck = jQuery(this).prop('rel');
588        if ((relCheck == "noopener noreferrer" || relCheck == "") && targetCheck == "_blank"){
589            newRel = "nofollow " + relCheck;
590            // 2021.04.22 add end
591            var href = jQuery(this).attr('href');
592            //「http://」あるいは「https://」で始まることを確認
593            if(internalLinkRegex.test(href)) {
594                //「http://」などで始まった場合は、次にドメインが入るか
595                return !domaincheckRegex.test(href);
596            } else {
597                return false;
598            }
599        } //2021.04.22 add 条件の追加
600    })
601    .each(function() {
602        // 2021.04.22 change 
603        // jQuery(this).attr('rel', 'nofollow');
604        jQuery(this).attr('rel', newRel);
605    });
606});
607//2019.06.10 add end
608
609// 2019.09.02 add
610// Instagram Feed Pro バージョンアップに伴う追加
611// jQueryのバージョンが古いため「addBack」関数を補う
612//jQuery.fn.addBack = function (selector) {
613//    return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector));
614//}
615
616//2019.10.01 add start
617//--------------------------------------------
618//メディアをグリッドで表示する場合のSVGファイル表示
619//--------------------------------------------
620//jQuery(function(){
621window.addEventListener('DOMContentLoaded', function() {
622    var observer = new MutationObserver(function(mutations){
623        for (var i=0; i < mutations.length; i++){
624            for (var j=0; j < mutations[i].addedNodes.length; j++){
625                //該当の要素を取得
626                element = jQuery(mutations[i].addedNodes[j]);
627                //classがある場合のみ実行
628                if(element.attr('class')){
629                    elementClass = element.attr('class');
630                    //「attachments」classを探す
631                    if (element.attr('class').indexOf('attachment') != -1){
632                        attachmentPreview = element.children('.attachment-preview');
633                        if(attachmentPreview.length != 0){
634                            //SVGファイルにのみ実行する
635                            if(attachmentPreview.attr('class').indexOf('subtype-svg+xml') != -1){
636                                var handler = function(element){
637                                    //WP ajaxを呼び出して「wp_ajax_svg_get_attachment_url」関数を実行→該当のSVGファイルのURLを取得する
638                                    jQuery.ajax({
639                                        url: ajaxurl,
640                                        data: {
641                                            'action'        : 'svg_get_attachment_url',
642                                            'attachmentID'  : element.attr('data-id')
643                                        },
644                                        success: function(data){
645                                            if(data){
646                                                //svgファイルのURLに変換
647                                                element.find('img').attr('src', data);
648                                            }
649                                        }
650                                    });
651                                }(element);
652                            }
653                        }
654                    }
655                }
656            }
657        }
658    });
659    observer.observe(document.body, {
660        childList: true,
661        subtree: true
662    });
663
664//--------------------------------------------
665//メディアライブラリの添付ファイル詳細モーダルでのSVGファイル表示
666//--------------------------------------------
667    var attachmentPreviewObserver = new MutationObserver(function(mutations){
668        for (var i=0; i < mutations.length; i++){
669            for (var j=0; j < mutations[i].addedNodes.length; j++){
670                var element = jQuery(mutations[i].addedNodes[j]);
671
672                //添付ファイルの詳細画面なのか
673                var onAttachmentPage = false;
674                if( (element.hasClass('attachment-details')) || element.find('.attachment-details').length != 0){
675                    onAttachmentPage = true;
676                }
677
678                if(onAttachmentPage == true){
679                    //URL値を設定する
680                    var urlLabel = element.find('label[data-setting="url"]');
681                    if(urlLabel.length != 0){
682                        var value = urlLabel.find('input').val();
683                        element.find('.details-image').attr('src', value);
684                    }
685                }
686            }
687        }
688    });
689    attachmentPreviewObserver.observe(document.body, {
690        childList: true,
691        subtree: true
692    });
693});
694//2019.10.01 add end
695
696//2022.05.26 add start
697//カード03
698jQuery(function(){
699    jQuery(document).on("click", '.wev_accordion_one > .wev_accordion_header', function() {
700        jQuery(this).next(".wev_accordion_inner").slideToggle();
701        jQuery(this).toggleClass("open");
702        jQuery(".wev_accordion_one > .wev_accordion_header").not(jQuery(this)).next(".wev_accordion_inner").slideUp();
703        jQuery(".wev_accordion_one > .wev_accordion_header").not(jQuery(this)).removeClass("open");
704    });
705});
706
707//--------------------------------------------
708// Scrolling code start
709//--------------------------------------------
710
711// Add debug function
712function isElementVisible($el) {
713    if (!$el.length) return false;
714    const elOffset = $el.offset().top;
715    const elHeight = $el.innerHeight();
716    const scrollTop = jQuery(window).scrollTop();
717    const windowHeight = jQuery(window).height();
718
719    return (elOffset + elHeight > scrollTop && elOffset < scrollTop + windowHeight);
720}
721
722function logAfterScrollInfo() {
723    const scrollTop = jQuery(window).scrollTop();
724
725    const header = jQuery("#header");
726    const gnavbar = jQuery("#gNav");
727
728    const headerHeight = header.length ? header.innerHeight() : 0;
729    const gnavHeight = gnavbar.length ? gnavbar.innerHeight() : 0;
730
731    const isHeaderVisible = isElementVisible(header);
732    const isGNavVisible = isElementVisible(gnavbar);
733
734    console.log("===== Scroll後の状態 =====");
735    console.log("現在位置 (scrollTop):", scrollTop);
736    console.log("header高さ:", headerHeight, " / 表示中?:", isHeaderVisible);
737    console.log("gNav高さ:", gnavHeight, " / 表示中?:", isGNavVisible);
738    console.log("========================");
739}
740
741//2022.05.26 add end
742window.addEventListener("load", function () {
743    const speed = 400;
744    const url = jQuery(location).attr("href");
745    let retry = 15;
746    let navbarHeight = getNavHeight();
747
748    if (url.indexOf("#") !== -1) {
749        // urlを#で分割して配列に格納
750        const anchor = url.split("#");
751        // 分割した最後の文字列(#◯◯の部分)をtargetに代入
752        const interval = setInterval(function () {
753            let target = jQuery("#" + anchor[anchor.length - 1]);
754            if (target.length) {
755                clearInterval(interval);
756                let position = Math.floor(target.offset().top);
757                smoothScroll(position, speed, navbarHeight, "#" + anchor[anchor.length - 1]);
758            }
759            retry--;
760            if (retry <= 0) {
761                clearInterval(interval);
762            }
763        }, 500);
764    }
765});
766
767//ページ内アンカーリンク
768var isClicked = false;
769jQuery(document).on("click", 'a[href*="#"]', function (e) {
770    isClicked = true;
771    const url = this.href;
772    const urlObj = new URL(url);
773
774    // Allow #sidr to be added to the URL and another site # link
775    if ((urlObj.hash === "#sidr") || (!url.includes(window.location.host)) || Array.from(urlObj.searchParams).length > 0) {
776        return;
777    }
778
779    if (urlObj.pathname == window.location.pathname) {
780        e.preventDefault(); // Prevent default only for internal page anchors
781        console.log('Click Scroll link');
782
783        // For same-page anchor links, close the mobile menu just before scrolling.
784        // (#mobile.side-open is only added when the menu is opened on mobile, so this effectively runs on mobile only.)
785        var $mobileMenu = jQuery("#mobile");
786        if ($mobileMenu.hasClass("side-open")) {
787            $mobileMenu.removeClass("side-open");
788            jQuery("#header .header_tel").removeClass("side-open");
789            jQuery("body").css({ overflow: "", height: "" });
790        }
791
792        let navbarHeight = getNavHeight();
793        const speed = 400;
794        const target = jQuery(urlObj.hash);
795
796        if (target.length) {
797            let position = Math.floor(target.offset().top);
798            smoothScroll(position, speed, navbarHeight, urlObj.hash);
799        }
800    }
801});
802
803jQuery(window).on("hashchange", function () {
804    if (isClicked) {
805        isClicked = false;
806        return;
807    }
808    const url = jQuery(location).attr("href");
809    let navbarHeight = getNavHeight();
810    const speed = 400;
811
812    if (url.indexOf("#") !== -1) {
813        // urlを#で分割して配列に格納
814        const anchor = url.split("#");
815        // 分割した最後の文字列(#◯◯の部分)をtargetに代入
816        let target = jQuery("#" + anchor[anchor.length - 1]);
817        if (target.length) {
818            let position = Math.floor(target.offset().top);
819            smoothScroll(position, speed, navbarHeight, "#" + anchor[anchor.length - 1]);
820        }
821    }
822});
823
824function getNavHeight() {
825    const gnavbar = jQuery("#gNav");
826    const header = jQuery("#header");
827    let gnavbarHeight = 0;
828    let headerHeight = 0;
829    let navbarHeight = 10;
830
831    if (gnavbar.length) {
832        gnavbarHeight += gnavbar.innerHeight();
833    }
834
835    if (header.length) {
836        headerHeight += header.innerHeight();
837    }
838
839    navbarHeight += Math.max(headerHeight, gnavbarHeight);
840    return navbarHeight;
841}
842
843function getMinPadding() {
844    const gnavbar = jQuery("#gNav");
845    const header = jQuery("#header");
846    let gnavbarHeight = 0;
847    let headerHeight = 0;
848    let padding = 0;
849
850    if (gnavbar.length) {
851        gnavbarHeight += gnavbar.innerHeight();
852    }
853
854    if (header.length) {
855        headerHeight += header.innerHeight();
856    }
857
858    const maxHeight = Math.max(headerHeight, gnavbarHeight);
859
860    if (gnavbar.length && maxHeight === gnavbarHeight) {
861        const style = window.getComputedStyle(gnavbar[0]);
862        padding = parseFloat(style.paddingTop) + parseFloat(style.paddingBottom);
863    } else if (header.length && maxHeight === headerHeight) {
864        const style = window.getComputedStyle(header[0]);
865        padding = parseFloat(style.paddingTop) + parseFloat(style.paddingBottom);
866    }
867    return padding;
868}
869
870function smoothScroll(position, speed, navbarHeight, targetSelector) {
871    const body = jQuery("html,body");
872    const gnavbar = jQuery("#gNav");
873    const header = jQuery("#header");
874    const isGNavFixed = gnavbar.length && gnavbar.css("position") === "fixed";
875    const isHeaderFixed = header.length && header.css("position") === "fixed";
876
877    let finalScrollPosition = position;
878    let needSecondAdjust = true;
879
880    if (jQuery(window).width() <= 480) {
881        var fixedHeight = 30;
882        var firstH1 = jQuery('h1').first();
883        if (firstH1.length > 0) {
884            fixedHeight = (firstH1.outerHeight() !== 0 ? firstH1.outerHeight() : fixedHeight);
885        }
886        finalScrollPosition -= fixedHeight;
887        needSecondAdjust = false;
888    } else {
889        const gnavHeight = gnavbar.length ? gnavbar.innerHeight() : 0;
890        const headerHeight = header.length ? header.innerHeight() : 0;
891
892        if (gnavHeight > 450 || headerHeight > 450) {
893            const smallerHeight = Math.min(gnavHeight || Infinity, headerHeight || Infinity);
894            finalScrollPosition -= smallerHeight;
895        } else if (isGNavFixed) {
896            finalScrollPosition -= gnavbar.innerHeight() > 100 ? gnavbar.innerHeight() : 100;
897            needSecondAdjust = false;
898        } else if (isHeaderFixed) {
899            finalScrollPosition -= header.innerHeight() > 100 ? header.innerHeight() : 100;
900            needSecondAdjust = false;
901        } else {
902            finalScrollPosition -= navbarHeight + getMinPadding();
903            needSecondAdjust = true;
904        }
905    }
906
907    body.stop().animate(
908        { scrollTop: finalScrollPosition },
909        speed,
910        "swing",
911        function () {
912            const isHeaderVisible = isElementVisible(header);
913            const isGNavVisible = isElementVisible(gnavbar);
914
915            // For debug
916            // console.log("isHeaderVisible?:", isHeaderVisible);
917            // console.log("isGNavVisible?:", isGNavVisible);
918            // console.log("needSecondAdjust?:", needSecondAdjust);
919            // console.log('targetSelector:?', targetSelector);
920            // logAfterScrollInfo();
921            if (!isHeaderVisible && !isGNavVisible && targetSelector) {
922                needSecondAdjust = false;
923                const target = jQuery(targetSelector);
924                if (target.length) {
925                    const targetPos = Math.floor(target.offset().top) - 50;
926                    jQuery("html,body").stop().animate(
927                        { scrollTop: targetPos },
928                        500,
929                        "swing",
930                        // For debug
931                        // function () {
932                        //     console.log("Correction: Since there is no header or gNav, reposition the target to top+30px");
933                        //     logAfterScrollInfo();
934                        // }
935                    );
936                }
937                return;
938            }
939
940            if (!needSecondAdjust) return;
941            // --- 2nd time: Re-correct height change due to gNav's is-fixed ---
942            setTimeout(function () {
943                const gnavNowFixed = gnavbar.length && gnavbar.css("position") === "fixed";
944                if (gnavNowFixed && gnavbar.hasClass("is-fixed")) {
945                    let adjust = gnavbar.innerHeight();
946                    let currentScroll = jQuery(window).scrollTop();
947                    jQuery("html,body").stop().animate(
948                        { scrollTop: currentScroll - adjust},
949                        600,
950                        "swing",
951                        // For debug
952                        // function () {
953                        //     logAfterScrollInfo();
954                        // }
955                    );
956                }
957            }, 500);
958        }
959    );
960}
961//--------------------------------------------
962// Scrolling code end
963//--------------------------------------------
964
965window.addEventListener("DOMContentLoaded", () => {
966    const iframeHeightObserver = new MutationObserver(mutations => {
967        mutations.forEach(mutation => {
968            if (mutation.attributeName === "height") {
969                const iframeElement = mutation.target;
970                iframeElement.style.height = `${iframeElement.getAttribute("height")}px`;
971            }
972        });
973    });
974
975    const iframeElements = Array.from(document.querySelectorAll("iframe.wp-embedded-content"));
976    iframeElements.forEach(iframe => iframeHeightObserver.observe(iframe, { attributes: true }));
977
978});
979
980window.addEventListener("load", () => {
981    handleNestedAccordion()
982    if (isMobileSafari()) {
983        removeInstagramLightBox();
984    }
985
986});
987
988function isMobileSafari() {
989    return (
990        navigator.userAgent.match(/(iPod|iPhone|iPad)/) &&
991        navigator.userAgent.match(/AppleWebKit/)
992    );
993}
994
995// 2026.08.12 fix この関数は977行のwindow load(管理画面でも実行される)から
996//  iOS Safari時に呼ばれる。管理画面では $ が未定義のため jQuery に変更。
997function removeInstagramLightBox() {
998    const sbiElements = jQuery(".sbi");
999    sbiElements.each((index, element) => {
1000        const $self = jQuery(element);
1001        const flags = $self.attr("data-sbi-flags");
1002        if (flags !== undefined && flags.indexOf("disableOnTouch") === -1) {
1003            if (typeof window.sbi.touchDevice === "undefined") {
1004                window.sbi.touchDevice = true;
1005                jQuery(".sbi_item").each((index, item) => {
1006                    const $item = jQuery(item);
1007                    if (!$item.find(".sbi_link").hasClass("sbi_disable_lightbox")) {
1008                        $item.find(".sbi_photo_wrap").prepend($item.find(".sbi_link_area"));
1009                        $item.find(".sbi_link").remove();
1010                    }
1011                });
1012            }
1013        }
1014    });
1015}
1016
1017function handleNestedAccordion() {
1018    var $root = jQuery('#sidr ul#menu-main_menu');
1019    if ($root.length === 0) return;
1020
1021    if (!window.__nestedAccordionInitTry) window.__nestedAccordionInitTry = 0;
1022    window.__nestedAccordionInitTry += 1;
1023
1024    var topAccCountNow = $root.find('> li > a + .accordion-elm').length;
1025    if (topAccCountNow === 0 && window.__nestedAccordionInitTry <= 60) {
1026        setTimeout(handleNestedAccordion, 50);
1027        return;
1028    }
1029
1030    // Add accordion under sub-menu
1031    $root.children('li').each(function () {
1032        var $menuItem = jQuery(this);
1033        var $targets = $menuItem.find('li.menu-item-has-children');
1034
1035        $targets.each(function () {
1036            var $subMenuItem = jQuery(this);
1037            if ($subMenuItem.children('ul.sub-menu').length === 0) return;
1038
1039            var $linkTag = $subMenuItem.children('a').first();
1040            if ($linkTag.length === 0) return;
1041
1042            // Duplicate prevention: If there is no accordion-elm immediately after a, add it.
1043            if ($linkTag.next('.accordion-elm').length === 0) {
1044                $linkTag.after('<div class="accordion-elm">▼</div>');
1045            }
1046
1047            $subMenuItem.css({
1048                'text-indent': 'initial',
1049                'margin-left': '0.8em'
1050            });
1051        });
1052    });
1053
1054    $root.find('.accordion-elm').off('click');
1055
1056    jQuery(document)
1057        .off('click.handleNestedAccordion', '#sidr ul#menu-main_menu .accordion-elm')
1058        .on('click.handleNestedAccordion', '#sidr ul#menu-main_menu .accordion-elm', function (e) {
1059            e.preventDefault();
1060            e.stopPropagation();
1061            if (typeof e.stopImmediatePropagation === 'function') e.stopImmediatePropagation();
1062
1063            var $btn = jQuery(this);
1064            var $targetUl = $btn.next('ul.sub-menu');
1065
1066            if ($targetUl.length === 0) return false;
1067
1068            $btn.toggleClass('active');
1069            $targetUl.stop(true, true).slideToggle(400);
1070
1071            return false;
1072        });
1073}
1074
1075document.addEventListener('DOMContentLoaded', function () {
1076    const options = document.querySelectorAll('#mm option');
1077    options.forEach(option => {
1078        let dataText = option.getAttribute('data-text');
1079        if (dataText) {
1080            dataText = dataText.replace('月', '');
1081            option.setAttribute('data-text', dataText);
1082        }
1083    });
1084});
1085
1086// 2024/11/28 add for Wevery custom plugins
1087document.addEventListener('DOMContentLoaded', function() {
1088    function isAdmin() {
1089        return window.location.href.indexOf('/wp-admin/') !== -1;
1090    }
1091
1092    if (!isAdmin()) {
1093        var elements = document.querySelectorAll("div.box_editer_custom");
1094        elements.forEach(function(element) {
1095            // Get parent element
1096            var parent = element.parentNode;
1097            // Move child element to parent element
1098            while (element.firstChild) {
1099                parent.insertBefore(element.firstChild, element);
1100            }
1101            // Delete the original div
1102            parent.removeChild(element);
1103        });
1104    }
1105});
1106// add end
1107
1108// Add for TEL to phone number
1109document.addEventListener("DOMContentLoaded", function() {
1110    let telElem = document.querySelector('.tel');
1111    if (!telElem) {
1112        return;
1113    }
1114    const origInnerHTML = telElem.innerHTML;
1115
1116    function hasWideTelText() {
1117        const width = telElem.offsetWidth;
1118        return width >= 80;
1119    }
1120
1121    function isPortrait() {
1122        const result = window.matchMedia("(orientation: portrait)").matches;
1123        return result;
1124    }
1125    function isPortraitAndInWidth() {
1126        const result = isPortrait() && window.innerWidth < 1000;
1127        return result;
1128    }
1129    function isLandscapeMode() {
1130        const result = window.innerWidth < 1200 && !isPortrait();
1131        return result;
1132    }
1133    function isTelNumber(str) {
1134        const result = /^\d{2,4}-\d{2,4}-\d{3,4}$/.test(str.trim()) || /^\d{10,11}$/.test(str.replace(/-/g, '').trim());
1135        return result;
1136    }
1137
1138    function renderTelContent() {
1139        let isParentATag = telElem.parentElement && telElem.parentElement.tagName.toLowerCase() === 'a';
1140        let parentATag = isParentATag ? telElem.parentElement : null;
1141
1142        if (isParentATag) {
1143            let aText = parentATag.textContent;
1144            let hasNumber = /\d{2,4}-\d{2,4}-\d{3,4}|\d{10,11}/.test(aText);
1145
1146            if (!hasNumber && hasWideTelText()) {
1147                let telNumber = '';
1148                let href = parentATag.getAttribute('href');
1149                if (href && href.indexOf('tel:') === 0) {
1150                    telNumber = href.replace('tel:', '');
1151                }
1152                telElem.innerHTML = `<i class="material-icons">local_phone</i> ${telNumber}`;
1153                return;
1154            } else {
1155                telElem.innerHTML = origInnerHTML;
1156            }
1157        }
1158
1159        let aTag = isParentATag ? parentATag : telElem.querySelector('a');
1160        if (!aTag) {
1161            return;
1162        }
1163
1164        const href = aTag.getAttribute('href');
1165        const telNumber = href ? href.replace(/^tel:/, '') : '';
1166        const gaAttr = aTag.getAttribute('onclick') || '';
1167
1168        if ((isLandscapeMode() && !hasWideTelText()) || 
1169            (isLandscapeMode() && aTag.textContent.trim() === 'TEL')
1170        ) {
1171            const telLinkHTML = `<a href="tel:${telNumber}"${gaAttr ? ` onclick="${gaAttr}"` : ''}><span class="tel-number">${telNumber}</span></a>`;
1172            telElem.innerHTML = `<i class="material-icons">local_phone</i> ${telLinkHTML}`;
1173            return;
1174        }
1175
1176        if (isPortraitAndInWidth()) {
1177            if (isTelNumber(aTag.textContent) && !hasWideTelText()) {
1178                aTag.textContent = 'TEL';
1179            }
1180            return;
1181        }
1182
1183        telElem.innerHTML = origInnerHTML;
1184    }
1185
1186    renderTelContent();
1187
1188    window.addEventListener('resize', function() {
1189        renderTelContent();
1190    });
1191    window.addEventListener('orientationchange', function() {
1192        renderTelContent();
1193    });
1194});
1195
1196(function () {
1197    if (location.pathname.indexOf('/wp-admin/') !== -1) return;
1198    const TARGET_FORM_ID = 'searchform';
1199
1200    function isTargetSearchForm(form) {
1201        return !!form && form.tagName && form.tagName.toLowerCase() === 'form' && form.id === TARGET_FORM_ID;
1202    }
1203
1204    function isEmptySearchForm(form) {
1205        if (!isTargetSearchForm(form)) return false;
1206        const s = form.querySelector('input[name="s"]');
1207        if (!s) return false;
1208        return s.value.trim() === '';
1209    }
1210
1211    function block(event) {
1212        console.warn('Empty search blocked');
1213        event.preventDefault();
1214        event.stopPropagation();
1215        if (typeof event.stopImmediatePropagation === 'function') event.stopImmediatePropagation();
1216        return false;
1217    }
1218
1219    document.addEventListener(
1220        'submit',
1221        function (event) {
1222            if (isEmptySearchForm(event.target)) return block(event);
1223        },
1224        true
1225    );
1226
1227    document.addEventListener(
1228        'click',
1229        function (event) {
1230            const eventTarget = event.target;
1231            if (!eventTarget) return;
1232
1233            const isSubmitLike =
1234                (eventTarget.tagName === 'INPUT' && (eventTarget.type === 'submit' || eventTarget.type === 'image')) ||
1235                (eventTarget.tagName === 'BUTTON' && (eventTarget.type === 'submit' || eventTarget.type === ''));
1236            
1237            if (!isSubmitLike) return;
1238
1239            const form = eventTarget.form;
1240            if (!form) return;
1241
1242            if (isEmptySearchForm(form)) return block(event);
1243        },
1244        true
1245    );
1246})();

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.