/* Js for , Version=1775388738 */
 v.lang = {"confirmDelete":"\u60a8\u786e\u5b9a\u8981\u6267\u884c\u5220\u9664\u64cd\u4f5c\u5417\uff1f","deleteing":"\u5220\u9664\u4e2d","doing":"\u5904\u7406\u4e2d","loading":"\u52a0\u8f7d\u4e2d","updating":"\u66f4\u65b0\u4e2d...","timeout":"\u7f51\u7edc\u8d85\u65f6,\u8bf7\u91cd\u8bd5","errorThrown":"\u6267\u884c\u51fa\u9519\uff1a","continueShopping":"\u7ee7\u7eed\u8d2d\u7269","required":"\u5fc5\u586b","back":"\u8fd4\u56de","continue":"\u7ee7\u7eed","bindWechatTip":"\u53d1\u5e16\u529f\u80fd\u8bbe\u7f6e\u4e86\u7ed1\u5b9a\u5fae\u4fe1\u7684\u9650\u5236\uff0c\u8bf7\u5148\u7ed1\u5b9a\u5fae\u4fe1\u4f1a\u5458\u3002","importTip":"\u53ea\u5bfc\u5165\u4e3b\u9898\u7684\u98ce\u683c\u548c\u6837\u5f0f","fullImportTip":"\u5c06\u4f1a\u5bfc\u5165\u6d4b\u8bd5\u6570\u636e\u4ee5\u53ca\u66ff\u6362\u7ad9\u70b9\u6587\u7ae0\u3001\u4ea7\u54c1\u7b49\u6570\u636e"};;
  $(function()
  {
    if($(window).width() > 768) $("#siteNav a[href*='login']").click(function(elem)
    {
      if(window.qrCodeTimer) window.clearInterval(window.qrCodeTimer);
      const id = 'loginModal';
      sessionStorage.removeItem('demoOpen');
      sessionStorage.removeItem('demoLocate');
      $.cookie('noDemoLogin', 1, {path: config.cookiePath});
      showModalLogin(id, elem.target, 23, 0, 1);
      $('body').css('padding-right', 'unset');
      return false;
    });
  });
;v.demoPcUrl = "\/demo-pc";;v.demoMobileUrl = "\/demo-mobile";;v.jsRoot = "\/js\/";;v.webRoot = "\/";;v.editors = {"id":["content"],"tools":"simple"};;v.errorUnwritable = "\u4e0a\u4f20\u76ee\u5f55\u4e0d\u53ef\u5199\uff0c\u65e0\u6cd5\u4e0a\u4f20\u9644\u4ef6\u3002";;v.editorLang = "zh_CN";;v.uid = "69d248430e4b5";;

var simple =
[ 'formatblock', 'fontsize', '|', 'bold', 'italic','underline', '|',
'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', 'insertunorderedlist', '|',
'emoticons', 'image', 'media', 'link', '|', 'removeformat','undo', 'redo', 'source' ];

var full =
[ 'formatblock', 'fontsize', 'lineheight', '|', 'forecolor', 'hilitecolor', '|', 'bold', 'italic','underline', 'strikethrough', '|',
'justifyleft', 'justifycenter', 'justifyright', '|',
'emoticons', 'image', '|', 'link', 'unlink', 'anchor', 'media', 'baidumap', '/',
'undo', 'redo', '|', 'cut', 'copy', '|', 'plainpaste', 'wordpaste', '|', 'removeformat', 'clearhtml','quickformat', '|',
'indent', 'outdent', 'subscript', 'superscript', 'insertorderedlist', 'insertunorderedlist', '|',
'table', 'code', 'hr', '|',
'fullscreen', 'source', 'about'];

