viewgate-wrapper 1.10.16 → 1.10.18
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.
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode('@import"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap";body{margin:0!important;padding:0!important}:root{--vg-primary: #6366f1;--vg-primary-glow: rgba(99, 102, 241, .5);--vg-primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);--vg-bg-glass: rgba(255, 255, 255, .7);--vg-radius: 16px;--vg-font-main: "Inter", system-ui, sans-serif;--vg-font-alt: "Inter", system-ui, sans-serif;--placeholder-color: #94a3b8;--vg-glass-border: rgba(255, 255, 255, .3);--vg-shadow-premium: 0 20px 50px rgba(0, 0, 0, .1)}.vg-container,.vg-container *{box-sizing:border-box}.vg-container{font-family:var(--vg-font-main);-webkit-font-smoothing:antialiased}.vg-glassmorphism{background:var(--vg-bg-glass);backdrop-filter:blur(16px) saturate(180%);-webkit-backdrop-filter:blur(16px) saturate(180%);border:1px solid var(--vg-glass-border);box-shadow:0 8px 32px #0000001a;border-radius:var(--vg-radius);position:relative}.vg-button-primary{background:var(--vg-primary-gradient);color:#fff;border:none;padding:12px 24px;font-family:var(--vg-font-main);font-size:14px;font-weight:700;cursor:pointer;transition:all .2s ease;border-radius:99px;display:flex;align-items:center;justify-content:center;gap:8px;box-shadow:0 4px 12px #6366f14d}.vg-button-primary:hover{transform:translateY(-2px);box-shadow:0 6px 20px #6366f166}.vg-button-primary:disabled,.vg-button-ghost:disabled{opacity:.5;cursor:not-allowed;filter:grayscale(.4);transform:none!important;box-shadow:none!important;pointer-events:none}.vg-button-ghost{background:#fffc;color:#1e293b;border:1px solid #e2e8f0;padding:10px 24px;font-family:var(--vg-font-main);font-size:14px;font-weight:600;cursor:pointer;transition:all .2s ease;border-radius:99px;display:flex;align-items:center;justify-content:center;gap:8px}.vg-button-ghost:hover{background:#fff;border-color:#cbd5e1;box-shadow:0 4px 12px #0000000d}.vg-badge{background:#f1f5f9;color:#64748b;padding:4px 12px;font-size:11px;border-radius:99px;font-weight:600;display:inline-flex;align-items:center;gap:6px}.vg-textarea{width:100%;box-sizing:border-box;border:1px solid #e2e8f0;border-radius:12px;padding:12px;font-family:var(--vg-font-main);font-size:15px;color:#0f172a;resize:none;outline:none;background:#f8fafc;transition:all .2s ease}.vg-textarea:focus{background:#fff;border-color:var(--vg-primary);box-shadow:0 0 0 4px #6366f11a}@keyframes vg-pop-in{0%{transform:scale(.6);opacity:0}70%{transform:scale(1.08);opacity:1}to{transform:scale(1);opacity:1}}@keyframes vg-slide-up-fade{0%{transform:translateY(12px) scale(.95);opacity:0}to{transform:translateY(0) scale(1);opacity:1}}.vg-animate-pop{animation:vg-pop-in .5s cubic-bezier(.34,1.56,.64,1) forwards}.vg-animate-slide-up{animation:vg-slide-up-fade .4s cubic-bezier(.22,1,.36,1) forwards}.vg-button-primary,.vg-button-ghost,.vg-pin-container,.vg-action-bar,.vg-glassmorphism{transition:all .3s cubic-bezier(.4,0,.2,1)}.vg-animate-slide{animation:vg-slide-in .4s cubic-bezier(.22,1,.36,1) forwards}.vg-animate-fade{animation:vg-fade-in .3s ease-out forwards}.vg-toasts{position:fixed;top:24px;right:24px;display:flex;flex-direction:column;gap:12px}.vg-toast{padding:12px 20px;display:flex;align-items:center;gap:12px;min-width:300px;border-radius:12px;box-shadow:0 10px 30px #0000001a;background:#fff}.vg-toast.success{border-left:6px solid #22c55e}.vg-toast.error{border-left:6px solid #ef4444}.vg-backdrop-blur{position:fixed;top:0;left:0;width:100%;height:100%;-webkit-backdrop-filter:blur(8px) grayscale(.2);backdrop-filter:blur(8px) grayscale(.2);background:#0000001a;pointer-events:none;transition:opacity .3s ease,clip-path .2s cubic-bezier(.19,1,.22,1)}.vg-selection-pulse{position:fixed;pointer-events:none;border:2px solid var(--vg-primary);border-radius:8px;box-shadow:0 0 0 0 var(--vg-primary-glow);animation:vg-pulse 2s infinite;transition:all .2s cubic-bezier(.19,1,.22,1)}@keyframes vg-pulse{0%{box-shadow:0 0 0 0 var(--vg-primary-glow)}70%{box-shadow:0 0 0 15px #6366f100}to{box-shadow:0 0 #6366f100}}.vg-selection-label{position:absolute;top:-40px;left:0;background:var(--vg-primary-gradient);color:#fff;padding:8px 16px;border-radius:20px;font-size:13px;font-weight:700;white-space:nowrap;box-shadow:0 4px 12px #6366f14d;display:flex;align-items:center;gap:8px}.vg-pin-container{transition:transform .2s ease}.vg-pin-container:hover{transform:scale(1.1)}.vg-formal-pin{width:32px;height:32px;border-radius:50%;background:
|
|
2
|
-
(function(N,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],m):(N=typeof globalThis<"u"?globalThis:N||self,m(N.ViewGateWrapper={},N.React,N.ReactDOM))})(this,(function(N,m,
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode('@import"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap";body{margin:0!important;padding:0!important}:root{--vg-primary: #6366f1;--vg-primary-glow: rgba(99, 102, 241, .5);--vg-primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);--vg-bg-glass: rgba(255, 255, 255, .7);--vg-radius: 16px;--vg-font-main: "Inter", system-ui, sans-serif;--vg-font-alt: "Inter", system-ui, sans-serif;--placeholder-color: #94a3b8;--vg-glass-border: rgba(255, 255, 255, .3);--vg-shadow-premium: 0 20px 50px rgba(0, 0, 0, .1)}.vg-container,.vg-container *{box-sizing:border-box}.vg-container{font-family:var(--vg-font-main);-webkit-font-smoothing:antialiased}.vg-glassmorphism{background:var(--vg-bg-glass);backdrop-filter:blur(16px) saturate(180%);-webkit-backdrop-filter:blur(16px) saturate(180%);border:1px solid var(--vg-glass-border);box-shadow:0 8px 32px #0000001a;border-radius:var(--vg-radius);position:relative}.vg-button-primary{background:var(--vg-primary-gradient);color:#fff;border:none;padding:12px 24px;font-family:var(--vg-font-main);font-size:14px;font-weight:700;cursor:pointer;transition:all .2s ease;border-radius:99px;display:flex;align-items:center;justify-content:center;gap:8px;box-shadow:0 4px 12px #6366f14d}.vg-button-primary:hover{transform:translateY(-2px);box-shadow:0 6px 20px #6366f166}.vg-button-primary:disabled,.vg-button-ghost:disabled{opacity:.5;cursor:not-allowed;filter:grayscale(.4);transform:none!important;box-shadow:none!important;pointer-events:none}.vg-button-ghost{background:#fffc;color:#1e293b;border:1px solid #e2e8f0;padding:10px 24px;font-family:var(--vg-font-main);font-size:14px;font-weight:600;cursor:pointer;transition:all .2s ease;border-radius:99px;display:flex;align-items:center;justify-content:center;gap:8px}.vg-button-ghost:hover{background:#fff;border-color:#cbd5e1;box-shadow:0 4px 12px #0000000d}.vg-badge{background:#f1f5f9;color:#64748b;padding:4px 12px;font-size:11px;border-radius:99px;font-weight:600;display:inline-flex;align-items:center;gap:6px}.vg-textarea{width:100%;box-sizing:border-box;border:1px solid #e2e8f0;border-radius:12px;padding:12px;font-family:var(--vg-font-main);font-size:15px;color:#0f172a;resize:none;outline:none;background:#f8fafc;transition:all .2s ease}.vg-textarea:focus{background:#fff;border-color:var(--vg-primary);box-shadow:0 0 0 4px #6366f11a}@keyframes vg-pop-in{0%{transform:scale(.6);opacity:0}70%{transform:scale(1.08);opacity:1}to{transform:scale(1);opacity:1}}@keyframes vg-slide-up-fade{0%{transform:translateY(12px) scale(.95);opacity:0}to{transform:translateY(0) scale(1);opacity:1}}.vg-animate-pop{animation:vg-pop-in .5s cubic-bezier(.34,1.56,.64,1) forwards}.vg-animate-slide-up{animation:vg-slide-up-fade .4s cubic-bezier(.22,1,.36,1) forwards}.vg-button-primary,.vg-button-ghost,.vg-pin-container,.vg-action-bar,.vg-glassmorphism{transition:all .3s cubic-bezier(.4,0,.2,1)}.vg-animate-slide{animation:vg-slide-in .4s cubic-bezier(.22,1,.36,1) forwards}.vg-animate-fade{animation:vg-fade-in .3s ease-out forwards}.vg-toasts{position:fixed;top:24px;right:24px;display:flex;flex-direction:column;gap:12px}.vg-toast{padding:12px 20px;display:flex;align-items:center;gap:12px;min-width:300px;border-radius:12px;box-shadow:0 10px 30px #0000001a;background:#fff}.vg-toast.success{border-left:6px solid #22c55e}.vg-toast.error{border-left:6px solid #ef4444}.vg-backdrop-blur{position:fixed;top:0;left:0;width:100%;height:100%;-webkit-backdrop-filter:blur(8px) grayscale(.2);backdrop-filter:blur(8px) grayscale(.2);background:#0000001a;pointer-events:none;transition:opacity .3s ease,clip-path .2s cubic-bezier(.19,1,.22,1)}.vg-selection-pulse{position:fixed;pointer-events:none;border:2px solid var(--vg-primary);border-radius:8px;box-shadow:0 0 0 0 var(--vg-primary-glow);animation:vg-pulse 2s infinite;transition:all .2s cubic-bezier(.19,1,.22,1)}@keyframes vg-pulse{0%{box-shadow:0 0 0 0 var(--vg-primary-glow)}70%{box-shadow:0 0 0 15px #6366f100}to{box-shadow:0 0 #6366f100}}.vg-selection-label{position:absolute;top:-40px;left:0;background:var(--vg-primary-gradient);color:#fff;padding:8px 16px;border-radius:20px;font-size:13px;font-weight:700;white-space:nowrap;box-shadow:0 4px 12px #6366f14d;display:flex;align-items:center;gap:8px}.vg-pin-container{transition:transform .2s ease}.vg-pin-container:hover{transform:scale(1.1)}.vg-formal-pin{width:32px;height:32px;border-radius:50%;background:linear-gradient(135deg,#f97316,#ea580c);border:3px solid white;box-shadow:0 4px 12px #ea580c66;display:flex;align-items:center;justify-content:center;color:#fff;transition:all .2s ease}.vg-formal-pin.ready{background:linear-gradient(135deg,#10b981,#059669);box-shadow:0 4px 12px #10b98166}.vg-formal-pin.mixed{background:linear-gradient(135deg,#10b981,#059669);border:3px solid #f97316;box-shadow:0 4px 15px #f9731666}.vg-formal-pin.modal-variant{background:linear-gradient(135deg,#f59e0b,#d97706);box-shadow:0 4px 12px #f59e0b66;border-style:dashed}.vg-pin-tooltip{position:absolute;top:calc(100% + 12px);left:50%;transform:translate(-50%);padding:16px;border-radius:16px;background:#ffffffe6;backdrop-filter:blur(12px) saturate(160%);-webkit-backdrop-filter:blur(12px) saturate(160%);color:#1e293b;width:240px;font-size:13px;box-shadow:0 10px 40px #00000026;opacity:0;pointer-events:none;transition:all .3s cubic-bezier(.19,1,.22,1);border:1px solid rgba(255,255,255,.5);z-index:1000}.vg-tooltip-scroll{scrollbar-width:thin;scrollbar-color:rgba(99,102,241,.2) transparent}.vg-tooltip-scroll::-webkit-scrollbar{width:4px}.vg-tooltip-scroll::-webkit-scrollbar-track{background:transparent}.vg-tooltip-scroll::-webkit-scrollbar-thumb{background:#6366f14d;border-radius:10px}.vg-pin-badge{position:absolute;top:-8px;right:-8px;background:#f43f5e;color:#fff;font-size:10px;font-weight:800;width:20px;height:20px;border-radius:50%;display:flex;align-items:center;justify-content:center;border:2px solid white;box-shadow:0 4px 12px #f43f5e66;z-index:2}.vg-pin-tooltip.vg-top{top:auto;bottom:calc(100% + 12px)}.vg-pin-container:hover .vg-pin-tooltip{opacity:1;transform:translate(-50%) translateY(-5px)}.vg-action-bar{display:flex;gap:12px;padding:0;background:transparent;border:none;box-shadow:none;-webkit-backdrop-filter:none;backdrop-filter:none}.vg-custom-scrollbar::-webkit-scrollbar{width:6px}.vg-custom-scrollbar::-webkit-scrollbar-track{background:transparent}.vg-custom-scrollbar::-webkit-scrollbar-thumb{background:#6366f166;border-radius:10px;transition:all .2s ease}.vg-custom-scrollbar::-webkit-scrollbar-thumb:hover{background:#6366f1b3}.vg-spinner{border:3px solid rgba(99,102,241,.1);border-top:3px solid var(--vg-primary);border-radius:50%;width:32px;height:32px;animation:vg-spin .8s linear infinite}@keyframes vg-spin{to{transform:rotate(360deg)}}.vg-animate-spin{animation:vg-spin .8s linear infinite}.vg-cursor-pointer,.vg-cursor-pointer *{cursor:pointer!important}.vg-url-tag{position:relative;cursor:help;transition:all .2s ease}.vg-url-tag:hover{background:#f1f5f9!important;border-color:var(--vg-primary)!important}.vg-url-tooltip{position:fixed;left:0;top:0;background:#0f172a;color:#fff;padding:8px 14px;border-radius:10px;font-size:11px;font-weight:500;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .2s ease,transform .2s ease;box-shadow:0 10px 25px -5px #0006;z-index:2147483647;border:1px solid rgba(255,255,255,.1)}.vg-url-tooltip.visible{opacity:1}.vg-url-tooltip:after{content:"";position:absolute;left:50%;transform:translate(-50%);border-width:6px;border-style:solid}.vg-url-tooltip.vg-top:after{top:100%;border-color:#0f172a transparent transparent transparent}.vg-url-tooltip.vg-bottom:after{bottom:100%;border-color:transparent transparent #0f172a transparent}')),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
+
(function(N,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],m):(N=typeof globalThis<"u"?globalThis:N||self,m(N.ViewGateWrapper={},N.React,N.ReactDOM))})(this,(function(N,m,Tt){"use strict";var be={exports:{}},pe={};var Be;function Pt(){if(Be)return pe;Be=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,a,s){var c=null;if(s!==void 0&&(c=""+s),a.key!==void 0&&(c=""+a.key),"key"in a){s={};for(var i in a)i!=="key"&&(s[i]=a[i])}else s=a;return a=s.ref,{$$typeof:e,type:n,key:c,ref:a!==void 0?a:null,props:s}}return pe.Fragment=t,pe.jsx=r,pe.jsxs=r,pe}var me={};var Ye;function At(){return Ye||(Ye=1,process.env.NODE_ENV!=="production"&&(function(){function e(d){if(d==null)return null;if(typeof d=="function")return d.$$typeof===he?null:d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case W:return"Fragment";case K:return"Profiler";case Z:return"StrictMode";case Fe:return"Suspense";case H:return"SuspenseList";case Rt:return"Activity"}if(typeof d=="object")switch(typeof d.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),d.$$typeof){case I:return"Portal";case Q:return d.displayName||"Context";case D:return(d._context.displayName||"Context")+".Consumer";case A:var y=d.render;return d=d.displayName,d||(d=y.displayName||y.name||"",d=d!==""?"ForwardRef("+d+")":"ForwardRef"),d;case $:return y=d.displayName||null,y!==null?y:e(d.type)||"Memo";case Oe:y=d._payload,d=d._init;try{return e(d(y))}catch{}}return null}function t(d){return""+d}function r(d){try{t(d);var y=!1}catch{y=!0}if(y){y=console;var S=y.error,R=typeof Symbol=="function"&&Symbol.toStringTag&&d[Symbol.toStringTag]||d.constructor.name||"Object";return S.call(y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",R),t(d)}}function n(d){if(d===W)return"<>";if(typeof d=="object"&&d!==null&&d.$$typeof===Oe)return"<...>";try{var y=e(d);return y?"<"+y+">":"<...>"}catch{return"<...>"}}function a(){var d=ce.A;return d===null?null:d.getOwner()}function s(){return Error("react-stack-top-frame")}function c(d){if(_e.call(d,"key")){var y=Object.getOwnPropertyDescriptor(d,"key").get;if(y&&y.isReactWarning)return!1}return d.key!==void 0}function i(d,y){function S(){le||(le=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",y))}S.isReactWarning=!0,Object.defineProperty(d,"key",{get:S,configurable:!0})}function u(){var d=e(this.type);return te[d]||(te[d]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),d=this.props.ref,d!==void 0?d:null}function p(d,y,S,R,Y,de){var C=S.ref;return d={$$typeof:V,type:d,key:y,props:S,_owner:R},(C!==void 0?C:null)!==null?Object.defineProperty(d,"ref",{enumerable:!1,get:u}):Object.defineProperty(d,"ref",{enumerable:!1,value:null}),d._store={},Object.defineProperty(d._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(d,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(d,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Y}),Object.defineProperty(d,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:de}),Object.freeze&&(Object.freeze(d.props),Object.freeze(d)),d}function f(d,y,S,R,Y,de){var C=y.children;if(C!==void 0)if(R)if(Ve(C)){for(R=0;R<C.length;R++)h(C[R]);Object.freeze&&Object.freeze(C)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(C);if(_e.call(y,"key")){C=e(d);var L=Object.keys(y).filter(function(re){return re!=="key"});R=0<L.length?"{key: someKey, "+L.join(": ..., ")+": ...}":"{key: someKey}",xe[C+R]||(L=0<L.length?"{"+L.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
3
3
|
let props = %s;
|
|
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} />`,E,k,z,k),_e[k+E]=!0)}if(k=null,S!==void 0&&(n(S),k=""+S),c(x)&&(n(x.key),k=""+x.key),"key"in x){S={};for(var ce in x)ce!=="key"&&(S[ce]=x[ce])}else S=x;return k&&i(S,typeof l=="function"?l.displayName||l.name||"Unknown":l),p(l,k,S,a(),G,B)}function h(l){C(l)?l._store&&(l._store.validated=1):typeof l=="object"&&l!==null&&l.$$typeof===ke&&(l._payload.status==="fulfilled"?C(l._payload.value)&&l._payload.value._store&&(l._payload.value._store.validated=1):l._store&&(l._store.validated=1))}function C(l){return typeof l=="object"&&l!==null&&l.$$typeof===O}var j=m,O=Symbol.for("react.transitional.element"),I=Symbol.for("react.portal"),W=Symbol.for("react.fragment"),J=Symbol.for("react.strict_mode"),Z=Symbol.for("react.profiler"),L=Symbol.for("react.consumer"),K=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),De=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),ke=Symbol.for("react.lazy"),St=Symbol.for("react.activity"),me=Symbol.for("react.client.reference"),oe=j.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Re=Object.prototype.hasOwnProperty,je=Array.isArray,U=console.createTask?console.createTask:function(){return null};j={react_stack_bottom_frame:function(l){return l()}};var ie,ee={},fe=j.react_stack_bottom_frame.bind(j,s)(),he=U(r(s)),_e={};ue.Fragment=W,ue.jsx=function(l,x,S){var E=1e4>oe.recentlyCreatedOwnerStacks++;return f(l,x,S,!1,E?Error("react-stack-top-frame"):fe,E?U(r(l)):he)},ue.jsxs=function(l,x,S){var E=1e4>oe.recentlyCreatedOwnerStacks++;return f(l,x,S,!0,E?Error("react-stack-top-frame"):fe,E?U(r(l)):he)}})()),ue}var Be;function Ot(){return Be||(Be=1,process.env.NODE_ENV==="production"?xe.exports=jt():xe.exports=_t()),xe.exports}var o=Ot();const Tt=({children:e})=>{const t=m.useRef(null),[n,r]=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),r(a)}},[]),o.jsx("div",{"data-source-path":"/src/components/ShadowRootWrapper.tsx:38",ref:t,id:"viewgate-shadow-host",children:n&&Rt.createPortal(e,n)})};const Ye=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const Pt=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Vt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const Xe=e=>{const t=Vt(e);return t.charAt(0).toUpperCase()+t.slice(1)};var At={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 Gt=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const Nt=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:s,iconNode:c,...i},u)=>m.createElement("svg",{ref:u,...At,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Ye("lucide",a),...!s&&!Gt(i)&&{"aria-hidden":"true"},...i},[...c.map(([p,f])=>m.createElement(p,f)),...Array.isArray(s)?s:[s]]));const P=(e,t)=>{const n=m.forwardRef(({className:r,...a},s)=>m.createElement(Nt,{ref:s,iconNode:t,className:Ye(`lucide-${Pt(Xe(e))}`,`lucide-${e}`,r),...a}));return n.displayName=Xe(e),n};const Mt=P("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 re=P("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const It=P("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);const Je=P("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 Lt=P("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 Ze=P("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 zt=P("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const we=P("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 Dt=P("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 Ft=P("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 Ht=P("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 Wt=P("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 Ke=P("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 Te=P("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),$t={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."}},Qe=m.createContext(void 0),qe=()=>{const e=m.useContext(Qe);if(!e)throw new Error("useViewGate must be used within a ViewGateProvider");return e},Pe="viewgate_enabled",Ut=()=>typeof window>"u"?!1:new URLSearchParams(window.location.search).has("viewgate")?(sessionStorage.setItem(Pe,"true"),!0):sessionStorage.getItem(Pe)==="true",Bt=({children:e,language:t="es",apiKey:n,baseUrl:r="https://view-gate.vercel.app"})=>{const[a,s]=m.useState(!1),[c,i]=m.useState([]);m.useEffect(()=>{s(Ut())},[]);const u=()=>{if(sessionStorage.removeItem(Pe),s(!1),typeof window<"u"){const h=new URL(window.location.href);h.searchParams.delete("viewgate"),window.history.replaceState({},"",h.toString())}},p=(h,C)=>{const j=Date.now();i(O=>[...O,{id:j,message:h,type:C}]),setTimeout(()=>{i(O=>O.filter(I=>I.id!==j))},4e3)},f=$t[t];return o.jsxs(Qe.Provider,{"data-source-path":"/src/components/ViewGateProvider.tsx:252",value:{addToast:p,language:t,t:f,apiKey:n,baseUrl:r,disableViewGate:u,hasActiveToasts:c.length>0},children:[e,a&&o.jsx(Tt,{"data-source-path":"/src/components/ViewGateProvider.tsx:263",children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:264",className:"vg-container",children:[o.jsx(bt,{"data-source-path":"/src/components/ViewGateProvider.tsx:265"}),o.jsx("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:266",className:"vg-toasts",style:{zIndex:2147483646},children:c.map(h=>o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:268",className:`vg-toast vg-animate-slide ${h.type}`,children:[h.type==="success"?o.jsx(re,{"data-source-path":"/src/components/ViewGateProvider.tsx:270",size:24,color:"#22c55e"}):o.jsx(Mt,{"data-source-path":"/src/components/ViewGateProvider.tsx:272",size:24,color:"#ef4444"}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:274",children:[o.jsx("strong",{"data-source-path":"/src/components/ViewGateProvider.tsx:275",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:278",style:{fontSize:"14px",color:"#000000"},children:h.message})]})]},h.id))})]})})]})};function Yt(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 n=document.implementation.createHTMLDocument(),r=n.createElement("base"),a=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(a),t&&(r.href=t),a.href=e,a.href}const Xt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function X(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}let ae=null;function et(e={}){return ae||(e.includeStyleProperties?(ae=e.includeStyleProperties,ae):(ae=X(window.getComputedStyle(document.documentElement)),ae))}function ve(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function Jt(e){const t=ve(e,"border-left-width"),n=ve(e,"border-right-width");return e.clientWidth+t+n}function Zt(e){const t=ve(e,"border-top-width"),n=ve(e,"border-bottom-width");return e.clientHeight+t+n}function tt(e,t={}){const n=t.width||Jt(e),r=t.height||Zt(e);return{width:n,height:r}}function Kt(){let e,t;try{t=process}catch{}const n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const M=16384;function Qt(e){(e.width>M||e.height>M)&&(e.width>M&&e.height>M?e.width>e.height?(e.height*=M/e.width,e.width=M):(e.width*=M/e.height,e.height=M):e.width>M?(e.height*=M/e.width,e.width=M):(e.width*=M/e.height,e.height=M))}function be(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>t(r))})},r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function qt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function en(e,t,n){const r="http://www.w3.org/2000/svg",a=document.createElementNS(r,"svg"),s=document.createElementNS(r,"foreignObject");return a.setAttribute("width",`${t}`),a.setAttribute("height",`${n}`),a.setAttribute("viewBox",`0 0 ${t} ${n}`),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),qt(a)}const V=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||V(n,t)};function tn(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function nn(e,t){return et(t).map(n=>{const r=e.getPropertyValue(n),a=e.getPropertyPriority(n);return`${n}: ${r}${a?" !important":""};`}).join(" ")}function rn(e,t,n,r){const a=`.${e}:${t}`,s=n.cssText?tn(n):nn(n,r);return document.createTextNode(`${a}{${s}}`)}function nt(e,t,n,r){const a=window.getComputedStyle(e,n),s=a.getPropertyValue("content");if(s===""||s==="none")return;const c=Xt();try{t.className=`${t.className} ${c}`}catch{return}const i=document.createElement("style");i.appendChild(rn(c,n,a,r)),t.appendChild(i)}function an(e,t,n){nt(e,t,":before",n),nt(e,t,":after",n)}const rt="application/font-woff",at="image/jpeg",sn={woff:rt,woff2:rt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:at,jpeg:at,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function on(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Ve(e){const t=on(e).toLowerCase();return sn[t]||""}function cn(e){return e.split(/,/)[1]}function Ae(e){return e.search(/^(data:)/)!==-1}function ln(e,t){return`data:${t};base64,${e}`}async function st(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const a=await r.blob();return new Promise((s,c)=>{const i=new FileReader;i.onerror=c,i.onloadend=()=>{try{s(n({res:r,result:i.result}))}catch(u){c(u)}},i.readAsDataURL(a)})}const Ge={};function dn(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}async function Ne(e,t,n){const r=dn(e,t,n.includeQueryParams);if(Ge[r]!=null)return Ge[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const s=await st(e,n.fetchRequestInit,({res:c,result:i})=>(t||(t=c.headers.get("Content-Type")||""),cn(i)));a=ln(s,t)}catch(s){a=n.imagePlaceholder||"";let c=`Failed to fetch resource: ${e}`;s&&(c=typeof s=="string"?s:s.message),c&&console.warn(c)}return Ge[r]=a,a}async function un(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):be(t)}async function pn(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 be(i)}const n=e.poster,r=Ve(n),a=await Ne(n,r,t);return be(a)}async function mn(e,t){var n;try{if(!((n=e?.contentDocument)===null||n===void 0)&&n.body)return await Se(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function fn(e,t){return V(e,HTMLCanvasElement)?un(e):V(e,HTMLVideoElement)?pn(e,t):V(e,HTMLIFrameElement)?mn(e,t):e.cloneNode(ot(e))}const hn=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ot=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function gn(e,t,n){var r,a;if(ot(t))return t;let s=[];return hn(e)&&e.assignedNodes?s=X(e.assignedNodes()):V(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?s=X(e.contentDocument.body.childNodes):s=X(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),s.length===0||V(e,HTMLVideoElement)||await s.reduce((c,i)=>c.then(()=>Se(i,n)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function yn(e,t,n){const r=t.style;if(!r)return;const a=window.getComputedStyle(e);a.cssText?(r.cssText=a.cssText,r.transformOrigin=a.transformOrigin):et(n).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`),V(e,HTMLIFrameElement)&&s==="display"&&c==="inline"&&(c="block"),s==="d"&&t.getAttribute("d")&&(c=`path(${t.getAttribute("d")})`),r.setProperty(s,c,a.getPropertyPriority(s))})}function xn(e,t){V(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),V(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function wn(e,t){if(V(e,HTMLSelectElement)){const r=Array.from(t.children).find(a=>e.value===a.getAttribute("value"));r&&r.setAttribute("selected","")}}function vn(e,t,n){return V(t,Element)&&(yn(e,t,n),an(e,t,n),xn(e,t),wn(e,t)),t}async function bn(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let s=0;s<n.length;s++){const i=n[s].getAttribute("xlink:href");if(i){const u=e.querySelector(i),p=document.querySelector(i);!u&&p&&!r[i]&&(r[i]=await Se(p,t,!0))}}const a=Object.values(r);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 Se(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>fn(r,t)).then(r=>gn(e,r,t)).then(r=>vn(e,r,t)).then(r=>bn(r,t))}const it=/url\((['"]?)([^'"]+?)\1\)/g,Sn=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Cn=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function En(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function kn(e){const t=[];return e.replace(it,(n,r,a)=>(t.push(a),n)),t.filter(n=>!Ae(n))}async function Rn(e,t,n,r,a){try{const s=n?Yt(t,n):t,c=Ve(t);let i;return a||(i=await Ne(s,c,r)),e.replace(En(t),`$1${i}$3`)}catch{}return e}function jn(e,{preferredFontFormat:t}){return t?e.replace(Cn,n=>{for(;;){const[r,,a]=Sn.exec(n)||[];if(!a)return"";if(a===t)return`src: ${r};`}}):e}function ct(e){return e.search(it)!==-1}async function lt(e,t,n){if(!ct(e))return e;const r=jn(e,n);return kn(r).reduce((s,c)=>s.then(i=>Rn(i,c,t,n)),Promise.resolve(r))}async function se(e,t,n){var r;const a=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(a){const s=await lt(a,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function _n(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 On(e,t){const n=V(e,HTMLImageElement);if(!(n&&!Ae(e.src))&&!(V(e,SVGImageElement)&&!Ae(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,a=await Ne(r,Ve(r),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"),n?(e.srcset="",e.src=a):e.href.baseVal=a})}async function Tn(e,t){const r=X(e.childNodes).map(a=>dt(a,t));await Promise.all(r).then(()=>e)}async function dt(e,t){V(e,Element)&&(await _n(e,t),await On(e,t),await Tn(e,t))}function Pn(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(a=>{n[a]=r[a]}),e}const ut={};async function pt(e){let t=ut[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},ut[e]=t,t}async function mt(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,s=(n.match(/url\([^)]+\)/g)||[]).map(async c=>{let i=c.replace(r,"$1");return i.startsWith("https://")||(i=new URL(i,e.url).href),st(i,t.fetchRequestInit,({result:u})=>(n=n.replace(c,`url(${u})`),[c,u]))});return Promise.all(s).then(()=>n)}function ft(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const u=a.exec(r);if(u===null)break;t.push(u[0])}r=r.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(r);if(u===null){if(u=i.exec(r),u===null)break;s.lastIndex=i.lastIndex}else i.lastIndex=s.lastIndex;t.push(u[0])}return t}async function Vn(e,t){const n=[],r=[];return e.forEach(a=>{if("cssRules"in a)try{X(a.cssRules||[]).forEach((s,c)=>{if(s.type===CSSRule.IMPORT_RULE){let i=c+1;const u=s.href,p=pt(u).then(f=>mt(f,t)).then(f=>ft(f).forEach(h=>{try{a.insertRule(h,h.startsWith("@import")?i+=1:a.cssRules.length)}catch(C){console.error("Error inserting rule from remote css",{rule:h,error:C})}})).catch(f=>{console.error("Error loading remote css",f.toString())});r.push(p)}})}catch(s){const c=e.find(i=>i.href==null)||document.styleSheets[0];a.href!=null&&r.push(pt(a.href).then(i=>mt(i,t)).then(i=>ft(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(r).then(()=>(e.forEach(a=>{if("cssRules"in a)try{X(a.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${a.href}`,s)}}),n))}function An(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>ct(t.style.getPropertyValue("src")))}async function Gn(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=X(e.ownerDocument.styleSheets),r=await Vn(n,t);return An(r)}function ht(e){return e.trim().replace(/["']/g,"")}function Nn(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(s=>{t.add(ht(s))}),Array.from(r.children).forEach(s=>{s instanceof HTMLElement&&n(s)})}return n(e),t}async function Mn(e,t){const n=await Gn(e,t),r=Nn(e);return(await Promise.all(n.filter(s=>r.has(ht(s.style.fontFamily))).map(s=>{const c=s.parentStyleSheet?s.parentStyleSheet.href:null;return lt(s.cssText,c,t)}))).join(`
|
|
8
|
-
`)}async function In(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Mn(e,t);if(n){const r=document.createElement("style"),a=document.createTextNode(n);r.appendChild(a),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function Ln(e,t={}){const{width:n,height:r}=tt(e,t),a=await Se(e,t,!0);return await In(a,t),await dt(a,t),Pn(a,t),await en(a,n,r)}async function zn(e,t={}){const{width:n,height:r}=tt(e,t),a=await Ln(e,t),s=await be(a),c=document.createElement("canvas"),i=c.getContext("2d"),u=t.pixelRatio||Kt(),p=t.canvasWidth||n,f=t.canvasHeight||r;return c.width=p*u,c.height=f*u,t.skipAutoScale||Qt(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 gt(e,t={}){return(await zn(e,t)).toDataURL()}const Ce=2147483647,Me=Ce,Ie=2e6,Dn=Ce-10,Fn=Ce-5,Hn=Ce-15,Q="data-vg-pin-id",Wn=()=>{const e=window.innerWidth;return e<768?"mobile":e<1024?"tablet":"desktop"},yt=(e,t)=>{if(!e)return"";try{const n=new Date(e);return isNaN(n.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(n)}catch{return""}},pe=e=>{const t=[],n=[],r=[];let a=e;for(;a&&a.nodeType===Node.ELEMENT_NODE;){if(a.id&&!a.id.startsWith("vg-")&&!a.id.includes(":")){t.unshift(`#${a.id}`),r.unshift(`${a.localName}#${a.id}`);break}let s=a.localName;const c=Array.from(a.parentNode?.children||[]).indexOf(a),i=`${a.localName}[${c}]`;r.unshift(i);const u=a.getAttribute("data-testid")||a.getAttribute("data-qa");if(u&&n.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:n,vgPath:r.join(" > ")}},$n=e=>{const{vgPath:t}=pe(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()}},Un=(()=>{let e=null,t=null;return n=>{if(!n||typeof window>"u"||typeof document>"u")return n;if(n.includes("oklch")||n.includes("oklab")||n.includes("lab(")||n.includes("lch(")||n.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=n;const s=t.fillStyle;if(s&&!s.includes("oklch")&&!s.includes("oklab"))return s}const r=document.createElement("div");r.style.color=n,document.body.appendChild(r);const a=getComputedStyle(r).color;return document.body.removeChild(r),a&&!a.includes("oklch")?a:"rgb(0,0,0)"}catch{return"rgb(0,0,0)"}return n}})(),xt=(e,t,n,r)=>new Promise(a=>{const s=new Image;s.onload=()=>{const c=document.createElement("canvas"),i=window.devicePixelRatio||1,u=t.width+n*2,p=t.height+n*2;c.width=u*i,c.height=p*i;const f=c.getContext("2d");if(f){f.scale(i,i);let h=(t.left-n)*r,C=(t.top-n)*r,j=u*r,O=p*r,I=0,W=0,J=u,Z=p;h<0&&(I=Math.abs(h)/r,j+=h,J-=I,h=0),h+j>s.width&&(j=s.width-h,J=j/r),C<0&&(W=Math.abs(C)/r,O+=C,Z-=W,C=0),C+O>s.height&&(O=s.height-C,Z=O/r),f.fillStyle="#ffffff",f.fillRect(0,0,u,p),j>0&&O>0&&f.drawImage(s,h,C,j,O,I,W,J,Z)}a(c.toDataURL("image/png"))},s.onerror=()=>a(""),s.src=e}),Bn=e=>{const t=window.getComputedStyle(e),n={};return["display","position","margin","padding","font-size","color","background-color","width","height","z-index"].forEach(a=>{const s=t.getPropertyValue(a);n[a]=Un(s)}),n},Yn=e=>{const n=Object.keys(e).find(s=>s.startsWith("__reactFiber$")||s.startsWith("__reactInternalInstance$"));if(!n)return"";const r=[];let a=e[n];for(;a;){const s=a.type;if(typeof s=="function"){const c=s.displayName||s.name;c&&!c.includes("ViewGate")&&!r.includes(c)&&r.unshift(c)}a=a.return}return r.join(" > ")||"Generic Component"},Xn=e=>{if(!e)return!1;const t=window.getComputedStyle(e),n=e.getBoundingClientRect(),r=e.getAttribute("role");if(r&&["listbox","menu","combobox","tooltip","option"].includes(r))return!1;const s=120;return n.width<s&&n.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"))},q=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 n=e.parentElement;for(;n;){const a=window.getComputedStyle(n);if(a.display==="none"||a.visibility==="hidden"||a.opacity==="0")return!1;n=n.parentElement}const r=e.getBoundingClientRect();return!(r.width===0||r.height===0||r.top===0&&r.left===0&&r.width>window.innerWidth*.9)},wt=(e,t=document)=>{const n=t.querySelector(e);if(n)return n;const r=t.querySelectorAll("*");for(const a of Array.from(r)){const s=a.shadowRoot;if(s){const c=wt(e,s);if(c)return c}}return null},vt=(e,t)=>{let n=document.elementFromPoint(e,t);for(;n&&n.shadowRoot;){const r=n.shadowRoot.elementFromPoint(e,t);if(!r||r===n)break;n=r}return n},Jn=e=>{if(!e.tag)return null;const t=Array.from(document.getElementsByTagName(e.tag));let n=null,r=0;for(const a of t){if(!Ee(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}=pe(a);(f===e.vgPath||e.fingerprint?.vgPath===f)&&(s+=10)}s>r&&s>=7&&(r=s,n=a)}return n},Ee=(e,t)=>{if(e.tagName.toLowerCase()!==t.tag.toLowerCase())return!1;const n=e.getAttribute("placeholder"),r=t.attributes?.placeholder||t.fingerprint?.placeholder;if(r&&n&&r!==n)return!1;const a=e.getAttribute("type"),s=t.attributes?.type||t.fingerprint?.type;return!(s&&a&&s!==a)},Zn=(e,t)=>{if(t){const c=Array.from(document.querySelectorAll(`[${Q}="${t}"]`));if(c.length>0){const i=c.filter(u=>Ee(u,e));if(i.length===0)c.forEach(u=>u.removeAttribute(Q));else{const u=i.find(f=>{const{vgPath:h}=pe(f);return h===e.vgPath||e.fingerprint?.vgPath===h}),p=u&&q(u)?u:i.find(f=>!(!q(f)||e.metadata?.isModal&&!f.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content')));return p?(c.forEach(f=>{f!==p&&f.removeAttribute(Q)}),p):null}}}const r=(e.selector?Array.from(document.querySelectorAll(e.selector)):[]).filter(c=>Ee(c,e));let a=r.find(c=>{const{vgPath:i}=pe(c);return i===e.vgPath||e.fingerprint?.vgPath===i})||r[0]||null;if(a&&q(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=wt(c);if(i&&Ee(i,e)&&q(i)){if(e.metadata?.isModal&&!i.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content'))continue;return i}}const s=Jn(e);return s&&q(s)?e.metadata?.isModal&&!s.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content')?null:s:null},Le=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}),Kn=e=>{const t=e.parentElement;if(!t)return;const n=Array.from(t.children).filter(c=>c!==e).slice(0,5).map(c=>Le(c)),r=Array.from(t.children),a=r.indexOf(e);let s="middle";return a===0&&(s="start"),a===r.length-1&&(s="end"),{target:{...Le(e),location:`${s} of ${t.tagName.toLowerCase()}`},parent:Le(t),siblings:n}},Qn=e=>{let t="unknown:0",n=e;for(;n;){const f=n.getAttribute("data-source-path");if(f){t=f;break}n=n.parentElement}const r=Yn(e),{selector:a,fallbacks:s,vgPath:c}=pe(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:r,signature:p,source:t,attributes:i,fallbackSelectors:[...new Set(s)].slice(0,5),domPath:[],viewportSize:{width:window.innerWidth,height:window.innerHeight},uiContext:Kn(e),fingerprint:$n(e),metadata:{hint:`Edit ${t.split(":")[0]} at line ${t.split(":")[1]||"?"}`,computedStyles:Bn(e),viewportBreakpoint:Wn(),outerHtml:e.outerHTML.slice(0,1500),scrollPosition:{x:window.scrollX,y:window.scrollY},isModal:u}}},bt=()=>{const{addToast:e,language:t,t:n,apiKey:r,baseUrl:a,disableViewGate:s,hasActiveToasts:c}=qe(),[i,u]=m.useState(!1),[p,f]=m.useState(null),[h,C]=m.useState(null),[j,O]=m.useState(""),[I,W]=m.useState(!1),[J,Z]=m.useState(!1),[L,K]=m.useState(!1),[A,De]=m.useState([]),[F,$]=m.useState(null),[ke,St]=m.useState(!1),[me,oe]=m.useState(!1),[Re,je]=m.useState({}),[U,ie]=m.useState(null),[ee,fe]=m.useState(!1),[he,_e]=m.useState([]),[l,x]=m.useState(()=>{if(typeof window>"u")return{top:24,right:24};const d=localStorage.getItem("vg-exit-pos");return d?JSON.parse(d):{top:24,right:24}}),[S,E]=m.useState(!1),G=m.useRef(null),[B,k]=m.useState(()=>{if(typeof window>"u")return{bottom:30,right:30};const d=localStorage.getItem("vg-bar-pos");return d?JSON.parse(d):{bottom:30,right:30}}),[z,ce]=m.useState(!1),H=m.useRef(null),tr=d=>{d.preventDefault(),d.stopPropagation();const g=d.currentTarget.parentElement?.getBoundingClientRect();g&&(E(!0),G.current={x:d.clientX,y:d.clientY,top:l.top,right:l.right,width:g.width,height:g.height})},nr=d=>{d.preventDefault(),d.stopPropagation();const g=d.currentTarget.parentElement?.getBoundingClientRect();g&&(ce(!0),H.current={x:d.clientX,y:d.clientY,bottom:B.bottom,right:B.right,width:g.width,height:g.height})};m.useEffect(()=>{if(!S&&!z)return;const d=w=>{if(S&&G.current){const _=w.clientX-G.current.x,R=w.clientY-G.current.y;let b=G.current.top+R,y=G.current.right-_;const v=10;b=Math.max(v,Math.min(window.innerHeight-G.current.height-v,b)),y=Math.max(v,Math.min(window.innerWidth-G.current.width-v,y)),x({top:b,right:y})}if(z&&H.current){const _=w.clientX-H.current.x,R=w.clientY-H.current.y;let b=H.current.bottom-R,y=H.current.right-_;const v=10;b=Math.max(v,Math.min(window.innerHeight-H.current.height-v,b)),y=Math.max(v,Math.min(window.innerWidth-H.current.width-v,y)),k({bottom:b,right:y})}},g=()=>{S&&(E(!1),localStorage.setItem("vg-exit-pos",JSON.stringify(l)),G.current=null),z&&(ce(!1),localStorage.setItem("vg-bar-pos",JSON.stringify(B)),H.current=null)};return window.addEventListener("mousemove",d),window.addEventListener("mouseup",g),()=>{window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",g)}},[S,z,l,B]);const[Ct,Fe]=m.useState(null),[Et,kt]=m.useState(""),[xr,wr]=m.useState({}),le=m.useRef(null),ge=m.useRef(null),ye=m.useCallback(()=>{ge.current||(ge.current=requestAnimationFrame(()=>{const d=new Map,w=Array.from(document.querySelectorAll('[role="dialog"], [aria-modal="true"], .modal, .modal-content')).find(b=>Xn(b)&&q(b)),_=!!w;A.forEach(b=>{if(!b.reference)return;const y=Zn(b.reference,b._id);if(!y||!q(y))return;const v=!!b.reference.metadata?.isModal;let D=!1;if(_?D=w.contains(y):D=!v,!D)return;const T=y.getAttribute(Q);T!==b._id&&(document.querySelectorAll(`[${Q}="${b._id}"]`).forEach(Y=>{Y.removeAttribute(Q)}),T||y.setAttribute(Q,b._id)),d.has(y)||d.set(y,[]),d.get(y).push(b)});const R=[];d.forEach((b,y)=>{const v=y.getBoundingClientRect(),D=v.left+v.width/2,T=v.top+v.height/2;if(D>=0&&D<=window.innerWidth&&T>=0&&T<=window.innerHeight){const Y=document.elementFromPoint(D,T);if(Y&&!y.contains(Y)&&!le.current?.contains(Y))return}R.push({id:b[0]._id,element:y,rect:v,annotations:b.sort((Y,ne)=>new Date(ne.timestamp||ne.createdAt).getTime()-new Date(Y.timestamp||Y.createdAt).getTime()),isModal:!!b[0].reference?.metadata?.isModal})}),_e(R),ge.current=null}))},[A]),te=m.useCallback(async()=>{if(r){oe(!0);try{const d=await fetch(`${a}/api/annotations`,{headers:{"x-api-key":r}});if(d.ok){const _=((await d.json()).data||[]).reduce((R,b)=>R.find(v=>v._id===b._id)?R:R.concat([b]),[]);De(_)}}catch(d){console.error("Failed to fetch annotations",d)}finally{oe(!1)}}},[r,a]);m.useEffect(()=>{L&&A.length===0&&!me&&K(!1)},[L,A.length,me]),m.useEffect(()=>{if(!i&&A.length>0){ye();const d=new MutationObserver(()=>ye()),g=new ResizeObserver(()=>ye()),w=()=>ye();return d.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}),g.observe(document.documentElement),window.addEventListener("scroll",w,!0),()=>{d.disconnect(),g.disconnect(),window.removeEventListener("scroll",w,!0),ge.current&&cancelAnimationFrame(ge.current)}}},[i,A.length,ye]),m.useEffect(()=>{te()},[te]),m.useEffect(()=>{le.current=document.getElementById("viewgate-shadow-host")},[]);const He=m.useCallback(d=>{if(!i||h)return;const g=vt(d.clientX,d.clientY);if(!g||le.current?.contains(g)||g.closest(".vg-no-capture")){f(null);return}const w=g.getBoundingClientRect();f({tag:g.tagName.toLowerCase(),source:g.getAttribute("data-source-path")||"unknown:0",rect:w,element:g,previewText:(g.innerText||"").slice(0,100)||(g.getAttribute("placeholder")||"").slice(0,100)||g.tagName.toLowerCase(),semanticReference:{...Qn(g),normalizedOffset:{x:(d.clientX-w.left)/w.width,y:(d.clientY-w.top)/w.height}}})},[i,h]),We=m.useCallback(async d=>{if(!i||h)return;const g=vt(d.clientX,d.clientY);if(!(!g||le.current?.contains(g)||g.closest(".vg-no-capture"))&&p){d.preventDefault(),d.stopPropagation(),Z(!0);try{const R=window.scrollX,b=window.scrollY,y=await gt(document.documentElement,{pixelRatio:1.5,cacheBust:!0,width:window.innerWidth,height:window.innerHeight,backgroundColor:"#ffffff",style:{transform:`scale(${1/window.devicePixelRatio}) translate(-${R}px, -${b}px)`,transformOrigin:"top left"},filter:ne=>{const Oe=ne;return!(le.current?.contains(Oe)||Oe.id==="viewgate-ui")}}),v=p.element.getBoundingClientRect(),D=v.top>=0&&v.left>=0&&v.bottom<=window.innerHeight&&v.right<=window.innerWidth;let T="";if(D&&v.width>0&&v.height>0)T=await xt(y,v,24,1.5);else try{T=await gt(p.element,{pixelRatio:2,cacheBust:!0,backgroundColor:"#ffffff",filter:ne=>{const Oe=ne;return!le.current?.contains(Oe)}})}catch{T=await xt(y,v,24,1.5)}const Y={...p.semanticReference,metadata:{...p.semanticReference.metadata,screenshotUrl:y,elementScreenshot:T}};C({...p,visualPreview:T,semanticReference:Y})}catch(w){console.error("Failed to capture preview:",w),C(p)}finally{Z(!1),f(null)}}},[i,p,h]);m.useEffect(()=>{const d=g=>{if(g.key==="Escape"){h?C(null):L?K(!1):i&&u(!1);return}const _=(()=>{let y=document.activeElement;for(;y&&y.shadowRoot&&y.shadowRoot.activeElement;)y=y.shadowRoot.activeElement;return y})();if(["input","textarea"].includes((_?.tagName||"").toLowerCase())||_?.isContentEditable)return;const b=g.key.toLowerCase();b==="c"&&!h&&!L&&u(y=>!y),b==="v"&&!h&&(A.length>0||L)&&(K(y=>!y),L||u(!1))};return i&&!h?document.body.classList.add("vg-cursor-pointer"):document.body.classList.remove("vg-cursor-pointer"),window.addEventListener("keydown",d),window.addEventListener("mousemove",He,!0),window.addEventListener("click",We,!0),()=>{document.body.classList.remove("vg-cursor-pointer"),window.removeEventListener("keydown",d),window.removeEventListener("mousemove",He,!0),window.removeEventListener("click",We,!0)}},[i,h,L,A,He,We]);const rr=async()=>{if(!h||!j.trim())return;W(!0);const{semanticReference:d}=h,[g,w]=(d.source||"").split(":"),_=w||"0";try{if(!(await fetch(`${a}/api/annotations`,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify({filePath:g,line:parseInt(_),url:window.location.href,message:j,componentName:d.componentPath||h.tag,reference:{...d,viewport:{width:window.innerWidth,height:window.innerHeight},userAgent:navigator.userAgent,timestamp:new Date().toISOString()}})})).ok)throw new Error("Backend failed");e(n.success,"success"),C(null),O(""),u(!1),te()}catch(R){console.error(R),e(n.error,"error")}finally{W(!1)}};return o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1101",className:"vg-container",children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1102",className:"vg-no-capture",children:[!c&&o.jsxs("div",{style:{position:"fixed",top:`${l.top}px`,right:`${l.right}px`,zIndex:Me+10,display:"flex",alignItems:"center",gap:"8px",transition:S?"none":"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},children:[o.jsx("div",{onMouseDown:tr,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:d=>{d.currentTarget.style.backgroundColor="white",d.currentTarget.style.color="#000000"},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.85)",d.currentTarget.style.color="#1e293b"},children:o.jsx(Ze,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1146",size:14})}),o.jsx("button",{onClick:d=>{d.stopPropagation(),$({title:n.exitConfirmTitle||"Close ViewGate?",message:n.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:d=>{d.currentTarget.style.transform="scale(1.1) rotate(90deg)",d.currentTarget.style.color="#ef4444",d.currentTarget.style.backgroundColor="white"},onMouseLeave:d=>{d.currentTarget.style.transform="scale(1) rotate(0deg)",d.currentTarget.style.color="#64748b",d.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.9)"},children:o.jsx(Te,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1186",size:20,strokeWidth:2.5})})]}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1192",style:{position:"fixed",bottom:`${B.bottom}px`,right:`${B.right}px`,zIndex:Me,display:"flex",alignItems:"center",gap:"8px",transition:z?"none":"all 0.4s cubic-bezier(0.4, 0, 0.2, 1)"},id:"viewgate-ui",children:[o.jsx("div",{onMouseDown:nr,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:d=>{d.currentTarget.style.backgroundColor="white",d.currentTarget.style.color="#000000"},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.85)",d.currentTarget.style.color="#1e293b"},className:"vg-animate-slide-up",children:o.jsx(Ze,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1235",size:16})}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1238",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:1247",style:{display:"flex",alignItems:"center",gap:"10px"},children:[i?o.jsx(Te,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1248",size:20,className:"vg-animate-pop"}):o.jsx(we,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1248",size:20,className:"vg-animate-pop"}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1249",children:i?n.exitMode:n.enterMode})]})}),A.length>0&&o.jsxs("button",{onClick:()=>{K(!L),u(!1),C(null)},className:"vg-button-ghost vg-animate-pop",style:{animationDelay:"0.1s"},children:[o.jsx(Lt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1262",size:20}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1263",children:n.viewComments})]})]})]}),J&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1271",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:Me+1,cursor:"wait"},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1277",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:1278",className:"vg-spinner"}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1279",style:{fontWeight:600,fontSize:"14px",color:"#000000"},children:"Capturando..."})]})}),i&&!h&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1286",className:"vg-backdrop-blur",style:{opacity:1,clipPath:p?`polygon(
|
|
7
|
+
<%s key={someKey} {...props} />`,R,C,L,C),xe[C+R]=!0)}if(C=null,S!==void 0&&(r(S),C=""+S),c(y)&&(r(y.key),C=""+y.key),"key"in y){S={};for(var ye in y)ye!=="key"&&(S[ye]=y[ye])}else S=y;return C&&i(S,typeof d=="function"?d.displayName||d.name||"Unknown":d),p(d,C,S,a(),Y,de)}function h(d){E(d)?d._store&&(d._store.validated=1):typeof d=="object"&&d!==null&&d.$$typeof===Oe&&(d._payload.status==="fulfilled"?E(d._payload.value)&&d._payload.value._store&&(d._payload.value._store.validated=1):d._store&&(d._store.validated=1))}function E(d){return typeof d=="object"&&d!==null&&d.$$typeof===V}var O=m,V=Symbol.for("react.transitional.element"),I=Symbol.for("react.portal"),W=Symbol.for("react.fragment"),Z=Symbol.for("react.strict_mode"),K=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),Q=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),Fe=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),Oe=Symbol.for("react.lazy"),Rt=Symbol.for("react.activity"),he=Symbol.for("react.client.reference"),ce=O.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_e=Object.prototype.hasOwnProperty,Ve=Array.isArray,U=console.createTask?console.createTask:function(){return null};O={react_stack_bottom_frame:function(d){return d()}};var le,te={},ge=O.react_stack_bottom_frame.bind(O,s)(),B=U(n(s)),xe={};me.Fragment=W,me.jsx=function(d,y,S){var R=1e4>ce.recentlyCreatedOwnerStacks++;return f(d,y,S,!1,R?Error("react-stack-top-frame"):ge,R?U(n(d)):B)},me.jsxs=function(d,y,S){var R=1e4>ce.recentlyCreatedOwnerStacks++;return f(d,y,S,!0,R?Error("react-stack-top-frame"):ge,R?U(n(d)):B)}})()),me}var Xe;function Gt(){return Xe||(Xe=1,process.env.NODE_ENV==="production"?be.exports=Pt():be.exports=At()),be.exports}var o=Gt();const Nt=({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&&Tt.createPortal(e,r)})};const Je=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();const Mt=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const It=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase());const Ze=e=>{const t=It(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Lt={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 zt=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const Dt=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,...Lt,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Je("lucide",a),...!s&&!zt(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(Dt,{ref:s,iconNode:t,className:Je(`lucide-${Mt(Ze(e))}`,`lucide-${e}`,n),...a}));return r.displayName=Ze(e),r};const Ft=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 se=T("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const Ke=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 Ht=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 qe=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 $t=T("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const Se=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 Bt=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 Yt=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 Xt=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 et=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 Te=T("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Jt={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."}},tt=m.createContext(void 0),rt=()=>{const e=m.useContext(tt);if(!e)throw new Error("useViewGate must be used within a ViewGateProvider");return e},Pe="viewgate_enabled",Zt=()=>typeof window>"u"?!1:new URLSearchParams(window.location.search).has("viewgate")?(sessionStorage.setItem(Pe,"true"),!0):sessionStorage.getItem(Pe)==="true",Kt=({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(Zt())},[]);const u=()=>{if(sessionStorage.removeItem(Pe),s(!1),typeof window<"u"){const h=new URL(window.location.href);h.searchParams.delete("viewgate"),window.history.replaceState({},"",h.toString())}},p=(h,E)=>{const O=Date.now();i(V=>[...V,{id:O,message:h,type:E}]),setTimeout(()=>{i(V=>V.filter(I=>I.id!==O))},4e3)},f=Jt[t];return o.jsxs(tt.Provider,{"data-source-path":"/src/components/ViewGateProvider.tsx:252",value:{addToast:p,language:t,t:f,apiKey:r,baseUrl:n,disableViewGate:u,hasActiveToasts:c.length>0},children:[e,a&&o.jsx(Nt,{"data-source-path":"/src/components/ViewGateProvider.tsx:263",children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:264",className:"vg-container",children:[o.jsx(kt,{"data-source-path":"/src/components/ViewGateProvider.tsx:265"}),o.jsx("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:266",className:"vg-toasts",style:{zIndex:2147483646},children:c.map(h=>o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:268",className:`vg-toast vg-animate-slide ${h.type}`,children:[h.type==="success"?o.jsx(se,{"data-source-path":"/src/components/ViewGateProvider.tsx:270",size:24,color:"#22c55e"}):o.jsx(Ft,{"data-source-path":"/src/components/ViewGateProvider.tsx:272",size:24,color:"#ef4444"}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:274",children:[o.jsx("strong",{"data-source-path":"/src/components/ViewGateProvider.tsx:275",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:278",style:{fontSize:"14px",color:"#000000"},children:h.message})]})]},h.id))})]})})]})};function Qt(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 J(e){const t=[];for(let r=0,n=e.length;r<n;r++)t.push(e[r]);return t}let oe=null;function nt(e={}){return oe||(e.includeStyleProperties?(oe=e.includeStyleProperties,oe):(oe=J(window.getComputedStyle(document.documentElement)),oe))}function Ce(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function er(e){const t=Ce(e,"border-left-width"),r=Ce(e,"border-right-width");return e.clientWidth+t+r}function tr(e){const t=Ce(e,"border-top-width"),r=Ce(e,"border-bottom-width");return e.clientHeight+t+r}function at(e,t={}){const r=t.width||er(e),n=t.height||tr(e);return{width:r,height:n}}function rr(){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 M=16384;function nr(e){(e.width>M||e.height>M)&&(e.width>M&&e.height>M?e.width>e.height?(e.height*=M/e.width,e.width=M):(e.width*=M/e.height,e.height=M):e.width>M?(e.height*=M/e.width,e.width=M):(e.width*=M/e.height,e.height=M))}function Ee(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 ar(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function sr(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),ar(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 or(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function ir(e,t){return nt(t).map(r=>{const n=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${n}${a?" !important":""};`}).join(" ")}function cr(e,t,r,n){const a=`.${e}:${t}`,s=r.cssText?or(r):ir(r,n);return document.createTextNode(`${a}{${s}}`)}function st(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(cr(c,r,a,n)),t.appendChild(i)}function lr(e,t,r){st(e,t,":before",r),st(e,t,":after",r)}const ot="application/font-woff",it="image/jpeg",dr={woff:ot,woff2:ot,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:it,jpeg:it,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function ur(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Ae(e){const t=ur(e).toLowerCase();return dr[t]||""}function pr(e){return e.split(/,/)[1]}function Ge(e){return e.search(/^(data:)/)!==-1}function mr(e,t){return`data:${t};base64,${e}`}async function ct(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 Ne={};function fr(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 Me(e,t,r){const n=fr(e,t,r.includeQueryParams);if(Ne[n]!=null)return Ne[n];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const s=await ct(e,r.fetchRequestInit,({res:c,result:i})=>(t||(t=c.headers.get("Content-Type")||""),pr(i)));a=mr(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 Ne[n]=a,a}async function hr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):Ee(t)}async function gr(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 Ee(i)}const r=e.poster,n=Ae(r),a=await Me(r,n,t);return Ee(a)}async function xr(e,t){var r;try{if(!((r=e?.contentDocument)===null||r===void 0)&&r.body)return await ke(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function yr(e,t){return P(e,HTMLCanvasElement)?hr(e):P(e,HTMLVideoElement)?gr(e,t):P(e,HTMLIFrameElement)?xr(e,t):e.cloneNode(lt(e))}const wr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",lt=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function vr(e,t,r){var n,a;if(lt(t))return t;let s=[];return wr(e)&&e.assignedNodes?s=J(e.assignedNodes()):P(e,HTMLIFrameElement)&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?s=J(e.contentDocument.body.childNodes):s=J(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),s.length===0||P(e,HTMLVideoElement)||await s.reduce((c,i)=>c.then(()=>ke(i,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function br(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):nt(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 Sr(e,t){P(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),P(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function Cr(e,t){if(P(e,HTMLSelectElement)){const n=Array.from(t.children).find(a=>e.value===a.getAttribute("value"));n&&n.setAttribute("selected","")}}function Er(e,t,r){return P(t,Element)&&(br(e,t,r),lr(e,t,r),Sr(e,t),Cr(e,t)),t}async function kr(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 ke(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 ke(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(n=>yr(n,t)).then(n=>vr(e,n,t)).then(n=>Er(e,n,t)).then(n=>kr(n,t))}const dt=/url\((['"]?)([^'"]+?)\1\)/g,Rr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,jr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Or(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function _r(e){const t=[];return e.replace(dt,(r,n,a)=>(t.push(a),r)),t.filter(r=>!Ge(r))}async function Vr(e,t,r,n,a){try{const s=r?Qt(t,r):t,c=Ae(t);let i;return a||(i=await Me(s,c,n)),e.replace(Or(t),`$1${i}$3`)}catch{}return e}function Tr(e,{preferredFontFormat:t}){return t?e.replace(jr,r=>{for(;;){const[n,,a]=Rr.exec(r)||[];if(!a)return"";if(a===t)return`src: ${n};`}}):e}function ut(e){return e.search(dt)!==-1}async function pt(e,t,r){if(!ut(e))return e;const n=Tr(e,r);return _r(n).reduce((s,c)=>s.then(i=>Vr(i,c,t,r)),Promise.resolve(n))}async function ie(e,t,r){var n;const a=(n=t.style)===null||n===void 0?void 0:n.getPropertyValue(e);if(a){const s=await pt(a,null,r);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function Pr(e,t){await ie("background",e,t)||await ie("background-image",e,t),await ie("mask",e,t)||await ie("-webkit-mask",e,t)||await ie("mask-image",e,t)||await ie("-webkit-mask-image",e,t)}async function Ar(e,t){const r=P(e,HTMLImageElement);if(!(r&&!Ge(e.src))&&!(P(e,SVGImageElement)&&!Ge(e.href.baseVal)))return;const n=r?e.src:e.href.baseVal,a=await Me(n,Ae(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 Gr(e,t){const n=J(e.childNodes).map(a=>mt(a,t));await Promise.all(n).then(()=>e)}async function mt(e,t){P(e,Element)&&(await Pr(e,t),await Ar(e,t),await Gr(e,t))}function Nr(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 ft={};async function ht(e){let t=ft[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},ft[e]=t,t}async function gt(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),ct(i,t.fetchRequestInit,({result:u})=>(r=r.replace(c,`url(${u})`),[c,u]))});return Promise.all(s).then(()=>r)}function xt(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 Mr(e,t){const r=[],n=[];return e.forEach(a=>{if("cssRules"in a)try{J(a.cssRules||[]).forEach((s,c)=>{if(s.type===CSSRule.IMPORT_RULE){let i=c+1;const u=s.href,p=ht(u).then(f=>gt(f,t)).then(f=>xt(f).forEach(h=>{try{a.insertRule(h,h.startsWith("@import")?i+=1:a.cssRules.length)}catch(E){console.error("Error inserting rule from remote css",{rule:h,error:E})}})).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(ht(a.href).then(i=>gt(i,t)).then(i=>xt(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{J(a.cssRules||[]).forEach(s=>{r.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${a.href}`,s)}}),r))}function Ir(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>ut(t.style.getPropertyValue("src")))}async function Lr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=J(e.ownerDocument.styleSheets),n=await Mr(r,t);return Ir(n)}function yt(e){return e.trim().replace(/["']/g,"")}function zr(e){const t=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(s=>{t.add(yt(s))}),Array.from(n.children).forEach(s=>{s instanceof HTMLElement&&r(s)})}return r(e),t}async function Dr(e,t){const r=await Lr(e,t),n=zr(e);return(await Promise.all(r.filter(s=>n.has(yt(s.style.fontFamily))).map(s=>{const c=s.parentStyleSheet?s.parentStyleSheet.href:null;return pt(s.cssText,c,t)}))).join(`
|
|
8
|
+
`)}async function Fr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Dr(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 Hr(e,t={}){const{width:r,height:n}=at(e,t),a=await ke(e,t,!0);return await Fr(a,t),await mt(a,t),Nr(a,t),await sr(a,r,n)}async function Wr(e,t={}){const{width:r,height:n}=at(e,t),a=await Hr(e,t),s=await Ee(a),c=document.createElement("canvas"),i=c.getContext("2d"),u=t.pixelRatio||rr(),p=t.canvasWidth||r,f=t.canvasHeight||n;return c.width=p*u,c.height=f*u,t.skipAutoScale||nr(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 wt(e,t={}){return(await Wr(e,t)).toDataURL()}const Re=2147483647,Ie=Re,Le=2e6,$r=Re-10,Ur=Re-5,Br=Re-15,q="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})]})},fe=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}=fe(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=(()=>{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}})(),St=(e,t,r,n)=>new Promise(a=>{const s=new Image;s.onload=()=>{const c=document.createElement("canvas"),i=window.devicePixelRatio||1,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.scale(i,i);let h=(t.left-r)*n,E=(t.top-r)*n,O=u*n,V=p*n,I=0,W=0,Z=u,K=p;h<0&&(I=Math.abs(h)/n,O+=h,Z-=I,h=0),h+O>s.width&&(O=s.width-h,Z=O/n),E<0&&(W=Math.abs(E)/n,V+=E,K-=W,E=0),E+V>s.height&&(V=s.height-E,K=V/n),f.fillStyle="#ffffff",f.fillRect(0,0,u,p),O>0&&V>0&&f.drawImage(s,h,E,O,V,I,W,Z,K)}a(c.toDataURL("image/png"))},s.onerror=()=>a(""),s.src=e}),Zr=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]=Jr(s)}),r},Kr=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)},Ct=(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=Ct(e,s);if(c)return c}}return null},Et=(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},qr=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(!je(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}=fe(a);(f===e.vgPath||e.fingerprint?.vgPath===f)&&(s+=10)}s>n&&s>=7&&(n=s,r=a)}return r},je=(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)},en=(e,t)=>{if(t){const c=Array.from(document.querySelectorAll(`[${q}="${t}"]`));if(c.length>0){const i=c.filter(u=>je(u,e));if(i.length===0)c.forEach(u=>u.removeAttribute(q));else{const u=i.find(f=>{const{vgPath:h}=fe(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(q)}),p):null}}}const n=(e.selector?Array.from(document.querySelectorAll(e.selector)):[]).filter(c=>je(c,e));let a=n.find(c=>{const{vgPath:i}=fe(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=Ct(c);if(i&&je(i,e)&&ee(i)){if(e.metadata?.isModal&&!i.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content'))continue;return i}}const s=qr(e);return s&&ee(s)?e.metadata?.isModal&&!s.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content')?null:s:null},ze=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}),tn=e=>{const t=e.parentElement;if(!t)return;const r=Array.from(t.children).filter(c=>c!==e).slice(0,5).map(c=>ze(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:{...ze(e),location:`${s} of ${t.tagName.toLowerCase()}`},parent:ze(t),siblings:r}},rn=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=Kr(e),{selector:a,fallbacks:s,vgPath:c}=fe(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:tn(e),fingerprint:Xr(e),metadata:{hint:`Edit ${t.split(":")[0]} at line ${t.split(":")[1]||"?"}`,computedStyles:Zr(e),viewportBreakpoint:Yr(),outerHtml:e.outerHTML.slice(0,1500),scrollPosition:{x:window.scrollX,y:window.scrollY},isModal:u}}},kt=()=>{const{addToast:e,language:t,t:r,apiKey:n,baseUrl:a,disableViewGate:s,hasActiveToasts:c}=rt(),[i,u]=m.useState(!1),[p,f]=m.useState(null),[h,E]=m.useState(null),[O,V]=m.useState(""),[I,W]=m.useState(!1),[Z,K]=m.useState(!1),[D,Q]=m.useState(!1),[A,Fe]=m.useState([]),[H,$]=m.useState(null),[Oe,Rt]=m.useState(!1),[he,ce]=m.useState(!1),[_e,Ve]=m.useState({}),[U,le]=m.useState(null),[te,ge]=m.useState(!1),[B,xe]=m.useState(null),[d,y]=m.useState([]),[S,R]=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}}),[Y,de]=m.useState(!1),C=m.useRef(null),[L,ye]=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}}),[re,jt]=m.useState(!1),X=m.useRef(null),sn=l=>{l.preventDefault(),l.stopPropagation();const g=l.currentTarget.parentElement?.getBoundingClientRect();g&&(de(!0),C.current={x:l.clientX,y:l.clientY,top:S.top,right:S.right,width:g.width,height:g.height})},on=l=>{l.preventDefault(),l.stopPropagation();const g=l.currentTarget.parentElement?.getBoundingClientRect();g&&(jt(!0),X.current={x:l.clientX,y:l.clientY,bottom:L.bottom,right:L.right,width:g.width,height:g.height})};m.useEffect(()=>{if(!Y&&!re)return;const l=w=>{if(Y&&C.current){const _=w.clientX-C.current.x,j=w.clientY-C.current.y;let v=C.current.top+j,x=C.current.right-_;const b=10;v=Math.max(b,Math.min(window.innerHeight-C.current.height-b,v)),x=Math.max(b,Math.min(window.innerWidth-C.current.width-b,x)),R({top:v,right:x})}if(re&&X.current){const _=w.clientX-X.current.x,j=w.clientY-X.current.y;let v=X.current.bottom-j,x=X.current.right-_;const b=10;v=Math.max(b,Math.min(window.innerHeight-X.current.height-b,v)),x=Math.max(b,Math.min(window.innerWidth-X.current.width-b,x)),ye({bottom:v,right:x})}},g=()=>{Y&&(de(!1),localStorage.setItem("vg-exit-pos",JSON.stringify(S)),C.current=null),re&&(jt(!1),localStorage.setItem("vg-bar-pos",JSON.stringify(L)),X.current=null)};return window.addEventListener("mousemove",l),window.addEventListener("mouseup",g),()=>{window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",g)}},[Y,re,S,L]);const[Ot,He]=m.useState(null),[_t,Vt]=m.useState(""),[En,kn]=m.useState({}),ue=m.useRef(null),we=m.useRef(null),ve=m.useCallback(()=>{we.current||(we.current=requestAnimationFrame(()=>{const l=new Map,w=Array.from(document.querySelectorAll('[role="dialog"], [aria-modal="true"], .modal, .modal-content')).find(v=>Qr(v)&&ee(v)),_=!!w;A.forEach(v=>{if(!v.reference)return;const x=en(v.reference,v._id);if(!x||!ee(x))return;const b=!!v.reference.metadata?.isModal;let F=!1;if(_?F=w.contains(x):F=!b,!F)return;const G=x.getAttribute(q);G!==v._id&&(document.querySelectorAll(`[${q}="${v._id}"]`).forEach(z=>{z.removeAttribute(q)}),G||x.setAttribute(q,v._id)),l.has(x)||l.set(x,[]),l.get(x).push(v)});const j=[];l.forEach((v,x)=>{const b=x.getBoundingClientRect(),F=b.left+b.width/2,G=b.top+b.height/2;if(F>=0&&F<=window.innerWidth&&G>=0&&G<=window.innerHeight){const z=document.elementFromPoint(F,G);if(z&&!x.contains(z)&&!ue.current?.contains(z))return}j.push({id:v[0]._id,element:x,rect:b,annotations:v.sort((z,k)=>new Date(k.timestamp||k.createdAt).getTime()-new Date(z.timestamp||z.createdAt).getTime()),isModal:!!v[0].reference?.metadata?.isModal})}),y(j),we.current=null}))},[A]),ne=m.useCallback(async()=>{if(n){ce(!0);try{const l=await fetch(`${a}/api/annotations`,{headers:{"x-api-key":n}});if(l.ok){const _=((await l.json()).data||[]).reduce((j,v)=>j.find(b=>b._id===v._id)?j:j.concat([v]),[]);Fe(_)}}catch(l){console.error("Failed to fetch annotations",l)}finally{ce(!1)}}},[n,a]);m.useEffect(()=>{D&&A.length===0&&!he&&Q(!1)},[D,A.length,he]),m.useEffect(()=>{if(!i&&A.length>0){ve();const l=new MutationObserver(()=>ve()),g=new ResizeObserver(()=>ve()),w=()=>ve();return l.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}),g.observe(document.documentElement),window.addEventListener("scroll",w,!0),()=>{l.disconnect(),g.disconnect(),window.removeEventListener("scroll",w,!0),we.current&&cancelAnimationFrame(we.current)}}},[i,A.length,ve]),m.useEffect(()=>{ne()},[ne]),m.useEffect(()=>{ue.current=document.getElementById("viewgate-shadow-host")},[]);const We=m.useCallback(l=>{if(!i||h)return;const g=Et(l.clientX,l.clientY);if(!g||ue.current?.contains(g)||g.closest(".vg-no-capture")){f(null);return}const w=g.getBoundingClientRect();f({tag:g.tagName.toLowerCase(),source:g.getAttribute("data-source-path")||"unknown:0",rect:w,element:g,previewText:(g.innerText||"").slice(0,100)||(g.getAttribute("placeholder")||"").slice(0,100)||g.tagName.toLowerCase(),semanticReference:{...rn(g),normalizedOffset:{x:(l.clientX-w.left)/w.width,y:(l.clientY-w.top)/w.height}}})},[i,h]),$e=m.useCallback(async l=>{if(!i||h)return;const g=Et(l.clientX,l.clientY);if(!(!g||ue.current?.contains(g)||g.closest(".vg-no-capture"))&&p){l.preventDefault(),l.stopPropagation(),K(!0);try{const j=window.scrollX,v=window.scrollY,x=await wt(document.documentElement,{pixelRatio:1.5,cacheBust:!0,width:window.innerWidth,height:window.innerHeight,backgroundColor:"#ffffff",style:{transform:`scale(${1/window.devicePixelRatio}) translate(-${j}px, -${v}px)`,transformOrigin:"top left"},filter:k=>{const ae=k;return!(ue.current?.contains(ae)||ae.id==="viewgate-ui")}}),b=p.element.getBoundingClientRect(),F=b.top>=0&&b.left>=0&&b.bottom<=window.innerHeight&&b.right<=window.innerWidth;let G="";if(F&&b.width>0&&b.height>0)G=await St(x,b,24,1.5);else try{G=await wt(p.element,{pixelRatio:2,cacheBust:!0,backgroundColor:"#ffffff",filter:k=>{const ae=k;return!ue.current?.contains(ae)}})}catch{G=await St(x,b,24,1.5)}const z={...p.semanticReference,metadata:{...p.semanticReference.metadata,screenshotUrl:x,elementScreenshot:G}};E({...p,visualPreview:G,semanticReference:z})}catch(w){console.error("Failed to capture preview:",w),E(p)}finally{K(!1),f(null)}}},[i,p,h]);m.useEffect(()=>{const l=g=>{if(g.key==="Escape"){h?E(null):D?Q(!1):i&&u(!1);return}const _=(()=>{let x=document.activeElement;for(;x&&x.shadowRoot&&x.shadowRoot.activeElement;)x=x.shadowRoot.activeElement;return x})();if(["input","textarea"].includes((_?.tagName||"").toLowerCase())||_?.isContentEditable)return;const v=g.key.toLowerCase();v==="c"&&!h&&!D&&u(x=>!x),v==="v"&&!h&&(A.length>0||D)&&(Q(x=>!x),D||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",We,!0),window.addEventListener("click",$e,!0),()=>{document.body.classList.remove("vg-cursor-pointer"),window.removeEventListener("keydown",l),window.removeEventListener("mousemove",We,!0),window.removeEventListener("click",$e,!0)}},[i,h,D,A,We,$e]);const cn=async()=>{if(!h||!O.trim())return;W(!0);const{semanticReference:l}=h,[g,w]=(l.source||"").split(":"),_=w||"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(_),url:window.location.href,message:O,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"),E(null),V(""),u(!1),ne()}catch(j){console.error(j),e(r.error,"error")}finally{W(!1)}};return o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1154",className:"vg-container",children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1155",className:"vg-no-capture",children:[!c&&o.jsxs("div",{style:{position:"fixed",top:`${S.top}px`,right:`${S.right}px`,zIndex:Ie+10,display:"flex",alignItems:"center",gap:"8px",transition:Y?"none":"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},children:[o.jsx("div",{onMouseDown:sn,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(qe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1199",size:14})}),o.jsx("button",{onClick:l=>{l.stopPropagation(),$({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(Te,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1239",size:20,strokeWidth:2.5})})]}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1245",style:{position:"fixed",bottom:`${L.bottom}px`,right:`${L.right}px`,zIndex:Ie,display:"flex",alignItems:"center",gap:"8px",transition:re?"none":"all 0.4s cubic-bezier(0.4, 0, 0.2, 1)"},id:"viewgate-ui",children:[o.jsx("div",{onMouseDown:on,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(qe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1288",size:16})}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1291",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:1300",style:{display:"flex",alignItems:"center",gap:"10px"},children:[i?o.jsx(Te,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1301",size:20,className:"vg-animate-pop"}):o.jsx(Se,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1301",size:20,className:"vg-animate-pop"}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1302",children:i?r.exitMode:r.enterMode})]})}),A.length>0&&o.jsxs("button",{onClick:()=>{Q(!D),u(!1),E(null)},className:"vg-button-ghost vg-animate-pop",style:{animationDelay:"0.1s"},children:[o.jsx(Ht,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1315",size:20}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1316",children:r.viewComments})]})]})]}),Z&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1324",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:Ie+1,cursor:"wait"},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1330",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:1331",className:"vg-spinner"}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1332",style:{fontWeight:600,fontSize:"14px",color:"#000000"},children:"Capturando..."})]})}),i&&!h&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1339",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,
|
|
11
11
|
${p.rect.right}px ${p.rect.top}px,
|
|
12
12
|
${p.rect.right}px ${p.rect.bottom}px,
|
|
13
13
|
${p.rect.left}px ${p.rect.bottom}px,
|
|
14
14
|
${p.rect.left}px ${p.rect.top}px
|
|
15
|
-
)`:"none",zIndex:Dn}}),i&&p&&!h&&!J&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1305",className:"vg-selection-pulse",style:{top:p.rect.top-4,left:p.rect.left-4,width:p.rect.width+8,height:p.rect.height+8,zIndex:Fn},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1315",className:"vg-selection-label",style:{...p.rect.top<60?p.rect.bottom>window.innerHeight-60?{top:"8px",bottom:"auto"}:{top:"100%",marginTop:"8px",bottom:"auto"}:{top:"-40px",bottom:"auto"},...p.rect.left+200>window.innerWidth?{left:"auto",right:"0"}:{left:"0",right:"auto"}},children:[o.jsx(Dt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1331",size:16}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1332",style:{display:"flex",flexDirection:"column"},children:[o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1333",style:{fontWeight:700},children:n.selectToComment}),o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1334",style:{fontSize:"10px",opacity:.8,fontFamily:"monospace"},children:[Math.round(p.rect.width)," × ",Math.round(p.rect.height)]})]})]})}),h&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1344",className:"vg-animate-fade",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(15, 23, 42, 0.4)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:Ie},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1349",className:"vg-glassmorphism vg-animate-slide",style:{padding:"40px",width:"500px",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1353",style:{textAlign:"center",marginBottom:"32px"},children:[o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1354",style:{width:"48px",height:"48px",background:"var(--vg-primary-gradient)",borderRadius:"12px",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 16px",color:"white",boxShadow:"0 8px 16px rgba(99, 102, 241, 0.3)"},children:o.jsx(we,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1359",size:24})}),o.jsx("h2",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1361",style:{margin:"0 0 8px 0",fontSize:"24px",fontWeight:800,color:"#0f172a"},children:n.feedbackHeader}),o.jsx("p",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1362",style:{margin:0,color:"#000000",fontSize:"15px"},children:n.feedbackSubheader})]}),h.visualPreview&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1366",style:{marginBottom:"24px",borderRadius:"12px",overflow:"hidden",border:"1px solid #e2e8f0",background:"#f8fafc",width:"fit-content",margin:"0 auto 24px auto"},children:o.jsx("img",{src:h.visualPreview,alt:"Preview",style:{maxWidth:"100%",maxHeight:"200px",objectFit:"contain",display:"block"}})}),o.jsx("textarea",{className:"vg-textarea",value:j,onChange:d=>O(d.target.value),rows:4,placeholder:n.placeholder,autoFocus:!0,style:{fontSize:"15px",padding:"16px",marginBottom:"24px"}}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1393",style:{display:"flex",gap:"12px"},children:[o.jsx("button",{onClick:()=>!I&&C(null),className:"vg-button-ghost",disabled:I,style:{flex:1,padding:"12px"},children:n.cancel}),o.jsx("button",{onClick:rr,className:"vg-button-primary",disabled:I||!j.trim(),style:{flex:2},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1408",style:{display:"flex",alignItems:"center",gap:"8px"},children:[I?o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1409",className:"vg-spinner",style:{width:"16px",height:"16px",borderWidth:"2px"}}):o.jsx(Wt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1409",size:18}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1410",children:I?n.submitting:n.sendFeedback||"Send Comment"})]})})]})]})}),L&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1420",className:"vg-animate-fade",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(15, 23, 42, 0.6)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:Ie},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1425",className:"vg-glassmorphism vg-animate-slide",style:{padding:"32px",width:"650px",maxHeight:"85vh",display:"flex",flexDirection:"column"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1429",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"20px"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1430",style:{display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("h2",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1431",style:{margin:0,fontSize:"20px",fontWeight:800,color:"#0f172a"},children:U?n.commentDetails:n.annotations}),!U&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1435",className:"vg-badge",style:{background:"#e0e7ff",color:"#6366f1"},children:A.length})]}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1440",style:{display:"flex",gap:"8px"},children:[U&&o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1442",className:"vg-button-ghost",style:{padding:"6px 14px",fontSize:"12px"},onClick:()=>ie(null),children:n.viewAll||"View All"}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1450",className:"vg-button-ghost",style:{padding:"8px",borderRadius:"50%"},onClick:()=>{K(!1),ie(null)},children:o.jsx(Te,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1455",size:20})})]})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1460",style:{maxHeight:"60vh",overflowY:"auto",paddingRight:"10px"},className:"vg-custom-scrollbar",children:me?o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1462",style:{display:"flex",justifyContent:"center",padding:"40px"},children:o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1463",className:"vg-spinner"})}):(()=>{if(!U)return A;const d=he.find(g=>g.annotations.some(w=>w._id===U));return d?d.annotations:A.filter(g=>g._id===U)})().map((d,g)=>o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1472",className:"vg-glassmorphism vg-animate-slide",style:{padding:"20px",marginBottom:"16px",border:"1px solid rgba(0,0,0,0.05)",background:"rgba(255,255,255,0.5)",animationDelay:`${g*.05}s`},children:[o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1483",style:{display:"flex",justifyContent:"space-between",marginBottom:"16px",alignItems:"center"},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1484",style:{display:"flex",gap:"12px",alignItems:"center"},children:[d.status==="ready_for_review"?o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1486",className:"vg-badge",style:{backgroundColor:"#f0fdf4",color:"#16a34a"},children:[o.jsx(re,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1487",size:14})," ",n.readyForReview]}):o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1490",className:"vg-badge",style:{backgroundColor:"#fff7ed",color:"#ea580c"},children:[o.jsx(It,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1491",size:14})," ",n.pending]}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1494",style:{fontSize:"12px",color:"#000000"},children:yt(d.timestamp||d.createdAt||d.reference?.timestamp,t)})]})}),Ct===d._id?o.jsx("textarea",{className:"vg-textarea",value:Et,onChange:w=>kt(w.target.value),rows:3,autoFocus:!0,style:{marginBottom:"16px"}}):o.jsx("p",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1510",style:{margin:"0 0 20px 0",fontSize:"16px",color:"#1e293b",lineHeight:1.6},children:d.message}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1513",style:{display:"flex",gap:"12px",justifyContent:"flex-end",borderTop:"1px solid #f1f5f9",paddingTop:"16px"},children:Ct===d._id?o.jsxs(o.Fragment,{children:[o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1516",className:"vg-button-primary vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:async()=>{try{(await fetch(`${a}/api/annotations/${d._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify({message:Et})})).ok&&(Fe(null),te(),e(n.updateSuccess,"success"))}catch{e(n.error,"error")}},children:n.save}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1538",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:()=>Fe(null),children:n.cancel})]}):o.jsxs(o.Fragment,{children:[o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1542",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:()=>{Fe(d._id),kt(d.message)},children:[o.jsx(Ft,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1550",size:14})," ",n.edit]}),o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1552",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px",animationDelay:"0.05s"},onClick:()=>{d.url&&(window.location.href=d.url)},children:[o.jsx(Je,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1559",size:14})," ",n.review]}),d.status==="pending"?o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1562",className:"vg-button-primary vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px",animationDelay:"0.1s"},onClick:()=>{$({title:n.markReadyConfirm,message:n.confirmMarkReady,type:"success",onConfirm:async()=>{try{(await fetch(`${a}/api/annotations/${d._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify({status:"ready_for_review"})})).ok&&(te(),e(n.updateSuccess,"success"))}catch{e(n.error,"error")}finally{$(null)}}})},children:[o.jsx(re,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1590",size:14})," ",n.markReady]}):o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1593",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px",animationDelay:"0.1s"},onClick:()=>{$({title:n.reopenConfirm,message:n.confirmReopen,type:"success",onConfirm:async()=>{try{(await fetch(`${a}/api/annotations/${d._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify({status:"pending"})})).ok&&(te(),e(n.updateSuccess,"success"))}catch{e(n.error,"error")}finally{$(null)}}})},children:[o.jsx(Ht,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1621",size:14})," ",n.reopen]}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1624",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 12px",color:"#ef4444",borderColor:"#fee2e2",animationDelay:"0.15s"},onClick:()=>{$({title:n.deleteConfirm,message:n.confirmDelete,type:"danger",onConfirm:async()=>{try{(await fetch(`${a}/api/annotations/${d._id}`,{method:"DELETE",headers:{"x-api-key":r}})).ok&&(te(),e(n.deleteSuccess,"success"))}catch{e(n.error,"error")}finally{$(null)}}})},children:o.jsx(Ke,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1651",size:16})})]})})]},d._id))})]})}),F&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1666",className:"vg-animate-fade",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(11, 15, 25, 0.7)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:Ie+100},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1671",className:"vg-glassmorphism vg-animate-slide",style:{padding:"40px",width:"420px",textAlign:"center",border:"1px solid rgba(255, 255, 255, 0.1)",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.5)"},children:[o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1678",style:{width:"64px",height:"64px",background:F.type==="danger"?"rgba(239, 68, 68, 0.1)":"rgba(99, 102, 241, 0.1)",borderRadius:"20px",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px",color:F.type==="danger"?"#ef4444":"#6366f1",transform:"rotate(-5deg)"},children:F.type==="danger"?o.jsx(Ke,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1687",size:32}):o.jsx(re,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1687",size:32})}),o.jsx("h3",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1689",style:{margin:"0 0 12px 0",fontSize:"20px",fontWeight:800,color:"#000000",letterSpacing:"-0.02em"},children:F.title}),o.jsx("p",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1690",style:{margin:"0 0 32px 0",fontSize:"15px",color:"#000000",lineHeight:1.6},children:F.message}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1691",style:{display:"flex",gap:"16px"},children:[o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1692",className:"vg-button-ghost",style:{flex:1,height:"44px"},onClick:()=>!ee&&$(null),disabled:ee,children:n.no}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1700",className:"vg-button-primary",style:{flex:1,height:"44px",backgroundColor:F.type==="danger"?"#ef4444":void 0,backgroundImage:F.type==="danger"?"none":void 0,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},disabled:ee,onClick:async()=>{fe(!0);try{await F.onConfirm()}catch(d){console.error("Confirmation error:",d)}finally{fe(!1)}},children:ee?o.jsx(zt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1725",size:18,className:"vg-animate-spin"}):n.yes})]})]})}),!i&&!L&&he.map((d,g)=>{const{rect:w,annotations:_,isModal:R}=d,b=_[0],y=_.length;return o.jsxs("div",{className:"vg-pin-container vg-animate-pop",style:{position:"fixed",top:w.top-20,left:w.left+w.width/2-16,cursor:"pointer",transition:"all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275)",zIndex:Hn},onMouseEnter:v=>{window.innerHeight-w.bottom<250?je(T=>({...T,[d.id]:"vg-top"})):je(T=>({...T,[d.id]:""}))},onClick:()=>{K(!0),ie(b._id)},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1764",className:`vg-pin-tooltip ${Re[d.id]||""}`,style:{width:"280px",padding:"16px"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1765",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"12px"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1766",style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx(we,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1767",size:14,color:"#6366f1"}),o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1768",style:{fontWeight:800,fontSize:"13px",color:"#0f172a"},children:[y," ",y===1?"Comentario":"Comentarios"]})]}),R&&o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1773",className:"vg-badge",style:{fontSize:"10px",background:"#fef3c7",color:"#92400e",border:"none"},children:"MODAL"})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1776",className:"vg-tooltip-scroll",style:{maxHeight:"180px",overflowY:"auto"},children:_.map((v,D)=>o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1778",style:{padding:"10px 0",borderTop:D===0?"none":"1px solid #f1f5f9",display:"flex",flexDirection:"column",gap:"4px"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1785",style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1786",style:{fontSize:"10px",fontWeight:600,color:"#64748b"},children:yt(v.timestamp||v.createdAt,t)}),v.status==="ready_for_review"&&o.jsx(re,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1789",size:12,color:"#22c55e"})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1791",style:{fontSize:"13px",color:"#1e293b",lineHeight:1.4,fontWeight:500},children:v.message.length>80?v.message.slice(0,80)+"...":v.message})]},v._id))})]}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1799",className:`vg-formal-pin ${b.status==="ready_for_review"?"ready":""} ${R?"modal-variant":""}`,style:{position:"relative"},children:[b.status==="ready_for_review"?o.jsx(re,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1800",size:18}):R?o.jsx(Je,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1800",size:16}):o.jsx(we,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1800",size:16}),y>1&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1803",className:"vg-pin-badge vg-animate-pop",children:y})]})]},`group-${d.id}`)})]})})};function ze(e,t,n){if(!t.endsWith(".tsx")&&!t.endsWith(".jsx")||t.includes("node_modules"))return e;const r=i=>i.replace(/\\/g,"/"),a=r(t).replace(r(n),"");return e.split(`
|
|
16
|
-
`).map((i,u)=>{const p=u+1;return i.replace(/(^|[^a-zA-Z0-9])<([a-zA-Z][a-zA-Z0-9\.]*)(?=[ \t\n\/\>])/g,(f,h,
|
|
17
|
-
`)}function
|
|
15
|
+
)`:"none",zIndex:$r}}),i&&p&&!h&&!Z&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1358",className:"vg-selection-pulse",style:{top:p.rect.top-4,left:p.rect.left-4,width:p.rect.width+8,height:p.rect.height+8,zIndex:Ur},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1368",className:"vg-selection-label",style:{...p.rect.top<60?p.rect.bottom>window.innerHeight-60?{top:"8px",bottom:"auto"}:{top:"100%",marginTop:"8px",bottom:"auto"}:{top:"-40px",bottom:"auto"},...p.rect.left+200>window.innerWidth?{left:"auto",right:"0"}:{left:"0",right:"auto"}},children:[o.jsx(Ut,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1384",size:16}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1385",style:{display:"flex",flexDirection:"column"},children:[o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1386",style:{fontWeight:700},children:r.selectToComment}),o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1387",style:{fontSize:"10px",opacity:.8,fontFamily:"monospace"},children:[Math.round(p.rect.width)," × ",Math.round(p.rect.height)]})]})]})}),h&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1397",className:"vg-animate-fade",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(15, 23, 42, 0.4)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:Le},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1402",className:"vg-glassmorphism vg-animate-slide",style:{padding:"40px",width:"500px",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1406",style:{textAlign:"center",marginBottom:"32px"},children:[o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1407",style:{width:"48px",height:"48px",background:"var(--vg-primary-gradient)",borderRadius:"12px",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 16px",color:"white",boxShadow:"0 8px 16px rgba(99, 102, 241, 0.3)"},children:o.jsx(Se,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1412",size:24})}),o.jsx("h2",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1414",style:{margin:"0 0 8px 0",fontSize:"24px",fontWeight:800,color:"#0f172a"},children:r.feedbackHeader}),o.jsx("p",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1415",style:{margin:0,color:"#000000",fontSize:"15px"},children:r.feedbackSubheader})]}),h.visualPreview&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1419",style:{marginBottom:"24px",borderRadius:"12px",overflow:"hidden",border:"1px solid #e2e8f0",background:"#f8fafc",width:"fit-content",margin:"0 auto 24px auto"},children:o.jsx("img",{src:h.visualPreview,alt:"Preview",style:{maxWidth:"100%",maxHeight:"200px",objectFit:"contain",display:"block"}})}),o.jsx("textarea",{className:"vg-textarea",value:O,onChange:l=>V(l.target.value),rows:4,placeholder:r.placeholder,autoFocus:!0,style:{fontSize:"15px",padding:"16px",marginBottom:"24px"}}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1446",style:{display:"flex",gap:"12px"},children:[o.jsx("button",{onClick:()=>!I&&E(null),className:"vg-button-ghost",disabled:I,style:{flex:1,padding:"12px"},children:r.cancel}),o.jsx("button",{onClick:cn,className:"vg-button-primary",disabled:I||!O.trim(),style:{flex:2},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1461",style:{display:"flex",alignItems:"center",gap:"8px"},children:[I?o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1462",className:"vg-spinner",style:{width:"16px",height:"16px",borderWidth:"2px"}}):o.jsx(Xt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1462",size:18}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1463",children:I?r.submitting:r.sendFeedback||"Send Comment"})]})})]})]})}),D&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1473",className:"vg-animate-fade",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(15, 23, 42, 0.6)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:Le},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1478",className:"vg-glassmorphism vg-animate-slide",style:{padding:"32px",width:"650px",maxHeight:"85vh",display:"flex",flexDirection:"column"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1482",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"20px"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1483",style:{display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("h2",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1484",style:{margin:0,fontSize:"20px",fontWeight:800,color:"#0f172a"},children:U?r.commentDetails:r.annotations}),!U&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1488",className:"vg-badge",style:{background:"#e0e7ff",color:"#6366f1"},children:A.length})]}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1493",style:{display:"flex",gap:"8px"},children:[U&&o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1495",className:"vg-button-ghost",style:{padding:"6px 14px",fontSize:"12px"},onClick:()=>le(null),children:r.viewAll||"View All"}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1503",className:"vg-button-ghost",style:{padding:"8px",borderRadius:"50%"},onClick:()=>{Q(!1),le(null)},children:o.jsx(Te,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1508",size:20})})]})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1513",style:{maxHeight:"60vh",overflowY:"auto",paddingRight:"10px"},className:"vg-custom-scrollbar",children:he?o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1515",style:{display:"flex",justifyContent:"center",padding:"40px"},children:o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1516",className:"vg-spinner"})}):(()=>{if(!U)return A;const l=d.find(g=>g.annotations.some(w=>w._id===U));return l?l.annotations:A.filter(g=>g._id===U)})().map((l,g)=>o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1525",className:"vg-glassmorphism vg-animate-slide",style:{padding:"20px",marginBottom:"16px",border:"1px solid rgba(0,0,0,0.05)",background:"rgba(255,255,255,0.5)",animationDelay:`${g*.05}s`},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1536",style:{display:"flex",justifyContent:"space-between",marginBottom:"16px",alignItems:"center"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1537",style:{display:"flex",gap:"12px",alignItems:"center"},children:[o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1538",style:{fontSize:"12px",color:"#000000",fontWeight:600},children:vt(l.timestamp||l.createdAt||l.reference?.timestamp,t)}),l.url&&o.jsx(bt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1542",url:l.url,onHover:xe,style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"11px",color:"#64748b",background:"#f8fafc",padding:"2px 8px",borderRadius:"6px",border:"1px solid #e2e8f0",maxWidth:"220px"}})]}),l.status==="ready_for_review"?o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1561",className:"vg-badge",style:{backgroundColor:"#f0fdf4",color:"#16a34a",border:"1px solid #dcfce7"},children:[o.jsx(se,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1562",size:14})," ",r.readyForReview]}):o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1565",className:"vg-badge",style:{backgroundColor:"#fff7ed",color:"#ea580c",border:"1px solid #ffedd5"},children:[o.jsx(Ke,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1566",size:14})," ",r.pending]})]}),Ot===l._id?o.jsx("textarea",{className:"vg-textarea",value:_t,onChange:w=>Vt(w.target.value),rows:3,autoFocus:!0,style:{marginBottom:"16px"}}):o.jsx("p",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1581",style:{margin:"0 0 20px 0",fontSize:"16px",color:"#1e293b",lineHeight:1.6},children:l.message}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1584",style:{display:"flex",gap:"12px",justifyContent:"flex-end",borderTop:"1px solid #f1f5f9",paddingTop:"16px"},children:Ot===l._id?o.jsxs(o.Fragment,{children:[o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1587",className:"vg-button-primary vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:async()=>{try{(await fetch(`${a}/api/annotations/${l._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":n},body:JSON.stringify({message:_t})})).ok&&(He(null),ne(),e(r.updateSuccess,"success"))}catch{e(r.error,"error")}},children:r.save}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1609",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:()=>He(null),children:r.cancel})]}):o.jsxs(o.Fragment,{children:[o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1613",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:()=>{He(l._id),Vt(l.message)},children:[o.jsx(Bt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1621",size:14})," ",r.edit]}),o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1623",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px",animationDelay:"0.05s"},onClick:()=>{l.url&&(window.location.href=l.url)},children:[o.jsx(Qe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1630",size:14})," ",r.review]}),l.status==="pending"?o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1633",className:"vg-button-primary vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px",animationDelay:"0.1s"},onClick:()=>{$({title:r.markReadyConfirm,message:r.confirmMarkReady,type:"success",onConfirm:async()=>{try{(await fetch(`${a}/api/annotations/${l._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":n},body:JSON.stringify({status:"ready_for_review"})})).ok&&(ne(),e(r.updateSuccess,"success"))}catch{e(r.error,"error")}finally{$(null)}}})},children:[o.jsx(se,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1661",size:14})," ",r.markReady]}):o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1664",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px",animationDelay:"0.1s"},onClick:()=>{$({title:r.reopenConfirm,message:r.confirmReopen,type:"success",onConfirm:async()=>{try{(await fetch(`${a}/api/annotations/${l._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":n},body:JSON.stringify({status:"pending"})})).ok&&(ne(),e(r.updateSuccess,"success"))}catch{e(r.error,"error")}finally{$(null)}}})},children:[o.jsx(Yt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1692",size:14})," ",r.reopen]}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1695",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 12px",color:"#ef4444",borderColor:"#fee2e2",animationDelay:"0.15s"},onClick:()=>{$({title:r.deleteConfirm,message:r.confirmDelete,type:"danger",onConfirm:async()=>{try{(await fetch(`${a}/api/annotations/${l._id}`,{method:"DELETE",headers:{"x-api-key":n}})).ok&&(ne(),e(r.deleteSuccess,"success"))}catch{e(r.error,"error")}finally{$(null)}}})},children:o.jsx(et,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1722",size:16})})]})})]},l._id))})]})}),H&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1737",className:"vg-animate-fade",style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(11, 15, 25, 0.7)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:Le+100},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1742",className:"vg-glassmorphism vg-animate-slide",style:{padding:"40px",width:"420px",textAlign:"center",border:"1px solid rgba(255, 255, 255, 0.1)",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.5)"},children:[o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1749",style:{width:"64px",height:"64px",background:H.type==="danger"?"rgba(239, 68, 68, 0.1)":"rgba(99, 102, 241, 0.1)",borderRadius:"20px",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px",color:H.type==="danger"?"#ef4444":"#6366f1",transform:"rotate(-5deg)"},children:H.type==="danger"?o.jsx(et,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1758",size:32}):o.jsx(se,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1758",size:32})}),o.jsx("h3",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1760",style:{margin:"0 0 12px 0",fontSize:"20px",fontWeight:800,color:"#000000",letterSpacing:"-0.02em"},children:H.title}),o.jsx("p",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1761",style:{margin:"0 0 32px 0",fontSize:"15px",color:"#000000",lineHeight:1.6},children:H.message}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1762",style:{display:"flex",gap:"16px"},children:[o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1763",className:"vg-button-ghost",style:{flex:1,height:"44px"},onClick:()=>!te&&$(null),disabled:te,children:r.no}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1771",className:"vg-button-primary",style:{flex:1,height:"44px",backgroundColor:H.type==="danger"?"#ef4444":void 0,backgroundImage:H.type==="danger"?"none":void 0,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},disabled:te,onClick:async()=>{ge(!0);try{await H.onConfirm()}catch(l){console.error("Confirmation error:",l)}finally{ge(!1)}},children:te?o.jsx($t,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1796",size:18,className:"vg-animate-spin"}):r.yes})]})]})}),!i&&!D&&d.map((l,g)=>{const{rect:w,annotations:_,isModal:j}=l,v=_[0],x=_.length,b=_.some(k=>k.status==="ready_for_review"),F=_.some(k=>k.status!=="ready_for_review"),G=b&&F,z=b&&!F;return o.jsxs("div",{className:"vg-pin-container vg-animate-pop",style:{position:"fixed",top:w.top-20,left:w.left+w.width/2-16,cursor:"pointer",transition:"all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275)",zIndex:Br},onMouseEnter:k=>{window.innerHeight-w.bottom<250?Ve(Ue=>({...Ue,[l.id]:"vg-top"})):Ve(Ue=>({...Ue,[l.id]:""}))},onClick:()=>{Q(!0),le(v._id)},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1840",className:`vg-pin-tooltip ${_e[l.id]||""}`,style:{width:"280px",padding:"16px"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1841",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"12px"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1842",style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx(Se,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1843",size:14,color:"#6366f1"}),o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1844",style:{fontWeight:800,fontSize:"13px",color:"#0f172a"},children:[x," ",x===1?"Comentario":"Comentarios"]})]}),j&&o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1849",className:"vg-badge",style:{fontSize:"10px",background:"#fef3c7",color:"#92400e",border:"none"},children:"MODAL"})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1852",className:"vg-tooltip-scroll",style:{maxHeight:"180px",overflowY:"auto"},children:_.map((k,ae)=>o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1854",style:{padding:"10px 0",borderTop:ae===0?"none":"1px solid #f1f5f9",display:"flex",gap:"12px",alignItems:"flex-start"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1861",style:{flex:1,display:"flex",flexDirection:"column",gap:"4px"},children:[o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1862",style:{fontSize:"10px",fontWeight:600,color:"#64748b"},children:vt(k.timestamp||k.createdAt,t)}),k.url&&o.jsx(bt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1866",url:k.url,onHover:xe,style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"9px",color:"#6366f1",opacity:.8,background:"rgba(99, 102, 241, 0.05)",padding:"2px 6px",borderRadius:"4px",maxWidth:"120px"},tooltipStyle:{fontSize:"9px"}}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1884",style:{fontSize:"13px",color:"#1e293b",lineHeight:1.4,fontWeight:500},children:k.message.length>80?k.message.slice(0,80)+"...":k.message})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1888",style:{flexShrink:0,marginTop:"2px"},children:k.status==="ready_for_review"?o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1890",style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"8px",fontWeight:800,color:"#16a34a",background:"#f0fdf4",padding:"2px 6px",borderRadius:"6px",textTransform:"uppercase",border:"1px solid #dcfce7"},children:[o.jsx(se,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1903",size:10}),r.readyForReview]}):o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1907",style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"8px",fontWeight:800,color:"#ea580c",background:"#fff7ed",padding:"2px 6px",borderRadius:"6px",textTransform:"uppercase",border:"1px solid #ffedd5"},children:[o.jsx(Ke,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1920",size:10}),r.pending]})})]},k._id))})]}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1930",className:`vg-formal-pin ${z?"ready":G?"mixed":""} ${j?"modal-variant":""}`,style:{position:"relative"},children:[z?o.jsx(se,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1931",size:18}):j?o.jsx(Qe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1931",size:16}):o.jsx(Se,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1931",size:16}),x>1&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1934",className:"vg-pin-badge vg-animate-pop",children:x})]})]},`group-${l.id}`)}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1943",className:`vg-url-tooltip ${B?"visible":""} ${B?.direction==="bottom"?"vg-bottom":"vg-top"}`,style:{transform:B?`translate(-50%, ${B.direction==="top"?"-110%":"10%"})`:"translate(-50%, 0)",left:B?.x||0,top:B?.y||0},children:B?.url})]})})};function De(e,t,r){if(!t.endsWith(".tsx")&&!t.endsWith(".jsx")||t.includes("node_modules"))return e;const n=i=>i.replace(/\\/g,"/"),a=n(t).replace(n(r),"");return e.split(`
|
|
16
|
+
`).map((i,u)=>{const p=u+1;return i.replace(/(^|[^a-zA-Z0-9])<([a-zA-Z][a-zA-Z0-9\.]*)(?=[ \t\n\/\>])/g,(f,h,E)=>f.includes("data-source-path")||E==="Fragment"||E==="React.Fragment"?f:`${h}<${E} data-source-path="${a}:${p}"`)}).join(`
|
|
17
|
+
`)}function nn(){return{name:"vite-plugin-viewgate",enforce:"pre",transform(e,t){return{code:De(e,t,process.cwd()),map:null}}}}function an(e){const t=this.resourcePath;return t?(process.env.NODE_ENV,De(e,t,process.cwd())):e}N.ViewGate=Kt,N.ViewGateOverlay=kt,N.transformSourcePaths=De,N.useViewGate=rt,N.viewgateNextLoader=an,N.viewgatePlugin=nn,Object.defineProperty(N,Symbol.toStringTag,{value:"Module"})}));
|