").insertBefore($(".container_postbtn").children().eq(0)))}function toastAfterLike(){$("#toast-after-like-yn").val()&&$("button.btn_post.uoc-icon").on("click",function(){setTimeout(function(){0<$("button.btn_post.uoc-icon>div.like_on").length&&showToast($("#toast-after-like").val())},500)})}function common(){var t=$(".top-button .profile"),e=$(".top-button .menu");t.on("click","button",function(){$(this).siblings("nav").is(":hidden")?$(this).siblings("nav").show():$(this).siblings("nav").hide()}),window.T&&window.T.config.USER.name?(t.find(".login").hide(),t.find(".logout").show()):(t.find(".login").show(),t.find(".logout").hide()),t.on("click",".login",function(){document.location.href="https://www.tistory.com/auth/login?redirectUrl="+encodeURIComponent(window.TistoryBlog.url)}),t.on("click",".logout",function(){document.location.href="https://www.tistory.com/auth/logout?redirectUrl="+encodeURIComponent(window.TistoryBlog.url)});var o=!0;$(".comment-content, span.count > span").bind("DOMSubtreeModified",function(){o&&(o=!1,setTimeout(function(){commentAutoLink(),initFoldReply(),o=!0},500))});var n=!0,i=0,a=0;$("#___gcse_1").bind("DOMSubtreeModified",function(){var e;transFlag?(0!=a&&(clearTimeout(a),a=0),a=setTimeout(function(){transFlag=!1},1e3)):0<$(".gsc-wrapper").text().length&&(n&&(n=!1,"none"==$("#___gcse_1").css("display")&&$("#___gcse_1").show(),0<$(".mobile-menu aside").length&&$(".sidebar .close").click(),0!=$(window).scrollTop()&&(e=(e=$(window).scrollTop()/2e3*300)<500?500:3e3'),$("section").css("z-index",""),$(".sidebar .profile").length||($(".sidebar").append(''),t.find("ul").clone().appendTo(".sidebar .profile"),(e=$(".sidebar .profile")).on("click",".login",function(){document.location.href="https://www.tistory.com/auth/login?redirectUrl="+encodeURIComponent(window.TistoryBlog.url)}),e.on("click",".logout",function(){document.location.href="https://www.tistory.com/auth/logout?redirectUrl="+encodeURIComponent(window.TistoryBlog.url)})),$(".sidebar").css("padding-top",addHeightByAnchorAds("top")+50+"px"),$(".sidebar .close").css("top",addHeightByAnchorAds("top")+10+"px"),0==$(".sidebar").find("#aside-bottom-blank").length&&$(".sidebar").append(''),$(".sidebar #aside-bottom-blank").css("padding-bottom",addHeightByAnchorAds("bottom")+5+"px"),fixedRecommendAds("init"))}),$(".postbtn_like .wrap_btn.wrap_btn_etc button").on("click",function(){setTimeout(function(){},200)}),$(document).on("click","#dimmed, .sidebar .close",function(){$("body").removeClass("mobile-menu"),$("#dimmed").length&&removeDimmed()});var l=localStorage.getItem("dark-mode"),e=$("#default-dark-mode").val();null==l?e?setDarkMode("+"):setDarkMode("-"):"y"==l?setDarkMode("+"):setDarkMode("-"),$(".share-btn").on("click",function(){var e=$("#tistorySnsLayer");0'+$(".category .link_tit .c_cnt").text()+""),$("#forced-dark-mode").val()&&(localStorage.setItem("dark-mode","y"),$("body").addClass("dark-mode")),0<$(".og-desc").length)for(d=0;d<$(".og-desc").length;d++)$(".og-desc").eq(d).text($(".og-desc").eq(d).text()+"...");for(var h=$('.sidebar ins, .sidebar .coupang, .sidebar .tenping, .sidebar div[id*="dablewidget"]').parent(),d=0;d ul li"),d=0;d p").text().indexOf("\\")&&u.eq(d).find("> p").html('특수문자 관련 티스토리 버그로 인해 댓글이 표시되지 않습니다. 특수문자 제거 후 정상 이용 가능합니다.')}function updateTagsAttr(){var l,r,c,s,d=$(".content-title .inner h1, .content-article h2, h3, h4"),g=d.length-1,e=$(".content-article").find("img"),m=0,h=0,u=d.eq(0).text();e.each(function(e,t){var o=$(t);if(!o.attr("alt")||!o.attr("title"))for(var n,i,a=!1;!a;)if(m<=g&&(a=m===g||d.eq(m).offset().topo.offset().top?("H1"===d.eq(m).prop("tagName")?l=u:"H2"===d.eq(m).prop("tagName")?l=u+" - "+r:"H3"===d.eq(m).prop("tagName")?l=u+" - "+r+" - "+c:"H4"===d.eq(m).prop("tagName")&&(l=u+" - "+r+" - "+c+" - "+s),o.attr("alt")||o.attr("alt",l),o.attr("title")||o.attr("title",l),!0):(m++,0<(i=(n=d.eq(m).text()).indexOf(d.eq(m).find("button").text()))&&(n=n.substr(0,i)),"H2"===d.eq(m).prop("tagName")?r=n:"H3"===d.eq(m).prop("tagName")?c=n:"H4"===d.eq(m).prop("tagName")&&(s=n),!1)),200<++h)break}),$("img").each(function(e,t){t=$(t);t.attr("alt")||t.attr("alt",$("#header .inner > h1 > a").text().trim())}),$("script").removeAttr("type"),$("style").removeAttr("type")}function lazyLoading(){if($("#lazy-loading").val()){const e=document.querySelectorAll("img");0window.getWindowCleintHeight()&&(t=n.innerWidth(),o=n.innerHeight(),1{await function(e){const n={rootMargin:"0px",threshold:.1,...{}};return new Promise(t=>{const o=new IntersectionObserver(async e=>{e&&([e]=e,e.isIntersecting&&(t(),o.disconnect()))},n);o.observe(e)})}(e),null!=e.getAttribute("src")&&e.setAttribute("src",e.getAttribute("data-src")),null!=e.getAttribute("srcset")&&e.setAttribute("srcset",e.getAttribute("data-srcset")),$(e).animate({opacity:"1.0"},600)})}}function fixedRecommendAds(e){var t,o,n,i,a,l,r,c;$("#use-fixed-ads-yn").val()&&(t=null,"matched"==(c=$("#fixed-ads-type").val())?t=$("#recommend-ads").parent():"adsense"==c?t=$("aside .revenue_unit_wrap .adsense").parent():"adfit"==c&&(t=$("aside .revenue_unit_wrap .adfit").parent()),o=!1,n=$("#fixed-header").val()?$("header").height()+5:!$("#hide-sidebar").val()||floatingTocPostion?5:60,"toc"==e?null!=t&&(r=(window.innerWidth-$(".content-wrapper").width())/2>t.outerWidth(),(contentMiddleYn&&r||!contentMiddleYn&&1400<=window.innerWidth)&&window.scrollY>$("header").height()&&(0p>span#toggle").hasClass("close")&&(!contentMiddleYn||adsTocPosition)||contentMiddleYn&&!adsTocPosition||0==bookToc.length)?(i=!(0r&&(l=r/t.height()*.9),t.css("position","fixed"),c="adsense"==c?-15:5,c=t.height()*(1-l)/2-c,t.css("top","calc("+(i+n+addHeightByAnchorAds("top"))+"px - "+c+"px)"),t.css("transform","scale("+l+")"),t.css("right",a+"px"),t.css("padding-bottom","5px"),t.css("padding-top","10px"),t.children().css("max-height",r-5-10+"px")):o=!0):"unfold"==e?null!=t&&(o=!0):"init"==e&&0@\#$%&\\\=\(\'\"]/gi,"\\$&"),0<(e=$(0currentIndex?bgmSource[currentIndex].title:"재생 목록 없음"),myBgm.src=bgmSource[currentIndex].src,bgmMute("-"),void 0!==(e=myBgm.play())&&e.then(function(){bgmPlaying=!0;var e=(Number(window.localStorage.getItem("current-bgm-time"))||0)-.3;myBgm.currentTime=0bgmSource.length-1&&(currentIndex=0),myBgm=$("#bgm")[0],currentBgm=$("#current-bgm"),myBgm.onplaying=function(){bgmPlaying=!0,myBgm.volume=currentVolume=1e?addHeightByAnchorAds("top"):e,e=window.scrollY>$(".sidebar").offset().top-$headerTitle.height()?addHeightByAnchorAds("top"):0;0window.innerHeight?($(".content-wrapper").css("margin-top",initHeaderHeight+"px"),$header.css("position","fixed"),$header.css("top",t+"px"),$header.css("left","0"),$header.css("z-index","119"),$topButton.css("position","fixed"),$topButton.css("top",t+10+"px"),$("#blog-menu").css("display","none"),$header.css("height",$headerTitle.height()+20+"px"),"y"!=localStorage.getItem("dark-mode")?$header.css("background","#fff"):$header.css("background",""),$header.css("opacity","0.9"),0<$contentTitle.length&&window.scrollY>$contentTitle.offset().top+$contentTitle.outerHeight()?($headerTitle.html($(".content-title .inner .title-box h1").text()),$headerTitle.attr("href","#")):(0<$headerTitleImage.length?($headerTitle.html(""),$headerTitle.append($headerTitleImage)):$headerTitle.html(headerTitleText),$headerTitle.attr("href","/")),$(".progress-bar-horizontal").css("top",$headerTitle.height()+20+t+"px"),$("#aside-top-blank").css("height",$headerTitle.height()+30+e+"px"),$("#aside-top-blank").slideDown(300,"linear")):0==window.scrollY&&(0!=fixedHeaderTopTimer&&(clearTimeout(fixedHeaderTopTimer),fixedHeaderTopTimer=0),$("#aside-top-blank").slideUp(300,"linear"),$("#blog-menu").fadeIn(500,"linear"),fixedHeaderTopTimer=0,fixedHeaderTopTimer=setTimeout(function(){$(".content-wrapper").css("margin-top",""),$header.css("height",""),$header.css("background",""),$header.css("border-bottom",""),$header.css("opacity",""),$header.css("position",""),$header.css("top",""),$header.css("left",""),$header.css("z-index",""),$topButton.css("top",t+10+"px"),0<$headerTitleImage.length?($headerTitle.html(""),$headerTitle.append($headerTitleImage)):$headerTitle.html(headerTitleText)},200));0<$(".floating-toc").height()&&$(".floating-toc").css("top",$headerTitle.height()+20+"px");-1window.innerHeight+100&&$(".sidebar div")[0].scrollHeight>window.innerHeight?(e=$(".sidebar")[0].scrollHeight-$(".sidebar")[0].scrollTop>$("#lower").offset().top+$("#lower").height()+30-window.scrollY-75?"":"100vh",sidebarScrollFlag&&(sidebarScrollFlag=!1,$(".sidebar").css("height",e),setTimeout(function(){sidebarScrollFlag=!0},50)),$(".sidebar")[0].scrollTop>window.scrollY&&previousScrollTop>window.scrollY&&$(".sidebar")[0].scrollTo(0,window.scrollY),previousScrollTop=window.scrollY):sidebarScrollFlag&&(sidebarScrollFlag=!1,$(".sidebar").css("height",""),setTimeout(function(){sidebarScrollFlag=!0},50))}function toggleCategory(){if($("#fold-category").val()){var e=Number($(".sidebar").css("right").replace("px",""));if(Number.isNaN(e)||0 li"),o=0;o li"),o=$(".category_list > li > a"),n=Number.isNaN(Number($("#fold-category-speed").val()))?600:Number($("#fold-category-speed").val());o.eq(e).addClass("fold"),t.eq(e).find("ul.sub_category_list").slideUp(n,"swing"),t.eq(e).hover(function(){unfoldCategory(t,o,e,n)},function(){foldCategory(t,o,e,n).then(function(){-1!=tempIndex&&e!=tempIndex?unfoldCategory(t,o,tempIndex,n):foldCategory(t,o,e,n)}),tempIndex=-1})}function unfoldCategory(e,t,o,n){tempIndex=o;e=e.eq(o).find("ul.sub_category_list");"none"==e.css("display")&&foldFlag&&(foldFlag=!1,e.slideDown(n,"swing",function(){t.eq(o).removeClass("fold")}))}function foldCategory(o,n,i,a){return new Promise(function(e){var t=o.eq(i).find("ul.sub_category_list");"none"!=t.css("display")&&t.slideUp(a,"swing",function(){n.eq(i).addClass("fold"),foldFlag=!0,e()})})}function replaceLink(){for(var e=$(".inner a"),t=0;t다음 글 없음'),$(".content-box .content-arrow").eq(1).addClass("no-post")):nextPostFlag&&"next"==e?(nextPostFlag=!1,$("#next-content").append($(".another_category tr").eq(t-1).find("a").clone()),$("#pre-content").append('이전 글 없음'),$(".content-box .content-arrow").eq(0).addClass("no-post")):prePostFlag&&nextPostFlag&&"both"==e&&(nextPostFlag=prePostFlag=!1,$("#pre-content").append($(".another_category tr").eq(t+1).find("a").clone()),$("#next-content").append($(".another_category tr").eq(t-1).find("a").clone()))}var recommendPostFlag=!0,recommendPostTimer=0,preRecommendPosition=-1,reCommendStartPosition=floatingTocPostion?"right":"left";function recommendPost(){if(0<$(".another_category").length){if(1window.scrollY?$(".adsbygoogle[data-anchor-status]").height():0:"top"==e?Math.round($(".adsbygoogle[data-anchor-status]").offset().top)==Math.round(window.scrollY)?$(".adsbygoogle[data-anchor-status]").height():0:void 0:"bottom"==e?$(".adsbygoogle[data-anchor-status]").offset().top>window.scrollY?15:0:"top"==e?0:void 0:0}function commonForScroll(){$(".floating-button").css("bottom",addHeightByAnchorAds("bottom")+15+"px"),$("#wrapper").css("padding-bottom",addHeightByAnchorAds("bottom")+"px"),"none"!=$("#tistorySnsLayer").css("display")&&$("#tistorySnsLayer").css("display","none")}function refreshAds(t){$("#adsense-refresh").val()&&("init"==t?(refreshAds("recommend"),setTimeout(function(){refreshAds("sidebar")},200)):setTimeout(function(){if("recommend"==t){var e=$("#recommend-ads > ins");if(0=t&&(a=0,i=30*(t-n))),e.animate({scrollTop:a},i,"linear",autoScroll)))})}function autoAppendAds(){if($("#article-google-ads").val()){var e=$("#article-google-ads-type").val(),t=$(".content-article > div > div > p > ins"),o=$(".content-article > div > div > p");if((0==t.length||$("#article-google-ads-forced").val())&&0',c+=' ',c+='
',c+=' ',c+="
";var s='';for(var d=$("#article-google-ads-frequency").val()?Number($("#article-google-ads-frequency").val()):30,g=Math.round(o.length/d*.5)+1,m=0,h="",n=0;n div > div > div.middle-ads, .content-article > div > div > p.auto-ads-block-2"),n=0;n div > div > div.middle-ads, .content-article > div > div > p.auto-ads-block-2"),n=0;n