Spaces:
Running
Running
AI concierge chat widget on every page (part 2)
Browse filesFiles changed (2)
5 unmodified lines678910115 unmodified linesvar body = document.body, sh = $(".sh"), hero = $(".hero"), mbar = $(".mbar");var reduce = matchMedia("(prefers-reduced-motion: reduce)").matches;// header: solid after the hero, hides on scroll down, returns on scroll upvar lastY = scrollY, tick = false;function onScroll() {5 unmodified lines678910111213141516171819205 unmodified linesvar body = document.body, sh = $(".sh"), hero = $(".hero"), mbar = $(".mbar");var reduce = matchMedia("(prefers-reduced-motion: reduce)").matches;// AI concierge chat panel (assets/chat.js) — same widget as the group site(function () {var cfg = window.OPEFAC_CONFIG || {};if (!cfg.CHAT_IFRAME_SRC) return;var me = document.currentScript && document.currentScript.src || "";var root = me.replace(/assets\/sites\/site(\.min)?\.js.*$/, "");var sc = document.createElement("script"); sc.src = root + "assets/chat.js?v=20261202e"; sc.async = true; document.head.appendChild(sc);})();// header: solid after the hero, hides on scroll down, returns on scroll upvar lastY = scrollY, tick = false;function onScroll() {
1var x=Object.defineProperty;var u=(n,i)=>x(n,"name",{value:i,configurable:!0});(function(){var n=u(function(e,t){return(t||document).querySelector(e)},"$"),i=u(function(e,t){return Array.prototype.slice.call((t||document).querySelectorAll(e))},"$$"),f=document.body,v=n(".sh"),p=n(".hero"),E=n(".mbar"),b=matchMedia("(prefers-reduced-motion: reduce)").matches,g=scrollY,m=!1;function w(){var e=scrollY,t=p?p.offsetHeight-90:40;v&&(v.classList.toggle("solid",e>Math.min(t,120)||f.classList.contains("h-split")&&innerWidth>760&&e>10),f.classList.contains("nav-open")||v.classList.toggle("hide",e>t&&e>g+4),e<g-4&&v.classList.remove("hide")),E&&E.classList.toggle("on",e>t*.6),g=e,m=!1}u(w,"onScroll"),addEventListener("scroll",function(){m||(m=!0,requestAnimationFrame(w))},{passive:!0}),w();var h=n(".burger");h&&(h.addEventListener("click",function(){var e=f.classList.toggle("nav-open");h.setAttribute("aria-expanded",e)}),i(".drawer a").forEach(function(e){e.addEventListener("click",function(){f.classList.remove("nav-open"),h.setAttribute("aria-expanded","false")})}));var r=n("#languages");i("[data-lang-open]").forEach(function(e){e.addEventListener("click",function(t){r&&(t.preventDefault(),f.classList.remove("nav-open"),r.showModal?r.showModal():r.setAttribute("open",""))})}),i("[data-lang-close]").forEach(function(e){e.addEventListener("click",function(){r.close?r.close():r.removeAttribute("open")})}),r&&r.addEventListener("click",function(e){e.target===r&&r.close()});var c=i(".hero-media img"),l=n(".hero-dots"),d=0;c.length&&(c[0].classList.add("on"),l&&c.forEach(function(e,t){var a=document.createElement("i");t||(a.className="on"),l.appendChild(a)}),c.length>1&&!b&&setInterval(function(){c[d].classList.remove("on"),l&&l.children[d].classList.remove("on"),d=(d+1)%c.length;var e=c[d];e.loading==="lazy"&&(e.loading="eager"),e.classList.add("on"),l&&l.children[d].classList.add("on")},5600));var k=i(".rv");if("IntersectionObserver"in window&&!b){var S=new IntersectionObserver(function(e){e.forEach(function(t){t.isIntersecting&&(t.target.classList.add("in"),S.unobserve(t.target))})},{rootMargin:"0px 0px -8% 0px"});k.forEach(function(e){S.observe(e)})}else k.forEach(function(e){e.classList.add("in")});var M=window.OPEFAC_CONFIG||{},L=M.OMOTENASHI||{};function _(e,t){var a=String((L.STORES||{})[e]||"").trim();if(!a)return"";try{var O=new URL(/^https?:/i.test(a)?a:(L.BASE||"https://omotenashi.ai-sns.io/reserve.html")+"?"+a.replace(/^\?/,"")),o=O.searchParams;return o.set("line",t==="line"?"1":"0"),o.get("lang")||o.set("lang",(document.documentElement.lang||"ja").slice(0,2)),o.set("src",L.SRC||"opefac_web"),o.set("utm_source","opefac.com"),o.set("utm_medium","shop-site"),o.set("utm_campaign",e),o.set("utm_content",t==="line"?"line":"web"),O.toString()}catch{return""}}if(u(_,"reserveUrl"),i("a[data-reserve]").forEach(function(e){var t=_(e.dataset.reserve,e.dataset.mode);if(t)e.href=t,e.target="_blank",e.rel="noopener";else if(e.dataset.mode==="line"){var a=e.closest(".tp-book-line");(a||e).hidden=!0}}),"serviceWorker"in navigator&&location.protocol==="https:"){var y=document.querySelector('script[src*="sites/site"]');y&&addEventListener("load",function(){navigator.serviceWorker.register(new URL("../../sw.js",y.src)).catch(function(){})})}var s=n("dialog.lightbox");if(s){var A=n("img",s);i(".gallery button").forEach(function(e){e.addEventListener("click",function(){var t=n("img",e);A.src=t.currentSrc||t.src,A.alt=t.alt,s.showModal()})}),n("button",s).addEventListener("click",function(){s.close()}),s.addEventListener("click",function(e){e.target===s&&s.close()})}})();1var M=Object.defineProperty;var v=(n,s)=>M(n,"name",{value:s,configurable:!0});(function(){var n=v(function(e,t){return(t||document).querySelector(e)},"$"),s=v(function(e,t){return Array.prototype.slice.call((t||document).querySelectorAll(e))},"$$"),f=document.body,h=n(".sh"),L=n(".hero"),b=n(".mbar"),w=matchMedia("(prefers-reduced-motion: reduce)").matches;(function(){var e=window.OPEFAC_CONFIG||{};if(e.CHAT_IFRAME_SRC){var t=document.currentScript&&document.currentScript.src||"",i=t.replace(/assets\/sites\/site(\.min)?\.js.*$/,""),u=document.createElement("script");u.src=i+"assets/chat.js?v=20261202e",u.async=!0,document.head.appendChild(u)}})();var g=scrollY,p=!1;function S(){var e=scrollY,t=L?L.offsetHeight-90:40;h&&(h.classList.toggle("solid",e>Math.min(t,120)||f.classList.contains("h-split")&&innerWidth>760&&e>10),f.classList.contains("nav-open")||h.classList.toggle("hide",e>t&&e>g+4),e<g-4&&h.classList.remove("hide")),b&&b.classList.toggle("on",e>t*.6),g=e,p=!1}v(S,"onScroll"),addEventListener("scroll",function(){p||(p=!0,requestAnimationFrame(S))},{passive:!0}),S();var m=n(".burger");m&&(m.addEventListener("click",function(){var e=f.classList.toggle("nav-open");m.setAttribute("aria-expanded",e)}),s(".drawer a").forEach(function(e){e.addEventListener("click",function(){f.classList.remove("nav-open"),m.setAttribute("aria-expanded","false")})}));var r=n("#languages");s("[data-lang-open]").forEach(function(e){e.addEventListener("click",function(t){r&&(t.preventDefault(),f.classList.remove("nav-open"),r.showModal?r.showModal():r.setAttribute("open",""))})}),s("[data-lang-close]").forEach(function(e){e.addEventListener("click",function(){r.close?r.close():r.removeAttribute("open")})}),r&&r.addEventListener("click",function(e){e.target===r&&r.close()});var c=s(".hero-media img"),l=n(".hero-dots"),d=0;c.length&&(c[0].classList.add("on"),l&&c.forEach(function(e,t){var i=document.createElement("i");t||(i.className="on"),l.appendChild(i)}),c.length>1&&!w&&setInterval(function(){c[d].classList.remove("on"),l&&l.children[d].classList.remove("on"),d=(d+1)%c.length;var e=c[d];e.loading==="lazy"&&(e.loading="eager"),e.classList.add("on"),l&&l.children[d].classList.add("on")},5600));var k=s(".rv");if("IntersectionObserver"in window&&!w){var A=new IntersectionObserver(function(e){e.forEach(function(t){t.isIntersecting&&(t.target.classList.add("in"),A.unobserve(t.target))})},{rootMargin:"0px 0px -8% 0px"});k.forEach(function(e){A.observe(e)})}else k.forEach(function(e){e.classList.add("in")});var _=window.OPEFAC_CONFIG||{},E=_.OMOTENASHI||{};function C(e,t){var i=String((E.STORES||{})[e]||"").trim();if(!i)return"";try{var u=new URL(/^https?:/i.test(i)?i:(E.BASE||"https://omotenashi.ai-sns.io/reserve.html")+"?"+i.replace(/^\?/,"")),o=u.searchParams;return o.set("line",t==="line"?"1":"0"),o.get("lang")||o.set("lang",(document.documentElement.lang||"ja").slice(0,2)),o.set("src",E.SRC||"opefac_web"),o.set("utm_source","opefac.com"),o.set("utm_medium","shop-site"),o.set("utm_campaign",e),o.set("utm_content",t==="line"?"line":"web"),u.toString()}catch{return""}}if(v(C,"reserveUrl"),s("a[data-reserve]").forEach(function(e){var t=C(e.dataset.reserve,e.dataset.mode);if(t)e.href=t,e.target="_blank",e.rel="noopener";else if(e.dataset.mode==="line"){var i=e.closest(".tp-book-line");(i||e).hidden=!0}}),"serviceWorker"in navigator&&location.protocol==="https:"){var y=document.querySelector('script[src*="sites/site"]');y&&addEventListener("load",function(){navigator.serviceWorker.register(new URL("../../sw.js",y.src)).catch(function(){})})}var a=n("dialog.lightbox");if(a){var O=n("img",a);s(".gallery button").forEach(function(e){e.addEventListener("click",function(){var t=n("img",e);O.src=t.currentSrc||t.src,O.alt=t.alt,a.showModal()})}),n("button",a).addEventListener("click",function(){a.close()}),a.addEventListener("click",function(e){e.target===a&&a.close()})}})();
assets/sites/site.js+9
assets/sites/site.min.js+1-1