@bitux/review-layer-react 0.1.7 → 0.1.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,4 +1,4 @@
1
- (function(G,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],s):(G=typeof globalThis<"u"?globalThis:G||self,s(G.ReviewLayerReact={},G.React,G.ReactDOM))})(this,function(G,s,Ne){"use strict";var Se={exports:{}},ie={};/**
1
+ (function(Z,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],s):(Z=typeof globalThis<"u"?globalThis:Z||self,s(Z.ReviewLayerReact={},Z.React,Z.ReactDOM))})(this,function(Z,s,Me){"use strict";var Se={exports:{}},ce={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Me;function hr(){if(Me)return ie;Me=1;var r=s,o=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(p,v,w){var b,E={},V=null,P=null;w!==void 0&&(V=""+w),v.key!==void 0&&(V=""+v.key),v.ref!==void 0&&(P=v.ref);for(b in v)n.call(v,b)&&!l.hasOwnProperty(b)&&(E[b]=v[b]);if(p&&p.defaultProps)for(b in v=p.defaultProps,v)E[b]===void 0&&(E[b]=v[b]);return{$$typeof:o,type:p,key:V,ref:P,props:E,_owner:i.current}}return ie.Fragment=t,ie.jsx=c,ie.jsxs=c,ie}var ae={};/**
9
+ */var We;function br(){if(We)return ce;We=1;var r=s,n=Symbol.for("react.element"),t=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function f(c,v,h){var m,S={},w=null,L=null;h!==void 0&&(w=""+h),v.key!==void 0&&(w=""+v.key),v.ref!==void 0&&(L=v.ref);for(m in v)o.call(v,m)&&!i.hasOwnProperty(m)&&(S[m]=v[m]);if(c&&c.defaultProps)for(m in v=c.defaultProps,v)S[m]===void 0&&(S[m]=v[m]);return{$$typeof:n,type:c,key:w,ref:L,props:S,_owner:l.current}}return ce.Fragment=t,ce.jsx=f,ce.jsxs=f,ce}var de={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,32 +14,32 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var We;function br(){return We||(We=1,process.env.NODE_ENV!=="production"&&function(){var r=s,o=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),p=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),P=Symbol.for("react.offscreen"),O=Symbol.iterator,M="@@iterator";function L(e){if(e===null||typeof e!="object")return null;var a=O&&e[O]||e[M];return typeof a=="function"?a:null}var h=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function d(e){{for(var a=arguments.length,u=new Array(a>1?a-1:0),g=1;g<a;g++)u[g-1]=arguments[g];x("error",e,u)}}function x(e,a,u){{var g=h.ReactDebugCurrentFrame,C=g.getStackAddendum();C!==""&&(a+="%s",u=u.concat([C]));var k=u.map(function(R){return String(R)});k.unshift("Warning: "+a),Function.prototype.apply.call(console[e],console,k)}}var A=!1,F=!1,le=!1,ue=!1,ce=!1,ee;ee=Symbol.for("react.module.reference");function re(e){return!!(typeof e=="string"||typeof e=="function"||e===n||e===l||ce||e===i||e===w||e===b||ue||e===P||A||F||le||typeof e=="object"&&e!==null&&(e.$$typeof===V||e.$$typeof===E||e.$$typeof===c||e.$$typeof===p||e.$$typeof===v||e.$$typeof===ee||e.getModuleId!==void 0))}function m(e,a,u){var g=e.displayName;if(g)return g;var C=a.displayName||a.name||"";return C!==""?u+"("+C+")":u}function S(e){return e.displayName||"Context"}function j(e){if(e==null)return null;if(typeof e.tag=="number"&&d("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case n:return"Fragment";case t:return"Portal";case l:return"Profiler";case i:return"StrictMode";case w:return"Suspense";case b:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case p:var a=e;return S(a)+".Consumer";case c:var u=e;return S(u._context)+".Provider";case v:return m(e,e.render,"ForwardRef");case E:var g=e.displayName||null;return g!==null?g:j(e.type)||"Memo";case V:{var C=e,k=C._payload,R=C._init;try{return j(R(k))}catch{return null}}}return null}var I=Object.assign,Y=0,Q,te,xe,de,fe,_,Z;function K(){}K.__reactDisabledLog=!0;function J(){{if(Y===0){Q=console.log,te=console.info,xe=console.warn,de=console.error,fe=console.group,_=console.groupCollapsed,Z=console.groupEnd;var e={configurable:!0,enumerable:!0,value:K,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Y++}}function me(){{if(Y--,Y===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:I({},e,{value:Q}),info:I({},e,{value:te}),warn:I({},e,{value:xe}),error:I({},e,{value:de}),group:I({},e,{value:fe}),groupCollapsed:I({},e,{value:_}),groupEnd:I({},e,{value:Z})})}Y<0&&d("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ve=h.ReactCurrentDispatcher,Ie;function we(e,a,u){{if(Ie===void 0)try{throw Error()}catch(C){var g=C.stack.trim().match(/\n( *(at )?)/);Ie=g&&g[1]||""}return`
18
- `+Ie+e}}var Oe=!1,Ee;{var bt=typeof WeakMap=="function"?WeakMap:Map;Ee=new bt}function rr(e,a){if(!e||Oe)return"";{var u=Ee.get(e);if(u!==void 0)return u}var g;Oe=!0;var C=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var k;k=Ve.current,Ve.current=null,J();try{if(a){var R=function(){throw Error()};if(Object.defineProperty(R.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(R,[])}catch(U){g=U}Reflect.construct(e,[],R)}else{try{R.call()}catch(U){g=U}e.call(R.prototype)}}else{try{throw Error()}catch(U){g=U}e()}}catch(U){if(U&&g&&typeof U.stack=="string"){for(var y=U.stack.split(`
19
- `),W=g.stack.split(`
20
- `),D=y.length-1,z=W.length-1;D>=1&&z>=0&&y[D]!==W[z];)z--;for(;D>=1&&z>=0;D--,z--)if(y[D]!==W[z]){if(D!==1||z!==1)do if(D--,z--,z<0||y[D]!==W[z]){var H=`
21
- `+y[D].replace(" at new "," at ");return e.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",e.displayName)),typeof e=="function"&&Ee.set(e,H),H}while(D>=1&&z>=0);break}}}finally{Oe=!1,Ve.current=k,me(),Error.prepareStackTrace=C}var ne=e?e.displayName||e.name:"",q=ne?we(ne):"";return typeof e=="function"&&Ee.set(e,q),q}function yt(e,a,u){return rr(e,!1)}function xt(e){var a=e.prototype;return!!(a&&a.isReactComponent)}function _e(e,a,u){if(e==null)return"";if(typeof e=="function")return rr(e,xt(e));if(typeof e=="string")return we(e);switch(e){case w:return we("Suspense");case b:return we("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case v:return yt(e.render);case E:return _e(e.type,a,u);case V:{var g=e,C=g._payload,k=g._init;try{return _e(k(C),a,u)}catch{}}}return""}var ve=Object.prototype.hasOwnProperty,tr={},or=h.ReactDebugCurrentFrame;function Re(e){if(e){var a=e._owner,u=_e(e.type,e._source,a?a.type:null);or.setExtraStackFrame(u)}else or.setExtraStackFrame(null)}function mt(e,a,u,g,C){{var k=Function.call.bind(ve);for(var R in e)if(k(e,R)){var y=void 0;try{if(typeof e[R]!="function"){var W=Error((g||"React class")+": "+u+" type `"+R+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[R]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw W.name="Invariant Violation",W}y=e[R](a,R,g,u,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(D){y=D}y&&!(y instanceof Error)&&(Re(C),d("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",g||"React class",u,R,typeof y),Re(null)),y instanceof Error&&!(y.message in tr)&&(tr[y.message]=!0,Re(C),d("Failed %s type: %s",u,y.message),Re(null))}}}var wt=Array.isArray;function De(e){return wt(e)}function Et(e){{var a=typeof Symbol=="function"&&Symbol.toStringTag,u=a&&e[Symbol.toStringTag]||e.constructor.name||"Object";return u}}function _t(e){try{return nr(e),!1}catch{return!0}}function nr(e){return""+e}function ir(e){if(_t(e))return d("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Et(e)),nr(e)}var ar=h.ReactCurrentOwner,Rt={key:!0,ref:!0,__self:!0,__source:!0},sr,lr;function St(e){if(ve.call(e,"ref")){var a=Object.getOwnPropertyDescriptor(e,"ref").get;if(a&&a.isReactWarning)return!1}return e.ref!==void 0}function Ct(e){if(ve.call(e,"key")){var a=Object.getOwnPropertyDescriptor(e,"key").get;if(a&&a.isReactWarning)return!1}return e.key!==void 0}function kt(e,a){typeof e.ref=="string"&&ar.current}function Pt(e,a){{var u=function(){sr||(sr=!0,d("%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://reactjs.org/link/special-props)",a))};u.isReactWarning=!0,Object.defineProperty(e,"key",{get:u,configurable:!0})}}function Tt(e,a){{var u=function(){lr||(lr=!0,d("%s: `ref` 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://reactjs.org/link/special-props)",a))};u.isReactWarning=!0,Object.defineProperty(e,"ref",{get:u,configurable:!0})}}var jt=function(e,a,u,g,C,k,R){var y={$$typeof:o,type:e,key:a,ref:u,props:R,_owner:k};return y._store={},Object.defineProperty(y._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(y,"_self",{configurable:!1,enumerable:!1,writable:!1,value:g}),Object.defineProperty(y,"_source",{configurable:!1,enumerable:!1,writable:!1,value:C}),Object.freeze&&(Object.freeze(y.props),Object.freeze(y)),y};function Vt(e,a,u,g,C){{var k,R={},y=null,W=null;u!==void 0&&(ir(u),y=""+u),Ct(a)&&(ir(a.key),y=""+a.key),St(a)&&(W=a.ref,kt(a,C));for(k in a)ve.call(a,k)&&!Rt.hasOwnProperty(k)&&(R[k]=a[k]);if(e&&e.defaultProps){var D=e.defaultProps;for(k in D)R[k]===void 0&&(R[k]=D[k])}if(y||W){var z=typeof e=="function"?e.displayName||e.name||"Unknown":e;y&&Pt(R,z),W&&Tt(R,z)}return jt(e,y,W,C,g,ar.current,R)}}var Le=h.ReactCurrentOwner,ur=h.ReactDebugCurrentFrame;function oe(e){if(e){var a=e._owner,u=_e(e.type,e._source,a?a.type:null);ur.setExtraStackFrame(u)}else ur.setExtraStackFrame(null)}var Ae;Ae=!1;function ze(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function cr(){{if(Le.current){var e=j(Le.current.type);if(e)return`
17
+ */var Be;function yr(){return Be||(Be=1,process.env.NODE_ENV!=="production"&&function(){var r=s,n=Symbol.for("react.element"),t=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),c=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),L=Symbol.for("react.offscreen"),A=Symbol.iterator,M="@@iterator";function V(e){if(e===null||typeof e!="object")return null;var a=A&&e[A]||e[M];return typeof a=="function"?a:null}var N=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function p(e){{for(var a=arguments.length,u=new Array(a>1?a-1:0),g=1;g<a;g++)u[g-1]=arguments[g];T("error",e,u)}}function T(e,a,u){{var g=N.ReactDebugCurrentFrame,k=g.getStackAddendum();k!==""&&(a+="%s",u=u.concat([k]));var P=u.map(function(_){return String(_)});P.unshift("Warning: "+a),Function.prototype.apply.call(console[e],console,P)}}var Y=!1,R=!1,C=!1,I=!1,X=!1,H;H=Symbol.for("react.module.reference");function K(e){return!!(typeof e=="string"||typeof e=="function"||e===o||e===i||X||e===l||e===h||e===m||I||e===L||Y||R||C||typeof e=="object"&&e!==null&&(e.$$typeof===w||e.$$typeof===S||e.$$typeof===f||e.$$typeof===c||e.$$typeof===v||e.$$typeof===H||e.getModuleId!==void 0))}function ie(e,a,u){var g=e.displayName;if(g)return g;var k=a.displayName||a.name||"";return k!==""?u+"("+k+")":u}function b(e){return e.displayName||"Context"}function y(e){if(e==null)return null;if(typeof e.tag=="number"&&p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case o:return"Fragment";case t:return"Portal";case i:return"Profiler";case l:return"StrictMode";case h:return"Suspense";case m:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case c:var a=e;return b(a)+".Consumer";case f:var u=e;return b(u._context)+".Provider";case v:return ie(e,e.render,"ForwardRef");case S:var g=e.displayName||null;return g!==null?g:y(e.type)||"Memo";case w:{var k=e,P=k._payload,_=k._init;try{return y(_(P))}catch{return null}}}return null}var D=Object.assign,O=0,ee,ae,se,ve,pe,E,$;function re(){}re.__reactDisabledLog=!0;function q(){{if(O===0){ee=console.log,ae=console.info,se=console.warn,ve=console.error,pe=console.group,E=console.groupCollapsed,$=console.groupEnd;var e={configurable:!0,enumerable:!0,value:re,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}O++}}function we(){{if(O--,O===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:D({},e,{value:ee}),info:D({},e,{value:ae}),warn:D({},e,{value:se}),error:D({},e,{value:ve}),group:D({},e,{value:pe}),groupCollapsed:D({},e,{value:E}),groupEnd:D({},e,{value:$})})}O<0&&p("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ie=N.ReactCurrentDispatcher,Oe;function Ee(e,a,u){{if(Oe===void 0)try{throw Error()}catch(k){var g=k.stack.trim().match(/\n( *(at )?)/);Oe=g&&g[1]||""}return`
18
+ `+Oe+e}}var De=!1,_e;{var Et=typeof WeakMap=="function"?WeakMap:Map;_e=new Et}function tr(e,a){if(!e||De)return"";{var u=_e.get(e);if(u!==void 0)return u}var g;De=!0;var k=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var P;P=Ie.current,Ie.current=null,q();try{if(a){var _=function(){throw Error()};if(Object.defineProperty(_.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_,[])}catch(G){g=G}Reflect.construct(e,[],_)}else{try{_.call()}catch(G){g=G}e.call(_.prototype)}}else{try{throw Error()}catch(G){g=G}e()}}catch(G){if(G&&g&&typeof G.stack=="string"){for(var x=G.stack.split(`
19
+ `),B=g.stack.split(`
20
+ `),z=x.length-1,F=B.length-1;z>=1&&F>=0&&x[z]!==B[F];)F--;for(;z>=1&&F>=0;z--,F--)if(x[z]!==B[F]){if(z!==1||F!==1)do if(z--,F--,F<0||x[z]!==B[F]){var J=`
21
+ `+x[z].replace(" at new "," at ");return e.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",e.displayName)),typeof e=="function"&&_e.set(e,J),J}while(z>=1&&F>=0);break}}}finally{De=!1,Ie.current=P,we(),Error.prepareStackTrace=k}var ue=e?e.displayName||e.name:"",te=ue?Ee(ue):"";return typeof e=="function"&&_e.set(e,te),te}function _t(e,a,u){return tr(e,!1)}function Rt(e){var a=e.prototype;return!!(a&&a.isReactComponent)}function Re(e,a,u){if(e==null)return"";if(typeof e=="function")return tr(e,Rt(e));if(typeof e=="string")return Ee(e);switch(e){case h:return Ee("Suspense");case m:return Ee("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case v:return _t(e.render);case S:return Re(e.type,a,u);case w:{var g=e,k=g._payload,P=g._init;try{return Re(P(k),a,u)}catch{}}}return""}var ge=Object.prototype.hasOwnProperty,or={},nr=N.ReactDebugCurrentFrame;function Ce(e){if(e){var a=e._owner,u=Re(e.type,e._source,a?a.type:null);nr.setExtraStackFrame(u)}else nr.setExtraStackFrame(null)}function Ct(e,a,u,g,k){{var P=Function.call.bind(ge);for(var _ in e)if(P(e,_)){var x=void 0;try{if(typeof e[_]!="function"){var B=Error((g||"React class")+": "+u+" type `"+_+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[_]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw B.name="Invariant Violation",B}x=e[_](a,_,g,u,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(z){x=z}x&&!(x instanceof Error)&&(Ce(k),p("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",g||"React class",u,_,typeof x),Ce(null)),x instanceof Error&&!(x.message in or)&&(or[x.message]=!0,Ce(k),p("Failed %s type: %s",u,x.message),Ce(null))}}}var St=Array.isArray;function Le(e){return St(e)}function kt(e){{var a=typeof Symbol=="function"&&Symbol.toStringTag,u=a&&e[Symbol.toStringTag]||e.constructor.name||"Object";return u}}function Tt(e){try{return ir(e),!1}catch{return!0}}function ir(e){return""+e}function ar(e){if(Tt(e))return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",kt(e)),ir(e)}var sr=N.ReactCurrentOwner,Pt={key:!0,ref:!0,__self:!0,__source:!0},lr,ur;function jt(e){if(ge.call(e,"ref")){var a=Object.getOwnPropertyDescriptor(e,"ref").get;if(a&&a.isReactWarning)return!1}return e.ref!==void 0}function Vt(e){if(ge.call(e,"key")){var a=Object.getOwnPropertyDescriptor(e,"key").get;if(a&&a.isReactWarning)return!1}return e.key!==void 0}function It(e,a){typeof e.ref=="string"&&sr.current}function Ot(e,a){{var u=function(){lr||(lr=!0,p("%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://reactjs.org/link/special-props)",a))};u.isReactWarning=!0,Object.defineProperty(e,"key",{get:u,configurable:!0})}}function Dt(e,a){{var u=function(){ur||(ur=!0,p("%s: `ref` 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://reactjs.org/link/special-props)",a))};u.isReactWarning=!0,Object.defineProperty(e,"ref",{get:u,configurable:!0})}}var Lt=function(e,a,u,g,k,P,_){var x={$$typeof:n,type:e,key:a,ref:u,props:_,_owner:P};return x._store={},Object.defineProperty(x._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(x,"_self",{configurable:!1,enumerable:!1,writable:!1,value:g}),Object.defineProperty(x,"_source",{configurable:!1,enumerable:!1,writable:!1,value:k}),Object.freeze&&(Object.freeze(x.props),Object.freeze(x)),x};function At(e,a,u,g,k){{var P,_={},x=null,B=null;u!==void 0&&(ar(u),x=""+u),Vt(a)&&(ar(a.key),x=""+a.key),jt(a)&&(B=a.ref,It(a,k));for(P in a)ge.call(a,P)&&!Pt.hasOwnProperty(P)&&(_[P]=a[P]);if(e&&e.defaultProps){var z=e.defaultProps;for(P in z)_[P]===void 0&&(_[P]=z[P])}if(x||B){var F=typeof e=="function"?e.displayName||e.name||"Unknown":e;x&&Ot(_,F),B&&Dt(_,F)}return Lt(e,x,B,k,g,sr.current,_)}}var Ae=N.ReactCurrentOwner,cr=N.ReactDebugCurrentFrame;function le(e){if(e){var a=e._owner,u=Re(e.type,e._source,a?a.type:null);cr.setExtraStackFrame(u)}else cr.setExtraStackFrame(null)}var ze;ze=!1;function Fe(e){return typeof e=="object"&&e!==null&&e.$$typeof===n}function dr(){{if(Ae.current){var e=y(Ae.current.type);if(e)return`
22
22
 
23
- Check the render method of \``+e+"`."}return""}}function It(e){return""}var dr={};function Ot(e){{var a=cr();if(!a){var u=typeof e=="string"?e:e.displayName||e.name;u&&(a=`
23
+ Check the render method of \``+e+"`."}return""}}function zt(e){return""}var fr={};function Ft(e){{var a=dr();if(!a){var u=typeof e=="string"?e:e.displayName||e.name;u&&(a=`
24
24
 
25
- Check the top-level render call using <`+u+">.")}return a}}function fr(e,a){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var u=Ot(a);if(dr[u])return;dr[u]=!0;var g="";e&&e._owner&&e._owner!==Le.current&&(g=" It was passed a child from "+j(e._owner.type)+"."),oe(e),d('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',u,g),oe(null)}}function vr(e,a){{if(typeof e!="object")return;if(De(e))for(var u=0;u<e.length;u++){var g=e[u];ze(g)&&fr(g,a)}else if(ze(e))e._store&&(e._store.validated=!0);else if(e){var C=L(e);if(typeof C=="function"&&C!==e.entries)for(var k=C.call(e),R;!(R=k.next()).done;)ze(R.value)&&fr(R.value,a)}}}function Dt(e){{var a=e.type;if(a==null||typeof a=="string")return;var u;if(typeof a=="function")u=a.propTypes;else if(typeof a=="object"&&(a.$$typeof===v||a.$$typeof===E))u=a.propTypes;else return;if(u){var g=j(a);mt(u,e.props,"prop",g,e)}else if(a.PropTypes!==void 0&&!Ae){Ae=!0;var C=j(a);d("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",C||"Unknown")}typeof a.getDefaultProps=="function"&&!a.getDefaultProps.isReactClassApproved&&d("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Lt(e){{for(var a=Object.keys(e.props),u=0;u<a.length;u++){var g=a[u];if(g!=="children"&&g!=="key"){oe(e),d("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",g),oe(null);break}}e.ref!==null&&(oe(e),d("Invalid attribute `ref` supplied to `React.Fragment`."),oe(null))}}var pr={};function gr(e,a,u,g,C,k){{var R=re(e);if(!R){var y="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(y+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var W=It();W?y+=W:y+=cr();var D;e===null?D="null":De(e)?D="array":e!==void 0&&e.$$typeof===o?(D="<"+(j(e.type)||"Unknown")+" />",y=" Did you accidentally export a JSX literal instead of a component?"):D=typeof e,d("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",D,y)}var z=Vt(e,a,u,C,k);if(z==null)return z;if(R){var H=a.children;if(H!==void 0)if(g)if(De(H)){for(var ne=0;ne<H.length;ne++)vr(H[ne],e);Object.freeze&&Object.freeze(H)}else d("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 vr(H,e)}if(ve.call(a,"key")){var q=j(e),U=Object.keys(a).filter(function(Wt){return Wt!=="key"}),Fe=U.length>0?"{key: someKey, "+U.join(": ..., ")+": ...}":"{key: someKey}";if(!pr[q+Fe]){var Mt=U.length>0?"{"+U.join(": ..., ")+": ...}":"{}";d(`A props object containing a "key" prop is being spread into JSX:
25
+ Check the top-level render call using <`+u+">.")}return a}}function vr(e,a){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var u=Ft(a);if(fr[u])return;fr[u]=!0;var g="";e&&e._owner&&e._owner!==Ae.current&&(g=" It was passed a child from "+y(e._owner.type)+"."),le(e),p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',u,g),le(null)}}function pr(e,a){{if(typeof e!="object")return;if(Le(e))for(var u=0;u<e.length;u++){var g=e[u];Fe(g)&&vr(g,a)}else if(Fe(e))e._store&&(e._store.validated=!0);else if(e){var k=V(e);if(typeof k=="function"&&k!==e.entries)for(var P=k.call(e),_;!(_=P.next()).done;)Fe(_.value)&&vr(_.value,a)}}}function Nt(e){{var a=e.type;if(a==null||typeof a=="string")return;var u;if(typeof a=="function")u=a.propTypes;else if(typeof a=="object"&&(a.$$typeof===v||a.$$typeof===S))u=a.propTypes;else return;if(u){var g=y(a);Ct(u,e.props,"prop",g,e)}else if(a.PropTypes!==void 0&&!ze){ze=!0;var k=y(a);p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",k||"Unknown")}typeof a.getDefaultProps=="function"&&!a.getDefaultProps.isReactClassApproved&&p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Mt(e){{for(var a=Object.keys(e.props),u=0;u<a.length;u++){var g=a[u];if(g!=="children"&&g!=="key"){le(e),p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",g),le(null);break}}e.ref!==null&&(le(e),p("Invalid attribute `ref` supplied to `React.Fragment`."),le(null))}}var gr={};function hr(e,a,u,g,k,P){{var _=K(e);if(!_){var x="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(x+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var B=zt();B?x+=B:x+=dr();var z;e===null?z="null":Le(e)?z="array":e!==void 0&&e.$$typeof===n?(z="<"+(y(e.type)||"Unknown")+" />",x=" Did you accidentally export a JSX literal instead of a component?"):z=typeof e,p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",z,x)}var F=At(e,a,u,k,P);if(F==null)return F;if(_){var J=a.children;if(J!==void 0)if(g)if(Le(J)){for(var ue=0;ue<J.length;ue++)pr(J[ue],e);Object.freeze&&Object.freeze(J)}else p("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 pr(J,e)}if(ge.call(a,"key")){var te=y(e),G=Object.keys(a).filter(function(Gt){return Gt!=="key"}),Ne=G.length>0?"{key: someKey, "+G.join(": ..., ")+": ...}":"{key: someKey}";if(!gr[te+Ne]){var Ht=G.length>0?"{"+G.join(": ..., ")+": ...}":"{}";p(`A props object containing a "key" prop is being spread into JSX:
26
26
  let props = %s;
27
27
  <%s {...props} />
28
28
  React keys must be passed directly to JSX without using spread:
29
29
  let props = %s;
30
- <%s key={someKey} {...props} />`,Fe,q,Mt,q),pr[q+Fe]=!0}}return e===n?Lt(z):Dt(z),z}}function At(e,a,u){return gr(e,a,u,!0)}function zt(e,a,u){return gr(e,a,u,!1)}var Ft=zt,Nt=At;ae.Fragment=n,ae.jsx=Ft,ae.jsxs=Nt}()),ae}process.env.NODE_ENV==="production"?Se.exports=hr():Se.exports=br();var f=Se.exports;function yr(r){if(r.id&&/^[a-zA-Z][\w-]*$/.test(r.id))return`#${r.id}`;const o=[];let t=r;for(;t&&t.nodeType===Node.ELEMENT_NODE;){let n=t.nodeName.toLowerCase();if(t.id&&/^[a-zA-Z][\w-]*$/.test(t.id)){o.unshift(`#${t.id}`);break}if(t.className&&typeof t.className=="string"){const i=t.className.trim().split(/\s+/).filter(Boolean);if(i.length>0){const l=i.filter(c=>/^[a-zA-Z][\w-]*$/.test(c)).slice(0,2).map(c=>`.${c}`).join("");l&&(n+=l)}}if(o.length>0){const i=t.parentElement;if(i){const l=Array.from(i.children).filter(c=>c.nodeName===t.nodeName);if(l.length>1){const c=l.indexOf(t)+1;n+=`:nth-child(${c})`}}}o.unshift(n),t=t.parentElement}return o.join(" > ")}const xr="[data-review-layer-root]",mr=16;function Ce(r,o,t=mr){if(typeof window>"u")return{x:r,y:o};const n=t,i=t,l=window.innerWidth-t,c=window.innerHeight-t;return{x:Math.max(n,Math.min(l,r)),y:Math.max(i,Math.min(c,o))}}function Be(r){if(typeof document>"u"||!r)return[];const o=[];let t=r.parentElement;for(;t&&t!==document.body;){const n=getComputedStyle(t),i=n.overflowX,l=n.overflowY;(i==="scroll"||i==="auto"||i==="overlay"||l==="scroll"||l==="auto"||l==="overlay")&&(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)&&o.push(t),t=t.parentElement}return o}function Ue(r){var o;if(typeof document>"u"||!(r!=null&&r.trim()))return null;try{const t=document.querySelector(r);return!t||(o=t.closest)!=null&&o.call(t,xr)?null:t.getBoundingClientRect()}catch{return null}}function wr(r){if(typeof window>"u")return{relativeX:0,relativeY:0};const o=window.innerWidth,t=window.innerHeight;return{relativeX:o>0?r.left/o:0,relativeY:t>0?r.top/t:0}}function Ye(r){if(typeof window>"u")return{x:r.x??0,y:r.y??0};const o=r.relativeX??r.relative_x??null,t=r.relativeY??r.relative_y??null;return o!=null&&t!=null?{x:o*window.innerWidth,y:t*window.innerHeight}:{x:r.x??0,y:r.y??0}}function Er(r){const{x:o,y:t}=Ye(r),n=r.width??100,i=r.height??40;return new DOMRect(o,t,n,i)}function pe(r){if(r.selector){const o=Ue(r.selector);if(o!=null)return{x:o.left,y:o.top}}return Ye(r)}function ke(){if(typeof window>"u")return"/";try{const r=new URLSearchParams(window.location.search).get("path");if(r!=null&&r.trim()!=="")return r.startsWith("/")?r:`/${r}`}catch{}return window.location.pathname||"/"}const T={PENDING:"pending",DEV_FIXED:"dev_fixed",VALIDATED:"validated"},He="[review-layer API]";function X(r,o,t){if("status"in t){const{status:p,statusText:v,body:w=""}=t;let b;p===401?b="No autorizado (401). Revisa que apiKey sea correcta y esté aceptada por la API.":p===403?b="Acceso denegado (403). Revisa apiKey o permisos del proyecto.":p===404?b="Recurso no encontrado (404). Revisa apiUrl y que la ruta exista en el backend.":p>=500?b="Error del servidor (5xx). El backend puede estar caído o sobrecargado.":b=`Respuesta HTTP ${p} ${v}. Revisa la API.`,console.error(He,r,{motivo:b,url:o,status:p,statusText:v,body:w.slice(0,300)});return}const n=t.networkError,i=n instanceof Error?n.message:String(n),c=n instanceof TypeError||/failed to fetch|networkerror|load failed|network request failed/i.test(i)?"Posible CORS o error de red (servidor inalcanzable, bloqueo CORS o certificado). Revisa que apiUrl sea accesible desde este origen y que el backend permita CORS.":`Error inesperado: ${i}`;console.error(He,r,{motivo:c,url:o,error:n})}function se(r){return{"Content-Type":"application/json","x-review-key":r}}async function _r(r,o,t){const n=`${r}/reviewers`;let i;try{i=await fetch(n,{headers:se(o),signal:t==null?void 0:t.signal})}catch(c){throw X("fetchReviewers (red/CORS)",n,{networkError:c}),c}if(!i.ok){const c=await i.text();throw X("fetchReviewers",n,{status:i.status,statusText:i.statusText,body:c}),new Error("Failed to fetch reviewers")}return(await i.json()).data??[]}async function Rr(r,o,t){const n=`${r}/comments`;let i;try{i=await fetch(n,{method:"POST",headers:se(o),body:JSON.stringify(t)})}catch(c){throw X("createComment (red/CORS)",n,{networkError:c}),c}if(!i.ok){const c=await i.text();let p="Failed to create comment";try{p=JSON.parse(c).message??p}catch{}throw X("createComment",n,{status:i.status,statusText:i.statusText,body:c}),new Error(p)}return(await i.json()).data}async function Sr(r,o,t,n){const i=new URLSearchParams({url:t}),l=`${r}/comments?${i}`;let c;try{c=await fetch(l,{headers:se(o),signal:n==null?void 0:n.signal})}catch(v){throw X("fetchComments (red/CORS)",l,{networkError:v}),v}if(!c.ok){const v=await c.text();throw X("fetchComments",l,{status:c.status,statusText:c.statusText,body:v}),new Error("Failed to fetch comments")}return(await c.json()).data??[]}async function Cr(r,o,t,n){const i=`${r}/comments/${t}/status`;let l;try{l=await fetch(i,{method:"PATCH",headers:se(o),body:JSON.stringify({status:n})})}catch(p){throw X("updateCommentStatus (red/CORS)",i,{networkError:p}),p}if(!l.ok){const p=await l.text();X("updateCommentStatus",i,{status:l.status,statusText:l.statusText,body:p});let v="Failed to update comment status";try{v=JSON.parse(p).message??v}catch{}throw new Error(v)}return(await l.json()).data}async function kr(r,o,t){const n=`${r}/comments/${t}`;let i;try{i=await fetch(n,{method:"DELETE",headers:se(o)})}catch(l){throw X("deleteComment (red/CORS)",n,{networkError:l}),l}if(!i.ok){const l=await i.text();X("deleteComment",n,{status:i.status,statusText:i.statusText,body:l});let c="Failed to delete comment";try{c=JSON.parse(l).message??c}catch{}throw new Error(c)}}const Pr={position:"fixed",inset:0,zIndex:999997,backgroundColor:"transparent"},Tr={position:"fixed",minWidth:320,maxWidth:400,padding:"var(--ui-positive-Value_400, 16px)",backgroundColor:"var(--ui-color-bg-surface-default, #fff)",border:"1px solid var(--ui-color-border-subtle, #e8e8e8)",borderRadius:"var(--ui-radius_8, 8px)",boxShadow:"0 8px 24px var(--ui-color-black-alpha-20, rgba(0,0,0,0.15))",zIndex:999998},jr={width:"100%",minHeight:80,padding:"var(--ui-positive-Value_200, 8px) var(--ui-positive-Value_300, 12px)",marginBottom:"var(--ui-positive-Value_200, 12px)",border:"1px solid var(--ui-color-border-default, #d9d9d9)",borderRadius:"var(--ui-radius_6, 6px)",fontSize:"var(--ui-font-size-sm, 14px)",fontFamily:"var(--ui-font-family-ui, 'Inter', sans-serif)",resize:"vertical",boxSizing:"border-box"},Vr={width:"100%",padding:"var(--ui-positive-Value_200, 8px) var(--ui-positive-Value_300, 12px)",marginBottom:"var(--ui-positive-Value_300, 12px)",border:"1px solid var(--ui-color-border-default, #d9d9d9)",borderRadius:"var(--ui-radius_6, 6px)",fontSize:"var(--ui-font-size-sm, 14px)"},Ge={padding:"var(--ui-positive-Value_200, 8px) var(--ui-positive-Value_400, 16px)",backgroundColor:"var(--ui-color-bg-fill-danger-default, #ff4d4f)",color:"var(--ui-color-text-on-color, #fff)",border:"none",borderRadius:"var(--ui-radius_6, 6px)",fontSize:"var(--ui-font-size-sm, 14px)",cursor:"pointer",fontWeight:"var(--ui-font-weight-medium, 500)"};function Ir({apiUrl:r,apiKey:o,reviewers:t,position:n,payload:i,onClose:l,onSuccess:c}){var h;const[p,v]=s.useState(""),[w,b]=s.useState(((h=t[0])==null?void 0:h.id)??0),[E,V]=s.useState(!1),[P,O]=s.useState(null);s.useEffect(()=>{t.length>0&&!w&&b(t[0].id)},[t,w]);const M=s.useCallback(async d=>{if(d.preventDefault(),!(!p.trim()||!w)){V(!0),O(null);try{await Rr(r,o,{...i,message:p.trim(),reviewerId:w}),c(),l()}catch(x){O(x instanceof Error?x.message:"Failed to send comment")}finally{V(!1)}}},[r,o,i,p,w,c,l]),L=s.useRef(null);return s.useEffect(()=>{const d=x=>{x.key==="Escape"&&(x.preventDefault(),l())};return document.addEventListener("keydown",d,!0),()=>document.removeEventListener("keydown",d,!0)},[l]),s.useEffect(()=>{const d=x=>{const A=x.target;L.current&&!L.current.contains(A)&&(x.preventDefault(),x.stopPropagation(),l())};return document.addEventListener("mousedown",d,!0),()=>document.removeEventListener("mousedown",d,!0)},[l]),s.useEffect(()=>{var d;(d=L.current)==null||d.focus()},[]),f.jsxs("div",{ref:L,role:"dialog","aria-modal":"true",tabIndex:-1,style:{position:"fixed",inset:0,zIndex:999997,outline:"none"},children:[f.jsx("div",{role:"presentation",style:Pr,onClick:l}),f.jsx("div",{style:{...Tr,left:Math.min(n.x,typeof window<"u"?window.innerWidth-420:n.x),top:n.y+12},onClick:d=>d.stopPropagation(),children:f.jsxs("form",{onSubmit:M,children:[f.jsx("textarea",{placeholder:"Escribe tu comentario...",value:p,onChange:d=>v(d.target.value),style:jr,required:!0,autoFocus:!0}),f.jsxs("select",{value:w,onChange:d=>b(Number(d.target.value)),style:Vr,required:!0,disabled:t.length===0,children:[f.jsx("option",{value:"",children:t.length===0?"No hay revisores (ejecuta php artisan db:seed en la API)":"Selecciona revisor"}),t.map(d=>f.jsx("option",{value:d.id,children:d.name},d.id))]}),P&&f.jsx("div",{style:{color:"var(--ui-color-text-danger-default, #ff4d4f)",fontSize:"var(--ui-font-size-xs, 12px)",marginBottom:"var(--ui-positive-Value_200, 8px)"},children:P}),f.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"var(--ui-positive-Value_200, 8px)"},children:[f.jsx("button",{type:"button",onClick:l,style:{...Ge,backgroundColor:"var(--ui-color-bg-fill-secondary-default, #f0f0f0)",color:"var(--ui-color-text-primary, #333)"},children:"Cancelar"}),f.jsx("button",{type:"submit",style:Ge,disabled:E||t.length===0,children:E?"Enviando...":"Enviar comentario"})]})]})})]})}const Or=s.memo(Ir),Dr="var(--ui-color-red-500, #ef4444)";function Lr(r){return{position:"fixed",outline:`2px solid ${r}`,outlineOffset:"var(--ui-positive-Value_200, 2px)",pointerEvents:"none",zIndex:999997,boxSizing:"border-box"}}const Ar=s.memo(function({selector:o,active:t,fallbackComment:n,outlineColor:i=Dr}){const[l,c]=s.useState(null),p=s.useCallback(()=>{if(!t){c(null);return}const v=o!=null&&o.trim()?Ue(o):null;if(v){c(v);return}if(n){c(Er(n));return}c(null)},[o,t,n]);return s.useEffect(()=>{p()},[p]),s.useEffect(()=>{if(t)return window.addEventListener("scroll",p,!0),window.addEventListener("resize",p),()=>{window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p)}},[t,p]),!t||l==null?null:f.jsx("div",{"aria-hidden":!0,style:{...Lr(i),left:l.left,top:l.top,width:l.width,height:l.height}})}),ge=32,Xe=150,Pe=250,B={cardBg:"var(--ui-color-bg-surface-default, #ffffff)",cardFooterBg:"var(--ui-color-bg-surface-secondary-default, #f8fafc)",textDark:"var(--ui-color-text-primary, #333333)",textMuted:"var(--ui-color-text-secondary, #888888)",border:"var(--ui-color-border-default, #cccccc)",shadow:"var(--ui-shadow-card, 0 4px 16px rgba(0, 0, 0, 0.12))"},zr={[T.PENDING]:"Pendiente",[T.DEV_FIXED]:"Corregido",[T.VALIDATED]:"Validado"},Fr={[T.PENDING]:"PENDIENTE",[T.DEV_FIXED]:"CORREGIDO",[T.VALIDATED]:"VALIDADO"},$={[T.PENDING]:"var(--ui-color-red-500, rgb(240, 69, 69))",[T.DEV_FIXED]:"var(--ui-color-yellow-500, rgb(235, 179, 8))",[T.VALIDATED]:"var(--ui-color-green-500, rgb(33, 196, 94))"},Je={[T.PENDING]:"var(--ui-color-bg-surface-danger-default, #fef2f2)",[T.DEV_FIXED]:"var(--ui-color-bg-surface-warning-default, #fffbeb)",[T.VALIDATED]:"var(--ui-color-bg-surface-success-default, #f0fdf4)"},he={[T.PENDING]:"var(--ui-color-red-500, #ef4444)",[T.DEV_FIXED]:"var(--ui-color-orange-500, #f59e0b)",[T.VALIDATED]:"var(--ui-color-green-500, #22c55e)"};function Nr(r){const o=r.trim().split(/\s+/);return o.length>=2?(o[0][0]+o[o.length-1][0]).toUpperCase():r.slice(0,2).toUpperCase()||"?"}const Mr=()=>f.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",style:{marginRight:4,flexShrink:0},children:f.jsx("path",{d:"M10 3L4.5 8.5L2 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),Wr=({color:r})=>f.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",style:{flexShrink:0},children:[f.jsx("path",{d:"M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),f.jsx("path",{d:"M8 10h.01M12 10h.01M16 10h.01",stroke:"var(--ui-color-white, #fff)",strokeWidth:"1.5",strokeLinecap:"round"})]}),Br=r=>({position:"fixed",width:ge,height:ge,borderRadius:"50%",backgroundColor:$[r]??$[T.PENDING],color:"var(--ui-color-text-on-color, #fff)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",fontFamily:"var(--ui-font-family-ui, 'Inter', sans-serif)",boxShadow:"0 2px 8px var(--ui-color-black-alpha-20, rgba(0,0,0,0.2))",zIndex:999998,border:"2px solid var(--ui-color-white, #fff)"}),Ur={position:"fixed",width:Pe,minWidth:Pe,maxWidth:Pe,boxSizing:"border-box",backgroundColor:B.cardBg,borderRadius:"var(--ui-radius_12, 12px)",boxShadow:B.shadow,fontSize:"var(--ui-font-size-sm, 14px)",fontFamily:"var(--ui-font-family-ui, 'Inter', sans-serif)",zIndex:999999,pointerEvents:"auto"},Yr={display:"flex",alignItems:"center",justifyContent:"space-between",gap:"var(--ui-positive-Value_250, 10px)",borderBottom:`1px solid ${B.border}`,padding:"var(--ui-positive-Value_300, 12px)"},Hr=r=>({width:40,height:40,borderRadius:"50%",backgroundColor:$[r]??$[T.PENDING],color:"var(--ui-color-text-on-color, #fff)",border:"2px solid var(--ui-color-white, #fff)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"var(--ui-font-size-sm, 14px)",fontWeight:"var(--ui-font-weight-bold, 700)",flexShrink:0,overflow:"hidden"}),Gr=s.memo(function({reviewer:o,status:t}){const n=o==null?void 0:o.image_url,i=(o==null?void 0:o.name)??"Revisor",l=Hr(t);if(n&&n.trim()){const c=$[t]??$[T.PENDING];return f.jsx("div",{style:{...l,border:`2px solid ${c}`},children:f.jsx("img",{src:n,alt:i,style:{width:"100%",height:"100%",objectFit:"cover"},loading:"lazy"})})}return f.jsx("div",{style:l,children:Nr(i)})}),Xr={flexShrink:0,width:"var(--ui-positive-Value_600, 24px)",height:"var(--ui-positive-Value_600, 24px)",padding:0,border:"none",borderRadius:"var(--ui-radius_6, 6px)",backgroundColor:"transparent",color:B.textDark,cursor:"pointer",fontSize:"var(--ui-positive-Value_450, 18px)",lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center"},Jr=r=>{const o=he[r]??he[T.PENDING];return{display:"inline-flex",alignItems:"center",padding:"var(--ui-positive-Value_50, 4px) var(--ui-positive-Value_100, 10px)",borderRadius:"var(--ui-radius_full, 9999px)",fontSize:"8px",fontWeight:"var(--ui-font-weight-bold, 700)",fontFamily:"var(--ui-font-family-ui, 'Inter', sans-serif)",textTransform:"uppercase",letterSpacing:"0.02em",backgroundColor:Je[r]??Je[T.PENDING],color:o,border:`1px solid ${o}`}},Zr={display:"block",fontSize:"var(--ui-font-size-2xs, 10px)",fontWeight:"var(--ui-font-weight-semibold, 600)",fontFamily:"var(--ui-font-family-ui, 'Inter', sans-serif)",color:B.textMuted,textTransform:"uppercase",letterSpacing:"0.04em"},Qr={width:"100%",padding:"var(--ui-positive-Value_200, 8px) var(--ui-positive-Value_300, 12px)",paddingRight:"var(--ui-positive-Value_800, 32px)",fontSize:"var(--ui-font-size-xs, 13px)",fontFamily:"var(--ui-font-family-ui, 'Inter', sans-serif)",borderRadius:"var(--ui-radius_8, 8px)",border:`1px solid ${B.border}`,backgroundColor:B.cardBg,color:B.textDark,cursor:"pointer",appearance:"none",backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L2 4h8z'/%3E%3C/svg%3E")`,backgroundRepeat:"no-repeat",backgroundPosition:"right var(--ui-positive-Value_250, 10px) center"},Kr={display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"var(--ui-positive-Value_200, 8px)",padding:"var(--ui-positive-Value_300, 12px)",borderTop:`1px solid ${B.border}`,backgroundColor:B.cardFooterBg},Ze={minWidth:100,padding:"var(--ui-positive-Value_200, 8px) var(--ui-positive-Value_350, 14px)",fontSize:"var(--ui-font-size-xs, 13px)",fontWeight:"var(--ui-font-weight-semibold, 600)",fontFamily:"var(--ui-font-family-ui, 'Inter', sans-serif)",borderRadius:"var(--ui-radius_8, 8px)",cursor:"pointer",border:"none"},qr={...Ze,backgroundColor:"transparent",color:B.textDark},be="review-layer-resolve-btn",$r=["pending","dev_fixed","validated"],et={...Ze,backgroundColor:"var(--ui-color-bg-fill-success-default, #22c55e)",color:"var(--ui-color-text-on-color, #fff)"};function rt({comment:r,offset:o={dx:0,dy:0},apiUrl:t,apiKey:n,onStatusChange:i,reviewMode:l=!1}){var de,fe;const[c,p]=s.useState(!1),[v,w]=s.useState(!1),[b,E]=s.useState(()=>pe(r)),[V,P]=s.useState(!1),[O,M]=s.useState(null),L=s.useRef(null),h=s.useRef(null),d=s.useRef(null),x=s.useCallback(()=>{E(pe(r))},[r]);s.useEffect(()=>{x()},[x]),s.useEffect(()=>{if(!(typeof window>"u"))return window.addEventListener("scroll",x,!0),window.addEventListener("resize",x),()=>{window.removeEventListener("scroll",x,!0),window.removeEventListener("resize",x)}},[x]),s.useEffect(()=>{if(!r.selector||typeof document>"u")return;const _=document.querySelector(r.selector);if(!_)return;const K=Be(_).map(J=>(J.addEventListener("scroll",x,!0),()=>J.removeEventListener("scroll",x,!0)));return()=>K.forEach(J=>J())},[r.selector,x]);const A=s.useCallback(()=>{L.current!==null&&(clearTimeout(L.current),L.current=null)},[]),F=s.useCallback(()=>{l||(A(),p(!0))},[l,A]),le=s.useCallback(()=>{v||(L.current=setTimeout(()=>{L.current=null,p(!1)},Xe))},[v]),ue=s.useCallback(()=>{A(),p(!0)},[A]),ce=s.useCallback(()=>{v||(L.current=setTimeout(()=>{L.current=null,p(!1)},Xe))},[v]),ee=s.useCallback(()=>{if(l){v&&(w(!1),p(!1));return}v?(w(!1),p(!1)):(w(!0),p(!0))},[l,v]);s.useEffect(()=>{if(!v)return;const _=Z=>{var J,me;const K=Z.target;(J=h.current)!=null&&J.contains(K)||(me=d.current)!=null&&me.contains(K)||(w(!1),p(!1))};return document.addEventListener("mousedown",_,!0),()=>document.removeEventListener("mousedown",_,!0)},[v]),s.useEffect(()=>()=>A(),[A]),s.useEffect(()=>{l&&(w(!1),p(!1))},[l]);const re=b.x+o.dx,m=b.y+o.dy,{x:S,y:j}=Ce(re,m,ge/2),I=c&&!v,Y=s.useCallback(()=>{w(!1),p(!1)},[]),Q=s.useCallback(async _=>{if(_!==r.status){M(null),P(!0);try{await Cr(t,n,r.id,_),i()}catch(Z){M(Z instanceof Error?Z.message:"Error al actualizar")}finally{P(!1)}}},[t,n,r.id,r.status,i]),te=s.useCallback(async()=>{M(null),P(!0);try{await kr(t,n,r.id),i(),Y()}catch(_){M(_ instanceof Error?_.message:"Error al eliminar")}finally{P(!1)}},[t,n,r.id,i,Y]),xe=s.useMemo(()=>({...Br(r.status),left:S,top:j,transform:"translate(-50%, -50%)"}),[r.status,S,j]);return f.jsxs(f.Fragment,{children:[f.jsx(Ar,{selector:r.selector,active:I,fallbackComment:r,outlineColor:he[r.status]??he[T.PENDING]}),f.jsx("div",{ref:h,role:"button",tabIndex:0,"aria-label":`Comentario: ${r.message.slice(0,30)}...`,"aria-expanded":c,style:xe,onMouseEnter:F,onMouseLeave:le,onClick:ee,children:f.jsx(Wr,{color:"var(--ui-color-white, #fff)"})}),c&&f.jsxs("div",{ref:d,role:"dialog","aria-label":"Detalle del comentario",style:{...Ur,left:S+ge/2+6,top:j},onMouseEnter:ue,onMouseLeave:ce,children:[f.jsxs("div",{style:Yr,children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,flex:1,minWidth:0},children:[f.jsx(Gr,{reviewer:r.reviewer,status:r.status}),f.jsxs("div",{children:[f.jsx("div",{style:{fontWeight:700,fontSize:14,color:B.textDark},children:((de=r.reviewer)==null?void 0:de.name)??"Revisor"}),f.jsx("div",{style:{fontSize:12,color:B.textMuted},children:((fe=r.reviewer)==null?void 0:fe.job_title)??"Revisor"})]})]}),f.jsx("button",{type:"button","aria-label":r.status===T.VALIDATED?"Eliminar comentario":"Cerrar",style:Xr,disabled:V,onClick:_=>{_.stopPropagation(),r.status===T.VALIDATED?te():Y()},onMouseDown:_=>_.stopPropagation(),children:"✕"})]}),f.jsxs("div",{style:{padding:12,display:"flex",alignItems:"flex-start",flexDirection:"column",gap:4},children:[f.jsxs("div",{style:Jr(r.status),children:[r.status===T.VALIDATED&&f.jsx(Mr,{}),Fr[r.status]??r.status]}),f.jsx("div",{style:{color:B.textDark,lineHeight:1.5,marginBottom:12,marginTop:12},children:r.message}),f.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,width:"100%"},children:[f.jsx("label",{style:Zr,htmlFor:`comment-status-${r.id}`,children:"Cambiar estado"}),f.jsx("select",{id:`comment-status-${r.id}`,style:Qr,value:r.status,disabled:V,onChange:_=>Q(_.target.value),onMouseDown:_=>_.stopPropagation(),"aria-label":"Cambiar estado del comentario",children:$r.map(_=>f.jsx("option",{value:_,children:zr[_]},_))}),O&&f.jsx("div",{style:{marginTop:8,fontSize:11,color:"var(--ui-color-text-danger-default, rgb(240, 69, 69))"},children:O})]})]}),f.jsxs("div",{style:Kr,children:[f.jsx("button",{type:"button",style:qr,onMouseDown:_=>_.stopPropagation(),onClick:_=>{_.stopPropagation(),Y()},children:"Cerrar"}),r.status!==T.VALIDATED&&f.jsxs(f.Fragment,{children:[f.jsx("style",{children:`
31
- .${be}:hover:not(:disabled) {
30
+ <%s key={someKey} {...props} />`,Ne,te,Ht,te),gr[te+Ne]=!0}}return e===o?Mt(F):Nt(F),F}}function Wt(e,a,u){return hr(e,a,u,!0)}function Bt(e,a,u){return hr(e,a,u,!1)}var Ut=Bt,Yt=Wt;de.Fragment=o,de.jsx=Ut,de.jsxs=Yt}()),de}process.env.NODE_ENV==="production"?Se.exports=br():Se.exports=yr();var d=Se.exports;function xr(r){if(r.id&&/^[a-zA-Z][\w-]*$/.test(r.id))return`#${r.id}`;const n=[];let t=r;for(;t&&t.nodeType===Node.ELEMENT_NODE;){let o=t.nodeName.toLowerCase();if(t.id&&/^[a-zA-Z][\w-]*$/.test(t.id)){n.unshift(`#${t.id}`);break}if(t.className&&typeof t.className=="string"){const i=t.className.trim().split(/\s+/).filter(Boolean);if(i.length>0){const f=i.filter(c=>/^[a-zA-Z][\w-]*$/.test(c)).slice(0,2).map(c=>`.${c}`).join("");f&&(o+=f)}}const l=t.parentElement;if(l){const i=Array.from(l.children);if(i.length>1){const f=i.indexOf(t)+1;o+=`:nth-child(${f})`}}n.unshift(o),t=t.parentElement}return n.join(" > ")}const mr="[data-review-layer-root]",wr=16;function ke(r,n,t=wr){if(typeof window>"u")return{x:r,y:n};const o=t,l=t,i=window.innerWidth-t,f=window.innerHeight-t;return{x:Math.max(o,Math.min(i,r)),y:Math.max(l,Math.min(f,n))}}function Ue(r){if(typeof document>"u"||!r)return[];const n=[];let t=r.parentElement;for(;t&&t!==document.body;){const o=getComputedStyle(t),l=o.overflowX,i=o.overflowY;(l==="scroll"||l==="auto"||l==="overlay"||i==="scroll"||i==="auto"||i==="overlay")&&(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)&&n.push(t),t=t.parentElement}return n}function Ye(r){var n;if(typeof document>"u"||!(r!=null&&r.trim()))return null;try{const t=document.querySelector(r);return!t||(n=t.closest)!=null&&n.call(t,mr)?null:t.getBoundingClientRect()}catch{return null}}function Er(r){if(typeof window>"u")return{relativeX:0,relativeY:0};const n=window.innerWidth,t=window.innerHeight;return{relativeX:n>0?r.left/n:0,relativeY:t>0?r.top/t:0}}function He(r){if(typeof window>"u")return{x:r.x??0,y:r.y??0};const n=r.relativeX??r.relative_x??null,t=r.relativeY??r.relative_y??null;return n!=null&&t!=null?{x:n*window.innerWidth,y:t*window.innerHeight}:{x:r.x??0,y:r.y??0}}function _r(r){const{x:n,y:t}=He(r),o=r.width??100,l=r.height??40;return new DOMRect(n,t,o,l)}function he(r){if(r.selector){const n=Ye(r.selector);if(n!=null)return{x:n.left,y:n.top}}return He(r)}const Rr=["path"];function Cr(r){return r.trim().startsWith("/")?r.trim():`/${r.trim()}`}function Ge(){if(typeof window>"u")return"/";try{const r=new URLSearchParams(window.location.search);for(const[,t]of r){const o=t==null?void 0:t.trim();if(o!==""&&o.startsWith("/"))return o}for(const t of Rr){const o=r.get(t);if(o!=null&&o.trim()!=="")return Cr(o)}const n=window.location.pathname||"/";if(n==="/iframe.html"||n.endsWith("/iframe.html")){const t=r.get("id");if(t!=null&&t.trim()!=="")return`/story/${t.trim()}`}}catch{}return window.location.pathname||"/"}const j={PENDING:"pending",DEV_FIXED:"dev_fixed",VALIDATED:"validated"},Xe="[review-layer API]";function Q(r,n,t){if("status"in t){const{status:c,statusText:v,body:h=""}=t;let m;c===401?m="No autorizado (401). Revisa que apiKey sea correcta y esté aceptada por la API.":c===403?m="Acceso denegado (403). Revisa apiKey o permisos del proyecto.":c===404?m="Recurso no encontrado (404). Revisa apiUrl y que la ruta exista en el backend.":c>=500?m="Error del servidor (5xx). El backend puede estar caído o sobrecargado.":m=`Respuesta HTTP ${c} ${v}. Revisa la API.`,console.error(Xe,r,{motivo:m,url:n,status:c,statusText:v,body:h.slice(0,300)});return}const o=t.networkError,l=o instanceof Error?o.message:String(o),f=o instanceof TypeError||/failed to fetch|networkerror|load failed|network request failed/i.test(l)?"Posible CORS o error de red (servidor inalcanzable, bloqueo CORS o certificado). Revisa que apiUrl sea accesible desde este origen y que el backend permita CORS.":`Error inesperado: ${l}`;console.error(Xe,r,{motivo:f,url:n,error:o})}function fe(r){return{"Content-Type":"application/json","x-review-key":r}}async function Sr(r,n,t){const o=`${r}/reviewers`;let l;try{l=await fetch(o,{headers:fe(n),signal:t==null?void 0:t.signal})}catch(f){throw Q("fetchReviewers (red/CORS)",o,{networkError:f}),f}if(!l.ok){const f=await l.text();throw Q("fetchReviewers",o,{status:l.status,statusText:l.statusText,body:f}),new Error("Failed to fetch reviewers")}return(await l.json()).data??[]}async function kr(r,n,t){const o=`${r}/comments`;let l;try{l=await fetch(o,{method:"POST",headers:fe(n),body:JSON.stringify(t)})}catch(f){throw Q("createComment (red/CORS)",o,{networkError:f}),f}if(!l.ok){const f=await l.text();let c="Failed to create comment";try{c=JSON.parse(f).message??c}catch{}throw Q("createComment",o,{status:l.status,statusText:l.statusText,body:f}),new Error(c)}return(await l.json()).data}async function Tr(r,n,t,o){const l=new URLSearchParams({url:t}),i=`${r}/comments?${l}`;let f;try{f=await fetch(i,{headers:fe(n),signal:o==null?void 0:o.signal})}catch(v){throw Q("fetchComments (red/CORS)",i,{networkError:v}),v}if(!f.ok){const v=await f.text();throw Q("fetchComments",i,{status:f.status,statusText:f.statusText,body:v}),new Error("Failed to fetch comments")}return(await f.json()).data??[]}async function Pr(r,n,t,o){const l=`${r}/comments/${t}/status`;let i;try{i=await fetch(l,{method:"PATCH",headers:fe(n),body:JSON.stringify({status:o})})}catch(c){throw Q("updateCommentStatus (red/CORS)",l,{networkError:c}),c}if(!i.ok){const c=await i.text();Q("updateCommentStatus",l,{status:i.status,statusText:i.statusText,body:c});let v="Failed to update comment status";try{v=JSON.parse(c).message??v}catch{}throw new Error(v)}return(await i.json()).data}async function jr(r,n,t){const o=`${r}/comments/${t}`;let l;try{l=await fetch(o,{method:"DELETE",headers:fe(n)})}catch(i){throw Q("deleteComment (red/CORS)",o,{networkError:i}),i}if(!l.ok){const i=await l.text();Q("deleteComment",o,{status:l.status,statusText:l.statusText,body:i});let f="Failed to delete comment";try{f=JSON.parse(i).message??f}catch{}throw new Error(f)}}const Vr={position:"fixed",inset:0,zIndex:999997,backgroundColor:"transparent"},Ir={position:"fixed",minWidth:320,maxWidth:400,padding:"var(--ui-positive-Value_400, 16px)",backgroundColor:"var(--ui-color-bg-surface-default, #fff)",border:"1px solid var(--ui-color-border-subtle, #e8e8e8)",borderRadius:"var(--ui-radius_8, 8px)",boxShadow:"0 8px 24px var(--ui-color-black-alpha-20, rgba(0,0,0,0.15))",zIndex:999998},Or={width:"100%",minHeight:80,padding:"var(--ui-positive-Value_200, 8px) var(--ui-positive-Value_300, 12px)",marginBottom:"var(--ui-positive-Value_200, 12px)",border:"1px solid var(--ui-color-border-default, #d9d9d9)",borderRadius:"var(--ui-radius_6, 6px)",fontSize:"var(--ui-font-size-sm, 14px)",fontFamily:"var(--ui-font-family-ui, 'Inter', sans-serif)",resize:"vertical",boxSizing:"border-box"},Dr={width:"100%",padding:"var(--ui-positive-Value_200, 8px) var(--ui-positive-Value_300, 12px)",marginBottom:"var(--ui-positive-Value_300, 12px)",border:"1px solid var(--ui-color-border-default, #d9d9d9)",borderRadius:"var(--ui-radius_6, 6px)",fontSize:"var(--ui-font-size-sm, 14px)"},Je={padding:"var(--ui-positive-Value_200, 8px) var(--ui-positive-Value_400, 16px)",backgroundColor:"var(--ui-color-bg-fill-danger-default, #ff4d4f)",color:"var(--ui-color-text-on-color, #fff)",border:"none",borderRadius:"var(--ui-radius_6, 6px)",fontSize:"var(--ui-font-size-sm, 14px)",cursor:"pointer",fontWeight:"var(--ui-font-weight-medium, 500)"};function Lr({apiUrl:r,apiKey:n,reviewers:t,position:o,payload:l,onClose:i,onSuccess:f}){var N;const[c,v]=s.useState(""),[h,m]=s.useState(((N=t[0])==null?void 0:N.id)??0),[S,w]=s.useState(!1),[L,A]=s.useState(null);s.useEffect(()=>{t.length>0&&!h&&m(t[0].id)},[t,h]);const M=s.useCallback(async p=>{if(p.preventDefault(),!(!c.trim()||!h)){w(!0),A(null);try{await kr(r,n,{...l,message:c.trim(),reviewerId:h}),f(),i()}catch(T){A(T instanceof Error?T.message:"Failed to send comment")}finally{w(!1)}}},[r,n,l,c,h,f,i]),V=s.useRef(null);return s.useEffect(()=>{const p=T=>{T.key==="Escape"&&(T.preventDefault(),i())};return document.addEventListener("keydown",p,!0),()=>document.removeEventListener("keydown",p,!0)},[i]),s.useEffect(()=>{const p=T=>{const Y=T.target;V.current&&!V.current.contains(Y)&&(T.preventDefault(),T.stopPropagation(),i())};return document.addEventListener("mousedown",p,!0),()=>document.removeEventListener("mousedown",p,!0)},[i]),s.useEffect(()=>{var p;(p=V.current)==null||p.focus()},[]),d.jsxs("div",{ref:V,role:"dialog","aria-modal":"true",tabIndex:-1,style:{position:"fixed",inset:0,zIndex:999997,outline:"none"},children:[d.jsx("div",{role:"presentation",style:Vr,onClick:i}),d.jsx("div",{style:{...Ir,left:Math.min(o.x,typeof window<"u"?window.innerWidth-420:o.x),top:o.y+12},onClick:p=>p.stopPropagation(),children:d.jsxs("form",{onSubmit:M,children:[d.jsx("textarea",{placeholder:"Escribe tu comentario...",value:c,onChange:p=>v(p.target.value),style:Or,required:!0,autoFocus:!0}),d.jsxs("select",{value:h,onChange:p=>m(Number(p.target.value)),style:Dr,required:!0,disabled:t.length===0,children:[d.jsx("option",{value:"",children:t.length===0?"No hay revisores (ejecuta php artisan db:seed en la API)":"Selecciona revisor"}),t.map(p=>d.jsx("option",{value:p.id,children:p.name},p.id))]}),L&&d.jsx("div",{style:{color:"var(--ui-color-text-danger-default, #ff4d4f)",fontSize:"var(--ui-font-size-xs, 12px)",marginBottom:"var(--ui-positive-Value_200, 8px)"},children:L}),d.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"var(--ui-positive-Value_200, 8px)"},children:[d.jsx("button",{type:"button",onClick:i,style:{...Je,backgroundColor:"var(--ui-color-bg-fill-secondary-default, #f0f0f0)",color:"var(--ui-color-text-primary, #333)"},children:"Cancelar"}),d.jsx("button",{type:"submit",style:Je,disabled:S||t.length===0,children:S?"Enviando...":"Enviar comentario"})]})]})})]})}const Ar=s.memo(Lr),zr="var(--ui-color-red-500, #ef4444)";function Fr(r){return{position:"fixed",outline:`2px solid ${r}`,outlineOffset:"var(--ui-positive-Value_200, 2px)",pointerEvents:"none",zIndex:999997,boxSizing:"border-box"}}const Nr=s.memo(function({selector:n,active:t,fallbackComment:o,outlineColor:l=zr}){const[i,f]=s.useState(null),c=s.useCallback(()=>{if(!t){f(null);return}const v=n!=null&&n.trim()?Ye(n):null;if(v){f(v);return}if(o){f(_r(o));return}f(null)},[n,t,o]);return s.useEffect(()=>{c()},[c]),s.useEffect(()=>{if(t)return window.addEventListener("scroll",c,!0),window.addEventListener("resize",c),()=>{window.removeEventListener("scroll",c,!0),window.removeEventListener("resize",c)}},[t,c]),!t||i==null?null:d.jsx("div",{"aria-hidden":!0,style:{...Fr(l),left:i.left,top:i.top,width:i.width,height:i.height}})}),be=32,Ze=150,Te=250,U={cardBg:"var(--ui-color-bg-surface-default, #ffffff)",cardFooterBg:"var(--ui-color-bg-surface-secondary-default, #f8fafc)",textDark:"var(--ui-color-text-primary, #333333)",textMuted:"var(--ui-color-text-secondary, #888888)",border:"var(--ui-color-border-default, #cccccc)",shadow:"var(--ui-shadow-card, 0 4px 16px rgba(0, 0, 0, 0.12))"},Mr={[j.PENDING]:"Pendiente",[j.DEV_FIXED]:"Corregido",[j.VALIDATED]:"Validado"},Wr={[j.PENDING]:"PENDIENTE",[j.DEV_FIXED]:"CORREGIDO",[j.VALIDATED]:"VALIDADO"},oe={[j.PENDING]:"var(--ui-color-red-500, rgb(240, 69, 69))",[j.DEV_FIXED]:"var(--ui-color-yellow-500, rgb(235, 179, 8))",[j.VALIDATED]:"var(--ui-color-green-500, rgb(33, 196, 94))"},Qe={[j.PENDING]:"var(--ui-color-bg-surface-danger-default, #fef2f2)",[j.DEV_FIXED]:"var(--ui-color-bg-surface-warning-default, #fffbeb)",[j.VALIDATED]:"var(--ui-color-bg-surface-success-default, #f0fdf4)"},ye={[j.PENDING]:"var(--ui-color-red-500, #ef4444)",[j.DEV_FIXED]:"var(--ui-color-orange-500, #f59e0b)",[j.VALIDATED]:"var(--ui-color-green-500, #22c55e)"};function Br(r){const n=r.trim().split(/\s+/);return n.length>=2?(n[0][0]+n[n.length-1][0]).toUpperCase():r.slice(0,2).toUpperCase()||"?"}const Ur=()=>d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",style:{marginRight:4,flexShrink:0},children:d.jsx("path",{d:"M10 3L4.5 8.5L2 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),Yr=({color:r})=>d.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",style:{flexShrink:0},children:[d.jsx("path",{d:"M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),d.jsx("path",{d:"M8 10h.01M12 10h.01M16 10h.01",stroke:"var(--ui-color-white, #fff)",strokeWidth:"1.5",strokeLinecap:"round"})]}),Hr=r=>({position:"fixed",width:be,height:be,borderRadius:"50%",backgroundColor:oe[r]??oe[j.PENDING],color:"var(--ui-color-text-on-color, #fff)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",fontFamily:"var(--ui-font-family-ui, 'Inter', sans-serif)",boxShadow:"0 2px 8px var(--ui-color-black-alpha-20, rgba(0,0,0,0.2))",zIndex:999998,border:"2px solid var(--ui-color-white, #fff)"}),Gr={position:"fixed",width:Te,minWidth:Te,maxWidth:Te,boxSizing:"border-box",backgroundColor:U.cardBg,borderRadius:"var(--ui-radius_12, 12px)",boxShadow:U.shadow,fontSize:"var(--ui-font-size-sm, 14px)",fontFamily:"var(--ui-font-family-ui, 'Inter', sans-serif)",zIndex:999999,pointerEvents:"auto"},Xr={display:"flex",alignItems:"center",justifyContent:"space-between",gap:"var(--ui-positive-Value_250, 10px)",borderBottom:`1px solid ${U.border}`,padding:"var(--ui-positive-Value_300, 12px)"},Jr=r=>({width:40,height:40,borderRadius:"50%",backgroundColor:oe[r]??oe[j.PENDING],color:"var(--ui-color-text-on-color, #fff)",border:"2px solid var(--ui-color-white, #fff)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"var(--ui-font-size-sm, 14px)",fontWeight:"var(--ui-font-weight-bold, 700)",flexShrink:0,overflow:"hidden"}),Zr=s.memo(function({reviewer:n,status:t}){const o=n==null?void 0:n.image_url,l=(n==null?void 0:n.name)??"Revisor",i=Jr(t);if(o&&o.trim()){const f=oe[t]??oe[j.PENDING];return d.jsx("div",{style:{...i,border:`2px solid ${f}`},children:d.jsx("img",{src:o,alt:l,style:{width:"100%",height:"100%",objectFit:"cover"},loading:"lazy"})})}return d.jsx("div",{style:i,children:Br(l)})}),Qr={flexShrink:0,width:"var(--ui-positive-Value_600, 24px)",height:"var(--ui-positive-Value_600, 24px)",padding:0,border:"none",borderRadius:"var(--ui-radius_6, 6px)",backgroundColor:"transparent",color:U.textDark,cursor:"pointer",fontSize:"var(--ui-positive-Value_450, 18px)",lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center"},Kr=r=>{const n=ye[r]??ye[j.PENDING];return{display:"inline-flex",alignItems:"center",padding:"var(--ui-positive-Value_50, 4px) var(--ui-positive-Value_100, 10px)",borderRadius:"var(--ui-radius_full, 9999px)",fontSize:"8px",fontWeight:"var(--ui-font-weight-bold, 700)",fontFamily:"var(--ui-font-family-ui, 'Inter', sans-serif)",textTransform:"uppercase",letterSpacing:"0.02em",backgroundColor:Qe[r]??Qe[j.PENDING],color:n,border:`1px solid ${n}`}},qr={display:"block",fontSize:"var(--ui-font-size-2xs, 10px)",fontWeight:"var(--ui-font-weight-semibold, 600)",fontFamily:"var(--ui-font-family-ui, 'Inter', sans-serif)",color:U.textMuted,textTransform:"uppercase",letterSpacing:"0.04em"},$r={width:"100%",padding:"var(--ui-positive-Value_200, 8px) var(--ui-positive-Value_300, 12px)",paddingRight:"var(--ui-positive-Value_800, 32px)",fontSize:"var(--ui-font-size-xs, 13px)",fontFamily:"var(--ui-font-family-ui, 'Inter', sans-serif)",borderRadius:"var(--ui-radius_8, 8px)",border:`1px solid ${U.border}`,backgroundColor:U.cardBg,color:U.textDark,cursor:"pointer",appearance:"none",backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L2 4h8z'/%3E%3C/svg%3E")`,backgroundRepeat:"no-repeat",backgroundPosition:"right var(--ui-positive-Value_250, 10px) center"},et={display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"var(--ui-positive-Value_200, 8px)",padding:"var(--ui-positive-Value_300, 12px)",borderTop:`1px solid ${U.border}`,backgroundColor:U.cardFooterBg},Ke={minWidth:100,padding:"var(--ui-positive-Value_200, 8px) var(--ui-positive-Value_350, 14px)",fontSize:"var(--ui-font-size-xs, 13px)",fontWeight:"var(--ui-font-weight-semibold, 600)",fontFamily:"var(--ui-font-family-ui, 'Inter', sans-serif)",borderRadius:"var(--ui-radius_8, 8px)",cursor:"pointer",border:"none"},rt={...Ke,backgroundColor:"transparent",color:U.textDark},xe="review-layer-resolve-btn",tt=["pending","dev_fixed","validated"],ot={...Ke,backgroundColor:"var(--ui-color-bg-fill-success-default, #22c55e)",color:"var(--ui-color-text-on-color, #fff)"};function nt({comment:r,offset:n={dx:0,dy:0},apiUrl:t,apiKey:o,onStatusChange:l,reviewMode:i=!1}){var ve,pe;const[f,c]=s.useState(!1),[v,h]=s.useState(!1),[m,S]=s.useState(()=>he(r)),[w,L]=s.useState(!1),[A,M]=s.useState(null),V=s.useRef(null),N=s.useRef(null),p=s.useRef(null),T=s.useCallback(()=>{S(he(r))},[r]);s.useEffect(()=>{T()},[T]),s.useEffect(()=>{if(!(typeof window>"u"))return window.addEventListener("scroll",T,!0),window.addEventListener("resize",T),()=>{window.removeEventListener("scroll",T,!0),window.removeEventListener("resize",T)}},[T]),s.useEffect(()=>{if(!r.selector||typeof document>"u")return;const E=document.querySelector(r.selector);if(!E)return;const re=Ue(E).map(q=>(q.addEventListener("scroll",T,!0),()=>q.removeEventListener("scroll",T,!0)));return()=>re.forEach(q=>q())},[r.selector,T]);const Y=s.useCallback(()=>{V.current!==null&&(clearTimeout(V.current),V.current=null)},[]),R=s.useCallback(()=>{i||(Y(),c(!0))},[i,Y]),C=s.useCallback(()=>{v||(V.current=setTimeout(()=>{V.current=null,c(!1)},Ze))},[v]),I=s.useCallback(()=>{Y(),c(!0)},[Y]),X=s.useCallback(()=>{v||(V.current=setTimeout(()=>{V.current=null,c(!1)},Ze))},[v]),H=s.useCallback(()=>{if(i){v&&(h(!1),c(!1));return}v?(h(!1),c(!1)):(h(!0),c(!0))},[i,v]);s.useEffect(()=>{if(!v)return;const E=$=>{var q,we;const re=$.target;(q=N.current)!=null&&q.contains(re)||(we=p.current)!=null&&we.contains(re)||(h(!1),c(!1))};return document.addEventListener("mousedown",E,!0),()=>document.removeEventListener("mousedown",E,!0)},[v]),s.useEffect(()=>()=>Y(),[Y]),s.useEffect(()=>{i&&(h(!1),c(!1))},[i]);const K=m.x+n.dx,ie=m.y+n.dy,{x:b,y}=ke(K,ie,be/2),D=f&&!v,O=s.useCallback(()=>{h(!1),c(!1)},[]),ee=s.useCallback(async E=>{if(E!==r.status){M(null),L(!0);try{await Pr(t,o,r.id,E),l()}catch($){M($ instanceof Error?$.message:"Error al actualizar")}finally{L(!1)}}},[t,o,r.id,r.status,l]),ae=s.useCallback(async()=>{M(null),L(!0);try{await jr(t,o,r.id),l(),O()}catch(E){M(E instanceof Error?E.message:"Error al eliminar")}finally{L(!1)}},[t,o,r.id,l,O]),se=s.useMemo(()=>({...Hr(r.status),left:b,top:y,transform:"translate(-50%, -50%)"}),[r.status,b,y]);return d.jsxs(d.Fragment,{children:[d.jsx(Nr,{selector:r.selector,active:D,fallbackComment:r,outlineColor:ye[r.status]??ye[j.PENDING]}),d.jsx("div",{ref:N,role:"button",tabIndex:0,"aria-label":`Comentario: ${r.message.slice(0,30)}...`,"aria-expanded":f,style:se,onMouseEnter:R,onMouseLeave:C,onClick:H,children:d.jsx(Yr,{color:"var(--ui-color-white, #fff)"})}),f&&d.jsxs("div",{ref:p,role:"dialog","aria-label":"Detalle del comentario",style:{...Gr,left:b+be/2+6,top:y},onMouseEnter:I,onMouseLeave:X,children:[d.jsxs("div",{style:Xr,children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,flex:1,minWidth:0},children:[d.jsx(Zr,{reviewer:r.reviewer,status:r.status}),d.jsxs("div",{children:[d.jsx("div",{style:{fontWeight:700,fontSize:14,color:U.textDark},children:((ve=r.reviewer)==null?void 0:ve.name)??"Revisor"}),d.jsx("div",{style:{fontSize:12,color:U.textMuted},children:((pe=r.reviewer)==null?void 0:pe.job_title)??"Revisor"})]})]}),d.jsx("button",{type:"button","aria-label":r.status===j.VALIDATED?"Eliminar comentario":"Cerrar",style:Qr,disabled:w,onClick:E=>{E.stopPropagation(),r.status===j.VALIDATED?ae():O()},onMouseDown:E=>E.stopPropagation(),children:"✕"})]}),d.jsxs("div",{style:{padding:12,display:"flex",alignItems:"flex-start",flexDirection:"column",gap:4},children:[d.jsxs("div",{style:Kr(r.status),children:[r.status===j.VALIDATED&&d.jsx(Ur,{}),Wr[r.status]??r.status]}),d.jsx("div",{style:{color:U.textDark,lineHeight:1.5,marginBottom:12,marginTop:12},children:r.message}),d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,width:"100%"},children:[d.jsx("label",{style:qr,htmlFor:`comment-status-${r.id}`,children:"Cambiar estado"}),d.jsx("select",{id:`comment-status-${r.id}`,style:$r,value:r.status,disabled:w,onChange:E=>ee(E.target.value),onMouseDown:E=>E.stopPropagation(),"aria-label":"Cambiar estado del comentario",children:tt.map(E=>d.jsx("option",{value:E,children:Mr[E]},E))}),A&&d.jsx("div",{style:{marginTop:8,fontSize:11,color:"var(--ui-color-text-danger-default, rgb(240, 69, 69))"},children:A})]})]}),d.jsxs("div",{style:et,children:[d.jsx("button",{type:"button",style:rt,onMouseDown:E=>E.stopPropagation(),onClick:E=>{E.stopPropagation(),O()},children:"Cerrar"}),r.status!==j.VALIDATED&&d.jsxs(d.Fragment,{children:[d.jsx("style",{children:`
31
+ .${xe}:hover:not(:disabled) {
32
32
  background-color: var(--ui-color-bg-fill-success-hover, #16a34a) !important;
33
33
  }
34
- .${be}:active:not(:disabled) {
34
+ .${xe}:active:not(:disabled) {
35
35
  background-color: var(--ui-color-bg-fill-success-pressed, #15803d) !important;
36
36
  }
37
- .${be}:disabled {
37
+ .${xe}:disabled {
38
38
  background-color: var(--ui-color-bg-fill-success-default, #22c55e) !important;
39
39
  opacity: 0.7;
40
40
  cursor: not-allowed;
41
41
  }
42
- `}),f.jsx("button",{type:"button",className:be,style:et,disabled:V,onMouseDown:_=>_.stopPropagation(),onClick:_=>{_.stopPropagation(),Q("validated")},children:"Validar"})]})]})]})]})}const tt=s.memo(rt),ot=25,nt=36;function it(r){const o=new Map;for(let t=0;t<r.length;t++){const n=r[t],{x:i,y:l}=pe(n),{x:c,y:p}=Ce(i,l);let v=0;for(let w=0;w<t;w++){const{x:b,y:E}=pe(r[w]),{x:V,y:P}=Ce(b,E);Math.hypot(c-V,p-P)<ot&&v++}o.set(n.id,{dx:v*nt,dy:0})}return o}function at(){return typeof window>"u"?"":`${window.innerWidth}x${window.innerHeight}`}function st({apiUrl:r,apiKey:o,reviewMode:t,setReviewMode:n,reviewers:i,comments:l,loadComments:c,commentsLoadFailed:p=!1}){const[v,w]=s.useState(null),b=s.useRef(null),[E,V]=s.useState(null),P=s.useCallback(()=>{v&&(v.style.outline="",v.style.outlineOffset="",w(null))},[v]),O=s.useCallback(()=>{b.current&&(b.current.style.outline="",b.current.style.outlineOffset="",b.current=null)},[]);s.useEffect(()=>{t||(P(),O())},[t,P,O]),s.useEffect(()=>{if(typeof document>"u")return;const m=document.body.style.cursor;return E?document.body.style.cursor="default":t&&(document.body.style.cursor="crosshair"),()=>{document.body.style.cursor=m}},[t,E]);const M=s.useCallback(m=>{var j;if(!m||typeof document>"u"||m===document.body||m===document.documentElement)return!0;const S=(j=m.tagName)==null?void 0:j.toUpperCase();return S==="BODY"||S==="HTML"?!0:m.parentElement!==document.body?!1:m.id==="root"||m.getAttribute("data-review-layer-host")!=null||document.body.children.length===1},[]),L=s.useCallback(m=>{if(!t||E)return;const S=m.target.nodeType===Node.ELEMENT_NODE?m.target:m.target.parentElement;!S||M(S)||(P(),w(S),S.style.outline="2px solid var(--ui-color-bg-fill-danger-default, #ff4d4f)",S.style.outlineOffset="2px")},[t,E,P,M]),h=s.useCallback(m=>{var j;if(E)return;const S=m.relatedTarget;v&&(!S||!v.contains(S))&&!(S&&((j=v.contains)!=null&&j.call(v,S)))&&P()},[v,E,P]),d=s.useCallback(m=>{if(!t||E)return;const S=m.target;if(!S||M(S)||S.closest("[data-review-layer-root]"))return;m.preventDefault(),m.stopPropagation(),P();const j=S;b.current=j,j.style.outline="2px solid var(--ui-color-bg-fill-danger-default, #ff4d4f)",j.style.outlineOffset="2px";const I=j.getBoundingClientRect(),Y=yr(S),{relativeX:Q,relativeY:te}=wr(I);V({position:{x:I.left+I.width/2,y:I.bottom},payload:{selector:Y,x:Math.round(I.left),y:Math.round(I.top),relativeX:Q,relativeY:te,width:Math.round(I.width),height:Math.round(I.height),url:typeof window<"u"?ke():"/",viewport:at(),userAgent:typeof navigator<"u"?navigator.userAgent:"",pageTitle:typeof document<"u"?document.title:""}})},[t,E,P,M]);s.useEffect(()=>{if(t)return document.addEventListener("mouseover",L,!0),document.addEventListener("mouseout",h,!0),document.addEventListener("click",d,!0),()=>{document.removeEventListener("mouseover",L,!0),document.removeEventListener("mouseout",h,!0),document.removeEventListener("click",d,!0)}},[t,L,h,d]);const[x,A]=s.useState(0),F=s.useCallback(()=>{if(A(m=>m+1),b.current){const m=b.current.getBoundingClientRect();V(S=>S?{...S,position:{x:m.left+m.width/2,y:m.bottom}}:null)}},[]);s.useEffect(()=>{if(!(typeof window>"u"))return window.addEventListener("resize",F),window.addEventListener("scroll",F,!0),()=>{window.removeEventListener("resize",F),window.removeEventListener("scroll",F,!0)}},[F]),s.useEffect(()=>{if(!E||!b.current)return;const m=b.current,j=Be(m).map(I=>(I.addEventListener("scroll",F,!0),()=>I.removeEventListener("scroll",F,!0)));return()=>j.forEach(I=>I())},[E,F]);const le=s.useMemo(()=>it(l),[l,x]),ue=s.useCallback(()=>{O(),V(null)},[O]),ce={position:"fixed",inset:0,zIndex:999999,pointerEvents:"none",cursor:t?"crosshair":void 0},ee=f.jsxs(f.Fragment,{children:[f.jsx("div",{style:ce,"aria-hidden":!0,"data-review-layer-root":!0}),t&&f.jsxs("div",{"data-review-layer-root":!0,style:{position:"fixed",top:"var(--ui-positive-Value_250, 10px)",left:"var(--ui-positive-Value_250, 10px)",zIndex:1e6,display:"flex",alignItems:"center",gap:"var(--ui-positive-Value_250, 10px)",padding:"var(--ui-positive-Value_150, 6px) var(--ui-positive-Value_300, 12px)",backgroundColor:"var(--ui-color-bg-fill-danger-default, #ff4d4f)",color:"var(--ui-color-text-on-color, #fff)",borderRadius:"var(--ui-radius_6, 6px)",fontSize:"var(--ui-font-size-xs, 12px)",fontWeight:"var(--ui-font-weight-medium, 500)",pointerEvents:"auto"},children:[f.jsx("span",{children:"Modo revisión (Shift+R para salir)"}),f.jsx("button",{type:"button",onClick:()=>n(!1),"aria-label":"Salir del modo revisión",style:{padding:0,margin:0,width:20,height:20,display:"flex",alignItems:"center",justifyContent:"center",border:"none",borderRadius:"var(--ui-radius_6, 6px)",backgroundColor:"rgba(255,255,255,0.2)",color:"inherit",fontSize:14,lineHeight:1,cursor:"pointer"},children:"×"})]}),p&&f.jsxs("div",{style:{position:"fixed",bottom:"var(--ui-positive-Value_400, 16px)",left:"50%",transform:"translateX(-50%)",display:"flex",alignItems:"center",gap:"var(--ui-positive-Value_250, 10px)",padding:"var(--ui-positive-Value_200, 8px) var(--ui-positive-Value_350, 14px)",backgroundColor:"var(--ui-color-bg-surface-default, #fff)",border:"1px solid var(--ui-color-border-subtle, #e8e8e8)",borderRadius:"var(--ui-radius_8, 8px)",boxShadow:"0 2px 12px var(--ui-color-black-alpha-10, rgba(0,0,0,0.1))",fontSize:"var(--ui-font-size-xs, 12px)",color:"var(--ui-color-text-primary, #333)",zIndex:999997,pointerEvents:"auto"},children:[f.jsx("span",{children:"No se pudo conectar. Mostrando últimos datos guardados. Reintentar no garantiza respuesta hasta que el servicio esté activo."}),f.jsx("button",{type:"button",onClick:()=>c(),style:{padding:"var(--ui-positive-Value_100, 4px) var(--ui-positive-Value_250, 10px)",fontSize:"var(--ui-font-size-xs, 12px)",fontWeight:"var(--ui-font-weight-semibold, 600)",backgroundColor:"var(--ui-color-bg-fill-success-default, rgb(33, 196, 94))",color:"var(--ui-color-text-on-color, #fff)",border:"none",borderRadius:"var(--ui-radius_6, 6px)",cursor:"pointer"},children:"Reintentar"})]}),l.map(m=>f.jsx("div",{"data-review-layer-pin":!0,style:{pointerEvents:"auto"},children:f.jsx(tt,{comment:m,offset:le.get(m.id),apiUrl:r,apiKey:o,onStatusChange:c,reviewMode:t})},m.id)),E&&f.jsx("div",{"data-review-layer-modal":!0,style:{pointerEvents:"auto"},children:f.jsx(Or,{apiUrl:r,apiKey:o,reviewers:i,position:E.position,payload:E.payload,onClose:ue,onSuccess:c})})]}),re=typeof document<"u"?document.body:null;return re?Ne.createPortal(ee,re):null}const lt=`/**
42
+ `}),d.jsx("button",{type:"button",className:xe,style:ot,disabled:w,onMouseDown:E=>E.stopPropagation(),onClick:E=>{E.stopPropagation(),ee("validated")},children:"Validar"})]})]})]})]})}const it=s.memo(nt),at=25,st=36;function lt(r){const n=new Map;for(let t=0;t<r.length;t++){const o=r[t],{x:l,y:i}=he(o),{x:f,y:c}=ke(l,i);let v=0;for(let h=0;h<t;h++){const{x:m,y:S}=he(r[h]),{x:w,y:L}=ke(m,S);Math.hypot(f-w,c-L)<at&&v++}n.set(o.id,{dx:v*st,dy:0})}return n}function ut(){return typeof window>"u"?"":`${window.innerWidth}x${window.innerHeight}`}function ct({apiUrl:r,apiKey:n,getPageUrl:t,reviewMode:o,setReviewMode:l,reviewers:i,comments:f,loadComments:c,commentsLoadFailed:v=!1}){const[h,m]=s.useState(null),S=s.useRef(null),[w,L]=s.useState(null),A=s.useCallback(()=>{h&&(h.style.outline="",h.style.outlineOffset="",m(null))},[h]),M=s.useCallback(()=>{S.current&&(S.current.style.outline="",S.current.style.outlineOffset="",S.current=null)},[]);s.useEffect(()=>{o||(A(),M())},[o,A,M]),s.useEffect(()=>{if(typeof document>"u")return;const b=document.body.style.cursor;return w?document.body.style.cursor="default":o&&(document.body.style.cursor="crosshair"),()=>{document.body.style.cursor=b}},[o,w]);const V=s.useCallback(b=>{var D;if(!b||typeof document>"u"||b===document.body||b===document.documentElement)return!0;const y=(D=b.tagName)==null?void 0:D.toUpperCase();return y==="BODY"||y==="HTML"?!0:b.parentElement!==document.body?!1:b.id==="root"||b.getAttribute("data-review-layer-host")!=null||document.body.children.length===1},[]),N=s.useCallback(b=>{if(!o||w)return;const y=b.target.nodeType===Node.ELEMENT_NODE?b.target:b.target.parentElement;!y||V(y)||(A(),m(y),y.style.outline="2px solid var(--ui-color-bg-fill-danger-default, #ff4d4f)",y.style.outlineOffset="2px")},[o,w,A,V]),p=s.useCallback(b=>{var D;if(w)return;const y=b.relatedTarget;h&&(!y||!h.contains(y))&&!(y&&((D=h.contains)!=null&&D.call(h,y)))&&A()},[h,w,A]),T=s.useCallback(b=>{if(!o||w)return;const y=b.target;if(!y||V(y)||y.closest("[data-review-layer-root]"))return;b.preventDefault(),b.stopPropagation(),A();const D=y;S.current=D,D.style.outline="2px solid var(--ui-color-bg-fill-danger-default, #ff4d4f)",D.style.outlineOffset="2px";const O=D.getBoundingClientRect(),ee=xr(y),{relativeX:ae,relativeY:se}=Er(O);L({position:{x:O.left+O.width/2,y:O.bottom},payload:{selector:ee,x:Math.round(O.left),y:Math.round(O.top),relativeX:ae,relativeY:se,width:Math.round(O.width),height:Math.round(O.height),url:typeof window<"u"?(t==null?void 0:t())??Ge():"/",viewport:ut(),userAgent:typeof navigator<"u"?navigator.userAgent:"",pageTitle:typeof document<"u"?document.title:""}})},[o,w,A,V]);s.useEffect(()=>{if(o)return document.addEventListener("mouseover",N,!0),document.addEventListener("mouseout",p,!0),document.addEventListener("click",T,!0),()=>{document.removeEventListener("mouseover",N,!0),document.removeEventListener("mouseout",p,!0),document.removeEventListener("click",T,!0)}},[o,N,p,T]);const[Y,R]=s.useState(0),C=s.useCallback(()=>{if(R(b=>b+1),S.current){const b=S.current.getBoundingClientRect();L(y=>y?{...y,position:{x:b.left+b.width/2,y:b.bottom}}:null)}},[]);s.useEffect(()=>{if(!(typeof window>"u"))return window.addEventListener("resize",C),window.addEventListener("scroll",C,!0),()=>{window.removeEventListener("resize",C),window.removeEventListener("scroll",C,!0)}},[C]),s.useEffect(()=>{if(!w||!S.current)return;const b=S.current,D=Ue(b).map(O=>(O.addEventListener("scroll",C,!0),()=>O.removeEventListener("scroll",C,!0)));return()=>D.forEach(O=>O())},[w,C]);const I=s.useMemo(()=>lt(f),[f,Y]),X=s.useCallback(()=>{M(),L(null)},[M]),H={position:"fixed",inset:0,zIndex:999999,pointerEvents:"none",cursor:o?"crosshair":void 0},K=d.jsxs(d.Fragment,{children:[d.jsx("div",{style:H,"aria-hidden":!0,"data-review-layer-root":!0}),o&&d.jsxs("div",{"data-review-layer-root":!0,style:{position:"fixed",top:"var(--ui-positive-Value_250, 10px)",left:"var(--ui-positive-Value_250, 10px)",zIndex:1e6,display:"flex",alignItems:"center",gap:"var(--ui-positive-Value_250, 10px)",padding:"var(--ui-positive-Value_150, 6px) var(--ui-positive-Value_300, 12px)",backgroundColor:"var(--ui-color-bg-fill-danger-default, #ff4d4f)",color:"var(--ui-color-text-on-color, #fff)",borderRadius:"var(--ui-radius_6, 6px)",fontSize:"var(--ui-font-size-xs, 12px)",fontWeight:"var(--ui-font-weight-medium, 500)",pointerEvents:"auto"},children:[d.jsx("span",{children:"Modo revisión (Shift+R para salir)"}),d.jsx("button",{type:"button",onClick:()=>l(!1),"aria-label":"Salir del modo revisión",style:{padding:0,margin:0,width:20,height:20,display:"flex",alignItems:"center",justifyContent:"center",border:"none",borderRadius:"var(--ui-radius_6, 6px)",backgroundColor:"rgba(255,255,255,0.2)",color:"inherit",fontSize:14,lineHeight:1,cursor:"pointer"},children:"×"})]}),v&&d.jsxs("div",{style:{position:"fixed",bottom:"var(--ui-positive-Value_400, 16px)",left:"50%",transform:"translateX(-50%)",display:"flex",alignItems:"center",gap:"var(--ui-positive-Value_250, 10px)",padding:"var(--ui-positive-Value_200, 8px) var(--ui-positive-Value_350, 14px)",backgroundColor:"var(--ui-color-bg-surface-default, #fff)",border:"1px solid var(--ui-color-border-subtle, #e8e8e8)",borderRadius:"var(--ui-radius_8, 8px)",boxShadow:"0 2px 12px var(--ui-color-black-alpha-10, rgba(0,0,0,0.1))",fontSize:"var(--ui-font-size-xs, 12px)",color:"var(--ui-color-text-primary, #333)",zIndex:999997,pointerEvents:"auto"},children:[d.jsx("span",{children:"No se pudo conectar. Mostrando últimos datos guardados. Reintentar no garantiza respuesta hasta que el servicio esté activo."}),d.jsx("button",{type:"button",onClick:()=>c(),style:{padding:"var(--ui-positive-Value_100, 4px) var(--ui-positive-Value_250, 10px)",fontSize:"var(--ui-font-size-xs, 12px)",fontWeight:"var(--ui-font-weight-semibold, 600)",backgroundColor:"var(--ui-color-bg-fill-success-default, rgb(33, 196, 94))",color:"var(--ui-color-text-on-color, #fff)",border:"none",borderRadius:"var(--ui-radius_6, 6px)",cursor:"pointer"},children:"Reintentar"})]}),f.map(b=>d.jsx("div",{"data-review-layer-pin":!0,style:{pointerEvents:"auto"},children:d.jsx(it,{comment:b,offset:I.get(b.id),apiUrl:r,apiKey:n,onStatusChange:c,reviewMode:o})},b.id)),w&&d.jsx("div",{"data-review-layer-modal":!0,style:{pointerEvents:"auto"},children:d.jsx(Ar,{apiUrl:r,apiKey:n,reviewers:i,position:w.position,payload:w.payload,onClose:X,onSuccess:c})})]}),ie=typeof document<"u"?document.body:null;return ie?Me.createPortal(K,ie):null}const dt=`/**
43
43
  * Tokens de diseño UI para review-layer-react.
44
44
  * Las variables se inyectan en :root al montar ReviewProvider.
45
45
  * Puedes sobrescribirlas en tu app para adaptar el tema.
@@ -364,5 +364,5 @@ React keys must be passed directly to JSX without using spread:
364
364
  --ui-shadow-popover: 0 var(--ui-shadow-02-y) var(--ui-shadow-02-blur) var(--ui-shadow-02-Color);
365
365
  --ui-shadow-modal: 0 var(--ui-shadow-04-y) var(--ui-shadow-04-blur) var(--ui-shadow-04-Color);
366
366
  }
367
- `;function ut(r,o,t){const n=s.useCallback(()=>{r&&t(i=>!i)},[r,t]);s.useEffect(()=>{if(!r)return;const i=l=>{(l.key==="r"||l.key==="R"||l.code==="KeyR")&&l.shiftKey&&!l.ctrlKey&&!l.metaKey&&(l.preventDefault(),n())};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[r,n])}const ct="review_layer:v1:";function dt(r,o){if(r==null)return o;try{return JSON.parse(r)??o}catch{return o}}function ye(r,o,t,n){const i=`${ct}${ft(r)}:${t}`;return n!=null?`${i}:${n}`:i}function ft(r){return r.replace(/\/+$/,"")||"/"}function Qe(r){if(typeof localStorage>"u")return null;const o=localStorage.getItem(r);return dt(o,null)}function Ke(r,o){if(!(typeof localStorage>"u"))try{localStorage.setItem(r,JSON.stringify({data:o,at:Date.now()}))}catch{}}function Te(r,o,t){const n=Qe(ye(r,o,"comments",t));return(n==null?void 0:n.data)??null}function vt(r,o,t,n){Ke(ye(r,o,"comments",t),n)}function qe(r,o){const t=Qe(ye(r,o,"reviewers"));return(t==null?void 0:t.data)??null}function pt(r,o,t){Ke(ye(r,o,"reviewers"),t)}const $e="https://review-layer-api.onrender.com/api",er=s.createContext(null);let je=null;function gt(){const r=s.useContext(er);if(!r)throw new Error("useReview must be used within ReviewProvider");return r}const N="[review-layer]";function ht({children:r,enabled:o=!0,apiUrl:t,apiKey:n}){const i=(t==null?void 0:t.trim())||$e,[l,c]=s.useState(!1),[p,v]=s.useState([]),[w,b]=s.useState([]),[E,V]=s.useState(!1);ut(o,l,c);const P=s.useCallback(async h=>{if(!o||!i||!n){console.warn(N,"loadReviewers omitido: faltan enabled, apiUrl o apiKey",{enabled:o,apiUrl:i,hasApiKey:!!n});return}console.log(N,"Cargando revisores...",{apiUrl:i});try{const d=await _r(i,n,{signal:h});h!=null&&h.aborted||(v(d),pt(i,n,d),console.log(N,"Revisores cargados:",d.length))}catch(d){if(d instanceof Error&&d.name==="AbortError")return;if(!(h!=null&&h.aborted)){console.error(N,"Error al cargar revisores:",d);const x=qe(i,n);x!=null&&(v(x),console.log(N,"Usando revisores en caché:",x.length))}}},[o,i,n]),O=s.useCallback(async h=>{if(!o||!i||!n){console.warn(N,"loadComments omitido: faltan enabled, apiUrl o apiKey",{enabled:o,apiUrl:i,hasApiKey:!!n});return}const d=ke(),x=Te(i,n,d);x!=null&&b(x),console.log(N,"Cargando comentarios...",{apiUrl:i,url:d});try{V(!1);const A=await Sr(i,n,d,{signal:h});h!=null&&h.aborted||(b(A),vt(i,n,d,A),console.log(N,"Comentarios cargados:",A.length))}catch(A){if(A instanceof Error&&A.name==="AbortError")return;if(!(h!=null&&h.aborted)){V(!0),console.error(N,"Error al cargar comentarios:",A);const F=Te(i,n,d);F!=null?(b(F),console.log(N,"Usando comentarios en caché:",F.length)):console.warn(N,"Sin caché de comentarios; la lista quedará vacía hasta que la API responda.")}}},[o,i,n]);s.useEffect(()=>{if(!o||!i||!n){console.warn(N,"Provider activo pero sin carga: enabled, apiUrl y apiKey son requeridos.",{enabled:o,apiUrl:i,hasApiKey:!!n});return}const h=ke(),d=qe(i,n),x=Te(i,n,h);d!=null&&(v(d),console.log(N,"Revisores desde caché (inicial):",d.length)),x!=null&&(b(x),console.log(N,"Comentarios desde caché (inicial):",x.length,{url:h}))},[o,i,n]),s.useEffect(()=>{if(typeof document>"u")return;const h="review-layer-ui-variables";if(!document.getElementById(h)){const d=document.createElement("style");d.id=h,d.textContent=lt,document.head.appendChild(d)}},[]),s.useEffect(()=>{if(!o||!i||!n)return;const h=`${i}:${n}`;if(je!==h)return je=h,console.log(N,"Inicio de carga (revisores + comentarios)",{apiUrl:i,apiKey:n?"***":"(vacío)"}),P(),O(),()=>{setTimeout(()=>{je=null},0)}},[o,i,n,P,O]),s.useEffect(()=>{if(!o)return;const h=()=>O();return window.addEventListener("popstate",h),()=>window.removeEventListener("popstate",h)},[o,O]);const M=s.useMemo(()=>({apiUrl:i,apiKey:n,reviewMode:l,setReviewMode:c,reviewers:p,comments:w,loadComments:O,commentsLoadFailed:E}),[i,n,l,c,p,w,O,E]),L=o&&typeof document<"u"?Ne.createPortal(f.jsx(st,{apiUrl:i,apiKey:n,reviewMode:l,setReviewMode:c,reviewers:p,comments:w,loadComments:O,commentsLoadFailed:E}),document.body):null;return f.jsxs(er.Provider,{value:M,children:[r,L]})}G.DEFAULT_API_URL=$e,G.ReviewProvider=ht,G.useReview=gt,Object.defineProperty(G,Symbol.toStringTag,{value:"Module"})});
367
+ `;function ft(r,n,t){const o=s.useCallback(()=>{r&&t(l=>!l)},[r,t]);s.useEffect(()=>{if(!r)return;const l=i=>{(i.key==="r"||i.key==="R"||i.code==="KeyR")&&i.shiftKey&&!i.ctrlKey&&!i.metaKey&&(i.preventDefault(),o())};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[r,o])}const vt="review_layer:v1:";function pt(r,n){if(r==null)return n;try{return JSON.parse(r)??n}catch{return n}}function ne(r,n,t,o){const l=`${vt}${gt(r)}:${t}`;return o!=null?`${l}:${o}`:l}function gt(r){return r.replace(/\/+$/,"")||"/"}function me(r){if(typeof localStorage>"u")return null;const n=localStorage.getItem(r);return pt(n,null)}function qe(r,n){if(!(typeof localStorage>"u"))try{localStorage.setItem(r,JSON.stringify({data:n,at:Date.now()}))}catch{}}function Pe(r,n,t){const o=me(ne(r,n,"comments",t));return(o==null?void 0:o.data)??null}function ht(r,n,t,o){qe(ne(r,n,"comments",t),o)}function je(r,n){const t=me(ne(r,n,"reviewers"));return(t==null?void 0:t.data)??null}function bt(r,n,t){qe(ne(r,n,"reviewers"),t)}function yt(r,n,t){const o=me(ne(r,n,"comments",t));return(o==null?void 0:o.at)??null}function xt(r,n){const t=me(ne(r,n,"reviewers"));return(t==null?void 0:t.at)??null}const $e="https://review-layer-api.onrender.com/api",er=s.createContext(null);let Ve=null;function mt(){const r=s.useContext(er);if(!r)throw new Error("useReview must be used within ReviewProvider");return r}const W="[review-layer]",rr=2500;function wt({children:r,enabled:n=!0,apiUrl:t,apiKey:o,getPageUrl:l}){const i=(t==null?void 0:t.trim())||$e,[f,c]=s.useState(!1),[v,h]=s.useState([]),[m,S]=s.useState([]),[w,L]=s.useState(!1),A=s.useRef(!1),M=s.useRef(null),V=s.useCallback(()=>(l==null?void 0:l())??Ge(),[l]);ft(n,f,c);const N=s.useCallback(async R=>{if(!n||!i||!o){console.warn(W,"loadReviewers omitido: faltan enabled, apiUrl o apiKey",{enabled:n,apiUrl:i,hasApiKey:!!o});return}const C=xt(i,o);if(C!=null&&Date.now()-C<rr){const I=je(i,o);if(I!=null){h(I);return}}if(!A.current){A.current=!0,console.log(W,"Cargando revisores...",{apiUrl:i});try{const I=await Sr(i,o,{signal:R});R!=null&&R.aborted||(h(I),bt(i,o,I),console.log(W,"Revisores cargados:",I.length))}catch(I){if(I instanceof Error&&I.name==="AbortError")return;if(!(R!=null&&R.aborted)){console.error(W,"Error al cargar revisores:",I);const X=je(i,o);X!=null&&(h(X),console.log(W,"Usando revisores en caché:",X.length))}}finally{A.current=!1}}},[n,i,o]),p=s.useCallback(async R=>{if(!n||!i||!o){console.warn(W,"loadComments omitido: faltan enabled, apiUrl o apiKey",{enabled:n,apiUrl:i,hasApiKey:!!o});return}const C=V(),I=Pe(i,o,C);I!=null&&S(I);const X=yt(i,o,C);if(!(X!=null&&Date.now()-X<rr&&I!=null)&&M.current!==C){M.current=C,console.log(W,"Cargando comentarios...",{apiUrl:i,url:C});try{L(!1);const H=await Tr(i,o,C,{signal:R});R!=null&&R.aborted||(S(H),ht(i,o,C,H),console.log(W,"Comentarios cargados:",H.length))}catch(H){if(H instanceof Error&&H.name==="AbortError")return;if(!(R!=null&&R.aborted)){L(!0),console.error(W,"Error al cargar comentarios:",H);const K=Pe(i,o,C);K!=null?(S(K),console.log(W,"Usando comentarios en caché:",K.length)):console.warn(W,"Sin caché de comentarios; la lista quedará vacía hasta que la API responda.")}}finally{M.current=null}}},[n,i,o,V]);s.useEffect(()=>{if(!n||!i||!o){console.warn(W,"Provider activo pero sin carga: enabled, apiUrl y apiKey son requeridos.",{enabled:n,apiUrl:i,hasApiKey:!!o});return}const R=V(),C=je(i,o),I=Pe(i,o,R);C!=null&&(h(C),console.log(W,"Revisores desde caché (inicial):",C.length)),I!=null&&(S(I),console.log(W,"Comentarios desde caché (inicial):",I.length,{url:R}))},[n,i,o,V]),s.useEffect(()=>{if(typeof document>"u")return;const R="review-layer-ui-variables";if(!document.getElementById(R)){const C=document.createElement("style");C.id=R,C.textContent=dt,document.head.appendChild(C)}},[]),s.useEffect(()=>{if(!n||!i||!o)return;const R=`${i}:${o}`;if(Ve!==R)return Ve=R,console.log(W,"Inicio de carga (revisores + comentarios)",{apiUrl:i,apiKey:o?"***":"(vacío)"}),N(),p(),()=>{setTimeout(()=>{Ve=null},0)}},[n,i,o,N,p]),s.useEffect(()=>{if(!n)return;const R=()=>p();return window.addEventListener("popstate",R),()=>window.removeEventListener("popstate",R)},[n,p]);const T=s.useMemo(()=>({apiUrl:i,apiKey:o,reviewMode:f,setReviewMode:c,reviewers:v,comments:m,loadComments:p,commentsLoadFailed:w}),[i,o,f,c,v,m,p,w]),Y=n&&typeof document<"u"?Me.createPortal(d.jsx(ct,{apiUrl:i,apiKey:o,getPageUrl:V,reviewMode:f,setReviewMode:c,reviewers:v,comments:m,loadComments:p,commentsLoadFailed:w}),document.body):null;return d.jsxs(er.Provider,{value:T,children:[r,Y]})}Z.DEFAULT_API_URL=$e,Z.ReviewProvider=wt,Z.useReview=mt,Object.defineProperty(Z,Symbol.toStringTag,{value:"Module"})});
368
368
  //# sourceMappingURL=review-layer-react.umd.cjs.map