PageSourceSearch

https://carsweek.ru/push-subscribe/push-sw.js

js carsweek.ru collected 2026-10-02 10:53:34 UTC 3,648 bytes, 1 lines download raw bytes

1!function(t){function e(i){if(n[i])return n[i].exports;var a=n[i]={i:i,l:!1,exports:{}};return t[i].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,'a',n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=8)}({8:function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();!function(){var t={api:'/push-subscribe/'},e=function(){function t(e){i(this,t),this.data=this.dataParse(e)}return a(t,[{key:'dataParse',value:function(t){try{return t.json()}catch(t){return this.defaultData}}},{key:'showNotification',value:function(){var t=this,e=this.messageData;return r({event_id:o('notificationview'),multicast_code:e.message.data.messageid}),self.registration.showNotification(e.title,e.message).then(function(){e.message.duration&&setTimeout(function(){t.closeNotification(e.message.data.messageid)},1e3*e.message.duration)})}},{key:'closeNotification',value:function(t){self.registration.getNotifications().then(function(e){for(var n=0;n<e.length;n++){e[n].data.messageid===t&&e[n].close()}})}},{key:'generateButtons',value:function(t){var e=[];if(t&&t.length)for(var n=0;n<t.length;n++)e.push({action:t[n].action,url:t[n].url});return e}},{key:'defaultData',get:function(){return{title:'Pesapallo',body:'Web push notification for Bitrix CMS',icon:'https://pesapallo.ru/default-icon-logo.png',url:'https://pesapallo.ru/',duration:30}}},{key:'messageData',get:function(){var t=this.data,e=t.multicast_code?t.multicast_code:Date.now(),n=t.buttons?t.buttons:[];return{title:t.title,message:{body:t.body,icon:t.icon,image:t.image||'',vibrate:t.vibrate||[300,100,400,100,400],direction:t.direction||'auto',duration:t.duration||60,tag:e,badge:t.badge||'',requireInteraction:!!t.requireInteraction&&t.requireInteraction,actions:n,data:{actions:n,buttons:this.generateButtons(t.buttons),messageid:e,url:t.url}}}}}]),t}(),n=function(t,e){return t.waitUntil(clients.matchAll({type:'window'}).then(function(t){for(var n=0;n<t.length;n++){var i=t[n];
1if(i.url==e&&'focus'in i)return i.focus()}if(clients.openWindow)return clients.openWindow(e)}))},o=function(t){return t.replace('notification','notification_')},r=function(e){var n=new FormData;n.append('json',JSON.stringify(Object.assign({},e,{type:'event'}))),fetch(t.api,{method:'POST',credentials:'include',body:n}).catch(function(t){console.error(t)})};self.addEventListener('install',function(t){t.waitUntil(self.skipWaiting())}),self.addEventListener('activate',function(t){t.waitUntil(clients.claim())}),self.addEventListener('push',function(t){var n=new e(t.data);t.waitUntil(n.showNotification())}),self.addEventListener('notificationclick',function(t){var e=t.notification.data;if(e){if(!t.action)return t.notification.close(),r({event_id:o(t.type),action:'default',multicast_code:e.messageid}),n(t,e.url);for(var i=0;i<e.buttons.length;i++)if(e.buttons[i].action===t.action)return r({event_id:o(t.type),action:t.action,multicast_code:e.messageid}),n(t,e.buttons[i].url)}}),self.addEventListener('notificationclose',function(t){t.notification.close();var e=t.notification.data;e&&r({event_id:o(t.type),multicast_code:e.messageid})})}()}});

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.