diff --git a/dist/content/content.js b/dist/content/content.js index c06660f..1c1004b 100644 --- a/dist/content/content.js +++ b/dist/content/content.js @@ -1,16 +1,17 @@ -var i=(e=>(e.close="closeMeasureTool",e.open="openMeasureTool",e))(i||{});const a={height:"333px",width:"300px"},h="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAjJJREFUaEPtmd1VAjEQhTN0IFoAPkAdWInyKBShFiE+qpVgHfDgFqBbAvEE3J8smfxMZtA9Z3mE3eR+2eTOnQVUzz/Qc/1KDODqZTffa/16WCAN7+Vq+iixWCIAR/Fq0wjWhRQEO8Cp+ApDBoIVABcvB8EGEBYvA8ECEC+eHyIbIF18AwFaPX2vZm857pQNMF5vP5WCSVvECNSN7UJKgdYLDXC01fqji3I5u/5XAEb81/30Y7ze6bawcjmFy+ftXRfCfP+nAI0oXYwAFka8EeQCMN9j11Mhsuh9k2IAVKHYfQMAtjLDE4jca8Et1Pi8LlJ8m/oE2vPFBEAvgCtVxvo2FcCuK+EAiAJgFTbWt3kADs2EN4o7ATDxVZGK2Z5UAFex80GcAHCI9xWyGPgUCAuAS3wugF2x7ezUPdg1AD1Vxqwp5zW2G9YArlTJOS3vWE2KrQEu1rsNKDXnnUhqNAeA++BICcgbt+2G1iFOOf0hCVQbrcaNNZQTG+WCyAGIFW9gnYUMgzhvFrKfMVZE0SiBQZw3Cx0hfAnAG+ZyeljqFuraeSi+BOM0tYelAqTOFwQIuc3QkVFX6Pe+4Qn0fgthPSx2iKk9tth7IayHdQHk9NhnAmh6WAXqoT2p64Wv+T22xxYDQLNT5421S0CoSMUYFIsLUaI4h3g0zMWQd69JgeASzwpgBouB4BTPDhCC4BYvAoBBSIgXA6gg9gC3oPSk/c8N5Xz57mFxIW5RKeP1HuAHwGT8QByJd+kAAAAASUVORK5CYII=",n="inject-D"+Date.now().toString(),p=` +var i=(t=>(t.close="closeMeasureTool",t.open="openMeasureTool",t))(i||{});const g={height:"333px",width:"300px"},u="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAjJJREFUaEPtmd1VAjEQhTN0IFoAPkAdWInyKBShFiE+qpVgHfDgFqBbAvEE3J8smfxMZtA9Z3mE3eR+2eTOnQVUzz/Qc/1KDODqZTffa/16WCAN7+Vq+iixWCIAR/Fq0wjWhRQEO8Cp+ApDBoIVABcvB8EGEBYvA8ECEC+eHyIbIF18AwFaPX2vZm857pQNMF5vP5WCSVvECNSN7UJKgdYLDXC01fqji3I5u/5XAEb81/30Y7ze6bawcjmFy+ftXRfCfP+nAI0oXYwAFka8EeQCMN9j11Mhsuh9k2IAVKHYfQMAtjLDE4jca8Et1Pi8LlJ8m/oE2vPFBEAvgCtVxvo2FcCuK+EAiAJgFTbWt3kADs2EN4o7ATDxVZGK2Z5UAFex80GcAHCI9xWyGPgUCAuAS3wugF2x7ezUPdg1AD1Vxqwp5zW2G9YArlTJOS3vWE2KrQEu1rsNKDXnnUhqNAeA++BICcgbt+2G1iFOOf0hCVQbrcaNNZQTG+WCyAGIFW9gnYUMgzhvFrKfMVZE0SiBQZw3Cx0hfAnAG+ZyeljqFuraeSi+BOM0tYelAqTOFwQIuc3QkVFX6Pe+4Qn0fgthPSx2iKk9tth7IayHdQHk9NhnAmh6WAXqoT2p64Wv+T22xxYDQLNT5421S0CoSMUYFIsLUaI4h3g0zMWQd69JgeASzwpgBouB4BTPDhCC4BYvAoBBSIgXA6gg9gC3oPSk/c8N5Xz57mFxIW5RKeP1HuAHwGT8QByJd+kAAAAASUVORK5CYII=";class p{constructor(e,a){this.iFrame=null,this.targetOrigin="",this.iFrame=e,this.targetOrigin=a,window.addEventListener("message",this.handle,!1)}send(e){this.targetOrigin?this.iFrame.postMessage(e,this.targetOrigin):this.iFrame.postMessage(e,"*")}handle(e){e.data.source!="react-devtools-content-script"&&console.log(e)}destroy(){window.removeEventListener("message",this.handle,!1)}}const n="inject-D"+Date.now().toString(),f=` .${n}{ outline: 1px solid red; } -`;let c=null,d=!1,s=null,A=null,r=!1;const m=e=>{if(d&&s&&(s.style.top=e.clientY+"px",s.style.left=e.clientX+"px"),r)return;let t=document.elementFromPoint(e.clientX,e.clientY);t&&(t.tagName==="IFRAME"||t.id===n||t.id===n+"-")||t!==c&&(c&&c.classList.remove(n),c=t,t&&t.classList.add(n),A=t)},u=e=>{(window.event?e.keyCode:e.which)===81&&(r=!r,r||(A=null),console.log(A))},E=e=>{i.open?window.addEventListener("mousemove",m):i.close&&window.removeEventListener("mousemove",m)},f=e=>{if(e==i.open){window.document.body.addEventListener("keydown",u);const t=document.querySelector(n)||window.document.createElement("style");t.className=n,t.innerHTML=p,window.document.head.appendChild(t)}else if(e==i.close){window.document.body.removeEventListener("keydown",u);const t=document.querySelector("."+n);t&&t.remove()}},w=e=>{if(e==i.open){const t=document.querySelector("#"+n)||document.createElement("iframe");t.id=n,t.style.cssText=`width: ${a.width}; - height: ${a.height}; +`;let A,l=null,r=!1,d=null,c=!1;const m=t=>{if(r&&d&&(d.style.top=t.clientY+"px",d.style.left=t.clientX+"px"),c)return;let e=document.elementFromPoint(t.clientX,t.clientY);e&&(e.tagName==="IFRAME"||e.id===n||e.id===n+"-")||e!==l&&(l&&l.classList.remove(n),l=e,e&&e.classList.add(n))},h=t=>{(window.event?t.keyCode:t.which)===81&&(c=!c,c&&A.send("hello"))},E=t=>{i.open?window.addEventListener("mousemove",m):i.close&&window.removeEventListener("mousemove",m)},w=t=>{if(t==i.open){window.document.body.addEventListener("keydown",h);const e=document.querySelector(n)||window.document.createElement("style");e.className=n,e.innerHTML=f,window.document.head.appendChild(e)}else if(t==i.close){window.document.body.removeEventListener("keydown",h);const e=document.querySelector("."+n);e&&e.remove()}},C=t=>{if(t==i.open){const e=document.querySelector("#"+n)||document.createElement("iframe");e.id=n,e.style.cssText=`width: ${g.width}; + height: ${g.height}; border: none; - `;const g=chrome.runtime.getURL("contentPage/index.html");t.src=g;let l=document.createElement("div");l.id=n,l.style.cssText=`position: fixed; + `;const a=chrome.runtime.getURL("contentPage/index.html");e.src=a;let s=document.createElement("div");s.id=n,s.style.cssText=`position: fixed; z-index: 1000000; top: 10px; left: 10px; - padding: 10px;`;let o=document.createElement("img");o.src=h,o.id=n+"-",o.style.cssText=`width: 20px; + padding: 10px;`;let o=document.createElement("img");o.src=u,o.id=n+"-",o.style.cssText=`width: 20px; height: 20px; position: absolute; top: 0px; - left: 0px;`,l.appendChild(o),l.appendChild(t),document.body.appendChild(l),s=l,o.onclick=()=>{d=!d,d?o.style.cursor="grabbing":o.style.cursor="grab"}}else e==i.close&&document.querySelector(`#${n}`)&&document.querySelector(`#${n}`).remove()};chrome.runtime.onMessage.addListener(e=>{f(e.info),E(e.info),w(e.info)}); + left: 0px; + cursor: grab;`,s.appendChild(o),s.appendChild(e),document.body.appendChild(s),d=s,o.onclick=()=>{r=!r,r?o.style.cursor="grabbing":o.style.cursor="grab"},A=new p(e.contentWindow),A.send("hello")}else t==i.close&&document.querySelector(`#${n}`)&&document.querySelector(`#${n}`).remove()};chrome.runtime.onMessage.addListener(t=>{w(t.info),E(t.info),C(t.info)}); diff --git a/dist/contentPage/contentPage.js b/dist/contentPage/contentPage.js index 845fa68..4ff8ac0 100644 --- a/dist/contentPage/contentPage.js +++ b/dist/contentPage/contentPage.js @@ -1 +1 @@ -import{j as e,c as r}from"../js/client-Gw-UosAD.js";function n(){return e.jsx(e.Fragment,{children:e.jsx("div",{children:e.jsx("div",{id:"app",children:e.jsx("div",{children:"当前元素信息"})})})})}r.createRoot(document.getElementById("root")).render(e.jsx(n,{})); +import{r as t,j as e,c as r}from"../js/client-B7nMxStY.js";function n(){return t.useEffect(()=>{window.addEventListener("message",s=>{console.log(s),top==null||top.postMessage("ok","*")},!1)}),e.jsx(e.Fragment,{children:e.jsx("div",{children:e.jsx("div",{id:"app",children:e.jsx("div",{children:"当前元素信息"})})})})}r.createRoot(document.getElementById("root")).render(e.jsx(n,{})); diff --git a/dist/contentPage/index.html b/dist/contentPage/index.html index 09b78d6..aa033aa 100644 --- a/dist/contentPage/index.html +++ b/dist/contentPage/index.html @@ -6,10 +6,11 @@ Measuring Tools - +
+ diff --git a/dist/js/client-B7nMxStY.js b/dist/js/client-B7nMxStY.js new file mode 100644 index 0000000..f480695 --- /dev/null +++ b/dist/js/client-B7nMxStY.js @@ -0,0 +1,40 @@ +(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const u of l)if(u.type==="childList")for(const o of u.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function t(l){const u={};return l.integrity&&(u.integrity=l.integrity),l.referrerPolicy&&(u.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?u.credentials="include":l.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function r(l){if(l.ep)return;l.ep=!0;const u=t(l);fetch(l.href,u)}})();var Ai={exports:{}},qr={},Bi={exports:{}},L={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Kt=Symbol.for("react.element"),nc=Symbol.for("react.portal"),tc=Symbol.for("react.fragment"),rc=Symbol.for("react.strict_mode"),lc=Symbol.for("react.profiler"),uc=Symbol.for("react.provider"),oc=Symbol.for("react.context"),ic=Symbol.for("react.forward_ref"),sc=Symbol.for("react.suspense"),ac=Symbol.for("react.memo"),cc=Symbol.for("react.lazy"),Ro=Symbol.iterator;function fc(e){return e===null||typeof e!="object"?null:(e=Ro&&e[Ro]||e["@@iterator"],typeof e=="function"?e:null)}var Hi={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Wi=Object.assign,Qi={};function rt(e,n,t){this.props=e,this.context=n,this.refs=Qi,this.updater=t||Hi}rt.prototype.isReactComponent={};rt.prototype.setState=function(e,n){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,n,"setState")};rt.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ki(){}Ki.prototype=rt.prototype;function Iu(e,n,t){this.props=e,this.context=n,this.refs=Qi,this.updater=t||Hi}var Fu=Iu.prototype=new Ki;Fu.constructor=Iu;Wi(Fu,rt.prototype);Fu.isPureReactComponent=!0;var Oo=Array.isArray,Yi=Object.prototype.hasOwnProperty,ju={current:null},Xi={key:!0,ref:!0,__self:!0,__source:!0};function Gi(e,n,t){var r,l={},u=null,o=null;if(n!=null)for(r in n.ref!==void 0&&(o=n.ref),n.key!==void 0&&(u=""+n.key),n)Yi.call(n,r)&&!Xi.hasOwnProperty(r)&&(l[r]=n[r]);var i=arguments.length-2;if(i===1)l.children=t;else if(1>>1,X=C[H];if(0>>1;Hl(hl,z))hnl(qt,hl)?(C[H]=qt,C[hn]=z,H=hn):(C[H]=hl,C[vn]=z,H=vn);else if(hnl(qt,z))C[H]=qt,C[hn]=z,H=hn;else break e}}return N}function l(C,N){var z=C.sortIndex-N.sortIndex;return z!==0?z:C.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var o=Date,i=o.now();e.unstable_now=function(){return o.now()-i}}var s=[],c=[],v=1,m=null,p=3,g=!1,w=!1,S=!1,F=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,a=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(C){for(var N=t(c);N!==null;){if(N.callback===null)r(c);else if(N.startTime<=C)r(c),N.sortIndex=N.expirationTime,n(s,N);else break;N=t(c)}}function h(C){if(S=!1,d(C),!w)if(t(s)!==null)w=!0,ml(E);else{var N=t(c);N!==null&&vl(h,N.startTime-C)}}function E(C,N){w=!1,S&&(S=!1,f(P),P=-1),g=!0;var z=p;try{for(d(N),m=t(s);m!==null&&(!(m.expirationTime>N)||C&&!xe());){var H=m.callback;if(typeof H=="function"){m.callback=null,p=m.priorityLevel;var X=H(m.expirationTime<=N);N=e.unstable_now(),typeof X=="function"?m.callback=X:m===t(s)&&r(s),d(N)}else r(s);m=t(s)}if(m!==null)var Jt=!0;else{var vn=t(c);vn!==null&&vl(h,vn.startTime-N),Jt=!1}return Jt}finally{m=null,p=z,g=!1}}var _=!1,x=null,P=-1,B=5,T=-1;function xe(){return!(e.unstable_now()-TC||125H?(C.sortIndex=z,n(c,C),t(s)===null&&C===t(c)&&(S?(f(P),P=-1):S=!0,vl(h,z-H))):(C.sortIndex=X,n(s,C),w||g||(w=!0,ml(E))),C},e.unstable_shouldYield=xe,e.unstable_wrapCallback=function(C){var N=p;return function(){var z=p;p=N;try{return C.apply(this,arguments)}finally{p=z}}}})(ns);es.exports=ns;var Ec=es.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Cc=Ji,he=Ec;function y(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,t=1;t"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hl=Object.prototype.hasOwnProperty,_c=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Io={},Fo={};function xc(e){return Hl.call(Fo,e)?!0:Hl.call(Io,e)?!1:_c.test(e)?Fo[e]=!0:(Io[e]=!0,!1)}function Pc(e,n,t,r){if(t!==null&&t.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return r?!1:t!==null?!t.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Nc(e,n,t,r){if(n===null||typeof n>"u"||Pc(e,n,t,r))return!0;if(r)return!1;if(t!==null)switch(t.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function ie(e,n,t,r,l,u,o){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=t,this.propertyName=e,this.type=n,this.sanitizeURL=u,this.removeEmptyString=o}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){b[e]=new ie(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];b[n]=new ie(n,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){b[e]=new ie(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){b[e]=new ie(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){b[e]=new ie(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){b[e]=new ie(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){b[e]=new ie(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){b[e]=new ie(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){b[e]=new ie(e,5,!1,e.toLowerCase(),null,!1,!1)});var $u=/[\-:]([a-z])/g;function Vu(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace($u,Vu);b[n]=new ie(n,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace($u,Vu);b[n]=new ie(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace($u,Vu);b[n]=new ie(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){b[e]=new ie(e,1,!1,e.toLowerCase(),null,!1,!1)});b.xlinkHref=new ie("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){b[e]=new ie(e,1,!1,e.toLowerCase(),null,!0,!0)});function Au(e,n,t,r){var l=b.hasOwnProperty(n)?b[n]:null;(l!==null?l.type!==0:r||!(2i||l[o]!==u[i]){var s=` +`+l[o].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=o&&0<=i);break}}}finally{wl=!1,Error.prepareStackTrace=t}return(e=e?e.displayName||e.name:"")?ht(e):""}function zc(e){switch(e.tag){case 5:return ht(e.type);case 16:return ht("Lazy");case 13:return ht("Suspense");case 19:return ht("SuspenseList");case 0:case 2:case 15:return e=Sl(e.type,!1),e;case 11:return e=Sl(e.type.render,!1),e;case 1:return e=Sl(e.type,!0),e;default:return""}}function Yl(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Mn:return"Fragment";case On:return"Portal";case Wl:return"Profiler";case Bu:return"StrictMode";case Ql:return"Suspense";case Kl:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ls:return(e.displayName||"Context")+".Consumer";case rs:return(e._context.displayName||"Context")+".Provider";case Hu:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Wu:return n=e.displayName||null,n!==null?n:Yl(e.type)||"Memo";case Ge:n=e._payload,e=e._init;try{return Yl(e(n))}catch{}}return null}function Lc(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Yl(n);case 8:return n===Bu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function cn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function os(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Tc(e){var n=os(e)?"checked":"value",t=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),r=""+e[n];if(!e.hasOwnProperty(n)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var l=t.get,u=t.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return l.call(this)},set:function(o){r=""+o,u.call(this,o)}}),Object.defineProperty(e,n,{enumerable:t.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function nr(e){e._valueTracker||(e._valueTracker=Tc(e))}function is(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var t=n.getValue(),r="";return e&&(r=os(e)?e.checked?"true":"false":e.value),e=r,e!==t?(n.setValue(e),!0):!1}function zr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Xl(e,n){var t=n.checked;return V({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??e._wrapperState.initialChecked})}function Uo(e,n){var t=n.defaultValue==null?"":n.defaultValue,r=n.checked!=null?n.checked:n.defaultChecked;t=cn(n.value!=null?n.value:t),e._wrapperState={initialChecked:r,initialValue:t,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function ss(e,n){n=n.checked,n!=null&&Au(e,"checked",n,!1)}function Gl(e,n){ss(e,n);var t=cn(n.value),r=n.type;if(t!=null)r==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+t):e.value!==""+t&&(e.value=""+t);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?Zl(e,n.type,t):n.hasOwnProperty("defaultValue")&&Zl(e,n.type,cn(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function $o(e,n,t){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var r=n.type;if(!(r!=="submit"&&r!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,t||n===e.value||(e.value=n),e.defaultValue=n}t=e.name,t!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,t!==""&&(e.name=t)}function Zl(e,n,t){(n!=="number"||zr(e.ownerDocument)!==e)&&(t==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+t&&(e.defaultValue=""+t))}var yt=Array.isArray;function Wn(e,n,t,r){if(e=e.options,n){n={};for(var l=0;l"+n.valueOf().toString()+"",n=tr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function Tt(e,n){if(n){var t=e.firstChild;if(t&&t===e.lastChild&&t.nodeType===3){t.nodeValue=n;return}}e.textContent=n}var St={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Rc=["Webkit","ms","Moz","O"];Object.keys(St).forEach(function(e){Rc.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),St[n]=St[e]})});function ds(e,n,t){return n==null||typeof n=="boolean"||n===""?"":t||typeof n!="number"||n===0||St.hasOwnProperty(e)&&St[e]?(""+n).trim():n+"px"}function ps(e,n){e=e.style;for(var t in n)if(n.hasOwnProperty(t)){var r=t.indexOf("--")===0,l=ds(t,n[t],r);t==="float"&&(t="cssFloat"),r?e.setProperty(t,l):e[t]=l}}var Oc=V({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function bl(e,n){if(n){if(Oc[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(y(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(y(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(y(61))}if(n.style!=null&&typeof n.style!="object")throw Error(y(62))}}function eu(e,n){if(e.indexOf("-")===-1)return typeof n.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var nu=null;function Qu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var tu=null,Qn=null,Kn=null;function Bo(e){if(e=Gt(e)){if(typeof tu!="function")throw Error(y(280));var n=e.stateNode;n&&(n=rl(n),tu(e.stateNode,e.type,n))}}function ms(e){Qn?Kn?Kn.push(e):Kn=[e]:Qn=e}function vs(){if(Qn){var e=Qn,n=Kn;if(Kn=Qn=null,Bo(e),n)for(e=0;e>>=0,e===0?32:31-(Hc(e)/Wc|0)|0}var rr=64,lr=4194304;function gt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Or(e,n){var t=e.pendingLanes;if(t===0)return 0;var r=0,l=e.suspendedLanes,u=e.pingedLanes,o=t&268435455;if(o!==0){var i=o&~l;i!==0?r=gt(i):(u&=o,u!==0&&(r=gt(u)))}else o=t&~l,o!==0?r=gt(o):u!==0&&(r=gt(u));if(r===0)return 0;if(n!==0&&n!==r&&!(n&l)&&(l=r&-r,u=n&-n,l>=u||l===16&&(u&4194240)!==0))return n;if(r&4&&(r|=t&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=r;0t;t++)n.push(e);return n}function Yt(e,n,t){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-Te(n),e[n]=t}function Xc(e,n){var t=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Et),Jo=" ",qo=!1;function Is(e,n){switch(e){case"keyup":return Cf.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fs(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Dn=!1;function xf(e,n){switch(e){case"compositionend":return Fs(n);case"keypress":return n.which!==32?null:(qo=!0,Jo);case"textInput":return e=n.data,e===Jo&&qo?null:e;default:return null}}function Pf(e,n){if(Dn)return e==="compositionend"||!bu&&Is(e,n)?(e=Ms(),wr=Zu=be=null,Dn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:t,offset:n-e};e=r}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=ti(t)}}function Vs(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Vs(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function As(){for(var e=window,n=zr();n instanceof e.HTMLIFrameElement;){try{var t=typeof n.contentWindow.location.href=="string"}catch{t=!1}if(t)e=n.contentWindow;else break;n=zr(e.document)}return n}function eo(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function If(e){var n=As(),t=e.focusedElem,r=e.selectionRange;if(n!==t&&t&&t.ownerDocument&&Vs(t.ownerDocument.documentElement,t)){if(r!==null&&eo(t)){if(n=r.start,e=r.end,e===void 0&&(e=n),"selectionStart"in t)t.selectionStart=n,t.selectionEnd=Math.min(e,t.value.length);else if(e=(n=t.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var l=t.textContent.length,u=Math.min(r.start,l);r=r.end===void 0?u:Math.min(r.end,l),!e.extend&&u>r&&(l=r,r=u,u=l),l=ri(t,u);var o=ri(t,r);l&&o&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(n=n.createRange(),n.setStart(l.node,l.offset),e.removeAllRanges(),u>r?(e.addRange(n),e.extend(o.node,o.offset)):(n.setEnd(o.node,o.offset),e.addRange(n)))}}for(n=[],e=t;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,In=null,su=null,_t=null,au=!1;function li(e,n,t){var r=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;au||In==null||In!==zr(r)||(r=In,"selectionStart"in r&&eo(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),_t&&Ft(_t,r)||(_t=r,r=Ir(su,"onSelect"),0Un||(e.current=vu[Un],vu[Un]=null,Un--)}function M(e,n){Un++,vu[Un]=e.current,e.current=n}var fn={},re=pn(fn),ce=pn(!1),_n=fn;function Jn(e,n){var t=e.type.contextTypes;if(!t)return fn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===n)return r.__reactInternalMemoizedMaskedChildContext;var l={},u;for(u in t)l[u]=n[u];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=l),l}function fe(e){return e=e.childContextTypes,e!=null}function jr(){I(ce),I(re)}function fi(e,n,t){if(re.current!==fn)throw Error(y(168));M(re,n),M(ce,t)}function Zs(e,n,t){var r=e.stateNode;if(n=n.childContextTypes,typeof r.getChildContext!="function")return t;r=r.getChildContext();for(var l in r)if(!(l in n))throw Error(y(108,Lc(e)||"Unknown",l));return V({},t,r)}function Ur(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||fn,_n=re.current,M(re,e),M(ce,ce.current),!0}function di(e,n,t){var r=e.stateNode;if(!r)throw Error(y(169));t?(e=Zs(e,n,_n),r.__reactInternalMemoizedMergedChildContext=e,I(ce),I(re),M(re,e)):I(ce),M(ce,t)}var $e=null,ll=!1,Dl=!1;function Js(e){$e===null?$e=[e]:$e.push(e)}function Yf(e){ll=!0,Js(e)}function mn(){if(!Dl&&$e!==null){Dl=!0;var e=0,n=O;try{var t=$e;for(O=1;e>=o,l-=o,Ve=1<<32-Te(n)+l|t<P?(B=x,x=null):B=x.sibling;var T=p(f,x,d[P],h);if(T===null){x===null&&(x=B);break}e&&x&&T.alternate===null&&n(f,x),a=u(T,a,P),_===null?E=T:_.sibling=T,_=T,x=B}if(P===d.length)return t(f,x),j&&yn(f,P),E;if(x===null){for(;PP?(B=x,x=null):B=x.sibling;var xe=p(f,x,T.value,h);if(xe===null){x===null&&(x=B);break}e&&x&&xe.alternate===null&&n(f,x),a=u(xe,a,P),_===null?E=xe:_.sibling=xe,_=xe,x=B}if(T.done)return t(f,x),j&&yn(f,P),E;if(x===null){for(;!T.done;P++,T=d.next())T=m(f,T.value,h),T!==null&&(a=u(T,a,P),_===null?E=T:_.sibling=T,_=T);return j&&yn(f,P),E}for(x=r(f,x);!T.done;P++,T=d.next())T=g(x,f,P,T.value,h),T!==null&&(e&&T.alternate!==null&&x.delete(T.key===null?P:T.key),a=u(T,a,P),_===null?E=T:_.sibling=T,_=T);return e&&x.forEach(function(ot){return n(f,ot)}),j&&yn(f,P),E}function F(f,a,d,h){if(typeof d=="object"&&d!==null&&d.type===Mn&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case er:e:{for(var E=d.key,_=a;_!==null;){if(_.key===E){if(E=d.type,E===Mn){if(_.tag===7){t(f,_.sibling),a=l(_,d.props.children),a.return=f,f=a;break e}}else if(_.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ge&&vi(E)===_.type){t(f,_.sibling),a=l(_,d.props),a.ref=pt(f,_,d),a.return=f,f=a;break e}t(f,_);break}else n(f,_);_=_.sibling}d.type===Mn?(a=Cn(d.props.children,f.mode,h,d.key),a.return=f,f=a):(h=Nr(d.type,d.key,d.props,null,f.mode,h),h.ref=pt(f,a,d),h.return=f,f=h)}return o(f);case On:e:{for(_=d.key;a!==null;){if(a.key===_)if(a.tag===4&&a.stateNode.containerInfo===d.containerInfo&&a.stateNode.implementation===d.implementation){t(f,a.sibling),a=l(a,d.children||[]),a.return=f,f=a;break e}else{t(f,a);break}else n(f,a);a=a.sibling}a=Bl(d,f.mode,h),a.return=f,f=a}return o(f);case Ge:return _=d._init,F(f,a,_(d._payload),h)}if(yt(d))return w(f,a,d,h);if(st(d))return S(f,a,d,h);fr(f,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,a!==null&&a.tag===6?(t(f,a.sibling),a=l(a,d),a.return=f,f=a):(t(f,a),a=Al(d,f.mode,h),a.return=f,f=a),o(f)):t(f,a)}return F}var bn=na(!0),ta=na(!1),Ar=pn(null),Br=null,An=null,lo=null;function uo(){lo=An=Br=null}function oo(e){var n=Ar.current;I(Ar),e._currentValue=n}function gu(e,n,t){for(;e!==null;){var r=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,r!==null&&(r.childLanes|=n)):r!==null&&(r.childLanes&n)!==n&&(r.childLanes|=n),e===t)break;e=e.return}}function Xn(e,n){Br=e,lo=An=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&n&&(ae=!0),e.firstContext=null)}function Ce(e){var n=e._currentValue;if(lo!==e)if(e={context:e,memoizedValue:n,next:null},An===null){if(Br===null)throw Error(y(308));An=e,Br.dependencies={lanes:0,firstContext:e}}else An=An.next=e;return n}var Sn=null;function io(e){Sn===null?Sn=[e]:Sn.push(e)}function ra(e,n,t,r){var l=n.interleaved;return l===null?(t.next=t,io(n)):(t.next=l.next,l.next=t),n.interleaved=t,Qe(e,r)}function Qe(e,n){e.lanes|=n;var t=e.alternate;for(t!==null&&(t.lanes|=n),t=e,e=e.return;e!==null;)e.childLanes|=n,t=e.alternate,t!==null&&(t.childLanes|=n),t=e,e=e.return;return t.tag===3?t.stateNode:null}var Ze=!1;function so(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function la(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Be(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function un(e,n,t){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,R&2){var l=r.pending;return l===null?n.next=n:(n.next=l.next,l.next=n),r.pending=n,Qe(e,t)}return l=r.interleaved,l===null?(n.next=n,io(r)):(n.next=l.next,l.next=n),r.interleaved=n,Qe(e,t)}function kr(e,n,t){if(n=n.updateQueue,n!==null&&(n=n.shared,(t&4194240)!==0)){var r=n.lanes;r&=e.pendingLanes,t|=r,n.lanes=t,Yu(e,t)}}function hi(e,n){var t=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,t===r)){var l=null,u=null;if(t=t.firstBaseUpdate,t!==null){do{var o={eventTime:t.eventTime,lane:t.lane,tag:t.tag,payload:t.payload,callback:t.callback,next:null};u===null?l=u=o:u=u.next=o,t=t.next}while(t!==null);u===null?l=u=n:u=u.next=n}else l=u=n;t={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:u,shared:r.shared,effects:r.effects},e.updateQueue=t;return}e=t.lastBaseUpdate,e===null?t.firstBaseUpdate=n:e.next=n,t.lastBaseUpdate=n}function Hr(e,n,t,r){var l=e.updateQueue;Ze=!1;var u=l.firstBaseUpdate,o=l.lastBaseUpdate,i=l.shared.pending;if(i!==null){l.shared.pending=null;var s=i,c=s.next;s.next=null,o===null?u=c:o.next=c,o=s;var v=e.alternate;v!==null&&(v=v.updateQueue,i=v.lastBaseUpdate,i!==o&&(i===null?v.firstBaseUpdate=c:i.next=c,v.lastBaseUpdate=s))}if(u!==null){var m=l.baseState;o=0,v=c=s=null,i=u;do{var p=i.lane,g=i.eventTime;if((r&p)===p){v!==null&&(v=v.next={eventTime:g,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var w=e,S=i;switch(p=n,g=t,S.tag){case 1:if(w=S.payload,typeof w=="function"){m=w.call(g,m,p);break e}m=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=S.payload,p=typeof w=="function"?w.call(g,m,p):w,p==null)break e;m=V({},m,p);break e;case 2:Ze=!0}}i.callback!==null&&i.lane!==0&&(e.flags|=64,p=l.effects,p===null?l.effects=[i]:p.push(i))}else g={eventTime:g,lane:p,tag:i.tag,payload:i.payload,callback:i.callback,next:null},v===null?(c=v=g,s=m):v=v.next=g,o|=p;if(i=i.next,i===null){if(i=l.shared.pending,i===null)break;p=i,i=p.next,p.next=null,l.lastBaseUpdate=p,l.shared.pending=null}}while(!0);if(v===null&&(s=m),l.baseState=s,l.firstBaseUpdate=c,l.lastBaseUpdate=v,n=l.shared.interleaved,n!==null){l=n;do o|=l.lane,l=l.next;while(l!==n)}else u===null&&(l.shared.lanes=0);Nn|=o,e.lanes=o,e.memoizedState=m}}function yi(e,n,t){if(e=n.effects,n.effects=null,e!==null)for(n=0;nt?t:4,e(!0);var r=Fl.transition;Fl.transition={};try{e(!1),n()}finally{O=t,Fl.transition=r}}function ka(){return _e().memoizedState}function Jf(e,n,t){var r=sn(e);if(t={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null},Ea(e))Ca(n,t);else if(t=ra(e,n,t,r),t!==null){var l=ue();Re(t,e,r,l),_a(t,n,r)}}function qf(e,n,t){var r=sn(e),l={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null};if(Ea(e))Ca(n,l);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=n.lastRenderedReducer,u!==null))try{var o=n.lastRenderedState,i=u(o,t);if(l.hasEagerState=!0,l.eagerState=i,Oe(i,o)){var s=n.interleaved;s===null?(l.next=l,io(n)):(l.next=s.next,s.next=l),n.interleaved=l;return}}catch{}finally{}t=ra(e,n,l,r),t!==null&&(l=ue(),Re(t,e,r,l),_a(t,n,r))}}function Ea(e){var n=e.alternate;return e===$||n!==null&&n===$}function Ca(e,n){xt=Qr=!0;var t=e.pending;t===null?n.next=n:(n.next=t.next,t.next=n),e.pending=n}function _a(e,n,t){if(t&4194240){var r=n.lanes;r&=e.pendingLanes,t|=r,n.lanes=t,Yu(e,t)}}var Kr={readContext:Ce,useCallback:ee,useContext:ee,useEffect:ee,useImperativeHandle:ee,useInsertionEffect:ee,useLayoutEffect:ee,useMemo:ee,useReducer:ee,useRef:ee,useState:ee,useDebugValue:ee,useDeferredValue:ee,useTransition:ee,useMutableSource:ee,useSyncExternalStore:ee,useId:ee,unstable_isNewReconciler:!1},bf={readContext:Ce,useCallback:function(e,n){return De().memoizedState=[e,n===void 0?null:n],e},useContext:Ce,useEffect:wi,useImperativeHandle:function(e,n,t){return t=t!=null?t.concat([e]):null,Cr(4194308,4,ha.bind(null,n,e),t)},useLayoutEffect:function(e,n){return Cr(4194308,4,e,n)},useInsertionEffect:function(e,n){return Cr(4,2,e,n)},useMemo:function(e,n){var t=De();return n=n===void 0?null:n,e=e(),t.memoizedState=[e,n],e},useReducer:function(e,n,t){var r=De();return n=t!==void 0?t(n):n,r.memoizedState=r.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},r.queue=e,e=e.dispatch=Jf.bind(null,$,e),[r.memoizedState,e]},useRef:function(e){var n=De();return e={current:e},n.memoizedState=e},useState:gi,useDebugValue:yo,useDeferredValue:function(e){return De().memoizedState=e},useTransition:function(){var e=gi(!1),n=e[0];return e=Zf.bind(null,e[1]),De().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,t){var r=$,l=De();if(j){if(t===void 0)throw Error(y(407));t=t()}else{if(t=n(),Z===null)throw Error(y(349));Pn&30||sa(r,n,t)}l.memoizedState=t;var u={value:t,getSnapshot:n};return l.queue=u,wi(ca.bind(null,r,u,e),[e]),r.flags|=2048,Wt(9,aa.bind(null,r,u,t,n),void 0,null),t},useId:function(){var e=De(),n=Z.identifierPrefix;if(j){var t=Ae,r=Ve;t=(r&~(1<<32-Te(r)-1)).toString(32)+t,n=":"+n+"R"+t,t=Bt++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(t,{is:r.is}):(e=o.createElement(t),t==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,t),e[Ie]=n,e[$t]=r,Da(e,n,!1,!1),n.stateNode=e;e:{switch(o=eu(t,r),t){case"dialog":D("cancel",e),D("close",e),l=r;break;case"iframe":case"object":case"embed":D("load",e),l=r;break;case"video":case"audio":for(l=0;ltt&&(n.flags|=128,r=!0,mt(u,!1),n.lanes=4194304)}else{if(!r)if(e=Wr(o),e!==null){if(n.flags|=128,r=!0,t=e.updateQueue,t!==null&&(n.updateQueue=t,n.flags|=4),mt(u,!0),u.tail===null&&u.tailMode==="hidden"&&!o.alternate&&!j)return ne(n),null}else 2*W()-u.renderingStartTime>tt&&t!==1073741824&&(n.flags|=128,r=!0,mt(u,!1),n.lanes=4194304);u.isBackwards?(o.sibling=n.child,n.child=o):(t=u.last,t!==null?t.sibling=o:n.child=o,u.last=o)}return u.tail!==null?(n=u.tail,u.rendering=n,u.tail=n.sibling,u.renderingStartTime=W(),n.sibling=null,t=U.current,M(U,r?t&1|2:t&1),n):(ne(n),null);case 22:case 23:return Co(),r=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(n.flags|=8192),r&&n.mode&1?pe&1073741824&&(ne(n),n.subtreeFlags&6&&(n.flags|=8192)):ne(n),null;case 24:return null;case 25:return null}throw Error(y(156,n.tag))}function id(e,n){switch(to(n),n.tag){case 1:return fe(n.type)&&jr(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return et(),I(ce),I(re),fo(),e=n.flags,e&65536&&!(e&128)?(n.flags=e&-65537|128,n):null;case 5:return co(n),null;case 13:if(I(U),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(y(340));qn()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return I(U),null;case 4:return et(),null;case 10:return oo(n.type._context),null;case 22:case 23:return Co(),null;case 24:return null;default:return null}}var pr=!1,te=!1,sd=typeof WeakSet=="function"?WeakSet:Set,k=null;function Bn(e,n){var t=e.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(r){A(e,n,r)}else t.current=null}function Nu(e,n,t){try{t()}catch(r){A(e,n,r)}}var Ti=!1;function ad(e,n){if(cu=Mr,e=As(),eo(e)){if("selectionStart"in e)var t={start:e.selectionStart,end:e.selectionEnd};else e:{t=(t=e.ownerDocument)&&t.defaultView||window;var r=t.getSelection&&t.getSelection();if(r&&r.rangeCount!==0){t=r.anchorNode;var l=r.anchorOffset,u=r.focusNode;r=r.focusOffset;try{t.nodeType,u.nodeType}catch{t=null;break e}var o=0,i=-1,s=-1,c=0,v=0,m=e,p=null;n:for(;;){for(var g;m!==t||l!==0&&m.nodeType!==3||(i=o+l),m!==u||r!==0&&m.nodeType!==3||(s=o+r),m.nodeType===3&&(o+=m.nodeValue.length),(g=m.firstChild)!==null;)p=m,m=g;for(;;){if(m===e)break n;if(p===t&&++c===l&&(i=o),p===u&&++v===r&&(s=o),(g=m.nextSibling)!==null)break;m=p,p=m.parentNode}m=g}t=i===-1||s===-1?null:{start:i,end:s}}else t=null}t=t||{start:0,end:0}}else t=null;for(fu={focusedElem:e,selectionRange:t},Mr=!1,k=n;k!==null;)if(n=k,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,k=e;else for(;k!==null;){n=k;try{var w=n.alternate;if(n.flags&1024)switch(n.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var S=w.memoizedProps,F=w.memoizedState,f=n.stateNode,a=f.getSnapshotBeforeUpdate(n.elementType===n.type?S:Ne(n.type,S),F);f.__reactInternalSnapshotBeforeUpdate=a}break;case 3:var d=n.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(y(163))}}catch(h){A(n,n.return,h)}if(e=n.sibling,e!==null){e.return=n.return,k=e;break}k=n.return}return w=Ti,Ti=!1,w}function Pt(e,n,t){var r=n.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var u=l.destroy;l.destroy=void 0,u!==void 0&&Nu(n,t,u)}l=l.next}while(l!==r)}}function il(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var t=n=n.next;do{if((t.tag&e)===e){var r=t.create;t.destroy=r()}t=t.next}while(t!==n)}}function zu(e){var n=e.ref;if(n!==null){var t=e.stateNode;switch(e.tag){case 5:e=t;break;default:e=t}typeof n=="function"?n(e):n.current=e}}function ja(e){var n=e.alternate;n!==null&&(e.alternate=null,ja(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[Ie],delete n[$t],delete n[mu],delete n[Qf],delete n[Kf])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ua(e){return e.tag===5||e.tag===3||e.tag===4}function Ri(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ua(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Lu(e,n,t){var r=e.tag;if(r===5||r===6)e=e.stateNode,n?t.nodeType===8?t.parentNode.insertBefore(e,n):t.insertBefore(e,n):(t.nodeType===8?(n=t.parentNode,n.insertBefore(e,t)):(n=t,n.appendChild(e)),t=t._reactRootContainer,t!=null||n.onclick!==null||(n.onclick=Fr));else if(r!==4&&(e=e.child,e!==null))for(Lu(e,n,t),e=e.sibling;e!==null;)Lu(e,n,t),e=e.sibling}function Tu(e,n,t){var r=e.tag;if(r===5||r===6)e=e.stateNode,n?t.insertBefore(e,n):t.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Tu(e,n,t),e=e.sibling;e!==null;)Tu(e,n,t),e=e.sibling}var J=null,ze=!1;function Xe(e,n,t){for(t=t.child;t!==null;)$a(e,n,t),t=t.sibling}function $a(e,n,t){if(Fe&&typeof Fe.onCommitFiberUnmount=="function")try{Fe.onCommitFiberUnmount(br,t)}catch{}switch(t.tag){case 5:te||Bn(t,n);case 6:var r=J,l=ze;J=null,Xe(e,n,t),J=r,ze=l,J!==null&&(ze?(e=J,t=t.stateNode,e.nodeType===8?e.parentNode.removeChild(t):e.removeChild(t)):J.removeChild(t.stateNode));break;case 18:J!==null&&(ze?(e=J,t=t.stateNode,e.nodeType===8?Ml(e.parentNode,t):e.nodeType===1&&Ml(e,t),Dt(e)):Ml(J,t.stateNode));break;case 4:r=J,l=ze,J=t.stateNode.containerInfo,ze=!0,Xe(e,n,t),J=r,ze=l;break;case 0:case 11:case 14:case 15:if(!te&&(r=t.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var u=l,o=u.destroy;u=u.tag,o!==void 0&&(u&2||u&4)&&Nu(t,n,o),l=l.next}while(l!==r)}Xe(e,n,t);break;case 1:if(!te&&(Bn(t,n),r=t.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=t.memoizedProps,r.state=t.memoizedState,r.componentWillUnmount()}catch(i){A(t,n,i)}Xe(e,n,t);break;case 21:Xe(e,n,t);break;case 22:t.mode&1?(te=(r=te)||t.memoizedState!==null,Xe(e,n,t),te=r):Xe(e,n,t);break;default:Xe(e,n,t)}}function Oi(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var t=e.stateNode;t===null&&(t=e.stateNode=new sd),n.forEach(function(r){var l=gd.bind(null,e,r);t.has(r)||(t.add(r),r.then(l,l))})}}function Pe(e,n){var t=n.deletions;if(t!==null)for(var r=0;rl&&(l=o),r&=~u}if(r=l,r=W()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*fd(r/1960))-r,10e?16:e,en===null)var r=!1;else{if(e=en,en=null,Gr=0,R&6)throw Error(y(331));var l=R;for(R|=4,k=e.current;k!==null;){var u=k,o=u.child;if(k.flags&16){var i=u.deletions;if(i!==null){for(var s=0;sW()-ko?En(e,0):So|=t),de(e,n)}function Ya(e,n){n===0&&(e.mode&1?(n=lr,lr<<=1,!(lr&130023424)&&(lr=4194304)):n=1);var t=ue();e=Qe(e,n),e!==null&&(Yt(e,n,t),de(e,t))}function yd(e){var n=e.memoizedState,t=0;n!==null&&(t=n.retryLane),Ya(e,t)}function gd(e,n){var t=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(t=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(y(314))}r!==null&&r.delete(n),Ya(e,t)}var Xa;Xa=function(e,n,t){if(e!==null)if(e.memoizedProps!==n.pendingProps||ce.current)ae=!0;else{if(!(e.lanes&t)&&!(n.flags&128))return ae=!1,ud(e,n,t);ae=!!(e.flags&131072)}else ae=!1,j&&n.flags&1048576&&qs(n,Vr,n.index);switch(n.lanes=0,n.tag){case 2:var r=n.type;_r(e,n),e=n.pendingProps;var l=Jn(n,re.current);Xn(n,t),l=mo(null,n,r,e,l,t);var u=vo();return n.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,fe(r)?(u=!0,Ur(n)):u=!1,n.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,so(n),l.updater=ol,n.stateNode=l,l._reactInternals=n,Su(n,r,e,t),n=Cu(null,n,r,!0,u,t)):(n.tag=0,j&&u&&no(n),le(null,n,l,t),n=n.child),n;case 16:r=n.elementType;e:{switch(_r(e,n),e=n.pendingProps,l=r._init,r=l(r._payload),n.type=r,l=n.tag=Sd(r),e=Ne(r,e),l){case 0:n=Eu(null,n,r,e,t);break e;case 1:n=Ni(null,n,r,e,t);break e;case 11:n=xi(null,n,r,e,t);break e;case 14:n=Pi(null,n,r,Ne(r.type,e),t);break e}throw Error(y(306,r,""))}return n;case 0:return r=n.type,l=n.pendingProps,l=n.elementType===r?l:Ne(r,l),Eu(e,n,r,l,t);case 1:return r=n.type,l=n.pendingProps,l=n.elementType===r?l:Ne(r,l),Ni(e,n,r,l,t);case 3:e:{if(Ra(n),e===null)throw Error(y(387));r=n.pendingProps,u=n.memoizedState,l=u.element,la(e,n),Hr(n,r,null,t);var o=n.memoizedState;if(r=o.element,u.isDehydrated)if(u={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},n.updateQueue.baseState=u,n.memoizedState=u,n.flags&256){l=nt(Error(y(423)),n),n=zi(e,n,r,t,l);break e}else if(r!==l){l=nt(Error(y(424)),n),n=zi(e,n,r,t,l);break e}else for(me=ln(n.stateNode.containerInfo.firstChild),ve=n,j=!0,Le=null,t=ta(n,null,r,t),n.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(qn(),r===l){n=Ke(e,n,t);break e}le(e,n,r,t)}n=n.child}return n;case 5:return ua(n),e===null&&yu(n),r=n.type,l=n.pendingProps,u=e!==null?e.memoizedProps:null,o=l.children,du(r,l)?o=null:u!==null&&du(r,u)&&(n.flags|=32),Ta(e,n),le(e,n,o,t),n.child;case 6:return e===null&&yu(n),null;case 13:return Oa(e,n,t);case 4:return ao(n,n.stateNode.containerInfo),r=n.pendingProps,e===null?n.child=bn(n,null,r,t):le(e,n,r,t),n.child;case 11:return r=n.type,l=n.pendingProps,l=n.elementType===r?l:Ne(r,l),xi(e,n,r,l,t);case 7:return le(e,n,n.pendingProps,t),n.child;case 8:return le(e,n,n.pendingProps.children,t),n.child;case 12:return le(e,n,n.pendingProps.children,t),n.child;case 10:e:{if(r=n.type._context,l=n.pendingProps,u=n.memoizedProps,o=l.value,M(Ar,r._currentValue),r._currentValue=o,u!==null)if(Oe(u.value,o)){if(u.children===l.children&&!ce.current){n=Ke(e,n,t);break e}}else for(u=n.child,u!==null&&(u.return=n);u!==null;){var i=u.dependencies;if(i!==null){o=u.child;for(var s=i.firstContext;s!==null;){if(s.context===r){if(u.tag===1){s=Be(-1,t&-t),s.tag=2;var c=u.updateQueue;if(c!==null){c=c.shared;var v=c.pending;v===null?s.next=s:(s.next=v.next,v.next=s),c.pending=s}}u.lanes|=t,s=u.alternate,s!==null&&(s.lanes|=t),gu(u.return,t,n),i.lanes|=t;break}s=s.next}}else if(u.tag===10)o=u.type===n.type?null:u.child;else if(u.tag===18){if(o=u.return,o===null)throw Error(y(341));o.lanes|=t,i=o.alternate,i!==null&&(i.lanes|=t),gu(o,t,n),o=u.sibling}else o=u.child;if(o!==null)o.return=u;else for(o=u;o!==null;){if(o===n){o=null;break}if(u=o.sibling,u!==null){u.return=o.return,o=u;break}o=o.return}u=o}le(e,n,l.children,t),n=n.child}return n;case 9:return l=n.type,r=n.pendingProps.children,Xn(n,t),l=Ce(l),r=r(l),n.flags|=1,le(e,n,r,t),n.child;case 14:return r=n.type,l=Ne(r,n.pendingProps),l=Ne(r.type,l),Pi(e,n,r,l,t);case 15:return za(e,n,n.type,n.pendingProps,t);case 17:return r=n.type,l=n.pendingProps,l=n.elementType===r?l:Ne(r,l),_r(e,n),n.tag=1,fe(r)?(e=!0,Ur(n)):e=!1,Xn(n,t),xa(n,r,l),Su(n,r,l,t),Cu(null,n,r,!0,e,t);case 19:return Ma(e,n,t);case 22:return La(e,n,t)}throw Error(y(156,n.tag))};function Ga(e,n){return Es(e,n)}function wd(e,n,t,r){this.tag=e,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ke(e,n,t,r){return new wd(e,n,t,r)}function xo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Sd(e){if(typeof e=="function")return xo(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Hu)return 11;if(e===Wu)return 14}return 2}function an(e,n){var t=e.alternate;return t===null?(t=ke(e.tag,n,e.key,e.mode),t.elementType=e.elementType,t.type=e.type,t.stateNode=e.stateNode,t.alternate=e,e.alternate=t):(t.pendingProps=n,t.type=e.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=e.flags&14680064,t.childLanes=e.childLanes,t.lanes=e.lanes,t.child=e.child,t.memoizedProps=e.memoizedProps,t.memoizedState=e.memoizedState,t.updateQueue=e.updateQueue,n=e.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},t.sibling=e.sibling,t.index=e.index,t.ref=e.ref,t}function Nr(e,n,t,r,l,u){var o=2;if(r=e,typeof e=="function")xo(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Mn:return Cn(t.children,l,u,n);case Bu:o=8,l|=8;break;case Wl:return e=ke(12,t,n,l|2),e.elementType=Wl,e.lanes=u,e;case Ql:return e=ke(13,t,n,l),e.elementType=Ql,e.lanes=u,e;case Kl:return e=ke(19,t,n,l),e.elementType=Kl,e.lanes=u,e;case us:return al(t,l,u,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case rs:o=10;break e;case ls:o=9;break e;case Hu:o=11;break e;case Wu:o=14;break e;case Ge:o=16,r=null;break e}throw Error(y(130,e==null?e:typeof e,""))}return n=ke(o,t,n,l),n.elementType=e,n.type=r,n.lanes=u,n}function Cn(e,n,t,r){return e=ke(7,e,r,n),e.lanes=t,e}function al(e,n,t,r){return e=ke(22,e,r,n),e.elementType=us,e.lanes=t,e.stateNode={isHidden:!1},e}function Al(e,n,t){return e=ke(6,e,null,n),e.lanes=t,e}function Bl(e,n,t){return n=ke(4,e.children!==null?e.children:[],e.key,n),n.lanes=t,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function kd(e,n,t,r,l){this.tag=n,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=El(0),this.expirationTimes=El(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=El(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Po(e,n,t,r,l,u,o,i,s){return e=new kd(e,n,t,i,s),n===1?(n=1,u===!0&&(n|=8)):n=0,u=ke(3,null,null,n),e.current=u,u.stateNode=e,u.memoizedState={element:r,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},so(u),e}function Ed(e,n,t){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ba)}catch(e){console.error(e)}}ba(),bi.exports=ye;var Nd=bi.exports,Vi=Nd;Do.createRoot=Vi.createRoot,Do.hydrateRoot=Vi.hydrateRoot;export{Do as c,zd as j,Ji as r}; diff --git a/dist/js/postMessage-B4GKDR20.js b/dist/js/postMessage-B4GKDR20.js new file mode 100644 index 0000000..113c998 --- /dev/null +++ b/dist/js/postMessage-B4GKDR20.js @@ -0,0 +1 @@ +class t{constructor(s,e){this.iFrame=null,this.targetOrigin="",this.iFrame=s,this.targetOrigin=e,window.addEventListener("message",this.handle,!1)}send(s){this.targetOrigin?this.iFrame.postMessage(s,this.targetOrigin):this.iFrame.postMessage(s,"*")}handle(s){console.log(s),s.origin===this.targetOrigin&&(console.log(s.origin),console.log(s.source),console.log(s.data))}destroy(){window.removeEventListener("message",this.handle,!1)}}export{t as P}; diff --git a/dist/js/postMessage-B_nyYmIz.js b/dist/js/postMessage-B_nyYmIz.js new file mode 100644 index 0000000..4a14314 --- /dev/null +++ b/dist/js/postMessage-B_nyYmIz.js @@ -0,0 +1 @@ +class t{constructor(s,e){this.iFrame=null,this.targetOrigin="",this.iFrame=s,this.targetOrigin=e,window.addEventListener("message",this.handle,!1)}send(s){this.targetOrigin?this.iFrame.postMessage(s,this.targetOrigin):this.iFrame.postMessage(s,"*")}handle(s){s.origin===this.targetOrigin&&(console.log(s.origin),console.log(s.source),console.log(s.data))}destroy(){window.removeEventListener("message",this.handle,!1)}}export{t as P}; diff --git a/dist/popup/index.html b/dist/popup/index.html index 2fa4715..9e60b08 100644 --- a/dist/popup/index.html +++ b/dist/popup/index.html @@ -6,7 +6,7 @@ Measuring Tools - + diff --git a/dist/popup/popup.js b/dist/popup/popup.js index 4e462b4..44fd016 100644 --- a/dist/popup/popup.js +++ b/dist/popup/popup.js @@ -1 +1 @@ -import{j as o,c as i}from"../js/client-Gw-UosAD.js";function a(){const r=()=>{chrome.tabs.query({active:!0,currentWindow:!0},e=>{let l={info:"openMeasureTool"};e[0]&&e[0].id&&chrome.tabs.sendMessage(e[0].id,l,void 0,n=>{console.log(n)})})},t=()=>{chrome.tabs.query({active:!0,currentWindow:!0},e=>{let l={info:"closeMeasureTool"};e[0]&&e[0].id&&chrome.tabs.sendMessage(e[0].id,l,void 0,n=>{console.log(n)})})};let s=!1;const c=()=>{s=!s,s?(r(),console.log("open")):(t(),console.log("close"))};return o.jsx(o.Fragment,{children:o.jsx("div",{id:"app",children:o.jsxs("div",{className:"toggle normal",children:[o.jsx("input",{id:"normal",type:"checkbox"}),o.jsx("label",{onClick:c,className:"toggle-item",htmlFor:"normal"})]})})})}i.createRoot(document.getElementById("root")).render(o.jsx(a,{})); +import{j as o,c as i}from"../js/client-B7nMxStY.js";function a(){const r=()=>{chrome.tabs.query({active:!0,currentWindow:!0},e=>{let l={info:"openMeasureTool"};e[0]&&e[0].id&&chrome.tabs.sendMessage(e[0].id,l,void 0,n=>{console.log(n)})})},t=()=>{chrome.tabs.query({active:!0,currentWindow:!0},e=>{let l={info:"closeMeasureTool"};e[0]&&e[0].id&&chrome.tabs.sendMessage(e[0].id,l,void 0,n=>{console.log(n)})})};let s=!1;const c=()=>{s=!s,s?(r(),console.log("open")):(t(),console.log("close"))};return o.jsx(o.Fragment,{children:o.jsx("div",{id:"app",children:o.jsxs("div",{className:"toggle normal",children:[o.jsx("input",{id:"normal",type:"checkbox"}),o.jsx("label",{onClick:c,className:"toggle-item",htmlFor:"normal"})]})})})}i.createRoot(document.getElementById("root")).render(o.jsx(a,{})); diff --git a/src/content/content.ts b/src/content/content.ts index 9a78986..3fda973 100644 --- a/src/content/content.ts +++ b/src/content/content.ts @@ -1,12 +1,14 @@ import { eventTypes } from '../types/eventTypes' import { iframe } from '../const/iframe' import dragImg from '../assets/drag.png' +import PostMessage from '../utils/postMessage' const timeS = "inject-D" + Date.now().toString() const style = ` .${timeS}{ outline: 1px solid red; } ` +let postMessage:any; let preEl: Element | null = null let dragOpen = false; let dragTarget: HTMLElement | null = null; @@ -14,32 +16,34 @@ let dragTarget: HTMLElement | null = null; let centralEl: HTMLElement | null = null; let onCneter = false; -const MeasureTools = (event: MouseEvent) => { +const MeasureTools = (event: MouseEvent) => { if (dragOpen) { if (dragTarget) { dragTarget.style.top = event.clientY + "px"; dragTarget.style.left = event.clientX + "px"; } } - if(onCneter)return + if (onCneter) return let cur = document.elementFromPoint(event.clientX, event.clientY)! - if (cur && (cur.tagName === 'IFRAME' || cur.id === timeS||cur.id===timeS+'-')) return + if (cur && (cur.tagName === 'IFRAME' || cur.id === timeS || cur.id === timeS + '-')) return if (cur !== preEl) { preEl && preEl.classList.remove(timeS) preEl = cur cur && cur.classList.add(timeS) - centralEl=cur as HTMLDivElement + centralEl = cur as HTMLDivElement } } const centralElClick = (e: KeyboardEvent) => { - let keyNum=window.event ? e.keyCode :e.which; + let keyNum = window.event ? e.keyCode : e.which; if (keyNum === 81) { onCneter = !onCneter; - if (!onCneter) { centralEl=null} - console.log(centralEl); + if (!onCneter) { + centralEl = null + } + else { + postMessage.send("hello") + } } - - } //@ts-ignore const handleEvent = (e: string) => { @@ -83,7 +87,7 @@ const handlePage = (e: string) => { padding: 10px;` let img = document.createElement('img') img.src = dragImg; - img.id=timeS+'-' + img.id = timeS + '-' img.style.cssText = `width: 20px; height: 20px; position: absolute; @@ -95,10 +99,14 @@ const handlePage = (e: string) => { document.body.appendChild(div); dragTarget = div img.onclick = () => { - dragOpen=!dragOpen; + dragOpen = !dragOpen; if (dragOpen) img.style.cursor = 'grabbing'; else img.style.cursor = 'grab'; } + //@ts-ignore + postMessage = new PostMessage(contentIframe.contentWindow) + postMessage.send("hello") + } else if (e == eventTypes.close) { document.querySelector(`#${timeS}`) && document.querySelector(`#${timeS}`)!.remove() } diff --git a/src/contentPage/App.tsx b/src/contentPage/App.tsx index f665e9c..14850ac 100644 --- a/src/contentPage/App.tsx +++ b/src/contentPage/App.tsx @@ -1,6 +1,15 @@ +import { useEffect } from 'react'; import './App.css' + export default function App() { + useEffect(() => { + + window.addEventListener('message', (e) => { + console.log(e); + top?.postMessage('ok',"*") + }, false) + }) return <>
diff --git a/src/contentPage/index.html b/src/contentPage/index.html index 51860a3..4516028 100644 --- a/src/contentPage/index.html +++ b/src/contentPage/index.html @@ -9,5 +9,6 @@
+ diff --git a/src/popup/App.tsx b/src/popup/App.tsx index bc404ca..38e3931 100644 --- a/src/popup/App.tsx +++ b/src/popup/App.tsx @@ -32,6 +32,7 @@ export default function App() { if(e){openMeasureTool();console.log("open")} else{closeMeasureTool();console.log("close")} } + return <>
diff --git a/src/utils/diary.md b/src/utils/diary.md new file mode 100644 index 0000000..29cc085 --- /dev/null +++ b/src/utils/diary.md @@ -0,0 +1,5 @@ +- window.postMessage中的window指的是你想发送跨域消息的那个窗口(你需要通信的目标窗口),而不是自身窗口的window + +- 父页面中:父页面向子页面发送跨域信息,window就是在父页面中嵌入的iframe指向的子页面的window,即:iFrame.contentWindow子页面中:子页面想父页面发送跨域信息 +- window就是父页面的window,在这里因为子页面是嵌入到父页面中的,对于子页面来讲,window就是top或者parent +- 需要等到iframe中的子页面加载完成后才发送消息,否则子页面接收不到消息在监听message事件时需要判断一下消息来源origin diff --git a/src/utils/postMessage.ts b/src/utils/postMessage.ts index ea2805e..c8f1a1b 100644 --- a/src/utils/postMessage.ts +++ b/src/utils/postMessage.ts @@ -1,23 +1,21 @@ class PostMessage { - #iFrame: HTMLIFrameElement|null =null; - #targetOrigin: string = ''; - constructor(el:HTMLIFrameElement, targetOrigin: string) { - this.#iFrame = el; - this.#targetOrigin = targetOrigin; + iFrame: Window |null =null; + targetOrigin: string|undefined = ''; + constructor(el:Window,targetOrigin?: string) { + this.iFrame = el; + this.targetOrigin =targetOrigin; window.addEventListener('message',this.handle,false) } - sendMessage(message: any) { - this.#iFrame!.contentWindow!.postMessage(message,this.#targetOrigin); + send(message: any) { + if(this.targetOrigin)this.iFrame!.postMessage(message,this.targetOrigin); + else this.iFrame!.postMessage(message,'*'); } - private handle(e: MessageEvent) { - if(e.origin===this.#targetOrigin){ - console.log(e.origin) //父页面URL,这里是http://a.index.com - console.log(e.source) // 父页面window对象,全等于window.parent/window.top - console.log(e.data) //父页面发送的消息 - } + private handle(e: MessageEvent) { + if(e.data.source!="react-devtools-content-script")console.log(e); + } destroy() { window.removeEventListener('message',this.handle,false) } } -export default PostMessage; \ No newline at end of file +export default PostMessage; diff --git a/vite.config.ts b/vite.config.ts index 402608d..fb8c4d1 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -7,33 +7,33 @@ import path from 'path' export default defineConfig({ root: 'src/', plugins: [react(), - copy({ - targets: [ - { src: 'manifest.json', dest: 'dist' }, // 复制 manifest.json 到 dist 目录 - { src: "src/icons/**", dest: 'dist/icons' } // 复制 src/icons/** 到 dist/icons 目录 - ] - }) + copy({ + targets: [ + { src: 'manifest.json', dest: 'dist' }, // 复制 manifest.json 到 dist 目录 + { src: "src/icons/**", dest: 'dist/icons' } // 复制 src/icons/** 到 dist/icons 目录 + ] + }) ], build: { outDir: path.resolve(__dirname, 'dist'), - rollupOptions: { + rollupOptions: { input: { popup: path.resolve(__dirname, 'src/popup/index.html'), - contentPage: path.resolve(__dirname, 'src/contentPage/index.html'), - content: path.resolve(__dirname, 'src/content/content.ts'), - background: path.resolve(__dirname, 'src/background/service-worker.ts'), - }, + contentPage: path.resolve(__dirname, 'src/contentPage/index.html'), + content: path.resolve(__dirname, 'src/content/content.ts'), + background: path.resolve(__dirname, 'src/background/service-worker.ts'), + }, output: { assetFileNames: 'assets/[name]-[hash].[ext]', // 静态资源 - chunkFileNames: 'js/[name]-[hash].js', // 代码分割中产生的 chunk - entryFileNames: (chunkInfo) => { // 入口文件 + chunkFileNames: 'js/[name]-[hash].js', // 代码分割中产生的 chunk + entryFileNames: (chunkInfo) => { // 入口文件 const baseName = path.basename(chunkInfo.facadeModuleId!, path.extname(chunkInfo.facadeModuleId!)) const saveArr = ['content', 'service-worker'] return `[name]/${saveArr.includes(baseName) ? baseName : chunkInfo.name}.js`; }, - name: '[name].js' + name: '[name].js' } }, }, - + })