/* OK ITHAKI V249526R10F19 - FEED SELF AVATAR / OWN POSTS / UNIFIED PROFILE AVATAR */
(function(){'use strict';if(window.__ITHAKI_V249491__)return;window.__ITHAKI_V249491__=true;window.__ITHAKI_V249499_FEED_RUNTIME__={ownAvatarCapture:true,storyPhotoVisible:true,adminContactVisible:true,feedSelfAvatarOwnPostsR10F19:true,unifiedHomeAvatarR10F19:true};window.FEED_SELF_AVATAR_OPENS_ALL_OWN_POSTS_R10F19=true;window.AVATARS_MATCH_HOME_R10F19=true;
const $=id=>document.getElementById(id),I=()=>window.ITH||{},S=()=>I().state||window.state||{};
function css(){if($('ithV249491Css'))return;const s=document.createElement('style');s.id='ithV249491Css';s.textContent=`
body[data-screen-theme="mountain"] .ithActionsV249461{--ith491-a:rgba(54,91,104,.95);--ith491-b:rgba(23,48,61,.95);--ith491-line:rgba(186,231,239,.34);--ith491-glow:rgba(121,220,236,.20)}
body[data-screen-theme="sea"] .ithActionsV249461{--ith491-a:rgba(7,103,132,.95);--ith491-b:rgba(3,55,78,.96);--ith491-line:rgba(116,224,255,.38);--ith491-glow:rgba(57,207,255,.22)}
body[data-screen-theme="sunset"] .ithActionsV249461{--ith491-a:rgba(104,48,83,.95);--ith491-b:rgba(54,25,62,.96);--ith491-line:rgba(255,172,191,.38);--ith491-glow:rgba(255,114,164,.20)}
body[data-screen-theme="night"] .ithActionsV249461{--ith491-a:rgba(19,37,67,.96);--ith491-b:rgba(4,14,31,.98);--ith491-line:rgba(151,170,255,.30);--ith491-glow:rgba(110,131,255,.18)}
.ithActionsV249461 .ithActionV249461{background:linear-gradient(145deg,var(--ith491-a,rgba(24,59,84,.96)),var(--ith491-b,rgba(5,20,34,.98)))!important;border-color:var(--ith491-line,rgba(255,255,255,.18))!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.16),inset 0 -12px 24px rgba(0,0,0,.20),0 14px 30px rgba(0,0,0,.28),0 0 22px var(--ith491-glow,transparent)!important}
[data-v249461-action="external"] b{font-size:0!important}[data-v249461-action="external"] b:after{content:"Κέντρο Μηνυμάτων";font-size:clamp(13px,2vw,18px)!important}[data-v249461-action="external"] small{display:none!important}[data-v249461-action="external"] .ithActionIconV249461{font-size:0!important}[data-v249461-action="external"] .ithActionIconV249461:after{content:"✉";font-size:34px!important}
#feedPage .avatar,#feedPage .avatar img,#feedPage .postAvatar,#feedPage .postAvatar img,#feedPage [class*="Avatar"],#feedPage [class*="Avatar"] img,#ith477StoryBarWrap img{filter:none!important;opacity:1!important;mix-blend-mode:normal!important;visibility:visible!important;transform:none!important}
#ith477StoryBarWrap{display:block!important;visibility:visible!important;opacity:1!important;background:transparent!important;border-color:rgba(255,255,255,.14)!important}
#ith477StoryBarWrap .ith477StoryRing,#ith477StoryBarWrap .ith481StoryAvatar{width:74px!important;height:74px!important;min-width:74px!important;background:rgba(255,255,255,.14)!important;border:3px solid #f0c96d!important;filter:none!important;opacity:1!important}
#ith477StoryBarWrap .ith477StoryCircle{display:block!important;opacity:1!important;filter:none!important}
#feedPage .mediaPost .leftActions .feedAvatarOverlay{display:flex!important;visibility:visible!important;opacity:1!important;filter:none!important}#feedPage .feedAvatarOverlay .avatar,#feedPage .feedAvatarOverlay .avatar img{display:block!important;visibility:visible!important;opacity:1!important;filter:none!important;mix-blend-mode:normal!important}.ith497SwipeToast{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);z-index:2147483640;padding:10px 14px;border-radius:999px;background:rgba(3,18,31,.88);border:1px solid rgba(255,215,110,.38);color:#fff;font-weight:900;box-shadow:0 14px 38px rgba(0,0,0,.42);pointer-events:none}

/* V249498: clear Story avatars, fully transparent raised bottom bar, no dark avatar backgrounds. */
body[data-page="feed"] #ith477StoryBarWrap{background:transparent!important;border:0!important;box-shadow:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
body[data-page="feed"] #ith477StoryBarWrap .ith477StoryRing,body[data-page="feed"] #ith477StoryBarWrap .ith481StoryAvatar{background:transparent!important;filter:none!important;opacity:1!important}
body[data-page="feed"] #ith477StoryBarWrap img{background:transparent!important;filter:none!important;opacity:1!important;visibility:visible!important;mix-blend-mode:normal!important}
#feedPage .mediaPost .leftActions .feedAvatarOverlay,#feedPage .mediaPost .leftActions .feedAvatarOverlay .avatar{background:transparent!important;filter:none!important;opacity:1!important}
#feedPage .mediaPost .leftActions .feedAvatarOverlay .avatar img{filter:none!important;opacity:1!important;visibility:visible!important;mix-blend-mode:normal!important}
body .nav{bottom:max(15px,calc(env(safe-area-inset-bottom) + 8px))!important;background:transparent!important;border:1px solid rgba(255,255,255,.18)!important;box-shadow:0 8px 24px rgba(0,0,0,.18)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;overflow:visible!important}
body .nav button{background:transparent!important}

#ith477StoryBarWrap .ith519FeedSelfCard{order:-999!important}.ith519FeedSelfButton{border:0;background:transparent;color:#fff;display:grid;justify-items:center;gap:4px;width:78px;padding:0}.ith519FeedSelfButton .avatarDotWrap{position:relative;display:block;width:74px;height:74px}.ith519FeedSelfButton .avatar{width:74px!important;height:74px!important;min-width:74px!important;border-radius:50%!important;display:grid!important;place-items:center!important;overflow:hidden!important;background:transparent!important;border:3px solid #36f0a0!important;box-shadow:0 0 0 4px rgba(54,240,160,.10),0 10px 26px rgba(0,0,0,.28)!important;color:#fff!important;font-weight:950!important}.ith519FeedSelfButton .avatar img{width:100%!important;height:100%!important;object-fit:cover!important}.ith519FeedSelfButton .avatarDotWrap>i{position:absolute;right:2px;bottom:2px;width:13px;height:13px;border-radius:50%;background:#36f0a0;border:2px solid rgba(4,17,29,.96);box-shadow:0 0 8px rgba(54,240,160,.7)}.ith519FeedSelfButton small{max-width:78px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:rgba(239,248,255,.85);font-size:10px}
@media(max-width:520px){body .nav{bottom:max(13px,calc(env(safe-area-inset-bottom) + 7px))!important}}
`;document.head.appendChild(s)}
function selfAvatarMarkupR10F19(){const s=S(),name=String(s.name||localStorage.getItem('ith_name')||'Εγώ'),raw=String(s.avatar||localStorage.getItem('ith_avatar')||s.animal||localStorage.getItem('ith_animal')||''),src=/^(data:image\/|https?:\/\/|blob:|\/)/i.test(raw)||/\.(png|jpe?g|gif|webp|svg)(\?.*)?$/i.test(raw)?raw:'',animal=raw.startsWith('animal:')?raw.slice(7):(!src&&raw?raw:''),fallback=String(name.trim().slice(0,1)||'Ε').toUpperCase();return `<span class="avatarDotWrap"><span class="avatar">${src?`<img src="${src.replace(/"/g,'&quot;')}" alt="" onerror="this.remove();this.parentElement.textContent='${fallback}'">`:(animal||fallback)}</span><i class="on"></i></span><small>${name.replace(/[&<>]/g,c=>({'&':'&amp;','<':'&lt;','>':'&gt;'}[c]))}</small>`}
function ensureFeedSelfAvatarR10F19(){const wrap=$('ith477StoryBarWrap'),bar=wrap&&wrap.querySelector('.ith477StoryBar');if(!bar)return false;let card=bar.querySelector('[data-feed-self-posts-r10f19]');if(!card){card=document.createElement('div');card.className='ith497StoryCard ith519FeedSelfCard';card.setAttribute('data-feed-self-posts-r10f19','1');card.innerHTML='<button type="button" class="ith519FeedSelfButton" title="Οι δημοσιεύσεις μου"></button>';bar.prepend(card)}const btn=card.querySelector('button');if(btn){btn.innerHTML=selfAvatarMarkupR10F19();btn.onclick=e=>{e.preventDefault();e.stopPropagation();return ownPosts('')}}return true}
function tidyHome(){const box=document.querySelector('.ithActionsV249461');if(!box)return;const ext=box.querySelector('[data-v249461-action="external"]');if(ext){const b=ext.querySelector('b');if(b)b.textContent='Κέντρο Μηνυμάτων';const sm=ext.querySelector('small');if(sm)sm.textContent='';ext.title='Κέντρο εξωτερικών μηνυμάτων και ημερολόγιο'} }
function memberPosts(id,startPost){const a=I(),d=String(id||'');if(!d)return false;try{if(typeof a.openMemberFeed==='function')return a.openMemberFeed(d,String(startPost||''));if(typeof window.openMemberFeed==='function')return window.openMemberFeed(d,String(startPost||''))}catch(e){}return false}
function ownPosts(startPost){const s=S(),d=String(s.device||s.device_id||'');return memberPosts(d,startPost)}
function swipeToast497(text){let x=$('ith497SwipeToast');if(x)x.remove();x=document.createElement('div');x.id='ith497SwipeToast';x.className='ith497SwipeToast';x.textContent=text;document.body.appendChild(x);setTimeout(()=>x.remove(),900)}
let swipe497=null;function installSwipe497(){if(window.__ITHAKI_SWIPE_MEMBER_INSTALLED_V249497__)return;window.__ITHAKI_SWIPE_MEMBER_INSTALLED_V249497__=true;document.addEventListener('touchstart',e=>{try{if(document.body.dataset.page!=='feed'||document.body.classList.contains('memberFeedV249485')||document.body.classList.contains('memberFeedTikTokV249494'))return;const t=e.target;if(t&&t.closest&&t.closest('#ith477StoryBarWrap,.nav,button,input,textarea,select,a,.leftActions,.feedDescOverlayV249287,.commentPanel,.previewModal'))return;const touch=e.touches&&e.touches[0],post=t&&t.closest?t.closest('#feedPage [data-post][data-sender]'):null;if(!touch||!post)return;swipe497={x:touch.clientX,y:touch.clientY,post:post,time:Date.now()} }catch(_){swipe497=null}},{passive:true});document.addEventListener('touchend',e=>{const st=swipe497;swipe497=null;if(!st)return;try{const t=e.changedTouches&&e.changedTouches[0];if(!t)return;const dx=t.clientX-st.x,dy=t.clientY-st.y;if(dx>-72||Math.abs(dx)<Math.abs(dy)*1.35||Date.now()-st.time>1400)return;const id=String(st.post.dataset.sender||''),pid=String(st.post.dataset.post||'');if(!id)return;st.post.classList.add('ith497SwipeOpening');swipeToast497((document.documentElement.lang||'el').toLowerCase().startsWith('en')?'Opening member posts…':'Άνοιγμα δημοσιεύσεων μέλους…');setTimeout(()=>memberPosts(id,pid),170)}catch(_){}} ,{passive:true});I().openMemberPostsBySwipeV249497=memberPosts}
document.addEventListener('click',e=>{const q=e.target&&e.target.closest?e.target.closest('#feedPage .feedAvatarOverlay,#feedPage .leftActions .avatar,#feedPage .leftActions .avatarDotWrap,#feedPage .postAvatar,#feedPage .postHead .avatar,#feedPage .postHead>button'):null;if(!q)return;const post=q.closest('[data-post][data-sender],.mediaPost[data-sender],.postCard[data-sender]');const id=String(post&&post.getAttribute('data-sender')||''),me=String(S().device||S().device_id||'');if(me&&id===me){e.preventDefault();e.stopPropagation();if(typeof e.stopImmediatePropagation==='function')e.stopImmediatePropagation();ownPosts(post&&post.getAttribute('data-post')||'');return false}},true);
function canonical(){return false}
function run(){css();tidyHome();installSwipe497();ensureFeedSelfAvatarR10F19();document.documentElement.setAttribute('data-ithaki-v249491','visible-feed-avatar-own-posts-swipe-member-v249498');document.documentElement.setAttribute('data-ithaki-v249499-feed','runtime-own-feed-admin-inbox-story-avatar-photo')}
new MutationObserver(()=>{clearTimeout(window.__ith491mo);window.__ith491mo=setTimeout(run,100)}).observe(document.documentElement,{subtree:true,childList:true,attributes:true,attributeFilter:['data-screen-theme','class']});
if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',run,{once:true});else run();setTimeout(run,800)
})();
