1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6249],{3431:(e,t,r)=>{"use strict";r.d(t,{RowLabel:()=>a});var l=r(12526),n=r(69541);let a=()=>{var e;let t=(0,n.useRowLabel)(),r=null==t||null==(e=t.data)?void 0:e.question;return(0,l.jsx)("div",{children:r||"New Question"})}},3437:()=>{},39482:(e,t,r)=>{"use strict";r.d(t,{HubSpotFormSelect:()=>s});var l=r(12526),n=r(99486),a=r(69541);let s=e=>{let{field:t,path:r,readOnly:s}=e,{value:o,setValue:i}=(0,a.useField)({path:r}),{setValue:c}=(0,a.useField)({path:r.replace("formId","portalId")}),[u,d]=(0,n.useState)([]),[p,h]=(0,n.useState)(!0),[m,f]=(0,n.useState)(null);(0,n.useEffect)(()=>{(async()=>{try{h(!0),f(null);let e=await fetch("/api/hubspot/forms");if(!e.ok){let t=await e.json();if(t.needsSetup)throw Error("Please configure HubSpot settings in Plugins â HubSpot Settings");throw Error(t.error||"Failed to fetch forms (".concat(e.status,")"))}let t=await e.json();d(t.forms||[]),c(t.portalId||"")}catch(e){console.error("Error fetching HubSpot forms:",e),f(e instanceof Error?e.message:"Failed to fetch forms")}finally{h(!1)}})()},[c]);let g=[{label:"Select a form...",value:""},...u.map(e=>({label:e.name,value:e.id}))];return p?(0,l.jsxs)("div",{children:[(0,l.jsx)(a.FieldLabel,{label:t.label,htmlFor:"field-".concat(r),required:t.required}),(0,l.jsx)("div",{children:"Loading forms from HubSpot..."})]}):m?(0,l.jsxs)("div",{children:[(0,l.jsx)(a.FieldLabel,{label:t.label,htmlFor:"field-".concat(r),required:t.required}),(0,l.jsxs)("div",{style:{color:"red"},children:["Error: ",m]})]}):(0,l.jsx)(a.SelectInput,{path:r,name:r,options:g,value:o,onChange:e=>{if(!e)return void i("");let t="string"==typeof e?e:null==e?void 0:e.value;"string"==typeof t&&i(t)},label:t.label,required:t.required,readOnly:s})}},43612:(e,t,r)=>{"use strict";r.d(t,{RowLabel:()=>a});var l=r(12526),n=r(69541);let a=()=>{var e,t,r;let a=(0,n.useRowLabel)(),s=(null==a||null==(e=a.data)?void 0:e.enabled)?"\uD83D\uDFE2":"\uD83D\uDD34",o=(null==a||null==(t=a.data)?void 0:t.name)||"Untitled Pixel",i=(null==a||null==(r=a.data)?void 0:r.label)?" â ".concat(a.data.label):"";return(0,l.jsx)("div",{children:"".concat(s," ").concat(o).concat(i)})}},50484:(e,t,r)=>{"use strict";r.d(t,{PageSlugComponent:()=>s});var l=r(12526),n=r(99486),a=r(69541);r(3437);let s=e=>{let{field:t,fieldToUse:r,checkboxFieldPath:s,path:o,readOnly:i}=e,{label:c}=t,u=(null==o?void 0:o.includes("."))?"".concat(o,".").concat(s):s,{value:d,setValue:p}=(0,a.useField)({path:o||t.name}),{dispatchFields:h}=(0,a.useForm)(),m=(0,a.useFormFields)(e=>{var t;let[r]=e;return null==(t=r[u])?void 0:t.value}),f=(0,a.useFormFields)(e=>{var t;let[l]=e;return null==(t=l[r])?void 0:t.value});(0,n.useEffect)(()=>{if(m)if(f){let e=f.replace(/ /g,"-").replace(/[^\w-]+/g,"").toLowerCase();d!==e&&p(e)}else""!==d&&p("")},[f,m,p,d]);let g=(0,n.useCallback)(e=>{e.preventDefault(),h({type:"UPDATE",path:u,value:!m})},[m,u,h]),v=i||m;return(0,l.jsxs)("div",{className:"field-type slug-field-component",children:[(0,l.jsxs)("div",{className:"label-wrapper",children:[(0,l.jsx)(a.FieldLabel,{htmlFor:"field-".concat(o),label:c}),(0,l.jsx)(a.Button,{className:"lock-button",buttonStyle:"none",onClick:g,children:m?"Unlock":"Lock"})]}),(0,l.jsx)(a.TextInput,{value:d,onChange:p,path:o||t.name,readOnly:!!v})]})}},59161:(e,t,r)=>{"use strict";r.d(t,{SlugComponent:()=>o});var l=r(12526),n=r(99486),a=r(69541);let s=e=>e.replace(/ /g,"-").replace(/[^\w-]+/g,"").toLowerCase();r(3437);let o=e=>{let{field:t,fieldToUse:r,checkboxFieldPath:o,path:i,readOnly:c}=e,{label:u}=t,d=(null==i?void 0:i.includes("."))?"".concat(i,".").concat(o):o,{value:p,setValue:h}=(0,a.useField)({path:i||t.name}),{dispatchFields:m}=(0,a.useForm)(),f=(0,a.useFormFields)(e=>{var t;let[r]=e;return null==(t=r[d])?void 0:t.value}),g=(0,a.useFormFields)(e=>{var t;let[l]=e;return null==(t=l[r])?void 0:t.value});(0,n.useEffect)(()=>{if(f)if(g){let e=s(g);p!==e&&h(e)}else""!==p&&h("")},[g,f,h,p]);let v=(0,n.useCallback)(e=>{e.preventDefault(),m({type:"UPDATE",path:d,value:!f})},[f,d,m]),b=c||f;return(0,l.jsxs)("div",{className:"field-type slug-field-component",children:[(0,l.jsxs)("div",{className:"label-wrapper",children:[(0,l.jsx)(a.FieldLabel,{htmlFor:"field-".concat(i),label:u}),(0,l.jsx)(a.Button,{className:"lock-button",buttonStyle:"none",onClick:v,children:f?"Unlock":"Lock"})]}),(0,l.jsx)(a.TextInput,{value:p,onChange:h,path:i||t.name,readOnly:!!b})]})}},64547:(e,t,r)=>{"use strict";r.d(t,{ImportButton:()=>s});var l=r(12526),n=r(99486),a=r(69541);let s=()=>
1{let[e,t]=(0,n.useState)(!1),[r,s]=(0,n.useState)(null);(0,n.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/ransomware-importer/status"),r=await e.json();r.isRunning&&(t(!0),r.totalEntries>0&&(console.log("Initial import status:",r.currentStep,r.processedEntries,"/",r.totalEntries),s({current:r.processedEntries||0,total:r.totalEntries,percentage:Math.round(r.processedEntries/r.totalEntries*100),currentStep:r.currentStep})))}catch(e){console.error("Failed to check initial import status:",e)}})()},[]),(0,n.useEffect)(()=>{if(!e)return;let l=setInterval(async()=>{try{let l=await fetch("/api/ransomware-importer/status"),n=await l.json();n.isRunning&&n.totalEntries>0?(console.log("Import progress:",n.currentStep,n.processedEntries,"/",n.totalEntries),s({current:n.processedEntries||0,total:n.totalEntries,percentage:Math.round(n.processedEntries/n.totalEntries*100),currentStep:n.currentStep})):!n.isRunning&&e&&r&&r.current>0&&(t(!1),s(null),alert("Import completed: ".concat(r.current," entries processed")),window.location.reload())}catch(e){console.error("Failed to fetch import status:",e)}},1e3);return()=>clearInterval(l)},[e,r]);let o=async()=>{try{let e=await fetch("/api/ransomware-importer/status"),r=await e.json();if(r.isRunning){t(!0),r.totalEntries>0&&s({current:r.processedEntries||0,total:r.totalEntries,percentage:Math.round(r.processedEntries/r.totalEntries*100),currentStep:r.currentStep});return}}catch(e){console.error("Failed to check import status before starting:",e)}t(!0),s(null);try{let e=await fetch("/api/ransomware-importer/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({triggeredBy:"manual"})}),t=await e.json();e.ok&&void 0!==t.success&&(alert("Import ".concat(t.success?"completed":"failed",": ").concat(t.message)),window.location.reload())}catch(e){alert("Import failed to start")}finally{t(!1),s(null)}};return(0,l.jsx)(a.Button,{buttonStyle:"primary",onClick:o,disabled:e,children:(()=>{if(!e)return"Run Import";if(r&&r.total>0){var t,l,n,a,s;let e=(null==(t=r.currentStep)?void 0:t.includes("Fetching from GitHub"))||(null==(l=r.currentStep)?void 0:l.includes("GitHub fetch complete")),o=(null==(n=r.currentStep)?void 0:n.includes("Processing batch"))||(null==(a=r.currentStep)?void 0:a.includes("Starting import"))||(null==(s=r.currentStep)?void 0:s.includes("Import completed")),i="Processing";return e?i="Validating":o&&(i="Importing"),"".concat(i,"... ").concat(r.current,"/").concat(r.total," (").concat(r.percentage,"%)")}return"Starting..."})()})}},64621:(e,t,r)=>{"use strict";r.d(t,{Icon:()=>a});var l=r(12526),n=r(99486);let a=e=>{let{name:t,className:r="",size:a=16,width:s,height:o,loading:i="lazy",priority:c="low"}=e,[u,d]=(0,n.useState)("");return((0,n.useEffect)(()=>{if(t)fetch("/icons/".concat(t,".svg"),{..."high"===c&&{priority:"high"}}).then(e=>e.text()).then(e=>{let t=new DOMParser().parseFromString(e,"image/svg+xml").querySelector("svg");t&&(void 0!==s&&void 0!==o?(t.setAttribute("width",s.toString()),t.setAttribute("height",o.toString())):(t.setAttribute("width",a.toString()),t.setAttribute("height",a.toString())),t.setAttribute("class",r),d(t.outerHTML))}).catch(e=>console.error("Failed to load SVG:",e))},[t,r,a,s,o,i,c]),u)?(0,l.jsx)("div",{className:"inline-flex items-center",dangerouslySetInnerHTML:{__html:u}}):null}},65904:(e,t,r)=>{"use strict";r.d(t,{RefreshCacheButton:()=>s});var l=r(12526),n=r(99486),a=r(69541);let s=()=>{let[e,t]=(0,n.useState)(!1),r=async()=>{t(!0);try{(await fetch("/api/hubspot/forms?refresh=true",{method:"GET"})).ok?a.toast.success("Forms cache refreshed successfully"):a.toast.error("Failed to refresh forms cache")}catch(e){console.error("Error refreshing cache:",e),a.toast.error("Error refreshing forms cache")}finally{t(!1)}};return(0,l.jsxs)("div",{style:{marginTop:"10px"},children:[(0,l.jsx)(a.Button,{onClick:r,disabled:e,buttonStyle:"secondary",children:e?"Refreshing...":"Refresh Forms Cache"}),(0,l.jsx)("p",{style:{marginTop:"8px",fontSize:"12px",color:"#666"},children:"Manually refresh the cached forms from HubSpot"})]})}},76205:(e,t,r)=>{"use strict";r.d(t,{MarketingPixels:()=>i,MarketingPixelsHead:()=>o});var l=r(12526),n=r(99486),a=r(33357);let s=(e,t)=>{var r;let n=e.customScript||"",s="custom-pixel-".concat(null==(r=e.name)?void 0:r.replace(/\s+/g,"-").toLowerCase());if(n.toLowerCase().includes("<script")){let e,r=[],o=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,i=0;for(;null!==(e=o.exec(n));){let n=e[1]||"",o=(e[2]||"").trim(),c=n.match(/src=["']([^"']+)["']/i),u=null==c?void 0:c[1];u&&r.push((0,l.jsx)(a.default,{id:"".concat(s,"-src-").concat(i),strategy:t,src:u},"".concat(s,"-src-").concat(i++))),o&&r.push((0,l.jsx)(a.default,{id:"".concat(s,"-inline-").concat(i),strategy:t,dangerouslySetInnerHTML:{__html:o}},"".concat(s,"-inline-").concat(i++)))}return 0===r.length?null:(0,l.jsx)(l.Fragment,{children:r})}return n.includes("<")?null:(0,l.jsx)(a.default,{id:"".concat(s,"-inline"),strategy:t,dangerouslySetInnerHTML:{__html:n}},"".concat(s,"-inline"))},o=e=>{let{pixels:t,globallyDisabled:r}=e;if(r||!t||0===t.length)return null;let a=t.filter(e=>!0===e.enabled&&!0===e.loadInHead);if(0===a.length)return null;let o=e=>s(e,"afterInteractive");return(0,l.jsx)(l.Fragment,{children:a.map((e,t)=>(0,l.jsx)(n.Fragment,{children:o(e)}
1,"head-pixel-".concat(e.name||e.id||t)))})},i=e=>{let{pixels:t,globallyDisabled:r}=e;if(r||!t||0===t.length)return null;let a=t.filter(e=>!0===e.enabled&&!0!==e.loadInHead);if(0===a.length)return null;let o=e=>s(e,"lazyOnload");return(0,l.jsx)(l.Fragment,{children:a.map((e,t)=>(0,l.jsx)(n.Fragment,{children:o(e)},"body-pixel-".concat(e.name||e.id||t)))})}}}]);
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.