PageSourceSearch

https://petstory.ru/product-finder/_nuxt/BM5NU7O2.js

js petstory.ru collected 2026-09-24 09:07:56 UTC 6,691 bytes, 1 lines download raw bytes

1import{e as ut,n as $,f as st,B as l,j as f,h as A,k as L,H as c,q as ct,p as lt,O as R,L as V,D as H,ac as z,l as rt,aj as dt,z as r,r as m}from"./BmBKTJoK.js";import{a as ft,u as mt,i as G}from"./B3_dHegs.js";import{q as vt,J as pt,t as B,W as gt}from"./BC6ytVF3.js";import{useAuthModal as kt}from"./BIR9CoUP.js";import yt from"./BX14ckME.js";import Ct from"./utvuWCED.js";import Nt from"./1yo7q9Fi.js";import ht from"./CdgjhS8a.js";import{_ as _t}from"./DlAUqK2U.js";const St="pslib:notification-badge",W="pslib_notification_session",F="pslib:notification-badge-state";let v=null,D="";function bt(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`}function Et(t){const o=`${encodeURIComponent(t)}=`,n=document.cookie.split("; ").find(e=>e.startsWith(o));return n?decodeURIComponent(n.slice(o.length)):null}function wt(t,o){if(!t)return"guest";if(o)return`user:${o}`;let n=2166136261;for(let e=0;e<t.length;e+=1)n^=t.charCodeAt(e),n=Math.imul(n,16777619);return`token:${(n>>>0).toString(36)}`}function J(t){return`${F}:${encodeURIComponent(t)}`}function j(){const t=Et(W);if(t)return D=t,t;const o=D||bt();return D=o,document.cookie=`${encodeURIComponent(W)}=${encodeURIComponent(o)}; Path=/; SameSite=Lax`,o}function C(t,o){return{sessionId:t,identityKey:o,unreadCount:null,count:null,isFakeNotificationRead:!1}}function It(t,o,n){if(!t)return C(o,n);try{const e=JSON.parse(t);return e.sessionId!==o||e.identityKey!==n?C(o,n):{sessionId:o,identityKey:n,unreadCount:typeof e.unreadCount=="number"?Math.max(0,e.unreadCount):null,count:typeof e.count=="number"&&Number.isFinite(e.count)?Math.max(0,e.count):null,isFakeNotificationRead:e.isFakeNotificationRead===!0}}catch{return C(o,n)}}function qt(t,o,n){const e=Math.max(0,o),N=typeof n=="number"&&Number.isFinite(n)?Math.max(0,n):t.count,p=e>0&&(t.unreadCount===null||e>t.unreadCount);return{state:{...t,unreadCount:e,count:N},shouldAnimate:p}}function q(t,o){try{const n=localStorage.getItem(J(o))??localStorage.getItem(F),e=It(n,t,o);return v=e,e}catch{return v?.sessionId===t&&v.identityKey===o?v:C(t,o)}}function At(t){v=t;try{localStorage.setItem(J(t.identityKey),JSON.stringify(t)),localStorage.setItem(F,JSON.stringify(t))}catch{}}function Bt(t){if(!(typeof BroadcastChannel>"u"))try{const o=new BroadcastChannel(St);o.postMessage(t),setTimeout(()=>o.close())}catch{}}function Dt(t,o){const n={...q(t,o),unreadCount:0,isFakeNotificationRead:!0};return At(n),Bt(n),n}const Ft={class:"modal-notifications"},Tt={class:"modal-notifications__content"},Mt={class:"modal-notifications__breeds-tabs"},Ot=["disabled","onClick"],xt={class:"modal-notifications__empty-block-title"},Ut={__name:"NotificationsModal",props:{isCommunityNotifyEnhanceTest:{type:String,required:!1}},emits:["close","item-click"],setup(t,{emit:o}){const n=o,e=ft(),{notificationListOpen:N,notificationListView:p,notificNotAutorizListOpen:X,notificNotAutorizListClick:P}=mt(),h=vt(),_=m(),K=m(0),s=m(""),g=m([]),k=m(!1),S=r(()=>d.value?e.getNotifications:s.value==="sent"&&T.value.status==="read"?[]:[T.value]),Y=[{id:"",label:"Все"},{id:"sent",label:"Непрочитанные"}],b=r(()=>e.getTotalCount),Q=r(()=>!y.value&&S.value.length===0),T=r(()=>e.getFakeNotification),Z=r(()=>({sent:"Вы просмотрели все уведомления",read:"Прочитанных уведомлений нет"})?.[s.value]||"Уведомлений пока нет"),y=r(()=>e.getLoading),tt=r(()=>e.getHasMore),d=r(()=>G()||!!(h.getAuthToken||B("X-Auth-Token").value));function M(){if(G())return"mock";const i=h.getAuthToken||B("X-Auth-Token").value,a=h.getUserId||B("X-User-Id").value;return wt(i,a)}const E=()=>n("close"),O=i=>{i.key==="Escape"&&E()},et=async i=>{s.value===i||y.value||(k.value=!1,s.value=i,K.value=0,e.setHasMore(!0),e.setOffset(0),await w(!0),d.value&&(p(s.value?"Непрочитанное":"Все",b.value),await $(),k.value=!0))},w=async(i=!1)=>{await e.loadNotifications({clear:i,status:s.value||void 0})},ot=()=>{if(!_.value||!tt.value)return;const{scrollTop:i,scrollHeight:a,clientHeight:u}=_.value;i+u>=a-100&&w()},x=pt(),nt=i=>{if(!d.value){e.setFakeNotificationStatus(!0),Dt(j(),M()),U("notice");return}n("item-click",i)},U=i=>{n("close"),P(i),x.pushAuthWay(gt.Notifications);const{open:a}=kt({onAuthenticated:async()=>{await e.fetchUnreadCount()},onClosed:()=>x.popAuthWay()});a()},it=i=>{g.value.includes(i)||(g.value=[...g.value,i])};return ut(async()=>{const i=q(j(),M());e.setFakeNotificationStatus(i.isFakeNotificationRead),document.body.style.overflow="hidden",await w(!0),window.addEventListener("keyup",O),d.value?(N(b.value),p(s.value?"Непрочитанное":"Все",b.value),await $(),k.value=!0):X()}),st(()=>{document.body.style.overflow="",window.removeEventListener("keyup",O),e.setHasMore(!0),e.setOffset(0)}),(i,a)=>(l(),f("div",Ft,[y.value?(l(),A(Ct,{key:0})):L("",!0),c("div",{class:"modal-notifications-overlay",onClick:E},[c("div",{class:"modal-notifications-body",onClick:a[1]||(a[1]=ct(()=>{},["stop"]))},[c("div",{class:"modal-notifications-cross",onClick:E},[lt(Nt)]),c("div",Tt,[a[2]||(a[2]=c("h2",{class:"modal-notifications__title"}," Уведомления ",-1)),c("div",Mt,[(l(),f(R,null,V(Y,u=>c("button",{key:u.id,class:H(["modal-notifications__breeds-tabs-item",{active:s.value===u.id}]),disabled:y.value,onClick:I=>et(u.id)},z(u.label),11,Ot)),64))])]),!Q.value&&S.value.length?(l(),f("div",{key:0,ref_key:"listContainer",ref:_,class:"modal-notifications__list",onScroll:ot},[(l(!0),f(R,null,V(S.value,(u,I)=>(l(),A(yt,{key:u.id||I,notification:u,"active-tab":s.value,"is-community-notify-enhance-test":t.isCommunityNotifyEnhanceTest,index:I,"is-viewed":g.value.includes(u.id),"view-tracking-enabled":k.value,onClick:at=>nt(u),onView:at=>it(u.id)},null,8,["notification","active-tab","is-community-notify-enhance-test","index","is-viewed","view-tracking-enabled","onClick","onView"]))
1),128))],544)):(l(),f("div",{key:1,class:H(["modal-notifications__empty-block",{"modal-notifications__empty-block--auth":d.value}])},[c("p",xt,z(Z.value),1),a[3]||(a[3]=c("div",{class:"modal-notifications__empty-block-logo"},null,-1))],2)),d.value?L("",!0):(l(),A(ht,{key:2,onClick:a[0]||(a[0]=u=>U("button")),"btn-class":"brand","padding-y":13,"padding-x":60,class:"modal-notifications__auth"},{default:rt(()=>[...a[4]||(a[4]=[dt("Войти",-1)])]),_:1}))])])]))}},$t=_t(Ut,[["__scopeId","data-v-64e756ce"]]),Xt=Object.freeze(Object.defineProperty({__proto__:null,default:$t},Symbol.toStringTag,{value:"Module"}));export{St as N,$t as a,qt as b,Bt as c,wt as d,J as e,F as f,j as g,Xt as h,It as p,q as r,At as w};

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.