@inkeep/open-knowledge 0.46.0-beta.34 → 0.46.0-beta.35
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/dist/{acp-harness-probe-DT0sl_D0.mjs → acp-harness-probe-BSVTFfrJ.mjs} +2 -2
- package/dist/cli.mjs +6 -6
- package/dist/constants-CfgzW6eO.mjs +2 -0
- package/dist/index.mjs +1 -1
- package/dist/init-BnJLvdAH.mjs +1 -0
- package/dist/{init-DEQGEuYc.mjs → init-V4vD94bb.mjs} +3 -3
- package/dist/{launch-json-removal-xx3UAhRW.mjs → launch-json-removal-DbXAmKSE.mjs} +2 -2
- package/dist/loader-Bb8dIYfj.mjs +1 -0
- package/dist/{loader-D3FaVs8V.mjs → loader-BedgCIcG.mjs} +2 -2
- package/dist/preview-CIOq8C9I.mjs +1 -0
- package/dist/{preview-DhwRKxCk.mjs → preview-CQbhUHvT.mjs} +2 -2
- package/dist/public/assets/{ActivityModeContent-eZKXi7x3.js → ActivityModeContent-1W0E_TW_.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-Bk_UuqIm.js → AgentDiffPane-Dctk3kCy.js} +1 -1
- package/dist/public/assets/{ChangedOutsideBadge-CHJ0a-hO.js → ChangedOutsideBadge-BAgxWMg1.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-Ci80khj8.js → CodeMirrorPropInput-DTaNg1-M.js} +1 -1
- package/dist/public/assets/{DocumentContext-CXfBU9-L.js → DocumentContext-CY-aaPA2.js} +1 -1
- package/dist/public/assets/FeedbackForm-D5_jriQK.js +1 -0
- package/dist/public/assets/{GraphPanel-C092olMj.js → GraphPanel-B86tFg1O.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-cZx3HFuS.js → ImportSkillDialog-zuUSp64v.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-BNGK9DX5.js → ManagedArtifactProperties-BEA8rfna.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-Wt4jiRF7.js +1 -0
- package/dist/public/assets/{MermaidDocEditor-DGbbrDkE.js → MermaidDocEditor-DGoGFr6Q.js} +1 -1
- package/dist/public/assets/{SessionsHost-CFKGHP-v.js → SessionsHost-CkTxH_pH.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-DqCUzuqy.js → SettingsDialogBody-CMYkLlDK.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-ZcB-SqtD.js → SkillToolbarControls-CzMUJTsR.js} +1 -1
- package/dist/public/assets/{SourceEditor-nQ1tYmvJ.js → SourceEditor-CmON1zaL.js} +1 -1
- package/dist/public/assets/{TerminalPanel-BzyUYvW1.js → TerminalPanel-CEFylp9e.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-DUsHFj09.js → TerminalWindowApp-Hea18ovV.js} +1 -1
- package/dist/public/assets/{TextDocEditor-Mgwc9lXu.js → TextDocEditor-DVdcvFG6.js} +1 -1
- package/dist/public/assets/{ThreadView-Bjw11Cxw.js → ThreadView-xDncqlbd.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-Chwunr-y.js → TimelineDiffPane-DK9DjRu2.js} +1 -1
- package/dist/public/assets/{agent-diff-store-D6R6MDp1.js → agent-diff-store-BtmgOmDH.js} +1 -1
- package/dist/public/assets/{auth-state-cache-DxbIoz7A.js → auth-state-cache-C-699iSE.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-BP7EuipU.js → file-tree-adapter-CS4JuYT3.js} +1 -1
- package/dist/public/assets/{index-DGoMcMEu.js → index-ByDq_yHG.js} +7 -7
- package/dist/public/assets/{navigation-targets-CUdNH5TL.js → navigation-targets-GzXvLoSC.js} +1 -1
- package/dist/public/assets/{prop-types-9khllr2u.js → prop-types-ZLa1Cj_J.js} +1 -1
- package/dist/public/assets/{selection-context-QeNscioc.js → selection-context-C8jYfARa.js} +1 -1
- package/dist/public/assets/{skill-actions-zxcx7XWT.js → skill-actions-CgxRJiS9.js} +1 -1
- package/dist/public/assets/{src-Dr3B9ii7.js → src-1YTF45Kf.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-D6ir9fa8.js → target-navigation-intent-DlmK2vet.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-D9B5ZK28.js → typing-burst-detector-By5ThDd8.js} +1 -1
- package/dist/public/assets/{use-activity-panel-DZ5Mg5tU.js → use-activity-panel-ZHwYErFx.js} +1 -1
- package/dist/public/assets/{use-open-skill-DpRSbvpY.js → use-open-skill-DF4PdWu_.js} +1 -1
- package/dist/public/assets/{use-skill-directory-BBfJIjk2.js → use-skill-directory-uITBGO9Q.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-CD1f20wi.js → use-timeline-entry-diff-CJle_iXu.js} +1 -1
- package/dist/public/index.html +16 -16
- package/dist/{repair-launch-json-G5t-TrFl.mjs → repair-launch-json-C1mipcEl.mjs} +2 -2
- package/dist/{repair-mcp-configs-DMqD3_wf.mjs → repair-mcp-configs-xAZRxGTM.mjs} +2 -2
- package/dist/{src-BgZFGtwA.mjs → src-CsTKBeVf.mjs} +2 -2
- package/dist/{start-DX4YYgK4.mjs → start-D6JW3eRX.mjs} +2 -2
- package/dist/start-EaZ9lKkR.mjs +1 -0
- package/package.json +5 -5
- package/dist/constants-BzSxKeCS.mjs +0 -2
- package/dist/init-CSyU2PH9.mjs +0 -1
- package/dist/loader-BQUss4Yj.mjs +0 -1
- package/dist/preview-Dbs7YrAM.mjs +0 -1
- package/dist/public/assets/FeedbackForm-CYffHrSn.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-GztrNTAZ.js +0 -1
- package/dist/start-BmmEy4iL.mjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./index-ByDq_yHG.js";export{e as FeedbackForm};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./useQuery-ZeEDLtxh.js";import{n as s}from"./dist-PQ5KMVDh.js";import{t as c}from"./compiler-runtime-BfE3aGVn.js";import{t as l}from"./utils-CPqDy6Hr.js";import{t as u}from"./button-RQ5o7P7w.js";import{i as d,n as f,t as p}from"./tooltip-x7BNUa3s.js";import{n as m,t as h}from"./toggle-group-Cnezoq-B.js";import{V as g,at as _,ft as v,hr as y,it as b,q as x}from"./dist-OxboORfH2.js";import{t as S}from"./createLucideIcon-DihYAFEK.js";import{t as C}from"./arrow-up-right-CxtRAecj.js";import{i as w,o as T,s as E,t as D}from"./prop-types-9khllr2u.js";import{t as ee}from"./triangle-alert-C2yId37R.js";import{t as O}from"./dist-CzC3AWOn.js";import{f as k}from"./doc-paths-lZOQ-mhw.js";import{d as te}from"./documents-events-5TI0rZAg.js";import{n as ne}from"./external-link-Dvu-nzFi.js";import{t as A}from"./overlay-layers-B39mutdg.js";import{a as re,c as ie,i as ae,n as j,r as oe,s as se,t as ce}from"./panel-Boo96yEj.js";import{t as le}from"./target-navigation-intent-D6ir9fa8.js";import{t as ue}from"./ordinal-DdrNAXbu.js";import{n as de,t as fe}from"./min-B52VabRz.js";import{C as pe,S as M,_ as me,b as he,g as ge,n as N,r as _e,t as ve,v as ye,w as be,x as xe,y as Se}from"./src-CIOeKeVw.js";import{t as Ce}from"./colors-DThYSuj1.js";import{t as we}from"./isObject-CS6pZNNk.js";import{n as Te,t as P}from"./now-D9M3Ys6o.js";var Ee=S(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),De=S(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]);function F(e,n){let r=0;if(n===void 0)for(let n of e)(n=+n)&&(r+=n);else{let i=-1;for(let a of e)(a=+n(a,++i,e))&&(r+=a)}return r}var Oe=e=>()=>e;function ke(e,{sourceEvent:n,subject:r,target:i,identifier:a,active:o,x:s,y:c,dx:l,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}ke.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Ae(e){return!e.ctrlKey&&!e.button}function je(){return this.parentNode}function Me(e,n){return n??{x:e.x,y:e.y}}function Ne(){return navigator.maxTouchPoints||`ontouchstart`in this}function Pe(){var e=Ae,n=je,r=Me,i=Ne,a={},o=be(`start`,`drag`,`end`),s=0,c,l,u,d,f=0;function p(e){e.on(`mousedown.drag`,m).filter(i).on(`touchstart.drag`,_).on(`touchmove.drag`,v,Se).on(`touchend.drag touchcancel.drag`,y).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function m(r,i){if(!(d||!e.call(this,r,i))){var a=b(this,n.call(this,r,i),r,i,`mouse`);a&&(pe(r.view).on(`mousemove.drag`,h,he).on(`mouseup.drag`,g,he),ge(r.view),xe(r),u=!1,c=r.clientX,l=r.clientY,a(`start`,r))}}function h(e){if(ye(e),!u){var n=e.clientX-c,r=e.clientY-l;u=n*n+r*r>f}a.mouse(`drag`,e)}function g(e){pe(e.view).on(`mousemove.drag mouseup.drag`,null),me(e.view,u),ye(e),a.mouse(`end`,e)}function _(r,i){if(e.call(this,r,i)){var a=r.changedTouches,o=n.call(this,r,i),s=a.length,c,l;for(c=0;c<s;++c)(l=b(this,o,r,i,a[c].identifier,a[c]))&&(xe(r),l(`start`,r,a[c]))}}function v(e){var n=e.changedTouches,r=n.length,i,o;for(i=0;i<r;++i)(o=a[n[i].identifier])&&(ye(e),o(`drag`,e,n[i]))}function y(e){var n=e.changedTouches,r=n.length,i,o;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),i=0;i<r;++i)(o=a[n[i].identifier])&&(xe(e),o(`end`,e,n[i]))}function b(e,n,i,c,l,u){var d=o.copy(),f=M(u||i,n),m,h,g;if((g=r.call(e,new ke(`beforestart`,{sourceEvent:i,target:p,identifier:l,active:s,x:f[0],y:f[1],dx:0,dy:0,dispatch:d}),c))!=null)return m=g.x-f[0]||0,h=g.y-f[1]||0,function r(i,o,u){var _=f,v;switch(i){case`start`:a[l]=r,v=s++;break;case`end`:delete a[l],--s;case`drag`:f=M(u||o,n),v=s;break}d.call(i,e,new ke(i,{sourceEvent:o,subject:g,target:p,identifier:l,active:v,x:f[0]+m,y:f[1]+h,dx:f[0]-_[0],dy:f[1]-_[1],dispatch:d}),c)}}return p.filter=function(n){return arguments.length?(e=typeof n==`function`?n:Oe(!!n),p):e},p.container=function(e){return arguments.length?(n=typeof e==`function`?e:Oe(e),p):n},p.subject=function(e){return arguments.length?(r=typeof e==`function`?e:Oe(e),p):r},p.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:Oe(!!e),p):i},p.on=function(){var e=o.on.apply(o,arguments);return e===o?p:e},p.clickDistance=function(e){return arguments.length?(f=(e=+e)*e,p):Math.sqrt(f)},p}function I(e){let n=+this._x.call(null,e),r=+this._y.call(null,e);return Fe(this.cover(n,r),n,r,e)}function Fe(e,n,r,i){if(isNaN(n)||isNaN(r))return e;var a,o=e._root,s={data:i},c=e._x0,l=e._y0,u=e._x1,d=e._y1,f,p,m,h,g,_,v,y;if(!o)return e._root=s,e;for(;o.length;)if((g=n>=(f=(c+u)/2))?c=f:u=f,(_=r>=(p=(l+d)/2))?l=p:d=p,a=o,!(o=o[v=_<<1|g]))return a[v]=s,e;if(m=+e._x.call(null,o.data),h=+e._y.call(null,o.data),n===m&&r===h)return s.next=o,a?a[v]=s:e._root=s,e;do a=a?a[v]=[,,,,]:e._root=[,,,,],(g=n>=(f=(c+u)/2))?c=f:u=f,(_=r>=(p=(l+d)/2))?l=p:d=p;while((v=_<<1|g)==(y=(h>=p)<<1|m>=f));return a[y]=o,a[v]=s,e}function Ie(e){var n,r,i=e.length,a,o,s=Array(i),c=Array(i),l=1/0,u=1/0,d=-1/0,f=-1/0;for(r=0;r<i;++r)isNaN(a=+this._x.call(null,n=e[r]))||isNaN(o=+this._y.call(null,n))||(s[r]=a,c[r]=o,a<l&&(l=a),a>d&&(d=a),o<u&&(u=o),o>f&&(f=o));if(l>d||u>f)return this;for(this.cover(l,u).cover(d,f),r=0;r<i;++r)Fe(this,s[r],c[r],e[r]);return this}function L(e,n){if(isNaN(e=+e)||isNaN(n=+n))return this;var r=this._x0,i=this._y0,a=this._x1,o=this._y1;if(isNaN(r))a=(r=Math.floor(e))+1,o=(i=Math.floor(n))+1;else{for(var s=a-r||1,c=this._root,l,u;r>e||e>=a||i>n||n>=o;)switch(u=(n<i)<<1|e<r,l=[,,,,],l[u]=c,c=l,s*=2,u){case 0:a=r+s,o=i+s;break;case 1:r=a-s,o=i+s;break;case 2:a=r+s,i=o-s;break;case 3:r=a-s,i=o-s;break}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=i,this._x1=a,this._y1=o,this}function Le(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function Re(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function R(e,n,r,i,a){this.node=e,this.x0=n,this.y0=r,this.x1=i,this.y1=a}function ze(e,n,r){var i,a=this._x0,o=this._y0,s,c,l,u,d=this._x1,f=this._y1,p=[],m=this._root,h,g;for(m&&p.push(new R(m,a,o,d,f)),r==null?r=1/0:(a=e-r,o=n-r,d=e+r,f=n+r,r*=r);h=p.pop();)if(!(!(m=h.node)||(s=h.x0)>d||(c=h.y0)>f||(l=h.x1)<a||(u=h.y1)<o))if(m.length){var _=(s+l)/2,v=(c+u)/2;p.push(new R(m[3],_,v,l,u),new R(m[2],s,v,_,u),new R(m[1],_,c,l,v),new R(m[0],s,c,_,v)),(g=(n>=v)<<1|e>=_)&&(h=p[p.length-1],p[p.length-1]=p[p.length-1-g],p[p.length-1-g]=h)}else{var y=e-+this._x.call(null,m.data),b=n-+this._y.call(null,m.data),x=y*y+b*b;if(x<r){var S=Math.sqrt(r=x);a=e-S,o=n-S,d=e+S,f=n+S,i=m.data}}return i}function Be(e){if(isNaN(d=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var n,r=this._root,i,a,o,s=this._x0,c=this._y0,l=this._x1,u=this._y1,d,f,p,m,h,g,_,v;if(!r)return this;if(r.length)for(;;){if((h=d>=(p=(s+l)/2))?s=p:l=p,(g=f>=(m=(c+u)/2))?c=m:u=m,n=r,!(r=r[_=g<<1|h]))return this;if(!r.length)break;(n[_+1&3]||n[_+2&3]||n[_+3&3])&&(i=n,v=_)}for(;r.data!==e;)if(a=r,!(r=r.next))return this;return(o=r.next)&&delete r.next,a?(o?a.next=o:delete a.next,this):n?(o?n[_]=o:delete n[_],(r=n[0]||n[1]||n[2]||n[3])&&r===(n[3]||n[2]||n[1]||n[0])&&!r.length&&(i?i[v]=r:this._root=r),this):(this._root=o,this)}function Ve(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function He(){return this._root}function Ue(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function We(e){var n=[],r,i=this._root,a,o,s,c,l;for(i&&n.push(new R(i,this._x0,this._y0,this._x1,this._y1));r=n.pop();)if(!e(i=r.node,o=r.x0,s=r.y0,c=r.x1,l=r.y1)&&i.length){var u=(o+c)/2,d=(s+l)/2;(a=i[3])&&n.push(new R(a,u,d,c,l)),(a=i[2])&&n.push(new R(a,o,d,u,l)),(a=i[1])&&n.push(new R(a,u,s,c,d)),(a=i[0])&&n.push(new R(a,o,s,u,d))}return this}function Ge(e){var n=[],r=[],i;for(this._root&&n.push(new R(this._root,this._x0,this._y0,this._x1,this._y1));i=n.pop();){var a=i.node;if(a.length){var o,s=i.x0,c=i.y0,l=i.x1,u=i.y1,d=(s+l)/2,f=(c+u)/2;(o=a[0])&&n.push(new R(o,s,c,d,f)),(o=a[1])&&n.push(new R(o,d,c,l,f)),(o=a[2])&&n.push(new R(o,s,f,d,u)),(o=a[3])&&n.push(new R(o,d,f,l,u))}r.push(i)}for(;i=r.pop();)e(i.node,i.x0,i.y0,i.x1,i.y1);return this}function Ke(e){return e[0]}function qe(e){return arguments.length?(this._x=e,this):this._x}function Je(e){return e[1]}function Ye(e){return arguments.length?(this._y=e,this):this._y}function Xe(e,n,r){var i=new Ze(n??Ke,r??Je,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function Ze(e,n,r,i,a,o){this._x=e,this._y=n,this._x0=r,this._y0=i,this._x1=a,this._y1=o,this._root=void 0}function Qe(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var z=Xe.prototype=Ze.prototype;z.copy=function(){var e=new Ze(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root,r,i;if(!n)return e;if(!n.length)return e._root=Qe(n),e;for(r=[{source:n,target:e._root=[,,,,]}];n=r.pop();)for(var a=0;a<4;++a)(i=n.source[a])&&(i.length?r.push({source:i,target:n.target[a]=[,,,,]}):n.target[a]=Qe(i));return e},z.add=I,z.addAll=Ie,z.cover=L,z.data=Le,z.extent=Re,z.find=ze,z.remove=Be,z.removeAll=Ve,z.root=He,z.size=Ue,z.visit=We,z.visitAfter=Ge,z.x=qe,z.y=Ye;var $e=Ce(`a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928`),B=n(),V=e(r(),1),et=c(),H=`Expected a function`,tt=Math.max,nt=Math.min;function rt(e,n,r){var i,a,o,s,c,l,u=0,d=!1,f=!1,p=!0;if(typeof e!=`function`)throw TypeError(H);n=Te(n)||0,we(r)&&(d=!!r.leading,f=`maxWait`in r,o=f?tt(Te(r.maxWait)||0,n):o,p=`trailing`in r?!!r.trailing:p);function m(n){var r=i,o=a;return i=a=void 0,u=n,s=e.apply(o,r),s}function h(e){return u=e,c=setTimeout(v,n),d?m(e):s}function g(e){var r=e-l,i=e-u,a=n-r;return f?nt(a,o-i):a}function _(e){var r=e-l,i=e-u;return l===void 0||r>=n||r<0||f&&i>=o}function v(){var e=P();if(_(e))return y(e);c=setTimeout(v,g(e))}function y(e){return c=void 0,p&&i?m(e):(i=a=void 0,s)}function b(){c!==void 0&&clearTimeout(c),u=0,i=l=a=c=void 0}function x(){return c===void 0?s:y(P())}function S(){var e=P(),r=_(e);if(i=arguments,a=this,l=e,r){if(c===void 0)return h(l);if(f)return clearTimeout(c),c=setTimeout(v,n),m(l)}return c===void 0&&(c=setTimeout(v,n)),s}return S.cancel=b,S.flush=x,S}var U=`Expected a function`;function it(e,n,r){var i=!0,a=!0;if(typeof e!=`function`)throw TypeError(U);return we(r)&&(i=`leading`in r?!!r.leading:i,a=`trailing`in r?!!r.trailing:a),rt(e,n,{leading:i,maxWait:n,trailing:a})}var at=[`#60a5fa`,`#a78bfa`,`#34d399`,`#f472b6`,`#fb923c`,`#22d3ee`,`#c084fc`,`#4ade80`,`#f87171`,`#eab308`,`#ec4899`,`#06b67f`,`#8b5cf6`,`#f43f5e`,`#0ea5e9`,`#a855f7`],ot=[`#1e40af`,`#6b21a8`,`#166534`,`#9f1239`,`#9a3412`,`#164e63`,`#581c87`,`#166534`,`#991b1b`,`#854d0e`,`#831843`,`#0f766e`,`#312e81`,`#9f1239`,`#0c4a6e`,`#6b21a8`];function st(e){let n=2;for(let r=0;r<e.length;r++)n=Math.imul(n^e.charCodeAt(r),1540483477),n^=n>>>13,n=Math.imul(n,1540483477),n^=n>>>15;return n>>>0}function ct(e,n){let r=n?at:ot;return r[st(e)%r.length]}var W={fullscreen:{maxEntries:10,containerClassName:`bottom-3 left-3 gap-1 rounded-lg px-3 py-2 text-xs`,titleClassName:`mb-1.5`,rowClassName:`gap-2`,swatchClassName:`size-2.5`,labelClassName:`max-w-[140px]`,overflowClassName:`pl-[18px]`},docked:{maxEntries:6,containerClassName:`bottom-2 left-2 gap-0.5 rounded-md px-2 py-1.5 text-[11px]`,titleClassName:`mb-1`,rowClassName:`gap-1.5`,swatchClassName:`size-2`,labelClassName:`max-w-[112px]`,overflowClassName:`pl-[14px]`}};function lt(e){return W[e]}function ut(e){let n=(0,et.c)(6),{clusters:r,variant:a}=e,o=a===void 0?`fullscreen`:a,{resolvedTheme:c}=s(),u=c===`dark`,d,f;if(n[0]!==r||n[1]!==u||n[2]!==o){f=Symbol.for(`react.early_return_sentinel`);bb0:{let e=lt(o);if(r.length===0){f=null;break bb0}let a=r.slice(0,e.maxEntries),s=r.length-a.length,c;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,B.jsx)(i,{id:`kmKqZg`}),n[5]=c):c=n[5],d=(0,B.jsxs)(`div`,{className:l(`pointer-events-none absolute z-10 flex flex-col backdrop-blur-sm`,e.containerClassName,u?`bg-black/70 text-gray-200`:`bg-white/80 text-gray-800 ring-1 ring-black/5`),children:[(0,B.jsx)(`div`,{className:l(`font-medium`,e.titleClassName,u?`text-slate-300`:`text-slate-700`),children:c}),a.map(n=>(0,B.jsxs)(`div`,{className:l(`flex items-center`,e.rowClassName),children:[(0,B.jsx)(`span`,{className:l(`inline-block shrink-0 rounded-full`,e.swatchClassName),style:{backgroundColor:ct(n,u)}}),(0,B.jsx)(`span`,{className:l(`truncate`,e.labelClassName),children:n})]},n)),s>0&&(0,B.jsx)(`div`,{className:l(`text-muted-foreground`,e.overflowClassName),children:(0,B.jsx)(i,{id:`lrhetp`,values:{overflow:s}})})]})}n[0]=r,n[1]=u,n[2]=o,n[3]=d,n[4]=f}else d=n[3],f=n[4];return f===Symbol.for(`react.early_return_sentinel`)?d:f}function dt(e,n){var r=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(r!=null){var i,a,o,s,c=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,n===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(i=o.call(r)).done)&&(c.push(i.value),c.length!==n);l=!0);}catch(e){u=!0,a=e}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return c}}function ft(e,n,r){return n=Ct(n),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function pt(e,n){return gt(e)||dt(e,n)||vt(e,n)||xt()}function mt(e){return ht(e)||_t(e)||vt(e)||bt()}function ht(e){if(Array.isArray(e))return yt(e)}function gt(e){if(Array.isArray(e))return e}function _t(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function vt(e,n){if(e){if(typeof e==`string`)return yt(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return Array.from(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yt(e,n)}}function yt(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function bt(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./useQuery-ZeEDLtxh.js";import{n as s}from"./dist-PQ5KMVDh.js";import{t as c}from"./compiler-runtime-BfE3aGVn.js";import{t as l}from"./utils-CPqDy6Hr.js";import{t as u}from"./button-RQ5o7P7w.js";import{i as d,n as f,t as p}from"./tooltip-x7BNUa3s.js";import{n as m,t as h}from"./toggle-group-Cnezoq-B.js";import{V as g,at as _,ft as v,hr as y,it as b,q as x}from"./dist-OxboORfH2.js";import{t as S}from"./createLucideIcon-DihYAFEK.js";import{t as C}from"./arrow-up-right-CxtRAecj.js";import{i as w,o as T,s as E,t as D}from"./prop-types-ZLa1Cj_J.js";import{t as ee}from"./triangle-alert-C2yId37R.js";import{t as O}from"./dist-CzC3AWOn.js";import{f as k}from"./doc-paths-lZOQ-mhw.js";import{d as te}from"./documents-events-5TI0rZAg.js";import{n as ne}from"./external-link-Dvu-nzFi.js";import{t as A}from"./overlay-layers-B39mutdg.js";import{a as re,c as ie,i as ae,n as j,r as oe,s as se,t as ce}from"./panel-Boo96yEj.js";import{t as le}from"./target-navigation-intent-DlmK2vet.js";import{t as ue}from"./ordinal-DdrNAXbu.js";import{n as de,t as fe}from"./min-B52VabRz.js";import{C as pe,S as M,_ as me,b as he,g as ge,n as N,r as _e,t as ve,v as ye,w as be,x as xe,y as Se}from"./src-CIOeKeVw.js";import{t as Ce}from"./colors-DThYSuj1.js";import{t as we}from"./isObject-CS6pZNNk.js";import{n as Te,t as P}from"./now-D9M3Ys6o.js";var Ee=S(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),De=S(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]);function F(e,n){let r=0;if(n===void 0)for(let n of e)(n=+n)&&(r+=n);else{let i=-1;for(let a of e)(a=+n(a,++i,e))&&(r+=a)}return r}var Oe=e=>()=>e;function ke(e,{sourceEvent:n,subject:r,target:i,identifier:a,active:o,x:s,y:c,dx:l,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}ke.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Ae(e){return!e.ctrlKey&&!e.button}function je(){return this.parentNode}function Me(e,n){return n??{x:e.x,y:e.y}}function Ne(){return navigator.maxTouchPoints||`ontouchstart`in this}function Pe(){var e=Ae,n=je,r=Me,i=Ne,a={},o=be(`start`,`drag`,`end`),s=0,c,l,u,d,f=0;function p(e){e.on(`mousedown.drag`,m).filter(i).on(`touchstart.drag`,_).on(`touchmove.drag`,v,Se).on(`touchend.drag touchcancel.drag`,y).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function m(r,i){if(!(d||!e.call(this,r,i))){var a=b(this,n.call(this,r,i),r,i,`mouse`);a&&(pe(r.view).on(`mousemove.drag`,h,he).on(`mouseup.drag`,g,he),ge(r.view),xe(r),u=!1,c=r.clientX,l=r.clientY,a(`start`,r))}}function h(e){if(ye(e),!u){var n=e.clientX-c,r=e.clientY-l;u=n*n+r*r>f}a.mouse(`drag`,e)}function g(e){pe(e.view).on(`mousemove.drag mouseup.drag`,null),me(e.view,u),ye(e),a.mouse(`end`,e)}function _(r,i){if(e.call(this,r,i)){var a=r.changedTouches,o=n.call(this,r,i),s=a.length,c,l;for(c=0;c<s;++c)(l=b(this,o,r,i,a[c].identifier,a[c]))&&(xe(r),l(`start`,r,a[c]))}}function v(e){var n=e.changedTouches,r=n.length,i,o;for(i=0;i<r;++i)(o=a[n[i].identifier])&&(ye(e),o(`drag`,e,n[i]))}function y(e){var n=e.changedTouches,r=n.length,i,o;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),i=0;i<r;++i)(o=a[n[i].identifier])&&(xe(e),o(`end`,e,n[i]))}function b(e,n,i,c,l,u){var d=o.copy(),f=M(u||i,n),m,h,g;if((g=r.call(e,new ke(`beforestart`,{sourceEvent:i,target:p,identifier:l,active:s,x:f[0],y:f[1],dx:0,dy:0,dispatch:d}),c))!=null)return m=g.x-f[0]||0,h=g.y-f[1]||0,function r(i,o,u){var _=f,v;switch(i){case`start`:a[l]=r,v=s++;break;case`end`:delete a[l],--s;case`drag`:f=M(u||o,n),v=s;break}d.call(i,e,new ke(i,{sourceEvent:o,subject:g,target:p,identifier:l,active:v,x:f[0]+m,y:f[1]+h,dx:f[0]-_[0],dy:f[1]-_[1],dispatch:d}),c)}}return p.filter=function(n){return arguments.length?(e=typeof n==`function`?n:Oe(!!n),p):e},p.container=function(e){return arguments.length?(n=typeof e==`function`?e:Oe(e),p):n},p.subject=function(e){return arguments.length?(r=typeof e==`function`?e:Oe(e),p):r},p.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:Oe(!!e),p):i},p.on=function(){var e=o.on.apply(o,arguments);return e===o?p:e},p.clickDistance=function(e){return arguments.length?(f=(e=+e)*e,p):Math.sqrt(f)},p}function I(e){let n=+this._x.call(null,e),r=+this._y.call(null,e);return Fe(this.cover(n,r),n,r,e)}function Fe(e,n,r,i){if(isNaN(n)||isNaN(r))return e;var a,o=e._root,s={data:i},c=e._x0,l=e._y0,u=e._x1,d=e._y1,f,p,m,h,g,_,v,y;if(!o)return e._root=s,e;for(;o.length;)if((g=n>=(f=(c+u)/2))?c=f:u=f,(_=r>=(p=(l+d)/2))?l=p:d=p,a=o,!(o=o[v=_<<1|g]))return a[v]=s,e;if(m=+e._x.call(null,o.data),h=+e._y.call(null,o.data),n===m&&r===h)return s.next=o,a?a[v]=s:e._root=s,e;do a=a?a[v]=[,,,,]:e._root=[,,,,],(g=n>=(f=(c+u)/2))?c=f:u=f,(_=r>=(p=(l+d)/2))?l=p:d=p;while((v=_<<1|g)==(y=(h>=p)<<1|m>=f));return a[y]=o,a[v]=s,e}function Ie(e){var n,r,i=e.length,a,o,s=Array(i),c=Array(i),l=1/0,u=1/0,d=-1/0,f=-1/0;for(r=0;r<i;++r)isNaN(a=+this._x.call(null,n=e[r]))||isNaN(o=+this._y.call(null,n))||(s[r]=a,c[r]=o,a<l&&(l=a),a>d&&(d=a),o<u&&(u=o),o>f&&(f=o));if(l>d||u>f)return this;for(this.cover(l,u).cover(d,f),r=0;r<i;++r)Fe(this,s[r],c[r],e[r]);return this}function L(e,n){if(isNaN(e=+e)||isNaN(n=+n))return this;var r=this._x0,i=this._y0,a=this._x1,o=this._y1;if(isNaN(r))a=(r=Math.floor(e))+1,o=(i=Math.floor(n))+1;else{for(var s=a-r||1,c=this._root,l,u;r>e||e>=a||i>n||n>=o;)switch(u=(n<i)<<1|e<r,l=[,,,,],l[u]=c,c=l,s*=2,u){case 0:a=r+s,o=i+s;break;case 1:r=a-s,o=i+s;break;case 2:a=r+s,i=o-s;break;case 3:r=a-s,i=o-s;break}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=i,this._x1=a,this._y1=o,this}function Le(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function Re(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function R(e,n,r,i,a){this.node=e,this.x0=n,this.y0=r,this.x1=i,this.y1=a}function ze(e,n,r){var i,a=this._x0,o=this._y0,s,c,l,u,d=this._x1,f=this._y1,p=[],m=this._root,h,g;for(m&&p.push(new R(m,a,o,d,f)),r==null?r=1/0:(a=e-r,o=n-r,d=e+r,f=n+r,r*=r);h=p.pop();)if(!(!(m=h.node)||(s=h.x0)>d||(c=h.y0)>f||(l=h.x1)<a||(u=h.y1)<o))if(m.length){var _=(s+l)/2,v=(c+u)/2;p.push(new R(m[3],_,v,l,u),new R(m[2],s,v,_,u),new R(m[1],_,c,l,v),new R(m[0],s,c,_,v)),(g=(n>=v)<<1|e>=_)&&(h=p[p.length-1],p[p.length-1]=p[p.length-1-g],p[p.length-1-g]=h)}else{var y=e-+this._x.call(null,m.data),b=n-+this._y.call(null,m.data),x=y*y+b*b;if(x<r){var S=Math.sqrt(r=x);a=e-S,o=n-S,d=e+S,f=n+S,i=m.data}}return i}function Be(e){if(isNaN(d=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var n,r=this._root,i,a,o,s=this._x0,c=this._y0,l=this._x1,u=this._y1,d,f,p,m,h,g,_,v;if(!r)return this;if(r.length)for(;;){if((h=d>=(p=(s+l)/2))?s=p:l=p,(g=f>=(m=(c+u)/2))?c=m:u=m,n=r,!(r=r[_=g<<1|h]))return this;if(!r.length)break;(n[_+1&3]||n[_+2&3]||n[_+3&3])&&(i=n,v=_)}for(;r.data!==e;)if(a=r,!(r=r.next))return this;return(o=r.next)&&delete r.next,a?(o?a.next=o:delete a.next,this):n?(o?n[_]=o:delete n[_],(r=n[0]||n[1]||n[2]||n[3])&&r===(n[3]||n[2]||n[1]||n[0])&&!r.length&&(i?i[v]=r:this._root=r),this):(this._root=o,this)}function Ve(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function He(){return this._root}function Ue(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function We(e){var n=[],r,i=this._root,a,o,s,c,l;for(i&&n.push(new R(i,this._x0,this._y0,this._x1,this._y1));r=n.pop();)if(!e(i=r.node,o=r.x0,s=r.y0,c=r.x1,l=r.y1)&&i.length){var u=(o+c)/2,d=(s+l)/2;(a=i[3])&&n.push(new R(a,u,d,c,l)),(a=i[2])&&n.push(new R(a,o,d,u,l)),(a=i[1])&&n.push(new R(a,u,s,c,d)),(a=i[0])&&n.push(new R(a,o,s,u,d))}return this}function Ge(e){var n=[],r=[],i;for(this._root&&n.push(new R(this._root,this._x0,this._y0,this._x1,this._y1));i=n.pop();){var a=i.node;if(a.length){var o,s=i.x0,c=i.y0,l=i.x1,u=i.y1,d=(s+l)/2,f=(c+u)/2;(o=a[0])&&n.push(new R(o,s,c,d,f)),(o=a[1])&&n.push(new R(o,d,c,l,f)),(o=a[2])&&n.push(new R(o,s,f,d,u)),(o=a[3])&&n.push(new R(o,d,f,l,u))}r.push(i)}for(;i=r.pop();)e(i.node,i.x0,i.y0,i.x1,i.y1);return this}function Ke(e){return e[0]}function qe(e){return arguments.length?(this._x=e,this):this._x}function Je(e){return e[1]}function Ye(e){return arguments.length?(this._y=e,this):this._y}function Xe(e,n,r){var i=new Ze(n??Ke,r??Je,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function Ze(e,n,r,i,a,o){this._x=e,this._y=n,this._x0=r,this._y0=i,this._x1=a,this._y1=o,this._root=void 0}function Qe(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var z=Xe.prototype=Ze.prototype;z.copy=function(){var e=new Ze(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root,r,i;if(!n)return e;if(!n.length)return e._root=Qe(n),e;for(r=[{source:n,target:e._root=[,,,,]}];n=r.pop();)for(var a=0;a<4;++a)(i=n.source[a])&&(i.length?r.push({source:i,target:n.target[a]=[,,,,]}):n.target[a]=Qe(i));return e},z.add=I,z.addAll=Ie,z.cover=L,z.data=Le,z.extent=Re,z.find=ze,z.remove=Be,z.removeAll=Ve,z.root=He,z.size=Ue,z.visit=We,z.visitAfter=Ge,z.x=qe,z.y=Ye;var $e=Ce(`a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928`),B=n(),V=e(r(),1),et=c(),H=`Expected a function`,tt=Math.max,nt=Math.min;function rt(e,n,r){var i,a,o,s,c,l,u=0,d=!1,f=!1,p=!0;if(typeof e!=`function`)throw TypeError(H);n=Te(n)||0,we(r)&&(d=!!r.leading,f=`maxWait`in r,o=f?tt(Te(r.maxWait)||0,n):o,p=`trailing`in r?!!r.trailing:p);function m(n){var r=i,o=a;return i=a=void 0,u=n,s=e.apply(o,r),s}function h(e){return u=e,c=setTimeout(v,n),d?m(e):s}function g(e){var r=e-l,i=e-u,a=n-r;return f?nt(a,o-i):a}function _(e){var r=e-l,i=e-u;return l===void 0||r>=n||r<0||f&&i>=o}function v(){var e=P();if(_(e))return y(e);c=setTimeout(v,g(e))}function y(e){return c=void 0,p&&i?m(e):(i=a=void 0,s)}function b(){c!==void 0&&clearTimeout(c),u=0,i=l=a=c=void 0}function x(){return c===void 0?s:y(P())}function S(){var e=P(),r=_(e);if(i=arguments,a=this,l=e,r){if(c===void 0)return h(l);if(f)return clearTimeout(c),c=setTimeout(v,n),m(l)}return c===void 0&&(c=setTimeout(v,n)),s}return S.cancel=b,S.flush=x,S}var U=`Expected a function`;function it(e,n,r){var i=!0,a=!0;if(typeof e!=`function`)throw TypeError(U);return we(r)&&(i=`leading`in r?!!r.leading:i,a=`trailing`in r?!!r.trailing:a),rt(e,n,{leading:i,maxWait:n,trailing:a})}var at=[`#60a5fa`,`#a78bfa`,`#34d399`,`#f472b6`,`#fb923c`,`#22d3ee`,`#c084fc`,`#4ade80`,`#f87171`,`#eab308`,`#ec4899`,`#06b67f`,`#8b5cf6`,`#f43f5e`,`#0ea5e9`,`#a855f7`],ot=[`#1e40af`,`#6b21a8`,`#166534`,`#9f1239`,`#9a3412`,`#164e63`,`#581c87`,`#166534`,`#991b1b`,`#854d0e`,`#831843`,`#0f766e`,`#312e81`,`#9f1239`,`#0c4a6e`,`#6b21a8`];function st(e){let n=2;for(let r=0;r<e.length;r++)n=Math.imul(n^e.charCodeAt(r),1540483477),n^=n>>>13,n=Math.imul(n,1540483477),n^=n>>>15;return n>>>0}function ct(e,n){let r=n?at:ot;return r[st(e)%r.length]}var W={fullscreen:{maxEntries:10,containerClassName:`bottom-3 left-3 gap-1 rounded-lg px-3 py-2 text-xs`,titleClassName:`mb-1.5`,rowClassName:`gap-2`,swatchClassName:`size-2.5`,labelClassName:`max-w-[140px]`,overflowClassName:`pl-[18px]`},docked:{maxEntries:6,containerClassName:`bottom-2 left-2 gap-0.5 rounded-md px-2 py-1.5 text-[11px]`,titleClassName:`mb-1`,rowClassName:`gap-1.5`,swatchClassName:`size-2`,labelClassName:`max-w-[112px]`,overflowClassName:`pl-[14px]`}};function lt(e){return W[e]}function ut(e){let n=(0,et.c)(6),{clusters:r,variant:a}=e,o=a===void 0?`fullscreen`:a,{resolvedTheme:c}=s(),u=c===`dark`,d,f;if(n[0]!==r||n[1]!==u||n[2]!==o){f=Symbol.for(`react.early_return_sentinel`);bb0:{let e=lt(o);if(r.length===0){f=null;break bb0}let a=r.slice(0,e.maxEntries),s=r.length-a.length,c;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,B.jsx)(i,{id:`kmKqZg`}),n[5]=c):c=n[5],d=(0,B.jsxs)(`div`,{className:l(`pointer-events-none absolute z-10 flex flex-col backdrop-blur-sm`,e.containerClassName,u?`bg-black/70 text-gray-200`:`bg-white/80 text-gray-800 ring-1 ring-black/5`),children:[(0,B.jsx)(`div`,{className:l(`font-medium`,e.titleClassName,u?`text-slate-300`:`text-slate-700`),children:c}),a.map(n=>(0,B.jsxs)(`div`,{className:l(`flex items-center`,e.rowClassName),children:[(0,B.jsx)(`span`,{className:l(`inline-block shrink-0 rounded-full`,e.swatchClassName),style:{backgroundColor:ct(n,u)}}),(0,B.jsx)(`span`,{className:l(`truncate`,e.labelClassName),children:n})]},n)),s>0&&(0,B.jsx)(`div`,{className:l(`text-muted-foreground`,e.overflowClassName),children:(0,B.jsx)(i,{id:`lrhetp`,values:{overflow:s}})})]})}n[0]=r,n[1]=u,n[2]=o,n[3]=d,n[4]=f}else d=n[3],f=n[4];return f===Symbol.for(`react.early_return_sentinel`)?d:f}function dt(e,n){var r=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(r!=null){var i,a,o,s,c=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,n===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(i=o.call(r)).done)&&(c.push(i.value),c.length!==n);l=!0);}catch(e){u=!0,a=e}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return c}}function ft(e,n,r){return n=Ct(n),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function pt(e,n){return gt(e)||dt(e,n)||vt(e,n)||xt()}function mt(e){return ht(e)||_t(e)||vt(e)||bt()}function ht(e){if(Array.isArray(e))return yt(e)}function gt(e){if(Array.isArray(e))return e}function _t(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function vt(e,n){if(e){if(typeof e==`string`)return yt(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return Array.from(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yt(e,n)}}function yt(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function bt(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xt(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function St(e,n){if(typeof e!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n||`default`);if(typeof i!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(e)}function Ct(e){var n=St(e,`string`);return typeof n==`symbol`?n:String(n)}var wt=function(e,n){var r=new Set(n);return Object.assign.apply(Object,[{}].concat(mt(Object.entries(e).filter(function(e){var n=pt(e,1)[0];return!r.has(n)}).map(function(e){var n=pt(e,2),r=n[0],i=n[1];return ft({},r,i)}))))};function Tt(e,{wrapperElementType:n=`div`,nodeMapper:r=e=>e,methodNames:i=[],initPropNames:a=[]}={}){return(0,V.forwardRef)((o,s)=>{let c=(0,V.useRef)(),l=(0,V.useMemo)(()=>e(Object.fromEntries(a.filter(e=>o.hasOwnProperty(e)).map(e=>[e,o[e]]))),[]);Et(()=>{l(r(c.current))},V.useLayoutEffect),Et(()=>l._destructor instanceof Function?l._destructor:void 0);let u=(0,V.useCallback)((e,...n)=>l[e]instanceof Function?l[e](...n):void 0,[l]),d=(0,V.useRef)({});return Object.keys(wt(o,[...i,...a])).filter(e=>d.current[e]!==o[e]).forEach(e=>u(e,o[e])),d.current=o,(0,V.useImperativeHandle)(s,()=>Object.fromEntries(i.map(e=>[e,(...n)=>u(e,...n)])),[u]),V.createElement(n,{ref:c})})}function Et(e,n=V.useEffect){let r=(0,V.useRef)(),i=(0,V.useRef)(!1),a=(0,V.useRef)(!1),[o,s]=(0,V.useState)(0);i.current&&(a.current=!0),n(()=>(i.current||=(r.current=e(),!0),s(e=>e+1),()=>{a.current&&=(r.current&&r.current(),r.current=void 0,i.current=!1,!1)}),[])}var Dt=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:1024**(e-1)},Out:function(e){return e===1?1:1-2**(-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*1024**(e-1):.5*(-(2**(-10*(e-1)))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-(2**(10*(e-1)))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:2**(-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*2**(10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*2**(-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var n=1.70158;return e===1?1:e*e*((n+1)*e-n)},Out:function(e){var n=1.70158;return e===0?0:--e*e*((n+1)*e+n)+1},InOut:function(e){var n=1.70158*1.525;return(e*=2)<1?.5*(e*e*((n+1)*e-n)):.5*((e-=2)*e*((n+1)*e+n)+2)}}),Bounce:Object.freeze({In:function(e){return 1-Dt.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?Dt.Bounce.In(e*2)*.5:Dt.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<2**-52?2**-52:e,e=e>1e4?1e4:e,{In:function(n){return n**+e},Out:function(n){return 1-(1-n)**e},InOut:function(n){return n<.5?(n*2)**e/2:(1-(2-n*2)**e)/2+.5}}}}),Ot=function(){return performance.now()},kt=function(){function e(){var e=[...arguments];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,e)}return e.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map(function(n){return e._tweens[n]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var e,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i=0,a=n;i<a.length;i++){var o=a[i];(e=o._group)==null||e.remove(o),o._group=this,this._tweens[o.getId()]=o,this._tweensAddedDuringUpdate[o.getId()]=o}},e.prototype.remove=function(){for(var e=[...arguments],n=0,r=e;n<r.length;n++){var i=r[n];i._group=void 0,delete this._tweens[i.getId()],delete this._tweensAddedDuringUpdate[i.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(e){return!e.isPlaying()})},e.prototype.update=function(e,n){e===void 0&&(e=Ot()),n===void 0&&(n=!0);var r=Object.keys(this._tweens);if(r.length!==0)for(;r.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<r.length;i++){var a=this._tweens[r[i]],o=!n;a&&a.update(e,o)===!1&&!n&&this.remove(a)}r=Object.keys(this._tweensAddedDuringUpdate)}},e}(),At={Linear:function(e,n){var r=e.length-1,i=r*n,a=Math.floor(i),o=At.Utils.Linear;return n<0?o(e[0],e[1],i):n>1?o(e[r],e[r-1],r-i):o(e[a],e[a+1>r?r:a+1],i-a)},Bezier:function(e,n){for(var r=0,i=e.length-1,a=Math.pow,o=At.Utils.Bernstein,s=0;s<=i;s++)r+=a(1-n,i-s)*a(n,s)*e[s]*o(i,s);return r},CatmullRom:function(e,n){var r=e.length-1,i=r*n,a=Math.floor(i),o=At.Utils.CatmullRom;return e[0]===e[r]?(n<0&&(a=Math.floor(i=r*(1+n))),o(e[(a-1+r)%r],e[a],e[(a+1)%r],e[(a+2)%r],i-a)):n<0?e[0]-(o(e[0],e[0],e[1],e[1],-i)-e[0]):n>1?e[r]-(o(e[r],e[r],e[r-1],e[r-1],i-r)-e[r]):o(e[a?a-1:0],e[a],e[r<a+1?r:a+1],e[r<a+2?r:a+2],i-a)},Utils:{Linear:function(e,n,r){return(n-e)*r+e},Bernstein:function(e,n){var r=At.Utils.Factorial;return r(e)/r(n)/r(e-n)},Factorial:(function(){var e=[1];return function(n){var r=1;if(e[n])return e[n];for(var i=n;i>1;i--)r*=i;return e[n]=r,r}})(),CatmullRom:function(e,n,r,i,a){var o=(r-e)*.5,s=(i-n)*.5,c=a*a,l=a*c;return(2*n-2*r+o+s)*l+(-3*n+3*r-2*o-s)*c+o*a+n}}},jt=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),Mt=new kt,Nt=function(){function e(e,n){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Dt.Linear.None,this._interpolationFunction=At.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=jt.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=e,typeof n==`object`?(this._group=n,n.add(this)):n===!0&&(this._group=Mt,Mt.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(e,n){if(n===void 0&&(n=1e3),this._isPlaying)throw Error(`Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.`);return this._valuesEnd=e,this._propertiesAreSetUp=!1,this._duration=n<0?0:n,this},e.prototype.duration=function(e){return e===void 0&&(e=1e3),this._duration=e<0?0:e,this},e.prototype.dynamic=function(e){return e===void 0&&(e=!1),this._isDynamic=e,this},e.prototype.start=function(e,n){if(e===void 0&&(e=Ot()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed)for(var r in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var i={};for(var a in this._valuesEnd)i[a]=this._valuesEnd[a];this._valuesEnd=i}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},e.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},e.prototype._setupProperties=function(e,n,r,i,a){for(var o in r){var s=e[o],c=Array.isArray(s),l=c?`array`:typeof s,u=!c&&Array.isArray(r[o]);if(!(l===`undefined`||l===`function`)){if(u){var d=r[o];if(d.length===0)continue;for(var f=[s],p=0,m=d.length;p<m;p+=1){var h=this._handleRelativeValue(s,d[p]);if(isNaN(h)){u=!1,console.warn(`Found invalid interpolation list. Skipping.`);break}f.push(h)}u&&(r[o]=f)}if((l===`object`||c)&&s&&!u){n[o]=c?[]:{};var g=s;for(var _ in g)n[o][_]=g[_];i[o]=c?[]:{};var d=r[o];if(!this._isDynamic){var v={};for(var _ in d)v[_]=d[_];r[o]=d=v}this._setupProperties(g,n[o],d,i[o],a)}else (n[o]===void 0||a)&&(n[o]=s),c||(n[o]*=1),u?i[o]=r[o].slice().reverse():i[o]=n[o]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(e){return e===void 0&&(e=Ot()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=e,this)},e.prototype.resume=function(e){return e===void 0&&(e=Ot()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var e=0,n=this._chainedTweens.length;e<n;e++)this._chainedTweens[e].stop();return this},e.prototype.group=function(e){return e?(e.add(this),this):(console.warn(`tween.group() without args has been removed, use group.add(tween) instead.`),this)},e.prototype.remove=function(){var e;return(e=this._group)==null||e.remove(this),this},e.prototype.delay=function(e){return e===void 0&&(e=0),this._delayTime=e,this},e.prototype.repeat=function(e){return e===void 0&&(e=0),this._initialRepeat=e,this._repeat=e,this},e.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},e.prototype.yoyo=function(e){return e===void 0&&(e=!1),this._yoyo=e,this},e.prototype.easing=function(e){return e===void 0&&(e=Dt.Linear.None),this._easingFunction=e,this},e.prototype.interpolation=function(e){return e===void 0&&(e=At.Linear),this._interpolationFunction=e,this},e.prototype.chain=function(){return this._chainedTweens=[...arguments],this},e.prototype.onStart=function(e){return this._onStartCallback=e,this},e.prototype.onEveryStart=function(e){return this._onEveryStartCallback=e,this},e.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},e.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},e.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},e.prototype.onStop=function(e){return this._onStopCallback=e,this},e.prototype.update=function(n,r){var i=this;if(n===void 0&&(n=Ot()),r===void 0&&(r=e.autoStartOnUpdate),this._isPaused)return!0;var a;if(!this._goToEnd&&!this._isPlaying)if(r)this.start(n,!0);else return!1;if(this._goToEnd=!1,n<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var o=n-this._startTime,s=this._duration+(this._repeatDelayTime??this._delayTime),c=this._duration+this._repeat*s,l=function(){if(i._duration===0||o>c)return 1;var e=o-Math.trunc(o/s)*s,n=Math.min(e/i._duration,1);return n===0&&o===i._duration?1:n}(),u=this._easingFunction(l);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,u),this._onUpdateCallback&&this._onUpdateCallback(this._object,l),this._duration===0||o>=this._duration)if(this._repeat>0){var d=Math.min(Math.trunc((o-this._duration)/s)+1,this._repeat);for(a in isFinite(this._repeat)&&(this._repeat-=d),this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[a]==`string`&&(this._valuesStartRepeat[a]=this._valuesStartRepeat[a]+parseFloat(this._valuesEnd[a])),this._yoyo&&this._swapEndStartRepeatValues(a),this._valuesStart[a]=this._valuesStartRepeat[a];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=s*d,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var f=0,p=this._chainedTweens.length;f<p;f++)this._chainedTweens[f].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(e,n,r,i){for(var a in r)if(n[a]!==void 0){var o=n[a]||0,s=r[a];!Array.isArray(e[a])&&Array.isArray(s)?e[a]=this._interpolationFunction(s,i):typeof s==`object`&&s?this._updateProperties(e[a],o,s,i):(s=this._handleRelativeValue(o,s),typeof s==`number`&&(e[a]=o+(s-o)*i))}},e.prototype._handleRelativeValue=function(e,n){return typeof n==`string`?n.charAt(0)===`+`||n.charAt(0)===`-`?e+parseFloat(n):parseFloat(n):n},e.prototype._swapEndStartRepeatValues=function(e){var n=this._valuesStartRepeat[e],r=this._valuesEnd[e];typeof r==`string`?this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(r):this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=n},e.autoStartOnUpdate=!1,e}();jt.nextId;var Pt=Mt;Pt.getAll.bind(Pt),Pt.removeAll.bind(Pt),Pt.add.bind(Pt),Pt.remove.bind(Pt),Pt.update.bind(Pt);function Ft(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function It(e){if(Array.isArray(e))return e}function Lt(e,n){if(!(e instanceof n))throw TypeError(`Cannot call a class as a function`)}function Rt(e,n,r){return Object.defineProperty(e,`prototype`,{writable:!1}),e}function zt(e,n){var r=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(r!=null){var i,a,o,s,c=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,n!==0)for(;!(l=(i=o.call(r)).done)&&(c.push(i.value),c.length!==n);l=!0);}catch(e){u=!0,a=e}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return c}}function Bt(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vt(e,n){return It(e)||zt(e,n)||Ht(e,n)||Bt()}function Ht(e,n){if(e){if(typeof e==`string`)return Ft(e,n);var r={}.toString.call(e).slice(8,-1);return r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`?Array.from(e):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ft(e,n):void 0}}var Ut=Rt(function e(n,r){var i=r.default,a=i===void 0?null:i,o=r.triggerUpdate,s=o===void 0?!0:o,c=r.onChange,l=c===void 0?function(e,n){}:c;Lt(this,e),this.name=n,this.defaultVal=a,this.triggerUpdate=s,this.onChange=l});function Wt(e){var n=e.stateInit,r=n===void 0?function(){return{}}:n,i=e.props,a=i===void 0?{}:i,o=e.methods,s=o===void 0?{}:o,c=e.aliases,l=c===void 0?{}:c,u=e.init,d=u===void 0?function(){}:u,f=e.update,p=f===void 0?function(){}:f,m=Object.keys(a).map(function(e){return new Ut(e,a[e])});return function e(){var n=[...arguments],i=!!(this instanceof e&&this.constructor),a=i?n.shift():void 0,o=n[0],c=o===void 0?{}:o,u=Object.assign({},r instanceof Function?r(c):r,{initialised:!1}),f={};function h(e){return g(e,c),_(),h}var g=function(e,n){d.call(h,e,u,n),u.initialised=!0},_=rt(function(){u.initialised&&(p.call(h,u,f),f={})},1);return m.forEach(function(e){h[e.name]=n(e);function n(e){var n=e.name,r=e.triggerUpdate,i=r===void 0?!1:r,a=e.onChange,o=a===void 0?function(e,n){}:a,s=e.defaultVal,c=s===void 0?null:s;return function(e){var r=u[n];if(!arguments.length)return r;var a=e===void 0?c:e;return u[n]=a,o.call(h,a,u,r),!f.hasOwnProperty(n)&&(f[n]=r),i&&_(),h}}}),Object.keys(s).forEach(function(e){h[e]=function(){var n,r=[...arguments];return(n=s[e]).call.apply(n,[h,u].concat(r))}}),Object.entries(l).forEach(function(e){var n=Vt(e,2),r=n[0];return h[r]=h[n[1]]}),h.resetProps=function(){return m.forEach(function(e){h[e.name](e.defaultVal)}),h},h.resetProps(),u._rerender=_,i&&a&&h(a),h}}var G=(function(e){return typeof e==`function`?e:typeof e==`string`?function(n){return n[e]}:function(n){return e}});function Gt(e){"@babel/helpers - typeof";return Gt=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Gt(e)}var Kt=/^\s+/,qt=/\s+$/;function K(e,n){if(e||=``,n||={},e instanceof K)return e;if(!(this instanceof K))return new K(e,n);var r=Jt(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=n.format||r.format,this._gradientType=n.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}K.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},getLuminance:function(){var e=this.toRgb(),n=e.r/255,r=e.g/255,i=e.b/255,a=n<=.03928?n/12.92:((n+.055)/1.055)**2.4,o=r<=.03928?r/12.92:((r+.055)/1.055)**2.4,s=i<=.03928?i/12.92:((i+.055)/1.055)**2.4;return .2126*a+.7152*o+.0722*s},setAlpha:function(e){return this._a=yn(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=Qt(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=Qt(this._r,this._g,this._b),n=Math.round(e.h*360),r=Math.round(e.s*100),i=Math.round(e.v*100);return this._a==1?`hsv(`+n+`, `+r+`%, `+i+`%)`:`hsva(`+n+`, `+r+`%, `+i+`%, `+this._roundA+`)`},toHsl:function(){var e=Xt(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=Xt(this._r,this._g,this._b),n=Math.round(e.h*360),r=Math.round(e.s*100),i=Math.round(e.l*100);return this._a==1?`hsl(`+n+`, `+r+`%, `+i+`%)`:`hsla(`+n+`, `+r+`%, `+i+`%, `+this._roundA+`)`},toHex:function(e){return en(this._r,this._g,this._b,e)},toHexString:function(e){return`#`+this.toHex(e)},toHex8:function(e){return tn(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return`#`+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?`rgb(`+Math.round(this._r)+`, `+Math.round(this._g)+`, `+Math.round(this._b)+`)`:`rgba(`+Math.round(this._r)+`, `+Math.round(this._g)+`, `+Math.round(this._b)+`, `+this._roundA+`)`},toPercentageRgb:function(){return{r:Math.round(q(this._r,255)*100)+`%`,g:Math.round(q(this._g,255)*100)+`%`,b:Math.round(q(this._b,255)*100)+`%`,a:this._a}},toPercentageRgbString:function(){return this._a==1?`rgb(`+Math.round(q(this._r,255)*100)+`%, `+Math.round(q(this._g,255)*100)+`%, `+Math.round(q(this._b,255)*100)+`%)`:`rgba(`+Math.round(q(this._r,255)*100)+`%, `+Math.round(q(this._g,255)*100)+`%, `+Math.round(q(this._b,255)*100)+`%, `+this._roundA+`)`},toName:function(){return this._a===0?`transparent`:this._a<1?!1:_n[en(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var n=`#`+nn(this._r,this._g,this._b,this._a),r=n,i=this._gradientType?`GradientType = 1, `:``;if(e){var a=K(e);r=`#`+nn(a._r,a._g,a._b,a._a)}return`progid:DXImageTransform.Microsoft.gradient(`+i+`startColorstr=`+n+`,endColorstr=`+r+`)`},toString:function(e){var n=!!e;e||=this._format;var r=!1,i=this._a<1&&this._a>=0;return!n&&i&&(e===`hex`||e===`hex6`||e===`hex3`||e===`hex4`||e===`hex8`||e===`name`)?e===`name`&&this._a===0?this.toName():this.toRgbString():(e===`rgb`&&(r=this.toRgbString()),e===`prgb`&&(r=this.toPercentageRgbString()),(e===`hex`||e===`hex6`)&&(r=this.toHexString()),e===`hex3`&&(r=this.toHexString(!0)),e===`hex4`&&(r=this.toHex8String(!0)),e===`hex8`&&(r=this.toHex8String()),e===`name`&&(r=this.toName()),e===`hsl`&&(r=this.toHslString()),e===`hsv`&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return K(this.toString())},_applyModification:function(e,n){var r=e.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(sn,arguments)},brighten:function(){return this._applyModification(cn,arguments)},darken:function(){return this._applyModification(ln,arguments)},desaturate:function(){return this._applyModification(rn,arguments)},saturate:function(){return this._applyModification(an,arguments)},greyscale:function(){return this._applyModification(on,arguments)},spin:function(){return this._applyModification(un,arguments)},_applyCombination:function(e,n){return e.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(mn,arguments)},complement:function(){return this._applyCombination(dn,arguments)},monochromatic:function(){return this._applyCombination(hn,arguments)},splitcomplement:function(){return this._applyCombination(pn,arguments)},triad:function(){return this._applyCombination(fn,[3])},tetrad:function(){return this._applyCombination(fn,[4])}},K.fromRatio=function(e,n){if(Gt(e)==`object`){var r={};for(var i in e)e.hasOwnProperty(i)&&(i===`a`?r[i]=e[i]:r[i]=Tn(e[i]));e=r}return K(e,n)};function Jt(e){var n={r:0,g:0,b:0},r=1,i=null,a=null,o=null,s=!1,c=!1;return typeof e==`string`&&(e=An(e)),Gt(e)==`object`&&(kn(e.r)&&kn(e.g)&&kn(e.b)?(n=Yt(e.r,e.g,e.b),s=!0,c=String(e.r).substr(-1)===`%`?`prgb`:`rgb`):kn(e.h)&&kn(e.s)&&kn(e.v)?(i=Tn(e.s),a=Tn(e.v),n=$t(e.h,i,a),s=!0,c=`hsv`):kn(e.h)&&kn(e.s)&&kn(e.l)&&(i=Tn(e.s),o=Tn(e.l),n=Zt(e.h,i,o),s=!0,c=`hsl`),e.hasOwnProperty(`a`)&&(r=e.a)),r=yn(r),{ok:s,format:e.format||c,r:Math.min(255,Math.max(n.r,0)),g:Math.min(255,Math.max(n.g,0)),b:Math.min(255,Math.max(n.b,0)),a:r}}function Yt(e,n,r){return{r:q(e,255)*255,g:q(n,255)*255,b:q(r,255)*255}}function Xt(e,n,r){e=q(e,255),n=q(n,255),r=q(r,255);var i=Math.max(e,n,r),a=Math.min(e,n,r),o,s,c=(i+a)/2;if(i==a)o=s=0;else{var l=i-a;switch(s=c>.5?l/(2-i-a):l/(i+a),i){case e:o=(n-r)/l+(n<r?6:0);break;case n:o=(r-e)/l+2;break;case r:o=(e-n)/l+4;break}o/=6}return{h:o,s,l:c}}function Zt(e,n,r){var i,a,o;e=q(e,360),n=q(n,100),r=q(r,100);function s(e,n,r){return r<0&&(r+=1),r>1&&--r,r<1/6?e+(n-e)*6*r:r<1/2?n:r<2/3?e+(n-e)*(2/3-r)*6:e}if(n===0)i=a=o=r;else{var c=r<.5?r*(1+n):r+n-r*n,l=2*r-c;i=s(l,c,e+1/3),a=s(l,c,e),o=s(l,c,e-1/3)}return{r:i*255,g:a*255,b:o*255}}function Qt(e,n,r){e=q(e,255),n=q(n,255),r=q(r,255);var i=Math.max(e,n,r),a=Math.min(e,n,r),o,s,c=i,l=i-a;if(s=i===0?0:l/i,i==a)o=0;else{switch(i){case e:o=(n-r)/l+(n<r?6:0);break;case n:o=(r-e)/l+2;break;case r:o=(e-n)/l+4;break}o/=6}return{h:o,s,v:c}}function $t(e,n,r){e=q(e,360)*6,n=q(n,100),r=q(r,100);var i=Math.floor(e),a=e-i,o=r*(1-n),s=r*(1-a*n),c=r*(1-(1-a)*n),l=i%6,u=[r,s,o,o,c,r][l],d=[c,r,r,s,o,o][l],f=[o,o,c,r,r,s][l];return{r:u*255,g:d*255,b:f*255}}function en(e,n,r,i){var a=[wn(Math.round(e).toString(16)),wn(Math.round(n).toString(16)),wn(Math.round(r).toString(16))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join(``)}function tn(e,n,r,i,a){var o=[wn(Math.round(e).toString(16)),wn(Math.round(n).toString(16)),wn(Math.round(r).toString(16)),wn(En(i))];return a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join(``)}function nn(e,n,r,i){return[wn(En(i)),wn(Math.round(e).toString(16)),wn(Math.round(n).toString(16)),wn(Math.round(r).toString(16))].join(``)}K.equals=function(e,n){return!e||!n?!1:K(e).toRgbString()==K(n).toRgbString()},K.random=function(){return K.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function rn(e,n){n=n===0?0:n||10;var r=K(e).toHsl();return r.s-=n/100,r.s=bn(r.s),K(r)}function an(e,n){n=n===0?0:n||10;var r=K(e).toHsl();return r.s+=n/100,r.s=bn(r.s),K(r)}function on(e){return K(e).desaturate(100)}function sn(e,n){n=n===0?0:n||10;var r=K(e).toHsl();return r.l+=n/100,r.l=bn(r.l),K(r)}function cn(e,n){n=n===0?0:n||10;var r=K(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(n/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(n/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(n/100)))),K(r)}function ln(e,n){n=n===0?0:n||10;var r=K(e).toHsl();return r.l-=n/100,r.l=bn(r.l),K(r)}function un(e,n){var r=K(e).toHsl(),i=(r.h+n)%360;return r.h=i<0?360+i:i,K(r)}function dn(e){var n=K(e).toHsl();return n.h=(n.h+180)%360,K(n)}function fn(e,n){if(isNaN(n)||n<=0)throw Error(`Argument to polyad must be a positive number`);for(var r=K(e).toHsl(),i=[K(e)],a=360/n,o=1;o<n;o++)i.push(K({h:(r.h+o*a)%360,s:r.s,l:r.l}));return i}function pn(e){var n=K(e).toHsl(),r=n.h;return[K(e),K({h:(r+72)%360,s:n.s,l:n.l}),K({h:(r+216)%360,s:n.s,l:n.l})]}function mn(e,n,r){n||=6,r||=30;var i=K(e).toHsl(),a=360/r,o=[K(e)];for(i.h=(i.h-(a*n>>1)+720)%360;--n;)i.h=(i.h+a)%360,o.push(K(i));return o}function hn(e,n){n||=6;for(var r=K(e).toHsv(),i=r.h,a=r.s,o=r.v,s=[],c=1/n;n--;)s.push(K({h:i,s:a,v:o})),o=(o+c)%1;return s}K.mix=function(e,n,r){r=r===0?0:r||50;var i=K(e).toRgb(),a=K(n).toRgb(),o=r/100;return K({r:(a.r-i.r)*o+i.r,g:(a.g-i.g)*o+i.g,b:(a.b-i.b)*o+i.b,a:(a.a-i.a)*o+i.a})},K.readability=function(e,n){var r=K(e),i=K(n);return(Math.max(r.getLuminance(),i.getLuminance())+.05)/(Math.min(r.getLuminance(),i.getLuminance())+.05)},K.isReadable=function(e,n,r){var i=K.readability(e,n),a,o=!1;switch(a=jn(r),a.level+a.size){case`AAsmall`:case`AAAlarge`:o=i>=4.5;break;case`AAlarge`:o=i>=3;break;case`AAAsmall`:o=i>=7;break}return o},K.mostReadable=function(e,n,r){var i=null,a=0,o,s,c,l;r||={},s=r.includeFallbackColors,c=r.level,l=r.size;for(var u=0;u<n.length;u++)o=K.readability(e,n[u]),o>a&&(a=o,i=K(n[u]));return K.isReadable(e,i,{level:c,size:l})||!s?i:(r.includeFallbackColors=!1,K.mostReadable(e,[`#fff`,`#000`],r))};var gn=K.names={aliceblue:`f0f8ff`,antiquewhite:`faebd7`,aqua:`0ff`,aquamarine:`7fffd4`,azure:`f0ffff`,beige:`f5f5dc`,bisque:`ffe4c4`,black:`000`,blanchedalmond:`ffebcd`,blue:`00f`,blueviolet:`8a2be2`,brown:`a52a2a`,burlywood:`deb887`,burntsienna:`ea7e5d`,cadetblue:`5f9ea0`,chartreuse:`7fff00`,chocolate:`d2691e`,coral:`ff7f50`,cornflowerblue:`6495ed`,cornsilk:`fff8dc`,crimson:`dc143c`,cyan:`0ff`,darkblue:`00008b`,darkcyan:`008b8b`,darkgoldenrod:`b8860b`,darkgray:`a9a9a9`,darkgreen:`006400`,darkgrey:`a9a9a9`,darkkhaki:`bdb76b`,darkmagenta:`8b008b`,darkolivegreen:`556b2f`,darkorange:`ff8c00`,darkorchid:`9932cc`,darkred:`8b0000`,darksalmon:`e9967a`,darkseagreen:`8fbc8f`,darkslateblue:`483d8b`,darkslategray:`2f4f4f`,darkslategrey:`2f4f4f`,darkturquoise:`00ced1`,darkviolet:`9400d3`,deeppink:`ff1493`,deepskyblue:`00bfff`,dimgray:`696969`,dimgrey:`696969`,dodgerblue:`1e90ff`,firebrick:`b22222`,floralwhite:`fffaf0`,forestgreen:`228b22`,fuchsia:`f0f`,gainsboro:`dcdcdc`,ghostwhite:`f8f8ff`,gold:`ffd700`,goldenrod:`daa520`,gray:`808080`,green:`008000`,greenyellow:`adff2f`,grey:`808080`,honeydew:`f0fff0`,hotpink:`ff69b4`,indianred:`cd5c5c`,indigo:`4b0082`,ivory:`fffff0`,khaki:`f0e68c`,lavender:`e6e6fa`,lavenderblush:`fff0f5`,lawngreen:`7cfc00`,lemonchiffon:`fffacd`,lightblue:`add8e6`,lightcoral:`f08080`,lightcyan:`e0ffff`,lightgoldenrodyellow:`fafad2`,lightgray:`d3d3d3`,lightgreen:`90ee90`,lightgrey:`d3d3d3`,lightpink:`ffb6c1`,lightsalmon:`ffa07a`,lightseagreen:`20b2aa`,lightskyblue:`87cefa`,lightslategray:`789`,lightslategrey:`789`,lightsteelblue:`b0c4de`,lightyellow:`ffffe0`,lime:`0f0`,limegreen:`32cd32`,linen:`faf0e6`,magenta:`f0f`,maroon:`800000`,mediumaquamarine:`66cdaa`,mediumblue:`0000cd`,mediumorchid:`ba55d3`,mediumpurple:`9370db`,mediumseagreen:`3cb371`,mediumslateblue:`7b68ee`,mediumspringgreen:`00fa9a`,mediumturquoise:`48d1cc`,mediumvioletred:`c71585`,midnightblue:`191970`,mintcream:`f5fffa`,mistyrose:`ffe4e1`,moccasin:`ffe4b5`,navajowhite:`ffdead`,navy:`000080`,oldlace:`fdf5e6`,olive:`808000`,olivedrab:`6b8e23`,orange:`ffa500`,orangered:`ff4500`,orchid:`da70d6`,palegoldenrod:`eee8aa`,palegreen:`98fb98`,paleturquoise:`afeeee`,palevioletred:`db7093`,papayawhip:`ffefd5`,peachpuff:`ffdab9`,peru:`cd853f`,pink:`ffc0cb`,plum:`dda0dd`,powderblue:`b0e0e6`,purple:`800080`,rebeccapurple:`663399`,red:`f00`,rosybrown:`bc8f8f`,royalblue:`4169e1`,saddlebrown:`8b4513`,salmon:`fa8072`,sandybrown:`f4a460`,seagreen:`2e8b57`,seashell:`fff5ee`,sienna:`a0522d`,silver:`c0c0c0`,skyblue:`87ceeb`,slateblue:`6a5acd`,slategray:`708090`,slategrey:`708090`,snow:`fffafa`,springgreen:`00ff7f`,steelblue:`4682b4`,tan:`d2b48c`,teal:`008080`,thistle:`d8bfd8`,tomato:`ff6347`,turquoise:`40e0d0`,violet:`ee82ee`,wheat:`f5deb3`,white:`fff`,whitesmoke:`f5f5f5`,yellow:`ff0`,yellowgreen:`9acd32`},_n=K.hexNames=vn(gn);function vn(e){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[e[r]]=r);return n}function yn(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function q(e,n){Sn(e)&&(e=`100%`);var r=Cn(e);return e=Math.min(n,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*n,10)/100),Math.abs(e-n)<1e-6?1:e%n/parseFloat(n)}function bn(e){return Math.min(1,Math.max(0,e))}function xn(e){return parseInt(e,16)}function Sn(e){return typeof e==`string`&&e.indexOf(`.`)!=-1&&parseFloat(e)===1}function Cn(e){return typeof e==`string`&&e.indexOf(`%`)!=-1}function wn(e){return e.length==1?`0`+e:``+e}function Tn(e){return e<=1&&(e=e*100+`%`),e}function En(e){return Math.round(parseFloat(e)*255).toString(16)}function Dn(e){return xn(e)/255}var On=function(){var e=`(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)`,n=`[\\s|\\(]+(`+e+`)[,|\\s]+(`+e+`)[,|\\s]+(`+e+`)\\s*\\)?`,r=`[\\s|\\(]+(`+e+`)[,|\\s]+(`+e+`)[,|\\s]+(`+e+`)[,|\\s]+(`+e+`)\\s*\\)?`;return{CSS_UNIT:new RegExp(e),rgb:RegExp(`rgb`+n),rgba:RegExp(`rgba`+r),hsl:RegExp(`hsl`+n),hsla:RegExp(`hsla`+r),hsv:RegExp(`hsv`+n),hsva:RegExp(`hsva`+r),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function kn(e){return!!On.CSS_UNIT.exec(e)}function An(e){e=e.replace(Kt,``).replace(qt,``).toLowerCase();var n=!1;if(gn[e])e=gn[e],n=!0;else if(e==`transparent`)return{r:0,g:0,b:0,a:0,format:`name`};var r;return(r=On.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=On.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=On.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=On.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=On.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=On.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=On.hex8.exec(e))?{r:xn(r[1]),g:xn(r[2]),b:xn(r[3]),a:Dn(r[4]),format:n?`name`:`hex8`}:(r=On.hex6.exec(e))?{r:xn(r[1]),g:xn(r[2]),b:xn(r[3]),format:n?`name`:`hex`}:(r=On.hex4.exec(e))?{r:xn(r[1]+``+r[1]),g:xn(r[2]+``+r[2]),b:xn(r[3]+``+r[3]),a:Dn(r[4]+``+r[4]),format:n?`name`:`hex8`}:(r=On.hex3.exec(e))?{r:xn(r[1]+``+r[1]),g:xn(r[2]+``+r[2]),b:xn(r[3]+``+r[3]),format:n?`name`:`hex`}:!1}function jn(e){var n,r;return e||={level:`AA`,size:`small`},n=(e.level||`AA`).toUpperCase(),r=(e.size||`small`).toLowerCase(),n!==`AA`&&n!==`AAA`&&(n=`AA`),r!==`small`&&r!==`large`&&(r=`small`),{level:n,size:r}}function Mn(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function Nn(e){if(Array.isArray(e))return Mn(e)}function Pn(e,n,r){if(typeof e==`function`?e===n:e.has(n))return arguments.length<3?n:r;throw TypeError(`Private element is not present on this object`)}function Fn(e,n){if(n.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function In(e,n){if(!(e instanceof n))throw TypeError(`Cannot call a class as a function`)}function Ln(e,n){return e.get(Pn(e,n))}function Rn(e,n,r){Fn(e,n),n.set(e,r)}function zn(e,n,r){return e.set(Pn(e,n),r),r}function Bn(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,`value`in i&&(i.writable=!0),Object.defineProperty(e,Kn(i.key),i)}}function Vn(e,n,r){return n&&Bn(e.prototype,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function Hn(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Un(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{vn as n}from"./DocumentContext-CXfBU9-L.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./utils-CPqDy6Hr.js";import{t as c}from"./button-RQ5o7P7w.js";import{a as l,c as ee,i as u,n as d,o as f,s as p,t as m}from"./dialog-FGMqkFjm.js";import{t as h}from"./label-G0lbYOgL.js";import{a as g,i as _,n as v,o as y,r as b,s as x,t as te}from"./select-BUOcREjn.js";import{n as S,t as ne}from"./radio-group-MAC3jHHk.js";import{i as C,n as w,r as T,t as re}from"./tabs-BKX_R3ed.js";import{t as E}from"./createLucideIcon-DihYAFEK.js";import{t as ie}from"./git-branch-le6ClqcQ.js";import{t as ae}from"./folder-DcWlgZbb.js";import{t as oe}from"./loader-circle-DJ1nzSAL.js";import{n as se,r as D,t as O}from"./use-skill-directory-BBfJIjk2.js";import{n as k}from"./dist-uN7pEWl0.js";import{t as A}from"./input-Cm94Cun3.js";import{t as j}from"./dist-CzC3AWOn.js";import{d as ce,t as le}from"./skill-scope-CmujX5gW.js";import{E as ue,k as de,r as fe,u as M}from"./skills-api-BeHeMfn9.js";import{t as N}from"./skeleton-CD1oYYfF.js";import{n as pe,r as P,t as me}from"./input-group-DY7bardr.js";var F=E(`file-archive`,[[`path`,{d:`M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]),he=o(),I=e(r(),1),L=t(),ge=[`s1`,`s2`,`s3`,`s4`,`s5`,`s6`,`s7`,`s8`],_e=[{label:{id:`f8fH8W`},query:`design`},{label:{id:`-ySLQJ`},query:`git`},{label:{id:`qIJIrD`},query:`test`},{label:{id:`8Uv5e6`},query:`agent`},{label:{id:`UDb2YD`},query:`react`},{label:{id:`TbjyhA`},query:`docs`},{label:{id:`9wQrUU`},query:`refactor`},{label:{id:`HKH-W-`},query:`data`},{label:{id:`43qzxu`},query:`devops`},{label:{id:`a3LDKx`},query:`security`}];function R(e){let t=(0,he.c)(57),{scope:r,onNavigate:o}=e,{_:s}=a(),l;t[0]!==o||t[1]!==r?(l={scope:r,onNavigate:o},t[0]=o,t[1]=r,t[2]=l):l=t[2];let{importedEntry:ee,openResult:u}=O(l),[d,f]=(0,I.useState)(``),p;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=[],t[3]=p):p=t[3];let[m,h]=(0,I.useState)(p),[S,ne]=(0,I.useState)(!1),[C,w]=(0,I.useState)(`idle`),[T,re]=(0,I.useState)(`relevance`),{skills:E}=se(),ie,ae;t[4]===d?(ie=t[5],ae=t[6]):(ie=()=>{let e=d.trim();if(e.length<2){h([]),w(`idle`);return}let t=!1;w(`searching`);let n=setTimeout(()=>{ue(e).then(e=>{if(!t){if(!e.ok){w(`error`),h([]),ne(!1);return}h(e.results),ne(e.degraded),w(`idle`)}})},300);return()=>{t=!0,clearTimeout(n)}},ae=[d],t[4]=d,t[5]=ie,t[6]=ae),(0,I.useEffect)(ie,ae);let oe;t[7]===d?oe=t[8]:(oe=d.trim(),t[7]=d,t[8]=oe);let k=oe,A;t[9]!==m||t[10]!==T?(A=T===`installs`?[...m].sort(ye):m,t[9]=m,t[10]=T,t[11]=A):A=t[11];let j=A,ce;t[12]!==ee||t[13]!==u?(ce=e=>(0,L.jsx)(D,{result:e,imported:ee(e),onOpen:()=>u(e)},e.id),t[12]=ee,t[13]=u,t[14]=ce):ce=t[14];let le=ce,de;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,L.jsx)(pe,{align:`inline-start`,children:(0,L.jsx)(n,{"aria-hidden":`true`})}),t[15]=de):de=t[15];let fe;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(fe=e=>f(e.target.value),t[16]=fe):fe=t[16];let M;t[17]===s?M=t[18]:(M=s({id:`BlLxpG`}),t[17]=s,t[18]=M);let N;t[19]===s?N=t[20]:(N=s({id:`BlLxpG`}),t[19]=s,t[20]=N);let F;t[21]!==d||t[22]!==M||t[23]!==N?(F=(0,L.jsxs)(me,{className:`h-9 flex-1`,children:[de,(0,L.jsx)(P,{value:d,onChange:fe,placeholder:M,"aria-label":N})]}),t[21]=d,t[22]=M,t[23]=N,t[24]=F):F=t[24];let R;t[25]!==s||t[26]!==k.length||t[27]!==m||t[28]!==T||t[29]!==C?(R=k.length>=2&&C===`idle`&&m.length>0?(0,L.jsxs)(te,{value:T,onValueChange:e=>re(e),children:[(0,L.jsx)(y,{className:`h-9! w-40 shrink-0`,"aria-label":s({id:`eUFXS1`}),children:(0,L.jsx)(x,{})}),(0,L.jsx)(v,{children:(0,L.jsxs)(b,{children:[(0,L.jsx)(g,{children:s({id:`_HgF9q`})}),(0,L.jsx)(_,{value:`relevance`,children:s({id:`7dZnmw`})}),(0,L.jsx)(_,{value:`installs`,children:s({id:`tc65fD`})})]})})]}):null,t[25]=s,t[26]=k.length,t[27]=m,t[28]=T,t[29]=C,t[30]=R):R=t[30];let z;t[31]!==F||t[32]!==R?(z=(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[F,R]}),t[31]=F,t[32]=R,t[33]=z):z=t[33];let B;t[34]!==s||t[35]!==d?(B=_e.map(e=>{let t=d.trim().split(/\s+/).filter(Boolean),n=t.includes(e.query);return(0,L.jsx)(c,{variant:n?`secondary`:`outline`,size:`sm`,"aria-pressed":n,className:`h-6 shrink-0 rounded-full data-[active=true]:border-foreground/30`,"data-active":n,onClick:()=>f((n?t.filter(t=>t!==e.query):[...t,e.query]).join(` `)),children:s(e.label)},e.query)}),t[34]=s,t[35]=d,t[36]=B):B=t[36];let V;t[37]===B?V=t[38]:(V=(0,L.jsx)(`div`,{className:`flex shrink-0 gap-2 overflow-x-auto scroll-fade-mask-x [scrollbar-width:none]`,children:B}),t[37]=B,t[38]=V);let H;t[39]!==S||t[40]!==k.length?(H=S&&k.length>=2?(0,L.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:(0,L.jsx)(i,{id:`MBKkUy`})}):null,t[39]=S,t[40]=k.length,t[41]=H):H=t[41];let U;t[42]!==E||t[43]!==k.length||t[44]!==le||t[45]!==m||t[46]!==j||t[47]!==C?(U=k.length<2?E.length>0?(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(`h3`,{className:`font-mono text-2xs uppercase tracking-wider text-muted-foreground`,children:(0,L.jsx)(i,{id:`gL_sdV`})}),(0,L.jsx)(`ul`,{className:`grid grid-cols-1 gap-2.5 sm:grid-cols-2`,children:E.map(le)})]}):null:C===`searching`?(0,L.jsxs)(`div`,{"aria-busy":`true`,children:[(0,L.jsx)(`span`,{className:`sr-only`,children:(0,L.jsx)(i,{id:`WRNXKp`})}),(0,L.jsx)(`ul`,{className:`grid grid-cols-1 gap-2.5 sm:grid-cols-2`,"aria-hidden":!0,children:ge.map(ve)})]}):C===`error`?(0,L.jsx)(`p`,{className:`text-sm text-destructive`,children:(0,L.jsx)(i,{id:`yg_6wQ`})}):m.length===0?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,L.jsx)(i,{id:`8t9T3-`})}):(0,L.jsx)(`ul`,{className:`grid grid-cols-1 gap-2.5 sm:grid-cols-2`,children:j.map(le)}),t[42]=E,t[43]=k.length,t[44]=le,t[45]=m,t[46]=j,t[47]=C,t[48]=U):U=t[48];let W;t[49]===U?W=t[50]:(W=(0,L.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto subtle-scrollbar scroll-fade-mask`,children:U}),t[49]=U,t[50]=W);let G;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,L.jsx)(`p`,{className:`-mb-3.5 shrink-0 text-center text-[11px] text-muted-foreground/80`,children:(0,L.jsx)(i,{id:`fg1U4e`,components:{0:(0,L.jsx)(`a`,{href:`https://skills.sh`,target:`_blank`,rel:`noreferrer`,className:`underline hover:text-foreground`})}})}),t[51]=G):G=t[51];let K;return t[52]!==z||t[53]!==V||t[54]!==H||t[55]!==W?(K=(0,L.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-3`,children:[z,V,H,W,G]}),t[52]=z,t[53]=V,t[54]=H,t[55]=W,t[56]=K):K=t[56],K}function ve(e){return(0,L.jsx)(N,{className:`h-[72px] rounded-xl`},e)}function ye(e,t){return(t.installs??-1)-(e.installs??-1)}function z(e,t){t.alreadyImported?k.success(e===`upload`?j._({id:`tA2-xC`,values:{0:t.name}}):j._({id:`8AjnFz`,values:{0:t.name}})):t.collisionRenamedFrom?k.success(e===`upload`?j._({id:`EPGePE`,values:{0:t.name,1:t.collisionRenamedFrom}}):j._({id:`C0Ciaj`,values:{0:t.name,1:t.collisionRenamedFrom}})):k.success(e===`upload`?j._({id:`Pg83C9`,values:{0:t.name}}):j._({id:`qFKsNl`,values:{0:t.name}}));for(let e of t.warnings??[])k.warning(e)}var B=`flex items-start justify-between gap-3 rounded-md border p-3 text-sm font-normal transition-colors cursor-pointer`;function V(e){let t=(0,he.c)(122),{defaultScope:n,onOpenChange:r,onImported:o}=e,{_:l}=a(),ee=(0,I.useId)(),u=(0,I.useId)(),p=(0,I.useId)(),m=(0,I.useId)(),g=(0,I.useId)(),b=ce(),[C,w]=(0,I.useState)(n),[T,re]=(0,I.useState)(`remote`),[E,se]=(0,I.useState)(``),[D,O]=(0,I.useState)(``),[j,ue]=(0,I.useState)(null),[N,pe]=(0,I.useState)(!1),[P,me]=(0,I.useState)(null),[ge,_e]=(0,I.useState)(!1),[R,ve]=(0,I.useState)(!1),ye=(0,I.useRef)(null),V,G;t[0]===T?(V=t[1],G=t[2]):(V=()=>{let e=ye.current;e&&(T===`folder`?(e.setAttribute(`webkitdirectory`,``),e.setAttribute(`directory`,``)):(e.removeAttribute(`webkitdirectory`),e.removeAttribute(`directory`)))},G=[T],t[0]=T,t[1]=V,t[2]=G),(0,I.useEffect)(V,G);let K;t[3]===E?K=t[4]:(K=E.trim(),t[3]=E,t[4]=K);let q=K,J=T===`zip`||T===`folder`,be=j?.[0]?.webkitRelativePath?.split(`/`)[0]??``,xe,Se;t[5]!==J||t[6]!==q?(xe=()=>{if(J||q===``){me(null),_e(!1),ve(!1),O(``);return}let e=!1,t=new AbortController;_e(!0),ve(!1);let n=setTimeout(()=>{fe(q,t.signal).then(t=>{if(!e){if(_e(!1),!t.ok){me(null),O(``),ve(!0);return}ve(!1),me(t.skills),O(t.skills.length>1?t.skills[0].name:``)}})},500);return()=>{e=!0,t.abort(),clearTimeout(n)}},Se=[q,J],t[5]=J,t[6]=q,t[7]=xe,t[8]=Se):(xe=t[7],Se=t[8]),(0,I.useEffect)(xe,Se);let Ce=!N&&(J?j!==null&&j.length>0:q!==``),we;t[9]!==l||t[10]!==Ce||t[11]!==j||t[12]!==J||t[13]!==o||t[14]!==r||t[15]!==C||t[16]!==D||t[17]!==T||t[18]!==q?(we=async function(){if(!Ce)return;if(pe(!0),J&&j!==null){let e=new FormData;if(T===`zip`)e.append(`file`,j[0]);else for(let t of Array.from(j))e.append(`files`,t,t.webkitRelativePath||t.name);let t=await de(e,C);if(pe(!1),!t.ok){k.error(l({id:`Z8nach`,values:{0:t.error}}));return}z(`upload`,t),o({scope:C,name:t.name}),r(!1);return}let e=await M({source:q,...D.trim()===``?{}:{skill:D.trim()},scope:C});if(pe(!1),!e.ok){if(e.skills&&e.skills.length>1){me(e.skills.map(W)),O(e.skills[0]),k.info(l({id:`iYUTsI`}));return}k.error(l({id:`kfL8BJ`,values:{0:e.error}}));return}z(`import`,e),o({scope:C,name:e.name}),r(!1)},t[9]=l,t[10]=Ce,t[11]=j,t[12]=J,t[13]=o,t[14]=r,t[15]=C,t[16]=D,t[17]=T,t[18]=q,t[19]=we):we=t[19];let Te=we,Ee=d,De;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(De=(0,L.jsx)(i,{id:`aBgwis`}),t[20]=De):De=t[20];let Y;t[21]===m?Y=t[22]:(Y=(0,L.jsx)(h,{htmlFor:m,children:De}),t[21]=m,t[22]=Y);let Oe;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=e=>w(e),t[23]=Oe):Oe=t[23];let ke;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,L.jsx)(x,{}),t[24]=ke):ke=t[24];let X;t[25]===m?X=t[26]:(X=(0,L.jsx)(y,{id:m,className:`w-full`,children:ke}),t[25]=m,t[26]=X);let Z;t[27]===b?Z=t[28]:(Z=le.map(e=>(0,L.jsx)(_,{value:e,children:b[e]},e)),t[27]=b,t[28]=Z);let Ae;t[29]===Z?Ae=t[30]:(Ae=(0,L.jsx)(v,{children:Z}),t[29]=Z,t[30]=Ae);let je;t[31]!==C||t[32]!==X||t[33]!==Ae?(je=(0,L.jsxs)(te,{value:C,onValueChange:Oe,children:[X,Ae]}),t[31]=C,t[32]=X,t[33]=Ae,t[34]=je):je=t[34];let Me;t[35]!==je||t[36]!==Y?(Me=(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[Y,je]}),t[35]=je,t[36]=Y,t[37]=Me):Me=t[37];let Ne;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,L.jsx)(i,{id:`wdxz7K`}),t[38]=Ne):Ne=t[38];let Pe;t[39]===u?Pe=t[40]:(Pe=(0,L.jsx)(h,{id:u,children:Ne}),t[39]=u,t[40]=Pe);let Fe;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=e=>{re(e),ue(null)},t[41]=Fe):Fe=t[41];let Ie=`${u}-remote`,Le=T===`remote`?`border-primary bg-primary/5`:`border-border hover:bg-muted/40`,Re;t[42]===Le?Re=t[43]:(Re=s(B,Le),t[42]=Le,t[43]=Re);let ze;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,L.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,L.jsx)(ie,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,L.jsx)(i,{id:`qlAIQ1`})]}),t[44]=ze):ze=t[44];let Be;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(Be=(0,L.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[ze,(0,L.jsx)(`span`,{className:`text-1sm text-muted-foreground`,children:(0,L.jsx)(i,{id:`9m4D_h`})})]}),t[45]=Be):Be=t[45];let Ve=`${u}-remote`,He;t[46]===Ve?He=t[47]:(He=(0,L.jsx)(S,{id:Ve,value:`remote`,className:`mt-0.5`}),t[46]=Ve,t[47]=He);let Ue;t[48]!==Ie||t[49]!==Re||t[50]!==He?(Ue=(0,L.jsxs)(h,{htmlFor:Ie,className:Re,children:[Be,He]}),t[48]=Ie,t[49]=Re,t[50]=He,t[51]=Ue):Ue=t[51];let We=`${u}-zip`,Ge=T===`zip`?`border-primary bg-primary/5`:`border-border hover:bg-muted/40`,Ke;t[52]===Ge?Ke=t[53]:(Ke=s(B,Ge),t[52]=Ge,t[53]=Ke);let qe;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(qe=(0,L.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,L.jsx)(F,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,L.jsx)(i,{id:`Fr8JGg`})]}),t[54]=qe):qe=t[54];let Je;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(Je=(0,L.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[qe,(0,L.jsx)(`span`,{className:`text-1sm text-muted-foreground`,children:(0,L.jsx)(i,{id:`hQjvzi`})})]}),t[55]=Je):Je=t[55];let Ye=`${u}-zip`,Xe;t[56]===Ye?Xe=t[57]:(Xe=(0,L.jsx)(S,{id:Ye,value:`zip`,className:`mt-0.5`}),t[56]=Ye,t[57]=Xe);let Ze;t[58]!==We||t[59]!==Ke||t[60]!==Xe?(Ze=(0,L.jsxs)(h,{htmlFor:We,className:Ke,children:[Je,Xe]}),t[58]=We,t[59]=Ke,t[60]=Xe,t[61]=Ze):Ze=t[61];let Qe=`${u}-folder`,$e=T===`folder`?`border-primary bg-primary/5`:`border-border hover:bg-muted/40`,et;t[62]===$e?et=t[63]:(et=s(B,$e),t[62]=$e,t[63]=et);let tt;t[64]===Symbol.for(`react.memo_cache_sentinel`)?(tt=(0,L.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,L.jsx)(ae,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,L.jsx)(i,{id:`kNqMMd`})]}),t[64]=tt):tt=t[64];let nt;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(nt=(0,L.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[tt,(0,L.jsx)(`span`,{className:`text-1sm text-muted-foreground`,children:(0,L.jsx)(i,{id:`UPWItY`})})]}),t[65]=nt):nt=t[65];let rt=`${u}-folder`,it;t[66]===rt?it=t[67]:(it=(0,L.jsx)(S,{id:rt,value:`folder`,className:`mt-0.5`}),t[66]=rt,t[67]=it);let at;t[68]!==Qe||t[69]!==et||t[70]!==it?(at=(0,L.jsxs)(h,{htmlFor:Qe,className:et,children:[nt,it]}),t[68]=Qe,t[69]=et,t[70]=it,t[71]=at):at=t[71];let ot;t[72]!==T||t[73]!==u||t[74]!==Ue||t[75]!==Ze||t[76]!==at?(ot=(0,L.jsxs)(ne,{value:T,onValueChange:Fe,"aria-labelledby":u,className:`grid-cols-1 gap-2 sm:grid-cols-3 mb-2`,children:[Ue,Ze,at]}),t[72]=T,t[73]=u,t[74]=Ue,t[75]=Ze,t[76]=at,t[77]=ot):ot=t[77];let st=J?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(A,{ref:ye,id:g,"aria-label":l(T===`zip`?{id:`wErce0`}:{id:`VJaBca`}),type:`file`,"data-testid":`skill-upload-input`,accept:T===`zip`?`.zip,.skill`:void 0,onChange:e=>ue(e.target.files),className:`sr-only`},T),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>ye.current?.click(),children:T===`zip`?(0,L.jsx)(i,{id:`-yPBXI`}):(0,L.jsx)(i,{id:`TgZOXj`})}),(0,L.jsx)(`span`,{className:`truncate text-sm text-muted-foreground`,"data-testid":`skill-upload-filename`,children:j&&j.length>0?T===`folder`?j.length===1?l({id:`BGtzlf`,values:{uploadFolderName:be}}):l({id:`K7NMEc`,values:{0:j.length,uploadFolderName:be}}):j[0].name:(0,L.jsx)(i,{id:`hqCwRf`})})]})]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(A,{id:ee,"aria-label":l({id:`cLP0Lf`}),"data-testid":`skill-import-source-input`,value:E,onChange:e=>se(e.target.value),onKeyDown:e=>{e.key===`Enter`&&Te()},placeholder:l({id:`gv5w9J`}),className:`font-mono`}),ge||R||P&&P.length===1?(0,L.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:ge?(0,L.jsx)(i,{id:`K4G55s`}):R?(0,L.jsx)(i,{id:`XgqUOy`}):P&&P.length===1?(0,L.jsx)(i,{id:`WpE38V`,values:{0:P[0].name}}):null}):null]}),ct;t[78]!==Pe||t[79]!==ot||t[80]!==st?(ct=(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[Pe,ot,st]}),t[78]=Pe,t[79]=ot,t[80]=st,t[81]=ct):ct=t[81];let lt;t[82]!==P||t[83]!==J||t[84]!==D||t[85]!==p?(lt=!J&&P&&P.length>1?(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(h,{htmlFor:p,children:(0,L.jsx)(i,{id:`FCMaBz`})}),(0,L.jsxs)(te,{value:D,onValueChange:O,children:[(0,L.jsx)(y,{id:p,size:`sm`,className:`w-full`,"data-testid":`skill-import-pick`,children:(0,L.jsx)(x,{})}),(0,L.jsx)(v,{children:P.map(U)})]}),(0,L.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,L.jsx)(i,{id:`xtJgSe`})})]}):null,t[82]=P,t[83]=J,t[84]=D,t[85]=p,t[86]=lt):lt=t[86];let ut;t[87]===Symbol.for(`react.memo_cache_sentinel`)?(ut=(0,L.jsx)(`p`,{className:`font-medium text-xs font-mono text-muted-foreground/80 uppercase tracking-wider`,children:(0,L.jsx)(i,{id:`DWJtEo`})}),t[87]=ut):ut=t[87];let dt;t[88]===C?dt=t[89]:(dt=(0,L.jsx)(`li`,{children:C===`project`?(0,L.jsx)(i,{id:`rucNcu`,components:{0:(0,L.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-[0.9em] text-foreground/80`})}}):(0,L.jsx)(i,{id:`vjW-SM`,components:{0:(0,L.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-[0.9em] text-foreground/80`})}})}),t[88]=C,t[89]=dt);let ft,pt;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(ft=(0,L.jsx)(`li`,{children:(0,L.jsx)(i,{id:`tqQBwN`})}),pt=(0,L.jsx)(`li`,{children:(0,L.jsx)(i,{id:`QB-moX`})}),t[90]=ft,t[91]=pt):(ft=t[90],pt=t[91]);let Q;t[92]===dt?Q=t[93]:(Q=(0,L.jsxs)(`div`,{role:`note`,className:`space-y-3`,"data-testid":`skill-import-disclosure`,children:[ut,(0,L.jsxs)(`ul`,{className:`list-disc space-y-2.5 pl-4 text-sm text-muted-foreground marker:text-muted-foreground/50`,children:[dt,ft,pt]})]}),t[92]=dt,t[93]=Q);let mt;t[94]!==Ee||t[95]!==Me||t[96]!==ct||t[97]!==lt||t[98]!==Q?(mt=(0,L.jsxs)(Ee,{className:`flex flex-col gap-6`,children:[Me,ct,lt,Q]}),t[94]=Ee,t[95]=Me,t[96]=ct,t[97]=lt,t[98]=Q,t[99]=mt):mt=t[99];let ht;t[100]===r?ht=t[101]:(ht=()=>r(!1),t[100]=r,t[101]=ht);let gt;t[102]===Symbol.for(`react.memo_cache_sentinel`)?(gt=(0,L.jsx)(i,{id:`dEgA5A`}),t[102]=gt):gt=t[102];let _t;t[103]!==N||t[104]!==ht?(_t=(0,L.jsx)(c,{variant:`outline`,className:`font-mono uppercase`,onMouseDown:H,onClick:ht,disabled:N,children:gt}),t[103]=N,t[104]=ht,t[105]=_t):_t=t[105];let vt=J?`skill-upload-button`:`skill-import-button`,yt;t[106]===Te?yt=t[107]:(yt=()=>void Te(),t[106]=Te,t[107]=yt);let bt=!Ce,xt;t[108]!==N||t[109]!==J?(xt=N?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(oe,{className:`size-4 animate-spin`}),J?(0,L.jsx)(i,{id:`_eguJc`}):(0,L.jsx)(i,{id:`RqSvT0`})]}):J?(0,L.jsx)(i,{id:`ONWvwQ`}):(0,L.jsx)(i,{id:`l3s5ri`}),t[108]=N,t[109]=J,t[110]=xt):xt=t[110];let St;t[111]!==vt||t[112]!==yt||t[113]!==bt||t[114]!==xt?(St=(0,L.jsx)(c,{"data-testid":vt,onClick:yt,disabled:bt,children:xt}),t[111]=vt,t[112]=yt,t[113]=bt,t[114]=xt,t[115]=St):St=t[115];let $;t[116]!==_t||t[117]!==St?($=(0,L.jsxs)(f,{children:[_t,St]}),t[116]=_t,t[117]=St,t[118]=$):$=t[118];let Ct;return t[119]!==mt||t[120]!==$?(Ct=(0,L.jsxs)(L.Fragment,{children:[mt,$]}),t[119]=mt,t[120]=$,t[121]=Ct):Ct=t[121],Ct}function H(e){return e.preventDefault()}function U(e){return(0,L.jsx)(_,{value:e.name,children:e.name},e.name)}function W(e){return{name:e,description:null}}function G(e){let t=(0,he.c)(21),{defaultScope:n,open:r,onOpenChange:a,defaultTab:o,onImported:s}=e,c=o===void 0?`skills-sh`:o,d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,L.jsx)(ee,{children:(0,L.jsx)(i,{id:`GBQjiV`})}),t[0]=d):d=t[0];let f;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,L.jsxs)(p,{children:[d,(0,L.jsx)(l,{className:`sr-only`,children:(0,L.jsx)(i,{id:`qTcVwj`})})]}),t[1]=f):f=t[1];let h;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,L.jsx)(C,{variant:`line`,value:`skills-sh`,children:(0,L.jsx)(i,{id:`8tjQCz`})}),t[2]=h):h=t[2];let g;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,L.jsxs)(T,{variant:`line`,className:`w-full justify-start gap-4 border-b p-0`,children:[h,(0,L.jsx)(C,{variant:`line`,value:`upload`,children:(0,L.jsx)(i,{id:`ONWvwQ`})})]}),t[3]=g):g=t[3];let _;t[4]===a?_=t[5]:(_=()=>a(!1),t[4]=a,t[5]=_);let v;t[6]!==n||t[7]!==_?(v=(0,L.jsx)(w,{value:`skills-sh`,className:`h-[62vh] min-h-0 flex-none`,children:(0,L.jsx)(R,{scope:n,onNavigate:_})}),t[6]=n,t[7]=_,t[8]=v):v=t[8];let y;t[9]!==n||t[10]!==s||t[11]!==a?(y=(0,L.jsx)(w,{value:`upload`,className:`mt-3 flex min-h-0 flex-1 flex-col gap-6`,children:(0,L.jsx)(V,{defaultScope:n,onOpenChange:a,onImported:s})}),t[9]=n,t[10]=s,t[11]=a,t[12]=y):y=t[12];let b;t[13]!==c||t[14]!==v||t[15]!==y?(b=(0,L.jsxs)(u,{className:`flex max-h-[85vh] flex-col gap-4 sm:max-w-4xl`,children:[f,(0,L.jsxs)(re,{defaultValue:c,className:`flex min-h-0 flex-1 flex-col gap-3`,children:[g,v,y]})]}),t[13]=c,t[14]=v,t[15]=y,t[16]=b):b=t[16];let x;return t[17]!==a||t[18]!==r||t[19]!==b?(x=(0,L.jsx)(m,{open:r,onOpenChange:a,children:b}),t[17]=a,t[18]=r,t[19]=b,t[20]=x):x=t[20],x}export{G as ImportSkillDialog};
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{vn as n}from"./DocumentContext-CY-aaPA2.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./utils-CPqDy6Hr.js";import{t as c}from"./button-RQ5o7P7w.js";import{a as l,c as ee,i as u,n as d,o as f,s as p,t as m}from"./dialog-FGMqkFjm.js";import{t as h}from"./label-G0lbYOgL.js";import{a as g,i as _,n as v,o as y,r as b,s as x,t as te}from"./select-BUOcREjn.js";import{n as S,t as ne}from"./radio-group-MAC3jHHk.js";import{i as C,n as w,r as T,t as re}from"./tabs-BKX_R3ed.js";import{t as E}from"./createLucideIcon-DihYAFEK.js";import{t as ie}from"./git-branch-le6ClqcQ.js";import{t as ae}from"./folder-DcWlgZbb.js";import{t as oe}from"./loader-circle-DJ1nzSAL.js";import{n as se,r as D,t as O}from"./use-skill-directory-uITBGO9Q.js";import{n as k}from"./dist-uN7pEWl0.js";import{t as A}from"./input-Cm94Cun3.js";import{t as j}from"./dist-CzC3AWOn.js";import{d as ce,t as le}from"./skill-scope-CmujX5gW.js";import{E as ue,k as de,r as fe,u as M}from"./skills-api-BeHeMfn9.js";import{t as N}from"./skeleton-CD1oYYfF.js";import{n as pe,r as P,t as me}from"./input-group-DY7bardr.js";var F=E(`file-archive`,[[`path`,{d:`M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]),he=o(),I=e(r(),1),L=t(),ge=[`s1`,`s2`,`s3`,`s4`,`s5`,`s6`,`s7`,`s8`],_e=[{label:{id:`f8fH8W`},query:`design`},{label:{id:`-ySLQJ`},query:`git`},{label:{id:`qIJIrD`},query:`test`},{label:{id:`8Uv5e6`},query:`agent`},{label:{id:`UDb2YD`},query:`react`},{label:{id:`TbjyhA`},query:`docs`},{label:{id:`9wQrUU`},query:`refactor`},{label:{id:`HKH-W-`},query:`data`},{label:{id:`43qzxu`},query:`devops`},{label:{id:`a3LDKx`},query:`security`}];function R(e){let t=(0,he.c)(57),{scope:r,onNavigate:o}=e,{_:s}=a(),l;t[0]!==o||t[1]!==r?(l={scope:r,onNavigate:o},t[0]=o,t[1]=r,t[2]=l):l=t[2];let{importedEntry:ee,openResult:u}=O(l),[d,f]=(0,I.useState)(``),p;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=[],t[3]=p):p=t[3];let[m,h]=(0,I.useState)(p),[S,ne]=(0,I.useState)(!1),[C,w]=(0,I.useState)(`idle`),[T,re]=(0,I.useState)(`relevance`),{skills:E}=se(),ie,ae;t[4]===d?(ie=t[5],ae=t[6]):(ie=()=>{let e=d.trim();if(e.length<2){h([]),w(`idle`);return}let t=!1;w(`searching`);let n=setTimeout(()=>{ue(e).then(e=>{if(!t){if(!e.ok){w(`error`),h([]),ne(!1);return}h(e.results),ne(e.degraded),w(`idle`)}})},300);return()=>{t=!0,clearTimeout(n)}},ae=[d],t[4]=d,t[5]=ie,t[6]=ae),(0,I.useEffect)(ie,ae);let oe;t[7]===d?oe=t[8]:(oe=d.trim(),t[7]=d,t[8]=oe);let k=oe,A;t[9]!==m||t[10]!==T?(A=T===`installs`?[...m].sort(ye):m,t[9]=m,t[10]=T,t[11]=A):A=t[11];let j=A,ce;t[12]!==ee||t[13]!==u?(ce=e=>(0,L.jsx)(D,{result:e,imported:ee(e),onOpen:()=>u(e)},e.id),t[12]=ee,t[13]=u,t[14]=ce):ce=t[14];let le=ce,de;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,L.jsx)(pe,{align:`inline-start`,children:(0,L.jsx)(n,{"aria-hidden":`true`})}),t[15]=de):de=t[15];let fe;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(fe=e=>f(e.target.value),t[16]=fe):fe=t[16];let M;t[17]===s?M=t[18]:(M=s({id:`BlLxpG`}),t[17]=s,t[18]=M);let N;t[19]===s?N=t[20]:(N=s({id:`BlLxpG`}),t[19]=s,t[20]=N);let F;t[21]!==d||t[22]!==M||t[23]!==N?(F=(0,L.jsxs)(me,{className:`h-9 flex-1`,children:[de,(0,L.jsx)(P,{value:d,onChange:fe,placeholder:M,"aria-label":N})]}),t[21]=d,t[22]=M,t[23]=N,t[24]=F):F=t[24];let R;t[25]!==s||t[26]!==k.length||t[27]!==m||t[28]!==T||t[29]!==C?(R=k.length>=2&&C===`idle`&&m.length>0?(0,L.jsxs)(te,{value:T,onValueChange:e=>re(e),children:[(0,L.jsx)(y,{className:`h-9! w-40 shrink-0`,"aria-label":s({id:`eUFXS1`}),children:(0,L.jsx)(x,{})}),(0,L.jsx)(v,{children:(0,L.jsxs)(b,{children:[(0,L.jsx)(g,{children:s({id:`_HgF9q`})}),(0,L.jsx)(_,{value:`relevance`,children:s({id:`7dZnmw`})}),(0,L.jsx)(_,{value:`installs`,children:s({id:`tc65fD`})})]})})]}):null,t[25]=s,t[26]=k.length,t[27]=m,t[28]=T,t[29]=C,t[30]=R):R=t[30];let z;t[31]!==F||t[32]!==R?(z=(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[F,R]}),t[31]=F,t[32]=R,t[33]=z):z=t[33];let B;t[34]!==s||t[35]!==d?(B=_e.map(e=>{let t=d.trim().split(/\s+/).filter(Boolean),n=t.includes(e.query);return(0,L.jsx)(c,{variant:n?`secondary`:`outline`,size:`sm`,"aria-pressed":n,className:`h-6 shrink-0 rounded-full data-[active=true]:border-foreground/30`,"data-active":n,onClick:()=>f((n?t.filter(t=>t!==e.query):[...t,e.query]).join(` `)),children:s(e.label)},e.query)}),t[34]=s,t[35]=d,t[36]=B):B=t[36];let V;t[37]===B?V=t[38]:(V=(0,L.jsx)(`div`,{className:`flex shrink-0 gap-2 overflow-x-auto scroll-fade-mask-x [scrollbar-width:none]`,children:B}),t[37]=B,t[38]=V);let H;t[39]!==S||t[40]!==k.length?(H=S&&k.length>=2?(0,L.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:(0,L.jsx)(i,{id:`MBKkUy`})}):null,t[39]=S,t[40]=k.length,t[41]=H):H=t[41];let U;t[42]!==E||t[43]!==k.length||t[44]!==le||t[45]!==m||t[46]!==j||t[47]!==C?(U=k.length<2?E.length>0?(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(`h3`,{className:`font-mono text-2xs uppercase tracking-wider text-muted-foreground`,children:(0,L.jsx)(i,{id:`gL_sdV`})}),(0,L.jsx)(`ul`,{className:`grid grid-cols-1 gap-2.5 sm:grid-cols-2`,children:E.map(le)})]}):null:C===`searching`?(0,L.jsxs)(`div`,{"aria-busy":`true`,children:[(0,L.jsx)(`span`,{className:`sr-only`,children:(0,L.jsx)(i,{id:`WRNXKp`})}),(0,L.jsx)(`ul`,{className:`grid grid-cols-1 gap-2.5 sm:grid-cols-2`,"aria-hidden":!0,children:ge.map(ve)})]}):C===`error`?(0,L.jsx)(`p`,{className:`text-sm text-destructive`,children:(0,L.jsx)(i,{id:`yg_6wQ`})}):m.length===0?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,L.jsx)(i,{id:`8t9T3-`})}):(0,L.jsx)(`ul`,{className:`grid grid-cols-1 gap-2.5 sm:grid-cols-2`,children:j.map(le)}),t[42]=E,t[43]=k.length,t[44]=le,t[45]=m,t[46]=j,t[47]=C,t[48]=U):U=t[48];let W;t[49]===U?W=t[50]:(W=(0,L.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto subtle-scrollbar scroll-fade-mask`,children:U}),t[49]=U,t[50]=W);let G;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,L.jsx)(`p`,{className:`-mb-3.5 shrink-0 text-center text-[11px] text-muted-foreground/80`,children:(0,L.jsx)(i,{id:`fg1U4e`,components:{0:(0,L.jsx)(`a`,{href:`https://skills.sh`,target:`_blank`,rel:`noreferrer`,className:`underline hover:text-foreground`})}})}),t[51]=G):G=t[51];let K;return t[52]!==z||t[53]!==V||t[54]!==H||t[55]!==W?(K=(0,L.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-3`,children:[z,V,H,W,G]}),t[52]=z,t[53]=V,t[54]=H,t[55]=W,t[56]=K):K=t[56],K}function ve(e){return(0,L.jsx)(N,{className:`h-[72px] rounded-xl`},e)}function ye(e,t){return(t.installs??-1)-(e.installs??-1)}function z(e,t){t.alreadyImported?k.success(e===`upload`?j._({id:`tA2-xC`,values:{0:t.name}}):j._({id:`8AjnFz`,values:{0:t.name}})):t.collisionRenamedFrom?k.success(e===`upload`?j._({id:`EPGePE`,values:{0:t.name,1:t.collisionRenamedFrom}}):j._({id:`C0Ciaj`,values:{0:t.name,1:t.collisionRenamedFrom}})):k.success(e===`upload`?j._({id:`Pg83C9`,values:{0:t.name}}):j._({id:`qFKsNl`,values:{0:t.name}}));for(let e of t.warnings??[])k.warning(e)}var B=`flex items-start justify-between gap-3 rounded-md border p-3 text-sm font-normal transition-colors cursor-pointer`;function V(e){let t=(0,he.c)(122),{defaultScope:n,onOpenChange:r,onImported:o}=e,{_:l}=a(),ee=(0,I.useId)(),u=(0,I.useId)(),p=(0,I.useId)(),m=(0,I.useId)(),g=(0,I.useId)(),b=ce(),[C,w]=(0,I.useState)(n),[T,re]=(0,I.useState)(`remote`),[E,se]=(0,I.useState)(``),[D,O]=(0,I.useState)(``),[j,ue]=(0,I.useState)(null),[N,pe]=(0,I.useState)(!1),[P,me]=(0,I.useState)(null),[ge,_e]=(0,I.useState)(!1),[R,ve]=(0,I.useState)(!1),ye=(0,I.useRef)(null),V,G;t[0]===T?(V=t[1],G=t[2]):(V=()=>{let e=ye.current;e&&(T===`folder`?(e.setAttribute(`webkitdirectory`,``),e.setAttribute(`directory`,``)):(e.removeAttribute(`webkitdirectory`),e.removeAttribute(`directory`)))},G=[T],t[0]=T,t[1]=V,t[2]=G),(0,I.useEffect)(V,G);let K;t[3]===E?K=t[4]:(K=E.trim(),t[3]=E,t[4]=K);let q=K,J=T===`zip`||T===`folder`,be=j?.[0]?.webkitRelativePath?.split(`/`)[0]??``,xe,Se;t[5]!==J||t[6]!==q?(xe=()=>{if(J||q===``){me(null),_e(!1),ve(!1),O(``);return}let e=!1,t=new AbortController;_e(!0),ve(!1);let n=setTimeout(()=>{fe(q,t.signal).then(t=>{if(!e){if(_e(!1),!t.ok){me(null),O(``),ve(!0);return}ve(!1),me(t.skills),O(t.skills.length>1?t.skills[0].name:``)}})},500);return()=>{e=!0,t.abort(),clearTimeout(n)}},Se=[q,J],t[5]=J,t[6]=q,t[7]=xe,t[8]=Se):(xe=t[7],Se=t[8]),(0,I.useEffect)(xe,Se);let Ce=!N&&(J?j!==null&&j.length>0:q!==``),we;t[9]!==l||t[10]!==Ce||t[11]!==j||t[12]!==J||t[13]!==o||t[14]!==r||t[15]!==C||t[16]!==D||t[17]!==T||t[18]!==q?(we=async function(){if(!Ce)return;if(pe(!0),J&&j!==null){let e=new FormData;if(T===`zip`)e.append(`file`,j[0]);else for(let t of Array.from(j))e.append(`files`,t,t.webkitRelativePath||t.name);let t=await de(e,C);if(pe(!1),!t.ok){k.error(l({id:`Z8nach`,values:{0:t.error}}));return}z(`upload`,t),o({scope:C,name:t.name}),r(!1);return}let e=await M({source:q,...D.trim()===``?{}:{skill:D.trim()},scope:C});if(pe(!1),!e.ok){if(e.skills&&e.skills.length>1){me(e.skills.map(W)),O(e.skills[0]),k.info(l({id:`iYUTsI`}));return}k.error(l({id:`kfL8BJ`,values:{0:e.error}}));return}z(`import`,e),o({scope:C,name:e.name}),r(!1)},t[9]=l,t[10]=Ce,t[11]=j,t[12]=J,t[13]=o,t[14]=r,t[15]=C,t[16]=D,t[17]=T,t[18]=q,t[19]=we):we=t[19];let Te=we,Ee=d,De;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(De=(0,L.jsx)(i,{id:`aBgwis`}),t[20]=De):De=t[20];let Y;t[21]===m?Y=t[22]:(Y=(0,L.jsx)(h,{htmlFor:m,children:De}),t[21]=m,t[22]=Y);let Oe;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=e=>w(e),t[23]=Oe):Oe=t[23];let ke;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,L.jsx)(x,{}),t[24]=ke):ke=t[24];let X;t[25]===m?X=t[26]:(X=(0,L.jsx)(y,{id:m,className:`w-full`,children:ke}),t[25]=m,t[26]=X);let Z;t[27]===b?Z=t[28]:(Z=le.map(e=>(0,L.jsx)(_,{value:e,children:b[e]},e)),t[27]=b,t[28]=Z);let Ae;t[29]===Z?Ae=t[30]:(Ae=(0,L.jsx)(v,{children:Z}),t[29]=Z,t[30]=Ae);let je;t[31]!==C||t[32]!==X||t[33]!==Ae?(je=(0,L.jsxs)(te,{value:C,onValueChange:Oe,children:[X,Ae]}),t[31]=C,t[32]=X,t[33]=Ae,t[34]=je):je=t[34];let Me;t[35]!==je||t[36]!==Y?(Me=(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[Y,je]}),t[35]=je,t[36]=Y,t[37]=Me):Me=t[37];let Ne;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,L.jsx)(i,{id:`wdxz7K`}),t[38]=Ne):Ne=t[38];let Pe;t[39]===u?Pe=t[40]:(Pe=(0,L.jsx)(h,{id:u,children:Ne}),t[39]=u,t[40]=Pe);let Fe;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=e=>{re(e),ue(null)},t[41]=Fe):Fe=t[41];let Ie=`${u}-remote`,Le=T===`remote`?`border-primary bg-primary/5`:`border-border hover:bg-muted/40`,Re;t[42]===Le?Re=t[43]:(Re=s(B,Le),t[42]=Le,t[43]=Re);let ze;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,L.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,L.jsx)(ie,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,L.jsx)(i,{id:`qlAIQ1`})]}),t[44]=ze):ze=t[44];let Be;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(Be=(0,L.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[ze,(0,L.jsx)(`span`,{className:`text-1sm text-muted-foreground`,children:(0,L.jsx)(i,{id:`9m4D_h`})})]}),t[45]=Be):Be=t[45];let Ve=`${u}-remote`,He;t[46]===Ve?He=t[47]:(He=(0,L.jsx)(S,{id:Ve,value:`remote`,className:`mt-0.5`}),t[46]=Ve,t[47]=He);let Ue;t[48]!==Ie||t[49]!==Re||t[50]!==He?(Ue=(0,L.jsxs)(h,{htmlFor:Ie,className:Re,children:[Be,He]}),t[48]=Ie,t[49]=Re,t[50]=He,t[51]=Ue):Ue=t[51];let We=`${u}-zip`,Ge=T===`zip`?`border-primary bg-primary/5`:`border-border hover:bg-muted/40`,Ke;t[52]===Ge?Ke=t[53]:(Ke=s(B,Ge),t[52]=Ge,t[53]=Ke);let qe;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(qe=(0,L.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,L.jsx)(F,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,L.jsx)(i,{id:`Fr8JGg`})]}),t[54]=qe):qe=t[54];let Je;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(Je=(0,L.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[qe,(0,L.jsx)(`span`,{className:`text-1sm text-muted-foreground`,children:(0,L.jsx)(i,{id:`hQjvzi`})})]}),t[55]=Je):Je=t[55];let Ye=`${u}-zip`,Xe;t[56]===Ye?Xe=t[57]:(Xe=(0,L.jsx)(S,{id:Ye,value:`zip`,className:`mt-0.5`}),t[56]=Ye,t[57]=Xe);let Ze;t[58]!==We||t[59]!==Ke||t[60]!==Xe?(Ze=(0,L.jsxs)(h,{htmlFor:We,className:Ke,children:[Je,Xe]}),t[58]=We,t[59]=Ke,t[60]=Xe,t[61]=Ze):Ze=t[61];let Qe=`${u}-folder`,$e=T===`folder`?`border-primary bg-primary/5`:`border-border hover:bg-muted/40`,et;t[62]===$e?et=t[63]:(et=s(B,$e),t[62]=$e,t[63]=et);let tt;t[64]===Symbol.for(`react.memo_cache_sentinel`)?(tt=(0,L.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,L.jsx)(ae,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,L.jsx)(i,{id:`kNqMMd`})]}),t[64]=tt):tt=t[64];let nt;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(nt=(0,L.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[tt,(0,L.jsx)(`span`,{className:`text-1sm text-muted-foreground`,children:(0,L.jsx)(i,{id:`UPWItY`})})]}),t[65]=nt):nt=t[65];let rt=`${u}-folder`,it;t[66]===rt?it=t[67]:(it=(0,L.jsx)(S,{id:rt,value:`folder`,className:`mt-0.5`}),t[66]=rt,t[67]=it);let at;t[68]!==Qe||t[69]!==et||t[70]!==it?(at=(0,L.jsxs)(h,{htmlFor:Qe,className:et,children:[nt,it]}),t[68]=Qe,t[69]=et,t[70]=it,t[71]=at):at=t[71];let ot;t[72]!==T||t[73]!==u||t[74]!==Ue||t[75]!==Ze||t[76]!==at?(ot=(0,L.jsxs)(ne,{value:T,onValueChange:Fe,"aria-labelledby":u,className:`grid-cols-1 gap-2 sm:grid-cols-3 mb-2`,children:[Ue,Ze,at]}),t[72]=T,t[73]=u,t[74]=Ue,t[75]=Ze,t[76]=at,t[77]=ot):ot=t[77];let st=J?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(A,{ref:ye,id:g,"aria-label":l(T===`zip`?{id:`wErce0`}:{id:`VJaBca`}),type:`file`,"data-testid":`skill-upload-input`,accept:T===`zip`?`.zip,.skill`:void 0,onChange:e=>ue(e.target.files),className:`sr-only`},T),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>ye.current?.click(),children:T===`zip`?(0,L.jsx)(i,{id:`-yPBXI`}):(0,L.jsx)(i,{id:`TgZOXj`})}),(0,L.jsx)(`span`,{className:`truncate text-sm text-muted-foreground`,"data-testid":`skill-upload-filename`,children:j&&j.length>0?T===`folder`?j.length===1?l({id:`BGtzlf`,values:{uploadFolderName:be}}):l({id:`K7NMEc`,values:{0:j.length,uploadFolderName:be}}):j[0].name:(0,L.jsx)(i,{id:`hqCwRf`})})]})]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(A,{id:ee,"aria-label":l({id:`cLP0Lf`}),"data-testid":`skill-import-source-input`,value:E,onChange:e=>se(e.target.value),onKeyDown:e=>{e.key===`Enter`&&Te()},placeholder:l({id:`gv5w9J`}),className:`font-mono`}),ge||R||P&&P.length===1?(0,L.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:ge?(0,L.jsx)(i,{id:`K4G55s`}):R?(0,L.jsx)(i,{id:`XgqUOy`}):P&&P.length===1?(0,L.jsx)(i,{id:`WpE38V`,values:{0:P[0].name}}):null}):null]}),ct;t[78]!==Pe||t[79]!==ot||t[80]!==st?(ct=(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[Pe,ot,st]}),t[78]=Pe,t[79]=ot,t[80]=st,t[81]=ct):ct=t[81];let lt;t[82]!==P||t[83]!==J||t[84]!==D||t[85]!==p?(lt=!J&&P&&P.length>1?(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(h,{htmlFor:p,children:(0,L.jsx)(i,{id:`FCMaBz`})}),(0,L.jsxs)(te,{value:D,onValueChange:O,children:[(0,L.jsx)(y,{id:p,size:`sm`,className:`w-full`,"data-testid":`skill-import-pick`,children:(0,L.jsx)(x,{})}),(0,L.jsx)(v,{children:P.map(U)})]}),(0,L.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,L.jsx)(i,{id:`xtJgSe`})})]}):null,t[82]=P,t[83]=J,t[84]=D,t[85]=p,t[86]=lt):lt=t[86];let ut;t[87]===Symbol.for(`react.memo_cache_sentinel`)?(ut=(0,L.jsx)(`p`,{className:`font-medium text-xs font-mono text-muted-foreground/80 uppercase tracking-wider`,children:(0,L.jsx)(i,{id:`DWJtEo`})}),t[87]=ut):ut=t[87];let dt;t[88]===C?dt=t[89]:(dt=(0,L.jsx)(`li`,{children:C===`project`?(0,L.jsx)(i,{id:`rucNcu`,components:{0:(0,L.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-[0.9em] text-foreground/80`})}}):(0,L.jsx)(i,{id:`vjW-SM`,components:{0:(0,L.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-[0.9em] text-foreground/80`})}})}),t[88]=C,t[89]=dt);let ft,pt;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(ft=(0,L.jsx)(`li`,{children:(0,L.jsx)(i,{id:`tqQBwN`})}),pt=(0,L.jsx)(`li`,{children:(0,L.jsx)(i,{id:`QB-moX`})}),t[90]=ft,t[91]=pt):(ft=t[90],pt=t[91]);let Q;t[92]===dt?Q=t[93]:(Q=(0,L.jsxs)(`div`,{role:`note`,className:`space-y-3`,"data-testid":`skill-import-disclosure`,children:[ut,(0,L.jsxs)(`ul`,{className:`list-disc space-y-2.5 pl-4 text-sm text-muted-foreground marker:text-muted-foreground/50`,children:[dt,ft,pt]})]}),t[92]=dt,t[93]=Q);let mt;t[94]!==Ee||t[95]!==Me||t[96]!==ct||t[97]!==lt||t[98]!==Q?(mt=(0,L.jsxs)(Ee,{className:`flex flex-col gap-6`,children:[Me,ct,lt,Q]}),t[94]=Ee,t[95]=Me,t[96]=ct,t[97]=lt,t[98]=Q,t[99]=mt):mt=t[99];let ht;t[100]===r?ht=t[101]:(ht=()=>r(!1),t[100]=r,t[101]=ht);let gt;t[102]===Symbol.for(`react.memo_cache_sentinel`)?(gt=(0,L.jsx)(i,{id:`dEgA5A`}),t[102]=gt):gt=t[102];let _t;t[103]!==N||t[104]!==ht?(_t=(0,L.jsx)(c,{variant:`outline`,className:`font-mono uppercase`,onMouseDown:H,onClick:ht,disabled:N,children:gt}),t[103]=N,t[104]=ht,t[105]=_t):_t=t[105];let vt=J?`skill-upload-button`:`skill-import-button`,yt;t[106]===Te?yt=t[107]:(yt=()=>void Te(),t[106]=Te,t[107]=yt);let bt=!Ce,xt;t[108]!==N||t[109]!==J?(xt=N?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(oe,{className:`size-4 animate-spin`}),J?(0,L.jsx)(i,{id:`_eguJc`}):(0,L.jsx)(i,{id:`RqSvT0`})]}):J?(0,L.jsx)(i,{id:`ONWvwQ`}):(0,L.jsx)(i,{id:`l3s5ri`}),t[108]=N,t[109]=J,t[110]=xt):xt=t[110];let St;t[111]!==vt||t[112]!==yt||t[113]!==bt||t[114]!==xt?(St=(0,L.jsx)(c,{"data-testid":vt,onClick:yt,disabled:bt,children:xt}),t[111]=vt,t[112]=yt,t[113]=bt,t[114]=xt,t[115]=St):St=t[115];let $;t[116]!==_t||t[117]!==St?($=(0,L.jsxs)(f,{children:[_t,St]}),t[116]=_t,t[117]=St,t[118]=$):$=t[118];let Ct;return t[119]!==mt||t[120]!==$?(Ct=(0,L.jsxs)(L.Fragment,{children:[mt,$]}),t[119]=mt,t[120]=$,t[121]=Ct):Ct=t[121],Ct}function H(e){return e.preventDefault()}function U(e){return(0,L.jsx)(_,{value:e.name,children:e.name},e.name)}function W(e){return{name:e,description:null}}function G(e){let t=(0,he.c)(21),{defaultScope:n,open:r,onOpenChange:a,defaultTab:o,onImported:s}=e,c=o===void 0?`skills-sh`:o,d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,L.jsx)(ee,{children:(0,L.jsx)(i,{id:`GBQjiV`})}),t[0]=d):d=t[0];let f;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,L.jsxs)(p,{children:[d,(0,L.jsx)(l,{className:`sr-only`,children:(0,L.jsx)(i,{id:`qTcVwj`})})]}),t[1]=f):f=t[1];let h;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,L.jsx)(C,{variant:`line`,value:`skills-sh`,children:(0,L.jsx)(i,{id:`8tjQCz`})}),t[2]=h):h=t[2];let g;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,L.jsxs)(T,{variant:`line`,className:`w-full justify-start gap-4 border-b p-0`,children:[h,(0,L.jsx)(C,{variant:`line`,value:`upload`,children:(0,L.jsx)(i,{id:`ONWvwQ`})})]}),t[3]=g):g=t[3];let _;t[4]===a?_=t[5]:(_=()=>a(!1),t[4]=a,t[5]=_);let v;t[6]!==n||t[7]!==_?(v=(0,L.jsx)(w,{value:`skills-sh`,className:`h-[62vh] min-h-0 flex-none`,children:(0,L.jsx)(R,{scope:n,onNavigate:_})}),t[6]=n,t[7]=_,t[8]=v):v=t[8];let y;t[9]!==n||t[10]!==s||t[11]!==a?(y=(0,L.jsx)(w,{value:`upload`,className:`mt-3 flex min-h-0 flex-1 flex-col gap-6`,children:(0,L.jsx)(V,{defaultScope:n,onOpenChange:a,onImported:s})}),t[9]=n,t[10]=s,t[11]=a,t[12]=y):y=t[12];let b;t[13]!==c||t[14]!==v||t[15]!==y?(b=(0,L.jsxs)(u,{className:`flex max-h-[85vh] flex-col gap-4 sm:max-w-4xl`,children:[f,(0,L.jsxs)(re,{defaultValue:c,className:`flex min-h-0 flex-1 flex-col gap-3`,children:[g,v,y]})]}),t[13]=c,t[14]=v,t[15]=y,t[16]=b):b=t[16];let x;return t[17]!==a||t[18]!==r||t[19]!==b?(x=(0,L.jsx)(m,{open:r,onOpenChange:a,children:b}),t[17]=a,t[18]=r,t[19]=b,t[20]=x):x=t[20],x}export{G as ImportSkillDialog};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./calendar-DWQCtEOX.js","./chunk-CYidjpOJ.js","./button-RQ5o7P7w.js","./dist-DUWYPul7.js","./react-f2sANaYj.js","./bundle-mjs-SHeFpKGC.js","./compiler-runtime-BfE3aGVn.js","./jsx-runtime-BUgB2tll.js","./utils-CPqDy6Hr.js","./format-B72MB8qy.js","./chevron-down-BeptYHqQ.js","./createLucideIcon-DihYAFEK.js","./chevron-left-B-obKYha.js","./chevron-right-CABnKLlm.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{Ht as r,S as i,Sn as a,Wt as o,_ as s,_n as c,bn as l,g as u,i as d,mn as f,y as p}from"./DocumentContext-CXfBU9-L.js";import{t as m}from"./react-f2sANaYj.js";import{n as h,r as g}from"./dist-Nvb76hAm.js";import{t as _}from"./compiler-runtime-BfE3aGVn.js";import{a as v,c as y,s as b,u as x}from"./terminal-input-events-BGPQuYMh.js";import{t as S}from"./utils-CPqDy6Hr.js";import{t as C}from"./button-RQ5o7P7w.js";import{i as w,n as T,t as E}from"./tooltip-x7BNUa3s.js";import{n as D,r as O,t as k}from"./collapsible-OhEmjTXw.js";import{E as A,at as j}from"./CodeMirrorPropInput-Ci80khj8.js";import{t as M}from"./checkbox-DoJAOcMt.js";import{c as N,l as P,m as F,r as I,t as L}from"./dropdown-menu-AlVJ7dJz.js";import{i as R,n as z,o as B,s as V,t as H}from"./select-BUOcREjn.js";import{Aa as U,At as ee,F as W,I as G,Ir as K,Ka as q,La as J,Lr as Y,O as te,Oa as ne,Pr as re,Rn as ie,S as ae,Va as oe,Wr as se,Yt as ce,br as le,ft as ue,ja as de,ka as fe,pt as pe,ut as me,x as he,xt as ge,zn as _e}from"./dist-OxboORfH2.js";import{t as ve}from"./createLucideIcon-DihYAFEK.js";import{t as ye}from"./braces-BG3bQFuB.js";import{t as be}from"./chevron-down-BeptYHqQ.js";import{t as xe}from"./chevron-right-CABnKLlm.js";import{o as Se,r as Ce}from"./folder-config-api-BSMImK4t.js";import{t as we}from"./hash-BXtq910s.js";import{t as Te}from"./trash-2-WxyktwvM.js";import{t as Ee}from"./triangle-alert-C2yId37R.js";import{t as De}from"./x-xV4a4mi6.js";import{n as Oe}from"./dist-uN7pEWl0.js";import{t as ke}from"./input-Cm94Cun3.js";import{t as Ae}from"./dist-CzC3AWOn.js";import{f as je,x as Me}from"./doc-paths-lZOQ-mhw.js";import{K as Ne,U as Pe,b as Fe,m as Ie}from"./navigation-targets-CUdNH5TL.js";import{d as Le}from"./documents-events-5TI0rZAg.js";import{o as Re}from"./skill-scope-CmujX5gW.js";import{t as ze}from"./badge-C21d8Yhu.js";import{g as Be}from"./skills-api-BeHeMfn9.js";import{t as Ve}from"./external-link-Dvu-nzFi.js";import{t as He}from"./use-skills-C2EtCeGb.js";import{a as Ue,l as We,r as Ge,t as Ke}from"./selection-context-QeNscioc.js";import{t as qe}from"./textarea-BzPGvj03.js";import{l as Je}from"./lint-config-client-CGN8hOQ_.js";import{a as Ye,d as Xe,f as Ze,i as Qe,l as $e,m as et,o as tt,p as nt,s as rt,t as it,u as at}from"./sortable.esm-Dngr9VJ1.js";import{C as ot,S as st,_ as ct,a as lt,b as ut,c as dt,g as ft,h as pt,i as mt,l as ht,n as gt,o as _t,r as vt,s as yt,t as bt,v as xt,w as St,x as Ct,y as wt}from"./format-B72MB8qy.js";var Tt=ve(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),Et=ve(`folder-git-2`,[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]),Dt=ve(`image-plus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),Ot=ve(`message-square-plus`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),kt=ve(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),At=ve(`square-check`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),jt=ve(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),Mt=ve(`unlink`,[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]),X=n(),Z=e(m(),1),Q=_(),Nt=`open-knowledge:doc-panel-tab`,Pt=null;function Ft(){let e=Pt;return Pt=null,e}function It(e,t=typeof window>`u`?new EventTarget:window){Pt=e,t.dispatchEvent(new CustomEvent(Nt,{detail:{tab:e}}))}function Lt(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail?.tab:void 0;n&&e(n)};return t.addEventListener(Nt,n),()=>t.removeEventListener(Nt,n)}var Rt=Object.defineProperty,zt=(e,t)=>{for(var n in t)Rt(e,n,{get:t[n],enumerable:!0})},Bt={};zt(Bt,{ActiveEmoji:()=>Er,Empty:()=>Tr,List:()=>xr,Loading:()=>Cr,Root:()=>rr,Search:()=>ir,SkinTone:()=>Dr,SkinToneSelector:()=>Sr,Viewport:()=>or});var Vt=`'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', EmojiSymbols, sans-serif`,Ht=[`none`,`light`,`medium-light`,`medium`,`medium-dark`,`dark`];function Ut(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Wt=2,Gt=null;function Kt(e){try{Gt??=document.createElement(`canvas`).getContext(`2d`,{willReadFrequently:!0})}catch{}if(!Gt||(queueMicrotask(()=>{Gt&&=null}),Gt.canvas.width=Wt,Gt.canvas.height=Wt,Gt.font=`2px ${Vt}`,Gt.textBaseline=`middle`,Gt.measureText(e).width>=Wt*2))return!1;Gt.fillStyle=`#00f`,Gt.fillText(e,0,0);let t=Gt.getImageData(0,0,Wt,Wt).data;Gt.clearRect(0,0,Wt,Wt),Gt.fillStyle=`#f00`,Gt.fillText(e,0,0);let n=Gt.getImageData(0,0,Wt,Wt).data;for(let e=0;e<Wt*Wt*4;e+=4)if(t[e]!==n[e]||t[e+1]!==n[e+1]||t[e+2]!==n[e+2])return!1;return!0}function qt(e,t,n){try{let r=e.getItem(t);if(!r)throw Error(`No value found for "${t}".`);return n(JSON.parse(r))}catch{return null}}function Jt(e,t,n){e.setItem(t,JSON.stringify(n))}function Yt(e){return t=>t===void 0?void 0:e(t)}function Xt(e){return t=>t===null?null:e(t)}function Zt(e){if(typeof e!=`string`)throw Error();return e}function Qt(e){if(typeof e!=`number`)throw Error();return e}function $t(e){if(typeof e!=`boolean`)throw Error();return e}function en(e){return t=>{if(typeof t!=`object`||!t)throw Error();let n={};for(let r in e){let i=t[r];i===void 0&&e[r](void 0),n[r]=e[r](i)}return n}}function tn(e){return t=>{if(!Array.isArray(t))throw Error();return t.length>0&&e(t[0]),t}}var nn=(e,t)=>`${e}/${t}/data.json`,rn=(e,t)=>`${e}/${t}/messages.json`,an=`bn.da.de.en-gb.en.es-mx.es.et.fi.fr.hi.hu.it.ja.ko.lt.ms.nb.nl.pl.pt.ru.sv.th.uk.vi.zh-hant.zh`.split(`.`),on=`en`,sn=e=>`frimousse/data/${e}`,cn=`frimousse/metadata`;async function ln(e,t){try{return(await fetch(e,{method:`HEAD`,signal:t})).headers.get(`etag`)}catch{return null}}async function un(e,t,n){let[{emojis:r,emojisEtag:i},{messages:a,messagesEtag:o}]=await Promise.all([fetch(nn(e,t),{signal:n}).then(async e=>({emojis:await e.json(),emojisEtag:e.headers.get(`etag`)})),fetch(rn(e,t),{signal:n}).then(async e=>({messages:await e.json(),messagesEtag:e.headers.get(`etag`)}))]);return{emojis:r,messages:a,emojisEtag:i,messagesEtag:o}}async function dn(e,t,n){let[r,i]=await Promise.all([ln(nn(e,t),n),ln(rn(e,t),n)]);return{emojisEtag:r,messagesEtag:i}}function fn(e){return e.skins?e.skins.filter(e=>typeof e.tone==`number`).reduce((e,t)=>{let n=Ht[t.tone];return e[n]=t.emoji,e},{}):void 0}async function pn(e,t,n){let{emojis:r,emojisEtag:i,messages:a,messagesEtag:o}=await un(e,t,n),s=a.subgroups.find(e=>e.key===`country-flag`||e.key===`subdivision-flag`),c=a.groups.filter(e=>e.key!==`component`),l=r.filter(e=>`group`in e),u=c.map(e=>({index:e.order,label:Ut(e.message)})),d=a.skinTones.reduce((e,t)=>(e[t.key]=Ut(t.message),e),{}),f={locale:t,emojis:l.map(e=>({emoji:e.emoji,category:e.group,version:e.version,label:Ut(e.label),tags:e.tags??[],countryFlag:s&&e.subgroup===s.order||void 0,skins:fn(e)})),categories:u,skinTones:d};return Jt(localStorage,sn(t),{data:f,metadata:{emojisEtag:i,messagesEtag:o}}),f}function mn(e,t){let n=new Map;for(let t of e)n.has(t.version)||n.set(t.version,t.emoji);let r=[...n.keys()].sort((e,t)=>t-e),i=r[0]??0,a=Kt(`🇪🇺`);if(typeof t==`number`)return{emojiVersion:t,countryFlags:a};for(let e of r)if(Kt(n.get(e)))return{emojiVersion:e,countryFlags:a};return{emojiVersion:i,countryFlags:a}}var hn=en({emojiVersion:Qt,countryFlags:$t}),gn=en({data:en({locale:Zt,emojis:tn(en({emoji:Zt,category:Qt,label:Zt,version:Qt,tags:tn(Zt),countryFlag:Yt($t),skins:Yt(en({light:Zt,"medium-light":Zt,medium:Zt,"medium-dark":Zt,dark:Zt}))})),categories:tn(en({index:Qt,label:Zt})),skinTones:en({light:Zt,"medium-light":Zt,medium:Zt,"medium-dark":Zt,dark:Zt})}),metadata:en({emojisEtag:Xt(Zt),messagesEtag:Xt(Zt)})});async function _n({locale:e,emojiVersion:t,emojibaseUrl:n,signal:r}){let i=typeof n==`string`?n:`https://cdn.jsdelivr.net/npm/emojibase-data@${typeof t==`number`?Math.floor(t):`latest`}`,a=qt(sessionStorage,cn,hn),o=qt(localStorage,sn(e),gn),s;if(!o)s=await pn(i,e,r);else if(a)s=o.data;else try{let{emojisEtag:t,messagesEtag:n}=await dn(i,e,r);s=!t||!n||t!==o.metadata.emojisEtag||n!==o.metadata.messagesEtag?await pn(i,e,r):o.data}catch{s=o.data}return a??=mn(s.emojis,t),Jt(sessionStorage,cn,a),{locale:e,emojis:s.emojis.filter(e=>{let t=e.version<=a.emojiVersion;return e.countryFlag?t&&a.countryFlags:t}),categories:s.categories,skinTones:s.skinTones}}function vn(e){return an.includes(e)?e:(console.warn(`Locale "${e}" is not supported, using "${on}" instead.`),on)}function yn(e){return Ht.includes(e)?e:(console.warn(`Skin tone "${e}" is not valid, using "none" instead.`),`none`)}function bn(e,t){let n=[];if(t<=0)return n;for(let r=0,i=e.length;r<i;r+=t)n.push(e.slice(r,r+t));return n}function xn(e,t){if(!t)return e;let n=t.toLowerCase().trim(),r=new WeakMap;return e.filter(e=>{let t=0;e.label.toLowerCase().includes(n)&&(t+=10);for(let r of e.tags)r.toLowerCase().includes(n)&&(t+=1);return t>0?(r.set(e,t),!0):!1}).sort((e,t)=>(r.get(t)??0)-(r.get(e)??0))}function Sn(e,t,n,r){let i=xn(e.emojis,r),a=[],o=[],s=[],c={},l=0,u=0;for(let e of i)c[e.category]||(c[e.category]=[]),c[e.category].push({emoji:n&&n!==`none`&&e.skins?e.skins[n]:e.emoji,label:e.label});for(let n of e.categories){let e=c[n.index];if(!e||e.length===0)continue;let r=bn(Array.from(e),t).map(e=>({categoryIndex:l,emojis:e}));a.push(...r),o.push({label:n.label,rowsCount:r.length,startRowIndex:u}),s.push(u),l++,u+=r.length}return{count:i.length,categories:o,categoriesStartRowIndices:s,rows:a,skinTones:e.skinTones}}function Cn(e){let t={},n=null,r=null,i=new Set,a=()=>{if(n){t=n,n=null;for(let e of i)e(t)}r=null},o=()=>n??t,s=e=>{n??=t,Object.assign(n,typeof e==`function`?e(o()):e),r||=requestAnimationFrame(a)};return t=e(s,o),{get:o,set:s,subscribe:e=>(i.add(e),()=>i.delete(e))}}function wn(e){let[t]=(0,Z.useState)(e);return t}function Tn(e){let t=(0,Z.createContext)(null);return{useStore:()=>{let n=(0,Z.useContext)(t);if(!n)throw Error(e);return n},Provider:({store:e,children:n})=>(0,X.jsx)(t.Provider,{value:e,children:n})}}function En(e,t,n=Object.is){let[r,i]=(0,Z.useState)(()=>t(e.get()));return(0,Z.useEffect)(()=>e.subscribe(()=>{let r=t(e.get());i(e=>n(e,r)?e:r)}),[e,t,n]),(0,Z.useDebugValue)(r),r}function Dn(e,t,n){return En(e,(0,Z.useCallback)(e=>e[t],[t]),n)}var On=2;function kn(e,t,n,r,i){let a=0;return Cn((o,s)=>({locale:t,columns:n,sticky:r,skinTone:i,onEmojiSelect:e,data:null,search:``,interaction:`none`,activeColumnIndex:0,activeRowIndex:0,rowHeight:null,categoryHeaderHeight:null,viewportWidth:null,viewportHeight:null,viewportCurrentCategoryIndex:null,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0,rootRef:null,searchRef:null,viewportRef:null,listRef:null,updateViewportState:e=>{let t=s(),n=e?.data??t.data,r=e?.categoryHeaderHeight??t.categoryHeaderHeight,i=e?.rowHeight??t.rowHeight,c=e?.viewportHeight??t.viewportHeight;if(!n||n.rows.length===0||!r||!i||!c)return o({...e,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0});let l=0,u=0;for(let e of n.categories)if(u++*r+e.startRowIndex*i<a)l+=r;else break;let d=n.categories.length*r+n.rows.length*i,f=Math.floor(On*i/2),p=Math.ceil(On*i/2),m=Math.min(a-l-f,d-c),h=m+c+p,g=Math.max(0,Math.floor(m/i)),_=Math.min(n.rows.length-1,Math.ceil(h/i)),v=n.rows[g]?.categoryIndex;return o(v===void 0&&e?e:{...e,viewportStartCategoryIndex:v,viewportStartRowIndex:g,viewportEndRowIndex:_})},onDataChange:e=>{s().updateViewportState({data:e,activeColumnIndex:0,activeRowIndex:0})},onSearchChange:e=>{o({search:e,interaction:e?`keyboard`:`none`})},onActiveEmojiChange:(e,t,n)=>{if(o({interaction:e,activeColumnIndex:t,activeRowIndex:n}),e!==`keyboard`)return;let{listRef:r,viewportRef:i,sticky:c,rowHeight:l,viewportHeight:u,categoryHeaderHeight:d}=s(),f=r?.current,p=i?.current;if(!f||!p||!l||!d||!u)return;let m=n;m===0&&p.scrollTo({top:0,behavior:`instant`});let h=f.querySelector(`[aria-rowindex="${m}"]`);if(!(h instanceof HTMLElement))return;let g=h.offsetTop,_=getComputedStyle(h),v=Number.parseFloat(_.scrollMarginTop),y=Number.parseFloat(_.scrollMarginBottom),b=a+v;c&&g<a+u/2&&(b+=d);let x=b+u-y;(g<b||g+l>x)&&p.scrollTo({top:Math.max(g<b+d?g-Math.max(c?d:0,v):g-u+l+y,0),behavior:`instant`})},onActiveEmojiReset:()=>{o({interaction:`none`,activeColumnIndex:0,activeRowIndex:0})},onRowHeightChange:e=>{s().updateViewportState({rowHeight:e})},onCategoryHeaderHeightChange:e=>{s().updateViewportState({categoryHeaderHeight:e})},onViewportSizeChange:(e,t)=>{s().updateViewportState({viewportWidth:e,viewportHeight:t})},onViewportScroll:e=>{a=e,s().updateViewportState()}}))}var{useStore:An,Provider:jn}=Tn(`EmojiPicker.Root is missing.`);function Mn(e){return e.search}function Nn(e){return e.interaction===`none`?void 0:e.data?.rows[e.activeRowIndex]?.emojis[e.activeColumnIndex]}function Pn(e){return e.data===void 0||typeof e.data?.count==`number`&&e.data.count===0}function Fn(e){return e.data===null||e.viewportHeight===null||e.rowHeight===null||e.categoryHeaderHeight===null}function In(e){return e.data?.rows.length}function Ln(e){return e.data?.categories.length}function Rn(e){return e.data?.categoriesStartRowIndices}function zn(e){return e.data?.skinTones}function Bn(e,t){return e?.emoji===t?.emoji}function Vn(e,t){return e?.categoryIndex!==t?.categoryIndex||e?.emojis.length!==t?.emojis.length?!1:!!e?.emojis.every((e,n)=>Bn(e,t?.emojis[n]))}var Hn=``,Un=/\p{Emoji_Modifier_Base}/u,Wn=/\uFE0F$/,Gn=/\u{1F3FB}|\u{1F3FC}|\u{1F3FD}|\u{1F3FE}|\u{1F3FF}/gu,Kn={light:`🏻`,"medium-light":`🏼`,medium:`🏽`,"medium-dark":`🏾`,dark:`🏿`};function qn(e,t){if(!e.split(Hn).some(e=>Un.test(e)))return e;let n=e.split(Hn).map(e=>e.replace(Gn,``)).join(Hn);return t===`none`?n:n.split(Hn).map((e,n,r)=>{let i=r.length>1;return!Un.test(e)||i&&e===`🤝`?e:e.replace(Wn,``)+Kn[t]}).join(Hn)}function Jn(e){return Ht.map(t=>({skinTone:t,emoji:qn(e,t)}))}function Yn(){return(0,Z.useDeferredValue)(En(An(),Nn,Bn))}function Xn(e=`✋`){let t=An(),n=Dn(t,`skinTone`),r=(0,Z.useMemo)(()=>Jn(e),[e]);return[n,(0,Z.useCallback)(e=>{t.set({skinTone:e})},[]),r]}function Zn(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||typeof t!=`object`||e===null||t===null||Array.isArray(e)!==Array.isArray(t))return!1;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length?n.every(n=>n in t&&e[n]===t[n]):!1}function Qn(...e){}function $n(e,t){let n=null;if(typeof window.requestIdleCallback==`function`)n=window.requestIdleCallback(e,t);else{let r=Date.now();n=window.setTimeout(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,(t?.timeout??50)-(Date.now()-r))})},10)}return()=>{typeof window.cancelIdleCallback==`function`?window.cancelIdleCallback(n):window.clearTimeout(n)}}var er=typeof window<`u`?Z.useLayoutEffect:Z.useEffect;function tr(e){let t=(0,Z.useRef)(e);return er(()=>{t.current=e}),(0,Z.useCallback)((...e)=>t.current(...e),[])}function nr({emojiVersion:e,emojibaseUrl:t}){let[n,r]=(0,Z.useState)(void 0),i=An(),a=Dn(i,`locale`),o=Dn(i,`columns`),s=Dn(i,`skinTone`),c=Dn(i,`search`);return(0,Z.useEffect)(()=>{let n=new AbortController,i=n.signal;return _n({locale:a,emojiVersion:e,emojibaseUrl:t,signal:i}).then(e=>{r(e)}).catch(e=>{i.aborted||console.error(e)}),()=>{n.abort()}},[e,t,a]),(0,Z.useEffect)(()=>{if(n)return $n(()=>{i.get().onDataChange(Sn(n,o,s,c))},{timeout:100})},[n,o,s,c]),null}var rr=(0,Z.forwardRef)(({locale:e=`en`,columns:t=9,skinTone:n=`none`,onEmojiSelect:r=Qn,emojiVersion:i,emojibaseUrl:a,onFocusCapture:o,onBlurCapture:s,children:c,style:l,sticky:u=!0,...d},f)=>{let p=tr(r),m=wn(()=>kn(p,vn(e),t,u,yn(n))),[h,g]=(0,Z.useState)(!1),_=(0,Z.useRef)(null),v=(0,Z.useCallback)(e=>{e&&(_.current=e,m.set({rootRef:_}))},[]);er(()=>{m.set({locale:vn(e)})},[e]),er(()=>{m.set({columns:t})},[t]),er(()=>{m.set({sticky:u})},[u]),er(()=>{m.set({skinTone:yn(n)})},[n]);let y=(0,Z.useCallback)(e=>{o?.(e);let{searchRef:t,viewportRef:n}=m.get(),r=e.target===t?.current||e.target.hasAttribute(`frimousse-search`),i=e.target===n?.current||e.target.hasAttribute(`frimousse-viewport`);e.isDefaultPrevented()||(g(r||i),e.isDefaultPrevented()||(g(r||i),i?m.get().onActiveEmojiChange(`keyboard`,0,0):r&&m.get().search===``&&m.set({interaction:`none`})))},[o]),b=(0,Z.useCallback)(e=>{s?.(e),!e.isDefaultPrevented()&&!e.currentTarget.contains(e.relatedTarget)&&g(!1)},[s]);return er(()=>{h||m.get().onActiveEmojiReset()},[h]),(0,Z.useImperativeHandle)(f,()=>_.current),(0,Z.useEffect)(()=>{if(!h)return;function e(e){if(e.defaultPrevented||!e.key.startsWith(`Arrow`)&&e.key!==`Enter`)return;let{data:t,onEmojiSelect:n,onActiveEmojiChange:r,interaction:i,activeColumnIndex:a,activeRowIndex:o}=m.get();if(e.key===`Enter`){let t=Nn(m.get());t&&(e.preventDefault(),n(t))}if(e.key.startsWith(`Arrow`)){let n=a,s=o;if(e.preventDefault(),i!==`none`){if(t?.rows&&t.rows.length>0)switch(e.key){case`ArrowLeft`:if(n===0){let e=s-1,r=t.rows[e];r&&(s=e,n=r.emojis.length-1)}else --n;break;case`ArrowRight`:if(n===t.rows[s].emojis.length-1){let e=s+1;t.rows[e]&&(s=e,n=0)}else n+=1;break;case`ArrowUp`:{let e=t.rows[s-1];e&&(--s,e.emojis[n]||(n=e.emojis.length-1));break}case`ArrowDown`:{let e=t.rows[s+1];e&&(s+=1,e.emojis[n]||(n=e.emojis.length-1));break}}r(`keyboard`,n,s)}else r(`keyboard`,0,0)}}return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[h]),er(()=>{let e=null,t=null,n=null,r=null,i=m.subscribe(i=>{_.current&&(e!==i.viewportWidth&&(e=i.viewportWidth,_.current.style.setProperty(`--frimousse-viewport-width`,`${i.viewportWidth}px`)),t!==i.viewportHeight&&(t=i.viewportHeight,_.current.style.setProperty(`--frimousse-viewport-height`,`${i.viewportHeight}px`)),n!==i.rowHeight&&(n=i.rowHeight,_.current.style.setProperty(`--frimousse-row-height`,`${i.rowHeight}px`)),r!==i.categoryHeaderHeight&&(r=i.categoryHeaderHeight,_.current.style.setProperty(`--frimousse-category-header-height`,`${i.categoryHeaderHeight}px`)))}),{viewportWidth:a,viewportHeight:o,rowHeight:s,categoryHeaderHeight:c}=m.get();return a&&_.current.style.setProperty(`--frimousse-viewport-width`,`${a}px`),o&&_.current.style.setProperty(`--frimousse-viewport-height`,`${o}px`),s&&_.current.style.setProperty(`--frimousse-row-height`,`${s}px`),c&&_.current.style.setProperty(`--frimousse-category-header-height`,`${c}px`),i},[]),(0,X.jsx)(`div`,{"data-focused":h?``:void 0,"frimousse-root":``,onBlurCapture:b,onFocusCapture:y,...d,ref:v,style:{"--frimousse-emoji-font":Vt,...l},children:(0,X.jsxs)(jn,{store:m,children:[(0,X.jsx)(nr,{emojiVersion:i,emojibaseUrl:a}),c]})})}),ir=(0,Z.forwardRef)(({value:e,defaultValue:t,onChange:n,...r},i)=>{let a=An(),o=(0,Z.useRef)(null),s=(0,Z.useCallback)(e=>{e&&(o.current=e,a.set({searchRef:o}))},[]),c=typeof e==`string`,l=(0,Z.useRef)(c);(0,Z.useEffect)(()=>{l.current=c},[c]),er(()=>{a.set({search:typeof e==`string`?e:typeof t==`string`?t:``})},[]),er(()=>{typeof e==`string`&&a.get().onSearchChange(e)},[e]);let u=(0,Z.useCallback)(e=>{n?.(e),e.isDefaultPrevented()||a.get().onSearchChange(e.target.value)},[n]);return(0,Z.useImperativeHandle)(i,()=>o.current),(0,X.jsx)(`input`,{autoCapitalize:`off`,autoComplete:`off`,autoCorrect:`off`,enterKeyHint:`done`,"frimousse-search":``,placeholder:`Search…`,spellCheck:!1,type:`search`,...r,defaultValue:t,onChange:u,ref:s,value:e})}),ar=(0,Z.memo)(()=>{let e=Yn();return e?(0,X.jsx)(`div`,{"aria-live":`polite`,style:{border:0,clip:`rect(0, 0, 0, 0)`,height:1,margin:-1,overflow:`hidden`,padding:0,position:`absolute`,whiteSpace:`nowrap`,width:1,wordWrap:`normal`},children:e.label}):null}),or=(0,Z.forwardRef)(({children:e,onScroll:t,onKeyDown:n,style:r,...i},a)=>{let o=An(),s=(0,Z.useRef)(null),c=(0,Z.useCallback)(e=>{e&&(s.current=e,o.set({viewportRef:s}))},[]),l=En(o,In),u=En(o,Ln),d=(0,Z.useCallback)(e=>{t?.(e),o.get().onViewportScroll(e.currentTarget.scrollTop)},[t]);return er(()=>{if(!s.current)return;let e=new ResizeObserver(([e])=>{let t=e?.borderBoxSize[0]?.inlineSize??0,n=e?.borderBoxSize[0]?.blockSize??0,{onViewportSizeChange:r,viewportHeight:i,viewportWidth:a}=o.get();(i!==n||a!==t)&&r(t,n)});return e.observe(s.current),o.get().onViewportSizeChange(s.current.offsetWidth,s.current.clientHeight),()=>{e.disconnect()}},[]),(0,Z.useImperativeHandle)(a,()=>s.current),(0,X.jsxs)(`div`,{"frimousse-viewport":``,...i,onScroll:d,ref:c,style:{position:`relative`,boxSizing:`border-box`,contain:`layout paint`,containIntrinsicSize:typeof l==`number`&&typeof u==`number`?`var(--frimousse-viewport-width, auto) calc(${l} * var(--frimousse-row-height) + ${u} * var(--frimousse-category-header-height))`:void 0,overflowY:`auto`,overscrollBehavior:`contain`,scrollbarGutter:`stable`,willChange:`scroll-position`,...r},children:[(0,X.jsx)(ar,{}),e]})});function sr(e,t,n){return{emoji:{...e,isActive:n},role:`gridcell`,"aria-colindex":t,"aria-selected":n||void 0,"aria-label":e.label,"data-active":n?``:void 0,"frimousse-emoji":``,style:{fontFamily:`var(--frimousse-emoji-font)`},tabIndex:-1}}function cr(e,t=!1){return{role:t?void 0:`row`,"aria-rowindex":t?void 0:e,"frimousse-row":``,style:{contain:t?void 0:`content`,height:t?void 0:`var(--frimousse-row-height)`,display:`flex`}}}function lr(e,t){return{"frimousse-category":``,style:{contain:`content`,top:t?`calc(${e} * var(--frimousse-category-header-height) + ${t.startRowIndex} * var(--frimousse-row-height))`:void 0,height:t?`calc(var(--frimousse-category-header-height) + ${t.rowsCount} * var(--frimousse-row-height))`:void 0,width:`100%`,pointerEvents:`none`,position:`absolute`}}}function ur(e,t=!1,n=!0){return{category:e,"frimousse-category-header":``,style:{contain:t?void 0:`layout paint`,height:t?void 0:`var(--frimousse-category-header-height)`,pointerEvents:`auto`,position:n?`sticky`:void 0,top:0}}}function dr(e,t,n,r){return{"frimousse-list-sizer":``,style:{position:`relative`,boxSizing:`border-box`,height:`calc(${e} * var(--frimousse-row-height) + ${t} * var(--frimousse-category-header-height))`,paddingTop:`calc(${n} * var(--frimousse-row-height) + ${r} * var(--frimousse-category-header-height))`}}}function fr(e,t,n){return{"aria-colcount":e,"aria-rowcount":t,"frimousse-list":``,style:{"--frimousse-list-columns":e,...n},role:`grid`}}function pr(e){e.preventDefault()}var mr=(0,Z.memo)(({Emoji:e,emoji:t,columnIndex:n,rowIndex:r})=>{let i=An(),a=En(i,e=>Nn(e)?.emoji===t.emoji),o=(0,Z.useCallback)(()=>{i.get().onEmojiSelect(t)},[t]),s=(0,Z.useCallback)(()=>{i.get().onActiveEmojiChange(`pointer`,n,r)},[n,r]),c=(0,Z.useCallback)(()=>{i.get().onActiveEmojiReset()},[]);return(0,X.jsx)(e,{...sr(t,n,a),onClick:o,onPointerDown:pr,onPointerEnter:s,onPointerLeave:c})}),hr=(0,Z.memo)(({Row:e,Emoji:t,rowIndex:n})=>{let r=En(An(),e=>e.data?.rows[n],Vn);return r?(0,X.jsx)(e,{...cr(n),children:r.emojis.map((e,r)=>(0,X.jsx)(mr,{Emoji:t,columnIndex:r,emoji:e,rowIndex:n},e.label))}):null}),gr=(0,Z.memo)(({CategoryHeader:e,categoryIndex:t})=>{let n=An(),r=En(n,e=>e.data?.categories[t],Zn),i=Dn(n,`sticky`);return r?(0,X.jsx)(`div`,{...lr(t,r),children:(0,X.jsx)(e,{...ur({label:r.label},!1,i)})}):null}),_r=(0,Z.memo)(({CategoryHeader:e,Row:t,Emoji:n})=>{let r=(0,Z.useRef)(null),i=An(),a=Dn(i,`columns`),o=(0,Z.useMemo)(()=>Array(a).fill({emoji:`🙂`,label:``}),[a]),s=(0,Z.useMemo)(()=>({label:`Category`}),[]),c=(0,Z.useRef)(null),l=(0,Z.useRef)(null);return er(()=>{let e=r.current?.parentElement?.parentElement;if(!e||!c.current||!l.current)return;let t=new ResizeObserver(e=>{for(let t of e){let e=t.contentRect.height,{onRowHeightChange:n,onCategoryHeaderHeightChange:r,rowHeight:a,categoryHeaderHeight:o}=i.get();t.target===c.current&&a!==e&&n(e),t.target===l.current&&o!==e&&r(e)}});t.observe(e),t.observe(c.current),t.observe(l.current);let{onRowHeightChange:n,onCategoryHeaderHeightChange:a}=i.get();return n(c.current.clientHeight),a(l.current.clientHeight),()=>{t.disconnect()}},[]),(0,X.jsxs)(`div`,{"aria-hidden":!0,ref:r,style:{height:0,visibility:`hidden`},children:[(0,X.jsx)(`div`,{"frimousse-row-sizer":``,ref:c,children:(0,X.jsx)(t,{...cr(-1,!0),children:o.map((e,t)=>(0,X.jsx)(n,{...sr(e,t,!1)},t))})}),(0,X.jsx)(`div`,{...lr(-1),children:(0,X.jsx)(`div`,{"frimousse-category-header-sizer":``,ref:l,children:(0,X.jsx)(e,{...ur(s,!0)})})})]})});function vr({category:e,...t}){return(0,X.jsx)(`div`,{...t,children:e.label})}function yr({emoji:e,...t}){return(0,X.jsx)(`button`,{type:`button`,...t,children:e.emoji})}function br({...e}){return(0,X.jsx)(`div`,{...e})}var xr=(0,Z.forwardRef)(({style:e,components:t,...n},r)=>{let i=An(),a=(0,Z.useRef)(null),o=(0,Z.useCallback)(e=>{e&&(a.current=e,i.set({listRef:a}))},[]),s=t?.CategoryHeader??vr,c=t?.Emoji??yr,l=t?.Row??br,u=Dn(i,`columns`),d=Dn(i,`viewportStartRowIndex`),f=Dn(i,`viewportEndRowIndex`),p=En(i,In),m=En(i,Rn,Zn),h=(0,Z.useMemo)(()=>m?.filter(e=>e<d).length??0,[m,d]),g=m?.length??0;return(0,Z.useImperativeHandle)(r,()=>a.current),!p||!m||g===0?(0,X.jsx)(`div`,{...fr(u,0,e),...n,children:(0,X.jsx)(`div`,{...dr(0,0,0,0),children:(0,X.jsx)(_r,{CategoryHeader:s,Emoji:c,Row:l})})}):(0,X.jsx)(`div`,{...fr(u,p,e),...n,ref:o,children:(0,X.jsxs)(`div`,{...dr(p,g,d,h),children:[(0,X.jsx)(_r,{CategoryHeader:s,Emoji:c,Row:l}),Array.from({length:f-d+1},(e,t)=>{let n=d+t;return(0,X.jsxs)(Z.Fragment,{children:[m.indexOf(n)>=0&&(0,X.jsx)(`div`,{style:{height:`var(--frimousse-category-header-height)`}}),(0,X.jsx)(hr,{Emoji:c,Row:l,rowIndex:n})]},n)}),Array.from({length:g},(e,t)=>(0,X.jsx)(gr,{CategoryHeader:s,categoryIndex:t},t))]})})}),Sr=(0,Z.forwardRef)(({emoji:e,onClick:t,"aria-label":n=`Change skin tone`,...r},i)=>{let a=En(An(),zn,Zn),[o,s,c]=Xn(e),l=(0,Z.useMemo)(()=>Math.max(0,c.findIndex(e=>e.skinTone===o)),[o,c]),u=c[l],d=c[(l+1)%c.length].skinTone,f=o===`none`?void 0:a?.[o],p=d===`none`?void 0:a?.[d],m=(0,Z.useCallback)(e=>{t?.(e),e.isDefaultPrevented()||s(d)},[t,s,d]);return(0,X.jsx)(`button`,{type:`button`,...r,"aria-label":n+(p?` (${p})`:``),"aria-live":`polite`,"aria-valuetext":f,"frimousse-skin-tone-selector":``,onClick:m,ref:i,children:u.emoji})});function Cr({children:e,...t}){return En(An(),Fn)?(0,X.jsx)(`span`,{"frimousse-loading":``,...t,children:e}):null}function wr({children:e}){return e({search:En(An(),Mn)})}function Tr({children:e,...t}){return En(An(),Pn)?(0,X.jsx)(`span`,{"frimousse-empty":``,...t,children:typeof e==`function`?(0,X.jsx)(wr,{children:e}):e}):null}function Er({children:e}){return e({emoji:Yn()})}function Dr({children:e,emoji:t}){let[n,r,i]=Xn(t);return e({skinTone:n,setSkinTone:r,skinToneVariations:i})}rr.displayName=`EmojiPicker.Root`,ir.displayName=`EmojiPicker.Search`,or.displayName=`EmojiPicker.Viewport`,xr.displayName=`EmojiPicker.List`,Cr.displayName=`EmojiPicker.Loading`,Tr.displayName=`EmojiPicker.Empty`,Sr.displayName=`EmojiPicker.SkinToneSelector`,Er.displayName=`EmojiPicker.ActiveEmoji`,Dr.displayName=`EmojiPicker.SkinTone`;var Or={CategoryHeader:({category:e,...t})=>(0,X.jsx)(`div`,{...t,className:`bg-popover px-3 pt-3 pb-1.5 font-medium text-muted-foreground text-xs`,children:e.label}),Row:({children:e,...t})=>(0,X.jsx)(`div`,{...t,className:`scroll-my-1.5 px-1.5`,children:e}),Emoji:({emoji:e,...t})=>(0,X.jsx)(`button`,{type:`button`,...t,className:`flex size-8 items-center justify-center rounded-md text-lg data-[active]:bg-accent`,children:e.emoji})};function kr(e){let t=(0,Q.c)(11),{onSelect:n}=e,{_:r}=g(),i;t[0]===n?i=t[1]:(i=e=>{let{emoji:t}=e;return n(t)},t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=r({id:`EarrCe`}),t[2]=r,t[3]=a);let o;t[4]===a?o=t[5]:(o=(0,X.jsx)(Bt.Search,{className:`z-10 mx-2 mt-2 rounded-md border bg-background px-2.5 py-2 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring`,placeholder:a,autoFocus:!0}),t[4]=a,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,X.jsx)(Bt.Loading,{className:`absolute inset-0 flex items-center justify-center text-muted-foreground text-sm`,children:(0,X.jsx)(h,{id:`yQE2r9`})}),t[6]=s):s=t[6];let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,X.jsxs)(Bt.Viewport,{className:`relative flex-1 overscroll-contain outline-none`,children:[s,(0,X.jsx)(Bt.Empty,{className:`absolute inset-0 flex items-center justify-center text-muted-foreground text-sm`,children:(0,X.jsx)(h,{id:`z1uNN0`})}),(0,X.jsx)(Bt.List,{className:`select-none pb-1.5`,components:Or})]}),t[7]=c):c=t[7];let l;return t[8]!==i||t[9]!==o?(l=(0,X.jsxs)(Bt.Root,{className:`isolate flex h-[326px] w-[320px] flex-col bg-popover text-popover-foreground`,onEmojiSelect:i,children:[o,c]}),t[8]=i,t[9]=o,t[10]=l):l=t[10],l}var Ar=`245,158,11`,jr=Ar,Mr={fill:.22,line:.7},Nr={fill:.45,line:1},Pr=.45;function Fr(e,t){let n=jr,{fill:r,line:i}=t?Nr:Mr;return[`border-radius:2px`,`padding-bottom:1px`,...e.id===null?[]:[`cursor:pointer`],`background-color:rgba(${n},${r})`,`box-shadow:inset 0 -2px 0 rgba(${n},${i})`,``].join(`;`)}function Ir(e){return e.map(e=>e.id??`·`).join(`|`)}function Lr(e){let t=null;for(let n of e)n.id!==null&&(t===null||n.to-n.from<t.to-t.from)&&(t=n);return t?.id??null}function Rr(e,t){return e.id===null||e.id===t}function zr(e,t=null){let n=[...e].filter(e=>e.from<e.to).sort((e,t)=>e.from-t.from||e.to-t.to||(e.id??``).localeCompare(t.id??``));if(n.length===0)return[];let r=[...new Set(n.flatMap(e=>[e.from,e.to]))].sort((e,t)=>e-t),i=[],a=null,o=()=>{if(a===null)return;let e=a.covering.find(e=>Rr(e,t));i.push({from:a.from,to:a.to,style:Fr(e??a.covering[0],e!==void 0),threadId:Lr(a.covering)}),a=null};for(let e=0;e<r.length-1;e++){let t=r[e],i=r[e+1],s=n.filter(e=>e.from<=t&&e.to>=i);if(s.length===0){o();continue}if(a!==null&&a.to===t&&Ir(a.covering)===Ir(s)){a.to=i;continue}o(),a={from:t,to:i,covering:s}}return o(),i}var Br=`data-comment-reveal`;function Vr(e){return typeof CSS<`u`&&CSS.escape?CSS.escape(e):e}function Hr(e){return e===``?null:document.querySelector(`[data-testid="property-row"][data-key="${Vr(e)}"]`)}function Ur(e){let t=Hr(e);if(t===null)return null;let n=t.getBoundingClientRect();return n.height===0&&n.width===0?null:n}function Wr(e){Hr(e)?.scrollIntoView({block:`center`,behavior:`smooth`})}function Gr(e){if(e.quote===``)return!1;let t=e.path.length===0?e.key:e.path[e.path.length-1],n=Array.from(document.querySelectorAll(`[data-testid="property-row"][data-key="${Vr(String(t))}"]`)),r=Array.from(document.querySelectorAll(`[data-testid="property-row"]`));for(let t of[...n,...r]){let n=t.querySelector(`textarea, input`);if(n===null)continue;let r=Kr(n.value,e.quote,e.start,e.end);if(r!==null)return t.scrollIntoView({block:`center`,behavior:`smooth`}),n.focus(),n.setSelectionRange(r.start,r.end),qr(n),!0}return!1}function Kr(e,t,n,r){if(n!==void 0&&r!==void 0&&e.slice(n,r)===t)return{start:n,end:r};let i=e.indexOf(t);return i<0?null:{start:i,end:i+t.length}}function qr(e){e.style.setProperty(`--comment-reveal-fill`,`rgba(${Ar},${Pr})`),e.setAttribute(Br,`true`);let t=()=>{e.removeAttribute(Br),e.style.removeProperty(`--comment-reveal-fill`)};e.addEventListener(`blur`,t,{once:!0}),e.addEventListener(`pointerdown`,t,{once:!0}),e.addEventListener(`keydown`,t,{once:!0})}function Jr(e){let t=``,n=[];return e.descendants((e,r)=>{if(e.isText&&e.text)for(let i=0;i<e.text.length;i++)t+=e.text[i],n.push(r+i);return!0}),{text:t,positions:n}}function Yr(e,t){let n=[];if(t===``)return n;let r=e.indexOf(t);for(;r!==-1;)n.push(r),r=e.indexOf(t,r+1);return n}function Xr(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[e.length-1-r]===t[t.length-1-r];)r+=1;return r}function Zr(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r+=1;return r}var Qr=4,$r=64;function ei(e,t,n){let r=n?.prefix??``,i=n?.suffix??``;if(r===``&&i===``)return null;let a=r===``?[0]:_e(e,r,{syntaxIn:`needle`}).map(e=>e.end),o=i===``?[e.length]:_e(e,i,{syntaxIn:`needle`}).map(e=>e.start);if(a.length!==1||o.length!==1)return null;let s=a[0],c=o[0];for(;s<c&&/\s/.test(e[s]??``);)s+=1;for(;c>s&&/\s/.test(e[c-1]??``);)--c;if(c<=s)return null;let l=Math.max(t.length*Qr,t.length+$r);return c-s>l?null:{start:s,end:c}}function ti(e,t){let n=e.positions[t.start],r=e.positions[t.end-1];return n==null||r==null?null:{from:n,to:r+1}}function ni(e,t,n){if(t.length===0)return null;let r=Yr(e.text,t).map(e=>({start:e,end:e+t.length}));if(r.length===0&&(r=_e(e.text,t,{syntaxIn:`needle`})),r.length===0){let r=ei(e.text,t,n);return r===null?null:ti(e,r)}if(r.length===1)return ti(e,r[0]);let i=n?.prefix??``,a=n?.suffix??``,o=[],s=-1;for(let t of r){let n=Xr(i,e.text.slice(0,t.start))+Zr(a,e.text.slice(t.end));n>s?(s=n,o=[t]):n===s&&o.push(t)}if(o.length===1)return ti(e,o[0]);let c=n?.start;if(c===void 0)return ti(e,o[0]);let l=o[0],u=1/0;for(let e of o){let t=Math.abs(e.start-c);t<u&&(u=t,l=e)}return ti(e,l)}var ri=64;function ii(e,t,n){return{prefix:e.textBetween(Math.max(0,t-ri),t,`
|
|
2
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{Ht as r,S as i,Sn as a,Wt as o,_ as s,_n as c,bn as l,g as u,i as d,mn as f,y as p}from"./DocumentContext-CY-aaPA2.js";import{t as m}from"./react-f2sANaYj.js";import{n as h,r as g}from"./dist-Nvb76hAm.js";import{t as _}from"./compiler-runtime-BfE3aGVn.js";import{a as v,c as y,s as b,u as x}from"./terminal-input-events-BGPQuYMh.js";import{t as S}from"./utils-CPqDy6Hr.js";import{t as C}from"./button-RQ5o7P7w.js";import{i as w,n as T,t as E}from"./tooltip-x7BNUa3s.js";import{n as D,r as O,t as k}from"./collapsible-OhEmjTXw.js";import{E as A,at as j}from"./CodeMirrorPropInput-DTaNg1-M.js";import{t as M}from"./checkbox-DoJAOcMt.js";import{c as N,l as P,m as F,r as I,t as L}from"./dropdown-menu-AlVJ7dJz.js";import{i as R,n as z,o as B,s as V,t as H}from"./select-BUOcREjn.js";import{Aa as U,At as ee,F as W,I as G,Ir as K,Ka as q,La as J,Lr as Y,O as te,Oa as ne,Pr as re,Rn as ie,S as ae,Va as oe,Wr as se,Yt as ce,br as le,ft as ue,ja as de,ka as fe,pt as pe,ut as me,x as he,xt as ge,zn as _e}from"./dist-OxboORfH2.js";import{t as ve}from"./createLucideIcon-DihYAFEK.js";import{t as ye}from"./braces-BG3bQFuB.js";import{t as be}from"./chevron-down-BeptYHqQ.js";import{t as xe}from"./chevron-right-CABnKLlm.js";import{o as Se,r as Ce}from"./folder-config-api-BSMImK4t.js";import{t as we}from"./hash-BXtq910s.js";import{t as Te}from"./trash-2-WxyktwvM.js";import{t as Ee}from"./triangle-alert-C2yId37R.js";import{t as De}from"./x-xV4a4mi6.js";import{n as Oe}from"./dist-uN7pEWl0.js";import{t as ke}from"./input-Cm94Cun3.js";import{t as Ae}from"./dist-CzC3AWOn.js";import{f as je,x as Me}from"./doc-paths-lZOQ-mhw.js";import{K as Ne,U as Pe,b as Fe,m as Ie}from"./navigation-targets-GzXvLoSC.js";import{d as Le}from"./documents-events-5TI0rZAg.js";import{o as Re}from"./skill-scope-CmujX5gW.js";import{t as ze}from"./badge-C21d8Yhu.js";import{g as Be}from"./skills-api-BeHeMfn9.js";import{t as Ve}from"./external-link-Dvu-nzFi.js";import{t as He}from"./use-skills-C2EtCeGb.js";import{a as Ue,l as We,r as Ge,t as Ke}from"./selection-context-C8jYfARa.js";import{t as qe}from"./textarea-BzPGvj03.js";import{l as Je}from"./lint-config-client-CGN8hOQ_.js";import{a as Ye,d as Xe,f as Ze,i as Qe,l as $e,m as et,o as tt,p as nt,s as rt,t as it,u as at}from"./sortable.esm-Dngr9VJ1.js";import{C as ot,S as st,_ as ct,a as lt,b as ut,c as dt,g as ft,h as pt,i as mt,l as ht,n as gt,o as _t,r as vt,s as yt,t as bt,v as xt,w as St,x as Ct,y as wt}from"./format-B72MB8qy.js";var Tt=ve(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),Et=ve(`folder-git-2`,[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]),Dt=ve(`image-plus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),Ot=ve(`message-square-plus`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),kt=ve(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),At=ve(`square-check`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),jt=ve(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),Mt=ve(`unlink`,[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]),X=n(),Z=e(m(),1),Q=_(),Nt=`open-knowledge:doc-panel-tab`,Pt=null;function Ft(){let e=Pt;return Pt=null,e}function It(e,t=typeof window>`u`?new EventTarget:window){Pt=e,t.dispatchEvent(new CustomEvent(Nt,{detail:{tab:e}}))}function Lt(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail?.tab:void 0;n&&e(n)};return t.addEventListener(Nt,n),()=>t.removeEventListener(Nt,n)}var Rt=Object.defineProperty,zt=(e,t)=>{for(var n in t)Rt(e,n,{get:t[n],enumerable:!0})},Bt={};zt(Bt,{ActiveEmoji:()=>Er,Empty:()=>Tr,List:()=>xr,Loading:()=>Cr,Root:()=>rr,Search:()=>ir,SkinTone:()=>Dr,SkinToneSelector:()=>Sr,Viewport:()=>or});var Vt=`'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', EmojiSymbols, sans-serif`,Ht=[`none`,`light`,`medium-light`,`medium`,`medium-dark`,`dark`];function Ut(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Wt=2,Gt=null;function Kt(e){try{Gt??=document.createElement(`canvas`).getContext(`2d`,{willReadFrequently:!0})}catch{}if(!Gt||(queueMicrotask(()=>{Gt&&=null}),Gt.canvas.width=Wt,Gt.canvas.height=Wt,Gt.font=`2px ${Vt}`,Gt.textBaseline=`middle`,Gt.measureText(e).width>=Wt*2))return!1;Gt.fillStyle=`#00f`,Gt.fillText(e,0,0);let t=Gt.getImageData(0,0,Wt,Wt).data;Gt.clearRect(0,0,Wt,Wt),Gt.fillStyle=`#f00`,Gt.fillText(e,0,0);let n=Gt.getImageData(0,0,Wt,Wt).data;for(let e=0;e<Wt*Wt*4;e+=4)if(t[e]!==n[e]||t[e+1]!==n[e+1]||t[e+2]!==n[e+2])return!1;return!0}function qt(e,t,n){try{let r=e.getItem(t);if(!r)throw Error(`No value found for "${t}".`);return n(JSON.parse(r))}catch{return null}}function Jt(e,t,n){e.setItem(t,JSON.stringify(n))}function Yt(e){return t=>t===void 0?void 0:e(t)}function Xt(e){return t=>t===null?null:e(t)}function Zt(e){if(typeof e!=`string`)throw Error();return e}function Qt(e){if(typeof e!=`number`)throw Error();return e}function $t(e){if(typeof e!=`boolean`)throw Error();return e}function en(e){return t=>{if(typeof t!=`object`||!t)throw Error();let n={};for(let r in e){let i=t[r];i===void 0&&e[r](void 0),n[r]=e[r](i)}return n}}function tn(e){return t=>{if(!Array.isArray(t))throw Error();return t.length>0&&e(t[0]),t}}var nn=(e,t)=>`${e}/${t}/data.json`,rn=(e,t)=>`${e}/${t}/messages.json`,an=`bn.da.de.en-gb.en.es-mx.es.et.fi.fr.hi.hu.it.ja.ko.lt.ms.nb.nl.pl.pt.ru.sv.th.uk.vi.zh-hant.zh`.split(`.`),on=`en`,sn=e=>`frimousse/data/${e}`,cn=`frimousse/metadata`;async function ln(e,t){try{return(await fetch(e,{method:`HEAD`,signal:t})).headers.get(`etag`)}catch{return null}}async function un(e,t,n){let[{emojis:r,emojisEtag:i},{messages:a,messagesEtag:o}]=await Promise.all([fetch(nn(e,t),{signal:n}).then(async e=>({emojis:await e.json(),emojisEtag:e.headers.get(`etag`)})),fetch(rn(e,t),{signal:n}).then(async e=>({messages:await e.json(),messagesEtag:e.headers.get(`etag`)}))]);return{emojis:r,messages:a,emojisEtag:i,messagesEtag:o}}async function dn(e,t,n){let[r,i]=await Promise.all([ln(nn(e,t),n),ln(rn(e,t),n)]);return{emojisEtag:r,messagesEtag:i}}function fn(e){return e.skins?e.skins.filter(e=>typeof e.tone==`number`).reduce((e,t)=>{let n=Ht[t.tone];return e[n]=t.emoji,e},{}):void 0}async function pn(e,t,n){let{emojis:r,emojisEtag:i,messages:a,messagesEtag:o}=await un(e,t,n),s=a.subgroups.find(e=>e.key===`country-flag`||e.key===`subdivision-flag`),c=a.groups.filter(e=>e.key!==`component`),l=r.filter(e=>`group`in e),u=c.map(e=>({index:e.order,label:Ut(e.message)})),d=a.skinTones.reduce((e,t)=>(e[t.key]=Ut(t.message),e),{}),f={locale:t,emojis:l.map(e=>({emoji:e.emoji,category:e.group,version:e.version,label:Ut(e.label),tags:e.tags??[],countryFlag:s&&e.subgroup===s.order||void 0,skins:fn(e)})),categories:u,skinTones:d};return Jt(localStorage,sn(t),{data:f,metadata:{emojisEtag:i,messagesEtag:o}}),f}function mn(e,t){let n=new Map;for(let t of e)n.has(t.version)||n.set(t.version,t.emoji);let r=[...n.keys()].sort((e,t)=>t-e),i=r[0]??0,a=Kt(`🇪🇺`);if(typeof t==`number`)return{emojiVersion:t,countryFlags:a};for(let e of r)if(Kt(n.get(e)))return{emojiVersion:e,countryFlags:a};return{emojiVersion:i,countryFlags:a}}var hn=en({emojiVersion:Qt,countryFlags:$t}),gn=en({data:en({locale:Zt,emojis:tn(en({emoji:Zt,category:Qt,label:Zt,version:Qt,tags:tn(Zt),countryFlag:Yt($t),skins:Yt(en({light:Zt,"medium-light":Zt,medium:Zt,"medium-dark":Zt,dark:Zt}))})),categories:tn(en({index:Qt,label:Zt})),skinTones:en({light:Zt,"medium-light":Zt,medium:Zt,"medium-dark":Zt,dark:Zt})}),metadata:en({emojisEtag:Xt(Zt),messagesEtag:Xt(Zt)})});async function _n({locale:e,emojiVersion:t,emojibaseUrl:n,signal:r}){let i=typeof n==`string`?n:`https://cdn.jsdelivr.net/npm/emojibase-data@${typeof t==`number`?Math.floor(t):`latest`}`,a=qt(sessionStorage,cn,hn),o=qt(localStorage,sn(e),gn),s;if(!o)s=await pn(i,e,r);else if(a)s=o.data;else try{let{emojisEtag:t,messagesEtag:n}=await dn(i,e,r);s=!t||!n||t!==o.metadata.emojisEtag||n!==o.metadata.messagesEtag?await pn(i,e,r):o.data}catch{s=o.data}return a??=mn(s.emojis,t),Jt(sessionStorage,cn,a),{locale:e,emojis:s.emojis.filter(e=>{let t=e.version<=a.emojiVersion;return e.countryFlag?t&&a.countryFlags:t}),categories:s.categories,skinTones:s.skinTones}}function vn(e){return an.includes(e)?e:(console.warn(`Locale "${e}" is not supported, using "${on}" instead.`),on)}function yn(e){return Ht.includes(e)?e:(console.warn(`Skin tone "${e}" is not valid, using "none" instead.`),`none`)}function bn(e,t){let n=[];if(t<=0)return n;for(let r=0,i=e.length;r<i;r+=t)n.push(e.slice(r,r+t));return n}function xn(e,t){if(!t)return e;let n=t.toLowerCase().trim(),r=new WeakMap;return e.filter(e=>{let t=0;e.label.toLowerCase().includes(n)&&(t+=10);for(let r of e.tags)r.toLowerCase().includes(n)&&(t+=1);return t>0?(r.set(e,t),!0):!1}).sort((e,t)=>(r.get(t)??0)-(r.get(e)??0))}function Sn(e,t,n,r){let i=xn(e.emojis,r),a=[],o=[],s=[],c={},l=0,u=0;for(let e of i)c[e.category]||(c[e.category]=[]),c[e.category].push({emoji:n&&n!==`none`&&e.skins?e.skins[n]:e.emoji,label:e.label});for(let n of e.categories){let e=c[n.index];if(!e||e.length===0)continue;let r=bn(Array.from(e),t).map(e=>({categoryIndex:l,emojis:e}));a.push(...r),o.push({label:n.label,rowsCount:r.length,startRowIndex:u}),s.push(u),l++,u+=r.length}return{count:i.length,categories:o,categoriesStartRowIndices:s,rows:a,skinTones:e.skinTones}}function Cn(e){let t={},n=null,r=null,i=new Set,a=()=>{if(n){t=n,n=null;for(let e of i)e(t)}r=null},o=()=>n??t,s=e=>{n??=t,Object.assign(n,typeof e==`function`?e(o()):e),r||=requestAnimationFrame(a)};return t=e(s,o),{get:o,set:s,subscribe:e=>(i.add(e),()=>i.delete(e))}}function wn(e){let[t]=(0,Z.useState)(e);return t}function Tn(e){let t=(0,Z.createContext)(null);return{useStore:()=>{let n=(0,Z.useContext)(t);if(!n)throw Error(e);return n},Provider:({store:e,children:n})=>(0,X.jsx)(t.Provider,{value:e,children:n})}}function En(e,t,n=Object.is){let[r,i]=(0,Z.useState)(()=>t(e.get()));return(0,Z.useEffect)(()=>e.subscribe(()=>{let r=t(e.get());i(e=>n(e,r)?e:r)}),[e,t,n]),(0,Z.useDebugValue)(r),r}function Dn(e,t,n){return En(e,(0,Z.useCallback)(e=>e[t],[t]),n)}var On=2;function kn(e,t,n,r,i){let a=0;return Cn((o,s)=>({locale:t,columns:n,sticky:r,skinTone:i,onEmojiSelect:e,data:null,search:``,interaction:`none`,activeColumnIndex:0,activeRowIndex:0,rowHeight:null,categoryHeaderHeight:null,viewportWidth:null,viewportHeight:null,viewportCurrentCategoryIndex:null,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0,rootRef:null,searchRef:null,viewportRef:null,listRef:null,updateViewportState:e=>{let t=s(),n=e?.data??t.data,r=e?.categoryHeaderHeight??t.categoryHeaderHeight,i=e?.rowHeight??t.rowHeight,c=e?.viewportHeight??t.viewportHeight;if(!n||n.rows.length===0||!r||!i||!c)return o({...e,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0});let l=0,u=0;for(let e of n.categories)if(u++*r+e.startRowIndex*i<a)l+=r;else break;let d=n.categories.length*r+n.rows.length*i,f=Math.floor(On*i/2),p=Math.ceil(On*i/2),m=Math.min(a-l-f,d-c),h=m+c+p,g=Math.max(0,Math.floor(m/i)),_=Math.min(n.rows.length-1,Math.ceil(h/i)),v=n.rows[g]?.categoryIndex;return o(v===void 0&&e?e:{...e,viewportStartCategoryIndex:v,viewportStartRowIndex:g,viewportEndRowIndex:_})},onDataChange:e=>{s().updateViewportState({data:e,activeColumnIndex:0,activeRowIndex:0})},onSearchChange:e=>{o({search:e,interaction:e?`keyboard`:`none`})},onActiveEmojiChange:(e,t,n)=>{if(o({interaction:e,activeColumnIndex:t,activeRowIndex:n}),e!==`keyboard`)return;let{listRef:r,viewportRef:i,sticky:c,rowHeight:l,viewportHeight:u,categoryHeaderHeight:d}=s(),f=r?.current,p=i?.current;if(!f||!p||!l||!d||!u)return;let m=n;m===0&&p.scrollTo({top:0,behavior:`instant`});let h=f.querySelector(`[aria-rowindex="${m}"]`);if(!(h instanceof HTMLElement))return;let g=h.offsetTop,_=getComputedStyle(h),v=Number.parseFloat(_.scrollMarginTop),y=Number.parseFloat(_.scrollMarginBottom),b=a+v;c&&g<a+u/2&&(b+=d);let x=b+u-y;(g<b||g+l>x)&&p.scrollTo({top:Math.max(g<b+d?g-Math.max(c?d:0,v):g-u+l+y,0),behavior:`instant`})},onActiveEmojiReset:()=>{o({interaction:`none`,activeColumnIndex:0,activeRowIndex:0})},onRowHeightChange:e=>{s().updateViewportState({rowHeight:e})},onCategoryHeaderHeightChange:e=>{s().updateViewportState({categoryHeaderHeight:e})},onViewportSizeChange:(e,t)=>{s().updateViewportState({viewportWidth:e,viewportHeight:t})},onViewportScroll:e=>{a=e,s().updateViewportState()}}))}var{useStore:An,Provider:jn}=Tn(`EmojiPicker.Root is missing.`);function Mn(e){return e.search}function Nn(e){return e.interaction===`none`?void 0:e.data?.rows[e.activeRowIndex]?.emojis[e.activeColumnIndex]}function Pn(e){return e.data===void 0||typeof e.data?.count==`number`&&e.data.count===0}function Fn(e){return e.data===null||e.viewportHeight===null||e.rowHeight===null||e.categoryHeaderHeight===null}function In(e){return e.data?.rows.length}function Ln(e){return e.data?.categories.length}function Rn(e){return e.data?.categoriesStartRowIndices}function zn(e){return e.data?.skinTones}function Bn(e,t){return e?.emoji===t?.emoji}function Vn(e,t){return e?.categoryIndex!==t?.categoryIndex||e?.emojis.length!==t?.emojis.length?!1:!!e?.emojis.every((e,n)=>Bn(e,t?.emojis[n]))}var Hn=``,Un=/\p{Emoji_Modifier_Base}/u,Wn=/\uFE0F$/,Gn=/\u{1F3FB}|\u{1F3FC}|\u{1F3FD}|\u{1F3FE}|\u{1F3FF}/gu,Kn={light:`🏻`,"medium-light":`🏼`,medium:`🏽`,"medium-dark":`🏾`,dark:`🏿`};function qn(e,t){if(!e.split(Hn).some(e=>Un.test(e)))return e;let n=e.split(Hn).map(e=>e.replace(Gn,``)).join(Hn);return t===`none`?n:n.split(Hn).map((e,n,r)=>{let i=r.length>1;return!Un.test(e)||i&&e===`🤝`?e:e.replace(Wn,``)+Kn[t]}).join(Hn)}function Jn(e){return Ht.map(t=>({skinTone:t,emoji:qn(e,t)}))}function Yn(){return(0,Z.useDeferredValue)(En(An(),Nn,Bn))}function Xn(e=`✋`){let t=An(),n=Dn(t,`skinTone`),r=(0,Z.useMemo)(()=>Jn(e),[e]);return[n,(0,Z.useCallback)(e=>{t.set({skinTone:e})},[]),r]}function Zn(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||typeof t!=`object`||e===null||t===null||Array.isArray(e)!==Array.isArray(t))return!1;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length?n.every(n=>n in t&&e[n]===t[n]):!1}function Qn(...e){}function $n(e,t){let n=null;if(typeof window.requestIdleCallback==`function`)n=window.requestIdleCallback(e,t);else{let r=Date.now();n=window.setTimeout(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,(t?.timeout??50)-(Date.now()-r))})},10)}return()=>{typeof window.cancelIdleCallback==`function`?window.cancelIdleCallback(n):window.clearTimeout(n)}}var er=typeof window<`u`?Z.useLayoutEffect:Z.useEffect;function tr(e){let t=(0,Z.useRef)(e);return er(()=>{t.current=e}),(0,Z.useCallback)((...e)=>t.current(...e),[])}function nr({emojiVersion:e,emojibaseUrl:t}){let[n,r]=(0,Z.useState)(void 0),i=An(),a=Dn(i,`locale`),o=Dn(i,`columns`),s=Dn(i,`skinTone`),c=Dn(i,`search`);return(0,Z.useEffect)(()=>{let n=new AbortController,i=n.signal;return _n({locale:a,emojiVersion:e,emojibaseUrl:t,signal:i}).then(e=>{r(e)}).catch(e=>{i.aborted||console.error(e)}),()=>{n.abort()}},[e,t,a]),(0,Z.useEffect)(()=>{if(n)return $n(()=>{i.get().onDataChange(Sn(n,o,s,c))},{timeout:100})},[n,o,s,c]),null}var rr=(0,Z.forwardRef)(({locale:e=`en`,columns:t=9,skinTone:n=`none`,onEmojiSelect:r=Qn,emojiVersion:i,emojibaseUrl:a,onFocusCapture:o,onBlurCapture:s,children:c,style:l,sticky:u=!0,...d},f)=>{let p=tr(r),m=wn(()=>kn(p,vn(e),t,u,yn(n))),[h,g]=(0,Z.useState)(!1),_=(0,Z.useRef)(null),v=(0,Z.useCallback)(e=>{e&&(_.current=e,m.set({rootRef:_}))},[]);er(()=>{m.set({locale:vn(e)})},[e]),er(()=>{m.set({columns:t})},[t]),er(()=>{m.set({sticky:u})},[u]),er(()=>{m.set({skinTone:yn(n)})},[n]);let y=(0,Z.useCallback)(e=>{o?.(e);let{searchRef:t,viewportRef:n}=m.get(),r=e.target===t?.current||e.target.hasAttribute(`frimousse-search`),i=e.target===n?.current||e.target.hasAttribute(`frimousse-viewport`);e.isDefaultPrevented()||(g(r||i),e.isDefaultPrevented()||(g(r||i),i?m.get().onActiveEmojiChange(`keyboard`,0,0):r&&m.get().search===``&&m.set({interaction:`none`})))},[o]),b=(0,Z.useCallback)(e=>{s?.(e),!e.isDefaultPrevented()&&!e.currentTarget.contains(e.relatedTarget)&&g(!1)},[s]);return er(()=>{h||m.get().onActiveEmojiReset()},[h]),(0,Z.useImperativeHandle)(f,()=>_.current),(0,Z.useEffect)(()=>{if(!h)return;function e(e){if(e.defaultPrevented||!e.key.startsWith(`Arrow`)&&e.key!==`Enter`)return;let{data:t,onEmojiSelect:n,onActiveEmojiChange:r,interaction:i,activeColumnIndex:a,activeRowIndex:o}=m.get();if(e.key===`Enter`){let t=Nn(m.get());t&&(e.preventDefault(),n(t))}if(e.key.startsWith(`Arrow`)){let n=a,s=o;if(e.preventDefault(),i!==`none`){if(t?.rows&&t.rows.length>0)switch(e.key){case`ArrowLeft`:if(n===0){let e=s-1,r=t.rows[e];r&&(s=e,n=r.emojis.length-1)}else --n;break;case`ArrowRight`:if(n===t.rows[s].emojis.length-1){let e=s+1;t.rows[e]&&(s=e,n=0)}else n+=1;break;case`ArrowUp`:{let e=t.rows[s-1];e&&(--s,e.emojis[n]||(n=e.emojis.length-1));break}case`ArrowDown`:{let e=t.rows[s+1];e&&(s+=1,e.emojis[n]||(n=e.emojis.length-1));break}}r(`keyboard`,n,s)}else r(`keyboard`,0,0)}}return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[h]),er(()=>{let e=null,t=null,n=null,r=null,i=m.subscribe(i=>{_.current&&(e!==i.viewportWidth&&(e=i.viewportWidth,_.current.style.setProperty(`--frimousse-viewport-width`,`${i.viewportWidth}px`)),t!==i.viewportHeight&&(t=i.viewportHeight,_.current.style.setProperty(`--frimousse-viewport-height`,`${i.viewportHeight}px`)),n!==i.rowHeight&&(n=i.rowHeight,_.current.style.setProperty(`--frimousse-row-height`,`${i.rowHeight}px`)),r!==i.categoryHeaderHeight&&(r=i.categoryHeaderHeight,_.current.style.setProperty(`--frimousse-category-header-height`,`${i.categoryHeaderHeight}px`)))}),{viewportWidth:a,viewportHeight:o,rowHeight:s,categoryHeaderHeight:c}=m.get();return a&&_.current.style.setProperty(`--frimousse-viewport-width`,`${a}px`),o&&_.current.style.setProperty(`--frimousse-viewport-height`,`${o}px`),s&&_.current.style.setProperty(`--frimousse-row-height`,`${s}px`),c&&_.current.style.setProperty(`--frimousse-category-header-height`,`${c}px`),i},[]),(0,X.jsx)(`div`,{"data-focused":h?``:void 0,"frimousse-root":``,onBlurCapture:b,onFocusCapture:y,...d,ref:v,style:{"--frimousse-emoji-font":Vt,...l},children:(0,X.jsxs)(jn,{store:m,children:[(0,X.jsx)(nr,{emojiVersion:i,emojibaseUrl:a}),c]})})}),ir=(0,Z.forwardRef)(({value:e,defaultValue:t,onChange:n,...r},i)=>{let a=An(),o=(0,Z.useRef)(null),s=(0,Z.useCallback)(e=>{e&&(o.current=e,a.set({searchRef:o}))},[]),c=typeof e==`string`,l=(0,Z.useRef)(c);(0,Z.useEffect)(()=>{l.current=c},[c]),er(()=>{a.set({search:typeof e==`string`?e:typeof t==`string`?t:``})},[]),er(()=>{typeof e==`string`&&a.get().onSearchChange(e)},[e]);let u=(0,Z.useCallback)(e=>{n?.(e),e.isDefaultPrevented()||a.get().onSearchChange(e.target.value)},[n]);return(0,Z.useImperativeHandle)(i,()=>o.current),(0,X.jsx)(`input`,{autoCapitalize:`off`,autoComplete:`off`,autoCorrect:`off`,enterKeyHint:`done`,"frimousse-search":``,placeholder:`Search…`,spellCheck:!1,type:`search`,...r,defaultValue:t,onChange:u,ref:s,value:e})}),ar=(0,Z.memo)(()=>{let e=Yn();return e?(0,X.jsx)(`div`,{"aria-live":`polite`,style:{border:0,clip:`rect(0, 0, 0, 0)`,height:1,margin:-1,overflow:`hidden`,padding:0,position:`absolute`,whiteSpace:`nowrap`,width:1,wordWrap:`normal`},children:e.label}):null}),or=(0,Z.forwardRef)(({children:e,onScroll:t,onKeyDown:n,style:r,...i},a)=>{let o=An(),s=(0,Z.useRef)(null),c=(0,Z.useCallback)(e=>{e&&(s.current=e,o.set({viewportRef:s}))},[]),l=En(o,In),u=En(o,Ln),d=(0,Z.useCallback)(e=>{t?.(e),o.get().onViewportScroll(e.currentTarget.scrollTop)},[t]);return er(()=>{if(!s.current)return;let e=new ResizeObserver(([e])=>{let t=e?.borderBoxSize[0]?.inlineSize??0,n=e?.borderBoxSize[0]?.blockSize??0,{onViewportSizeChange:r,viewportHeight:i,viewportWidth:a}=o.get();(i!==n||a!==t)&&r(t,n)});return e.observe(s.current),o.get().onViewportSizeChange(s.current.offsetWidth,s.current.clientHeight),()=>{e.disconnect()}},[]),(0,Z.useImperativeHandle)(a,()=>s.current),(0,X.jsxs)(`div`,{"frimousse-viewport":``,...i,onScroll:d,ref:c,style:{position:`relative`,boxSizing:`border-box`,contain:`layout paint`,containIntrinsicSize:typeof l==`number`&&typeof u==`number`?`var(--frimousse-viewport-width, auto) calc(${l} * var(--frimousse-row-height) + ${u} * var(--frimousse-category-header-height))`:void 0,overflowY:`auto`,overscrollBehavior:`contain`,scrollbarGutter:`stable`,willChange:`scroll-position`,...r},children:[(0,X.jsx)(ar,{}),e]})});function sr(e,t,n){return{emoji:{...e,isActive:n},role:`gridcell`,"aria-colindex":t,"aria-selected":n||void 0,"aria-label":e.label,"data-active":n?``:void 0,"frimousse-emoji":``,style:{fontFamily:`var(--frimousse-emoji-font)`},tabIndex:-1}}function cr(e,t=!1){return{role:t?void 0:`row`,"aria-rowindex":t?void 0:e,"frimousse-row":``,style:{contain:t?void 0:`content`,height:t?void 0:`var(--frimousse-row-height)`,display:`flex`}}}function lr(e,t){return{"frimousse-category":``,style:{contain:`content`,top:t?`calc(${e} * var(--frimousse-category-header-height) + ${t.startRowIndex} * var(--frimousse-row-height))`:void 0,height:t?`calc(var(--frimousse-category-header-height) + ${t.rowsCount} * var(--frimousse-row-height))`:void 0,width:`100%`,pointerEvents:`none`,position:`absolute`}}}function ur(e,t=!1,n=!0){return{category:e,"frimousse-category-header":``,style:{contain:t?void 0:`layout paint`,height:t?void 0:`var(--frimousse-category-header-height)`,pointerEvents:`auto`,position:n?`sticky`:void 0,top:0}}}function dr(e,t,n,r){return{"frimousse-list-sizer":``,style:{position:`relative`,boxSizing:`border-box`,height:`calc(${e} * var(--frimousse-row-height) + ${t} * var(--frimousse-category-header-height))`,paddingTop:`calc(${n} * var(--frimousse-row-height) + ${r} * var(--frimousse-category-header-height))`}}}function fr(e,t,n){return{"aria-colcount":e,"aria-rowcount":t,"frimousse-list":``,style:{"--frimousse-list-columns":e,...n},role:`grid`}}function pr(e){e.preventDefault()}var mr=(0,Z.memo)(({Emoji:e,emoji:t,columnIndex:n,rowIndex:r})=>{let i=An(),a=En(i,e=>Nn(e)?.emoji===t.emoji),o=(0,Z.useCallback)(()=>{i.get().onEmojiSelect(t)},[t]),s=(0,Z.useCallback)(()=>{i.get().onActiveEmojiChange(`pointer`,n,r)},[n,r]),c=(0,Z.useCallback)(()=>{i.get().onActiveEmojiReset()},[]);return(0,X.jsx)(e,{...sr(t,n,a),onClick:o,onPointerDown:pr,onPointerEnter:s,onPointerLeave:c})}),hr=(0,Z.memo)(({Row:e,Emoji:t,rowIndex:n})=>{let r=En(An(),e=>e.data?.rows[n],Vn);return r?(0,X.jsx)(e,{...cr(n),children:r.emojis.map((e,r)=>(0,X.jsx)(mr,{Emoji:t,columnIndex:r,emoji:e,rowIndex:n},e.label))}):null}),gr=(0,Z.memo)(({CategoryHeader:e,categoryIndex:t})=>{let n=An(),r=En(n,e=>e.data?.categories[t],Zn),i=Dn(n,`sticky`);return r?(0,X.jsx)(`div`,{...lr(t,r),children:(0,X.jsx)(e,{...ur({label:r.label},!1,i)})}):null}),_r=(0,Z.memo)(({CategoryHeader:e,Row:t,Emoji:n})=>{let r=(0,Z.useRef)(null),i=An(),a=Dn(i,`columns`),o=(0,Z.useMemo)(()=>Array(a).fill({emoji:`🙂`,label:``}),[a]),s=(0,Z.useMemo)(()=>({label:`Category`}),[]),c=(0,Z.useRef)(null),l=(0,Z.useRef)(null);return er(()=>{let e=r.current?.parentElement?.parentElement;if(!e||!c.current||!l.current)return;let t=new ResizeObserver(e=>{for(let t of e){let e=t.contentRect.height,{onRowHeightChange:n,onCategoryHeaderHeightChange:r,rowHeight:a,categoryHeaderHeight:o}=i.get();t.target===c.current&&a!==e&&n(e),t.target===l.current&&o!==e&&r(e)}});t.observe(e),t.observe(c.current),t.observe(l.current);let{onRowHeightChange:n,onCategoryHeaderHeightChange:a}=i.get();return n(c.current.clientHeight),a(l.current.clientHeight),()=>{t.disconnect()}},[]),(0,X.jsxs)(`div`,{"aria-hidden":!0,ref:r,style:{height:0,visibility:`hidden`},children:[(0,X.jsx)(`div`,{"frimousse-row-sizer":``,ref:c,children:(0,X.jsx)(t,{...cr(-1,!0),children:o.map((e,t)=>(0,X.jsx)(n,{...sr(e,t,!1)},t))})}),(0,X.jsx)(`div`,{...lr(-1),children:(0,X.jsx)(`div`,{"frimousse-category-header-sizer":``,ref:l,children:(0,X.jsx)(e,{...ur(s,!0)})})})]})});function vr({category:e,...t}){return(0,X.jsx)(`div`,{...t,children:e.label})}function yr({emoji:e,...t}){return(0,X.jsx)(`button`,{type:`button`,...t,children:e.emoji})}function br({...e}){return(0,X.jsx)(`div`,{...e})}var xr=(0,Z.forwardRef)(({style:e,components:t,...n},r)=>{let i=An(),a=(0,Z.useRef)(null),o=(0,Z.useCallback)(e=>{e&&(a.current=e,i.set({listRef:a}))},[]),s=t?.CategoryHeader??vr,c=t?.Emoji??yr,l=t?.Row??br,u=Dn(i,`columns`),d=Dn(i,`viewportStartRowIndex`),f=Dn(i,`viewportEndRowIndex`),p=En(i,In),m=En(i,Rn,Zn),h=(0,Z.useMemo)(()=>m?.filter(e=>e<d).length??0,[m,d]),g=m?.length??0;return(0,Z.useImperativeHandle)(r,()=>a.current),!p||!m||g===0?(0,X.jsx)(`div`,{...fr(u,0,e),...n,children:(0,X.jsx)(`div`,{...dr(0,0,0,0),children:(0,X.jsx)(_r,{CategoryHeader:s,Emoji:c,Row:l})})}):(0,X.jsx)(`div`,{...fr(u,p,e),...n,ref:o,children:(0,X.jsxs)(`div`,{...dr(p,g,d,h),children:[(0,X.jsx)(_r,{CategoryHeader:s,Emoji:c,Row:l}),Array.from({length:f-d+1},(e,t)=>{let n=d+t;return(0,X.jsxs)(Z.Fragment,{children:[m.indexOf(n)>=0&&(0,X.jsx)(`div`,{style:{height:`var(--frimousse-category-header-height)`}}),(0,X.jsx)(hr,{Emoji:c,Row:l,rowIndex:n})]},n)}),Array.from({length:g},(e,t)=>(0,X.jsx)(gr,{CategoryHeader:s,categoryIndex:t},t))]})})}),Sr=(0,Z.forwardRef)(({emoji:e,onClick:t,"aria-label":n=`Change skin tone`,...r},i)=>{let a=En(An(),zn,Zn),[o,s,c]=Xn(e),l=(0,Z.useMemo)(()=>Math.max(0,c.findIndex(e=>e.skinTone===o)),[o,c]),u=c[l],d=c[(l+1)%c.length].skinTone,f=o===`none`?void 0:a?.[o],p=d===`none`?void 0:a?.[d],m=(0,Z.useCallback)(e=>{t?.(e),e.isDefaultPrevented()||s(d)},[t,s,d]);return(0,X.jsx)(`button`,{type:`button`,...r,"aria-label":n+(p?` (${p})`:``),"aria-live":`polite`,"aria-valuetext":f,"frimousse-skin-tone-selector":``,onClick:m,ref:i,children:u.emoji})});function Cr({children:e,...t}){return En(An(),Fn)?(0,X.jsx)(`span`,{"frimousse-loading":``,...t,children:e}):null}function wr({children:e}){return e({search:En(An(),Mn)})}function Tr({children:e,...t}){return En(An(),Pn)?(0,X.jsx)(`span`,{"frimousse-empty":``,...t,children:typeof e==`function`?(0,X.jsx)(wr,{children:e}):e}):null}function Er({children:e}){return e({emoji:Yn()})}function Dr({children:e,emoji:t}){let[n,r,i]=Xn(t);return e({skinTone:n,setSkinTone:r,skinToneVariations:i})}rr.displayName=`EmojiPicker.Root`,ir.displayName=`EmojiPicker.Search`,or.displayName=`EmojiPicker.Viewport`,xr.displayName=`EmojiPicker.List`,Cr.displayName=`EmojiPicker.Loading`,Tr.displayName=`EmojiPicker.Empty`,Sr.displayName=`EmojiPicker.SkinToneSelector`,Er.displayName=`EmojiPicker.ActiveEmoji`,Dr.displayName=`EmojiPicker.SkinTone`;var Or={CategoryHeader:({category:e,...t})=>(0,X.jsx)(`div`,{...t,className:`bg-popover px-3 pt-3 pb-1.5 font-medium text-muted-foreground text-xs`,children:e.label}),Row:({children:e,...t})=>(0,X.jsx)(`div`,{...t,className:`scroll-my-1.5 px-1.5`,children:e}),Emoji:({emoji:e,...t})=>(0,X.jsx)(`button`,{type:`button`,...t,className:`flex size-8 items-center justify-center rounded-md text-lg data-[active]:bg-accent`,children:e.emoji})};function kr(e){let t=(0,Q.c)(11),{onSelect:n}=e,{_:r}=g(),i;t[0]===n?i=t[1]:(i=e=>{let{emoji:t}=e;return n(t)},t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=r({id:`EarrCe`}),t[2]=r,t[3]=a);let o;t[4]===a?o=t[5]:(o=(0,X.jsx)(Bt.Search,{className:`z-10 mx-2 mt-2 rounded-md border bg-background px-2.5 py-2 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring`,placeholder:a,autoFocus:!0}),t[4]=a,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,X.jsx)(Bt.Loading,{className:`absolute inset-0 flex items-center justify-center text-muted-foreground text-sm`,children:(0,X.jsx)(h,{id:`yQE2r9`})}),t[6]=s):s=t[6];let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,X.jsxs)(Bt.Viewport,{className:`relative flex-1 overscroll-contain outline-none`,children:[s,(0,X.jsx)(Bt.Empty,{className:`absolute inset-0 flex items-center justify-center text-muted-foreground text-sm`,children:(0,X.jsx)(h,{id:`z1uNN0`})}),(0,X.jsx)(Bt.List,{className:`select-none pb-1.5`,components:Or})]}),t[7]=c):c=t[7];let l;return t[8]!==i||t[9]!==o?(l=(0,X.jsxs)(Bt.Root,{className:`isolate flex h-[326px] w-[320px] flex-col bg-popover text-popover-foreground`,onEmojiSelect:i,children:[o,c]}),t[8]=i,t[9]=o,t[10]=l):l=t[10],l}var Ar=`245,158,11`,jr=Ar,Mr={fill:.22,line:.7},Nr={fill:.45,line:1},Pr=.45;function Fr(e,t){let n=jr,{fill:r,line:i}=t?Nr:Mr;return[`border-radius:2px`,`padding-bottom:1px`,...e.id===null?[]:[`cursor:pointer`],`background-color:rgba(${n},${r})`,`box-shadow:inset 0 -2px 0 rgba(${n},${i})`,``].join(`;`)}function Ir(e){return e.map(e=>e.id??`·`).join(`|`)}function Lr(e){let t=null;for(let n of e)n.id!==null&&(t===null||n.to-n.from<t.to-t.from)&&(t=n);return t?.id??null}function Rr(e,t){return e.id===null||e.id===t}function zr(e,t=null){let n=[...e].filter(e=>e.from<e.to).sort((e,t)=>e.from-t.from||e.to-t.to||(e.id??``).localeCompare(t.id??``));if(n.length===0)return[];let r=[...new Set(n.flatMap(e=>[e.from,e.to]))].sort((e,t)=>e-t),i=[],a=null,o=()=>{if(a===null)return;let e=a.covering.find(e=>Rr(e,t));i.push({from:a.from,to:a.to,style:Fr(e??a.covering[0],e!==void 0),threadId:Lr(a.covering)}),a=null};for(let e=0;e<r.length-1;e++){let t=r[e],i=r[e+1],s=n.filter(e=>e.from<=t&&e.to>=i);if(s.length===0){o();continue}if(a!==null&&a.to===t&&Ir(a.covering)===Ir(s)){a.to=i;continue}o(),a={from:t,to:i,covering:s}}return o(),i}var Br=`data-comment-reveal`;function Vr(e){return typeof CSS<`u`&&CSS.escape?CSS.escape(e):e}function Hr(e){return e===``?null:document.querySelector(`[data-testid="property-row"][data-key="${Vr(e)}"]`)}function Ur(e){let t=Hr(e);if(t===null)return null;let n=t.getBoundingClientRect();return n.height===0&&n.width===0?null:n}function Wr(e){Hr(e)?.scrollIntoView({block:`center`,behavior:`smooth`})}function Gr(e){if(e.quote===``)return!1;let t=e.path.length===0?e.key:e.path[e.path.length-1],n=Array.from(document.querySelectorAll(`[data-testid="property-row"][data-key="${Vr(String(t))}"]`)),r=Array.from(document.querySelectorAll(`[data-testid="property-row"]`));for(let t of[...n,...r]){let n=t.querySelector(`textarea, input`);if(n===null)continue;let r=Kr(n.value,e.quote,e.start,e.end);if(r!==null)return t.scrollIntoView({block:`center`,behavior:`smooth`}),n.focus(),n.setSelectionRange(r.start,r.end),qr(n),!0}return!1}function Kr(e,t,n,r){if(n!==void 0&&r!==void 0&&e.slice(n,r)===t)return{start:n,end:r};let i=e.indexOf(t);return i<0?null:{start:i,end:i+t.length}}function qr(e){e.style.setProperty(`--comment-reveal-fill`,`rgba(${Ar},${Pr})`),e.setAttribute(Br,`true`);let t=()=>{e.removeAttribute(Br),e.style.removeProperty(`--comment-reveal-fill`)};e.addEventListener(`blur`,t,{once:!0}),e.addEventListener(`pointerdown`,t,{once:!0}),e.addEventListener(`keydown`,t,{once:!0})}function Jr(e){let t=``,n=[];return e.descendants((e,r)=>{if(e.isText&&e.text)for(let i=0;i<e.text.length;i++)t+=e.text[i],n.push(r+i);return!0}),{text:t,positions:n}}function Yr(e,t){let n=[];if(t===``)return n;let r=e.indexOf(t);for(;r!==-1;)n.push(r),r=e.indexOf(t,r+1);return n}function Xr(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[e.length-1-r]===t[t.length-1-r];)r+=1;return r}function Zr(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r+=1;return r}var Qr=4,$r=64;function ei(e,t,n){let r=n?.prefix??``,i=n?.suffix??``;if(r===``&&i===``)return null;let a=r===``?[0]:_e(e,r,{syntaxIn:`needle`}).map(e=>e.end),o=i===``?[e.length]:_e(e,i,{syntaxIn:`needle`}).map(e=>e.start);if(a.length!==1||o.length!==1)return null;let s=a[0],c=o[0];for(;s<c&&/\s/.test(e[s]??``);)s+=1;for(;c>s&&/\s/.test(e[c-1]??``);)--c;if(c<=s)return null;let l=Math.max(t.length*Qr,t.length+$r);return c-s>l?null:{start:s,end:c}}function ti(e,t){let n=e.positions[t.start],r=e.positions[t.end-1];return n==null||r==null?null:{from:n,to:r+1}}function ni(e,t,n){if(t.length===0)return null;let r=Yr(e.text,t).map(e=>({start:e,end:e+t.length}));if(r.length===0&&(r=_e(e.text,t,{syntaxIn:`needle`})),r.length===0){let r=ei(e.text,t,n);return r===null?null:ti(e,r)}if(r.length===1)return ti(e,r[0]);let i=n?.prefix??``,a=n?.suffix??``,o=[],s=-1;for(let t of r){let n=Xr(i,e.text.slice(0,t.start))+Zr(a,e.text.slice(t.end));n>s?(s=n,o=[t]):n===s&&o.push(t)}if(o.length===1)return ti(e,o[0]);let c=n?.start;if(c===void 0)return ti(e,o[0]);let l=o[0],u=1/0;for(let e of o){let t=Math.abs(e.start-c);t<u&&(u=t,l=e)}return ti(e,l)}var ri=64;function ii(e,t,n){return{prefix:e.textBetween(Math.max(0,t-ri),t,`
|
|
3
3
|
`),suffix:e.textBetween(n,Math.min(e.content.size,n+ri),`
|
|
4
4
|
`)}}function ai(e,t,n){return ni(Jr(e),t,n)}var oi=220,si=24;function ci(e){let t=e.viewTop+e.insetTop,n=e.viewBottom-oi;return e.anchorTop>=t&&e.anchorBottom<=n?0:e.anchorTop-(t+si)}function li(e){let t=e?.parentElement??null;for(;t;){let e=getComputedStyle(t).overflowY;if(e===`auto`||e===`scroll`)return t;t=t.parentElement}return null}function ui(e){let t=Number.parseFloat(getComputedStyle(e).scrollPaddingTop);return Number.isFinite(t)?t:0}function di(e,t){let n=A(e);if(!n)return;let r=li(n.dom);if(!r){e.commands.scrollIntoView();return}let i,a;try{i=n.coordsAtPos(t.from),a=n.coordsAtPos(t.to)}catch{return}let o=r.getBoundingClientRect(),s=ci({anchorTop:i.top,anchorBottom:Math.max(i.bottom,a.bottom),viewTop:o.top,viewBottom:o.bottom,insetTop:ui(r)});if(s===0)return;let c=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;r.scrollTo({top:r.scrollTop+s,behavior:c?`auto`:`smooth`})}async function fi(e,t){let n=await fetch(e,{...t,headers:{"content-type":`application/json`,...t?.headers}}),r=await n.json().catch(()=>null);if(!n.ok){let e=ue.safeParse(r);throw Error(e.success?e.data.title??e.data.detail:`comments request failed (${n.status})`)}return r}function pi(e){return fi(`/api/comment`,{method:`POST`,body:JSON.stringify(e)})}function mi(e,t){let n=e.safeParse(t);if(!n.success)throw Error(`The server returned a response this build cannot read.`);return n.data}function hi(e){let t=he.safeParse(e);if(!t.success)throw Error(`The server returned a comment thread this build cannot read.`);return t.data}function gi(e){let t=[];for(let n of e){let e=he.safeParse(n);e.success?t.push(e.data):console.warn(`[comments] skipped a thread this build cannot read`,e.error.issues)}return t}async function _i(e){let{threads:t}=await fi(e===void 0?`/api/comments`:`/api/comments?doc=${encodeURIComponent(e)}`);return gi(t)}function vi(e){return fi(`/api/comments`,{method:`POST`,body:JSON.stringify(e)}).then(hi)}function yi(e,t){return pi({action:`edit`,id:e,body:t}).then(hi)}function bi(e){return pi({action:`resolve`,id:e}).then(hi)}function xi(e){return pi({action:`reopen`,id:e}).then(hi)}function Si(e,t){return pi({action:`replace`,id:e,...t}).then(hi)}function Ci(e){return pi({action:`queue`,id:e}).then(e=>mi(pe,e))}function wi(e){return pi({action:`unqueue`,id:e}).then(hi)}function Ti(e){return fi(`/api/comment?id=${encodeURIComponent(e)}`,{method:`DELETE`}).then(e=>mi(te,e))}function Ei(e){return pi({action:`dispatch-prepare-batch`,ids:e}).then(e=>mi(me,e))}function Di(e){return pi({action:`dispatch-complete-batch`,ids:e}).then(e=>mi(ae,e))}var Oi=`open-knowledge:comments-queue-scope`,ki=typeof window>`u`?new EventTarget:window,Ai=!1;function ji(){let e=Ai;return Ai=!1,e}function Mi(e){let t=()=>{Ai=!1,e()};return ki.addEventListener(Oi,t),()=>ki.removeEventListener(Oi,t)}function Ni(){Ai=!0,It(`comments`),ki.dispatchEvent(new Event(Oi))}var Pi=Object.freeze([]),Fi=Object.freeze([]),Ii=new Map,Li=[],Ri=new Set,zi=new Set,Bi=!1,Vi=new Set,Hi=0,Ui=0;function Wi(){for(let e of Ri)e()}function Gi(){Hi+=1,Wi()}function Ki(){Ui+=1,Wi()}function qi(e){return{id:e.threadId,docName:e.docName,target:e.target,anchor:e.anchor===null?null:{quote:e.anchor.exact,prefix:e.anchor.prefix,suffix:e.anchor.suffix,start:e.anchor.start,end:e.anchor.end},status:e.state===`anchored`?`open`:e.state,body:e.latestComment,createdAt:e.createdAt,queued:e.queued}}async function Ji(){return(await _i()).map(qi).sort((e,t)=>t.createdAt-e.createdAt)}async function Yi(e){e!==void 0&&zi.add(e);let t=await Ji();Li=t,Bi=!0;for(let e of zi)Ii.set(e,t.filter(t=>t.docName===e));Gi()}var Xi=!1;function Zi(){Xi||typeof window>`u`||(Xi=!0,Le(e=>{e.includes(`comments`)&&Yi().catch(()=>void 0)}))}function Qi(e){Zi(),!zi.has(e)&&(zi.add(e),Yi(e).catch(()=>{zi.delete(e)}))}function $i(){Zi(),!Bi&&(Bi=!0,Yi().catch(()=>{Bi=!1}))}function ea(e){return Qi(e),Ii.get(e)??Pi}function ta(e){return Ri.add(e),()=>{Ri.delete(e)}}function na(e){let t=(0,Q.c)(2),n;return t[0]===e?n=t[1]:(n=()=>ea(e),t[0]=e,t[1]=n),(0,Z.useSyncExternalStore)(ta,n,ra)}function ra(){return Pi}function ia(e){for(let t of Ii.values()){let n=t.find(t=>t.id===e);if(n)return n}return Li.find(t=>t.id===e)??null}function aa(e){vi({docName:e.docName,quote:e.quote,prefix:e.prefix,suffix:e.suffix,body:e.body,queue:!0}).then(t=>{if(Yi(e.docName).catch(()=>void 0),e.onCreated!==void 0){e.onCreated(t.threadId);return}Ni(),Qa()}).catch(e=>{Oe.error(e instanceof Error&&e.message?Ae._({id:`q3W2nd`,values:{0:e.message}}):Ae._({id:`SRBk2G`}))})}function oa(e){vi({docName:e.docName,propertyKey:e.propertyKey,propertyPath:e.propertyPath,quote:e.quote,body:e.body,queue:!0}).then(()=>{Yi(e.docName).catch(()=>void 0),Ni(),Qa()}).catch(e=>{Oe.error(e instanceof Error&&e.message?Ae._({id:`q3W2nd`,values:{0:e.message}}):Ae._({id:`SRBk2G`}))})}function sa(e,t,n){e.then(()=>Yi(t)).catch(e=>{Oe.error(e instanceof Error&&e.message?`${n} ${e.message}`:n),Yi(t).catch(()=>void 0)})}function ca(e,t){let n=ia(e)?.docName;sa(yi(e,t),n,Ae._({id:`kzpkcn`}))}function la(e){let t=ia(e)?.docName;sa(bi(e),t,Ae._({id:`eoEUI3`}))}function ua(e){let t=ia(e)?.docName;sa(xi(e),t,Ae._({id:`lISYEX`}))}function da(e){let t=ia(e)?.docName;sa(Ti(e),t,Ae._({id:`IxHMdF`}))}function fa(e,t,n){let r=ia(e)?.docName;sa(Si(e,{quote:t,prefix:n?.prefix,suffix:n?.suffix}),r,Ae._({id:`mlvM8g`}))}var pa=Fi,ma=-1,ha=Fi,ga=-1,_a=-1;function va(){if($i(),ma!==Hi){let e=Li.filter(e=>e.queued&&e.status!==`resolved`).sort((e,t)=>e.createdAt-t.createdAt).map(e=>e.id);pa=e.length===0?Fi:e,ma=Hi}return pa}function ya(){return(0,Z.useSyncExternalStore)(ta,va,ba)}function ba(){return Fi}function xa(){let e=va();if(ga!==Hi||_a!==Ui){let t=e.filter(e=>!Vi.has(e));ha=t.length===0?Fi:t,ga=Hi,_a=Ui}return ha}function Sa(){return(0,Z.useSyncExternalStore)(ta,xa,Ca)}function Ca(){return Fi}function wa(e){return va().includes(e)}function Ta(e){let t=ia(e)?.docName;if(Vi.has(e)){let t=new Set(Vi);t.delete(e),Vi=t,Ki()}sa(Ci(e),t,Ae._({id:`Hhe73G`}))}function Ea(e){let t=ia(e)?.docName;sa(wi(e),t,Ae._({id:`os6dRM`}))}function Da(e){wa(e)?Ea(e):Ta(e)}function Oa(){Vi.size!==0&&(Vi=new Set,Ki())}function ka(e){let t=new Set(Vi);t.has(e)?t.delete(e):t.add(e),Vi=t,Ki()}function Aa(){let e=va();e.length!==0&&Promise.all(e.map(e=>wi(e).then(()=>!0).catch(()=>!1))).then(t=>{let n=t.filter(e=>!e).length;n>0&&Oe.error(Ae._({id:`4_5_n5`,values:{0:e.length,failed:n}})),Yi().catch(()=>void 0)})}var ja=!1;async function Ma({compose:e,threadIds:t,resolve:n=!0}){let r=t??xa();if(r.length===0||ja)return[];ja=!0;try{return await Na(r,e,n)}finally{ja=!1}}async function Na(e,t,n){let r;try{r=await Ei(e)}catch(e){return Oe.error(e instanceof Error&&e.message?Ae._({id:`VIiaFH`,values:{0:e.message}}):Ae._({id:`LvoXJX`})),[]}Gi();let i=r.results.flatMap(e=>e.ok?[{threadId:e.threadId,payload:e.payload}]:[]);if(i.length===0)return await Yi().catch(()=>void 0),[];let a=!1;try{a=await t(i)}catch{a=!1}let o=a?i.map(e=>e.threadId):[];return o.length>0&&n&&await Di(o).catch(()=>{Oe.error(Ae._({id:`siXSpl`}))}),await Yi().catch(()=>void 0),o}var Pa=`ok:comment-focus-thread`,Fa=`ok:comment-open-popover`,Ia=`ok:comment-start`,La=`ok:comment-posted`,Ra=typeof window>`u`?new EventTarget:window;function za(e){Ra.dispatchEvent(new CustomEvent(Pa,{detail:e}))}function Ba(e){let t=t=>e(t.detail);return Ra.addEventListener(Pa,t),()=>Ra.removeEventListener(Pa,t)}var Va=null,Ha=null,Ua=null,Wa=new Set;function Ga(){let e=Ha??Va;if(e!==Ua){Ua=e;for(let e of Wa)e()}}function Ka(){return Ua}function qa(e){Ha=e,Ga()}function Ja(e){Ha===e&&(Ha=null,Ga())}function Ya(e){return Wa.add(e),()=>{Wa.delete(e)}}function Xa(e){Va=e,Ga(),Ra.dispatchEvent(new CustomEvent(Fa,{detail:e}))}function Za(e){let t=t=>e(t.detail);return Ra.addEventListener(Fa,t),()=>Ra.removeEventListener(Fa,t)}function Qa(){Ra.dispatchEvent(new CustomEvent(La))}function $a(e){let t=()=>e();return Ra.addEventListener(La,t),()=>Ra.removeEventListener(La,t)}function eo(){Ra.dispatchEvent(new CustomEvent(Ia))}function to(e){let t=()=>e();return Ra.addEventListener(Ia,t),()=>Ra.removeEventListener(Ia,t)}var no=1e4;function ro(e){let t=()=>{let t=r(e.docName);if(!t||t.isDestroyed)return!1;let n=ai(t.state.doc,e.quote,e.context);return n&&(t.chain().focus().setTextSelection(n).run(),di(t,n)),za(e.threadId),!0};if(It(`comments`),t())return;window.location.assign(je(e.docName));let n=!1,i=()=>{n||(n=!0,a(),window.clearTimeout(s))},a=o(()=>{t()&&i()}),s=window.setTimeout(i,no);t()&&i()}function io(){let e=(0,Q.c)(2),t=ya(),n;if(e[0]!==t){n=[];for(let e of t){let t=ia(e);t!==null&&n.push(t)}e[0]=t,e[1]=n}else n=e[1];return n}function ao(){return Sa().length}function oo(e){let t=(0,Q.c)(34),{count:n,attached:r,expanded:i,onAttach:a,onToggleExpanded:o,onDismiss:s}=e,{_:c}=g();if(n===0)return null;if(!r){let e;t[0]===c?e=t[1]:(e=c({id:`8ycqHY`}),t[0]=c,t[1]=e);let n,r,i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(n=S(`h-auto min-h-0 gap-1 rounded-md border border-dashed bg-transparent px-1.5 py-0.5`,`text-xs font-normal text-muted-foreground hover:bg-muted/60 hover:text-foreground`),r=(0,X.jsx)(x,{className:`size-3`}),i=(0,X.jsx)(h,{id:`b24kPi`}),t[2]=n,t[3]=r,t[4]=i):(n=t[2],r=t[3],i=t[4]);let o;return t[5]!==a||t[6]!==e?(o=(0,X.jsxs)(C,{type:`button`,size:`sm`,variant:`ghost`,"aria-pressed":!1,"aria-label":e,onClick:a,"data-testid":`composer-context-chip-comments`,className:n,children:[r,i]}),t[5]=a,t[6]=e,t[7]=o):o=t[7],o}let l;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(l=S(`inline-flex items-center gap-1 rounded-md border bg-muted/60 py-0.5 pr-0.5 pl-1.5`,`text-xs text-muted-foreground`),t[8]=l):l=t[8];let u;t[9]!==c||t[10]!==i?(u=c(i?{id:`HFqQui`}:{id:`qokN44`}),t[9]=c,t[10]=i,t[11]=u):u=t[11];let d;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,X.jsx)(kt,{className:`size-3`}),t[12]=d):d=t[12];let f;t[13]===n?f=t[14]:(f=(0,X.jsx)(h,{id:`eiUA4k`,values:{count:n}}),t[13]=n,t[14]=f);let p=i&&`rotate-180`,m;t[15]===p?m=t[16]:(m=S(`size-3 transition-transform`,p),t[15]=p,t[16]=m);let _;t[17]===m?_=t[18]:(_=(0,X.jsx)(be,{className:m}),t[17]=m,t[18]=_);let v;t[19]!==i||t[20]!==o||t[21]!==u||t[22]!==f||t[23]!==_?(v=(0,X.jsxs)(C,{type:`button`,size:`sm`,variant:`ghost`,"aria-expanded":i,"aria-label":u,onClick:o,"data-testid":`composer-comments-peek`,className:`h-auto min-h-0 gap-1 px-0.5 py-0 text-xs font-normal text-muted-foreground hover:text-foreground`,children:[d,f,_]}),t[19]=i,t[20]=o,t[21]=u,t[22]=f,t[23]=_,t[24]=v):v=t[24];let y;t[25]===c?y=t[26]:(y=c({id:`pFRz_E`}),t[25]=c,t[26]=y);let b;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,X.jsx)(De,{className:`size-3`}),t[27]=b):b=t[27];let w;t[28]!==s||t[29]!==y?(w=(0,X.jsx)(C,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":y,onClick:s,className:`size-4 p-0 text-muted-foreground hover:text-foreground`,children:b}),t[28]=s,t[29]=y,t[30]=w):w=t[30];let T;return t[31]!==w||t[32]!==v?(T=(0,X.jsxs)(`span`,{"data-testid":`composer-context-chip-comments`,className:l,children:[v,w]}),t[31]=w,t[32]=v,t[33]=T):T=t[33],T}function so(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function co(e,t){let n=e;for(let e of t)n+=typeof e==`number`?`[${e}]`:`.${e}`;return n}function lo(e){let t=(0,Q.c)(14),{thread:n,className:r}=e,i=n.anchor?.quote??``;if(n.target.kind===`property`){let e;t[0]!==n.target.key||t[1]!==n.target.path?(e=co(n.target.key,n.target.path),t[0]=n.target.key,t[1]=n.target.path,t[2]=e):e=t[2];let a=e,o;t[3]===r?o=t[4]:(o=S(`w-full truncate font-mono text-[11px] text-muted-foreground`,r),t[3]=r,t[4]=o);let s=i===``?``:` “${i}”`,c;return t[5]!==a||t[6]!==o||t[7]!==s?(c=(0,X.jsxs)(`span`,{className:o,children:[a,`:`,s]}),t[5]=a,t[6]=o,t[7]=s,t[8]=c):c=t[8],c}let a;t[9]===r?a=t[10]:(a=S(`w-full truncate font-mono text-[11px] text-muted-foreground`,r),t[9]=r,t[10]=a);let o;return t[11]!==i||t[12]!==a?(o=(0,X.jsxs)(`span`,{className:a,children:[`“`,i,`”`]}),t[11]=i,t[12]=a,t[13]=o):o=t[13],o}function uo(e){ro({docName:e.docName,quote:e.target.kind===`property`?``:e.anchor?.quote??``,threadId:e.id,context:e.anchor??void 0});let{target:t,anchor:n}=e;if(t.kind!==`property`||n===null)return;let r=0,i=()=>{Gr({key:t.key,path:t.path,quote:n.quote,start:n.start,end:n.end})||(r+=1,!(r>=fo)&&requestAnimationFrame(i))};requestAnimationFrame(i)}var fo=30;function po(e){let t=(0,Q.c)(9),{threads:n}=e,{_:r}=g(),i=Sa();if(n.length===0)return null;let a;if(t[0]!==r||t[1]!==i||t[2]!==n){let e;t[4]!==r||t[5]!==i?(e=e=>{let t=e.status===`orphaned`,n=i.includes(e.id);return(0,X.jsxs)(`li`,{className:S(`flex items-start gap-2 rounded-md border bg-background/60 px-2 py-1.5`,!n&&`opacity-50`),children:[(0,X.jsx)(M,{checked:n,onCheckedChange:()=>ka(e.id),"aria-label":r({id:`Uoux8m`}),className:`mt-0.5`}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,X.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1 rounded border px-1 py-px text-[10px] text-muted-foreground`,title:e.docName,children:[(0,X.jsx)(j,{className:`size-2.5 shrink-0`}),(0,X.jsx)(`span`,{className:`truncate`,children:so(e.docName)})]}),t&&(0,X.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 text-[10px] text-amber-600 dark:text-amber-500`,title:r({id:`MBe6TE`}),children:[(0,X.jsx)(Mt,{className:`size-2.5`}),(0,X.jsx)(h,{id:`2UgoBZ`})]})]}),(0,X.jsxs)(C,{type:`button`,variant:`ghost`,"aria-label":r({id:`rscgd_`,values:{0:so(e.docName)}}),onClick:()=>uo(e),className:`h-auto min-h-0 w-full min-w-0 flex-col items-start gap-1 px-0 py-0 text-left font-normal hover:bg-transparent`,children:[(0,X.jsx)(lo,{thread:e}),(0,X.jsx)(`span`,{className:`line-clamp-2 w-full text-xs whitespace-normal text-foreground/90`,children:e.body})]})]}),(0,X.jsx)(C,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":r({id:`YDX9lo`}),onClick:()=>Ea(e.id),className:`size-5 shrink-0 p-0 text-muted-foreground hover:text-foreground`,children:(0,X.jsx)(De,{className:`size-3`})})]},e.id)},t[4]=r,t[5]=i,t[6]=e):e=t[6],a=n.map(e),t[0]=r,t[1]=i,t[2]=n,t[3]=a}else a=t[3];let o;return t[7]===a?o=t[8]:(o=(0,X.jsx)(`ul`,{"data-testid":`composer-comments-list`,className:`mt-1 flex max-h-64 basis-full list-none flex-col gap-1 overflow-y-auto subtle-scrollbar`,children:a}),t[7]=a,t[8]=o),o}function mo(e){return{docName:e.docName,body:e.instruction,propertyKey:e.property,quote:e.passage?.exact??``,anchorLost:e.anchorLost,prefix:e.passage?.prefix??``,suffix:e.passage?.suffix??``,repeats:e.passageRepeats}}var ho=48;function go(e){let t=e.replace(/\s+/g,` `).trimStart();return t.length>ho?`…${t.slice(-ho)}`:t}function _o(e){let t=e.replace(/\s+/g,` `).trimEnd();return t.length>ho?`${t.slice(0,ho)}…`:t}function vo(e){if(!e.repeats)return null;let t=go(e.prefix),n=_o(e.suffix);return t===``&&n===``?null:`(This text appears more than once in the file. The one meant is ${t===``?`at the start of the file, followed by "${n}"`:n===``?`at the end of the file, preceded by "${t}"`:`between "${t}" and "${n}"`} — match that context rather than the first occurrence.)`}function yo(e,t,n){let r=t.trim(),i=[];if(i.push(r.length>0?r:`Address the following review comments by editing the documents directly.`),i.push(``),i.push(e.length===1?`The comment:`:`The ${e.length} comments:`),e.forEach((e,t)=>{if(i.push(``),e.propertyKey){let n=e.quote.trim();if(n===``)i.push(`${t+1}. In \`${e.docName}\`, on the \`${e.propertyKey}\` property (frontmatter):`),i.push(``),i.push(` ${e.body.trim()}`);else{i.push(`${t+1}. In \`${e.docName}\`, on this text within the \`${e.propertyKey}\` property (frontmatter):`),i.push(``);for(let e of n.split(`
|
|
5
5
|
`))i.push(` > ${e}`);i.push(``),i.push(` ${e.body.trim()}`)}e.anchorLost&&(i.push(``),i.push(n===``?` (Note: \`${e.propertyKey}\` is no longer in this document's frontmatter — it was renamed or removed since the comment was written. Do not apply this to a different property; if you cannot tell what it now refers to, say so instead of guessing.)`:` (Note: that text is no longer in \`${e.propertyKey}\` — the value was edited, reshaped, or removed since the comment was written. Do not apply this to a different property or a different part of the value; if you cannot tell what it now refers to, say so instead of guessing.)`));return}i.push(`${t+1}. In \`${e.docName}\`, on this passage:`),i.push(``);for(let t of e.quote.split(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./ManagedArtifactProperties-BEA8rfna.js";export{e as ManagedArtifactProperties};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{r}from"./dist-Nvb76hAm.js";import{n as i}from"./dist-PQ5KMVDh.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{k as o,n as s}from"./CodeMirrorPropInput-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{r}from"./dist-Nvb76hAm.js";import{n as i}from"./dist-PQ5KMVDh.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{k as o,n as s}from"./CodeMirrorPropInput-DTaNg1-M.js";import{t as c}from"./Mermaid-C8gHr0W4.js";import{f as l}from"./config-provider-CswKxDa9.js";import{N as u,Ot as d,X as f}from"./dist-BNDNcytQ.js";import{t as p}from"./cm-theme-BCzjFmR8.js";import{t as m}from"./overlay-layers-B39mutdg.js";import{t as h}from"./dist-DZPs1bpg.js";import{t as g}from"./src-1YTF45Kf.js";var _=a(),v=e(n(),1),y=t(),b=p({dark:!0,background:`var(--background)`,gutterBackground:`var(--muted)`}),x=p({dark:!1,background:`var(--background)`,gutterBackground:`var(--muted)`});function S(e,t,n){let r=e.toString();if(r===t)return;let i=0,a=Math.min(r.length,t.length);for(;i<a&&r[i]===t[i];)i+=1;let o=r.length,s=t.length;for(;o>i&&s>i&&r[o-1]===t[s-1];)--o,--s;let c=()=>{o>i&&e.delete(i,o-i),s>i&&e.insert(i,t.slice(i,s))},l=e.doc;l?l.transact(c,n):c()}function C(e){let t=(0,_.c)(7),{ytext:n,provider:r,undoManager:a}=e,c=(0,v.useRef)(null),{resolvedTheme:l}=i(),p,m;t[0]!==r||t[1]!==l||t[2]!==a||t[3]!==n?(p=()=>{let e=c.current;if(!e)return;let t=l===`dark`?b:x,i=new f({state:d.create({doc:n.toString(),extensions:[h,g(n,r.awareness,{undoManager:a}),o(),u(s),f.lineWrapping,f.theme({"&":{height:`100%`}}),t]}),parent:e});return()=>i.destroy()},m=[n,r,l,a],t[0]=r,t[1]=l,t[2]=a,t[3]=n,t[4]=p,t[5]=m):(p=t[4],m=t[5]),(0,v.useEffect)(p,m);let S;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,y.jsx)(`div`,{ref:c,className:`h-full min-h-0 overflow-auto`}),t[6]=S):S=t[6],S}var w=Symbol(`mermaid-diagram-edit`);function T(e){let t=(0,_.c)(28),{provider:n,isSourceMode:i}=e,{_:a}=r(),o;t[0]===n.document?o=t[1]:(o=n.document.getText(`source`),t[0]=n.document,t[1]=o);let s=o,u;t[2]===s?u=t[3]:(u=()=>s.toString(),t[2]=s,t[3]=u);let[d,f]=(0,v.useState)(u),p,h;t[4]===s?(p=t[5],h=t[6]):(p=()=>{let e=()=>f(s.toString());return s.observe(e),e(),()=>s.unobserve(e)},h=[s],t[4]=s,t[5]=p,t[6]=h),(0,v.useEffect)(p,h);let g;t[7]===s?g=t[8]:(g=()=>new l(s,{trackedOrigins:new Set([w])}),t[7]=s,t[8]=g);let[b]=(0,v.useState)(g),x;t[9]===s?x=t[10]:(x={canEdit:!0,commitChart:e=>S(s,e,w)},t[9]=s,t[10]=x);let T=x,E,D;t[11]!==i||t[12]!==b?(E=()=>{if(i)return;let e=e=>{if(!(e.metaKey||e.ctrlKey)||e.key.toLowerCase()!==`z`||m())return;let t=e.target;if(t instanceof HTMLElement){let e=t.tagName;if(e===`INPUT`||e===`TEXTAREA`||t.isContentEditable)return}e.preventDefault(),e.shiftKey?b.redo():b.undo()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},D=[i,b],t[11]=i,t[12]=b,t[13]=E,t[14]=D):(E=t[13],D=t[14]),(0,v.useEffect)(E,D);let O;t[15]===a?O=t[16]:(O=a({id:`8PifYj`}),t[15]=a,t[16]=O);let k=i?`source`:`diagram`,A;t[17]!==T||t[18]!==i||t[19]!==n||t[20]!==d||t[21]!==b||t[22]!==s?(A=(0,y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:i?(0,y.jsx)(C,{ytext:s,provider:n,undoManager:b}):(0,y.jsx)(`div`,{className:`flex h-full min-h-0 flex-col p-3`,children:(0,y.jsx)(c,{chart:d,editBinding:T,className:`min-h-0 flex-1`})})}),t[17]=T,t[18]=i,t[19]=n,t[20]=d,t[21]=b,t[22]=s,t[23]=A):A=t[23];let j;return t[24]!==k||t[25]!==A||t[26]!==O?(j=(0,y.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":O,"data-mermaid-doc-editor":``,"data-mermaid-doc-editor-mode":k,children:A}),t[24]=k,t[25]=A,t[26]=O,t[27]=j):j=t[27],j}export{T as MermaidDocEditor};
|