$(document).ready(initKindeditor);
function initKindeditor(afterInit)
{
    $(':input[type=submit]').after("<input type='hidden' id='uid' name='uid' value=" + v.uid + ">");
    var nextFormControl = 'input:not([type="hidden"]), textarea:not(.ke-edit-textarea), button[type="submit"], select';

    var editorsID = '';
    var $editorsID = $('.editors-id');
    if($editorsID.length) editorsID = ($editorsID.data('editors') || '').split(',');
    $.each(editorsID || v.editors.id, function(key, editorID)
    {
        if(typeof(v.editors.filterMode) == 'undefined') v.editors.filterMode = true;
        editorTool = eval(v.editors.tools);
        var K = KindEditor, $editor = $('#' + editorID);
        keEditor = K.create('#' + editorID,
        {
            width:'100%',
            items:editorTool,
            cssPath:[v.webRoot + 'zui/css/min.css'],
            bodyClass:'article-content',
            urlType:'absolute',
            uploadJson: createLink('file', 'ajaxUpload', 'uid=' + v.uid),
            imageTabIndex:1,
            filterMode:v.editors.filterMode,
            allowFileManager:false,
            langType:v.editorLang,
            htmlTags:{
            
            'p,span,h1,h2,h3,h4,h5,em,u,strong,br,ol,ul,li,img,a,b,font,hr,pre,embed,video,audio,':["class","id","style"],
            
            object: ["type", "data", "width", "height"], param: ["name", "value"],
            audio: ['id', 'class', 'width', 'src', 'height', 'loop', 'preload', 'autoplay', 'controls', 'crossorigin', 'currentTime', 'duration', 'muted'],
            video: ['id', 'class', 'width', 'src', 'height', 'loop', 'preload', 'autoplay', 'controls', 'crossorigin', 'currentTime', 'duration', 'muted', 'buffered', 'playsinline', 'played', 'poster'],
            source: ['src', 'type'],
            font:["id","class","color","size","face",".background-color"],span:["id","class",".color",".background-color",".font-size",".font-family",".background",".font-weight",".font-style",".text-decoration",".vertical-align",".line-height"],div:["id","class","align",".border",".margin",".padding",".text-align",".color",".background-color",".font-size",".font-family",
            ".font-weight",".background",".font-style",".text-decoration",".vertical-align",".margin-left"],table:["id","class","border","cellspacing","cellpadding","width","height","align","bordercolor",".padding",".margin",".border","bgcolor",".text-align",".color",".background-color",".font-size",".font-family",".font-weight",".font-style",".text-decoration",".background",".width",".height",".border-collapse"],"td,th":["id","class","align","valign","width","height","colspan","rowspan","bgcolor",".text-align",
            ".color",".background-color",".font-size",".font-family",".font-weight",".font-style",".text-decoration",".vertical-align",".background",".border"],a:["id","class","href","target","name"],embed:["id","class","src","width","height","type","loop","autostart","quality",".width",".height","align","allowscriptaccess","allowfullscreen"],img:["id","class","src","width","height","border","alt","title","align",".width",".height",".border"],"p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6":["id","class","align",".text-align",".color",
            ".background-color",".font-size",".font-family",".background",".font-weight",".font-style",".text-decoration",".vertical-align",".text-indent",".margin-left"],pre:["id","class"],hr:["id","class",".page-break-after"],"br,tbody,tr,strong,b,sub,sup,em,i,u,strike,s,del":["id","class"],iframe:["id","class","src","frameborder","width","height",".width",".height"],style:[]},

            
            
            
            syncAfterBlur: true,
            spellcheck: false,
            placeholderStyle: {fontSize: '14px', color: '#999'},
            pasteImage: {postUrl: createLink('file', 'ajaxPasteImage', 'uid=' + v.uid), placeholder: true}
        });
        try
        {
            if(!window.editor) window.editor = {};
            window.editor['#'] = window.editor[editorID] = keEditor;
            $editor.data('keditor', keEditor);
        }
        catch(e){}
    });

    if($.isFunction(afterInit)) afterInit();
}

