PageSourceSearch

https://freelance.ru/web/js/polaris-site.js?v=1790794797

js freelance.ru collected 2026-10-01 08:35:15 UTC 7,451 bytes, 1 lines download raw bytes

1"use strict";(()=>{var p="plrs_anon",g="plrs_sess",_="plrs_sess_ts";var d=class{d;queue=[];userId;maxBatch;anonId;constructor(e){this.d=e,this.userId=e.userId??null,this.maxBatch=e.maxBatch??20,this.anonId=this.loadAnon()}setUser(e){this.userId=e}track(e){let n={event_id:this.d.uuid(),ts:this.d.now(),schema_version:1,anon_id:this.anonId,user_id:this.userId,session_id:this.loadSession(),page_url:this.d.pageURL(),referrer:this.d.referrer(),...e};this.queue.push(n),this.d.log?.({kind:"track",event:n}),this.queue.length>=this.maxBatch&&this.flush()}flush(){if(this.queue.length===0)return;let e=this.queue;this.queue=[];let n=this.d.endpoint.replace(/\/$/,"")+"/e",r=this.d.transport.send(n,JSON.stringify(e));this.d.log?.({kind:"flush",count:e.length,ok:r,url:n}),r||(this.queue=e.concat(this.queue))}pageView(){this.track({event_name:"page_view"})}profileView(e){this.track({event_name:"profile_view",entity_type:"profile",entity_id:e})}searchPerformed(e,n){this.track({event_name:"search_performed",query:e,results_count:n})}searchResultClicked(e,n,r,i="search"){this.track({event_name:"search_result_clicked",entity_type:"profile",entity_id:e,position:n,query:r,surface:i})}messageClick(e){this.track({event_name:"message_click",entity_type:"profile",entity_id:e})}phoneClick(e){this.track({event_name:"phone_click",entity_type:"profile",entity_id:e})}outboundClick(e,n){this.track({event_name:"outbound_click",entity_type:"profile",entity_id:e,props:{target:n}})}bookmark(e,n){this.track({event_name:n?"bookmark_added":"bookmark_removed",entity_type:"profile",entity_id:e})}loadAnon(){if(this.d.anonId)return this.d.local.set(p,this.d.anonId),this.d.anonId;let e=this.d.local.get(p);return e||(e=this.d.uuid(),this.d.local.set(p,e)),e}loadSession(){let e=this.d.now(),n=Number(this.d.session.get(_)??0),r=this.d.session.get(g);return(!r||e-n>18e5)&&(r=this.d.uuid(),this.d.session.set(g,r)),this.d.session.set(_,String(e)),r}};var h=class{setUser(){}track(){}flush(){}pageView(){}profileView(){}searchPerformed(){}searchResultClicked(){}messageClick(){}phoneClick(){}outboundClick(){}bookmark(){}};function k(t){return{get:e=>{try{return t.getItem(e)}catch{return null}},set:(e,n)=>{try{t.setItem(e,n)}catch{}}}}var w={send(t,e){let n=new Blob([e],{type:"application/json"});if(navigator.sendBeacon&&navigator.sendBeacon(t,n))return!0;try{return fetch(t,{method:"POST",body:e,headers:{"Content-Type":"application/json"},keepalive:!0}),!0}catch{return!1}}},f="plrs_debug";function E(t){if(t!==void 0)return t;try{let e=new URLSearchParams(location.search);if(e.has(f)){let n=e.get(f)!=="0";return window.localStorage.setItem(f,n?"1":"0"),n}return window.localStorage.getItem(f)==="1"}catch{return!1}}function C(){let t="color:#fff;background:#6BBE3C;padding:1px 4px;border-radius:3px;font-weight:bold",e="color:#6BBE3C;font-weight:bold";return n=>{if(n.kind==="track"){let r=n.event,i={};r.entity_id!=null&&(i.entity=`${r.entity_type??""}#${r.entity_id}`),r.position!=null&&(i.pos=r.position),r.surface&&(i.surface=r.surface),r.query&&(i.query=r.query),r.results_count!=null&&(i.results=r.results_count),i.id=`${r.user_id??"anon"}/${r.anon_id.slice(0,8)}`,r.props&&Object.keys(r.props).length&&(i.props=r.props),console.debug("%c[polaris]%c \u25B8 %c"+r.event_name,t,"color:inherit",e,i)}else console.debug("%c[polaris]%c \u21E7 flush %c"+n.count+"%c \u2192 /e "+(n.ok?"\u2713":"\u2717 FAILED (will retry)"),t,"color:inherit","font-weight:bold","color:inherit")}}function y(t){if(typeof window>"u")return new h;let e=E(t.debug);e&&console.info("%c[polaris]%c tracker debug ON \u2014 events mirror to console; endpoint "+t.endpoint,"color:#fff;background:#6BBE3C;padding:1px 4px;border-radius:3px;font-weight:bold","color:inherit");let n=new d({endpoint:t.endpoint,userId:t.userId,anonId:t.anonId,flushIntervalMs:t.flushIntervalMs,maxBatch:t.maxBatch,transport:w,local:k(window.localStorage),session:k(window.sessionStorage),now:()=>Date.now(),uuid:()=>crypto.randomUUID?crypto.randomUUID():U(),pageURL:()=>location.href,referrer:()=>document.referrer,log:e?C():void 0}),r=t.flushIntervalMs??4e3;return window.setInterval(()=>n.flush(),r),document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&n.flush()}),window.addEventListener("pagehide",()=>n.flush()),n}function U(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}var b="plrs_anon",L=400*24*3600;function T(t,e){for(let n of e.split(";")){let r=n.indexOf("=");if(r!==-1&&n.slice(0,r).trim()===t)return decodeURIComponent(n.slice(r+1).trim())||null}return null}function O(t){if(!t||t==="localhost"||/^[\d.]+$/.test(t)||t.includes(":"))return null;let e=t.split(".");return e.length<2?null:e.slice(-2).join(".")}function M(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function N(t){let e;try{e=t.cookie}catch{return}let n=T(b,e)??M(),r=O(t.location?.hostname??""),i=`${b}=${encodeURIComponent(n)}; Max-Age=${L}; Path=/; SameSite=Lax`;r&&(i+=`; Domain=.${r}`);try{t.cookie=i}catch{}return n}function q(t){let e=Number(t.dataset.plrsUid);if(!Number.isFinite(e)||e<=0)return null;let n={event_name:"profile_impression",entity_type:"profile",entity_id:e};return t.dataset.plrsPos!==void 0&&t.dataset.plrsPos!==""&&(n.position=Number(t.dataset.plrsPos)),t.dataset.plrsSurface&&(n.surface=t.dataset.plrsSurface),t.dataset.plrsOffer&&(n.props={offer_id:t.dataset.plrsOffer}),n}function B(t,e){let n=t.defaultView;if(!n||typeof n.IntersectionObserver>"u")return;let r=new WeakSet,i=new n.IntersectionObserver((s,u)=>{for(let a of s){if(!a.isIntersecting||r.has(a.target))continue;r.add(a.target),u.unobserve(a.target);let l=q(a.target);l&&e(l)}},{threshold:.5});t.querySelectorAll("[data-plrs-uid][data-plrs-surface]").forEach(s=>i.observe(s))}function A(t,e,n){let r=i=>{let s=i.target;if(!s||typeof s.closest!="function")return;let u=s.closest(".talk-cta");if(u){let o=Number(u.dataset.plrsUid);o>0&&e.messageClick(o);return}let a=s.closest('[data-plrs-click="phone"]');if(a){let o=Number(a.dataset.plrsUid);o>0&&(e.phoneClick(o),e.flush());return}let l=s.closest('[data-plrs-click="outbound"]');if(l){let o=Number(l.dataset.plrsUid);if(o>0){let c=l.dataset.plrsTarget;if(!c){let x=s.closest(".contact-item");c=x?Array.from(x.classList).find(I=>I!=="contact-item")??"other":"other"}
1e.outboundClick(o,c),e.flush()}return}let m=s.closest('a.search-item, [data-plrs-click="result"]');if(m){let o=m.closest("[data-plrs-uid]");if(!o)return;let c=Number(o.dataset.plrsUid);if(!(c>0))return;e.searchResultClicked(c,Number(o.dataset.plrsPos??0),n.search?.query??"",o.dataset.plrsSurface??"search_simple"),e.flush()}};t.addEventListener("click",r,!0),t.addEventListener("auxclick",r,!0)}function v(t,e){if(!t||!t.endpoint)return null;let n=y({endpoint:t.endpoint,userId:t.userId??null,anonId:N(e)});return n.pageView(),t.profileUid&&t.profileUid>0&&n.profileView(t.profileUid),t.search&&n.track({event_name:"search_results_shown",query:t.search.query,results_count:t.search.total}),B(e,r=>n.track(r)),A(e,n,t),{tracker:n,bookmarkAdded:r=>{r>0&&n.bookmark(r,!0)}}}function S(){let t=v(window.polarisCtx,document);t&&(window.PolarisSite=t)}typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",S):S());})();

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.