1var Fn=Object.defineProperty,Wn=Object.defineProperties;var jn=Object.getOwnPropertyDescriptors;var Te=Object.getOwnPropertySymbols;var vt=Object.prototype.hasOwnProperty,yt=Object.prototype.propertyIsEnumerable;var xt=e=>{throw TypeError(e)};var bt=(e,t,n)=>t in e?Fn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,T=(e,t)=>{for(var n in t||(t={}))vt.call(t,n)&&bt(e,n,t[n]);if(Te)for(var n of Te(t))yt.call(t,n)&&bt(e,n,t[n]);return e},I=(e,t)=>Wn(e,jn(t));var oe=(e,t)=>{var n={};for(var o in e)vt.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&Te)for(var o of Te(e))t.indexOf(o)<0&&yt.call(e,o)&&(n[o]=e[o]);return n};var St=(e,t,n)=>t.has(e)||xt("Cannot "+n);var Se=(e,t,n)=>(St(e,t,"read from private field"),n?n.call(e):t.get(e)),wt=(e,t,n)=>t.has(e)?xt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),zt=(e,t,n,o)=>(St(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n);import{_ as m,a as _,b as De}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-B177jzqY.js";import{e as W,c as q,k as Ae,b as H,g as _e,s as Un,a as K,i as j,q as Vn,u as tn,d as Ie,r as Hn}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react__loadShare__.js-ClGO9exV.js";import{_ as ye,e as Yn,d as Le,k as Kn,b as Ct}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_router_mf_2_dom__loadShare__.js-CK4j7iSY.js";import{I as et,n as Y,q as qn,r as Xn,s as tt,m as Jn,G as Qn,l as nn,t as on,j as rn,A as Zn,v as Ke,w as eo,x as qe,y as Dt,z as Pt,C as Oe,E as Pe,F as an,H as to,u as sn,J as no,K as kt,o as oo}from"./index-B9O2cfno.js";import{d as nt}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare___mf_0_unleash_mf_1_proxy_mf_2_client_mf_2_react__loadShare__.js-BdtqsXmB.js";import{u as ro,f as Lt,a as io,b as ao,H as so}from"./formatStorageBytes-CwFL-Nos.js";import{I as lo}from"./ImageIcon-DCfEtqpZ.js";import{L as uo}from"./Link1Icon-CoMYT4-V.js";import{S as co}from"./Star1Icon-3etEaU32.js";import{T as fo}from"./Trash1Icon-B3_S5Y02.js";import{I as ln}from"./IconButton-lWu-sW9d.js";import{G as Xe}from"./GridIcon-DPy6pYc3.js";import{P as un}from"./PlusIcon-DCbZ0WST.js";import{u as po}from"./CreateGroupDrawerContext-CoBRpHno.js";import{B as go,a as mo}from"./useBucketList-Dcd9NUck.js";import{C as ho}from"./ChevronDownIcon-WQ4Lvim_.js";import{C as bo}from"./ChevronUpIcon-hA-AYcUt.js";import{u as vo}from"./useGroupCounters-BNlY0tvN.js";import{F as Je}from"./FolderIcon-DyiwQ_7S.js";import{L as yo}from"./LoadingIcon-DAFCQ8iI.js";import{u as xo}from"./useBucketMediaMove-BuvKt6ph.js";import{r as So,p as wo}from"./albumCacheLinks-Cqrf5vaz.js";import{u as zo}from"./CreateAlbumDrawerContext-BrLdwoFb.js";import{B as Et}from"./BucketCreate-B4a-RI5Z.js";import"./__virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react__loadShare__.js_commonjs-proxy-D_fXcg40.js";import"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_dom__loadShare__.js-ckyQG2Wp.js";import"./__virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_dom__loadShare__.js_commonjs-proxy-BYnSnx8j.js";import"./virtualExposes-_ivNhQLP.js";import"./remoteEntry-uboCqDRT.js";import"./preload-helper-s0Msbe4-.js";import"./index-DM2295YJ.js";import"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-_fD68H2V.js";import"./formatBytes-jRUNT9z8.js";import"./usePositioner-B6-eQzwV.js";import"./DirectionContext-CJiZK74l.js";import"./logger-YHhloPCO.js";import"./useSelectedMedia-BLVwYI-I.js";import"./index-CNeZytPn.js";import"./groupCapUpsell-Ckyvb8hl.js";import"./useProfilePlan-2AaC2fHr.js";import"./useAnalytics-BR9_As4i.js";import"./TextField-Cxuy6esU.js";import"./Select-BBMTu6sl.js";import"./isMuiElement-ByswdNQJ.js";import"./List-C5bK9afY.js";import"./FormControlLabel-Czs4VhDI.js";import"./Divider-Ds-LqyRJ.js";import"./dividerClasses-cApOefCC.js";import"./Dialog-C1VO68NT.js";const Co='<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M3.5 6.5L6 9L8.5 6.5M3.5 3L6 5.5L8.5 3" stroke="#3A0090" stroke-linecap="round" stroke-linejoin="round"/></svg>';function Do(e){return m(et,T({svg:Co},e))}const Po='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="m18 17-5-5 5-5M11 17l-5-5 5-5" stroke="#1A1A1A" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>';function ko(e){return m(et,T({svg:Po},e))}function Lo(e,t){const n=getComputedStyle(e),o=parseFloat(n.fontSize);return t*o}function Eo(e,t){const n=getComputedStyle(e.ownerDocument.documentElement),o=parseFloat(n.fontSize);return t*o}function To(e){return e/100*window.innerHeight}function Mo(e){return e/100*window.innerWidth}function Ro(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function we({groupSize:e,panelElement:t,styleProp:n}){let o;const[i,r]=Ro(n);switch(r){case"%":{o=i/100*e;break}case"px":{o=i;break}case"rem":{o=Eo(t,i);break}case"em":{o=Lo(t,i);break}case"vh":{o=To(i);break}case"vw":{o=Mo(i);break}}return o}function V(e){return parseFloat(e.toFixed(3))}function ve({group:e}){const{orientation:t,panels:n}=e;return n.reduce((o,i)=>(o+=t==="horizontal"?i.element.offsetWidth:i.element.offsetHeight,o),0)}function Qe(e){const{panels:t}=e,n=ve({group:e});return n===0?t.map(o=>({groupResizeBehavior:o.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:o.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:o.panelConstraints.disabled,minSize:0,maxSize:100,panelId:o.id})):t.map(o=>{const{element:i,panelConstraints:r}=o;let l=0;if(r.collapsedSize!==void 0){const u=we({groupSize:n,panelElement:i,styleProp:r.collapsedSize});l=V(u/n*100)}let s;if(r.defaultSize!==void 0){const u=we({groupSize:n,panelElement:i,styleProp:r.defaultSize});s=V(u/n*100)}let a=0;if(r.minSize!==void 0){const u=we({groupSize:n,panelElement:i,styleProp:r.minSize});a=V(u/n*100)}let c=100;if(r.maxSize!==void 0){const u=we({groupSize:n,panelElement:i,styleProp:r.maxSize});c=V(u/n*100)}return{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:l,collapsible:r.collapsible===!0,defaultSize:s,disabled:r.disabled,minSize:a,maxSize:c,panelId:o.id}})}function R(e,t="Assertion error"){if(!e)throw Error(t)}function Ze(e,t){return Array.from(t).sort(e==="horizontal"?No:Ao)}function No(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function Ao(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function cn(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function dn(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function _o({orientation:e,rects:t,targetRect:n}){const o={x:n.x+n.width/2,y:n.y+n.height/2};let i,r=Number.MAX_VALUE;for(const l of t){const{x:s,y:a}=dn(o,l),c=e==="horizontal"?s:a;c<r&&(r=c,i=l)}return R(i,"No rect found"),i}let Me;function Io(){return Me===void 0&&(typeof matchMedia=="function"?Me=!!matchMedia("(pointer:coarse)").matches:Me=!1),Me}function fn(e){const{element:t,orientation:n,panels:o,separators:i}=e,r=Ze(n,Array.from(t.children).filter(cn).map(y=>({element:y}))).map(({element:y})=>y),l=[];let s=!1,a=!1,c=-1,u=-1,p=0,d,b=[];{let y=-1;for(const h of r)h.hasAttribute("data-panel")&&(y++,h.hasAttribute("data-disabled")||(p++,c===-1&&(c=y),u=y))}if(p>1){let y=-1;for(const h of r)if(h.hasAttribute("data-panel")){y++;const g=o.find(f=>f.element===h);if(g){if(d){const f=d.element.getBoundingClientRect(),v=h.getBoundingClientRect();let x;if(a){const w=n==="horizontal"?new DOMRect(f.right,f.top,0,f.height):new DOMRect(f.left,f.bottom,f.width,0),S=n==="horizontal"?new DOMRect(v.left,v.top,0,v.height):new DOMRect(v.left,v.top,v.width,0);switch(b.length){case 0:{x=[w,S];break}case 1:{const z=b[0],C=_o({orientation:n,rects:[f,v],targetRect:z.element.getBoundingClientRect()});x=[z,C===f?S:w];break}default:{x=b;break}}}else b.length?x=b:x=[n==="horizontal"?new DOMRect(f.right,v.top,v.left-f.right,v.height):new DOMRect(v.left,f.bottom,v.width,v.top-f.bottom)];for(const w of x){let S="width"in w?w:w.element.getBoundingClientRect();const z=Io()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(S.width<z){const D=z-S.width;S=new DOMRect(S.x-D/2,S.y,S.width+D,S.height)}if(S.height<z){const D=z-S.height;S=new DOMRect(S.x,S.y-D/2,S.width,S.height+D)}const C=y<=c||y>u;!s&&!C&&l.push({group:e,groupSize:ve({group:e}),panels:[d,g],separator:"width"in w?void 0:w,rect:S}),s=!1}}a=!1,d=g,b=[]}}else if(h.hasAttribute("data-separator")){h.ariaDisabled!==null&&(s=!0);const g=i.find(f=>f.element===h);g?b.push(g):(d=void 0,b=[])}else a=!0}return l}var te;class pn{constructor(){wt(this,te,{})}addListener(t,n){const o=Se(this,te)[t];return o===void 0?Se(this,te)[t]=[n]:o.includes(n)||o.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const o=Se(this,te)[t];if(o!==void 0)if(o.length===1)o[0].call(null,n);else{let i=!1,r=null;const l=Array.from(o);for(let s=0;s<l.length;s++){const a=l[s];try{a.call(null,n)}catch(c){r===null&&(i=!0,r=c)}}if(i)throw r}}removeAllListeners(){zt(this,te,{})}removeListener(t,n){const o=Se(this,te)[t];if(o!==void 0){const i=o.indexOf(n);i>=0&&o.splice(i,1)}}}te=new WeakMap;let J=new Map;const gn=new pn;function Oo(e){J=new Map(J),J.delete(e)}function Tt(e,t){for(const[n]of J)if(n.id===e)return n}function ne(e,t){for(const[n,o]of J)if(n.id===e)return o;if(t)throw Error("Could not find data for Group with id ".concat(e))}function ce(){return J}function ot(e,t){return gn.addListener("groupChange",n=>{n.group.id===e&&t(n)})}function Z(e,t){const n=J.get(e);J=new Map(J),J.set(e,t),gn.emit("groupChange",{group:e,prev:n,next:t})}
1function Bo(e,t,n){let o,i={x:1/0,y:1/0};for(const r of t){const l=dn(n,r.rect);switch(e){case"horizontal":{l.x<=i.x&&(o=r,i=l);break}case"vertical":{l.y<=i.y&&(o=r,i=l);break}}}return o?{distance:i,hitRegion:o}:void 0}function Go(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function $o(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:Nt(e),b:Nt(t)};let o;for(;n.a.at(-1)===n.b.at(-1);)o=n.a.pop(),n.b.pop();R(o,"Stacking order can only be calculated for elements with a common ancestor");const i={a:Rt(Mt(n.a)),b:Rt(Mt(n.b))};if(i.a===i.b){const r=o.childNodes,l={a:n.a.at(-1),b:n.b.at(-1)};let s=r.length;for(;s--;){const a=r[s];if(a===l.a)return 1;if(a===l.b)return-1}}return Math.sign(i.a-i.b)}const Fo=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Wo(e){var n;const t=getComputedStyle((n=mn(e))!=null?n:e).display;return t==="flex"||t==="inline-flex"}function jo(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||Wo(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||Fo.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function Mt(e){let t=e.length;for(;t--;){const n=e[t];if(R(n,"Missing node"),jo(n))return n}return null}function Rt(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Nt(e){const t=[];for(;e;)t.push(e),e=mn(e);return t}function mn(e){const{parentNode:t}=e;return Go(t)?t.host:t}function Uo(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Vo({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!cn(n)||n.contains(e)||e.contains(n))return!0;if($o(n,e)>0){let o=n;for(;o;){if(o.contains(e))return!0;if(Uo(o.getBoundingClientRect(),t))return!1;o=o.parentElement}}return!0}function rt(e,t){const n=[];return t.forEach((o,i)=>{if(i.disabled)return;const r=fn(i),l=Bo(i.orientation,r,{x:e.clientX,y:e.clientY});l&&l.distance.x<=0&&l.distance.y<=0&&Vo({groupElement:i.element,hitRegion:l.hitRegion.rect,pointerEventTarget:e.target})&&n.push(l.hitRegion)}),n}function Ho(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function F(e,t,n=0){return Math.abs(V(e)-V(t))<=n}function X(e,t){return F(e,t)?0:e>t?1:-1}function me({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:o}){const{collapsedSize:i=0,collapsible:r,disabled:l,maxSize:s=100,minSize:a=0}=t;if(l&&!e)return n;if(X(o,a)<0)if(r){const c=(i+a)/2;X(o,c)<0?o=i:o=a}else o=a;return o=Math.min(s,o),o=V(o),o}function ke({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:o,prevLayout:i,trigger:r}){if(F(e,0))return t;const l=r==="imperative-api",s=Object.values(t),a=Object.values(i),c=[...s],[u,p]=o;R(u!=null,"Invalid first pivot index"),R(p!=null,"Invalid second pivot index");let d=0;switch(r){case"keyboard":{{const h=e<0?p:u,g=n[h];R(g,"Panel constraints not found for index ".concat(h));const{collapsedSize:f=0,collapsible:v,minSize:x=0}=g;if(v){const w=s[h];if(R(w!=null,"Previous layout not found for panel index ".concat(h)),F(w,f)){const S=x-w;X(S,Math.abs(e))>0&&(e=e<0?0-S:S)}}}{const h=e<0?u:p,g=n[h];R(g,"No panel constraints found for index ".concat(h));const{collapsedSize:f=0,collapsible:v,minSize:x=0}=g;if(v){const w=s[h];if(R(w!=null,"Previous layout not found for panel index ".concat(h)),F(w,x)){const S=w-f;X(S,Math.abs(e))>0&&(e=e<0?0-S:S)}}}break}default:{const h=e<0?p:u,g=n[h];R(g,"Panel constraints not found for index ".concat(h));const f=s[h],{collapsible:v,collapsedSize:x,minSize:w}=g;if(v&&X(f,w)<0)if(e>0){const S=w-x,z=S/2,C=f+e;X(C,w)<0&&(e=X(e,z)<=0?0:S)}else{const S=w-x,z=100-S/2,C=f-e;X(C,w)<0&&(e=X(100+e,z)>0?0:-S)}break}}{const h=e<0?1:-1;let g=e<0?p:u,f=0;for(;;){const x=s[g];R(x!=null,"Previous layout not found for panel index ".concat(g));const w=me({overrideDisabledPanels:l,panelConstraints:n[g],prevSize:x,size:100})-x;if(f+=w,g+=h,g<0||g>=n.length)break}const v=Math.min(Math.abs(e),Math.abs(f));e=e<0?0-v:v}{let h=e<0?u:p;for(;h>=0&&h<n.length;){const g=Math.abs(e)-Math.abs(d),f=s[h];R(f!=null,"Previous layout not found for panel index ".concat(h));const v=f-g,x=me({overrideDisabledPanels:l,panelConstraints:n[h],prevSize:f,size:v});if(!F(f,x)&&(d+=f-x,c[h]=x,d.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?h--:h++}}if(Ho(a,c))return i;{const h=e<0?p:u,g=s[h];R(g!=null,"Previous layout not found for panel index ".concat(h));const f=g+d,v=me({overrideDisabledPanels:l,panelConstraints:n[h],prevSize:g,size:f});if(c[h]=v,!F(v,f)){let x=f-v,w=e<0?p:u;for(;w>=0&&w<n.length;){const S=c[w];R(S!=null,"Previous layout not found for panel index ".concat(w));const z=S+x,C=me({overrideDisabledPanels:l,panelConstraints:n[w],prevSize:S,size:z});if(F(S,C)||(x-=C-S,c[w]=C),F(x,0))break;e>0?w--:w++}}}const b=Object.values(c).reduce((h,g)=>g+h,0);if(!F(b,100,.1))return i;const y=Object.keys(i);return c.reduce((h,g,f)=>(h[y[f]]=g,h),{})}function se(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||X(e[n],t[n])!==0)return!1;return!0}function le({layout:e,panelConstraints:t}){const n=Object.values(e),o=[...n],i=o.reduce((s,a)=>s+a,0);if(o.length!==t.length)throw Error("Invalid ".concat(t.length," panel layout: ").concat(o.map(s=>"".concat(s,"%")).join(", ")));if(!F(i,100)&&o.length>0)for(let s=0;s<t.length;s++){const a=o[s];R(a!=null,"No layout data found for index ".concat(s));const c=100/i*a;o[s]=c}let r=0;for(let s=0;s<t.length;s++){const a=n[s];R(a!=null,"No layout data found for index ".concat(s));const c=o[s];R(c!=null,"No layout data found for index ".concat(s));const u=me({overrideDisabledPanels:!0,panelConstraints:t[s],prevSize:a,size:c});c!=u&&(r+=c-u,o[s]=u)}if(!F(r,0))for(let s=0;s<t.length;s++){const a=o[s];R(a!=null,"No layout data found for index ".concat(s));const c=a+r,u=me({overrideDisabledPanels:!0,panelConstraints:t[s],prevSize:a,size:c});if(a!==u&&(r-=u-a,o[s]=u,F(r,0)))break}const l=Object.keys(e);return o.reduce((s,a,c)=>(s[l[c]]=a,s),{})}function hn({groupId:e,panelId:t}){const n=()=>{const a=ce();for(const[c,{defaultLayoutDeferred:u,derivedPanelConstraints:p,layout:d,groupSize:b,separatorToPanels:y}]of a)if(c.id===e)return{defaultLayoutDeferred:u,derivedPanelConstraints:p,group:c,groupSize:b,layout:d,separatorToPanels:y};throw Error("Group ".concat(e," not found"))},o=()=>{const a=n().derivedPanelConstraints.find(c=>c.panelId===t);if(a!==void 0)return a;throw Error("Panel constraints not found for Panel ".concat(t))},i=()=>{const a=n().group.panels.find(c=>c.id===t);if(a!==void 0)return a;throw Error("Layout not found for Panel ".concat(t))},r=()=>{const a=n().layout[t];if(a!==void 0)return a;throw Error("Layout not found for Panel ".concat(t))},l=({nextSize:a,panels:c,prevLayout:u,derivedPanelConstraints:p})=>{const d=r(),b=c.findIndex(g=>g.id===t),y=b===0,h=b===c.length-1;if(h&&a<d&&(y||c.slice(0,b).every((g,f)=>{const v=p[f];return(v==null?void 0:v.collapsible)&&F(v.collapsedSize,u[v.panelId])}))){const g=c.slice(0,b).reduce((f,v)=>f+u[v.id],0);return I(T({},u),{[t]:V(100-g)})}return ke({delta:h?d-a:a-d,initialLayout:u,panelConstraints:p,pivotIndices:h?[b-1,b]:[b,b+1],prevLayout:u,trigger:"imperative-api"})},s=a=>{const c=r();if(a===c)return;const{defaultLayoutDeferred:u,derivedPanelConstraints:p,group:d,groupSize:b,layout:y,separatorToPanels:h}=n(),g=l({nextSize:a,panels:d.panels,prevLayout:y,derivedPanelConstraints:p}),f=le({layout:g,panelConstraints:p});se(y,f)||Z(d,{defaultLayoutDeferred:u,derivedPanelConstraints:p,groupSize:b,layout:f,separatorToPanels:h})};return{collapse:()=>{const{collapsible:a,collapsedSize:c}=o(),{mutableValues:u}=i(),p=r();a&&p!==c&&(u.expandToSize=p,s(c))},expand:()=>{var b;const{collapsible:a,collapsedSize:c,minSize:u}=o(),{mutableValues:p}=i(),d=r();if(a&&d===c){let y=(b=p.expandToSize)!=null?b:u;y===0&&(y=1),s(y)}},getSize:()=>{const{group:a}=n(),c=r(),{element:u}=i(),p=a.orientation==="horizontal"?u.offsetWidth:u.offsetHeight;return{asPercentage:c,inPixels:p}},isCollapsed:()=>{const{collapsible:a,collapsedSize:c}=o(),u=r();return a&&F(c,u)},resize:a=>{const{group:c}=n(),{element:u}
1=i(),p=ve({group:c}),d=we({groupSize:p,panelElement:u,styleProp:a}),b=V(d/p*100);s(b)}}}function At(e){if(e.defaultPrevented)return;const t=ce();rt(e,t).forEach(n=>{if(n.separator&&!n.separator.disableDoubleClick){const o=n.panels.find(i=>i.panelConstraints.defaultSize!==void 0);if(o){const i=o.panelConstraints.defaultSize,r=hn({groupId:n.group.id,panelId:o.id});r&&i!==void 0&&(r.resize(i),e.preventDefault())}}})}function Ne(e){const t=ce();for(const[n]of t)if(n.separators.some(o=>o.element===e))return n;throw Error("Could not find parent Group for separator element")}function bn({groupId:e}){const t=()=>{const n=ce();for(const[o,i]of n)if(o.id===e)return T({group:o},i);throw Error('Could not find Group with id "'.concat(e,'"'))};return{getLayout(){const{defaultLayoutDeferred:n,layout:o}=t();return n?{}:o},setLayout(n){const{defaultLayoutDeferred:o,derivedPanelConstraints:i,group:r,groupSize:l,layout:s,separatorToPanels:a}=t(),c=le({layout:n,panelConstraints:i});return o?s:(se(s,c)||Z(r,{defaultLayoutDeferred:o,derivedPanelConstraints:i,groupSize:l,layout:c,separatorToPanels:a}),c)}}}function re(e,t){const n=Ne(e),o=ne(n.id,!0),i=n.separators.find(u=>u.element===e);R(i,"Matching separator not found");const r=o.separatorToPanels.get(i);R(r,"Matching panels not found");const l=r.map(u=>n.panels.indexOf(u)),s=bn({groupId:n.id}).getLayout(),a=ke({delta:t,initialLayout:s,panelConstraints:o.derivedPanelConstraints,pivotIndices:l,prevLayout:s,trigger:"keyboard"}),c=le({layout:a,panelConstraints:o.derivedPanelConstraints});se(s,c)||Z(n,{defaultLayoutDeferred:o.defaultLayoutDeferred,derivedPanelConstraints:o.derivedPanelConstraints,groupSize:o.groupSize,layout:c,separatorToPanels:o.separatorToPanels})}function _t(e){var o;if(e.defaultPrevented)return;const t=e.currentTarget,n=Ne(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&re(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&re(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&re(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&re(t,-5);break}case"End":{e.preventDefault(),re(t,100);break}case"Enter":{e.preventDefault();const i=Ne(t),r=ne(i.id,!0),{derivedPanelConstraints:l,layout:s,separatorToPanels:a}=r,c=i.separators.find(b=>b.element===t);R(c,"Matching separator not found");const u=a.get(c);R(u,"Matching panels not found");const p=u[0],d=l.find(b=>b.panelId===p.id);if(R(d,"Panel metadata not found"),d.collapsible){const b=s[p.id],y=d.collapsedSize===b?(o=i.mutableState.expandedPanelSizes[p.id])!=null?o:d.minSize:d.collapsedSize;re(t,y-b)}break}case"F6":{e.preventDefault();const i=Ne(t).separators.map(s=>s.element),r=Array.from(i).findIndex(s=>s===e.currentTarget);R(r!==null,"Index not found");const l=e.shiftKey?r>0?r-1:i.length-1:r+1<i.length?r+1:0;i[l].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),re(t,-100);break}}}let he={cursorFlags:0,state:"inactive"};const it=new pn;function ue(){return he}function Yo(e){return it.addListener("change",e)}function Ko(e){const t=he,n=T({},he);n.cursorFlags=e,he=n,it.emit("change",{prev:t,next:n})}function be(e){const t=he;he=e,it.emit("change",{prev:t,next:e})}function It(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=ce(),n=rt(e,t),o=new Map;let i=!1;n.forEach(r=>{r.separator&&(i||(i=!0,r.separator.element.focus({focusVisible:!1,preventScroll:!0})));const l=t.get(r.group);l&&o.set(r.group,l.layout)}),be({cursorFlags:0,hitRegions:n,initialLayoutMap:o,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}const qo=e=>e,je=()=>{},vn=1,yn=2,xn=4,Sn=8,Ot=3,Bt=12;let Re;function Gt(){return Re===void 0&&(Re=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(Re=!0)),Re}function Xo({cursorFlags:e,groups:t,state:n}){let o=0,i=0;switch(n){case"active":case"hover":t.forEach(r=>{if(!r.mutableState.disableCursor)switch(r.orientation){case"horizontal":{o++;break}case"vertical":{i++;break}}})}if(!(o===0&&i===0)){switch(n){case"active":{if(e&&Gt()){const r=(e&vn)!==0,l=(e&yn)!==0,s=(e&xn)!==0,a=(e&Sn)!==0;if(r)return s?"se-resize":a?"ne-resize":"e-resize";if(l)return s?"sw-resize":a?"nw-resize":"w-resize";if(s)return"s-resize";if(a)return"n-resize"}break}}return Gt()?o>0&&i>0?"move":o>
10?"ew-resize":"ns-resize":o>0&&i>0?"grab":o>0?"col-resize":"row-resize"}}const $t=new WeakMap;function at(e){var i;if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=(i=$t.get(e))!=null?i:{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));const o=ue();switch(o.state){case"active":case"hover":{const r=Xo({cursorFlags:o.cursorFlags,groups:o.hitRegions.map(s=>s.group),state:o.state}),l="*, *:hover {cursor: ".concat(r," !important; }");if(t===l)return;t=l,r?n.cssRules.length===0?n.insertRule(l):n.replaceSync(l):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}$t.set(e,{prevStyle:t,styleSheet:n})}function wn({document:e,event:t,hitRegions:n,initialLayoutMap:o,mountedGroups:i,pointerDownAtPoint:r,prevCursorFlags:l}){let s=0;n.forEach(c=>{const{group:u,groupSize:p}=c,{orientation:d,panels:b}=u,{disableCursor:y}=u.mutableState;let h=0;r?d==="horizontal"?h=(t.clientX-r.x)/p*100:h=(t.clientY-r.y)/p*100:d==="horizontal"?h=t.clientX<0?-100:100:h=t.clientY<0?-100:100;const g=o.get(u),f=i.get(u);if(!g||!f)return;const{defaultLayoutDeferred:v,derivedPanelConstraints:x,groupSize:w,layout:S,separatorToPanels:z}=f;if(x&&S&&z){const C=ke({delta:h,initialLayout:g,panelConstraints:x,pivotIndices:c.panels.map(D=>b.indexOf(D)),prevLayout:S,trigger:"mouse-or-touch"});if(se(C,S)){if(h!==0&&!y)switch(d){case"horizontal":{s|=h<0?vn:yn;break}case"vertical":{s|=h<0?xn:Sn;break}}}else Z(c.group,{defaultLayoutDeferred:v,derivedPanelConstraints:x,groupSize:w,layout:C,separatorToPanels:z})}});let a=0;t.movementX===0?a|=l&Ot:a|=s&Ot,t.movementY===0?a|=l&Bt:a|=s&Bt,Ko(a),at(e)}function Ft(e){const t=ce(),n=ue();n.state==="active"&&wn({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}function Wt(e){var o,i;if(e.defaultPrevented)return;const t=ue(),n=ce();switch(t.state){case"active":{if(e.buttons===0){be({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(r=>{const l=ne(r.group.id,!0);Z(r.group,l)});return}for(const r of t.hitRegions)if(r.separator){const{element:l}=r.separator;(o=l.hasPointerCapture)!=null&&o.call(l,e.pointerId)||((i=l.setPointerCapture)==null||i.call(l,e.pointerId))}wn({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const r=rt(e,n);r.length===0?t.state!=="inactive"&&be({cursorFlags:0,state:"inactive"}):be({cursorFlags:0,hitRegions:r,state:"hover"}),at(e.currentTarget);break}}}function jt(e){e.relatedTarget instanceof HTMLIFrameElement&&ue().state==="hover"&&be({cursorFlags:0,state:"inactive"})}function Ut(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=ue();t.state==="active"&&(be({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(at(e.currentTarget),t.hitRegions.forEach(n=>{const o=ne(n.group.id,!0);Z(n.group,o)}),e.preventDefault()))}function Vt(e){let t=0,n=0;const o={};for(const r of e)if(r.defaultSize!==void 0){t++;const l=V(r.defaultSize);n+=l,o[r.panelId]=l}else o[r.panelId]=void 0;const i=e.length-t;if(i!==0){const r=V((100-n)/i);for(const l of e)l.defaultSize===void 0&&(o[l.panelId]=r)}return o}function Jo(e,t,n){if(!n[0])return;const o=e.panels.find(a=>a.element===t);if(!o||!o.onResize)return;const i=ve({group:e}),r=e.orientation==="horizontal"?o.element.offsetWidth:o.element.offsetHeight,l=o.mutableValues.prevSize,s={asPercentage:V(r/i*100),inPixels:r};o.mutableValues.prevSize=s,o.onResize(s,o.id,l)}function Qo(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Zo({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:o}){var p,d;if(n<=0||t<=0||n===t)return o;let i=0,r=0,l=!1;const s=new Map,a=[];for(const b of e.panels){const y=(p=o[b.id])!=null?p:0;
1if(b.panelConstraints.groupResizeBehavior==="preserve-pixel-size"){l=!0;const h=y/100*n,g=V(h/t*100);s.set(b.id,g),i+=g}else a.push(b.id),r+=y}if(!l||a.length===0)return o;const c=100-i,u=T({},o);if(s.forEach((b,y)=>{u[y]=b}),r>0)for(const b of a){const y=(d=o[b])!=null?d:0;u[b]=V(y/r*c)}else{const b=V(c/a.length);for(const y of a)u[y]=b}return u}function er(e,t){const n=e.map(i=>i.id),o=Object.keys(t);if(n.length!==o.length)return!1;for(const i of n)if(!o.includes(i))return!1;return!0}const pe=new Map;function tr(e){var y,h,g;let t=!0;R(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,o=new Set,i=new Set,r=new n(f=>{for(const v of f){const{borderBoxSize:x,target:w}=v;if(w===e.element){if(t){const S=ve({group:e});if(S===0)return;const z=ne(e.id);if(!z)return;const C=Qe(e),D=z.defaultLayoutDeferred?Vt(C):z.layout,L=Zo({group:e,nextGroupSize:S,prevGroupSize:z.groupSize,prevLayout:D}),E=le({layout:L,panelConstraints:C});if(!z.defaultLayoutDeferred&&se(z.layout,E)&&Qo(z.derivedPanelConstraints,C)&&z.groupSize===S)return;Z(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:C,groupSize:S,layout:E,separatorToPanels:z.separatorToPanels})}}else Jo(e,w,x)}});r.observe(e.element),e.panels.forEach(f=>{R(!o.has(f.id),'Panel ids must be unique; id "'.concat(f.id,'" was used more than once')),o.add(f.id),f.onResize&&r.observe(f.element)});const l=ve({group:e}),s=Qe(e),a=e.panels.map(({id:f})=>f).join(",");let c=e.mutableState.defaultLayout;c&&(er(e.panels,c)||(c=void 0));const u=(h=(y=e.mutableState.layouts[a])!=null?y:c)!=null?h:Vt(s),p=le({layout:u,panelConstraints:s}),d=e.element.ownerDocument;pe.set(d,((g=pe.get(d))!=null?g:0)+1);const b=new Map;return fn(e).forEach(f=>{f.separator&&b.set(f.separator,f.panels)}),Z(e,{defaultLayoutDeferred:l===0,derivedPanelConstraints:s,groupSize:l,layout:p,separatorToPanels:b}),e.separators.forEach(f=>{R(!i.has(f.id),'Separator ids must be unique; id "'.concat(f.id,'" was used more than once')),i.add(f.id),f.element.addEventListener("keydown",_t)}),pe.get(d)===1&&(d.addEventListener("dblclick",At,!0),d.addEventListener("pointerdown",It,!0),d.addEventListener("pointerleave",Ft),d.addEventListener("pointermove",Wt),d.addEventListener("pointerout",jt),d.addEventListener("pointerup",Ut,!0)),function(){var f;t=!1,pe.set(d,Math.max(0,((f=pe.get(d))!=null?f:0)-1)),Oo(e),e.separators.forEach(v=>{v.element.removeEventListener("keydown",_t)}),pe.get(d)||(d.removeEventListener("dblclick",At,!0),d.removeEventListener("pointerdown",It,!0),d.removeEventListener("pointerleave",Ft),d.removeEventListener("pointermove",Wt),d.removeEventListener("pointerout",jt),d.removeEventListener("pointerup",Ut,!0)),r.disconnect()}}function nr(){const[e,t]=K({}),n=j(()=>t({}),[]);return[e,n]}function st(e){const t=Vn();return"".concat(e!=null?e:t)}const de=typeof window<"u"?Ae:H;function Ce(e){const t=W(e);return de(()=>{t.current=e},[e]),j((...n)=>{var o;return(o=t.current)==null?void 0:o.call(t,...n)},[t])}function lt(...e){return Ce(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function ut(e){const t=W(T({},e));return de(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const zn=_e(null);function or(e,t){const n=W({getLayout:()=>({}),setLayout:qo});tn(t,()=>n.current,[]),de(()=>{Object.assign(n.current,bn({groupId:e}))})}function Cn(y){var h=y,{children:e,className:t,defaultLayout:n,disableCursor:o,disabled:i,elementRef:r,groupRef:l,id:s,onLayoutChange:a,onLayoutChanged:c,orientation:u="horizontal",resizeTargetMinimumSize:p={coarse:20,fine:10},style:d}=h,b=oe(h,["children","className","defaultLayout","disableCursor","disabled","elementRef","groupRef","id","onLayoutChange","onLayoutChanged","orientation","resizeTargetMinimumSize","style"]);const g=W({onLayoutChange:{},onLayoutChanged:{}}),f=Ce(P=>{se(g.current.onLayoutChange,P)||(g.current.onLayoutChange=P,a==null||a(P))}),v=Ce(P=>{se(g.current.onLayoutChanged,P)||(g.current.onLayoutChanged=P,c==null||c(P))}),x=st(s),w=W(null),[S,z]=nr(),C=W({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:p,separators:[]}),D=lt(w,r);or(x,l);const L=Ce((P,k)=>{var A;const N=ue(),M=Tt(P),O=ne(P);if(O){let B=!1;return N.state==="active"&&(B=N.hitRegions.some($=>$.group===M)),{flexGrow:(A=O.layout[k])!=null?A:1,pointerEvents:B?"none":void 0}}if(n!=null&&n[k])return{flexGrow:n==null?void 0:n[k]}}),E=ut({defaultLayout:n,disableCursor:o}),G=q(()=>
1({get disableCursor(){return!!E.disableCursor},getPanelStyles:L,id:x,orientation:u,registerPanel:P=>{const k=C.current;return k.panels=Ze(u,[...k.panels,P]),z(),()=>{k.panels=k.panels.filter(N=>N!==P),z()}},registerSeparator:P=>{const k=C.current;return k.separators=Ze(u,[...k.separators,P]),z(),()=>{k.separators=k.separators.filter(N=>N!==P),z()}},updatePanelProps:(P,{disabled:k})=>{const N=C.current.panels.find(A=>A.id===P);N&&(N.panelConstraints.disabled=k);const M=Tt(x),O=ne(x);M&&O&&Z(M,I(T({},O),{derivedPanelConstraints:Qe(M)}))},updateSeparatorProps:(P,{disabled:k,disableDoubleClick:N})=>{const M=C.current.separators.find(O=>O.id===P);M&&(M.disabled=k,M.disableDoubleClick=N)}}),[L,x,z,u,E]),U=W(null);return de(()=>{const P=w.current;if(P===null)return;const k=C.current;let N;if(E.defaultLayout!==void 0&&Object.keys(E.defaultLayout).length===k.panels.length){N={};for(const ee of k.panels){const fe=E.defaultLayout[ee.id];fe!==void 0&&(N[ee.id]=fe)}}const M={disabled:!!i,element:P,id:x,mutableState:{defaultLayout:N,disableCursor:!!E.disableCursor,expandedPanelSizes:C.current.lastExpandedPanelSizes,layouts:C.current.layouts},orientation:u,panels:k.panels,resizeTargetMinimumSize:k.resizeTargetMinimumSize,separators:k.separators};U.current=M;const O=tr(M),{defaultLayoutDeferred:A,derivedPanelConstraints:B,layout:$}=ne(M.id,!0);!A&&B.length>0&&(f($),v($));const xe=ot(x,ee=>{const{defaultLayoutDeferred:fe,derivedPanelConstraints:mt,layout:Ee}=ee.next;if(fe||mt.length===0)return;const On=M.panels.map(({id:Q})=>Q).join(",");M.mutableState.layouts[On]=Ee,mt.forEach(Q=>{var ht;if(Q.collapsible){const{layout:We}=(ht=ee.prev)!=null?ht:{};if(We){const Gn=F(Q.collapsedSize,Ee[Q.panelId]),$n=F(Q.collapsedSize,We[Q.panelId]);Gn&&!$n&&(M.mutableState.expandedPanelSizes[Q.panelId]=We[Q.panelId])}}});const Bn=ue().state!=="active";f(Ee),Bn&&v(Ee)});return()=>{U.current=null,O(),xe()}},[i,x,v,f,u,S,E]),H(()=>{const P=U.current;P&&(P.mutableState.defaultLayout=n,P.mutableState.disableCursor=!!o)}),m(zn.Provider,{value:G,children:m("div",I(T({},b),{className:t,"data-group":!0,"data-testid":x,id:x,ref:D,style:I(T({height:"100%",width:"100%",overflow:"hidden"},d),{display:"flex",flexDirection:u==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:u==="horizontal"?"pan-y":"pan-x"}),children:e}))})}Cn.displayName="Group";function ct(){const e=Ie(zn);return R(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function rr(e,t){const{id:n}=ct(),o=W({collapse:je,expand:je,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:je});tn(t,()=>o.current,[]),de(()=>{Object.assign(o.current,hn({groupId:n,panelId:e}))})}function Dn(h){var g=h,{children:e,className:t,collapsedSize:n="0%",collapsible:o=!1,defaultSize:i,disabled:r,elementRef:l,groupResizeBehavior:s="preserve-relative-size",id:a,maxSize:c="100%",minSize:u="0%",onResize:p,panelRef:d,style:b}=g,y=oe(g,["children","className","collapsedSize","collapsible","defaultSize","disabled","elementRef","groupResizeBehavior","id","maxSize","minSize","onResize","panelRef","style"]);const f=!!a,v=st(a),x=ut({disabled:r}),w=W(null),S=lt(w,l),{getPanelStyles:z,id:C,orientation:D,registerPanel:L,updatePanelProps:E}=ct(),G=p!==null,U=Ce((M,O,A)=>{p==null||p(M,a,A)});de(()=>{const M=w.current;if(M!==null){const O={element:M,id:v,idIsStable:f,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:G?U:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:o,defaultSize:i,disabled:x.disabled,maxSize:c,minSize:u}};return L(O)}},[s,n,o,i,G,v,f,c,u,U,L,x]),H(()=>{E(v,{disabled:r})},[r,v,E]),rr(v,d);const P=()=>{const M=z(C,v);if(M)return JSON.stringify(M)},k=Un(M=>ot(C,M),P,P);let N;return k?N=JSON.parse(k):i!==void 0?N={flexGrow:void 0,flexShrink:void 0,flexBasis:i}:N={flexGrow:1},m("div",I(T({},y),{"data-disabled":r||void 0,"data-panel":!0,"data-testid":v,id:v,ref:S,style:T(I(T({},ir),{display:"flex",flexBasis:0,flexShrink:1,overflow:"visible"}),N),children:m("div",{className:t,style:I(T({maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto"},b),{touchAction:D==="horizontal"?"pan-y":"pan-x"}),children:e})}))}Dn.displayName="Panel";const ir={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function ar(){return W(null)}function sr({layout:e,panelConstraints:t,panelId:n,panelIndex:o}){let i,r;const l=e[n],s=t.find(a=>a.panelId===n);if(s){const a=s.maxSize,c=s.collapsible?s.collapsedSize:s.minSize,u=[o,o+1];r=le({layout:ke({delta:c-l,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=le({layout:ke({delta:a-l,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:r,valueNow:l}}function Pn(a){var c=a,{children:e,className:t,disabled:n,disableDoubleClick:o,elementRef:i,id:r,style:l}=c,s=oe(c,["children","className","disabled","disableDoubleClick","elementRef","id","style"]);const u=st(r),p=ut({disabled:n,disableDoubleClick:o}),[d,b]=K({}),[y,h]=K("inactive"),[g,f]=K(!1),v=W(null),x=lt(v,i),{disableCursor:w,id:S,orientation:z,registerSeparator:C,updateSeparatorProps:D}=ct(),L=z==="horizontal"?"vertical":"horizontal";de(()=>{const U=v.current;if(U!==null){const P={disabled:p.disabled,disableDoubleClick:p.disableDoubleClick,element:U,id:u},k=C(P),N=Yo(O=>{h(O.next.state!=="inactive"&&O.next.hitRegions.some(A=>A.separator===P)?O.next.state:"inactive")}),M=ot(S,O=>{const{derivedPanelConstraints:A,layout:B,separatorToPanels:$}=O.next,xe=$.get(P);
1if(xe){const ee=xe[0],fe=xe.indexOf(ee);b(sr({layout:B,panelConstraints:A,panelId:ee.id,panelIndex:fe}))}});return()=>{N(),M(),k()}}},[S,u,C,p]),H(()=>{D(u,{disabled:n,disableDoubleClick:o})},[n,o,u,D]);let E;n&&!w&&(E="not-allowed");let G;return n?G="disabled":y==="active"?G="active":g?G="focus":G=y,m("div",I(T({},s),{"aria-controls":d.valueControls,"aria-disabled":n||void 0,"aria-orientation":L,"aria-valuemax":d.valueMax,"aria-valuemin":d.valueMin,"aria-valuenow":d.valueNow,children:e,className:t,"data-separator":G,"data-testid":u,id:u,onBlur:()=>f(!1),onFocus:()=>f(!0),ref:x,role:"separator",style:I(T({flexBasis:"auto",cursor:E},l),{flexGrow:0,flexShrink:0,touchAction:"none"}),tabIndex:n?void 0:0}))}Pn.displayName="Separator";function lr(n){var o=n,{className:e}=o,t=oe(o,["className"]);return m(Cn,T({"data-slot":"resizable-panel-group",className:Y("flex h-full w-full aria-[orientation=vertical]:flex-col",e)},t))}function Ht(t){var e=oe(t,[]);return m(Dn,T({"data-slot":"resizable-panel"},e))}function ur(o){var i=o,{withHandle:e,className:t}=i,n=oe(i,["withHandle","className"]);return m(Pn,I(T({"data-slot":"resizable-handle",className:Y("bg-border ring-offset-background focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-4 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-4 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90",t)},n),{children:e&&m("div",{className:"bg-border z-10 flex h-24 w-4 shrink-0 rounded-12"})}))}function cr({usage:e}){const{usedBytes:t,limitBytes:n,percent:o}=e,i=Lt(t),r=n===null?"Unlimited":Lt(n);return _("div",{className:"flex flex-col gap-4",children:[_("div",{className:"text-foreground flex items-center justify-between text-base",children:[m("span",{className:"font-text",children:"Usage"}),_("span",{className:"font-display font-semibold",children:[i," / ",r]})]}),n!==null&&o!==null&&m("div",{role:"meter","aria-label":"Storage usage","aria-valuemin":0,"aria-valuemax":n,"aria-valuenow":Math.min(t,n),"aria-valuetext":"".concat(i," of ").concat(r," used"),className:"bg-brand-200 relative h-8 w-full overflow-hidden rounded-full",children:m("div",{className:"bg-gradient-purple-pink absolute inset-y-0 left-0 rounded-full",style:{width:"".concat(o,"%")}})})]})}function dr(){const e=ro(),t=qn();return!e&&!t?null:m("div",{className:"border-border border-t",children:_("div",{className:"flex flex-col gap-8 pr-16 pl-24 pt-8",children:[e&&m(cr,{usage:e}),t&&m("button",{type:"button",onClick:()=>Xn("upsellModal"),className:"bg-gradient-purple-pink font-display focus-visible:ring-ring inline-flex h-32 w-full items-center justify-center rounded-24 bg-clip-text text-base font-semibold text-transparent outline-none focus-visible:ring-3",children:"Upgrade plan"})]})})}const fr=5;function pr(e,t=!0,n=!0){var u;const{data:o,loading:i,error:r,fetchMore:l,refetch:s}=tt(Qn,{skip:!e||!t,fetchPolicy:"cache-first",variables:{userId:e,bucketType:Jn.Group,sorter:go,limit:fr}}),a=(u=o==null?void 0:o.bucketsByUserId)==null?void 0:u.nextToken;return H(()=>{t&&n&&!i&&a&&e&&l({variables:{nextToken:a,limit:mo}}).catch(p=>{nn.warn("useGroupSidebarData: failed to fetch next page of groups:",p)})},[t,n,i,a,e,l]),{buckets:q(()=>{var p,d;return((d=(p=o==null?void 0:o.bucketsByUserId)==null?void 0:p.items)!=null?d:[]).filter(b=>!b.isBanned)},[o]),loading:i||n&&!!a&&!r,error:r,refetch:s}}function gr(e,t,n){if(!e||e.bucketId!==t)return;if(n===void 0)return e.albumIds[0];const o=e.albumIds.indexOf(n);return o===-1?void 0:e.albumIds[o+1]}const mr={isExpanded:()=>!1,toggle:()=>{},expand:()=>{}},dt=_e(mr);function ft(){return Ie(dt)}function kn(e,t){const n=new Set(e);return t.reduce((i,r)=>n.has(r)?i:(n.add(r),!0),!1)?n:e}const hr={isOnSelectionPath:()=>!1,publishSelectionPath:()=>{}},Ln=_e(hr),Yt=[];function En({children:e}){const{pathname:t}=ye(),[n,o]=K({path:Yt,route:t}),i=n.route===t?n.path:Yt,r=q(()=>({isOnSelectionPath:l=>i.includes(l),publishSelectionPath:l=>o(s=>s.route===t&&s.path.length===l.length&&s.path.every((a,c)=>a===l[c])?s:{path:l,route:t})}),[i,t]);return m(Ln.Provider,{value:r,children:e})}function Be(){return Ie(Ln)}const Tn="data-tree-active";function br(e,t){Ae(function(){const o=e.current;if(!o)return;let i=0,r;const l=()=>{const a=o.querySelector("[".concat(Tn,"]"));if(!a)return;const c=o.getBoundingClientRect(),u=a.getBoundingClientRect();if(!(u.top>=c.top&&u.bottom<=c.bottom)){const d=o.scrollTop+(u.top-c.top)-(c.height-u.height)/2;o.scrollTop=Math.max(0,d)}r==null||r.disconnect()},s=()=>{cancelAnimationFrame(i),i=requestAnimationFrame(l)};return r=new MutationObserver(s),s(),r.observe(o,{childList:!0,subtree:!0}),()=>{cancelAnimationFrame(i),r==null||r.disconnect()}},[e,t])}const vr=24,yr=16,xr=88;function Mn(e){return Math.min(vr+e*yr,xr)}const Sr=32;function wr(e){return Mn(e)+Sr}const zr=on("flex h-40 w-full items-center gap-8 pr-8 text-base outline-none",{variants:{isActive:{true:"bg-brand-200 text-brand-700 font-display font-bold border-brand-700 border-r-2",false:"text-foreground font-text hover:bg-muted focus-within:bg-muted"},isOnSelectionPath:{true:"font-display font-bold",false:""}},defaultVariants:{isActive:!1,isOnSelectionPath:!1}});function Cr(e,t){return e&&t&&"bg-gradient-sidebar-selected border-accent"}function Dr({depth:e,label:t,count:n,isExpandable:o,isExpanded:i,isActive:r=!1,isOnSelectionPath:l=!1,rebrand:s=!1,onNavigate:a,onToggle:c,regionId:u,leading:p,action:d,onDragOver:b,onDragLeave:y,onDrop:h,isDropTarget:g=!1,isDropBlocked:f=!1}){return _("div",{[Tn]:r||void 0,onDragOver:b,onDragLeave:y,onDrop:h,className:Y("group",zr({isActive:r,isOnSelectionPath:l||r}),Cr(r,s),g&&"bg-brand-100 ring-2 ring-inset ring-brand-500",f&&"opacity-40"),children:[_("button",{type:"button",onClick:a,"aria-current":r?"page":void 0,style:{paddingLeft:"".concat(Mn(e),"px")}
1,className:"flex min-w-0 flex-1 items-center gap-8 py-8 text-left",children:[p&&m("span",{className:"flex size-24 shrink-0 items-center justify-center",children:p}),m("span",{title:t,className:"truncate",children:t}),n!==void 0&&_("span",{className:"shrink-0 text-sm whitespace-nowrap tabular-nums",children:["(",n,")"]})]}),d,o&&m("span",{className:"flex shrink-0 items-center pl-8",children:m("button",{type:"button",onClick:c,"aria-expanded":i,"aria-controls":i?u:void 0,"aria-label":i?"Collapse ".concat(t):"Expand ".concat(t),className:"text-foreground focus-visible:ring-ring inline-flex size-20 shrink-0 items-center justify-center rounded-4 outline-none focus-visible:ring-2",children:i?m(bo,{size:"small"}):m(ho,{size:"small"})})})]})}const Ge=Hn(Dr),Pr='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.45 7L11.3902 4.76892C11.0852 4.1268 10.9327 3.80573 10.7052 3.57116C10.504 3.36373 10.2615 3.20597 9.99527 3.10931C9.69421 3 9.3532 3 8.67118 3H5.04C3.9759 3 3.44385 3 3.03742 3.21799C2.67991 3.40973 2.38925 3.71569 2.20709 4.09202C2 4.51984 2 5.0799 2 6.2V7
1M2 7H15.44C17.0361 7 17.8342 7 18.4439 7.32698C18.9801 7.6146 19.5 8.36197 19.5 9M2 7V16.2C2 17.8802 2 18.7202 2.31063 19.362C2.58387 19.9265 3.01987 20.3854 3.55613 20.673C4.16578 21 4.96385 21 6.56 21H15.44" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M3 19.3077L7.35409 11.5C7.83869 10.6538 8.63376 10 9.54427 10C10.4548 10 17.5902 10 21.3839 10C22.8074 10 23.2884 11.6018 22.8353 12.5C21.9817 14.1923 20.1669 17.8974 18.9339 19.7308C18.7442 20.1538 18.1372 21 17.2267 21C16.3162 21 8.50098 21 4.7072 21" stroke="currentColor" stroke-width="2"/></svg>';function kr(e){return m(et,T({svg:Pr},e))}function Lr(e,t){var b,y;const{bucketId:n}=Yn(),o=(b=rn().currentUser)==null?void 0:b.uid,i=t!=null?t:n,r=tt(Zn,{skip:!i,variables:{bucketId:i!=null?i:"",albumId:e},fetchPolicy:"cache-first"}),l=(y=r.data)==null?void 0:y.bucketAlbums,s=l==null?void 0:l.nextToken,a=r.loading||!o||!i,c=r.fetchMore,{error:u,refetch:p}=r,d=q(()=>Ke.debounce(()=>{nn.info("fetching more albums",{nextToken:s}),s&&c({variables:{nextToken:s}})},300,{leading:!0}),[s,c]);return{bucketAlbums:l,loading:a,error:u,refetch:p,fetchMore:d,nextToken:s}}function $e(e){return{paddingLeft:"".concat(wr(e),"px")}}function Rn({depth:e}){return _("div",{style:$e(e),className:"text-muted-foreground flex h-36 items-center gap-8 pr-8",children:[m(yo,{size:"small",className:"animate-spin"}),m("span",{className:"sr-only",children:"Loading"})]})}function Nn({depth:e,label:t}){return m("div",{style:$e(e),className:"text-muted-foreground font-text flex h-36 items-center pr-8 text-sm whitespace-nowrap",children:t})}function An({depth:e,onRetry:t}){return _("div",{style:$e(e),className:"text-muted-foreground font-text flex h-36 items-center gap-8 pr-8 text-sm whitespace-nowrap",children:[m("span",{children:"Couldn't load"}),m("button",{type:"button",onClick:t,className:"text-brand-600 underline outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-4",children:"Retry"})]})}function Er({depth:e,onClick:t}){return m("div",{style:$e(e),className:"flex h-36 items-center pr-8",children:m("button",{type:"button",onClick:t,className:"text-brand-600 font-display text-sm font-semibold whitespace-nowrap outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-4",children:"Show more"})})}function Tr(){const{mutation:e,loading:t}=xo(),{settings:n}=eo(),o=W(n);return o.current=n,{moveMediaToAlbum:j((r,l,s)=>{if(!r||l.length===0)return;const a=o.current.sortBy?T({},o.current.sortBy):null,c=o.current.filterBy?T({},o.current.filterBy):null,u=Ke.isEmpty(a)?null:a,p=Ke.isEmpty(c)?null:c;return e({variables:{bucketId:r,mediaIds:l,data:{destinationAlbumId:s}},update:(d,{data:b})=>{b!=null&&b.bucketMediaMove&&b.bucketMediaMove.forEach(y=>{const h=d.readFragment({id:"BucketMedia:".concat(y),fragment:qe});h&&(d.updateQuery({query:Dt,variables:{bucketId:r,albumId:h.albumId,filterBy:p,sortBy:u}},g=>{var x;if(!g)return null;const{bucketMediaByAlbumId:f}=g,v=(x=f==null?void 0:f.items)!=null?x:[];return{bucketMediaByAlbumId:I(T({},f),{items:v.filter(w=>w.id!==h.id)})}}),d.updateQuery({query:Dt,variables:{bucketId:r,albumId:s,filterBy:p,sortBy:u}},g=>{var x;if(!g)return null;const{bucketMediaByAlbumId:f}=g,v=(x=f==null?void 0:f.items)!=null?x:[];return{bucketMediaByAlbumId:I(T({},f),{items:[h,...v]})}}),d.updateFragment({id:"BucketMedia:".concat(y),fragment:qe},g=>g?I(T({},g),{albumId:s}):null),d.updateFragment({id:"BucketAlbum:".concat(h.albumId),fragment:Pt},g=>{var v,x;if(!g)return null;const f=Math.max(((x=(v=g==null?void 0:g.counters)==null?void 0:v.totalMedia)!=null?x:0)-1,0);return I(T({},g),{counters:I(T({},g.counters),{totalMedia:f})})}),d.updateFragment({id:"BucketAlbum:".concat(s),fragment:Pt},g=>{var v,x;if(!g)return null;const f=((x=(v=g==null?void 0:g.counters)==null?void 0:v.totalMedia)!=null?x:0)+1;return I(T({},g),{counters:I(T({},g.counters),{totalMedia:f})})}))})}})},[e]),loading:t}}const _n=_e(()=>{});function Mr({children:e}){const{moveMediaToAlbum:t}=Tr();return m(_n.Provider,{value:t,children:e})}function Rr(){return Ie(_n)}function pt(e,t){const n=Oe(Pe),o=an(),i=Rr(),[r,l]=K(!1),s=!!n&&n.sourceBucketId===e;return{onDragOver:p=>
1{if(!s)return;p.preventDefault();const{dataTransfer:d}=p;d.dropEffect="move",r||l(!0)},onDragLeave:p=>{p.relatedTarget instanceof Node&&p.currentTarget.contains(p.relatedTarget)||r&&l(!1)},onDrop:p=>{if(l(!1),!n||n.sourceBucketId!==e)return;p.preventDefault();const d=t!=null?t:null,b=n.mediaIds.filter(y=>{var g;const h=o.readFragment({id:"BucketMedia:".concat(y),fragment:qe});return((g=h==null?void 0:h.albumId)!=null?g:null)!==d});Pe(null),b.length!==0&&i(e,b,d)},isDropTarget:s&&r,isDropBlocked:!!n&&!!e&&!s}}const Nr=600;function Fe(e,t,n){const{isExpanded:o,expand:i}=n,r=Oe(Pe)!==null,l=W(void 0),s=j(()=>{l.current&&(clearTimeout(l.current),l.current=void 0)},[]),a=j(u=>{!r||!t||o(e)||l.current||(l.current=setTimeout(()=>{l.current=void 0,i(e)},Nr))},[r,t,o,e,i]),c=j(u=>{u.relatedTarget instanceof Node&&u.currentTarget.contains(u.relatedTarget)||s()},[s]);return H(()=>(r||s(),s),[r,s]),{onDragOver:a,onDragLeave:c}}function Ar({album:e,bucketId:t,depth:n,isSubalbum:o=!1,getAlbumHref:i,ancestorKeys:r=[],rebrand:l}){var G,U,P;const s=Le(),{pathname:a}=ye(),c=ft(),{isExpanded:u,toggle:p}=c,{isOnSelectionPath:d,publishSelectionPath:b}=Be(),y="album:".concat(t,":").concat(e.id),h="album-".concat(t,"-").concat(e.id,"-region"),g=(P=(U=e.subAlbumCount)!=null?U:(G=e.counters)==null?void 0:G.totalSubalbums)!=null?P:0,f=g>0,v=u(y),x=i?i(t,e.id):"/bucket/".concat(t,"/album/").concat(e.id),w=pt(t,e.id),S=Fe(y,f,c);let z=m(Je,{size:"base","data-testid":"sidebar-album-icon"});o?z=m("span",{className:"size-4 shrink-0 rounded-full bg-muted-foreground","data-testid":"sidebar-album-bullet","aria-hidden":!0}):v&&f&&(z=m(kr,{size:"base","data-testid":"sidebar-album-open-icon"}));const C=k=>{w.onDragOver(k),S.onDragOver(k)},D=k=>{w.onDragLeave(k),S.onDragLeave(k)},L=a===x,E=q(()=>[...r,y],[r,y]);return Ae(function(){L&&b(E)},[L,E,b]),_(De,{children:[m(Ge,{depth:n,label:e.title,count:f?g:void 0,isExpandable:f,isExpanded:v,isActive:L,isOnSelectionPath:d(y),rebrand:l,onNavigate:()=>s(x),onToggle:()=>p(y),regionId:h,onDragOver:C,onDragLeave:D,onDrop:w.onDrop,isDropTarget:w.isDropTarget,isDropBlocked:w.isDropBlocked,leading:z}),f&&v&&m(gt,{bucketId:t,albumId:e.id,depth:n+1,regionId:h,isSubalbum:!0,getAlbumHref:i,ancestorKeys:E,rebrand:l})]})}function gt({bucketId:e,albumId:t,depth:n,regionId:o,isSubalbum:i=!1,getAlbumHref:r,ancestorKeys:l=[],rebrand:s}){var v;const{reveal:a}=ft(),{bucketAlbums:c,loading:u,error:p,refetch:d,fetchMore:b,nextToken:y}=Lr(t,e),h=(v=c==null?void 0:c.items)!=null?v:[],g=gr(a,e,t),f=!!g&&!u&&!p&&!h.some(x=>x.id===g);return H(function(){f&&y&&b()},[f,y,b]),_("div",{id:o,children:[u&&m(Rn,{depth:n}),!u&&p&&m(An,{depth:n,onRetry:()=>d==null?void 0:d()}),!u&&!p&&h.length===0&&m(Nn,{depth:n,label:"No albums"}),h.map(x=>m(Ar,{album:x,bucketId:e,depth:n,isSubalbum:i,getAlbumHref:r,ancestorKeys:l,rebrand:s},x.id)),!u&&y&&m(Er,{depth:n,onClick:()=>b()})]})}function _r(e,t){if(e===t)return!0;if(!e.startsWith("".concat(t,"/")))return!1;const[n,o]=e.slice(t.length+1).split("/");return!((n.toLowerCase()==="albums"||n.toLowerCase()==="album")&&o)}function Ir({bucket:e,depth:t,ancestorKeys:n=[],rebrand:o}){const i=Le(),{pathname:r}=ye(),l=ft(),{isExpanded:s,toggle:a}=l,{isOnSelectionPath:c,publishSelectionPath:u}=Be(),p="bucket:".concat(e.id),d="bucket-".concat(e.id,"-region"),{albumCount:b}=vo(e.id),y=(b!=null?b:0)>0,h=s(p)&&y,g=pt(e.id,null),f=Fe(p,y,l),v=D=>{g.onDragOver(D),f.onDragOver(D)},x=D=>{g.onDragLeave(D),f.onDragLeave(D)},w="/groups/".concat(e.id),S="/bucket/".concat(e.id),z=_r(r,w)||r===S,C=q(()=>[...n,p],[n,p]);return Ae(function(){z&&u(C)},[z,C,u]),_(De,{children:[m(Ge,{depth:t,label:e.title,count:y&&b!=null?b:void 0,isExpandable:y,isExpanded:h,isActive:z,isOnSelectionPath:c(p),rebrand:o,leading:m(Xe,{size:"base","data-testid":"sidebar-group-icon"}),onNavigate:()=>i(w),onToggle:()=>a(p),regionId:d,onDragOver:v,onDragLeave:x,onDrop:g.onDrop,isDropTarget:g.isDropTarget,isDropBlocked:g.isDropBlocked}),h&&m(gt,{bucketId:e.id,depth:t+1,regionId:d,isSubalbum:!0,getAlbumHref:(D,L)=>"/groups/".concat(D,"/albums/").concat(L),ancestorKeys:C,rebrand:o})]})}function Or({buckets:e,loading:t,error:n,depth:o,refetch:i,limit:r,ancestorKeys:l=[],rebrand:s}){if(t&&e.length===0)return m(Rn,{depth:o});if(n&&e.length===0)return m(An,{depth:o,onRetry:i});if(e.length===0)return m(Nn,{depth:o,label:"No groups yet"});const a=r===void 0?e:e.slice(0,r);return m(De,{children:a.map(c=>m(Ir,{bucket:c,depth:o,ancestorKeys:l,rebrand:s},c.id))})}function Ue(e){return{target:e,chain:[],cursor:e,status:"walking"}}function In(e,t,n=!1){var b,y;const{cache:o}=an(),[i,r]=K(()=>Ue(t)),l=i.target===t?i:Ue(t);H(function(){i.target!==t&&r(Ue(t))},[t,i.target]);
1const s=l.status==="walking"&&!!e&&!!l.cursor&&!n,a=s&&l.cursor?So(o,l.cursor):null,{data:c,error:u}=tt(to,{skip:!s||!!a,fetchPolicy:"cache-first",variables:{bucketId:e!=null?e:"",albumId:(b=l.cursor)!=null?b:""}}),p=a!=null?a:c==null?void 0:c.bucketAlbum,d=p&&p.id===l.cursor?(y=wo(p))!=null?y:null:void 0;return H(function(){if(s){if(u){r(g=>I(T({},g),{status:"stopped"}));return}if(d!==void 0){if(d===null){r(g=>I(T({},g),{status:"resolved"}));return}r(g=>g.chain.includes(d)?I(T({},g),{status:"stopped"}):I(T({},g),{chain:[d,...g.chain],cursor:d}))}}},[d,u,s]),q(()=>({ancestorIds:l.chain,resolved:l.status==="resolved"}),[l])}const ie="groups",Kt="sidebar-groups-region",Br=[ie],qt=5;function Gr({isCollapsed:e,isDropBlocked:t=!1}){var M,O;const n=Le(),{pathname:o}=ye(),i=(O=(M=rn().currentUser)==null?void 0:M.uid)!=null?O:"",{open:r}=po(),l=nt("isGroupsyRebrandEnabled"),{isOnSelectionPath:s}=Be(),a=o.startsWith("/groups/")&&o.slice(8).split("/")[0]||void 0,c=a?"/groups/".concat(a,"/albums/"):void 0,u=c&&o.startsWith(c)&&o.slice(c.length).split("/")[0]||void 0,p=!!u&&s("album:".concat(a,":").concat(u)),{ancestorIds:d,resolved:b}=In(a,u,p),y=q(()=>b&&a&&u?{bucketId:a,albumIds:[...d,u]}:void 0,[b,a,u,d]),[h,g]=K(!1),[f,v]=K(()=>new Set),x=j(A=>f.has(A),[f]),w=j(A=>{v(B=>{const $=new Set(B);return $.has(A)?$.delete(A):$.add(A),$})},[]),S=j(A=>{v(B=>B.has(A)?B:new Set(B).add(A))},[]),z=q(()=>({isExpanded:x,toggle:w,expand:S,reveal:y}),[x,w,S,y]),C=Fe(ie,!0,z),D=x(ie),L=io(),{buckets:E,loading:G,error:U,refetch:P}=pr(i,D,h),k=!!a&&D&&!G&&!E.some(A=>A.id===a);H(function(){a&&(k&&g(!0),v(B=>{const $="bucket:".concat(a);return B.has(ie)&&B.has($)?B:new Set(B).add(ie).add($)}))},[a,k]),H(function(){!a||d.length===0||v(B=>kn(B,d.map($=>"album:".concat(a,":").concat($))))},[d,a]);const N=o==="/groups";return e?m("button",{type:"button","aria-label":"Groups","aria-current":N?"page":void 0,onClick:()=>n("/groups"),className:Y("flex h-40 w-full items-center justify-center outline-none focus-visible:bg-muted",N?"bg-brand-200 text-brand-700":"text-foreground hover:bg-muted"),children:m(Xe,{size:"base"})}):_(dt.Provider,{value:z,children:[m(Ge,{depth:0,label:"Groups",count:L,isExpandable:!0,isExpanded:D,isActive:N,isOnSelectionPath:s(ie),rebrand:l,onNavigate:()=>n("/groups"),onToggle:()=>w(ie),regionId:Kt,onDragOver:C.onDragOver,onDragLeave:C.onDragLeave,isDropBlocked:t,leading:m(Xe,{size:"base"}),action:m(ln,{size:"xs","aria-label":"Create a group",icon:m(un,{size:"base"}),onClick:()=>r(),className:"bg-brand-700 text-white hover:bg-brand-700/90"})}),D&&_("div",{id:Kt,children:[m(Or,{buckets:E,loading:G,error:U,depth:1,refetch:P,limit:h?void 0:qt,ancestorKeys:Br,rebrand:l}),!U&&!h&&Math.max(L!=null?L:0,E.length)>qt&&m("div",{style:{paddingLeft:"40px"},className:"py-4",children:_("button",{type:"button",onClick:()=>g(!0),className:"text-brand-700 font-display inline-flex items-center gap-4 text-xs font-bold uppercase whitespace-nowrap outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-4",children:["Expand all groups",m(Do,{size:"xsmall"})]})})]})]})}function $r(e){return m(En,{children:m(Gr,{isCollapsed:e.isCollapsed,isDropBlocked:e.isDropBlocked})})}const ae="albums",Ve="sidebar-albums-region",Fr=[ae];function Wr({isCollapsed:e,isDropBlocked:t=!1}){const n=Le(),{pathname:o}=ye(),i=sn(),r=nt("isGroupsyRebrandEnabled"),{isOnSelectionPath:l}=Be(),{open:s}=zo(),a=o==="/library/albums",c=ao(i),u="/library/albums/",p=o.startsWith(u)?o.slice(u.length).split("/")[0]:void 0,d=!!p&&l("album:".concat(i,":").concat(p)),{ancestorIds:b,resolved:y}=In(i,p,d),h=q(()=>y&&i&&p?{bucketId:i,albumIds:[...b,p]}:void 0,[y,i,p,b]),[g,f]=K(()=>new Set),v=j(D=>g.has(D),[g]),x=j(D=>{f(L=>{const E=new Set(L);return E.has(D)?E.delete(D):E.add(D),E})},[]),w=j(D=>{f(L=>L.has(D)?L:new Set(L).add(D))},[]),S=q(()=>({isExpanded:v,toggle:x,expand:w,reveal:h}),[v,x,w,h]),z=Fe(ae,!0,S);if(H(function(){p&&f(L=>{if(L.has(ae))return L;const E=new Set(L);return E.add(ae),E})},[p]),H(function(){!i||b.length===0||f(L=>kn(L,b.map(E=>"album:".concat(i,":").concat(E))))},[b,i]),e)return m("button",{type:"button","aria-label":"Albums","aria-current":a?"page":void 0,onClick:()=>n("/library/albums"),className:Y("flex h-40 w-full items-center justify-center outline-none focus-visible:bg-muted",a?"bg-brand-200 text-brand-700":"text-foreground hover:bg-muted"),children:m(Je,{size:"base"})});const C=v(ae);return _(dt.Provider,{value:S,children:[m(Ge,{depth:0,label:"Albums",count:c,isExpandable:!0,isExpanded:C,isActive:a,isOnSelectionPath:l(ae),rebrand:r,onNavigate:()=>n("/library/albums"),onToggle:()=>x(ae),regionId:Ve,onDragOver:z.onDragOver,onDragLeave:z.onDragLeave,isDropBlocked:t,leading:m(Je,{size:"base"}),action:m(ln,{size:"xs","aria-label":"Create an album",icon:m(un,{size:"base"}),onClick:()=>s(),className:"bg-brand-700 text-white hover:bg-brand-700/90"})}),C&&i&&m("div",{id:Ve,children:m(gt,{bucketId:i,depth:1,regionId:Ve,getAlbumHref:(D,L)=>"/library/albums/".concat(L),ancestorKeys:Fr,rebrand:r})})]})}function jr(e){return m(En,{children:m(Wr,{isCollapsed:e.isCollapsed,isDropBlocked:e.isDropBlocked})})}function Ur(){var t;const e=Oe(Pe);return{isDragging:e!==null,sourceBucketId:(t=e==null?void 0:e.sourceBucketId)!=null?t:null}}const ge=48,Xt=18;function Vr(){const e=Oe(Pe)!==null,t=W(null),n=W(0),o=W(void 0),i=j(()=>{n.current=0,o.current!==void 0&&(cancelAnimationFrame(o.current),o.current=void 0)},[]),r=j(()=>{const a=t.current;if(!a||n.current===0){o.current=void 0;return}a.scrollTop+=n.current,o.current=requestAnimationFrame(r)},[]),l=j(a=>{const c=t.current;if(!c||!e)return;const u=c.getBoundingClientRect(),{clientY:p}=a;let d=0;p<u.top+ge?d=-Math.ceil((u.top+ge-p)/ge*Xt):p>u.bottom-ge&&(d=Math.ceil((p-(u.bottom-ge))/ge*Xt)),n.current=d,d!==0&&o.current===void 0&&(o.current=requestAnimationFrame(r))},[e,r]),s=j(a=>{a.relatedTarget instanceof Node&&a.currentTarget.contains(a.relatedTarget)||i()},[i]);return H(()=>(e||i(),i),[e,i]),{scrollRef:t,onDragOver:l,onDragLeave:s}}function Hr({isCollapsed:e,onClick:t}){return m("div",{className:Y("flex w-full items-center",e?"justify-center":"justify-end pr-16"),children:m("button",{type:"button",onClick:t,"aria-label":e?"Expand navigation":"Collapse navigation","aria-expanded":!e,className:"text-foreground hover:bg-muted focus-visible:ring-ring inline-flex size-32 items-center justify-center rounded-8 outline-none focus-visible:ring-3",children:m(ko,{size:"base",className:Y(e&&"scale-x-[-1]")})})})}const Jt=on("flex h-40 items-center text-base outline-none focus-visible:bg-muted",{variants:{isActive:{true:"bg-brand-200 text-brand-700 font-display font-bold",false:"text-foreground font-text hover:bg-muted"},isCollapsed:{true:"w-full justify-center px-0",false:"w-full gap-8 pr-8 pl-24"}},compoundVariants:[{isActive:!0,isCollapsed:!1,className:"border-brand-700 border-r-2"}],defaultVariants:{isActive:!1,isCollapsed:!1}});function Qt(e,t,n){return!e||!n?!1:Y("bg-gradient-sidebar-selected",!t&&"border-accent")}function ze({icon:e,label:t,count:n,isActive:o=!1,isCollapsed:i,onClick:r,rebrand:l,onDragOver:s,onDragLeave:a,onDrop:c,isDropTarget:u=!1,isBlocked:p=!1}){const d=Y(u&&"bg-brand-100 ring-2 ring-inset ring-brand-500",p&&"opacity-40");return i?m("button",{type:"button","aria-label":t,"aria-current":o?"page":void 0,onClick:r,onDragOver:s,onDragLeave:a,onDrop:c,className:Y(Jt({isActive:o,isCollapsed:!0}),Qt(o,!0,l),d),children:m(e,{size:"base"})}):_("button",{type:"button","aria-current":o?"page":void 0,onClick:r,onDragOver:s,onDragLeave:a,onDrop:c,className:Y(Jt({isActive:o,isCollapsed:!1}),Qt(o,!1,l),d),children:[m(e,{size:"base"}),_("span",{className:"flex-1 truncate text-left",children:[t,n!==void 0&&" (".concat(n,")")]})]})}function Yr({libraryId:e,isActive:t,isCollapsed:n,onNavigate:o,rebrand:i}){const r=pt(e!=null?e:"",null);return m(ze,{icon:lo,label:"My Uploads",isActive:t,isCollapsed:n,onClick:o,rebrand:i,onDragOver:r.onDragOver,onDragLeave:r.onDragLeave,onDrop:r.onDrop,isDropTarget:r.isDropTarget,isBlocked:r.isDropBlocked})}function Zt({label:e,isBlocked:t=!1}){return m("div",{className:Y("text-foreground font-text pt-16 pr-0 pb-0 pl-24 text-sm font-bold tracking-wide uppercase",t&&"opacity-40"),children:e})}function He(){return m("div",{className:"bg-border h-px w-full shrink-0",role:"separator"})}const en="text-foreground font-text hover:bg-muted focus-visible:ring-ring py-4 pr-24 pl-24 text-base no-underline outline-none focus-visible:ring-2";function Ye({to:e,href:t,target:n,children:o}){return e!==void 0?m(Kn,{to:e,className:en,children:o}):m("a",{href:t,target:n,rel:n==="_blank"?"noopener noreferrer":void 0,className:en,children:o})}function Kr({isCollapsed:e,onToggleCollapse:t}){const{pathname:n}=ye(),o=Le(),i=nt("isGroupsyRebrandEnabled"),r=n.startsWith("/groups"),l=n==="/library/albums"||n.startsWith("/library/albums/"),s=n.startsWith("/library/trash"),a=n.startsWith("/library/links"),c=n.startsWith("/library/favorites"),u=(n==="/library"||n.startsWith("/library/"))&&!l&&!s&&!a&&!c,p=sn(),{scrollRef:d,onDragOver:b,onDragLeave:y}=Vr();br(d,n);const{isDragging:h,sourceBucketId:g}
1=Ur(),f=h&&!!p&&g===p,v=h&&!!p&&g!==p;return _("nav",{"aria-label":i?"Groupsy navigation":"Photobucket navigation",className:"flex h-full flex-col pt-32 pb-24",children:[m(Hr,{isCollapsed:e,onClick:t}),m("div",{ref:d,onDragOver:b,onDragLeave:y,className:"flex-1 overflow-y-auto overflow-x-hidden",children:_(Mr,{children:[m(ze,{icon:so,label:"Home",isActive:!r&&!u&&!l&&!a&&!s&&!c,isCollapsed:e,onClick:()=>o("/home"),rebrand:i,isBlocked:h}),m(He,{}),!e&&m(Zt,{label:"Library",isBlocked:v}),m(Yr,{libraryId:p,isActive:u,isCollapsed:e,onNavigate:()=>o("/library"),rebrand:i}),m(jr,{isCollapsed:e,isDropBlocked:v}),m(ze,{icon:uo,label:"Public Links",isActive:a,isCollapsed:e,onClick:()=>o("/library/links"),rebrand:i}),m(ze,{icon:co,label:"Favorites",isActive:c,isCollapsed:e,onClick:()=>o("/library/favorites"),rebrand:i,isBlocked:h}),m(ze,{icon:fo,label:"Recently Deleted",isActive:s,isCollapsed:e,onClick:()=>o("/library/trash"),rebrand:i,isBlocked:h}),m(He,{}),!e&&m(Zt,{label:"Groups",isBlocked:f}),m($r,{isCollapsed:e,isDropBlocked:f}),m(He,{}),!e&&_("div",{className:"flex flex-col gap-8 py-8",children:[m(Ye,{href:no.CONTACT_US,target:"_blank",children:"Submit Feedback"}),m(Ye,{to:kt.PRIVACY_POLICY,children:"Privacy Policy"}),m(Ye,{to:kt.TERMS_OF_SERVICE,children:"Terms of Use"})]})]})}),!e&&m(dr,{})]})}const qr="(min-width: 1200px)";function Hi(){const e=ar(),[t,n]=K(!1),o=()=>{const r=e.current;r&&(r.isCollapsed()?r.expand():r.collapse())};return oo(qr)?_(De,{children:[_(lr,{orientation:"horizontal",className:"h-full",children:[m(Ht,{panelRef:e,defaultSize:"236px",minSize:"200px",maxSize:"400px",collapsible:!0,collapsedSize:"64px",onResize:()=>{var l,s;const r=(s=(l=e.current)==null?void 0:l.isCollapsed())!=null?s:!1;n(a=>a===r?a:r)},children:m(Kr,{isCollapsed:t,onToggleCollapse:o})}),m(ur,{}),m(Ht,{className:"pt-16",children:m("main",{className:"h-full overflow-y-auto",children:m(Ct,{})})})]}),m(Et,{})]}):_(De,{children:[m(Ct,{}),m(Et,{})]})}export{Hi as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.