@apolitical/component-library 8.3.10 → 8.3.12-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -162,7 +162,7 @@ ${h}${d?"1.":"-"} ${u}${f?`
162
162
 
163
163
  `.substring(0,i);return n+a+r}function sU(e){return e!=null&&(typeof e=="string"||e.nodeType&&(e.nodeType===1||e.nodeType===9||e.nodeType===11))}var lU={isHistory(e){return Dn(e)&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(e.redos.length===0||Xa.isOperationList(e.redos[0].operations))&&(e.undos.length===0||Xa.isOperationList(e.undos[0].operations))}},gm=new WeakMap,vm=new WeakMap,Gs={isHistoryEditor(e){return lU.isHistory(e.history)&&N.isEditor(e)},isMerging(e){return vm.get(e)},isSaving(e){return gm.get(e)},redo(e){e.redo()},undo(e){e.undo()},withoutMerging(e,t){var n=Gs.isMerging(e);vm.set(e,!1),t(),vm.set(e,n)},withoutSaving(e,t){var n=Gs.isSaving(e);gm.set(e,!1),t(),gm.set(e,n)}},uU=e=>{var t=e,{apply:n}=t;return t.history={undos:[],redos:[]},t.redo=()=>{var{history:r}=t,{redos:i}=r;if(i.length>0){var a=i[i.length-1];a.selectionBefore&&de.setSelection(t,a.selectionBefore),Gs.withoutSaving(t,()=>{N.withoutNormalizing(t,()=>{for(var o of a.operations)t.apply(o)})}),r.redos.pop(),t.writeHistory("undos",a)}},t.undo=()=>{var{history:r}=t,{undos:i}=r;if(i.length>0){var a=i[i.length-1];Gs.withoutSaving(t,()=>{N.withoutNormalizing(t,()=>{var o=a.operations.map(Xa.inverse).reverse();for(var s of o)t.apply(s);a.selectionBefore&&de.setSelection(t,a.selectionBefore)})}),t.writeHistory("redos",a),r.undos.pop()}},t.apply=r=>{var{operations:i,history:a}=t,{undos:o}=a,s=o[o.length-1],l=s&&s.operations[s.operations.length-1],u=Gs.isSaving(t),c=Gs.isMerging(t);if(u==null&&(u=dU(r)),u){if(c==null&&(s==null?c=!1:i.length!==0?c=!0:c=cU(r,l)),s&&c)s.operations.push(r);else{var d={operations:[r],selectionBefore:t.selection};t.writeHistory("undos",d)}for(;o.length>100;)o.shift();a.redos=[]}n(r)},t.writeHistory=(r,i)=>{t.history[r].push(i)},t},cU=(e,t)=>!!(t&&e.type==="insert_text"&&t.type==="insert_text"&&e.offset===t.offset+t.text.length&&K.equals(e.path,t.path)||t&&e.type==="remove_text"&&t.type==="remove_text"&&e.offset+e.text.length===t.offset&&K.equals(e.path,t.path)),dU=(e,t)=>e.type!=="set_selection";const fU=(e,t)=>{const{apply:n}=e;try{e.apply=r=>{if(r.type==="remove_node"&&"type"in r.node&&r.node.type===ae.link){const i=r.node;if(i.link){const a=new CustomEvent("linkRemoved",{detail:{url:i.link}});window.dispatchEvent(a)}}n(r)}}catch(r){const i=r.message;t(`Error in withLinkRemovalListener: ${i}`)}return e};var hU=vU,pU=/^(?:\w+:)?\/\/(\S+)$/,mU=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,gU=/^[^\s\.]+\.\S{2,}$/;function vU(e){if(typeof e!="string")return!1;var t=e.match(pU);if(!t)return!1;var n=t[1];return n?!!(mU.test(n)||gU.test(n)):!1}const yU=gi(hU),bU=(e,t,n)=>{const{insertText:r,isInline:i}=e;try{e.isInline=a=>{const o=a;return[ae.link].includes(o.type)||i(a)},e.insertText=a=>{a&&yU(a)?Cy(e,a,t):r(a)}}catch(a){const o=a.message;n(`Error in withInlines: ${o}`)}return e},EU=(e,t)=>{const{isInline:n,isVoid:r,markableVoid:i}=e;try{e.isInline=a=>a.type===ae.mention?!0:n(a),e.isVoid=a=>a.type===ae.mention?!0:r(a),e.markableVoid=a=>a.type===ae.mention||i(a)}catch(a){const o=a.message;t(`Error in withMentions: ${o}`)}return e},_U=(e,t)=>{const{normalizeNode:n}=e;try{e.normalizeNode=([r,i])=>{if(r.type===ae.link&&Ee.string(r).trim()===""){de.removeNodes(e,{at:i});return}n([r,i])}}catch(r){const i=r.message;t(`Error in withoutEmptyLinks: ${i}`)}return e};const ky=({id:e="rich-text-editor",value:t,placeholder:n,maxLength:r=0,meta:i,functions:a,autoFocus:o,data:s,styling:l,...u})=>{const c=me.useIntl(),d=KD();typeof o>"u"&&(o=!0);const{isInOverlay:f=!1}=i||{},{listMembers:h,clickMentionFallback:m,onChange:p=()=>{},onChangeData:y=()=>{},getLinkPreview:v=()=>Promise.resolve({}),onMention:b=()=>{},reportError:_=V=>{console.error(V)}}=a||{},T=[{type:ae.paragraph,children:[{text:""}]}];t==="<br>"&&(t="");const C={editorKey:null,originalValue:t||"",initialValue:t?null:T,showLinkEditor:!1,mentionPopover:{show:!1,selectedUser:0,possibleUsers:[],position:null,numberOfUsers:null},lastAnchor:null,stringValue:"",lastKey:null,hasInteracted:!1,hasLoaded:!1,enrichedUrl:!1},[x,w]=E.useReducer(Rl,C),{editorKey:P,originalValue:O,initialValue:M,stringValue:R,lastAnchor:D,lastKey:S,hasInteracted:B,hasLoaded:H,enrichedUrl:$,mentionPopover:F}=x,ne=async V=>{const z=await v(V);z.url&&w([{type:"enrichedUrl",value:z}])},J=`rte-${e}`,I=E.useCallback(V=>g.jsx(nP,{...V}),[]),A=E.useCallback(V=>g.jsx(rP,{...V}),[]),Y=E.useMemo(()=>fU(bU(EU(_U(uU(zL(WM())),_),_),J,_),_),[]),L=V=>{if(!Y||V!==J)return;const z=N.end(Y,[]);de.select(Y,z),fe.focus(Y)};E.useEffect(()=>{const V=z=>{var Q;const j=z,ue=((Q=j==null?void 0:j.detail)==null?void 0:Q.id)||null;ue&&L(ue)};return window.addEventListener("focusEditor",V),()=>{window.removeEventListener("focusEditor",V)}},[]),E.useEffect(()=>{if(Y.children.length>0&&!H){if(w([{type:"hasLoaded",value:!0}]),!o)return;L(J)}},[Y.children.length,M]),E.useEffect(()=>{O&&(async()=>{let z=$r(O);if(z.includes("<")){kc.prototype.escape=ue=>ue;const j=new kc;j.addRule("br",{filter:["br"],replacement:ue=>ue+`
164
164
 
165
- `}),z=j.turndown(z)}s&&s.mentions&&(z=await GC({text:z,template:`[${Tg}{{name}}]({{id}})`,mentions:s.mentions,listMembers:h||(()=>Promise.resolve([]))})),yH(z,j=>{const ue=[{type:"initialValue",value:j},{type:"editorKey",value:O.toString()}];s!=null&&s.link&&(ue.push({type:"enrichedUrl",value:s.link}),s.link.url&&ne(s.link.url)),w(ue),setTimeout(()=>{w([{type:"stringValue",value:q2(Y)}])},150)})})()},[O]),E.useEffect(()=>{if($===void 0&&Y){const z=_H(Y);z&&ne(z)}const V=z=>{var Q;const j=z,ue=((Q=j==null?void 0:j.detail)==null?void 0:Q.url)||null;ue&&$&&$.url===ue&&w([{type:"enrichedUrl",value:void 0}])};return window.addEventListener("linkRemoved",V),()=>{window.removeEventListener("linkRemoved",V)}},[$]),E.useEffect(()=>{if(t){vc.lastIndex=0;const V=t.match(vc);V&&V.length===1&&V[0].length===t.length&&!B&&w([{type:"originalValue",value:t}])}t!==""||!Y||cf(O,t)&&!B||(N.withoutNormalizing(Y,()=>{de.delete(Y,{at:{anchor:N.start(Y,[]),focus:N.end(Y,[])}}),de.deselect(Y),Y.children.length!==0&&de.unwrapNodes(Y,{at:[0]}),de.insertNodes(Y,T,{at:[0]})}),w([{type:"initialValue",value:T},{type:"lastAnchor",value:null},{type:"enrichedUrl",value:!1}]))},[t]),E.useEffect(()=>{y({link:$})},[$]),E.useEffect(()=>{R===""&&$&&w([{type:"enrichedUrl",value:void 0}])},[R]);const U=mc(()=>{CH({editor:Y,isShowing:F.show,numberOfUsers:F.numberOfUsers,listMembers:h,dispatch:w})},100);return M?g.jsx("div",{id:J,className:"rich-text-editor input text-medium",children:g.jsxs(Da.Provider,{value:{...x,id:J,isInOverlay:f,dispatch:w,onMention:b,reportError:_},children:[g.jsxs(HL,{editor:Y,initialValue:M,onChange:V=>{if(Y.operations.some(j=>j.type!=="set_selection")){let j=wH(V);j==="<br>"&&(j=""),p(j,$),w([{type:"stringValue",value:q2(Y)}]),B||w([{type:"hasInteracted",value:!0}]),U(),d&&console.log({serialized:j,json:V})}},...u,children:[g.jsx(IL,{className:"editor",renderElement:I,renderLeaf:A,placeholder:n||c.formatMessage({id:"richTextEditor_placeholder"}),autoFocus:o,tabIndex:0,onPaste:async V=>{const z=$!==!1,j=V.clipboardData.getData("text");if((Q=>{try{return new URL(Q),!0}catch{return!1}})(j)){let Q=j;if(j){const{full:ie}=Ov(j);Q=ie}if(j&&v&&!z){const ie=await v(Q);ie.url&&w([{type:"enrichedUrl",value:ie}])}}},onKeyDown:V=>{if(V.key==="Enter"){F.show&&(V.preventDefault(),V.stopPropagation(),dw(Y,F,w,J));const{selection:z}=Y;if(z){const j=ce.isCollapsed(z),[ue,Q]=N.node(Y,z,{depth:1});let ie=ue,le=ie.type;const te=ie.children[0];if(te&&(te==null?void 0:te[ae.h3])===!0&&(V.stopPropagation(),V.preventDefault(),de.insertNodes(Y,T)),te&&[ae.ol,ae.ul].includes(te.type)&&(ie=te,le=te.type),ie&&De.isElement(ie)&&le!==ae.paragraph){if(le===ae.blockquote&&!V.shiftKey){V.stopPropagation(),V.preventDefault(),de.insertNodes(Y,T);return}if(j){const[Ae,Oe]=N.parent(Y,z,{edge:"end"}),se=Ae.type;if([ae.ul,ae.ol].includes(le))if(V.stopPropagation(),V.preventDefault(),se===ae.li&&S==="Enter"){Ae.children.length===1&&"text"in Ae.children[0]&&Ae.children[0].text===""&&de.removeNodes(Y,{at:Oe}),de.insertNodes(Y,T,{at:K.next(Q)}),de.select(Y,N.end(Y,K.next(Q)));return}else{const[ve,ke]=bH(Y,ae.li),Fe={type:ae.li,children:[{text:""}]};de.insertNodes(Y,Fe,{at:K.next(ke)}),de.select(Y,N.end(Y,K.next(ke)))}}}}}else if(V.key==="Escape"){if(F.show){V.preventDefault(),V.stopPropagation(),w([{type:"mentionPopover",value:{...F,show:!1}}]);return}}else if(["ArrowUp","ArrowDown"].includes(V.key)&&F.show){V.preventDefault(),V.stopPropagation();const{selectedUser:z,possibleUsers:j}=F;let ue=V.key==="ArrowUp"?z-1:z+1;ue<0&&(ue=j.length-1),ue>=j.length+1&&(ue=0),w([{type:"mentionPopover",value:{...F,selectedUser:ue}}])}w([{type:"lastKey",value:V.key}]),TH(V,Y,w,_)},onBlur:()=>{Y.selection&&w([{type:"lastAnchor",value:Y.selection.anchor}])},onFocus:()=>{if(D){if(!K.isPath(D.path)||!Ee.has(Y,D.path))return;const V=Ee.get(Y,D.path);let z=0;if(Pe.isText(V)?z=V.text.length:V.children&&(z=V.children.length),D.offset>z)return;try{de.select(Y,{anchor:D,focus:D})}catch(j){const ue=j.message;_(`Error focusing editor: ${ue}`)}}}}),$?g.jsx(Qv,{data:$,variant:"condensed",onClick:()=>{w([{type:"enrichedUrl",value:!1}]);const V=new CustomEvent("ariaLive",{detail:{message:c.formatMessage({id:"richTextEditor_link_enrichedUrl_aria_live"})}});document.dispatchEvent(V)},"aria-label":c.formatMessage({id:"richTextEditor_link_enrichedUrl_aria"},{title:$.title||c.formatMessage({id:"richTextEditor_link_enrichedUrl_aria_fallback"})})}):g.jsx(g.Fragment,{}),g.jsx(MH,{styling:l==null?void 0:l.toolbar}),h?g.jsx(AH,{onFallbackClick:m}):g.jsx(g.Fragment,{})]},P),g.jsx(Jv,{id:`character-limit-${e}`,limit:r,valueLength:_h(R)})]})}):g.jsx(g.Fragment,{})};const TU=({id:e="form-toggle",label:t,options:n,initialValue:r,functions:{onChange:i=()=>{}},isDisabled:a=!1,className:o=""})=>{const[s,l]=E.useState(typeof r=="boolean"||typeof r=="string"?r:n[0].value);E.useEffect(()=>{r&&l(r)},[r]);const u=c=>{a||(l(c),i(c))};return g.jsxs("div",{className:ee("toggle",o),onClick:c=>{c.preventDefault(),c.stopPropagation(),u(s===n[0].value?n[1].value:n[0].value)},children:[g.jsx("p",{children:t}),g.jsx("ul",{className:ee("toggle-options",{disabled:a,on:s===n[1].value}),children:n.map(c=>{const d=`${e}-${c.value}`;return g.jsxs("li",{className:"hidden",children:[g.jsx("input",{type:"radio",id:d,name:e,value:c.value,checked:s===c.value,onChange:()=>u(c.value),disabled:a}),g.jsx("label",{htmlFor:d,children:c.label})]},d)})})]})};function Aw({className:e="",userId:t,userName:n,src:r,uploadImage:i,button:a,callback:o}){const s=me.useIntl(),l="profileImageChange_",[u,c]=E.useState(r),[d,f]=E.useState(!1),[h,m]=E.useState(!1),p=E.useRef(null),y=async T=>{f(!0),m(!1);try{const C=T.target.files&&T.target.files[0];if(!C||!t)throw f(!1),new Error("Image file or userID is missing");const x=await i({fileObject:C,userId:t}),w={thumbnail:x.thumbnailURL,full:x.originalURL};c(w),o(w)}catch{m(!0)}finally{f(!1)}f(!1)},{upload:v=s.formatMessage({id:`${l}cta_upload`}),change:b=s.formatMessage({id:`${l}cta_change`}),uploading:_=s.formatMessage({id:`${l}cta_uploading`})}=(a==null?void 0:a.text)||{};return g.jsxs("div",{className:ee("profile-image-change-figure",e),children:[g.jsx(ka,{className:"profile-image-change-picture",name:n,src:u==null?void 0:u.thumbnail,showInitials:!1,alt:"","data-testid":"profile-picture"}),h&&g.jsx("p",{className:"error text-small",children:s.formatMessage({id:`${l}error`})}),g.jsx("input",{id:"file",type:"file",accept:"image/*",ref:p,onChange:y,hidden:!0,"data-testid":"file-input"}),g.jsx(Ke,{onClick:()=>p.current&&p.current.click(),variant:"secondary","data-gtm-event-context":"ImageField","data-gtm-event-type":`${u?"change-photo":"add-photo"}-click`,className:"gtm-trackable",disabled:d,children:d?_:u?b:v})]})}const kw=({gtm:e,functions:{onSuccess:t=async()=>{},onFailure:n=()=>{}}})=>{const{context:r="FooterContactUsForm",event:i="contact-form-submit-click"}=e||{};return g.jsx(Zi,{id:"contact-us-form",fields:[{id:"name",type:"text",className:"short",validation:[{condition:"required"}],autoComplete:"name"},{id:"email",type:"email",className:"short",validation:[{condition:"required"},{condition:"valid-email"}]},{id:"organisation",type:"text"},{id:"interests",type:"checkboxes",options:[{id:"publishingCourse",label:"Publishing or creating a course"},{id:"buyingCourse",label:"Buying courses for my team"},{id:"learningExperience",label:"Customised learning experiences"},{id:"somethingElse",label:"Something else"}]},{id:"message",type:"textarea",limit:1e3,validation:[{condition:"required"}]}],intlPath:"contactForm",gtm:{context:r,event:i},functions:{onSuccess:t,onFailure:n},button:{className:"new"}})};const CU=({emails:e,setEmails:t,setIsDisabled:n})=>{const{formatMessage:r}=me.useIntl();return g.jsx(OD.ReactMultiEmail,{id:"email-input",inputClassName:"email-input input",placeholder:r({id:"inviteForm_email_placeholder"}),emails:e,onChange:i=>{t(i),n(!i.length)},autoFocus:!1,getLabel:(i,a,o)=>g.jsxs("div",{className:"email text-medium",children:[g.jsx("div",{"data-tag-item":!0,children:i}),g.jsx(Ke,{variant:"tertiary",size:"small",icon:{icon:"close"},onClick:()=>{o(a),n(!e.length)},className:"remove-email-button",screenreaderText:r({id:"overlay_close"})})]},a)})},Sw=({title:e,label:t,messagePlaceholder:n,ctaMessage:r,titleColor:i,labelColor:a,backgroundColor:o,onClose:s,reportError:l,sendInvites:u,initialFormStatus:c="NOT_SUBMITTED",gtm:d={context:"Form",event:"form-submit-click"},secondaryActionButton:f,meta:h})=>{const[m,p]=E.useState([]),[y,v]=E.useState(!0),[b,_]=E.useState(c),{formatMessage:T}=me.useIntl(),C=async P=>{try{await u(m,P.message),p([]),_("SUCCESS")}catch(O){_("ERROR"),l(O)}},x=P=>{P.preventDefault(),_("NOT_SUBMITTED"),v(!0),p([])},w=P=>{P.preventDefault(),s(),_("CLOSED")};return b==="CLOSED"?null:b==="ERROR"||b==="SUCCESS"&&!(h!=null&&h.shouldHideDoneButtonOnSubmit)?g.jsxs("div",{className:"invite-form-wrapper",children:[g.jsx("div",{className:"content centred",children:b==="SUCCESS"?g.jsx("h2",{className:"success-title",children:T({id:"inviteForm_success"})}):g.jsxs("h2",{className:"error-title",children:[" ",T({id:"inviteForm_error"})]})}),g.jsx(fi,{}),g.jsx("div",{className:"footer",children:b==="SUCCESS"?g.jsxs(g.Fragment,{children:[g.jsx(Ke,{variant:"secondary",onClick:x,children:T({id:"inviteForm_ctaSendMoreInvites"})}),g.jsx(Ke,{onClick:w,children:T({id:"inviteForm_ctaDone"})})]}):g.jsx(Ke,{onClick:x,children:T({id:"inviteForm_ctaTryAgain"})})})]}):g.jsxs("div",{className:"invite-form-wrapper",style:{backgroundColor:o},children:[g.jsxs("div",{className:"content",children:[g.jsx("h2",{className:"title",style:{color:i},children:e}),g.jsx("label",{htmlFor:"email-input",className:"label",style:{color:a},children:t})]}),g.jsx(Zi,{id:"invite-form",fields:[{component:CU,props:{emails:m,setEmails:p,setIsDisabled:v},required:!0},{id:"message",type:"textarea",label:T({id:"inviteForm_message_label"}),placeholder:n||T({id:"inviteForm_message_placeholder"})}],functions:{onSuccess:C},button:{text:r,size:"medium",disabled:y},gtm:d,meta:h,secondaryActionButton:f})]})},Dd=e=>e.map(t=>({condition:t})),Sr={FORM_ID:"manage-account-password-change",NEW_PASSWORD:"newPassword",CONFIRMED_PASSWORD:"confirmedPassword",CURRENT_PASSWORD:"oldPassword"},xU=({functions:e,...t})=>{const{formatMessage:n}=me.useIntl(),[r,i]=E.useState(null),[a,o]=E.useState(!1),[s,l]=E.useState({isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1}),u=h=>h[Sr.NEW_PASSWORD]!==h[Sr.CONFIRMED_PASSWORD]?n({id:"passwordRules_unmatched_text"}):null,c=h=>!eg(h[Sr.NEW_PASSWORD]).isValid,d=[{"data-testid":Sr.NEW_PASSWORD,id:Sr.NEW_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_newPassword_label"}),validation:Dd(["required",c]),functions:{onChange:h=>l(eg(h).matchingRules),onFocus:()=>o(!0),onBlur:()=>o(!1)}},{"data-testid":Sr.CONFIRMED_PASSWORD,id:Sr.CONFIRMED_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_confirmPassword_label"}),validation:Dd(["required",u])}];t.isPasswordChange&&d.unshift({"data-testid":Sr.CURRENT_PASSWORD,id:Sr.CURRENT_PASSWORD,type:"password",autoComplete:"current-password",placeholder:"",label:n({id:"passwordRules_currentPassword_label"}),validation:Dd(["required"])}),a&&d.push({component:tx,props:{matchingRules:s}});const f={id:Sr.FORM_ID,fields:d,functions:{...e,onSuccess:async h=>(e.createPassword(h),e.onSuccess&&e.onSuccess(h)),onCatch:h=>i(h==null?void 0:h.statusCode),onFailure:(h,m)=>{(m.includes(Sr.NEW_PASSWORD)||m.includes(Sr.CONFIRMED_PASSWORD))&&o(!0)}},meta:{shouldReset:!0},...t};return g.jsxs(g.Fragment,{children:[g.jsx(Zi,{...f}),r&&g.jsx(Ui,{variant:"error",text:r})]})};const Dw=({isCreateProfile:e=!1,hooks:t,functions:n,meta:r={},gtm:i,...a})=>{var P;const o=me.useIntl(),s="profileForm_",l=E.useContext(fn),[u,c]=E.useState(l.image),[d,f]=E.useState(!1),{uploadImage:h=()=>{},onSuccess:m=async O=>{},onCancel:p=()=>{},onFailure:y=()=>{}}=n,{buildLocation:v,isValidPlace:b,predictPlaces:_}=t.useMaps(),{context:T="ProfileForm",event:C="profile-form-submit-click"}=i||{},x=[{id:"jobTitle",type:"text",label:o.formatMessage({id:`${s}jobTitle`}),placeholder:o.formatMessage({id:`${s}jobTitle_placeholder`}),value:l.jobTitle,validation:[{condition:"required"}]},{id:"organization",type:"text",label:o.formatMessage({id:`${s}organization`}),placeholder:o.formatMessage({id:`${s}organization_placeholder`}),value:l.organization,validation:[{condition:"required"}]},{id:"location",type:"autocomplete",label:o.formatMessage({id:`${s}location`}),placeholder:o.formatMessage({id:`${s}location_placeholder`}),value:(P=l.location)==null?void 0:P.en,validation:[{condition:"required"},{condition:({location:O})=>O&&!d?!1:!b(O),error:o.formatMessage({id:`${s}location_error`})}],functions:{onChange:()=>{d||f(!0)},onKeyInput:_}}],w=[{component:Aw,props:{userName:l.name,userId:l.id,src:u,uploadImage:h,callback:c,button:{text:{upload:o.formatMessage({id:`${s}image`})}}}},{id:"name",type:"text",label:o.formatMessage({id:`${s}name`}),placeholder:o.formatMessage({id:`${s}name_placeholder`}),value:l.name,autoComplete:"name",validation:[{condition:"required"}]},...x,{id:"biography",type:"textarea",label:o.formatMessage({id:`${s}bio`}),placeholder:o.formatMessage({id:`${s}bio_placeholder`}),limit:1e3,value:l.biography},{component:fi}];return g.jsx(Zi,{id:"profile-details-form",fields:e?x:w,meta:{shouldShowCancelButton:!e,shouldReset:!1,shouldHide:!1,showRequiredLabels:e,...r},intlPath:s,gtm:{context:T,event:C},functions:{onSuccess:async O=>{try{const M={...O,image:u||null,location:d?await v(O==null?void 0:O.location):l.location,...e?{onboardingState:"completed"}:{}};l.updateDetails&&l.updateDetails(R=>({...R,...M})),await m(M)}catch{y()}},onCancel:p,onFailure:y},button:{size:"large",text:{default:o.formatMessage({id:`${s}cta`}),submitting:o.formatMessage({id:`${s}cta_submitting`}),submitted:o.formatMessage({id:`${s}cta_submitted`})}},...a})},wU=()=>{const e=me.useIntl(),[t,n]=E.useState(0);return E.useEffect(()=>{const r=setInterval(()=>{n(i=>{if(i>=95)return clearInterval(r),95;const a=Math.round(Math.random()*10);return Math.min(i+a,95)})},800);return()=>{clearInterval(r)}},[]),g.jsx(m3,{progress:t,steps:{0:{icon:"layers",text:e.formatMessage({id:"publishArticleForm_progressBar"})}}})};function AU({coverImage:e,setShowImagePicker:t}){return e&&e.url?g.jsx(Ui,{className:"cover-image-preview",text:g.jsx(co,{className:"cover-image",image:{description:e.description||"",height:e.height,width:e.width,url:e.url,color:e.color,type:"image/jpeg"}}),button:{component:g.jsx(Ke,{variant:"tertiary",onClick:()=>t(!0),children:g.jsx(me.FormattedMessage,{id:"publishArticleForm_replaceImage_button"})})}}):g.jsx(Ui,{button:{component:g.jsx(Ke,{variant:"secondary",onClick:()=>t(!0),children:g.jsx(me.FormattedMessage,{id:"publishArticleForm_selectImage_button"})})}})}var Ow=(e=>(e.CitiesAndLocalGovernment="topic_CitiesAndLocalGovernment",e.Climate="topic_Climate",e.DigitalAndData="topic_DigitalAndData",e.Education="topic_Education",e.EquityJusticeAndInclusion="topic_EquityJusticeAndInclusion",e.HealthAndSocialCare="topic_HealthAndSocialCare",e.Innovation="topic_Innovation",e.LeadershipAndSkills="topic_LeadershipAndSkills",e.LifeInGovernment="topic_LifeInGovernment",e.Policymaking="topic_Policymaking",e.TransportAndInfrastructure="topic_TransportAndInfrastructure",e.WorkingAndTheEconomy="topic_WorkAndTheEconomy",e))(Ow||{});let ym=null;const un="publishArticleForm_",J2={},eE=10,kU=({id:e="publish-article-form",values:t=J2,setShowImagePicker:n,functions:r,meta:i,gtm:a})=>{var O;const o=me.useIntl(),s=E.useContext(fn),{create:l,onSuccess:u=()=>{},onFailure:c=()=>{}}=r||{},{isInOverlay:d=!1}=i||{},[f,h]=E.useState(!1),[m,p]=E.useState(t.body||""),[y,v]=E.useState(!1),[b,_]=E.useState("");E.useEffect(()=>{cf(t,J2)||yc(t.body)&&t.body!==m&&t.body!==void 0&&p(t.body)},[t.body]);const T=()=>{!s||!s.id?v(o.formatMessage({id:`${un}error_loggedOut`})):y&&v(!1)},C=M=>({condition:R=>{const D=R[M];return!D||typeof D!="string"?!0:D.length<eE},error:o.formatMessage({id:`${un}error_underMinLength`},{length:eE})}),x=!!m&&yc(m),w=()=>g.jsxs(g.Fragment,{children:[g.jsx(fi,{}),g.jsx("p",{className:"text-medium",children:o.formatMessage({id:`${un}disclaimer`})})]}),P=[{id:"title",type:"textarea",value:t.title||"",limit:65,label:o.formatMessage({id:`${un}title_label`}),placeholder:o.formatMessage({id:`${un}title_placeholder`}),styling:{autosizeToFit:!0},functions:{onChange:T},validation:[{condition:"required"},C("title")]},{id:"subtitle",type:"textarea",value:t.subtitle,limit:115,label:o.formatMessage({id:`${un}subtitle_label`}),styling:{autosizeToFit:!0},placeholder:o.formatMessage({id:`${un}subtitle_placeholder`}),functions:{onChange:T},validation:[{condition:"required"},C("subtitle")]},{component:Af,props:{formID:e,label:{visible:o.formatMessage({id:`${un}body_label`})},showLabel:!0}},{component:ky,props:{id:`${e}-input`,value:m,placeholder:o.formatMessage({id:`${un}body_placeholder`}),meta:{isInOverlay:d},autoFocus:!1,functions:{onChange:M=>{p(M),T()}},styling:{toolbar:{showHeadingOption:!0}},"aria-invalid":!!y,"aria-errormessage":"error-message"}},{id:"tags",label:o.formatMessage({id:`${un}tags_label`}),type:"checkboxes",styling:{displayOptionsAsPills:!0},options:Object.values(Ow).map(M=>({id:M,label:o.formatMessage({id:`${un}_tags_${M}`})})),multipleOptions:{limit:3},validation:[{condition:"required",error:o.formatMessage({id:`${un}tags_error_required`})},{condition:M=>{var R;return((R=M==null?void 0:M.tags)==null?void 0:R.length)>3},error:o.formatMessage({id:`${un}tags_error_over_three`})}]},{component:Af,props:{formID:e,label:{visible:o.formatMessage({id:`${un}cover_image_label`})},showLabel:!0}},{component:AU,props:{coverImage:t.coverImage||{},setShowImagePicker:n}}];return f?P.push({component:fi}):P.push({component:w}),g.jsxs("section",{className:"publish-article-form",children:[g.jsx(Zi,{id:e,meta:{shouldReset:!1,shouldHide:!1,showRequiredLabels:!1,shouldScrollOnSuccess:!1},functions:{onSuccess:async M=>{if(!s||!s.id||!x)return;ym&&clearTimeout(ym),h(!0);const R={...M,body:m,coverImage:t.coverImage};try{l&&await l(R),ym=setTimeout(()=>{_(o.formatMessage({id:`${un}aria_success`})),u(R)},500)}catch{v(o.formatMessage({id:`${un}error`})),_(""),c()}},onFailure:c},fields:P,intlPath:un,button:{variant:"primary",size:{mobile:"small",600:"medium"},"data-gtm-event-context":a==null?void 0:a.context,"data-gtm-event-type":"publish-article-click",disabled:!s||!s.id||!x||!((O=t==null?void 0:t.coverImage)!=null&&O.url),text:{default:o.formatMessage({id:`${un}cta_submit`}),submitting:o.formatMessage({id:`${un}cta_submitting`}),submitted:o.formatMessage({id:`${un}cta_submitted`})},customOnSubmit:y?g.jsx(g.Fragment,{}):g.jsx(wU,{})},gtm:a}),y&&g.jsx(gl,{id:"error-message",className:"error",children:typeof y=="string"&&y.includes(" ")?y:o.formatMessage({id:`${un}error`})}),b&&g.jsx(xt,{"aria-live":"polite",showOnFocus:!1,children:b})]})};const Nw=({id:e="search",className:t="",handleToggle:n=!1,defaultValue:r="",gtmContext:i="search-bar",gtmEvent:a="form-submission"})=>{const{searchIsOpen:o=!0,isDesktopVersion:s=!1}=n||{},l=me.useIntl(),u=E.useRef(null);ml(()=>{!n||s||!o||u.current&&u.current.focus()},[o]);const c=d=>{d.preventDefault(),d.stopPropagation(),!(!u.current||!u.current.value||u.current.value.length<1)&&(window.location.href=`/search?search=${encodeURIComponent(u.current.value)}`)};return g.jsx("form",{onSubmit:c,className:ee("search-form gtm-trackable",t),role:"search","data-gtm-event-context":i,"data-gtm-event-type":a,children:g.jsx("fieldset",{id:`${e}-form`,hidden:n?!o:!1,children:g.jsxs("p",{children:[g.jsx(xt,{element:"label",htmlFor:e,children:l.formatMessage({id:"search_label"})}),g.jsx("input",{ref:u,type:"search",id:e,name:e,defaultValue:r,placeholder:l.formatMessage({id:"search_placeholder"}),onKeyDown:d=>{d.key==="Enter"&&c(d)}}),g.jsx("button",{className:"clear",onClick:d=>{d.preventDefault(),d.stopPropagation(),u.current&&u.current.value&&(u.current.value="")},children:g.jsx(xt,{children:l.formatMessage({id:"search_clear"})})}),g.jsx("button",{className:"search",onClick:c,children:g.jsx(xt,{children:l.formatMessage({id:"search_cta"})})})]})})})},tE=async({ref:e,validateEmail:t,dispatch:n})=>{const r=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;if(!e.current.validity.valid||!r.test(e.current.value))return n([{type:"validFields.email",value:!1}]);const i=e.current.value.toString().toLowerCase().trim(),a={valid:!1,autoApproved:!1,exists:{auth:!1,engagement:!1,registration:!1,user:!1}};let o=Object.assign({},a);try{o=await t(i),o===void 0&&(o=a)}catch{return n([{type:"shouldManuallyApprove",value:!0},{type:"emailDetails",value:{email:i,boxType:"nonGov",isEnd2End:!1}},{type:"validFields.email",value:!1}])}const{valid:s=!1,autoApproved:l=!1,exists:u}=o;let c="";return s?c=l?"gov":"nonGov":u.registration?u.engagement&&!u.user?c=u.auth?"verify":"pending":c="exists":u.auth&&(c="exists"),n([{type:"shouldDisableButton",value:!1},{type:"shouldManuallyApprove",value:!l},{type:"emailDetails",value:{email:i,boxType:c,isEnd2End:/testing\+[0-9]+@apolitical.co$/.test(i)}},{type:"validFields.email",value:!0}])},SU=e=>{const t={};for(const n of e.entries())t[n[0]]=n[1];return{name:t.full_name.toString().trim(),email:t.email_address.toString().toLowerCase().trim(),jobTitle:t.job_title,organization:t.organization,bioLink:t.url,optIn:!0,expectation:t.expectation,page:window.location.pathname,"g-recaptcha-response":t["g-recaptcha-response"]}},DU=async({refs:e,dataToSubmit:t,createAccount:n,onSuccess:r,dispatch:i,state:a})=>{if(!e.form||!e.form.current)throw new Error("No refs.form");if(!e.form.current.checkValidity()){e.hiddenValidation&&e.hiddenValidation.current&&e.hiddenValidation.current.click();return}const o=SU(new FormData(e.form.current)),s=Object.assign(o,t);await n(s),sessionStorage.setItem(Sv.SESSION_STORAGE.EMAIL,o.email),r&&r({...o,...a.values}),i([{type:"showSuccessMessage",value:!0}])},OU=({shouldShow:e,placeholders:t,labels:n,functions:{validateEmail:r,resendVerificationCode:i},refs:a,state:o,dispatch:s,dataToSubmit:l,intl:u})=>{const{emailDetails:c}=o,d=(h,m)=>{h.current&&o.validFields[m]!==h.current.validity.valid&&s([{type:`validFields.${m}`,value:h.current.validity.valid}])},f=[{id:"full_name",type:"text",inputRef:a.name,placeholder:u.formatMessage({id:"signup_full_name_placeholder"}),functions:{onChange:()=>d(a.name,"name"),onFocus:()=>s([{type:"loadRecaptcha",value:!0}])},autoComplete:"name",validation:[{condition:"required"},{condition:"no-numbers"}],"data-testid":"signup-name-input"},{id:"email_address",type:"email",inputRef:a.email,placeholder:u.formatMessage({id:"signup_email_address_placeholder"}),"aria-describedby":"email-helper-textbox",functions:{onBlur:()=>{tE({ref:a.email,validateEmail:r,dispatch:s})},onChange:(h,m)=>{s([{type:"shouldDisableButton",value:!0}]),m&&m({type:"updateValue",payload:{key:"terms",value:!1}})},onFocus:()=>s([{type:"loadRecaptcha",value:!0}])},autoComplete:"email",validation:[{condition:"required"},{condition:"valid-email"}],"data-testid":"signup-email-input"},{component:Y3,props:{email:c.email,type:c.boxType,resendVerificationCode:i}}];return o.shouldManuallyApprove&&(f.push({id:"job_title",type:"text",inputRef:a.jobTitle,placeholder:u.formatMessage({id:"signup_job_title_placeholder"}),functions:{onChange:()=>d(a.jobTitle,"jobTitle")},validation:[{condition:"required"}],"data-testid":"signup-job-input"},{id:"organization",type:"text",inputRef:a.organisation,placeholder:u.formatMessage({id:"signup_organization_placeholder"}),functions:{onChange:()=>{d(a.organisation,"organisation")}},validation:[{condition:"required"}],autoComplete:"organization","data-testid":"signup-org-input"}),e.url&&f.push({id:"url",type:"text",label:u.formatMessage({id:"signup_url"},{small:h=>g.jsx("small",{children:h})}),placeholder:u.formatMessage({id:"signup_url_placeholder"}),validation:[{condition:"valid-url"}],"data-testid":"signup-url-input"})),e.expectation&&f.push({id:"expectation",className:"expectation",type:"text",label:(n==null?void 0:n.expectation)||u.formatMessage({id:"signup_expectation"},{small:h=>g.jsx("small",{className:"notes text-small",children:h})}),placeholder:(t==null?void 0:t.expectation)||u.formatMessage({id:"signup_expectation_placeholder"}),"data-testid":"signup-events-question"}),f.push({id:"terms",className:"text-small",type:"checkbox",inputRef:a.tc,label:u.formatMessage({id:"signup_terms"},{terms:h=>g.jsx("a",{href:"https://about.apolitical.co/terms-and-conditions","data-gtm-event-context":"SignupForm","data-gtm-event-type":"terms-of-service-click",className:"gtm-trackable",children:h}),privacy:h=>g.jsx("a",{href:"https://about.apolitical.co/privacy-policy","data-gtm-event-context":"SignupForm","data-gtm-event-type":"privacy-policy-click",className:"gtm-trackable",children:h})}),shownValue:"accepted",functions:{onChange:h=>{if(!h)return;const m=[];["name","email"].forEach(p=>{o.validFields[p]!==a[p].current.validity.valid&&(m.push({type:`validFields.${p}`,value:a[p].current.validity.valid}),p==="email"&&tE({ref:a.email,validateEmail:r,dispatch:s}))}),m.length&&s(m)}},validation:[{condition:"required"}],"data-testid":"signup-terms-checkbox"}),f};const NU=({className:e=""})=>g.jsxs("div",{className:ee("success-message",e),"data-testid":"success-message",children:[g.jsx("p",{className:"success-title",children:g.jsx(me.FormattedMessage,{id:"signup_success_title"})}),g.jsx(me.FormattedMessage,{id:"signup_success_text",values:{p:t=>g.jsx("p",{children:t})}})]});const IU={validFields:{name:!1,email:!1,jobTitle:!1,organisation:!1},emailDetails:{email:"",boxType:"",isEnd2End:!1},shouldManuallyApprove:!1,shouldDisableButton:!0,loadRecaptcha:!1,showSuccessMessage:!1,showError:!1},PU=({className:e="",labels:t={},placeholders:n={},functions:r={validateEmail:()=>Promise.resolve(),createAccount:()=>Promise.resolve(),handleError:()=>{},resendVerificationCode:()=>Promise.resolve()},shouldShow:i={},submitButton:a,dataToSubmit:o={ref:"sign-up-form"},...s})=>{const l=me.useIntl(),u=window.location.pathname.includes("/signup")?"/login":`/login?returnTo=${window.location.pathname}`,{title:c=!0,expectation:d=!1,url:f=!0,logInButton:h=!0,successMessage:m=!0}=i,p={title:c,expectation:d,url:f,logInButton:h,successMessage:m},[y,v]=E.useReducer(Rl,IU),{validFields:b,emailDetails:_,shouldManuallyApprove:T,shouldDisableButton:C,showSuccessMessage:x,showError:w}=y,[P,O]=wv.useCookies(["signup-this-session","functional-cookie-consent"]),M={form:E.createRef(),name:E.createRef(),email:E.createRef(),jobTitle:E.createRef(),organisation:E.createRef(),tc:E.createRef(),hiddenValidation:E.createRef()};E.useEffect(()=>{T===!0&&M.jobTitle.current&&M.jobTitle.current.focus()},[T]),E.useEffect(()=>{P["signup-this-session"]&&v([{type:"showSuccessMessage",value:!0}])},[P]),E.useEffect(()=>{x&&P["functional-cookie-consent"]&&O("signup-this-session","true",{path:"/",maxAge:3600})},[x]);const R=E.useMemo(()=>OU({placeholders:n,labels:t,shouldShow:p,functions:r,refs:M,state:y,dispatch:v,dataToSubmit:o,intl:l}),[o,r,l,M,p,y]),D=C?!0:T?!Object.values(b).every(S=>S===!0):!b.name||!b.email||["exists","pending","verify"].includes(_.boxType);return p.successMessage&&x?g.jsx(NU,{className:e}):g.jsxs("fieldset",{className:ee("signup-form-fieldset",e),"data-testid":"signup-form",children:[p.title&&g.jsx("p",{className:"signup-title",children:g.jsx(me.FormattedMessage,{id:"signup_title"})}),w&&g.jsx(Ui,{variant:"error",text:l.formatMessage({id:"signup_error"})}),g.jsx(Zi,{className:"signup-form",formRef:M.form,id:"sign-up-form",fields:R,intlPath:"signup",button:{variant:"primary",size:"medium",text:a||l.formatMessage({id:"signup_button_join"}),disabled:D?{isClickable:!0}:!1,styling:{fullWidth:!0},"data-testid":"signup-button"},secondaryActionButton:{className:"login-button",styling:{fullWidth:!0},variant:"tertiary",size:"medium",href:u,"data-gtm-event-context":"SignupForm","data-gtm-event-type":"login-click",text:l.formatMessage({id:"signup_button_login"})},meta:{shouldReset:!1,showRequiredLabels:!1,shouldShowCancelButton:p.logInButton},gtm:{context:"SignupForm",event:"signup-submit-click"},functions:{onSuccess:async()=>{await DU({refs:M,dataToSubmit:o,createAccount:r.createAccount,onSuccess:r.onSuccess,dispatch:v,state:y})},onCatch:S=>{r.handleError(S),v([{type:"showSuccessMessage",value:!1},{type:"showError",value:!0}])}}}),g.jsx("button",{className:"validation-button",ref:M.hiddenValidation})]})};const mo=({children:e,className:t="",styling:n={},...r})=>{const{background:i="default",padding:a="none"}=n;return g.jsx("section",{className:ee("full-width-section",t,{[i]:i!=="default",[a]:a!=="none"}),...r,children:e})};const RU=({text:e,buttons:t,className:n=""})=>{const r=[];return t.forEach(i=>{r.push({href:i.link,variant:"secondary",size:{mobile:"medium",1024:"large"},className:"gtm-trackable new","data-gtm-event-type":"download-click","data-gtm-event-context":i.eventContext||"Download",target:"_blank",children:i.text})}),g.jsx(mo,{className:ee("download-section",n),styling:{background:"dark"},children:g.jsxs("div",{className:"content-default",children:[E.createElement(typeof e=="string"?"h2":e.element,{className:"text"},typeof e=="string"?e:e.text),g.jsx(Fl,{buttons:r})]})})};const Og="editSection_";function Iw({href:e,setShowModal:t}){typeof e!="string"&&t(!0)}const FU=({icon:e,description:t,ctaMessage:n,href:r,showEditButton:i,setShowModal:a})=>{const{formatMessage:o}=me.useIntl();return g.jsxs(Er,{variant:"muted",icon:e,children:[g.jsx("p",{children:t||o({id:`${Og}placeholder_description`})}),i&&g.jsx("p",{children:g.jsx(Ke,{href:r,variant:"secondary",size:"small",onClick:()=>Iw({href:r,setShowModal:a}),children:n||o({id:`${Og}placeholder_cta`})})})]})},MU=({children:e,className:t="",formProps:n,formComponent:r,href:i,title:a,showTitle:o=!0,modalTitle:s,placeholder:l,showDivider:u=!0})=>{const{formatMessage:c}=me.useIntl(),[d,f]=E.useState(!1),h=()=>f(!1),m=!!n||!!r,p=typeof i=="string"||m;let y;return r&&(y=E.cloneElement(r,{functions:{...r.props.functions,onSuccess:async v=>{try{r.props.functions.onSuccess&&await r.props.functions.onSuccess(v)}finally{h()}},onCancel:()=>{r.props.functions.onCancel&&r.props.functions.onCancel(),h()}}})),g.jsxs("section",{className:ee("edit-section",t),children:[m&&g.jsx(Sa,{title:s||`Edit ${a}`,isOpen:d,showDivider:!1,showIcon:!1,functions:{onClose:h},className:ee("edit-section-modal"),children:y||(n?g.jsx(Zi,{...n,fields:n.fields,meta:{...n==null?void 0:n.meta,shouldShowCancelButton:!0,shouldReset:!1,showSuccessMessage:!0},functions:{...n==null?void 0:n.functions,onSuccess:async v=>{var b,_;(b=n==null?void 0:n.functions)!=null&&b.onSuccess&&await((_=n==null?void 0:n.functions)==null?void 0:_.onSuccess(v)),f(!1)},onCancel:h}}):g.jsx(g.Fragment,{}))}),g.jsxs("div",{className:ee("edit-section-header",{"no-title":!o}),children:[o&&g.jsx("h2",{className:"edit-section-header-title",children:a}),p&&g.jsx(Ke,{href:i,variant:"tertiary",size:"small",icon:"pencil",onClick:()=>Iw({href:i,setShowModal:f}),children:c({id:`${Og}edit`})})]}),e||g.jsx(FU,{...l,href:i,setShowModal:f,showEditButton:p}),u&&g.jsx(fi,{})]})};const BU=({title:e=!1,text:t,logos:n=[],styling:r={},className:i=""})=>{const a=n.length;if(a===0)return null;const o={element:typeof e=="object"?e.element:"h2",text:typeof e=="string"?e:typeof e=="object"?e.text:"",className:typeof e=="object"?e.className:""},{wrapLogos:s=!1,align:l="center",display:u="block"}=r;return g.jsxs("div",{className:ee("logos",i,`align-${l}`,{[u]:u!=="block","wrap-logos":s}),children:[e&&E.createElement(o.element,{className:ee("title",o.className)},o.text),t&&g.jsx("p",{children:t}),g.jsx("ul",{className:ee({"two-col":a===2||a===4,"three-col":a===5||a<=10&&a%3===0}),children:n.map(({logo:c,nameOfBusiness:d,link:f=!1,description:h=!1},m)=>{if(!c||!c.url)return null;const p=g.jsx("img",{src:c.url,width:c.width||"auto",height:c.height||"auto",alt:d});return g.jsxs("li",{children:[g.jsx("p",{className:"img-wrapper",children:f?g.jsx("a",{href:f,target:"_blank",rel:"nofollow noreferrer noopener",children:p}):p}),h&&g.jsx("small",{children:h})]},window.btoa(`${c.url}_${m}`))})})]})};let bm;const Em="contactFooter_",LU=({onSuccess:e=async()=>{},onFailure:t=()=>{}})=>{const n=E.useRef(null),[r,i]=E.useState(0),[a,o]=E.useState(!1),s=()=>{n.current&&i(n.current.clientHeight)},l=()=>{a||(o(!0),clearTimeout(bm),bm=setTimeout(()=>{s(),o(!1)},500))};return E.useEffect(()=>(s(),window.addEventListener("resize",l),()=>{clearTimeout(bm),window.removeEventListener("resize",l)}),[]),g.jsx(mo,{id:"contactForm",className:"contact-footer",children:g.jsxs("div",{className:"inner-wrapper",children:[g.jsx("h2",{children:g.jsx(me.FormattedMessage,{id:`${Em}title`})}),g.jsxs("div",{className:"content-wrapper",ref:n,"data-testid":"content-wrapper",style:a?{}:{minHeight:r},children:[g.jsxs("aside",{children:[g.jsx("p",{children:g.jsx(me.FormattedMessage,{id:`${Em}text`})}),g.jsx(fo,{className:"mailto-link",href:"mailto:hello@apolitical.co",children:g.jsx(me.FormattedMessage,{id:`${Em}email`})})]}),g.jsx(kw,{functions:{onSuccess:e,onFailure:t},gtm:{context:"FooterContactUsForm",event:"contact-form-submit-click"}})]})]})})},$U=({activeLink:e,profile:t,...n})=>g.jsx(mo,{children:g.jsx(K3,{layout:"1-3",children:g.jsxs(g.Fragment,{children:[g.jsx(W3,{activeLink:e,profile:t}),g.jsx(d3,{...n})]})})});const _m="cookieBanner_",Tm=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],Cm=new Date(Date.now()+12*30*24*60*60*1e3),Pw=()=>{const e=me.useIntl(),[t,n,r]=wv.useCookies(Tm),[i,a]=E.useState(!t["apol-cookie-banner"]),o=()=>{Tm.forEach(c=>{n(c,!0,{path:"/",expires:Cm,domain:c==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),a(!1),window.location.reload()},s=()=>{n("apol-cookie-banner",!0,{path:"/",expires:Cm}),Tm.forEach(c=>{if(c==="apol-cookie-banner"){n(c,!0,{path:"/",expires:Cm});return}r(c)}),a(!1)};if(!i)return null;const l=[{id:"settings",href:"/pages/cookie-policy",gtmType:"policy-page"},{id:"reject",onClick:s,gtmType:"reject-all"},{id:"accept",onClick:o,gtmType:"accepted-all"}],u=[];return l.forEach(c=>{u.push({variant:c.href?"tertiary":"primary",href:c.href,onClick:c.onClick,className:"gtm-trackable","data-gtm-event-context":"cookie-banner","data-gtm-event-type":`cookie-${c.gtmType}-click`,children:e.formatMessage({id:`${_m}buttons_${c.id}`})})}),g.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[g.jsx("h6",{children:e.formatMessage({id:`${_m}title`})}),g.jsx("p",{children:e.formatMessage({id:`${_m}text`})}),g.jsx(Fl,{buttons:u})]})},ga={platform:{order:["events","courses","articles","communities"],events:{href:"/events/",gtmType:"events-click"},courses:{href:"/microcourses/",gtmType:"microcourses-click"},articles:{href:"/solution-articles/",gtmType:"articles-click"},communities:{href:"/communities/",gtmType:"communities-click"}},community:{order:["support","post","join","guidelines"],support:{name:"Support FAQ",href:"/pages/support-faq",gtmType:"support-faq-click"},post:{href:"/pages/post-an-article",gtmType:"post-an-article-click"},join:{href:"/pages/who-can-join-the-community",gtmType:"who-can-join-click"},guidelines:{href:"/pages/values-and-guidelines",gtmType:"guidelines-and-values-click"}},company:{order:["news","insights","story","team","careers","partner","contact"],news:{href:"/learning-hub/updates/",gtmType:"news-click"},insights:{href:"/learning-hub/global-insights/",gtmType:"insights-click"},story:{href:"/pages/our-story",gtmType:"our-story-click"},team:{href:"/pages/meet-our-team",gtmType:"team-click"},careers:{href:"/pages/careers",gtmType:"careers-click"},partner:{href:"/partnerships/",gtmType:"partner-with-us-click"},contact:{href:"/pages/get-in-touch",gtmType:"contact-click"},child:"legal"},legal:{order:["privacy","terms","cookie","accessibility","ai"],privacy:{href:"https://about.apolitical.co/privacy-policy",gtmType:"privacy-policy-link"},terms:{href:"https://about.apolitical.co/terms-and-conditions",gtmType:"terms-conditions-link"},cookie:{href:"/pages/cookie-policy",gtmType:"cookie-policy-link"},ai:{href:"/pages/ai-principles",gtmType:"ai-principles-link"},accessibility:{href:"/pages/accessibility-statement",gtmType:"accessibility-link"},text:{order:["dataProtection","euDataProtection"],dataProtection:{email:zs["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:zs["data-protection"].eu,gtmType:"email-eu-dpo-link"}}},contact:{text:{order:["london","washington","berlin","registered","support","business"],london:{address:!0},washington:{address:!0},registered:{address:!0},berlin:{address:!0},support:{email:zs.support,gtmType:"concierge-email-click"},business:{email:zs.general,gtmType:"hello-email-click"}}},social:{order:["linkedin","twitter","facebook"],linkedin:{href:"https://www.linkedin.com/company/apolitical"},twitter:{href:"https://twitter.com/apoliticalco"},facebook:{href:"https://www.facebook.com/apoliticalco"}}};const Ys="footer_",Sf="SiteFooter",nE=({group:e})=>{const t=ga[e].order||[];let n=!1;return"text"in ga[e]&&(n=ga[e].text),g.jsxs(E.Fragment,{children:[g.jsx("p",{className:"pre-title",children:g.jsx(me.FormattedMessage,{id:`${Ys}${e}`})}),Array.isArray(t)&&t.length>0&&g.jsx("ul",{className:"text-medium",children:t.map(r=>{if(["order","child","text"].includes(r))return null;const{href:i,gtmType:a}=ga[e][r],o={};return["legal"].includes(e)&&(o.target="_blank",o.rel="noopener"),g.jsx("li",{children:g.jsx("a",{href:i,className:"gtm-trackable","data-gtm-event-context":Sf,"data-gtm-event-type":a,...o,children:g.jsx(me.FormattedMessage,{id:`${Ys}${e}_${r}`})})},`${e}_${r}`)})}),typeof n!="boolean"&&"order"in n&&Array.isArray(n.order)&&g.jsx("dl",{className:"text-medium",children:n.order.map(r=>g.jsxs(E.Fragment,{children:[g.jsx("dt",{children:g.jsx(me.FormattedMessage,{id:`${Ys}${e}_${r}`})}),g.jsxs("dd",{children:[typeof n!="boolean"&&n[r].address&&g.jsx("address",{children:g.jsx(me.FormattedMessage,{id:`${Ys}${e}_${r}_address`,values:{br:g.jsx("br",{})}})}),typeof n!="boolean"&&n[r].email&&g.jsx("a",{href:`mailto:${n[r].email}`,className:"gtm-trackable","data-gtm-event-context":Sf,"data-gtm-event-type":n[r].gtmType,children:n[r].email})]})]},`dl-${e}-${r}`))})]},e)},Sy=()=>g.jsx("div",{id:"footer",children:g.jsxs("div",{className:"wrapper",children:[g.jsx(mh,{element:"hr"}),g.jsx(Xv,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":Sf,"data-gtm-event-type":"logo-homepage-link"}),g.jsx("footer",{children:["platform","community","company","contact"].map(e=>g.jsxs("div",{className:"group",children:[g.jsx(nE,{group:e}),Object.keys(ga[e]).includes("child")&&g.jsx(nE,{group:ga[e].child})]},e))}),g.jsx("hr",{}),g.jsxs("div",{className:"sub-footer",children:[g.jsx("ul",{children:Array.isArray(ga.social.order)&&ga.social.order.map(e=>{const t=ga.social[e];return g.jsx("li",{className:e,children:g.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":Sf,"data-gtm-event-type":"social-click",children:g.jsx("span",{className:"hidden",children:g.jsx(me.FormattedMessage,{id:`${Ys}social_${e}`})})})},e)})}),g.jsx("small",{children:g.jsx(me.FormattedMessage,{id:`${Ys}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})});var jU=Object.defineProperty,HU=Object.defineProperties,UU=Object.getOwnPropertyDescriptors,Df=Object.getOwnPropertySymbols,Rw=Object.prototype.hasOwnProperty,Fw=Object.prototype.propertyIsEnumerable,Mw=e=>{throw TypeError(e)},rE=(e,t,n)=>t in e?jU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ye=(e,t)=>{for(var n in t||(t={}))Rw.call(t,n)&&rE(e,n,t[n]);if(Df)for(var n of Df(t))Fw.call(t,n)&&rE(e,n,t[n]);return e},an=(e,t)=>HU(e,UU(t)),Dy=(e,t)=>{var n={};for(var r in e)Rw.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Df)for(var r of Df(e))t.indexOf(r)<0&&Fw.call(e,r)&&(n[r]=e[r]);return n},Oy=(e,t,n)=>t.has(e)||Mw("Cannot "+n),oe=(e,t,n)=>(Oy(e,t,"read from private field"),n?n.call(e):t.get(e)),Ge=(e,t,n)=>t.has(e)?Mw("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Qe=(e,t,n,r)=>(Oy(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Of=(e,t,n)=>(Oy(e,t,"access private method"),n),Ve=(e,t,n)=>new Promise((r,i)=>{var a=l=>{try{s(n.next(l))}catch(u){i(u)}},o=l=>{try{s(n.throw(l))}catch(u){i(u)}},s=l=>l.done?r(l.value):Promise.resolve(l.value).then(a,o);s((n=n.apply(e,t)).next())});function Bw(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(i){i(n)}),(r=e.get("*"))&&r.slice().map(function(i){i(t,n)})}}}const Vi=Object.create(null);Vi.open="0";Vi.close="1";Vi.ping="2";Vi.pong="3";Vi.message="4";Vi.upgrade="5";Vi.noop="6";const Od=Object.create(null);Object.keys(Vi).forEach(e=>{Od[Vi[e]]=e});const Ng={type:"error",data:"parser error"},Lw=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",$w=typeof ArrayBuffer=="function",jw=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Dh=({type:e,data:t},n,r)=>Lw&&t instanceof Blob?n?r(t):iE(t,r):$w&&(t instanceof ArrayBuffer||jw(t))?n?r(t):iE(new Blob([t]),r):r(Vi[e]+(t||"")),iE=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function aE(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let xm;function zU(e,t){if(Lw&&e.data instanceof Blob)return e.data.arrayBuffer().then(aE).then(t);if($w&&(e.data instanceof ArrayBuffer||jw(e.data)))return t(aE(e.data));Dh(e,!1,n=>{xm||(xm=new TextEncoder),t(xm.encode(n))})}const oE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Pu=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<oE.length;e++)Pu[oE.charCodeAt(e)]=e;const VU=e=>{let t=e.length*.75,n=e.length,r,i=0,a,o,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),c=new Uint8Array(u);for(r=0;r<n;r+=4)a=Pu[e.charCodeAt(r)],o=Pu[e.charCodeAt(r+1)],s=Pu[e.charCodeAt(r+2)],l=Pu[e.charCodeAt(r+3)],c[i++]=a<<2|o>>4,c[i++]=(o&15)<<4|s>>2,c[i++]=(s&3)<<6|l&63;return u},qU=typeof ArrayBuffer=="function",Oh=(e,t)=>{if(typeof e!="string")return{type:"message",data:Hw(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:WU(e.substring(1),t)}:Od[n]?e.length>1?{type:Od[n],data:e.substring(1)}:{type:Od[n]}:Ng},WU=(e,t)=>{if(qU){const n=VU(e);return Hw(n,t)}else return{base64:!0,data:e}},Hw=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Uw=String.fromCharCode(30),zw=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((a,o)=>{Dh(a,!1,s=>{r[o]=s,++i===n&&t(r.join(Uw))})})},Vw=(e,t)=>{const n=e.split(Uw),r=[];for(let i=0;i<n.length;i++){const a=Oh(n[i],t);if(r.push(a),a.type==="error")break}return r};function qw(){return new TransformStream({transform(e,t){zU(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const a=new DataView(i.buffer);a.setUint8(0,126),a.setUint16(1,r)}else{i=new Uint8Array(9);const a=new DataView(i.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let wm;function O1(e){return e.reduce((t,n)=>t+n.length,0)}function N1(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function Ww(e,t){wm||(wm=new TextDecoder);const n=[];let r=0,i=-1,a=!1;return new TransformStream({transform(o,s){for(n.push(o);;){if(r===0){if(O1(n)<1)break;const l=N1(n,1);a=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(O1(n)<2)break;const l=N1(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(O1(n)<8)break;const l=N1(n,8),u=new DataView(l.buffer,l.byteOffset,l.length),c=u.getUint32(0);if(c>Math.pow(2,53-32)-1){s.enqueue(Ng);break}i=c*Math.pow(2,32)+u.getUint32(4),r=3}else{if(O1(n)<i)break;const l=N1(n,i);s.enqueue(Oh(a?l:wm.decode(l),t)),r=0}if(i===0||i>e){s.enqueue(Ng);break}}}})}const Nh=4;function Jt(e){if(e)return KU(e)}function KU(e){for(var t in Jt.prototype)e[t]=Jt.prototype[t];return e}Jt.prototype.on=Jt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Jt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Jt.prototype.off=Jt.prototype.removeListener=Jt.prototype.removeAllListeners=Jt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Jt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};Jt.prototype.emitReserved=Jt.prototype.emit;Jt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Jt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Br=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function Kw(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const GU=Br.setTimeout,YU=Br.clearTimeout;function Ih(e,t){t.useNativeTimers?(e.setTimeoutFn=GU.bind(Br),e.clearTimeoutFn=YU.bind(Br)):(e.setTimeoutFn=Br.setTimeout.bind(Br),e.clearTimeoutFn=Br.clearTimeout.bind(Br))}const ZU=1.33;function QU(e){return typeof e=="string"?XU(e):Math.ceil((e.byteLength||e.size)*ZU)}function XU(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function JU(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function ez(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let a=n[r].split("=");t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}let tz=class extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}},Ny=class extends Jt{constructor(t){super(),this.writable=!1,Ih(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new tz(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Oh(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=JU(t);return n.length?"?"+n:""}};const Gw="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Ig=64,nz={};let sE=0,I1=0,lE;function uE(e){let t="";do t=Gw[e%Ig]+t,e=Math.floor(e/Ig);while(e>0);return t}function Yw(){const e=uE(+new Date);return e!==lE?(sE=0,lE=e):e+"."+uE(sE++)}for(;I1<Ig;I1++)nz[Gw[I1]]=I1;let Zw=!1;try{Zw=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const rz=Zw;function Qw(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||rz))return new XMLHttpRequest}catch{}if(!t)try{return new Br[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function iz(){}const az=function(){return new Qw({xdomain:!1}).responseType!=null}();let oz=class extends Ny{constructor(t){if(super(t),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let i=location.port;i||(i=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||i!==t.port}const n=t&&t.forceBase64;this.supportsBinary=az&&!n,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Vw(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,zw(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Yw()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new nl(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,a)=>{this.onError("xhr post error",i,a)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}},nl=class Nd extends Jt{constructor(t,n){super(),Ih(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.data=n.data!==void 0?n.data:null,this.create()}create(){var t;const n=Kw(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new Qw(n);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this.opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this.opts.cookieJar)===null||i===void 0||i.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},r.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=Nd.requestsCount++,Nd.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=iz,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Nd.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}};nl.requestsCount=0;nl.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",cE);else if(typeof addEventListener=="function"){const e="onpagehide"in Br?"pagehide":"unload";addEventListener(e,cE,!1)}}function cE(){for(let e in nl.requests)nl.requests.hasOwnProperty(e)&&nl.requests[e].abort()}const Iy=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),P1=Br.WebSocket||Br.MozWebSocket,dE=!0,sz="arraybuffer",fE=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";let lz=class extends Ny{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=fE?{}:Kw(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=dE&&!fE?n?new P1(t,n):new P1(t):new P1(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;Dh(r,this.supportsBinary,a=>{const o={};try{dE&&this.ws.send(a)}catch{}i&&Iy(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Yw()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}check(){return!!P1}},uz=class extends Ny{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(t=>{const n=Ww(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=qw();i.readable.pipeTo(t.writable),this.writer=i.writable.getWriter();const a=()=>{r.read().then(({done:s,value:l})=>{s||(this.onPacket(l),a())}).catch(s=>{})};a();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this.writer.write(o).then(()=>this.onOpen())})}))}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this.writer.write(r).then(()=>{i&&Iy(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this.transport)===null||t===void 0||t.close()}};const cz={websocket:lz,webtransport:uz,polling:oz},dz=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,fz=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Pg(e){if(e.length>2e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=dz.exec(e||""),a={},o=14;for(;o--;)a[fz[o]]=i[o]||"";return n!=-1&&r!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=hz(a,a.path),a.queryKey=pz(a,a.query),a}function hz(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function pz(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,a){i&&(n[i]=a)}),n}let Xw=class Fs extends Jt{constructor(t,n={}){super(),this.binaryType=sz,this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=Pg(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=Pg(n.host).host),Ih(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=ez(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Nh,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new cz[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Fs.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;Fs.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Fs.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(c(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function a(){r||(r=!0,c(),n.close(),n=null)}const o=d=>{const f=new Error("probe error: "+d);f.transport=n.name,a(),this.emitReserved("upgradeError",f)};function s(){o("transport closed")}function l(){o("socket closed")}function u(d){n&&d.name!==n.name&&a()}const c=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",o),n.once("close",s),this.once("close",l),this.once("upgrading",u),this.upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onOpen(){if(this.readyState="open",Fs.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let t=0;const n=this.upgrades.length;for(;t<n;t++)this.probe(this.upgrades[t])}}onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),this.resetPingTimeout(),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=t.data,this.onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=QU(i)),r>0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const a={type:t,data:n,options:r};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){Fs.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;r<i;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}};Xw.protocol=Nh;function mz(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Pg(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const a=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port+t,r.href=r.protocol+"://"+a+(n&&n.port===r.port?"":":"+r.port),r}const gz=typeof ArrayBuffer=="function",vz=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Jw=Object.prototype.toString,yz=typeof Blob=="function"||typeof Blob<"u"&&Jw.call(Blob)==="[object BlobConstructor]",bz=typeof File=="function"||typeof File<"u"&&Jw.call(File)==="[object FileConstructor]";function Py(e){return gz&&(e instanceof ArrayBuffer||vz(e))||yz&&e instanceof Blob||bz&&e instanceof File}function Id(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Id(e[n]))return!0;return!1}if(Py(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Id(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Id(e[n]))return!0;return!1}function Ez(e){const t=[],n=e.data,r=e;return r.data=Rg(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Rg(e,t){if(!e)return e;if(Py(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Rg(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Rg(e[r],t));return n}return e}function _z(e,t){return e.data=Fg(e.data,t),delete e.attachments,e}function Fg(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Fg(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Fg(e[n],t));return e}const Tz=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Cz=5;var et;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(et||(et={}));class xz{constructor(t){this.replacer=t}encode(t){return(t.type===et.EVENT||t.type===et.ACK)&&Id(t)?this.encodeAsBinary({type:t.type===et.EVENT?et.BINARY_EVENT:et.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===et.BINARY_EVENT||t.type===et.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=Ez(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function hE(e){return Object.prototype.toString.call(e)==="[object Object]"}class Ry extends Jt{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===et.BINARY_EVENT;r||n.type===et.BINARY_ACK?(n.type=r?et.EVENT:et.ACK,this.reconstructor=new wz(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Py(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(et[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===et.BINARY_EVENT||r.type===et.BINARY_ACK){const a=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(a,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(o)}if(t.charAt(n+1)==="/"){const a=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(a,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const a=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}r.id=Number(t.substring(a,n+1))}if(t.charAt(++n)){const a=this.tryParse(t.substr(n));if(Ry.isPayloadValid(r.type,a))r.data=a;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case et.CONNECT:return hE(n);case et.DISCONNECT:return n===void 0;case et.CONNECT_ERROR:return typeof n=="string"||hE(n);case et.EVENT:case et.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&Tz.indexOf(n[0])===-1);case et.ACK:case et.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class wz{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=_z(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const e7=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Ry,Encoder:xz,get PacketType(){return et},protocol:Cz},Symbol.toStringTag,{value:"Module"}));function si(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Az=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});let t7=class extends Jt{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[si(t,"open",this.onopen.bind(this)),si(t,"packet",this.onpacket.bind(this)),si(t,"error",this.onerror.bind(this)),si(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(Az.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:et.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const o=this.ids++,s=n.pop();this._registerAckCallback(o,s),r.id=o}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===t&&this.sendBuffer.splice(o,1);n.call(this,new Error("operation has timed out"))},i);this.acks[t]=(...o)=>{this.io.clearTimeoutFn(a),n.apply(this,[null,...o])}}emitWithAck(t,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((i,a)=>{n.push((o,s)=>r?o?a(o):i(s):i(o)),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...a)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...a)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:et.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case et.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case et.EVENT:case et.BINARY_EVENT:this.onevent(t);break;case et.ACK:case et.BINARY_ACK:this.onack(t);break;case et.DISCONNECT:this.ondisconnect();break;case et.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:et.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:et.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}};function jl(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}jl.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};jl.prototype.reset=function(){this.attempts=0};jl.prototype.setMin=function(e){this.ms=e};jl.prototype.setMax=function(e){this.max=e};jl.prototype.setJitter=function(e){this.jitter=e};let Mg=class extends Jt{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Ih(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new jl({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||e7;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Xw(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=si(n,"open",function(){r.onopen(),t&&t()}),a=s=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",s),t?t(s):this.maybeReconnectOnOpen()},o=si(n,"error",a);if(this._timeout!==!1){const s=this._timeout,l=this.setTimeoutFn(()=>{i(),a(new Error("timeout")),n.close()},s);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(si(t,"ping",this.onping.bind(this)),si(t,"data",this.ondata.bind(this)),si(t,"error",this.onerror.bind(this)),si(t,"close",this.onclose.bind(this)),si(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Iy(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new t7(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}};const cu={};function Pd(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=mz(e,t.path||"/socket.io"),r=n.source,i=n.id,a=n.path,o=cu[i]&&a in cu[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return s?l=new Mg(r,t):(cu[i]||(cu[i]=new Mg(r,t)),l=cu[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Pd,{Manager:Mg,Socket:t7,io:Pd,connect:Pd});var Co=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(c){try{u(r.next(c))}catch(d){o(d)}}function l(c){try{u(r.throw(c))}catch(d){o(d)}}function u(c){c.done?a(c.value):i(c.value).then(s,l)}u((r=r.apply(e,t||[])).next())})};const kz="v1",Sz="https://api.novu.co",Dz="@novu/client",Oz="2.0.0-canary.0",Nz=`${Dz}-${Oz}`;class Iz{constructor({apiVersion:t=kz,backendUrl:n=Sz,userAgent:r=Nz}={}){this.apiVersion=t,this.backendUrl=`${n}/${this.apiVersion}`,this.headers={"Content-Type":"application/json","User-Agent":r}}setAuthorizationToken(t){this.headers.Authorization=`Bearer ${t}`}disposeAuthorizationToken(){delete this.headers.Authorization}updateHeaders(t){this.headers=Object.assign(Object.assign({},this.headers),t)}getFullResponse(t,n){return Co(this,void 0,void 0,function*(){return yield(yield this.doFetch(t+this.getQueryString(n))).json()})}get(t,n){return Co(this,void 0,void 0,function*(){return(yield(yield this.doFetch(t+this.getQueryString(n))).json()).data})}post(t,n={}){return Co(this,void 0,void 0,function*(){return(yield(yield this.doFetch(t,{method:"POST",body:JSON.stringify(n)})).json()).data})}patch(t,n={}){return Co(this,void 0,void 0,function*(){return(yield(yield this.doFetch(t,{method:"PATCH",body:JSON.stringify(n)})).json()).data})}delete(t,n={}){return Co(this,void 0,void 0,function*(){return(yield(yield this.doFetch(t,{method:"DELETE",body:JSON.stringify(n)})).json()).data})}getQueryString(t){return t?"?"+new URLSearchParams(t).toString():""}doFetch(t,n={}){return Co(this,void 0,void 0,function*(){try{const r=yield fetch(this.backendUrl+t,Object.assign(Object.assign({},n),{headers:this.headers}));return yield this.checkResponseStatus(r),r}catch(r){throw r}})}checkResponseStatus(t){return Co(this,void 0,void 0,function*(){if(!t.ok){const n=yield t.json();throw new Error(`HTTP error! Status: ${t.status}, Message: ${n.message}`)}})}}globalThis&&globalThis.__awaiter;globalThis&&globalThis.__rest;var Pz=(e,t)=>e===t?!0:!e||!t||e.length!==t.length?!1:e.every((n,r)=>n===t[r]),n7=(e,t)=>Pz(e,t)||!e&&(t==null?void 0:t.length)===0||(e==null?void 0:e.length)===0&&!t,Nf=(e,t)=>n7(e.tags,t.tags)&&e.read===t.read&&e.archived===t.archived,Ms,Rz=class{constructor(){Ge(this,Ms),Qe(this,Ms,Bw())}on(e,t){return oe(this,Ms).on(e,t),()=>{this.off(e,t)}}off(e,t){oe(this,Ms).off(e,t)}emit(e,t){oe(this,Ms).emit(e,t)}};Ms=new WeakMap;var or=class extends Error{constructor(e,t){super(e),this.originalError=t}},Fo,Ru,Fy=class{constructor({inboxServiceInstance:e,eventEmitterInstance:t}){Ge(this,Fo,[]),Ge(this,Ru),this._emitter=t,this._inboxService=e,this._emitter.on("session.initialize.resolved",({error:n,data:r})=>{r?(this.onSessionSuccess(r),oe(this,Fo).forEach(i=>Ve(this,[i],function*({fn:a,resolve:o}){o(yield a())})),Qe(this,Fo,[])):n&&(this.onSessionError(n),Qe(this,Ru,n),oe(this,Fo).forEach(({resolve:i})=>{i({error:new or("Failed to initialize session, please contact the support",n)})}),Qe(this,Fo,[]))})}onSessionSuccess(e){}onSessionError(e){}callWithSession(e){return Ve(this,null,function*(){return this._inboxService.isSessionInitialized?e():oe(this,Ru)?Promise.resolve({error:new or("Failed to initialize session, please contact the support",oe(this,Ru))}):new Promise((t,n)=>{oe(this,Fo).push({fn:e,resolve:t,reject:n})})})}};Fo=new WeakMap;Ru=new WeakMap;var mr,ni,Gr=class{constructor(t,n,r){Ge(this,mr),Ge(this,ni),Qe(this,mr,n),Qe(this,ni,r),this.id=t.id,this.subject=t.subject,this.body=t.body,this.to=t.to,this.isRead=t.isRead,this.isArchived=t.isArchived,this.createdAt=t.createdAt,this.readAt=t.readAt,this.archivedAt=t.archivedAt,this.avatar=t.avatar,this.primaryAction=t.primaryAction,this.secondaryAction=t.secondaryAction,this.channelType=t.channelType,this.tags=t.tags,this.redirect=t.redirect,this.data=t.data}read(){return r7({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this}})}unread(){return i7({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this}})}archive(){return a7({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this}})}unarchive(){return o7({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this}})}completePrimary(){if(!this.primaryAction)throw new Error("Primary action is not available");return If({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this},actionType:"primary"})}completeSecondary(){if(!this.primaryAction)throw new Error("Secondary action is not available");return If({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this},actionType:"secondary"})}revertPrimary(){if(!this.primaryAction)throw new Error("Primary action is not available");return Pf({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this},actionType:"primary"})}revertSecondary(){if(!this.primaryAction)throw new Error("Secondary action is not available");return Pf({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this},actionType:"secondary"})}on(t,n){const r=oe(this,mr).on(t,n);return()=>{r()}}off(t,n){oe(this,mr).off(t,n)}};mr=new WeakMap;ni=new WeakMap;var r7=e=>Ve(void 0,[e],function*({emitter:t,apiService:n,args:r}){const{notificationId:i,optimisticValue:a}=Hl(r,{isRead:!0,readAt:new Date().toISOString(),isArchived:!1,archivedAt:void 0},{emitter:t,apiService:n});try{t.emit("notification.read.pending",{args:r,data:a});const o=yield n.read(i),s=new Gr(o,t,n);return t.emit("notification.read.resolved",{args:r,data:s}),{data:s}}catch(o){return t.emit("notification.read.resolved",{args:r,error:o}),{error:new or("Failed to read notification",o)}}}),i7=e=>Ve(void 0,[e],function*({emitter:t,apiService:n,args:r}){const{notificationId:i,optimisticValue:a}=Hl(r,{isRead:!1,readAt:null,isArchived:!1,archivedAt:void 0},{emitter:t,apiService:n});try{t.emit("notification.unread.pending",{args:r,data:a});const o=yield n.unread(i),s=new Gr(o,t,n);return t.emit("notification.unread.resolved",{args:r,data:s}),{data:s}}catch(o){return t.emit("notification.unread.resolved",{args:r,error:o}),{error:new or("Failed to unread notification",o)}}}),a7=e=>Ve(void 0,[e],function*({emitter:t,apiService:n,args:r}){const{notificationId:i,optimisticValue:a}=Hl(r,{isArchived:!0,archivedAt:new Date().toISOString(),isRead:!0,readAt:new Date().toISOString()},{emitter:t,apiService:n});try{t.emit("notification.archive.pending",{args:r,data:a});const o=yield n.archive(i),s=new Gr(o,t,n);return t.emit("notification.archive.resolved",{args:r,data:s}),{data:s}}catch(o){return t.emit("notification.archive.resolved",{args:r,error:o}),{error:new or("Failed to archive notification",o)}}}),o7=e=>Ve(void 0,[e],function*({emitter:t,apiService:n,args:r}){const{notificationId:i,optimisticValue:a}=Hl(r,{isArchived:!1,archivedAt:null,isRead:!0,readAt:new Date().toISOString()},{emitter:t,apiService:n});try{t.emit("notification.unarchive.pending",{args:r,data:a});const o=yield n.unarchive(i),s=new Gr(o,t,n);return t.emit("notification.unarchive.resolved",{args:r,data:s}),{data:s}}catch(o){return t.emit("notification.unarchive.resolved",{args:r,error:o}),{error:new or("Failed to unarchive notification",o)}}}),If=e=>Ve(void 0,[e],function*({emitter:t,apiService:n,args:r,actionType:i}){const a=i==="primary"?{primaryAction:an(Ye({},"notification"in r?r.notification.primaryAction:{}),{isCompleted:!0})}:{secondaryAction:an(Ye({},"notification"in r?r.notification.secondaryAction:{}),{isCompleted:!0})},{notificationId:o,optimisticValue:s}=Hl(r,a,{emitter:t,apiService:n});try{t.emit("notification.complete_action.pending",{args:r,data:s});const l=yield n.completeAction({actionType:i,notificationId:o}),u=new Gr(l,t,n);return t.emit("notification.complete_action.resolved",{args:r,data:u}),{data:u}}catch(l){return t.emit("notification.complete_action.resolved",{args:r,error:l}),{error:new or(`Failed to complete ${i} action on the notification`,l)}}}),Pf=e=>Ve(void 0,[e],function*({emitter:t,apiService:n,args:r,actionType:i}){const a=i==="primary"?{primaryAction:an(Ye({},"notification"in r?r.notification.primaryAction:{}),{isCompleted:!1})}:{secondaryAction:an(Ye({},"notification"in r?r.notification.secondaryAction:{}),{isCompleted:!1})},{notificationId:o,optimisticValue:s}=Hl(r,a,{emitter:t,apiService:n});try{t.emit("notification.revert_action.pending",{args:r,data:s});const l=yield n.revertAction({actionType:i,notificationId:o}),u=new Gr(l,t,n);return t.emit("notification.revert_action.resolved",{args:r,data:u}),{data:u}}catch(l){return t.emit("notification.revert_action.resolved",{args:r,error:l}),{error:new or("Failed to fetch notifications",l)}}}),Hl=(e,t,n)=>"notification"in e?{notificationId:e.notification.id,optimisticValue:new Gr(Ye(Ye({},e.notification),t),n.emitter,n.apiService)}:{notificationId:e.notificationId},Fz=e=>Ve(void 0,[e],function*({emitter:t,inboxService:n,notificationsCache:r,tags:i}){try{const o=r.getUniqueNotifications({tags:i}).map(s=>new Gr(an(Ye({},s),{isRead:!0,readAt:new Date().toISOString(),isArchived:!1,archivedAt:void 0}),t,n));return t.emit("notifications.read_all.pending",{args:{tags:i},data:o}),yield n.readAll({tags:i}),t.emit("notifications.read_all.resolved",{args:{tags:i},data:o}),{}}catch(a){return t.emit("notifications.read_all.resolved",{args:{tags:i},error:a}),{error:new or("Failed to read all notifications",a)}}}),Mz=e=>Ve(void 0,[e],function*({emitter:t,inboxService:n,notificationsCache:r,tags:i}){try{const o=r.getUniqueNotifications({tags:i}).map(s=>new Gr(an(Ye({},s),{isRead:!0,readAt:new Date().toISOString(),isArchived:!0,archivedAt:new Date().toISOString()}),t,n));return t.emit("notifications.archive_all.pending",{args:{tags:i},data:o}),yield n.archiveAll({tags:i}),t.emit("notifications.archive_all.resolved",{args:{tags:i},data:o}),{}}catch(a){return t.emit("notifications.archive_all.resolved",{args:{tags:i},error:a}),{error:new or("Failed to archive all notifications",a)}}}),Bz=e=>Ve(void 0,[e],function*({emitter:t,inboxService:n,notificationsCache:r,tags:i}){try{const o=r.getUniqueNotifications({tags:i,read:!0}).map(s=>new Gr(an(Ye({},s),{isArchived:!0,archivedAt:new Date().toISOString()}),t,n));return t.emit("notifications.archive_all_read.pending",{args:{tags:i},data:o}),yield n.archiveAllRead({tags:i}),t.emit("notifications.archive_all_read.resolved",{args:{tags:i},data:o}),{}}catch(a){return t.emit("notifications.archive_all_read.resolved",{args:{tags:i},error:a}),{error:new or("Failed to archive all read notifications",a)}}}),Ai,s7=class{constructor(){Ge(this,Ai),Qe(this,Ai,new Map)}get(e){return oe(this,Ai).get(e)}getValues(){return Array.from(oe(this,Ai).values())}entries(){return Array.from(oe(this,Ai).entries())}keys(){return Array.from(oe(this,Ai).keys())}set(e,t){oe(this,Ai).set(e,t)}remove(e){oe(this,Ai).delete(e)}clear(){oe(this,Ai).clear()}};Ai=new WeakMap;var l7=({tags:e,read:t,archived:n,limit:r,offset:i,after:a})=>Object.entries({tags:e,read:t,archived:n,limit:r,offset:i,after:a}).filter(([o,s])=>s!=null&&!(Array.isArray(s)&&s.length===0)).reduce((o,[s,l])=>(o[s]=l,o),{}),Am=({tags:e,read:t,archived:n,limit:r,offset:i,after:a})=>JSON.stringify(l7({tags:e,read:t,archived:n,limit:r,offset:i,after:a})),Lz=({tags:e,read:t,archived:n})=>JSON.stringify(l7({tags:e,read:t,archived:n})),Ts=e=>JSON.parse(e),$z=["notification.read.pending","notification.read.resolved","notification.unread.pending","notification.unread.resolved","notification.complete_action.pending","notification.complete_action.resolved","notification.revert_action.pending","notification.revert_action.resolved","notifications.read_all.pending","notifications.read_all.resolved"],jz=["notification.archive.pending","notification.unarchive.pending","notifications.archive_all.pending","notifications.archive_all_read.pending"],Mo,kn,Hz=class{constructor({emitter:e}){Ge(this,Mo),Ge(this,kn),this.updateNotification=(t,n)=>{const r=oe(this,kn).get(t);if(!r)return!1;const i=r.notifications.findIndex(o=>o.id===n.id);if(i===-1)return!1;const a=[...r.notifications];return a[i]=n,oe(this,kn).set(t,an(Ye({},r),{notifications:a})),!0},this.removeNotification=(t,n)=>{const r=oe(this,kn).get(t);if(!r)return!1;const i=r.notifications.findIndex(o=>o.id===n.id);if(i===-1)return!1;const a=[...r.notifications];return a.splice(i,1),oe(this,kn).set(t,an(Ye({},r),{notifications:a})),!0},this.handleNotificationEvent=({remove:t}={remove:!1})=>({data:n})=>{if(!n)return;const r=Array.isArray(n)?n:[n],i=new Set;oe(this,kn).keys().forEach(a=>{r.forEach(o=>{let s=!1;t?s=this.removeNotification(a,o):s=this.updateNotification(a,o),s&&i.add(Lz(Ts(a)))})}),i.forEach(a=>{const o=this.getAggregated(Ts(a));oe(this,Mo).emit("notifications.list.updated",{data:o})})},Qe(this,Mo,e),$z.forEach(t=>{oe(this,Mo).on(t,this.handleNotificationEvent())}),jz.forEach(t=>{oe(this,Mo).on(t,this.handleNotificationEvent({remove:!0}))}),Qe(this,kn,new s7)}getAggregated(e){return oe(this,kn).keys().filter(n=>{const r=Ts(n);return Nf(r,e)}).map(n=>oe(this,kn).get(n)).reduce((n,r)=>r?{hasMore:r.hasMore,filter:r.filter,notifications:[...n.notifications,...r.notifications]}:n,{hasMore:!1,filter:{},notifications:[]})}has(e){return oe(this,kn).get(Am(e))!==void 0}set(e,t){oe(this,kn).set(Am(e),t)}update(e,t){this.set(e,t);const n=this.getAggregated(Ts(Am(e)));oe(this,Mo).emit("notifications.list.updated",{data:n})}getAll(e){if(this.has(e))return this.getAggregated({tags:e.tags,read:e.read,archived:e.archived})}getUniqueNotifications({tags:e,read:t}){const n=oe(this,kn).keys(),r=new Map;return n.forEach(i=>{const a=Ts(i);if(n7(e,a.tags)){const o=oe(this,kn).get(i);if(!o)return;o.notifications.filter(s=>typeof t>"u"||t===s.isRead).forEach(s=>r.set(s.id,s))}}),Array.from(r.values())}clear(e){oe(this,kn).keys().forEach(n=>{Nf(Ts(n),e)&&oe(this,kn).remove(n)})}clearAll(){oe(this,kn).clear()}};Mo=new WeakMap;kn=new WeakMap;var Rd,Uz=class extends Fy{constructor({useCache:e,inboxServiceInstance:t,eventEmitterInstance:n}){super({eventEmitterInstance:n,inboxServiceInstance:t}),Ge(this,Rd),this.cache=new Hz({emitter:n}),Qe(this,Rd,e)}list(){return Ve(this,arguments,function*(e={}){var t=e,{limit:n=10}=t,r=Dy(t,["limit"]);return this.callWithSession(()=>Ve(this,null,function*(){const i=Ye({limit:n},r);try{const a="useCache"in i?i.useCache:oe(this,Rd);let o=a?this.cache.getAll(i):void 0;if(this._emitter.emit("notifications.list.pending",{args:i,data:o}),!o){const s=yield this._inboxService.fetchNotifications(Ye({limit:n},r));o={hasMore:s.hasMore,filter:s.filter,notifications:s.data.map(l=>new Gr(l,this._emitter,this._inboxService))},a&&(this.cache.set(i,o),o=this.cache.getAll(i))}return this._emitter.emit("notifications.list.resolved",{args:i,data:o}),{data:o}}catch(a){return this._emitter.emit("notifications.list.resolved",{args:i,error:a}),{error:new or("Failed to fetch notifications",a)}}}))})}count(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){const t=e&&"filters"in e?e.filters:[Ye({},e)];try{this._emitter.emit("notifications.count.pending",{args:e});const n=yield this._inboxService.count({filters:t}),r=e&&"filters"in e?{counts:n.data}:n.data[0];return this._emitter.emit("notifications.count.resolved",{args:e,data:r}),{data:r}}catch(n){return this._emitter.emit("notifications.count.resolved",{args:e,error:n}),{error:new or("Failed to count notifications",n)}}}))})}read(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return r7({emitter:this._emitter,apiService:this._inboxService,args:e})}))})}unread(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return i7({emitter:this._emitter,apiService:this._inboxService,args:e})}))})}archive(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return a7({emitter:this._emitter,apiService:this._inboxService,args:e})}))})}unarchive(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return o7({emitter:this._emitter,apiService:this._inboxService,args:e})}))})}completePrimary(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return If({emitter:this._emitter,apiService:this._inboxService,args:e,actionType:"primary"})}))})}completeSecondary(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return If({emitter:this._emitter,apiService:this._inboxService,args:e,actionType:"secondary"})}))})}revertPrimary(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return Pf({emitter:this._emitter,apiService:this._inboxService,args:e,actionType:"primary"})}))})}revertSecondary(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return Pf({emitter:this._emitter,apiService:this._inboxService,args:e,actionType:"secondary"})}))})}readAll(){return Ve(this,arguments,function*({tags:e}={}){return this.callWithSession(()=>Ve(this,null,function*(){return Fz({emitter:this._emitter,inboxService:this._inboxService,notificationsCache:this.cache,tags:e})}))})}archiveAll(){return Ve(this,arguments,function*({tags:e}={}){return this.callWithSession(()=>Ve(this,null,function*(){return Mz({emitter:this._emitter,inboxService:this._inboxService,notificationsCache:this.cache,tags:e})}))})}archiveAllRead(){return Ve(this,arguments,function*({tags:e}={}){return this.callWithSession(()=>Ve(this,null,function*(){return Bz({emitter:this._emitter,inboxService:this._inboxService,notificationsCache:this.cache,tags:e})}))})}clearCache({filter:e}={}){return e?this.cache.clear(e??{}):this.cache.clearAll()}};Rd=new WeakMap;var Bs,Fd,Bo,zz=class{constructor(e,t,n){Ge(this,Bs),Ge(this,Fd),Ge(this,Bo),Qe(this,Bs,n),Qe(this,Fd,t),Qe(this,Bo,e)}initialize(){return Ve(this,null,function*(){try{const{applicationIdentifier:e,subscriberId:t,subscriberHash:n}=oe(this,Bo);oe(this,Bs).emit("session.initialize.pending",{args:oe(this,Bo)});const r=yield oe(this,Fd).initializeSession({applicationIdentifier:e,subscriberId:t,subscriberHash:n});oe(this,Bs).emit("session.initialize.resolved",{args:oe(this,Bo),data:r})}catch(e){oe(this,Bs).emit("session.initialize.resolved",{args:oe(this,Bo),error:e})}})}};Bs=new WeakMap;Fd=new WeakMap;Bo=new WeakMap;var Vz=e=>Ve(void 0,[e],function*({emitter:t,apiService:n,cache:r,useCache:i,args:a}){const{workflowId:o,channelPreferences:s}=a;try{t.emit("preference.update.pending",{args:a,data:a.preference?new Rf(an(Ye({},a.preference),{channels:Ye(Ye({},a.preference.channels),s)}),{emitterInstance:t,inboxServiceInstance:n,cache:r,useCache:i}):void 0});let l;o?l=yield n.updateWorkflowPreferences({workflowId:o,channelPreferences:s}):(qz({emitter:t,apiService:n,cache:r,useCache:i,args:a}),l=yield n.updateGlobalPreferences(s));const u=new Rf(l,{emitterInstance:t,inboxServiceInstance:n,cache:r,useCache:i});return t.emit("preference.update.resolved",{args:a,data:u}),{data:u}}catch(l){return t.emit("preference.update.resolved",{args:a,error:l}),{error:new or("Failed to fetch notifications",l)}}}),qz=({emitter:e,apiService:t,cache:n,useCache:r,args:i})=>{const a=r?n==null?void 0:n.getAll({}):void 0;a==null||a.forEach(o=>{var s;if(o.level==="template"){const l=an(Ye({},o),{channels:Object.entries(o.channels).reduce((c,[d,f])=>{var h;const m=d;return c[m]=(h=i.channelPreferences[m])!=null?h:f,c},{})}),u=i.preference?new Rf(l,{emitterInstance:e,inboxServiceInstance:t,cache:n,useCache:r}):void 0;u&&e.emit("preference.update.pending",{args:{workflowId:(s=o.workflow)==null?void 0:s.id,channelPreferences:u.channels},data:u})}})},Md,Bd,Ld,$d,Rf=class{constructor(e,{emitterInstance:t,inboxServiceInstance:n,cache:r,useCache:i}){Ge(this,Md),Ge(this,Bd),Ge(this,Ld),Ge(this,$d),Qe(this,Md,t),Qe(this,Bd,n),Qe(this,Ld,r),Qe(this,$d,i),this.level=e.level,this.enabled=e.enabled,this.channels=e.channels,this.workflow=e.workflow}update({channelPreferences:e}){var t;return Vz({emitter:oe(this,Md),apiService:oe(this,Bd),cache:oe(this,Ld),useCache:oe(this,$d),args:{workflowId:(t=this.workflow)==null?void 0:t.id,channelPreferences:e,preference:{level:this.level,enabled:this.enabled,channels:this.channels,workflow:this.workflow}}})}};Md=new WeakMap;Bd=new WeakMap;Ld=new WeakMap;$d=new WeakMap;var Wz=["preference.update.pending","preference.update.resolved"],Kz=({tags:e})=>Object.entries({tags:e}).reduce((t,[n,r])=>(r==null||Array.isArray(r)&&r.length===0||(t[n]=r),t),{}),km=({tags:e})=>JSON.stringify(Kz({tags:e})),Fu,ri,Gz=class{constructor({emitterInstance:e}){Ge(this,Fu),Ge(this,ri),this.updatePreference=(t,n)=>{const r=oe(this,ri).get(t);if(!r)return!1;const i=r.findIndex(o=>{var s,l;return((s=o.workflow)==null?void 0:s.id)===((l=n.workflow)==null?void 0:l.id)||o.level===n.level&&n.level==="global"});if(i===-1)return!1;const a=[...r];return a[i]=n,oe(this,ri).set(t,a),!0},this.handlePreferenceEvent=({data:t})=>{t&&oe(this,ri).keys().forEach(n=>{const r=this.updatePreference(n,t),i=oe(this,ri).get(n);!r||!i||oe(this,Fu).emit("preferences.list.updated",{data:i})})},Qe(this,Fu,e),Wz.forEach(t=>{oe(this,Fu).on(t,this.handlePreferenceEvent)}),Qe(this,ri,new s7)}has(e){return oe(this,ri).get(km(e))!==void 0}set(e,t){oe(this,ri).set(km(e),t)}getAll(e){if(this.has(e))return oe(this,ri).get(km(e))}clearAll(){oe(this,ri).clear()}};Fu=new WeakMap;ri=new WeakMap;var Ls,Yz=class extends Fy{constructor({useCache:t,inboxServiceInstance:n,eventEmitterInstance:r}){super({eventEmitterInstance:r,inboxServiceInstance:n}),Ge(this,Ls),this.cache=new Gz({emitterInstance:this._emitter}),Qe(this,Ls,t)}list(){return Ve(this,arguments,function*(t={}){return this.callWithSession(()=>Ve(this,null,function*(){try{let n=oe(this,Ls)?this.cache.getAll(t):void 0;return this._emitter.emit("preferences.list.pending",{args:t,data:n}),n||(n=(yield this._inboxService.fetchPreferences(t.tags)).map(i=>new Rf(i,{emitterInstance:this._emitter,inboxServiceInstance:this._inboxService,cache:this.cache,useCache:oe(this,Ls)})),oe(this,Ls)&&(this.cache.set(t,n),n=this.cache.getAll(t))),this._emitter.emit("preferences.list.resolved",{args:t,data:n}),{data:n}}catch(n){throw this._emitter.emit("preferences.list.resolved",{args:t,error:n}),n}}))})}};Ls=new WeakMap;var Zz="https://ws.novu.co",pE="notifications.notification_received",mE="notifications.unseen_count_changed",gE="notifications.unread_count_changed",Qz=({_id:e,content:t,read:n,archived:r,createdAt:i,lastReadDate:a,archivedAt:o,channel:s,subscriber:l,subject:u,avatar:c,cta:d,tags:f,data:h})=>{var m,p,y,v,b,_,T,C,x,w;const P={id:(m=l==null?void 0:l._id)!=null?m:"",firstName:l==null?void 0:l.firstName,lastName:l==null?void 0:l.lastName,avatar:l==null?void 0:l.avatar,subscriberId:(p=l==null?void 0:l.subscriberId)!=null?p:""},O=(v=(y=d.action)==null?void 0:y.buttons)==null?void 0:v.find(S=>S.type==="primary"),M=(_=(b=d.action)==null?void 0:b.buttons)==null?void 0:_.find(S=>S.type==="secondary"),R=(C=(T=d.action)==null?void 0:T.result)==null?void 0:C.type,D=(x=d.action)==null?void 0:x.status;return{id:e,subject:u,body:t,to:P,isRead:n,isArchived:r,createdAt:i,readAt:a,archivedAt:o,avatar:c,primaryAction:O&&{label:O.content,isCompleted:R==="primary"&&D==="done",redirect:O.url?{target:O.target,url:O.url}:void 0},secondaryAction:M&&{label:M.content,isCompleted:R==="secondary"&&D==="done",redirect:M.url?{target:M.target,url:M.url}:void 0},channelType:s,tags:f,redirect:(w=d.data)!=null&&w.url?{url:d.data.url,target:d.data.target}:void 0,data:h}},tc,Si,ha,Sc,My,By,Ly,jd,Bg,Xz=class extends Fy{constructor({socketUrl:t,inboxServiceInstance:n,eventEmitterInstance:r}){super({eventEmitterInstance:r,inboxServiceInstance:n}),Ge(this,jd),Ge(this,tc),Ge(this,Si),Ge(this,ha),Ge(this,Sc),Ge(this,My,({message:i})=>{oe(this,Si).emit(pE,{result:new Gr(Qz(i),oe(this,Si),this._inboxService)})}),Ge(this,By,({unseenCount:i})=>{oe(this,Si).emit(mE,{result:i})}),Ge(this,Ly,({unreadCount:i})=>{oe(this,Si).emit(gE,{result:i})}),Qe(this,Si,r),Qe(this,Sc,t??Zz)}onSessionSuccess({token:t}){Qe(this,tc,t)}isSocketEvent(t){return t===pE||t===mE||t===gE}initialize(){if(oe(this,tc)){Of(this,jd,Bg).call(this).catch(t=>{console.error(t)});return}this.callWithSession(()=>Ve(this,null,function*(){return Of(this,jd,Bg).call(this).catch(t=>{console.error(t)}),{}}))}};tc=new WeakMap;Si=new WeakMap;ha=new WeakMap;Sc=new WeakMap;My=new WeakMap;By=new WeakMap;Ly=new WeakMap;jd=new WeakSet;Bg=function(){return Ve(this,null,function*(){var e,t,n;if(oe(this,ha))return;const r={socketUrl:oe(this,Sc)};oe(this,Si).emit("socket.connect.pending",{args:r}),Qe(this,ha,Pd(oe(this,Sc),{reconnectionDelayMax:1e4,transports:["websocket"],query:{token:`${oe(this,tc)}`}})),oe(this,ha).on("connect",()=>{oe(this,Si).emit("socket.connect.resolved",{args:r})}),oe(this,ha).on("connect_error",i=>{oe(this,Si).emit("socket.connect.resolved",{args:r,error:i})}),(e=oe(this,ha))==null||e.on("notification_received",oe(this,My)),(t=oe(this,ha))==null||t.on("unseen_count_changed",oe(this,By)),(n=oe(this,ha))==null||n.on("unread_count_changed",oe(this,Ly))})};var Jz="https://api.novu.co",eV="2024-06-26",Mu="/inbox",Jr=`${Mu}/notifications`,pn,tV=class{constructor(e={}){this.isSessionInitialized=!1,Ge(this,pn),Qe(this,pn,new Iz(e)),oe(this,pn).updateHeaders({"Novu-API-Version":eV,"Novu-User-Agent":e.userAgent||"@novu/js"})}initializeSession(e){return Ve(this,arguments,function*({applicationIdentifier:t,subscriberId:n,subscriberHash:r}){const i=yield oe(this,pn).post(`${Mu}/session`,{applicationIdentifier:t,subscriberId:n,subscriberHash:r});return oe(this,pn).setAuthorizationToken(i.token),this.isSessionInitialized=!0,i})}fetchNotifications({after:e,archived:t,limit:n=10,offset:r,read:i,tags:a}){const o=new URLSearchParams(`limit=${n}`);return e&&o.append("after",e),r&&o.append("offset",`${r}`),a&&a.forEach(s=>o.append("tags[]",s)),i!==void 0&&o.append("read",`${i}`),t!==void 0&&o.append("archived",`${t}`),oe(this,pn).getFullResponse(`${Jr}?${o.toString()}`)}count({filters:e}){return oe(this,pn).getFullResponse(`${Jr}/count?filters=${JSON.stringify(e)}`)}read(e){return oe(this,pn).patch(`${Jr}/${e}/read`)}unread(e){return oe(this,pn).patch(`${Jr}/${e}/unread`)}archive(e){return oe(this,pn).patch(`${Jr}/${e}/archive`)}unarchive(e){return oe(this,pn).patch(`${Jr}/${e}/unarchive`)}readAll({tags:e}){return oe(this,pn).post(`${Jr}/read`,{tags:e})}archiveAll({tags:e}){return oe(this,pn).post(`${Jr}/archive`,{tags:e})}archiveAllRead({tags:e}){return oe(this,pn).post(`${Jr}/read-archive`,{tags:e})}completeAction({actionType:e,notificationId:t}){return oe(this,pn).patch(`${Jr}/${t}/complete`,{actionType:e})}revertAction({actionType:e,notificationId:t}){return oe(this,pn).patch(`${Jr}/${t}/revert`,{actionType:e})}fetchPreferences(e){const t=new URLSearchParams;e&&e.forEach(r=>t.append("tags[]",r));const n=t.size?`?${t.toString()}`:"";return oe(this,pn).get(`${Mu}/preferences${n}`)}updateGlobalPreferences(e){return oe(this,pn).patch(`${Mu}/preferences`,e)}updateWorkflowPreferences({workflowId:e,channelPreferences:t}){return oe(this,pn).patch(`${Mu}/preferences/${e}`,t)}};pn=new WeakMap;var nV="2.6.0",rV="@novu/js",iV=`${rV}@${nV}`,da,Hd,Bu,Lo,u7=class{constructor(e){Ge(this,da),Ge(this,Hd),Ge(this,Bu),Ge(this,Lo);var t,n,r,i;Qe(this,Lo,new tV({backendUrl:(t=e.backendUrl)!=null?t:Jz,userAgent:(n=e.__userAgent)!=null?n:iV})),Qe(this,da,new Rz),Qe(this,Hd,new zz({applicationIdentifier:e.applicationIdentifier,subscriberId:e.subscriberId,subscriberHash:e.subscriberHash},oe(this,Lo),oe(this,da))),oe(this,Hd).initialize(),this.notifications=new Uz({useCache:(r=e.useCache)!=null?r:!0,inboxServiceInstance:oe(this,Lo),eventEmitterInstance:oe(this,da)}),this.preferences=new Yz({useCache:(i=e.useCache)!=null?i:!0,inboxServiceInstance:oe(this,Lo),eventEmitterInstance:oe(this,da)}),Qe(this,Bu,new Xz({socketUrl:e.socketUrl,eventEmitterInstance:oe(this,da),inboxServiceInstance:oe(this,Lo)})),this.on=(a,o)=>{oe(this,Bu).isSocketEvent(a)&&oe(this,Bu).initialize();const s=oe(this,da).on(a,o);return()=>{s()}},this.off=(a,o)=>{oe(this,da).off(a,o)}}};da=new WeakMap;Hd=new WeakMap;Bu=new WeakMap;Lo=new WeakMap;var aV=e=>{const t=[];let n="",r=!1;for(let i=0;i<e.length;i+=1)e[i]==="\\"&&e[i+1]==="*"?(n+="*",i+=1):e[i]==="*"&&e[i+1]==="*"?(n&&(t.push({type:r?"bold":"text",content:n}),n=""),r=!r,i+=1):n+=e[i];return n&&t.push({type:r?"bold":"text",content:n}),t};const c7={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return vE(this.context.count)},getNextContextId(){return vE(this.context.count++)}};function vE(e){const t=String(e),n=t.length-1;return c7.context.id+(n?String.fromCharCode(96+n):"")+t}const oV=(e,t)=>e===t,hi=Symbol("solid-proxy"),d7=typeof Proxy=="function",Lg=Symbol("solid-track"),Ff={equals:oV};let f7=y7;const Na=1,Mf=2,h7={owned:null,cleanups:null,context:null,owner:null},Sm={};var It=null;let Dm=null,sV=null,$t=null,Mn=null,ya=null,Ph=0;function nc(e,t){const n=$t,r=It,i=e.length===0,a=t===void 0?r:t,o=i?h7:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(()=>xn(()=>Dc(o)));It=o,$t=null;try{return qi(s,!0)}finally{$t=n,It=r}}function Me(e,t){t=t?Object.assign({},Ff,t):Ff;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=i=>(typeof i=="function"&&(i=i(n.value)),v7(n,i));return[g7.bind(n),r]}function Bf(e,t,n){const r=Rh(e,t,!0,Na);Ul(r)}function ct(e,t,n){const r=Rh(e,t,!1,Na);Ul(r)}function cn(e,t,n){f7=vV;const r=Rh(e,t,!1,Na);(!n||!n.render)&&(r.user=!0),ya?ya.push(r):Ul(r)}function He(e,t,n){n=n?Object.assign({},Ff,n):Ff;const r=Rh(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Ul(r),g7.bind(r)}function lV(e){return e&&typeof e=="object"&&"then"in e}function p7(e,t,n){let r,i,a;arguments.length===2&&typeof t=="object"||arguments.length===1?(r=!0,i=e,a=t||{}):(r=e,i=t,a=n||{});let o=null,s=Sm,l=!1,u="initialValue"in a,c=typeof r=="function"&&He(r);const d=new Set,[f,h]=(a.storage||Me)(a.initialValue),[m,p]=Me(void 0),[y,v]=Me(void 0,{equals:!1}),[b,_]=Me(u?"ready":"unresolved");function T(P,O,M,R){return o===P&&(o=null,R!==void 0&&(u=!0),(P===s||O===s)&&a.onHydrated&&queueMicrotask(()=>a.onHydrated(R,{value:O})),s=Sm,C(O,M)),O}function C(P,O){qi(()=>{O===void 0&&h(()=>P),_(O!==void 0?"errored":u?"ready":"unresolved"),p(O);for(const M of d.keys())M.decrement();d.clear()},!1)}function x(){const P=pV,O=f(),M=m();if(M!==void 0&&!o)throw M;return $t&&!$t.user&&P&&Bf(()=>{y(),o&&(P.resolved||d.has(P)||(P.increment(),d.add(P)))}),O}function w(P=!0){if(P!==!1&&l)return;l=!1;const O=c?c():r;if(O==null||O===!1){T(o,xn(f));return}const M=s!==Sm?s:xn(()=>i(O,{value:f(),refetching:P}));return lV(M)?(o=M,"value"in M?(M.status==="success"?T(o,M.value,void 0,O):T(o,void 0,jg(M.value),O),M):(l=!0,queueMicrotask(()=>l=!1),qi(()=>{_(u?"refreshing":"pending"),v()},!1),M.then(R=>T(M,R,void 0,O),R=>T(M,void 0,jg(R),O)))):(T(o,M,void 0,O),M)}return Object.defineProperties(x,{state:{get:()=>b()},error:{get:()=>m()},loading:{get(){const P=b();return P==="pending"||P==="refreshing"}},latest:{get(){if(!u)return x();const P=m();if(P&&!o)throw P;return f()}}}),c?Bf(()=>w(!1)):w(!1),[x,{refetch:w,mutate:h}]}function xl(e){return qi(e,!1)}function xn(e){if($t===null)return e();const t=$t;$t=null;try{return e()}finally{$t=t}}function sr(e){cn(()=>xn(e))}function dn(e){return It===null||(It.cleanups===null?It.cleanups=[e]:It.cleanups.push(e)),e}function $g(){return $t}function uV(){return It}function cV(e,t){const n=It,r=$t;It=e,$t=null;try{return qi(t,!0)}catch(i){$y(i)}finally{It=n,$t=r}}function dV(e){const t=$t,n=It;return Promise.resolve().then(()=>{$t=t,It=n;let r;return qi(e,!1),$t=It=null,r?r.done:void 0})}const[fV,Uve]=Me(!1);function hV(){return[fV,dV]}function vi(e,t){const n=Symbol("context");return{id:n,Provider:yV(n),defaultValue:e}}function lr(e){let t;return It&&It.context&&(t=It.context[e.id])!==void 0?t:e.defaultValue}function m7(e){const t=He(e),n=He(()=>Hg(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let pV;function g7(){if(this.sources&&this.state)if(this.state===Na)Ul(this);else{const e=Mn;Mn=null,qi(()=>$f(this),!1),Mn=e}if($t){const e=this.observers?this.observers.length:0;$t.sources?($t.sources.push(this),$t.sourceSlots.push(e)):($t.sources=[this],$t.sourceSlots=[e]),this.observers?(this.observers.push($t),this.observerSlots.push($t.sources.length-1)):(this.observers=[$t],this.observerSlots=[$t.sources.length-1])}return this.value}function v7(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&qi(()=>{for(let i=0;i<e.observers.length;i+=1){const a=e.observers[i],o=Dm&&Dm.running;o&&Dm.disposed.has(a),(o?!a.tState:!a.state)&&(a.pure?Mn.push(a):ya.push(a),a.observers&&b7(a)),o||(a.state=Na)}if(Mn.length>1e6)throw Mn=[],new Error},!1)),t}function Ul(e){if(!e.fn)return;Dc(e);const t=Ph;mV(e,e.value,t)}function mV(e,t,n){let r;const i=It,a=$t;$t=It=e;try{r=e.fn(t)}catch(o){return e.pure&&(e.state=Na,e.owned&&e.owned.forEach(Dc),e.owned=null),e.updatedAt=n+1,$y(o)}finally{$t=a,It=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?v7(e,r):e.value=r,e.updatedAt=n)}function Rh(e,t,n,r=Na,i){const a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:It,context:It?It.context:null,pure:n};return It===null||It!==h7&&(It.owned?It.owned.push(a):It.owned=[a]),a}function Lf(e){if(e.state===0)return;if(e.state===Mf)return $f(e);if(e.suspense&&xn(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Ph);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===Na)Ul(e);else if(e.state===Mf){const r=Mn;Mn=null,qi(()=>$f(e,t[0]),!1),Mn=r}}function qi(e,t){if(Mn)return e();let n=!1;t||(Mn=[]),ya?n=!0:ya=[],Ph++;try{const r=e();return gV(n),r}catch(r){n||(ya=null),Mn=null,$y(r)}}function gV(e){if(Mn&&(y7(Mn),Mn=null),e)return;const t=ya;ya=null,t.length&&qi(()=>f7(t),!1)}function y7(e){for(let t=0;t<e.length;t++)Lf(e[t])}function vV(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Lf(r)}for(t=0;t<n;t++)Lf(e[t])}function $f(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const i=r.state;i===Na?r!==t&&(!r.updatedAt||r.updatedAt<Ph)&&Lf(r):i===Mf&&$f(r,t)}}}function b7(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Mf,n.pure?Mn.push(n):ya.push(n),n.observers&&b7(n))}}function Dc(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),i=n.observers;if(i&&i.length){const a=i.pop(),o=n.observerSlots.pop();r<i.length&&(a.sourceSlots[o]=r,i[r]=a,n.observerSlots[r]=o)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Dc(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Dc(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function jg(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function $y(e,t=It){throw jg(e)}function Hg(e){if(typeof e=="function"&&!e.length)return Hg(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=Hg(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function yV(e,t){return function(r){let i;return ct(()=>i=xn(()=>(It.context={...It.context,[e]:r.value},m7(()=>r.children))),void 0),i}}const bV=Symbol("fallback");function yE(e){for(let t=0;t<e.length;t++)e[t]()}function EV(e,t,n={}){let r=[],i=[],a=[],o=0,s=t.length>1?[]:null;return dn(()=>yE(a)),()=>{let l=e()||[],u=l.length,c,d;return l[Lg],xn(()=>{let h,m,p,y,v,b,_,T,C;if(u===0)o!==0&&(yE(a),a=[],r=[],i=[],o=0,s&&(s=[])),n.fallback&&(r=[bV],i[0]=nc(x=>(a[0]=x,n.fallback())),o=1);else if(o===0){for(i=new Array(u),d=0;d<u;d++)r[d]=l[d],i[d]=nc(f);o=u}else{for(p=new Array(u),y=new Array(u),s&&(v=new Array(u)),b=0,_=Math.min(o,u);b<_&&r[b]===l[b];b++);for(_=o-1,T=u-1;_>=b&&T>=b&&r[_]===l[T];_--,T--)p[T]=i[_],y[T]=a[_],s&&(v[T]=s[_]);for(h=new Map,m=new Array(T+1),d=T;d>=b;d--)C=l[d],c=h.get(C),m[d]=c===void 0?-1:c,h.set(C,d);for(c=b;c<=_;c++)C=r[c],d=h.get(C),d!==void 0&&d!==-1?(p[d]=i[c],y[d]=a[c],s&&(v[d]=s[c]),d=m[d],h.set(C,d)):a[c]();for(d=b;d<u;d++)d in p?(i[d]=p[d],a[d]=y[d],s&&(s[d]=v[d],s[d](d))):i[d]=nc(f);i=i.slice(0,o=u),r=l.slice(0)}return i});function f(h){if(a[d]=h,s){const[m,p]=Me(d);return s[d]=p,t(l[d],m)}return t(l[d])}}}function Z(e,t){return xn(()=>e(t||{}))}function R1(){return!0}const Ug={get(e,t,n){return t===hi?n:e.get(t)},has(e,t){return t===hi?!0:e.has(t)},set:R1,deleteProperty:R1,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:R1,deleteProperty:R1}},ownKeys(e){return e.keys()}};function Om(e){return(e=typeof e=="function"?e():e)?e:{}}function _V(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function At(...e){let t=!1;for(let o=0;o<e.length;o++){const s=e[o];t=t||!!s&&hi in s,e[o]=typeof s=="function"?(t=!0,He(s)):s}if(d7&&t)return new Proxy({get(o){for(let s=e.length-1;s>=0;s--){const l=Om(e[s])[o];if(l!==void 0)return l}},has(o){for(let s=e.length-1;s>=0;s--)if(o in Om(e[s]))return!0;return!1},keys(){const o=[];for(let s=0;s<e.length;s++)o.push(...Object.keys(Om(e[s])));return[...new Set(o)]}},Ug);const n={},r=Object.create(null);for(let o=e.length-1;o>=0;o--){const s=e[o];if(!s)continue;const l=Object.getOwnPropertyNames(s);for(let u=l.length-1;u>=0;u--){const c=l[u];if(c==="__proto__"||c==="constructor")continue;const d=Object.getOwnPropertyDescriptor(s,c);if(!r[c])r[c]=d.get?{enumerable:!0,configurable:!0,get:_V.bind(n[c]=[d.get.bind(s)])}:d.value!==void 0?d:void 0;else{const f=n[c];f&&(d.get?f.push(d.get.bind(s)):d.value!==void 0&&f.push(()=>d.value))}}}const i={},a=Object.keys(r);for(let o=a.length-1;o>=0;o--){const s=a[o],l=r[s];l&&l.get?Object.defineProperty(i,s,l):i[s]=l?l.value:void 0}return i}function wn(e,...t){if(d7&&hi in e){const i=new Set(t.length>1?t.flat():t[0]),a=t.map(o=>new Proxy({get(s){return o.includes(s)?e[s]:void 0},has(s){return o.includes(s)&&s in e},keys(){return o.filter(s=>s in e)}},Ug));return a.push(new Proxy({get(o){return i.has(o)?void 0:e[o]},has(o){return i.has(o)?!1:o in e},keys(){return Object.keys(e).filter(o=>!i.has(o))}},Ug)),a}const n={},r=t.map(()=>({}));for(const i of Object.getOwnPropertyNames(e)){const a=Object.getOwnPropertyDescriptor(e,i),o=!a.get&&!a.set&&a.enumerable&&a.writable&&a.configurable;let s=!1,l=0;for(const u of t)u.includes(i)&&(s=!0,o?r[l][i]=a.value:Object.defineProperty(r[l],i,a)),++l;s||(o?n[i]=a.value:Object.defineProperty(n,i,a))}return[...r,n]}const E7=e=>`Stale read from <${e}>.`;function Wi(e){const t="fallback"in e&&{fallback:()=>e.fallback};return He(EV(()=>e.each,e.children,t||void 0))}function Tt(e){const t=e.keyed,n=He(()=>e.when,void 0,{equals:(r,i)=>t?r===i:!r==!i});return He(()=>{const r=n();if(r){const i=e.children;return typeof i=="function"&&i.length>0?xn(()=>i(t?r:()=>{if(!xn(n))throw E7("Show");return e.when})):i}return e.fallback},void 0,void 0)}function TV(e){let t=!1;const n=(a,o)=>(t?a[1]===o[1]:!a[1]==!o[1])&&a[2]===o[2],r=m7(()=>e.children),i=He(()=>{let a=r();Array.isArray(a)||(a=[a]);for(let o=0;o<a.length;o++){const s=a[o].when;if(s)return t=!!a[o].keyed,[o,s,a[o]]}return[-1]},void 0,{equals:n});return He(()=>{const[a,o,s]=i();if(a<0)return e.fallback;const l=s.children;return typeof l=="function"&&l.length>0?xn(()=>l(t?o:()=>{if(xn(i)[0]!==a)throw E7("Match");return s.when})):l},void 0,void 0)}function bE(e){return e}const CV=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],xV=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...CV]),wV=new Set(["innerHTML","textContent","innerText","children"]),AV=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),kV=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function SV(e,t){const n=kV[e];return typeof n=="object"?n[t]?n.$:void 0:n}const DV=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),OV=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),NV={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function IV(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,l=t[i-1].nextSibling,u=null;for(;o<i||s<a;){if(t[o]===n[s]){o++,s++;continue}for(;t[i-1]===n[a-1];)i--,a--;if(i===o){const c=a<r?s?n[s-1].nextSibling:n[a-s]:l;for(;s<a;)e.insertBefore(n[s++],c)}else if(a===s)for(;o<i;)(!u||!u.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){const c=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],c),t[i]=n[a]}else{if(!u){u=new Map;let d=s;for(;d<a;)u.set(n[d],d++)}const c=u.get(t[o]);if(c!=null)if(s<c&&c<a){let d=o,f=1,h;for(;++d<i&&d<a&&!((h=u.get(t[d]))==null||h!==c+f);)f++;if(f>c-s){const m=t[o];for(;s<c;)e.insertBefore(n[s++],m)}else e.replaceChild(n[s++],t[o++])}else o++;else t[o++].remove()}}}const EE="_$DX_DELEGATE";function PV(e,t,n,r={}){let i;return nc(a=>{i=a,t===document?e():Ie(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=""}}function Le(e,t,n){let r;const i=()=>{const o=document.createElement("template");return o.innerHTML=e,n?o.content.firstChild.firstChild:o.content.firstChild},a=t?()=>xn(()=>document.importNode(r||(r=i()),!0)):()=>(r||(r=i())).cloneNode(!0);return a.cloneNode=a,a}function zl(e,t=window.document){const n=t[EE]||(t[EE]=new Set);for(let r=0,i=e.length;r<i;r++){const a=e[r];n.has(a)||(n.add(a),t.addEventListener(a,jV))}}function er(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function RV(e,t,n,r){r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r)}function FV(e,t,n){n?e.setAttribute(t,""):e.removeAttribute(t)}function Ze(e,t){t==null?e.removeAttribute("class"):e.className=t}function _7(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const i=n[0];e.addEventListener(t,n[0]=a=>i.call(e,n[1],a))}else e.addEventListener(t,n,typeof n!="function"&&n)}function MV(e,t,n={}){const r=Object.keys(t||{}),i=Object.keys(n);let a,o;for(a=0,o=i.length;a<o;a++){const s=i[a];!s||s==="undefined"||t[s]||(_E(e,s,!1),delete n[s])}for(a=0,o=r.length;a<o;a++){const s=r[a],l=!!t[s];!s||s==="undefined"||n[s]===l||!l||(_E(e,s,!0),n[s]=l)}return n}function BV(e,t,n){if(!t)return n?er(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let i,a;for(a in n)t[a]==null&&r.removeProperty(a),delete n[a];for(a in t)i=t[a],i!==n[a]&&(r.setProperty(a,i),n[a]=i);return n}function Ft(e,t={},n,r){const i={};return r||ct(()=>i.children=wl(e,t.children,i.children)),ct(()=>typeof t.ref=="function"&&Ca(t.ref,e)),ct(()=>LV(e,t,n,!0,i,!0)),i}function Ca(e,t,n){return xn(()=>e(t,n))}function Ie(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return wl(e,t,r,n);ct(i=>wl(e,t(),i,n),r)}function LV(e,t,n,r,i={},a=!1){t||(t={});for(const o in i)if(!(o in t)){if(o==="children")continue;i[o]=TE(e,o,null,i[o],n,a,t)}for(const o in t){if(o==="children"){r||wl(e,t.children);continue}const s=t[o];i[o]=TE(e,o,s,i[o],n,a,t)}}function $V(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function _E(e,t,n){const r=t.trim().split(/\s+/);for(let i=0,a=r.length;i<a;i++)e.classList.toggle(r[i],n)}function TE(e,t,n,r,i,a,o){let s,l,u,c,d;if(t==="style")return BV(e,n,r);if(t==="classList")return MV(e,n,r);if(n===r)return r;if(t==="ref")a||n(e);else if(t.slice(0,3)==="on:"){const f=t.slice(3);r&&e.removeEventListener(f,r,typeof r!="function"&&r),n&&e.addEventListener(f,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const f=t.slice(10);r&&e.removeEventListener(f,r,!0),n&&e.addEventListener(f,n,!0)}else if(t.slice(0,2)==="on"){const f=t.slice(2).toLowerCase(),h=DV.has(f);if(!h&&r){const m=Array.isArray(r)?r[0]:r;e.removeEventListener(f,m)}(h||n)&&(_7(e,f,n,h),h&&zl([f]))}else if(t.slice(0,5)==="attr:")er(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")FV(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(u=wV.has(t))||!i&&((c=SV(t,e.tagName))||(l=xV.has(t)))||(s=e.nodeName.includes("-")||"is"in o))d&&(t=t.slice(5),l=!0),t==="class"||t==="className"?Ze(e,n):s&&!l&&!u?e[$V(t)]=n:e[c||t]=n;else{const f=i&&t.indexOf(":")>-1&&NV[t.split(":")[0]];f?RV(e,f,t,n):er(e,AV[t]||t,n)}return n}function jV(e){let t=e.target;const n=`$$${e.type}`,r=e.target,i=e.currentTarget,a=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),o=()=>{const l=t[n];if(l&&!t.disabled){const u=t[`${n}Data`];if(u!==void 0?l.call(t,u,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&a(t.host),!0},s=()=>{for(;o()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),e.composedPath){const l=e.composedPath();a(l[0]);for(let u=0;u<l.length-2&&(t=l[u],!!o());u++){if(t._$host){t=t._$host,s();break}if(t.parentNode===i)break}}else s();a(r)}function wl(e,t,n,r,i){for(;typeof n=="function";)n=n();if(t===n)return n;const a=typeof t,o=r!==void 0;if(e=o&&n[0]&&n[0].parentNode||e,a==="string"||a==="number"){if(a==="number"&&(t=t.toString(),t===n))return n;if(o){let s=n[0];s&&s.nodeType===3?s.data!==t&&(s.data=t):s=document.createTextNode(t),n=Cs(e,n,r,s)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||a==="boolean")n=Cs(e,n,r);else{if(a==="function")return ct(()=>{let s=t();for(;typeof s=="function";)s=s();n=wl(e,s,n,r)}),()=>n;if(Array.isArray(t)){const s=[],l=n&&Array.isArray(n);if(zg(s,t,n,i))return ct(()=>n=wl(e,s,n,r,!0)),()=>n;if(s.length===0){if(n=Cs(e,n,r),o)return n}else l?n.length===0?CE(e,s,r):IV(e,n,s):(n&&Cs(e),CE(e,s));n=s}else if(t.nodeType){if(Array.isArray(n)){if(o)return n=Cs(e,n,r,t);Cs(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function zg(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let s=t[a],l=n&&n[e.length],u;if(!(s==null||s===!0||s===!1))if((u=typeof s)=="object"&&s.nodeType)e.push(s);else if(Array.isArray(s))i=zg(e,s,l)||i;else if(u==="function")if(r){for(;typeof s=="function";)s=s();i=zg(e,Array.isArray(s)?s:[s],Array.isArray(l)?l:[l])||i}else e.push(s),i=!0;else{const c=String(s);l&&l.nodeType===3&&l.data===c?e.push(l):e.push(document.createTextNode(c))}}return i}function CE(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function Cs(e,t,n,r){if(n===void 0)return e.textContent="";const i=r||document.createTextNode("");if(t.length){let a=!1;for(let o=t.length-1;o>=0;o--){const s=t[o];if(i!==s){const l=s.parentNode===e;!a&&!o?l?e.replaceChild(i,s):e.insertBefore(i,n):l&&s.remove()}else a=!0}}else e.insertBefore(i,n);return[i]}const HV="http://www.w3.org/2000/svg";function T7(e,t=!1){return t?document.createElementNS(HV,e):document.createElement(e)}function jy(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,i=uV();let a,o=!!c7.context;return cn(()=>{a||(a=cV(i,()=>He(()=>e.children)));const s=r();if(s instanceof HTMLHeadElement){const[l,u]=Me(!1),c=()=>u(!0);nc(d=>Ie(s,()=>l()?d():a(),null)),dn(c)}else{const l=T7(e.isSVG?"g":"div",e.isSVG),u=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),Ie(u,a),s.appendChild(l),e.ref&&e.ref(l),dn(()=>s.removeChild(l))}},void 0,{render:!o}),n}function Fh(e){const[t,n]=wn(e,["component"]),r=He(()=>t.component);return He(()=>{const i=r();switch(typeof i){case"function":return xn(()=>i(n));case"string":const a=OV.has(i),o=T7(i,a);return Ft(o,n,a),o}})}const Vg=Symbol("store-raw"),rl=Symbol("store-node"),ma=Symbol("store-has"),C7=Symbol("store-self");function x7(e){let t=e[hi];if(!t&&(Object.defineProperty(e,hi,{value:t=new Proxy(e,VV)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let i=0,a=n.length;i<a;i++){const o=n[i];r[o].get&&Object.defineProperty(e,o,{enumerable:r[o].enumerable,get:r[o].get.bind(t)})}}return t}function jf(e){let t;return e!=null&&typeof e=="object"&&(e[hi]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function Oc(e,t=new Set){let n,r,i,a;if(n=e!=null&&e[Vg])return n;if(!jf(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let o=0,s=e.length;o<s;o++)i=e[o],(r=Oc(i,t))!==i&&(e[o]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const o=Object.keys(e),s=Object.getOwnPropertyDescriptors(e);for(let l=0,u=o.length;l<u;l++)a=o[l],!s[a].get&&(i=e[a],(r=Oc(i,t))!==i&&(e[a]=r))}return e}function Hf(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function Nc(e,t,n){if(e[t])return e[t];const[r,i]=Me(n,{equals:!1,internal:!0});return r.$=i,e[t]=r}function UV(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===hi||t===rl||(delete n.value,delete n.writable,n.get=()=>e[hi][t]),n}function w7(e){$g()&&Nc(Hf(e,rl),C7)()}function zV(e){return w7(e),Reflect.ownKeys(e)}const VV={get(e,t,n){if(t===Vg)return e;if(t===hi)return n;if(t===Lg)return w7(e),n;const r=Hf(e,rl),i=r[t];let a=i?i():e[t];if(t===rl||t===ma||t==="__proto__")return a;if(!i){const o=Object.getOwnPropertyDescriptor(e,t);$g()&&(typeof a!="function"||e.hasOwnProperty(t))&&!(o&&o.get)&&(a=Nc(r,t,a)())}return jf(a)?x7(a):a},has(e,t){return t===Vg||t===hi||t===Lg||t===rl||t===ma||t==="__proto__"?!0:($g()&&Nc(Hf(e,ma),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:zV,getOwnPropertyDescriptor:UV};function Uf(e,t,n,r=!1){if(!r&&e[t]===n)return;const i=e[t],a=e.length;n===void 0?(delete e[t],e[ma]&&e[ma][t]&&i!==void 0&&e[ma][t].$()):(e[t]=n,e[ma]&&e[ma][t]&&i===void 0&&e[ma][t].$());let o=Hf(e,rl),s;if((s=Nc(o,t,i))&&s.$(()=>n),Array.isArray(e)&&e.length!==a){for(let l=e.length;l<a;l++)(s=o[l])&&s.$();(s=Nc(o,"length",a))&&s.$(e.length)}(s=o[C7])&&s.$()}function A7(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const i=n[r];Uf(e,i,t[i])}}function qV(e,t){if(typeof t=="function"&&(t=t(e)),t=Oc(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const i=t[n];e[n]!==i&&Uf(e,n,i)}Uf(e,"length",r)}else A7(e,t)}function Lu(e,t,n=[]){let r,i=e;if(t.length>1){r=t.shift();const o=typeof r,s=Array.isArray(e);if(Array.isArray(r)){for(let l=0;l<r.length;l++)Lu(e,[r[l]].concat(t),n);return}else if(s&&o==="function"){for(let l=0;l<e.length;l++)r(e[l],l)&&Lu(e,[l].concat(t),n);return}else if(s&&o==="object"){const{from:l=0,to:u=e.length-1,by:c=1}=r;for(let d=l;d<=u;d+=c)Lu(e,[d].concat(t),n);return}else if(t.length>1){Lu(e[r],t,[r].concat(n));return}i=e[r],n=[r].concat(n)}let a=t[0];typeof a=="function"&&(a=a(i,n),a===i)||r===void 0&&a==null||(a=Oc(a),r===void 0||jf(i)&&jf(a)&&!Array.isArray(a)?A7(i,a):Uf(e,r,a))}function WV(...[e,t]){const n=Oc(e||{}),r=Array.isArray(n),i=x7(n);function a(...o){xl(()=>{r&&o.length===1?qV(n,o[0]):Lu(n,o)})}return[i,a]}function k7(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=k7(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function KV(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=k7(e))&&(r&&(r+=" "),r+=t);return r}const Hy="-",GV=e=>{const t=ZV(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const s=o.split(Hy);return s[0]===""&&s.length!==1&&s.shift(),S7(s,t)||YV(o)},getConflictingClassGroupIds:(o,s)=>{const l=n[o]||[];return s&&r[o]?[...l,...r[o]]:l}}},S7=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?S7(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const a=e.join(Hy);return(o=t.validators.find(({validator:s})=>s(a)))==null?void 0:o.classGroupId},xE=/^\[(.+)\]$/,YV=e=>{if(xE.test(e)){const t=xE.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},ZV=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return XV(Object.entries(e.classGroups),n).forEach(([a,o])=>{qg(o,r,a,t)}),r},qg=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const a=i===""?t:wE(t,i);a.classGroupId=n;return}if(typeof i=="function"){if(QV(i)){qg(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([a,o])=>{qg(o,wE(t,a),n,r)})})},wE=(e,t)=>{let n=e;return t.split(Hy).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},QV=e=>e.isThemeGetter,XV=(e,t)=>t?e.map(([n,r])=>{const i=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([o,s])=>[t+o,s])):a);return[n,i]}):e,JV=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(a,o)=>{n.set(a,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let o=n.get(a);if(o!==void 0)return o;if((o=r.get(a))!==void 0)return i(a,o),o},set(a,o){n.has(a)?n.set(a,o):i(a,o)}}},D7="!",eq=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],a=t.length,o=s=>{const l=[];let u=0,c=0,d;for(let y=0;y<s.length;y++){let v=s[y];if(u===0){if(v===i&&(r||s.slice(y,y+a)===t)){l.push(s.slice(c,y)),c=y+a;continue}if(v==="/"){d=y;continue}}v==="["?u++:v==="]"&&u--}const f=l.length===0?s:s.substring(c),h=f.startsWith(D7),m=h?f.substring(1):f,p=d&&d>c?d-c:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:p}};return n?s=>n({className:s,parseClassName:o}):o},tq=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},nq=e=>({cache:JV(e.cacheSize),parseClassName:eq(e),...GV(e)}),rq=/\s+/,iq=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],o=e.trim().split(rq);let s="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=n(u);let m=!!h,p=r(m?f.substring(0,h):f);if(!p){if(!m){s=u+(s.length>0?" "+s:s);continue}if(p=r(f),!p){s=u+(s.length>0?" "+s:s);continue}m=!1}const y=tq(c).join(":"),v=d?y+D7:y,b=v+p;if(a.includes(b))continue;a.push(b);const _=i(p,m);for(let T=0;T<_.length;++T){const C=_[T];a.push(v+C)}s=u+(s.length>0?" "+s:s)}return s};function aq(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=O7(t))&&(r&&(r+=" "),r+=n);return r}const O7=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=O7(e[r]))&&(n&&(n+=" "),n+=t);return n};function AE(e,...t){let n,r,i,a=o;function o(l){const u=t.reduce((c,d)=>d(c),e());return n=nq(u),r=n.cache.get,i=n.cache.set,a=s,s(l)}function s(l){const u=r(l);if(u)return u;const c=iq(l,n);return i(l,c),c}return function(){return a(aq.apply(null,arguments))}}const Yt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},N7=/^\[(?:([a-z-]+):)?(.+)\]$/i,oq=/^\d+\/\d+$/,sq=new Set(["px","full","screen"]),lq=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,uq=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,cq=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,dq=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,fq=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,na=e=>il(e)||sq.has(e)||oq.test(e),ja=e=>Vl(e,"length",Eq),il=e=>!!e&&!Number.isNaN(Number(e)),Nm=e=>Vl(e,"number",il),du=e=>!!e&&Number.isInteger(Number(e)),hq=e=>e.endsWith("%")&&il(e.slice(0,-1)),st=e=>N7.test(e),Ha=e=>lq.test(e),pq=new Set(["length","size","percentage"]),mq=e=>Vl(e,pq,I7),gq=e=>Vl(e,"position",I7),vq=new Set(["image","url"]),yq=e=>Vl(e,vq,Tq),bq=e=>Vl(e,"",_q),fu=()=>!0,Vl=(e,t,n)=>{const r=N7.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Eq=e=>uq.test(e)&&!cq.test(e),I7=()=>!1,_q=e=>dq.test(e),Tq=e=>fq.test(e),kE=()=>{const e=Yt("colors"),t=Yt("spacing"),n=Yt("blur"),r=Yt("brightness"),i=Yt("borderColor"),a=Yt("borderRadius"),o=Yt("borderSpacing"),s=Yt("borderWidth"),l=Yt("contrast"),u=Yt("grayscale"),c=Yt("hueRotate"),d=Yt("invert"),f=Yt("gap"),h=Yt("gradientColorStops"),m=Yt("gradientColorStopPositions"),p=Yt("inset"),y=Yt("margin"),v=Yt("opacity"),b=Yt("padding"),_=Yt("saturate"),T=Yt("scale"),C=Yt("sepia"),x=Yt("skew"),w=Yt("space"),P=Yt("translate"),O=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",st,t],D=()=>[st,t],S=()=>["",na,ja],B=()=>["auto",il,st],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],F=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ne=()=>["start","end","center","between","around","evenly","stretch"],J=()=>["","0",st],I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>[il,st];return{cacheSize:500,separator:":",theme:{colors:[fu],spacing:[na,ja],blur:["none","",Ha,st],brightness:A(),borderColor:[e],borderRadius:["none","","full",Ha,st],borderSpacing:D(),borderWidth:S(),contrast:A(),grayscale:J(),hueRotate:A(),invert:J(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[hq,ja],inset:R(),margin:R(),opacity:A(),padding:D(),saturate:A(),scale:A(),sepia:J(),skew:A(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",st]}],container:["container"],columns:[{columns:[Ha]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...H(),st]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",du,st]}],basis:[{basis:R()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",st]}],grow:[{grow:J()}],shrink:[{shrink:J()}],order:[{order:["first","last","none",du,st]}],"grid-cols":[{"grid-cols":[fu]}],"col-start-end":[{col:["auto",{span:["full",du,st]},st]}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":[fu]}],"row-start-end":[{row:["auto",{span:[du,st]},st]}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",st]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",st]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...ne()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ne(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ne(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[w]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[w]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",st,t]}],"min-w":[{"min-w":[st,t,"min","max","fit"]}],"max-w":[{"max-w":[st,t,"none","full","min","max","fit","prose",{screen:[Ha]},Ha]}],h:[{h:[st,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[st,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[st,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[st,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ha,ja]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Nm]}],"font-family":[{font:[fu]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",st]}],"line-clamp":[{"line-clamp":["none",il,Nm]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",na,st]}],"list-image":[{"list-image":["none",st]}],"list-style-type":[{list:["none","disc","decimal",st]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",na,ja]}],"underline-offset":[{"underline-offset":["auto",na,st]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",st]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",st]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...H(),gq]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",mq]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},yq]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...$(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:$()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...$()]}],"outline-offset":[{"outline-offset":[na,st]}],"outline-w":[{outline:[na,ja]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:S()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[na,ja]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ha,bq]}],"shadow-color":[{shadow:[fu]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...F(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":F()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ha,st]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[_]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",st]}],duration:[{duration:A()}],ease:[{ease:["linear","in","out","in-out",st]}],delay:[{delay:A()}],animate:[{animate:["none","spin","ping","pulse","bounce",st]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[du,st]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[x]}],"skew-y":[{"skew-y":[x]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",st]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",st]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",st]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[na,ja,Nm]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Cq=(e,{cacheSize:t,prefix:n,separator:r,experimentalParseClassName:i,extend:a={},override:o={}})=>{$u(e,"cacheSize",t),$u(e,"prefix",n),$u(e,"separator",r),$u(e,"experimentalParseClassName",i);for(const s in o)xq(e[s],o[s]);for(const s in a)wq(e[s],a[s]);return e},$u=(e,t,n)=>{n!==void 0&&(e[t]=n)},xq=(e,t)=>{if(t)for(const n in t)$u(e,n,t[n])},wq=(e,t)=>{if(t)for(const n in t){const r=t[n];r!==void 0&&(e[n]=(e[n]||[]).concat(r))}},Aq=(e,...t)=>typeof e=="function"?AE(kE,e,...t):AE(()=>Cq(kE(),e),...t);function P7(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=P7(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function kq(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=P7(e))&&(r&&(r+=" "),r+=t);return r}const SE=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,DE=kq,Sq=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return DE(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(u=>{const c=n==null?void 0:n[u],d=a==null?void 0:a[u];if(c===null)return null;const f=SE(c)||SE(d);return i[u][f]}),s=n&&Object.entries(n).reduce((u,c)=>{let[d,f]=c;return f===void 0||(u[d]=f),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:f,...h}=c;return Object.entries(h).every(m=>{let[p,y]=m;return Array.isArray(y)?y.includes({...a,...s}[p]):{...a,...s}[p]===y})?[...u,d,f]:u},[]);return DE(e,o,l,n==null?void 0:n.class,n==null?void 0:n.className)};var Dq=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function OE(e){const t={};let n;for(;n=Dq.exec(e);)t[n[1]]=n[2];return t}function Oq(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=OE(e)}else typeof t=="string"&&(t=OE(t));return{...e,...t}}function R7(e,t){e.indexOf(t)===-1&&e.push(t)}function Nq(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const F7=(e,t,n)=>Math.min(Math.max(n,e),t),ui={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},Ic=e=>typeof e=="number",al=e=>Array.isArray(e)&&!Ic(e[0]),Iq=(e,t,n)=>{const r=t-e;return((n-e)%r+r)%r+e};function Pq(e,t){return al(e)?e[Iq(0,e.length,t)]:e}const M7=(e,t,n)=>-n*e+n*t+e,B7=()=>{},to=e=>e,Uy=(e,t,n)=>t-e===0?1:(n-e)/(t-e);function L7(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Uy(0,t,r);e.push(M7(n,1,i))}}function Rq(e){const t=[0];return L7(t,e-1),t}function Fq(e,t=Rq(e.length),n=to){const r=e.length,i=r-t.length;return i>0&&L7(t,i),a=>{let o=0;for(;o<r-2&&!(a<t[o+1]);o++);let s=F7(0,1,Uy(t[o],t[o+1],a));return s=Pq(n,o)(s),M7(e[o],e[o+1],s)}}const $7=e=>Array.isArray(e)&&Ic(e[0]),Wg=e=>typeof e=="object"&&!!e.createAnimation,Pc=e=>typeof e=="function",Mq=e=>typeof e=="string",Im={ms:e=>e*1e3,s:e=>e/1e3},j7=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Bq=1e-7,Lq=12;function $q(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=j7(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Bq&&++s<Lq);return o}function ju(e,t,n,r){if(e===t&&n===r)return to;const i=a=>$q(a,0,1,e,n);return a=>a===0||a===1?a:j7(i(a),t,r)}const jq=(e,t="end")=>n=>{n=t==="end"?Math.min(n,.999):Math.max(n,.001);const r=n*e,i=t==="end"?Math.floor(r):Math.ceil(r);return F7(0,1,i/e)},Hq={ease:ju(.25,.1,.25,1),"ease-in":ju(.42,0,1,1),"ease-in-out":ju(.42,0,.58,1),"ease-out":ju(0,0,.58,1)},Uq=/\((.*?)\)/;function NE(e){if(Pc(e))return e;if($7(e))return ju(...e);const t=Hq[e];if(t)return t;if(e.startsWith("steps")){const n=Uq.exec(e);if(n){const r=n[1].split(",");return jq(parseFloat(r[0]),r[1].trim())}}return to}class zq{constructor(t,n=[0,1],{easing:r,duration:i=ui.duration,delay:a=ui.delay,endDelay:o=ui.endDelay,repeat:s=ui.repeat,offset:l,direction:u="normal",autoplay:c=!0}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=to,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((f,h)=>{this.resolve=f,this.reject=h}),r=r||ui.easing,Wg(r)){const f=r.createAnimation(n);r=f.easing,n=f.keyframes||n,i=f.duration||i}this.repeat=s,this.easing=al(r)?to:NE(r),this.updateDuration(i);const d=Fq(n,l,al(r)?r.map(NE):to);this.tick=f=>{var h;a=a;let m=0;this.pauseTime!==void 0?m=this.pauseTime:m=(f-this.startTime)*this.rate,this.t=m,m/=1e3,m=Math.max(m-a,0),this.playState==="finished"&&this.pauseTime===void 0&&(m=this.totalDuration);const p=m/this.duration;let y=Math.floor(p),v=p%1;!v&&p>=1&&(v=1),v===1&&y--;const b=y%2;(u==="reverse"||u==="alternate"&&b||u==="alternate-reverse"&&!b)&&(v=1-v);const _=m>=this.totalDuration?1:Math.min(v,1),T=d(this.easing(_));t(T),this.pauseTime===void 0&&(this.playState==="finished"||m>=this.totalDuration+o)?(this.playState="finished",(h=this.resolve)===null||h===void 0||h.call(this,T)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},c&&this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=t-this.pauseTime:this.startTime||(this.startTime=t),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var t;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(t=this.reject)===null||t===void 0||t.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(t){this.duration=t,this.totalDuration=t*(this.repeat+1)}get currentTime(){return this.t}set currentTime(t){this.pauseTime!==void 0||this.rate===0?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}var H7=function(){};process.env.NODE_ENV!=="production"&&(H7=function(e,t){if(!e)throw new Error(t)});class Vq{setAnimation(t){this.animation=t,t==null||t.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const Pm=new WeakMap;function U7(e){return Pm.has(e)||Pm.set(e,{transforms:[],values:new Map}),Pm.get(e)}function qq(e,t){return e.has(t)||e.set(t,new Vq),e.get(t)}const Wq=["","X","Y","Z"],Kq=["translate","scale","rotate","skew"],Al={x:"translateX",y:"translateY",z:"translateZ"},IE={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:e=>e+"deg"},Gq={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:e=>e+"px"},rotate:IE,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:to},skew:IE},kl=new Map,Mh=e=>`--motion-${e}`,zf=["x","y","z"];Kq.forEach(e=>{Wq.forEach(t=>{zf.push(e+t),kl.set(Mh(e+t),Gq[e])})});const Yq=(e,t)=>zf.indexOf(e)-zf.indexOf(t),Zq=new Set(zf),zy=e=>Zq.has(e),Qq=(e,t)=>{Al[t]&&(t=Al[t]);const{transforms:n}=U7(e);R7(n,t),e.style.transform=z7(n)},z7=e=>e.sort(Yq).reduce(Xq,"").trim(),Xq=(e,t)=>`${e} ${t}(var(${Mh(t)}))`,Kg=e=>e.startsWith("--"),PE=new Set;function Jq(e){if(!PE.has(e)){PE.add(e);try{const{syntax:t,initialValue:n}=kl.has(e)?kl.get(e):{};CSS.registerProperty({name:e,inherits:!1,syntax:t,initialValue:n})}catch{}}}const Rm=(e,t)=>document.createElement("div").animate(e,t),RE={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{Rm({opacity:[1]})}catch{return!1}return!0},finished:()=>!!Rm({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{Rm({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},Fm={},Zs={};for(const e in RE)Zs[e]=()=>(Fm[e]===void 0&&(Fm[e]=RE[e]()),Fm[e]);const eW=.015,tW=(e,t)=>{let n="";const r=Math.round(t/eW);for(let i=0;i<r;i++)n+=e(Uy(0,r-1,i))+", ";return n.substring(0,n.length-2)},FE=(e,t)=>Pc(e)?Zs.linearEasing()?`linear(${tW(e,t)})`:ui.easing:$7(e)?nW(e):e,nW=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`;function rW(e,t){for(let n=0;n<e.length;n++)e[n]===null&&(e[n]=n?e[n-1]:t());return e}const iW=e=>Array.isArray(e)?e:[e];function Gg(e){return Al[e]&&(e=Al[e]),zy(e)?Mh(e):e}const Hu={get:(e,t)=>{t=Gg(t);let n=Kg(t)?e.style.getPropertyValue(t):getComputedStyle(e)[t];if(!n&&n!==0){const r=kl.get(t);r&&(n=r.initialValue)}return n},set:(e,t,n)=>{t=Gg(t),Kg(t)?e.style.setProperty(t,n):e.style[t]=n}};function aW(e,t=!0){if(!(!e||e.playState==="finished"))try{e.stop?e.stop():(t&&e.commitStyles(),e.cancel())}catch{}}function oW(e,t){var n;let r=(t==null?void 0:t.toDefaultUnit)||to;const i=e[e.length-1];if(Mq(i)){const a=((n=i.match(/(-?[\d.]+)([a-z%]*)/))===null||n===void 0?void 0:n[2])||"";a&&(r=o=>o+a)}return r}function sW(){return window.__MOTION_DEV_TOOLS_RECORD}function lW(e,t,n,r={},i){const a=sW(),o=r.record!==!1&&a;let s,{duration:l=ui.duration,delay:u=ui.delay,endDelay:c=ui.endDelay,repeat:d=ui.repeat,easing:f=ui.easing,persist:h=!1,direction:m,offset:p,allowWebkitAcceleration:y=!1,autoplay:v=!0}=r;const b=U7(e),_=zy(t);let T=Zs.waapi();_&&Qq(e,t);const C=Gg(t),x=qq(b.values,C),w=kl.get(C);return aW(x.animation,!(Wg(f)&&x.generator)&&r.record!==!1),()=>{const P=()=>{var R,D;return(D=(R=Hu.get(e,C))!==null&&R!==void 0?R:w==null?void 0:w.initialValue)!==null&&D!==void 0?D:0};let O=rW(iW(n),P);const M=oW(O,w);if(Wg(f)){const R=f.createAnimation(O,t!=="opacity",P,C,x);f=R.easing,O=R.keyframes||O,l=R.duration||l}if(Kg(C)&&(Zs.cssRegisterProperty()?Jq(C):T=!1),_&&!Zs.linearEasing()&&(Pc(f)||al(f)&&f.some(Pc))&&(T=!1),T){w&&(O=O.map(S=>Ic(S)?w.toDefaultUnit(S):S)),O.length===1&&(!Zs.partialKeyframes()||o)&&O.unshift(P());const R={delay:Im.ms(u),duration:Im.ms(l),endDelay:Im.ms(c),easing:al(f)?void 0:FE(f,l),direction:m,iterations:d+1,fill:"both"};s=e.animate({[C]:O,offset:p,easing:al(f)?f.map(S=>FE(S,l)):void 0},R),s.finished||(s.finished=new Promise((S,B)=>{s.onfinish=S,s.oncancel=B}));const D=O[O.length-1];s.finished.then(()=>{h||(Hu.set(e,C,D),s.cancel())}).catch(B7),y||(s.playbackRate=1.000001)}else if(i&&_)O=O.map(R=>typeof R=="string"?parseFloat(R):R),O.length===1&&O.unshift(parseFloat(P())),s=new i(R=>{Hu.set(e,C,M?M(R):R)},O,Object.assign(Object.assign({},r),{duration:l,easing:f}));else{const R=O[O.length-1];Hu.set(e,C,w&&Ic(R)?w.toDefaultUnit(R):R)}return o&&a(e,t,O,{duration:l,delay:u,easing:f,repeat:d,offset:p},"motion-one"),x.setAnimation(s),s&&!v&&s.pause(),s}}const uW=(e,t)=>e[t]?Object.assign(Object.assign({},e),e[t]):Object.assign({},e);function cW(e,t){var n;return typeof e=="string"?t?((n=t[e])!==null&&n!==void 0||(t[e]=document.querySelectorAll(e)),e=t[e]):e=document.querySelectorAll(e):e instanceof Element&&(e=[e]),Array.from(e||[])}const dW={any:0,all:1};function fW(e,t,{root:n,margin:r,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const a=cW(e),o=new WeakMap,s=u=>{u.forEach(c=>{const d=o.get(c.target);if(c.isIntersecting!==!!d)if(c.isIntersecting){const f=t(c);Pc(f)?o.set(c.target,f):l.unobserve(c.target)}else d&&(d(c),o.delete(c.target))})},l=new IntersectionObserver(s,{root:n,rootMargin:r,threshold:typeof i=="number"?i:dW[i]});return a.forEach(u=>l.observe(u)),()=>l.disconnect()}function hW(e,t){return typeof e!=typeof t?!0:Array.isArray(e)&&Array.isArray(t)?!pW(e,t):e!==t}function pW(e,t){const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function mW(e){return typeof e=="object"}function ME(e,t){if(mW(e))return e;if(e&&t)return t[e]}let no;function gW(){if(!no)return;const e=no.sort(yW).map(bW);e.forEach(BE),e.forEach(BE),no=void 0}function Mm(e){no?R7(no,e):(no=[e],requestAnimationFrame(gW))}function vW(e){no&&Nq(no,e)}const yW=(e,t)=>e.getDepth()-t.getDepth(),bW=e=>e.animateUpdates(),BE=e=>e.next(),LE=(e,t)=>new CustomEvent(e,{detail:{target:t}});function Yg(e,t,n){e.dispatchEvent(new CustomEvent(t,{detail:{originalEvent:n}}))}function $E(e,t,n){e.dispatchEvent(new CustomEvent(t,{detail:{originalEntry:n}}))}const EW={isActive:e=>!!e.inView,subscribe:(e,{enable:t,disable:n},{inViewOptions:r={}})=>{const{once:i}=r,a=NC.__rest(r,["once"]);return fW(e,o=>{if(t(),$E(e,"viewenter",o),!i)return s=>{n(),$E(e,"viewleave",s)}},a)}},jE=(e,t,n)=>r=>{r.pointerType&&r.pointerType!=="mouse"||(n(),Yg(e,t,r))},_W={isActive:e=>!!e.hover,subscribe:(e,{enable:t,disable:n})=>{const r=jE(e,"hoverstart",t),i=jE(e,"hoverend",n);return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",i),()=>{e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",i)}}},TW={isActive:e=>!!e.press,subscribe:(e,{enable:t,disable:n})=>{const r=a=>{n(),Yg(e,"pressend",a),window.removeEventListener("pointerup",r)},i=a=>{t(),Yg(e,"pressstart",a),window.addEventListener("pointerup",r)};return e.addEventListener("pointerdown",i),()=>{e.removeEventListener("pointerdown",i),window.removeEventListener("pointerup",r)}}},Ud={inView:EW,hover:_W,press:TW},HE=["initial","animate",...Object.keys(Ud),"exit"],Zg=new WeakMap;function CW(e={},t){let n,r=t?t.getDepth()+1:0;const i={initial:!0,animate:!0},a={},o={};for(const p of HE)o[p]=typeof e[p]=="string"?e[p]:t==null?void 0:t.getContext()[p];const s=e.initial===!1?"animate":"initial";let l=ME(e[s]||o[s],e.variants)||{},u=NC.__rest(l,["transition"]);const c=Object.assign({},u);function*d(){var p,y;const v=u;u={};const b={};for(const w of HE){if(!i[w])continue;const P=ME(e[w]);if(P)for(const O in P)O!=="transition"&&(u[O]=P[O],b[O]=uW((y=(p=P.transition)!==null&&p!==void 0?p:e.transition)!==null&&y!==void 0?y:{},O))}const _=new Set([...Object.keys(u),...Object.keys(v)]),T=[];_.forEach(w=>{var P;u[w]===void 0&&(u[w]=c[w]),hW(v[w],u[w])&&((P=c[w])!==null&&P!==void 0||(c[w]=Hu.get(n,w)),T.push(lW(n,w,u[w],b[w],zq)))}),yield;const C=T.map(w=>w()).filter(Boolean);if(!C.length)return;const x=u;n.dispatchEvent(LE("motionstart",x)),Promise.all(C.map(w=>w.finished)).then(()=>{n.dispatchEvent(LE("motioncomplete",x))}).catch(B7)}const f=(p,y)=>()=>{i[p]=y,Mm(m)},h=()=>{for(const p in Ud){const y=Ud[p].isActive(e),v=a[p];y&&!v?a[p]=Ud[p].subscribe(n,{enable:f(p,!0),disable:f(p,!1)},e):!y&&v&&(v(),delete a[p])}},m={update:p=>{n&&(e=p,h(),Mm(m))},setActive:(p,y)=>{n&&(i[p]=y,Mm(m))},animateUpdates:d,getDepth:()=>r,getTarget:()=>u,getOptions:()=>e,getContext:()=>o,mount:p=>(H7(!!p,"Animation state must be mounted with valid Element"),n=p,Zg.set(n,m),h(),()=>{Zg.delete(n),vW(m);for(const y in a)a[y]()}),isMounted:()=>!!n};return m}function xW(e){const t={},n=[];for(let r in e){const i=e[r];zy(r)&&(Al[r]&&(r=Al[r]),n.push(r),r=Mh(r));let a=Array.isArray(i)?i[0]:i;const o=kl.get(r);o&&(a=Ic(i)?o.toDefaultUnit(i):i),t[r]=a}return n.length&&(t.transform=z7(n)),t}var UE=e=>e instanceof Element;function Qg(e,t){if(t(e))return e;if(typeof e=="function"&&!e.length)return Qg(e(),t);if(Array.isArray(e))for(const n of e){const r=Qg(n,t);if(r)return r}return null}function wW(e,t=UE,n=UE){const r=He(e);return He(()=>Qg(r(),t))}var AW=()=>{},zE=(e,t)=>t();function kW(e,t){const n=xn(e),r=n?[n]:[],{onEnter:i=zE,onExit:a=zE}=t,[o,s]=Me(t.appear?[]:r),[l]=hV();let u,c=!1;function d(m,p){if(!m)return p&&p();c=!0,a(m,()=>{xl(()=>{c=!1,s(y=>y.filter(v=>v!==m)),p&&p()})})}function f(m){const p=u;if(!p)return m&&m();u=void 0,s(y=>[p,...y]),i(p,m??AW)}const h=t.mode==="out-in"?m=>c||d(m,f):t.mode==="in-out"?m=>f(()=>d(m)):m=>{d(m),f()};return Bf(m=>{const p=e();return xn(l)?(l(),m):(p!==m&&(u=p,xl(()=>xn(()=>h(m)))),p)},t.appear?void 0:n),o}var V7=vi(),SW=e=>{const[t,n]=Me(!0),r={initial:e.initial??!0,mount:t},i=Z(V7.Provider,{value:r,get children(){return kW(wW(()=>e.children),{appear:r.initial,mode:e.exitBeforeEnter?"out-in":"parallel",onExit(a,o){xl(()=>{var s;n(!1),(s=Zg.get(a))!=null&&s.getOptions().exit?a.addEventListener("motioncomplete",o):o()})},onEnter(a,o){xl(()=>{n(!0),o()})}})}});return r.initial=!0,i};function DW(e,t,n,r){const i=CW((n==null?void 0:n.initial)===!1?{...t(),initial:!1}:t(),r);return cn(()=>{if(n&&!n.mount())return;const a=e(),o=i.mount(a);cn(()=>i.update(t())),dn(()=>{n&&t().exit?(i.setActive("exit",!0),a.addEventListener("motioncomplete",o)):o()})}),[i,xW(i.getTarget())]}var OW=["initial","animate","inView","inViewOptions","hover","press","variants","transition","exit"],NW=["tag"],VE=vi(),qE=e=>{const[t,,n]=wn(e,OW,NW),[r,i]=DW(()=>a,()=>({...t}),lr(V7),lr(VE));let a;return Z(VE.Provider,{value:r,get children(){return Z(Fh,At(n,{ref:o=>{var s;a=o,(s=e.ref)==null||s.call(e,o)},get component(){return e.tag||"div"},get style(){return Oq(e.style,i)}}))}})},WE=new Proxy(qE,{get:(e,t)=>n=>Z(qE,At(n,{tag:t}))});const IW=Math.min,PW=Math.max,RW={left:"right",right:"left",bottom:"top",top:"bottom"},FW={start:"end",end:"start"};function KE(e,t,n){return PW(e,IW(t,n))}function Bh(e,t){return typeof e=="function"?e(t):e}function rs(e){return e.split("-")[0]}function Lh(e){return e.split("-")[1]}function q7(e){return e==="x"?"y":"x"}function W7(e){return e==="y"?"height":"width"}function $h(e){return["top","bottom"].includes(rs(e))?"y":"x"}function K7(e){return q7($h(e))}function MW(e,t,n){n===void 0&&(n=!1);const r=Lh(e),i=K7(e),a=W7(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=Vf(o)),[o,Vf(o)]}function BW(e){const t=Vf(e);return[Xg(e),t,Xg(t)]}function Xg(e){return e.replace(/start|end/g,t=>FW[t])}function LW(e,t,n){const r=["left","right"],i=["right","left"],a=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?a:o;default:return[]}}function $W(e,t,n,r){const i=Lh(e);let a=LW(rs(e),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(Xg)))),a}function Vf(e){return e.replace(/left|right|bottom|top/g,t=>RW[t])}function jW(e){return{top:0,right:0,bottom:0,left:0,...e}}function HW(e){return typeof e!="number"?jW(e):{top:e,right:e,bottom:e,left:e}}function qf(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function GE(e,t,n){let{reference:r,floating:i}=e;const a=$h(t),o=K7(t),s=W7(o),l=rs(t),u=a==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2;let h;switch(l){case"top":h={x:c,y:r.y-i.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-i.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Lh(t)){case"start":h[o]-=f*(n&&u?-1:1);break;case"end":h[o]+=f*(n&&u?-1:1);break}return h}const UW=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,s=a.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=GE(u,r,l),f=r,h={},m=0;for(let p=0;p<s.length;p++){const{name:y,fn:v}=s[p],{x:b,y:_,data:T,reset:C}=await v({x:c,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:h,rects:u,platform:o,elements:{reference:e,floating:t}});c=b??c,d=_??d,h={...h,[y]:{...h[y],...T}},C&&m<=50&&(m++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(u=C.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:c,y:d}=GE(u,f,l)),p=-1)}return{x:c,y:d,placement:f,strategy:i,middlewareData:h}};async function G7(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:o,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Bh(t,e),m=HW(h),y=s[f?d==="floating"?"reference":"floating":d],v=qf(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(y)))==null||n?y:y.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),b=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,_=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),T=await(a.isElement==null?void 0:a.isElement(_))?await(a.getScale==null?void 0:a.getScale(_))||{x:1,y:1}:{x:1,y:1},C=qf(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:_,strategy:l}):b);return{top:(v.top-C.top+m.top)/T.y,bottom:(C.bottom-v.bottom+m.bottom)/T.y,left:(v.left-C.left+m.left)/T.x,right:(C.right-v.right+m.right)/T.x}}const zW=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:o,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...y}=Bh(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const v=rs(i),b=rs(s)===s,_=await(l.isRTL==null?void 0:l.isRTL(u.floating)),T=f||(b||!p?[Vf(s)]:BW(s));!f&&m!=="none"&&T.push(...$W(s,p,m,_));const C=[s,...T],x=await G7(t,y),w=[];let P=((r=a.flip)==null?void 0:r.overflows)||[];if(c&&w.push(x[v]),d){const D=MW(i,o,_);w.push(x[D[0]],x[D[1]])}if(P=[...P,{placement:i,overflows:w}],!w.every(D=>D<=0)){var O,M;const D=(((O=a.flip)==null?void 0:O.index)||0)+1,S=C[D];if(S)return{data:{index:D,overflows:P},reset:{placement:S}};let B=(M=P.filter(H=>H.overflows[0]<=0).sort((H,$)=>H.overflows[1]-$.overflows[1])[0])==null?void 0:M.placement;if(!B)switch(h){case"bestFit":{var R;const H=(R=P.map($=>[$.placement,$.overflows.filter(F=>F>0).reduce((F,ne)=>F+ne,0)]).sort(($,F)=>$[1]-F[1])[0])==null?void 0:R[0];H&&(B=H);break}case"initialPlacement":B=s;break}if(i!==B)return{reset:{placement:B}}}return{}}}};async function VW(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=rs(n),s=Lh(n),l=$h(n)==="y",u=["left","top"].includes(o)?-1:1,c=a&&l?-1:1,d=Bh(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&typeof m=="number"&&(h=s==="end"?m*-1:m),l?{x:h*c,y:f*u}:{x:f*u,y:h*c}}const qW=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:o,middlewareData:s}=t,l=await VW(t,e);return o===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:o}}}}},WW=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:y=>{let{x:v,y:b}=y;return{x:v,y:b}}},...l}=Bh(e,t),u={x:n,y:r},c=await G7(t,l),d=$h(rs(i)),f=q7(d);let h=u[f],m=u[d];if(a){const y=f==="y"?"top":"left",v=f==="y"?"bottom":"right",b=h+c[y],_=h-c[v];h=KE(b,h,_)}if(o){const y=d==="y"?"top":"left",v=d==="y"?"bottom":"right",b=m+c[y],_=m-c[v];m=KE(b,m,_)}const p=s.fn({...t,[f]:h,[d]:m});return{...p,data:{x:p.x-n,y:p.y-r}}}}},Jg=Math.min,ol=Math.max,Wf=Math.round,F1=Math.floor,Mi=e=>({x:e,y:e});function jh(){return typeof window<"u"}function ql(e){return Y7(e)?(e.nodeName||"").toLowerCase():"#document"}function _r(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Qi(e){var t;return(t=(Y7(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Y7(e){return jh()?e instanceof Node||e instanceof _r(e).Node:!1}function pi(e){return jh()?e instanceof Element||e instanceof _r(e).Element:!1}function Ki(e){return jh()?e instanceof HTMLElement||e instanceof _r(e).HTMLElement:!1}function YE(e){return!jh()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof _r(e).ShadowRoot}function Kc(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=mi(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function KW(e){return["table","td","th"].includes(ql(e))}function Hh(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Vy(e){const t=qy(),n=pi(e)?mi(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function GW(e){let t=so(e);for(;Ki(t)&&!Sl(t);){if(Vy(t))return t;if(Hh(t))return null;t=so(t)}return null}function qy(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Sl(e){return["html","body","#document"].includes(ql(e))}function mi(e){return _r(e).getComputedStyle(e)}function Uh(e){return pi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function so(e){if(ql(e)==="html")return e;const t=e.assignedSlot||e.parentNode||YE(e)&&e.host||Qi(e);return YE(t)?t.host:t}function Z7(e){const t=so(e);return Sl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ki(t)&&Kc(t)?t:Z7(t)}function Rc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Z7(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=_r(i);if(a){const s=ev(o);return t.concat(o,o.visualViewport||[],Kc(i)?i:[],s&&n?Rc(s):[])}return t.concat(i,Rc(i,[],n))}function ev(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Q7(e){const t=mi(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Ki(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Wf(n)!==a||Wf(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Wy(e){return pi(e)?e:e.contextElement}function sl(e){const t=Wy(e);if(!Ki(t))return Mi(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Q7(t);let o=(a?Wf(n.width):n.width)/r,s=(a?Wf(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const YW=Mi(0);function X7(e){const t=_r(e);return!qy()||!t.visualViewport?YW:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ZW(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==_r(e)?!1:t}function is(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=Wy(e);let o=Mi(1);t&&(r?pi(r)&&(o=sl(r)):o=sl(e));const s=ZW(a,n,r)?X7(a):Mi(0);let l=(i.left+s.x)/o.x,u=(i.top+s.y)/o.y,c=i.width/o.x,d=i.height/o.y;if(a){const f=_r(a),h=r&&pi(r)?_r(r):r;let m=f,p=ev(m);for(;p&&r&&h!==m;){const y=sl(p),v=p.getBoundingClientRect(),b=mi(p),_=v.left+(p.clientLeft+parseFloat(b.paddingLeft))*y.x,T=v.top+(p.clientTop+parseFloat(b.paddingTop))*y.y;l*=y.x,u*=y.y,c*=y.x,d*=y.y,l+=_,u+=T,m=_r(p),p=ev(m)}}return qf({width:c,height:d,x:l,y:u})}function Ky(e,t){const n=Uh(e).scrollLeft;return t?t.left+n:is(Qi(e)).left+n}function J7(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:Ky(e,r)),a=r.top+t.scrollTop;return{x:i,y:a}}function QW(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=Qi(r),s=t?Hh(t.floating):!1;if(r===o||s&&a)return n;let l={scrollLeft:0,scrollTop:0},u=Mi(1);const c=Mi(0),d=Ki(r);if((d||!d&&!a)&&((ql(r)!=="body"||Kc(o))&&(l=Uh(r)),Ki(r))){const h=is(r);u=sl(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}const f=o&&!d&&!a?J7(o,l,!0):Mi(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:n.y*u.y-l.scrollTop*u.y+c.y+f.y}}function XW(e){return Array.from(e.getClientRects())}function JW(e){const t=Qi(e),n=Uh(e),r=e.ownerDocument.body,i=ol(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=ol(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Ky(e);const s=-n.scrollTop;return mi(r).direction==="rtl"&&(o+=ol(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function eK(e,t){const n=_r(e),r=Qi(e),i=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;const u=qy();(!u||u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:a,height:o,x:s,y:l}}function tK(e,t){const n=is(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ki(e)?sl(e):Mi(1),o=e.clientWidth*a.x,s=e.clientHeight*a.y,l=i*a.x,u=r*a.y;return{width:o,height:s,x:l,y:u}}function ZE(e,t,n){let r;if(t==="viewport")r=eK(e,n);else if(t==="document")r=JW(Qi(e));else if(pi(t))r=tK(t,n);else{const i=X7(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return qf(r)}function e6(e,t){const n=so(e);return n===t||!pi(n)||Sl(n)?!1:mi(n).position==="fixed"||e6(n,t)}function nK(e,t){const n=t.get(e);if(n)return n;let r=Rc(e,[],!1).filter(s=>pi(s)&&ql(s)!=="body"),i=null;const a=mi(e).position==="fixed";let o=a?so(e):e;for(;pi(o)&&!Sl(o);){const s=mi(o),l=Vy(o);!l&&s.position==="fixed"&&(i=null),(a?!l&&!i:!l&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Kc(o)&&!l&&e6(e,o))?r=r.filter(c=>c!==o):i=s,o=so(o)}return t.set(e,r),r}function rK(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?Hh(t)?[]:nK(t,this._c):[].concat(n),r],s=o[0],l=o.reduce((u,c)=>{const d=ZE(t,c,i);return u.top=ol(d.top,u.top),u.right=Jg(d.right,u.right),u.bottom=Jg(d.bottom,u.bottom),u.left=ol(d.left,u.left),u},ZE(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function iK(e){const{width:t,height:n}=Q7(e);return{width:t,height:n}}function aK(e,t,n){const r=Ki(t),i=Qi(t),a=n==="fixed",o=is(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Mi(0);if(r||!r&&!a)if((ql(t)!=="body"||Kc(i))&&(s=Uh(t)),r){const f=is(t,!0,a,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else i&&(l.x=Ky(i));const u=i&&!r&&!a?J7(i,s):Mi(0),c=o.left+s.scrollLeft-l.x-u.x,d=o.top+s.scrollTop-l.y-u.y;return{x:c,y:d,width:o.width,height:o.height}}function Bm(e){return mi(e).position==="static"}function QE(e,t){if(!Ki(e)||mi(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Qi(e)===n&&(n=n.ownerDocument.body),n}function t6(e,t){const n=_r(e);if(Hh(e))return n;if(!Ki(e)){let i=so(e);for(;i&&!Sl(i);){if(pi(i)&&!Bm(i))return i;i=so(i)}return n}let r=QE(e,t);for(;r&&KW(r)&&Bm(r);)r=QE(r,t);return r&&Sl(r)&&Bm(r)&&!Vy(r)?n:r||GW(e)||n}const oK=async function(e){const t=this.getOffsetParent||t6,n=this.getDimensions,r=await n(e.floating);return{reference:aK(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function sK(e){return mi(e).direction==="rtl"}const lK={convertOffsetParentRelativeRectToViewportRelativeRect:QW,getDocumentElement:Qi,getClippingRect:rK,getOffsetParent:t6,getElementRects:oK,getClientRects:XW,getDimensions:iK,getScale:sl,isElement:pi,isRTL:sK};function uK(e,t){let n=null,r;const i=Qi(e);function a(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function o(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const{left:u,top:c,width:d,height:f}=e.getBoundingClientRect();if(s||t(),!d||!f)return;const h=F1(c),m=F1(i.clientWidth-(u+d)),p=F1(i.clientHeight-(c+f)),y=F1(u),b={rootMargin:-h+"px "+-m+"px "+-p+"px "+-y+"px",threshold:ol(0,Jg(1,l))||1};let _=!0;function T(C){const x=C[0].intersectionRatio;if(x!==l){if(!_)return o();x?o(!1,x):r=setTimeout(()=>{o(!1,1e-7)},1e3)}_=!1}try{n=new IntersectionObserver(T,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(T,b)}n.observe(e)}return o(!0),a}function n6(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Wy(e),c=i||a?[...u?Rc(u):[],...Rc(t)]:[];c.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),a&&v.addEventListener("resize",n)});const d=u&&s?uK(u,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(v=>{let[b]=v;b&&b.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var _;(_=h)==null||_.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let m,p=l?is(e):null;l&&y();function y(){const v=is(e);p&&(v.x!==p.x||v.y!==p.y||v.width!==p.width||v.height!==p.height)&&n(),p=v,m=requestAnimationFrame(y)}return n(),()=>{var v;c.forEach(b=>{i&&b.removeEventListener("scroll",n),a&&b.removeEventListener("resize",n)}),d==null||d(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(m)}}const r6=qW,i6=WW,a6=zW,cK=(e,t,n)=>{const r=new Map,i={platform:lK,...n},a={...i.platform,_c:r};return UW(e,t,{...i,platform:a})};function o6(e,t,n){let r=()=>{var d;return(d=n==null?void 0:n.placement)!=null?d:"bottom"},i=()=>{var d;return(d=n==null?void 0:n.strategy)!=null?d:"absolute"},[a,o]=Me({x:null,y:null,placement:r(),strategy:i(),middlewareData:{}}),[s,l]=Me();cn(()=>{let d=s();if(d)throw d.value});let u=He(()=>(e(),t(),{}));function c(){let d=e(),f=t();if(d&&f){let h=u();cK(d,f,{middleware:n==null?void 0:n.middleware,placement:r(),strategy:i()}).then(m=>{h===u()&&o(m)},m=>{l(m)})}}return cn(()=>{let d=e(),f=t();if(n==null||n.middleware,r(),i(),d&&f)if(n!=null&&n.whileElementsMounted){let h=n.whileElementsMounted(d,f,c);h&&dn(h)}else c()}),{get x(){return a().x},get y(){return a().y},get placement(){return a().placement},get strategy(){return a().strategy},get middlewareData(){return a().middlewareData},update:c}}var dK={colorPrimary:"#0081F1",colorPrimaryForeground:"white",colorSecondary:"#F3F3F3",colorSecondaryForeground:"#1A1523",colorCounter:"#E5484D",colorCounterForeground:"white",colorBackground:"#FCFCFC",colorForeground:"#1A1523",colorNeutral:"#525252",colorShadow:"rgba(122,133,153,0.25)",fontSize:"inherit",borderRadius:"0.375rem"},fK={locale:"en-US","inbox.filters.dropdownOptions.unread":"Unread only","inbox.filters.dropdownOptions.default":"Unread & read","inbox.filters.dropdownOptions.archived":"Archived","inbox.filters.labels.unread":"Unread","inbox.filters.labels.default":"Inbox","inbox.filters.labels.archived":"Archived","notifications.emptyNotice":"No notifications","notifications.actions.readAll":"Mark all as read","notifications.actions.archiveAll":"Archive all","notifications.actions.archiveRead":"Archive read","notifications.newNotifications":({notificationCount:e})=>`${e>99?"99+":e} new ${e===1?"notification":"notifications"}`,"notification.actions.read.tooltip":"Mark as read","notification.actions.unread.tooltip":"Mark as unread","notification.actions.archive.tooltip":"Archive","notification.actions.unarchive.tooltip":"Unarchive","preferences.title":"Notification Preferences","preferences.global":"Global Preferences","preferences.workflow.disabled.notice":"Contact admin to enable subscription management for this critical notification.","preferences.workflow.disabled.tooltip":"Contact admin to edit"},[hK,pK]=Me({}),XE=["button","popoverContent","popoverTrigger","dropdownContent","dropdownTrigger","dropdownItem","dropdownItemLabel","dropdownItemLabelContainer","dropdownItemLeftIcon","dropdownItemRightIcon","tooltipContent","tooltipTrigger","back__button","skeletonText","skeletonAvatar","tabsRoot","tabsList","tabsContent","tabsTrigger","dots","root","bellIcon","bellContainer","bellDot","preferences__button","preferencesContainer","inboxHeader","loading","inboxContent","inbox__popoverTrigger","inbox__popoverContent","notificationListContainer","notificationList","notificationListEmptyNoticeContainer","notificationListEmptyNotice","notificationListEmptyNoticeIcon","notificationListNewNotificationsNotice__button","notification","notificationDot","notificationSubject","notificationSubject__strong","notificationBody","notificationBody__strong","notificationBodyContainer","notificationImage","notificationDate","notificationDefaultActions","notificationCustomActions","notificationPrimaryAction__button","notificationSecondaryAction__button","notificationRead__button","notificationUnread__button","notificationArchive__button","notificationUnarchive__button","notificationsTabs__tabsRoot","notificationsTabs__tabsList","notificationsTabs__tabsContent","notificationsTabs__tabsTrigger","notificationsTabsTriggerLabel","notificationsTabsTriggerCount","inboxStatus__title","inboxStatus__dropdownTrigger","inboxStatus__dropdownContent","inboxStatus__dropdownItem","inboxStatus__dropdownItemLabel","inboxStatus__dropdownItemLabelContainer","inboxStatus__dropdownItemLeft__icon","inboxStatus__dropdownItemRight__icon","moreActionsContainer","moreActions__dropdownTrigger","moreActions__dropdownContent","moreActions__dropdownItem","moreActions__dropdownItemLabel","moreActions__dropdownItemLeft__icon","moreActions__dots","moreTabs__button","moreTabs__dots","moreTabs__dropdownTrigger","moreTabs__dropdownContent","moreTabs__dropdownItem","moreTabs__dropdownItemLabel","moreTabs__dropdownItemRight__icon","workflowContainer","workflowLabel","workflowLabelContainer","workflowContainerDisabledNotice","workflowLabelDisabled__icon","workflowContainerRight__icon","workflowArrow__icon","channelContainer","channelsContainerCollapsible","channelsContainer","channelLabel","channelLabelContainer","channelDescription","channelName","channelSwitchContainer","channelSwitch","channelSwitchThumb","preferencesHeader","preferencesHeader__back__button","preferencesHeader__title","preferencesLoadingContainer","strong"];function mK(e){const[t,n]=Me([]),[r,i]=Me(!0),[a,o]=Me(0),[s,l]=Me(!1),[u,{mutate:c,refetch:d}]=p7(a,e);let f=()=>{};{const m=new IntersectionObserver(p=>{p.length>0&&p[0].isIntersecting&&!s()&&!u.loading&&o(o(t().length))});dn(()=>m.disconnect()),f=p=>{m.observe(p),dn(()=>m.unobserve(p))}}return Bf(()=>{const m=u.latest;m&&(i(!1),xl(()=>{m.hasMore||l(!0),n(m.data)}))}),[t,{initialLoading:r,setEl:f,offset:a,end:s,mutate:c,reset:()=>Ve(this,null,function*(){n([]),i(!0),l(!1),a()!==0?o(0):yield d()})}]}var gK="en-US",xo={inMinute:60,inHour:3600,inDay:86400,inWeek:604800,inMonth:2592e3};function vK({fromDate:e,locale:t=gK,toDate:n=new Date}){const r=n.getTime()-e.getTime(),i=new Intl.RelativeTimeFormat(t,{style:"narrow"}),a=Math.floor(r/1e3);return a<xo.inMinute?"Just now":a<xo.inHour?i.format(Math.floor(-a/xo.inMinute),"minute"):a<xo.inDay?i.format(Math.floor(-a/xo.inHour),"hour"):a<xo.inMonth?i.format(Math.floor(-a/xo.inDay),"day"):new Intl.DateTimeFormat(t,{month:"short",day:"numeric"}).format(e)}var yK=Aq({prefix:"nt-"});function Bn(...e){return yK(KV(e))}function s6(e){const t="abcdefghijklmnopqrstuvwxyz";let n="";const r=t.length;for(let i=0;i<e;i+=1)n+=t.charAt(Math.floor(Math.random()*r));return n}function bK(e,t){let n;do n=s6(t);while(e.has(n));return n}function EK(e){return Object.entries(e).map(([t,n])=>`${t.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${n};`).join(" ")}function _K(e,t){const n=`novu-css-${bK(e,8)}`,r=`.${n} { ${t} }`;return e.add(n),{className:n,rule:r}}var Kf=[50,100,200,300,400,500,600,700,800,900];function ra(e){return`.${e.id} { --nv-${e.key}: oklch(from ${e.color} l c h); }`}function JE(e){const t=[];for(let n=0;n<Kf.length;n+=1){const r=Kf[n],i=`.${e.id} { --nv-${e.key}-${r}: oklch(from ${e.color} calc(l - ${(r-500)/1e3}) c h); }`;t.push(i)}return t}function wo(e){const t=[];for(let n=0;n<Kf.length;n+=1){const r=Kf[n],i=`.${e.id} { --nv-${e.key}-${r}: oklch(from ${e.color} l c h / ${r/1e3}); }`;t.push(i)}return t}var TK=(e,t)=>[ra({color:e.colorBackground,key:"color-background",id:t}),ra({color:e.colorForeground,key:"color-foreground",id:t}),ra({color:e.colorPrimary,key:"color-primary",id:t}),ra({color:e.colorPrimaryForeground,key:"color-primary-foreground",id:t}),ra({color:e.colorSecondary,key:"color-secondary",id:t}),ra({color:e.colorSecondaryForeground,key:"color-secondary-foreground",id:t}),ra({color:e.colorCounter,key:"color-counter",id:t}),ra({color:e.colorCounterForeground,key:"color-counter-foreground",id:t}),ra({color:e.colorShadow,key:"color-shadow",id:t}),...wo({color:e.colorBackground,key:"color-background-alpha",id:t}),...wo({color:e.colorForeground,key:"color-foreground-alpha",id:t}),...JE({color:e.colorPrimary,key:"color-primary",id:t}),...wo({color:e.colorPrimary,key:"color-primary-alpha",id:t}),...wo({color:e.colorPrimaryForeground,key:"color-primary-foreground-alpha",id:t}),...JE({color:e.colorSecondary,key:"color-secondary",id:t}),...wo({color:e.colorSecondary,key:"color-secondary-alpha",id:t}),...wo({color:e.colorSecondaryForeground,key:"color-secondary-foreground-alpha",id:t}),...wo({color:e.colorNeutral,key:"color-neutral-alpha",id:t})],CK=e=>{const t=[],n=new Set;for(const r in e)if(e.hasOwnProperty(r)){const i=e[r];if(typeof i=="object"){const a=EK(i),{className:o,rule:s}=_K(n,a);t.push({key:r,rule:s,className:o})}}return t},ba=e=>{var t;return((t=e==null?void 0:e.filter)==null?void 0:t.tags)||(e==null?void 0:e.value)||[]},ft=()=>{const e=Gy(),[t,n]=Me(!0);return sr(()=>{n(!1)}),He(()=>(i,a)=>{var o,s;const l=i.split("__");let u=[];for(let p=0;p<l.length;p+=1){const y=l.slice(p).join("__");XE.includes(y)&&u.push(y)}const c=(a==null?void 0:a.split(/\s+/).map(p=>p.replace(/^nv-/,"")))||[],d=c.filter(p=>XE.includes(p));u=Array.from(new Set([...u,...d])),u.sort((p,y)=>{const v=(p.match(/__/g)||[]).length;return(y.match(/__/g)||[]).length-v});const f=c.filter(p=>!u.includes(p)).join(" "),h=[];for(let p=0;p<u.length;p+=1)typeof((o=e.elements())==null?void 0:o[u[p]])=="string"&&h.push((s=e.elements())==null?void 0:s[u[p]]);const m=u.length&&!t()?u.map(p=>e.appearanceKeyToCssInJsClass[p]):[];return Bn(...u.map(p=>`nv-${p}`),"🔔",f,h,...m)})()};function xK(e){const[t,n]=Me(!!e.fallbackValue);return e.value!==void 0?[()=>!!e.value,n]:[t,n]}var wK="_blank",AK="noopener noreferrer",l6=vi(void 0),kK=e=>{const[t,n]=WV({appearanceKeyToCssInJsClass:{}}),[r,i]=Me(null),[a,o]=Me([]),[s,l]=Me([]),u=He(()=>{var m,p,y;return Array.isArray((m=e.appearance)==null?void 0:m.baseTheme)?((p=e.appearance)==null?void 0:p.baseTheme)||[]:[((y=e.appearance)==null?void 0:y.baseTheme)||{}]}),c=()=>e.id,d=()=>{var m;return((m=e.appearance)==null?void 0:m.variables)||{}},f=()=>{var m,p;return(p=(m=e.appearance)==null?void 0:m.animations)!=null?p:!0},h=He(()=>{var m;const p=u().reduce((y,v)=>Ye(Ye({},y),v.elements||{}),{});return Ye(Ye({},p),((m=e.appearance)==null?void 0:m.elements)||{})});return sr(()=>{const m=document.getElementById(e.id);if(m){i(m);return}const p=document.createElement("style");p.id=e.id,document.head.appendChild(p),i(p),dn(()=>{const y=document.getElementById(e.id);y&&y.remove()})}),cn(()=>{var m;if(!r())return;const y=Ye(Ye({},dK),u().reduce((v,b)=>Ye(Ye({},v),b.variables||{}),{}));l(TK(Ye(Ye({},y),((m=e.appearance)==null?void 0:m.variables)||{}),e.id))}),cn(()=>{if(!r())return;const p=CK(h());n("appearanceKeyToCssInJsClass",y=>Ye(Ye({},y),p.reduce((v,b)=>(v[b.key]=b.className,v),{}))),o(p.map(y=>y.rule))}),cn(()=>{const m=r();m&&(m.innerHTML=[...s(),...a()].join(" "))}),Z(l6.Provider,{get value(){return{elements:h,variables:d,appearanceKeyToCssInJsClass:t.appearanceKeyToCssInJsClass,animations:f,id:c}},get children(){return e.children}})};function Gy(){const e=lr(l6);if(!e)throw new Error("useAppearance must be used within an AppearanceProvider");return e}var u6=({event:e,eventHandler:t})=>{const n=vo();sr(()=>{const r=n.on(e,t);dn(()=>{r()})})};function SK(e,t){let n=!1,r;const i=new Promise(a=>{r=a});return navigator.locks.request(e,()=>(n||t(e),i)),()=>{n=!0,r()}}var DK=({channelName:e,onMessage:t})=>{const[n]=Me(new BroadcastChannel(e)),r=i=>{n().postMessage(i)};return sr(()=>{const i=o=>{t(o.data)},a=n();a.addEventListener("message",i),dn(()=>{a.removeEventListener("message",i)})}),{postMessage:r}},Lm=({event:e,eventHandler:t})=>{const n=vo(),{postMessage:r}=DK({channelName:`nv.${e}`,onMessage:t}),i=a=>{t(a),r(a)};sr(()=>{let a;const o=SK(`nv.${e}`,()=>{a=n.on(e,i)});dn(()=>{a&&a(),o()})})},c6=vi(void 0),OK=e=>{const t=He(()=>{const i=e.localization||{},{dynamic:a}=i,o=Dy(i,["dynamic"]);return Ye(Ye(Ye(Ye({},fK),hK()),a||{}),o)}),n=(i,...a)=>{const o=t()[i];return typeof o=="function"?o(a[0]):o},r=He(()=>t().locale);return Z(c6.Provider,{value:{t:n,locale:r},get children(){return e.children}})};function go(){const e=lr(c6);if(!e)throw new Error("useLocalization must be used within an LocalizationProvider");return e}var d6=vi(void 0),e4={unreadRead:{archived:!1},unread:{read:!1},archived:{archived:!0}},f6=10,NK=e=>{var t;const[n,r]=Me(!1),[i,a]=Me(e.tabs),[o,s]=Me((t=e.tabs[0]&&e.tabs[0].label)!=null?t:""),[l,u]=Me("unreadRead"),[c,d]=Me(f6),[f,h]=Me(an(Ye({},e4.unreadRead),{tags:e.tabs.length>0?ba(e.tabs[0]):[]})),[m,p]=Me(!1),[y,v]=Me(e.preferencesFilter),b=C=>{u(C),h(x=>an(Ye({},e4[C]),{tags:x.tags}))},_=C=>{const x=i().find(P=>P.label===C),w=ba(x);w&&(s(C),h(P=>an(Ye({},P),{tags:w})))},T=(C,x)=>{if(!C)return;if(!C.startsWith("/")){window.open(C,x??wK,AK);return}if(e.routerPush){e.routerPush(C);return}const P=new URL(C,window.location.href);window.history.pushState.bind(window.history)({},"",P)};return cn(()=>{var C;a(e.tabs);const x=e.tabs[0],w=ba(x);s((C=x==null?void 0:x.label)!=null?C:""),h(P=>an(Ye({},P),{tags:w})),v(e.preferencesFilter)}),u6({event:"session.initialize.resolved",eventHandler:({data:C})=>{C&&p(C.removeNovuBranding)}}),Z(d6.Provider,{value:{status:l,setStatus:b,filter:f,tabs:i,activeTab:o,setActiveTab:_,limit:c,setLimit:d,isOpened:n,setIsOpened:r,navigate:T,hideBranding:m,preferencesFilter:y},get children(){return e.children}})},dr=()=>{const e=lr(d6);if(!e)throw new Error("useInboxContext must be used within a InboxProvider");return e},h6=vi(void 0);function IK(e){const t=He(()=>e.novu||new u7(e.options));return Z(h6.Provider,{get value(){return t()},get children(){return e.children}})}function vo(){const e=lr(h6);if(!e)throw new Error("useNovu must be used within a NovuProvider");return e}var PK=1,Gc=vi(void 0),RK=e=>{const t=vo(),{isOpened:n,tabs:r,filter:i,limit:a}=dr(),[o,s]=Me(0),[l,u]=Me(new Map),[c,d]=Me(new Map),f=()=>Ve(void 0,null,function*(){if(r().length===0)return;const p=r().map(_=>({tags:ba(_),read:!1,archived:!1})),{data:y}=yield t.notifications.count({filters:p});if(!y)return;const v=new Map,{counts:b}=y;for(let _=0;_<b.length;_+=1){const T=Fc(b[_].filter.tags);v.set(T,y==null?void 0:y.counts[_].count)}u(v)});sr(()=>{f()}),Lm({event:"notifications.unread_count_changed",eventHandler:p=>{s(p.result),f()}}),u6({event:"session.initialize.resolved",eventHandler:({data:p})=>{p&&s(p.totalUnreadCount)}});const h=(p,y)=>{const v=t.notifications.cache,b=a(),_=an(Ye({},i()),{tags:y,offset:0,limit:b}),T=!v.has(_);if(!n()&&T)return;const C=v.getAll(_)||{hasMore:!1,filter:_,notifications:[]};if(((C==null?void 0:C.notifications.length)||0)<PK){v.update(_,an(Ye({},C),{notifications:[p,...C.notifications]}));return}d(w=>{const P=Fc(y),O=new Map(w);return O.set(P,(w.get(P)||0)+1),O})};Lm({event:"notifications.notification_received",eventHandler:p=>Ve(void 0,[p],function*({result:y}){if(i().archived)return;const v=r();if(v.length>0)for(let b=0;b<v.length;b+=1){const _=v[b],T=ba(_),C=T.length===0,x=T.some(w=>{var P;return(P=y.tags)==null?void 0:P.includes(w)});!C&&!x||h(y,T)}else h(y,[])})}),Lm({event:"notifications.notification_received",eventHandler:f});const m=p=>{d(y=>{const v=new Map(y);return v.set(p,0),v})};return Z(Gc.Provider,{value:{totalUnreadCount:o,unreadCounts:l,newNotificationCounts:c,resetNewNotificationCounts:m},get children(){return e.children}})},Fc=e=>JSON.stringify({tags:e??[]}),FK=()=>{const e=lr(Gc);if(!e)throw new Error("useTotalUnreadCount must be used within a CountProvider");return{totalUnreadCount:e.totalUnreadCount}},MK=e=>{const t=lr(Gc);if(!t)throw new Error("useNewMessagesCount must be used within a CountProvider");const n=He(()=>Fc(e.filter.tags));return{count:He(()=>t.newNotificationCounts().get(n())||0),reset:()=>t.resetNewNotificationCounts(n())}},p6=e=>{const t=lr(Gc);if(!t)throw new Error("useUnreadCount must be used within a CountProvider");return He(()=>t.unreadCounts().get(Fc(e.filter.tags))||0)},BK=e=>{const t=lr(Gc);if(!t)throw new Error("useUnreadCounts must be used within a CountProvider");return He(()=>e.filters.map(r=>t.unreadCounts().get(Fc(r.tags))||0))};function LK({element:e,enabled:t}){cn(()=>{const n=e();if(!n||!t())return;const r="a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex], [contenteditable]",i=()=>Array.from(n.querySelectorAll(r)).filter(s=>s.tabIndex>=0&&!s.hasAttribute("disabled")),a=s=>{if(s.key!=="Tab")return;const l=i(),u=l[0],c=l[l.length-1];s.shiftKey?document.activeElement===u&&(c.focus(),s.preventDefault()):document.activeElement===c&&(u.focus(),s.preventDefault())};n.addEventListener("keydown",a);const o=i();o.length>0&&o[0].focus(),dn(()=>{n.removeEventListener("keydown",a)})})}var $K=LK,m6=vi(void 0),jK=e=>{const[t,n]=Me([]),r=o=>{n(s=>[...s,o])},i=o=>{n(s=>s.filter(l=>l!==o))},a=He(()=>t().length?t()[t().length-1]:null);return $K({element:()=>a(),enabled:()=>!0}),Z(m6.Provider,{value:{focusTraps:t,active:a,setActive:r,removeActive:i},get children(){return e.children}})};function Yy(){const e=lr(m6);if(!e)throw new Error("useFocusManager must be used within an FocusManagerProvider");return e}var HK=Le("<div>"),g6=e=>{let t;const[n,r]=wn(e,["render"]);return cn(()=>{const i=n.render(t);dn(()=>{i()})}),(()=>{var i=HK();return Ca(a=>{t=a},i),Ft(i,r,!1,!1),i})()},UK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M16.25 15V6.875L15 4.375H5L3.75 6.877V15c0 .345.28.625.625.625h11.25c.345 0 .625-.28.625-.625zM5 8.125h10v6.25H5v-6.25zm.772-2.5h8.455l.625 1.25H5.148l.625-1.25zm6.103 3.75h-3.75v1.25h3.75v-1.25z">'),Zy=e=>(()=>{var t=UK();return Ft(t,e,!0,!0),t})(),zK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M17.117 4.358l-1.159-1.4A1.21 1.21 0 0015 2.5H5c-.392 0-.733.175-.967.458l-1.15 1.4A1.632 1.632 0 002.5 5.417v10.416c0 .917.75 1.667 1.667 1.667h11.666c.917 0 1.667-.75 1.667-1.667V5.417c0-.4-.142-.775-.383-1.059zM10 14.583L5.417 10h2.916V8.333h3.334V10h2.916L10 14.583zM4.267 4.167l.675-.834h10l.783.834H4.267z">'),VK=e=>(()=>{var t=zK();return Ft(t,e,!0,!0),t})(),qK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M5.833 8.333L10 12.5l4.166-4.167H5.833z">'),Qy=e=>(()=>{var t=qK();return Ft(t,e,!0,!0),t})(),WK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M10 16.667l1.175-1.175-4.65-4.659h10.142V9.167H6.525l4.659-4.65L10 3.333 3.334 10 10 16.667z">'),KK=e=>(()=>{var t=WK();return Ft(t,e,!0,!0),t})(),GK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M10 18.333c.916 0 1.666-.75 1.666-1.666H8.333c0 .916.75 1.666 1.667 1.666zm5-5V9.167c0-2.559-1.359-4.7-3.75-5.267v-.567c0-.691-.559-1.25-1.25-1.25-.692 0-1.25.559-1.25 1.25V3.9C6.366 4.467 5 6.6 5 9.167v4.166L3.333 15v.833h13.333V15L15 13.333zm-1.667.834H6.666v-5c0-2.067 1.259-3.75 3.334-3.75s3.333 1.683 3.333 3.75v5z">');function YK(e){return(()=>{var t=GK();return Ft(t,e,!0,!0),t})()}var ZK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M12.5 3.333v5.834H4.31l-.975.975V3.333H12.5zm.834-1.666H2.5a.836.836 0 00-.833.833v11.667L5 10.833h8.334a.836.836 0 00.833-.833V2.5a.836.836 0 00-.833-.833zM17.5 5h-1.666v7.5H5v1.667c0 .458.375.833.834.833H15l3.334 3.333v-12.5A.836.836 0 0017.5 5z">'),QK=e=>(()=>{var t=ZK();return Ft(t,e,!0,!0),t})(),XK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M7.5 13.475L4.025 10l-1.183 1.175L7.5 15.833l10-10-1.175-1.175L7.5 13.475z">'),v6=e=>(()=>{var t=XK();return Ft(t,e,!0,!0),t})(),JK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M5 8.333c-.917 0-1.667.75-1.667 1.667s.75 1.667 1.667 1.667c.916 0 1.666-.75 1.666-1.667S5.916 8.333 5 8.333zm10 0c-.917 0-1.667.75-1.667 1.667s.75 1.667 1.667 1.667c.916 0 1.666-.75 1.666-1.667S15.916 8.333 15 8.333zm-5 0c-.917 0-1.667.75-1.667 1.667s.75 1.667 1.667 1.667c.916 0 1.666-.75 1.666-1.667S10.916 8.333 10 8.333z">'),y6=e=>(()=>{var t=JK();return Ft(t,e,!0,!0),t})(),eG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M16.667 3.333H3.334c-.917 0-1.659.75-1.659 1.667l-.008 10c0 .917.75 1.667 1.667 1.667h13.333c.917 0 1.667-.75 1.667-1.667V5c0-.917-.75-1.667-1.667-1.667zm0 11.667H3.334V6.667L10 10.833l6.667-4.166V15zM10 9.167L3.334 5h13.333L10 9.167z">'),tG=e=>(()=>{var t=eG();return Ft(t,e,!0,!0),t})(),nG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 viewBox="0 0 20 20"fill=none><path fill=currentColor d="M9.99967 18.3334C10.9163 18.3334 11.6663 17.5834 11.6663 16.6667H8.33301C8.33301 17.5834 9.08301 18.3334 9.99967 18.3334ZM14.9997 13.3334V9.16671C14.9997 6.60837 13.6413 4.46671 11.2497 3.90004V3.33337C11.2497 2.64171 10.6913 2.08337 9.99967 2.08337C9.30801 2.08337 8.74967 2.64171 8.74967 3.33337V3.90004C6.36634 4.46671 4.99967 6.60004 4.99967 9.16671V13.3334L3.33301 15V15.8334H16.6663V15L14.9997 13.3334ZM13.333 14.1667H6.66634V9.16671C6.66634 7.10004 7.92467 5.41671 9.99967 5.41671C12.0747 5.41671 13.333 7.10004 13.333 9.16671V14.1667Z">'),rG=e=>(()=>{var t=nG();return Ft(t,e,!0,!0),t})(),iG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M15.833 2.5H4.158c-.925 0-1.65.742-1.65 1.667L2.5 15.833A1.66 1.66 0 004.158 17.5h11.675c.917 0 1.667-.75 1.667-1.667V4.167A1.667 1.667 0 0015.833 2.5zm0 10H12.5c0 1.383-1.125 2.5-2.5 2.5a2.502 2.502 0 01-2.5-2.5H4.158V4.167h11.675V12.5z">'),aG=e=>(()=>{var t=iG();return Ft(t,e,!0,!0),t})(),oG=Le('<svg xmlns=http://www.w3.org/2000/svg width=13 height=12 fill=none viewBox="0 0 13 12"><path fill=currentColor d="M9.787.98A5.972 5.972 0 006.5 0c-.668 0-1.31.11-1.911.31L9.187 4.94c.221.222.6.065.6-.248V.98z"></path><path fill=currentColor d="M2.879 1.216A5.99 5.99 0 00.5 6c0 1.134.315 2.195.862 3.1V7.309c0-1.966 2.379-2.946 3.764-1.552l4.995 5.027A5.99 5.99 0 0012.5 6a5.972 5.972 0 00-.862-3.1v1.791c0 1.966-2.379 2.946-3.764 1.552L2.879 1.216z"></path><path fill=currentColor d="M8.411 11.69L3.813 7.06a.351.351 0 00-.6.248v3.711c.944.62 2.073.98 3.287.98.668 0 1.31-.11 1.911-.31z">'),sG=e=>(()=>{var t=oG();return Ft(t,e,!0,!0),t})(),lG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M15.833.833H7.5c-.917 0-1.667.75-1.667 1.667V5H7.5V3.333h8.333v13.334H7.5V15H5.833v2.5c0 .917.75 1.667 1.667 1.667h8.333c.917 0 1.667-.75 1.667-1.667v-15c0-.917-.75-1.667-1.667-1.667zM5.842 11.225L3.717 9.1l-1.059 1.058 3.175 3.175 5.992-5.991-1.058-1.059-4.925 4.942z">'),uG=e=>(()=>{var t=lG();return Ft(t,e,!0,!0),t})(),cG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M15.833 2.5H4.167C3.25 2.5 2.5 3.25 2.5 4.167v11.666c0 .917.75 1.667 1.667 1.667h11.666c.917 0 1.667-.75 1.667-1.667V4.167c0-.917-.75-1.667-1.667-1.667zm0 13.333H4.167V4.167h11.666v11.666zM14.992 7.5l-1.175-1.183-5.492 5.491-2.15-2.141-1.183 1.175 3.333 3.325L14.992 7.5z">'),b6=e=>(()=>{var t=cG();return Ft(t,e,!0,!0),t})(),dG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M15.95 10.783c.033-.25.05-.508.05-.783a4.81 4.81 0 00-.059-.783L17.633 7.9a.408.408 0 00.1-.508l-1.6-2.767a.407.407 0 00-.492-.183l-1.991.8a5.885 5.885 0 00-1.35-.784L12 2.342A.403.403 0 0011.6 2H8.4c-.2 0-.359.142-.392.342l-.3 2.116c-.492.2-.942.475-1.35.784l-1.992-.8a.398.398 0 00-.491.183L2.283 7.392c-.1.175-.067.391.1.508l1.692 1.317A4.89 4.89 0 004 10c0 .258.016.533.058.783L2.366 12.1a.408.408 0 00-.1.508l1.6 2.767c.1.183.309.242.492.183l1.992-.8c.416.317.858.584 1.35.784l.3 2.116c.041.2.2.342.4.342h3.2c.2 0 .366-.142.391-.342l.3-2.116c.492-.2.942-.467 1.35-.784l1.992.8c.183.067.392 0 .492-.183l1.6-2.767c.1-.183.058-.391-.1-.508l-1.675-1.317zM10 13c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3z">'),fG=e=>(()=>{var t=dG();return Ft(t,e,!0,!0),t})(),hG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M16.667 1.667H3.334c-.917 0-1.667.75-1.667 1.666v15L5 15h11.667c.917 0 1.667-.75 1.667-1.667v-10c0-.916-.75-1.666-1.667-1.666zm0 11.666H4.309l-.975.975V3.333h13.333v10zM5.834 7.5H7.5v1.667H5.834V7.5zm6.666 0h1.667v1.667H12.5V7.5zm-3.333 0h1.667v1.667H9.167V7.5z">'),pG=e=>(()=>{var t=hG();return Ft(t,e,!0,!0),t})(),mG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 viewBox="0 0 20 20"fill=none><path fill=currentColor d="M17.1167 4.35833L15.9583 2.95833C15.7333 2.675 15.3917 2.5 15 2.5H5C4.60833 2.5 4.26667 2.675 4.03333 2.95833L2.88333 4.35833C2.64167 4.64167 2.5 5.01667 2.5 5.41667V15.8333C2.5 16.75 3.25 17.5 4.16667 17.5H15.8333C16.75 17.5 17.5 16.75 17.5 15.8333V5.41667C17.5 5.01667 17.3583 4.64167 17.1167 4.35833ZM5.2 4.16667H14.8L15.4917 5H4.51667L5.2 4.16667ZM4.16667 15.8333V6.66667H15.8333V15.8333H4.16667ZM6.66667 11.6667H8.79167V14.1667H11.2083V11.6667H13.3333L10 8.33333L6.66667 11.6667Z">'),gG=e=>(()=>{var t=mG();return Ft(t,e,!0,!0),t})(),vG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M10 15v1.25H4.996a.625.625 0 01-.621-.62V4.37c0-.342.28-.62.624-.62H12.5l3.125 3.125v4.375h-1.25V7.5h-2.5V5h-6.25v10H10zm1.54-.335l2.21 2.21 3.094-3.093-.884-.884-2.21 2.21-1.326-1.326-.884.883z">'),E6=e=>(()=>{var t=vG();return Ft(t,e,!0,!0),t})(),t4=Le("<span>"),yG=e=>{const t=ft();return(()=>{var n=t4();return Ie(n,Z(YK,{get class(){return t("bellIcon")}}),null),Ie(n,Z(Tt,{get when(){return e.unreadCount>0},get children(){var r=t4();return ct(()=>Ze(r,t("bellDot","nt-absolute nt-top-2 nt-right-2 nt-block nt-size-2 nt-transform nt-translate-x-1/2 -nt-translate-y-1/2 nt-bg-primary nt-rounded-full nt-border nt-border-background"))),r}}),null),ct(()=>Ze(n,t("bellContainer","nt-h-6 nt-w-6 nt-flex nt-justify-center nt-items-center nt-rounded-md nt-relative nt-text-foreground nt-cursor-pointer"))),n})()},_6=e=>{const{totalUnreadCount:t}=FK();return Z(Tt,{get when(){return e.renderBell},get fallback(){return Z(yG,{get unreadCount(){return t()}})},get children(){return Z(g6,{render:n=>e.renderBell(n,t())})}})},bG=Le('<div class="nt-flex nt-shrink-0 nt-justify-center nt-items-center nt-gap-1 nt-mt-auto nt-pt-9 nt-pb-3 nt-text-foreground-alpha-200"><span class=nt-text-xs>Powered by Novu'),EG=()=>{const{hideBranding:e}=dr();return Z(Tt,{get when(){return!e()},get children(){var t=bG(),n=t.firstChild;return Ie(t,Z(sG,{}),n),t}})},_G=Le("<button>"),T6=Sq("nt-inline-flex nt-gap-4 nt-items-center nt-justify-center nt-whitespace-nowrap nt-rounded-lg nt-text-sm nt-font-medium nt-ring-offset-background nt-transition-colors focus-visible:nt-outline-none focus-visible:nt-ring-2 focus-visible:nt-ring-primary nt-focus-visible:nt-ring-offset-2 disabled:nt-pointer-events-none disabled:nt-opacity-50",{variants:{variant:{default:"nt-bg-primary nt-text-primary-foreground hover:nt-bg-primary-alpha-900",secondary:"nt-bg-secondary nt-text-secondary-foreground hover:nt-bg-secondary-alpha-800",icon:"nt-text-secondary-foreground-alpha-500 hover:nt-bg-neutral-alpha-50",ghost:"hover:nt-bg-neutral-alpha-50",unstyled:""},size:{none:"",icon:"nt-p-1",default:"nt-h-8 nt-px-3",sm:"nt-h-7 nt-rounded-md nt-px-3",lg:"nt-h-10 nt-px-8"}},defaultVariants:{variant:"default",size:"default"}}),yr=e=>{const[t,n]=wn(e,["class","appearanceKey"]),r=ft();return(()=>{var i=_G();return Ft(i,At({get"data-variant"(){return e.variant},get"data-size"(){return e.size},get class(){return r(t.appearanceKey||"button",Bn(T6({variant:e.variant,size:e.size}),t.class))}},n),!1,!1),i})()},TG=Le("<button>"),CG=e=>{const{onClose:t}=Yc(),[n,r]=wn(e,["onClick","asChild"]),i=a=>{typeof n.onClick=="function"&&n.onClick(a),t()};return n.asChild?Z(Fh,At({get component(){return n.asChild},onClick:i},r)):(()=>{var a=TG();return a.$$click=i,Ft(a,r,!1,!1),a})()};zl(["click"]);var C6=new Proxy(WE,{get:(e,t)=>n=>{const{animations:r}=Gy();return Z(WE,At(n,{tag:t,get transition(){return r()?n.transition:{duration:0}}}))}}),x6=vi(void 0);function xG(e){var t;const[n,r]=Me((t=e.open)!=null?t:!1),i=()=>{var m;return(m=e.onOpenChange)!=null?m:r},a=()=>{var m;return(m=e.open)!=null?m:n()},[o,s]=Me(null),[l,u]=Me(null),c=o6(o,l,{placement:e.placement||"bottom-start",whileElementsMounted:(m,p,y)=>n6(m,p,y,{elementResize:!1,ancestorScroll:!1,animationFrame:!1,layoutShift:!1}),middleware:[r6(10),a6({fallbackPlacements:e.fallbackPlacements||["top-start"]}),i6()]}),d=He(()=>{var m,p;return{position:c.strategy,top:`${(m=c.y)!=null?m:0}px`,left:`${(p=c.x)!=null?p:0}px`}}),f=()=>{i()(!1)},h=()=>{i()(m=>!m)};return Z(x6.Provider,{value:{onToggle:h,onClose:f,reference:o,setReference:s,floating:l,setFloating:u,open:a,floatingStyles:d},get children(){return e.children}})}function Yc(){const e=lr(x6);if(!e)throw new Error("usePopover must be used within Popover.Root component");return e}var wG=()=>Bn("nt-w-[400px] nt-h-[600px] nt-rounded-xl nt-bg-background","nt-shadow-popover nt-z-10 nt-cursor-default nt-flex nt-flex-col nt-overflow-hidden"),n4=e=>{const{open:t,setFloating:n,floating:r,floatingStyles:i}=Yc(),{setActive:a,removeActive:o}=Yy(),[s,l]=wn(e,["class","appearanceKey","style"]),u=ft();return sr(()=>{const c=r();a(c),dn(()=>{o(c)})}),Z(C6.div,At({ref:n,get class(){return He(()=>!!s.class)()?s.class:u(s.appearanceKey||"popoverContent",wG())},get style(){return i()},get"data-open"(){return t()},animate:{opacity:[0,1],y:[-6,0]},transition:{duration:.1,easing:"ease-out"}},l))},AG=e=>{const[t,n]=wn(e,["portal"]),{open:r,onClose:i,reference:a,floating:o}=Yc(),{active:s}=Yy(),l=c=>{var d,f;(d=a())!=null&&d.contains(c.target)||s()!==o()||(f=o())!=null&&f.contains(c.target)||i()},u=c=>{s()===o()&&c.key==="Escape"&&i()};return sr(()=>{document.body.addEventListener("click",l),document.body.addEventListener("keydown",u)}),dn(()=>{document.body.removeEventListener("click",l),document.body.removeEventListener("keydown",u)}),Z(Tt,{get when(){return r()},get children(){return Z(Tt,{get when(){return t.portal},get fallback(){return Z(n4,n)},get children(){return Z(jy,{get children(){return Z(Xy,{get children(){return Z(n4,n)}})}})}})}})},kG=Le("<button>"),SG=e=>{const{setReference:t,onToggle:n}=Yc(),r=ft(),[i,a]=wn(e,["appearanceKey","asChild","onClick"]),o=s=>{typeof i.onClick=="function"&&i.onClick(s),n()};return i.asChild?Z(Fh,At({get component(){return i.asChild},ref:t,onClick:o},a)):(()=>{var s=kG();return s.$$click=o,Ca(t,s),Ft(s,At({get class(){return r(i.appearanceKey||"dropdownTrigger")}},a),!1,!0),Ie(s,()=>e.children),s})()};zl(["click"]);var ro={Root:xG,Trigger:SG,Content:AG,Close:CG},DG=()=>"nt-w-max nt-rounded-xl nt-p-1 nt-overflow-hidden nt-flex nt-flex-col nt-min-w-52 nt-shadow-dropdown nt-z-10 nt-bg-background",OG=e=>{const t=ft(),[n,r]=wn(e,["appearanceKey"]);return Z(ro.Content,At({get class(){return t(n.appearanceKey||"dropdownContent",DG())}},r))},zh=()=>"focus:nt-outline-none nt-rounded-lg nt-items-center hover:nt-bg-neutral-alpha-50 focus-visible:nt-bg-neutral-alpha-50 nt-py-1 nt-px-3",NG=e=>{const t=ft(),[n,r]=wn(e,["appearanceKey","onClick","class"]),{onClose:i}=Yc();return Z(ro.Close,At({get class(){return He(()=>!!n.class)()?n.class:t(n.appearanceKey||"dropdownItem",zh())},onClick:a=>{typeof n.onClick=="function"&&n.onClick(a),i()}},r))},IG=e=>Z(ro.Root,At({placement:"bottom",fallbackPlacements:["top"]},e)),PG=()=>"nt-relative nt-transition nt-outline-none focus-visible:nt-outline-nonefocus-visible:nt-ring-2 focus-visible:nt-ring-primary focus-visible:nt-ring-offset-2",RG=e=>{const t=ft(),[n,r]=wn(e,["appearanceKey"]);return Z(ro.Trigger,At({get class(){return t(n.appearanceKey||"dropdownTrigger",PG())}},r))},Ur={Root:IG,Trigger:RG,Content:OG,Close:ro.Close,Item:NG},FG=Le("<div role=tablist>"),MG=Le('<div class="nt-border-t nt-border-secondary nt-mt-[-0.25rem] nt-relative nt-z-[-1]">'),BG=()=>"nt-flex nt-gap-6 nt-px-6 nt-py-1 nt-overflow-hidden",LG=e=>{const[t,n]=wn(e,["class","appearanceKey","ref","children"]),r=ft();return[(()=>{var i=FG(),a=t.ref;return typeof a=="function"?Ca(a,i):t.ref=i,Ft(i,At({get class(){return He(()=>!!t.class)()?t.class:r(t.appearanceKey||"tabsList",BG())}},n),!1,!0),Ie(i,()=>t.children),i})(),MG()]},$G=({activeTab:e,setActiveTab:t,tabsContainer:n})=>{const[r,i]=Me(!1);cn(()=>{const a=o=>{var s;if(o.key!=="Tab")return;const l=(s=n())==null?void 0:s.querySelectorAll('[role="tab"]');!l||!document.activeElement||i(Array.from(l).includes(document.activeElement))};return document.addEventListener("keyup",a),dn(()=>document.removeEventListener("keyup",a))}),cn(()=>{const a=o=>{var s,l;if(!r()||o.key!=="ArrowLeft"&&o.key!=="ArrowRight")return;const u=Array.from((l=(s=n())==null?void 0:s.querySelectorAll('[role="tab"]'))!=null?l:[]),c=u.map(p=>p.id),d=c.indexOf(e()),{length:f}=c;let h=d,m=e();o.key==="ArrowLeft"?(h=d===0?f-1:d-1,m=c[h]):o.key==="ArrowRight"&&(h=d===f-1?0:d+1,m=c[h]),u[h].focus(),t(m)};return document.addEventListener("keydown",a),dn(()=>document.removeEventListener("keydown",a))})},jG=Le("<div>"),w6=vi(void 0),A6=()=>{const e=lr(w6);if(!e)throw new Error("useTabsContext must be used within an TabsContext.Provider");return e},k6=()=>"nt-flex nt-flex-col",HG=e=>{var t;const[n,r]=wn(e,["defaultValue","value","class","appearanceKey","onChange","children"]),[i,a]=Me(),[o,s]=Me([]),[l,u]=Me((t=n.defaultValue)!=null?t:""),c=ft();return $G({tabsContainer:i,activeTab:l,setActiveTab:u}),cn(()=>{n.value&&u(n.value)}),cn(()=>{var d;(d=n.onChange)==null||d.call(n,l())}),Z(w6.Provider,{value:{activeTab:l,setActiveTab:u,visibleTabs:o,setVisibleTabs:s},get children(){var d=jG();return Ca(a,d),Ft(d,At({get class(){return He(()=>!!n.class)()?n.class:c(n.appearanceKey||"tabsRoot",k6())}},r),!1,!0),Ie(d,()=>n.children),d}})},UG=Le("<div role=tabpanel>"),zG=e=>{const[t,n]=wn(e,["value","class","appearanceKey","children"]),r=ft(),{activeTab:i}=A6();return Z(Tt,{get when(){return i()===t.value},get children(){var a=UG();return Ft(a,At({get class(){return He(()=>!!t.class)()?t.class:r(t.appearanceKey||"tabsContent",i()===t.value?"nt-block":"nt-hidden")},get id(){return`tabpanel-${t.value}`},get"aria-labelledby"(){return t.value},get"data-state"(){return i()===t.value?"active":"inactive"}},n),!1,!0),Ie(a,()=>t.children),a}})},S6=()=>"nt-relative nt-transition nt-outline-none nt-text-foreground-alpha-600 focus-visible:nt-outline-none focus-visible:nt-ring-2 focus-visible:nt-ring-primary focus-visible:nt-ring-offset-2 nt-pb-[0.625rem] after:nt-absolute after:nt-content-[''] after:nt-bottom-0 after:nt-left-0 after:nt-w-full after:nt-h-[2px] after:nt-border-b-2 data-[state=active]:after:nt-border-primary data-[state=active]:nt-text-foreground after:nt-border-b-transparent",VG=e=>{const[t,n]=wn(e,["value","class","appearanceKey","ref","onClick","children"]),r=ft(),{activeTab:i,setActiveTab:a}=A6(),o=()=>a(t.value);return Z(yr,At({variant:"unstyled",size:"none",ref(s){var l=t.ref;typeof l=="function"?l(s):t.ref=s},get id(){return t.value},get appearanceKey(){var s;return(s=t.appearanceKey)!=null?s:"tabsTrigger"},get class(){return He(()=>!!t.class)()?t.class:r(t.appearanceKey||"tabsTrigger",S6())},get onClick(){var s;return(s=t.onClick)!=null?s:o},role:"tab",tabIndex:0,get"aria-selected"(){return i()===t.value},get"aria-controls"(){return`tabpanel-${t.value}`},get"data-state"(){return i()===t.value?"active":"inactive"}},n,{get children(){return t.children}}))},Uu={Root:HG,List:LG,Trigger:VG,Content:zG},qG={unreadRead:"inbox.filters.dropdownOptions.default",unread:"inbox.filters.dropdownOptions.unread",archived:"inbox.filters.dropdownOptions.archived"},r4={unreadRead:"inbox.filters.labels.default",unread:"inbox.filters.labels.unread",archived:"inbox.filters.labels.archived"},WG=Le("<span><span></span><span>"),KG=Le("<span>"),GG=[{status:"unreadRead",icon:aG},{status:"unread",icon:E6},{status:"archived",icon:Zy}],YG=e=>Z(Wi,{each:GG,children:t=>Z(ZG,{get localizationKey(){return qG[t.status]},onClick:()=>{e.setStatus(t.status)},get isSelected(){return e.status===t.status},get icon(){return t.icon}})}),ZG=e=>{const t=ft(),{t:n}=go();return Z(Ur.Item,{get class(){return t("inboxStatus__dropdownItem",Bn(zh(),"nt-flex nt-gap-8 nt-justify-between"))},get onClick(){return e.onClick},get children(){return[(()=>{var r=WG(),i=r.firstChild,a=i.nextSibling;return Ie(i,()=>e.icon()),Ie(a,()=>n(e.localizationKey)),ct(o=>{var s=t("inboxStatus__dropdownItemLabelContainer","nt-flex nt-gap-2 nt-items-center"),l=t("inboxStatus__dropdownItemLeft__icon"),u=e.localizationKey,c=t("inboxStatus__dropdownItemLabel");return s!==o.e&&Ze(r,o.e=s),l!==o.t&&Ze(i,o.t=l),u!==o.a&&er(a,"data-localization",o.a=u),c!==o.o&&Ze(a,o.o=c),o},{e:void 0,t:void 0,a:void 0,o:void 0}),r})(),Z(Tt,{get when(){return e.isSelected},get children(){var r=KG();return Ie(r,Z(v6,{})),ct(()=>Ze(r,t("inboxStatus__dropdownItemRight__icon"))),r}})]}})},i4=Le("<span>"),QG=()=>{const e=ft(),{status:t,setStatus:n}=dr(),{t:r}=go();return Z(Ur.Root,{get children(){return[Z(Ur.Trigger,{get class(){return e("inboxStatus__dropdownTrigger",Bn(T6({variant:"unstyled",size:"none"}),"nt-gap-2"))},asChild:i=>Z(yr,At({variant:"unstyled",size:"none"},i,{get children(){return[(()=>{var a=i4();return Ie(a,()=>r(r4[t()])),ct(o=>{var s=r4[t()],l=e("inboxStatus__title","nt-text-xl nt-font-semibold");return s!==o.e&&er(a,"data-localization",o.e=s),l!==o.t&&Ze(a,o.t=l),o},{e:void 0,t:void 0}),a})(),(()=>{var a=i4();return Ie(a,Z(Qy,{})),ct(()=>Ze(a,e("inboxStatus__dropdownItemRight__icon","nt-text-foreground-alpha-600"))),a})()]}}))}),Z(Ur.Content,{appearanceKey:"inboxStatus__dropdownContent",get children(){return Z(YG,{setStatus:n,get status(){return t()}})}})]}})},XG=e=>{const t=vo();let n=Ye({},e.options());const[r,{initialLoading:i,setEl:a,end:o,mutate:s,reset:l}]=mK(c=>Ve(void 0,null,function*(){var d,f;const{data:h}=yield t.notifications.list(an(Ye({},e.options()||{}),{offset:c}));return{data:(d=h==null?void 0:h.notifications)!=null?d:[],hasMore:(f=h==null?void 0:h.hasMore)!=null?f:!1}}));return sr(()=>{const c=({data:f})=>{!f||!Nf(n,f.filter)||s({data:f.notifications,hasMore:f.hasMore})},d=t.on("notifications.list.updated",c);dn(()=>d())}),cn(()=>{const c=Ye({},e.options());Nf(n,c)||(t.notifications.clearCache(),l(),n=c)}),{data:r,initialLoading:i,setEl:a,end:o,refetch:({filter:c})=>{t.notifications.clearCache({filter:c}),l()}}},JG=e=>{const t=vo(),[n,r]=Me(!0),[i,{mutate:a,refetch:o}]=p7(e||{},s=>Ve(void 0,[s],function*({tags:l}){try{return(yield t.preferences.list({tags:l})).data}catch(u){throw console.error("Error fetching preferences:",u),u}}));return sr(()=>{const s=({data:u})=>{u&&a(u)},l=t.on("preferences.list.updated",s);dn(()=>l())}),cn(()=>{r(i.loading)}),{preferences:i,loading:n,mutate:a,refetch:o}},eY=e=>{const t=vo();return{readAll:(...r)=>Ve(void 0,[...r],function*({tags:i}={}){var a,o;try{yield t.notifications.readAll({tags:i}),(a=e==null?void 0:e.onSuccess)==null||a.call(e)}catch(s){(o=void 0)==null||o.call(e,s)}})}},tY=e=>{const t=vo();return{archiveAll:(...r)=>Ve(void 0,[...r],function*({tags:i}={}){var a,o;try{yield t.notifications.archiveAll({tags:i}),(a=e==null?void 0:e.onSuccess)==null||a.call(e)}catch(s){(o=void 0)==null||o.call(e,s)}})}},nY=e=>{const t=vo();return{archiveAllRead:(...r)=>Ve(void 0,[...r],function*({tags:i}={}){var a,o;try{yield t.notifications.archiveAllRead({tags:i}),(a=e==null?void 0:e.onSuccess)==null||a.call(e)}catch(s){(o=void 0)==null||o.call(e,s)}})}},a4=Le("<span>"),rY=()=>{const{filter:e}=dr(),{readAll:t}=eY(),{archiveAll:n}=tY(),{archiveAllRead:r}=nY();return[Z($m,{localizationKey:"notifications.actions.readAll",onClick:()=>t({tags:e().tags}),icon:b6}),Z($m,{localizationKey:"notifications.actions.archiveAll",onClick:()=>n({tags:e().tags}),icon:Zy}),Z($m,{localizationKey:"notifications.actions.archiveRead",onClick:()=>r({tags:e().tags}),icon:VK})]},$m=e=>{const t=ft(),{t:n}=go();return Z(Ur.Item,{get class(){return t("moreActions__dropdownItem",Bn(zh(),"nt-flex nt-gap-2"))},get onClick(){return e.onClick},get children(){return[(()=>{var r=a4();return Ie(r,()=>e.icon()),ct(()=>Ze(r,t("moreActions__dropdownItemLeft__icon","nt-text-foreground-alpha-600"))),r})(),(()=>{var r=a4();return Ie(r,()=>n(e.localizationKey)),ct(i=>{var a=e.localizationKey,o=t("moreActions__dropdownItemLabel");return a!==i.e&&er(r,"data-localization",i.e=a),o!==i.t&&Ze(r,i.t=o),i},{e:void 0,t:void 0}),r})()]}})},iY=()=>{const e=ft(),{status:t}=dr();return Z(Tt,{get when(){return t()!=="archived"},get children(){return Z(Ur.Root,{get children(){return[Z(Ur.Trigger,{get class(){return e("moreActions__dropdownTrigger")},asChild:n=>Z(yr,At({variant:"icon",size:"icon"},n,{get children(){return Z(y6,{get class(){return e("moreActions__dots")}})}}))}),Z(Ur.Content,{appearanceKey:"moreActions__dropdownContent",get children(){return Z(rY,{})}})]}})}})},aY=Le("<div>"),oY=e=>{const t=ft();return(()=>{var n=aY();return Ie(n,Z(iY,{}),null),Ie(n,Z(Tt,{get when(){return e.showPreferences},children:r=>Z(yr,{appearanceKey:"preferences__button",variant:"icon",size:"icon",get onClick(){return r()},get children(){return Z(fG,{})}})}),null),ct(()=>Ze(n,t("moreActionsContainer","nt-flex nt-gap-2"))),n})()},sY=Le("<div>"),lY=e=>{const t=ft();return(()=>{var n=sY();return Ie(n,Z(QG,{}),null),Ie(n,Z(oY,{get showPreferences(){return e.navigateToPreferences}}),null),ct(()=>Ze(n,t("inboxHeader",Bn("nt-flex nt-shrink-0 nt-justify-between nt-items-center nt-w-full nt-py-5 nt-px-6")))),n})()},uY=Le("<div><div data-localization=preferences.title>"),cY=Le("<button>"),dY=e=>{const t=ft(),{t:n}=go();return(()=>{var r=uY(),i=r.firstChild;return Ie(r,Z(Tt,{get when(){return e.navigateToNotifications},children:a=>(()=>{var o=cY();return _7(o,"click",a(),!0),Ie(o,Z(KK,{})),ct(()=>Ze(o,t("preferencesHeader__back__button","nt-h-6 nt-w-6 nt-flex nt-justify-center nt-items-center nt-rounded-md nt-relative hover:nt-bg-foreground-alpha-50 focus:nt-bg-foreground-alpha-50 nt-text-foreground-alpha-600"))),o})()}),i),Ie(i,()=>n("preferences.title")),ct(a=>{var o=t("preferencesHeader","nt-flex nt-items-center nt-py-5 nt-px-6 nt-gap-2"),s=t("preferencesHeader__title","nt-text-xl nt-font-semibold");return o!==a.e&&Ze(r,a.e=o),s!==a.t&&Ze(i,a.t=s),a},{e:void 0,t:void 0}),r})()};zl(["click"]);var fY=Le("<div>"),Xy=e=>{const[t,n]=wn(e,["class"]),{id:r}=Gy(),i=ft(),{hideBranding:a}=dr();return[Z(Tt,{get when(){return!a()},children:new Comment(" Powered by Novu - https://novu.co ")}),(()=>{var o=fY();return Ft(o,At({get id(){return`novu-root-${r()}`},get class(){return i("root"),Bn("novu",r(),"nt-text-foreground nt-h-full")}},n),!1,!1),o})()]},hY=Le('<label><input type=checkbox class="nt-peer nt-sr-only"><div>'),pY=e=>{const t=ft();return(()=>{var n=hY(),r=n.firstChild,i=r.nextSibling;return r.addEventListener("change",a=>{e.onChange(a.target.checked)}),ct(a=>{var o=t("channelSwitch","nt-relative nt-inline-flex nt-cursor-pointer nt-items-center"),s=t("channelSwitchThumb","nt-peer nt-h-6 nt-w-11 nt-rounded-full nt-border nt-border-neutral-alpha-200 peer-checked:nt-border-neutral-alpha-400 nt-bg-neutral-alpha-300 after:nt-absolute after:nt-left-[2px] after:nt-top-0.5 after:nt-h-5 after:nt-w-5 after:nt-rounded-full after:nt-border after:nt-border-neutral-alpha-400 after:nt-bg-background after:nt-transition-all after:nt-content-[''] peer-checked:nt-bg-primary peer-checked:after:nt-translate-x-full peer-checked:after:nt-border-background nt-transition-all nt-duration-200 after:nt-duration-200"),l=e.checked;return o!==a.e&&Ze(n,a.e=o),s!==a.t&&Ze(i,a.t=s),l!==a.a&&er(i,"data-checked",a.a=l),a},{e:void 0,t:void 0,a:void 0}),ct(()=>r.checked=e.checked),n})()},mY=Le("<div><div><div></div><span></span></div><div>"),gY=e=>{const t=ft(),n=i=>Ve(void 0,null,function*(){e.onChange({channel:e.channel,enabled:i,workflowId:e.workflowId})}),r=i=>{n(i)};return(()=>{var i=mY(),a=i.firstChild,o=a.firstChild,s=o.nextSibling,l=a.nextSibling;return Ie(o,Z(vY,{get channel(){return e.channel}})),Ie(s,()=>D6(e.channel)),Ie(l,Z(pY,{get checked(){return e.enabled},onChange:u=>r(u)})),ct(u=>{var c=t("channelContainer","nt-flex nt-justify-between nt-items-center nt-h-11 nt-gap-2 data-[disabled=true]:nt-text-foreground-alpha-600"),d=t("channelLabelContainer","nt-flex nt-items-center nt-gap-2"),f=t("channelLabel","nt-text-base nt-font-semibold"),h=t("channelSwitchContainer","nt-flex nt-items-center");return c!==u.e&&Ze(i,u.e=c),d!==u.t&&Ze(a,u.t=d),f!==u.a&&Ze(s,u.a=f),h!==u.o&&Ze(l,u.o=h),u},{e:void 0,t:void 0,a:void 0,o:void 0}),i})()},vY=e=>{switch(e.channel){case"in_app":return Z(rG,{});case"email":return Z(tG,{});case"push":return Z(uG,{});case"sms":return Z(pG,{});case"chat":return Z(QK,{});default:return null}},D6=e=>{switch(e){case"in_app":return"In-App";case"email":return"Email";case"push":return"Push";case"sms":return"SMS";case"chat":return"Chat";default:return""}},O6=Le("<div>"),jo=e=>{const t=ft();return(()=>{var n=O6();return ct(()=>Ze(n,t(e.appearanceKey,Bn("nt-w-full nt-h-3 nt-rounded nt-bg-foreground-alpha-100",e.class)))),n})()},yY=e=>{const t=ft();return(()=>{var n=O6();return ct(()=>Ze(n,t(e.appearanceKey,Bn("nt-size-8 nt-rounded-lg nt-bg-foreground-alpha-100",e.class)))),n})()},bY=Le('<div><div class="nt-flex nt-flex-col nt-self-stretch nt-gap-1 nt-flex-1"></div><div>'),EY=()=>Z(Wi,{get each(){return Array.from({length:8})},children:()=>Z(_Y,{})}),_Y=()=>{const e=ft();return(()=>{var t=bY(),n=t.firstChild,r=n.nextSibling;return Ie(n,Z(jo,{appearanceKey:"skeletonText",class:"nt-w-1/3"}),null),Ie(n,Z(jo,{appearanceKey:"skeletonText",class:"nt-w-1/3"}),null),Ie(r,Z(Qy,{})),ct(()=>Ze(t,e("preferencesLoadingContainer","nt-p-4 nt-flex nt-gap-1 nt-items-center nt-self-stretch nt-animate-pulse"))),t})()},Jy=Le("<div>"),TY=Le("<span>"),CY=Le("<div><div><div><div></div></div><span>"),xY=()=>{var e;const t=ft(),{preferencesFilter:n}=dr(),{preferences:r,loading:i}=JG({tags:(e=n())==null?void 0:e.tags}),a=He(()=>{var s,l;const u=(s=r())==null?void 0:s.find(f=>f.level==="global"),c=(l=r())==null?void 0:l.filter(f=>f.level==="template"),d=c==null?void 0:c.map(f=>{var h;return(h=f.workflow)==null?void 0:h.id});return{globalPreference:u,workflowPreferences:c,workflowPreferencesIds:d}});cn(()=>{pK(s=>{var l;return Ye(Ye({},s),(l=a().workflowPreferences)==null?void 0:l.reduce((u,c)=>(u[c.workflow.identifier]=c.workflow.name,u),{}))})});const o=s=>({channel:l,enabled:u})=>{s==null||s.update({channelPreferences:{[l]:u}})};return(()=>{var s=Jy();return Ie(s,Z(Tt,{get when(){return i()},get children(){return Z(EY,{})}}),null),Ie(s,Z(Tt,{get when(){return He(()=>!i())()&&r()},get children(){return[Z(o4,{localizationKey:"preferences.global",get channels(){var l;return((l=a().globalPreference)==null?void 0:l.channels)||{}},get onChange(){return o(a().globalPreference)}}),Z(Wi,{get each(){return a().workflowPreferencesIds},children:(l,u)=>{const c=()=>{var d;return(d=a().workflowPreferences)==null?void 0:d[u()]};return c()?Z(o4,{get localizationKey(){return c().workflow.identifier},get channels(){return c().channels},get workflowId(){var d;return(d=c().workflow)==null?void 0:d.id},get onChange(){return o(c())}}):null}})]}}),null),ct(()=>Ze(s,t("preferencesContainer","nt-p-2 nt-flex nt-flex-col nt-gap-1 nt-bg-background nt-overflow-y-auto nt-h-full"))),s})()},wY=e=>{const t=ft(),n=()=>{const r=[];for(const i in e.channels)if(e.channels[i]!==void 0){const a=!e.channels[i],o=(()=>{var s=TY();return er(s,"data-disabled",a),Ie(s,()=>D6(i)),ct(()=>Ze(s,t("channelName","data-[disabled=true]:nt-text-foreground-alpha-400"))),s})();r.push(o)}return r.map((i,a)=>[i,He(()=>a<r.length-1&&", ")])};return(()=>{var r=Jy();return Ie(r,n),ct(()=>Ze(r,t("channelDescription","nt-text-sm nt-text-foreground-alpha-600 nt-text-start"))),r})()},o4=e=>{const[t,n]=Me(!1),r=ft(),{t:i}=go(),a=He(()=>Object.keys(e.channels||{}));return Z(Tt,{get when(){return a().length>0},get children(){var o=CY(),s=o.firstChild,l=s.firstChild,u=l.firstChild,c=l.nextSibling;return s.$$click=()=>n(d=>!d),Ie(u,()=>i(e.localizationKey)),Ie(l,Z(wY,{get channels(){return e.channels}}),null),Ie(c,Z(Qy,{get class(){return r("workflowArrow__icon","nt-text-foreground-alpha-600")}})),Ie(o,Z(SW,{exitBeforeEnter:!0,get children(){return Z(Tt,{get when(){return t()},get children(){return Z(C6.div,{animate:{gridTemplateRows:["0fr","1fr"]},exit:{gridTemplateRows:["1fr","0fr"]},transition:{duration:.2,easing:"ease-out"},get class(){return r("channelsContainerCollapsible","nt-grid nt-self-stretch")},get children(){var d=Jy();return Ie(d,Z(Wi,{get each(){return a()},children:f=>Z(gY,{channel:f,get enabled(){return!!e.channels[f]},get workflowId(){return e.workflowId},get onChange(){return e.onChange}})})),ct(()=>Ze(d,r("channelsContainer","nt-overflow-hidden nt-flex-col nt-gap-1"))),d}})}})}}),null),ct(d=>{var f=r("workflowContainer","nt-p-4 nt-flex nt-flex-col nt-gap-1 nt-items-start nt-self-stretch hover:nt-bg-neutral-alpha-50 nt-rounded-lg data-[disabled=true]:nt-bg-neutral-alpha-50"),h=t(),m=r("workflowLabelContainer","nt-flex nt-justify-between nt-flex-nowrap nt-self-stretch nt-cursor-pointer nt-items-center"),p=t(),y=r("workflowLabel","nt-text-base nt-font-semibold nt-text-start nt-flex nt-items-center nt-gap-1"),v=e.localizationKey,b=t(),_=r("workflowContainerRight__icon","nt-text-foreground-alpha-600 nt-transition-all nt-duration-200 data-[open=true]:nt-transform data-[open=true]:nt-rotate-180"),T=t();return f!==d.e&&Ze(o,d.e=f),h!==d.t&&er(o,"data-open",d.t=h),m!==d.a&&Ze(s,d.a=m),p!==d.o&&er(s,"data-open",d.o=p),y!==d.i&&Ze(u,d.i=y),v!==d.n&&er(u,"data-localization",d.n=v),b!==d.s&&er(u,"data-open",d.s=b),_!==d.h&&Ze(c,d.h=_),T!==d.r&&er(c,"data-open",d.r=T),d},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),o}})};zl(["click"]);var AY=Le("<strong>"),kY=Le("<p>"),SY=e=>{const t=ft();return(()=>{var n=AY();return Ie(n,()=>e.children),ct(()=>Ze(n,t(e.appearanceKey||"strong","nt-font-semibold"))),n})()},DY=e=>e.children,OY=e=>{const t=e,{children:n,strongAppearanceKey:r}=t,i=Dy(t,["children","strongAppearanceKey"]),a=He(()=>aV(n));return(()=>{var o=kY();return Ft(o,i,!1,!0),Ie(o,Z(Wi,{get each(){return a()},children:s=>s.type==="bold"?Z(SY,{appearanceKey:r,get children(){return s.content}}):Z(DY,{get children(){return s.content}})})),o})()},s4=OY,N6=vi(void 0);function NY(e){const[t,n]=Me(null),[r,i]=Me(null),a=o6(t,r,{placement:e.placement||"top",whileElementsMounted:n6,middleware:[r6(10),a6({fallbackPlacements:e.fallbackPlacements||["bottom"]}),i6()]}),[o,s]=xK({value:e.open,fallbackValue:!1});return Z(N6.Provider,{value:{reference:t,setReference:n,floating:r,setFloating:i,open:o,setOpen:s,floatingStyles:()=>{var l,u;return{position:a.strategy,top:`${(l=a.y)!=null?l:0}px`,left:`${(u=a.x)!=null?u:0}px`}}},get children(){return e.children}})}function e9(){const e=lr(N6);if(!e)throw new Error("useTooltip must be used within Tooltip.Root component");return e}var IY=Le("<div>"),PY=()=>"nt-bg-foreground nt-p-2 nt-shadow-tooltip nt-rounded-lg nt-text-background nt-text-xs",RY=e=>{const{open:t,setFloating:n,floating:r,floatingStyles:i}=e9(),{setActive:a,removeActive:o}=Yy(),[s,l]=wn(e,["class","appearanceKey","style"]),u=ft();return sr(()=>{const c=r();a(c),dn(()=>{o(c)})}),(()=>{var c=IY();return Ca(n,c),Ft(c,At({get class(){return He(()=>!!s.class)()?s.class:u(s.appearanceKey||"tooltipContent",PY())},get style(){return an(Ye({},i()),{"z-index":99999})},get"data-open"(){return t()}},l),!1,!1),c})()},FY=e=>{const{open:t}=e9();return Z(Tt,{get when(){return t()},get children(){return Z(jy,{get children(){return Z(Xy,{get children(){return Z(RY,e)}})}})}})},MY=Le("<button>"),BY=e=>{const{setReference:t,setOpen:n}=e9(),r=ft(),[i,a]=wn(e,["appearanceKey","asChild","onClick"]);return i.asChild?Z(Fh,At({get component(){return i.asChild},ref:t,onMouseEnter:()=>{n(!0)},onMouseLeave:()=>{n(!1)}},a)):(()=>{var o=MY();return o.addEventListener("mouseleave",()=>{n(!1)}),o.addEventListener("mouseenter",()=>{n(!0)}),Ca(t,o),Ft(o,At({get class(){return r(i.appearanceKey||"tooltipTrigger")}},a),!1,!0),Ie(o,()=>e.children),o})()},Dr={Root:NY,Trigger:BY,Content:FY},LY=Le("<span>"),$Y=Le("<img>"),jY=Le('<a><div><div class="nt-relative nt-shrink-0 nt-float-right nt-ml-1 nt-pr-1.5"><p></p><div></div></div><div>'),HY=e=>{const t=ft(),{t:n,locale:r}=go(),{navigate:i,status:a}=dr(),[o,s]=Me(0),l=He(()=>(o(),vK({fromDate:new Date(e.notification.createdAt),locale:r()})));cn(()=>{const d=setInterval(()=>{s(f=>f+1)},6e4);return()=>clearInterval(d)});const u=d=>{var f,h,m;d.stopPropagation(),d.preventDefault(),e.notification.isRead||e.notification.read(),(f=e.onNotificationClick)==null||f.call(e,e.notification),i((h=e.notification.redirect)==null?void 0:h.url,(m=e.notification.redirect)==null?void 0:m.target)},c=(d,f)=>{var h,m,p,y,v,b,_,T,C,x;f.stopPropagation(),d==="primary"?(e.notification.completePrimary(),(h=e.onPrimaryActionClick)==null||h.call(e,e.notification),i((p=(m=e.notification.primaryAction)==null?void 0:m.redirect)==null?void 0:p.url,(v=(y=e.notification.primaryAction)==null?void 0:y.redirect)==null?void 0:v.target)):(e.notification.completeSecondary(),(b=e.onSecondaryActionClick)==null||b.call(e,e.notification),i((T=(_=e.notification.secondaryAction)==null?void 0:_.redirect)==null?void 0:T.url,(x=(C=e.notification.secondaryAction)==null?void 0:C.redirect)==null?void 0:x.target))};return(()=>{var d=jY(),f=d.firstChild,h=f.firstChild,m=h.firstChild,p=m.nextSibling,y=h.nextSibling;return d.$$click=u,Ie(d,Z(Tt,{get when(){return!e.notification.isRead},get children(){var v=LY();return ct(()=>Ze(v,t("notificationDot","nt-absolute -nt-translate-x-[1.0625rem] nt-translate-y-1/2 nt-size-2.5 nt-bg-primary nt-rounded-full nt-border nt-border-neutral-alpha-200"))),v}}),f),Ie(d,Z(Tt,{get when(){return e.notification.avatar},get children(){var v=$Y();return ct(b=>{var _=t("notificationImage","nt-size-8 nt-rounded-lg"),T=e.notification.avatar;return _!==b.e&&Ze(v,b.e=_),T!==b.t&&er(v,"src",b.t=T),b},{e:void 0,t:void 0}),v}}),f),Ie(m,l),Ie(p,Z(Tt,{get when(){return a()!=="archived"},get children(){return Z(Tt,{get when(){return e.notification.isRead},get fallback(){return Z(Dr.Root,{get children(){return[Z(Dr.Trigger,{asChild:v=>Z(yr,At({appearanceKey:"notificationRead__button",size:"icon",variant:"icon"},v,{onClick:b=>{b.stopPropagation(),e.notification.read()},class:"hover:nt-bg-neutral-alpha-50 nt-p-0.5",get children(){return Z(b6,{})}}))}),Z(Dr.Content,{"data-localization":"notification.actions.read.tooltip",get children(){return n("notification.actions.read.tooltip")}})]}})},get children(){return Z(Dr.Root,{get children(){return[Z(Dr.Trigger,{asChild:v=>Z(yr,At({appearanceKey:"notificationUnread__button",size:"icon",variant:"icon"},v,{onClick:b=>{b.stopPropagation(),e.notification.unread()},class:"hover:nt-bg-neutral-alpha-50 nt-p-0.5",get children(){return Z(E6,{})}}))}),Z(Dr.Content,{"data-localization":"notification.actions.unread.tooltip",get children(){return n("notification.actions.unread.tooltip")}})]}})}})}}),null),Ie(p,Z(Tt,{get when(){return e.notification.isArchived},get fallback(){return Z(Dr.Root,{get children(){return[Z(Dr.Trigger,{asChild:v=>Z(yr,At({appearanceKey:"notificationArchive__button",size:"icon",variant:"icon"},v,{onClick:b=>{b.stopPropagation(),e.notification.archive()},class:"hover:nt-bg-neutral-alpha-50 nt-p-0.5",get children(){return Z(Zy,{})}}))}),Z(Dr.Content,{"data-localization":"notification.actions.archive.tooltip",get children(){return n("notification.actions.archive.tooltip")}})]}})},get children(){return Z(Dr.Root,{get children(){return[Z(Dr.Trigger,{asChild:v=>Z(yr,At({appearanceKey:"notificationUnarchive__button",size:"icon",variant:"icon"},v,{onClick:b=>{b.stopPropagation(),e.notification.unarchive()},class:"hover:nt-bg-neutral-alpha-50 nt-p-0.5",get children(){return Z(gG,{})}}))}),Z(Dr.Content,{"data-localization":"notification.actions.unarchive.tooltip",get children(){return n("notification.actions.unarchive.tooltip")}})]}})}}),null),Ie(f,Z(Tt,{get when(){return e.notification.subject},children:v=>Z(s4,{get class(){return t("notificationSubject","nt-text-start")},strongAppearanceKey:"notificationSubject__strong",get children(){return v()}})}),y),Ie(f,Z(s4,{get class(){return t("notificationBody","nt-text-start")},strongAppearanceKey:"notificationBody__strong",get children(){return e.notification.body}}),y),Ie(y,Z(Tt,{get when(){return e.notification.primaryAction},keyed:!0,children:v=>Z(yr,{appearanceKey:"notificationPrimaryAction__button",variant:"default",onClick:b=>c("primary",b),get children(){return v.label}})}),null),Ie(y,Z(Tt,{get when(){return e.notification.secondaryAction},keyed:!0,children:v=>Z(yr,{appearanceKey:"notificationSecondaryAction__button",variant:"secondary",onClick:b=>c("secondary",b),get children(){return v.label}})}),null),ct(v=>{var b,_=t("notification",Bn("nt-w-full nt-text-sm hover:nt-bg-neutral-alpha-50 nt-group nt-relative nt-flex nt-py-4 nt-px-6 nt-gap-2",{"nt-cursor-pointer":!e.notification.isRead||!!((b=e.notification.redirect)!=null&&b.url)})),T=t("notificationBody","nt-overflow-hidden nt-w-full"),C=t("notificationDate","nt-transition nt-duration-100 nt-ease-out nt-text-foreground-alpha-400 nt-shrink-0 nt-float-right nt-text-right group-hover:nt-opacity-0"),x=t("notificationDefaultActions","nt-transition nt-duration-100 nt-ease-out nt-gap-2 nt-flex nt-shrink-0 nt-opacity-0 group-hover:nt-opacity-100 nt-justify-center nt-items-center nt-absolute nt-top-0 nt-right-0 nt-bg-neutral-alpha-50 nt-rounded-lg nt-backdrop-blur-md nt-p-0.5"),w=t("notificationCustomActions","nt-flex nt-flex-wrap nt-gap-4 nt-mt-4");return _!==v.e&&Ze(d,v.e=_),T!==v.t&&Ze(f,v.t=T),C!==v.a&&Ze(m,v.a=C),x!==v.o&&Ze(p,v.o=x),w!==v.i&&Ze(y,v.i=w),v},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),d})()};zl(["click"]);var UY=e=>Z(Tt,{get when(){return e.renderNotification},get fallback(){return Z(HY,{get notification(){return e.notification},get onNotificationClick(){return e.onNotificationClick},get onPrimaryActionClick(){return e.onPrimaryActionClick},get onSecondaryActionClick(){return e.onSecondaryActionClick}})},get children(){return Z(g6,{render:t=>e.renderNotification(t,e.notification)})}}),zY=Le('<svg xmlns=http://www.w3.org/2000/svg width=48 height=48 viewBox="0 0 48 48"fill=none><path fill=currentColor d="M35.2 21.62L32.38 18.8L39.5 11.7L42.32 14.52C42.1 14.58 35.2 21.62 35.2 21.62ZM26 6H22V16H26V6ZM12.8 21.62L15.62 18.8L8.52 11.68L5.68 14.52C5.9 14.58 12.8 21.62 12.8 21.62ZM40 28H33.16C31.62 31.52 28.08 34 24 34C19.92 34 16.38 31.52 14.84 28H8V38H40V28ZM40 24C42.2 24 44 25.8 44 28V38C44 40.2 42.2 42 40 42H8C5.8 42 4 40.2 4 38V28C4 25.8 5.8 24 8 24H18C18 27.32 20.68 30 24 30C27.32 30 30 27.32 30 24H40Z">');function VY(e){return(()=>{var t=zY();return Ft(t,e,!0,!0),t})()}var qY=e=>{const t=He(()=>!!e.count),{t:n}=go();return Z(Tt,{get when(){return t()},get children(){return Z(yr,{appearanceKey:"notificationListNewNotificationsNotice__button",class:"nt-absolute nt-w-fit nt-top-0 nt-mx-auto nt-inset-2 nt-z-10 nt-rounded-full hover:nt-bg-primary-600 nt-animate-in nt-slide-in-from-top-2 nt-fade-in",get onClick(){return e.onClick},"data-localization":"notifications.newNotifications",get children(){return n("notifications.newNotifications",{notificationCount:e.count})}})}})},WY=Le('<div class="nt-flex nt-gap-2 nt-px-6 nt-py-4 nt-w-full"><div class="nt-flex nt-flex-col nt-self-stretch nt-gap-3 nt-flex-1"><div class="nt-flex nt-gap-1"></div><div class="nt-flex nt-gap-1">'),I6=()=>(()=>{var e=WY(),t=e.firstChild,n=t.firstChild,r=n.nextSibling;return Ie(e,Z(yY,{appearanceKey:"skeletonAvatar"}),t),Ie(t,Z(jo,{appearanceKey:"skeletonText",class:"nt-w-1/4"}),n),Ie(n,Z(jo,{appearanceKey:"skeletonText"}),null),Ie(n,Z(jo,{appearanceKey:"skeletonText"}),null),Ie(r,Z(jo,{appearanceKey:"skeletonText",class:"nt-w-2/3"}),null),Ie(r,Z(jo,{appearanceKey:"skeletonText",class:"nt-w-1/3"}),null),e})(),KY=e=>Z(Wi,{get each(){return Array.from({length:e.count})},children:()=>Z(I6,{})}),GY=Le("<div><p data-localization=notifications.emptyNotice>"),YY=Le("<div>"),ZY=Le("<div><div>"),QY=()=>{const e=ft(),{t}=go();return(()=>{var n=GY(),r=n.firstChild;return Ie(n,Z(VY,{get class(){return e("notificationListEmptyNoticeIcon")}}),r),Ie(r,()=>t("notifications.emptyNotice")),ct(i=>{var a=e("notificationListEmptyNoticeContainer","nt-absolute nt-inset-0 nt-flex nt-flex-col nt-items-center nt-m-auto nt-h-fit nt-w-full nt-text-foreground-alpha-100"),o=e("notificationListEmptyNotice");return a!==i.e&&Ze(n,i.e=a),o!==i.t&&Ze(r,i.t=o),i},{e:void 0,t:void 0}),n})()},P6=e=>{var t,n;const r=He(()=>an(Ye({},e.filter),{limit:e.limit})),i=ft(),{data:a,setEl:o,end:s,refetch:l,initialLoading:u}=XG({options:r}),{count:c,reset:d}=MK({filter:{tags:(n=(t=e.filter)==null?void 0:t.tags)!=null?n:[]}}),{setLimit:f}=dr(),h=He(()=>a().map(y=>y.id));let m;cn(()=>{f(e.limit||f6)});const p=y=>Ve(void 0,null,function*(){y.stopPropagation(),d(),l({filter:e.filter}),m.scrollTo({top:0})});return(()=>{var y=ZY(),v=y.firstChild;return Ie(y,Z(qY,{get count(){return c()},onClick:p}),v),Ca(b=>{m=b},v),Ie(v,Z(Tt,{get when(){return!u()},get fallback(){return Z(KY,{count:8})},get children(){return Z(Tt,{get when(){return a().length>0},get fallback(){return Z(QY,{})},get children(){return[Z(Wi,{get each(){return h()},children:(b,_)=>{const T=()=>a()[_()];return Z(UY,{get notification(){return T()},get renderNotification(){return e.renderNotification},get onNotificationClick(){return e.onNotificationClick},get onPrimaryActionClick(){return e.onPrimaryActionClick},get onSecondaryActionClick(){return e.onSecondaryActionClick}})}}),Z(Tt,{get when(){return!s()},get children(){var b=YY();return Ca(o,b),Ie(b,Z(Wi,{get each(){return Array.from({length:3})},children:()=>Z(I6,{})})),b}})]}})}})),ct(b=>{var _=i("notificationListContainer","nt-relative nt-h-full nt-overflow-hidden"),T=i("notificationList","nt-relative nt-h-full nt-flex nt-flex-col nt-overflow-y-auto");return _!==b.e&&Ze(y,b.e=_),T!==b.t&&Ze(v,b.t=T),b},{e:void 0,t:void 0}),y})()},t9=Le("<span>"),XY=e=>e>=100?"99+":e,n9=e=>{const t=ft(),n=He(()=>XY(e.count));return(()=>{var r=t9();return Ie(r,n),ct(()=>Ze(r,t("notificationsTabsTriggerCount","nt-rounded-full nt-bg-counter nt-px-[6px] nt-text-counter-foreground nt-text-sm"))),r})()},l4=e=>{const{status:t}=dr(),n=ft(),r=p6({filter:{tags:ba(e)}});return Z(Uu.Trigger,{get value(){return e.label},get class(){return n("notificationsTabs__tabsTrigger",Bn(S6(),"nt-flex nt-gap-2",e.class))},get children(){return[(()=>{var i=t9();return Ie(i,()=>e.label),ct(()=>Ze(i,n("notificationsTabsTriggerLabel","nt-text-sm nt-font-medium"))),i})(),Z(Tt,{get when(){return He(()=>t()!=="archived")()&&r()},get children(){return Z(n9,{get count(){return r()}})}})]}})},JY=e=>{const{status:t}=dr(),n=ft(),r=p6({filter:{tags:ba(e)}});return Z(Ur.Item,{get class(){return n("moreTabs__dropdownItem",Bn(zh(),"nt-flex nt-justify-between nt-gap-2"))},get children(){return[(()=>{var i=t9();return Ie(i,()=>e.label),ct(()=>Ze(i,n("moreTabs__dropdownItemLabel","nt-mr-auto"))),i})(),He(()=>e.rightIcon),Z(Tt,{get when(){return He(()=>t()!=="archived")()&&r()},get children(){return Z(n9,{get count(){return r()}})}})]}})},eZ=({tabs:e})=>{const[t,n]=Me(),[r,i]=Me([]),[a,o]=Me([]);return sr(()=>{const s=t();if(!s)return;const l=[...s.querySelectorAll('[role="tab"]')],u=new IntersectionObserver(c=>{let d=c.filter(f=>f.isIntersecting&&f.intersectionRatio===1).map(f=>f.target.id);if(l.length===d.length){i(e.filter(f=>d.includes(f.label))),u.disconnect();return}d=d.slice(0,-1),i(e.filter(f=>d.includes(f.label))),o(e.filter(f=>!d.includes(f.label))),u.disconnect()},{root:s});for(const c of l)u.observe(c)}),{dropdownTabs:a,setTabsList:n,visibleTabs:r}},tZ=()=>"nt-relative after:nt-absolute after:nt-content-[''] after:nt-bottom-0 after:nt-left-0 after:nt-w-full after:nt-h-[2px] after:nt-border-b-2 nt-pb-[0.625rem]",nZ=e=>{const t=ft(),{activeTab:n,status:r,setActiveTab:i,filter:a}=dr(),{dropdownTabs:o,setTabsList:s,visibleTabs:l}=eZ({tabs:e.tabs}),u=BK({filters:o().map(h=>({tags:ba(h)}))}),c=He(()=>o().map(h=>an(Ye({},h),{rightIcon:h.label===n()?Z(v6,{get class(){return t("moreTabs__dropdownItemRight__icon")}}):void 0}))),d=He(()=>u().reduce((h,m)=>h+m,0)),f=He(()=>o().map(h=>h.label).includes(n()));return Z(Uu.Root,{get class(){return t("notificationsTabs__tabsRoot",Bn(k6(),"nt-flex-1 nt-overflow-hidden"))},get value(){return n()},onChange:i,get children(){return[Z(Tt,{get when(){return l().length>0},get fallback(){return Z(Uu.List,{ref:s,appearanceKey:"notificationsTabs__tabsList",get children(){return e.tabs.map(h=>Z(l4,At(h,{class:"nt-invisible"})))}})},get children(){return Z(Uu.List,{appearanceKey:"notificationsTabs__tabsList",get children(){return[He(()=>l().map(h=>Z(l4,h))),Z(Tt,{get when(){return o().length>0},get children(){return Z(Ur.Root,{fallbackPlacements:["bottom","top"],placement:"bottom-start",get children(){return[Z(Ur.Trigger,{appearanceKey:"moreTabs__dropdownTrigger",asChild:h=>Z(yr,At({variant:"unstyled",size:"none",appearanceKey:"moreTabs__button"},h,{get class(){return Bn(tZ(),f()?"after:nt-border-b-primary":"after:nt-border-b-transparent nt-text-foreground-alpha-600")},get children(){return[Z(y6,{get class(){return t("moreTabs__dots")}}),Z(Tt,{get when(){return He(()=>r()!=="archived")()&&d()},get children(){return Z(n9,{get count(){return d()}})}})]}}))}),Z(Ur.Content,{appearanceKey:"moreTabs__dropdownContent",get children(){return Z(Wi,{get each(){return c()},children:h=>Z(JY,At({onClick:()=>i(h.label)},h))})}})]}})}})]}})}}),He(()=>e.tabs.map(h=>Z(Uu.Content,{get value(){return h.label},get class(){return t("notificationsTabs__tabsContent",Bn(n()===h.label?"nt-block":"nt-hidden","nt-flex-1 nt-overflow-hidden"))},get children(){return Z(P6,{get renderNotification(){return e.renderNotification},get onNotificationClick(){return e.onNotificationClick},get onPrimaryActionClick(){return e.onPrimaryActionClick},get onSecondaryActionClick(){return e.onSecondaryActionClick},get filter(){return an(Ye({},a()),{tags:ba(h)})}})}})))]}})},rZ=Le("<div>"),Ho=function(e){return e.Notifications="notifications",e.Preferences="preferences",e}({}),zd=e=>{const[t,n]=Me(e.initialPage||Ho.Notifications),{tabs:r,filter:i}=dr(),a=ft(),o=He(()=>s=>{if(!e.hideNav)return()=>{n(s)}});return(()=>{var s=rZ();return Ie(s,Z(TV,{get children(){return[Z(bE,{get when(){return t()===Ho.Notifications},get children(){return[Z(lY,{get navigateToPreferences(){return o()(Ho.Preferences)}}),Z(Tt,{keyed:!0,get when(){return He(()=>!!r())()&&r().length>0},get fallback(){return Z(P6,{get renderNotification(){return e.renderNotification},get onNotificationClick(){return e.onNotificationClick},get onPrimaryActionClick(){return e.onPrimaryActionClick},get onSecondaryActionClick(){return e.onSecondaryActionClick},get filter(){return i()}})},get children(){return Z(nZ,{get renderNotification(){return e.renderNotification},get onNotificationClick(){return e.onNotificationClick},get onPrimaryActionClick(){return e.onPrimaryActionClick},get onSecondaryActionClick(){return e.onSecondaryActionClick},get tabs(){return r()}})}})]}}),Z(bE,{get when(){return t()===Ho.Preferences},get children(){return[Z(dY,{get navigateToNotifications(){return o()(Ho.Notifications)}}),Z(xY,{})]}})]}}),null),Ie(s,Z(EG,{}),null),ct(()=>Ze(s,a("inboxContent","nt-h-full nt-flex nt-flex-col"))),s})()},iZ=e=>{const t=ft(),{isOpened:n,setIsOpened:r}=dr(),i=()=>{var a;return(a=e==null?void 0:e.open)!=null?a:n()};return Z(ro.Root,{get open(){return i()},onOpenChange:r,get children(){return[Z(ro.Trigger,{asChild:a=>Z(yr,At({get class(){return t("inbox__popoverTrigger")},variant:"ghost",size:"icon"},a,{get children(){return Z(_6,{get renderBell(){return e.renderBell}})}}))}),Z(ro.Content,{appearanceKey:"inbox__popoverContent",portal:!0,get children(){return Z(zd,{get renderNotification(){return e.renderNotification},get onNotificationClick(){return e.onNotificationClick},get onPrimaryActionClick(){return e.onPrimaryActionClick},get onSecondaryActionClick(){return e.onSecondaryActionClick}})}})]}})},aZ={Inbox:iZ,InboxContent:zd,Bell:_6,Notifications:e=>Z(zd,At(e,{hideNav:!0,get initialPage(){return Ho.Notifications}})),Preferences:e=>Z(zd,At(e,{hideNav:!0,get initialPage(){return Ho.Preferences}}))},oZ=e=>{const t=()=>[...e.nodes.keys()];return sr(()=>{const n="novu-default-css";if(document.getElementById(n))return;const i=document.createElement("link");i.id=n,i.rel="stylesheet",i.href=e.cssHref,document.head.insertBefore(i,document.head.firstChild),dn(()=>{const a=document.getElementById(n);a==null||a.remove()})}),Z(IK,{get options(){return e.options},get novu(){return e.novu},get children(){return Z(OK,{get localization(){return e.localization},get children(){return Z(kK,{get id(){return e.novuUI.id},get appearance(){return e.appearance},get children(){return Z(jK,{get children(){return Z(NK,{get tabs(){return e.tabs},get preferencesFilter(){return e.preferencesFilter},get routerPush(){return e.routerPush},get children(){return Z(RK,{get children(){return Z(Wi,{get each(){return t()},children:n=>{const r=()=>e.nodes.get(n);let i;const a=aZ[r().name];return sr(()=>{["Notifications","Preferences"].includes(r().name)&&(n instanceof HTMLElement&&n.classList.add("nt-h-full"),i.classList.add("nt-h-full"))}),Z(jy,{mount:n,ref:o=>{i=o},get children(){return Z(Xy,{get children(){return Z(a,At(()=>r().props))}})}})}})}})}})}})}})}})}})},sZ="2.6.0",lZ=`https://cdn.jsdelivr.net/npm/@novu/js@${sZ}/dist/index.css`,ll,qo,rc,Qs,Gf,Vd,Yf,qd,Zf,Wd,Qf,Kd,Xf,Gd,Jf,Yd,eh,Zd,R6,F6,uZ=class{constructor(t){Ge(this,Zd),Ge(this,ll,null),Ge(this,qo),Ge(this,rc),Ge(this,Qs),Ge(this,Gf),Ge(this,Vd),Ge(this,Yf),Ge(this,qd),Ge(this,Zf),Ge(this,Wd),Ge(this,Qf),Ge(this,Kd),Ge(this,Xf),Ge(this,Gd),Ge(this,Jf),Ge(this,Yd),Ge(this,eh);var n;this.id=s6(16);const[r,i]=Me(t.appearance),[a,o]=Me(t.localization),[s,l]=Me(t.options),[u,c]=Me(new Map),[d,f]=Me((n=t.tabs)!=null?n:[]),[h,m]=Me(t.preferencesFilter),[p,y]=Me(t.routerPush);Qe(this,rc,u),Qe(this,Qs,c),Qe(this,Gf,r),Qe(this,Vd,i),Qe(this,Yf,a),Qe(this,qd,o),Qe(this,Zf,s),Qe(this,Wd,l),Qe(this,Qf,d),Qe(this,Kd,f),Qe(this,Xf,p),Qe(this,Gd,y),Qe(this,eh,t.novu),Qe(this,Jf,h),Qe(this,Yd,m),Of(this,Zd,R6).call(this)}mountComponent({name:t,element:n,props:r}){if(oe(this,rc).call(this).has(n))return Of(this,Zd,F6).call(this,n,r);oe(this,Qs).call(this,i=>{const a=new Map(i);return a.set(n,{name:t,props:r}),a})}unmountComponent(t){oe(this,Qs).call(this,n=>{const r=new Map(n);return r.delete(t),r})}updateAppearance(t){oe(this,Vd).call(this,t)}updateLocalization(t){oe(this,qd).call(this,t)}updateOptions(t){oe(this,Wd).call(this,t)}updateTabs(t){oe(this,Kd).call(this,t??[])}updatePreferencesFilter(t){oe(this,Yd).call(this,t)}updateRouterPush(t){oe(this,Gd).call(this,()=>t)}unmount(){var t,n;(t=oe(this,ll))==null||t.call(this),Qe(this,ll,null),(n=oe(this,qo))==null||n.remove()}};ll=new WeakMap;qo=new WeakMap;rc=new WeakMap;Qs=new WeakMap;Gf=new WeakMap;Vd=new WeakMap;Yf=new WeakMap;qd=new WeakMap;Zf=new WeakMap;Wd=new WeakMap;Qf=new WeakMap;Kd=new WeakMap;Xf=new WeakMap;Gd=new WeakMap;Jf=new WeakMap;Yd=new WeakMap;eh=new WeakMap;Zd=new WeakSet;R6=function(){if(oe(this,ll)!==null)return;Qe(this,qo,document.createElement("div")),oe(this,qo).setAttribute("id",`novu-ui-${this.id}`),document.body.appendChild(oe(this,qo));const e=PV(()=>{const t=this;return Z(oZ,{cssHref:lZ,novuUI:t,get nodes(){var n;return oe(n=t,rc).call(n)},get options(){var n;return oe(n=t,Zf).call(n)},get appearance(){var n;return oe(n=t,Gf).call(n)},get localization(){var n;return oe(n=t,Yf).call(n)},get tabs(){var n;return oe(n=t,Qf).call(n)},get preferencesFilter(){var n;return oe(n=t,Jf).call(n)},get routerPush(){var n;return oe(n=t,Xf).call(n)},get novu(){return oe(t,eh)}})},oe(this,qo));Qe(this,ll,e)};F6=function(e,t){oe(this,Qs).call(this,n=>{const r=new Map(n),i=r.get(e);return i&&r.set(e,an(Ye({},i),{props:t})),r})};function Vh({mount:e}){const t=E.useRef(null);return E.useEffect(()=>{let n;const r=t.current;if(r&&e){const i=e(r);i&&(n=i)}return()=>{r&&n&&n(r)}},[t,e]),g.jsx("div",{ref:t})}function cZ(e,t){if(!e)throw typeof t=="string"?new Error(t):new Error(`${t.displayName} not found`)}var M6=(e,t)=>{const{assertCtxFn:n=cZ}=t||{},r=E.createContext(void 0);return r.displayName=e,[r,()=>{const o=E.useContext(r);return n(o,`Component must be wrapped with ${r.displayName}`),o.value},()=>{const o=E.useContext(r);return o?o.value:{}}]},[dZ,qh,Vve]=M6("RendererContext"),fZ=e=>g.jsx(dZ.Provider,{value:{value:e.value},children:e.children}),hZ=e=>{const{children:t}=e,[n,r]=E.useState(new Map),i=E.useCallback((a,o)=>(r(s=>{const l=new Map(s);return l.set(a,o),l}),()=>{r(s=>{const l=new Map(s);return l.delete(a),l})}),[r]);return g.jsxs(fZ,{value:{mountElement:i},children:[[...n].map(([a,o])=>ph.createPortal(o,a)),t]})},Wh=e=>{const t=n=>g.jsx(hZ,{children:g.jsx(e,{...n})});return t.displayName=`WithRenderer(${e.displayName||e.name||"Component"})`,t},[pZ,Kh,qve]=M6("NovuUIContext"),mZ=e=>g.jsx(pZ.Provider,{value:{value:e.value},children:e.children}),gZ=E.memo(e=>{const{renderBell:t}=e,{novuUI:n}=Kh(),{mountElement:r}=qh(),i=E.useCallback(a=>n.mountComponent({name:"Bell",element:a,props:t?{renderBell:(o,s)=>r(o,t(s))}:void 0}),[t]);return g.jsx(Vh,{mount:i})});Wh(gZ);var vZ="2.6.0",yZ="@novu/react",bZ=`${yZ}@${vZ}`,r9=E.createContext(void 0),EZ=({children:e,applicationIdentifier:t,subscriberId:n,subscriberHash:r,backendUrl:i,socketUrl:a,useCache:o,userAgentType:s})=>{const l=E.useMemo(()=>new u7({applicationIdentifier:t,subscriberId:n,subscriberHash:r,backendUrl:i,socketUrl:a,useCache:o,__userAgent:`${bZ} ${s}`}),[t,n,r,i,a,o,s]);return g.jsx(r9.Provider,{value:l,children:e})},_Z=()=>{const e=E.useContext(r9);if(!e)throw new Error("useNovu must be used within a <NovuProvider />");return e},TZ=()=>E.useContext(r9),CZ=e=>{const t=E.useRef(e);return t.current=e,t},u4=({options:e,novu:t,children:n})=>{const r=CZ({...e,novu:t}),[i,a]=E.useState();return E.useEffect(()=>{const o=new uZ(r.current);return a(o),()=>{o.unmount()}},[]),E.useEffect(()=>{i&&(i.updateAppearance(e.appearance),i.updateLocalization(e.localization),i.updateTabs(e.tabs),i.updateOptions(e.options),i.updateRouterPush(e.routerPush))},[e]),i?g.jsx(mZ,{value:{novuUI:i},children:n}):null},xZ=e=>{const{open:t,renderNotification:n,renderBell:r,onNotificationClick:i,onPrimaryActionClick:a,onSecondaryActionClick:o}=e,{novuUI:s}=Kh(),{mountElement:l}=qh(),u=E.useCallback(c=>s.mountComponent({name:"Inbox",props:{open:t,renderNotification:n?(d,f)=>l(d,n(f)):void 0,renderBell:r?(d,f)=>l(d,r(f)):void 0,onNotificationClick:i,onPrimaryActionClick:a,onSecondaryActionClick:o},element:c}),[t,n,r,i,a,o]);return g.jsx(Vh,{mount:u})},wZ=Wh(xZ),AZ=E.memo(e=>{const{applicationIdentifier:t,subscriberId:n,subscriberHash:r,backendUrl:i,socketUrl:a}=e;return TZ()?g.jsx(c4,{...e}):g.jsx(EZ,{applicationIdentifier:t,subscriberId:n,subscriberHash:r,backendUrl:i,socketUrl:a,userAgentType:"components",children:g.jsx(c4,{...e})})}),c4=E.memo(e=>{const{localization:t,appearance:n,tabs:r,preferencesFilter:i,routerPush:a,applicationIdentifier:o,subscriberId:s,subscriberHash:l,backendUrl:u,socketUrl:c}=e,d=_Z(),f=E.useMemo(()=>({localization:t,appearance:n,tabs:r,preferencesFilter:i,routerPush:a,options:{applicationIdentifier:o,subscriberId:s,subscriberHash:l,backendUrl:u,socketUrl:c}}),[t,n,r,i,o,s,l,u,c]);if(kZ(e))return g.jsx(u4,{options:f,novu:d,children:e.children});const{open:h,renderNotification:m,renderBell:p,onNotificationClick:y,onPrimaryActionClick:v,onSecondaryActionClick:b}=e;return g.jsx(u4,{options:f,novu:d,children:g.jsx(wZ,{open:h,renderNotification:m,renderBell:p,onNotificationClick:y,onPrimaryActionClick:v,onSecondaryActionClick:b})})});function kZ(e){return"children"in e}var SZ=E.memo(e=>{const{onNotificationClick:t,onPrimaryActionClick:n,renderNotification:r,onSecondaryActionClick:i}=e,{novuUI:a}=Kh(),{mountElement:o}=qh(),s=E.useCallback(l=>a.mountComponent({name:"Notifications",element:l,props:{renderNotification:r?(u,c)=>o(u,r(c)):void 0,onNotificationClick:t,onPrimaryActionClick:n,onSecondaryActionClick:i}}),[r,t,n,i]);return g.jsx(Vh,{mount:s})});Wh(SZ);var DZ=E.memo(e=>{const{onNotificationClick:t,onPrimaryActionClick:n,renderNotification:r,onSecondaryActionClick:i,initialPage:a,hideNav:o}=e,{novuUI:s}=Kh(),{mountElement:l}=qh(),u=E.useCallback(c=>s.mountComponent({name:"InboxContent",element:c,props:{renderNotification:r?(d,f)=>l(d,r(f)):void 0,onNotificationClick:t,onPrimaryActionClick:n,onSecondaryActionClick:i,initialPage:a,hideNav:o}}),[r,t,n,i]);return g.jsx(Vh,{mount:u})});Wh(DZ);const Gh=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),Lr=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())(),OZ="arraybuffer";function B6(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const NZ=Lr.setTimeout,IZ=Lr.clearTimeout;function Yh(e,t){t.useNativeTimers?(e.setTimeoutFn=NZ.bind(Lr),e.clearTimeoutFn=IZ.bind(Lr)):(e.setTimeoutFn=Lr.setTimeout.bind(Lr),e.clearTimeoutFn=Lr.clearTimeout.bind(Lr))}const PZ=1.33;function RZ(e){return typeof e=="string"?FZ(e):Math.ceil((e.byteLength||e.size)*PZ)}function FZ(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function L6(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function MZ(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function BZ(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let a=n[r].split("=");t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}class LZ extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class i9 extends Jt{constructor(t){super(),this.writable=!1,Yh(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new LZ(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Oh(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=MZ(t);return n.length?"?"+n:""}}class $Z extends i9{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Vw(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,zw(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=L6()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let $6=!1;try{$6=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const jZ=$6;function HZ(){}class UZ extends $Z{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,a)=>{this.onError("xhr post error",i,a)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Bi extends Jt{constructor(t,n,r){super(),this.createRequest=t,Yh(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=B6(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=Bi.requestsCount++,Bi.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=HZ,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Bi.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Bi.requestsCount=0;Bi.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",d4);else if(typeof addEventListener=="function"){const e="onpagehide"in Lr?"pagehide":"unload";addEventListener(e,d4,!1)}}function d4(){for(let e in Bi.requests)Bi.requests.hasOwnProperty(e)&&Bi.requests[e].abort()}const zZ=function(){const e=j6({xdomain:!1});return e&&e.responseType!==null}();class VZ extends UZ{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=zZ&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Bi(j6,this.uri(),t)}}function j6(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||jZ))return new XMLHttpRequest}catch{}if(!t)try{return new Lr[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const H6=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class qZ extends i9{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=H6?{}:B6(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;Dh(r,this.supportsBinary,a=>{try{this.doWrite(r,a)}catch{}i&&Gh(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=L6()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const jm=Lr.WebSocket||Lr.MozWebSocket;class WZ extends qZ{createSocket(t,n,r){return H6?new jm(t,n,r):n?new jm(t,n):new jm(t)}doWrite(t,n){this.ws.send(n)}}class KZ extends i9{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=Ww(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=qw();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const a=()=>{r.read().then(({done:s,value:l})=>{s||(this.onPacket(l),a())}).catch(s=>{})};a();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&Gh(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const GZ={websocket:WZ,webtransport:KZ,polling:VZ},YZ=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,ZZ=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function tv(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=YZ.exec(e||""),a={},o=14;for(;o--;)a[ZZ[o]]=i[o]||"";return n!=-1&&r!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=QZ(a,a.path),a.queryKey=XZ(a,a.query),a}function QZ(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function XZ(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,a){i&&(n[i]=a)}),n}const nv=typeof addEventListener=="function"&&typeof removeEventListener=="function",Qd=[];nv&&addEventListener("offline",()=>{Qd.forEach(e=>e())},!1);class io extends Jt{constructor(t,n){if(super(),this.binaryType=OZ,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=tv(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=tv(n.host).host);Yh(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=BZ(this.opts.query)),nv&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Qd.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Nh,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&io.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",io.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=RZ(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Gh(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const a={type:t,data:n,options:r};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(io.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),nv&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Qd.indexOf(this._offlineEventListener);r!==-1&&Qd.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}io.protocol=Nh;class JZ extends io{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;io.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;io.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(c(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function a(){r||(r=!0,c(),n.close(),n=null)}const o=d=>{const f=new Error("probe error: "+d);f.transport=n.name,a(),this.emitReserved("upgradeError",f)};function s(){o("transport closed")}function l(){o("socket closed")}function u(d){n&&d.name!==n.name&&a()}const c=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",o),n.once("close",s),this.once("close",l),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let eQ=class extends JZ{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>GZ[i]).filter(i=>!!i)),super(t,r)}};function tQ(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=tv(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const a=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port+t,r.href=r.protocol+"://"+a+(n&&n.port===r.port?"":":"+r.port),r}function li(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const nQ=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class U6 extends Jt{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[li(t,"open",this.onopen.bind(this)),li(t,"packet",this.onpacket.bind(this)),li(t,"error",this.onerror.bind(this)),li(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,i,a;if(nQ.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:et.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const c=this.ids++,d=n.pop();this._registerAckCallback(c,d),o.id=c}const s=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!s||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let s=0;s<this.sendBuffer.length;s++)this.sendBuffer[s].id===t&&this.sendBuffer.splice(s,1);n.call(this,new Error("operation has timed out"))},i),o=(...s)=>{this.io.clearTimeoutFn(a),n.apply(this,s)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((r,i)=>{const a=(o,s)=>o?i(o):r(s);a.withError=!0,n.push(a),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...a)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...a)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:et.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case et.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case et.EVENT:case et.BINARY_EVENT:this.onevent(t);break;case et.ACK:case et.BINARY_ACK:this.onack(t);break;case et.DISCONNECT:this.ondisconnect();break;case et.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:et.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:et.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Wl(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Wl.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Wl.prototype.reset=function(){this.attempts=0};Wl.prototype.setMin=function(e){this.ms=e};Wl.prototype.setMax=function(e){this.max=e};Wl.prototype.setJitter=function(e){this.jitter=e};class rv extends Jt{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Yh(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Wl({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||e7;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new eQ(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=li(n,"open",function(){r.onopen(),t&&t()}),a=s=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",s),t?t(s):this.maybeReconnectOnOpen()},o=li(n,"error",a);if(this._timeout!==!1){const s=this._timeout,l=this.setTimeoutFn(()=>{i(),a(new Error("timeout")),n.close()},s);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(li(t,"ping",this.onping.bind(this)),li(t,"data",this.ondata.bind(this)),li(t,"error",this.onerror.bind(this)),li(t,"close",this.onclose.bind(this)),li(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Gh(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new U6(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const hu={};function Xd(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=tQ(e,t.path||"/socket.io"),r=n.source,i=n.id,a=n.path,o=hu[i]&&a in hu[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return s?l=new rv(r,t):(hu[i]||(hu[i]=new rv(r,t)),l=hu[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Xd,{Manager:rv,Socket:U6,io:Xd,connect:Xd});const f4=e=>{let t;const n=new Set,r=(c,d)=>{const f=typeof c=="function"?c(t):c;if(!Object.is(f,t)){const h=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(m=>m(t,h))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{n.clear()}},u=t=e(r,i,l);return l},z6=e=>e?f4(e):f4;function br(){return br=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},br.apply(this,arguments)}class rQ extends Error{constructor(t){super(t),this.name=void 0,this.name="SuprSendError"}}function Wo(){return Math.round(Date.now())}function Ao(){var e=new Date().getTime(),t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var r=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(n=="x"?r:r&3|8).toString(16)});return t}const zn=z6()(()=>({apiUrl:"https://inboxs.live",collectorApiUrl:"https://hub.suprsend.com",socketUrl:"https://betainbox.suprsend.com",pageSize:20})),iQ={unseenCount:0,stores:{},activeStoreId:null,pageNumber:1,hasNext:!0,initialLoading:!1,fetchMoreLoading:!1,initialFetchTime:null},_t=z6()(()=>iQ);class aQ{constructor(t){this.socket=void 0,this.config=void 0,this.config=t;const n=zn.getState();this.socket=Xd(n.socketUrl,{transports:["websocket"],auth:{subscriber_id:this.config.subscriberId,distinct_id:this.config.distinctId,authorization:`${this.config.workspaceKey}:${Ao()}`,tenant_id:this.config.tenantId},reconnectionAttempts:25,reconnectionDelay:5e3,reconnectionDelayMax:1e4}),this._initializeSocketEvents()}orderNotifications(t,n){if(t.is_pinned)return[t,...n];{let r=!1,i=[];return n.forEach(a=>{a.is_pinned||r?i.push(a):(i.push(t),i.push(a),r=!0)}),r?i:[...n,t]}}_initializeSocketEvents(){var t=this;this.socket.on("new_notification",async function(n){n.n_id&&setTimeout(async function(){try{const i=await(await t.getNotificationDetails(n.n_id)).json(),a=_t.getState();if(t.config.stores){let o=!1;for(let s of t.config.stores){const l=a.stores[s.storeId];t._notificationBelongToStore(i.data,s)&&(o=!0,l.notifications=t.orderNotifications(i.data,l.notifications),l.unseenCount+=1)}o&&(a.unseenCount+=1,t.config.emitter.emit("new_notification",i.data)),_t.setState({unseenCount:a.unseenCount,stores:br({},a.stores)})}else{if(!a.activeStoreId)return;let o=a.stores[a.activeStoreId];a.unseenCount+=1,o.unseenCount+=1,o.notifications=t.orderNotifications(i.data,o.notifications),_t.setState({unseenCount:a.unseenCount,stores:br({},a.stores)}),t.config.emitter.emit("new_notification",i.data)}t.config.emitter.emit("sync_notif_store")}catch(r){console.log("SuprSend: error in new_notification event",r)}},1e3)}),this.socket.on("notification_updated",async function(n){n.n_id&&setTimeout(async function(){try{const a=await Promise.allSettled([t.getNotificationDetails(n.n_id),t.getNotificationsCount()]),o=_t.getState();let s=o.activeStoreId;if(a[0].status==="fulfilled"){var r;const u=await a[0].value.json(),c=u.data;if(!s)return;let d=o.stores[s];const f=(r=t.config.stores)==null?void 0:r.find(h=>h.storeId===s);if((n==null?void 0:n.type)==="archive"){var i;f!=null&&(i=f.query)!=null&&i.archived?t._notificationBelongToStore(c,f)&&(o.stores[s].notifications=[c,...d.notifications]):o.stores[s].notifications=d.notifications.filter(h=>h.n_id!==n.n_id)}else o.stores[s].notifications=d.notifications.map(h=>h.n_id===n.n_id?u.data:h);_t.setState({stores:br({},o.stores)})}if(a[1].status==="fulfilled"){const u=await a[1].value.json();_t.setState(c=>{for(let d in c.stores){const f=c.stores[d];f.unseenCount=u[d]||0}return{unseenCount:u.ss_bell_count,stores:br({},c.stores)}})}t.config.emitter.emit("sync_notif_store")}catch(a){console.log("SuprSend: error in notification_updated event",a)}},1e3)}),this.socket.on("update_badge",async function(){_t.setState({unseenCount:0}),t.config.emitter.emit("sync_notif_store")}),this.socket.on("mark_all_read",async function(){const n=_t.getState(),r=Wo();for(let i in n.stores){const a=n.stores[i];a.notifications.forEach(o=>{o.seen_on||(o.seen_on=r)}),a.unseenCount=0}_t.setState({stores:n.stores}),t.config.emitter.emit("sync_notif_store")})}_notificationBelongToStore(t,n){var r,i,a,o;const s=!!t.seen_on,l=t.archived,u=t.tags,c=t.n_category,d=n==null||(r=n.query)==null?void 0:r.read,f=n==null||(i=n.query)==null?void 0:i.archived,h=n==null||(a=n.query)==null?void 0:a.tags,m=n==null||(o=n.query)==null?void 0:o.categories,p=!d||s===d,y=!f||l===f;let v,b;return Array.isArray(h)&&h.length>0?h.forEach(_=>{u!=null&&u.includes(_)&&(v=!0)}):v=!0,Array.isArray(m)&&m.length>0?m.includes(c)&&(b=!0):b=!0,p&&v&&b&&y}_getStoreQueryString(t){const n=t==null?void 0:t.query;let r=(n==null?void 0:n.tags)||[],i=(n==null?void 0:n.categories)||[];const a=n==null?void 0:n.read,o=n==null?void 0:n.archived;return{store_id:t.storeId,query:{read:a,archived:o,tags:{or:r},categories:{or:i}}}}_getStoresQueryString(){const t=this.config.stores;return t==null?void 0:t.map(r=>this._getStoreQueryString(r))}getNotificationsCount(){const{apiUrl:t}=zn.getState();let n=`/notification_count/?subscriber_id=${this.config.subscriberId}&distinct_id=${this.config.distinctId}&tenant_id=${this.config.tenantId}`;if(this.config.stores){const r=this._getStoresQueryString();n+=`&stores=${encodeURIComponent(JSON.stringify(r))}`}return fetch(`${t}${n}`,{method:"GET",headers:{Authorization:`${this.config.workspaceKey}:${Ao()}`}})}getNotifications(t,n,r=20,i){const{apiUrl:a}=zn.getState();let o=`/notifications/?subscriber_id=${this.config.subscriberId}&distinct_id=${this.config.distinctId}&tenant_id=${this.config.tenantId}&page_no=${n}&page_size=${r}&before=${i}`;if(t){const s=this._getStoreQueryString(t);o+=`&store=${encodeURIComponent(JSON.stringify(s))}`}return fetch(`${a}${o}`,{method:"GET",headers:{Authorization:`${this.config.workspaceKey}:${Ao()}`}})}getNotificationDetails(t){const{apiUrl:n}=zn.getState(),r=`/notification/${t}/?subscriber_id=${this.config.subscriberId}&distinct_id=${this.config.distinctId}&tenant_id=${this.config.tenantId}`;return fetch(`${n}${r}`,{method:"GET",headers:{Authorization:`${this.config.workspaceKey}:${Ao()}`}})}markBellClicked(){const{apiUrl:t}=zn.getState(),n="/bell-clicked/",r=JSON.stringify({time:Wo(),distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId,tenant_id:this.config.tenantId});return fetch(`${t}${n}`,{method:"POST",body:r,headers:{Authorization:`${this.config.workspaceKey}:${Ao()}`,"Content-Type":"application/json"}})}markAllRead(){const{apiUrl:t}=zn.getState(),n="/mark-all-read/",r=JSON.stringify({time:Wo(),distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId,tenant_id:this.config.tenantId});return fetch(`${t}${n}`,{method:"POST",body:r,headers:{Authorization:`${this.config.workspaceKey}:${Ao()}`,"Content-Type":"application/json"}})}markNotificationClicked(t){const{collectorApiUrl:n}=zn.getState(),r={event:"$notification_clicked",env:this.config.workspaceKey,$insert_id:Ao(),$time:Wo(),properties:{id:t}};return fetch(`${n}/event/`,{method:"POST",body:JSON.stringify(r),headers:{Authorization:`${this.config.workspaceKey}:`,"Content-Type":"application/json"}})}markNotificationRead(t){const{apiUrl:n}=zn.getState();return fetch(`${n}/notification/${t}/action`,{method:"POST",body:JSON.stringify({action:"read",distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId}),headers:{Authorization:`${this.config.workspaceKey}:`,"Content-Type":"application/json"}})}markNotificationUnRead(t){const{apiUrl:n}=zn.getState();return fetch(`${n}/notification/${t}/action`,{method:"POST",body:JSON.stringify({action:"unread",distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId}),headers:{Authorization:`${this.config.workspaceKey}:`,"Content-Type":"application/json"}})}markNotificationArchive(t){const{apiUrl:n}=zn.getState();return fetch(`${n}/notification/${t}/action`,{method:"POST",body:JSON.stringify({action:"archive",distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId}),headers:{Authorization:`${this.config.workspaceKey}:`,"Content-Type":"application/json"}})}}let h4=class{constructor(t){this.config=void 0,this.config=t}_overallFirstApiCall(){const t=_t.getState();for(let n in t.stores)if(t.stores[n].isFirstCall===!1)return!1;return!0}async fetchNotifications(){var t,n;const r=this.config.client,i=_t.getState(),a=zn.getState(),o=i.activeStoreId;if(!o||!((t=i.stores)!=null&&t[o]))return;const s=i.stores[o],l=s.isFirstCall,u=i.initialFetchTime||Date.now(),c=(n=this.config.stores)==null?void 0:n.find(d=>d.storeId===o);try{if(!r||!i.hasNext)return;l?(_t.setState({initialLoading:!0}),this._overallFirstApiCall()&&this.getNotificationsCount()):i.pageNumber>1&&_t.setState({fetchMoreLoading:!0}),this.config.emitter.emit("sync_notif_store");const f=await(await r.getNotifications(c,i.pageNumber,a.pageSize,u)).json();let h;l||!l&&i.pageNumber===1?h=f.results:h=[...s.notifications,...f.results],i.stores[o].notifications=h,i.stores[o].isFirstCall=!1,_t.setState({stores:i.stores,pageNumber:i.pageNumber+1,hasNext:f.meta.current_page<f.meta.total_pages,initialFetchTime:u,initialLoading:!1,fetchMoreLoading:!1}),this.config.emitter.emit("sync_notif_store"),this.config._startExipryCheck()}catch(d){console.log("SUPRSEND: error getting latest notifications",d),_t.setState({initialLoading:!1,fetchMoreLoading:!1}),this.config.emitter.emit("sync_notif_store")}}async getNotificationsCount(){const t=this.config.client;if(t)try{const r=await(await t.getNotificationsCount()).json();_t.setState(i=>{for(let a in i.stores){const o=i.stores[a];o.unseenCount=r[a]||0}return{unseenCount:r.ss_bell_count,stores:br({},i.stores)}}),this.config.emitter.emit("sync_notif_store")}catch(n){console.log("SUPRSEND: error getting notifications count",n)}}async markClicked(t){var n;const r=this.config.client,i=_t.getState(),a=i.activeStoreId;if(!a||!((n=i.stores)!=null&&n[a]))return;const l=i.stores[a].notifications.find(c=>c.n_id===t);if(l&&(!l.interacted_on||!l.seen_on)){if(!r)return;try{l.interacted_on?l.seen_on||r.markNotificationRead(t):r.markNotificationClicked(t);const c=Wo();if(l.interacted_on=c,!l.seen_on)for(let d in i==null?void 0:i.stores){var u;const f=i.stores[d];(u=f.notifications)==null||u.forEach(h=>{h.n_id===l.n_id&&(h.seen_on=c,h.interacted_on=c,f.unseenCount>0&&(f.unseenCount-=1))})}_t.setState(br({},i)),this.config.emitter.emit("sync_notif_store")}catch(c){console.log("SUPRSEND: error marking notification clicked",c)}}}async markAllSeen(){const t=this.config.client;try{if(!t)return;t.markBellClicked(),_t.setState({unseenCount:0}),this.config.emitter.emit("sync_notif_store")}catch(n){console.log("SUPRSEND: error marking all notifications seen",n)}}async markAllRead(){const t=this.config.client;try{if(!t)return;t.markAllRead();const n=_t.getState(),r=Wo();for(let i in n.stores){const a=n.stores[i];a.notifications.forEach(o=>{o.seen_on||(o.seen_on=r)}),a.unseenCount=0}_t.setState({stores:n.stores}),this.config.emitter.emit("sync_notif_store")}catch(n){console.log("SUPRSEND: error marking all notifications read",n)}}async markRead(t){var n;const r=this.config.client,i=_t.getState(),a=i.activeStoreId;if(!a||!((n=i.stores)!=null&&n[a]))return;const l=i.stores[a].notifications.find(c=>c.n_id===t);if(l&&!l.seen_on){if(!r)return;try{r.markNotificationRead(t);const c=Wo();if(!l.seen_on)for(let d in i==null?void 0:i.stores){var u;const f=i.stores[d];(u=f.notifications)==null||u.forEach(h=>{h.n_id===l.n_id&&(h.seen_on=c,f.unseenCount>0&&(f.unseenCount-=1))})}_t.setState(br({},i)),this.config.emitter.emit("sync_notif_store")}catch(c){console.log("SUPRSEND: error marking notification read",c)}}}async markUnRead(t){var n;const r=this.config.client,i=_t.getState(),a=i.activeStoreId;if(!a||!((n=i.stores)!=null&&n[a]))return;const l=i.stores[a].notifications.find(c=>c.n_id===t);if(l&&l.seen_on){if(!r)return;try{if(r.markNotificationUnRead(t),l.seen_on)for(let c in i==null?void 0:i.stores){var u;const d=i.stores[c];(u=d.notifications)==null||u.forEach(f=>{f.n_id===l.n_id&&(f.seen_on=void 0,d.unseenCount>=0&&(d.unseenCount+=1))})}_t.setState(br({},i)),this.config.emitter.emit("sync_notif_store")}catch(c){console.log("SUPRSEND: error marking notification read",c)}}}markArchived(t){var n;const r=this.config.client,i=_t.getState(),a=i.activeStoreId;if(!a||!((n=i.stores)!=null&&n[a]))return;const s=(i==null?void 0:i.stores)[a],l=s.notifications.find(u=>u.n_id===t);if(l&&!l.archived){if(!r)return;try{r.markNotificationArchive(t),s.notifications=s.notifications.filter(u=>u.n_id!==t),!l.seen_on&&s.unseenCount>0&&(s.unseenCount-=1),_t.setState(br({},i)),this.config.emitter.emit("sync_notif_store")}catch(u){console.log("SUPRSEND: error marking notification archived",u)}}}get stores(){return this.config.stores}get data(){const t=_t.getState(),n=t.activeStoreId,r=this.stores;if(n)return{unseenCount:t.unseenCount,activeStoreId:t.activeStoreId,stores:t.stores,hasStores:r?(r==null?void 0:r.length)>0:!1,hasNext:t.hasNext,initialLoading:t.initialLoading,fetchMoreLoading:t.fetchMoreLoading}}};class oQ{constructor(t,n){this.workspaceKey="",this.tenantId=void 0,this.stores=void 0,this.distinctId=void 0,this.subscriberId=void 0,this._client=void 0,this._expiryTimerId=void 0,this.feed=new h4(this),this.emitter=Bw(),this._validateConfig(t),this._setConfigStoreState((n==null?void 0:n.host)||{}),this.tenantId=(n==null?void 0:n.tenantID)||"default",this._validateStore(n==null?void 0:n.stores),this._validatePageSize(n==null?void 0:n.pageSize),this._initializeStoreState()}_validateConfig(t){if(t)this.workspaceKey=t;else throw new rQ("workspaceKey missing")}_validateStore(t){if(!t||!Array.isArray(t))return;const n=[];t.forEach(r=>{if(!r.storeId){console.log("SuprSendInbox: storeId is mandatory if stores are used");return}const i=r==null?void 0:r.query;let a,o=[],s=[],l;typeof(i==null?void 0:i.read)=="boolean"&&(a=i.read),typeof(i==null?void 0:i.archived)=="boolean"&&(l=i.archived),typeof(i==null?void 0:i.tags)=="string"?o=[i.tags]:Array.isArray(i==null?void 0:i.tags)&&(o=i==null?void 0:i.tags.filter(u=>typeof u=="string")),typeof(i==null?void 0:i.categories)=="string"?s=[i.categories]:Array.isArray(i==null?void 0:i.categories)&&(s=i==null?void 0:i.categories.filter(u=>typeof u=="string")),n.push({storeId:r.storeId,label:r.label||r.storeId,query:{archived:l,read:a,tags:o,categories:s}})}),this.stores=n}_validatePageSize(t){if(t&&typeof t=="number"){const r=t<=50?t:50;zn.setState({pageSize:r})}}_setConfigStoreState(t){t&&(t!=null&&t.socketHost&&zn.setState({socketUrl:t.socketHost}),t!=null&&t.apiHost&&zn.setState({apiUrl:t.apiHost}),t!=null&&t.collectorHost&&zn.setState({collectorApiUrl:t.collectorHost}))}_initializeStoreState(){const t="default_store",n={notifications:[],unseenCount:0,isFirstCall:!0};if(this.stores&&Array.isArray(this.stores)&&this.stores.length>0){const r={};this.stores.map(i=>{r[i.storeId]=br({},n)}),_t.setState({stores:r,activeStoreId:this.stores[0].storeId})}else _t.setState({stores:{[t]:br({},n)},activeStoreId:t});setTimeout(()=>{this.emitter.emit("sync_notif_store")},0)}_startExipryCheck(){var t=this;this._expiryTimerId||(this._expiryTimerId=setInterval(async function(){const r=_t.getState().stores;let i=!1;for(let a in r){let o=r[a].notifications;o=o.filter(s=>(s.expiry?Date.now()>s.expiry:!1)?(i=!0,!1):!0),r[a].notifications=o}i&&(_t.setState({stores:r}),await t.feed.getNotificationsCount(),t.emitter.emit("sync_notif_store"))},3e4))}get client(){return this.distinctId&&this.subscriberId&&(this._client||(this._client=new aQ(this))),this._client}identifyUser(t,n){this.distinctId=t,this.subscriberId=n}changeActiveStore(t){var n;const r=_t.getState(),i={};if(r.activeStoreId!==t&&(n=r.stores)!=null&&n[t]){for(let a in r.stores){const o=r.stores[a],s=o.notifications.slice(0,20);i[a]={notifications:s,unseenCount:o.unseenCount,isFirstCall:o.isFirstCall}}_t.setState({activeStoreId:t,stores:i,pageNumber:1,hasNext:!0,initialLoading:!1,fetchMoreLoading:!1,initialFetchTime:null}),this.client&&this.feed.fetchNotifications()}}resetUser(){var t;_t.setState({unseenCount:0,pageNumber:1,hasNext:!0,initialLoading:!1,fetchMoreLoading:!1,initialFetchTime:null}),this._initializeStoreState(),(t=this._client)==null||t.socket.disconnect(),this.distinctId=void 0,this.subscriberId=void 0,this._client=void 0,clearInterval(this._expiryTimerId),this._expiryTimerId=void 0,this.feed=new h4(this)}}var p4=function(t){return t.reduce(function(n,r){var i=r[0],a=r[1];return n[i]=a,n},{})},m4=typeof window<"u"&&window.document&&window.document.createElement?Nn.useLayoutEffect:Nn.useEffect,rr="top",Wr="bottom",Kr="right",ir="left",a9="auto",Zc=[rr,Wr,Kr,ir],Dl="start",Mc="end",sQ="clippingParents",V6="viewport",pu="popper",lQ="reference",g4=Zc.reduce(function(e,t){return e.concat([t+"-"+Dl,t+"-"+Mc])},[]),q6=[].concat(Zc,[a9]).reduce(function(e,t){return e.concat([t,t+"-"+Dl,t+"-"+Mc])},[]),uQ="beforeRead",cQ="read",dQ="afterRead",fQ="beforeMain",hQ="main",pQ="afterMain",mQ="beforeWrite",gQ="write",vQ="afterWrite",yQ=[uQ,cQ,dQ,fQ,hQ,pQ,mQ,gQ,vQ];function Gi(e){return e?(e.nodeName||"").toLowerCase():null}function wr(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function as(e){var t=wr(e).Element;return e instanceof t||e instanceof Element}function zr(e){var t=wr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function o9(e){if(typeof ShadowRoot>"u")return!1;var t=wr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function bQ(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},a=t.elements[n];!zr(a)||!Gi(a)||(Object.assign(a.style,r),Object.keys(i).forEach(function(o){var s=i[o];s===!1?a.removeAttribute(o):a.setAttribute(o,s===!0?"":s)}))})}function EQ(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],a=t.attributes[r]||{},o=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=o.reduce(function(l,u){return l[u]="",l},{});!zr(i)||!Gi(i)||(Object.assign(i.style,s),Object.keys(a).forEach(function(l){i.removeAttribute(l)}))})}}const _Q={name:"applyStyles",enabled:!0,phase:"write",fn:bQ,effect:EQ,requires:["computeStyles"]};function Li(e){return e.split("-")[0]}var Qo=Math.max,th=Math.min,Ol=Math.round;function iv(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function W6(){return!/^((?!chrome|android).)*safari/i.test(iv())}function Nl(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,a=1;t&&zr(e)&&(i=e.offsetWidth>0&&Ol(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&Ol(r.height)/e.offsetHeight||1);var o=as(e)?wr(e):window,s=o.visualViewport,l=!W6()&&n,u=(r.left+(l&&s?s.offsetLeft:0))/i,c=(r.top+(l&&s?s.offsetTop:0))/a,d=r.width/i,f=r.height/a;return{width:d,height:f,top:c,right:u+d,bottom:c+f,left:u,x:u,y:c}}function s9(e){var t=Nl(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function K6(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&o9(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function xa(e){return wr(e).getComputedStyle(e)}function TQ(e){return["table","td","th"].indexOf(Gi(e))>=0}function yo(e){return((as(e)?e.ownerDocument:e.document)||window.document).documentElement}function Zh(e){return Gi(e)==="html"?e:e.assignedSlot||e.parentNode||(o9(e)?e.host:null)||yo(e)}function v4(e){return!zr(e)||xa(e).position==="fixed"?null:e.offsetParent}function CQ(e){var t=/firefox/i.test(iv()),n=/Trident/i.test(iv());if(n&&zr(e)){var r=xa(e);if(r.position==="fixed")return null}var i=Zh(e);for(o9(i)&&(i=i.host);zr(i)&&["html","body"].indexOf(Gi(i))<0;){var a=xa(i);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||t&&a.willChange==="filter"||t&&a.filter&&a.filter!=="none")return i;i=i.parentNode}return null}function Qc(e){for(var t=wr(e),n=v4(e);n&&TQ(n)&&xa(n).position==="static";)n=v4(n);return n&&(Gi(n)==="html"||Gi(n)==="body"&&xa(n).position==="static")?t:n||CQ(e)||t}function l9(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ic(e,t,n){return Qo(e,th(t,n))}function xQ(e,t,n){var r=ic(e,t,n);return r>n?n:r}function G6(){return{top:0,right:0,bottom:0,left:0}}function Y6(e){return Object.assign({},G6(),e)}function Z6(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var wQ=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Y6(typeof t!="number"?t:Z6(t,Zc))};function AQ(e){var t,n=e.state,r=e.name,i=e.options,a=n.elements.arrow,o=n.modifiersData.popperOffsets,s=Li(n.placement),l=l9(s),u=[ir,Kr].indexOf(s)>=0,c=u?"height":"width";if(!(!a||!o)){var d=wQ(i.padding,n),f=s9(a),h=l==="y"?rr:ir,m=l==="y"?Wr:Kr,p=n.rects.reference[c]+n.rects.reference[l]-o[l]-n.rects.popper[c],y=o[l]-n.rects.reference[l],v=Qc(a),b=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,_=p/2-y/2,T=d[h],C=b-f[c]-d[m],x=b/2-f[c]/2+_,w=ic(T,x,C),P=l;n.modifiersData[r]=(t={},t[P]=w,t.centerOffset=w-x,t)}}function kQ(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||K6(t.elements.popper,i)&&(t.elements.arrow=i))}const SQ={name:"arrow",enabled:!0,phase:"main",fn:AQ,effect:kQ,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Il(e){return e.split("-")[1]}var DQ={top:"auto",right:"auto",bottom:"auto",left:"auto"};function OQ(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:Ol(n*i)/i||0,y:Ol(r*i)/i||0}}function y4(e){var t,n=e.popper,r=e.popperRect,i=e.placement,a=e.variation,o=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,d=e.isFixed,f=o.x,h=f===void 0?0:f,m=o.y,p=m===void 0?0:m,y=typeof c=="function"?c({x:h,y:p}):{x:h,y:p};h=y.x,p=y.y;var v=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),_=ir,T=rr,C=window;if(u){var x=Qc(n),w="clientHeight",P="clientWidth";if(x===wr(n)&&(x=yo(n),xa(x).position!=="static"&&s==="absolute"&&(w="scrollHeight",P="scrollWidth")),x=x,i===rr||(i===ir||i===Kr)&&a===Mc){T=Wr;var O=d&&x===C&&C.visualViewport?C.visualViewport.height:x[w];p-=O-r.height,p*=l?1:-1}if(i===ir||(i===rr||i===Wr)&&a===Mc){_=Kr;var M=d&&x===C&&C.visualViewport?C.visualViewport.width:x[P];h-=M-r.width,h*=l?1:-1}}var R=Object.assign({position:s},u&&DQ),D=c===!0?OQ({x:h,y:p},wr(n)):{x:h,y:p};if(h=D.x,p=D.y,l){var S;return Object.assign({},R,(S={},S[T]=b?"0":"",S[_]=v?"0":"",S.transform=(C.devicePixelRatio||1)<=1?"translate("+h+"px, "+p+"px)":"translate3d("+h+"px, "+p+"px, 0)",S))}return Object.assign({},R,(t={},t[T]=b?p+"px":"",t[_]=v?h+"px":"",t.transform="",t))}function NQ(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,a=n.adaptive,o=a===void 0?!0:a,s=n.roundOffsets,l=s===void 0?!0:s,u={placement:Li(t.placement),variation:Il(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,y4(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,y4(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const IQ={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:NQ,data:{}};var M1={passive:!0};function PQ(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,a=i===void 0?!0:i,o=r.resize,s=o===void 0?!0:o,l=wr(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&u.forEach(function(c){c.addEventListener("scroll",n.update,M1)}),s&&l.addEventListener("resize",n.update,M1),function(){a&&u.forEach(function(c){c.removeEventListener("scroll",n.update,M1)}),s&&l.removeEventListener("resize",n.update,M1)}}const RQ={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:PQ,data:{}};var FQ={left:"right",right:"left",bottom:"top",top:"bottom"};function Jd(e){return e.replace(/left|right|bottom|top/g,function(t){return FQ[t]})}var MQ={start:"end",end:"start"};function b4(e){return e.replace(/start|end/g,function(t){return MQ[t]})}function u9(e){var t=wr(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function c9(e){return Nl(yo(e)).left+u9(e).scrollLeft}function BQ(e,t){var n=wr(e),r=yo(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;var u=W6();(u||!u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:a,height:o,x:s+c9(e),y:l}}function LQ(e){var t,n=yo(e),r=u9(e),i=(t=e.ownerDocument)==null?void 0:t.body,a=Qo(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=Qo(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+c9(e),l=-r.scrollTop;return xa(i||n).direction==="rtl"&&(s+=Qo(n.clientWidth,i?i.clientWidth:0)-a),{width:a,height:o,x:s,y:l}}function d9(e){var t=xa(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Q6(e){return["html","body","#document"].indexOf(Gi(e))>=0?e.ownerDocument.body:zr(e)&&d9(e)?e:Q6(Zh(e))}function ac(e,t){var n;t===void 0&&(t=[]);var r=Q6(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),a=wr(r),o=i?[a].concat(a.visualViewport||[],d9(r)?r:[]):r,s=t.concat(o);return i?s:s.concat(ac(Zh(o)))}function av(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function $Q(e,t){var n=Nl(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function E4(e,t,n){return t===V6?av(BQ(e,n)):as(t)?$Q(t,n):av(LQ(yo(e)))}function jQ(e){var t=ac(Zh(e)),n=["absolute","fixed"].indexOf(xa(e).position)>=0,r=n&&zr(e)?Qc(e):e;return as(r)?t.filter(function(i){return as(i)&&K6(i,r)&&Gi(i)!=="body"}):[]}function HQ(e,t,n,r){var i=t==="clippingParents"?jQ(e):[].concat(t),a=[].concat(i,[n]),o=a[0],s=a.reduce(function(l,u){var c=E4(e,u,r);return l.top=Qo(c.top,l.top),l.right=th(c.right,l.right),l.bottom=th(c.bottom,l.bottom),l.left=Qo(c.left,l.left),l},E4(e,o,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function X6(e){var t=e.reference,n=e.element,r=e.placement,i=r?Li(r):null,a=r?Il(r):null,o=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(i){case rr:l={x:o,y:t.y-n.height};break;case Wr:l={x:o,y:t.y+t.height};break;case Kr:l={x:t.x+t.width,y:s};break;case ir:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var u=i?l9(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(a){case Dl:l[u]=l[u]-(t[c]/2-n[c]/2);break;case Mc:l[u]=l[u]+(t[c]/2-n[c]/2);break}}return l}function Bc(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,a=n.strategy,o=a===void 0?e.strategy:a,s=n.boundary,l=s===void 0?sQ:s,u=n.rootBoundary,c=u===void 0?V6:u,d=n.elementContext,f=d===void 0?pu:d,h=n.altBoundary,m=h===void 0?!1:h,p=n.padding,y=p===void 0?0:p,v=Y6(typeof y!="number"?y:Z6(y,Zc)),b=f===pu?lQ:pu,_=e.rects.popper,T=e.elements[m?b:f],C=HQ(as(T)?T:T.contextElement||yo(e.elements.popper),l,c,o),x=Nl(e.elements.reference),w=X6({reference:x,element:_,strategy:"absolute",placement:i}),P=av(Object.assign({},_,w)),O=f===pu?P:x,M={top:C.top-O.top+v.top,bottom:O.bottom-C.bottom+v.bottom,left:C.left-O.left+v.left,right:O.right-C.right+v.right},R=e.modifiersData.offset;if(f===pu&&R){var D=R[i];Object.keys(M).forEach(function(S){var B=[Kr,Wr].indexOf(S)>=0?1:-1,H=[rr,Wr].indexOf(S)>=0?"y":"x";M[S]+=D[H]*B})}return M}function UQ(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,a=n.rootBoundary,o=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?q6:l,c=Il(r),d=c?s?g4:g4.filter(function(m){return Il(m)===c}):Zc,f=d.filter(function(m){return u.indexOf(m)>=0});f.length===0&&(f=d);var h=f.reduce(function(m,p){return m[p]=Bc(e,{placement:p,boundary:i,rootBoundary:a,padding:o})[Li(p)],m},{});return Object.keys(h).sort(function(m,p){return h[m]-h[p]})}function zQ(e){if(Li(e)===a9)return[];var t=Jd(e);return[b4(e),t,b4(t)]}function VQ(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,a=i===void 0?!0:i,o=n.altAxis,s=o===void 0?!0:o,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,m=h===void 0?!0:h,p=n.allowedAutoPlacements,y=t.options.placement,v=Li(y),b=v===y,_=l||(b||!m?[Jd(y)]:zQ(y)),T=[y].concat(_).reduce(function(U,V){return U.concat(Li(V)===a9?UQ(t,{placement:V,boundary:c,rootBoundary:d,padding:u,flipVariations:m,allowedAutoPlacements:p}):V)},[]),C=t.rects.reference,x=t.rects.popper,w=new Map,P=!0,O=T[0],M=0;M<T.length;M++){var R=T[M],D=Li(R),S=Il(R)===Dl,B=[rr,Wr].indexOf(D)>=0,H=B?"width":"height",$=Bc(t,{placement:R,boundary:c,rootBoundary:d,altBoundary:f,padding:u}),F=B?S?Kr:ir:S?Wr:rr;C[H]>x[H]&&(F=Jd(F));var ne=Jd(F),J=[];if(a&&J.push($[D]<=0),s&&J.push($[F]<=0,$[ne]<=0),J.every(function(U){return U})){O=R,P=!1;break}w.set(R,J)}if(P)for(var I=m?3:1,A=function(V){var z=T.find(function(j){var ue=w.get(j);if(ue)return ue.slice(0,V).every(function(Q){return Q})});if(z)return O=z,"break"},Y=I;Y>0;Y--){var L=A(Y);if(L==="break")break}t.placement!==O&&(t.modifiersData[r]._skip=!0,t.placement=O,t.reset=!0)}}const qQ={name:"flip",enabled:!0,phase:"main",fn:VQ,requiresIfExists:["offset"],data:{_skip:!1}};function _4(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function T4(e){return[rr,Kr,Wr,ir].some(function(t){return e[t]>=0})}function WQ(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,o=Bc(t,{elementContext:"reference"}),s=Bc(t,{altBoundary:!0}),l=_4(o,r),u=_4(s,i,a),c=T4(l),d=T4(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}const KQ={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:WQ};function GQ(e,t,n){var r=Li(e),i=[ir,rr].indexOf(r)>=0?-1:1,a=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,o=a[0],s=a[1];return o=o||0,s=(s||0)*i,[ir,Kr].indexOf(r)>=0?{x:s,y:o}:{x:o,y:s}}function YQ(e){var t=e.state,n=e.options,r=e.name,i=n.offset,a=i===void 0?[0,0]:i,o=q6.reduce(function(c,d){return c[d]=GQ(d,t.rects,a),c},{}),s=o[t.placement],l=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=o}const ZQ={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:YQ};function QQ(e){var t=e.state,n=e.name;t.modifiersData[n]=X6({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const XQ={name:"popperOffsets",enabled:!0,phase:"read",fn:QQ,data:{}};function JQ(e){return e==="x"?"y":"x"}function eX(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,a=i===void 0?!0:i,o=n.altAxis,s=o===void 0?!1:o,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,f=n.tether,h=f===void 0?!0:f,m=n.tetherOffset,p=m===void 0?0:m,y=Bc(t,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),v=Li(t.placement),b=Il(t.placement),_=!b,T=l9(v),C=JQ(T),x=t.modifiersData.popperOffsets,w=t.rects.reference,P=t.rects.popper,O=typeof p=="function"?p(Object.assign({},t.rects,{placement:t.placement})):p,M=typeof O=="number"?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),R=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,D={x:0,y:0};if(x){if(a){var S,B=T==="y"?rr:ir,H=T==="y"?Wr:Kr,$=T==="y"?"height":"width",F=x[T],ne=F+y[B],J=F-y[H],I=h?-P[$]/2:0,A=b===Dl?w[$]:P[$],Y=b===Dl?-P[$]:-w[$],L=t.elements.arrow,U=h&&L?s9(L):{width:0,height:0},V=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:G6(),z=V[B],j=V[H],ue=ic(0,w[$],U[$]),Q=_?w[$]/2-I-ue-z-M.mainAxis:A-ue-z-M.mainAxis,ie=_?-w[$]/2+I+ue+j+M.mainAxis:Y+ue+j+M.mainAxis,le=t.elements.arrow&&Qc(t.elements.arrow),te=le?T==="y"?le.clientTop||0:le.clientLeft||0:0,Ae=(S=R==null?void 0:R[T])!=null?S:0,Oe=F+Q-Ae-te,Te=F+ie-Ae,se=ic(h?th(ne,Oe):ne,F,h?Qo(J,Te):J);x[T]=se,D[T]=se-F}if(s){var ve,ke=T==="x"?rr:ir,Fe=T==="x"?Wr:Kr,ht=x[C],gt=C==="y"?"height":"width",nt=ht+y[ke],ot=ht-y[Fe],je=[rr,ir].indexOf(v)!==-1,re=(ve=R==null?void 0:R[C])!=null?ve:0,ge=je?nt:ht-w[gt]-P[gt]-re+M.altAxis,Ne=je?ht+w[gt]+P[gt]-re-M.altAxis:ot,ye=h&&je?xQ(ge,ht,Ne):ic(h?ge:nt,ht,h?Ne:ot);x[C]=ye,D[C]=ye-ht}t.modifiersData[r]=D}}const tX={name:"preventOverflow",enabled:!0,phase:"main",fn:eX,requiresIfExists:["offset"]};function nX(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function rX(e){return e===wr(e)||!zr(e)?u9(e):nX(e)}function iX(e){var t=e.getBoundingClientRect(),n=Ol(t.width)/e.offsetWidth||1,r=Ol(t.height)/e.offsetHeight||1;return n!==1||r!==1}function aX(e,t,n){n===void 0&&(n=!1);var r=zr(t),i=zr(t)&&iX(t),a=yo(t),o=Nl(e,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Gi(t)!=="body"||d9(a))&&(s=rX(t)),zr(t)?(l=Nl(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):a&&(l.x=c9(a))),{x:o.left+s.scrollLeft-l.x,y:o.top+s.scrollTop-l.y,width:o.width,height:o.height}}function oX(e){var t=new Map,n=new Set,r=[];e.forEach(function(a){t.set(a.name,a)});function i(a){n.add(a.name);var o=[].concat(a.requires||[],a.requiresIfExists||[]);o.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&i(l)}}),r.push(a)}return e.forEach(function(a){n.has(a.name)||i(a)}),r}function sX(e){var t=oX(e);return yQ.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function lX(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function uX(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var C4={placement:"bottom",modifiers:[],strategy:"absolute"};function x4(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function cX(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,a=i===void 0?C4:i;return function(s,l,u){u===void 0&&(u=a);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},C4,a),modifiersData:{},elements:{reference:s,popper:l},attributes:{},styles:{}},d=[],f=!1,h={state:c,setOptions:function(v){var b=typeof v=="function"?v(c.options):v;p(),c.options=Object.assign({},a,c.options,b),c.scrollParents={reference:as(s)?ac(s):s.contextElement?ac(s.contextElement):[],popper:ac(l)};var _=sX(uX([].concat(r,c.options.modifiers)));return c.orderedModifiers=_.filter(function(T){return T.enabled}),m(),h.update()},forceUpdate:function(){if(!f){var v=c.elements,b=v.reference,_=v.popper;if(x4(b,_)){c.rects={reference:aX(b,Qc(_),c.options.strategy==="fixed"),popper:s9(_)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(M){return c.modifiersData[M.name]=Object.assign({},M.data)});for(var T=0;T<c.orderedModifiers.length;T++){if(c.reset===!0){c.reset=!1,T=-1;continue}var C=c.orderedModifiers[T],x=C.fn,w=C.options,P=w===void 0?{}:w,O=C.name;typeof x=="function"&&(c=x({state:c,options:P,name:O,instance:h})||c)}}}},update:lX(function(){return new Promise(function(y){h.forceUpdate(),y(c)})}),destroy:function(){p(),f=!0}};if(!x4(s,l))return h;h.setOptions(u).then(function(y){!f&&u.onFirstUpdate&&u.onFirstUpdate(y)});function m(){c.orderedModifiers.forEach(function(y){var v=y.name,b=y.options,_=b===void 0?{}:b,T=y.effect;if(typeof T=="function"){var C=T({state:c,name:v,instance:h,options:_}),x=function(){};d.push(C||x)}})}function p(){d.forEach(function(y){return y()}),d=[]}return h}}var dX=[RQ,XQ,IQ,_Q,ZQ,qQ,tX,SQ,KQ],fX=cX({defaultModifiers:dX}),hX=typeof Element<"u",pX=typeof Map=="function",mX=typeof Set=="function",gX=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function ef(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!ef(e[r],t[r]))return!1;return!0}var a;if(pX&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a=e.entries();!(r=a.next()).done;)if(!t.has(r.value[0]))return!1;for(a=e.entries();!(r=a.next()).done;)if(!ef(r.value[1],t.get(r.value[0])))return!1;return!0}if(mX&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a=e.entries();!(r=a.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(gX&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(hX&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!ef(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var vX=function(t,n){try{return ef(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const yX=gi(vX);var bX=[],EX=function(t,n,r){r===void 0&&(r={});var i=Nn.useRef(null),a={onFirstUpdate:r.onFirstUpdate,placement:r.placement||"bottom",strategy:r.strategy||"absolute",modifiers:r.modifiers||bX},o=Nn.useState({styles:{popper:{position:a.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),s=o[0],l=o[1],u=Nn.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(h){var m=h.state,p=Object.keys(m.elements);ND.flushSync(function(){l({styles:p4(p.map(function(y){return[y,m.styles[y]||{}]})),attributes:p4(p.map(function(y){return[y,m.attributes[y]]}))})})},requires:["computeStyles"]}},[]),c=Nn.useMemo(function(){var f={onFirstUpdate:a.onFirstUpdate,placement:a.placement,strategy:a.strategy,modifiers:[].concat(a.modifiers,[u,{name:"applyStyles",enabled:!1}])};return yX(i.current,f)?i.current||f:(i.current=f,f)},[a.onFirstUpdate,a.placement,a.strategy,a.modifiers,u]),d=Nn.useRef();return m4(function(){d.current&&d.current.setOptions(c)},[c]),m4(function(){if(!(t==null||n==null)){var f=r.createPopper||fX,h=f(t,n,c);return d.current=h,function(){h.destroy(),d.current=null}}},[t,n,r.createPopper]),{state:d.current?d.current.state:null,styles:s.styles,attributes:s.attributes,update:d.current?d.current.update:null,forceUpdate:d.current?d.current.forceUpdate:null}};function ov(){return ov=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ov.apply(this,arguments)}function J6(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var _X=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,TX=J6(function(e){return _X.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),CX=!1;function xX(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function wX(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var AX=function(){function e(n){var r=this;this._insertTag=function(i){var a;r.tags.length===0?r.insertionPoint?a=r.insertionPoint.nextSibling:r.prepend?a=r.container.firstChild:a=r.before:a=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,a),r.tags.push(i)},this.isSpeedy=n.speedy===void 0?!CX:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(wX(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var a=xX(i);try{a.insertRule(r,a.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var i;return(i=r.parentNode)==null?void 0:i.removeChild(r)}),this.tags=[],this.ctr=0},e}(),Pn="-ms-",nh="-moz-",Ot="-webkit-",eA="comm",f9="rule",h9="decl",kX="@import",tA="@keyframes",SX="@layer",DX=Math.abs,Qh=String.fromCharCode,OX=Object.assign;function NX(e,t){return On(e,0)^45?(((t<<2^On(e,0))<<2^On(e,1))<<2^On(e,2))<<2^On(e,3):0}function nA(e){return e.trim()}function IX(e,t){return(e=t.exec(e))?e[0]:e}function Nt(e,t,n){return e.replace(t,n)}function sv(e,t){return e.indexOf(t)}function On(e,t){return e.charCodeAt(t)|0}function Lc(e,t,n){return e.slice(t,n)}function Di(e){return e.length}function p9(e){return e.length}function B1(e,t){return t.push(e),e}function PX(e,t){return e.map(t).join("")}var Xh=1,Pl=1,rA=0,ur=0,gn=0,Kl="";function Jh(e,t,n,r,i,a,o){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:Xh,column:Pl,length:o,return:""}}function mu(e,t){return OX(Jh("",null,null,"",null,null,0),e,{length:-e.length},t)}function RX(){return gn}function FX(){return gn=ur>0?On(Kl,--ur):0,Pl--,gn===10&&(Pl=1,Xh--),gn}function Tr(){return gn=ur<rA?On(Kl,ur++):0,Pl++,gn===10&&(Pl=1,Xh++),gn}function $i(){return On(Kl,ur)}function tf(){return ur}function Xc(e,t){return Lc(Kl,e,t)}function $c(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function iA(e){return Xh=Pl=1,rA=Di(Kl=e),ur=0,[]}function aA(e){return Kl="",e}function nf(e){return nA(Xc(ur-1,lv(e===91?e+2:e===40?e+1:e)))}function MX(e){for(;(gn=$i())&&gn<33;)Tr();return $c(e)>2||$c(gn)>3?"":" "}function BX(e,t){for(;--t&&Tr()&&!(gn<48||gn>102||gn>57&&gn<65||gn>70&&gn<97););return Xc(e,tf()+(t<6&&$i()==32&&Tr()==32))}function lv(e){for(;Tr();)switch(gn){case e:return ur;case 34:case 39:e!==34&&e!==39&&lv(gn);break;case 40:e===41&&lv(e);break;case 92:Tr();break}return ur}function LX(e,t){for(;Tr()&&e+gn!==47+10;)if(e+gn===42+42&&$i()===47)break;return"/*"+Xc(t,ur-1)+"*"+Qh(e===47?e:Tr())}function $X(e){for(;!$c($i());)Tr();return Xc(e,ur)}function jX(e){return aA(rf("",null,null,null,[""],e=iA(e),0,[0],e))}function rf(e,t,n,r,i,a,o,s,l){for(var u=0,c=0,d=o,f=0,h=0,m=0,p=1,y=1,v=1,b=0,_="",T=i,C=a,x=r,w=_;y;)switch(m=b,b=Tr()){case 40:if(m!=108&&On(w,d-1)==58){sv(w+=Nt(nf(b),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:w+=nf(b);break;case 9:case 10:case 13:case 32:w+=MX(m);break;case 92:w+=BX(tf()-1,7);continue;case 47:switch($i()){case 42:case 47:B1(HX(LX(Tr(),tf()),t,n),l);break;default:w+="/"}break;case 123*p:s[u++]=Di(w)*v;case 125*p:case 59:case 0:switch(b){case 0:case 125:y=0;case 59+c:v==-1&&(w=Nt(w,/\f/g,"")),h>0&&Di(w)-d&&B1(h>32?A4(w+";",r,n,d-1):A4(Nt(w," ","")+";",r,n,d-2),l);break;case 59:w+=";";default:if(B1(x=w4(w,t,n,u,c,i,s,_,T=[],C=[],d),a),b===123)if(c===0)rf(w,t,x,x,T,a,d,s,C);else switch(f===99&&On(w,3)===110?100:f){case 100:case 108:case 109:case 115:rf(e,x,x,r&&B1(w4(e,x,x,0,0,i,s,_,i,T=[],d),C),i,C,d,s,r?T:C);break;default:rf(w,x,x,x,[""],C,0,s,C)}}u=c=h=0,p=v=1,_=w="",d=o;break;case 58:d=1+Di(w),h=m;default:if(p<1){if(b==123)--p;else if(b==125&&p++==0&&FX()==125)continue}switch(w+=Qh(b),b*p){case 38:v=c>0?1:(w+="\f",-1);break;case 44:s[u++]=(Di(w)-1)*v,v=1;break;case 64:$i()===45&&(w+=nf(Tr())),f=$i(),c=d=Di(_=w+=$X(tf())),b++;break;case 45:m===45&&Di(w)==2&&(p=0)}}return a}function w4(e,t,n,r,i,a,o,s,l,u,c){for(var d=i-1,f=i===0?a:[""],h=p9(f),m=0,p=0,y=0;m<r;++m)for(var v=0,b=Lc(e,d+1,d=DX(p=o[m])),_=e;v<h;++v)(_=nA(p>0?f[v]+" "+b:Nt(b,/&\f/g,f[v])))&&(l[y++]=_);return Jh(e,t,n,i===0?f9:s,l,u,c)}function HX(e,t,n){return Jh(e,t,n,eA,Qh(RX()),Lc(e,2,-2),0)}function A4(e,t,n,r){return Jh(e,t,n,h9,Lc(e,0,r),Lc(e,r+1,-1),r)}function ul(e,t){for(var n="",r=p9(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function UX(e,t,n,r){switch(e.type){case SX:if(e.children.length)break;case kX:case h9:return e.return=e.return||e.value;case eA:return"";case tA:return e.return=e.value+"{"+ul(e.children,r)+"}";case f9:e.value=e.props.join(",")}return Di(n=ul(e.children,r))?e.return=e.value+"{"+n+"}":""}function zX(e){var t=p9(e);return function(n,r,i,a){for(var o="",s=0;s<t;s++)o+=e[s](n,r,i,a)||"";return o}}function VX(e){return function(t){t.root||(t=t.return)&&e(t)}}var qX=function(t,n,r){for(var i=0,a=0;i=a,a=$i(),i===38&&a===12&&(n[r]=1),!$c(a);)Tr();return Xc(t,ur)},WX=function(t,n){var r=-1,i=44;do switch($c(i)){case 0:i===38&&$i()===12&&(n[r]=1),t[r]+=qX(ur-1,n,r);break;case 2:t[r]+=nf(i);break;case 4:if(i===44){t[++r]=$i()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=Qh(i)}while(i=Tr());return t},KX=function(t,n){return aA(WX(iA(t),n))},k4=new WeakMap,GX=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,i=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!k4.get(r))&&!i){k4.set(t,!0);for(var a=[],o=KX(n,a),s=r.props,l=0,u=0;l<o.length;l++)for(var c=0;c<s.length;c++,u++)t.props[u]=a[l]?o[l].replace(/&\f/g,s[c]):s[c]+" "+o[l]}}},YX=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function oA(e,t){switch(NX(e,t)){case 5103:return Ot+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ot+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ot+e+nh+e+Pn+e+e;case 6828:case 4268:return Ot+e+Pn+e+e;case 6165:return Ot+e+Pn+"flex-"+e+e;case 5187:return Ot+e+Nt(e,/(\w+).+(:[^]+)/,Ot+"box-$1$2"+Pn+"flex-$1$2")+e;case 5443:return Ot+e+Pn+"flex-item-"+Nt(e,/flex-|-self/,"")+e;case 4675:return Ot+e+Pn+"flex-line-pack"+Nt(e,/align-content|flex-|-self/,"")+e;case 5548:return Ot+e+Pn+Nt(e,"shrink","negative")+e;case 5292:return Ot+e+Pn+Nt(e,"basis","preferred-size")+e;case 6060:return Ot+"box-"+Nt(e,"-grow","")+Ot+e+Pn+Nt(e,"grow","positive")+e;case 4554:return Ot+Nt(e,/([^-])(transform)/g,"$1"+Ot+"$2")+e;case 6187:return Nt(Nt(Nt(e,/(zoom-|grab)/,Ot+"$1"),/(image-set)/,Ot+"$1"),e,"")+e;case 5495:case 3959:return Nt(e,/(image-set\([^]*)/,Ot+"$1$`$1");case 4968:return Nt(Nt(e,/(.+:)(flex-)?(.*)/,Ot+"box-pack:$3"+Pn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ot+e+e;case 4095:case 3583:case 4068:case 2532:return Nt(e,/(.+)-inline(.+)/,Ot+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Di(e)-1-t>6)switch(On(e,t+1)){case 109:if(On(e,t+4)!==45)break;case 102:return Nt(e,/(.+:)(.+)-([^]+)/,"$1"+Ot+"$2-$3$1"+nh+(On(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~sv(e,"stretch")?oA(Nt(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(On(e,t+1)!==115)break;case 6444:switch(On(e,Di(e)-3-(~sv(e,"!important")&&10))){case 107:return Nt(e,":",":"+Ot)+e;case 101:return Nt(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ot+(On(e,14)===45?"inline-":"")+"box$3$1"+Ot+"$2$3$1"+Pn+"$2box$3")+e}break;case 5936:switch(On(e,t+11)){case 114:return Ot+e+Pn+Nt(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ot+e+Pn+Nt(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ot+e+Pn+Nt(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Ot+e+Pn+e+e}return e}var ZX=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case h9:t.return=oA(t.value,t.length);break;case tA:return ul([mu(t,{value:Nt(t.value,"@","@"+Ot)})],i);case f9:if(t.length)return PX(t.props,function(a){switch(IX(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return ul([mu(t,{props:[Nt(a,/:(read-\w+)/,":"+nh+"$1")]})],i);case"::placeholder":return ul([mu(t,{props:[Nt(a,/:(plac\w+)/,":"+Ot+"input-$1")]}),mu(t,{props:[Nt(a,/:(plac\w+)/,":"+nh+"$1")]}),mu(t,{props:[Nt(a,/:(plac\w+)/,Pn+"input-$1")]})],i)}return""})}},QX=[ZX],XX=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(p){var y=p.getAttribute("data-emotion");y.indexOf(" ")!==-1&&(document.head.appendChild(p),p.setAttribute("data-s",""))})}var i=t.stylisPlugins||QX,a={},o,s=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(p){for(var y=p.getAttribute("data-emotion").split(" "),v=1;v<y.length;v++)a[y[v]]=!0;s.push(p)});var l,u=[GX,YX];{var c,d=[UX,VX(function(p){c.insert(p)})],f=zX(u.concat(i,d)),h=function(y){return ul(jX(y),f)};l=function(y,v,b,_){c=b,h(y?y+"{"+v.styles+"}":v.styles),_&&(m.inserted[v.name]=!0)}}var m={key:n,sheet:new AX({key:n,container:o,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:a,registered:{},insert:l};return m.sheet.hydrate(s),m},sA=$v(),JX={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},eJ={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},lA={};lA[sA.ForwardRef]=JX;lA[sA.Memo]=eJ;var tJ=!0;function nJ(e,t,n){var r="";return n.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(r+=i+" ")}),r}var uA=function(t,n,r){var i=t.key+"-"+n.name;(r===!1||tJ===!1)&&t.registered[i]===void 0&&(t.registered[i]=n.styles)},rJ=function(t,n,r){uA(t,n,r);var i=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var a=n;do t.insert(n===a?"."+i:"",a,t.sheet,!0),a=a.next;while(a!==void 0)}};function iJ(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var aJ={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},oJ=!1,sJ=/[A-Z]|^ms/g,lJ=/_EMO_([^_]+?)_([^]*?)_EMO_/g,cA=function(t){return t.charCodeAt(1)===45},S4=function(t){return t!=null&&typeof t!="boolean"},Hm=J6(function(e){return cA(e)?e:e.replace(sJ,"-$&").toLowerCase()}),D4=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(lJ,function(r,i,a){return Oi={name:i,styles:a,next:Oi},i})}return aJ[t]!==1&&!cA(t)&&typeof n=="number"&&n!==0?n+"px":n},uJ="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function jc(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return Oi={name:i.name,styles:i.styles,next:Oi},i.name;var a=n;if(a.styles!==void 0){var o=a.next;if(o!==void 0)for(;o!==void 0;)Oi={name:o.name,styles:o.styles,next:Oi},o=o.next;var s=a.styles+";";return s}return cJ(e,t,n)}case"function":{if(e!==void 0){var l=Oi,u=n(e);return Oi=l,jc(e,t,u)}break}}var c=n;if(t==null)return c;var d=t[c];return d!==void 0?d:c}function cJ(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=jc(e,t,n[i])+";";else for(var a in n){var o=n[a];if(typeof o!="object"){var s=o;t!=null&&t[s]!==void 0?r+=a+"{"+t[s]+"}":S4(s)&&(r+=Hm(a)+":"+D4(a,s)+";")}else{if(a==="NO_COMPONENT_SELECTOR"&&oJ)throw new Error(uJ);if(Array.isArray(o)&&typeof o[0]=="string"&&(t==null||t[o[0]]===void 0))for(var l=0;l<o.length;l++)S4(o[l])&&(r+=Hm(a)+":"+D4(a,o[l])+";");else{var u=jc(e,t,o);switch(a){case"animation":case"animationName":{r+=Hm(a)+":"+u+";";break}default:r+=a+"{"+u+"}"}}}}return r}var O4=/label:\s*([^\s;{]+)\s*(;|$)/g,Oi;function dA(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,i="";Oi=void 0;var a=e[0];if(a==null||a.raw===void 0)r=!1,i+=jc(n,t,a);else{var o=a;i+=o[0]}for(var s=1;s<e.length;s++)if(i+=jc(n,t,e[s]),r){var l=a;i+=l[s]}O4.lastIndex=0;for(var u="",c;(c=O4.exec(i))!==null;)u+="-"+c[1];var d=iJ(i)+u;return{name:d,styles:i,next:Oi}}var dJ=function(t){return t()},fJ=Nn["useInsertionEffect"]?Nn["useInsertionEffect"]:!1,hJ=fJ||dJ,fA=Nn.createContext(typeof HTMLElement<"u"?XX({key:"css"}):null);fA.Provider;var pJ=function(t){return E.forwardRef(function(n,r){var i=E.useContext(fA);return t(n,i,r)})},mJ=Nn.createContext({});function gJ(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return dA(t)}var vJ=function(){var t=gJ.apply(void 0,arguments),n="animation-"+t.name;return{name:n,styles:"@keyframes "+n+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}},yJ=TX,bJ=function(t){return t!=="theme"},N4=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?yJ:bJ},I4=function(t,n,r){var i;if(n){var a=n.shouldForwardProp;i=t.__emotion_forwardProp&&a?function(o){return t.__emotion_forwardProp(o)&&a(o)}:a}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},EJ=!1,_J=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return uA(n,r,i),hJ(function(){return rJ(n,r,i)}),null},TJ=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,a,o;n!==void 0&&(a=n.label,o=n.target);var s=I4(t,n,r),l=s||N4(i),u=!l("as");return function(){var c=arguments,d=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(a!==void 0&&d.push("label:"+a+";"),c[0]==null||c[0].raw===void 0)d.push.apply(d,c);else{d.push(c[0][0]);for(var f=c.length,h=1;h<f;h++)d.push(c[h],c[0][h])}var m=pJ(function(p,y,v){var b=u&&p.as||i,_="",T=[],C=p;if(p.theme==null){C={};for(var x in p)C[x]=p[x];C.theme=Nn.useContext(mJ)}typeof p.className=="string"?_=nJ(y.registered,T,p.className):p.className!=null&&(_=p.className+" ");var w=dA(d.concat(T),y.registered,C);_+=y.key+"-"+w.name,o!==void 0&&(_+=" "+o);var P=u&&s===void 0?N4(b):l,O={};for(var M in p)u&&M==="as"||P(M)&&(O[M]=p[M]);return O.className=_,v&&(O.ref=v),Nn.createElement(Nn.Fragment,null,Nn.createElement(_J,{cache:y,serialized:w,isStringTag:typeof b=="string"}),Nn.createElement(b,O))});return m.displayName=a!==void 0?a:"Styled("+(typeof i=="string"?i:i.displayName||i.name||"Component")+")",m.defaultProps=t.defaultProps,m.__emotion_real=m,m.__emotion_base=i,m.__emotion_styles=d,m.__emotion_forwardProp=s,Object.defineProperty(m,"toString",{value:function(){return o===void 0&&EJ?"NO_COMPONENT_SELECTOR":"."+o}}),m.withComponent=function(p,y){return e(p,ov({},n,y,{shouldForwardProp:I4(m,y,!0)})).apply(void 0,d)},m}},CJ=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],Be=TJ.bind();CJ.forEach(function(e){Be[e]=Be(e)});var xs={}.hasOwnProperty,hA=xJ;function xJ(e){return!e||typeof e!="object"?"":xs.call(e,"position")||xs.call(e,"type")?P4(e.position):xs.call(e,"start")||xs.call(e,"end")?P4(e):xs.call(e,"line")||xs.call(e,"column")?uv(e):""}function uv(e){return(!e||typeof e!="object")&&(e={}),R4(e.line)+":"+R4(e.column)}function P4(e){return(!e||typeof e!="object")&&(e={}),uv(e.start)+"-"+uv(e.end)}function R4(e){return e&&typeof e=="number"?e:1}var wJ=hA,AJ=m9;function pA(){}pA.prototype=Error.prototype;m9.prototype=new pA;var bo=m9.prototype;bo.file="";bo.name="";bo.reason="";bo.message="";bo.stack="";bo.fatal=null;bo.column=null;bo.line=null;function m9(e,t,n){var r,i,a;typeof t=="string"&&(n=t,t=null),r=kJ(n),i=wJ(t)||"1:1",a={start:{line:null,column:null},end:{line:null,column:null}},t&&t.position&&(t=t.position),t&&(t.start?(a=t,t=t.start):a.start=t),e.stack&&(this.stack=e.stack,e=e.message),this.message=e,this.name=i,this.reason=e,this.line=t?t.line:null,this.column=t?t.column:null,this.location=a,this.source=r[0],this.ruleId=r[1]}function kJ(e){var t=[null,null],n;return typeof e=="string"&&(n=e.indexOf(":"),n===-1?t[1]=e:(t[0]=e.slice(0,n),t[1]=e.slice(n+1))),t}var Gl={};Gl.basename=SJ;Gl.dirname=DJ;Gl.extname=OJ;Gl.join=NJ;Gl.sep="/";function SJ(e,t){var n=0,r=-1,i,a,o,s;if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');if(Jc(e),i=e.length,t===void 0||!t.length||t.length>e.length){for(;i--;)if(e.charCodeAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";for(a=-1,s=t.length-1;i--;)if(e.charCodeAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(e.charCodeAt(i)===t.charCodeAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function DJ(e){var t,n,r;if(Jc(e),!e.length)return".";for(t=-1,r=e.length;--r;)if(e.charCodeAt(r)===47){if(n){t=r;break}}else n||(n=!0);return t<0?e.charCodeAt(0)===47?"/":".":t===1&&e.charCodeAt(0)===47?"//":e.slice(0,t)}function OJ(e){var t=-1,n=0,r=-1,i=0,a,o,s;for(Jc(e),s=e.length;s--;){if(o=e.charCodeAt(s),o===47){if(a){n=s+1;break}continue}r<0&&(a=!0,r=s+1),o===46?t<0?t=s:i!==1&&(i=1):t>-1&&(i=-1)}return t<0||r<0||i===0||i===1&&t===r-1&&t===n+1?"":e.slice(t,r)}function NJ(){for(var e=-1,t;++e<arguments.length;)Jc(arguments[e]),arguments[e]&&(t=t===void 0?arguments[e]:t+"/"+arguments[e]);return t===void 0?".":IJ(t)}function IJ(e){var t,n;return Jc(e),t=e.charCodeAt(0)===47,n=PJ(e,!t),!n.length&&!t&&(n="."),n.length&&e.charCodeAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function PJ(e,t){for(var n="",r=0,i=-1,a=0,o=-1,s,l;++o<=e.length;){if(o<e.length)s=e.charCodeAt(o);else{if(s===47)break;s=47}if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=o,a=0;continue}}else if(n.length){n="",r=0,i=o,a=0;continue}}t&&(n=n.length?n+"/..":"..",r=2)}else n.length?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Jc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var mA={};mA.cwd=RJ;function RJ(){return"/"}/*!
165
+ `}),z=j.turndown(z)}s&&s.mentions&&(z=await GC({text:z,template:`[${Tg}{{name}}]({{id}})`,mentions:s.mentions,listMembers:h||(()=>Promise.resolve([]))})),yH(z,j=>{const ue=[{type:"initialValue",value:j},{type:"editorKey",value:O.toString()}];s!=null&&s.link&&(ue.push({type:"enrichedUrl",value:s.link}),s.link.url&&ne(s.link.url)),w(ue),setTimeout(()=>{w([{type:"stringValue",value:q2(Y)}])},150)})})()},[O]),E.useEffect(()=>{if($===void 0&&Y){const z=_H(Y);z&&ne(z)}const V=z=>{var Q;const j=z,ue=((Q=j==null?void 0:j.detail)==null?void 0:Q.url)||null;ue&&$&&$.url===ue&&w([{type:"enrichedUrl",value:void 0}])};return window.addEventListener("linkRemoved",V),()=>{window.removeEventListener("linkRemoved",V)}},[$]),E.useEffect(()=>{if(t){vc.lastIndex=0;const V=t.match(vc);V&&V.length===1&&V[0].length===t.length&&!B&&w([{type:"originalValue",value:t}])}t!==""||!Y||cf(O,t)&&!B||(N.withoutNormalizing(Y,()=>{de.delete(Y,{at:{anchor:N.start(Y,[]),focus:N.end(Y,[])}}),de.deselect(Y),Y.children.length!==0&&de.unwrapNodes(Y,{at:[0]}),de.insertNodes(Y,T,{at:[0]})}),w([{type:"initialValue",value:T},{type:"lastAnchor",value:null},{type:"enrichedUrl",value:!1}]))},[t]),E.useEffect(()=>{y({link:$})},[$]),E.useEffect(()=>{R===""&&$&&w([{type:"enrichedUrl",value:void 0}])},[R]);const U=mc(()=>{CH({editor:Y,isShowing:F.show,numberOfUsers:F.numberOfUsers,listMembers:h,dispatch:w})},100);return M?g.jsx("div",{id:J,className:"rich-text-editor input text-medium",children:g.jsxs(Da.Provider,{value:{...x,id:J,isInOverlay:f,dispatch:w,onMention:b,reportError:_},children:[g.jsxs(HL,{editor:Y,initialValue:M,onChange:V=>{if(Y.operations.some(j=>j.type!=="set_selection")){let j=wH(V);j==="<br>"&&(j=""),p(j,$),w([{type:"stringValue",value:q2(Y)}]),B||w([{type:"hasInteracted",value:!0}]),U(),d&&console.log({serialized:j,json:V})}},...u,children:[g.jsx(IL,{className:"editor",renderElement:I,renderLeaf:A,placeholder:n||c.formatMessage({id:"richTextEditor_placeholder"}),autoFocus:o,tabIndex:0,onPaste:async V=>{const z=$!==!1,j=V.clipboardData.getData("text");if((Q=>{try{return new URL(Q),!0}catch{return!1}})(j)){let Q=j;if(j){const{full:ie}=Ov(j);Q=ie}if(j&&v&&!z){const ie=await v(Q);ie.url&&w([{type:"enrichedUrl",value:ie}])}}},onKeyDown:V=>{if(V.key==="Enter"){F.show&&(V.preventDefault(),V.stopPropagation(),dw(Y,F,w,J));const{selection:z}=Y;if(z){const j=ce.isCollapsed(z),[ue,Q]=N.node(Y,z,{depth:1});let ie=ue,le=ie.type;const te=ie.children[0];if(te&&(te==null?void 0:te[ae.h3])===!0&&(V.stopPropagation(),V.preventDefault(),de.insertNodes(Y,T)),te&&[ae.ol,ae.ul].includes(te.type)&&(ie=te,le=te.type),ie&&De.isElement(ie)&&le!==ae.paragraph){if(le===ae.blockquote&&!V.shiftKey){V.stopPropagation(),V.preventDefault(),de.insertNodes(Y,T);return}if(j){const[Ae,Oe]=N.parent(Y,z,{edge:"end"}),se=Ae.type;if([ae.ul,ae.ol].includes(le))if(V.stopPropagation(),V.preventDefault(),se===ae.li&&S==="Enter"){Ae.children.length===1&&"text"in Ae.children[0]&&Ae.children[0].text===""&&de.removeNodes(Y,{at:Oe}),de.insertNodes(Y,T,{at:K.next(Q)}),de.select(Y,N.end(Y,K.next(Q)));return}else{const[ve,ke]=bH(Y,ae.li),Fe={type:ae.li,children:[{text:""}]};de.insertNodes(Y,Fe,{at:K.next(ke)}),de.select(Y,N.end(Y,K.next(ke)))}}}}}else if(V.key==="Escape"){if(F.show){V.preventDefault(),V.stopPropagation(),w([{type:"mentionPopover",value:{...F,show:!1}}]);return}}else if(["ArrowUp","ArrowDown"].includes(V.key)&&F.show){V.preventDefault(),V.stopPropagation();const{selectedUser:z,possibleUsers:j}=F;let ue=V.key==="ArrowUp"?z-1:z+1;ue<0&&(ue=j.length-1),ue>=j.length+1&&(ue=0),w([{type:"mentionPopover",value:{...F,selectedUser:ue}}])}w([{type:"lastKey",value:V.key}]),TH(V,Y,w,_)},onBlur:()=>{Y.selection&&w([{type:"lastAnchor",value:Y.selection.anchor}])},onFocus:()=>{if(D){if(!K.isPath(D.path)||!Ee.has(Y,D.path))return;const V=Ee.get(Y,D.path);let z=0;if(Pe.isText(V)?z=V.text.length:V.children&&(z=V.children.length),D.offset>z)return;try{de.select(Y,{anchor:D,focus:D})}catch(j){const ue=j.message;_(`Error focusing editor: ${ue}`)}}}}),$?g.jsx(Qv,{data:$,variant:"condensed",onClick:()=>{w([{type:"enrichedUrl",value:!1}]);const V=new CustomEvent("ariaLive",{detail:{message:c.formatMessage({id:"richTextEditor_link_enrichedUrl_aria_live"})}});document.dispatchEvent(V)},"aria-label":c.formatMessage({id:"richTextEditor_link_enrichedUrl_aria"},{title:$.title||c.formatMessage({id:"richTextEditor_link_enrichedUrl_aria_fallback"})})}):g.jsx(g.Fragment,{}),g.jsx(MH,{styling:l==null?void 0:l.toolbar}),h?g.jsx(AH,{onFallbackClick:m}):g.jsx(g.Fragment,{})]},P),g.jsx(Jv,{id:`character-limit-${e}`,limit:r,valueLength:_h(R)})]})}):g.jsx(g.Fragment,{})};const TU=({id:e="form-toggle",label:t,options:n,initialValue:r,functions:{onChange:i=()=>{}},isDisabled:a=!1,className:o=""})=>{const[s,l]=E.useState(typeof r=="boolean"||typeof r=="string"?r:n[0].value);E.useEffect(()=>{r&&l(r)},[r]);const u=c=>{a||(l(c),i(c))};return g.jsxs("div",{className:ee("toggle",o),onClick:c=>{c.preventDefault(),c.stopPropagation(),u(s===n[0].value?n[1].value:n[0].value)},children:[g.jsx("p",{children:t}),g.jsx("ul",{className:ee("toggle-options",{disabled:a,on:s===n[1].value}),children:n.map(c=>{const d=`${e}-${c.value}`;return g.jsxs("li",{className:"hidden",children:[g.jsx("input",{type:"radio",id:d,name:e,value:c.value,checked:s===c.value,onChange:()=>u(c.value),disabled:a}),g.jsx("label",{htmlFor:d,children:c.label})]},d)})})]})};function Aw({className:e="",userId:t,userName:n,src:r,uploadImage:i,button:a,callback:o}){const s=me.useIntl(),l="profileImageChange_",[u,c]=E.useState(r),[d,f]=E.useState(!1),[h,m]=E.useState(!1),p=E.useRef(null),y=async T=>{f(!0),m(!1);try{const C=T.target.files&&T.target.files[0];if(!C||!t)throw f(!1),new Error("Image file or userID is missing");const x=await i({fileObject:C,userId:t}),w={thumbnail:x.thumbnailURL,full:x.originalURL};c(w),o(w)}catch{m(!0)}finally{f(!1)}f(!1)},{upload:v=s.formatMessage({id:`${l}cta_upload`}),change:b=s.formatMessage({id:`${l}cta_change`}),uploading:_=s.formatMessage({id:`${l}cta_uploading`})}=(a==null?void 0:a.text)||{};return g.jsxs("div",{className:ee("profile-image-change-figure",e),children:[g.jsx(ka,{className:"profile-image-change-picture",name:n,src:u==null?void 0:u.thumbnail,showInitials:!1,alt:"","data-testid":"profile-picture"}),h&&g.jsx("p",{className:"error text-small",children:s.formatMessage({id:`${l}error`})}),g.jsx("input",{id:"file",type:"file",accept:"image/*",ref:p,onChange:y,hidden:!0,"data-testid":"file-input"}),g.jsx(Ke,{onClick:()=>p.current&&p.current.click(),variant:"secondary","data-gtm-event-context":"ImageField","data-gtm-event-type":`${u?"change-photo":"add-photo"}-click`,className:"gtm-trackable",disabled:d,children:d?_:u?b:v})]})}const kw=({gtm:e,functions:{onSuccess:t=async()=>{},onFailure:n=()=>{}}})=>{const{context:r="FooterContactUsForm",event:i="contact-form-submit-click"}=e||{};return g.jsx(Zi,{id:"contact-us-form",fields:[{id:"name",type:"text",className:"short",validation:[{condition:"required"}],autoComplete:"name"},{id:"email",type:"email",className:"short",validation:[{condition:"required"},{condition:"valid-email"}]},{id:"organisation",type:"text"},{id:"interests",type:"checkboxes",options:[{id:"publishingCourse",label:"Publishing or creating a course"},{id:"buyingCourse",label:"Buying courses for my team"},{id:"learningExperience",label:"Customised learning experiences"},{id:"somethingElse",label:"Something else"}]},{id:"message",type:"textarea",limit:1e3,validation:[{condition:"required"}]}],intlPath:"contactForm",gtm:{context:r,event:i},functions:{onSuccess:t,onFailure:n},button:{className:"new"}})};const CU=({emails:e,setEmails:t,setIsDisabled:n})=>{const{formatMessage:r}=me.useIntl();return g.jsx(OD.ReactMultiEmail,{id:"email-input",inputClassName:"email-input input",placeholder:r({id:"inviteForm_email_placeholder"}),emails:e,onChange:i=>{t(i),n(!i.length)},autoFocus:!1,getLabel:(i,a,o)=>g.jsxs("div",{className:"email text-medium",children:[g.jsx("div",{"data-tag-item":!0,children:i}),g.jsx(Ke,{variant:"tertiary",size:"small",icon:{icon:"close"},onClick:()=>{o(a),n(!e.length)},className:"remove-email-button",screenreaderText:r({id:"overlay_close"})})]},a)})},Sw=({title:e,label:t,messagePlaceholder:n,ctaMessage:r,titleColor:i,labelColor:a,backgroundColor:o,onClose:s,reportError:l,sendInvites:u,initialFormStatus:c="NOT_SUBMITTED",gtm:d={context:"Form",event:"form-submit-click"},secondaryActionButton:f,meta:h})=>{const[m,p]=E.useState([]),[y,v]=E.useState(!0),[b,_]=E.useState(c),{formatMessage:T}=me.useIntl(),C=async P=>{try{await u(m,P.message),p([]),_("SUCCESS")}catch(O){_("ERROR"),l(O)}},x=P=>{P.preventDefault(),_("NOT_SUBMITTED"),v(!0),p([])},w=P=>{P.preventDefault(),s(),_("CLOSED")};return b==="CLOSED"?null:b==="ERROR"||b==="SUCCESS"&&!(h!=null&&h.shouldHideDoneButtonOnSubmit)?g.jsxs("div",{className:"invite-form-wrapper",children:[g.jsx("div",{className:"content centred",children:b==="SUCCESS"?g.jsx("h2",{className:"success-title",children:T({id:"inviteForm_success"})}):g.jsxs("h2",{className:"error-title",children:[" ",T({id:"inviteForm_error"})]})}),g.jsx(fi,{}),g.jsx("div",{className:"footer",children:b==="SUCCESS"?g.jsxs(g.Fragment,{children:[g.jsx(Ke,{variant:"secondary",onClick:x,children:T({id:"inviteForm_ctaSendMoreInvites"})}),g.jsx(Ke,{onClick:w,children:T({id:"inviteForm_ctaDone"})})]}):g.jsx(Ke,{onClick:x,children:T({id:"inviteForm_ctaTryAgain"})})})]}):g.jsxs("div",{className:"invite-form-wrapper",style:{backgroundColor:o},children:[g.jsxs("div",{className:"content",children:[g.jsx("h2",{className:"title",style:{color:i},children:e}),g.jsx("label",{htmlFor:"email-input",className:"label",style:{color:a},children:t})]}),g.jsx(Zi,{id:"invite-form",fields:[{component:CU,props:{emails:m,setEmails:p,setIsDisabled:v},required:!0},{id:"message",type:"textarea",label:T({id:"inviteForm_message_label"}),placeholder:n||T({id:"inviteForm_message_placeholder"})}],functions:{onSuccess:C},button:{text:r,size:"medium",disabled:y},gtm:d,meta:h,secondaryActionButton:f})]})},Dd=e=>e.map(t=>({condition:t}));const Sr={FORM_ID:"manage-account-password-change",NEW_PASSWORD:"newPassword",CONFIRMED_PASSWORD:"confirmedPassword",CURRENT_PASSWORD:"oldPassword"},xU=({functions:e,...t})=>{const{formatMessage:n}=me.useIntl(),[r,i]=E.useState(null),[a,o]=E.useState(!1),[s,l]=E.useState({isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1}),u=h=>h[Sr.NEW_PASSWORD]!==h[Sr.CONFIRMED_PASSWORD]?n({id:"passwordRules_unmatched_text"}):null,c=h=>!eg(h[Sr.NEW_PASSWORD]).isValid,d=[{"data-testid":Sr.NEW_PASSWORD,id:Sr.NEW_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_newPassword_label"}),validation:Dd(["required",c]),functions:{onChange:h=>l(eg(h).matchingRules),onFocus:()=>o(!0),onBlur:()=>o(!1)}},{"data-testid":Sr.CONFIRMED_PASSWORD,id:Sr.CONFIRMED_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_confirmPassword_label"}),validation:Dd(["required",u])}];t.isPasswordChange&&d.unshift({"data-testid":Sr.CURRENT_PASSWORD,id:Sr.CURRENT_PASSWORD,type:"password",autoComplete:"current-password",placeholder:"",label:n({id:"passwordRules_currentPassword_label"}),validation:Dd(["required"])}),a&&d.push({component:tx,props:{matchingRules:s}});const f={id:Sr.FORM_ID,fields:d,functions:{...e,onSuccess:async h=>(e.createPassword(h),e.onSuccess&&e.onSuccess(h)),onCatch:h=>i(h==null?void 0:h.statusCode),onFailure:(h,m)=>{(m.includes(Sr.NEW_PASSWORD)||m.includes(Sr.CONFIRMED_PASSWORD))&&o(!0)}},meta:{shouldReset:!0},...t};return g.jsxs(g.Fragment,{children:[g.jsx(Zi,{...f}),r&&g.jsx(Ui,{variant:"error",text:r})]})};const Dw=({isCreateProfile:e=!1,hooks:t,functions:n,meta:r={},gtm:i,...a})=>{var P;const o=me.useIntl(),s="profileForm_",l=E.useContext(fn),[u,c]=E.useState(l.image),[d,f]=E.useState(!1),{uploadImage:h=()=>{},onSuccess:m=async O=>{},onCancel:p=()=>{},onFailure:y=()=>{}}=n,{buildLocation:v,isValidPlace:b,predictPlaces:_}=t.useMaps(),{context:T="ProfileForm",event:C="profile-form-submit-click"}=i||{},x=[{id:"jobTitle",type:"text",label:o.formatMessage({id:`${s}jobTitle`}),placeholder:o.formatMessage({id:`${s}jobTitle_placeholder`}),value:l.jobTitle,validation:[{condition:"required"}]},{id:"organization",type:"text",label:o.formatMessage({id:`${s}organization`}),placeholder:o.formatMessage({id:`${s}organization_placeholder`}),value:l.organization,validation:[{condition:"required"}]},{id:"location",type:"autocomplete",label:o.formatMessage({id:`${s}location`}),placeholder:o.formatMessage({id:`${s}location_placeholder`}),value:(P=l.location)==null?void 0:P.en,validation:[{condition:"required"},{condition:({location:O})=>O&&!d?!1:!b(O),error:o.formatMessage({id:`${s}location_error`})}],functions:{onChange:()=>{d||f(!0)},onKeyInput:_}}],w=[{component:Aw,props:{userName:l.name,userId:l.id,src:u,uploadImage:h,callback:c,button:{text:{upload:o.formatMessage({id:`${s}image`})}}}},{id:"name",type:"text",label:o.formatMessage({id:`${s}name`}),placeholder:o.formatMessage({id:`${s}name_placeholder`}),value:l.name,autoComplete:"name",validation:[{condition:"required"}]},...x,{id:"biography",type:"textarea",label:o.formatMessage({id:`${s}bio`}),placeholder:o.formatMessage({id:`${s}bio_placeholder`}),limit:1e3,value:l.biography},{component:fi}];return g.jsx(Zi,{id:"profile-details-form",fields:e?x:w,meta:{shouldShowCancelButton:!e,shouldReset:!1,shouldHide:!1,showRequiredLabels:e,...r},intlPath:s,gtm:{context:T,event:C},functions:{onSuccess:async O=>{try{const M={...O,image:u||null,location:d?await v(O==null?void 0:O.location):l.location,...e?{onboardingState:"completed"}:{}};l.updateDetails&&l.updateDetails(R=>({...R,...M})),await m(M)}catch{y()}},onCancel:p,onFailure:y},button:{size:"large",text:{default:o.formatMessage({id:`${s}cta`}),submitting:o.formatMessage({id:`${s}cta_submitting`}),submitted:o.formatMessage({id:`${s}cta_submitted`})}},...a})},wU=()=>{const e=me.useIntl(),[t,n]=E.useState(0);return E.useEffect(()=>{const r=setInterval(()=>{n(i=>{if(i>=95)return clearInterval(r),95;const a=Math.round(Math.random()*10);return Math.min(i+a,95)})},800);return()=>{clearInterval(r)}},[]),g.jsx(m3,{progress:t,steps:{0:{icon:"layers",text:e.formatMessage({id:"publishArticleForm_progressBar"})}}})};function AU({coverImage:e,setShowImagePicker:t}){return e&&e.url?g.jsx(Ui,{className:"cover-image-preview",text:g.jsx(co,{className:"cover-image",image:{description:e.description||"",height:e.height,width:e.width,url:e.url,color:e.color,type:"image/jpeg"}}),button:{component:g.jsx(Ke,{variant:"tertiary",onClick:()=>t(!0),children:g.jsx(me.FormattedMessage,{id:"publishArticleForm_replaceImage_button"})})}}):g.jsx(Ui,{button:{component:g.jsx(Ke,{variant:"secondary",onClick:()=>t(!0),children:g.jsx(me.FormattedMessage,{id:"publishArticleForm_selectImage_button"})})}})}var Ow=(e=>(e.CitiesAndLocalGovernment="topic_CitiesAndLocalGovernment",e.Climate="topic_Climate",e.DigitalAndData="topic_DigitalAndData",e.Education="topic_Education",e.EquityJusticeAndInclusion="topic_EquityJusticeAndInclusion",e.HealthAndSocialCare="topic_HealthAndSocialCare",e.Innovation="topic_Innovation",e.LeadershipAndSkills="topic_LeadershipAndSkills",e.LifeInGovernment="topic_LifeInGovernment",e.Policymaking="topic_Policymaking",e.TransportAndInfrastructure="topic_TransportAndInfrastructure",e.WorkingAndTheEconomy="topic_WorkAndTheEconomy",e))(Ow||{});let ym=null;const un="publishArticleForm_",J2={},eE=10,kU=({id:e="publish-article-form",values:t=J2,setShowImagePicker:n,functions:r,meta:i,gtm:a})=>{var O;const o=me.useIntl(),s=E.useContext(fn),{create:l,onSuccess:u=()=>{},onFailure:c=()=>{}}=r||{},{isInOverlay:d=!1}=i||{},[f,h]=E.useState(!1),[m,p]=E.useState(t.body||""),[y,v]=E.useState(!1),[b,_]=E.useState("");E.useEffect(()=>{cf(t,J2)||yc(t.body)&&t.body!==m&&t.body!==void 0&&p(t.body)},[t.body]);const T=()=>{!s||!s.id?v(o.formatMessage({id:`${un}error_loggedOut`})):y&&v(!1)},C=M=>({condition:R=>{const D=R[M];return!D||typeof D!="string"?!0:D.length<eE},error:o.formatMessage({id:`${un}error_underMinLength`},{length:eE})}),x=!!m&&yc(m),w=()=>g.jsxs(g.Fragment,{children:[g.jsx(fi,{}),g.jsx("p",{className:"text-medium",children:o.formatMessage({id:`${un}disclaimer`})})]}),P=[{id:"title",type:"textarea",value:t.title||"",limit:65,label:o.formatMessage({id:`${un}title_label`}),placeholder:o.formatMessage({id:`${un}title_placeholder`}),styling:{autosizeToFit:!0},functions:{onChange:T},validation:[{condition:"required"},C("title")]},{id:"subtitle",type:"textarea",value:t.subtitle,limit:115,label:o.formatMessage({id:`${un}subtitle_label`}),styling:{autosizeToFit:!0},placeholder:o.formatMessage({id:`${un}subtitle_placeholder`}),functions:{onChange:T},validation:[{condition:"required"},C("subtitle")]},{component:Af,props:{formID:e,label:{visible:o.formatMessage({id:`${un}body_label`})},showLabel:!0}},{component:ky,props:{id:`${e}-input`,value:m,placeholder:o.formatMessage({id:`${un}body_placeholder`}),meta:{isInOverlay:d},autoFocus:!1,functions:{onChange:M=>{p(M),T()}},styling:{toolbar:{showHeadingOption:!0}},"aria-invalid":!!y,"aria-errormessage":"error-message"}},{id:"tags",label:o.formatMessage({id:`${un}tags_label`}),type:"checkboxes",styling:{displayOptionsAsPills:!0},options:Object.values(Ow).map(M=>({id:M,label:o.formatMessage({id:`${un}_tags_${M}`})})),multipleOptions:{limit:3},validation:[{condition:"required",error:o.formatMessage({id:`${un}tags_error_required`})},{condition:M=>{var R;return((R=M==null?void 0:M.tags)==null?void 0:R.length)>3},error:o.formatMessage({id:`${un}tags_error_over_three`})}]},{component:Af,props:{formID:e,label:{visible:o.formatMessage({id:`${un}cover_image_label`})},showLabel:!0}},{component:AU,props:{coverImage:t.coverImage||{},setShowImagePicker:n}}];return f?P.push({component:fi}):P.push({component:w}),g.jsxs("section",{className:"publish-article-form",children:[g.jsx(Zi,{id:e,meta:{shouldReset:!1,shouldHide:!1,showRequiredLabels:!1,shouldScrollOnSuccess:!1},functions:{onSuccess:async M=>{if(!s||!s.id||!x)return;ym&&clearTimeout(ym),h(!0);const R={...M,body:m,coverImage:t.coverImage};try{l&&await l(R),ym=setTimeout(()=>{_(o.formatMessage({id:`${un}aria_success`})),u(R)},500)}catch{v(o.formatMessage({id:`${un}error`})),_(""),c()}},onFailure:c},fields:P,intlPath:un,button:{variant:"primary",size:{mobile:"small",600:"medium"},"data-gtm-event-context":a==null?void 0:a.context,"data-gtm-event-type":"publish-article-click",disabled:!s||!s.id||!x||!((O=t==null?void 0:t.coverImage)!=null&&O.url),text:{default:o.formatMessage({id:`${un}cta_submit`}),submitting:o.formatMessage({id:`${un}cta_submitting`}),submitted:o.formatMessage({id:`${un}cta_submitted`})},customOnSubmit:y?g.jsx(g.Fragment,{}):g.jsx(wU,{})},gtm:a}),y&&g.jsx(gl,{id:"error-message",className:"error",children:typeof y=="string"&&y.includes(" ")?y:o.formatMessage({id:`${un}error`})}),b&&g.jsx(xt,{"aria-live":"polite",showOnFocus:!1,children:b})]})};const Nw=({id:e="search",className:t="",handleToggle:n=!1,defaultValue:r="",gtmContext:i="search-bar",gtmEvent:a="form-submission"})=>{const{searchIsOpen:o=!0,isDesktopVersion:s=!1}=n||{},l=me.useIntl(),u=E.useRef(null);ml(()=>{!n||s||!o||u.current&&u.current.focus()},[o]);const c=d=>{d.preventDefault(),d.stopPropagation(),!(!u.current||!u.current.value||u.current.value.length<1)&&(window.location.href=`/search?search=${encodeURIComponent(u.current.value)}`)};return g.jsx("form",{onSubmit:c,className:ee("search-form gtm-trackable",t),role:"search","data-gtm-event-context":i,"data-gtm-event-type":a,children:g.jsx("fieldset",{id:`${e}-form`,hidden:n?!o:!1,children:g.jsxs("p",{children:[g.jsx(xt,{element:"label",htmlFor:e,children:l.formatMessage({id:"search_label"})}),g.jsx("input",{ref:u,type:"search",id:e,name:e,defaultValue:r,placeholder:l.formatMessage({id:"search_placeholder"}),onKeyDown:d=>{d.key==="Enter"&&c(d)}}),g.jsx("button",{className:"clear",onClick:d=>{d.preventDefault(),d.stopPropagation(),u.current&&u.current.value&&(u.current.value="")},children:g.jsx(xt,{children:l.formatMessage({id:"search_clear"})})}),g.jsx("button",{className:"search",onClick:c,children:g.jsx(xt,{children:l.formatMessage({id:"search_cta"})})})]})})})},tE=async({ref:e,validateEmail:t,dispatch:n})=>{const r=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;if(!e.current.validity.valid||!r.test(e.current.value))return n([{type:"validFields.email",value:!1}]);const i=e.current.value.toString().toLowerCase().trim(),a={valid:!1,autoApproved:!1,exists:{auth:!1,engagement:!1,registration:!1,user:!1}};let o=Object.assign({},a);try{o=await t(i),o===void 0&&(o=a)}catch{return n([{type:"shouldManuallyApprove",value:!0},{type:"emailDetails",value:{email:i,boxType:"nonGov",isEnd2End:!1}},{type:"validFields.email",value:!1}])}const{valid:s=!1,autoApproved:l=!1,exists:u}=o;let c="";return s?c=l?"gov":"nonGov":u.registration?u.engagement&&!u.user?c=u.auth?"verify":"pending":c="exists":u.auth&&(c="exists"),n([{type:"shouldDisableButton",value:!1},{type:"shouldManuallyApprove",value:!l},{type:"emailDetails",value:{email:i,boxType:c,isEnd2End:/testing\+[0-9]+@apolitical.co$/.test(i)}},{type:"validFields.email",value:!0}])},SU=e=>{const t={};for(const n of e.entries())t[n[0]]=n[1];return{name:t.full_name.toString().trim(),email:t.email_address.toString().toLowerCase().trim(),jobTitle:t.job_title,organization:t.organization,bioLink:t.url,optIn:!0,expectation:t.expectation,page:window.location.pathname,"g-recaptcha-response":t["g-recaptcha-response"]}},DU=async({refs:e,dataToSubmit:t,createAccount:n,onSuccess:r,dispatch:i,state:a})=>{if(!e.form||!e.form.current)throw new Error("No refs.form");if(!e.form.current.checkValidity()){e.hiddenValidation&&e.hiddenValidation.current&&e.hiddenValidation.current.click();return}const o=SU(new FormData(e.form.current)),s=Object.assign(o,t);await n(s),sessionStorage.setItem(Sv.SESSION_STORAGE.EMAIL,o.email),r&&r({...o,...a.values}),i([{type:"showSuccessMessage",value:!0}])},OU=({shouldShow:e,placeholders:t,labels:n,functions:{validateEmail:r,resendVerificationCode:i},refs:a,state:o,dispatch:s,dataToSubmit:l,intl:u})=>{const{emailDetails:c}=o,d=(h,m)=>{h.current&&o.validFields[m]!==h.current.validity.valid&&s([{type:`validFields.${m}`,value:h.current.validity.valid}])},f=[{id:"full_name",type:"text",inputRef:a.name,placeholder:u.formatMessage({id:"signup_full_name_placeholder"}),functions:{onChange:()=>d(a.name,"name"),onFocus:()=>s([{type:"loadRecaptcha",value:!0}])},autoComplete:"name",validation:[{condition:"required"},{condition:"no-numbers"}],"data-testid":"signup-name-input"},{id:"email_address",type:"email",inputRef:a.email,placeholder:u.formatMessage({id:"signup_email_address_placeholder"}),"aria-describedby":"email-helper-textbox",functions:{onBlur:()=>{tE({ref:a.email,validateEmail:r,dispatch:s})},onChange:(h,m)=>{s([{type:"shouldDisableButton",value:!0}]),m&&m({type:"updateValue",payload:{key:"terms",value:!1}})},onFocus:()=>s([{type:"loadRecaptcha",value:!0}])},autoComplete:"email",validation:[{condition:"required"},{condition:"valid-email"}],"data-testid":"signup-email-input"},{component:Y3,props:{email:c.email,type:c.boxType,resendVerificationCode:i}}];return o.shouldManuallyApprove&&(f.push({id:"job_title",type:"text",inputRef:a.jobTitle,placeholder:u.formatMessage({id:"signup_job_title_placeholder"}),functions:{onChange:()=>d(a.jobTitle,"jobTitle")},validation:[{condition:"required"}],"data-testid":"signup-job-input"},{id:"organization",type:"text",inputRef:a.organisation,placeholder:u.formatMessage({id:"signup_organization_placeholder"}),functions:{onChange:()=>{d(a.organisation,"organisation")}},validation:[{condition:"required"}],autoComplete:"organization","data-testid":"signup-org-input"}),e.url&&f.push({id:"url",type:"text",label:u.formatMessage({id:"signup_url"},{small:h=>g.jsx("small",{children:h})}),placeholder:u.formatMessage({id:"signup_url_placeholder"}),validation:[{condition:"valid-url"}],"data-testid":"signup-url-input"})),e.expectation&&f.push({id:"expectation",className:"expectation",type:"text",label:(n==null?void 0:n.expectation)||u.formatMessage({id:"signup_expectation"},{small:h=>g.jsx("small",{className:"notes text-small",children:h})}),placeholder:(t==null?void 0:t.expectation)||u.formatMessage({id:"signup_expectation_placeholder"}),"data-testid":"signup-events-question"}),f.push({id:"terms",className:"text-small",type:"checkbox",inputRef:a.tc,label:u.formatMessage({id:"signup_terms"},{terms:h=>g.jsx("a",{href:"https://about.apolitical.co/terms-and-conditions","data-gtm-event-context":"SignupForm","data-gtm-event-type":"terms-of-service-click",className:"gtm-trackable",children:h}),privacy:h=>g.jsx("a",{href:"https://about.apolitical.co/privacy-policy","data-gtm-event-context":"SignupForm","data-gtm-event-type":"privacy-policy-click",className:"gtm-trackable",children:h})}),shownValue:"accepted",functions:{onChange:h=>{if(!h)return;const m=[];["name","email"].forEach(p=>{o.validFields[p]!==a[p].current.validity.valid&&(m.push({type:`validFields.${p}`,value:a[p].current.validity.valid}),p==="email"&&tE({ref:a.email,validateEmail:r,dispatch:s}))}),m.length&&s(m)}},validation:[{condition:"required"}],"data-testid":"signup-terms-checkbox"}),f};const NU=({className:e=""})=>g.jsxs("div",{className:ee("success-message",e),"data-testid":"success-message",children:[g.jsx("p",{className:"success-title",children:g.jsx(me.FormattedMessage,{id:"signup_success_title"})}),g.jsx(me.FormattedMessage,{id:"signup_success_text",values:{p:t=>g.jsx("p",{children:t})}})]});const IU={validFields:{name:!1,email:!1,jobTitle:!1,organisation:!1},emailDetails:{email:"",boxType:"",isEnd2End:!1},shouldManuallyApprove:!1,shouldDisableButton:!0,loadRecaptcha:!1,showSuccessMessage:!1,showError:!1},PU=({className:e="",labels:t={},placeholders:n={},functions:r={validateEmail:()=>Promise.resolve(),createAccount:()=>Promise.resolve(),handleError:()=>{},resendVerificationCode:()=>Promise.resolve()},shouldShow:i={},submitButton:a,dataToSubmit:o={ref:"sign-up-form"},...s})=>{const l=me.useIntl(),u=window.location.pathname.includes("/signup")?"/login":`/login?returnTo=${window.location.pathname}`,{title:c=!0,expectation:d=!1,url:f=!0,logInButton:h=!0,successMessage:m=!0}=i,p={title:c,expectation:d,url:f,logInButton:h,successMessage:m},[y,v]=E.useReducer(Rl,IU),{validFields:b,emailDetails:_,shouldManuallyApprove:T,shouldDisableButton:C,showSuccessMessage:x,showError:w}=y,[P,O]=wv.useCookies(["signup-this-session","functional-cookie-consent"]),M={form:E.createRef(),name:E.createRef(),email:E.createRef(),jobTitle:E.createRef(),organisation:E.createRef(),tc:E.createRef(),hiddenValidation:E.createRef()};E.useEffect(()=>{T===!0&&M.jobTitle.current&&M.jobTitle.current.focus()},[T]),E.useEffect(()=>{P["signup-this-session"]&&v([{type:"showSuccessMessage",value:!0}])},[P]),E.useEffect(()=>{x&&P["functional-cookie-consent"]&&O("signup-this-session","true",{path:"/",maxAge:3600})},[x]);const R=E.useMemo(()=>OU({placeholders:n,labels:t,shouldShow:p,functions:r,refs:M,state:y,dispatch:v,dataToSubmit:o,intl:l}),[o,r,l,M,p,y]),D=C?!0:T?!Object.values(b).every(S=>S===!0):!b.name||!b.email||["exists","pending","verify"].includes(_.boxType);return p.successMessage&&x?g.jsx(NU,{className:e}):g.jsxs("fieldset",{className:ee("signup-form-fieldset",e),"data-testid":"signup-form",children:[p.title&&g.jsx("p",{className:"signup-title",children:g.jsx(me.FormattedMessage,{id:"signup_title"})}),w&&g.jsx(Ui,{variant:"error",text:l.formatMessage({id:"signup_error"})}),g.jsx(Zi,{className:"signup-form",formRef:M.form,id:"sign-up-form",fields:R,intlPath:"signup",button:{variant:"primary",size:"medium",text:a||l.formatMessage({id:"signup_button_join"}),disabled:D?{isClickable:!0}:!1,styling:{fullWidth:!0},"data-testid":"signup-button"},secondaryActionButton:{className:"login-button",styling:{fullWidth:!0},variant:"tertiary",size:"medium",href:u,"data-gtm-event-context":"SignupForm","data-gtm-event-type":"login-click",text:l.formatMessage({id:"signup_button_login"})},meta:{shouldReset:!1,showRequiredLabels:!1,shouldShowCancelButton:p.logInButton},gtm:{context:"SignupForm",event:"signup-submit-click"},functions:{onSuccess:async()=>{await DU({refs:M,dataToSubmit:o,createAccount:r.createAccount,onSuccess:r.onSuccess,dispatch:v,state:y})},onCatch:S=>{r.handleError(S),v([{type:"showSuccessMessage",value:!1},{type:"showError",value:!0}])}}}),g.jsx("button",{className:"validation-button",ref:M.hiddenValidation})]})};const mo=({children:e,className:t="",styling:n={},...r})=>{const{background:i="default",padding:a="none"}=n;return g.jsx("section",{className:ee("full-width-section",t,{[i]:i!=="default",[a]:a!=="none"}),...r,children:e})};const RU=({text:e,buttons:t,className:n=""})=>{const r=[];return t.forEach(i=>{r.push({href:i.link,variant:"secondary",size:{mobile:"medium",1024:"large"},className:"gtm-trackable new","data-gtm-event-type":"download-click","data-gtm-event-context":i.eventContext||"Download",target:"_blank",children:i.text})}),g.jsx(mo,{className:ee("download-section",n),styling:{background:"dark"},children:g.jsxs("div",{className:"content-default",children:[E.createElement(typeof e=="string"?"h2":e.element,{className:"text"},typeof e=="string"?e:e.text),g.jsx(Fl,{buttons:r})]})})};const Og="editSection_";function Iw({href:e,setShowModal:t}){typeof e!="string"&&t(!0)}const FU=({icon:e,description:t,ctaMessage:n,href:r,showEditButton:i,setShowModal:a})=>{const{formatMessage:o}=me.useIntl();return g.jsxs(Er,{variant:"muted",icon:e,children:[g.jsx("p",{children:t||o({id:`${Og}placeholder_description`})}),i&&g.jsx("p",{children:g.jsx(Ke,{href:r,variant:"secondary",size:"small",onClick:()=>Iw({href:r,setShowModal:a}),children:n||o({id:`${Og}placeholder_cta`})})})]})},MU=({children:e,className:t="",formProps:n,formComponent:r,href:i,title:a,showTitle:o=!0,modalTitle:s,placeholder:l,showDivider:u=!0})=>{const{formatMessage:c}=me.useIntl(),[d,f]=E.useState(!1),h=()=>f(!1),m=!!n||!!r,p=typeof i=="string"||m;let y;return r&&(y=E.cloneElement(r,{functions:{...r.props.functions,onSuccess:async v=>{try{r.props.functions.onSuccess&&await r.props.functions.onSuccess(v)}finally{h()}},onCancel:()=>{r.props.functions.onCancel&&r.props.functions.onCancel(),h()}}})),g.jsxs("section",{className:ee("edit-section",t),children:[m&&g.jsx(Sa,{title:s||`Edit ${a}`,isOpen:d,showDivider:!1,showIcon:!1,functions:{onClose:h},className:ee("edit-section-modal"),children:y||(n?g.jsx(Zi,{...n,fields:n.fields,meta:{...n==null?void 0:n.meta,shouldShowCancelButton:!0,shouldReset:!1,showSuccessMessage:!0},functions:{...n==null?void 0:n.functions,onSuccess:async v=>{var b,_;(b=n==null?void 0:n.functions)!=null&&b.onSuccess&&await((_=n==null?void 0:n.functions)==null?void 0:_.onSuccess(v)),f(!1)},onCancel:h}}):g.jsx(g.Fragment,{}))}),g.jsxs("div",{className:ee("edit-section-header",{"no-title":!o}),children:[o&&g.jsx("h2",{className:"edit-section-header-title",children:a}),p&&g.jsx(Ke,{href:i,variant:"tertiary",size:"small",icon:"pencil",onClick:()=>Iw({href:i,setShowModal:f}),children:c({id:`${Og}edit`})})]}),e||g.jsx(FU,{...l,href:i,setShowModal:f,showEditButton:p}),u&&g.jsx(fi,{})]})};const BU=({title:e=!1,text:t,logos:n=[],styling:r={},className:i=""})=>{const a=n.length;if(a===0)return null;const o={element:typeof e=="object"?e.element:"h2",text:typeof e=="string"?e:typeof e=="object"?e.text:"",className:typeof e=="object"?e.className:""},{wrapLogos:s=!1,align:l="center",display:u="block"}=r;return g.jsxs("div",{className:ee("logos",i,`align-${l}`,{[u]:u!=="block","wrap-logos":s}),children:[e&&E.createElement(o.element,{className:ee("title",o.className)},o.text),t&&g.jsx("p",{children:t}),g.jsx("ul",{className:ee({"two-col":a===2||a===4,"three-col":a===5||a<=10&&a%3===0}),children:n.map(({logo:c,nameOfBusiness:d,link:f=!1,description:h=!1},m)=>{if(!c||!c.url)return null;const p=g.jsx("img",{src:c.url,width:c.width||"auto",height:c.height||"auto",alt:d});return g.jsxs("li",{children:[g.jsx("p",{className:"img-wrapper",children:f?g.jsx("a",{href:f,target:"_blank",rel:"nofollow noreferrer noopener",children:p}):p}),h&&g.jsx("small",{children:h})]},window.btoa(`${c.url}_${m}`))})})]})};let bm;const Em="contactFooter_",LU=({onSuccess:e=async()=>{},onFailure:t=()=>{}})=>{const n=E.useRef(null),[r,i]=E.useState(0),[a,o]=E.useState(!1),s=()=>{n.current&&i(n.current.clientHeight)},l=()=>{a||(o(!0),clearTimeout(bm),bm=setTimeout(()=>{s(),o(!1)},500))};return E.useEffect(()=>(s(),window.addEventListener("resize",l),()=>{clearTimeout(bm),window.removeEventListener("resize",l)}),[]),g.jsx(mo,{id:"contactForm",className:"contact-footer",children:g.jsxs("div",{className:"inner-wrapper",children:[g.jsx("h2",{children:g.jsx(me.FormattedMessage,{id:`${Em}title`})}),g.jsxs("div",{className:"content-wrapper",ref:n,"data-testid":"content-wrapper",style:a?{}:{minHeight:r},children:[g.jsxs("aside",{children:[g.jsx("p",{children:g.jsx(me.FormattedMessage,{id:`${Em}text`})}),g.jsx(fo,{className:"mailto-link",href:"mailto:hello@apolitical.co",children:g.jsx(me.FormattedMessage,{id:`${Em}email`})})]}),g.jsx(kw,{functions:{onSuccess:e,onFailure:t},gtm:{context:"FooterContactUsForm",event:"contact-form-submit-click"}})]})]})})},$U=({activeLink:e,profile:t,...n})=>g.jsx(mo,{children:g.jsx(K3,{layout:"1-3",children:g.jsxs(g.Fragment,{children:[g.jsx(W3,{activeLink:e,profile:t}),g.jsx(d3,{...n})]})})});const _m="cookieBanner_",Tm=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],Cm=new Date(Date.now()+12*30*24*60*60*1e3),Pw=()=>{const e=me.useIntl(),[t,n,r]=wv.useCookies(Tm),[i,a]=E.useState(!t["apol-cookie-banner"]),o=()=>{Tm.forEach(c=>{n(c,!0,{path:"/",expires:Cm,domain:c==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),a(!1),window.location.reload()},s=()=>{n("apol-cookie-banner",!0,{path:"/",expires:Cm}),Tm.forEach(c=>{if(c==="apol-cookie-banner"){n(c,!0,{path:"/",expires:Cm});return}r(c)}),a(!1)};if(!i)return null;const l=[{id:"settings",href:"/pages/cookie-policy",gtmType:"policy-page"},{id:"reject",onClick:s,gtmType:"reject-all"},{id:"accept",onClick:o,gtmType:"accepted-all"}],u=[];return l.forEach(c=>{u.push({variant:c.href?"tertiary":"primary",href:c.href,onClick:c.onClick,className:"gtm-trackable","data-gtm-event-context":"cookie-banner","data-gtm-event-type":`cookie-${c.gtmType}-click`,children:e.formatMessage({id:`${_m}buttons_${c.id}`})})}),g.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[g.jsx("h6",{children:e.formatMessage({id:`${_m}title`})}),g.jsx("p",{children:e.formatMessage({id:`${_m}text`})}),g.jsx(Fl,{buttons:u})]})},ga={platform:{order:["events","courses","articles","communities"],events:{href:"/events/",gtmType:"events-click"},courses:{href:"/microcourses/",gtmType:"microcourses-click"},articles:{href:"/solution-articles/",gtmType:"articles-click"},communities:{href:"/communities/",gtmType:"communities-click"}},community:{order:["support","post","join","guidelines"],support:{name:"Support FAQ",href:"/pages/support-faq",gtmType:"support-faq-click"},post:{href:"/pages/post-an-article",gtmType:"post-an-article-click"},join:{href:"/pages/who-can-join-the-community",gtmType:"who-can-join-click"},guidelines:{href:"/pages/values-and-guidelines",gtmType:"guidelines-and-values-click"}},company:{order:["news","insights","story","team","careers","partner","contact"],news:{href:"/learning-hub/updates/",gtmType:"news-click"},insights:{href:"/learning-hub/global-insights/",gtmType:"insights-click"},story:{href:"/pages/our-story",gtmType:"our-story-click"},team:{href:"/pages/meet-our-team",gtmType:"team-click"},careers:{href:"/pages/careers",gtmType:"careers-click"},partner:{href:"/partnerships/",gtmType:"partner-with-us-click"},contact:{href:"/pages/get-in-touch",gtmType:"contact-click"},child:"legal"},legal:{order:["privacy","terms","cookie","accessibility","ai"],privacy:{href:"https://about.apolitical.co/privacy-policy",gtmType:"privacy-policy-link"},terms:{href:"https://about.apolitical.co/terms-and-conditions",gtmType:"terms-conditions-link"},cookie:{href:"/pages/cookie-policy",gtmType:"cookie-policy-link"},ai:{href:"/pages/ai-principles",gtmType:"ai-principles-link"},accessibility:{href:"/pages/accessibility-statement",gtmType:"accessibility-link"},text:{order:["dataProtection","euDataProtection"],dataProtection:{email:zs["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:zs["data-protection"].eu,gtmType:"email-eu-dpo-link"}}},contact:{text:{order:["london","washington","berlin","registered","support","business"],london:{address:!0},washington:{address:!0},registered:{address:!0},berlin:{address:!0},support:{email:zs.support,gtmType:"concierge-email-click"},business:{email:zs.general,gtmType:"hello-email-click"}}},social:{order:["linkedin","twitter","facebook"],linkedin:{href:"https://www.linkedin.com/company/apolitical"},twitter:{href:"https://twitter.com/apoliticalco"},facebook:{href:"https://www.facebook.com/apoliticalco"}}};const Ys="footer_",Sf="SiteFooter",nE=({group:e})=>{const t=ga[e].order||[];let n=!1;return"text"in ga[e]&&(n=ga[e].text),g.jsxs(E.Fragment,{children:[g.jsx("p",{className:"pre-title",children:g.jsx(me.FormattedMessage,{id:`${Ys}${e}`})}),Array.isArray(t)&&t.length>0&&g.jsx("ul",{className:"text-medium",children:t.map(r=>{if(["order","child","text"].includes(r))return null;const{href:i,gtmType:a}=ga[e][r],o={};return["legal"].includes(e)&&(o.target="_blank",o.rel="noopener"),g.jsx("li",{children:g.jsx("a",{href:i,className:"gtm-trackable","data-gtm-event-context":Sf,"data-gtm-event-type":a,...o,children:g.jsx(me.FormattedMessage,{id:`${Ys}${e}_${r}`})})},`${e}_${r}`)})}),typeof n!="boolean"&&"order"in n&&Array.isArray(n.order)&&g.jsx("dl",{className:"text-medium",children:n.order.map(r=>g.jsxs(E.Fragment,{children:[g.jsx("dt",{children:g.jsx(me.FormattedMessage,{id:`${Ys}${e}_${r}`})}),g.jsxs("dd",{children:[typeof n!="boolean"&&n[r].address&&g.jsx("address",{children:g.jsx(me.FormattedMessage,{id:`${Ys}${e}_${r}_address`,values:{br:g.jsx("br",{})}})}),typeof n!="boolean"&&n[r].email&&g.jsx("a",{href:`mailto:${n[r].email}`,className:"gtm-trackable","data-gtm-event-context":Sf,"data-gtm-event-type":n[r].gtmType,children:n[r].email})]})]},`dl-${e}-${r}`))})]},e)},Sy=()=>g.jsx("div",{id:"footer",children:g.jsxs("div",{className:"wrapper",children:[g.jsx(mh,{element:"hr"}),g.jsx(Xv,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":Sf,"data-gtm-event-type":"logo-homepage-link"}),g.jsx("footer",{children:["platform","community","company","contact"].map(e=>g.jsxs("div",{className:"group",children:[g.jsx(nE,{group:e}),Object.keys(ga[e]).includes("child")&&g.jsx(nE,{group:ga[e].child})]},e))}),g.jsx("hr",{}),g.jsxs("div",{className:"sub-footer",children:[g.jsx("ul",{children:Array.isArray(ga.social.order)&&ga.social.order.map(e=>{const t=ga.social[e];return g.jsx("li",{className:e,children:g.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":Sf,"data-gtm-event-type":"social-click",children:g.jsx("span",{className:"hidden",children:g.jsx(me.FormattedMessage,{id:`${Ys}social_${e}`})})})},e)})}),g.jsx("small",{children:g.jsx(me.FormattedMessage,{id:`${Ys}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})});var jU=Object.defineProperty,HU=Object.defineProperties,UU=Object.getOwnPropertyDescriptors,Df=Object.getOwnPropertySymbols,Rw=Object.prototype.hasOwnProperty,Fw=Object.prototype.propertyIsEnumerable,Mw=e=>{throw TypeError(e)},rE=(e,t,n)=>t in e?jU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ye=(e,t)=>{for(var n in t||(t={}))Rw.call(t,n)&&rE(e,n,t[n]);if(Df)for(var n of Df(t))Fw.call(t,n)&&rE(e,n,t[n]);return e},an=(e,t)=>HU(e,UU(t)),Dy=(e,t)=>{var n={};for(var r in e)Rw.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Df)for(var r of Df(e))t.indexOf(r)<0&&Fw.call(e,r)&&(n[r]=e[r]);return n},Oy=(e,t,n)=>t.has(e)||Mw("Cannot "+n),oe=(e,t,n)=>(Oy(e,t,"read from private field"),n?n.call(e):t.get(e)),Ge=(e,t,n)=>t.has(e)?Mw("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Qe=(e,t,n,r)=>(Oy(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Of=(e,t,n)=>(Oy(e,t,"access private method"),n),Ve=(e,t,n)=>new Promise((r,i)=>{var a=l=>{try{s(n.next(l))}catch(u){i(u)}},o=l=>{try{s(n.throw(l))}catch(u){i(u)}},s=l=>l.done?r(l.value):Promise.resolve(l.value).then(a,o);s((n=n.apply(e,t)).next())});function Bw(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(i){i(n)}),(r=e.get("*"))&&r.slice().map(function(i){i(t,n)})}}}const Vi=Object.create(null);Vi.open="0";Vi.close="1";Vi.ping="2";Vi.pong="3";Vi.message="4";Vi.upgrade="5";Vi.noop="6";const Od=Object.create(null);Object.keys(Vi).forEach(e=>{Od[Vi[e]]=e});const Ng={type:"error",data:"parser error"},Lw=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",$w=typeof ArrayBuffer=="function",jw=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Dh=({type:e,data:t},n,r)=>Lw&&t instanceof Blob?n?r(t):iE(t,r):$w&&(t instanceof ArrayBuffer||jw(t))?n?r(t):iE(new Blob([t]),r):r(Vi[e]+(t||"")),iE=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function aE(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let xm;function zU(e,t){if(Lw&&e.data instanceof Blob)return e.data.arrayBuffer().then(aE).then(t);if($w&&(e.data instanceof ArrayBuffer||jw(e.data)))return t(aE(e.data));Dh(e,!1,n=>{xm||(xm=new TextEncoder),t(xm.encode(n))})}const oE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Pu=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<oE.length;e++)Pu[oE.charCodeAt(e)]=e;const VU=e=>{let t=e.length*.75,n=e.length,r,i=0,a,o,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),c=new Uint8Array(u);for(r=0;r<n;r+=4)a=Pu[e.charCodeAt(r)],o=Pu[e.charCodeAt(r+1)],s=Pu[e.charCodeAt(r+2)],l=Pu[e.charCodeAt(r+3)],c[i++]=a<<2|o>>4,c[i++]=(o&15)<<4|s>>2,c[i++]=(s&3)<<6|l&63;return u},qU=typeof ArrayBuffer=="function",Oh=(e,t)=>{if(typeof e!="string")return{type:"message",data:Hw(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:WU(e.substring(1),t)}:Od[n]?e.length>1?{type:Od[n],data:e.substring(1)}:{type:Od[n]}:Ng},WU=(e,t)=>{if(qU){const n=VU(e);return Hw(n,t)}else return{base64:!0,data:e}},Hw=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Uw=String.fromCharCode(30),zw=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((a,o)=>{Dh(a,!1,s=>{r[o]=s,++i===n&&t(r.join(Uw))})})},Vw=(e,t)=>{const n=e.split(Uw),r=[];for(let i=0;i<n.length;i++){const a=Oh(n[i],t);if(r.push(a),a.type==="error")break}return r};function qw(){return new TransformStream({transform(e,t){zU(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const a=new DataView(i.buffer);a.setUint8(0,126),a.setUint16(1,r)}else{i=new Uint8Array(9);const a=new DataView(i.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let wm;function O1(e){return e.reduce((t,n)=>t+n.length,0)}function N1(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function Ww(e,t){wm||(wm=new TextDecoder);const n=[];let r=0,i=-1,a=!1;return new TransformStream({transform(o,s){for(n.push(o);;){if(r===0){if(O1(n)<1)break;const l=N1(n,1);a=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(O1(n)<2)break;const l=N1(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(O1(n)<8)break;const l=N1(n,8),u=new DataView(l.buffer,l.byteOffset,l.length),c=u.getUint32(0);if(c>Math.pow(2,53-32)-1){s.enqueue(Ng);break}i=c*Math.pow(2,32)+u.getUint32(4),r=3}else{if(O1(n)<i)break;const l=N1(n,i);s.enqueue(Oh(a?l:wm.decode(l),t)),r=0}if(i===0||i>e){s.enqueue(Ng);break}}}})}const Nh=4;function Jt(e){if(e)return KU(e)}function KU(e){for(var t in Jt.prototype)e[t]=Jt.prototype[t];return e}Jt.prototype.on=Jt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Jt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Jt.prototype.off=Jt.prototype.removeListener=Jt.prototype.removeAllListeners=Jt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Jt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};Jt.prototype.emitReserved=Jt.prototype.emit;Jt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Jt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Br=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function Kw(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const GU=Br.setTimeout,YU=Br.clearTimeout;function Ih(e,t){t.useNativeTimers?(e.setTimeoutFn=GU.bind(Br),e.clearTimeoutFn=YU.bind(Br)):(e.setTimeoutFn=Br.setTimeout.bind(Br),e.clearTimeoutFn=Br.clearTimeout.bind(Br))}const ZU=1.33;function QU(e){return typeof e=="string"?XU(e):Math.ceil((e.byteLength||e.size)*ZU)}function XU(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function JU(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function ez(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let a=n[r].split("=");t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}let tz=class extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}},Ny=class extends Jt{constructor(t){super(),this.writable=!1,Ih(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new tz(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Oh(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=JU(t);return n.length?"?"+n:""}};const Gw="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Ig=64,nz={};let sE=0,I1=0,lE;function uE(e){let t="";do t=Gw[e%Ig]+t,e=Math.floor(e/Ig);while(e>0);return t}function Yw(){const e=uE(+new Date);return e!==lE?(sE=0,lE=e):e+"."+uE(sE++)}for(;I1<Ig;I1++)nz[Gw[I1]]=I1;let Zw=!1;try{Zw=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const rz=Zw;function Qw(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||rz))return new XMLHttpRequest}catch{}if(!t)try{return new Br[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function iz(){}const az=function(){return new Qw({xdomain:!1}).responseType!=null}();let oz=class extends Ny{constructor(t){if(super(t),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let i=location.port;i||(i=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||i!==t.port}const n=t&&t.forceBase64;this.supportsBinary=az&&!n,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Vw(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,zw(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Yw()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new nl(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,a)=>{this.onError("xhr post error",i,a)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}},nl=class Nd extends Jt{constructor(t,n){super(),Ih(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.data=n.data!==void 0?n.data:null,this.create()}create(){var t;const n=Kw(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new Qw(n);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this.opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this.opts.cookieJar)===null||i===void 0||i.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},r.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=Nd.requestsCount++,Nd.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=iz,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Nd.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}};nl.requestsCount=0;nl.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",cE);else if(typeof addEventListener=="function"){const e="onpagehide"in Br?"pagehide":"unload";addEventListener(e,cE,!1)}}function cE(){for(let e in nl.requests)nl.requests.hasOwnProperty(e)&&nl.requests[e].abort()}const Iy=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),P1=Br.WebSocket||Br.MozWebSocket,dE=!0,sz="arraybuffer",fE=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";let lz=class extends Ny{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=fE?{}:Kw(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=dE&&!fE?n?new P1(t,n):new P1(t):new P1(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;Dh(r,this.supportsBinary,a=>{const o={};try{dE&&this.ws.send(a)}catch{}i&&Iy(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Yw()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}check(){return!!P1}},uz=class extends Ny{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(t=>{const n=Ww(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=qw();i.readable.pipeTo(t.writable),this.writer=i.writable.getWriter();const a=()=>{r.read().then(({done:s,value:l})=>{s||(this.onPacket(l),a())}).catch(s=>{})};a();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this.writer.write(o).then(()=>this.onOpen())})}))}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this.writer.write(r).then(()=>{i&&Iy(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this.transport)===null||t===void 0||t.close()}};const cz={websocket:lz,webtransport:uz,polling:oz},dz=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,fz=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Pg(e){if(e.length>2e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=dz.exec(e||""),a={},o=14;for(;o--;)a[fz[o]]=i[o]||"";return n!=-1&&r!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=hz(a,a.path),a.queryKey=pz(a,a.query),a}function hz(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function pz(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,a){i&&(n[i]=a)}),n}let Xw=class Fs extends Jt{constructor(t,n={}){super(),this.binaryType=sz,this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=Pg(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=Pg(n.host).host),Ih(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=ez(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Nh,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new cz[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Fs.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;Fs.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Fs.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(c(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function a(){r||(r=!0,c(),n.close(),n=null)}const o=d=>{const f=new Error("probe error: "+d);f.transport=n.name,a(),this.emitReserved("upgradeError",f)};function s(){o("transport closed")}function l(){o("socket closed")}function u(d){n&&d.name!==n.name&&a()}const c=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",o),n.once("close",s),this.once("close",l),this.once("upgrading",u),this.upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onOpen(){if(this.readyState="open",Fs.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let t=0;const n=this.upgrades.length;for(;t<n;t++)this.probe(this.upgrades[t])}}onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),this.resetPingTimeout(),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=t.data,this.onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=QU(i)),r>0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const a={type:t,data:n,options:r};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){Fs.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;r<i;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}};Xw.protocol=Nh;function mz(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Pg(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const a=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port+t,r.href=r.protocol+"://"+a+(n&&n.port===r.port?"":":"+r.port),r}const gz=typeof ArrayBuffer=="function",vz=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Jw=Object.prototype.toString,yz=typeof Blob=="function"||typeof Blob<"u"&&Jw.call(Blob)==="[object BlobConstructor]",bz=typeof File=="function"||typeof File<"u"&&Jw.call(File)==="[object FileConstructor]";function Py(e){return gz&&(e instanceof ArrayBuffer||vz(e))||yz&&e instanceof Blob||bz&&e instanceof File}function Id(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Id(e[n]))return!0;return!1}if(Py(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Id(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Id(e[n]))return!0;return!1}function Ez(e){const t=[],n=e.data,r=e;return r.data=Rg(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Rg(e,t){if(!e)return e;if(Py(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Rg(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Rg(e[r],t));return n}return e}function _z(e,t){return e.data=Fg(e.data,t),delete e.attachments,e}function Fg(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Fg(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Fg(e[n],t));return e}const Tz=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Cz=5;var et;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(et||(et={}));class xz{constructor(t){this.replacer=t}encode(t){return(t.type===et.EVENT||t.type===et.ACK)&&Id(t)?this.encodeAsBinary({type:t.type===et.EVENT?et.BINARY_EVENT:et.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===et.BINARY_EVENT||t.type===et.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=Ez(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function hE(e){return Object.prototype.toString.call(e)==="[object Object]"}class Ry extends Jt{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===et.BINARY_EVENT;r||n.type===et.BINARY_ACK?(n.type=r?et.EVENT:et.ACK,this.reconstructor=new wz(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Py(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(et[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===et.BINARY_EVENT||r.type===et.BINARY_ACK){const a=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(a,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(o)}if(t.charAt(n+1)==="/"){const a=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(a,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const a=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}r.id=Number(t.substring(a,n+1))}if(t.charAt(++n)){const a=this.tryParse(t.substr(n));if(Ry.isPayloadValid(r.type,a))r.data=a;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case et.CONNECT:return hE(n);case et.DISCONNECT:return n===void 0;case et.CONNECT_ERROR:return typeof n=="string"||hE(n);case et.EVENT:case et.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&Tz.indexOf(n[0])===-1);case et.ACK:case et.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class wz{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=_z(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const e7=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Ry,Encoder:xz,get PacketType(){return et},protocol:Cz},Symbol.toStringTag,{value:"Module"}));function si(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Az=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});let t7=class extends Jt{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[si(t,"open",this.onopen.bind(this)),si(t,"packet",this.onpacket.bind(this)),si(t,"error",this.onerror.bind(this)),si(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(Az.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:et.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const o=this.ids++,s=n.pop();this._registerAckCallback(o,s),r.id=o}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===t&&this.sendBuffer.splice(o,1);n.call(this,new Error("operation has timed out"))},i);this.acks[t]=(...o)=>{this.io.clearTimeoutFn(a),n.apply(this,[null,...o])}}emitWithAck(t,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((i,a)=>{n.push((o,s)=>r?o?a(o):i(s):i(o)),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...a)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...a)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:et.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case et.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case et.EVENT:case et.BINARY_EVENT:this.onevent(t);break;case et.ACK:case et.BINARY_ACK:this.onack(t);break;case et.DISCONNECT:this.ondisconnect();break;case et.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:et.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:et.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}};function jl(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}jl.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};jl.prototype.reset=function(){this.attempts=0};jl.prototype.setMin=function(e){this.ms=e};jl.prototype.setMax=function(e){this.max=e};jl.prototype.setJitter=function(e){this.jitter=e};let Mg=class extends Jt{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Ih(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new jl({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||e7;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Xw(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=si(n,"open",function(){r.onopen(),t&&t()}),a=s=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",s),t?t(s):this.maybeReconnectOnOpen()},o=si(n,"error",a);if(this._timeout!==!1){const s=this._timeout,l=this.setTimeoutFn(()=>{i(),a(new Error("timeout")),n.close()},s);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(si(t,"ping",this.onping.bind(this)),si(t,"data",this.ondata.bind(this)),si(t,"error",this.onerror.bind(this)),si(t,"close",this.onclose.bind(this)),si(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Iy(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new t7(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}};const cu={};function Pd(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=mz(e,t.path||"/socket.io"),r=n.source,i=n.id,a=n.path,o=cu[i]&&a in cu[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return s?l=new Mg(r,t):(cu[i]||(cu[i]=new Mg(r,t)),l=cu[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Pd,{Manager:Mg,Socket:t7,io:Pd,connect:Pd});var Co=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(c){try{u(r.next(c))}catch(d){o(d)}}function l(c){try{u(r.throw(c))}catch(d){o(d)}}function u(c){c.done?a(c.value):i(c.value).then(s,l)}u((r=r.apply(e,t||[])).next())})};const kz="v1",Sz="https://api.novu.co",Dz="@novu/client",Oz="2.0.0-canary.0",Nz=`${Dz}-${Oz}`;class Iz{constructor({apiVersion:t=kz,backendUrl:n=Sz,userAgent:r=Nz}={}){this.apiVersion=t,this.backendUrl=`${n}/${this.apiVersion}`,this.headers={"Content-Type":"application/json","User-Agent":r}}setAuthorizationToken(t){this.headers.Authorization=`Bearer ${t}`}disposeAuthorizationToken(){delete this.headers.Authorization}updateHeaders(t){this.headers=Object.assign(Object.assign({},this.headers),t)}getFullResponse(t,n){return Co(this,void 0,void 0,function*(){return yield(yield this.doFetch(t+this.getQueryString(n))).json()})}get(t,n){return Co(this,void 0,void 0,function*(){return(yield(yield this.doFetch(t+this.getQueryString(n))).json()).data})}post(t,n={}){return Co(this,void 0,void 0,function*(){return(yield(yield this.doFetch(t,{method:"POST",body:JSON.stringify(n)})).json()).data})}patch(t,n={}){return Co(this,void 0,void 0,function*(){return(yield(yield this.doFetch(t,{method:"PATCH",body:JSON.stringify(n)})).json()).data})}delete(t,n={}){return Co(this,void 0,void 0,function*(){return(yield(yield this.doFetch(t,{method:"DELETE",body:JSON.stringify(n)})).json()).data})}getQueryString(t){return t?"?"+new URLSearchParams(t).toString():""}doFetch(t,n={}){return Co(this,void 0,void 0,function*(){try{const r=yield fetch(this.backendUrl+t,Object.assign(Object.assign({},n),{headers:this.headers}));return yield this.checkResponseStatus(r),r}catch(r){throw r}})}checkResponseStatus(t){return Co(this,void 0,void 0,function*(){if(!t.ok){const n=yield t.json();throw new Error(`HTTP error! Status: ${t.status}, Message: ${n.message}`)}})}}globalThis&&globalThis.__awaiter;globalThis&&globalThis.__rest;var Pz=(e,t)=>e===t?!0:!e||!t||e.length!==t.length?!1:e.every((n,r)=>n===t[r]),n7=(e,t)=>Pz(e,t)||!e&&(t==null?void 0:t.length)===0||(e==null?void 0:e.length)===0&&!t,Nf=(e,t)=>n7(e.tags,t.tags)&&e.read===t.read&&e.archived===t.archived,Ms,Rz=class{constructor(){Ge(this,Ms),Qe(this,Ms,Bw())}on(e,t){return oe(this,Ms).on(e,t),()=>{this.off(e,t)}}off(e,t){oe(this,Ms).off(e,t)}emit(e,t){oe(this,Ms).emit(e,t)}};Ms=new WeakMap;var or=class extends Error{constructor(e,t){super(e),this.originalError=t}},Fo,Ru,Fy=class{constructor({inboxServiceInstance:e,eventEmitterInstance:t}){Ge(this,Fo,[]),Ge(this,Ru),this._emitter=t,this._inboxService=e,this._emitter.on("session.initialize.resolved",({error:n,data:r})=>{r?(this.onSessionSuccess(r),oe(this,Fo).forEach(i=>Ve(this,[i],function*({fn:a,resolve:o}){o(yield a())})),Qe(this,Fo,[])):n&&(this.onSessionError(n),Qe(this,Ru,n),oe(this,Fo).forEach(({resolve:i})=>{i({error:new or("Failed to initialize session, please contact the support",n)})}),Qe(this,Fo,[]))})}onSessionSuccess(e){}onSessionError(e){}callWithSession(e){return Ve(this,null,function*(){return this._inboxService.isSessionInitialized?e():oe(this,Ru)?Promise.resolve({error:new or("Failed to initialize session, please contact the support",oe(this,Ru))}):new Promise((t,n)=>{oe(this,Fo).push({fn:e,resolve:t,reject:n})})})}};Fo=new WeakMap;Ru=new WeakMap;var mr,ni,Gr=class{constructor(t,n,r){Ge(this,mr),Ge(this,ni),Qe(this,mr,n),Qe(this,ni,r),this.id=t.id,this.subject=t.subject,this.body=t.body,this.to=t.to,this.isRead=t.isRead,this.isArchived=t.isArchived,this.createdAt=t.createdAt,this.readAt=t.readAt,this.archivedAt=t.archivedAt,this.avatar=t.avatar,this.primaryAction=t.primaryAction,this.secondaryAction=t.secondaryAction,this.channelType=t.channelType,this.tags=t.tags,this.redirect=t.redirect,this.data=t.data}read(){return r7({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this}})}unread(){return i7({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this}})}archive(){return a7({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this}})}unarchive(){return o7({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this}})}completePrimary(){if(!this.primaryAction)throw new Error("Primary action is not available");return If({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this},actionType:"primary"})}completeSecondary(){if(!this.primaryAction)throw new Error("Secondary action is not available");return If({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this},actionType:"secondary"})}revertPrimary(){if(!this.primaryAction)throw new Error("Primary action is not available");return Pf({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this},actionType:"primary"})}revertSecondary(){if(!this.primaryAction)throw new Error("Secondary action is not available");return Pf({emitter:oe(this,mr),apiService:oe(this,ni),args:{notification:this},actionType:"secondary"})}on(t,n){const r=oe(this,mr).on(t,n);return()=>{r()}}off(t,n){oe(this,mr).off(t,n)}};mr=new WeakMap;ni=new WeakMap;var r7=e=>Ve(void 0,[e],function*({emitter:t,apiService:n,args:r}){const{notificationId:i,optimisticValue:a}=Hl(r,{isRead:!0,readAt:new Date().toISOString(),isArchived:!1,archivedAt:void 0},{emitter:t,apiService:n});try{t.emit("notification.read.pending",{args:r,data:a});const o=yield n.read(i),s=new Gr(o,t,n);return t.emit("notification.read.resolved",{args:r,data:s}),{data:s}}catch(o){return t.emit("notification.read.resolved",{args:r,error:o}),{error:new or("Failed to read notification",o)}}}),i7=e=>Ve(void 0,[e],function*({emitter:t,apiService:n,args:r}){const{notificationId:i,optimisticValue:a}=Hl(r,{isRead:!1,readAt:null,isArchived:!1,archivedAt:void 0},{emitter:t,apiService:n});try{t.emit("notification.unread.pending",{args:r,data:a});const o=yield n.unread(i),s=new Gr(o,t,n);return t.emit("notification.unread.resolved",{args:r,data:s}),{data:s}}catch(o){return t.emit("notification.unread.resolved",{args:r,error:o}),{error:new or("Failed to unread notification",o)}}}),a7=e=>Ve(void 0,[e],function*({emitter:t,apiService:n,args:r}){const{notificationId:i,optimisticValue:a}=Hl(r,{isArchived:!0,archivedAt:new Date().toISOString(),isRead:!0,readAt:new Date().toISOString()},{emitter:t,apiService:n});try{t.emit("notification.archive.pending",{args:r,data:a});const o=yield n.archive(i),s=new Gr(o,t,n);return t.emit("notification.archive.resolved",{args:r,data:s}),{data:s}}catch(o){return t.emit("notification.archive.resolved",{args:r,error:o}),{error:new or("Failed to archive notification",o)}}}),o7=e=>Ve(void 0,[e],function*({emitter:t,apiService:n,args:r}){const{notificationId:i,optimisticValue:a}=Hl(r,{isArchived:!1,archivedAt:null,isRead:!0,readAt:new Date().toISOString()},{emitter:t,apiService:n});try{t.emit("notification.unarchive.pending",{args:r,data:a});const o=yield n.unarchive(i),s=new Gr(o,t,n);return t.emit("notification.unarchive.resolved",{args:r,data:s}),{data:s}}catch(o){return t.emit("notification.unarchive.resolved",{args:r,error:o}),{error:new or("Failed to unarchive notification",o)}}}),If=e=>Ve(void 0,[e],function*({emitter:t,apiService:n,args:r,actionType:i}){const a=i==="primary"?{primaryAction:an(Ye({},"notification"in r?r.notification.primaryAction:{}),{isCompleted:!0})}:{secondaryAction:an(Ye({},"notification"in r?r.notification.secondaryAction:{}),{isCompleted:!0})},{notificationId:o,optimisticValue:s}=Hl(r,a,{emitter:t,apiService:n});try{t.emit("notification.complete_action.pending",{args:r,data:s});const l=yield n.completeAction({actionType:i,notificationId:o}),u=new Gr(l,t,n);return t.emit("notification.complete_action.resolved",{args:r,data:u}),{data:u}}catch(l){return t.emit("notification.complete_action.resolved",{args:r,error:l}),{error:new or(`Failed to complete ${i} action on the notification`,l)}}}),Pf=e=>Ve(void 0,[e],function*({emitter:t,apiService:n,args:r,actionType:i}){const a=i==="primary"?{primaryAction:an(Ye({},"notification"in r?r.notification.primaryAction:{}),{isCompleted:!1})}:{secondaryAction:an(Ye({},"notification"in r?r.notification.secondaryAction:{}),{isCompleted:!1})},{notificationId:o,optimisticValue:s}=Hl(r,a,{emitter:t,apiService:n});try{t.emit("notification.revert_action.pending",{args:r,data:s});const l=yield n.revertAction({actionType:i,notificationId:o}),u=new Gr(l,t,n);return t.emit("notification.revert_action.resolved",{args:r,data:u}),{data:u}}catch(l){return t.emit("notification.revert_action.resolved",{args:r,error:l}),{error:new or("Failed to fetch notifications",l)}}}),Hl=(e,t,n)=>"notification"in e?{notificationId:e.notification.id,optimisticValue:new Gr(Ye(Ye({},e.notification),t),n.emitter,n.apiService)}:{notificationId:e.notificationId},Fz=e=>Ve(void 0,[e],function*({emitter:t,inboxService:n,notificationsCache:r,tags:i}){try{const o=r.getUniqueNotifications({tags:i}).map(s=>new Gr(an(Ye({},s),{isRead:!0,readAt:new Date().toISOString(),isArchived:!1,archivedAt:void 0}),t,n));return t.emit("notifications.read_all.pending",{args:{tags:i},data:o}),yield n.readAll({tags:i}),t.emit("notifications.read_all.resolved",{args:{tags:i},data:o}),{}}catch(a){return t.emit("notifications.read_all.resolved",{args:{tags:i},error:a}),{error:new or("Failed to read all notifications",a)}}}),Mz=e=>Ve(void 0,[e],function*({emitter:t,inboxService:n,notificationsCache:r,tags:i}){try{const o=r.getUniqueNotifications({tags:i}).map(s=>new Gr(an(Ye({},s),{isRead:!0,readAt:new Date().toISOString(),isArchived:!0,archivedAt:new Date().toISOString()}),t,n));return t.emit("notifications.archive_all.pending",{args:{tags:i},data:o}),yield n.archiveAll({tags:i}),t.emit("notifications.archive_all.resolved",{args:{tags:i},data:o}),{}}catch(a){return t.emit("notifications.archive_all.resolved",{args:{tags:i},error:a}),{error:new or("Failed to archive all notifications",a)}}}),Bz=e=>Ve(void 0,[e],function*({emitter:t,inboxService:n,notificationsCache:r,tags:i}){try{const o=r.getUniqueNotifications({tags:i,read:!0}).map(s=>new Gr(an(Ye({},s),{isArchived:!0,archivedAt:new Date().toISOString()}),t,n));return t.emit("notifications.archive_all_read.pending",{args:{tags:i},data:o}),yield n.archiveAllRead({tags:i}),t.emit("notifications.archive_all_read.resolved",{args:{tags:i},data:o}),{}}catch(a){return t.emit("notifications.archive_all_read.resolved",{args:{tags:i},error:a}),{error:new or("Failed to archive all read notifications",a)}}}),Ai,s7=class{constructor(){Ge(this,Ai),Qe(this,Ai,new Map)}get(e){return oe(this,Ai).get(e)}getValues(){return Array.from(oe(this,Ai).values())}entries(){return Array.from(oe(this,Ai).entries())}keys(){return Array.from(oe(this,Ai).keys())}set(e,t){oe(this,Ai).set(e,t)}remove(e){oe(this,Ai).delete(e)}clear(){oe(this,Ai).clear()}};Ai=new WeakMap;var l7=({tags:e,read:t,archived:n,limit:r,offset:i,after:a})=>Object.entries({tags:e,read:t,archived:n,limit:r,offset:i,after:a}).filter(([o,s])=>s!=null&&!(Array.isArray(s)&&s.length===0)).reduce((o,[s,l])=>(o[s]=l,o),{}),Am=({tags:e,read:t,archived:n,limit:r,offset:i,after:a})=>JSON.stringify(l7({tags:e,read:t,archived:n,limit:r,offset:i,after:a})),Lz=({tags:e,read:t,archived:n})=>JSON.stringify(l7({tags:e,read:t,archived:n})),Ts=e=>JSON.parse(e),$z=["notification.read.pending","notification.read.resolved","notification.unread.pending","notification.unread.resolved","notification.complete_action.pending","notification.complete_action.resolved","notification.revert_action.pending","notification.revert_action.resolved","notifications.read_all.pending","notifications.read_all.resolved"],jz=["notification.archive.pending","notification.unarchive.pending","notifications.archive_all.pending","notifications.archive_all_read.pending"],Mo,kn,Hz=class{constructor({emitter:e}){Ge(this,Mo),Ge(this,kn),this.updateNotification=(t,n)=>{const r=oe(this,kn).get(t);if(!r)return!1;const i=r.notifications.findIndex(o=>o.id===n.id);if(i===-1)return!1;const a=[...r.notifications];return a[i]=n,oe(this,kn).set(t,an(Ye({},r),{notifications:a})),!0},this.removeNotification=(t,n)=>{const r=oe(this,kn).get(t);if(!r)return!1;const i=r.notifications.findIndex(o=>o.id===n.id);if(i===-1)return!1;const a=[...r.notifications];return a.splice(i,1),oe(this,kn).set(t,an(Ye({},r),{notifications:a})),!0},this.handleNotificationEvent=({remove:t}={remove:!1})=>({data:n})=>{if(!n)return;const r=Array.isArray(n)?n:[n],i=new Set;oe(this,kn).keys().forEach(a=>{r.forEach(o=>{let s=!1;t?s=this.removeNotification(a,o):s=this.updateNotification(a,o),s&&i.add(Lz(Ts(a)))})}),i.forEach(a=>{const o=this.getAggregated(Ts(a));oe(this,Mo).emit("notifications.list.updated",{data:o})})},Qe(this,Mo,e),$z.forEach(t=>{oe(this,Mo).on(t,this.handleNotificationEvent())}),jz.forEach(t=>{oe(this,Mo).on(t,this.handleNotificationEvent({remove:!0}))}),Qe(this,kn,new s7)}getAggregated(e){return oe(this,kn).keys().filter(n=>{const r=Ts(n);return Nf(r,e)}).map(n=>oe(this,kn).get(n)).reduce((n,r)=>r?{hasMore:r.hasMore,filter:r.filter,notifications:[...n.notifications,...r.notifications]}:n,{hasMore:!1,filter:{},notifications:[]})}has(e){return oe(this,kn).get(Am(e))!==void 0}set(e,t){oe(this,kn).set(Am(e),t)}update(e,t){this.set(e,t);const n=this.getAggregated(Ts(Am(e)));oe(this,Mo).emit("notifications.list.updated",{data:n})}getAll(e){if(this.has(e))return this.getAggregated({tags:e.tags,read:e.read,archived:e.archived})}getUniqueNotifications({tags:e,read:t}){const n=oe(this,kn).keys(),r=new Map;return n.forEach(i=>{const a=Ts(i);if(n7(e,a.tags)){const o=oe(this,kn).get(i);if(!o)return;o.notifications.filter(s=>typeof t>"u"||t===s.isRead).forEach(s=>r.set(s.id,s))}}),Array.from(r.values())}clear(e){oe(this,kn).keys().forEach(n=>{Nf(Ts(n),e)&&oe(this,kn).remove(n)})}clearAll(){oe(this,kn).clear()}};Mo=new WeakMap;kn=new WeakMap;var Rd,Uz=class extends Fy{constructor({useCache:e,inboxServiceInstance:t,eventEmitterInstance:n}){super({eventEmitterInstance:n,inboxServiceInstance:t}),Ge(this,Rd),this.cache=new Hz({emitter:n}),Qe(this,Rd,e)}list(){return Ve(this,arguments,function*(e={}){var t=e,{limit:n=10}=t,r=Dy(t,["limit"]);return this.callWithSession(()=>Ve(this,null,function*(){const i=Ye({limit:n},r);try{const a="useCache"in i?i.useCache:oe(this,Rd);let o=a?this.cache.getAll(i):void 0;if(this._emitter.emit("notifications.list.pending",{args:i,data:o}),!o){const s=yield this._inboxService.fetchNotifications(Ye({limit:n},r));o={hasMore:s.hasMore,filter:s.filter,notifications:s.data.map(l=>new Gr(l,this._emitter,this._inboxService))},a&&(this.cache.set(i,o),o=this.cache.getAll(i))}return this._emitter.emit("notifications.list.resolved",{args:i,data:o}),{data:o}}catch(a){return this._emitter.emit("notifications.list.resolved",{args:i,error:a}),{error:new or("Failed to fetch notifications",a)}}}))})}count(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){const t=e&&"filters"in e?e.filters:[Ye({},e)];try{this._emitter.emit("notifications.count.pending",{args:e});const n=yield this._inboxService.count({filters:t}),r=e&&"filters"in e?{counts:n.data}:n.data[0];return this._emitter.emit("notifications.count.resolved",{args:e,data:r}),{data:r}}catch(n){return this._emitter.emit("notifications.count.resolved",{args:e,error:n}),{error:new or("Failed to count notifications",n)}}}))})}read(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return r7({emitter:this._emitter,apiService:this._inboxService,args:e})}))})}unread(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return i7({emitter:this._emitter,apiService:this._inboxService,args:e})}))})}archive(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return a7({emitter:this._emitter,apiService:this._inboxService,args:e})}))})}unarchive(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return o7({emitter:this._emitter,apiService:this._inboxService,args:e})}))})}completePrimary(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return If({emitter:this._emitter,apiService:this._inboxService,args:e,actionType:"primary"})}))})}completeSecondary(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return If({emitter:this._emitter,apiService:this._inboxService,args:e,actionType:"secondary"})}))})}revertPrimary(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return Pf({emitter:this._emitter,apiService:this._inboxService,args:e,actionType:"primary"})}))})}revertSecondary(e){return Ve(this,null,function*(){return this.callWithSession(()=>Ve(this,null,function*(){return Pf({emitter:this._emitter,apiService:this._inboxService,args:e,actionType:"secondary"})}))})}readAll(){return Ve(this,arguments,function*({tags:e}={}){return this.callWithSession(()=>Ve(this,null,function*(){return Fz({emitter:this._emitter,inboxService:this._inboxService,notificationsCache:this.cache,tags:e})}))})}archiveAll(){return Ve(this,arguments,function*({tags:e}={}){return this.callWithSession(()=>Ve(this,null,function*(){return Mz({emitter:this._emitter,inboxService:this._inboxService,notificationsCache:this.cache,tags:e})}))})}archiveAllRead(){return Ve(this,arguments,function*({tags:e}={}){return this.callWithSession(()=>Ve(this,null,function*(){return Bz({emitter:this._emitter,inboxService:this._inboxService,notificationsCache:this.cache,tags:e})}))})}clearCache({filter:e}={}){return e?this.cache.clear(e??{}):this.cache.clearAll()}};Rd=new WeakMap;var Bs,Fd,Bo,zz=class{constructor(e,t,n){Ge(this,Bs),Ge(this,Fd),Ge(this,Bo),Qe(this,Bs,n),Qe(this,Fd,t),Qe(this,Bo,e)}initialize(){return Ve(this,null,function*(){try{const{applicationIdentifier:e,subscriberId:t,subscriberHash:n}=oe(this,Bo);oe(this,Bs).emit("session.initialize.pending",{args:oe(this,Bo)});const r=yield oe(this,Fd).initializeSession({applicationIdentifier:e,subscriberId:t,subscriberHash:n});oe(this,Bs).emit("session.initialize.resolved",{args:oe(this,Bo),data:r})}catch(e){oe(this,Bs).emit("session.initialize.resolved",{args:oe(this,Bo),error:e})}})}};Bs=new WeakMap;Fd=new WeakMap;Bo=new WeakMap;var Vz=e=>Ve(void 0,[e],function*({emitter:t,apiService:n,cache:r,useCache:i,args:a}){const{workflowId:o,channelPreferences:s}=a;try{t.emit("preference.update.pending",{args:a,data:a.preference?new Rf(an(Ye({},a.preference),{channels:Ye(Ye({},a.preference.channels),s)}),{emitterInstance:t,inboxServiceInstance:n,cache:r,useCache:i}):void 0});let l;o?l=yield n.updateWorkflowPreferences({workflowId:o,channelPreferences:s}):(qz({emitter:t,apiService:n,cache:r,useCache:i,args:a}),l=yield n.updateGlobalPreferences(s));const u=new Rf(l,{emitterInstance:t,inboxServiceInstance:n,cache:r,useCache:i});return t.emit("preference.update.resolved",{args:a,data:u}),{data:u}}catch(l){return t.emit("preference.update.resolved",{args:a,error:l}),{error:new or("Failed to fetch notifications",l)}}}),qz=({emitter:e,apiService:t,cache:n,useCache:r,args:i})=>{const a=r?n==null?void 0:n.getAll({}):void 0;a==null||a.forEach(o=>{var s;if(o.level==="template"){const l=an(Ye({},o),{channels:Object.entries(o.channels).reduce((c,[d,f])=>{var h;const m=d;return c[m]=(h=i.channelPreferences[m])!=null?h:f,c},{})}),u=i.preference?new Rf(l,{emitterInstance:e,inboxServiceInstance:t,cache:n,useCache:r}):void 0;u&&e.emit("preference.update.pending",{args:{workflowId:(s=o.workflow)==null?void 0:s.id,channelPreferences:u.channels},data:u})}})},Md,Bd,Ld,$d,Rf=class{constructor(e,{emitterInstance:t,inboxServiceInstance:n,cache:r,useCache:i}){Ge(this,Md),Ge(this,Bd),Ge(this,Ld),Ge(this,$d),Qe(this,Md,t),Qe(this,Bd,n),Qe(this,Ld,r),Qe(this,$d,i),this.level=e.level,this.enabled=e.enabled,this.channels=e.channels,this.workflow=e.workflow}update({channelPreferences:e}){var t;return Vz({emitter:oe(this,Md),apiService:oe(this,Bd),cache:oe(this,Ld),useCache:oe(this,$d),args:{workflowId:(t=this.workflow)==null?void 0:t.id,channelPreferences:e,preference:{level:this.level,enabled:this.enabled,channels:this.channels,workflow:this.workflow}}})}};Md=new WeakMap;Bd=new WeakMap;Ld=new WeakMap;$d=new WeakMap;var Wz=["preference.update.pending","preference.update.resolved"],Kz=({tags:e})=>Object.entries({tags:e}).reduce((t,[n,r])=>(r==null||Array.isArray(r)&&r.length===0||(t[n]=r),t),{}),km=({tags:e})=>JSON.stringify(Kz({tags:e})),Fu,ri,Gz=class{constructor({emitterInstance:e}){Ge(this,Fu),Ge(this,ri),this.updatePreference=(t,n)=>{const r=oe(this,ri).get(t);if(!r)return!1;const i=r.findIndex(o=>{var s,l;return((s=o.workflow)==null?void 0:s.id)===((l=n.workflow)==null?void 0:l.id)||o.level===n.level&&n.level==="global"});if(i===-1)return!1;const a=[...r];return a[i]=n,oe(this,ri).set(t,a),!0},this.handlePreferenceEvent=({data:t})=>{t&&oe(this,ri).keys().forEach(n=>{const r=this.updatePreference(n,t),i=oe(this,ri).get(n);!r||!i||oe(this,Fu).emit("preferences.list.updated",{data:i})})},Qe(this,Fu,e),Wz.forEach(t=>{oe(this,Fu).on(t,this.handlePreferenceEvent)}),Qe(this,ri,new s7)}has(e){return oe(this,ri).get(km(e))!==void 0}set(e,t){oe(this,ri).set(km(e),t)}getAll(e){if(this.has(e))return oe(this,ri).get(km(e))}clearAll(){oe(this,ri).clear()}};Fu=new WeakMap;ri=new WeakMap;var Ls,Yz=class extends Fy{constructor({useCache:t,inboxServiceInstance:n,eventEmitterInstance:r}){super({eventEmitterInstance:r,inboxServiceInstance:n}),Ge(this,Ls),this.cache=new Gz({emitterInstance:this._emitter}),Qe(this,Ls,t)}list(){return Ve(this,arguments,function*(t={}){return this.callWithSession(()=>Ve(this,null,function*(){try{let n=oe(this,Ls)?this.cache.getAll(t):void 0;return this._emitter.emit("preferences.list.pending",{args:t,data:n}),n||(n=(yield this._inboxService.fetchPreferences(t.tags)).map(i=>new Rf(i,{emitterInstance:this._emitter,inboxServiceInstance:this._inboxService,cache:this.cache,useCache:oe(this,Ls)})),oe(this,Ls)&&(this.cache.set(t,n),n=this.cache.getAll(t))),this._emitter.emit("preferences.list.resolved",{args:t,data:n}),{data:n}}catch(n){throw this._emitter.emit("preferences.list.resolved",{args:t,error:n}),n}}))})}};Ls=new WeakMap;var Zz="https://ws.novu.co",pE="notifications.notification_received",mE="notifications.unseen_count_changed",gE="notifications.unread_count_changed",Qz=({_id:e,content:t,read:n,archived:r,createdAt:i,lastReadDate:a,archivedAt:o,channel:s,subscriber:l,subject:u,avatar:c,cta:d,tags:f,data:h})=>{var m,p,y,v,b,_,T,C,x,w;const P={id:(m=l==null?void 0:l._id)!=null?m:"",firstName:l==null?void 0:l.firstName,lastName:l==null?void 0:l.lastName,avatar:l==null?void 0:l.avatar,subscriberId:(p=l==null?void 0:l.subscriberId)!=null?p:""},O=(v=(y=d.action)==null?void 0:y.buttons)==null?void 0:v.find(S=>S.type==="primary"),M=(_=(b=d.action)==null?void 0:b.buttons)==null?void 0:_.find(S=>S.type==="secondary"),R=(C=(T=d.action)==null?void 0:T.result)==null?void 0:C.type,D=(x=d.action)==null?void 0:x.status;return{id:e,subject:u,body:t,to:P,isRead:n,isArchived:r,createdAt:i,readAt:a,archivedAt:o,avatar:c,primaryAction:O&&{label:O.content,isCompleted:R==="primary"&&D==="done",redirect:O.url?{target:O.target,url:O.url}:void 0},secondaryAction:M&&{label:M.content,isCompleted:R==="secondary"&&D==="done",redirect:M.url?{target:M.target,url:M.url}:void 0},channelType:s,tags:f,redirect:(w=d.data)!=null&&w.url?{url:d.data.url,target:d.data.target}:void 0,data:h}},tc,Si,ha,Sc,My,By,Ly,jd,Bg,Xz=class extends Fy{constructor({socketUrl:t,inboxServiceInstance:n,eventEmitterInstance:r}){super({eventEmitterInstance:r,inboxServiceInstance:n}),Ge(this,jd),Ge(this,tc),Ge(this,Si),Ge(this,ha),Ge(this,Sc),Ge(this,My,({message:i})=>{oe(this,Si).emit(pE,{result:new Gr(Qz(i),oe(this,Si),this._inboxService)})}),Ge(this,By,({unseenCount:i})=>{oe(this,Si).emit(mE,{result:i})}),Ge(this,Ly,({unreadCount:i})=>{oe(this,Si).emit(gE,{result:i})}),Qe(this,Si,r),Qe(this,Sc,t??Zz)}onSessionSuccess({token:t}){Qe(this,tc,t)}isSocketEvent(t){return t===pE||t===mE||t===gE}initialize(){if(oe(this,tc)){Of(this,jd,Bg).call(this).catch(t=>{console.error(t)});return}this.callWithSession(()=>Ve(this,null,function*(){return Of(this,jd,Bg).call(this).catch(t=>{console.error(t)}),{}}))}};tc=new WeakMap;Si=new WeakMap;ha=new WeakMap;Sc=new WeakMap;My=new WeakMap;By=new WeakMap;Ly=new WeakMap;jd=new WeakSet;Bg=function(){return Ve(this,null,function*(){var e,t,n;if(oe(this,ha))return;const r={socketUrl:oe(this,Sc)};oe(this,Si).emit("socket.connect.pending",{args:r}),Qe(this,ha,Pd(oe(this,Sc),{reconnectionDelayMax:1e4,transports:["websocket"],query:{token:`${oe(this,tc)}`}})),oe(this,ha).on("connect",()=>{oe(this,Si).emit("socket.connect.resolved",{args:r})}),oe(this,ha).on("connect_error",i=>{oe(this,Si).emit("socket.connect.resolved",{args:r,error:i})}),(e=oe(this,ha))==null||e.on("notification_received",oe(this,My)),(t=oe(this,ha))==null||t.on("unseen_count_changed",oe(this,By)),(n=oe(this,ha))==null||n.on("unread_count_changed",oe(this,Ly))})};var Jz="https://api.novu.co",eV="2024-06-26",Mu="/inbox",Jr=`${Mu}/notifications`,pn,tV=class{constructor(e={}){this.isSessionInitialized=!1,Ge(this,pn),Qe(this,pn,new Iz(e)),oe(this,pn).updateHeaders({"Novu-API-Version":eV,"Novu-User-Agent":e.userAgent||"@novu/js"})}initializeSession(e){return Ve(this,arguments,function*({applicationIdentifier:t,subscriberId:n,subscriberHash:r}){const i=yield oe(this,pn).post(`${Mu}/session`,{applicationIdentifier:t,subscriberId:n,subscriberHash:r});return oe(this,pn).setAuthorizationToken(i.token),this.isSessionInitialized=!0,i})}fetchNotifications({after:e,archived:t,limit:n=10,offset:r,read:i,tags:a}){const o=new URLSearchParams(`limit=${n}`);return e&&o.append("after",e),r&&o.append("offset",`${r}`),a&&a.forEach(s=>o.append("tags[]",s)),i!==void 0&&o.append("read",`${i}`),t!==void 0&&o.append("archived",`${t}`),oe(this,pn).getFullResponse(`${Jr}?${o.toString()}`)}count({filters:e}){return oe(this,pn).getFullResponse(`${Jr}/count?filters=${JSON.stringify(e)}`)}read(e){return oe(this,pn).patch(`${Jr}/${e}/read`)}unread(e){return oe(this,pn).patch(`${Jr}/${e}/unread`)}archive(e){return oe(this,pn).patch(`${Jr}/${e}/archive`)}unarchive(e){return oe(this,pn).patch(`${Jr}/${e}/unarchive`)}readAll({tags:e}){return oe(this,pn).post(`${Jr}/read`,{tags:e})}archiveAll({tags:e}){return oe(this,pn).post(`${Jr}/archive`,{tags:e})}archiveAllRead({tags:e}){return oe(this,pn).post(`${Jr}/read-archive`,{tags:e})}completeAction({actionType:e,notificationId:t}){return oe(this,pn).patch(`${Jr}/${t}/complete`,{actionType:e})}revertAction({actionType:e,notificationId:t}){return oe(this,pn).patch(`${Jr}/${t}/revert`,{actionType:e})}fetchPreferences(e){const t=new URLSearchParams;e&&e.forEach(r=>t.append("tags[]",r));const n=t.size?`?${t.toString()}`:"";return oe(this,pn).get(`${Mu}/preferences${n}`)}updateGlobalPreferences(e){return oe(this,pn).patch(`${Mu}/preferences`,e)}updateWorkflowPreferences({workflowId:e,channelPreferences:t}){return oe(this,pn).patch(`${Mu}/preferences/${e}`,t)}};pn=new WeakMap;var nV="2.6.0",rV="@novu/js",iV=`${rV}@${nV}`,da,Hd,Bu,Lo,u7=class{constructor(e){Ge(this,da),Ge(this,Hd),Ge(this,Bu),Ge(this,Lo);var t,n,r,i;Qe(this,Lo,new tV({backendUrl:(t=e.backendUrl)!=null?t:Jz,userAgent:(n=e.__userAgent)!=null?n:iV})),Qe(this,da,new Rz),Qe(this,Hd,new zz({applicationIdentifier:e.applicationIdentifier,subscriberId:e.subscriberId,subscriberHash:e.subscriberHash},oe(this,Lo),oe(this,da))),oe(this,Hd).initialize(),this.notifications=new Uz({useCache:(r=e.useCache)!=null?r:!0,inboxServiceInstance:oe(this,Lo),eventEmitterInstance:oe(this,da)}),this.preferences=new Yz({useCache:(i=e.useCache)!=null?i:!0,inboxServiceInstance:oe(this,Lo),eventEmitterInstance:oe(this,da)}),Qe(this,Bu,new Xz({socketUrl:e.socketUrl,eventEmitterInstance:oe(this,da),inboxServiceInstance:oe(this,Lo)})),this.on=(a,o)=>{oe(this,Bu).isSocketEvent(a)&&oe(this,Bu).initialize();const s=oe(this,da).on(a,o);return()=>{s()}},this.off=(a,o)=>{oe(this,da).off(a,o)}}};da=new WeakMap;Hd=new WeakMap;Bu=new WeakMap;Lo=new WeakMap;var aV=e=>{const t=[];let n="",r=!1;for(let i=0;i<e.length;i+=1)e[i]==="\\"&&e[i+1]==="*"?(n+="*",i+=1):e[i]==="*"&&e[i+1]==="*"?(n&&(t.push({type:r?"bold":"text",content:n}),n=""),r=!r,i+=1):n+=e[i];return n&&t.push({type:r?"bold":"text",content:n}),t};const c7={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return vE(this.context.count)},getNextContextId(){return vE(this.context.count++)}};function vE(e){const t=String(e),n=t.length-1;return c7.context.id+(n?String.fromCharCode(96+n):"")+t}const oV=(e,t)=>e===t,hi=Symbol("solid-proxy"),d7=typeof Proxy=="function",Lg=Symbol("solid-track"),Ff={equals:oV};let f7=y7;const Na=1,Mf=2,h7={owned:null,cleanups:null,context:null,owner:null},Sm={};var It=null;let Dm=null,sV=null,$t=null,Mn=null,ya=null,Ph=0;function nc(e,t){const n=$t,r=It,i=e.length===0,a=t===void 0?r:t,o=i?h7:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(()=>xn(()=>Dc(o)));It=o,$t=null;try{return qi(s,!0)}finally{$t=n,It=r}}function Me(e,t){t=t?Object.assign({},Ff,t):Ff;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=i=>(typeof i=="function"&&(i=i(n.value)),v7(n,i));return[g7.bind(n),r]}function Bf(e,t,n){const r=Rh(e,t,!0,Na);Ul(r)}function ct(e,t,n){const r=Rh(e,t,!1,Na);Ul(r)}function cn(e,t,n){f7=vV;const r=Rh(e,t,!1,Na);(!n||!n.render)&&(r.user=!0),ya?ya.push(r):Ul(r)}function He(e,t,n){n=n?Object.assign({},Ff,n):Ff;const r=Rh(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Ul(r),g7.bind(r)}function lV(e){return e&&typeof e=="object"&&"then"in e}function p7(e,t,n){let r,i,a;arguments.length===2&&typeof t=="object"||arguments.length===1?(r=!0,i=e,a=t||{}):(r=e,i=t,a=n||{});let o=null,s=Sm,l=!1,u="initialValue"in a,c=typeof r=="function"&&He(r);const d=new Set,[f,h]=(a.storage||Me)(a.initialValue),[m,p]=Me(void 0),[y,v]=Me(void 0,{equals:!1}),[b,_]=Me(u?"ready":"unresolved");function T(P,O,M,R){return o===P&&(o=null,R!==void 0&&(u=!0),(P===s||O===s)&&a.onHydrated&&queueMicrotask(()=>a.onHydrated(R,{value:O})),s=Sm,C(O,M)),O}function C(P,O){qi(()=>{O===void 0&&h(()=>P),_(O!==void 0?"errored":u?"ready":"unresolved"),p(O);for(const M of d.keys())M.decrement();d.clear()},!1)}function x(){const P=pV,O=f(),M=m();if(M!==void 0&&!o)throw M;return $t&&!$t.user&&P&&Bf(()=>{y(),o&&(P.resolved||d.has(P)||(P.increment(),d.add(P)))}),O}function w(P=!0){if(P!==!1&&l)return;l=!1;const O=c?c():r;if(O==null||O===!1){T(o,xn(f));return}const M=s!==Sm?s:xn(()=>i(O,{value:f(),refetching:P}));return lV(M)?(o=M,"value"in M?(M.status==="success"?T(o,M.value,void 0,O):T(o,void 0,jg(M.value),O),M):(l=!0,queueMicrotask(()=>l=!1),qi(()=>{_(u?"refreshing":"pending"),v()},!1),M.then(R=>T(M,R,void 0,O),R=>T(M,void 0,jg(R),O)))):(T(o,M,void 0,O),M)}return Object.defineProperties(x,{state:{get:()=>b()},error:{get:()=>m()},loading:{get(){const P=b();return P==="pending"||P==="refreshing"}},latest:{get(){if(!u)return x();const P=m();if(P&&!o)throw P;return f()}}}),c?Bf(()=>w(!1)):w(!1),[x,{refetch:w,mutate:h}]}function xl(e){return qi(e,!1)}function xn(e){if($t===null)return e();const t=$t;$t=null;try{return e()}finally{$t=t}}function sr(e){cn(()=>xn(e))}function dn(e){return It===null||(It.cleanups===null?It.cleanups=[e]:It.cleanups.push(e)),e}function $g(){return $t}function uV(){return It}function cV(e,t){const n=It,r=$t;It=e,$t=null;try{return qi(t,!0)}catch(i){$y(i)}finally{It=n,$t=r}}function dV(e){const t=$t,n=It;return Promise.resolve().then(()=>{$t=t,It=n;let r;return qi(e,!1),$t=It=null,r?r.done:void 0})}const[fV,Uve]=Me(!1);function hV(){return[fV,dV]}function vi(e,t){const n=Symbol("context");return{id:n,Provider:yV(n),defaultValue:e}}function lr(e){let t;return It&&It.context&&(t=It.context[e.id])!==void 0?t:e.defaultValue}function m7(e){const t=He(e),n=He(()=>Hg(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let pV;function g7(){if(this.sources&&this.state)if(this.state===Na)Ul(this);else{const e=Mn;Mn=null,qi(()=>$f(this),!1),Mn=e}if($t){const e=this.observers?this.observers.length:0;$t.sources?($t.sources.push(this),$t.sourceSlots.push(e)):($t.sources=[this],$t.sourceSlots=[e]),this.observers?(this.observers.push($t),this.observerSlots.push($t.sources.length-1)):(this.observers=[$t],this.observerSlots=[$t.sources.length-1])}return this.value}function v7(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&qi(()=>{for(let i=0;i<e.observers.length;i+=1){const a=e.observers[i],o=Dm&&Dm.running;o&&Dm.disposed.has(a),(o?!a.tState:!a.state)&&(a.pure?Mn.push(a):ya.push(a),a.observers&&b7(a)),o||(a.state=Na)}if(Mn.length>1e6)throw Mn=[],new Error},!1)),t}function Ul(e){if(!e.fn)return;Dc(e);const t=Ph;mV(e,e.value,t)}function mV(e,t,n){let r;const i=It,a=$t;$t=It=e;try{r=e.fn(t)}catch(o){return e.pure&&(e.state=Na,e.owned&&e.owned.forEach(Dc),e.owned=null),e.updatedAt=n+1,$y(o)}finally{$t=a,It=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?v7(e,r):e.value=r,e.updatedAt=n)}function Rh(e,t,n,r=Na,i){const a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:It,context:It?It.context:null,pure:n};return It===null||It!==h7&&(It.owned?It.owned.push(a):It.owned=[a]),a}function Lf(e){if(e.state===0)return;if(e.state===Mf)return $f(e);if(e.suspense&&xn(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Ph);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===Na)Ul(e);else if(e.state===Mf){const r=Mn;Mn=null,qi(()=>$f(e,t[0]),!1),Mn=r}}function qi(e,t){if(Mn)return e();let n=!1;t||(Mn=[]),ya?n=!0:ya=[],Ph++;try{const r=e();return gV(n),r}catch(r){n||(ya=null),Mn=null,$y(r)}}function gV(e){if(Mn&&(y7(Mn),Mn=null),e)return;const t=ya;ya=null,t.length&&qi(()=>f7(t),!1)}function y7(e){for(let t=0;t<e.length;t++)Lf(e[t])}function vV(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Lf(r)}for(t=0;t<n;t++)Lf(e[t])}function $f(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const i=r.state;i===Na?r!==t&&(!r.updatedAt||r.updatedAt<Ph)&&Lf(r):i===Mf&&$f(r,t)}}}function b7(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Mf,n.pure?Mn.push(n):ya.push(n),n.observers&&b7(n))}}function Dc(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),i=n.observers;if(i&&i.length){const a=i.pop(),o=n.observerSlots.pop();r<i.length&&(a.sourceSlots[o]=r,i[r]=a,n.observerSlots[r]=o)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Dc(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Dc(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function jg(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function $y(e,t=It){throw jg(e)}function Hg(e){if(typeof e=="function"&&!e.length)return Hg(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=Hg(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function yV(e,t){return function(r){let i;return ct(()=>i=xn(()=>(It.context={...It.context,[e]:r.value},m7(()=>r.children))),void 0),i}}const bV=Symbol("fallback");function yE(e){for(let t=0;t<e.length;t++)e[t]()}function EV(e,t,n={}){let r=[],i=[],a=[],o=0,s=t.length>1?[]:null;return dn(()=>yE(a)),()=>{let l=e()||[],u=l.length,c,d;return l[Lg],xn(()=>{let h,m,p,y,v,b,_,T,C;if(u===0)o!==0&&(yE(a),a=[],r=[],i=[],o=0,s&&(s=[])),n.fallback&&(r=[bV],i[0]=nc(x=>(a[0]=x,n.fallback())),o=1);else if(o===0){for(i=new Array(u),d=0;d<u;d++)r[d]=l[d],i[d]=nc(f);o=u}else{for(p=new Array(u),y=new Array(u),s&&(v=new Array(u)),b=0,_=Math.min(o,u);b<_&&r[b]===l[b];b++);for(_=o-1,T=u-1;_>=b&&T>=b&&r[_]===l[T];_--,T--)p[T]=i[_],y[T]=a[_],s&&(v[T]=s[_]);for(h=new Map,m=new Array(T+1),d=T;d>=b;d--)C=l[d],c=h.get(C),m[d]=c===void 0?-1:c,h.set(C,d);for(c=b;c<=_;c++)C=r[c],d=h.get(C),d!==void 0&&d!==-1?(p[d]=i[c],y[d]=a[c],s&&(v[d]=s[c]),d=m[d],h.set(C,d)):a[c]();for(d=b;d<u;d++)d in p?(i[d]=p[d],a[d]=y[d],s&&(s[d]=v[d],s[d](d))):i[d]=nc(f);i=i.slice(0,o=u),r=l.slice(0)}return i});function f(h){if(a[d]=h,s){const[m,p]=Me(d);return s[d]=p,t(l[d],m)}return t(l[d])}}}function Z(e,t){return xn(()=>e(t||{}))}function R1(){return!0}const Ug={get(e,t,n){return t===hi?n:e.get(t)},has(e,t){return t===hi?!0:e.has(t)},set:R1,deleteProperty:R1,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:R1,deleteProperty:R1}},ownKeys(e){return e.keys()}};function Om(e){return(e=typeof e=="function"?e():e)?e:{}}function _V(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function At(...e){let t=!1;for(let o=0;o<e.length;o++){const s=e[o];t=t||!!s&&hi in s,e[o]=typeof s=="function"?(t=!0,He(s)):s}if(d7&&t)return new Proxy({get(o){for(let s=e.length-1;s>=0;s--){const l=Om(e[s])[o];if(l!==void 0)return l}},has(o){for(let s=e.length-1;s>=0;s--)if(o in Om(e[s]))return!0;return!1},keys(){const o=[];for(let s=0;s<e.length;s++)o.push(...Object.keys(Om(e[s])));return[...new Set(o)]}},Ug);const n={},r=Object.create(null);for(let o=e.length-1;o>=0;o--){const s=e[o];if(!s)continue;const l=Object.getOwnPropertyNames(s);for(let u=l.length-1;u>=0;u--){const c=l[u];if(c==="__proto__"||c==="constructor")continue;const d=Object.getOwnPropertyDescriptor(s,c);if(!r[c])r[c]=d.get?{enumerable:!0,configurable:!0,get:_V.bind(n[c]=[d.get.bind(s)])}:d.value!==void 0?d:void 0;else{const f=n[c];f&&(d.get?f.push(d.get.bind(s)):d.value!==void 0&&f.push(()=>d.value))}}}const i={},a=Object.keys(r);for(let o=a.length-1;o>=0;o--){const s=a[o],l=r[s];l&&l.get?Object.defineProperty(i,s,l):i[s]=l?l.value:void 0}return i}function wn(e,...t){if(d7&&hi in e){const i=new Set(t.length>1?t.flat():t[0]),a=t.map(o=>new Proxy({get(s){return o.includes(s)?e[s]:void 0},has(s){return o.includes(s)&&s in e},keys(){return o.filter(s=>s in e)}},Ug));return a.push(new Proxy({get(o){return i.has(o)?void 0:e[o]},has(o){return i.has(o)?!1:o in e},keys(){return Object.keys(e).filter(o=>!i.has(o))}},Ug)),a}const n={},r=t.map(()=>({}));for(const i of Object.getOwnPropertyNames(e)){const a=Object.getOwnPropertyDescriptor(e,i),o=!a.get&&!a.set&&a.enumerable&&a.writable&&a.configurable;let s=!1,l=0;for(const u of t)u.includes(i)&&(s=!0,o?r[l][i]=a.value:Object.defineProperty(r[l],i,a)),++l;s||(o?n[i]=a.value:Object.defineProperty(n,i,a))}return[...r,n]}const E7=e=>`Stale read from <${e}>.`;function Wi(e){const t="fallback"in e&&{fallback:()=>e.fallback};return He(EV(()=>e.each,e.children,t||void 0))}function Tt(e){const t=e.keyed,n=He(()=>e.when,void 0,{equals:(r,i)=>t?r===i:!r==!i});return He(()=>{const r=n();if(r){const i=e.children;return typeof i=="function"&&i.length>0?xn(()=>i(t?r:()=>{if(!xn(n))throw E7("Show");return e.when})):i}return e.fallback},void 0,void 0)}function TV(e){let t=!1;const n=(a,o)=>(t?a[1]===o[1]:!a[1]==!o[1])&&a[2]===o[2],r=m7(()=>e.children),i=He(()=>{let a=r();Array.isArray(a)||(a=[a]);for(let o=0;o<a.length;o++){const s=a[o].when;if(s)return t=!!a[o].keyed,[o,s,a[o]]}return[-1]},void 0,{equals:n});return He(()=>{const[a,o,s]=i();if(a<0)return e.fallback;const l=s.children;return typeof l=="function"&&l.length>0?xn(()=>l(t?o:()=>{if(xn(i)[0]!==a)throw E7("Match");return s.when})):l},void 0,void 0)}function bE(e){return e}const CV=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],xV=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...CV]),wV=new Set(["innerHTML","textContent","innerText","children"]),AV=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),kV=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function SV(e,t){const n=kV[e];return typeof n=="object"?n[t]?n.$:void 0:n}const DV=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),OV=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),NV={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function IV(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,l=t[i-1].nextSibling,u=null;for(;o<i||s<a;){if(t[o]===n[s]){o++,s++;continue}for(;t[i-1]===n[a-1];)i--,a--;if(i===o){const c=a<r?s?n[s-1].nextSibling:n[a-s]:l;for(;s<a;)e.insertBefore(n[s++],c)}else if(a===s)for(;o<i;)(!u||!u.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){const c=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],c),t[i]=n[a]}else{if(!u){u=new Map;let d=s;for(;d<a;)u.set(n[d],d++)}const c=u.get(t[o]);if(c!=null)if(s<c&&c<a){let d=o,f=1,h;for(;++d<i&&d<a&&!((h=u.get(t[d]))==null||h!==c+f);)f++;if(f>c-s){const m=t[o];for(;s<c;)e.insertBefore(n[s++],m)}else e.replaceChild(n[s++],t[o++])}else o++;else t[o++].remove()}}}const EE="_$DX_DELEGATE";function PV(e,t,n,r={}){let i;return nc(a=>{i=a,t===document?e():Ie(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=""}}function Le(e,t,n){let r;const i=()=>{const o=document.createElement("template");return o.innerHTML=e,n?o.content.firstChild.firstChild:o.content.firstChild},a=t?()=>xn(()=>document.importNode(r||(r=i()),!0)):()=>(r||(r=i())).cloneNode(!0);return a.cloneNode=a,a}function zl(e,t=window.document){const n=t[EE]||(t[EE]=new Set);for(let r=0,i=e.length;r<i;r++){const a=e[r];n.has(a)||(n.add(a),t.addEventListener(a,jV))}}function er(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function RV(e,t,n,r){r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r)}function FV(e,t,n){n?e.setAttribute(t,""):e.removeAttribute(t)}function Ze(e,t){t==null?e.removeAttribute("class"):e.className=t}function _7(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const i=n[0];e.addEventListener(t,n[0]=a=>i.call(e,n[1],a))}else e.addEventListener(t,n,typeof n!="function"&&n)}function MV(e,t,n={}){const r=Object.keys(t||{}),i=Object.keys(n);let a,o;for(a=0,o=i.length;a<o;a++){const s=i[a];!s||s==="undefined"||t[s]||(_E(e,s,!1),delete n[s])}for(a=0,o=r.length;a<o;a++){const s=r[a],l=!!t[s];!s||s==="undefined"||n[s]===l||!l||(_E(e,s,!0),n[s]=l)}return n}function BV(e,t,n){if(!t)return n?er(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let i,a;for(a in n)t[a]==null&&r.removeProperty(a),delete n[a];for(a in t)i=t[a],i!==n[a]&&(r.setProperty(a,i),n[a]=i);return n}function Ft(e,t={},n,r){const i={};return r||ct(()=>i.children=wl(e,t.children,i.children)),ct(()=>typeof t.ref=="function"&&Ca(t.ref,e)),ct(()=>LV(e,t,n,!0,i,!0)),i}function Ca(e,t,n){return xn(()=>e(t,n))}function Ie(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return wl(e,t,r,n);ct(i=>wl(e,t(),i,n),r)}function LV(e,t,n,r,i={},a=!1){t||(t={});for(const o in i)if(!(o in t)){if(o==="children")continue;i[o]=TE(e,o,null,i[o],n,a,t)}for(const o in t){if(o==="children"){r||wl(e,t.children);continue}const s=t[o];i[o]=TE(e,o,s,i[o],n,a,t)}}function $V(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function _E(e,t,n){const r=t.trim().split(/\s+/);for(let i=0,a=r.length;i<a;i++)e.classList.toggle(r[i],n)}function TE(e,t,n,r,i,a,o){let s,l,u,c,d;if(t==="style")return BV(e,n,r);if(t==="classList")return MV(e,n,r);if(n===r)return r;if(t==="ref")a||n(e);else if(t.slice(0,3)==="on:"){const f=t.slice(3);r&&e.removeEventListener(f,r,typeof r!="function"&&r),n&&e.addEventListener(f,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const f=t.slice(10);r&&e.removeEventListener(f,r,!0),n&&e.addEventListener(f,n,!0)}else if(t.slice(0,2)==="on"){const f=t.slice(2).toLowerCase(),h=DV.has(f);if(!h&&r){const m=Array.isArray(r)?r[0]:r;e.removeEventListener(f,m)}(h||n)&&(_7(e,f,n,h),h&&zl([f]))}else if(t.slice(0,5)==="attr:")er(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")FV(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(u=wV.has(t))||!i&&((c=SV(t,e.tagName))||(l=xV.has(t)))||(s=e.nodeName.includes("-")||"is"in o))d&&(t=t.slice(5),l=!0),t==="class"||t==="className"?Ze(e,n):s&&!l&&!u?e[$V(t)]=n:e[c||t]=n;else{const f=i&&t.indexOf(":")>-1&&NV[t.split(":")[0]];f?RV(e,f,t,n):er(e,AV[t]||t,n)}return n}function jV(e){let t=e.target;const n=`$$${e.type}`,r=e.target,i=e.currentTarget,a=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),o=()=>{const l=t[n];if(l&&!t.disabled){const u=t[`${n}Data`];if(u!==void 0?l.call(t,u,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&a(t.host),!0},s=()=>{for(;o()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),e.composedPath){const l=e.composedPath();a(l[0]);for(let u=0;u<l.length-2&&(t=l[u],!!o());u++){if(t._$host){t=t._$host,s();break}if(t.parentNode===i)break}}else s();a(r)}function wl(e,t,n,r,i){for(;typeof n=="function";)n=n();if(t===n)return n;const a=typeof t,o=r!==void 0;if(e=o&&n[0]&&n[0].parentNode||e,a==="string"||a==="number"){if(a==="number"&&(t=t.toString(),t===n))return n;if(o){let s=n[0];s&&s.nodeType===3?s.data!==t&&(s.data=t):s=document.createTextNode(t),n=Cs(e,n,r,s)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||a==="boolean")n=Cs(e,n,r);else{if(a==="function")return ct(()=>{let s=t();for(;typeof s=="function";)s=s();n=wl(e,s,n,r)}),()=>n;if(Array.isArray(t)){const s=[],l=n&&Array.isArray(n);if(zg(s,t,n,i))return ct(()=>n=wl(e,s,n,r,!0)),()=>n;if(s.length===0){if(n=Cs(e,n,r),o)return n}else l?n.length===0?CE(e,s,r):IV(e,n,s):(n&&Cs(e),CE(e,s));n=s}else if(t.nodeType){if(Array.isArray(n)){if(o)return n=Cs(e,n,r,t);Cs(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function zg(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let s=t[a],l=n&&n[e.length],u;if(!(s==null||s===!0||s===!1))if((u=typeof s)=="object"&&s.nodeType)e.push(s);else if(Array.isArray(s))i=zg(e,s,l)||i;else if(u==="function")if(r){for(;typeof s=="function";)s=s();i=zg(e,Array.isArray(s)?s:[s],Array.isArray(l)?l:[l])||i}else e.push(s),i=!0;else{const c=String(s);l&&l.nodeType===3&&l.data===c?e.push(l):e.push(document.createTextNode(c))}}return i}function CE(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function Cs(e,t,n,r){if(n===void 0)return e.textContent="";const i=r||document.createTextNode("");if(t.length){let a=!1;for(let o=t.length-1;o>=0;o--){const s=t[o];if(i!==s){const l=s.parentNode===e;!a&&!o?l?e.replaceChild(i,s):e.insertBefore(i,n):l&&s.remove()}else a=!0}}else e.insertBefore(i,n);return[i]}const HV="http://www.w3.org/2000/svg";function T7(e,t=!1){return t?document.createElementNS(HV,e):document.createElement(e)}function jy(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,i=uV();let a,o=!!c7.context;return cn(()=>{a||(a=cV(i,()=>He(()=>e.children)));const s=r();if(s instanceof HTMLHeadElement){const[l,u]=Me(!1),c=()=>u(!0);nc(d=>Ie(s,()=>l()?d():a(),null)),dn(c)}else{const l=T7(e.isSVG?"g":"div",e.isSVG),u=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),Ie(u,a),s.appendChild(l),e.ref&&e.ref(l),dn(()=>s.removeChild(l))}},void 0,{render:!o}),n}function Fh(e){const[t,n]=wn(e,["component"]),r=He(()=>t.component);return He(()=>{const i=r();switch(typeof i){case"function":return xn(()=>i(n));case"string":const a=OV.has(i),o=T7(i,a);return Ft(o,n,a),o}})}const Vg=Symbol("store-raw"),rl=Symbol("store-node"),ma=Symbol("store-has"),C7=Symbol("store-self");function x7(e){let t=e[hi];if(!t&&(Object.defineProperty(e,hi,{value:t=new Proxy(e,VV)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let i=0,a=n.length;i<a;i++){const o=n[i];r[o].get&&Object.defineProperty(e,o,{enumerable:r[o].enumerable,get:r[o].get.bind(t)})}}return t}function jf(e){let t;return e!=null&&typeof e=="object"&&(e[hi]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function Oc(e,t=new Set){let n,r,i,a;if(n=e!=null&&e[Vg])return n;if(!jf(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let o=0,s=e.length;o<s;o++)i=e[o],(r=Oc(i,t))!==i&&(e[o]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const o=Object.keys(e),s=Object.getOwnPropertyDescriptors(e);for(let l=0,u=o.length;l<u;l++)a=o[l],!s[a].get&&(i=e[a],(r=Oc(i,t))!==i&&(e[a]=r))}return e}function Hf(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function Nc(e,t,n){if(e[t])return e[t];const[r,i]=Me(n,{equals:!1,internal:!0});return r.$=i,e[t]=r}function UV(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===hi||t===rl||(delete n.value,delete n.writable,n.get=()=>e[hi][t]),n}function w7(e){$g()&&Nc(Hf(e,rl),C7)()}function zV(e){return w7(e),Reflect.ownKeys(e)}const VV={get(e,t,n){if(t===Vg)return e;if(t===hi)return n;if(t===Lg)return w7(e),n;const r=Hf(e,rl),i=r[t];let a=i?i():e[t];if(t===rl||t===ma||t==="__proto__")return a;if(!i){const o=Object.getOwnPropertyDescriptor(e,t);$g()&&(typeof a!="function"||e.hasOwnProperty(t))&&!(o&&o.get)&&(a=Nc(r,t,a)())}return jf(a)?x7(a):a},has(e,t){return t===Vg||t===hi||t===Lg||t===rl||t===ma||t==="__proto__"?!0:($g()&&Nc(Hf(e,ma),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:zV,getOwnPropertyDescriptor:UV};function Uf(e,t,n,r=!1){if(!r&&e[t]===n)return;const i=e[t],a=e.length;n===void 0?(delete e[t],e[ma]&&e[ma][t]&&i!==void 0&&e[ma][t].$()):(e[t]=n,e[ma]&&e[ma][t]&&i===void 0&&e[ma][t].$());let o=Hf(e,rl),s;if((s=Nc(o,t,i))&&s.$(()=>n),Array.isArray(e)&&e.length!==a){for(let l=e.length;l<a;l++)(s=o[l])&&s.$();(s=Nc(o,"length",a))&&s.$(e.length)}(s=o[C7])&&s.$()}function A7(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const i=n[r];Uf(e,i,t[i])}}function qV(e,t){if(typeof t=="function"&&(t=t(e)),t=Oc(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const i=t[n];e[n]!==i&&Uf(e,n,i)}Uf(e,"length",r)}else A7(e,t)}function Lu(e,t,n=[]){let r,i=e;if(t.length>1){r=t.shift();const o=typeof r,s=Array.isArray(e);if(Array.isArray(r)){for(let l=0;l<r.length;l++)Lu(e,[r[l]].concat(t),n);return}else if(s&&o==="function"){for(let l=0;l<e.length;l++)r(e[l],l)&&Lu(e,[l].concat(t),n);return}else if(s&&o==="object"){const{from:l=0,to:u=e.length-1,by:c=1}=r;for(let d=l;d<=u;d+=c)Lu(e,[d].concat(t),n);return}else if(t.length>1){Lu(e[r],t,[r].concat(n));return}i=e[r],n=[r].concat(n)}let a=t[0];typeof a=="function"&&(a=a(i,n),a===i)||r===void 0&&a==null||(a=Oc(a),r===void 0||jf(i)&&jf(a)&&!Array.isArray(a)?A7(i,a):Uf(e,r,a))}function WV(...[e,t]){const n=Oc(e||{}),r=Array.isArray(n),i=x7(n);function a(...o){xl(()=>{r&&o.length===1?qV(n,o[0]):Lu(n,o)})}return[i,a]}function k7(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=k7(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function KV(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=k7(e))&&(r&&(r+=" "),r+=t);return r}const Hy="-",GV=e=>{const t=ZV(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const s=o.split(Hy);return s[0]===""&&s.length!==1&&s.shift(),S7(s,t)||YV(o)},getConflictingClassGroupIds:(o,s)=>{const l=n[o]||[];return s&&r[o]?[...l,...r[o]]:l}}},S7=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?S7(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const a=e.join(Hy);return(o=t.validators.find(({validator:s})=>s(a)))==null?void 0:o.classGroupId},xE=/^\[(.+)\]$/,YV=e=>{if(xE.test(e)){const t=xE.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},ZV=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return XV(Object.entries(e.classGroups),n).forEach(([a,o])=>{qg(o,r,a,t)}),r},qg=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const a=i===""?t:wE(t,i);a.classGroupId=n;return}if(typeof i=="function"){if(QV(i)){qg(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([a,o])=>{qg(o,wE(t,a),n,r)})})},wE=(e,t)=>{let n=e;return t.split(Hy).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},QV=e=>e.isThemeGetter,XV=(e,t)=>t?e.map(([n,r])=>{const i=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([o,s])=>[t+o,s])):a);return[n,i]}):e,JV=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(a,o)=>{n.set(a,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let o=n.get(a);if(o!==void 0)return o;if((o=r.get(a))!==void 0)return i(a,o),o},set(a,o){n.has(a)?n.set(a,o):i(a,o)}}},D7="!",eq=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],a=t.length,o=s=>{const l=[];let u=0,c=0,d;for(let y=0;y<s.length;y++){let v=s[y];if(u===0){if(v===i&&(r||s.slice(y,y+a)===t)){l.push(s.slice(c,y)),c=y+a;continue}if(v==="/"){d=y;continue}}v==="["?u++:v==="]"&&u--}const f=l.length===0?s:s.substring(c),h=f.startsWith(D7),m=h?f.substring(1):f,p=d&&d>c?d-c:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:p}};return n?s=>n({className:s,parseClassName:o}):o},tq=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},nq=e=>({cache:JV(e.cacheSize),parseClassName:eq(e),...GV(e)}),rq=/\s+/,iq=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],o=e.trim().split(rq);let s="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=n(u);let m=!!h,p=r(m?f.substring(0,h):f);if(!p){if(!m){s=u+(s.length>0?" "+s:s);continue}if(p=r(f),!p){s=u+(s.length>0?" "+s:s);continue}m=!1}const y=tq(c).join(":"),v=d?y+D7:y,b=v+p;if(a.includes(b))continue;a.push(b);const _=i(p,m);for(let T=0;T<_.length;++T){const C=_[T];a.push(v+C)}s=u+(s.length>0?" "+s:s)}return s};function aq(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=O7(t))&&(r&&(r+=" "),r+=n);return r}const O7=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=O7(e[r]))&&(n&&(n+=" "),n+=t);return n};function AE(e,...t){let n,r,i,a=o;function o(l){const u=t.reduce((c,d)=>d(c),e());return n=nq(u),r=n.cache.get,i=n.cache.set,a=s,s(l)}function s(l){const u=r(l);if(u)return u;const c=iq(l,n);return i(l,c),c}return function(){return a(aq.apply(null,arguments))}}const Yt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},N7=/^\[(?:([a-z-]+):)?(.+)\]$/i,oq=/^\d+\/\d+$/,sq=new Set(["px","full","screen"]),lq=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,uq=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,cq=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,dq=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,fq=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,na=e=>il(e)||sq.has(e)||oq.test(e),ja=e=>Vl(e,"length",Eq),il=e=>!!e&&!Number.isNaN(Number(e)),Nm=e=>Vl(e,"number",il),du=e=>!!e&&Number.isInteger(Number(e)),hq=e=>e.endsWith("%")&&il(e.slice(0,-1)),st=e=>N7.test(e),Ha=e=>lq.test(e),pq=new Set(["length","size","percentage"]),mq=e=>Vl(e,pq,I7),gq=e=>Vl(e,"position",I7),vq=new Set(["image","url"]),yq=e=>Vl(e,vq,Tq),bq=e=>Vl(e,"",_q),fu=()=>!0,Vl=(e,t,n)=>{const r=N7.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Eq=e=>uq.test(e)&&!cq.test(e),I7=()=>!1,_q=e=>dq.test(e),Tq=e=>fq.test(e),kE=()=>{const e=Yt("colors"),t=Yt("spacing"),n=Yt("blur"),r=Yt("brightness"),i=Yt("borderColor"),a=Yt("borderRadius"),o=Yt("borderSpacing"),s=Yt("borderWidth"),l=Yt("contrast"),u=Yt("grayscale"),c=Yt("hueRotate"),d=Yt("invert"),f=Yt("gap"),h=Yt("gradientColorStops"),m=Yt("gradientColorStopPositions"),p=Yt("inset"),y=Yt("margin"),v=Yt("opacity"),b=Yt("padding"),_=Yt("saturate"),T=Yt("scale"),C=Yt("sepia"),x=Yt("skew"),w=Yt("space"),P=Yt("translate"),O=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",st,t],D=()=>[st,t],S=()=>["",na,ja],B=()=>["auto",il,st],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],F=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ne=()=>["start","end","center","between","around","evenly","stretch"],J=()=>["","0",st],I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>[il,st];return{cacheSize:500,separator:":",theme:{colors:[fu],spacing:[na,ja],blur:["none","",Ha,st],brightness:A(),borderColor:[e],borderRadius:["none","","full",Ha,st],borderSpacing:D(),borderWidth:S(),contrast:A(),grayscale:J(),hueRotate:A(),invert:J(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[hq,ja],inset:R(),margin:R(),opacity:A(),padding:D(),saturate:A(),scale:A(),sepia:J(),skew:A(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",st]}],container:["container"],columns:[{columns:[Ha]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...H(),st]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",du,st]}],basis:[{basis:R()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",st]}],grow:[{grow:J()}],shrink:[{shrink:J()}],order:[{order:["first","last","none",du,st]}],"grid-cols":[{"grid-cols":[fu]}],"col-start-end":[{col:["auto",{span:["full",du,st]},st]}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":[fu]}],"row-start-end":[{row:["auto",{span:[du,st]},st]}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",st]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",st]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...ne()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ne(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ne(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[w]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[w]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",st,t]}],"min-w":[{"min-w":[st,t,"min","max","fit"]}],"max-w":[{"max-w":[st,t,"none","full","min","max","fit","prose",{screen:[Ha]},Ha]}],h:[{h:[st,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[st,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[st,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[st,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ha,ja]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Nm]}],"font-family":[{font:[fu]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",st]}],"line-clamp":[{"line-clamp":["none",il,Nm]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",na,st]}],"list-image":[{"list-image":["none",st]}],"list-style-type":[{list:["none","disc","decimal",st]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",na,ja]}],"underline-offset":[{"underline-offset":["auto",na,st]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",st]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",st]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...H(),gq]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",mq]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},yq]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...$(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:$()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...$()]}],"outline-offset":[{"outline-offset":[na,st]}],"outline-w":[{outline:[na,ja]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:S()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[na,ja]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ha,bq]}],"shadow-color":[{shadow:[fu]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...F(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":F()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ha,st]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[_]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",st]}],duration:[{duration:A()}],ease:[{ease:["linear","in","out","in-out",st]}],delay:[{delay:A()}],animate:[{animate:["none","spin","ping","pulse","bounce",st]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[du,st]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[x]}],"skew-y":[{"skew-y":[x]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",st]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",st]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",st]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[na,ja,Nm]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Cq=(e,{cacheSize:t,prefix:n,separator:r,experimentalParseClassName:i,extend:a={},override:o={}})=>{$u(e,"cacheSize",t),$u(e,"prefix",n),$u(e,"separator",r),$u(e,"experimentalParseClassName",i);for(const s in o)xq(e[s],o[s]);for(const s in a)wq(e[s],a[s]);return e},$u=(e,t,n)=>{n!==void 0&&(e[t]=n)},xq=(e,t)=>{if(t)for(const n in t)$u(e,n,t[n])},wq=(e,t)=>{if(t)for(const n in t){const r=t[n];r!==void 0&&(e[n]=(e[n]||[]).concat(r))}},Aq=(e,...t)=>typeof e=="function"?AE(kE,e,...t):AE(()=>Cq(kE(),e),...t);function P7(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=P7(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function kq(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=P7(e))&&(r&&(r+=" "),r+=t);return r}const SE=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,DE=kq,Sq=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return DE(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(u=>{const c=n==null?void 0:n[u],d=a==null?void 0:a[u];if(c===null)return null;const f=SE(c)||SE(d);return i[u][f]}),s=n&&Object.entries(n).reduce((u,c)=>{let[d,f]=c;return f===void 0||(u[d]=f),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:f,...h}=c;return Object.entries(h).every(m=>{let[p,y]=m;return Array.isArray(y)?y.includes({...a,...s}[p]):{...a,...s}[p]===y})?[...u,d,f]:u},[]);return DE(e,o,l,n==null?void 0:n.class,n==null?void 0:n.className)};var Dq=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function OE(e){const t={};let n;for(;n=Dq.exec(e);)t[n[1]]=n[2];return t}function Oq(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=OE(e)}else typeof t=="string"&&(t=OE(t));return{...e,...t}}function R7(e,t){e.indexOf(t)===-1&&e.push(t)}function Nq(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const F7=(e,t,n)=>Math.min(Math.max(n,e),t),ui={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},Ic=e=>typeof e=="number",al=e=>Array.isArray(e)&&!Ic(e[0]),Iq=(e,t,n)=>{const r=t-e;return((n-e)%r+r)%r+e};function Pq(e,t){return al(e)?e[Iq(0,e.length,t)]:e}const M7=(e,t,n)=>-n*e+n*t+e,B7=()=>{},to=e=>e,Uy=(e,t,n)=>t-e===0?1:(n-e)/(t-e);function L7(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Uy(0,t,r);e.push(M7(n,1,i))}}function Rq(e){const t=[0];return L7(t,e-1),t}function Fq(e,t=Rq(e.length),n=to){const r=e.length,i=r-t.length;return i>0&&L7(t,i),a=>{let o=0;for(;o<r-2&&!(a<t[o+1]);o++);let s=F7(0,1,Uy(t[o],t[o+1],a));return s=Pq(n,o)(s),M7(e[o],e[o+1],s)}}const $7=e=>Array.isArray(e)&&Ic(e[0]),Wg=e=>typeof e=="object"&&!!e.createAnimation,Pc=e=>typeof e=="function",Mq=e=>typeof e=="string",Im={ms:e=>e*1e3,s:e=>e/1e3},j7=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Bq=1e-7,Lq=12;function $q(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=j7(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Bq&&++s<Lq);return o}function ju(e,t,n,r){if(e===t&&n===r)return to;const i=a=>$q(a,0,1,e,n);return a=>a===0||a===1?a:j7(i(a),t,r)}const jq=(e,t="end")=>n=>{n=t==="end"?Math.min(n,.999):Math.max(n,.001);const r=n*e,i=t==="end"?Math.floor(r):Math.ceil(r);return F7(0,1,i/e)},Hq={ease:ju(.25,.1,.25,1),"ease-in":ju(.42,0,1,1),"ease-in-out":ju(.42,0,.58,1),"ease-out":ju(0,0,.58,1)},Uq=/\((.*?)\)/;function NE(e){if(Pc(e))return e;if($7(e))return ju(...e);const t=Hq[e];if(t)return t;if(e.startsWith("steps")){const n=Uq.exec(e);if(n){const r=n[1].split(",");return jq(parseFloat(r[0]),r[1].trim())}}return to}class zq{constructor(t,n=[0,1],{easing:r,duration:i=ui.duration,delay:a=ui.delay,endDelay:o=ui.endDelay,repeat:s=ui.repeat,offset:l,direction:u="normal",autoplay:c=!0}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=to,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((f,h)=>{this.resolve=f,this.reject=h}),r=r||ui.easing,Wg(r)){const f=r.createAnimation(n);r=f.easing,n=f.keyframes||n,i=f.duration||i}this.repeat=s,this.easing=al(r)?to:NE(r),this.updateDuration(i);const d=Fq(n,l,al(r)?r.map(NE):to);this.tick=f=>{var h;a=a;let m=0;this.pauseTime!==void 0?m=this.pauseTime:m=(f-this.startTime)*this.rate,this.t=m,m/=1e3,m=Math.max(m-a,0),this.playState==="finished"&&this.pauseTime===void 0&&(m=this.totalDuration);const p=m/this.duration;let y=Math.floor(p),v=p%1;!v&&p>=1&&(v=1),v===1&&y--;const b=y%2;(u==="reverse"||u==="alternate"&&b||u==="alternate-reverse"&&!b)&&(v=1-v);const _=m>=this.totalDuration?1:Math.min(v,1),T=d(this.easing(_));t(T),this.pauseTime===void 0&&(this.playState==="finished"||m>=this.totalDuration+o)?(this.playState="finished",(h=this.resolve)===null||h===void 0||h.call(this,T)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},c&&this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=t-this.pauseTime:this.startTime||(this.startTime=t),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var t;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(t=this.reject)===null||t===void 0||t.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(t){this.duration=t,this.totalDuration=t*(this.repeat+1)}get currentTime(){return this.t}set currentTime(t){this.pauseTime!==void 0||this.rate===0?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}var H7=function(){};process.env.NODE_ENV!=="production"&&(H7=function(e,t){if(!e)throw new Error(t)});class Vq{setAnimation(t){this.animation=t,t==null||t.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const Pm=new WeakMap;function U7(e){return Pm.has(e)||Pm.set(e,{transforms:[],values:new Map}),Pm.get(e)}function qq(e,t){return e.has(t)||e.set(t,new Vq),e.get(t)}const Wq=["","X","Y","Z"],Kq=["translate","scale","rotate","skew"],Al={x:"translateX",y:"translateY",z:"translateZ"},IE={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:e=>e+"deg"},Gq={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:e=>e+"px"},rotate:IE,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:to},skew:IE},kl=new Map,Mh=e=>`--motion-${e}`,zf=["x","y","z"];Kq.forEach(e=>{Wq.forEach(t=>{zf.push(e+t),kl.set(Mh(e+t),Gq[e])})});const Yq=(e,t)=>zf.indexOf(e)-zf.indexOf(t),Zq=new Set(zf),zy=e=>Zq.has(e),Qq=(e,t)=>{Al[t]&&(t=Al[t]);const{transforms:n}=U7(e);R7(n,t),e.style.transform=z7(n)},z7=e=>e.sort(Yq).reduce(Xq,"").trim(),Xq=(e,t)=>`${e} ${t}(var(${Mh(t)}))`,Kg=e=>e.startsWith("--"),PE=new Set;function Jq(e){if(!PE.has(e)){PE.add(e);try{const{syntax:t,initialValue:n}=kl.has(e)?kl.get(e):{};CSS.registerProperty({name:e,inherits:!1,syntax:t,initialValue:n})}catch{}}}const Rm=(e,t)=>document.createElement("div").animate(e,t),RE={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{Rm({opacity:[1]})}catch{return!1}return!0},finished:()=>!!Rm({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{Rm({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},Fm={},Zs={};for(const e in RE)Zs[e]=()=>(Fm[e]===void 0&&(Fm[e]=RE[e]()),Fm[e]);const eW=.015,tW=(e,t)=>{let n="";const r=Math.round(t/eW);for(let i=0;i<r;i++)n+=e(Uy(0,r-1,i))+", ";return n.substring(0,n.length-2)},FE=(e,t)=>Pc(e)?Zs.linearEasing()?`linear(${tW(e,t)})`:ui.easing:$7(e)?nW(e):e,nW=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`;function rW(e,t){for(let n=0;n<e.length;n++)e[n]===null&&(e[n]=n?e[n-1]:t());return e}const iW=e=>Array.isArray(e)?e:[e];function Gg(e){return Al[e]&&(e=Al[e]),zy(e)?Mh(e):e}const Hu={get:(e,t)=>{t=Gg(t);let n=Kg(t)?e.style.getPropertyValue(t):getComputedStyle(e)[t];if(!n&&n!==0){const r=kl.get(t);r&&(n=r.initialValue)}return n},set:(e,t,n)=>{t=Gg(t),Kg(t)?e.style.setProperty(t,n):e.style[t]=n}};function aW(e,t=!0){if(!(!e||e.playState==="finished"))try{e.stop?e.stop():(t&&e.commitStyles(),e.cancel())}catch{}}function oW(e,t){var n;let r=(t==null?void 0:t.toDefaultUnit)||to;const i=e[e.length-1];if(Mq(i)){const a=((n=i.match(/(-?[\d.]+)([a-z%]*)/))===null||n===void 0?void 0:n[2])||"";a&&(r=o=>o+a)}return r}function sW(){return window.__MOTION_DEV_TOOLS_RECORD}function lW(e,t,n,r={},i){const a=sW(),o=r.record!==!1&&a;let s,{duration:l=ui.duration,delay:u=ui.delay,endDelay:c=ui.endDelay,repeat:d=ui.repeat,easing:f=ui.easing,persist:h=!1,direction:m,offset:p,allowWebkitAcceleration:y=!1,autoplay:v=!0}=r;const b=U7(e),_=zy(t);let T=Zs.waapi();_&&Qq(e,t);const C=Gg(t),x=qq(b.values,C),w=kl.get(C);return aW(x.animation,!(Wg(f)&&x.generator)&&r.record!==!1),()=>{const P=()=>{var R,D;return(D=(R=Hu.get(e,C))!==null&&R!==void 0?R:w==null?void 0:w.initialValue)!==null&&D!==void 0?D:0};let O=rW(iW(n),P);const M=oW(O,w);if(Wg(f)){const R=f.createAnimation(O,t!=="opacity",P,C,x);f=R.easing,O=R.keyframes||O,l=R.duration||l}if(Kg(C)&&(Zs.cssRegisterProperty()?Jq(C):T=!1),_&&!Zs.linearEasing()&&(Pc(f)||al(f)&&f.some(Pc))&&(T=!1),T){w&&(O=O.map(S=>Ic(S)?w.toDefaultUnit(S):S)),O.length===1&&(!Zs.partialKeyframes()||o)&&O.unshift(P());const R={delay:Im.ms(u),duration:Im.ms(l),endDelay:Im.ms(c),easing:al(f)?void 0:FE(f,l),direction:m,iterations:d+1,fill:"both"};s=e.animate({[C]:O,offset:p,easing:al(f)?f.map(S=>FE(S,l)):void 0},R),s.finished||(s.finished=new Promise((S,B)=>{s.onfinish=S,s.oncancel=B}));const D=O[O.length-1];s.finished.then(()=>{h||(Hu.set(e,C,D),s.cancel())}).catch(B7),y||(s.playbackRate=1.000001)}else if(i&&_)O=O.map(R=>typeof R=="string"?parseFloat(R):R),O.length===1&&O.unshift(parseFloat(P())),s=new i(R=>{Hu.set(e,C,M?M(R):R)},O,Object.assign(Object.assign({},r),{duration:l,easing:f}));else{const R=O[O.length-1];Hu.set(e,C,w&&Ic(R)?w.toDefaultUnit(R):R)}return o&&a(e,t,O,{duration:l,delay:u,easing:f,repeat:d,offset:p},"motion-one"),x.setAnimation(s),s&&!v&&s.pause(),s}}const uW=(e,t)=>e[t]?Object.assign(Object.assign({},e),e[t]):Object.assign({},e);function cW(e,t){var n;return typeof e=="string"?t?((n=t[e])!==null&&n!==void 0||(t[e]=document.querySelectorAll(e)),e=t[e]):e=document.querySelectorAll(e):e instanceof Element&&(e=[e]),Array.from(e||[])}const dW={any:0,all:1};function fW(e,t,{root:n,margin:r,amount:i="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const a=cW(e),o=new WeakMap,s=u=>{u.forEach(c=>{const d=o.get(c.target);if(c.isIntersecting!==!!d)if(c.isIntersecting){const f=t(c);Pc(f)?o.set(c.target,f):l.unobserve(c.target)}else d&&(d(c),o.delete(c.target))})},l=new IntersectionObserver(s,{root:n,rootMargin:r,threshold:typeof i=="number"?i:dW[i]});return a.forEach(u=>l.observe(u)),()=>l.disconnect()}function hW(e,t){return typeof e!=typeof t?!0:Array.isArray(e)&&Array.isArray(t)?!pW(e,t):e!==t}function pW(e,t){const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function mW(e){return typeof e=="object"}function ME(e,t){if(mW(e))return e;if(e&&t)return t[e]}let no;function gW(){if(!no)return;const e=no.sort(yW).map(bW);e.forEach(BE),e.forEach(BE),no=void 0}function Mm(e){no?R7(no,e):(no=[e],requestAnimationFrame(gW))}function vW(e){no&&Nq(no,e)}const yW=(e,t)=>e.getDepth()-t.getDepth(),bW=e=>e.animateUpdates(),BE=e=>e.next(),LE=(e,t)=>new CustomEvent(e,{detail:{target:t}});function Yg(e,t,n){e.dispatchEvent(new CustomEvent(t,{detail:{originalEvent:n}}))}function $E(e,t,n){e.dispatchEvent(new CustomEvent(t,{detail:{originalEntry:n}}))}const EW={isActive:e=>!!e.inView,subscribe:(e,{enable:t,disable:n},{inViewOptions:r={}})=>{const{once:i}=r,a=NC.__rest(r,["once"]);return fW(e,o=>{if(t(),$E(e,"viewenter",o),!i)return s=>{n(),$E(e,"viewleave",s)}},a)}},jE=(e,t,n)=>r=>{r.pointerType&&r.pointerType!=="mouse"||(n(),Yg(e,t,r))},_W={isActive:e=>!!e.hover,subscribe:(e,{enable:t,disable:n})=>{const r=jE(e,"hoverstart",t),i=jE(e,"hoverend",n);return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",i),()=>{e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",i)}}},TW={isActive:e=>!!e.press,subscribe:(e,{enable:t,disable:n})=>{const r=a=>{n(),Yg(e,"pressend",a),window.removeEventListener("pointerup",r)},i=a=>{t(),Yg(e,"pressstart",a),window.addEventListener("pointerup",r)};return e.addEventListener("pointerdown",i),()=>{e.removeEventListener("pointerdown",i),window.removeEventListener("pointerup",r)}}},Ud={inView:EW,hover:_W,press:TW},HE=["initial","animate",...Object.keys(Ud),"exit"],Zg=new WeakMap;function CW(e={},t){let n,r=t?t.getDepth()+1:0;const i={initial:!0,animate:!0},a={},o={};for(const p of HE)o[p]=typeof e[p]=="string"?e[p]:t==null?void 0:t.getContext()[p];const s=e.initial===!1?"animate":"initial";let l=ME(e[s]||o[s],e.variants)||{},u=NC.__rest(l,["transition"]);const c=Object.assign({},u);function*d(){var p,y;const v=u;u={};const b={};for(const w of HE){if(!i[w])continue;const P=ME(e[w]);if(P)for(const O in P)O!=="transition"&&(u[O]=P[O],b[O]=uW((y=(p=P.transition)!==null&&p!==void 0?p:e.transition)!==null&&y!==void 0?y:{},O))}const _=new Set([...Object.keys(u),...Object.keys(v)]),T=[];_.forEach(w=>{var P;u[w]===void 0&&(u[w]=c[w]),hW(v[w],u[w])&&((P=c[w])!==null&&P!==void 0||(c[w]=Hu.get(n,w)),T.push(lW(n,w,u[w],b[w],zq)))}),yield;const C=T.map(w=>w()).filter(Boolean);if(!C.length)return;const x=u;n.dispatchEvent(LE("motionstart",x)),Promise.all(C.map(w=>w.finished)).then(()=>{n.dispatchEvent(LE("motioncomplete",x))}).catch(B7)}const f=(p,y)=>()=>{i[p]=y,Mm(m)},h=()=>{for(const p in Ud){const y=Ud[p].isActive(e),v=a[p];y&&!v?a[p]=Ud[p].subscribe(n,{enable:f(p,!0),disable:f(p,!1)},e):!y&&v&&(v(),delete a[p])}},m={update:p=>{n&&(e=p,h(),Mm(m))},setActive:(p,y)=>{n&&(i[p]=y,Mm(m))},animateUpdates:d,getDepth:()=>r,getTarget:()=>u,getOptions:()=>e,getContext:()=>o,mount:p=>(H7(!!p,"Animation state must be mounted with valid Element"),n=p,Zg.set(n,m),h(),()=>{Zg.delete(n),vW(m);for(const y in a)a[y]()}),isMounted:()=>!!n};return m}function xW(e){const t={},n=[];for(let r in e){const i=e[r];zy(r)&&(Al[r]&&(r=Al[r]),n.push(r),r=Mh(r));let a=Array.isArray(i)?i[0]:i;const o=kl.get(r);o&&(a=Ic(i)?o.toDefaultUnit(i):i),t[r]=a}return n.length&&(t.transform=z7(n)),t}var UE=e=>e instanceof Element;function Qg(e,t){if(t(e))return e;if(typeof e=="function"&&!e.length)return Qg(e(),t);if(Array.isArray(e))for(const n of e){const r=Qg(n,t);if(r)return r}return null}function wW(e,t=UE,n=UE){const r=He(e);return He(()=>Qg(r(),t))}var AW=()=>{},zE=(e,t)=>t();function kW(e,t){const n=xn(e),r=n?[n]:[],{onEnter:i=zE,onExit:a=zE}=t,[o,s]=Me(t.appear?[]:r),[l]=hV();let u,c=!1;function d(m,p){if(!m)return p&&p();c=!0,a(m,()=>{xl(()=>{c=!1,s(y=>y.filter(v=>v!==m)),p&&p()})})}function f(m){const p=u;if(!p)return m&&m();u=void 0,s(y=>[p,...y]),i(p,m??AW)}const h=t.mode==="out-in"?m=>c||d(m,f):t.mode==="in-out"?m=>f(()=>d(m)):m=>{d(m),f()};return Bf(m=>{const p=e();return xn(l)?(l(),m):(p!==m&&(u=p,xl(()=>xn(()=>h(m)))),p)},t.appear?void 0:n),o}var V7=vi(),SW=e=>{const[t,n]=Me(!0),r={initial:e.initial??!0,mount:t},i=Z(V7.Provider,{value:r,get children(){return kW(wW(()=>e.children),{appear:r.initial,mode:e.exitBeforeEnter?"out-in":"parallel",onExit(a,o){xl(()=>{var s;n(!1),(s=Zg.get(a))!=null&&s.getOptions().exit?a.addEventListener("motioncomplete",o):o()})},onEnter(a,o){xl(()=>{n(!0),o()})}})}});return r.initial=!0,i};function DW(e,t,n,r){const i=CW((n==null?void 0:n.initial)===!1?{...t(),initial:!1}:t(),r);return cn(()=>{if(n&&!n.mount())return;const a=e(),o=i.mount(a);cn(()=>i.update(t())),dn(()=>{n&&t().exit?(i.setActive("exit",!0),a.addEventListener("motioncomplete",o)):o()})}),[i,xW(i.getTarget())]}var OW=["initial","animate","inView","inViewOptions","hover","press","variants","transition","exit"],NW=["tag"],VE=vi(),qE=e=>{const[t,,n]=wn(e,OW,NW),[r,i]=DW(()=>a,()=>({...t}),lr(V7),lr(VE));let a;return Z(VE.Provider,{value:r,get children(){return Z(Fh,At(n,{ref:o=>{var s;a=o,(s=e.ref)==null||s.call(e,o)},get component(){return e.tag||"div"},get style(){return Oq(e.style,i)}}))}})},WE=new Proxy(qE,{get:(e,t)=>n=>Z(qE,At(n,{tag:t}))});const IW=Math.min,PW=Math.max,RW={left:"right",right:"left",bottom:"top",top:"bottom"},FW={start:"end",end:"start"};function KE(e,t,n){return PW(e,IW(t,n))}function Bh(e,t){return typeof e=="function"?e(t):e}function rs(e){return e.split("-")[0]}function Lh(e){return e.split("-")[1]}function q7(e){return e==="x"?"y":"x"}function W7(e){return e==="y"?"height":"width"}function $h(e){return["top","bottom"].includes(rs(e))?"y":"x"}function K7(e){return q7($h(e))}function MW(e,t,n){n===void 0&&(n=!1);const r=Lh(e),i=K7(e),a=W7(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=Vf(o)),[o,Vf(o)]}function BW(e){const t=Vf(e);return[Xg(e),t,Xg(t)]}function Xg(e){return e.replace(/start|end/g,t=>FW[t])}function LW(e,t,n){const r=["left","right"],i=["right","left"],a=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?a:o;default:return[]}}function $W(e,t,n,r){const i=Lh(e);let a=LW(rs(e),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(Xg)))),a}function Vf(e){return e.replace(/left|right|bottom|top/g,t=>RW[t])}function jW(e){return{top:0,right:0,bottom:0,left:0,...e}}function HW(e){return typeof e!="number"?jW(e):{top:e,right:e,bottom:e,left:e}}function qf(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function GE(e,t,n){let{reference:r,floating:i}=e;const a=$h(t),o=K7(t),s=W7(o),l=rs(t),u=a==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2;let h;switch(l){case"top":h={x:c,y:r.y-i.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-i.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Lh(t)){case"start":h[o]-=f*(n&&u?-1:1);break;case"end":h[o]+=f*(n&&u?-1:1);break}return h}const UW=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,s=a.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=GE(u,r,l),f=r,h={},m=0;for(let p=0;p<s.length;p++){const{name:y,fn:v}=s[p],{x:b,y:_,data:T,reset:C}=await v({x:c,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:h,rects:u,platform:o,elements:{reference:e,floating:t}});c=b??c,d=_??d,h={...h,[y]:{...h[y],...T}},C&&m<=50&&(m++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(u=C.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:c,y:d}=GE(u,f,l)),p=-1)}return{x:c,y:d,placement:f,strategy:i,middlewareData:h}};async function G7(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:o,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Bh(t,e),m=HW(h),y=s[f?d==="floating"?"reference":"floating":d],v=qf(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(y)))==null||n?y:y.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),b=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,_=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),T=await(a.isElement==null?void 0:a.isElement(_))?await(a.getScale==null?void 0:a.getScale(_))||{x:1,y:1}:{x:1,y:1},C=qf(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:_,strategy:l}):b);return{top:(v.top-C.top+m.top)/T.y,bottom:(C.bottom-v.bottom+m.bottom)/T.y,left:(v.left-C.left+m.left)/T.x,right:(C.right-v.right+m.right)/T.x}}const zW=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:o,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...y}=Bh(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const v=rs(i),b=rs(s)===s,_=await(l.isRTL==null?void 0:l.isRTL(u.floating)),T=f||(b||!p?[Vf(s)]:BW(s));!f&&m!=="none"&&T.push(...$W(s,p,m,_));const C=[s,...T],x=await G7(t,y),w=[];let P=((r=a.flip)==null?void 0:r.overflows)||[];if(c&&w.push(x[v]),d){const D=MW(i,o,_);w.push(x[D[0]],x[D[1]])}if(P=[...P,{placement:i,overflows:w}],!w.every(D=>D<=0)){var O,M;const D=(((O=a.flip)==null?void 0:O.index)||0)+1,S=C[D];if(S)return{data:{index:D,overflows:P},reset:{placement:S}};let B=(M=P.filter(H=>H.overflows[0]<=0).sort((H,$)=>H.overflows[1]-$.overflows[1])[0])==null?void 0:M.placement;if(!B)switch(h){case"bestFit":{var R;const H=(R=P.map($=>[$.placement,$.overflows.filter(F=>F>0).reduce((F,ne)=>F+ne,0)]).sort(($,F)=>$[1]-F[1])[0])==null?void 0:R[0];H&&(B=H);break}case"initialPlacement":B=s;break}if(i!==B)return{reset:{placement:B}}}return{}}}};async function VW(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=rs(n),s=Lh(n),l=$h(n)==="y",u=["left","top"].includes(o)?-1:1,c=a&&l?-1:1,d=Bh(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&typeof m=="number"&&(h=s==="end"?m*-1:m),l?{x:h*c,y:f*u}:{x:f*u,y:h*c}}const qW=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:o,middlewareData:s}=t,l=await VW(t,e);return o===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:o}}}}},WW=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:y=>{let{x:v,y:b}=y;return{x:v,y:b}}},...l}=Bh(e,t),u={x:n,y:r},c=await G7(t,l),d=$h(rs(i)),f=q7(d);let h=u[f],m=u[d];if(a){const y=f==="y"?"top":"left",v=f==="y"?"bottom":"right",b=h+c[y],_=h-c[v];h=KE(b,h,_)}if(o){const y=d==="y"?"top":"left",v=d==="y"?"bottom":"right",b=m+c[y],_=m-c[v];m=KE(b,m,_)}const p=s.fn({...t,[f]:h,[d]:m});return{...p,data:{x:p.x-n,y:p.y-r}}}}},Jg=Math.min,ol=Math.max,Wf=Math.round,F1=Math.floor,Mi=e=>({x:e,y:e});function jh(){return typeof window<"u"}function ql(e){return Y7(e)?(e.nodeName||"").toLowerCase():"#document"}function _r(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Qi(e){var t;return(t=(Y7(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Y7(e){return jh()?e instanceof Node||e instanceof _r(e).Node:!1}function pi(e){return jh()?e instanceof Element||e instanceof _r(e).Element:!1}function Ki(e){return jh()?e instanceof HTMLElement||e instanceof _r(e).HTMLElement:!1}function YE(e){return!jh()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof _r(e).ShadowRoot}function Kc(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=mi(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function KW(e){return["table","td","th"].includes(ql(e))}function Hh(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Vy(e){const t=qy(),n=pi(e)?mi(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function GW(e){let t=so(e);for(;Ki(t)&&!Sl(t);){if(Vy(t))return t;if(Hh(t))return null;t=so(t)}return null}function qy(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Sl(e){return["html","body","#document"].includes(ql(e))}function mi(e){return _r(e).getComputedStyle(e)}function Uh(e){return pi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function so(e){if(ql(e)==="html")return e;const t=e.assignedSlot||e.parentNode||YE(e)&&e.host||Qi(e);return YE(t)?t.host:t}function Z7(e){const t=so(e);return Sl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ki(t)&&Kc(t)?t:Z7(t)}function Rc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Z7(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=_r(i);if(a){const s=ev(o);return t.concat(o,o.visualViewport||[],Kc(i)?i:[],s&&n?Rc(s):[])}return t.concat(i,Rc(i,[],n))}function ev(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Q7(e){const t=mi(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Ki(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Wf(n)!==a||Wf(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Wy(e){return pi(e)?e:e.contextElement}function sl(e){const t=Wy(e);if(!Ki(t))return Mi(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Q7(t);let o=(a?Wf(n.width):n.width)/r,s=(a?Wf(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const YW=Mi(0);function X7(e){const t=_r(e);return!qy()||!t.visualViewport?YW:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ZW(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==_r(e)?!1:t}function is(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=Wy(e);let o=Mi(1);t&&(r?pi(r)&&(o=sl(r)):o=sl(e));const s=ZW(a,n,r)?X7(a):Mi(0);let l=(i.left+s.x)/o.x,u=(i.top+s.y)/o.y,c=i.width/o.x,d=i.height/o.y;if(a){const f=_r(a),h=r&&pi(r)?_r(r):r;let m=f,p=ev(m);for(;p&&r&&h!==m;){const y=sl(p),v=p.getBoundingClientRect(),b=mi(p),_=v.left+(p.clientLeft+parseFloat(b.paddingLeft))*y.x,T=v.top+(p.clientTop+parseFloat(b.paddingTop))*y.y;l*=y.x,u*=y.y,c*=y.x,d*=y.y,l+=_,u+=T,m=_r(p),p=ev(m)}}return qf({width:c,height:d,x:l,y:u})}function Ky(e,t){const n=Uh(e).scrollLeft;return t?t.left+n:is(Qi(e)).left+n}function J7(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:Ky(e,r)),a=r.top+t.scrollTop;return{x:i,y:a}}function QW(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=Qi(r),s=t?Hh(t.floating):!1;if(r===o||s&&a)return n;let l={scrollLeft:0,scrollTop:0},u=Mi(1);const c=Mi(0),d=Ki(r);if((d||!d&&!a)&&((ql(r)!=="body"||Kc(o))&&(l=Uh(r)),Ki(r))){const h=is(r);u=sl(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}const f=o&&!d&&!a?J7(o,l,!0):Mi(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:n.y*u.y-l.scrollTop*u.y+c.y+f.y}}function XW(e){return Array.from(e.getClientRects())}function JW(e){const t=Qi(e),n=Uh(e),r=e.ownerDocument.body,i=ol(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=ol(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Ky(e);const s=-n.scrollTop;return mi(r).direction==="rtl"&&(o+=ol(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function eK(e,t){const n=_r(e),r=Qi(e),i=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;const u=qy();(!u||u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:a,height:o,x:s,y:l}}function tK(e,t){const n=is(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ki(e)?sl(e):Mi(1),o=e.clientWidth*a.x,s=e.clientHeight*a.y,l=i*a.x,u=r*a.y;return{width:o,height:s,x:l,y:u}}function ZE(e,t,n){let r;if(t==="viewport")r=eK(e,n);else if(t==="document")r=JW(Qi(e));else if(pi(t))r=tK(t,n);else{const i=X7(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return qf(r)}function e6(e,t){const n=so(e);return n===t||!pi(n)||Sl(n)?!1:mi(n).position==="fixed"||e6(n,t)}function nK(e,t){const n=t.get(e);if(n)return n;let r=Rc(e,[],!1).filter(s=>pi(s)&&ql(s)!=="body"),i=null;const a=mi(e).position==="fixed";let o=a?so(e):e;for(;pi(o)&&!Sl(o);){const s=mi(o),l=Vy(o);!l&&s.position==="fixed"&&(i=null),(a?!l&&!i:!l&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Kc(o)&&!l&&e6(e,o))?r=r.filter(c=>c!==o):i=s,o=so(o)}return t.set(e,r),r}function rK(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?Hh(t)?[]:nK(t,this._c):[].concat(n),r],s=o[0],l=o.reduce((u,c)=>{const d=ZE(t,c,i);return u.top=ol(d.top,u.top),u.right=Jg(d.right,u.right),u.bottom=Jg(d.bottom,u.bottom),u.left=ol(d.left,u.left),u},ZE(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function iK(e){const{width:t,height:n}=Q7(e);return{width:t,height:n}}function aK(e,t,n){const r=Ki(t),i=Qi(t),a=n==="fixed",o=is(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Mi(0);if(r||!r&&!a)if((ql(t)!=="body"||Kc(i))&&(s=Uh(t)),r){const f=is(t,!0,a,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else i&&(l.x=Ky(i));const u=i&&!r&&!a?J7(i,s):Mi(0),c=o.left+s.scrollLeft-l.x-u.x,d=o.top+s.scrollTop-l.y-u.y;return{x:c,y:d,width:o.width,height:o.height}}function Bm(e){return mi(e).position==="static"}function QE(e,t){if(!Ki(e)||mi(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Qi(e)===n&&(n=n.ownerDocument.body),n}function t6(e,t){const n=_r(e);if(Hh(e))return n;if(!Ki(e)){let i=so(e);for(;i&&!Sl(i);){if(pi(i)&&!Bm(i))return i;i=so(i)}return n}let r=QE(e,t);for(;r&&KW(r)&&Bm(r);)r=QE(r,t);return r&&Sl(r)&&Bm(r)&&!Vy(r)?n:r||GW(e)||n}const oK=async function(e){const t=this.getOffsetParent||t6,n=this.getDimensions,r=await n(e.floating);return{reference:aK(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function sK(e){return mi(e).direction==="rtl"}const lK={convertOffsetParentRelativeRectToViewportRelativeRect:QW,getDocumentElement:Qi,getClippingRect:rK,getOffsetParent:t6,getElementRects:oK,getClientRects:XW,getDimensions:iK,getScale:sl,isElement:pi,isRTL:sK};function uK(e,t){let n=null,r;const i=Qi(e);function a(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function o(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const{left:u,top:c,width:d,height:f}=e.getBoundingClientRect();if(s||t(),!d||!f)return;const h=F1(c),m=F1(i.clientWidth-(u+d)),p=F1(i.clientHeight-(c+f)),y=F1(u),b={rootMargin:-h+"px "+-m+"px "+-p+"px "+-y+"px",threshold:ol(0,Jg(1,l))||1};let _=!0;function T(C){const x=C[0].intersectionRatio;if(x!==l){if(!_)return o();x?o(!1,x):r=setTimeout(()=>{o(!1,1e-7)},1e3)}_=!1}try{n=new IntersectionObserver(T,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(T,b)}n.observe(e)}return o(!0),a}function n6(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Wy(e),c=i||a?[...u?Rc(u):[],...Rc(t)]:[];c.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),a&&v.addEventListener("resize",n)});const d=u&&s?uK(u,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(v=>{let[b]=v;b&&b.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var _;(_=h)==null||_.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let m,p=l?is(e):null;l&&y();function y(){const v=is(e);p&&(v.x!==p.x||v.y!==p.y||v.width!==p.width||v.height!==p.height)&&n(),p=v,m=requestAnimationFrame(y)}return n(),()=>{var v;c.forEach(b=>{i&&b.removeEventListener("scroll",n),a&&b.removeEventListener("resize",n)}),d==null||d(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(m)}}const r6=qW,i6=WW,a6=zW,cK=(e,t,n)=>{const r=new Map,i={platform:lK,...n},a={...i.platform,_c:r};return UW(e,t,{...i,platform:a})};function o6(e,t,n){let r=()=>{var d;return(d=n==null?void 0:n.placement)!=null?d:"bottom"},i=()=>{var d;return(d=n==null?void 0:n.strategy)!=null?d:"absolute"},[a,o]=Me({x:null,y:null,placement:r(),strategy:i(),middlewareData:{}}),[s,l]=Me();cn(()=>{let d=s();if(d)throw d.value});let u=He(()=>(e(),t(),{}));function c(){let d=e(),f=t();if(d&&f){let h=u();cK(d,f,{middleware:n==null?void 0:n.middleware,placement:r(),strategy:i()}).then(m=>{h===u()&&o(m)},m=>{l(m)})}}return cn(()=>{let d=e(),f=t();if(n==null||n.middleware,r(),i(),d&&f)if(n!=null&&n.whileElementsMounted){let h=n.whileElementsMounted(d,f,c);h&&dn(h)}else c()}),{get x(){return a().x},get y(){return a().y},get placement(){return a().placement},get strategy(){return a().strategy},get middlewareData(){return a().middlewareData},update:c}}var dK={colorPrimary:"#0081F1",colorPrimaryForeground:"white",colorSecondary:"#F3F3F3",colorSecondaryForeground:"#1A1523",colorCounter:"#E5484D",colorCounterForeground:"white",colorBackground:"#FCFCFC",colorForeground:"#1A1523",colorNeutral:"#525252",colorShadow:"rgba(122,133,153,0.25)",fontSize:"inherit",borderRadius:"0.375rem"},fK={locale:"en-US","inbox.filters.dropdownOptions.unread":"Unread only","inbox.filters.dropdownOptions.default":"Unread & read","inbox.filters.dropdownOptions.archived":"Archived","inbox.filters.labels.unread":"Unread","inbox.filters.labels.default":"Inbox","inbox.filters.labels.archived":"Archived","notifications.emptyNotice":"No notifications","notifications.actions.readAll":"Mark all as read","notifications.actions.archiveAll":"Archive all","notifications.actions.archiveRead":"Archive read","notifications.newNotifications":({notificationCount:e})=>`${e>99?"99+":e} new ${e===1?"notification":"notifications"}`,"notification.actions.read.tooltip":"Mark as read","notification.actions.unread.tooltip":"Mark as unread","notification.actions.archive.tooltip":"Archive","notification.actions.unarchive.tooltip":"Unarchive","preferences.title":"Notification Preferences","preferences.global":"Global Preferences","preferences.workflow.disabled.notice":"Contact admin to enable subscription management for this critical notification.","preferences.workflow.disabled.tooltip":"Contact admin to edit"},[hK,pK]=Me({}),XE=["button","popoverContent","popoverTrigger","dropdownContent","dropdownTrigger","dropdownItem","dropdownItemLabel","dropdownItemLabelContainer","dropdownItemLeftIcon","dropdownItemRightIcon","tooltipContent","tooltipTrigger","back__button","skeletonText","skeletonAvatar","tabsRoot","tabsList","tabsContent","tabsTrigger","dots","root","bellIcon","bellContainer","bellDot","preferences__button","preferencesContainer","inboxHeader","loading","inboxContent","inbox__popoverTrigger","inbox__popoverContent","notificationListContainer","notificationList","notificationListEmptyNoticeContainer","notificationListEmptyNotice","notificationListEmptyNoticeIcon","notificationListNewNotificationsNotice__button","notification","notificationDot","notificationSubject","notificationSubject__strong","notificationBody","notificationBody__strong","notificationBodyContainer","notificationImage","notificationDate","notificationDefaultActions","notificationCustomActions","notificationPrimaryAction__button","notificationSecondaryAction__button","notificationRead__button","notificationUnread__button","notificationArchive__button","notificationUnarchive__button","notificationsTabs__tabsRoot","notificationsTabs__tabsList","notificationsTabs__tabsContent","notificationsTabs__tabsTrigger","notificationsTabsTriggerLabel","notificationsTabsTriggerCount","inboxStatus__title","inboxStatus__dropdownTrigger","inboxStatus__dropdownContent","inboxStatus__dropdownItem","inboxStatus__dropdownItemLabel","inboxStatus__dropdownItemLabelContainer","inboxStatus__dropdownItemLeft__icon","inboxStatus__dropdownItemRight__icon","moreActionsContainer","moreActions__dropdownTrigger","moreActions__dropdownContent","moreActions__dropdownItem","moreActions__dropdownItemLabel","moreActions__dropdownItemLeft__icon","moreActions__dots","moreTabs__button","moreTabs__dots","moreTabs__dropdownTrigger","moreTabs__dropdownContent","moreTabs__dropdownItem","moreTabs__dropdownItemLabel","moreTabs__dropdownItemRight__icon","workflowContainer","workflowLabel","workflowLabelContainer","workflowContainerDisabledNotice","workflowLabelDisabled__icon","workflowContainerRight__icon","workflowArrow__icon","channelContainer","channelsContainerCollapsible","channelsContainer","channelLabel","channelLabelContainer","channelDescription","channelName","channelSwitchContainer","channelSwitch","channelSwitchThumb","preferencesHeader","preferencesHeader__back__button","preferencesHeader__title","preferencesLoadingContainer","strong"];function mK(e){const[t,n]=Me([]),[r,i]=Me(!0),[a,o]=Me(0),[s,l]=Me(!1),[u,{mutate:c,refetch:d}]=p7(a,e);let f=()=>{};{const m=new IntersectionObserver(p=>{p.length>0&&p[0].isIntersecting&&!s()&&!u.loading&&o(o(t().length))});dn(()=>m.disconnect()),f=p=>{m.observe(p),dn(()=>m.unobserve(p))}}return Bf(()=>{const m=u.latest;m&&(i(!1),xl(()=>{m.hasMore||l(!0),n(m.data)}))}),[t,{initialLoading:r,setEl:f,offset:a,end:s,mutate:c,reset:()=>Ve(this,null,function*(){n([]),i(!0),l(!1),a()!==0?o(0):yield d()})}]}var gK="en-US",xo={inMinute:60,inHour:3600,inDay:86400,inWeek:604800,inMonth:2592e3};function vK({fromDate:e,locale:t=gK,toDate:n=new Date}){const r=n.getTime()-e.getTime(),i=new Intl.RelativeTimeFormat(t,{style:"narrow"}),a=Math.floor(r/1e3);return a<xo.inMinute?"Just now":a<xo.inHour?i.format(Math.floor(-a/xo.inMinute),"minute"):a<xo.inDay?i.format(Math.floor(-a/xo.inHour),"hour"):a<xo.inMonth?i.format(Math.floor(-a/xo.inDay),"day"):new Intl.DateTimeFormat(t,{month:"short",day:"numeric"}).format(e)}var yK=Aq({prefix:"nt-"});function Bn(...e){return yK(KV(e))}function s6(e){const t="abcdefghijklmnopqrstuvwxyz";let n="";const r=t.length;for(let i=0;i<e;i+=1)n+=t.charAt(Math.floor(Math.random()*r));return n}function bK(e,t){let n;do n=s6(t);while(e.has(n));return n}function EK(e){return Object.entries(e).map(([t,n])=>`${t.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${n};`).join(" ")}function _K(e,t){const n=`novu-css-${bK(e,8)}`,r=`.${n} { ${t} }`;return e.add(n),{className:n,rule:r}}var Kf=[50,100,200,300,400,500,600,700,800,900];function ra(e){return`.${e.id} { --nv-${e.key}: oklch(from ${e.color} l c h); }`}function JE(e){const t=[];for(let n=0;n<Kf.length;n+=1){const r=Kf[n],i=`.${e.id} { --nv-${e.key}-${r}: oklch(from ${e.color} calc(l - ${(r-500)/1e3}) c h); }`;t.push(i)}return t}function wo(e){const t=[];for(let n=0;n<Kf.length;n+=1){const r=Kf[n],i=`.${e.id} { --nv-${e.key}-${r}: oklch(from ${e.color} l c h / ${r/1e3}); }`;t.push(i)}return t}var TK=(e,t)=>[ra({color:e.colorBackground,key:"color-background",id:t}),ra({color:e.colorForeground,key:"color-foreground",id:t}),ra({color:e.colorPrimary,key:"color-primary",id:t}),ra({color:e.colorPrimaryForeground,key:"color-primary-foreground",id:t}),ra({color:e.colorSecondary,key:"color-secondary",id:t}),ra({color:e.colorSecondaryForeground,key:"color-secondary-foreground",id:t}),ra({color:e.colorCounter,key:"color-counter",id:t}),ra({color:e.colorCounterForeground,key:"color-counter-foreground",id:t}),ra({color:e.colorShadow,key:"color-shadow",id:t}),...wo({color:e.colorBackground,key:"color-background-alpha",id:t}),...wo({color:e.colorForeground,key:"color-foreground-alpha",id:t}),...JE({color:e.colorPrimary,key:"color-primary",id:t}),...wo({color:e.colorPrimary,key:"color-primary-alpha",id:t}),...wo({color:e.colorPrimaryForeground,key:"color-primary-foreground-alpha",id:t}),...JE({color:e.colorSecondary,key:"color-secondary",id:t}),...wo({color:e.colorSecondary,key:"color-secondary-alpha",id:t}),...wo({color:e.colorSecondaryForeground,key:"color-secondary-foreground-alpha",id:t}),...wo({color:e.colorNeutral,key:"color-neutral-alpha",id:t})],CK=e=>{const t=[],n=new Set;for(const r in e)if(e.hasOwnProperty(r)){const i=e[r];if(typeof i=="object"){const a=EK(i),{className:o,rule:s}=_K(n,a);t.push({key:r,rule:s,className:o})}}return t},ba=e=>{var t;return((t=e==null?void 0:e.filter)==null?void 0:t.tags)||(e==null?void 0:e.value)||[]},ft=()=>{const e=Gy(),[t,n]=Me(!0);return sr(()=>{n(!1)}),He(()=>(i,a)=>{var o,s;const l=i.split("__");let u=[];for(let p=0;p<l.length;p+=1){const y=l.slice(p).join("__");XE.includes(y)&&u.push(y)}const c=(a==null?void 0:a.split(/\s+/).map(p=>p.replace(/^nv-/,"")))||[],d=c.filter(p=>XE.includes(p));u=Array.from(new Set([...u,...d])),u.sort((p,y)=>{const v=(p.match(/__/g)||[]).length;return(y.match(/__/g)||[]).length-v});const f=c.filter(p=>!u.includes(p)).join(" "),h=[];for(let p=0;p<u.length;p+=1)typeof((o=e.elements())==null?void 0:o[u[p]])=="string"&&h.push((s=e.elements())==null?void 0:s[u[p]]);const m=u.length&&!t()?u.map(p=>e.appearanceKeyToCssInJsClass[p]):[];return Bn(...u.map(p=>`nv-${p}`),"🔔",f,h,...m)})()};function xK(e){const[t,n]=Me(!!e.fallbackValue);return e.value!==void 0?[()=>!!e.value,n]:[t,n]}var wK="_blank",AK="noopener noreferrer",l6=vi(void 0),kK=e=>{const[t,n]=WV({appearanceKeyToCssInJsClass:{}}),[r,i]=Me(null),[a,o]=Me([]),[s,l]=Me([]),u=He(()=>{var m,p,y;return Array.isArray((m=e.appearance)==null?void 0:m.baseTheme)?((p=e.appearance)==null?void 0:p.baseTheme)||[]:[((y=e.appearance)==null?void 0:y.baseTheme)||{}]}),c=()=>e.id,d=()=>{var m;return((m=e.appearance)==null?void 0:m.variables)||{}},f=()=>{var m,p;return(p=(m=e.appearance)==null?void 0:m.animations)!=null?p:!0},h=He(()=>{var m;const p=u().reduce((y,v)=>Ye(Ye({},y),v.elements||{}),{});return Ye(Ye({},p),((m=e.appearance)==null?void 0:m.elements)||{})});return sr(()=>{const m=document.getElementById(e.id);if(m){i(m);return}const p=document.createElement("style");p.id=e.id,document.head.appendChild(p),i(p),dn(()=>{const y=document.getElementById(e.id);y&&y.remove()})}),cn(()=>{var m;if(!r())return;const y=Ye(Ye({},dK),u().reduce((v,b)=>Ye(Ye({},v),b.variables||{}),{}));l(TK(Ye(Ye({},y),((m=e.appearance)==null?void 0:m.variables)||{}),e.id))}),cn(()=>{if(!r())return;const p=CK(h());n("appearanceKeyToCssInJsClass",y=>Ye(Ye({},y),p.reduce((v,b)=>(v[b.key]=b.className,v),{}))),o(p.map(y=>y.rule))}),cn(()=>{const m=r();m&&(m.innerHTML=[...s(),...a()].join(" "))}),Z(l6.Provider,{get value(){return{elements:h,variables:d,appearanceKeyToCssInJsClass:t.appearanceKeyToCssInJsClass,animations:f,id:c}},get children(){return e.children}})};function Gy(){const e=lr(l6);if(!e)throw new Error("useAppearance must be used within an AppearanceProvider");return e}var u6=({event:e,eventHandler:t})=>{const n=vo();sr(()=>{const r=n.on(e,t);dn(()=>{r()})})};function SK(e,t){let n=!1,r;const i=new Promise(a=>{r=a});return navigator.locks.request(e,()=>(n||t(e),i)),()=>{n=!0,r()}}var DK=({channelName:e,onMessage:t})=>{const[n]=Me(new BroadcastChannel(e)),r=i=>{n().postMessage(i)};return sr(()=>{const i=o=>{t(o.data)},a=n();a.addEventListener("message",i),dn(()=>{a.removeEventListener("message",i)})}),{postMessage:r}},Lm=({event:e,eventHandler:t})=>{const n=vo(),{postMessage:r}=DK({channelName:`nv.${e}`,onMessage:t}),i=a=>{t(a),r(a)};sr(()=>{let a;const o=SK(`nv.${e}`,()=>{a=n.on(e,i)});dn(()=>{a&&a(),o()})})},c6=vi(void 0),OK=e=>{const t=He(()=>{const i=e.localization||{},{dynamic:a}=i,o=Dy(i,["dynamic"]);return Ye(Ye(Ye(Ye({},fK),hK()),a||{}),o)}),n=(i,...a)=>{const o=t()[i];return typeof o=="function"?o(a[0]):o},r=He(()=>t().locale);return Z(c6.Provider,{value:{t:n,locale:r},get children(){return e.children}})};function go(){const e=lr(c6);if(!e)throw new Error("useLocalization must be used within an LocalizationProvider");return e}var d6=vi(void 0),e4={unreadRead:{archived:!1},unread:{read:!1},archived:{archived:!0}},f6=10,NK=e=>{var t;const[n,r]=Me(!1),[i,a]=Me(e.tabs),[o,s]=Me((t=e.tabs[0]&&e.tabs[0].label)!=null?t:""),[l,u]=Me("unreadRead"),[c,d]=Me(f6),[f,h]=Me(an(Ye({},e4.unreadRead),{tags:e.tabs.length>0?ba(e.tabs[0]):[]})),[m,p]=Me(!1),[y,v]=Me(e.preferencesFilter),b=C=>{u(C),h(x=>an(Ye({},e4[C]),{tags:x.tags}))},_=C=>{const x=i().find(P=>P.label===C),w=ba(x);w&&(s(C),h(P=>an(Ye({},P),{tags:w})))},T=(C,x)=>{if(!C)return;if(!C.startsWith("/")){window.open(C,x??wK,AK);return}if(e.routerPush){e.routerPush(C);return}const P=new URL(C,window.location.href);window.history.pushState.bind(window.history)({},"",P)};return cn(()=>{var C;a(e.tabs);const x=e.tabs[0],w=ba(x);s((C=x==null?void 0:x.label)!=null?C:""),h(P=>an(Ye({},P),{tags:w})),v(e.preferencesFilter)}),u6({event:"session.initialize.resolved",eventHandler:({data:C})=>{C&&p(C.removeNovuBranding)}}),Z(d6.Provider,{value:{status:l,setStatus:b,filter:f,tabs:i,activeTab:o,setActiveTab:_,limit:c,setLimit:d,isOpened:n,setIsOpened:r,navigate:T,hideBranding:m,preferencesFilter:y},get children(){return e.children}})},dr=()=>{const e=lr(d6);if(!e)throw new Error("useInboxContext must be used within a InboxProvider");return e},h6=vi(void 0);function IK(e){const t=He(()=>e.novu||new u7(e.options));return Z(h6.Provider,{get value(){return t()},get children(){return e.children}})}function vo(){const e=lr(h6);if(!e)throw new Error("useNovu must be used within a NovuProvider");return e}var PK=1,Gc=vi(void 0),RK=e=>{const t=vo(),{isOpened:n,tabs:r,filter:i,limit:a}=dr(),[o,s]=Me(0),[l,u]=Me(new Map),[c,d]=Me(new Map),f=()=>Ve(void 0,null,function*(){if(r().length===0)return;const p=r().map(_=>({tags:ba(_),read:!1,archived:!1})),{data:y}=yield t.notifications.count({filters:p});if(!y)return;const v=new Map,{counts:b}=y;for(let _=0;_<b.length;_+=1){const T=Fc(b[_].filter.tags);v.set(T,y==null?void 0:y.counts[_].count)}u(v)});sr(()=>{f()}),Lm({event:"notifications.unread_count_changed",eventHandler:p=>{s(p.result),f()}}),u6({event:"session.initialize.resolved",eventHandler:({data:p})=>{p&&s(p.totalUnreadCount)}});const h=(p,y)=>{const v=t.notifications.cache,b=a(),_=an(Ye({},i()),{tags:y,offset:0,limit:b}),T=!v.has(_);if(!n()&&T)return;const C=v.getAll(_)||{hasMore:!1,filter:_,notifications:[]};if(((C==null?void 0:C.notifications.length)||0)<PK){v.update(_,an(Ye({},C),{notifications:[p,...C.notifications]}));return}d(w=>{const P=Fc(y),O=new Map(w);return O.set(P,(w.get(P)||0)+1),O})};Lm({event:"notifications.notification_received",eventHandler:p=>Ve(void 0,[p],function*({result:y}){if(i().archived)return;const v=r();if(v.length>0)for(let b=0;b<v.length;b+=1){const _=v[b],T=ba(_),C=T.length===0,x=T.some(w=>{var P;return(P=y.tags)==null?void 0:P.includes(w)});!C&&!x||h(y,T)}else h(y,[])})}),Lm({event:"notifications.notification_received",eventHandler:f});const m=p=>{d(y=>{const v=new Map(y);return v.set(p,0),v})};return Z(Gc.Provider,{value:{totalUnreadCount:o,unreadCounts:l,newNotificationCounts:c,resetNewNotificationCounts:m},get children(){return e.children}})},Fc=e=>JSON.stringify({tags:e??[]}),FK=()=>{const e=lr(Gc);if(!e)throw new Error("useTotalUnreadCount must be used within a CountProvider");return{totalUnreadCount:e.totalUnreadCount}},MK=e=>{const t=lr(Gc);if(!t)throw new Error("useNewMessagesCount must be used within a CountProvider");const n=He(()=>Fc(e.filter.tags));return{count:He(()=>t.newNotificationCounts().get(n())||0),reset:()=>t.resetNewNotificationCounts(n())}},p6=e=>{const t=lr(Gc);if(!t)throw new Error("useUnreadCount must be used within a CountProvider");return He(()=>t.unreadCounts().get(Fc(e.filter.tags))||0)},BK=e=>{const t=lr(Gc);if(!t)throw new Error("useUnreadCounts must be used within a CountProvider");return He(()=>e.filters.map(r=>t.unreadCounts().get(Fc(r.tags))||0))};function LK({element:e,enabled:t}){cn(()=>{const n=e();if(!n||!t())return;const r="a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex], [contenteditable]",i=()=>Array.from(n.querySelectorAll(r)).filter(s=>s.tabIndex>=0&&!s.hasAttribute("disabled")),a=s=>{if(s.key!=="Tab")return;const l=i(),u=l[0],c=l[l.length-1];s.shiftKey?document.activeElement===u&&(c.focus(),s.preventDefault()):document.activeElement===c&&(u.focus(),s.preventDefault())};n.addEventListener("keydown",a);const o=i();o.length>0&&o[0].focus(),dn(()=>{n.removeEventListener("keydown",a)})})}var $K=LK,m6=vi(void 0),jK=e=>{const[t,n]=Me([]),r=o=>{n(s=>[...s,o])},i=o=>{n(s=>s.filter(l=>l!==o))},a=He(()=>t().length?t()[t().length-1]:null);return $K({element:()=>a(),enabled:()=>!0}),Z(m6.Provider,{value:{focusTraps:t,active:a,setActive:r,removeActive:i},get children(){return e.children}})};function Yy(){const e=lr(m6);if(!e)throw new Error("useFocusManager must be used within an FocusManagerProvider");return e}var HK=Le("<div>"),g6=e=>{let t;const[n,r]=wn(e,["render"]);return cn(()=>{const i=n.render(t);dn(()=>{i()})}),(()=>{var i=HK();return Ca(a=>{t=a},i),Ft(i,r,!1,!1),i})()},UK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M16.25 15V6.875L15 4.375H5L3.75 6.877V15c0 .345.28.625.625.625h11.25c.345 0 .625-.28.625-.625zM5 8.125h10v6.25H5v-6.25zm.772-2.5h8.455l.625 1.25H5.148l.625-1.25zm6.103 3.75h-3.75v1.25h3.75v-1.25z">'),Zy=e=>(()=>{var t=UK();return Ft(t,e,!0,!0),t})(),zK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M17.117 4.358l-1.159-1.4A1.21 1.21 0 0015 2.5H5c-.392 0-.733.175-.967.458l-1.15 1.4A1.632 1.632 0 002.5 5.417v10.416c0 .917.75 1.667 1.667 1.667h11.666c.917 0 1.667-.75 1.667-1.667V5.417c0-.4-.142-.775-.383-1.059zM10 14.583L5.417 10h2.916V8.333h3.334V10h2.916L10 14.583zM4.267 4.167l.675-.834h10l.783.834H4.267z">'),VK=e=>(()=>{var t=zK();return Ft(t,e,!0,!0),t})(),qK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M5.833 8.333L10 12.5l4.166-4.167H5.833z">'),Qy=e=>(()=>{var t=qK();return Ft(t,e,!0,!0),t})(),WK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M10 16.667l1.175-1.175-4.65-4.659h10.142V9.167H6.525l4.659-4.65L10 3.333 3.334 10 10 16.667z">'),KK=e=>(()=>{var t=WK();return Ft(t,e,!0,!0),t})(),GK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M10 18.333c.916 0 1.666-.75 1.666-1.666H8.333c0 .916.75 1.666 1.667 1.666zm5-5V9.167c0-2.559-1.359-4.7-3.75-5.267v-.567c0-.691-.559-1.25-1.25-1.25-.692 0-1.25.559-1.25 1.25V3.9C6.366 4.467 5 6.6 5 9.167v4.166L3.333 15v.833h13.333V15L15 13.333zm-1.667.834H6.666v-5c0-2.067 1.259-3.75 3.334-3.75s3.333 1.683 3.333 3.75v5z">');function YK(e){return(()=>{var t=GK();return Ft(t,e,!0,!0),t})()}var ZK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M12.5 3.333v5.834H4.31l-.975.975V3.333H12.5zm.834-1.666H2.5a.836.836 0 00-.833.833v11.667L5 10.833h8.334a.836.836 0 00.833-.833V2.5a.836.836 0 00-.833-.833zM17.5 5h-1.666v7.5H5v1.667c0 .458.375.833.834.833H15l3.334 3.333v-12.5A.836.836 0 0017.5 5z">'),QK=e=>(()=>{var t=ZK();return Ft(t,e,!0,!0),t})(),XK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M7.5 13.475L4.025 10l-1.183 1.175L7.5 15.833l10-10-1.175-1.175L7.5 13.475z">'),v6=e=>(()=>{var t=XK();return Ft(t,e,!0,!0),t})(),JK=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M5 8.333c-.917 0-1.667.75-1.667 1.667s.75 1.667 1.667 1.667c.916 0 1.666-.75 1.666-1.667S5.916 8.333 5 8.333zm10 0c-.917 0-1.667.75-1.667 1.667s.75 1.667 1.667 1.667c.916 0 1.666-.75 1.666-1.667S15.916 8.333 15 8.333zm-5 0c-.917 0-1.667.75-1.667 1.667s.75 1.667 1.667 1.667c.916 0 1.666-.75 1.666-1.667S10.916 8.333 10 8.333z">'),y6=e=>(()=>{var t=JK();return Ft(t,e,!0,!0),t})(),eG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M16.667 3.333H3.334c-.917 0-1.659.75-1.659 1.667l-.008 10c0 .917.75 1.667 1.667 1.667h13.333c.917 0 1.667-.75 1.667-1.667V5c0-.917-.75-1.667-1.667-1.667zm0 11.667H3.334V6.667L10 10.833l6.667-4.166V15zM10 9.167L3.334 5h13.333L10 9.167z">'),tG=e=>(()=>{var t=eG();return Ft(t,e,!0,!0),t})(),nG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 viewBox="0 0 20 20"fill=none><path fill=currentColor d="M9.99967 18.3334C10.9163 18.3334 11.6663 17.5834 11.6663 16.6667H8.33301C8.33301 17.5834 9.08301 18.3334 9.99967 18.3334ZM14.9997 13.3334V9.16671C14.9997 6.60837 13.6413 4.46671 11.2497 3.90004V3.33337C11.2497 2.64171 10.6913 2.08337 9.99967 2.08337C9.30801 2.08337 8.74967 2.64171 8.74967 3.33337V3.90004C6.36634 4.46671 4.99967 6.60004 4.99967 9.16671V13.3334L3.33301 15V15.8334H16.6663V15L14.9997 13.3334ZM13.333 14.1667H6.66634V9.16671C6.66634 7.10004 7.92467 5.41671 9.99967 5.41671C12.0747 5.41671 13.333 7.10004 13.333 9.16671V14.1667Z">'),rG=e=>(()=>{var t=nG();return Ft(t,e,!0,!0),t})(),iG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M15.833 2.5H4.158c-.925 0-1.65.742-1.65 1.667L2.5 15.833A1.66 1.66 0 004.158 17.5h11.675c.917 0 1.667-.75 1.667-1.667V4.167A1.667 1.667 0 0015.833 2.5zm0 10H12.5c0 1.383-1.125 2.5-2.5 2.5a2.502 2.502 0 01-2.5-2.5H4.158V4.167h11.675V12.5z">'),aG=e=>(()=>{var t=iG();return Ft(t,e,!0,!0),t})(),oG=Le('<svg xmlns=http://www.w3.org/2000/svg width=13 height=12 fill=none viewBox="0 0 13 12"><path fill=currentColor d="M9.787.98A5.972 5.972 0 006.5 0c-.668 0-1.31.11-1.911.31L9.187 4.94c.221.222.6.065.6-.248V.98z"></path><path fill=currentColor d="M2.879 1.216A5.99 5.99 0 00.5 6c0 1.134.315 2.195.862 3.1V7.309c0-1.966 2.379-2.946 3.764-1.552l4.995 5.027A5.99 5.99 0 0012.5 6a5.972 5.972 0 00-.862-3.1v1.791c0 1.966-2.379 2.946-3.764 1.552L2.879 1.216z"></path><path fill=currentColor d="M8.411 11.69L3.813 7.06a.351.351 0 00-.6.248v3.711c.944.62 2.073.98 3.287.98.668 0 1.31-.11 1.911-.31z">'),sG=e=>(()=>{var t=oG();return Ft(t,e,!0,!0),t})(),lG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M15.833.833H7.5c-.917 0-1.667.75-1.667 1.667V5H7.5V3.333h8.333v13.334H7.5V15H5.833v2.5c0 .917.75 1.667 1.667 1.667h8.333c.917 0 1.667-.75 1.667-1.667v-15c0-.917-.75-1.667-1.667-1.667zM5.842 11.225L3.717 9.1l-1.059 1.058 3.175 3.175 5.992-5.991-1.058-1.059-4.925 4.942z">'),uG=e=>(()=>{var t=lG();return Ft(t,e,!0,!0),t})(),cG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M15.833 2.5H4.167C3.25 2.5 2.5 3.25 2.5 4.167v11.666c0 .917.75 1.667 1.667 1.667h11.666c.917 0 1.667-.75 1.667-1.667V4.167c0-.917-.75-1.667-1.667-1.667zm0 13.333H4.167V4.167h11.666v11.666zM14.992 7.5l-1.175-1.183-5.492 5.491-2.15-2.141-1.183 1.175 3.333 3.325L14.992 7.5z">'),b6=e=>(()=>{var t=cG();return Ft(t,e,!0,!0),t})(),dG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M15.95 10.783c.033-.25.05-.508.05-.783a4.81 4.81 0 00-.059-.783L17.633 7.9a.408.408 0 00.1-.508l-1.6-2.767a.407.407 0 00-.492-.183l-1.991.8a5.885 5.885 0 00-1.35-.784L12 2.342A.403.403 0 0011.6 2H8.4c-.2 0-.359.142-.392.342l-.3 2.116c-.492.2-.942.475-1.35.784l-1.992-.8a.398.398 0 00-.491.183L2.283 7.392c-.1.175-.067.391.1.508l1.692 1.317A4.89 4.89 0 004 10c0 .258.016.533.058.783L2.366 12.1a.408.408 0 00-.1.508l1.6 2.767c.1.183.309.242.492.183l1.992-.8c.416.317.858.584 1.35.784l.3 2.116c.041.2.2.342.4.342h3.2c.2 0 .366-.142.391-.342l.3-2.116c.492-.2.942-.467 1.35-.784l1.992.8c.183.067.392 0 .492-.183l1.6-2.767c.1-.183.058-.391-.1-.508l-1.675-1.317zM10 13c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3z">'),fG=e=>(()=>{var t=dG();return Ft(t,e,!0,!0),t})(),hG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M16.667 1.667H3.334c-.917 0-1.667.75-1.667 1.666v15L5 15h11.667c.917 0 1.667-.75 1.667-1.667v-10c0-.916-.75-1.666-1.667-1.666zm0 11.666H4.309l-.975.975V3.333h13.333v10zM5.834 7.5H7.5v1.667H5.834V7.5zm6.666 0h1.667v1.667H12.5V7.5zm-3.333 0h1.667v1.667H9.167V7.5z">'),pG=e=>(()=>{var t=hG();return Ft(t,e,!0,!0),t})(),mG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 viewBox="0 0 20 20"fill=none><path fill=currentColor d="M17.1167 4.35833L15.9583 2.95833C15.7333 2.675 15.3917 2.5 15 2.5H5C4.60833 2.5 4.26667 2.675 4.03333 2.95833L2.88333 4.35833C2.64167 4.64167 2.5 5.01667 2.5 5.41667V15.8333C2.5 16.75 3.25 17.5 4.16667 17.5H15.8333C16.75 17.5 17.5 16.75 17.5 15.8333V5.41667C17.5 5.01667 17.3583 4.64167 17.1167 4.35833ZM5.2 4.16667H14.8L15.4917 5H4.51667L5.2 4.16667ZM4.16667 15.8333V6.66667H15.8333V15.8333H4.16667ZM6.66667 11.6667H8.79167V14.1667H11.2083V11.6667H13.3333L10 8.33333L6.66667 11.6667Z">'),gG=e=>(()=>{var t=mG();return Ft(t,e,!0,!0),t})(),vG=Le('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 fill=none viewBox="0 0 20 20"><path fill=currentColor d="M10 15v1.25H4.996a.625.625 0 01-.621-.62V4.37c0-.342.28-.62.624-.62H12.5l3.125 3.125v4.375h-1.25V7.5h-2.5V5h-6.25v10H10zm1.54-.335l2.21 2.21 3.094-3.093-.884-.884-2.21 2.21-1.326-1.326-.884.883z">'),E6=e=>(()=>{var t=vG();return Ft(t,e,!0,!0),t})(),t4=Le("<span>"),yG=e=>{const t=ft();return(()=>{var n=t4();return Ie(n,Z(YK,{get class(){return t("bellIcon")}}),null),Ie(n,Z(Tt,{get when(){return e.unreadCount>0},get children(){var r=t4();return ct(()=>Ze(r,t("bellDot","nt-absolute nt-top-2 nt-right-2 nt-block nt-size-2 nt-transform nt-translate-x-1/2 -nt-translate-y-1/2 nt-bg-primary nt-rounded-full nt-border nt-border-background"))),r}}),null),ct(()=>Ze(n,t("bellContainer","nt-h-6 nt-w-6 nt-flex nt-justify-center nt-items-center nt-rounded-md nt-relative nt-text-foreground nt-cursor-pointer"))),n})()},_6=e=>{const{totalUnreadCount:t}=FK();return Z(Tt,{get when(){return e.renderBell},get fallback(){return Z(yG,{get unreadCount(){return t()}})},get children(){return Z(g6,{render:n=>e.renderBell(n,t())})}})},bG=Le('<div class="nt-flex nt-shrink-0 nt-justify-center nt-items-center nt-gap-1 nt-mt-auto nt-pt-9 nt-pb-3 nt-text-foreground-alpha-200"><span class=nt-text-xs>Powered by Novu'),EG=()=>{const{hideBranding:e}=dr();return Z(Tt,{get when(){return!e()},get children(){var t=bG(),n=t.firstChild;return Ie(t,Z(sG,{}),n),t}})},_G=Le("<button>"),T6=Sq("nt-inline-flex nt-gap-4 nt-items-center nt-justify-center nt-whitespace-nowrap nt-rounded-lg nt-text-sm nt-font-medium nt-ring-offset-background nt-transition-colors focus-visible:nt-outline-none focus-visible:nt-ring-2 focus-visible:nt-ring-primary nt-focus-visible:nt-ring-offset-2 disabled:nt-pointer-events-none disabled:nt-opacity-50",{variants:{variant:{default:"nt-bg-primary nt-text-primary-foreground hover:nt-bg-primary-alpha-900",secondary:"nt-bg-secondary nt-text-secondary-foreground hover:nt-bg-secondary-alpha-800",icon:"nt-text-secondary-foreground-alpha-500 hover:nt-bg-neutral-alpha-50",ghost:"hover:nt-bg-neutral-alpha-50",unstyled:""},size:{none:"",icon:"nt-p-1",default:"nt-h-8 nt-px-3",sm:"nt-h-7 nt-rounded-md nt-px-3",lg:"nt-h-10 nt-px-8"}},defaultVariants:{variant:"default",size:"default"}}),yr=e=>{const[t,n]=wn(e,["class","appearanceKey"]),r=ft();return(()=>{var i=_G();return Ft(i,At({get"data-variant"(){return e.variant},get"data-size"(){return e.size},get class(){return r(t.appearanceKey||"button",Bn(T6({variant:e.variant,size:e.size}),t.class))}},n),!1,!1),i})()},TG=Le("<button>"),CG=e=>{const{onClose:t}=Yc(),[n,r]=wn(e,["onClick","asChild"]),i=a=>{typeof n.onClick=="function"&&n.onClick(a),t()};return n.asChild?Z(Fh,At({get component(){return n.asChild},onClick:i},r)):(()=>{var a=TG();return a.$$click=i,Ft(a,r,!1,!1),a})()};zl(["click"]);var C6=new Proxy(WE,{get:(e,t)=>n=>{const{animations:r}=Gy();return Z(WE,At(n,{tag:t,get transition(){return r()?n.transition:{duration:0}}}))}}),x6=vi(void 0);function xG(e){var t;const[n,r]=Me((t=e.open)!=null?t:!1),i=()=>{var m;return(m=e.onOpenChange)!=null?m:r},a=()=>{var m;return(m=e.open)!=null?m:n()},[o,s]=Me(null),[l,u]=Me(null),c=o6(o,l,{placement:e.placement||"bottom-start",whileElementsMounted:(m,p,y)=>n6(m,p,y,{elementResize:!1,ancestorScroll:!1,animationFrame:!1,layoutShift:!1}),middleware:[r6(10),a6({fallbackPlacements:e.fallbackPlacements||["top-start"]}),i6()]}),d=He(()=>{var m,p;return{position:c.strategy,top:`${(m=c.y)!=null?m:0}px`,left:`${(p=c.x)!=null?p:0}px`}}),f=()=>{i()(!1)},h=()=>{i()(m=>!m)};return Z(x6.Provider,{value:{onToggle:h,onClose:f,reference:o,setReference:s,floating:l,setFloating:u,open:a,floatingStyles:d},get children(){return e.children}})}function Yc(){const e=lr(x6);if(!e)throw new Error("usePopover must be used within Popover.Root component");return e}var wG=()=>Bn("nt-w-[400px] nt-h-[600px] nt-rounded-xl nt-bg-background","nt-shadow-popover nt-z-10 nt-cursor-default nt-flex nt-flex-col nt-overflow-hidden"),n4=e=>{const{open:t,setFloating:n,floating:r,floatingStyles:i}=Yc(),{setActive:a,removeActive:o}=Yy(),[s,l]=wn(e,["class","appearanceKey","style"]),u=ft();return sr(()=>{const c=r();a(c),dn(()=>{o(c)})}),Z(C6.div,At({ref:n,get class(){return He(()=>!!s.class)()?s.class:u(s.appearanceKey||"popoverContent",wG())},get style(){return i()},get"data-open"(){return t()},animate:{opacity:[0,1],y:[-6,0]},transition:{duration:.1,easing:"ease-out"}},l))},AG=e=>{const[t,n]=wn(e,["portal"]),{open:r,onClose:i,reference:a,floating:o}=Yc(),{active:s}=Yy(),l=c=>{var d,f;(d=a())!=null&&d.contains(c.target)||s()!==o()||(f=o())!=null&&f.contains(c.target)||i()},u=c=>{s()===o()&&c.key==="Escape"&&i()};return sr(()=>{document.body.addEventListener("click",l),document.body.addEventListener("keydown",u)}),dn(()=>{document.body.removeEventListener("click",l),document.body.removeEventListener("keydown",u)}),Z(Tt,{get when(){return r()},get children(){return Z(Tt,{get when(){return t.portal},get fallback(){return Z(n4,n)},get children(){return Z(jy,{get children(){return Z(Xy,{get children(){return Z(n4,n)}})}})}})}})},kG=Le("<button>"),SG=e=>{const{setReference:t,onToggle:n}=Yc(),r=ft(),[i,a]=wn(e,["appearanceKey","asChild","onClick"]),o=s=>{typeof i.onClick=="function"&&i.onClick(s),n()};return i.asChild?Z(Fh,At({get component(){return i.asChild},ref:t,onClick:o},a)):(()=>{var s=kG();return s.$$click=o,Ca(t,s),Ft(s,At({get class(){return r(i.appearanceKey||"dropdownTrigger")}},a),!1,!0),Ie(s,()=>e.children),s})()};zl(["click"]);var ro={Root:xG,Trigger:SG,Content:AG,Close:CG},DG=()=>"nt-w-max nt-rounded-xl nt-p-1 nt-overflow-hidden nt-flex nt-flex-col nt-min-w-52 nt-shadow-dropdown nt-z-10 nt-bg-background",OG=e=>{const t=ft(),[n,r]=wn(e,["appearanceKey"]);return Z(ro.Content,At({get class(){return t(n.appearanceKey||"dropdownContent",DG())}},r))},zh=()=>"focus:nt-outline-none nt-rounded-lg nt-items-center hover:nt-bg-neutral-alpha-50 focus-visible:nt-bg-neutral-alpha-50 nt-py-1 nt-px-3",NG=e=>{const t=ft(),[n,r]=wn(e,["appearanceKey","onClick","class"]),{onClose:i}=Yc();return Z(ro.Close,At({get class(){return He(()=>!!n.class)()?n.class:t(n.appearanceKey||"dropdownItem",zh())},onClick:a=>{typeof n.onClick=="function"&&n.onClick(a),i()}},r))},IG=e=>Z(ro.Root,At({placement:"bottom",fallbackPlacements:["top"]},e)),PG=()=>"nt-relative nt-transition nt-outline-none focus-visible:nt-outline-nonefocus-visible:nt-ring-2 focus-visible:nt-ring-primary focus-visible:nt-ring-offset-2",RG=e=>{const t=ft(),[n,r]=wn(e,["appearanceKey"]);return Z(ro.Trigger,At({get class(){return t(n.appearanceKey||"dropdownTrigger",PG())}},r))},Ur={Root:IG,Trigger:RG,Content:OG,Close:ro.Close,Item:NG},FG=Le("<div role=tablist>"),MG=Le('<div class="nt-border-t nt-border-secondary nt-mt-[-0.25rem] nt-relative nt-z-[-1]">'),BG=()=>"nt-flex nt-gap-6 nt-px-6 nt-py-1 nt-overflow-hidden",LG=e=>{const[t,n]=wn(e,["class","appearanceKey","ref","children"]),r=ft();return[(()=>{var i=FG(),a=t.ref;return typeof a=="function"?Ca(a,i):t.ref=i,Ft(i,At({get class(){return He(()=>!!t.class)()?t.class:r(t.appearanceKey||"tabsList",BG())}},n),!1,!0),Ie(i,()=>t.children),i})(),MG()]},$G=({activeTab:e,setActiveTab:t,tabsContainer:n})=>{const[r,i]=Me(!1);cn(()=>{const a=o=>{var s;if(o.key!=="Tab")return;const l=(s=n())==null?void 0:s.querySelectorAll('[role="tab"]');!l||!document.activeElement||i(Array.from(l).includes(document.activeElement))};return document.addEventListener("keyup",a),dn(()=>document.removeEventListener("keyup",a))}),cn(()=>{const a=o=>{var s,l;if(!r()||o.key!=="ArrowLeft"&&o.key!=="ArrowRight")return;const u=Array.from((l=(s=n())==null?void 0:s.querySelectorAll('[role="tab"]'))!=null?l:[]),c=u.map(p=>p.id),d=c.indexOf(e()),{length:f}=c;let h=d,m=e();o.key==="ArrowLeft"?(h=d===0?f-1:d-1,m=c[h]):o.key==="ArrowRight"&&(h=d===f-1?0:d+1,m=c[h]),u[h].focus(),t(m)};return document.addEventListener("keydown",a),dn(()=>document.removeEventListener("keydown",a))})},jG=Le("<div>"),w6=vi(void 0),A6=()=>{const e=lr(w6);if(!e)throw new Error("useTabsContext must be used within an TabsContext.Provider");return e},k6=()=>"nt-flex nt-flex-col",HG=e=>{var t;const[n,r]=wn(e,["defaultValue","value","class","appearanceKey","onChange","children"]),[i,a]=Me(),[o,s]=Me([]),[l,u]=Me((t=n.defaultValue)!=null?t:""),c=ft();return $G({tabsContainer:i,activeTab:l,setActiveTab:u}),cn(()=>{n.value&&u(n.value)}),cn(()=>{var d;(d=n.onChange)==null||d.call(n,l())}),Z(w6.Provider,{value:{activeTab:l,setActiveTab:u,visibleTabs:o,setVisibleTabs:s},get children(){var d=jG();return Ca(a,d),Ft(d,At({get class(){return He(()=>!!n.class)()?n.class:c(n.appearanceKey||"tabsRoot",k6())}},r),!1,!0),Ie(d,()=>n.children),d}})},UG=Le("<div role=tabpanel>"),zG=e=>{const[t,n]=wn(e,["value","class","appearanceKey","children"]),r=ft(),{activeTab:i}=A6();return Z(Tt,{get when(){return i()===t.value},get children(){var a=UG();return Ft(a,At({get class(){return He(()=>!!t.class)()?t.class:r(t.appearanceKey||"tabsContent",i()===t.value?"nt-block":"nt-hidden")},get id(){return`tabpanel-${t.value}`},get"aria-labelledby"(){return t.value},get"data-state"(){return i()===t.value?"active":"inactive"}},n),!1,!0),Ie(a,()=>t.children),a}})},S6=()=>"nt-relative nt-transition nt-outline-none nt-text-foreground-alpha-600 focus-visible:nt-outline-none focus-visible:nt-ring-2 focus-visible:nt-ring-primary focus-visible:nt-ring-offset-2 nt-pb-[0.625rem] after:nt-absolute after:nt-content-[''] after:nt-bottom-0 after:nt-left-0 after:nt-w-full after:nt-h-[2px] after:nt-border-b-2 data-[state=active]:after:nt-border-primary data-[state=active]:nt-text-foreground after:nt-border-b-transparent",VG=e=>{const[t,n]=wn(e,["value","class","appearanceKey","ref","onClick","children"]),r=ft(),{activeTab:i,setActiveTab:a}=A6(),o=()=>a(t.value);return Z(yr,At({variant:"unstyled",size:"none",ref(s){var l=t.ref;typeof l=="function"?l(s):t.ref=s},get id(){return t.value},get appearanceKey(){var s;return(s=t.appearanceKey)!=null?s:"tabsTrigger"},get class(){return He(()=>!!t.class)()?t.class:r(t.appearanceKey||"tabsTrigger",S6())},get onClick(){var s;return(s=t.onClick)!=null?s:o},role:"tab",tabIndex:0,get"aria-selected"(){return i()===t.value},get"aria-controls"(){return`tabpanel-${t.value}`},get"data-state"(){return i()===t.value?"active":"inactive"}},n,{get children(){return t.children}}))},Uu={Root:HG,List:LG,Trigger:VG,Content:zG},qG={unreadRead:"inbox.filters.dropdownOptions.default",unread:"inbox.filters.dropdownOptions.unread",archived:"inbox.filters.dropdownOptions.archived"},r4={unreadRead:"inbox.filters.labels.default",unread:"inbox.filters.labels.unread",archived:"inbox.filters.labels.archived"},WG=Le("<span><span></span><span>"),KG=Le("<span>"),GG=[{status:"unreadRead",icon:aG},{status:"unread",icon:E6},{status:"archived",icon:Zy}],YG=e=>Z(Wi,{each:GG,children:t=>Z(ZG,{get localizationKey(){return qG[t.status]},onClick:()=>{e.setStatus(t.status)},get isSelected(){return e.status===t.status},get icon(){return t.icon}})}),ZG=e=>{const t=ft(),{t:n}=go();return Z(Ur.Item,{get class(){return t("inboxStatus__dropdownItem",Bn(zh(),"nt-flex nt-gap-8 nt-justify-between"))},get onClick(){return e.onClick},get children(){return[(()=>{var r=WG(),i=r.firstChild,a=i.nextSibling;return Ie(i,()=>e.icon()),Ie(a,()=>n(e.localizationKey)),ct(o=>{var s=t("inboxStatus__dropdownItemLabelContainer","nt-flex nt-gap-2 nt-items-center"),l=t("inboxStatus__dropdownItemLeft__icon"),u=e.localizationKey,c=t("inboxStatus__dropdownItemLabel");return s!==o.e&&Ze(r,o.e=s),l!==o.t&&Ze(i,o.t=l),u!==o.a&&er(a,"data-localization",o.a=u),c!==o.o&&Ze(a,o.o=c),o},{e:void 0,t:void 0,a:void 0,o:void 0}),r})(),Z(Tt,{get when(){return e.isSelected},get children(){var r=KG();return Ie(r,Z(v6,{})),ct(()=>Ze(r,t("inboxStatus__dropdownItemRight__icon"))),r}})]}})},i4=Le("<span>"),QG=()=>{const e=ft(),{status:t,setStatus:n}=dr(),{t:r}=go();return Z(Ur.Root,{get children(){return[Z(Ur.Trigger,{get class(){return e("inboxStatus__dropdownTrigger",Bn(T6({variant:"unstyled",size:"none"}),"nt-gap-2"))},asChild:i=>Z(yr,At({variant:"unstyled",size:"none"},i,{get children(){return[(()=>{var a=i4();return Ie(a,()=>r(r4[t()])),ct(o=>{var s=r4[t()],l=e("inboxStatus__title","nt-text-xl nt-font-semibold");return s!==o.e&&er(a,"data-localization",o.e=s),l!==o.t&&Ze(a,o.t=l),o},{e:void 0,t:void 0}),a})(),(()=>{var a=i4();return Ie(a,Z(Qy,{})),ct(()=>Ze(a,e("inboxStatus__dropdownItemRight__icon","nt-text-foreground-alpha-600"))),a})()]}}))}),Z(Ur.Content,{appearanceKey:"inboxStatus__dropdownContent",get children(){return Z(YG,{setStatus:n,get status(){return t()}})}})]}})},XG=e=>{const t=vo();let n=Ye({},e.options());const[r,{initialLoading:i,setEl:a,end:o,mutate:s,reset:l}]=mK(c=>Ve(void 0,null,function*(){var d,f;const{data:h}=yield t.notifications.list(an(Ye({},e.options()||{}),{offset:c}));return{data:(d=h==null?void 0:h.notifications)!=null?d:[],hasMore:(f=h==null?void 0:h.hasMore)!=null?f:!1}}));return sr(()=>{const c=({data:f})=>{!f||!Nf(n,f.filter)||s({data:f.notifications,hasMore:f.hasMore})},d=t.on("notifications.list.updated",c);dn(()=>d())}),cn(()=>{const c=Ye({},e.options());Nf(n,c)||(t.notifications.clearCache(),l(),n=c)}),{data:r,initialLoading:i,setEl:a,end:o,refetch:({filter:c})=>{t.notifications.clearCache({filter:c}),l()}}},JG=e=>{const t=vo(),[n,r]=Me(!0),[i,{mutate:a,refetch:o}]=p7(e||{},s=>Ve(void 0,[s],function*({tags:l}){try{return(yield t.preferences.list({tags:l})).data}catch(u){throw console.error("Error fetching preferences:",u),u}}));return sr(()=>{const s=({data:u})=>{u&&a(u)},l=t.on("preferences.list.updated",s);dn(()=>l())}),cn(()=>{r(i.loading)}),{preferences:i,loading:n,mutate:a,refetch:o}},eY=e=>{const t=vo();return{readAll:(...r)=>Ve(void 0,[...r],function*({tags:i}={}){var a,o;try{yield t.notifications.readAll({tags:i}),(a=e==null?void 0:e.onSuccess)==null||a.call(e)}catch(s){(o=void 0)==null||o.call(e,s)}})}},tY=e=>{const t=vo();return{archiveAll:(...r)=>Ve(void 0,[...r],function*({tags:i}={}){var a,o;try{yield t.notifications.archiveAll({tags:i}),(a=e==null?void 0:e.onSuccess)==null||a.call(e)}catch(s){(o=void 0)==null||o.call(e,s)}})}},nY=e=>{const t=vo();return{archiveAllRead:(...r)=>Ve(void 0,[...r],function*({tags:i}={}){var a,o;try{yield t.notifications.archiveAllRead({tags:i}),(a=e==null?void 0:e.onSuccess)==null||a.call(e)}catch(s){(o=void 0)==null||o.call(e,s)}})}},a4=Le("<span>"),rY=()=>{const{filter:e}=dr(),{readAll:t}=eY(),{archiveAll:n}=tY(),{archiveAllRead:r}=nY();return[Z($m,{localizationKey:"notifications.actions.readAll",onClick:()=>t({tags:e().tags}),icon:b6}),Z($m,{localizationKey:"notifications.actions.archiveAll",onClick:()=>n({tags:e().tags}),icon:Zy}),Z($m,{localizationKey:"notifications.actions.archiveRead",onClick:()=>r({tags:e().tags}),icon:VK})]},$m=e=>{const t=ft(),{t:n}=go();return Z(Ur.Item,{get class(){return t("moreActions__dropdownItem",Bn(zh(),"nt-flex nt-gap-2"))},get onClick(){return e.onClick},get children(){return[(()=>{var r=a4();return Ie(r,()=>e.icon()),ct(()=>Ze(r,t("moreActions__dropdownItemLeft__icon","nt-text-foreground-alpha-600"))),r})(),(()=>{var r=a4();return Ie(r,()=>n(e.localizationKey)),ct(i=>{var a=e.localizationKey,o=t("moreActions__dropdownItemLabel");return a!==i.e&&er(r,"data-localization",i.e=a),o!==i.t&&Ze(r,i.t=o),i},{e:void 0,t:void 0}),r})()]}})},iY=()=>{const e=ft(),{status:t}=dr();return Z(Tt,{get when(){return t()!=="archived"},get children(){return Z(Ur.Root,{get children(){return[Z(Ur.Trigger,{get class(){return e("moreActions__dropdownTrigger")},asChild:n=>Z(yr,At({variant:"icon",size:"icon"},n,{get children(){return Z(y6,{get class(){return e("moreActions__dots")}})}}))}),Z(Ur.Content,{appearanceKey:"moreActions__dropdownContent",get children(){return Z(rY,{})}})]}})}})},aY=Le("<div>"),oY=e=>{const t=ft();return(()=>{var n=aY();return Ie(n,Z(iY,{}),null),Ie(n,Z(Tt,{get when(){return e.showPreferences},children:r=>Z(yr,{appearanceKey:"preferences__button",variant:"icon",size:"icon",get onClick(){return r()},get children(){return Z(fG,{})}})}),null),ct(()=>Ze(n,t("moreActionsContainer","nt-flex nt-gap-2"))),n})()},sY=Le("<div>"),lY=e=>{const t=ft();return(()=>{var n=sY();return Ie(n,Z(QG,{}),null),Ie(n,Z(oY,{get showPreferences(){return e.navigateToPreferences}}),null),ct(()=>Ze(n,t("inboxHeader",Bn("nt-flex nt-shrink-0 nt-justify-between nt-items-center nt-w-full nt-py-5 nt-px-6")))),n})()},uY=Le("<div><div data-localization=preferences.title>"),cY=Le("<button>"),dY=e=>{const t=ft(),{t:n}=go();return(()=>{var r=uY(),i=r.firstChild;return Ie(r,Z(Tt,{get when(){return e.navigateToNotifications},children:a=>(()=>{var o=cY();return _7(o,"click",a(),!0),Ie(o,Z(KK,{})),ct(()=>Ze(o,t("preferencesHeader__back__button","nt-h-6 nt-w-6 nt-flex nt-justify-center nt-items-center nt-rounded-md nt-relative hover:nt-bg-foreground-alpha-50 focus:nt-bg-foreground-alpha-50 nt-text-foreground-alpha-600"))),o})()}),i),Ie(i,()=>n("preferences.title")),ct(a=>{var o=t("preferencesHeader","nt-flex nt-items-center nt-py-5 nt-px-6 nt-gap-2"),s=t("preferencesHeader__title","nt-text-xl nt-font-semibold");return o!==a.e&&Ze(r,a.e=o),s!==a.t&&Ze(i,a.t=s),a},{e:void 0,t:void 0}),r})()};zl(["click"]);var fY=Le("<div>"),Xy=e=>{const[t,n]=wn(e,["class"]),{id:r}=Gy(),i=ft(),{hideBranding:a}=dr();return[Z(Tt,{get when(){return!a()},children:new Comment(" Powered by Novu - https://novu.co ")}),(()=>{var o=fY();return Ft(o,At({get id(){return`novu-root-${r()}`},get class(){return i("root"),Bn("novu",r(),"nt-text-foreground nt-h-full")}},n),!1,!1),o})()]},hY=Le('<label><input type=checkbox class="nt-peer nt-sr-only"><div>'),pY=e=>{const t=ft();return(()=>{var n=hY(),r=n.firstChild,i=r.nextSibling;return r.addEventListener("change",a=>{e.onChange(a.target.checked)}),ct(a=>{var o=t("channelSwitch","nt-relative nt-inline-flex nt-cursor-pointer nt-items-center"),s=t("channelSwitchThumb","nt-peer nt-h-6 nt-w-11 nt-rounded-full nt-border nt-border-neutral-alpha-200 peer-checked:nt-border-neutral-alpha-400 nt-bg-neutral-alpha-300 after:nt-absolute after:nt-left-[2px] after:nt-top-0.5 after:nt-h-5 after:nt-w-5 after:nt-rounded-full after:nt-border after:nt-border-neutral-alpha-400 after:nt-bg-background after:nt-transition-all after:nt-content-[''] peer-checked:nt-bg-primary peer-checked:after:nt-translate-x-full peer-checked:after:nt-border-background nt-transition-all nt-duration-200 after:nt-duration-200"),l=e.checked;return o!==a.e&&Ze(n,a.e=o),s!==a.t&&Ze(i,a.t=s),l!==a.a&&er(i,"data-checked",a.a=l),a},{e:void 0,t:void 0,a:void 0}),ct(()=>r.checked=e.checked),n})()},mY=Le("<div><div><div></div><span></span></div><div>"),gY=e=>{const t=ft(),n=i=>Ve(void 0,null,function*(){e.onChange({channel:e.channel,enabled:i,workflowId:e.workflowId})}),r=i=>{n(i)};return(()=>{var i=mY(),a=i.firstChild,o=a.firstChild,s=o.nextSibling,l=a.nextSibling;return Ie(o,Z(vY,{get channel(){return e.channel}})),Ie(s,()=>D6(e.channel)),Ie(l,Z(pY,{get checked(){return e.enabled},onChange:u=>r(u)})),ct(u=>{var c=t("channelContainer","nt-flex nt-justify-between nt-items-center nt-h-11 nt-gap-2 data-[disabled=true]:nt-text-foreground-alpha-600"),d=t("channelLabelContainer","nt-flex nt-items-center nt-gap-2"),f=t("channelLabel","nt-text-base nt-font-semibold"),h=t("channelSwitchContainer","nt-flex nt-items-center");return c!==u.e&&Ze(i,u.e=c),d!==u.t&&Ze(a,u.t=d),f!==u.a&&Ze(s,u.a=f),h!==u.o&&Ze(l,u.o=h),u},{e:void 0,t:void 0,a:void 0,o:void 0}),i})()},vY=e=>{switch(e.channel){case"in_app":return Z(rG,{});case"email":return Z(tG,{});case"push":return Z(uG,{});case"sms":return Z(pG,{});case"chat":return Z(QK,{});default:return null}},D6=e=>{switch(e){case"in_app":return"In-App";case"email":return"Email";case"push":return"Push";case"sms":return"SMS";case"chat":return"Chat";default:return""}},O6=Le("<div>"),jo=e=>{const t=ft();return(()=>{var n=O6();return ct(()=>Ze(n,t(e.appearanceKey,Bn("nt-w-full nt-h-3 nt-rounded nt-bg-foreground-alpha-100",e.class)))),n})()},yY=e=>{const t=ft();return(()=>{var n=O6();return ct(()=>Ze(n,t(e.appearanceKey,Bn("nt-size-8 nt-rounded-lg nt-bg-foreground-alpha-100",e.class)))),n})()},bY=Le('<div><div class="nt-flex nt-flex-col nt-self-stretch nt-gap-1 nt-flex-1"></div><div>'),EY=()=>Z(Wi,{get each(){return Array.from({length:8})},children:()=>Z(_Y,{})}),_Y=()=>{const e=ft();return(()=>{var t=bY(),n=t.firstChild,r=n.nextSibling;return Ie(n,Z(jo,{appearanceKey:"skeletonText",class:"nt-w-1/3"}),null),Ie(n,Z(jo,{appearanceKey:"skeletonText",class:"nt-w-1/3"}),null),Ie(r,Z(Qy,{})),ct(()=>Ze(t,e("preferencesLoadingContainer","nt-p-4 nt-flex nt-gap-1 nt-items-center nt-self-stretch nt-animate-pulse"))),t})()},Jy=Le("<div>"),TY=Le("<span>"),CY=Le("<div><div><div><div></div></div><span>"),xY=()=>{var e;const t=ft(),{preferencesFilter:n}=dr(),{preferences:r,loading:i}=JG({tags:(e=n())==null?void 0:e.tags}),a=He(()=>{var s,l;const u=(s=r())==null?void 0:s.find(f=>f.level==="global"),c=(l=r())==null?void 0:l.filter(f=>f.level==="template"),d=c==null?void 0:c.map(f=>{var h;return(h=f.workflow)==null?void 0:h.id});return{globalPreference:u,workflowPreferences:c,workflowPreferencesIds:d}});cn(()=>{pK(s=>{var l;return Ye(Ye({},s),(l=a().workflowPreferences)==null?void 0:l.reduce((u,c)=>(u[c.workflow.identifier]=c.workflow.name,u),{}))})});const o=s=>({channel:l,enabled:u})=>{s==null||s.update({channelPreferences:{[l]:u}})};return(()=>{var s=Jy();return Ie(s,Z(Tt,{get when(){return i()},get children(){return Z(EY,{})}}),null),Ie(s,Z(Tt,{get when(){return He(()=>!i())()&&r()},get children(){return[Z(o4,{localizationKey:"preferences.global",get channels(){var l;return((l=a().globalPreference)==null?void 0:l.channels)||{}},get onChange(){return o(a().globalPreference)}}),Z(Wi,{get each(){return a().workflowPreferencesIds},children:(l,u)=>{const c=()=>{var d;return(d=a().workflowPreferences)==null?void 0:d[u()]};return c()?Z(o4,{get localizationKey(){return c().workflow.identifier},get channels(){return c().channels},get workflowId(){var d;return(d=c().workflow)==null?void 0:d.id},get onChange(){return o(c())}}):null}})]}}),null),ct(()=>Ze(s,t("preferencesContainer","nt-p-2 nt-flex nt-flex-col nt-gap-1 nt-bg-background nt-overflow-y-auto nt-h-full"))),s})()},wY=e=>{const t=ft(),n=()=>{const r=[];for(const i in e.channels)if(e.channels[i]!==void 0){const a=!e.channels[i],o=(()=>{var s=TY();return er(s,"data-disabled",a),Ie(s,()=>D6(i)),ct(()=>Ze(s,t("channelName","data-[disabled=true]:nt-text-foreground-alpha-400"))),s})();r.push(o)}return r.map((i,a)=>[i,He(()=>a<r.length-1&&", ")])};return(()=>{var r=Jy();return Ie(r,n),ct(()=>Ze(r,t("channelDescription","nt-text-sm nt-text-foreground-alpha-600 nt-text-start"))),r})()},o4=e=>{const[t,n]=Me(!1),r=ft(),{t:i}=go(),a=He(()=>Object.keys(e.channels||{}));return Z(Tt,{get when(){return a().length>0},get children(){var o=CY(),s=o.firstChild,l=s.firstChild,u=l.firstChild,c=l.nextSibling;return s.$$click=()=>n(d=>!d),Ie(u,()=>i(e.localizationKey)),Ie(l,Z(wY,{get channels(){return e.channels}}),null),Ie(c,Z(Qy,{get class(){return r("workflowArrow__icon","nt-text-foreground-alpha-600")}})),Ie(o,Z(SW,{exitBeforeEnter:!0,get children(){return Z(Tt,{get when(){return t()},get children(){return Z(C6.div,{animate:{gridTemplateRows:["0fr","1fr"]},exit:{gridTemplateRows:["1fr","0fr"]},transition:{duration:.2,easing:"ease-out"},get class(){return r("channelsContainerCollapsible","nt-grid nt-self-stretch")},get children(){var d=Jy();return Ie(d,Z(Wi,{get each(){return a()},children:f=>Z(gY,{channel:f,get enabled(){return!!e.channels[f]},get workflowId(){return e.workflowId},get onChange(){return e.onChange}})})),ct(()=>Ze(d,r("channelsContainer","nt-overflow-hidden nt-flex-col nt-gap-1"))),d}})}})}}),null),ct(d=>{var f=r("workflowContainer","nt-p-4 nt-flex nt-flex-col nt-gap-1 nt-items-start nt-self-stretch hover:nt-bg-neutral-alpha-50 nt-rounded-lg data-[disabled=true]:nt-bg-neutral-alpha-50"),h=t(),m=r("workflowLabelContainer","nt-flex nt-justify-between nt-flex-nowrap nt-self-stretch nt-cursor-pointer nt-items-center"),p=t(),y=r("workflowLabel","nt-text-base nt-font-semibold nt-text-start nt-flex nt-items-center nt-gap-1"),v=e.localizationKey,b=t(),_=r("workflowContainerRight__icon","nt-text-foreground-alpha-600 nt-transition-all nt-duration-200 data-[open=true]:nt-transform data-[open=true]:nt-rotate-180"),T=t();return f!==d.e&&Ze(o,d.e=f),h!==d.t&&er(o,"data-open",d.t=h),m!==d.a&&Ze(s,d.a=m),p!==d.o&&er(s,"data-open",d.o=p),y!==d.i&&Ze(u,d.i=y),v!==d.n&&er(u,"data-localization",d.n=v),b!==d.s&&er(u,"data-open",d.s=b),_!==d.h&&Ze(c,d.h=_),T!==d.r&&er(c,"data-open",d.r=T),d},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),o}})};zl(["click"]);var AY=Le("<strong>"),kY=Le("<p>"),SY=e=>{const t=ft();return(()=>{var n=AY();return Ie(n,()=>e.children),ct(()=>Ze(n,t(e.appearanceKey||"strong","nt-font-semibold"))),n})()},DY=e=>e.children,OY=e=>{const t=e,{children:n,strongAppearanceKey:r}=t,i=Dy(t,["children","strongAppearanceKey"]),a=He(()=>aV(n));return(()=>{var o=kY();return Ft(o,i,!1,!0),Ie(o,Z(Wi,{get each(){return a()},children:s=>s.type==="bold"?Z(SY,{appearanceKey:r,get children(){return s.content}}):Z(DY,{get children(){return s.content}})})),o})()},s4=OY,N6=vi(void 0);function NY(e){const[t,n]=Me(null),[r,i]=Me(null),a=o6(t,r,{placement:e.placement||"top",whileElementsMounted:n6,middleware:[r6(10),a6({fallbackPlacements:e.fallbackPlacements||["bottom"]}),i6()]}),[o,s]=xK({value:e.open,fallbackValue:!1});return Z(N6.Provider,{value:{reference:t,setReference:n,floating:r,setFloating:i,open:o,setOpen:s,floatingStyles:()=>{var l,u;return{position:a.strategy,top:`${(l=a.y)!=null?l:0}px`,left:`${(u=a.x)!=null?u:0}px`}}},get children(){return e.children}})}function e9(){const e=lr(N6);if(!e)throw new Error("useTooltip must be used within Tooltip.Root component");return e}var IY=Le("<div>"),PY=()=>"nt-bg-foreground nt-p-2 nt-shadow-tooltip nt-rounded-lg nt-text-background nt-text-xs",RY=e=>{const{open:t,setFloating:n,floating:r,floatingStyles:i}=e9(),{setActive:a,removeActive:o}=Yy(),[s,l]=wn(e,["class","appearanceKey","style"]),u=ft();return sr(()=>{const c=r();a(c),dn(()=>{o(c)})}),(()=>{var c=IY();return Ca(n,c),Ft(c,At({get class(){return He(()=>!!s.class)()?s.class:u(s.appearanceKey||"tooltipContent",PY())},get style(){return an(Ye({},i()),{"z-index":99999})},get"data-open"(){return t()}},l),!1,!1),c})()},FY=e=>{const{open:t}=e9();return Z(Tt,{get when(){return t()},get children(){return Z(jy,{get children(){return Z(Xy,{get children(){return Z(RY,e)}})}})}})},MY=Le("<button>"),BY=e=>{const{setReference:t,setOpen:n}=e9(),r=ft(),[i,a]=wn(e,["appearanceKey","asChild","onClick"]);return i.asChild?Z(Fh,At({get component(){return i.asChild},ref:t,onMouseEnter:()=>{n(!0)},onMouseLeave:()=>{n(!1)}},a)):(()=>{var o=MY();return o.addEventListener("mouseleave",()=>{n(!1)}),o.addEventListener("mouseenter",()=>{n(!0)}),Ca(t,o),Ft(o,At({get class(){return r(i.appearanceKey||"tooltipTrigger")}},a),!1,!0),Ie(o,()=>e.children),o})()},Dr={Root:NY,Trigger:BY,Content:FY},LY=Le("<span>"),$Y=Le("<img>"),jY=Le('<a><div><div class="nt-relative nt-shrink-0 nt-float-right nt-ml-1 nt-pr-1.5"><p></p><div></div></div><div>'),HY=e=>{const t=ft(),{t:n,locale:r}=go(),{navigate:i,status:a}=dr(),[o,s]=Me(0),l=He(()=>(o(),vK({fromDate:new Date(e.notification.createdAt),locale:r()})));cn(()=>{const d=setInterval(()=>{s(f=>f+1)},6e4);return()=>clearInterval(d)});const u=d=>{var f,h,m;d.stopPropagation(),d.preventDefault(),e.notification.isRead||e.notification.read(),(f=e.onNotificationClick)==null||f.call(e,e.notification),i((h=e.notification.redirect)==null?void 0:h.url,(m=e.notification.redirect)==null?void 0:m.target)},c=(d,f)=>{var h,m,p,y,v,b,_,T,C,x;f.stopPropagation(),d==="primary"?(e.notification.completePrimary(),(h=e.onPrimaryActionClick)==null||h.call(e,e.notification),i((p=(m=e.notification.primaryAction)==null?void 0:m.redirect)==null?void 0:p.url,(v=(y=e.notification.primaryAction)==null?void 0:y.redirect)==null?void 0:v.target)):(e.notification.completeSecondary(),(b=e.onSecondaryActionClick)==null||b.call(e,e.notification),i((T=(_=e.notification.secondaryAction)==null?void 0:_.redirect)==null?void 0:T.url,(x=(C=e.notification.secondaryAction)==null?void 0:C.redirect)==null?void 0:x.target))};return(()=>{var d=jY(),f=d.firstChild,h=f.firstChild,m=h.firstChild,p=m.nextSibling,y=h.nextSibling;return d.$$click=u,Ie(d,Z(Tt,{get when(){return!e.notification.isRead},get children(){var v=LY();return ct(()=>Ze(v,t("notificationDot","nt-absolute -nt-translate-x-[1.0625rem] nt-translate-y-1/2 nt-size-2.5 nt-bg-primary nt-rounded-full nt-border nt-border-neutral-alpha-200"))),v}}),f),Ie(d,Z(Tt,{get when(){return e.notification.avatar},get children(){var v=$Y();return ct(b=>{var _=t("notificationImage","nt-size-8 nt-rounded-lg"),T=e.notification.avatar;return _!==b.e&&Ze(v,b.e=_),T!==b.t&&er(v,"src",b.t=T),b},{e:void 0,t:void 0}),v}}),f),Ie(m,l),Ie(p,Z(Tt,{get when(){return a()!=="archived"},get children(){return Z(Tt,{get when(){return e.notification.isRead},get fallback(){return Z(Dr.Root,{get children(){return[Z(Dr.Trigger,{asChild:v=>Z(yr,At({appearanceKey:"notificationRead__button",size:"icon",variant:"icon"},v,{onClick:b=>{b.stopPropagation(),e.notification.read()},class:"hover:nt-bg-neutral-alpha-50 nt-p-0.5",get children(){return Z(b6,{})}}))}),Z(Dr.Content,{"data-localization":"notification.actions.read.tooltip",get children(){return n("notification.actions.read.tooltip")}})]}})},get children(){return Z(Dr.Root,{get children(){return[Z(Dr.Trigger,{asChild:v=>Z(yr,At({appearanceKey:"notificationUnread__button",size:"icon",variant:"icon"},v,{onClick:b=>{b.stopPropagation(),e.notification.unread()},class:"hover:nt-bg-neutral-alpha-50 nt-p-0.5",get children(){return Z(E6,{})}}))}),Z(Dr.Content,{"data-localization":"notification.actions.unread.tooltip",get children(){return n("notification.actions.unread.tooltip")}})]}})}})}}),null),Ie(p,Z(Tt,{get when(){return e.notification.isArchived},get fallback(){return Z(Dr.Root,{get children(){return[Z(Dr.Trigger,{asChild:v=>Z(yr,At({appearanceKey:"notificationArchive__button",size:"icon",variant:"icon"},v,{onClick:b=>{b.stopPropagation(),e.notification.archive()},class:"hover:nt-bg-neutral-alpha-50 nt-p-0.5",get children(){return Z(Zy,{})}}))}),Z(Dr.Content,{"data-localization":"notification.actions.archive.tooltip",get children(){return n("notification.actions.archive.tooltip")}})]}})},get children(){return Z(Dr.Root,{get children(){return[Z(Dr.Trigger,{asChild:v=>Z(yr,At({appearanceKey:"notificationUnarchive__button",size:"icon",variant:"icon"},v,{onClick:b=>{b.stopPropagation(),e.notification.unarchive()},class:"hover:nt-bg-neutral-alpha-50 nt-p-0.5",get children(){return Z(gG,{})}}))}),Z(Dr.Content,{"data-localization":"notification.actions.unarchive.tooltip",get children(){return n("notification.actions.unarchive.tooltip")}})]}})}}),null),Ie(f,Z(Tt,{get when(){return e.notification.subject},children:v=>Z(s4,{get class(){return t("notificationSubject","nt-text-start")},strongAppearanceKey:"notificationSubject__strong",get children(){return v()}})}),y),Ie(f,Z(s4,{get class(){return t("notificationBody","nt-text-start")},strongAppearanceKey:"notificationBody__strong",get children(){return e.notification.body}}),y),Ie(y,Z(Tt,{get when(){return e.notification.primaryAction},keyed:!0,children:v=>Z(yr,{appearanceKey:"notificationPrimaryAction__button",variant:"default",onClick:b=>c("primary",b),get children(){return v.label}})}),null),Ie(y,Z(Tt,{get when(){return e.notification.secondaryAction},keyed:!0,children:v=>Z(yr,{appearanceKey:"notificationSecondaryAction__button",variant:"secondary",onClick:b=>c("secondary",b),get children(){return v.label}})}),null),ct(v=>{var b,_=t("notification",Bn("nt-w-full nt-text-sm hover:nt-bg-neutral-alpha-50 nt-group nt-relative nt-flex nt-py-4 nt-px-6 nt-gap-2",{"nt-cursor-pointer":!e.notification.isRead||!!((b=e.notification.redirect)!=null&&b.url)})),T=t("notificationBody","nt-overflow-hidden nt-w-full"),C=t("notificationDate","nt-transition nt-duration-100 nt-ease-out nt-text-foreground-alpha-400 nt-shrink-0 nt-float-right nt-text-right group-hover:nt-opacity-0"),x=t("notificationDefaultActions","nt-transition nt-duration-100 nt-ease-out nt-gap-2 nt-flex nt-shrink-0 nt-opacity-0 group-hover:nt-opacity-100 nt-justify-center nt-items-center nt-absolute nt-top-0 nt-right-0 nt-bg-neutral-alpha-50 nt-rounded-lg nt-backdrop-blur-md nt-p-0.5"),w=t("notificationCustomActions","nt-flex nt-flex-wrap nt-gap-4 nt-mt-4");return _!==v.e&&Ze(d,v.e=_),T!==v.t&&Ze(f,v.t=T),C!==v.a&&Ze(m,v.a=C),x!==v.o&&Ze(p,v.o=x),w!==v.i&&Ze(y,v.i=w),v},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),d})()};zl(["click"]);var UY=e=>Z(Tt,{get when(){return e.renderNotification},get fallback(){return Z(HY,{get notification(){return e.notification},get onNotificationClick(){return e.onNotificationClick},get onPrimaryActionClick(){return e.onPrimaryActionClick},get onSecondaryActionClick(){return e.onSecondaryActionClick}})},get children(){return Z(g6,{render:t=>e.renderNotification(t,e.notification)})}}),zY=Le('<svg xmlns=http://www.w3.org/2000/svg width=48 height=48 viewBox="0 0 48 48"fill=none><path fill=currentColor d="M35.2 21.62L32.38 18.8L39.5 11.7L42.32 14.52C42.1 14.58 35.2 21.62 35.2 21.62ZM26 6H22V16H26V6ZM12.8 21.62L15.62 18.8L8.52 11.68L5.68 14.52C5.9 14.58 12.8 21.62 12.8 21.62ZM40 28H33.16C31.62 31.52 28.08 34 24 34C19.92 34 16.38 31.52 14.84 28H8V38H40V28ZM40 24C42.2 24 44 25.8 44 28V38C44 40.2 42.2 42 40 42H8C5.8 42 4 40.2 4 38V28C4 25.8 5.8 24 8 24H18C18 27.32 20.68 30 24 30C27.32 30 30 27.32 30 24H40Z">');function VY(e){return(()=>{var t=zY();return Ft(t,e,!0,!0),t})()}var qY=e=>{const t=He(()=>!!e.count),{t:n}=go();return Z(Tt,{get when(){return t()},get children(){return Z(yr,{appearanceKey:"notificationListNewNotificationsNotice__button",class:"nt-absolute nt-w-fit nt-top-0 nt-mx-auto nt-inset-2 nt-z-10 nt-rounded-full hover:nt-bg-primary-600 nt-animate-in nt-slide-in-from-top-2 nt-fade-in",get onClick(){return e.onClick},"data-localization":"notifications.newNotifications",get children(){return n("notifications.newNotifications",{notificationCount:e.count})}})}})},WY=Le('<div class="nt-flex nt-gap-2 nt-px-6 nt-py-4 nt-w-full"><div class="nt-flex nt-flex-col nt-self-stretch nt-gap-3 nt-flex-1"><div class="nt-flex nt-gap-1"></div><div class="nt-flex nt-gap-1">'),I6=()=>(()=>{var e=WY(),t=e.firstChild,n=t.firstChild,r=n.nextSibling;return Ie(e,Z(yY,{appearanceKey:"skeletonAvatar"}),t),Ie(t,Z(jo,{appearanceKey:"skeletonText",class:"nt-w-1/4"}),n),Ie(n,Z(jo,{appearanceKey:"skeletonText"}),null),Ie(n,Z(jo,{appearanceKey:"skeletonText"}),null),Ie(r,Z(jo,{appearanceKey:"skeletonText",class:"nt-w-2/3"}),null),Ie(r,Z(jo,{appearanceKey:"skeletonText",class:"nt-w-1/3"}),null),e})(),KY=e=>Z(Wi,{get each(){return Array.from({length:e.count})},children:()=>Z(I6,{})}),GY=Le("<div><p data-localization=notifications.emptyNotice>"),YY=Le("<div>"),ZY=Le("<div><div>"),QY=()=>{const e=ft(),{t}=go();return(()=>{var n=GY(),r=n.firstChild;return Ie(n,Z(VY,{get class(){return e("notificationListEmptyNoticeIcon")}}),r),Ie(r,()=>t("notifications.emptyNotice")),ct(i=>{var a=e("notificationListEmptyNoticeContainer","nt-absolute nt-inset-0 nt-flex nt-flex-col nt-items-center nt-m-auto nt-h-fit nt-w-full nt-text-foreground-alpha-100"),o=e("notificationListEmptyNotice");return a!==i.e&&Ze(n,i.e=a),o!==i.t&&Ze(r,i.t=o),i},{e:void 0,t:void 0}),n})()},P6=e=>{var t,n;const r=He(()=>an(Ye({},e.filter),{limit:e.limit})),i=ft(),{data:a,setEl:o,end:s,refetch:l,initialLoading:u}=XG({options:r}),{count:c,reset:d}=MK({filter:{tags:(n=(t=e.filter)==null?void 0:t.tags)!=null?n:[]}}),{setLimit:f}=dr(),h=He(()=>a().map(y=>y.id));let m;cn(()=>{f(e.limit||f6)});const p=y=>Ve(void 0,null,function*(){y.stopPropagation(),d(),l({filter:e.filter}),m.scrollTo({top:0})});return(()=>{var y=ZY(),v=y.firstChild;return Ie(y,Z(qY,{get count(){return c()},onClick:p}),v),Ca(b=>{m=b},v),Ie(v,Z(Tt,{get when(){return!u()},get fallback(){return Z(KY,{count:8})},get children(){return Z(Tt,{get when(){return a().length>0},get fallback(){return Z(QY,{})},get children(){return[Z(Wi,{get each(){return h()},children:(b,_)=>{const T=()=>a()[_()];return Z(UY,{get notification(){return T()},get renderNotification(){return e.renderNotification},get onNotificationClick(){return e.onNotificationClick},get onPrimaryActionClick(){return e.onPrimaryActionClick},get onSecondaryActionClick(){return e.onSecondaryActionClick}})}}),Z(Tt,{get when(){return!s()},get children(){var b=YY();return Ca(o,b),Ie(b,Z(Wi,{get each(){return Array.from({length:3})},children:()=>Z(I6,{})})),b}})]}})}})),ct(b=>{var _=i("notificationListContainer","nt-relative nt-h-full nt-overflow-hidden"),T=i("notificationList","nt-relative nt-h-full nt-flex nt-flex-col nt-overflow-y-auto");return _!==b.e&&Ze(y,b.e=_),T!==b.t&&Ze(v,b.t=T),b},{e:void 0,t:void 0}),y})()},t9=Le("<span>"),XY=e=>e>=100?"99+":e,n9=e=>{const t=ft(),n=He(()=>XY(e.count));return(()=>{var r=t9();return Ie(r,n),ct(()=>Ze(r,t("notificationsTabsTriggerCount","nt-rounded-full nt-bg-counter nt-px-[6px] nt-text-counter-foreground nt-text-sm"))),r})()},l4=e=>{const{status:t}=dr(),n=ft(),r=p6({filter:{tags:ba(e)}});return Z(Uu.Trigger,{get value(){return e.label},get class(){return n("notificationsTabs__tabsTrigger",Bn(S6(),"nt-flex nt-gap-2",e.class))},get children(){return[(()=>{var i=t9();return Ie(i,()=>e.label),ct(()=>Ze(i,n("notificationsTabsTriggerLabel","nt-text-sm nt-font-medium"))),i})(),Z(Tt,{get when(){return He(()=>t()!=="archived")()&&r()},get children(){return Z(n9,{get count(){return r()}})}})]}})},JY=e=>{const{status:t}=dr(),n=ft(),r=p6({filter:{tags:ba(e)}});return Z(Ur.Item,{get class(){return n("moreTabs__dropdownItem",Bn(zh(),"nt-flex nt-justify-between nt-gap-2"))},get children(){return[(()=>{var i=t9();return Ie(i,()=>e.label),ct(()=>Ze(i,n("moreTabs__dropdownItemLabel","nt-mr-auto"))),i})(),He(()=>e.rightIcon),Z(Tt,{get when(){return He(()=>t()!=="archived")()&&r()},get children(){return Z(n9,{get count(){return r()}})}})]}})},eZ=({tabs:e})=>{const[t,n]=Me(),[r,i]=Me([]),[a,o]=Me([]);return sr(()=>{const s=t();if(!s)return;const l=[...s.querySelectorAll('[role="tab"]')],u=new IntersectionObserver(c=>{let d=c.filter(f=>f.isIntersecting&&f.intersectionRatio===1).map(f=>f.target.id);if(l.length===d.length){i(e.filter(f=>d.includes(f.label))),u.disconnect();return}d=d.slice(0,-1),i(e.filter(f=>d.includes(f.label))),o(e.filter(f=>!d.includes(f.label))),u.disconnect()},{root:s});for(const c of l)u.observe(c)}),{dropdownTabs:a,setTabsList:n,visibleTabs:r}},tZ=()=>"nt-relative after:nt-absolute after:nt-content-[''] after:nt-bottom-0 after:nt-left-0 after:nt-w-full after:nt-h-[2px] after:nt-border-b-2 nt-pb-[0.625rem]",nZ=e=>{const t=ft(),{activeTab:n,status:r,setActiveTab:i,filter:a}=dr(),{dropdownTabs:o,setTabsList:s,visibleTabs:l}=eZ({tabs:e.tabs}),u=BK({filters:o().map(h=>({tags:ba(h)}))}),c=He(()=>o().map(h=>an(Ye({},h),{rightIcon:h.label===n()?Z(v6,{get class(){return t("moreTabs__dropdownItemRight__icon")}}):void 0}))),d=He(()=>u().reduce((h,m)=>h+m,0)),f=He(()=>o().map(h=>h.label).includes(n()));return Z(Uu.Root,{get class(){return t("notificationsTabs__tabsRoot",Bn(k6(),"nt-flex-1 nt-overflow-hidden"))},get value(){return n()},onChange:i,get children(){return[Z(Tt,{get when(){return l().length>0},get fallback(){return Z(Uu.List,{ref:s,appearanceKey:"notificationsTabs__tabsList",get children(){return e.tabs.map(h=>Z(l4,At(h,{class:"nt-invisible"})))}})},get children(){return Z(Uu.List,{appearanceKey:"notificationsTabs__tabsList",get children(){return[He(()=>l().map(h=>Z(l4,h))),Z(Tt,{get when(){return o().length>0},get children(){return Z(Ur.Root,{fallbackPlacements:["bottom","top"],placement:"bottom-start",get children(){return[Z(Ur.Trigger,{appearanceKey:"moreTabs__dropdownTrigger",asChild:h=>Z(yr,At({variant:"unstyled",size:"none",appearanceKey:"moreTabs__button"},h,{get class(){return Bn(tZ(),f()?"after:nt-border-b-primary":"after:nt-border-b-transparent nt-text-foreground-alpha-600")},get children(){return[Z(y6,{get class(){return t("moreTabs__dots")}}),Z(Tt,{get when(){return He(()=>r()!=="archived")()&&d()},get children(){return Z(n9,{get count(){return d()}})}})]}}))}),Z(Ur.Content,{appearanceKey:"moreTabs__dropdownContent",get children(){return Z(Wi,{get each(){return c()},children:h=>Z(JY,At({onClick:()=>i(h.label)},h))})}})]}})}})]}})}}),He(()=>e.tabs.map(h=>Z(Uu.Content,{get value(){return h.label},get class(){return t("notificationsTabs__tabsContent",Bn(n()===h.label?"nt-block":"nt-hidden","nt-flex-1 nt-overflow-hidden"))},get children(){return Z(P6,{get renderNotification(){return e.renderNotification},get onNotificationClick(){return e.onNotificationClick},get onPrimaryActionClick(){return e.onPrimaryActionClick},get onSecondaryActionClick(){return e.onSecondaryActionClick},get filter(){return an(Ye({},a()),{tags:ba(h)})}})}})))]}})},rZ=Le("<div>"),Ho=function(e){return e.Notifications="notifications",e.Preferences="preferences",e}({}),zd=e=>{const[t,n]=Me(e.initialPage||Ho.Notifications),{tabs:r,filter:i}=dr(),a=ft(),o=He(()=>s=>{if(!e.hideNav)return()=>{n(s)}});return(()=>{var s=rZ();return Ie(s,Z(TV,{get children(){return[Z(bE,{get when(){return t()===Ho.Notifications},get children(){return[Z(lY,{get navigateToPreferences(){return o()(Ho.Preferences)}}),Z(Tt,{keyed:!0,get when(){return He(()=>!!r())()&&r().length>0},get fallback(){return Z(P6,{get renderNotification(){return e.renderNotification},get onNotificationClick(){return e.onNotificationClick},get onPrimaryActionClick(){return e.onPrimaryActionClick},get onSecondaryActionClick(){return e.onSecondaryActionClick},get filter(){return i()}})},get children(){return Z(nZ,{get renderNotification(){return e.renderNotification},get onNotificationClick(){return e.onNotificationClick},get onPrimaryActionClick(){return e.onPrimaryActionClick},get onSecondaryActionClick(){return e.onSecondaryActionClick},get tabs(){return r()}})}})]}}),Z(bE,{get when(){return t()===Ho.Preferences},get children(){return[Z(dY,{get navigateToNotifications(){return o()(Ho.Notifications)}}),Z(xY,{})]}})]}}),null),Ie(s,Z(EG,{}),null),ct(()=>Ze(s,a("inboxContent","nt-h-full nt-flex nt-flex-col"))),s})()},iZ=e=>{const t=ft(),{isOpened:n,setIsOpened:r}=dr(),i=()=>{var a;return(a=e==null?void 0:e.open)!=null?a:n()};return Z(ro.Root,{get open(){return i()},onOpenChange:r,get children(){return[Z(ro.Trigger,{asChild:a=>Z(yr,At({get class(){return t("inbox__popoverTrigger")},variant:"ghost",size:"icon"},a,{get children(){return Z(_6,{get renderBell(){return e.renderBell}})}}))}),Z(ro.Content,{appearanceKey:"inbox__popoverContent",portal:!0,get children(){return Z(zd,{get renderNotification(){return e.renderNotification},get onNotificationClick(){return e.onNotificationClick},get onPrimaryActionClick(){return e.onPrimaryActionClick},get onSecondaryActionClick(){return e.onSecondaryActionClick}})}})]}})},aZ={Inbox:iZ,InboxContent:zd,Bell:_6,Notifications:e=>Z(zd,At(e,{hideNav:!0,get initialPage(){return Ho.Notifications}})),Preferences:e=>Z(zd,At(e,{hideNav:!0,get initialPage(){return Ho.Preferences}}))},oZ=e=>{const t=()=>[...e.nodes.keys()];return sr(()=>{const n="novu-default-css";if(document.getElementById(n))return;const i=document.createElement("link");i.id=n,i.rel="stylesheet",i.href=e.cssHref,document.head.insertBefore(i,document.head.firstChild),dn(()=>{const a=document.getElementById(n);a==null||a.remove()})}),Z(IK,{get options(){return e.options},get novu(){return e.novu},get children(){return Z(OK,{get localization(){return e.localization},get children(){return Z(kK,{get id(){return e.novuUI.id},get appearance(){return e.appearance},get children(){return Z(jK,{get children(){return Z(NK,{get tabs(){return e.tabs},get preferencesFilter(){return e.preferencesFilter},get routerPush(){return e.routerPush},get children(){return Z(RK,{get children(){return Z(Wi,{get each(){return t()},children:n=>{const r=()=>e.nodes.get(n);let i;const a=aZ[r().name];return sr(()=>{["Notifications","Preferences"].includes(r().name)&&(n instanceof HTMLElement&&n.classList.add("nt-h-full"),i.classList.add("nt-h-full"))}),Z(jy,{mount:n,ref:o=>{i=o},get children(){return Z(Xy,{get children(){return Z(a,At(()=>r().props))}})}})}})}})}})}})}})}})}})},sZ="2.6.0",lZ=`https://cdn.jsdelivr.net/npm/@novu/js@${sZ}/dist/index.css`,ll,qo,rc,Qs,Gf,Vd,Yf,qd,Zf,Wd,Qf,Kd,Xf,Gd,Jf,Yd,eh,Zd,R6,F6,uZ=class{constructor(t){Ge(this,Zd),Ge(this,ll,null),Ge(this,qo),Ge(this,rc),Ge(this,Qs),Ge(this,Gf),Ge(this,Vd),Ge(this,Yf),Ge(this,qd),Ge(this,Zf),Ge(this,Wd),Ge(this,Qf),Ge(this,Kd),Ge(this,Xf),Ge(this,Gd),Ge(this,Jf),Ge(this,Yd),Ge(this,eh);var n;this.id=s6(16);const[r,i]=Me(t.appearance),[a,o]=Me(t.localization),[s,l]=Me(t.options),[u,c]=Me(new Map),[d,f]=Me((n=t.tabs)!=null?n:[]),[h,m]=Me(t.preferencesFilter),[p,y]=Me(t.routerPush);Qe(this,rc,u),Qe(this,Qs,c),Qe(this,Gf,r),Qe(this,Vd,i),Qe(this,Yf,a),Qe(this,qd,o),Qe(this,Zf,s),Qe(this,Wd,l),Qe(this,Qf,d),Qe(this,Kd,f),Qe(this,Xf,p),Qe(this,Gd,y),Qe(this,eh,t.novu),Qe(this,Jf,h),Qe(this,Yd,m),Of(this,Zd,R6).call(this)}mountComponent({name:t,element:n,props:r}){if(oe(this,rc).call(this).has(n))return Of(this,Zd,F6).call(this,n,r);oe(this,Qs).call(this,i=>{const a=new Map(i);return a.set(n,{name:t,props:r}),a})}unmountComponent(t){oe(this,Qs).call(this,n=>{const r=new Map(n);return r.delete(t),r})}updateAppearance(t){oe(this,Vd).call(this,t)}updateLocalization(t){oe(this,qd).call(this,t)}updateOptions(t){oe(this,Wd).call(this,t)}updateTabs(t){oe(this,Kd).call(this,t??[])}updatePreferencesFilter(t){oe(this,Yd).call(this,t)}updateRouterPush(t){oe(this,Gd).call(this,()=>t)}unmount(){var t,n;(t=oe(this,ll))==null||t.call(this),Qe(this,ll,null),(n=oe(this,qo))==null||n.remove()}};ll=new WeakMap;qo=new WeakMap;rc=new WeakMap;Qs=new WeakMap;Gf=new WeakMap;Vd=new WeakMap;Yf=new WeakMap;qd=new WeakMap;Zf=new WeakMap;Wd=new WeakMap;Qf=new WeakMap;Kd=new WeakMap;Xf=new WeakMap;Gd=new WeakMap;Jf=new WeakMap;Yd=new WeakMap;eh=new WeakMap;Zd=new WeakSet;R6=function(){if(oe(this,ll)!==null)return;Qe(this,qo,document.createElement("div")),oe(this,qo).setAttribute("id",`novu-ui-${this.id}`),document.body.appendChild(oe(this,qo));const e=PV(()=>{const t=this;return Z(oZ,{cssHref:lZ,novuUI:t,get nodes(){var n;return oe(n=t,rc).call(n)},get options(){var n;return oe(n=t,Zf).call(n)},get appearance(){var n;return oe(n=t,Gf).call(n)},get localization(){var n;return oe(n=t,Yf).call(n)},get tabs(){var n;return oe(n=t,Qf).call(n)},get preferencesFilter(){var n;return oe(n=t,Jf).call(n)},get routerPush(){var n;return oe(n=t,Xf).call(n)},get novu(){return oe(t,eh)}})},oe(this,qo));Qe(this,ll,e)};F6=function(e,t){oe(this,Qs).call(this,n=>{const r=new Map(n),i=r.get(e);return i&&r.set(e,an(Ye({},i),{props:t})),r})};function Vh({mount:e}){const t=E.useRef(null);return E.useEffect(()=>{let n;const r=t.current;if(r&&e){const i=e(r);i&&(n=i)}return()=>{r&&n&&n(r)}},[t,e]),g.jsx("div",{ref:t})}function cZ(e,t){if(!e)throw typeof t=="string"?new Error(t):new Error(`${t.displayName} not found`)}var M6=(e,t)=>{const{assertCtxFn:n=cZ}=t||{},r=E.createContext(void 0);return r.displayName=e,[r,()=>{const o=E.useContext(r);return n(o,`Component must be wrapped with ${r.displayName}`),o.value},()=>{const o=E.useContext(r);return o?o.value:{}}]},[dZ,qh,Vve]=M6("RendererContext"),fZ=e=>g.jsx(dZ.Provider,{value:{value:e.value},children:e.children}),hZ=e=>{const{children:t}=e,[n,r]=E.useState(new Map),i=E.useCallback((a,o)=>(r(s=>{const l=new Map(s);return l.set(a,o),l}),()=>{r(s=>{const l=new Map(s);return l.delete(a),l})}),[r]);return g.jsxs(fZ,{value:{mountElement:i},children:[[...n].map(([a,o])=>ph.createPortal(o,a)),t]})},Wh=e=>{const t=n=>g.jsx(hZ,{children:g.jsx(e,{...n})});return t.displayName=`WithRenderer(${e.displayName||e.name||"Component"})`,t},[pZ,Kh,qve]=M6("NovuUIContext"),mZ=e=>g.jsx(pZ.Provider,{value:{value:e.value},children:e.children}),gZ=E.memo(e=>{const{renderBell:t}=e,{novuUI:n}=Kh(),{mountElement:r}=qh(),i=E.useCallback(a=>n.mountComponent({name:"Bell",element:a,props:t?{renderBell:(o,s)=>r(o,t(s))}:void 0}),[t]);return g.jsx(Vh,{mount:i})});Wh(gZ);var vZ="2.6.0",yZ="@novu/react",bZ=`${yZ}@${vZ}`,r9=E.createContext(void 0),EZ=({children:e,applicationIdentifier:t,subscriberId:n,subscriberHash:r,backendUrl:i,socketUrl:a,useCache:o,userAgentType:s})=>{const l=E.useMemo(()=>new u7({applicationIdentifier:t,subscriberId:n,subscriberHash:r,backendUrl:i,socketUrl:a,useCache:o,__userAgent:`${bZ} ${s}`}),[t,n,r,i,a,o,s]);return g.jsx(r9.Provider,{value:l,children:e})},_Z=()=>{const e=E.useContext(r9);if(!e)throw new Error("useNovu must be used within a <NovuProvider />");return e},TZ=()=>E.useContext(r9),CZ=e=>{const t=E.useRef(e);return t.current=e,t},u4=({options:e,novu:t,children:n})=>{const r=CZ({...e,novu:t}),[i,a]=E.useState();return E.useEffect(()=>{const o=new uZ(r.current);return a(o),()=>{o.unmount()}},[]),E.useEffect(()=>{i&&(i.updateAppearance(e.appearance),i.updateLocalization(e.localization),i.updateTabs(e.tabs),i.updateOptions(e.options),i.updateRouterPush(e.routerPush))},[e]),i?g.jsx(mZ,{value:{novuUI:i},children:n}):null},xZ=e=>{const{open:t,renderNotification:n,renderBell:r,onNotificationClick:i,onPrimaryActionClick:a,onSecondaryActionClick:o}=e,{novuUI:s}=Kh(),{mountElement:l}=qh(),u=E.useCallback(c=>s.mountComponent({name:"Inbox",props:{open:t,renderNotification:n?(d,f)=>l(d,n(f)):void 0,renderBell:r?(d,f)=>l(d,r(f)):void 0,onNotificationClick:i,onPrimaryActionClick:a,onSecondaryActionClick:o},element:c}),[t,n,r,i,a,o]);return g.jsx(Vh,{mount:u})},wZ=Wh(xZ),AZ=E.memo(e=>{const{applicationIdentifier:t,subscriberId:n,subscriberHash:r,backendUrl:i,socketUrl:a}=e;return TZ()?g.jsx(c4,{...e}):g.jsx(EZ,{applicationIdentifier:t,subscriberId:n,subscriberHash:r,backendUrl:i,socketUrl:a,userAgentType:"components",children:g.jsx(c4,{...e})})}),c4=E.memo(e=>{const{localization:t,appearance:n,tabs:r,preferencesFilter:i,routerPush:a,applicationIdentifier:o,subscriberId:s,subscriberHash:l,backendUrl:u,socketUrl:c}=e,d=_Z(),f=E.useMemo(()=>({localization:t,appearance:n,tabs:r,preferencesFilter:i,routerPush:a,options:{applicationIdentifier:o,subscriberId:s,subscriberHash:l,backendUrl:u,socketUrl:c}}),[t,n,r,i,o,s,l,u,c]);if(kZ(e))return g.jsx(u4,{options:f,novu:d,children:e.children});const{open:h,renderNotification:m,renderBell:p,onNotificationClick:y,onPrimaryActionClick:v,onSecondaryActionClick:b}=e;return g.jsx(u4,{options:f,novu:d,children:g.jsx(wZ,{open:h,renderNotification:m,renderBell:p,onNotificationClick:y,onPrimaryActionClick:v,onSecondaryActionClick:b})})});function kZ(e){return"children"in e}var SZ=E.memo(e=>{const{onNotificationClick:t,onPrimaryActionClick:n,renderNotification:r,onSecondaryActionClick:i}=e,{novuUI:a}=Kh(),{mountElement:o}=qh(),s=E.useCallback(l=>a.mountComponent({name:"Notifications",element:l,props:{renderNotification:r?(u,c)=>o(u,r(c)):void 0,onNotificationClick:t,onPrimaryActionClick:n,onSecondaryActionClick:i}}),[r,t,n,i]);return g.jsx(Vh,{mount:s})});Wh(SZ);var DZ=E.memo(e=>{const{onNotificationClick:t,onPrimaryActionClick:n,renderNotification:r,onSecondaryActionClick:i,initialPage:a,hideNav:o}=e,{novuUI:s}=Kh(),{mountElement:l}=qh(),u=E.useCallback(c=>s.mountComponent({name:"InboxContent",element:c,props:{renderNotification:r?(d,f)=>l(d,r(f)):void 0,onNotificationClick:t,onPrimaryActionClick:n,onSecondaryActionClick:i,initialPage:a,hideNav:o}}),[r,t,n,i]);return g.jsx(Vh,{mount:u})});Wh(DZ);const Gh=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),Lr=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())(),OZ="arraybuffer";function B6(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const NZ=Lr.setTimeout,IZ=Lr.clearTimeout;function Yh(e,t){t.useNativeTimers?(e.setTimeoutFn=NZ.bind(Lr),e.clearTimeoutFn=IZ.bind(Lr)):(e.setTimeoutFn=Lr.setTimeout.bind(Lr),e.clearTimeoutFn=Lr.clearTimeout.bind(Lr))}const PZ=1.33;function RZ(e){return typeof e=="string"?FZ(e):Math.ceil((e.byteLength||e.size)*PZ)}function FZ(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function L6(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function MZ(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function BZ(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let a=n[r].split("=");t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}class LZ extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class i9 extends Jt{constructor(t){super(),this.writable=!1,Yh(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new LZ(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Oh(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=MZ(t);return n.length?"?"+n:""}}class $Z extends i9{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Vw(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,zw(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=L6()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let $6=!1;try{$6=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const jZ=$6;function HZ(){}class UZ extends $Z{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,a)=>{this.onError("xhr post error",i,a)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Bi extends Jt{constructor(t,n,r){super(),this.createRequest=t,Yh(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=B6(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=Bi.requestsCount++,Bi.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=HZ,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Bi.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Bi.requestsCount=0;Bi.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",d4);else if(typeof addEventListener=="function"){const e="onpagehide"in Lr?"pagehide":"unload";addEventListener(e,d4,!1)}}function d4(){for(let e in Bi.requests)Bi.requests.hasOwnProperty(e)&&Bi.requests[e].abort()}const zZ=function(){const e=j6({xdomain:!1});return e&&e.responseType!==null}();class VZ extends UZ{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=zZ&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Bi(j6,this.uri(),t)}}function j6(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||jZ))return new XMLHttpRequest}catch{}if(!t)try{return new Lr[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const H6=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class qZ extends i9{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=H6?{}:B6(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;Dh(r,this.supportsBinary,a=>{try{this.doWrite(r,a)}catch{}i&&Gh(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=L6()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const jm=Lr.WebSocket||Lr.MozWebSocket;class WZ extends qZ{createSocket(t,n,r){return H6?new jm(t,n,r):n?new jm(t,n):new jm(t)}doWrite(t,n){this.ws.send(n)}}class KZ extends i9{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=Ww(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=qw();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const a=()=>{r.read().then(({done:s,value:l})=>{s||(this.onPacket(l),a())}).catch(s=>{})};a();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&Gh(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const GZ={websocket:WZ,webtransport:KZ,polling:VZ},YZ=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,ZZ=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function tv(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=YZ.exec(e||""),a={},o=14;for(;o--;)a[ZZ[o]]=i[o]||"";return n!=-1&&r!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=QZ(a,a.path),a.queryKey=XZ(a,a.query),a}function QZ(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function XZ(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,a){i&&(n[i]=a)}),n}const nv=typeof addEventListener=="function"&&typeof removeEventListener=="function",Qd=[];nv&&addEventListener("offline",()=>{Qd.forEach(e=>e())},!1);class io extends Jt{constructor(t,n){if(super(),this.binaryType=OZ,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=tv(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=tv(n.host).host);Yh(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=BZ(this.opts.query)),nv&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Qd.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Nh,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&io.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",io.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=RZ(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Gh(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const a={type:t,data:n,options:r};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(io.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),nv&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Qd.indexOf(this._offlineEventListener);r!==-1&&Qd.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}io.protocol=Nh;class JZ extends io{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;io.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;io.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(c(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function a(){r||(r=!0,c(),n.close(),n=null)}const o=d=>{const f=new Error("probe error: "+d);f.transport=n.name,a(),this.emitReserved("upgradeError",f)};function s(){o("transport closed")}function l(){o("socket closed")}function u(d){n&&d.name!==n.name&&a()}const c=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",o),n.once("close",s),this.once("close",l),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let eQ=class extends JZ{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>GZ[i]).filter(i=>!!i)),super(t,r)}};function tQ(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=tv(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const a=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port+t,r.href=r.protocol+"://"+a+(n&&n.port===r.port?"":":"+r.port),r}function li(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const nQ=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class U6 extends Jt{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[li(t,"open",this.onopen.bind(this)),li(t,"packet",this.onpacket.bind(this)),li(t,"error",this.onerror.bind(this)),li(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,i,a;if(nQ.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:et.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const c=this.ids++,d=n.pop();this._registerAckCallback(c,d),o.id=c}const s=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!s||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let s=0;s<this.sendBuffer.length;s++)this.sendBuffer[s].id===t&&this.sendBuffer.splice(s,1);n.call(this,new Error("operation has timed out"))},i),o=(...s)=>{this.io.clearTimeoutFn(a),n.apply(this,s)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((r,i)=>{const a=(o,s)=>o?i(o):r(s);a.withError=!0,n.push(a),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...a)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...a)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:et.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case et.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case et.EVENT:case et.BINARY_EVENT:this.onevent(t);break;case et.ACK:case et.BINARY_ACK:this.onack(t);break;case et.DISCONNECT:this.ondisconnect();break;case et.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:et.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:et.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Wl(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Wl.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Wl.prototype.reset=function(){this.attempts=0};Wl.prototype.setMin=function(e){this.ms=e};Wl.prototype.setMax=function(e){this.max=e};Wl.prototype.setJitter=function(e){this.jitter=e};class rv extends Jt{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Yh(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Wl({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||e7;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new eQ(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=li(n,"open",function(){r.onopen(),t&&t()}),a=s=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",s),t?t(s):this.maybeReconnectOnOpen()},o=li(n,"error",a);if(this._timeout!==!1){const s=this._timeout,l=this.setTimeoutFn(()=>{i(),a(new Error("timeout")),n.close()},s);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(li(t,"ping",this.onping.bind(this)),li(t,"data",this.ondata.bind(this)),li(t,"error",this.onerror.bind(this)),li(t,"close",this.onclose.bind(this)),li(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Gh(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new U6(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const hu={};function Xd(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=tQ(e,t.path||"/socket.io"),r=n.source,i=n.id,a=n.path,o=hu[i]&&a in hu[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return s?l=new rv(r,t):(hu[i]||(hu[i]=new rv(r,t)),l=hu[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Xd,{Manager:rv,Socket:U6,io:Xd,connect:Xd});const f4=e=>{let t;const n=new Set,r=(c,d)=>{const f=typeof c=="function"?c(t):c;if(!Object.is(f,t)){const h=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(m=>m(t,h))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{n.clear()}},u=t=e(r,i,l);return l},z6=e=>e?f4(e):f4;function br(){return br=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},br.apply(this,arguments)}class rQ extends Error{constructor(t){super(t),this.name=void 0,this.name="SuprSendError"}}function Wo(){return Math.round(Date.now())}function Ao(){var e=new Date().getTime(),t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var r=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(n=="x"?r:r&3|8).toString(16)});return t}const zn=z6()(()=>({apiUrl:"https://inboxs.live",collectorApiUrl:"https://hub.suprsend.com",socketUrl:"https://betainbox.suprsend.com",pageSize:20})),iQ={unseenCount:0,stores:{},activeStoreId:null,pageNumber:1,hasNext:!0,initialLoading:!1,fetchMoreLoading:!1,initialFetchTime:null},_t=z6()(()=>iQ);class aQ{constructor(t){this.socket=void 0,this.config=void 0,this.config=t;const n=zn.getState();this.socket=Xd(n.socketUrl,{transports:["websocket"],auth:{subscriber_id:this.config.subscriberId,distinct_id:this.config.distinctId,authorization:`${this.config.workspaceKey}:${Ao()}`,tenant_id:this.config.tenantId},reconnectionAttempts:25,reconnectionDelay:5e3,reconnectionDelayMax:1e4}),this._initializeSocketEvents()}orderNotifications(t,n){if(t.is_pinned)return[t,...n];{let r=!1,i=[];return n.forEach(a=>{a.is_pinned||r?i.push(a):(i.push(t),i.push(a),r=!0)}),r?i:[...n,t]}}_initializeSocketEvents(){var t=this;this.socket.on("new_notification",async function(n){n.n_id&&setTimeout(async function(){try{const i=await(await t.getNotificationDetails(n.n_id)).json(),a=_t.getState();if(t.config.stores){let o=!1;for(let s of t.config.stores){const l=a.stores[s.storeId];t._notificationBelongToStore(i.data,s)&&(o=!0,l.notifications=t.orderNotifications(i.data,l.notifications),l.unseenCount+=1)}o&&(a.unseenCount+=1,t.config.emitter.emit("new_notification",i.data)),_t.setState({unseenCount:a.unseenCount,stores:br({},a.stores)})}else{if(!a.activeStoreId)return;let o=a.stores[a.activeStoreId];a.unseenCount+=1,o.unseenCount+=1,o.notifications=t.orderNotifications(i.data,o.notifications),_t.setState({unseenCount:a.unseenCount,stores:br({},a.stores)}),t.config.emitter.emit("new_notification",i.data)}t.config.emitter.emit("sync_notif_store")}catch(r){console.log("SuprSend: error in new_notification event",r)}},1e3)}),this.socket.on("notification_updated",async function(n){n.n_id&&setTimeout(async function(){try{const a=await Promise.allSettled([t.getNotificationDetails(n.n_id),t.getNotificationsCount()]),o=_t.getState();let s=o.activeStoreId;if(a[0].status==="fulfilled"){var r;const u=await a[0].value.json(),c=u.data;if(!s)return;let d=o.stores[s];const f=(r=t.config.stores)==null?void 0:r.find(h=>h.storeId===s);if((n==null?void 0:n.type)==="archive"){var i;f!=null&&(i=f.query)!=null&&i.archived?t._notificationBelongToStore(c,f)&&(o.stores[s].notifications=[c,...d.notifications]):o.stores[s].notifications=d.notifications.filter(h=>h.n_id!==n.n_id)}else o.stores[s].notifications=d.notifications.map(h=>h.n_id===n.n_id?u.data:h);_t.setState({stores:br({},o.stores)})}if(a[1].status==="fulfilled"){const u=await a[1].value.json();_t.setState(c=>{for(let d in c.stores){const f=c.stores[d];f.unseenCount=u[d]||0}return{unseenCount:u.ss_bell_count,stores:br({},c.stores)}})}t.config.emitter.emit("sync_notif_store")}catch(a){console.log("SuprSend: error in notification_updated event",a)}},1e3)}),this.socket.on("update_badge",async function(){_t.setState({unseenCount:0}),t.config.emitter.emit("sync_notif_store")}),this.socket.on("mark_all_read",async function(){const n=_t.getState(),r=Wo();for(let i in n.stores){const a=n.stores[i];a.notifications.forEach(o=>{o.seen_on||(o.seen_on=r)}),a.unseenCount=0}_t.setState({stores:n.stores}),t.config.emitter.emit("sync_notif_store")})}_notificationBelongToStore(t,n){var r,i,a,o;const s=!!t.seen_on,l=t.archived,u=t.tags,c=t.n_category,d=n==null||(r=n.query)==null?void 0:r.read,f=n==null||(i=n.query)==null?void 0:i.archived,h=n==null||(a=n.query)==null?void 0:a.tags,m=n==null||(o=n.query)==null?void 0:o.categories,p=!d||s===d,y=!f||l===f;let v,b;return Array.isArray(h)&&h.length>0?h.forEach(_=>{u!=null&&u.includes(_)&&(v=!0)}):v=!0,Array.isArray(m)&&m.length>0?m.includes(c)&&(b=!0):b=!0,p&&v&&b&&y}_getStoreQueryString(t){const n=t==null?void 0:t.query;let r=(n==null?void 0:n.tags)||[],i=(n==null?void 0:n.categories)||[];const a=n==null?void 0:n.read,o=n==null?void 0:n.archived;return{store_id:t.storeId,query:{read:a,archived:o,tags:{or:r},categories:{or:i}}}}_getStoresQueryString(){const t=this.config.stores;return t==null?void 0:t.map(r=>this._getStoreQueryString(r))}getNotificationsCount(){const{apiUrl:t}=zn.getState();let n=`/notification_count/?subscriber_id=${this.config.subscriberId}&distinct_id=${this.config.distinctId}&tenant_id=${this.config.tenantId}`;if(this.config.stores){const r=this._getStoresQueryString();n+=`&stores=${encodeURIComponent(JSON.stringify(r))}`}return fetch(`${t}${n}`,{method:"GET",headers:{Authorization:`${this.config.workspaceKey}:${Ao()}`}})}getNotifications(t,n,r=20,i){const{apiUrl:a}=zn.getState();let o=`/notifications/?subscriber_id=${this.config.subscriberId}&distinct_id=${this.config.distinctId}&tenant_id=${this.config.tenantId}&page_no=${n}&page_size=${r}&before=${i}`;if(t){const s=this._getStoreQueryString(t);o+=`&store=${encodeURIComponent(JSON.stringify(s))}`}return fetch(`${a}${o}`,{method:"GET",headers:{Authorization:`${this.config.workspaceKey}:${Ao()}`}})}getNotificationDetails(t){const{apiUrl:n}=zn.getState(),r=`/notification/${t}/?subscriber_id=${this.config.subscriberId}&distinct_id=${this.config.distinctId}&tenant_id=${this.config.tenantId}`;return fetch(`${n}${r}`,{method:"GET",headers:{Authorization:`${this.config.workspaceKey}:${Ao()}`}})}markBellClicked(){const{apiUrl:t}=zn.getState(),n="/bell-clicked/",r=JSON.stringify({time:Wo(),distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId,tenant_id:this.config.tenantId});return fetch(`${t}${n}`,{method:"POST",body:r,headers:{Authorization:`${this.config.workspaceKey}:${Ao()}`,"Content-Type":"application/json"}})}markAllRead(){const{apiUrl:t}=zn.getState(),n="/mark-all-read/",r=JSON.stringify({time:Wo(),distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId,tenant_id:this.config.tenantId});return fetch(`${t}${n}`,{method:"POST",body:r,headers:{Authorization:`${this.config.workspaceKey}:${Ao()}`,"Content-Type":"application/json"}})}markNotificationClicked(t){const{collectorApiUrl:n}=zn.getState(),r={event:"$notification_clicked",env:this.config.workspaceKey,$insert_id:Ao(),$time:Wo(),properties:{id:t}};return fetch(`${n}/event/`,{method:"POST",body:JSON.stringify(r),headers:{Authorization:`${this.config.workspaceKey}:`,"Content-Type":"application/json"}})}markNotificationRead(t){const{apiUrl:n}=zn.getState();return fetch(`${n}/notification/${t}/action`,{method:"POST",body:JSON.stringify({action:"read",distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId}),headers:{Authorization:`${this.config.workspaceKey}:`,"Content-Type":"application/json"}})}markNotificationUnRead(t){const{apiUrl:n}=zn.getState();return fetch(`${n}/notification/${t}/action`,{method:"POST",body:JSON.stringify({action:"unread",distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId}),headers:{Authorization:`${this.config.workspaceKey}:`,"Content-Type":"application/json"}})}markNotificationArchive(t){const{apiUrl:n}=zn.getState();return fetch(`${n}/notification/${t}/action`,{method:"POST",body:JSON.stringify({action:"archive",distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId}),headers:{Authorization:`${this.config.workspaceKey}:`,"Content-Type":"application/json"}})}}let h4=class{constructor(t){this.config=void 0,this.config=t}_overallFirstApiCall(){const t=_t.getState();for(let n in t.stores)if(t.stores[n].isFirstCall===!1)return!1;return!0}async fetchNotifications(){var t,n;const r=this.config.client,i=_t.getState(),a=zn.getState(),o=i.activeStoreId;if(!o||!((t=i.stores)!=null&&t[o]))return;const s=i.stores[o],l=s.isFirstCall,u=i.initialFetchTime||Date.now(),c=(n=this.config.stores)==null?void 0:n.find(d=>d.storeId===o);try{if(!r||!i.hasNext)return;l?(_t.setState({initialLoading:!0}),this._overallFirstApiCall()&&this.getNotificationsCount()):i.pageNumber>1&&_t.setState({fetchMoreLoading:!0}),this.config.emitter.emit("sync_notif_store");const f=await(await r.getNotifications(c,i.pageNumber,a.pageSize,u)).json();let h;l||!l&&i.pageNumber===1?h=f.results:h=[...s.notifications,...f.results],i.stores[o].notifications=h,i.stores[o].isFirstCall=!1,_t.setState({stores:i.stores,pageNumber:i.pageNumber+1,hasNext:f.meta.current_page<f.meta.total_pages,initialFetchTime:u,initialLoading:!1,fetchMoreLoading:!1}),this.config.emitter.emit("sync_notif_store"),this.config._startExipryCheck()}catch(d){console.log("SUPRSEND: error getting latest notifications",d),_t.setState({initialLoading:!1,fetchMoreLoading:!1}),this.config.emitter.emit("sync_notif_store")}}async getNotificationsCount(){const t=this.config.client;if(t)try{const r=await(await t.getNotificationsCount()).json();_t.setState(i=>{for(let a in i.stores){const o=i.stores[a];o.unseenCount=r[a]||0}return{unseenCount:r.ss_bell_count,stores:br({},i.stores)}}),this.config.emitter.emit("sync_notif_store")}catch(n){console.log("SUPRSEND: error getting notifications count",n)}}async markClicked(t){var n;const r=this.config.client,i=_t.getState(),a=i.activeStoreId;if(!a||!((n=i.stores)!=null&&n[a]))return;const l=i.stores[a].notifications.find(c=>c.n_id===t);if(l&&(!l.interacted_on||!l.seen_on)){if(!r)return;try{l.interacted_on?l.seen_on||r.markNotificationRead(t):r.markNotificationClicked(t);const c=Wo();if(l.interacted_on=c,!l.seen_on)for(let d in i==null?void 0:i.stores){var u;const f=i.stores[d];(u=f.notifications)==null||u.forEach(h=>{h.n_id===l.n_id&&(h.seen_on=c,h.interacted_on=c,f.unseenCount>0&&(f.unseenCount-=1))})}_t.setState(br({},i)),this.config.emitter.emit("sync_notif_store")}catch(c){console.log("SUPRSEND: error marking notification clicked",c)}}}async markAllSeen(){const t=this.config.client;try{if(!t)return;t.markBellClicked(),_t.setState({unseenCount:0}),this.config.emitter.emit("sync_notif_store")}catch(n){console.log("SUPRSEND: error marking all notifications seen",n)}}async markAllRead(){const t=this.config.client;try{if(!t)return;t.markAllRead();const n=_t.getState(),r=Wo();for(let i in n.stores){const a=n.stores[i];a.notifications.forEach(o=>{o.seen_on||(o.seen_on=r)}),a.unseenCount=0}_t.setState({stores:n.stores}),this.config.emitter.emit("sync_notif_store")}catch(n){console.log("SUPRSEND: error marking all notifications read",n)}}async markRead(t){var n;const r=this.config.client,i=_t.getState(),a=i.activeStoreId;if(!a||!((n=i.stores)!=null&&n[a]))return;const l=i.stores[a].notifications.find(c=>c.n_id===t);if(l&&!l.seen_on){if(!r)return;try{r.markNotificationRead(t);const c=Wo();if(!l.seen_on)for(let d in i==null?void 0:i.stores){var u;const f=i.stores[d];(u=f.notifications)==null||u.forEach(h=>{h.n_id===l.n_id&&(h.seen_on=c,f.unseenCount>0&&(f.unseenCount-=1))})}_t.setState(br({},i)),this.config.emitter.emit("sync_notif_store")}catch(c){console.log("SUPRSEND: error marking notification read",c)}}}async markUnRead(t){var n;const r=this.config.client,i=_t.getState(),a=i.activeStoreId;if(!a||!((n=i.stores)!=null&&n[a]))return;const l=i.stores[a].notifications.find(c=>c.n_id===t);if(l&&l.seen_on){if(!r)return;try{if(r.markNotificationUnRead(t),l.seen_on)for(let c in i==null?void 0:i.stores){var u;const d=i.stores[c];(u=d.notifications)==null||u.forEach(f=>{f.n_id===l.n_id&&(f.seen_on=void 0,d.unseenCount>=0&&(d.unseenCount+=1))})}_t.setState(br({},i)),this.config.emitter.emit("sync_notif_store")}catch(c){console.log("SUPRSEND: error marking notification read",c)}}}markArchived(t){var n;const r=this.config.client,i=_t.getState(),a=i.activeStoreId;if(!a||!((n=i.stores)!=null&&n[a]))return;const s=(i==null?void 0:i.stores)[a],l=s.notifications.find(u=>u.n_id===t);if(l&&!l.archived){if(!r)return;try{r.markNotificationArchive(t),s.notifications=s.notifications.filter(u=>u.n_id!==t),!l.seen_on&&s.unseenCount>0&&(s.unseenCount-=1),_t.setState(br({},i)),this.config.emitter.emit("sync_notif_store")}catch(u){console.log("SUPRSEND: error marking notification archived",u)}}}get stores(){return this.config.stores}get data(){const t=_t.getState(),n=t.activeStoreId,r=this.stores;if(n)return{unseenCount:t.unseenCount,activeStoreId:t.activeStoreId,stores:t.stores,hasStores:r?(r==null?void 0:r.length)>0:!1,hasNext:t.hasNext,initialLoading:t.initialLoading,fetchMoreLoading:t.fetchMoreLoading}}};class oQ{constructor(t,n){this.workspaceKey="",this.tenantId=void 0,this.stores=void 0,this.distinctId=void 0,this.subscriberId=void 0,this._client=void 0,this._expiryTimerId=void 0,this.feed=new h4(this),this.emitter=Bw(),this._validateConfig(t),this._setConfigStoreState((n==null?void 0:n.host)||{}),this.tenantId=(n==null?void 0:n.tenantID)||"default",this._validateStore(n==null?void 0:n.stores),this._validatePageSize(n==null?void 0:n.pageSize),this._initializeStoreState()}_validateConfig(t){if(t)this.workspaceKey=t;else throw new rQ("workspaceKey missing")}_validateStore(t){if(!t||!Array.isArray(t))return;const n=[];t.forEach(r=>{if(!r.storeId){console.log("SuprSendInbox: storeId is mandatory if stores are used");return}const i=r==null?void 0:r.query;let a,o=[],s=[],l;typeof(i==null?void 0:i.read)=="boolean"&&(a=i.read),typeof(i==null?void 0:i.archived)=="boolean"&&(l=i.archived),typeof(i==null?void 0:i.tags)=="string"?o=[i.tags]:Array.isArray(i==null?void 0:i.tags)&&(o=i==null?void 0:i.tags.filter(u=>typeof u=="string")),typeof(i==null?void 0:i.categories)=="string"?s=[i.categories]:Array.isArray(i==null?void 0:i.categories)&&(s=i==null?void 0:i.categories.filter(u=>typeof u=="string")),n.push({storeId:r.storeId,label:r.label||r.storeId,query:{archived:l,read:a,tags:o,categories:s}})}),this.stores=n}_validatePageSize(t){if(t&&typeof t=="number"){const r=t<=50?t:50;zn.setState({pageSize:r})}}_setConfigStoreState(t){t&&(t!=null&&t.socketHost&&zn.setState({socketUrl:t.socketHost}),t!=null&&t.apiHost&&zn.setState({apiUrl:t.apiHost}),t!=null&&t.collectorHost&&zn.setState({collectorApiUrl:t.collectorHost}))}_initializeStoreState(){const t="default_store",n={notifications:[],unseenCount:0,isFirstCall:!0};if(this.stores&&Array.isArray(this.stores)&&this.stores.length>0){const r={};this.stores.map(i=>{r[i.storeId]=br({},n)}),_t.setState({stores:r,activeStoreId:this.stores[0].storeId})}else _t.setState({stores:{[t]:br({},n)},activeStoreId:t});setTimeout(()=>{this.emitter.emit("sync_notif_store")},0)}_startExipryCheck(){var t=this;this._expiryTimerId||(this._expiryTimerId=setInterval(async function(){const r=_t.getState().stores;let i=!1;for(let a in r){let o=r[a].notifications;o=o.filter(s=>(s.expiry?Date.now()>s.expiry:!1)?(i=!0,!1):!0),r[a].notifications=o}i&&(_t.setState({stores:r}),await t.feed.getNotificationsCount(),t.emitter.emit("sync_notif_store"))},3e4))}get client(){return this.distinctId&&this.subscriberId&&(this._client||(this._client=new aQ(this))),this._client}identifyUser(t,n){this.distinctId=t,this.subscriberId=n}changeActiveStore(t){var n;const r=_t.getState(),i={};if(r.activeStoreId!==t&&(n=r.stores)!=null&&n[t]){for(let a in r.stores){const o=r.stores[a],s=o.notifications.slice(0,20);i[a]={notifications:s,unseenCount:o.unseenCount,isFirstCall:o.isFirstCall}}_t.setState({activeStoreId:t,stores:i,pageNumber:1,hasNext:!0,initialLoading:!1,fetchMoreLoading:!1,initialFetchTime:null}),this.client&&this.feed.fetchNotifications()}}resetUser(){var t;_t.setState({unseenCount:0,pageNumber:1,hasNext:!0,initialLoading:!1,fetchMoreLoading:!1,initialFetchTime:null}),this._initializeStoreState(),(t=this._client)==null||t.socket.disconnect(),this.distinctId=void 0,this.subscriberId=void 0,this._client=void 0,clearInterval(this._expiryTimerId),this._expiryTimerId=void 0,this.feed=new h4(this)}}var p4=function(t){return t.reduce(function(n,r){var i=r[0],a=r[1];return n[i]=a,n},{})},m4=typeof window<"u"&&window.document&&window.document.createElement?Nn.useLayoutEffect:Nn.useEffect,rr="top",Wr="bottom",Kr="right",ir="left",a9="auto",Zc=[rr,Wr,Kr,ir],Dl="start",Mc="end",sQ="clippingParents",V6="viewport",pu="popper",lQ="reference",g4=Zc.reduce(function(e,t){return e.concat([t+"-"+Dl,t+"-"+Mc])},[]),q6=[].concat(Zc,[a9]).reduce(function(e,t){return e.concat([t,t+"-"+Dl,t+"-"+Mc])},[]),uQ="beforeRead",cQ="read",dQ="afterRead",fQ="beforeMain",hQ="main",pQ="afterMain",mQ="beforeWrite",gQ="write",vQ="afterWrite",yQ=[uQ,cQ,dQ,fQ,hQ,pQ,mQ,gQ,vQ];function Gi(e){return e?(e.nodeName||"").toLowerCase():null}function wr(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function as(e){var t=wr(e).Element;return e instanceof t||e instanceof Element}function zr(e){var t=wr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function o9(e){if(typeof ShadowRoot>"u")return!1;var t=wr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function bQ(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},a=t.elements[n];!zr(a)||!Gi(a)||(Object.assign(a.style,r),Object.keys(i).forEach(function(o){var s=i[o];s===!1?a.removeAttribute(o):a.setAttribute(o,s===!0?"":s)}))})}function EQ(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],a=t.attributes[r]||{},o=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=o.reduce(function(l,u){return l[u]="",l},{});!zr(i)||!Gi(i)||(Object.assign(i.style,s),Object.keys(a).forEach(function(l){i.removeAttribute(l)}))})}}const _Q={name:"applyStyles",enabled:!0,phase:"write",fn:bQ,effect:EQ,requires:["computeStyles"]};function Li(e){return e.split("-")[0]}var Qo=Math.max,th=Math.min,Ol=Math.round;function iv(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function W6(){return!/^((?!chrome|android).)*safari/i.test(iv())}function Nl(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,a=1;t&&zr(e)&&(i=e.offsetWidth>0&&Ol(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&Ol(r.height)/e.offsetHeight||1);var o=as(e)?wr(e):window,s=o.visualViewport,l=!W6()&&n,u=(r.left+(l&&s?s.offsetLeft:0))/i,c=(r.top+(l&&s?s.offsetTop:0))/a,d=r.width/i,f=r.height/a;return{width:d,height:f,top:c,right:u+d,bottom:c+f,left:u,x:u,y:c}}function s9(e){var t=Nl(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function K6(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&o9(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function xa(e){return wr(e).getComputedStyle(e)}function TQ(e){return["table","td","th"].indexOf(Gi(e))>=0}function yo(e){return((as(e)?e.ownerDocument:e.document)||window.document).documentElement}function Zh(e){return Gi(e)==="html"?e:e.assignedSlot||e.parentNode||(o9(e)?e.host:null)||yo(e)}function v4(e){return!zr(e)||xa(e).position==="fixed"?null:e.offsetParent}function CQ(e){var t=/firefox/i.test(iv()),n=/Trident/i.test(iv());if(n&&zr(e)){var r=xa(e);if(r.position==="fixed")return null}var i=Zh(e);for(o9(i)&&(i=i.host);zr(i)&&["html","body"].indexOf(Gi(i))<0;){var a=xa(i);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||t&&a.willChange==="filter"||t&&a.filter&&a.filter!=="none")return i;i=i.parentNode}return null}function Qc(e){for(var t=wr(e),n=v4(e);n&&TQ(n)&&xa(n).position==="static";)n=v4(n);return n&&(Gi(n)==="html"||Gi(n)==="body"&&xa(n).position==="static")?t:n||CQ(e)||t}function l9(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ic(e,t,n){return Qo(e,th(t,n))}function xQ(e,t,n){var r=ic(e,t,n);return r>n?n:r}function G6(){return{top:0,right:0,bottom:0,left:0}}function Y6(e){return Object.assign({},G6(),e)}function Z6(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var wQ=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Y6(typeof t!="number"?t:Z6(t,Zc))};function AQ(e){var t,n=e.state,r=e.name,i=e.options,a=n.elements.arrow,o=n.modifiersData.popperOffsets,s=Li(n.placement),l=l9(s),u=[ir,Kr].indexOf(s)>=0,c=u?"height":"width";if(!(!a||!o)){var d=wQ(i.padding,n),f=s9(a),h=l==="y"?rr:ir,m=l==="y"?Wr:Kr,p=n.rects.reference[c]+n.rects.reference[l]-o[l]-n.rects.popper[c],y=o[l]-n.rects.reference[l],v=Qc(a),b=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,_=p/2-y/2,T=d[h],C=b-f[c]-d[m],x=b/2-f[c]/2+_,w=ic(T,x,C),P=l;n.modifiersData[r]=(t={},t[P]=w,t.centerOffset=w-x,t)}}function kQ(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||K6(t.elements.popper,i)&&(t.elements.arrow=i))}const SQ={name:"arrow",enabled:!0,phase:"main",fn:AQ,effect:kQ,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Il(e){return e.split("-")[1]}var DQ={top:"auto",right:"auto",bottom:"auto",left:"auto"};function OQ(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:Ol(n*i)/i||0,y:Ol(r*i)/i||0}}function y4(e){var t,n=e.popper,r=e.popperRect,i=e.placement,a=e.variation,o=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,d=e.isFixed,f=o.x,h=f===void 0?0:f,m=o.y,p=m===void 0?0:m,y=typeof c=="function"?c({x:h,y:p}):{x:h,y:p};h=y.x,p=y.y;var v=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),_=ir,T=rr,C=window;if(u){var x=Qc(n),w="clientHeight",P="clientWidth";if(x===wr(n)&&(x=yo(n),xa(x).position!=="static"&&s==="absolute"&&(w="scrollHeight",P="scrollWidth")),x=x,i===rr||(i===ir||i===Kr)&&a===Mc){T=Wr;var O=d&&x===C&&C.visualViewport?C.visualViewport.height:x[w];p-=O-r.height,p*=l?1:-1}if(i===ir||(i===rr||i===Wr)&&a===Mc){_=Kr;var M=d&&x===C&&C.visualViewport?C.visualViewport.width:x[P];h-=M-r.width,h*=l?1:-1}}var R=Object.assign({position:s},u&&DQ),D=c===!0?OQ({x:h,y:p},wr(n)):{x:h,y:p};if(h=D.x,p=D.y,l){var S;return Object.assign({},R,(S={},S[T]=b?"0":"",S[_]=v?"0":"",S.transform=(C.devicePixelRatio||1)<=1?"translate("+h+"px, "+p+"px)":"translate3d("+h+"px, "+p+"px, 0)",S))}return Object.assign({},R,(t={},t[T]=b?p+"px":"",t[_]=v?h+"px":"",t.transform="",t))}function NQ(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,a=n.adaptive,o=a===void 0?!0:a,s=n.roundOffsets,l=s===void 0?!0:s,u={placement:Li(t.placement),variation:Il(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,y4(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,y4(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const IQ={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:NQ,data:{}};var M1={passive:!0};function PQ(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,a=i===void 0?!0:i,o=r.resize,s=o===void 0?!0:o,l=wr(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&u.forEach(function(c){c.addEventListener("scroll",n.update,M1)}),s&&l.addEventListener("resize",n.update,M1),function(){a&&u.forEach(function(c){c.removeEventListener("scroll",n.update,M1)}),s&&l.removeEventListener("resize",n.update,M1)}}const RQ={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:PQ,data:{}};var FQ={left:"right",right:"left",bottom:"top",top:"bottom"};function Jd(e){return e.replace(/left|right|bottom|top/g,function(t){return FQ[t]})}var MQ={start:"end",end:"start"};function b4(e){return e.replace(/start|end/g,function(t){return MQ[t]})}function u9(e){var t=wr(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function c9(e){return Nl(yo(e)).left+u9(e).scrollLeft}function BQ(e,t){var n=wr(e),r=yo(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;var u=W6();(u||!u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:a,height:o,x:s+c9(e),y:l}}function LQ(e){var t,n=yo(e),r=u9(e),i=(t=e.ownerDocument)==null?void 0:t.body,a=Qo(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=Qo(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+c9(e),l=-r.scrollTop;return xa(i||n).direction==="rtl"&&(s+=Qo(n.clientWidth,i?i.clientWidth:0)-a),{width:a,height:o,x:s,y:l}}function d9(e){var t=xa(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Q6(e){return["html","body","#document"].indexOf(Gi(e))>=0?e.ownerDocument.body:zr(e)&&d9(e)?e:Q6(Zh(e))}function ac(e,t){var n;t===void 0&&(t=[]);var r=Q6(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),a=wr(r),o=i?[a].concat(a.visualViewport||[],d9(r)?r:[]):r,s=t.concat(o);return i?s:s.concat(ac(Zh(o)))}function av(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function $Q(e,t){var n=Nl(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function E4(e,t,n){return t===V6?av(BQ(e,n)):as(t)?$Q(t,n):av(LQ(yo(e)))}function jQ(e){var t=ac(Zh(e)),n=["absolute","fixed"].indexOf(xa(e).position)>=0,r=n&&zr(e)?Qc(e):e;return as(r)?t.filter(function(i){return as(i)&&K6(i,r)&&Gi(i)!=="body"}):[]}function HQ(e,t,n,r){var i=t==="clippingParents"?jQ(e):[].concat(t),a=[].concat(i,[n]),o=a[0],s=a.reduce(function(l,u){var c=E4(e,u,r);return l.top=Qo(c.top,l.top),l.right=th(c.right,l.right),l.bottom=th(c.bottom,l.bottom),l.left=Qo(c.left,l.left),l},E4(e,o,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function X6(e){var t=e.reference,n=e.element,r=e.placement,i=r?Li(r):null,a=r?Il(r):null,o=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(i){case rr:l={x:o,y:t.y-n.height};break;case Wr:l={x:o,y:t.y+t.height};break;case Kr:l={x:t.x+t.width,y:s};break;case ir:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var u=i?l9(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(a){case Dl:l[u]=l[u]-(t[c]/2-n[c]/2);break;case Mc:l[u]=l[u]+(t[c]/2-n[c]/2);break}}return l}function Bc(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,a=n.strategy,o=a===void 0?e.strategy:a,s=n.boundary,l=s===void 0?sQ:s,u=n.rootBoundary,c=u===void 0?V6:u,d=n.elementContext,f=d===void 0?pu:d,h=n.altBoundary,m=h===void 0?!1:h,p=n.padding,y=p===void 0?0:p,v=Y6(typeof y!="number"?y:Z6(y,Zc)),b=f===pu?lQ:pu,_=e.rects.popper,T=e.elements[m?b:f],C=HQ(as(T)?T:T.contextElement||yo(e.elements.popper),l,c,o),x=Nl(e.elements.reference),w=X6({reference:x,element:_,strategy:"absolute",placement:i}),P=av(Object.assign({},_,w)),O=f===pu?P:x,M={top:C.top-O.top+v.top,bottom:O.bottom-C.bottom+v.bottom,left:C.left-O.left+v.left,right:O.right-C.right+v.right},R=e.modifiersData.offset;if(f===pu&&R){var D=R[i];Object.keys(M).forEach(function(S){var B=[Kr,Wr].indexOf(S)>=0?1:-1,H=[rr,Wr].indexOf(S)>=0?"y":"x";M[S]+=D[H]*B})}return M}function UQ(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,a=n.rootBoundary,o=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?q6:l,c=Il(r),d=c?s?g4:g4.filter(function(m){return Il(m)===c}):Zc,f=d.filter(function(m){return u.indexOf(m)>=0});f.length===0&&(f=d);var h=f.reduce(function(m,p){return m[p]=Bc(e,{placement:p,boundary:i,rootBoundary:a,padding:o})[Li(p)],m},{});return Object.keys(h).sort(function(m,p){return h[m]-h[p]})}function zQ(e){if(Li(e)===a9)return[];var t=Jd(e);return[b4(e),t,b4(t)]}function VQ(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,a=i===void 0?!0:i,o=n.altAxis,s=o===void 0?!0:o,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,m=h===void 0?!0:h,p=n.allowedAutoPlacements,y=t.options.placement,v=Li(y),b=v===y,_=l||(b||!m?[Jd(y)]:zQ(y)),T=[y].concat(_).reduce(function(U,V){return U.concat(Li(V)===a9?UQ(t,{placement:V,boundary:c,rootBoundary:d,padding:u,flipVariations:m,allowedAutoPlacements:p}):V)},[]),C=t.rects.reference,x=t.rects.popper,w=new Map,P=!0,O=T[0],M=0;M<T.length;M++){var R=T[M],D=Li(R),S=Il(R)===Dl,B=[rr,Wr].indexOf(D)>=0,H=B?"width":"height",$=Bc(t,{placement:R,boundary:c,rootBoundary:d,altBoundary:f,padding:u}),F=B?S?Kr:ir:S?Wr:rr;C[H]>x[H]&&(F=Jd(F));var ne=Jd(F),J=[];if(a&&J.push($[D]<=0),s&&J.push($[F]<=0,$[ne]<=0),J.every(function(U){return U})){O=R,P=!1;break}w.set(R,J)}if(P)for(var I=m?3:1,A=function(V){var z=T.find(function(j){var ue=w.get(j);if(ue)return ue.slice(0,V).every(function(Q){return Q})});if(z)return O=z,"break"},Y=I;Y>0;Y--){var L=A(Y);if(L==="break")break}t.placement!==O&&(t.modifiersData[r]._skip=!0,t.placement=O,t.reset=!0)}}const qQ={name:"flip",enabled:!0,phase:"main",fn:VQ,requiresIfExists:["offset"],data:{_skip:!1}};function _4(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function T4(e){return[rr,Kr,Wr,ir].some(function(t){return e[t]>=0})}function WQ(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,o=Bc(t,{elementContext:"reference"}),s=Bc(t,{altBoundary:!0}),l=_4(o,r),u=_4(s,i,a),c=T4(l),d=T4(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}const KQ={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:WQ};function GQ(e,t,n){var r=Li(e),i=[ir,rr].indexOf(r)>=0?-1:1,a=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,o=a[0],s=a[1];return o=o||0,s=(s||0)*i,[ir,Kr].indexOf(r)>=0?{x:s,y:o}:{x:o,y:s}}function YQ(e){var t=e.state,n=e.options,r=e.name,i=n.offset,a=i===void 0?[0,0]:i,o=q6.reduce(function(c,d){return c[d]=GQ(d,t.rects,a),c},{}),s=o[t.placement],l=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=o}const ZQ={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:YQ};function QQ(e){var t=e.state,n=e.name;t.modifiersData[n]=X6({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const XQ={name:"popperOffsets",enabled:!0,phase:"read",fn:QQ,data:{}};function JQ(e){return e==="x"?"y":"x"}function eX(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,a=i===void 0?!0:i,o=n.altAxis,s=o===void 0?!1:o,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,f=n.tether,h=f===void 0?!0:f,m=n.tetherOffset,p=m===void 0?0:m,y=Bc(t,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),v=Li(t.placement),b=Il(t.placement),_=!b,T=l9(v),C=JQ(T),x=t.modifiersData.popperOffsets,w=t.rects.reference,P=t.rects.popper,O=typeof p=="function"?p(Object.assign({},t.rects,{placement:t.placement})):p,M=typeof O=="number"?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),R=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,D={x:0,y:0};if(x){if(a){var S,B=T==="y"?rr:ir,H=T==="y"?Wr:Kr,$=T==="y"?"height":"width",F=x[T],ne=F+y[B],J=F-y[H],I=h?-P[$]/2:0,A=b===Dl?w[$]:P[$],Y=b===Dl?-P[$]:-w[$],L=t.elements.arrow,U=h&&L?s9(L):{width:0,height:0},V=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:G6(),z=V[B],j=V[H],ue=ic(0,w[$],U[$]),Q=_?w[$]/2-I-ue-z-M.mainAxis:A-ue-z-M.mainAxis,ie=_?-w[$]/2+I+ue+j+M.mainAxis:Y+ue+j+M.mainAxis,le=t.elements.arrow&&Qc(t.elements.arrow),te=le?T==="y"?le.clientTop||0:le.clientLeft||0:0,Ae=(S=R==null?void 0:R[T])!=null?S:0,Oe=F+Q-Ae-te,Te=F+ie-Ae,se=ic(h?th(ne,Oe):ne,F,h?Qo(J,Te):J);x[T]=se,D[T]=se-F}if(s){var ve,ke=T==="x"?rr:ir,Fe=T==="x"?Wr:Kr,ht=x[C],gt=C==="y"?"height":"width",nt=ht+y[ke],ot=ht-y[Fe],je=[rr,ir].indexOf(v)!==-1,re=(ve=R==null?void 0:R[C])!=null?ve:0,ge=je?nt:ht-w[gt]-P[gt]-re+M.altAxis,Ne=je?ht+w[gt]+P[gt]-re-M.altAxis:ot,ye=h&&je?xQ(ge,ht,Ne):ic(h?ge:nt,ht,h?Ne:ot);x[C]=ye,D[C]=ye-ht}t.modifiersData[r]=D}}const tX={name:"preventOverflow",enabled:!0,phase:"main",fn:eX,requiresIfExists:["offset"]};function nX(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function rX(e){return e===wr(e)||!zr(e)?u9(e):nX(e)}function iX(e){var t=e.getBoundingClientRect(),n=Ol(t.width)/e.offsetWidth||1,r=Ol(t.height)/e.offsetHeight||1;return n!==1||r!==1}function aX(e,t,n){n===void 0&&(n=!1);var r=zr(t),i=zr(t)&&iX(t),a=yo(t),o=Nl(e,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Gi(t)!=="body"||d9(a))&&(s=rX(t)),zr(t)?(l=Nl(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):a&&(l.x=c9(a))),{x:o.left+s.scrollLeft-l.x,y:o.top+s.scrollTop-l.y,width:o.width,height:o.height}}function oX(e){var t=new Map,n=new Set,r=[];e.forEach(function(a){t.set(a.name,a)});function i(a){n.add(a.name);var o=[].concat(a.requires||[],a.requiresIfExists||[]);o.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&i(l)}}),r.push(a)}return e.forEach(function(a){n.has(a.name)||i(a)}),r}function sX(e){var t=oX(e);return yQ.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function lX(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function uX(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var C4={placement:"bottom",modifiers:[],strategy:"absolute"};function x4(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function cX(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,a=i===void 0?C4:i;return function(s,l,u){u===void 0&&(u=a);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},C4,a),modifiersData:{},elements:{reference:s,popper:l},attributes:{},styles:{}},d=[],f=!1,h={state:c,setOptions:function(v){var b=typeof v=="function"?v(c.options):v;p(),c.options=Object.assign({},a,c.options,b),c.scrollParents={reference:as(s)?ac(s):s.contextElement?ac(s.contextElement):[],popper:ac(l)};var _=sX(uX([].concat(r,c.options.modifiers)));return c.orderedModifiers=_.filter(function(T){return T.enabled}),m(),h.update()},forceUpdate:function(){if(!f){var v=c.elements,b=v.reference,_=v.popper;if(x4(b,_)){c.rects={reference:aX(b,Qc(_),c.options.strategy==="fixed"),popper:s9(_)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(M){return c.modifiersData[M.name]=Object.assign({},M.data)});for(var T=0;T<c.orderedModifiers.length;T++){if(c.reset===!0){c.reset=!1,T=-1;continue}var C=c.orderedModifiers[T],x=C.fn,w=C.options,P=w===void 0?{}:w,O=C.name;typeof x=="function"&&(c=x({state:c,options:P,name:O,instance:h})||c)}}}},update:lX(function(){return new Promise(function(y){h.forceUpdate(),y(c)})}),destroy:function(){p(),f=!0}};if(!x4(s,l))return h;h.setOptions(u).then(function(y){!f&&u.onFirstUpdate&&u.onFirstUpdate(y)});function m(){c.orderedModifiers.forEach(function(y){var v=y.name,b=y.options,_=b===void 0?{}:b,T=y.effect;if(typeof T=="function"){var C=T({state:c,name:v,instance:h,options:_}),x=function(){};d.push(C||x)}})}function p(){d.forEach(function(y){return y()}),d=[]}return h}}var dX=[RQ,XQ,IQ,_Q,ZQ,qQ,tX,SQ,KQ],fX=cX({defaultModifiers:dX}),hX=typeof Element<"u",pX=typeof Map=="function",mX=typeof Set=="function",gX=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function ef(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!ef(e[r],t[r]))return!1;return!0}var a;if(pX&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a=e.entries();!(r=a.next()).done;)if(!t.has(r.value[0]))return!1;for(a=e.entries();!(r=a.next()).done;)if(!ef(r.value[1],t.get(r.value[0])))return!1;return!0}if(mX&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a=e.entries();!(r=a.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(gX&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(hX&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!ef(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var vX=function(t,n){try{return ef(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const yX=gi(vX);var bX=[],EX=function(t,n,r){r===void 0&&(r={});var i=Nn.useRef(null),a={onFirstUpdate:r.onFirstUpdate,placement:r.placement||"bottom",strategy:r.strategy||"absolute",modifiers:r.modifiers||bX},o=Nn.useState({styles:{popper:{position:a.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),s=o[0],l=o[1],u=Nn.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(h){var m=h.state,p=Object.keys(m.elements);ND.flushSync(function(){l({styles:p4(p.map(function(y){return[y,m.styles[y]||{}]})),attributes:p4(p.map(function(y){return[y,m.attributes[y]]}))})})},requires:["computeStyles"]}},[]),c=Nn.useMemo(function(){var f={onFirstUpdate:a.onFirstUpdate,placement:a.placement,strategy:a.strategy,modifiers:[].concat(a.modifiers,[u,{name:"applyStyles",enabled:!1}])};return yX(i.current,f)?i.current||f:(i.current=f,f)},[a.onFirstUpdate,a.placement,a.strategy,a.modifiers,u]),d=Nn.useRef();return m4(function(){d.current&&d.current.setOptions(c)},[c]),m4(function(){if(!(t==null||n==null)){var f=r.createPopper||fX,h=f(t,n,c);return d.current=h,function(){h.destroy(),d.current=null}}},[t,n,r.createPopper]),{state:d.current?d.current.state:null,styles:s.styles,attributes:s.attributes,update:d.current?d.current.update:null,forceUpdate:d.current?d.current.forceUpdate:null}};function ov(){return ov=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ov.apply(this,arguments)}function J6(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var _X=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,TX=J6(function(e){return _X.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),CX=!1;function xX(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function wX(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var AX=function(){function e(n){var r=this;this._insertTag=function(i){var a;r.tags.length===0?r.insertionPoint?a=r.insertionPoint.nextSibling:r.prepend?a=r.container.firstChild:a=r.before:a=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,a),r.tags.push(i)},this.isSpeedy=n.speedy===void 0?!CX:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(wX(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var a=xX(i);try{a.insertRule(r,a.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var i;return(i=r.parentNode)==null?void 0:i.removeChild(r)}),this.tags=[],this.ctr=0},e}(),Pn="-ms-",nh="-moz-",Ot="-webkit-",eA="comm",f9="rule",h9="decl",kX="@import",tA="@keyframes",SX="@layer",DX=Math.abs,Qh=String.fromCharCode,OX=Object.assign;function NX(e,t){return On(e,0)^45?(((t<<2^On(e,0))<<2^On(e,1))<<2^On(e,2))<<2^On(e,3):0}function nA(e){return e.trim()}function IX(e,t){return(e=t.exec(e))?e[0]:e}function Nt(e,t,n){return e.replace(t,n)}function sv(e,t){return e.indexOf(t)}function On(e,t){return e.charCodeAt(t)|0}function Lc(e,t,n){return e.slice(t,n)}function Di(e){return e.length}function p9(e){return e.length}function B1(e,t){return t.push(e),e}function PX(e,t){return e.map(t).join("")}var Xh=1,Pl=1,rA=0,ur=0,gn=0,Kl="";function Jh(e,t,n,r,i,a,o){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:Xh,column:Pl,length:o,return:""}}function mu(e,t){return OX(Jh("",null,null,"",null,null,0),e,{length:-e.length},t)}function RX(){return gn}function FX(){return gn=ur>0?On(Kl,--ur):0,Pl--,gn===10&&(Pl=1,Xh--),gn}function Tr(){return gn=ur<rA?On(Kl,ur++):0,Pl++,gn===10&&(Pl=1,Xh++),gn}function $i(){return On(Kl,ur)}function tf(){return ur}function Xc(e,t){return Lc(Kl,e,t)}function $c(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function iA(e){return Xh=Pl=1,rA=Di(Kl=e),ur=0,[]}function aA(e){return Kl="",e}function nf(e){return nA(Xc(ur-1,lv(e===91?e+2:e===40?e+1:e)))}function MX(e){for(;(gn=$i())&&gn<33;)Tr();return $c(e)>2||$c(gn)>3?"":" "}function BX(e,t){for(;--t&&Tr()&&!(gn<48||gn>102||gn>57&&gn<65||gn>70&&gn<97););return Xc(e,tf()+(t<6&&$i()==32&&Tr()==32))}function lv(e){for(;Tr();)switch(gn){case e:return ur;case 34:case 39:e!==34&&e!==39&&lv(gn);break;case 40:e===41&&lv(e);break;case 92:Tr();break}return ur}function LX(e,t){for(;Tr()&&e+gn!==47+10;)if(e+gn===42+42&&$i()===47)break;return"/*"+Xc(t,ur-1)+"*"+Qh(e===47?e:Tr())}function $X(e){for(;!$c($i());)Tr();return Xc(e,ur)}function jX(e){return aA(rf("",null,null,null,[""],e=iA(e),0,[0],e))}function rf(e,t,n,r,i,a,o,s,l){for(var u=0,c=0,d=o,f=0,h=0,m=0,p=1,y=1,v=1,b=0,_="",T=i,C=a,x=r,w=_;y;)switch(m=b,b=Tr()){case 40:if(m!=108&&On(w,d-1)==58){sv(w+=Nt(nf(b),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:w+=nf(b);break;case 9:case 10:case 13:case 32:w+=MX(m);break;case 92:w+=BX(tf()-1,7);continue;case 47:switch($i()){case 42:case 47:B1(HX(LX(Tr(),tf()),t,n),l);break;default:w+="/"}break;case 123*p:s[u++]=Di(w)*v;case 125*p:case 59:case 0:switch(b){case 0:case 125:y=0;case 59+c:v==-1&&(w=Nt(w,/\f/g,"")),h>0&&Di(w)-d&&B1(h>32?A4(w+";",r,n,d-1):A4(Nt(w," ","")+";",r,n,d-2),l);break;case 59:w+=";";default:if(B1(x=w4(w,t,n,u,c,i,s,_,T=[],C=[],d),a),b===123)if(c===0)rf(w,t,x,x,T,a,d,s,C);else switch(f===99&&On(w,3)===110?100:f){case 100:case 108:case 109:case 115:rf(e,x,x,r&&B1(w4(e,x,x,0,0,i,s,_,i,T=[],d),C),i,C,d,s,r?T:C);break;default:rf(w,x,x,x,[""],C,0,s,C)}}u=c=h=0,p=v=1,_=w="",d=o;break;case 58:d=1+Di(w),h=m;default:if(p<1){if(b==123)--p;else if(b==125&&p++==0&&FX()==125)continue}switch(w+=Qh(b),b*p){case 38:v=c>0?1:(w+="\f",-1);break;case 44:s[u++]=(Di(w)-1)*v,v=1;break;case 64:$i()===45&&(w+=nf(Tr())),f=$i(),c=d=Di(_=w+=$X(tf())),b++;break;case 45:m===45&&Di(w)==2&&(p=0)}}return a}function w4(e,t,n,r,i,a,o,s,l,u,c){for(var d=i-1,f=i===0?a:[""],h=p9(f),m=0,p=0,y=0;m<r;++m)for(var v=0,b=Lc(e,d+1,d=DX(p=o[m])),_=e;v<h;++v)(_=nA(p>0?f[v]+" "+b:Nt(b,/&\f/g,f[v])))&&(l[y++]=_);return Jh(e,t,n,i===0?f9:s,l,u,c)}function HX(e,t,n){return Jh(e,t,n,eA,Qh(RX()),Lc(e,2,-2),0)}function A4(e,t,n,r){return Jh(e,t,n,h9,Lc(e,0,r),Lc(e,r+1,-1),r)}function ul(e,t){for(var n="",r=p9(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function UX(e,t,n,r){switch(e.type){case SX:if(e.children.length)break;case kX:case h9:return e.return=e.return||e.value;case eA:return"";case tA:return e.return=e.value+"{"+ul(e.children,r)+"}";case f9:e.value=e.props.join(",")}return Di(n=ul(e.children,r))?e.return=e.value+"{"+n+"}":""}function zX(e){var t=p9(e);return function(n,r,i,a){for(var o="",s=0;s<t;s++)o+=e[s](n,r,i,a)||"";return o}}function VX(e){return function(t){t.root||(t=t.return)&&e(t)}}var qX=function(t,n,r){for(var i=0,a=0;i=a,a=$i(),i===38&&a===12&&(n[r]=1),!$c(a);)Tr();return Xc(t,ur)},WX=function(t,n){var r=-1,i=44;do switch($c(i)){case 0:i===38&&$i()===12&&(n[r]=1),t[r]+=qX(ur-1,n,r);break;case 2:t[r]+=nf(i);break;case 4:if(i===44){t[++r]=$i()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=Qh(i)}while(i=Tr());return t},KX=function(t,n){return aA(WX(iA(t),n))},k4=new WeakMap,GX=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,i=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!k4.get(r))&&!i){k4.set(t,!0);for(var a=[],o=KX(n,a),s=r.props,l=0,u=0;l<o.length;l++)for(var c=0;c<s.length;c++,u++)t.props[u]=a[l]?o[l].replace(/&\f/g,s[c]):s[c]+" "+o[l]}}},YX=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function oA(e,t){switch(NX(e,t)){case 5103:return Ot+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ot+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ot+e+nh+e+Pn+e+e;case 6828:case 4268:return Ot+e+Pn+e+e;case 6165:return Ot+e+Pn+"flex-"+e+e;case 5187:return Ot+e+Nt(e,/(\w+).+(:[^]+)/,Ot+"box-$1$2"+Pn+"flex-$1$2")+e;case 5443:return Ot+e+Pn+"flex-item-"+Nt(e,/flex-|-self/,"")+e;case 4675:return Ot+e+Pn+"flex-line-pack"+Nt(e,/align-content|flex-|-self/,"")+e;case 5548:return Ot+e+Pn+Nt(e,"shrink","negative")+e;case 5292:return Ot+e+Pn+Nt(e,"basis","preferred-size")+e;case 6060:return Ot+"box-"+Nt(e,"-grow","")+Ot+e+Pn+Nt(e,"grow","positive")+e;case 4554:return Ot+Nt(e,/([^-])(transform)/g,"$1"+Ot+"$2")+e;case 6187:return Nt(Nt(Nt(e,/(zoom-|grab)/,Ot+"$1"),/(image-set)/,Ot+"$1"),e,"")+e;case 5495:case 3959:return Nt(e,/(image-set\([^]*)/,Ot+"$1$`$1");case 4968:return Nt(Nt(e,/(.+:)(flex-)?(.*)/,Ot+"box-pack:$3"+Pn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ot+e+e;case 4095:case 3583:case 4068:case 2532:return Nt(e,/(.+)-inline(.+)/,Ot+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Di(e)-1-t>6)switch(On(e,t+1)){case 109:if(On(e,t+4)!==45)break;case 102:return Nt(e,/(.+:)(.+)-([^]+)/,"$1"+Ot+"$2-$3$1"+nh+(On(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~sv(e,"stretch")?oA(Nt(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(On(e,t+1)!==115)break;case 6444:switch(On(e,Di(e)-3-(~sv(e,"!important")&&10))){case 107:return Nt(e,":",":"+Ot)+e;case 101:return Nt(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ot+(On(e,14)===45?"inline-":"")+"box$3$1"+Ot+"$2$3$1"+Pn+"$2box$3")+e}break;case 5936:switch(On(e,t+11)){case 114:return Ot+e+Pn+Nt(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ot+e+Pn+Nt(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ot+e+Pn+Nt(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Ot+e+Pn+e+e}return e}var ZX=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case h9:t.return=oA(t.value,t.length);break;case tA:return ul([mu(t,{value:Nt(t.value,"@","@"+Ot)})],i);case f9:if(t.length)return PX(t.props,function(a){switch(IX(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return ul([mu(t,{props:[Nt(a,/:(read-\w+)/,":"+nh+"$1")]})],i);case"::placeholder":return ul([mu(t,{props:[Nt(a,/:(plac\w+)/,":"+Ot+"input-$1")]}),mu(t,{props:[Nt(a,/:(plac\w+)/,":"+nh+"$1")]}),mu(t,{props:[Nt(a,/:(plac\w+)/,Pn+"input-$1")]})],i)}return""})}},QX=[ZX],XX=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(p){var y=p.getAttribute("data-emotion");y.indexOf(" ")!==-1&&(document.head.appendChild(p),p.setAttribute("data-s",""))})}var i=t.stylisPlugins||QX,a={},o,s=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(p){for(var y=p.getAttribute("data-emotion").split(" "),v=1;v<y.length;v++)a[y[v]]=!0;s.push(p)});var l,u=[GX,YX];{var c,d=[UX,VX(function(p){c.insert(p)})],f=zX(u.concat(i,d)),h=function(y){return ul(jX(y),f)};l=function(y,v,b,_){c=b,h(y?y+"{"+v.styles+"}":v.styles),_&&(m.inserted[v.name]=!0)}}var m={key:n,sheet:new AX({key:n,container:o,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:a,registered:{},insert:l};return m.sheet.hydrate(s),m},sA=$v(),JX={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},eJ={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},lA={};lA[sA.ForwardRef]=JX;lA[sA.Memo]=eJ;var tJ=!0;function nJ(e,t,n){var r="";return n.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(r+=i+" ")}),r}var uA=function(t,n,r){var i=t.key+"-"+n.name;(r===!1||tJ===!1)&&t.registered[i]===void 0&&(t.registered[i]=n.styles)},rJ=function(t,n,r){uA(t,n,r);var i=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var a=n;do t.insert(n===a?"."+i:"",a,t.sheet,!0),a=a.next;while(a!==void 0)}};function iJ(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var aJ={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},oJ=!1,sJ=/[A-Z]|^ms/g,lJ=/_EMO_([^_]+?)_([^]*?)_EMO_/g,cA=function(t){return t.charCodeAt(1)===45},S4=function(t){return t!=null&&typeof t!="boolean"},Hm=J6(function(e){return cA(e)?e:e.replace(sJ,"-$&").toLowerCase()}),D4=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(lJ,function(r,i,a){return Oi={name:i,styles:a,next:Oi},i})}return aJ[t]!==1&&!cA(t)&&typeof n=="number"&&n!==0?n+"px":n},uJ="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function jc(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return Oi={name:i.name,styles:i.styles,next:Oi},i.name;var a=n;if(a.styles!==void 0){var o=a.next;if(o!==void 0)for(;o!==void 0;)Oi={name:o.name,styles:o.styles,next:Oi},o=o.next;var s=a.styles+";";return s}return cJ(e,t,n)}case"function":{if(e!==void 0){var l=Oi,u=n(e);return Oi=l,jc(e,t,u)}break}}var c=n;if(t==null)return c;var d=t[c];return d!==void 0?d:c}function cJ(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=jc(e,t,n[i])+";";else for(var a in n){var o=n[a];if(typeof o!="object"){var s=o;t!=null&&t[s]!==void 0?r+=a+"{"+t[s]+"}":S4(s)&&(r+=Hm(a)+":"+D4(a,s)+";")}else{if(a==="NO_COMPONENT_SELECTOR"&&oJ)throw new Error(uJ);if(Array.isArray(o)&&typeof o[0]=="string"&&(t==null||t[o[0]]===void 0))for(var l=0;l<o.length;l++)S4(o[l])&&(r+=Hm(a)+":"+D4(a,o[l])+";");else{var u=jc(e,t,o);switch(a){case"animation":case"animationName":{r+=Hm(a)+":"+u+";";break}default:r+=a+"{"+u+"}"}}}}return r}var O4=/label:\s*([^\s;{]+)\s*(;|$)/g,Oi;function dA(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,i="";Oi=void 0;var a=e[0];if(a==null||a.raw===void 0)r=!1,i+=jc(n,t,a);else{var o=a;i+=o[0]}for(var s=1;s<e.length;s++)if(i+=jc(n,t,e[s]),r){var l=a;i+=l[s]}O4.lastIndex=0;for(var u="",c;(c=O4.exec(i))!==null;)u+="-"+c[1];var d=iJ(i)+u;return{name:d,styles:i,next:Oi}}var dJ=function(t){return t()},fJ=Nn["useInsertionEffect"]?Nn["useInsertionEffect"]:!1,hJ=fJ||dJ,fA=Nn.createContext(typeof HTMLElement<"u"?XX({key:"css"}):null);fA.Provider;var pJ=function(t){return E.forwardRef(function(n,r){var i=E.useContext(fA);return t(n,i,r)})},mJ=Nn.createContext({});function gJ(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return dA(t)}var vJ=function(){var t=gJ.apply(void 0,arguments),n="animation-"+t.name;return{name:n,styles:"@keyframes "+n+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}},yJ=TX,bJ=function(t){return t!=="theme"},N4=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?yJ:bJ},I4=function(t,n,r){var i;if(n){var a=n.shouldForwardProp;i=t.__emotion_forwardProp&&a?function(o){return t.__emotion_forwardProp(o)&&a(o)}:a}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},EJ=!1,_J=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return uA(n,r,i),hJ(function(){return rJ(n,r,i)}),null},TJ=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,a,o;n!==void 0&&(a=n.label,o=n.target);var s=I4(t,n,r),l=s||N4(i),u=!l("as");return function(){var c=arguments,d=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(a!==void 0&&d.push("label:"+a+";"),c[0]==null||c[0].raw===void 0)d.push.apply(d,c);else{d.push(c[0][0]);for(var f=c.length,h=1;h<f;h++)d.push(c[h],c[0][h])}var m=pJ(function(p,y,v){var b=u&&p.as||i,_="",T=[],C=p;if(p.theme==null){C={};for(var x in p)C[x]=p[x];C.theme=Nn.useContext(mJ)}typeof p.className=="string"?_=nJ(y.registered,T,p.className):p.className!=null&&(_=p.className+" ");var w=dA(d.concat(T),y.registered,C);_+=y.key+"-"+w.name,o!==void 0&&(_+=" "+o);var P=u&&s===void 0?N4(b):l,O={};for(var M in p)u&&M==="as"||P(M)&&(O[M]=p[M]);return O.className=_,v&&(O.ref=v),Nn.createElement(Nn.Fragment,null,Nn.createElement(_J,{cache:y,serialized:w,isStringTag:typeof b=="string"}),Nn.createElement(b,O))});return m.displayName=a!==void 0?a:"Styled("+(typeof i=="string"?i:i.displayName||i.name||"Component")+")",m.defaultProps=t.defaultProps,m.__emotion_real=m,m.__emotion_base=i,m.__emotion_styles=d,m.__emotion_forwardProp=s,Object.defineProperty(m,"toString",{value:function(){return o===void 0&&EJ?"NO_COMPONENT_SELECTOR":"."+o}}),m.withComponent=function(p,y){return e(p,ov({},n,y,{shouldForwardProp:I4(m,y,!0)})).apply(void 0,d)},m}},CJ=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],Be=TJ.bind();CJ.forEach(function(e){Be[e]=Be(e)});var xs={}.hasOwnProperty,hA=xJ;function xJ(e){return!e||typeof e!="object"?"":xs.call(e,"position")||xs.call(e,"type")?P4(e.position):xs.call(e,"start")||xs.call(e,"end")?P4(e):xs.call(e,"line")||xs.call(e,"column")?uv(e):""}function uv(e){return(!e||typeof e!="object")&&(e={}),R4(e.line)+":"+R4(e.column)}function P4(e){return(!e||typeof e!="object")&&(e={}),uv(e.start)+"-"+uv(e.end)}function R4(e){return e&&typeof e=="number"?e:1}var wJ=hA,AJ=m9;function pA(){}pA.prototype=Error.prototype;m9.prototype=new pA;var bo=m9.prototype;bo.file="";bo.name="";bo.reason="";bo.message="";bo.stack="";bo.fatal=null;bo.column=null;bo.line=null;function m9(e,t,n){var r,i,a;typeof t=="string"&&(n=t,t=null),r=kJ(n),i=wJ(t)||"1:1",a={start:{line:null,column:null},end:{line:null,column:null}},t&&t.position&&(t=t.position),t&&(t.start?(a=t,t=t.start):a.start=t),e.stack&&(this.stack=e.stack,e=e.message),this.message=e,this.name=i,this.reason=e,this.line=t?t.line:null,this.column=t?t.column:null,this.location=a,this.source=r[0],this.ruleId=r[1]}function kJ(e){var t=[null,null],n;return typeof e=="string"&&(n=e.indexOf(":"),n===-1?t[1]=e:(t[0]=e.slice(0,n),t[1]=e.slice(n+1))),t}var Gl={};Gl.basename=SJ;Gl.dirname=DJ;Gl.extname=OJ;Gl.join=NJ;Gl.sep="/";function SJ(e,t){var n=0,r=-1,i,a,o,s;if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');if(Jc(e),i=e.length,t===void 0||!t.length||t.length>e.length){for(;i--;)if(e.charCodeAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";for(a=-1,s=t.length-1;i--;)if(e.charCodeAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(e.charCodeAt(i)===t.charCodeAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function DJ(e){var t,n,r;if(Jc(e),!e.length)return".";for(t=-1,r=e.length;--r;)if(e.charCodeAt(r)===47){if(n){t=r;break}}else n||(n=!0);return t<0?e.charCodeAt(0)===47?"/":".":t===1&&e.charCodeAt(0)===47?"//":e.slice(0,t)}function OJ(e){var t=-1,n=0,r=-1,i=0,a,o,s;for(Jc(e),s=e.length;s--;){if(o=e.charCodeAt(s),o===47){if(a){n=s+1;break}continue}r<0&&(a=!0,r=s+1),o===46?t<0?t=s:i!==1&&(i=1):t>-1&&(i=-1)}return t<0||r<0||i===0||i===1&&t===r-1&&t===n+1?"":e.slice(t,r)}function NJ(){for(var e=-1,t;++e<arguments.length;)Jc(arguments[e]),arguments[e]&&(t=t===void 0?arguments[e]:t+"/"+arguments[e]);return t===void 0?".":IJ(t)}function IJ(e){var t,n;return Jc(e),t=e.charCodeAt(0)===47,n=PJ(e,!t),!n.length&&!t&&(n="."),n.length&&e.charCodeAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function PJ(e,t){for(var n="",r=0,i=-1,a=0,o=-1,s,l;++o<=e.length;){if(o<e.length)s=e.charCodeAt(o);else{if(s===47)break;s=47}if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=o,a=0;continue}}else if(n.length){n="",r=0,i=o,a=0;continue}}t&&(n=n.length?n+"/..":"..",r=2)}else n.length?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Jc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var mA={};mA.cwd=RJ;function RJ(){return"/"}/*!
166
166
  * Determine if an object is a Buffer
167
167
  *
168
168
  * @author Feross Aboukhadijeh <https://feross.org>