viewgate-wrapper 1.10.23 → 1.10.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -155,7 +155,6 @@ export interface SemanticReference {
|
|
|
155
155
|
metadata?: {
|
|
156
156
|
hint?: string | undefined;
|
|
157
157
|
closestSource?: string | undefined;
|
|
158
|
-
screenshotUrl?: string | undefined;
|
|
159
158
|
computedStyles?: Record<string, string> | undefined;
|
|
160
159
|
viewportBreakpoint?: 'mobile' | 'tablet' | 'desktop' | undefined;
|
|
161
160
|
outerHtml?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewGateProvider.d.ts","sourceRoot":"","sources":["../../src/components/ViewGateProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkD,KAAK,SAAS,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhG,OAAO,wBAAwB,CAAC;AAEhC,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAC;AAEnC,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6FjB,CAAC;AAQF,MAAM,WAAW,iBAAiB;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,gBAAgB,CAAC,EAAE;QACf,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;KACb,CAAC;IACF,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,YAAY,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACjD,SAAS,CAAC,EAAE;QACR,MAAM,EAAE;YACJ,GAAG,EAAE,MAAM,CAAC;YACZ,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;YAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;YAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;SACjC,CAAC;QACF,MAAM,CAAC,EAAE;YACL,GAAG,EAAE,MAAM,CAAC;YACZ,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;YAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;SAC7B,GAAG,SAAS,CAAC;QACd,QAAQ,CAAC,EAAE,KAAK,CAAC;YACb,GAAG,EAAE,MAAM,CAAC;YACZ,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;YAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;SAC7B,CAAC,GAAG,SAAS,CAAC;KAClB,GAAG,SAAS,CAAC;IACd,WAAW,CAAC,EAAE;QACV,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,GAAG,EAAE,MAAM,CAAC;QACZ,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC/B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QACjC,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC/B,aAAa,EAAE,MAAM,CAAC;KACzB,GAAG,SAAS,CAAC;IACd,QAAQ,CAAC,EAAE;QACP,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC1B,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QACnC,
|
|
1
|
+
{"version":3,"file":"ViewGateProvider.d.ts","sourceRoot":"","sources":["../../src/components/ViewGateProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkD,KAAK,SAAS,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhG,OAAO,wBAAwB,CAAC;AAEhC,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAC;AAEnC,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6FjB,CAAC;AAQF,MAAM,WAAW,iBAAiB;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,gBAAgB,CAAC,EAAE;QACf,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;KACb,CAAC;IACF,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,YAAY,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACjD,SAAS,CAAC,EAAE;QACR,MAAM,EAAE;YACJ,GAAG,EAAE,MAAM,CAAC;YACZ,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;YAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;YAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;SACjC,CAAC;QACF,MAAM,CAAC,EAAE;YACL,GAAG,EAAE,MAAM,CAAC;YACZ,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;YAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;SAC7B,GAAG,SAAS,CAAC;QACd,QAAQ,CAAC,EAAE,KAAK,CAAC;YACb,GAAG,EAAE,MAAM,CAAC;YACZ,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;YAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;SAC7B,CAAC,GAAG,SAAS,CAAC;KAClB,GAAG,SAAS,CAAC;IACd,WAAW,CAAC,EAAE;QACV,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,GAAG,EAAE,MAAM,CAAC;QACZ,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC/B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QACjC,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC/B,aAAa,EAAE,MAAM,CAAC;KACzB,GAAG,SAAS,CAAC;IACd,QAAQ,CAAC,EAAE;QACP,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC1B,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QACnC,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;QACpD,kBAAkB,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;QACjE,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC/B,cAAc,CAAC,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,GAAG,SAAS,CAAC;QACtD,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QAC9B,gBAAgB,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;KACpD,GAAG,SAAS,CAAC;CACjB;AAED,UAAU,mBAAmB;IACzB,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,KAAK,IAAI,CAAC;IAC/D,QAAQ,EAAE,QAAQ,CAAC;IACnB,CAAC,EAAE,OAAO,YAAY,CAAC,EAAE,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,eAAe,EAAE,OAAO,CAAC;CAC5B;AAID,eAAO,MAAM,WAAW,2BAIvB,CAAC;AAEF,UAAU,aAAa;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAcD,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAwEtC,CAAC"}
|
package/dist/viewgate-wrapper.js
CHANGED
|
@@ -557,7 +557,7 @@ const xr = [
|
|
|
557
557
|
i((L) => L.filter((B) => B.id !== P));
|
|
558
558
|
}, 4e3);
|
|
559
559
|
}, m = yr[t];
|
|
560
|
-
return /* @__PURE__ */ o.jsxs(vt.Provider, { "data-source-path": "/src/components/ViewGateProvider.tsx:
|
|
560
|
+
return /* @__PURE__ */ o.jsxs(vt.Provider, { "data-source-path": "/src/components/ViewGateProvider.tsx:250", value: {
|
|
561
561
|
addToast: p,
|
|
562
562
|
language: t,
|
|
563
563
|
t: m,
|
|
@@ -567,13 +567,13 @@ const xr = [
|
|
|
567
567
|
hasActiveToasts: c.length > 0
|
|
568
568
|
}, children: [
|
|
569
569
|
e,
|
|
570
|
-
s && /* @__PURE__ */ o.jsx(Ht, { "data-source-path": "/src/components/ViewGateProvider.tsx:
|
|
571
|
-
/* @__PURE__ */ o.jsx(An, { "data-source-path": "/src/components/ViewGateProvider.tsx:
|
|
572
|
-
/* @__PURE__ */ o.jsx("div", { "data-source-path": "/src/components/ViewGateProvider.tsx:
|
|
573
|
-
f.type === "success" ? /* @__PURE__ */ o.jsx(de, { "data-source-path": "/src/components/ViewGateProvider.tsx:
|
|
574
|
-
/* @__PURE__ */ o.jsxs("div", { "data-source-path": "/src/components/ViewGateProvider.tsx:
|
|
575
|
-
/* @__PURE__ */ o.jsx("strong", { "data-source-path": "/src/components/ViewGateProvider.tsx:
|
|
576
|
-
/* @__PURE__ */ o.jsx("span", { "data-source-path": "/src/components/ViewGateProvider.tsx:
|
|
570
|
+
s && /* @__PURE__ */ o.jsx(Ht, { "data-source-path": "/src/components/ViewGateProvider.tsx:261", children: /* @__PURE__ */ o.jsxs("div", { "data-source-path": "/src/components/ViewGateProvider.tsx:262", className: "vg-container", children: [
|
|
571
|
+
/* @__PURE__ */ o.jsx(An, { "data-source-path": "/src/components/ViewGateProvider.tsx:263" }),
|
|
572
|
+
/* @__PURE__ */ o.jsx("div", { "data-source-path": "/src/components/ViewGateProvider.tsx:264", className: "vg-toasts", style: { zIndex: 2147483646 }, children: c.map((f) => /* @__PURE__ */ o.jsxs("div", { "data-source-path": "/src/components/ViewGateProvider.tsx:266", className: `vg-toast vg-animate-slide ${f.type}`, children: [
|
|
573
|
+
f.type === "success" ? /* @__PURE__ */ o.jsx(de, { "data-source-path": "/src/components/ViewGateProvider.tsx:268", size: 24, color: "#22c55e" }) : /* @__PURE__ */ o.jsx(Jt, { "data-source-path": "/src/components/ViewGateProvider.tsx:270", size: 24, color: "#ef4444" }),
|
|
574
|
+
/* @__PURE__ */ o.jsxs("div", { "data-source-path": "/src/components/ViewGateProvider.tsx:272", children: [
|
|
575
|
+
/* @__PURE__ */ o.jsx("strong", { "data-source-path": "/src/components/ViewGateProvider.tsx:273", style: { display: "block", fontSize: "13px", color: "#0f172a", textTransform: "uppercase", marginBottom: "2px" }, children: f.type === "success" ? m.successHeader : m.errorHeader }),
|
|
576
|
+
/* @__PURE__ */ o.jsx("span", { "data-source-path": "/src/components/ViewGateProvider.tsx:276", style: { fontSize: "14px", color: "#000000" }, children: f.message })
|
|
577
577
|
] })
|
|
578
578
|
] }, f.id)) })
|
|
579
579
|
] }) })
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<%s {...props} />
|
|
5
5
|
React keys must be passed directly to JSX without using spread:
|
|
6
6
|
let props = %s;
|
|
7
|
-
<%s key={someKey} {...props} />`,S,k,A,k),ge[k+S]=!0)}if(k=null,b!==void 0&&(r(b),k=""+b),c(y)&&(r(y.key),k=""+y.key),"key"in y){b={};for(var $ in y)$!=="key"&&(b[$]=y[$])}else b=y;return k&&i(b,typeof d=="function"?d.displayName||d.name||"Unknown":d),p(d,k,b,a(),ce,J)}function h(d){j(d)?d._store&&(d._store.validated=1):typeof d=="object"&&d!==null&&d.$$typeof===Ve&&(d._payload.status==="fulfilled"?j(d._payload.value)&&d._payload.value._store&&(d._payload.value._store.validated=1):d._store&&(d._store.validated=1))}function j(d){return typeof d=="object"&&d!==null&&d.$$typeof===D}var G=m,D=Symbol.for("react.transitional.element"),Y=Symbol.for("react.portal"),oe=Symbol.for("react.fragment"),je=Symbol.for("react.strict_mode"),_e=Symbol.for("react.profiler"),L=Symbol.for("react.consumer"),X=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),Oe=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),Ve=Symbol.for("react.lazy"),kt=Symbol.for("react.activity"),fe=Symbol.for("react.client.reference"),ie=G.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ae=Object.prototype.hasOwnProperty,Te=Array.isArray,z=console.createTask?console.createTask:function(){return null};G={react_stack_bottom_frame:function(d){return d()}};var q,te={},he=G.react_stack_bottom_frame.bind(G,s)(),U=z(n(s)),ge={};pe.Fragment=oe,pe.jsx=function(d,y,b){var S=1e4>ie.recentlyCreatedOwnerStacks++;return f(d,y,b,!1,S?Error("react-stack-top-frame"):he,S?z(n(d)):U)},pe.jsxs=function(d,y,b){var S=1e4>ie.recentlyCreatedOwnerStacks++;return f(d,y,b,!0,S?Error("react-stack-top-frame"):he,S?z(n(d)):U)}})()),pe}var Je;function Pt(){return Je||(Je=1,process.env.NODE_ENV==="production"?ve.exports=At():ve.exports=Tt()),ve.exports}var o=Pt();const Gt=({children:e})=>{const t=m.useRef(null),[r,n]=m.useState(null);return m.useEffect(()=>{if(t.current&&!t.current.shadowRoot){const a=t.current.attachShadow({mode:"open"});document.querySelectorAll("style[data-vite-dev-id], style:not([data-vite-dev-id])").forEach(i=>{(i.textContent?.includes(".vg-")||i.textContent?.includes("--vg-"))&&a.appendChild(i.cloneNode(!0))});const c=document.createElement("link");c.rel="stylesheet",c.href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800;900&display=swap",a.appendChild(c),n(a)}},[]),o.jsx("div",{"data-source-path":"/src/components/ShadowRootWrapper.tsx:38",ref:t,id:"viewgate-shadow-host",children:r&&Vt.createPortal(e,r)})};const Ze=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();const Nt=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Mt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase());const Ke=e=>{const t=Mt(e);return t.charAt(0).toUpperCase()+t.slice(1)};var It={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Lt=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const zt=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:s,iconNode:c,...i},u)=>m.createElement("svg",{ref:u,...It,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Ze("lucide",a),...!s&&!Lt(i)&&{"aria-hidden":"true"},...i},[...c.map(([p,f])=>m.createElement(p,f)),...Array.isArray(s)?s:[s]]));const T=(e,t)=>{const r=m.forwardRef(({className:n,...a},s)=>m.createElement(zt,{ref:s,iconNode:t,className:Ze(`lucide-${Nt(Ke(e))}`,`lucide-${e}`,n),...a}));return r.displayName=Ke(e),r};const Dt=T("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const ne=T("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const Qe=T("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);const qe=T("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);const Ft=T("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const Wt=T("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);const et=T("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);const Ht=T("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const be=T("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);const Ut=T("mouse-pointer-2",[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]]);const $t=T("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);const Bt=T("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);const Yt=T("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);const tt=T("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);const Pe=T("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Xt={en:{enterMode:"Enter Feedback Mode",exitMode:"Exit Mode",feedbackHeader:"Feedback",selectedElement:"Selected element:",line:"Line",placeholder:"Tell us what you'd like to change...",cancel:"Cancel",send:"Send Feedback",submitting:"Submitting...",success:"Your feedback has been submitted successfully!",error:"Failed to submit feedback. Check backend connection.",successHeader:"Success",errorHeader:"Error",preview:"Preview",viewComments:"View Comments",close:"Close",observe:"Observe",pending:"Pending",readyForReview:"Ready for Review",noComments:"No comments found.",deleteConfirm:"Delete comment",markReady:"Mark as Ready",reopen:"Reopen",review:"Review",confirmDelete:"Are you sure you want to permanently delete this comment? This action cannot be undone.",markReadyConfirm:"Complete review",confirmMarkReady:"Do you want to mark this comment as ready? it will be moved to the completed state.",reopenConfirm:"Reopen comment",confirmReopen:"Do you want to set this comment back to pending status?",yes:"Yes, confirm",no:"No, cancel",deleteSuccess:"Comment deleted successfully.",updateSuccess:"Updated successfully.",navigating:"Redirecting to review...",selectToComment:"Click to comment",feedbackSubheader:"What would you like to improve here?",sendFeedback:"Send Comment",edit:"Edit",save:"Save",commentDetails:"Comment Details",annotations:"Comments",viewAll:"View All",exitConfirmTitle:"Close ViewGate?",exitConfirmMessage:"Are you sure you want to close ViewGate? You can reopen it at any time by adding ?viewgate=true to your URL."},es:{enterMode:"Activar Modo Comentarios",exitMode:"Salir del Modo",feedbackHeader:"Comentarios",selectedElement:"Elemento seleccionado:",line:"Línea",placeholder:"Cuéntanos qué te gustaría cambiar...",cancel:"Cancelar",send:"Enviar Comentarios",submitting:"Enviando...",success:"¡Tus comentarios se han enviado con éxito!",error:"Error al enviar comentarios. Revisa la conexión con el servidor.",successHeader:"Éxito",errorHeader:"Error",preview:"Vista previa",viewComments:"Ver Comentarios",close:"Cerrar",observe:"Observar",pending:"Pendiente",readyForReview:"Lista para revisión",noComments:"No hay comentarios.",deleteConfirm:"Eliminar comentario",markReady:"Marcar como Listo",reopen:"Reabrir",review:"Revisar",confirmDelete:"¿Estás seguro de que deseas eliminar permanentemente este comentario? Esta acción no se puede deshacer.",markReadyConfirm:"Finalizar revisión",confirmMarkReady:"¿Deseas marcar este comentario como listo? Pasará al estado completado.",reopenConfirm:"Reabrir comentario",confirmReopen:"¿Deseas volver a poner este comentario en estado pendiente?",yes:"Sí, confirmar",no:"No, cancelar",deleteSuccess:"El comentario ha sido eliminado.",updateSuccess:"Actualizado correctamente.",navigating:"Redirigiendo a revisión...",selectToComment:"Haz clic para comentar",feedbackSubheader:"¿Qué te gustaría mejorar aquí?",sendFeedback:"Enviar Comentario",edit:"Editar",save:"Guardar",commentDetails:"Detalles del Comentario",annotations:"Comentarios",viewAll:"Ver Todos",exitConfirmTitle:"¿Cerrar ViewGate?",exitConfirmMessage:"¿Estás seguro de que deseas cerrar ViewGate? Puedes volver a activarlo en cualquier momento agregando ?viewgate=true a la URL."}},rt=m.createContext(void 0),nt=()=>{const e=m.useContext(rt);if(!e)throw new Error("useViewGate must be used within a ViewGateProvider");return e},Ge="viewgate_enabled",Jt=()=>typeof window>"u"?!1:new URLSearchParams(window.location.search).has("viewgate")?(sessionStorage.setItem(Ge,"true"),!0):sessionStorage.getItem(Ge)==="true",Zt=({children:e,language:t="es",apiKey:r,baseUrl:n="https://view-gate.vercel.app"})=>{const[a,s]=m.useState(!1),[c,i]=m.useState([]);m.useEffect(()=>{s(Jt())},[]);const u=()=>{if(sessionStorage.removeItem(Ge),s(!1),typeof window<"u"){const h=new URL(window.location.href);h.searchParams.delete("viewgate"),window.history.replaceState({},"",h.toString())}},p=(h,j)=>{const G=Date.now();i(D=>[...D,{id:G,message:h,type:j}]),setTimeout(()=>{i(D=>D.filter(Y=>Y.id!==G))},4e3)},f=Xt[t];return o.jsxs(rt.Provider,{"data-source-path":"/src/components/ViewGateProvider.tsx:251",value:{addToast:p,language:t,t:f,apiKey:r,baseUrl:n,disableViewGate:u,hasActiveToasts:c.length>0},children:[e,a&&o.jsx(Gt,{"data-source-path":"/src/components/ViewGateProvider.tsx:262",children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:263",className:"vg-container",children:[o.jsx(Et,{"data-source-path":"/src/components/ViewGateProvider.tsx:264"}),o.jsx("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:265",className:"vg-toasts",style:{zIndex:2147483646},children:c.map(h=>o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:267",className:`vg-toast vg-animate-slide ${h.type}`,children:[h.type==="success"?o.jsx(ne,{"data-source-path":"/src/components/ViewGateProvider.tsx:269",size:24,color:"#22c55e"}):o.jsx(Dt,{"data-source-path":"/src/components/ViewGateProvider.tsx:271",size:24,color:"#ef4444"}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:273",children:[o.jsx("strong",{"data-source-path":"/src/components/ViewGateProvider.tsx:274",style:{display:"block",fontSize:"13px",color:"#0f172a",textTransform:"uppercase",marginBottom:"2px"},children:h.type==="success"?f.successHeader:f.errorHeader}),o.jsx("span",{"data-source-path":"/src/components/ViewGateProvider.tsx:277",style:{fontSize:"14px",color:"#000000"},children:h.message})]})]},h.id))})]})})]})};function Kt(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),n=r.createElement("base"),a=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(a),t&&(n.href=t),a.href=e,a.href}const Qt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Q(e){const t=[];for(let r=0,n=e.length;r<n;r++)t.push(e[r]);return t}let ae=null;function at(e={}){return ae||(e.includeStyleProperties?(ae=e.includeStyleProperties,ae):(ae=Q(window.getComputedStyle(document.documentElement)),ae))}function Se(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function qt(e){const t=Se(e,"border-left-width"),r=Se(e,"border-right-width");return e.clientWidth+t+r}function er(e){const t=Se(e,"border-top-width"),r=Se(e,"border-bottom-width");return e.clientHeight+t+r}function st(e,t={}){const r=t.width||qt(e),n=t.height||er(e);return{width:r,height:n}}function tr(){let e,t;try{t=process}catch{}const r=t&&t.env?t.env.devicePixelRatio:null;return r&&(e=parseInt(r,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const I=16384;function rr(e){(e.width>I||e.height>I)&&(e.width>I&&e.height>I?e.width>e.height?(e.height*=I/e.width,e.width=I):(e.width*=I/e.height,e.height=I):e.width>I?(e.height*=I/e.width,e.width=I):(e.width*=I/e.height,e.height=I))}function Ce(e){return new Promise((t,r)=>{const n=new Image;n.onload=()=>{n.decode().then(()=>{requestAnimationFrame(()=>t(n))})},n.onerror=r,n.crossOrigin="anonymous",n.decoding="async",n.src=e})}async function nr(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function ar(e,t,r){const n="http://www.w3.org/2000/svg",a=document.createElementNS(n,"svg"),s=document.createElementNS(n,"foreignObject");return a.setAttribute("width",`${t}`),a.setAttribute("height",`${r}`),a.setAttribute("viewBox",`0 0 ${t} ${r}`),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("x","0"),s.setAttribute("y","0"),s.setAttribute("externalResourcesRequired","true"),a.appendChild(s),s.appendChild(e),nr(a)}const P=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||P(r,t)};function sr(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function or(e,t){return at(t).map(r=>{const n=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${n}${a?" !important":""};`}).join(" ")}function ir(e,t,r,n){const a=`.${e}:${t}`,s=r.cssText?sr(r):or(r,n);return document.createTextNode(`${a}{${s}}`)}function ot(e,t,r,n){const a=window.getComputedStyle(e,r),s=a.getPropertyValue("content");if(s===""||s==="none")return;const c=Qt();try{t.className=`${t.className} ${c}`}catch{return}const i=document.createElement("style");i.appendChild(ir(c,r,a,n)),t.appendChild(i)}function cr(e,t,r){ot(e,t,":before",r),ot(e,t,":after",r)}const it="application/font-woff",ct="image/jpeg",lr={woff:it,woff2:it,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:ct,jpeg:ct,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function dr(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Ne(e){const t=dr(e).toLowerCase();return lr[t]||""}function ur(e){return e.split(/,/)[1]}function Me(e){return e.search(/^(data:)/)!==-1}function pr(e,t){return`data:${t};base64,${e}`}async function lt(e,t,r){const n=await fetch(e,t);if(n.status===404)throw new Error(`Resource "${n.url}" not found`);const a=await n.blob();return new Promise((s,c)=>{const i=new FileReader;i.onerror=c,i.onloadend=()=>{try{s(r({res:n,result:i.result}))}catch(u){c(u)}},i.readAsDataURL(a)})}const Ie={};function mr(e,t,r){let n=e.replace(/\?.*/,"");return r&&(n=e),/ttf|otf|eot|woff2?/i.test(n)&&(n=n.replace(/.*\//,"")),t?`[${t}]${n}`:n}async function Le(e,t,r){const n=mr(e,t,r.includeQueryParams);if(Ie[n]!=null)return Ie[n];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const s=await lt(e,r.fetchRequestInit,({res:c,result:i})=>(t||(t=c.headers.get("Content-Type")||""),ur(i)));a=pr(s,t)}catch(s){a=r.imagePlaceholder||"";let c=`Failed to fetch resource: ${e}`;s&&(c=typeof s=="string"?s:s.message),c&&console.warn(c)}return Ie[n]=a,a}async function fr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):Ce(t)}async function hr(e,t){if(e.currentSrc){const s=document.createElement("canvas"),c=s.getContext("2d");s.width=e.clientWidth,s.height=e.clientHeight,c?.drawImage(e,0,0,s.width,s.height);const i=s.toDataURL();return Ce(i)}const r=e.poster,n=Ne(r),a=await Le(r,n,t);return Ce(a)}async function gr(e,t){var r;try{if(!((r=e?.contentDocument)===null||r===void 0)&&r.body)return await Ee(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function xr(e,t){return P(e,HTMLCanvasElement)?fr(e):P(e,HTMLVideoElement)?hr(e,t):P(e,HTMLIFrameElement)?gr(e,t):e.cloneNode(dt(e))}const yr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",dt=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function wr(e,t,r){var n,a;if(dt(t))return t;let s=[];return yr(e)&&e.assignedNodes?s=Q(e.assignedNodes()):P(e,HTMLIFrameElement)&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?s=Q(e.contentDocument.body.childNodes):s=Q(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),s.length===0||P(e,HTMLVideoElement)||await s.reduce((c,i)=>c.then(()=>Ee(i,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function vr(e,t,r){const n=t.style;if(!n)return;const a=window.getComputedStyle(e);a.cssText?(n.cssText=a.cssText,n.transformOrigin=a.transformOrigin):at(r).forEach(s=>{let c=a.getPropertyValue(s);s==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),P(e,HTMLIFrameElement)&&s==="display"&&c==="inline"&&(c="block"),s==="d"&&t.getAttribute("d")&&(c=`path(${t.getAttribute("d")})`),n.setProperty(s,c,a.getPropertyPriority(s))})}function br(e,t){P(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),P(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function Sr(e,t){if(P(e,HTMLSelectElement)){const n=Array.from(t.children).find(a=>e.value===a.getAttribute("value"));n&&n.setAttribute("selected","")}}function Cr(e,t,r){return P(t,Element)&&(vr(e,t,r),cr(e,t,r),br(e,t),Sr(e,t)),t}async function Er(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const n={};for(let s=0;s<r.length;s++){const i=r[s].getAttribute("xlink:href");if(i){const u=e.querySelector(i),p=document.querySelector(i);!u&&p&&!n[i]&&(n[i]=await Ee(p,t,!0))}}const a=Object.values(n);if(a.length){const s="http://www.w3.org/1999/xhtml",c=document.createElementNS(s,"svg");c.setAttribute("xmlns",s),c.style.position="absolute",c.style.width="0",c.style.height="0",c.style.overflow="hidden",c.style.display="none";const i=document.createElementNS(s,"defs");c.appendChild(i);for(let u=0;u<a.length;u++)i.appendChild(a[u]);e.appendChild(c)}return e}async function Ee(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(n=>xr(n,t)).then(n=>wr(e,n,t)).then(n=>Cr(e,n,t)).then(n=>Er(n,t))}const ut=/url\((['"]?)([^'"]+?)\1\)/g,kr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Rr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function jr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function _r(e){const t=[];return e.replace(ut,(r,n,a)=>(t.push(a),r)),t.filter(r=>!Me(r))}async function Or(e,t,r,n,a){try{const s=r?Kt(t,r):t,c=Ne(t);let i;return a||(i=await Le(s,c,n)),e.replace(jr(t),`$1${i}$3`)}catch{}return e}function Vr(e,{preferredFontFormat:t}){return t?e.replace(Rr,r=>{for(;;){const[n,,a]=kr.exec(r)||[];if(!a)return"";if(a===t)return`src: ${n};`}}):e}function pt(e){return e.search(ut)!==-1}async function mt(e,t,r){if(!pt(e))return e;const n=Vr(e,r);return _r(n).reduce((s,c)=>s.then(i=>Or(i,c,t,r)),Promise.resolve(n))}async function se(e,t,r){var n;const a=(n=t.style)===null||n===void 0?void 0:n.getPropertyValue(e);if(a){const s=await mt(a,null,r);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function Ar(e,t){await se("background",e,t)||await se("background-image",e,t),await se("mask",e,t)||await se("-webkit-mask",e,t)||await se("mask-image",e,t)||await se("-webkit-mask-image",e,t)}async function Tr(e,t){const r=P(e,HTMLImageElement);if(!(r&&!Me(e.src))&&!(P(e,SVGImageElement)&&!Me(e.href.baseVal)))return;const n=r?e.src:e.href.baseVal,a=await Le(n,Ne(n),t);await new Promise((s,c)=>{e.onload=s,e.onerror=t.onImageErrorHandler?(...u)=>{try{s(t.onImageErrorHandler(...u))}catch(p){c(p)}}:c;const i=e;i.decode&&(i.decode=s),i.loading==="lazy"&&(i.loading="eager"),r?(e.srcset="",e.src=a):e.href.baseVal=a})}async function Pr(e,t){const n=Q(e.childNodes).map(a=>ft(a,t));await Promise.all(n).then(()=>e)}async function ft(e,t){P(e,Element)&&(await Ar(e,t),await Tr(e,t),await Pr(e,t))}function Gr(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const n=t.style;return n!=null&&Object.keys(n).forEach(a=>{r[a]=n[a]}),e}const ht={};async function gt(e){let t=ht[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},ht[e]=t,t}async function xt(e,t){let r=e.cssText;const n=/url\(["']?([^"')]+)["']?\)/g,s=(r.match(/url\([^)]+\)/g)||[]).map(async c=>{let i=c.replace(n,"$1");return i.startsWith("https://")||(i=new URL(i,e.url).href),lt(i,t.fetchRequestInit,({result:u})=>(r=r.replace(c,`url(${u})`),[c,u]))});return Promise.all(s).then(()=>r)}function yt(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let n=e.replace(r,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const u=a.exec(n);if(u===null)break;t.push(u[0])}n=n.replace(a,"");const s=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,c="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",i=new RegExp(c,"gi");for(;;){let u=s.exec(n);if(u===null){if(u=i.exec(n),u===null)break;s.lastIndex=i.lastIndex}else i.lastIndex=s.lastIndex;t.push(u[0])}return t}async function Nr(e,t){const r=[],n=[];return e.forEach(a=>{if("cssRules"in a)try{Q(a.cssRules||[]).forEach((s,c)=>{if(s.type===CSSRule.IMPORT_RULE){let i=c+1;const u=s.href,p=gt(u).then(f=>xt(f,t)).then(f=>yt(f).forEach(h=>{try{a.insertRule(h,h.startsWith("@import")?i+=1:a.cssRules.length)}catch(j){console.error("Error inserting rule from remote css",{rule:h,error:j})}})).catch(f=>{console.error("Error loading remote css",f.toString())});n.push(p)}})}catch(s){const c=e.find(i=>i.href==null)||document.styleSheets[0];a.href!=null&&n.push(gt(a.href).then(i=>xt(i,t)).then(i=>yt(i).forEach(u=>{c.insertRule(u,c.cssRules.length)})).catch(i=>{console.error("Error loading remote stylesheet",i)})),console.error("Error inlining remote css file",s)}}),Promise.all(n).then(()=>(e.forEach(a=>{if("cssRules"in a)try{Q(a.cssRules||[]).forEach(s=>{r.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${a.href}`,s)}}),r))}function Mr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>pt(t.style.getPropertyValue("src")))}async function Ir(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=Q(e.ownerDocument.styleSheets),n=await Nr(r,t);return Mr(n)}function wt(e){return e.trim().replace(/["']/g,"")}function Lr(e){const t=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(s=>{t.add(wt(s))}),Array.from(n.children).forEach(s=>{s instanceof HTMLElement&&r(s)})}return r(e),t}async function zr(e,t){const r=await Ir(e,t),n=Lr(e);return(await Promise.all(r.filter(s=>n.has(wt(s.style.fontFamily))).map(s=>{const c=s.parentStyleSheet?s.parentStyleSheet.href:null;return mt(s.cssText,c,t)}))).join(`
|
|
7
|
+
<%s key={someKey} {...props} />`,S,k,A,k),ge[k+S]=!0)}if(k=null,b!==void 0&&(r(b),k=""+b),c(y)&&(r(y.key),k=""+y.key),"key"in y){b={};for(var $ in y)$!=="key"&&(b[$]=y[$])}else b=y;return k&&i(b,typeof d=="function"?d.displayName||d.name||"Unknown":d),p(d,k,b,a(),ce,J)}function h(d){j(d)?d._store&&(d._store.validated=1):typeof d=="object"&&d!==null&&d.$$typeof===Ve&&(d._payload.status==="fulfilled"?j(d._payload.value)&&d._payload.value._store&&(d._payload.value._store.validated=1):d._store&&(d._store.validated=1))}function j(d){return typeof d=="object"&&d!==null&&d.$$typeof===D}var G=m,D=Symbol.for("react.transitional.element"),Y=Symbol.for("react.portal"),oe=Symbol.for("react.fragment"),je=Symbol.for("react.strict_mode"),_e=Symbol.for("react.profiler"),L=Symbol.for("react.consumer"),X=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),Oe=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),Ve=Symbol.for("react.lazy"),kt=Symbol.for("react.activity"),fe=Symbol.for("react.client.reference"),ie=G.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ae=Object.prototype.hasOwnProperty,Te=Array.isArray,z=console.createTask?console.createTask:function(){return null};G={react_stack_bottom_frame:function(d){return d()}};var q,te={},he=G.react_stack_bottom_frame.bind(G,s)(),U=z(n(s)),ge={};pe.Fragment=oe,pe.jsx=function(d,y,b){var S=1e4>ie.recentlyCreatedOwnerStacks++;return f(d,y,b,!1,S?Error("react-stack-top-frame"):he,S?z(n(d)):U)},pe.jsxs=function(d,y,b){var S=1e4>ie.recentlyCreatedOwnerStacks++;return f(d,y,b,!0,S?Error("react-stack-top-frame"):he,S?z(n(d)):U)}})()),pe}var Je;function Pt(){return Je||(Je=1,process.env.NODE_ENV==="production"?ve.exports=At():ve.exports=Tt()),ve.exports}var o=Pt();const Gt=({children:e})=>{const t=m.useRef(null),[r,n]=m.useState(null);return m.useEffect(()=>{if(t.current&&!t.current.shadowRoot){const a=t.current.attachShadow({mode:"open"});document.querySelectorAll("style[data-vite-dev-id], style:not([data-vite-dev-id])").forEach(i=>{(i.textContent?.includes(".vg-")||i.textContent?.includes("--vg-"))&&a.appendChild(i.cloneNode(!0))});const c=document.createElement("link");c.rel="stylesheet",c.href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800;900&display=swap",a.appendChild(c),n(a)}},[]),o.jsx("div",{"data-source-path":"/src/components/ShadowRootWrapper.tsx:38",ref:t,id:"viewgate-shadow-host",children:r&&Vt.createPortal(e,r)})};const Ze=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();const Nt=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Mt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase());const Ke=e=>{const t=Mt(e);return t.charAt(0).toUpperCase()+t.slice(1)};var It={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Lt=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const zt=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:s,iconNode:c,...i},u)=>m.createElement("svg",{ref:u,...It,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Ze("lucide",a),...!s&&!Lt(i)&&{"aria-hidden":"true"},...i},[...c.map(([p,f])=>m.createElement(p,f)),...Array.isArray(s)?s:[s]]));const T=(e,t)=>{const r=m.forwardRef(({className:n,...a},s)=>m.createElement(zt,{ref:s,iconNode:t,className:Ze(`lucide-${Nt(Ke(e))}`,`lucide-${e}`,n),...a}));return r.displayName=Ke(e),r};const Dt=T("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const ne=T("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const Qe=T("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);const qe=T("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);const Ft=T("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const Wt=T("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);const et=T("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);const Ht=T("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const be=T("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);const Ut=T("mouse-pointer-2",[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]]);const $t=T("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);const Bt=T("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);const Yt=T("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);const tt=T("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);const Pe=T("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Xt={en:{enterMode:"Enter Feedback Mode",exitMode:"Exit Mode",feedbackHeader:"Feedback",selectedElement:"Selected element:",line:"Line",placeholder:"Tell us what you'd like to change...",cancel:"Cancel",send:"Send Feedback",submitting:"Submitting...",success:"Your feedback has been submitted successfully!",error:"Failed to submit feedback. Check backend connection.",successHeader:"Success",errorHeader:"Error",preview:"Preview",viewComments:"View Comments",close:"Close",observe:"Observe",pending:"Pending",readyForReview:"Ready for Review",noComments:"No comments found.",deleteConfirm:"Delete comment",markReady:"Mark as Ready",reopen:"Reopen",review:"Review",confirmDelete:"Are you sure you want to permanently delete this comment? This action cannot be undone.",markReadyConfirm:"Complete review",confirmMarkReady:"Do you want to mark this comment as ready? it will be moved to the completed state.",reopenConfirm:"Reopen comment",confirmReopen:"Do you want to set this comment back to pending status?",yes:"Yes, confirm",no:"No, cancel",deleteSuccess:"Comment deleted successfully.",updateSuccess:"Updated successfully.",navigating:"Redirecting to review...",selectToComment:"Click to comment",feedbackSubheader:"What would you like to improve here?",sendFeedback:"Send Comment",edit:"Edit",save:"Save",commentDetails:"Comment Details",annotations:"Comments",viewAll:"View All",exitConfirmTitle:"Close ViewGate?",exitConfirmMessage:"Are you sure you want to close ViewGate? You can reopen it at any time by adding ?viewgate=true to your URL."},es:{enterMode:"Activar Modo Comentarios",exitMode:"Salir del Modo",feedbackHeader:"Comentarios",selectedElement:"Elemento seleccionado:",line:"Línea",placeholder:"Cuéntanos qué te gustaría cambiar...",cancel:"Cancelar",send:"Enviar Comentarios",submitting:"Enviando...",success:"¡Tus comentarios se han enviado con éxito!",error:"Error al enviar comentarios. Revisa la conexión con el servidor.",successHeader:"Éxito",errorHeader:"Error",preview:"Vista previa",viewComments:"Ver Comentarios",close:"Cerrar",observe:"Observar",pending:"Pendiente",readyForReview:"Lista para revisión",noComments:"No hay comentarios.",deleteConfirm:"Eliminar comentario",markReady:"Marcar como Listo",reopen:"Reabrir",review:"Revisar",confirmDelete:"¿Estás seguro de que deseas eliminar permanentemente este comentario? Esta acción no se puede deshacer.",markReadyConfirm:"Finalizar revisión",confirmMarkReady:"¿Deseas marcar este comentario como listo? Pasará al estado completado.",reopenConfirm:"Reabrir comentario",confirmReopen:"¿Deseas volver a poner este comentario en estado pendiente?",yes:"Sí, confirmar",no:"No, cancelar",deleteSuccess:"El comentario ha sido eliminado.",updateSuccess:"Actualizado correctamente.",navigating:"Redirigiendo a revisión...",selectToComment:"Haz clic para comentar",feedbackSubheader:"¿Qué te gustaría mejorar aquí?",sendFeedback:"Enviar Comentario",edit:"Editar",save:"Guardar",commentDetails:"Detalles del Comentario",annotations:"Comentarios",viewAll:"Ver Todos",exitConfirmTitle:"¿Cerrar ViewGate?",exitConfirmMessage:"¿Estás seguro de que deseas cerrar ViewGate? Puedes volver a activarlo en cualquier momento agregando ?viewgate=true a la URL."}},rt=m.createContext(void 0),nt=()=>{const e=m.useContext(rt);if(!e)throw new Error("useViewGate must be used within a ViewGateProvider");return e},Ge="viewgate_enabled",Jt=()=>typeof window>"u"?!1:new URLSearchParams(window.location.search).has("viewgate")?(sessionStorage.setItem(Ge,"true"),!0):sessionStorage.getItem(Ge)==="true",Zt=({children:e,language:t="es",apiKey:r,baseUrl:n="https://view-gate.vercel.app"})=>{const[a,s]=m.useState(!1),[c,i]=m.useState([]);m.useEffect(()=>{s(Jt())},[]);const u=()=>{if(sessionStorage.removeItem(Ge),s(!1),typeof window<"u"){const h=new URL(window.location.href);h.searchParams.delete("viewgate"),window.history.replaceState({},"",h.toString())}},p=(h,j)=>{const G=Date.now();i(D=>[...D,{id:G,message:h,type:j}]),setTimeout(()=>{i(D=>D.filter(Y=>Y.id!==G))},4e3)},f=Xt[t];return o.jsxs(rt.Provider,{"data-source-path":"/src/components/ViewGateProvider.tsx:250",value:{addToast:p,language:t,t:f,apiKey:r,baseUrl:n,disableViewGate:u,hasActiveToasts:c.length>0},children:[e,a&&o.jsx(Gt,{"data-source-path":"/src/components/ViewGateProvider.tsx:261",children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:262",className:"vg-container",children:[o.jsx(Et,{"data-source-path":"/src/components/ViewGateProvider.tsx:263"}),o.jsx("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:264",className:"vg-toasts",style:{zIndex:2147483646},children:c.map(h=>o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:266",className:`vg-toast vg-animate-slide ${h.type}`,children:[h.type==="success"?o.jsx(ne,{"data-source-path":"/src/components/ViewGateProvider.tsx:268",size:24,color:"#22c55e"}):o.jsx(Dt,{"data-source-path":"/src/components/ViewGateProvider.tsx:270",size:24,color:"#ef4444"}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:272",children:[o.jsx("strong",{"data-source-path":"/src/components/ViewGateProvider.tsx:273",style:{display:"block",fontSize:"13px",color:"#0f172a",textTransform:"uppercase",marginBottom:"2px"},children:h.type==="success"?f.successHeader:f.errorHeader}),o.jsx("span",{"data-source-path":"/src/components/ViewGateProvider.tsx:276",style:{fontSize:"14px",color:"#000000"},children:h.message})]})]},h.id))})]})})]})};function Kt(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),n=r.createElement("base"),a=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(a),t&&(n.href=t),a.href=e,a.href}const Qt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Q(e){const t=[];for(let r=0,n=e.length;r<n;r++)t.push(e[r]);return t}let ae=null;function at(e={}){return ae||(e.includeStyleProperties?(ae=e.includeStyleProperties,ae):(ae=Q(window.getComputedStyle(document.documentElement)),ae))}function Se(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function qt(e){const t=Se(e,"border-left-width"),r=Se(e,"border-right-width");return e.clientWidth+t+r}function er(e){const t=Se(e,"border-top-width"),r=Se(e,"border-bottom-width");return e.clientHeight+t+r}function st(e,t={}){const r=t.width||qt(e),n=t.height||er(e);return{width:r,height:n}}function tr(){let e,t;try{t=process}catch{}const r=t&&t.env?t.env.devicePixelRatio:null;return r&&(e=parseInt(r,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const I=16384;function rr(e){(e.width>I||e.height>I)&&(e.width>I&&e.height>I?e.width>e.height?(e.height*=I/e.width,e.width=I):(e.width*=I/e.height,e.height=I):e.width>I?(e.height*=I/e.width,e.width=I):(e.width*=I/e.height,e.height=I))}function Ce(e){return new Promise((t,r)=>{const n=new Image;n.onload=()=>{n.decode().then(()=>{requestAnimationFrame(()=>t(n))})},n.onerror=r,n.crossOrigin="anonymous",n.decoding="async",n.src=e})}async function nr(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function ar(e,t,r){const n="http://www.w3.org/2000/svg",a=document.createElementNS(n,"svg"),s=document.createElementNS(n,"foreignObject");return a.setAttribute("width",`${t}`),a.setAttribute("height",`${r}`),a.setAttribute("viewBox",`0 0 ${t} ${r}`),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("x","0"),s.setAttribute("y","0"),s.setAttribute("externalResourcesRequired","true"),a.appendChild(s),s.appendChild(e),nr(a)}const P=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||P(r,t)};function sr(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function or(e,t){return at(t).map(r=>{const n=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${n}${a?" !important":""};`}).join(" ")}function ir(e,t,r,n){const a=`.${e}:${t}`,s=r.cssText?sr(r):or(r,n);return document.createTextNode(`${a}{${s}}`)}function ot(e,t,r,n){const a=window.getComputedStyle(e,r),s=a.getPropertyValue("content");if(s===""||s==="none")return;const c=Qt();try{t.className=`${t.className} ${c}`}catch{return}const i=document.createElement("style");i.appendChild(ir(c,r,a,n)),t.appendChild(i)}function cr(e,t,r){ot(e,t,":before",r),ot(e,t,":after",r)}const it="application/font-woff",ct="image/jpeg",lr={woff:it,woff2:it,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:ct,jpeg:ct,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function dr(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Ne(e){const t=dr(e).toLowerCase();return lr[t]||""}function ur(e){return e.split(/,/)[1]}function Me(e){return e.search(/^(data:)/)!==-1}function pr(e,t){return`data:${t};base64,${e}`}async function lt(e,t,r){const n=await fetch(e,t);if(n.status===404)throw new Error(`Resource "${n.url}" not found`);const a=await n.blob();return new Promise((s,c)=>{const i=new FileReader;i.onerror=c,i.onloadend=()=>{try{s(r({res:n,result:i.result}))}catch(u){c(u)}},i.readAsDataURL(a)})}const Ie={};function mr(e,t,r){let n=e.replace(/\?.*/,"");return r&&(n=e),/ttf|otf|eot|woff2?/i.test(n)&&(n=n.replace(/.*\//,"")),t?`[${t}]${n}`:n}async function Le(e,t,r){const n=mr(e,t,r.includeQueryParams);if(Ie[n]!=null)return Ie[n];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const s=await lt(e,r.fetchRequestInit,({res:c,result:i})=>(t||(t=c.headers.get("Content-Type")||""),ur(i)));a=pr(s,t)}catch(s){a=r.imagePlaceholder||"";let c=`Failed to fetch resource: ${e}`;s&&(c=typeof s=="string"?s:s.message),c&&console.warn(c)}return Ie[n]=a,a}async function fr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):Ce(t)}async function hr(e,t){if(e.currentSrc){const s=document.createElement("canvas"),c=s.getContext("2d");s.width=e.clientWidth,s.height=e.clientHeight,c?.drawImage(e,0,0,s.width,s.height);const i=s.toDataURL();return Ce(i)}const r=e.poster,n=Ne(r),a=await Le(r,n,t);return Ce(a)}async function gr(e,t){var r;try{if(!((r=e?.contentDocument)===null||r===void 0)&&r.body)return await Ee(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function xr(e,t){return P(e,HTMLCanvasElement)?fr(e):P(e,HTMLVideoElement)?hr(e,t):P(e,HTMLIFrameElement)?gr(e,t):e.cloneNode(dt(e))}const yr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",dt=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function wr(e,t,r){var n,a;if(dt(t))return t;let s=[];return yr(e)&&e.assignedNodes?s=Q(e.assignedNodes()):P(e,HTMLIFrameElement)&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?s=Q(e.contentDocument.body.childNodes):s=Q(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),s.length===0||P(e,HTMLVideoElement)||await s.reduce((c,i)=>c.then(()=>Ee(i,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function vr(e,t,r){const n=t.style;if(!n)return;const a=window.getComputedStyle(e);a.cssText?(n.cssText=a.cssText,n.transformOrigin=a.transformOrigin):at(r).forEach(s=>{let c=a.getPropertyValue(s);s==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),P(e,HTMLIFrameElement)&&s==="display"&&c==="inline"&&(c="block"),s==="d"&&t.getAttribute("d")&&(c=`path(${t.getAttribute("d")})`),n.setProperty(s,c,a.getPropertyPriority(s))})}function br(e,t){P(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),P(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function Sr(e,t){if(P(e,HTMLSelectElement)){const n=Array.from(t.children).find(a=>e.value===a.getAttribute("value"));n&&n.setAttribute("selected","")}}function Cr(e,t,r){return P(t,Element)&&(vr(e,t,r),cr(e,t,r),br(e,t),Sr(e,t)),t}async function Er(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const n={};for(let s=0;s<r.length;s++){const i=r[s].getAttribute("xlink:href");if(i){const u=e.querySelector(i),p=document.querySelector(i);!u&&p&&!n[i]&&(n[i]=await Ee(p,t,!0))}}const a=Object.values(n);if(a.length){const s="http://www.w3.org/1999/xhtml",c=document.createElementNS(s,"svg");c.setAttribute("xmlns",s),c.style.position="absolute",c.style.width="0",c.style.height="0",c.style.overflow="hidden",c.style.display="none";const i=document.createElementNS(s,"defs");c.appendChild(i);for(let u=0;u<a.length;u++)i.appendChild(a[u]);e.appendChild(c)}return e}async function Ee(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(n=>xr(n,t)).then(n=>wr(e,n,t)).then(n=>Cr(e,n,t)).then(n=>Er(n,t))}const ut=/url\((['"]?)([^'"]+?)\1\)/g,kr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Rr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function jr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function _r(e){const t=[];return e.replace(ut,(r,n,a)=>(t.push(a),r)),t.filter(r=>!Me(r))}async function Or(e,t,r,n,a){try{const s=r?Kt(t,r):t,c=Ne(t);let i;return a||(i=await Le(s,c,n)),e.replace(jr(t),`$1${i}$3`)}catch{}return e}function Vr(e,{preferredFontFormat:t}){return t?e.replace(Rr,r=>{for(;;){const[n,,a]=kr.exec(r)||[];if(!a)return"";if(a===t)return`src: ${n};`}}):e}function pt(e){return e.search(ut)!==-1}async function mt(e,t,r){if(!pt(e))return e;const n=Vr(e,r);return _r(n).reduce((s,c)=>s.then(i=>Or(i,c,t,r)),Promise.resolve(n))}async function se(e,t,r){var n;const a=(n=t.style)===null||n===void 0?void 0:n.getPropertyValue(e);if(a){const s=await mt(a,null,r);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function Ar(e,t){await se("background",e,t)||await se("background-image",e,t),await se("mask",e,t)||await se("-webkit-mask",e,t)||await se("mask-image",e,t)||await se("-webkit-mask-image",e,t)}async function Tr(e,t){const r=P(e,HTMLImageElement);if(!(r&&!Me(e.src))&&!(P(e,SVGImageElement)&&!Me(e.href.baseVal)))return;const n=r?e.src:e.href.baseVal,a=await Le(n,Ne(n),t);await new Promise((s,c)=>{e.onload=s,e.onerror=t.onImageErrorHandler?(...u)=>{try{s(t.onImageErrorHandler(...u))}catch(p){c(p)}}:c;const i=e;i.decode&&(i.decode=s),i.loading==="lazy"&&(i.loading="eager"),r?(e.srcset="",e.src=a):e.href.baseVal=a})}async function Pr(e,t){const n=Q(e.childNodes).map(a=>ft(a,t));await Promise.all(n).then(()=>e)}async function ft(e,t){P(e,Element)&&(await Ar(e,t),await Tr(e,t),await Pr(e,t))}function Gr(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const n=t.style;return n!=null&&Object.keys(n).forEach(a=>{r[a]=n[a]}),e}const ht={};async function gt(e){let t=ht[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},ht[e]=t,t}async function xt(e,t){let r=e.cssText;const n=/url\(["']?([^"')]+)["']?\)/g,s=(r.match(/url\([^)]+\)/g)||[]).map(async c=>{let i=c.replace(n,"$1");return i.startsWith("https://")||(i=new URL(i,e.url).href),lt(i,t.fetchRequestInit,({result:u})=>(r=r.replace(c,`url(${u})`),[c,u]))});return Promise.all(s).then(()=>r)}function yt(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let n=e.replace(r,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const u=a.exec(n);if(u===null)break;t.push(u[0])}n=n.replace(a,"");const s=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,c="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",i=new RegExp(c,"gi");for(;;){let u=s.exec(n);if(u===null){if(u=i.exec(n),u===null)break;s.lastIndex=i.lastIndex}else i.lastIndex=s.lastIndex;t.push(u[0])}return t}async function Nr(e,t){const r=[],n=[];return e.forEach(a=>{if("cssRules"in a)try{Q(a.cssRules||[]).forEach((s,c)=>{if(s.type===CSSRule.IMPORT_RULE){let i=c+1;const u=s.href,p=gt(u).then(f=>xt(f,t)).then(f=>yt(f).forEach(h=>{try{a.insertRule(h,h.startsWith("@import")?i+=1:a.cssRules.length)}catch(j){console.error("Error inserting rule from remote css",{rule:h,error:j})}})).catch(f=>{console.error("Error loading remote css",f.toString())});n.push(p)}})}catch(s){const c=e.find(i=>i.href==null)||document.styleSheets[0];a.href!=null&&n.push(gt(a.href).then(i=>xt(i,t)).then(i=>yt(i).forEach(u=>{c.insertRule(u,c.cssRules.length)})).catch(i=>{console.error("Error loading remote stylesheet",i)})),console.error("Error inlining remote css file",s)}}),Promise.all(n).then(()=>(e.forEach(a=>{if("cssRules"in a)try{Q(a.cssRules||[]).forEach(s=>{r.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${a.href}`,s)}}),r))}function Mr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>pt(t.style.getPropertyValue("src")))}async function Ir(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=Q(e.ownerDocument.styleSheets),n=await Nr(r,t);return Mr(n)}function wt(e){return e.trim().replace(/["']/g,"")}function Lr(e){const t=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(s=>{t.add(wt(s))}),Array.from(n.children).forEach(s=>{s instanceof HTMLElement&&r(s)})}return r(e),t}async function zr(e,t){const r=await Ir(e,t),n=Lr(e);return(await Promise.all(r.filter(s=>n.has(wt(s.style.fontFamily))).map(s=>{const c=s.parentStyleSheet?s.parentStyleSheet.href:null;return mt(s.cssText,c,t)}))).join(`
|
|
8
8
|
`)}async function Dr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await zr(e,t);if(r){const n=document.createElement("style"),a=document.createTextNode(r);n.appendChild(a),e.firstChild?e.insertBefore(n,e.firstChild):e.appendChild(n)}}async function Fr(e,t={}){const{width:r,height:n}=st(e,t),a=await Ee(e,t,!0);return await Dr(a,t),await ft(a,t),Gr(a,t),await ar(a,r,n)}async function Wr(e,t={}){const{width:r,height:n}=st(e,t),a=await Fr(e,t),s=await Ce(a),c=document.createElement("canvas"),i=c.getContext("2d"),u=t.pixelRatio||tr(),p=t.canvasWidth||r,f=t.canvasHeight||n;return c.width=p*u,c.height=f*u,t.skipAutoScale||rr(c),c.style.width=`${p}`,c.style.height=`${f}`,t.backgroundColor&&(i.fillStyle=t.backgroundColor,i.fillRect(0,0,c.width,c.height)),i.drawImage(s,0,0,c.width,c.height),c}async function Hr(e,t={}){return(await Wr(e,t)).toDataURL()}const ke=2147483647,ze=ke,De=2e6,Ur=ke-10,$r=ke-5,Br=ke-15,W="data-vg-pin-id",Yr=()=>{const e=window.innerWidth;return e<768?"mobile":e<1024?"tablet":"desktop"},vt=(e,t)=>{if(!e)return"";try{const r=new Date(e);return isNaN(r.getTime())?"":new Intl.DateTimeFormat(t==="es"?"es-ES":"en-US",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).format(r)}catch{return""}},bt=({url:e,className:t,style:r,tooltipStyle:n,onHover:a})=>{const s=m.useRef(null),c=()=>{if(!s.current||!a)return;const i=s.current.getBoundingClientRect(),u=i.top,p=window.innerHeight-i.bottom,f=u<140&&p>u?"bottom":"top";a({url:e,x:i.left+i.width/2,y:f==="top"?i.top:i.bottom,direction:f})};return o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:106",ref:s,className:`vg-url-tag ${t||""}`,style:r,onMouseEnter:c,onMouseMove:c,onMouseLeave:()=>a?.(null),children:[o.jsx(Wt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:114",size:r?.fontSize?parseInt(r.fontSize)+1:10}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:115",style:{maxWidth:r?.maxWidth||"150px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:new URL(e).pathname})]})},me=e=>{const t=[],r=[],n=[];let a=e;for(;a&&a.nodeType===Node.ELEMENT_NODE;){if(a.id&&!a.id.startsWith("vg-")&&!a.id.includes(":")){t.unshift(`#${a.id}`),n.unshift(`${a.localName}#${a.id}`);break}let s=a.localName;const c=Array.from(a.parentNode?.children||[]).indexOf(a),i=`${a.localName}[${c}]`;n.unshift(i);const u=a.getAttribute("data-testid")||a.getAttribute("data-qa");if(u&&r.push(`[data-testid="${u}"]`),a.getAttribute("placeholder"),a.getAttribute("aria-label"),a.getAttribute("role"),a.getAttribute("name"),a.getAttribute("title"),u){s=`[${a.hasAttribute("data-testid")?"data-testid":"data-qa"}="${u}"]`,t.unshift(s);break}const p=Array.from(a.parentNode?.children||[]).filter(f=>f.localName===a?.localName);if(p.length>1){const f=p.indexOf(a)+1;s+=`:nth-of-type(${f})`}t.unshift(s),a=a.parentElement}return{selector:t.join(" > "),fallbacks:r,vgPath:n.join(" > ")}},Xr=e=>{const{vgPath:t}=me(e);return{vgPath:t,classHash:e.className,parentTag:e.parentElement?.tagName.toLowerCase(),neighborCount:e.parentElement?.children.length,ariaLabel:e.getAttribute("aria-label")||void 0,role:e.getAttribute("role")||void 0,name:e.getAttribute("name")||void 0,type:e.getAttribute("type")||void 0,placeholder:e.getAttribute("placeholder")||void 0,textSnippet:(e.innerText||"").slice(0,30).trim()}},Jr=(e,t,r,n)=>new Promise(a=>{const s=new Image;s.onload=()=>{const c=document.createElement("canvas"),i=2,u=t.width+r*2,p=t.height+r*2;c.width=u*i,c.height=p*i;const f=c.getContext("2d");if(f){f.imageSmoothingEnabled=!0,f.imageSmoothingQuality="high";const h=(t.left-r)*n,j=(t.top-r)*n,G=u*n,D=p*n;f.drawImage(s,h,j,G,D,0,0,c.width,c.height)}a(c.toDataURL("image/png",.9))},s.onerror=()=>a(""),s.src=e}),Zr=(()=>{let e=null,t=null;return r=>{if(!r||typeof window>"u"||typeof document>"u")return r;if(r.includes("oklch")||r.includes("oklab")||r.includes("lab(")||r.includes("lch(")||r.includes("color("))try{if(e||(e=document.createElement("canvas"),e.width=1,e.height=1),t||(t=e.getContext("2d",{willReadFrequently:!0})),t){t.fillStyle="#000000",t.fillStyle=r;const s=t.fillStyle;if(s&&!s.includes("oklch")&&!s.includes("oklab"))return s}const n=document.createElement("div");n.style.color=r,document.body.appendChild(n);const a=getComputedStyle(n).color;return document.body.removeChild(n),a&&!a.includes("oklch")?a:"rgb(0,0,0)"}catch{return"rgb(0,0,0)"}return r}})(),Kr=e=>{const t=window.getComputedStyle(e),r={};return["display","position","margin","padding","font-size","color","background-color","width","height","z-index"].forEach(a=>{const s=t.getPropertyValue(a);r[a]=Zr(s)}),r},Qr=e=>{const r=Object.keys(e).find(s=>s.startsWith("__reactFiber$")||s.startsWith("__reactInternalInstance$"));if(!r)return"";const n=[];let a=e[r];for(;a;){const s=a.type;if(typeof s=="function"){const c=s.displayName||s.name;c&&!c.includes("ViewGate")&&!n.includes(c)&&n.unshift(c)}a=a.return}return n.join(" > ")||"Generic Component"},qr=e=>{if(!e)return!1;const t=window.getComputedStyle(e),r=e.getBoundingClientRect(),n=e.getAttribute("role");if(n&&["listbox","menu","combobox","tooltip","option"].includes(n))return!1;const s=120;return r.width<s&&r.height<s||t.position!=="fixed"&&t.position!=="absolute"?!1:!!(e.closest('[role="dialog"]')||e.closest('[aria-modal="true"]')||e.classList.contains("modal")||e.classList.contains("modal-content"))},ee=e=>{if(!e.isConnected)return!1;const t=window.getComputedStyle(e);if(t.display==="none"||t.visibility==="hidden"||t.opacity==="0"||e.offsetWidth===0||e.offsetHeight===0)return!1;let r=e.parentElement;for(;r;){const a=window.getComputedStyle(r);if(a.display==="none"||a.visibility==="hidden"||a.opacity==="0")return!1;r=r.parentElement}const n=e.getBoundingClientRect();return!(n.width===0||n.height===0||n.top===0&&n.left===0&&n.width>window.innerWidth*.9)},St=(e,t=document)=>{const r=t.querySelector(e);if(r)return r;const n=t.querySelectorAll("*");for(const a of Array.from(n)){const s=a.shadowRoot;if(s){const c=St(e,s);if(c)return c}}return null},Ct=(e,t)=>{let r=document.elementFromPoint(e,t);for(;r&&r.shadowRoot;){const n=r.shadowRoot.elementFromPoint(e,t);if(!n||n===r)break;r=n}return r},en=e=>{if(!e.tag)return null;const t=Array.from(document.getElementsByTagName(e.tag));let r=null,n=0;for(const a of t){if(!Re(a,e))continue;let s=0;const c=a.getAttribute("placeholder"),i=e.attributes?.placeholder||e.fingerprint?.placeholder;i&&c===i&&(s+=6);const u=a.getAttribute("type"),p=e.attributes?.type||e.fingerprint?.type;if(p&&u===p&&(s+=2),a.innerText?.trim()===e.text.trim()&&(s+=5),e.fingerprint?.vgPath){const{vgPath:f}=me(a);(f===e.vgPath||e.fingerprint?.vgPath===f)&&(s+=10)}s>n&&s>=7&&(n=s,r=a)}return r},Re=(e,t)=>{if(e.tagName.toLowerCase()!==t.tag.toLowerCase())return!1;const r=e.getAttribute("placeholder"),n=t.attributes?.placeholder||t.fingerprint?.placeholder;if(n&&r&&n!==r)return!1;const a=e.getAttribute("type"),s=t.attributes?.type||t.fingerprint?.type;return!(s&&a&&s!==a)},tn=(e,t)=>{if(t){const c=Array.from(document.querySelectorAll(`[${W}="${t}"]`));if(c.length>0){const i=c.filter(u=>Re(u,e));if(i.length===0)c.forEach(u=>u.removeAttribute(W));else{const u=i.find(f=>{const{vgPath:h}=me(f);return h===e.vgPath||e.fingerprint?.vgPath===h}),p=u&&ee(u)?u:i.find(f=>!(!ee(f)||e.metadata?.isModal&&!f.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content')));return p?(c.forEach(f=>{f!==p&&f.removeAttribute(W)}),p):null}}}const n=(e.selector?Array.from(document.querySelectorAll(e.selector)):[]).filter(c=>Re(c,e));let a=n.find(c=>{const{vgPath:i}=me(c);return i===e.vgPath||e.fingerprint?.vgPath===i})||n[0]||null;if(a&&ee(a))if(e.metadata?.isModal&&!a.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content'))a=null;else return a;if(e.fallbackSelectors)for(const c of e.fallbackSelectors){const i=St(c);if(i&&Re(i,e)&&ee(i)){if(e.metadata?.isModal&&!i.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content'))continue;return i}}const s=en(e);return s&&ee(s)?e.metadata?.isModal&&!s.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content')?null:s:null},Fe=e=>({tag:e.tagName.toLowerCase(),text:(e.innerText||e.getAttribute("placeholder")||"").slice(0,50).trim(),role:e.getAttribute("role")||void 0,type:e.getAttribute("type")||void 0}),rn=e=>{const t=e.parentElement;if(!t)return;const r=Array.from(t.children).filter(c=>c!==e).slice(0,5).map(c=>Fe(c)),n=Array.from(t.children),a=n.indexOf(e);let s="middle";return a===0&&(s="start"),a===n.length-1&&(s="end"),{target:{...Fe(e),location:`${s} of ${t.tagName.toLowerCase()}`},parent:Fe(t),siblings:r}},nn=e=>{let t="unknown:0",r=e;for(;r;){const f=r.getAttribute("data-source-path");if(f){t=f;break}r=r.parentElement}const n=Qr(e),{selector:a,fallbacks:s,vgPath:c}=me(e),i={};["placeholder","aria-label","name","type","alt","title","value","role"].forEach(f=>{const h=e.getAttribute(f);h&&(i[f]=h)});const u=!!e.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content'),p=`${e.tagName.toLowerCase()}-${(e.innerText||"").slice(0,20).replace(/\s+/g,"_")}-${a.split(" > ").slice(-1)}`;return{tag:e.tagName.toLowerCase(),id:e.id||"",classes:e.className||"",text:(e.innerText||"").slice(0,100).trim(),selector:a,vgPath:c,outerHtml:e.outerHTML,parentContext:(e.parentElement?.innerText||"").slice(0,150).trim(),componentPath:n,signature:p,source:t,attributes:i,fallbackSelectors:[...new Set(s)].slice(0,5),domPath:[],viewportSize:{width:window.innerWidth,height:window.innerHeight},uiContext:rn(e),fingerprint:Xr(e),metadata:{hint:`Edit ${t.split(":")[0]} at line ${t.split(":")[1]||"?"}`,computedStyles:Kr(e),viewportBreakpoint:Yr(),outerHtml:e.outerHTML.slice(0,1500),scrollPosition:{x:window.scrollX,y:window.scrollY},isModal:u}}},Et=()=>{const{addToast:e,language:t,t:r,apiKey:n,baseUrl:a,disableViewGate:s,hasActiveToasts:c}=nt(),[i,u]=m.useState(!1),[p,f]=m.useState(null),[h,j]=m.useState(null),[G,D]=m.useState(""),[Y,oe]=m.useState(!1),[je,_e]=m.useState(!1),[L,X]=m.useState(!1),[V,Oe]=m.useState([]),[F,H]=m.useState(null),[Ve,kt]=m.useState(!1),[fe,ie]=m.useState(!1),[Ae,Te]=m.useState({}),[z,q]=m.useState(null),[te,he]=m.useState(!1),[U,ge]=m.useState(null),[d,y]=m.useState([]),b=m.useMemo(()=>{const l=Array.isArray(V)?V:[];if(!z)return l;const g=d.find(x=>x.annotations&&Array.isArray(x.annotations)&&x.annotations.some(E=>E._id===z));return g?g.annotations:l.filter(x=>x._id===z)},[z,V,d]),[S,ce]=m.useState(()=>{if(typeof window>"u")return{top:24,right:24};const l=localStorage.getItem("vg-exit-pos");return l?JSON.parse(l):{top:24,right:24}}),[J,k]=m.useState(!1),A=m.useRef(null),[$,He]=m.useState(()=>{if(typeof window>"u")return{bottom:30,right:30};const l=localStorage.getItem("vg-bar-pos");return l?JSON.parse(l):{bottom:30,right:30}}),[xe,Rt]=m.useState(!1),Z=m.useRef(null),on=l=>{l.preventDefault(),l.stopPropagation();const g=l.currentTarget.parentElement?.getBoundingClientRect();g&&(k(!0),A.current={x:l.clientX,y:l.clientY,top:S.top,right:S.right,width:g.width,height:g.height})},cn=l=>{l.preventDefault(),l.stopPropagation();const g=l.currentTarget.parentElement?.getBoundingClientRect();g&&(Rt(!0),Z.current={x:l.clientX,y:l.clientY,bottom:$.bottom,right:$.right,width:g.width,height:g.height})};m.useEffect(()=>{if(!J&&!xe)return;const l=x=>{if(J&&A.current){const E=x.clientX-A.current.x,R=x.clientY-A.current.y;let _=A.current.top+R,v=A.current.right-E;const w=10;_=Math.max(w,Math.min(window.innerHeight-A.current.height-w,_)),v=Math.max(w,Math.min(window.innerWidth-A.current.width-w,v)),ce({top:_,right:v})}if(xe&&Z.current){const E=x.clientX-Z.current.x,R=x.clientY-Z.current.y;let _=Z.current.bottom-R,v=Z.current.right-E;const w=10;_=Math.max(w,Math.min(window.innerHeight-Z.current.height-w,_)),v=Math.max(w,Math.min(window.innerWidth-Z.current.width-w,v)),He({bottom:_,right:v})}},g=()=>{J&&(k(!1),localStorage.setItem("vg-exit-pos",JSON.stringify(S)),A.current=null),xe&&(Rt(!1),localStorage.setItem("vg-bar-pos",JSON.stringify($)),Z.current=null)};return window.addEventListener("mousemove",l),window.addEventListener("mouseup",g),()=>{window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",g)}},[J,xe,S,$]);const[jt,Ue]=m.useState(null),[_t,Ot]=m.useState(""),[kn,Rn]=m.useState({}),ye=m.useRef(null),we=m.useRef(null),le=m.useCallback(()=>{we.current||(we.current=requestAnimationFrame(()=>{const l=new Map,g=Array.isArray(V)?V:[],x=new Set(g.map(w=>w._id));document.querySelectorAll(`[${W}]`).forEach(w=>{const O=w.getAttribute(W);O&&!x.has(O)&&w.removeAttribute(W)});const R=Array.from(document.querySelectorAll('[role="dialog"], [aria-modal="true"], .modal, .modal-content')).find(w=>qr(w)&&ee(w)),_=!!R;V.forEach(w=>{if(!w.reference)return;const O=tn(w.reference,w._id);if(!O||!ee(O))return;const K=!!w.reference.metadata?.isModal;let B=!1;if(_?B=R.contains(O):B=!K,!B)return;const C=O.getAttribute(W);C!==w._id&&(document.querySelectorAll(`[${W}="${w._id}"]`).forEach(N=>{N.removeAttribute(W)}),C||O.setAttribute(W,w._id)),l.has(O)||l.set(O,[]),l.get(O).push(w)});const v=[];l.forEach((w,O)=>{const K=O.getBoundingClientRect(),B=K.left+K.width/2,C=K.top+K.height/2;if(B>=0&&B<=window.innerWidth&&C>=0&&C<=window.innerHeight){const N=document.elementFromPoint(B,C);if(N&&!O.contains(N)&&!ye.current?.contains(N))return}v.push({id:w[0]._id,element:O,rect:K,annotations:w.sort((N,de)=>new Date(de.timestamp||de.createdAt).getTime()-new Date(N.timestamp||N.createdAt).getTime()),isModal:!!w[0].reference?.metadata?.isModal})}),y(v),we.current=null}))},[V]),re=m.useCallback(async()=>{if(n){ie(!0);try{const l=await fetch(`${a}/api/annotations`,{headers:{"x-api-key":n}});if(l.ok){const g=await l.json(),x=Array.isArray(g)?g:g?.data||[];if(!Array.isArray(x)){console.error("Expected annotations array, got:",typeof x),Oe([]);return}const E=x.reduce((R,_)=>R.find(w=>w._id===_._id)?R:R.concat([_]),[]);Oe(E)}}catch(l){console.error("Failed to fetch annotations",l)}finally{ie(!1)}}},[n,a]);m.useEffect(()=>{L&&V.length===0&&!fe&&X(!1)},[L,V.length,fe]),m.useEffect(()=>{if(V.length===0){le();return}if(!i){le();const l=new MutationObserver(()=>le()),g=new ResizeObserver(()=>le()),x=()=>le();return l.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}),g.observe(document.documentElement),window.addEventListener("scroll",x,!0),()=>{l.disconnect(),g.disconnect(),window.removeEventListener("scroll",x,!0),we.current&&cancelAnimationFrame(we.current)}}},[i,V.length,le]),m.useEffect(()=>{re()},[re]),m.useEffect(()=>{ye.current=document.getElementById("viewgate-shadow-host")},[]);const $e=m.useCallback(l=>{if(!i||h)return;const g=Ct(l.clientX,l.clientY);if(!g||ye.current?.contains(g)||g.closest(".vg-no-capture")){f(null);return}const x=g.getBoundingClientRect();f({tag:g.tagName.toLowerCase(),source:g.getAttribute("data-source-path")||"unknown:0",rect:x,element:g,previewText:(g.innerText||"").slice(0,100)||(g.getAttribute("placeholder")||"").slice(0,100)||g.tagName.toLowerCase(),semanticReference:{...nn(g),normalizedOffset:{x:(l.clientX-x.left)/x.width,y:(l.clientY-x.top)/x.height}}})},[i,h]),Be=m.useCallback(async l=>{if(!i||h)return;const g=Ct(l.clientX,l.clientY);if(!(!g||ye.current?.contains(g)||g.closest(".vg-no-capture"))&&p){l.preventDefault(),l.stopPropagation(),_e(!0);try{const R=await Hr(document.body,{pixelRatio:2,cacheBust:!0,width:window.innerWidth,height:window.innerHeight,backgroundColor:"#ffffff",filter:v=>{const w=v;return!(ye.current?.contains(w)||w.id==="viewgate-ui"||w.classList?.contains("vg-no-capture"))}}),_=await Jr(R,p.rect,32,2);j({...p,visualPreview:_})}catch(x){console.error("Failed to capture high-fidelity preview:",x),j(p)}finally{_e(!1),f(null)}}},[i,p,h]);m.useEffect(()=>{const l=g=>{if(g.key==="Escape"){h?j(null):L?X(!1):i&&u(!1);return}const E=(()=>{let v=document.activeElement;for(;v&&v.shadowRoot&&v.shadowRoot.activeElement;)v=v.shadowRoot.activeElement;return v})();if(["input","textarea"].includes((E?.tagName||"").toLowerCase())||E?.isContentEditable)return;const _=g.key.toLowerCase();_==="c"&&!h&&!L&&u(v=>!v),_==="v"&&!h&&(V.length>0||L)&&(X(v=>!v),L||u(!1))};return i&&!h?document.body.classList.add("vg-cursor-pointer"):document.body.classList.remove("vg-cursor-pointer"),window.addEventListener("keydown",l),window.addEventListener("mousemove",$e,!0),window.addEventListener("click",Be,!0),()=>{document.body.classList.remove("vg-cursor-pointer"),window.removeEventListener("keydown",l),window.removeEventListener("mousemove",$e,!0),window.removeEventListener("click",Be,!0)}},[i,h,L,V,$e,Be]);const ln=async()=>{if(!h||!G.trim())return;oe(!0);const{semanticReference:l}=h,[g,x]=(l.source||"").split(":"),E=x||"0";try{if(!(await fetch(`${a}/api/annotations`,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":n},body:JSON.stringify({filePath:g,line:parseInt(E),url:window.location.href,message:G,componentName:l.componentPath||h.tag,reference:{...l,viewport:{width:window.innerWidth,height:window.innerHeight},userAgent:navigator.userAgent,timestamp:new Date().toISOString()}})})).ok)throw new Error("Backend failed");e(r.success,"success"),j(null),D(""),u(!1),re()}catch(R){console.error(R),e(r.error,"error")}finally{oe(!1)}};return o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1275",className:"vg-container",children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1276",className:"vg-no-capture",children:[!c&&o.jsxs("div",{style:{position:"fixed",top:`${S.top}px`,right:`${S.right}px`,zIndex:ze+10,display:"flex",alignItems:"center",gap:"8px",transition:J?"none":"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},children:[o.jsx("div",{onMouseDown:on,style:{width:"20px",height:"32px",borderRadius:"6px",backgroundColor:"rgba(255, 255, 255, 0.85)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"#1e293b",opacity:i?0:1,visibility:i?"hidden":"visible",transition:"all 0.2s",border:"1px solid rgba(0,0,0,0.1)",boxShadow:"0 2px 8px rgba(0,0,0,0.05)"},onMouseEnter:l=>{l.currentTarget.style.backgroundColor="white",l.currentTarget.style.color="#000000"},onMouseLeave:l=>{l.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.85)",l.currentTarget.style.color="#1e293b"},children:o.jsx(et,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1320",size:14})}),o.jsx("button",{onClick:l=>{l.stopPropagation(),H({title:r.exitConfirmTitle||"Close ViewGate?",message:r.exitConfirmMessage||"Are you sure you want to close ViewGate?",type:"danger",onConfirm:()=>s()})},title:"Cerrar ViewGate",style:{width:"40px",height:"40px",borderRadius:"12px",backgroundColor:"rgba(255, 255, 255, 0.9)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid rgba(0,0,0,0.05)",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",cursor:"pointer",color:"#64748b",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},onMouseEnter:l=>{l.currentTarget.style.transform="scale(1.1) rotate(90deg)",l.currentTarget.style.color="#ef4444",l.currentTarget.style.backgroundColor="white"},onMouseLeave:l=>{l.currentTarget.style.transform="scale(1) rotate(0deg)",l.currentTarget.style.color="#64748b",l.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.9)"},children:o.jsx(Pe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1360",size:20,strokeWidth:2.5})})]}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1366",style:{position:"fixed",bottom:`${$.bottom}px`,right:`${$.right}px`,zIndex:ze,display:"flex",alignItems:"center",gap:"8px",transition:xe?"none":"all 0.4s cubic-bezier(0.4, 0, 0.2, 1)"},id:"viewgate-ui",children:[o.jsx("div",{onMouseDown:cn,style:{width:"24px",height:"40px",borderRadius:"10px",backgroundColor:"rgba(255, 255, 255, 0.85)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"#1e293b",opacity:i?0:1,visibility:i?"hidden":"visible",transition:"all 0.2s",border:"1px solid rgba(0,0,0,0.1)",boxShadow:"0 2px 8px rgba(0,0,0,0.05)"},onMouseEnter:l=>{l.currentTarget.style.backgroundColor="white",l.currentTarget.style.color="#000000"},onMouseLeave:l=>{l.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.85)",l.currentTarget.style.color="#1e293b"},className:"vg-animate-slide-up",children:o.jsx(et,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1409",size:16})}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1412",className:"vg-action-bar vg-animate-slide-up",style:{transition:"all 0.4s cubic-bezier(0.4, 0, 0.2, 1)"},children:[o.jsx("button",{onClick:()=>u(!i),className:"vg-button-primary vg-animate-pop",style:{padding:"12px 24px",background:i?"#ef4444":void 0},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1421",style:{display:"flex",alignItems:"center",gap:"10px"},children:[i?o.jsx(Pe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1422",size:20,className:"vg-animate-pop"}):o.jsx(be,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1422",size:20,className:"vg-animate-pop"}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1423",children:i?r.exitMode:r.enterMode})]})}),V.length>0&&o.jsxs("button",{onClick:()=>{X(!L),u(!1),j(null)},className:"vg-button-ghost vg-animate-pop",style:{animationDelay:"0.1s"},children:[o.jsx(Ft,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1436",size:20}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1437",children:r.viewComments})]})]})]}),je&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1445",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(255,255,255,0.6)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:ze+1,cursor:"wait"},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1451",className:"vg-glassmorphism",style:{padding:"30px 50px",display:"flex",flexDirection:"column",alignItems:"center",gap:"16px"},children:[o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1452",className:"vg-spinner"}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1453",style:{fontWeight:600,fontSize:"14px",color:"#000000"},children:"Capturando..."})]})}),i&&!h&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1460",className:"vg-backdrop-blur",style:{opacity:1,clipPath:p?`polygon(
|
|
9
9
|
0% 0%, 0% 100%, 100% 100%, 100% 0%, 0% 0%,
|
|
10
10
|
${p.rect.left}px ${p.rect.top}px,
|
package/mcp-server/dist/index.js
CHANGED
|
@@ -22,7 +22,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
22
22
|
tools: [
|
|
23
23
|
{
|
|
24
24
|
name: "get_annotations",
|
|
25
|
-
description: "Retrieves all feedback annotations
|
|
25
|
+
description: "Retrieves all feedback annotations. For each annotation, follow the '_ia_fix_instruction' to perform a FAST, SURGICAL fix. Use 'outerHtml' and 'source' (file:line) to locate the exact code block without manual searching.",
|
|
26
26
|
inputSchema: {
|
|
27
27
|
type: "object",
|
|
28
28
|
properties: {},
|
|
@@ -60,7 +60,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
60
60
|
switch (request.params.name) {
|
|
61
61
|
case "get_annotations": {
|
|
62
62
|
try {
|
|
63
|
-
const response = await fetch(`${BACKEND_URL}/api/annotations?full=true`, {
|
|
63
|
+
const response = await fetch(`${BACKEND_URL}/api/annotations?full=true&status=pending`, {
|
|
64
64
|
headers: {
|
|
65
65
|
'x-api-key': process.env.API_KEY || ''
|
|
66
66
|
}
|
|
@@ -82,12 +82,22 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
82
82
|
isError: true,
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
|
-
const annotationsWithTips = rawAnnotations.map((ann) =>
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
const annotationsWithTips = rawAnnotations.map((ann) => {
|
|
86
|
+
const source = ann.reference?.source;
|
|
87
|
+
const hasSource = source && source !== 'unknown:0';
|
|
88
|
+
const [file, line] = hasSource ? source.split(':') : [null, null];
|
|
89
|
+
let hint = "";
|
|
90
|
+
if (hasSource) {
|
|
91
|
+
hint = `SURGICAL FIX: Open \`${file}\` at line ${line}. The element is \`${ann.reference.tag}\`.`;
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
hint = `MANUAL FIND: Search for the element using selector \`${ann.reference?.selector}\`. Reference HTML: \`${ann.reference?.outerHtml?.slice(0, 100)}...\``;
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
...ann,
|
|
98
|
+
_ia_fix_instruction: hint
|
|
99
|
+
};
|
|
100
|
+
});
|
|
91
101
|
return {
|
|
92
102
|
content: [
|
|
93
103
|
{
|