PageSourceSearch

https://app.easybuilder.com.br/_next/static/chunks/1637-ddf1f2d0e32a57ef.js

js easybuilder.com.br collected 2026-09-24 13:11:48 UTC 9,452 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1637],{39052:(e,t,a)=>{a.d(t,{M:()=>i,e:()=>d});var r=a(95155),o=a(12115),l=a(18720),n=a(9829),s=a(65149),c=a(95704);let i=(0,o.createContext)(null),u={position:"top-center"};function d(e){var t,a,d,f,g,p,m;let{children:h}=e,[b,k]=(0,o.useState)([]),[x,v]=(0,o.useState)(!1),C=(0,o.useRef)(!1),y=(0,o.useRef)([]);y.current=b;let[j,w]=(0,o.useState)(!1),[E,R]=(0,o.useState)(null),[z,N]=(0,o.useState)(!1),[P,S]=(0,o.useState)({}),[_,T]=(0,o.useState)([]),B=(0,o.useRef)({});B.current=P;let O=(0,o.useRef)(null),I=(0,o.useRef)(j);I.current=j;let L=(0,o.useCallback)(async()=>{try{let e=await fetch("/api/client/cart");if(!e.ok)return;let t=await e.json();k(t.items||[])}catch(e){}},[]);(0,o.useEffect)(()=>{L()},[L]),(0,o.useEffect)(()=>{let e=c.env.NEXT_PUBLIC_REALTIME_URL;if(!e)return;let t=null;try{(t=(0,n.io)(e,{autoConnect:!0,reconnection:!0,reconnectionAttempts:3})).on("cart:updated",()=>{L()})}catch(e){t=null}return()=>{null==t||t.off("cart:updated"),null==t||t.disconnect()}},[L]);let A=(0,o.useCallback)(e=>y.current.some(t=>t.sectionId===e),[]),M=(0,o.useCallback)(async e=>{let t="temp-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2)),a=y.current,r=0===a.length,o={id:t,sectionId:e,position:a.length,available:!0,section:null};k(e=>[...e,o]);try{let a=await fetch("/api/client/cart",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({section_id:e})});if(!a.ok)throw Error("Add failed");let o=await a.json();k(e=>e.map(e=>e.id===t?{...e,id:o.id,position:o.position}:e)),l.oR.success("Adicionado ao Page Builder",u),(0,s.j)("cart_add",{resourceId:e,resourceType:"SECTION"}),r&&v(!0),L()}catch(e){k(e=>e.filter(e=>e.id!==t)),l.oR.error("Erro ao adicionar ao Page Builder",u)}},[L]),D=(0,o.useCallback)(async e=>{var t;let a=y.current,r=null==(t=a.find(t=>t.id===e))?void 0:t.sectionId;k(t=>t.filter(t=>t.id!==e));try{let t=await fetch("/api/client/cart/".concat(e),{method:"DELETE"});if(!t.ok&&204!==t.status)throw Error("Delete failed");l.oR.success("Removido do Page Builder",u),r&&(0,s.j)("cart_remove",{resourceId:r,resourceType:"SECTION"}),L()}catch(e){k(()=>a),l.oR.error("Erro ao remover do Page Builder",u)}},[L]),U=(0,o.useCallback)(async()=>{let e=y.current;k([]);try{if(!(await fetch("/api/client/cart",{method:"DELETE"})).ok)throw Error("Clear failed");l.oR.success("Page Builder esvaziado",u),L()}catch(t){k(()=>e),l.oR.error("Erro ao esvaziar o Page Builder",u)}},[L]),H=(0,o.useCallback)(async e=>{if(C.current)return;C.current=!0;let t=y.current,a=new Map(t.map(e=>[e.id,e]));k(e.map((e,t)=>{let r=a.get(e);return r?{...r,position:t}:null}).filter(e=>null!==e));try{let t=await fetch("/api/client/cart/reorder",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({orderedIds:e})});if(409===t.status)return void await L();if(!t.ok)throw Error("Reorder failed")}catch(e){k(()=>t),l.oR.error("Erro ao reordenar o Page Builder",u)}finally{C.current=!1}},[L]),J=(0,o.useCallback)(()=>v(!0),[]),X=(0,o.useCallback)(()=>{v(!1),w(!1)},[]),Z=(0,o.useCallback)(async()=>{N(!0);try{let e=await fetch("/api/client/cart/style-tokens");if(!e.ok){R(null),400!==e.status&&l.oR.error("N\xe3o foi poss\xedvel carregar os estilos do Page Builder.",u);return}let t=await e.json();R(t)}catch(e){R(null),l.oR.error("N\xe3o foi poss\xedvel carregar os estilos do Page Builder.",u)}finally{N(!1)}},[]),V=(0,o.useCallback)(()=>{w(!0),E||Z()},[Z,E]),$=(0,o.useCallback)(()=>w(!1),[]),q=(0,o.useCallback)(e=>{O.current!==e&&(T(e=>[...e,B.current]),O.current=e)},[]),F=(0,o.useCallback)((e,t,a)=>{q("c:".concat(e,":").concat([...t].sort().join(","))),S(r=>{var o;let l={...null==(o=r.cores)?void 0:o[e]};for(let e of t)l[e]=a;return{...r,cores:{...r.cores,[e]:l}}})},[q]),G=(0,o.useCallback)((e,t)=>{q("c:".concat(e,":unmerge:").concat([...t].sort().join(","))),S(a=>{var r;let o={...null==(r=a.cores)?void 0:r[e]};for(let e of t)delete o[e];return{...a,cores:{...a.cores,[e]:o}}})},[q]),K=(0,o.useCallback)((e,t)=>{q("f:".concat(e)),S(a=>({...a,fontes:{...a.fontes,[e]:t}}))},[q]),Q=(0,o.useCallback)(e=>{q("f:unmerge:".concat([...e].sort().join(","))),S(t=>{let a={...t.fontes};for(let t of e)delete a[t];return{...t,fontes:a}})},[q]),W=(0,o.useRef)(0),Y=(0,o.useCallback)((e,t)=>{W.current+=1,q("cbatch:".concat(W.current)),S(a=>{var r,o;let l={conteudo:{...null==(r=a.cores)?void 0:r.conteudo},background:{...null==(o=a.cores)?void 0:o.background}};for(let{categoria:a,originals:r}of e)for(let e of r)l[a][e]=t;return{...a,cores:l}})},[q]),ee=(0,o.useCallback)((e,t)=>{W.current+=1,q("fbatch:".concat(W.current)),S(a=>{let r={...a.fontes};for(let a of e)r[a]=t;return{...a,fontes:r}})},[q]),et=(0,o.useCallback)((e,t)=>{q("fsize:".concat([...e].sort().join(","))),S(a=>{let r={...a.fontesTamanho};for(let a of e)r[a]=t;return{...a,fontesTamanho:r}})},[q]),ea=(0,o.useCallback)((e,t)=>{q("fweight:".concat([...e].sort().join(","))),S(a=>{let r={...a.fontesPeso};for(let a of e)r[a]=t;return{...a,fontesPeso:r}})},[q]),er=(0,o.useCallback)(()=>{T(e=>0===e.length?e:(S(e[e.length-1]),O.current=null,e.slice(0,-1)))},[]),eo=(0,o.useCallback)(()=>{S({}),T([]),O.current=null},[]),el=[...new Set(b.map(e=>e.sectionId))].sort().join("|");(0,o.useEffect)(()=>{R(null),S({}),T([]),O.current=null,I.current&&Z()},[el,Z]);let en=Object.keys(null!=(d=null==(t=P.cores)?void 0:t.conteudo)?d:{}).length>0||Object.keys(null!=(f=null==(a=P.cores)?void 0:a.background)?f:{}).length>0||Object.keys(null!=(g=P.fontes)?g:{}).length>0||Object.keys(null!=(p=P.fontesTamanho)?p:{}).length>0||Object.keys(null!=(m=P.fontesPeso)?m:{}).length>0,es={items:b,count:b.length,isInCart:A,addToCart:M,removeFromCart:D,clearCart:U,reorder:H,revalidate:L,isSidebarOpen:x,openSidebar:J,closeSidebar:X,styleEditorOpen:j,styleTokens:E,styleTokensLoading:z,styleEdits:P,hasStyleEdits:en,openStyleEditor:V,closeStyleEditor:$,loadStyleTokens:Z,setColorEdit:F,removeColorEdits:G,setFontEdit:K,removeFontEdits:Q,setColorEditBatch:Y,setFontEditBatch:ee,setFontSizeBatch:et,setFontWeightBatch:ea,undoStyleEdit:er,canUndoStyle:_.length>0,resetEdits:eo};return(0,r.jsx)(i.Provider,{value:es,children:h})}},89377:(e,t,a)=>{a.d(t,{_:()=>l});var r=a(12115),o=a(39052);function l(){let e=(0,r.useContext)(o.M);if(!e)throw Error("useCart must be used within a CartProvider");return e}},98053:(e,t,a)=>{a.d(t,{$v:()=>v,EO:()=>h,Lt:()=>g,Rx:()=>C,Zr:()=>y,ck:()=>k,r7:()=>x,wd:()=>b});var r=a(95155);a(12115);var o=a(15921),l=a(38336),n=a(27588),s=a(45669),c=a(72482),i=a(99170),u=a(35966),d=a(64269),f=a(3998);function g(e){let{...t}=e;return(0,r.jsx)(o.V,{"data-slot":"alert-dialog",...t})}function p(e){let{...t}=e;return(0,r.jsx)(l.Z,{"data-slot":"alert-dialog-portal",...t})}function m(e){let{className:t,...a}=e;return(0,r.jsx)(n.X,{"data-slot":"alert-dialog-overlay",className:(0,d.cn)("fixed inset-0 isolate z-[100] bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",t),...a})}function h(e){let{className:t,size:a="default",...o}=e;return(0,r.jsxs)(p,{children:[(0,r.jsx)(m,{}),(0,r.jsx)(s.h,{"data-slot":"alert-dialog-content","data-size":a,className:(0,d.cn)("group/alert-dialog-content fixed top-1/2 left-1/2 z-[100] grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 roun
1ded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...o})]})}function b(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,d.cn)("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",t),...a})}function k(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,d.cn)("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",t),...a})}function x(e){let{className:t,...a}=e;return(0,r.jsx)(c.L,{"data-slot":"alert-dialog-title",className:(0,d.cn)("font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",t),...a})}function v(e){let{className:t,...a}=e;return(0,r.jsx)(i.r,{"data-slot":"alert-dialog-description",className:(0,d.cn)("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",t),...a})}function C(e){let{className:t,...a}=e;return(0,r.jsx)(f.Button,{"data-slot":"alert-dialog-action",className:(0,d.cn)(t),...a})}function y(e){let{className:t,variant:a="outline",size:o="default",...l}=e;return(0,r.jsx)(u.H,{"data-slot":"alert-dialog-cancel",className:(0,d.cn)(t),render:(0,r.jsx)(f.Button,{variant:a,size:o}),...l})}}}]);

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.