PageSourceSearch

https://snew.ai/assets/useAdStyleBriefings-B-lgDCqm.js

js snew.ai collected 2026-10-05 15:09:03 UTC 1,901 bytes, 1 lines download raw bytes

1import{r as d}from"./index-L9AYrVUw.js";import{s as p}from"./productFunnel-DiJFcMU2.js";import{eT as g,bu as c}from"./PlanAccessModal-P_W2GThH.js";import"./locale-Cctu0V3Y.js";let s=null,u=null,l=null,a=null;async function y(){return s||u||(u=(async()=>{var n;const e=c.map(i=>i.id),{data:f,error:r}=await p.from("style_descriptors").select("template_id, config").in("template_id",e),t={};if(!r&&f)for(const i of f){const o=(n=i==null?void 0:i.config)==null?void 0:n.briefing,m=i.template_id;typeof m=="string"&&!g(m)&&typeof o=="string"&&o.trim().length>0&&(t[m]=o)}return s=t,u=null,t})(),u)}async function S(){return l||a||(a=(async()=>{var t;const{data:e,error:f}=await p.from("style_descriptors").select("template_id, config"),r={};if(!f&&e)for(const n of e){const i=(t=n==null?void 0:n.config)==null?void 0:t.folder;typeof i=="string"&&i.trim().length>0&&(r[n.template_id]=i)}return l=r,a=null,r})(),a)}function B(){s=null,u=null,l=null,a=null}function A(e){var r,t;if(g(e))return((r=c.find(n=>n.id===e))==null?void 0:r.briefing)??"";const f=s==null?void 0:s[e];return f&&f.trim()?f:((t=c.find(n=>n.id===e))==null?void 0:t.briefing)??""}function D(e){return(l==null?void 0:l[e])==="draft"}function E(){const[e,f]=d.useState(s??{});return d.useEffect(()=>{let r=!0;return y().then(t=>{r&&f(t)}),()=>{r=!1}},[]),{overrides:e,getBriefing:r=>{var n,i;if(g(r))return((n=c.find(o=>o.id===r))==null?void 0:n.briefing)??"";const t=e[r];return t&&t.trim()?t:((i=c.find(o=>o.id===r))==null?void 0:i.briefing)??""}}}function F(){const[e,f]=d.useState(l??{});d.useEffect(()=>{let t=!0;return S().then(n=>{t&&f(n)}),()=>{t=!1}},[]);const r=new Set(Object.entries(e).filter(([,t])=>t==="draft").map(([t])=>t));return{folders:e,draftedIds:r,isDrafted:t=>e[t]==="draft"}}export{B as invalidateAdStyleBriefingsCache,D as isStyleDrafted,A as resolveAdStyleBriefing,E as useAdStyleBriefings,F as useStyleFolders};

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.