viewgate-wrapper 1.10.8 → 1.10.10
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
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(
|
|
2
|
+
(function(M,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):(M=typeof globalThis<"u"?globalThis:M||self,m(M.ViewGateWrapper={},M.React,M.ReactDOM))})(this,(function(M,m,Et){"use strict";var fe={exports:{}},oe={};var Fe;function kt(){if(Fe)return oe;Fe=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,s){var i=null;if(s!==void 0&&(i=""+s),a.key!==void 0&&(i=""+a.key),"key"in a){s={};for(var d in a)d!=="key"&&(s[d]=a[d])}else s=a;return a=s.ref,{$$typeof:e,type:r,key:i,ref:a!==void 0?a:null,props:s}}return oe.Fragment=t,oe.jsx=n,oe.jsxs=n,oe}var ie={};var He;function Rt(){return He||(He=1,process.env.NODE_ENV!=="production"&&(function(){function e(c){if(c==null)return null;if(typeof c=="function")return c.$$typeof===ce?null:c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case P:return"Fragment";case H:return"Profiler";case F:return"StrictMode";case Le:return"Suspense";case W:return"SuspenseList";case vt:return"Activity"}if(typeof c=="object")switch(typeof c.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),c.$$typeof){case T:return"Portal";case L:return c.displayName||"Context";case G:return(c._context.displayName||"Context")+".Consumer";case _:var g=c.render;return c=c.displayName,c||(c=g.displayName||g.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case $:return g=c.displayName||null,g!==null?g:e(c.type)||"Memo";case we:g=c._payload,c=c._init;try{return e(c(g))}catch{}}return null}function t(c){return""+c}function n(c){try{t(c);var g=!1}catch{g=!0}if(g){g=console;var b=g.error,E=typeof Symbol=="function"&&Symbol.toStringTag&&c[Symbol.toStringTag]||c.constructor.name||"Object";return b.call(g,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",E),t(c)}}function r(c){if(c===P)return"<>";if(typeof c=="object"&&c!==null&&c.$$typeof===we)return"<...>";try{var g=e(c);return g?"<"+g+">":"<...>"}catch{return"<...>"}}function a(){var c=ne.A;return c===null?null:c.getOwner()}function s(){return Error("react-stack-top-frame")}function i(c){if(ve.call(c,"key")){var g=Object.getOwnPropertyDescriptor(c,"key").get;if(g&&g.isReactWarning)return!1}return c.key!==void 0}function d(c,g){function b(){re||(re=!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)",g))}b.isReactWarning=!0,Object.defineProperty(c,"key",{get:b,configurable:!0})}function p(){var c=e(this.type);return K[c]||(K[c]=!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.")),c=this.props.ref,c!==void 0?c:null}function u(c,g,b,E,se,Y){var j=b.ref;return c={$$typeof:S,type:c,key:g,props:b,_owner:E},(j!==void 0?j:null)!==null?Object.defineProperty(c,"ref",{enumerable:!1,get:p}):Object.defineProperty(c,"ref",{enumerable:!1,value:null}),c._store={},Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(c,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(c,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:se}),Object.defineProperty(c,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Y}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c}function v(c,g,b,E,se,Y){var j=g.children;if(j!==void 0)if(E)if(be(j)){for(E=0;E<j.length;E++)f(j[E]);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(ve.call(g,"key")){j=e(c);var V=Object.keys(g).filter(function(Me){return Me!=="key"});E=0<V.length?"{key: someKey, "+V.join(": ..., ")+": ...}":"{key: someKey}",Se[j+E]||(V=0<V.length?"{"+V.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} />`,k,C,N,C),re[C+k]=!0)}if(C=null,S!==void 0&&(n(S),C=""+S),i(h)&&(n(h.key),C=""+h.key),"key"in h){S={};for(var K in h)K!=="key"&&(S[K]=h[K])}else S=h;return C&&l(S,typeof c=="function"?c.displayName||c.name||"Unknown":c),u(c,C,S,a(),H,B)}function m(c){y(c)?c._store&&(c._store.validated=1):typeof c=="object"&&c!==null&&c.$$typeof===ye&&(c._payload.status==="fulfilled"?y(c._payload.value)&&c._payload.value._store&&(c._payload.value._store.validated=1):c._store&&(c._store.validated=1))}function y(c){return typeof c=="object"&&c!==null&&c.$$typeof===b}var g=f,b=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),G=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),Pe=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),ye=Symbol.for("react.lazy"),ut=Symbol.for("react.activity"),ie=Symbol.for("react.client.reference"),te=g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xe=Object.prototype.hasOwnProperty,we=Array.isArray,U=console.createTask?console.createTask:function(){return null};g={react_stack_bottom_frame:function(c){return c()}};var ne,Z={},ce=g.react_stack_bottom_frame.bind(g,s)(),le=U(r(s)),re={};oe.Fragment=T,oe.jsx=function(c,h,S){var k=1e4>te.recentlyCreatedOwnerStacks++;return w(c,h,S,!1,k?Error("react-stack-top-frame"):ce,k?U(r(c)):le)},oe.jsxs=function(c,h,S){var k=1e4>te.recentlyCreatedOwnerStacks++;return w(c,h,S,!0,k?Error("react-stack-top-frame"):ce,k?U(r(c)):le)}})()),oe}var Ne;function ht(){return Ne||(Ne=1,process.env.NODE_ENV==="production"?pe.exports=mt():pe.exports=ft()),pe.exports}var o=ht();const gt=({children:e})=>{const t=f.useRef(null),[n,r]=f.useState(null);return f.useEffect(()=>{if(t.current&&!t.current.shadowRoot){const a=t.current.attachShadow({mode:"open"});document.querySelectorAll("style[data-vite-dev-id], style:not([data-vite-dev-id])").forEach(l=>{(l.textContent?.includes(".vg-")||l.textContent?.includes("--vg-"))&&a.appendChild(l.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",a.appendChild(i),r(a)}},[]),o.jsx("div",{"data-source-path":"/src/components/ShadowRootWrapper.tsx:38",ref:t,id:"viewgate-shadow-host",children:n&&pt.createPortal(e,n)})};const Le=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const yt=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const xt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const Ie=e=>{const t=xt(e);return t.charAt(0).toUpperCase()+t.slice(1)};var wt={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 vt=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const bt=f.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:s,iconNode:i,...l},p)=>f.createElement("svg",{ref:p,...wt,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Le("lucide",a),...!s&&!vt(l)&&{"aria-hidden":"true"},...l},[...i.map(([u,w])=>f.createElement(u,w)),...Array.isArray(s)?s:[s]]));const I=(e,t)=>{const n=f.forwardRef(({className:r,...a},s)=>f.createElement(bt,{ref:s,iconNode:t,className:Le(`lucide-${yt(Ie(e))}`,`lucide-${e}`,r),...a}));return n.displayName=Ie(e),n};const Ct=I("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 Q=I("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const Me=I("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);const ze=I("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 St=I("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 Et=I("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const ve=I("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 kt=I("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 Rt=I("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 _t=I("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 jt=I("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 Fe=I("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 be=I("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Ot={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."}},De=f.createContext(void 0),He=()=>{const e=f.useContext(De);if(!e)throw new Error("useViewGate must be used within a ViewGateProvider");return e},Ce="viewgate_enabled",Vt=()=>typeof window>"u"?!1:new URLSearchParams(window.location.search).has("viewgate")?(sessionStorage.setItem(Ce,"true"),!0):sessionStorage.getItem(Ce)==="true",Tt=({children:e,language:t="es",apiKey:n,baseUrl:r="https://view-gate.vercel.app"})=>{const[a,s]=f.useState(!1),[i,l]=f.useState([]);f.useEffect(()=>{s(Vt())},[]);const p=()=>{if(sessionStorage.removeItem(Ce),s(!1),typeof window<"u"){const m=new URL(window.location.href);m.searchParams.delete("viewgate"),window.history.replaceState({},"",m.toString())}},u=(m,y)=>{const g=Date.now();l(b=>[...b,{id:g,message:m,type:y}]),setTimeout(()=>{l(b=>b.filter(_=>_.id!==g))},4e3)},w=Ot[t];return o.jsxs(De.Provider,{"data-source-path":"/src/components/ViewGateProvider.tsx:248",value:{addToast:u,language:t,t:w,apiKey:n,baseUrl:r,disableViewGate:p,hasActiveToasts:i.length>0},children:[e,a&&o.jsx(gt,{"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(dt,{"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(m=>o.jsxs("div",{"data-source-path":"/src/components/ViewGateProvider.tsx:264",className:`vg-toast vg-animate-slide ${m.type}`,children:[m.type==="success"?o.jsx(Q,{"data-source-path":"/src/components/ViewGateProvider.tsx:266",size:24,color:"#22c55e"}):o.jsx(Ct,{"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:m.type==="success"?w.successHeader:w.errorHeader}),o.jsx("span",{"data-source-path":"/src/components/ViewGateProvider.tsx:274",style:{fontSize:"14px",color:"#000000"},children:m.message})]})]},m.id))})]})})]})};function Pt(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),a=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(a),t&&(r.href=t),a.href=e,a.href}const At=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function X(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}let q=null;function We(e={}){return q||(e.includeStyleProperties?(q=e.includeStyleProperties,q):(q=X(window.getComputedStyle(document.documentElement)),q))}function me(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function Gt(e){const t=me(e,"border-left-width"),n=me(e,"border-right-width");return e.clientWidth+t+n}function Nt(e){const t=me(e,"border-top-width"),n=me(e,"border-bottom-width");return e.clientHeight+t+n}function $e(e,t={}){const n=t.width||Gt(e),r=t.height||Nt(e);return{width:n,height:r}}function Lt(){let e,t;try{t=process}catch{}const n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const M=16384;function It(e){(e.width>M||e.height>M)&&(e.width>M&&e.height>M?e.width>e.height?(e.height*=M/e.width,e.width=M):(e.width*=M/e.height,e.height=M):e.width>M?(e.height*=M/e.width,e.width=M):(e.width*=M/e.height,e.height=M))}function fe(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 Mt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function zt(e,t,n){const r="http://www.w3.org/2000/svg",a=document.createElementNS(r,"svg"),s=document.createElementNS(r,"foreignObject");return a.setAttribute("width",`${t}`),a.setAttribute("height",`${n}`),a.setAttribute("viewBox",`0 0 ${t} ${n}`),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("x","0"),s.setAttribute("y","0"),s.setAttribute("externalResourcesRequired","true"),a.appendChild(s),s.appendChild(e),Mt(a)}const A=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||A(n,t)};function Ft(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Dt(e,t){return We(t).map(n=>{const r=e.getPropertyValue(n),a=e.getPropertyPriority(n);return`${n}: ${r}${a?" !important":""};`}).join(" ")}function Ht(e,t,n,r){const a=`.${e}:${t}`,s=n.cssText?Ft(n):Dt(n,r);return document.createTextNode(`${a}{${s}}`)}function Ue(e,t,n,r){const a=window.getComputedStyle(e,n),s=a.getPropertyValue("content");if(s===""||s==="none")return;const i=At();try{t.className=`${t.className} ${i}`}catch{return}const l=document.createElement("style");l.appendChild(Ht(i,n,a,r)),t.appendChild(l)}function Wt(e,t,n){Ue(e,t,":before",n),Ue(e,t,":after",n)}const Be="application/font-woff",Ye="image/jpeg",$t={woff:Be,woff2:Be,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Ye,jpeg:Ye,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Ut(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Se(e){const t=Ut(e).toLowerCase();return $t[t]||""}function Bt(e){return e.split(/,/)[1]}function Ee(e){return e.search(/^(data:)/)!==-1}function Yt(e,t){return`data:${t};base64,${e}`}async function Xe(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const a=await r.blob();return new Promise((s,i)=>{const l=new FileReader;l.onerror=i,l.onloadend=()=>{try{s(n({res:r,result:l.result}))}catch(p){i(p)}},l.readAsDataURL(a)})}const ke={};function Xt(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 Re(e,t,n){const r=Xt(e,t,n.includeQueryParams);if(ke[r]!=null)return ke[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const s=await Xe(e,n.fetchRequestInit,({res:i,result:l})=>(t||(t=i.headers.get("Content-Type")||""),Bt(l)));a=Yt(s,t)}catch(s){a=n.imagePlaceholder||"";let i=`Failed to fetch resource: ${e}`;s&&(i=typeof s=="string"?s:s.message),i&&console.warn(i)}return ke[r]=a,a}async function Jt(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):fe(t)}async function Zt(e,t){if(e.currentSrc){const s=document.createElement("canvas"),i=s.getContext("2d");s.width=e.clientWidth,s.height=e.clientHeight,i?.drawImage(e,0,0,s.width,s.height);const l=s.toDataURL();return fe(l)}const n=e.poster,r=Se(n),a=await Re(n,r,t);return fe(a)}async function Kt(e,t){var n;try{if(!((n=e?.contentDocument)===null||n===void 0)&&n.body)return await he(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Qt(e,t){return A(e,HTMLCanvasElement)?Jt(e):A(e,HTMLVideoElement)?Zt(e,t):A(e,HTMLIFrameElement)?Kt(e,t):e.cloneNode(Je(e))}const qt=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Je=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function en(e,t,n){var r,a;if(Je(t))return t;let s=[];return qt(e)&&e.assignedNodes?s=X(e.assignedNodes()):A(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?s=X(e.contentDocument.body.childNodes):s=X(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),s.length===0||A(e,HTMLVideoElement)||await s.reduce((i,l)=>i.then(()=>he(l,n)).then(p=>{p&&t.appendChild(p)}),Promise.resolve()),t}function tn(e,t,n){const r=t.style;if(!r)return;const a=window.getComputedStyle(e);a.cssText?(r.cssText=a.cssText,r.transformOrigin=a.transformOrigin):We(n).forEach(s=>{let i=a.getPropertyValue(s);s==="font-size"&&i.endsWith("px")&&(i=`${Math.floor(parseFloat(i.substring(0,i.length-2)))-.1}px`),A(e,HTMLIFrameElement)&&s==="display"&&i==="inline"&&(i="block"),s==="d"&&t.getAttribute("d")&&(i=`path(${t.getAttribute("d")})`),r.setProperty(s,i,a.getPropertyPriority(s))})}function nn(e,t){A(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),A(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function rn(e,t){if(A(e,HTMLSelectElement)){const r=Array.from(t.children).find(a=>e.value===a.getAttribute("value"));r&&r.setAttribute("selected","")}}function sn(e,t,n){return A(t,Element)&&(tn(e,t,n),Wt(e,t,n),nn(e,t),rn(e,t)),t}async function an(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let s=0;s<n.length;s++){const l=n[s].getAttribute("xlink:href");if(l){const p=e.querySelector(l),u=document.querySelector(l);!p&&u&&!r[l]&&(r[l]=await he(u,t,!0))}}const a=Object.values(r);if(a.length){const s="http://www.w3.org/1999/xhtml",i=document.createElementNS(s,"svg");i.setAttribute("xmlns",s),i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.overflow="hidden",i.style.display="none";const l=document.createElementNS(s,"defs");i.appendChild(l);for(let p=0;p<a.length;p++)l.appendChild(a[p]);e.appendChild(i)}return e}async function he(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>Qt(r,t)).then(r=>en(e,r,t)).then(r=>sn(e,r,t)).then(r=>an(r,t))}const Ze=/url\((['"]?)([^'"]+?)\1\)/g,on=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,cn=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function ln(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function dn(e){const t=[];return e.replace(Ze,(n,r,a)=>(t.push(a),n)),t.filter(n=>!Ee(n))}async function un(e,t,n,r,a){try{const s=n?Pt(t,n):t,i=Se(t);let l;return a||(l=await Re(s,i,r)),e.replace(ln(t),`$1${l}$3`)}catch{}return e}function pn(e,{preferredFontFormat:t}){return t?e.replace(cn,n=>{for(;;){const[r,,a]=on.exec(n)||[];if(!a)return"";if(a===t)return`src: ${r};`}}):e}function Ke(e){return e.search(Ze)!==-1}async function Qe(e,t,n){if(!Ke(e))return e;const r=pn(e,n);return dn(r).reduce((s,i)=>s.then(l=>un(l,i,t,n)),Promise.resolve(r))}async function ee(e,t,n){var r;const a=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(a){const s=await Qe(a,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function mn(e,t){await ee("background",e,t)||await ee("background-image",e,t),await ee("mask",e,t)||await ee("-webkit-mask",e,t)||await ee("mask-image",e,t)||await ee("-webkit-mask-image",e,t)}async function fn(e,t){const n=A(e,HTMLImageElement);if(!(n&&!Ee(e.src))&&!(A(e,SVGImageElement)&&!Ee(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,a=await Re(r,Se(r),t);await new Promise((s,i)=>{e.onload=s,e.onerror=t.onImageErrorHandler?(...p)=>{try{s(t.onImageErrorHandler(...p))}catch(u){i(u)}}:i;const l=e;l.decode&&(l.decode=s),l.loading==="lazy"&&(l.loading="eager"),n?(e.srcset="",e.src=a):e.href.baseVal=a})}async function hn(e,t){const r=X(e.childNodes).map(a=>qe(a,t));await Promise.all(r).then(()=>e)}async function qe(e,t){A(e,Element)&&(await mn(e,t),await fn(e,t),await hn(e,t))}function gn(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(a=>{n[a]=r[a]}),e}const et={};async function tt(e){let t=et[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},et[e]=t,t}async function nt(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,s=(n.match(/url\([^)]+\)/g)||[]).map(async i=>{let l=i.replace(r,"$1");return l.startsWith("https://")||(l=new URL(l,e.url).href),Xe(l,t.fetchRequestInit,({result:p})=>(n=n.replace(i,`url(${p})`),[i,p]))});return Promise.all(s).then(()=>n)}function rt(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const p=a.exec(r);if(p===null)break;t.push(p[0])}r=r.replace(a,"");const s=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",l=new RegExp(i,"gi");for(;;){let p=s.exec(r);if(p===null){if(p=l.exec(r),p===null)break;s.lastIndex=l.lastIndex}else l.lastIndex=s.lastIndex;t.push(p[0])}return t}async function yn(e,t){const n=[],r=[];return e.forEach(a=>{if("cssRules"in a)try{X(a.cssRules||[]).forEach((s,i)=>{if(s.type===CSSRule.IMPORT_RULE){let l=i+1;const p=s.href,u=tt(p).then(w=>nt(w,t)).then(w=>rt(w).forEach(m=>{try{a.insertRule(m,m.startsWith("@import")?l+=1:a.cssRules.length)}catch(y){console.error("Error inserting rule from remote css",{rule:m,error:y})}})).catch(w=>{console.error("Error loading remote css",w.toString())});r.push(u)}})}catch(s){const i=e.find(l=>l.href==null)||document.styleSheets[0];a.href!=null&&r.push(tt(a.href).then(l=>nt(l,t)).then(l=>rt(l).forEach(p=>{i.insertRule(p,i.cssRules.length)})).catch(l=>{console.error("Error loading remote stylesheet",l)})),console.error("Error inlining remote css file",s)}}),Promise.all(r).then(()=>(e.forEach(a=>{if("cssRules"in a)try{X(a.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${a.href}`,s)}}),n))}function xn(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Ke(t.style.getPropertyValue("src")))}async function wn(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=X(e.ownerDocument.styleSheets),r=await yn(n,t);return xn(r)}function st(e){return e.trim().replace(/["']/g,"")}function vn(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(s=>{t.add(st(s))}),Array.from(r.children).forEach(s=>{s instanceof HTMLElement&&n(s)})}return n(e),t}async function bn(e,t){const n=await wn(e,t),r=vn(e);return(await Promise.all(n.filter(s=>r.has(st(s.style.fontFamily))).map(s=>{const i=s.parentStyleSheet?s.parentStyleSheet.href:null;return Qe(s.cssText,i,t)}))).join(`
|
|
8
|
-
`)}async function Cn(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await bn(e,t);if(n){const r=document.createElement("style"),a=document.createTextNode(n);r.appendChild(a),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function Sn(e,t={}){const{width:n,height:r}=$e(e,t),a=await he(e,t,!0);return await Cn(a,t),await qe(a,t),gn(a,t),await zt(a,n,r)}async function En(e,t={}){const{width:n,height:r}=$e(e,t),a=await Sn(e,t),s=await fe(a),i=document.createElement("canvas"),l=i.getContext("2d"),p=t.pixelRatio||Lt(),u=t.canvasWidth||n,w=t.canvasHeight||r;return i.width=u*p,i.height=w*p,t.skipAutoScale||It(i),i.style.width=`${u}`,i.style.height=`${w}`,t.backgroundColor&&(l.fillStyle=t.backgroundColor,l.fillRect(0,0,i.width,i.height)),l.drawImage(s,0,0,i.width,i.height),i}async function at(e,t={}){return(await En(e,t)).toDataURL("image/jpeg",t.quality||1)}const ge=2147483647,_e=ge,je=2e6,kn=ge-10,Rn=ge-5,_n=ge-15,jn=()=>{const e=window.innerWidth;return e<768?"mobile":e<1024?"tablet":"desktop"},On=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)},Vn=(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""}},Tn=e=>{const t=(e.innerText||"").slice(0,30).trim(),n={tag:e.tagName.toLowerCase(),classHash:On(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 a=e.getAttribute("role");a&&(n.role=a);const s=e.getAttribute("name");return s&&(n.name=s),n},Pn=(()=>{let e=null,t=null;return n=>{if(!n||typeof window>"u"||typeof document>"u")return n;if(n.includes("oklch")||n.includes("oklab")||n.includes("lab(")||n.includes("lch(")||n.includes("color("))try{if(e||(e=document.createElement("canvas"),e.width=1,e.height=1),t||(t=e.getContext("2d",{willReadFrequently:!0})),t){t.fillStyle="#000000",t.fillStyle=n;const s=t.fillStyle;if(s&&!s.includes("oklch")&&!s.includes("oklab"))return s}const r=document.createElement("div");r.style.color=n,document.body.appendChild(r);const a=getComputedStyle(r).color;return document.body.removeChild(r),a&&!a.includes("oklch")?a:"rgb(0,0,0)"}catch{return"rgb(0,0,0)"}return n}})(),ot=(e,t,n,r)=>new Promise(a=>{const s=new Image;s.onload=()=>{const i=document.createElement("canvas"),l=window.devicePixelRatio||1,p=t.width+n*2,u=t.height+n*2;i.width=p*l,i.height=u*l;const w=i.getContext("2d");if(w){w.scale(l,l);let m=(t.left-n)*r,y=(t.top-n)*r,g=p*r,b=u*r,_=0,T=0,z=p,F=u;m<0&&(_=Math.abs(m)/r,g+=m,z-=_,m=0),m+g>s.width&&(g=s.width-m,z=g/r),y<0&&(T=Math.abs(y)/r,b+=y,F-=T,y=0),y+b>s.height&&(b=s.height-y,F=b/r),w.fillStyle="#f8fafc",w.fillRect(0,0,p,u),g>0&&b>0&&w.drawImage(s,m,y,g,b,_,T,z,F)}a(i.toDataURL("image/png"))},s.onerror=()=>a(""),s.src=e}),An=e=>{const t=window.getComputedStyle(e),n={};return["display","position","margin","padding","font-size","color","background-color","width","height","z-index"].forEach(a=>{const s=t.getPropertyValue(a);n[a]=Pn(s)}),n},Gn=e=>{const n=Object.keys(e).find(s=>s.startsWith("__reactFiber$")||s.startsWith("__reactInternalInstance$"));if(!n)return"";const r=[];let a=e[n];for(;a;){const s=a.type;if(typeof s=="function"){const i=s.displayName||s.name;i&&!i.includes("ViewGate")&&!r.includes(i)&&r.unshift(i)}a=a.return}return r.join(" > ")||"Generic Component"},it=e=>{if(!e)return!1;const t=window.getComputedStyle(e),n=e.getBoundingClientRect(),r=e.getAttribute("role");if(r&&["listbox","menu","combobox","tooltip","option"].includes(r))return!1;const s=120;return n.width<s&&n.height<s||t.position!=="fixed"&&t.position!=="absolute"?!1:!!(e.closest('[role="dialog"]')||e.closest('[aria-modal="true"]')||e.classList.contains("modal")||e.classList.contains("modal-content"))},ct=e=>{if(!e.isConnected)return!1;const t=window.getComputedStyle(e);if(t.display==="none"||t.visibility==="hidden"||t.opacity==="0"||e.offsetWidth===0||e.offsetHeight===0)return!1;let n=e.parentElement;for(;n;){const a=window.getComputedStyle(n);if(a.display==="none"||a.visibility==="hidden"||a.opacity==="0")return!1;n=n.parentElement}const r=e.getBoundingClientRect();return!(r.width===0||r.height===0||r.top===0&&r.left===0&&r.width>window.innerWidth*.9)},Oe=(e,t=document)=>{const n=t.querySelector(e);if(n)return n;const r=t.querySelectorAll("*");for(const a of Array.from(r)){const s=a.shadowRoot;if(s){const i=Oe(e,s);if(i)return i}}return null},lt=(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},Nn=e=>{if(!e.tag)return null;const t=document.getElementsByTagName(e.tag);let n=null,r=0;for(let a=0;a<t.length;a++){const s=t[a];let i=0;s.innerText?.includes(e.text.slice(0,20))&&(i+=4),e.fingerprint?.classHash&&s.className.includes(e.fingerprint.classHash)&&(i+=2),e.fingerprint?.ariaLabel&&s.getAttribute("aria-label")===e.fingerprint.ariaLabel&&(i+=3),e.fingerprint?.role&&s.getAttribute("role")===e.fingerprint.role&&(i+=2),e.parentContext&&(s.parentElement?.innerText||"").includes(e.parentContext.slice(0,30))&&(i+=2),e.fingerprint?.neighborCount===s.parentElement?.children.length&&(i+=1),e.fingerprint?.parentTag===s.parentElement?.tagName.toLowerCase()&&(i+=1),i>r&&i>=5&&(r=i,n=s)}return n},Ln=e=>{let t=Oe(e.selector);if(t)return t;if(e.fallbackSelectors){for(const n of e.fallbackSelectors)if(t=Oe(n),t)return t}return t=Nn(e),t||null},Ve=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}),In=e=>{const t=e.parentElement;if(!t)return;const n=Array.from(t.children).filter(i=>i!==e).slice(0,5).map(i=>Ve(i)),r=Array.from(t.children),a=r.indexOf(e);let s="middle";return a===0&&(s="start"),a===r.length-1&&(s="end"),{target:{...Ve(e),location:`${s} of ${t.tagName.toLowerCase()}`},parent:Ve(t),siblings:n}},Mn=e=>{let t="unknown:0",n=e;for(;n;){const m=n.getAttribute("data-source-path");if(m){t=m;break}n=n.parentElement}const r=Gn(e),a=[],s=[],i=m=>{const y=[];let g=m;for(;g&&g.nodeType===Node.ELEMENT_NODE;){let b=g.nodeName.toLowerCase();s.unshift(b);const _=g.id&&!g.id.startsWith("__")?g.id:null;_&&a.push(`#${_}`);const T=g.getAttribute("data-testid")||g.getAttribute("data-qa");T&&a.push(`[data-testid="${T}"]`);const z=g.getAttribute("aria-label"),F=g.getAttribute("role"),P=g.getAttribute("name");if(T){b=`[${g.hasAttribute("data-testid")?"data-testid":"data-qa"}="${T}"]`,y.unshift(b);break}else if(_){b="#"+_,y.unshift(b);break}else if(z){b=`${g.localName}[aria-label="${z}"]`,y.unshift(b);break}else if(F){b=`${g.localName}[role="${F}"]`,y.unshift(b);break}else if(P){b=`${g.localName}[name="${P}"]`,y.unshift(b);break}else{let G=g,R=1;for(;G.previousElementSibling;)G=G.previousElementSibling,G.nodeName.toLowerCase()===g.nodeName.toLowerCase()&&R++;R>1&&(b+=`:nth-of-type(${R})`)}y.unshift(b),g=g.parentElement}return y.join(" > ")},l=it(e.closest('[role="dialog"], [aria-modal="true"], .modal, .modal-content')),p=i(e),u={};["placeholder","aria-label","name","type","alt","title","value","role"].forEach(m=>{const y=e.getAttribute(m);y&&(u[m]=y)});const w=`${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:w,source:t,attributes:u,fallbackSelectors:[...new Set(a)].slice(0,5),domPath:s.slice(-10),viewportSize:{width:window.innerWidth,height:window.innerHeight},uiContext:In(e),fingerprint:Tn(e),metadata:{hint:`Edit ${t.split(":")[0]} at line ${t.split(":")[1]||"?"}`,computedStyles:An(e),viewportBreakpoint:jn(),outerHtml:e.outerHTML.slice(0,1500),scrollPosition:{x:window.scrollX,y:window.scrollY},isModal:l}}},dt=()=>{const{addToast:e,language:t,t:n,apiKey:r,baseUrl:a,disableViewGate:s,hasActiveToasts:i}=He(),[l,p]=f.useState(!1),[u,w]=f.useState(null),[m,y]=f.useState(null),[g,b]=f.useState(""),[_,T]=f.useState(!1),[z,F]=f.useState(!1),[P,G]=f.useState(!1),[R,Pe]=f.useState([]),[D,W]=f.useState(null),[ye,ut]=f.useState(!1),[ie,te]=f.useState(!1),[xe,we]=f.useState({}),[U,ne]=f.useState(null),[Z,ce]=f.useState(!1),[le,re]=f.useState(null),[c,h]=f.useState(""),[S,k]=f.useState({}),H=f.useRef(null),B=f.useRef(null),C=f.useCallback(()=>{B.current||(B.current=requestAnimationFrame(()=>{const d={},x=Array.from(document.querySelectorAll('[role="dialog"], [aria-modal="true"], .modal, .modal-content')).find(j=>it(j)&&ct(j)),$=!!x;R.forEach(j=>{if(!j.reference)return;const O=Ln(j.reference),E=!!j.reference.metadata?.isModal;if(O&&ct(O)){let se=!1;if($?se=x.contains(O):se=!E,!se)return;const V=O.getBoundingClientRect(),ue=V.left+V.width/2,Y=V.top+V.height/2;if(ue>=0&&ue<=window.innerWidth&&Y>=0&&Y<=window.innerHeight){const J=document.elementFromPoint(ue,Y);if(J&&!O.contains(J)&&!H.current?.contains(J))return}d[j._id]={top:V.top+window.scrollY,left:V.left+window.scrollX,width:V.width,isModal:E}}}),k(d),B.current=null}))},[R]),N=f.useCallback(async()=>{if(r){te(!0);try{const d=await fetch(`${a}/api/annotations`,{headers:{"x-api-key":r}});if(d.ok){const v=await d.json();Pe(v.data||[])}}catch(d){console.error("Failed to fetch annotations",d)}finally{te(!1)}}},[r,a]);f.useEffect(()=>{P&&R.length===0&&!ie&&G(!1)},[P,R.length,ie]),f.useEffect(()=>{if(!l&&R.length>0){C();const d=new MutationObserver(()=>C()),v=new ResizeObserver(()=>C()),x=()=>C();return d.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}),v.observe(document.documentElement),window.addEventListener("scroll",x,!0),()=>{d.disconnect(),v.disconnect(),window.removeEventListener("scroll",x,!0),B.current&&cancelAnimationFrame(B.current)}}},[l,R.length,C]),f.useEffect(()=>{N()},[N]),f.useEffect(()=>{H.current=document.getElementById("viewgate-shadow-host")},[]);const K=f.useCallback(d=>{if(!l||m)return;const v=lt(d.clientX,d.clientY);if(!v||H.current?.contains(v)||v.closest(".vg-no-capture")){w(null);return}const x=v.getBoundingClientRect();w({tag:v.tagName.toLowerCase(),source:v.getAttribute("data-source-path")||"unknown:0",rect:x,element:v,previewText:(v.innerText||"").slice(0,100)||(v.getAttribute("placeholder")||"").slice(0,100)||v.tagName.toLowerCase(),semanticReference:{...Mn(v),normalizedOffset:{x:(d.clientX-x.left)/x.width,y:(d.clientY-x.top)/x.height}}})},[l,m]),de=f.useCallback(async d=>{if(!l||m)return;const v=lt(d.clientX,d.clientY);if(!(!v||H.current?.contains(v)||v.closest(".vg-no-capture"))&&u){d.preventDefault(),d.stopPropagation(),F(!0);try{const x=u.element.getBoundingClientRect(),$=24,j=2,O=await at(document.documentElement,{quality:.9,pixelRatio:j,cacheBust:!0,width:window.innerWidth,height:window.innerHeight,style:{transform:`scale(${1/window.devicePixelRatio}) translate(-${window.scrollX}px, -${window.scrollY}px)`,transformOrigin:"top left"},filter:Y=>{const J=Y;return!(H.current?.contains(J)||J.id==="viewgate-ui")}}),E=u.element.getBoundingClientRect(),se=E.top>=0&&E.left>=0&&E.bottom<=window.innerHeight&&E.right<=window.innerWidth;let V="";if(se&&E.width>0&&E.height>0)V=await ot(O,E,$,j);else try{V=await at(u.element,{quality:.9,pixelRatio:j,cacheBust:!0,filter:Y=>{const J=Y;return!H.current?.contains(J)}})}catch(Y){console.warn("Direct element capture failed, falling back to viewport crop:",Y),V=await ot(O,E,$,j)}const ue={...u.semanticReference,metadata:{...u.semanticReference.metadata,screenshotUrl:O,elementScreenshot:V}};y({...u,visualPreview:V,semanticReference:ue})}catch(x){console.error("Failed to capture preview:",x),y(u)}finally{F(!1),w(null)}}},[l,u,m]);f.useEffect(()=>{const d=v=>{if(v.key==="Escape"){m?y(null):P?G(!1):l&&p(!1);return}const $=(()=>{let E=document.activeElement;for(;E&&E.shadowRoot&&E.shadowRoot.activeElement;)E=E.shadowRoot.activeElement;return E})();if(["input","textarea"].includes(($?.tagName||"").toLowerCase())||$?.isContentEditable)return;const O=v.key.toLowerCase();O==="c"&&!m&&!P&&p(E=>!E),O==="v"&&!m&&(R.length>0||P)&&(G(E=>!E),P||p(!1))};return l&&!m?document.body.classList.add("vg-cursor-pointer"):document.body.classList.remove("vg-cursor-pointer"),window.addEventListener("keydown",d),window.addEventListener("mousemove",K,!0),window.addEventListener("click",de,!0),()=>{document.body.classList.remove("vg-cursor-pointer"),window.removeEventListener("keydown",d),window.removeEventListener("mousemove",K,!0),window.removeEventListener("click",de,!0)}},[l,m,P,R,K,de]);const Dn=async()=>{if(!m||!g.trim())return;T(!0);const{semanticReference:d}=m,[v,x]=(d.source||"").split(":"),$=x||"0";try{if(!(await fetch(`${a}/api/annotations`,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify({filePath:v,line:parseInt($),url:window.location.href,message:g,componentName:d.componentPath||m.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"),y(null),b(""),p(!1),N()}catch(j){console.error(j),e(n.error,"error")}finally{T(!1)}};return o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:895",className:"vg-container",children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:896",className:"vg-no-capture",children:[!i&&o.jsx("button",{onClick:d=>{d.stopPropagation(),W({title:n.exitConfirmTitle||"Close ViewGate?",message:n.exitConfirmMessage||"Are you sure you want to close ViewGate?",type:"danger",onConfirm:()=>s()})},title:"Cerrar ViewGate",style:{position:"fixed",top:"24px",right:"24px",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)",zIndex:_e+10},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(be,{"data-source-path":"/src/components/ViewGateOverlay.tsx:940",size:20,strokeWidth:2.5})}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:945",style:{position:"fixed",bottom:"30px",right:"30px",zIndex:_e},id:"viewgate-ui",children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:946",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(!l),className:"vg-button-primary vg-animate-pop",style:{padding:"12px 24px",background:l?"#ef4444":void 0},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:955",style:{display:"flex",alignItems:"center",gap:"10px"},children:[l?o.jsx(be,{"data-source-path":"/src/components/ViewGateOverlay.tsx:956",size:20,className:"vg-animate-pop"}):o.jsx(ve,{"data-source-path":"/src/components/ViewGateOverlay.tsx:956",size:20,className:"vg-animate-pop"}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:957",children:l?n.exitMode:n.enterMode})]})}),R.length>0&&o.jsxs("button",{onClick:()=>{G(!P),p(!1),y(null)},className:"vg-button-ghost vg-animate-pop",style:{animationDelay:"0.1s"},children:[o.jsx(St,{"data-source-path":"/src/components/ViewGateOverlay.tsx:970",size:20}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:971",children:n.viewComments})]})]})}),z&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:979",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:_e+1,cursor:"wait"},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:985",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:986",className:"vg-spinner"}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:987",style:{fontWeight:600,fontSize:"14px",color:"#000000"},children:"Capturando..."})]})}),l&&!m&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:994",className:"vg-backdrop-blur",style:{opacity:1,clipPath:u?`polygon(
|
|
7
|
+
<%s key={someKey} {...props} />`,E,j,V,j),Se[j+E]=!0)}if(j=null,b!==void 0&&(n(b),j=""+b),i(g)&&(n(g.key),j=""+g.key),"key"in g){b={};for(var de in g)de!=="key"&&(b[de]=g[de])}else b=g;return j&&d(b,typeof c=="function"?c.displayName||c.name||"Unknown":c),u(c,j,b,a(),se,Y)}function f(c){w(c)?c._store&&(c._store.validated=1):typeof c=="object"&&c!==null&&c.$$typeof===we&&(c._payload.status==="fulfilled"?w(c._payload.value)&&c._payload.value._store&&(c._payload.value._store.validated=1):c._store&&(c._store.validated=1))}function w(c){return typeof c=="object"&&c!==null&&c.$$typeof===S}var x=m,S=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"),G=Symbol.for("react.consumer"),L=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),Le=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),we=Symbol.for("react.lazy"),vt=Symbol.for("react.activity"),ce=Symbol.for("react.client.reference"),ne=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ve=Object.prototype.hasOwnProperty,be=Array.isArray,B=console.createTask?console.createTask:function(){return null};x={react_stack_bottom_frame:function(c){return c()}};var re,K={},le=x.react_stack_bottom_frame.bind(x,s)(),U=B(r(s)),Se={};ie.Fragment=P,ie.jsx=function(c,g,b){var E=1e4>ne.recentlyCreatedOwnerStacks++;return v(c,g,b,!1,E?Error("react-stack-top-frame"):le,E?B(r(c)):U)},ie.jsxs=function(c,g,b){var E=1e4>ne.recentlyCreatedOwnerStacks++;return v(c,g,b,!0,E?Error("react-stack-top-frame"):le,E?B(r(c)):U)}})()),ie}var We;function jt(){return We||(We=1,process.env.NODE_ENV==="production"?fe.exports=kt():fe.exports=Rt()),fe.exports}var o=jt();const _t=({children:e})=>{const t=m.useRef(null),[n,r]=m.useState(null);return m.useEffect(()=>{if(t.current&&!t.current.shadowRoot){const a=t.current.attachShadow({mode:"open"});document.querySelectorAll("style[data-vite-dev-id], style:not([data-vite-dev-id])").forEach(d=>{(d.textContent?.includes(".vg-")||d.textContent?.includes("--vg-"))&&a.appendChild(d.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",a.appendChild(i),r(a)}},[]),o.jsx("div",{"data-source-path":"/src/components/ShadowRootWrapper.tsx:38",ref:t,id:"viewgate-shadow-host",children:n&&Et.createPortal(e,n)})};const $e=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const Ot=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Tt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const Be=e=>{const t=Tt(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Vt={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 Pt=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:a="",children:s,iconNode:i,...d},p)=>m.createElement("svg",{ref:p,...Vt,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:$e("lucide",a),...!s&&!Pt(d)&&{"aria-hidden":"true"},...d},[...i.map(([u,v])=>m.createElement(u,v)),...Array.isArray(s)?s:[s]]));const A=(e,t)=>{const n=m.forwardRef(({className:r,...a},s)=>m.createElement(Gt,{ref:s,iconNode:t,className:$e(`lucide-${Ot(Be(e))}`,`lucide-${e}`,r),...a}));return n.displayName=Be(e),n};const At=A("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 q=A("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const Ue=A("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);const Ye=A("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 Nt=A("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 Xe=A("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 Lt=A("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const Ee=A("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 Mt=A("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 It=A("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 zt=A("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 Dt=A("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 Je=A("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 ke=A("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Ft={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."}},Ze=m.createContext(void 0),Ke=()=>{const e=m.useContext(Ze);if(!e)throw new Error("useViewGate must be used within a ViewGateProvider");return e},Re="viewgate_enabled",Ht=()=>typeof window>"u"?!1:new URLSearchParams(window.location.search).has("viewgate")?(sessionStorage.setItem(Re,"true"),!0):sessionStorage.getItem(Re)==="true",Wt=({children:e,language:t="es",apiKey:n,baseUrl:r="https://view-gate.vercel.app"})=>{const[a,s]=m.useState(!1),[i,d]=m.useState([]);m.useEffect(()=>{s(Ht())},[]);const p=()=>{if(sessionStorage.removeItem(Re),s(!1),typeof window<"u"){const f=new URL(window.location.href);f.searchParams.delete("viewgate"),window.history.replaceState({},"",f.toString())}},u=(f,w)=>{const x=Date.now();d(S=>[...S,{id:x,message:f,type:w}]),setTimeout(()=>{d(S=>S.filter(T=>T.id!==x))},4e3)},v=Ft[t];return o.jsxs(Ze.Provider,{"data-source-path":"/src/components/ViewGateProvider.tsx:248",value:{addToast:u,language:t,t:v,apiKey:n,baseUrl:r,disableViewGate:p,hasActiveToasts:i.length>0},children:[e,a&&o.jsx(_t,{"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(wt,{"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(q,{"data-source-path":"/src/components/ViewGateProvider.tsx:266",size:24,color:"#22c55e"}):o.jsx(At,{"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"?v.successHeader:v.errorHeader}),o.jsx("span",{"data-source-path":"/src/components/ViewGateProvider.tsx:274",style:{fontSize:"14px",color:"#000000"},children:f.message})]})]},f.id))})]})})]})};function $t(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),a=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(a),t&&(r.href=t),a.href=e,a.href}const Bt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function J(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}let ee=null;function Qe(e={}){return ee||(e.includeStyleProperties?(ee=e.includeStyleProperties,ee):(ee=J(window.getComputedStyle(document.documentElement)),ee))}function he(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function Ut(e){const t=he(e,"border-left-width"),n=he(e,"border-right-width");return e.clientWidth+t+n}function Yt(e){const t=he(e,"border-top-width"),n=he(e,"border-bottom-width");return e.clientHeight+t+n}function qe(e,t={}){const n=t.width||Ut(e),r=t.height||Yt(e);return{width:n,height:r}}function Xt(){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 I=16384;function Jt(e){(e.width>I||e.height>I)&&(e.width>I&&e.height>I?e.width>e.height?(e.height*=I/e.width,e.width=I):(e.width*=I/e.height,e.height=I):e.width>I?(e.height*=I/e.width,e.width=I):(e.width*=I/e.height,e.height=I))}function ge(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 Zt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Kt(e,t,n){const r="http://www.w3.org/2000/svg",a=document.createElementNS(r,"svg"),s=document.createElementNS(r,"foreignObject");return a.setAttribute("width",`${t}`),a.setAttribute("height",`${n}`),a.setAttribute("viewBox",`0 0 ${t} ${n}`),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("x","0"),s.setAttribute("y","0"),s.setAttribute("externalResourcesRequired","true"),a.appendChild(s),s.appendChild(e),Zt(a)}const N=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||N(n,t)};function Qt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function qt(e,t){return Qe(t).map(n=>{const r=e.getPropertyValue(n),a=e.getPropertyPriority(n);return`${n}: ${r}${a?" !important":""};`}).join(" ")}function en(e,t,n,r){const a=`.${e}:${t}`,s=n.cssText?Qt(n):qt(n,r);return document.createTextNode(`${a}{${s}}`)}function et(e,t,n,r){const a=window.getComputedStyle(e,n),s=a.getPropertyValue("content");if(s===""||s==="none")return;const i=Bt();try{t.className=`${t.className} ${i}`}catch{return}const d=document.createElement("style");d.appendChild(en(i,n,a,r)),t.appendChild(d)}function tn(e,t,n){et(e,t,":before",n),et(e,t,":after",n)}const tt="application/font-woff",nt="image/jpeg",nn={woff:tt,woff2:tt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:nt,jpeg:nt,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function rn(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function je(e){const t=rn(e).toLowerCase();return nn[t]||""}function sn(e){return e.split(/,/)[1]}function _e(e){return e.search(/^(data:)/)!==-1}function an(e,t){return`data:${t};base64,${e}`}async function rt(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const a=await r.blob();return new Promise((s,i)=>{const d=new FileReader;d.onerror=i,d.onloadend=()=>{try{s(n({res:r,result:d.result}))}catch(p){i(p)}},d.readAsDataURL(a)})}const Oe={};function on(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 Te(e,t,n){const r=on(e,t,n.includeQueryParams);if(Oe[r]!=null)return Oe[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const s=await rt(e,n.fetchRequestInit,({res:i,result:d})=>(t||(t=i.headers.get("Content-Type")||""),sn(d)));a=an(s,t)}catch(s){a=n.imagePlaceholder||"";let i=`Failed to fetch resource: ${e}`;s&&(i=typeof s=="string"?s:s.message),i&&console.warn(i)}return Oe[r]=a,a}async function cn(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ge(t)}async function ln(e,t){if(e.currentSrc){const s=document.createElement("canvas"),i=s.getContext("2d");s.width=e.clientWidth,s.height=e.clientHeight,i?.drawImage(e,0,0,s.width,s.height);const d=s.toDataURL();return ge(d)}const n=e.poster,r=je(n),a=await Te(n,r,t);return ge(a)}async function dn(e,t){var n;try{if(!((n=e?.contentDocument)===null||n===void 0)&&n.body)return await ye(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function un(e,t){return N(e,HTMLCanvasElement)?cn(e):N(e,HTMLVideoElement)?ln(e,t):N(e,HTMLIFrameElement)?dn(e,t):e.cloneNode(st(e))}const pn=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",st=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function mn(e,t,n){var r,a;if(st(t))return t;let s=[];return pn(e)&&e.assignedNodes?s=J(e.assignedNodes()):N(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?s=J(e.contentDocument.body.childNodes):s=J(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),s.length===0||N(e,HTMLVideoElement)||await s.reduce((i,d)=>i.then(()=>ye(d,n)).then(p=>{p&&t.appendChild(p)}),Promise.resolve()),t}function fn(e,t,n){const r=t.style;if(!r)return;const a=window.getComputedStyle(e);a.cssText?(r.cssText=a.cssText,r.transformOrigin=a.transformOrigin):Qe(n).forEach(s=>{let i=a.getPropertyValue(s);s==="font-size"&&i.endsWith("px")&&(i=`${Math.floor(parseFloat(i.substring(0,i.length-2)))-.1}px`),N(e,HTMLIFrameElement)&&s==="display"&&i==="inline"&&(i="block"),s==="d"&&t.getAttribute("d")&&(i=`path(${t.getAttribute("d")})`),r.setProperty(s,i,a.getPropertyPriority(s))})}function hn(e,t){N(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),N(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function gn(e,t){if(N(e,HTMLSelectElement)){const r=Array.from(t.children).find(a=>e.value===a.getAttribute("value"));r&&r.setAttribute("selected","")}}function yn(e,t,n){return N(t,Element)&&(fn(e,t,n),tn(e,t,n),hn(e,t),gn(e,t)),t}async function xn(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let s=0;s<n.length;s++){const d=n[s].getAttribute("xlink:href");if(d){const p=e.querySelector(d),u=document.querySelector(d);!p&&u&&!r[d]&&(r[d]=await ye(u,t,!0))}}const a=Object.values(r);if(a.length){const s="http://www.w3.org/1999/xhtml",i=document.createElementNS(s,"svg");i.setAttribute("xmlns",s),i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.overflow="hidden",i.style.display="none";const d=document.createElementNS(s,"defs");i.appendChild(d);for(let p=0;p<a.length;p++)d.appendChild(a[p]);e.appendChild(i)}return e}async function ye(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>un(r,t)).then(r=>mn(e,r,t)).then(r=>yn(e,r,t)).then(r=>xn(r,t))}const at=/url\((['"]?)([^'"]+?)\1\)/g,wn=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,vn=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function bn(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function Sn(e){const t=[];return e.replace(at,(n,r,a)=>(t.push(a),n)),t.filter(n=>!_e(n))}async function Cn(e,t,n,r,a){try{const s=n?$t(t,n):t,i=je(t);let d;return a||(d=await Te(s,i,r)),e.replace(bn(t),`$1${d}$3`)}catch{}return e}function En(e,{preferredFontFormat:t}){return t?e.replace(vn,n=>{for(;;){const[r,,a]=wn.exec(n)||[];if(!a)return"";if(a===t)return`src: ${r};`}}):e}function ot(e){return e.search(at)!==-1}async function it(e,t,n){if(!ot(e))return e;const r=En(e,n);return Sn(r).reduce((s,i)=>s.then(d=>Cn(d,i,t,n)),Promise.resolve(r))}async function te(e,t,n){var r;const a=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(a){const s=await it(a,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function kn(e,t){await te("background",e,t)||await te("background-image",e,t),await te("mask",e,t)||await te("-webkit-mask",e,t)||await te("mask-image",e,t)||await te("-webkit-mask-image",e,t)}async function Rn(e,t){const n=N(e,HTMLImageElement);if(!(n&&!_e(e.src))&&!(N(e,SVGImageElement)&&!_e(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,a=await Te(r,je(r),t);await new Promise((s,i)=>{e.onload=s,e.onerror=t.onImageErrorHandler?(...p)=>{try{s(t.onImageErrorHandler(...p))}catch(u){i(u)}}:i;const d=e;d.decode&&(d.decode=s),d.loading==="lazy"&&(d.loading="eager"),n?(e.srcset="",e.src=a):e.href.baseVal=a})}async function jn(e,t){const r=J(e.childNodes).map(a=>ct(a,t));await Promise.all(r).then(()=>e)}async function ct(e,t){N(e,Element)&&(await kn(e,t),await Rn(e,t),await jn(e,t))}function _n(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(a=>{n[a]=r[a]}),e}const lt={};async function dt(e){let t=lt[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},lt[e]=t,t}async function ut(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,s=(n.match(/url\([^)]+\)/g)||[]).map(async i=>{let d=i.replace(r,"$1");return d.startsWith("https://")||(d=new URL(d,e.url).href),rt(d,t.fetchRequestInit,({result:p})=>(n=n.replace(i,`url(${p})`),[i,p]))});return Promise.all(s).then(()=>n)}function pt(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const p=a.exec(r);if(p===null)break;t.push(p[0])}r=r.replace(a,"");const s=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",d=new RegExp(i,"gi");for(;;){let p=s.exec(r);if(p===null){if(p=d.exec(r),p===null)break;s.lastIndex=d.lastIndex}else d.lastIndex=s.lastIndex;t.push(p[0])}return t}async function On(e,t){const n=[],r=[];return e.forEach(a=>{if("cssRules"in a)try{J(a.cssRules||[]).forEach((s,i)=>{if(s.type===CSSRule.IMPORT_RULE){let d=i+1;const p=s.href,u=dt(p).then(v=>ut(v,t)).then(v=>pt(v).forEach(f=>{try{a.insertRule(f,f.startsWith("@import")?d+=1:a.cssRules.length)}catch(w){console.error("Error inserting rule from remote css",{rule:f,error:w})}})).catch(v=>{console.error("Error loading remote css",v.toString())});r.push(u)}})}catch(s){const i=e.find(d=>d.href==null)||document.styleSheets[0];a.href!=null&&r.push(dt(a.href).then(d=>ut(d,t)).then(d=>pt(d).forEach(p=>{i.insertRule(p,i.cssRules.length)})).catch(d=>{console.error("Error loading remote stylesheet",d)})),console.error("Error inlining remote css file",s)}}),Promise.all(r).then(()=>(e.forEach(a=>{if("cssRules"in a)try{J(a.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${a.href}`,s)}}),n))}function Tn(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>ot(t.style.getPropertyValue("src")))}async function Vn(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=J(e.ownerDocument.styleSheets),r=await On(n,t);return Tn(r)}function mt(e){return e.trim().replace(/["']/g,"")}function Pn(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(s=>{t.add(mt(s))}),Array.from(r.children).forEach(s=>{s instanceof HTMLElement&&n(s)})}return n(e),t}async function Gn(e,t){const n=await Vn(e,t),r=Pn(e);return(await Promise.all(n.filter(s=>r.has(mt(s.style.fontFamily))).map(s=>{const i=s.parentStyleSheet?s.parentStyleSheet.href:null;return it(s.cssText,i,t)}))).join(`
|
|
8
|
+
`)}async function An(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Gn(e,t);if(n){const r=document.createElement("style"),a=document.createTextNode(n);r.appendChild(a),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function Nn(e,t={}){const{width:n,height:r}=qe(e,t),a=await ye(e,t,!0);return await An(a,t),await ct(a,t),_n(a,t),await Kt(a,n,r)}async function Ln(e,t={}){const{width:n,height:r}=qe(e,t),a=await Nn(e,t),s=await ge(a),i=document.createElement("canvas"),d=i.getContext("2d"),p=t.pixelRatio||Xt(),u=t.canvasWidth||n,v=t.canvasHeight||r;return i.width=u*p,i.height=v*p,t.skipAutoScale||Jt(i),i.style.width=`${u}`,i.style.height=`${v}`,t.backgroundColor&&(d.fillStyle=t.backgroundColor,d.fillRect(0,0,i.width,i.height)),d.drawImage(s,0,0,i.width,i.height),i}async function ft(e,t={}){return(await Ln(e,t)).toDataURL()}const xe=2147483647,Ve=xe,Pe=2e6,Mn=xe-10,In=xe-5,zn=xe-15,Dn=()=>{const e=window.innerWidth;return e<768?"mobile":e<1024?"tablet":"desktop"},Fn=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)},Hn=(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""}},Wn=e=>{const t=(e.innerText||"").slice(0,30).trim(),n={tag:e.tagName.toLowerCase(),classHash:Fn(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 a=e.getAttribute("role");a&&(n.role=a);const s=e.getAttribute("name");return s&&(n.name=s),n},$n=(()=>{let e=null,t=null;return n=>{if(!n||typeof window>"u"||typeof document>"u")return n;if(n.includes("oklch")||n.includes("oklab")||n.includes("lab(")||n.includes("lch(")||n.includes("color("))try{if(e||(e=document.createElement("canvas"),e.width=1,e.height=1),t||(t=e.getContext("2d",{willReadFrequently:!0})),t){t.fillStyle="#000000",t.fillStyle=n;const s=t.fillStyle;if(s&&!s.includes("oklch")&&!s.includes("oklab"))return s}const r=document.createElement("div");r.style.color=n,document.body.appendChild(r);const a=getComputedStyle(r).color;return document.body.removeChild(r),a&&!a.includes("oklch")?a:"rgb(0,0,0)"}catch{return"rgb(0,0,0)"}return n}})(),ht=(e,t,n,r)=>new Promise(a=>{const s=new Image;s.onload=()=>{const i=document.createElement("canvas"),d=window.devicePixelRatio||1,p=t.width+n*2,u=t.height+n*2;i.width=p*d,i.height=u*d;const v=i.getContext("2d");if(v){v.scale(d,d);let f=(t.left-n)*r,w=(t.top-n)*r,x=p*r,S=u*r,T=0,P=0,F=p,H=u;f<0&&(T=Math.abs(f)/r,x+=f,F-=T,f=0),f+x>s.width&&(x=s.width-f,F=x/r),w<0&&(P=Math.abs(w)/r,S+=w,H-=P,w=0),w+S>s.height&&(S=s.height-w,H=S/r),v.fillStyle="#ffffff",v.fillRect(0,0,p,u),x>0&&S>0&&v.drawImage(s,f,w,x,S,T,P,F,H)}a(i.toDataURL("image/png"))},s.onerror=()=>a(""),s.src=e}),Bn=e=>{const t=window.getComputedStyle(e),n={};return["display","position","margin","padding","font-size","color","background-color","width","height","z-index"].forEach(a=>{const s=t.getPropertyValue(a);n[a]=$n(s)}),n},Un=e=>{const n=Object.keys(e).find(s=>s.startsWith("__reactFiber$")||s.startsWith("__reactInternalInstance$"));if(!n)return"";const r=[];let a=e[n];for(;a;){const s=a.type;if(typeof s=="function"){const i=s.displayName||s.name;i&&!i.includes("ViewGate")&&!r.includes(i)&&r.unshift(i)}a=a.return}return r.join(" > ")||"Generic Component"},gt=e=>{if(!e)return!1;const t=window.getComputedStyle(e),n=e.getBoundingClientRect(),r=e.getAttribute("role");if(r&&["listbox","menu","combobox","tooltip","option"].includes(r))return!1;const s=120;return n.width<s&&n.height<s||t.position!=="fixed"&&t.position!=="absolute"?!1:!!(e.closest('[role="dialog"]')||e.closest('[aria-modal="true"]')||e.classList.contains("modal")||e.classList.contains("modal-content"))},yt=e=>{if(!e.isConnected)return!1;const t=window.getComputedStyle(e);if(t.display==="none"||t.visibility==="hidden"||t.opacity==="0"||e.offsetWidth===0||e.offsetHeight===0)return!1;let n=e.parentElement;for(;n;){const a=window.getComputedStyle(n);if(a.display==="none"||a.visibility==="hidden"||a.opacity==="0")return!1;n=n.parentElement}const r=e.getBoundingClientRect();return!(r.width===0||r.height===0||r.top===0&&r.left===0&&r.width>window.innerWidth*.9)},Ge=(e,t=document)=>{const n=t.querySelector(e);if(n)return n;const r=t.querySelectorAll("*");for(const a of Array.from(r)){const s=a.shadowRoot;if(s){const i=Ge(e,s);if(i)return i}}return null},xt=(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},Yn=e=>{if(!e.tag)return null;const t=document.getElementsByTagName(e.tag);let n=null,r=0;for(let a=0;a<t.length;a++){const s=t[a];let i=0;s.innerText?.includes(e.text.slice(0,20))&&(i+=4),e.fingerprint?.classHash&&s.className.includes(e.fingerprint.classHash)&&(i+=2),e.fingerprint?.ariaLabel&&s.getAttribute("aria-label")===e.fingerprint.ariaLabel&&(i+=3),e.fingerprint?.role&&s.getAttribute("role")===e.fingerprint.role&&(i+=2),e.parentContext&&(s.parentElement?.innerText||"").includes(e.parentContext.slice(0,30))&&(i+=2),e.fingerprint?.neighborCount===s.parentElement?.children.length&&(i+=1),e.fingerprint?.parentTag===s.parentElement?.tagName.toLowerCase()&&(i+=1),i>r&&i>=5&&(r=i,n=s)}return n},Xn=e=>{let t=Ge(e.selector);if(t)return t;if(e.fallbackSelectors){for(const n of e.fallbackSelectors)if(t=Ge(n),t)return t}return t=Yn(e),t||null},Ae=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}),Jn=e=>{const t=e.parentElement;if(!t)return;const n=Array.from(t.children).filter(i=>i!==e).slice(0,5).map(i=>Ae(i)),r=Array.from(t.children),a=r.indexOf(e);let s="middle";return a===0&&(s="start"),a===r.length-1&&(s="end"),{target:{...Ae(e),location:`${s} of ${t.tagName.toLowerCase()}`},parent:Ae(t),siblings:n}},Zn=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=Un(e),a=[],s=[],i=f=>{const w=[];let x=f;for(;x&&x.nodeType===Node.ELEMENT_NODE;){let S=x.nodeName.toLowerCase();s.unshift(S);const T=x.id&&!x.id.startsWith("__")?x.id:null;T&&a.push(`#${T}`);const P=x.getAttribute("data-testid")||x.getAttribute("data-qa");P&&a.push(`[data-testid="${P}"]`);const F=x.getAttribute("aria-label"),H=x.getAttribute("role"),G=x.getAttribute("name");if(P){S=`[${x.hasAttribute("data-testid")?"data-testid":"data-qa"}="${P}"]`,w.unshift(S);break}else if(T){S="#"+T,w.unshift(S);break}else if(F){S=`${x.localName}[aria-label="${F}"]`,w.unshift(S);break}else if(H){S=`${x.localName}[role="${H}"]`,w.unshift(S);break}else if(G){S=`${x.localName}[name="${G}"]`,w.unshift(S);break}else{let L=x,_=1;for(;L.previousElementSibling;)L=L.previousElementSibling,L.nodeName.toLowerCase()===x.nodeName.toLowerCase()&&_++;_>1&&(S+=`:nth-of-type(${_})`)}w.unshift(S),x=x.parentElement}return w.join(" > ")},d=gt(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 v=`${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:v,source:t,attributes:u,fallbackSelectors:[...new Set(a)].slice(0,5),domPath:s.slice(-10),viewportSize:{width:window.innerWidth,height:window.innerHeight},uiContext:Jn(e),fingerprint:Wn(e),metadata:{hint:`Edit ${t.split(":")[0]} at line ${t.split(":")[1]||"?"}`,computedStyles:Bn(e),viewportBreakpoint:Dn(),outerHtml:e.outerHTML.slice(0,1500),scrollPosition:{x:window.scrollX,y:window.scrollY},isModal:d}}},wt=()=>{const{addToast:e,language:t,t:n,apiKey:r,baseUrl:a,disableViewGate:s,hasActiveToasts:i}=Ke(),[d,p]=m.useState(!1),[u,v]=m.useState(null),[f,w]=m.useState(null),[x,S]=m.useState(""),[T,P]=m.useState(!1),[F,H]=m.useState(!1),[G,L]=m.useState(!1),[_,Le]=m.useState([]),[W,$]=m.useState(null),[we,vt]=m.useState(!1),[ce,ne]=m.useState(!1),[ve,be]=m.useState({}),[B,re]=m.useState(null),[K,le]=m.useState(!1),[U,Se]=m.useState(()=>{if(typeof window>"u")return{top:24,right:24};const l=localStorage.getItem("vg-exit-pos");return l?JSON.parse(l):{top:24,right:24}}),[c,g]=m.useState(!1),b=m.useRef(null),[E,se]=m.useState(()=>{if(typeof window>"u")return{bottom:30,right:30};const l=localStorage.getItem("vg-bar-pos");return l?JSON.parse(l):{bottom:30,right:30}}),[Y,j]=m.useState(!1),V=m.useRef(null),de=l=>{l.preventDefault(),l.stopPropagation();const h=l.currentTarget.parentElement?.getBoundingClientRect();h&&(g(!0),b.current={x:l.clientX,y:l.clientY,top:U.top,right:U.right,width:h.width,height:h.height})},Me=l=>{l.preventDefault(),l.stopPropagation();const h=l.currentTarget.parentElement?.getBoundingClientRect();h&&(j(!0),V.current={x:l.clientX,y:l.clientY,bottom:E.bottom,right:E.right,width:h.width,height:h.height})};m.useEffect(()=>{if(!c&&!Y)return;const l=y=>{if(c&&b.current){const D=y.clientX-b.current.x,O=y.clientY-b.current.y;let k=b.current.top+O,C=b.current.right-D;const R=10;k=Math.max(R,Math.min(window.innerHeight-b.current.height-R,k)),C=Math.max(R,Math.min(window.innerWidth-b.current.width-R,C)),Se({top:k,right:C})}if(Y&&V.current){const D=y.clientX-V.current.x,O=y.clientY-V.current.y;let k=V.current.bottom-O,C=V.current.right-D;const R=10;k=Math.max(R,Math.min(window.innerHeight-V.current.height-R,k)),C=Math.max(R,Math.min(window.innerWidth-V.current.width-R,C)),se({bottom:k,right:C})}},h=()=>{c&&(g(!1),localStorage.setItem("vg-exit-pos",JSON.stringify(U)),b.current=null),Y&&(j(!1),localStorage.setItem("vg-bar-pos",JSON.stringify(E)),V.current=null)};return window.addEventListener("mousemove",l),window.addEventListener("mouseup",h),()=>{window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",h)}},[c,Y,U,E]);const[bt,Ie]=m.useState(null),[St,Ct]=m.useState(""),[qn,er]=m.useState({}),ae=m.useRef(null),ue=m.useRef(null),pe=m.useCallback(()=>{ue.current||(ue.current=requestAnimationFrame(()=>{const l={},y=Array.from(document.querySelectorAll('[role="dialog"], [aria-modal="true"], .modal, .modal-content')).find(O=>gt(O)&&yt(O)),D=!!y;_.forEach(O=>{if(!O.reference)return;const k=Xn(O.reference),C=!!O.reference.metadata?.isModal;if(k&&yt(k)){let R=!1;if(D?R=y.contains(k):R=!C,!R)return;const z=k.getBoundingClientRect(),X=z.left+z.width/2,me=z.top+z.height/2;if(X>=0&&X<=window.innerWidth&&me>=0&&me<=window.innerHeight){const Z=document.elementFromPoint(X,me);if(Z&&!k.contains(Z)&&!ae.current?.contains(Z))return}l[O._id]={top:z.top+window.scrollY,left:z.left+window.scrollX,width:z.width,isModal:C}}}),er(l),ue.current=null}))},[_]),Q=m.useCallback(async()=>{if(r){ne(!0);try{const l=await fetch(`${a}/api/annotations`,{headers:{"x-api-key":r}});if(l.ok){const h=await l.json();Le(h.data||[])}}catch(l){console.error("Failed to fetch annotations",l)}finally{ne(!1)}}},[r,a]);m.useEffect(()=>{G&&_.length===0&&!ce&&L(!1)},[G,_.length,ce]),m.useEffect(()=>{if(!d&&_.length>0){pe();const l=new MutationObserver(()=>pe()),h=new ResizeObserver(()=>pe()),y=()=>pe();return l.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}),h.observe(document.documentElement),window.addEventListener("scroll",y,!0),()=>{l.disconnect(),h.disconnect(),window.removeEventListener("scroll",y,!0),ue.current&&cancelAnimationFrame(ue.current)}}},[d,_.length,pe]),m.useEffect(()=>{Q()},[Q]),m.useEffect(()=>{ae.current=document.getElementById("viewgate-shadow-host")},[]);const ze=m.useCallback(l=>{if(!d||f)return;const h=xt(l.clientX,l.clientY);if(!h||ae.current?.contains(h)||h.closest(".vg-no-capture")){v(null);return}const y=h.getBoundingClientRect();v({tag:h.tagName.toLowerCase(),source:h.getAttribute("data-source-path")||"unknown:0",rect:y,element:h,previewText:(h.innerText||"").slice(0,100)||(h.getAttribute("placeholder")||"").slice(0,100)||h.tagName.toLowerCase(),semanticReference:{...Zn(h),normalizedOffset:{x:(l.clientX-y.left)/y.width,y:(l.clientY-y.top)/y.height}}})},[d,f]),De=m.useCallback(async l=>{if(!d||f)return;const h=xt(l.clientX,l.clientY);if(!(!h||ae.current?.contains(h)||h.closest(".vg-no-capture"))&&u){l.preventDefault(),l.stopPropagation(),H(!0);try{const O=window.scrollX,k=window.scrollY,C=await ft(document.documentElement,{pixelRatio:1.5,cacheBust:!0,width:window.innerWidth,height:window.innerHeight,backgroundColor:"#ffffff",style:{transform:`scale(${1/window.devicePixelRatio}) translate(-${O}px, -${k}px)`,transformOrigin:"top left"},filter:Z=>{const Ce=Z;return!(ae.current?.contains(Ce)||Ce.id==="viewgate-ui")}}),R=u.element.getBoundingClientRect(),z=R.top>=0&&R.left>=0&&R.bottom<=window.innerHeight&&R.right<=window.innerWidth;let X="";if(z&&R.width>0&&R.height>0)X=await ht(C,R,24,1.5);else try{X=await ft(u.element,{pixelRatio:2,cacheBust:!0,backgroundColor:"#ffffff",filter:Z=>{const Ce=Z;return!ae.current?.contains(Ce)}})}catch{X=await ht(C,R,24,1.5)}const me={...u.semanticReference,metadata:{...u.semanticReference.metadata,screenshotUrl:C,elementScreenshot:X}};w({...u,visualPreview:X,semanticReference:me})}catch(y){console.error("Failed to capture preview:",y),w(u)}finally{H(!1),v(null)}}},[d,u,f]);m.useEffect(()=>{const l=h=>{if(h.key==="Escape"){f?w(null):G?L(!1):d&&p(!1);return}const D=(()=>{let C=document.activeElement;for(;C&&C.shadowRoot&&C.shadowRoot.activeElement;)C=C.shadowRoot.activeElement;return C})();if(["input","textarea"].includes((D?.tagName||"").toLowerCase())||D?.isContentEditable)return;const k=h.key.toLowerCase();k==="c"&&!f&&!G&&p(C=>!C),k==="v"&&!f&&(_.length>0||G)&&(L(C=>!C),G||p(!1))};return d&&!f?document.body.classList.add("vg-cursor-pointer"):document.body.classList.remove("vg-cursor-pointer"),window.addEventListener("keydown",l),window.addEventListener("mousemove",ze,!0),window.addEventListener("click",De,!0),()=>{document.body.classList.remove("vg-cursor-pointer"),window.removeEventListener("keydown",l),window.removeEventListener("mousemove",ze,!0),window.removeEventListener("click",De,!0)}},[d,f,G,_,ze,De]);const tr=async()=>{if(!f||!x.trim())return;P(!0);const{semanticReference:l}=f,[h,y]=(l.source||"").split(":"),D=y||"0";try{if(!(await fetch(`${a}/api/annotations`,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify({filePath:h,line:parseInt(D),url:window.location.href,message:x,componentName:l.componentPath||f.tag,reference:{...l,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),S(""),p(!1),Q()}catch(O){console.error(O),e(n.error,"error")}finally{P(!1)}};return o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:987",className:"vg-container",children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:988",className:"vg-no-capture",children:[!i&&o.jsxs("div",{style:{position:"fixed",top:`${U.top}px`,right:`${U.right}px`,zIndex:Ve+10,display:"flex",alignItems:"center",gap:"8px",transition:c?"none":"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},children:[o.jsx("div",{onMouseDown:de,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:d?0:1,visibility:d?"hidden":"visible",transition:"all 0.2s",border:"1px solid rgba(0,0,0,0.1)",boxShadow:"0 2px 8px rgba(0,0,0,0.05)"},onMouseEnter:l=>{l.currentTarget.style.backgroundColor="white",l.currentTarget.style.color="#000000"},onMouseLeave:l=>{l.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.85)",l.currentTarget.style.color="#1e293b"},children:o.jsx(Xe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1032",size:14})}),o.jsx("button",{onClick:l=>{l.stopPropagation(),$({title:n.exitConfirmTitle||"Close ViewGate?",message:n.exitConfirmMessage||"Are you sure you want to close ViewGate?",type:"danger",onConfirm:()=>s()})},title:"Cerrar ViewGate",style:{width:"40px",height:"40px",borderRadius:"12px",backgroundColor:"rgba(255, 255, 255, 0.9)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid rgba(0,0,0,0.05)",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",cursor:"pointer",color:"#64748b",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},onMouseEnter:l=>{l.currentTarget.style.transform="scale(1.1) rotate(90deg)",l.currentTarget.style.color="#ef4444",l.currentTarget.style.backgroundColor="white"},onMouseLeave:l=>{l.currentTarget.style.transform="scale(1) rotate(0deg)",l.currentTarget.style.color="#64748b",l.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.9)"},children:o.jsx(ke,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1072",size:20,strokeWidth:2.5})})]}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1078",style:{position:"fixed",bottom:`${E.bottom}px`,right:`${E.right}px`,zIndex:Ve,display:"flex",alignItems:"center",gap:"8px",transition:Y?"none":"all 0.4s cubic-bezier(0.4, 0, 0.2, 1)"},id:"viewgate-ui",children:[o.jsx("div",{onMouseDown:Me,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:d?0:1,visibility:d?"hidden":"visible",transition:"all 0.2s",border:"1px solid rgba(0,0,0,0.1)",boxShadow:"0 2px 8px rgba(0,0,0,0.05)"},onMouseEnter:l=>{l.currentTarget.style.backgroundColor="white",l.currentTarget.style.color="#000000"},onMouseLeave:l=>{l.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.85)",l.currentTarget.style.color="#1e293b"},className:"vg-animate-slide-up",children:o.jsx(Xe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1121",size:16})}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1124",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(!d),className:"vg-button-primary vg-animate-pop",style:{padding:"12px 24px",background:d?"#ef4444":void 0},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1133",style:{display:"flex",alignItems:"center",gap:"10px"},children:[d?o.jsx(ke,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1134",size:20,className:"vg-animate-pop"}):o.jsx(Ee,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1134",size:20,className:"vg-animate-pop"}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1135",children:d?n.exitMode:n.enterMode})]})}),_.length>0&&o.jsxs("button",{onClick:()=>{L(!G),p(!1),w(null)},className:"vg-button-ghost vg-animate-pop",style:{animationDelay:"0.1s"},children:[o.jsx(Nt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1148",size:20}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1149",children:n.viewComments})]})]})]}),F&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1157",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:Ve+1,cursor:"wait"},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1163",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:1164",className:"vg-spinner"}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1165",style:{fontWeight:600,fontSize:"14px",color:"#000000"},children:"Capturando..."})]})}),d&&!f&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1172",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:kn}}),l&&u&&!m&&!z&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1013",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:Rn},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1023",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(kt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1039",size:16}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1040",style:{display:"flex",flexDirection:"column"},children:[o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1041",style:{fontWeight:700},children:n.selectToComment}),o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1042",style:{fontSize:"10px",opacity:.8,fontFamily:"monospace"},children:[Math.round(u.rect.width)," × ",Math.round(u.rect.height)]})]})]})}),m&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1052",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:je},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1057",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:1061",style:{textAlign:"center",marginBottom:"32px"},children:[o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1062",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(ve,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1067",size:24})}),o.jsx("h2",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1069",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:1070",style:{margin:0,color:"#000000",fontSize:"15px"},children:n.feedbackSubheader})]}),m.visualPreview&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1074",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:m.visualPreview,alt:"Preview",style:{maxWidth:"100%",maxHeight:"200px",objectFit:"contain",display:"block"}})}),o.jsx("textarea",{className:"vg-textarea",value:g,onChange:d=>b(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:1101",style:{display:"flex",gap:"12px"},children:[o.jsx("button",{onClick:()=>!_&&y(null),className:"vg-button-ghost",disabled:_,style:{flex:1,padding:"12px"},children:n.cancel}),o.jsx("button",{onClick:Dn,className:"vg-button-primary",disabled:_||!g.trim(),style:{flex:2},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1116",style:{display:"flex",alignItems:"center",gap:"8px"},children:[_?o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1117",className:"vg-spinner",style:{width:"16px",height:"16px",borderWidth:"2px"}}):o.jsx(jt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1117",size:18}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1118",children:_?n.submitting:n.sendFeedback||"Send Comment"})]})})]})]})}),P&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1128",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:je},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1133",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:1137",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"20px"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1138",style:{display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("h2",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1139",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:1143",className:"vg-badge",style:{background:"#e0e7ff",color:"#6366f1"},children:R.length})]}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1148",style:{display:"flex",gap:"8px"},children:[U&&o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1150",className:"vg-button-ghost",style:{padding:"6px 14px",fontSize:"12px"},onClick:()=>ne(null),children:n.viewAll||"View All"}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1158",className:"vg-button-ghost",style:{padding:"8px",borderRadius:"50%"},onClick:()=>{G(!1),ne(null)},children:o.jsx(be,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1163",size:20})})]})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1168",style:{maxHeight:"60vh",overflowY:"auto",paddingRight:"10px"},className:"vg-custom-scrollbar",children:ie?o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1170",style:{display:"flex",justifyContent:"center",padding:"40px"},children:o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1171",className:"vg-spinner"})}):(U?R.filter(d=>d._id===U):R).map((d,v)=>o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1175",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:`${v*.05}s`},children:[o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1186",style:{display:"flex",justifyContent:"space-between",marginBottom:"16px",alignItems:"center"},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1187",style:{display:"flex",gap:"12px",alignItems:"center"},children:[d.status==="ready_for_review"?o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1189",className:"vg-badge",style:{backgroundColor:"#f0fdf4",color:"#16a34a"},children:[o.jsx(Q,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1190",size:14})," ",n.readyForReview]}):o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1193",className:"vg-badge",style:{backgroundColor:"#fff7ed",color:"#ea580c"},children:[o.jsx(Me,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1194",size:14})," ",n.pending]}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1197",style:{fontSize:"12px",color:"#000000"},children:Vn(d.timestamp||d.createdAt||d.reference?.timestamp,t)})]})}),le===d._id?o.jsx("textarea",{className:"vg-textarea",value:c,onChange:x=>h(x.target.value),rows:3,autoFocus:!0,style:{marginBottom:"16px"}}):o.jsx("p",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1213",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:1216",style:{display:"flex",gap:"12px",justifyContent:"flex-end",borderTop:"1px solid #f1f5f9",paddingTop:"16px"},children:le===d._id?o.jsxs(o.Fragment,{children:[o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1219",className:"vg-button-primary vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:async()=>{try{(await fetch(`${a}/api/annotations/${d._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify({message:c})})).ok&&(re(null),N(),e(n.updateSuccess,"success"))}catch{e(n.error,"error")}},children:n.save}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1241",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:()=>re(null),children:n.cancel})]}):o.jsxs(o.Fragment,{children:[o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1245",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:()=>{re(d._id),h(d.message)},children:[o.jsx(Rt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1253",size:14})," ",n.edit]}),o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1255",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(ze,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1262",size:14})," ",n.review]}),d.status==="pending"?o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1265",className:"vg-button-primary vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px",animationDelay:"0.1s"},onClick:()=>{W({title:n.markReadyConfirm,message:n.confirmMarkReady,type:"success",onConfirm:async()=>{try{(await fetch(`${a}/api/annotations/${d._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify({status:"ready_for_review"})})).ok&&(N(),e(n.updateSuccess,"success"))}catch{e(n.error,"error")}finally{W(null)}}})},children:[o.jsx(Q,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1293",size:14})," ",n.markReady]}):o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1296",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px",animationDelay:"0.1s"},onClick:()=>{W({title:n.reopenConfirm,message:n.confirmReopen,type:"success",onConfirm:async()=>{try{(await fetch(`${a}/api/annotations/${d._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify({status:"pending"})})).ok&&(N(),e(n.updateSuccess,"success"))}catch{e(n.error,"error")}finally{W(null)}}})},children:[o.jsx(_t,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1324",size:14})," ",n.reopen]}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1327",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 12px",color:"#ef4444",borderColor:"#fee2e2",animationDelay:"0.15s"},onClick:()=>{W({title:n.deleteConfirm,message:n.confirmDelete,type:"danger",onConfirm:async()=>{try{(await fetch(`${a}/api/annotations/${d._id}`,{method:"DELETE",headers:{"x-api-key":r}})).ok&&(N(),e(n.deleteSuccess,"success"))}catch{e(n.error,"error")}finally{W(null)}}})},children:o.jsx(Fe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1354",size:16})})]})})]},d._id))})]})}),D&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1369",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:je+100},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1374",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:1381",style:{width:"64px",height:"64px",background:D.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:D.type==="danger"?"#ef4444":"#6366f1",transform:"rotate(-5deg)"},children:D.type==="danger"?o.jsx(Fe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1390",size:32}):o.jsx(Q,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1390",size:32})}),o.jsx("h3",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1392",style:{margin:"0 0 12px 0",fontSize:"20px",fontWeight:800,color:"#000000",letterSpacing:"-0.02em"},children:D.title}),o.jsx("p",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1393",style:{margin:"0 0 32px 0",fontSize:"15px",color:"#000000",lineHeight:1.6},children:D.message}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1394",style:{display:"flex",gap:"16px"},children:[o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1395",className:"vg-button-ghost",style:{flex:1,height:"44px"},onClick:()=>!Z&&W(null),disabled:Z,children:n.no}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1403",className:"vg-button-primary",style:{flex:1,height:"44px",backgroundColor:D.type==="danger"?"#ef4444":void 0,backgroundImage:D.type==="danger"?"none":void 0,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},disabled:Z,onClick:async()=>{ce(!0);try{await D.onConfirm()}catch(d){console.error("Confirmation error:",d)}finally{ce(!1)}},children:Z?o.jsx(Et,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1428",size:18,className:"vg-animate-spin"}):n.yes})]})]})}),!l&&!P&&R.map((d,v)=>{const x=S[d._id];if(!x)return null;const j=R.slice(0,v).filter(O=>O.reference?.selector&&O.reference.selector===d.reference?.selector).length*34;return o.jsxs("div",{className:"vg-pin-container vg-animate-pop",style:{position:"fixed",top:x.top-20-window.scrollY,left:x.left+x.width/2-16+j-window.scrollX,cursor:"pointer",animationDelay:`${v*.08}s`,transition:"all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275)",zIndex:_n-v},onMouseEnter:O=>{const E=O.currentTarget.getBoundingClientRect();window.innerHeight-E.bottom<180?we(V=>({...V,[d._id]:"vg-top"})):we(V=>({...V,[d._id]:""}))},onClick:()=>{G(!0),ne(d._id)},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1475",className:`vg-pin-tooltip ${xe[d._id]||""}`,children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1476",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:1478",style:{display:"flex",alignItems:"center",gap:"6px",color:"#16a34a",fontWeight:700,fontSize:"11px"},children:[o.jsx(Q,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1479",size:12})," ",n.readyForReview]}):o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1482",style:{display:"flex",alignItems:"center",gap:"6px",color:x.isModal?"#f59e0b":"#ea580c",fontWeight:700,fontSize:"11px"},children:[o.jsx(Me,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1483",size:12})," ",n.pending]}),x.isModal&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1487",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:1488",children:"MODAL"})})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1492",style:{fontWeight:500,color:"#1e293b",lineHeight:1.4},children:d.message})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1495",className:`vg-formal-pin ${d.status==="ready_for_review"?"ready":""} ${x.isModal?"modal-variant":""}`,children:d.status==="ready_for_review"?o.jsx(Q,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1496",size:18}):x.isModal?o.jsx(ze,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1496",size:16}):o.jsx(ve,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1496",size:16})})]},`pin-${d._id}`)})]})})};function Te(e,t,n){if(!t.endsWith(".tsx")&&!t.endsWith(".jsx")||t.includes("node_modules"))return e;const r=l=>l.replace(/\\/g,"/"),a=r(t).replace(r(n),"");return e.split(`
|
|
16
|
-
`).map((
|
|
17
|
-
`)}function
|
|
15
|
+
)`:"none",zIndex:Mn}}),d&&u&&!f&&!F&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1191",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:In},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1201",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(Mt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1217",size:16}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1218",style:{display:"flex",flexDirection:"column"},children:[o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1219",style:{fontWeight:700},children:n.selectToComment}),o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1220",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:1230",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:Pe},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1235",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:1239",style:{textAlign:"center",marginBottom:"32px"},children:[o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1240",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(Ee,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1245",size:24})}),o.jsx("h2",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1247",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:1248",style:{margin:0,color:"#000000",fontSize:"15px"},children:n.feedbackSubheader})]}),f.visualPreview&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1252",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:x,onChange:l=>S(l.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:1279",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:tr,className:"vg-button-primary",disabled:T||!x.trim(),style:{flex:2},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1294",style:{display:"flex",alignItems:"center",gap:"8px"},children:[T?o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1295",className:"vg-spinner",style:{width:"16px",height:"16px",borderWidth:"2px"}}):o.jsx(Dt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1295",size:18}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1296",children:T?n.submitting:n.sendFeedback||"Send Comment"})]})})]})]})}),G&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1306",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:Pe},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1311",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:1315",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"20px"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1316",style:{display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("h2",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1317",style:{margin:0,fontSize:"20px",fontWeight:800,color:"#0f172a"},children:B?n.commentDetails:n.annotations}),!B&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1321",className:"vg-badge",style:{background:"#e0e7ff",color:"#6366f1"},children:_.length})]}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1326",style:{display:"flex",gap:"8px"},children:[B&&o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1328",className:"vg-button-ghost",style:{padding:"6px 14px",fontSize:"12px"},onClick:()=>re(null),children:n.viewAll||"View All"}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1336",className:"vg-button-ghost",style:{padding:"8px",borderRadius:"50%"},onClick:()=>{L(!1),re(null)},children:o.jsx(ke,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1341",size:20})})]})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1346",style:{maxHeight:"60vh",overflowY:"auto",paddingRight:"10px"},className:"vg-custom-scrollbar",children:ce?o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1348",style:{display:"flex",justifyContent:"center",padding:"40px"},children:o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1349",className:"vg-spinner"})}):(B?_.filter(l=>l._id===B):_).map((l,h)=>o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1353",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:`${h*.05}s`},children:[o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1364",style:{display:"flex",justifyContent:"space-between",marginBottom:"16px",alignItems:"center"},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1365",style:{display:"flex",gap:"12px",alignItems:"center"},children:[l.status==="ready_for_review"?o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1367",className:"vg-badge",style:{backgroundColor:"#f0fdf4",color:"#16a34a"},children:[o.jsx(q,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1368",size:14})," ",n.readyForReview]}):o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1371",className:"vg-badge",style:{backgroundColor:"#fff7ed",color:"#ea580c"},children:[o.jsx(Ue,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1372",size:14})," ",n.pending]}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1375",style:{fontSize:"12px",color:"#000000"},children:Hn(l.timestamp||l.createdAt||l.reference?.timestamp,t)})]})}),bt===l._id?o.jsx("textarea",{className:"vg-textarea",value:St,onChange:y=>Ct(y.target.value),rows:3,autoFocus:!0,style:{marginBottom:"16px"}}):o.jsx("p",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1391",style:{margin:"0 0 20px 0",fontSize:"16px",color:"#1e293b",lineHeight:1.6},children:l.message}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1394",style:{display:"flex",gap:"12px",justifyContent:"flex-end",borderTop:"1px solid #f1f5f9",paddingTop:"16px"},children:bt===l._id?o.jsxs(o.Fragment,{children:[o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1397",className:"vg-button-primary vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:async()=>{try{(await fetch(`${a}/api/annotations/${l._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify({message:St})})).ok&&(Ie(null),Q(),e(n.updateSuccess,"success"))}catch{e(n.error,"error")}},children:n.save}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1419",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:()=>Ie(null),children:n.cancel})]}):o.jsxs(o.Fragment,{children:[o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1423",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px"},onClick:()=>{Ie(l._id),Ct(l.message)},children:[o.jsx(It,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1431",size:14})," ",n.edit]}),o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1433",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px",animationDelay:"0.05s"},onClick:()=>{l.url&&(window.location.href=l.url)},children:[o.jsx(Ye,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1440",size:14})," ",n.review]}),l.status==="pending"?o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1443",className:"vg-button-primary vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px",animationDelay:"0.1s"},onClick:()=>{$({title:n.markReadyConfirm,message:n.confirmMarkReady,type:"success",onConfirm:async()=>{try{(await fetch(`${a}/api/annotations/${l._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify({status:"ready_for_review"})})).ok&&(Q(),e(n.updateSuccess,"success"))}catch{e(n.error,"error")}finally{$(null)}}})},children:[o.jsx(q,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1471",size:14})," ",n.markReady]}):o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1474",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 16px",fontSize:"13px",animationDelay:"0.1s"},onClick:()=>{$({title:n.reopenConfirm,message:n.confirmReopen,type:"success",onConfirm:async()=>{try{(await fetch(`${a}/api/annotations/${l._id}`,{method:"PATCH",headers:{"Content-Type":"application/json","x-api-key":r},body:JSON.stringify({status:"pending"})})).ok&&(Q(),e(n.updateSuccess,"success"))}catch{e(n.error,"error")}finally{$(null)}}})},children:[o.jsx(zt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1502",size:14})," ",n.reopen]}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1505",className:"vg-button-ghost vg-animate-pop",style:{padding:"8px 12px",color:"#ef4444",borderColor:"#fee2e2",animationDelay:"0.15s"},onClick:()=>{$({title:n.deleteConfirm,message:n.confirmDelete,type:"danger",onConfirm:async()=>{try{(await fetch(`${a}/api/annotations/${l._id}`,{method:"DELETE",headers:{"x-api-key":r}})).ok&&(Q(),e(n.deleteSuccess,"success"))}catch{e(n.error,"error")}finally{$(null)}}})},children:o.jsx(Je,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1532",size:16})})]})})]},l._id))})]})}),W&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1547",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:Pe+100},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1552",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:1559",style:{width:"64px",height:"64px",background:W.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:W.type==="danger"?"#ef4444":"#6366f1",transform:"rotate(-5deg)"},children:W.type==="danger"?o.jsx(Je,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1568",size:32}):o.jsx(q,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1568",size:32})}),o.jsx("h3",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1570",style:{margin:"0 0 12px 0",fontSize:"20px",fontWeight:800,color:"#000000",letterSpacing:"-0.02em"},children:W.title}),o.jsx("p",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1571",style:{margin:"0 0 32px 0",fontSize:"15px",color:"#000000",lineHeight:1.6},children:W.message}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1572",style:{display:"flex",gap:"16px"},children:[o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1573",className:"vg-button-ghost",style:{flex:1,height:"44px"},onClick:()=>!K&&$(null),disabled:K,children:n.no}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1581",className:"vg-button-primary",style:{flex:1,height:"44px",backgroundColor:W.type==="danger"?"#ef4444":void 0,backgroundImage:W.type==="danger"?"none":void 0,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},disabled:K,onClick:async()=>{le(!0);try{await W.onConfirm()}catch(l){console.error("Confirmation error:",l)}finally{le(!1)}},children:K?o.jsx(Lt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1606",size:18,className:"vg-animate-spin"}):n.yes})]})]})}),!d&&!G&&_.map((l,h)=>{const y=qn[l._id];if(!y)return null;const O=_.slice(0,h).filter(k=>k.reference?.selector&&k.reference.selector===l.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+O-window.scrollX,cursor:"pointer",animationDelay:`${h*.08}s`,transition:"all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275)",zIndex:zn-h},onMouseEnter:k=>{const C=k.currentTarget.getBoundingClientRect();window.innerHeight-C.bottom<180?be(z=>({...z,[l._id]:"vg-top"})):be(z=>({...z,[l._id]:""}))},onClick:()=>{L(!0),re(l._id)},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1653",className:`vg-pin-tooltip ${ve[l._id]||""}`,children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1654",style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"8px"},children:[l.status==="ready_for_review"?o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1656",style:{display:"flex",alignItems:"center",gap:"6px",color:"#16a34a",fontWeight:700,fontSize:"11px"},children:[o.jsx(q,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1657",size:12})," ",n.readyForReview]}):o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1660",style:{display:"flex",alignItems:"center",gap:"6px",color:y.isModal?"#f59e0b":"#ea580c",fontWeight:700,fontSize:"11px"},children:[o.jsx(Ue,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1661",size:12})," ",n.pending]}),y.isModal&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1665",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:1666",children:"MODAL"})})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1670",style:{fontWeight:500,color:"#1e293b",lineHeight:1.4},children:l.message})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1673",className:`vg-formal-pin ${l.status==="ready_for_review"?"ready":""} ${y.isModal?"modal-variant":""}`,children:l.status==="ready_for_review"?o.jsx(q,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1674",size:18}):y.isModal?o.jsx(Ye,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1674",size:16}):o.jsx(Ee,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1674",size:16})})]},`pin-${l._id}`)})]})})};function Ne(e,t,n){if(!t.endsWith(".tsx")&&!t.endsWith(".jsx")||t.includes("node_modules"))return e;const r=d=>d.replace(/\\/g,"/"),a=r(t).replace(r(n),"");return e.split(`
|
|
16
|
+
`).map((d,p)=>{const u=p+1;return d.replace(/(^|[^a-zA-Z0-9])<([a-zA-Z][a-zA-Z0-9\.]*)(?=[ \t\n\/\>])/g,(v,f,w)=>v.includes("data-source-path")||w==="Fragment"||w==="React.Fragment"?v:`${f}<${w} data-source-path="${a}:${u}"`)}).join(`
|
|
17
|
+
`)}function Kn(){return{name:"vite-plugin-viewgate",enforce:"pre",transform(e,t){return{code:Ne(e,t,process.cwd()),map:null}}}}function Qn(e){const t=this.resourcePath;return t?(process.env.NODE_ENV,Ne(e,t,process.cwd())):e}M.ViewGate=Wt,M.ViewGateOverlay=wt,M.transformSourcePaths=Ne,M.useViewGate=Ke,M.viewgateNextLoader=Qn,M.viewgatePlugin=Kn,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})}));
|