;v.viewReplies = "\u67e5\u770b\u56de\u5e16\u5185\u5bb9";;v.stayCurrent = "\u7559\u5728\u5f53\u524d\u9875\u9762";;v.quoteTitle = "<div class='quote-title'>\u539f\u5e16\u7531 %s \u4e8e %s \u53d1\u8868<\/div>";;v.discussion = 0;;v.isCurrentPage = true;;
$(function()
{
    var videoContainer = "<video id=\"VIDEO_ID\" class=\"video-js vjs-default-skin vjs-big-play-centered\" controls preload=\"auto\" loop=\"loop\" data-setup='{\"autoplay\": VIDEO_AUTOSTART, \"width\": VIDEO_WIDTH, \"height\": VIDEO_HEIGHT, \"controlBar\": {\"fullscreenToggle\": VIDEO_FULLSCREEN}}'><source src=\"VIDEO_SRC\" type=\"video\/VIDEO_TYPE\" \/> <\/video>";
    $('embed').each(function(index)
    {
        if($(this).hasClass('videojs')) 
        {
            var $embed      = $(this),
                src         = $embed.attr('src'),
                w           = $embed.width(),
                h           = $embed.height(),
                type        = src.match(/t=\w+/g),
                autostart   = $embed.attr('autostart'),
                fullscreen  = $embed.attr('allowfullscreen'),
                containerID = 'video_' + index;

            $container = videoContainer.replace(/VIDEO_SRC/g, src);
            $container = $container.replace(/VIDEO_WIDTH/, w);
            $container = $container.replace(/VIDEO_HEIGHT/, h);
            $container = $container.replace(/VIDEO_ID/, containerID);
            $container = $container.replace(/VIDEO_AUTOSTART/, autostart);
            $container = $container.replace(/VIDEO_FULLSCREEN/, fullscreen);
            $container = $container.replace(/VIDEO_TYPE/, type[0].replace('t=', ''));
            $(this).replaceWith($container);
        }
    })
});
;(function() {var _53code = document.createElement("script");_53code.src = "https://tb.53kf.com/code/code/ef35685c8390f5aa37b2ddce53eca3e09/2";var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(_53code, s);})();;$(document).ready(function()
{
    $('#isLink').change(function()
    {
        if($(this).prop('checked'))
        {
            $('.threadInfo').hide();
            $('.link').show();
        }
        else
        {
            $('.threadInfo').show();
            $('.link').hide();
        }
    });

    $('.color').each(function()
    {
        var $this = $(this);
        var c = $this.attr('data');
        if(!c) return;
        var cc = new $.zui.Color(c).contrast().hexStr();

        ($this.hasClass('input-group') ? $this.find('.input-group-btn .dropdown-toggle') : $this).css({'background': c, 'color': cc}).find('.caret').css('border-top-color', cc);
    }).click(function()
    {
        var $this = $(this);
        if($this.hasClass('input-group')) return;
        var $plate = $this.closest('.colorplate');
        $plate.find('.color.active').removeClass('active');
        if($this.hasClass('color-tile')) $plate.find('.input-color').val($this.attr('data')).change();
        $this.addClass('active');
    });

    $('.input-color').on('keyup change', function()
    {
        var $this = $(this);
        var val = $this.val();

        $this.closest('.colorplate').find('.color.active').removeClass('active');

        if($.zui.Color.isColor(val))
        {
            var ic = (new $.zui.Color(val)).contrast().hexStr();
            $this.attr('placeholder', val).closest('.color').removeClass('error').find('.input-group-btn .dropdown-toggle').css({'background': val, 'color': ic}).find('.caret').css('border-top-color', ic);;
        }
        else
        {
            $this.closest('.color').addClass('error');
        }
    });
});
$(document).ready(function()
{
    $.setAjaxForm('#replyForm', function(response)
    {
        if(response.result == 'success')
        {
            if(!v.isCurrentPage && (v.discussion == '0' || (v.discussion == '1' && response.replyID == 0)))
            {
                bootbox.dialog(
                {  
                    message: response.replySuccess,  
                    buttons:
                    {  
                        lastPage:
                        {  
                            label:     v.viewReplies,
                            className: 'btn-primary',  
                            callback:  function(){location.href = response.locate;}  
                        },
                        back:
                        {  
                            label:     v.stayCurrent,  
                            className: 'btn-primary',  
                            callback:  function(){location.href = removeAnchor(location.href);}  
                        }  
                    }  
                });
            }
            else
            {
                $('#submit').popover({container: 'body', trigger:'manual', content:response.replySuccess, placement: 'right', tipClass: 'popover-success  popover-ajaxform'}).popover('show');
                setTimeout(function(){$('#submit').popover('destroy');}, 2000);
                setTimeout(function(){location.href = response.locate;}, 1200);
            }
        }
        else
        {
            if(response.reason == 'needChecking')
            {
                $('#captchaBox').html(Base64.decode(response.captcha)).show();
            }
        }
    });

    $.setAjaxForm('#addScoreForm');

    $.setAjaxJSONER('.switcher', function(response){ bootbox.alert(response.message, function(){location.href = response.locate; return false;});});
    $('.nav-system-forum').addClass('active');
    $('#navbar li.active').parents('li').addClass('active');

    /* remove empty element */
    $('.speaker > ul > li > span:empty').closest('li').remove();

    $('.thread-reply-btn').click(function()
    {
        if($(this).data('reply')) $('input[name=reply]').val($(this).data('reply'));
    })

    $(document).on('click', '.quote', function()
    {
        if($(this).parents('.alert-replies').length)
        {
            var $quote = $(this).parents('.thread-content');
            var date   = $quote.find('.reply-date').html();
            var user   = $quote.find('.reply-author').html().replace('\：', '');
            var quoteTitle = v.quoteTitle.replace('\%\s', user).replace('\%\s', date);

            var quoteContent = '[quote]';
            quoteContent += quoteTitle;
            quoteContent += $quote.find('.reply-content').html();
            quoteContent += '[/quote]';
        }
        else
        {
            var $quote     = $(this).parents('.panel.reply');
            var date       = $quote.find('.panel-heading span.muted').html().replace(/<[^>]+>/g,'');
            var user       = $quote.find('.table .speaker .thread-author').html().replace(/<[^>]+>/g, '');
            var quoteTitle = v.quoteTitle.replace('\%\s', user).replace('%s', date);
            
            var quoteContent = '[quote]';
            quoteContent += quoteTitle;
            quoteContent += $quote.find('.table .thread-wrapper .thread-content').html();
            quoteContent += '[/quote]';
        }

        KindEditor.html('#content', quoteContent);
    })
    
    $('.alert-primary').parent('.reply-content').css('display', 'block');
});
window.xuanxuan = {
    // beta 版本相关信息
    betadate: "04月24日",
    betaver: "7.2.beta",
    betadownload: "/dynamic/xuanxuan7.2.beta-104.html",

    // 设置喧喧当前版本
    version: "10.1",

    // 设置喧喧更新日期
    publishDate: "2025.04.25",

    // 首页幻灯片发布日期
    date: "7月11日",

    // 以下只能填写版本号，不可以加英文字母
    ver: "10.2",

    xxcVersion: "10.2",

    xxbVersion: "10.2",

    xxdVersion: "10.2",

    androidVersion: "10.2.0",
    
    version:"10.2.0",

    iosVersion: "10.2.0",

    owtVersion: "1.5",

    // 所有下载按钮指向的位置
    download: "/dynamic/xuanxuan9.1-111.html",

    // 设置喧喧下载地址前缀
    downloadUrl: "/dl/xuanxuan/{ver}/",
    androidDownloadUrl: "/dl/xuanxuan/{ver}/",
    owtDownloadUrl: "/dl/xuanxuan/owt/",
    jitsiDownloadUrl: "https://dl.zentao.net/xuanmeet/xuanmeet-1.0.zip",
    downloadDockerBaidu: "https://pan.baidu.com/s/1Pvz5Yz4fsvS8-VNzKLqPSQ",
    owt_docker_baidu_code: "cgna",

    // 以下内容无需更改
    downloads: {
        windows_setup: "xuanxuan.{xxcVersion}.win64.setup.exe",
        windows_setup_debug: "xuanxuan.{xxcVersion}.debug.win64.setup.exe",
        windows_setup_win32: "xuanxuan.{xxcVersion}.win32.setup.exe",
        windows_7z: "xuanxuan.{xxcVersion}.win64.7z.exe",
        windows_7z_win32: "xuanxuan.{xxcVersion}.win32.7z.exe",
        windows_zip: "xuanxuan.{xxcVersion}.win64.zip",
        windows_zip_win32: "xuanxuan.{xxcVersion}.win32.zip",
        mac_dmg: "xuanxuan.{xxcVersion}.mac.dmg",
        mac_zip: "xuanxuan.{xxcVersion}.mac.zip",
        mac_dmg_debug: "xuanxuan.{xxcVersion}.debug.mac.dmg",
        browser: "xuanxuan.{xxcVersion}.browser.zip",
        linux_deb: "xuanxuan.{xxcVersion}.linux.amd64.deb",
        linux_deb_32: "xuanxuan.{xxcVersion}.linux.i386.deb",
        linux_zip: "xuanxuan.{xxcVersion}.linux64.zip",
        linux_targz: "xuanxuan.{xxcVersion}.linux.x64.tar.gz",
        linux_targz_32: "xuanxuan.{xxcVersion}.linux.ia32.tar.gz",
        linux_rpm: "xuanxuan.{xxcVersion}.linux.x86_64.rpm",
        linux_rpm_32: "xuanxuan.{xxcVersion}.linux.i686.rpm",
        ranzhi_server: "xuanxuan.ranzhi.{xxbVersion}.zip",
        zentao_server: "xuanxuan.zentao.{xxbVersion}.zip",
        source: "xuanxuan.source.{ver}.zip",
        xxd_win32: "xxd.{xxdVersion}.win32.zip",
        xxd_win64: "xxd.{xxdVersion}.win.x64.zip",
        xxd_mac: "xxd.{xxdVersion}.mac.tar.gz",
        xxd_linux32: "xxd.{xxdVersion}.linux.ia32.tar.gz",
        xxd_linux64: "xxd.{xxdVersion}.linux.x64.tar.gz",
        xxb_source: "xxb.{xxbVersion}.zip",
        xxb_source_php53: "xxb.{xxbVersion}.php53.zip",
        xxb_source_php70: "xxb.{xxbVersion}.php70.zip",
        xxb_source_php71: "xxb.{xxbVersion}.php71.zip",
        xxb_source_php72: "xxb.{xxbVersion}.php72.zip",
        xxb_win64_zbox: "xuan.{xxbVersion}.zbox.win.x64.exe",
        xxb_win64: "xxb.{xxbVersion}.win64.exe",
        xxb_win32: "xxb.{xxbVersion}.win32.exe",
        xxb_zbox64: "xuan.{xxbVersion}.zbox.linux.x64.tar.gz",
        xxb_zbox32: "xxb.{xxbVersion}.zbox_32.tar.gz",
        xxb_linux_rpm: "xxb-{xxbVersion}-1.noarch.rpm",
        xxb_linux_deb: "xxb_{xxbVersion}_1_all.deb",
        android: "xuanxuan.android.{androidVersion}.apk",
        owt_docker: "owt.{owtVersion}.docker.tar.xz",
        owt_docker_baidu: "{downloadDockerBaidu}",
        jisti_docker: "{jitsiDownloadUrl}",
        windows_bundle: "xxb.{xxbVersion}.bundle.win64.zip",
        linux_bundle: "xxb.{xxbVersion}.bundle.zbox_64.tar.gz",
    }
};
xuanxuan.downloadUrlOrigin = xuanxuan.downloadUrl;
xuanxuan.downloadUrl = xuanxuan.downloadUrl.format(xuanxuan);
xuanxuan.androidDownloadUrl = xuanxuan.androidDownloadUrl.format(xuanxuan);

