viewgate-wrapper 1.10.13 → 1.10.14

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:var(--vg-primary-gradient);border:3px solid white;box-shadow:0 4px 12px #6366f166;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.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:12px 16px;border-radius:12px;background:#fff;color:#1e293b;width:240px;font-size:13px;box-shadow:0 10px 40px #00000026;opacity:0;pointer-events:none;transition:all .2s ease;border:1px solid #e2e8f0}.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}')),document.head.appendChild(r)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
2
- (function(I,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):(I=typeof globalThis<"u"?globalThis:I||self,m(I.ViewGateWrapper={},I.React,I.ReactDOM))})(this,(function(I,m,kt){"use strict";var xe={exports:{}},ce={};var We;function Rt(){if(We)return ce;We=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,a){var i=null;if(a!==void 0&&(i=""+a),s.key!==void 0&&(i=""+s.key),"key"in s){a={};for(var c in s)c!=="key"&&(a[c]=s[c])}else a=s;return s=a.ref,{$$typeof:e,type:r,key:i,ref:s!==void 0?s:null,props:a}}return ce.Fragment=t,ce.jsx=n,ce.jsxs=n,ce}var le={};var $e;function _t(){return $e||($e=1,process.env.NODE_ENV!=="production"&&(function(){function e(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===pe?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case P:return"Fragment";case H:return"Profiler";case F:return"StrictMode";case B:return"Suspense";case G:return"SuspenseList";case bt:return"Activity"}if(typeof l=="object")switch(typeof l.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),l.$$typeof){case T:return"Portal";case W:return l.displayName||"Context";case A:return(l._context.displayName||"Context")+".Consumer";case O:var x=l.render;return l=l.displayName,l||(l=x.displayName||x.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case $:return x=l.displayName||null,x!==null?x:e(l.type)||"Memo";case Ce:x=l._payload,l=l._init;try{return e(l(x))}catch{}}return null}function t(l){return""+l}function n(l){try{t(l);var x=!1}catch{x=!0}if(x){x=console;var S=x.error,R=typeof Symbol=="function"&&Symbol.toStringTag&&l[Symbol.toStringTag]||l.constructor.name||"Object";return S.call(x,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",R),t(l)}}function r(l){if(l===P)return"<>";if(typeof l=="object"&&l!==null&&l.$$typeof===Ce)return"<...>";try{var x=e(l);return x?"<"+x+">":"<...>"}catch{return"<...>"}}function s(){var l=ae.A;return l===null?null:l.getOwner()}function a(){return Error("react-stack-top-frame")}function i(l){if(Ee.call(l,"key")){var x=Object.getOwnPropertyDescriptor(l,"key").get;if(x&&x.isReactWarning)return!1}return l.key!==void 0}function c(l,x){function S(){se||(se=!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)",x))}S.isReactWarning=!0,Object.defineProperty(l,"key",{get:S,configurable:!0})}function p(){var l=e(this.type);return q[l]||(q[l]=!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.")),l=this.props.ref,l!==void 0?l:null}function u(l,x,S,R,oe,X){var j=S.ref;return l={$$typeof:v,type:l,key:x,props:S,_owner:R},(j!==void 0?j:null)!==null?Object.defineProperty(l,"ref",{enumerable:!1,get:p}):Object.defineProperty(l,"ref",{enumerable:!1,value:null}),l._store={},Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(l,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(l,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:oe}),Object.defineProperty(l,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l}function b(l,x,S,R,oe,X){var j=x.children;if(j!==void 0)if(R)if(ke(j)){for(R=0;R<j.length;R++)f(j[R]);Object.freeze&&Object.freeze(j)}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 f(j);if(Ee.call(x,"key")){j=e(l);var V=Object.keys(x).filter(function(ze){return ze!=="key"});R=0<V.length?"{key: someKey, "+V.join(": ..., ")+": ...}":"{key: someKey}",Re[j+R]||(V=0<V.length?"{"+V.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
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:var(--vg-primary-gradient);border:3px solid white;box-shadow:0 4px 12px #6366f166;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.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}')),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
+ (function(z,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],p):(z=typeof globalThis<"u"?globalThis:z||self,p(z.ViewGateWrapper={},z.React,z.ReactDOM))})(this,(function(z,p,kt){"use strict";var ye={exports:{}},de={};var We;function Rt(){if(We)return de;We=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,a){var i=null;if(a!==void 0&&(i=""+a),s.key!==void 0&&(i=""+s.key),"key"in s){a={};for(var c in s)c!=="key"&&(a[c]=s[c])}else a=s;return s=a.ref,{$$typeof:e,type:r,key:i,ref:s!==void 0?s:null,props:a}}return de.Fragment=t,de.jsx=n,de.jsxs=n,de}var ue={};var $e;function jt(){return $e||($e=1,process.env.NODE_ENV!=="production"&&(function(){function e(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===pe?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case P:return"Fragment";case $:return"Profiler";case W:return"StrictMode";case Z:return"Suspense";case G:return"SuspenseList";case bt:return"Activity"}if(typeof l=="object")switch(typeof l.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),l.$$typeof){case O:return"Portal";case U:return l.displayName||"Context";case A:return(l._context.displayName||"Context")+".Consumer";case T:var x=l.render;return l=l.displayName,l||(l=x.displayName||x.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case Y:return x=l.displayName||null,x!==null?x:e(l.type)||"Memo";case Ee:x=l._payload,l=l._init;try{return e(l(x))}catch{}}return null}function t(l){return""+l}function n(l){try{t(l);var x=!1}catch{x=!0}if(x){x=console;var k=x.error,R=typeof Symbol=="function"&&Symbol.toStringTag&&l[Symbol.toStringTag]||l.constructor.name||"Object";return k.call(x,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",R),t(l)}}function r(l){if(l===P)return"<>";if(typeof l=="object"&&l!==null&&l.$$typeof===Ee)return"<...>";try{var x=e(l);return x?"<"+x+">":"<...>"}catch{return"<...>"}}function s(){var l=oe.A;return l===null?null:l.getOwner()}function a(){return Error("react-stack-top-frame")}function i(l){if(ke.call(l,"key")){var x=Object.getOwnPropertyDescriptor(l,"key").get;if(x&&x.isReactWarning)return!1}return l.key!==void 0}function c(l,x){function k(){ie||(ie=!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)",x))}k.isReactWarning=!0,Object.defineProperty(l,"key",{get:k,configurable:!0})}function m(){var l=e(this.type);return q[l]||(q[l]=!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.")),l=this.props.ref,l!==void 0?l:null}function u(l,x,k,R,M,J){var j=k.ref;return l={$$typeof:S,type:l,key:x,props:k,_owner:R},(j!==void 0?j:null)!==null?Object.defineProperty(l,"ref",{enumerable:!1,get:m}):Object.defineProperty(l,"ref",{enumerable:!1,value:null}),l._store={},Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(l,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(l,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:M}),Object.defineProperty(l,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:J}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l}function E(l,x,k,R,M,J){var j=x.children;if(j!==void 0)if(R)if(Re(j)){for(R=0;R<j.length;R++)f(j[R]);Object.freeze&&Object.freeze(j)}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 f(j);if(ke.call(x,"key")){j=e(l);var F=Object.keys(x).filter(function(B){return B!=="key"});R=0<F.length?"{key: someKey, "+F.join(": ..., ")+": ...}":"{key: someKey}",je[j+R]||(F=0<F.length?"{"+F.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} />`,R,j,V,j),Re[j+R]=!0)}if(j=null,S!==void 0&&(n(S),j=""+S),i(x)&&(n(x.key),j=""+x.key),"key"in x){S={};for(var fe in x)fe!=="key"&&(S[fe]=x[fe])}else S=x;return j&&c(S,typeof l=="function"?l.displayName||l.name||"Unknown":l),u(l,j,S,s(),oe,X)}function f(l){w(l)?l._store&&(l._store.validated=1):typeof l=="object"&&l!==null&&l.$$typeof===Ce&&(l._payload.status==="fulfilled"?w(l._payload.value)&&l._payload.value._store&&(l._payload.value._store.validated=1):l._store&&(l._store.validated=1))}function w(l){return typeof l=="object"&&l!==null&&l.$$typeof===v}var h=m,v=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),F=Symbol.for("react.strict_mode"),H=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),W=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),Ce=Symbol.for("react.lazy"),bt=Symbol.for("react.activity"),pe=Symbol.for("react.client.reference"),ae=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ee=Object.prototype.hasOwnProperty,ke=Array.isArray,U=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(l){return l()}};var se,q={},me=h.react_stack_bottom_frame.bind(h,a)(),Y=U(r(a)),Re={};le.Fragment=P,le.jsx=function(l,x,S){var R=1e4>ae.recentlyCreatedOwnerStacks++;return b(l,x,S,!1,R?Error("react-stack-top-frame"):me,R?U(r(l)):Y)},le.jsxs=function(l,x,S){var R=1e4>ae.recentlyCreatedOwnerStacks++;return b(l,x,S,!0,R?Error("react-stack-top-frame"):me,R?U(r(l)):Y)}})()),le}var Be;function jt(){return Be||(Be=1,process.env.NODE_ENV==="production"?xe.exports=Rt():xe.exports=_t()),xe.exports}var o=jt();const Ot=({children:e})=>{const t=m.useRef(null),[n,r]=m.useState(null);return m.useEffect(()=>{if(t.current&&!t.current.shadowRoot){const s=t.current.attachShadow({mode:"open"});document.querySelectorAll("style[data-vite-dev-id], style:not([data-vite-dev-id])").forEach(c=>{(c.textContent?.includes(".vg-")||c.textContent?.includes("--vg-"))&&s.appendChild(c.cloneNode(!0))});const i=document.createElement("link");i.rel="stylesheet",i.href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800;900&display=swap",s.appendChild(i),r(s)}},[]),o.jsx("div",{"data-source-path":"/src/components/ShadowRootWrapper.tsx:38",ref:t,id:"viewgate-shadow-host",children:n&&kt.createPortal(e,n)})};const Ue=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const Tt=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 Ye=e=>{const t=Vt(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Pt={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 At=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const Gt=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:a,iconNode:i,...c},p)=>m.createElement("svg",{ref:p,...Pt,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Ue("lucide",s),...!a&&!At(c)&&{"aria-hidden":"true"},...c},[...i.map(([u,b])=>m.createElement(u,b)),...Array.isArray(a)?a:[a]]));const N=(e,t)=>{const n=m.forwardRef(({className:r,...s},a)=>m.createElement(Gt,{ref:a,iconNode:t,className:Ue(`lucide-${Tt(Ye(e))}`,`lucide-${e}`,r),...s}));return n.displayName=Ye(e),n};const Nt=N("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 te=N("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const Xe=N("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);const Je=N("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=N("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=N("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 Mt=N("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const _e=N("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 It=N("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 zt=N("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 Dt=N("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 Ft=N("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=N("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 je=N("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Ht={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},Oe="viewgate_enabled",Wt=()=>typeof window>"u"?!1:new URLSearchParams(window.location.search).has("viewgate")?(sessionStorage.setItem(Oe,"true"),!0):sessionStorage.getItem(Oe)==="true",$t=({children:e,language:t="es",apiKey:n,baseUrl:r="https://view-gate.vercel.app"})=>{const[s,a]=m.useState(!1),[i,c]=m.useState([]);m.useEffect(()=>{a(Wt())},[]);const p=()=>{if(sessionStorage.removeItem(Oe),a(!1),typeof window<"u"){const f=new URL(window.location.href);f.searchParams.delete("viewgate"),window.history.replaceState({},"",f.toString())}},u=(f,w)=>{const h=Date.now();c(v=>[...v,{id:h,message:f,type:w}]),setTimeout(()=>{c(v=>v.filter(T=>T.id!==h))},4e3)},b=Ht[t];return o.jsxs(Qe.Provider,{"data-source-path":"/src/components/ViewGateProvider.tsx:248",value:{addToast:u,language:t,t:b,apiKey:n,baseUrl:r,disableViewGate:p,hasActiveToasts:i.length>0},children:[e,s&&o.jsx(Ot,{"data-source-path":"/src/components/ViewGateProvider.tsx:259",children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:260",className:"vg-container",children:[o.jsx(vt,{"data-source-path":"/src/components/ViewGateProvider.tsx:261"}),o.jsx("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:262",className:"vg-toasts",style:{zIndex:2147483646},children:i.map(f=>o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:264",className:`vg-toast vg-animate-slide ${f.type}`,children:[f.type==="success"?o.jsx(te,{"data-source-path":"/src/components/ViewGateProvider.tsx:266",size:24,color:"#22c55e"}):o.jsx(Nt,{"data-source-path":"/src/components/ViewGateProvider.tsx:268",size:24,color:"#ef4444"}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:270",children:[o.jsx("strong",{"data-source-path":"/src/components/ViewGateProvider.tsx:271",style:{display:"block",fontSize:"13px",color:"#0f172a",textTransform:"uppercase",marginBottom:"2px"},children:f.type==="success"?b.successHeader:b.errorHeader}),o.jsx("span",{"data-source-path":"/src/components/ViewGateProvider.tsx:274",style:{fontSize:"14px",color:"#000000"},children:f.message})]})]},f.id))})]})})]})};function Bt(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"),s=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(s),t&&(r.href=t),s.href=e,s.href}const Ut=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Z(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}let ne=null;function et(e={}){return ne||(e.includeStyleProperties?(ne=e.includeStyleProperties,ne):(ne=Z(window.getComputedStyle(document.documentElement)),ne))}function we(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function Yt(e){const t=we(e,"border-left-width"),n=we(e,"border-right-width");return e.clientWidth+t+n}function Xt(e){const t=we(e,"border-top-width"),n=we(e,"border-bottom-width");return e.clientHeight+t+n}function tt(e,t={}){const n=t.width||Yt(e),r=t.height||Xt(e);return{width:n,height:r}}function Jt(){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 z=16384;function Zt(e){(e.width>z||e.height>z)&&(e.width>z&&e.height>z?e.width>e.height?(e.height*=z/e.width,e.width=z):(e.width*=z/e.height,e.height=z):e.width>z?(e.height*=z/e.width,e.width=z):(e.width*=z/e.height,e.height=z))}function ve(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 Kt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Qt(e,t,n){const r="http://www.w3.org/2000/svg",s=document.createElementNS(r,"svg"),a=document.createElementNS(r,"foreignObject");return s.setAttribute("width",`${t}`),s.setAttribute("height",`${n}`),s.setAttribute("viewBox",`0 0 ${t} ${n}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),s.appendChild(a),a.appendChild(e),Kt(s)}const L=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||L(n,t)};function qt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function en(e,t){return et(t).map(n=>{const r=e.getPropertyValue(n),s=e.getPropertyPriority(n);return`${n}: ${r}${s?" !important":""};`}).join(" ")}function tn(e,t,n,r){const s=`.${e}:${t}`,a=n.cssText?qt(n):en(n,r);return document.createTextNode(`${s}{${a}}`)}function nt(e,t,n,r){const s=window.getComputedStyle(e,n),a=s.getPropertyValue("content");if(a===""||a==="none")return;const i=Ut();try{t.className=`${t.className} ${i}`}catch{return}const c=document.createElement("style");c.appendChild(tn(i,n,s,r)),t.appendChild(c)}function nn(e,t,n){nt(e,t,":before",n),nt(e,t,":after",n)}const rt="application/font-woff",at="image/jpeg",rn={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 an(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Te(e){const t=an(e).toLowerCase();return rn[t]||""}function sn(e){return e.split(/,/)[1]}function Ve(e){return e.search(/^(data:)/)!==-1}function on(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 s=await r.blob();return new Promise((a,i)=>{const c=new FileReader;c.onerror=i,c.onloadend=()=>{try{a(n({res:r,result:c.result}))}catch(p){i(p)}},c.readAsDataURL(s)})}const Pe={};function cn(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 Ae(e,t,n){const r=cn(e,t,n.includeQueryParams);if(Pe[r]!=null)return Pe[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let s;try{const a=await st(e,n.fetchRequestInit,({res:i,result:c})=>(t||(t=i.headers.get("Content-Type")||""),sn(c)));s=on(a,t)}catch(a){s=n.imagePlaceholder||"";let i=`Failed to fetch resource: ${e}`;a&&(i=typeof a=="string"?a:a.message),i&&console.warn(i)}return Pe[r]=s,s}async function ln(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ve(t)}async function dn(e,t){if(e.currentSrc){const a=document.createElement("canvas"),i=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,i?.drawImage(e,0,0,a.width,a.height);const c=a.toDataURL();return ve(c)}const n=e.poster,r=Te(n),s=await Ae(n,r,t);return ve(s)}async function un(e,t){var n;try{if(!((n=e?.contentDocument)===null||n===void 0)&&n.body)return await be(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function pn(e,t){return L(e,HTMLCanvasElement)?ln(e):L(e,HTMLVideoElement)?dn(e,t):L(e,HTMLIFrameElement)?un(e,t):e.cloneNode(ot(e))}const mn=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ot=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function fn(e,t,n){var r,s;if(ot(t))return t;let a=[];return mn(e)&&e.assignedNodes?a=Z(e.assignedNodes()):L(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?a=Z(e.contentDocument.body.childNodes):a=Z(((s=e.shadowRoot)!==null&&s!==void 0?s:e).childNodes),a.length===0||L(e,HTMLVideoElement)||await a.reduce((i,c)=>i.then(()=>be(c,n)).then(p=>{p&&t.appendChild(p)}),Promise.resolve()),t}function hn(e,t,n){const r=t.style;if(!r)return;const s=window.getComputedStyle(e);s.cssText?(r.cssText=s.cssText,r.transformOrigin=s.transformOrigin):et(n).forEach(a=>{let i=s.getPropertyValue(a);a==="font-size"&&i.endsWith("px")&&(i=`${Math.floor(parseFloat(i.substring(0,i.length-2)))-.1}px`),L(e,HTMLIFrameElement)&&a==="display"&&i==="inline"&&(i="block"),a==="d"&&t.getAttribute("d")&&(i=`path(${t.getAttribute("d")})`),r.setProperty(a,i,s.getPropertyPriority(a))})}function gn(e,t){L(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),L(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function yn(e,t){if(L(e,HTMLSelectElement)){const r=Array.from(t.children).find(s=>e.value===s.getAttribute("value"));r&&r.setAttribute("selected","")}}function xn(e,t,n){return L(t,Element)&&(hn(e,t,n),nn(e,t,n),gn(e,t),yn(e,t)),t}async function wn(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let a=0;a<n.length;a++){const c=n[a].getAttribute("xlink:href");if(c){const p=e.querySelector(c),u=document.querySelector(c);!p&&u&&!r[c]&&(r[c]=await be(u,t,!0))}}const s=Object.values(r);if(s.length){const a="http://www.w3.org/1999/xhtml",i=document.createElementNS(a,"svg");i.setAttribute("xmlns",a),i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.overflow="hidden",i.style.display="none";const c=document.createElementNS(a,"defs");i.appendChild(c);for(let p=0;p<s.length;p++)c.appendChild(s[p]);e.appendChild(i)}return e}async function be(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>pn(r,t)).then(r=>fn(e,r,t)).then(r=>xn(e,r,t)).then(r=>wn(r,t))}const it=/url\((['"]?)([^'"]+?)\1\)/g,vn=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,bn=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Sn(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function Cn(e){const t=[];return e.replace(it,(n,r,s)=>(t.push(s),n)),t.filter(n=>!Ve(n))}async function En(e,t,n,r,s){try{const a=n?Bt(t,n):t,i=Te(t);let c;return s||(c=await Ae(a,i,r)),e.replace(Sn(t),`$1${c}$3`)}catch{}return e}function kn(e,{preferredFontFormat:t}){return t?e.replace(bn,n=>{for(;;){const[r,,s]=vn.exec(n)||[];if(!s)return"";if(s===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=kn(e,n);return Cn(r).reduce((a,i)=>a.then(c=>En(c,i,t,n)),Promise.resolve(r))}async function re(e,t,n){var r;const s=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(s){const a=await lt(s,null,n);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function Rn(e,t){await re("background",e,t)||await re("background-image",e,t),await re("mask",e,t)||await re("-webkit-mask",e,t)||await re("mask-image",e,t)||await re("-webkit-mask-image",e,t)}async function _n(e,t){const n=L(e,HTMLImageElement);if(!(n&&!Ve(e.src))&&!(L(e,SVGImageElement)&&!Ve(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,s=await Ae(r,Te(r),t);await new Promise((a,i)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...p)=>{try{a(t.onImageErrorHandler(...p))}catch(u){i(u)}}:i;const c=e;c.decode&&(c.decode=a),c.loading==="lazy"&&(c.loading="eager"),n?(e.srcset="",e.src=s):e.href.baseVal=s})}async function jn(e,t){const r=Z(e.childNodes).map(s=>dt(s,t));await Promise.all(r).then(()=>e)}async function dt(e,t){L(e,Element)&&(await Rn(e,t),await _n(e,t),await jn(e,t))}function On(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(s=>{n[s]=r[s]}),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,a=(n.match(/url\([^)]+\)/g)||[]).map(async i=>{let c=i.replace(r,"$1");return c.startsWith("https://")||(c=new URL(c,e.url).href),st(c,t.fetchRequestInit,({result:p})=>(n=n.replace(i,`url(${p})`),[i,p]))});return Promise.all(a).then(()=>n)}function ft(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const s=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const p=s.exec(r);if(p===null)break;t.push(p[0])}r=r.replace(s,"");const a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",c=new RegExp(i,"gi");for(;;){let p=a.exec(r);if(p===null){if(p=c.exec(r),p===null)break;a.lastIndex=c.lastIndex}else c.lastIndex=a.lastIndex;t.push(p[0])}return t}async function Tn(e,t){const n=[],r=[];return e.forEach(s=>{if("cssRules"in s)try{Z(s.cssRules||[]).forEach((a,i)=>{if(a.type===CSSRule.IMPORT_RULE){let c=i+1;const p=a.href,u=pt(p).then(b=>mt(b,t)).then(b=>ft(b).forEach(f=>{try{s.insertRule(f,f.startsWith("@import")?c+=1:s.cssRules.length)}catch(w){console.error("Error inserting rule from remote css",{rule:f,error:w})}})).catch(b=>{console.error("Error loading remote css",b.toString())});r.push(u)}})}catch(a){const i=e.find(c=>c.href==null)||document.styleSheets[0];s.href!=null&&r.push(pt(s.href).then(c=>mt(c,t)).then(c=>ft(c).forEach(p=>{i.insertRule(p,i.cssRules.length)})).catch(c=>{console.error("Error loading remote stylesheet",c)})),console.error("Error inlining remote css file",a)}}),Promise.all(r).then(()=>(e.forEach(s=>{if("cssRules"in s)try{Z(s.cssRules||[]).forEach(a=>{n.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${s.href}`,a)}}),n))}function Vn(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>ct(t.style.getPropertyValue("src")))}async function Pn(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=Z(e.ownerDocument.styleSheets),r=await Tn(n,t);return Vn(r)}function ht(e){return e.trim().replace(/["']/g,"")}function An(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(a=>{t.add(ht(a))}),Array.from(r.children).forEach(a=>{a instanceof HTMLElement&&n(a)})}return n(e),t}async function Gn(e,t){const n=await Pn(e,t),r=An(e);return(await Promise.all(n.filter(a=>r.has(ht(a.style.fontFamily))).map(a=>{const i=a.parentStyleSheet?a.parentStyleSheet.href:null;return lt(a.cssText,i,t)}))).join(`
8
- `)}async function Nn(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Gn(e,t);if(n){const r=document.createElement("style"),s=document.createTextNode(n);r.appendChild(s),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function Ln(e,t={}){const{width:n,height:r}=tt(e,t),s=await be(e,t,!0);return await Nn(s,t),await dt(s,t),On(s,t),await Qt(s,n,r)}async function Mn(e,t={}){const{width:n,height:r}=tt(e,t),s=await Ln(e,t),a=await ve(s),i=document.createElement("canvas"),c=i.getContext("2d"),p=t.pixelRatio||Jt(),u=t.canvasWidth||n,b=t.canvasHeight||r;return i.width=u*p,i.height=b*p,t.skipAutoScale||Zt(i),i.style.width=`${u}`,i.style.height=`${b}`,t.backgroundColor&&(c.fillStyle=t.backgroundColor,c.fillRect(0,0,i.width,i.height)),c.drawImage(a,0,0,i.width,i.height),i}async function gt(e,t={}){return(await Mn(e,t)).toDataURL()}const Se=2147483647,Ge=Se,Ne=2e6,In=Se-10,zn=Se-5,Dn=Se-15,de="data-vg-pin-id",Fn=()=>{const e=window.innerWidth;return e<768?"mobile":e<1024?"tablet":"desktop"},Hn=e=>{let t=0;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t=(t<<5)-t+r,t=t&t}return Math.abs(t).toString(16)},Wn=(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""}},$n=e=>{const t=(e.innerText||"").slice(0,30).trim(),n={tag:e.tagName.toLowerCase(),classHash:Hn(e.className),textSnippet:t,parentTag:e.parentElement?.tagName.toLowerCase(),neighborCount:e.parentElement?.children.length||0},r=e.getAttribute("aria-label");r&&(n.ariaLabel=r);const s=e.getAttribute("role");s&&(n.role=s);const a=e.getAttribute("name");return a&&(n.name=a),n},Bn=(()=>{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 a=t.fillStyle;if(a&&!a.includes("oklch")&&!a.includes("oklab"))return a}const r=document.createElement("div");r.style.color=n,document.body.appendChild(r);const s=getComputedStyle(r).color;return document.body.removeChild(r),s&&!s.includes("oklch")?s:"rgb(0,0,0)"}catch{return"rgb(0,0,0)"}return n}})(),yt=(e,t,n,r)=>new Promise(s=>{const a=new Image;a.onload=()=>{const i=document.createElement("canvas"),c=window.devicePixelRatio||1,p=t.width+n*2,u=t.height+n*2;i.width=p*c,i.height=u*c;const b=i.getContext("2d");if(b){b.scale(c,c);let f=(t.left-n)*r,w=(t.top-n)*r,h=p*r,v=u*r,T=0,P=0,F=p,H=u;f<0&&(T=Math.abs(f)/r,h+=f,F-=T,f=0),f+h>a.width&&(h=a.width-f,F=h/r),w<0&&(P=Math.abs(w)/r,v+=w,H-=P,w=0),w+v>a.height&&(v=a.height-w,H=v/r),b.fillStyle="#ffffff",b.fillRect(0,0,p,u),h>0&&v>0&&b.drawImage(a,f,w,h,v,T,P,F,H)}s(i.toDataURL("image/png"))},a.onerror=()=>s(""),a.src=e}),Un=e=>{const t=window.getComputedStyle(e),n={};return["display","position","margin","padding","font-size","color","background-color","width","height","z-index"].forEach(s=>{const a=t.getPropertyValue(s);n[s]=Bn(a)}),n},Yn=e=>{const n=Object.keys(e).find(a=>a.startsWith("__reactFiber$")||a.startsWith("__reactInternalInstance$"));if(!n)return"";const r=[];let s=e[n];for(;s;){const a=s.type;if(typeof a=="function"){const i=a.displayName||a.name;i&&!i.includes("ViewGate")&&!r.includes(i)&&r.unshift(i)}s=s.return}return r.join(" > ")||"Generic Component"},xt=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 a=120;return n.width<a&&n.height<a||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"))},ue=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 s=window.getComputedStyle(n);if(s.display==="none"||s.visibility==="hidden"||s.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)},Le=(e,t=document)=>{const n=t.querySelector(e);if(n)return n;const r=t.querySelectorAll("*");for(const s of Array.from(r)){const a=s.shadowRoot;if(a){const i=Le(e,a);if(i)return i}}return null},wt=(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},Xn=e=>{if(!e.tag)return null;const t=document.getElementsByTagName(e.tag);let n=null,r=0;for(let s=0;s<t.length;s++){const a=t[s];let i=0;const c=a.getAttribute("placeholder");e.attributes?.placeholder&&c===e.attributes.placeholder?i+=6:c&&e.attributes?.placeholder&&c.includes(e.attributes.placeholder)&&(i+=2),a.innerText?.trim()===e.text.trim()?i+=5:a.innerText?.includes(e.text.slice(0,20))&&(i+=3),e.fingerprint?.classHash&&a.className.includes(e.fingerprint.classHash)&&(i+=2),e.fingerprint?.ariaLabel&&a.getAttribute("aria-label")===e.fingerprint.ariaLabel&&(i+=3),e.fingerprint?.role&&a.getAttribute("role")===e.fingerprint.role&&(i+=2),e.parentContext&&(a.parentElement?.innerText||"").includes(e.parentContext.slice(0,30))&&(i+=2),e.fingerprint?.neighborCount===a.parentElement?.children.length&&(i+=1),e.fingerprint?.parentTag===a.parentElement?.tagName.toLowerCase()&&(i+=1),i>r&&i>=7&&(r=i,n=a)}return n},Jn=(e,t)=>{if(t){const r=Array.from(document.querySelectorAll(`[${de}="${t}"]`));if(r.length>0){const s=r.find(a=>!(!ue(a)||e.metadata?.isModal&&!a.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content')));return s?(r.forEach(a=>{a!==s&&a.removeAttribute(de)}),s):null}}let n=Le(e.selector);if(n&&ue(n))if(e.metadata?.isModal&&!n.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content'))n=null;else return n;if(e.fallbackSelectors){for(const r of e.fallbackSelectors)if(n=Le(r),n&&ue(n)){if(e.metadata?.isModal&&!n.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content'))continue;return n}}return n=Xn(e),n&&ue(n)?e.metadata?.isModal&&!n.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content')?null:n:null},Me=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}),Zn=e=>{const t=e.parentElement;if(!t)return;const n=Array.from(t.children).filter(i=>i!==e).slice(0,5).map(i=>Me(i)),r=Array.from(t.children),s=r.indexOf(e);let a="middle";return s===0&&(a="start"),s===r.length-1&&(a="end"),{target:{...Me(e),location:`${a} of ${t.tagName.toLowerCase()}`},parent:Me(t),siblings:n}},Kn=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),s=[],a=[],i=f=>{const w=[];let h=f;for(;h&&h.nodeType===Node.ELEMENT_NODE;){let v=h.nodeName.toLowerCase();a.unshift(v);const T=h.id&&!h.id.startsWith("__")?h.id:null;T&&s.push(`#${T}`);const P=h.getAttribute("data-testid")||h.getAttribute("data-qa");P&&s.push(`[data-testid="${P}"]`);const F=h.getAttribute("placeholder"),H=h.getAttribute("aria-label"),A=h.getAttribute("role"),W=h.getAttribute("name"),O=h.getAttribute("title");if(P){v=`[${h.hasAttribute("data-testid")?"data-testid":"data-qa"}="${P}"]`,w.unshift(v);break}else if(T){v="#"+T,w.unshift(v);break}else if(F){v=`${h.localName}[placeholder="${F}"]`,w.unshift(v);break}else if(H){v=`${h.localName}[aria-label="${H}"]`,w.unshift(v);break}else if(A){v=`${h.localName}[role="${A}"]`,w.unshift(v);break}else if(W){v=`${h.localName}[name="${W}"]`,w.unshift(v);break}else if(O){v=`${h.localName}[title="${O}"]`,w.unshift(v);break}else{let B=h,G=1;for(;B.previousElementSibling;)B=B.previousElementSibling,B.nodeName.toLowerCase()===h.nodeName.toLowerCase()&&G++;G>1&&(v+=`:nth-of-type(${G})`)}w.unshift(v),h=h.parentElement}return w.join(" > ")},c=xt(e.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content')),p=i(e),u={};["placeholder","aria-label","name","type","alt","title","value","role"].forEach(f=>{const w=e.getAttribute(f);w&&(u[f]=w)});const b=`${e.tagName.toLowerCase()}-${(e.innerText||"").slice(0,20).replace(/\s+/g,"_")}-${p.split(" > ").slice(-1)}`;return{tag:e.tagName.toLowerCase(),id:e.id||"",classes:e.className||"",text:(e.innerText||"").slice(0,100).trim(),selector:p,outerHtml:e.outerHTML,parentContext:(e.parentElement?.innerText||"").slice(0,150).trim(),componentPath:r,signature:b,source:t,attributes:u,fallbackSelectors:[...new Set(s)].slice(0,5),domPath:a.slice(-10),viewportSize:{width:window.innerWidth,height:window.innerHeight},uiContext:Zn(e),fingerprint:$n(e),metadata:{hint:`Edit ${t.split(":")[0]} at line ${t.split(":")[1]||"?"}`,computedStyles:Un(e),viewportBreakpoint:Fn(),outerHtml:e.outerHTML.slice(0,1500),scrollPosition:{x:window.scrollX,y:window.scrollY},isModal:c}}},vt=()=>{const{addToast:e,language:t,t:n,apiKey:r,baseUrl:s,disableViewGate:a,hasActiveToasts:i}=qe(),[c,p]=m.useState(!1),[u,b]=m.useState(null),[f,w]=m.useState(null),[h,v]=m.useState(""),[T,P]=m.useState(!1),[F,H]=m.useState(!1),[A,W]=m.useState(!1),[O,B]=m.useState([]),[G,$]=m.useState(null),[Ce,bt]=m.useState(!1),[pe,ae]=m.useState(!1),[Ee,ke]=m.useState({}),[U,se]=m.useState(null),[q,me]=m.useState(!1),[Y,Re]=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}}),[l,x]=m.useState(!1),S=m.useRef(null),[R,oe]=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}}),[X,j]=m.useState(!1),V=m.useRef(null),fe=d=>{d.preventDefault(),d.stopPropagation();const g=d.currentTarget.parentElement?.getBoundingClientRect();g&&(x(!0),S.current={x:d.clientX,y:d.clientY,top:Y.top,right:Y.right,width:g.width,height:g.height})},ze=d=>{d.preventDefault(),d.stopPropagation();const g=d.currentTarget.parentElement?.getBoundingClientRect();g&&(j(!0),V.current={x:d.clientX,y:d.clientY,bottom:R.bottom,right:R.right,width:g.width,height:g.height})};m.useEffect(()=>{if(!l&&!X)return;const d=y=>{if(l&&S.current){const M=y.clientX-S.current.x,C=y.clientY-S.current.y;let E=S.current.top+C,k=S.current.right-M;const _=10;E=Math.max(_,Math.min(window.innerHeight-S.current.height-_,E)),k=Math.max(_,Math.min(window.innerWidth-S.current.width-_,k)),Re({top:E,right:k})}if(X&&V.current){const M=y.clientX-V.current.x,C=y.clientY-V.current.y;let E=V.current.bottom-C,k=V.current.right-M;const _=10;E=Math.max(_,Math.min(window.innerHeight-V.current.height-_,E)),k=Math.max(_,Math.min(window.innerWidth-V.current.width-_,k)),oe({bottom:E,right:k})}},g=()=>{l&&(x(!1),localStorage.setItem("vg-exit-pos",JSON.stringify(Y)),S.current=null),X&&(j(!1),localStorage.setItem("vg-bar-pos",JSON.stringify(R)),V.current=null)};return window.addEventListener("mousemove",d),window.addEventListener("mouseup",g),()=>{window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",g)}},[l,X,Y,R]);const[St,De]=m.useState(null),[Ct,Et]=m.useState(""),[er,tr]=m.useState({}),ie=m.useRef(null),he=m.useRef(null),ge=m.useCallback(()=>{he.current||(he.current=requestAnimationFrame(()=>{const d={},y=Array.from(document.querySelectorAll('[role="dialog"], [aria-modal="true"], .modal, .modal-content')).find(C=>xt(C)&&ue(C)),M=!!y;O.forEach(C=>{if(!C.reference)return;const E=Jn(C.reference,C._id),k=!!C.reference.metadata?.isModal;if(E){const _=E.getAttribute(de);_?_!==C._id&&(console.warn(`Element already tagged with ${_}, skipping ${C._id}`),_.length<10&&E.setAttribute(de,C._id)):E.setAttribute(de,C._id);let J=!1;if(M?J=y.contains(E):J=!k,!J)return;const D=E.getBoundingClientRect(),ye=D.left+D.width/2,K=D.top+D.height/2;if(ye>=0&&ye<=window.innerWidth&&K>=0&&K<=window.innerHeight){const Q=document.elementFromPoint(ye,K);if(Q&&!E.contains(Q)&&!ie.current?.contains(Q))return}d[C._id]={top:D.top+window.scrollY,left:D.left+window.scrollX,width:D.width,isModal:k}}}),tr(d),he.current=null}))},[O]),ee=m.useCallback(async()=>{if(r){ae(!0);try{const d=await fetch(`${s}/api/annotations`,{headers:{"x-api-key":r}});if(d.ok){const M=((await d.json()).data||[]).reduce((C,E)=>C.find(_=>_._id===E._id)?C:C.concat([E]),[]);B(M)}}catch(d){console.error("Failed to fetch annotations",d)}finally{ae(!1)}}},[r,s]);m.useEffect(()=>{A&&O.length===0&&!pe&&W(!1)},[A,O.length,pe]),m.useEffect(()=>{if(!c&&O.length>0){ge();const d=new MutationObserver(()=>ge()),g=new ResizeObserver(()=>ge()),y=()=>ge();return d.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}),g.observe(document.documentElement),window.addEventListener("scroll",y,!0),()=>{d.disconnect(),g.disconnect(),window.removeEventListener("scroll",y,!0),he.current&&cancelAnimationFrame(he.current)}}},[c,O.length,ge]),m.useEffect(()=>{ee()},[ee]),m.useEffect(()=>{ie.current=document.getElementById("viewgate-shadow-host")},[]);const Fe=m.useCallback(d=>{if(!c||f)return;const g=wt(d.clientX,d.clientY);if(!g||ie.current?.contains(g)||g.closest(".vg-no-capture")){b(null);return}const y=g.getBoundingClientRect();b({tag:g.tagName.toLowerCase(),source:g.getAttribute("data-source-path")||"unknown:0",rect:y,element:g,previewText:(g.innerText||"").slice(0,100)||(g.getAttribute("placeholder")||"").slice(0,100)||g.tagName.toLowerCase(),semanticReference:{...Kn(g),normalizedOffset:{x:(d.clientX-y.left)/y.width,y:(d.clientY-y.top)/y.height}}})},[c,f]),He=m.useCallback(async d=>{if(!c||f)return;const g=wt(d.clientX,d.clientY);if(!(!g||ie.current?.contains(g)||g.closest(".vg-no-capture"))&&u){d.preventDefault(),d.stopPropagation(),H(!0);try{const C=window.scrollX,E=window.scrollY,k=await gt(document.documentElement,{pixelRatio:1.5,cacheBust:!0,width:window.innerWidth,height:window.innerHeight,backgroundColor:"#ffffff",style:{transform:`scale(${1/window.devicePixelRatio}) translate(-${C}px, -${E}px)`,transformOrigin:"top left"},filter:K=>{const Q=K;return!(ie.current?.contains(Q)||Q.id==="viewgate-ui")}}),_=u.element.getBoundingClientRect(),J=_.top>=0&&_.left>=0&&_.bottom<=window.innerHeight&&_.right<=window.innerWidth;let D="";if(J&&_.width>0&&_.height>0)D=await yt(k,_,24,1.5);else try{D=await gt(u.element,{pixelRatio:2,cacheBust:!0,backgroundColor:"#ffffff",filter:K=>{const Q=K;return!ie.current?.contains(Q)}})}catch{D=await yt(k,_,24,1.5)}const ye={...u.semanticReference,metadata:{...u.semanticReference.metadata,screenshotUrl:k,elementScreenshot:D}};w({...u,visualPreview:D,semanticReference:ye})}catch(y){console.error("Failed to capture preview:",y),w(u)}finally{H(!1),b(null)}}},[c,u,f]);m.useEffect(()=>{const d=g=>{if(g.key==="Escape"){f?w(null):A?W(!1):c&&p(!1);return}const M=(()=>{let k=document.activeElement;for(;k&&k.shadowRoot&&k.shadowRoot.activeElement;)k=k.shadowRoot.activeElement;return k})();if(["input","textarea"].includes((M?.tagName||"").toLowerCase())||M?.isContentEditable)return;const E=g.key.toLowerCase();E==="c"&&!f&&!A&&p(k=>!k),E==="v"&&!f&&(O.length>0||A)&&(W(k=>!k),A||p(!1))};return c&&!f?document.body.classList.add("vg-cursor-pointer"):document.body.classList.remove("vg-cursor-pointer"),window.addEventListener("keydown",d),window.addEventListener("mousemove",Fe,!0),window.addEventListener("click",He,!0),()=>{document.body.classList.remove("vg-cursor-pointer"),window.removeEventListener("keydown",d),window.removeEventListener("mousemove",Fe,!0),window.removeEventListener("click",He,!0)}},[c,f,A,O,Fe,He]);const nr=async()=>{if(!f||!h.trim())return;P(!0);const{semanticReference:d}=f,[g,y]=(d.source||"").split(":"),M=y||"0";try{if(!(await fetch(`${s}/api/annotations`,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify({filePath:g,line:parseInt(M),url:window.location.href,message:h,componentName:d.componentPath||f.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"),w(null),v(""),p(!1),ee()}catch(C){console.error(C),e(n.error,"error")}finally{P(!1)}};return o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1077",className:"vg-container",children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1078",className:"vg-no-capture",children:[!i&&o.jsxs("div",{style:{position:"fixed",top:`${Y.top}px`,right:`${Y.right}px`,zIndex:Ge+10,display:"flex",alignItems:"center",gap:"8px",transition:l?"none":"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},children:[o.jsx("div",{onMouseDown:fe,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:c?0:1,visibility:c?"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:1122",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:()=>a()})},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(je,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1162",size:20,strokeWidth:2.5})})]}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1168",style:{position:"fixed",bottom:`${R.bottom}px`,right:`${R.right}px`,zIndex:Ge,display:"flex",alignItems:"center",gap:"8px",transition:X?"none":"all 0.4s cubic-bezier(0.4, 0, 0.2, 1)"},id:"viewgate-ui",children:[o.jsx("div",{onMouseDown:ze,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:c?0:1,visibility:c?"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:1211",size:16})}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1214",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:()=>p(!c),className:"vg-button-primary vg-animate-pop",style:{padding:"12px 24px",background:c?"#ef4444":void 0},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1223",style:{display:"flex",alignItems:"center",gap:"10px"},children:[c?o.jsx(je,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1224",size:20,className:"vg-animate-pop"}):o.jsx(_e,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1224",size:20,className:"vg-animate-pop"}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1225",children:c?n.exitMode:n.enterMode})]})}),O.length>0&&o.jsxs("button",{onClick:()=>{W(!A),p(!1),w(null)},className:"vg-button-ghost vg-animate-pop",style:{animationDelay:"0.1s"},children:[o.jsx(Lt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1238",size:20}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1239",children:n.viewComments})]})]})]}),F&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1247",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:Ge+1,cursor:"wait"},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1253",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:1254",className:"vg-spinner"}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1255",style:{fontWeight:600,fontSize:"14px",color:"#000000"},children:"Capturando..."})]})}),c&&!f&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1262",className:"vg-backdrop-blur",style:{opacity:1,clipPath:u?`polygon(
7
+ <%s key={someKey} {...props} />`,R,j,F,j),je[j+R]=!0)}if(j=null,k!==void 0&&(n(k),j=""+k),i(x)&&(n(x.key),j=""+x.key),"key"in x){k={};for(var ce in x)ce!=="key"&&(k[ce]=x[ce])}else k=x;return j&&c(k,typeof l=="function"?l.displayName||l.name||"Unknown":l),u(l,j,k,s(),M,J)}function f(l){v(l)?l._store&&(l._store.validated=1):typeof l=="object"&&l!==null&&l.$$typeof===Ee&&(l._payload.status==="fulfilled"?v(l._payload.value)&&l._payload.value._store&&(l._payload.value._store.validated=1):l._store&&(l._store.validated=1))}function v(l){return typeof l=="object"&&l!==null&&l.$$typeof===S}var h=p,S=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),U=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),Ee=Symbol.for("react.lazy"),bt=Symbol.for("react.activity"),pe=Symbol.for("react.client.reference"),oe=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ke=Object.prototype.hasOwnProperty,Re=Array.isArray,X=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(l){return l()}};var ie,q={},me=h.react_stack_bottom_frame.bind(h,a)(),fe=X(r(a)),je={};ue.Fragment=P,ue.jsx=function(l,x,k){var R=1e4>oe.recentlyCreatedOwnerStacks++;return E(l,x,k,!1,R?Error("react-stack-top-frame"):me,R?X(r(l)):fe)},ue.jsxs=function(l,x,k){var R=1e4>oe.recentlyCreatedOwnerStacks++;return E(l,x,k,!0,R?Error("react-stack-top-frame"):me,R?X(r(l)):fe)}})()),ue}var Ue;function _t(){return Ue||(Ue=1,process.env.NODE_ENV==="production"?ye.exports=Rt():ye.exports=jt()),ye.exports}var o=_t();const Ot=({children:e})=>{const t=p.useRef(null),[n,r]=p.useState(null);return p.useEffect(()=>{if(t.current&&!t.current.shadowRoot){const s=t.current.attachShadow({mode:"open"});document.querySelectorAll("style[data-vite-dev-id], style:not([data-vite-dev-id])").forEach(c=>{(c.textContent?.includes(".vg-")||c.textContent?.includes("--vg-"))&&s.appendChild(c.cloneNode(!0))});const i=document.createElement("link");i.rel="stylesheet",i.href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800;900&display=swap",s.appendChild(i),r(s)}},[]),o.jsx("div",{"data-source-path":"/src/components/ShadowRootWrapper.tsx:38",ref:t,id:"viewgate-shadow-host",children:n&&kt.createPortal(e,n)})};const Be=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const Tt=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 Ye=e=>{const t=Vt(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Pt={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 At=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const Gt=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:a,iconNode:i,...c},m)=>p.createElement("svg",{ref:m,...Pt,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Be("lucide",s),...!a&&!At(c)&&{"aria-hidden":"true"},...c},[...i.map(([u,E])=>p.createElement(u,E)),...Array.isArray(a)?a:[a]]));const N=(e,t)=>{const n=p.forwardRef(({className:r,...s},a)=>p.createElement(Gt,{ref:a,iconNode:t,className:Be(`lucide-${Tt(Ye(e))}`,`lucide-${e}`,r),...s}));return n.displayName=Ye(e),n};const Nt=N("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const ne=N("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const Lt=N("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);const Xe=N("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 Mt=N("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 Je=N("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 It=N("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const xe=N("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 zt=N("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 Dt=N("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 Ft=N("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 Ht=N("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 Ze=N("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 Oe=N("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Wt={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."}},Ke=p.createContext(void 0),Qe=()=>{const e=p.useContext(Ke);if(!e)throw new Error("useViewGate must be used within a ViewGateProvider");return e},Te="viewgate_enabled",$t=()=>typeof window>"u"?!1:new URLSearchParams(window.location.search).has("viewgate")?(sessionStorage.setItem(Te,"true"),!0):sessionStorage.getItem(Te)==="true",Ut=({children:e,language:t="es",apiKey:n,baseUrl:r="https://view-gate.vercel.app"})=>{const[s,a]=p.useState(!1),[i,c]=p.useState([]);p.useEffect(()=>{a($t())},[]);const m=()=>{if(sessionStorage.removeItem(Te),a(!1),typeof window<"u"){const f=new URL(window.location.href);f.searchParams.delete("viewgate"),window.history.replaceState({},"",f.toString())}},u=(f,v)=>{const h=Date.now();c(S=>[...S,{id:h,message:f,type:v}]),setTimeout(()=>{c(S=>S.filter(O=>O.id!==h))},4e3)},E=Wt[t];return o.jsxs(Ke.Provider,{"data-source-path":"/src/components/ViewGateProvider.tsx:248",value:{addToast:u,language:t,t:E,apiKey:n,baseUrl:r,disableViewGate:m,hasActiveToasts:i.length>0},children:[e,s&&o.jsx(Ot,{"data-source-path":"/src/components/ViewGateProvider.tsx:259",children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:260",className:"vg-container",children:[o.jsx(vt,{"data-source-path":"/src/components/ViewGateProvider.tsx:261"}),o.jsx("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:262",className:"vg-toasts",style:{zIndex:2147483646},children:i.map(f=>o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:264",className:`vg-toast vg-animate-slide ${f.type}`,children:[f.type==="success"?o.jsx(ne,{"data-source-path":"/src/components/ViewGateProvider.tsx:266",size:24,color:"#22c55e"}):o.jsx(Nt,{"data-source-path":"/src/components/ViewGateProvider.tsx:268",size:24,color:"#ef4444"}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:270",children:[o.jsx("strong",{"data-source-path":"/src/components/ViewGateProvider.tsx:271",style:{display:"block",fontSize:"13px",color:"#0f172a",textTransform:"uppercase",marginBottom:"2px"},children:f.type==="success"?E.successHeader:E.errorHeader}),o.jsx("span",{"data-source-path":"/src/components/ViewGateProvider.tsx:274",style:{fontSize:"14px",color:"#000000"},children:f.message})]})]},f.id))})]})})]})};function Bt(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"),s=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(s),t&&(r.href=t),s.href=e,s.href}const Yt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function K(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}let re=null;function qe(e={}){return re||(e.includeStyleProperties?(re=e.includeStyleProperties,re):(re=K(window.getComputedStyle(document.documentElement)),re))}function we(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function Xt(e){const t=we(e,"border-left-width"),n=we(e,"border-right-width");return e.clientWidth+t+n}function Jt(e){const t=we(e,"border-top-width"),n=we(e,"border-bottom-width");return e.clientHeight+t+n}function et(e,t={}){const n=t.width||Xt(e),r=t.height||Jt(e);return{width:n,height:r}}function Zt(){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 D=16384;function Kt(e){(e.width>D||e.height>D)&&(e.width>D&&e.height>D?e.width>e.height?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D):e.width>D?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D))}function ve(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 qt(e,t,n){const r="http://www.w3.org/2000/svg",s=document.createElementNS(r,"svg"),a=document.createElementNS(r,"foreignObject");return s.setAttribute("width",`${t}`),s.setAttribute("height",`${n}`),s.setAttribute("viewBox",`0 0 ${t} ${n}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),s.appendChild(a),a.appendChild(e),Qt(s)}const L=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||L(n,t)};function en(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function tn(e,t){return qe(t).map(n=>{const r=e.getPropertyValue(n),s=e.getPropertyPriority(n);return`${n}: ${r}${s?" !important":""};`}).join(" ")}function nn(e,t,n,r){const s=`.${e}:${t}`,a=n.cssText?en(n):tn(n,r);return document.createTextNode(`${s}{${a}}`)}function tt(e,t,n,r){const s=window.getComputedStyle(e,n),a=s.getPropertyValue("content");if(a===""||a==="none")return;const i=Yt();try{t.className=`${t.className} ${i}`}catch{return}const c=document.createElement("style");c.appendChild(nn(i,n,s,r)),t.appendChild(c)}function rn(e,t,n){tt(e,t,":before",n),tt(e,t,":after",n)}const nt="application/font-woff",rt="image/jpeg",an={woff:nt,woff2:nt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:rt,jpeg:rt,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function sn(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Ve(e){const t=sn(e).toLowerCase();return an[t]||""}function on(e){return e.split(/,/)[1]}function Pe(e){return e.search(/^(data:)/)!==-1}function cn(e,t){return`data:${t};base64,${e}`}async function at(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const s=await r.blob();return new Promise((a,i)=>{const c=new FileReader;c.onerror=i,c.onloadend=()=>{try{a(n({res:r,result:c.result}))}catch(m){i(m)}},c.readAsDataURL(s)})}const Ae={};function ln(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 Ge(e,t,n){const r=ln(e,t,n.includeQueryParams);if(Ae[r]!=null)return Ae[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let s;try{const a=await at(e,n.fetchRequestInit,({res:i,result:c})=>(t||(t=i.headers.get("Content-Type")||""),on(c)));s=cn(a,t)}catch(a){s=n.imagePlaceholder||"";let i=`Failed to fetch resource: ${e}`;a&&(i=typeof a=="string"?a:a.message),i&&console.warn(i)}return Ae[r]=s,s}async function dn(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ve(t)}async function un(e,t){if(e.currentSrc){const a=document.createElement("canvas"),i=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,i?.drawImage(e,0,0,a.width,a.height);const c=a.toDataURL();return ve(c)}const n=e.poster,r=Ve(n),s=await Ge(n,r,t);return ve(s)}async function pn(e,t){var n;try{if(!((n=e?.contentDocument)===null||n===void 0)&&n.body)return await be(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function mn(e,t){return L(e,HTMLCanvasElement)?dn(e):L(e,HTMLVideoElement)?un(e,t):L(e,HTMLIFrameElement)?pn(e,t):e.cloneNode(st(e))}const fn=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",st=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function hn(e,t,n){var r,s;if(st(t))return t;let a=[];return fn(e)&&e.assignedNodes?a=K(e.assignedNodes()):L(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?a=K(e.contentDocument.body.childNodes):a=K(((s=e.shadowRoot)!==null&&s!==void 0?s:e).childNodes),a.length===0||L(e,HTMLVideoElement)||await a.reduce((i,c)=>i.then(()=>be(c,n)).then(m=>{m&&t.appendChild(m)}),Promise.resolve()),t}function gn(e,t,n){const r=t.style;if(!r)return;const s=window.getComputedStyle(e);s.cssText?(r.cssText=s.cssText,r.transformOrigin=s.transformOrigin):qe(n).forEach(a=>{let i=s.getPropertyValue(a);a==="font-size"&&i.endsWith("px")&&(i=`${Math.floor(parseFloat(i.substring(0,i.length-2)))-.1}px`),L(e,HTMLIFrameElement)&&a==="display"&&i==="inline"&&(i="block"),a==="d"&&t.getAttribute("d")&&(i=`path(${t.getAttribute("d")})`),r.setProperty(a,i,s.getPropertyPriority(a))})}function yn(e,t){L(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),L(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function xn(e,t){if(L(e,HTMLSelectElement)){const r=Array.from(t.children).find(s=>e.value===s.getAttribute("value"));r&&r.setAttribute("selected","")}}function wn(e,t,n){return L(t,Element)&&(gn(e,t,n),rn(e,t,n),yn(e,t),xn(e,t)),t}async function vn(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let a=0;a<n.length;a++){const c=n[a].getAttribute("xlink:href");if(c){const m=e.querySelector(c),u=document.querySelector(c);!m&&u&&!r[c]&&(r[c]=await be(u,t,!0))}}const s=Object.values(r);if(s.length){const a="http://www.w3.org/1999/xhtml",i=document.createElementNS(a,"svg");i.setAttribute("xmlns",a),i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.overflow="hidden",i.style.display="none";const c=document.createElementNS(a,"defs");i.appendChild(c);for(let m=0;m<s.length;m++)c.appendChild(s[m]);e.appendChild(i)}return e}async function be(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>mn(r,t)).then(r=>hn(e,r,t)).then(r=>wn(e,r,t)).then(r=>vn(r,t))}const ot=/url\((['"]?)([^'"]+?)\1\)/g,bn=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Sn=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Cn(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function En(e){const t=[];return e.replace(ot,(n,r,s)=>(t.push(s),n)),t.filter(n=>!Pe(n))}async function kn(e,t,n,r,s){try{const a=n?Bt(t,n):t,i=Ve(t);let c;return s||(c=await Ge(a,i,r)),e.replace(Cn(t),`$1${c}$3`)}catch{}return e}function Rn(e,{preferredFontFormat:t}){return t?e.replace(Sn,n=>{for(;;){const[r,,s]=bn.exec(n)||[];if(!s)return"";if(s===t)return`src: ${r};`}}):e}function it(e){return e.search(ot)!==-1}async function ct(e,t,n){if(!it(e))return e;const r=Rn(e,n);return En(r).reduce((a,i)=>a.then(c=>kn(c,i,t,n)),Promise.resolve(r))}async function ae(e,t,n){var r;const s=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(s){const a=await ct(s,null,n);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function jn(e,t){await ae("background",e,t)||await ae("background-image",e,t),await ae("mask",e,t)||await ae("-webkit-mask",e,t)||await ae("mask-image",e,t)||await ae("-webkit-mask-image",e,t)}async function _n(e,t){const n=L(e,HTMLImageElement);if(!(n&&!Pe(e.src))&&!(L(e,SVGImageElement)&&!Pe(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,s=await Ge(r,Ve(r),t);await new Promise((a,i)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...m)=>{try{a(t.onImageErrorHandler(...m))}catch(u){i(u)}}:i;const c=e;c.decode&&(c.decode=a),c.loading==="lazy"&&(c.loading="eager"),n?(e.srcset="",e.src=s):e.href.baseVal=s})}async function On(e,t){const r=K(e.childNodes).map(s=>lt(s,t));await Promise.all(r).then(()=>e)}async function lt(e,t){L(e,Element)&&(await jn(e,t),await _n(e,t),await On(e,t))}function Tn(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(s=>{n[s]=r[s]}),e}const dt={};async function ut(e){let t=dt[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},dt[e]=t,t}async function pt(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,a=(n.match(/url\([^)]+\)/g)||[]).map(async i=>{let c=i.replace(r,"$1");return c.startsWith("https://")||(c=new URL(c,e.url).href),at(c,t.fetchRequestInit,({result:m})=>(n=n.replace(i,`url(${m})`),[i,m]))});return Promise.all(a).then(()=>n)}function mt(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const s=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const m=s.exec(r);if(m===null)break;t.push(m[0])}r=r.replace(s,"");const a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",c=new RegExp(i,"gi");for(;;){let m=a.exec(r);if(m===null){if(m=c.exec(r),m===null)break;a.lastIndex=c.lastIndex}else c.lastIndex=a.lastIndex;t.push(m[0])}return t}async function Vn(e,t){const n=[],r=[];return e.forEach(s=>{if("cssRules"in s)try{K(s.cssRules||[]).forEach((a,i)=>{if(a.type===CSSRule.IMPORT_RULE){let c=i+1;const m=a.href,u=ut(m).then(E=>pt(E,t)).then(E=>mt(E).forEach(f=>{try{s.insertRule(f,f.startsWith("@import")?c+=1:s.cssRules.length)}catch(v){console.error("Error inserting rule from remote css",{rule:f,error:v})}})).catch(E=>{console.error("Error loading remote css",E.toString())});r.push(u)}})}catch(a){const i=e.find(c=>c.href==null)||document.styleSheets[0];s.href!=null&&r.push(ut(s.href).then(c=>pt(c,t)).then(c=>mt(c).forEach(m=>{i.insertRule(m,i.cssRules.length)})).catch(c=>{console.error("Error loading remote stylesheet",c)})),console.error("Error inlining remote css file",a)}}),Promise.all(r).then(()=>(e.forEach(s=>{if("cssRules"in s)try{K(s.cssRules||[]).forEach(a=>{n.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${s.href}`,a)}}),n))}function Pn(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>it(t.style.getPropertyValue("src")))}async function An(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=K(e.ownerDocument.styleSheets),r=await Vn(n,t);return Pn(r)}function ft(e){return e.trim().replace(/["']/g,"")}function Gn(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(a=>{t.add(ft(a))}),Array.from(r.children).forEach(a=>{a instanceof HTMLElement&&n(a)})}return n(e),t}async function Nn(e,t){const n=await An(e,t),r=Gn(e);return(await Promise.all(n.filter(a=>r.has(ft(a.style.fontFamily))).map(a=>{const i=a.parentStyleSheet?a.parentStyleSheet.href:null;return ct(a.cssText,i,t)}))).join(`
8
+ `)}async function Ln(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Nn(e,t);if(n){const r=document.createElement("style"),s=document.createTextNode(n);r.appendChild(s),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function Mn(e,t={}){const{width:n,height:r}=et(e,t),s=await be(e,t,!0);return await Ln(s,t),await lt(s,t),Tn(s,t),await qt(s,n,r)}async function In(e,t={}){const{width:n,height:r}=et(e,t),s=await Mn(e,t),a=await ve(s),i=document.createElement("canvas"),c=i.getContext("2d"),m=t.pixelRatio||Zt(),u=t.canvasWidth||n,E=t.canvasHeight||r;return i.width=u*m,i.height=E*m,t.skipAutoScale||Kt(i),i.style.width=`${u}`,i.style.height=`${E}`,t.backgroundColor&&(c.fillStyle=t.backgroundColor,c.fillRect(0,0,i.width,i.height)),c.drawImage(a,0,0,i.width,i.height),i}async function ht(e,t={}){return(await In(e,t)).toDataURL()}const Se=2147483647,Ne=Se,Le=2e6,zn=Se-10,Dn=Se-5,Fn=Se-15,Ce="data-vg-pin-id",Hn=()=>{const e=window.innerWidth;return e<768?"mobile":e<1024?"tablet":"desktop"},Wn=e=>{let t=0;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t=(t<<5)-t+r,t=t&t}return Math.abs(t).toString(16)},gt=(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""}},$n=e=>{const t=(e.innerText||"").slice(0,30).trim(),n={tag:e.tagName.toLowerCase(),classHash:Wn(e.className),textSnippet:t,parentTag:e.parentElement?.tagName.toLowerCase(),neighborCount:e.parentElement?.children.length||0},r=e.getAttribute("aria-label");r&&(n.ariaLabel=r);const s=e.getAttribute("role");s&&(n.role=s);const a=e.getAttribute("name");return a&&(n.name=a),n},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 a=t.fillStyle;if(a&&!a.includes("oklch")&&!a.includes("oklab"))return a}const r=document.createElement("div");r.style.color=n,document.body.appendChild(r);const s=getComputedStyle(r).color;return document.body.removeChild(r),s&&!s.includes("oklch")?s:"rgb(0,0,0)"}catch{return"rgb(0,0,0)"}return n}})(),yt=(e,t,n,r)=>new Promise(s=>{const a=new Image;a.onload=()=>{const i=document.createElement("canvas"),c=window.devicePixelRatio||1,m=t.width+n*2,u=t.height+n*2;i.width=m*c,i.height=u*c;const E=i.getContext("2d");if(E){E.scale(c,c);let f=(t.left-n)*r,v=(t.top-n)*r,h=m*r,S=u*r,O=0,P=0,W=m,$=u;f<0&&(O=Math.abs(f)/r,h+=f,W-=O,f=0),f+h>a.width&&(h=a.width-f,W=h/r),v<0&&(P=Math.abs(v)/r,S+=v,$-=P,v=0),v+S>a.height&&(S=a.height-v,$=S/r),E.fillStyle="#ffffff",E.fillRect(0,0,m,u),h>0&&S>0&&E.drawImage(a,f,v,h,S,O,P,W,$)}s(i.toDataURL("image/png"))},a.onerror=()=>s(""),a.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(s=>{const a=t.getPropertyValue(s);n[s]=Un(a)}),n},Yn=e=>{const n=Object.keys(e).find(a=>a.startsWith("__reactFiber$")||a.startsWith("__reactInternalInstance$"));if(!n)return"";const r=[];let s=e[n];for(;s;){const a=s.type;if(typeof a=="function"){const i=a.displayName||a.name;i&&!i.includes("ViewGate")&&!r.includes(i)&&r.unshift(i)}s=s.return}return r.join(" > ")||"Generic Component"},xt=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 a=120;return n.width<a&&n.height<a||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"))},se=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 s=window.getComputedStyle(n);if(s.display==="none"||s.visibility==="hidden"||s.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)},Me=(e,t=document)=>{const n=t.querySelector(e);if(n)return n;const r=t.querySelectorAll("*");for(const s of Array.from(r)){const a=s.shadowRoot;if(a){const i=Me(e,a);if(i)return i}}return null},wt=(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},Xn=e=>{if(!e.tag)return null;const t=document.getElementsByTagName(e.tag);let n=null,r=0;for(let s=0;s<t.length;s++){const a=t[s];let i=0;const c=a.getAttribute("placeholder");e.attributes?.placeholder&&c===e.attributes.placeholder?i+=6:c&&e.attributes?.placeholder&&c.includes(e.attributes.placeholder)&&(i+=2),a.innerText?.trim()===e.text.trim()?i+=5:a.innerText?.includes(e.text.slice(0,20))&&(i+=3),e.fingerprint?.classHash&&a.className.includes(e.fingerprint.classHash)&&(i+=2),e.fingerprint?.ariaLabel&&a.getAttribute("aria-label")===e.fingerprint.ariaLabel&&(i+=3),e.fingerprint?.role&&a.getAttribute("role")===e.fingerprint.role&&(i+=2),e.parentContext&&(a.parentElement?.innerText||"").includes(e.parentContext.slice(0,30))&&(i+=2),e.fingerprint?.neighborCount===a.parentElement?.children.length&&(i+=1),e.fingerprint?.parentTag===a.parentElement?.tagName.toLowerCase()&&(i+=1),i>r&&i>=7&&(r=i,n=a)}return n},Jn=(e,t)=>{if(t){const r=Array.from(document.querySelectorAll(`[${Ce}="${t}"]`));if(r.length>0){const s=r.find(a=>!(!se(a)||e.metadata?.isModal&&!a.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content')));return s?(r.forEach(a=>{a!==s&&a.removeAttribute(Ce)}),s):null}}let n=Me(e.selector);if(n&&se(n))if(e.metadata?.isModal&&!n.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content'))n=null;else return n;if(e.fallbackSelectors){for(const r of e.fallbackSelectors)if(n=Me(r),n&&se(n)){if(e.metadata?.isModal&&!n.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content'))continue;return n}}return n=Xn(e),n&&se(n)?e.metadata?.isModal&&!n.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content')?null:n:null},Ie=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}),Zn=e=>{const t=e.parentElement;if(!t)return;const n=Array.from(t.children).filter(i=>i!==e).slice(0,5).map(i=>Ie(i)),r=Array.from(t.children),s=r.indexOf(e);let a="middle";return s===0&&(a="start"),s===r.length-1&&(a="end"),{target:{...Ie(e),location:`${a} of ${t.tagName.toLowerCase()}`},parent:Ie(t),siblings:n}},Kn=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),s=[],a=[],i=f=>{const v=[];let h=f;for(;h&&h.nodeType===Node.ELEMENT_NODE;){let S=h.nodeName.toLowerCase();a.unshift(S);const O=h.id&&!h.id.startsWith("__")?h.id:null;O&&s.push(`#${O}`);const P=h.getAttribute("data-testid")||h.getAttribute("data-qa");P&&s.push(`[data-testid="${P}"]`);const W=h.getAttribute("placeholder"),$=h.getAttribute("aria-label"),A=h.getAttribute("role"),U=h.getAttribute("name"),T=h.getAttribute("title");if(P){S=`[${h.hasAttribute("data-testid")?"data-testid":"data-qa"}="${P}"]`,v.unshift(S);break}else if(O){S="#"+O,v.unshift(S);break}else if(W){S=`${h.localName}[placeholder="${W}"]`,v.unshift(S);break}else if($){S=`${h.localName}[aria-label="${$}"]`,v.unshift(S);break}else if(A){S=`${h.localName}[role="${A}"]`,v.unshift(S);break}else if(U){S=`${h.localName}[name="${U}"]`,v.unshift(S);break}else if(T){S=`${h.localName}[title="${T}"]`,v.unshift(S);break}else{let Z=h,G=1;for(;Z.previousElementSibling;)Z=Z.previousElementSibling,Z.nodeName.toLowerCase()===h.nodeName.toLowerCase()&&G++;G>1&&(S+=`:nth-of-type(${G})`)}v.unshift(S),h=h.parentElement}return v.join(" > ")},c=xt(e.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content')),m=i(e),u={};["placeholder","aria-label","name","type","alt","title","value","role"].forEach(f=>{const v=e.getAttribute(f);v&&(u[f]=v)});const E=`${e.tagName.toLowerCase()}-${(e.innerText||"").slice(0,20).replace(/\s+/g,"_")}-${m.split(" > ").slice(-1)}`;return{tag:e.tagName.toLowerCase(),id:e.id||"",classes:e.className||"",text:(e.innerText||"").slice(0,100).trim(),selector:m,outerHtml:e.outerHTML,parentContext:(e.parentElement?.innerText||"").slice(0,150).trim(),componentPath:r,signature:E,source:t,attributes:u,fallbackSelectors:[...new Set(s)].slice(0,5),domPath:a.slice(-10),viewportSize:{width:window.innerWidth,height:window.innerHeight},uiContext:Zn(e),fingerprint:$n(e),metadata:{hint:`Edit ${t.split(":")[0]} at line ${t.split(":")[1]||"?"}`,computedStyles:Bn(e),viewportBreakpoint:Hn(),outerHtml:e.outerHTML.slice(0,1500),scrollPosition:{x:window.scrollX,y:window.scrollY},isModal:c}}},vt=()=>{const{addToast:e,language:t,t:n,apiKey:r,baseUrl:s,disableViewGate:a,hasActiveToasts:i}=Qe(),[c,m]=p.useState(!1),[u,E]=p.useState(null),[f,v]=p.useState(null),[h,S]=p.useState(""),[O,P]=p.useState(!1),[W,$]=p.useState(!1),[A,U]=p.useState(!1),[T,Z]=p.useState([]),[G,Y]=p.useState(null),[Ee,bt]=p.useState(!1),[pe,oe]=p.useState(!1),[ke,Re]=p.useState({}),[X,ie]=p.useState(null),[q,me]=p.useState(!1),[fe,je]=p.useState([]),[l,x]=p.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}}),[k,R]=p.useState(!1),M=p.useRef(null),[J,j]=p.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}}),[F,ce]=p.useState(!1),B=p.useRef(null),er=d=>{d.preventDefault(),d.stopPropagation();const g=d.currentTarget.parentElement?.getBoundingClientRect();g&&(R(!0),M.current={x:d.clientX,y:d.clientY,top:l.top,right:l.right,width:g.width,height:g.height})},tr=d=>{d.preventDefault(),d.stopPropagation();const g=d.currentTarget.parentElement?.getBoundingClientRect();g&&(ce(!0),B.current={x:d.clientX,y:d.clientY,bottom:J.bottom,right:J.right,width:g.width,height:g.height})};p.useEffect(()=>{if(!k&&!F)return;const d=w=>{if(k&&M.current){const V=w.clientX-M.current.x,_=w.clientY-M.current.y;let C=M.current.top+_,y=M.current.right-V;const b=10;C=Math.max(b,Math.min(window.innerHeight-M.current.height-b,C)),y=Math.max(b,Math.min(window.innerWidth-M.current.width-b,y)),x({top:C,right:y})}if(F&&B.current){const V=w.clientX-B.current.x,_=w.clientY-B.current.y;let C=B.current.bottom-_,y=B.current.right-V;const b=10;C=Math.max(b,Math.min(window.innerHeight-B.current.height-b,C)),y=Math.max(b,Math.min(window.innerWidth-B.current.width-b,y)),j({bottom:C,right:y})}},g=()=>{k&&(R(!1),localStorage.setItem("vg-exit-pos",JSON.stringify(l)),M.current=null),F&&(ce(!1),localStorage.setItem("vg-bar-pos",JSON.stringify(J)),B.current=null)};return window.addEventListener("mousemove",d),window.addEventListener("mouseup",g),()=>{window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",g)}},[k,F,l,J]);const[St,De]=p.useState(null),[Ct,Et]=p.useState(""),[yr,xr]=p.useState({}),le=p.useRef(null),he=p.useRef(null),ge=p.useCallback(()=>{he.current||(he.current=requestAnimationFrame(()=>{const d=new Map,w=Array.from(document.querySelectorAll('[role="dialog"], [aria-modal="true"], .modal, .modal-content')).find(C=>xt(C)&&se(C)),V=!!w;T.forEach(C=>{if(!C.reference)return;const y=Jn(C.reference,C._id);if(!y||!se(y))return;const b=!!C.reference.metadata?.isModal;let H=!1;if(V?H=w.contains(y):H=!b,!H)return;y.getAttribute(Ce)||y.setAttribute(Ce,C._id),d.has(y)||d.set(y,[]),d.get(y).push(C)});const _=[];d.forEach((C,y)=>{const b=y.getBoundingClientRect(),H=b.left+b.width/2,I=b.top+b.height/2;if(H>=0&&H<=window.innerWidth&&I>=0&&I<=window.innerHeight){const Q=document.elementFromPoint(H,I);if(Q&&!y.contains(Q)&&!le.current?.contains(Q))return}_.push({id:C[0]._id,element:y,rect:b,annotations:C.sort((Q,te)=>new Date(te.timestamp||te.createdAt).getTime()-new Date(Q.timestamp||Q.createdAt).getTime()),isModal:!!C[0].reference?.metadata?.isModal})}),je(_),he.current=null}))},[T]),ee=p.useCallback(async()=>{if(r){oe(!0);try{const d=await fetch(`${s}/api/annotations`,{headers:{"x-api-key":r}});if(d.ok){const V=((await d.json()).data||[]).reduce((_,C)=>_.find(b=>b._id===C._id)?_:_.concat([C]),[]);Z(V)}}catch(d){console.error("Failed to fetch annotations",d)}finally{oe(!1)}}},[r,s]);p.useEffect(()=>{A&&T.length===0&&!pe&&U(!1)},[A,T.length,pe]),p.useEffect(()=>{if(!c&&T.length>0){ge();const d=new MutationObserver(()=>ge()),g=new ResizeObserver(()=>ge()),w=()=>ge();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),he.current&&cancelAnimationFrame(he.current)}}},[c,T.length,ge]),p.useEffect(()=>{ee()},[ee]),p.useEffect(()=>{le.current=document.getElementById("viewgate-shadow-host")},[]);const Fe=p.useCallback(d=>{if(!c||f)return;const g=wt(d.clientX,d.clientY);if(!g||le.current?.contains(g)||g.closest(".vg-no-capture")){E(null);return}const w=g.getBoundingClientRect();E({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:{...Kn(g),normalizedOffset:{x:(d.clientX-w.left)/w.width,y:(d.clientY-w.top)/w.height}}})},[c,f]),He=p.useCallback(async d=>{if(!c||f)return;const g=wt(d.clientX,d.clientY);if(!(!g||le.current?.contains(g)||g.closest(".vg-no-capture"))&&u){d.preventDefault(),d.stopPropagation(),$(!0);try{const _=window.scrollX,C=window.scrollY,y=await ht(document.documentElement,{pixelRatio:1.5,cacheBust:!0,width:window.innerWidth,height:window.innerHeight,backgroundColor:"#ffffff",style:{transform:`scale(${1/window.devicePixelRatio}) translate(-${_}px, -${C}px)`,transformOrigin:"top left"},filter:te=>{const _e=te;return!(le.current?.contains(_e)||_e.id==="viewgate-ui")}}),b=u.element.getBoundingClientRect(),H=b.top>=0&&b.left>=0&&b.bottom<=window.innerHeight&&b.right<=window.innerWidth;let I="";if(H&&b.width>0&&b.height>0)I=await yt(y,b,24,1.5);else try{I=await ht(u.element,{pixelRatio:2,cacheBust:!0,backgroundColor:"#ffffff",filter:te=>{const _e=te;return!le.current?.contains(_e)}})}catch{I=await yt(y,b,24,1.5)}const Q={...u.semanticReference,metadata:{...u.semanticReference.metadata,screenshotUrl:y,elementScreenshot:I}};v({...u,visualPreview:I,semanticReference:Q})}catch(w){console.error("Failed to capture preview:",w),v(u)}finally{$(!1),E(null)}}},[c,u,f]);p.useEffect(()=>{const d=g=>{if(g.key==="Escape"){f?v(null):A?U(!1):c&&m(!1);return}const V=(()=>{let y=document.activeElement;for(;y&&y.shadowRoot&&y.shadowRoot.activeElement;)y=y.shadowRoot.activeElement;return y})();if(["input","textarea"].includes((V?.tagName||"").toLowerCase())||V?.isContentEditable)return;const C=g.key.toLowerCase();C==="c"&&!f&&!A&&m(y=>!y),C==="v"&&!f&&(T.length>0||A)&&(U(y=>!y),A||m(!1))};return c&&!f?document.body.classList.add("vg-cursor-pointer"):document.body.classList.remove("vg-cursor-pointer"),window.addEventListener("keydown",d),window.addEventListener("mousemove",Fe,!0),window.addEventListener("click",He,!0),()=>{document.body.classList.remove("vg-cursor-pointer"),window.removeEventListener("keydown",d),window.removeEventListener("mousemove",Fe,!0),window.removeEventListener("click",He,!0)}},[c,f,A,T,Fe,He]);const nr=async()=>{if(!f||!h.trim())return;P(!0);const{semanticReference:d}=f,[g,w]=(d.source||"").split(":"),V=w||"0";try{if(!(await fetch(`${s}/api/annotations`,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify({filePath:g,line:parseInt(V),url:window.location.href,message:h,componentName:d.componentPath||f.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"),v(null),S(""),m(!1),ee()}catch(_){console.error(_),e(n.error,"error")}finally{P(!1)}};return o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1080",className:"vg-container",children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1081",className:"vg-no-capture",children:[!i&&o.jsxs("div",{style:{position:"fixed",top:`${l.top}px`,right:`${l.right}px`,zIndex:Ne+10,display:"flex",alignItems:"center",gap:"8px",transition:k?"none":"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},children:[o.jsx("div",{onMouseDown:er,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:c?0:1,visibility:c?"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(Je,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1125",size:14})}),o.jsx("button",{onClick:d=>{d.stopPropagation(),Y({title:n.exitConfirmTitle||"Close ViewGate?",message:n.exitConfirmMessage||"Are you sure you want to close ViewGate?",type:"danger",onConfirm:()=>a()})},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(Oe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1165",size:20,strokeWidth:2.5})})]}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1171",style:{position:"fixed",bottom:`${J.bottom}px`,right:`${J.right}px`,zIndex:Ne,display:"flex",alignItems:"center",gap:"8px",transition:F?"none":"all 0.4s cubic-bezier(0.4, 0, 0.2, 1)"},id:"viewgate-ui",children:[o.jsx("div",{onMouseDown:tr,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:c?0:1,visibility:c?"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(Je,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1214",size:16})}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1217",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:()=>m(!c),className:"vg-button-primary vg-animate-pop",style:{padding:"12px 24px",background:c?"#ef4444":void 0},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1226",style:{display:"flex",alignItems:"center",gap:"10px"},children:[c?o.jsx(Oe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1227",size:20,className:"vg-animate-pop"}):o.jsx(xe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1227",size:20,className:"vg-animate-pop"}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1228",children:c?n.exitMode:n.enterMode})]})}),T.length>0&&o.jsxs("button",{onClick:()=>{U(!A),m(!1),v(null)},className:"vg-button-ghost vg-animate-pop",style:{animationDelay:"0.1s"},children:[o.jsx(Mt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1241",size:20}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1242",children:n.viewComments})]})]})]}),W&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1250",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:Ne+1,cursor:"wait"},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1256",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:1257",className:"vg-spinner"}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1258",style:{fontWeight:600,fontSize:"14px",color:"#000000"},children:"Capturando..."})]})}),c&&!f&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1265",className:"vg-backdrop-blur",style:{opacity:1,clipPath:u?`polygon(
9
9
  0% 0%, 0% 100%, 100% 100%, 100% 0%, 0% 0%,
10
10
  ${u.rect.left}px ${u.rect.top}px,
11
11
  ${u.rect.right}px ${u.rect.top}px,
12
12
  ${u.rect.right}px ${u.rect.bottom}px,
13
13
  ${u.rect.left}px ${u.rect.bottom}px,
14
14
  ${u.rect.left}px ${u.rect.top}px
15
- )`:"none",zIndex:In}}),c&&u&&!f&&!F&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1281",className:"vg-selection-pulse",style:{top:u.rect.top-4,left:u.rect.left-4,width:u.rect.width+8,height:u.rect.height+8,zIndex:zn},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1291",className:"vg-selection-label",style:{...u.rect.top<60?u.rect.bottom>window.innerHeight-60?{top:"8px",bottom:"auto"}:{top:"100%",marginTop:"8px",bottom:"auto"}:{top:"-40px",bottom:"auto"},...u.rect.left+200>window.innerWidth?{left:"auto",right:"0"}:{left:"0",right:"auto"}},children:[o.jsx(It,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1307",size:16}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1308",style:{display:"flex",flexDirection:"column"},children:[o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1309",style:{fontWeight:700},children:n.selectToComment}),o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1310",style:{fontSize:"10px",opacity:.8,fontFamily:"monospace"},children:[Math.round(u.rect.width)," × ",Math.round(u.rect.height)]})]})]})}),f&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1320",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:Ne},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1325",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:1329",style:{textAlign:"center",marginBottom:"32px"},children:[o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1330",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(_e,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1335",size:24})}),o.jsx("h2",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1337",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:1338",style:{margin:0,color:"#000000",fontSize:"15px"},children:n.feedbackSubheader})]}),f.visualPreview&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1342",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:f.visualPreview,alt:"Preview",style:{maxWidth:"100%",maxHeight:"200px",objectFit:"contain",display:"block"}})}),o.jsx("textarea",{className:"vg-textarea",value:h,onChange:d=>v(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:1369",style:{display:"flex",gap:"12px"},children:[o.jsx("button",{onClick:()=>!T&&w(null),className:"vg-button-ghost",disabled:T,style:{flex:1,padding:"12px"},children:n.cancel}),o.jsx("button",{onClick:nr,className:"vg-button-primary",disabled:T||!h.trim(),style:{flex:2},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1384",style:{display:"flex",alignItems:"center",gap:"8px"},children:[T?o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1385",className:"vg-spinner",style:{width:"16px",height:"16px",borderWidth:"2px"}}):o.jsx(Ft,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1385",size:18}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1386",children:T?n.submitting:n.sendFeedback||"Send Comment"})]})})]})]})}),A&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1396",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:Ne},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1401",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:1405",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"20px"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1406",style:{display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("h2",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1407",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:1411",className:"vg-badge",style:{background:"#e0e7ff",color:"#6366f1"},children:O.length})]}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1416",style:{display:"flex",gap:"8px"},children:[U&&o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1418",className:"vg-button-ghost",style:{padding:"6px 14px",fontSize:"12px"},onClick:()=>se(null),children:n.viewAll||"View All"}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1426",className:"vg-button-ghost",style:{padding:"8px",borderRadius:"50%"},onClick:()=>{W(!1),se(null)},children:o.jsx(je,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1431",size:20})})]})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1436",style:{maxHeight:"60vh",overflowY:"auto",paddingRight:"10px"},className:"vg-custom-scrollbar",children:pe?o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1438",style:{display:"flex",justifyContent:"center",padding:"40px"},children:o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1439",className:"vg-spinner"})}):(U?O.filter(d=>d._id===U):O).map((d,g)=>o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1443",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:1454",style:{display:"flex",justifyContent:"space-between",marginBottom:"16px",alignItems:"center"},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1455",style:{display:"flex",gap:"12px",alignItems:"center"},children:[d.status==="ready_for_review"?o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1457",className:"vg-badge",style:{backgroundColor:"#f0fdf4",color:"#16a34a"},children:[o.jsx(te,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1458",size:14})," ",n.readyForReview]}):o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1461",className:"vg-badge",style:{backgroundColor:"#fff7ed",color:"#ea580c"},children:[o.jsx(Xe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1462",size:14})," ",n.pending]}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1465",style:{fontSize:"12px",color:"#000000"},children:Wn(d.timestamp||d.createdAt||d.reference?.timestamp,t)})]})}),St===d._id?o.jsx("textarea",{className:"vg-textarea",value:Ct,onChange:y=>Et(y.target.value),rows:3,autoFocus:!0,style:{marginBottom:"16px"}}):o.jsx("p",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1481",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:1484",style:{display:"flex",gap:"12px",justifyContent:"flex-end",borderTop:"1px solid #f1f5f9",paddingTop:"16px"},children:St===d._id?o.jsxs(o.Fragment,{children:[o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1487",className:"vg-button-primary vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:async()=>{try{(await fetch(`${s}/api/annotations/${d._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify({message:Ct})})).ok&&(De(null),ee(),e(n.updateSuccess,"success"))}catch{e(n.error,"error")}},children:n.save}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1509",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:()=>De(null),children:n.cancel})]}):o.jsxs(o.Fragment,{children:[o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1513",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:()=>{De(d._id),Et(d.message)},children:[o.jsx(zt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1521",size:14})," ",n.edit]}),o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1523",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:1530",size:14})," ",n.review]}),d.status==="pending"?o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1533",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(`${s}/api/annotations/${d._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify({status:"ready_for_review"})})).ok&&(ee(),e(n.updateSuccess,"success"))}catch{e(n.error,"error")}finally{$(null)}}})},children:[o.jsx(te,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1561",size:14})," ",n.markReady]}):o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1564",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(`${s}/api/annotations/${d._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify({status:"pending"})})).ok&&(ee(),e(n.updateSuccess,"success"))}catch{e(n.error,"error")}finally{$(null)}}})},children:[o.jsx(Dt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1592",size:14})," ",n.reopen]}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1595",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(`${s}/api/annotations/${d._id}`,{method:"DELETE",headers:{"x-api-key":r}})).ok&&(ee(),e(n.deleteSuccess,"success"))}catch{e(n.error,"error")}finally{$(null)}}})},children:o.jsx(Ke,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1622",size:16})})]})})]},d._id))})]})}),G&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1637",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:Ne+100},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1642",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:1649",style:{width:"64px",height:"64px",background:G.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:G.type==="danger"?"#ef4444":"#6366f1",transform:"rotate(-5deg)"},children:G.type==="danger"?o.jsx(Ke,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1658",size:32}):o.jsx(te,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1658",size:32})}),o.jsx("h3",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1660",style:{margin:"0 0 12px 0",fontSize:"20px",fontWeight:800,color:"#000000",letterSpacing:"-0.02em"},children:G.title}),o.jsx("p",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1661",style:{margin:"0 0 32px 0",fontSize:"15px",color:"#000000",lineHeight:1.6},children:G.message}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1662",style:{display:"flex",gap:"16px"},children:[o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1663",className:"vg-button-ghost",style:{flex:1,height:"44px"},onClick:()=>!q&&$(null),disabled:q,children:n.no}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1671",className:"vg-button-primary",style:{flex:1,height:"44px",backgroundColor:G.type==="danger"?"#ef4444":void 0,backgroundImage:G.type==="danger"?"none":void 0,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},disabled:q,onClick:async()=>{me(!0);try{await G.onConfirm()}catch(d){console.error("Confirmation error:",d)}finally{me(!1)}},children:q?o.jsx(Mt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1696",size:18,className:"vg-animate-spin"}):n.yes})]})]})}),!c&&!A&&O.map((d,g)=>{const y=er[d._id];if(!y)return null;const C=O.slice(0,g).filter(E=>E.reference?.selector&&E.reference.selector===d.reference?.selector).length*34;return o.jsxs("div",{className:"vg-pin-container vg-animate-pop",style:{position:"fixed",top:y.top-20-window.scrollY,left:y.left+y.width/2-16+C-window.scrollX,cursor:"pointer",animationDelay:`${g*.08}s`,transition:"all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275)",zIndex:Dn-g},onMouseEnter:E=>{const k=E.currentTarget.getBoundingClientRect();window.innerHeight-k.bottom<180?ke(J=>({...J,[d._id]:"vg-top"})):ke(J=>({...J,[d._id]:""}))},onClick:()=>{W(!0),se(d._id)},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1743",className:`vg-pin-tooltip ${Ee[d._id]||""}`,children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1744",style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"8px"},children:[d.status==="ready_for_review"?o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1746",style:{display:"flex",alignItems:"center",gap:"6px",color:"#16a34a",fontWeight:700,fontSize:"11px"},children:[o.jsx(te,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1747",size:12})," ",n.readyForReview]}):o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1750",style:{display:"flex",alignItems:"center",gap:"6px",color:y.isModal?"#f59e0b":"#ea580c",fontWeight:700,fontSize:"11px"},children:[o.jsx(Xe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1751",size:12})," ",n.pending]}),y.isModal&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1755",style:{display:"flex",alignItems:"center",gap:"6px",color:"#f59e0b",fontWeight:700,fontSize:"11px",marginLeft:"auto"},children:o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1756",children:"MODAL"})})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1760",style:{fontWeight:500,color:"#1e293b",lineHeight:1.4},children:d.message})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1763",className:`vg-formal-pin ${d.status==="ready_for_review"?"ready":""} ${y.isModal?"modal-variant":""}`,children:d.status==="ready_for_review"?o.jsx(te,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1764",size:18}):y.isModal?o.jsx(Je,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1764",size:16}):o.jsx(_e,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1764",size:16})})]},`pin-${d._id}`)})]})})};function Ie(e,t,n){if(!t.endsWith(".tsx")&&!t.endsWith(".jsx")||t.includes("node_modules"))return e;const r=c=>c.replace(/\\/g,"/"),s=r(t).replace(r(n),"");return e.split(`
16
- `).map((c,p)=>{const u=p+1;return c.replace(/(^|[^a-zA-Z0-9])<([a-zA-Z][a-zA-Z0-9\.]*)(?=[ \t\n\/\>])/g,(b,f,w)=>b.includes("data-source-path")||w==="Fragment"||w==="React.Fragment"?b:`${f}<${w} data-source-path="${s}:${u}"`)}).join(`
17
- `)}function Qn(){return{name:"vite-plugin-viewgate",enforce:"pre",transform(e,t){return{code:Ie(e,t,process.cwd()),map:null}}}}function qn(e){const t=this.resourcePath;return t?(process.env.NODE_ENV,Ie(e,t,process.cwd())):e}I.ViewGate=$t,I.ViewGateOverlay=vt,I.transformSourcePaths=Ie,I.useViewGate=qe,I.viewgateNextLoader=qn,I.viewgatePlugin=Qn,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})}));
15
+ )`:"none",zIndex:zn}}),c&&u&&!f&&!W&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1284",className:"vg-selection-pulse",style:{top:u.rect.top-4,left:u.rect.left-4,width:u.rect.width+8,height:u.rect.height+8,zIndex:Dn},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1294",className:"vg-selection-label",style:{...u.rect.top<60?u.rect.bottom>window.innerHeight-60?{top:"8px",bottom:"auto"}:{top:"100%",marginTop:"8px",bottom:"auto"}:{top:"-40px",bottom:"auto"},...u.rect.left+200>window.innerWidth?{left:"auto",right:"0"}:{left:"0",right:"auto"}},children:[o.jsx(zt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1310",size:16}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1311",style:{display:"flex",flexDirection:"column"},children:[o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1312",style:{fontWeight:700},children:n.selectToComment}),o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1313",style:{fontSize:"10px",opacity:.8,fontFamily:"monospace"},children:[Math.round(u.rect.width)," × ",Math.round(u.rect.height)]})]})]})}),f&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1323",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:1328",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:1332",style:{textAlign:"center",marginBottom:"32px"},children:[o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1333",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(xe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1338",size:24})}),o.jsx("h2",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1340",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:1341",style:{margin:0,color:"#000000",fontSize:"15px"},children:n.feedbackSubheader})]}),f.visualPreview&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1345",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:f.visualPreview,alt:"Preview",style:{maxWidth:"100%",maxHeight:"200px",objectFit:"contain",display:"block"}})}),o.jsx("textarea",{className:"vg-textarea",value:h,onChange:d=>S(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:1372",style:{display:"flex",gap:"12px"},children:[o.jsx("button",{onClick:()=>!O&&v(null),className:"vg-button-ghost",disabled:O,style:{flex:1,padding:"12px"},children:n.cancel}),o.jsx("button",{onClick:nr,className:"vg-button-primary",disabled:O||!h.trim(),style:{flex:2},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1387",style:{display:"flex",alignItems:"center",gap:"8px"},children:[O?o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1388",className:"vg-spinner",style:{width:"16px",height:"16px",borderWidth:"2px"}}):o.jsx(Ht,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1388",size:18}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1389",children:O?n.submitting:n.sendFeedback||"Send Comment"})]})})]})]})}),A&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1399",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:1404",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:1408",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"20px"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1409",style:{display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("h2",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1410",style:{margin:0,fontSize:"20px",fontWeight:800,color:"#0f172a"},children:X?n.commentDetails:n.annotations}),!X&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1414",className:"vg-badge",style:{background:"#e0e7ff",color:"#6366f1"},children:T.length})]}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1419",style:{display:"flex",gap:"8px"},children:[X&&o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1421",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:1429",className:"vg-button-ghost",style:{padding:"8px",borderRadius:"50%"},onClick:()=>{U(!1),ie(null)},children:o.jsx(Oe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1434",size:20})})]})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1439",style:{maxHeight:"60vh",overflowY:"auto",paddingRight:"10px"},className:"vg-custom-scrollbar",children:pe?o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1441",style:{display:"flex",justifyContent:"center",padding:"40px"},children:o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1442",className:"vg-spinner"})}):(()=>{if(!X)return T;const d=fe.find(g=>g.annotations.some(w=>w._id===X));return d?d.annotations:T.filter(g=>g._id===X)})().map((d,g)=>o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1451",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:1462",style:{display:"flex",justifyContent:"space-between",marginBottom:"16px",alignItems:"center"},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1463",style:{display:"flex",gap:"12px",alignItems:"center"},children:[d.status==="ready_for_review"?o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1465",className:"vg-badge",style:{backgroundColor:"#f0fdf4",color:"#16a34a"},children:[o.jsx(ne,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1466",size:14})," ",n.readyForReview]}):o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1469",className:"vg-badge",style:{backgroundColor:"#fff7ed",color:"#ea580c"},children:[o.jsx(Lt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1470",size:14})," ",n.pending]}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1473",style:{fontSize:"12px",color:"#000000"},children:gt(d.timestamp||d.createdAt||d.reference?.timestamp,t)})]})}),St===d._id?o.jsx("textarea",{className:"vg-textarea",value:Ct,onChange:w=>Et(w.target.value),rows:3,autoFocus:!0,style:{marginBottom:"16px"}}):o.jsx("p",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1489",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:1492",style:{display:"flex",gap:"12px",justifyContent:"flex-end",borderTop:"1px solid #f1f5f9",paddingTop:"16px"},children:St===d._id?o.jsxs(o.Fragment,{children:[o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1495",className:"vg-button-primary vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:async()=>{try{(await fetch(`${s}/api/annotations/${d._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify({message:Ct})})).ok&&(De(null),ee(),e(n.updateSuccess,"success"))}catch{e(n.error,"error")}},children:n.save}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1517",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:()=>De(null),children:n.cancel})]}):o.jsxs(o.Fragment,{children:[o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1521",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:()=>{De(d._id),Et(d.message)},children:[o.jsx(Dt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1529",size:14})," ",n.edit]}),o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1531",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(Xe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1538",size:14})," ",n.review]}),d.status==="pending"?o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1541",className:"vg-button-primary vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px",animationDelay:"0.1s"},onClick:()=>{Y({title:n.markReadyConfirm,message:n.confirmMarkReady,type:"success",onConfirm:async()=>{try{(await fetch(`${s}/api/annotations/${d._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify({status:"ready_for_review"})})).ok&&(ee(),e(n.updateSuccess,"success"))}catch{e(n.error,"error")}finally{Y(null)}}})},children:[o.jsx(ne,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1569",size:14})," ",n.markReady]}):o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1572",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px",animationDelay:"0.1s"},onClick:()=>{Y({title:n.reopenConfirm,message:n.confirmReopen,type:"success",onConfirm:async()=>{try{(await fetch(`${s}/api/annotations/${d._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify({status:"pending"})})).ok&&(ee(),e(n.updateSuccess,"success"))}catch{e(n.error,"error")}finally{Y(null)}}})},children:[o.jsx(Ft,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1600",size:14})," ",n.reopen]}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1603",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 12px",color:"#ef4444",borderColor:"#fee2e2",animationDelay:"0.15s"},onClick:()=>{Y({title:n.deleteConfirm,message:n.confirmDelete,type:"danger",onConfirm:async()=>{try{(await fetch(`${s}/api/annotations/${d._id}`,{method:"DELETE",headers:{"x-api-key":r}})).ok&&(ee(),e(n.deleteSuccess,"success"))}catch{e(n.error,"error")}finally{Y(null)}}})},children:o.jsx(Ze,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1630",size:16})})]})})]},d._id))})]})}),G&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1645",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:1650",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:1657",style:{width:"64px",height:"64px",background:G.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:G.type==="danger"?"#ef4444":"#6366f1",transform:"rotate(-5deg)"},children:G.type==="danger"?o.jsx(Ze,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1666",size:32}):o.jsx(ne,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1666",size:32})}),o.jsx("h3",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1668",style:{margin:"0 0 12px 0",fontSize:"20px",fontWeight:800,color:"#000000",letterSpacing:"-0.02em"},children:G.title}),o.jsx("p",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1669",style:{margin:"0 0 32px 0",fontSize:"15px",color:"#000000",lineHeight:1.6},children:G.message}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1670",style:{display:"flex",gap:"16px"},children:[o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1671",className:"vg-button-ghost",style:{flex:1,height:"44px"},onClick:()=>!q&&Y(null),disabled:q,children:n.no}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1679",className:"vg-button-primary",style:{flex:1,height:"44px",backgroundColor:G.type==="danger"?"#ef4444":void 0,backgroundImage:G.type==="danger"?"none":void 0,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},disabled:q,onClick:async()=>{me(!0);try{await G.onConfirm()}catch(d){console.error("Confirmation error:",d)}finally{me(!1)}},children:q?o.jsx(It,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1704",size:18,className:"vg-animate-spin"}):n.yes})]})]})}),!c&&!A&&fe.map((d,g)=>{const{rect:w,annotations:V,isModal:_}=d,C=V[0],y=V.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:Fn},onMouseEnter:b=>{window.innerHeight-w.bottom<250?Re(I=>({...I,[d.id]:"vg-top"})):Re(I=>({...I,[d.id]:""}))},onClick:()=>{U(!0),ie(C._id)},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1743",className:`vg-pin-tooltip ${ke[d.id]||""}`,style:{width:"280px",padding:"16px"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1744",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"12px"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1745",style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx(xe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1746",size:14,color:"#6366f1"}),o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1747",style:{fontWeight:800,fontSize:"13px",color:"#0f172a"},children:[y," ",y===1?"Comentario":"Comentarios"]})]}),_&&o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1752",className:"vg-badge",style:{fontSize:"10px",background:"#fef3c7",color:"#92400e",border:"none"},children:"MODAL"})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1755",className:"vg-tooltip-scroll",style:{maxHeight:"180px",overflowY:"auto"},children:V.map((b,H)=>o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1757",style:{padding:"10px 0",borderTop:H===0?"none":"1px solid #f1f5f9",display:"flex",flexDirection:"column",gap:"4px"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1764",style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1765",style:{fontSize:"10px",fontWeight:600,color:"#64748b"},children:gt(b.timestamp||b.createdAt,t)}),b.status==="ready_for_review"&&o.jsx(ne,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1768",size:12,color:"#22c55e"})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1770",style:{fontSize:"13px",color:"#1e293b",lineHeight:1.4,fontWeight:500},children:b.message.length>80?b.message.slice(0,80)+"...":b.message})]},b._id))})]}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1778",className:`vg-formal-pin ${C.status==="ready_for_review"?"ready":""} ${_?"modal-variant":""}`,style:{position:"relative"},children:[C.status==="ready_for_review"?o.jsx(ne,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1779",size:18}):_?o.jsx(Xe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1779",size:16}):o.jsx(xe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1779",size:16}),y>1&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1782",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=c=>c.replace(/\\/g,"/"),s=r(t).replace(r(n),"");return e.split(`
16
+ `).map((c,m)=>{const u=m+1;return c.replace(/(^|[^a-zA-Z0-9])<([a-zA-Z][a-zA-Z0-9\.]*)(?=[ \t\n\/\>])/g,(E,f,v)=>E.includes("data-source-path")||v==="Fragment"||v==="React.Fragment"?E:`${f}<${v} data-source-path="${s}:${u}"`)}).join(`
17
+ `)}function Qn(){return{name:"vite-plugin-viewgate",enforce:"pre",transform(e,t){return{code:ze(e,t,process.cwd()),map:null}}}}function qn(e){const t=this.resourcePath;return t?(process.env.NODE_ENV,ze(e,t,process.cwd())):e}z.ViewGate=Ut,z.ViewGateOverlay=vt,z.transformSourcePaths=ze,z.useViewGate=Qe,z.viewgateNextLoader=qn,z.viewgatePlugin=Qn,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viewgate-wrapper",
3
- "version": "1.10.13",
3
+ "version": "1.10.14",
4
4
  "type": "module",
5
5
  "main": "./dist/viewgate-wrapper.umd.cjs",
6
6
  "module": "./dist/viewgate-wrapper.js",