PageSourceSearch

https://unm.ai/build/assets/user-meta-ads-show-D4pDbUX7.js

js unm.ai collected 2026-10-05 15:57:21 UTC 2,573 bytes, 1 lines download raw bytes

1let r=null,c=!1;function i(){return document.querySelector("meta[name=csrf-token]")?.content||""}function s(){return document.querySelector("[data-meta-show]")}function o(t,a){const e=document.querySelector(`[data-tile="${t}"] .text-\\[16px\\]`);e&&(e.textContent=a)}function f(t){const a=s();if(!a||!t||!t.ok)return;if(t.meta_status){a.dataset.metaStatus=t.meta_status;const n=document.querySelector("[data-status-label]");n&&(n.textContent=t.meta_status.charAt(0)+t.meta_status.slice(1).toLowerCase())}if(t.last_synced){const n=document.querySelector("[data-meta-last-synced]");n&&(n.textContent="Last synced "+t.last_synced)}const e=t.insights||{};o("spend",(e.spend??0).toFixed(2)),o("impressions",Intl.NumberFormat().format(e.impressions??0)),o("clicks",Intl.NumberFormat().format(e.clicks??0)),o("reach",Intl.NumberFormat().format(e.reach??0)),o("conversations",Intl.NumberFormat().format(e.conversions??0)),o("ctr",(e.ctr??0).toFixed(2)+"%"),o("cpc",(e.cpc??0).toFixed(2)),o("frequency",(e.frequency??0).toFixed(2))}async function d(){const t=s();if(!t||c)return;const a=t.dataset.metaRefreshUrl;if(a){c=!0;try{const e=await fetch(a,{method:"POST",headers:{"X-CSRF-TOKEN":i(),"X-Requested-With":"XMLHttpRequest",Accept:"application/json"}});if(!e.ok)return;f(await e.json())}catch{}finally{c=!1}}}function u(){r||(r=setInterval(d,6e4))}function m(){r&&clearInterval(r),r=null}function y(){document.querySelectorAll("[data-meta-toggle-btn]").forEach(t=>{t.addEventListener("click",async()=>{t.disabled=!0;try{const a=s().dataset.metaToggleUrl;(await fetch(a,{method:"POST",headers:{"X-CSRF-TOKEN":i(),"X-Requested-With":"XMLHttpRequest",Accept:"application/json"}})).ok&&location.reload()}finally{t.disabled=!1}})})}function h(){document.querySelectorAll("[data-meta-retry-btn]").forEach(t=>{t.addEventListener("click",async()=>{t.disabled=!0,t.textContent="Retrying…";try{const a=s().dataset.metaRetryUrl,e=await fetch(a,{method:"POST",headers:{"X-CSRF-TOKEN":i(),"X-Requested-With":"XMLHttpRequest",Accept:"application/json"}}),n=e.ok?await e.json():null;if(n&&n.ok)location.reload();else if(n){const l=document.querySelector("[data-meta-error]");l&&(l.textContent=n.last_error||"Retry failed."),t.disabled=!1,t.textContent="Retry sync"}}catch{t.disabled=!1,t.textContent="Retry sync"}})})}function p(){const t=s();t&&(y(),h(),t.dataset.metaStatus==="ACTIVE"&&document.visibilityState==="visible"&&u(),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&s().dataset.metaStatus==="ACTIVE"?(u(),d()):m()}))}export{p as default};

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.