var timeNow = new Date().getTime();
for(var downloadType in xuanxuan.downloads) {
    var url = xuanxuan.downloads[downloadType];
    var preUrl = url.indexOf('{xxcVersion}') > -1 ? xuanxuan.downloadUrl.format({version: xuanxuan.xxcVersion}) :
        (url.indexOf('{xxbVersion}') > -1 ? xuanxuan.downloadUrl.format({version: xuanxuan.xxbVersion}) :
        (url.indexOf('{xxdVersion}') > -1 ? xuanxuan.downloadUrl.format({version: xuanxuan.xxdVersion}) :
        (url.indexOf('{androidVersion}') > -1 ? xuanxuan.androidDownloadUrl.format({version: xuanxuan.androidVersion}) : (url.indexOf('{owtVersion}') > -1 ? xuanxuan.owtDownloadUrl : xuanxuan.downloadUrl))));
    xuanxuan.downloads[downloadType] = url.format(xuanxuan);
    var thisDownloadUrl = xuanxuan.downloads[downloadType];
    if (thisDownloadUrl.indexOf('https://') !== 0 && thisDownloadUrl.indexOf('http://')) {
        thisDownloadUrl = preUrl + thisDownloadUrl;
    }
    xuanxuan['download.' + downloadType] = thisDownloadUrl;
    xuanxuan['filename.' + downloadType] = xuanxuan.downloads[downloadType];
};

