PageSourceSearch

https://bas-ip.shop/templates/basip/dist/20260917-202548/2788.cff7b49d.js

js bas-ip.shop collected 2026-10-06 06:57:31 UTC 18,674 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkbas_ip_shop=self.webpackChunkbas_ip_shop||[]).push([[2788],{2788:function(t,e,o){o.r(e),o.d(e,{initCatalogPanel:function(){return b}});var r=o(1324);const n={panelSelector:".catalog_panel",sortToggleSelector:"#cat-sort-select .dropdown-toggle",sortDropdownSelector:"#cat-sort-select .dropdown",sortItemSelector:'#cat-sort-select .dropdown-item, #cat-sort-select input[type="radio"][data-sort], input[type="radio"][name="sort"]',viewButtonSelector:".type_view [data-show_view]",availableFilterSelector:"#available_filter",autoloadTogglerSelector:"#ajax_autoload_toggle",limitToggleSelector:"#cat-limit-select .dropdown-toggle",limitDropdownSelector:"#cat-limit-select .dropdown",limitItemSelector:'#cat-limit-select .dropdown-item, #cat-limit-select input[type="radio"][data-limit], input[type="radio"][name="limit"]',filterViewSelector:".filter_view",dropdownOpenClass:"is-open",activeClass:"active",ajaxScrollTarget:null,reloadCacheBustParam:"_r",modes:{sort:"auto",limit:"auto"},defaults:{limit:12,sortDirection:"1"},storage:{useCookies:!0,useLocalStorage:!0,syncToAll:!0,readOrder:["cookie","localStorage"],writeOrder:["cookie","localStorage"],cookieDays:365,cookiePath:"/",cookieSameSite:"Lax",storagePrefix:"catalog-panel:",keys:{view:"show_view_goods",sortField:"sort_field",sortDirection:"sort_direction",sortCombined:"sorti",onlyAvailable:"available_filter",autoload:"ajax_scroll_autoload",limit:"limit"}},queryParams:{enabled:!1,readOnInit:!0,replaceHistory:!0,names:{view:"view",sortField:"sort_field",sortDirection:"sort_direction",sortCombined:"sorti",onlyAvailable:"available_filter",autoload:"ajax_scroll_autoload",limit:"limit"}},ajaxScroll:{bridgeQueryParams:!0,refreshOnAutoloadChange:!0},debug:!1};function i(t){return"[object Object]"===Object.prototype.toString.call(t)}function l(...t){const e={};return t.forEach(t=>{i(t)&&Object.keys(t).forEach(o=>{const r=t[o],n=e[o];i(r)&&i(n)?e[o]=l(n,r):i(r)?e[o]=l(r):Array.isArray(r)?e[o]=r.slice():e[o]=r})}),e}function a(t,e=document){if(!t)return null;if(t instanceof Element)return t;if("string"!=typeof t)return null;try{return e.querySelector(t)}catch(t){return null}}function c(t,e){if(!t||!e)return[];const o=[],r=t,n=t instanceof Element?t:null;return n&&n.matches(e)&&o.push(n),o.push(...Array.from(r.querySelectorAll(e))),o}function s(t,e=!1){if("boolean"==typeof t)return t;if(null==t||""===t)return e;const o=String(t).trim().toLowerCase();return!!["1","true","yes","on"].includes(o)||!["0","false","no","off"].includes(o)&&e}function u(t){return Array.isArray(t)?t.map(t=>String(t||"").trim()).filter(Boolean):"string"==typeof t?t.split(",").map(t=>t.trim()).filter(Boolean):[]}function d(t){return Array.from(new Set(t.filter(Boolean)))}function f(t){return e=t,"undefined"!=typeof HTMLInputElement&&e instanceof HTMLInputElement&&"radio"===e.type?t:t?.querySelector?.('input[type="radio"]')||null;var e}function g(t){const e=f(t);return e?String(e.value||"").trim():"value"in t?String(t.value||"").trim():String(t.getAttribute("value")||"").trim()}function m(t){if(!t||"undefined"==typeof document)return"";const e=String(t||"").replace(/([.$?*|{}()[\]\\/+^])/g,"\\$1"),o=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return o?decodeURIComponent(o[1]):""}function p(){try{if("undefined"==typeof window||!window.localStorage)return!1;const t="__catalog_panel_test__";return window.localStorage.setItem(t,"1"),window.localStorage.removeItem(t),!0}catch(t){return!1}}function w(t,e){if(!t||!e)return;const o=Array.from(t.childNodes).find(t=>t.nodeType===Node.TEXT_NODE);o?o.nodeValue=`${e} `:t.prepend(document.createTextNode(`${e} `))}const S=function(t={}){let e=l(n,t);const o=new Map,S=new WeakMap;let b=0,y=!1;function v(...t){e.debug&&console.debug("[catalog-panel]",...t)}function h(t){const o=String(t??"").trim();return""!==o?o:String(e.defaults.sortDirection??"1").trim()||"1"}function A(t){const o=function(t,e=0){const o=parseInt(String(t??""),10);return Number.isFinite(o)?o:e}(t,e.defaults.limit);return o>0?o:e.defaults.limit}function k(t,o){const r=String(e.modes?.[t]||"auto").trim().toLowerCase();if("select"===r||"dropdown"===r||"radio"===r)return r;const n="sort"===t?o?.controls?.sortItems:o?.controls?.limitItems;if(n?.some(t=>f(t)))return"radio";return("sort"===t?o?.controls?.sortToggle:o?.controls?.limitToggle)?"dropdown":"select"}function _(t,e){return"select"===k(t,e)}function D(t,e){return"dropdown"===k(t,e)}function C(t){return String(e.storage.keys[t]||t||"").trim()}function T(t){return`${e.storage.storagePrefix||""}${C(t)}`}function E(t){return String(e.queryParams.names[t]||"").trim()}function I(t){if(!e.storage.useLocalStorage||!p())return"";try{return window.localStorage.getItem(T(t))||""}catch(t){return""}}
1function P(t,o){if(!e.storage.useLocalStorage||!p())return!1;try{return window.localStorage.setItem(T(t),String(o)),window.localStorage.getItem(T(t))===String(o)}catch(t){return!1}}function x(t){return e.storage.useCookies?m(C(t)):""}function $(t,o){return!!e.storage.useCookies&&function(t,e,o){if(!t||"undefined"==typeof document)return!1;try{const r=Math.max(0,Math.floor(24*(o.cookieDays||365)*60*60)),n=o.cookiePath||"/",i=o.cookieSameSite||"Lax";return document.cookie=`${encodeURIComponent(t)}=${encodeURIComponent(e)}; path=${n}; max-age=${r}; SameSite=${i}`,m(t)===String(e)}catch(t){return!1}}(C(t),String(o),e.storage)}function L(t){const o=function(t){if(!e.queryParams.enabled||!e.queryParams.readOnInit)return"";const o=E(t);if(!o)return"";try{return new URL(window.location.href).searchParams.get(o)||""}catch(t){return""}}(t);if(""!==o)return o;const r=u(e.storage.readOrder);for(const e of r){if("cookie"===e){const e=x(t);if(""!==e)return e}if("localStorage"===e){const e=I(t);if(""!==e)return e}}return""}function j(t,o){const r={cookie:!1,localStorage:!1};return u(e.storage.writeOrder).forEach(e=>{"cookie"===e&&(r.cookie=$(t,o)||r.cookie),"localStorage"===e&&(r.localStorage=P(t,o)||r.localStorage)}),e.storage.syncToAll&&(r.cookie||(r.cookie=$(t,o)||r.cookie),r.localStorage||(r.localStorage=P(t,o)||r.localStorage)),r}function O(t){return t instanceof Element&&S.get(t)||""}function F(t){if(!t)return o.values().next().value||null;if("object"==typeof t&&t&&"string"==typeof t.id&&o.has(t.id))return o.get(t.id)||null;if("string"==typeof t&&o.has(t))return o.get(t)||null;const e=a(t);if(!e)return null;const r=O(e);if(r&&o.has(r))return o.get(r)||null;for(const t of o.values())if(t.panel.contains(e))return t;return null}function q(){const t=L("sortField"),e=L("sortDirection"),o=L("sortCombined"),r=N(o);return{view:L("view"),sortField:t||r.field,sortDirection:h(e||r.dir),sortCombined:o||B(t||r.field,e||r.dir),onlyAvailable:s(L("onlyAvailable"),!1),autoload:s(L("autoload"),!1),limit:A(L("limit"))}}function B(t,e){const o=String(t||"").trim();return o?`${o}/${h(e)}`:""}function N(t){const e=String(t||"").trim();if(!e.includes("/"))return{field:e,dir:h("")};const[o,r]=e.split("/");return{field:String(o||"").trim(),dir:h(r)}}function M(t){const e=f(t);return String(t.getAttribute("data-sort")||e?.getAttribute("data-sort")||g(t)||"").trim()}function R(t){const e=f(t);return String(t.getAttribute("data-limit")||e?.getAttribute("data-limit")||g(t)||t.textContent||"").trim()}function U(t,e=""){const o=f(t);return String(t.getAttribute("data-title")||o?.getAttribute("data-title")||t.querySelector?.(".value")?.textContent||t.textContent||e||"").trim()}function V(t,e){if(!t||!e)return;const o=f(t),r=String(t.getAttribute("data-target-title")||o?.getAttribute("data-target-title")||"").trim();if(r)try{document.querySelectorAll(r).forEach(t=>{t.textContent=e})}catch(t){v("updateTargetTitle failed",t)}}function H(t,e,o){const r=t.controls.sortToggle,n=function(t,e,o){const r=String(e||"").trim(),n=h(o);return t.controls.sortItems.find(t=>{const e=M(t);if(!e)return!1;const o=N(e);return o.field===r&&o.dir===n})||null}(t,e,o);if(!n)return;const i=U(n);V(n,i),r&&i&&w(r,i)}function Q(t,e){const o=t.controls.limitToggle,r=function(t,e){const o=A(e);return t.controls.limitItems.find(t=>A(R(t))===o)||null}(t,e),n=r?U(r,A(e)):String(A(e));V(r,n),o&&n&&w(o,n)}function W(t){const o=q();t.state=o,t.controls.availableFilter&&(t.controls.availableFilter.checked=!!o.onlyAvailable),t.controls.autoloadToggler&&(t.controls.autoloadToggler.checked=!!o.autoload),function(t,o){t.controls.viewButtons.forEach(t=>{const r=String(t.getAttribute("data-show_view")||"").trim(),n=o&&r===o;t.classList.toggle(e.activeClass,n),t.setAttribute("aria-pressed",n?"true":"false")})}(t,o.view),H(t,o.sortField,o.sortDirection),Q(t,o.limit),function(t,e){const o=t.controls.sortDropdown?.querySelector("select");o&&e.sortCombined&&(o.value=e.sortCombined);const r=t.controls.limitDropdown?.querySelector("select");r&&(r.value=String(e.limit))}
1(t,o),function(t,o){t.controls.sortItems.forEach(t=>{const r=f(t);if(!r)return;const n=N(M(t)),i=!!n.field&&n.field===o.sortField&&n.dir===h(o.sortDirection);r.checked=i,t.classList.toggle(e.activeClass,i)}),t.controls.limitItems.forEach(t=>{const r=f(t);if(!r)return;const n=A(R(t))===A(o.limit);r.checked=n,t.classList.toggle(e.activeClass,n)})}(t,o),function(t){j("view",t.view||""),j("sortField",t.sortField||""),j("sortDirection",t.sortDirection||""),j("sortCombined",t.sortCombined||""),j("onlyAvailable",t.onlyAvailable?"1":"0"),j("autoload",t.autoload?"1":"0"),j("limit",String(t.limit))}(o)}function X(t){return t.panel.hasAttribute("data-ajax-scroll-target")?t.panel.getAttribute("data-ajax-scroll-target")||null:e.ajaxScrollTarget}function z(){if(!e.queryParams.enabled||!e.ajaxScroll.bridgeQueryParams)return;if(!r._$||"function"!=typeof r._$.configure)return;const t=d(Object.values(e.queryParams.names).map(t=>String(t||"").trim())),o=d([...u(e.ajaxScroll.preserveParams),...t]);r._$.configure({preserveParams:o})}function G(t){try{if(r._$&&"function"==typeof r._$.triggerPage)return void r._$.triggerPage(X(t),0)}catch(t){v("ajaxScroll.triggerPage failed",t)}!function(){try{const t=new URL(window.location.href);t.searchParams.set(e.reloadCacheBustParam,String(Date.now())),window.location.assign(t.toString())}catch(t){window.location.reload()}}()}function J(t,o,n=!0){const i={...q(),...o};i.sortDirection=h(i.sortDirection),i.limit=A(i.limit),i.sortCombined=B(i.sortField,i.sortDirection),j("view",i.view||""),j("sortField",i.sortField||""),j("sortDirection",i.sortDirection||""),j("sortCombined",i.sortCombined||""),j("onlyAvailable",i.onlyAvailable?"1":"0"),j("autoload",i.autoload?"1":"0"),j("limit",String(i.limit)),function(t){if(e.queryParams.enabled)try{const o=new URL(window.location.href);Object.keys(t).forEach(e=>{const r=E(e);if(!r)return;const n=t[e],i=null==n?"":String(n).trim();""!==i?o.searchParams.set(r,i):o.searchParams.delete(r)}),!1!==e.queryParams.replaceHistory&&window.history.replaceState({},"",o.toString())}catch(t){v("updateQueryParams failed",t)}}({view:i.view||"",sortField:i.sortField||"",sortDirection:i.sortDirection||"",sortCombined:i.sortCombined||"",onlyAvailable:i.onlyAvailable?"1":"0",autoload:i.autoload?"1":"0",limit:String(i.limit)}),W(t),function(t,e,o=document){o&&"function"==typeof o.dispatchEvent&&o.dispatchEvent(new CustomEvent(t,{detail:e}))}("catalogpanel:change",{id:t.id,panel:t.panel,state:{...i},reload:n},t.panel),n?G(t):e.ajaxScroll.refreshOnAutoloadChange&&r._$&&"function"==typeof r._$.refresh&&r._$.refresh(X(t))}function K(t,o){if(!t||!o)return;const r=t.classList.contains(e.dropdownOpenClass)||"block"===o.style.display;Y(),r||(t.classList.add(e.dropdownOpenClass),o.style.display="block")}function Y(){o.forEach(t=>{[["sort",t.controls.sortToggle,t.controls.sortToggle?.closest("#cat-sort-select, .dropdown_block, .dropdown-wrap, .dropdown"),t.controls.sortDropdown],["limit",t.controls.limitToggle,t.controls.limitToggle?.closest("#cat-limit-select, .dropdown_block, .dropdown-wrap, .dropdown"),t.controls.limitDropdown]].forEach(([o,r,n,i])=>{n&&n.classList.remove(e.dropdownOpenClass),D(o,t)&&r&&i&&(i.style.display="none")})})}function Z(t){const o=String(t.getAttribute("data-target")||"").trim();if(!o)return;const r=a(o);if(!r)return;const n=String(t.getAttribute("data-mode")||"view").trim(),i=String(t.getAttribute("data-force")||"").trim().toLowerCase(),l=function(t){const e=t.getAttribute("data-cp-uid")||"";if(e)return e;const o=`cpbtn-${Date.now().toString(36)}${Math.random().toString(36).slice(2,7)}`;return t.setAttribute("data-cp-uid",o),o}(t),c=function(t){const e=String(t||"view").trim();if(e.startsWith("."))return{kind:"class",cls:e.slice(1).trim()};if("view"===e)return{kind:"view"};const o=e.split(","),r=String(o[0]||"").trim(),n=ct(o[1]??"0"),i=ct(o[2]??("0"===n?"-999px":"0"));if(!r)return{kind:"view"};return{kind:"prop",prop:r,a:n,b:i}}(n),s=function(t,e){if("class"===e.kind)return e.cls?t.classList.contains(e.cls):null!==t.offsetParent;if("view"===e.kind)return null!==t.offsetParent&&"none"!==getComputedStyle(t).display;const o=ct(getComputedStyle(t)[e.prop]);return o===ct(e.a)}(r,c),u=r.contains(t),d=r.getAttribute("data-opened-by-button-id")||"";let f;f="open"===i||"close"!==i&&("toggle"===i?!s:!u&&(!(s&&!(d&&d===l))&&!s)),function(t,e,o){
1if("class"===e.kind)return void(e.cls?t.classList.toggle(e.cls,!!o):t.style.display=o?"":"none");if("view"===e.kind)return void(t.style.display=o?"":"none");t.style[e.prop]=o?e.a:e.b}(r,c,f),function(t,e,o,r){if(o)return t.setAttribute("data-opened-by-button","1"),t.setAttribute("data-opened-by-button-id",r),void(!t.getAttribute("data-panel-selector")&&e&&t.setAttribute("data-panel-selector",e));t.removeAttribute("data-opened-by-button"),t.removeAttribute("data-opened-by-button-id")}(r,o,f,l),function(t,o,r){Array.from(document.querySelectorAll(`${e.filterViewSelector}[data-target]`)).forEach(e=>{String(e.getAttribute("data-target")||"").trim()===t&&e.setAttribute("aria-expanded",e===r&&o?"true":"false")})}(o,f,t)}function tt(t){const r=t.target instanceof Element?t.target:null;if(!r)return;const n=r.closest(e.filterViewSelector);if(n)return t.preventDefault(),void Z(n);let i=!1;if(o.forEach(e=>{const o=e.controls.sortToggle,n=e.controls.limitToggle;D("sort",e)&&o&&(r===o||o.contains(r))&&(t.preventDefault(),i=!0,K(o.closest("#cat-sort-select, .dropdown_block, .dropdown-wrap, .dropdown"),e.controls.sortDropdown)),D("limit",e)&&n&&(r===n||n.contains(r))&&(t.preventDefault(),i=!0,K(n.closest("#cat-limit-select, .dropdown_block, .dropdown-wrap, .dropdown"),e.controls.limitDropdown))}),!i){Array.from(o.values()).some(t=>[t.controls.sortDropdown,t.controls.limitDropdown].some(t=>t&&t.contains(r)))||Y()}}function et(t,e){const o=N(e);o.field&&(Y(),J(t,{sortField:o.field,sortDirection:o.dir},!0))}function ot(t,e){Y(),J(t,{limit:A(e)},!0)}function rt(t){const e=(e,o,r)=>{e&&"function"==typeof e.addEventListener&&(e.addEventListener(o,r),t.listeners.push({element:e,eventName:o,handler:r}))};t.controls.viewButtons.forEach(o=>{e(o,"click",e=>{e.preventDefault();const r=String(o.getAttribute("data-show_view")||"").trim();r&&J(t,{view:r},!0)})}),t.controls.availableFilter&&e(t.controls.availableFilter,"change",()=>{J(t,{onlyAvailable:!!t.controls.availableFilter.checked},!0)}),t.controls.autoloadToggler&&e(t.controls.autoloadToggler,"change",()=>{J(t,{autoload:!!t.controls.autoloadToggler.checked},!1)}),t.controls.sortItems.forEach(o=>{const r=f(o);r?e(r,"change",()=>{r.checked&&et(t,M(o))}):e(o,"click",e=>{"OPTION"!==o.tagName&&(e.preventDefault(),et(t,M(o)))})});const o=t.controls.sortDropdown?.querySelector("select");o&&_("sort",t)&&e(o,"change",()=>{et(t,o.value)}),t.controls.limitItems.forEach(o=>{const r=f(o);r?e(r,"change",()=>{r.checked&&ot(t,R(o))}):e(o,"click",e=>{"OPTION"!==o.tagName&&(e.preventDefault(),ot(t,R(o)))})});const r=t.controls.limitDropdown?.querySelector("select");r&&_("limit",t)&&e(r,"change",()=>{ot(t,r.value)})}function nt(t){t.listeners.forEach(({element:t,eventName:e,handler:o})=>{t.removeEventListener(e,o)}),t.listeners=[]}function it(t){const o=e=>a(e,t)||a(e),r=e=>function(t){const e=new Set;return t.filter(t=>t instanceof Element&&(!e.has(t)&&(e.add(t),!0)))}([...c(t,e),...c(document,e).filter(e=>!t.contains(e))]);return{sortToggle:o(e.sortToggleSelector),sortDropdown:o(e.sortDropdownSelector),sortItems:r(e.sortItemSelector),viewButtons:r(e.viewButtonSelector),availableFilter:o(e.availableFilterSelector),autoloadToggler:o(e.autoloadTogglerSelector),limitToggle:o(e.limitToggleSelector),limitDropdown:o(e.limitDropdownSelector),limitItems:r(e.limitItemSelector)}}function lt(t=document){return y||(document.addEventListener("click",tt,!0),y=!0),z(),c(t,e.panelSelector).map(t=>function(t){if(!(t instanceof Element))return null;const e=O(t);if(e&&o.has(e)){const r=o.get(e)||null;return r&&(nt(r),r.controls=it(t),rt(r),W(r)),r}const r="catalog-panel-"+ ++b,n={id:r,panel:t,controls:it(t),listeners:[],state:q()};return S.set(t,r),o.set(r,n),rt(n),W(n),v("bound",{id:r,panel:t}),n}(t)).filter(Boolean)}function at(t={}){return e=l(e,t),z(),st}function ct(t){if(null==t)return"";let e=String(t).trim().toLowerCase();return"0px"===e&&(e="0"),e}const st={init:function(t={}){return i(t)&&Object.keys(t).length>0&&at(t),lt(document),st},configure:at,bindAll:lt,refresh:function(t=null){if(!t)return o.forEach(t=>W(t)),st;const e=F(t);return e&&W(e),st},destroy:function(){o.forEach(t=>{nt(t)}),o.clear(),Y(),y&&(document.removeEventListener("click",tt,!0),y=!1)},getState:function(){return{config:l(e),storage:q(),instances:Array.from(o.values()).map(t=>({id:t.id,state:{...t.state},panel:t.panel}))}},getInstance:F,applySort:function(t,e){const o=F(t);return o&&et(o,e),st},applyLimit:function(t,e){const o=F(t);return o&&ot(o,e),st},closePanelIfOpenedByButton:function(t,o={}){const r=a(t);if(!r)return!1;if("1"!==r.getAttribute("data-opened-by-button"))return!1;const n=String(o.buttonSelector||e.filterViewSelector||".filter_view"),i=r.id?`#${r.id}`:String(r.getAttribute("data-panel-selector")||"").trim();if(!i)return!1;const l=a(`${n}[data-target="${i.replace(/"/g,'\\"')}"]`)||Array.from(document.querySelectorAll(n)).find(t=>{const e=String(t.getAttribute("data-target")||"").trim();if(!e)return!1;try{return r.matches(e)}catch(t){return!1}})||null;
1return!!l&&(l.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0})),!0)}};return st}();function b(){S.init({panelSelector:".catalog_panel",ajaxScrollTarget:".ajax-scroll-checker",sortToggleSelector:null,sortDropdownSelector:".js-catalog-sort",sortItemSelector:"#cat-sort-select option",limitToggleSelector:null,limitDropdownSelector:".js-catalog-limit",limitItemSelector:"#cat-limit-select option",modes:{sort:"select",limit:"select"}})}}}]);

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.