@bitux/review-layer-react 0.1.3 → 0.1.5
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.
- package/README.md +116 -116
- package/dist/review-layer-react.js +915 -896
- package/dist/review-layer-react.js.map +1 -1
- package/dist/review-layer-react.umd.cjs +338 -338
- package/dist/review-layer-react.umd.cjs.map +1 -1
- package/package.json +59 -59
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(G,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],a):(G=typeof globalThis<"u"?globalThis:G||self,a(G.ReviewLayerReact={},G.React,G.ReactDOM))})(this,function(G,a,
|
|
1
|
+
(function(G,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],a):(G=typeof globalThis<"u"?globalThis:G||self,a(G.ReviewLayerReact={},G.React,G.ReactDOM))})(this,function(G,a,Ae){"use strict";var Ee={exports:{}},ee={};/**
|
|
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
|
|
9
|
+
*/var Fe;function fr(){if(Fe)return ee;Fe=1;var r=a,o=Symbol.for("react.element"),t=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function g(b,f,_){var y,m={},j=null,k=null;_!==void 0&&(j=""+_),f.key!==void 0&&(j=""+f.key),f.ref!==void 0&&(k=f.ref);for(y in f)i.call(f,y)&&!c.hasOwnProperty(y)&&(m[y]=f[y]);if(b&&b.defaultProps)for(y in f=b.defaultProps,f)m[y]===void 0&&(m[y]=f[y]);return{$$typeof:o,type:b,key:j,ref:k,props:m,_owner:l.current}}return ee.Fragment=t,ee.jsx=g,ee.jsxs=g,ee}var re={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,355 +14,355 @@
|
|
|
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
|
|
18
|
-
`+
|
|
19
|
-
`),N=
|
|
17
|
+
*/var Ne;function vr(){return Ne||(Ne=1,process.env.NODE_ENV!=="production"&&function(){var r=a,o=Symbol.for("react.element"),t=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),b=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),k=Symbol.for("react.offscreen"),V=Symbol.iterator,F="@@iterator";function L(e){if(e===null||typeof e!="object")return null;var n=V&&e[V]||e[F];return typeof n=="function"?n:null}var d=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function v(e){{for(var n=arguments.length,u=new Array(n>1?n-1:0),p=1;p<n;p++)u[p-1]=arguments[p];I("error",e,u)}}function I(e,n,u){{var p=d.ReactDebugCurrentFrame,R=p.getStackAddendum();R!==""&&(n+="%s",u=u.concat([R]));var S=u.map(function(x){return String(x)});S.unshift("Warning: "+n),Function.prototype.apply.call(console[e],console,S)}}var A=!1,H=!1,oe=!1,ne=!1,ie=!1,X;X=Symbol.for("react.module.reference");function w(e){return!!(typeof e=="string"||typeof e=="function"||e===i||e===c||ie||e===l||e===_||e===y||ne||e===k||A||H||oe||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===m||e.$$typeof===g||e.$$typeof===b||e.$$typeof===f||e.$$typeof===X||e.getModuleId!==void 0))}function P(e,n,u){var p=e.displayName;if(p)return p;var R=n.displayName||n.name||"";return R!==""?u+"("+R+")":u}function z(e){return e.displayName||"Context"}function T(e){if(e==null)return null;if(typeof e.tag=="number"&&v("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 i:return"Fragment";case t:return"Portal";case c:return"Profiler";case l:return"StrictMode";case _:return"Suspense";case y:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case b:var n=e;return z(n)+".Consumer";case g:var u=e;return z(u._context)+".Provider";case f:return P(e,e.render,"ForwardRef");case m:var p=e.displayName||null;return p!==null?p:T(e.type)||"Memo";case j:{var R=e,S=R._payload,x=R._init;try{return T(x(S))}catch{return null}}}return null}var U=Object.assign,B=0,J,ge,be,ae,le,E,Z;function ue(){}ue.__reactDisabledLog=!0;function he(){{if(B===0){J=console.log,ge=console.info,be=console.warn,ae=console.error,le=console.group,E=console.groupCollapsed,Z=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ue,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}B++}}function xe(){{if(B--,B===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:U({},e,{value:J}),info:U({},e,{value:ge}),warn:U({},e,{value:be}),error:U({},e,{value:ae}),group:U({},e,{value:le}),groupCollapsed:U({},e,{value:E}),groupEnd:U({},e,{value:Z})})}B<0&&v("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var je=d.ReactCurrentDispatcher,Ve;function ye(e,n,u){{if(Ve===void 0)try{throw Error()}catch(R){var p=R.stack.trim().match(/\n( *(at )?)/);Ve=p&&p[1]||""}return`
|
|
18
|
+
`+Ve+e}}var Te=!1,me;{var vt=typeof WeakMap=="function"?WeakMap:Map;me=new vt}function Ke(e,n){if(!e||Te)return"";{var u=me.get(e);if(u!==void 0)return u}var p;Te=!0;var R=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var S;S=je.current,je.current=null,he();try{if(n){var x=function(){throw Error()};if(Object.defineProperty(x.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(x,[])}catch(W){p=W}Reflect.construct(e,[],x)}else{try{x.call()}catch(W){p=W}e.call(x.prototype)}}else{try{throw Error()}catch(W){p=W}e()}}catch(W){if(W&&p&&typeof W.stack=="string"){for(var h=W.stack.split(`
|
|
19
|
+
`),N=p.stack.split(`
|
|
20
20
|
`),D=h.length-1,O=N.length-1;D>=1&&O>=0&&h[D]!==N[O];)O--;for(;D>=1&&O>=0;D--,O--)if(h[D]!==N[O]){if(D!==1||O!==1)do if(D--,O--,O<0||h[D]!==N[O]){var Y=`
|
|
21
|
-
`+h[D].replace(" at new "," at ");return
|
|
21
|
+
`+h[D].replace(" at new "," at ");return e.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",e.displayName)),typeof e=="function"&&me.set(e,Y),Y}while(D>=1&&O>=0);break}}}finally{Te=!1,je.current=S,xe(),Error.prepareStackTrace=R}var $=e?e.displayName||e.name:"",Q=$?ye($):"";return typeof e=="function"&&me.set(e,Q),Q}function pt(e,n,u){return Ke(e,!1)}function gt(e){var n=e.prototype;return!!(n&&n.isReactComponent)}function we(e,n,u){if(e==null)return"";if(typeof e=="function")return Ke(e,gt(e));if(typeof e=="string")return ye(e);switch(e){case _:return ye("Suspense");case y:return ye("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return pt(e.render);case m:return we(e.type,n,u);case j:{var p=e,R=p._payload,S=p._init;try{return we(S(R),n,u)}catch{}}}return""}var se=Object.prototype.hasOwnProperty,qe={},$e=d.ReactDebugCurrentFrame;function _e(e){if(e){var n=e._owner,u=we(e.type,e._source,n?n.type:null);$e.setExtraStackFrame(u)}else $e.setExtraStackFrame(null)}function bt(e,n,u,p,R){{var S=Function.call.bind(se);for(var x in e)if(S(e,x)){var h=void 0;try{if(typeof e[x]!="function"){var N=Error((p||"React class")+": "+u+" type `"+x+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[x]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw N.name="Invariant Violation",N}h=e[x](n,x,p,u,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(D){h=D}h&&!(h instanceof Error)&&(_e(R),v("%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).",p||"React class",u,x,typeof h),_e(null)),h instanceof Error&&!(h.message in qe)&&(qe[h.message]=!0,_e(R),v("Failed %s type: %s",u,h.message),_e(null))}}}var ht=Array.isArray;function De(e){return ht(e)}function xt(e){{var n=typeof Symbol=="function"&&Symbol.toStringTag,u=n&&e[Symbol.toStringTag]||e.constructor.name||"Object";return u}}function yt(e){try{return er(e),!1}catch{return!0}}function er(e){return""+e}function rr(e){if(yt(e))return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",xt(e)),er(e)}var tr=d.ReactCurrentOwner,mt={key:!0,ref:!0,__self:!0,__source:!0},or,nr;function wt(e){if(se.call(e,"ref")){var n=Object.getOwnPropertyDescriptor(e,"ref").get;if(n&&n.isReactWarning)return!1}return e.ref!==void 0}function _t(e){if(se.call(e,"key")){var n=Object.getOwnPropertyDescriptor(e,"key").get;if(n&&n.isReactWarning)return!1}return e.key!==void 0}function Et(e,n){typeof e.ref=="string"&&tr.current}function Rt(e,n){{var u=function(){or||(or=!0,v("%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)",n))};u.isReactWarning=!0,Object.defineProperty(e,"key",{get:u,configurable:!0})}}function St(e,n){{var u=function(){nr||(nr=!0,v("%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)",n))};u.isReactWarning=!0,Object.defineProperty(e,"ref",{get:u,configurable:!0})}}var kt=function(e,n,u,p,R,S,x){var h={$$typeof:o,type:e,key:n,ref:u,props:x,_owner:S};return h._store={},Object.defineProperty(h._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(h,"_self",{configurable:!1,enumerable:!1,writable:!1,value:p}),Object.defineProperty(h,"_source",{configurable:!1,enumerable:!1,writable:!1,value:R}),Object.freeze&&(Object.freeze(h.props),Object.freeze(h)),h};function Ct(e,n,u,p,R){{var S,x={},h=null,N=null;u!==void 0&&(rr(u),h=""+u),_t(n)&&(rr(n.key),h=""+n.key),wt(n)&&(N=n.ref,Et(n,R));for(S in n)se.call(n,S)&&!mt.hasOwnProperty(S)&&(x[S]=n[S]);if(e&&e.defaultProps){var D=e.defaultProps;for(S in D)x[S]===void 0&&(x[S]=D[S])}if(h||N){var O=typeof e=="function"?e.displayName||e.name||"Unknown":e;h&&Rt(x,O),N&&St(x,O)}return kt(e,h,N,R,p,tr.current,x)}}var Ie=d.ReactCurrentOwner,ir=d.ReactDebugCurrentFrame;function q(e){if(e){var n=e._owner,u=we(e.type,e._source,n?n.type:null);ir.setExtraStackFrame(u)}else ir.setExtraStackFrame(null)}var Oe;Oe=!1;function Le(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function ar(){{if(Ie.current){var e=T(Ie.current.type);if(e)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function Pt(e){return""}var lr={};function jt(e){{var n=ar();if(!n){var u=typeof e=="string"?e:e.displayName||e.name;u&&(n=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+u+">.")}return n}}function
|
|
25
|
+
Check the top-level render call using <`+u+">.")}return n}}function ur(e,n){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var u=jt(n);if(lr[u])return;lr[u]=!0;var p="";e&&e._owner&&e._owner!==Ie.current&&(p=" It was passed a child from "+T(e._owner.type)+"."),q(e),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',u,p),q(null)}}function sr(e,n){{if(typeof e!="object")return;if(De(e))for(var u=0;u<e.length;u++){var p=e[u];Le(p)&&ur(p,n)}else if(Le(e))e._store&&(e._store.validated=!0);else if(e){var R=L(e);if(typeof R=="function"&&R!==e.entries)for(var S=R.call(e),x;!(x=S.next()).done;)Le(x.value)&&ur(x.value,n)}}}function Vt(e){{var n=e.type;if(n==null||typeof n=="string")return;var u;if(typeof n=="function")u=n.propTypes;else if(typeof n=="object"&&(n.$$typeof===f||n.$$typeof===m))u=n.propTypes;else return;if(u){var p=T(n);bt(u,e.props,"prop",p,e)}else if(n.PropTypes!==void 0&&!Oe){Oe=!0;var R=T(n);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",R||"Unknown")}typeof n.getDefaultProps=="function"&&!n.getDefaultProps.isReactClassApproved&&v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Tt(e){{for(var n=Object.keys(e.props),u=0;u<n.length;u++){var p=n[u];if(p!=="children"&&p!=="key"){q(e),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",p),q(null);break}}e.ref!==null&&(q(e),v("Invalid attribute `ref` supplied to `React.Fragment`."),q(null))}}var cr={};function dr(e,n,u,p,R,S){{var x=w(e);if(!x){var h="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(h+=" 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 N=Pt();N?h+=N:h+=ar();var D;e===null?D="null":De(e)?D="array":e!==void 0&&e.$$typeof===o?(D="<"+(T(e.type)||"Unknown")+" />",h=" Did you accidentally export a JSX literal instead of a component?"):D=typeof e,v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",D,h)}var O=Ct(e,n,u,R,S);if(O==null)return O;if(x){var Y=n.children;if(Y!==void 0)if(p)if(De(Y)){for(var $=0;$<Y.length;$++)sr(Y[$],e);Object.freeze&&Object.freeze(Y)}else v("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 sr(Y,e)}if(se.call(n,"key")){var Q=T(e),W=Object.keys(n).filter(function(At){return At!=="key"}),ze=W.length>0?"{key: someKey, "+W.join(": ..., ")+": ...}":"{key: someKey}";if(!cr[Q+ze]){var zt=W.length>0?"{"+W.join(": ..., ")+": ...}":"{}";v(`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} />`,zr,Q,zt,Q),se[Q+zr]=!0}}return r===i?Tt(O):Vt(O),O}}function Dt(r,n,u){return ce(r,n,u,!0)}function It(r,n,u){return ce(r,n,u,!1)}var Ot=It,Lt=Dt;er.Fragment=i,er.jsx=Ot,er.jsxs=Lt}()),er}process.env.NODE_ENV==="production"?Er.exports=de():Er.exports=fe();var s=Er.exports;function ve(e){if(e.id&&/^[a-zA-Z][\w-]*$/.test(e.id))return`#${e.id}`;const o=[];let t=e;for(;t&&t.nodeType===Node.ELEMENT_NODE;){let i=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 l=t.className.trim().split(/\s+/).filter(Boolean);if(l.length>0){const c=l.filter(p=>/^[a-zA-Z][\w-]*$/.test(p)).slice(0,2).map(p=>`.${p}`).join("");c&&(i+=c)}}if(o.length>0){const l=t.parentElement;if(l){const c=Array.from(l.children).filter(p=>p.nodeName===t.nodeName);if(c.length>1){const p=c.indexOf(t)+1;i+=`:nth-child(${p})`}}}o.unshift(i),t=t.parentElement}return o.join(" > ")}const pe="[data-review-layer-root]",ge=16;function Rr(e,o,t=ge){if(typeof window>"u")return{x:e,y:o};const i=t,l=t,c=window.innerWidth-t,p=window.innerHeight-t;return{x:Math.max(i,Math.min(c,e)),y:Math.max(l,Math.min(p,o))}}function Mr(e){var o;if(typeof document>"u"||!(e!=null&&e.trim()))return null;try{const t=document.querySelector(e);return!t||(o=t.closest)!=null&&o.call(t,pe)?null:t.getBoundingClientRect()}catch{return null}}function be(e){if(typeof window>"u")return{relativeX:0,relativeY:0};const o=window.innerWidth,t=window.innerHeight;return{relativeX:o>0?e.left/o:0,relativeY:t>0?e.top/t:0}}function Sr(e){if(typeof window>"u")return{x:e.x??0,y:e.y??0};const o=e.relativeX??e.relative_x??null,t=e.relativeY??e.relative_y??null;return o!=null&&t!=null?{x:o*window.innerWidth,y:t*window.innerHeight}:{x:e.x??0,y:e.y??0}}function he(e){const{x:o,y:t}=Sr(e),i=e.width??100,l=e.height??40;return new DOMRect(o,t,i,l)}function cr(e){const o=(e.relativeX??e.relative_x)!=null&&(e.relativeY??e.relative_y)!=null,t=e.x!=null&&e.y!=null;if(o||t)return Sr(e);if(e.selector){const i=Mr(e.selector);if(i!=null)return{x:i.left,y:i.top}}return Sr(e)}const k={PENDING:"pending",DEV_FIXED:"dev_fixed",VALIDATED:"validated"};function tr(e){return{"Content-Type":"application/json","x-review-key":e}}async function xe(e,o,t){const i=await fetch(`${e}/reviewers`,{headers:tr(o),signal:t==null?void 0:t.signal});if(!i.ok)throw new Error("Failed to fetch reviewers");return(await i.json()).data??[]}async function ye(e,o,t){const i=await fetch(`${e}/comments`,{method:"POST",headers:tr(o),body:JSON.stringify(t)});if(!i.ok){const c=await i.json().catch(()=>({}));throw new Error(c.message||"Failed to create comment")}return(await i.json()).data}async function me(e,o,t,i){const l=new URLSearchParams({url:t}),c=await fetch(`${e}/comments?${l}`,{headers:tr(o),signal:i==null?void 0:i.signal});if(!c.ok)throw new Error("Failed to fetch comments");return(await c.json()).data??[]}async function we(e,o,t,i){const l=await fetch(`${e}/comments/${t}/status`,{method:"PATCH",headers:tr(o),body:JSON.stringify({status:i})});if(!l.ok){const p=await l.json().catch(()=>({}));throw new Error(p.message||"Failed to update comment status")}return(await l.json()).data}async function _e(e,o,t){const i=await fetch(`${e}/comments/${t}`,{method:"DELETE",headers:tr(o)});if(!i.ok){const l=await i.json().catch(()=>({}));throw new Error(l.message||"Failed to delete comment")}}const Ee={position:"fixed",inset:0,zIndex:999997,backgroundColor:"transparent"},Re={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},Se={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"},Ce={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)"},ke={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 Pe({apiUrl:e,apiKey:o,reviewers:t,position:i,payload:l,onClose:c,onSuccess:p}){var L;const[b,f]=a.useState(""),[_,y]=a.useState(((L=t[0])==null?void 0:L.id)??0),[m,j]=a.useState(!1),[C,V]=a.useState(null);a.useEffect(()=>{t.length>0&&!_&&y(t[0].id)},[t,_]);const F=a.useCallback(async d=>{if(d.preventDefault(),!(!b.trim()||!_)){j(!0),V(null);try{await ye(e,o,{...l,message:b.trim(),reviewerId:_}),p(),c()}catch(g){V(g instanceof Error?g.message:"Failed to send comment")}finally{j(!1)}}},[e,o,l,b,_,p,c]);return s.jsxs(s.Fragment,{children:[s.jsx("div",{role:"presentation",style:Ee,onClick:c,onKeyDown:d=>d.key==="Escape"&&c()}),s.jsx("div",{style:{...Re,left:Math.min(i.x,typeof window<"u"?window.innerWidth-420:i.x),top:i.y+12},onClick:d=>d.stopPropagation(),children:s.jsxs("form",{onSubmit:F,children:[s.jsx("textarea",{placeholder:"Escribe tu comentario...",value:b,onChange:d=>f(d.target.value),style:Se,required:!0,autoFocus:!0}),s.jsxs("select",{value:_,onChange:d=>y(Number(d.target.value)),style:Ce,required:!0,disabled:t.length===0,children:[s.jsx("option",{value:"",children:t.length===0?"No hay revisores (ejecuta php artisan db:seed en la API)":"Selecciona revisor"}),t.map(d=>s.jsx("option",{value:d.id,children:d.name},d.id))]}),C&&s.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:C}),s.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:s.jsx("button",{type:"submit",style:ke,disabled:m||t.length===0,children:m?"Enviando...":"Enviar comentario"})})]})})]})}const je=a.memo(Pe),Ve="var(--ui-color-red-500, #ef4444)";function Te(e){return{position:"fixed",outline:`2px solid ${e}`,outlineOffset:"var(--ui-positive-Value_200, 2px)",pointerEvents:"none",zIndex:999997,boxSizing:"border-box"}}const De=a.memo(function({selector:o,active:t,fallbackComment:i,outlineColor:l=Ve}){const[c,p]=a.useState(null),b=a.useCallback(()=>{if(!t){p(null);return}const f=o!=null&&o.trim()?Mr(o):null;if(f){p(f);return}if(i){p(he(i));return}p(null)},[o,t,i]);return a.useEffect(()=>{b()},[b]),a.useEffect(()=>{if(t)return window.addEventListener("scroll",b,!0),window.addEventListener("resize",b),()=>{window.removeEventListener("scroll",b,!0),window.removeEventListener("resize",b)}},[t,b]),!t||c==null?null:s.jsx("div",{"aria-hidden":!0,style:{...Te(l),left:c.left,top:c.top,width:c.width,height:c.height}})}),dr=32,Wr=15e5,Cr=250,M={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))"},Ie={[k.PENDING]:"Pendiente",[k.DEV_FIXED]:"Corregido",[k.VALIDATED]:"Validado"},Oe={[k.PENDING]:"PENDIENTE",[k.DEV_FIXED]:"CORREGIDO",[k.VALIDATED]:"VALIDADO"},K={[k.PENDING]:"var(--ui-color-red-500, rgb(240, 69, 69))",[k.DEV_FIXED]:"var(--ui-color-yellow-500, rgb(235, 179, 8))",[k.VALIDATED]:"var(--ui-color-green-500, rgb(33, 196, 94))"},Br={[k.PENDING]:"var(--ui-color-bg-surface-danger-default, #fef2f2)",[k.DEV_FIXED]:"var(--ui-color-bg-surface-warning-default, #fffbeb)",[k.VALIDATED]:"var(--ui-color-bg-surface-success-default, #f0fdf4)"},fr={[k.PENDING]:"var(--ui-color-red-500, #ef4444)",[k.DEV_FIXED]:"var(--ui-color-orange-500, #f59e0b)",[k.VALIDATED]:"var(--ui-color-green-500, #22c55e)"};function Le(e){const o=e.trim().split(/\s+/);return o.length>=2?(o[0][0]+o[o.length-1][0]).toUpperCase():e.slice(0,2).toUpperCase()||"?"}const ze=()=>s.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",style:{marginRight:4,flexShrink:0},children:s.jsx("path",{d:"M10 3L4.5 8.5L2 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),Ae=({color:e})=>s.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",style:{flexShrink:0},children:[s.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:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),s.jsx("path",{d:"M8 10h.01M12 10h.01M16 10h.01",stroke:"var(--ui-color-white, #fff)",strokeWidth:"1.5",strokeLinecap:"round"})]}),Fe=e=>({position:"fixed",width:dr,height:dr,borderRadius:"50%",backgroundColor:K[e]??K[k.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)"}),Ne={position:"fixed",width:Cr,minWidth:Cr,maxWidth:Cr,boxSizing:"border-box",backgroundColor:M.cardBg,borderRadius:"var(--ui-radius_12, 12px)",boxShadow:M.shadow,fontSize:"var(--ui-font-size-sm, 14px)",fontFamily:"var(--ui-font-family-ui, 'Inter', sans-serif)",zIndex:999999,pointerEvents:"auto"},Me={display:"flex",alignItems:"center",justifyContent:"space-between",gap:"var(--ui-positive-Value_250, 10px)",borderBottom:`1px solid ${M.border}`,padding:"var(--ui-positive-Value_300, 12px)"},We=e=>({width:40,height:40,borderRadius:"50%",backgroundColor:K[e]??K[k.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"}),Be=a.memo(function({reviewer:o,status:t}){const i=o==null?void 0:o.image_url,l=(o==null?void 0:o.name)??"Revisor",c=We(t);if(i&&i.trim()){const p=K[t]??K[k.PENDING];return s.jsx("div",{style:{...c,border:`2px solid ${p}`},children:s.jsx("img",{src:i,alt:l,style:{width:"100%",height:"100%",objectFit:"cover"},loading:"lazy"})})}return s.jsx("div",{style:c,children:Le(l)})}),Ye={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:M.textDark,cursor:"pointer",fontSize:"var(--ui-positive-Value_450, 18px)",lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center"},Ue=e=>{const o=fr[e]??fr[k.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:Br[e]??Br[k.PENDING],color:o,border:`1px solid ${o}`}},Ge={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:M.textMuted,textTransform:"uppercase",letterSpacing:"0.04em"},He={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 ${M.border}`,backgroundColor:M.cardBg,color:M.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"},Xe={display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"var(--ui-positive-Value_200, 8px)",padding:"var(--ui-positive-Value_300, 12px)",borderTop:`1px solid ${M.border}`,backgroundColor:M.cardFooterBg},Yr={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"},Je={...Yr,backgroundColor:"transparent",color:M.textDark},vr="review-layer-resolve-btn",Ze=["pending","dev_fixed","validated"],Qe={...Yr,backgroundColor:"var(--ui-color-bg-fill-success-default, #22c55e)",color:"var(--ui-color-text-on-color, #fff)"};function Ke({comment:e,offset:o={dx:0,dy:0},apiUrl:t,apiKey:i,onStatusChange:l,reviewMode:c=!1}){var ar,lr;const[p,b]=a.useState(!1),[f,_]=a.useState(!1),[y,m]=a.useState(()=>cr(e)),[j,C]=a.useState(!1),[V,F]=a.useState(null),L=a.useRef(null),d=a.useRef(null),g=a.useRef(null),I=a.useCallback(()=>{m(cr(e))},[e]);a.useEffect(()=>{I()},[I]),a.useEffect(()=>{if(!(typeof window>"u"))return window.addEventListener("scroll",I,!0),window.addEventListener("resize",I),()=>{window.removeEventListener("scroll",I,!0),window.removeEventListener("resize",I)}},[I]);const A=a.useCallback(()=>{L.current!==null&&(clearTimeout(L.current),L.current=null)},[]),H=a.useCallback(()=>{c||(A(),b(!0))},[c,A]),or=a.useCallback(()=>{f||(L.current=setTimeout(()=>{L.current=null,b(!1)},Wr))},[f]),nr=a.useCallback(()=>{A(),b(!0)},[A]),ir=a.useCallback(()=>{f||(L.current=setTimeout(()=>{L.current=null,b(!1)},Wr))},[f]),X=a.useCallback(()=>{if(c){f&&(_(!1),b(!1));return}f?(_(!1),b(!1)):(_(!0),b(!0))},[c,f]);a.useEffect(()=>{if(!f)return;const E=Z=>{var hr,xr;const ur=Z.target;(hr=d.current)!=null&&hr.contains(ur)||(xr=g.current)!=null&&xr.contains(ur)||(_(!1),b(!1))};return document.addEventListener("mousedown",E,!0),()=>document.removeEventListener("mousedown",E,!0)},[f]),a.useEffect(()=>()=>A(),[A]),a.useEffect(()=>{c&&(_(!1),b(!1))},[c]);const w=y.x+o.dx,P=y.y+o.dy,{x:z,y:T}=Rr(w,P,dr/2),U=p&&!f,B=a.useCallback(()=>{_(!1),b(!1)},[]),J=a.useCallback(async E=>{if(E!==e.status){F(null),C(!0);try{await we(t,i,e.id,E),l()}catch(Z){F(Z instanceof Error?Z.message:"Error al actualizar")}finally{C(!1)}}},[t,i,e.id,e.status,l]),gr=a.useCallback(async()=>{F(null),C(!0);try{await _e(t,i,e.id),l(),B()}catch(E){F(E instanceof Error?E.message:"Error al eliminar")}finally{C(!1)}},[t,i,e.id,l,B]),br=a.useMemo(()=>({...Fe(e.status),left:z,top:T,transform:"translate(-50%, -50%)"}),[e.status,z,T]);return s.jsxs(s.Fragment,{children:[s.jsx(De,{selector:e.selector,active:U,fallbackComment:e,outlineColor:fr[e.status]??fr[k.PENDING]}),s.jsx("div",{ref:d,role:"button",tabIndex:0,"aria-label":`Comentario: ${e.message.slice(0,30)}...`,"aria-expanded":p,style:br,onMouseEnter:H,onMouseLeave:or,onClick:X,children:s.jsx(Ae,{color:"var(--ui-color-white, #fff)"})}),p&&s.jsxs("div",{ref:g,role:"dialog","aria-label":"Detalle del comentario",style:{...Ne,left:z+dr/2+6,top:T},onMouseEnter:nr,onMouseLeave:ir,children:[s.jsxs("div",{style:Me,children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,flex:1,minWidth:0},children:[s.jsx(Be,{reviewer:e.reviewer,status:e.status}),s.jsxs("div",{children:[s.jsx("div",{style:{fontWeight:700,fontSize:14,color:M.textDark},children:((ar=e.reviewer)==null?void 0:ar.name)??"Revisor"}),s.jsx("div",{style:{fontSize:12,color:M.textMuted},children:((lr=e.reviewer)==null?void 0:lr.job_title)??"Revisor"})]})]}),s.jsx("button",{type:"button","aria-label":e.status===k.VALIDATED?"Eliminar comentario":"Cerrar",style:Ye,disabled:j,onClick:E=>{E.stopPropagation(),e.status===k.VALIDATED?gr():B()},onMouseDown:E=>E.stopPropagation(),children:"✕"})]}),s.jsxs("div",{style:{padding:12,display:"flex",alignItems:"flex-start",flexDirection:"column",gap:4},children:[s.jsxs("div",{style:Ue(e.status),children:[e.status===k.VALIDATED&&s.jsx(ze,{}),Oe[e.status]??e.status]}),s.jsx("div",{style:{color:M.textDark,lineHeight:1.5,marginBottom:12,marginTop:12},children:e.message}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,width:"100%"},children:[s.jsx("label",{style:Ge,htmlFor:`comment-status-${e.id}`,children:"Cambiar estado"}),s.jsx("select",{id:`comment-status-${e.id}`,style:He,value:e.status,disabled:j,onChange:E=>J(E.target.value),onMouseDown:E=>E.stopPropagation(),"aria-label":"Cambiar estado del comentario",children:Ze.map(E=>s.jsx("option",{value:E,children:Ie[E]},E))}),V&&s.jsx("div",{style:{marginTop:8,fontSize:11,color:"var(--ui-color-text-danger-default, rgb(240, 69, 69))"},children:V})]})]}),s.jsxs("div",{style:Xe,children:[s.jsx("button",{type:"button",style:Je,onMouseDown:E=>E.stopPropagation(),onClick:E=>{E.stopPropagation(),B()},children:"Cerrar"}),e.status!==k.VALIDATED&&s.jsxs(s.Fragment,{children:[s.jsx("style",{children:`
|
|
31
|
-
.${
|
|
30
|
+
<%s key={someKey} {...props} />`,ze,Q,zt,Q),cr[Q+ze]=!0}}return e===i?Tt(O):Vt(O),O}}function Dt(e,n,u){return dr(e,n,u,!0)}function It(e,n,u){return dr(e,n,u,!1)}var Ot=It,Lt=Dt;re.Fragment=i,re.jsx=Ot,re.jsxs=Lt}()),re}process.env.NODE_ENV==="production"?Ee.exports=fr():Ee.exports=vr();var s=Ee.exports;function pr(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 i=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 l=t.className.trim().split(/\s+/).filter(Boolean);if(l.length>0){const c=l.filter(g=>/^[a-zA-Z][\w-]*$/.test(g)).slice(0,2).map(g=>`.${g}`).join("");c&&(i+=c)}}if(o.length>0){const l=t.parentElement;if(l){const c=Array.from(l.children).filter(g=>g.nodeName===t.nodeName);if(c.length>1){const g=c.indexOf(t)+1;i+=`:nth-child(${g})`}}}o.unshift(i),t=t.parentElement}return o.join(" > ")}const gr="[data-review-layer-root]",br=16;function Re(r,o,t=br){if(typeof window>"u")return{x:r,y:o};const i=t,l=t,c=window.innerWidth-t,g=window.innerHeight-t;return{x:Math.max(i,Math.min(c,r)),y:Math.max(l,Math.min(g,o))}}function Me(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,gr)?null:t.getBoundingClientRect()}catch{return null}}function hr(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 Se(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 xr(r){const{x:o,y:t}=Se(r),i=r.width??100,l=r.height??40;return new DOMRect(o,t,i,l)}function ce(r){const o=(r.relativeX??r.relative_x)!=null&&(r.relativeY??r.relative_y)!=null,t=r.x!=null&&r.y!=null;if(o||t)return Se(r);if(r.selector){const i=Me(r.selector);if(i!=null)return{x:i.left,y:i.top}}return Se(r)}const C={PENDING:"pending",DEV_FIXED:"dev_fixed",VALIDATED:"validated"};function te(r){return{"Content-Type":"application/json","x-review-key":r}}async function yr(r,o,t){const i=await fetch(`${r}/reviewers`,{headers:te(o),signal:t==null?void 0:t.signal});if(!i.ok)throw new Error("Failed to fetch reviewers");return(await i.json()).data??[]}async function mr(r,o,t){const i=await fetch(`${r}/comments`,{method:"POST",headers:te(o),body:JSON.stringify(t)});if(!i.ok){const c=await i.json().catch(()=>({}));throw new Error(c.message||"Failed to create comment")}return(await i.json()).data}async function wr(r,o,t,i){const l=new URLSearchParams({url:t}),c=await fetch(`${r}/comments?${l}`,{headers:te(o),signal:i==null?void 0:i.signal});if(!c.ok)throw new Error("Failed to fetch comments");return(await c.json()).data??[]}async function _r(r,o,t,i){const l=await fetch(`${r}/comments/${t}/status`,{method:"PATCH",headers:te(o),body:JSON.stringify({status:i})});if(!l.ok){const g=await l.json().catch(()=>({}));throw new Error(g.message||"Failed to update comment status")}return(await l.json()).data}async function Er(r,o,t){const i=await fetch(`${r}/comments/${t}`,{method:"DELETE",headers:te(o)});if(!i.ok){const l=await i.json().catch(()=>({}));throw new Error(l.message||"Failed to delete comment")}}const Rr={position:"fixed",inset:0,zIndex:999997,backgroundColor:"transparent"},Sr={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},kr={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"},Cr={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)"},We={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 Pr({apiUrl:r,apiKey:o,reviewers:t,position:i,payload:l,onClose:c,onSuccess:g}){var L;const[b,f]=a.useState(""),[_,y]=a.useState(((L=t[0])==null?void 0:L.id)??0),[m,j]=a.useState(!1),[k,V]=a.useState(null);a.useEffect(()=>{t.length>0&&!_&&y(t[0].id)},[t,_]);const F=a.useCallback(async d=>{if(d.preventDefault(),!(!b.trim()||!_)){j(!0),V(null);try{await mr(r,o,{...l,message:b.trim(),reviewerId:_}),g(),c()}catch(v){V(v instanceof Error?v.message:"Failed to send comment")}finally{j(!1)}}},[r,o,l,b,_,g,c]);return a.useEffect(()=>{const d=v=>{v.key==="Escape"&&(v.preventDefault(),c())};return document.addEventListener("keydown",d,!0),()=>document.removeEventListener("keydown",d,!0)},[c]),s.jsxs(s.Fragment,{children:[s.jsx("div",{role:"presentation",style:Rr,onClick:c}),s.jsx("div",{style:{...Sr,left:Math.min(i.x,typeof window<"u"?window.innerWidth-420:i.x),top:i.y+12},onClick:d=>d.stopPropagation(),children:s.jsxs("form",{onSubmit:F,children:[s.jsx("textarea",{placeholder:"Escribe tu comentario...",value:b,onChange:d=>f(d.target.value),style:kr,required:!0,autoFocus:!0}),s.jsxs("select",{value:_,onChange:d=>y(Number(d.target.value)),style:Cr,required:!0,disabled:t.length===0,children:[s.jsx("option",{value:"",children:t.length===0?"No hay revisores (ejecuta php artisan db:seed en la API)":"Selecciona revisor"}),t.map(d=>s.jsx("option",{value:d.id,children:d.name},d.id))]}),k&&s.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:k}),s.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"var(--ui-positive-Value_200, 8px)"},children:[s.jsx("button",{type:"button",onClick:c,style:{...We,backgroundColor:"var(--ui-color-bg-fill-secondary-default, #f0f0f0)",color:"var(--ui-color-text-primary, #333)"},children:"Cancelar"}),s.jsx("button",{type:"submit",style:We,disabled:m||t.length===0,children:m?"Enviando...":"Enviar comentario"})]})]})})]})}const jr=a.memo(Pr),Vr="var(--ui-color-red-500, #ef4444)";function Tr(r){return{position:"fixed",outline:`2px solid ${r}`,outlineOffset:"var(--ui-positive-Value_200, 2px)",pointerEvents:"none",zIndex:999997,boxSizing:"border-box"}}const Dr=a.memo(function({selector:o,active:t,fallbackComment:i,outlineColor:l=Vr}){const[c,g]=a.useState(null),b=a.useCallback(()=>{if(!t){g(null);return}const f=o!=null&&o.trim()?Me(o):null;if(f){g(f);return}if(i){g(xr(i));return}g(null)},[o,t,i]);return a.useEffect(()=>{b()},[b]),a.useEffect(()=>{if(t)return window.addEventListener("scroll",b,!0),window.addEventListener("resize",b),()=>{window.removeEventListener("scroll",b,!0),window.removeEventListener("resize",b)}},[t,b]),!t||c==null?null:s.jsx("div",{"aria-hidden":!0,style:{...Tr(l),left:c.left,top:c.top,width:c.width,height:c.height}})}),de=32,Be=150,ke=250,M={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))"},Ir={[C.PENDING]:"Pendiente",[C.DEV_FIXED]:"Corregido",[C.VALIDATED]:"Validado"},Or={[C.PENDING]:"PENDIENTE",[C.DEV_FIXED]:"CORREGIDO",[C.VALIDATED]:"VALIDADO"},K={[C.PENDING]:"var(--ui-color-red-500, rgb(240, 69, 69))",[C.DEV_FIXED]:"var(--ui-color-yellow-500, rgb(235, 179, 8))",[C.VALIDATED]:"var(--ui-color-green-500, rgb(33, 196, 94))"},Ye={[C.PENDING]:"var(--ui-color-bg-surface-danger-default, #fef2f2)",[C.DEV_FIXED]:"var(--ui-color-bg-surface-warning-default, #fffbeb)",[C.VALIDATED]:"var(--ui-color-bg-surface-success-default, #f0fdf4)"},fe={[C.PENDING]:"var(--ui-color-red-500, #ef4444)",[C.DEV_FIXED]:"var(--ui-color-orange-500, #f59e0b)",[C.VALIDATED]:"var(--ui-color-green-500, #22c55e)"};function Lr(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 zr=()=>s.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",style:{marginRight:4,flexShrink:0},children:s.jsx("path",{d:"M10 3L4.5 8.5L2 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),Ar=({color:r})=>s.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",style:{flexShrink:0},children:[s.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"}),s.jsx("path",{d:"M8 10h.01M12 10h.01M16 10h.01",stroke:"var(--ui-color-white, #fff)",strokeWidth:"1.5",strokeLinecap:"round"})]}),Fr=r=>({position:"fixed",width:de,height:de,borderRadius:"50%",backgroundColor:K[r]??K[C.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)"}),Nr={position:"fixed",width:ke,minWidth:ke,maxWidth:ke,boxSizing:"border-box",backgroundColor:M.cardBg,borderRadius:"var(--ui-radius_12, 12px)",boxShadow:M.shadow,fontSize:"var(--ui-font-size-sm, 14px)",fontFamily:"var(--ui-font-family-ui, 'Inter', sans-serif)",zIndex:999999,pointerEvents:"auto"},Mr={display:"flex",alignItems:"center",justifyContent:"space-between",gap:"var(--ui-positive-Value_250, 10px)",borderBottom:`1px solid ${M.border}`,padding:"var(--ui-positive-Value_300, 12px)"},Wr=r=>({width:40,height:40,borderRadius:"50%",backgroundColor:K[r]??K[C.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"}),Br=a.memo(function({reviewer:o,status:t}){const i=o==null?void 0:o.image_url,l=(o==null?void 0:o.name)??"Revisor",c=Wr(t);if(i&&i.trim()){const g=K[t]??K[C.PENDING];return s.jsx("div",{style:{...c,border:`2px solid ${g}`},children:s.jsx("img",{src:i,alt:l,style:{width:"100%",height:"100%",objectFit:"cover"},loading:"lazy"})})}return s.jsx("div",{style:c,children:Lr(l)})}),Yr={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:M.textDark,cursor:"pointer",fontSize:"var(--ui-positive-Value_450, 18px)",lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center"},Ur=r=>{const o=fe[r]??fe[C.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:Ye[r]??Ye[C.PENDING],color:o,border:`1px solid ${o}`}},Gr={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:M.textMuted,textTransform:"uppercase",letterSpacing:"0.04em"},Hr={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 ${M.border}`,backgroundColor:M.cardBg,color:M.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"},Xr={display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"var(--ui-positive-Value_200, 8px)",padding:"var(--ui-positive-Value_300, 12px)",borderTop:`1px solid ${M.border}`,backgroundColor:M.cardFooterBg},Ue={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"},Jr={...Ue,backgroundColor:"transparent",color:M.textDark},ve="review-layer-resolve-btn",Zr=["pending","dev_fixed","validated"],Qr={...Ue,backgroundColor:"var(--ui-color-bg-fill-success-default, #22c55e)",color:"var(--ui-color-text-on-color, #fff)"};function Kr({comment:r,offset:o={dx:0,dy:0},apiUrl:t,apiKey:i,onStatusChange:l,reviewMode:c=!1}){var ae,le;const[g,b]=a.useState(!1),[f,_]=a.useState(!1),[y,m]=a.useState(()=>ce(r)),[j,k]=a.useState(!1),[V,F]=a.useState(null),L=a.useRef(null),d=a.useRef(null),v=a.useRef(null),I=a.useCallback(()=>{m(ce(r))},[r]);a.useEffect(()=>{I()},[I]),a.useEffect(()=>{if(!(typeof window>"u"))return window.addEventListener("scroll",I,!0),window.addEventListener("resize",I),()=>{window.removeEventListener("scroll",I,!0),window.removeEventListener("resize",I)}},[I]);const A=a.useCallback(()=>{L.current!==null&&(clearTimeout(L.current),L.current=null)},[]),H=a.useCallback(()=>{c||(A(),b(!0))},[c,A]),oe=a.useCallback(()=>{f||(L.current=setTimeout(()=>{L.current=null,b(!1)},Be))},[f]),ne=a.useCallback(()=>{A(),b(!0)},[A]),ie=a.useCallback(()=>{f||(L.current=setTimeout(()=>{L.current=null,b(!1)},Be))},[f]),X=a.useCallback(()=>{if(c){f&&(_(!1),b(!1));return}f?(_(!1),b(!1)):(_(!0),b(!0))},[c,f]);a.useEffect(()=>{if(!f)return;const E=Z=>{var he,xe;const ue=Z.target;(he=d.current)!=null&&he.contains(ue)||(xe=v.current)!=null&&xe.contains(ue)||(_(!1),b(!1))};return document.addEventListener("mousedown",E,!0),()=>document.removeEventListener("mousedown",E,!0)},[f]),a.useEffect(()=>()=>A(),[A]),a.useEffect(()=>{c&&(_(!1),b(!1))},[c]);const w=y.x+o.dx,P=y.y+o.dy,{x:z,y:T}=Re(w,P,de/2),U=g&&!f,B=a.useCallback(()=>{_(!1),b(!1)},[]),J=a.useCallback(async E=>{if(E!==r.status){F(null),k(!0);try{await _r(t,i,r.id,E),l()}catch(Z){F(Z instanceof Error?Z.message:"Error al actualizar")}finally{k(!1)}}},[t,i,r.id,r.status,l]),ge=a.useCallback(async()=>{F(null),k(!0);try{await Er(t,i,r.id),l(),B()}catch(E){F(E instanceof Error?E.message:"Error al eliminar")}finally{k(!1)}},[t,i,r.id,l,B]),be=a.useMemo(()=>({...Fr(r.status),left:z,top:T,transform:"translate(-50%, -50%)"}),[r.status,z,T]);return s.jsxs(s.Fragment,{children:[s.jsx(Dr,{selector:r.selector,active:U,fallbackComment:r,outlineColor:fe[r.status]??fe[C.PENDING]}),s.jsx("div",{ref:d,role:"button",tabIndex:0,"aria-label":`Comentario: ${r.message.slice(0,30)}...`,"aria-expanded":g,style:be,onMouseEnter:H,onMouseLeave:oe,onClick:X,children:s.jsx(Ar,{color:"var(--ui-color-white, #fff)"})}),g&&s.jsxs("div",{ref:v,role:"dialog","aria-label":"Detalle del comentario",style:{...Nr,left:z+de/2+6,top:T},onMouseEnter:ne,onMouseLeave:ie,children:[s.jsxs("div",{style:Mr,children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,flex:1,minWidth:0},children:[s.jsx(Br,{reviewer:r.reviewer,status:r.status}),s.jsxs("div",{children:[s.jsx("div",{style:{fontWeight:700,fontSize:14,color:M.textDark},children:((ae=r.reviewer)==null?void 0:ae.name)??"Revisor"}),s.jsx("div",{style:{fontSize:12,color:M.textMuted},children:((le=r.reviewer)==null?void 0:le.job_title)??"Revisor"})]})]}),s.jsx("button",{type:"button","aria-label":r.status===C.VALIDATED?"Eliminar comentario":"Cerrar",style:Yr,disabled:j,onClick:E=>{E.stopPropagation(),r.status===C.VALIDATED?ge():B()},onMouseDown:E=>E.stopPropagation(),children:"✕"})]}),s.jsxs("div",{style:{padding:12,display:"flex",alignItems:"flex-start",flexDirection:"column",gap:4},children:[s.jsxs("div",{style:Ur(r.status),children:[r.status===C.VALIDATED&&s.jsx(zr,{}),Or[r.status]??r.status]}),s.jsx("div",{style:{color:M.textDark,lineHeight:1.5,marginBottom:12,marginTop:12},children:r.message}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,width:"100%"},children:[s.jsx("label",{style:Gr,htmlFor:`comment-status-${r.id}`,children:"Cambiar estado"}),s.jsx("select",{id:`comment-status-${r.id}`,style:Hr,value:r.status,disabled:j,onChange:E=>J(E.target.value),onMouseDown:E=>E.stopPropagation(),"aria-label":"Cambiar estado del comentario",children:Zr.map(E=>s.jsx("option",{value:E,children:Ir[E]},E))}),V&&s.jsx("div",{style:{marginTop:8,fontSize:11,color:"var(--ui-color-text-danger-default, rgb(240, 69, 69))"},children:V})]})]}),s.jsxs("div",{style:Xr,children:[s.jsx("button",{type:"button",style:Jr,onMouseDown:E=>E.stopPropagation(),onClick:E=>{E.stopPropagation(),B()},children:"Cerrar"}),r.status!==C.VALIDATED&&s.jsxs(s.Fragment,{children:[s.jsx("style",{children:`
|
|
31
|
+
.${ve}:hover:not(:disabled) {
|
|
32
32
|
background-color: var(--ui-color-bg-fill-success-hover, #16a34a) !important;
|
|
33
33
|
}
|
|
34
|
-
.${
|
|
34
|
+
.${ve}:active:not(:disabled) {
|
|
35
35
|
background-color: var(--ui-color-bg-fill-success-pressed, #15803d) !important;
|
|
36
36
|
}
|
|
37
|
-
.${
|
|
37
|
+
.${ve}: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
|
-
`}),s.jsx("button",{type:"button",className:
|
|
43
|
-
* Tokens de diseño UI para review-layer-react
|
|
44
|
-
* Las variables se inyectan en :root al montar ReviewProvider
|
|
45
|
-
* Puedes sobrescribirlas en tu app para adaptar el tema
|
|
46
|
-
|
|
47
|
-
:root {
|
|
48
|
-
/* Colores base
|
|
49
|
-
--ui-color-white: rgb(255, 255, 255)
|
|
50
|
-
--ui-color-black: rgb(0, 0, 0)
|
|
51
|
-
--ui-color-red-50: rgb(255, 242, 242)
|
|
52
|
-
--ui-color-red-100: rgb(252, 227, 227)
|
|
53
|
-
--ui-color-red-200: rgb(250, 189, 189)
|
|
54
|
-
--ui-color-red-300: rgb(245, 148, 148)
|
|
55
|
-
--ui-color-red-400: rgb(242, 107, 107)
|
|
56
|
-
--ui-color-red-500: rgb(240, 69, 69)
|
|
57
|
-
--ui-color-red-600: rgb(212, 61, 61)
|
|
58
|
-
--ui-color-red-700: rgb(184, 51, 51)
|
|
59
|
-
--ui-color-red-800: rgb(156, 43, 43)
|
|
60
|
-
--ui-color-red-900: rgb(128, 36, 36)
|
|
61
|
-
--ui-color-orange-50: rgb(255, 247, 242)
|
|
62
|
-
--ui-color-orange-100: rgb(252, 237, 227)
|
|
63
|
-
--ui-color-orange-200: rgb(252, 209, 176)
|
|
64
|
-
--ui-color-orange-300: rgb(250, 176, 125)
|
|
65
|
-
--ui-color-orange-400: rgb(250, 145, 74)
|
|
66
|
-
--ui-color-orange-500: rgb(250, 115, 23)
|
|
67
|
-
--ui-color-orange-600: rgb(219, 102, 20)
|
|
68
|
-
--ui-color-orange-700: rgb(189, 87, 18)
|
|
69
|
-
--ui-color-orange-800: rgb(158, 74, 13)
|
|
70
|
-
--ui-color-orange-900: rgb(128, 59, 10)
|
|
71
|
-
--ui-color-yellow-50: rgb(255, 250, 242)
|
|
72
|
-
--ui-color-yellow-100: rgb(252, 245, 227)
|
|
73
|
-
--ui-color-yellow-200: rgb(247, 230, 173)
|
|
74
|
-
--ui-color-yellow-300: rgb(242, 214, 117)
|
|
75
|
-
--ui-color-yellow-400: rgb(240, 196, 64)
|
|
76
|
-
--ui-color-yellow-500: rgb(235, 179, 8)
|
|
77
|
-
--ui-color-yellow-600: rgb(209, 158, 8)
|
|
78
|
-
--ui-color-yellow-700: rgb(181, 140, 5)
|
|
79
|
-
--ui-color-yellow-800: rgb(156, 120, 5)
|
|
80
|
-
--ui-color-yellow-900: rgb(128, 97, 5)
|
|
81
|
-
--ui-color-lime-50: rgb(250, 255, 242)
|
|
82
|
-
--ui-color-lime-100: rgb(242, 252, 227)
|
|
83
|
-
--ui-color-lime-200: rgb(214, 240, 176)
|
|
84
|
-
--ui-color-lime-300: rgb(186, 227, 125)
|
|
85
|
-
--ui-color-lime-400: rgb(161, 217, 74)
|
|
86
|
-
--ui-color-lime-500: rgb(133, 204, 23)
|
|
87
|
-
--ui-color-lime-600: rgb(120, 186, 20)
|
|
88
|
-
--ui-color-lime-700: rgb(107, 166, 18)
|
|
89
|
-
--ui-color-lime-800: rgb(97, 148, 15)
|
|
90
|
-
--ui-color-lime-900: rgb(84, 128, 13)
|
|
91
|
-
--ui-color-green-50: rgb(242, 255, 245)
|
|
92
|
-
--ui-color-green-100: rgb(227, 252, 237)
|
|
93
|
-
--ui-color-green-200: rgb(179, 240, 201)
|
|
94
|
-
--ui-color-green-300: rgb(130, 224, 166)
|
|
95
|
-
--ui-color-green-400: rgb(84, 212, 130)
|
|
96
|
-
--ui-color-green-500: rgb(33, 196, 94)
|
|
97
|
-
--ui-color-green-600: rgb(31, 181, 87)
|
|
98
|
-
--ui-color-green-700: rgb(28, 163, 79)
|
|
99
|
-
--ui-color-green-800: rgb(26, 145, 69)
|
|
100
|
-
--ui-color-green-900: rgb(23, 128, 61)
|
|
101
|
-
--ui-color-cyan-50: rgb(242, 252, 255)
|
|
102
|
-
--ui-color-cyan-100: rgb(227, 250, 252)
|
|
103
|
-
--ui-color-cyan-200: rgb(171, 232, 242)
|
|
104
|
-
--ui-color-cyan-300: rgb(117, 217, 232)
|
|
105
|
-
--ui-color-cyan-400: rgb(61, 199, 222)
|
|
106
|
-
--ui-color-cyan-500: rgb(5, 181, 212)
|
|
107
|
-
--ui-color-cyan-600: rgb(5, 163, 191)
|
|
108
|
-
--ui-color-cyan-700: rgb(5, 145, 171)
|
|
109
|
-
--ui-color-cyan-800: rgb(5, 128, 148)
|
|
110
|
-
--ui-color-cyan-900: rgb(5, 110, 128)
|
|
111
|
-
--ui-color-azure-50: rgb(242, 250, 255)
|
|
112
|
-
--ui-color-azure-100: rgb(227, 245, 252)
|
|
113
|
-
--ui-color-azure-200: rgb(173, 224, 247)
|
|
114
|
-
--ui-color-azure-300: rgb(120, 204, 242)
|
|
115
|
-
--ui-color-azure-400: rgb(69, 186, 237)
|
|
116
|
-
--ui-color-azure-500: rgb(13, 166, 232)
|
|
117
|
-
--ui-color-azure-600: rgb(13, 148, 207)
|
|
118
|
-
--ui-color-azure-700: rgb(10, 128, 181)
|
|
119
|
-
--ui-color-azure-800: rgb(10, 110, 156)
|
|
120
|
-
--ui-color-azure-900: rgb(8, 89, 128)
|
|
121
|
-
--ui-color-blue-50: rgb(242, 245, 255)
|
|
122
|
-
--ui-color-blue-100: rgb(227, 232, 252)
|
|
123
|
-
--ui-color-blue-200: rgb(184, 196, 237)
|
|
124
|
-
--ui-color-blue-300: rgb(140, 161, 222)
|
|
125
|
-
--ui-color-blue-400: rgb(97, 125, 209)
|
|
126
|
-
--ui-color-blue-500: rgb(54, 89, 194)
|
|
127
|
-
--ui-color-blue-600: rgb(51, 82, 176)
|
|
128
|
-
--ui-color-blue-700: rgb(46, 74, 161)
|
|
129
|
-
--ui-color-blue-800: rgb(41, 66, 145)
|
|
130
|
-
--ui-color-blue-900: rgb(36, 59, 128)
|
|
131
|
-
--ui-color-violet-50: rgb(245, 242, 255)
|
|
132
|
-
--ui-color-violet-100: rgb(237, 227, 252)
|
|
133
|
-
--ui-color-violet-200: rgb(209, 186, 250)
|
|
134
|
-
--ui-color-violet-300: rgb(181, 143, 245)
|
|
135
|
-
--ui-color-violet-400: rgb(153, 102, 242)
|
|
136
|
-
--ui-color-violet-500: rgb(125, 59, 237)
|
|
137
|
-
--ui-color-violet-600: rgb(110, 51, 209)
|
|
138
|
-
--ui-color-violet-700: rgb(97, 46, 184)
|
|
139
|
-
--ui-color-violet-800: rgb(82, 38, 156)
|
|
140
|
-
--ui-color-violet-900: rgb(66, 31, 128)
|
|
141
|
-
--ui-color-magenta-50: rgb(255, 242, 247)
|
|
142
|
-
--ui-color-magenta-100: rgb(252, 227, 240)
|
|
143
|
-
--ui-color-magenta-200: rgb(247, 184, 214)
|
|
144
|
-
--ui-color-magenta-300: rgb(245, 140, 186)
|
|
145
|
-
--ui-color-magenta-400: rgb(240, 94, 161)
|
|
146
|
-
--ui-color-magenta-500: rgb(235, 51, 135)
|
|
147
|
-
--ui-color-magenta-600: rgb(209, 46, 120)
|
|
148
|
-
--ui-color-magenta-700: rgb(181, 41, 105)
|
|
149
|
-
--ui-color-magenta-800: rgb(156, 33, 89)
|
|
150
|
-
--ui-color-magenta-900: rgb(128, 28, 74)
|
|
151
|
-
--ui-color-rose-50: rgb(255, 242, 245)
|
|
152
|
-
--ui-color-rose-100: rgb(252, 227, 232)
|
|
153
|
-
--ui-color-rose-200: rgb(245, 179, 194)
|
|
154
|
-
--ui-color-rose-300: rgb(240, 128, 153)
|
|
155
|
-
--ui-color-rose-400: rgb(232, 79, 112)
|
|
156
|
-
--ui-color-rose-500: rgb(224, 28, 71)
|
|
157
|
-
--ui-color-rose-600: rgb(201, 26, 64)
|
|
158
|
-
--ui-color-rose-700: rgb(176, 23, 56)
|
|
159
|
-
--ui-color-rose-800: rgb(153, 20, 48)
|
|
160
|
-
--ui-color-rose-900: rgb(128, 15, 41)
|
|
161
|
-
--ui-color-light-gray-50: rgb(247, 247, 250)
|
|
162
|
-
--ui-color-light-gray-100: rgb(240, 242, 242)
|
|
163
|
-
--ui-color-light-gray-200: rgb(224, 227, 230)
|
|
164
|
-
--ui-color-light-gray-300: rgb(212, 214, 217)
|
|
165
|
-
--ui-color-light-gray-400: rgb(199, 199, 204)
|
|
166
|
-
--ui-color-light-gray-500: rgb(186, 189, 191)
|
|
167
|
-
--ui-color-light-gray-600: rgb(171, 173, 179)
|
|
168
|
-
--ui-color-light-gray-700: rgb(158, 163, 166)
|
|
169
|
-
--ui-color-light-gray-800: rgb(145, 148, 153)
|
|
170
|
-
--ui-color-light-gray-900: rgb(133, 135, 140)
|
|
171
|
-
--ui-color-dark-gray-50: rgb(120, 122, 128)
|
|
172
|
-
--ui-color-dark-gray-100: rgb(107, 110, 115)
|
|
173
|
-
--ui-color-dark-gray-200: rgb(97, 99, 105)
|
|
174
|
-
--ui-color-dark-gray-300: rgb(89, 89, 94)
|
|
175
|
-
--ui-color-dark-gray-400: rgb(77, 79, 84)
|
|
176
|
-
--ui-color-dark-gray-500: rgb(69, 69, 74)
|
|
177
|
-
--ui-color-dark-gray-600: rgb(59, 61, 64)
|
|
178
|
-
--ui-color-dark-gray-700: rgb(48, 51, 54)
|
|
179
|
-
--ui-color-dark-gray-800: rgb(38, 41, 43)
|
|
180
|
-
--ui-color-dark-gray-900: rgb(31, 31, 33)
|
|
181
|
-
--ui-color-black-alpha-transparent: rgba(0, 0, 0, 0)
|
|
182
|
-
--ui-color-black-alpha-5: rgba(0, 0, 0, 0.05)
|
|
183
|
-
--ui-color-black-alpha-10: rgba(0, 0, 0, 0.1)
|
|
184
|
-
--ui-color-black-alpha-20: rgba(0, 0, 0, 0.2)
|
|
185
|
-
--ui-color-black-alpha-30: rgba(0, 0, 0, 0.3)
|
|
186
|
-
--ui-color-black-alpha-40: rgba(0, 0, 0, 0.4)
|
|
187
|
-
--ui-color-black-alpha-50: rgba(0, 0, 0, 0.5)
|
|
188
|
-
--ui-color-black-alpha-60: rgba(0, 0, 0, 0.6)
|
|
189
|
-
--ui-color-black-alpha-70: rgba(0, 0, 0, 0.7)
|
|
190
|
-
--ui-color-black-alpha-80: rgba(0, 0, 0, 0.8)
|
|
191
|
-
--ui-color-black-alpha-90: rgba(0, 0, 0, 0.9)
|
|
192
|
-
|
|
193
|
-
/* Espaciado positivo
|
|
194
|
-
--ui-positive-Value_0: 0
|
|
195
|
-
--ui-positive-Value_12: 0.66px
|
|
196
|
-
--ui-positive-Value_25: 1px
|
|
197
|
-
--ui-positive-Value_50: 2px
|
|
198
|
-
--ui-positive-Value_100: 4px
|
|
199
|
-
--ui-positive-Value_150: 6px
|
|
200
|
-
--ui-positive-Value_200: 8px
|
|
201
|
-
--ui-positive-Value_250: 10px
|
|
202
|
-
--ui-positive-Value_275: 11px
|
|
203
|
-
--ui-positive-Value_300: 12px
|
|
204
|
-
--ui-positive-Value_325: 13px
|
|
205
|
-
--ui-positive-Value_350: 14px
|
|
206
|
-
--ui-positive-Value_400: 16px
|
|
207
|
-
--ui-positive-Value_450: 18px
|
|
208
|
-
--ui-positive-Value_500: 20px
|
|
209
|
-
--ui-positive-Value_600: 24px
|
|
210
|
-
--ui-positive-Value_700: 28px
|
|
211
|
-
--ui-positive-Value_750: 30px
|
|
212
|
-
--ui-positive-Value_800: 32px
|
|
213
|
-
--ui-positive-Value_900: 36px
|
|
214
|
-
--ui-positive-Value_1000: 40px
|
|
215
|
-
--ui-positive-Value_1200: 48px
|
|
216
|
-
--ui-positive-Value_1400: 56px
|
|
217
|
-
--ui-positive-Value_1600: 64px
|
|
218
|
-
--ui-positive-Value_2000: 80px
|
|
219
|
-
--ui-positive-Value_2400: 96px
|
|
220
|
-
--ui-positive-Value_2800: 112px
|
|
221
|
-
--ui-positive-Value_3200: 128px
|
|
222
|
-
--ui-positive-Value_full: 9999px
|
|
223
|
-
|
|
224
|
-
/* Sombras
|
|
225
|
-
--ui-shadow-01-x: 0
|
|
226
|
-
--ui-shadow-01-y: 1px
|
|
227
|
-
--ui-shadow-01-blur: 2px
|
|
228
|
-
--ui-shadow-01-Spread: 0
|
|
229
|
-
--ui-shadow-02-x: 0
|
|
230
|
-
--ui-shadow-02-y: 2px
|
|
231
|
-
--ui-shadow-02-blur: 4px
|
|
232
|
-
--ui-shadow-02-Spread: -1px
|
|
233
|
-
--ui-shadow-03-x: 0
|
|
234
|
-
--ui-shadow-03-y: 4px
|
|
235
|
-
--ui-shadow-03-blur: 8px
|
|
236
|
-
--ui-shadow-03-Spread: -2px
|
|
237
|
-
--ui-shadow-04-x: 0
|
|
238
|
-
--ui-shadow-04-y: 8px
|
|
239
|
-
--ui-shadow-04-blur: 16px
|
|
240
|
-
--ui-shadow-04-Spread: -4px
|
|
241
|
-
--ui-shadow-05-x: 0
|
|
242
|
-
--ui-shadow-05-y: 16px
|
|
243
|
-
--ui-shadow-05-blur: 24px
|
|
244
|
-
--ui-shadow-05-Spread: -8px
|
|
245
|
-
--ui-shadow-01-Color: var(--ui-color-black-alpha-10)
|
|
246
|
-
--ui-shadow-02-Color: var(--ui-color-black-alpha-20)
|
|
247
|
-
--ui-shadow-03-Color: var(--ui-color-black-alpha-20)
|
|
248
|
-
--ui-shadow-04-Color: var(--ui-color-black-alpha-30)
|
|
249
|
-
--ui-shadow-05-Color: var(--ui-color-black-alpha-30)
|
|
250
|
-
|
|
251
|
-
/* Z-index
|
|
252
|
-
--ui-z-hide: -1
|
|
253
|
-
--ui-z-base: 0
|
|
254
|
-
--ui-z-raised: 100
|
|
255
|
-
--ui-z-sticky: 200
|
|
256
|
-
--ui-z-shell: 300
|
|
257
|
-
--ui-z-dropdown: 400
|
|
258
|
-
--ui-z-popover: 500
|
|
259
|
-
--ui-z-tooltip: 600
|
|
260
|
-
--ui-z-modalBackdrop: 690
|
|
261
|
-
--ui-z-modal: 700
|
|
262
|
-
--ui-z-toast: 800
|
|
263
|
-
--ui-z-overlay: 900
|
|
264
|
-
--ui-z-max: 99999
|
|
265
|
-
|
|
266
|
-
/* Tipografía
|
|
267
|
-
--ui-font-family-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif
|
|
268
|
-
--ui-font-family-mono: "IBM Plex Mono"
|
|
269
|
-
--ui-font-weight-regular: 400
|
|
270
|
-
--ui-font-weight-medium: 500
|
|
271
|
-
--ui-font-weight-semibold: 600
|
|
272
|
-
--ui-font-weight-bold: 700
|
|
273
|
-
|
|
274
|
-
/* Radios
|
|
275
|
-
--ui-radius_0: 0
|
|
276
|
-
--ui-radius_2: 2px
|
|
277
|
-
--ui-radius_4: 4px
|
|
278
|
-
--ui-radius_6: 6px
|
|
279
|
-
--ui-radius_8: 8px
|
|
280
|
-
--ui-radius_10: 10px
|
|
281
|
-
--ui-radius_12: 12px
|
|
282
|
-
--ui-radius_16: 16px
|
|
283
|
-
--ui-radius_24: 24px
|
|
284
|
-
--ui-radius_full: 9999px
|
|
285
|
-
|
|
286
|
-
/* Semánticos: texto
|
|
287
|
-
--ui-color-text-primary: var(--ui-color-dark-gray-700)
|
|
288
|
-
--ui-color-text-secondary: var(--ui-color-dark-gray-300)
|
|
289
|
-
--ui-color-text-tertiary: var(--ui-color-dark-gray-100)
|
|
290
|
-
--ui-color-text-disabled: var(--ui-color-light-gray-500)
|
|
291
|
-
--ui-color-text-on-color: var(--ui-color-white)
|
|
292
|
-
--ui-color-text-danger-default: var(--ui-color-red-700)
|
|
293
|
-
--ui-color-text-danger-hover: var(--ui-color-red-800)
|
|
294
|
-
--ui-color-text-danger-pressed: var(--ui-color-red-900)
|
|
295
|
-
|
|
296
|
-
/* Semánticos: bordes
|
|
297
|
-
--ui-color-border-default: var(--ui-color-light-gray-400)
|
|
298
|
-
--ui-color-border-subtle: var(--ui-color-light-gray-300)
|
|
299
|
-
--ui-color-border-strong: var(--ui-color-dark-gray-400)
|
|
300
|
-
--ui-color-border-danger: var(--ui-color-red-500)
|
|
301
|
-
|
|
302
|
-
/* Semánticos: superficies y fondos
|
|
303
|
-
--ui-color-bg-surface-default: var(--ui-color-white)
|
|
304
|
-
--ui-color-bg-surface-secondary-default: var(--ui-color-light-gray-50)
|
|
305
|
-
--ui-color-bg-surface-secondary-hover: var(--ui-color-light-gray-100)
|
|
306
|
-
--ui-color-bg-fill-danger-default: var(--ui-color-red-500)
|
|
307
|
-
--ui-color-bg-fill-danger-hover: var(--ui-color-red-600)
|
|
308
|
-
--ui-color-bg-fill-danger-pressed: var(--ui-color-red-700)
|
|
309
|
-
--ui-color-bg-fill-success-default: var(--ui-color-green-500)
|
|
310
|
-
--ui-color-bg-fill-success-hover: var(--ui-color-green-600)
|
|
311
|
-
--ui-color-bg-fill-success-pressed: var(--ui-color-green-700)
|
|
312
|
-
--ui-color-bg-surface-success-default: var(--ui-color-green-50)
|
|
313
|
-
--ui-color-bg-surface-success-hover: var(--ui-color-green-100)
|
|
314
|
-
--ui-color-bg-surface-success-selected: var(--ui-color-green-200)
|
|
315
|
-
--ui-color-bg-surface-danger-default: var(--ui-color-red-50)
|
|
316
|
-
--ui-color-bg-surface-danger-hover: var(--ui-color-red-100)
|
|
317
|
-
--ui-color-bg-surface-danger-selected: var(--ui-color-red-200)
|
|
318
|
-
--ui-color-bg-surface-warning-default: var(--ui-color-yellow-50)
|
|
319
|
-
--ui-color-bg-surface-warning-hover: var(--ui-color-yellow-100)
|
|
320
|
-
--ui-color-bg-surface-warning-selected: var(--ui-color-yellow-200)
|
|
321
|
-
|
|
322
|
-
/* Espaciado (space)
|
|
323
|
-
--ui-Positive-space_0: var(--ui-positive-Value_0)
|
|
324
|
-
--ui-Positive-space_2: var(--ui-positive-Value_100)
|
|
325
|
-
--ui-Positive-space_4: var(--ui-positive-Value_100)
|
|
326
|
-
--ui-Positive-space_6: var(--ui-positive-Value_150)
|
|
327
|
-
--ui-Positive-space_8: var(--ui-positive-Value_200)
|
|
328
|
-
--ui-Positive-space_10: var(--ui-positive-Value_250)
|
|
329
|
-
--ui-Positive-space_12: var(--ui-positive-Value_300)
|
|
330
|
-
--ui-Positive-space_16: var(--ui-positive-Value_400)
|
|
331
|
-
--ui-Positive-space_20: var(--ui-positive-Value_500)
|
|
332
|
-
--ui-Positive-space_24: var(--ui-positive-Value_600)
|
|
333
|
-
--ui-Positive-space_28: var(--ui-positive-Value_700)
|
|
334
|
-
--ui-Positive-space_32: var(--ui-positive-Value_800)
|
|
335
|
-
--ui-Positive-space_40: var(--ui-positive-Value_1000)
|
|
336
|
-
--ui-Positive-space_48: var(--ui-positive-Value_1200)
|
|
337
|
-
--ui-Positive-space_56: var(--ui-positive-Value_1400)
|
|
338
|
-
--ui-Positive-space_64: var(--ui-positive-Value_1600)
|
|
339
|
-
--ui-Positive-space_80: var(--ui-positive-Value_2000)
|
|
340
|
-
--ui-Positive-space_96: var(--ui-positive-Value_2400)
|
|
341
|
-
|
|
342
|
-
/* Tamaños de fuente
|
|
343
|
-
--ui-font-size-2xs: var(--ui-positive-Value_250)
|
|
344
|
-
--ui-font-size-xs: var(--ui-positive-Value_300)
|
|
345
|
-
--ui-font-size-sm: var(--ui-positive-Value_350)
|
|
346
|
-
--ui-font-size-md: var(--ui-positive-Value_400)
|
|
347
|
-
--ui-font-size-lg: var(--ui-positive-Value_450)
|
|
348
|
-
--ui-font-size-xl: var(--ui-positive-Value_500)
|
|
349
|
-
--ui-font-size-2xl: var(--ui-positive-Value_600)
|
|
350
|
-
--ui-font-size-3xl: var(--ui-positive-Value_750)
|
|
351
|
-
--ui-font-size-4xl: var(--ui-positive-Value_900)
|
|
352
|
-
--ui-font-size-5xl: var(--ui-positive-Value_1200)
|
|
353
|
-
|
|
354
|
-
/* Line height (muestra)
|
|
355
|
-
--ui-font-lh-10-normal: 14.5px
|
|
356
|
-
--ui-font-lh-12-normal: 17.5px
|
|
357
|
-
--ui-font-lh-14-normal: 20.5px
|
|
358
|
-
--ui-font-lh-16-normal: 23px
|
|
359
|
-
--ui-font-lh-18-normal: 26px
|
|
360
|
-
--ui-font-lh-20-snug: 25px
|
|
361
|
-
|
|
362
|
-
/* Sombras compuestas (para uso en box-shadow)
|
|
363
|
-
--ui-shadow-card: 0 4px 16px var(--ui-shadow-01-Color)
|
|
364
|
-
--ui-shadow-popover: 0 var(--ui-shadow-02-y) var(--ui-shadow-02-blur) var(--ui-shadow-02-Color)
|
|
365
|
-
--ui-shadow-modal: 0 var(--ui-shadow-04-y) var(--ui-shadow-04-blur) var(--ui-shadow-04-Color)
|
|
366
|
-
}
|
|
367
|
-
`;function it(
|
|
42
|
+
`}),s.jsx("button",{type:"button",className:ve,style:Qr,disabled:j,onMouseDown:E=>E.stopPropagation(),onClick:E=>{E.stopPropagation(),J("validated")},children:"Validar"})]})]})]})]})}const qr=a.memo(Kr),$r=25,et=36;function rt(r){const o=new Map;for(let t=0;t<r.length;t++){const i=r[t],{x:l,y:c}=ce(i),{x:g,y:b}=Re(l,c);let f=0;for(let _=0;_<t;_++){const{x:y,y:m}=ce(r[_]),{x:j,y:k}=Re(y,m);Math.hypot(g-j,b-k)<$r&&f++}o.set(i.id,{dx:f*et,dy:0})}return o}function tt(){return typeof window>"u"?"":`${window.innerWidth}x${window.innerHeight}`}function ot({apiUrl:r,apiKey:o,reviewMode:t,setReviewMode:i,reviewers:l,comments:c,loadComments:g,commentsLoadFailed:b=!1}){const[f,_]=a.useState(null),y=a.useRef(null),[m,j]=a.useState(null),k=a.useCallback(()=>{f&&(f.style.outline="",f.style.outlineOffset="",_(null))},[f]),V=a.useCallback(()=>{y.current&&(y.current.style.outline="",y.current.style.outlineOffset="",y.current=null)},[]);a.useEffect(()=>{t||(k(),V())},[t,k,V]),a.useEffect(()=>{if(typeof document>"u")return;const w=document.body.style.cursor;return m?document.body.style.cursor="default":t&&(document.body.style.cursor="crosshair"),()=>{document.body.style.cursor=w}},[t,m]);const F=a.useCallback(w=>{var z;if(!w||typeof document>"u"||w===document.body||w===document.documentElement)return!0;const P=(z=w.tagName)==null?void 0:z.toUpperCase();return P==="BODY"||P==="HTML"?!0:w.parentElement!==document.body?!1:w.id==="root"||w.getAttribute("data-review-layer-host")!=null||document.body.children.length===1},[]),L=a.useCallback(w=>{if(!t||m)return;const P=w.target.nodeType===Node.ELEMENT_NODE?w.target:w.target.parentElement;!P||F(P)||(k(),_(P),P.style.outline="2px solid var(--ui-color-bg-fill-danger-default, #ff4d4f)",P.style.outlineOffset="2px")},[t,m,k,F]),d=a.useCallback(w=>{var z;if(m)return;const P=w.relatedTarget;f&&(!P||!f.contains(P))&&!(P&&((z=f.contains)!=null&&z.call(f,P)))&&k()},[f,m,k]),v=a.useCallback(w=>{if(!t||m)return;const P=w.target;if(!P||F(P)||P.closest("[data-review-layer-root]"))return;w.preventDefault(),w.stopPropagation(),k();const z=P;y.current=z,z.style.outline="2px solid var(--ui-color-bg-fill-danger-default, #ff4d4f)",z.style.outlineOffset="2px";const T=z.getBoundingClientRect(),U=pr(P),{relativeX:B,relativeY:J}=hr(T);j({position:{x:T.left+T.width/2,y:T.bottom},payload:{selector:U,x:Math.round(T.left),y:Math.round(T.top),relativeX:B,relativeY:J,width:Math.round(T.width),height:Math.round(T.height),url:typeof window<"u"&&window.location.pathname||"/",viewport:tt(),userAgent:typeof navigator<"u"?navigator.userAgent:"",pageTitle:typeof document<"u"?document.title:""}})},[t,m,k,F]);a.useEffect(()=>{if(t)return document.addEventListener("mouseover",L,!0),document.addEventListener("mouseout",d,!0),document.addEventListener("click",v,!0),()=>{document.removeEventListener("mouseover",L,!0),document.removeEventListener("mouseout",d,!0),document.removeEventListener("click",v,!0)}},[t,L,d,v]);const[I,A]=a.useState(0);a.useEffect(()=>{if(typeof window>"u")return;const w=()=>A(P=>P+1);return window.addEventListener("resize",w),window.addEventListener("scroll",w,!0),()=>{window.removeEventListener("resize",w),window.removeEventListener("scroll",w,!0)}},[]);const H=a.useMemo(()=>rt(c),[c,I]),oe=a.useCallback(()=>{V(),j(null)},[V]),ne={position:"fixed",inset:0,zIndex:999999,pointerEvents:"none",cursor:t?"crosshair":void 0},ie=s.jsxs(s.Fragment,{children:[s.jsx("div",{style:ne,"aria-hidden":!0,"data-review-layer-root":!0}),t&&s.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:[s.jsx("span",{children:"Modo revisión (Shift+R para salir)"}),s.jsx("button",{type:"button",onClick:()=>i(!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:"×"})]}),b&&s.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:[s.jsx("span",{children:"No se pudo conectar. Mostrando últimos datos guardados. Reintentar no garantiza respuesta hasta que el servicio esté activo."}),s.jsx("button",{type:"button",onClick:()=>g(),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"})]}),c.map(w=>s.jsx("div",{"data-review-layer-pin":!0,style:{pointerEvents:"auto"},children:s.jsx(qr,{comment:w,offset:H.get(w.id),apiUrl:r,apiKey:o,onStatusChange:g,reviewMode:t})},w.id)),m&&s.jsx("div",{"data-review-layer-modal":!0,style:{pointerEvents:"auto"},children:s.jsx(jr,{apiUrl:r,apiKey:o,reviewers:l,position:m.position,payload:m.payload,onClose:oe,onSuccess:g})})]}),X=typeof document<"u"?document.body:null;return X?Ae.createPortal(ie,X):null}const nt=`/**
|
|
43
|
+
* Tokens de diseño UI para review-layer-react.
|
|
44
|
+
* Las variables se inyectan en :root al montar ReviewProvider.
|
|
45
|
+
* Puedes sobrescribirlas en tu app para adaptar el tema.
|
|
46
|
+
*/
|
|
47
|
+
:root {
|
|
48
|
+
/* Colores base */
|
|
49
|
+
--ui-color-white: rgb(255, 255, 255);
|
|
50
|
+
--ui-color-black: rgb(0, 0, 0);
|
|
51
|
+
--ui-color-red-50: rgb(255, 242, 242);
|
|
52
|
+
--ui-color-red-100: rgb(252, 227, 227);
|
|
53
|
+
--ui-color-red-200: rgb(250, 189, 189);
|
|
54
|
+
--ui-color-red-300: rgb(245, 148, 148);
|
|
55
|
+
--ui-color-red-400: rgb(242, 107, 107);
|
|
56
|
+
--ui-color-red-500: rgb(240, 69, 69);
|
|
57
|
+
--ui-color-red-600: rgb(212, 61, 61);
|
|
58
|
+
--ui-color-red-700: rgb(184, 51, 51);
|
|
59
|
+
--ui-color-red-800: rgb(156, 43, 43);
|
|
60
|
+
--ui-color-red-900: rgb(128, 36, 36);
|
|
61
|
+
--ui-color-orange-50: rgb(255, 247, 242);
|
|
62
|
+
--ui-color-orange-100: rgb(252, 237, 227);
|
|
63
|
+
--ui-color-orange-200: rgb(252, 209, 176);
|
|
64
|
+
--ui-color-orange-300: rgb(250, 176, 125);
|
|
65
|
+
--ui-color-orange-400: rgb(250, 145, 74);
|
|
66
|
+
--ui-color-orange-500: rgb(250, 115, 23);
|
|
67
|
+
--ui-color-orange-600: rgb(219, 102, 20);
|
|
68
|
+
--ui-color-orange-700: rgb(189, 87, 18);
|
|
69
|
+
--ui-color-orange-800: rgb(158, 74, 13);
|
|
70
|
+
--ui-color-orange-900: rgb(128, 59, 10);
|
|
71
|
+
--ui-color-yellow-50: rgb(255, 250, 242);
|
|
72
|
+
--ui-color-yellow-100: rgb(252, 245, 227);
|
|
73
|
+
--ui-color-yellow-200: rgb(247, 230, 173);
|
|
74
|
+
--ui-color-yellow-300: rgb(242, 214, 117);
|
|
75
|
+
--ui-color-yellow-400: rgb(240, 196, 64);
|
|
76
|
+
--ui-color-yellow-500: rgb(235, 179, 8);
|
|
77
|
+
--ui-color-yellow-600: rgb(209, 158, 8);
|
|
78
|
+
--ui-color-yellow-700: rgb(181, 140, 5);
|
|
79
|
+
--ui-color-yellow-800: rgb(156, 120, 5);
|
|
80
|
+
--ui-color-yellow-900: rgb(128, 97, 5);
|
|
81
|
+
--ui-color-lime-50: rgb(250, 255, 242);
|
|
82
|
+
--ui-color-lime-100: rgb(242, 252, 227);
|
|
83
|
+
--ui-color-lime-200: rgb(214, 240, 176);
|
|
84
|
+
--ui-color-lime-300: rgb(186, 227, 125);
|
|
85
|
+
--ui-color-lime-400: rgb(161, 217, 74);
|
|
86
|
+
--ui-color-lime-500: rgb(133, 204, 23);
|
|
87
|
+
--ui-color-lime-600: rgb(120, 186, 20);
|
|
88
|
+
--ui-color-lime-700: rgb(107, 166, 18);
|
|
89
|
+
--ui-color-lime-800: rgb(97, 148, 15);
|
|
90
|
+
--ui-color-lime-900: rgb(84, 128, 13);
|
|
91
|
+
--ui-color-green-50: rgb(242, 255, 245);
|
|
92
|
+
--ui-color-green-100: rgb(227, 252, 237);
|
|
93
|
+
--ui-color-green-200: rgb(179, 240, 201);
|
|
94
|
+
--ui-color-green-300: rgb(130, 224, 166);
|
|
95
|
+
--ui-color-green-400: rgb(84, 212, 130);
|
|
96
|
+
--ui-color-green-500: rgb(33, 196, 94);
|
|
97
|
+
--ui-color-green-600: rgb(31, 181, 87);
|
|
98
|
+
--ui-color-green-700: rgb(28, 163, 79);
|
|
99
|
+
--ui-color-green-800: rgb(26, 145, 69);
|
|
100
|
+
--ui-color-green-900: rgb(23, 128, 61);
|
|
101
|
+
--ui-color-cyan-50: rgb(242, 252, 255);
|
|
102
|
+
--ui-color-cyan-100: rgb(227, 250, 252);
|
|
103
|
+
--ui-color-cyan-200: rgb(171, 232, 242);
|
|
104
|
+
--ui-color-cyan-300: rgb(117, 217, 232);
|
|
105
|
+
--ui-color-cyan-400: rgb(61, 199, 222);
|
|
106
|
+
--ui-color-cyan-500: rgb(5, 181, 212);
|
|
107
|
+
--ui-color-cyan-600: rgb(5, 163, 191);
|
|
108
|
+
--ui-color-cyan-700: rgb(5, 145, 171);
|
|
109
|
+
--ui-color-cyan-800: rgb(5, 128, 148);
|
|
110
|
+
--ui-color-cyan-900: rgb(5, 110, 128);
|
|
111
|
+
--ui-color-azure-50: rgb(242, 250, 255);
|
|
112
|
+
--ui-color-azure-100: rgb(227, 245, 252);
|
|
113
|
+
--ui-color-azure-200: rgb(173, 224, 247);
|
|
114
|
+
--ui-color-azure-300: rgb(120, 204, 242);
|
|
115
|
+
--ui-color-azure-400: rgb(69, 186, 237);
|
|
116
|
+
--ui-color-azure-500: rgb(13, 166, 232);
|
|
117
|
+
--ui-color-azure-600: rgb(13, 148, 207);
|
|
118
|
+
--ui-color-azure-700: rgb(10, 128, 181);
|
|
119
|
+
--ui-color-azure-800: rgb(10, 110, 156);
|
|
120
|
+
--ui-color-azure-900: rgb(8, 89, 128);
|
|
121
|
+
--ui-color-blue-50: rgb(242, 245, 255);
|
|
122
|
+
--ui-color-blue-100: rgb(227, 232, 252);
|
|
123
|
+
--ui-color-blue-200: rgb(184, 196, 237);
|
|
124
|
+
--ui-color-blue-300: rgb(140, 161, 222);
|
|
125
|
+
--ui-color-blue-400: rgb(97, 125, 209);
|
|
126
|
+
--ui-color-blue-500: rgb(54, 89, 194);
|
|
127
|
+
--ui-color-blue-600: rgb(51, 82, 176);
|
|
128
|
+
--ui-color-blue-700: rgb(46, 74, 161);
|
|
129
|
+
--ui-color-blue-800: rgb(41, 66, 145);
|
|
130
|
+
--ui-color-blue-900: rgb(36, 59, 128);
|
|
131
|
+
--ui-color-violet-50: rgb(245, 242, 255);
|
|
132
|
+
--ui-color-violet-100: rgb(237, 227, 252);
|
|
133
|
+
--ui-color-violet-200: rgb(209, 186, 250);
|
|
134
|
+
--ui-color-violet-300: rgb(181, 143, 245);
|
|
135
|
+
--ui-color-violet-400: rgb(153, 102, 242);
|
|
136
|
+
--ui-color-violet-500: rgb(125, 59, 237);
|
|
137
|
+
--ui-color-violet-600: rgb(110, 51, 209);
|
|
138
|
+
--ui-color-violet-700: rgb(97, 46, 184);
|
|
139
|
+
--ui-color-violet-800: rgb(82, 38, 156);
|
|
140
|
+
--ui-color-violet-900: rgb(66, 31, 128);
|
|
141
|
+
--ui-color-magenta-50: rgb(255, 242, 247);
|
|
142
|
+
--ui-color-magenta-100: rgb(252, 227, 240);
|
|
143
|
+
--ui-color-magenta-200: rgb(247, 184, 214);
|
|
144
|
+
--ui-color-magenta-300: rgb(245, 140, 186);
|
|
145
|
+
--ui-color-magenta-400: rgb(240, 94, 161);
|
|
146
|
+
--ui-color-magenta-500: rgb(235, 51, 135);
|
|
147
|
+
--ui-color-magenta-600: rgb(209, 46, 120);
|
|
148
|
+
--ui-color-magenta-700: rgb(181, 41, 105);
|
|
149
|
+
--ui-color-magenta-800: rgb(156, 33, 89);
|
|
150
|
+
--ui-color-magenta-900: rgb(128, 28, 74);
|
|
151
|
+
--ui-color-rose-50: rgb(255, 242, 245);
|
|
152
|
+
--ui-color-rose-100: rgb(252, 227, 232);
|
|
153
|
+
--ui-color-rose-200: rgb(245, 179, 194);
|
|
154
|
+
--ui-color-rose-300: rgb(240, 128, 153);
|
|
155
|
+
--ui-color-rose-400: rgb(232, 79, 112);
|
|
156
|
+
--ui-color-rose-500: rgb(224, 28, 71);
|
|
157
|
+
--ui-color-rose-600: rgb(201, 26, 64);
|
|
158
|
+
--ui-color-rose-700: rgb(176, 23, 56);
|
|
159
|
+
--ui-color-rose-800: rgb(153, 20, 48);
|
|
160
|
+
--ui-color-rose-900: rgb(128, 15, 41);
|
|
161
|
+
--ui-color-light-gray-50: rgb(247, 247, 250);
|
|
162
|
+
--ui-color-light-gray-100: rgb(240, 242, 242);
|
|
163
|
+
--ui-color-light-gray-200: rgb(224, 227, 230);
|
|
164
|
+
--ui-color-light-gray-300: rgb(212, 214, 217);
|
|
165
|
+
--ui-color-light-gray-400: rgb(199, 199, 204);
|
|
166
|
+
--ui-color-light-gray-500: rgb(186, 189, 191);
|
|
167
|
+
--ui-color-light-gray-600: rgb(171, 173, 179);
|
|
168
|
+
--ui-color-light-gray-700: rgb(158, 163, 166);
|
|
169
|
+
--ui-color-light-gray-800: rgb(145, 148, 153);
|
|
170
|
+
--ui-color-light-gray-900: rgb(133, 135, 140);
|
|
171
|
+
--ui-color-dark-gray-50: rgb(120, 122, 128);
|
|
172
|
+
--ui-color-dark-gray-100: rgb(107, 110, 115);
|
|
173
|
+
--ui-color-dark-gray-200: rgb(97, 99, 105);
|
|
174
|
+
--ui-color-dark-gray-300: rgb(89, 89, 94);
|
|
175
|
+
--ui-color-dark-gray-400: rgb(77, 79, 84);
|
|
176
|
+
--ui-color-dark-gray-500: rgb(69, 69, 74);
|
|
177
|
+
--ui-color-dark-gray-600: rgb(59, 61, 64);
|
|
178
|
+
--ui-color-dark-gray-700: rgb(48, 51, 54);
|
|
179
|
+
--ui-color-dark-gray-800: rgb(38, 41, 43);
|
|
180
|
+
--ui-color-dark-gray-900: rgb(31, 31, 33);
|
|
181
|
+
--ui-color-black-alpha-transparent: rgba(0, 0, 0, 0);
|
|
182
|
+
--ui-color-black-alpha-5: rgba(0, 0, 0, 0.05);
|
|
183
|
+
--ui-color-black-alpha-10: rgba(0, 0, 0, 0.1);
|
|
184
|
+
--ui-color-black-alpha-20: rgba(0, 0, 0, 0.2);
|
|
185
|
+
--ui-color-black-alpha-30: rgba(0, 0, 0, 0.3);
|
|
186
|
+
--ui-color-black-alpha-40: rgba(0, 0, 0, 0.4);
|
|
187
|
+
--ui-color-black-alpha-50: rgba(0, 0, 0, 0.5);
|
|
188
|
+
--ui-color-black-alpha-60: rgba(0, 0, 0, 0.6);
|
|
189
|
+
--ui-color-black-alpha-70: rgba(0, 0, 0, 0.7);
|
|
190
|
+
--ui-color-black-alpha-80: rgba(0, 0, 0, 0.8);
|
|
191
|
+
--ui-color-black-alpha-90: rgba(0, 0, 0, 0.9);
|
|
192
|
+
|
|
193
|
+
/* Espaciado positivo */
|
|
194
|
+
--ui-positive-Value_0: 0;
|
|
195
|
+
--ui-positive-Value_12: 0.66px;
|
|
196
|
+
--ui-positive-Value_25: 1px;
|
|
197
|
+
--ui-positive-Value_50: 2px;
|
|
198
|
+
--ui-positive-Value_100: 4px;
|
|
199
|
+
--ui-positive-Value_150: 6px;
|
|
200
|
+
--ui-positive-Value_200: 8px;
|
|
201
|
+
--ui-positive-Value_250: 10px;
|
|
202
|
+
--ui-positive-Value_275: 11px;
|
|
203
|
+
--ui-positive-Value_300: 12px;
|
|
204
|
+
--ui-positive-Value_325: 13px;
|
|
205
|
+
--ui-positive-Value_350: 14px;
|
|
206
|
+
--ui-positive-Value_400: 16px;
|
|
207
|
+
--ui-positive-Value_450: 18px;
|
|
208
|
+
--ui-positive-Value_500: 20px;
|
|
209
|
+
--ui-positive-Value_600: 24px;
|
|
210
|
+
--ui-positive-Value_700: 28px;
|
|
211
|
+
--ui-positive-Value_750: 30px;
|
|
212
|
+
--ui-positive-Value_800: 32px;
|
|
213
|
+
--ui-positive-Value_900: 36px;
|
|
214
|
+
--ui-positive-Value_1000: 40px;
|
|
215
|
+
--ui-positive-Value_1200: 48px;
|
|
216
|
+
--ui-positive-Value_1400: 56px;
|
|
217
|
+
--ui-positive-Value_1600: 64px;
|
|
218
|
+
--ui-positive-Value_2000: 80px;
|
|
219
|
+
--ui-positive-Value_2400: 96px;
|
|
220
|
+
--ui-positive-Value_2800: 112px;
|
|
221
|
+
--ui-positive-Value_3200: 128px;
|
|
222
|
+
--ui-positive-Value_full: 9999px;
|
|
223
|
+
|
|
224
|
+
/* Sombras */
|
|
225
|
+
--ui-shadow-01-x: 0;
|
|
226
|
+
--ui-shadow-01-y: 1px;
|
|
227
|
+
--ui-shadow-01-blur: 2px;
|
|
228
|
+
--ui-shadow-01-Spread: 0;
|
|
229
|
+
--ui-shadow-02-x: 0;
|
|
230
|
+
--ui-shadow-02-y: 2px;
|
|
231
|
+
--ui-shadow-02-blur: 4px;
|
|
232
|
+
--ui-shadow-02-Spread: -1px;
|
|
233
|
+
--ui-shadow-03-x: 0;
|
|
234
|
+
--ui-shadow-03-y: 4px;
|
|
235
|
+
--ui-shadow-03-blur: 8px;
|
|
236
|
+
--ui-shadow-03-Spread: -2px;
|
|
237
|
+
--ui-shadow-04-x: 0;
|
|
238
|
+
--ui-shadow-04-y: 8px;
|
|
239
|
+
--ui-shadow-04-blur: 16px;
|
|
240
|
+
--ui-shadow-04-Spread: -4px;
|
|
241
|
+
--ui-shadow-05-x: 0;
|
|
242
|
+
--ui-shadow-05-y: 16px;
|
|
243
|
+
--ui-shadow-05-blur: 24px;
|
|
244
|
+
--ui-shadow-05-Spread: -8px;
|
|
245
|
+
--ui-shadow-01-Color: var(--ui-color-black-alpha-10);
|
|
246
|
+
--ui-shadow-02-Color: var(--ui-color-black-alpha-20);
|
|
247
|
+
--ui-shadow-03-Color: var(--ui-color-black-alpha-20);
|
|
248
|
+
--ui-shadow-04-Color: var(--ui-color-black-alpha-30);
|
|
249
|
+
--ui-shadow-05-Color: var(--ui-color-black-alpha-30);
|
|
250
|
+
|
|
251
|
+
/* Z-index */
|
|
252
|
+
--ui-z-hide: -1;
|
|
253
|
+
--ui-z-base: 0;
|
|
254
|
+
--ui-z-raised: 100;
|
|
255
|
+
--ui-z-sticky: 200;
|
|
256
|
+
--ui-z-shell: 300;
|
|
257
|
+
--ui-z-dropdown: 400;
|
|
258
|
+
--ui-z-popover: 500;
|
|
259
|
+
--ui-z-tooltip: 600;
|
|
260
|
+
--ui-z-modalBackdrop: 690;
|
|
261
|
+
--ui-z-modal: 700;
|
|
262
|
+
--ui-z-toast: 800;
|
|
263
|
+
--ui-z-overlay: 900;
|
|
264
|
+
--ui-z-max: 99999;
|
|
265
|
+
|
|
266
|
+
/* Tipografía */
|
|
267
|
+
--ui-font-family-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
268
|
+
--ui-font-family-mono: "IBM Plex Mono";
|
|
269
|
+
--ui-font-weight-regular: 400;
|
|
270
|
+
--ui-font-weight-medium: 500;
|
|
271
|
+
--ui-font-weight-semibold: 600;
|
|
272
|
+
--ui-font-weight-bold: 700;
|
|
273
|
+
|
|
274
|
+
/* Radios */
|
|
275
|
+
--ui-radius_0: 0;
|
|
276
|
+
--ui-radius_2: 2px;
|
|
277
|
+
--ui-radius_4: 4px;
|
|
278
|
+
--ui-radius_6: 6px;
|
|
279
|
+
--ui-radius_8: 8px;
|
|
280
|
+
--ui-radius_10: 10px;
|
|
281
|
+
--ui-radius_12: 12px;
|
|
282
|
+
--ui-radius_16: 16px;
|
|
283
|
+
--ui-radius_24: 24px;
|
|
284
|
+
--ui-radius_full: 9999px;
|
|
285
|
+
|
|
286
|
+
/* Semánticos: texto */
|
|
287
|
+
--ui-color-text-primary: var(--ui-color-dark-gray-700);
|
|
288
|
+
--ui-color-text-secondary: var(--ui-color-dark-gray-300);
|
|
289
|
+
--ui-color-text-tertiary: var(--ui-color-dark-gray-100);
|
|
290
|
+
--ui-color-text-disabled: var(--ui-color-light-gray-500);
|
|
291
|
+
--ui-color-text-on-color: var(--ui-color-white);
|
|
292
|
+
--ui-color-text-danger-default: var(--ui-color-red-700);
|
|
293
|
+
--ui-color-text-danger-hover: var(--ui-color-red-800);
|
|
294
|
+
--ui-color-text-danger-pressed: var(--ui-color-red-900);
|
|
295
|
+
|
|
296
|
+
/* Semánticos: bordes */
|
|
297
|
+
--ui-color-border-default: var(--ui-color-light-gray-400);
|
|
298
|
+
--ui-color-border-subtle: var(--ui-color-light-gray-300);
|
|
299
|
+
--ui-color-border-strong: var(--ui-color-dark-gray-400);
|
|
300
|
+
--ui-color-border-danger: var(--ui-color-red-500);
|
|
301
|
+
|
|
302
|
+
/* Semánticos: superficies y fondos */
|
|
303
|
+
--ui-color-bg-surface-default: var(--ui-color-white);
|
|
304
|
+
--ui-color-bg-surface-secondary-default: var(--ui-color-light-gray-50);
|
|
305
|
+
--ui-color-bg-surface-secondary-hover: var(--ui-color-light-gray-100);
|
|
306
|
+
--ui-color-bg-fill-danger-default: var(--ui-color-red-500);
|
|
307
|
+
--ui-color-bg-fill-danger-hover: var(--ui-color-red-600);
|
|
308
|
+
--ui-color-bg-fill-danger-pressed: var(--ui-color-red-700);
|
|
309
|
+
--ui-color-bg-fill-success-default: var(--ui-color-green-500);
|
|
310
|
+
--ui-color-bg-fill-success-hover: var(--ui-color-green-600);
|
|
311
|
+
--ui-color-bg-fill-success-pressed: var(--ui-color-green-700);
|
|
312
|
+
--ui-color-bg-surface-success-default: var(--ui-color-green-50);
|
|
313
|
+
--ui-color-bg-surface-success-hover: var(--ui-color-green-100);
|
|
314
|
+
--ui-color-bg-surface-success-selected: var(--ui-color-green-200);
|
|
315
|
+
--ui-color-bg-surface-danger-default: var(--ui-color-red-50);
|
|
316
|
+
--ui-color-bg-surface-danger-hover: var(--ui-color-red-100);
|
|
317
|
+
--ui-color-bg-surface-danger-selected: var(--ui-color-red-200);
|
|
318
|
+
--ui-color-bg-surface-warning-default: var(--ui-color-yellow-50);
|
|
319
|
+
--ui-color-bg-surface-warning-hover: var(--ui-color-yellow-100);
|
|
320
|
+
--ui-color-bg-surface-warning-selected: var(--ui-color-yellow-200);
|
|
321
|
+
|
|
322
|
+
/* Espaciado (space) */
|
|
323
|
+
--ui-Positive-space_0: var(--ui-positive-Value_0);
|
|
324
|
+
--ui-Positive-space_2: var(--ui-positive-Value_100);
|
|
325
|
+
--ui-Positive-space_4: var(--ui-positive-Value_100);
|
|
326
|
+
--ui-Positive-space_6: var(--ui-positive-Value_150);
|
|
327
|
+
--ui-Positive-space_8: var(--ui-positive-Value_200);
|
|
328
|
+
--ui-Positive-space_10: var(--ui-positive-Value_250);
|
|
329
|
+
--ui-Positive-space_12: var(--ui-positive-Value_300);
|
|
330
|
+
--ui-Positive-space_16: var(--ui-positive-Value_400);
|
|
331
|
+
--ui-Positive-space_20: var(--ui-positive-Value_500);
|
|
332
|
+
--ui-Positive-space_24: var(--ui-positive-Value_600);
|
|
333
|
+
--ui-Positive-space_28: var(--ui-positive-Value_700);
|
|
334
|
+
--ui-Positive-space_32: var(--ui-positive-Value_800);
|
|
335
|
+
--ui-Positive-space_40: var(--ui-positive-Value_1000);
|
|
336
|
+
--ui-Positive-space_48: var(--ui-positive-Value_1200);
|
|
337
|
+
--ui-Positive-space_56: var(--ui-positive-Value_1400);
|
|
338
|
+
--ui-Positive-space_64: var(--ui-positive-Value_1600);
|
|
339
|
+
--ui-Positive-space_80: var(--ui-positive-Value_2000);
|
|
340
|
+
--ui-Positive-space_96: var(--ui-positive-Value_2400);
|
|
341
|
+
|
|
342
|
+
/* Tamaños de fuente */
|
|
343
|
+
--ui-font-size-2xs: var(--ui-positive-Value_250);
|
|
344
|
+
--ui-font-size-xs: var(--ui-positive-Value_300);
|
|
345
|
+
--ui-font-size-sm: var(--ui-positive-Value_350);
|
|
346
|
+
--ui-font-size-md: var(--ui-positive-Value_400);
|
|
347
|
+
--ui-font-size-lg: var(--ui-positive-Value_450);
|
|
348
|
+
--ui-font-size-xl: var(--ui-positive-Value_500);
|
|
349
|
+
--ui-font-size-2xl: var(--ui-positive-Value_600);
|
|
350
|
+
--ui-font-size-3xl: var(--ui-positive-Value_750);
|
|
351
|
+
--ui-font-size-4xl: var(--ui-positive-Value_900);
|
|
352
|
+
--ui-font-size-5xl: var(--ui-positive-Value_1200);
|
|
353
|
+
|
|
354
|
+
/* Line height (muestra) */
|
|
355
|
+
--ui-font-lh-10-normal: 14.5px;
|
|
356
|
+
--ui-font-lh-12-normal: 17.5px;
|
|
357
|
+
--ui-font-lh-14-normal: 20.5px;
|
|
358
|
+
--ui-font-lh-16-normal: 23px;
|
|
359
|
+
--ui-font-lh-18-normal: 26px;
|
|
360
|
+
--ui-font-lh-20-snug: 25px;
|
|
361
|
+
|
|
362
|
+
/* Sombras compuestas (para uso en box-shadow) */
|
|
363
|
+
--ui-shadow-card: 0 4px 16px var(--ui-shadow-01-Color);
|
|
364
|
+
--ui-shadow-popover: 0 var(--ui-shadow-02-y) var(--ui-shadow-02-blur) var(--ui-shadow-02-Color);
|
|
365
|
+
--ui-shadow-modal: 0 var(--ui-shadow-04-y) var(--ui-shadow-04-blur) var(--ui-shadow-04-Color);
|
|
366
|
+
}
|
|
367
|
+
`;function it(r,o,t){const i=a.useCallback(()=>{r&&t(l=>!l)},[r,t]);a.useEffect(()=>{if(!r)return;const l=c=>{(c.key==="r"||c.key==="R"||c.code==="KeyR")&&c.shiftKey&&!c.ctrlKey&&!c.metaKey&&(c.preventDefault(),i())};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[r,i])}const at="review_layer:v1:";function lt(r,o){if(r==null)return o;try{return JSON.parse(r)??o}catch{return o}}function pe(r,o,t,i){const l=`${at}${ut(r)}:${t}`;return i!=null?`${l}:${i}`:l}function ut(r){return r.replace(/\/+$/,"")||"/"}function Ge(r){if(typeof localStorage>"u")return null;const o=localStorage.getItem(r);return lt(o,null)}function He(r,o){if(!(typeof localStorage>"u"))try{localStorage.setItem(r,JSON.stringify({data:o,at:Date.now()}))}catch{}}function Ce(r,o,t){const i=Ge(pe(r,o,"comments",t));return(i==null?void 0:i.data)??null}function st(r,o,t,i){He(pe(r,o,"comments",t),i)}function Xe(r,o){const t=Ge(pe(r,o,"reviewers"));return(t==null?void 0:t.data)??null}function ct(r,o,t){He(pe(r,o,"reviewers"),t)}const Je="https://review-layer-api.onrender.com/api";function Ze(){return typeof window>"u"?"/":window.location.pathname||"/"}const Qe=a.createContext(null);let Pe=null;function dt(){const r=a.useContext(Qe);if(!r)throw new Error("useReview must be used within ReviewProvider");return r}function ft({children:r,enabled:o=!0,apiUrl:t,apiKey:i}){const l=(t==null?void 0:t.trim())||Je,[c,g]=a.useState(!1),[b,f]=a.useState([]),[_,y]=a.useState([]),[m,j]=a.useState(!1);it(o,c,g);const k=a.useCallback(async d=>{if(!(!o||!l||!i))try{const v=await yr(l,i,{signal:d});d!=null&&d.aborted||(f(v),ct(l,i,v))}catch(v){if(v instanceof Error&&v.name==="AbortError")return;if(!(d!=null&&d.aborted)){const I=Xe(l,i);I!=null&&f(I)}}},[o,l,i]),V=a.useCallback(async d=>{if(!o||!l||!i)return;const v=Ze(),I=Ce(l,i,v);I!=null&&y(I);try{j(!1);const A=await wr(l,i,v,{signal:d});d!=null&&d.aborted||(y(A),st(l,i,v,A))}catch(A){if(A instanceof Error&&A.name==="AbortError")return;if(!(d!=null&&d.aborted)){j(!0);const H=Ce(l,i,v);H!=null&&y(H)}}},[o,l,i]);a.useEffect(()=>{if(!o||!l||!i)return;const d=Ze(),v=Xe(l,i),I=Ce(l,i,d);v!=null&&f(v),I!=null&&y(I)},[o,l,i]),a.useEffect(()=>{if(typeof document>"u")return;const d="review-layer-ui-variables";if(!document.getElementById(d)){const v=document.createElement("style");v.id=d,v.textContent=nt,document.head.appendChild(v)}},[]),a.useEffect(()=>{if(!o||!l||!i)return;const d=`${l}:${i}`;if(Pe!==d)return Pe=d,k(),V(),()=>{setTimeout(()=>{Pe=null},0)}},[o,l,i,k,V]),a.useEffect(()=>{if(!o)return;const d=()=>V();return window.addEventListener("popstate",d),()=>window.removeEventListener("popstate",d)},[o,V]);const F=a.useMemo(()=>({apiUrl:l,apiKey:i,reviewMode:c,setReviewMode:g,reviewers:b,comments:_,loadComments:V,commentsLoadFailed:m}),[l,i,c,g,b,_,V,m]),L=o&&typeof document<"u"?Ae.createPortal(s.jsx(ot,{apiUrl:l,apiKey:i,reviewMode:c,setReviewMode:g,reviewers:b,comments:_,loadComments:V,commentsLoadFailed:m}),document.body):null;return s.jsxs(Qe.Provider,{value:F,children:[r,L]})}G.DEFAULT_API_URL=Je,G.ReviewProvider=ft,G.useReview=dt,Object.defineProperty(G,Symbol.toStringTag,{value:"Module"})});
|
|
368
368
|
//# sourceMappingURL=review-layer-react.umd.cjs.map
|