$(function() {
    $('[data-xuanxuan]').each(function() {
        var $this = $(this);
        var data = $this.data('xuanxuan');
        $.each(data.split(' '), function(idx, dataItem) {
            dataItem = dataItem.split('|');
            var attr = dataItem[0] || 'text';
            var key = dataItem[1];
            var value = xuanxuan[key];
            if(!key || !value) {
                var oldValue = attr === 'text' ? $this.text() : $this.attr(attr);
                if(oldValue) value = oldValue.format(xuanxuan);
            }
            if(attr === 'text') {
                $this.text(value);
            } else {
                $this.attr(attr, value);
            }
        });
    });
    $('.text-xuanxuan').each(function()
    {
        var $this = $(this);
        var format = $this.text();
        $this.text(format.format(xuanxuan));
    });
    $('.link-xuanxuan').each(function()
    {
        var $this = $(this);
        var attrName = $this.is('img') ? 'src' : 'href';
        var format = $this.data(attrName) || $this.attr(attrName);
        if(format.indexOf('/#') === 0) format = format.substr(2);
        else if(format.indexOf('#') === 0) format = format.substr(1);
        $this.attr(attrName, format.format(xuanxuan));
    });
});

if(screen.width > 767){
    $('#words').attr('placeholder','搜一搜');
    $("#searchbar").insertAfter("#navbarWrapper");
    $("#siteNav").insertAfter("#searchbar");
} else {
    $("#siteNav").insertAfter("#siteTitle");
};

