1"use strict";(self.webpackChunkpixfort_core=self.webpackChunkpixfort_core||[]).push([[4238,6450],{5734(e,t,o){o.d(t,{default:()=>i});var n=o(5886),a=o(4664);const s=new Map;function i(){r(),$(document).on("click",".pix-loop-grid-load-more button",function(e){e.preventDefault();let t=$(this),o=t.closest(".pix-loop-grid-wrapper").find(".pix-loop-grid");if(t.hasClass("loading"))return;let a=parseInt(t.data("page")),s=parseInt(t.data("max-pages")),i=t.data("query");a>=s||(t.addClass("loading"),n.default.makeRequest({action:"pix_loop_grid_load_more",nonceKey:"loop_grid_load_more_nonce",data:{page:a+1,query:JSON.stringify(i)},method:"POST",success:function(e){e.success&&e.data.html&&(o.append(e.data.html),t.data("page",a+1),a+1>=s&&t.fadeOut(),e.data.has_animation&&"function"==typeof window.pix_animation&&setTimeout(()=>{window.pix_animation(o,!0)},50),$(document).trigger("pix-loop-grid-loaded",[o,e.data.html]))},error:function(){console.error("Error loading more items")},complete:function(){t.removeClass("loading")}}))})}function r(){$(".pix-loop-grid-infinite-scroll").each(function(){const e=$(this),t=e.attr("data-grid-id");if(s.has(t))return;let o=!1;const i=(0,a.W)(t=>{("number"==typeof t?t:t?.y?.progress||0)>.8&&!o&&(o=!0,function(e,t){if(e.hasClass("loading")||e.hasClass("finished"))return void(t&&t());const o=e.closest(".pix-loop-grid-wrapper"),a=o.find(".pix-loop-grid"),i=parseInt(e.data("page")),c=parseInt(e.data("max-pages")),d=e.data("query"),l=e.attr("data-grid-id");if(i>=c)return e.addClass("finished"),s.has(l)&&(s.get(l)(),s.delete(l)),void(t&&t());e.addClass("loading"),e.find(".pix-loop-grid-loading").show(),n.default.makeRequest({action:"pix_loop_grid_load_more",nonceKey:"loop_grid_load_more_nonce",data:{page:i+1,query:JSON.stringify(d)},method:"POST",success:function(t){t.success&&t.data.html&&(a.append(t.data.html),e.data("page",i+1),i+1>=c?(e.addClass("finished"),s.has(l)&&(s.get(l)(),s.delete(l))):(s.has(l)&&(s.get(l)(),s.delete(l)),setTimeout(()=>{r()},100)),t.data.has_animation&&"function"==typeof window.pix_animation&&setTimeout(()=>{window.pix_animation(a,!0)},50),$(document).trigger("pix-loop-grid-loaded",[a,t.data.html]))},error:function(){console.error("Error loading more items"),t&&t()},complete:function(){e.removeClass("loading"),e.find(".pix-loop-grid-loading").hide(),t&&t()}})}(e,()=>{o=!1}))},{target:this,offset:["start end","end end"]});s.set(t,i)})}},5886(e,t,o){o.d(t,{default:()=>a});const n=new class{constructor(){this.nonces={},this.isLoading=!1,this.loadingPromise=null,this.requestQueue=[],this.ajaxUrl=PIX_JS_OPTIONS.dataAjaxBase}async makeRequest(e){const{action:t,nonceKey:o,data:n={},url:a=this.ajaxUrl,method:s="GET",success:i,error:r,complete:c}=e;try{await this.ensureNoncesLoaded();const e=this.getNonce(o);if(!e)throw new Error(`Nonce not found for key: ${o}`);const r={action:t,nonce:e,...n},d=await this.performAjaxRequest({url:a,method:s,data:r});return i&&"function"==typeof i&&i(d),c&&"function"==typeof c&&c(d),d}catch(e){throw console.error("AJAX request failed:",e),r&&"function"==typeof r&&r(e),c&&"function"==typeof c&&c(null,e),e}}async ensureNoncesLoaded(){if(Object.keys(this.nonces).length>0)return Promise.resolve(this.nonces);if(this.isLoading&&this.loadingPromise)return this.loadingPromise;this.isLoading=!0,this.loadingPromise=this.fetchNonces();try{return await this.loadingPromise,this.nonces}finally{this.isLoading=!1,this.loadingPromise=null}}async fetchNonces(){try{const e=await this.performAjaxRequest({url:this.ajaxUrl,method:"GET",data:{action:"pix_get_nonces"}});if(e&&e.success&&e.data)return this.nonces=e.data,this.cacheNonces(e.data),this.nonces;throw new Error("Invalid nonces response format")}catch(e){throw console.error("Failed to fetch nonces:",e),e}}getNonce(e){return this.nonces[e]||null}cacheNonces(e){try{const t={nonces:e,timestamp:Date.now(),expiry:Date.now()+36e5};sessionStorage.setItem("pixfort_nonces",JSON.stringify(t))}catch(e){console.warn("Failed to cache nonces:",e)}}loadCachedNonces(){try{const e=sessionStorage.getItem("pixfort_nonces");if(!e)return!1;const t=JSON.parse(e);return Date.now()>t.expiry?(sessionStorage.removeItem("pixfort_nonces"),!1):(this.nonces=t.nonces,!0)}catch(e){return console.warn("Failed to load cached nonces:",e),sessionStorage.removeItem("pixfort_nonces"),!1}}performAjaxRequest(e){return new Promise((t,o)=>{if("undefined"!=typeof $&&$.ajax)$.ajax({url:e.url,type:e.method,data:e.data,dataType:"json",success:t,error:(e,t,n
1)=>{o(new Error(`AJAX Error: ${t} - ${n}`))}});else{const n=new FormData;Object.keys(e.data).forEach(t=>{n.append(t,e.data[t])}),fetch(e.url,{method:e.method,body:n,credentials:"same-origin"}).then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}: ${e.statusText}`);return e.json()}).then(t).catch(o)}})}clearCache(){this.nonces={};try{sessionStorage.removeItem("pixfort_nonces")}catch(e){console.warn("Failed to clear nonce cache:",e)}}async refreshNonces(){return this.clearCache(),this.ensureNoncesLoaded()}};n.loadCachedNonces(),window.pixAjaxRequest=function(e){return n.makeRequest(e)},window.pixRefreshNonces=function(){return n.refreshNonces()};const a=n}}]);
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.