react-grab 0.1.48-dev.fe982d7 → 0.1.49-dev.575dc58
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 +15 -58
- package/dist/{copy-content-CDFe4uJW.d.ts → copy-content-CcSwO8vJ.d.ts} +21 -6
- package/dist/{copy-content-hpjB511j.d.cts → copy-content-Dxdqj7pl.d.cts} +21 -6
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +1 -1
- package/dist/core-BqLdgVaS.cjs +14 -0
- package/dist/core-DKd_EzPG.js +14 -0
- package/dist/{errors-Bk7FIavr.d.cts → errors-BEgowzRA.d.ts} +10 -2
- package/dist/{errors-Cy89H8tr.d.ts → errors-CTlIFDQs.d.cts} +10 -2
- package/dist/execute-context-menu-action-BM8Ih_bp.cjs +9 -0
- package/dist/execute-context-menu-action-CGl6l6sT.js +9 -0
- package/dist/freeze-updates-Bo4hlR6H.cjs +43 -0
- package/dist/freeze-updates-CTzQGBxU.js +43 -0
- package/dist/{index-qFak7ECs.d.ts → index-Cd-ADR9Q.d.ts} +1 -1
- package/dist/{index-D23mfsUe.d.cts → index-DdYffA2X.d.cts} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +10 -8
- package/dist/index.d.ts +10 -8
- package/dist/index.global.js +20 -19
- package/dist/index.js +1 -1
- package/dist/open-file-CBXQTDtp.cjs +20 -0
- package/dist/open-file-DHlgPEf-.js +29 -0
- package/dist/primitives.cjs +2 -2
- package/dist/primitives.d.cts +51 -3
- package/dist/primitives.d.ts +51 -3
- package/dist/primitives.js +2 -2
- package/dist/renderer-CYA6df1l.js +9 -0
- package/dist/renderer-DMhdAwZM.cjs +9 -0
- package/dist/styles.css +1 -1
- package/package.json +11 -5
- package/dist/copy-content-C2zrO3VU.js +0 -10
- package/dist/copy-content-CXUx_1iN.cjs +0 -10
- package/dist/core-iQ3mfusF.js +0 -14
- package/dist/core-x3YUe26k.cjs +0 -14
- package/dist/execute-context-menu-action-B-P_gUOs.js +0 -9
- package/dist/execute-context-menu-action-Ddtbmlwp.cjs +0 -9
- package/dist/freeze-updates-BVxvgb7T.js +0 -61
- package/dist/freeze-updates-D7HmnXxx.cjs +0 -61
- package/dist/renderer-BN5dqKip.cjs +0 -9
- package/dist/renderer-CaZRY4SP.js +0 -9
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2025 Aiden Bai
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
import{$ as e,I as t,It as n,L as r,R as i,St as a,d as o,gn as s,k as c,mt as l}from"./freeze-updates-CTzQGBxU.js";const u={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return d(this.context.count)},getNextContextId(){return d(this.context.count++)}};function d(e){let t=String(e),n=t.length-1;return u.context.id+(n?String.fromCharCode(96+n):``)+t}function f(e){u.context=e}const p=(e,t)=>e===t,m=Symbol(`solid-proxy`),h=typeof Proxy==`function`,g=Symbol(`solid-track`),_={equals:p};let v=ve;const y={owned:null,cleanups:null,context:null,owner:null},ee={};var b=null;let x=null,S=null,C=null,w=null,T=0;function E(e,t){let n=S,r=b,i=e.length===0,a=t===void 0?r:t,o=i?y:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(()=>M(()=>B(o)));b=o,S=null;try{return R(s,!0)}finally{S=n,b=r}}function D(e,t){t=t?Object.assign({},_,t):_;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0};return[me.bind(n),e=>(typeof e==`function`&&(e=x&&x.running&&x.sources.has(n)?e(n.tValue):e(n.value)),he(n,e))]}function te(e,t,n){F(I(e,t,!0,1))}function O(e,t,n){F(I(e,t,!1,1))}function k(e,t,n){v=ye;let r=I(e,t,!1,1),i=P&&fe(P);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),w?w.push(r):F(r)}function A(e,t,n){n=n?Object.assign({},_,n):_;let r=I(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,F(r),me.bind(r)}function ne(e){return e&&typeof e==`object`&&`then`in e}function j(e,t,n){let r,i,a;typeof t==`function`?(r=e,i=t,a=n||{}):(r=!0,i=e,a=t||{});let o=null,s=ee,c=null,l=!1,d=!1,f=`initialValue`in a,p=typeof r==`function`&&A(r),m=new Set,[h,g]=(a.storage||D)(a.initialValue),[_,v]=D(void 0),[y,C]=D(void 0,{equals:!1}),[w,T]=D(f?`ready`:`unresolved`);u.context&&(c=u.getNextContextId(),a.ssrLoadFrom===`initial`?s=a.initialValue:u.load&&u.has(c)&&(s=u.load(c)));function E(e,t,n,r){return o===e&&(o=null,r!==void 0&&(f=!0),(e===s||t===s)&&a.onHydrated&&queueMicrotask(()=>a.onHydrated(r,{value:t})),s=ee,x&&e&&l?(x.promises.delete(e),l=!1,R(()=>{x.running=!0,O(t,n)},!1)):O(t,n)),t}function O(e,t){R(()=>{t===void 0&&g(()=>e),T(t===void 0?f?`ready`:`unresolved`:`errored`),v(t);for(let e of m.keys())e.decrement();m.clear()},!1)}function k(){let e=P&&fe(P),t=h(),n=_();if(n!==void 0&&!o)throw n;return S&&!S.user&&e&&te(()=>{y(),o&&(e.resolved&&x&&l?x.promises.add(o):m.has(e)||(e.increment(),m.add(e)))}),t}function j(e=!0){if(e!==!1&&d)return;d=!1;let t=p?p():r;if(l=x&&x.running,t==null||t===!1){E(o,M(h));return}x&&o&&x.promises.delete(o);let n,a=s===ee?M(()=>{try{return i(t,{value:h(),refetching:e})}catch(e){n=e}}):s;if(n!==void 0){E(o,void 0,V(n),t);return}else if(!ne(a))return E(o,a,void 0,t),a;return o=a,`v`in a?(a.s===1?E(o,a.v,void 0,t):E(o,void 0,V(a.v),t),a):(d=!0,queueMicrotask(()=>d=!1),R(()=>{T(f?`refreshing`:`pending`),C()},!1),a.then(e=>E(a,e,void 0,t),e=>E(a,void 0,V(e),t)))}Object.defineProperties(k,{state:{get:()=>w()},error:{get:()=>_()},loading:{get(){let e=w();return e===`pending`||e===`refreshing`}},latest:{get(){if(!f)return k();let e=_();if(e&&!o)throw e;return h()}}});let re=b;return p?te(()=>(re=b,j(!1))):j(!1),[k,{refetch:e=>ce(re,()=>j(e)),mutate:g}]}function re(e){return R(e,!1)}function M(e){if(S===null)return e();let t=S;S=null;try{return e()}finally{S=t}}function ie(e,t,n){let r=Array.isArray(e),i,a=n&&n.defer;return n=>{let o;if(r){o=Array(e.length);for(let t=0;t<e.length;t++)o[t]=e[t]()}else o=e();if(a)return a=!1,n;let s=M(()=>t(o,i,n));return i=o,s}}function ae(e){k(()=>M(e))}function N(e){return b===null||(b.cleanups===null?b.cleanups=[e]:b.cleanups.push(e)),e}function oe(){return S}function se(){return b}function ce(e,t){let n=b,r=S;b=e,S=null;try{return R(t,!0)}catch(e){Se(e)}finally{b=n,S=r}}const[le,ue]=D(!1);function de(e,t){let n=Symbol(`context`);return{id:n,Provider:we(n),defaultValue:e}}function fe(e){let t;return b&&b.context&&(t=b.context[e.id])!==void 0?t:e.defaultValue}function pe(e){let t=A(e),n=A(()=>Ce(t()));return n.toArray=()=>{let e=n();return Array.isArray(e)?e:e==null?[]:[e]},n}let P;function me(){let e=x&&x.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===1)F(this);else{let e=C;C=null,R(()=>z(this),!1),C=e}if(S){let e=this.observers?this.observers.length:0;S.sources?(S.sources.push(this),S.sourceSlots.push(e)):(S.sources=[this],S.sourceSlots=[e]),this.observers?(this.observers.push(S),this.observerSlots.push(S.sources.length-1)):(this.observers=[S],this.observerSlots=[S.sources.length-1])}return e&&x.sources.has(this)?this.tValue:this.value}function he(e,t,n){let r=x&&x.running&&x.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(x){let r=x.running;(r||!n&&x.sources.has(e))&&(x.sources.add(e),e.tValue=t),r||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&R(()=>{for(let t=0;t<e.observers.length;t+=1){let n=e.observers[t],r=x&&x.running;r&&x.disposed.has(n)||((r?!n.tState:!n.state)&&(n.pure?C.push(n):w.push(n),n.observers&&be(n)),r?n.tState=1:n.state=1)}if(C.length>1e6)throw C=[],Error()},!1)}return t}function F(e){if(!e.fn)return;B(e);let t=T;ge(e,x&&x.running&&x.sources.has(e)?e.tValue:e.value,t),x&&!x.running&&x.sources.has(e)&&queueMicrotask(()=>{R(()=>{x&&(x.running=!0),S=b=e,ge(e,e.tValue,t),S=b=null},!1)})}function ge(e,t,n){let r,i=b,a=S;S=b=e;try{r=e.fn(t)}catch(t){return e.pure&&(x&&x.running?(e.tState=1,e.tOwned&&e.tOwned.forEach(B),e.tOwned=void 0):(e.state=1,e.owned&&e.owned.forEach(B),e.owned=null)),e.updatedAt=n+1,Se(t)}finally{S=a,b=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&`observers`in e?he(e,r,!0):x&&x.running&&e.pure?(x.sources.has(e)||(e.value=r),x.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function I(e,t,n,r=1,i){let a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:b,context:b?b.context:null,pure:n};return x&&x.running&&(a.state=0,a.tState=r),b===null||b!==y&&(x&&x.running&&b.pure?b.tOwned?b.tOwned.push(a):b.tOwned=[a]:b.owned?b.owned.push(a):b.owned=[a]),a}function L(e){let t=x&&x.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===2)return z(e);if(e.suspense&&M(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<T);){if(t&&x.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let t=e,i=n[r+1];for(;(t=t.owner)&&t!==i;)if(x.disposed.has(t))return}if((t?e.tState:e.state)===1)F(e);else if((t?e.tState:e.state)===2){let t=C;C=null,R(()=>z(e,n[0]),!1),C=t}}}function R(e,t){if(C)return e();let n=!1;t||(C=[]),w?n=!0:w=[],T++;try{let t=e();return _e(n),t}catch(e){n||(w=null),C=null,Se(e)}}function _e(e){if(C&&=(ve(C),null),e)return;let t;if(x){if(!x.promises.size&&!x.queue.size){let e=x.sources,n=x.disposed;w.push.apply(w,x.effects),t=x.resolve;for(let e of w)`tState`in e&&(e.state=e.tState),delete e.tState;x=null,R(()=>{for(let e of n)B(e);for(let t of e){if(t.value=t.tValue,t.owned)for(let e=0,n=t.owned.length;e<n;e++)B(t.owned[e]);t.tOwned&&(t.owned=t.tOwned),delete t.tValue,delete t.tOwned,t.tState=0}ue(!1)},!1)}else if(x.running){x.running=!1,x.effects.push.apply(x.effects,w),w=null,ue(!0);return}}let n=w;w=null,n.length&&R(()=>v(n),!1),t&&t()}function ve(e){for(let t=0;t<e.length;t++)L(e[t])}function ye(e){let t,n=0;for(t=0;t<e.length;t++){let r=e[t];r.user?e[n++]=r:L(r)}if(u.context){if(u.count){u.effects||=[],u.effects.push(...e.slice(0,n));return}f()}for(u.effects&&(u.done||!u.count)&&(e=[...u.effects,...e],n+=u.effects.length,delete u.effects),t=0;t<n;t++)L(e[t])}function z(e,t){let n=x&&x.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){let i=e.sources[r];if(i.sources){let e=n?i.tState:i.state;e===1?i!==t&&(!i.updatedAt||i.updatedAt<T)&&L(i):e===2&&z(i,t)}}}function be(e){let t=x&&x.running;for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=2:r.state=2,r.pure?C.push(r):w.push(r),r.observers&&be(r))}}function B(e){let t;if(e.sources)for(;e.sources.length;){let t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){let e=r.pop(),i=t.observerSlots.pop();n<r.length&&(e.sourceSlots[i]=n,r[n]=e,t.observerSlots[n]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)B(e.tOwned[t]);delete e.tOwned}if(x&&x.running&&e.pure)xe(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)B(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}x&&x.running?e.tState=0:e.state=0}function xe(e,t){if(t||(e.tState=0,x.disposed.add(e)),e.owned)for(let t=0;t<e.owned.length;t++)xe(e.owned[t])}function V(e){return e instanceof Error?e:Error(typeof e==`string`?e:`Unknown error`,{cause:e})}function Se(e,t=b){throw V(e)}function Ce(e){if(typeof e==`function`&&!e.length)return Ce(e());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++){let r=Ce(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function we(e,t){return function(t){let n;return O(()=>n=M(()=>(b.context={...b.context,[e]:t.value},pe(()=>t.children))),void 0),n}}const Te=Symbol(`fallback`);function H(e){for(let t=0;t<e.length;t++)e[t]()}function Ee(e,t,n={}){let r=[],i=[],a=[],o=0,s=t.length>1?[]:null;return N(()=>H(a)),()=>{let c=e()||[],l=c.length,u,d;return c[g],M(()=>{let e,t,p,m,h,g,_,v,y;if(l===0)o!==0&&(H(a),a=[],r=[],i=[],o=0,s&&=[]),n.fallback&&(r=[Te],i[0]=E(e=>(a[0]=e,n.fallback())),o=1);else if(o===0){for(i=Array(l),d=0;d<l;d++)r[d]=c[d],i[d]=E(f);o=l}else{for(p=Array(l),m=Array(l),s&&(h=Array(l)),g=0,_=Math.min(o,l);g<_&&r[g]===c[g];g++);for(_=o-1,v=l-1;_>=g&&v>=g&&r[_]===c[v];_--,v--)p[v]=i[_],m[v]=a[_],s&&(h[v]=s[_]);for(e=new Map,t=Array(v+1),d=v;d>=g;d--)y=c[d],u=e.get(y),t[d]=u===void 0?-1:u,e.set(y,d);for(u=g;u<=_;u++)y=r[u],d=e.get(y),d!==void 0&&d!==-1?(p[d]=i[u],m[d]=a[u],s&&(h[d]=s[u]),d=t[d],e.set(y,d)):a[u]();for(d=g;d<l;d++)d in p?(i[d]=p[d],a[d]=m[d],s&&(s[d]=h[d],s[d](d))):i[d]=E(f);i=i.slice(0,o=l),r=c.slice(0)}return i});function f(e){if(a[d]=e,s){let[e,n]=D(d);return s[d]=n,t(c[d],e)}return t(c[d])}}}function De(e,t,n={}){let r=[],i=[],a=[],o=[],s=0,c;return N(()=>H(a)),()=>{let l=e()||[],u=l.length;return l[g],M(()=>{if(u===0)return s!==0&&(H(a),a=[],r=[],i=[],s=0,o=[]),n.fallback&&(r=[Te],i[0]=E(e=>(a[0]=e,n.fallback())),s=1),i;for(r[0]===Te&&(a[0](),a=[],r=[],i=[],s=0),c=0;c<u;c++)c<r.length&&r[c]!==l[c]?o[c](()=>l[c]):c>=r.length&&(i[c]=E(d));for(;c<r.length;c++)a[c]();return s=o.length=a.length=u,r=l.slice(0),i=i.slice(0,s)});function d(e){a[c]=e;let[n,r]=D(l[c]);return o[c]=r,t(n,c)}}}function Oe(e,t){return M(()=>e(t||{}))}function U(){return!0}const ke={get(e,t,n){return t===m?n:e.get(t)},has(e,t){return t===m?!0:e.has(t)},set:U,deleteProperty:U,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:U,deleteProperty:U}},ownKeys(e){return e.keys()}};function Ae(e){return(e=typeof e==`function`?e():e)?e:{}}function je(){for(let e=0,t=this.length;e<t;++e){let t=this[e]();if(t!==void 0)return t}}function Me(...e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];t||=!!r&&m in r,e[n]=typeof r==`function`?(t=!0,A(r)):r}if(h&&t)return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){let r=Ae(e[n])[t];if(r!==void 0)return r}},has(t){for(let n=e.length-1;n>=0;n--)if(t in Ae(e[n]))return!0;return!1},keys(){let t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(Ae(e[n])));return[...new Set(t)]}},ke);let n={},r=Object.create(null);for(let t=e.length-1;t>=0;t--){let i=e[t];if(!i)continue;let a=Object.getOwnPropertyNames(i);for(let e=a.length-1;e>=0;e--){let t=a[e];if(t===`__proto__`||t===`constructor`)continue;let o=Object.getOwnPropertyDescriptor(i,t);if(!r[t])r[t]=o.get?{enumerable:!0,configurable:!0,get:je.bind(n[t]=[o.get.bind(i)])}:o.value===void 0?void 0:o;else{let e=n[t];e&&(o.get?e.push(o.get.bind(i)):o.value!==void 0&&e.push(()=>o.value))}}}let i={},a=Object.keys(r);for(let e=a.length-1;e>=0;e--){let t=a[e],n=r[t];n&&n.get?Object.defineProperty(i,t,n):i[t]=n?n.value:void 0}return i}function Ne(e,...t){let n=t.length;if(h&&m in e){let r=n>1?t.flat():t[0],i=t.map(t=>new Proxy({get(n){return t.includes(n)?e[n]:void 0},has(n){return t.includes(n)&&n in e},keys(){return t.filter(t=>t in e)}},ke));return i.push(new Proxy({get(t){return r.includes(t)?void 0:e[t]},has(t){return r.includes(t)?!1:t in e},keys(){return Object.keys(e).filter(e=>!r.includes(e))}},ke)),i}let r=[];for(let e=0;e<=n;e++)r[e]={};for(let i of Object.getOwnPropertyNames(e)){let a=n;for(let e=0;e<t.length;e++)if(t[e].includes(i)){a=e;break}let o=Object.getOwnPropertyDescriptor(e,i);!o.get&&!o.set&&o.enumerable&&o.writable&&o.configurable?r[a][i]=o.value:Object.defineProperty(r[a],i,o)}return r}const Pe=e=>`Stale read from <${e}>.`;function Fe(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return A(Ee(()=>e.each,e.children,t||void 0))}function Ie(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return A(De(()=>e.each,e.children,t||void 0))}function Le(e){let t=e.keyed,n=A(()=>e.when,void 0,void 0),r=t?n:A(n,void 0,{equals:(e,t)=>!e==!t});return A(()=>{let i=r();if(i){let a=e.children;return typeof a==`function`&&a.length>0?M(()=>a(t?i:()=>{if(!M(r))throw Pe(`Show`);return n()})):a}return e.fallback},void 0,void 0)}function Re(e){let t=pe(()=>e.children),n=A(()=>{let e=t(),n=Array.isArray(e)?e:[e],r=()=>void 0;for(let e=0;e<n.length;e++){let t=e,i=n[e],a=r,o=A(()=>a()?void 0:i.when,void 0,void 0),s=i.keyed?o:A(o,void 0,{equals:(e,t)=>!e==!t});r=()=>a()||(s()?[t,o,i]:void 0)}return r});return A(()=>{let t=n()();if(!t)return e.fallback;let[r,i,a]=t,o=a.children;return typeof o==`function`&&o.length>0?M(()=>o(a.keyed?i():()=>{if(M(n)()?.[0]!==r)throw Pe(`Match`);return i()})):o},void 0,void 0)}function ze(e){return e}const Be=new Set([`className`,`value`,`readOnly`,`noValidate`,`formNoValidate`,`isMap`,`noModule`,`playsInline`,`adAuctionHeaders`,`allowFullscreen`,`browsingTopics`,`defaultChecked`,`defaultMuted`,`defaultSelected`,`disablePictureInPicture`,`disableRemotePlayback`,`preservesPitch`,`shadowRootClonable`,`shadowRootCustomElementRegistry`,`shadowRootDelegatesFocus`,`shadowRootSerializable`,`sharedStorageWritable`,...`allowfullscreen.async.alpha.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.hidden.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.adauctionheaders.browsingtopics.credentialless.defaultchecked.defaultmuted.defaultselected.defer.disablepictureinpicture.disableremoteplayback.preservespitch.shadowrootclonable.shadowrootcustomelementregistry.shadowrootdelegatesfocus.shadowrootserializable.sharedstoragewritable`.split(`.`)]),Ve=new Set([`innerHTML`,`textContent`,`innerText`,`children`]),He=Object.assign(Object.create(null),{className:`class`,htmlFor:`for`}),Ue=Object.assign(Object.create(null),{class:`className`,novalidate:{$:`noValidate`,FORM:1},formnovalidate:{$:`formNoValidate`,BUTTON:1,INPUT:1},ismap:{$:`isMap`,IMG:1},nomodule:{$:`noModule`,SCRIPT:1},playsinline:{$:`playsInline`,VIDEO:1},readonly:{$:`readOnly`,INPUT:1,TEXTAREA:1},adauctionheaders:{$:`adAuctionHeaders`,IFRAME:1},allowfullscreen:{$:`allowFullscreen`,IFRAME:1},browsingtopics:{$:`browsingTopics`,IMG:1},defaultchecked:{$:`defaultChecked`,INPUT:1},defaultmuted:{$:`defaultMuted`,AUDIO:1,VIDEO:1},defaultselected:{$:`defaultSelected`,OPTION:1},disablepictureinpicture:{$:`disablePictureInPicture`,VIDEO:1},disableremoteplayback:{$:`disableRemotePlayback`,AUDIO:1,VIDEO:1},preservespitch:{$:`preservesPitch`,AUDIO:1,VIDEO:1},shadowrootclonable:{$:`shadowRootClonable`,TEMPLATE:1},shadowrootdelegatesfocus:{$:`shadowRootDelegatesFocus`,TEMPLATE:1},shadowrootserializable:{$:`shadowRootSerializable`,TEMPLATE:1},sharedstoragewritable:{$:`sharedStorageWritable`,IFRAME:1,IMG:1}});function We(e,t){let n=Ue[e];return typeof n==`object`?n[t]?n.$:void 0:n}const Ge=new Set([`beforeinput`,`click`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`]),Ke={xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`},qe=e=>A(()=>e());function Je(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,c=t[i-1].nextSibling,l=null;for(;o<i||s<a;){if(t[o]===n[s]){o++,s++;continue}for(;t[i-1]===n[a-1];)i--,a--;if(i===o){let t=a<r?s?n[s-1].nextSibling:n[a-s]:c;for(;s<a;)e.insertBefore(n[s++],t)}else if(a===s)for(;o<i;)(!l||!l.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){let r=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],r),t[i]=n[a]}else{if(!l){l=new Map;let e=s;for(;e<a;)l.set(n[e],e++)}let r=l.get(t[o]);if(r!=null)if(s<r&&r<a){let c=o,u=1,d;for(;++c<i&&c<a&&!((d=l.get(t[c]))==null||d!==r+u);)u++;if(u>r-s){let i=t[o];for(;s<r;)e.insertBefore(n[s++],i)}else e.replaceChild(n[s++],t[o++])}else o++;else t[o++].remove()}}}const Ye=`_$DX_DELEGATE`;function Xe(e,t,n,r={}){let i;return E(r=>{i=r,t===document?e():ct(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=``}}function Ze(e,t,n,r){let i,a=()=>{let t=r?document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`template`):document.createElement(`template`);return t.innerHTML=e,n?t.content.firstChild.firstChild:r?t.firstChild:t.content.firstChild},o=t?()=>M(()=>document.importNode(i||=a(),!0)):()=>(i||=a()).cloneNode(!0);return o.cloneNode=o,o}function Qe(e,t=window.document){let n=t[Ye]||(t[Ye]=new Set);for(let r=0,i=e.length;r<i;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,pt))}}function W(e,t,n){G(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function $e(e,t,n,r){G(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function et(e,t,n){G(e)||(n?e.setAttribute(t,``):e.removeAttribute(t))}function tt(e,t){G(e)||(t==null?e.removeAttribute(`class`):e.className=t)}function nt(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){let r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n,typeof n!=`function`&&n)}function rt(e,t,n={}){let r=Object.keys(t||{}),i=Object.keys(n),a,o;for(a=0,o=i.length;a<o;a++){let r=i[a];!r||r===`undefined`||t[r]||(dt(e,r,!1),delete n[r])}for(a=0,o=r.length;a<o;a++){let i=r[a],o=!!t[i];!i||i===`undefined`||n[i]===o||!o||(dt(e,i,!0),n[i]=o)}return n}function it(e,t,n){if(!t)return n?W(e,`style`):t;let r=e.style;if(typeof t==`string`)return r.cssText=t;typeof n==`string`&&(r.cssText=n=void 0),n||={},t||={};let i,a;for(a in n)t[a]??r.removeProperty(a),delete n[a];for(a in t)i=t[a],i!==n[a]&&(r.setProperty(a,i),n[a]=i);return n}function at(e,t,n){n==null?e.style.removeProperty(t):e.style.setProperty(t,n)}function ot(e,t={},n,r){let i={};return r||O(()=>i.children=K(e,t.children,i.children)),O(()=>typeof t.ref==`function`&&st(t.ref,e)),O(()=>lt(e,t,n,!0,i,!0)),i}function st(e,t,n){return M(()=>e(t,n))}function ct(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!=`function`)return K(e,t,r,n);O(r=>K(e,t(),r,n),r)}function lt(e,t,n,r,i={},a=!1){t||={};for(let r in i)if(!(r in t)){if(r===`children`)continue;i[r]=ft(e,r,null,i[r],n,a,t)}for(let o in t){if(o===`children`){r||K(e,t.children);continue}let s=t[o];i[o]=ft(e,o,s,i[o],n,a,t)}}function G(e){return!!u.context&&!u.done&&(!e||e.isConnected)}function ut(e){return e.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function dt(e,t,n){let r=t.trim().split(/\s+/);for(let t=0,i=r.length;t<i;t++)e.classList.toggle(r[t],n)}function ft(e,t,n,r,i,a,o){let s,c,l,u,d;if(t===`style`)return it(e,n,r);if(t===`classList`)return rt(e,n,r);if(n===r)return r;if(t===`ref`)a||n(e);else if(t.slice(0,3)===`on:`){let i=t.slice(3);r&&e.removeEventListener(i,r,typeof r!=`function`&&r),n&&e.addEventListener(i,n,typeof n!=`function`&&n)}else if(t.slice(0,10)===`oncapture:`){let i=t.slice(10);r&&e.removeEventListener(i,r,!0),n&&e.addEventListener(i,n,!0)}else if(t.slice(0,2)===`on`){let i=t.slice(2).toLowerCase(),a=Ge.has(i);if(!a&&r){let t=Array.isArray(r)?r[0]:r;e.removeEventListener(i,t)}(a||n)&&(nt(e,i,n,a),a&&Qe([i]))}else if(t.slice(0,5)===`attr:`)W(e,t.slice(5),n);else if(t.slice(0,5)===`bool:`)et(e,t.slice(5),n);else if((d=t.slice(0,5)===`prop:`)||(l=Ve.has(t))||!i&&((u=We(t,e.tagName))||(c=Be.has(t)))||(s=e.nodeName.includes(`-`)||`is`in o)){if(d)t=t.slice(5),c=!0;else if(G(e))return n;t===`class`||t===`className`?tt(e,n):s&&!c&&!l?e[ut(t)]=n:e[u||t]=n}else{let r=i&&t.indexOf(`:`)>-1&&Ke[t.split(`:`)[0]];r?$e(e,r,t,n):W(e,He[t]||t,n)}return n}function pt(e){if(u.registry&&u.events&&u.events.find(([t,n])=>n===e))return;let t=e.target,n=`$$${e.type}`,r=e.target,i=e.currentTarget,a=t=>Object.defineProperty(e,`target`,{configurable:!0,value:t}),o=()=>{let r=t[n];if(r&&!t.disabled){let i=t[`${n}Data`];if(i===void 0?r.call(t,e):r.call(t,i,e),e.cancelBubble)return}return t.host&&typeof t.host!=`string`&&!t.host._$host&&t.contains(e.target)&&a(t.host),!0},s=()=>{for(;o()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,`currentTarget`,{configurable:!0,get(){return t||document}}),u.registry&&!u.done&&(u.done=_$HY.done=!0),e.composedPath){let n=e.composedPath();a(n[0]);for(let e=0;e<n.length-2&&(t=n[e],o());e++){if(t._$host){t=t._$host,s();break}if(t.parentNode===i)break}}else s();a(r)}function K(e,t,n,r,i){let a=G(e);if(a){!n&&(n=[...e.childNodes]);let t=[];for(let e=0;e<n.length;e++){let r=n[e];r.nodeType===8&&r.data.slice(0,2)===`!$`?r.remove():t.push(r)}n=t}for(;typeof n==`function`;)n=n();if(t===n)return n;let o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o===`string`||o===`number`){if(a||o===`number`&&(t=t.toString(),t===n))return n;if(s){let i=n[0];i&&i.nodeType===3?i.data!==t&&(i.data=t):i=document.createTextNode(t),n=q(e,n,r,i)}else n=n!==``&&typeof n==`string`?e.firstChild.data=t:e.textContent=t}else if(t==null||o===`boolean`){if(a)return n;n=q(e,n,r)}else if(o===`function`)return O(()=>{let i=t();for(;typeof i==`function`;)i=i();n=K(e,i,n,r)}),()=>n;else if(Array.isArray(t)){let o=[],c=n&&Array.isArray(n);if(mt(o,t,n,i))return O(()=>n=K(e,o,n,r,!0)),()=>n;if(a){if(!o.length)return n;if(r===void 0)return n=[...e.childNodes];let t=o[0];if(t.parentNode!==e)return n;let i=[t];for(;(t=t.nextSibling)!==r;)i.push(t);return n=i}if(o.length===0){if(n=q(e,n,r),s)return n}else c?n.length===0?ht(e,o,r):Je(e,n,o):(n&&q(e),ht(e,o));n=o}else if(t.nodeType){if(a&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=q(e,n,r,t);q(e,n,null,t)}else n==null||n===``||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}return n}function mt(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let o=t[a],s=n&&n[e.length],c;if(!(o==null||o===!0||o===!1))if((c=typeof o)==`object`&&o.nodeType)e.push(o);else if(Array.isArray(o))i=mt(e,o,s)||i;else if(c===`function`)if(r){for(;typeof o==`function`;)o=o();i=mt(e,Array.isArray(o)?o:[o],Array.isArray(s)?s:[s])||i}else e.push(o),i=!0;else{let t=String(o);s&&s.nodeType===3&&s.data===t?e.push(s):e.push(document.createTextNode(t))}}return i}function ht(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function q(e,t,n,r){if(n===void 0)return e.textContent=``;let i=r||document.createTextNode(``);if(t.length){let r=!1;for(let a=t.length-1;a>=0;a--){let o=t[a];if(i!==o){let t=o.parentNode===e;!r&&!a?t?e.replaceChild(i,o):e.insertBefore(i,n):t&&o.remove()}else r=!0}}else e.insertBefore(i,n);return[i]}const gt=t=>{if(!t)return!1;let n=e(t);return n?n.isConnected():!!(t.isConnected||t.ownerDocument?.contains(t))},_t=[`input`,`textarea`,`select`,`searchbox`,`slider`,`spinbutton`,`menuitem`,`menuitemcheckbox`,`menuitemradio`,`option`,`radio`,`textbox`,`combobox`],vt=e=>{if(e.composed){let t=e.composedPath()[0];if(t instanceof HTMLElement)return t}else if(e.target instanceof HTMLElement)return e.target},yt=e=>{if(document.designMode===`on`)return!0;let n=vt(e);if(!n)return!1;if(n.isContentEditable)return!0;let r=t(n);return _t.some(e=>e===r||e===n.role)},bt=e=>{let t=e.target;if(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement){let e=t.selectionStart??0;return(t.selectionEnd??0)-e>0}return!1},xt=()=>{let e=window.getSelection();return e?e.toString().length>0:!1},St=/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:\s*[,/]\s*([\d.]+%?))?\s*\)$/,J=e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,`0`),Ct=(e,t,n,r=1)=>{let i=J(e),a=J(t),o=J(n);return r>=1?`#${i}${a}${o}`:`#${i}${a}${o}${J(r*255)}`},wt=e=>{if(!e.startsWith(`#`))return null;let t=e.slice(1);if(t.length!==6&&t.length!==8)return null;let n=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),i=parseInt(t.slice(4,6),16),a=t.length===8?parseInt(t.slice(6,8),16)/255:1;return!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)?null:{red:n,green:r,blue:i,alpha:a}},Tt=e=>{let t=e.match(St);if(!t)return null;let n=1;if(t[4]!==void 0){let e=t[4];n=e.endsWith(`%`)?Number(e.slice(0,-1))/100:Number(e)}return Ct(Number(t[1]),Number(t[2]),Number(t[3]),n)},Et=e=>{let t=e.match(St);return!t||t[4]===void 0?!1:(t[4].endsWith(`%`)?Number(t[4].slice(0,-1))/100:Number(t[4]))===0},Dt=/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,Ot=e=>{let t=e.match(Dt);if(!t)return null;let n=t[1];return n.length===3?`#${n[0]}${n[0]}${n[1]}${n[1]}${n[2]}${n[2]}`:n.length===4?`#${n[0]}${n[0]}${n[1]}${n[1]}${n[2]}${n[2]}${n[3]}${n[3]}`:`#${n}`},kt=`rgba(0, 0, 0, 0)`,At=/^oklch\(\s*([+-]?\d*\.?\d+%?)\s+([+-]?\d*\.?\d+%?)\s+([+-]?\d*\.?\d+)(deg|grad|rad|turn)?(?:\s*\/\s*([+-]?\d*\.?\d+%?))?\s*\)$/i,jt=180/Math.PI,Mt=(e,t)=>e.endsWith(`%`)?Number(e.slice(0,-1))/100*t:Number(e),Nt=(e,t)=>{let n=Number(e);return t===`grad`?n*.9:t===`rad`?n*jt:t===`turn`?n*360:n},Pt=e=>{let t=Math.max(0,Math.min(1,e));return(t<=.0031308?t*12.92:1.055*t**(1/2.4)-.055)*255},Ft=e=>{let t=e.match(At);if(!t)return null;let n=Mt(t[1],1),r=Mt(t[2],.4),i=Nt(t[3],t[4])*Math.PI/180,a=t[5]===void 0?1:Mt(t[5],1);if(![n,r,i,a].every(Number.isFinite))return null;let o=r*Math.cos(i),s=r*Math.sin(i),c=n+.3963377774*o+.2158037573*s,l=n-.1055613458*o-.0638541728*s,u=n-.0894841775*o-1.291485548*s,d=c**3,f=l**3,p=u**3,m=4.0767416621*d-3.3077115913*f+.2309699292*p,h=-1.2684380046*d+2.6097574011*f-.3413193965*p,g=-.0041960863*d-.7034186147*f+1.707614701*p;return Ct(Pt(m),Pt(h),Pt(g),Math.max(0,Math.min(1,a)))};let It=null;const Lt=()=>It||(typeof document>`u`?null:(It=document.createElement(`canvas`).getContext(`2d`,{willReadFrequently:!0}),It)),Rt=(e,t)=>{e.clearRect(0,0,1,1),e.fillStyle=t,e.fillRect(0,0,1,1);let r=e.getImageData(0,0,1,1).data;return r[3]===0?n:Ct(r[0],r[1],r[2],r[3]/255)},zt=e=>{let t=e.trim();if(!t)return null;if(t.toLowerCase()===`transparent`)return n;let r=Ot(t);if(r)return r;let i=Ft(t);if(i)return i;let a=Lt();if(!a)return null;a.fillStyle=kt,a.fillStyle=t;let o=a.fillStyle;return typeof o==`string`?o.toLowerCase()===kt?t.toLowerCase().replace(/\s+/g,``)===`rgba(0,0,0,0)`?n:null:o.startsWith(`#`)&&o.length===7?o:o.startsWith(`rgb`)?Tt(o):Rt(a,t):null},Bt=(e,t,n)=>Math.max(t,Math.min(e,n));let Y=null;const Vt=()=>{if(typeof navigator>`u`||!(`userAgentData`in navigator))return null;let e=navigator.userAgentData;if(typeof e!=`object`||!e||!(`platform`in e))return null;let t=e.platform;return typeof t==`string`?t:null},Ht=()=>{if(Y===null){if(typeof navigator>`u`)return Y=!1,Y;let e=navigator.platform??Vt()??navigator.userAgent;Y=/Mac|iPhone|iPad|iPod/i.test(e)}return Y},Ut=(e,t)=>{try{return e.composedPath().some(e=>l(e)&&e.hasAttribute(t))}catch{return!1}},Wt=`padding-top.padding-right.padding-bottom.padding-left.margin-top.margin-right.margin-bottom.margin-left.gap.row-gap.column-gap.font-size.line-height.letter-spacing.border-radius.border-top-left-radius.border-top-right-radius.border-bottom-right-radius.border-bottom-left-radius.border-width.border-top-width.border-right-width.border-bottom-width.border-left-width.opacity.width.height.min-width.min-height.max-width.max-height.top.right.bottom.left.z-index`.split(`.`),Gt=.5,Kt=384,qt=-128,Jt=-512,Yt=-9999,Xt=9999,Zt=new Set([`letter-spacing`,`gap`,`row-gap`,`column-gap`]),Qt=new Set([`z-index`]),$t=[{key:`padding`,label:`padding`,longhands:[`padding-top`,`padding-right`,`padding-bottom`,`padding-left`]},{key:`padding-top,padding-bottom`,label:`padding-y`,longhands:[`padding-top`,`padding-bottom`]},{key:`padding-left,padding-right`,label:`padding-x`,longhands:[`padding-left`,`padding-right`]},{key:`padding-top`,label:`padding top`,longhands:[`padding-top`]},{key:`padding-right`,label:`padding right`,longhands:[`padding-right`]},{key:`padding-bottom`,label:`padding bottom`,longhands:[`padding-bottom`]},{key:`padding-left`,label:`padding left`,longhands:[`padding-left`]}],en=[{key:`margin`,label:`margin`,longhands:[`margin-top`,`margin-right`,`margin-bottom`,`margin-left`]},{key:`margin-top,margin-bottom`,label:`margin-y`,longhands:[`margin-top`,`margin-bottom`]},{key:`margin-left,margin-right`,label:`margin-x`,longhands:[`margin-left`,`margin-right`]},{key:`margin-top`,label:`margin top`,longhands:[`margin-top`]},{key:`margin-right`,label:`margin right`,longhands:[`margin-right`]},{key:`margin-bottom`,label:`margin bottom`,longhands:[`margin-bottom`]},{key:`margin-left`,label:`margin left`,longhands:[`margin-left`]}],tn=[{key:`gap`,label:`gap`,longhands:[`row-gap`,`column-gap`]},{key:`row-gap`,label:`row gap`,longhands:[`row-gap`]},{key:`column-gap`,label:`column gap`,longhands:[`column-gap`]}],nn=[{key:`border-radius`,label:`border radius`,longhands:[`border-top-left-radius`,`border-top-right-radius`,`border-bottom-right-radius`,`border-bottom-left-radius`]},{key:`border-top-left-radius,border-top-right-radius`,label:`top corners`,longhands:[`border-top-left-radius`,`border-top-right-radius`]},{key:`border-bottom-left-radius,border-bottom-right-radius`,label:`bottom corners`,longhands:[`border-bottom-left-radius`,`border-bottom-right-radius`]},{key:`border-top-left-radius,border-bottom-left-radius`,label:`left corners`,longhands:[`border-top-left-radius`,`border-bottom-left-radius`]},{key:`border-top-right-radius,border-bottom-right-radius`,label:`right corners`,longhands:[`border-top-right-radius`,`border-bottom-right-radius`]},{key:`border-top-left-radius`,label:`top left radius`,longhands:[`border-top-left-radius`]},{key:`border-top-right-radius`,label:`top right radius`,longhands:[`border-top-right-radius`]},{key:`border-bottom-right-radius`,label:`bottom right radius`,longhands:[`border-bottom-right-radius`]},{key:`border-bottom-left-radius`,label:`bottom left radius`,longhands:[`border-bottom-left-radius`]}],rn=[{key:`top,right,bottom,left`,label:`inset`,longhands:[`top`,`right`,`bottom`,`left`]},{key:`top,bottom`,label:`inset-y`,longhands:[`top`,`bottom`]},{key:`left,right`,label:`inset-x`,longhands:[`left`,`right`]},{key:`top`,label:`top`,longhands:[`top`]},{key:`right`,label:`right`,longhands:[`right`]},{key:`bottom`,label:`bottom`,longhands:[`bottom`]},{key:`left`,label:`left`,longhands:[`left`]}],an=new Set(rn.map(e=>e.key)),on=[$t,en,tn,nn,[{key:`border-width`,label:`border width`,longhands:[`border-top-width`,`border-right-width`,`border-bottom-width`,`border-left-width`]},{key:`border-top-width`,label:`border top width`,longhands:[`border-top-width`]},{key:`border-right-width`,label:`border right width`,longhands:[`border-right-width`]},{key:`border-bottom-width`,label:`border bottom width`,longhands:[`border-bottom-width`]},{key:`border-left-width`,label:`border left width`,longhands:[`border-left-width`]}],[{key:`width,height`,label:`size`,longhands:[`width`,`height`]},{key:`width`,label:`width`,longhands:[`width`]},{key:`height`,label:`height`,longhands:[`height`]}],rn],sn=[{key:`font-size`,label:`font size`},{key:`line-height`,label:`line height`},{key:`letter-spacing`,label:`letter spacing`},{key:`min-width`,label:`min width`},{key:`min-height`,label:`min height`},{key:`max-width`,label:`max width`},{key:`max-height`,label:`max height`},{key:`z-index`,label:`z-index`},{key:`opacity`,label:`opacity`}],cn=[{key:`color`,label:`text color`,alwaysShow:!0},{key:`background-color`,label:`background`,alwaysShow:!0},{key:`border-color`,label:`border color`},{key:`fill`,label:`fill`},{key:`stroke`,label:`stroke`}],ln=[{value:`ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"`,label:`sans`},{value:`ui-serif, Georgia, Cambria, "Times New Roman", Times, serif`,label:`serif`},{value:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace`,label:`mono`},{value:`system-ui, sans-serif`,label:`system`},{value:`serif`,label:`serif`},{value:`monospace`,label:`mono`}],un=e=>{let t=e.trim();return ln.some(e=>e.value===t)?ln:[{value:t,label:`current`},...ln]},dn={key:`font-family`,label:`font family`},fn=[{key:`display`,label:`display`,options:[{value:`block`,label:`block`},{value:`flex`,label:`flex`},{value:`inline-block`,label:`inline-block`},{value:`inline`,label:`inline`},{value:`grid`,label:`grid`},{value:`none`,label:`none`}]},{key:`text-align`,label:`text align`,options:[{value:`left`,label:`left`},{value:`center`,label:`center`},{value:`right`,label:`right`},{value:`justify`,label:`justify`}]},{key:`font-style`,label:`font style`,options:[{value:`normal`,label:`normal`},{value:`italic`,label:`italic`}]},{key:`text-transform`,label:`text transform`,options:[{value:`none`,label:`none`},{value:`uppercase`,label:`uppercase`},{value:`lowercase`,label:`lowercase`},{value:`capitalize`,label:`capitalize`}]},{key:`white-space`,label:`white space`,options:[{value:`normal`,label:`normal`},{value:`nowrap`,label:`nowrap`},{value:`pre`,label:`pre`},{value:`pre-wrap`,label:`pre-wrap`},{value:`pre-line`,label:`pre-line`},{value:`break-spaces`,label:`break-spaces`}]},{key:`word-break`,label:`word break`,options:[{value:`normal`,label:`normal`},{value:`break-all`,label:`break-all`},{value:`keep-all`,label:`keep-all`}]},{key:`overflow-wrap`,label:`wrap`,options:[{value:`normal`,label:`normal`},{value:`break-word`,label:`break-word`},{value:`anywhere`,label:`anywhere`}]},{key:`font-variant-numeric`,label:`number style`,options:[{value:`normal`,label:`normal`},{value:`tabular-nums`,label:`tabular`},{value:`proportional-nums`,label:`proportional`},{value:`lining-nums`,label:`lining`},{value:`oldstyle-nums`,label:`oldstyle`},{value:`slashed-zero`,label:`slashed zero`}]},{key:`text-decoration-line`,label:`decoration`,options:[{value:`none`,label:`none`},{value:`underline`,label:`underline`},{value:`line-through`,label:`strike`}]},{key:`border-style`,label:`border style`,options:[{value:`none`,label:`none`},{value:`solid`,label:`solid`},{value:`dashed`,label:`dashed`},{value:`dotted`,label:`dotted`}]},{key:`visibility`,label:`visibility`,options:[{value:`visible`,label:`visible`},{value:`hidden`,label:`hidden`}]},{key:`align-items`,label:`align items`,options:[{value:`stretch`,label:`stretch`},{value:`flex-start`,label:`start`},{value:`center`,label:`center`},{value:`flex-end`,label:`end`},{value:`baseline`,label:`baseline`}]},{key:`justify-content`,label:`justify content`,options:[{value:`flex-start`,label:`start`},{value:`center`,label:`center`},{value:`flex-end`,label:`end`},{value:`space-between`,label:`between`},{value:`space-around`,label:`around`},{value:`space-evenly`,label:`evenly`}]},{key:`font-weight`,label:`font weight`,options:[{value:`100`,label:`thin`},{value:`200`,label:`extra-light`},{value:`300`,label:`light`},{value:`400`,label:`normal`},{value:`500`,label:`medium`},{value:`600`,label:`semibold`},{value:`700`,label:`bold`},{value:`800`,label:`extra-bold`},{value:`900`,label:`black`}]}],pn=[...Wt,`color`,`background-color`,`border-color`,`fill`,`stroke`,`font-family`,`display`,`text-align`,`font-style`,`text-transform`,`white-space`,`word-break`,`overflow-wrap`,`font-variant-numeric`,`text-decoration-line`,`border-style`,`visibility`,`align-items`,`justify-content`,`font-weight`],mn=e=>Number.isInteger(e)?e:Math.round(e*100)/100,hn=e=>Number.isInteger(e)?String(e):e.toFixed(2).replace(/\.?0+$/,``),gn=e=>Number.isFinite(e)?hn(mn(e)):String(e),_n=e=>Math.round(e),vn=(e,t)=>{if(e.kind===`color`||e.kind===`enum`)return typeof t==`string`?t:e.value;let n=typeof t==`number`?t:e.value;return e.key===`opacity`&&e.unit===`%`?hn(mn(n/100)):`${hn(mn(n))}${e.unit}`},yn={slate:{50:`#f8fafc`,100:`#f1f5f9`,200:`#e2e8f0`,300:`#cbd5e1`,400:`#94a3b8`,500:`#64748b`,600:`#475569`,700:`#334155`,800:`#1e293b`,900:`#0f172a`,950:`#020617`},gray:{50:`#f9fafb`,100:`#f3f4f6`,200:`#e5e7eb`,300:`#d1d5db`,400:`#9ca3af`,500:`#6b7280`,600:`#4b5563`,700:`#374151`,800:`#1f2937`,900:`#111827`,950:`#030712`},zinc:{50:`#fafafa`,100:`#f4f4f5`,200:`#e4e4e7`,300:`#d4d4d8`,400:`#a1a1aa`,500:`#71717a`,600:`#52525b`,700:`#3f3f46`,800:`#27272a`,900:`#18181b`,950:`#09090b`},neutral:{50:`#fafafa`,100:`#f5f5f5`,200:`#e5e5e5`,300:`#d4d4d4`,400:`#a3a3a3`,500:`#737373`,600:`#525252`,700:`#404040`,800:`#262626`,900:`#171717`,950:`#0a0a0a`},stone:{50:`#fafaf9`,100:`#f5f5f4`,200:`#e7e5e4`,300:`#d6d3d1`,400:`#a8a29e`,500:`#78716c`,600:`#57534e`,700:`#44403c`,800:`#292524`,900:`#1c1917`,950:`#0c0a09`},red:{50:`#fef2f2`,100:`#fee2e2`,200:`#fecaca`,300:`#fca5a5`,400:`#f87171`,500:`#ef4444`,600:`#dc2626`,700:`#b91c1c`,800:`#991b1b`,900:`#7f1d1d`,950:`#450a0a`},orange:{50:`#fff7ed`,100:`#ffedd5`,200:`#fed7aa`,300:`#fdba74`,400:`#fb923c`,500:`#f97316`,600:`#ea580c`,700:`#c2410c`,800:`#9a3412`,900:`#7c2d12`,950:`#431407`},amber:{50:`#fffbeb`,100:`#fef3c7`,200:`#fde68a`,300:`#fcd34d`,400:`#fbbf24`,500:`#f59e0b`,600:`#d97706`,700:`#b45309`,800:`#92400e`,900:`#78350f`,950:`#451a03`},yellow:{50:`#fefce8`,100:`#fef9c3`,200:`#fef08a`,300:`#fde047`,400:`#facc15`,500:`#eab308`,600:`#ca8a04`,700:`#a16207`,800:`#854d0e`,900:`#713f12`,950:`#422006`},lime:{50:`#f7fee7`,100:`#ecfccb`,200:`#d9f99d`,300:`#bef264`,400:`#a3e635`,500:`#84cc16`,600:`#65a30d`,700:`#4d7c0f`,800:`#3f6212`,900:`#365314`,950:`#1a2e05`},green:{50:`#f0fdf4`,100:`#dcfce7`,200:`#bbf7d0`,300:`#86efac`,400:`#4ade80`,500:`#22c55e`,600:`#16a34a`,700:`#15803d`,800:`#166534`,900:`#14532d`,950:`#052e16`},emerald:{50:`#ecfdf5`,100:`#d1fae5`,200:`#a7f3d0`,300:`#6ee7b7`,400:`#34d399`,500:`#10b981`,600:`#059669`,700:`#047857`,800:`#065f46`,900:`#064e3b`,950:`#022c22`},teal:{50:`#f0fdfa`,100:`#ccfbf1`,200:`#99f6e4`,300:`#5eead4`,400:`#2dd4bf`,500:`#14b8a6`,600:`#0d9488`,700:`#0f766e`,800:`#115e59`,900:`#134e4a`,950:`#042f2e`},cyan:{50:`#ecfeff`,100:`#cffafe`,200:`#a5f3fc`,300:`#67e8f9`,400:`#22d3ee`,500:`#06b6d4`,600:`#0891b2`,700:`#0e7490`,800:`#155e75`,900:`#164e63`,950:`#083344`},sky:{50:`#f0f9ff`,100:`#e0f2fe`,200:`#bae6fd`,300:`#7dd3fc`,400:`#38bdf8`,500:`#0ea5e9`,600:`#0284c7`,700:`#0369a1`,800:`#075985`,900:`#0c4a6e`,950:`#082f49`},blue:{50:`#eff6ff`,100:`#dbeafe`,200:`#bfdbfe`,300:`#93c5fd`,400:`#60a5fa`,500:`#3b82f6`,600:`#2563eb`,700:`#1d4ed8`,800:`#1e40af`,900:`#1e3a8a`,950:`#172554`},indigo:{50:`#eef2ff`,100:`#e0e7ff`,200:`#c7d2fe`,300:`#a5b4fc`,400:`#818cf8`,500:`#6366f1`,600:`#4f46e5`,700:`#4338ca`,800:`#3730a3`,900:`#312e81`,950:`#1e1b4b`},violet:{50:`#f5f3ff`,100:`#ede9fe`,200:`#ddd6fe`,300:`#c4b5fd`,400:`#a78bfa`,500:`#8b5cf6`,600:`#7c3aed`,700:`#6d28d9`,800:`#5b21b6`,900:`#4c1d95`,950:`#2e1065`},purple:{50:`#faf5ff`,100:`#f3e8ff`,200:`#e9d5ff`,300:`#d8b4fe`,400:`#c084fc`,500:`#a855f7`,600:`#9333ea`,700:`#7e22ce`,800:`#6b21a8`,900:`#581c87`,950:`#3b0764`},fuchsia:{50:`#fdf4ff`,100:`#fae8ff`,200:`#f5d0fe`,300:`#f0abfc`,400:`#e879f9`,500:`#d946ef`,600:`#c026d3`,700:`#a21caf`,800:`#86198f`,900:`#701a75`,950:`#4a044e`},pink:{50:`#fdf2f8`,100:`#fce7f3`,200:`#fbcfe8`,300:`#f9a8d4`,400:`#f472b6`,500:`#ec4899`,600:`#db2777`,700:`#be185d`,800:`#9d174d`,900:`#831843`,950:`#500724`},rose:{50:`#fff1f2`,100:`#ffe4e6`,200:`#fecdd3`,300:`#fda4af`,400:`#fb7185`,500:`#f43f5e`,600:`#e11d48`,700:`#be123c`,800:`#9f1239`,900:`#881337`,950:`#4c0519`}},bn={p:`padding`,px:`padding-left,padding-right`,py:`padding-top,padding-bottom`,pt:`padding-top`,pr:`padding-right`,pb:`padding-bottom`,pl:`padding-left`,ps:`padding-left`,pe:`padding-right`,m:`margin`,mx:`margin-left,margin-right`,my:`margin-top,margin-bottom`,mt:`margin-top`,mr:`margin-right`,mb:`margin-bottom`,ml:`margin-left`,ms:`margin-left`,me:`margin-right`,gap:`gap`,"gap-x":`column-gap`,"gap-y":`row-gap`,text:`font-size`,leading:`line-height`,tracking:`letter-spacing`,rounded:`border-radius`,"rounded-t":`border-top-left-radius,border-top-right-radius`,"rounded-b":`border-bottom-left-radius,border-bottom-right-radius`,"rounded-l":`border-top-left-radius,border-bottom-left-radius`,"rounded-r":`border-top-right-radius,border-bottom-right-radius`,"rounded-tl":`border-top-left-radius`,"rounded-tr":`border-top-right-radius`,"rounded-bl":`border-bottom-left-radius`,"rounded-br":`border-bottom-right-radius`,border:`border-width`,"border-t":`border-top-width`,"border-r":`border-right-width`,"border-b":`border-bottom-width`,"border-l":`border-left-width`,w:`width`,h:`height`,size:`width,height`,"max-w":`max-width`,"max-h":`max-height`,"min-w":`min-width`,"min-h":`min-height`,opacity:`opacity`,inset:`top,right,bottom,left`,"inset-x":`left,right`,"inset-y":`top,bottom`,top:`top`,right:`right`,bottom:`bottom`,left:`left`,z:`z-index`,items:`align-items`,justify:`justify-content`,font:`font-weight`,whitespace:`white-space`},xn={"font-size":[`font-size`,`font size`,`text-size`,`text size`],color:[`color`,`text-color`,`text color`,`text-colour`,`text colour`,`foreground`,`fg`],"background-color":[`background`,`background-color`,`background color`,`bg`,`bg-color`,`bg color`],"border-color":[`border-color`,`border color`],fill:[`fill`,`fill-color`,`fill color`],stroke:[`stroke`,`stroke-color`,`stroke color`],"font-family":[`font`,`font-sans`,`font-serif`,`font-mono`,`family`,`sans`,`serif`,`mono`],"font-style":[`italic`,`not-italic`],"text-align":[`text-left`,`text-center`,`text-right`,`text-justify`],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-decoration-line":[`underline`,`line-through`,`no-underline`],"white-space":[`whitespace`,`whitespace-normal`,`whitespace-nowrap`,`whitespace-pre`],"word-break":[`break-normal`,`break-all`,`break-keep`],"overflow-wrap":[`break-words`,`break-anywhere`],"font-variant-numeric":[`tabular-nums`,`proportional-nums`,`lining-nums`,`oldstyle-nums`],"border-style":[`border-solid`,`border-dashed`,`border-dotted`,`border-none`]},Sn=(()=>{let e={};for(let[t,n]of Object.entries(bn))n!==void 0&&(e[n]??=new Set).add(t);let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=Array.from(r));for(let[e,n]of Object.entries(xn)){let r=new Set([...t[e]??[],...n]);t[e]=Array.from(r)}return t})(),Cn={text:`color`,bg:`background-color`,border:`border-color`,"border-x":`border-color`,"border-y":`border-color`,"border-t":`border-color`,"border-r":`border-color`,"border-b":`border-color`,"border-l":`border-color`,"border-s":`border-color`,"border-e":`border-color`,fill:`fill`,stroke:`stroke`},wn=e=>bn[e]!==void 0||Cn[e]!==void 0,X=e=>{let t=0,n=-1;for(let r=0;r<e.length;r++){let i=e[r];i===`[`?t++:i===`]`?t--:i===`:`&&t===0&&(n=r)}let r=n>=0?e.slice(n+1):e;return r.startsWith(`!`)?r.slice(1):r},Z=e=>{let t=X(e);if(!t)return null;let n=t.indexOf(`[`);if(n>0)return t.slice(0,n).replace(/-$/,``)||null;let r=t.split(`-`).filter(Boolean);if(r.length===0)return null;for(let e=r.length;e>=1;e--){let t=r.slice(0,e).join(`-`);if(wn(t))return t}return r[0]},Tn=/-(red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose|slate|gray|zinc|neutral|stone|black|white|transparent|current|inherit)\b/,En=(e,t)=>e!==`text`&&e!==`bg`&&e!==`border`&&!e.startsWith(`border-`)?!1:Tn.test(t),Dn=new Set(`color.red.orange.amber.yellow.lime.green.emerald.teal.cyan.sky.blue.indigo.violet.purple.fuchsia.pink.rose.slate.gray.grey.zinc.neutral.stone.black.white.transparent.current.currentcolor.inherit.primary.secondary.accent.muted.foreground.background.destructive.success.warning.error.info.card.popover.input.ring`.split(`.`)),On=new Set([`xs`,`sm`,`base`,`lg`,`xl`,`2xl`,`3xl`,`4xl`,`5xl`,`6xl`,`7xl`,`8xl`,`9xl`]),kn=/^(#|rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color:|color\(|var\(--.*color)/,An=/^(-?\d|length:|size:)/,Q=e=>e.trim().toLowerCase().replace(/\s+/g,`-`).replace(/([a-z])(\d)/g,`$1-$2`),jn=e=>kn.test(e)&&!An.test(e),$=(e,t)=>{if(e===t)return``;let n=`${t}-`;return e.startsWith(n)?e.slice(n.length):null},Mn=e=>{let t=X(Q(e)),n=Z(t);if(!n)return null;let r=Cn[n];if(!r)return null;let i=t.indexOf(`[`);if(i>=0)return jn(t.slice(i+1).replace(/\]$/,``))?r:null;let a=$(t,n);if(a===null)return null;if(n===`bg`&&a===``||(n===`fill`||n===`stroke`)&&a===``)return r;let o=a.split(`-`)[0];return n===`text`&&On.has(o)?null:Dn.has(o)?r:null},Nn={black:`#000000`,white:`#ffffff`,transparent:n},Pn=e=>{let t=X(Q(e)),n=Z(t);if(!n||Cn[n]===void 0||t.includes(`[`))return null;let r=$(t,n);if(!r)return null;let i=Nn[r];if(i)return i;let a=r.lastIndexOf(`-`);if(a<0)return null;let o=r.slice(0,a),s=o===`grey`?`gray`:o,c=Number.parseInt(r.slice(a+1),10);return yn[s]?.[c]??null},Fn=/^-?\d/,In=(e,t)=>{if(t===``||t.startsWith(`[`)||Fn.test(t))return!0;let n=t.split(`-`)[0];return e===`text`?On.has(n):e===`font`||e===`border`||e.startsWith(`border-`)?!1:(e===`rounded`||e.startsWith(`rounded-`),!0)},Ln={"font-sans":{property:`font-family`,value:`ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"`},"font-serif":{property:`font-family`,value:`ui-serif, Georgia, Cambria, "Times New Roman", Times, serif`},"font-mono":{property:`font-family`,value:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace`},"font-thin":{property:`font-weight`,value:`100`},"font-extralight":{property:`font-weight`,value:`200`},"font-light":{property:`font-weight`,value:`300`},"font-normal":{property:`font-weight`,value:`400`},"font-medium":{property:`font-weight`,value:`500`},"font-semibold":{property:`font-weight`,value:`600`},"font-bold":{property:`font-weight`,value:`700`},"font-extrabold":{property:`font-weight`,value:`800`},"font-black":{property:`font-weight`,value:`900`},"text-left":{property:`text-align`,value:`left`},"text-center":{property:`text-align`,value:`center`},"text-right":{property:`text-align`,value:`right`},"text-justify":{property:`text-align`,value:`justify`},italic:{property:`font-style`,value:`italic`},"not-italic":{property:`font-style`,value:`normal`},uppercase:{property:`text-transform`,value:`uppercase`},lowercase:{property:`text-transform`,value:`lowercase`},capitalize:{property:`text-transform`,value:`capitalize`},"normal-case":{property:`text-transform`,value:`none`},underline:{property:`text-decoration-line`,value:`underline`},"line-through":{property:`text-decoration-line`,value:`line-through`},"no-underline":{property:`text-decoration-line`,value:`none`},"whitespace-normal":{property:`white-space`,value:`normal`},"whitespace-nowrap":{property:`white-space`,value:`nowrap`},"whitespace-pre":{property:`white-space`,value:`pre`},"whitespace-pre-line":{property:`white-space`,value:`pre-line`},"whitespace-pre-wrap":{property:`white-space`,value:`pre-wrap`},"whitespace-break-spaces":{property:`white-space`,value:`break-spaces`},"break-normal":{property:`word-break`,value:`normal`},"break-all":{property:`word-break`,value:`break-all`},"break-keep":{property:`word-break`,value:`keep-all`},"break-words":{property:`overflow-wrap`,value:`break-word`},"break-anywhere":{property:`overflow-wrap`,value:`anywhere`},"tabular-nums":{property:`font-variant-numeric`,value:`tabular-nums`},"proportional-nums":{property:`font-variant-numeric`,value:`proportional-nums`},"lining-nums":{property:`font-variant-numeric`,value:`lining-nums`},"oldstyle-nums":{property:`font-variant-numeric`,value:`oldstyle-nums`},"slashed-zero":{property:`font-variant-numeric`,value:`slashed-zero`},"border-solid":{property:`border-style`,value:`solid`},"border-dashed":{property:`border-style`,value:`dashed`},"border-dotted":{property:`border-style`,value:`dotted`},"border-none":{property:`border-style`,value:`none`}},Rn=e=>{let t=Q(e);if(!t)return[];let n=Un(t);if(n)return[n.property];let r=Mn(t);return r?[r]:[]},zn=e=>{let t=Q(e);if(!t)return[];let n=Z(t);if(!n)return[];let r=$(X(t),n);if(r===null||!In(n,r))return[];let i=Hn(n);return i?[i]:[]},Bn=e=>{let t=e.getAttribute(`class`);if(!t)return new Set;let n=t.split(/\s+/).filter(Boolean),r=new Set;for(let e of n){let t=Z(e);if(!t||En(t,e))continue;let n=Un(e);if(n){r.add(n.property);continue}let i=Hn(t);i&&r.add(i)}return r},Vn=e=>Sn[e]??[],Hn=e=>{let t=bn[e];return t===void 0?null:t},Un=e=>{let t=Ln[X(e)];return t===void 0?null:t},Wn=`react-grab-toolbar-state`,Gn=()=>{try{let e=localStorage.getItem(Wn);if(!e)return null;let t=JSON.parse(e);if(typeof t!=`object`||!t)return null;let n=t,r=typeof n.collapsed==`boolean`?n.collapsed:!1;return{edge:n.edge===`top`||n.edge===`bottom`||n.edge===`left`||n.edge===`right`?n.edge:`bottom`,ratio:typeof n.ratio==`number`?n.ratio:s,collapsed:r,enabled:!r,defaultAction:typeof n.defaultAction==`string`?n.defaultAction:a}}catch(e){console.warn(`[react-grab] Failed to load toolbar state from localStorage:`,e)}return null},Kn=e=>{try{localStorage.setItem(Wn,JSON.stringify(e))}catch(e){console.warn(`[react-grab] Failed to save toolbar state to localStorage:`,e)}},qn=e=>{let[t,n]=D(!1);return ae(()=>{let t=c(t=>n(e(t))),r=()=>n(!1);window.addEventListener(`keydown`,t,{capture:!0}),window.addEventListener(`keyup`,t,{capture:!0}),window.addEventListener(`blur`,r),N(()=>{window.removeEventListener(`keydown`,t,{capture:!0}),window.removeEventListener(`keyup`,t,{capture:!0}),window.removeEventListener(`blur`,r)})}),t},Jn=e=>e.key===`Enter`,Yn=e=>e.metaKey||e.ctrlKey,Xn=(e,t,n={})=>{if(!t.key)return null;if(Jn(t))return e.find(e=>e.shortcut===`Enter`)??null;if(t.repeat)return null;let r=t.key.toLowerCase();return Yn(t)?n.includeModifierShortcuts===!0?e.find(e=>e.shortcut!==void 0&&e.shortcut!==`Enter`&&e.shortcutModifier!==!1&&r===e.shortcut.toLowerCase())??null:null:e.find(e=>e.shortcut!==void 0&&e.shortcutModifier===!1&&r===e.shortcut.toLowerCase())??null},Zn=()=>{let e=!1;return{arm:()=>{e=!0},clear:()=>{e=!1},consume:()=>e?(e=!1,!0):!1}},Qn=e=>e??!0,$n=(e,t)=>{if(typeof e.enabled==`function`){if(!t)return!1;try{return e.enabled(t)}catch(t){return o(new r(e.id,t)),!1}}return Qn(e.enabled)},er=(e,t)=>{if(!$n(e,t))return!1;try{let n=e.onAction(t);n&&n.catch(t=>{o(new i(e.id,t))})}catch(t){o(new i(e.id,t))}return!0};export{Xe as $,sn as A,M as At,zt as B,cn as C,se as Ct,qt as D,N as Dt,dn as E,ie as Et,Yt as F,yt as G,wt as H,un as I,rt as J,gt as K,Ut as L,Wt as M,Qt as N,an as O,ae as Ot,Xt as P,qe as Q,Ht as R,pn as S,oe as St,Zt as T,Me as Tt,bt as U,Et as V,xt as W,Qe as X,tt as Y,ct as Z,gn as _,A as _t,qn as a,st as at,on as b,E as bt,Bn as c,Fe as ct,Pn as d,Le as dt,W as et,zn as f,Re as ft,Hn as g,k as gt,Un as h,de as ht,Xn as i,Ze as it,Kt as j,fe as jt,Jt as k,Ne as kt,Vn as l,Ie as lt,Q as m,Oe as mt,$n as n,ot as nt,Gn as o,m as ot,Rn as p,re as pt,nt as q,Zn as r,it as rt,Kn as s,g as st,er as t,at as tt,Mn as u,ze as ut,vn as v,O as vt,fn as w,Ee as wt,Gt as x,D as xt,_n as y,j as yt,Bt as z};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2025 Aiden Bai
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
let e=null;const t=()=>{if(e!==null)return e;try{e=window.matchMedia(`(color-gamut: p3)`).matches}catch{e=!1}return e},n=t(),r=e=>n?`color(display-p3 0.84 0.19 0.78 / ${e})`:`rgba(210, 57, 192, ${e})`,i=[`/components/ui/`,`/packages/ui/`,`/design-system/`,`/design-systems/`,`/primitives/`],a=r(.4),o=r(.05),s=r(.5),c=r(.08),l=r(.15),u=[`id`,`class`,`aria-label`,`data-testid`,`role`,`name`,`title`],d=new Set([`id`,`data-testid`,`aria-label`,`href`,`src`,`alt`,`type`,`name`,`placeholder`,`role`,`for`,`action`,`method`,`title`,`disabled`,`checked`,`readonly`,`required`,`selected`,`open`]),f=new Set([`a`,`code`,`pre`]),p=new Set([`script`,`style`,`template`,`noscript`]),ee=[`Meta`,`Control`,`Shift`,`Alt`],m=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`]),h=`data-react-grab-frozen`,te=`data-react-grab-same-origin-frame`,ne={left:-9999,top:-9999},re={left:`left center`,right:`right center`,top:`center top`,bottom:`center bottom`},ie=new Set(`display.position.top.right.bottom.left.z-index.overflow.overflow-x.overflow-y.width.height.min-width.min-height.max-width.max-height.margin-top.margin-right.margin-bottom.margin-left.padding-top.padding-right.padding-bottom.padding-left.flex-direction.flex-wrap.justify-content.align-items.align-self.align-content.flex-grow.flex-shrink.flex-basis.order.gap.row-gap.column-gap.grid-template-columns.grid-template-rows.grid-template-areas.font-family.font-size.font-weight.font-style.line-height.letter-spacing.text-align.text-decoration-line.text-decoration-style.text-transform.text-overflow.text-shadow.white-space.word-break.overflow-wrap.vertical-align.color.background-color.background-image.background-position.background-size.background-repeat.border-top-width.border-right-width.border-bottom-width.border-left-width.border-top-style.border-right-style.border-bottom-style.border-left-style.border-top-color.border-right-color.border-bottom-color.border-left-color.border-top-left-radius.border-top-right-radius.border-bottom-left-radius.border-bottom-right-radius.box-shadow.opacity.transform.filter.backdrop-filter.object-fit.object-position`.split(`.`)),ae=e=>typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE,g=e=>ae(e)&&e.namespaceURI===`http://www.w3.org/1999/xhtml`,_=e=>g(e)&&e.tagName===`IFRAME`,oe=new WeakMap,v=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?t:0},se=e=>{let t=performance.now(),n=oe.get(e);if(n&&t-n.timestamp<16)return n.metrics;let r=e.ownerDocument.defaultView?.getComputedStyle(e),i;if(!r)i={contentOffsetX:e.clientLeft,contentOffsetY:e.clientTop,height:e.offsetHeight,width:e.offsetWidth};else{let t=v(r.borderLeftWidth),n=v(r.borderRightWidth),a=v(r.borderTopWidth),o=v(r.borderBottomWidth),s=v(r.paddingLeft),c=v(r.paddingRight),l=v(r.paddingTop),u=v(r.paddingBottom),d=v(r.width),f=v(r.height),p=t+n+s+c,ee=a+o+l+u,m=r.boxSizing===`border-box`?d:d+p,h=r.boxSizing===`border-box`?f:f+ee;i={contentOffsetX:t+s,contentOffsetY:a+l,height:h>0?h:e.offsetHeight,width:m>0?m:e.offsetWidth}}return oe.set(e,{metrics:i,timestamp:t}),i},ce=(e,t)=>t>0?e/t:1,le=e=>{if(!e)return null;try{return e.frameElement}catch{return null}},ue=(e,t,n)=>{let r=t,i=n,a=1,o=1,s=e;for(;s&&s!==window;){let e=le(s);if(!e||!_(e))break;let t=e.getBoundingClientRect(),n=se(e),c=ce(t.width,n.width),l=ce(t.height,n.height);r=t.left+(n.contentOffsetX+r)*c,i=t.top+(n.contentOffsetY+i)*l,a*=c,o*=l,s=e.ownerDocument.defaultView}return{x:r,y:i,scaleX:a,scaleY:o}},de=e=>{let t=e.ownerDocument.defaultView;return t?t.getComputedStyle(e):window.getComputedStyle(e)},fe=(e,t)=>e.replace(/([\d.]+)px/g,(e,n)=>{let r=Number(n)*Math.abs(t);return`${Number(r.toFixed(3))}px`}),pe=(e,t,n)=>{let[r,i]=e.split(`/`).map(e=>e.trim()),a=fe(r,t),o=fe(i??r,n);return i===void 0&&a===o?a:`${a} / ${o}`},me=e=>Object.assign(e,{[Symbol.dispose]:e}),he=`bippy-0.6.1`,ge=Object.defineProperty,_e=Object.prototype.hasOwnProperty,y=()=>{},ve=e=>{try{Function.prototype.toString.call(e).indexOf(`^_^`)>-1&&setTimeout(()=>{throw Error(`React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://reactjs.org/link/perf-use-production-build`)})}catch{}},ye=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>!!(e&&`getFiberRoots`in e);let be=!1,xe;const Se=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>be?!0:(e&&typeof e.inject==`function`&&(xe=e.inject.toString()),!!xe?.includes(`(injected)`)),b=new Set,Ce=new Set,we=e=>{e&&b.add(e);let t=new Map,n=0,r={_instrumentationIsActive:!1,_instrumentationSource:he,checkDCE:ve,hasUnsupportedRendererAttached:!1,inject(e){let i=++n;return t.set(i,e),Ce.add(e),r._instrumentationIsActive||(r._instrumentationIsActive=!0,b.forEach(e=>e())),i},on:y,onCommitFiberRoot:y,onCommitFiberUnmount:y,onPostCommitFiberRoot:y,renderers:t,supportsFiber:!0,supportsFlight:!0};try{ge(globalThis,`__REACT_DEVTOOLS_GLOBAL_HOOK__`,{configurable:!0,enumerable:!0,get(){return r},set(t){if(t&&typeof t==`object`){let n=r.renderers;r=t,n.size>0&&(n.forEach((e,n)=>{Ce.add(e),t.renderers.set(n,e)}),Te(e))}}});let t=window.hasOwnProperty,n=!1;ge(window,`hasOwnProperty`,{configurable:!0,value:function(...e){try{if(!n&&e[0]===`__REACT_DEVTOOLS_GLOBAL_HOOK__`)return globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__=void 0,n=!0,-0}catch{}return t.apply(this,e)},writable:!0})}catch{Te(e)}return r},Te=e=>{e&&b.add(e);try{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t)return;if(!t._instrumentationSource){t.checkDCE=ve,t.supportsFiber=!0,t.supportsFlight=!0,t.hasUnsupportedRendererAttached=!1,t._instrumentationSource=he,t._instrumentationIsActive=!1;let e=ye(t);if(e||(t.on=y),t.renderers.size){t._instrumentationIsActive=!0,b.forEach(e=>e());return}let n=t.inject,r=Se(t);r&&!e&&(be=!0,t.inject({scheduleRefresh(){}})&&(t._instrumentationIsActive=!0)),t.inject=e=>{let i=n(e);return Ce.add(e),r&&t.renderers.set(i,e),t._instrumentationIsActive=!0,b.forEach(e=>e()),i}}(t.renderers.size||t._instrumentationIsActive||Se())&&e?.()}catch{}},Ee=()=>_e.call(globalThis,`__REACT_DEVTOOLS_GLOBAL_HOOK__`),x=e=>Ee()?(Te(e),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):we(e),De=()=>!!(typeof window<`u`&&(window.document?.createElement||window.navigator?.product===`ReactNative`));
|
|
10
|
+
/**
|
|
11
|
+
* @license bippy
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Aiden Bai
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/
|
|
18
|
+
(()=>{try{De()&&x()}catch{}})();
|
|
19
|
+
/**
|
|
20
|
+
* @license bippy
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) Aiden Bai
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/
|
|
27
|
+
const Oe=e=>{switch(e.tag){case 5:case 26:case 27:return!0;default:return typeof e.type==`string`}},ke=e=>{switch(e.tag){case 1:case 11:case 0:case 14:case 15:return!0;default:return!1}},Ae=e=>!e||typeof e!=`object`?!1:`pendingProps`in e&&!(`containerInfo`in e),je=e=>{let t=e.memoizedProps,n=e.alternate?.memoizedProps||{},r=e.flags??e.effectTag??0;switch(e.tag){case 1:case 9:case 11:case 0:case 14:case 15:return(r&1)==1;default:return e.alternate?n!==t||e.alternate.memoizedState!==e.memoizedState||e.alternate.ref!==e.ref:!0}},Me=e=>{switch(e.tag){case 18:return!0;case 7:case 6:case 23:case 22:return!0;case 3:return!1;default:{let t=typeof e.type==`object`&&e.type!==null?e.type.$$typeof:e.type;if(typeof t==`symbol`)return t.description===`react.concurrent_mode`||t.description===`react.async_mode`;switch(t){case 60111:case`Symbol(react.concurrent_mode)`:case`Symbol(react.async_mode)`:return!0;default:return!1}}}},Ne=e=>{let t=[],n=[];for(Oe(e)?t.push(e):e.child&&n.push(e.child);n.length;){let e=n.pop();if(!e)break;Oe(e)?t.push(e):e.child&&n.push(e.child),e.sibling&&n.push(e.sibling)}return t};function Pe(e,t,n=!1){if(!e)return null;let r=t(e);if(r instanceof Promise)return(async()=>{if(await r===!0)return e;let i=n?e.return:e.child;for(;i;){let e=await Ie(i,t,n);if(e)return e;i=n?null:i.sibling}return null})();if(r===!0)return e;let i=n?e.return:e.child;for(;i;){let e=Fe(i,t,n);if(e)return e;i=n?null:i.sibling}return null}const Fe=(e,t,n=!1)=>{if(!e)return null;if(t(e)===!0)return e;let r=n?e.return:e.child;for(;r;){let e=Fe(r,t,n);if(e)return e;r=n?null:r.sibling}return null},Ie=async(e,t,n=!1)=>{if(!e)return null;if(await t(e)===!0)return e;let r=n?e.return:e.child;for(;r;){let e=await Ie(r,t,n);if(e)return e;r=n?null:r.sibling}return null},Le=e=>{let t=e;return typeof t==`function`?t:typeof t==`object`&&t?Le(t.type||t.render):null},Re=e=>{let t=e;if(typeof t==`string`)return t;if(typeof t!=`function`&&!(typeof t==`object`&&t))return null;let n=t.displayName||t.name||null;if(n)return n;let r=Le(t);return r&&(r.displayName||r.name)||null},ze=()=>{let e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;return!!e?._instrumentationIsActive||ye(e)||Se(e)},Be=new Set,Ve=e=>{let t=e.alternate;if(!t)return e;if(t.actualStartTime&&e.actualStartTime)return t.actualStartTime>e.actualStartTime?t:e;for(let t of Be){let n=Pe(t.current,t=>{if(t===e)return!0});if(n)return n}return e};let He=0;const S=new WeakMap,Ue=(e,t=He++)=>{S.set(e,t)},We=e=>{let t=S.get(e);return t===void 0&&e.alternate&&(t=S.get(e.alternate)),t===void 0&&(t=He++,Ue(e,t)),t},C=(e,t,n)=>{let r=t;for(;r!=null;){if(S.has(r)||We(r),!Me(r)&&je(r)&&e(r,`mount`),r.tag===13)if(r.memoizedState!==null){let t=r.child,n=t?t.sibling:null;if(n){let t=n.child;t!==null&&C(e,t,!1)}}else{let t=null;r.child!==null&&(t=r.child.child),t!==null&&C(e,t,!1)}else r.child!=null&&C(e,r.child,!0);r=n?r.sibling:null}},Ge=(e,t,n,r)=>{if(S.has(t)||We(t),!n)return;S.has(n)||We(n);let i=t.tag===13,a=!Me(t);a&&je(t)&&e(t,`update`);let o=i&&n.memoizedState!==null,s=i&&t.memoizedState!==null;if(o&&s){let r=t.child?.sibling??null,i=n.child?.sibling??null;r!==null&&i!==null&&Ge(e,r,i,t)}else if(o&&!s){let n=t.child;n!==null&&C(e,n,!0)}else if(!o&&s){qe(e,n);let r=t.child?.sibling??null;r!==null&&C(e,r,!0)}else if(t.child!==n.child){let n=t.child;for(;n;){if(n.alternate){let i=n.alternate;Ge(e,n,i,a?t:r)}else C(e,n,!1);n=n.sibling}}},Ke=(e,t)=>{(t.tag===3||!Me(t))&&e(t,`unmount`)},qe=(e,t)=>{let n=t.tag===13&&t.memoizedState!==null,r=t.child;for(n&&(r=(t.child?.sibling??null)?.child??null);r!==null;)r.return!==null&&(Ke(e,r),qe(e,r)),r=r.sibling},Je=e=>{if(!Ee())return null;let t=e;for(;t.return;)t=t.return;let n=tt.get(t.stateNode);return n===void 0?null:x().renderers?.get(n)??null},Ye=e=>Object.prototype.toString.call(e)===`[object Object]`&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null),Xe=(e,t=[])=>{if(!Ye(e))return[{path:t,value:e}];let n=[];for(let r in e){let i=e[r],a=t.concat(r);Ye(i)?n.push(...Xe(i,a)):n.push({path:a,value:i})}return n},Ze=new Set,Qe=new Set,$e=new Set,et=new Set,w=new WeakMap,tt=new WeakMap,nt=e=>{let t=w.get(e)??{};if(w.set(e,t),!t.onCommitFiberRoot||e.onCommitFiberRoot!==t.onCommitFiberRoot){let n=e.onCommitFiberRoot,r=(t,i,a)=>{if(n?.(t,i,a),w.get(e)?.onCommitFiberRoot===r){Be.add(i),tt.set(i,t);for(let e of Ze)e(t,i,a)}};t.onCommitFiberRoot=r,e.onCommitFiberRoot=r}if(!t.onCommitFiberUnmount||e.onCommitFiberUnmount!==t.onCommitFiberUnmount){let n=e.onCommitFiberUnmount,r=(t,i)=>{if(n?.(t,i),w.get(e)?.onCommitFiberUnmount===r)for(let e of Qe)e(t,i)};t.onCommitFiberUnmount=r,e.onCommitFiberUnmount=r}if(!t.onPostCommitFiberRoot||e.onPostCommitFiberRoot!==t.onPostCommitFiberRoot){let n=e.onPostCommitFiberRoot,r=(t,i)=>{if(n?.(t,i),w.get(e)?.onPostCommitFiberRoot===r)for(let e of $e)e(t,i)};t.onPostCommitFiberRoot=r,e.onPostCommitFiberRoot=r}if(!t.onScheduleFiberRoot||e.onScheduleFiberRoot!==t.onScheduleFiberRoot){let n=e.onScheduleFiberRoot,r=(t,i,a)=>{if(n?.(t,i,a),w.get(e)?.onScheduleFiberRoot===r)for(let e of et)e(t,i,a)};t.onScheduleFiberRoot=r,e.onScheduleFiberRoot=r}},rt=e=>{let t=x(e.onActive);t._instrumentationSource=e.name??he,nt(t);let{onActive:n,onCommitFiberRoot:r,onCommitFiberUnmount:i,onPostCommitFiberRoot:a,onScheduleFiberRoot:o}=e;return r&&Ze.add(r),i&&Qe.add(i),a&&$e.add(a),o&&et.add(o),me(()=>{n&&b.delete(n),r&&Ze.delete(r),i&&Qe.delete(i),a&&$e.delete(a),o&&et.delete(o)})},it=new Set,at=e=>e.startsWith(`__reactContainer$`)||e.startsWith(`__reactInternalInstance$`)||e.startsWith(`__reactFiber`),ot=e=>{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t?.renderers)for(let n of t.renderers.values())try{let t=n.findFiberByHostInstance?.(e);if(t)return t}catch{}if(typeof e==`object`&&e){if(`_reactRootContainer`in e)return e._reactRootContainer?._internalRoot?.current?.child;let t=e.__internalInstanceHandle??e._internalInstanceHandle;if(Ae(t))return t;let n=e;for(let e of it){let t=n[e];if(t)return t}for(let e of Object.keys(n))if(at(e))return it.add(e),n[e]||null;for(let t of Be){if(Je(t.current)?.findFiberByHostInstance)continue;let n=Pe(t.current,t=>t.stateNode===e);if(n)return n}}return null},st=new WeakMap,ct=(e,t)=>{st.set(e,t)},T=e=>st.get(e)??null,lt=e=>T(e)?.getFiber()??ot(e);let ut=new WeakMap,dt=new WeakMap;const ft=()=>{ut=new WeakMap,dt=new WeakMap},pt=(e,t,n)=>{let r=dt.get(e);if(r&&n-r.timestamp<200)return r.borderRadius;let i=(t??de(e)).borderRadius||`0px`;return dt.set(e,{borderRadius:i,timestamp:n}),i},mt=e=>{let t=performance.now(),n=ut.get(e);if(n&&t-n.timestamp<16)return n.bounds;let r=T(e);if(r){let n=r.getBounds();return ut.set(e,{bounds:n,timestamp:t}),n}let i=e.getBoundingClientRect(),a=ue(e.ownerDocument.defaultView,i.left,i.top),o={borderRadius:pe(pt(e,null,t),a.scaleX,a.scaleY),height:i.height*a.scaleY,width:i.width*a.scaleX,x:a.x,y:a.y};return ut.set(e,{bounds:o,timestamp:t}),o},ht=e=>{let t=e.ownerDocument?.defaultView;return!!(t&&e instanceof t.ShadowRoot)};var E=class extends Error{constructor(e,t){super(e,t),this.name=`ReactGrabError`}},D=class extends E{constructor(e,t){super(e,{cause:t}),this.name=`RecoverableError`}},gt=class extends E{constructor(e){super(`Failed to freeze page`,{cause:e}),this.name=`FreezeError`}},_t=class extends D{constructor(e,t,n){super(`Failed to open source file "${e}"`,n),this.name=`OpenFileError`,this.filePath=e,this.lineNumber=t}},vt=class extends D{constructor(e,t,n){super(`Plugin hook "${t}" failed for "${e}"`,n),this.name=`PluginHookError`,this.pluginName=e,this.hookName=t}},yt=class extends D{constructor(e,t){super(`Plugin cleanup failed for "${e}"`,t),this.name=`PluginCleanupError`,this.pluginName=e}},bt=class extends D{constructor(e,t){super(`Plugin setup failed for "${e}"`,t),this.name=`PluginSetupError`,this.pluginName=e}},xt=class extends D{constructor(e,t){super(`Action "${e}" failed`,t),this.name=`ContextMenuActionError`,this.actionId=e}},St=class extends D{constructor(e,t){super(`Action "${e}" enabled check failed`,t),this.name=`ContextMenuActionEnabledError`,this.actionId=e}},Ct=class extends E{constructor(){super(`Can't generate CSS selector for non-element node type.`),this.name=`NonElementNodeError`}},wt=class extends E{constructor(e){super(`Timeout: Can't find a unique selector after ${e}ms`),this.name=`SelectorTimeoutError`,this.timeoutMs=e}},Tt=class extends E{constructor(){super(`Selector was not found.`),this.name=`SelectorNotFoundError`}},Et=class extends E{constructor(){super(`Failed to copy`),this.name=`CopyFailedError`}};const Dt=e=>T(e)?.getTagName()??(e.tagName||``).toLowerCase(),Ot=new WeakMap,kt=(e=document)=>{let t=Ot.get(e);if(t!==void 0)return t;let n=e.querySelector(`script[nonce], style[nonce]`),r=n?.nonce||n?.getAttribute(`nonce`)||null;return r&&Ot.set(e,r),r},At=[[`data-rr-block`,``],[`data-rr-ignore`,``],[`data-rr-mask`,``],[`data-sentry-block`,``],[`data-sentry-ignore`,``],[`data-sentry-mask`,``],[`data-dd-privacy`,`hidden`],[`data-fs-exclude`,``],[`data-lr-exclude`,``],[`data-hj-suppress`,``],[`data-recording-disable`,``],[`data-clarity-mask`,`true`],[`data-heap-redact-text`,``]],jt=e=>{for(let[t,n]of At)e.setAttribute(t,n);e.setAttribute(`data-testid`,`react-grab-overlay`),e.classList.add(`ph-no-capture`)},Mt=e=>typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===9,Nt=e=>{if(e.assignedSlot)return e.assignedSlot;if(e.parentElement)return e.parentElement;let t=e.getRootNode();return ht(t)?t.host:Mt(t)?le(t.defaultView):null};let Pt=null;const Ft=e=>{Pt=e},It=()=>Pt,Lt=e=>{if(!Pt)return!0;let t=e;for(;t;){if(t===Pt)return!0;t=Nt(t)}return!1},Rt=e=>e,zt=typeof window<`u`,Bt=e=>0,Vt=e=>{},O=zt?(Object.getOwnPropertyDescriptor(Window.prototype,`requestAnimationFrame`)?.value??window.requestAnimationFrame).bind(window):Bt,Ht=zt?(Object.getOwnPropertyDescriptor(Window.prototype,`cancelAnimationFrame`)?.value??window.cancelAnimationFrame).bind(window):Vt,Ut=()=>zt?new Promise(e=>O(()=>e())):Promise.resolve(),k=e=>{try{return e.contentDocument}catch{return null}},Wt=(e,t,n)=>{let r=e.getBoundingClientRect(),i=se(e),a=ce(r.width,i.width),o=ce(r.height,i.height);return{x:(t-r.left)/a-i.contentOffsetX,y:(n-r.top)/o-i.contentOffsetY}},Gt=(e,t,n)=>{let r=e.elementFromPoint(t,n);for(;r;){let e=r.shadowRoot?.elementFromPoint(t,n);if(e&&e!==r){r=e;continue}if(_(r)){let e=k(r);if(!e)return r;let i=Wt(r,t,n);return Gt(e,i.x,i.y)??r}return r}return null},Kt=(e,t)=>Gt(document,e,t),qt=e=>{let t=e;for(;t;){if(t.hasAttribute(`data-react-grab-ignore`))return!0;t=Nt(t)}return!1},Jt=typeof Element<`u`&&typeof Element.prototype.checkVisibility==`function`,Yt={checkOpacity:!0,checkVisibilityCSS:!0,opacityProperty:!0,visibilityProperty:!0},Xt={checkVisibilityCSS:!0,visibilityProperty:!0},Zt=(e,t)=>{if(Jt&&!t)return e.checkVisibility(Yt)?!0:e.checkVisibility(Xt)?de(e).opacity!==`0`:!1;let n=t??de(e);return n.display!==`none`&&n.visibility!==`hidden`&&n.opacity!==`0`},Qt=e=>{let t=Dt(e);return t===`html`||t===`body`},$t=[`data-react-grab`,`data-react-grab-demo`],en=e=>$t.some(t=>e.hasAttribute(t)),tn=e=>{if(en(e))return!0;let t=e.getRootNode();return ht(t)&&en(t.host)},nn=e=>{let t=parseInt(e.zIndex,10);return e.pointerEvents===`none`&&e.position===`fixed`&&!isNaN(t)&&t>=2147483600},rn=e=>{let t=e.backgroundColor;return t===`transparent`||t===`rgba(0, 0, 0, 0)`},an=e=>{let t=e.position;if(t!==`fixed`&&t!==`absolute`)return!1;if(rn(e)||parseFloat(e.opacity)<.1)return!0;let n=parseInt(e.zIndex,10);return!isNaN(n)&&n>1e3};let on=new WeakMap;const sn=()=>{on=new WeakMap},cn=e=>{let t=T(e);if(t)return t.isConnected();if(Qt(e)||tn(e)||qt(e))return!1;let n=performance.now(),r=on.get(e);if(r&&n-r.timestamp<50)return r.isVisible;if(!Zt(e))return on.set(e,{isVisible:!1,timestamp:n}),!1;if(e.clientWidth/(e.ownerDocument.defaultView?.innerWidth??window.innerWidth)>=.9&&e.clientHeight/(e.ownerDocument.defaultView?.innerHeight??window.innerHeight)>=.9){let t=de(e);if(nn(t)||an(t))return!1}return on.set(e,{isVisible:!0,timestamp:n}),!0},ln=(e,t,n)=>{let r=!0;for(let i of e.elementsFromPoint(t,n)){if(qt(i)&&(r=!1),!Lt(i))continue;let a=i.shadowRoot;if(r&&a&&a!==e){let e=ln(a,t,n);if(e)return e}if(r&&_(i)){let e=k(i);if(e){let r=Wt(i,t,n),a=ln(e,r.x,r.y);if(a)return a}}if(cn(i))return i}return null},un=(e,t)=>ln(document,e,t),dn=(e,t,n,r)=>{let i=e.elementsFromPoint(t,n),a=!0;for(let o of i){if(qt(o)&&(a=!1),a&&o.shadowRoot&&o.shadowRoot!==e&&dn(o.shadowRoot,t,n,r),a&&_(o)){let e=k(o);if(e){let i=Wt(o,t,n);dn(e,i.x,i.y,r)}}r.add(o)}},fn=(e,t)=>{let n=new Set;return dn(document,e,t,n),[...n]},pn=(e,t,n)=>e>=n.left&&e<=n.right&&t>=n.top&&t<=n.bottom,mn=(e,t,n=document)=>{let r=n.createElement(`style`);r.setAttribute(e,``);let i=kt(n);return i&&(r.nonce=i),jt(r),r.textContent=t,n.head.appendChild(r),r},hn=`html { pointer-events: none !important; }
|
|
28
|
+
iframe[${te}] { pointer-events: auto !important; }`,gn=new Set,A=new Map;let j=!1;const _n=e=>{if(A.has(e))return;let t=mn(`data-react-grab-frozen-pseudo`,hn,e),n=mn(`data-react-grab-hittest-override`,`html, body { pointer-events: auto !important; }`,e);n.disabled=!0,A.set(e,{pointerEventsStyle:t,hitTestOverrideStyle:n})},vn=e=>{let t=A.get(e);t&&(t.pointerEventsStyle.remove(),t.hitTestOverrideStyle.remove(),A.delete(e))},yn=()=>j,bn=e=>(gn.add(e),j&&_n(e),()=>{gn.delete(e),vn(e)}),xn=()=>{if(!j){j=!0,gn.add(document);for(let e of gn)_n(e)}},Sn=()=>{if(j){j=!1;for(let e of[...A.keys()])vn(e)}},Cn=()=>{if(j)for(let e of A.values())e.pointerEventsStyle.disabled||(e.pointerEventsStyle.disabled=!0),e.hitTestOverrideStyle.disabled&&(e.hitTestOverrideStyle.disabled=!1)},wn=()=>{if(j)for(let e of A.values())e.pointerEventsStyle.disabled&&(e.pointerEventsStyle.disabled=!1),e.hitTestOverrideStyle.disabled||(e.hitTestOverrideStyle.disabled=!0)},Tn=new WeakMap,M=new WeakMap,En=[`name`,`position`,`rotation`,`scale`,`color`,`visible`,`args`],N=e=>typeof e==`object`&&!!e,Dn=e=>typeof e==`object`&&!!e||typeof e==`function`,P=(e,t)=>typeof e[t]==`function`,On=e=>N(e)&&typeof e.x==`number`&&typeof e.y==`number`&&typeof e.z==`number`&&P(e,`set`)&&P(e,`clone`)&&P(e,`applyMatrix4`)&&P(e,`project`),kn=e=>N(e)&&P(e,`clone`)&&P(e,`premultiply`),An=e=>N(e)&&`boundingBox`in e&&P(e,`computeBoundingBox`),jn=e=>N(e)&&typeof e.type==`string`&&N(e.props)&&Mn(e.object),Mn=e=>N(e)&&e.isObject3D===!0&&typeof e.uuid==`string`&&typeof e.name==`string`&&typeof e.type==`string`&&typeof e.visible==`boolean`&&kn(e.matrixWorld)&&P(e,`updateWorldMatrix`),Nn=e=>N(e)&&e.isCamera===!0,Pn=e=>Mn(e)&&e.isScene===!0&&Array.isArray(e.children),Fn=e=>N(e)&&typeof e.tagName==`string`&&e.tagName.toLowerCase()===`canvas`&&P(e,`getContext`),In=e=>N(e)&&Fn(e.domElement),Ln=e=>N(e)&&P(e,`set`),Rn=e=>N(e)&&P(e,`setFromCamera`)&&P(e,`intersectObjects`),zn=e=>N(e)&&In(e.gl)&&Pn(e.scene)&&Nn(e.camera)&&Rn(e.raycaster)&&Ln(e.pointer),Bn=e=>jn(e.__r3f)?e.__r3f:null,Vn=e=>{let t=e.current.stateNode;if(!N(t)||!Dn(t.containerInfo))return null;let n=Reflect.get(t.containerInfo,`getState`);if(typeof n!=`function`)return null;let r=n();return zn(r)?r:null};rt({name:`react-grab-three-selection`,onCommitFiberRoot:(e,t)=>{let n=Vn(t);n&&M.set(n.gl.domElement,{isReactThreeFiber:!0,state:n})}});const Hn=e=>{let t=e;for(;t;){if(Bn(t))return t;t=t.parent}return null},Un=e=>{let t=e;for(;t;){let e=Bn(t);if(e&&typeof e.eventCount==`number`&&e.eventCount>0)return!0;t=t.parent}return!1},Wn=(e,t)=>{let n=e;for(;n;){if(n===t)return!0;n=n.parent}return!1},Gn=(e,t,n)=>{let r=typeof n.instanceId==`number`&&Number.isInteger(n.instanceId)?n.instanceId:null,i=Tn.get(t);i||(i=new Map,Tn.set(t,i));let a=i.get(r);if(a)return a.canvas=e.gl.domElement,a.intersectionPoint=On(n.point)?n.point:null,a.object=t,a.rootState=e,a.element;let o=Bn(t),s=o?ot(o):null;if(o&&!s)return null;let c=(o?.type||t.type||`object-3d`).toLowerCase(),l=e.gl.domElement.ownerDocument.createElement(c),u={canvas:e.gl.domElement,element:l,fiber:s,instance:o,instanceId:r,intersectionPoint:On(n.point)?n.point:null,object:t,rootState:e,tagName:c},d=l.getBoundingClientRect.bind(l);return l.getBoundingClientRect=()=>{let e=er(u),t=l.ownerDocument.defaultView?.DOMRect;return t?new t(e.x,e.y,e.width,e.height):d()},ct(l,{hostElement:u.canvas,supportsDomEditing:!1,getBounds:()=>er(u),getFiber:()=>u.fiber?Ve(u.fiber):null,getPreview:()=>Yn(u),getSelector:()=>Xn(u),getTagName:()=>u.tagName,isConnected:()=>u.canvas.isConnected&&Wn(u.object,u.rootState.scene)}),i.set(r,u),l},Kn=(e,t,n)=>{if(!Fn(e))return e;let r=M.get(e);if(!r)return e;let i=mt(e);if(i.width<=0||i.height<=0)return e;let a=(t-i.x)/i.width*2-1,o=-((n-i.y)/i.height)*2+1;if(a<-1||a>1||o<-1||o>1)return e;try{r.state.pointer.set(a,o),r.state.raycaster.setFromCamera(r.state.pointer,r.state.camera);let e=r.state.raycaster.intersectObjects(r.state.scene.children,!0);if(r.isReactThreeFiber)for(let t of e){if(!Un(t.object))continue;let e=Hn(t.object);if(!e||e.visible===!1)continue;let n=Gn(r.state,e,t);if(n)return n}for(let t of e){let e=r.isReactThreeFiber?Hn(t.object):t.object;if(!e||e.visible===!1)continue;let n=Gn(r.state,e,t);if(n)return n}}catch{}return e},qn=e=>{let t={gl:e.renderer,scene:e.scene,camera:e.camera,raycaster:e.raycaster,pointer:e.pointer};if(!zn(t))throw TypeError(`Invalid Three.js scene registration`);let n=t.gl.domElement,r={isReactThreeFiber:!1,state:t};return M.set(n,r),()=>{M.get(n)===r&&M.delete(n)}},Jn=e=>typeof e==`string`?JSON.stringify(e):typeof e==`number`||typeof e==`boolean`?`{${String(e)}}`:Array.isArray(e)&&e.length<=4&&e.every(e=>typeof e==`number`||typeof e==`string`)?`{${JSON.stringify(e)}}`:null,Yn=e=>{let t=e.instance?.props??{},n=[];for(let r of En){let i=t[r];r===`name`&&i===void 0&&e.object.name&&(i=e.object.name);let a=Jn(i);a&&n.push(`${r}=${a}`)}return e.instanceId!==null&&n.push(`instanceId={${e.instanceId}}`),`<${e.tagName}${n.length>0?` ${n.join(` `)}`:``} />`},Xn=e=>{if(e.object.name)return`${e.tagName}[name=${JSON.stringify(e.object.name)}]`;let t=e.instanceId===null?``:`:${e.instanceId}`;return`${e.tagName}[uuid=${JSON.stringify(`${e.object.uuid}${t}`)}]`},Zn=e=>{e.object.updateWorldMatrix(!0,!1);let t=e.object.matrixWorld.clone();if(e.instanceId===null||!e.object.getMatrixAt)return t;let n=e.object.matrixWorld.clone();return e.object.getMatrixAt(e.instanceId,n),n.premultiply(t)},Qn=e=>{if(!An(e.geometry))return null;e.geometry.boundingBox||e.geometry.computeBoundingBox();let t=e.geometry.boundingBox;return!t||!On(t.min)||!On(t.max)?null:t},$n=(e,t)=>{let n=t.x+t.width/2,r=t.y+t.height/2;if(e.intersectionPoint){let i=e.intersectionPoint.clone().project(e.rootState.camera);Number.isFinite(i.x)&&Number.isFinite(i.y)&&(n=t.x+(i.x+1)/2*t.width,r=t.y+(1-i.y)/2*t.height)}return{x:n-16/2,y:r-16/2,width:16,height:16,borderRadius:`0px`}},er=e=>{let t=mt(e.canvas),n=Qn(e.object);if(!n)return $n(e,t);let r=Zn(e),i=[n.min.x,n.max.x],a=[n.min.y,n.max.y],o=[n.min.z,n.max.z],s=1/0,c=1/0,l=-1/0,u=-1/0,d=n.min.clone();for(let n of i)for(let i of a)for(let a of o){if(d.set(n,i,a).applyMatrix4(r).project(e.rootState.camera),!Number.isFinite(d.x)||!Number.isFinite(d.y))continue;let o=t.x+(d.x+1)/2*t.width,f=t.y+(1-d.y)/2*t.height;s=Math.min(s,o),c=Math.min(c,f),l=Math.max(l,o),u=Math.max(u,f)}if(!Number.isFinite(s)||!Number.isFinite(c)||!Number.isFinite(l)||!Number.isFinite(u))return $n(e,t);let f=Math.max(t.x,s),p=Math.max(t.y,c),ee=Math.min(t.x+t.width,l),m=Math.min(t.y+t.height,u);return ee<=f||m<=p?$n(e,t):{x:f,y:p,width:ee-f,height:m-p,borderRadius:`0px`}};let F=null,I=null,L=null;const tr=()=>{L!==null&&clearTimeout(L),L=setTimeout(()=>{L=null,wn()},100)},nr=()=>{L!==null&&(clearTimeout(L),L=null)},rr=(e,t,n,r)=>{let i=Math.abs(e-n),a=Math.abs(t-r);return i<=2&&a<=2},ir=(e,t)=>{if(!Number.isFinite(e)||!Number.isFinite(t))return[];nr(),Cn();try{let n=fn(e,t),r=It()?n.filter(Lt):n,i=[];for(let n of r)i.push(Kn(n,e,t));return i}finally{tr()}},ar=(e,t)=>{if(!Number.isFinite(e)||!Number.isFinite(t))return null;let n=performance.now();if(I){let r=I.element,i=n-I.timestamp<16;if(r.isConnected&&i&&pn(e,t,I.bounds)&&!k(r))return r;I=null,F?.element===r&&(F=null)}if(F){let r=rr(e,t,F.clientX,F.clientY),i=n-F.timestamp<16;if(r||i)return F.element}nr(),Cn();try{let r=null,i=Kt(e,t),a=i?Kn(i,e,t):null;if(r=i&&a&&cn(a)&&Lt(i)?a:un(e,t),r&&_(r)&&!k(r)){let e=mt(r);I={element:r,timestamp:n,bounds:{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height}}}else I=null;return F={clientX:e,clientY:t,element:r,timestamp:n},r}finally{tr()}},or=()=>{nr(),wn(),F=null,I=null},R=e=>{console.warn(`[react-grab]`,e)},sr=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]);let z=!1;const B=new Map;let cr=-1;const lr=new WeakSet,V=new Map,H=new Map,ur=e=>lr.has(e)?!0:!z||!(`gsapVersions`in window)||!(Error().stack??``).includes(`_tick`)?!1:(lr.add(e),!0);typeof window<`u`&&(window.requestAnimationFrame=e=>{if(!ur(e))return O(e);if(z){let t=cr--;return B.set(t,e),t}let t=O(n=>{if(z){let n=cr--;B.set(n,e),V.set(t,n);return}e(n)});return t},window.cancelAnimationFrame=e=>{if(B.has(e)){B.delete(e);return}let t=H.get(e);if(t!==void 0){Ht(t.nativeId),H.delete(e);return}let n=V.get(e);if(n!==void 0){B.delete(n),V.delete(e);return}Ht(e)});const dr=()=>{if(!z){z=!0,B.clear(),V.clear();for(let[e,{nativeId:t,callback:n}]of H)Ht(t),B.set(e,n);H.clear()}},fr=()=>{if(z){z=!1;for(let[e,t]of B.entries()){let n=O(n=>{H.delete(e),t(n)});H.set(e,{nativeId:n,callback:t})}B.clear(),V.clear()}},U=(e,t)=>{if(e.length!==0)throw e.length===1?e[0]:AggregateError(e,t)},pr=`
|
|
29
|
+
[${h}],
|
|
30
|
+
[${h}] * {
|
|
31
|
+
animation-play-state: paused !important;
|
|
32
|
+
transition: none !important;
|
|
33
|
+
}
|
|
34
|
+
`,mr=e=>e?.namespaceURI===`http://www.w3.org/2000/svg`&&e.tagName===`svg`;let hr=null,W=[],G=[],gr=[];const K=new Set,q=new Map,J=new Map;let Y=[];const _r=()=>q.size>0,vr=()=>{hr||=mn(`data-react-grab-frozen-styles`,pr)},yr=e=>{let t=new Set;for(let n of e){let e=mr(n)?n:n.closest(`svg`);mr(e)&&t.add(e);for(let e of n.querySelectorAll(`svg`))mr(e)&&t.add(e)}return[...t]},br=(e,t)=>{let n=Reflect.get(e,t);typeof n==`function`&&n.call(e)},xr=(e,t)=>{for(let n of e){let e=J.get(n)??0;if(e===0){J.set(n,1),t.push(n),br(n,`pauseAnimations`);continue}J.set(n,e+1),t.push(n)}},Sr=(e,t)=>{let n=[];for(let r of e){let e=J.get(r);if(e){if(e===1){try{br(r,`unpauseAnimations`),J.delete(r)}catch(e){n.push(r),t.push(e)}continue}J.set(r,e-1)}}return n},Cr=e=>{let t=[];for(let n of e)for(let e of n.getAnimations({subtree:!0}))e.playState===`running`&&t.push(e);return t},wr=e=>{for(let t of e)try{t.finish()}catch{}},Tr=e=>{for(let t of e)try{t.finish()}catch{try{t.play()}catch{}}},Er=e=>{if(!(e.effect instanceof KeyframeEffect))return!1;let t=e.effect.target;if(!ae(t))return!1;let n=t.getRootNode();return ht(n)&&en(n.host)},Dr=e=>{if(e.length===0||sr(e,gr))return;Or();let t=[...e];vr(),W=t,G=[];try{xr(yr(W),G);for(let e of W)e.setAttribute(h,``);let e=Cr(W);Y=[];for(let t of e)t.pause(),Y.push(t);gr=t}catch(e){try{Or()}catch(t){throw AggregateError([e,t],`Rolling back animation freeze failed`)}throw e}},Or=()=>{if(W.length===0&&G.length===0&&Y.length===0)return;let e=W,t=G,n=Y,r=[],i=[];gr=[];for(let t of e)try{t.removeAttribute(h)}catch(e){i.push(t),r.push(e)}W=i,G=Sr(t,r),Tr(n),Y=[],U(r,`Unfreezing element animations failed`)},kr=e=>e.length===0?(Or(),()=>{}):(Dr(e),Or),Ar=e=>{let t=[];for(let n of e.getAnimations())Er(n)||n.playState===`running`&&t.push(n);return{targetDocument:e,runningAnimations:t}},jr=e=>{let t=q.get(e);if(!t)return[];let n=[],r=t.styleElement;if(r){try{if(t.didUseCssFreeze){r.textContent=`
|
|
35
|
+
*, *::before, *::after {
|
|
36
|
+
transition: none !important;
|
|
37
|
+
}
|
|
38
|
+
`;let t=[];for(let n of e.getAnimations())Er(n)||t.push(n);wr(t)}else Tr(t.frozenWaapiAnimations);t.didUseCssFreeze=!1,t.frozenWaapiAnimations=[]}catch(e){n.push(e)}try{r.remove(),t.styleElement=null}catch(e){n.push(e)}}return t.frozenSvgElements=Sr(t.frozenSvgElements,n),t.styleElement===null&&t.frozenSvgElements.length===0&&t.frozenWaapiAnimations.length===0&&q.delete(e),n},Mr=e=>{if(q.has(e.targetDocument))return;let t=mn(`data-react-grab-global-freeze`,``,e.targetDocument),n={styleElement:t,frozenSvgElements:[],frozenWaapiAnimations:[],didUseCssFreeze:!1};if(q.set(e.targetDocument,n),e.runningAnimations.length>200)t.textContent=`
|
|
39
|
+
*, *::before, *::after {
|
|
40
|
+
animation-play-state: paused !important;
|
|
41
|
+
transition: none !important;
|
|
42
|
+
}
|
|
43
|
+
`,n.didUseCssFreeze=!0;else for(let t of e.runningAnimations)t.pause(),n.frozenWaapiAnimations.push(t);xr(yr(Array.from(e.targetDocument.querySelectorAll(`svg`))),n.frozenSvgElements)},Nr=e=>{K.add(e);try{_r()&&Mr(Ar(e))}catch(t){K.delete(e);let n=jr(e);throw n.length===0?t:AggregateError([t,...n],`Freezing frame animations failed`)}return()=>{K.delete(e),U(jr(e),`Unfreezing frame animations failed`)}},Pr=()=>_r()?[]:(K.add(document),[...K].map(Ar)),Fr=e=>{if(!_r()){for(let t of e)Mr(t);dr()}},Ir=()=>{if(!_r())return;let e=[];for(let t of[...q.keys()])e.push(...jr(t));try{fr()}catch(t){e.push(t)}U(e,`Unfreezing global animations failed`)},Lr=(e,t)=>{for(let n of e.querySelectorAll(`:hover`))if(!tn(n)&&(g(n)&&t.add(n),n.shadowRoot&&Lr(n.shadowRoot,t),_(n))){let e=k(n);e&&Lr(e,t)}},Rr=()=>{let e=new Set;return Lr(document,e),[...e]},zr=[`mouseenter`,`mouseleave`,`mouseover`,`mouseout`,`pointerenter`,`pointerleave`,`pointerover`,`pointerout`],Br=[`focus`,`blur`,`focusin`,`focusout`],Vr=[`background-color`,`color`,`border-color`,`box-shadow`,`transform`,`opacity`,`outline`,`filter`,`scale`,`visibility`,`display`],Hr=[`background-color`,`color`,`border-color`,`box-shadow`,`outline`,`outline-offset`,`outline-width`,`outline-color`,`outline-style`,`filter`,`opacity`,`ring-color`,`ring-width`],Ur=new Map,Wr=new Map,X=new Set;let Gr=!1;const Kr=e=>{e.stopImmediatePropagation()},qr=e=>{e.preventDefault(),e.stopImmediatePropagation()},Jr=e=>{for(let t of zr)e.addEventListener(t,Kr,!0);for(let t of Br)e.addEventListener(t,qr,!0)},Yr=e=>{for(let t of zr)e.removeEventListener(t,Kr,!0);for(let t of Br)e.removeEventListener(t,qr,!0)},Xr=e=>{X.add(e);let t=bn(e);return Gr&&Jr(e),()=>{Gr&&Yr(e),X.delete(e),t()}},Zr=(e,t,n)=>{if(n?.has(e))return null;let r=getComputedStyle(e),i=new Map,a=new Map;for(let n of t){let t=r.getPropertyValue(n);t&&(i.set(n,t),a.set(n,{value:e.style.getPropertyValue(n),priority:e.style.getPropertyPriority(n)}))}return{element:e,frozenPropertyValues:i,originalPropertyValues:a}},Qr=(e,t)=>{let n=[],r=Kt(e,t);for(;r&&r!==document.documentElement&&!tn(r);)g(r)&&n.push(r),r=Nt(r);return n},$r=()=>{let e=[],t=document.activeElement;for(;t&&t!==document.body;){if(g(t)&&e.push(t),t.shadowRoot?.activeElement){t=t.shadowRoot.activeElement;continue}if(_(t)){t=k(t)?.activeElement??null;continue}t=null}return e},ei=(e,t)=>{for(let{element:n,frozenPropertyValues:r,originalPropertyValues:i}of e){t.set(n,i);for(let[e,t]of r)n.style.setProperty(e,t,`important`)}},ti=e=>{let t=[];for(let[n,r]of e){for(let[e,i]of r)try{i.value?n.style.setProperty(e,i.value,i.priority):n.style.removeProperty(e),r.delete(e)}catch(e){t.push(e)}r.size===0&&e.delete(n)}return t},ni=(e,t)=>{if(yn())return null;let n=[],r=e!==void 0&&t!==void 0&&e>=0&&t>=0&&e<window.innerWidth&&t<window.innerHeight?Qr(e,t):Rr();for(let e of r){let t=Zr(e,Vr);t&&n.push(t)}let i=[];for(let e of $r()){let t=Zr(e,Hr,Wr);t&&i.push(t)}return{hoverStates:n,focusStates:i}},ri=e=>{if(e){Gr=!0,X.add(document);for(let e of X)Jr(e);ei(e.hoverStates,Ur),ei(e.focusStates,Wr),xn()}},ii=()=>{or(),Gr=!1;for(let e of X)Yr(e);let e=[...ti(Ur),...ti(Wr)];try{Sn()}catch(t){e.push(t)}U(e,`Unfreezing pseudo states failed`)},ai=()=>{let e=[];try{ii()}catch(t){e.push(t)}try{Ir()}catch(t){e.push(t)}return e},oi=(e,t)=>{let n=ni(e,t),r=Pr();try{ri(n),Fr(r)}catch(e){let t=ai();throw t.length===0?e:AggregateError([e,...t],`Freezing global interactions failed`)}},si=()=>{U(ai(),`Unfreezing global interactions failed`)};let Z=!1,Q=0;const ci=(e,t,n)=>{let r=e.get(t);if(r)return r;let i=n();return e.set(t,i),i},li=new WeakMap,ui=new WeakMap,di=new WeakMap,fi=new Set,pi=[],$=[],mi=new WeakMap,hi=new WeakMap,gi=new WeakSet,_i=Be,vi=new Set,yi=e=>e.rendererPackageName.startsWith(`react-dom`),bi=e=>{let t=e;for(;t.return;)t=t.return;return t.stateNode??null},xi=e=>{let t=e.current?.stateNode;if(!t||typeof t!=`object`)return!1;let n=Reflect.get(t,`containerInfo`);return!!(n&&typeof n==`object`&&typeof Reflect.get(n,`nodeType`)==`number`)},Si=()=>{if(_i.size>0){let e=new Set;for(let t of _i)xi(t)&&e.add(t);return e}let e=new Set,t=n=>{let r=ot(n);if(r){let t=bi(r);t&&e.add(t);return}for(let r of Array.from(n.children))if(t(r),e.size>0)return};return t(document.body),e},Ci=(e,t)=>{if(!e)return t;if(!t)return e;if(!e.next||!t.next)return t;let n=e.next,r=t.next,i=e===n,a=t===r;return i&&a?(e.next=t,t.next=e):i?(e.next=r,t.next=e):a?(t.next=n,e.next=t):(e.next=r,t.next=n),t},wi=e=>{if(!e||mi.has(e))return;let t={originalPendingDescriptor:Object.getOwnPropertyDescriptor(e,`pending`),pendingValueAtPause:e.pending,bufferedPending:null};typeof e.getSnapshot==`function`&&(t.originalGetSnapshot=e.getSnapshot,t.snapshotValueAtPause=e.getSnapshot(),e.getSnapshot=()=>Z?t.snapshotValueAtPause:t.originalGetSnapshot());let n=t.pendingValueAtPause;Object.defineProperty(e,`pending`,{configurable:!0,enumerable:!0,get:()=>Z?null:n,set:e=>{if(Z){e!==null&&(t.bufferedPending=Ci(t.bufferedPending??null,e));return}n=e}}),mi.set(e,t)},Ti=e=>{if(!e)return[];let t=[],n=e.next;if(!n)return[];let r=n;do r&&=(t.push(r.action),r.next);while(r&&r!==n);return t},Ei=e=>{let t=mi.get(e);if(!t)return;t.originalGetSnapshot&&(e.getSnapshot=t.originalGetSnapshot),t.originalPendingDescriptor?Object.defineProperty(e,`pending`,t.originalPendingDescriptor):delete e.pending,e.pending=null;let n=e.dispatch;if(typeof n==`function`){let e=Ti(t.pendingValueAtPause??null),r=Ti(t.bufferedPending??null);for(let t of[...e,...r])$.push(()=>n(t))}mi.delete(e)},Di=e=>{if(hi.has(e))return;let t={originalDescriptor:Object.getOwnPropertyDescriptor(e,`memoizedValue`),frozenValue:e.memoizedValue};Object.defineProperty(e,`memoizedValue`,{configurable:!0,enumerable:!0,get(){return Z?t.frozenValue:t.originalDescriptor?.get?t.originalDescriptor.get.call(this):this._memoizedValue},set(e){if(Z){t.pendingValue=e,t.didReceivePendingValue=!0;return}t.originalDescriptor?.set?t.originalDescriptor.set.call(this,e):this._memoizedValue=e}}),t.originalDescriptor?.get||(e._memoizedValue=t.frozenValue),hi.set(e,t)},Oi=e=>{let t=hi.get(e);t&&(t.originalDescriptor?Object.defineProperty(e,`memoizedValue`,t.originalDescriptor):delete e.memoizedValue,t.didReceivePendingValue&&(e.memoizedValue=t.pendingValue),hi.delete(e))},ki=e=>{let t=e.memoizedState;for(;t;)t.queue&&typeof t.queue==`object`&&wi(t.queue),t=t.next;let n=e.dependencies?.firstContext;for(;n&&typeof n==`object`&&`memoizedValue`in n;)Di(n),n=n.next},Ai=e=>{let t=e.memoizedState;for(;t;)t.queue&&typeof t.queue==`object`&&Ei(t.queue),t=t.next;let n=e.dependencies?.firstContext;for(;n&&typeof n==`object`&&`memoizedValue`in n;)Oi(n),n=n.next},ji=e=>{let t=e;for(;t;){if(ke(t)&&ki(t),t.child){t=t.child;continue}for(;t!==e&&!t.sibling;)if(t=t.return,!t)return;if(t===e)return;t=t.sibling}},Mi=e=>{let t=e;for(;t;){if(ke(t)&&Ai(t),t.child){t=t.child;continue}for(;t!==e&&!t.sibling;)if(t=t.return,!t)return;if(t===e)return;t=t.sibling}},Ni=e=>{if(li.has(e))return;let t=e,n={useState:t.useState,useReducer:t.useReducer,useTransition:t.useTransition,useSyncExternalStore:t.useSyncExternalStore};li.set(e,n),t.useState=(...t)=>{let r=n.useState.apply(e,t);if(!Z||!Array.isArray(r)||typeof r[1]!=`function`)return r;let[i,a]=r;return[i,ci(ui,a,()=>(...e)=>{Z?$.push(()=>a(...e)):a(...e)})]},t.useReducer=(...t)=>{let r=n.useReducer.apply(e,t);if(!Z||!Array.isArray(r)||typeof r[1]!=`function`)return r;let[i,a]=r;return[i,ci(ui,a,()=>(...e)=>{Z?$.push(()=>a(...e)):a(...e)})]},t.useTransition=(...t)=>{let r=n.useTransition.apply(e,t);if(!Z||!Array.isArray(r)||typeof r[1]!=`function`)return r;let[i,a]=r;return[i,ci(di,a,()=>e=>{Z?pi.push(()=>a(e)):a(e)})]},t.useSyncExternalStore=((e,t,r)=>Z?n.useSyncExternalStore(t=>e(()=>{Z?fi.add(t):t()}),t,r):n.useSyncExternalStore(e,t,r))},Pi=e=>{let t=e.currentDispatcherRef;if(!t||typeof t!=`object`)return;let n=`H`in t?`H`:`current`,r=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get:()=>(r&&typeof r==`object`&&Ni(r),r),set:e=>{r=e}})},Fi=e=>{queueMicrotask(()=>{try{for(let t of x().renderers.values())if(yi(t)&&typeof t.scheduleUpdate==`function`){for(let n of e)if(n.current)try{t.scheduleUpdate(n.current)}catch(e){R(new D(`scheduleUpdate failed during unfreeze`,e))}}}catch(e){R(new D(`scheduleReactUpdate failed`,e))}})},Ii=e=>{for(let t of e)try{t()}catch(e){R(new D(`Callback failed during state replay`,e))}},Li=()=>{for(let e of x().renderers.values())yi(e)&&(gi.has(e)||(Pi(e),gi.add(e)))},Ri=()=>{fi.clear(),pi.length=0,$.length=0},zi=()=>{let e=new Set(vi);try{for(let t of Si())e.add(t)}catch(e){R(new D(`Collecting fiber roots failed during unfreeze`,e))}vi.clear(),Z=!1;for(let t of e)try{Mi(t.current)}catch(e){R(new D(`Resuming a fiber root failed during unfreeze`,e))}let t=Array.from(fi),n=pi.slice(),r=$.slice();Ri(),Ii(t),Ii(n),Ii(r),Z||Fi(e)},Bi=()=>{let e=Q===0;if(Q+=1,e)try{Li(),Z=!0;let e=Si();for(let t of e)vi.add(t),ji(t.current)}catch(e){throw--Q,Z&&zi(),e}let t=!1;return()=>{t||(t=!0,--Q,Q===0&&zi())}},Vi=()=>{try{return Bi()}catch(e){return R(new D(`Pausing React updates failed`,e)),()=>{}}};Object.defineProperty(exports,`$`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`$t`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`A`,{enumerable:!0,get:function(){return Lt}}),Object.defineProperty(exports,`At`,{enumerable:!0,get:function(){return 8e3}}),Object.defineProperty(exports,`B`,{enumerable:!0,get:function(){return gt}}),Object.defineProperty(exports,`Bt`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`C`,{enumerable:!0,get:function(){return Qt}}),Object.defineProperty(exports,`Ct`,{enumerable:!0,get:function(){return .7}}),Object.defineProperty(exports,`D`,{enumerable:!0,get:function(){return Ut}}),Object.defineProperty(exports,`Dt`,{enumerable:!0,get:function(){return`edit`}}),Object.defineProperty(exports,`E`,{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,`Et`,{enumerable:!0,get:function(){return ne}}),Object.defineProperty(exports,`F`,{enumerable:!0,get:function(){return kt}}),Object.defineProperty(exports,`Ft`,{enumerable:!0,get:function(){return`cubic-bezier(0.34, 1.56, 0.64, 1)`}}),Object.defineProperty(exports,`G`,{enumerable:!0,get:function(){return bt}}),Object.defineProperty(exports,`Gt`,{enumerable:!0,get:function(){return`superellipse(1.25)`}}),Object.defineProperty(exports,`H`,{enumerable:!0,get:function(){return _t}}),Object.defineProperty(exports,`Ht`,{enumerable:!0,get:function(){return .6}}),Object.defineProperty(exports,`I`,{enumerable:!0,get:function(){return Dt}}),Object.defineProperty(exports,`It`,{enumerable:!0,get:function(){return`#00000000`}}),Object.defineProperty(exports,`J`,{enumerable:!0,get:function(){return Tt}}),Object.defineProperty(exports,`Jt`,{enumerable:!0,get:function(){return 1e3}}),Object.defineProperty(exports,`K`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`Kt`,{enumerable:!0,get:function(){return ee}}),Object.defineProperty(exports,`L`,{enumerable:!0,get:function(){return St}}),Object.defineProperty(exports,`Lt`,{enumerable:!0,get:function(){return`transparent`}}),Object.defineProperty(exports,`M`,{enumerable:!0,get:function(){return Nt}}),Object.defineProperty(exports,`Mt`,{enumerable:!0,get:function(){return 1e3}}),Object.defineProperty(exports,`N`,{enumerable:!0,get:function(){return Mt}}),Object.defineProperty(exports,`Nt`,{enumerable:!0,get:function(){return 12e3}}),Object.defineProperty(exports,`O`,{enumerable:!0,get:function(){return It}}),Object.defineProperty(exports,`Ot`,{enumerable:!0,get:function(){return 2e3}}),Object.defineProperty(exports,`P`,{enumerable:!0,get:function(){return jt}}),Object.defineProperty(exports,`Pt`,{enumerable:!0,get:function(){return 9e3}}),Object.defineProperty(exports,`Q`,{enumerable:!0,get:function(){return ft}}),Object.defineProperty(exports,`Qt`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`R`,{enumerable:!0,get:function(){return xt}}),Object.defineProperty(exports,`Rt`,{enumerable:!0,get:function(){return 1500}}),Object.defineProperty(exports,`S`,{enumerable:!0,get:function(){return tn}}),Object.defineProperty(exports,`St`,{enumerable:!0,get:function(){return`copy`}}),Object.defineProperty(exports,`T`,{enumerable:!0,get:function(){return Ht}}),Object.defineProperty(exports,`Tt`,{enumerable:!0,get:function(){return re}}),Object.defineProperty(exports,`U`,{enumerable:!0,get:function(){return yt}}),Object.defineProperty(exports,`Ut`,{enumerable:!0,get:function(){return .18}}),Object.defineProperty(exports,`V`,{enumerable:!0,get:function(){return Ct}}),Object.defineProperty(exports,`Vt`,{enumerable:!0,get:function(){return .5}}),Object.defineProperty(exports,`W`,{enumerable:!0,get:function(){return vt}}),Object.defineProperty(exports,`Wt`,{enumerable:!0,get:function(){return 1e4}}),Object.defineProperty(exports,`X`,{enumerable:!0,get:function(){return ht}}),Object.defineProperty(exports,`Xt`,{enumerable:!0,get:function(){return .01}}),Object.defineProperty(exports,`Y`,{enumerable:!0,get:function(){return wt}}),Object.defineProperty(exports,`Yt`,{enumerable:!0,get:function(){return-1e3}}),Object.defineProperty(exports,`Z`,{enumerable:!0,get:function(){return mt}}),Object.defineProperty(exports,`Zt`,{enumerable:!0,get:function(){return .5}}),Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return wn}}),Object.defineProperty(exports,`_n`,{enumerable:!0,get:function(){return`0.1.49-dev.575dc58`}}),Object.defineProperty(exports,`_t`,{enumerable:!0,get:function(){return .2}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return Xr}}),Object.defineProperty(exports,`an`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`at`,{enumerable:!0,get:function(){return ot}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return sn}}),Object.defineProperty(exports,`bn`,{enumerable:!0,get:function(){return 2147483645}}),Object.defineProperty(exports,`bt`,{enumerable:!0,get:function(){return`comment`}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return Nr}}),Object.defineProperty(exports,`cn`,{enumerable:!0,get:function(){return`data-react-grab-input`}}),Object.defineProperty(exports,`ct`,{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,`dn`,{enumerable:!0,get:function(){return-9999}}),Object.defineProperty(exports,`dt`,{enumerable:!0,get:function(){return ue}}),Object.defineProperty(exports,`en`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`et`,{enumerable:!0,get:function(){return lt}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return or}}),Object.defineProperty(exports,`fn`,{enumerable:!0,get:function(){return .95}}),Object.defineProperty(exports,`ft`,{enumerable:!0,get:function(){return le}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return Kn}}),Object.defineProperty(exports,`gn`,{enumerable:!0,get:function(){return .5}}),Object.defineProperty(exports,`gt`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return qn}}),Object.defineProperty(exports,`hn`,{enumerable:!0,get:function(){return 5e3}}),Object.defineProperty(exports,`ht`,{enumerable:!0,get:function(){return ae}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return si}}),Object.defineProperty(exports,`in`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`it`,{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,`j`,{enumerable:!0,get:function(){return Ft}}),Object.defineProperty(exports,`jt`,{enumerable:!0,get:function(){return 5e3}}),Object.defineProperty(exports,`k`,{enumerable:!0,get:function(){return Rt}}),Object.defineProperty(exports,`kt`,{enumerable:!0,get:function(){return 1e4}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,`ln`,{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,`lt`,{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return ir}}),Object.defineProperty(exports,`mn`,{enumerable:!0,get:function(){return 8e3}}),Object.defineProperty(exports,`mt`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return Bi}}),Object.defineProperty(exports,`nn`,{enumerable:!0,get:function(){return`var(--rg-panel-bg)`}}),Object.defineProperty(exports,`nt`,{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return Dr}}),Object.defineProperty(exports,`on`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`ot`,{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return ar}}),Object.defineProperty(exports,`pn`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`pt`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`q`,{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,`qt`,{enumerable:!0,get:function(){return 1e3}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return oi}}),Object.defineProperty(exports,`rn`,{enumerable:!0,get:function(){return`var(--rg-shadow)`}}),Object.defineProperty(exports,`rt`,{enumerable:!0,get:function(){return ke}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return kr}}),Object.defineProperty(exports,`sn`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`st`,{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return Vi}}),Object.defineProperty(exports,`tn`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`tt`,{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return sr}}),Object.defineProperty(exports,`un`,{enumerable:!0,get:function(){return te}}),Object.defineProperty(exports,`ut`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return Cn}}),Object.defineProperty(exports,`vn`,{enumerable:!0,get:function(){return .01}}),Object.defineProperty(exports,`vt`,{enumerable:!0,get:function(){return 16.666666666666668}}),Object.defineProperty(exports,`w`,{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,`wt`,{enumerable:!0,get:function(){return .75}}),Object.defineProperty(exports,`x`,{enumerable:!0,get:function(){return cn}}),Object.defineProperty(exports,`xn`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`xt`,{enumerable:!0,get:function(){return 1e7}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return fn}}),Object.defineProperty(exports,`yn`,{enumerable:!0,get:function(){return 2147483647}}),Object.defineProperty(exports,`yt`,{enumerable:!0,get:function(){return .5}}),Object.defineProperty(exports,`z`,{enumerable:!0,get:function(){return Et}}),Object.defineProperty(exports,`zt`,{enumerable:!0,get:function(){return 1.2}});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2025 Aiden Bai
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
let e=null;const t=()=>{if(e!==null)return e;try{e=window.matchMedia(`(color-gamut: p3)`).matches}catch{e=!1}return e},n=t(),r=e=>n?`color(display-p3 0.84 0.19 0.78 / ${e})`:`rgba(210, 57, 192, ${e})`,i=`0.1.49-dev.575dc58`,a=`var(--rg-panel-bg)`,o=`var(--rg-shadow)`,s=-1e3,c=.95,l=1500,u=[`/components/ui/`,`/packages/ui/`,`/design-system/`,`/design-systems/`,`/primitives/`],d=5e3,f=8e3,p=1e4,ee=.5,m=2147483647,te=2147483645,ne=.7,re=1e3/60,ie=.5,ae=.01,oe=r(.4),se=r(.05),ce=r(.5),le=r(.08),ue=r(.15),de=.2,fe=[`id`,`class`,`aria-label`,`data-testid`,`role`,`name`,`title`],pe=new Set([`id`,`data-testid`,`aria-label`,`href`,`src`,`alt`,`type`,`name`,`placeholder`,`role`,`for`,`action`,`method`,`title`,`disabled`,`checked`,`readonly`,`required`,`selected`,`open`]),me=new Set([`a`,`code`,`pre`]),he=new Set([`script`,`style`,`template`,`noscript`]),ge=[`Meta`,`Control`,`Shift`,`Alt`],_e=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`]),ve=`data-react-grab-frozen`,ye=`data-react-grab-same-origin-frame`,be=.18,xe=.6,Se=.5,Ce=`data-react-grab-input`,we=.5,Te=`copy`,Ee=`comment`,De=`edit`,Oe=`superellipse(1.25)`,ke=.75,Ae=.01,je=1e3,Me={left:-9999,top:-9999},Ne={left:`left center`,right:`right center`,top:`center top`,bottom:`center bottom`},Pe=1e3,Fe=`#00000000`,Ie=`transparent`,Le=2e3,Re=`cubic-bezier(0.34, 1.56, 0.64, 1)`,ze=12e3,Be=9e3,Ve=1e4,He=8e3,Ue=5e3,We=1e3,Ge=1e7,Ke=1.2,qe=-9999,Je=new Set(`display.position.top.right.bottom.left.z-index.overflow.overflow-x.overflow-y.width.height.min-width.min-height.max-width.max-height.margin-top.margin-right.margin-bottom.margin-left.padding-top.padding-right.padding-bottom.padding-left.flex-direction.flex-wrap.justify-content.align-items.align-self.align-content.flex-grow.flex-shrink.flex-basis.order.gap.row-gap.column-gap.grid-template-columns.grid-template-rows.grid-template-areas.font-family.font-size.font-weight.font-style.line-height.letter-spacing.text-align.text-decoration-line.text-decoration-style.text-transform.text-overflow.text-shadow.white-space.word-break.overflow-wrap.vertical-align.color.background-color.background-image.background-position.background-size.background-repeat.border-top-width.border-right-width.border-bottom-width.border-left-width.border-top-style.border-right-style.border-bottom-style.border-left-style.border-top-color.border-right-color.border-bottom-color.border-left-color.border-top-left-radius.border-top-right-radius.border-bottom-left-radius.border-bottom-right-radius.box-shadow.opacity.transform.filter.backdrop-filter.object-fit.object-position`.split(`.`)),Ye=e=>typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE,h=e=>Ye(e)&&e.namespaceURI===`http://www.w3.org/1999/xhtml`,g=e=>h(e)&&e.tagName===`IFRAME`,Xe=new WeakMap,_=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?t:0},Ze=e=>{let t=performance.now(),n=Xe.get(e);if(n&&t-n.timestamp<16)return n.metrics;let r=e.ownerDocument.defaultView?.getComputedStyle(e),i;if(!r)i={contentOffsetX:e.clientLeft,contentOffsetY:e.clientTop,height:e.offsetHeight,width:e.offsetWidth};else{let t=_(r.borderLeftWidth),n=_(r.borderRightWidth),a=_(r.borderTopWidth),o=_(r.borderBottomWidth),s=_(r.paddingLeft),c=_(r.paddingRight),l=_(r.paddingTop),u=_(r.paddingBottom),d=_(r.width),f=_(r.height),p=t+n+s+c,ee=a+o+l+u,m=r.boxSizing===`border-box`?d:d+p,te=r.boxSizing===`border-box`?f:f+ee;i={contentOffsetX:t+s,contentOffsetY:a+l,height:te>0?te:e.offsetHeight,width:m>0?m:e.offsetWidth}}return Xe.set(e,{metrics:i,timestamp:t}),i},Qe=(e,t)=>t>0?e/t:1,$e=e=>{if(!e)return null;try{return e.frameElement}catch{return null}},et=(e,t,n)=>{let r=t,i=n,a=1,o=1,s=e;for(;s&&s!==window;){let e=$e(s);if(!e||!g(e))break;let t=e.getBoundingClientRect(),n=Ze(e),c=Qe(t.width,n.width),l=Qe(t.height,n.height);r=t.left+(n.contentOffsetX+r)*c,i=t.top+(n.contentOffsetY+i)*l,a*=c,o*=l,s=e.ownerDocument.defaultView}return{x:r,y:i,scaleX:a,scaleY:o}},tt=e=>{let t=e.ownerDocument.defaultView;return t?t.getComputedStyle(e):window.getComputedStyle(e)},nt=(e,t)=>e.replace(/([\d.]+)px/g,(e,n)=>{let r=Number(n)*Math.abs(t);return`${Number(r.toFixed(3))}px`}),rt=(e,t,n)=>{let[r,i]=e.split(`/`).map(e=>e.trim()),a=nt(r,t),o=nt(i??r,n);return i===void 0&&a===o?a:`${a} / ${o}`},it=e=>Object.assign(e,{[Symbol.dispose]:e}),at=`bippy-0.6.1`,ot=Object.defineProperty,st=Object.prototype.hasOwnProperty,v=()=>{},ct=e=>{try{Function.prototype.toString.call(e).indexOf(`^_^`)>-1&&setTimeout(()=>{throw Error(`React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://reactjs.org/link/perf-use-production-build`)})}catch{}},lt=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>!!(e&&`getFiberRoots`in e);let ut=!1,dt;const ft=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>ut?!0:(e&&typeof e.inject==`function`&&(dt=e.inject.toString()),!!dt?.includes(`(injected)`)),y=new Set,pt=new Set,mt=e=>{e&&y.add(e);let t=new Map,n=0,r={_instrumentationIsActive:!1,_instrumentationSource:at,checkDCE:ct,hasUnsupportedRendererAttached:!1,inject(e){let i=++n;return t.set(i,e),pt.add(e),r._instrumentationIsActive||(r._instrumentationIsActive=!0,y.forEach(e=>e())),i},on:v,onCommitFiberRoot:v,onCommitFiberUnmount:v,onPostCommitFiberRoot:v,renderers:t,supportsFiber:!0,supportsFlight:!0};try{ot(globalThis,`__REACT_DEVTOOLS_GLOBAL_HOOK__`,{configurable:!0,enumerable:!0,get(){return r},set(t){if(t&&typeof t==`object`){let n=r.renderers;r=t,n.size>0&&(n.forEach((e,n)=>{pt.add(e),t.renderers.set(n,e)}),ht(e))}}});let t=window.hasOwnProperty,n=!1;ot(window,`hasOwnProperty`,{configurable:!0,value:function(...e){try{if(!n&&e[0]===`__REACT_DEVTOOLS_GLOBAL_HOOK__`)return globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__=void 0,n=!0,-0}catch{}return t.apply(this,e)},writable:!0})}catch{ht(e)}return r},ht=e=>{e&&y.add(e);try{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t)return;if(!t._instrumentationSource){t.checkDCE=ct,t.supportsFiber=!0,t.supportsFlight=!0,t.hasUnsupportedRendererAttached=!1,t._instrumentationSource=at,t._instrumentationIsActive=!1;let e=lt(t);if(e||(t.on=v),t.renderers.size){t._instrumentationIsActive=!0,y.forEach(e=>e());return}let n=t.inject,r=ft(t);r&&!e&&(ut=!0,t.inject({scheduleRefresh(){}})&&(t._instrumentationIsActive=!0)),t.inject=e=>{let i=n(e);return pt.add(e),r&&t.renderers.set(i,e),t._instrumentationIsActive=!0,y.forEach(e=>e()),i}}(t.renderers.size||t._instrumentationIsActive||ft())&&e?.()}catch{}},gt=()=>st.call(globalThis,`__REACT_DEVTOOLS_GLOBAL_HOOK__`),b=e=>gt()?(ht(e),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):mt(e),_t=()=>!!(typeof window<`u`&&(window.document?.createElement||window.navigator?.product===`ReactNative`));
|
|
10
|
+
/**
|
|
11
|
+
* @license bippy
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Aiden Bai
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/
|
|
18
|
+
(()=>{try{_t()&&b()}catch{}})();
|
|
19
|
+
/**
|
|
20
|
+
* @license bippy
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) Aiden Bai
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/
|
|
27
|
+
const vt=e=>{switch(e.tag){case 5:case 26:case 27:return!0;default:return typeof e.type==`string`}},yt=e=>{switch(e.tag){case 1:case 11:case 0:case 14:case 15:return!0;default:return!1}},bt=e=>!e||typeof e!=`object`?!1:`pendingProps`in e&&!(`containerInfo`in e),xt=e=>{let t=e.memoizedProps,n=e.alternate?.memoizedProps||{},r=e.flags??e.effectTag??0;switch(e.tag){case 1:case 9:case 11:case 0:case 14:case 15:return(r&1)==1;default:return e.alternate?n!==t||e.alternate.memoizedState!==e.memoizedState||e.alternate.ref!==e.ref:!0}},St=e=>{switch(e.tag){case 18:return!0;case 7:case 6:case 23:case 22:return!0;case 3:return!1;default:{let t=typeof e.type==`object`&&e.type!==null?e.type.$$typeof:e.type;if(typeof t==`symbol`)return t.description===`react.concurrent_mode`||t.description===`react.async_mode`;switch(t){case 60111:case`Symbol(react.concurrent_mode)`:case`Symbol(react.async_mode)`:return!0;default:return!1}}}},Ct=e=>{let t=[],n=[];for(vt(e)?t.push(e):e.child&&n.push(e.child);n.length;){let e=n.pop();if(!e)break;vt(e)?t.push(e):e.child&&n.push(e.child),e.sibling&&n.push(e.sibling)}return t};function wt(e,t,n=!1){if(!e)return null;let r=t(e);if(r instanceof Promise)return(async()=>{if(await r===!0)return e;let i=n?e.return:e.child;for(;i;){let e=await Et(i,t,n);if(e)return e;i=n?null:i.sibling}return null})();if(r===!0)return e;let i=n?e.return:e.child;for(;i;){let e=Tt(i,t,n);if(e)return e;i=n?null:i.sibling}return null}const Tt=(e,t,n=!1)=>{if(!e)return null;if(t(e)===!0)return e;let r=n?e.return:e.child;for(;r;){let e=Tt(r,t,n);if(e)return e;r=n?null:r.sibling}return null},Et=async(e,t,n=!1)=>{if(!e)return null;if(await t(e)===!0)return e;let r=n?e.return:e.child;for(;r;){let e=await Et(r,t,n);if(e)return e;r=n?null:r.sibling}return null},Dt=e=>{let t=e;return typeof t==`function`?t:typeof t==`object`&&t?Dt(t.type||t.render):null},Ot=e=>{let t=e;if(typeof t==`string`)return t;if(typeof t!=`function`&&!(typeof t==`object`&&t))return null;let n=t.displayName||t.name||null;if(n)return n;let r=Dt(t);return r&&(r.displayName||r.name)||null},kt=()=>{let e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;return!!e?._instrumentationIsActive||lt(e)||ft(e)},At=new Set,jt=e=>{let t=e.alternate;if(!t)return e;if(t.actualStartTime&&e.actualStartTime)return t.actualStartTime>e.actualStartTime?t:e;for(let t of At){let n=wt(t.current,t=>{if(t===e)return!0});if(n)return n}return e};let Mt=0;const x=new WeakMap,Nt=(e,t=Mt++)=>{x.set(e,t)},Pt=e=>{let t=x.get(e);return t===void 0&&e.alternate&&(t=x.get(e.alternate)),t===void 0&&(t=Mt++,Nt(e,t)),t},S=(e,t,n)=>{let r=t;for(;r!=null;){if(x.has(r)||Pt(r),!St(r)&&xt(r)&&e(r,`mount`),r.tag===13)if(r.memoizedState!==null){let t=r.child,n=t?t.sibling:null;if(n){let t=n.child;t!==null&&S(e,t,!1)}}else{let t=null;r.child!==null&&(t=r.child.child),t!==null&&S(e,t,!1)}else r.child!=null&&S(e,r.child,!0);r=n?r.sibling:null}},Ft=(e,t,n,r)=>{if(x.has(t)||Pt(t),!n)return;x.has(n)||Pt(n);let i=t.tag===13,a=!St(t);a&&xt(t)&&e(t,`update`);let o=i&&n.memoizedState!==null,s=i&&t.memoizedState!==null;if(o&&s){let r=t.child?.sibling??null,i=n.child?.sibling??null;r!==null&&i!==null&&Ft(e,r,i,t)}else if(o&&!s){let n=t.child;n!==null&&S(e,n,!0)}else if(!o&&s){Lt(e,n);let r=t.child?.sibling??null;r!==null&&S(e,r,!0)}else if(t.child!==n.child){let n=t.child;for(;n;){if(n.alternate){let i=n.alternate;Ft(e,n,i,a?t:r)}else S(e,n,!1);n=n.sibling}}},It=(e,t)=>{(t.tag===3||!St(t))&&e(t,`unmount`)},Lt=(e,t)=>{let n=t.tag===13&&t.memoizedState!==null,r=t.child;for(n&&(r=(t.child?.sibling??null)?.child??null);r!==null;)r.return!==null&&(It(e,r),Lt(e,r)),r=r.sibling},Rt=e=>{if(!gt())return null;let t=e;for(;t.return;)t=t.return;let n=Gt.get(t.stateNode);return n===void 0?null:b().renderers?.get(n)??null},zt=e=>Object.prototype.toString.call(e)===`[object Object]`&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null),Bt=(e,t=[])=>{if(!zt(e))return[{path:t,value:e}];let n=[];for(let r in e){let i=e[r],a=t.concat(r);zt(i)?n.push(...Bt(i,a)):n.push({path:a,value:i})}return n},Vt=new Set,Ht=new Set,Ut=new Set,Wt=new Set,C=new WeakMap,Gt=new WeakMap,Kt=e=>{let t=C.get(e)??{};if(C.set(e,t),!t.onCommitFiberRoot||e.onCommitFiberRoot!==t.onCommitFiberRoot){let n=e.onCommitFiberRoot,r=(t,i,a)=>{if(n?.(t,i,a),C.get(e)?.onCommitFiberRoot===r){At.add(i),Gt.set(i,t);for(let e of Vt)e(t,i,a)}};t.onCommitFiberRoot=r,e.onCommitFiberRoot=r}if(!t.onCommitFiberUnmount||e.onCommitFiberUnmount!==t.onCommitFiberUnmount){let n=e.onCommitFiberUnmount,r=(t,i)=>{if(n?.(t,i),C.get(e)?.onCommitFiberUnmount===r)for(let e of Ht)e(t,i)};t.onCommitFiberUnmount=r,e.onCommitFiberUnmount=r}if(!t.onPostCommitFiberRoot||e.onPostCommitFiberRoot!==t.onPostCommitFiberRoot){let n=e.onPostCommitFiberRoot,r=(t,i)=>{if(n?.(t,i),C.get(e)?.onPostCommitFiberRoot===r)for(let e of Ut)e(t,i)};t.onPostCommitFiberRoot=r,e.onPostCommitFiberRoot=r}if(!t.onScheduleFiberRoot||e.onScheduleFiberRoot!==t.onScheduleFiberRoot){let n=e.onScheduleFiberRoot,r=(t,i,a)=>{if(n?.(t,i,a),C.get(e)?.onScheduleFiberRoot===r)for(let e of Wt)e(t,i,a)};t.onScheduleFiberRoot=r,e.onScheduleFiberRoot=r}},qt=e=>{let t=b(e.onActive);t._instrumentationSource=e.name??at,Kt(t);let{onActive:n,onCommitFiberRoot:r,onCommitFiberUnmount:i,onPostCommitFiberRoot:a,onScheduleFiberRoot:o}=e;return r&&Vt.add(r),i&&Ht.add(i),a&&Ut.add(a),o&&Wt.add(o),it(()=>{n&&y.delete(n),r&&Vt.delete(r),i&&Ht.delete(i),a&&Ut.delete(a),o&&Wt.delete(o)})},Jt=new Set,Yt=e=>e.startsWith(`__reactContainer$`)||e.startsWith(`__reactInternalInstance$`)||e.startsWith(`__reactFiber`),Xt=e=>{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t?.renderers)for(let n of t.renderers.values())try{let t=n.findFiberByHostInstance?.(e);if(t)return t}catch{}if(typeof e==`object`&&e){if(`_reactRootContainer`in e)return e._reactRootContainer?._internalRoot?.current?.child;let t=e.__internalInstanceHandle??e._internalInstanceHandle;if(bt(t))return t;let n=e;for(let e of Jt){let t=n[e];if(t)return t}for(let e of Object.keys(n))if(Yt(e))return Jt.add(e),n[e]||null;for(let t of At){if(Rt(t.current)?.findFiberByHostInstance)continue;let n=wt(t.current,t=>t.stateNode===e);if(n)return n}}return null},Zt=new WeakMap,Qt=(e,t)=>{Zt.set(e,t)},w=e=>Zt.get(e)??null,$t=e=>w(e)?.getFiber()??Xt(e);let en=new WeakMap,tn=new WeakMap;const nn=()=>{en=new WeakMap,tn=new WeakMap},rn=(e,t,n)=>{let r=tn.get(e);if(r&&n-r.timestamp<200)return r.borderRadius;let i=(t??tt(e)).borderRadius||`0px`;return tn.set(e,{borderRadius:i,timestamp:n}),i},an=e=>{let t=performance.now(),n=en.get(e);if(n&&t-n.timestamp<16)return n.bounds;let r=w(e);if(r){let n=r.getBounds();return en.set(e,{bounds:n,timestamp:t}),n}let i=e.getBoundingClientRect(),a=et(e.ownerDocument.defaultView,i.left,i.top),o={borderRadius:rt(rn(e,null,t),a.scaleX,a.scaleY),height:i.height*a.scaleY,width:i.width*a.scaleX,x:a.x,y:a.y};return en.set(e,{bounds:o,timestamp:t}),o},on=e=>{let t=e.ownerDocument?.defaultView;return!!(t&&e instanceof t.ShadowRoot)};var T=class extends Error{constructor(e,t){super(e,t),this.name=`ReactGrabError`}},E=class extends T{constructor(e,t){super(e,{cause:t}),this.name=`RecoverableError`}},sn=class extends T{constructor(e){super(`Failed to freeze page`,{cause:e}),this.name=`FreezeError`}},cn=class extends E{constructor(e,t,n){super(`Failed to open source file "${e}"`,n),this.name=`OpenFileError`,this.filePath=e,this.lineNumber=t}},ln=class extends E{constructor(e,t,n){super(`Plugin hook "${t}" failed for "${e}"`,n),this.name=`PluginHookError`,this.pluginName=e,this.hookName=t}},un=class extends E{constructor(e,t){super(`Plugin cleanup failed for "${e}"`,t),this.name=`PluginCleanupError`,this.pluginName=e}},dn=class extends E{constructor(e,t){super(`Plugin setup failed for "${e}"`,t),this.name=`PluginSetupError`,this.pluginName=e}},fn=class extends E{constructor(e,t){super(`Action "${e}" failed`,t),this.name=`ContextMenuActionError`,this.actionId=e}},pn=class extends E{constructor(e,t){super(`Action "${e}" enabled check failed`,t),this.name=`ContextMenuActionEnabledError`,this.actionId=e}},mn=class extends T{constructor(){super(`Can't generate CSS selector for non-element node type.`),this.name=`NonElementNodeError`}},hn=class extends T{constructor(e){super(`Timeout: Can't find a unique selector after ${e}ms`),this.name=`SelectorTimeoutError`,this.timeoutMs=e}},gn=class extends T{constructor(){super(`Selector was not found.`),this.name=`SelectorNotFoundError`}},_n=class extends T{constructor(){super(`Failed to copy`),this.name=`CopyFailedError`}};const vn=e=>w(e)?.getTagName()??(e.tagName||``).toLowerCase(),yn=new WeakMap,bn=(e=document)=>{let t=yn.get(e);if(t!==void 0)return t;let n=e.querySelector(`script[nonce], style[nonce]`),r=n?.nonce||n?.getAttribute(`nonce`)||null;return r&&yn.set(e,r),r},xn=[[`data-rr-block`,``],[`data-rr-ignore`,``],[`data-rr-mask`,``],[`data-sentry-block`,``],[`data-sentry-ignore`,``],[`data-sentry-mask`,``],[`data-dd-privacy`,`hidden`],[`data-fs-exclude`,``],[`data-lr-exclude`,``],[`data-hj-suppress`,``],[`data-recording-disable`,``],[`data-clarity-mask`,`true`],[`data-heap-redact-text`,``]],Sn=e=>{for(let[t,n]of xn)e.setAttribute(t,n);e.setAttribute(`data-testid`,`react-grab-overlay`),e.classList.add(`ph-no-capture`)},Cn=e=>typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===9,wn=e=>{if(e.assignedSlot)return e.assignedSlot;if(e.parentElement)return e.parentElement;let t=e.getRootNode();return on(t)?t.host:Cn(t)?$e(t.defaultView):null};let Tn=null;const En=e=>{Tn=e},Dn=()=>Tn,On=e=>{if(!Tn)return!0;let t=e;for(;t;){if(t===Tn)return!0;t=wn(t)}return!1},kn=e=>e,An=typeof window<`u`,jn=e=>0,Mn=e=>{},D=An?(Object.getOwnPropertyDescriptor(Window.prototype,`requestAnimationFrame`)?.value??window.requestAnimationFrame).bind(window):jn,Nn=An?(Object.getOwnPropertyDescriptor(Window.prototype,`cancelAnimationFrame`)?.value??window.cancelAnimationFrame).bind(window):Mn,Pn=()=>An?new Promise(e=>D(()=>e())):Promise.resolve(),O=e=>{try{return e.contentDocument}catch{return null}},Fn=(e,t,n)=>{let r=e.getBoundingClientRect(),i=Ze(e),a=Qe(r.width,i.width),o=Qe(r.height,i.height);return{x:(t-r.left)/a-i.contentOffsetX,y:(n-r.top)/o-i.contentOffsetY}},In=(e,t,n)=>{let r=e.elementFromPoint(t,n);for(;r;){let e=r.shadowRoot?.elementFromPoint(t,n);if(e&&e!==r){r=e;continue}if(g(r)){let e=O(r);if(!e)return r;let i=Fn(r,t,n);return In(e,i.x,i.y)??r}return r}return null},Ln=(e,t)=>In(document,e,t),Rn=e=>{let t=e;for(;t;){if(t.hasAttribute(`data-react-grab-ignore`))return!0;t=wn(t)}return!1},zn=typeof Element<`u`&&typeof Element.prototype.checkVisibility==`function`,Bn={checkOpacity:!0,checkVisibilityCSS:!0,opacityProperty:!0,visibilityProperty:!0},Vn={checkVisibilityCSS:!0,visibilityProperty:!0},Hn=(e,t)=>{if(zn&&!t)return e.checkVisibility(Bn)?!0:e.checkVisibility(Vn)?tt(e).opacity!==`0`:!1;let n=t??tt(e);return n.display!==`none`&&n.visibility!==`hidden`&&n.opacity!==`0`},Un=e=>{let t=vn(e);return t===`html`||t===`body`},Wn=[`data-react-grab`,`data-react-grab-demo`],Gn=e=>Wn.some(t=>e.hasAttribute(t)),Kn=e=>{if(Gn(e))return!0;let t=e.getRootNode();return on(t)&&Gn(t.host)},qn=e=>{let t=parseInt(e.zIndex,10);return e.pointerEvents===`none`&&e.position===`fixed`&&!isNaN(t)&&t>=2147483600},Jn=e=>{let t=e.backgroundColor;return t===`transparent`||t===`rgba(0, 0, 0, 0)`},Yn=e=>{let t=e.position;if(t!==`fixed`&&t!==`absolute`)return!1;if(Jn(e)||parseFloat(e.opacity)<.1)return!0;let n=parseInt(e.zIndex,10);return!isNaN(n)&&n>1e3};let Xn=new WeakMap;const Zn=()=>{Xn=new WeakMap},Qn=e=>{let t=w(e);if(t)return t.isConnected();if(Un(e)||Kn(e)||Rn(e))return!1;let n=performance.now(),r=Xn.get(e);if(r&&n-r.timestamp<50)return r.isVisible;if(!Hn(e))return Xn.set(e,{isVisible:!1,timestamp:n}),!1;if(e.clientWidth/(e.ownerDocument.defaultView?.innerWidth??window.innerWidth)>=.9&&e.clientHeight/(e.ownerDocument.defaultView?.innerHeight??window.innerHeight)>=.9){let t=tt(e);if(qn(t)||Yn(t))return!1}return Xn.set(e,{isVisible:!0,timestamp:n}),!0},$n=(e,t,n)=>{let r=!0;for(let i of e.elementsFromPoint(t,n)){if(Rn(i)&&(r=!1),!On(i))continue;let a=i.shadowRoot;if(r&&a&&a!==e){let e=$n(a,t,n);if(e)return e}if(r&&g(i)){let e=O(i);if(e){let r=Fn(i,t,n),a=$n(e,r.x,r.y);if(a)return a}}if(Qn(i))return i}return null},er=(e,t)=>$n(document,e,t),tr=(e,t,n,r)=>{let i=e.elementsFromPoint(t,n),a=!0;for(let o of i){if(Rn(o)&&(a=!1),a&&o.shadowRoot&&o.shadowRoot!==e&&tr(o.shadowRoot,t,n,r),a&&g(o)){let e=O(o);if(e){let i=Fn(o,t,n);tr(e,i.x,i.y,r)}}r.add(o)}},nr=(e,t)=>{let n=new Set;return tr(document,e,t,n),[...n]},rr=(e,t,n)=>e>=n.left&&e<=n.right&&t>=n.top&&t<=n.bottom,ir=(e,t,n=document)=>{let r=n.createElement(`style`);r.setAttribute(e,``);let i=bn(n);return i&&(r.nonce=i),Sn(r),r.textContent=t,n.head.appendChild(r),r},ar=`html { pointer-events: none !important; }
|
|
28
|
+
iframe[${ye}] { pointer-events: auto !important; }`,or=new Set,k=new Map;let A=!1;const sr=e=>{if(k.has(e))return;let t=ir(`data-react-grab-frozen-pseudo`,ar,e),n=ir(`data-react-grab-hittest-override`,`html, body { pointer-events: auto !important; }`,e);n.disabled=!0,k.set(e,{pointerEventsStyle:t,hitTestOverrideStyle:n})},cr=e=>{let t=k.get(e);t&&(t.pointerEventsStyle.remove(),t.hitTestOverrideStyle.remove(),k.delete(e))},lr=()=>A,ur=e=>(or.add(e),A&&sr(e),()=>{or.delete(e),cr(e)}),dr=()=>{if(!A){A=!0,or.add(document);for(let e of or)sr(e)}},fr=()=>{if(A){A=!1;for(let e of[...k.keys()])cr(e)}},pr=()=>{if(A)for(let e of k.values())e.pointerEventsStyle.disabled||(e.pointerEventsStyle.disabled=!0),e.hitTestOverrideStyle.disabled&&(e.hitTestOverrideStyle.disabled=!1)},mr=()=>{if(A)for(let e of k.values())e.pointerEventsStyle.disabled&&(e.pointerEventsStyle.disabled=!1),e.hitTestOverrideStyle.disabled||(e.hitTestOverrideStyle.disabled=!0)},hr=new WeakMap,j=new WeakMap,gr=[`name`,`position`,`rotation`,`scale`,`color`,`visible`,`args`],M=e=>typeof e==`object`&&!!e,_r=e=>typeof e==`object`&&!!e||typeof e==`function`,N=(e,t)=>typeof e[t]==`function`,vr=e=>M(e)&&typeof e.x==`number`&&typeof e.y==`number`&&typeof e.z==`number`&&N(e,`set`)&&N(e,`clone`)&&N(e,`applyMatrix4`)&&N(e,`project`),yr=e=>M(e)&&N(e,`clone`)&&N(e,`premultiply`),br=e=>M(e)&&`boundingBox`in e&&N(e,`computeBoundingBox`),xr=e=>M(e)&&typeof e.type==`string`&&M(e.props)&&Sr(e.object),Sr=e=>M(e)&&e.isObject3D===!0&&typeof e.uuid==`string`&&typeof e.name==`string`&&typeof e.type==`string`&&typeof e.visible==`boolean`&&yr(e.matrixWorld)&&N(e,`updateWorldMatrix`),Cr=e=>M(e)&&e.isCamera===!0,wr=e=>Sr(e)&&e.isScene===!0&&Array.isArray(e.children),Tr=e=>M(e)&&typeof e.tagName==`string`&&e.tagName.toLowerCase()===`canvas`&&N(e,`getContext`),Er=e=>M(e)&&Tr(e.domElement),Dr=e=>M(e)&&N(e,`set`),Or=e=>M(e)&&N(e,`setFromCamera`)&&N(e,`intersectObjects`),kr=e=>M(e)&&Er(e.gl)&&wr(e.scene)&&Cr(e.camera)&&Or(e.raycaster)&&Dr(e.pointer),Ar=e=>xr(e.__r3f)?e.__r3f:null,jr=e=>{let t=e.current.stateNode;if(!M(t)||!_r(t.containerInfo))return null;let n=Reflect.get(t.containerInfo,`getState`);if(typeof n!=`function`)return null;let r=n();return kr(r)?r:null};qt({name:`react-grab-three-selection`,onCommitFiberRoot:(e,t)=>{let n=jr(t);n&&j.set(n.gl.domElement,{isReactThreeFiber:!0,state:n})}});const Mr=e=>{let t=e;for(;t;){if(Ar(t))return t;t=t.parent}return null},Nr=e=>{let t=e;for(;t;){let e=Ar(t);if(e&&typeof e.eventCount==`number`&&e.eventCount>0)return!0;t=t.parent}return!1},Pr=(e,t)=>{let n=e;for(;n;){if(n===t)return!0;n=n.parent}return!1},Fr=(e,t,n)=>{let r=typeof n.instanceId==`number`&&Number.isInteger(n.instanceId)?n.instanceId:null,i=hr.get(t);i||(i=new Map,hr.set(t,i));let a=i.get(r);if(a)return a.canvas=e.gl.domElement,a.intersectionPoint=vr(n.point)?n.point:null,a.object=t,a.rootState=e,a.element;let o=Ar(t),s=o?Xt(o):null;if(o&&!s)return null;let c=(o?.type||t.type||`object-3d`).toLowerCase(),l=e.gl.domElement.ownerDocument.createElement(c),u={canvas:e.gl.domElement,element:l,fiber:s,instance:o,instanceId:r,intersectionPoint:vr(n.point)?n.point:null,object:t,rootState:e,tagName:c},d=l.getBoundingClientRect.bind(l);return l.getBoundingClientRect=()=>{let e=Wr(u),t=l.ownerDocument.defaultView?.DOMRect;return t?new t(e.x,e.y,e.width,e.height):d()},Qt(l,{hostElement:u.canvas,supportsDomEditing:!1,getBounds:()=>Wr(u),getFiber:()=>u.fiber?jt(u.fiber):null,getPreview:()=>zr(u),getSelector:()=>Br(u),getTagName:()=>u.tagName,isConnected:()=>u.canvas.isConnected&&Pr(u.object,u.rootState.scene)}),i.set(r,u),l},Ir=(e,t,n)=>{if(!Tr(e))return e;let r=j.get(e);if(!r)return e;let i=an(e);if(i.width<=0||i.height<=0)return e;let a=(t-i.x)/i.width*2-1,o=-((n-i.y)/i.height)*2+1;if(a<-1||a>1||o<-1||o>1)return e;try{r.state.pointer.set(a,o),r.state.raycaster.setFromCamera(r.state.pointer,r.state.camera);let e=r.state.raycaster.intersectObjects(r.state.scene.children,!0);if(r.isReactThreeFiber)for(let t of e){if(!Nr(t.object))continue;let e=Mr(t.object);if(!e||e.visible===!1)continue;let n=Fr(r.state,e,t);if(n)return n}for(let t of e){let e=r.isReactThreeFiber?Mr(t.object):t.object;if(!e||e.visible===!1)continue;let n=Fr(r.state,e,t);if(n)return n}}catch{}return e},Lr=e=>{let t={gl:e.renderer,scene:e.scene,camera:e.camera,raycaster:e.raycaster,pointer:e.pointer};if(!kr(t))throw TypeError(`Invalid Three.js scene registration`);let n=t.gl.domElement,r={isReactThreeFiber:!1,state:t};return j.set(n,r),()=>{j.get(n)===r&&j.delete(n)}},Rr=e=>typeof e==`string`?JSON.stringify(e):typeof e==`number`||typeof e==`boolean`?`{${String(e)}}`:Array.isArray(e)&&e.length<=4&&e.every(e=>typeof e==`number`||typeof e==`string`)?`{${JSON.stringify(e)}}`:null,zr=e=>{let t=e.instance?.props??{},n=[];for(let r of gr){let i=t[r];r===`name`&&i===void 0&&e.object.name&&(i=e.object.name);let a=Rr(i);a&&n.push(`${r}=${a}`)}return e.instanceId!==null&&n.push(`instanceId={${e.instanceId}}`),`<${e.tagName}${n.length>0?` ${n.join(` `)}`:``} />`},Br=e=>{if(e.object.name)return`${e.tagName}[name=${JSON.stringify(e.object.name)}]`;let t=e.instanceId===null?``:`:${e.instanceId}`;return`${e.tagName}[uuid=${JSON.stringify(`${e.object.uuid}${t}`)}]`},Vr=e=>{e.object.updateWorldMatrix(!0,!1);let t=e.object.matrixWorld.clone();if(e.instanceId===null||!e.object.getMatrixAt)return t;let n=e.object.matrixWorld.clone();return e.object.getMatrixAt(e.instanceId,n),n.premultiply(t)},Hr=e=>{if(!br(e.geometry))return null;e.geometry.boundingBox||e.geometry.computeBoundingBox();let t=e.geometry.boundingBox;return!t||!vr(t.min)||!vr(t.max)?null:t},Ur=(e,t)=>{let n=t.x+t.width/2,r=t.y+t.height/2;if(e.intersectionPoint){let i=e.intersectionPoint.clone().project(e.rootState.camera);Number.isFinite(i.x)&&Number.isFinite(i.y)&&(n=t.x+(i.x+1)/2*t.width,r=t.y+(1-i.y)/2*t.height)}return{x:n-16/2,y:r-16/2,width:16,height:16,borderRadius:`0px`}},Wr=e=>{let t=an(e.canvas),n=Hr(e.object);if(!n)return Ur(e,t);let r=Vr(e),i=[n.min.x,n.max.x],a=[n.min.y,n.max.y],o=[n.min.z,n.max.z],s=1/0,c=1/0,l=-1/0,u=-1/0,d=n.min.clone();for(let n of i)for(let i of a)for(let a of o){if(d.set(n,i,a).applyMatrix4(r).project(e.rootState.camera),!Number.isFinite(d.x)||!Number.isFinite(d.y))continue;let o=t.x+(d.x+1)/2*t.width,f=t.y+(1-d.y)/2*t.height;s=Math.min(s,o),c=Math.min(c,f),l=Math.max(l,o),u=Math.max(u,f)}if(!Number.isFinite(s)||!Number.isFinite(c)||!Number.isFinite(l)||!Number.isFinite(u))return Ur(e,t);let f=Math.max(t.x,s),p=Math.max(t.y,c),ee=Math.min(t.x+t.width,l),m=Math.min(t.y+t.height,u);return ee<=f||m<=p?Ur(e,t):{x:f,y:p,width:ee-f,height:m-p,borderRadius:`0px`}};let P=null,F=null,I=null;const Gr=()=>{I!==null&&clearTimeout(I),I=setTimeout(()=>{I=null,mr()},100)},Kr=()=>{I!==null&&(clearTimeout(I),I=null)},qr=(e,t,n,r)=>{let i=Math.abs(e-n),a=Math.abs(t-r);return i<=2&&a<=2},Jr=(e,t)=>{if(!Number.isFinite(e)||!Number.isFinite(t))return[];Kr(),pr();try{let n=nr(e,t),r=Dn()?n.filter(On):n,i=[];for(let n of r)i.push(Ir(n,e,t));return i}finally{Gr()}},Yr=(e,t)=>{if(!Number.isFinite(e)||!Number.isFinite(t))return null;let n=performance.now();if(F){let r=F.element,i=n-F.timestamp<16;if(r.isConnected&&i&&rr(e,t,F.bounds)&&!O(r))return r;F=null,P?.element===r&&(P=null)}if(P){let r=qr(e,t,P.clientX,P.clientY),i=n-P.timestamp<16;if(r||i)return P.element}Kr(),pr();try{let r=null,i=Ln(e,t),a=i?Ir(i,e,t):null;if(r=i&&a&&Qn(a)&&On(i)?a:er(e,t),r&&g(r)&&!O(r)){let e=an(r);F={element:r,timestamp:n,bounds:{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height}}}else F=null;return P={clientX:e,clientY:t,element:r,timestamp:n},r}finally{Gr()}},Xr=()=>{Kr(),mr(),P=null,F=null},L=e=>{console.warn(`[react-grab]`,e)},Zr=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]);let R=!1;const z=new Map;let Qr=-1;const $r=new WeakSet,B=new Map,V=new Map,ei=e=>$r.has(e)?!0:!R||!(`gsapVersions`in window)||!(Error().stack??``).includes(`_tick`)?!1:($r.add(e),!0);typeof window<`u`&&(window.requestAnimationFrame=e=>{if(!ei(e))return D(e);if(R){let t=Qr--;return z.set(t,e),t}let t=D(n=>{if(R){let n=Qr--;z.set(n,e),B.set(t,n);return}e(n)});return t},window.cancelAnimationFrame=e=>{if(z.has(e)){z.delete(e);return}let t=V.get(e);if(t!==void 0){Nn(t.nativeId),V.delete(e);return}let n=B.get(e);if(n!==void 0){z.delete(n),B.delete(e);return}Nn(e)});const ti=()=>{if(!R){R=!0,z.clear(),B.clear();for(let[e,{nativeId:t,callback:n}]of V)Nn(t),z.set(e,n);V.clear()}},ni=()=>{if(R){R=!1;for(let[e,t]of z.entries()){let n=D(n=>{V.delete(e),t(n)});V.set(e,{nativeId:n,callback:t})}z.clear(),B.clear()}},H=(e,t)=>{if(e.length!==0)throw e.length===1?e[0]:AggregateError(e,t)},ri=`
|
|
29
|
+
[${ve}],
|
|
30
|
+
[${ve}] * {
|
|
31
|
+
animation-play-state: paused !important;
|
|
32
|
+
transition: none !important;
|
|
33
|
+
}
|
|
34
|
+
`,ii=e=>e?.namespaceURI===`http://www.w3.org/2000/svg`&&e.tagName===`svg`;let ai=null,U=[],W=[],oi=[];const G=new Set,K=new Map,q=new Map;let J=[];const si=()=>K.size>0,ci=()=>{ai||=ir(`data-react-grab-frozen-styles`,ri)},li=e=>{let t=new Set;for(let n of e){let e=ii(n)?n:n.closest(`svg`);ii(e)&&t.add(e);for(let e of n.querySelectorAll(`svg`))ii(e)&&t.add(e)}return[...t]},ui=(e,t)=>{let n=Reflect.get(e,t);typeof n==`function`&&n.call(e)},di=(e,t)=>{for(let n of e){let e=q.get(n)??0;if(e===0){q.set(n,1),t.push(n),ui(n,`pauseAnimations`);continue}q.set(n,e+1),t.push(n)}},fi=(e,t)=>{let n=[];for(let r of e){let e=q.get(r);if(e){if(e===1){try{ui(r,`unpauseAnimations`),q.delete(r)}catch(e){n.push(r),t.push(e)}continue}q.set(r,e-1)}}return n},pi=e=>{let t=[];for(let n of e)for(let e of n.getAnimations({subtree:!0}))e.playState===`running`&&t.push(e);return t},mi=e=>{for(let t of e)try{t.finish()}catch{}},hi=e=>{for(let t of e)try{t.finish()}catch{try{t.play()}catch{}}},gi=e=>{if(!(e.effect instanceof KeyframeEffect))return!1;let t=e.effect.target;if(!Ye(t))return!1;let n=t.getRootNode();return on(n)&&Gn(n.host)},_i=e=>{if(e.length===0||Zr(e,oi))return;vi();let t=[...e];ci(),U=t,W=[];try{di(li(U),W);for(let e of U)e.setAttribute(ve,``);let e=pi(U);J=[];for(let t of e)t.pause(),J.push(t);oi=t}catch(e){try{vi()}catch(t){throw AggregateError([e,t],`Rolling back animation freeze failed`)}throw e}},vi=()=>{if(U.length===0&&W.length===0&&J.length===0)return;let e=U,t=W,n=J,r=[],i=[];oi=[];for(let t of e)try{t.removeAttribute(ve)}catch(e){i.push(t),r.push(e)}U=i,W=fi(t,r),hi(n),J=[],H(r,`Unfreezing element animations failed`)},yi=e=>e.length===0?(vi(),()=>{}):(_i(e),vi),bi=e=>{let t=[];for(let n of e.getAnimations())gi(n)||n.playState===`running`&&t.push(n);return{targetDocument:e,runningAnimations:t}},xi=e=>{let t=K.get(e);if(!t)return[];let n=[],r=t.styleElement;if(r){try{if(t.didUseCssFreeze){r.textContent=`
|
|
35
|
+
*, *::before, *::after {
|
|
36
|
+
transition: none !important;
|
|
37
|
+
}
|
|
38
|
+
`;let t=[];for(let n of e.getAnimations())gi(n)||t.push(n);mi(t)}else hi(t.frozenWaapiAnimations);t.didUseCssFreeze=!1,t.frozenWaapiAnimations=[]}catch(e){n.push(e)}try{r.remove(),t.styleElement=null}catch(e){n.push(e)}}return t.frozenSvgElements=fi(t.frozenSvgElements,n),t.styleElement===null&&t.frozenSvgElements.length===0&&t.frozenWaapiAnimations.length===0&&K.delete(e),n},Si=e=>{if(K.has(e.targetDocument))return;let t=ir(`data-react-grab-global-freeze`,``,e.targetDocument),n={styleElement:t,frozenSvgElements:[],frozenWaapiAnimations:[],didUseCssFreeze:!1};if(K.set(e.targetDocument,n),e.runningAnimations.length>200)t.textContent=`
|
|
39
|
+
*, *::before, *::after {
|
|
40
|
+
animation-play-state: paused !important;
|
|
41
|
+
transition: none !important;
|
|
42
|
+
}
|
|
43
|
+
`,n.didUseCssFreeze=!0;else for(let t of e.runningAnimations)t.pause(),n.frozenWaapiAnimations.push(t);di(li(Array.from(e.targetDocument.querySelectorAll(`svg`))),n.frozenSvgElements)},Ci=e=>{G.add(e);try{si()&&Si(bi(e))}catch(t){G.delete(e);let n=xi(e);throw n.length===0?t:AggregateError([t,...n],`Freezing frame animations failed`)}return()=>{G.delete(e),H(xi(e),`Unfreezing frame animations failed`)}},wi=()=>si()?[]:(G.add(document),[...G].map(bi)),Ti=e=>{if(!si()){for(let t of e)Si(t);ti()}},Ei=()=>{if(!si())return;let e=[];for(let t of[...K.keys()])e.push(...xi(t));try{ni()}catch(t){e.push(t)}H(e,`Unfreezing global animations failed`)},Di=(e,t)=>{for(let n of e.querySelectorAll(`:hover`))if(!Kn(n)&&(h(n)&&t.add(n),n.shadowRoot&&Di(n.shadowRoot,t),g(n))){let e=O(n);e&&Di(e,t)}},Oi=()=>{let e=new Set;return Di(document,e),[...e]},ki=[`mouseenter`,`mouseleave`,`mouseover`,`mouseout`,`pointerenter`,`pointerleave`,`pointerover`,`pointerout`],Ai=[`focus`,`blur`,`focusin`,`focusout`],ji=[`background-color`,`color`,`border-color`,`box-shadow`,`transform`,`opacity`,`outline`,`filter`,`scale`,`visibility`,`display`],Mi=[`background-color`,`color`,`border-color`,`box-shadow`,`outline`,`outline-offset`,`outline-width`,`outline-color`,`outline-style`,`filter`,`opacity`,`ring-color`,`ring-width`],Ni=new Map,Pi=new Map,Y=new Set;let X=!1;const Fi=e=>{e.stopImmediatePropagation()},Ii=e=>{e.preventDefault(),e.stopImmediatePropagation()},Li=e=>{for(let t of ki)e.addEventListener(t,Fi,!0);for(let t of Ai)e.addEventListener(t,Ii,!0)},Ri=e=>{for(let t of ki)e.removeEventListener(t,Fi,!0);for(let t of Ai)e.removeEventListener(t,Ii,!0)},zi=e=>{Y.add(e);let t=ur(e);return X&&Li(e),()=>{X&&Ri(e),Y.delete(e),t()}},Bi=(e,t,n)=>{if(n?.has(e))return null;let r=getComputedStyle(e),i=new Map,a=new Map;for(let n of t){let t=r.getPropertyValue(n);t&&(i.set(n,t),a.set(n,{value:e.style.getPropertyValue(n),priority:e.style.getPropertyPriority(n)}))}return{element:e,frozenPropertyValues:i,originalPropertyValues:a}},Vi=(e,t)=>{let n=[],r=Ln(e,t);for(;r&&r!==document.documentElement&&!Kn(r);)h(r)&&n.push(r),r=wn(r);return n},Hi=()=>{let e=[],t=document.activeElement;for(;t&&t!==document.body;){if(h(t)&&e.push(t),t.shadowRoot?.activeElement){t=t.shadowRoot.activeElement;continue}if(g(t)){t=O(t)?.activeElement??null;continue}t=null}return e},Ui=(e,t)=>{for(let{element:n,frozenPropertyValues:r,originalPropertyValues:i}of e){t.set(n,i);for(let[e,t]of r)n.style.setProperty(e,t,`important`)}},Wi=e=>{let t=[];for(let[n,r]of e){for(let[e,i]of r)try{i.value?n.style.setProperty(e,i.value,i.priority):n.style.removeProperty(e),r.delete(e)}catch(e){t.push(e)}r.size===0&&e.delete(n)}return t},Gi=(e,t)=>{if(lr())return null;let n=[],r=e!==void 0&&t!==void 0&&e>=0&&t>=0&&e<window.innerWidth&&t<window.innerHeight?Vi(e,t):Oi();for(let e of r){let t=Bi(e,ji);t&&n.push(t)}let i=[];for(let e of Hi()){let t=Bi(e,Mi,Pi);t&&i.push(t)}return{hoverStates:n,focusStates:i}},Ki=e=>{if(e){X=!0,Y.add(document);for(let e of Y)Li(e);Ui(e.hoverStates,Ni),Ui(e.focusStates,Pi),dr()}},qi=()=>{Xr(),X=!1;for(let e of Y)Ri(e);let e=[...Wi(Ni),...Wi(Pi)];try{fr()}catch(t){e.push(t)}H(e,`Unfreezing pseudo states failed`)},Ji=()=>{let e=[];try{qi()}catch(t){e.push(t)}try{Ei()}catch(t){e.push(t)}return e},Yi=(e,t)=>{let n=Gi(e,t),r=wi();try{Ki(n),Ti(r)}catch(e){let t=Ji();throw t.length===0?e:AggregateError([e,...t],`Freezing global interactions failed`)}},Xi=()=>{H(Ji(),`Unfreezing global interactions failed`)};let Z=!1,Q=0;const Zi=(e,t,n)=>{let r=e.get(t);if(r)return r;let i=n();return e.set(t,i),i},Qi=new WeakMap,$i=new WeakMap,ea=new WeakMap,ta=new Set,na=[],$=[],ra=new WeakMap,ia=new WeakMap,aa=new WeakSet,oa=At,sa=new Set,ca=e=>e.rendererPackageName.startsWith(`react-dom`),la=e=>{let t=e;for(;t.return;)t=t.return;return t.stateNode??null},ua=e=>{let t=e.current?.stateNode;if(!t||typeof t!=`object`)return!1;let n=Reflect.get(t,`containerInfo`);return!!(n&&typeof n==`object`&&typeof Reflect.get(n,`nodeType`)==`number`)},da=()=>{if(oa.size>0){let e=new Set;for(let t of oa)ua(t)&&e.add(t);return e}let e=new Set,t=n=>{let r=Xt(n);if(r){let t=la(r);t&&e.add(t);return}for(let r of Array.from(n.children))if(t(r),e.size>0)return};return t(document.body),e},fa=(e,t)=>{if(!e)return t;if(!t)return e;if(!e.next||!t.next)return t;let n=e.next,r=t.next,i=e===n,a=t===r;return i&&a?(e.next=t,t.next=e):i?(e.next=r,t.next=e):a?(t.next=n,e.next=t):(e.next=r,t.next=n),t},pa=e=>{if(!e||ra.has(e))return;let t={originalPendingDescriptor:Object.getOwnPropertyDescriptor(e,`pending`),pendingValueAtPause:e.pending,bufferedPending:null};typeof e.getSnapshot==`function`&&(t.originalGetSnapshot=e.getSnapshot,t.snapshotValueAtPause=e.getSnapshot(),e.getSnapshot=()=>Z?t.snapshotValueAtPause:t.originalGetSnapshot());let n=t.pendingValueAtPause;Object.defineProperty(e,`pending`,{configurable:!0,enumerable:!0,get:()=>Z?null:n,set:e=>{if(Z){e!==null&&(t.bufferedPending=fa(t.bufferedPending??null,e));return}n=e}}),ra.set(e,t)},ma=e=>{if(!e)return[];let t=[],n=e.next;if(!n)return[];let r=n;do r&&=(t.push(r.action),r.next);while(r&&r!==n);return t},ha=e=>{let t=ra.get(e);if(!t)return;t.originalGetSnapshot&&(e.getSnapshot=t.originalGetSnapshot),t.originalPendingDescriptor?Object.defineProperty(e,`pending`,t.originalPendingDescriptor):delete e.pending,e.pending=null;let n=e.dispatch;if(typeof n==`function`){let e=ma(t.pendingValueAtPause??null),r=ma(t.bufferedPending??null);for(let t of[...e,...r])$.push(()=>n(t))}ra.delete(e)},ga=e=>{if(ia.has(e))return;let t={originalDescriptor:Object.getOwnPropertyDescriptor(e,`memoizedValue`),frozenValue:e.memoizedValue};Object.defineProperty(e,`memoizedValue`,{configurable:!0,enumerable:!0,get(){return Z?t.frozenValue:t.originalDescriptor?.get?t.originalDescriptor.get.call(this):this._memoizedValue},set(e){if(Z){t.pendingValue=e,t.didReceivePendingValue=!0;return}t.originalDescriptor?.set?t.originalDescriptor.set.call(this,e):this._memoizedValue=e}}),t.originalDescriptor?.get||(e._memoizedValue=t.frozenValue),ia.set(e,t)},_a=e=>{let t=ia.get(e);t&&(t.originalDescriptor?Object.defineProperty(e,`memoizedValue`,t.originalDescriptor):delete e.memoizedValue,t.didReceivePendingValue&&(e.memoizedValue=t.pendingValue),ia.delete(e))},va=e=>{let t=e.memoizedState;for(;t;)t.queue&&typeof t.queue==`object`&&pa(t.queue),t=t.next;let n=e.dependencies?.firstContext;for(;n&&typeof n==`object`&&`memoizedValue`in n;)ga(n),n=n.next},ya=e=>{let t=e.memoizedState;for(;t;)t.queue&&typeof t.queue==`object`&&ha(t.queue),t=t.next;let n=e.dependencies?.firstContext;for(;n&&typeof n==`object`&&`memoizedValue`in n;)_a(n),n=n.next},ba=e=>{let t=e;for(;t;){if(yt(t)&&va(t),t.child){t=t.child;continue}for(;t!==e&&!t.sibling;)if(t=t.return,!t)return;if(t===e)return;t=t.sibling}},xa=e=>{let t=e;for(;t;){if(yt(t)&&ya(t),t.child){t=t.child;continue}for(;t!==e&&!t.sibling;)if(t=t.return,!t)return;if(t===e)return;t=t.sibling}},Sa=e=>{if(Qi.has(e))return;let t=e,n={useState:t.useState,useReducer:t.useReducer,useTransition:t.useTransition,useSyncExternalStore:t.useSyncExternalStore};Qi.set(e,n),t.useState=(...t)=>{let r=n.useState.apply(e,t);if(!Z||!Array.isArray(r)||typeof r[1]!=`function`)return r;let[i,a]=r;return[i,Zi($i,a,()=>(...e)=>{Z?$.push(()=>a(...e)):a(...e)})]},t.useReducer=(...t)=>{let r=n.useReducer.apply(e,t);if(!Z||!Array.isArray(r)||typeof r[1]!=`function`)return r;let[i,a]=r;return[i,Zi($i,a,()=>(...e)=>{Z?$.push(()=>a(...e)):a(...e)})]},t.useTransition=(...t)=>{let r=n.useTransition.apply(e,t);if(!Z||!Array.isArray(r)||typeof r[1]!=`function`)return r;let[i,a]=r;return[i,Zi(ea,a,()=>e=>{Z?na.push(()=>a(e)):a(e)})]},t.useSyncExternalStore=((e,t,r)=>Z?n.useSyncExternalStore(t=>e(()=>{Z?ta.add(t):t()}),t,r):n.useSyncExternalStore(e,t,r))},Ca=e=>{let t=e.currentDispatcherRef;if(!t||typeof t!=`object`)return;let n=`H`in t?`H`:`current`,r=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get:()=>(r&&typeof r==`object`&&Sa(r),r),set:e=>{r=e}})},wa=e=>{queueMicrotask(()=>{try{for(let t of b().renderers.values())if(ca(t)&&typeof t.scheduleUpdate==`function`){for(let n of e)if(n.current)try{t.scheduleUpdate(n.current)}catch(e){L(new E(`scheduleUpdate failed during unfreeze`,e))}}}catch(e){L(new E(`scheduleReactUpdate failed`,e))}})},Ta=e=>{for(let t of e)try{t()}catch(e){L(new E(`Callback failed during state replay`,e))}},Ea=()=>{for(let e of b().renderers.values())ca(e)&&(aa.has(e)||(Ca(e),aa.add(e)))},Da=()=>{ta.clear(),na.length=0,$.length=0},Oa=()=>{let e=new Set(sa);try{for(let t of da())e.add(t)}catch(e){L(new E(`Collecting fiber roots failed during unfreeze`,e))}sa.clear(),Z=!1;for(let t of e)try{xa(t.current)}catch(e){L(new E(`Resuming a fiber root failed during unfreeze`,e))}let t=Array.from(ta),n=na.slice(),r=$.slice();Da(),Ta(t),Ta(n),Ta(r),Z||wa(e)},ka=()=>{let e=Q===0;if(Q+=1,e)try{Ea(),Z=!0;let e=da();for(let t of e)sa.add(t),ba(t.current)}catch(e){throw--Q,Z&&Oa(),e}let t=!1;return()=>{t||(t=!0,--Q,Q===0&&Oa())}},Aa=()=>{try{return ka()}catch(e){return L(new E(`Pausing React updates failed`,e)),()=>{}}};export{w as $,oe as $t,On as A,He as At,sn as B,ue as Bt,Un as C,ne as Ct,Pn as D,De as Dt,D as E,Me as Et,bn as F,Re as Ft,dn as G,Oe as Gt,cn as H,xe as Ht,vn as I,Fe as It,gn as J,Pe as Jt,T as K,ge as Kt,pn as L,Ie as Lt,wn as M,We as Mt,Cn as N,ze as Nt,Dn as O,Le as Ot,Sn as P,Be as Pt,nn as Q,ce as Qt,fn as R,l as Rt,Kn as S,Te as St,Nn as T,Ne as Tt,un as U,be as Ut,mn as V,ie as Vt,ln as W,p as Wt,on as X,ae as Xt,hn as Y,s as Yt,an as Z,Se as Zt,mr as _,i as _n,de as _t,zi as a,pe as an,Xt as at,Zn as b,te as bn,Ee as bt,Ci as c,Ce as cn,jt as ct,L as d,qe as dn,et as dt,le as en,$t as et,Xr as f,c as fn,$e as ft,Ir as g,we as gn,_e as gt,Lr as h,d as hn,Ye as ht,Xi as i,me as in,kt as it,En as j,Ue as jt,kn as k,Ve as kt,H as l,Je as ln,pt as lt,Jr as m,f as mn,h as mt,ka as n,a as nn,Ct as nt,_i as o,fe as on,vt as ot,Yr as p,u as pn,g as pt,E as q,je as qt,Yi as r,o as rn,yt as rt,yi as s,he as sn,wt as st,Aa as t,se as tn,Ot as tt,Zr as u,ye as un,b as ut,pr as v,Ae as vn,re as vt,O as w,ke as wt,Qn as x,t as xn,Ge as xt,nr as y,m as yn,ee as yt,_n as z,Ke as zt};
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
9
|
+
import { D as ReactGrabAPI, P as Theme, b as Options, r as StackFrame } from "./copy-content-CcSwO8vJ.js";
|
|
10
10
|
|
|
11
11
|
//#region src/core/context.d.ts
|
|
12
12
|
declare const getStack: (element: Element) => Promise<StackFrame[] | null>;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
9
|
+
import { D as ReactGrabAPI, P as Theme, b as Options, r as StackFrame } from "./copy-content-Dxdqj7pl.cjs";
|
|
10
10
|
|
|
11
11
|
//#region src/core/context.d.ts
|
|
12
12
|
declare const getStack: (element: Element) => Promise<StackFrame[] | null>;
|
package/dist/index.cjs
CHANGED
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./core-
|
|
9
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./core-BqLdgVaS.cjs`),t=require(`./freeze-updates-Bo4hlR6H.cjs`),n=require(`./open-file-CBXQTDtp.cjs`),r=()=>{if(typeof window>`u`||window.parent===window)return null;try{return window.parent.__REACT_GRAB__??null}catch{return null}};if(typeof window<`u`&&!window.__REACT_GRAB_DISABLED__){let t=window.__REACT_GRAB__??r();t?e.a(t):e.a(e.t()),window.dispatchEvent(new CustomEvent(`react-grab:init`,{detail:e.r()}))}exports.DEFAULT_THEME=e.l,exports.FreezeError=t.B,exports.OpenFileError=t.H,exports.PluginSetupError=t.G,exports.ReactGrabError=t.K,exports.commentPlugin=e.c,exports.formatElementInfo=n.r,exports.generateSnippet=e.n,exports.getGlobalApi=e.r,exports.getStack=n.s,exports.init=e.t,exports.isInstrumentationActive=t.it,exports.openPlugin=e.s,exports.registerPlugin=e.i,exports.setGlobalApi=e.a,exports.unregisterPlugin=e.o;
|
package/dist/index.d.cts
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
import { A as
|
|
10
|
-
import { a as getStack, i as formatElementInfo, n as generateSnippet, r as DEFAULT_THEME, t as init } from "./index-
|
|
11
|
-
import { n as
|
|
9
|
+
import { A as Rect, C as PluginConfig, D as ReactGrabAPI, E as PromptModeContext, F as ToolbarState, M as SettableOptions, N as SourceInfo, P as Theme, S as Plugin, T as Position, _ as ElementSelectedEventDetail, a as ActionContext, b as Options, c as AgentContext, d as DeepPartial, f as DragRect, g as ElementLabelVariant, h as ElementLabelContext, j as SelectedElementPayload, k as ReactGrabState, l as ContextMenuAction, n as isInstrumentationActive, o as ActionContextHooks, s as ActivationMode, u as ContextMenuActionContext, v as GrabbedBox, w as PluginHooks, x as OverlayBounds, y as OpenFileActionHooks } from "./copy-content-Dxdqj7pl.cjs";
|
|
10
|
+
import { a as getStack, i as formatElementInfo, n as generateSnippet, r as DEFAULT_THEME, t as init } from "./index-DdYffA2X.cjs";
|
|
11
|
+
import { i as ReactGrabError, n as OpenFileError, r as PluginSetupError, t as FreezeError } from "./errors-CTlIFDQs.cjs";
|
|
12
12
|
|
|
13
13
|
//#region src/core/plugins/comment.d.ts
|
|
14
14
|
declare const commentPlugin: Plugin;
|
|
@@ -16,6 +16,12 @@ declare const commentPlugin: Plugin;
|
|
|
16
16
|
//#region src/core/plugins/open.d.ts
|
|
17
17
|
declare const openPlugin: Plugin;
|
|
18
18
|
//#endregion
|
|
19
|
+
//#region src/global-api.d.ts
|
|
20
|
+
declare const getGlobalApi: () => ReactGrabAPI | null;
|
|
21
|
+
declare const setGlobalApi: (api: ReactGrabAPI | null) => void;
|
|
22
|
+
declare const registerPlugin: (plugin: Plugin) => void;
|
|
23
|
+
declare const unregisterPlugin: (name: string) => void;
|
|
24
|
+
//#endregion
|
|
19
25
|
//#region src/index.d.ts
|
|
20
26
|
declare global {
|
|
21
27
|
interface Window {
|
|
@@ -23,9 +29,5 @@ declare global {
|
|
|
23
29
|
__REACT_GRAB_DISABLED__?: boolean;
|
|
24
30
|
}
|
|
25
31
|
}
|
|
26
|
-
declare const getGlobalApi: () => ReactGrabAPI | null;
|
|
27
|
-
declare const setGlobalApi: (api: ReactGrabAPI | null) => void;
|
|
28
|
-
declare const registerPlugin: (plugin: Plugin) => void;
|
|
29
|
-
declare const unregisterPlugin: (name: string) => void;
|
|
30
32
|
//#endregion
|
|
31
|
-
export { type ActionContext, type ActionContextHooks, type ActivationMode, type AgentContext, type ContextMenuAction, type ContextMenuActionContext, DEFAULT_THEME, type DeepPartial, type DragRect, type ElementLabelContext, type ElementLabelVariant, type ElementSelectedEventDetail, FreezeError, type GrabbedBox, type Options, type OverlayBounds, type Plugin, type PluginConfig, type PluginHooks, PluginSetupError, type Position, type PromptModeContext, type ReactGrabAPI, ReactGrabError, type ReactGrabState, type Rect, type SelectedElementPayload, type SettableOptions, type SourceInfo, type Theme, type ToolbarState, commentPlugin, formatElementInfo, generateSnippet, getGlobalApi, getStack, init, isInstrumentationActive, openPlugin, registerPlugin, setGlobalApi, unregisterPlugin };
|
|
33
|
+
export { type ActionContext, type ActionContextHooks, type ActivationMode, type AgentContext, type ContextMenuAction, type ContextMenuActionContext, DEFAULT_THEME, type DeepPartial, type DragRect, type ElementLabelContext, type ElementLabelVariant, type ElementSelectedEventDetail, FreezeError, type GrabbedBox, type OpenFileActionHooks, OpenFileError, type Options, type OverlayBounds, type Plugin, type PluginConfig, type PluginHooks, PluginSetupError, type Position, type PromptModeContext, type ReactGrabAPI, ReactGrabError, type ReactGrabState, type Rect, type SelectedElementPayload, type SettableOptions, type SourceInfo, type Theme, type ToolbarState, commentPlugin, formatElementInfo, generateSnippet, getGlobalApi, getStack, init, isInstrumentationActive, openPlugin, registerPlugin, setGlobalApi, unregisterPlugin };
|
package/dist/index.d.ts
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
import { A as
|
|
10
|
-
import { a as getStack, i as formatElementInfo, n as generateSnippet, r as DEFAULT_THEME, t as init } from "./index-
|
|
11
|
-
import { n as
|
|
9
|
+
import { A as Rect, C as PluginConfig, D as ReactGrabAPI, E as PromptModeContext, F as ToolbarState, M as SettableOptions, N as SourceInfo, P as Theme, S as Plugin, T as Position, _ as ElementSelectedEventDetail, a as ActionContext, b as Options, c as AgentContext, d as DeepPartial, f as DragRect, g as ElementLabelVariant, h as ElementLabelContext, j as SelectedElementPayload, k as ReactGrabState, l as ContextMenuAction, n as isInstrumentationActive, o as ActionContextHooks, s as ActivationMode, u as ContextMenuActionContext, v as GrabbedBox, w as PluginHooks, x as OverlayBounds, y as OpenFileActionHooks } from "./copy-content-CcSwO8vJ.js";
|
|
10
|
+
import { a as getStack, i as formatElementInfo, n as generateSnippet, r as DEFAULT_THEME, t as init } from "./index-Cd-ADR9Q.js";
|
|
11
|
+
import { i as ReactGrabError, n as OpenFileError, r as PluginSetupError, t as FreezeError } from "./errors-BEgowzRA.js";
|
|
12
12
|
|
|
13
13
|
//#region src/core/plugins/comment.d.ts
|
|
14
14
|
declare const commentPlugin: Plugin;
|
|
@@ -16,6 +16,12 @@ declare const commentPlugin: Plugin;
|
|
|
16
16
|
//#region src/core/plugins/open.d.ts
|
|
17
17
|
declare const openPlugin: Plugin;
|
|
18
18
|
//#endregion
|
|
19
|
+
//#region src/global-api.d.ts
|
|
20
|
+
declare const getGlobalApi: () => ReactGrabAPI | null;
|
|
21
|
+
declare const setGlobalApi: (api: ReactGrabAPI | null) => void;
|
|
22
|
+
declare const registerPlugin: (plugin: Plugin) => void;
|
|
23
|
+
declare const unregisterPlugin: (name: string) => void;
|
|
24
|
+
//#endregion
|
|
19
25
|
//#region src/index.d.ts
|
|
20
26
|
declare global {
|
|
21
27
|
interface Window {
|
|
@@ -23,9 +29,5 @@ declare global {
|
|
|
23
29
|
__REACT_GRAB_DISABLED__?: boolean;
|
|
24
30
|
}
|
|
25
31
|
}
|
|
26
|
-
declare const getGlobalApi: () => ReactGrabAPI | null;
|
|
27
|
-
declare const setGlobalApi: (api: ReactGrabAPI | null) => void;
|
|
28
|
-
declare const registerPlugin: (plugin: Plugin) => void;
|
|
29
|
-
declare const unregisterPlugin: (name: string) => void;
|
|
30
32
|
//#endregion
|
|
31
|
-
export { type ActionContext, type ActionContextHooks, type ActivationMode, type AgentContext, type ContextMenuAction, type ContextMenuActionContext, DEFAULT_THEME, type DeepPartial, type DragRect, type ElementLabelContext, type ElementLabelVariant, type ElementSelectedEventDetail, FreezeError, type GrabbedBox, type Options, type OverlayBounds, type Plugin, type PluginConfig, type PluginHooks, PluginSetupError, type Position, type PromptModeContext, type ReactGrabAPI, ReactGrabError, type ReactGrabState, type Rect, type SelectedElementPayload, type SettableOptions, type SourceInfo, type Theme, type ToolbarState, commentPlugin, formatElementInfo, generateSnippet, getGlobalApi, getStack, init, isInstrumentationActive, openPlugin, registerPlugin, setGlobalApi, unregisterPlugin };
|
|
33
|
+
export { type ActionContext, type ActionContextHooks, type ActivationMode, type AgentContext, type ContextMenuAction, type ContextMenuActionContext, DEFAULT_THEME, type DeepPartial, type DragRect, type ElementLabelContext, type ElementLabelVariant, type ElementSelectedEventDetail, FreezeError, type GrabbedBox, type OpenFileActionHooks, OpenFileError, type Options, type OverlayBounds, type Plugin, type PluginConfig, type PluginHooks, PluginSetupError, type Position, type PromptModeContext, type ReactGrabAPI, ReactGrabError, type ReactGrabState, type Rect, type SelectedElementPayload, type SettableOptions, type SourceInfo, type Theme, type ToolbarState, commentPlugin, formatElementInfo, generateSnippet, getGlobalApi, getStack, init, isInstrumentationActive, openPlugin, registerPlugin, setGlobalApi, unregisterPlugin };
|