$(document).ready(function(){
    if(typeof headerList != 'undefined') return ;
    headerList = true;
    $('#footer #icpInfo').after('<a class="privacy" href="/page/xuan-privacypolicy.html">隐私政策</a>');
    $('.m-user-register .form-horizontal .agreement-form span').after('<span>和《<a href="/page/xuan-privacypolicy.html" target="_blank">隐私政策</a>》</span>');
});

$(document).on('click', '.icon_img_bg', function(){open_floatWindow();});


// 首页点击空白处登录弹框隐藏
$(document).click(function(e) {
    if($(this).children('html').hasClass('m-user-login')) {
        return;
    } else {
        $('#loginModal').hide();
        if(window.qrCodeTimer) clearInterval(window.qrCodeTimer);
        $('#whitePaper').remove();
    }
})
$(document).on('click', '#loginModal, #privacyagreement, #agreement', function(e) {
    e.stopPropagation();
})
function showModalLogin(id, elem,  moreTop, moreLeft, showHeader, style, callback)
{
    var isVisible = document.getElementById(id) && document.getElementById(id).offsetParent;
    if(isVisible) return false;
    if(!style) {
        style = {}
    }

    var modalLoginOptions =
    {
        url     : "/user-loginmodal.html",
        name    : id,
        keyboard: false,
        backdrop: 'static',
        loaded  : function() {
            $('#' + id).addClass('modalLogin');
            if(showHeader == 0) $('#' + id + ' .close').hide();
            if($('html').hasClass('m-user-login')) $('#loginModal').css('height', $('.page-wrapper').height() + 100);
            callback && callback();
        },
        onHide: function(){
            if(window.smsTimer) clearInterval(window.smsTimer);
            if(window.qrCodeTimer) clearInterval(window.qrCodeTimer);
        }
    };
    var myModalTrigger = new $.zui.ModalTrigger(modalLoginOptions);
    myModalTrigger.show();
}
$('.demo-link').click(function(e)
{
    e.preventDefault();
    if (location.pathname == createLink('user', 'login', 'referer=pcDemo') || location.pathname == createLink('user', 'login', 'referer=mobileDemo')) {
        return;
    }
    var demoLink = $(this).attr('href');
    getUserFingerprint().then(visitorID => {
        if (demoLink == v.demoPcUrl) 
        {
          var postFunc = 'pc';
        }
        if (demoLink == v.demoMobileUrl) 
        {
          var postFunc = 'mobile';
        }
        var postLink = `/demo-${postFunc}`;
        $.post(postLink, 
        {
            url: demoLink,
            fingerprint: visitorID,
            referrer: location.href
        }, function(response) 
        {
            if(response.result == 'success')
            {
                if(response.data.open) 
                {
                    sessionStorage.setItem('demoOpen', response.data.open);
                } 
                else 
                {
                    sessionStorage.removeItem('demoOpen');
                }

                if(response.data.locate)
                {
                    sessionStorage.setItem('demoLocate', response.data.locate);
                    $.cookie('noDemoLogin', 0, {path: config.cookiePath});
                }

               if (response.data.target === '_blank') {
                    // 1. 获取原始URL和时间戳
                    const originalUrl = response.data.url;
                    const timestamp = new Date().getTime();
                
                    // 2. 分离URL的hash部分（#及后面的内容）
                    let urlWithoutHash = originalUrl;
                    let hashPart = '';
                    const hashIndex = originalUrl.indexOf('#');
                    if (hashIndex !== -1) {
                        urlWithoutHash = originalUrl.slice(0, hashIndex); // 截取#前面的URL
                        hashPart = originalUrl.slice(hashIndex); // 截取#及后面的hash
                    }
                
                    // 3. 处理URL参数（删除原有v，添加新v）
                    // 兼容相对路径：如果URL是相对路径，拼接当前页面origin
                    const baseUrl = window.location.origin;
                    const urlObj = new URL(urlWithoutHash, baseUrl);
                    urlObj.searchParams.delete('v'); // 移除原有v参数
                    urlObj.searchParams.append('v', timestamp); // 添加新的时间戳v参数
                
                    // 4. 拼接回完整URL（处理后的参数 + 原始hash）
                    const newUrl = urlObj.toString() + hashPart;
                
                    // 5. 打开新窗口
                    window.open(newUrl, '_blank', 'noopener');
                }
                else 
                {
                    window.location.href = response.data.url;
                }
            }
        }, 'json')
    });
});

