PageSourceSearch

https://gabc.org/_next/static/chunks/05rml6dr.vazf.js

js gabc.org collected 2026-10-02 05:50:47 UTC 104,757 bytes, 37 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,224370,e=>{"use strict";var t=e.i(843476),s=e.i(988842);e.s(["AdminDivider",0,({title:e,className:n})=>e?(0,t.jsx)("div",{className:(0,s.classNames)("relative mt-8 mb-8",n),children:(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("div",{className:"w-full flex items-center","aria-hidden":"true",children:(0,t.jsx)("div",{className:"w-full border-t border-tcc-altdark "})}),(0,t.jsx)("div",{className:"relative flex justify-center min-w-72 text-center",children:(0,t.jsxs)("span",{className:"px-2 text-sm text-tcc-basetext/50",children:[e," "]})}),(0,t.jsx)("div",{className:"w-full flex items-center","aria-hidden":"true",children:(0,t.jsx)("div",{className:"w-full border-t border-tcc-altdark"})})]})}):(0,t.jsx)("div",{className:(0,s.classNames)("relative mt-4 mb-4",n),children:(0,t.jsx)("div",{className:"relative inset-0 flex items-center","aria-hidden":"true",children:(0,t.jsx)("div",{className:"w-full border-t border-tcc-altdark"})})})])},436289,e=>{"use strict";var t=e.i(271645);function s(e,t){return null!==e&&null!==t&&"object"==typeof e&&"object"==typeof t&&"id"in e&&"id"in t?e.id===t.id:e===t}e.s(["useByComparator",0,function(e=s){return(0,t.useCallback)((t,s)=>"string"==typeof e?(null==t?void 0:t[e])===(null==s?void 0:s[e]):e(t,s),[e])}])},904016,e=>{"use strict";var t=e.i(271645);let s=t.default.forwardRef(function({children:e,freeze:s},l){let o=n(s,e);return(0,t.isValidElement)(o)?(0,t.cloneElement)(o,{ref:l}):t.default.createElement(t.default.Fragment,null,o)});function n(e,s){let[n,l]=(0,t.useState)(s);return e||n===s||l(s),e?n:s}e.s(["Frozen",0,s,"useFrozenData",0,n])},460973,e=>{"use strict";var t=e.i(175658);let s="/v1/contributor",n=async({page:e,limit:n,search:l,view:o,args:i},r,a)=>(0,t.searchModels)(s,{page:e,limit:n,search:l,view:o,args:i},r,a),l=async(e,n,l)=>(0,t.getModel)(s,e,n,l),o=async(e,n,l)=>(0,t.updateModel)(s,e,n,null,l),i=async(e,n)=>(0,t.duplicateModel)(s,e,null,n),r=async(e,n)=>(0,t.deleteModel)(s,e,null,n),a=async(e,n)=>(0,t.restoreModel)(s,e,null,n),u=async(e,n)=>(0,t.createModel)(s,e,null,n),c=async(e,n,l)=>(0,t.getModelBySlug)(s,e,n,l),d=async(e,n,l,o)=>(0,t.replaceTags)(s,e,n,l,null,o),p=async(e,n)=>(0,t.importModel)(s,e,null,n),h=async(e,n,l,o)=>(0,t.addTags)(s,e,n,l,null,o);e.s(["addContributorTags",0,h,"createContributor",0,u,"deleteContributor",0,r,"duplicateContributor",0,i,"getContributor",0,l,"getContributorBySlug",0,c,"getContributorRevision",0,(e,n)=>(0,t.getRevisions)(s,e,"no-store",n),"importContributor",0,p,"replaceContributors",0,d,"restoreContributor",0,a,"searchContributors",0,n,"updateContributor",0,o])},137701,e=>{"use strict";var t=e.i(65781),s=e.i(460973);e.s(["useAddContributorTags",0,()=>(0,t.useAddTags)(s.addContributorTags),"useBulkUpdateContributor",0,()=>(0,t.useBulkUpdate)(s.updateContributor),"useContributorRevision",0,()=>(0,t.useRevisions)(s.getContributorRevision),"useCreateContributor",0,()=>(0,t.useCreate)(s.createContributor),"useDeleteContributor",0,()=>(0,t.useDelete)(s.deleteContributor),"useDuplicateContributor",0,()=>(0,t.useDuplicate)(s.duplicateContributor),"useImportContributor",0,()=>(0,t.useImport)(s.importContributor),"useReplaceContributors",0,()=>(0,t.useReplaceTags)(s.replaceContributors),"useRestoreContributor",0,()=>(0,t.useRestore)(s.restoreContributor),"useSearchContributors",0,()=>(0,t.useSearch)(s.searchContributors),"useUpdateContributor",0,()=>(0,t.useUpdate)(s.updateContributor)])},581538,e=>{"use strict";var t=e.i(175658);let s="/v1/channel",n=async({page:e,limit:n,search:l,view:o,args:i},r,a)=>(0,t.searchModels)(s,{page:e,limit:n,search:l,view:o,args:i},r,a),l=async(e,n,l)=>(0,t.getModel)(s,e,n,l),o=async(e,n,l)=>(0,t.updateModel)(s,e,n,null,l),i=async(e,n)=>(0,t.duplicateModel)(s,e,null,n),r=async(e,n)=>(0,t.deleteModel)(s,e,null,n),a=async(e,n)=>(0,t.restoreModel)(s,e,null,n),u=async(e,n)=>(0,t.createModel)(s,e,null,n),c=async(e,n,l)=>(0,t.getModelBySlug)(s,e,n,l),d=async(e,n,l,o)=>(0,t.replaceTags)(s,e,n,l,null,o),p=async(e,n)=>(0,t.importModel)(s,e,null,n);e.s(["createChannel",0,u,"deleteChannel",0,r,"duplicateChannel",0,i,"getChannel",0,l,"getChannelBySlug",0,c,"getChannelRevision",0,(e,n)=>(0,t.getRevisions)(s,e,"no-store",n),"importChannel",0,p,"replaceChannels",0,d,"restoreChannel",0,a,"searchChannels",0,n,"updateChannel",0,o])},152519,e=>{"use strict";var t=e.i(65781),s=e.i(581538);e.s(["useBulkUpdateChannel",0,()=>(0,t.useBulkUpdate)(s.updateChannel),"useChannelRevision",0,()=>(0,t.useRevisions)(s.getChannelRevision),"useCreateChannel",0,()=>(0,t.useCreate)(s.createChannel),"useDeleteChannel",0,()=>(0,t.useDelete)(s.deleteChannel),"useDuplicateChannel",0,()=>(0,t.useDuplicate)(s.duplicateChannel),"useGetChannel",0,()=>(0,t.useGet)(s.getChannel),"useReplaceChannels",0,()=>(0,t.useReplaceTags)(s.replaceChannels),"useRestoreChannel",0,()=>(0,t.useRestore)(s.restoreChannel),"useSearchChannels",0,()=>(0,t.useSearch)(s.searchChannels),"useUpdateChannel",0,()=>(0,t.useUpdate)(s.updateChannel)])},826007,e=>{"use strict";var t=e.i(152480),s=e.i(175658);let n="/v1/episode",l=async({page:e,limit:t,search:l,view:o,args:i},r,a)=>(0,s.searchModels)(n,{page:e,limit:t,search:l,view:o,args:i},r,a),o=async(e,t,l)=>(0,s.getModel)(n,e,t,l),i=async(e,t,l)=>(0,s.updateModel)(n,e,t,null,l),r=async(e,t)=>(0,s.duplicateModel)(n,e,null,t),a=async(e,t)=>(0,s.deleteModel)(n,e,null,t),u=async(e,t)=>(0,s.restoreModel)(n,e,null,t),c=async(e,t)=>(0,s.createModel)(n,e,null,t),d=async(e,t,l)=>(0,s.getModelBySlug)(n,e,t,l),p=async(e,t,l,o)=>(0,s.replaceTags)(n,e,t,l,null,o),h=async(e,t)=>(0,s.importModel)(n,e,null,t),m=async(e,s,l)=>{try{let o=[];e?.page&&o.push(`page=${e?.page}`),e?.limit&&o.push(`limit=${e?.limit}`),e?.view&&e?.view!=="all"&&o.push(`view=${e?.view}`),e?.search&&o.push(`search=${e?.search}`),e?.args&&Object.keys(e?.args).map(t=>o.push(`${t}=${e?.args[t]}`));let i=o.join("&"),r=await (0,t.APIGet)(`${t.APIBase}${n}/filters?${i}`,null,s,l.token);return await r.json()}catch(e){(0,t.APIErrorHandler)(e)}};e.s(["createEpisode",0,c,"deleteEpisode",0,a,"duplicateEpisode",0,r,"getEpisode",0,o,"getEpisodeBySlug",0,d,"getEpisodeFilters",0,m,"getEpisodeRevision",0,(e,t)=>(0,s.getRevisions)(n,e,"no-store",t),"importEpisode",0,h,"replaceEpisodes",0,p,"restoreEpisode",0,u,"searchEpisodes",0,l,"updateEpisode",0,i])},318999,e=>{"use strict";var t=e.i(65781),s=e.i(826007),n=e.i(271645),l=e.i(276495);e.s(["useBulkUpdateEpisode",0,()=>(0,t.useBulkUpdate)(s.updateEpisode),"useCreateEpisode",0,()=>(0,t.useCreate)(s.createEpisode),"useDeleteEpisode",0,()=>(0,t.useDelete)(s.deleteEpisode),"useDuplicateEpisode",0,()=>(0,t.useDuplicate)(s.duplicateEpisode),"useEpisodeFilters",0,()=>
1{let[e,t]=(0,n.useState)(!1),[o,i]=(0,n.useState)(null),[r,a]=(0,n.useState)(null),[u,c]=(0,n.useState)(null),[d,p]=(0,n.useState)([]),h=(0,l.usePublicSession)();return{loading:e,runSearch:async({page:e,limit:n,search:l,view:o,args:r},u=null,d="admin")=>{t(!0),a(null);let m=h(),v=await (0,s.getEpisodeFilters)({page:e,limit:n,search:l,view:o,args:r},u,m);return v?.status==="success"?(c("Your info has been updated."),t(!1),p(v?.data)):(i(null),v?.message?a(v.message):v?.error&&a(v?.error),t(!1),c(null)),v},session:o,error:r,message:u,data:d}},"useEpisodeRevision",0,()=>(0,t.useRevisions)(s.getEpisodeRevision),"useGetEpisode",0,()=>(0,t.useGet)(s.getEpisode),"useImportEpisode",0,()=>(0,t.useImport)(s.importEpisode),"useRestoreEpisode",0,()=>(0,t.useRestore)(s.restoreEpisode),"useSearchEpisodes",0,()=>(0,t.useSearch)(s.searchEpisodes),"useUpdateEpisode",0,()=>(0,t.useUpdate)(s.updateEpisode)])},443191,e=>{"use strict";var t=e.i(152480),s=e.i(175658);let n="/v1/series",l=async({page:e,limit:t,search:l,view:o,args:i},r,a)=>(0,s.searchModels)(n,{page:e,limit:t,search:l,view:o,args:i},r,a),o=async(e,t,l)=>(0,s.getModel)(n,e,t,l),i=async(e,t,l)=>(0,s.updateModel)(n,e,t,null,l),r=async(e,t)=>(0,s.duplicateModel)(n,e,null,t),a=async(e,t)=>(0,s.deleteModel)(n,e,null,t),u=async(e,t)=>(0,s.restoreModel)(n,e,null,t),c=async(e,t)=>(0,s.createModel)(n,e,null,t),d=async(e,t,l)=>(0,s.getModelBySlug)(n,e,t,l),p=async(e,t,l,o)=>(0,s.replaceTags)(n,e,t,l,null,o),h=async(e,t)=>(0,s.importModel)(n,e,null,t),m=async(e,s,l)=>{try{let o=[];e?.page&&o.push(`page=${e?.page}`),e?.limit&&o.push(`limit=${e?.limit}`),e?.view&&e?.view!=="all"&&o.push(`view=${e?.view}`),e?.search&&o.push(`search=${e?.search}`),e?.args&&Object.keys(e?.args).map(t=>o.push(`${t}=${e?.args[t]}`));let i=o.join("&"),r=await (0,t.APIGet)(`${t.APIBase}${n}/latest?${i}`,null,s,l.token);return await r.json()}catch(e){(0,t.APIErrorHandler)(e)}};e.s(["createSeries",0,c,"deleteSeries",0,a,"duplicateSeries",0,r,"getSeries",0,o,"getSeriesBySlug",0,d,"getSeriesRevision",0,(e,t)=>(0,s.getRevisions)(n,e,"no-store",t),"importSeries",0,h,"replaceSeries",0,p,"restoreSeries",0,u,"searchLatestSeries",0,m,"searchSeries",0,l,"updateSeries",0,i])},91255,e=>{"use strict";var t=e.i(65781),s=e.i(443191);e.s(["useBulkUpdateSeries",0,()=>(0,t.useBulkUpdate)(s.updateSeries),"useCreateSeries",0,()=>(0,t.useCreate)(s.createSeries),"useDeleteSeries",0,()=>(0,t.useDelete)(s.deleteSeries),"useDuplicateSeries",0,()=>(0,t.useDuplicate)(s.duplicateSeries),"useImportSeries",0,()=>(0,t.useImport)(s.importSeries),"useReplaceSeries",0,()=>(0,t.useReplaceTags)(s.replaceSeries),"useRestoreSeries",0,()=>(0,t.useRestore)(s.restoreSeries),"useSearchLatestSeries",0,()=>(0,t.useSearch)(s.searchLatestSeries),"useSearchSeries",0,()=>(0,t.useSearch)(s.searchSeries),"useSeriesRevision",0,()=>(0,t.useRevisions)(s.getSeriesRevision),"useUpdateSeries",0,()=>(0,t.useUpdate)(s.updateSeries)])},998307,e=>{"use strict";let t,s;var n=e.i(429427),l=e.i(371330),o=e.i(271645),i=e.i(394487),r=e.i(992704),a=e.i(914189),u=e.i(693456),c=e.i(835696),d=e.i(941444),p=e.i(877891),h=e.i(952744),m=e.i(605083),v=e.i(144279),g=e.i(185935),b=e.i(101852),f=e.i(255743),x=e.i(294316),C=e.i(661130),y=e.i(83733),S=e.i(674175),E=e.i(919751),w=e.i(2788),I=e.i(233137),M=e.i(140407),O=e.i(233538),j=e.i(813581),T=e.i(652265),R=e.i(397701),P=e.i(402155),F=e.i(700020),A=e.i(998348),k=e.i(635307),N=e.i(825720),D=e.i(341650),L=Object.defineProperty,B=(e,t,s)=>{let n;return(n="symbol"!=typeof t?t+"":t)in e?L(e,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[n]=s,s},z=((t=z||{})[t.Open=0]="Open",t[t.Closed=1]="Closed",t),_=((s=_||{})[s.OpenPopover=0]="OpenPopover",s[s.ClosePopover=1]="ClosePopover",s[s.SetButton=2]="SetButton",s[s.SetButtonId=3]="SetButtonId",s[s.SetPanel=4]="SetPanel",s[s.SetPanelId=5]="SetPanelId",s);let $={0:e=>0===e.popoverState?e:{...e,popoverState:0,__demoMode:!1},1:e=>1===e.popoverState?e:{...e,popoverState:1,__demoMode:!1},2:(e,t)=>e.button===t.button?e:{...e,button:t.button},3:(e,t)=>
1e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId},4:(e,t)=>e.panel===t.panel?e:{...e,panel:t.panel},5:(e,t)=>e.panelId===t.panelId?e:{...e,panelId:t.panelId}};class H extends N.Machine{constructor(e){super(e),B(this,"actions",{close:()=>this.send({type:1}),refocusableClose:e=>{this.actions.close();let t=e?j.isHTMLElement(e)?e:"current"in e&&j.isHTMLElement(e.current)?e.current:this.state.button:this.state.button;null==t||t.focus()},open:()=>this.send({type:0}),setButtonId:e=>this.send({type:3,buttonId:e}),setButton:e=>this.send({type:2,button:e}),setPanelId:e=>this.send({type:5,panelId:e}),setPanel:e=>this.send({type:4,panel:e})}),B(this,"selectors",{isPortalled:e=>{var t;if(!e.button||!e.panel)return!1;let s=null!=(t=(0,P.getOwnerDocument)(e.button))?t:document;for(let t of s.querySelectorAll("body > *"))if(Number(null==t?void 0:t.contains(e.button))^Number(null==t?void 0:t.contains(e.panel)))return!0;let n=(0,T.getFocusableElements)(s),l=n.indexOf(e.button),o=(l+n.length-1)%n.length,i=(l+1)%n.length,r=n[o],a=n[i];return!e.panel.contains(r)&&!e.panel.contains(a)}});{let e=this.state.id,t=D.stackMachines.get(null);this.on(0,()=>t.actions.push(e)),this.on(1,()=>t.actions.pop(e))}}static new({id:e,__demoMode:t=!1}){return new H({id:e,__demoMode:t,popoverState:+!t,buttons:{current:[]},button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:{current:null},afterPanelSentinel:{current:null},afterButtonSentinel:{current:null}})}reduce(e,t){return(0,R.match)(t.type,$,e,t)}}var W=e.i(526599);let U=(0,o.createContext)(null);function K(e){let t=(0,o.useContext)(U);if(null===t){let t=Error(`<${e} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,K),t}return t}let V=(0,o.createContext)(null);function G(){return(0,o.useContext)(V)}V.displayName="PopoverGroupContext";let q=(0,o.createContext)(null);q.displayName="PopoverPanelContext";let Y=F.RenderFeatures.RenderStrategy|F.RenderFeatures.Static;function J(e,t){let s=(0,o.useId)(),{id:n=`headlessui-popover-backdrop-${s}`,transition:l=!1,...i}=e,r=K("Popover.Backdrop"),u=(0,M.useSlice)(r,(0,o.useCallback)(e=>e.popoverState,[])),[c,d]=(0,o.useState)(null),p=(0,x.useSyncRefs)(t,d),h=(0,I.useOpenClosed)(),[m,v]=(0,y.useTransition)(l,c,null!==h?(h&I.State.Open)===I.State.Open:u===z.Open),g=(0,a.useEvent)(e=>{if((0,O.isDisabledReactIssue7711)(e.currentTarget))return e.preventDefault();r.actions.close()}),b=(0,f.useSlot)({open:u===z.Open}),C={ref:p,id:n,"aria-hidden":!0,onClick:g,...(0,y.transitionDataAttributes)(v)};return(0,F.useRender)()({ourProps:C,theirProps:i,slot:b,defaultTag:"div",features:Y,visible:m,name:"Popover.Backdrop"})}let X=F.RenderFeatures.RenderStrategy|F.RenderFeatures.Static,Q=(0,F.forwardRefWithAs)(function(e,t){var s;let n=(0,o.useId)(),{__demoMode:l=!1,...i}=e,r=function({id:e,__demoMode:t=!1}){let s=(0,o.useMemo)(()=>H.new({id:e,__demoMode:t}),[]);return(0,W.useOnUnmount)(()=>s.dispose()),s}({id:n,__demoMode:l}),c=(0,o.useRef)(null),p=(0,x.useSyncRefs)(t,(0,x.optionalRef)(e=>{c.current=e})),[v,b,C,y,w]=(0,M.useSlice)(r,(0,o.useCallback)(e=>[e.popoverState,e.button,e.panel,e.buttonId,e.panelId],[])),O=(0,m.useRootDocument)(null!=(s=c.current)?s:b),A=(0,d.useLatestValue)(y),N=(0,d.useLatestValue)(w),D=(0,o.useMemo)(()=>({buttonId:A,panelId:N,close:r.actions.close}),[A,N,r]),L=G(),B=null==L?void 0:L.registerPopover,_=(0,a.useEvent)(()=>{var e,t;let s=(0,P.getActiveElement)(null!=(e=c.current)?e:b);return null!=(t=null==L?void 0:L.isFocusWithinPopoverGroup())?t:s&&((null==b?void 0:b.contains(s))||(null==C?void 0:C.contains(s)))});(0,o.useEffect)(()=>null==B?void 0:B(D),[B,D]);let[$,K]=(0,k.useNestedPortals)(),V=(0,g.useMainTreeNode)(b),Y=(0,g.useRootContainers)({mainTreeNode:V,portals:$,defaultContainers:[{get current(){return r.state.button}},{get current(){return r.state.panel}}]});(0,u.useEventListener)(O,"focus",e=>{var t,s,n,l,o,i;e.target!==window&&j.isHTMLorSVGElement(e.target)&&r.state.popoverState===z.Open&&(_()||r.state.button&&r.state.panel&&(Y.contains(e.target)||null!=(s=null==(t=r.state.beforePanelSentinel.current)?void 0:t.contains)&&s.call(t,e.target)||null!=(l=null==(n=r.state.afterPanelSentinel.current)?void 0:n.contains)&&l.call(n,e.target)||null!=(i=null==(o=r.state.afterButtonSentinel.current)?void 0:o.contains)&&i.call(o,e.target)||r.actions.close()))},!0);let J=v===z.Open;
1(0,h.useOutsideClick)(J,Y.resolveContainers,(e,t)=>{r.actions.close(),(0,T.isFocusableElement)(t,T.FocusableMode.Loose)||(e.preventDefault(),null==b||b.focus())});let X=(0,f.useSlot)({open:v===z.Open,close:r.actions.refocusableClose}),Q=(0,M.useSlice)(r,(0,o.useCallback)(e=>(0,R.match)(e.popoverState,{[z.Open]:I.State.Open,[z.Closed]:I.State.Closed}),[])),Z=(0,F.useRender)();return o.default.createElement(g.MainTreeProvider,{node:V},o.default.createElement(E.FloatingProvider,null,o.default.createElement(q.Provider,{value:null},o.default.createElement(U.Provider,{value:r},o.default.createElement(S.CloseProvider,{value:r.actions.refocusableClose},o.default.createElement(I.OpenClosedProvider,{value:Q},o.default.createElement(K,null,Z({ourProps:{ref:p},theirProps:i,slot:X,defaultTag:"div",name:"Popover"}))))))))}),Z=(0,F.forwardRefWithAs)(function(e,t){let s=(0,o.useId)(),{id:r=`headlessui-popover-button-${s}`,disabled:u=!1,autoFocus:c=!1,...d}=e,p=K("Popover.Button"),[h,m,g,b,y,S,I]=(0,M.useSlice)(p,(0,o.useCallback)(e=>[e.popoverState,p.selectors.isPortalled(e),e.button,e.buttonId,e.panel,e.panelId,e.afterButtonSentinel],[])),k=(0,o.useRef)(null),N=`headlessui-focus-sentinel-${(0,o.useId)()}`,D=G(),L=null==D?void 0:D.closeOthers,B=null!==(0,o.useContext)(q);(0,o.useEffect)(()=>{if(!B)return p.actions.setButtonId(r),()=>p.actions.setButtonId(null)},[B,r,p]);let[_]=(0,o.useState)(()=>Symbol()),$=(0,x.useSyncRefs)(k,t,(0,E.useFloatingReference)(),(0,a.useEvent)(e=>{if(!B){if(e)p.state.buttons.current.push(_);else{let e=p.state.buttons.current.indexOf(_);-1!==e&&p.state.buttons.current.splice(e,1)}p.state.buttons.current.length>1&&console.warn("You are already using a <Popover.Button /> but only 1 <Popover.Button /> is supported."),e&&p.actions.setButton(e)}})),H=(0,x.useSyncRefs)(k,t),W=(0,a.useEvent)(e=>{var t,s,n;if(B){if(p.state.popoverState===z.Closed)return;switch(e.key){case A.Keys.Space:case A.Keys.Enter:e.preventDefault(),null==(s=(t=e.target).click)||s.call(t),p.actions.close(),null==(n=p.state.button)||n.focus()}}else switch(e.key){case A.Keys.Space:case A.Keys.Enter:e.preventDefault(),e.stopPropagation(),p.state.popoverState===z.Closed?(null==L||L(p.state.buttonId),p.actions.open()):p.actions.close();break;case A.Keys.Escape:if(p.state.popoverState!==z.Open)return null==L?void 0:L(p.state.buttonId);if(!k.current)return;let l=(0,P.getActiveElement)(k.current);if(l&&!k.current.contains(l))return;e.preventDefault(),e.stopPropagation(),p.actions.close()}}),U=(0,a.useEvent)(e=>{B||e.key===A.Keys.Space&&e.preventDefault()}),V=(0,a.useEvent)(e=>{var t,s;(0,O.isDisabledReactIssue7711)(e.currentTarget)||u||(B?(p.actions.close(),null==(t=p.state.button)||t.focus()):(e.preventDefault(),e.stopPropagation(),p.state.popoverState===z.Closed?(null==L||L(p.state.buttonId),p.actions.open()):p.actions.close(),null==(s=p.state.button)||s.focus()))}),Y=(0,a.useEvent)(e=>{e.preventDefault(),e.stopPropagation()}),{isFocusVisible:J,focusProps:X}=(0,n.useFocusRing)({autoFocus:c}),{isHovered:Q,hoverProps:Z}=(0,l.useHover)({isDisabled:u}),{pressed:ee,pressProps:et}=(0,i.useActivePress)({disabled:u}),es=h===z.Open,en=(0,f.useSlot)({open:es,active:ee||es,disabled:u,hover:Q,focus:J,autofocus:c}),el=(0,v.useResolveButtonType)(e,g),eo=B?(0,F.mergeProps)({ref:H,type:el,onKeyDown:W,onClick:V,disabled:u||void 0,autoFocus:c},X,Z,et):(0,F.mergeProps)({ref:$,id:b,type:el,"aria-expanded":h===z.Open,"aria-controls":y?S:void 0,disabled:u||void 0,autoFocus:c,onKeyDown:W,onKeyUp:U,onClick:V,onMouseDown:Y},X,Z,et),ei=(0,C.useTabDirection)(),er=(0,a.useEvent)(()=>{if(!j.isHTMLElement(p.state.panel))return;let e=p.state.panel;(0,R.match)(ei.current,{[C.Direction.Forwards]:()=>(0,T.focusIn)(e,T.Focus.First),[C.Direction.Backwards]:()=>(0,T.focusIn)(e,T.Focus.Last)})===T.FocusResult.Error&&(0,T.focusIn)((0,T.getFocusableElements)((0,P.getRootNode)(p.state.button)).filter(e=>"true"!==e.dataset.headlessuiFocusGuard),(0,R.match)(ei.current,{[C.Direction.Forwards]:T.Focus.Next,[C.Direction.Backwards]:T.Focus.Previous}),{relativeTo:p.state.button})}),ea=(0,F.useRender)();return o.default.createElement(o.default.Fragment,null,ea({ourProps:eo,theirProps:d,slot:en,defaultTag:"button",name:"Popover.Button"}),es&&!B&&m&&o.default.createElement(w.Hidden,{id:N,ref:I,features:w.HiddenFeatures.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:er}))}),ee=(0,F.forwardRefWithAs)(J),et=(0,F.forwardRefWithAs)(J),es=(0,F.forwardRefWithAs)(function(e,t){let s=(0,o.useId)(),{id:n=`headlessui-popover-panel-${s}`,focus:l=!1,anchor:i,portal:u=!1,modal:d=!1,transition:h=!1,...v}=e,g=K("Popover.Panel"),O=(0,M.useSlice)(g,g.selectors.isPortalled),[j,N,D,L,B]=(0,M.useSlice)(g,(0,o.useCallback)(e=>[e.popoverState,e.button,e.__demoMode,e.beforePanelSentinel,e.afterPanelSentinel],[])),_=`headlessui-focus-sentinel-before-${s}`,$=`headlessui-focus-sentinel-after-${s}`,H=(0,o.useRef)(null),W=(0,E.useResolvedAnchor)(i),[U,V]=(0,E.useFloatingPanel)(W),G=(0,E.useFloatingPanelProps)();W&&(u=!0);let[Y,J]=(0,o.useState)(null),Q=(0,x.useSyncRefs)(H,t,W?U:null,g.actions.setPanel,J),Z=(0,m.useOwnerDocument)(N),ee=(0,m.useOwnerDocument)(H.current);(0,c.useIsoMorphicEffect)(()=>(g.actions.setPanelId(n),()=>g.actions.setPanelId(null)),[n,g]);let et=(0,I.useOpenClosed)(),[es,en]=(0,y.useTransition)(h,Y,null!==et?(et&I.State.Open)===I.State.Open:j===z.Open);(0,p.useOnDisappear)(es,N,g.actions.close),(0,b.useScrollLock)(!D&&d&&es,ee);let el=(0,a.useEvent)(e=>{var t;if(e.key===A.Keys.Escape){if(g.state.popoverState!==z.Open||!H.current)return;let s=(0,P.getActiveElement)(H.current);if(s&&!H.current.contains(s))return;e.preventDefault(),e.stopPropagation(),g.actions.close(),null==(t=g.state.button)||t.focu
1s()}});(0,o.useEffect)(()=>{var t;e.static||j===z.Closed&&(null==(t=e.unmount)||t)&&g.actions.setPanel(null)},[j,e.unmount,e.static,g]),(0,o.useEffect)(()=>{if(D||!l||j!==z.Open||!H.current)return;let e=(0,P.getActiveElement)(H.current);H.current.contains(e)||(0,T.focusIn)(H.current,T.Focus.First)},[D,l,H.current,j]);let eo=(0,f.useSlot)({open:j===z.Open,close:g.actions.refocusableClose}),ei=(0,F.mergeProps)(W?G():{},{ref:Q,id:n,onKeyDown:el,onBlur:l&&j===z.Open?e=>{var t,s,n,l,o;let i=e.relatedTarget;i&&H.current&&(null!=(t=H.current)&&t.contains(i)||(g.actions.close(),(null!=(n=null==(s=L.current)?void 0:s.contains)&&n.call(s,i)||null!=(o=null==(l=B.current)?void 0:l.contains)&&o.call(l,i))&&i.focus({preventScroll:!0})))}:void 0,tabIndex:-1,style:{...v.style,...V,"--button-width":(0,r.useElementSize)(es,N,!0).width},...(0,y.transitionDataAttributes)(en)}),er=(0,C.useTabDirection)(),ea=(0,a.useEvent)(()=>{let e=H.current;e&&(0,R.match)(er.current,{[C.Direction.Forwards]:()=>{var t;(0,T.focusIn)(e,T.Focus.First)===T.FocusResult.Error&&(null==(t=g.state.afterPanelSentinel.current)||t.focus())},[C.Direction.Backwards]:()=>{var e;null==(e=g.state.button)||e.focus({preventScroll:!0})}})}),eu=(0,a.useEvent)(()=>{let e=H.current;e&&(0,R.match)(er.current,{[C.Direction.Forwards]:()=>{var e;if(!g.state.button)return;let t=null!=(e=(0,P.getRootNode)(g.state.button))?e:document.body,s=(0,T.getFocusableElements)(t),n=s.indexOf(g.state.button),l=s.slice(0,n+1),o=[...s.slice(n+1),...l];for(let e of o.slice())if("true"===e.dataset.headlessuiFocusGuard||null!=Y&&Y.contains(e)){let t=o.indexOf(e);-1!==t&&o.splice(t,1)}(0,T.focusIn)(o,T.Focus.First,{sorted:!1})},[C.Direction.Backwards]:()=>{var t;(0,T.focusIn)(e,T.Focus.Previous)===T.FocusResult.Error&&(null==(t=g.state.button)||t.focus())}})}),ec=(0,F.useRender)();return o.default.createElement(I.ResetOpenClosedProvider,null,o.default.createElement(q.Provider,{value:n},o.default.createElement(S.CloseProvider,{value:g.actions.refocusableClose},o.default.createElement(k.Portal,{enabled:!!u&&(e.static||es),ownerDocument:Z},es&&O&&o.default.createElement(w.Hidden,{id:_,ref:L,features:w.HiddenFeatures.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:ea}),ec({ourProps:ei,theirProps:v,slot:eo,defaultTag:"div",features:X,visible:es,name:"Popover.Panel"}),es&&O&&o.default.createElement(w.Hidden,{id:$,ref:B,features:w.HiddenFeatures.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:eu})))))}),en=Object.assign(Q,{Button:Z,Backdrop:et,Overlay:ee,Panel:es,Group:(0,F.forwardRefWithAs)(function(e,t){let s=(0,o.useRef)(null),n=(0,x.useSyncRefs)(s,t),[l,i]=(0,o.useState)([]),r=(0,a.useEvent)(e=>{i(t=>{let s=t.indexOf(e);if(-1!==s){let e=t.slice();return e.splice(s,1),e}return t})}),u=(0,a.useEvent)(e=>(i(t=>[...t,e]),()=>r(e))),c=(0,a.useEvent)(()=>{var e;let t=(0,P.getRootNode)(s.current);if(!t)return!1;let n=(0,P.getActiveElement)(s.current);return!!(null!=(e=s.current)&&e.contains(n))||l.some(e=>{var s,l;return(null==(s=t.getElementById(e.buttonId.current))?void 0:s.contains(n))||(null==(l=t.getElementById(e.panelId.current))?void 0:l.contains(n))})}),d=(0,a.useEvent)(e=>{for(let t of l)t.buttonId.current!==e&&t.close()}),p=(0,o.useMemo)(()=>
1({registerPopover:u,unregisterPopover:r,isFocusWithinPopoverGroup:c,closeOthers:d}),[u,r,c,d]),h=(0,f.useSlot)({}),m=(0,F.useRender)();return o.default.createElement(g.MainTreeProvider,null,o.default.createElement(V.Provider,{value:p},m({ourProps:{ref:n},theirProps:e,slot:h,defaultTag:"div",name:"Popover.Group"})))})});e.s(["Popover",0,en,"PopoverButton",0,Z,"PopoverPanel",0,es],998307)},548748,701124,e=>{"use strict";var t=e.i(843476),s=e.i(271645);let n=e=>{let[t,n]=(0,s.useState)(null),[l,o]=(0,s.useState)(!1),[i,r]=(0,s.useState)(void 0);return(0,s.useLayoutEffect)(()=>{let s;if(!e||!t){o(!1),r(void 0);return}let n=()=>{let e=t.offsetParent;if(!(e instanceof HTMLElement))return;let s=e.getBoundingClientRect(),n=window.innerHeight-s.bottom-8,l=s.top-8,i=t.scrollHeight>n&&l>n,a=Math.max(i?l:n,120);o(i),r(a)},l=0,i=()=>{l||(l=window.requestAnimationFrame(()=>{l=0,n()}))};return n(),window.addEventListener("resize",i),document.addEventListener("scroll",i,!0),"u">typeof ResizeObserver&&(s=new ResizeObserver(i)).observe(t),()=>{l&&window.cancelAnimationFrame(l),window.removeEventListener("resize",i),document.removeEventListener("scroll",i,!0),s?.disconnect()}},[e,t]),{setPanelRef:n,flipUp:l,maxHeight:i}};e.s(["useFlipWhenClipped",0,n],701124);var l=e.i(761978),o=e.i(796440),i=e.i(988842),r=e.i(998307);function a(e,t){return Array.isArray(e)?e.includes(t):e}function u(){let e=(0,s.useRef)(null),[t,n]=(0,s.useState)({width:1,height:1});(0,s.useLayoutEffect)(()=>{let t=()=>{if(e.current){let t;n({width:(t=e.current.getBoundingClientRect()).width,height:t.height})}};window.addEventListener("resize",t,!1);let s=new ResizeObserver(([{contentBoxSize:e}])=>{n({height:e[0].blockSize,width:e[0].inlineSize})});return e.current&&s.observe(e.current),()=>{window.removeEventListener("resize",t,!1),s.disconnect()}},[]);let l=(0,s.useCallback)(()=>{let{left:t=1,right:s=1,top:n=1,bottom:l=1}=e.current?.getBoundingClientRect()??{};return{left:t,right:s,top:n,bottom:l}},[]);return[e,t,l]}function c(e,t,s){return e<t?t:e>s?s:e}var d=new class{convert(e,t){let s=this.toHex("#000000"),n=this.hex2rgb(s),l=this.rgb2hsv(n);return"hex"===e?(s=this.toHex(t),n=this.hex2rgb(s),s.startsWith("rgba")&&(n=this.toRgb(s),s=this.rgb2hex(n)),l=this.rgb2hsv(n)):"rgb"===e?(n=t,s=this.rgb2hex(n),l=this.rgb2hsv(n)):"hsv"===e&&(l=t,n=this.hsv2rgb(l),s=this.rgb2hex(n)),{hex:s,rgb:n,hsv:l}}toHex(e){if(e.startsWith("#")){if(4===e.length||5===e.length)return e=e.split("").map((e,t)=>t?t<4?e+e:"f"===e?void 0:e+e:"#").join("");else if(7===e.length)return e;else if(9===e.length)return e.endsWith("ff")?e.slice(0,7):e}else{let t=document.createElement("canvas").getContext("2d");if(!t)throw Error("2d context not supported or canvas already initialized");return t.fillStyle=e,t.fillStyle}return"#000000"}toRgb(e){let t=e.match(/\d+(\.\d+)?/gu)??[],[s,n,l,o]=Array.from({length:4}).map((e,s)=>c(+(t[s]??(s<3?0:1)),0,s<3?255:1));return{r:s,g:n,b:l,a:o}}toHsv(e){let t=e.match(/\d+(\.\d+)?/gu)??[],[s,n,l,o]=Array.from({length:4}).map((e,s)=>c(+(t[s]??(s<3?0:1)),0,s?s<3?100:1:360));return{h:s,s:n,v:l,a:o}}hex2rgb(e){e=e.slice(1);let[t,s,n,l]=Array.from({length:4}).map((t,s)=>parseInt(e.slice(2*s,2*s+2),16));return{r:t,g:s,b:n,a:l=Number.isNaN(l)?1:l/255}}rgb2hsv({r:e,g:t,b:s,a:n}){e/=255,t/=255,s/=255;let l=Math.max(e,t,s),o=l-Math.min(e,t,s);return{h:o?(l===e?(t-s)/o+6*(t<s):l===t?2+(s-e)/o:4+(e-t)/o)*60:0,s:l?o/l*100:0,v:100*l,a:n}}hsv2rgb({h:e,s:t,v:s,a:n}){t/=100;let l=~~(e/60),o=e/60-l,i=(s/=100)*(1-t),r=s*(1-t*o),a=s*(1-t*(1-o)),u=l%6;return{r:255*[s,r,i,i,a,s][u],g:255*[a,s,s,r,i,i][u],b:255*[i,i,a,s,s,r][u],a:n}}rgb2hex({r:e,g:t,b:s,a:n}){let[l,o,i,r]=[e,t,s,n].map((e,t)=>Math.round(t<3?e:255*e).toString(16).padStart(2,"0"));return"#"+l+o+i+("ff"===r?"":r)}};function p(e){return"touches"in e}var h=(0,s.memo)(({onCoordinateChange:e,children:t,disabled:n})=>{let[l,{width:o,height:i},r]=u(),a=(0,s.useCallback)((t,s=!1)=>{let{left:n,top:l}=r();e(s,c(t.clientX-n,0,o),c(t.clientY-l,0,i))},[o,i,r,e]),d=(0,s.useCallback)(e=>{if(!p(e)&&0!==e.button)return;let t=e=>{a(p(e)?e.touches[0]:e)},s=e=>{a(p(e)?e.changedTouches[0]:e,!0),document.removeEventListener(p(e)?"touchmove":"mousemove",t,!1),document.removeEventListener(p(e)?"touchend":"mou
1seup",s,!1)};t(e),document.addEventListener(p(e)?"touchmove":"mousemove",t,!1),document.addEventListener(p(e)?"touchend":"mouseup",s,!1)},[a]);return s.default.createElement("div",{ref:l,className:"rcp-interactive",onMouseDown:d,onTouchStart:d,"aria-disabled":n},t)}),m=(0,s.memo)(({color:e,disabled:t,onChange:n,onChangeComplete:l})=>{let[o,{width:i}]=u(),r=(0,s.useMemo)(()=>({x:e.hsv.a*i}),[e.hsv.a,i]),a=(0,s.useCallback)((t,s)=>{let o=d.convert("hsv",{...e.hsv,a:s/i});n(o),t&&l?.(o)},[e.hsv,i,n,l]),c=(0,s.useMemo)(()=>[e.rgb.r,e.rgb.g,e.rgb.b].join(" "),[e.rgb.r,e.rgb.g,e.rgb.b]),p=(0,s.useMemo)(()=>[c,e.rgb.a].join(" / "),[c,e.rgb.a]);return s.default.createElement(h,{disabled:t,onCoordinateChange:a},s.default.createElement("div",{ref:o,style:{background:`linear-gradient(to right, rgb(${c} / 0), rgb(${c} / 1)) top left / auto auto,
2                      conic-gradient(#666 0.25turn, #999 0.25turn 0.5turn, #666 0.5turn 0.75turn, #999 0.75turn) top left / 12px 12px
3                      repeat`},className:"rcp-alpha"},s.default.createElement("div",{style:{left:r.x,background:`linear-gradient(to right, rgb(${p}), rgb(${p})) top left / auto auto,
4                        conic-gradient(#666 0.25turn, #999 0.25turn 0.5turn, #666 0.5turn 0.75turn, #999 0.75turn) ${-r.x-4}px 2px / 12px 12px
5                        repeat`},className:"rcp-alpha-cursor"})))});function v(e,t){return Math.round(e*10**t)/10**t}function g({r:e,g:t,b:s,a:n}){let l=[Math.round(e),Math.round(t),Math.round(s)],o=v(n,3);return o<1&&l.push(o),l.join(", ")}function b({h:e,s:t,v:s,a:n}){let l=[`${Math.round(e)}\xb0`,`${Math.round(t)}%`,`${Math.round(s)}%`],o=v(n,3);return o<1&&l.push(o),l.join(", ")}var f=(0,s.memo)(({hideInput:e,color:t,disabled:n,onChange:l,onChangeComplete:o})=>{let[i,r]=(0,s.useState)({hex:{value:t.hex,inputted:!1},rgb:{value:g(t.rgb),inputted:!1},hsv:{value:b(t.hsv),inputted:!1}});(0,s.useEffect)(()=>{i.hex.inputted||r(e=>({...e,hex:{...e.hex,value:t.hex}}))},[i.hex.inputted,t.hex]),(0,s.useEffect)(()=>{i.rgb.inputted||r(e=>({...e,rgb:{...e.rgb,value:g(t.rgb)}}))},[i.rgb.inputted,t.rgb]),(0,s.useEffect)(()=>{i.hsv.inputted||r(e=>({...e,hsv:{...e.hsv,value:b(t.hsv)}}))},[i.hsv.inputted,t.hsv]);let u=(0,s.useCallback)(e=>t=>{let{value:s}=t.target;r(t=>({...t,[e]:{...t[e],value:s}})),"hsv"===e?l(d.convert("hsv",d.toHsv(s))):"rgb"===e?l(d.convert("rgb",d.toRgb(s))):l(d.convert("hex",s))},[l]),c=(0,s.useCallback)(e=>()=>{r(t=>({...t,[e]:{...t[e],inputted:!0}}))},[]),p=(0,s.useCallback)(e=>t=>{let{value:s}=t.target;r(t=>({...t,[e]:{...t[e],inputted:!1}})),"hsv"===e?o?.(d.convert("hsv",d.toHsv(s))):"rgb"===e?o?.(d.convert("rgb",d.toRgb(s))):o?.(d.convert("hex",s))},[o]);return s.default.createElement("div",{className:"rcp-fields"},!a(e,"hex")&&s.default.createElement("div",{className:"rcp-fields-floor"},s.default.createElement("div",{className:"rcp-field"},s.default.createElement("input",{id:"hex",className:"rcp-field-input",readOnly:n,value:i.hex.value,onChange:u("hex"),onFocus:c("hex"),onBlur:p("hex")}),s.default.createElement("label",{htmlFor:"hex",className:"rcp-field-label"},"HEX"))),(!a(e,"rgb")||!a(e,"hsv"))&&s.default.createElement("div",{className:"rcp-fields-floor"},!a(e,"rgb")&&s.default.createElement("div",{className:"rcp-field"},s.default.createElement("input",{id:"rgb",className:"rcp-field-input",readOnly:n,value:i.rgb.value,onChange:u("rgb"),onFocus:c("rgb"),onBlur:p("rgb")}),s.default.createElement("label",{htmlFor:"rgb",className:"rcp-field-label"},"RGB")),!a(e,"hsv")&&s.default.createElement("div",{className:"rcp-field"},s.default.createElement("input",{id:"hsv",className:"rcp-field-input",readOnly:n,value:i.hsv.value,onChange:u("hsv"),onFocus:c("hsv"),onBlur:p("hsv")}),s.default.createElement("label",{htmlFor:"hsv",className:"rcp-field-label"},"HSV"))))}),x=(0,s.memo)(({color:e,disabled:t,onChange:n,onChangeComplete:l})=>{let[o,{width:i}]=u(),r=(0,s.useMemo)(()=>({x:e.hsv.h/360*i}),[e.hsv.h,i]),a=(0,s.useCallback)((t,s)=>{let o=d.convert("hsv",{...e.hsv,h:s/i*360});n(o),t&&l?.(o)},[e.hsv,i,n,l]),c=(0,s.useMemo)(()=>[e.hsv.h,"100% 50%"].join(" "),[e.hsv.h]);return s.default.createElement(h,{disabled:t,onCoordinateChange:a},s.default.createElement("div",{ref:o,className:"rcp-hue"},s.default.createElement("div",{style:{left:r.x,backgroundColor:`hsl(${c})`},className:"rcp-hue-cursor"})))}
5),C=(0,s.memo)(({height:e,color:t,disabled:n,onChange:l,onChangeComplete:o})=>{let[i,{width:r}]=u(),a=(0,s.useMemo)(()=>({x:t.hsv.s/100*r,y:(100-t.hsv.v)/100*e}),[t.hsv.s,t.hsv.v,r,e]),c=(0,s.useCallback)((s,n,i)=>{let a=d.convert("hsv",{...t.hsv,s:n/r*100,v:100-i/e*100});l(a),s&&o?.(a)},[t.hsv,r,e,l,o]),p=(0,s.useMemo)(()=>[t.hsv.h,"100% 50%"].join(" "),[t.hsv.h]),m=(0,s.useMemo)(()=>[t.rgb.r,t.rgb.g,t.rgb.b].join(" "),[t.rgb.r,t.rgb.g,t.rgb.b]);return s.default.createElement(h,{disabled:n,onCoordinateChange:c},s.default.createElement("div",{ref:i,style:{height:e,backgroundColor:`hsl(${p})`},className:"rcp-saturation"},s.default.createElement("div",{style:{left:a.x,top:a.y,backgroundColor:`rgb(${m})`},className:"rcp-saturation-cursor"})))}),y=(0,s.memo)(({height:e=200,hideAlpha:t=!1,hideInput:n=!1,color:l,disabled:o=!1,onChange:i,onChangeComplete:r})=>s.default.createElement("div",{className:"rcp-root rcp"},s.default.createElement(C,{height:e,color:l,disabled:o,onChange:i,onChangeComplete:r}),s.default.createElement("div",{className:"rcp-body"},s.default.createElement("section",{className:"rcp-section"},s.default.createElement(x,{color:l,disabled:o,onChange:i,onChangeComplete:r}),!t&&s.default.createElement(m,{color:l,disabled:o,onChange:i,onChangeComplete:r})),(!a(n,"hex")||!a(n,"rgb")||!a(n,"hsv"))&&s.default.createElement("section",{className:"rcp-section"},s.default.createElement(f,{hideInput:n,color:l,disabled:o,onChange:i,onChangeComplete:r}))))),S=e.i(997053),E=e.i(792032),w=e.i(148797);let I=({value:e,label:n,onChange:l,ref:o})=>
5{let[r,a]=(0,s.useState)(e||"#FFFFFF"),[u,c]=(0,s.useState)(!1),d=(0,s.useCallback)(e=>{let t=/^#([A-Fa-f0-9]{3}){1,2}$|^#([A-Fa-f0-9]{4}){1,2}$/.test(e);return c(!t),t},[]),p=(0,s.useCallback)(e=>{let t=e.trim();e.startsWith("#")||(t=`#${e}`),a(t),d(t)&&l(t)},[l,d]);return(0,s.useImperativeHandle)(o,()=>({resetValue:e=>{a(e)}}),[]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(E.AdminInput,{"aria-invalid":u,className:(0,i.classNames)("text-center",{"text-red-900 ring-1 ring-inset ring-red-300 placeholder:text-red-300 focus:ring-2 focus:ring-inset focus:ring-red-500":u}),value:r,onChange:p}),(0,t.jsx)(w.AdminMiniLabel,{className:"mt-1",children:n})]})},M=({open:e,panelClassName:s,children:l})=>{let{setPanelRef:o,flipUp:a,maxHeight:u}=n(e);return(0,t.jsx)("div",{ref:o,"data-toolbar-owned-control":"true",style:u?{maxHeight:u}:void 0,className:(0,i.classNames)("absolute z-50 right-0 overflow-y-auto",a?"bottom-full mb-2":"top-full mt-2",s),children:(0,t.jsx)(r.PopoverPanel,{"data-toolbar-owned-control":"true","data-color-picker-panel":!0,className:"  border border-tcc-altdark bg-tcc-base p-2 rounded-md min-w-64",children:l})})},O=(0,S.default)(e=>(0,t.jsx)("div",{className:e.className,children:(0,t.jsx)(y,{...e})})).withConfig({displayName:"AdminColorPicker__StyledColorPicker",componentId:"sc-701f63f1-0"})`
6    .rcp-root {
7        --rcp-background-color: transparent;
8        --rcp-field-input-color: inherit;
9        --rcp-field-label-color: inherit;
10        --rcp-field-input-border-color: currentColor;
11    }
12    .rcp-saturation {
13        border-radius: 0.375rem;
14    }
15    .rcp-body {
16        padding-inline: 0.2rem;
17        padding-block-end: 0.5rem;
18    }
19    label.rcp-field-label {
20        text-align: left;
21        font-size: 0.75rem;
22        line-height: 1rem;
23        margin-block-start: 0.25rem;
24        color: rgb(156 163 175 / 1);
25    }
26    .rcp-field-input {
27        border-width: 1px;
28        border-color: rgb(209 213 219 / 1)
29    }
30    .dark & .rcp-field-input {
31        color: white;
32        border-color: rgb(75 85 99 / 1)
33    }
34`;e.s(["AdminColorPicker",0,({value:e,onChange:n,icon:a=null,anchor:u={to:"top left",gap:"4px"},inlinePanel:c=!1,buttonClassName:p="",panelClassName:h="",selected:m=!1})=>{let v=(0,s.useRef)(null),[g,b]=function(e){let[t,n]=(0,s.useState)(d.convert("hex",e));return(0,s.useEffect)(()=>{n(d.convert("hex",e))},[e]),[t,n]}
34(e||"#FFFFFF"),[f,x]=(0,s.useState)(!1),C=(0,s.useRef)(null),y={};e&&(y.backgroundColor=e);let S={};c||(S.anchor=u);let E=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between w-full mb-2",children:[(0,t.jsxs)(l.AdminButtonOutlined,{type:"button",onClick:()=>x(!f),children:[(0,t.jsx)(o.TCCControls,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Show Tools"})]}),(0,t.jsx)(l.AdminButtonOutlined,{type:"button",onClick:()=>{x(!1),n(null)},children:"Clear Color"})]}),(0,t.jsxs)("div",{className:"overflow-hidden rounded-md",children:[(0,t.jsx)(O,{hideInput:!f||["hex"],color:g,onChange:b,onChangeComplete:e=>{n(e.hex),C?.current?.resetValue(e.hex)}}),(0,t.jsx)("div",{className:"px-2 pb-2",children:(0,t.jsx)(I,{ref:C,value:g.hex,label:"HEX",onChange:e=>n(e)})})]})]});return(0,t.jsx)("div",{"data-color-picker":!0,children:(0,t.jsx)(r.Popover,{className:"relative",children:({open:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.PopoverButton,{ref:v,"aria-label":"Open Color Picker","data-toolbar-owned-control":"true","data-color-picker-trigger":!0,className:(0,i.classNames)("w-8 h-8 items-center rounded-md px-3 py-2 text-sm font-semibold shadow-xs ring-1  ring-inset ring-gray-300  bg-tcc-base text-tcc-basetext hover:bg-gray-50 disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none",p,{"border-2":m}),style:y,children:a}),c?(0,t.jsx)(M,{open:e,panelClassName:h,children:E}):(0,t.jsx)(r.PopoverPanel,{"data-toolbar-owned-control":"true","data-color-picker-panel":!0,...S,className:(0,i.classNames)("absolute z-50 bg-tcc-alt  border border-tcc-altdark p-2 rounded-md min-w-64",h),children:E})]})})})},"AdminColorSwatch",0,({selected:e,value:s=null,onClick:n,children:l,className:r,...a})=>{let u=(0,i.classNames)("flex w-8 h-8 items-center rounded-md px-2 text-sm font-semibold shadow-xs text-tcc-basetext ring-1 ring-inset ring-tcc-basetext/20 hover:bg-tcc-basetext/50 disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none",r);e&&(u+=" border-2");let c={backgroundColor:s};return"currentcolor"===s&&(c={}),(0,t.jsxs)("button",{type:"button",className:u,style:c,onClick:()=>{n&&n(s)}
34,...a,children:[l,"currentcolor"===s&&(0,t.jsx)(o.TCCCircleXIcon,{})]})}],548748)},684827,e=>{"use strict";var t=e.i(843476),s=e.i(796440);e.s(["AdminBadge",0,({item:e,onClose:n,onClick:l})=>{let o={};return l&&(o.role="button",o.tabIndex=0,o.onClick=()=>{l&&l(e)}),(0,t.jsxs)("span",{...o,className:"inline-flex items-center gap-x-0.5 rounded-full bg-tcc-alt  px-2 py-1  text-xs font-medium text-tcc-alttext/75 border border-tcc-altdark",children:[e?.name,n&&(0,t.jsxs)("button",{onClick:()=>{n&&n(e)},type:"button",className:"group relative -mr-1 h-3.5 w-3.5 rounded-full opacity-75 hover:opacity-100 hover:bg-tcc-altdark ",children:[(0,t.jsx)("span",{className:"sr-only",children:"Remove"}),(0,t.jsx)(s.TCCCloseIcon,{className:"w-4 h-4"})]})]})}])},42323,762630,687692,e=>{"use strict";let t,s,n,l;var o=e.i(843476),i=e.i(988842),r=e.i(429427),a=e.i(371330),u=e.i(271645),c=e.i(174080);function d(e,t,s){let n,l=s.initialDeps??[];return()=>{var o,i,r,a;let u,c;s.key&&(null==(o=s.debug)?void 0:o.call(s))&&(u=Date.now());let d=e();if(!(d.length!==l.length||d.some((e,t)=>l[t]!==e)))return n;if(l=d,s.key&&(null==(i=s.debug)?void 0:i.call(s))&&(c=Date.now()),n=t(...d),s.key&&(null==(r=s.debug)?void 0:r.call(s))){let e=Math.round((Date.now()-u)*100)/100,t=Math.round((Date.now()-c)*100)/100,n=t/16,l=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${l(t,5)} /${l(e,5)} ms`,`
35            font-size: .6rem;
36            font-weight: bold;
37            color: hsl(${Math.max(0,Math.min(120-120*n,120))}deg 100% 31%);`,null==s?void 0:s.key)}return null==(a=null==s?void 0:s.onChange)||a.call(s,n),n}}function p(e,t){if(void 0!==e)return e;throw Error(`Unexpected undefined${t?`: ${t}`:""}`)}e.i(247167);let h=e=>e,m=e=>{let t=Math.max(e.startIndex-e.overscan,0),s=Math.min(e.endIndex+e.overscan,e.count-1),n=[];for(let e=t;e<=s;e++)n.push(e);return n},v=(e,t)=>{let s=e.scrollElement;if(!s)return;let n=e.targetWindow;if(!n)return;let l=e=>{let{width:s,height:n}=e;t({width:Math.round(s),height:Math.round(n)})};if(l(s.getBoundingClientRect()),!n.ResizeObserver)return()=>{};let o=new n.ResizeObserver(e=>{let t=e[0];if(null==t?void 0:t.borderBoxSize){let e=t.borderBoxSize[0];if(e)return void l({width:e.inlineSize,height:e.blockSize})}l(s.getBoundingClientRect())});return o.observe(s,{box:"border-box"}),()=>{o.unobserve(s)}},g={passive:!0},b="u"<typeof window||"onscrollend"in window,f=(e,t)=>{var s,n;let l,o=e.scrollElement;if(!o)return;let i=e.targetWindow;if(!i)return;let r=0,a=b?()=>void 0:(s=()=>{t(r,!1)},n=e.options.isScrollingResetDelay,function(...e){i.clearTimeout(l),l=i.setTimeout(()=>s.apply(this,e),n)}),u=s=>()=>{r=o[e.options.horizontal?"scrollLeft":"scrollTop"],a(),t(r,s)},c=u(!0),d=u(!1);return d(),o.addEventListener("scroll",c,g),o.addEventListener("scrollend",d,g),()=>{o.removeEventListener("scroll",c),o.removeEventListener("scrollend",d)}},x=(e,t,s)=>{if(null==t?void 0:t.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[s.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[s.options.horizontal?"width":"height"])},C=(e,{adjustments:t=0,behavior:s},n)=>{var l,o;null==(o=null==(l=n.scrollElement)?void 0:l.scrollTo)||o.call(l,{[n.options.horizontal?"left":"top"]:e+t,behavior:s})};class y{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollDirection=null,this.scrollAdjustments=0,this.measureElementCache=new Map,this.observer=(()=>{let e=null,t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{this._measureElement(e.target,e)})}):null);return{disconnect:()=>{var e;return null==(e=t())?void 0:e.disconnect()},observe:e=>{var s;return null==(s=t())?void 0:s.observe(e,{box:"border-box"})},unobserve:e=>{var s;return null==(s=t())?void 0:s.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,s])=>{void 0===s&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:h,rangeExtractor:m,onChange:()=>{},measureElement:x,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,...e}},this.notify=(e,t)=>{var s,n;let{startIndex:l,endIndex:o}=this.range??{startIndex:void 0,endIndex:void 0},i=this.calculateRange();(e||l!==(null==i?void 0:i.startIndex)||o!==(null==i?void 0:i.endIndex))&&(null==(n=(s=this.options).onChange)||n.call(s,this,t))},this.cleanup=()=>
37{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.scrollElement=null},this._didMount=()=>(this.measureElementCache.forEach(this.observer.observe),()=>{this.observer.disconnect(),this.cleanup()}),this._willUpdate=()=>{var e;let t=this.options.getScrollElement();this.scrollElement!==t&&(this.cleanup(),this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this._scrollToOffset(this.scrollOffset,{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.notify(!1,!1)})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.scrollOffset<e?"forward":"backward":null,this.scrollOffset=e;let s=this.isScrolling;this.isScrolling=t,this.notify(s!==t,t)})))},this.getSize=()=>this.scrollRect[this.options.horizontal?"width":"height"],this.getMeasurementOptions=d(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey],(e,t,s,n)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:s,getItemKey:n}),{key:!1}),this.getFurthestMeasurement=(e,t)=>{let s=new Map,n=new Map;for(let l=t-1;l>=0;l--){let t=e[l];if(s.has(t.lane))continue;let o=n.get(t.lane);if(null==o||t.end>o.end?n.set(t.lane,t):t.end<o.end&&s.set(t.lane,!0),s.size===this.options.lanes)break}return n.size===this.options.lanes?Array.from(n.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurements=d(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:s,getItemKey:n},l)=>{let o=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];let i=this.measurementsCache.slice(0,o);for(let r=o;r<e;r++){let e=n(r),o=1===this.options.lanes?i[r-1]:this.getFurthestMeasurement(i,r),a=o?o.end+this.options.gap:t+s,u=l.get(e),c="number"==typeof u?u:this.options.estimateSize(r),d=a+c,p=o?o.lane:r%this.options.lanes;i[r]={index:r,start:a,size:c,end:d,key:e,lane:p}}return this.measurementsCache=i,i},{key:!1,debug:()=>this.options.debug}),this.calculateRange=d(()=>[this.getMeasurements(),this.getSize(),this.scrollOffset],(e,t,s)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:s}){let n=e.length-1,l=S(0,n,t=>e[t].start,s),o=l;for(;o<n&&e[o].end<s+t;)o++;return{startIndex:l,endIndex:o}}({measurements:e,outerSize:t,scrollOffset:s}):null,{key:!1,debug:()=>this.options.debug}),this.getIndexes=d(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(e,t,s,n)=>null===t?[]:e({startIndex:t.startIndex,endIndex:t.endIndex,overscan:s,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,s=e.getAttribute(t);return s?parseInt(s,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this._measureElement=(e,t)=>{let s=this.measurementsCache[this.indexFromElement(e)];if(!s||!e.isConnected)return void this.measureElementCache.forEach((t,s)=>{t===e&&(this.observer.unobserve(e),this.measureElementCache.delete(s))});let n=this.measureElementCache.get(s.key);n!==e&&(n&&this.observer.unobserve(n),this.observer.observe(e),this.measureElementCache.set(s.key,e));let l=this.options.measureElement(e,t,this);this.resizeItem(s,l)},this.resizeItem=(e,t)=>{let s=t-(this.itemSizeCache.get(e.key)??e.size);0!==s&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(e,s,this):e.start<this.scrollOffset+this.scrollAdjustments)&&this._scrollToOffset(this.scrollOffset,{adjustments:this.scrollAdjustments+=s,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(e.index),this.itemSizeCache=new Map(this.itemSizeCache.set(e.key,t)),this.notify(!0,!1))},this.measureElement=e=>{e&&this._measureElement(e,void 0)},this.getVirtualItems=d(()=>[this.getIndexes(),this.getMeasurements()],(e,t)=>{let s=[];for(let n=0,l=e.length;n<l;n++){let l=t[e[n]];s.push(l)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();return p(t[S(0,t.length-1,e=>p(t[e]).start,e)])},this.getOffsetForAlignment=(e,t)=>
37{let s=this.getSize();"auto"===t&&(t=e<=this.scrollOffset?"start":e>=this.scrollOffset+s?"end":"start"),"start"===t||("end"===t?e-=s:"center"===t&&(e-=s/2));let n=this.options.horizontal?"scrollWidth":"scrollHeight";return Math.max(Math.min((this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[n]:this.scrollElement[n]:0)-this.getSize(),e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));let s=p(this.getMeasurements()[e]);if("auto"===t)if(s.end>=this.scrollOffset+this.getSize()-this.options.scrollPaddingEnd)t="end";else{if(!(s.start<=this.scrollOffset+this.options.scrollPaddingStart))return[this.scrollOffset,t];t="start"}let n="end"===t?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(n,t),t]},this.isDynamicMode=()=>this.measureElementCache.size>0,this.cancelScrollToIndex=()=>{null!==this.scrollToIndexTimeoutId&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(e,{align:t="start",behavior:s}={})=>{this.cancelScrollToIndex(),"smooth"===s&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:s})},this.scrollToIndex=(e,{align:t="auto",behavior:s}={})=>{e=Math.max(0,Math.min(e,this.options.count-1)),this.cancelScrollToIndex(),"smooth"===s&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");let[n,l]=this.getOffsetForIndex(e,t);this._scrollToOffset(n,{adjustments:void 0,behavior:s}),"smooth"!==s&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.measureElementCache.has(this.options.getItemKey(e))){let[t]=this.getOffsetForIndex(e,l);1>Math.abs(t-this.scrollOffset)||this.scrollToIndex(e,{align:l,behavior:s})}else this.scrollToIndex(e,{align:l,behavior:s})}))},this.scrollBy=(e,{behavior:t}={})=>{this.cancelScrollToIndex(),"smooth"===t&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.scrollOffset+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{var e;let t=this.getMeasurements();return(0===t.length?this.options.paddingStart:1===this.options.lanes?(null==(e=t[t.length-1])?void 0:e.end)??0:Math.max(...t.slice(-this.options.lanes).map(e=>e.end)))-this.options.scrollMargin+this.options.paddingEnd},this._scrollToOffset=(e,{adjustments:t,behavior:s})=>{this.options.scrollToFn(e,{behavior:s,adjustments:t},this)},this.measure=()=>{var e,t;this.itemSizeCache=new Map,null==(t=(e=this.options).onChange)||t.call(e,this,!1)},this.setOptions(e),this.scrollRect=this.options.initialRect,this.scrollOffset="function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset,this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}),this.notify(!1,!1)}}let S=(e,t,s,n)=>{for(;e<=t;){let l=(e+t)/2|0,o=s(l);if(o<n)e=l+1;else{if(!(o>n))return l;t=l-1}}return e>0?e-1:0},E="u">typeof document?u.useLayoutEffect:u.useEffect;var w=e.i(394487),I=e.i(436289),M=e.i(503269),O=e.i(214520),j=e.i(746725),T=e.i(992704),R=e.i(914189),P=e.i(488374),F=e.i(684653),A=e.i(835696),k=e.i(941444),N=e.i(877891),D=e.i(952744),L=e.i(605083),B=e.i(157138),z=e.i(813581),_=e.i(402155),$=e.i(693456);function H(e){let t=(0,u.useRef)({value:"",selectionStart:null,selectionEnd:null});return(0,$.useEventListener)(e,"blur",e=>{let s=e.target;z.isHTMLInputElement(s)&&(t.current={value:s.value,selectionStart:s.selectionStart,selectionEnd:s.selectionEnd})}),(0,R.useEvent)(()=>{if(!(0,_.isActiveElement)(e)&&z.isHTMLInputElement(e)&&e.isConnected){if(e.focus({preventScroll:!0}),e.value!==t.current.value)e.setSelectionRange(e.value.length,e.value.length);else{let{selectionStart:s,selectionEnd:n}=t.current;null!==s&&null!==n&&e.setSelectionRange(s,n)}t.current={value:"",selectionStart:null,selectionEnd:null}}})}var W=e.i(144279),U=e.i(101852),K=e.i(255743),V=e.i(294316),G=e.i(571616),q=e.i(83733),Y=e.i(340143),J=e.i(833633),X=e.i(601893),Q=e.i(919751),Z=e.i(140721),ee=e.i(904016),et=e.i(942803),es=e.i(233137),en=e.i(341650),el=e.i(140407),eo=e.i(103935),ei=e.i(6
375659),er=e.i(544508),ea=e.i(397701),eu=e.i(309507),ec=e.i(700020),ed=e.i(35889),ep=e.i(998348),eh=e.i(722678),em=e.i(863516),ev=e.i(635307),eg=e.i(825720),eb=e.i(667310),ef=e.i(652265),ex=Object.defineProperty,eC=(e,t,s)=>{let n;return(n="symbol"!=typeof t?t+"":t)in e?ex(e,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[n]=s,s},ey=((t=ey||{})[t.Open=0]="Open",t[t.Closed=1]="Closed",t),eS=((s=eS||{})[s.Single=0]="Single",s[s.Multi=1]="Multi",s),eE=((n=eE||{})[n.Pointer=0]="Pointer",n[n.Focus=1]="Focus",n[n.Other=2]="Other",n),ew=((l=ew||{})[l.OpenCombobox=0]="OpenCombobox",l[l.CloseCombobox=1]="CloseCombobox",l[l.GoToOption=2]="GoToOption",l[l.SetTyping=3]="SetTyping",l[l.RegisterOption=4]="RegisterOption",l[l.UnregisterOption=5]="UnregisterOption",l[l.DefaultToFirstOption=6]="DefaultToFirstOption",l[l.SetActivationTrigger=7]="SetActivationTrigger",l[l.UpdateVirtualConfiguration=8]="UpdateVirtualConfiguration",l[l.SetInputElement=9]="SetInputElement",l[l.SetButtonElement=10]="SetButtonElement",l[l.SetOptionsElement=11]="SetOptionsElement",l[l.MarkInputAsMoved=12]="MarkInputAsMoved",l);function eI(e,t=e=>e){let s=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,n=t(e.options.slice()),l=n.length>0&&null!==n[0].dataRef.current.order?n.sort((e,t)=>e.dataRef.current.order-t.dataRef.current.order):(0,ef.sortByDomNode)(n,e=>e.dataRef.current.domRef.current),o=s?l.indexOf(s):null;return -1===o&&(o=null),{options:l,activeOptionIndex:o}}let eM={1(e){var t;if(null!=(t=e.dataRef.current)&&t.disabled||1===e.comboboxState)return e;let s=e.inputElement?eb.ElementPositionState.Tracked((0,eb.computeVisualPosition)(e.inputElement)):e.inputPositionState;return{...e,activeOptionIndex:null,comboboxState:1,isTyping:!1,activationTrigger:2,inputPositionState:s,__demoMode:!1}},0(e){var t,s;if(null!=(t=e.dataRef.current)&&t.disabled||0===e.comboboxState)return e;if(null!=(s=e.dataRef.current)&&s.value){let t=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(-1!==t)return{...e,activeOptionIndex:t,comboboxState:0,__demoMode:!1,inputPositionState:eb.ElementPositionState.Idle}}return{...e,comboboxState:0,inputPositionState:eb.ElementPositionState.Idle,__demoMode:!1}},3:(e,t)=>e.isTyping===t.isTyping?e:{...e,isTyping:t.isTyping},2(e,t){var s,n,l,o;if(null!=(s=e.dataRef.current)&&s.disabled||e.optionsElement&&!(null!=(n=e.dataRef.current)&&n.optionsPropsRef.current.static)&&1===e.comboboxState)return e;if(e.virtual){let{options:s,disabled:n}=e.virtual,o=t.focus===ei.Focus.Specific?t.idx:(0,ei.calculateActiveIndex)(t,{resolveItems:()=>s,resolveActiveIndex:()=>{var t,l;return null!=(l=null!=(t=e.activeOptionIndex)?t:s.findIndex(e=>!n(e)))?l:null},resolveDisabled:n,resolveId(){throw Error("Function not implemented.")}}),i=null!=(l=t.trigger)?l:2;return e.activeOptionIndex===o&&e.activationTrigger===i?e:{...e,activeOptionIndex:o,activationTrigger:i,isTyping:!1,__demoMode:!1}}let i=eI(e);if(null===i.activeOptionIndex){let e=i.options.findIndex(e=>!e.dataRef.current.disabled);-1!==e&&(i.activeOptionIndex=e)}let r=t.focus===ei.Focus.Specific?t.idx:(0,ei.calculateActiveIndex)(t,{resolveItems:()=>i.options,resolveActiveIndex:()=>i.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled}),a=null!=(o=t.trigger)?o:2;return e.activeOptionIndex===r&&e.activationTrigger===a?e:{...e,...i,isTyping:!1,activeOptionIndex:r,activationTrigger:a,__demoMode:!1}},4:(e,t)=>{var s,n,l,o;if(null!=(s=e.dataRef.current)&&s.virtual)return{...e,options:[...e.options,t.payload]};let i=t.payload,r=eI(e,e=>(e.push(i),e));null===e.activeOptionIndex&&null!=(l=(n=e.dataRef.current).isSelected)&&l.call(n,t.payload.dataRef.current.value)&&(r.activeOptionIndex=r.options.indexOf(i));let a={...e,...r,activationTrigger:2};return null!=(o=e.dataRef.current)&&o.__demoMode&&void 0===e.dataRef.current.value&&(a.activeOptionIndex=0),a},5:(e,t)=>{var s;if(null!=(s=e.dataRef.current)&&s.virtual)return{...e,options:e.options.filter(e=>e.id!==t.id)};let n=eI(e,e=>{let s=e.findIndex(e=>e.id===t.id);return -1!==s&&e.splice(s,1),e});return{...e,...n,activationTrigger:2}},6:(e,t)=>e.defaultToFirstOption===t.value?e:{...e,defaultToFirstOption:t.value},7:(e,t)=>e.activationTrigger===t.trigger?e:{...e,activationTrigger:t.trigger},8:(e,t)=>
37{var s,n;if(null===e.virtual)return{...e,virtual:{options:t.options,disabled:null!=(s=t.disabled)?s:()=>!1}};if(e.virtual.options===t.options&&e.virtual.disabled===t.disabled)return e;let l=e.activeOptionIndex;if(null!==e.activeOptionIndex){let s=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);l=-1!==s?s:null}return{...e,activeOptionIndex:l,virtual:{options:t.options,disabled:null!=(n=t.disabled)?n:()=>!1}}},9:(e,t)=>e.inputElement===t.element?e:{...e,inputElement:t.element},10:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},11:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element},12:e=>"Tracked"!==e.inputPositionState.kind?e:{...e,inputPositionState:eb.ElementPositionState.Moved}};class eO extends eg.Machine{constructor(e){super(e),eC(this,"actions",{onChange:e=>{let{onChange:t,compare:s,mode:n,value:l}=this.state.dataRef.current;return(0,ea.match)(n,{0:()=>null==t?void 0:t(e),1:()=>{let n=l.slice(),o=n.findIndex(t=>s(t,e));return -1===o?n.push(e):n.splice(o,1),null==t?void 0:t(n)}})},registerOption:(e,t)=>(this.send({type:4,payload:{id:e,dataRef:t}}),()=>{this.state.activeOptionIndex===this.state.dataRef.current.calculateIndex(t.current.value)&&this.send({type:6,value:!0}),this.send({type:5,id:e})}),goToOption:(e,t)=>(this.send({type:6,value:!1}),this.send({type:2,...e,trigger:t})),setIsTyping:e=>{this.send({type:3,isTyping:e})},closeCombobox:()=>{var e,t;this.send({type:1}),this.send({type:6,value:!1}),null==(t=(e=this.state.dataRef.current).onClose)||t.call(e)},openCombobox:()=>{this.send({type:0}),this.send({type:6,value:!0})},setActivationTrigger:e=>{this.send({type:7,trigger:e})},selectActiveOption:()=>{let e=this.selectors.activeOptionIndex(this.state);if(null!==e){if(this.actions.setIsTyping(!1),this.state.virtual)this.actions.onChange(this.state.virtual.options[e]);else{let{dataRef:t}=this.state.options[e];this.actions.onChange(t.current.value)}this.actions.goToOption({focus:ei.Focus.Specific,idx:e})}},setInputElement:e=>{this.send({type:9,element:e})},setButtonElement:e=>{this.send({type:10,element:e})},setOptionsElement:e=>{this.send({type:11,element:e})}}),eC(this,"selectors",{activeDescendantId:e=>{var t,s;let n=this.selectors.activeOptionIndex(e);if(null!==n)return e.virtual?null==(s=e.options.find(t=>!t.dataRef.current.disabled&&e.dataRef.current.compare(t.dataRef.current.value,e.virtual.options[n])))?void 0:s.id:null==(t=e.options[n])?void 0:t.id},activeOptionIndex:e=>{if(e.defaultToFirstOption&&null===e.activeOptionIndex&&(e.virtual?e.virtual.options.length>0:e.options.length>0)){if(e.virtual){let{options:t,disabled:s}=e.virtual,n=t.findIndex(e=>{var t;return!(null!=(t=null==s?void 0:s(e))&&t)});if(-1!==n)return n}let t=e.options.findIndex(e=>!e.dataRef.current.disabled);if(-1!==t)return t}return e.activeOptionIndex},activeOption:e=>{var t,s;let n=this.selectors.activeOptionIndex(e);return null===n?null:e.virtual?e.virtual.options[null!=n?n:0]:null!=(s=null==(t=e.options[n])?void 0:t.dataRef.current.value)?s:null},isActive:(e,t,s)=>{var n;let l=this.selectors.activeOptionIndex(e);return null!==l&&(e.virtual?l===e.dataRef.current.calculateIndex(t):(null==(n=e.options[l])?void 0:n.id)===s)},shouldScrollIntoView:(e,t,s)=>!(e.virtual||e.__demoMode||0!==e.comboboxState||0===e.activationTrigger||!this.selectors.isActive(e,t,s)),didInputMove:e=>"Moved"===e.inputPositionState.kind});{let e=this.state.id,t=en.stackMachines.get(null);this.disposables.add(t.on(en.ActionTypes.Push,s=>{t.selectors.isTop(s,e)||0!==this.state.comboboxState||this.actions.closeCombobox()})),this.on(0,()=>t.actions.push(e)),this.on(1,()=>t.actions.pop(e))}this.disposables.group(e=>{this.on(1,t=>{t.inputElement&&(e.dispose(),e.add((0,eb.detectMovement)(t.inputElement,t.inputPositionState,()=>{this.send({type:12})})))})})}static new({id:e,virtual:t=null,__demoMode:s=!1}){var n;return new eO({id:e,dataRef:{current:{}},comboboxState:+!s,isTyping:!1,options:[],virtual:t?{options:t.options,disabled:null!=(n=t.disabled)?n:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:s,inputPositionState:eb.ElementPositionState.Idle})}reduce(e,t){return(0,ea.match)(t.type,eM,e,t)}}var ej=e.i(526599);let eT=(0,u.createContext)(null);function eR(e){let t=(0,u.useContext)(eT);if(null===t){let t=Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,eP),t}return t}function eP({id:e,virtual:t=null,__demoMode:s=!1}){let n=(0,u.useMemo)(()=>eO.new({id:e,virtual:t,__demoMode:s}),[]);return(0,ej.useOnUnmount)(()=>n.dispose()),n}let eF=(0,u.createContext)(null);function eA(e){let t=(0,u.useContext)(eF);if(null===t){let t=Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,eA),t}return t}eF.displayName="ComboboxDataContext";let ek=(0,u.createContext)(null);function eN(e){let t=eR("VirtualProvider"),{options:s}=eA("VirtualProvider").virtual,n=(0,el.useSlice)(t,e=>e.optionsElement),[l,o]=(0,u.useMemo)(()=>
37{if(!n)return[0,0];let e=window.getComputedStyle(n);return[parseFloat(e.paddingBlockStart||e.paddingTop),parseFloat(e.paddingBlockEnd||e.paddingBottom)]},[n]),i=function({useFlushSync:e=!0,...t}){let s=u.useReducer(()=>({}),{})[1],n={...t,onChange:(n,l)=>{var o;e&&l?(0,c.flushSync)(s):s(),null==(o=t.onChange)||o.call(t,n,l)}},[l]=u.useState(()=>new y(n));return l.setOptions(n),E(()=>l._didMount(),[]),E(()=>l._willUpdate()),l}({observeElementRect:v,observeElementOffset:f,scrollToFn:C,...{enabled:0!==s.length,scrollPaddingStart:l,scrollPaddingEnd:o,count:s.length,estimateSize:()=>40,getScrollElement:()=>t.state.optionsElement,overscan:12}}),[r,a]=(0,u.useState)(0);(0,A.useIsoMorphicEffect)(()=>{a(e=>e+1)},[s]);let d=i.getVirtualItems(),p=(0,el.useSlice)(t,e=>e.activationTrigger===eE.Pointer),h=(0,el.useSlice)(t,t.selectors.activeOptionIndex);return 0===d.length?null:u.default.createElement(ek.Provider,{value:i},u.default.createElement("div",{style:{position:"relative",width:"100%",height:`${i.getTotalSize()}px`},ref:e=>{e&&(p||null!==h&&s.length>h&&i.scrollToIndex(h))}},d.map(t=>{var n;return u.default.createElement(u.Fragment,{key:t.key},u.default.cloneElement(null==(n=e.children)?void 0:n.call(e,{...e.slot,option:s[t.index]}),{key:`${r}-${t.key}`,"data-index":t.index,"aria-setsize":s.length,"aria-posinset":t.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${t.start}px)`,overflowAnchor:"none"}}))})))}let eD=u.Fragment,eL=ec.RenderFeatures.RenderStrategy|ec.RenderFeatures.Static,eB=(0,ec.forwardRefWithAs)(function(e,t){let s=(0,u.useId)(),n=(0,X.useDisabled)(),{value:l,defaultValue:o,onChange:i,form:r,name:a,by:c,invalid:d=!1,disabled:p=n||!1,onClose:h,__demoMode:m=!1,multiple:v=!1,immediate:g=!1,virtual:b=null,nullable:f,...x}=e,C=(0,O.useDefaultValue)(o),[y=v?[]:void 0,S]=(0,M.useControllable)(l,i,C),E=eP({id:s,virtual:b,__demoMode:m}),w=(0,u.useRef)({static:!1,hold:!1}),j=(0,I.useByComparator)(c),T=(0,R.useEvent)(e=>b?null===c?b.options.indexOf(e):b.options.findIndex(t=>j(t,e)):E.state.options.findIndex(t=>j(t.dataRef.current.value,e))),P=(0,u.useCallback)(e=>(0,ea.match)(N.mode,{[eS.Multi]:()=>y.some(t=>j(t,e)),[eS.Single]:()=>j(y,e)}),[y]),F=(0,el.useSlice)(E,e=>e.virtual),k=(0,R.useEvent)(()=>null==h?void 0:h()),N=(0,u.useMemo)(()=>({__demoMode:m,immediate:g,optionsPropsRef:w,value:y,defaultValue:C,disabled:p,invalid:d,mode:v?eS.Multi:eS.Single,virtual:b?F:null,onChange:S,isSelected:P,calculateIndex:T,compare:j,onClose:k}),[m,g,w,y,C,p,d,v,b,F,S,P,T,j,k]);(0,A.useIsoMorphicEffect)(()=>{var e;b&&E.send({type:ew.UpdateVirtualConfiguration,options:b.options,disabled:null!=(e=b.disabled)?e:null})},[b,null==b?void 0:b.options,null==b?void 0:b.disabled]),(0,A.useIsoMorphicEffect)(()=>{E.state.dataRef.current=N},[N]);let[L,B,z,_]=(0,el.useSlice)(E,e=>[e.comboboxState,e.buttonElement,e.inputElement,e.optionsElement]),$=en.stackMachines.get(null),H=(0,el.useSlice)($,(0,u.useCallback)(e=>$.selectors.isTop(e,s),[$,s]));(0,D.useOutsideClick)(H,[B,z,_],()=>E.actions.closeCombobox());let W=(0,el.useSlice)(E,E.selectors.activeOptionIndex),U=(0,el.useSlice)(E,E.selectors.activeOption),V=(0,K.useSlot)({open:L===ey.Open,disabled:p,invalid:d,activeIndex:W,activeOption:U,value:y}),[G,q]=(0,eh.useLabels)(),Y=(0,u.useCallback)(()=>{if(void 0!==C)return null==S?void 0:S(C)},[S,C]),J=(0,ec.useRender)();return u.default.createElement(q,{value:G,props:{htmlFor:null==z?void 0:z.id},slot:{open:L===ey.Open,disabled:p}},u.default.createElement(Q.FloatingProvider,null,u.default.createElement(eF.Provider,{value:N},u.default.createElement(eT.Provider,{value:E},u.default.createElement(es.OpenClosedProvider,{value:(0,ea.match)(L,{[ey.Open]:es.State.Open,[ey.Closed]:es.State.Closed})},null!=a&&u.default.createElement(Z.FormFields,{disabled:p,data:null!=y?{[a]:y}:{},form:r,onReset:Y}),J({ourProps:null===t?{}:{ref:t},theirProps:x,slot:V,defaultTag:eD,name:"Combobox"}))))))}),ez=(0,ec.forwardRefWithAs)(function(e,t){let s=eR("Combobox.Button"),n=eA("Combobox.Button"),[l,o]=(0,u.useState)(null),i=(0,V.useSyncRefs)(t,o,s.actions.setButtonElement),d=(0,u.useId)(),{id:p=`headlessui-combobox-button-${d}`,disabled:h=n.disabled||!1,autoFocus:m=!1,...v}=e,[g,b,f]=(0,el.useSlice)(s,e=>[e.comboboxState,e.inputElement,e.optionsElement]),x=H(b),C=g===ey.Open;(0,B.useQuickRelease)(C,{trigger:l,action:(0,u.useCallback)(e=>{if(null!=l&&l.contains(e.target)||null!=b&&b.contains(e.target))return B.Action.Ignore;let t=e.target.closest('[role="option"]:not([data-disabled])');return z.isHTMLElement(t)?B.Action.Select(t):null!=f&&f.contains(e.target)?B.Action.Ignore:B.Action.Close},[l,b,f]),close:s.actions.closeCombobox,select:s.actions.selectActiveOption});let y=(0,R.useEvent)(e=>{switch(e.key){case ep.Keys.Space:case ep.Keys.Enter:e.preventDefault(),e.stopPropagation(),s.state.comboboxState===ey.Closed&&(0,c.flushSync)(()=>s.actions.openCombobox()),x();return;case ep.Keys.ArrowDown:e.preventDefault(),e.stopPropagation(),s.state.comboboxState===ey.Closed&&((0,c.flushSync)(()=>s.actions.openCombobox()),s.state.dataRef.current.value||s.actions.goToOption({focus:ei.Focus.First})),x();return;case ep.Keys.ArrowUp:e.preventDefault(),e.stopPropagation(),s.state.comboboxState===ey.Closed&&((0,c.flushSync)(()=>s.actions.openCombobox()),s.state.dataRef.current.value||s.actions.goToOption({focus:ei.Focus.Last})),x();return;case ep.Keys.Escape:if(s.state.comboboxState!==ey.Open)return;e.preventDefault(),s.state.optionsElement&&!n.optionsPropsRef.current.static&&e.stopPropagation(),(0,c.flushSync)(()=>s.actions.closeCombobox()),x();return;default:return}}),S=(0,P.useHandleToggle)(()=>{s.state.comboboxState===ey.Open?s.actions.closeCombobox():s.actions.openCombobox(),x()}),E=(0,eh.useLabelledBy)([p]),{isFocusVisible:I,focusProps:M}=(0,r.useFocusRing)({autoFocus:m}),{isHovered:O,hoverProps:j}=(0,a.useHover)({isDisabled:h}),{pressed:T,pressProps:F}=(0,w.useActivePress)({disabled:h}),A=(0,K.useSlot)({open:g===ey.Open,active:T||g===ey.Open,disabled:h,invalid:n.invalid,value:n.value,hover:O,focus:I}),k=(0,ec.mergeProps)({ref:i,id:p,type:(0,W.useResolveButtonType)(e,l),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":null==f?void 0:f.id,"aria-expanded":g===ey.Open,"aria-labelledby":E,disabled:h||void 0,autoFocus:m,onKeyDown:y},S,M,j,F);return(0,ec.useRender)()({ourProps:k,theirProps:v,slot:A,defaultTag:"button",name:"Combobox.Button"})}),e_=(0,ec.forwardRefWithAs)(function(e,t){var s,n;let l=eR("Combobox.Input"),o=eA("Combobox.Input"),i=(0,u.useId)(),d=(0,et.useProvidedId)(),{id:p=d||`headlessui-combobox-input-${i}
37`,onChange:h,displayValue:m,disabled:v=o.disabled||!1,autoFocus:g=!1,type:b="text",...f}=e,x=(0,u.useRef)(null),C=(0,V.useSyncRefs)(x,t,(0,Q.useFloatingReference)(),l.actions.setInputElement),[y,S]=(0,el.useSlice)(l,e=>[e.comboboxState,e.isTyping]),E=(0,j.useDisposables)(),w=(0,R.useEvent)(()=>{l.actions.onChange(null),l.state.optionsElement&&(l.state.optionsElement.scrollTop=0),l.actions.goToOption({focus:ei.Focus.Nothing})}),I=(0,u.useMemo)(()=>{var e;return"function"==typeof m&&void 0!==o.value?null!=(e=m(o.value))?e:"":"string"==typeof o.value?o.value:""},[o.value,m]);(0,J.useWatch)(([e,t],[s,n])=>{if(l.state.isTyping)return;let o=x.current;o&&((n===ey.Open&&t===ey.Closed||e!==s)&&(o.value=e),requestAnimationFrame(()=>{if(l.state.isTyping||!o||(0,_.isActiveElement)(o))return;let{selectionStart:e,selectionEnd:t}=o;0===Math.abs((null!=t?t:0)-(null!=e?e:0))&&0===e&&o.setSelectionRange(o.value.length,o.value.length)}))},[I,y,S]),(0,J.useWatch)(([e],[t])=>{if(e===ey.Open&&t===ey.Closed){if(l.state.isTyping)return;let e=x.current;if(!e)return;let t=e.value,{selectionStart:s,selectionEnd:n,selectionDirection:o}=e;e.value="",e.value=t,null!==o?e.setSelectionRange(s,n,o):e.setSelectionRange(s,n)}},[y]);let M=(0,u.useRef)(!1),O=(0,R.useEvent)(()=>{M.current=!0}),T=(0,R.useEvent)(()=>{E.nextFrame(()=>{M.current=!1})}),P=(0,R.useEvent)(e=>{switch(l.actions.setIsTyping(!0),e.key){case ep.Keys.Enter:if(l.state.comboboxState!==ey.Open||M.current)return;if(e.preventDefault(),e.stopPropagation(),null===l.selectors.activeOptionIndex(l.state))return void l.actions.closeCombobox();l.actions.selectActiveOption(),o.mode===eS.Single&&l.actions.closeCombobox();break;case ep.Keys.ArrowDown:return e.preventDefault(),e.stopPropagation(),(0,ea.match)(l.state.comboboxState,{[ey.Open]:()=>l.actions.goToOption({focus:ei.Focus.Next}),[ey.Closed]:()=>l.actions.openCombobox()});case ep.Keys.ArrowUp:return e.preventDefault(),e.stopPropagation(),(0,ea.match)(l.state.comboboxState,{[ey.Open]:()=>l.actions.goToOption({focus:ei.Focus.Previous}),[ey.Closed]:()=>{(0,c.flushSync)(()=>l.actions.openCombobox()),o.value||l.actions.goToOption({focus:ei.Focus.Last})}});case ep.Keys.Home:if(l.state.comboboxState===ey.Closed||e.shiftKey)break;return e.preventDefault(),e.stopPropagation(),l.actions.goToOption({focus:ei.Focus.First});case ep.Keys.PageUp:return e.preventDefault(),e.stopPropagation(),l.actions.goToOption({focus:ei.Focus.First});case ep.Keys.End:if(l.state.comboboxState===ey.Closed||e.shiftKey)break;return e.preventDefault(),e.stopPropagation(),l.actions.goToOption({focus:ei.Focus.Last});case ep.Keys.PageDown:return e.preventDefault(),e.stopPropagation(),l.actions.goToOption({focus:ei.Focus.Last});case ep.Keys.Escape:return l.state.comboboxState!==ey.Open?void 0:(e.preventDefault(),l.state.optionsElement&&!o.optionsPropsRef.current.static&&e.stopPropagation(),o.mode===eS.Single&&null===o.value&&w(),l.actions.closeCombobox());case ep.Keys.Tab:if(l.actions.setIsTyping(!1),l.state.comboboxState!==ey.Open)return;o.mode===eS.Single&&l.state.activationTrigger!==eE.Focus&&l.actions.selectActiveOption(),l.actions.closeCombobox()}}),F=(0,R.useEvent)(e=>{null==h||h(e),o.mode===eS.Single&&""===e.target.value&&w(),l.actions.openCombobox()}),A=(0,R.useEvent)(e=>{var t,s,n;let i=null!=(t=e.relatedTarget)?t:eo.history.find(t=>t!==e.currentTarget);if(!(null!=(s=l.state.optionsElement)&&s.contains(i))&&!(null!=(n=l.state.buttonElement)&&n.contains(i))&&l.state.comboboxState===ey.Open)return e.preventDefault(),o.mode===eS.Single&&null===o.value&&w(),l.actions.closeCombobox()}),k=(0,R.useEvent)(e=>{var t,s,n;let i=null!=(t=e.relatedTarget)?t:eo.history.find(t=>t!==e.currentTarget);null!=(s=l.state.buttonElement)&&s.contains(i)||null!=(n=l.state.optionsElement)&&n.contains(i)||o.disabled||o.immediate&&l.state.comboboxState!==ey.Open&&E.microTask(()=>{(0,c.flushSync)(()=>l.actions.openCombobox()),l.actions.setActivationTrigger(eE.Focus)})}),N=(0,eh.useLabelledBy)(),D=(0,ed.useDescribedBy)(),{isFocused:L,focusProps:B}=(0,r.useFocusRing)({autoFocus:g}),{isHovered:z,hoverProps:$}=(0,a.useHover)({isDisabled:v}),H=(0,el.useSlice)(l,e=>e.optionsElement),W=(0,K.useSlot)({open:y===ey.Open,disabled:v,invalid:o.invalid,hover:z,focus:L,autofocus:g}),U=(0,ec.mergeProps)({ref:C,id:p,role:"combobox",type:b,"aria-controls":null==H?void 0:H.id,"aria-expanded":y===ey.Open,"aria-activedescendant":(0,el.useSlice)(l,l.selectors.activeDescendantId),"aria-labelledby":N,"aria-describedby":D,"aria-autocomplete":"list",defaultValue:null!=(n=null!=(s=e.defaultValue)?s:void 0!==o.defaultValue?null==m?void 0:m(o.defaultValue):null)?n:o.defaultValue,disabled:v||void 0,autoFocus:g,onCompositionStart:O,onCompositionEnd:T,onKeyDown:P,onChange:F,onFocus:k,onBlur:A},B,$);return(0,ec.useRender)()({ourProps:U,theirProps:f,slot:W,defaultTag:"input",name:"Combobox.Input"})}),e$=eh.Label,eH=(0,ec.forwardRefWithAs)(function(e,t){var s,n,l;let o=(0,u.useId)(),{id:i=`headlessui-combobox-options-${o}`,hold:r=!1,anchor:a,portal:c=!1,modal:d=!0,transition:p=!1,...h}=e,m=eR("Combobox.Options"),v=eA("Combobox.Options"),g=(0,Q.useResolvedAnchor)(a);g&&(c=!0);let[b,f]=(0,Q.useFloatingPanel)(g),[x,C]=(0,u.useState)(null),y=(0,Q.useFloatingPanelProps)(),S=(0,V.useSyncRefs)(t,g?b:null,m.actions.setOptionsElement,C),[E,w,I,M,O]=(0,el.useSlice)(m,e=>[e.comboboxState,e.inputElement,e.buttonElement,e.optionsElement,e.activationTrigger]),j=(0,L.useOwnerDocument)(w||I),P=(0,L.useOwnerDocument)(M),k=(0,es.useOpenClosed)(),[D,B]=(0,q.useTransition)(p,x,null!==k?(k&es.State.Open)===es.State.Open:E===ey.Open);(0,N.useOnDisappear)(D,w,m.actions.closeCombobox);let z=!v.__demoMode&&d&&E===ey.Open;(0,U.useScrollLock)(z,P);let _=!v.__demoMode&&d&&E===ey.Open;(0,F.useInertOthers)(_,{allowed:(0,u.useCallback)(()=>[w,I,M],[w,I,M])});let $=!(0,el.useSlice)(m,m.selectors.didInputMove)&&D;(0,A.useIsoMorphicEffect)(()=>{var t;v.optionsPropsRef.current.static=null!=(t=e.static)&&t},[v.optionsPropsRef,e.static]),(0,A.useIsoMorphicEffect)(()=>{v.optionsPropsRef.current.hold=r},[v.optionsPropsRef,r]),(0,Y.useTreeWalker)(E===ey.Open,{container:M,accept:e=>
37"option"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let H=(0,eh.useLabelledBy)([null==I?void 0:I.id]),W=(0,K.useSlot)({open:E===ey.Open,option:void 0}),G=(0,R.useEvent)(()=>{m.actions.setActivationTrigger(eE.Pointer)}),J=(0,R.useEvent)(e=>{e.preventDefault(),m.actions.setActivationTrigger(eE.Pointer)}),X=(0,ec.mergeProps)(g?y():{},{"aria-labelledby":H,role:"listbox","aria-multiselectable":v.mode===eS.Multi||void 0,id:i,ref:S,style:{...h.style,...f,"--input-width":(0,T.useElementSize)(D,w,!0).width,"--button-width":(0,T.useElementSize)(D,I,!0).width},onWheel:O===eE.Pointer?void 0:G,onMouseDown:J,...(0,q.transitionDataAttributes)(B)}),Z=D&&E===ey.Closed&&!e.static,et=(0,ee.useFrozenData)(Z,null==(s=v.virtual)?void 0:s.options),en=(0,ee.useFrozenData)(Z,v.value),eo=(0,u.useCallback)(e=>v.compare(en,e),[v.compare,en]),ei=(0,u.useMemo)(()=>{if(!v.virtual)return v;if(void 0===et)throw Error("Missing `options` in virtual mode");return et!==v.virtual.options?{...v,virtual:{...v.virtual,options:et}}:v},[v,et,null==(n=v.virtual)?void 0:n.options]);v.virtual&&Object.assign(h,{children:u.default.createElement(eF.Provider,{value:ei},u.default.createElement(eN,{slot:W},h.children))});let er=(0,ec.useRender)(),ea=(0,u.useMemo)(()=>v.mode===eS.Multi?v:{...v,isSelected:eo},[v,eo]);return u.default.createElement(ev.Portal,{enabled:!!c&&(e.static||D),ownerDocument:j},u.default.createElement(eF.Provider,{value:ea},er({ourProps:X,theirProps:{...h,children:u.default.createElement(ee.Frozen,{freeze:Z},"function"==typeof h.children?null==(l=h.children)?void 0:l.call(h,W):h.children)},slot:W,defaultTag:"div",features:eL,visible:$,name:"Combobox.Options"}
37)))}),eW=(0,ec.forwardRefWithAs)(function(e,t){var s,n,l;let o=eA("Combobox.Option"),i=eR("Combobox.Option"),r=(0,u.useId)(),{id:a=`headlessui-combobox-option-${r}`,value:c,disabled:d=null!=(l=null==(n=null==(s=o.virtual)?void 0:s.disabled)?void 0:n.call(s,c))&&l,order:p=null,...h}=e,[m]=(0,el.useSlice)(i,e=>[e.inputElement]),v=H(m),g=(0,el.useSlice)(i,(0,u.useCallback)(e=>i.selectors.isActive(e,c,a),[c,a])),b=o.isSelected(c),f=(0,u.useRef)(null),x=(0,k.useLatestValue)({disabled:d,value:c,domRef:f,order:p}),C=(0,u.useContext)(ek),y=(0,V.useSyncRefs)(t,f,C?C.measureElement:null),S=(0,R.useEvent)(()=>{i.actions.setIsTyping(!1),i.actions.onChange(c)});(0,A.useIsoMorphicEffect)(()=>i.actions.registerOption(a,x),[x,a]);let E=(0,el.useSlice)(i,(0,u.useCallback)(e=>i.selectors.shouldScrollIntoView(e,c,a),[c,a]));(0,A.useIsoMorphicEffect)(()=>{if(E)return(0,er.disposables)().requestAnimationFrame(()=>{var e,t;null==(t=null==(e=f.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})},[E,f]);let w=(0,R.useEvent)(e=>{e.preventDefault(),e.button===em.MouseButton.Left&&(d||(S(),(0,eu.isMobile)()||requestAnimationFrame(()=>v()),o.mode===eS.Single&&i.actions.closeCombobox()))}),I=(0,R.useEvent)(()=>{if(d)return i.actions.goToOption({focus:ei.Focus.Nothing});let e=o.calculateIndex(c);i.actions.goToOption({focus:ei.Focus.Specific,idx:e})}),M=(0,G.useTrackedPointer)(),O=(0,R.useEvent)(e=>M.update(e)),j=(0,R.useEvent)(e=>{if(!M.wasMoved(e)||d||g&&i.state.activationTrigger===eE.Pointer)return;let t=o.calculateIndex(c);i.actions.goToOption({focus:ei.Focus.Specific,idx:t},eE.Pointer)}),T=(0,R.useEvent)(e=>{M.wasMoved(e)&&(d||g&&(o.optionsPropsRef.current.hold||i.state.activationTrigger===eE.Pointer&&i.actions.goToOption({focus:ei.Focus.Nothing})))}),P=(0,K.useSlot)({active:g,focus:g,selected:b,disabled:d});return(0,ec.useRender)()({ourProps:{id:a,ref:y,role:"option",tabIndex:!0===d?void 0:-1,"aria-disabled":!0===d||void 0,"aria-selected":b,disabled:void 0,onMouseDown:w,onFocus:I,onPointerEnter:O,onMouseEnter:O,onPointerMove:j,onMouseMove:j,onPointerLeave:T,onMouseLeave:T},theirProps:h,slot:P,defaultTag:"div",name:"Combobox.Option"})}),eU=Object.assign(eB,{Input:e_,Button:ez,Label:e$,Options:eH,Option:eW});e.s(["Combobox",0,eU,"ComboboxButton",0,ez,"ComboboxInput",0,e_,"ComboboxOption",0,eW,"ComboboxOptions",0,eH],762630);var eK=e.i(787906);let eV=u.forwardRef(function({title:e,titleId:t,...s},n){return u.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},s),e?u.createElement("title",{id:t},e):null,u.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"}))});e.s(["ChevronUpDownIcon",0,eV],687692);var eG=e.i(224283);e.s(["AdminComboBox",0,({label:e,value:t,id:s=null,onChange:n,options:l=[],onSearch:r,customRenderer:a,noResultText:c="No Results",noResultAction:d,limit:p=null,disableNoResultsOption:h=!1,onLoadMore:m,hasMore:v=!1,loading:g=!1,className:b})=>{let[f,x]=(0,u.useState)(""),C=(0,u.useRef)(null),y=(0,u.useRef)(!0),S=(0,u.useRef)(!1),E=(0,u.useMemo)(()=>(0,eG.default)(e=>{r(e),S.current=!0},1e3),[r]);(0,u.useEffect)(()=>{if(r){if(y.current){y.current=!1;return}E(f)}},[f]);let w=""===f?l:l.filter(e=>{let t=e?.title?"title":"name";return e[t]?.toLowerCase().includes(f.toLowerCase())}),I={};s&&(I.id=s);let M=f.trim(),O=l.some(e=>{let t=e?.title?"title":"name";return e[t]?.toLowerCase()===M.toLowerCase()}),j=!!d&&!h&&""!==M&&!O,T=S.current&&w?.length===0,R=(0,u.useMemo)(()=>(0,eG.default)(e=>{if(!m||!v||g)return;let t=e.target;t.scrollHeight-t.scrollTop<=t.clientHeight+50&&m()},300),[m,v,g]);return(0,u.useEffect)(()=>()=>{R.cancel()},[R]),(0,o.jsx)(eU,{as:"div",value:t,onChange:e=>{"noresults"===e&&d?d(f):"noresults"===e||n(e),x("")},children:(0,o.jsxs)("div",{className:"relative mt-2 ",children:[!p&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(e_,{placeholder:e,className:`w-full rounded-md border-0 bg-tcc-base text-tcc-basetext py-1.5 pl-3 pr-10 shadow-xs ring-1 ring-inset ring-tcc-basetext/20  focus:ring-2 focus:ring-inset focus:ring-tcc-basetext sm:text-sm sm:leading-6 ${b}`,onChange:e=>x(e.target.value),displayValue:e=>e?.title,...I}),(0,o.jsx)(ez,{className:" absolute inset-y-0 right-0 top-0  flex items-center rounded-r-md px-2 focus:outline-hidden",onClick:()=>{!S.current&&r&&E("")},children:(0,o.jsx)(eV,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})})]}),(w?.length>0||j||T)&&(0,o.jsxs)(eH,{ref:C,onScroll:R,className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-hidden sm:text-sm",children:[w.map((e,t)=>(0,o.jsx)(eW,{value:e,className:(0,i.classNames)("group relative cursor-default select-none py-2 pl-3 pr-9 data-active:bg-basealt-100 data-active:text-basealt-900","data-selected:font-semibold","text-gray-900"),children:a?a(e,!1,!1):(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsx)("span",{className:"block truncate",children:e.title||e.name}),(0,o.jsx)(eK.CheckIcon,{className:"h-5 w-5 hidden group-data-selected:block text-primary-600","aria-hidden":"true"})]})},`${e.id}_${t}`)),g&&(0,o.jsx)("div",{className:"py-2 px-3 text-center text-sm text-gray-500",children:"Loading..."}),v&&!g&&(0,o.jsx)("div",{className:"py-2 px-3 text-center text-sm text-gray-400",children:"Scroll for more"}),(j||T)&&(0,o.jsx)(eW,{value:"noresults",disabled:h,className:(0,i.classNames)("group relative cursor-default select-none py-2 pl-3 pr-9 data-active:bg-basealt-100","text-gray-900"),children:(0,o.jsx)("span",{className:(0,i.classNames)("block truncate p-2",h?"text-gray-400":"cursor-pointer"),children:j&&M?`${c}: ${M}`:c})},"noresults")]})]})})}],42323)},86351,e=>{"use strict";var t=e.i(843476),s=e.i(271645),n=e.i(684827),l=e.i(42323),o=e.i(993675);e.s(["AdminMultiSelect",0,({limit:e=null,id:i="combobox",label:r,value:a,options:u,disabled:c,onChange:d,refresh:p=!1,noResultText:h="Add New",onSearch:m,disableNoResults:v=!1,onLoadMore:g,hasMore:b=!1,loading:f=!1,CustomBadge:x=!1})=>{let C=(0,s.useMemo)(()=>u?u.filter(e=>!a?.filter(t=>e.name===t.name).length):[],[u,a]),y=(0,s.useCallback)(e=>{if(!m)return;let t=C?.filter(t=>{let s=t?.name?.toLowerCase();return s?.indexOf(e.toLowerCase())>=0&&t});t?.length<=0&&m(e)},[m,C]),S=e=>{d([...e])},E=e=>{if(!e)return;let t=a?.filter(t=>e.name!==t.name);[...t],S(t)},w=e=>{let t=[];S(e.filter(e=>!t.includes(String(e.name).toLowerCase())&&(t.push(String(e.name).toLowerCase()),e)))},I=e=>{!e||a?.filter(t=>e.name===t.name).length||w([...a||[],e])},M=e=>{e&&(e?.id?I(e):e?.indexOf(",")>-1?w([...a||[],...(0,o.splitAndTrim)(e,",").map(e=>({name:e}))]):I({name:e}))};return(0,t.jsxs)("div",{"data-multi-select":!0,className:"space-y-2",children:[(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1 mb-1",children:a?.map(e=>{let s=e?.id?e?.id:e?.name;return x?(0,t.jsx)(x,{item:e,children:(0,t.jsx)(n.AdminBadge,{item:e,onClose:E},s)}):(0,t.jsx)(n.AdminBadge,{item:e,onClose:E},s)})}),(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)(l.AdminComboBox,{label:r,noResultText:h,noResultAction:M,onChange:M,onSearch:y,options:C,id:i,limit:e,disableNoResultsOption:v,onLoadMore:g,hasMore:b,loading:f})})]})}])},606830,e=>{"use strict";var t=e.i(843476),s=e.i(271645),n=e.i(86351),l=e.i(667408);e.s(["ModelTagging",0,({modelId:e,value:o,selector:i,onChange:r,label:a,limit:u=null,filters:c,id:d=null,passThroughProps:p={},className:h})=>{let{setNotice:m}
37=(0,l.useProxyContext)(),[v,g]=(0,s.useState)([]),b=(0,s.useRef)(1),f=(0,s.useRef)(""),[x,C]=(0,s.useState)(!1),{runSearch:y,loading:S,total:E}=i(),w=(0,s.useRef)(o);(0,s.useEffect)(()=>{JSON.stringify(w.current)!==JSON.stringify(o)?m("You have unsaved changes. Are you sure you want to leave?"):m(null)},[o,m]);let I=(0,s.useCallback)(async({page:e=1,limit:t=20,search:s=null,view:n="all",args:l={}})=>{try{let o=await y({page:e,limit:t,search:s,view:n,args:l});return o?.data?.rows&&(1===e?g(o.data.rows):g(e=>{let t=new Set(e.map(e=>e.id)),s=o.data.rows.filter(e=>!t.has(e.id));return[...e,...s]})),o}catch(e){console.error("Search failed:",e)}finally{C(!1)}},[y]),M=(0,s.useCallback)(async e=>{let t=c||null;b.current=1,f.current=e,C(!1),g([]),await I({page:1,search:e,args:t})},[c,I]);(0,s.useEffect)(()=>{if(!e)return;let t=c||null;b.current=1,f.current="",I({page:1,args:t})},[e,c]);let O=(0,s.useCallback)(async e=>{r(e);let t=c||null;b.current=1,f.current="",C(!1),g([]),await I({page:1,search:null,args:t})},[r,c,I]),j=(0,s.useCallback)(async()=>{if(x||S)return;let e=b.current+1;b.current=e,C(!0);let t=c||null;try{await I({page:e,search:f.current,args:t})}catch(e){}finally{C(!1)}},[x,S,c,I]),T=!1;u===o?.length&&(T=!0),d&&(p.id=d);let R=v?.length<E;return(0,t.jsx)("div",{"data-model-tagging":!0,className:h,children:(0,t.jsx)(n.AdminMultiSelect,{label:a,value:o,options:v,onChange:O,onSearch:M,limit:T,onLoadMore:j,hasMore:R,loading:S||x,...p})})}])},598614,e=>{"use strict";var t=e.i(843476),s=e.i(548748),n=e.i(148797);let l=({color:e,hex:n,onClick:l,selected:o})=>(0,t.jsx)(s.AdminColorSwatch,{value:n,onClick:()=>l(e),selected:o});e.s(["AdminBrandColorSelector",0,({brand:e,value:o,onChange:i,noText:r=!1,withCurrentColor:a=!1})=>{let u=e=>{i({value:e,type:"brand"})},c=o?.type==="custom"?o?.value:"#FFF";return o?.color?.type==="custom"&&(c=o?.color?.value||c),(0,t.jsxs)("div",{className:"mt-2w-full",children:[(0,t.jsxs)("div",{className:"flex gap-1 flex-wrap",children:[(0,t.jsx)(l,{color:"base",hex:e?.meta?.colorBase,onClick:e=>u(e),selected:o?.type==="brand"&&o?.value==="base"}),(0,t.jsx)(l,{color:"alt",hex:e?.meta?.colorAlt,onClick:e=>u(e),selected:o?.type==="brand"&&o?.value==="alt"}),(0,t.jsx)(l,{color:"primary",hex:e?.meta?.colorPrimary,onClick:e=>u(e),selected:o?.type==="brand"&&o?.value==="primary"}),(0,t.jsx)(l,{color:"secondary",hex:e?.meta?.colorSecondary,onClick:e=>u(e),selected:o?.type==="brand"&&o?.value==="secondary"}),(0,t.jsx)(l,{color:"tertiary",hex:e?.meta?.colorTertiary,onClick:e=>u(e),selected:o?.type==="brand"&&o?.value==="tertiary"}),!0===a&&(0,t.jsx)(l,{color:"currentcolor",hex:"currentcolor",onClick:e=>u(e),selected:o?.type==="brand"&&o?.value==="currentcolor"}),(0,t.jsx)(s.AdminColorPicker,{icon:(0,t.jsx)("p",{className:"text-xs block -ml-[3px]",children:"Bg"}),value:c,onChange:e=>{i({value:e,type:"custom"})}})]}),(0,t.jsx)(n.AdminMiniLabel,{className:"mt-2",children:"Edit this colors in your brand settings."})]})}])},668079,e=>{"use strict";var t=e.i(65781),s=e.i(326358);e.s(["useAddCampusTags",0,()=>(0,t.useAddTags)(s.addCampusTags),"useCampusRevision",0,()=>(0,t.useRevisions)(s.getCampusRevision),"useCreateCampus",0,()=>(0,t.useCreate)(s.createCampus),"useDeleteCampus",0,()=>(0,t.useDelete)(s.deleteCampus),"useDuplicateCampus",0,()=>(0,t.useDuplicate)(s.duplicateCampus),"useReplaceCampuses",0,()=>(0,t.useReplaceTags)(s.replaceCampuses),"useRestoreCampus",0,()=>(0,t.useRestore)(s.restoreCampus),"useSearchCampuses",0,()=>(0,t.useSearch)(s.searchCampuses),"useUpdateCampus",0,()=>(0,t.useUpdate)(s.updateCampus)])},588363,e=>{"use strict";var t=e.i(175658);let s="/v1/episodecategory",n=async({page:e,limit:n,search:l,view:o,args:i},r,a)=>(0,t.searchModels)(s,{page:e,limit:n,search:l,view:o,args:i},r,a),l=async(e,n,l)=>(0,t.updateModel)(s,e,n,null,l),o=async(e,n)=>(0,t.duplicateModel)(s,e,null,n),i=async(e,n)=>(0,t.deleteModel)(s,e,null,n),r=async(e,n)=>(0,t.restoreModel)(s,e,null,n),a=async(e,n)=>(0,t.createModel)(s,e,null,n),u=async(e,n,l,o)=>(0,t.replaceTags)(s,e,n,l,null,o),c=async(e,n,l,o)=>(0,t.addTags)(s,e,n,l,null,o);e.s(["addEpisodeCategoryTags",0,c,"createEpisodeCategory",0,a,"deleteEpisodeCategory",0,i,"duplicateEpisodeCategory",0,o,"getEpisodeCategoryRevision",0,(e,n)=>(0,t.getRevisions)(s,e,"no-store",n),"replaceEpisodeCategories",0,u,"restoreEpisodeCategory",0,r,"searchEpisodeCategories",0,n,"updateEpisodeCategory",0,l])},736426,e=>{"use strict";var t=e.i(65781),s=e.i(588363);e.s(["useAddEpisodeCategoryTags",0,()=>(0,t.useAddTags)(s.addEpisodeCategoryTags),"useCreateEpisodeCategory",0,()=>(0,t.useCreate)(s.createEpisodeCategory),"useDeleteEpisodeCategory",0,()=>(0,t.useDelete)(s.deleteEpisodeCategory),"useReplaceEpisodeCategories",0,()=>(0,t.useReplaceTags)(s.replaceEpisodeCategories),"useRestoreEpisodeCategory",0,()=>(0,t.useRestore)(s.restoreEpisodeCategory),"useSearchEpisodeCategories",0,()=>(0,t.useSearch)(s.searchEpisodeCategories),"useUpdateEpisodeCategory",0,()=>(0,t.useUpdate)(s.updateEpisodeCategory)])},667680,584149,206019,e=>{"use strict";var t=e.i(843476),s=e.i(992917),n=e.i(318999),l=e.i(544081),o=e.i(896486),i=e.i(993675),r=e.i(482820),a=e.i(271645),u=e.i(399168),c=e.i(41963),d=e.i(910838),p=e.i(488691);let h=({item:e,layout:s="default",align:n="default",bg:o=null,textColor:i=null,children:r,showPlaceholder:a=!0,hideImage:h=!1})=>{let m=e?.meta?.excerpt,{account:v}=(0,p.useGlobalContext)(),g={...e,href:`/episode/${e.slug}`,meta:{...e.meta,featureImage:e.meta?.featureImage??e.meta?.wideImage}};return(0,t.jsxs)(l.ThemedCard,{crop:u.ImageCroppingPresets.landscape,item:g,shape:"landscape",layout:s,align:n,bg:o,textColor:i,showPlaceholder:a,hideImage:h,footerChildren:(0,t.jsx)(c.ThemedCardContributors,{contributors:e?.contributors}),children:[e?.publishedAt&&(0,t.jsx)("div",{className:"card-icon-item",children:(0,t.jsx)("span",{suppressHydrationWarning:!0,children:(0,t.jsx)(d.FormattedDate,{date:e?.publishedAt,format:"LL",timezone:v?.timezone,locale:v?.meta?.lang})})}),m&&(0,t.jsx)("p",{className:"card-text",dangerouslySetInnerHTML:{__html:m}}),r]},e.id)};e.s(["EpisodeCard",0,h],584149);var m=e.i(922113),v=e.i(316818);let g=["channels","series","categories","campuses","contributors"],b=(e,t,s)=>{let n=t[e],l=s?.[e]??[];if(n?.length>1){let e=new Set(n.map(e=>e.id)),t=l.filter(t=>e.has(t.id));return t.length>0?t:n.map(e=>({id:e.id,name:e.name??e.id}))}return l},f=({onChange:e,value:s,name:n,label:l,placeholder:o,options:i=[]})=>{if(i?.length===0)return null;let r=[...i].sort((e,t)=>
37(e.name??"").localeCompare(t.name??""));return(0,t.jsxs)(v.ThemedSelect,{onChange:e,value:s,name:n,placeholder:o,children:[(0,t.jsx)("option",{value:"",children:l||`All ${n}`}),r.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]})},x=({presets:e={},onChange:s,values:l,query:o,onSearch:i,config:r,argsMap:u,presetIds:c})=>{let{data:d,runSearch:p}=(0,n.useEpisodeFilters)(),h=(e,t)=>s({...l,[e]:t}),v=(0,a.useMemo)(()=>{let t={};for(let s of g)t[s]=b(s,e,d);return t},[e,d]);return(0,a.useEffect)(()=>{let t={};if(Object.keys(e).length>0)for(let s in u){let n=u[s];e[s]?.length>0&&(t[n]=e[s].map(({id:e})=>e))}p({args:t},null,"member")},c),(0,t.jsxs)("div",{"data-group-controls":!0,children:[r.search.enabled&&(0,t.jsx)(m.ThemedInput,{type:"text",name:"search",placeholder:"Search",value:o,onChange:i}),r.channels.enabled&&(0,t.jsx)(f,{label:r.channels.label,onChange:e=>h("channels",e),value:l.channels,name:"Channel",placeholder:"Channel",options:v.channels}),r.series.enabled&&(0,t.jsx)(f,{label:r.series.label,onChange:e=>h("series",e),value:l.series,name:"Series",placeholder:"Series",options:v.series}),r.categories.enabled&&(0,t.jsx)(f,{label:r.categories.label,onChange:e=>h("categories",e),value:l.categories,name:"Categories",placeholder:"Categories",options:v.categories}),r.campuses.enabled&&(0,t.jsx)(f,{label:r.campuses.label,onChange:e=>h("campuses",e),value:l.campuses,name:"Campuses",placeholder:"Campuses",options:v.campuses}),r.contributors.enabled&&(0,t.jsx)(f,{label:r.contributors.label,onChange:e=>h("contributors",e),value:l.contributors,name:"Contributors",placeholder:"Contributors",options:v.contributors})]})};e.s(["EpisodesDisplayFilters",0,x],206019);let C=e=>"loading"in e&&!0===e.loading,y={categories:"EpisodeCategory",contributors:"Contributor",channels:"Channel",series:"Series",campuses:"Campus"},S={categories:"",contributors:"",channels:"",series:"",campuses:""},E=e=>Object.values(e).filter(Boolean).length>0;e.s(["EpisodesDisplay",0,({limit:e=3,feedType:u,layout:c="default",align:d="default",categories:p=null,contributors:m=null,series:v=null,channels:g=null,campuses:b=null,exclude:f=null,showFilters:w=!1,cardBg:I=null,cardTextColor:M=null,hideFallbackImages:O=!1,hideImage:j=!1,hideSearch:T=!1,hideChannels:R=!1,hideSeries:P=!1,hideCategories:F=!1,hideContributors:A=!1,hideCampuses:k=!1,seriesLabel:N="All Series",channelsLabel:D="All Channels",campusesLabel:L="All Campuses",categoriesLabel:B="All Categories",contributorsLabel:z="All Contributors",loadMore:_=!1,loadMoreButton:$={},showSeriesImage:H=!1,ids:W=null,orderBy:U=null,orderDirection:K=null,showArrows:V,size:G,autoScroll:q,scrollSpeed:Y})=>{let{runSearch:J,loading:X}=(0,n.useSearchEpisodes)(),[Q,Z]=(0,a.useState)(""),[ee,et]=(0,a.useState)([]),[es,en]=(0,a.useState)(0),[el,eo]=(0,a.useState)([]),[ei,er]=(0,a.useState)(0),[ea,eu]=(0,a.useState)(!1),ec=es-el.length,ed=(0,a.useMemo)(()=>({categories:p,contributors:m,series:v,channels:g,campuses:b}),[p,m,v,g,b]),ep=(0,a.useMemo)(()=>Object.values(ed).flatMap(e=>e?.map(({id:e})=>e)||[]),[ed]),eh=(0,a.useMemo)(()=>ee.map(e=>{let t;return C(e)?e:{...e,meta:{...e.meta,featureImage:(t=e?.meta?.wideImage&&Object.keys(e.meta.wideImage).length>0,H&&!t?e?.series?.[0]?.images?.wideImage||e?.series?.[0]?.images?.squareImage||e?.series?.[0]?.images?.bannerImage:e?.meta?.wideImage)}}}),[ee,H]),[em,ev]=(0,a.useState)(S),eg=async(t=0,s=[])=>{if("latest"!==u)return;let n=W?.length>0?W.length:E(em)||Q?999:e,l={include:"series",exclude:["content"]};if(W?.length>0)l.in=W.join(",");else{for(let e in U&&K&&(l.order=JSON.stringify([[U,K]])),y){let t=y[e];!em[e]&&ed[e]?.length>0&&(l[t]=ed[e].map(({id:e})=>e)),em[e]&&(l[t]=[em[e],...l?.[t]||[]])}f?.length>0&&(l.notIn=f.join(","))}let o=Number(n),i=o<9?o:9;ec<Number(n)&&ea&&(i=ec),et([...s,...Array.from({length:i},(e,t)=>({id:`shadow-${t}`,image:"1",loading:!0}))]);let a=await J({page:t/n+1,limit:n,search:Q||"",args:l},null,"member"),c=(0,r.default)(a,"data.rows",[]),d=W?.length>0?[...c].sort((e,t)=>W.indexOf(e.id)-W.indexOf(t.id)):c;eo([...s,...d]),et([...s,...d]),er(t),en(Number.parseInt((0,r.default)(a,"data.count",0))),ea||eu(!0)},eb=(0,i.useDebounce)(eg,500);(0,a.useEffect)(()=>{u&&eg(0,[])},[e,u,em,...ep,...W||[],f?.join(",")||""]);let ef=e=>{Z(e),eb()};(0,a.useEffect)(()=>
37{if(!w){let e=E(em);Q&&ef(""),e&&ev(S)}},[w,Z,ev]);let ex=(0,a.useMemo)(()=>({search:{enabled:!T,label:"Search"},series:{enabled:!P&&ed.series?.length!==1,label:N},channels:{enabled:!R&&ed.channels?.length!==1,label:D},campuses:{enabled:!k&&ed.campuses?.length!==1,label:L},categories:{enabled:!F&&ed.categories?.length!==1,label:B},contributors:{enabled:!A&&ed.contributors?.length!==1,label:z}}),[ed,T,P,N,R,D,k,L,F,B,A,z]),eC=(0,a.useMemo)(()=>({showArrows:V,size:G,autoScroll:q,scrollSpeed:Y}),[V,G,q,Y]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{children:[w&&(0,t.jsx)(x,{presets:ed,presetIds:ep,argsMap:y,onChange:ev,values:em,config:ex,query:Q,onSearch:ef}),(0,t.jsx)(o.ThemedList,{layout:c,align:d,shape:"landscape",editable:!1,items:eh,...eC,children:eh?.map(e=>C(e)?(0,t.jsx)(l.ThemedCard,{crop:{h:"203px"},item:e,shape:"landscape",layout:c,align:d,hideImage:j},e.id):(0,t.jsx)(h,{item:e,layout:c,align:d,bg:I,textColor:M,showPlaceholder:!O,hideImage:j},e.id))})]}),_&&ec>0&&(0,t.jsx)(s.ThemedLoadMoreButton,{color:(0,r.default)($,"color",{}),textColor:(0,r.default)($,"textColor",{}),onClick:()=>{eg(ei+Number(e),el)},disabled:X,children:(0,r.default)($,"text","Load More")})]})}],667680)},150009,7271,215800,e=>{"use strict";e.i(584149);var t=e.i(843476),s=e.i(792032),n=e.i(148797),l=e.i(92023),o=e.i(259073),i=e.i(224370),r=e.i(988842);e.s(["EpisodeFiltersForm",0,({value:e={},onChange:a})=>{let{showFilters:u,hideSearch:c,hideChannels:d,hideSeries:p,hideCategories:h,hideContributors:m,hideCampuses:v,seriesLabel:g,channelsLabel:b,campusesLabel:f,categoriesLabel:x,contributorsLabel:C,channels:y,series:S,categories:E,contributors:w,campuses:I}=e;return(0,t.jsxs)("div",{className:"w-full",children:[(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)(n.AdminLabel,{htmlFor:"showFilters",children:"Show Filters"}),(0,t.jsxs)(l.AdminSelect,{id:"showFilters",value:u,onChange:e=>a("showFilters",e),children:[(0,t.jsx)("option",{value:"",children:"Hide"}),(0,t.jsx)("option",{value:1,children:"Show"})]})]}),u&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.AdminDivider,{}),(0,t.jsx)(n.AdminMiniLabel,{children:"Show or hide Episode filtering controls."}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)(n.AdminLabel,{children:"Show search bar"}),(0,t.jsxs)(l.AdminSelect,{value:!c,onChange:e=>a("hideSearch","true"!==e),children:[(0,t.jsx)("option",{value:!0,children:"Yes"}),(0,t.jsx)("option",{value:!1,children:"No"})]})]}),(0,t.jsxs)("div",{className:"mt-2 flex gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(n.AdminLabel,{children:"Channel"}),(0,t.jsxs)("div",{className:"mt-2 flex gap-3 items-center",children:[(0,t.jsx)(o.AdminToggle,{value:!d,onChange:e=>a("hideChannels",!e)}),(0,t.jsx)(n.AdminMiniLabel,{children:d?"Hide":"Show"})]})]}),(0,t.jsxs)("div",{className:(0,r.classNames)("flex-1",{invisible:d}),children:[(0,t.jsx)(n.AdminLabel,{htmlFor:"episode-filters-channels-label",children:"Label"}),(0,t.jsx)(s.AdminInput,{id:"episode-filters-channels-label",type:"text",placeholder:"All Channels",value:b,onChange:e=>a("channelsLabel",e),"aria-describedby":y?.length===1?"episode-filters-channels-hint":void 0}),y?.length===1&&(0,t.jsx)(n.AdminMiniLabel,{id:"episode-filters-channels-hint",children:"When only one value is scoped, the filter will not show."})]})]}),(0,t.jsxs)("div",{className:"mt-2 flex gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(n.AdminLabel,{children:"Campus"}),(0,t.jsxs)("div",{className:"mt-2 flex gap-3 items-center",children:[(0,t.jsx)(o.AdminToggle,{value:!v,onChange:e=>a("hideCampuses",!e)}),(0,t.jsx)(n.AdminMiniLabel,{children:v?"Hide":"Show"})]})]}),(0,t.jsxs)("div",{className:(0,r.classNames)("flex-1",{invisible:v}),children:[(0,t.jsx)(n.AdminLabel,{htmlFor:"episode-filters-campuses-label",children:"Label"}),(0,t.jsx)(s.AdminInput,{id:"episode-filters-campuses-label",type:"text",placeholder:"All Campuses",value:f,onChange:e=>a("campusesLabel",e),"aria-describedby":I?.length===1?"episode-filters-campuses-hint":void 0}),I?.length===1&&(0,t.jsx)(n.AdminMiniLabel,{id:"episode-filters-campuses-hint",children:"When only one value is scoped, the filter will not show."})]})]}),(0,t.jsxs)("div",{className:"mt-2 flex gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(n.AdminLabel,{children:"Categories"}),(0,t.jsxs)("div",{className:"mt-2 flex gap-3 items-center",children:[(0,t.jsx)(o.AdminToggle,{value:!h,onChange:e=>a("hideCategories",!e)}),(0,t.jsx)(n.AdminMiniLabel,{children:h?"Hide":"Show"})]})]}),(0,t.jsxs)("div",{className:(0,r.classNames)("flex-1",{invisible:h}),children:[(0,t.jsx)(n.AdminLabel,{htmlFor:"episode-filters-categories-label",children:"Label"}),(0,t.jsx)(s.AdminInput,{id:"episode-filters-categories-label",type:"text",placeholder:"All Categories",value:x,onChange:e=>a("categoriesLabel",e),"aria-describedby":E?.length===1?"episode-filters-categories-hint":void 0}),E?.length===1&&(0,t.jsx)(n.AdminMiniLabel,{id:"episode-filters-categories-hint",children:"When only one value is scoped, the filter will not show."})]})]}),(0,t.jsxs)("div",{className:"mt-2 flex gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(n.AdminLabel,{children:"Series"}),(0,t.jsxs)("div",{className:"mt-2 flex gap-3 items-center",children:[(0,t.jsx)(o.AdminToggle,{value:!p,onChange:e=>a("hideSeries",!e)}),(0,t.jsx)(n.AdminMiniLabel,{children:p?"Hide":"Show"})]})]}),(0,t.jsxs)("div",{className:(0,r.classNames)("flex-1",{invisible:p}),children:[(0,t.jsx)(n.AdminLabel,{htmlFor:"episode-filters-series-label",children:"Label"}),(0,t.jsx)(s.AdminInput,{id:"episode-filters-series-label",type:"text",placeholder:"All Series",value:g,onChange:e=>a("seriesLabel",e),"aria-describedby":S?.length===1?"episode-filters-series-hint":void 0}),S?.length===1&&(0,t.jsx)(n.AdminMiniLabel,{id:"episode-filters-series-hint",children:"When only one value is scoped, the filter will not show."})]})]}),(0,t.jsxs)("div",{className:"mt-2 flex gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(n.AdminLabel,{children:"Contributors"}),(0,t.jsxs)("div",{className:"mt-2 flex gap-3 items-center",children:[(0,t.jsx)(o.AdminToggle,{value:!m,onChange:e=>a("hideContributors",!e)}),(0,t.jsx)(n.AdminMiniLabel,{children:m?"Hide":"Show"})]})]}),(0,t.jsxs)("div",{className:(0,r.classNames)("flex-1",{invisible:m}),children:[(0,t.jsx)(n.AdminLabel,{htmlFor:"episode-filters-contributors-label",children:"Label"}),(0,t.jsx)(s.AdminInput,{id:"episode-filters-contributors-label",type:"text",placeholder:"All Contributors",value:C,onChange:e=>a("contributorsLabel",e),"aria-describedby":w?.length===1?"episode-filters-contributors-hint":void 0}),w?.length===1&&(0,t.jsx)(n.AdminMiniLabel,{id:"episode-filters-contributors-hint",children:"When only one value is scoped, the filter will not show."})]})]})]})]})}],7271);var a=e.i(548748),u=e.i(606830),c=e.i(598614),d=e.i(668079),p=e.i(152519),h=e.i(137701),m=e.i(736426),v=e.i(91255);e.s(["EpisodeScopeForm",0,({value:e={},onChange:l,brand:i})=>{let{campuses:r,categories:g,channels:b,contributors:f,limit:x,series:C,loadMore:y,loadMoreButton:S}=e;return(0,t.jsxs)("div",{className:"w-full",children:[(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)(n.AdminLabel,{htmlFor:"limit",children:"Limit"}),(0,t.jsx)(n.AdminMiniLabel,{children:"Set a limit for how many items to display"}),(0,t.jsx)(s.AdminInput,{id:"limit",type:"number",placeholder:"Total number of items to display",value:x,onChange:e=>l("limit",e)})]}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)(n.AdminLabel,{htmlFor:"channels",children:"Channel"}),(0,t.jsx)(u.ModelTagging,{id:"channels",label:"Channels",value:b,selector:p.useSearchChannels,onChange:e=>l("channels",e)})]}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)(n.AdminLabel,{htmlFor:"series",children:"Series"}),(0,t.jsx)(u.ModelTagging,{id:"series",label:"Series",value:C,selector:v.useSearchSeries,onChange:e=>l("series",e)})]}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)(n.AdminLabel,{htmlFor:"categories",children:"Categories"}),(0,t.jsx)(u.ModelTagging,{id:"categories",label:"Categories",value:g,selector:m.useSearchEpisodeCategories,onChange:e=>l("categories",e)})]}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)(n.AdminLabel,{htmlFor:"contributors",children:"Contributor"}),(0,t.jsx)(u.ModelTagging,{id:"contributors",label:"Contributors",value:f,selector:h.useSearchContributors,onChange:e=>l("contributors",e)})]}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)(n.AdminLabel,{htmlFor:"campuses",children:"Campuses"}),(0,t.jsx)(u.ModelTagging,{id:"campuses",label:"Campuses",value:r,selector:d.useSearchCampuses,onChange:e=>l("campuses",e)})]}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)(n.AdminLabel,{children:"Show Load More button"}),(0,t.jsx)(o.AdminToggle,{value:y,onChange:e=>l("loadMore",e)})]}),y&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)(n.AdminLabel,{children:"Button Text"}),(0,t.jsx)(n.AdminMiniLabel,{children:"Text to display on the Load More button."}),(0,t.jsx)(s.AdminInput,{value:S?.text||S?.text===""?S?.text:"Load more",onCh
37ange:e=>l("loadMoreButton.text",e)})]}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)(n.AdminMiniLabel,{children:"Button Color"}),(0,t.jsx)(c.AdminBrandColorSelector,{withCurrentColor:!0,value:S?.color,brand:i,onChange:e=>l("loadMoreButton.color",e)})]}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)(n.AdminMiniLabel,{children:"Button Text Color"}),(0,t.jsx)(a.AdminColorPicker,{icon:(0,t.jsx)("p",{className:"text-xs block -ml-[3px]",children:"Tt"}),value:S?.textColor,onChange:e=>l("loadMoreButton.textColor",e)})]})]})]})}],215800),e.i(667680),e.i(206019),e.s([],150009)}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.