@hienlh/ppm 0.2.21 → 0.3.0
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/CHANGELOG.md +21 -3
- package/dist/web/assets/{chat-tab-C_U7EwM9.js → chat-tab-BHrizSRk.js} +2 -2
- package/dist/web/assets/{code-editor-DuarTBEe.js → code-editor-B9B6BZbl.js} +1 -1
- package/dist/web/assets/{diff-viewer-sBWBgb7U.js → diff-viewer-DI3baLow.js} +1 -1
- package/dist/web/assets/{git-graph-fOKEZiot.js → git-graph-7qqwcWri.js} +1 -1
- package/dist/web/assets/index-DnbqOQf5.css +2 -0
- package/dist/web/assets/index-wdrrHLzl.js +21 -0
- package/dist/web/assets/{settings-tab-C5aWMqIA.js → settings-tab-WE-GP2Ig.js} +1 -1
- package/dist/web/assets/{use-monaco-theme-BxaccPmI.js → use-monaco-theme-DGDiih0R.js} +1 -1
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/package.json +1 -1
- package/src/web/app.tsx +9 -1
- package/src/web/components/chat/chat-tab.tsx +1 -1
- package/src/web/components/layout/editor-panel.tsx +44 -4
- package/src/web/components/settings/settings-tab.tsx +3 -1
- package/src/web/components/ui/scroll-area.tsx +2 -2
- package/src/web/stores/panel-store.ts +1 -8
- package/src/web/styles/globals.css +10 -4
- package/dist/web/assets/index-3zt5mBwZ.css +0 -2
- package/dist/web/assets/index-CaUQy3Zs.js +0 -21
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,n as t,r as n,t as r}from"./jsx-runtime-BFALxl05.js";import{A as i,C as a,E as o,_ as s,a as c,b as l,c as u,d,f,g as p,h as m,i as h,k as g,l as _,m as v,n as y,o as b,p as x,r as S,s as C,t as w,u as ee,v as T,w as E,x as D,y as O}from"./input-CTnwfHVN.js";import{n as k,t as A}from"./api-client-BCjah751.js";import{t as j}from"./utils-B-_GCz7E.js";import{F as M,M as te,P as N,g as P,h as ne}from"./index-CaUQy3Zs.js";var F=t(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),I=t(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),L=t(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),R=t(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),z=t(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),B=e(n(),1);function re(e){let t=B.useRef({value:e,previous:e});return B.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var V=r(),ie=`Label`,ae=B.forwardRef((e,t)=>(0,V.jsx)(E.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));ae.displayName=ie;var oe=ae,se=e(i(),1),ce=[` `,`Enter`,`ArrowUp`,`ArrowDown`],le=[` `,`Enter`],H=`Select`,[U,W,ue]=D(H),[G,de]=a(H,[ue,u]),K=u(),[fe,q]=G(H),[pe,me]=G(H),he=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:c,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:m,required:h,form:g}=e,_=K(t),[v,y]=B.useState(null),[b,x]=B.useState(null),[S,w]=B.useState(!1),ee=p(u),[E,D]=T({prop:r,defaultProp:i??!1,onChange:a,caller:H}),[O,k]=T({prop:o,defaultProp:c,onChange:l,caller:H}),A=B.useRef(null),j=v?g||!!v.closest(`form`):!0,[M,te]=B.useState(new Set),N=Array.from(M).map(e=>e.props.value).join(`;`);return(0,V.jsx)(C,{..._,children:(0,V.jsxs)(fe,{required:h,scope:t,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:w,contentId:s(),value:O,onValueChange:k,open:E,onOpenChange:D,dir:ee,triggerPointerDownPosRef:A,disabled:m,children:[(0,V.jsx)(U.Provider,{scope:t,children:(0,V.jsx)(pe,{scope:e.__scopeSelect,onNativeOptionAdd:B.useCallback(e=>{te(t=>new Set(t).add(e))},[]),onNativeOptionRemove:B.useCallback(e=>{te(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),j?(0,V.jsxs)(at,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:f,value:O,onChange:e=>k(e.target.value),disabled:m,form:g,children:[O===void 0?(0,V.jsx)(`option`,{value:``}):null,Array.from(M)]},N):null]})})};he.displayName=H;var ge=`SelectTrigger`,_e=B.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=K(n),o=q(ge,n),s=o.disabled||r,c=g(t,o.onTriggerChange),u=W(n),d=B.useRef(`touch`),[f,p,m]=st(e=>{let t=u().filter(e=>!e.disabled),n=ct(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),_=e=>{s||(o.onOpenChange(!0),m()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,V.jsx)(h,{asChild:!0,...a,children:(0,V.jsx)(E.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":ot(o.value)?``:void 0,...i,ref:c,onClick:l(i.onClick,e=>{e.currentTarget.focus(),d.current!==`mouse`&&_(e)}),onPointerDown:l(i.onPointerDown,e=>{d.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(_(e),e.preventDefault())}),onKeyDown:l(i.onKeyDown,e=>{let t=f.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&p(e.key),!(t&&e.key===` `)&&ce.includes(e.key)&&(_(),e.preventDefault())})})})});_e.displayName=ge;var ve=`SelectValue`,ye=B.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=q(ve,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=g(t,c.onValueNodeChange);return O(()=>{l(u)},[l,u]),(0,V.jsx)(E.span,{...s,ref:d,style:{pointerEvents:`none`},children:ot(c.value)?(0,V.jsx)(V.Fragment,{children:o}):a})});ye.displayName=ve;var be=`SelectIcon`,xe=B.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,V.jsx)(E.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});xe.displayName=be;var Se=`SelectPortal`,Ce=e=>(0,V.jsx)(f,{asChild:!0,...e});Ce.displayName=Se;var J=`SelectContent`,we=B.forwardRef((e,t)=>{let n=q(J,e.__scopeSelect),[r,i]=B.useState();if(O(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?se.createPortal((0,V.jsx)(Te,{scope:e.__scopeSelect,children:(0,V.jsx)(U.Slot,{scope:e.__scopeSelect,children:(0,V.jsx)(`div`,{children:e.children})})}),t):null}return(0,V.jsx)(Oe,{...e,ref:t})});we.displayName=J;var Y=10,[Te,X]=G(J),Ee=`SelectContentImpl`,De=o(`SelectContent.RemoveScroll`),Oe=B.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:u,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:y,hideWhenDetached:b,avoidCollisions:S,...C}=e,w=q(J,n),[T,E]=B.useState(null),[D,O]=B.useState(null),k=g(t,e=>E(e)),[A,j]=B.useState(null),[M,te]=B.useState(null),N=W(n),[P,ne]=B.useState(!1),F=B.useRef(!1);B.useEffect(()=>{if(T)return _(T)},[T]),d();let I=B.useCallback(e=>{let[t,...n]=N().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&D&&(D.scrollTop=0),n===r&&D&&(D.scrollTop=D.scrollHeight),n?.focus(),document.activeElement!==i))return},[N,D]),L=B.useCallback(()=>I([A,T]),[I,A,T]);B.useEffect(()=>{P&&L()},[P,L]);let{onOpenChange:R,triggerPointerDownPosRef:z}=w;B.useEffect(()=>{if(T){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(z.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(z.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():T.contains(n.target)||R(!1),document.removeEventListener(`pointermove`,t),z.current=null};return z.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[T,R,z]),B.useEffect(()=>{let e=()=>R(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[R]);let[re,ie]=st(e=>{let t=N().filter(e=>!e.disabled),n=ct(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ae=B.useCallback((e,t,n)=>{let r=!F.current&&!n;(w.value!==void 0&&w.value===t||r)&&(j(e),r&&(F.current=!0))},[w.value]),oe=B.useCallback(()=>T?.focus(),[T]),se=B.useCallback((e,t,n)=>{let r=!F.current&&!n;(w.value!==void 0&&w.value===t||r)&&te(e)},[w.value]),ce=r===`popper`?Me:Ae,le=ce===Me?{side:s,sideOffset:c,align:u,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:y,hideWhenDetached:b,avoidCollisions:S}:{};return(0,V.jsx)(Te,{scope:n,content:T,viewport:D,onViewportChange:O,itemRefCallback:ae,selectedItem:A,onItemLeave:oe,itemTextRefCallback:se,focusSelectedItem:L,selectedItemText:M,position:r,isPositioned:P,searchRef:re,children:(0,V.jsx)(ee,{as:De,allowPinchZoom:!0,children:(0,V.jsx)(x,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:l(i,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,V.jsx)(v,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:(0,V.jsx)(ce,{role:`listbox`,id:w.contentId,"data-state":w.open?`open`:`closed`,dir:w.dir,onContextMenu:e=>e.preventDefault(),...C,...le,onPlaced:()=>ne(!0),ref:k,style:{display:`flex`,flexDirection:`column`,outline:`none`,...C.style},onKeyDown:l(C.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ie(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=N().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>I(t)),e.preventDefault()}})})})})})})});Oe.displayName=Ee;var ke=`SelectItemAlignedPosition`,Ae=B.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=q(J,n),o=X(J,n),[s,c]=B.useState(null),[l,u]=B.useState(null),d=g(t,e=>u(e)),f=W(n),p=B.useRef(!1),m=B.useRef(!0),{viewport:h,selectedItem:_,selectedItemText:v,focusSelectedItem:y}=o,b=B.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&_&&v){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=v.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Y,d=S(a,[Y,Math.max(Y,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Y,d=S(a,[Y,Math.max(Y,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-Y*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),g=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+g+u+b+y,C=Math.min(_.offsetHeight*5,x),w=window.getComputedStyle(h),ee=parseInt(w.paddingTop,10),T=parseInt(w.paddingBottom,10),E=e.top+e.height/2-Y,D=c-E,O=_.offsetHeight/2,k=_.offsetTop+O,A=m+g+k,j=x-A;if(A<=E){let e=o.length>0&&_===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&_===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?ee:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${Y}px 0`,s.style.minHeight=C+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,_,v,a.dir,r]);O(()=>b(),[b]);let[x,C]=B.useState();return O(()=>{l&&C(window.getComputedStyle(l).zIndex)},[l]),(0,V.jsx)(Ne,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:B.useCallback(e=>{e&&m.current===!0&&(b(),y?.(),m.current=!1)},[b,y]),children:(0,V.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:(0,V.jsx)(E.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});Ae.displayName=ke;var je=`SelectPopperPosition`,Me=B.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Y,...a}=e,o=K(n);return(0,V.jsx)(b,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});Me.displayName=je;var[Ne,Pe]=G(J,{}),Fe=`SelectViewport`,Ie=B.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=X(Fe,n),o=Pe(Fe,n),s=g(t,a.onViewportChange),c=B.useRef(0);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,V.jsx)(U.Slot,{scope:n,children:(0,V.jsx)(E.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:l(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-Y*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});Ie.displayName=Fe;var Le=`SelectGroup`,[Re,ze]=G(Le),Be=B.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=s();return(0,V.jsx)(Re,{scope:n,id:i,children:(0,V.jsx)(E.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Be.displayName=Le;var Ve=`SelectLabel`,He=B.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=ze(Ve,n);return(0,V.jsx)(E.div,{id:i.id,...r,ref:t})});He.displayName=Ve;var Z=`SelectItem`,[Ue,We]=G(Z),Ge=B.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,c=q(Z,n),u=X(Z,n),d=c.value===r,[f,p]=B.useState(a??``),[m,h]=B.useState(!1),_=g(t,e=>u.itemRefCallback?.(e,r,i)),v=s(),y=B.useRef(`touch`),b=()=>{i||(c.onValueChange(r),c.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,V.jsx)(Ue,{scope:n,value:r,disabled:i,textId:v,isSelected:d,onItemTextChange:B.useCallback(e=>{p(t=>t||(e?.textContent??``).trim())},[]),children:(0,V.jsx)(U.ItemSlot,{scope:n,value:r,disabled:i,textValue:f,children:(0,V.jsx)(E.div,{role:`option`,"aria-labelledby":v,"data-highlighted":m?``:void 0,"aria-selected":d&&m,"data-state":d?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:_,onFocus:l(o.onFocus,()=>h(!0)),onBlur:l(o.onBlur,()=>h(!1)),onClick:l(o.onClick,()=>{y.current!==`mouse`&&b()}),onPointerUp:l(o.onPointerUp,()=>{y.current===`mouse`&&b()}),onPointerDown:l(o.onPointerDown,e=>{y.current=e.pointerType}),onPointerMove:l(o.onPointerMove,e=>{y.current=e.pointerType,i?u.onItemLeave?.():y.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:l(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:l(o.onKeyDown,e=>{u.searchRef?.current!==``&&e.key===` `||(le.includes(e.key)&&b(),e.key===` `&&e.preventDefault())})})})})});Ge.displayName=Z;var Q=`SelectItemText`,Ke=B.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=q(Q,n),s=X(Q,n),c=We(Q,n),l=me(Q,n),[u,d]=B.useState(null),f=g(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=B.useMemo(()=>(0,V.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:_}=l;return O(()=>(h(m),()=>_(m)),[h,_,m]),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(E.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?se.createPortal(a.children,o.valueNode):null]})});Ke.displayName=Q;var qe=`SelectItemIndicator`,Je=B.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return We(qe,n).isSelected?(0,V.jsx)(E.span,{"aria-hidden":!0,...r,ref:t}):null});Je.displayName=qe;var Ye=`SelectScrollUpButton`,Xe=B.forwardRef((e,t)=>{let n=X(Ye,e.__scopeSelect),r=Pe(Ye,e.__scopeSelect),[i,a]=B.useState(!1),o=g(t,r.onScrollButtonChange);return O(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,V.jsx)($e,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Xe.displayName=Ye;var Ze=`SelectScrollDownButton`,Qe=B.forwardRef((e,t)=>{let n=X(Ze,e.__scopeSelect),r=Pe(Ze,e.__scopeSelect),[i,a]=B.useState(!1),o=g(t,r.onScrollButtonChange);return O(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,V.jsx)($e,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});Qe.displayName=Ze;var $e=B.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=X(`SelectScrollButton`,n),o=B.useRef(null),s=W(n),c=B.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return B.useEffect(()=>()=>c(),[c]),O(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,V.jsx)(E.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:l(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:l(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:l(i.onPointerLeave,()=>{c()})})}),et=`SelectSeparator`,tt=B.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,V.jsx)(E.div,{"aria-hidden":!0,...r,ref:t})});tt.displayName=et;var nt=`SelectArrow`,rt=B.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=K(n),a=q(nt,n),o=X(nt,n);return a.open&&o.position===`popper`?(0,V.jsx)(c,{...i,...r,ref:t}):null});rt.displayName=nt;var it=`SelectBubbleInput`,at=B.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=B.useRef(null),a=g(r,i),o=re(t);return B.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,V.jsx)(E.select,{...n,style:{...ne,...n.style},ref:a,defaultValue:t})});at.displayName=it;function ot(e){return e===``||e===void 0}function st(e){let t=m(e),n=B.useRef(``),r=B.useRef(0),i=B.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=B.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return B.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function ct(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=lt(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function lt(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ut=he,dt=_e,ft=ye,pt=xe,mt=Ce,ht=we,gt=Ie,_t=Ge,vt=Ke,yt=Je,bt=Xe,xt=Qe,St=`Separator`,Ct=`horizontal`,wt=[`horizontal`,`vertical`],Tt=B.forwardRef((e,t)=>{let{decorative:n,orientation:r=Ct,...i}=e,a=Et(r)?r:Ct,o=a===`vertical`?a:void 0,s=n?{role:`none`}:{"aria-orientation":o,role:`separator`};return(0,V.jsx)(E.div,{"data-orientation":a,...s,...i,ref:t})});Tt.displayName=St;function Et(e){return wt.includes(e)}var Dt=Tt;function Ot({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,V.jsx)(Dt,{"data-slot":`separator`,decorative:n,orientation:t,className:j(`shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px`,e),...r})}function $({className:e,...t}){return(0,V.jsx)(oe,{"data-slot":`label`,className:j(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function kt({...e}){return(0,V.jsx)(ut,{"data-slot":`select`,...e})}function At({...e}){return(0,V.jsx)(ft,{"data-slot":`select-value`,...e})}function jt({className:e,size:t=`default`,children:n,...r}){return(0,V.jsxs)(dt,{"data-slot":`select-trigger`,"data-size":t,className:j(`flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,V.jsx)(pt,{asChild:!0,children:(0,V.jsx)(N,{className:`size-4 opacity-50`})})]})}function Mt({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,V.jsx)(mt,{children:(0,V.jsxs)(ht,{"data-slot":`select-content`,className:j(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,V.jsx)(Pt,{}),(0,V.jsx)(gt,{className:j(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,V.jsx)(Ft,{})]})})}function Nt({className:e,children:t,...n}){return(0,V.jsxs)(_t,{"data-slot":`select-item`,className:j(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,V.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,V.jsx)(yt,{children:(0,V.jsx)(M,{className:`size-4`})})}),(0,V.jsx)(vt,{children:t})]})}function Pt({className:e,...t}){return(0,V.jsx)(bt,{"data-slot":`select-scroll-up-button`,className:j(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,V.jsx)(te,{className:`size-4`})})}function Ft({className:e,...t}){return(0,V.jsx)(xt,{"data-slot":`select-scroll-down-button`,className:j(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,V.jsx)(N,{className:`size-4`})})}function It(){return A.get(`/api/settings/ai`)}function Lt(e){return A.put(`/api/settings/ai`,e)}var Rt=[{value:`claude-sonnet-4-6`,label:`Claude Sonnet 4.6`},{value:`claude-opus-4-6`,label:`Claude Opus 4.6`},{value:`claude-haiku-4-5`,label:`Claude Haiku 4.5`}],zt=[{value:`low`,label:`Low`},{value:`medium`,label:`Medium`},{value:`high`,label:`High`},{value:`max`,label:`Max`}];function Bt(){let[e,t]=(0,B.useState)(null),[n,r]=(0,B.useState)(!1),[i,a]=(0,B.useState)(null),[o,s]=(0,B.useState)(0);(0,B.useEffect)(()=>{It().then(t).catch(e=>a(e.message))},[]);let c=e?.default_provider??`claude`,l=e?.providers[c],u=async(n,i)=>{if(e){r(!0),a(null);try{t(await Lt({providers:{[c]:{[n]:i}}})),s(e=>e+1)}catch(e){a(e.message)}finally{r(!1)}}};return e?(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-medium text-text-secondary`,children:`AI Provider`}),(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)($,{htmlFor:`ai-model`,children:`Model`}),(0,V.jsxs)(kt,{value:l?.model??`claude-sonnet-4-6`,onValueChange:e=>u(`model`,e),children:[(0,V.jsx)(jt,{id:`ai-model`,className:`w-full`,children:(0,V.jsx)(At,{})}),(0,V.jsx)(Mt,{children:Rt.map(e=>(0,V.jsx)(Nt,{value:e.value,children:e.label},e.value))})]})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)($,{htmlFor:`ai-effort`,children:`Effort`}),(0,V.jsxs)(kt,{value:l?.effort??`high`,onValueChange:e=>u(`effort`,e),children:[(0,V.jsx)(jt,{id:`ai-effort`,className:`w-full`,children:(0,V.jsx)(At,{})}),(0,V.jsx)(Mt,{children:zt.map(e=>(0,V.jsx)(Nt,{value:e.value,children:e.label},e.value))})]})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)($,{htmlFor:`ai-max-turns`,children:`Max Turns (1-500)`}),(0,V.jsx)(w,{id:`ai-max-turns`,type:`number`,min:1,max:500,defaultValue:l?.max_turns??100,onBlur:e=>{let t=parseInt(e.target.value);isNaN(t)||u(`max_turns`,t)}},`turns-${o}`)]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)($,{htmlFor:`ai-budget`,children:`Max Budget (USD)`}),(0,V.jsx)(w,{id:`ai-budget`,type:`number`,step:.1,min:.01,max:50,defaultValue:l?.max_budget_usd??``,placeholder:`No limit`,onBlur:e=>{let t=parseFloat(e.target.value);u(`max_budget_usd`,isNaN(t)?void 0:t)}},`budget-${o}`)]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)($,{htmlFor:`ai-thinking`,children:`Thinking Budget (tokens)`}),(0,V.jsx)(w,{id:`ai-thinking`,type:`number`,min:0,defaultValue:l?.thinking_budget_tokens??``,placeholder:`Disabled`,onBlur:e=>{let t=parseInt(e.target.value);u(`thinking_budget_tokens`,isNaN(t)?void 0:t)}},`thinking-${o}`)]})]}),n&&(0,V.jsx)(`p`,{className:`text-xs text-text-subtle`,children:`Saving...`}),i&&(0,V.jsx)(`p`,{className:`text-xs text-red-500`,children:i})]}):(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-medium text-text-secondary`,children:`AI Provider`}),(0,V.jsx)(`p`,{className:`text-sm text-text-subtle`,children:i?`Error: ${i}`:`Loading...`})]})}function Vt(e){let t=(e+`=`.repeat((4-e.length%4)%4)).replace(/-/g,`+`).replace(/_/g,`/`),n=atob(t);return Uint8Array.from(n,e=>e.charCodeAt(0))}function Ht(){let[e,t]=(0,B.useState)(`default`),[n,r]=(0,B.useState)(!1),[i,a]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{`Notification`in window&&t(Notification.permission),r(localStorage.getItem(`ppm-push-subscribed`)===`true`)},[]),{permission:e,isSubscribed:n,loading:i,subscribe:(0,B.useCallback)(async()=>{a(!0);try{let e=await Notification.requestPermission();if(t(e),e!==`granted`)return;let n={},i=k();i&&(n.Authorization=`Bearer ${i}`);let a=await(await fetch(`/api/push/vapid-key`,{headers:n})).json();if(!a.ok)throw Error(a.error||`Failed to get VAPID key`);let o=await(await navigator.serviceWorker.ready).pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Vt(a.data.publicKey).buffer});await fetch(`/api/push/subscribe`,{method:`POST`,headers:{...n,"Content-Type":`application/json`},body:JSON.stringify(o.toJSON())}),r(!0),localStorage.setItem(`ppm-push-subscribed`,`true`)}catch(e){console.error(`[push] Subscribe failed:`,e)}finally{a(!1)}},[]),unsubscribe:(0,B.useCallback)(async()=>{a(!0);try{let e=await(await navigator.serviceWorker.ready).pushManager.getSubscription();if(e){let t={"Content-Type":`application/json`},n=k();n&&(t.Authorization=`Bearer ${n}`),await fetch(`/api/push/subscribe`,{method:`DELETE`,headers:t,body:JSON.stringify({endpoint:e.endpoint})}),await e.unsubscribe()}r(!1),localStorage.removeItem(`ppm-push-subscribed`)}catch(e){console.error(`[push] Unsubscribe failed:`,e)}finally{a(!1)}},[])}}var Ut=[{value:`light`,label:`Light`,icon:z},{value:`dark`,label:`Dark`,icon:R},{value:`system`,label:`System`,icon:L}],Wt=`PushManager`in window&&`serviceWorker`in navigator,Gt=/iPhone|iPad/.test(navigator.userAgent)&&!window.matchMedia(`(display-mode: standalone)`).matches;function Kt(){let{theme:e,setTheme:t}=P(),{permission:n,isSubscribed:r,loading:i,subscribe:a,unsubscribe:o}=Ht();return(0,V.jsxs)(`div`,{className:`h-full p-4 space-y-6 overflow-auto max-w-lg`,children:[(0,V.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Settings`}),(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-medium text-text-secondary`,children:`Theme`}),(0,V.jsx)(`div`,{className:`flex gap-2`,children:Ut.map(n=>{let r=n.icon;return(0,V.jsxs)(y,{variant:e===n.value?`default`:`outline`,size:`lg`,onClick:()=>t(n.value),className:j(`flex-1 gap-2`,e===n.value&&`ring-2 ring-primary`),children:[(0,V.jsx)(r,{className:`size-4`}),n.label]},n.value)})})]}),(0,V.jsx)(Ot,{}),(0,V.jsx)(Bt,{}),(0,V.jsx)(Ot,{}),(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-medium text-text-secondary`,children:`Notifications`}),Wt?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[r?(0,V.jsx)(I,{className:`size-4`}):(0,V.jsx)(F,{className:`size-4`}),(0,V.jsx)(`span`,{className:`text-sm`,children:`Push notifications`})]}),(0,V.jsx)(y,{variant:r?`default`:`outline`,size:`sm`,disabled:i||n===`denied`,onClick:()=>r?o():a(),children:i?`...`:r?`On`:`Off`})]}),n===`denied`&&(0,V.jsx)(`p`,{className:`text-xs text-destructive`,children:`Notifications blocked. Enable in browser settings.`}),Gt&&(0,V.jsx)(`p`,{className:`text-xs text-text-subtle`,children:`On iOS, install PPM to Home Screen for push notifications.`})]}):(0,V.jsx)(`p`,{className:`text-sm text-text-subtle`,children:`Push notifications are not supported in this browser.`})]}),(0,V.jsx)(Ot,{}),(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-medium text-text-secondary`,children:`About`}),(0,V.jsx)(`p`,{className:`text-sm text-text-secondary`,children:`PPM — Personal Project Manager`}),(0,V.jsx)(`p`,{className:`text-xs text-text-subtle`,children:`A mobile-first web IDE for managing your projects.`})]})]})}export{Kt as SettingsTab};
|
|
1
|
+
import{a as e,n as t,r as n,t as r}from"./jsx-runtime-BFALxl05.js";import{A as i,C as a,E as o,_ as s,a as c,b as l,c as u,d,f,g as p,h as m,i as h,k as g,l as _,m as v,n as y,o as b,p as x,r as S,s as C,t as w,u as ee,v as T,w as E,x as D,y as O}from"./input-CTnwfHVN.js";import{n as k,t as A}from"./api-client-BCjah751.js";import{t as j}from"./utils-B-_GCz7E.js";import{F as M,M as te,P as N,g as P,h as ne}from"./index-wdrrHLzl.js";var F=t(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),I=t(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),L=t(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),R=t(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),z=t(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),B=e(n(),1);function re(e){let t=B.useRef({value:e,previous:e});return B.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var V=r(),ie=`Label`,ae=B.forwardRef((e,t)=>(0,V.jsx)(E.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));ae.displayName=ie;var oe=ae,se=e(i(),1),ce=[` `,`Enter`,`ArrowUp`,`ArrowDown`],le=[` `,`Enter`],H=`Select`,[U,W,ue]=D(H),[G,de]=a(H,[ue,u]),K=u(),[fe,q]=G(H),[pe,me]=G(H),he=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:c,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:m,required:h,form:g}=e,_=K(t),[v,y]=B.useState(null),[b,x]=B.useState(null),[S,w]=B.useState(!1),ee=p(u),[E,D]=T({prop:r,defaultProp:i??!1,onChange:a,caller:H}),[O,k]=T({prop:o,defaultProp:c,onChange:l,caller:H}),A=B.useRef(null),j=v?g||!!v.closest(`form`):!0,[M,te]=B.useState(new Set),N=Array.from(M).map(e=>e.props.value).join(`;`);return(0,V.jsx)(C,{..._,children:(0,V.jsxs)(fe,{required:h,scope:t,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:w,contentId:s(),value:O,onValueChange:k,open:E,onOpenChange:D,dir:ee,triggerPointerDownPosRef:A,disabled:m,children:[(0,V.jsx)(U.Provider,{scope:t,children:(0,V.jsx)(pe,{scope:e.__scopeSelect,onNativeOptionAdd:B.useCallback(e=>{te(t=>new Set(t).add(e))},[]),onNativeOptionRemove:B.useCallback(e=>{te(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),j?(0,V.jsxs)(at,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:f,value:O,onChange:e=>k(e.target.value),disabled:m,form:g,children:[O===void 0?(0,V.jsx)(`option`,{value:``}):null,Array.from(M)]},N):null]})})};he.displayName=H;var ge=`SelectTrigger`,_e=B.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=K(n),o=q(ge,n),s=o.disabled||r,c=g(t,o.onTriggerChange),u=W(n),d=B.useRef(`touch`),[f,p,m]=st(e=>{let t=u().filter(e=>!e.disabled),n=ct(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),_=e=>{s||(o.onOpenChange(!0),m()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,V.jsx)(h,{asChild:!0,...a,children:(0,V.jsx)(E.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":ot(o.value)?``:void 0,...i,ref:c,onClick:l(i.onClick,e=>{e.currentTarget.focus(),d.current!==`mouse`&&_(e)}),onPointerDown:l(i.onPointerDown,e=>{d.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(_(e),e.preventDefault())}),onKeyDown:l(i.onKeyDown,e=>{let t=f.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&p(e.key),!(t&&e.key===` `)&&ce.includes(e.key)&&(_(),e.preventDefault())})})})});_e.displayName=ge;var ve=`SelectValue`,ye=B.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=q(ve,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=g(t,c.onValueNodeChange);return O(()=>{l(u)},[l,u]),(0,V.jsx)(E.span,{...s,ref:d,style:{pointerEvents:`none`},children:ot(c.value)?(0,V.jsx)(V.Fragment,{children:o}):a})});ye.displayName=ve;var be=`SelectIcon`,xe=B.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,V.jsx)(E.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});xe.displayName=be;var Se=`SelectPortal`,Ce=e=>(0,V.jsx)(f,{asChild:!0,...e});Ce.displayName=Se;var J=`SelectContent`,we=B.forwardRef((e,t)=>{let n=q(J,e.__scopeSelect),[r,i]=B.useState();if(O(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?se.createPortal((0,V.jsx)(Te,{scope:e.__scopeSelect,children:(0,V.jsx)(U.Slot,{scope:e.__scopeSelect,children:(0,V.jsx)(`div`,{children:e.children})})}),t):null}return(0,V.jsx)(Oe,{...e,ref:t})});we.displayName=J;var Y=10,[Te,X]=G(J),Ee=`SelectContentImpl`,De=o(`SelectContent.RemoveScroll`),Oe=B.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:u,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:y,hideWhenDetached:b,avoidCollisions:S,...C}=e,w=q(J,n),[T,E]=B.useState(null),[D,O]=B.useState(null),k=g(t,e=>E(e)),[A,j]=B.useState(null),[M,te]=B.useState(null),N=W(n),[P,ne]=B.useState(!1),F=B.useRef(!1);B.useEffect(()=>{if(T)return _(T)},[T]),d();let I=B.useCallback(e=>{let[t,...n]=N().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&D&&(D.scrollTop=0),n===r&&D&&(D.scrollTop=D.scrollHeight),n?.focus(),document.activeElement!==i))return},[N,D]),L=B.useCallback(()=>I([A,T]),[I,A,T]);B.useEffect(()=>{P&&L()},[P,L]);let{onOpenChange:R,triggerPointerDownPosRef:z}=w;B.useEffect(()=>{if(T){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(z.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(z.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():T.contains(n.target)||R(!1),document.removeEventListener(`pointermove`,t),z.current=null};return z.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[T,R,z]),B.useEffect(()=>{let e=()=>R(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[R]);let[re,ie]=st(e=>{let t=N().filter(e=>!e.disabled),n=ct(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ae=B.useCallback((e,t,n)=>{let r=!F.current&&!n;(w.value!==void 0&&w.value===t||r)&&(j(e),r&&(F.current=!0))},[w.value]),oe=B.useCallback(()=>T?.focus(),[T]),se=B.useCallback((e,t,n)=>{let r=!F.current&&!n;(w.value!==void 0&&w.value===t||r)&&te(e)},[w.value]),ce=r===`popper`?Me:Ae,le=ce===Me?{side:s,sideOffset:c,align:u,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:y,hideWhenDetached:b,avoidCollisions:S}:{};return(0,V.jsx)(Te,{scope:n,content:T,viewport:D,onViewportChange:O,itemRefCallback:ae,selectedItem:A,onItemLeave:oe,itemTextRefCallback:se,focusSelectedItem:L,selectedItemText:M,position:r,isPositioned:P,searchRef:re,children:(0,V.jsx)(ee,{as:De,allowPinchZoom:!0,children:(0,V.jsx)(x,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:l(i,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,V.jsx)(v,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:(0,V.jsx)(ce,{role:`listbox`,id:w.contentId,"data-state":w.open?`open`:`closed`,dir:w.dir,onContextMenu:e=>e.preventDefault(),...C,...le,onPlaced:()=>ne(!0),ref:k,style:{display:`flex`,flexDirection:`column`,outline:`none`,...C.style},onKeyDown:l(C.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ie(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=N().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>I(t)),e.preventDefault()}})})})})})})});Oe.displayName=Ee;var ke=`SelectItemAlignedPosition`,Ae=B.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=q(J,n),o=X(J,n),[s,c]=B.useState(null),[l,u]=B.useState(null),d=g(t,e=>u(e)),f=W(n),p=B.useRef(!1),m=B.useRef(!0),{viewport:h,selectedItem:_,selectedItemText:v,focusSelectedItem:y}=o,b=B.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&_&&v){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=v.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Y,d=S(a,[Y,Math.max(Y,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Y,d=S(a,[Y,Math.max(Y,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-Y*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),g=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+g+u+b+y,C=Math.min(_.offsetHeight*5,x),w=window.getComputedStyle(h),ee=parseInt(w.paddingTop,10),T=parseInt(w.paddingBottom,10),E=e.top+e.height/2-Y,D=c-E,O=_.offsetHeight/2,k=_.offsetTop+O,A=m+g+k,j=x-A;if(A<=E){let e=o.length>0&&_===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&_===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?ee:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${Y}px 0`,s.style.minHeight=C+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,_,v,a.dir,r]);O(()=>b(),[b]);let[x,C]=B.useState();return O(()=>{l&&C(window.getComputedStyle(l).zIndex)},[l]),(0,V.jsx)(Ne,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:B.useCallback(e=>{e&&m.current===!0&&(b(),y?.(),m.current=!1)},[b,y]),children:(0,V.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:(0,V.jsx)(E.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});Ae.displayName=ke;var je=`SelectPopperPosition`,Me=B.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Y,...a}=e,o=K(n);return(0,V.jsx)(b,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});Me.displayName=je;var[Ne,Pe]=G(J,{}),Fe=`SelectViewport`,Ie=B.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=X(Fe,n),o=Pe(Fe,n),s=g(t,a.onViewportChange),c=B.useRef(0);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,V.jsx)(U.Slot,{scope:n,children:(0,V.jsx)(E.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:l(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-Y*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});Ie.displayName=Fe;var Le=`SelectGroup`,[Re,ze]=G(Le),Be=B.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=s();return(0,V.jsx)(Re,{scope:n,id:i,children:(0,V.jsx)(E.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Be.displayName=Le;var Ve=`SelectLabel`,He=B.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=ze(Ve,n);return(0,V.jsx)(E.div,{id:i.id,...r,ref:t})});He.displayName=Ve;var Z=`SelectItem`,[Ue,We]=G(Z),Ge=B.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,c=q(Z,n),u=X(Z,n),d=c.value===r,[f,p]=B.useState(a??``),[m,h]=B.useState(!1),_=g(t,e=>u.itemRefCallback?.(e,r,i)),v=s(),y=B.useRef(`touch`),b=()=>{i||(c.onValueChange(r),c.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,V.jsx)(Ue,{scope:n,value:r,disabled:i,textId:v,isSelected:d,onItemTextChange:B.useCallback(e=>{p(t=>t||(e?.textContent??``).trim())},[]),children:(0,V.jsx)(U.ItemSlot,{scope:n,value:r,disabled:i,textValue:f,children:(0,V.jsx)(E.div,{role:`option`,"aria-labelledby":v,"data-highlighted":m?``:void 0,"aria-selected":d&&m,"data-state":d?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:_,onFocus:l(o.onFocus,()=>h(!0)),onBlur:l(o.onBlur,()=>h(!1)),onClick:l(o.onClick,()=>{y.current!==`mouse`&&b()}),onPointerUp:l(o.onPointerUp,()=>{y.current===`mouse`&&b()}),onPointerDown:l(o.onPointerDown,e=>{y.current=e.pointerType}),onPointerMove:l(o.onPointerMove,e=>{y.current=e.pointerType,i?u.onItemLeave?.():y.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:l(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:l(o.onKeyDown,e=>{u.searchRef?.current!==``&&e.key===` `||(le.includes(e.key)&&b(),e.key===` `&&e.preventDefault())})})})})});Ge.displayName=Z;var Q=`SelectItemText`,Ke=B.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=q(Q,n),s=X(Q,n),c=We(Q,n),l=me(Q,n),[u,d]=B.useState(null),f=g(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=B.useMemo(()=>(0,V.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:_}=l;return O(()=>(h(m),()=>_(m)),[h,_,m]),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(E.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?se.createPortal(a.children,o.valueNode):null]})});Ke.displayName=Q;var qe=`SelectItemIndicator`,Je=B.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return We(qe,n).isSelected?(0,V.jsx)(E.span,{"aria-hidden":!0,...r,ref:t}):null});Je.displayName=qe;var Ye=`SelectScrollUpButton`,Xe=B.forwardRef((e,t)=>{let n=X(Ye,e.__scopeSelect),r=Pe(Ye,e.__scopeSelect),[i,a]=B.useState(!1),o=g(t,r.onScrollButtonChange);return O(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,V.jsx)($e,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Xe.displayName=Ye;var Ze=`SelectScrollDownButton`,Qe=B.forwardRef((e,t)=>{let n=X(Ze,e.__scopeSelect),r=Pe(Ze,e.__scopeSelect),[i,a]=B.useState(!1),o=g(t,r.onScrollButtonChange);return O(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,V.jsx)($e,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});Qe.displayName=Ze;var $e=B.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=X(`SelectScrollButton`,n),o=B.useRef(null),s=W(n),c=B.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return B.useEffect(()=>()=>c(),[c]),O(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,V.jsx)(E.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:l(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:l(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:l(i.onPointerLeave,()=>{c()})})}),et=`SelectSeparator`,tt=B.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,V.jsx)(E.div,{"aria-hidden":!0,...r,ref:t})});tt.displayName=et;var nt=`SelectArrow`,rt=B.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=K(n),a=q(nt,n),o=X(nt,n);return a.open&&o.position===`popper`?(0,V.jsx)(c,{...i,...r,ref:t}):null});rt.displayName=nt;var it=`SelectBubbleInput`,at=B.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=B.useRef(null),a=g(r,i),o=re(t);return B.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,V.jsx)(E.select,{...n,style:{...ne,...n.style},ref:a,defaultValue:t})});at.displayName=it;function ot(e){return e===``||e===void 0}function st(e){let t=m(e),n=B.useRef(``),r=B.useRef(0),i=B.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=B.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return B.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function ct(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=lt(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function lt(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ut=he,dt=_e,ft=ye,pt=xe,mt=Ce,ht=we,gt=Ie,_t=Ge,vt=Ke,yt=Je,bt=Xe,xt=Qe,St=`Separator`,Ct=`horizontal`,wt=[`horizontal`,`vertical`],Tt=B.forwardRef((e,t)=>{let{decorative:n,orientation:r=Ct,...i}=e,a=Et(r)?r:Ct,o=a===`vertical`?a:void 0,s=n?{role:`none`}:{"aria-orientation":o,role:`separator`};return(0,V.jsx)(E.div,{"data-orientation":a,...s,...i,ref:t})});Tt.displayName=St;function Et(e){return wt.includes(e)}var Dt=Tt;function Ot({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,V.jsx)(Dt,{"data-slot":`separator`,decorative:n,orientation:t,className:j(`shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px`,e),...r})}function $({className:e,...t}){return(0,V.jsx)(oe,{"data-slot":`label`,className:j(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function kt({...e}){return(0,V.jsx)(ut,{"data-slot":`select`,...e})}function At({...e}){return(0,V.jsx)(ft,{"data-slot":`select-value`,...e})}function jt({className:e,size:t=`default`,children:n,...r}){return(0,V.jsxs)(dt,{"data-slot":`select-trigger`,"data-size":t,className:j(`flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,V.jsx)(pt,{asChild:!0,children:(0,V.jsx)(N,{className:`size-4 opacity-50`})})]})}function Mt({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,V.jsx)(mt,{children:(0,V.jsxs)(ht,{"data-slot":`select-content`,className:j(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,V.jsx)(Pt,{}),(0,V.jsx)(gt,{className:j(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,V.jsx)(Ft,{})]})})}function Nt({className:e,children:t,...n}){return(0,V.jsxs)(_t,{"data-slot":`select-item`,className:j(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,V.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,V.jsx)(yt,{children:(0,V.jsx)(M,{className:`size-4`})})}),(0,V.jsx)(vt,{children:t})]})}function Pt({className:e,...t}){return(0,V.jsx)(bt,{"data-slot":`select-scroll-up-button`,className:j(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,V.jsx)(te,{className:`size-4`})})}function Ft({className:e,...t}){return(0,V.jsx)(xt,{"data-slot":`select-scroll-down-button`,className:j(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,V.jsx)(N,{className:`size-4`})})}function It(){return A.get(`/api/settings/ai`)}function Lt(e){return A.put(`/api/settings/ai`,e)}var Rt=[{value:`claude-sonnet-4-6`,label:`Claude Sonnet 4.6`},{value:`claude-opus-4-6`,label:`Claude Opus 4.6`},{value:`claude-haiku-4-5`,label:`Claude Haiku 4.5`}],zt=[{value:`low`,label:`Low`},{value:`medium`,label:`Medium`},{value:`high`,label:`High`},{value:`max`,label:`Max`}];function Bt(){let[e,t]=(0,B.useState)(null),[n,r]=(0,B.useState)(!1),[i,a]=(0,B.useState)(null),[o,s]=(0,B.useState)(0);(0,B.useEffect)(()=>{It().then(t).catch(e=>a(e.message))},[]);let c=e?.default_provider??`claude`,l=e?.providers[c],u=async(n,i)=>{if(e){r(!0),a(null);try{t(await Lt({providers:{[c]:{[n]:i}}})),s(e=>e+1)}catch(e){a(e.message)}finally{r(!1)}}};return e?(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-medium text-text-secondary`,children:`AI Provider`}),(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)($,{htmlFor:`ai-model`,children:`Model`}),(0,V.jsxs)(kt,{value:l?.model??`claude-sonnet-4-6`,onValueChange:e=>u(`model`,e),children:[(0,V.jsx)(jt,{id:`ai-model`,className:`w-full`,children:(0,V.jsx)(At,{})}),(0,V.jsx)(Mt,{children:Rt.map(e=>(0,V.jsx)(Nt,{value:e.value,children:e.label},e.value))})]})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)($,{htmlFor:`ai-effort`,children:`Effort`}),(0,V.jsxs)(kt,{value:l?.effort??`high`,onValueChange:e=>u(`effort`,e),children:[(0,V.jsx)(jt,{id:`ai-effort`,className:`w-full`,children:(0,V.jsx)(At,{})}),(0,V.jsx)(Mt,{children:zt.map(e=>(0,V.jsx)(Nt,{value:e.value,children:e.label},e.value))})]})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)($,{htmlFor:`ai-max-turns`,children:`Max Turns (1-500)`}),(0,V.jsx)(w,{id:`ai-max-turns`,type:`number`,min:1,max:500,defaultValue:l?.max_turns??100,onBlur:e=>{let t=parseInt(e.target.value);isNaN(t)||u(`max_turns`,t)}},`turns-${o}`)]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)($,{htmlFor:`ai-budget`,children:`Max Budget (USD)`}),(0,V.jsx)(w,{id:`ai-budget`,type:`number`,step:.1,min:.01,max:50,defaultValue:l?.max_budget_usd??``,placeholder:`No limit`,onBlur:e=>{let t=parseFloat(e.target.value);u(`max_budget_usd`,isNaN(t)?void 0:t)}},`budget-${o}`)]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)($,{htmlFor:`ai-thinking`,children:`Thinking Budget (tokens)`}),(0,V.jsx)(w,{id:`ai-thinking`,type:`number`,min:0,defaultValue:l?.thinking_budget_tokens??``,placeholder:`Disabled`,onBlur:e=>{let t=parseInt(e.target.value);u(`thinking_budget_tokens`,isNaN(t)?void 0:t)}},`thinking-${o}`)]})]}),n&&(0,V.jsx)(`p`,{className:`text-xs text-text-subtle`,children:`Saving...`}),i&&(0,V.jsx)(`p`,{className:`text-xs text-red-500`,children:i})]}):(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-medium text-text-secondary`,children:`AI Provider`}),(0,V.jsx)(`p`,{className:`text-sm text-text-subtle`,children:i?`Error: ${i}`:`Loading...`})]})}function Vt(e){let t=(e+`=`.repeat((4-e.length%4)%4)).replace(/-/g,`+`).replace(/_/g,`/`),n=atob(t);return Uint8Array.from(n,e=>e.charCodeAt(0))}function Ht(){let[e,t]=(0,B.useState)(`default`),[n,r]=(0,B.useState)(!1),[i,a]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{`Notification`in window&&t(Notification.permission),r(localStorage.getItem(`ppm-push-subscribed`)===`true`)},[]),{permission:e,isSubscribed:n,loading:i,subscribe:(0,B.useCallback)(async()=>{a(!0);try{let e=await Notification.requestPermission();if(t(e),e!==`granted`)return;let n={},i=k();i&&(n.Authorization=`Bearer ${i}`);let a=await(await fetch(`/api/push/vapid-key`,{headers:n})).json();if(!a.ok)throw Error(a.error||`Failed to get VAPID key`);let o=await(await navigator.serviceWorker.ready).pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Vt(a.data.publicKey).buffer});await fetch(`/api/push/subscribe`,{method:`POST`,headers:{...n,"Content-Type":`application/json`},body:JSON.stringify(o.toJSON())}),r(!0),localStorage.setItem(`ppm-push-subscribed`,`true`)}catch(e){console.error(`[push] Subscribe failed:`,e)}finally{a(!1)}},[]),unsubscribe:(0,B.useCallback)(async()=>{a(!0);try{let e=await(await navigator.serviceWorker.ready).pushManager.getSubscription();if(e){let t={"Content-Type":`application/json`},n=k();n&&(t.Authorization=`Bearer ${n}`),await fetch(`/api/push/subscribe`,{method:`DELETE`,headers:t,body:JSON.stringify({endpoint:e.endpoint})}),await e.unsubscribe()}r(!1),localStorage.removeItem(`ppm-push-subscribed`)}catch(e){console.error(`[push] Unsubscribe failed:`,e)}finally{a(!1)}},[])}}var Ut=[{value:`light`,label:`Light`,icon:z},{value:`dark`,label:`Dark`,icon:R},{value:`system`,label:`System`,icon:L}],Wt=`PushManager`in window&&`serviceWorker`in navigator,Gt=/iPhone|iPad/.test(navigator.userAgent)&&!window.matchMedia(`(display-mode: standalone)`).matches;function Kt(){let{theme:e,setTheme:t}=P(),{permission:n,isSubscribed:r,loading:i,subscribe:a,unsubscribe:o}=Ht();return(0,V.jsx)(`div`,{className:`h-full w-full overflow-auto`,children:(0,V.jsxs)(`div`,{className:`p-4 space-y-6 max-w-lg mx-auto`,children:[(0,V.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Settings`}),(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-medium text-text-secondary`,children:`Theme`}),(0,V.jsx)(`div`,{className:`flex gap-2`,children:Ut.map(n=>{let r=n.icon;return(0,V.jsxs)(y,{variant:e===n.value?`default`:`outline`,size:`lg`,onClick:()=>t(n.value),className:j(`flex-1 gap-2`,e===n.value&&`ring-2 ring-primary`),children:[(0,V.jsx)(r,{className:`size-4`}),n.label]},n.value)})})]}),(0,V.jsx)(Ot,{}),(0,V.jsx)(Bt,{}),(0,V.jsx)(Ot,{}),(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-medium text-text-secondary`,children:`Notifications`}),Wt?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[r?(0,V.jsx)(I,{className:`size-4`}):(0,V.jsx)(F,{className:`size-4`}),(0,V.jsx)(`span`,{className:`text-sm`,children:`Push notifications`})]}),(0,V.jsx)(y,{variant:r?`default`:`outline`,size:`sm`,disabled:i||n===`denied`,onClick:()=>r?o():a(),children:i?`...`:r?`On`:`Off`})]}),n===`denied`&&(0,V.jsx)(`p`,{className:`text-xs text-destructive`,children:`Notifications blocked. Enable in browser settings.`}),Gt&&(0,V.jsx)(`p`,{className:`text-xs text-text-subtle`,children:`On iOS, install PPM to Home Screen for push notifications.`})]}):(0,V.jsx)(`p`,{className:`text-sm text-text-subtle`,children:`Push notifications are not supported in this browser.`})]}),(0,V.jsx)(Ot,{}),(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-medium text-text-secondary`,children:`About`}),(0,V.jsx)(`p`,{className:`text-sm text-text-secondary`,children:`PPM — Personal Project Manager`}),(0,V.jsx)(`p`,{className:`text-xs text-text-subtle`,children:`A mobile-first web IDE for managing your projects.`})]})]})})}export{Kt as SettingsTab};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,n as t,r as n}from"./jsx-runtime-BFALxl05.js";import{g as r}from"./index-
|
|
1
|
+
import{a as e,n as t,r as n}from"./jsx-runtime-BFALxl05.js";import{g as r}from"./index-wdrrHLzl.js";var i=t(`text-wrap`,[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]]);function a(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o(e){if(Array.isArray(e))return e}function s(e,t,n){return(t=g(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function l(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?u(Object(n),!0).forEach(function(t){s(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function f(e,t){if(e==null)return{};var n,r,i=p(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function p(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function m(e,t){return o(e)||c(e,t)||_(e,t)||l()}function h(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function g(e){var t=h(e,`string`);return typeof t==`symbol`?t:t+``}function _(e,t){if(e){if(typeof e==`string`)return a(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?y(Object(n),!0).forEach(function(t){v(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function x(){var e=[...arguments];return function(t){return e.reduceRight(function(e,t){return t(e)},t)}}function S(e){return function t(){var n=this,r=[...arguments];return r.length>=e.length?e.apply(this,r):function(){var e=[...arguments];return t.apply(n,[].concat(r,e))}}}function C(e){return{}.toString.call(e).includes(`Object`)}function w(e){return!Object.keys(e).length}function T(e){return typeof e==`function`}function E(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function D(e,t){return C(t)||M(`changeType`),Object.keys(t).some(function(t){return!E(e,t)})&&M(`changeField`),t}function O(e){T(e)||M(`selectorType`)}function k(e){T(e)||C(e)||M(`handlerType`),C(e)&&Object.values(e).some(function(e){return!T(e)})&&M(`handlersType`)}function A(e){e||M(`initialIsRequired`),C(e)||M(`initialType`),w(e)&&M(`initialContent`)}function j(e,t){throw Error(e[t]||e.default)}var M=S(j)({initialIsRequired:`initial state is required`,initialType:`initial state should be an object`,initialContent:`initial state shouldn't be an empty object`,handlerType:`handler should be an object or a function`,handlersType:`all handlers should be a functions`,selectorType:`selector should be a function`,changeType:`provided value of changes should be an object`,changeField:`it seams you want to change a field in the state which is not specified in the "initial" state`,default:"an unknown error accured in `state-local` package"}),N={changes:D,selector:O,handler:k,initial:A};function P(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};N.initial(e),N.handler(t);var n={current:e},r=S(ee)(n,t),i=S(I)(n),a=S(N.changes)(e),o=S(F)(n);function s(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(e){return e};return N.selector(e),e(n.current)}function c(e){x(r,i,a,o)(e)}return[s,c]}function F(e,t){return T(t)?t(e.current):t}function I(e,t){return e.current=b(b({},e.current),t),t}function ee(e,t,n){return T(t)?t(e.current):Object.keys(n).forEach(function(n){return t[n]?.call(t,e.current[n])}),n}var te={create:P},ne={paths:{vs:`https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs`}};function re(e){return function t(){var n=this,r=[...arguments];return r.length>=e.length?e.apply(this,r):function(){var e=[...arguments];return t.apply(n,[].concat(r,e))}}}function ie(e){return{}.toString.call(e).includes(`Object`)}function ae(e){return e||ce(`configIsRequired`),ie(e)||ce(`configType`),e.urls?(oe(),{paths:{vs:e.urls.monacoBase}}):e}function oe(){console.warn(L.deprecation)}function se(e,t){throw Error(e[t]||e.default)}var L={configIsRequired:`the configuration object is required`,configType:`the configuration object should be an object`,default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
3
3
|
You are using deprecated way of configuration.
|
|
4
4
|
|
package/dist/web/index.html
CHANGED
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
39
39
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
40
40
|
<link href="https://fonts.googleapis.com/css2?family=Geist+Mono:wght@400;500;600;700&family=Geist:wght@400;500;600;700&display=swap" rel="stylesheet" />
|
|
41
|
-
<script type="module" crossorigin src="/assets/index-
|
|
41
|
+
<script type="module" crossorigin src="/assets/index-wdrrHLzl.js"></script>
|
|
42
42
|
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-BFALxl05.js">
|
|
43
43
|
<link rel="modulepreload" crossorigin href="/assets/utils-B-_GCz7E.js">
|
|
44
44
|
<link rel="modulepreload" crossorigin href="/assets/input-CTnwfHVN.js">
|
|
45
45
|
<link rel="modulepreload" crossorigin href="/assets/api-client-BCjah751.js">
|
|
46
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
46
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DnbqOQf5.css">
|
|
47
47
|
<link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
|
|
48
48
|
<body class="bg-[#0f1419] text-[#e5e7eb] font-sans antialiased">
|
|
49
49
|
<div id="root"></div>
|
package/dist/web/sw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
try{self[`workbox:core:7.3.0`]&&_()}catch{}var e=(e,...t)=>{let n=e;return t.length>0&&(n+=` :: ${JSON.stringify(t)}`),n},t=class extends Error{constructor(t,n){let r=e(t,n);super(r),this.name=t,this.details=n}},n={googleAnalytics:`googleAnalytics`,precache:`precache-v2`,prefix:`workbox`,runtime:`runtime`,suffix:typeof registration<`u`?registration.scope:``},r=e=>[n.prefix,e,n.suffix].filter(e=>e&&e.length>0).join(`-`),i=e=>{for(let t of Object.keys(n))e(t)},a={updateDetails:e=>{i(t=>{typeof e[t]==`string`&&(n[t]=e[t])})},getGoogleAnalyticsName:e=>e||r(n.googleAnalytics),getPrecacheName:e=>e||r(n.precache),getPrefix:()=>n.prefix,getRuntimeName:e=>e||r(n.runtime),getSuffix:()=>n.suffix};function o(e,t){let n=t();return e.waitUntil(n),n}try{self[`workbox:precaching:7.3.0`]&&_()}catch{}var s=`__WB_REVISION__`;function c(e){if(!e)throw new t(`add-to-cache-list-unexpected-type`,{entry:e});if(typeof e==`string`){let t=new URL(e,location.href);return{cacheKey:t.href,url:t.href}}let{revision:n,url:r}=e;if(!r)throw new t(`add-to-cache-list-unexpected-type`,{entry:e});if(!n){let e=new URL(r,location.href);return{cacheKey:e.href,url:e.href}}let i=new URL(r,location.href),a=new URL(r,location.href);return i.searchParams.set(s,n),{cacheKey:i.href,url:a.href}}var l=class{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:n})=>{if(e.type===`install`&&t&&t.originalRequest&&t.originalRequest instanceof Request){let e=t.originalRequest.url;n?this.notUpdatedURLs.push(e):this.updatedURLs.push(e)}return n}}},u=class{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:e,params:t})=>{let n=t?.cacheKey||this._precacheController.getCacheKeyForURL(e.url);return n?new Request(n,{headers:e.headers}):e},this._precacheController=e}},d;function f(){if(d===void 0){let e=new Response(``);if(`body`in e)try{new Response(e.body),d=!0}catch{d=!1}d=!1}return d}async function p(e,n){let r=null;if(e.url&&(r=new URL(e.url).origin),r!==self.location.origin)throw new t(`cross-origin-copy-response`,{origin:r});let i=e.clone(),a={headers:new Headers(i.headers),status:i.status,statusText:i.statusText},o=n?n(a):a,s=f()?i.body:await i.blob();return new Response(s,o)}var m=e=>new URL(String(e),location.href).href.replace(RegExp(`^${location.origin}`),``);function h(e,t){let n=new URL(e);for(let e of t)n.searchParams.delete(e);return n.href}async function g(e,t,n,r){let i=h(t.url,n);if(t.url===i)return e.match(t,r);let a=Object.assign(Object.assign({},r),{ignoreSearch:!0}),o=await e.keys(t,a);for(let t of o)if(i===h(t.url,n))return e.match(t,r)}var v=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}},y=new Set;async function b(){for(let e of y)await e()}function x(e){return new Promise(t=>setTimeout(t,e))}try{self[`workbox:strategies:7.3.0`]&&_()}catch{}function S(e){return typeof e==`string`?new Request(e):e}var C=class{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new v,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(let e of this._plugins)this._pluginStateMap.set(e,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){let{event:n}=this,r=S(e);if(r.mode===`navigate`&&n instanceof FetchEvent&&n.preloadResponse){let e=await n.preloadResponse;if(e)return e}let i=this.hasCallback(`fetchDidFail`)?r.clone():null;try{for(let e of this.iterateCallbacks(`requestWillFetch`))r=await e({request:r.clone(),event:n})}catch(e){if(e instanceof Error)throw new t(`plugin-error-request-will-fetch`,{thrownErrorMessage:e.message})}let a=r.clone();try{let e;e=await fetch(r,r.mode===`navigate`?void 0:this._strategy.fetchOptions);for(let t of this.iterateCallbacks(`fetchDidSucceed`))e=await t({event:n,request:a,response:e});return e}catch(e){throw i&&await this.runCallbacks(`fetchDidFail`,{error:e,event:n,originalRequest:i.clone(),request:a.clone()}),e}}async fetchAndCachePut(e){let t=await this.fetch(e),n=t.clone();return this.waitUntil(this.cachePut(e,n)),t}async cacheMatch(e){let t=S(e),n,{cacheName:r,matchOptions:i}=this._strategy,a=await this.getCacheKey(t,`read`),o=Object.assign(Object.assign({},i),{cacheName:r});n=await caches.match(a,o);for(let e of this.iterateCallbacks(`cachedResponseWillBeUsed`))n=await e({cacheName:r,matchOptions:i,cachedResponse:n,request:a,event:this.event})||void 0;return n}async cachePut(e,n){let r=S(e);await x(0);let i=await this.getCacheKey(r,`write`);if(!n)throw new t(`cache-put-with-no-response`,{url:m(i.url)});let a=await this._ensureResponseSafeToCache(n);if(!a)return!1;let{cacheName:o,matchOptions:s}=this._strategy,c=await self.caches.open(o),l=this.hasCallback(`cacheDidUpdate`),u=l?await g(c,i.clone(),[`__WB_REVISION__`],s):null;try{await c.put(i,l?a.clone():a)}catch(e){if(e instanceof Error)throw e.name===`QuotaExceededError`&&await b(),e}for(let e of this.iterateCallbacks(`cacheDidUpdate`))await e({cacheName:o,oldResponse:u,newResponse:a.clone(),request:i,event:this.event});return!0}async getCacheKey(e,t){let n=`${e.url} | ${t}`;if(!this._cacheKeys[n]){let r=e;for(let e of this.iterateCallbacks(`cacheKeyWillBeUsed`))r=S(await e({mode:t,request:r,event:this.event,params:this.params}));this._cacheKeys[n]=r}return this._cacheKeys[n]}hasCallback(e){for(let t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(let n of this.iterateCallbacks(e))await n(t)}*iterateCallbacks(e){for(let t of this._strategy.plugins)if(typeof t[e]==`function`){let n=this._pluginStateMap.get(t);yield r=>{let i=Object.assign(Object.assign({},r),{state:n});return t[e](i)}}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){for(;this._extendLifetimePromises.length;){let e=this._extendLifetimePromises.splice(0),t=(await Promise.allSettled(e)).find(e=>e.status===`rejected`);if(t)throw t.reason}}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,n=!1;for(let e of this.iterateCallbacks(`cacheWillUpdate`))if(t=await e({request:this.request,response:t,event:this.event})||void 0,n=!0,!t)break;return n||t&&t.status!==200&&(t=void 0),t}},w=class{constructor(e={}){this.cacheName=a.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){let[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});let t=e.event,n=typeof e.request==`string`?new Request(e.request):e.request,r=`params`in e?e.params:void 0,i=new C(this,{event:t,request:n,params:r}),a=this._getResponse(i,n,t);return[a,this._awaitComplete(a,i,n,t)]}async _getResponse(e,n,r){await e.runCallbacks(`handlerWillStart`,{event:r,request:n});let i;try{if(i=await this._handle(n,e),!i||i.type===`error`)throw new t(`no-response`,{url:n.url})}catch(t){if(t instanceof Error){for(let a of e.iterateCallbacks(`handlerDidError`))if(i=await a({error:t,event:r,request:n}),i)break}if(!i)throw t}for(let t of e.iterateCallbacks(`handlerWillRespond`))i=await t({event:r,request:n,response:i});return i}async _awaitComplete(e,t,n,r){let i,a;try{i=await e}catch{}try{await t.runCallbacks(`handlerDidRespond`,{event:r,request:n,response:i}),await t.doneWaiting()}catch(e){e instanceof Error&&(a=e)}if(await t.runCallbacks(`handlerDidComplete`,{event:r,request:n,response:i,error:a}),t.destroy(),a)throw a}},T=class e extends w{constructor(t={}){t.cacheName=a.getPrecacheName(t.cacheName),super(t),this._fallbackToNetwork=t.fallbackToNetwork!==!1,this.plugins.push(e.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){return await t.cacheMatch(e)||(t.event&&t.event.type===`install`?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,n){let r,i=n.params||{};if(this._fallbackToNetwork){let t=i.integrity,a=e.integrity,o=!a||a===t;r=await n.fetch(new Request(e,{integrity:e.mode===`no-cors`?void 0:a||t})),t&&o&&e.mode!==`no-cors`&&(this._useDefaultCacheabilityPluginIfNeeded(),await n.cachePut(e,r.clone()))}else throw new t(`missing-precache-entry`,{cacheName:this.cacheName,url:e.url});return r}async _handleInstall(e,n){this._useDefaultCacheabilityPluginIfNeeded();let r=await n.fetch(e);if(!await n.cachePut(e,r.clone()))throw new t(`bad-precaching-response`,{url:e.url,status:r.status});return r}_useDefaultCacheabilityPluginIfNeeded(){let t=null,n=0;for(let[r,i]of this.plugins.entries())i!==e.copyRedirectedCacheableResponsesPlugin&&(i===e.defaultPrecacheCacheabilityPlugin&&(t=r),i.cacheWillUpdate&&n++);n===0?this.plugins.push(e.defaultPrecacheCacheabilityPlugin):n>1&&t!==null&&this.plugins.splice(t,1)}};T.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate({response:e}){return!e||e.status>=400?null:e}},T.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate({response:e}){return e.redirected?await p(e):e}};var E=class{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:n=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new T({cacheName:a.getPrecacheName(e),plugins:[...t,new u({precacheController:this})],fallbackToNetwork:n}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||=(self.addEventListener(`install`,this.install),self.addEventListener(`activate`,this.activate),!0)}addToCacheList(e){let n=[];for(let r of e){typeof r==`string`?n.push(r):r&&r.revision===void 0&&n.push(r.url);let{cacheKey:e,url:i}=c(r),a=typeof r!=`string`&&r.revision?`reload`:`default`;if(this._urlsToCacheKeys.has(i)&&this._urlsToCacheKeys.get(i)!==e)throw new t(`add-to-cache-list-conflicting-entries`,{firstEntry:this._urlsToCacheKeys.get(i),secondEntry:e});if(typeof r!=`string`&&r.integrity){if(this._cacheKeysToIntegrities.has(e)&&this._cacheKeysToIntegrities.get(e)!==r.integrity)throw new t(`add-to-cache-list-conflicting-integrities`,{url:i});this._cacheKeysToIntegrities.set(e,r.integrity)}if(this._urlsToCacheKeys.set(i,e),this._urlsToCacheModes.set(i,a),n.length>0){let e=`Workbox is precaching URLs without revision info: ${n.join(`, `)}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(e)}}}install(e){return o(e,async()=>{let t=new l;this.strategy.plugins.push(t);for(let[t,n]of this._urlsToCacheKeys){let r=this._cacheKeysToIntegrities.get(n),i=this._urlsToCacheModes.get(t),a=new Request(t,{integrity:r,cache:i,credentials:`same-origin`});await Promise.all(this.strategy.handleAll({params:{cacheKey:n},request:a,event:e}))}let{updatedURLs:n,notUpdatedURLs:r}=t;return{updatedURLs:n,notUpdatedURLs:r}})}activate(e){return o(e,async()=>{let e=await self.caches.open(this.strategy.cacheName),t=await e.keys(),n=new Set(this._urlsToCacheKeys.values()),r=[];for(let i of t)n.has(i.url)||(await e.delete(i),r.push(i.url));return{deletedURLs:r}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){let t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){let t=e instanceof Request?e.url:e,n=this.getCacheKeyForURL(t);if(n)return(await self.caches.open(this.strategy.cacheName)).match(n)}createHandlerBoundToURL(e){let n=this.getCacheKeyForURL(e);if(!n)throw new t(`non-precached-url`,{url:e});return t=>(t.request=new Request(e),t.params=Object.assign({cacheKey:n},t.params),this.strategy.handle(t))}},D,O=()=>(D||=new E,D);try{self[`workbox:routing:7.3.0`]&&_()}catch{}var k=e=>e&&typeof e==`object`?e:{handle:e},A=class{constructor(e,t,n=`GET`){this.handler=k(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=k(e)}},j=class extends A{constructor(e,t,n){super(({url:t})=>{let n=e.exec(t.href);if(n&&!(t.origin!==location.origin&&n.index!==0))return n.slice(1)},t,n)}},M=class{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener(`fetch`,(e=>{let{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)}))}addCacheListener(){self.addEventListener(`message`,(e=>{if(e.data&&e.data.type===`CACHE_URLS`){let{payload:t}=e.data,n=Promise.all(t.urlsToCache.map(t=>{typeof t==`string`&&(t=[t]);let n=new Request(...t);return this.handleRequest({request:n,event:e})}));e.waitUntil(n),e.ports&&e.ports[0]&&n.then(()=>e.ports[0].postMessage(!0))}}))}handleRequest({request:e,event:t}){let n=new URL(e.url,location.href);if(!n.protocol.startsWith(`http`))return;let r=n.origin===location.origin,{params:i,route:a}=this.findMatchingRoute({event:t,request:e,sameOrigin:r,url:n}),o=a&&a.handler,s=e.method;if(!o&&this._defaultHandlerMap.has(s)&&(o=this._defaultHandlerMap.get(s)),!o)return;let c;try{c=o.handle({url:n,request:e,event:t,params:i})}catch(e){c=Promise.reject(e)}let l=a&&a.catchHandler;return c instanceof Promise&&(this._catchHandler||l)&&(c=c.catch(async r=>{if(l)try{return await l.handle({url:n,request:e,event:t,params:i})}catch(e){e instanceof Error&&(r=e)}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw r})),c}findMatchingRoute({url:e,sameOrigin:t,request:n,event:r}){let i=this._routes.get(n.method)||[];for(let a of i){let i,o=a.match({url:e,sameOrigin:t,request:n,event:r});if(o)return i=o,(Array.isArray(i)&&i.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o==`boolean`)&&(i=void 0),{route:a,params:i}}return{}}setDefaultHandler(e,t=`GET`){this._defaultHandlerMap.set(t,k(e))}setCatchHandler(e){this._catchHandler=k(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new t(`unregister-route-but-not-found-with-method`,{method:e.method});let n=this._routes.get(e.method).indexOf(e);if(n>-1)this._routes.get(e.method).splice(n,1);else throw new t(`unregister-route-route-not-registered`)}},N,P=()=>(N||(N=new M,N.addFetchListener(),N.addCacheListener()),N);function F(e,n,r){let i;if(typeof e==`string`){let t=new URL(e,location.href);i=new A(({url:e})=>e.href===t.href,n,r)}else if(e instanceof RegExp)i=new j(e,n,r);else if(typeof e==`function`)i=new A(e,n,r);else if(e instanceof A)i=e;else throw new t(`unsupported-route-type`,{moduleName:`workbox-routing`,funcName:`registerRoute`,paramName:`capture`});return P().registerRoute(i),i}function I(e,t=[]){for(let n of[...e.searchParams.keys()])t.some(e=>e.test(n))&&e.searchParams.delete(n);return e}function*L(e,{ignoreURLParametersMatching:t=[/^utm_/,/^fbclid$/],directoryIndex:n=`index.html`,cleanURLs:r=!0,urlManipulation:i}={}){let a=new URL(e,location.href);a.hash=``,yield a.href;let o=I(a,t);if(yield o.href,n&&o.pathname.endsWith(`/`)){let e=new URL(o.href);e.pathname+=n,yield e.href}if(r){let e=new URL(o.href);e.pathname+=`.html`,yield e.href}if(i){let e=i({url:a});for(let t of e)yield t.href}}var R=class extends A{constructor(e,t){super(({request:n})=>{let r=e.getURLsToCacheKeys();for(let i of L(n.url,t)){let t=r.get(i);if(t)return{cacheKey:t,integrity:e.getIntegrityForCacheKey(t)}}},e.strategy)}};function z(e){F(new R(O(),e))}function B(e){O().precache(e)}function V(e,t){B(e),z(t)}V([{"revision":"1872c500de691dce40960bb85481de07","url":"registerSW.js"},{"revision":"03fc4ef30aa8bc8d092779233232faea","url":"index.html"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-512.svg"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-192.svg"},{"revision":null,"url":"assets/utils-B-_GCz7E.js"},{"revision":null,"url":"assets/use-monaco-theme-BxaccPmI.js"},{"revision":null,"url":"assets/terminal-tab-BrP-ENHg.css"},{"revision":null,"url":"assets/terminal-tab-BEFAYT4S.js"},{"revision":null,"url":"assets/settings-tab-C5aWMqIA.js"},{"revision":null,"url":"assets/marked.esm-DhBtkBa8.js"},{"revision":null,"url":"assets/jsx-runtime-BFALxl05.js"},{"revision":null,"url":"assets/input-CTnwfHVN.js"},{"revision":null,"url":"assets/index-CaUQy3Zs.js"},{"revision":null,"url":"assets/index-3zt5mBwZ.css"},{"revision":null,"url":"assets/git-graph-fOKEZiot.js"},{"revision":null,"url":"assets/external-link-Dim3NH6h.js"},{"revision":null,"url":"assets/diff-viewer-sBWBgb7U.js"},{"revision":null,"url":"assets/copy-B-kLwqzg.js"},{"revision":null,"url":"assets/columns-2-DFQ3yid7.js"},{"revision":null,"url":"assets/code-editor-DuarTBEe.js"},{"revision":null,"url":"assets/chat-tab-C_U7EwM9.js"},{"revision":null,"url":"assets/api-client-BCjah751.js"},{"revision":"79c8870653c8f419f2e3323085e1f4be","url":"manifest.webmanifest"}]),self.addEventListener(`push`,e=>{e.waitUntil(self.clients.matchAll({type:`window`,includeUncontrolled:!0}).then(t=>{if(t.some(e=>e.visibilityState===`visible`))return;let n=e.data?.json()??{title:`PPM`,body:`Chat completed`};return self.registration.showNotification(n.title,{body:n.body,icon:`/icon-192.png`,badge:`/icon-192.png`,tag:`ppm-chat-done`,silent:!1,data:{url:self.location.origin}})}))}),self.addEventListener(`notificationclick`,e=>{e.notification.close(),e.waitUntil(self.clients.matchAll({type:`window`,includeUncontrolled:!0}).then(t=>{for(let e of t)if(e.url.includes(self.location.origin)&&`focus`in e)return e.focus();return self.clients.openWindow(e.notification.data?.url||`/`)}))});
|
|
1
|
+
try{self[`workbox:core:7.3.0`]&&_()}catch{}var e=(e,...t)=>{let n=e;return t.length>0&&(n+=` :: ${JSON.stringify(t)}`),n},t=class extends Error{constructor(t,n){let r=e(t,n);super(r),this.name=t,this.details=n}},n={googleAnalytics:`googleAnalytics`,precache:`precache-v2`,prefix:`workbox`,runtime:`runtime`,suffix:typeof registration<`u`?registration.scope:``},r=e=>[n.prefix,e,n.suffix].filter(e=>e&&e.length>0).join(`-`),i=e=>{for(let t of Object.keys(n))e(t)},a={updateDetails:e=>{i(t=>{typeof e[t]==`string`&&(n[t]=e[t])})},getGoogleAnalyticsName:e=>e||r(n.googleAnalytics),getPrecacheName:e=>e||r(n.precache),getPrefix:()=>n.prefix,getRuntimeName:e=>e||r(n.runtime),getSuffix:()=>n.suffix};function o(e,t){let n=t();return e.waitUntil(n),n}try{self[`workbox:precaching:7.3.0`]&&_()}catch{}var s=`__WB_REVISION__`;function c(e){if(!e)throw new t(`add-to-cache-list-unexpected-type`,{entry:e});if(typeof e==`string`){let t=new URL(e,location.href);return{cacheKey:t.href,url:t.href}}let{revision:n,url:r}=e;if(!r)throw new t(`add-to-cache-list-unexpected-type`,{entry:e});if(!n){let e=new URL(r,location.href);return{cacheKey:e.href,url:e.href}}let i=new URL(r,location.href),a=new URL(r,location.href);return i.searchParams.set(s,n),{cacheKey:i.href,url:a.href}}var l=class{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:n})=>{if(e.type===`install`&&t&&t.originalRequest&&t.originalRequest instanceof Request){let e=t.originalRequest.url;n?this.notUpdatedURLs.push(e):this.updatedURLs.push(e)}return n}}},u=class{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:e,params:t})=>{let n=t?.cacheKey||this._precacheController.getCacheKeyForURL(e.url);return n?new Request(n,{headers:e.headers}):e},this._precacheController=e}},d;function f(){if(d===void 0){let e=new Response(``);if(`body`in e)try{new Response(e.body),d=!0}catch{d=!1}d=!1}return d}async function p(e,n){let r=null;if(e.url&&(r=new URL(e.url).origin),r!==self.location.origin)throw new t(`cross-origin-copy-response`,{origin:r});let i=e.clone(),a={headers:new Headers(i.headers),status:i.status,statusText:i.statusText},o=n?n(a):a,s=f()?i.body:await i.blob();return new Response(s,o)}var m=e=>new URL(String(e),location.href).href.replace(RegExp(`^${location.origin}`),``);function h(e,t){let n=new URL(e);for(let e of t)n.searchParams.delete(e);return n.href}async function g(e,t,n,r){let i=h(t.url,n);if(t.url===i)return e.match(t,r);let a=Object.assign(Object.assign({},r),{ignoreSearch:!0}),o=await e.keys(t,a);for(let t of o)if(i===h(t.url,n))return e.match(t,r)}var v=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}},y=new Set;async function b(){for(let e of y)await e()}function x(e){return new Promise(t=>setTimeout(t,e))}try{self[`workbox:strategies:7.3.0`]&&_()}catch{}function S(e){return typeof e==`string`?new Request(e):e}var C=class{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new v,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(let e of this._plugins)this._pluginStateMap.set(e,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){let{event:n}=this,r=S(e);if(r.mode===`navigate`&&n instanceof FetchEvent&&n.preloadResponse){let e=await n.preloadResponse;if(e)return e}let i=this.hasCallback(`fetchDidFail`)?r.clone():null;try{for(let e of this.iterateCallbacks(`requestWillFetch`))r=await e({request:r.clone(),event:n})}catch(e){if(e instanceof Error)throw new t(`plugin-error-request-will-fetch`,{thrownErrorMessage:e.message})}let a=r.clone();try{let e;e=await fetch(r,r.mode===`navigate`?void 0:this._strategy.fetchOptions);for(let t of this.iterateCallbacks(`fetchDidSucceed`))e=await t({event:n,request:a,response:e});return e}catch(e){throw i&&await this.runCallbacks(`fetchDidFail`,{error:e,event:n,originalRequest:i.clone(),request:a.clone()}),e}}async fetchAndCachePut(e){let t=await this.fetch(e),n=t.clone();return this.waitUntil(this.cachePut(e,n)),t}async cacheMatch(e){let t=S(e),n,{cacheName:r,matchOptions:i}=this._strategy,a=await this.getCacheKey(t,`read`),o=Object.assign(Object.assign({},i),{cacheName:r});n=await caches.match(a,o);for(let e of this.iterateCallbacks(`cachedResponseWillBeUsed`))n=await e({cacheName:r,matchOptions:i,cachedResponse:n,request:a,event:this.event})||void 0;return n}async cachePut(e,n){let r=S(e);await x(0);let i=await this.getCacheKey(r,`write`);if(!n)throw new t(`cache-put-with-no-response`,{url:m(i.url)});let a=await this._ensureResponseSafeToCache(n);if(!a)return!1;let{cacheName:o,matchOptions:s}=this._strategy,c=await self.caches.open(o),l=this.hasCallback(`cacheDidUpdate`),u=l?await g(c,i.clone(),[`__WB_REVISION__`],s):null;try{await c.put(i,l?a.clone():a)}catch(e){if(e instanceof Error)throw e.name===`QuotaExceededError`&&await b(),e}for(let e of this.iterateCallbacks(`cacheDidUpdate`))await e({cacheName:o,oldResponse:u,newResponse:a.clone(),request:i,event:this.event});return!0}async getCacheKey(e,t){let n=`${e.url} | ${t}`;if(!this._cacheKeys[n]){let r=e;for(let e of this.iterateCallbacks(`cacheKeyWillBeUsed`))r=S(await e({mode:t,request:r,event:this.event,params:this.params}));this._cacheKeys[n]=r}return this._cacheKeys[n]}hasCallback(e){for(let t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(let n of this.iterateCallbacks(e))await n(t)}*iterateCallbacks(e){for(let t of this._strategy.plugins)if(typeof t[e]==`function`){let n=this._pluginStateMap.get(t);yield r=>{let i=Object.assign(Object.assign({},r),{state:n});return t[e](i)}}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){for(;this._extendLifetimePromises.length;){let e=this._extendLifetimePromises.splice(0),t=(await Promise.allSettled(e)).find(e=>e.status===`rejected`);if(t)throw t.reason}}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,n=!1;for(let e of this.iterateCallbacks(`cacheWillUpdate`))if(t=await e({request:this.request,response:t,event:this.event})||void 0,n=!0,!t)break;return n||t&&t.status!==200&&(t=void 0),t}},w=class{constructor(e={}){this.cacheName=a.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){let[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});let t=e.event,n=typeof e.request==`string`?new Request(e.request):e.request,r=`params`in e?e.params:void 0,i=new C(this,{event:t,request:n,params:r}),a=this._getResponse(i,n,t);return[a,this._awaitComplete(a,i,n,t)]}async _getResponse(e,n,r){await e.runCallbacks(`handlerWillStart`,{event:r,request:n});let i;try{if(i=await this._handle(n,e),!i||i.type===`error`)throw new t(`no-response`,{url:n.url})}catch(t){if(t instanceof Error){for(let a of e.iterateCallbacks(`handlerDidError`))if(i=await a({error:t,event:r,request:n}),i)break}if(!i)throw t}for(let t of e.iterateCallbacks(`handlerWillRespond`))i=await t({event:r,request:n,response:i});return i}async _awaitComplete(e,t,n,r){let i,a;try{i=await e}catch{}try{await t.runCallbacks(`handlerDidRespond`,{event:r,request:n,response:i}),await t.doneWaiting()}catch(e){e instanceof Error&&(a=e)}if(await t.runCallbacks(`handlerDidComplete`,{event:r,request:n,response:i,error:a}),t.destroy(),a)throw a}},T=class e extends w{constructor(t={}){t.cacheName=a.getPrecacheName(t.cacheName),super(t),this._fallbackToNetwork=t.fallbackToNetwork!==!1,this.plugins.push(e.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){return await t.cacheMatch(e)||(t.event&&t.event.type===`install`?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,n){let r,i=n.params||{};if(this._fallbackToNetwork){let t=i.integrity,a=e.integrity,o=!a||a===t;r=await n.fetch(new Request(e,{integrity:e.mode===`no-cors`?void 0:a||t})),t&&o&&e.mode!==`no-cors`&&(this._useDefaultCacheabilityPluginIfNeeded(),await n.cachePut(e,r.clone()))}else throw new t(`missing-precache-entry`,{cacheName:this.cacheName,url:e.url});return r}async _handleInstall(e,n){this._useDefaultCacheabilityPluginIfNeeded();let r=await n.fetch(e);if(!await n.cachePut(e,r.clone()))throw new t(`bad-precaching-response`,{url:e.url,status:r.status});return r}_useDefaultCacheabilityPluginIfNeeded(){let t=null,n=0;for(let[r,i]of this.plugins.entries())i!==e.copyRedirectedCacheableResponsesPlugin&&(i===e.defaultPrecacheCacheabilityPlugin&&(t=r),i.cacheWillUpdate&&n++);n===0?this.plugins.push(e.defaultPrecacheCacheabilityPlugin):n>1&&t!==null&&this.plugins.splice(t,1)}};T.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate({response:e}){return!e||e.status>=400?null:e}},T.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate({response:e}){return e.redirected?await p(e):e}};var E=class{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:n=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new T({cacheName:a.getPrecacheName(e),plugins:[...t,new u({precacheController:this})],fallbackToNetwork:n}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||=(self.addEventListener(`install`,this.install),self.addEventListener(`activate`,this.activate),!0)}addToCacheList(e){let n=[];for(let r of e){typeof r==`string`?n.push(r):r&&r.revision===void 0&&n.push(r.url);let{cacheKey:e,url:i}=c(r),a=typeof r!=`string`&&r.revision?`reload`:`default`;if(this._urlsToCacheKeys.has(i)&&this._urlsToCacheKeys.get(i)!==e)throw new t(`add-to-cache-list-conflicting-entries`,{firstEntry:this._urlsToCacheKeys.get(i),secondEntry:e});if(typeof r!=`string`&&r.integrity){if(this._cacheKeysToIntegrities.has(e)&&this._cacheKeysToIntegrities.get(e)!==r.integrity)throw new t(`add-to-cache-list-conflicting-integrities`,{url:i});this._cacheKeysToIntegrities.set(e,r.integrity)}if(this._urlsToCacheKeys.set(i,e),this._urlsToCacheModes.set(i,a),n.length>0){let e=`Workbox is precaching URLs without revision info: ${n.join(`, `)}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(e)}}}install(e){return o(e,async()=>{let t=new l;this.strategy.plugins.push(t);for(let[t,n]of this._urlsToCacheKeys){let r=this._cacheKeysToIntegrities.get(n),i=this._urlsToCacheModes.get(t),a=new Request(t,{integrity:r,cache:i,credentials:`same-origin`});await Promise.all(this.strategy.handleAll({params:{cacheKey:n},request:a,event:e}))}let{updatedURLs:n,notUpdatedURLs:r}=t;return{updatedURLs:n,notUpdatedURLs:r}})}activate(e){return o(e,async()=>{let e=await self.caches.open(this.strategy.cacheName),t=await e.keys(),n=new Set(this._urlsToCacheKeys.values()),r=[];for(let i of t)n.has(i.url)||(await e.delete(i),r.push(i.url));return{deletedURLs:r}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){let t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){let t=e instanceof Request?e.url:e,n=this.getCacheKeyForURL(t);if(n)return(await self.caches.open(this.strategy.cacheName)).match(n)}createHandlerBoundToURL(e){let n=this.getCacheKeyForURL(e);if(!n)throw new t(`non-precached-url`,{url:e});return t=>(t.request=new Request(e),t.params=Object.assign({cacheKey:n},t.params),this.strategy.handle(t))}},D,O=()=>(D||=new E,D);try{self[`workbox:routing:7.3.0`]&&_()}catch{}var k=e=>e&&typeof e==`object`?e:{handle:e},A=class{constructor(e,t,n=`GET`){this.handler=k(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=k(e)}},j=class extends A{constructor(e,t,n){super(({url:t})=>{let n=e.exec(t.href);if(n&&!(t.origin!==location.origin&&n.index!==0))return n.slice(1)},t,n)}},M=class{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener(`fetch`,(e=>{let{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)}))}addCacheListener(){self.addEventListener(`message`,(e=>{if(e.data&&e.data.type===`CACHE_URLS`){let{payload:t}=e.data,n=Promise.all(t.urlsToCache.map(t=>{typeof t==`string`&&(t=[t]);let n=new Request(...t);return this.handleRequest({request:n,event:e})}));e.waitUntil(n),e.ports&&e.ports[0]&&n.then(()=>e.ports[0].postMessage(!0))}}))}handleRequest({request:e,event:t}){let n=new URL(e.url,location.href);if(!n.protocol.startsWith(`http`))return;let r=n.origin===location.origin,{params:i,route:a}=this.findMatchingRoute({event:t,request:e,sameOrigin:r,url:n}),o=a&&a.handler,s=e.method;if(!o&&this._defaultHandlerMap.has(s)&&(o=this._defaultHandlerMap.get(s)),!o)return;let c;try{c=o.handle({url:n,request:e,event:t,params:i})}catch(e){c=Promise.reject(e)}let l=a&&a.catchHandler;return c instanceof Promise&&(this._catchHandler||l)&&(c=c.catch(async r=>{if(l)try{return await l.handle({url:n,request:e,event:t,params:i})}catch(e){e instanceof Error&&(r=e)}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw r})),c}findMatchingRoute({url:e,sameOrigin:t,request:n,event:r}){let i=this._routes.get(n.method)||[];for(let a of i){let i,o=a.match({url:e,sameOrigin:t,request:n,event:r});if(o)return i=o,(Array.isArray(i)&&i.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o==`boolean`)&&(i=void 0),{route:a,params:i}}return{}}setDefaultHandler(e,t=`GET`){this._defaultHandlerMap.set(t,k(e))}setCatchHandler(e){this._catchHandler=k(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new t(`unregister-route-but-not-found-with-method`,{method:e.method});let n=this._routes.get(e.method).indexOf(e);if(n>-1)this._routes.get(e.method).splice(n,1);else throw new t(`unregister-route-route-not-registered`)}},N,P=()=>(N||(N=new M,N.addFetchListener(),N.addCacheListener()),N);function F(e,n,r){let i;if(typeof e==`string`){let t=new URL(e,location.href);i=new A(({url:e})=>e.href===t.href,n,r)}else if(e instanceof RegExp)i=new j(e,n,r);else if(typeof e==`function`)i=new A(e,n,r);else if(e instanceof A)i=e;else throw new t(`unsupported-route-type`,{moduleName:`workbox-routing`,funcName:`registerRoute`,paramName:`capture`});return P().registerRoute(i),i}function I(e,t=[]){for(let n of[...e.searchParams.keys()])t.some(e=>e.test(n))&&e.searchParams.delete(n);return e}function*L(e,{ignoreURLParametersMatching:t=[/^utm_/,/^fbclid$/],directoryIndex:n=`index.html`,cleanURLs:r=!0,urlManipulation:i}={}){let a=new URL(e,location.href);a.hash=``,yield a.href;let o=I(a,t);if(yield o.href,n&&o.pathname.endsWith(`/`)){let e=new URL(o.href);e.pathname+=n,yield e.href}if(r){let e=new URL(o.href);e.pathname+=`.html`,yield e.href}if(i){let e=i({url:a});for(let t of e)yield t.href}}var R=class extends A{constructor(e,t){super(({request:n})=>{let r=e.getURLsToCacheKeys();for(let i of L(n.url,t)){let t=r.get(i);if(t)return{cacheKey:t,integrity:e.getIntegrityForCacheKey(t)}}},e.strategy)}};function z(e){F(new R(O(),e))}function B(e){O().precache(e)}function V(e,t){B(e),z(t)}V([{"revision":"1872c500de691dce40960bb85481de07","url":"registerSW.js"},{"revision":"0ff188b60f8dfcec7ed4322d44cac7d8","url":"index.html"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-512.svg"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-192.svg"},{"revision":null,"url":"assets/utils-B-_GCz7E.js"},{"revision":null,"url":"assets/use-monaco-theme-DGDiih0R.js"},{"revision":null,"url":"assets/terminal-tab-BrP-ENHg.css"},{"revision":null,"url":"assets/terminal-tab-BEFAYT4S.js"},{"revision":null,"url":"assets/settings-tab-WE-GP2Ig.js"},{"revision":null,"url":"assets/marked.esm-DhBtkBa8.js"},{"revision":null,"url":"assets/jsx-runtime-BFALxl05.js"},{"revision":null,"url":"assets/input-CTnwfHVN.js"},{"revision":null,"url":"assets/index-wdrrHLzl.js"},{"revision":null,"url":"assets/index-DnbqOQf5.css"},{"revision":null,"url":"assets/git-graph-7qqwcWri.js"},{"revision":null,"url":"assets/external-link-Dim3NH6h.js"},{"revision":null,"url":"assets/diff-viewer-DI3baLow.js"},{"revision":null,"url":"assets/copy-B-kLwqzg.js"},{"revision":null,"url":"assets/columns-2-DFQ3yid7.js"},{"revision":null,"url":"assets/code-editor-B9B6BZbl.js"},{"revision":null,"url":"assets/chat-tab-BHrizSRk.js"},{"revision":null,"url":"assets/api-client-BCjah751.js"},{"revision":"79c8870653c8f419f2e3323085e1f4be","url":"manifest.webmanifest"}]),self.addEventListener(`push`,e=>{e.waitUntil(self.clients.matchAll({type:`window`,includeUncontrolled:!0}).then(t=>{if(t.some(e=>e.visibilityState===`visible`))return;let n=e.data?.json()??{title:`PPM`,body:`Chat completed`};return self.registration.showNotification(n.title,{body:n.body,icon:`/icon-192.png`,badge:`/icon-192.png`,tag:`ppm-chat-done`,silent:!1,data:{url:self.location.origin}})}))}),self.addEventListener(`notificationclick`,e=>{e.notification.close(),e.waitUntil(self.clients.matchAll({type:`window`,includeUncontrolled:!0}).then(t=>{for(let e of t)if(e.url.includes(self.location.origin)&&`focus`in e)return e.focus();return self.clients.openWindow(e.notification.data?.url||`/`)}))});
|
package/package.json
CHANGED
package/src/web/app.tsx
CHANGED
|
@@ -31,6 +31,7 @@ export function App() {
|
|
|
31
31
|
() => new Set(["__global__"]),
|
|
32
32
|
);
|
|
33
33
|
const theme = useSettingsStore((s) => s.theme);
|
|
34
|
+
const deviceName = useSettingsStore((s) => s.deviceName);
|
|
34
35
|
const fetchProjects = useProjectStore((s) => s.fetchProjects);
|
|
35
36
|
const fetchServerInfo = useSettingsStore((s) => s.fetchServerInfo);
|
|
36
37
|
const activeProject = useProjectStore((s) => s.activeProject);
|
|
@@ -158,7 +159,14 @@ export function App() {
|
|
|
158
159
|
|
|
159
160
|
return (
|
|
160
161
|
<TooltipProvider>
|
|
161
|
-
<div className="h-dvh flex flex-col bg-background text-foreground overflow-hidden">
|
|
162
|
+
<div className="h-dvh flex flex-col bg-background text-foreground overflow-hidden relative">
|
|
163
|
+
{/* Mobile device name badge — floating top-left */}
|
|
164
|
+
{deviceName && (
|
|
165
|
+
<div className="md:hidden fixed top-0 left-0 z-50 px-2 py-0.5 bg-primary/80 text-primary-foreground text-[10px] font-medium rounded-br">
|
|
166
|
+
{deviceName}
|
|
167
|
+
</div>
|
|
168
|
+
)}
|
|
169
|
+
|
|
162
170
|
{/* Main layout */}
|
|
163
171
|
<div className="flex flex-1 overflow-hidden">
|
|
164
172
|
{/* Desktop project bar (far left, non-collapsible) */}
|
|
@@ -25,7 +25,7 @@ export function ChatTab({ metadata, tabId }: ChatTabProps) {
|
|
|
25
25
|
(metadata?.sessionId as string) ?? null,
|
|
26
26
|
);
|
|
27
27
|
const [providerId, setProviderId] = useState<string>(
|
|
28
|
-
(metadata?.providerId as string) ?? "claude
|
|
28
|
+
(metadata?.providerId as string) ?? "claude",
|
|
29
29
|
);
|
|
30
30
|
|
|
31
31
|
// Slash picker state
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import { Suspense, lazy } from "react";
|
|
2
|
-
import { Loader2 } from "lucide-react";
|
|
2
|
+
import { Loader2, Terminal, MessageSquare, GitBranch, Settings } from "lucide-react";
|
|
3
3
|
import { usePanelStore } from "@/stores/panel-store";
|
|
4
|
+
import { useProjectStore } from "@/stores/project-store";
|
|
4
5
|
import type { TabType } from "@/stores/tab-store";
|
|
5
6
|
import { TabBar } from "./tab-bar";
|
|
6
7
|
import { SplitDropOverlay } from "./split-drop-overlay";
|
|
7
8
|
import { cn } from "@/lib/utils";
|
|
8
9
|
|
|
10
|
+
const QUICK_OPEN_TABS: { type: TabType; label: string; icon: React.ElementType }[] = [
|
|
11
|
+
{ type: "terminal", label: "Terminal", icon: Terminal },
|
|
12
|
+
{ type: "chat", label: "AI Chat", icon: MessageSquare },
|
|
13
|
+
{ type: "git-graph", label: "Git Graph", icon: GitBranch },
|
|
14
|
+
{ type: "settings", label: "Settings", icon: Settings },
|
|
15
|
+
];
|
|
16
|
+
|
|
9
17
|
const TAB_COMPONENTS: Record<TabType, React.LazyExoticComponent<React.ComponentType<{ metadata?: Record<string, unknown>; tabId?: string }>>> = {
|
|
10
18
|
terminal: lazy(() => import("@/components/terminal/terminal-tab").then((m) => ({ default: m.TerminalTab }))),
|
|
11
19
|
chat: lazy(() => import("@/components/chat/chat-tab").then((m) => ({ default: m.ChatTab }))),
|
|
@@ -43,9 +51,7 @@ export function EditorPanel({ panelId, projectName }: EditorPanelProps) {
|
|
|
43
51
|
|
|
44
52
|
<div className="flex-1 overflow-hidden relative">
|
|
45
53
|
{panel.tabs.length === 0 ? (
|
|
46
|
-
<
|
|
47
|
-
Drop a tab here
|
|
48
|
-
</div>
|
|
54
|
+
<EmptyPanel panelId={panelId} />
|
|
49
55
|
) : (
|
|
50
56
|
panel.tabs.map((tab) => {
|
|
51
57
|
const Component = TAB_COMPONENTS[tab.type];
|
|
@@ -64,3 +70,37 @@ export function EditorPanel({ panelId, projectName }: EditorPanelProps) {
|
|
|
64
70
|
</div>
|
|
65
71
|
);
|
|
66
72
|
}
|
|
73
|
+
|
|
74
|
+
function EmptyPanel({ panelId }: { panelId: string }) {
|
|
75
|
+
const activeProject = useProjectStore((s) => s.activeProject);
|
|
76
|
+
|
|
77
|
+
function openTab(type: TabType) {
|
|
78
|
+
const needsProject = type !== "settings";
|
|
79
|
+
const metadata = needsProject && activeProject ? { projectName: activeProject.name } : undefined;
|
|
80
|
+
usePanelStore.getState().openTab(
|
|
81
|
+
{ type, title: QUICK_OPEN_TABS.find((t) => t.type === type)?.label ?? type, metadata, projectId: activeProject?.name ?? null, closable: true },
|
|
82
|
+
panelId,
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<div className="flex flex-col items-center justify-center h-full gap-4 text-text-secondary">
|
|
88
|
+
<p className="text-sm">Open a tab to get started</p>
|
|
89
|
+
<div className="flex flex-col md:flex-row flex-wrap justify-center gap-2">
|
|
90
|
+
{QUICK_OPEN_TABS.map((opt) => {
|
|
91
|
+
const Icon = opt.icon;
|
|
92
|
+
return (
|
|
93
|
+
<button
|
|
94
|
+
key={opt.type}
|
|
95
|
+
onClick={() => openTab(opt.type)}
|
|
96
|
+
className="flex items-center gap-2 px-4 py-2 rounded-md border border-border bg-surface hover:bg-surface-elevated text-sm text-foreground transition-colors"
|
|
97
|
+
>
|
|
98
|
+
<Icon className="size-4" />
|
|
99
|
+
{opt.label}
|
|
100
|
+
</button>
|
|
101
|
+
);
|
|
102
|
+
})}
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
@@ -21,7 +21,8 @@ export function SettingsTab() {
|
|
|
21
21
|
const { permission, isSubscribed, loading, subscribe, unsubscribe } = usePushNotification();
|
|
22
22
|
|
|
23
23
|
return (
|
|
24
|
-
<div className="h-full
|
|
24
|
+
<div className="h-full w-full overflow-auto">
|
|
25
|
+
<div className="p-4 space-y-6 max-w-lg mx-auto">
|
|
25
26
|
<h2 className="text-lg font-semibold">Settings</h2>
|
|
26
27
|
|
|
27
28
|
<div className="space-y-3">
|
|
@@ -102,5 +103,6 @@ export function SettingsTab() {
|
|
|
102
103
|
</p>
|
|
103
104
|
</div>
|
|
104
105
|
</div>
|
|
106
|
+
</div>
|
|
105
107
|
);
|
|
106
108
|
}
|
|
@@ -38,9 +38,9 @@ function ScrollBar({
|
|
|
38
38
|
className={cn(
|
|
39
39
|
"flex touch-none p-px transition-colors select-none",
|
|
40
40
|
orientation === "vertical" &&
|
|
41
|
-
"h-full w-
|
|
41
|
+
"h-full w-1.5 border-l border-l-transparent",
|
|
42
42
|
orientation === "horizontal" &&
|
|
43
|
-
"h-
|
|
43
|
+
"h-1.5 flex-col border-t border-t-transparent",
|
|
44
44
|
className
|
|
45
45
|
)}
|
|
46
46
|
{...props}
|
|
@@ -168,15 +168,8 @@ export const usePanelStore = create<PanelStore>()((set, get) => {
|
|
|
168
168
|
projectFocused: newProjectFocused,
|
|
169
169
|
});
|
|
170
170
|
} else {
|
|
171
|
-
// Create
|
|
171
|
+
// Create empty layout — EmptyPanel will show quick-open buttons
|
|
172
172
|
const p = createPanel();
|
|
173
|
-
const defaultTab: Tab = {
|
|
174
|
-
id: generateTabId(), type: "chat", title: "AI Chat", projectId: projectName, closable: true,
|
|
175
|
-
metadata: { projectName },
|
|
176
|
-
};
|
|
177
|
-
p.tabs = [defaultTab];
|
|
178
|
-
p.activeTabId = defaultTab.id;
|
|
179
|
-
p.tabHistory = [defaultTab.id];
|
|
180
173
|
const newGrid = [[p.id]];
|
|
181
174
|
|
|
182
175
|
// Merge into flat panels map
|
|
@@ -92,10 +92,10 @@
|
|
|
92
92
|
--color-text-subtle: #94a3b8;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
/* Scrollbar styling */
|
|
95
|
+
/* Scrollbar styling — thin & unobtrusive */
|
|
96
96
|
::-webkit-scrollbar {
|
|
97
|
-
width:
|
|
98
|
-
height:
|
|
97
|
+
width: 5px;
|
|
98
|
+
height: 5px;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
::-webkit-scrollbar-track {
|
|
@@ -104,13 +104,19 @@
|
|
|
104
104
|
|
|
105
105
|
::-webkit-scrollbar-thumb {
|
|
106
106
|
background: var(--color-border);
|
|
107
|
-
border-radius:
|
|
107
|
+
border-radius: 9999px;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
::-webkit-scrollbar-thumb:hover {
|
|
111
111
|
background: #525c6a;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
+
/* Firefox thin scrollbar */
|
|
115
|
+
* {
|
|
116
|
+
scrollbar-width: thin;
|
|
117
|
+
scrollbar-color: var(--color-border) transparent;
|
|
118
|
+
}
|
|
119
|
+
|
|
114
120
|
/* Disable global focus ring — components handle their own focus styles */
|
|
115
121
|
:focus-visible {
|
|
116
122
|
outline: none;
|