PageSourceSearch

https://www.honda.at/etc/designs/honda/hme-core-front-end/social-share.neh22oqcokexlmxs.js

js honda.at collected 2026-10-02 17:47:44 UTC 2,879 bytes, 1 lines download raw bytes

1var t=Object.defineProperty,e=(e,s,i)=>((e,s,i)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[s]=i)(e,"symbol"!=typeof s?s+"":s,i),s=(t,e,s)=>new Promise((i,n)=>{var o=t=>{try{a(s.next(t))}catch(e){n(e)}},r=t=>{try{a(s.throw(t))}catch(e){n(e)}},a=t=>t.done?i(t.value):Promise.resolve(t.value).then(o,r);a((s=s.apply(t,e)).next())});import{h as i}from"./index.cz83wh4sws6slzdm.js";import{A as n}from"./index.fwy4myo0zwt1lnjt.js";const o="social-share",r=`[data-hme-is="${o}"]`,a="hme-social-share--liked",l="hme-social-share--error";class h extends n{constructor(){super(...arguments),e(this,"isSubmitting",!1),e(this,"handleLikeClick",()=>s(this,null,function*(){var t;this.isSubmitting||(null==(t=this.sessionStorageData.hash)?void 0:t.includes(i(this.options.pageUrl)))||(this.isSubmitting=!0,yield this.sendLike())}))}init(){var t;if(this.setSessionStorageHash(i(r)),this.updateShareCount(),null==(t=this.sessionStorageData.hash)?void 0:t.includes(i(this.options.pageUrl)))return this.toggleButtonState(!0),void this.toggleError(!1);this.elements.likeButton.addEventListener("click",this.handleLikeClick,{once:!0})}updateShareCount(){return s(this,null,function*(){const t=yield this.fetchData("GET");t.success?this.updateLikeCount(t.data.likes):console.error("Share count error:",t.error)})}sendLike(){return s(this,null,function*(){const t={uri:this.options.pageUrl,signature:this.options.signature};try{const e=yield this.fetchData("POST",t);if(!e.success)return console.error("Like failed:",e.error),this.toggleError(!0),void this.elements.likeButton.addEventListener("click",this.handleLikeClick,{once:!0});const s=e.data.newLikes;this.updateLikeCount(s),this.toggleButtonState(!0),this.sessionStorageData.hash=this.sessionStorageData.hash||[],this.sessionStorageData.hash.push(i(this.options.pageUrl)),this.toggleError(!1)}finally{this.isSubmitting=!1}})}fetchData(t,e){return s(this,null,function*(){const s="GET"===t?this.getLikesUrl():this.options.likesUrl;try{const i=yield fetch(s,{method:t,headers:{"Content-Type":"application/json"},body:e?JSON.stringify(e):void 0});if(!i.ok)return{success:!1,error:`HTTP ${i.status}`};return{success:!0,data:yield i.json()}}catch(i){return{success:!1,error:String(i)}}})}getLikesUrl(){const t=new URL(this.options.likesUrl,window.location.origin);return t.searchParams.set("uri",this.options.pageUrl),t.toString()}updateLikeCount(t){this.elements.likeCount.textContent=String(t);const e=this.options.likeText.includes("{0}")?this.options.likeText.replace("{0}",String(t)):`${this.options.likeText} ${t}`;this.elements.likeButton.setAttribute("aria-label",e)}toggleButtonState(t){this.elements.self.classList.toggle(a,t),this.elements.likeButton.setAttribute("aria-pressed",String(t))}toggleError(t){this.elements.self.classList.toggle(l,t)}}e(h,"SELF",r),e(h,"NS","hme"),e(h,"IS",o);export{h as default};

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.