import*as t from"@wordpress/interactivity";var e={d:(t,r)=>{for(var i in r)e.o(r,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};e.d({},{}),document.addEventListener("DOMContentLoaded",(function(t){let e=JSON.parse(localStorage.getItem("pageHistory"));JSON.stringify(e);const r=document.getElementById("favorite-list");function i(){if(!r)return!1;r.innerHTML="",Array.isArray(e)&&e.forEach((t=>{let e=t.eyeCatch?'<figure><img src="'+t.eyeCatch+'"></figure>':'<div class="no-image"><svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="1.25" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z"></path><line x1="15" y1="8" x2="15.01" y2="8"></line><rect x="4" y="4" width="16" height="16" rx="3"></rect><path d="M4 15l4 -4a3 5 0 0 1 3 0l5 5"></path><path d="M14 14l1 -1a3 5 0 0 1 3 0l2 2"></path></svg></div>',i=t.title?'<div class="post-detail"><a class="post-link" href="'+t.url+'"><header><h2 class="post-title has-sm-font-size">'+t.title+"</h2></header></a></div>":"",a='<article><div class="post-image aspect-ratio-16-9"><a class="post-link" href="'+t.url+'"><button data-post-id="'+t.postId+'"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false"><path d="M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"></path></svg></button>'+e+"</a></div>"+i+"</article>";r.innerHTML+=a}))}function a(t){e=e.filter((e=>e.postId!==parseInt(t))),localStorage.setItem("pageHistory",JSON.stringify(e)),i(),o()}function o(){if(!r)return!1;const t=r.querySelectorAll("[data-post-id]");t&&t.forEach((t=>{t.addEventListener("click",(e=>{if(e.preventDefault(),!window.confirm("お気に入り一覧から削除しますか？（元に戻せません）"))return!1;a(t.dataset.postId)}))}))}i(),o()}));