@brainfish-ai/components 0.28.7 → 0.28.9

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.
@@ -1,19 +1,18 @@
1
- import*as e from"react";import t,{useCallback as n,useEffect as r,useRef as a,useState as s,useImperativeHandle as l}from"react";import{u as o,E as i,b as c,R as m}from"../chunks/suggestion-card.D6e8iM9D.js";import '../knowledge-review.css';export{S as SuggestionCard}from"../chunks/suggestion-card.D6e8iM9D.js";import d from"html-react-parser";import{CaretDown as u,CaretUp as f,Lightbulb as g,Backspace as p,CheckCircle as h,HandsClapping as b}from"@phosphor-icons/react";import{Card as E,CardHeader as A,CardTitle as x,CardContent as v}from"../components/ui/card.js";import{ScrollArea as N}from"../components/ui/scroll-area.js";import{Spinner as k}from"../components/ui/spinner.js";import{B as w,a as y}from"../chunks/button.D_2SonNs.js";import{Tooltip as C,TooltipTrigger as j,TooltipContent as R}from"../components/ui/tooltip.js";import{Popover as I,PopoverTrigger as L,PopoverContent as z}from"../components/ui/popover.js";import{DropdownMenu as B,DropdownMenuTrigger as D,DropdownMenuContent as O,DropdownMenuItem as P}from"../components/ui/dropdown-menu.js";import{ButtonGroup as T}from"../components/ui/button-group.js";import{c as F}from"../chunks/utils.C6Qu-kwd.js";import{S as $}from"../chunks/status-badge.BLB0pWDn.js";function _({fetchDiffForItem:e}){const{selectedItem:t,setLoadedDiffDoc:a,setLoadingDiff:s}=o(),l=n(async(t,n)=>{s(!0),a(null);try{const r=await e(t);if(n.aborted)return;a(r)}catch(r){if(n.aborted)return;console.error("Failed to fetch diff:",r),a(null)}finally{n.aborted||s(!1)}},[e,a,s]),i=t?.id;return r(()=>{if(!i)return a(null),void s(!1);const e=new AbortController;return l(i,e.signal),()=>{e.abort()}},[i,l]),null}const q="Why is Brainfish suggesting this?",M=e.forwardRef(function({title:t,isNew:n,suggestionsCount:r,sourceIcon:a,sourceDescription:s,currentArticleIndex:l,totalArticles:o,displayTotalArticles:c,showActionButtons:m=!0,onNextArticle:d,onPreviousArticle:b,onRejectAllSuggestions:E,onAcceptAllSuggestions:A,onAcceptAndPublish:x,breadcrumb:v,onOpenArticleLink:N,onSourceLinkClick:k,suggestionReasonBody:S,className:_,...M},W){const G=e.useRef(null),[K,H]=e.useState(!1),J=o>0&&l<o-1,Q=l>0,U=0===o?0:l+1,V=c??o,X=V>0;let Y;return n?Y=/* @__PURE__ */e.createElement($,{variant:"success"},"New"):r&&(Y=/* @__PURE__ */e.createElement(i,{count:r})),/* @__PURE__ */e.createElement("div",{ref:W,className:F("flex flex-col gap-4",_),...M},/* @__PURE__ */e.createElement("div",{className:"flex justify-between items-center"},/* @__PURE__ */e.createElement("h1",{className:"heading-lg"},t,N&&v&&/* @__PURE__ */e.createElement(w,{variant:"link",size:"sm",onClick:N,"aria-label":"Open article",className:"block px-0 text-subtle text-xs"},v)),/* @__PURE__ */e.createElement("div",{className:"flex items-center"},/* @__PURE__ */e.createElement("p",{className:"text-xs text-foreground"},/* @__PURE__ */e.createElement("span",{"aria-hidden":"true"},X?`${U}/${V}`:"0"),/* @__PURE__ */e.createElement("span",{className:"sr-only","aria-live":"polite"},X?`Article ${U} of ${V}`:"No articles")),/* @__PURE__ */e.createElement(C,null,/* @__PURE__ */e.createElement(j,{asChild:!0},/* @__PURE__ */e.createElement(w,{variant:"ghost",size:"icon",disabled:!J,onClick:d,"aria-label":"Go to next article"},
2
- /* @__PURE__ */e.createElement(u,{"aria-hidden":"true"}))),/* @__PURE__ */e.createElement(R,{side:"bottom",bgColor:"--bfc-foreground",className:"text-background"},"Next Article")),/* @__PURE__ */e.createElement(C,null,/* @__PURE__ */e.createElement(j,{asChild:!0},/* @__PURE__ */e.createElement(w,{variant:"ghost",size:"icon",disabled:!Q,onClick:b,"aria-label":"Go to previous article"},
3
- /* @__PURE__ */e.createElement(f,{"aria-hidden":"true"}))),/* @__PURE__ */e.createElement(R,{side:"top",bgColor:"--bfc-foreground",className:"text-background"},"Previous Article")))),/* @__PURE__ */e.createElement("div",{className:"flex-1 px-2 pb-2 flex justify-between items-center"},/* @__PURE__ */e.createElement("div",{className:"flex items-center gap-2"},Y,s&&(k?/* @__PURE__ */e.createElement(w,{variant:"link",onClick:k,"aria-label":"Open source",className:"[&_svg]:size-4 text-xs text-subtle gap-1"},a&&/* @__PURE__ */e.createElement("span",{className:"shrink-0 flex items-center"},a),
4
- /* @__PURE__ */e.createElement("span",null,s)):/* @__PURE__ */e.createElement("span",{className:"[&_svg]:size-4 flex items-center gap-1 text-xs text-subtle"},a&&/* @__PURE__ */e.createElement("span",{className:"shrink-0 flex items-center"},a),s))),m&&/* @__PURE__ */e.createElement(T,{orientation:"horizontal",rounded:!1,"aria-label":"Suggestion actions",className:"gap-1"},S&&/* @__PURE__ */e.createElement(I,{open:K,onOpenChange:H},/* @__PURE__ */e.createElement(L,{asChild:!0},/* @__PURE__ */e.createElement(w,{variant:"ghost","aria-label":q},/* @__PURE__ */e.createElement(g,{"aria-hidden":"true"}),"Why")),/* @__PURE__ */e.createElement(z,{align:"start",side:"bottom",className:"z-above-modal shadow-md dark:shadow-md-invert border-dark-300"},
5
- /* @__PURE__ */e.createElement("div",{className:"font-bold text-sm"},q),
6
- /* @__PURE__ */e.createElement("div",{className:"text-sm text-subtle mt-1"},S))),/* @__PURE__ */e.createElement(w,{variant:"ghost",onClick:E},/* @__PURE__ */e.createElement(p,{"aria-hidden":"true"}),"Reject"),x?/* @__PURE__ */e.createElement(B,null,/* @__PURE__ */e.createElement("div",{ref:G,className:F("flex items-center rounded border border-border bg-primary",y)},
7
- /* @__PURE__ */e.createElement(w,{variant:"default",elevation:"shadow",className:"gap-1 rounded-none border-0 bg-transparent shadow-none",onClick:A},
8
- /* @__PURE__ */e.createElement(h,{"aria-hidden":"true"}),"Accept as draft"),
9
- /* @__PURE__ */e.createElement("span",{className:"h-full w-px self-stretch bg-foreground","aria-hidden":"true"}),
10
- /* @__PURE__ */e.createElement(D,{asChild:!0},/* @__PURE__ */e.createElement(w,{variant:"default",size:"icon",className:"size-9 rounded-none border-0 bg-transparent shadow-none","aria-label":"More accept options"},
11
- /* @__PURE__ */e.createElement(u,{className:"size-4","aria-hidden":"true"})))),/* @__PURE__ */e.createElement(O,{align:"end",className:"z-above-modal border-none shadow-md dark:shadow-md-invert mt-1"},
12
- /* @__PURE__ */e.createElement(P,{onClick:x},/* @__PURE__ */e.createElement(h,{"aria-hidden":"true"}),"Accept & publish"))):/* @__PURE__ */e.createElement(w,{variant:"default",elevation:"shadow",onClick:A},/* @__PURE__ */e.createElement(h,{"aria-hidden":"true"}),"Accept as draft"))))});function W(e){const t=e.querySelectorAll("del + ins"),n=e.querySelectorAll("ins:not(del + ins)"),r=e.querySelectorAll("del"),a=Array.from(r).filter(e=>"INS"!==e.nextElementSibling?.tagName);return t.length+n.length+a.length}function G({diffTitle:e,items:l,isLoading:i,totalItemsCount:c,showActionButtons:m=!0,children:u,sourceIcon:f,sourceDescription:g}){const{selectedItem:p,setSelectedItem:h,loadedDiffDoc:w,loadingDiff:S,onApproveAllSuggestions:y,onRejectAllSuggestions:C,onAcceptAndPublish:j,onOpenArticleLink:R,onSourceLinkClick:I,breadcrumb:L,suggestionReasonBody:z}=o(),B=l.length>0,D=i??!B,O=D&&!B,P=!D&&!B,T=S?"":d(w?.diffTitle??e??""),F=S?/* @__PURE__ */t.createElement("div",{className:"text-muted-foreground"},"Loading diff…"):w?.diffContent,$=S?0:(_=w?.diffTitle??e)&&"undefined"!=typeof DOMParser?W((new DOMParser).parseFromString(_,"text/html")):0;var _;const q=a(null),[G,K]=s(0);r(()=>{if(S||!w)return void K(0);const e=q.current;if(!e)return;const t=requestAnimationFrame(()=>{var t;K((t=e)?W(t):0)});return()=>cancelAnimationFrame(t)},[S,w]);const H=$+G,J=l.length,Q=c??J,U=p?Math.max(0,l.findIndex(e=>e.id===p.id)):0,V=n(()=>{U<J-1&&h(l[U+1]??null)},[U,l,h,J]),X=n(()=>{U>0&&h(l[U-1]??null)},[U,l,h]),Y=p?.icon??f,Z=p?.description??g;/* @__PURE__ */
13
- return t.createElement(E,{className:"py-6 pl-4","data-name":"knowledge-reviews"},/* @__PURE__ */t.createElement(N,{className:"h-[calc(var(--knowledge-review-scroll-height)-50px)] pr-8"},/* @__PURE__ */t.createElement(A,{className:"p-0"},B&&/* @__PURE__ */t.createElement(x,{className:"border-b border-dark-300 mb-6 pb-2 font-normal"},/* @__PURE__ */t.createElement(M,{title:T,isNew:w?.isNew??!1,suggestionsCount:H,sourceIcon:Y,sourceDescription:Z,currentArticleIndex:U,totalArticles:J,displayTotalArticles:Q,showActionButtons:m,onNextArticle:V,onPreviousArticle:X,onRejectAllSuggestions:C,onAcceptAllSuggestions:y,onAcceptAndPublish:j,onOpenArticleLink:R,onSourceLinkClick:I,breadcrumb:L,suggestionReasonBody:z}))),/* @__PURE__ */t.createElement(v,{className:"p-0 [&_ol]:!pl-16 [&_ul]:!pl-16"},/* @__PURE__ */t.createElement("div",{"aria-hidden":"true",className:"sr-only",hidden:!0},u),O?/* @__PURE__ */t.createElement("div",{className:"flex flex-col items-center justify-center gap-4 text-center h-[50dvh] text-muted-foreground"},/* @__PURE__ */t.createElement(k,{className:"size-8"}),/* @__PURE__ */t.createElement("p",{className:"text-base font-medium"},"Loading suggestions...")):P?/* @__PURE__ */t.createElement("div",{className:"flex flex-col items-center justify-center gap-4 text-center h-[50dvh]"},/* @__PURE__ */t.createElement(b,{className:"text-muted-foreground",size:32,weight:"fill"}),/* @__PURE__ */t.createElement("p",{className:"text-base font-medium text-foreground"},"All up to date. Well done, mate.")):/* @__PURE__ */t.createElement("div",{ref:q,className:"pl-12"},F))))}const K="--knowledge-review-scroll-height",H=t.forwardRef(function({diffTitle:e="Knowledge Review",children:n,items:s,isLoading:i,totalItemsCount:c,showActionButtons:d=!0,className:u,onApproveAllSuggestions:f,onRejectAllSuggestions:g,onOpenArticleLink:p,onAcceptAndPublish:h,onSourceLinkClick:b,breadcrumb:A,sourceIcon:x,sourceDescription:w,suggestionReasonBody:S,...y},C){const j=a(null),{selectedItem:R,setSelectedItem:I}=o();l(C,()=>({selectedItem:R,setSelectedItem:I}),[R,I]),r(()=>{const e=j.current;if(!e)return;const t=()=>{const{height:t}=e.getBoundingClientRect();e.style.setProperty(K,`${t}px`)};if(t(),"function"!=typeof ResizeObserver)return;const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);const L=i??0===s.length,z=L&&0===s.length;/* @__PURE__ */
14
- return t.createElement(E,{className:F("h-full",u)},/* @__PURE__ */t.createElement(v,{className:"p-4 lg:p-8 h-full"},/* @__PURE__ */t.createElement("div",{ref:j,className:"grid xs:max-lg:grid-cols-1 lg:grid-cols-[1fr_4fr] gap-6 min-h-96 h-full",style:{[K]:"100px"},...y},
15
- /* @__PURE__ */t.createElement(N,{className:"h-[calc(var(--knowledge-review-scroll-height))] min-w-80 lg:block hidden"},z?/* @__PURE__ */t.createElement("div",{className:"flex h-full min-h-96 items-center justify-center text-muted-foreground"},/* @__PURE__ */t.createElement(k,{className:"size-6"})):/* @__PURE__ */t.createElement(m,{items:s})),
16
- /* @__PURE__ */t.createElement(G,{diffTitle:e,items:s,isLoading:L,totalItemsCount:c,showActionButtons:d,sourceIcon:x,sourceDescription:w},n))))}),J=t.forwardRef(function(e,n){const{items:r,onApproveAllSuggestions:a,onRejectAllSuggestions:s,onAcceptAndPublish:l,onOpenArticleLink:o,onSourceLinkClick:i,breadcrumb:m,suggestionReasonBody:d}=e;/* @__PURE__ */
17
- return t.createElement(c,{defaultSelectedItem:r.find(e=>e.isSelected)??null,onApproveAllSuggestions:a,onRejectAllSuggestions:s,onAcceptAndPublish:l,onOpenArticleLink:o,onSourceLinkClick:i,breadcrumb:m,suggestionReasonBody:d},
18
- /* @__PURE__ */t.createElement(H,{...e,ref:n}))});export{_ as KnowledgeReviewDiffLoader,G as KnowledgeReviewPanel,J as KnowledgeReviewScene,c as ReviewsSelectionProvider,o as useReviewsSelection};
1
+ import*as e from"react";import t,{useCallback as n,useEffect as l,useRef as r,useState as a,useImperativeHandle as s}from"react";import{u as o,E as c,b as i,R as m}from"../chunks/suggestion-card.DAwWcW7V.js";import '../knowledge-review.css';export{S as SuggestionCard}from"../chunks/suggestion-card.DAwWcW7V.js";import d from"html-react-parser";import{CaretDown as u,CaretUp as p,Lightbulb as f,Backspace as g,CheckCircle as h,Globe as A,LockKey as b,HandsClapping as E}from"@phosphor-icons/react";import{Card as x,CardHeader as N,CardTitle as v,CardContent as k}from"../components/ui/card.js";import{ScrollArea as w}from"../components/ui/scroll-area.js";import{Spinner as y}from"../components/ui/spinner.js";import{B as C,a as I}from"../chunks/button.D_2SonNs.js";import{Tooltip as j,TooltipTrigger as P,TooltipContent as R}from"../components/ui/tooltip.js";import{Popover as L,PopoverTrigger as z,PopoverContent as B}from"../components/ui/popover.js";import{DropdownMenu as D,DropdownMenuTrigger as O,DropdownMenuContent as T,DropdownMenuItem as F}from"../components/ui/dropdown-menu.js";import{ButtonGroup as $}from"../components/ui/button-group.js";import{c as _}from"../chunks/utils.C6Qu-kwd.js";import{S as q}from"../chunks/status-badge.BLB0pWDn.js";function M({fetchDiffForItem:e}){const{selectedItem:t,setLoadedDiffDoc:r,setLoadingDiff:a}=o(),s=n(async(t,n)=>{a(!0),r(null);try{const l=await e(t);if(n.aborted)return;r(l)}catch(l){if(n.aborted)return;console.error("Failed to fetch diff:",l),r(null)}finally{n.aborted||a(!1)}},[e,r,a]),c=t?.id;return l(()=>{if(!c)return r(null),void a(!1);const e=new AbortController;return s(c,e.signal),()=>{e.abort()}},[c,s]),null}function W({title:t,breadcrumb:n,onOpenArticleLink:l,currentArticleIndex:r,totalArticles:a,displayTotalArticles:s,onNextArticle:o,onPreviousArticle:c}){const i=a>0&&r<a-1,m=r>0,d=0===a?0:r+1,f=s??a,g=f>0;/* @__PURE__ */
2
+ return e.createElement("div",{className:"flex justify-between items-center"},/* @__PURE__ */e.createElement("h1",{className:"heading-lg"},t,l&&n&&/* @__PURE__ */e.createElement(C,{variant:"link",size:"sm",onClick:l,"aria-label":"Open article",className:"block px-0 text-subtle text-xs"},n)),/* @__PURE__ */e.createElement("div",{className:"flex items-center"},/* @__PURE__ */e.createElement("p",{className:"text-xs text-foreground pr-2"},/* @__PURE__ */e.createElement("span",{"aria-hidden":"true"},g?`${d}/${f}`:"0"),/* @__PURE__ */e.createElement("span",{className:"sr-only","aria-live":"polite"},g?`Article ${d} of ${f}`:"No articles")),/* @__PURE__ */e.createElement(j,null,/* @__PURE__ */e.createElement(P,{asChild:!0},/* @__PURE__ */e.createElement(C,{variant:"ghost",size:"icon",disabled:!i,onClick:o,"aria-label":"Go to next article"},
3
+ /* @__PURE__ */e.createElement(u,{"aria-hidden":"true"}))),/* @__PURE__ */e.createElement(R,{side:"bottom",bgColor:"--bfc-foreground",className:"text-background"},"Next Article")),/* @__PURE__ */e.createElement(j,null,/* @__PURE__ */e.createElement(P,{asChild:!0},/* @__PURE__ */e.createElement(C,{variant:"ghost",size:"icon",disabled:!m,onClick:c,"aria-label":"Go to previous article"},
4
+ /* @__PURE__ */e.createElement(p,{"aria-hidden":"true"}))),/* @__PURE__ */e.createElement(R,{side:"top",bgColor:"--bfc-foreground",className:"text-background"},"Previous Article"))))}function G({isNew:t,suggestionsCount:n,sourceIcon:l,sourceDescription:r,onSourceLinkClick:a,showActionButtons:s=!0,suggestionReasonBody:o,hideAcceptAndPublishPublic:i=!1,onAcceptAndPublish:m,onRejectAll:d,onAcceptAll:p,onAcceptAndPublishAction:E}){const[x,N]=e.useState(!1);let v;return t?v=/* @__PURE__ */e.createElement(q,{variant:"success"},"New"):n&&(v=/* @__PURE__ */e.createElement(c,{count:n})),/* @__PURE__ */e.createElement("div",{className:"flex-1 px-2 pb-2 flex justify-between items-center"},/* @__PURE__ */e.createElement("div",{className:"flex items-center gap-2"},v,r&&(a?/* @__PURE__ */e.createElement(C,{variant:"link",onClick:a,"aria-label":"Open source",className:"[&_svg]:size-4 text-xs text-subtle gap-1"},l&&/* @__PURE__ */e.createElement("span",{className:"shrink-0 flex items-center"},l),
5
+ /* @__PURE__ */e.createElement("span",null,r)):/* @__PURE__ */e.createElement("span",{className:"[&_svg]:size-4 flex items-center gap-1 text-xs text-subtle"},l&&/* @__PURE__ */e.createElement("span",{className:"shrink-0 flex items-center"},l),r))),s&&/* @__PURE__ */e.createElement($,{orientation:"horizontal",rounded:!1,"aria-label":"Suggestion actions",className:"gap-1"},o&&/* @__PURE__ */e.createElement(L,{open:x,onOpenChange:N},/* @__PURE__ */e.createElement(z,{asChild:!0},/* @__PURE__ */e.createElement(C,{variant:"ghost","aria-label":K},/* @__PURE__ */e.createElement(f,{"aria-hidden":"true"}),"Why")),/* @__PURE__ */e.createElement(B,{align:"start",side:"bottom",className:"z-above-modal shadow-md dark:shadow-md-invert border-dark-300"},
6
+ /* @__PURE__ */e.createElement("div",{className:"font-bold text-sm"},K),
7
+ /* @__PURE__ */e.createElement("div",{className:"text-sm text-subtle mt-1"},o))),/* @__PURE__ */e.createElement(C,{variant:"ghost",onClick:()=>{d()}},/* @__PURE__ */e.createElement(g,{"aria-hidden":"true"}),t?"Reject":"Reject all"),m?/* @__PURE__ */e.createElement(D,null,/* @__PURE__ */e.createElement("div",{className:_("flex items-center rounded border border-border bg-primary",I)},/* @__PURE__ */e.createElement(C,{variant:"default",elevation:"shadow",className:"gap-1 rounded-none border-0 bg-transparent shadow-none",onClick:()=>{p()}},
8
+ /* @__PURE__ */e.createElement(h,{"aria-hidden":"true"}),t?"Accept as draft":"Accept all as draft"),/* @__PURE__ */e.createElement("span",{className:"h-full w-px self-stretch bg-foreground","aria-hidden":"true"}),/* @__PURE__ */e.createElement(O,{asChild:!0},/* @__PURE__ */e.createElement(C,{variant:"default",size:"icon",className:"size-9 rounded-none border-0 bg-transparent shadow-none","aria-label":"More accept options"},
9
+ /* @__PURE__ */e.createElement(u,{className:"size-4","aria-hidden":"true"})))),/* @__PURE__ */e.createElement(T,{align:"end",className:"z-above-modal border-none shadow-md dark:shadow-md-invert mt-1 "},!i&&/* @__PURE__ */e.createElement(F,{className:"p-3",onClick:()=>{E("public")}},/* @__PURE__ */e.createElement(A,{"aria-hidden":"true"}),t?"Accept & publish publicly":"Accept all & publish publicly"),
10
+ /* @__PURE__ */e.createElement(F,{className:"p-3",onClick:()=>{E("internal")}},/* @__PURE__ */e.createElement(b,{"aria-hidden":"true"}),t?"Accept & publish internally":"Accept all & publish internally"))):/* @__PURE__ */e.createElement(C,{variant:"default",elevation:"shadow",onClick:()=>{p()}},/* @__PURE__ */e.createElement(h,{"aria-hidden":"true"}),t?"Accept as draft":"Accept all as draft")))}const K="Why is Brainfish suggesting this?",H=e.forwardRef(function({title:t,isNew:n,suggestionsCount:l,sourceIcon:r,sourceDescription:a,currentArticleIndex:s,totalArticles:c,displayTotalArticles:i,showActionButtons:m=!0,onNextArticle:d,onPreviousArticle:u,className:p,...f},g){const{onApproveAllSuggestions:h,onRejectAllSuggestions:A,onAcceptAndPublish:b,onApplyAllInEditor:E,onRejectAllInEditor:x,onOpenArticleLink:N,onSourceLinkClick:v,breadcrumb:k,suggestionReasonBody:w,hideAcceptAndPublishPublic:y=!1}=o(),C=e.useCallback(async()=>{x&&await x(),A()},[x,A]),I=e.useCallback(async()=>{E&&await E(),h()},[E,h]),S=e.useCallback(async e=>{b&&(E&&await E(),b(e))},[E,b]);/* @__PURE__ */
11
+ return e.createElement("div",{ref:g,className:_("flex flex-col gap-4",p),...f},/* @__PURE__ */e.createElement(W,{title:t,breadcrumb:k,onOpenArticleLink:N,currentArticleIndex:s,totalArticles:c,displayTotalArticles:i,onNextArticle:d,onPreviousArticle:u}),/* @__PURE__ */e.createElement(G,{isNew:n,suggestionsCount:l,sourceIcon:r,sourceDescription:a,onSourceLinkClick:v,showActionButtons:m,suggestionReasonBody:w,hideAcceptAndPublishPublic:y,onAcceptAndPublish:b,onRejectAll:C,onAcceptAll:I,onAcceptAndPublishAction:S}))});function J(e){const t=e.querySelectorAll("del + ins"),n=e.querySelectorAll("ins:not(del + ins)"),l=e.querySelectorAll("del"),r=Array.from(l).filter(e=>"INS"!==e.nextElementSibling?.tagName);return t.length+n.length+r.length}function Q({diffTitle:e,items:s,isLoading:c,totalItemsCount:i,showActionButtons:m=!0,children:u,sourceIcon:p,sourceDescription:f}){const{selectedItem:g,setSelectedItem:h,loadedDiffDoc:A,loadingDiff:b}=o(),C=s.length>0,I=c??!C,S=I&&!C,j=!I&&!C,P=b?"":d(A?.diffTitle??e??""),R=b?/* @__PURE__ */t.createElement("div",{className:"text-muted-foreground"},"Loading diff…"):A?.diffContent,L=b?0:(z=A?.diffTitle??e)&&"undefined"!=typeof DOMParser?J((new DOMParser).parseFromString(z,"text/html")):0;var z;const B=r(null),[D,O]=a(0);l(()=>{if(b||!A)return void O(0);const e=B.current;if(!e)return;const t=requestAnimationFrame(()=>{var t;O((t=e)?J(t):0)});return()=>cancelAnimationFrame(t)},[b,A]);const T=L+D,F=s.length,$=i??F,_=g?Math.max(0,s.findIndex(e=>e.id===g.id)):0,q=n(()=>{_<F-1&&h(s[_+1]??null)},[_,s,h,F]),M=n(()=>{_>0&&h(s[_-1]??null)},[_,s,h]),W=g?.icon??p,G=g?.description??f;/* @__PURE__ */
12
+ return t.createElement(x,{className:"py-6 pl-4","data-name":"knowledge-reviews"},/* @__PURE__ */t.createElement(w,{className:"h-[calc(var(--knowledge-review-scroll-height)-50px)] pr-8"},/* @__PURE__ */t.createElement(N,{className:"p-0"},C&&/* @__PURE__ */t.createElement(v,{className:"border-b border-dark-300 mb-6 pb-2 font-normal"},/* @__PURE__ */t.createElement(H,{title:P,isNew:A?.isNew??!1,suggestionsCount:T,sourceIcon:W,sourceDescription:G,currentArticleIndex:_,totalArticles:F,displayTotalArticles:$,showActionButtons:m,onNextArticle:q,onPreviousArticle:M}))),/* @__PURE__ */t.createElement(k,{className:"p-0 [&_ol]:!pl-16 [&_ul]:!pl-16"},/* @__PURE__ */t.createElement("div",{"aria-hidden":"true",className:"sr-only",hidden:!0},u),S?/* @__PURE__ */t.createElement("div",{className:"flex flex-col items-center justify-center gap-4 text-center h-[50dvh] text-muted-foreground"},/* @__PURE__ */t.createElement(y,{className:"size-8"}),/* @__PURE__ */t.createElement("p",{className:"text-base font-medium"},"Loading suggestions...")):j?/* @__PURE__ */t.createElement("div",{className:"flex flex-col items-center justify-center gap-4 text-center h-[50dvh]"},/* @__PURE__ */t.createElement(E,{className:"text-muted-foreground",size:32,weight:"fill"}),/* @__PURE__ */t.createElement("p",{className:"text-base font-medium text-foreground"},"All up to date. Well done, mate.")):/* @__PURE__ */t.createElement("div",{ref:B,className:"pl-12"},R))))}const U="--knowledge-review-scroll-height",V=t.forwardRef(function({diffTitle:e="Knowledge Review",children:n,items:a,isLoading:c,totalItemsCount:i,showActionButtons:d=!0,className:u,onApproveAllSuggestions:p,onRejectAllSuggestions:f,onOpenArticleLink:g,onAcceptAndPublish:h,onApplyAllInEditor:A,onRejectAllInEditor:b,onSourceLinkClick:E,breadcrumb:N,sourceIcon:v,sourceDescription:C,suggestionReasonBody:I,hideAcceptAndPublishPublic:S,...j},P){const R=r(null),{selectedItem:L,setSelectedItem:z}=o();s(P,()=>({selectedItem:L,setSelectedItem:z}),[L,z]),l(()=>{const e=R.current;if(!e)return;const t=()=>{const{height:t}=e.getBoundingClientRect();e.style.setProperty(U,`${t}px`)};if(t(),"function"!=typeof ResizeObserver)return;const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);const B=c??0===a.length,D=B&&0===a.length;/* @__PURE__ */
13
+ return t.createElement(x,{className:_("h-full",u)},/* @__PURE__ */t.createElement(k,{className:"p-4 lg:p-8 h-full"},/* @__PURE__ */t.createElement("div",{ref:R,className:"grid xs:max-lg:grid-cols-1 lg:grid-cols-[1fr_4fr] gap-6 min-h-96 h-full",style:{[U]:"100px"},...j},
14
+ /* @__PURE__ */t.createElement(w,{className:"h-[calc(var(--knowledge-review-scroll-height))] min-w-80 lg:block hidden"},D?/* @__PURE__ */t.createElement("div",{className:"flex h-full min-h-96 items-center justify-center text-muted-foreground"},/* @__PURE__ */t.createElement(y,{className:"size-6"})):/* @__PURE__ */t.createElement(m,{items:a})),
15
+ /* @__PURE__ */t.createElement(Q,{diffTitle:e,items:a,isLoading:B,totalItemsCount:i,showActionButtons:d,sourceIcon:v,sourceDescription:C},n))))}),X=t.forwardRef(function(e,n){const{items:l,onApproveAllSuggestions:r,onRejectAllSuggestions:a,onAcceptAndPublish:s,onApplyAllInEditor:o,onRejectAllInEditor:c,onOpenArticleLink:m,onSourceLinkClick:d,breadcrumb:u,suggestionReasonBody:p,hideAcceptAndPublishPublic:f}=e;/* @__PURE__ */
16
+ return t.createElement(i,{defaultSelectedItem:l.find(e=>e.isSelected)??null,onApproveAllSuggestions:r,onRejectAllSuggestions:a,onAcceptAndPublish:s,onApplyAllInEditor:o,onRejectAllInEditor:c,onOpenArticleLink:m,onSourceLinkClick:d,breadcrumb:u,suggestionReasonBody:p,hideAcceptAndPublishPublic:f},
17
+ /* @__PURE__ */t.createElement(V,{...e,ref:n}))});export{M as KnowledgeReviewDiffLoader,Q as KnowledgeReviewPanel,X as KnowledgeReviewScene,i as ReviewsSelectionProvider,o as useReviewsSelection};
19
18
  //# sourceMappingURL=knowledge-review.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"knowledge-review.js","sources":["../../../src/scenes/knowledge-review/diff-loader.tsx","../../../src/scenes/knowledge-review/suggestions-header/suggestions-header.tsx","../../../src/lib/countSuggestions.ts","../../../src/scenes/knowledge-review/knowledge-review-panel.tsx","../../../src/scenes/knowledge-review/scene.tsx"],"sourcesContent":["import { useCallback, useEffect } from 'react';\n\nimport type { LoadedDiffDoc } from './context';\nimport { useReviewsSelection } from './context';\n\nexport type KnowledgeReviewDiffLoaderProps = {\n /** Called when selectedItem changes. Return diff payload or null. */\n fetchDiffForItem: (itemId: string) => Promise<LoadedDiffDoc | null>;\n};\n\n/**\n * Listens to selectedItem from context and fetches diff via the provided callback.\n * Owns loading state and context updates; host (Storybook or Platform) supplies fetch logic.\n */\nexport function KnowledgeReviewDiffLoader({ fetchDiffForItem }: KnowledgeReviewDiffLoaderProps) {\n const { selectedItem, setLoadedDiffDoc, setLoadingDiff } = useReviewsSelection();\n\n const loadDiffForItem = useCallback(\n async (itemId: string, signal: AbortSignal) => {\n setLoadingDiff(true);\n setLoadedDiffDoc(null);\n\n try {\n const doc = await fetchDiffForItem(itemId);\n if (signal.aborted) return;\n setLoadedDiffDoc(doc);\n } catch (error) {\n if (signal.aborted) return;\n console.error('Failed to fetch diff:', error);\n setLoadedDiffDoc(null);\n } finally {\n if (!signal.aborted) {\n setLoadingDiff(false);\n }\n }\n },\n [fetchDiffForItem, setLoadedDiffDoc, setLoadingDiff],\n );\n\n const selectedId = selectedItem?.id;\n\n useEffect(() => {\n if (!selectedId) {\n setLoadedDiffDoc(null);\n setLoadingDiff(false);\n\n return;\n }\n\n const abortController = new AbortController();\n void loadDiffForItem(selectedId, abortController.signal);\n\n return () => {\n abortController.abort();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selectedId, loadDiffForItem]);\n\n return null;\n}\n","import { CaretDown, CaretUp, Backspace, CheckCircle, Lightbulb } from '@phosphor-icons/react';\nimport * as React from 'react';\n\nimport { EditCount } from '../review-list/edit-count';\n\nimport { Button } from '@/components/ui/button';\nimport { brandShadowEffect } from '@/lib/styles';\nimport { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';\nimport { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\nimport { ButtonGroup } from '@/components/ui/button-group';\nimport { cn } from '@/lib/utils';\nimport { StatusBadge } from '@/components/convos/status-badge';\n\nexport interface SuggestionsHeaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n title: React.ReactNode;\n isNew: boolean;\n suggestionsCount: number;\n sourceIcon: React.ReactNode;\n sourceDescription: string | null;\n currentArticleIndex: number;\n totalArticles: number;\n displayTotalArticles?: number;\n showActionButtons?: boolean;\n onNextArticle: () => void;\n onPreviousArticle: () => void;\n onRejectAllSuggestions: () => void;\n onAcceptAllSuggestions: () => void;\n onAcceptAndPublish?: () => void;\n breadcrumb?: string;\n onOpenArticleLink?: () => void;\n onSourceLinkClick?: () => void;\n suggestionReasonBody?: string;\n}\n\nexport const REASON_TITLE = 'Why is Brainfish suggesting this?';\n\nexport const SuggestionsHeader = React.forwardRef<HTMLDivElement, SuggestionsHeaderProps>(function SuggestionsHeader(\n {\n title,\n isNew,\n suggestionsCount,\n sourceIcon,\n sourceDescription,\n currentArticleIndex,\n totalArticles,\n displayTotalArticles,\n showActionButtons = true,\n onNextArticle,\n onPreviousArticle,\n onRejectAllSuggestions,\n onAcceptAllSuggestions,\n onAcceptAndPublish,\n breadcrumb,\n onOpenArticleLink,\n onSourceLinkClick,\n suggestionReasonBody,\n className,\n ...props\n },\n ref,\n) {\n const splitButtonRef = React.useRef<HTMLDivElement>(null);\n const [whyOpen, setWhyOpen] = React.useState(false);\n const hasNextArticle = totalArticles > 0 && currentArticleIndex < totalArticles - 1;\n const hasPreviousArticle = currentArticleIndex > 0;\n const currentArticle = totalArticles === 0 ? 0 : currentArticleIndex + 1;\n const totalArticlesForDisplay = displayTotalArticles ?? totalArticles;\n const hasDisplayArticles = totalArticlesForDisplay > 0;\n\n let status: React.ReactNode | undefined;\n if (isNew) {\n status = <StatusBadge variant=\"success\">New</StatusBadge>;\n } else if (suggestionsCount) {\n status = <EditCount count={suggestionsCount} />;\n }\n\n return (\n <div ref={ref} className={cn('flex flex-col gap-4', className)} {...props}>\n {/* Header + Navigation */}\n <div className=\"flex justify-between items-center\">\n <h1 className=\"heading-lg\">\n {title}\n {/* Breadcrumbs */}\n {onOpenArticleLink && breadcrumb && (\n <Button\n variant=\"link\"\n size=\"sm\"\n onClick={onOpenArticleLink}\n aria-label=\"Open article\"\n className=\"block px-0 text-subtle text-xs\"\n >\n {breadcrumb}\n </Button>\n )}\n </h1>\n {/* up/down carets */}\n <div className=\"flex items-center\">\n <p className=\"text-xs text-foreground\">\n <span aria-hidden=\"true\">{hasDisplayArticles ? `${currentArticle}/${totalArticlesForDisplay}` : '0'}</span>\n <span className=\"sr-only\" aria-live=\"polite\">\n {hasDisplayArticles ? `Article ${currentArticle} of ${totalArticlesForDisplay}` : 'No articles'}\n </span>\n </p>\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n disabled={!hasNextArticle}\n onClick={onNextArticle}\n aria-label=\"Go to next article\"\n >\n <CaretDown aria-hidden=\"true\" />\n </Button>\n </TooltipTrigger>\n <TooltipContent side=\"bottom\" bgColor=\"--bfc-foreground\" className=\"text-background\">\n Next Article\n </TooltipContent>\n </Tooltip>\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n disabled={!hasPreviousArticle}\n onClick={onPreviousArticle}\n aria-label=\"Go to previous article\"\n >\n <CaretUp aria-hidden=\"true\" />\n </Button>\n </TooltipTrigger>\n <TooltipContent side=\"top\" bgColor=\"--bfc-foreground\" className=\"text-background\">\n Previous Article\n </TooltipContent>\n </Tooltip>\n </div>\n </div>\n\n {/* Status, Source + Actions */}\n <div className=\"flex-1 px-2 pb-2 flex justify-between items-center\">\n <div className=\"flex items-center gap-2\">\n {status}\n {sourceDescription &&\n (onSourceLinkClick ? (\n <Button\n variant=\"link\"\n onClick={onSourceLinkClick}\n aria-label=\"Open source\"\n className=\"[&_svg]:size-4 text-xs text-subtle gap-1\"\n >\n {sourceIcon && <span className=\"shrink-0 flex items-center\">{sourceIcon}</span>}\n <span>{sourceDescription}</span>\n </Button>\n ) : (\n <span className=\"[&_svg]:size-4 flex items-center gap-1 text-xs text-subtle\">\n {sourceIcon && <span className=\"shrink-0 flex items-center\">{sourceIcon}</span>}\n {sourceDescription}\n </span>\n ))}\n </div>\n {showActionButtons && (\n <ButtonGroup orientation=\"horizontal\" rounded={false} aria-label=\"Suggestion actions\" className=\"gap-1\">\n {suggestionReasonBody && (\n <Popover open={whyOpen} onOpenChange={setWhyOpen}>\n <PopoverTrigger asChild>\n <Button variant=\"ghost\" aria-label={REASON_TITLE}>\n <Lightbulb aria-hidden=\"true\" />\n Why\n </Button>\n </PopoverTrigger>\n <PopoverContent\n align=\"start\"\n side=\"bottom\"\n className=\"z-above-modal shadow-md dark:shadow-md-invert border-dark-300\"\n >\n <div className=\"font-bold text-sm\">{REASON_TITLE}</div>\n <div className=\"text-sm text-subtle mt-1\">{suggestionReasonBody}</div>\n </PopoverContent>\n </Popover>\n )}\n <Button variant=\"ghost\" onClick={onRejectAllSuggestions}>\n <Backspace aria-hidden=\"true\" />\n Reject\n </Button>\n {onAcceptAndPublish ? (\n <DropdownMenu>\n <div\n ref={splitButtonRef}\n className={cn('flex items-center rounded border border-border bg-primary', brandShadowEffect)}\n >\n <Button\n variant=\"default\"\n elevation=\"shadow\"\n className=\"gap-1 rounded-none border-0 bg-transparent shadow-none\"\n onClick={onAcceptAllSuggestions}\n >\n <CheckCircle aria-hidden=\"true\" />\n Accept as draft\n </Button>\n <span className=\"h-full w-px self-stretch bg-foreground\" aria-hidden=\"true\" />\n <DropdownMenuTrigger asChild>\n <Button\n variant=\"default\"\n size=\"icon\"\n className=\"size-9 rounded-none border-0 bg-transparent shadow-none\"\n aria-label=\"More accept options\"\n >\n <CaretDown className=\"size-4\" aria-hidden=\"true\" />\n </Button>\n </DropdownMenuTrigger>\n </div>\n <DropdownMenuContent\n align=\"end\"\n className=\"z-above-modal border-none shadow-md dark:shadow-md-invert mt-1\"\n >\n <DropdownMenuItem onClick={onAcceptAndPublish}>\n <CheckCircle aria-hidden=\"true\" />\n Accept & publish\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n ) : (\n <Button variant=\"default\" elevation=\"shadow\" onClick={onAcceptAllSuggestions}>\n <CheckCircle aria-hidden=\"true\" />\n Accept as draft\n </Button>\n )}\n </ButtonGroup>\n )}\n </div>\n </div>\n );\n});\n","function countSuggestionsInRoot(root: Document | Element): number {\n const adjacentPairs = root.querySelectorAll('del + ins');\n const standaloneIns = root.querySelectorAll('ins:not(del + ins)');\n const allDel = root.querySelectorAll('del');\n const standaloneDel = Array.from(allDel).filter((del) => del.nextElementSibling?.tagName !== 'INS');\n\n return adjacentPairs.length + standaloneIns.length + standaloneDel.length;\n}\n\n/** Count suggestions in an HTML string (for title or raw HTML content). */\nexport const countSuggestions = (htmlString: string) => {\n if (!htmlString || typeof DOMParser === 'undefined') {\n return 0;\n }\n const parser = new DOMParser();\n const doc = parser.parseFromString(htmlString, 'text/html');\n\n return countSuggestionsInRoot(doc);\n};\n\n/** Count suggestions inside a DOM element (for rendered ReactNode body content). */\nexport const countSuggestionsInElement = (element: Element | null) => {\n if (!element) return 0;\n\n return countSuggestionsInRoot(element);\n};\n","import React, { useCallback, useEffect, useRef, useState } from 'react';\nimport parse from 'html-react-parser';\nimport { HandsClapping } from '@phosphor-icons/react';\n\nimport { useReviewsSelection } from './context';\nimport { SuggestionsHeader } from './suggestions-header';\nimport type { ReviewListItemProps } from './review-list';\n\nimport { countSuggestions, countSuggestionsInElement } from '@/lib/countSuggestions';\nimport { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';\nimport { ScrollArea } from '@/components/ui/scroll-area';\nimport { Spinner } from '@/components/ui/spinner';\n\nexport type KnowledgeReviewPanelProps = {\n diffTitle: string;\n items: ReviewListItemProps[];\n isLoading?: boolean;\n totalItemsCount?: number;\n showActionButtons?: boolean;\n children?: React.ReactNode;\n sourceIcon: React.ReactNode;\n sourceDescription: string | null;\n};\n\n/**\n * Panel that shows the selected diff (title + content), suggestion count, and article nav.\n * Must be used inside ReviewsSelectionProvider. Expects --knowledge-review-scroll-height\n * to be set by a parent for ScrollArea height.\n */\nexport function KnowledgeReviewPanel({\n diffTitle,\n items,\n isLoading,\n totalItemsCount,\n showActionButtons = true,\n children,\n sourceIcon,\n sourceDescription,\n}: KnowledgeReviewPanelProps) {\n const {\n selectedItem,\n setSelectedItem,\n loadedDiffDoc,\n loadingDiff,\n onApproveAllSuggestions,\n onRejectAllSuggestions,\n onAcceptAndPublish,\n onOpenArticleLink,\n onSourceLinkClick,\n breadcrumb,\n suggestionReasonBody,\n } = useReviewsSelection();\n\n const hasItems = items.length > 0;\n const resolvedIsLoading = isLoading ?? !hasItems;\n const isLoadingState = resolvedIsLoading && !hasItems;\n const isEmptyState = !resolvedIsLoading && !hasItems;\n\n const title = loadingDiff ? '' : parse(loadedDiffDoc?.diffTitle ?? diffTitle ?? '');\n const body = loadingDiff ? <div className=\"text-muted-foreground\">Loading diff…</div> : loadedDiffDoc?.diffContent;\n\n const titleSuggestionsCount = loadingDiff ? 0 : countSuggestions(loadedDiffDoc?.diffTitle ?? diffTitle);\n\n const bodyRef = useRef<HTMLDivElement>(null);\n const [bodySuggestionsCount, setBodySuggestionsCount] = useState(0);\n useEffect(() => {\n if (loadingDiff || !loadedDiffDoc) {\n setBodySuggestionsCount(0);\n\n return;\n }\n const el = bodyRef.current;\n if (!el) return;\n const id = requestAnimationFrame(() => {\n setBodySuggestionsCount(countSuggestionsInElement(el));\n });\n\n return () => cancelAnimationFrame(id);\n }, [loadingDiff, loadedDiffDoc]);\n\n const suggestionsCount = titleSuggestionsCount + bodySuggestionsCount;\n\n const totalArticles = items.length;\n const totalArticlesForDisplay = totalItemsCount ?? totalArticles;\n const currentArticleIndex = selectedItem\n ? Math.max(\n 0,\n items.findIndex((i) => i.id === selectedItem.id),\n )\n : 0;\n\n const onNextArticle = useCallback(() => {\n if (currentArticleIndex < totalArticles - 1) {\n setSelectedItem(items[currentArticleIndex + 1] ?? null);\n }\n }, [currentArticleIndex, items, setSelectedItem, totalArticles]);\n\n const onPreviousArticle = useCallback(() => {\n if (currentArticleIndex > 0) {\n setSelectedItem(items[currentArticleIndex - 1] ?? null);\n }\n }, [currentArticleIndex, items, setSelectedItem]);\n\n const headerSourceIcon = selectedItem?.icon ?? sourceIcon;\n const headerSourceDescription = selectedItem?.description ?? sourceDescription;\n\n return (\n <Card className=\"py-6 pl-4\" data-name=\"knowledge-reviews\">\n <ScrollArea className=\"h-[calc(var(--knowledge-review-scroll-height)-50px)] pr-8\">\n <CardHeader className=\"p-0\">\n {hasItems && (\n <CardTitle className=\"border-b border-dark-300 mb-6 pb-2 font-normal\">\n <SuggestionsHeader\n title={title}\n isNew={loadedDiffDoc?.isNew ?? false}\n suggestionsCount={suggestionsCount}\n sourceIcon={headerSourceIcon}\n sourceDescription={headerSourceDescription}\n currentArticleIndex={currentArticleIndex}\n totalArticles={totalArticles}\n displayTotalArticles={totalArticlesForDisplay}\n showActionButtons={showActionButtons}\n onNextArticle={onNextArticle}\n onPreviousArticle={onPreviousArticle}\n onRejectAllSuggestions={onRejectAllSuggestions}\n onAcceptAllSuggestions={onApproveAllSuggestions}\n onAcceptAndPublish={onAcceptAndPublish}\n onOpenArticleLink={onOpenArticleLink}\n onSourceLinkClick={onSourceLinkClick}\n breadcrumb={breadcrumb}\n suggestionReasonBody={suggestionReasonBody}\n />\n </CardTitle>\n )}\n </CardHeader>\n <CardContent className=\"p-0 [&_ol]:!pl-16 [&_ul]:!pl-16\">\n {/* Mount point for children (e.g. KnowledgeReviewDiffLoader). Kept in DOM so its effects run; hidden because it has no UI. */}\n <div aria-hidden=\"true\" className=\"sr-only\" hidden>\n {children}\n </div>\n {isLoadingState ? (\n <div className=\"flex flex-col items-center justify-center gap-4 text-center h-[50dvh] text-muted-foreground\">\n <Spinner className=\"size-8\" />\n <p className=\"text-base font-medium\">Loading suggestions...</p>\n </div>\n ) : isEmptyState ? (\n <div className=\"flex flex-col items-center justify-center gap-4 text-center h-[50dvh]\">\n <HandsClapping className=\"text-muted-foreground\" size={32} weight=\"fill\" />\n <p className=\"text-base font-medium text-foreground\">All up to date. Well done, mate.</p>\n </div>\n ) : (\n <div ref={bodyRef} className=\"pl-12\">\n {body}\n </div>\n )}\n </CardContent>\n </ScrollArea>\n </Card>\n );\n}\n","import React, { useEffect, useImperativeHandle, useRef } from 'react';\n\nimport { useReviewsSelection } from './context';\nimport { ReviewList, ReviewListItemProps, ReviewsSelectionProvider } from './review-list';\nimport { KnowledgeReviewPanel } from './knowledge-review-panel';\n\nimport { Card, CardContent } from '@/components/ui/card';\nimport { ScrollArea } from '@/components/ui/scroll-area';\nimport { Spinner } from '@/components/ui/spinner';\nimport { cn } from '@/lib/utils';\n\nimport './knowledge-review.css';\n\nconst SCROLL_HEIGHT_VAR = '--knowledge-review-scroll-height';\n\nexport type KnowledgeReviewSceneHandle = {\n selectedItem: ReviewListItemProps | null;\n setSelectedItem: (item: ReviewListItemProps | null) => void;\n};\n\nexport type KnowledgeReviewSceneProps = {\n diffTitle?: string;\n children: React.ReactNode;\n items: ReviewListItemProps[];\n isLoading?: boolean;\n /** Total number of review list items available (can exceed currently loaded `items.length`). */\n totalItemsCount?: number;\n /** Controls visibility of the Reject / Accept action buttons in the review header. */\n showActionButtons?: boolean;\n className?: string;\n onApproveAllSuggestions: () => void;\n onRejectAllSuggestions: () => void;\n onAcceptAndPublish?: () => void;\n onOpenArticleLink?: () => void;\n onSourceLinkClick?: () => void;\n breadcrumb?: string;\n sourceIcon: React.ReactNode;\n sourceDescription: string | null;\n suggestionReasonBody?: string;\n};\n\nconst KnowledgeReviewSceneInner = React.forwardRef<KnowledgeReviewSceneHandle, KnowledgeReviewSceneProps>(\n function KnowledgeReviewSceneInner(\n {\n diffTitle = 'Knowledge Review',\n children,\n items,\n isLoading,\n totalItemsCount,\n showActionButtons = true,\n className,\n onApproveAllSuggestions,\n onRejectAllSuggestions,\n onOpenArticleLink,\n onAcceptAndPublish,\n onSourceLinkClick,\n breadcrumb,\n sourceIcon,\n sourceDescription,\n suggestionReasonBody,\n ...props\n },\n ref,\n ) {\n const innerRef = useRef<HTMLDivElement>(null);\n const { selectedItem, setSelectedItem } = useReviewsSelection();\n\n useImperativeHandle(\n ref,\n () => ({\n selectedItem,\n setSelectedItem,\n }),\n [selectedItem, setSelectedItem],\n );\n\n useEffect(() => {\n const cardEl = innerRef.current;\n if (!cardEl) return;\n\n const updateHeight = () => {\n const { height } = cardEl.getBoundingClientRect();\n cardEl.style.setProperty(SCROLL_HEIGHT_VAR, `${height}px`);\n };\n\n updateHeight();\n\n if (typeof ResizeObserver !== 'function') {\n return;\n }\n\n const observer = new ResizeObserver(updateHeight);\n observer.observe(cardEl);\n\n return () => observer.disconnect();\n }, []);\n\n const resolvedIsLoading = isLoading ?? items.length === 0;\n const isLoadingItems = resolvedIsLoading && items.length === 0;\n\n return (\n <Card className={cn('h-full', className)}>\n <CardContent className=\"p-4 lg:p-8 h-full\">\n <div\n ref={innerRef}\n className=\"grid xs:max-lg:grid-cols-1 lg:grid-cols-[1fr_4fr] gap-6 min-h-96 h-full\"\n style={{ [SCROLL_HEIGHT_VAR]: '100px' } as React.CSSProperties}\n {...props}\n >\n <ScrollArea className=\"h-[calc(var(--knowledge-review-scroll-height))] min-w-80 lg:block hidden\">\n {isLoadingItems ? (\n <div className=\"flex h-full min-h-96 items-center justify-center text-muted-foreground\">\n <Spinner className=\"size-6\" />\n </div>\n ) : (\n <ReviewList items={items} />\n )}\n </ScrollArea>\n <KnowledgeReviewPanel\n diffTitle={diffTitle}\n items={items}\n isLoading={resolvedIsLoading}\n totalItemsCount={totalItemsCount}\n showActionButtons={showActionButtons}\n sourceIcon={sourceIcon}\n sourceDescription={sourceDescription}\n >\n {children}\n </KnowledgeReviewPanel>\n </div>\n </CardContent>\n </Card>\n );\n },\n);\n\nexport const KnowledgeReviewScene = React.forwardRef<KnowledgeReviewSceneHandle, KnowledgeReviewSceneProps>(\n function KnowledgeReviewScene(props, ref) {\n const {\n items,\n onApproveAllSuggestions,\n onRejectAllSuggestions,\n onAcceptAndPublish,\n onOpenArticleLink,\n onSourceLinkClick,\n breadcrumb,\n suggestionReasonBody,\n } = props;\n\n return (\n <ReviewsSelectionProvider\n defaultSelectedItem={items.find((m) => m.isSelected) ?? null}\n onApproveAllSuggestions={onApproveAllSuggestions}\n onRejectAllSuggestions={onRejectAllSuggestions}\n onAcceptAndPublish={onAcceptAndPublish}\n onOpenArticleLink={onOpenArticleLink}\n onSourceLinkClick={onSourceLinkClick}\n breadcrumb={breadcrumb}\n suggestionReasonBody={suggestionReasonBody}\n >\n <KnowledgeReviewSceneInner {...props} ref={ref} />\n </ReviewsSelectionProvider>\n );\n },\n);\n"],"names":["KnowledgeReviewDiffLoader","fetchDiffForItem","selectedItem","setLoadedDiffDoc","setLoadingDiff","useReviewsSelection","loadDiffForItem","useCallback","async","itemId","signal","doc","aborted","error","console","selectedId","id","useEffect","abortController","AbortController","abort","REASON_TITLE","SuggestionsHeader","React","forwardRef","title","isNew","suggestionsCount","sourceIcon","sourceDescription","currentArticleIndex","totalArticles","displayTotalArticles","showActionButtons","onNextArticle","onPreviousArticle","onRejectAllSuggestions","onAcceptAllSuggestions","onAcceptAndPublish","breadcrumb","onOpenArticleLink","onSourceLinkClick","suggestionReasonBody","className","props","ref","splitButtonRef","useRef","whyOpen","setWhyOpen","useState","hasNextArticle","hasPreviousArticle","currentArticle","totalArticlesForDisplay","hasDisplayArticles","status","createElement","StatusBadge","variant","EditCount","count","cn","Button","size","onClick","Tooltip","TooltipTrigger","asChild","disabled","CaretDown","TooltipContent","side","bgColor","CaretUp","ButtonGroup","orientation","rounded","Popover","open","onOpenChange","PopoverTrigger","Lightbulb","PopoverContent","align","Backspace","DropdownMenu","brandShadowEffect","elevation","CheckCircle","DropdownMenuTrigger","DropdownMenuContent","DropdownMenuItem","countSuggestionsInRoot","root","adjacentPairs","querySelectorAll","standaloneIns","allDel","standaloneDel","Array","from","filter","del","nextElementSibling","tagName","length","KnowledgeReviewPanel","diffTitle","items","isLoading","totalItemsCount","children","setSelectedItem","loadedDiffDoc","loadingDiff","onApproveAllSuggestions","hasItems","resolvedIsLoading","isLoadingState","isEmptyState","parse","body","diffContent","titleSuggestionsCount","htmlString","DOMParser","parseFromString","bodyRef","bodySuggestionsCount","setBodySuggestionsCount","el","current","requestAnimationFrame","element","cancelAnimationFrame","Math","max","findIndex","i","headerSourceIcon","icon","headerSourceDescription","description","Card","ScrollArea","CardHeader","CardTitle","CardContent","hidden","Spinner","HandsClapping","weight","SCROLL_HEIGHT_VAR","KnowledgeReviewSceneInner","innerRef","useImperativeHandle","cardEl","updateHeight","height","getBoundingClientRect","style","setProperty","ResizeObserver","observer","observe","disconnect","isLoadingItems","ReviewList","KnowledgeReviewScene","ReviewsSelectionProvider","defaultSelectedItem","find","m","isSelected"],"mappings":"+qCAcO,SAASA,GAA0BC,iBAAEA,IAC1C,MAAMC,aAAEA,EAAAC,iBAAcA,EAAAC,eAAkBA,GAAmBC,IAErDC,EAAkBC,EACtBC,MAAOC,EAAgBC,KACrBN,GAAe,GACfD,EAAiB,MAEjB,IACE,MAAMQ,QAAYV,EAAiBQ,GACnC,GAAIC,EAAOE,QAAS,OACpBT,EAAiBQ,EACnB,OAASE,GACP,GAAIH,EAAOE,QAAS,OACpBE,QAAQD,MAAM,wBAAyBA,GACvCV,EAAiB,KACnB,CAAA,QACOO,EAAOE,SACVR,GAAe,EAEnB,GAEF,CAACH,EAAkBE,EAAkBC,IAGjCW,EAAab,GAAcc,GAmBjC,OAjBAC,EAAU,KACR,IAAKF,EAIH,OAHAZ,EAAiB,WACjBC,GAAe,GAKjB,MAAMc,EAAkB,IAAIC,gBAG5B,OAFKb,EAAgBS,EAAYG,EAAgBR,QAE1C,KACLQ,EAAgBE,UAGjB,CAACL,EAAYT,IAET,IACT,CCnBO,MAAMe,EAAe,oCAEfC,EAAoBC,EAAMC,WAAmD,UACxFC,MACEA,EAAAC,MACAA,EAAAC,iBACAA,EAAAC,WACAA,EAAAC,kBACAA,EAAAC,oBACAA,EAAAC,cACAA,EAAAC,qBACAA,EAAAC,kBACAA,GAAoB,EAAAC,cACpBA,EAAAC,kBACAA,EAAAC,uBACAA,EAAAC,uBACAA,EAAAC,mBACAA,EAAAC,WACAA,EAAAC,kBACAA,EAAAC,kBACAA,EAAAC,qB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AAM+D,KAAMC,GAAMA,EAAEC,aAAe,KACxD1D,0BACAhF,yBACAE,qBACAE,oBACAC,oBACAF,aACAG;eAEAnB,EAAAkC,cAACiG,EAAA,IAA8B9G,EAAOC,QAG5C"}
1
+ {"version":3,"file":"knowledge-review.js","sources":["../../../src/scenes/knowledge-review/diff-loader.tsx","../../../src/scenes/knowledge-review/suggestions-header/suggestions-header-title-nav.tsx","../../../src/scenes/knowledge-review/suggestions-header/suggestions-header-toolbar.tsx","../../../src/scenes/knowledge-review/suggestions-header/suggestions-header.tsx","../../../src/lib/countSuggestions.ts","../../../src/scenes/knowledge-review/knowledge-review-panel.tsx","../../../src/scenes/knowledge-review/scene.tsx"],"sourcesContent":["import { useCallback, useEffect } from 'react';\n\nimport type { LoadedDiffDoc } from './context';\nimport { useReviewsSelection } from './context';\n\nexport type KnowledgeReviewDiffLoaderProps = {\n /** Called when selectedItem changes. Return diff payload or null. */\n fetchDiffForItem: (itemId: string) => Promise<LoadedDiffDoc | null>;\n};\n\n/**\n * Listens to selectedItem from context and fetches diff via the provided callback.\n * Owns loading state and context updates; host (Storybook or Platform) supplies fetch logic.\n */\nexport function KnowledgeReviewDiffLoader({ fetchDiffForItem }: KnowledgeReviewDiffLoaderProps) {\n const { selectedItem, setLoadedDiffDoc, setLoadingDiff } = useReviewsSelection();\n\n const loadDiffForItem = useCallback(\n async (itemId: string, signal: AbortSignal) => {\n setLoadingDiff(true);\n setLoadedDiffDoc(null);\n\n try {\n const doc = await fetchDiffForItem(itemId);\n if (signal.aborted) return;\n setLoadedDiffDoc(doc);\n } catch (error) {\n if (signal.aborted) return;\n console.error('Failed to fetch diff:', error);\n setLoadedDiffDoc(null);\n } finally {\n if (!signal.aborted) {\n setLoadingDiff(false);\n }\n }\n },\n [fetchDiffForItem, setLoadedDiffDoc, setLoadingDiff],\n );\n\n const selectedId = selectedItem?.id;\n\n useEffect(() => {\n if (!selectedId) {\n setLoadedDiffDoc(null);\n setLoadingDiff(false);\n\n return;\n }\n\n const abortController = new AbortController();\n void loadDiffForItem(selectedId, abortController.signal);\n\n return () => {\n abortController.abort();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selectedId, loadDiffForItem]);\n\n return null;\n}\n","import { CaretDown, CaretUp } from '@phosphor-icons/react';\nimport * as React from 'react';\n\nimport { Button } from '@/components/ui/button';\nimport { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';\n\nexport interface SuggestionsHeaderTitleNavProps {\n title: React.ReactNode;\n breadcrumb?: string;\n onOpenArticleLink?: () => void;\n currentArticleIndex: number;\n totalArticles: number;\n displayTotalArticles?: number;\n onNextArticle: () => void;\n onPreviousArticle: () => void;\n}\n\nexport function SuggestionsHeaderTitleNav({\n title,\n breadcrumb,\n onOpenArticleLink,\n currentArticleIndex,\n totalArticles,\n displayTotalArticles,\n onNextArticle,\n onPreviousArticle,\n}: SuggestionsHeaderTitleNavProps) {\n const hasNextArticle = totalArticles > 0 && currentArticleIndex < totalArticles - 1;\n const hasPreviousArticle = currentArticleIndex > 0;\n const currentArticle = totalArticles === 0 ? 0 : currentArticleIndex + 1;\n const totalArticlesForDisplay = displayTotalArticles ?? totalArticles;\n const hasDisplayArticles = totalArticlesForDisplay > 0;\n\n return (\n <div className=\"flex justify-between items-center\">\n <h1 className=\"heading-lg\">\n {title}\n {onOpenArticleLink && breadcrumb && (\n <Button\n variant=\"link\"\n size=\"sm\"\n onClick={onOpenArticleLink}\n aria-label=\"Open article\"\n className=\"block px-0 text-subtle text-xs\"\n >\n {breadcrumb}\n </Button>\n )}\n </h1>\n <div className=\"flex items-center\">\n <p className=\"text-xs text-foreground pr-2\">\n <span aria-hidden=\"true\">{hasDisplayArticles ? `${currentArticle}/${totalArticlesForDisplay}` : '0'}</span>\n <span className=\"sr-only\" aria-live=\"polite\">\n {hasDisplayArticles ? `Article ${currentArticle} of ${totalArticlesForDisplay}` : 'No articles'}\n </span>\n </p>\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n disabled={!hasNextArticle}\n onClick={onNextArticle}\n aria-label=\"Go to next article\"\n >\n <CaretDown aria-hidden=\"true\" />\n </Button>\n </TooltipTrigger>\n <TooltipContent side=\"bottom\" bgColor=\"--bfc-foreground\" className=\"text-background\">\n Next Article\n </TooltipContent>\n </Tooltip>\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n disabled={!hasPreviousArticle}\n onClick={onPreviousArticle}\n aria-label=\"Go to previous article\"\n >\n <CaretUp aria-hidden=\"true\" />\n </Button>\n </TooltipTrigger>\n <TooltipContent side=\"top\" bgColor=\"--bfc-foreground\" className=\"text-background\">\n Previous Article\n </TooltipContent>\n </Tooltip>\n </div>\n </div>\n );\n}\n","import { CaretDown, Backspace, CheckCircle, Lightbulb, Globe, LockKey } from '@phosphor-icons/react';\nimport * as React from 'react';\n\nimport type { AcceptAndPublishVisibility } from '../context';\nimport { REASON_TITLE } from '../suggestions-header';\nimport { EditCount } from '../review-list/edit-count';\n\nimport { Button } from '@/components/ui/button';\nimport { brandShadowEffect } from '@/lib/styles';\nimport { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\nimport { ButtonGroup } from '@/components/ui/button-group';\nimport { cn } from '@/lib/utils';\nimport { StatusBadge } from '@/components/convos/status-badge';\n\nexport interface SuggestionsHeaderToolbarProps {\n isNew: boolean;\n suggestionsCount: number;\n sourceIcon: React.ReactNode;\n sourceDescription: string | null;\n onSourceLinkClick?: () => void;\n showActionButtons?: boolean;\n suggestionReasonBody?: string;\n hideAcceptAndPublishPublic?: boolean;\n onAcceptAndPublish?: (visibility: AcceptAndPublishVisibility) => void;\n onRejectAll: () => void | Promise<void>;\n onAcceptAll: () => void | Promise<void>;\n onAcceptAndPublishAction: (visibility: AcceptAndPublishVisibility) => void | Promise<void>;\n}\n\nexport function SuggestionsHeaderToolbar({\n isNew,\n suggestionsCount,\n sourceIcon,\n sourceDescription,\n onSourceLinkClick,\n showActionButtons = true,\n suggestionReasonBody,\n hideAcceptAndPublishPublic = false,\n onAcceptAndPublish,\n onRejectAll,\n onAcceptAll,\n onAcceptAndPublishAction,\n}: SuggestionsHeaderToolbarProps) {\n const [whyOpen, setWhyOpen] = React.useState(false);\n\n let status: React.ReactNode | undefined;\n if (isNew) {\n status = <StatusBadge variant=\"success\">New</StatusBadge>;\n } else if (suggestionsCount) {\n status = <EditCount count={suggestionsCount} />;\n }\n\n return (\n <div className=\"flex-1 px-2 pb-2 flex justify-between items-center\">\n <div className=\"flex items-center gap-2\">\n {status}\n {sourceDescription &&\n (onSourceLinkClick ? (\n <Button\n variant=\"link\"\n onClick={onSourceLinkClick}\n aria-label=\"Open source\"\n className=\"[&_svg]:size-4 text-xs text-subtle gap-1\"\n >\n {sourceIcon && <span className=\"shrink-0 flex items-center\">{sourceIcon}</span>}\n <span>{sourceDescription}</span>\n </Button>\n ) : (\n <span className=\"[&_svg]:size-4 flex items-center gap-1 text-xs text-subtle\">\n {sourceIcon && <span className=\"shrink-0 flex items-center\">{sourceIcon}</span>}\n {sourceDescription}\n </span>\n ))}\n </div>\n {showActionButtons && (\n <ButtonGroup orientation=\"horizontal\" rounded={false} aria-label=\"Suggestion actions\" className=\"gap-1\">\n {suggestionReasonBody && (\n <Popover open={whyOpen} onOpenChange={setWhyOpen}>\n <PopoverTrigger asChild>\n <Button variant=\"ghost\" aria-label={REASON_TITLE}>\n <Lightbulb aria-hidden=\"true\" />\n Why\n </Button>\n </PopoverTrigger>\n <PopoverContent\n align=\"start\"\n side=\"bottom\"\n className=\"z-above-modal shadow-md dark:shadow-md-invert border-dark-300\"\n >\n <div className=\"font-bold text-sm\">{REASON_TITLE}</div>\n <div className=\"text-sm text-subtle mt-1\">{suggestionReasonBody}</div>\n </PopoverContent>\n </Popover>\n )}\n <Button variant=\"ghost\" onClick={() => void onRejectAll()}>\n <Backspace aria-hidden=\"true\" />\n {isNew ? 'Reject' : 'Reject all'}\n </Button>\n {onAcceptAndPublish ? (\n <DropdownMenu>\n <div className={cn('flex items-center rounded border border-border bg-primary', brandShadowEffect)}>\n <Button\n variant=\"default\"\n elevation=\"shadow\"\n className=\"gap-1 rounded-none border-0 bg-transparent shadow-none\"\n onClick={() => void onAcceptAll()}\n >\n <CheckCircle aria-hidden=\"true\" />\n {isNew ? 'Accept as draft' : 'Accept all as draft'}\n </Button>\n <span className=\"h-full w-px self-stretch bg-foreground\" aria-hidden=\"true\" />\n <DropdownMenuTrigger asChild>\n <Button\n variant=\"default\"\n size=\"icon\"\n className=\"size-9 rounded-none border-0 bg-transparent shadow-none\"\n aria-label=\"More accept options\"\n >\n <CaretDown className=\"size-4\" aria-hidden=\"true\" />\n </Button>\n </DropdownMenuTrigger>\n </div>\n <DropdownMenuContent\n align=\"end\"\n className=\"z-above-modal border-none shadow-md dark:shadow-md-invert mt-1 \"\n >\n {!hideAcceptAndPublishPublic && (\n <DropdownMenuItem className=\"p-3\" onClick={() => void onAcceptAndPublishAction('public')}>\n <Globe aria-hidden=\"true\" />\n {isNew ? 'Accept & publish publicly' : 'Accept all & publish publicly'}\n </DropdownMenuItem>\n )}\n <DropdownMenuItem className=\"p-3\" onClick={() => void onAcceptAndPublishAction('internal')}>\n <LockKey aria-hidden=\"true\" />\n {isNew ? 'Accept & publish internally' : 'Accept all & publish internally'}\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n ) : (\n <Button variant=\"default\" elevation=\"shadow\" onClick={() => void onAcceptAll()}>\n <CheckCircle aria-hidden=\"true\" />\n {isNew ? 'Accept as draft' : 'Accept all as draft'}\n </Button>\n )}\n </ButtonGroup>\n )}\n </div>\n );\n}\n","import * as React from 'react';\n\nimport { useReviewsSelection } from '../context';\nimport type { AcceptAndPublishVisibility } from '../context';\nimport { SuggestionsHeaderTitleNav } from './suggestions-header-title-nav';\nimport { SuggestionsHeaderToolbar } from './suggestions-header-toolbar';\n\nimport { cn } from '@/lib/utils';\n\nexport interface SuggestionsHeaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n title: React.ReactNode;\n isNew: boolean;\n suggestionsCount: number;\n sourceIcon: React.ReactNode;\n sourceDescription: string | null;\n currentArticleIndex: number;\n totalArticles: number;\n displayTotalArticles?: number;\n showActionButtons?: boolean;\n onNextArticle: () => void;\n onPreviousArticle: () => void;\n}\n\nexport const REASON_TITLE = 'Why is Brainfish suggesting this?';\n\nexport const SuggestionsHeader = React.forwardRef<HTMLDivElement, SuggestionsHeaderProps>(function SuggestionsHeader(\n {\n title,\n isNew,\n suggestionsCount,\n sourceIcon,\n sourceDescription,\n currentArticleIndex,\n totalArticles,\n displayTotalArticles,\n showActionButtons = true,\n onNextArticle,\n onPreviousArticle,\n className,\n ...props\n },\n ref,\n) {\n const {\n onApproveAllSuggestions,\n onRejectAllSuggestions,\n onAcceptAndPublish,\n onApplyAllInEditor,\n onRejectAllInEditor,\n onOpenArticleLink,\n onSourceLinkClick,\n breadcrumb,\n suggestionReasonBody,\n hideAcceptAndPublishPublic = false,\n } = useReviewsSelection();\n\n const handleRejectAll = React.useCallback(async () => {\n if (onRejectAllInEditor) await onRejectAllInEditor();\n onRejectAllSuggestions();\n }, [onRejectAllInEditor, onRejectAllSuggestions]);\n\n const handleAcceptAll = React.useCallback(async () => {\n if (onApplyAllInEditor) await onApplyAllInEditor();\n onApproveAllSuggestions();\n }, [onApplyAllInEditor, onApproveAllSuggestions]);\n\n const handleAcceptAndPublish = React.useCallback(\n async (visibility: AcceptAndPublishVisibility) => {\n if (!onAcceptAndPublish) return;\n if (onApplyAllInEditor) await onApplyAllInEditor();\n onAcceptAndPublish(visibility);\n },\n [onApplyAllInEditor, onAcceptAndPublish],\n );\n\n return (\n <div ref={ref} className={cn('flex flex-col gap-4', className)} {...props}>\n <SuggestionsHeaderTitleNav\n title={title}\n breadcrumb={breadcrumb}\n onOpenArticleLink={onOpenArticleLink}\n currentArticleIndex={currentArticleIndex}\n totalArticles={totalArticles}\n displayTotalArticles={displayTotalArticles}\n onNextArticle={onNextArticle}\n onPreviousArticle={onPreviousArticle}\n />\n <SuggestionsHeaderToolbar\n isNew={isNew}\n suggestionsCount={suggestionsCount}\n sourceIcon={sourceIcon}\n sourceDescription={sourceDescription}\n onSourceLinkClick={onSourceLinkClick}\n showActionButtons={showActionButtons}\n suggestionReasonBody={suggestionReasonBody}\n hideAcceptAndPublishPublic={hideAcceptAndPublishPublic}\n onAcceptAndPublish={onAcceptAndPublish}\n onRejectAll={handleRejectAll}\n onAcceptAll={handleAcceptAll}\n onAcceptAndPublishAction={handleAcceptAndPublish}\n />\n </div>\n );\n});\n","function countSuggestionsInRoot(root: Document | Element): number {\n const adjacentPairs = root.querySelectorAll('del + ins');\n const standaloneIns = root.querySelectorAll('ins:not(del + ins)');\n const allDel = root.querySelectorAll('del');\n const standaloneDel = Array.from(allDel).filter((del) => del.nextElementSibling?.tagName !== 'INS');\n\n return adjacentPairs.length + standaloneIns.length + standaloneDel.length;\n}\n\n/** Count suggestions in an HTML string (for title or raw HTML content). */\nexport const countSuggestions = (htmlString: string) => {\n if (!htmlString || typeof DOMParser === 'undefined') {\n return 0;\n }\n const parser = new DOMParser();\n const doc = parser.parseFromString(htmlString, 'text/html');\n\n return countSuggestionsInRoot(doc);\n};\n\n/** Count suggestions inside a DOM element (for rendered ReactNode body content). */\nexport const countSuggestionsInElement = (element: Element | null) => {\n if (!element) return 0;\n\n return countSuggestionsInRoot(element);\n};\n","import React, { useCallback, useEffect, useRef, useState } from 'react';\nimport parse from 'html-react-parser';\nimport { HandsClapping } from '@phosphor-icons/react';\n\nimport { useReviewsSelection } from './context';\nimport { SuggestionsHeader } from './suggestions-header';\nimport type { ReviewListItemProps } from './review-list';\n\nimport { countSuggestions, countSuggestionsInElement } from '@/lib/countSuggestions';\nimport { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';\nimport { ScrollArea } from '@/components/ui/scroll-area';\nimport { Spinner } from '@/components/ui/spinner';\n\nexport type KnowledgeReviewPanelProps = {\n diffTitle: string;\n items: ReviewListItemProps[];\n isLoading?: boolean;\n totalItemsCount?: number;\n showActionButtons?: boolean;\n children?: React.ReactNode;\n sourceIcon: React.ReactNode;\n sourceDescription: string | null;\n};\n\n/**\n * Panel that shows the selected diff (title + content), suggestion count, and article nav.\n * Must be used inside ReviewsSelectionProvider. Expects --knowledge-review-scroll-height\n * to be set by a parent for ScrollArea height.\n */\nexport function KnowledgeReviewPanel({\n diffTitle,\n items,\n isLoading,\n totalItemsCount,\n showActionButtons = true,\n children,\n sourceIcon,\n sourceDescription,\n}: KnowledgeReviewPanelProps) {\n const { selectedItem, setSelectedItem, loadedDiffDoc, loadingDiff } = useReviewsSelection();\n\n const hasItems = items.length > 0;\n const resolvedIsLoading = isLoading ?? !hasItems;\n const isLoadingState = resolvedIsLoading && !hasItems;\n const isEmptyState = !resolvedIsLoading && !hasItems;\n\n const title = loadingDiff ? '' : parse(loadedDiffDoc?.diffTitle ?? diffTitle ?? '');\n const body = loadingDiff ? <div className=\"text-muted-foreground\">Loading diff…</div> : loadedDiffDoc?.diffContent;\n\n const titleSuggestionsCount = loadingDiff ? 0 : countSuggestions(loadedDiffDoc?.diffTitle ?? diffTitle);\n\n const bodyRef = useRef<HTMLDivElement>(null);\n const [bodySuggestionsCount, setBodySuggestionsCount] = useState(0);\n useEffect(() => {\n if (loadingDiff || !loadedDiffDoc) {\n setBodySuggestionsCount(0);\n\n return;\n }\n const el = bodyRef.current;\n if (!el) return;\n const id = requestAnimationFrame(() => {\n setBodySuggestionsCount(countSuggestionsInElement(el));\n });\n\n return () => cancelAnimationFrame(id);\n }, [loadingDiff, loadedDiffDoc]);\n\n const suggestionsCount = titleSuggestionsCount + bodySuggestionsCount;\n\n const totalArticles = items.length;\n const totalArticlesForDisplay = totalItemsCount ?? totalArticles;\n const currentArticleIndex = selectedItem\n ? Math.max(\n 0,\n items.findIndex((i) => i.id === selectedItem.id),\n )\n : 0;\n\n const onNextArticle = useCallback(() => {\n if (currentArticleIndex < totalArticles - 1) {\n setSelectedItem(items[currentArticleIndex + 1] ?? null);\n }\n }, [currentArticleIndex, items, setSelectedItem, totalArticles]);\n\n const onPreviousArticle = useCallback(() => {\n if (currentArticleIndex > 0) {\n setSelectedItem(items[currentArticleIndex - 1] ?? null);\n }\n }, [currentArticleIndex, items, setSelectedItem]);\n\n const headerSourceIcon = selectedItem?.icon ?? sourceIcon;\n const headerSourceDescription = selectedItem?.description ?? sourceDescription;\n\n return (\n <Card className=\"py-6 pl-4\" data-name=\"knowledge-reviews\">\n <ScrollArea className=\"h-[calc(var(--knowledge-review-scroll-height)-50px)] pr-8\">\n <CardHeader className=\"p-0\">\n {hasItems && (\n <CardTitle className=\"border-b border-dark-300 mb-6 pb-2 font-normal\">\n <SuggestionsHeader\n title={title}\n isNew={loadedDiffDoc?.isNew ?? false}\n suggestionsCount={suggestionsCount}\n sourceIcon={headerSourceIcon}\n sourceDescription={headerSourceDescription}\n currentArticleIndex={currentArticleIndex}\n totalArticles={totalArticles}\n displayTotalArticles={totalArticlesForDisplay}\n showActionButtons={showActionButtons}\n onNextArticle={onNextArticle}\n onPreviousArticle={onPreviousArticle}\n />\n </CardTitle>\n )}\n </CardHeader>\n <CardContent className=\"p-0 [&_ol]:!pl-16 [&_ul]:!pl-16\">\n {/* Mount point for children (e.g. KnowledgeReviewDiffLoader). Kept in DOM so its effects run; hidden because it has no UI. */}\n <div aria-hidden=\"true\" className=\"sr-only\" hidden>\n {children}\n </div>\n {isLoadingState ? (\n <div className=\"flex flex-col items-center justify-center gap-4 text-center h-[50dvh] text-muted-foreground\">\n <Spinner className=\"size-8\" />\n <p className=\"text-base font-medium\">Loading suggestions...</p>\n </div>\n ) : isEmptyState ? (\n <div className=\"flex flex-col items-center justify-center gap-4 text-center h-[50dvh]\">\n <HandsClapping className=\"text-muted-foreground\" size={32} weight=\"fill\" />\n <p className=\"text-base font-medium text-foreground\">All up to date. Well done, mate.</p>\n </div>\n ) : (\n <div ref={bodyRef} className=\"pl-12\">\n {body}\n </div>\n )}\n </CardContent>\n </ScrollArea>\n </Card>\n );\n}\n","import React, { useEffect, useImperativeHandle, useRef } from 'react';\n\nimport { useReviewsSelection, type AcceptAndPublishVisibility } from './context';\nimport { ReviewList, ReviewListItemProps, ReviewsSelectionProvider } from './review-list';\nimport { KnowledgeReviewPanel } from './knowledge-review-panel';\n\nimport { Card, CardContent } from '@/components/ui/card';\nimport { ScrollArea } from '@/components/ui/scroll-area';\nimport { Spinner } from '@/components/ui/spinner';\nimport { cn } from '@/lib/utils';\n\nimport './knowledge-review.css';\n\nconst SCROLL_HEIGHT_VAR = '--knowledge-review-scroll-height';\n\nexport type KnowledgeReviewSceneHandle = {\n selectedItem: ReviewListItemProps | null;\n setSelectedItem: (item: ReviewListItemProps | null) => void;\n};\n\nexport type KnowledgeReviewSceneProps = {\n diffTitle?: string;\n children: React.ReactNode;\n items: ReviewListItemProps[];\n isLoading?: boolean;\n /** Total number of review list items available (can exceed currently loaded `items.length`). */\n totalItemsCount?: number;\n /** Controls visibility of the Reject / Accept action buttons in the review header. */\n showActionButtons?: boolean;\n className?: string;\n onApproveAllSuggestions: () => void;\n onRejectAllSuggestions: () => void;\n onAcceptAndPublish?: (visibility: AcceptAndPublishVisibility) => void;\n /** Bulk-apply against the live editor doc (new editor only). Runs before the server callback. */\n onApplyAllInEditor?: () => Promise<void> | void;\n /** Bulk-reject against the live editor doc (new editor only). Runs before the server callback. */\n onRejectAllInEditor?: () => Promise<void> | void;\n onOpenArticleLink?: () => void;\n onSourceLinkClick?: () => void;\n breadcrumb?: string;\n sourceIcon: React.ReactNode;\n sourceDescription: string | null;\n suggestionReasonBody?: string;\n hideAcceptAndPublishPublic?: boolean;\n};\n\nconst KnowledgeReviewSceneInner = React.forwardRef<KnowledgeReviewSceneHandle, KnowledgeReviewSceneProps>(\n function KnowledgeReviewSceneInner(\n {\n diffTitle = 'Knowledge Review',\n children,\n items,\n isLoading,\n totalItemsCount,\n showActionButtons = true,\n className,\n onApproveAllSuggestions,\n onRejectAllSuggestions,\n onOpenArticleLink,\n onAcceptAndPublish,\n onApplyAllInEditor,\n onRejectAllInEditor,\n onSourceLinkClick,\n breadcrumb,\n sourceIcon,\n sourceDescription,\n suggestionReasonBody,\n hideAcceptAndPublishPublic,\n ...props\n },\n ref,\n ) {\n const innerRef = useRef<HTMLDivElement>(null);\n const { selectedItem, setSelectedItem } = useReviewsSelection();\n\n useImperativeHandle(\n ref,\n () => ({\n selectedItem,\n setSelectedItem,\n }),\n [selectedItem, setSelectedItem],\n );\n\n useEffect(() => {\n const cardEl = innerRef.current;\n if (!cardEl) return;\n\n const updateHeight = () => {\n const { height } = cardEl.getBoundingClientRect();\n cardEl.style.setProperty(SCROLL_HEIGHT_VAR, `${height}px`);\n };\n\n updateHeight();\n\n if (typeof ResizeObserver !== 'function') {\n return;\n }\n\n const observer = new ResizeObserver(updateHeight);\n observer.observe(cardEl);\n\n return () => observer.disconnect();\n }, []);\n\n const resolvedIsLoading = isLoading ?? items.length === 0;\n const isLoadingItems = resolvedIsLoading && items.length === 0;\n\n return (\n <Card className={cn('h-full', className)}>\n <CardContent className=\"p-4 lg:p-8 h-full\">\n <div\n ref={innerRef}\n className=\"grid xs:max-lg:grid-cols-1 lg:grid-cols-[1fr_4fr] gap-6 min-h-96 h-full\"\n style={{ [SCROLL_HEIGHT_VAR]: '100px' } as React.CSSProperties}\n {...props}\n >\n <ScrollArea className=\"h-[calc(var(--knowledge-review-scroll-height))] min-w-80 lg:block hidden\">\n {isLoadingItems ? (\n <div className=\"flex h-full min-h-96 items-center justify-center text-muted-foreground\">\n <Spinner className=\"size-6\" />\n </div>\n ) : (\n <ReviewList items={items} />\n )}\n </ScrollArea>\n <KnowledgeReviewPanel\n diffTitle={diffTitle}\n items={items}\n isLoading={resolvedIsLoading}\n totalItemsCount={totalItemsCount}\n showActionButtons={showActionButtons}\n sourceIcon={sourceIcon}\n sourceDescription={sourceDescription}\n >\n {children}\n </KnowledgeReviewPanel>\n </div>\n </CardContent>\n </Card>\n );\n },\n);\n\nexport const KnowledgeReviewScene = React.forwardRef<KnowledgeReviewSceneHandle, KnowledgeReviewSceneProps>(\n function KnowledgeReviewScene(props, ref) {\n const {\n items,\n onApproveAllSuggestions,\n onRejectAllSuggestions,\n onAcceptAndPublish,\n onApplyAllInEditor,\n onRejectAllInEditor,\n onOpenArticleLink,\n onSourceLinkClick,\n breadcrumb,\n suggestionReasonBody,\n hideAcceptAndPublishPublic,\n } = props;\n\n return (\n <ReviewsSelectionProvider\n defaultSelectedItem={items.find((m) => m.isSelected) ?? null}\n onApproveAllSuggestions={onApproveAllSuggestions}\n onRejectAllSuggestions={onRejectAllSuggestions}\n onAcceptAndPublish={onAcceptAndPublish}\n onApplyAllInEditor={onApplyAllInEditor}\n onRejectAllInEditor={onRejectAllInEditor}\n onOpenArticleLink={onOpenArticleLink}\n onSourceLinkClick={onSourceLinkClick}\n breadcrumb={breadcrumb}\n suggestionReasonBody={suggestionReasonBody}\n hideAcceptAndPublishPublic={hideAcceptAndPublishPublic}\n >\n <KnowledgeReviewSceneInner {...props} ref={ref} />\n </ReviewsSelectionProvider>\n );\n },\n);\n"],"names":["KnowledgeReviewDiffLoader","fetchDiffForItem","selectedItem","setLoadedDiffDoc","setLoadingDiff","useReviewsSelection","loadDiffForItem","useCallback","async","itemId","signal","doc","aborted","error","console","selectedId","id","useEffect","abortController","AbortController","abort","SuggestionsHeaderTitleNav","title","breadcrumb","onOpenArticleLink","currentArticleIndex","totalArticles","displayTotalArticles","onNextArticle","onPreviousArticle","hasNextArticle","hasPreviousArticle","currentArticle","totalArticlesForDisplay","hasDisplayArticles","React","createElement","className","Button","variant","size","onClick","Tooltip","TooltipTrigger","asChild","disabled","CaretDown","TooltipContent","side","bgColor","CaretUp","SuggestionsHeaderToolbar","isNew","suggestionsCount","sourceIcon","sourceDescription","onSourceLinkClick","showActionButtons","suggestionReasonBody","hideAcceptAndPublishPublic","onAcceptAndPublish","onRejectAll","onAcceptAll","onAcceptAndPublishAction","whyOpen","setWhyOpen","useState","status","StatusBadge","EditCount","count","ButtonGroup","orientation","rounded","Popover","open","onOpenChange","PopoverTrigger","REASON_TITLE","Lightbulb","PopoverContent","align","Backspace","DropdownMenu","cn","brandShadowEffect","elevation","CheckCircle","DropdownMenuTrigger","DropdownMenuContent","DropdownMenuItem","Globe","LockKey","SuggestionsHeader","forwardRef","props","ref","onApproveAllSuggestions","onRejectAllSuggestions","onApplyAllInEditor","onRejectAllInEditor","handleRejectAll","handleAcceptAll","handleAcceptAndPublish","visibility","countSuggestionsInRoot","root","adjacentPairs","querySelectorAll","standaloneIns","allDel","standaloneDel","Array","from","filter","del","nextElementSibling","tagName","length","KnowledgeReviewPanel","diffTitle","items","isLoading","totalItemsCount","children","setSelectedItem","loadedDiffDoc","loadingDiff","hasItems","resolvedIsLoading","isLoadingState","isEmptyState","parse","body","diffContent","titleSuggestionsCount","htmlString","DOMParser","parseFromString","bodyRef","useRef","bodySuggestionsCount","setBodySuggestionsCount","el","current","requestAnimationFrame","element","cancelAnimationFrame","Math","max","findIndex","i","headerSourceIcon","icon","headerSourceDescription","description","Card","ScrollArea","CardHeader","CardTitle","CardContent","hidden","Spinner","HandsClapping","weight","SCROLL_HEIGHT_VAR","KnowledgeReviewSceneInner","innerRef","useImperativeHandle","cardEl","updateHeight","height","getBoundingClientRect","style","setProperty","ResizeObserver","observer","observe","disconnect","isLoadingItems","ReviewList","KnowledgeReviewScene","ReviewsSelectionProvider","defaultSelectedItem","find","m","isSelected"],"mappings":"usCAcO,SAASA,GAA0BC,iBAAEA,IAC1C,MAAMC,aAAEA,EAAAC,iBAAcA,EAAAC,eAAkBA,GAAmBC,IAErDC,EAAkBC,EACtBC,MAAOC,EAAgBC,KACrBN,GAAe,GACfD,EAAiB,MAEjB,IACE,MAAMQ,QAAYV,EAAiBQ,GACnC,GAAIC,EAAOE,QAAS,OACpBT,EAA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,CAAQ7H,UAAU,2BAGrBF,EAAAC,cAACgJ,EAAA,CAAW3D;eAGhBtF,EAAAC,cAACmF,EAAA,CACCC,YACAC,QACAC,UAAWO,EACXN,kBACAlE,oBACAH,aACAC,qBAECqE,KAMb,GAGWyD,EAAuBlJ,EAAM2D,WACxC,SAA8BC,EAAOC,GACnC,MAAMyB,MACJA,EAAAxB,wBACAA,EAAAC,uBACAA,EAAAtC,mBACAA,EAAAuC,mBACAA,EAAAC,oBACAA,EAAA5E,kBACAA,EAAAgC,kBACAA,EAAAjC,WACAA,EAAAmC,qBACAA,EAAAC,2BACAA,GACEoC;AAEJ,OACE5D,EAAAC,cAACkJ,EAAA,CACCC,oBAAqB9D,EAAM+D,KAAMC,GAAMA,EAAEC,aAAe,KACxDzF,0BACAC,yBACAtC,qBACAuC,qBACAC,sBACA5E,oBACAgC,oBACAjC,aACAmC,uBACAC;eAEAxB,EAAAC,cAACkI,EAAA,IAA8BvE,EAAOC,QAG5C"}
@@ -1,2 +1,2 @@
1
- import{g as e}from"./chunks/_commonjsHelpers.lGe4XDVY.js";import{BrainfishColors as r}from"./colors.js";var t,n,o,a,i={},s={};function l(){return n||(n=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const r=/*#__PURE__*/n((t||(t=1,function(e){function r(e,r){return{handler:e,config:r}}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}}),r.withOptions=function(e,r=()=>({})){const t=function(t){return{__options:t,handler:e(t),config:r(t)}};return t.__isOptionsFunction=!0,t.__pluginFunction=e,t.__configFunction=r,t};const t=r}(s)),s));function n(e){return e&&e.__esModule?e:{default:e}}const o=r.default}(i)),i}var m=function(){if(a)return o;a=1;let e=l();return o=(e.__esModule?e:{default:e}).default}();const c=/*@__PURE__*/e(m);var p,d,g,f,u,b,x={},h={};function v(){return f||(f=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const r=(p||(p=1,function(e){function r(e){return Array.isArray(e)?e.map(e=>r(e)):"object"==typeof e&&null!==e?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,r(t)])):e}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"cloneDeep",{enumerable:!0,get:function(){return r}})}(h)),h),t=/*#__PURE__*/n(g?d:(g=1,d={content:[],presets:[],darkMode:"media",theme:{accentColor:({theme:e})=>({...e("colors"),auto:"auto"}),animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0, 0, 0.2, 1) infinite",pulse:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",bounce:"bounce 1s infinite"},aria:{busy:'busy="true"',checked:'checked="true"',disabled:'disabled="true"',expanded:'expanded="true"',hidden:'hidden="true"',pressed:'pressed="true"',readonly:'readonly="true"',required:'required="true"',selected:'selected="true"'},aspectRatio:{auto:"auto",square:"1 / 1",video:"16 / 9"},backdropBlur:({theme:e})=>e("blur"),backdropBrightness:({theme:e})=>e("brightness"),backdropContrast:({theme:e})=>e("contrast"),backdropGrayscale:({theme:e})=>e("grayscale"),backdropHueRotate:({theme:e})=>e("hueRotate"),backdropInvert:({theme:e})=>e("invert"),backdropOpacity:({theme:e})=>e("opacity"),backdropSaturate:({theme:e})=>e("saturate"),backdropSepia:({theme:e})=>e("sepia"),backgroundColor:({theme:e})=>e("colors"),backgroundImage:{none:"none","gradient-to-t":"linear-gradient(to top, var(--tw-gradient-stops))","gradient-to-tr":"linear-gradient(to top right, var(--tw-gradient-stops))","gradient-to-r":"linear-gradient(to right, var(--tw-gradient-stops))","gradient-to-br":"linear-gradient(to bottom right, var(--tw-gradient-stops))","gradient-to-b":"linear-gradient(to bottom, var(--tw-gradient-stops))","gradient-to-bl":"linear-gradient(to bottom left, var(--tw-gradient-stops))","gradient-to-l":"linear-gradient(to left, var(--tw-gradient-stops))","gradient-to-tl":"linear-gradient(to top left, var(--tw-gradient-stops))"},backgroundOpacity:({theme:e})=>e("opacity"),backgroundPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{0:"0",none:"",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},borderColor:({theme:e})=>({...e("colors"),DEFAULT:e("colors.gray.200","currentColor")}),borderOpacity:({theme:e})=>e("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},borderSpacing:({theme:e})=>({...e("spacing")}),borderWidth:{DEFAULT:"1px",0:"0px",2:"2px",4:"4px",8:"8px"},boxShadow:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",DEFAULT:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)",inner:"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",none:"none"},boxShadowColor:({theme:e})=>e("colors"),brightness:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5",200:"2"},caretColor:({theme:e})=>e("colors"),colors:({colors:e})=>({inherit:e.inherit,current:e.current,transparent:e.transparent,black:e.black,white:e.white,slate:e.slate,gray:e.gray,zinc:e.zinc,neutral:e.neutral,stone:e.stone,red:e.red,orange:e.orange,amber:e.amber,yellow:e.yellow,lime:e.lime,green:e.green,emerald:e.emerald,teal:e.teal,cyan:e.cyan,sky:e.sky,blue:e.blue,indigo:e.indigo,violet:e.violet,purple:e.purple,fuchsia:e.fuchsia,pink:e.pink,rose:e.rose}),columns:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},container:{},content:{none:"none"},contrast:{0:"0",50:".5",75:".75",100:"1",125:"1.25",150:"1.5",200:"2"},cursor:{auto:"auto",default:"default",pointer:"pointer",wait:"wait",text:"text",move:"move",help:"help","not-allowed":"not-allowed",none:"none","context-menu":"context-menu",progress:"progress",cell:"cell",crosshair:"crosshair","vertical-text":"vertical-text",alias:"alias",copy:"copy","no-drop":"no-drop",grab:"grab",grabbing:"grabbing","all-scroll":"all-scroll","col-resize":"col-resize","row-resize":"row-resize","n-resize":"n-resize","e-resize":"e-resize","s-resize":"s-resize","w-resize":"w-resize","ne-resize":"ne-resize","nw-resize":"nw-resize","se-resize":"se-resize","sw-resize":"sw-resize","ew-resize":"ew-resize","ns-resize":"ns-resize","nesw-resize":"nesw-resize","nwse-resize":"nwse-resize","zoom-in":"zoom-in","zoom-out":"zoom-out"},divideColor:({theme:e})=>e("borderColor"),divideOpacity:({theme:e})=>e("borderOpacity"),divideWidth:({theme:e})=>e("borderWidth"),dropShadow:{sm:"0 1px 1px rgb(0 0 0 / 0.05)",DEFAULT:["0 1px 2px rgb(0 0 0 / 0.1)","0 1px 1px rgb(0 0 0 / 0.06)"],md:["0 4px 3px rgb(0 0 0 / 0.07)","0 2px 2px rgb(0 0 0 / 0.06)"],lg:["0 10px 8px rgb(0 0 0 / 0.04)","0 4px 3px rgb(0 0 0 / 0.1)"],xl:["0 20px 13px rgb(0 0 0 / 0.03)","0 8px 5px rgb(0 0 0 / 0.08)"],"2xl":"0 25px 25px rgb(0 0 0 / 0.15)",none:"0 0 #0000"},fill:({theme:e})=>({none:"none",...e("colors")}),flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:e})=>({auto:"auto",...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%"}),flexGrow:{0:"0",DEFAULT:"1"},flexShrink:{0:"0",DEFAULT:"1"},fontFamily:{sans:["ui-sans-serif","system-ui","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"','"Noto Color Emoji"'],serif:["ui-serif","Georgia","Cambria",'"Times New Roman"',"Times","serif"],mono:["ui-monospace","SFMono-Regular","Menlo","Monaco","Consolas",'"Liberation Mono"','"Courier New"',"monospace"]},fontSize:{xs:["0.75rem",{lineHeight:"1rem"}],sm:["0.875rem",{lineHeight:"1.25rem"}],base:["1rem",{lineHeight:"1.5rem"}],lg:["1.125rem",{lineHeight:"1.75rem"}],xl:["1.25rem",{lineHeight:"1.75rem"}],"2xl":["1.5rem",{lineHeight:"2rem"}],"3xl":["1.875rem",{lineHeight:"2.25rem"}],"4xl":["2.25rem",{lineHeight:"2.5rem"}],"5xl":["3rem",{lineHeight:"1"}],"6xl":["3.75rem",{lineHeight:"1"}],"7xl":["4.5rem",{lineHeight:"1"}],"8xl":["6rem",{lineHeight:"1"}],"9xl":["8rem",{lineHeight:"1"}]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:({theme:e})=>e("spacing"),gradientColorStops:({theme:e})=>e("colors"),gradientColorStopPositions:{"0%":"0%","5%":"5%","10%":"10%","15%":"15%","20%":"20%","25%":"25%","30%":"30%","35%":"35%","40%":"40%","45%":"45%","50%":"50%","55%":"55%","60%":"60%","65%":"65%","70%":"70%","75%":"75%","80%":"80%","85%":"85%","90%":"90%","95%":"95%","100%":"100%"},grayscale:{0:"0",DEFAULT:"100%"},gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridColumn:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-7":"span 7 / span 7","span-8":"span 8 / span 8","span-9":"span 9 / span 9","span-10":"span 10 / span 10","span-11":"span 11 / span 11","span-12":"span 12 / span 12","span-full":"1 / -1"},gridColumnEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridColumnStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridRow:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-7":"span 7 / span 7","span-8":"span 8 / span 8","span-9":"span 9 / span 9","span-10":"span 10 / span 10","span-11":"span 11 / span 11","span-12":"span 12 / span 12","span-full":"1 / -1"},gridRowEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridRowStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridTemplateColumns:{none:"none",subgrid:"subgrid",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))",7:"repeat(7, minmax(0, 1fr))",8:"repeat(8, minmax(0, 1fr))",9:"repeat(9, minmax(0, 1fr))",10:"repeat(10, minmax(0, 1fr))",11:"repeat(11, minmax(0, 1fr))",12:"repeat(12, minmax(0, 1fr))"},gridTemplateRows:{none:"none",subgrid:"subgrid",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))",7:"repeat(7, minmax(0, 1fr))",8:"repeat(8, minmax(0, 1fr))",9:"repeat(9, minmax(0, 1fr))",10:"repeat(10, minmax(0, 1fr))",11:"repeat(11, minmax(0, 1fr))",12:"repeat(12, minmax(0, 1fr))"},height:({theme:e})=>({auto:"auto",...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%",full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content"}),hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},inset:({theme:e})=>({auto:"auto",...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%"}),invert:{0:"0",DEFAULT:"100%"},keyframes:{spin:{to:{transform:"rotate(360deg)"}},ping:{"75%, 100%":{transform:"scale(2)",opacity:"0"}},pulse:{"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},listStyleType:{none:"none",disc:"disc",decimal:"decimal"},listStyleImage:{none:"none"},margin:({theme:e})=>({auto:"auto",...e("spacing")}),lineClamp:{1:"1",2:"2",3:"3",4:"4",5:"5",6:"6"},maxHeight:({theme:e})=>({...e("spacing"),none:"none",full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content"}),maxWidth:({theme:e,breakpoints:r})=>({...e("spacing"),none:"none",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch",...r(e("screens"))}),minHeight:({theme:e})=>({...e("spacing"),full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content"}),minWidth:({theme:e})=>({...e("spacing"),full:"100%",min:"min-content",max:"max-content",fit:"fit-content"}),objectPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},opacity:{0:"0",5:"0.05",10:"0.1",15:"0.15",20:"0.2",25:"0.25",30:"0.3",35:"0.35",40:"0.4",45:"0.45",50:"0.5",55:"0.55",60:"0.6",65:"0.65",70:"0.7",75:"0.75",80:"0.8",85:"0.85",90:"0.9",95:"0.95",100:"1"},order:{first:"-9999",last:"9999",none:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12"},outlineColor:({theme:e})=>e("colors"),outlineOffset:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},outlineWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},padding:({theme:e})=>e("spacing"),placeholderColor:({theme:e})=>e("colors"),placeholderOpacity:({theme:e})=>e("opacity"),ringColor:({theme:e})=>({DEFAULT:e("colors.blue.500","#3b82f6"),...e("colors")}),ringOffsetColor:({theme:e})=>e("colors"),ringOffsetWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},ringOpacity:({theme:e})=>({DEFAULT:"0.5",...e("opacity")}),ringWidth:{DEFAULT:"3px",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},rotate:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg"},saturate:{0:"0",50:".5",100:"1",150:"1.5",200:"2"},scale:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5"},screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},scrollMargin:({theme:e})=>({...e("spacing")}),scrollPadding:({theme:e})=>e("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg"},space:({theme:e})=>({...e("spacing")}),spacing:{px:"1px",0:"0px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},stroke:({theme:e})=>({none:"none",...e("colors")}),strokeWidth:{0:"0",1:"1",2:"2"},supports:{},data:{},textColor:({theme:e})=>e("colors"),textDecorationColor:({theme:e})=>e("colors"),textDecorationThickness:{auto:"auto","from-font":"from-font",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},textIndent:({theme:e})=>({...e("spacing")}),textOpacity:({theme:e})=>e("opacity"),textUnderlineOffset:{auto:"auto",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},transformOrigin:{center:"center",top:"top","top-right":"top right",right:"right","bottom-right":"bottom right",bottom:"bottom","bottom-left":"bottom left",left:"left","top-left":"top left"},transitionDelay:{0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},transitionDuration:{DEFAULT:"150ms",0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},transitionProperty:{none:"none",all:"all",DEFAULT:"color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter",colors:"color, background-color, border-color, text-decoration-color, fill, stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4, 0, 0.2, 1)",linear:"linear",in:"cubic-bezier(0.4, 0, 1, 1)",out:"cubic-bezier(0, 0, 0.2, 1)","in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},translate:({theme:e})=>({...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%"}),size:({theme:e})=>({auto:"auto",...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",min:"min-content",max:"max-content",fit:"fit-content"}),width:({theme:e})=>({auto:"auto",...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",screen:"100vw",svw:"100svw",lvw:"100lvw",dvw:"100dvw",min:"min-content",max:"max-content",fit:"fit-content"}),willChange:{auto:"auto",scroll:"scroll-position",contents:"contents",transform:"transform"},zIndex:{auto:"auto",0:"0",10:"10",20:"20",30:"30",40:"40",50:"50"}},plugins:[]}));function n(e){return e&&e.__esModule?e:{default:e}}const o=(0,r.cloneDeep)(t.default.theme)}(x)),x}var y=function(){if(b)return u;b=1;let e=v();return u=(e.__esModule?e:{default:e}).default}();const{blue:w,dark:k,green:z,lime:F,magenta:E,orange:T,pink:D,primary:A,purple:U,red:L,teal:O,yellow:S}=r,C={darkMode:["class"],theme:{container:{center:!0,padding:"2rem",screens:{"2xl":"1400px"}},extend:{fontFamily:{...y.fontFamily,sans:["var(--bfc-font-family)","system-ui","sans-serif"],fraunces:["var(--font-fraunces)","serif"],inter:["var(--font-inter)","sans-serif"]},fontWeight:{bold:"700",normal:"400"},colors:{transparent:"transparent",primary:"var(--bfc-primary)",success:{DEFAULT:"var(--bfc-success-bg)",foreground:"var(--bfc-success-text)"},destructive:{DEFAULT:"var(--bfc-destructive-bg)",foreground:"var(--bfc-destructive-text)"},warning:"var(--bfc-warning-bg)",base:{orange:T.DEFAULT,yellow:S.DEFAULT,primary:A.DEFAULT,green:z.DEFAULT,blue:w.DEFAULT,purple:U.DEFAULT,pink:D.DEFAULT,red:L.DEFAULT,lime:F.DEFAULT,teal:O.DEFAULT,magenta:E.DEFAULT},dark:k,orange:T,yellow:S,green:z,blue:w,purple:U,pink:D,red:L,border:"var(--bfc-border)","border-subtle":"var(--bfc-border-subtle)",input:"var(--bfc-input)",ring:"color-mix(in srgb, var(--bfc-primary) 85%, transparent)",background:"var(--bfc-background)",foreground:"var(--bfc-foreground)",feedback:{positive:"var(--bfc-feedback-positive)",negative:"var(--bfc-feedback-negative)"},link:"var(--bfc-link)",surface:{DEFAULT:"var(--bfc-surface)",border:"var(--bfc-surface-border)"},secondary:{DEFAULT:"var(--bfc-secondary)",foreground:"var(--bfc-secondary-foreground)"},muted:{DEFAULT:"var(--bfc-muted)",foreground:"var(--bfc-muted-foreground)"},accent:{DEFAULT:"var(--bfc-accent)",foreground:"var(--bfc-accent-foreground)"},popover:{DEFAULT:"var(--bfc-popover)",foreground:"var(--bfc-foreground)"},card:{DEFAULT:"var(--bfc-card)",foreground:"var(--bfc-card-foreground)"}},textColor:{primary:"var(--bfc-primary-foreground)","primary-foreground":"var(--bfc-primary-foreground)",default:"var(--bfc-text-default)",subtle:"var(--bfc-text-subtle)",subtlest:"var(--bfc-text-subtlest)",success:"var(--bfc-success-text)",destructive:"var(--bfc-destructive-text)",warning:"var(--bfc-warning-text)"},backgroundColor:{success:"var(--bfc-success-bg)",destructive:"var(--bfc-destructive-bg)",warning:"var(--bfc-warning-bg)",surface:"var(--bfc-white)"},borderColor:{success:"var(--bfc-success-border)",destructive:"var(--bfc-destructive-border)",warning:"var(--bfc-warning-border)"},keyframes:{"accordion-down":{from:{height:"0"},to:{height:"var(--radix-accordion-content-height)"}},"accordion-up":{from:{height:"var(--radix-accordion-content-height)"},to:{height:"0"}},sweep:{"0%":{backgroundPosition:"100% center"},"100%":{backgroundPosition:"-100% center"}}},animation:{"accordion-down":"accordion-down 0.2s ease-out","accordion-up":"accordion-up 0.2s ease-out",sweep:"sweep 1.8s linear infinite"},maxWidth:{threadWidth:"1400px"},spacing:{headerHeight:"64px",md:"16px",lg:"24px",xl:"32px"},backgroundImage:{"gradient-yellowfin":"linear-gradient(168deg, rgb(24, 104, 219) 7.35%, rgb(53, 125, 232) 23.69%, rgb(126, 226, 184) 61.42%, rgb(179, 238, 43) 82.59%)","sweep-yellowfin":"linear-gradient(90deg, var(--bfc-v2-color-blue-700) 0%, var(--bfc-v2-color-blue-700) 37%, var(--bfc-v2-color-blue-600) 42%, var(--bfc-v2-color-green-300) 46%, var(--bfc-v2-color-lime-300) 50%, var(--bfc-v2-color-green-300) 54%, var(--bfc-v2-color-blue-600) 58%, var(--bfc-v2-color-blue-700) 63%, var(--bfc-v2-color-blue-700) 100%)"},zIndex:{"above-modal":"9999"},boxShadow:{md:"2px 4px 12px 0 rgba(0,0,0,0.14)","md-invert":"2px 4px 12px 0 rgba(255,255,255,0.14)",brand:"2px 2px 0 0 #0A0A0D","brand-active":"inset 2px 2px 0 0 #262626","brand-dark":"2px 2px 0 0 #FFF","brand-dark-active":"inset 2px 2px 0 0 #FFF","top-soft":"0px -2px 4px 0px rgba(18, 18, 23, 0.05)"},gridTemplateColumns:{12:"repeat(12, minmax(0, 1fr))"}}},plugins:[require("tailwindcss-animate"),require("@tailwindcss/container-queries"),c(function({addBase:e}){e({ul:{listStyleType:"disc"},ol:{listStyleType:"decimal"}})}),c(function({addUtilities:e}){e({...Object.entries({xxl:{fontSize:"2rem",lineHeight:"2.25rem",fontFamily:"var(--bfc-heading-xxl-font-family)"},xl:{fontSize:"1.75rem",lineHeight:"2rem",fontFamily:"var(--bfc-v2-font-family)"},lg:{fontSize:"1.5rem",lineHeight:"1.75rem",fontFamily:"var(--bfc-v2-font-family)"},m:{fontSize:"1.25rem",lineHeight:"1.5rem",fontFamily:"var(--bfc-v2-font-family)"},sm:{fontSize:"1rem",lineHeight:"1.25rem",fontFamily:"var(--bfc-v2-font-family)"},xs:{fontSize:"0.875rem",lineHeight:"1.25rem",fontFamily:"var(--bfc-v2-font-family)"},xxs:{fontSize:"0.75rem",lineHeight:"1rem",fontFamily:"var(--bfc-v2-font-family)"},xxxs:{fontSize:"0.625rem",lineHeight:"0.875rem",fontFamily:"var(--bfc-v2-font-family)"}}).reduce((e,[r,t])=>(e[`.heading-${r}`]={"font-family":t.fontFamily,"font-size":t.fontSize,"font-style":"normal","font-weight":"700","line-height":t.lineHeight},e),{}),...Object.entries({lg:{fontSize:"1rem",lineHeight:"1.5rem"},md:{fontSize:"0.875rem",lineHeight:"1.25rem"},sm:{fontSize:"0.75rem",lineHeight:"1rem"}}).reduce((e,[r,t])=>(e[`.paragraph-${r}`]={"font-family":"var(--bfc-v2-font-family)","font-size":t.fontSize,"font-style":"normal","font-weight":"400","line-height":t.lineHeight},e),{}),".text-subtlest":{fontWeight:"400"}})}),c(function({addUtilities:e}){const t={},n=(e,r,t)=>{const n=[0,90,180,270].map(t=>((e,r)=>`repeating-linear-gradient(${e}deg, ${r}, ${r} 8px, transparent 8px, transparent 16px)`)(t,r.includes(t)?e:"transparent")),o=t?`.custom-dashed-border-${t}`:".custom-dashed-border";return{[o]:{position:"relative",border:"none"},[`${o}::before`]:{content:'""',position:"absolute",inset:"0","background-image":n.join(","),"background-position":"0 0, 0 0, 100% 0, 0 100%","background-size":"1px 100%, 100% 1px, 1px 100%, 100% 1px","background-repeat":"no-repeat","pointer-events":"none","border-radius":"inherit","z-index":"0"}}},o=(e,r)=>{const t={};return Object.assign(t,n(e,[0,90,180,270],r)),Object.assign(t,n(e,[90],r?`t-${r}`:"t")),Object.assign(t,n(e,[180],r?`r-${r}`:"r")),Object.assign(t,n(e,[270],r?`b-${r}`:"b")),Object.assign(t,n(e,[0],r?`l-${r}`:"l")),Object.assign(t,n(e,[0,180],r?`x-${r}`:"x")),Object.assign(t,n(e,[90,270],r?`y-${r}`:"y")),t};Object.assign(t,o("var(--bfc-border)","")),Object.entries(r).forEach(([e,r])=>{Object.entries(r).forEach(([r,n])=>{const a="DEFAULT"===r?e:`${e}-${r}`;Object.assign(t,o(n,a))})}),e(t),e({".custom-dashed-border-hover":{"&::before":{"background-image":"none",border:"1px solid var(--bfc-border)"},"box-shadow":"4px 4px 0 0 var(--bfc-border)"}});const a={border:"1.2px solid transparent",background:"linear-gradient(145.85deg, #1868DB 7.35%, #357DE8 23.69%, #7EE2B8 61.42%, #B4EE2B 82.59%),\n linear-gradient(145.85deg, rgba(180, 238, 43, 0.7) 3.02%, rgba(126, 226, 184, 0.7) 24.19%, rgba(53, 125, 232, 0.7) 61.92%, rgba(24, 104, 219, 0.7) 78.26%)",transition:"all 0.2s ease-in-out","background-origin":"border-box","background-clip":"content-box, border-box"};e({".bg-yellowfin-gradient":{...a},".bg-yellowfin-gradient-reverse":{...a,filter:"brightness(1.02) saturate(1.5) hue-rotate(5deg)",transform:"translateY(-1px)"}})})]};export{C as default};
1
+ import{g as e}from"./chunks/_commonjsHelpers.lGe4XDVY.js";import{BrainfishColors as r}from"./colors.js";var t,n,o,a,i={},s={};function l(){return n||(n=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const r=/*#__PURE__*/n((t||(t=1,function(e){function r(e,r){return{handler:e,config:r}}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}}),r.withOptions=function(e,r=()=>({})){const t=function(t){return{__options:t,handler:e(t),config:r(t)}};return t.__isOptionsFunction=!0,t.__pluginFunction=e,t.__configFunction=r,t};const t=r}(s)),s));function n(e){return e&&e.__esModule?e:{default:e}}const o=r.default}(i)),i}var m=function(){if(a)return o;a=1;let e=l();return o=(e.__esModule?e:{default:e}).default}();const c=/*@__PURE__*/e(m);var p,d,g,f,u,b,x={},h={};function v(){return f||(f=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const r=(p||(p=1,function(e){function r(e){return Array.isArray(e)?e.map(e=>r(e)):"object"==typeof e&&null!==e?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,r(t)])):e}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"cloneDeep",{enumerable:!0,get:function(){return r}})}(h)),h),t=/*#__PURE__*/n(g?d:(g=1,d={content:[],presets:[],darkMode:"media",theme:{accentColor:({theme:e})=>({...e("colors"),auto:"auto"}),animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0, 0, 0.2, 1) infinite",pulse:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",bounce:"bounce 1s infinite"},aria:{busy:'busy="true"',checked:'checked="true"',disabled:'disabled="true"',expanded:'expanded="true"',hidden:'hidden="true"',pressed:'pressed="true"',readonly:'readonly="true"',required:'required="true"',selected:'selected="true"'},aspectRatio:{auto:"auto",square:"1 / 1",video:"16 / 9"},backdropBlur:({theme:e})=>e("blur"),backdropBrightness:({theme:e})=>e("brightness"),backdropContrast:({theme:e})=>e("contrast"),backdropGrayscale:({theme:e})=>e("grayscale"),backdropHueRotate:({theme:e})=>e("hueRotate"),backdropInvert:({theme:e})=>e("invert"),backdropOpacity:({theme:e})=>e("opacity"),backdropSaturate:({theme:e})=>e("saturate"),backdropSepia:({theme:e})=>e("sepia"),backgroundColor:({theme:e})=>e("colors"),backgroundImage:{none:"none","gradient-to-t":"linear-gradient(to top, var(--tw-gradient-stops))","gradient-to-tr":"linear-gradient(to top right, var(--tw-gradient-stops))","gradient-to-r":"linear-gradient(to right, var(--tw-gradient-stops))","gradient-to-br":"linear-gradient(to bottom right, var(--tw-gradient-stops))","gradient-to-b":"linear-gradient(to bottom, var(--tw-gradient-stops))","gradient-to-bl":"linear-gradient(to bottom left, var(--tw-gradient-stops))","gradient-to-l":"linear-gradient(to left, var(--tw-gradient-stops))","gradient-to-tl":"linear-gradient(to top left, var(--tw-gradient-stops))"},backgroundOpacity:({theme:e})=>e("opacity"),backgroundPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{0:"0",none:"",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},borderColor:({theme:e})=>({...e("colors"),DEFAULT:e("colors.gray.200","currentColor")}),borderOpacity:({theme:e})=>e("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},borderSpacing:({theme:e})=>({...e("spacing")}),borderWidth:{DEFAULT:"1px",0:"0px",2:"2px",4:"4px",8:"8px"},boxShadow:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",DEFAULT:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)",inner:"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",none:"none"},boxShadowColor:({theme:e})=>e("colors"),brightness:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5",200:"2"},caretColor:({theme:e})=>e("colors"),colors:({colors:e})=>({inherit:e.inherit,current:e.current,transparent:e.transparent,black:e.black,white:e.white,slate:e.slate,gray:e.gray,zinc:e.zinc,neutral:e.neutral,stone:e.stone,red:e.red,orange:e.orange,amber:e.amber,yellow:e.yellow,lime:e.lime,green:e.green,emerald:e.emerald,teal:e.teal,cyan:e.cyan,sky:e.sky,blue:e.blue,indigo:e.indigo,violet:e.violet,purple:e.purple,fuchsia:e.fuchsia,pink:e.pink,rose:e.rose}),columns:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},container:{},content:{none:"none"},contrast:{0:"0",50:".5",75:".75",100:"1",125:"1.25",150:"1.5",200:"2"},cursor:{auto:"auto",default:"default",pointer:"pointer",wait:"wait",text:"text",move:"move",help:"help","not-allowed":"not-allowed",none:"none","context-menu":"context-menu",progress:"progress",cell:"cell",crosshair:"crosshair","vertical-text":"vertical-text",alias:"alias",copy:"copy","no-drop":"no-drop",grab:"grab",grabbing:"grabbing","all-scroll":"all-scroll","col-resize":"col-resize","row-resize":"row-resize","n-resize":"n-resize","e-resize":"e-resize","s-resize":"s-resize","w-resize":"w-resize","ne-resize":"ne-resize","nw-resize":"nw-resize","se-resize":"se-resize","sw-resize":"sw-resize","ew-resize":"ew-resize","ns-resize":"ns-resize","nesw-resize":"nesw-resize","nwse-resize":"nwse-resize","zoom-in":"zoom-in","zoom-out":"zoom-out"},divideColor:({theme:e})=>e("borderColor"),divideOpacity:({theme:e})=>e("borderOpacity"),divideWidth:({theme:e})=>e("borderWidth"),dropShadow:{sm:"0 1px 1px rgb(0 0 0 / 0.05)",DEFAULT:["0 1px 2px rgb(0 0 0 / 0.1)","0 1px 1px rgb(0 0 0 / 0.06)"],md:["0 4px 3px rgb(0 0 0 / 0.07)","0 2px 2px rgb(0 0 0 / 0.06)"],lg:["0 10px 8px rgb(0 0 0 / 0.04)","0 4px 3px rgb(0 0 0 / 0.1)"],xl:["0 20px 13px rgb(0 0 0 / 0.03)","0 8px 5px rgb(0 0 0 / 0.08)"],"2xl":"0 25px 25px rgb(0 0 0 / 0.15)",none:"0 0 #0000"},fill:({theme:e})=>({none:"none",...e("colors")}),flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:e})=>({auto:"auto",...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%"}),flexGrow:{0:"0",DEFAULT:"1"},flexShrink:{0:"0",DEFAULT:"1"},fontFamily:{sans:["ui-sans-serif","system-ui","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"','"Noto Color Emoji"'],serif:["ui-serif","Georgia","Cambria",'"Times New Roman"',"Times","serif"],mono:["ui-monospace","SFMono-Regular","Menlo","Monaco","Consolas",'"Liberation Mono"','"Courier New"',"monospace"]},fontSize:{xs:["0.75rem",{lineHeight:"1rem"}],sm:["0.875rem",{lineHeight:"1.25rem"}],base:["1rem",{lineHeight:"1.5rem"}],lg:["1.125rem",{lineHeight:"1.75rem"}],xl:["1.25rem",{lineHeight:"1.75rem"}],"2xl":["1.5rem",{lineHeight:"2rem"}],"3xl":["1.875rem",{lineHeight:"2.25rem"}],"4xl":["2.25rem",{lineHeight:"2.5rem"}],"5xl":["3rem",{lineHeight:"1"}],"6xl":["3.75rem",{lineHeight:"1"}],"7xl":["4.5rem",{lineHeight:"1"}],"8xl":["6rem",{lineHeight:"1"}],"9xl":["8rem",{lineHeight:"1"}]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:({theme:e})=>e("spacing"),gradientColorStops:({theme:e})=>e("colors"),gradientColorStopPositions:{"0%":"0%","5%":"5%","10%":"10%","15%":"15%","20%":"20%","25%":"25%","30%":"30%","35%":"35%","40%":"40%","45%":"45%","50%":"50%","55%":"55%","60%":"60%","65%":"65%","70%":"70%","75%":"75%","80%":"80%","85%":"85%","90%":"90%","95%":"95%","100%":"100%"},grayscale:{0:"0",DEFAULT:"100%"},gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridColumn:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-7":"span 7 / span 7","span-8":"span 8 / span 8","span-9":"span 9 / span 9","span-10":"span 10 / span 10","span-11":"span 11 / span 11","span-12":"span 12 / span 12","span-full":"1 / -1"},gridColumnEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridColumnStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridRow:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-7":"span 7 / span 7","span-8":"span 8 / span 8","span-9":"span 9 / span 9","span-10":"span 10 / span 10","span-11":"span 11 / span 11","span-12":"span 12 / span 12","span-full":"1 / -1"},gridRowEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridRowStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridTemplateColumns:{none:"none",subgrid:"subgrid",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))",7:"repeat(7, minmax(0, 1fr))",8:"repeat(8, minmax(0, 1fr))",9:"repeat(9, minmax(0, 1fr))",10:"repeat(10, minmax(0, 1fr))",11:"repeat(11, minmax(0, 1fr))",12:"repeat(12, minmax(0, 1fr))"},gridTemplateRows:{none:"none",subgrid:"subgrid",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))",7:"repeat(7, minmax(0, 1fr))",8:"repeat(8, minmax(0, 1fr))",9:"repeat(9, minmax(0, 1fr))",10:"repeat(10, minmax(0, 1fr))",11:"repeat(11, minmax(0, 1fr))",12:"repeat(12, minmax(0, 1fr))"},height:({theme:e})=>({auto:"auto",...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%",full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content"}),hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},inset:({theme:e})=>({auto:"auto",...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%"}),invert:{0:"0",DEFAULT:"100%"},keyframes:{spin:{to:{transform:"rotate(360deg)"}},ping:{"75%, 100%":{transform:"scale(2)",opacity:"0"}},pulse:{"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},listStyleType:{none:"none",disc:"disc",decimal:"decimal"},listStyleImage:{none:"none"},margin:({theme:e})=>({auto:"auto",...e("spacing")}),lineClamp:{1:"1",2:"2",3:"3",4:"4",5:"5",6:"6"},maxHeight:({theme:e})=>({...e("spacing"),none:"none",full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content"}),maxWidth:({theme:e,breakpoints:r})=>({...e("spacing"),none:"none",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch",...r(e("screens"))}),minHeight:({theme:e})=>({...e("spacing"),full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content"}),minWidth:({theme:e})=>({...e("spacing"),full:"100%",min:"min-content",max:"max-content",fit:"fit-content"}),objectPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},opacity:{0:"0",5:"0.05",10:"0.1",15:"0.15",20:"0.2",25:"0.25",30:"0.3",35:"0.35",40:"0.4",45:"0.45",50:"0.5",55:"0.55",60:"0.6",65:"0.65",70:"0.7",75:"0.75",80:"0.8",85:"0.85",90:"0.9",95:"0.95",100:"1"},order:{first:"-9999",last:"9999",none:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12"},outlineColor:({theme:e})=>e("colors"),outlineOffset:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},outlineWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},padding:({theme:e})=>e("spacing"),placeholderColor:({theme:e})=>e("colors"),placeholderOpacity:({theme:e})=>e("opacity"),ringColor:({theme:e})=>({DEFAULT:e("colors.blue.500","#3b82f6"),...e("colors")}),ringOffsetColor:({theme:e})=>e("colors"),ringOffsetWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},ringOpacity:({theme:e})=>({DEFAULT:"0.5",...e("opacity")}),ringWidth:{DEFAULT:"3px",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},rotate:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg"},saturate:{0:"0",50:".5",100:"1",150:"1.5",200:"2"},scale:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5"},screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},scrollMargin:({theme:e})=>({...e("spacing")}),scrollPadding:({theme:e})=>e("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg"},space:({theme:e})=>({...e("spacing")}),spacing:{px:"1px",0:"0px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},stroke:({theme:e})=>({none:"none",...e("colors")}),strokeWidth:{0:"0",1:"1",2:"2"},supports:{},data:{},textColor:({theme:e})=>e("colors"),textDecorationColor:({theme:e})=>e("colors"),textDecorationThickness:{auto:"auto","from-font":"from-font",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},textIndent:({theme:e})=>({...e("spacing")}),textOpacity:({theme:e})=>e("opacity"),textUnderlineOffset:{auto:"auto",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},transformOrigin:{center:"center",top:"top","top-right":"top right",right:"right","bottom-right":"bottom right",bottom:"bottom","bottom-left":"bottom left",left:"left","top-left":"top left"},transitionDelay:{0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},transitionDuration:{DEFAULT:"150ms",0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},transitionProperty:{none:"none",all:"all",DEFAULT:"color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter",colors:"color, background-color, border-color, text-decoration-color, fill, stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4, 0, 0.2, 1)",linear:"linear",in:"cubic-bezier(0.4, 0, 1, 1)",out:"cubic-bezier(0, 0, 0.2, 1)","in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},translate:({theme:e})=>({...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%"}),size:({theme:e})=>({auto:"auto",...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",min:"min-content",max:"max-content",fit:"fit-content"}),width:({theme:e})=>({auto:"auto",...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",screen:"100vw",svw:"100svw",lvw:"100lvw",dvw:"100dvw",min:"min-content",max:"max-content",fit:"fit-content"}),willChange:{auto:"auto",scroll:"scroll-position",contents:"contents",transform:"transform"},zIndex:{auto:"auto",0:"0",10:"10",20:"20",30:"30",40:"40",50:"50"}},plugins:[]}));function n(e){return e&&e.__esModule?e:{default:e}}const o=(0,r.cloneDeep)(t.default.theme)}(x)),x}var y=function(){if(b)return u;b=1;let e=v();return u=(e.__esModule?e:{default:e}).default}();const{blue:w,dark:k,green:z,lime:F,magenta:E,orange:T,pink:D,primary:A,purple:U,red:L,teal:O,yellow:S}=r,C={darkMode:["class"],theme:{container:{center:!0,padding:"2rem",screens:{"2xl":"1400px"}},extend:{fontFamily:{...y.fontFamily,sans:["var(--bfc-font-family)","system-ui","sans-serif"],fraunces:["var(--font-fraunces)","serif"],inter:["var(--font-inter)","sans-serif"]},fontWeight:{bold:"700",normal:"400"},colors:{transparent:"transparent",primary:"var(--bfc-primary)",success:{DEFAULT:"var(--bfc-success-bg)",foreground:"var(--bfc-success-text)"},destructive:{DEFAULT:"var(--bfc-destructive-bg)",foreground:"var(--bfc-destructive-text)"},warning:"var(--bfc-warning-bg)",base:{orange:T.DEFAULT,yellow:S.DEFAULT,primary:A.DEFAULT,green:z.DEFAULT,blue:w.DEFAULT,purple:U.DEFAULT,pink:D.DEFAULT,red:L.DEFAULT,lime:F.DEFAULT,teal:O.DEFAULT,magenta:E.DEFAULT},dark:k,orange:T,yellow:S,green:z,blue:w,purple:U,pink:D,red:L,border:"var(--bfc-border)","border-subtle":"var(--bfc-border-subtle)",input:"var(--bfc-input)",ring:"color-mix(in srgb, var(--bfc-primary) 85%, transparent)",background:"var(--bfc-background)",foreground:"var(--bfc-foreground)",feedback:{positive:"var(--bfc-feedback-positive)",negative:"var(--bfc-feedback-negative)"},link:"var(--bfc-link)",surface:{DEFAULT:"var(--bfc-surface)",border:"var(--bfc-surface-border)"},secondary:{DEFAULT:"var(--bfc-secondary)",foreground:"var(--bfc-secondary-foreground)"},muted:{DEFAULT:"var(--bfc-muted)",foreground:"var(--bfc-muted-foreground)"},accent:{DEFAULT:"var(--bfc-accent)",foreground:"var(--bfc-accent-foreground)"},popover:{DEFAULT:"var(--bfc-popover)",foreground:"var(--bfc-foreground)"},card:{DEFAULT:"var(--bfc-card)",foreground:"var(--bfc-card-foreground)"}},textColor:{primary:"var(--bfc-primary-foreground)","primary-foreground":"var(--bfc-primary-foreground)",default:"var(--bfc-text-default)",subtle:"var(--bfc-text-subtle)",subtlest:"var(--bfc-text-subtlest)",success:"var(--bfc-success-text)",destructive:"var(--bfc-destructive-text)",warning:"var(--bfc-warning-text)"},backgroundColor:{success:"var(--bfc-success-bg)",destructive:"var(--bfc-destructive-bg)",warning:"var(--bfc-warning-bg)",surface:"var(--bfc-white)"},borderColor:{success:"var(--bfc-success-border)",destructive:"var(--bfc-destructive-border)",warning:"var(--bfc-warning-border)"},keyframes:{"accordion-down":{from:{height:"0"},to:{height:"var(--radix-accordion-content-height)"}},"accordion-up":{from:{height:"var(--radix-accordion-content-height)"},to:{height:"0"}},sweep:{"0%":{backgroundPosition:"100% center"},"100%":{backgroundPosition:"-100% center"}}},animation:{"accordion-down":"accordion-down 0.2s ease-out","accordion-up":"accordion-up 0.2s ease-out",sweep:"sweep 1.8s linear infinite"},maxWidth:{threadWidth:"1400px"},spacing:{headerHeight:"64px",md:"16px",lg:"24px",xl:"32px"},backgroundImage:{"gradient-yellowfin":"linear-gradient(168deg, rgb(24, 104, 219) 7.35%, rgb(53, 125, 232) 23.69%, rgb(126, 226, 184) 61.42%, rgb(179, 238, 43) 82.59%)","sweep-yellowfin":"linear-gradient(90deg, var(--bfc-v2-color-blue-700) 0%, var(--bfc-v2-color-blue-700) 37%, var(--bfc-v2-color-blue-600) 42%, var(--bfc-v2-color-green-300) 46%, var(--bfc-v2-color-lime-300) 50%, var(--bfc-v2-color-green-300) 54%, var(--bfc-v2-color-blue-600) 58%, var(--bfc-v2-color-blue-700) 63%, var(--bfc-v2-color-blue-700) 100%)"},zIndex:{"above-modal":"9999"},boxShadow:{md:"2px 4px 12px 0 rgba(0,0,0,0.14)","md-invert":"2px 4px 12px 0 rgba(255,255,255,0.14)",brand:"2px 2px 0 0 #0A0A0D","brand-active":"inset 2px 2px 0 0 #262626","brand-dark":"2px 2px 0 0 #FFF","brand-dark-active":"inset 2px 2px 0 0 #FFF","top-soft":"0px -2px 4px 0px rgba(18, 18, 23, 0.05)"},gridTemplateColumns:{12:"repeat(12, minmax(0, 1fr))"}}},plugins:[require("tailwindcss-animate"),require("@tailwindcss/container-queries"),require("tailwindcss-device"),c(function({addBase:e}){e({ul:{listStyleType:"disc"},ol:{listStyleType:"decimal"}})}),c(function({addUtilities:e}){e({...Object.entries({xxl:{fontSize:"2rem",lineHeight:"2.25rem",fontFamily:"var(--bfc-heading-xxl-font-family)"},xl:{fontSize:"1.75rem",lineHeight:"2rem",fontFamily:"var(--bfc-v2-font-family)"},lg:{fontSize:"1.5rem",lineHeight:"1.75rem",fontFamily:"var(--bfc-v2-font-family)"},m:{fontSize:"1.25rem",lineHeight:"1.5rem",fontFamily:"var(--bfc-v2-font-family)"},sm:{fontSize:"1rem",lineHeight:"1.25rem",fontFamily:"var(--bfc-v2-font-family)"},xs:{fontSize:"0.875rem",lineHeight:"1.25rem",fontFamily:"var(--bfc-v2-font-family)"},xxs:{fontSize:"0.75rem",lineHeight:"1rem",fontFamily:"var(--bfc-v2-font-family)"},xxxs:{fontSize:"0.625rem",lineHeight:"0.875rem",fontFamily:"var(--bfc-v2-font-family)"}}).reduce((e,[r,t])=>(e[`.heading-${r}`]={"font-family":t.fontFamily,"font-size":t.fontSize,"font-style":"normal","font-weight":"700","line-height":t.lineHeight},e),{}),...Object.entries({lg:{fontSize:"1rem",lineHeight:"1.5rem"},md:{fontSize:"0.875rem",lineHeight:"1.25rem"},sm:{fontSize:"0.75rem",lineHeight:"1rem"}}).reduce((e,[r,t])=>(e[`.paragraph-${r}`]={"font-family":"var(--bfc-v2-font-family)","font-size":t.fontSize,"font-style":"normal","font-weight":"400","line-height":t.lineHeight},e),{}),".text-subtlest":{fontWeight:"400"}})}),c(function({addUtilities:e}){const t={},n=(e,r,t)=>{const n=[0,90,180,270].map(t=>((e,r)=>`repeating-linear-gradient(${e}deg, ${r}, ${r} 8px, transparent 8px, transparent 16px)`)(t,r.includes(t)?e:"transparent")),o=t?`.custom-dashed-border-${t}`:".custom-dashed-border";return{[o]:{position:"relative",border:"none"},[`${o}::before`]:{content:'""',position:"absolute",inset:"0","background-image":n.join(","),"background-position":"0 0, 0 0, 100% 0, 0 100%","background-size":"1px 100%, 100% 1px, 1px 100%, 100% 1px","background-repeat":"no-repeat","pointer-events":"none","border-radius":"inherit","z-index":"0"}}},o=(e,r)=>{const t={};return Object.assign(t,n(e,[0,90,180,270],r)),Object.assign(t,n(e,[90],r?`t-${r}`:"t")),Object.assign(t,n(e,[180],r?`r-${r}`:"r")),Object.assign(t,n(e,[270],r?`b-${r}`:"b")),Object.assign(t,n(e,[0],r?`l-${r}`:"l")),Object.assign(t,n(e,[0,180],r?`x-${r}`:"x")),Object.assign(t,n(e,[90,270],r?`y-${r}`:"y")),t};Object.assign(t,o("var(--bfc-border)","")),Object.entries(r).forEach(([e,r])=>{Object.entries(r).forEach(([r,n])=>{const a="DEFAULT"===r?e:`${e}-${r}`;Object.assign(t,o(n,a))})}),e(t),e({".custom-dashed-border-hover":{"&::before":{"background-image":"none",border:"1px solid var(--bfc-border)"},"box-shadow":"4px 4px 0 0 var(--bfc-border)"}});const a={border:"1.2px solid transparent",background:"linear-gradient(145.85deg, #1868DB 7.35%, #357DE8 23.69%, #7EE2B8 61.42%, #B4EE2B 82.59%),\n linear-gradient(145.85deg, rgba(180, 238, 43, 0.7) 3.02%, rgba(126, 226, 184, 0.7) 24.19%, rgba(53, 125, 232, 0.7) 61.92%, rgba(24, 104, 219, 0.7) 78.26%)",transition:"all 0.2s ease-in-out","background-origin":"border-box","background-clip":"content-box, border-box"};e({".bg-yellowfin-gradient":{...a},".bg-yellowfin-gradient-reverse":{...a,filter:"brightness(1.02) saturate(1.5) hue-rotate(5deg)",transform:"translateY(-1px)"}})})]};export{C as default};
2
2
  //# sourceMappingURL=tailwind.preset.js.map