$('.faq-block .question').click(function()
{
    $(this).siblings('.answer').toggleClass('hide');
    $(this).find('i').toggleClass('rotate');
});

function throttle(func, limit) {
    let inThrottle;
    return function() {
        const args = arguments;
        const context = this;
        if (!inThrottle) {
            func.apply(context, args);
            inThrottle = true;
            setTimeout(() => inThrottle = false, limit);
        }
    }
}

$('#searchbar').click(function(e)
{
    e.stopPropagation();
});

$(document).click(function()
{
    $('#searchbar form').removeClass('active');
    $('#searchbar .search-btn').removeClass('show-form');
});

$('#searchbar .search-btn').click(function(e)
{
    e.stopPropagation();
   $(this).siblings().addClass('active'); 
   $(this).addClass('show-form');
});$(".panel,.clearfix.pager").wrapAll('<div class="panel-wrap"></div>');
;
$(document).ready(function()
{
    $('a[data-download=1]').each(function()
    {   
        link = window.btoa(window.encodeURIComponent($(this).attr('href')));
        fileName = window.btoa(window.encodeURIComponent($(this).text()));
        $(this).attr('data-toggle', 'modal').attr('href', createLink('misc', 'download', 'link=' + link + '&fileName=' + fileName));
    }); 
})
;
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?d1c082425f9ca559c0c1ca5a8783cad0";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
;v.clickNavLogin = ';';v.genFingerprintError = ';';
    async function getUserFingerprint() {
        const agent = typeof (FingerprintJS) !== 'undefined' ? await FingerprintJS.load() : '';
        const result = agent ? await agent.get() : '';
        return result ? result.visitorId : '';
    }

    function debounce(fn, delay = 500) {
        let timer = null;
        return function () {
            if (timer) {
                clearTimeout(timer)
            }
            timer = setTimeout(() => {
                fn.apply(this, arguments);
                timer = null;
            }, delay);
        }
    }

    $().ready(function () {
        getUserFingerprint().then(result => {
            var mouseinTime, mouseoutTime;
            $('.telephone').hover(function () {
                    if ($(this).find('.service').length > 0) {
                        mouseinTime = new Date().getTime();
                    }
                    $(this).find('.popup').addClass('active')
                },
                function () {
                    if ($(this).find('.service').length > 0) {
                        mouseoutTime = new Date().getTime();
                        if (mouseoutTime - mouseinTime > 3000) {
                            const postData = {
                                fingerprint: result,
                                triggerType: 'hover',
                                location: 'rightDocker',
                                triggerTime: Math.round(mouseoutTime / 1000),
                                duration: Math.round((mouseoutTime - mouseinTime) / 1000)
                            };
                            $.post(createLink('contact', 'event'), postData);
                        }
                    }
                    $(this).find('.popup').removeClass('active')
                });

            var location;
            $('.contact-us').click(debounce(function (e) {
                location = $(this).data('location');
                e.preventDefault();
                const postData = {
                    fingerprint: result,
                    location: location,
                    triggerType: 'click',
                };
                $.post(createLink('contact', 'event'), postData);
            }));
        });
    });

    function checkDemoLogin(locate)
    {
        if(locate && locate.includes('checkUserMobile')) return false;

        const demoLocate = sessionStorage.getItem('demoLocate');
        const demoOpen = sessionStorage.getItem('demoOpen');

        if(demoOpen)
        {
            const newWindow = window.open(demoOpen, '_blank', 'noopener');
            setTimeout(function() {
                let windowVerified = false;
                if (newWindow) {
                    try {
                        const closed = newWindow.closed;
                        if (typeof closed !== 'undefined') {
                            if (closed === false) {
                                try {
                                    const width = newWindow.outerWidth;
                                    const height = newWindow.outerHeight;
                                    if (width > 0 && height > 0) {
                                        windowVerified = true;
                                    }
                                } catch(e2) {
                                    windowVerified = true;
                                }
                            }
                        }
                    } catch(e) {
                        // windowVerified = false
                    }
                }

                if (!windowVerified) {
                    if (window.location.href !== demoOpen) {
                        window.location.href = demoOpen;
                        sessionStorage.removeItem('demoOpen');
                        sessionStorage.removeItem('demoLocate');
                    }
                } else {
                    sessionStorage.removeItem('demoOpen');
                }
            }, 500);
        }

        if(demoLocate)
        {
            window.location.href = demoLocate;
            sessionStorage.removeItem('demoLocate');
            return true;
        }
        return false;
    }
;
  

  
