viewgate-wrapper 1.10.8 → 1.10.9
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(L,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],f):(L=typeof globalThis<"u"?globalThis:L||self,f(L.ViewGateWrapper={},L.React,L.ReactDOM))})(this,(function(L,f,pt){"use strict";var pe={exports:{}},ae={};var Ae;function mt(){if(Ae)return ae;Ae=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 l in a)l!=="key"&&(s[l]=a[l])}else s=a;return a=s.ref,{$$typeof:e,type:r,key:i,ref:a!==void 0?a:null,props:s}}return ae.Fragment=t,ae.jsx=n,ae.jsxs=n,ae}var oe={};var Ge;function ft(){return Ge||(Ge=1,process.env.NODE_ENV!=="production"&&(function(){function e(c){if(c==null)return null;if(typeof c=="function")return c.$$typeof===ie?null:c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case
|
|
2
|
+
(function(L,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],f):(L=typeof globalThis<"u"?globalThis:L||self,f(L.ViewGateWrapper={},L.React,L.ReactDOM))})(this,(function(L,f,pt){"use strict";var pe={exports:{}},ae={};var Ae;function mt(){if(Ae)return ae;Ae=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 l in a)l!=="key"&&(s[l]=a[l])}else s=a;return a=s.ref,{$$typeof:e,type:r,key:i,ref:a!==void 0?a:null,props:s}}return ae.Fragment=t,ae.jsx=n,ae.jsxs=n,ae}var oe={};var Ge;function ft(){return Ge||(Ge=1,process.env.NODE_ENV!=="production"&&(function(){function e(c){if(c==null)return null;if(typeof c=="function")return c.$$typeof===ie?null:c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case V:return"Fragment";case F:return"Profiler";case z:return"StrictMode";case Pe:return"Suspense";case D:return"SuspenseList";case ut: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 _:return"Portal";case A:return c.displayName||"Context";case T:return(c._context.displayName||"Context")+".Consumer";case R:var h=c.render;return c=c.displayName,c||(c=h.displayName||h.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case W:return h=c.displayName||null,h!==null?h:e(c.type)||"Memo";case ye:h=c._payload,c=c._init;try{return e(c(h))}catch{}}return null}function t(c){return""+c}function n(c){try{t(c);var h=!1}catch{h=!0}if(h){h=console;var S=h.error,k=typeof Symbol=="function"&&Symbol.toStringTag&&c[Symbol.toStringTag]||c.constructor.name||"Object";return S.call(h,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",k),t(c)}}function r(c){if(c===V)return"<>";if(typeof c=="object"&&c!==null&&c.$$typeof===ye)return"<...>";try{var h=e(c);return h?"<"+h+">":"<...>"}catch{return"<...>"}}function a(){var c=te.A;return c===null?null:c.getOwner()}function s(){return Error("react-stack-top-frame")}function i(c){if(xe.call(c,"key")){var h=Object.getOwnPropertyDescriptor(c,"key").get;if(h&&h.isReactWarning)return!1}return c.key!==void 0}function l(c,h){function S(){ne||(ne=!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)",h))}S.isReactWarning=!0,Object.defineProperty(c,"key",{get:S,configurable:!0})}function p(){var c=e(this.type);return Z[c]||(Z[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,h,S,k,H,B){var C=S.ref;return c={$$typeof:b,type:c,key:h,props:S,_owner:k},(C!==void 0?C: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:H}),Object.defineProperty(c,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:B}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c}function w(c,h,S,k,H,B){var C=h.children;if(C!==void 0)if(k)if(we(C)){for(k=0;k<C.length;k++)m(C[k]);Object.freeze&&Object.freeze(C)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else m(C);if(xe.call(h,"key")){C=e(c);var G=Object.keys(h).filter(function(de){return de!=="key"});k=0<G.length?"{key: someKey, "+G.join(": ..., ")+": ...}":"{key: someKey}",re[C+k]||(G=0<G.length?"{"+G.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} />`,k,C,G,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"),V=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),A=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=V,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 P=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||P(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 P(e,HTMLCanvasElement)?Jt(e):P(e,HTMLVideoElement)?Zt(e,t):P(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()):P(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||P(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`),P(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){P(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),P(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function rn(e,t){if(P(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 P(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=P(e,HTMLImageElement);if(!(n&&!Ee(e.src))&&!(P(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){P(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()}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,V=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&&(V=Math.abs(y)/r,b+=y,F-=V,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,_,V,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 V=g.getAttribute("data-testid")||g.getAttribute("data-qa");V&&a.push(`[data-testid="${V}"]`);const z=g.getAttribute("aria-label"),F=g.getAttribute("role"),T=g.getAttribute("name");if(V){b=`[${g.hasAttribute("data-testid")?"data-testid":"data-qa"}="${V}"]`,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(T){b=`${g.localName}[name="${T}"]`,y.unshift(b);break}else{let A=g,R=1;for(;A.previousElementSibling;)A=A.previousElementSibling,A.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(""),[_,V]=f.useState(!1),[z,F]=f.useState(!1),[T,A]=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(N=>it(N)&&ct(N)),$=!!x;R.forEach(N=>{if(!N.reference)return;const j=Ln(N.reference),E=!!N.reference.metadata?.isModal;if(j&&ct(j)){let se=!1;if($?se=x.contains(j):se=!E,!se)return;const O=j.getBoundingClientRect(),ue=O.left+O.width/2,Y=O.top+O.height/2;if(ue>=0&&ue<=window.innerWidth&&Y>=0&&Y<=window.innerHeight){const J=document.elementFromPoint(ue,Y);if(J&&!j.contains(J)&&!H.current?.contains(J))return}d[N._id]={top:O.top+window.scrollY,left:O.left+window.scrollX,width:O.width,isModal:E}}}),k(d),B.current=null}))},[R]),G=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(()=>{T&&R.length===0&&!ie&&A(!1)},[T,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(()=>{G()},[G]),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,N=2,j=await at(document.documentElement,{pixelRatio:1.5,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 O="";if(se&&E.width>0&&E.height>0)O=await ot(j,E,$,1.5);else try{O=await at(u.element,{pixelRatio:2,cacheBust:!0,backgroundColor:"#ffffff",filter:Y=>{const J=Y;return!H.current?.contains(J)}})}catch(Y){console.warn("Direct element capture failed, falling back to viewport crop:",Y),O=await ot(j,E,$,1.5)}const ue={...u.semanticReference,metadata:{...u.semanticReference.metadata,screenshotUrl:j,elementScreenshot:O}};y({...u,visualPreview:O,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):T?A(!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 j=v.key.toLowerCase();j==="c"&&!m&&!T&&p(E=>!E),j==="v"&&!m&&(R.length>0||T)&&(A(E=>!E),T||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,T,R,K,de]);const Dn=async()=>{if(!m||!g.trim())return;V(!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),G()}catch(N){console.error(N),e(n.error,"error")}finally{V(!1)}};return o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:894",className:"vg-container",children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:895",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:939",size:20,strokeWidth:2.5})}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:944",style:{position:"fixed",bottom:"30px",right:"30px",zIndex:_e},id:"viewgate-ui",children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:945",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:954",style:{display:"flex",alignItems:"center",gap:"10px"},children:[l?o.jsx(be,{"data-source-path":"/src/components/ViewGateOverlay.tsx:955",size:20,className:"vg-animate-pop"}):o.jsx(ve,{"data-source-path":"/src/components/ViewGateOverlay.tsx:955",size:20,className:"vg-animate-pop"}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:956",children:l?n.exitMode:n.enterMode})]})}),R.length>0&&o.jsxs("button",{onClick:()=>{A(!T),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:969",size:20}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:970",children:n.viewComments})]})]})}),z&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:978",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:984",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:985",className:"vg-spinner"}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:986",style:{fontWeight:600,fontSize:"14px",color:"#000000"},children:"Capturando..."})]})}),l&&!m&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:993",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(`
|
|
15
|
+
)`:"none",zIndex:kn}}),l&&u&&!m&&!z&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1012",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:1022",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:1038",size:16}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1039",style:{display:"flex",flexDirection:"column"},children:[o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1040",style:{fontWeight:700},children:n.selectToComment}),o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1041",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:1051",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:1056",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:1060",style:{textAlign:"center",marginBottom:"32px"},children:[o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1061",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:1066",size:24})}),o.jsx("h2",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1068",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:1069",style:{margin:0,color:"#000000",fontSize:"15px"},children:n.feedbackSubheader})]}),m.visualPreview&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1073",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:1100",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:1115",style:{display:"flex",alignItems:"center",gap:"8px"},children:[_?o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1116",className:"vg-spinner",style:{width:"16px",height:"16px",borderWidth:"2px"}}):o.jsx(jt,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1116",size:18}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1117",children:_?n.submitting:n.sendFeedback||"Send Comment"})]})})]})]})}),T&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1127",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:1132",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:1136",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"20px"},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1137",style:{display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("h2",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1138",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:1142",className:"vg-badge",style:{background:"#e0e7ff",color:"#6366f1"},children:R.length})]}),o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1147",style:{display:"flex",gap:"8px"},children:[U&&o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1149",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:1157",className:"vg-button-ghost",style:{padding:"8px",borderRadius:"50%"},onClick:()=>{A(!1),ne(null)},children:o.jsx(be,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1162",size:20})})]})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1167",style:{maxHeight:"60vh",overflowY:"auto",paddingRight:"10px"},className:"vg-custom-scrollbar",children:ie?o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1169",style:{display:"flex",justifyContent:"center",padding:"40px"},children:o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1170",className:"vg-spinner"})}):(U?R.filter(d=>d._id===U):R).map((d,v)=>o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1174",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:1185",style:{display:"flex",justifyContent:"space-between",marginBottom:"16px",alignItems:"center"},children:o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1186",style:{display:"flex",gap:"12px",alignItems:"center"},children:[d.status==="ready_for_review"?o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1188",className:"vg-badge",style:{backgroundColor:"#f0fdf4",color:"#16a34a"},children:[o.jsx(Q,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1189",size:14})," ",n.readyForReview]}):o.jsxs("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1192",className:"vg-badge",style:{backgroundColor:"#fff7ed",color:"#ea580c"},children:[o.jsx(Me,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1193",size:14})," ",n.pending]}),o.jsx("span",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1196",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:1212",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:1215",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:1218",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),G(),e(n.updateSuccess,"success"))}catch{e(n.error,"error")}},children:n.save}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1240",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:1244",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:1252",size:14})," ",n.edit]}),o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1254",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:1261",size:14})," ",n.review]}),d.status==="pending"?o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1264",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&&(G(),e(n.updateSuccess,"success"))}catch{e(n.error,"error")}finally{W(null)}}})},children:[o.jsx(Q,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1292",size:14})," ",n.markReady]}):o.jsxs("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1295",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&&(G(),e(n.updateSuccess,"success"))}catch{e(n.error,"error")}finally{W(null)}}})},children:[o.jsx(_t,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1323",size:14})," ",n.reopen]}),o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1326",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&&(G(),e(n.deleteSuccess,"success"))}catch{e(n.error,"error")}finally{W(null)}}})},children:o.jsx(Fe,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1353",size:16})})]})})]},d._id))})]})}),D&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1368",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:1373",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:1380",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:1389",size:32}):o.jsx(Q,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1389",size:32})}),o.jsx("h3",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1391",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:1392",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:1393",style:{display:"flex",gap:"16px"},children:[o.jsx("button",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1394",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:1402",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:1427",size:18,className:"vg-animate-spin"}):n.yes})]})]})}),!l&&!T&&R.map((d,v)=>{const x=S[d._id];if(!x)return null;const N=R.slice(0,v).filter(j=>j.reference?.selector&&j.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+N-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:j=>{const E=j.currentTarget.getBoundingClientRect();window.innerHeight-E.bottom<180?we(O=>({...O,[d._id]:"vg-top"})):we(O=>({...O,[d._id]:""}))},onClick:()=>{A(!0),ne(d._id)},children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1474",className:`vg-pin-tooltip ${xe[d._id]||""}`,children:[o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1475",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:1477",style:{display:"flex",alignItems:"center",gap:"6px",color:"#16a34a",fontWeight:700,fontSize:"11px"},children:[o.jsx(Q,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1478",size:12})," ",n.readyForReview]}):o.jsxs("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1481",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:1482",size:12})," ",n.pending]}),x.isModal&&o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1486",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:1487",children:"MODAL"})})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1491",style:{fontWeight:500,color:"#1e293b",lineHeight:1.4},children:d.message})]}),o.jsx("div",{"data-source-path":"/src/components/ViewGateOverlay.tsx:1494",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:1495",size:18}):x.isModal?o.jsx(ze,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1495",size:16}):o.jsx(ve,{"data-source-path":"/src/components/ViewGateOverlay.tsx:1495",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
16
|
`).map((l,p)=>{const u=p+1;return l.replace(/(^|[^a-zA-Z0-9])<([a-zA-Z][a-zA-Z0-9\.]*)(?=[ \t\n\/\>])/g,(w,m,y)=>w.includes("data-source-path")||y==="Fragment"||y==="React.Fragment"?w:`${m}<${y} data-source-path="${a}:${u}"`)}).join(`
|
|
17
17
|
`)}function zn(){return{name:"vite-plugin-viewgate",enforce:"pre",transform(e,t){return{code:Te(e,t,process.cwd()),map:null}}}}function Fn(e){const t=this.resourcePath;return t?(process.env.NODE_ENV,Te(e,t,process.cwd())):e}L.ViewGate=Tt,L.ViewGateOverlay=dt,L.transformSourcePaths=Te,L.useViewGate=He,L.viewgateNextLoader=Fn,L.viewgatePlugin=zn,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})}));
|