strapi-plugin-navigation 3.0.11 → 3.0.12
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/dist/_chunks/{fr-DDKFueED.mjs → fr-B3UeLLGy.mjs} +42 -42
- package/dist/_chunks/fr-BjVniZne.js +1 -0
- package/dist/admin/index.js +2231 -44
- package/dist/admin/index.mjs +36912 -2763
- package/dist/admin/src/api/client.d.ts +9 -1
- package/dist/admin/src/api/validators.d.ts +72 -72
- package/dist/admin/src/components/RestartAlert/index.d.ts +1 -1
- package/dist/admin/src/pages/HomePage/components/NavigationHeader/styles.d.ts +1 -1
- package/dist/admin/src/pages/HomePage/components/NavigationItemForm/utils/form.d.ts +9 -9
- package/dist/admin/src/pages/HomePage/components/NavigationItemList/Wrapper.d.ts +2 -2
- package/dist/admin/src/pages/HomePage/components/NavigationItemListItem/ItemCardBadge/index.d.ts +1 -1
- package/dist/admin/src/pages/HomePage/components/NavigationItemListItem/ItemCardHeader/Wrapper.d.ts +1 -1
- package/dist/admin/src/pages/HomePage/components/NavigationItemListItem/ItemCardRemovedOverlay/index.d.ts +1 -1
- package/dist/admin/src/pages/HomePage/components/NavigationItemListItem/Wrapper.d.ts +2 -2
- package/dist/admin/src/pages/HomePage/hooks/index.d.ts +10 -2
- package/dist/admin/src/pages/SettingsPage/hooks/index.d.ts +12 -15
- package/dist/admin/src/schemas/config.d.ts +36 -36
- package/dist/server/index.js +44 -44
- package/dist/server/index.mjs +7107 -7438
- package/dist/server/src/schemas/config.d.ts +36 -36
- package/dist/server/src/schemas/content-type.d.ts +24 -24
- package/dist/server/src/schemas/navigation.d.ts +6 -6
- package/package.json +15 -18
- package/dist/_chunks/fr-DyX_S7LN.js +0 -1
package/dist/admin/index.js
CHANGED
|
@@ -1,10 +1,2197 @@
|
|
|
1
|
-
"use strict";const p=require("react"),
|
|
1
|
+
"use strict";const p=require("react"),u=require("react/jsx-runtime"),C=require("styled-components"),Se=require("@strapi/strapi/admin"),vd=require("react-dnd"),_w=require("react-dnd-html5-backend"),bc=require("react-router-dom"),ds=require("react-dom"),ue=require("lodash"),Fe=require("@tanstack/react-query"),Ve=require("react-intl"),je=require("@sensinum/strapi-utils"),z=require("zod"),Oa=require("lodash/fp"),zw=t=>t&&t.__esModule?t:{default:t};function Gu(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const w=Gu(p),En=zw(C),ei=Gu(ds),T=Gu(z),Qt="navigation",Hw=({setPlugin:t})=>{const e=p.useRef(t);return p.useEffect(()=>{e.current?.(Qt)},[]),null},Pw=92,Ww=En.default.svg`
|
|
2
2
|
path {
|
|
3
|
-
fill: ${({theme:
|
|
3
|
+
fill: ${({theme:t})=>t.colors.neutral500};
|
|
4
4
|
}
|
|
5
|
-
`,
|
|
5
|
+
`,qw=({width:t=20,height:e=20})=>u.jsx(Ww,{viewBox:`0 0 ${t} ${e}`,xmlns:"http://www.w3.org/2000/svg",height:e,width:t,children:u.jsx("g",{style:{transform:`scale(${t/Pw})`},children:u.jsx("path",{d:`M78,23.5H14c-3.6,0-6.5-2.9-6.5-6.5s2.9-6.5,6.5-6.5h64c3.6,0,6.5,2.9,6.5,6.5S81.6,23.5,78,23.5z M84.5,46
|
|
6
6
|
c0-3.6-2.9-6.5-6.5-6.5H14c-3.6,0-6.5,2.9-6.5,6.5s2.9,6.5,6.5,6.5h64C81.6,52.5,84.5,49.6,84.5,46z M84.5,75c0-3.6-2.9-6.5-6.5-6.5
|
|
7
|
-
H14c-3.6,0-6.5,2.9-6.5,6.5s2.9,6.5,6.5,6.5h64C81.6,81.5,84.5,78.6,84.5,75z`})})}),Mt=()=>t.jsx(zt,{}),nt={en:()=>Promise.resolve().then(()=>require("../_chunks/en-CKowl_sX.js")),fr:()=>Promise.resolve().then(()=>require("../_chunks/fr-DyX_S7LN.js")),ca:()=>Promise.resolve().then(()=>require("../_chunks/ca-BzGBgdJx.js"))},Qe=e=>`${xe}.${e}`,l=(e,n)=>({id:Qe(e),defaultMessage:n??Qe(e)}),qe=e=>`plugin::navigation.${e}`,Oe={read:"read",update:"update",settings:"settings"},Ae={access:[{action:qe(Oe.read),subject:null}],update:[{action:qe(Oe.update),subject:null}],settings:[{action:qe(Oe.settings),subject:null}]},Ke=c.z.object({name:c.z.string().refine(e=>!e.includes(" "),{message:"No space allowed"}),label:c.z.string(),required:c.z.boolean().optional(),enabled:c.z.boolean().optional()}),Bt=Ke.extend({type:c.z.literal("select"),multi:c.z.boolean(),options:c.z.array(c.z.string())}),Dt=Ke.extend({type:c.z.enum(["boolean","string"]),multi:c.z.literal(!1).optional(),options:c.z.array(c.z.string()).max(0).optional()}),qt=Ke.extend({type:c.z.literal("media"),multi:c.z.literal(!1).optional(),options:c.z.array(c.z.string()).max(0).optional()}),yt=c.z.union([Dt,qt,Bt]),Ot=c.z.union([c.z.literal("audience"),yt]),Gt=c.z.object({additionalFields:c.z.array(Ot),allowedLevels:c.z.number(),availableAudience:c.z.object({id:c.z.number(),documentId:c.z.string(),name:c.z.string(),key:c.z.string()}).array(),contentTypes:c.z.array(c.z.string()),contentTypesNameFields:c.z.record(c.z.string(),c.z.array(c.z.string())),contentTypesPopulate:c.z.record(c.z.string(),c.z.array(c.z.string())),gql:c.z.object({navigationItemRelated:c.z.array(c.z.string())}),pathDefaultFields:c.z.record(c.z.string(),c.z.any()),cascadeMenuAttached:c.z.boolean(),preferCustomContentTypes:c.z.boolean(),isCacheEnabled:c.z.boolean().optional(),isCachePluginEnabled:c.z.boolean().optional()}),Vt=c.z.object({uid:c.z.string(),isDisplayed:c.z.boolean(),apiID:c.z.string(),kind:c.z.enum(["collectionType","singleType"]),info:c.z.object({singularName:c.z.string(),pluralName:c.z.string(),displayName:c.z.string(),description:c.z.string().optional()}),attributes:c.z.record(c.z.string(),c.z.unknown())}),_t=o.object({id:o.number(),documentId:o.string(),name:o.string(),key:o.string()}),xt=o.enum(["INTERNAL","EXTERNAL","WRAPPER"]),Qt=o.object({id:o.number(),documentId:o.string(),title:o.string(),type:xt,path:o.string(),externalPath:o.string().or(o.null()).optional(),uiRouterKey:o.string(),menuAttached:o.boolean(),order:o.number().int(),collapsed:o.boolean(),autoSync:o.boolean().or(o.null()).optional(),related:o.object({documentId:o.string().optional(),__type:o.string()}).catchall(o.unknown()).nullish(),additionalFields:o.record(o.string(),o.unknown()).or(o.null()).optional(),audience:o.array(_t).or(o.null()).optional(),viewId:o.number().optional(),viewParentId:o.number().optional(),structureId:o.string().optional(),removed:o.boolean().optional(),isSearchActive:o.boolean().optional(),updated:o.boolean().optional()}),bt=Qt.extend({items:o.lazy(()=>bt.array().or(o.null())).optional()}),Kt=o.object({id:o.number(),documentId:o.string(),name:o.string(),slug:o.string(),locale:o.string(),visible:o.boolean(),items:o.array(bt)}),Ue=o.object({name:o.string().refine(e=>!e.includes(" "),{message:"No space allowed"}),label:o.string(),required:o.boolean().optional(),enabled:o.boolean().optional()}),Ut=Ue.extend({type:o.literal("select"),multi:o.boolean(),options:o.array(o.string())}),Wt=Ue.extend({type:o.enum(["boolean","string"]),multi:o.literal(!1).optional(),options:o.array(o.string()).max(0).optional()}),Ht=Ue.extend({type:o.literal("media"),multi:o.literal(!1).optional(),options:o.array(o.string()).max(0).optional()}),Xt=Wt.or(Ht).or(Ut),Zt=o.union([o.literal("audience"),Xt]),Jt=o.object({uid:o.string(),name:o.string(),draftAndPublish:o.boolean(),isSingle:o.boolean(),description:o.string(),collectionName:o.string(),contentTypeName:o.string(),label:o.string(),labelSingular:o.string(),endpoint:o.string(),available:o.boolean(),visible:o.boolean()}),Yt=o.object({additionalFields:o.array(Zt),allowedLevels:o.number(),availableAudience:o.object({id:o.number(),documentId:o.string(),name:o.string(),key:o.string()}).array(),contentTypes:o.array(o.string()),contentTypesNameFields:o.record(o.string(),o.array(o.string())),contentTypesPopulate:o.record(o.string(),o.array(o.string())),gql:o.object({navigationItemRelated:o.array(o.string())}),pathDefaultFields:o.record(o.string(),o.string().array()),cascadeMenuAttached:o.boolean(),preferCustomContentTypes:o.boolean(),allowedContentTypes:o.string().array(),restrictedContentTypes:o.string().array(),isCacheEnabled:o.boolean().optional(),isCachePluginEnabled:o.boolean().optional()}),at=Yt.omit({contentTypes:!0}).extend({contentTypes:Jt.array()}),en=o.object({defaultLocale:o.string(),restLocale:o.string().array()}),tn=o.enum(["collectionType","singleType"]),nn=o.object({singularName:o.string(),pluralName:o.string(),displayName:o.string(),description:o.string().optional(),name:o.string().optional()}),jt=o.object({required:o.boolean().optional(),max:o.number().optional(),min:o.number().optional(),minLength:o.number().optional(),maxLength:o.number().optional(),private:o.boolean().optional(),configurable:o.boolean().optional(),default:o.any().optional()}),an=o.enum(["string","text","richtext","blocks","email","password","date","time","datetime","timestamp","boolean","integer","biginteger","float","decimal","json","relation","media"]),on=jt.extend({type:an}),sn=jt.extend({type:o.literal("enumeration"),enum:o.string().array()}),rn=o.object({type:o.literal("component"),component:o.string(),repeatable:o.boolean().optional()}),ln=o.object({type:o.literal("dynamiczone"),components:o.string().array()}),dn=o.object({media:o.literal("media"),allowedTypes:o.enum(["images","videos","audios","files"]).array(),required:o.boolean().optional()}),cn=o.enum(["oneToOne","oneToMany","manyToOne","manyToMany","morphToMany","manyToMorph"]),un=o.object({type:o.literal("relation"),relation:cn,target:o.string(),mappedBy:o.string().optional(),inversedBy:o.string().optional()}),pn=o.record(o.string(),o.union([on,sn,rn,ln,un,dn])),mn=o.object({kind:tn,collectionName:o.string(),info:nn,options:o.object({draftAndPublish:o.boolean().optional(),hidden:o.boolean().optional(),templateName:o.string().optional()}).optional(),attributes:pn,actions:o.record(o.string(),o.any()).optional(),lifecycles:o.record(o.string(),o.any()).optional(),uid:o.string(),apiName:o.string().optional(),associations:o.object({model:o.string(),alias:o.string()}).array().optional(),modelName:o.string().optional(),plugin:o.string().optional(),pluginOptions:o.record(o.string(),o.any()).optional(),isSingle:o.boolean().optional()});mn.pick({info:!0,kind:!0,attributes:!0,options:!0});const gn=o.object({id:o.number(),documentId:o.string(),locale:o.string().or(o.null()).optional()}).and(o.record(o.string(),o.any())),hn=o.object({slug:o.string()}),fn=o.object({externalPath:o.string().or(o.null()).optional(),path:o.string().or(o.null()).optional(),related:o.object({documentId:o.string().optional(),__type:o.string()}).catchall(o.unknown()).nullish(),title:o.string(),type:xt,uiRouterKey:o.string()}),Y="navigation",ee=j.once(e=>({getIndexPrefix(){return[Y]},readAll(){return e.get(`/${Y}`).then(({data:n})=>Kt.array().parse(n))},readAllIndex(){return[Y,"navigations"]},delete(n){return e.del(`/${Y}/${n}`)},create(n){return e.post(`/${Y}/`,n)},update(n){return e.put(`/${Y}/${n.documentId}`,n)},purge({documentId:n,withLangVersions:i}){return e.del(`/${Y}/cache/purge/${n??""}?clearLocalisations=${!!i}`)},slugify(n){const i=new URLSearchParams;return i.append("q",n),e.get(`/${Y}/slug?${i.toString()}`).then(({data:s})=>hn.parse(s)).then(({slug:s})=>s)},readConfig(){return e.get(`/${Y}/config`).then(({data:n})=>at.parse(n))},readConfigIndex(){return[Y,"config"]},healthCheck(){return e.get("/_health")},healthCheckIndex(){return["health"]},readNavigationItemFromLocale({source:n,structureId:i,target:s,documentId:d}){return e.get(`/${Y}/i18n/item/read/${d}/${n}/${s}?path=${i}`)},updateConfig(n){return e.put(`/${Y}/config`,n).then(()=>{})},restart(){return e.get(`/${Y}/settings/restart`).then(()=>{})},restoreConfig(){return e.del(`/${Y}/config`).then(()=>{})},readSettingsConfig(){return e.get(`/${Y}/settings/config`).then(({data:n})=>{const i=at.parse(n);return{...i,contentTypes:i.contentTypes.map(({uid:s})=>s)}})},readSettingsConfigIndex(){return[Y,"config"]},readContentType(){return e.get("/content-manager/content-types").then(({data:n})=>Vt.array().parse(n.data))},readContentTypeIndex(){return[Y,"content-manager","content-types"]},readContentTypeItems({uid:n,locale:i,query:s}){const d=new URLSearchParams;return s&&d.append("_q",s),i&&d.append("locale",i),e.get(`/${Y}/content-type-items/${n}?${d.toString()}`).then(({data:r})=>gn.array().parse(r))},readContentTypeItemsIndex({uid:n,locale:i,query:s}){return[Y,"content-manager","content-type-items",n,i,s]},readLocale(){return e.get(`/${Y}/settings/locale`).then(n=>en.parse(n.data))},readLocaleIndex(){return[Y,"locale"]},copyNavigationLocale({documentId:n,source:i,target:s}){return e.put(`/${Y}/i18n/copy/${n}/${i}/${s}`)},copyNavigationItemLocale({source:n,structureId:i="",target:s}){return e.get(`/${Y}/i18n/item/read/${n}/${s}?path=${i}`).then(d=>fn.parse(d.data))}})),yn=t.jsx(O.WarningCircle,{}),We=({isVisible:e=!1,isActionAsync:n=!1,children:i,onConfirm:s,onCancel:d,header:r,labelCancel:h,labelConfirm:x,iconConfirm:F,mainIcon:g=yn})=>{const{formatMessage:f}=H.useIntl();return e?t.jsx(a.Dialog.Root,{open:e,onOpenChange:S=>{!S&&e&&d?.(void 0)},title:r||f(l("components.confirmation.dialog.header","Confirmation")),children:t.jsxs(a.Dialog.Content,{children:[t.jsx(a.Dialog.Body,{icon:g,children:t.jsx(a.Flex,{justifyContent:"center",children:t.jsx(a.Typography,{id:"dialog-confirm-description",children:i||f(l("components.confirmation.dialog.description"))})})}),t.jsxs(a.Dialog.Footer,{children:[t.jsx(a.Dialog.Cancel,{children:t.jsx(a.Button,{fullWidth:!0,onClick:d,variant:"tertiary",disabled:n,children:h||f(l("components.confirmation.dialog.button.cancel","Cancel"))})}),t.jsx(a.Button,{fullWidth:!0,onClick:s,variant:"danger-light",startIcon:F||t.jsx(O.Check,{}),disabled:n,children:x||f(l("components.confirmation.dialog.button.confirm","Confirm"))})]})]})}):null},it=t.jsx(t.Fragment,{}),xn=({onConfirm:e,onCancel:n})=>{const{formatMessage:i}=H.useIntl();return t.jsx(We,{isVisible:!0,header:i(l("pages.view.actions.i18nCopyItems.confirmation.header")),labelConfirm:i(l("pages.view.actions.i18nCopyItems.confirmation.confirm")),iconConfirm:it,mainIcon:it,onConfirm:e,onCancel:n,children:i(l("pages.view.actions.i18nCopyItems.confirmation.content"))})},He=()=>{const e=P.getFetchClient(),n=ee(e);return W.useQuery({queryKey:n.readLocaleIndex(),queryFn:n.readLocale,staleTime:1/0})},It=e=>{const n=P.getFetchClient(),i=ee(n);return W.useQuery({queryKey:i.readContentTypeItemsIndex(e),queryFn:()=>i.readContentTypeItems(e),staleTime:1e3*60*3,enabled:!!e.uid})},bn=()=>{const e=P.getFetchClient(),n=ee(e);return W.useQuery({queryKey:n.readContentTypeIndex(),queryFn:()=>n.readContentType(),staleTime:1e3*60*3})},jn=()=>{const e=P.getFetchClient(),n=ee(e),i=W.useQueryClient();return()=>{i.resetQueries({queryKey:n.readAllIndex()})}},In=()=>{const e=P.getFetchClient(),n=ee(e),i=W.useQueryClient();return()=>{i.resetQueries({queryKey:n.readContentTypeIndex()})}},Xe=()=>{const e=P.getFetchClient(),n=ee(e);return W.useQuery({queryKey:n.readAllIndex(),queryFn(){return n.readAll().then(i=>i.map(s=>({...s,items:s.items.map(Ze)})))},staleTime:1e3*60*5})},Cn=()=>{const e=W.useQueryClient(),n=P.getFetchClient(),i=ee(n);return p.useCallback(()=>{e.invalidateQueries({queryKey:i.getIndexPrefix()})},[e,n,i])},vn=()=>{const e=P.getFetchClient(),n=ee(e);return W.useMutation({mutationFn(i){return Promise.all(i.map(n.delete))}})},Tn=()=>{const e=P.getFetchClient(),n=ee(e);return W.useMutation({mutationFn:n.copyNavigationItemLocale})},wn=()=>{const e=P.getFetchClient(),n=ee(e),i=W.useQueryClient();return W.useMutation({mutationFn:n.copyNavigationLocale,onSuccess(){i.invalidateQueries({queryKey:n.readAllIndex()})}})},Sn=()=>{const e=P.getFetchClient(),n=ee(e),i=W.useQueryClient();return W.useMutation({mutationFn:n.create,onSuccess(){i.invalidateQueries({queryKey:n.readAllIndex()})}})},Ct=e=>{const n=P.getFetchClient(),i=ee(n),s=W.useQueryClient();return W.useMutation({mutationFn:i.update,onSuccess(){s.invalidateQueries({queryKey:i.readAllIndex()}),e?.()}})},vt=()=>{const e=P.getFetchClient(),n=ee(e);return W.useMutation({mutationFn(i){return i?.length?Promise.all(i.map(s=>n.purge({documentId:s,withLangVersions:!0}))):n.purge({})}})},ke=()=>{const e=P.getFetchClient(),n=ee(e);return W.useQuery({queryKey:n.readConfigIndex(),queryFn:n.readConfig})},Fn=e=>{const[n,i]=p.useState(!1),[s,d]=p.useState(void 0),r=p.useCallback(()=>{i(!1)},[i]),h=p.useCallback(()=>{s&&(e(s),i(!1))},[e,s]),x=p.useMemo(()=>n?t.jsx(xn,{onConfirm:h,onCancel:r}):null,[n,h,r]);return p.useMemo(()=>({setI18nCopyModalOpened:i,setI18nCopySourceLocale:d,i18nCopyItemsModal:x,i18nCopySourceLocale:s}),[d,i,x,s])},Ze=e=>({...e,viewId:Math.floor(Math.random()*152e4),items:e.items?.map(Ze)}),$e=(e=[])=>j.orderBy(e,["order"],["asc"]).map((n,i)=>{const s=i+1;return{...n,order:s,updated:n.updated||s!==n.order}}),ze=(e,n)=>e.type==="INTERNAL"?{type:"INTERNAL",collapsed:!!e.collapsed,id:e.id,documentId:e.documentId,menuAttached:!!e.menuAttached,order:e.order??0,path:e.path,title:e.title,uiRouterKey:e.uiRouterKey,additionalFields:e.additionalFields,audience:e.audience?.map(i=>n.availableAudience.find(s=>s.documentId===i))??[],autoSync:e.autoSync,items:e.items?.length?Ee(e,e.items,n):e.items,related:{__type:e.relatedType,documentId:e.related},viewId:e.viewId,viewParentId:e.viewParentId,structureId:e.structureId,removed:e.removed,updated:e.updated}:e.type==="EXTERNAL"?{type:"EXTERNAL",collapsed:!!e.collapsed,id:e.id,documentId:e.documentId,menuAttached:!!e.menuAttached,order:e.order??0,title:e.title,uiRouterKey:e.uiRouterKey,additionalFields:e.additionalFields,autoSync:e.autoSync,items:e.items?.length?Ee(e,e.items,n):e.items,path:"",viewId:e.viewId,structureId:e.structureId,viewParentId:e.viewParentId,removed:e.removed,updated:e.updated,externalPath:e.externalPath??"",audience:e.audience?.map(i=>n.availableAudience.find(s=>s.documentId===i))??[]}:{type:"WRAPPER",collapsed:!!e.collapsed,id:e.id,documentId:e.documentId,menuAttached:!!e.menuAttached,order:e.order??0,path:e.path??"",title:e.title,uiRouterKey:e.uiRouterKey,additionalFields:e.additionalFields,audience:e.audience?.map(i=>n.availableAudience.find(s=>s.documentId===i))??[],autoSync:e.autoSync,items:e.items?.length?Ee(e,e.items,n):e.items,viewId:e.viewId,viewParentId:e.viewParentId,structureId:e.structureId,removed:e.removed,updated:e.updated},Ee=(e,n=[],i)=>{if(!e.viewParentId){if(e.viewId){const d=n.map(r=>r.viewId===e.viewId?ze(e,i):{...r,items:r.items?.length?Ee(e,r.items,i):r.items});return $e(d)}return[...$e([...n,ze({...e,viewId:Date.now()},i)])]}const s=n.map(d=>{const r=d.items||[];if(e.viewParentId===d.viewId){if(!e.viewId)return{...d,items:[...$e([...r,ze({...e,viewId:Date.now()},i)])]};const h=r.map(x=>x.viewId===e.viewId?ze(e,i):x);return{...d,items:$e(h)}}return{...d,items:d.items?.length?Ee(e,d.items,i):d.items}});return $e(s)},Be=(e,n)=>{const i=n?.contentTypes??[],s=n?.contentTypesNameFields??{},d=s.default??[],{__collectionUid:r}=e,h=i.find(({uid:f})=>f===r);if(h?.isSingle)return h.labelSingular;const x=[...d,...d.map(f=>j.capitalize(f))],F=j.get(s,`${h?h.uid:r}`,x),g=(j.isEmpty(F)?x:F).map(f=>e[f]).filter(f=>f);return j.first(g)||""},Nn=({relatedRef:e,relatedType:n={},type:i,isCollection:s})=>s?n.available||e.available:i==="INTERNAL"&&(e?"publishedAt"in e:!1)?j.get(e,"publishedAt",!0):!0,Ne=(e,n=!1)=>{const{__type:i,documentId:s}=e.type==="INTERNAL"&&e.related?e.related:{__type:"",documentId:""};return e.type==="INTERNAL"?{type:"INTERNAL",id:e.id,documentId:e.documentId,additionalFields:e.additionalFields??{},path:e.path??"",relatedType:i,related:s,title:e.title,uiRouterKey:e.uiRouterKey,autoSync:e.autoSync??void 0,collapsed:e.collapsed,externalPath:void 0,order:e.order??0,menuAttached:e.menuAttached,viewId:e.viewId,viewParentId:e.viewParentId,items:n?e.items:e.items?.map(d=>Ne(d))??void 0,removed:e.removed,updated:e.updated,isSearchActive:e.isSearchActive}:e.type==="EXTERNAL"?{type:"EXTERNAL",id:e.id,documentId:e.documentId,additionalFields:e.additionalFields??{},title:e.title,uiRouterKey:e.uiRouterKey,autoSync:e.autoSync??void 0,collapsed:e.collapsed,externalPath:e.externalPath,order:e.order??0,menuAttached:e.menuAttached,viewId:e.viewId,viewParentId:e.viewParentId,items:n?e.items:e.items?.map(d=>Ne(d))??void 0,removed:e.removed,updated:e.updated,isSearchActive:e.isSearchActive}:{type:"WRAPPER",id:e.id,documentId:e.documentId,additionalFields:e.additionalFields??{},title:e.title,uiRouterKey:e.uiRouterKey,autoSync:e.autoSync??void 0,collapsed:e.collapsed,order:e.order??0,menuAttached:e.menuAttached,viewId:e.viewId,viewParentId:e.viewParentId,items:n?e.items:e.items?.map(d=>Ne(d))??void 0,removed:e.removed,updated:e.updated,isSearchActive:e.isSearchActive,path:e.path??""}},Tt=e=>e.find(({isPending:n})=>n),Re=(e,n)=>e.collapsed!==n?{...e,collapsed:n,updated:!0,items:e.items?.map(i=>Re(i,n))}:{...e,items:e.items?.map(i=>Re(i,n))},Le=({start:e,end:n})=>t.jsxs(a.Modal.Footer,{children:[t.jsx(a.Modal.Close,{children:ot(e)}),ot(n)]}),ot=e=>e?t.jsx(a.Button,{onClick:e.onClick,variant:e.variant,disabled:e.disabled,children:e.children}):null,An=({alreadyUsedNames:e})=>c.z.object({name:c.z.string().min(2).and(c.z.string().refine(n=>!e.includes(n),"Name already used")),visible:c.z.boolean()}),wt=({navigation:e,onChange:n,alreadyUsedNames:i=[],isLoading:s})=>{const[d,r]=p.useState({}),[h,x]=p.useState(),{formatMessage:F}=H.useIntl(),{name:g,visible:f}=d,S=(I,T,u)=>{if(u){let v=I,A=T;if(j.isObject(I)){const{name:V,value:le}=I.target;v=V,A=j.isNil(A)?le:A}return j.isString(v)&&b(v,A),u(I,A)}},b=(I,T)=>{r(j.set({...d},I,T))},$=I=>{const T=j.get(h,I);if(T)return T};return p.useEffect(()=>{e&&(e.name?r({...e}):(r({name:"New navigation",visible:!0}),n({name:"New navigation",visible:!0,disabled:!0})))},[]),p.useEffect(()=>{if(`${g}-${f}`!=`${e.name}-${e.visible}`){const{error:I}=An({alreadyUsedNames:i}).safeParse(d);n({...e,name:g,visible:f,disabled:!j.isEmpty(I?.issues)}),x(I?I.issues.reduce((T,u)=>({...T,[u.path.join(".")]:u.message}),{}):void 0)}},[g,f]),t.jsx(P.Form,{width:"auto",height:"auto",method:"POST",initialValues:d,children:({values:I,onChange:T})=>t.jsxs(a.Grid.Root,{gap:5,children:[t.jsx(a.Grid.Item,{col:6,children:t.jsx(G.Field,{name:"name",label:F(l("popup.navigation.form.name.label","Name")),error:$("name"),children:t.jsx(a.TextInput,{name:"name",type:"string",placeholder:F(l("popup.navigation.form.name.placeholder","Navigations's name")),onChange:(u,v)=>S(u,v,T),value:I.name,disabled:s})})}),t.jsx(a.Grid.Item,{col:6,children:t.jsx(G.Field,{name:"visible",label:F(l("popup.navigation.form.visible.label","Visibility")),error:$("visible"),children:t.jsx(a.Toggle,{name:"visible",checked:I.visible,onChange:u=>S(u,!I.visible,T),onLabel:F(l("popup.navigation.form.visible.toggle.visible")),offLabel:F(l("popup.navigation.form.visible.toggle.hidden")),disabled:s,width:"100%"})})})]})})},Rn={name:"",items:[],visible:!1},En=({setState:e,current:n,isLoading:i,alreadyUsedNames:s})=>{const d=p.useCallback(({disabled:r,...h})=>{e({view:"CREATE",current:h,alreadyUsedNames:s,disabled:r})},[e]);return t.jsx(wt,{alreadyUsedNames:s,navigation:n,onChange:d,isLoading:i})},Ln=({onSubmit:e,onReset:n,disabled:i,isLoading:s})=>{const{formatMessage:d}=H.useIntl();return t.jsx(Le,{start:{children:d(l("popup.item.form.button.cancel")),variant:"tertiary",disabled:s,onClick:n},end:{children:d(l("popup.navigation.manage.button.save")),variant:"default",disabled:s||i,onClick:e}})},$n=t.jsx(O.Pencil,{}),Pn=t.jsx(O.Trash,{}),st=t.jsx(O.Feather,{}),kn=({navigations:e,selected:n,setState:i})=>{const s=ke(),d=!!n.length,{formatMessage:r}=H.useIntl(),h=He(),x=p.useCallback(()=>i({navigations:e,selected:d?[]:e.map(u=>u),view:"LIST"}),[i,e,d]),F=p.useMemo(()=>new Set(n.map(Me.prop("documentId"))),[n]),g=(u,v)=>()=>{i({navigations:e,selected:v?n.filter(({documentId:A})=>A!==u.documentId):n.concat([u]),view:"LIST"})},f=u=>()=>{i({view:"EDIT",current:u,navigation:u,alreadyUsedNames:e.reduce((v,{name:A})=>A!==u.name?v.concat([A]):v,[])})},S=u=>()=>{i({view:"DELETE",navigations:u})},b=u=>()=>{i({view:"CACHE_PURGE",navigations:u})},$=p.useCallback(S(n),[S]),I=p.useCallback(b(n),[b]),T=u=>[u].concat(e.filter(v=>v.documentId===u.documentId&&v.locale!==u.locale));return t.jsxs(t.Fragment,{children:[t.jsx(a.Grid.Root,{children:t.jsx(a.Grid.Item,{col:12,paddingBottom:3,children:d?t.jsxs(a.Flex,{direction:"row",gap:1,children:[t.jsx(a.Box,{paddingRight:3,children:r(l("popup.navigation.manage.table.hasSelected"),{count:n.length})}),t.jsx(a.Button,{onClick:$,variant:"tertiary",children:r(l("popup.navigation.manage.button.delete"))}),s.data?.isCacheEnabled?t.jsx(a.Button,{onClick:I,variant:"tertiary",children:r(l("popup.navigation.manage.button.purge"))}):null]}):null})}),t.jsxs(a.Table,{rowCount:e.length,colCount:6,children:[t.jsx(a.Thead,{children:t.jsxs(a.Tr,{children:[t.jsx(a.Th,{children:t.jsx(a.Checkbox,{onCheckedChange:x,check:d})}),t.jsx(a.Th,{children:t.jsx(a.Typography,{textColor:"neutral800",children:r(l("popup.navigation.manage.table.id"))})}),t.jsx(a.Th,{children:t.jsx(a.Typography,{textColor:"neutral800",children:r(l("popup.navigation.manage.table.name"))})}),t.jsx(a.Th,{children:t.jsx(a.Typography,{textColor:"neutral800",children:r(l("popup.navigation.manage.table.locale"))})}),t.jsx(a.Th,{children:t.jsx(a.Typography,{textColor:"neutral800",children:r(l("popup.navigation.manage.table.visibility"))})}),t.jsx(a.Th,{children:s.data?.isCacheEnabled?t.jsx(a.Flex,{direction:"row",children:t.jsx(a.Box,{paddingLeft:1,children:t.jsx(a.IconButton,{onClick:b([]),label:r(l("popup.navigation.manage.button.purge")),noBorder:!0,children:st})})}):null})]})}),t.jsx(a.Tbody,{children:e.filter(({locale:u})=>u===h.data?.defaultLocale).map(u=>t.jsxs(a.Tr,{children:[t.jsx(a.Td,{children:t.jsx(a.Checkbox,{onCheckedChange:g(u,F.has(u.documentId)),checked:F.has(u.documentId)})}),t.jsx(a.Td,{children:t.jsx(a.Typography,{textColor:"neutral800",children:u.documentId})}),t.jsx(a.Td,{children:t.jsx(a.Typography,{textColor:"neutral800",children:u.name})}),t.jsx(a.Td,{children:t.jsx(a.Typography,{textColor:"neutral800",children:T(u).map(Me.prop("locale")).join(", ")})}),t.jsx(a.Td,{children:t.jsx(a.Typography,{textColor:"neutral800",children:u.visible?r(l("popup.navigation.manage.navigation.visible")):r(l("popup.navigation.manage.navigation.hidden"))})}),t.jsx(a.Td,{children:t.jsxs(a.Flex,{width:"100%",direction:"row",alignItems:"center",justifyContent:"flex-end",children:[t.jsx(a.Box,{paddingLeft:1,children:t.jsx(a.IconButton,{onClick:f(u),label:r(l("popup.navigation.manage.button.edit")),noBorder:!0,children:$n})}),t.jsx(a.Box,{paddingLeft:1,children:t.jsx(a.IconButton,{onClick:S([u]),label:r(l("popup.navigation.manage.button.delete")),noBorder:!0,children:Pn})}),s.data?.isCacheEnabled?t.jsx(a.Box,{paddingLeft:1,children:t.jsx(a.IconButton,{onClick:b([u]),label:r(l("popup.navigation.manage.button.purge")),noBorder:!0,children:st})}):null]})})]},u.documentId))})]})]})},zn=({onClose:e,state:n,setState:i,navigations:s,isLoading:d})=>{const{formatMessage:r}=H.useIntl();return t.jsx(Le,{start:{onClick:e,variant:"tertiary",disabled:d,children:r(l("popup.item.form.button.cancel"))},end:{onClick:()=>i({view:"CREATE",alreadyUsedNames:s.map(({name:h})=>h),current:Rn}),variant:"default",disabled:d,children:r(l("popup.navigation.manage.button.create"))}})},Mn=({navigations:e})=>{const{formatMessage:n}=H.useIntl();return t.jsxs(a.Grid.Root,{children:[t.jsx(a.Grid.Item,{col:12,paddingBottom:1,children:t.jsx(a.Flex,{children:t.jsx(a.Typography,{variant:"beta",children:n(l("popup.navigation.manage.delete.header"))})})}),t.jsx(a.Grid.Item,{col:12,paddingBottom:1,children:t.jsx(a.Typography,{variant:"omega",fontWeight:"semiBold",children:Dn(e)})})]})},Bn=({state:e,onSubmit:n,onReset:i,isLoading:s})=>{const{formatMessage:d}=H.useIntl();return t.jsx(Le,{start:{children:d(l("popup.item.form.button.cancel")),disabled:s,onClick:i,variant:"tertiary"},end:{children:d(l("popup.navigation.manage.button.delete")),disabled:s,onClick:n,variant:"danger"}})},Dn=e=>e.map(Me.prop("name")).join(", "),qn=({errors:e})=>{const{formatMessage:n}=H.useIntl(),{toggleNotification:i}=P.useNotification();return p.useEffect(()=>{e.map(s=>{i({type:"warning",message:n({id:"",defaultMessage:s.message})}),console.error(s)})},[]),t.jsx(a.Grid.Root,{children:t.jsx(a.Grid.Item,{col:12,children:n(l("popup.navigation.manage.error.message"))})})},On=({onReset:e})=>{const{formatMessage:n}=H.useIntl();return t.jsx(Le,{end:{children:n(l("popup.navigation.manage.button.goBack")),onClick:e,variant:"secondary"}})},Gn=({alreadyUsedNames:e,current:n,isLoading:i,navigation:s,setState:d})=>{const r=p.useMemo(()=>n??s,[n]),h=p.useCallback(({disabled:x,...F})=>{d({view:"EDIT",alreadyUsedNames:e,current:F,disabled:x,navigation:s})},[d,s,e]);return t.jsx(wt,{navigation:r,onChange:h,isLoading:i,alreadyUsedNames:e})},Vn=({onSubmit:e,onReset:n,disabled:i,isLoading:s})=>{const{formatMessage:d}=H.useIntl();return t.jsx(Le,{start:{children:d(l("popup.item.form.button.cancel")),disabled:s,onClick:n,variant:"tertiary"},end:{children:d(l("popup.navigation.manage.button.save")),disabled:s||i,onClick:e,variant:"secondary"}})},_n=({navigations:e})=>{const{formatMessage:n}=H.useIntl();return t.jsxs(a.Grid.Root,{children:[t.jsx(a.Grid.Item,{col:12,paddingBottom:1,children:t.jsx(a.Flex,{children:t.jsx(a.Typography,{variant:"beta",children:n(l("popup.navigation.manage.purge.header"))})})}),t.jsx(a.Grid.Item,{col:12,paddingBottom:1,children:t.jsx(a.Typography,{variant:"omega",fontWeight:"semiBold",children:Kn(e)})})]})},Qn=({onSubmit:e,onReset:n,isLoading:i})=>{const{formatMessage:s}=H.useIntl();return t.jsx(Le,{start:{children:s(l("popup.item.form.button.cancel")),disabled:i,onClick:n,variant:"tertiary"},end:{children:s(l("popup.navigation.manage.footer.button.purge")),disabled:i,onClick:e,variant:"danger"}})},Kn=e=>e.map(Me.prop("name")).join(", "),Un=({initialState:e,isOpened:n,onClose:i})=>{const{formatMessage:s}=H.useIntl(),[d,r]=p.useState(e),{toggleNotification:h}=P.useNotification(),x=Cn(),F=vn(),g=Sn(),f=Ct(),S=vt(),b=Xe(),$=He(),I=p.useMemo(()=>j.sortBy(b.data??[],"id"),[b.data]),T=Tt([F,b,g,f,S,$]),u=p.useCallback(()=>r({view:"INITIAL"}),[r]),v=p.useCallback(async()=>{const M=d.view==="DELETE"?()=>{F.mutate(d.navigations.reduce((J,ne)=>(ne.documentId&&J.push(ne.documentId),J),[]),{onSuccess:x})}:d.view==="EDIT"?()=>{f.mutate(d.current,{onSuccess(){x(),h({type:"success",message:s(l("notification.navigation.submit"))})},onError(J){console.warn(J),h({type:"warning",message:s(l("notification.navigation.error"),{errorTitles:""})})}})}:d.view==="CREATE"&&d.current?()=>{g.mutate(d.current,{onSuccess(){x(),h({type:"success",message:s(l("notification.navigation.submit"))})},onError(J){console.warn(J),h({type:"warning",message:s(l("notification.navigation.error"),{errorTitles:""})})}})}:d.view==="CACHE_PURGE"?()=>{S.mutate(d.navigations.reduce((J,ne)=>(ne.documentId&&J.push(ne.documentId),J),[]),{onSuccess:x})}:()=>{};try{M(),r({view:"INITIAL"})}catch(J){r({view:"ERROR",errors:J instanceof Error?[J]:[]})}},[d,r,x,g,S,f,F,h,s,l]);p.useEffect(()=>{(d.view==="INITIAL"||d.view==="LIST")&&r({view:"LIST",navigations:I,selected:[]})},[d.view,I]);const A=Wn(d,s,!!T),V=Hn(d,r,!!T),le=Xn({state:d,setState:r,onClose:i,onSubmit:v,onReset:u,navigations:I,isLoading:!!T});return t.jsx(a.Modal.Root,{labelledBy:"condition-modal-breadcrumbs",onOpenChange:M=>{M||i?.()},open:n,children:t.jsxs(a.Modal.Content,{children:[t.jsx(a.Modal.Header,{children:t.jsx(a.Typography,{variant:"omega",fontWeight:"bold",textColor:"neutral800",as:"h2",children:A})}),t.jsx(a.Modal.Body,{children:V}),le]})})},Wn=(e,n,i)=>{switch(e.view){case"LIST":case"CREATE":case"ERROR":case"CACHE_PURGE":case"DELETE":return t.jsxs(a.Flex,{direction:"row",children:[i?t.jsx(a.Loader,{small:!0}):null,n(l(`popup.navigation.manage.header.${e.view}`))]});case"EDIT":return t.jsxs(a.Flex,{direction:"row",children:[i?t.jsx(a.Loader,{small:!0}):null,n(l("popup.navigation.manage.header.EDIT"),{name:e.navigation.name})]});case"INITIAL":return null;default:return Je(e)}},Hn=(e,n,i)=>{const s={setState:n,isLoading:i};switch(e.view){case"LIST":return t.jsx(kn,{...e,...s});case"EDIT":return t.jsx(Gn,{...e,...s});case"CREATE":return t.jsx(En,{...e,...s});case"DELETE":return t.jsx(Mn,{...e,...s});case"CACHE_PURGE":return t.jsx(_n,{...e,...s});case"INITIAL":return t.jsx(a.Loader,{small:!0});case"ERROR":return t.jsx(qn,{...e,...s});default:return Je(e)}},Xn=e=>{switch(e.state.view){case"LIST":return t.jsx(zn,{...e});case"CREATE":return t.jsx(Ln,{...e,disabled:e.state.disabled});case"EDIT":return t.jsx(Vn,{...e,disabled:e.state.disabled});case"DELETE":return t.jsx(Bn,{...e});case"CACHE_PURGE":return t.jsx(Qn,{...e});case"ERROR":return t.jsx(On,{...e});case"INITIAL":return null;default:return Je(e.state)}},Je=e=>(console.warn(`Unknown state "${e?.view}". (${JSON.stringify(e)})`),null),Zn=()=>{const[e,n]=p.useState(!1),i=p.useCallback(()=>n(!0),[n]),s=p.useCallback(()=>n(!1),[n]),d=p.useMemo(()=>e?t.jsx(Un,{initialState:{view:"INITIAL"},isOpened:!0,onClose:s}):null,[e,s]);return p.useMemo(()=>({navigationManagerModal:d,openNavigationManagerModal:i,closeNavigationManagerModal:s}),[d,i,s])},rt=t.jsx(O.Check,{}),Jn=({activeNavigation:e,availableNavigations:n,structureHasErrors:i,structureHasChanged:s,handleChangeSelection:d,handleLocalizationSelection:r,handleSave:h,handleCachePurge:x,permissions:F={},locale:g,currentLocale:f})=>{const{formatMessage:S}=H.useIntl(),{openNavigationManagerModal:b,navigationManagerModal:$}=Zn(),I=!!g.restLocale,{canUpdate:T}=F,u=ke();return t.jsx(t.Fragment,{children:t.jsx(P.Layouts.Header,{title:S(l("header.title","UI Navigation")),subtitle:S(l("header.description")),primaryAction:t.jsxs(a.Flex,{direction:"row",size:2,children:[t.jsx(a.Box,{children:t.jsxs(a.Grid.Root,{gap:4,style:u.data?.isCacheEnabled?{display:"flex"}:void 0,children:[I?null:t.jsx(a.Grid.Item,{col:2}),T&&t.jsx(a.Grid.Item,{col:3,children:t.jsx(a.Button,{onClick:b,startIcon:null,type:"button",variant:"secondary",fullWidth:!0,size:"S",children:S(l("header.action.manage"))})}),t.jsx(a.Grid.Item,{col:T?4:10,children:t.jsx(a.Field.Root,{width:"100%",children:t.jsx(a.SingleSelect,{type:"select",placeholder:"Change navigation",name:"navigationSelect",onChange:v=>{const A=n.find(({documentId:V})=>v===V);A&&d(A)},value:e?.documentId,size:"S",style:null,children:n.filter(({locale:v})=>v===f).map(({documentId:v,name:A})=>t.jsx(a.SingleSelectOption,{value:v,children:A},v))})})}),I?t.jsx(a.Grid.Item,{col:2,children:t.jsx(a.SingleSelect,{type:"select",placeholder:S(l("pages.main.header.localization.select.placeholder")),name:"navigationLocalizationSelect",onChange:r,value:f,size:"S",children:[g.defaultLocale,...g.restLocale].map(v=>t.jsx(a.SingleSelectOption,{value:v,children:v},v))})}):null,T&&t.jsx(a.Grid.Item,{col:3,children:t.jsx(a.Button,{onClick:h,startIcon:rt,disabled:i||!s,type:"submit",fullWidth:!0,size:"S",children:S(l("submit.cta.save"))})}),u.data?.isCacheEnabled&&t.jsx(a.Grid.Item,{col:3,children:t.jsx(a.Button,{onClick:x,startIcon:rt,variant:"danger",type:"submit",fullWidth:!0,size:"S",children:S(l("submit.cta.cache.purge"))})})]})}),T&&$]}),secondaryAction:t.jsx(a.Tag,{icon:t.jsx(O.Information,{"aria-hidden":!0}),children:e?S(l("header.meta"),{id:e?.documentId,key:e?.slug}):null})})})},Yn=({startActions:e,endActions:n})=>t.jsxs(a.Flex,{justifyContent:"space-between",width:"100%",children:[t.jsx(a.Flex,{alignItems:"space-between",children:e}),t.jsx(a.Flex,{alignItems:"space-between",children:n})]}),ea=we.default.div`
|
|
7
|
+
H14c-3.6,0-6.5,2.9-6.5,6.5s2.9,6.5,6.5,6.5h64C81.6,81.5,84.5,78.6,84.5,75z`})})}),Uw=()=>u.jsx(qw,{});function nt(t){const e=p.useRef(t);return p.useEffect(()=>{e.current=t}),p.useMemo(()=>(...n)=>{var r;return(r=e.current)===null||r===void 0?void 0:r.call(e,...n)},[])}function vc(t,e){return t-e*Math.floor(t/e)}const bp=1721426;function Ds(t,e,n,r){e=Yu(t,e);let i=e-1,o=-2;return n<=2?o=0:va(e)&&(o=-1),bp-1+365*i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400)+Math.floor((367*n-362)/12+o+r)}function va(t){return t%4===0&&(t%100!==0||t%400===0)}function Yu(t,e){return t==="BC"?1-e:e}function Kw(t){let e="AD";return t<=0&&(e="BC",t=1-t),[e,t]}const Gw={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class Oi{fromJulianDay(e){let n=e,r=n-bp,i=Math.floor(r/146097),o=vc(r,146097),s=Math.floor(o/36524),a=vc(o,36524),l=Math.floor(a/1461),c=vc(a,1461),d=Math.floor(c/365),h=i*400+s*100+l*4+d+(s!==4&&d!==4?1:0),[f,m]=Kw(h),g=n-Ds(f,m,1,1),b=2;n<Ds(f,m,3,1)?b=0:va(m)&&(b=1);let v=Math.floor(((g+b)*12+373)/367),x=n-Ds(f,m,v,1)+1;return new Fo(f,m,v,x)}toJulianDay(e){return Ds(e.era,e.year,e.month,e.day)}getDaysInMonth(e){return Gw[va(e.year)?"leapyear":"standard"][e.month-1]}getMonthsInYear(e){return 12}getDaysInYear(e){return va(e.year)?366:365}getYearsInEra(e){return 9999}getEras(){return["BC","AD"]}isInverseEra(e){return e.era==="BC"}balanceDate(e){e.year<=0&&(e.era=e.era==="BC"?"AD":"BC",e.year=1-e.year)}constructor(){this.identifier="gregory"}}const Yw={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function vp(t,e){return e=tn(e,t.calendar),t.era===e.era&&t.year===e.year&&t.month===e.month&&t.day===e.day}function xp(t,e){let n=t.calendar.toJulianDay(t),r=Math.ceil(n+1-ty(e))%7;return r<0&&(r+=7),r}function Xw(t){return Pn(Date.now(),t)}function Xu(t){return kp(Xw(t))}function wp(t,e){return t.calendar.toJulianDay(t)-e.calendar.toJulianDay(e)}function Qw(t,e){return i0(t)-i0(e)}function i0(t){return t.hour*36e5+t.minute*6e4+t.second*1e3+t.millisecond}let xc=null;function Li(){return xc==null&&(xc=new Intl.DateTimeFormat().resolvedOptions().timeZone),xc}function Zw(t){return t.subtract({days:t.day-1})}function Jw(t){return t.add({days:t.calendar.getDaysInMonth(t)-t.day})}function yp(t,e){let n=xp(t,e);return t.subtract({days:n})}const o0=new Map;function ey(t){if(Intl.Locale){let n=o0.get(t);return n||(n=new Intl.Locale(t).maximize().region,n&&o0.set(t,n)),n}let e=t.split("-")[1];return e==="u"?void 0:e}function ty(t){let e=ey(t);return e&&Yw[e]||0}function xd(t,e){return t&&e?t.compare(e)<=0?t:e:t||e}function wd(t,e){return t&&e?t.compare(e)>=0?t:e:t||e}function Ni(t){t=tn(t,new Oi);let e=Yu(t.era,t.year);return Cp(e,t.month,t.day,t.hour,t.minute,t.second,t.millisecond)}function Cp(t,e,n,r,i,o,s){let a=new Date;return a.setUTCHours(r,i,o,s),a.setUTCFullYear(t,e-1,n),a.getTime()}function yd(t,e){if(e==="UTC")return 0;if(t>0&&e===Li())return new Date(t).getTimezoneOffset()*-6e4;let{year:n,month:r,day:i,hour:o,minute:s,second:a}=$p(t,e);return Cp(n,r,i,o,s,a,0)-Math.floor(t/1e3)*1e3}const s0=new Map;function $p(t,e){let n=s0.get(e);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:e,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),s0.set(e,n));let r=n.formatToParts(new Date(t)),i={};for(let o of r)o.type!=="literal"&&(i[o.type]=o.value);return{year:i.era==="BC"||i.era==="B"?-i.year+1:+i.year,month:+i.month,day:+i.day,hour:i.hour==="24"?0:+i.hour,minute:+i.minute,second:+i.second}}const a0=864e5;function ny(t,e,n,r){return(n===r?[n]:[n,r]).filter(o=>ry(t,e,o))}function ry(t,e,n){let r=$p(n,e);return t.year===r.year&&t.month===r.month&&t.day===r.day&&t.hour===r.hour&&t.minute===r.minute&&t.second===r.second}function zn(t,e,n="compatible"){let r=Pr(t);if(e==="UTC")return Ni(r);if(e===Li()&&n==="compatible"){r=tn(r,new Oi);let l=new Date,c=Yu(r.era,r.year);return l.setFullYear(c,r.month-1,r.day),l.setHours(r.hour,r.minute,r.second,r.millisecond),l.getTime()}let i=Ni(r),o=yd(i-a0,e),s=yd(i+a0,e),a=ny(r,e,i-o,i-s);if(a.length===1)return a[0];if(a.length>1)switch(n){case"compatible":case"earlier":return a[0];case"later":return a[a.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(i-o,i-s);case"compatible":case"later":return Math.max(i-o,i-s);case"reject":throw new RangeError("No such absolute time found")}}function Sp(t,e,n="compatible"){return new Date(zn(t,e,n))}function Pn(t,e){let n=yd(t,e),r=new Date(t+n),i=r.getUTCFullYear(),o=r.getUTCMonth()+1,s=r.getUTCDate(),a=r.getUTCHours(),l=r.getUTCMinutes(),c=r.getUTCSeconds(),d=r.getUTCMilliseconds();return new Bi(i,o,s,e,n,a,l,c,d)}function kp(t){return new Fo(t.calendar,t.era,t.year,t.month,t.day)}function Pr(t,e){let n=0,r=0,i=0,o=0;if("timeZone"in t)({hour:n,minute:r,second:i,millisecond:o}=t);else if("hour"in t&&!e)return t;return e&&({hour:n,minute:r,second:i,millisecond:o}=e),new Na(t.calendar,t.era,t.year,t.month,t.day,n,r,i,o)}function tn(t,e){if(t.calendar.identifier===e.identifier)return t;let n=e.fromJulianDay(t.calendar.toJulianDay(t)),r=t.copy();return r.calendar=e,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,Wr(r),r}function iy(t,e,n){if(t instanceof Bi)return t.timeZone===e?t:Ap(t,e);let r=zn(t,e,n);return Pn(r,e)}function oy(t){let e=Ni(t)-t.offset;return new Date(e)}function Ap(t,e){let n=Ni(t)-t.offset;return tn(Pn(n,e),t.calendar)}const ho=36e5;function kl(t,e){let n=t.copy(),r="hour"in n?cy(n,e):0;Cd(n,e.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,t),n.month+=e.months||0,$d(n),Rp(n),n.day+=(e.weeks||0)*7,n.day+=e.days||0,n.day+=r,sy(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let i=n.calendar.getYearsInEra(n);if(n.year>i){var o,s;let l=(o=(s=n.calendar).isInverseEra)===null||o===void 0?void 0:o.call(s,n);n.year=i,n.month=l?1:n.calendar.getMonthsInYear(n),n.day=l?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let a=n.calendar.getMonthsInYear(n);return n.month>a&&(n.month=a,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function Cd(t,e){var n,r;!((n=(r=t.calendar).isInverseEra)===null||n===void 0)&&n.call(r,t)&&(e=-e),t.year+=e}function $d(t){for(;t.month<1;)Cd(t,-1),t.month+=t.calendar.getMonthsInYear(t);let e=0;for(;t.month>(e=t.calendar.getMonthsInYear(t));)t.month-=e,Cd(t,1)}function sy(t){for(;t.day<1;)t.month--,$d(t),t.day+=t.calendar.getDaysInMonth(t);for(;t.day>t.calendar.getDaysInMonth(t);)t.day-=t.calendar.getDaysInMonth(t),t.month++,$d(t)}function Rp(t){t.month=Math.max(1,Math.min(t.calendar.getMonthsInYear(t),t.month)),t.day=Math.max(1,Math.min(t.calendar.getDaysInMonth(t),t.day))}function Wr(t){t.calendar.constrainDate&&t.calendar.constrainDate(t),t.year=Math.max(1,Math.min(t.calendar.getYearsInEra(t),t.year)),Rp(t)}function Tp(t){let e={};for(let n in t)typeof t[n]=="number"&&(e[n]=-t[n]);return e}function Mp(t,e){return kl(t,Tp(e))}function Qu(t,e){let n=t.copy();return e.era!=null&&(n.era=e.era),e.year!=null&&(n.year=e.year),e.month!=null&&(n.month=e.month),e.day!=null&&(n.day=e.day),Wr(n),n}function La(t,e){let n=t.copy();return e.hour!=null&&(n.hour=e.hour),e.minute!=null&&(n.minute=e.minute),e.second!=null&&(n.second=e.second),e.millisecond!=null&&(n.millisecond=e.millisecond),ly(n),n}function ay(t){t.second+=Math.floor(t.millisecond/1e3),t.millisecond=Os(t.millisecond,1e3),t.minute+=Math.floor(t.second/60),t.second=Os(t.second,60),t.hour+=Math.floor(t.minute/60),t.minute=Os(t.minute,60);let e=Math.floor(t.hour/24);return t.hour=Os(t.hour,24),e}function ly(t){t.millisecond=Math.max(0,Math.min(t.millisecond,1e3)),t.second=Math.max(0,Math.min(t.second,59)),t.minute=Math.max(0,Math.min(t.minute,59)),t.hour=Math.max(0,Math.min(t.hour,23))}function Os(t,e){let n=t%e;return n<0&&(n+=e),n}function cy(t,e){return t.hour+=e.hours||0,t.minute+=e.minutes||0,t.second+=e.seconds||0,t.millisecond+=e.milliseconds||0,ay(t)}function Zu(t,e,n,r){let i=t.copy();switch(e){case"era":{let a=t.calendar.getEras(),l=a.indexOf(t.era);if(l<0)throw new Error("Invalid era: "+t.era);l=Wn(l,n,0,a.length-1,r?.round),i.era=a[l],Wr(i);break}case"year":var o,s;!((o=(s=i.calendar).isInverseEra)===null||o===void 0)&&o.call(s,i)&&(n=-n),i.year=Wn(t.year,n,-1/0,9999,r?.round),i.year===-1/0&&(i.year=1),i.calendar.balanceYearMonth&&i.calendar.balanceYearMonth(i,t);break;case"month":i.month=Wn(t.month,n,1,t.calendar.getMonthsInYear(t),r?.round);break;case"day":i.day=Wn(t.day,n,1,t.calendar.getDaysInMonth(t),r?.round);break;default:throw new Error("Unsupported field "+e)}return t.calendar.balanceDate&&t.calendar.balanceDate(i),Wr(i),i}function Ep(t,e,n,r){let i=t.copy();switch(e){case"hour":{let o=t.hour,s=0,a=23;if(r?.hourCycle===12){let l=o>=12;s=l?12:0,a=l?23:11}i.hour=Wn(o,n,s,a,r?.round);break}case"minute":i.minute=Wn(t.minute,n,0,59,r?.round);break;case"second":i.second=Wn(t.second,n,0,59,r?.round);break;case"millisecond":i.millisecond=Wn(t.millisecond,n,0,999,r?.round);break;default:throw new Error("Unsupported field "+e)}return i}function Wn(t,e,n,r,i=!1){if(i){t+=Math.sign(e),t<n&&(t=r);let o=Math.abs(e);e>0?t=Math.ceil(t/o)*o:t=Math.floor(t/o)*o,t>r&&(t=n)}else t+=e,t<n?t=r-(n-t-1):t>r&&(t=n+(t-r-1));return t}function Ip(t,e){let n;if(e.years!=null&&e.years!==0||e.months!=null&&e.months!==0||e.weeks!=null&&e.weeks!==0||e.days!=null&&e.days!==0){let i=kl(Pr(t),{years:e.years,months:e.months,weeks:e.weeks,days:e.days});n=zn(i,t.timeZone)}else n=Ni(t)-t.offset;n+=e.milliseconds||0,n+=(e.seconds||0)*1e3,n+=(e.minutes||0)*6e4,n+=(e.hours||0)*36e5;let r=Pn(n,t.timeZone);return tn(r,t.calendar)}function dy(t,e){return Ip(t,Tp(e))}function uy(t,e,n,r){switch(e){case"hour":{let i=0,o=23;if(r?.hourCycle===12){let g=t.hour>=12;i=g?12:0,o=g?23:11}let s=Pr(t),a=tn(La(s,{hour:i}),new Oi),l=[zn(a,t.timeZone,"earlier"),zn(a,t.timeZone,"later")].filter(g=>Pn(g,t.timeZone).day===a.day)[0],c=tn(La(s,{hour:o}),new Oi),d=[zn(c,t.timeZone,"earlier"),zn(c,t.timeZone,"later")].filter(g=>Pn(g,t.timeZone).day===c.day).pop(),h=Ni(t)-t.offset,f=Math.floor(h/ho),m=h%ho;return h=Wn(f,n,Math.floor(l/ho),Math.floor(d/ho),r?.round)*ho+m,tn(Pn(h,t.timeZone),t.calendar)}case"minute":case"second":case"millisecond":return Ep(t,e,n,r);case"era":case"year":case"month":case"day":{let i=Zu(Pr(t),e,n,r),o=zn(i,t.timeZone);return tn(Pn(o,t.timeZone),t.calendar)}default:throw new Error("Unsupported field "+e)}}function hy(t,e,n){let r=Pr(t),i=La(Qu(r,e),e);if(i.compare(r)===0)return t;let o=zn(i,t.timeZone,n);return tn(Pn(o,t.timeZone),t.calendar)}const fy=/^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;function jp(t,e){let n=t.match(fy);if(!n)throw new Error("Invalid ISO 8601 date time string: "+t);let r=new Bi(Bn(n[1],1,9999),Bn(n[2],1,12),1,e,0,n[4]?Bn(n[4],0,23):0,n[5]?Bn(n[5],0,59):0,n[6]?Bn(n[6],0,59):0,n[7]?Bn(n[7],0,1/0)*1e3:0);r.day=Bn(n[3],0,r.calendar.getDaysInMonth(r));var i;return n[8]&&(r.offset=Bn(n[8],-23,23)*36e5+Bn((i=n[9])!==null&&i!==void 0?i:"0",0,59)*6e4),Ap(r,e)}function my(t){return jp(t,Li())}function Bn(t,e,n){let r=Number(t);if(r<e||r>n)throw new RangeError(`Value out of range: ${e} <= ${r} <= ${n}`);return r}function py(t){return`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}:${String(t.second).padStart(2,"0")}${t.millisecond?String(t.millisecond/1e3).slice(1):""}`}function Dp(t){let e=tn(t,new Oi);return`${String(e.year).padStart(4,"0")}-${String(e.month).padStart(2,"0")}-${String(e.day).padStart(2,"0")}`}function Op(t){return`${Dp(t)}T${py(t)}`}function gy(t){let e=Math.sign(t)<0?"-":"+";t=Math.abs(t);let n=Math.floor(t/36e5),r=t%36e5/6e4;return`${e}${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`}function by(t){return`${Op(t)}${gy(t.offset)}[${t.timeZone}]`}function vy(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ju(t,e,n){vy(t,e),e.set(t,n)}function eh(t){let e=typeof t[0]=="object"?t.shift():new Oi,n;if(typeof t[0]=="string")n=t.shift();else{let s=e.getEras();n=s[s.length-1]}let r=t.shift(),i=t.shift(),o=t.shift();return[e,n,r,i,o]}var xy=new WeakMap;class Fo{copy(){return this.era?new Fo(this.calendar,this.era,this.year,this.month,this.day):new Fo(this.calendar,this.year,this.month,this.day)}add(e){return kl(this,e)}subtract(e){return Mp(this,e)}set(e){return Qu(this,e)}cycle(e,n,r){return Zu(this,e,n,r)}toDate(e){return Sp(this,e)}toString(){return Dp(this)}compare(e){return wp(this,e)}constructor(...e){Ju(this,xy,{writable:!0,value:void 0});let[n,r,i,o,s]=eh(e);this.calendar=n,this.era=r,this.year=i,this.month=o,this.day=s,Wr(this)}}var wy=new WeakMap;class Na{copy(){return this.era?new Na(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new Na(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(e){return kl(this,e)}subtract(e){return Mp(this,e)}set(e){return Qu(La(this,e),e)}cycle(e,n,r){switch(e){case"era":case"year":case"month":case"day":return Zu(this,e,n,r);default:return Ep(this,e,n,r)}}toDate(e,n){return Sp(this,e,n)}toString(){return Op(this)}compare(e){let n=wp(this,e);return n===0?Qw(this,Pr(e)):n}constructor(...e){Ju(this,wy,{writable:!0,value:void 0});let[n,r,i,o,s]=eh(e);this.calendar=n,this.era=r,this.year=i,this.month=o,this.day=s,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,Wr(this)}}var yy=new WeakMap;class Bi{copy(){return this.era?new Bi(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new Bi(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(e){return Ip(this,e)}subtract(e){return dy(this,e)}set(e,n){return hy(this,e,n)}cycle(e,n,r){return uy(this,e,n,r)}toDate(){return oy(this)}toString(){return by(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(e){return this.toDate().getTime()-iy(e,this.timeZone).toDate().getTime()}constructor(...e){Ju(this,yy,{writable:!0,value:void 0});let[n,r,i,o,s]=eh(e),a=e.shift(),l=e.shift();this.calendar=n,this.era=r,this.year=i,this.month=o,this.day=s,this.timeZone=a,this.offset=l,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,Wr(this)}}let wc=new Map;class Cy{format(e){return this.formatter.format(e)}formatToParts(e){return this.formatter.formatToParts(e)}formatRange(e,n){if(typeof this.formatter.formatRange=="function")return this.formatter.formatRange(e,n);if(n<e)throw new RangeError("End date must be >= start date");return`${this.formatter.format(e)} – ${this.formatter.format(n)}`}formatRangeToParts(e,n){if(typeof this.formatter.formatRangeToParts=="function")return this.formatter.formatRangeToParts(e,n);if(n<e)throw new RangeError("End date must be >= start date");let r=this.formatter.formatToParts(e),i=this.formatter.formatToParts(n);return[...r.map(o=>({...o,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...i.map(o=>({...o,source:"endRange"}))]}resolvedOptions(){let e=this.formatter.resolvedOptions();return ky()&&(this.resolvedHourCycle||(this.resolvedHourCycle=Ay(e.locale,this.options)),e.hourCycle=this.resolvedHourCycle,e.hour12=this.resolvedHourCycle==="h11"||this.resolvedHourCycle==="h12"),e.calendar==="ethiopic-amete-alem"&&(e.calendar="ethioaa"),e}constructor(e,n={}){this.formatter=Lp(e,n),this.options=n}}const $y={true:{ja:"h11"},false:{}};function Lp(t,e={}){if(typeof e.hour12=="boolean"&&Sy()){e={...e};let i=$y[String(e.hour12)][t.split("-")[0]],o=e.hour12?"h12":"h23";e.hourCycle=i??o,delete e.hour12}let n=t+(e?Object.entries(e).sort((i,o)=>i[0]<o[0]?-1:1).join():"");if(wc.has(n))return wc.get(n);let r=new Intl.DateTimeFormat(t,e);return wc.set(n,r),r}let yc=null;function Sy(){return yc==null&&(yc=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),yc}let Cc=null;function ky(){return Cc==null&&(Cc=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),Cc}function Ay(t,e){if(!e.timeStyle&&!e.hour)return;t=t.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,""),t+=(t.includes("-u-")?"":"-u")+"-nu-latn";let n=Lp(t,{...e,timeZone:void 0}),r=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(o=>o.type==="hour").value,10),i=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(o=>o.type==="hour").value,10);if(r===0&&i===23)return"h23";if(r===24&&i===23)return"h24";if(r===0&&i===11)return"h11";if(r===12&&i===11)return"h12";throw new Error("Unexpected hour cycle result")}function N(){return N=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},N.apply(null,arguments)}function X(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t?.(i),n===!1||!i.defaultPrevented)return e?.(i)}}function Ry(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function Al(...t){return e=>t.forEach(n=>Ry(n,e))}function ye(...t){return p.useCallback(Al(...t),t)}function th(t,e){const n=p.createContext(e);function r(o){const{children:s,...a}=o,l=p.useMemo(()=>a,Object.values(a));return p.createElement(n.Provider,{value:l},s)}function i(o){const s=p.useContext(n);if(s)return s;if(e!==void 0)return e;throw new Error(`\`${o}\` must be used within \`${t}\``)}return r.displayName=t+"Provider",[r,i]}function et(t,e=[]){let n=[];function r(o,s){const a=p.createContext(s),l=n.length;n=[...n,s];function c(h){const{scope:f,children:m,...g}=h,b=f?.[t][l]||a,v=p.useMemo(()=>g,Object.values(g));return p.createElement(b.Provider,{value:v},m)}function d(h,f){const m=f?.[t][l]||a,g=p.useContext(m);if(g)return g;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,d]}const i=()=>{const o=n.map(s=>p.createContext(s));return function(a){const l=a?.[t]||o;return p.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return i.scopeName=t,[r,Ty(i,...e)]}function Ty(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const h=l(o)[`__scope${c}`];return{...a,...h}},{});return p.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])}};return n.scopeName=e.scopeName,n}const Rn=p.forwardRef((t,e)=>{const{children:n,...r}=t,i=p.Children.toArray(n),o=i.find(My);if(o){const s=o.props.children,a=i.map(l=>l===o?p.Children.count(s)>1?p.Children.only(null):p.isValidElement(s)?s.props.children:null:l);return p.createElement(Sd,N({},r,{ref:e}),p.isValidElement(s)?p.cloneElement(s,void 0,a):null)}return p.createElement(Sd,N({},r,{ref:e}),n)});Rn.displayName="Slot";const Sd=p.forwardRef((t,e)=>{const{children:n,...r}=t;return p.isValidElement(n)?p.cloneElement(n,{...Ey(r,n.props),ref:e?Al(e,n.ref):n.ref}):p.Children.count(n)>1?p.Children.only(null):null});Sd.displayName="SlotClone";const nh=({children:t})=>p.createElement(p.Fragment,null,t);function My(t){return p.isValidElement(t)&&t.type===nh}function Ey(t,e){const n={...e};for(const r in e){const i=t[r],o=e[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{o(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...t,...n}}const Iy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ge=Iy.reduce((t,e)=>{const n=p.forwardRef((r,i)=>{const{asChild:o,...s}=r,a=o?Rn:e;return p.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),p.createElement(a,N({},s,{ref:i}))});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function jy(t,e){t&&ds.flushSync(()=>t.dispatchEvent(e))}function Dy(t,e=globalThis?.document){const n=nt(t);p.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r),()=>e.removeEventListener("keydown",r)},[n,e])}const kd="dismissableLayer.update",Oy="dismissableLayer.pointerDownOutside",Ly="dismissableLayer.focusOutside";let l0;const Ny=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ti=p.forwardRef((t,e)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...c}=t,d=p.useContext(Ny),[h,f]=p.useState(null),m=(n=h?.ownerDocument)!==null&&n!==void 0?n:globalThis?.document,[,g]=p.useState({}),b=ye(e,I=>f(I)),v=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=v.indexOf(x),$=h?v.indexOf(h):-1,k=d.layersWithOutsidePointerEventsDisabled.size>0,S=$>=y,R=By(I=>{const E=I.target,j=[...d.branches].some(O=>O.contains(E));!S||j||(o?.(I),a?.(I),I.defaultPrevented||l?.())},m),A=Fy(I=>{const E=I.target;[...d.branches].some(O=>O.contains(E))||(s?.(I),a?.(I),I.defaultPrevented||l?.())},m);return Dy(I=>{$===d.layers.size-1&&(i?.(I),!I.defaultPrevented&&l&&(I.preventDefault(),l()))},m),p.useEffect(()=>{if(h)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(l0=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),c0(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=l0)}},[h,m,r,d]),p.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),c0())},[h,d]),p.useEffect(()=>{const I=()=>g({});return document.addEventListener(kd,I),()=>document.removeEventListener(kd,I)},[]),p.createElement(ge.div,N({},c,{ref:b,style:{pointerEvents:k?S?"auto":"none":void 0,...t.style},onFocusCapture:X(t.onFocusCapture,A.onFocusCapture),onBlurCapture:X(t.onBlurCapture,A.onBlurCapture),onPointerDownCapture:X(t.onPointerDownCapture,R.onPointerDownCapture)}))});function By(t,e=globalThis?.document){const n=nt(t),r=p.useRef(!1),i=p.useRef(()=>{});return p.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let c=function(){Np(Oy,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=c,e.addEventListener("click",i.current,{once:!0})):c()}else e.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{e.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),e.removeEventListener("pointerdown",o),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function Fy(t,e=globalThis?.document){const n=nt(t),r=p.useRef(!1);return p.useEffect(()=>{const i=o=>{o.target&&!r.current&&Np(Ly,n,{originalEvent:o},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function c0(){const t=new CustomEvent(kd);document.dispatchEvent(t)}function Np(t,e,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?jy(i,o):i.dispatchEvent(o)}const Vy=ti,Ke=globalThis?.document?p.useLayoutEffect:()=>{},_y=w.useId||(()=>{});let zy=0;function gt(t){const[e,n]=w.useState(_y());return Ke(()=>{n(r=>r??String(zy++))},[t]),e?`radix-${e}`:""}const Hy=["top","right","bottom","left"],pr=Math.min,Ht=Math.max,Ba=Math.round,Ls=Math.floor,Sn=t=>({x:t,y:t}),Py={left:"right",right:"left",bottom:"top",top:"bottom"},Wy={start:"end",end:"start"};function Ad(t,e,n){return Ht(t,pr(e,n))}function Gn(t,e){return typeof t=="function"?t(e):t}function Yn(t){return t.split("-")[0]}function Qi(t){return t.split("-")[1]}function rh(t){return t==="x"?"y":"x"}function ih(t){return t==="y"?"height":"width"}function qn(t){return["top","bottom"].includes(Yn(t))?"y":"x"}function oh(t){return rh(qn(t))}function qy(t,e,n){n===void 0&&(n=!1);const r=Qi(t),i=oh(t),o=ih(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=Fa(s)),[s,Fa(s)]}function Uy(t){const e=Fa(t);return[Rd(t),e,Rd(e)]}function Rd(t){return t.replace(/start|end/g,e=>Wy[e])}function Ky(t,e,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?o:s;default:return[]}}function Gy(t,e,n,r){const i=Qi(t);let o=Ky(Yn(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(Rd)))),o}function Fa(t){return t.replace(/left|right|bottom|top/g,e=>Py[e])}function Yy(t){return{top:0,right:0,bottom:0,left:0,...t}}function Bp(t){return typeof t!="number"?Yy(t):{top:t,right:t,bottom:t,left:t}}function Va(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function d0(t,e,n){let{reference:r,floating:i}=t;const o=qn(e),s=oh(e),a=ih(s),l=Yn(e),c=o==="y",d=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,f=r[a]/2-i[a]/2;let m;switch(l){case"top":m={x:d,y:r.y-i.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:h};break;case"left":m={x:r.x-i.width,y:h};break;default:m={x:r.x,y:r.y}}switch(Qi(e)){case"start":m[s]-=f*(n&&c?-1:1);break;case"end":m[s]+=f*(n&&c?-1:1);break}return m}const Xy=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:h}=d0(c,r,l),f=r,m={},g=0;for(let b=0;b<a.length;b++){const{name:v,fn:x}=a[b],{x:y,y:$,data:k,reset:S}=await x({x:d,y:h,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:c,platform:s,elements:{reference:t,floating:e}});d=y??d,h=$??h,m={...m,[v]:{...m[v],...k}},S&&g<=50&&(g++,typeof S=="object"&&(S.placement&&(f=S.placement),S.rects&&(c=S.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):S.rects),{x:d,y:h}=d0(c,f,l)),b=-1)}return{x:d,y:h,placement:f,strategy:i,middlewareData:m}};async function Vo(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:f=!1,padding:m=0}=Gn(e,t),g=Bp(m),v=a[f?h==="floating"?"reference":"floating":h],x=Va(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(v)))==null||n?v:v.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),y=h==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,$=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),k=await(o.isElement==null?void 0:o.isElement($))?await(o.getScale==null?void 0:o.getScale($))||{x:1,y:1}:{x:1,y:1},S=Va(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:$,strategy:l}):y);return{top:(x.top-S.top+g.top)/k.y,bottom:(S.bottom-x.bottom+g.bottom)/k.y,left:(x.left-S.left+g.left)/k.x,right:(S.right-x.right+g.right)/k.x}}const Qy=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=e,{element:c,padding:d=0}=Gn(t,e)||{};if(c==null)return{};const h=Bp(d),f={x:n,y:r},m=oh(i),g=ih(m),b=await s.getDimensions(c),v=m==="y",x=v?"top":"left",y=v?"bottom":"right",$=v?"clientHeight":"clientWidth",k=o.reference[g]+o.reference[m]-f[m]-o.floating[g],S=f[m]-o.reference[m],R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let A=R?R[$]:0;(!A||!await(s.isElement==null?void 0:s.isElement(R)))&&(A=a.floating[$]||o.floating[g]);const I=k/2-S/2,E=A/2-b[g]/2-1,j=pr(h[x],E),O=pr(h[y],E),D=j,B=A-b[g]-O,V=A/2-b[g]/2+I,q=Ad(D,V,B),J=!l.arrow&&Qi(i)!=null&&V!==q&&o.reference[g]/2-(V<D?j:O)-b[g]/2<0,W=J?V<D?V-D:V-B:0;return{[m]:f[m]+W,data:{[m]:q,centerOffset:V-q-W,...J&&{alignmentOffset:W}},reset:J}}}),Zy=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:b=!0,...v}=Gn(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const x=Yn(i),y=qn(a),$=Yn(a)===a,k=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=f||($||!b?[Fa(a)]:Uy(a)),R=g!=="none";!f&&R&&S.push(...Gy(a,b,g,k));const A=[a,...S],I=await Vo(e,v),E=[];let j=((r=o.flip)==null?void 0:r.overflows)||[];if(d&&E.push(I[x]),h){const q=qy(i,s,k);E.push(I[q[0]],I[q[1]])}if(j=[...j,{placement:i,overflows:E}],!E.every(q=>q<=0)){var O,D;const q=(((O=o.flip)==null?void 0:O.index)||0)+1,J=A[q];if(J){var B;const K=h==="alignment"?y!==qn(J):!1,F=((B=j[0])==null?void 0:B.overflows[0])>0;if(!K||F)return{data:{index:q,overflows:j},reset:{placement:J}}}let W=(D=j.filter(K=>K.overflows[0]<=0).sort((K,F)=>K.overflows[1]-F.overflows[1])[0])==null?void 0:D.placement;if(!W)switch(m){case"bestFit":{var V;const K=(V=j.filter(F=>{if(R){const Q=qn(F.placement);return Q===y||Q==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(Q=>Q>0).reduce((Q,pe)=>Q+pe,0)]).sort((F,Q)=>F[1]-Q[1])[0])==null?void 0:V[0];K&&(W=K);break}case"initialPlacement":W=a;break}if(i!==W)return{reset:{placement:W}}}return{}}}};function u0(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function h0(t){return Hy.some(e=>t[e]>=0)}const Jy=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=Gn(t,e);switch(r){case"referenceHidden":{const o=await Vo(e,{...i,elementContext:"reference"}),s=u0(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:h0(s)}}}case"escaped":{const o=await Vo(e,{...i,altBoundary:!0}),s=u0(o,n.floating);return{data:{escapedOffsets:s,escaped:h0(s)}}}default:return{}}}}};async function e3(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Yn(n),a=Qi(n),l=qn(n)==="y",c=["left","top"].includes(s)?-1:1,d=o&&l?-1:1,h=Gn(e,t);let{mainAxis:f,crossAxis:m,alignmentAxis:g}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof g=="number"&&(m=a==="end"?g*-1:g),l?{x:m*d,y:f*c}:{x:f*c,y:m*d}}const t3=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=e,l=await e3(e,t);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},n3=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:v=>{let{x,y}=v;return{x,y}}},...l}=Gn(t,e),c={x:n,y:r},d=await Vo(e,l),h=qn(Yn(i)),f=rh(h);let m=c[f],g=c[h];if(o){const v=f==="y"?"top":"left",x=f==="y"?"bottom":"right",y=m+d[v],$=m-d[x];m=Ad(y,m,$)}if(s){const v=h==="y"?"top":"left",x=h==="y"?"bottom":"right",y=g+d[v],$=g-d[x];g=Ad(y,g,$)}const b=a.fn({...e,[f]:m,[h]:g});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[f]:o,[h]:s}}}}}},r3=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:o,middlewareData:s}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Gn(t,e),d={x:n,y:r},h=qn(i),f=rh(h);let m=d[f],g=d[h];const b=Gn(a,e),v=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const $=f==="y"?"height":"width",k=o.reference[f]-o.floating[$]+v.mainAxis,S=o.reference[f]+o.reference[$]-v.mainAxis;m<k?m=k:m>S&&(m=S)}if(c){var x,y;const $=f==="y"?"width":"height",k=["top","left"].includes(Yn(i)),S=o.reference[h]-o.floating[$]+(k&&((x=s.offset)==null?void 0:x[h])||0)+(k?0:v.crossAxis),R=o.reference[h]+o.reference[$]+(k?0:((y=s.offset)==null?void 0:y[h])||0)-(k?v.crossAxis:0);g<S?g=S:g>R&&(g=R)}return{[f]:m,[h]:g}}}},i3=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:o,platform:s,elements:a}=e,{apply:l=()=>{},...c}=Gn(t,e),d=await Vo(e,c),h=Yn(i),f=Qi(i),m=qn(i)==="y",{width:g,height:b}=o.floating;let v,x;h==="top"||h==="bottom"?(v=h,x=f===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(x=h,v=f==="end"?"top":"bottom");const y=b-d.top-d.bottom,$=g-d.left-d.right,k=pr(b-d[v],y),S=pr(g-d[x],$),R=!e.middlewareData.shift;let A=k,I=S;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(I=$),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(A=y),R&&!f){const j=Ht(d.left,0),O=Ht(d.right,0),D=Ht(d.top,0),B=Ht(d.bottom,0);m?I=g-2*(j!==0||O!==0?j+O:Ht(d.left,d.right)):A=b-2*(D!==0||B!==0?D+B:Ht(d.top,d.bottom))}await l({...e,availableWidth:I,availableHeight:A});const E=await s.getDimensions(a.floating);return g!==E.width||b!==E.height?{reset:{rects:!0}}:{}}}};function Rl(){return typeof window<"u"}function Zi(t){return Fp(t)?(t.nodeName||"").toLowerCase():"#document"}function Wt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function In(t){var e;return(e=(Fp(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Fp(t){return Rl()?t instanceof Node||t instanceof Wt(t).Node:!1}function sn(t){return Rl()?t instanceof Element||t instanceof Wt(t).Element:!1}function Tn(t){return Rl()?t instanceof HTMLElement||t instanceof Wt(t).HTMLElement:!1}function f0(t){return!Rl()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Wt(t).ShadowRoot}function us(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=an(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function o3(t){return["table","td","th"].includes(Zi(t))}function Tl(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function sh(t){const e=ah(),n=sn(t)?an(t):t;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function s3(t){let e=gr(t);for(;Tn(e)&&!Fi(e);){if(sh(e))return e;if(Tl(e))return null;e=gr(e)}return null}function ah(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Fi(t){return["html","body","#document"].includes(Zi(t))}function an(t){return Wt(t).getComputedStyle(t)}function Ml(t){return sn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function gr(t){if(Zi(t)==="html")return t;const e=t.assignedSlot||t.parentNode||f0(t)&&t.host||In(t);return f0(e)?e.host:e}function Vp(t){const e=gr(t);return Fi(e)?t.ownerDocument?t.ownerDocument.body:t.body:Tn(e)&&us(e)?e:Vp(e)}function _o(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Vp(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=Wt(i);if(o){const a=Td(s);return e.concat(s,s.visualViewport||[],us(i)?i:[],a&&n?_o(a):[])}return e.concat(i,_o(i,[],n))}function Td(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function _p(t){const e=an(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Tn(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,a=Ba(n)!==o||Ba(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function lh(t){return sn(t)?t:t.contextElement}function Ci(t){const e=lh(t);if(!Tn(e))return Sn(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=_p(e);let s=(o?Ba(n.width):n.width)/r,a=(o?Ba(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const a3=Sn(0);function zp(t){const e=Wt(t);return!ah()||!e.visualViewport?a3:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function l3(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Wt(t)?!1:e}function qr(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=lh(t);let s=Sn(1);e&&(r?sn(r)&&(s=Ci(r)):s=Ci(t));const a=l3(o,n,r)?zp(o):Sn(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,d=i.width/s.x,h=i.height/s.y;if(o){const f=Wt(o),m=r&&sn(r)?Wt(r):r;let g=f,b=Td(g);for(;b&&r&&m!==g;){const v=Ci(b),x=b.getBoundingClientRect(),y=an(b),$=x.left+(b.clientLeft+parseFloat(y.paddingLeft))*v.x,k=x.top+(b.clientTop+parseFloat(y.paddingTop))*v.y;l*=v.x,c*=v.y,d*=v.x,h*=v.y,l+=$,c+=k,g=Wt(b),b=Td(g)}}return Va({width:d,height:h,x:l,y:c})}function ch(t,e){const n=Ml(t).scrollLeft;return e?e.left+n:qr(In(t)).left+n}function Hp(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:ch(t,r)),o=r.top+e.scrollTop;return{x:i,y:o}}function c3(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",s=In(r),a=e?Tl(e.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},c=Sn(1);const d=Sn(0),h=Tn(r);if((h||!h&&!o)&&((Zi(r)!=="body"||us(s))&&(l=Ml(r)),Tn(r))){const m=qr(r);c=Ci(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const f=s&&!h&&!o?Hp(s,l,!0):Sn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+f.x,y:n.y*c.y-l.scrollTop*c.y+d.y+f.y}}function d3(t){return Array.from(t.getClientRects())}function u3(t){const e=In(t),n=Ml(t),r=t.ownerDocument.body,i=Ht(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Ht(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+ch(t);const a=-n.scrollTop;return an(r).direction==="rtl"&&(s+=Ht(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function h3(t,e){const n=Wt(t),r=In(t),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const c=ah();(!c||c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}function f3(t,e){const n=qr(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=Tn(t)?Ci(t):Sn(1),s=t.clientWidth*o.x,a=t.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:s,height:a,x:l,y:c}}function m0(t,e,n){let r;if(e==="viewport")r=h3(t,n);else if(e==="document")r=u3(In(t));else if(sn(e))r=f3(e,n);else{const i=zp(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Va(r)}function Pp(t,e){const n=gr(t);return n===e||!sn(n)||Fi(n)?!1:an(n).position==="fixed"||Pp(n,e)}function m3(t,e){const n=e.get(t);if(n)return n;let r=_o(t,[],!1).filter(a=>sn(a)&&Zi(a)!=="body"),i=null;const o=an(t).position==="fixed";let s=o?gr(t):t;for(;sn(s)&&!Fi(s);){const a=an(s),l=sh(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||us(s)&&!l&&Pp(t,s))?r=r.filter(d=>d!==s):i=a,s=gr(s)}return e.set(t,r),r}function p3(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?Tl(e)?[]:m3(e,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,d)=>{const h=m0(e,d,i);return c.top=Ht(h.top,c.top),c.right=pr(h.right,c.right),c.bottom=pr(h.bottom,c.bottom),c.left=Ht(h.left,c.left),c},m0(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function g3(t){const{width:e,height:n}=_p(t);return{width:e,height:n}}function b3(t,e,n){const r=Tn(e),i=In(e),o=n==="fixed",s=qr(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=Sn(0);function c(){l.x=ch(i)}if(r||!r&&!o)if((Zi(e)!=="body"||us(i))&&(a=Ml(e)),r){const m=qr(e,!0,o,e);l.x=m.x+e.clientLeft,l.y=m.y+e.clientTop}else i&&c();o&&!r&&i&&c();const d=i&&!r&&!o?Hp(i,a):Sn(0),h=s.left+a.scrollLeft-l.x-d.x,f=s.top+a.scrollTop-l.y-d.y;return{x:h,y:f,width:s.width,height:s.height}}function $c(t){return an(t).position==="static"}function p0(t,e){if(!Tn(t)||an(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return In(t)===n&&(n=n.ownerDocument.body),n}function Wp(t,e){const n=Wt(t);if(Tl(t))return n;if(!Tn(t)){let i=gr(t);for(;i&&!Fi(i);){if(sn(i)&&!$c(i))return i;i=gr(i)}return n}let r=p0(t,e);for(;r&&o3(r)&&$c(r);)r=p0(r,e);return r&&Fi(r)&&$c(r)&&!sh(r)?n:r||s3(t)||n}const v3=async function(t){const e=this.getOffsetParent||Wp,n=this.getDimensions,r=await n(t.floating);return{reference:b3(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function x3(t){return an(t).direction==="rtl"}const w3={convertOffsetParentRelativeRectToViewportRelativeRect:c3,getDocumentElement:In,getClippingRect:p3,getOffsetParent:Wp,getElementRects:v3,getClientRects:d3,getDimensions:g3,getScale:Ci,isElement:sn,isRTL:x3};function qp(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function y3(t,e){let n=null,r;const i=In(t);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const c=t.getBoundingClientRect(),{left:d,top:h,width:f,height:m}=c;if(a||e(),!f||!m)return;const g=Ls(h),b=Ls(i.clientWidth-(d+f)),v=Ls(i.clientHeight-(h+m)),x=Ls(d),$={rootMargin:-g+"px "+-b+"px "+-v+"px "+-x+"px",threshold:Ht(0,pr(1,l))||1};let k=!0;function S(R){const A=R[0].intersectionRatio;if(A!==l){if(!k)return s();A?s(!1,A):r=setTimeout(()=>{s(!1,1e-7)},1e3)}A===1&&!qp(c,t.getBoundingClientRect())&&s(),k=!1}try{n=new IntersectionObserver(S,{...$,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,$)}n.observe(t)}return s(!0),o}function Up(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=lh(t),d=i||o?[...c?_o(c):[],..._o(e)]:[];d.forEach(x=>{i&&x.addEventListener("scroll",n,{passive:!0}),o&&x.addEventListener("resize",n)});const h=c&&a?y3(c,n):null;let f=-1,m=null;s&&(m=new ResizeObserver(x=>{let[y]=x;y&&y.target===c&&m&&(m.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var $;($=m)==null||$.observe(e)})),n()}),c&&!l&&m.observe(c),m.observe(e));let g,b=l?qr(t):null;l&&v();function v(){const x=qr(t);b&&!qp(b,x)&&n(),b=x,g=requestAnimationFrame(v)}return n(),()=>{var x;d.forEach(y=>{i&&y.removeEventListener("scroll",n),o&&y.removeEventListener("resize",n)}),h?.(),(x=m)==null||x.disconnect(),m=null,l&&cancelAnimationFrame(g)}}const Kp=t3,Gp=n3,Yp=Zy,C3=i3,$3=Jy,g0=Qy,S3=r3,Xp=(t,e,n)=>{const r=new Map,i={platform:w3,...n},o={...i.platform,_c:r};return Xy(t,e,{...i,platform:o})};var xa=typeof document<"u"?p.useLayoutEffect:p.useEffect;function _a(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!_a(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&t.$$typeof)&&!_a(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function Qp(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function b0(t,e){const n=Qp(t);return Math.round(e*n)/n}function Sc(t){const e=w.useRef(t);return xa(()=>{e.current=t}),e}function k3(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=t,[d,h]=w.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,m]=w.useState(r);_a(f,r)||m(r);const[g,b]=w.useState(null),[v,x]=w.useState(null),y=w.useCallback(K=>{K!==R.current&&(R.current=K,b(K))},[]),$=w.useCallback(K=>{K!==A.current&&(A.current=K,x(K))},[]),k=o||g,S=s||v,R=w.useRef(null),A=w.useRef(null),I=w.useRef(d),E=l!=null,j=Sc(l),O=Sc(i),D=Sc(c),B=w.useCallback(()=>{if(!R.current||!A.current)return;const K={placement:e,strategy:n,middleware:f};O.current&&(K.platform=O.current),Xp(R.current,A.current,K).then(F=>{const Q={...F,isPositioned:D.current!==!1};V.current&&!_a(I.current,Q)&&(I.current=Q,ei.flushSync(()=>{h(Q)}))})},[f,e,n,O,D]);xa(()=>{c===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,h(K=>({...K,isPositioned:!1})))},[c]);const V=w.useRef(!1);xa(()=>(V.current=!0,()=>{V.current=!1}),[]),xa(()=>{if(k&&(R.current=k),S&&(A.current=S),k&&S){if(j.current)return j.current(k,S,B);B()}},[k,S,B,j,E]);const q=w.useMemo(()=>({reference:R,floating:A,setReference:y,setFloating:$}),[y,$]),J=w.useMemo(()=>({reference:k,floating:S}),[k,S]),W=w.useMemo(()=>{const K={position:n,left:0,top:0};if(!J.floating)return K;const F=b0(J.floating,d.x),Q=b0(J.floating,d.y);return a?{...K,transform:"translate("+F+"px, "+Q+"px)",...Qp(J.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:Q}},[n,a,J.floating,d.x,d.y]);return w.useMemo(()=>({...d,update:B,refs:q,elements:J,floatingStyles:W}),[d,B,q,J,W])}const A3=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?g0({element:r.current,padding:i}).fn(n):{}:r?g0({element:r,padding:i}).fn(n):{}}}},R3=(t,e)=>({...Kp(t),options:[t,e]}),T3=(t,e)=>({...Gp(t),options:[t,e]}),M3=(t,e)=>({...S3(t),options:[t,e]}),E3=(t,e)=>({...Yp(t),options:[t,e]}),I3=(t,e)=>({...C3(t),options:[t,e]}),j3=(t,e)=>({...$3(t),options:[t,e]}),D3=(t,e)=>({...A3(t),options:[t,e]}),O3=p.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...o}=t;return p.createElement(ge.svg,N({},o,{ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),t.asChild?n:p.createElement("polygon",{points:"0,0 30,0 15,10"}))}),L3=O3;function El(t){const[e,n]=p.useState(void 0);return Ke(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,a;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=t.offsetWidth,a=t.offsetHeight;n({width:s,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}const Zp="Popper",[Jp,Sr]=et(Zp),[N3,eg]=Jp(Zp),B3=t=>{const{__scopePopper:e,children:n}=t,[r,i]=p.useState(null);return p.createElement(N3,{scope:e,anchor:r,onAnchorChange:i},n)},F3="PopperAnchor",V3=p.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,o=eg(F3,n),s=p.useRef(null),a=ye(e,s);return p.useEffect(()=>{o.onAnchorChange(r?.current||s.current)}),r?null:p.createElement(ge.div,N({},i,{ref:a}))}),tg="PopperContent",[_3,z3]=Jp(tg),H3=p.forwardRef((t,e)=>{var n,r,i,o,s,a,l,c;const{__scopePopper:d,side:h="bottom",sideOffset:f=0,align:m="center",alignOffset:g=0,arrowPadding:b=0,avoidCollisions:v=!0,collisionBoundary:x=[],collisionPadding:y=0,sticky:$="partial",hideWhenDetached:k=!1,updatePositionStrategy:S="optimized",onPlaced:R,...A}=t,I=eg(tg,d),[E,j]=p.useState(null),O=ye(e,$e=>j($e)),[D,B]=p.useState(null),V=El(D),q=(n=V?.width)!==null&&n!==void 0?n:0,J=(r=V?.height)!==null&&r!==void 0?r:0,W=h+(m!=="center"?"-"+m:""),K=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},F=Array.isArray(x)?x:[x],Q=F.length>0,pe={padding:K,boundary:F.filter(U3),altBoundary:Q},{refs:we,floatingStyles:ce,placement:Ce,isPositioned:P,middlewareData:oe}=k3({strategy:"fixed",placement:W,whileElementsMounted:(...$e)=>Up(...$e,{animationFrame:S==="always"}),elements:{reference:I.anchor},middleware:[R3({mainAxis:f+J,alignmentAxis:g}),v&&T3({mainAxis:!0,crossAxis:!1,limiter:$==="partial"?M3():void 0,...pe}),v&&E3({...pe}),I3({...pe,apply:({elements:$e,rects:Be,availableWidth:se,availableHeight:Ee})=>{const{width:Ge,height:U}=Be.reference,ve=$e.floating.style;ve.setProperty("--radix-popper-available-width",`${se}px`),ve.setProperty("--radix-popper-available-height",`${Ee}px`),ve.setProperty("--radix-popper-anchor-width",`${Ge}px`),ve.setProperty("--radix-popper-anchor-height",`${U}px`)}}),D&&D3({element:D,padding:b}),K3({arrowWidth:q,arrowHeight:J}),k&&j3({strategy:"referenceHidden",...pe})]}),[_,G]=ng(Ce),Z=nt(R);Ke(()=>{P&&Z?.()},[P,Z]);const ne=(i=oe.arrow)===null||i===void 0?void 0:i.x,ae=(o=oe.arrow)===null||o===void 0?void 0:o.y,be=((s=oe.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[le,Le]=p.useState();return Ke(()=>{E&&Le(window.getComputedStyle(E).zIndex)},[E]),p.createElement("div",{ref:we.setFloating,"data-radix-popper-content-wrapper":"",style:{...ce,transform:P?ce.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:le,"--radix-popper-transform-origin":[(a=oe.transformOrigin)===null||a===void 0?void 0:a.x,(l=oe.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:t.dir},p.createElement(_3,{scope:d,placedSide:_,onArrowChange:B,arrowX:ne,arrowY:ae,shouldHideArrow:be},p.createElement(ge.div,N({"data-side":_,"data-align":G},A,{ref:O,style:{...A.style,animation:P?void 0:"none",opacity:(c=oe.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))}),P3="PopperArrow",W3={top:"bottom",right:"left",bottom:"top",left:"right"},q3=p.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,o=z3(P3,r),s=W3[o.placedSide];return p.createElement("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0}},p.createElement(L3,N({},i,{ref:n,style:{...i.style,display:"block"}})))});function U3(t){return t!==null}const K3=t=>({name:"transformOrigin",options:t,fn(e){var n,r,i,o,s;const{placement:a,rects:l,middlewareData:c}=e,h=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,f=h?0:t.arrowWidth,m=h?0:t.arrowHeight,[g,b]=ng(a),v={start:"0%",center:"50%",end:"100%"}[b],x=((r=(i=c.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+f/2,y=((o=(s=c.arrow)===null||s===void 0?void 0:s.y)!==null&&o!==void 0?o:0)+m/2;let $="",k="";return g==="bottom"?($=h?v:`${x}px`,k=`${-m}px`):g==="top"?($=h?v:`${x}px`,k=`${l.floating.height+m}px`):g==="right"?($=`${-m}px`,k=h?v:`${y}px`):g==="left"&&($=`${l.floating.width+m}px`,k=h?v:`${y}px`),{data:{x:$,y:k}}}});function ng(t){const[e,n="center"]=t.split("-");return[e,n]}const Il=B3,hs=V3,fs=H3,G3=q3,Ji=p.forwardRef((t,e)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...i}=t;return r?ei.default.createPortal(p.createElement(ge.div,N({},i,{ref:e})),r):null});function Y3(t,e){return p.useReducer((n,r)=>{const i=e[n][r];return i??n},t)}const at=t=>{const{present:e,children:n}=t,r=X3(e),i=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),o=ye(r.ref,i.ref);return typeof n=="function"||r.isPresent?p.cloneElement(i,{ref:o}):null};at.displayName="Presence";function X3(t){const[e,n]=p.useState(),r=p.useRef({}),i=p.useRef(t),o=p.useRef("none"),s=t?"mounted":"unmounted",[a,l]=Y3(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const c=Ns(r.current);o.current=a==="mounted"?c:"none"},[a]),Ke(()=>{const c=r.current,d=i.current;if(d!==t){const f=o.current,m=Ns(c);t?l("MOUNT"):m==="none"||c?.display==="none"?l("UNMOUNT"):l(d&&f!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),Ke(()=>{if(e){const c=h=>{const m=Ns(r.current).includes(h.animationName);h.target===e&&m&&ds.flushSync(()=>l("ANIMATION_END"))},d=h=>{h.target===e&&(o.current=Ns(r.current))};return e.addEventListener("animationstart",d),e.addEventListener("animationcancel",c),e.addEventListener("animationend",c),()=>{e.removeEventListener("animationstart",d),e.removeEventListener("animationcancel",c),e.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:p.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Ns(t){return t?.animationName||"none"}function mt({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=Q3({defaultProp:e,onChange:n}),o=t!==void 0,s=o?t:r,a=nt(n),l=p.useCallback(c=>{if(o){const h=typeof c=="function"?c(t):c;h!==t&&a(h)}else i(c)},[o,t,i,a]);return[s,l]}function Q3({defaultProp:t,onChange:e}){const n=p.useState(t),[r]=n,i=p.useRef(r),o=nt(e);return p.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const rg=p.forwardRef((t,e)=>p.createElement(ge.span,N({},t,{ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}))),Z3=rg,[jl,KH]=et("Tooltip",[Sr]),dh=Sr(),J3="TooltipProvider",e6=700,Md="tooltip.open",[t6,uh]=jl(J3),n6=t=>{const{__scopeTooltip:e,delayDuration:n=e6,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=t,[s,a]=p.useState(!0),l=p.useRef(!1),c=p.useRef(0);return p.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),p.createElement(t6,{scope:e,isOpenDelayed:s,delayDuration:n,onOpen:p.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:p.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:p.useCallback(d=>{l.current=d},[]),disableHoverableContent:i},o)},hh="Tooltip",[r6,ms]=jl(hh),i6=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:i=!1,onOpenChange:o,disableHoverableContent:s,delayDuration:a}=t,l=uh(hh,t.__scopeTooltip),c=dh(e),[d,h]=p.useState(null),f=gt(),m=p.useRef(0),g=s??l.disableHoverableContent,b=a??l.delayDuration,v=p.useRef(!1),[x=!1,y]=mt({prop:r,defaultProp:i,onChange:A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(Md))):l.onClose(),o?.(A)}}),$=p.useMemo(()=>x?v.current?"delayed-open":"instant-open":"closed",[x]),k=p.useCallback(()=>{window.clearTimeout(m.current),v.current=!1,y(!0)},[y]),S=p.useCallback(()=>{window.clearTimeout(m.current),y(!1)},[y]),R=p.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{v.current=!0,y(!0)},b)},[b,y]);return p.useEffect(()=>()=>window.clearTimeout(m.current),[]),p.createElement(Il,c,p.createElement(r6,{scope:e,contentId:f,open:x,stateAttribute:$,trigger:d,onTriggerChange:h,onTriggerEnter:p.useCallback(()=>{l.isOpenDelayed?R():k()},[l.isOpenDelayed,R,k]),onTriggerLeave:p.useCallback(()=>{g?S():window.clearTimeout(m.current)},[S,g]),onOpen:k,onClose:S,disableHoverableContent:g},n))},v0="TooltipTrigger",o6=p.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=ms(v0,n),o=uh(v0,n),s=dh(n),a=p.useRef(null),l=ye(e,a,i.onTriggerChange),c=p.useRef(!1),d=p.useRef(!1),h=p.useCallback(()=>c.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),p.createElement(hs,N({asChild:!0},s),p.createElement(ge.button,N({"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute},r,{ref:l,onPointerMove:X(t.onPointerMove,f=>{f.pointerType!=="touch"&&!d.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:X(t.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:X(t.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:X(t.onFocus,()=>{c.current||i.onOpen()}),onBlur:X(t.onBlur,i.onClose),onClick:X(t.onClick,i.onClose)})))}),ig="TooltipPortal",[s6,a6]=jl(ig,{forceMount:void 0}),l6=t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:i}=t,o=ms(ig,e);return p.createElement(s6,{scope:e,forceMount:n},p.createElement(at,{present:n||o.open},p.createElement(Ji,{asChild:!0,container:i},r)))},zo="TooltipContent",c6=p.forwardRef((t,e)=>{const n=a6(zo,t.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=t,s=ms(zo,t.__scopeTooltip);return p.createElement(at,{present:r||s.open},s.disableHoverableContent?p.createElement(og,N({side:i},o,{ref:e})):p.createElement(d6,N({side:i},o,{ref:e})))}),d6=p.forwardRef((t,e)=>{const n=ms(zo,t.__scopeTooltip),r=uh(zo,t.__scopeTooltip),i=p.useRef(null),o=ye(e,i),[s,a]=p.useState(null),{trigger:l,onClose:c}=n,d=i.current,{onPointerInTransitChange:h}=r,f=p.useCallback(()=>{a(null),h(!1)},[h]),m=p.useCallback((g,b)=>{const v=g.currentTarget,x={x:g.clientX,y:g.clientY},y=h6(x,v.getBoundingClientRect()),$=f6(x,y),k=m6(b.getBoundingClientRect()),S=g6([...$,...k]);a(S),h(!0)},[h]);return p.useEffect(()=>()=>f(),[f]),p.useEffect(()=>{if(l&&d){const g=v=>m(v,d),b=v=>m(v,l);return l.addEventListener("pointerleave",g),d.addEventListener("pointerleave",b),()=>{l.removeEventListener("pointerleave",g),d.removeEventListener("pointerleave",b)}}},[l,d,m,f]),p.useEffect(()=>{if(s){const g=b=>{const v=b.target,x={x:b.clientX,y:b.clientY},y=l?.contains(v)||d?.contains(v),$=!p6(x,s);y?f():$&&(f(),c())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[l,d,s,c,f]),p.createElement(og,N({},t,{ref:o}))}),[u6,GH]=jl(hh,{isInside:!1}),og=p.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:s,...a}=t,l=ms(zo,n),c=dh(n),{onClose:d}=l;return p.useEffect(()=>(document.addEventListener(Md,d),()=>document.removeEventListener(Md,d)),[d]),p.useEffect(()=>{if(l.trigger){const h=f=>{const m=f.target;m!=null&&m.contains(l.trigger)&&d()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[l.trigger,d]),p.createElement(ti,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:h=>h.preventDefault(),onDismiss:d},p.createElement(fs,N({"data-state":l.stateAttribute},c,a,{ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),p.createElement(nh,null,r),p.createElement(u6,{scope:n,isInside:!0},p.createElement(Z3,{id:l.contentId,role:"tooltip"},i||r))))});function h6(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),o=Math.abs(e.left-t.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function f6(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function m6(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function p6(t,e){const{x:n,y:r}=t;let i=!1;for(let o=0,s=e.length-1;o<e.length;s=o++){const a=e[o].x,l=e[o].y,c=e[s].x,d=e[s].y;l>r!=d>r&&n<(c-a)*(r-l)/(d-l)+a&&(i=!i)}return i}function g6(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),b6(e)}function b6(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const i=t[r];for(;e.length>=2;){const o=e[e.length-1],s=e[e.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const o=n[n.length-1],s=n[n.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}const v6=n6,sg=i6,ag=o6,lg=l6,cg=c6;let kc=0;function eo(){p.useEffect(()=>{var t,e;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=n[0])!==null&&t!==void 0?t:x0()),document.body.insertAdjacentElement("beforeend",(e=n[1])!==null&&e!==void 0?e:x0()),kc++,()=>{kc===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),kc--}},[])}function x0(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}const Ac="focusScope.autoFocusOnMount",Rc="focusScope.autoFocusOnUnmount",w0={bubbles:!1,cancelable:!0},to=p.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=t,[a,l]=p.useState(null),c=nt(i),d=nt(o),h=p.useRef(null),f=ye(e,b=>l(b)),m=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let b=function($){if(m.paused||!a)return;const k=$.target;a.contains(k)?h.current=k:or(h.current,{select:!0})},v=function($){if(m.paused||!a)return;const k=$.relatedTarget;k!==null&&(a.contains(k)||or(h.current,{select:!0}))},x=function($){if(document.activeElement===document.body)for(const S of $)S.removedNodes.length>0&&or(a)};document.addEventListener("focusin",b),document.addEventListener("focusout",v);const y=new MutationObserver(x);return a&&y.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",v),y.disconnect()}}},[r,a,m.paused]),p.useEffect(()=>{if(a){C0.add(m);const b=document.activeElement;if(!a.contains(b)){const x=new CustomEvent(Ac,w0);a.addEventListener(Ac,c),a.dispatchEvent(x),x.defaultPrevented||(x6(S6(dg(a)),{select:!0}),document.activeElement===b&&or(a))}return()=>{a.removeEventListener(Ac,c),setTimeout(()=>{const x=new CustomEvent(Rc,w0);a.addEventListener(Rc,d),a.dispatchEvent(x),x.defaultPrevented||or(b??document.body,{select:!0}),a.removeEventListener(Rc,d),C0.remove(m)},0)}}},[a,c,d,m]);const g=p.useCallback(b=>{if(!n&&!r||m.paused)return;const v=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,x=document.activeElement;if(v&&x){const y=b.currentTarget,[$,k]=w6(y);$&&k?!b.shiftKey&&x===k?(b.preventDefault(),n&&or($,{select:!0})):b.shiftKey&&x===$&&(b.preventDefault(),n&&or(k,{select:!0})):x===y&&b.preventDefault()}},[n,r,m.paused]);return p.createElement(ge.div,N({tabIndex:-1},s,{ref:f,onKeyDown:g}))});function x6(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(or(r,{select:e}),document.activeElement!==n)return}function w6(t){const e=dg(t),n=y0(e,t),r=y0(e.reverse(),t);return[n,r]}function dg(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function y0(t,e){for(const n of t)if(!y6(n,{upTo:e}))return n}function y6(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function C6(t){return t instanceof HTMLInputElement&&"select"in t}function or(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&C6(t)&&e&&t.select()}}const C0=$6();function $6(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=$0(t,e),t.unshift(e)},remove(e){var n;t=$0(t,e),(n=t[0])===null||n===void 0||n.resume()}}}function $0(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function S6(t){return t.filter(e=>e.tagName!=="A")}var k6=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},ai=new WeakMap,Bs=new WeakMap,Fs={},Tc=0,ug=function(t){return t&&(t.host||ug(t.parentNode))},A6=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=ug(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},R6=function(t,e,n,r){var i=A6(e,Array.isArray(t)?t:[t]);Fs[n]||(Fs[n]=new WeakMap);var o=Fs[n],s=[],a=new Set,l=new Set(i),c=function(h){!h||a.has(h)||(a.add(h),c(h.parentNode))};i.forEach(c);var d=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(f){if(a.has(f))d(f);else try{var m=f.getAttribute(r),g=m!==null&&m!=="false",b=(ai.get(f)||0)+1,v=(o.get(f)||0)+1;ai.set(f,b),o.set(f,v),s.push(f),b===1&&g&&Bs.set(f,!0),v===1&&f.setAttribute(n,"true"),g||f.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",f,x)}})};return d(e),a.clear(),Tc++,function(){s.forEach(function(h){var f=ai.get(h)-1,m=o.get(h)-1;ai.set(h,f),o.set(h,m),f||(Bs.has(h)||h.removeAttribute(r),Bs.delete(h)),m||h.removeAttribute(n)}),Tc--,Tc||(ai=new WeakMap,ai=new WeakMap,Bs=new WeakMap,Fs={})}},ps=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=k6(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),R6(r,i,n,"aria-hidden")):function(){return null}},Ye=function(){return Ye=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Ye.apply(this,arguments)};function Dl(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function fh(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}var $i="right-scroll-bar-position",Si="width-before-scroll-bar",T6="with-scroll-bars-hidden",M6="--removed-body-scroll-bar-size";function Mc(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function E6(t,e){var n=p.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=e,n.facade}var I6=typeof window<"u"?w.useLayoutEffect:w.useEffect,S0=new WeakMap;function mh(t,e){var n=E6(null,function(r){return t.forEach(function(i){return Mc(i,r)})});return I6(function(){var r=S0.get(n);if(r){var i=new Set(r),o=new Set(t),s=n.current;i.forEach(function(a){o.has(a)||Mc(a,null)}),o.forEach(function(a){i.has(a)||Mc(a,s)})}S0.set(n,t)},[t]),n}function j6(t){return t}function D6(t,e){e===void 0&&(e=j6);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(o){var s=e(o,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(o),s=n}var l=function(){var d=s;s=[],d.forEach(o)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(d){s.push(d),c()},filter:function(d){return s=s.filter(d),n}}}};return i}function ph(t){t===void 0&&(t={});var e=D6(null);return e.options=Ye({async:!0,ssr:!1},t),e}var hg=function(t){var e=t.sideCar,n=Dl(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return w.createElement(r,Ye({},n))};hg.isSideCarExport=!0;function gh(t,e){return t.useMedium(e),hg}var fg=ph(),Ec=function(){},Ol=w.forwardRef(function(t,e){var n=w.useRef(null),r=w.useState({onScrollCapture:Ec,onWheelCapture:Ec,onTouchMoveCapture:Ec}),i=r[0],o=r[1],s=t.forwardProps,a=t.children,l=t.className,c=t.removeScrollBar,d=t.enabled,h=t.shards,f=t.sideCar,m=t.noIsolation,g=t.inert,b=t.allowPinchZoom,v=t.as,x=v===void 0?"div":v,y=t.gapMode,$=Dl(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=f,S=mh([n,e]),R=Ye(Ye({},$),i);return w.createElement(w.Fragment,null,d&&w.createElement(k,{sideCar:fg,removeScrollBar:c,shards:h,noIsolation:m,inert:g,setCallbacks:o,allowPinchZoom:!!b,lockRef:n,gapMode:y}),s?w.cloneElement(w.Children.only(a),Ye(Ye({},R),{ref:S})):w.createElement(x,Ye({},R,{className:l,ref:S}),a))});Ol.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ol.classNames={fullWidth:Si,zeroRight:$i};var O6=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function L6(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=O6();return e&&t.setAttribute("nonce",e),t}function N6(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function B6(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var F6=function(){var t=0,e=null;return{add:function(n){t==0&&(e=L6())&&(N6(e,n),B6(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},V6=function(){var t=F6();return function(e,n){w.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},Ll=function(){var t=V6(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},_6={left:0,top:0,right:0,gap:0},Ic=function(t){return parseInt(t||"",10)||0},z6=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[Ic(n),Ic(r),Ic(i)]},H6=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return _6;var e=z6(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},P6=Ll(),ki="data-scroll-locked",W6=function(t,e,n,r){var i=t.left,o=t.top,s=t.right,a=t.gap;return n===void 0&&(n="margin"),`
|
|
8
|
+
.`.concat(T6,` {
|
|
9
|
+
overflow: hidden `).concat(r,`;
|
|
10
|
+
padding-right: `).concat(a,"px ").concat(r,`;
|
|
11
|
+
}
|
|
12
|
+
body[`).concat(ki,`] {
|
|
13
|
+
overflow: hidden `).concat(r,`;
|
|
14
|
+
overscroll-behavior: contain;
|
|
15
|
+
`).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
16
|
+
padding-left: `.concat(i,`px;
|
|
17
|
+
padding-top: `).concat(o,`px;
|
|
18
|
+
padding-right: `).concat(s,`px;
|
|
19
|
+
margin-left:0;
|
|
20
|
+
margin-top:0;
|
|
21
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
22
|
+
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.`).concat($i,` {
|
|
26
|
+
right: `).concat(a,"px ").concat(r,`;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.`).concat(Si,` {
|
|
30
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.`).concat($i," .").concat($i,` {
|
|
34
|
+
right: 0 `).concat(r,`;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.`).concat(Si," .").concat(Si,` {
|
|
38
|
+
margin-right: 0 `).concat(r,`;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
body[`).concat(ki,`] {
|
|
42
|
+
`).concat(M6,": ").concat(a,`px;
|
|
43
|
+
}
|
|
44
|
+
`)},k0=function(){var t=parseInt(document.body.getAttribute(ki)||"0",10);return isFinite(t)?t:0},q6=function(){w.useEffect(function(){return document.body.setAttribute(ki,(k0()+1).toString()),function(){var t=k0()-1;t<=0?document.body.removeAttribute(ki):document.body.setAttribute(ki,t.toString())}},[])},bh=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;q6();var o=w.useMemo(function(){return H6(i)},[i]);return w.createElement(P6,{styles:W6(o,!e,i,n?"":"!important")})},Ed=!1;if(typeof window<"u")try{var Vs=Object.defineProperty({},"passive",{get:function(){return Ed=!0,!0}});window.addEventListener("test",Vs,Vs),window.removeEventListener("test",Vs,Vs)}catch{Ed=!1}var li=Ed?{passive:!1}:!1,U6=function(t){return t.tagName==="TEXTAREA"},mg=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!U6(t)&&n[e]==="visible")},K6=function(t){return mg(t,"overflowY")},G6=function(t){return mg(t,"overflowX")},A0=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=pg(t,r);if(i){var o=gg(t,r),s=o[1],a=o[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Y6=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},X6=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},pg=function(t,e){return t==="v"?K6(e):G6(e)},gg=function(t,e){return t==="v"?Y6(e):X6(e)},Q6=function(t,e){return t==="h"&&e==="rtl"?-1:1},Z6=function(t,e,n,r,i){var o=Q6(t,window.getComputedStyle(e).direction),s=o*r,a=n.target,l=e.contains(a),c=!1,d=s>0,h=0,f=0;do{var m=gg(t,a),g=m[0],b=m[1],v=m[2],x=b-v-o*g;(g||x)&&pg(t,a)&&(h+=x,f+=g),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(d&&Math.abs(h)<1||!d&&Math.abs(f)<1)&&(c=!0),c},_s=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},R0=function(t){return[t.deltaX,t.deltaY]},T0=function(t){return t&&"current"in t?t.current:t},J6=function(t,e){return t[0]===e[0]&&t[1]===e[1]},e4=function(t){return`
|
|
45
|
+
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
46
|
+
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
47
|
+
`)},t4=0,ci=[];function n4(t){var e=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),i=w.useState(t4++)[0],o=w.useState(Ll)[0],s=w.useRef(t);w.useEffect(function(){s.current=t},[t]),w.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var b=fh([t.lockRef.current],(t.shards||[]).map(T0),!0).filter(Boolean);return b.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),b.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=w.useCallback(function(b,v){if("touches"in b&&b.touches.length===2)return!s.current.allowPinchZoom;var x=_s(b),y=n.current,$="deltaX"in b?b.deltaX:y[0]-x[0],k="deltaY"in b?b.deltaY:y[1]-x[1],S,R=b.target,A=Math.abs($)>Math.abs(k)?"h":"v";if("touches"in b&&A==="h"&&R.type==="range")return!1;var I=A0(A,R);if(!I)return!0;if(I?S=A:(S=A==="v"?"h":"v",I=A0(A,R)),!I)return!1;if(!r.current&&"changedTouches"in b&&($||k)&&(r.current=S),!S)return!0;var E=r.current||S;return Z6(E,v,b,E==="h"?$:k)},[]),l=w.useCallback(function(b){var v=b;if(!(!ci.length||ci[ci.length-1]!==o)){var x="deltaY"in v?R0(v):_s(v),y=e.current.filter(function(S){return S.name===v.type&&(S.target===v.target||v.target===S.shadowParent)&&J6(S.delta,x)})[0];if(y&&y.should){v.cancelable&&v.preventDefault();return}if(!y){var $=(s.current.shards||[]).map(T0).filter(Boolean).filter(function(S){return S.contains(v.target)}),k=$.length>0?a(v,$[0]):!s.current.noIsolation;k&&v.cancelable&&v.preventDefault()}}},[]),c=w.useCallback(function(b,v,x,y){var $={name:b,delta:v,target:x,should:y,shadowParent:r4(x)};e.current.push($),setTimeout(function(){e.current=e.current.filter(function(k){return k!==$})},1)},[]),d=w.useCallback(function(b){n.current=_s(b),r.current=void 0},[]),h=w.useCallback(function(b){c(b.type,R0(b),b.target,a(b,t.lockRef.current))},[]),f=w.useCallback(function(b){c(b.type,_s(b),b.target,a(b,t.lockRef.current))},[]);w.useEffect(function(){return ci.push(o),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",l,li),document.addEventListener("touchmove",l,li),document.addEventListener("touchstart",d,li),function(){ci=ci.filter(function(b){return b!==o}),document.removeEventListener("wheel",l,li),document.removeEventListener("touchmove",l,li),document.removeEventListener("touchstart",d,li)}},[]);var m=t.removeScrollBar,g=t.inert;return w.createElement(w.Fragment,null,g?w.createElement(o,{styles:e4(i)}):null,m?w.createElement(bh,{gapMode:t.gapMode}):null)}function r4(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const i4=gh(fg,n4);var vh=w.forwardRef(function(t,e){return w.createElement(Ol,Ye({},t,{ref:e,sideCar:i4}))});vh.classNames=Ol.classNames;function Id(t,[e,n]){return Math.min(n,Math.max(e,t))}function Nl(t){const e=t+"CollectionProvider",[n,r]=et(e),[i,o]=n(e,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:g,children:b}=m,v=w.default.useRef(null),x=w.default.useRef(new Map).current;return w.default.createElement(i,{scope:g,itemMap:x,collectionRef:v},b)},a=t+"CollectionSlot",l=w.default.forwardRef((m,g)=>{const{scope:b,children:v}=m,x=o(a,b),y=ye(g,x.collectionRef);return w.default.createElement(Rn,{ref:y},v)}),c=t+"CollectionItemSlot",d="data-radix-collection-item",h=w.default.forwardRef((m,g)=>{const{scope:b,children:v,...x}=m,y=w.default.useRef(null),$=ye(g,y),k=o(c,b);return w.default.useEffect(()=>(k.itemMap.set(y,{ref:y,...x}),()=>void k.itemMap.delete(y))),w.default.createElement(Rn,{[d]:"",ref:$},v)});function f(m){const g=o(t+"CollectionConsumer",m);return w.default.useCallback(()=>{const v=g.collectionRef.current;if(!v)return[];const x=Array.from(v.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((k,S)=>x.indexOf(k.ref.current)-x.indexOf(S.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:s,Slot:l,ItemSlot:h},f,r]}const o4=p.createContext(void 0);function ni(t){const e=p.useContext(o4);return t||e||"ltr"}function Bl(t){const e=p.useRef({value:t,previous:t});return p.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function s4(t){const e=`${t}CollectionProvider`,[n,r]=et(e),[i,o]=n(e,{collectionRef:{current:null},itemMap:new Map,listeners:new Set}),s=m=>{const{scope:g,children:b}=m,v=w.useRef(null),x=w.useRef(new Map).current,y=w.useRef(new Set).current;return u.jsx(i,{scope:g,itemMap:x,collectionRef:v,listeners:y,children:b})};s.displayName=e;const a=`${t}CollectionSlot`,l=w.forwardRef((m,g)=>{const{scope:b,children:v}=m,x=o(a,b),y=ye(g,x.collectionRef);return u.jsx(Rn,{ref:y,children:v})});l.displayName=a;const c=`${t}CollectionItemSlot`,d="data-radix-collection-item",h=w.forwardRef((m,g)=>{const{scope:b,children:v,...x}=m,y=w.useRef(null),$=ye(g,y),k=o(c,b);return w.useEffect(()=>{const S=Array.from(k.itemMap.values());return k.itemMap.set(y,{ref:y,...x}),k.listeners.forEach(R=>R(Array.from(k.itemMap.values()),S)),()=>{const R=Array.from(k.itemMap.values());k.itemMap.delete(y),k.listeners.forEach(A=>A(Array.from(k.itemMap.values()),R))}}),u.jsx(Rn,{[d]:"",ref:$,children:v})});h.displayName=c;function f(m){const g=o(`${t}CollectionConsumer`,m),b=w.useCallback(()=>{const x=g.collectionRef.current;if(!x)return[];const y=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((S,R)=>y.indexOf(S.ref.current)-y.indexOf(R.ref.current))},[g.collectionRef,g.itemMap]),v=w.useCallback(x=>(g.listeners.add(x),()=>g.listeners.delete(x)),[g.listeners]);return{getItems:b,subscribe:v}}return[{Provider:s,Slot:l,ItemSlot:h},f,r]}const jc=new Map;function a4(t,e){const n=t+(e?Object.entries(e).sort((i,o)=>i[0]<o[0]?-1:1).join():"");if(jc.has(n))return jc.get(n);const r=new Intl.Collator(t,e);return jc.set(n,r),r}function xh(t,e){const n=a4(t,{usage:"search",...e});return{startsWith(r,i){return i.length===0?!0:(r=r.normalize("NFC"),i=i.normalize("NFC"),n.compare(r.slice(0,i.length),i)===0)},endsWith(r,i){return i.length===0?!0:(r=r.normalize("NFC"),i=i.normalize("NFC"),n.compare(r.slice(-i.length),i)===0)},contains(r,i){if(i.length===0)return!0;r=r.normalize("NFC"),i=i.normalize("NFC");let o=0;const s=i.length;for(;o+s<=r.length;o++){const a=r.slice(o,o+s);if(n.compare(i,a)===0)return!0}return!1}}}const l4=t=>{const e=w.useRef();return w.useEffect(()=>{e.current=t}),e.current},c4=[" ","Enter","ArrowUp","ArrowDown"],d4=["Enter"],u4=t=>!!(t.length===1&&t.match(/\S| /)),bg="Combobox",[Vi,gs]=s4(bg),[h4,jn]=th(bg),f4=({children:t})=>u.jsx(Il,{children:u.jsx(Vi.Provider,{scope:void 0,children:t})}),m4=t=>typeof t=="string"?t==="none"?{type:t,filter:void 0}:{type:t,filter:"startsWith"}:t,p4=t=>{const{allowCustomValue:e=!1,autocomplete:n="none",children:r,open:i,defaultOpen:o,onOpenChange:s,value:a,defaultValue:l,onValueChange:c,disabled:d,required:h=!1,locale:f="en-EN",onTextValueChange:m,textValue:g,defaultTextValue:b,filterValue:v,defaultFilterValue:x,onFilterValueChange:y,isPrintableCharacter:$=u4,visible:k=!1}=t,[S,R]=w.useState(null),[A,I]=w.useState(null),[E,j]=w.useState(null),[O,D]=w.useState(null),[B=!1,V]=mt({prop:i,defaultProp:o,onChange:s}),[q,J]=mt({prop:a,defaultProp:l,onChange:c}),[W,K]=mt({prop:g,defaultProp:e&&!b?a:b,onChange:m}),[F,Q]=mt({prop:v,defaultProp:x,onChange:y}),pe=gt(),we=w.useCallback((Ce,P)=>{const oe=P.map(ae=>ae.ref.current),[_,...G]=oe,[Z]=G.slice(-1),ne=O??P.find(ae=>ae.value===q)?.ref.current;for(const ae of Ce){if(ae===ne)return;if(ae?.scrollIntoView({block:"nearest"}),ae===_&&A&&(A.scrollTop=0),ae===Z&&A&&(A.scrollTop=A.scrollHeight),D(ae),n==="both"){const be=P.find(le=>le.ref.current===ae);be&&K(be.textValue)}if(ae!==ne)return}},[n,K,A,O,q]),ce=m4(n);return w.useEffect(()=>{n!=="both"&&D(null)},[W,n]),w.useEffect(()=>{if(E&&S)return ps([E,S])},[E,S]),u.jsx(f4,{children:u.jsx(h4,{allowCustomValue:e,autocomplete:ce,required:h,trigger:S,onTriggerChange:R,contentId:pe,value:q,onValueChange:J,open:B,onOpenChange:V,disabled:d,locale:f,focusFirst:we,textValue:W,onTextValueChange:K,onViewportChange:I,onContentChange:j,visuallyFocussedItem:O,filterValue:F,onFilterValueChange:Q,onVisuallyFocussedItemChange:D,isPrintableCharacter:$,visible:k,children:r})})},vg="ComboboxTrigger",xg=w.forwardRef((t,e)=>{const{...n}=t,r=jn(vg),i=()=>{r.disabled||r.onOpenChange(!0)};return u.jsx(hs,{asChild:!0,children:u.jsx(to,{asChild:!0,trapped:r.open,onMountAutoFocus:o=>{o.preventDefault()},onUnmountAutoFocus:o=>{r.trigger?.focus({preventScroll:!0}),document.getSelection()?.empty(),o.preventDefault()},children:u.jsx("div",{ref:e,"data-disabled":r.disabled?"":void 0,...n,onClick:X(n.onClick,o=>{if(r.disabled){o.preventDefault();return}r.trigger?.focus()}),onPointerDown:X(n.onPointerDown,o=>{if(r.disabled){o.preventDefault();return}const s=o.target;s.hasPointerCapture(o.pointerId)&&s.releasePointerCapture(o.pointerId),(s.closest("button")??s.closest("div"))===o.currentTarget&&o.button===0&&o.ctrlKey===!1&&(i(),r.trigger?.focus())})})})})});xg.displayName=vg;const wg="ComboboxInput",yg=w.forwardRef((t,e)=>{const n=jn(wg),r=w.useRef(null),{getItems:i}=gs(void 0),{startsWith:o}=xh(n.locale,{sensitivity:"base"}),s=n.disabled,a=ye(r,e,n.onTriggerChange),l=()=>{s||n.onOpenChange(!0)},c=l4(n.filterValue);return Ke(()=>{const d=setTimeout(()=>{if(n.textValue===""||n.textValue===void 0||n.filterValue===""||n.filterValue===void 0)return;const h=i().find(m=>m.type==="option"&&o(m.textValue,n.textValue)),f=E4(c??"",n.filterValue);h&&!n.visuallyFocussedItem&&f===n.filterValue.length&&r.current?.setSelectionRange(n.filterValue.length,n.textValue.length)});return()=>clearTimeout(d)},[n.textValue,n.filterValue,o,n.visuallyFocussedItem,i,c]),u.jsx("input",{type:"text",role:"combobox","aria-controls":n.contentId,"aria-expanded":n.open,"aria-required":n.required,"aria-autocomplete":n.autocomplete.type,"data-state":n.open?"open":"closed","aria-disabled":s,"aria-activedescendant":n.visuallyFocussedItem?.id,disabled:s,"data-disabled":s?"":void 0,"data-placeholder":n.textValue===void 0?"":void 0,value:n.textValue??"",...t,ref:a,onKeyDown:X(t.onKeyDown,d=>{if(["ArrowUp","ArrowDown","Home","End"].includes(d.key))n.open||l(),setTimeout(()=>{let f=i().filter(m=>!m.disabled&&m.isVisible).map(m=>m.ref.current);if(["ArrowUp","End"].includes(d.key)&&(f=f.slice().reverse()),["ArrowUp","ArrowDown"].includes(d.key)){const m=n.visuallyFocussedItem??i().find(g=>g.value===n.value)?.ref.current;if(m){let g=f.indexOf(m);g===f.length-1&&(g=-1),f=f.slice(g+1)}}if(["ArrowDown"].includes(d.key)&&n.autocomplete.type==="both"&&f.length>1){const[m,...g]=f,b=i().find(v=>v.ref.current===m).textValue;n.textValue===b&&(f=g)}n.focusFirst(f,i())}),d.preventDefault();else if(["Tab"].includes(d.key)&&n.open)d.preventDefault();else if(["Escape"].includes(d.key))n.open?n.onOpenChange(!1):(n.onValueChange(void 0),n.onTextValueChange("")),d.preventDefault();else if(d4.includes(d.key)){if(n.visuallyFocussedItem){const h=i().find(f=>f.ref.current===n.visuallyFocussedItem);h&&(n.onValueChange(h.value),n.onTextValueChange(h.textValue),n.autocomplete.type==="both"&&n.onFilterValueChange(h.textValue),h.ref.current?.click())}else{const h=i().find(f=>f.type==="option"&&!f.disabled&&f.textValue===n.textValue);h&&(n.onValueChange(h.value),n.onTextValueChange(h.textValue),n.autocomplete.type==="both"&&n.onFilterValueChange(h.textValue),h.ref.current?.click())}n.onOpenChange(!1),d.preventDefault()}else n.onVisuallyFocussedItemChange(null)}),onChange:X(t.onChange,d=>{n.onTextValueChange(d.currentTarget.value),n.autocomplete.type==="both"&&n.onFilterValueChange(d.currentTarget.value)}),onKeyUp:X(t.onKeyUp,d=>{if(!n.open&&(n.isPrintableCharacter(d.key)||["Backspace"].includes(d.key))&&l(),setTimeout(()=>{if(n.autocomplete.type==="both"&&n.isPrintableCharacter(d.key)&&n.filterValue!==void 0){const h=n.filterValue,f=i().find(m=>o(m.textValue,h));f&&n.onTextValueChange(f.textValue)}}),n.autocomplete.type==="none"&&n.isPrintableCharacter(d.key)){const h=n.textValue??"",f=i().find(m=>o(m.textValue,h));f&&(n.onVisuallyFocussedItemChange(f.ref.current),f.ref.current?.scrollIntoView())}}),onBlur:X(t.onBlur,()=>{if(n.open)return;n.onVisuallyFocussedItemChange(null);const[d]=i().filter(f=>f.textValue===n.textValue&&f.type==="option");if(d){n.onValueChange(d.value),n.autocomplete.type==="both"&&n.onFilterValueChange(d.textValue);return}if(n.allowCustomValue){n.onValueChange(n.textValue),n.autocomplete.type==="both"&&n.onFilterValueChange(n.textValue);return}const[h]=i().filter(f=>f.value===n.value&&f.type==="option");h&&n.textValue!==""?(n.onTextValueChange(h.textValue),n.autocomplete.type==="both"&&n.onFilterValueChange(h.textValue)):(n.onValueChange(void 0),n.onTextValueChange(""))})})});yg.displayName="ComboboxTextInput";const Cg=w.forwardRef((t,e)=>{const{children:n,...r}=t,i=jn(wg),o=i.disabled,s=()=>{o||(i.onOpenChange(!0),i.trigger?.focus())};return u.jsx(ge.button,{"aria-hidden":!0,type:"button","aria-disabled":o,"aria-controls":i.contentId,"aria-expanded":i.open,disabled:o,"data-disabled":o?"":void 0,...r,tabIndex:-1,ref:e,onClick:X(r.onClick,()=>{i.trigger?.focus()}),onPointerDown:X(r.onPointerDown,a=>{a.button===0&&a.ctrlKey===!1&&(s(),a.preventDefault())}),onKeyDown:X(r.onKeyDown,a=>{c4.includes(a.key)&&(s(),a.preventDefault())}),children:n||"▼"})});Cg.displayName="ComboboxIcon";const g4="ComboboxPortal",$g=t=>u.jsx(Ji,{asChild:!0,...t});$g.displayName=g4;const wh="ComboboxContent",Sg=w.forwardRef((t,e)=>{const n=jn(wh),{getItems:r}=gs(void 0),[i,o]=w.useState();if(Ke(()=>{o(new DocumentFragment)},[]),Ke(()=>{n.open&&n.autocomplete.type==="none"&&setTimeout(()=>{r().find(a=>a.value===n.value)?.ref.current?.scrollIntoView({block:"nearest"})})},[r,n.autocomplete,n.value,n.open]),!n.open){const s=i;return s?ei.createPortal(u.jsx(Vi.Slot,{scope:void 0,children:u.jsx("div",{children:t.children})}),s):null}return u.jsx(kg,{...t,ref:e})});Sg.displayName=wh;const b4=10,kg=w.forwardRef((t,e)=>{const{onEscapeKeyDown:n,onPointerDownOutside:r,...i}=t,o=jn(wh),s=ye(e,l=>o.onContentChange(l)),{onOpenChange:a}=o;return eo(),w.useEffect(()=>{const l=()=>{a(!1)};return window.addEventListener("blur",l),window.addEventListener("resize",l),()=>{window.removeEventListener("blur",l),window.removeEventListener("resize",l)}},[a]),u.jsx(vh,{allowPinchZoom:!0,children:u.jsx(ti,{asChild:!0,onEscapeKeyDown:n,onPointerDownOutside:r,onFocusOutside:l=>{l.preventDefault()},onDismiss:()=>{o.onOpenChange(!1),o.trigger?.focus({preventScroll:!0})},children:u.jsx(Ag,{role:"listbox",id:o.contentId,"data-state":o.open?"open":"closed",onContextMenu:l=>l.preventDefault(),...i,ref:s,style:{display:"flex",flexDirection:"column",outline:"none",...i.style}})})})});kg.displayName="ComboboxContentImpl";const Ag=w.forwardRef((t,e)=>{const{align:n="start",collisionPadding:r=b4,...i}=t;return u.jsx(fs,{...i,ref:e,align:n,collisionPadding:r,style:{boxSizing:"border-box",...i.style,"--radix-combobox-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-combobox-content-available-width":"var(--radix-popper-available-width)","--radix-combobox-content-available-height":"var(--radix-popper-available-height)","--radix-combobox-trigger-width":"var(--radix-popper-anchor-width)","--radix-combobox-trigger-height":"var(--radix-popper-anchor-height)"}})});Ag.displayName="ComboboxPopperPosition";const Rg="ComboboxViewport",Tg=w.forwardRef((t,e)=>{const n=jn(Rg),r=ye(e,n.onViewportChange);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-combobox-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-combobox-viewport]::-webkit-scrollbar{display:none}"}}),u.jsx(Vi.Slot,{scope:void 0,children:u.jsx(ge.div,{"data-radix-combobox-viewport":"",role:"presentation",...t,ref:r,style:{position:"relative",flex:1,overflow:"auto",...t.style}})})]})});Tg.displayName=Rg;const Fl="ComboboxItem",[M0,yh]=th(Fl),Ch=w.forwardRef((t,e)=>{const{value:n,disabled:r=!1,textValue:i,...o}=t,[s,a]=w.useState();Ke(()=>{a(new DocumentFragment)},[]);const{onTextValueChange:l,textValue:c,...d}=jn(Fl),h=gt(),[f,m]=w.useState(i??""),g=d.value===n,{startsWith:b,contains:v}=xh(d.locale,{sensitivity:"base"}),x=w.useCallback(y=>{m($=>$||(y?.textContent??"").trim())},[]);return w.useEffect(()=>{g&&c===void 0&&f!==""&&l(f)},[f,g,c,l]),d.autocomplete.type==="both"&&f&&d.filterValue&&!b(f,d.filterValue)||d.autocomplete.type==="list"&&d.autocomplete.filter==="startsWith"&&f&&c&&!b(f,c)||d.autocomplete.type==="list"&&d.autocomplete.filter==="contains"&&f&&c&&!v(f,c)?s?ei.createPortal(u.jsx(M0,{textId:h,onTextValueChange:x,isSelected:g,textValue:f,children:u.jsx(Vi.ItemSlot,{scope:void 0,value:n,textValue:f,disabled:r,type:"option",isVisible:!1,children:u.jsx(jd,{ref:e,value:n,disabled:r,...o})})}),s):null:u.jsx(M0,{textId:h,onTextValueChange:x,isSelected:g,textValue:f,children:u.jsx(Vi.ItemSlot,{scope:void 0,value:n,textValue:f,disabled:r,type:"option",isVisible:!0,children:u.jsx(jd,{ref:e,value:n,disabled:r,...o})})})});Ch.displayName=Fl;const Mg="ComboboxItemImpl",jd=w.forwardRef((t,e)=>{const{value:n,disabled:r=!1,...i}=t,o=w.useRef(null),s=ye(e,o),{getItems:a}=gs(void 0),{onTextValueChange:l,visuallyFocussedItem:c,...d}=jn(Fl),{isSelected:h,textValue:f,textId:m}=yh(Mg),g=()=>{r||(d.onValueChange(n),l(f),d.onOpenChange(!1),d.autocomplete.type==="both"&&d.onFilterValueChange(f),d.trigger?.focus({preventScroll:!0}))},b=w.useMemo(()=>c===a().find(x=>x.ref.current===o.current)?.ref.current,[a,c]),v=gt();return u.jsx(ge.div,{role:"option","aria-labelledby":m,"data-highlighted":b?"":void 0,"aria-selected":h&&b,"data-state":h?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...i,id:v,ref:s,onPointerUp:X(i.onPointerUp,g)})});jd.displayName=Mg;const Eg="ComboboxItemText",Ig=w.forwardRef((t,e)=>{const{className:n,style:r,...i}=t,o=yh(Eg),s=ye(e,o.onTextValueChange);return u.jsx(ge.span,{id:o.textId,...i,ref:s})});Ig.displayName=Eg;const jg="ComboboxItemIndicator",Dg=w.forwardRef((t,e)=>{const{isSelected:n}=yh(jg);return n?u.jsx(ge.span,{"aria-hidden":!0,...t,ref:e}):null});Dg.displayName=jg;const $h="ComboboxNoValueFound",Og=w.forwardRef((t,e)=>{const{textValue:n="",filterValue:r="",visible:i=!1,locale:o,autocomplete:s}=jn($h),[a,l]=w.useState([]),{subscribe:c}=gs(void 0),{startsWith:d,contains:h}=xh(o,{sensitivity:"base"});return w.useEffect(()=>{const f=c(m=>{if(i){const g=m.filter(b=>b.type!=="create");l(g)}else l(m)});return()=>{f()}},[i,c]),s.type==="none"&&a.length>0||s.type==="list"&&s.filter==="startsWith"&&a.some(f=>d(f.textValue,n))||s.type==="both"&&a.some(f=>d(f.textValue,r))||s.type==="list"&&s.filter==="contains"&&a.some(f=>h(f.textValue,n))?null:u.jsx(ge.div,{...t,ref:e})});Og.displayName=$h;const Lg=w.forwardRef((t,e)=>{const{disabled:n=!1,...r}=t,i=jn($h),{textValue:o,visuallyFocussedItem:s}=i,{getItems:a,subscribe:l}=gs(void 0),c=w.useRef(null),[d,h]=w.useState(!1),f=ye(e,c),m=w.useMemo(()=>s===a().find(v=>v.ref.current===c.current)?.ref.current,[a,s]),g=gt(),b=()=>{!n&&o&&(i.onValueChange(o),i.onTextValueChange(o),i.onOpenChange(!1),i.autocomplete.type==="both"&&i.onFilterValueChange(o),i.trigger?.focus({preventScroll:!0}))};return Ke(()=>{const v=l(x=>{h(!x.some(y=>y.textValue===o&&y.type!=="create"))});return a().length===0&&h(!0),()=>{v()}},[o,l,a]),(!o||!d)&&!i.visible?null:u.jsx(Vi.ItemSlot,{scope:void 0,value:o??"",textValue:o??"",disabled:n,isVisible:!0,type:"create",children:u.jsx(ge.div,{role:"option",tabIndex:n?void 0:-1,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,"data-highlighted":m?"":void 0,...r,id:g,ref:f,onPointerUp:X(r.onPointerUp,b)})})});Lg.displayName="ComboboxCreateItem";const v4=p4,x4=xg,w4=yg,y4=Cg,C4=$g,$4=Sg,S4=Tg,k4=Ch,A4=Ig,R4=Dg,T4=Og,M4=Lg;function E4(t,e){const n=Math.min(t.length,e.length);for(let r=0;r<n;r++)if(t[r]!==e[r])return r;return n}const nn=Object.freeze(Object.defineProperty({__proto__:null,ComboboxItem:Ch,Content:$4,CreateItem:M4,Icon:y4,Item:k4,ItemIndicator:R4,ItemText:A4,NoValueFound:T4,Portal:C4,Root:v4,TextInput:w4,Trigger:x4,Viewport:S4},Symbol.toStringTag,{value:"Module"}));function Sh(t){const e=w.useRef(t);return w.useEffect(()=>{e.current=t}),w.useMemo(()=>(...n)=>e.current?.(...n),[])}const I4=[" ","Enter","ArrowUp","ArrowDown"],j4=[" ","Enter"],bs="Select",[Vl,vs,D4]=Nl(bs),[no,O4]=et(bs,[D4,Sr]),_l=Sr(),[L4,tr]=no(bs),[N4,B4]=no(bs),kh=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:i,onOpenChange:o,value:s,defaultValue:a,onValueChange:l,dir:c,disabled:d,required:h,multi:f=!1}=t,m=_l(e),[g,b]=w.useState(null),[v,x]=w.useState(null),[y,$]=w.useState(!1),k=ni(c),[S=!1,R]=mt({prop:r,defaultProp:i,onChange:o}),[A,I]=mt({prop:s,defaultProp:a,onChange(D){l&&(Array.isArray(D),l(D))}}),E=w.useRef(null),[j,O]=w.useState(new Set);return u.jsx(Il,{...m,children:u.jsx(L4,{required:h,scope:e,trigger:g,onTriggerChange:b,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:y,onValueNodeHasChildrenChange:$,contentId:gt(),value:A,onValueChange:I,open:S,onOpenChange:R,dir:k,triggerPointerDownPosRef:E,disabled:d,multi:f,children:u.jsx(Vl.Provider,{scope:e,children:u.jsx(N4,{scope:t.__scopeSelect,onNativeOptionAdd:w.useCallback(D=>{O(B=>new Set(B).add(D))},[]),onNativeOptionRemove:w.useCallback(D=>{O(B=>{const V=new Set(B);return V.delete(D),V})},[]),children:n})})})})};kh.displayName=bs;const Ng="SelectTrigger",Ah=w.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=_l(n),o=tr(Ng,n),s=o.disabled,a=ye(e,o.onTriggerChange),l=vs(n),[c,d,h]=qg(m=>{const g=l().filter(x=>!x.disabled),b=g.find(x=>x.value===o.value),v=Ug(g,m,b);if(v!==void 0&&!Array.isArray(v.value)){const x=o.multi?[v.value]:v.value;o.onValueChange(x)}}),f=()=>{s||(o.onOpenChange(!0),h())};return u.jsx(hs,{asChild:!0,...i,children:u.jsx(ge.div,{role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed","data-disabled":s?"":void 0,"data-placeholder":o.value===void 0?"":void 0,tabIndex:s?void 0:0,...r,ref:a,onClick:X(r.onClick,m=>{m.currentTarget.focus()}),onPointerDown:X(r.onPointerDown,m=>{const g=m.target;g.hasPointerCapture(m.pointerId)&&g.releasePointerCapture(m.pointerId),(g.closest("button")??g.closest("div"))===m.currentTarget&&m.button===0&&m.ctrlKey===!1&&(f(),o.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)},m.preventDefault())}),onKeyDown:X(r.onKeyDown,m=>{const g=c.current!=="",b=m.ctrlKey||m.altKey||m.metaKey,v=m.target;(v.closest("button")??v.closest("div"))===m.currentTarget&&(!b&&m.key.length===1&&d(m.key),!(g&&m.key===" ")&&I4.includes(m.key)&&(f(),m.preventDefault()))})})})});Ah.displayName=Ng;const Bg="SelectValue",Rh=w.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,placeholder:i,...o}=t,s=tr(Bg,n),{onValueNodeHasChildrenChange:a}=s,l=r!==void 0,c=ye(e,s.onValueNodeChange),[d,h]=w.useState([]),f=vs(n);Ke(()=>{a(l)},[a,l]),w.useLayoutEffect(()=>{if(Array.isArray(s.value)&&d.length!==s.value.length){const g=setTimeout(()=>{const b=f().filter(v=>Array.isArray(v.value)?!1:s.value?.includes(v.value));h(b)});return()=>{clearTimeout(g)}}},[s.value,f,d]);let m;if((s.value===void 0||s.value.length===0)&&i!==void 0)m=u.jsx("span",{children:i});else if(typeof r=="function")if(Array.isArray(s.value)){const g=s.value.map(b=>{const v=d.find(x=>x.value===b);return v?r({value:b,textValue:v?.textValue}):null});m=g.every(b=>b===null)?i:g}else m=r(s.value);else m=r;return u.jsx(ge.span,{...o,ref:c,children:m||null})});Rh.displayName=Bg;const F4="SelectIcon",Th=w.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...i}=t;return u.jsx(ge.span,{"aria-hidden":!0,...i,ref:e,children:r||"▼"})});Th.displayName=F4;const V4="SelectPortal",Mh=t=>u.jsx(Ji,{asChild:!0,...t});Mh.displayName=V4;const Ur="SelectContent",Eh=w.forwardRef((t,e)=>{const n=tr(Ur,t.__scopeSelect),[r,i]=w.useState();if(Ke(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?ei.createPortal(u.jsx(Fg,{scope:t.__scopeSelect,children:u.jsx(Vl.Slot,{scope:t.__scopeSelect,children:u.jsx("div",{children:t.children})})}),o):null}return u.jsx(Vg,{...t,ref:e})});Eh.displayName=Ur;const Fn=10,[Fg,kr]=no(Ur),_4="SelectContentImpl",Vg=w.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:h,collisionBoundary:f,collisionPadding:m,sticky:g,hideWhenDetached:b,avoidCollisions:v,...x}=t,y=tr(Ur,n),[$,k]=w.useState(null),[S,R]=w.useState(null),A=ye(e,_=>k(_)),[I,E]=w.useState(null),[j,O]=w.useState(null),D=vs(n),[B,V]=w.useState(!1),q=w.useRef(!1);w.useEffect(()=>{if($)return ps($)},[$]),eo();const J=w.useCallback(_=>{const[G,...Z]=D().map(be=>be.ref.current),[ne]=Z.slice(-1),ae=document.activeElement;for(const be of _)if(be===ae||(be?.scrollIntoView({block:"nearest"}),be===G&&S&&(S.scrollTop=0),be===ne&&S&&(S.scrollTop=S.scrollHeight),be?.focus(),document.activeElement!==ae))return},[D,S]),W=w.useCallback(()=>J([I,$]),[J,I,$]);w.useEffect(()=>{B&&W()},[B,W]);const{onOpenChange:K,triggerPointerDownPosRef:F}=y;w.useEffect(()=>{if($){let _={x:0,y:0};const G=ne=>{_={x:Math.abs(Math.round(ne.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(ne.pageY)-(F.current?.y??0))}},Z=ne=>{_.x<=10&&_.y<=10?ne.preventDefault():$.contains(ne.target)||K(!1),document.removeEventListener("pointermove",G),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",G),document.addEventListener("pointerup",Z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",G),document.removeEventListener("pointerup",Z,{capture:!0})}}},[$,K,F]),w.useEffect(()=>{const _=()=>K(!1);return window.addEventListener("blur",_),window.addEventListener("resize",_),()=>{window.removeEventListener("blur",_),window.removeEventListener("resize",_)}},[K]);const[Q,pe]=qg(_=>{const G=D().filter(ae=>!ae.disabled),Z=G.find(ae=>ae.ref.current===document.activeElement),ne=Ug(G,_,Z);ne&&setTimeout(()=>ne.ref.current.focus())}),we=w.useCallback((_,G,Z)=>{const ne=!q.current&&!Z;(y.value!==void 0&&y.value===G||ne)&&(E(_),ne&&(q.current=!0))},[y.value]),ce=w.useCallback(()=>$?.focus(),[$]),Ce=w.useCallback((_,G,Z)=>{const ne=!q.current&&!Z;(y.value!==void 0&&(Array.isArray(G)?G.every(be=>y.value?.includes(be)):y.value===G)||ne)&&O(_)},[y.value]),P=r==="popper"?Dd:_g,oe=P===Dd?{side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:h,collisionBoundary:f,collisionPadding:m,sticky:g,hideWhenDetached:b,avoidCollisions:v}:{};return u.jsx(Fg,{scope:n,content:$,viewport:S,onViewportChange:R,itemRefCallback:we,selectedItem:I,onItemLeave:ce,itemTextRefCallback:Ce,focusSelectedItem:W,selectedItemText:j,position:r,isPositioned:B,searchRef:Q,children:u.jsx(vh,{as:Rn,allowPinchZoom:!0,children:u.jsx(to,{asChild:!0,trapped:y.open,onMountAutoFocus:_=>{_.preventDefault()},onUnmountAutoFocus:X(i,_=>{y.trigger?.focus({preventScroll:!0}),document.getSelection()?.empty(),_.preventDefault()}),children:u.jsx(ti,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:_=>_.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:u.jsx(P,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed","aria-multiselectable":y.multi?"true":void 0,dir:y.dir,onContextMenu:_=>_.preventDefault(),...x,...oe,onPlaced:()=>V(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:X(x.onKeyDown,_=>{const G=_.ctrlKey||_.altKey||_.metaKey;if(_.key==="Tab"&&_.preventDefault(),!G&&_.key.length===1&&pe(_.key),["ArrowUp","ArrowDown","Home","End"].includes(_.key)){let ne=D().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);if(["ArrowUp","End"].includes(_.key)&&(ne=ne.slice().reverse()),["ArrowUp","ArrowDown"].includes(_.key)){const ae=_.target,be=ne.indexOf(ae);ne=ne.slice(be+1)}setTimeout(()=>J(ne)),_.preventDefault()}})})})})})})});Vg.displayName=_4;const z4="SelectItemAlignedPosition",_g=w.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...i}=t,o=tr(Ur,n),s=kr(Ur,n),[a,l]=w.useState(null),[c,d]=w.useState(null),h=ye(e,A=>d(A)),f=vs(n),m=w.useRef(!1),g=w.useRef(!0),{viewport:b,selectedItem:v,selectedItemText:x,focusSelectedItem:y}=s,$=w.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&c&&b&&v&&x){const A=o.trigger.getBoundingClientRect(),I=c.getBoundingClientRect(),E=o.valueNode.getBoundingClientRect(),j=x.getBoundingClientRect();if(o.dir!=="rtl"){const ae=j.left-I.left,be=E.left-ae,le=A.left-be,Le=A.width+le,$e=Math.max(Le,I.width),Be=window.innerWidth-Fn,se=Id(be,[Fn,Be-$e]);a.style.minWidth=`${Le}px`,a.style.left=`${se}px`}else{const ae=I.right-j.right,be=window.innerWidth-E.right-ae,le=window.innerWidth-A.right-be,Le=A.width+le,$e=Math.max(Le,I.width),Be=window.innerWidth-Fn,se=Id(be,[Fn,Be-$e]);a.style.minWidth=`${Le}px`,a.style.right=`${se}px`}const O=f(),D=window.innerHeight-Fn*2,B=b.scrollHeight,V=window.getComputedStyle(c),q=parseInt(V.borderTopWidth,10),J=parseInt(V.paddingTop,10),W=parseInt(V.borderBottomWidth,10),K=parseInt(V.paddingBottom,10),F=q+J+B+K+W,Q=Math.min(v.offsetHeight*5,F),pe=window.getComputedStyle(b),we=parseInt(pe.paddingTop,10),ce=parseInt(pe.paddingBottom,10),Ce=A.top+A.height/2-Fn,P=D-Ce,oe=v.offsetHeight/2,_=v.offsetTop+oe,G=q+J+_,Z=F-G;if(G<=Ce){const ae=v===O[O.length-1].ref.current;a.style.bottom="0px";const be=c.clientHeight-b.offsetTop-b.offsetHeight,le=Math.max(P,oe+(ae?ce:0)+be+W),Le=G+le;a.style.height=`${Le}px`}else{const ae=v===O[0].ref.current;a.style.top="0px";const le=Math.max(Ce,q+b.offsetTop+(ae?we:0)+oe)+Z;a.style.height=`${le}px`,b.scrollTop=G-Ce+b.offsetTop}a.style.margin=`${Fn}px 0`,a.style.minHeight=`${Q}px`,a.style.maxHeight=`${D}px`,r?.(),requestAnimationFrame(()=>m.current=!0)}},[f,o.trigger,o.valueNode,a,c,b,v,x,o.dir,r]);Ke(()=>$(),[$]);const[k,S]=w.useState();Ke(()=>{c&&S(window.getComputedStyle(c).zIndex)},[c]);const R=w.useCallback(A=>{A&&g.current===!0&&($(),y?.(),g.current=!1)},[$,y]);return u.jsx(P4,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:m,onScrollButtonChange:R,children:u.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:u.jsx(ge.div,{...i,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});_g.displayName=z4;const H4="SelectPopperPosition",Dd=w.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Fn,...o}=t,s=_l(n);return u.jsx(fs,{...s,...o,ref:e,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Dd.displayName=H4;const[P4,Ih]=no(Ur,{}),Od="SelectViewport",jh=w.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=kr(Od,n),o=Ih(Od,n),s=ye(e,i.onViewportChange),a=w.useRef(0);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),u.jsx(Vl.Slot,{scope:n,children:u.jsx(ge.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:s,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:X(r.onScroll,l=>{const c=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:h}=o;if(h?.current&&d){const f=Math.abs(a.current-c.scrollTop);if(f>0){const m=window.innerHeight-Fn*2,g=parseFloat(d.style.minHeight),b=parseFloat(d.style.height),v=Math.max(g,b);if(v<m){const x=v+f,y=Math.min(m,x),$=x-y;d.style.height=`${y}px`,d.style.bottom==="0px"&&(c.scrollTop=$>0?$:0,d.style.justifyContent="flex-end")}}}a.current=c.scrollTop})})})]})});jh.displayName=Od;const zg="SelectGroup",[W4,q4]=no(zg),Dh=w.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=gt();return u.jsx(W4,{scope:n,id:i,children:u.jsx(ge.div,{role:"group","aria-labelledby":i,...r,ref:e})})});Dh.displayName=zg;const Hg="SelectLabel",Oh=w.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=q4(Hg,n);return u.jsx(ge.div,{id:i.id,...r,ref:e})});Oh.displayName=Hg;const za="SelectItem",[U4,Pg]=no(za),Lh=w.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...s}=t,a=tr(za,n),l=kr(za,n),c=typeof r=="string"?Array.isArray(a.value)?a.value.includes(r):a.value===r:r.every(y=>a.value?.includes(y)),d=Array.isArray(a.value)&&Array.isArray(r)&&r.some(y=>a.value?.includes(y)),[h,f]=w.useState(o??""),[m,g]=w.useState(!1),b=ye(e,y=>l.itemRefCallback?.(y,r,i)),v=gt(),x=()=>{if(!i){let y=a.multi&&typeof r=="string"?[r]:r;d&&!c?a.onValueChange(y):Array.isArray(a.value)&&(y=Kg(r,a.value)),a.onValueChange(y),a.multi||a.onOpenChange(!1)}};if(!a.multi&&Array.isArray(r))throw new Error("You can only pass an array of values in multi selects");return u.jsx(U4,{scope:n,value:r,disabled:i,textId:v,isSelected:c,isIntermediate:d,onItemTextChange:w.useCallback(y=>{f($=>$||(y?.textContent??"").trim())},[]),children:u.jsx(Vl.ItemSlot,{scope:n,value:r,disabled:i,textValue:h,children:u.jsx(ge.div,{role:"option","aria-labelledby":v,"data-highlighted":m?"":void 0,"aria-selected":a.multi?void 0:c&&m,"aria-checked":a.multi?c:void 0,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:b,onFocus:X(s.onFocus,()=>g(!0)),onBlur:X(s.onBlur,()=>g(!1)),onPointerUp:X(s.onPointerUp,x),onPointerMove:X(s.onPointerMove,y=>{i?l.onItemLeave?.():y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:X(s.onPointerLeave,y=>{y.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:X(s.onKeyDown,y=>{l.searchRef?.current!==""&&y.key===" "||(j4.includes(y.key)&&x(),y.key===" "&&y.preventDefault())})})})})});Lh.displayName=za;const ko="SelectItemText",Nh=w.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,...o}=t,s=tr(ko,n),a=kr(ko,n),l=Pg(ko,n),c=B4(ko,n),[d,h]=w.useState(null),f=ye(e,x=>h(x),l.onItemTextChange,x=>a.itemTextRefCallback?.(x,l.value,l.disabled)),m=d?.textContent,g=w.useMemo(()=>u.jsx("option",{value:l.value,disabled:l.disabled,children:m},Array.isArray(l.value)?l.value.join(";"):l.value),[l.disabled,l.value,m]),{onNativeOptionAdd:b,onNativeOptionRemove:v}=c;return Ke(()=>(b(g),()=>v(g)),[b,v,g]),u.jsxs(u.Fragment,{children:[u.jsx(ge.span,{id:l.textId,...o,ref:f}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?ei.createPortal(o.children,s.valueNode):null]})});Nh.displayName=ko;const Wg="SelectItemIndicator",Bh=w.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...i}=t,o=Pg(Wg,n);return typeof r=="function"?u.jsx(ge.span,{"aria-hidden":!0,...i,ref:e,children:r({isSelected:o.isSelected,isIntermediate:o.isIntermediate})}):o.isSelected?u.jsx(ge.span,{"aria-hidden":!0,...i,ref:e,children:r}):null});Bh.displayName=Wg;const Ld="SelectScrollUpButton",Fh=w.forwardRef((t,e)=>{const n=kr(Ld,t.__scopeSelect),r=Ih(Ld,t.__scopeSelect),[i,o]=w.useState(!1),s=ye(e,r.onScrollButtonChange);return Ke(()=>{if(n.viewport&&n.isPositioned){const a=n.viewport,l=()=>{const c=a.scrollTop>0;o(c)};return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?u.jsx(_h,{...t,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop-=l.offsetHeight)}}):null});Fh.displayName=Ld;const Nd="SelectScrollDownButton",Vh=w.forwardRef((t,e)=>{const n=kr(Nd,t.__scopeSelect),r=Ih(Nd,t.__scopeSelect),[i,o]=w.useState(!1),s=ye(e,r.onScrollButtonChange);return Ke(()=>{if(n.viewport&&n.isPositioned){const a=n.viewport,l=()=>{const c=a.scrollHeight-a.clientHeight,d=Math.ceil(a.scrollTop)<c;o(d)};return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?u.jsx(_h,{...t,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop+=l.offsetHeight)}}):null});Vh.displayName=Nd;const _h=w.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=t,o=kr("SelectScrollButton",n),s=w.useRef(null),a=vs(n),l=w.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return w.useEffect(()=>()=>l(),[l]),Ke(()=>{a().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),u.jsx(ge.div,{"aria-hidden":!0,...i,ref:e,style:{flexShrink:0,...i.style},onPointerMove:X(i.onPointerMove,()=>{o.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:X(i.onPointerLeave,()=>{l()})})});_h.displayName="SelectScrollButtonImpl";const K4="SelectSeparator",zh=w.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return u.jsx(ge.div,{"aria-hidden":!0,...r,ref:e})});zh.displayName=K4;const Bd="SelectArrow",Hh=w.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=_l(n),o=tr(Bd,n),s=kr(Bd,n);return o.open&&s.position==="popper"?u.jsx(G3,{...i,...r,ref:e}):null});Hh.displayName=Bd;const G4="BubbleSelect",Y4=w.forwardRef((t,e)=>{const{value:n,...r}=t,i=w.useRef(null),o=ye(e,i),s=Bl(n),a=tr(G4,void 0);w.useEffect(()=>{const c=i.current,d=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(d,"value").set;if(s!==n&&f){const m=new Event("change",{bubbles:!0});f.call(c,n),c.dispatchEvent(m)}},[s,n]);let l=n;return a.multi&&!Array.isArray(n)&&(l=[]),u.jsx(rg,{asChild:!0,children:u.jsx("select",{...r,multiple:a.multi?!0:void 0,ref:o,defaultValue:l})})});Y4.displayName="BubbleSelect";function qg(t){const e=Sh(t),n=w.useRef(""),r=w.useRef(0),i=w.useCallback(s=>{const a=n.current+s;e(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[e]),o=w.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function Ug(t,e,n){const i=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,o=n?t.indexOf(n):-1;let s=X4(t,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function X4(t,e){return t.map((n,r)=>t[(e+r)%t.length])}const Kg=(t,e=[])=>{if(Array.isArray(t))return t.reduce((r,i)=>Kg(i,r),e);const n=e.indexOf(t);return n===-1?[...e,t]:[...e.slice(0,n),...e.slice(n+1)]},Q4=kh,Z4=Ah,J4=Rh,eC=Th,tC=Mh,nC=Eh,rC=jh,iC=Dh,oC=Oh,sC=Lh,aC=Nh,lC=Bh,cC=Fh,dC=Vh,uC=zh,hC=Hh,dn=Object.freeze(Object.defineProperty({__proto__:null,Arrow:hC,Content:nC,Group:iC,Icon:eC,Item:sC,ItemIndicator:lC,ItemText:aC,Label:oC,Portal:tC,Root:Q4,ScrollDownButton:dC,ScrollUpButton:cC,Select:kh,SelectArrow:Hh,SelectContent:Eh,SelectGroup:Dh,SelectIcon:Th,SelectItem:Lh,SelectItemIndicator:Bh,SelectItemText:Nh,SelectLabel:Oh,SelectPortal:Mh,SelectScrollDownButton:Vh,SelectScrollUpButton:Fh,SelectSeparator:zh,SelectTrigger:Ah,SelectValue:Rh,SelectViewport:jh,Separator:uC,Trigger:Z4,Value:J4,Viewport:rC,createSelectScope:O4},Symbol.toStringTag,{value:"Module"}));function Fr(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t?.(i),n===!1||!i.defaultPrevented)return e?.(i)}}const Gg="Collapsible",[fC,Yg]=et(Gg),[mC,Ph]=fC(Gg),pC=p.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:s,...a}=t,[l=!1,c]=mt({prop:r,defaultProp:i,onChange:s});return p.createElement(mC,{scope:n,disabled:o,contentId:gt(),open:l,onOpenToggle:p.useCallback(()=>c(d=>!d),[c])},p.createElement(ge.div,N({"data-state":Wh(l),"data-disabled":o?"":void 0},a,{ref:e})))}),gC="CollapsibleTrigger",bC=p.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,i=Ph(gC,n);return p.createElement(ge.button,N({type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Wh(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled},r,{ref:e,onClick:X(t.onClick,i.onOpenToggle)}))}),Xg="CollapsibleContent",vC=p.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=Ph(Xg,t.__scopeCollapsible);return p.createElement(at,{present:n||i.open},({present:o})=>p.createElement(xC,N({},r,{ref:e,present:o})))}),xC=p.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=t,s=Ph(Xg,n),[a,l]=p.useState(r),c=p.useRef(null),d=ye(e,c),h=p.useRef(0),f=h.current,m=p.useRef(0),g=m.current,b=s.open||a,v=p.useRef(b),x=p.useRef();return p.useEffect(()=>{const y=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(y)},[]),Ke(()=>{const y=c.current;if(y){x.current=x.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const $=y.getBoundingClientRect();h.current=$.height,m.current=$.width,v.current||(y.style.transitionDuration=x.current.transitionDuration,y.style.animationName=x.current.animationName),l(r)}},[s.open,r]),p.createElement(ge.div,N({"data-state":Wh(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!b},o,{ref:d,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...t.style}}),b&&i)});function Wh(t){return t?"open":"closed"}const wC=pC,yC=bC,CC=vC,Ar="Accordion",$C=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[qh,SC,kC]=Nl(Ar),[zl,YH]=et(Ar,[kC,Yg]),Uh=Yg(),Qg=w.default.forwardRef((t,e)=>{const{type:n,...r}=t,i=r,o=r;return w.default.createElement(qh.Provider,{scope:t.__scopeAccordion},n==="multiple"?w.default.createElement(MC,N({},o,{ref:e})):w.default.createElement(TC,N({},i,{ref:e})))});Qg.propTypes={type(t){const e=t.value||t.defaultValue;return t.type&&!["single","multiple"].includes(t.type)?new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):t.type==="multiple"&&typeof e=="string"?new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):t.type==="single"&&Array.isArray(e)?new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[Zg,AC]=zl(Ar),[Jg,RC]=zl(Ar,{collapsible:!1}),TC=w.default.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:o=!1,...s}=t,[a,l]=mt({prop:n,defaultProp:r,onChange:i});return w.default.createElement(Zg,{scope:t.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:w.default.useCallback(()=>o&&l(""),[o,l])},w.default.createElement(Jg,{scope:t.__scopeAccordion,collapsible:o},w.default.createElement(e2,N({},s,{ref:e}))))}),MC=w.default.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=t,[s=[],a]=mt({prop:n,defaultProp:r,onChange:i}),l=w.default.useCallback(d=>a((h=[])=>[...h,d]),[a]),c=w.default.useCallback(d=>a((h=[])=>h.filter(f=>f!==d)),[a]);return w.default.createElement(Zg,{scope:t.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c},w.default.createElement(Jg,{scope:t.__scopeAccordion,collapsible:!0},w.default.createElement(e2,N({},o,{ref:e}))))}),[EC,Hl]=zl(Ar),e2=w.default.forwardRef((t,e)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:o="vertical",...s}=t,a=w.default.useRef(null),l=ye(a,e),c=SC(n),h=ni(i)==="ltr",f=X(t.onKeyDown,m=>{var g;if(!$C.includes(m.key))return;const b=m.target,v=c().filter(E=>{var j;return!((j=E.ref.current)!==null&&j!==void 0&&j.disabled)}),x=v.findIndex(E=>E.ref.current===b),y=v.length;if(x===-1)return;m.preventDefault();let $=x;const k=0,S=y-1,R=()=>{$=x+1,$>S&&($=k)},A=()=>{$=x-1,$<k&&($=S)};switch(m.key){case"Home":$=k;break;case"End":$=S;break;case"ArrowRight":o==="horizontal"&&(h?R():A());break;case"ArrowDown":o==="vertical"&&R();break;case"ArrowLeft":o==="horizontal"&&(h?A():R());break;case"ArrowUp":o==="vertical"&&A();break}const I=$%y;(g=v[I].ref.current)===null||g===void 0||g.focus()});return w.default.createElement(EC,{scope:n,disabled:r,direction:i,orientation:o},w.default.createElement(qh.Slot,{scope:n},w.default.createElement(ge.div,N({},s,{"data-orientation":o,ref:l,onKeyDown:r?void 0:f}))))}),Fd="AccordionItem",[IC,Kh]=zl(Fd),jC=w.default.forwardRef((t,e)=>{const{__scopeAccordion:n,value:r,...i}=t,o=Hl(Fd,n),s=AC(Fd,n),a=Uh(n),l=gt(),c=r&&s.value.includes(r)||!1,d=o.disabled||t.disabled;return w.default.createElement(IC,{scope:n,open:c,disabled:d,triggerId:l},w.default.createElement(wC,N({"data-orientation":o.orientation,"data-state":t2(c)},a,i,{ref:e,disabled:d,open:c,onOpenChange:h=>{h?s.onItemOpen(r):s.onItemClose(r)}})))}),DC="AccordionHeader",OC=w.default.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,i=Hl(Ar,n),o=Kh(DC,n);return w.default.createElement(ge.h3,N({"data-orientation":i.orientation,"data-state":t2(o.open),"data-disabled":o.disabled?"":void 0},r,{ref:e}))}),E0="AccordionTrigger",LC=w.default.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,i=Hl(Ar,n),o=Kh(E0,n),s=RC(E0,n),a=Uh(n);return w.default.createElement(qh.ItemSlot,{scope:n},w.default.createElement(yC,N({"aria-disabled":o.open&&!s.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId},a,r,{ref:e})))}),NC="AccordionContent",BC=w.default.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,i=Hl(Ar,n),o=Kh(NC,n),s=Uh(n);return w.default.createElement(CC,N({role:"region","aria-labelledby":o.triggerId,"data-orientation":i.orientation},s,r,{ref:e,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}}))});function t2(t){return t?"open":"closed"}const FC=Qg,VC=jC,_C=OC,zC=LC,HC=BC,PC=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 2A12.014 12.014 0 0 0 4 14c0 3 1.57 6.883 4.201 10.375C10.85 27.894 13.764 30 16 30s5.151-2.101 7.799-5.625C26.43 20.875 28 17 28 14A12.014 12.014 0 0 0 16 2M8 14.5A1.5 1.5 0 0 1 9.5 13a4.5 4.5 0 0 1 4.5 4.5 1.5 1.5 0 0 1-1.5 1.5A4.5 4.5 0 0 1 8 14.5M18 25h-4a1 1 0 0 1 0-2h4a1 1 0 0 1 0 2m1.5-6a1.5 1.5 0 0 1-1.5-1.5 4.5 4.5 0 0 1 4.5-4.5 1.5 1.5 0 0 1 1.5 1.5 4.5 4.5 0 0 1-4.5 4.5"})})};p.forwardRef(PC);const WC=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28 6H4a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2v11a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V13a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2m-9 12h-6a1 1 0 0 1 0-2h6a1 1 0 0 1 0 2m9-7H4V8h24z"})})};p.forwardRef(WC);const qC=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30.5 7v6a1.5 1.5 0 0 1-1.5 1.5h-6a1.5 1.5 0 0 1 0-3h2.137l-2.375-2.173-.047-.046a9.5 9.5 0 1 0-6.84 16.219H16a9.44 9.44 0 0 0 6.519-2.59 1.5 1.5 0 1 1 2.061 2.181A12.43 12.43 0 0 1 16 28.5h-.171a12.5 12.5 0 1 1 8.985-21.368L27.5 9.59V7a1.5 1.5 0 0 1 3 0"})})},UC=p.forwardRef(qC),KC=UC,GC=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m26.061 19.061-9 9a1.503 1.503 0 0 1-2.125 0l-9-9a1.503 1.503 0 1 1 2.125-2.125l6.439 6.439V5a1.5 1.5 0 1 1 3 0v18.375l6.439-6.44a1.502 1.502 0 1 1 2.125 2.125z"})})};p.forwardRef(GC);const YC=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 16a1.5 1.5 0 0 1-1.5 1.5H8.625l6.44 6.439a1.502 1.502 0 1 1-2.125 2.125l-9-9a1.5 1.5 0 0 1 0-2.125l9-9a1.503 1.503 0 0 1 2.125 2.125L8.625 14.5H27a1.5 1.5 0 0 1 1.5 1.5"})})};p.forwardRef(YC);const XC=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:o,viewBox:"0 0 16 16",stroke:s,ref:r,...n,children:u.jsx("path",{d:"M14.75 8a.75.75 0 0 1-.75.75H6.813l3.22 3.22a.751.751 0 1 1-1.063 1.062l-4.5-4.5a.75.75 0 0 1 0-1.063l4.5-4.5a.751.751 0 0 1 1.063 1.063L6.813 7.25H14a.75.75 0 0 1 .75.75M2.5 1.75a.75.75 0 0 0-.75.75v11a.75.75 0 0 0 1.5 0v-11a.75.75 0 0 0-.75-.75"})})};p.forwardRef(XC);const QC=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:o,viewBox:"0 0 16 16",stroke:s,ref:r,...n,children:u.jsx("path",{d:"M11.53 7.47a.75.75 0 0 1 0 1.062l-4.5 4.5a.751.751 0 1 1-1.062-1.063l3.22-3.219H2a.75.75 0 1 1 0-1.5h7.188L5.969 4.03a.751.751 0 1 1 1.063-1.062zm1.97-5.72a.75.75 0 0 0-.75.75v11a.75.75 0 0 0 1.5 0v-11a.75.75 0 0 0-.75-.75"})})};p.forwardRef(QC);const ZC=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m28.061 17.061-9 9a1.503 1.503 0 1 1-2.125-2.125l6.439-6.436H5a1.5 1.5 0 1 1 0-3h18.375l-6.436-6.44a1.503 1.503 0 0 1 2.125-2.125l9 9a1.5 1.5 0 0 1-.003 2.126"})})},JC=p.forwardRef(ZC),e$=JC,t$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26.061 15.061a1.5 1.5 0 0 1-2.125 0L17.5 8.625V27a1.5 1.5 0 1 1-3 0V8.625l-6.439 6.436a1.503 1.503 0 1 1-2.125-2.125l9-9a1.5 1.5 0 0 1 2.125 0l9 9a1.5 1.5 0 0 1 0 2.125"})})};p.forwardRef(t$);const n$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M11 13.5H5A1.5 1.5 0 0 1 3.5 12V6a1.5 1.5 0 0 1 3 0v1.733C8.581 5.683 11.786 3.5 16 3.5c5.558 0 8.92 3.299 9.061 3.439a1.5 1.5 0 0 1-2.117 2.125C22.889 9.01 20.25 6.5 16 6.5c-3.625 0-6.367 2.21-8 4h3a1.5 1.5 0 1 1 0 3m16 5h-6a1.5 1.5 0 1 0 0 3h3c-1.625 1.79-4.375 4-8 4-4.25 0-6.889-2.511-6.944-2.565A1.5 1.5 0 0 0 6.94 25.06c.141.141 3.504 3.44 9.061 3.44 4.214 0 7.419-2.183 9.5-4.233V26a1.5 1.5 0 1 0 3 0v-6a1.5 1.5 0 0 0-1.5-1.5"})})};p.forwardRef(n$);const r$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M220 48v48a12 12 0 0 1-24 0V77l-39.51 39.52a12 12 0 0 1-17-17L179 60h-19a12 12 0 0 1 0-24h48a12 12 0 0 1 12 12M99.51 139.51 60 179v-19a12 12 0 0 0-24 0v48a12 12 0 0 0 12 12h48a12 12 0 0 0 0-24H77l39.52-39.51a12 12 0 0 0-17-17Z"})})};p.forwardRef(r$);const i$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27.725 21.993C27.031 20.798 26 17.416 26 13a10 10 0 0 0-20 0c0 4.418-1.032 7.797-1.726 8.993A2 2 0 0 0 6 25h5.101a5 5 0 0 0 9.798 0H26a2 2 0 0 0 1.725-3.008M16 27a3 3 0 0 1-2.828-2h5.656A3 3 0 0 1 16 27"})})};p.forwardRef(i$);const o$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M22.135 14.308A6.001 6.001 0 0 0 17.5 4.5H9A1.5 1.5 0 0 0 7.5 6v19A1.5 1.5 0 0 0 9 26.5h10a6.5 6.5 0 0 0 3.135-12.192M10.5 7.5h7a3 3 0 0 1 0 6h-7zm8.5 16h-8.5v-7H19a3.5 3.5 0 1 1 0 7"})})};p.forwardRef(o$);const s$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 4v20a1 1 0 0 1-1 1H9a2 2 0 0 0-2 2h17a1 1 0 0 1 0 2H6a1 1 0 0 1-1-1V7a4 4 0 0 1 4-4h17a1 1 0 0 1 1 1"})})};p.forwardRef(s$);const a$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M19 14a1 1 0 0 1-1 1h-4a1 1 0 0 1 0-2h4a1 1 0 0 1 1 1m10-5v16a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h5V6a3 3 0 0 1 3-3h6a3 3 0 0 1 3 3v1h5a2 2 0 0 1 2 2M12 7h8V6a1 1 0 0 0-1-1h-6a1 1 0 0 0-1 1zm15 7.201V9H5v5.201A23 23 0 0 0 16 17a23 23 0 0 0 11-2.799"})})};p.forwardRef(a$);const l$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M9.5 8A1.5 1.5 0 0 1 11 6.5h16a1.5 1.5 0 0 1 0 3H11A1.5 1.5 0 0 1 9.5 8M27 14.5H11a1.5 1.5 0 1 0 0 3h16a1.5 1.5 0 1 0 0-3m0 8H11a1.5 1.5 0 1 0 0 3h16a1.5 1.5 0 1 0 0-3M5.5 14a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0-8a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 16a2 2 0 1 0 0 4 2 2 0 0 0 0-4"})})};p.forwardRef(l$);const c$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26 4h-3V3a1 1 0 0 0-2 0v1H11V3a1 1 0 0 0-2 0v1H6a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2m0 6H6V6h3v1a1 1 0 0 0 2 0V6h10v1a1 1 0 0 0 2 0V6h3z"})})},d$=p.forwardRef(c$),u$=d$,h$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30 14h-1.35l-3.472-7.812A2 2 0 0 0 23.35 5H8.65a2 2 0 0 0-1.828 1.188L3.35 14H2a1 1 0 0 0 0 2h1v10a2 2 0 0 0 2 2h3a2 2 0 0 0 2-2v-2h12v2a2 2 0 0 0 2 2h3a2 2 0 0 0 2-2V16h1a1 1 0 0 0 0-2m-20 6H8a1 1 0 0 1 0-2h2a1 1 0 0 1 0 2m12 0a1 1 0 0 1 0-2h2a1 1 0 0 1 0 2z"})})};p.forwardRef(h$);const f$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m26.708 12.708-10 10a1 1 0 0 1-1.415 0l-10-10A1 1 0 0 1 6 11h20a1 1 0 0 1 .707 1.707"})})},m$=p.forwardRef(f$),br=m$,p$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26.924 20.383A1 1 0 0 1 26 21H6a1 1 0 0 1-.708-1.707l10-10a1 1 0 0 1 1.415 0l10 10a1 1 0 0 1 .217 1.09"})})},g$=p.forwardRef(p$),b$=g$,v$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M7 26a1 1 0 1 1-2 0 1 1 0 0 0-1-1 1 1 0 0 1 0-2 3 3 0 0 1 3 3m-3-7a1 1 0 0 0 0 2 5 5 0 0 1 5 5 1 1 0 1 0 2 0 7.01 7.01 0 0 0-7-7m0-4a1 1 0 0 0 0 2 9.01 9.01 0 0 1 9 9 1 1 0 0 0 2 0A11.01 11.01 0 0 0 4 15M27 5H5a2 2 0 0 0-2 2v5a1 1 0 0 0 1 1 13.014 13.014 0 0 1 13 13 1 1 0 0 0 1 1h9a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2"})})};p.forwardRef(v$);const x$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M25 3h-1a2 2 0 0 0-2 2v2h-3.5V5a2 2 0 0 0-2-2h-1a2 2 0 0 0-2 2v2H10V5a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v5.586A1.98 1.98 0 0 0 5.586 12L7 13.414V27a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V13.414L26.414 12A1.98 1.98 0 0 0 27 10.586V5a2 2 0 0 0-2-2m-6 24h-6v-8a3 3 0 0 1 6 0z"})})};p.forwardRef(x$);const w$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 5H5a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h22a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m0 7a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m-5-2a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m-3-5a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m-3 7a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3M25 24H7a1 1 0 0 1-1-1V9a1 1 0 0 1 2 0v13h17a1 1 0 0 1 0 2"})})};p.forwardRef(w$);const y$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M3.094 14.443a12.8 12.8 0 0 1 2.914-6.72 2 2 0 0 1 2.953-.138l3.459 3.533a1.98 1.98 0 0 1 .211 2.56 3.2 3.2 0 0 0-.462.968.5.5 0 0 1-.478.354h-8.1a.5.5 0 0 1-.497-.557m14.08-11.435A2 2 0 0 0 15 5v5.084a1.98 1.98 0 0 0 1.656 1.97 4 4 0 0 1 .677 7.72.51.51 0 0 0-.333.476v8.154a.5.5 0 0 0 .558.5A13.04 13.04 0 0 0 29 16.185C29.094 9.4 23.899 3.61 17.174 3.008M14.656 19.77a4 4 0 0 1-2.425-2.427.51.51 0 0 0-.475-.343H3.59a.5.5 0 0 0-.5.556A13.01 13.01 0 0 0 14.443 28.91a.5.5 0 0 0 .556-.5V20.25a.51.51 0 0 0-.343-.48"})})};p.forwardRef(y$);const C$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m0 2a11 11 0 0 1 8.984 4.659L16 14.845zm0 22a11 11 0 0 1-8.984-4.659l18.97-10.951A11 11 0 0 1 16 27"})})};p.forwardRef(C$);const $$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m29.061 10.061-16 16a1.5 1.5 0 0 1-2.125 0l-7-7a1.504 1.504 0 0 1 2.125-2.125L12 22.875 26.939 7.939a1.502 1.502 0 1 1 2.125 2.125z"})})},S$=p.forwardRef($$),Ho=S$,k$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m5.708 10.708-7 7a1 1 0 0 1-1.415 0l-3-3a1 1 0 0 1 1.415-1.415L14 18.586l6.293-6.293a1 1 0 0 1 1.415 1.415"})})},A$=p.forwardRef(k$),R$=A$,T$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 256 256",fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M176.49 95.51a12 12 0 0 1 0 17l-56 56a12 12 0 0 1-17 0l-24-24a12 12 0 1 1 17-17L112 143l47.51-47.52a12 12 0 0 1 16.98.03M236 128A108 108 0 1 1 128 20a108.12 108.12 0 0 1 108 108m-24 0a84 84 0 1 0-84 84 84.09 84.09 0 0 0 84-84"})})};p.forwardRef(T$);const M$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m27.061 13.061-10 10a1.503 1.503 0 0 1-2.125 0l-10-10a1.503 1.503 0 1 1 2.125-2.125L16 19.875l8.939-8.94a1.502 1.502 0 1 1 2.125 2.125z"})})};p.forwardRef(M$);const E$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M21.061 24.939a1.503 1.503 0 0 1-2.125 2.125l-10-10a1.5 1.5 0 0 1 0-2.125l10-10a1.503 1.503 0 0 1 2.125 2.125L12.125 16z"})})},I$=p.forwardRef(E$),n2=I$,j$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m23.061 17.061-10 10a1.503 1.503 0 0 1-2.125-2.125L19.875 16l-8.936-8.939a1.502 1.502 0 1 1 2.125-2.125l10 10a1.5 1.5 0 0 1-.003 2.125"})})},D$=p.forwardRef(j$),Gh=D$,O$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27.061 21.061a1.503 1.503 0 0 1-2.125 0L16 12.125l-8.939 8.936a1.503 1.503 0 0 1-2.125-2.125l10-10a1.5 1.5 0 0 1 2.125 0l10 10a1.5 1.5 0 0 1 0 2.125"})})};p.forwardRef(O$);const L$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m7 14h-7a1 1 0 0 1-1-1V9a1 1 0 0 1 2 0v6h6a1 1 0 0 1 0 2"})})},N$=p.forwardRef(L$),B$=N$,F$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28 16a12 12 0 0 1-20.236 8.728 1.002 1.002 0 0 1 1.375-1.456 10 10 0 1 0-.21-14.343c-.441.446-.857.885-1.26 1.321l2.039 2.043A1 1 0 0 1 9 14H4a1 1 0 0 1-1-1V8a1 1 0 0 1 1.707-.707L6.25 8.838c.402-.437.817-.875 1.258-1.32A12 12 0 0 1 28 16M16 9a1 1 0 0 0-1 1v6a1 1 0 0 0 .485.858l5 3a.999.999 0 0 0 1.486-1.1 1 1 0 0 0-.456-.616L17 15.434V10a1 1 0 0 0-1-1"})})};p.forwardRef(F$);const V$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M20.008 5a11.01 11.01 0 0 0-9.847 6.084A10.9 10.9 0 0 0 9 15.966 1.023 1.023 0 0 1 8.071 17 1 1 0 0 1 7 16a13 13 0 0 1 .668-4.115.5.5 0 0 0-.594-.647A8.01 8.01 0 0 0 1 19c0 4.399 3.719 8 8.125 8H20a11.01 11.01 0 0 0 10.991-11.435C30.764 9.693 25.884 5 20.008 5"})})};p.forwardRef(V$);const _$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30.991 15.565C30.764 9.693 25.884 5 20.008 5a11.01 11.01 0 0 0-9.847 6.084A10.9 10.9 0 0 0 9 15.966 1.023 1.023 0 0 1 8.071 17 1 1 0 0 1 7 16a13 13 0 0 1 .668-4.115.5.5 0 0 0-.594-.647A8.01 8.01 0 0 0 1 19c0 4.399 3.719 8 8.125 8H20a11.01 11.01 0 0 0 10.991-11.435m-7.283 3.143a1 1 0 0 1-1.415 0L20 16.414V24a1 1 0 0 1-2 0v-7.586l-2.293 2.293a1 1 0 0 1-1.415-1.415l4-4a1 1 0 0 1 1.415 0l4 4a1 1 0 0 1 0 1.415"})})};p.forwardRef(_$);const z$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M8.96 12.153 4.342 16l4.618 3.848a1.5 1.5 0 1 1-1.92 2.305l-6-5a1.5 1.5 0 0 1 0-2.305l6-5a1.5 1.5 0 0 1 1.92 2.304m22 2.694-6-5a1.5 1.5 0 1 0-1.92 2.306L27.658 16l-4.618 3.848a1.5 1.5 0 1 0 1.92 2.305l6-5a1.5 1.5 0 0 0 0-2.305M20.512 3.59a1.5 1.5 0 0 0-1.922.898l-8 22a1.5 1.5 0 0 0 2.82 1.024l8-22a1.5 1.5 0 0 0-.898-1.922"})})};p.forwardRef(z$);const H$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 256 256",fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M200 40h-32a16 16 0 0 0-16-16H32a16 16 0 0 0-16 16v80a16 16 0 0 0 16 16h8v64a16 16 0 0 0 16 16h144a16 16 0 0 0 16-16V56a16 16 0 0 0-16-16m-93.66 21.66a8 8 0 0 1 11.32-11.32l24 24a8 8 0 0 1 0 11.32l-24 24a8 8 0 0 1-11.32-11.32L124.69 80Zm-64 24a8 8 0 0 1 0-11.32l24-24a8 8 0 0 1 11.32 11.32L59.31 80l18.35 18.34a8 8 0 0 1-11.32 11.32ZM200 200H56v-64h96a16 16 0 0 0 16-16V56h32Z"})})};p.forwardRef(H$);const P$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26 10H4a1 1 0 0 0-1 1v6a12.04 12.04 0 0 0 4.068 9H4a1 1 0 0 0 0 2h22a1 1 0 0 0 0-2h-3.067a12.1 12.1 0 0 0 3.375-5.011A5 5 0 0 0 31 16v-1a5 5 0 0 0-5-5m3 6a3 3 0 0 1-2.15 2.875Q27 17.944 27 17v-4.828A3 3 0 0 1 29 15zM14 7V3a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0m4 0V3a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0m-8 0V3a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0"})})};p.forwardRef(P$);const W$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29.743 13.401a1 1 0 0 0-.487-.675l-3.729-2.125-.015-4.202a1 1 0 0 0-.353-.76 14 14 0 0 0-4.59-2.584 1 1 0 0 0-.808.074L16 5.23l-3.765-2.106a1 1 0 0 0-.809-.075 14 14 0 0 0-4.585 2.594 1 1 0 0 0-.354.758L6.47 10.61 2.74 12.734a1 1 0 0 0-.486.675 13.3 13.3 0 0 0 0 5.195 1 1 0 0 0 .486.675l3.729 2.125.015 4.204a1 1 0 0 0 .353.76 14 14 0 0 0 4.59 2.583 1 1 0 0 0 .808-.073L16 26.768l3.765 2.107a1.013 1.013 0 0 0 .809.073 14 14 0 0 0 4.585-2.592 1 1 0 0 0 .354-.759l.018-4.206 3.729-2.125a1 1 0 0 0 .486-.675c.34-1.713.338-3.477-.003-5.19M16 21a5 5 0 1 1 0-10 5 5 0 0 1 0 10"})})},q$=p.forwardRef(W$),U$=q$,K$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M18.5 12V6a1.5 1.5 0 1 1 3 0v4.5H26a1.5 1.5 0 1 1 0 3h-6a1.5 1.5 0 0 1-1.5-1.5M12 18.5H6a1.5 1.5 0 1 0 0 3h4.5V26a1.5 1.5 0 1 0 3 0v-6a1.5 1.5 0 0 0-1.5-1.5m14 0h-6a1.5 1.5 0 0 0-1.5 1.5v6a1.5 1.5 0 1 0 3 0v-4.5H26a1.5 1.5 0 1 0 0-3m-14-14A1.5 1.5 0 0 0 10.5 6v4.5H6a1.5 1.5 0 1 0 0 3h6a1.5 1.5 0 0 0 1.5-1.5V6A1.5 1.5 0 0 0 12 4.5"})})};p.forwardRef(K$);const G$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M22.5 17.5h-2v-3h2a5 5 0 1 0-5-5v2h-3v-2a5 5 0 1 0-5 5h2v3h-2a5 5 0 1 0 5 5v-2h3v2a5 5 0 1 0 5-5m-2-8a2 2 0 1 1 2 2h-2zm-13 0a2 2 0 0 1 4 0v2h-2a2 2 0 0 1-2-2m4 13a2 2 0 1 1-2-2h2zm3-8h3v3h-3zm8 10a2 2 0 0 1-2-2v-2h2a2 2 0 0 1 0 4"})})};p.forwardRef(G$);const Y$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30.5 24a1.5 1.5 0 0 1-1.5 1.5h-3.5V29a1.5 1.5 0 1 1-3 0v-3.5H8A1.5 1.5 0 0 1 6.5 24V9.5H3a1.5 1.5 0 0 1 0-3h3.5V3a1.5 1.5 0 0 1 3 0v19.5H29a1.5 1.5 0 0 1 1.5 1.5M13 9.5h9.5V19a1.5 1.5 0 1 0 3 0V8A1.5 1.5 0 0 0 24 6.5H13a1.5 1.5 0 0 0 0 3"})})};p.forwardRef(Y$);const X$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26.061 23.939a1.503 1.503 0 0 1-2.125 2.125L16 18.125l-7.939 7.936a1.503 1.503 0 1 1-2.125-2.125L13.875 16 5.939 8.061a1.503 1.503 0 1 1 2.125-2.125L16 13.875l7.939-7.94a1.502 1.502 0 1 1 2.125 2.125L18.125 16z"})})},Q$=p.forwardRef(X$),ri=Q$,Z$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m4.708 16.293a1 1 0 0 1-1.415 1.415L16 17.414l-3.293 3.293a1 1 0 0 1-1.415-1.415L14.587 16l-3.293-3.293a1 1 0 1 1 1.415-1.415L16 14.587l3.293-3.293a1 1 0 0 1 1.415 1.415L17.414 16z"})})};p.forwardRef(Z$);const J$=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30.48 9.524a1.51 1.51 0 0 0-1.668-.213l-6.276 3.125-5.24-8.704a1.514 1.514 0 0 0-2.592 0l-5.24 8.708L3.19 9.315a1.514 1.514 0 0 0-2.113 1.825l4.625 14.17a1 1 0 0 0 1.46.55C7.194 25.841 10.39 24 16 24s8.806 1.841 8.835 1.859a1 1 0 0 0 1.464-.549l4.625-14.166a1.51 1.51 0 0 0-.444-1.62M21.98 19.6a1 1 0 0 1-1.159.811 28.5 28.5 0 0 0-9.652 0 1 1 0 0 1-.348-1.97 30.6 30.6 0 0 1 10.348 0 1 1 0 0 1 .816 1.159z"})})};p.forwardRef(J$);const e8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27.414 24a2 2 0 0 1 0 2.829l-.585.585a2 2 0 0 1-2.829 0l-6.906-6.905-2.735 6.292A1.98 1.98 0 0 1 12.533 28h-.098a1.98 1.98 0 0 1-1.801-1.375L4.1 6.615A1.994 1.994 0 0 1 6.615 4.1l20.01 6.534a2 2 0 0 1 .176 3.725l-6.292 2.735z"})})};p.forwardRef(e8);const t8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3C9.271 3 4 6.075 4 10v12c0 3.925 5.271 7 12 7s12-3.075 12-7V10c0-3.925-5.271-7-12-7m10 13c0 1.203-.985 2.429-2.701 3.365C21.366 20.419 18.774 21 16 21s-5.366-.581-7.299-1.635C6.985 18.429 6 17.203 6 16v-2.08C8.133 15.795 11.779 17 16 17s7.868-1.21 10-3.08zm-2.701 9.365C21.366 26.419 18.774 27 16 27s-5.366-.581-7.299-1.635C6.985 24.429 6 23.203 6 22v-2.08C8.133 21.795 11.779 23 16 23s7.868-1.21 10-3.08V22c0 1.203-.985 2.429-2.701 3.365"})})};p.forwardRef(t8);const n8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29 12a2 2 0 0 0-2-2h-4V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v16a1 1 0 0 0 1.625.777L9 19.25V23a2 2 0 0 0 2 2h11.699l4.676 3.778A1 1 0 0 0 29 28zm-5.319 11.223a1 1 0 0 0-.625-.223H11v-4h10a2 2 0 0 0 2-2v-5h4v13.906z"})})};p.forwardRef(n8);const r8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 19v7a2.5 2.5 0 0 1-2.5 2.5H6A2.5 2.5 0 0 1 3.5 26v-7a1.5 1.5 0 0 1 3 0v6.5h19V19a1.5 1.5 0 1 1 3 0m-13.561 1.061a1.5 1.5 0 0 0 2.125 0l5-5a1.502 1.502 0 1 0-2.125-2.125L17.5 15.375V5a1.5 1.5 0 1 0-3 0v10.375l-2.439-2.436a1.502 1.502 0 1 0-2.125 2.125z"})})};p.forwardRef(r8);const i8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M13.5 7.5a2 2 0 1 1-4 0 2 2 0 0 1 4 0m7 2a2 2 0 1 0 0-4 2 2 0 0 0 0 4m-9 4.5a2 2 0 1 0 0 4 2 2 0 0 0 0-4m9 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4m-9 8.5a2 2 0 1 0 0 4 2 2 0 0 0 0-4m9 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4"})})},o8=p.forwardRef(i8),s8=o8,a8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 4H11a1 1 0 0 0-1 1v5H5a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1v-5h5a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1m-1 16h-4v-9a1 1 0 0 0-1-1h-9V6h14z"})})};p.forwardRef(a8);const l8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m11 13c.001 1.411-.27 2.81-.8 4.118l-5.587-3.437a2 2 0 0 0-.78-.279l-2.853-.385a2.01 2.01 0 0 0-2 .983h-1.09l-.475-.983a1.99 1.99 0 0 0-1.375-1.083l-1-.216.978-1.718h2.088c.338 0 .67-.087.966-.25l1.532-.845q.202-.113.375-.268l3.364-3.042a1.99 1.99 0 0 0 .407-2.458l-.045-.08A11.01 11.01 0 0 1 27 16M5 16a10.94 10.94 0 0 1 1.068-4.725l1.417 3.784a2 2 0 0 0 1.453 1.25l2.678.576.476.99a2.01 2.01 0 0 0 1.8 1.125h.186l-.904 2.029a2 2 0 0 0 .357 2.171l.018.018L16 25.742l-.242 1.25A11.014 11.014 0 0 1 5 16"})})},c8=p.forwardRef(l8),d8=c8,u8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:[u.jsx("path",{d:"M20.689 3.88A13 13 0 0 0 16 3a13 13 0 0 0-8.155 23.124l1.02-1.765A11 11 0 0 1 5 16a10.94 10.94 0 0 1 1.068-4.724l1.417 3.784a2 2 0 0 0 1.453 1.25l2.678.576.476.99q.113.226.275.418l1.169-2.025-.121-.25a1.99 1.99 0 0 0-1.375-1.084l-1-.217.978-1.717h2.088c.338 0 .67-.087.966-.25l.726-.4z"}),u.jsx("path",{fillRule:"evenodd",d:"m24 2.144 1.732 1-1.58 2.736q.54.435 1.036.932A13.01 13.01 0 0 1 29 16a13 13 0 0 1-17.69 12.124l-1.578 2.732-1.732-1zm-.86 5.49-4.936 8.549 1.628.22c.277.037.543.132.78.278l5.588 3.436c.53-1.308.801-2.706.8-4.117a11.01 11.01 0 0 0-3.86-8.367M13.92 23.6l-1.593 2.76a11 11 0 0 0 3.43.631l.242-1.25z",clipRule:"evenodd"})]})};p.forwardRef(u8);const h8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m-4.5 9a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m10.365 7.5C20.579 21.724 18.441 23 16 23s-4.579-1.275-5.865-3.5a1.001 1.001 0 0 1 1.477-1.31q.157.129.253.31C12.799 20.114 14.266 21 16 21s3.201-.887 4.135-2.5a1 1 0 1 1 1.73 1M20.5 15a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"})})};p.forwardRef(h8);const f8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m-4.5 9a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m10 10.865a1 1 0 0 1-1.365-.365C19.201 20.886 17.734 20 16 20s-3.201.887-4.135 2.5a1.001 1.001 0 1 1-1.73-1C11.421 19.276 13.559 18 16 18s4.579 1.275 5.865 3.5a1 1 0 0 1-.365 1.365M20.5 15a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"})})};p.forwardRef(f8);const m8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27.5 6v5a1.5 1.5 0 1 1-3 0V7.5H21a1.5 1.5 0 0 1 0-3h5A1.5 1.5 0 0 1 27.5 6M11 24.5H7.5V21a1.5 1.5 0 0 0-3 0v5A1.5 1.5 0 0 0 6 27.5h5a1.5 1.5 0 1 0 0-3m15-5a1.5 1.5 0 0 0-1.5 1.5v3.5H21a1.5 1.5 0 1 0 0 3h5a1.5 1.5 0 0 0 1.5-1.5v-5a1.5 1.5 0 0 0-1.5-1.5m-15-15H6A1.5 1.5 0 0 0 4.5 6v5a1.5 1.5 0 0 0 3 0V7.5H11a1.5 1.5 0 0 0 0-3"})})};p.forwardRef(m8);const p8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 13a1.5 1.5 0 1 1-3 0V8.625l-7.439 7.439a1.503 1.503 0 1 1-2.125-2.125L23.375 6.5H19a1.5 1.5 0 0 1 0-3h8A1.5 1.5 0 0 1 28.5 5zM23 16a1.5 1.5 0 0 0-1.5 1.5v8h-15v-15h8a1.5 1.5 0 1 0 0-3H6A2.5 2.5 0 0 0 3.5 10v16A2.5 2.5 0 0 0 6 28.5h16a2.5 2.5 0 0 0 2.5-2.5v-8.5A1.5 1.5 0 0 0 23 16"})})},g8=p.forwardRef(p8),b8=g8,v8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30.914 15.595c-.044-.099-1.103-2.447-3.457-4.801C24.322 7.657 20.36 6 16 6S7.679 7.657 4.542 10.794C2.19 13.148 1.125 15.5 1.086 15.595a1 1 0 0 0 0 .812c.044.1 1.103 2.447 3.456 4.8C7.68 24.344 11.64 26 16 26s8.321-1.657 11.458-4.792c2.353-2.354 3.412-4.702 3.456-4.8a1 1 0 0 0 0-.813M16 21a5 5 0 1 1 0-10 5 5 0 0 1 0 10"})})},x8=p.forwardRef(v8),r2=x8,w8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M6.74 4.328a1 1 0 1 0-1.48 1.345l2.405 2.646c-4.54 2.786-6.493 7.081-6.579 7.276a1 1 0 0 0 0 .813c.044.098 1.103 2.446 3.456 4.8C7.68 24.343 11.64 26 16 26c2.24.013 4.459-.448 6.509-1.354l2.75 3.027a1 1 0 1 0 1.48-1.345zm11.125 15.21a4 4 0 0 1-5.209-5.73zm13.049-3.13c-.053.117-1.319 2.92-4.17 5.475a1 1 0 0 1-1.408-.072L12.675 7.884a1 1 0 0 1 .575-1.66A17 17 0 0 1 16 6c4.36 0 8.321 1.658 11.458 4.794 2.353 2.354 3.412 4.702 3.456 4.801a1 1 0 0 1 0 .813"})})},y8=p.forwardRef(w8),C8=y8,$8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M17 15v12a1 1 0 0 1-2 0V15a1 1 0 0 1 2 0m8 9a1 1 0 0 0-1 1v2a1 1 0 0 0 2 0v-2a1 1 0 0 0-1-1m3-6h-2V5a1 1 0 0 0-2 0v13h-2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1M7 20a1 1 0 0 0-1 1v6a1 1 0 1 0 2 0v-6a1 1 0 0 0-1-1m3-6H8V5a1 1 0 0 0-2 0v9H4a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1m9-6h-2V5a1 1 0 0 0-2 0v3h-2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V9a1 1 0 0 0-1-1"})})};p.forwardRef($8);const S8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m26.48 16.851-7.474 7.559a1.97 1.97 0 0 1-1.4.585H9.415l-3.707 3.712a1.001 1.001 0 0 1-1.415-1.415l2.823-2.822L15.588 16h10.537a.5.5 0 0 1 .355.851m.607-13.03a8 8 0 0 0-10.737.518l-1.2 1.185a.5.5 0 0 0-.15.351v7.875l6.875-6.875a1 1 0 0 1 1.414 1.414L17.589 14h11.047a.5.5 0 0 0 .445-.27 8.01 8.01 0 0 0-1.994-9.909M7.854 20.904 13 15.758V8.845a.5.5 0 0 0-.851-.355L7.586 13A1.99 1.99 0 0 0 7 14.414v6.136a.5.5 0 0 0 .854.354"})})},k8=p.forwardRef(S8),A8=k8,R8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m26.708 10.293-7-7A1 1 0 0 0 19 3H7a2 2 0 0 0-2 2v22a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V11a1 1 0 0 0-.293-.707M19 11V5.5l5.5 5.5z"})})};p.forwardRef(R8);const T8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 256 256",fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m213.66 82.34-56-56A8 8 0 0 0 152 24H56a16 16 0 0 0-16 16v76a4 4 0 0 0 4 4h168a4 4 0 0 0 4-4V88a8 8 0 0 0-2.34-5.66M152 88V44l44 44ZM48 180c0 11 7.18 20 16 20a14.18 14.18 0 0 0 10.06-4.5 8.21 8.21 0 0 1 10.9-.91 8 8 0 0 1 .82 11.81A30.06 30.06 0 0 1 64 216c-17.64 0-32-16.15-32-36s14.36-36 32-36a30 30 0 0 1 21.39 9.19 8.26 8.26 0 0 1 .73 11.09 8 8 0 0 1-11.9.38A14.17 14.17 0 0 0 64 160c-8.82 0-16 9-16 20m103.81 16.31a20.82 20.82 0 0 1-9.19 15.23C137.43 215 131 216 125.13 216a61.1 61.1 0 0 1-15.13-2 8 8 0 1 1 4.3-15.41c4.38 1.2 14.95 2.7 19.55-.36.88-.59 1.83-1.52 2.14-3.93.35-2.67-.71-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.11a20.56 20.56 0 0 1 9-14.95c11.84-8 30.71-3.31 32.83-2.76a8 8 0 0 1-4.07 15.48c-4.49-1.17-15.23-2.56-19.83.56a4.54 4.54 0 0 0-2 3.67c-.12.9-.14 1.09 1.11 1.9 2.31 1.49 6.45 2.68 10.45 3.84 9.79 2.83 26.35 7.66 24.11 24.97M215.42 155l-19.89 55.68a8 8 0 0 1-15.06 0L160.58 155a8.21 8.21 0 0 1 4.5-10.45 8 8 0 0 1 10.45 4.76l12.47 34.9 12.47-34.9a8 8 0 0 1 10.45-4.76 8.23 8.23 0 0 1 4.5 10.45"})})};p.forwardRef(T8);const M8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m26.708 10.293-7-7A1 1 0 0 0 19 3H7a2 2 0 0 0-2 2v22a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V11a1 1 0 0 0-.293-.707m-7 11a1 1 0 0 1-1.415 1.415L16 20.414l-2.293 2.293a1 1 0 0 1-1.415-1.415L14.587 19l-2.293-2.293a1 1 0 1 1 1.415-1.415L16 17.587l2.293-2.293a1 1 0 0 1 1.415 1.415L17.414 19zM19 11V5.5l5.5 5.5z"})})};p.forwardRef(M8);const E8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M6 15h20a1 1 0 0 0 1-1v-3a1 1 0 0 0-.293-.707l-7-7A1 1 0 0 0 19 3H7a2 2 0 0 0-2 2v9a1 1 0 0 0 1 1m13-9.5 5.5 5.5H19zM28 19a1 1 0 0 1-1 1h-3v2h2a1 1 0 0 1 0 2h-2v2a1 1 0 0 1-2 0v-7a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1M8 18H6a1 1 0 0 0-1 1v7a1 1 0 1 0 2 0v-1h1a3.5 3.5 0 1 0 0-7m0 5H7v-3h1a1.5 1.5 0 1 1 0 3m8-5h-2a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h2a4.5 4.5 0 1 0 0-9m0 7h-1v-5h1a2.5 2.5 0 0 1 0 5"})})};p.forwardRef(E8);const I8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 256 256",fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M44 120h168a4 4 0 0 0 4-4V88a8 8 0 0 0-2.34-5.66l-56-56A8 8 0 0 0 152 24H56a16 16 0 0 0-16 16v76a4 4 0 0 0 4 4m108-76 44 44h-44Zm4 164.53a8.18 8.18 0 0 1-8.25 7.47H120a8 8 0 0 1-8-8v-55.73a8.18 8.18 0 0 1 7.47-8.25 8 8 0 0 1 8.53 8v48h20a8 8 0 0 1 8 8.51m-61.49-51.88L77.83 180l16.68 23.35a8 8 0 0 1-13 9.3L68 193.76l-13.49 18.89a8 8 0 1 1-13-9.3L58.17 180l-16.68-23.35a8 8 0 0 1 2.3-11.46 8.19 8.19 0 0 1 10.88 2.38L68 166.24l13.49-18.89a8 8 0 0 1 13 9.3Zm121.28 39.66a20.81 20.81 0 0 1-9.18 15.23c-5.19 3.46-11.67 4.46-17.49 4.46a60.6 60.6 0 0 1-15.19-2 8 8 0 0 1 4.31-15.41c4.38 1.21 14.94 2.71 19.54-.35.89-.6 1.84-1.52 2.15-3.93.34-2.67-.72-4.1-12.78-7.59-9.35-2.7-25-7.23-23-23.12a20.58 20.58 0 0 1 8.95-14.94c11.84-8 30.72-3.31 32.83-2.76a8 8 0 0 1-4.07 15.48c-4.48-1.17-15.22-2.56-19.82.56a4.54 4.54 0 0 0-2 3.67c-.11.9-.13 1.08 1.12 1.9 2.31 1.49 6.45 2.68 10.45 3.84 9.87 2.82 26.39 7.65 24.18 24.96"})})};p.forwardRef(I8);const j8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 256 256",fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M184 144h-16a8 8 0 0 0-8 8v55.73a8.17 8.17 0 0 0 7.47 8.25 8 8 0 0 0 8.53-8v-8h7.4c15.24 0 28.14-11.92 28.59-27.15A28 28 0 0 0 184 144m-.35 40H176v-24h8a12 12 0 0 1 12 13.16A12.25 12.25 0 0 1 183.65 184M136 152v55.73a8.17 8.17 0 0 1-7.47 8.25 8 8 0 0 1-8.53-8v-55.71a8.17 8.17 0 0 1 7.47-8.25A8 8 0 0 1 136 152m-40 56.53a8.17 8.17 0 0 1-8.27 7.47h-31.5a8.27 8.27 0 0 1-6-2.5 8 8 0 0 1-1.18-9.5l25.16-44H56.27a8.17 8.17 0 0 1-8.27-7.47 8 8 0 0 1 8-8.53h31.77a8.27 8.27 0 0 1 6 2.5A8 8 0 0 1 95 156l-25.21 44H88a8 8 0 0 1 8 8.53M213.66 82.34l-56-56A8 8 0 0 0 152 24H56a16 16 0 0 0-16 16v76a4 4 0 0 0 4 4h168a4 4 0 0 0 4-4V88a8 8 0 0 0-2.34-5.66M152 88V44l44 44Z"})})};p.forwardRef(j8);const D8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M25.5 16a1.5 1.5 0 0 1-1.5 1.5H8a1.5 1.5 0 1 1 0-3h16a1.5 1.5 0 0 1 1.5 1.5M29 8.5H3a1.5 1.5 0 0 0 0 3h26a1.5 1.5 0 1 0 0-3m-10 12h-6a1.5 1.5 0 1 0 0 3h6a1.5 1.5 0 1 0 0-3"})})};p.forwardRef(D8);const O8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 9H16.414L13 5.586A1.98 1.98 0 0 0 11.586 5H5a2 2 0 0 0-2 2v18.078A1.926 1.926 0 0 0 4.924 27H27.11A1.89 1.89 0 0 0 29 25.111V11a2 2 0 0 0-2-2M5 7h6.586l2 2H5z"})})};p.forwardRef(O8);const L8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 9h-4.385q.075-.06.146-.125A3.7 3.7 0 0 0 24 6.196 4.08 4.08 0 0 0 19.805 2a3.7 3.7 0 0 0-2.68 1.239A6.9 6.9 0 0 0 16 5.049a6.9 6.9 0 0 0-1.125-1.81A3.7 3.7 0 0 0 12.195 2 4.08 4.08 0 0 0 8 6.196a3.7 3.7 0 0 0 1.239 2.679q.072.06.146.125H5a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2v8a2 2 0 0 0 2 2h7.5a.5.5 0 0 0 .5-.5V15H5v-4h10v4h2v-4h10v4H17v11.5a.5.5 0 0 0 .5.5H25a2 2 0 0 0 2-2v-8a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2M10.564 7.375A1.7 1.7 0 0 1 10 6.125 2.076 2.076 0 0 1 12.074 4h.061a1.71 1.71 0 0 1 1.25.563c1.049 1.185 1.419 3.15 1.549 4.365-1.22-.13-3.184-.5-4.37-1.553m10.875 0c-1.186 1.05-3.155 1.42-4.375 1.55.148-1.314.561-3.237 1.561-4.361A1.7 1.7 0 0 1 19.875 4h.061A2.077 2.077 0 0 1 22 6.135a1.7 1.7 0 0 1-.564 1.24z"})})};p.forwardRef(L8);const N8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m9.796 8h-4.428a17.8 17.8 0 0 0-2.533-5.625A11.05 11.05 0 0 1 25.796 11M16 5.014c1.5 1.625 2.625 3.693 3.296 5.986h-6.592C13.375 8.707 14.5 6.641 16 5.014M12 16c0-1.005.084-2.009.25-3h7.5a18.2 18.2 0 0 1 0 6h-7.5a18 18 0 0 1-.25-3m.704 5h6.592c-.671 2.293-1.796 4.359-3.296 5.986-1.5-1.627-2.625-3.693-3.296-5.986m6.131 5.625A17.8 17.8 0 0 0 21.367 21h4.43a11.05 11.05 0 0 1-6.962 5.625M21.776 19a20.2 20.2 0 0 0 0-6h4.808a11 11 0 0 1 0 6z"})})};p.forwardRef(N8);const B8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{fillRule:"evenodd",d:"M13.29 28.226 6.765 24.46a2.822 2.822 0 1 1-2.708-4.693v-7.532a2.824 2.824 0 1 1 2.708-4.693l6.525-3.767a2.824 2.824 0 1 1 5.42 0l6.524 3.766a2.822 2.822 0 1 1 2.71 4.693v7.533a2.824 2.824 0 1 1-2.71 4.694l-6.524 3.766A2.825 2.825 0 0 1 16 31.84a2.822 2.822 0 0 1-2.71-3.614M16 5.806q.413-.002.791-.113l8.531 14.776a2.8 2.8 0 0 0-.791 1.37H7.467a2.8 2.8 0 0 0-.79-1.369L15.21 5.693q.377.11.791.112M7.468 23.178l-.033.12 6.526 3.767A2.81 2.81 0 0 1 16 26.195c.802 0 1.526.334 2.04.871l6.523-3.766-.032-.121zM5.397 12.233a2.824 2.824 0 0 0 2.038-3.532l6.526-3.767q.043.045.088.088L5.517 19.8l-.12-.032zM26.482 19.8q.06-.018.121-.033v-7.532a2.824 2.824 0 0 1-2.04-3.534L18.04 4.934q-.045.045-.089.088z",clipRule:"evenodd"})})};p.forwardRef(B8);const F8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 7v7.5a.5.5 0 0 1-.5.5H17V5.5a.5.5 0 0 1 .5-.5H25a2 2 0 0 1 2 2M14.5 5H7a2 2 0 0 0-2 2v7.5a.5.5 0 0 0 .5.5H15V5.5a.5.5 0 0 0-.5-.5m12 12H17v9.5a.5.5 0 0 0 .5.5H25a2 2 0 0 0 2-2v-7.5a.5.5 0 0 0-.5-.5M5 17.5V25a2 2 0 0 0 2 2h7.5a.5.5 0 0 0 .5-.5V17H5.5a.5.5 0 0 0-.5.5"})})};p.forwardRef(F8);const V8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M10.5 6.5v5h-7A.5.5 0 0 1 3 11V8a2 2 0 0 1 2-2h5a.5.5 0 0 1 .5.5m2 19a.5.5 0 0 0 .5.5h6a.5.5 0 0 0 .5-.5v-5h-7zM3 21v3a2 2 0 0 0 2 2h5a.5.5 0 0 0 .5-.5v-5h-7a.5.5 0 0 0-.5.5m0-7v4a.5.5 0 0 0 .5.5h7v-5h-7a.5.5 0 0 0-.5.5m16-8h-6a.5.5 0 0 0-.5.5v5h7v-5A.5.5 0 0 0 19 6m9.5 7.5h-7v5h7a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 0-.5-.5m-16 5h7v-5h-7zM27 6h-5a.5.5 0 0 0-.5.5v5h7a.5.5 0 0 0 .5-.5V8a2 2 0 0 0-2-2m1.5 14.5h-7v5a.5.5 0 0 0 .5.5h5a2 2 0 0 0 2-2v-3a.5.5 0 0 0-.5-.5"})})};p.forwardRef(V8);const _8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.791 17.633a3.04 3.04 0 0 0-2.326-.597C28.813 14.666 30 12.31 30 10c0-3.309-2.661-6-5.933-6A5.95 5.95 0 0 0 19.5 6.094 5.95 5.95 0 0 0 14.932 4C11.663 4 9 6.691 9 10c0 1.375.405 2.711 1.258 4.125a4 4 0 0 0-1.844 1.05L5.586 18H2a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h13q.123 0 .242-.03l8-2a1 1 0 0 0 .15-.05l4.858-2.067.055-.025a3.074 3.074 0 0 0 .491-5.195zm-1.362 3.393-4.75 2.023L14.875 25H7v-5.586l2.829-2.828A1.98 1.98 0 0 1 11.242 16H17.5a1.5 1.5 0 0 1 0 3H14a1 1 0 0 0 0 2h4q.113 0 .224-.025l8.375-1.926.038-.01a1.075 1.075 0 0 1 .788 1.987z"})})};p.forwardRef(_8);const z8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28 10.5h-5.475l.951-5.231a1.5 1.5 0 1 0-2.952-.538L19.475 10.5h-4.95l.951-5.231a1.5 1.5 0 1 0-2.952-.538L11.475 10.5H6a1.5 1.5 0 0 0 0 3h4.93l-.909 5H4a1.5 1.5 0 0 0 0 3h5.475l-.951 5.231a1.5 1.5 0 0 0 1.207 1.75q.134.022.269.019a1.5 1.5 0 0 0 1.475-1.233l1.05-5.767h4.95l-.951 5.231a1.5 1.5 0 1 0 2.952.543l1.049-5.774H26a1.5 1.5 0 1 0 0-3h-4.93l.909-5H28a1.5 1.5 0 1 0 0-3m-9.979 8H13.07l.909-5h4.951z"})})};p.forwardRef(z8);const H8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M31.5 22.5a5 5 0 0 1-5 5 4.94 4.94 0 0 1-3.571-1.45 1.5 1.5 0 0 1 2.142-2.1 1.94 1.94 0 0 0 1.429.55 2 2 0 0 0 0-4 1.94 1.94 0 0 0-1.429.55 1.5 1.5 0 0 1-2.551-1.3l1-6A1.5 1.5 0 0 1 25 12.5h5a1.5 1.5 0 1 1 0 3h-3.729l-.338 2.029q.283-.03.567-.029a5 5 0 0 1 5 5M18 5.5A1.5 1.5 0 0 0 16.5 7v6h-10V7a1.5 1.5 0 0 0-3 0v15a1.5 1.5 0 0 0 3 0v-6h10v6a1.5 1.5 0 1 0 3 0V7A1.5 1.5 0 0 0 18 5.5"})})};p.forwardRef(H8);const P8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M32 22a1.5 1.5 0 0 1-1.5 1.5V26a1.5 1.5 0 1 1-3 0v-2.5H23a1.5 1.5 0 0 1-1.422-1.974l3-9a1.5 1.5 0 0 1 2.845.948L25.08 20.5H27.5V18a1.5 1.5 0 1 1 3 0v2.5A1.5 1.5 0 0 1 32 22M18 5.5A1.5 1.5 0 0 0 16.5 7v6h-10V7a1.5 1.5 0 0 0-3 0v15a1.5 1.5 0 0 0 3 0v-6h10v6a1.5 1.5 0 1 0 3 0V7A1.5 1.5 0 0 0 18 5.5"})})};p.forwardRef(P8);const W8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29.5 14v12a1.5 1.5 0 1 1-3 0v-9.198l-.668.448a1.503 1.503 0 0 1-1.665-2.5l3-2A1.5 1.5 0 0 1 29.5 14M18 5.5A1.5 1.5 0 0 0 16.5 7v6h-10V7a1.5 1.5 0 0 0-3 0v15a1.5 1.5 0 0 0 3 0v-6h10v6a1.5 1.5 0 1 0 3 0V7A1.5 1.5 0 0 0 18 5.5"})})};p.forwardRef(W8);const q8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m27.133 17.541 1.655-2.772a1.5 1.5 0 1 0-2.576-1.538l-4.03 6.75q-.018.029-.032.059a5 5 0 1 0 4.983-2.5zM26.5 24.5a2 2 0 1 1 0-4 2 2 0 0 1 0 4M19.5 7v15a1.5 1.5 0 1 1-3 0v-6h-10v6a1.5 1.5 0 0 1-3 0V7a1.5 1.5 0 0 1 3 0v6h10V7a1.5 1.5 0 1 1 3 0"})})};p.forwardRef(q8);const U8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M31.5 22.5a5 5 0 0 1-8.571 3.5 1.5 1.5 0 1 1 2.142-2.099A2 2 0 1 0 26.5 20.5a1.5 1.5 0 0 1-1.229-2.36l1.854-2.64H24a1.5 1.5 0 1 1 0-3h6a1.5 1.5 0 0 1 1.229 2.36l-2.293 3.275A5 5 0 0 1 31.5 22.5M18 5.5A1.5 1.5 0 0 0 16.5 7v6h-10V7a1.5 1.5 0 0 0-3 0v15a1.5 1.5 0 0 0 3 0v-6h10v6a1.5 1.5 0 1 0 3 0V7A1.5 1.5 0 0 0 18 5.5"})})};p.forwardRef(U8);const K8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M19.5 7v15a1.5 1.5 0 1 1-3 0v-6h-10v6a1.5 1.5 0 0 1-3 0V7a1.5 1.5 0 0 1 3 0v6h10V7a1.5 1.5 0 1 1 3 0M30 24.5h-3l3.593-4.791a4.499 4.499 0 1 0-7.837-4.209 1.5 1.5 0 1 0 2.829 1q.076-.218.216-.402a1.5 1.5 0 1 1 2.394 1.807L22.8 25.1a1.5 1.5 0 0 0 1.2 2.4h6a1.5 1.5 0 1 0 0-3"})})};p.forwardRef(K8);const G8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29 17v7a3 3 0 0 1-3 3h-2a3 3 0 0 1-3-3v-5a3 3 0 0 1 3-3h2.956A10.964 10.964 0 0 0 16.081 6H16A11 11 0 0 0 5.045 16H8a3 3 0 0 1 3 3v5a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3v-7a13.014 13.014 0 0 1 22.236-9.167A12.93 12.93 0 0 1 29 17"})})};p.forwardRef(G8);const Y8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30 11.75c0 8.75-12.974 15.833-13.526 16.125a1 1 0 0 1-.948 0C14.974 27.582 2 20.5 2 11.75A7.76 7.76 0 0 1 9.75 4c2.581 0 4.841 1.11 6.25 2.986C17.409 5.11 19.669 4 22.25 4A7.76 7.76 0 0 1 30 11.75"})})};p.forwardRef(Y8);const X8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28 14.444V26a2 2 0 0 1-2 2h-5a2 2 0 0 1-2-2v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V14.444a2 2 0 0 1 .646-1.473l10-9.435.014-.013a2 2 0 0 1 2.705.013l10 9.435A2 2 0 0 1 28 14.444"})})};p.forwardRef(X8);const Q8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 5H5a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h22a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-7.5 6a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3M5 25v-3.5l6.5-6.5 10 10zm22 0h-2.671l-4.5-4.5 2.5-2.5L27 22.672z"})})};p.forwardRef(Q8);const Z8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 5H9a2 2 0 0 0-2 2v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2v-2h2a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-5.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3M23 25H5V11h2v10a2 2 0 0 0 2 2h14zm4-4H9v-4.5l4.5-4.5 6.208 6.208a1 1 0 0 0 1.413 0L24.33 15 27 17.672z"})})};p.forwardRef(Z8);const J8=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 16a1.5 1.5 0 0 1-1.5 1.5H15a1.5 1.5 0 0 1 0-3h12a1.5 1.5 0 0 1 1.5 1.5M15 9.5h12a1.5 1.5 0 0 0 0-3H15a1.5 1.5 0 0 0 0 3m12 13H5a1.5 1.5 0 1 0 0 3h22a1.5 1.5 0 0 0 0-3m-18-4a1.5 1.5 0 0 0 1.061-2.561L6.125 12l3.936-3.94a1.503 1.503 0 1 0-2.125-2.125l-5 5a1.5 1.5 0 0 0 0 2.125l5 5A1.5 1.5 0 0 0 9 18.5"})})};p.forwardRef(J8);const eS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 16a1.5 1.5 0 0 1-1.5 1.5H15a1.5 1.5 0 0 1 0-3h12a1.5 1.5 0 0 1 1.5 1.5M15 9.5h12a1.5 1.5 0 0 0 0-3H15a1.5 1.5 0 0 0 0 3m12 13H5a1.5 1.5 0 0 0 0 3h22a1.5 1.5 0 1 0 0-3M3.939 18.06a1.5 1.5 0 0 0 2.125 0l5-5a1.5 1.5 0 0 0 0-2.125l-5-5a1.503 1.503 0 0 0-2.125 2.125L7.875 12l-3.936 3.939a1.5 1.5 0 0 0 0 2.122"})})};p.forwardRef(eS);const tS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m-.5 6a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3M17 23a2 2 0 0 1-2-2v-5a1 1 0 0 1 0-2 2 2 0 0 1 2 2v5a1 1 0 0 1 0 2"})})},nS=p.forwardRef(tS),i2=nS,rS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M25.5 7A1.5 1.5 0 0 1 24 8.5h-3.919l-5 15H18a1.5 1.5 0 1 1 0 3H8a1.5 1.5 0 1 1 0-3h3.919l5-15H14a1.5 1.5 0 0 1 0-3h10A1.5 1.5 0 0 1 25.5 7"})})};p.forwardRef(rS);const iS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M20 2a10.01 10.01 0 0 0-9.511 13.098l-7.196 7.195A1 1 0 0 0 3 23v5a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1v-2h2a1 1 0 0 0 1-1v-2h2a1 1 0 0 0 .707-.293l1.195-1.196A10 10 0 1 0 20 2m2.5 9.5a2 2 0 1 1 0-4 2 2 0 0 1 0 4"})})};p.forwardRef(iS);const oS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 5H5a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h22a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2M5 7h22v5H5zm22 18H14V14h13z"})})};p.forwardRef(oS);const sS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M22 29a1 1 0 0 1-1 1H11a1 1 0 1 1 0-2h10a1 1 0 0 1 1 1m5-16a10.94 10.94 0 0 1-4.205 8.651A2.03 2.03 0 0 0 22 23.25V24a2 2 0 0 1-2 2h-8a2 2 0 0 1-2-2v-.75a2 2 0 0 0-.779-1.582A10.95 10.95 0 0 1 5 13.06C4.967 7.104 9.782 2.143 15.735 2A11 11 0 0 1 27 13m-4.014-1.168a7.2 7.2 0 0 0-5.82-5.818 1 1 0 1 0-.332 1.972c2.071.349 3.829 2.106 4.18 4.182a1 1 0 0 0 1.972-.335"})})};p.forwardRef(sS);const aS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m21.731 14.683-14 15a1 1 0 0 1-1.711-.875l1.832-9.167L.65 16.936a1 1 0 0 1-.375-1.625l14-15a1 1 0 0 1 1.71.875l-1.837 9.177 7.204 2.7a1 1 0 0 1 .375 1.62z"})})};p.forwardRef(aS);const lS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M17.046 23.441a1.5 1.5 0 0 1 0 2.125l-.742.743a7.502 7.502 0 1 1-10.61-10.61l3.015-3.014A7.5 7.5 0 0 1 19 12.375a1.506 1.506 0 0 1-2 2.25 4.5 4.5 0 0 0-6.171.184l-3.013 3.01a4.5 4.5 0 0 0 6.365 6.365l.743-.743a1.5 1.5 0 0 1 2.122 0m9.26-17.75a7.51 7.51 0 0 0-10.61 0l-.742.743a1.503 1.503 0 1 0 2.125 2.125l.742-.743a4.5 4.5 0 0 1 6.365 6.365l-3.014 3.015a4.5 4.5 0 0 1-6.172.179 1.506 1.506 0 1 0-2 2.25 7.5 7.5 0 0 0 10.288-.304l3.014-3.014a7.51 7.51 0 0 0 .004-10.613z"})})},cS=p.forwardRef(lS),dS=cS,uS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 16a1.5 1.5 0 0 1-1.5 1.5H5a1.5 1.5 0 1 1 0-3h22a1.5 1.5 0 0 1 1.5 1.5M5 9.5h22a1.5 1.5 0 0 0 0-3H5a1.5 1.5 0 0 0 0 3m22 13H5a1.5 1.5 0 1 0 0 3h22a1.5 1.5 0 1 0 0-3"})})};p.forwardRef(uS);const hS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M3.5 8A1.5 1.5 0 0 1 5 6.5h22a1.5 1.5 0 0 1 0 3H5A1.5 1.5 0 0 1 3.5 8M5 17.5h22a1.5 1.5 0 1 0 0-3H5a1.5 1.5 0 1 0 0 3m13 5H5a1.5 1.5 0 1 0 0 3h13a1.5 1.5 0 1 0 0-3m11 0h-1.5V21a1.5 1.5 0 1 0-3 0v1.5H23a1.5 1.5 0 1 0 0 3h1.5V27a1.5 1.5 0 1 0 3 0v-1.5H29a1.5 1.5 0 1 0 0-3"})})},fS=p.forwardRef(hS),mS=fS,pS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 256 256",fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28 64a12 12 0 0 1 12-12h176a12 12 0 0 1 0 24H40a12 12 0 0 1-12-12m12 76h64a12 12 0 0 0 0-24H40a12 12 0 0 0 0 24m80 40H40a12 12 0 0 0 0 24h80a12 12 0 0 0 0-24m120.49 20.49a12 12 0 0 1-17 0l-18.08-18.08a44 44 0 1 1 17-17l18.08 18.07a12 12 0 0 1 0 17.01M184 164a20 20 0 1 0-20-20 20 20 0 0 0 20 20"})})};p.forwardRef(pS);const gS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M17.5 4v4a1.5 1.5 0 1 1-3 0V4a1.5 1.5 0 1 1 3 0m4.156 7.844a1.5 1.5 0 0 0 1.062-.44l2.828-2.829a1.503 1.503 0 1 0-2.125-2.125l-2.825 2.833a1.5 1.5 0 0 0 1.06 2.56M28 14.5h-4a1.5 1.5 0 1 0 0 3h4a1.5 1.5 0 1 0 0-3m-5.282 6.096a1.501 1.501 0 0 0-2.451 1.638c.075.182.186.348.326.487l2.828 2.829a1.503 1.503 0 0 0 2.125-2.125zM16 22.5a1.5 1.5 0 0 0-1.5 1.5v4a1.5 1.5 0 1 0 3 0v-4a1.5 1.5 0 0 0-1.5-1.5m-6.717-1.904-2.83 2.829A1.503 1.503 0 0 0 8.58 25.55l2.829-2.829a1.503 1.503 0 0 0-2.125-2.125M9.5 16A1.5 1.5 0 0 0 8 14.5H4a1.5 1.5 0 1 0 0 3h4A1.5 1.5 0 0 0 9.5 16m-.925-9.546A1.503 1.503 0 0 0 6.45 8.579l2.833 2.825a1.503 1.503 0 0 0 2.125-2.125z"})})},bS=p.forwardRef(gS),o2=bS,vS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26 10h-4V7a6 6 0 1 0-12 0v3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V12a2 2 0 0 0-2-2M16 20.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3M20 10h-8V7a4 4 0 1 1 8 0z"})})};p.forwardRef(vS);const xS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M31 19a1 1 0 0 1-1 1h-2v2a1 1 0 0 1-2 0v-2h-2a1 1 0 0 1 0-2h2v-2a1 1 0 1 1 2 0v2h2a1 1 0 0 1 1 1M7 9h2v2a1 1 0 1 0 2 0V9h2a1 1 0 0 0 0-2h-2V5a1 1 0 0 0-2 0v2H7a1 1 0 0 0 0 2m16 15h-1v-1a1 1 0 0 0-2 0v1h-1a1 1 0 0 0 0 2h1v1a1 1 0 1 0 2 0v-1h1a1 1 0 0 0 0-2m4.414-14L10 27.414a2 2 0 0 1-2.828 0l-2.587-2.585a2 2 0 0 1 0-2.829L22 4.586a2 2 0 0 1 2.829 0l2.585 2.585a2 2 0 0 1 0 2.829M26 8.586 23.414 6l-4 4L22 12.586z"})})};p.forwardRef(xS);const wS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28 6H4a1 1 0 0 0-1 1v17a2 2 0 0 0 2 2h22a2 2 0 0 0 2-2V7a1 1 0 0 0-1-1M12.339 16 5 22.726V9.274zm1.48 1.356 1.5 1.381a1 1 0 0 0 1.352 0l1.5-1.38L25.421 24H6.571zM19.66 16 27 9.273v13.455z"})})};p.forwardRef(wS);const yS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{fillRule:"evenodd",d:"M11 7q0 .432-.088.838L16 10.382l5.088-2.544a4 4 0 1 1 .895 1.789L18.236 11.5l3.747 1.873a4 4 0 1 1 0 5.253L18.236 20.5l3.747 1.874a4 4 0 1 1-.895 1.788L16 21.618l-5.088 2.544Q11 24.567 11 25a4 4 0 1 1-.983-2.626l3.747-1.874-3.747-1.873a4 4 0 1 1 0-5.253l3.747-1.874-3.747-1.874A4 4 0 1 1 11 7M9 7a2 2 0 1 1-4 0 2 2 0 0 1 4 0m2.236 8h9.528L16 12.618zM9 25a2 2 0 1 1-4 0 2 2 0 0 1 4 0m-2-7a2 2 0 1 0 0-4 2 2 0 0 0 0 4M27 7a2 2 0 1 1-4 0 2 2 0 0 1 4 0m-2 20a2 2 0 1 0 0-4 2 2 0 0 0 0 4m2-11a2 2 0 1 1-4 0 2 2 0 0 1 4 0m-11 3.382L20.764 17h-9.528z",clipRule:"evenodd"})})};p.forwardRef(yS);const CS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{fillRule:"evenodd",d:"M14.8 8.254a4 4 0 1 0-1.082 1.682l7.483 4.81a4 4 0 0 0-.075.254H10.874A4.002 4.002 0 0 0 3 16a4 4 0 0 0 7.874 1h10.252q.033.128.075.254l-7.484 4.81a4 4 0 1 0 1.082 1.682l7.484-4.81a4 4 0 1 0 0-5.871zM11 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4m0 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4M9 16a2 2 0 1 1-4 0 2 2 0 0 1 4 0m16 2a2 2 0 1 0 0-4 2 2 0 0 0 0 4",clipRule:"evenodd"})})};p.forwardRef(CS);const $S=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{fillRule:"evenodd",d:"M18.842 3.227a1 1 0 1 0-.445 1.95l1.747.399L9.6 12.959a4 4 0 1 0 0 6.081l10.546 7.385-1.748.399a1 1 0 1 0 .445 1.95l3.945-.9a1 1 0 0 0 .77-1.1l-.503-4.014a1 1 0 0 0-1.985.248l.223 1.779-10.545-7.384a4 4 0 0 0 .127-.403h14.712l-1.293 1.293a1 1 0 1 0 1.414 1.414l3-3a1 1 0 0 0 0-1.414l-3-3a1 1 0 0 0-1.414 1.414L25.586 15H10.874a4 4 0 0 0-.127-.403l10.544-7.383-.222 1.778a1 1 0 0 0 1.984.249l.503-4.015a1 1 0 0 0-.77-1.099zM9 16a2 2 0 1 1-4 0 2 2 0 0 1 4 0",clipRule:"evenodd"})})};p.forwardRef($S);const SS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 6H5a2 2 0 0 0-2 2v20a1.98 1.98 0 0 0 1.156 1.813 1.986 1.986 0 0 0 2.141-.299L10.312 26H27a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2M10.5 17.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m5.5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m5.5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"})})};p.forwardRef(SS);const kS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M10 16V8a6 6 0 1 1 12 0v8a6 6 0 1 1-12 0m16 0a1 1 0 0 0-2 0 8 8 0 0 1-16 0 1 1 0 1 0-2 0 10.014 10.014 0 0 0 9 9.95V29a1 1 0 0 0 2 0v-3.05A10.014 10.014 0 0 0 26 16"})})};p.forwardRef(kS);const AS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 16a1.5 1.5 0 0 1-1.5 1.5H5a1.5 1.5 0 1 1 0-3h22a1.5 1.5 0 0 1 1.5 1.5"})})},RS=p.forwardRef(AS),s2=RS,TS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m5 14H11a1 1 0 0 1 0-2h10a1 1 0 0 1 0 2"})})};p.forwardRef(TS);const MS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26 5H6a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h20a3 3 0 0 0 3-3V8a3 3 0 0 0-3-3M20 27h-8a1 1 0 0 0 0 2h8a1 1 0 0 0 0-2"})})};p.forwardRef(MS);const ES=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29.443 18.776a13.1 13.1 0 0 1-4.626 6.614A13 13 0 0 1 4 15a12.9 12.9 0 0 1 2.61-7.815 13.1 13.1 0 0 1 6.614-4.625 1 1 0 0 1 1.25 1.25 11.01 11.01 0 0 0 13.725 13.725 1 1 0 0 1 1.25 1.25z"})})};p.forwardRef(ES);const IS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M18 16a2 2 0 1 1-4 0 2 2 0 0 1 4 0M7.5 14a2 2 0 1 0 0 4 2 2 0 0 0 0-4m17 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4"})})};p.forwardRef(IS);const jS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M10.939 8.061a1.5 1.5 0 0 1 0-2.125l4-4a1.5 1.5 0 0 1 2.125 0l4 4a1.503 1.503 0 1 1-2.125 2.125L17.5 6.625V12a1.5 1.5 0 1 1-3 0V6.625l-1.439 1.436a1.5 1.5 0 0 1-2.122 0m8 15.875L17.5 25.375V20a1.5 1.5 0 1 0-3 0v5.375l-1.439-1.44a1.504 1.504 0 0 0-2.125 2.125l4 4a1.5 1.5 0 0 0 2.125 0l4-4a1.502 1.502 0 1 0-2.125-2.125zm11.125-9-4-4a1.503 1.503 0 0 0-2.125 2.125l1.436 1.439H20a1.5 1.5 0 0 0 0 3h5.375l-1.44 1.439a1.503 1.503 0 0 0 2.125 2.125l4-4a1.5 1.5 0 0 0 .001-2.125zM6.625 17.5H12a1.5 1.5 0 1 0 0-3H6.625l1.44-1.439a1.503 1.503 0 1 0-2.125-2.125l-4 4a1.5 1.5 0 0 0 0 2.125l4 4a1.503 1.503 0 0 0 2.125-2.125z"})})};p.forwardRef(jS);const DS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26.615 3.214a.99.99 0 0 0-.857-.183l-16 4a1 1 0 0 0-.758.97v13.762a4.5 4.5 0 1 0 2 3.737V13.781l14-3.5v7.482a4.5 4.5 0 1 0 2 3.737V4a1 1 0 0 0-.385-.786"})})};p.forwardRef(DS);const OS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 16a1.5 1.5 0 0 1-1.5 1.5H14.5a1.5 1.5 0 1 1 0-3H27a1.5 1.5 0 0 1 1.5 1.5m-14-6.5H27a1.5 1.5 0 0 0 0-3H14.5a1.5 1.5 0 0 0 0 3m12.5 13H14.5a1.5 1.5 0 1 0 0 3H27a1.5 1.5 0 1 0 0-3M5.5 7.414V13a1.5 1.5 0 0 0 3 0V5a1.5 1.5 0 0 0-2.17-1.341l-2 1a1.5 1.5 0 0 0 1.17 2.75zm4.966 12.107a3.46 3.46 0 0 0-1.4-2.329 3.61 3.61 0 0 0-4.954.683 3.5 3.5 0 0 0-.52.942 1.5 1.5 0 0 0 2.818 1.027.5.5 0 0 1 .072-.125.6.6 0 0 1 .813-.103.48.48 0 0 1 .201.325.45.45 0 0 1-.096.347l-.016.02-3.585 4.794A1.5 1.5 0 0 0 5 27.5h4a1.5 1.5 0 1 0 0-3H8l1.785-2.389a3.43 3.43 0 0 0 .681-2.59"})})};p.forwardRef(OS);const LS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{fillRule:"evenodd",d:"M17.2 8.254a4 4 0 1 1 1.082 1.682l-7.482 4.81q.04.125.074.254h10.252A4.002 4.002 0 0 1 29 16a4 4 0 0 1-7.874 1H10.874q-.033.128-.075.254l7.484 4.81a4 4 0 1 1-1.082 1.682l-7.484-4.81a4 4 0 1 1 0-5.871zM21 9a2 2 0 1 1 0-4 2 2 0 0 1 0 4m0 18a2 2 0 1 1 0-4 2 2 0 0 1 0 4m2-11a2 2 0 1 0 4 0 2 2 0 0 0-4 0M7 18a2 2 0 1 1 0-4 2 2 0 0 1 0 4",clipRule:"evenodd"})})};p.forwardRef(LS);const NS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{fillRule:"evenodd",d:"M10.874 17A4.002 4.002 0 0 1 3 16a4 4 0 0 1 7.874-1h10.252A4.002 4.002 0 0 1 29 16a4 4 0 0 1-7.874 1zM7 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4m18 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4",clipRule:"evenodd"})})};p.forwardRef(NS);const BS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{fillRule:"evenodd",d:"M28.924 16.384c-.05.12-.124.231-.217.324l-4 4a1 1 0 0 1-1.632-.324 1 1 0 0 1 .217-1.09L25.585 17H10.875A4.002 4.002 0 0 1 3 16a4 4 0 0 1 7.874-1h14.712l-2.294-2.293a1 1 0 0 1 1.415-1.415l4 4a1 1 0 0 1 .217 1.09M7 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4",clipRule:"evenodd"})})};p.forwardRef(BS);const FS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29 4a1 1 0 0 0-1-1c-5.51 0-11.164 6.214-14.304 10.329A7.5 7.5 0 0 0 4 20.5c0 3.86-2.443 5.591-2.559 5.671A1 1 0 0 0 2 28h9.5a7.5 7.5 0 0 0 7.171-9.696C22.788 15.164 29 9.51 29 4M15.553 14.194a48 48 0 0 1 1.26-1.569 9.5 9.5 0 0 1 2.562 2.561q-.738.618-1.569 1.262a7.6 7.6 0 0 0-2.254-2.254m5.337-.335a11.6 11.6 0 0 0-2.75-2.75c3.973-4.316 6.969-5.625 8.738-5.989-.357 1.77-1.672 4.766-5.988 8.739"})})};p.forwardRef(FS);const VS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M31 13v6.25a2.01 2.01 0 0 1-1.45 1.922L17 24.75V29a1 1 0 0 1-2 0v-4.25a2.01 2.01 0 0 1 1.45-1.922L29 19.25V13h-2v3a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-3H2a1 1 0 0 1 0-2h2V8a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v3h2a2 2 0 0 1 2 2"})})};p.forwardRef(VS);const _S=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M25.096 6.736A12.9 12.9 0 0 0 16 3h-.134A13 13 0 0 0 3 16c0 5.375 3.323 9.883 8.67 11.771A4 4 0 0 0 17 24a2 2 0 0 1 2-2h5.776a3.976 3.976 0 0 0 3.9-3.11c.224-.984.332-1.99.324-3a12.9 12.9 0 0 0-3.904-9.154M10.5 21a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m0-7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m5.5-3a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m5.5 3a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"})})};p.forwardRef(_S);const zS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.925 5.543v.018L21.65 29.554A1.985 1.985 0 0 1 19.728 31a1.98 1.98 0 0 1-1.803-1.144l-4.464-9.423a.5.5 0 0 1 .099-.568l7.158-7.159a1 1 0 0 0-1.414-1.413l-7.169 7.157a.5.5 0 0 1-.567.099l-9.376-4.441A2.05 2.05 0 0 1 1 12.17a1.99 1.99 0 0 1 1.446-1.815L26.44 3.08h.018a2 2 0 0 1 2.468 2.463"})})};p.forwardRef(zS);const HS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m26.56 17.061-10.257 10.25a7.501 7.501 0 0 1-10.607-10.61l12.27-12.236a5 5 0 0 1 7.07 7.074l-.021.02L13.04 23.086a1.503 1.503 0 0 1-2.121-.041 1.5 1.5 0 0 1 .041-2.121L22.924 9.409a2 2 0 1 0-2.838-2.82L7.816 18.82a4.5 4.5 0 1 0 6.366 6.364l10.258-10.25a1.503 1.503 0 0 1 2.125 2.125z"})})};p.forwardRef(HS);const PS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M3.5 8A1.5 1.5 0 0 1 5 6.5h22a1.5 1.5 0 0 1 0 3H5A1.5 1.5 0 0 1 3.5 8M5 14.5h16a1.5 1.5 0 1 0 0-3H5a1.5 1.5 0 1 0 0 3m22 2H5a1.5 1.5 0 1 0 0 3h22a1.5 1.5 0 1 0 0-3m-6 5H5a1.5 1.5 0 1 0 0 3h16a1.5 1.5 0 1 0 0-3"})})};p.forwardRef(PS);const WS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m28.414 9.171-5.585-5.586a2 2 0 0 0-2.829 0L4.586 19A1.98 1.98 0 0 0 4 20.414V26a2 2 0 0 0 2 2h5.586A1.98 1.98 0 0 0 13 27.414L28.414 12a2 2 0 0 0 0-2.829M24 13.585 18.414 8l3-3L27 10.585z"})})},qS=p.forwardRef(WS),Yh=qS,US=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.985 21.885A7.03 7.03 0 0 1 22 28c-9.925 0-18-8.075-18-18a7.03 7.03 0 0 1 6.115-6.985 2 2 0 0 1 2.078 1.19l2.64 5.894v.015a2 2 0 0 1-.16 1.886 1 1 0 0 1-.07.096L12 15.181c.936 1.903 2.926 3.875 4.854 4.814l3.042-2.589q.045-.037.094-.07a2 2 0 0 1 1.896-.175l.017.008 5.888 2.639a2 2 0 0 1 1.194 2.077"})})};p.forwardRef(US);const KS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m29.416 13-6.683 6.706c.57 1.584.806 4.236-1.65 7.5a2 2 0 0 1-1.458.794h-.141a2 2 0 0 1-1.415-.586l-6.033-6.04-5.328 5.333a1 1 0 1 1-1.415-1.415l5.332-5.328-6.037-6.038a2 2 0 0 1 .162-2.972c3.178-2.564 6.219-2.06 7.55-1.643L19 2.587a2 2 0 0 1 2.829 0l7.586 7.585A2 2 0 0 1 29.416 13"})})};p.forwardRef(KS);const GS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 2A11.013 11.013 0 0 0 5 13c0 9.413 10 16.521 10.426 16.819a1 1 0 0 0 1.148 0C17 29.52 27 22.413 27 13A11.01 11.01 0 0 0 16 2m0 7a4 4 0 1 1 0 8 4 4 0 0 1 0-8"})})};p.forwardRef(GS);const YS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30 17v4a1 1 0 0 1-1.196.98L19.5 20.125v2.966l2.207 2.206A1 1 0 0 1 22 26v3a1 1 0 0 1-1.375.929L16 28.078l-4.625 1.85A1 1 0 0 1 10 29v-3a1 1 0 0 1 .293-.707l2.207-2.207v-2.961L3.196 21.98A1 1 0 0 1 2 21v-4a1 1 0 0 1 .553-.895l9.947-4.972V5.5a3.5 3.5 0 1 1 7 0v5.633l9.948 4.972A1 1 0 0 1 30 17"})})};p.forwardRef(YS);const XS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M25.676 18.884a7.6 7.6 0 0 1-3.978 1.107 9 9 0 0 1-3.42-.707A6.94 6.94 0 0 0 17 23.314V27a1 1 0 0 1-1.066 1A1.023 1.023 0 0 1 15 26.969v-1.555l-4.828-4.828A6.6 6.6 0 0 1 7.93 21a5.73 5.73 0 0 1-2.99-.834C2.216 18.511.75 14.702 1.034 9.974a1 1 0 0 1 .94-.94c4.728-.28 8.537 1.182 10.187 3.906a5.75 5.75 0 0 1 .806 3.56.5.5 0 0 1-.86.304l-2.4-2.513a1 1 0 0 0-1.415 1.414l6.736 6.906q.01-.146.026-.291a8.57 8.57 0 0 1 2.33-4.933l6.323-6.682a1 1 0 0 0-1.413-1.415l-6.125 6.477a.5.5 0 0 1-.848-.217c-.592-2.185-.331-4.36.8-6.228 2.233-3.685 7.428-5.657 13.898-5.277a1 1 0 0 1 .94.94c.375 6.471-1.598 11.666-5.283 13.899"})})};p.forwardRef(XS);const QS=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30 16a1.97 1.97 0 0 1-.95 1.689L11.04 28.706a2 2 0 0 1-2.767-.688A2 2 0 0 1 8 27.016V4.984a1.98 1.98 0 0 1 1.015-1.728 2 2 0 0 1 2.025.038L29.05 14.31A1.97 1.97 0 0 1 30 16"})})},ZS=p.forwardRef(QS),JS=ZS,e7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 16a1.5 1.5 0 0 1-1.5 1.5h-9.5V27a1.5 1.5 0 1 1-3 0v-9.5H5a1.5 1.5 0 1 1 0-3h9.5V5a1.5 1.5 0 1 1 3 0v9.5H27a1.5 1.5 0 0 1 1.5 1.5"})})},t7=p.forwardRef(e7),Xh=t7,n7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.016 13.016 0 0 0 16 3m5 14h-4v4a1 1 0 0 1-2 0v-4h-4a1 1 0 0 1 0-2h4v-4a1 1 0 0 1 2 0v4h4a1 1 0 0 1 0 2"})})};p.forwardRef(n7);const r7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 5H17V3a1 1 0 0 0-2 0v2H5a2 2 0 0 0-2 2v15a2 2 0 0 0 2 2h4.92l-2.701 3.375a1 1 0 0 0 1.562 1.25L12.48 24h7.04l3.699 4.625a1 1 0 1 0 1.562-1.25L22.08 24H27a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2M13 18a1 1 0 0 1-2 0v-3a1 1 0 0 1 2 0zm4 0a1 1 0 0 1-2 0v-5a1 1 0 0 1 2 0zm4 0a1 1 0 0 1-2 0v-7a1 1 0 0 1 2 0z"})})};p.forwardRef(r7);const i7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M30.414 17 18 4.586A1.98 1.98 0 0 0 16.586 4H5a1 1 0 0 0-1 1v11.586A1.98 1.98 0 0 0 4.586 18L17 30.414a2 2 0 0 0 2.829 0l10.585-10.585a2 2 0 0 0 0-2.829M10.5 12a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"})})},o7=p.forwardRef(i7),s7=o7,a7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M20.723 28H26a2 2 0 0 0 2-2v-4.706a1 1 0 0 0-1.383-.919 2.9 2.9 0 0 1-1.117.221c-1.654 0-3-1.387-3-3.091s1.346-3.091 3-3.091c.383 0 .763.075 1.117.221A1 1 0 0 0 28 13.706V9a2 2 0 0 0-2-2h-4.527a4.5 4.5 0 1 0-8.945 0H8a2 2 0 0 0-2 2v4.028a4.5 4.5 0 1 0 0 8.945V26a2 2 0 0 0 2 2h5.278"})})};p.forwardRef(a7);const l7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M18 22.5a2 2 0 1 1-4 0 2 2 0 0 1 4 0M29.5 16A13.5 13.5 0 1 1 16 2.5 13.515 13.515 0 0 1 29.5 16m-3 0A10.5 10.5 0 1 0 16 26.5 10.51 10.51 0 0 0 26.5 16M16 8c-3.033 0-5.5 2.242-5.5 5v.5a1.5 1.5 0 1 0 3 0V13c0-1.102 1.125-2 2.5-2s2.5.898 2.5 2-1.125 2-2.5 2a1.5 1.5 0 0 0-1.5 1.5v1a1.5 1.5 0 0 0 2.966.32C19.79 17.235 21.5 15.296 21.5 13c0-2.758-2.468-5-5.5-5"})})};p.forwardRef(l7);const c7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M14.5 9v11a6.006 6.006 0 0 1-6 6 1 1 0 0 1 0-2 4 4 0 0 0 4-4v-1H5a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h7.5a2 2 0 0 1 2 2M27 7h-7.5a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2H27v1a4 4 0 0 1-4 4 1 1 0 0 0 0 2 6.006 6.006 0 0 0 6-6V9a2 2 0 0 0-2-2"})})};p.forwardRef(c7);const d7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 5v23a1 1 0 0 1-2 0v-6h-6a1 1 0 0 1-1-1c.046-2.395.349-4.779.902-7.11 1.223-5.061 3.54-8.454 6.704-9.809a1 1 0 0 1 1.394.92m-12.014-.164a.999.999 0 1 0-1.972.33L13.986 11H11V5a1 1 0 0 0-2 0v6H6.014l.972-5.835a1 1 0 1 0-1.972-.329l-1 6A1 1 0 0 0 4 11a6.01 6.01 0 0 0 5 5.915V28a1 1 0 1 0 2 0V16.915A6.01 6.01 0 0 0 16 11q0-.083-.014-.164z"})})};p.forwardRef(d7);const u7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M19 28a1 1 0 0 1-1 1h-4a1 1 0 0 1 0-2h4a1 1 0 0 1 1 1m8.953-8.521-1.546 6.954a2 2 0 0 1-3.188 1.138l-3.405-2.57h-7.625L8.78 27.57a2 2 0 0 1-3.189-1.138l-1.545-6.954a2.01 2.01 0 0 1 .415-1.714l3.57-4.282c.12-1.574.482-3.12 1.072-4.584 1.612-4.043 4.5-6.579 5.671-7.481a2 2 0 0 1 2.45 0c1.167.902 4.059 3.438 5.671 7.48.59 1.465.952 3.01 1.072 4.585l3.57 4.282a2.01 2.01 0 0 1 .415 1.714m-17.404 4.25q-2.014-3.666-2.445-7.209L6 19.045 7.545 26l.022-.016zM17.5 12.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0m8.5 6.545-2.104-2.525q-.428 3.535-2.445 7.211l2.982 2.25.022.017z"})})};p.forwardRef(u7);const h7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M19.716 14.141a1 1 0 0 1 .261-1.391l8.458-5.788a1 1 0 0 1 1.125 1.652L21.101 14.4a1 1 0 0 1-1.39-.261zm10.109 10.634a1 1 0 0 1-1.39.261L17 17.211l-5.315 3.636a4.5 4.5 0 1 1-1.125-1.65L15.229 16l-4.673-3.198a4.5 4.5 0 1 1 1.125-1.65l17.875 12.233a1 1 0 0 1 .269 1.39M9 22.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0m0-13a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0"})})};p.forwardRef(h7);const f7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 256 256",fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M225.86 102.82c-3.77-3.94-7.67-8-9.14-11.57-1.36-3.27-1.44-8.69-1.52-13.94-.15-9.76-.31-20.82-8-28.51s-18.75-7.85-28.51-8c-5.25-.08-10.67-.16-13.94-1.52-3.56-1.47-7.63-5.37-11.57-9.14C146.28 23.51 138.44 16 128 16s-18.27 7.51-25.18 14.14c-3.94 3.77-8 7.67-11.57 9.14-3.25 1.36-8.69 1.44-13.94 1.52-9.76.15-20.82.31-28.51 8s-7.8 18.75-8 28.51c-.08 5.25-.16 10.67-1.52 13.94-1.47 3.56-5.37 7.63-9.14 11.57C23.51 109.72 16 117.56 16 128s7.51 18.27 14.14 25.18c3.77 3.94 7.67 8 9.14 11.57 1.36 3.27 1.44 8.69 1.52 13.94.15 9.76.31 20.82 8 28.51s18.75 7.85 28.51 8c5.25.08 10.67.16 13.94 1.52 3.56 1.47 7.63 5.37 11.57 9.14 6.9 6.63 14.74 14.14 25.18 14.14s18.27-7.51 25.18-14.14c3.94-3.77 8-7.67 11.57-9.14 3.27-1.36 8.69-1.44 13.94-1.52 9.76-.15 20.82-.31 28.51-8s7.85-18.75 8-28.51c.08-5.25.16-10.67 1.52-13.94 1.47-3.56 5.37-7.63 9.14-11.57 6.63-6.9 14.14-14.74 14.14-25.18s-7.51-18.27-14.14-25.18m-52.2 6.84-56 56a8 8 0 0 1-11.32 0l-24-24a8 8 0 0 1 11.32-11.32L112 148.69l50.34-50.35a8 8 0 0 1 11.32 11.32"})})};p.forwardRef(f7);const m7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29.061 26.939 23.125 21A11.515 11.515 0 1 0 21 23.125l5.941 5.942a1.503 1.503 0 0 0 2.125-2.125zM5.5 14a8.5 8.5 0 1 1 8.5 8.5A8.51 8.51 0 0 1 5.5 14"})})},p7=p.forwardRef(m7),a2=p7,g7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26 5H6a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3.5 6.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3M26 17H6a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2m-3.5 6.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"})})};p.forwardRef(g7);const b7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28 7v7.346c0 11.202-9.477 14.918-11.375 15.549a1.94 1.94 0 0 1-1.25 0C13.475 29.264 4 25.548 4 14.346V7a2 2 0 0 1 2-2h20a2 2 0 0 1 2 2"})})};p.forwardRef(b7);const v7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m30.949 7.653-6.47-3.528A1 1 0 0 0 24 4h-4a1 1 0 0 0-1 1 3 3 0 0 1-6 0 1 1 0 0 0-1-1H8a1 1 0 0 0-.48.125L1.051 7.653a1.97 1.97 0 0 0-.824 2.657l2.41 4.601A2.05 2.05 0 0 0 4.458 16H7v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V16h2.543a2.05 2.05 0 0 0 1.822-1.089l2.409-4.601a1.97 1.97 0 0 0-.825-2.658M4.459 14a.08.08 0 0 1-.051-.016L2.01 9.408 7 6.685V14zm23.134-.018a.07.07 0 0 1-.052.018H25V6.685l4.99 2.723z"})})};p.forwardRef(v7);const x7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M12 27a2 2 0 1 1-4 0 2 2 0 0 1 4 0m11-2a2 2 0 1 0 0 4 2 2 0 0 0 0-4m5.805-16.594A1 1 0 0 0 28 8H6.04L5.026 4.45A2.01 2.01 0 0 0 3.103 3H1a1 1 0 0 0 0 2h2.103l4.522 15.824A3.01 3.01 0 0 0 10.509 23h12.014a2.99 2.99 0 0 0 2.867-2.117l3.566-11.59a1 1 0 0 0-.151-.887"})})};p.forwardRef(x7);const w7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M14.5 27a1.5 1.5 0 0 1-1.5 1.5H6A2.5 2.5 0 0 1 3.5 26V6A2.5 2.5 0 0 1 6 3.5h7a1.5 1.5 0 0 1 0 3H6.5v19H13a1.5 1.5 0 0 1 1.5 1.5m13.561-12.061-5-5a1.503 1.503 0 0 0-2.125 2.125l2.439 2.436H13a1.5 1.5 0 1 0 0 3h10.375l-2.44 2.439a1.503 1.503 0 0 0 2.125 2.125l5-5a1.5 1.5 0 0 0 .001-2.125"})})};p.forwardRef(w7);const y7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M4 10a1 1 0 0 1 1-1h4.646a3.5 3.5 0 0 1 6.708 0H27a1 1 0 1 1 0 2H16.354a3.5 3.5 0 0 1-6.708 0H5a1 1 0 0 1-1-1m23 11h-2.646a3.5 3.5 0 0 0-6.708 0H5a1 1 0 0 0 0 2h12.646a3.5 3.5 0 0 0 6.708 0H27a1 1 0 1 0 0-2"})})};p.forwardRef(y7);const C7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M26 18a1.97 1.97 0 0 1-1.302 1.867l-6.457 2.375-2.375 6.452a1.99 1.99 0 0 1-3.735 0L9.75 22.25l-6.452-2.375a1.99 1.99 0 0 1 0-3.735l6.456-2.375 2.375-6.451a1.99 1.99 0 0 1 3.735 0l2.375 6.456 6.451 2.375A1.97 1.97 0 0 1 26 18M19 6h2v2a1 1 0 0 0 2 0V6h2a1 1 0 1 0 0-2h-2V2a1 1 0 1 0-2 0v2h-2a1 1 0 1 0 0 2m11 4h-1V9a1 1 0 1 0-2 0v1h-1a1 1 0 0 0 0 2h1v1a1 1 0 0 0 2 0v-1h1a1 1 0 0 0 0-2"})})};p.forwardRef(C7);const $7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M15 7v6a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2m10-2h-6a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2M13 17H7a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2m12 0h-6a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2"})})};p.forwardRef($7);const S7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:[u.jsx("path",{d:"M27.5 21.136 16 27.843 4.5 21.136a1 1 0 0 0-1 1.728l12 7a1 1 0 0 0 1.008 0l12-7a1 1 0 1 0-1.008-1.728"}),u.jsx("path",{d:"M27.5 15.136 16 21.843 4.5 15.136a1 1 0 0 0-1 1.728l12 7a1 1 0 0 0 1.008 0l12-7a1 1 0 1 0-1.008-1.728"}),u.jsx("path",{d:"m3.5 10.864 12 7a1 1 0 0 0 1.008 0l12-7a1 1 0 0 0 0-1.728l-12-7a1 1 0 0 0-1.008 0l-12 7a1 1 0 0 0 0 1.728"})]})};p.forwardRef(S7);const k7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m29.313 14.298-5.638 4.92 1.689 7.325a2 2 0 0 1-2.98 2.167l-6.389-3.875L9.62 28.71a2 2 0 0 1-2.98-2.168l1.686-7.317-5.638-4.928a2 2 0 0 1 1.138-3.507l7.433-.644 2.901-6.92a1.994 1.994 0 0 1 3.68 0l2.91 6.92 7.43.644a2 2 0 0 1 1.139 3.508z"})})};p.forwardRef(k7);const A7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29 19a4 4 0 1 0-4.991 3.875A1 1 0 0 0 24 23a4 4 0 0 1-4 4h-3a4 4 0 0 1-4-4v-5.065c3.934-.5 7-3.934 7-8.039V5a2 2 0 0 0-2-2h-2a1 1 0 1 0 0 2h2v4.896c0 3.323-2.656 6.061-5.92 6.104A6 6 0 0 1 6 10V5h2a1 1 0 0 0 0-2H6a2 2 0 0 0-2 2v5a8 8 0 0 0 7 7.936V23a6.006 6.006 0 0 0 6 6h3a6.006 6.006 0 0 0 6-6 1 1 0 0 0-.009-.125A4 4 0 0 0 29 19m-4 1a1 1 0 1 1 0-2 1 1 0 0 1 0 2"})})};p.forwardRef(A7);const R7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M216 56v144a16 16 0 0 1-16 16H56a16 16 0 0 1-16-16V56a16 16 0 0 1 16-16h144a16 16 0 0 1 16 16"})})};p.forwardRef(R7);const T7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29 12a1 1 0 0 0-.038-.275L27.17 5.45A2.01 2.01 0 0 0 25.25 4H6.75a2.01 2.01 0 0 0-1.919 1.45L3.04 11.725A1 1 0 0 0 3 12v2a5 5 0 0 0 2 4v8a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2v-8a5 5 0 0 0 2-4zm-18 2a3 3 0 0 1-4.39 2.657 1 1 0 0 0-.228-.132A3 3 0 0 1 5 14v-1h6zm8 0a3 3 0 0 1-6 0v-1h6zm8 0a3 3 0 0 1-1.384 2.525q-.12.051-.225.131A3 3 0 0 1 21 14v-1h6z"})})};p.forwardRef(T7);const M7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 16a1.5 1.5 0 0 1-1.5 1.5h-3.767A5.19 5.19 0 0 1 24.5 21c0 1.806-.976 3.54-2.679 4.756C20.25 26.881 18.18 27.5 16 27.5s-4.25-.619-5.821-1.744C8.476 24.54 7.5 22.806 7.5 21a1.5 1.5 0 0 1 3 0c0 1.898 2.519 3.5 5.5 3.5s5.5-1.602 5.5-3.5c0-1.595-1.163-2.523-4.419-3.5H5a1.5 1.5 0 1 1 0-3h22a1.5 1.5 0 0 1 1.5 1.5M9.389 12.5a1.5 1.5 0 0 0 1.5-1.5c0-2 2.197-3.5 5.111-3.5 2.17 0 3.921.831 4.685 2.223a1.5 1.5 0 0 0 2.625-1.446C22.016 5.914 19.281 4.5 16 4.5c-4.625 0-8.111 2.794-8.111 6.5a1.5 1.5 0 0 0 1.5 1.5"})})};p.forwardRef(M7);const E7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M15 5V2a1 1 0 0 1 2 0v3a1 1 0 0 1-2 0m1 3a8 8 0 1 0 8 8 8.01 8.01 0 0 0-8-8m-8.707.707a1 1 0 1 0 1.414-1.415l-2-2a1 1 0 1 0-1.414 1.415zm0 14.586-2 2a1 1 0 1 0 1.414 1.415l2-2a1 1 0 1 0-1.415-1.415M24 9a1 1 0 0 0 .707-.293l2-2a1 1 0 0 0-1.415-1.414l-2 2A1 1 0 0 0 24 9m.707 14.293a1 1 0 1 0-1.415 1.415l2 2a1 1 0 0 0 1.415-1.415zM6 16a1 1 0 0 0-1-1H2a1 1 0 0 0 0 2h3a1 1 0 0 0 1-1m10 10a1 1 0 0 0-1 1v3a1 1 0 0 0 2 0v-3a1 1 0 0 0-1-1m14-11h-3a1 1 0 0 0 0 2h3a1 1 0 0 0 0-2"})})};p.forwardRef(E7);const I7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 8h-8.586l4.293-4.292a1 1 0 0 0-1.415-1.415L16 7.586l-5.292-5.293a1 1 0 1 0-1.415 1.415L13.586 8H5a2 2 0 0 0-2 2v15a2 2 0 0 0 2 2h22a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2m0 17h-7V10h7zm-2-10.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0 6a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"})})};p.forwardRef(I7);const j7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m29.978 19.625-1.5-12A3 3 0 0 0 25.5 5H4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h5.383l4.722 9.448A1 1 0 0 0 15 30a5 5 0 0 0 5-5v-2h7a3 3 0 0 0 2.977-3.375M9 18H4V7h5z"})})};p.forwardRef(j7);const D7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M29.25 10.015A3 3 0 0 0 27 9h-7V7a5 5 0 0 0-5-5 1 1 0 0 0-.895.553L9.383 12H4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h21.5a3 3 0 0 0 2.977-2.625l1.5-12a3 3 0 0 0-.727-2.36M4 14h5v11H4z"})})};p.forwardRef(D7);const O7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M23 3H9a4 4 0 0 0-4 4v16a4 4 0 0 0 4 4h1l-1.8 2.4a1 1 0 0 0 1.6 1.2l2.7-3.6h7l2.7 3.6a1 1 0 0 0 1.6-1.2L22 27h1a4 4 0 0 0 4-4V7a4 4 0 0 0-4-4M10.5 23a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m4.5-8H7v-5h8zm6.5 8a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m3.5-8h-8v-5h8z"})})};p.forwardRef(O7);const L7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M27 6h-5V5a3 3 0 0 0-3-3h-6a3 3 0 0 0-3 3v1H5a1 1 0 0 0 0 2h1v18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8h1a1 1 0 1 0 0-2M14 21a1 1 0 0 1-2 0v-8a1 1 0 0 1 2 0zm6 0a1 1 0 0 1-2 0v-8a1 1 0 0 1 2 0zm0-15h-8V5a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1z"})})},N7=p.forwardRef(L7),Qh=N7,B7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m23.54 2.267-3.711 3.377c1.7.52 3.298 1.397 4.653 2.631 4.684 4.266 4.684 11.184 0 15.45q-5.184 4.72-16.021 6.008l3.71-3.377a12.2 12.2 0 0 1-4.653-2.63c-4.684-4.267-4.712-11.16 0-15.45q5.184-4.721 16.021-6.01m-7.54 8.4c-3.314 0-6 2.388-6 5.333s2.686 5.333 6 5.333 6-2.387 6-5.333c0-2.945-2.686-5.333-6-5.333"})})},F7=p.forwardRef(B7),V7=F7,_7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M25.5 28a1.5 1.5 0 0 1-1.5 1.5H8a1.5 1.5 0 1 1 0-3h16a1.5 1.5 0 0 1 1.5 1.5M16 24.5a8.51 8.51 0 0 0 8.5-8.5V7a1.5 1.5 0 1 0-3 0v9a5.5 5.5 0 0 1-11 0V7a1.5 1.5 0 1 0-3 0v9a8.51 8.51 0 0 0 8.5 8.5"})})};p.forwardRef(_7);const z7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.5 19v7a2.5 2.5 0 0 1-2.5 2.5H6A2.5 2.5 0 0 1 3.5 26v-7a1.5 1.5 0 0 1 3 0v6.5h19V19a1.5 1.5 0 1 1 3 0m-16.439-7.939L14.5 8.625V19a1.5 1.5 0 1 0 3 0V8.625l2.439 2.44a1.503 1.503 0 0 0 2.125-2.125l-5-5a1.5 1.5 0 0 0-2.125 0l-5 5a1.503 1.503 0 1 0 2.125 2.125z"})})};p.forwardRef(z7);const H7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M28.866 27.5A1 1 0 0 1 28 28H4a1 1 0 0 1-.865-1.5c1.904-3.291 4.838-5.651 8.261-6.77a9 9 0 1 1 9.208 0c3.424 1.119 6.357 3.479 8.261 6.77a1 1 0 0 1 .001 1"})})};p.forwardRef(H7);const P7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M19.44 3.101a1 1 0 0 0-1.054.11L9.656 10H4a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h5.656l8.73 6.789A1 1 0 0 0 20 28V4a1 1 0 0 0-.56-.899M28.414 16l2.293-2.292a1.001 1.001 0 0 0-1.415-1.415L27 14.586l-2.293-2.293a1 1 0 1 0-1.415 1.415L25.587 16l-2.293 2.293a1 1 0 0 0 1.415 1.415L27 17.414l2.293 2.294a1 1 0 0 0 1.415-1.415z"})})};p.forwardRef(P7);const W7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M19.439 3.101a1 1 0 0 0-1.053.11L9.656 10H4a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h5.656l8.73 6.789A1.001 1.001 0 0 0 20 28V4a1 1 0 0 0-.561-.899M9 20H4v-8h5zm15.75-7.305a5 5 0 0 1 0 6.61 1 1 0 0 1-1.5-1.322 3 3 0 0 0 0-3.966 1 1 0 0 1 1.5-1.322M31 16a10 10 0 0 1-2.546 6.668 1 1 0 0 1-1.49-1.334 8 8 0 0 0 0-10.666.998.998 0 0 1 .407-1.624 1 1 0 0 1 1.083.29A9.98 9.98 0 0 1 31 16"})})};p.forwardRef(W7);const q7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M15 6a4 4 0 1 1 8 0 4 4 0 0 1-8 0m11 11c-3.58 0-5.226-1.662-6.969-3.421a25 25 0 0 0-1.375-1.323C13.031 8.24 5.63 15.098 5.316 15.391a1 1 0 0 0 1.369 1.458 20.5 20.5 0 0 1 3.815-2.724c1.723-.922 3.174-1.279 4.338-1.072L8.082 28.6a1 1 0 0 0 1.835.798l4.2-9.659L18 22.515V29a1 1 0 1 0 2 0v-7a1 1 0 0 0-.419-.814l-4.65-3.321L16.61 14c.33.305.657.634 1 .98C19.381 16.774 21.586 19 26 19a1 1 0 0 0 0-2"})})};p.forwardRef(q7);const U7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"M16 3a13 13 0 1 0 13 13A13.013 13.013 0 0 0 16 3m-1 7a1 1 0 0 1 2 0v7a1 1 0 0 1-2 0zm1 13a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"})})},K7=p.forwardRef(U7),l2=K7,G7=({fill:t="currentColor",stroke:e,...n},r)=>{const{colors:i}=C.useTheme(),o=t&&t in i?i[t]:t,s=e&&e in i?i[e]:e;return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:16,height:16,fill:o,stroke:s,ref:r,...n,children:u.jsx("path",{d:"m31.316 24.949-3 1a1 1 0 0 1-1.211-.5l-3.724-7.45H13a1 1 0 0 1-1-1v-3.707A7 7 0 0 0 14 27c3.239 0 6.261-2.256 7.031-5.25a1 1 0 1 1 1.938.5C21.96 26.162 18.19 29 14 29a9 9 0 0 1-2-17.774V8.851a3.5 3.5 0 1 1 2 0V11h7a1 1 0 0 1 0 2h-7v3h10a1 1 0 0 1 .894.552l3.612 7.225 2.178-.726a1 1 0 1 1 .632 1.898"})})};p.forwardRef(G7);const c2="Avatar",[Y7,XH]=et(c2),[X7,d2]=Y7(c2),Q7=p.forwardRef((t,e)=>{const{__scopeAvatar:n,...r}=t,[i,o]=p.useState("idle");return p.createElement(X7,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o},p.createElement(ge.span,N({},r,{ref:e})))}),Z7="AvatarImage",J7=p.forwardRef((t,e)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=t,s=d2(Z7,n),a=n9(r),l=nt(c=>{i(c),s.onImageLoadingStatusChange(c)});return Ke(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?p.createElement(ge.img,N({},o,{ref:e,src:r})):null}),e9="AvatarFallback",t9=p.forwardRef((t,e)=>{const{__scopeAvatar:n,delayMs:r,...i}=t,o=d2(e9,n),[s,a]=p.useState(r===void 0);return p.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),s&&o.imageLoadingStatus!=="loaded"?p.createElement(ge.span,N({},i,{ref:e})):null});function n9(t){const[e,n]=p.useState("idle");return Ke(()=>{if(!t){n("error");return}let r=!0;const i=new window.Image,o=s=>()=>{r&&n(s)};return n("loading"),i.onload=o("loaded"),i.onerror=o("error"),i.src=t,()=>{r=!1}},[t]),e}const r9=Q7,i9=J7,o9=t9,Dc="rovingFocusGroup.onEntryFocus",s9={bubbles:!1,cancelable:!0},Zh="RovingFocusGroup",[Vd,u2,a9]=Nl(Zh),[l9,ro]=et(Zh,[a9]),[c9,d9]=l9(Zh),u9=p.forwardRef((t,e)=>p.createElement(Vd.Provider,{scope:t.__scopeRovingFocusGroup},p.createElement(Vd.Slot,{scope:t.__scopeRovingFocusGroup},p.createElement(h9,N({},t,{ref:e}))))),h9=p.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...d}=t,h=p.useRef(null),f=ye(e,h),m=ni(o),[g=null,b]=mt({prop:s,defaultProp:a,onChange:l}),[v,x]=p.useState(!1),y=nt(c),$=u2(n),k=p.useRef(!1),[S,R]=p.useState(0);return p.useEffect(()=>{const A=h.current;if(A)return A.addEventListener(Dc,y),()=>A.removeEventListener(Dc,y)},[y]),p.createElement(c9,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:g,onItemFocus:p.useCallback(A=>b(A),[b]),onItemShiftTab:p.useCallback(()=>x(!0),[]),onFocusableItemAdd:p.useCallback(()=>R(A=>A+1),[]),onFocusableItemRemove:p.useCallback(()=>R(A=>A-1),[])},p.createElement(ge.div,N({tabIndex:v||S===0?-1:0,"data-orientation":r},d,{ref:f,style:{outline:"none",...t.style},onMouseDown:X(t.onMouseDown,()=>{k.current=!0}),onFocus:X(t.onFocus,A=>{const I=!k.current;if(A.target===A.currentTarget&&I&&!v){const E=new CustomEvent(Dc,s9);if(A.currentTarget.dispatchEvent(E),!E.defaultPrevented){const j=$().filter(q=>q.focusable),O=j.find(q=>q.active),D=j.find(q=>q.id===g),V=[O,D,...j].filter(Boolean).map(q=>q.ref.current);h2(V)}}k.current=!1}),onBlur:X(t.onBlur,()=>x(!1))})))}),f9="RovingFocusGroupItem",m9=p.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...s}=t,a=gt(),l=o||a,c=d9(f9,n),d=c.currentTabStopId===l,h=u2(n),{onFocusableItemAdd:f,onFocusableItemRemove:m}=c;return p.useEffect(()=>{if(r)return f(),()=>m()},[r,f,m]),p.createElement(Vd.ItemSlot,{scope:n,id:l,focusable:r,active:i},p.createElement(ge.span,N({tabIndex:d?0:-1,"data-orientation":c.orientation},s,{ref:e,onMouseDown:X(t.onMouseDown,g=>{r?c.onItemFocus(l):g.preventDefault()}),onFocus:X(t.onFocus,()=>c.onItemFocus(l)),onKeyDown:X(t.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){c.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const b=b9(g,c.orientation,c.dir);if(b!==void 0){g.preventDefault();let x=h().filter(y=>y.focusable).map(y=>y.ref.current);if(b==="last")x.reverse();else if(b==="prev"||b==="next"){b==="prev"&&x.reverse();const y=x.indexOf(g.currentTarget);x=c.loop?v9(x,y+1):x.slice(y+1)}setTimeout(()=>h2(x))}})})))}),p9={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function g9(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function b9(t,e,n){const r=g9(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return p9[r]}function h2(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function v9(t,e){return t.map((n,r)=>t[(e+r)%t.length])}const Jh=u9,ef=m9;var f2=ph(),Oc=function(){},Pl=w.forwardRef(function(t,e){var n=w.useRef(null),r=w.useState({onScrollCapture:Oc,onWheelCapture:Oc,onTouchMoveCapture:Oc}),i=r[0],o=r[1],s=t.forwardProps,a=t.children,l=t.className,c=t.removeScrollBar,d=t.enabled,h=t.shards,f=t.sideCar,m=t.noIsolation,g=t.inert,b=t.allowPinchZoom,v=t.as,x=v===void 0?"div":v,y=Dl(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),$=f,k=mh([n,e]),S=Ye(Ye({},y),i);return w.createElement(w.Fragment,null,d&&w.createElement($,{sideCar:f2,removeScrollBar:c,shards:h,noIsolation:m,inert:g,setCallbacks:o,allowPinchZoom:!!b,lockRef:n}),s?w.cloneElement(w.Children.only(a),Ye(Ye({},S),{ref:k})):w.createElement(x,Ye({},S,{className:l,ref:k}),a))});Pl.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Pl.classNames={fullWidth:Si,zeroRight:$i};var _d=!1;if(typeof window<"u")try{var zs=Object.defineProperty({},"passive",{get:function(){return _d=!0,!0}});window.addEventListener("test",zs,zs),window.removeEventListener("test",zs,zs)}catch{_d=!1}var di=_d?{passive:!1}:!1,x9=function(t){return t.tagName==="TEXTAREA"},m2=function(t,e){var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!x9(t)&&n[e]==="visible")},w9=function(t){return m2(t,"overflowY")},y9=function(t){return m2(t,"overflowX")},I0=function(t,e){var n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=p2(t,n);if(r){var i=g2(t,n),o=i[1],s=i[2];if(o>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},C9=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},$9=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},p2=function(t,e){return t==="v"?w9(e):y9(e)},g2=function(t,e){return t==="v"?C9(e):$9(e)},S9=function(t,e){return t==="h"&&e==="rtl"?-1:1},k9=function(t,e,n,r,i){var o=S9(t,window.getComputedStyle(e).direction),s=o*r,a=n.target,l=e.contains(a),c=!1,d=s>0,h=0,f=0;do{var m=g2(t,a),g=m[0],b=m[1],v=m[2],x=b-v-o*g;(g||x)&&p2(t,a)&&(h+=x,f+=g),a=a.parentNode}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(d&&h===0||!d&&f===0)&&(c=!0),c},Hs=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},j0=function(t){return[t.deltaX,t.deltaY]},D0=function(t){return t&&"current"in t?t.current:t},A9=function(t,e){return t[0]===e[0]&&t[1]===e[1]},R9=function(t){return`
|
|
48
|
+
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
49
|
+
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
50
|
+
`)},T9=0,ui=[];function M9(t){var e=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),i=w.useState(T9++)[0],o=w.useState(function(){return Ll()})[0],s=w.useRef(t);w.useEffect(function(){s.current=t},[t]),w.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var b=fh([t.lockRef.current],(t.shards||[]).map(D0),!0).filter(Boolean);return b.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),b.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=w.useCallback(function(b,v){if("touches"in b&&b.touches.length===2)return!s.current.allowPinchZoom;var x=Hs(b),y=n.current,$="deltaX"in b?b.deltaX:y[0]-x[0],k="deltaY"in b?b.deltaY:y[1]-x[1],S,R=b.target,A=Math.abs($)>Math.abs(k)?"h":"v";if("touches"in b&&A==="h"&&R.type==="range")return!1;var I=I0(A,R);if(!I)return!0;if(I?S=A:(S=A==="v"?"h":"v",I=I0(A,R)),!I)return!1;if(!r.current&&"changedTouches"in b&&($||k)&&(r.current=S),!S)return!0;var E=r.current||S;return k9(E,v,b,E==="h"?$:k)},[]),l=w.useCallback(function(b){var v=b;if(!(!ui.length||ui[ui.length-1]!==o)){var x="deltaY"in v?j0(v):Hs(v),y=e.current.filter(function(S){return S.name===v.type&&S.target===v.target&&A9(S.delta,x)})[0];if(y&&y.should){v.cancelable&&v.preventDefault();return}if(!y){var $=(s.current.shards||[]).map(D0).filter(Boolean).filter(function(S){return S.contains(v.target)}),k=$.length>0?a(v,$[0]):!s.current.noIsolation;k&&v.cancelable&&v.preventDefault()}}},[]),c=w.useCallback(function(b,v,x,y){var $={name:b,delta:v,target:x,should:y};e.current.push($),setTimeout(function(){e.current=e.current.filter(function(k){return k!==$})},1)},[]),d=w.useCallback(function(b){n.current=Hs(b),r.current=void 0},[]),h=w.useCallback(function(b){c(b.type,j0(b),b.target,a(b,t.lockRef.current))},[]),f=w.useCallback(function(b){c(b.type,Hs(b),b.target,a(b,t.lockRef.current))},[]);w.useEffect(function(){return ui.push(o),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",l,di),document.addEventListener("touchmove",l,di),document.addEventListener("touchstart",d,di),function(){ui=ui.filter(function(b){return b!==o}),document.removeEventListener("wheel",l,di),document.removeEventListener("touchmove",l,di),document.removeEventListener("touchstart",d,di)}},[]);var m=t.removeScrollBar,g=t.inert;return w.createElement(w.Fragment,null,g?w.createElement(o,{styles:R9(i)}):null,m?w.createElement(bh,{gapMode:"margin"}):null)}const E9=gh(f2,M9);var Wl=w.forwardRef(function(t,e){return w.createElement(Pl,Ye({},t,{ref:e,sideCar:E9}))});Wl.classNames=Pl.classNames;const O0=["Enter"," "],I9=["ArrowDown","PageUp","Home"],b2=["ArrowUp","PageDown","End"],j9=[...I9,...b2],D9={ltr:[...O0,"ArrowRight"],rtl:[...O0,"ArrowLeft"]},O9={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ql="Menu",[Po,L9,N9]=Nl(ql),[ii,v2]=et(ql,[N9,Sr,ro]),tf=Sr(),x2=ro(),[B9,oi]=ii(ql),[F9,Ul]=ii(ql),V9=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:i,onOpenChange:o,modal:s=!0}=t,a=tf(e),[l,c]=p.useState(null),d=p.useRef(!1),h=nt(o),f=ni(i);return p.useEffect(()=>{const m=()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>d.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),p.createElement(Il,a,p.createElement(B9,{scope:e,open:n,onOpenChange:h,content:l,onContentChange:c},p.createElement(F9,{scope:e,onClose:p.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:d,dir:f,modal:s},r)))},w2=p.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=tf(n);return p.createElement(hs,N({},i,r,{ref:e}))}),y2="MenuPortal",[_9,C2]=ii(y2,{forceMount:void 0}),z9=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:i}=t,o=oi(y2,e);return p.createElement(_9,{scope:e,forceMount:n},p.createElement(at,{present:n||o.open},p.createElement(Ji,{asChild:!0,container:i},r)))},on="MenuContent",[H9,$2]=ii(on),P9=p.forwardRef((t,e)=>{const n=C2(on,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,o=oi(on,t.__scopeMenu),s=Ul(on,t.__scopeMenu);return p.createElement(Po.Provider,{scope:t.__scopeMenu},p.createElement(at,{present:r||o.open},p.createElement(Po.Slot,{scope:t.__scopeMenu},s.modal?p.createElement(W9,N({},i,{ref:e})):p.createElement(q9,N({},i,{ref:e})))))}),W9=p.forwardRef((t,e)=>{const n=oi(on,t.__scopeMenu),r=p.useRef(null),i=ye(e,r);return p.useEffect(()=>{const o=r.current;if(o)return ps(o)},[]),p.createElement(nf,N({},t,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:X(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),q9=p.forwardRef((t,e)=>{const n=oi(on,t.__scopeMenu);return p.createElement(nf,N({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),nf=p.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:f,onDismiss:m,disableOutsideScroll:g,...b}=t,v=oi(on,n),x=Ul(on,n),y=tf(n),$=x2(n),k=L9(n),[S,R]=p.useState(null),A=p.useRef(null),I=ye(e,A,v.onContentChange),E=p.useRef(0),j=p.useRef(""),O=p.useRef(0),D=p.useRef(null),B=p.useRef("right"),V=p.useRef(0),q=g?Wl:p.Fragment,J=g?{as:Rn,allowPinchZoom:!0}:void 0,W=F=>{var Q,pe;const we=j.current+F,ce=k().filter(Z=>!Z.disabled),Ce=document.activeElement,P=(Q=ce.find(Z=>Z.ref.current===Ce))===null||Q===void 0?void 0:Q.textValue,oe=ce.map(Z=>Z.textValue),_=ik(oe,we,P),G=(pe=ce.find(Z=>Z.textValue===_))===null||pe===void 0?void 0:pe.ref.current;(function Z(ne){j.current=ne,window.clearTimeout(E.current),ne!==""&&(E.current=window.setTimeout(()=>Z(""),1e3))})(we),G&&setTimeout(()=>G.focus())};p.useEffect(()=>()=>window.clearTimeout(E.current),[]),eo();const K=p.useCallback(F=>{var Q,pe;return B.current===((Q=D.current)===null||Q===void 0?void 0:Q.side)&&sk(F,(pe=D.current)===null||pe===void 0?void 0:pe.area)},[]);return p.createElement(H9,{scope:n,searchRef:j,onItemEnter:p.useCallback(F=>{K(F)&&F.preventDefault()},[K]),onItemLeave:p.useCallback(F=>{var Q;K(F)||((Q=A.current)===null||Q===void 0||Q.focus(),R(null))},[K]),onTriggerLeave:p.useCallback(F=>{K(F)&&F.preventDefault()},[K]),pointerGraceTimerRef:O,onPointerGraceIntentChange:p.useCallback(F=>{D.current=F},[])},p.createElement(q,J,p.createElement(to,{asChild:!0,trapped:i,onMountAutoFocus:X(o,F=>{var Q;F.preventDefault(),(Q=A.current)===null||Q===void 0||Q.focus()}),onUnmountAutoFocus:s},p.createElement(ti,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:f,onDismiss:m},p.createElement(Jh,N({asChild:!0},$,{dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:R,onEntryFocus:X(l,F=>{x.isUsingKeyboardRef.current||F.preventDefault()})}),p.createElement(fs,N({role:"menu","aria-orientation":"vertical","data-state":k2(v.open),"data-radix-menu-content":"",dir:x.dir},y,b,{ref:I,style:{outline:"none",...b.style},onKeyDown:X(b.onKeyDown,F=>{const pe=F.target.closest("[data-radix-menu-content]")===F.currentTarget,we=F.ctrlKey||F.altKey||F.metaKey,ce=F.key.length===1;pe&&(F.key==="Tab"&&F.preventDefault(),!we&&ce&&W(F.key));const Ce=A.current;if(F.target!==Ce||!j9.includes(F.key))return;F.preventDefault();const oe=k().filter(_=>!_.disabled).map(_=>_.ref.current);b2.includes(F.key)&&oe.reverse(),nk(oe)}),onBlur:X(t.onBlur,F=>{F.currentTarget.contains(F.target)||(window.clearTimeout(E.current),j.current="")}),onPointerMove:X(t.onPointerMove,Wo(F=>{const Q=F.target,pe=V.current!==F.clientX;if(F.currentTarget.contains(Q)&&pe){const we=F.clientX>V.current?"right":"left";B.current=we,V.current=F.clientX}}))})))))))}),U9=p.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return p.createElement(ge.div,N({},r,{ref:e}))}),K9="MenuItem",G9=p.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=t,s=$2(K9,n),a=x2(n),l=p.useRef(null),c=ye(e,l),[d,h]=p.useState(!1),[f,m]=p.useState("");return p.useEffect(()=>{const g=l.current;if(g){var b;m(((b=g.textContent)!==null&&b!==void 0?b:"").trim())}},[o.children]),p.createElement(Po.ItemSlot,{scope:n,disabled:r,textValue:i??f},p.createElement(ef,N({asChild:!0},a,{focusable:!r}),p.createElement(ge.div,N({role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:c,onPointerMove:X(t.onPointerMove,Wo(g=>{r?s.onItemLeave(g):(s.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus())})),onPointerLeave:X(t.onPointerLeave,Wo(g=>s.onItemLeave(g))),onFocus:X(t.onFocus,()=>h(!0)),onBlur:X(t.onBlur,()=>h(!1))}))))}),Y9="MenuRadioGroup",[QH,ZH]=ii(Y9,{value:void 0,onValueChange:()=>{}}),X9="MenuItemIndicator",[JH,eP]=ii(X9,{checked:!1}),Q9=p.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return p.createElement(ge.div,N({role:"separator","aria-orientation":"horizontal"},r,{ref:e}))}),Z9="MenuSub",[tP,S2]=ii(Z9),Ps="MenuSubTrigger",J9=p.forwardRef((t,e)=>{const n=oi(Ps,t.__scopeMenu),r=Ul(Ps,t.__scopeMenu),i=S2(Ps,t.__scopeMenu),o=$2(Ps,t.__scopeMenu),s=p.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=o,c={__scopeMenu:t.__scopeMenu},d=p.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return p.useEffect(()=>d,[d]),p.useEffect(()=>{const h=a.current;return()=>{window.clearTimeout(h),l(null)}},[a,l]),p.createElement(w2,N({asChild:!0},c),p.createElement(G9,N({id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":k2(n.open)},t,{ref:Al(e,i.onTriggerChange),onClick:h=>{var f;(f=t.onClick)===null||f===void 0||f.call(t,h),!(t.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:X(t.onPointerMove,Wo(h=>{o.onItemEnter(h),!h.defaultPrevented&&!t.disabled&&!n.open&&!s.current&&(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:X(t.onPointerLeave,Wo(h=>{var f;d();const m=(f=n.content)===null||f===void 0?void 0:f.getBoundingClientRect();if(m){var g;const b=(g=n.content)===null||g===void 0?void 0:g.dataset.side,v=b==="right",x=v?-5:5,y=m[v?"left":"right"],$=m[v?"right":"left"];o.onPointerGraceIntentChange({area:[{x:h.clientX+x,y:h.clientY},{x:y,y:m.top},{x:$,y:m.top},{x:$,y:m.bottom},{x:y,y:m.bottom}],side:b}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(h),h.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:X(t.onKeyDown,h=>{const f=o.searchRef.current!=="";if(!(t.disabled||f&&h.key===" ")&&D9[r.dir].includes(h.key)){var m;n.onOpenChange(!0),(m=n.content)===null||m===void 0||m.focus(),h.preventDefault()}})})))}),ek="MenuSubContent",tk=p.forwardRef((t,e)=>{const n=C2(on,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,o=oi(on,t.__scopeMenu),s=Ul(on,t.__scopeMenu),a=S2(ek,t.__scopeMenu),l=p.useRef(null),c=ye(e,l);return p.createElement(Po.Provider,{scope:t.__scopeMenu},p.createElement(at,{present:r||o.open},p.createElement(Po.Slot,{scope:t.__scopeMenu},p.createElement(nf,N({id:a.contentId,"aria-labelledby":a.triggerId},i,{ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var h;s.isUsingKeyboardRef.current&&((h=l.current)===null||h===void 0||h.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:X(t.onFocusOutside,d=>{d.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:X(t.onEscapeKeyDown,d=>{s.onClose(),d.preventDefault()}),onKeyDown:X(t.onKeyDown,d=>{const h=d.currentTarget.contains(d.target),f=O9[s.dir].includes(d.key);if(h&&f){var m;o.onOpenChange(!1),(m=a.trigger)===null||m===void 0||m.focus(),d.preventDefault()}})})))))});function k2(t){return t?"open":"closed"}function nk(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function rk(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function ik(t,e,n){const i=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,o=n?t.indexOf(n):-1;let s=rk(t,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function ok(t,e){const{x:n,y:r}=t;let i=!1;for(let o=0,s=e.length-1;o<e.length;s=o++){const a=e[o].x,l=e[o].y,c=e[s].x,d=e[s].y;l>r!=d>r&&n<(c-a)*(r-l)/(d-l)+a&&(i=!i)}return i}function sk(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return ok(n,e)}function Wo(t){return e=>e.pointerType==="mouse"?t(e):void 0}const ak=V9,lk=w2,ck=z9,dk=P9,uk=U9,hk=Q9,fk=J9,mk=tk,A2="DropdownMenu",[pk,nP]=et(A2,[v2]),Rr=v2(),[gk,R2]=pk(A2),bk=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:s,modal:a=!0}=t,l=Rr(e),c=p.useRef(null),[d=!1,h]=mt({prop:i,defaultProp:o,onChange:s});return p.createElement(gk,{scope:e,triggerId:gt(),triggerRef:c,contentId:gt(),open:d,onOpenChange:h,onOpenToggle:p.useCallback(()=>h(f=>!f),[h]),modal:a},p.createElement(ak,N({},l,{open:d,onOpenChange:h,dir:r,modal:a}),n))},vk="DropdownMenuTrigger",xk=p.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=t,o=R2(vk,n),s=Rr(n);return p.createElement(lk,N({asChild:!0},s),p.createElement(ge.button,N({type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},i,{ref:Al(e,o.triggerRef),onPointerDown:X(t.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:X(t.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})))}),wk=t=>{const{__scopeDropdownMenu:e,...n}=t,r=Rr(e);return p.createElement(ck,N({},r,n))},yk="DropdownMenuContent",Ck=p.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=R2(yk,n),o=Rr(n),s=p.useRef(!1);return p.createElement(dk,N({id:i.contentId,"aria-labelledby":i.triggerId},o,r,{ref:e,onCloseAutoFocus:X(t.onCloseAutoFocus,a=>{var l;s.current||(l=i.triggerRef.current)===null||l===void 0||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:X(t.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;(!i.modal||d)&&(s.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),$k=p.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Rr(n);return p.createElement(uk,N({},i,r,{ref:e}))}),Sk=p.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Rr(n);return p.createElement(hk,N({},i,r,{ref:e}))}),kk=p.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Rr(n);return p.createElement(fk,N({},i,r,{ref:e}))}),Ak=p.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Rr(n);return p.createElement(mk,N({},i,r,{ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),Rk=bk,Tk=xk,T2=wk,Mk=Ck,Ek=$k,Ik=Sk,jk=kk,Dk=Ak,M2="Checkbox",[Ok,rP]=et(M2),[Lk,Nk]=Ok(M2),Bk=p.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:s,disabled:a,value:l="on",onCheckedChange:c,...d}=t,[h,f]=p.useState(null),m=ye(e,$=>f($)),g=p.useRef(!1),b=h?!!h.closest("form"):!0,[v=!1,x]=mt({prop:i,defaultProp:o,onChange:c}),y=p.useRef(v);return p.useEffect(()=>{const $=h?.form;if($){const k=()=>x(y.current);return $.addEventListener("reset",k),()=>$.removeEventListener("reset",k)}},[h,x]),p.createElement(Lk,{scope:n,state:v,disabled:a},p.createElement(ge.button,N({type:"button",role:"checkbox","aria-checked":Vr(v)?"mixed":v,"aria-required":s,"data-state":E2(v),"data-disabled":a?"":void 0,disabled:a,value:l},d,{ref:m,onKeyDown:X(t.onKeyDown,$=>{$.key==="Enter"&&$.preventDefault()}),onClick:X(t.onClick,$=>{x(k=>Vr(k)?!0:!k),b&&(g.current=$.isPropagationStopped(),g.current||$.stopPropagation())})})),b&&p.createElement(_k,{control:h,bubbles:!g.current,name:r,value:l,checked:v,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),Fk="CheckboxIndicator",Vk=p.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...i}=t,o=Nk(Fk,n);return p.createElement(at,{present:r||Vr(o.state)||o.state===!0},p.createElement(ge.span,N({"data-state":E2(o.state),"data-disabled":o.disabled?"":void 0},i,{ref:e,style:{pointerEvents:"none",...t.style}})))}),_k=t=>{const{control:e,checked:n,bubbles:r=!0,...i}=t,o=p.useRef(null),s=Bl(n),a=El(e);return p.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&h){const f=new Event("click",{bubbles:r});l.indeterminate=Vr(n),h.call(l,Vr(n)?!1:n),l.dispatchEvent(f)}},[s,n,r]),p.createElement("input",N({type:"checkbox","aria-hidden":!0,defaultChecked:Vr(n)?!1:n},i,{tabIndex:-1,ref:o,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function Vr(t){return t==="indeterminate"}function E2(t){return Vr(t)?"indeterminate":t?"checked":"unchecked"}const zk=Bk,Hk=Vk;function Pk(t,e){return p.useReducer((n,r)=>{const i=e[n][r];return i??n},t)}const I2="ScrollArea",[j2,iP]=et(I2),[Wk,Dn]=j2(I2),qk=p.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...s}=t,[a,l]=p.useState(null),[c,d]=p.useState(null),[h,f]=p.useState(null),[m,g]=p.useState(null),[b,v]=p.useState(null),[x,y]=p.useState(0),[$,k]=p.useState(0),[S,R]=p.useState(!1),[A,I]=p.useState(!1),E=ye(e,O=>l(O)),j=ni(i);return p.createElement(Wk,{scope:n,type:r,dir:j,scrollHideDelay:o,scrollArea:a,viewport:c,onViewportChange:d,content:h,onContentChange:f,scrollbarX:m,onScrollbarXChange:g,scrollbarXEnabled:S,onScrollbarXEnabledChange:R,scrollbarY:b,onScrollbarYChange:v,scrollbarYEnabled:A,onScrollbarYEnabledChange:I,onCornerWidthChange:y,onCornerHeightChange:k},p.createElement(ge.div,N({dir:j},s,{ref:E,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":$+"px",...t.style}})))}),Uk="ScrollAreaViewport",Kk=p.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:r,...i}=t,o=Dn(Uk,n),s=p.useRef(null),a=ye(e,s,o.onViewportChange);return p.createElement(p.Fragment,null,p.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),p.createElement(ge.div,N({"data-radix-scroll-area-viewport":""},i,{ref:a,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...t.style}}),p.createElement("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),nr="ScrollAreaScrollbar",Gk=p.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=Dn(nr,t.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=i,a=t.orientation==="horizontal";return p.useEffect(()=>(a?o(!0):s(!0),()=>{a?o(!1):s(!1)}),[a,o,s]),i.type==="hover"?p.createElement(Yk,N({},r,{ref:e,forceMount:n})):i.type==="scroll"?p.createElement(Xk,N({},r,{ref:e,forceMount:n})):i.type==="auto"?p.createElement(D2,N({},r,{ref:e,forceMount:n})):i.type==="always"?p.createElement(rf,N({},r,{ref:e})):null}),Yk=p.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=Dn(nr,t.__scopeScrollArea),[o,s]=p.useState(!1);return p.useEffect(()=>{const a=i.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},d=()=>{l=window.setTimeout(()=>s(!1),i.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",d)}}},[i.scrollArea,i.scrollHideDelay]),p.createElement(at,{present:n||o},p.createElement(D2,N({"data-state":o?"visible":"hidden"},r,{ref:e})))}),Xk=p.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=Dn(nr,t.__scopeScrollArea),o=t.orientation==="horizontal",s=Gl(()=>l("SCROLL_END"),100),[a,l]=Pk("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return p.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,i.scrollHideDelay,l]),p.useEffect(()=>{const c=i.viewport,d=o?"scrollLeft":"scrollTop";if(c){let h=c[d];const f=()=>{const m=c[d];h!==m&&(l("SCROLL"),s()),h=m};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[i.viewport,o,l,s]),p.createElement(at,{present:n||a!=="hidden"},p.createElement(rf,N({"data-state":a==="hidden"?"hidden":"visible"},r,{ref:e,onPointerEnter:X(t.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:X(t.onPointerLeave,()=>l("POINTER_LEAVE"))})))}),D2=p.forwardRef((t,e)=>{const n=Dn(nr,t.__scopeScrollArea),{forceMount:r,...i}=t,[o,s]=p.useState(!1),a=t.orientation==="horizontal",l=Gl(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:d)}},10);return Pa(n.viewport,l),Pa(n.content,l),p.createElement(at,{present:r||o},p.createElement(rf,N({"data-state":o?"visible":"hidden"},i,{ref:e})))}),rf=p.forwardRef((t,e)=>{const{orientation:n="vertical",...r}=t,i=Dn(nr,t.__scopeScrollArea),o=p.useRef(null),s=p.useRef(0),[a,l]=p.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=N2(a.viewport,a.content),d={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:f=>o.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function h(f,m){return nA(f,s.current,a,m)}return n==="horizontal"?p.createElement(Qk,N({},d,{ref:e,onThumbPositionChange:()=>{if(i.viewport&&o.current){const f=i.viewport.scrollLeft,m=L0(f,a,i.dir);o.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:f=>{i.viewport&&(i.viewport.scrollLeft=f)},onDragScroll:f=>{i.viewport&&(i.viewport.scrollLeft=h(f,i.dir))}})):n==="vertical"?p.createElement(Zk,N({},d,{ref:e,onThumbPositionChange:()=>{if(i.viewport&&o.current){const f=i.viewport.scrollTop,m=L0(f,a);o.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:f=>{i.viewport&&(i.viewport.scrollTop=f)},onDragScroll:f=>{i.viewport&&(i.viewport.scrollTop=h(f))}})):null}),Qk=p.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...i}=t,o=Dn(nr,t.__scopeScrollArea),[s,a]=p.useState(),l=p.useRef(null),c=ye(e,l,o.onScrollbarXChange);return p.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),p.createElement(L2,N({"data-orientation":"horizontal"},i,{ref:c,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Kl(n)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.x),onDragScroll:d=>t.onDragScroll(d.x),onWheelScroll:(d,h)=>{if(o.viewport){const f=o.viewport.scrollLeft+d.deltaX;t.onWheelScroll(f),F2(f,h)&&d.preventDefault()}},onResize:()=>{l.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Ha(s.paddingLeft),paddingEnd:Ha(s.paddingRight)}})}}))}),Zk=p.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...i}=t,o=Dn(nr,t.__scopeScrollArea),[s,a]=p.useState(),l=p.useRef(null),c=ye(e,l,o.onScrollbarYChange);return p.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),p.createElement(L2,N({"data-orientation":"vertical"},i,{ref:c,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Kl(n)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.y),onDragScroll:d=>t.onDragScroll(d.y),onWheelScroll:(d,h)=>{if(o.viewport){const f=o.viewport.scrollTop+d.deltaY;t.onWheelScroll(f),F2(f,h)&&d.preventDefault()}},onResize:()=>{l.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Ha(s.paddingTop),paddingEnd:Ha(s.paddingBottom)}})}}))}),[Jk,O2]=j2(nr),L2=p.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:d,onResize:h,...f}=t,m=Dn(nr,n),[g,b]=p.useState(null),v=ye(e,E=>b(E)),x=p.useRef(null),y=p.useRef(""),$=m.viewport,k=r.content-r.viewport,S=nt(d),R=nt(l),A=Gl(h,10);function I(E){if(x.current){const j=E.clientX-x.current.left,O=E.clientY-x.current.top;c({x:j,y:O})}}return p.useEffect(()=>{const E=j=>{const O=j.target;g?.contains(O)&&S(j,k)};return document.addEventListener("wheel",E,{passive:!1}),()=>document.removeEventListener("wheel",E,{passive:!1})},[$,g,k,S]),p.useEffect(R,[r,R]),Pa(g,A),Pa(m.content,A),p.createElement(Jk,{scope:n,scrollbar:g,hasThumb:i,onThumbChange:nt(o),onThumbPointerUp:nt(s),onThumbPositionChange:R,onThumbPointerDown:nt(a)},p.createElement(ge.div,N({},f,{ref:v,style:{position:"absolute",...f.style},onPointerDown:X(t.onPointerDown,E=>{E.button===0&&(E.target.setPointerCapture(E.pointerId),x.current=g.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),I(E))}),onPointerMove:X(t.onPointerMove,I),onPointerUp:X(t.onPointerUp,E=>{const j=E.target;j.hasPointerCapture(E.pointerId)&&j.releasePointerCapture(E.pointerId),document.body.style.webkitUserSelect=y.current,m.viewport&&(m.viewport.style.scrollBehavior=""),x.current=null})})))}),zd="ScrollAreaThumb",eA=p.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=O2(zd,t.__scopeScrollArea);return p.createElement(at,{present:n||i.hasThumb},p.createElement(tA,N({ref:e},r)))}),tA=p.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:r,...i}=t,o=Dn(zd,n),s=O2(zd,n),{onThumbPositionChange:a}=s,l=ye(e,h=>s.onThumbChange(h)),c=p.useRef(),d=Gl(()=>{c.current&&(c.current(),c.current=void 0)},100);return p.useEffect(()=>{const h=o.viewport;if(h){const f=()=>{if(d(),!c.current){const m=rA(h,a);c.current=m,a()}};return a(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[o.viewport,d,a]),p.createElement(ge.div,N({"data-state":s.hasThumb?"visible":"hidden"},i,{ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:X(t.onPointerDownCapture,h=>{const m=h.target.getBoundingClientRect(),g=h.clientX-m.left,b=h.clientY-m.top;s.onThumbPointerDown({x:g,y:b})}),onPointerUp:X(t.onPointerUp,s.onThumbPointerUp)}))});function Ha(t){return t?parseInt(t,10):0}function N2(t,e){const n=t/e;return isNaN(n)?0:n}function Kl(t){const e=N2(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function nA(t,e,n,r="ltr"){const i=Kl(n),o=i/2,s=e||o,a=i-s,l=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,d=n.content-n.viewport,h=r==="ltr"?[0,d]:[d*-1,0];return B2([l,c],h)(t)}function L0(t,e,n="ltr"){const r=Kl(e),i=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=e.scrollbar.size-i,s=e.content-e.viewport,a=o-r,l=n==="ltr"?[0,s]:[s*-1,0],c=Id(t,l);return B2([0,s],[0,a])(c)}function B2(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function F2(t,e){return t>0&&t<e}const rA=(t,e=()=>{})=>{let n={left:t.scrollLeft,top:t.scrollTop},r=0;return function i(){const o={left:t.scrollLeft,top:t.scrollTop},s=n.left!==o.left,a=n.top!==o.top;(s||a)&&e(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function Gl(t,e){const n=nt(t),r=p.useRef(0);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),p.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,e)},[n,e])}function Pa(t,e){const n=nt(e);Ke(()=>{let r=0;if(t){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(t),()=>{window.cancelAnimationFrame(r),i.unobserve(t)}}},[t,n])}const iA=qk,oA=Kk,sA=Gk,aA=eA,V2="Dialog",[_2,z2]=et(V2),[lA,un]=_2(V2),cA=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=t,a=p.useRef(null),l=p.useRef(null),[c=!1,d]=mt({prop:r,defaultProp:i,onChange:o});return p.createElement(lA,{scope:e,triggerRef:a,contentRef:l,contentId:gt(),titleId:gt(),descriptionId:gt(),open:c,onOpenChange:d,onOpenToggle:p.useCallback(()=>d(h=>!h),[d]),modal:s},n)},dA="DialogTrigger",uA=p.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=un(dA,n),o=ye(e,i.triggerRef);return p.createElement(ge.button,N({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":of(i.open)},r,{ref:o,onClick:X(t.onClick,i.onOpenToggle)}))}),H2="DialogPortal",[hA,P2]=_2(H2,{forceMount:void 0}),fA=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:i}=t,o=un(H2,e);return p.createElement(hA,{scope:e,forceMount:n},p.Children.map(r,s=>p.createElement(at,{present:n||o.open},p.createElement(Ji,{asChild:!0,container:i},s))))},Hd="DialogOverlay",mA=p.forwardRef((t,e)=>{const n=P2(Hd,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,o=un(Hd,t.__scopeDialog);return o.modal?p.createElement(at,{present:r||o.open},p.createElement(pA,N({},i,{ref:e}))):null}),pA=p.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=un(Hd,n);return p.createElement(Wl,{as:Rn,allowPinchZoom:!0,shards:[i.contentRef]},p.createElement(ge.div,N({"data-state":of(i.open)},r,{ref:e,style:{pointerEvents:"auto",...r.style}})))}),_i="DialogContent",gA=p.forwardRef((t,e)=>{const n=P2(_i,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,o=un(_i,t.__scopeDialog);return p.createElement(at,{present:r||o.open},o.modal?p.createElement(bA,N({},i,{ref:e})):p.createElement(vA,N({},i,{ref:e})))}),bA=p.forwardRef((t,e)=>{const n=un(_i,t.__scopeDialog),r=p.useRef(null),i=ye(e,n.contentRef,r);return p.useEffect(()=>{const o=r.current;if(o)return ps(o)},[]),p.createElement(W2,N({},t,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:X(t.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:X(t.onPointerDownOutside,o=>{const s=o.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&o.preventDefault()}),onFocusOutside:X(t.onFocusOutside,o=>o.preventDefault())}))}),vA=p.forwardRef((t,e)=>{const n=un(_i,t.__scopeDialog),r=p.useRef(!1),i=p.useRef(!1);return p.createElement(W2,N({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s;if((s=t.onCloseAutoFocus)===null||s===void 0||s.call(t,o),!o.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),o.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:o=>{var s,a;(s=t.onInteractOutside)===null||s===void 0||s.call(t,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}}))}),W2=p.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=t,a=un(_i,n),l=p.useRef(null),c=ye(e,l);return eo(),p.createElement(p.Fragment,null,p.createElement(to,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},p.createElement(ti,N({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":of(a.open)},s,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),q2="DialogTitle",xA=p.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=un(q2,n);return p.createElement(ge.h2,N({id:i.titleId},r,{ref:e}))}),wA="DialogDescription",yA=p.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=un(wA,n);return p.createElement(ge.p,N({id:i.descriptionId},r,{ref:e}))}),CA="DialogClose",$A=p.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=un(CA,n);return p.createElement(ge.button,N({type:"button"},r,{ref:e,onClick:X(t.onClick,()=>i.onOpenChange(!1))}))});function of(t){return t?"open":"closed"}const SA="DialogTitleWarning",[kA,oP]=th(SA,{contentName:_i,titleName:q2,docsSlug:"dialog"}),U2=cA,K2=uA,G2=fA,Y2=mA,X2=gA,Q2=xA,AA=yA,sf=$A,RA="AlertDialog",[TA,sP]=et(RA,[z2]),rr=z2(),MA=t=>{const{__scopeAlertDialog:e,...n}=t,r=rr(e);return p.createElement(U2,N({},r,n,{modal:!0}))},EA=p.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=rr(n);return p.createElement(K2,N({},i,r,{ref:e}))}),IA=t=>{const{__scopeAlertDialog:e,...n}=t,r=rr(e);return p.createElement(G2,N({},r,n))},jA=p.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=rr(n);return p.createElement(Y2,N({},i,r,{ref:e}))}),Z2="AlertDialogContent",[DA,OA]=TA(Z2),LA=p.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:r,...i}=t,o=rr(n),s=p.useRef(null),a=ye(e,s),l=p.useRef(null);return p.createElement(kA,{contentName:Z2,titleName:NA,docsSlug:"alert-dialog"},p.createElement(DA,{scope:n,cancelRef:l},p.createElement(X2,N({role:"alertdialog"},o,i,{ref:a,onOpenAutoFocus:X(i.onOpenAutoFocus,c=>{var d;c.preventDefault(),(d=l.current)===null||d===void 0||d.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault()}),p.createElement(nh,null,r),!1)))}),NA="AlertDialogTitle",BA=p.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=rr(n);return p.createElement(Q2,N({},i,r,{ref:e}))}),FA=p.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=rr(n);return p.createElement(AA,N({},i,r,{ref:e}))}),VA=p.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=rr(n);return p.createElement(sf,N({},i,r,{ref:e}))}),_A="AlertDialogCancel",zA=p.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,{cancelRef:i}=OA(_A,n),o=rr(n),s=ye(e,i);return p.createElement(sf,N({},o,r,{ref:s}))}),HA=MA,PA=EA,WA=IA,qA=jA,UA=LA,KA=VA,GA=zA,YA=BA,XA=FA;var wa=typeof document<"u"?p.useLayoutEffect:p.useEffect;function Wa(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Wa(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&t.$$typeof)&&!Wa(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function J2(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function N0(t,e){const n=J2(t);return Math.round(e*n)/n}function B0(t){const e=w.useRef(t);return wa(()=>{e.current=t}),e}function QA(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=t,[d,h]=w.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,m]=w.useState(r);Wa(f,r)||m(r);const[g,b]=w.useState(null),[v,x]=w.useState(null),y=w.useCallback(W=>{W!==R.current&&(R.current=W,b(W))},[]),$=w.useCallback(W=>{W!==A.current&&(A.current=W,x(W))},[]),k=o||g,S=s||v,R=w.useRef(null),A=w.useRef(null),I=w.useRef(d),E=l!=null,j=B0(l),O=B0(i),D=w.useCallback(()=>{if(!R.current||!A.current)return;const W={placement:e,strategy:n,middleware:f};O.current&&(W.platform=O.current),Xp(R.current,A.current,W).then(K=>{const F={...K,isPositioned:!0};B.current&&!Wa(I.current,F)&&(I.current=F,ei.flushSync(()=>{h(F)}))})},[f,e,n,O]);wa(()=>{c===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,h(W=>({...W,isPositioned:!1})))},[c]);const B=w.useRef(!1);wa(()=>(B.current=!0,()=>{B.current=!1}),[]),wa(()=>{if(k&&(R.current=k),S&&(A.current=S),k&&S){if(j.current)return j.current(k,S,D);D()}},[k,S,D,j,E]);const V=w.useMemo(()=>({reference:R,floating:A,setReference:y,setFloating:$}),[y,$]),q=w.useMemo(()=>({reference:k,floating:S}),[k,S]),J=w.useMemo(()=>{const W={position:n,left:0,top:0};if(!q.floating)return W;const K=N0(q.floating,d.x),F=N0(q.floating,d.y);return a?{...W,transform:"translate("+K+"px, "+F+"px)",...J2(q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:F}},[n,a,q.floating,d.x,d.y]);return w.useMemo(()=>({...d,update:D,refs:V,elements:q,floatingStyles:J}),[d,D,V,q,J])}const ZA=(t,e)=>({...Kp(t),options:[t,e]}),JA=(t,e)=>({...Gp(t),options:[t,e]}),eR=(t,e)=>({...Yp(t),options:[t,e]});var eb=ph(),Lc=function(){},Yl=w.forwardRef(function(t,e){var n=w.useRef(null),r=w.useState({onScrollCapture:Lc,onWheelCapture:Lc,onTouchMoveCapture:Lc}),i=r[0],o=r[1],s=t.forwardProps,a=t.children,l=t.className,c=t.removeScrollBar,d=t.enabled,h=t.shards,f=t.sideCar,m=t.noIsolation,g=t.inert,b=t.allowPinchZoom,v=t.as,x=v===void 0?"div":v,y=t.gapMode,$=Dl(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=f,S=mh([n,e]),R=Ye(Ye({},$),i);return w.createElement(w.Fragment,null,d&&w.createElement(k,{sideCar:eb,removeScrollBar:c,shards:h,noIsolation:m,inert:g,setCallbacks:o,allowPinchZoom:!!b,lockRef:n,gapMode:y}),s?w.cloneElement(w.Children.only(a),Ye(Ye({},R),{ref:S})):w.createElement(x,Ye({},R,{className:l,ref:S}),a))});Yl.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Yl.classNames={fullWidth:Si,zeroRight:$i};var Pd=!1;if(typeof window<"u")try{var Ws=Object.defineProperty({},"passive",{get:function(){return Pd=!0,!0}});window.addEventListener("test",Ws,Ws),window.removeEventListener("test",Ws,Ws)}catch{Pd=!1}var hi=Pd?{passive:!1}:!1,tR=function(t){return t.tagName==="TEXTAREA"},tb=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!tR(t)&&n[e]==="visible")},nR=function(t){return tb(t,"overflowY")},rR=function(t){return tb(t,"overflowX")},F0=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=nb(t,r);if(i){var o=rb(t,r),s=o[1],a=o[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},iR=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},oR=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},nb=function(t,e){return t==="v"?nR(e):rR(e)},rb=function(t,e){return t==="v"?iR(e):oR(e)},sR=function(t,e){return t==="h"&&e==="rtl"?-1:1},aR=function(t,e,n,r,i){var o=sR(t,window.getComputedStyle(e).direction),s=o*r,a=n.target,l=e.contains(a),c=!1,d=s>0,h=0,f=0;do{var m=rb(t,a),g=m[0],b=m[1],v=m[2],x=b-v-o*g;(g||x)&&nb(t,a)&&(h+=x,f+=g),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(d&&Math.abs(h)<1||!d&&Math.abs(f)<1)&&(c=!0),c},qs=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},V0=function(t){return[t.deltaX,t.deltaY]},_0=function(t){return t&&"current"in t?t.current:t},lR=function(t,e){return t[0]===e[0]&&t[1]===e[1]},cR=function(t){return`
|
|
51
|
+
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
52
|
+
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
53
|
+
`)},dR=0,fi=[];function uR(t){var e=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),i=w.useState(dR++)[0],o=w.useState(Ll)[0],s=w.useRef(t);w.useEffect(function(){s.current=t},[t]),w.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var b=fh([t.lockRef.current],(t.shards||[]).map(_0),!0).filter(Boolean);return b.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),b.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=w.useCallback(function(b,v){if("touches"in b&&b.touches.length===2)return!s.current.allowPinchZoom;var x=qs(b),y=n.current,$="deltaX"in b?b.deltaX:y[0]-x[0],k="deltaY"in b?b.deltaY:y[1]-x[1],S,R=b.target,A=Math.abs($)>Math.abs(k)?"h":"v";if("touches"in b&&A==="h"&&R.type==="range")return!1;var I=F0(A,R);if(!I)return!0;if(I?S=A:(S=A==="v"?"h":"v",I=F0(A,R)),!I)return!1;if(!r.current&&"changedTouches"in b&&($||k)&&(r.current=S),!S)return!0;var E=r.current||S;return aR(E,v,b,E==="h"?$:k)},[]),l=w.useCallback(function(b){var v=b;if(!(!fi.length||fi[fi.length-1]!==o)){var x="deltaY"in v?V0(v):qs(v),y=e.current.filter(function(S){return S.name===v.type&&(S.target===v.target||v.target===S.shadowParent)&&lR(S.delta,x)})[0];if(y&&y.should){v.cancelable&&v.preventDefault();return}if(!y){var $=(s.current.shards||[]).map(_0).filter(Boolean).filter(function(S){return S.contains(v.target)}),k=$.length>0?a(v,$[0]):!s.current.noIsolation;k&&v.cancelable&&v.preventDefault()}}},[]),c=w.useCallback(function(b,v,x,y){var $={name:b,delta:v,target:x,should:y,shadowParent:hR(x)};e.current.push($),setTimeout(function(){e.current=e.current.filter(function(k){return k!==$})},1)},[]),d=w.useCallback(function(b){n.current=qs(b),r.current=void 0},[]),h=w.useCallback(function(b){c(b.type,V0(b),b.target,a(b,t.lockRef.current))},[]),f=w.useCallback(function(b){c(b.type,qs(b),b.target,a(b,t.lockRef.current))},[]);w.useEffect(function(){return fi.push(o),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",l,hi),document.addEventListener("touchmove",l,hi),document.addEventListener("touchstart",d,hi),function(){fi=fi.filter(function(b){return b!==o}),document.removeEventListener("wheel",l,hi),document.removeEventListener("touchmove",l,hi),document.removeEventListener("touchstart",d,hi)}},[]);var m=t.removeScrollBar,g=t.inert;return w.createElement(w.Fragment,null,g?w.createElement(o,{styles:cR(i)}):null,m?w.createElement(bh,{gapMode:t.gapMode}):null)}function hR(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const fR=gh(eb,uR);var ib=w.forwardRef(function(t,e){return w.createElement(Yl,Ye({},t,{ref:e,sideCar:fR}))});ib.classNames=Yl.classNames;const ob=1024;let mR=0,Nc=class{constructor(e,n){this.from=e,this.to=n}};class Te{constructor(e={}){this.id=mR++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Lt.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}Te.closedBy=new Te({deserialize:t=>t.split(" ")});Te.openedBy=new Te({deserialize:t=>t.split(" ")});Te.group=new Te({deserialize:t=>t.split(" ")});Te.isolate=new Te({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Te.contextHash=new Te({perNode:!0});Te.lookAhead=new Te({perNode:!0});Te.mounted=new Te({perNode:!0});class qa{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[Te.mounted.id]}}const pR=Object.create(null);class Lt{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):pR,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Lt(e.name||"",n,e.id,r);if(e.props){for(let o of e.props)if(Array.isArray(o)||(o=o(i)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[o[0].id]=o[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(Te.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(Te.group),o=-1;o<(i?i.length:0);o++){let s=n[o<0?r.name:i[o]];if(s)return s}}}}Lt.none=new Lt("",Object.create(null),0,8);class af{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let r of this.types){let i=null;for(let o of e){let s=o(r);s&&(i||(i=Object.assign({},r.props)),i[s[0].id]=s[1])}n.push(i?new Lt(r.name,i,r.id,r.flags):r)}return new af(n)}}const Us=new WeakMap,z0=new WeakMap;var lt;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays"})(lt||(lt={}));class rt{constructor(e,n,r,i,o){if(this.type=e,this.children=n,this.positions=r,this.length=i,this.props=null,o&&o.length){this.props=Object.create(null);for(let[s,a]of o)this.props[typeof s=="number"?s:s.id]=a}}toString(){let e=qa.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let r of this.children){let i=r.toString();i&&(n&&(n+=","),n+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new qd(this.topNode,e)}cursorAt(e,n=0,r=0){let i=Us.get(this)||this.topNode,o=new qd(i);return o.moveTo(e,n),Us.set(this,o._tree),o}get topNode(){return new Kt(this,0,0,null)}resolve(e,n=0){let r=qo(Us.get(this)||this.topNode,e,n,!1);return Us.set(this,r),r}resolveInner(e,n=0){let r=qo(z0.get(this)||this.topNode,e,n,!0);return z0.set(this,r),r}resolveStack(e,n=0){return vR(this,e,n)}iterate(e){let{enter:n,leave:r,from:i=0,to:o=this.length}=e,s=e.mode||0,a=(s<.IncludeAnonymous)>0;for(let l=this.cursor(s|lt.IncludeAnonymous);;){let c=!1;if(l.from<=o&&l.to>=i&&(!a&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(a||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:df(Lt.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new rt(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new rt(Lt.none,n,r,i)))}static build(e){return xR(e)}}rt.empty=new rt(Lt.none,[],[],0);class lf{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new lf(this.buffer,this.index)}}class vr{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return Lt.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],r=this.buffer[e+3],i=this.set.types[n],o=i.name;if(/\W/.test(o)&&!i.isError&&(o=JSON.stringify(o)),e+=4,r==e)return o;let s=[];for(;e<r;)s.push(this.childString(e)),e=this.buffer[e+3];return o+"("+s.join(",")+")"}findChild(e,n,r,i,o){let{buffer:s}=this,a=-1;for(let l=e;l!=n&&!(sb(o,i,s[l+1],s[l+2])&&(a=l,r>0));l=s[l+3]);return a}slice(e,n,r){let i=this.buffer,o=new Uint16Array(n-e),s=0;for(let a=e,l=0;a<n;){o[l++]=i[a++],o[l++]=i[a++]-r;let c=o[l++]=i[a++]-r;o[l++]=i[a++]-e,s=Math.max(s,c)}return new vr(o,s,this.set)}}function sb(t,e,n,r){switch(t){case-2:return n<e;case-1:return r>=e&&n<e;case 0:return n<e&&r>e;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function qo(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let s=!r&&t instanceof Kt&&t.index<0?null:t.parent;if(!s)return t;t=s}let o=r?0:lt.IgnoreOverlays;if(r)for(let s=t,a=s.parent;a;s=a,a=s.parent)s instanceof Kt&&s.index<0&&((i=a.enter(e,n,o))===null||i===void 0?void 0:i.from)!=s.from&&(t=a);for(;;){let s=t.enter(e,n,o);if(!s)return t;t=s}}class ab{cursor(e=0){return new qd(this,e)}getChild(e,n=null,r=null){let i=H0(this,e,n,r);return i.length?i[0]:null}getChildren(e,n=null,r=null){return H0(this,e,n,r)}resolve(e,n=0){return qo(this,e,n,!1)}resolveInner(e,n=0){return qo(this,e,n,!0)}matchContext(e){return Wd(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),r=this;for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(r=n,n=i.prevSibling):n=i}return r}get node(){return this}get next(){return this.parent}}class Kt extends ab{constructor(e,n,r,i){super(),this._tree=e,this.from=n,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,r,i,o=0){for(let s=this;;){for(let{children:a,positions:l}=s._tree,c=n>0?a.length:-1;e!=c;e+=n){let d=a[e],h=l[e]+s.from;if(sb(i,r,h,h+d.length)){if(d instanceof vr){if(o<.ExcludeBuffers)continue;let f=d.findChild(0,d.buffer.length,n,r-h,i);if(f>-1)return new cr(new gR(s,d,e,h),null,f)}else if(o<.IncludeAnonymous||!d.type.isAnonymous||cf(d)){let f;if(!(o<.IgnoreMounts)&&(f=qa.get(d))&&!f.overlay)return new Kt(f.tree,h,e,s);let m=new Kt(d,h,e,s);return o<.IncludeAnonymous||!m.type.isAnonymous?m:m.nextChild(n<0?d.children.length-1:0,n,r,i)}}}if(o<.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+n:e=n<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,n,r=0){let i;if(!(r<.IgnoreOverlays)&&(i=qa.get(this._tree))&&i.overlay){let o=e-this.from;for(let{from:s,to:a}of i.overlay)if((n>0?s<=o:s<o)&&(n<0?a>=o:a>o))return new Kt(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function H0(t,e,n,r){let i=t.cursor(),o=[];if(!i.firstChild())return o;if(n!=null){for(let s=!1;!s;)if(s=i.type.is(n),!i.nextSibling())return o}for(;;){if(r!=null&&i.type.is(r))return o;if(i.type.is(e)&&o.push(i.node),!i.nextSibling())return r==null?o:[]}}function Wd(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class gR{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class cr extends ab{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return o<0?null:new cr(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,n,r=0){if(r<.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return o<0?null:new cr(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new cr(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new cr(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,o=r.buffer[this.index+3];if(o>i){let s=r.buffer[this.index+1];e.push(r.slice(i,o,s)),n.push(0)}return new rt(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function lb(t){if(!t.length)return null;let e=0,n=t[0];for(let o=1;o<t.length;o++){let s=t[o];(s.from>n.from||s.to<n.to)&&(n=s,e=o)}let r=n instanceof Kt&&n.index<0?null:n.parent,i=t.slice();return r?i[e]=r:i.splice(e,1),new bR(i,n)}class bR{constructor(e,n){this.heads=e,this.node=n}get next(){return lb(this.heads)}}function vR(t,e,n){let r=t.resolveInner(e,n),i=null;for(let o=r instanceof Kt?r:r.context.parent;o;o=o.parent)if(o.index<0){let s=o.parent;(i||(i=[r])).push(s.resolve(e,n)),o=s}else{let s=qa.get(o.tree);if(s&&s.overlay&&s.overlay[0].from<=e&&s.overlay[s.overlay.length-1].to>=e){let a=new Kt(s.tree,s.overlay[0].from+o.from,-1,o);(i||(i=[r])).push(qo(a,e,n,!1))}}return i?lb(i):r}class qd{get name(){return this.type.name}constructor(e,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Kt)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof Kt?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r<.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode<.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode<.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let o=0;o<this.index;o++)if(i.buffer.buffer[o+3]<this.index)return!1;({index:n,parent:r}=i)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let o=n+e,s=e<0?-1:r._tree.children.length;o!=s;o+=e){let a=r._tree.children[o];if(this.mode<.IncludeAnonymous||a instanceof vr||!a.type.isAnonymous||cf(a))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,r=0;if(e&&e.context==this.buffer)e:for(let i=this.index,o=this.stack.length;o>=0;){for(let s=e;s;s=s._parent)if(s.index==i){if(i==this.index)return s;n=s,r=o+1;break e}i=this.stack[--o]}for(let i=r;i<this.stack.length;i++)n=new cr(this.buffer,n,this.stack[i]);return this.bufferNode=new cr(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&n&&n(this),i=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,i=!0}}}matchContext(e){if(!this.buffer)return Wd(this.node.parent,e);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=e.length-1,o=this.stack.length-1;i>=0;o--){if(o<0)return Wd(this._tree,e,i);let s=r[n.buffer[this.stack[o]]];if(!s.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}}function cf(t){return t.children.some(e=>e instanceof vr||!e.type.isAnonymous||cf(e))}function xR(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=ob,reused:o=[],minRepeatType:s=r.types.length}=t,a=Array.isArray(n)?new lf(n,n.length):n,l=r.types,c=0,d=0;function h(S,R,A,I,E,j){let{id:O,start:D,end:B,size:V}=a,q=d,J=c;for(;V<0;)if(a.next(),V==-1){let pe=o[O];A.push(pe),I.push(D-S);return}else if(V==-3){c=O;return}else if(V==-4){d=O;return}else throw new RangeError(`Unrecognized record size: ${V}`);let W=l[O],K,F,Q=D-S;if(B-D<=i&&(F=v(a.pos-R,E))){let pe=new Uint16Array(F.size-F.skip),we=a.pos-F.size,ce=pe.length;for(;a.pos>we;)ce=x(F.start,pe,ce);K=new vr(pe,B-F.start,r),Q=F.start-S}else{let pe=a.pos-V;a.next();let we=[],ce=[],Ce=O>=s?O:-1,P=0,oe=B;for(;a.pos>pe;)Ce>=0&&a.id==Ce&&a.size>=0?(a.end<=oe-i&&(g(we,ce,D,P,a.end,oe,Ce,q,J),P=we.length,oe=a.end),a.next()):j>2500?f(D,pe,we,ce):h(D,pe,we,ce,Ce,j+1);if(Ce>=0&&P>0&&P<we.length&&g(we,ce,D,P,D,oe,Ce,q,J),we.reverse(),ce.reverse(),Ce>-1&&P>0){let _=m(W,J);K=df(W,we,ce,0,we.length,0,B-D,_,_)}else K=b(W,we,ce,B-D,q-B,J)}A.push(K),I.push(Q)}function f(S,R,A,I){let E=[],j=0,O=-1;for(;a.pos>R;){let{id:D,start:B,end:V,size:q}=a;if(q>4)a.next();else{if(O>-1&&B<O)break;O<0&&(O=V-i),E.push(D,B,V),j++,a.next()}}if(j){let D=new Uint16Array(j*4),B=E[E.length-2];for(let V=E.length-3,q=0;V>=0;V-=3)D[q++]=E[V],D[q++]=E[V+1]-B,D[q++]=E[V+2]-B,D[q++]=q;A.push(new vr(D,E[2]-B,r)),I.push(B-S)}}function m(S,R){return(A,I,E)=>{let j=0,O=A.length-1,D,B;if(O>=0&&(D=A[O])instanceof rt){if(!O&&D.type==S&&D.length==E)return D;(B=D.prop(Te.lookAhead))&&(j=I[O]+D.length+B)}return b(S,A,I,E,j,R)}}function g(S,R,A,I,E,j,O,D,B){let V=[],q=[];for(;S.length>I;)V.push(S.pop()),q.push(R.pop()+A-E);S.push(b(r.types[O],V,q,j-E,D-j,B)),R.push(E-A)}function b(S,R,A,I,E,j,O){if(j){let D=[Te.contextHash,j];O=O?[D].concat(O):[D]}if(E>25){let D=[Te.lookAhead,E];O=O?[D].concat(O):[D]}return new rt(S,R,A,I,O)}function v(S,R){let A=a.fork(),I=0,E=0,j=0,O=A.end-i,D={size:0,start:0,skip:0};e:for(let B=A.pos-S;A.pos>B;){let V=A.size;if(A.id==R&&V>=0){D.size=I,D.start=E,D.skip=j,j+=4,I+=4,A.next();continue}let q=A.pos-V;if(V<0||q<B||A.start<O)break;let J=A.id>=s?4:0,W=A.start;for(A.next();A.pos>q;){if(A.size<0)if(A.size==-3)J+=4;else break e;else A.id>=s&&(J+=4);A.next()}E=W,I+=V,j+=J}return(R<0||I==S)&&(D.size=I,D.start=E,D.skip=j),D.size>4?D:void 0}function x(S,R,A){let{id:I,start:E,end:j,size:O}=a;if(a.next(),O>=0&&I<s){let D=A;if(O>4){let B=a.pos-(O-4);for(;a.pos>B;)A=x(S,R,A)}R[--A]=D,R[--A]=j-S,R[--A]=E-S,R[--A]=I}else O==-3?c=I:O==-4&&(d=I);return A}let y=[],$=[];for(;a.pos>0;)h(t.start||0,t.bufferStart||0,y,$,-1,0);let k=(e=t.length)!==null&&e!==void 0?e:y.length?$[0]+y[0].length:0;return new rt(l[t.topID],y.reverse(),$.reverse(),k)}const P0=new WeakMap;function ya(t,e){if(!t.isAnonymous||e instanceof vr||e.type!=t)return 1;let n=P0.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof rt)){n=1;break}n+=ya(t,r)}P0.set(e,n)}return n}function df(t,e,n,r,i,o,s,a,l){let c=0;for(let g=r;g<i;g++)c+=ya(t,e[g]);let d=Math.ceil(c*1.5/8),h=[],f=[];function m(g,b,v,x,y){for(let $=v;$<x;){let k=$,S=b[$],R=ya(t,g[$]);for($++;$<x;$++){let A=ya(t,g[$]);if(R+A>=d)break;R+=A}if($==k+1){if(R>d){let A=g[k];m(A.children,A.positions,0,A.children.length,b[k]+y);continue}h.push(g[k])}else{let A=b[$-1]+g[$-1].length-S;h.push(df(t,g,b,k,$,S,A,null,l))}f.push(S+y-o)}}return m(e,n,r,i,0),(a||l)(h,f,s)}class _r{constructor(e,n,r,i,o=!1,s=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(o?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new _r(0,e.length,e,0,!1,r)];for(let o of n)o.to>e.length&&i.push(o);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],o=1,s=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let d=a<n.length?n[a]:null,h=d?d.fromA:1e9;if(h-l>=r)for(;s&&s.from<h;){let f=s;if(l>=f.from||h<=f.to||c){let m=Math.max(f.from,l)-c,g=Math.min(f.to,h)-c;f=m>=g?null:new _r(m,g,f.tree,f.offset+c,a>0,!!d)}if(f&&i.push(f),s.to>h)break;s=o<e.length?e[o++]:null}if(!d)break;l=d.toA,c=d.toA-d.toB}return i}}class cb{startParse(e,n,r){return typeof e=="string"&&(e=new wR(e)),r=r?r.length?r.map(i=>new Nc(i.from,i.to)):[new Nc(0,0)]:[new Nc(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let o=i.advance();if(o)return o}}}class wR{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}new Te({perNode:!0});class Ua{constructor(e,n,r,i,o,s,a,l,c,d=0,h){this.p=e,this.stack=n,this.state=r,this.reducePos=i,this.pos=o,this.score=s,this.buffer=a,this.bufferBase=l,this.curContext=c,this.lookAhead=d,this.parent=h}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let i=e.parser.context;return new Ua(e,[],n,r,r,0,[],0,i?new W0(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,i=e&65535,{parser:o}=this.p,s=this.reducePos<this.pos-25;s&&this.setLookAhead(this.pos);let a=o.dynamicPrecedence(i);if(a&&(this.score+=a),r==0){this.pushState(o.getGoto(this.state,i,!0),this.reducePos),i<o.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,s?8:4,!0),this.reduceContext(i,this.reducePos);return}let l=this.stack.length-(r-1)*3-(e&262144?6:0),c=l?this.stack[l-2]:this.p.ranges[0].from,d=this.reducePos-c;d>=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=d):this.p.lastBigReductionSize<d&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=c,this.p.lastBigReductionSize=d));let h=l?this.stack[l-1]:0,f=this.bufferBase+this.buffer.length-h;if(i<o.minRepeatTerm||e&131072){let m=o.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,c,m,f+4,!0)}if(e&262144)this.state=this.stack[l];else{let m=this.stack[l-3];this.state=o.getGoto(m,i,!0)}for(;this.stack.length>l;)this.stack.pop();this.reduceContext(i,c)}storeNode(e,n,r,i=4,o=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let s=this,a=this.buffer.length;if(a==0&&s.parent&&(a=s.bufferBase-s.parent.bufferBase,s=s.parent),a>0&&s.buffer[a-4]==0&&s.buffer[a-1]>-1){if(n==r)return;if(s.buffer[a-2]>=n){s.buffer[a-2]=r;return}}}if(!o||this.pos==r)this.buffer.push(e,n,r,i);else{let s=this.buffer.length;if(s>0&&this.buffer[s-4]!=0){let a=!1;for(let l=s;l>0&&this.buffer[l-2]>r;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;s>0&&this.buffer[s-2]>r;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,i>4&&(i-=4)}this.buffer[s]=e,this.buffer[s+1]=n,this.buffer[s+2]=r,this.buffer[s+3]=i}}shift(e,n,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4);else{let o=e,{parser:s}=this.p;(i>this.pos||n<=s.maxNode)&&(this.pos=i,s.stateFlag(o,1)||(this.reducePos=i)),this.pushState(o,r),this.shiftContext(n,r),n<=s.maxNode&&this.buffer.push(n,r,i,4)}}apply(e,n,r,i){e&65536?this.reduce(e):this.shift(e,n,r,i)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),i=e.bufferBase+n;for(;e&&i==e.bufferBase;)e=e.parent;return new Ua(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new yR(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if(!(r&65536))return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let o=0,s;o<n.length;o+=2)(s=n[o+1])!=this.state&&this.p.parser.hasAction(s,e)&&i.push(n[o],s);if(this.stack.length<120)for(let o=0;i.length<8&&o<n.length;o+=2){let s=n[o+1];i.some((a,l)=>l&1&&a==s)||i.push(n[o],s)}n=i}let r=[];for(let i=0;i<n.length&&r.length<4;i+=2){let o=n[i+1];if(o==this.state)continue;let s=this.split();s.pushState(o,this.pos),s.storeNode(0,s.pos,s.pos,4,!0),s.shiftContext(n[i],this.pos),s.reducePos=this.pos,s.score-=200,r.push(s)}return r}forceReduce(){let{parser:e}=this.p,n=e.stateSlot(this.state,5);if(!(n&65536))return!1;if(!e.validAction(this.state,n)){let r=n>>19,i=n&65535,o=this.stack.length-r*3;if(o<0||e.getGoto(this.stack[o],i,!1)<0){let s=this.findForcedReduction();if(s==null)return!1;n=s}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=(i,o)=>{if(!n.includes(i))return n.push(i),e.allActions(i,s=>{if(!(s&393216))if(s&65536){let a=(s>>19)-o;if(a>1){let l=s&65535,c=this.stack.length-a*3;if(c>=0&&e.getGoto(this.stack[c],l,!1)>=0)return a<<19|65536|l}}else{let a=r(s,o+1);if(a!=null)return a}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=e.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(n)))}reduceContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(n)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let n=new W0(this.curContext.tracker,e);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class W0{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class yR{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class Ka{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new Ka(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Ka(this.stack,this.pos,this.index)}}function Ks(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,i=0;r<t.length;){let o=0;for(;;){let s=t.charCodeAt(r++),a=!1;if(s==126){o=65535;break}s>=92&&s--,s>=34&&s--;let l=s-32;if(l>=46&&(l-=46,a=!0),o+=l,a)break;o*=46}n?n[i++]=o:n=new e(o)}return n}class Ca{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const q0=new Ca;class CR{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=q0,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,i=this.rangeIndex,o=this.pos+e;for(;o<r.from;){if(!i)return null;let s=this.ranges[--i];o-=r.from-s.to,r=s}for(;n<0?o>r.to:o>=r.to;){if(i==this.ranges.length-1)return null;let s=this.ranges[++i];o+=s.from-r.to,r=s}return o}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let n of this.ranges)if(n.to>e)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,i;if(n>=0&&n<this.chunk.length)r=this.pos+e,i=this.chunk.charCodeAt(n);else{let o=this.resolveOffset(e,1);if(o==null)return-1;if(r=o,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let s=this.rangeIndex,a=this.range;for(;a.to<=r;)a=this.ranges[++s];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>a.to&&(this.chunk2=this.chunk2.slice(0,a.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=r}acceptTokenTo(e,n){this.token.value=e,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),n=this.pos+e.length;this.chunk=n>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=q0,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,n){if(e>=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,n)))}return r}}class Ai{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;$R(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}Ai.prototype.contextual=Ai.prototype.fallback=Ai.prototype.extend=!1;Ai.prototype.fallback=Ai.prototype.extend=!1;function $R(t,e,n,r,i,o){let s=0,a=1<<r,{dialect:l}=n.p.parser;e:for(;a&t[s];){let c=t[s+1];for(let m=s+3;m<c;m+=2)if((t[m+1]&a)>0){let g=t[m];if(l.allows(g)&&(e.token.value==-1||e.token.value==g||SR(g,e.token.value,i,o))){e.acceptToken(g);break}}let d=e.next,h=0,f=t[s+2];if(e.next<0&&f>h&&t[c+f*3-3]==65535){s=t[c+f*3-1];continue e}for(;h<f;){let m=h+f>>1,g=c+m+(m<<1),b=t[g],v=t[g+1]||65536;if(d<b)f=m;else if(d>=v)h=m+1;else{s=t[g+2],e.advance();continue e}}break}}function U0(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}function SR(t,e,n,r){let i=U0(n,r,e);return i<0||U0(n,r,t)<i}const Ft=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG);let Bc=null;function K0(t,e,n){let r=t.cursor(lt.IncludeAnonymous);for(r.moveTo(e);;)if(!(n<0?r.childBefore(e):r.childAfter(e)))for(;;){if((n<0?r.to<e:r.from>e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}class kR{constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?K0(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?K0(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let r=this.trees[n],i=this.index[n];if(i==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let o=r.children[i],s=this.start[n]+r.positions[i];if(s>e)return this.nextStart=s,null;if(o instanceof rt){if(s==e){if(s<this.safeFrom)return null;let a=s+o.length;if(a<=this.safeTo){let l=o.prop(Te.lookAhead);if(!l||a+l<this.fragment.to)return o}}this.index[n]++,s+o.length>=Math.max(this.safeFrom,e)&&(this.trees.push(o),this.start.push(s),this.index.push(0))}else this.index[n]++,this.nextStart=s+o.length}}}class AR{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new Ca)}getActions(e){let n=0,r=null,{parser:i}=e.p,{tokenizers:o}=i,s=i.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let c=0;c<o.length;c++){if(!(1<<c&s))continue;let d=o[c],h=this.tokens[c];if(!(r&&!d.fallback)&&((d.contextual||h.start!=e.pos||h.mask!=s||h.context!=a)&&(this.updateCachedToken(h,d,e),h.mask=s,h.context=a),h.lookAhead>h.end+25&&(l=Math.max(h.lookAhead,l)),h.value!=0)){let f=n;if(h.extended>-1&&(n=this.addActions(e,h.extended,h.end,n)),n=this.addActions(e,h.value,h.end,n),!d.extend&&(r=h,n>f))break}}for(;this.actions.length>n;)this.actions.pop();return l&&e.setLookAhead(l),!r&&e.pos==this.stream.end&&(r=new Ca,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new Ca,{pos:r,p:i}=e;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(e,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,e),r),e.value>-1){let{parser:o}=r.p;for(let s=0;s<o.specialized.length;s++)if(o.specialized[s]==e.value){let a=o.specializers[s](this.stream.read(e.start,e.end),r);if(a>=0&&r.p.parser.dialect.allows(a>>1)){a&1?e.extended=a>>1:e.value=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,n,r,i){for(let o=0;o<i;o+=3)if(this.actions[o]==e)return i;return this.actions[i++]=e,this.actions[i++]=n,this.actions[i++]=r,i}addActions(e,n,r,i){let{state:o}=e,{parser:s}=e.p,{data:a}=s;for(let l=0;l<2;l++)for(let c=s.stateSlot(o,l?2:1);;c+=3){if(a[c]==65535)if(a[c+1]==1)c=Vn(a,c+2);else{i==0&&a[c+1]==2&&(i=this.putAction(Vn(a,c+2),n,r,i));break}a[c]==n&&(i=this.putAction(Vn(a,c+1),n,r,i))}return i}}class RR{constructor(e,n,r,i){this.parser=e,this.input=n,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new CR(n,i),this.tokens=new AR(e,this.stream),this.topTerm=e.top[1];let{from:o}=i[0];this.stacks=[Ua.start(this,e.top[0],o)],this.fragments=r.length&&this.stream.end-o>e.bufferLength*4?new kR(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],i,o;if(this.bigReductionCount>300&&e.length==1){let[s]=e;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;s<e.length;s++){let a=e[s];for(;;){if(this.tokens.mainToken=null,a.pos>n)r.push(a);else{if(this.advanceStack(a,r,e))continue;{i||(i=[],o=[]),i.push(a);let l=this.tokens.getMainToken(a);o.push(l.value,l.end)}}break}}if(!r.length){let s=i&&MR(i);if(s)return Ft&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw Ft&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let s=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,o,r);if(s)return Ft&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(r.length>s)for(r.sort((a,l)=>l.score-a.score);r.length>s;)r.pop();r.some(a=>a.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let s=0;s<r.length-1;s++){let a=r[s];for(let l=s+1;l<r.length;l++){let c=r[l];if(a.sameState(c)||a.buffer.length>500&&c.buffer.length>500)if((a.score-c.score||a.buffer.length-c.buffer.length)>0)r.splice(l--,1);else{r.splice(s--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let s=1;s<r.length;s++)r[s].pos<this.minStackPos&&(this.minStackPos=r[s].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,n,r){let i=e.pos,{parser:o}=this,s=Ft?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,d=c?e.curContext.hash:0;for(let h=this.fragments.nodeAt(i);h;){let f=this.parser.nodeSet.types[h.type.id]==h.type?o.getGoto(e.state,h.type.id):-1;if(f>-1&&h.length&&(!c||(h.prop(Te.contextHash)||0)==d))return e.useNode(h,f),Ft&&console.log(s+this.stackID(e)+` (via reuse of ${o.getName(h.type.id)})`),!0;if(!(h instanceof rt)||h.children.length==0||h.positions[0]>0)break;let m=h.children[0];if(m instanceof rt&&h.positions[0]==0)h=m;else break}}let a=o.stateSlot(e.state,4);if(a>0)return e.reduce(a),Ft&&console.log(s+this.stackID(e)+` (via always-reduce ${o.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let c=0;c<l.length;){let d=l[c++],h=l[c++],f=l[c++],m=c==l.length||!r,g=m?e:e.split(),b=this.tokens.mainToken;if(g.apply(d,h,b?b.start:g.pos,f),Ft&&console.log(s+this.stackID(g)+` (via ${d&65536?`reduce of ${o.getName(d&65535)}`:"shift"} for ${o.getName(h)} @ ${i}${g==e?"":", split"})`),m)return!0;g.pos>i?n.push(g):r.push(g)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return G0(e,n),!0}}runRecovery(e,n,r){let i=null,o=!1;for(let s=0;s<e.length;s++){let a=e[s],l=n[s<<1],c=n[(s<<1)+1],d=Ft?this.stackID(a)+" -> ":"";if(a.deadEnd&&(o||(o=!0,a.restart(),Ft&&console.log(d+this.stackID(a)+" (restarted)"),this.advanceFully(a,r))))continue;let h=a.split(),f=d;for(let m=0;h.forceReduce()&&m<10&&(Ft&&console.log(f+this.stackID(h)+" (via force-reduce)"),!this.advanceFully(h,r));m++)Ft&&(f=this.stackID(h)+" -> ");for(let m of a.recoverByInsert(l))Ft&&console.log(d+this.stackID(m)+" (via recover-insert)"),this.advanceFully(m,r);this.stream.end>a.pos?(c==a.pos&&(c++,l=0),a.recoverByDelete(l,c),Ft&&console.log(d+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),G0(a,r)):(!i||i.score<a.score)&&(i=a)}return i}stackToTree(e){return e.close(),rt.build({buffer:Ka.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let n=(Bc||(Bc=new WeakMap)).get(e);return n||Bc.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}}function G0(t,e){for(let n=0;n<e.length;n++){let r=e[n];if(r.pos==t.pos&&r.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}class TR{constructor(e,n,r){this.source=e,this.flags=n,this.disabled=r}allows(e){return!this.disabled||this.disabled[e]==0}}class Ga extends cb{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let a=0;a<e.repeatNodeCount;a++)n.push("");let r=Object.keys(e.topRules).map(a=>e.topRules[a][1]),i=[];for(let a=0;a<n.length;a++)i.push([]);function o(a,l,c){i[a].push([l,l.deserialize(String(c))])}if(e.nodeProps)for(let a of e.nodeProps){let l=a[0];typeof l=="string"&&(l=Te[l]);for(let c=1;c<a.length;){let d=a[c++];if(d>=0)o(d,l,a[c++]);else{let h=a[c+-d];for(let f=-d;f>0;f--)o(a[c++],l,h);c++}}}this.nodeSet=new af(n.map((a,l)=>Lt.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:i[l],top:r.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=ob;let s=Ks(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;a<this.specializerSpecs.length;a++)this.specialized[a]=this.specializerSpecs[a].term;this.specializers=this.specializerSpecs.map(Y0),this.states=Ks(e.states,Uint32Array),this.data=Ks(e.stateData),this.goto=Ks(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(a=>typeof a=="number"?new Ai(s,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let i=new RR(this,e,n,r);for(let o of this.wrappers)i=o(i,e,n,r);return i}getGoto(e,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let o=i[n+1];;){let s=i[o++],a=s&1,l=i[o++];if(a&&r)return l;for(let c=o+(s>>1);o<c;o++)if(i[o]==e)return l;if(a)return-1}}hasAction(e,n){let r=this.data;for(let i=0;i<2;i++)for(let o=this.stateSlot(e,i?2:1),s;;o+=3){if((s=r[o])==65535)if(r[o+1]==1)s=r[o=Vn(r,o+2)];else{if(r[o+1]==2)return Vn(r,o+2);break}if(s==n||s==0)return Vn(r,o+1)}return 0}stateSlot(e,n){return this.states[e*6+n]}stateFlag(e,n){return(this.stateSlot(e,0)&n)>0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),i=r?n(r):void 0;for(let o=this.stateSlot(e,1);i==null;o+=3){if(this.data[o]==65535)if(this.data[o+1]==1)o=Vn(this.data,o+2);else break;i=n(Vn(this.data,o+1))}return i}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=Vn(this.data,r+2);else break;if(!(this.data[r+2]&1)){let i=this.data[r+1];n.some((o,s)=>s&1&&o==i)||n.push(this.data[r],i)}}return n}configure(e){let n=Object.assign(Object.create(Ga.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(o=>o.from==r);return i?i.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let o=e.specializers.find(a=>a.from==r.external);if(!o)return r;let s=Object.assign(Object.assign({},r),{external:o.to});return n.specializers[i]=Y0(s),s})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let o of e.split(" ")){let s=n.indexOf(o);s>=0&&(r[s]=!0)}let i=null;for(let o=0;o<n.length;o++)if(!r[o])for(let s=this.dialects[n[o]],a;(a=this.data[s++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[a]=1;return new TR(e,r,i)}static deserialize(e){return new Ga(e)}}function Vn(t,e){return t[e]|t[e+1]<<16}function MR(t){let e=null;for(let n of t){let r=n.p.stoppedAt;(n.pos==n.p.stream.end||r!=null&&n.pos>r)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}function Y0(t){if(t.external){let e=t.extend?1:0;return(n,r)=>t.external(n,r)<<1|e}return t.get}let ER=0,_n=class Ud{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=ER++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof Ud&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let i=new Ud(r,[],null,[]);if(i.set.push(i),n)for(let o of n.set)i.set.push(o);return i}static defineModifier(e){let n=new Ya(e);return r=>r.modified.indexOf(n)>-1?r:Ya.get(r.base||r,r.modified.concat(n).sort((i,o)=>i.id-o.id))}},IR=0;class Ya{constructor(e){this.name=e,this.instances=[],this.id=IR++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(a=>a.base==e&&jR(n,a.modified));if(r)return r;let i=[],o=new _n(e.name,i,e,n);for(let a of n)a.instances.push(o);let s=DR(n);for(let a of e.set)if(!a.modified.length)for(let l of s)i.push(Ya.get(a,l));return o}}function jR(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function DR(t){let e=[[]];for(let n=0;n<t.length;n++)for(let r=0,i=e.length;r<i;r++)e.push(e[r].concat(t[n]));return e.sort((n,r)=>r.length-n.length)}function db(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let o=[],s=2,a=i;for(let h=0;;){if(a=="..."&&h>0&&h+3==i.length){s=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!f)throw new RangeError("Invalid path: "+i);if(o.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),h+=f[0].length,h==i.length)break;let m=i[h++];if(h==i.length&&m=="!"){s=0;break}if(m!="/")throw new RangeError("Invalid path: "+i);a=i.slice(h)}let l=o.length-1,c=o[l];if(!c)throw new RangeError("Invalid path: "+i);let d=new Xa(r,s,l>0?o.slice(0,l):null);e[c]=d.sort(e[c])}}return ub.add(e)}const ub=new Te;class Xa{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}Xa.empty=new Xa([],2,null);function hb(t,e){let n=Object.create(null);for(let o of t)if(!Array.isArray(o.tag))n[o.tag.id]=o.class;else for(let s of o.tag)n[s.id]=o.class;let{scope:r,all:i=null}=e||{};return{style:o=>{let s=i;for(let a of o)for(let l of a.set){let c=n[l.id];if(c){s=s?s+" "+c:c;break}}return s},scope:r}}function OR(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function LR(t,e,n,r=0,i=t.length){let o=new NR(r,Array.isArray(e)?e:[e],n);o.highlightRange(t.cursor(),r,i,"",o.highlighters),o.flush(i)}class NR{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,i,o){let{type:s,from:a,to:l}=e;if(a>=r||l<=n)return;s.isTop&&(o=this.highlighters.filter(m=>!m.scope||m.scope(s)));let c=i,d=BR(e)||Xa.empty,h=OR(o,d.tags);if(h&&(c&&(c+=" "),c+=h,d.mode==1&&(i+=(i?" ":"")+h)),this.startSpan(Math.max(n,a),c),d.opaque)return;let f=e.tree&&e.tree.prop(Te.mounted);if(f&&f.overlay){let m=e.node.enter(f.overlay[0].from+a,1),g=this.highlighters.filter(v=>!v.scope||v.scope(f.tree.type)),b=e.firstChild();for(let v=0,x=a;;v++){let y=v<f.overlay.length?f.overlay[v]:null,$=y?y.from+a:l,k=Math.max(n,x),S=Math.min(r,$);if(k<S&&b)for(;e.from<S&&(this.highlightRange(e,k,S,i,o),this.startSpan(Math.min(S,e.to),c),!(e.to>=$||!e.nextSibling())););if(!y||$>r)break;x=y.to+a,x>n&&(this.highlightRange(m.cursor(),Math.max(n,y.from+a),Math.min(r,x),"",g),this.startSpan(Math.min(r,x),c))}b&&e.parent()}else if(e.firstChild()){f&&(i="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,i,o),this.startSpan(Math.min(r,e.to),c)}while(e.nextSibling());e.parent()}}}function BR(t){let e=t.type.prop(ub);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const te=_n.define,Gs=te(),sr=te(),X0=te(sr),Q0=te(sr),ar=te(),Ys=te(ar),Fc=te(ar),bn=te(),Ir=te(bn),mn=te(),pn=te(),Kd=te(),fo=te(Kd),Xs=te(),L={comment:Gs,lineComment:te(Gs),blockComment:te(Gs),docComment:te(Gs),name:sr,variableName:te(sr),typeName:X0,tagName:te(X0),propertyName:Q0,attributeName:te(Q0),className:te(sr),labelName:te(sr),namespace:te(sr),macroName:te(sr),literal:ar,string:Ys,docString:te(Ys),character:te(Ys),attributeValue:te(Ys),number:Fc,integer:te(Fc),float:te(Fc),bool:te(ar),regexp:te(ar),escape:te(ar),color:te(ar),url:te(ar),keyword:mn,self:te(mn),null:te(mn),atom:te(mn),unit:te(mn),modifier:te(mn),operatorKeyword:te(mn),controlKeyword:te(mn),definitionKeyword:te(mn),moduleKeyword:te(mn),operator:pn,derefOperator:te(pn),arithmeticOperator:te(pn),logicOperator:te(pn),bitwiseOperator:te(pn),compareOperator:te(pn),updateOperator:te(pn),definitionOperator:te(pn),typeOperator:te(pn),controlOperator:te(pn),punctuation:Kd,separator:te(Kd),bracket:fo,angleBracket:te(fo),squareBracket:te(fo),paren:te(fo),brace:te(fo),content:bn,heading:Ir,heading1:te(Ir),heading2:te(Ir),heading3:te(Ir),heading4:te(Ir),heading5:te(Ir),heading6:te(Ir),contentSeparator:te(bn),list:te(bn),quote:te(bn),emphasis:te(bn),strong:te(bn),link:te(bn),monospace:te(bn),strikethrough:te(bn),inserted:te(),deleted:te(),changed:te(),invalid:te(),meta:Xs,documentMeta:te(Xs),annotation:te(Xs),processingInstruction:te(Xs),definition:_n.defineModifier("definition"),constant:_n.defineModifier("constant"),function:_n.defineModifier("function"),standard:_n.defineModifier("standard"),local:_n.defineModifier("local"),special:_n.defineModifier("special")};for(let t in L){let e=L[t];e instanceof _n&&(e.name=t)}hb([{tag:L.link,class:"tok-link"},{tag:L.heading,class:"tok-heading"},{tag:L.emphasis,class:"tok-emphasis"},{tag:L.strong,class:"tok-strong"},{tag:L.keyword,class:"tok-keyword"},{tag:L.atom,class:"tok-atom"},{tag:L.bool,class:"tok-bool"},{tag:L.url,class:"tok-url"},{tag:L.labelName,class:"tok-labelName"},{tag:L.inserted,class:"tok-inserted"},{tag:L.deleted,class:"tok-deleted"},{tag:L.literal,class:"tok-literal"},{tag:L.string,class:"tok-string"},{tag:L.number,class:"tok-number"},{tag:[L.regexp,L.escape,L.special(L.string)],class:"tok-string2"},{tag:L.variableName,class:"tok-variableName"},{tag:L.local(L.variableName),class:"tok-variableName tok-local"},{tag:L.definition(L.variableName),class:"tok-variableName tok-definition"},{tag:L.special(L.variableName),class:"tok-variableName2"},{tag:L.definition(L.propertyName),class:"tok-propertyName tok-definition"},{tag:L.typeName,class:"tok-typeName"},{tag:L.namespace,class:"tok-namespace"},{tag:L.className,class:"tok-className"},{tag:L.macroName,class:"tok-macroName"},{tag:L.propertyName,class:"tok-propertyName"},{tag:L.operator,class:"tok-operator"},{tag:L.comment,class:"tok-comment"},{tag:L.meta,class:"tok-meta"},{tag:L.invalid,class:"tok-invalid"},{tag:L.punctuation,class:"tok-punctuation"}]);const FR=db({String:L.string,Number:L.number,"True False":L.bool,PropertyName:L.propertyName,Null:L.null,", :":L.separator,"[ ]":L.squareBracket,"{ }":L.brace}),VR=Ga.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[FR],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0});let Gd=[],fb=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?fb:Gd).push(n=n+t[e])})();function _R(t){if(t<768)return!1;for(let e=0,n=Gd.length;;){let r=e+n>>1;if(t<Gd[r])n=r;else if(t>=fb[r])e=r+1;else return!0;if(e==n)return!1}}function Z0(t){return t>=127462&&t<=127487}const J0=8205;function zR(t,e,n=!0,r=!0){return(n?mb:HR)(t,e,r)}function mb(t,e,n){if(e==t.length)return e;e&&pb(t.charCodeAt(e))&&gb(t.charCodeAt(e-1))&&e--;let r=Vc(t,e);for(e+=e1(r);e<t.length;){let i=Vc(t,e);if(r==J0||i==J0||n&&_R(i))e+=e1(i),r=i;else if(Z0(i)){let o=0,s=e-2;for(;s>=0&&Z0(Vc(t,s));)o++,s-=2;if(o%2==0)break;e+=2}else break}return e}function HR(t,e,n){for(;e>0;){let r=mb(t,e-2,n);if(r<e)return r;e--}return 0}function Vc(t,e){let n=t.charCodeAt(e);if(!gb(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return pb(r)?(n-55296<<10)+(r-56320)+65536:n}function pb(t){return t>=56320&&t<57344}function gb(t){return t>=55296&&t<56320}function e1(t){return t<65536?1:2}class Oe{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=zi(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),vn.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=zi(this,e,n);let r=[];return this.decompose(e,n,r,0),vn.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new jo(this),o=new jo(e);for(let s=n,a=n;;){if(i.next(s),o.next(s),s=0,i.lineBreak!=o.lineBreak||i.done!=o.done||i.value!=o.value)return!1;if(a+=i.value.length,i.done||a>=r)return!0}}iter(e=1){return new jo(this,e)}iterRange(e,n=this.length){return new bb(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new vb(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Oe.empty:e.length<=32?new Qe(e):vn.from(Qe.split(e,[]))}}class Qe extends Oe{constructor(e,n=PR(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let o=0;;o++){let s=this.text[o],a=i+s.length;if((n?r:a)>=e)return new WR(i,a,r,s);i=a+1,r++}}decompose(e,n,r,i){let o=e<=0&&n>=this.length?this:new Qe(t1(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let s=r.pop(),a=$a(o.text,s.text.slice(),0,o.length);if(a.length<=32)r.push(new Qe(a,s.length+o.length));else{let l=a.length>>1;r.push(new Qe(a.slice(0,l)),new Qe(a.slice(l)))}}else r.push(o)}replace(e,n,r){if(!(r instanceof Qe))return super.replace(e,n,r);[e,n]=zi(this,e,n);let i=$a(this.text,$a(r.text,t1(this.text,0,e)),n),o=this.length+r.length-(n-e);return i.length<=32?new Qe(i,o):vn.from(Qe.split(i,[]),o)}sliceString(e,n=this.length,r=`
|
|
54
|
+
`){[e,n]=zi(this,e,n);let i="";for(let o=0,s=0;o<=n&&s<this.text.length;s++){let a=this.text[s],l=o+a.length;o>e&&s&&(i+=r),e<l&&n>o&&(i+=a.slice(Math.max(0,e-o),n-o)),o=l+1}return i}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],i=-1;for(let o of e)r.push(o),i+=o.length+1,r.length==32&&(n.push(new Qe(r,i)),r=[],i=-1);return i>-1&&n.push(new Qe(r,i)),n}}class vn extends Oe{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,i){for(let o=0;;o++){let s=this.children[o],a=i+s.length,l=r+s.lines-1;if((n?l:a)>=e)return s.lineInner(e,n,r,i);i=a+1,r=l+1}}decompose(e,n,r,i){for(let o=0,s=0;s<=n&&o<this.children.length;o++){let a=this.children[o],l=s+a.length;if(e<=l&&n>=s){let c=i&((s<=e?1:0)|(l>=n?2:0));s>=e&&l<=n&&!c?r.push(a):a.decompose(e-s,n-s,r,c)}s=l+1}}replace(e,n,r){if([e,n]=zi(this,e,n),r.lines<this.lines)for(let i=0,o=0;i<this.children.length;i++){let s=this.children[i],a=o+s.length;if(e>=o&&n<=a){let l=s.replace(e-o,n-o,r),c=this.lines-s.lines+l.lines;if(l.lines<c>>4&&l.lines>c>>6){let d=this.children.slice();return d[i]=l,new vn(d,this.length-(n-e)+r.length)}return super.replace(o,a,l)}o=a+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=`
|
|
55
|
+
`){[e,n]=zi(this,e,n);let i="";for(let o=0,s=0;o<this.children.length&&s<=n;o++){let a=this.children[o],l=s+a.length;s>e&&o&&(i+=r),e<l&&n>s&&(i+=a.sliceString(e-s,n-s,r)),s=l+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof vn))return 0;let r=0,[i,o,s,a]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,o+=n){if(i==s||o==a)return r;let l=this.children[i],c=e.children[o];if(l!=c)return r+l.scanIdentical(c,n);r+=l.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let m of e)r+=m.lines;if(r<32){let m=[];for(let g of e)g.flatten(m);return new Qe(m,n)}let i=Math.max(32,r>>5),o=i<<1,s=i>>1,a=[],l=0,c=-1,d=[];function h(m){let g;if(m.lines>o&&m instanceof vn)for(let b of m.children)h(b);else m.lines>s&&(l>s||!l)?(f(),a.push(m)):m instanceof Qe&&l&&(g=d[d.length-1])instanceof Qe&&m.lines+g.lines<=32?(l+=m.lines,c+=m.length+1,d[d.length-1]=new Qe(g.text.concat(m.text),g.length+1+m.length)):(l+m.lines>i&&f(),l+=m.lines,c+=m.length+1,d.push(m))}function f(){l!=0&&(a.push(d.length==1?d[0]:vn.from(d,c)),c=-1,l=d.length=0)}for(let m of e)h(m);return f(),a.length==1?a[0]:new vn(a,n)}}Oe.empty=new Qe([""],0);function PR(t){let e=-1;for(let n of t)e+=n.length+1;return e}function $a(t,e,n=0,r=1e9){for(let i=0,o=0,s=!0;o<t.length&&i<=r;o++){let a=t[o],l=i+a.length;l>=n&&(l>r&&(a=a.slice(0,r-i)),i<n&&(a=a.slice(n-i)),s?(e[e.length-1]+=a,s=!1):e.push(a)),i=l+1}return e}function t1(t,e,n){return $a(t,[""],e,n)}class jo{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof Qe?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],o=this.offsets[r],s=o>>1,a=i instanceof Qe?i.text.length:i.children.length;if(s==(n>0?a:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((o&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=`
|
|
56
|
+
`,this;e--}else if(i instanceof Qe){let l=i.text[s+(n<0?-1:0)];if(this.offsets[r]+=n,l.length>Math.max(0,e))return this.value=e==0?l:n>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=i.children[s+(n<0?-1:0)];e>l.length?(e-=l.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(n>0?1:(l instanceof Qe?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class bb{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new jo(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class vb{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Oe.prototype[Symbol.iterator]=function(){return this.iter()},jo.prototype[Symbol.iterator]=bb.prototype[Symbol.iterator]=vb.prototype[Symbol.iterator]=function(){return this});class WR{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}}function zi(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function pt(t,e,n=!0,r=!0){return zR(t,e,n,r)}function qR(t){return t>=56320&&t<57344}function UR(t){return t>=55296&&t<56320}function Et(t,e){let n=t.charCodeAt(e);if(!UR(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return qR(r)?(n-55296<<10)+(r-56320)+65536:n}function uf(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function xn(t){return t<65536?1:2}const Yd=/\r\n?|\n/;var kt=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(kt||(kt={}));class kn{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];e+=r<0?this.sections[n]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,r=0,i=0;n<this.sections.length;){let o=this.sections[n++],s=this.sections[n++];s<0?(e(r,i,o),i+=o):i+=s,r+=o}}iterChangedRanges(e,n=!1){Xd(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];i<0?e.push(r,i):e.push(i,r)}return new kn(e)}composeDesc(e){return this.empty?e:e.empty?this:xb(this,e)}mapDesc(e,n=!1){return e.empty?this:Qd(this,e,n)}mapPos(e,n=-1,r=kt.Simple){let i=0,o=0;for(let s=0;s<this.sections.length;){let a=this.sections[s++],l=this.sections[s++],c=i+a;if(l<0){if(c>e)return o+(e-i);o+=a}else{if(r!=kt.Simple&&c>=e&&(r==kt.TrackDel&&i<e&&c>e||r==kt.TrackBefore&&i<e||r==kt.TrackAfter&&c>e))return null;if(c>e||c==e&&n<0&&!a)return e==i||n<0?o:o+l;o+=l}i=c}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return o}touchesRange(e,n=e){for(let r=0,i=0;r<this.sections.length&&i<=n;){let o=this.sections[r++],s=this.sections[r++],a=i+o;if(s>=0&&i<=n&&a>=e)return i<e&&a>n?"cover":!0;i=a}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];e+=(e?" ":"")+r+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new kn(e)}static create(e){return new kn(e)}}class ot extends kn{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Xd(this,(n,r,i,o,s)=>e=e.replace(i,i+(r-n),s),!1),e}mapDesc(e,n=!1){return Qd(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,o=0;i<n.length;i+=2){let s=n[i],a=n[i+1];if(a>=0){n[i]=a,n[i+1]=s;let l=i>>1;for(;r.length<l;)r.push(Oe.empty);r.push(s?e.slice(o,o+s):Oe.empty)}o+=s}return new ot(n,r)}compose(e){return this.empty?e:e.empty?this:xb(this,e,!0)}map(e,n=!1){return e.empty?this:Qd(this,e,n,!0)}iterChanges(e,n=!1){Xd(this,e,n)}get desc(){return kn.create(this.sections)}filter(e){let n=[],r=[],i=[],o=new Uo(this);e:for(let s=0,a=0;;){let l=s==e.length?1e9:e[s++];for(;a<l||a==l&&o.len==0;){if(o.done)break e;let d=Math.min(o.len,l-a);wt(i,d,-1);let h=o.ins==-1?-1:o.off==0?o.ins:0;wt(n,d,h),h>0&&dr(r,n,o.text),o.forward(d),a+=d}let c=e[s++];for(;a<c;){if(o.done)break e;let d=Math.min(o.len,c-a);wt(n,d,-1),wt(i,d,o.ins==-1?-1:o.off==0?o.ins:0),o.forward(d),a+=d}}return{changes:new ot(n,r),filtered:kn.create(i)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],i=this.sections[n+1];i<0?e.push(r):i==0?e.push([r]):e.push([r].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,r){let i=[],o=[],s=0,a=null;function l(d=!1){if(!d&&!i.length)return;s<n&&wt(i,n-s,-1);let h=new ot(i,o);a=a?a.compose(h.map(a)):h,i=[],o=[],s=0}function c(d){if(Array.isArray(d))for(let h of d)c(h);else if(d instanceof ot){if(d.length!=n)throw new RangeError(`Mismatched change set length (got ${d.length}, expected ${n})`);l(),a=a?a.compose(d.map(a)):d}else{let{from:h,to:f=h,insert:m}=d;if(h>f||h<0||f>n)throw new RangeError(`Invalid change range ${h} to ${f} (in doc of length ${n})`);let g=m?typeof m=="string"?Oe.of(m.split(r||Yd)):m:Oe.empty,b=g.length;if(h==f&&b==0)return;h<s&&l(),h>s&&wt(i,h-s,-1),wt(i,f-h,b),dr(o,i,g),s=f}}return c(e),l(!a),a}static empty(e){return new ot(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;i<e.length;i++){let o=e[i];if(typeof o=="number")n.push(o,-1);else{if(!Array.isArray(o)||typeof o[0]!="number"||o.some((s,a)=>a&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(o.length==1)n.push(o[0],0);else{for(;r.length<i;)r.push(Oe.empty);r[i]=Oe.of(o.slice(1)),n.push(o[0],r[i].length)}}}return new ot(n,r)}static createSet(e,n){return new ot(e,n)}}function wt(t,e,n,r=!1){if(e==0&&n<=0)return;let i=t.length-2;i>=0&&n<=0&&n==t[i+1]?t[i]+=e:i>=0&&e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}function dr(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<r;)t.push(Oe.empty);t.push(n)}}function Xd(t,e,n){let r=t.inserted;for(let i=0,o=0,s=0;s<t.sections.length;){let a=t.sections[s++],l=t.sections[s++];if(l<0)i+=a,o+=a;else{let c=i,d=o,h=Oe.empty;for(;c+=a,d+=l,l&&r&&(h=h.append(r[s-2>>1])),!(n||s==t.sections.length||t.sections[s+1]<0);)a=t.sections[s++],l=t.sections[s++];e(i,c,o,d,h),i=c,o=d}}}function Qd(t,e,n,r=!1){let i=[],o=r?[]:null,s=new Uo(t),a=new Uo(e);for(let l=-1;;){if(s.done&&a.len||a.done&&s.len)throw new Error("Mismatched change set lengths");if(s.ins==-1&&a.ins==-1){let c=Math.min(s.len,a.len);wt(i,c,-1),s.forward(c),a.forward(c)}else if(a.ins>=0&&(s.ins<0||l==s.i||s.off==0&&(a.len<s.len||a.len==s.len&&!n))){let c=a.len;for(wt(i,a.ins,-1);c;){let d=Math.min(s.len,c);s.ins>=0&&l<s.i&&s.len<=d&&(wt(i,0,s.ins),o&&dr(o,i,s.text),l=s.i),s.forward(d),c-=d}a.next()}else if(s.ins>=0){let c=0,d=s.len;for(;d;)if(a.ins==-1){let h=Math.min(d,a.len);c+=h,d-=h,a.forward(h)}else if(a.ins==0&&a.len<d)d-=a.len,a.next();else break;wt(i,c,l<s.i?s.ins:0),o&&l<s.i&&dr(o,i,s.text),l=s.i,s.forward(s.len-d)}else{if(s.done&&a.done)return o?ot.createSet(i,o):kn.create(i);throw new Error("Mismatched change set lengths")}}}function xb(t,e,n=!1){let r=[],i=n?[]:null,o=new Uo(t),s=new Uo(e);for(let a=!1;;){if(o.done&&s.done)return i?ot.createSet(r,i):kn.create(r);if(o.ins==0)wt(r,o.len,0,a),o.next();else if(s.len==0&&!s.done)wt(r,0,s.ins,a),i&&dr(i,r,s.text),s.next();else{if(o.done||s.done)throw new Error("Mismatched change set lengths");{let l=Math.min(o.len2,s.len),c=r.length;if(o.ins==-1){let d=s.ins==-1?-1:s.off?0:s.ins;wt(r,l,d,a),i&&d&&dr(i,r,s.text)}else s.ins==-1?(wt(r,o.off?0:o.len,l,a),i&&dr(i,r,o.textBit(l))):(wt(r,o.off?0:o.len,s.off?0:s.ins,a),i&&!s.off&&dr(i,r,s.text));a=(o.ins>l||s.ins>=0&&s.len>l)&&(a||r.length>c),o.forward2(l),s.forward(l)}}}}class Uo{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?Oe.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?Oe.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Lr{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new Lr(r,i,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return H.range(e,n);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return H.range(this.anchor,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return H.range(e.anchor,e.head)}static create(e,n,r){return new Lr(e,n,r)}}class H{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:H.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new H([this.main],0)}addRange(e,n=!0){return H.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let r=this.ranges.slice();return r[n]=e,H.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new H(e.ranges.map(n=>Lr.fromJSON(n)),e.main)}static single(e,n=e){return new H([H.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;i<e.length;i++){let o=e[i];if(o.empty?o.from<=r:o.from<r)return H.normalized(e.slice(),n);r=o.to}return new H(e,n)}static cursor(e,n=0,r,i){return Lr.create(e,e,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r))|(i??16777215)<<6)}static range(e,n,r,i){let o=(r??16777215)<<6|(i==null?7:Math.min(6,i));return n<e?Lr.create(n,e,48|o):Lr.create(e,n,(n>e?8:0)|o)}static normalized(e,n=0){let r=e[n];e.sort((i,o)=>i.from-o.from),n=e.indexOf(r);for(let i=1;i<e.length;i++){let o=e[i],s=e[i-1];if(o.empty?o.from<=s.to:o.from<s.to){let a=s.from,l=Math.max(o.to,s.to);i<=n&&n--,e.splice(--i,2,o.anchor>o.head?H.range(l,a):H.range(a,l))}}return new H(e,n)}}function wb(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let hf=0;class he{constructor(e,n,r,i,o){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=hf++,this.default=e([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(e={}){return new he(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:ff),!!e.static,e.enables)}of(e){return new Sa([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Sa(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Sa(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function ff(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class Sa{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=hf++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,o=this.id,s=e[o]>>1,a=this.type==2,l=!1,c=!1,d=[];for(let h of this.dependencies)h=="doc"?l=!0:h=="selection"?c=!0:((n=e[h.id])!==null&&n!==void 0?n:1)&1||d.push(e[h.id]);return{create(h){return h.values[s]=r(h),1},update(h,f){if(l&&f.docChanged||c&&(f.docChanged||f.selection)||Zd(h,d)){let m=r(h);if(a?!n1(m,h.values[s],i):!i(m,h.values[s]))return h.values[s]=m,1}return 0},reconfigure:(h,f)=>{let m,g=f.config.address[o];if(g!=null){let b=Za(f,g);if(this.dependencies.every(v=>v instanceof he?f.facet(v)===h.facet(v):v instanceof ut?f.field(v,!1)==h.field(v,!1):!0)||(a?n1(m=r(h),b,i):i(m=r(h),b)))return h.values[s]=b,0}else m=r(h);return h.values[s]=m,1}}}}function n1(t,e,n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!n(t[r],e[r]))return!1;return!0}function Zd(t,e){let n=!1;for(let r of e)Do(t,r)&1&&(n=!0);return n}function KR(t,e,n){let r=n.map(l=>t[l.id]),i=n.map(l=>l.type),o=r.filter(l=>!(l&1)),s=t[e.id]>>1;function a(l){let c=[];for(let d=0;d<r.length;d++){let h=Za(l,r[d]);if(i[d]==2)for(let f of h)c.push(f);else c.push(h)}return e.combine(c)}return{create(l){for(let c of r)Do(l,c);return l.values[s]=a(l),1},update(l,c){if(!Zd(l,o))return 0;let d=a(l);return e.compare(d,l.values[s])?0:(l.values[s]=d,1)},reconfigure(l,c){let d=Zd(l,r),h=c.config.facets[e.id],f=c.facet(e);if(h&&!d&&ff(n,h))return l.values[s]=f,0;let m=a(l);return e.compare(m,f)?(l.values[s]=f,0):(l.values[s]=m,1)}}}const Qs=he.define({static:!0});class ut{constructor(e,n,r,i,o){this.id=e,this.createF=n,this.updateF=r,this.compareF=i,this.spec=o,this.provides=void 0}static define(e){let n=new ut(hf++,e.create,e.update,e.compare||((r,i)=>r===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(Qs).find(r=>r.field==this);return(n?.create||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let o=r.values[n],s=this.updateF(o,i);return this.compareF(o,s)?0:(r.values[n]=s,1)},reconfigure:(r,i)=>{let o=r.facet(Qs),s=i.facet(Qs),a;return(a=o.find(l=>l.field==this))&&a!=s.find(l=>l.field==this)?(r.values[n]=a.create(r),1):i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,Qs.of({field:this,create:e})]}get extension(){return this}}const Dr={lowest:4,low:3,default:2,high:1,highest:0};function mo(t){return e=>new yb(e,t)}const si={highest:mo(Dr.highest),high:mo(Dr.high),default:mo(Dr.default),low:mo(Dr.low),lowest:mo(Dr.lowest)};class yb{constructor(e,n){this.inner=e,this.prec=n}}class Xl{of(e){return new Jd(this,e)}reconfigure(e){return Xl.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Jd{constructor(e,n){this.compartment=e,this.inner=n}}class Qa{constructor(e,n,r,i,o,s){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.facets=s,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,r){let i=[],o=Object.create(null),s=new Map;for(let f of GR(e,n,s))f instanceof ut?i.push(f):(o[f.facet.id]||(o[f.facet.id]=[])).push(f);let a=Object.create(null),l=[],c=[];for(let f of i)a[f.id]=c.length<<1,c.push(m=>f.slot(m));let d=r?.config.facets;for(let f in o){let m=o[f],g=m[0].facet,b=d&&d[f]||[];if(m.every(v=>v.type==0))if(a[g.id]=l.length<<1|1,ff(b,m))l.push(r.facet(g));else{let v=g.combine(m.map(x=>x.value));l.push(r&&g.compare(v,r.facet(g))?r.facet(g):v)}else{for(let v of m)v.type==0?(a[v.id]=l.length<<1|1,l.push(v.value)):(a[v.id]=c.length<<1,c.push(x=>v.dynamicSlot(x)));a[g.id]=c.length<<1,c.push(v=>KR(v,g,m))}}let h=c.map(f=>f(a));return new Qa(e,s,h,a,l,o)}}function GR(t,e,n){let r=[[],[],[],[],[]],i=new Map;function o(s,a){let l=i.get(s);if(l!=null){if(l<=a)return;let c=r[l].indexOf(s);c>-1&&r[l].splice(c,1),s instanceof Jd&&n.delete(s.compartment)}if(i.set(s,a),Array.isArray(s))for(let c of s)o(c,a);else if(s instanceof Jd){if(n.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(s.compartment)||s.inner;n.set(s.compartment,c),o(c,a)}else if(s instanceof yb)o(s.inner,s.prec);else if(s instanceof ut)r[a].push(s),s.provides&&o(s.provides,a);else if(s instanceof Sa)r[a].push(s),s.facet.extensions&&o(s.facet.extensions,Dr.default);else{let c=s.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(c,a)}}return o(t,Dr.default),r.reduce((s,a)=>s.concat(a))}function Do(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}function Za(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const Cb=he.define(),eu=he.define({combine:t=>t.some(e=>e),static:!0}),$b=he.define({combine:t=>t.length?t[0]:void 0,static:!0}),Sb=he.define(),kb=he.define(),Ab=he.define(),Rb=he.define({combine:t=>t.length?t[0]:!1});class On{constructor(e,n){this.type=e,this.value=n}static define(){return new YR}}class YR{of(e){return new On(this,e)}}class XR{constructor(e){this.map=e}of(e){return new Ae(this,e)}}class Ae{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new Ae(this.type,n)}is(e){return this.type==e}static define(e={}){return new XR(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let o=i.map(n);o&&r.push(o)}return r}}Ae.reconfigure=Ae.define();Ae.appendConfig=Ae.define();class st{constructor(e,n,r,i,o,s){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=s,this._doc=null,this._state=null,r&&wb(r,n.newLength),o.some(a=>a.type==st.time)||(this.annotations=o.concat(st.time.of(Date.now())))}static create(e,n,r,i,o,s){return new st(e,n,r,i,o,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(st.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}st.time=On.define();st.userEvent=On.define();st.addToHistory=On.define();st.remote=On.define();function QR(t,e){let n=[];for(let r=0,i=0;;){let o,s;if(r<t.length&&(i==e.length||e[i]>=t[r]))o=t[r++],s=t[r++];else if(i<e.length)o=e[i++],s=e[i++];else return n;!n.length||n[n.length-1]<o?n.push(o,s):n[n.length-1]<s&&(n[n.length-1]=s)}}function Tb(t,e,n){var r;let i,o,s;return n?(i=e.changes,o=ot.empty(e.changes.length),s=t.changes.compose(e.changes)):(i=e.changes.map(t.changes),o=t.changes.mapDesc(e.changes,!0),s=t.changes.compose(i)),{changes:s,selection:e.selection?e.selection.map(o):(r=t.selection)===null||r===void 0?void 0:r.map(i),effects:Ae.mapEffects(t.effects,i).concat(Ae.mapEffects(e.effects,o)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function tu(t,e,n){let r=e.selection,i=Ri(e.annotations);return e.userEvent&&(i=i.concat(st.userEvent.of(e.userEvent))),{changes:e.changes instanceof ot?e.changes:ot.of(e.changes||[],n,t.facet($b)),selection:r&&(r instanceof H?r:H.single(r.anchor,r.head)),effects:Ri(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function Mb(t,e,n){let r=tu(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let o=1;o<e.length;o++){e[o].filter===!1&&(n=!1);let s=!!e[o].sequential;r=Tb(r,tu(t,e[o],s?r.changes.newLength:t.doc.length),s)}let i=st.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return JR(n?ZR(i):i)}function ZR(t){let e=t.startState,n=!0;for(let i of e.facet(Sb)){let o=i(t);if(o===!1){n=!1;break}Array.isArray(o)&&(n=n===!0?o:QR(n,o))}if(n!==!0){let i,o;if(n===!1)o=t.changes.invertedDesc,i=ot.empty(e.doc.length);else{let s=t.changes.filter(n);i=s.changes,o=s.filtered.mapDesc(s.changes).invertedDesc}t=st.create(e,i,t.selection&&t.selection.map(o),Ae.mapEffects(t.effects,o),t.annotations,t.scrollIntoView)}let r=e.facet(kb);for(let i=r.length-1;i>=0;i--){let o=r[i](t);o instanceof st?t=o:Array.isArray(o)&&o.length==1&&o[0]instanceof st?t=o[0]:t=Mb(e,Ri(o),!1)}return t}function JR(t){let e=t.startState,n=e.facet(Ab),r=t;for(let i=n.length-1;i>=0;i--){let o=n[i](t);o&&Object.keys(o).length&&(r=Tb(r,tu(e,o,t.changes.newLength),!0))}return r==t?t:st.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const eT=[];function Ri(t){return t==null?eT:Array.isArray(t)?t:[t]}var qe=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(qe||(qe={}));const tT=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let nu;try{nu=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function nT(t){if(nu)return nu.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||tT.test(n)))return!0}return!1}function rT(t){return e=>{if(!/\S/.test(e))return qe.Space;if(nT(e))return qe.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return qe.Word;return qe.Other}}class Me{constructor(e,n,r,i,o,s){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=o,s&&(s._state=this);for(let a=0;a<this.config.dynamicSlots.length;a++)Do(this,a<<1);this.computeSlot=null}field(e,n=!0){let r=this.config.address[e.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return Do(this,r),Za(this,r)}update(...e){return Mb(this,e,!0)}applyTransaction(e){let n=this.config,{base:r,compartments:i}=n;for(let a of e.effects)a.is(Xl.reconfigure)?(n&&(i=new Map,n.compartments.forEach((l,c)=>i.set(c,l)),n=null),i.set(a.value.compartment,a.value.extension)):a.is(Ae.reconfigure)?(n=null,r=a.value):a.is(Ae.appendConfig)&&(n=null,r=Ri(r).concat(a.value));let o;n?o=e.startState.values.slice():(n=Qa.resolve(r,i,this),o=new Me(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let s=e.startState.facet(eu)?e.newSelection:e.newSelection.asSingle();new Me(n,e.newDoc,s,o,(a,l)=>l.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:H.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),o=[r.range],s=Ri(r.effects);for(let a=1;a<n.ranges.length;a++){let l=e(n.ranges[a]),c=this.changes(l.changes),d=c.map(i);for(let f=0;f<a;f++)o[f]=o[f].map(d);let h=i.mapDesc(c,!0);o.push(l.range.map(h)),i=i.compose(d),s=Ae.mapEffects(s,d).concat(Ae.mapEffects(Ri(l.effects),h))}return{changes:i,selection:H.create(o,n.mainIndex),effects:s}}changes(e=[]){return e instanceof ot?e:ot.of(e,this.doc.length,this.facet(Me.lineSeparator))}toText(e){return Oe.of(e.split(this.facet(Me.lineSeparator)||Yd))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(Do(this,n),Za(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let i=e[r];i instanceof ut&&this.config.address[i.id]!=null&&(n[r]=i.spec.toJSON(this.field(e[r]),this))}return n}static fromJSON(e,n={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let o in r)if(Object.prototype.hasOwnProperty.call(e,o)){let s=r[o],a=e[o];i.push(s.init(l=>s.spec.fromJSON(a,l)))}}return Me.create({doc:e.doc,selection:H.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=Qa.resolve(e.extensions||[],new Map),r=e.doc instanceof Oe?e.doc:Oe.of((e.doc||"").split(n.staticFacet(Me.lineSeparator)||Yd)),i=e.selection?e.selection instanceof H?e.selection:H.single(e.selection.anchor,e.selection.head):H.single(0);return wb(i,r.length),n.staticFacet(eu)||(i=i.asSingle()),new Me(n,r,i,n.dynamicSlots.map(()=>null),(o,s)=>s.create(o),null)}get tabSize(){return this.facet(Me.tabSize)}get lineBreak(){return this.facet(Me.lineSeparator)||`
|
|
57
|
+
`}get readOnly(){return this.facet(Rb)}phrase(e,...n){for(let r of this.facet(Me.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let o=+(i||1);return!o||o>n.length?r:n[o-1]})),e}languageDataAt(e,n,r=-1){let i=[];for(let o of this.facet(Cb))for(let s of o(this,n,r))Object.prototype.hasOwnProperty.call(s,e)&&i.push(s[e]);return i}charCategorizer(e){return rT(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),o=this.charCategorizer(e),s=e-r,a=e-r;for(;s>0;){let l=pt(n,s,!1);if(o(n.slice(l,s))!=qe.Word)break;s=l}for(;a<i;){let l=pt(n,a);if(o(n.slice(a,l))!=qe.Word)break;a=l}return s==a?null:H.range(s+r,a+r)}}Me.allowMultipleSelections=eu;Me.tabSize=he.define({combine:t=>t.length?t[0]:4});Me.lineSeparator=$b;Me.readOnly=Rb;Me.phrases=he.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(i=>t[i]==e[i])}});Me.languageData=Cb;Me.changeFilter=Sb;Me.transactionFilter=kb;Me.transactionExtender=Ab;Xl.reconfigure=Ae.define();function Ln(t,e,n={}){let r={};for(let i of t)for(let o of Object.keys(i)){let s=i[o],a=r[o];if(a===void 0)r[o]=s;else if(!(a===s||s===void 0))if(Object.hasOwnProperty.call(n,o))r[o]=n[o](a,s);else throw new Error("Config merge conflict for field "+o)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class Kr{eq(e){return this==e}range(e,n=e){return Ko.create(e,n,this)}}Kr.prototype.startSide=Kr.prototype.endSide=0;Kr.prototype.point=!1;Kr.prototype.mapMode=kt.TrackDel;class Ko{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new Ko(e,n,r)}}function ru(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class mf{constructor(e,n,r,i){this.from=e,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,i=0){let o=r?this.to:this.from;for(let s=i,a=o.length;;){if(s==a)return s;let l=s+a>>1,c=o[l]-e||(r?this.value[l].endSide:this.value[l].startSide)-n;if(l==s)return c>=0?s:a;c>=0?a=l:s=l+1}}between(e,n,r,i){for(let o=this.findIndex(n,-1e9,!0),s=this.findIndex(r,1e9,!1,o);o<s;o++)if(i(this.from[o]+e,this.to[o]+e,this.value[o])===!1)return!1}map(e,n){let r=[],i=[],o=[],s=-1,a=-1;for(let l=0;l<this.value.length;l++){let c=this.value[l],d=this.from[l]+e,h=this.to[l]+e,f,m;if(d==h){let g=n.mapPos(d,c.startSide,c.mapMode);if(g==null||(f=m=g,c.startSide!=c.endSide&&(m=n.mapPos(d,c.endSide),m<f)))continue}else if(f=n.mapPos(d,c.startSide),m=n.mapPos(h,c.endSide),f>m||f==m&&c.startSide>0&&c.endSide<=0)continue;(m-f||c.endSide-c.startSide)<0||(s<0&&(s=f),c.point&&(a=Math.max(a,m-f)),r.push(c),i.push(f-s),o.push(m-s))}return{mapped:r.length?new mf(i,o,r,a):null,pos:s}}}class De{constructor(e,n,r,i){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(e,n,r,i){return new De(e,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:o=this.length}=e,s=e.filter;if(n.length==0&&!s)return this;if(r&&(n=n.slice().sort(ru)),this.isEmpty)return n.length?De.of(n):this;let a=new Eb(this,null,-1).goto(0),l=0,c=[],d=new Xn;for(;a.value||l<n.length;)if(l<n.length&&(a.from-n[l].from||a.startSide-n[l].value.startSide)>=0){let h=n[l++];d.addInner(h.from,h.to,h.value)||c.push(h)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(l==n.length||this.chunkEnd(a.chunkIndex)<n[l].from)&&(!s||i>this.chunkEnd(a.chunkIndex)||o<this.chunkPos[a.chunkIndex])&&d.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!s||i>a.to||o<a.from||s(a.from,a.to,a.value))&&(d.addInner(a.from,a.to,a.value)||c.push(Ko.create(a.from,a.to,a.value))),a.next());return d.finishInner(this.nextLayer.isEmpty&&!c.length?De.empty:this.nextLayer.update({add:c,filter:s,filterFrom:i,filterTo:o}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let s=0;s<this.chunk.length;s++){let a=this.chunkPos[s],l=this.chunk[s],c=e.touchesRange(a,a+l.length);if(c===!1)i=Math.max(i,l.maxPoint),n.push(l),r.push(e.mapPos(a));else if(c===!0){let{mapped:d,pos:h}=l.map(a,e);d&&(i=Math.max(i,d.maxPoint),n.push(d),r.push(h))}}let o=this.nextLayer.map(e);return n.length==0?o:new De(r,n,o||De.empty,i)}between(e,n,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let o=this.chunkPos[i],s=this.chunk[i];if(n>=o&&e<=o+s.length&&s.between(o,e-o,n-o,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return Go.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return Go.from(e).goto(n)}static compare(e,n,r,i,o=-1){let s=e.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=o),a=n.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=o),l=r1(s,a,r),c=new po(s,l,o),d=new po(a,l,o);r.iterGaps((h,f,m)=>i1(c,h,d,f,m,i)),r.empty&&r.length==0&&i1(c,0,d,0,0,i)}static eq(e,n,r=0,i){i==null&&(i=999999999);let o=e.filter(d=>!d.isEmpty&&n.indexOf(d)<0),s=n.filter(d=>!d.isEmpty&&e.indexOf(d)<0);if(o.length!=s.length)return!1;if(!o.length)return!0;let a=r1(o,s),l=new po(o,a,0).goto(r),c=new po(s,a,0).goto(r);for(;;){if(l.to!=c.to||!iu(l.active,c.active)||l.point&&(!c.point||!l.point.eq(c.point)))return!1;if(l.to>i)return!0;l.next(),c.next()}}static spans(e,n,r,i,o=-1){let s=new po(e,null,o).goto(n),a=n,l=s.openStart;for(;;){let c=Math.min(s.to,r);if(s.point){let d=s.activeForPoint(s.to),h=s.pointFrom<n?d.length+1:s.point.startSide<0?d.length:Math.min(d.length,l);i.point(a,c,s.point,d,h,s.pointRank),l=Math.min(s.openEnd(c),d.length)}else c>a&&(i.span(a,c,s.active,l),l=s.openEnd(c));if(s.to>r)return l+(s.point&&s.to>r?1:0);a=s.to,s.next()}}static of(e,n=!1){let r=new Xn;for(let i of e instanceof Ko?[e]:n?iT(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return De.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=De.empty;i=i.nextLayer)n=new De(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}De.empty=new De([],[],null,-1);function iT(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let r=t[n];if(ru(e,r)>0)return t.slice().sort(ru);e=r}return t}De.empty.nextLayer=De.empty;class Xn{finishChunk(e){this.chunks.push(new mf(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new Xn)).add(e,n,r)}addInner(e,n,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(De.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=De.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function r1(t,e,n){let r=new Map;for(let o of t)for(let s=0;s<o.chunk.length;s++)o.chunk[s].maxPoint<=0&&r.set(o.chunk[s],o.chunkPos[s]);let i=new Set;for(let o of e)for(let s=0;s<o.chunk.length;s++){let a=r.get(o.chunk[s]);a!=null&&(n?n.mapPos(a):a)==o.chunkPos[s]&&!n?.touchesRange(a,a+o.chunk[s].length)&&i.add(o.chunk[s])}return i}class Eb{constructor(e,n,r,i=0){this.layer=e,this.skip=n,this.minPoint=r,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,r){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<e||i.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],r=e+n.from[this.rangeIndex];if(this.from=r,this.to=e+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Go{constructor(e){this.heap=e}static from(e,n=null,r=-1){let i=[];for(let o=0;o<e.length;o++)for(let s=e[o];!s.isEmpty;s=s.nextLayer)s.maxPoint>=r&&i.push(new Eb(s,n,r,o));return i.length==1?i[0]:new Go(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)_c(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)_c(this.heap,r);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),_c(this.heap,0)}}}function _c(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let i=t[r];if(r+1<t.length&&i.compare(t[r+1])>=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}class po{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Go.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){Zs(this.active,e),Zs(this.activeTo,e),Zs(this.activeRank,e),this.minActive=o1(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:o}=this.cursor;for(;n<this.activeRank.length&&(o-this.activeRank[n]||i-this.activeTo[n])>0;)n++;Js(this.active,n,r),Js(this.activeTo,n,i),Js(this.activeRank,n,o),e&&Js(e,n,this.cursor.from),this.minActive=o1(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&Zs(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let o=this.cursor.value;if(!o.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=o,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=o.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let i=r.length-1;i>=0&&r[i]<e;i--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function i1(t,e,n,r,i,o){t.goto(e),n.goto(r);let s=r+i,a=r,l=r-e;for(;;){let c=t.to+l-n.to,d=c||t.endSide-n.endSide,h=d<0?t.to+l:n.to,f=Math.min(h,s);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&iu(t.activeForPoint(t.to),n.activeForPoint(n.to))||o.comparePoint(a,f,t.point,n.point):f>a&&!iu(t.active,n.active)&&o.compareRange(a,f,t.active,n.active),h>s)break;(c||t.openEnd!=n.openEnd)&&o.boundChange&&o.boundChange(h),a=h,d<=0&&t.next(),d>=0&&n.next()}}function iu(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!t[n].eq(e[n]))return!1;return!0}function Zs(t,e){for(let n=e,r=t.length-1;n<r;n++)t[n]=t[n+1];t.pop()}function Js(t,e,n){for(let r=t.length-1;r>=e;r--)t[r+1]=t[r];t[e]=n}function o1(t,e){let n=-1,r=1e9;for(let i=0;i<e.length;i++)(e[i]-r||t[i].endSide-t[n].endSide)<0&&(n=i,r=e[i]);return n}function io(t,e,n=t.length){let r=0;for(let i=0;i<n&&i<t.length;)t.charCodeAt(i)==9?(r+=e-r%e,i++):(r++,i=pt(t,i));return r}function ou(t,e,n,r){for(let i=0,o=0;;){if(o>=e)return i;if(i==t.length)break;o+=t.charCodeAt(i)==9?n-o%n:1,i=pt(t,i)}return r===!0?-1:t.length}const su="ͼ",s1=typeof Symbol>"u"?"__"+su:Symbol.for(su),au=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),a1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class xr{constructor(e,n){this.rules=[];let{finish:r}=n||{};function i(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function o(s,a,l,c){let d=[],h=/^@(\w+)\b/.exec(s[0]),f=h&&h[1]=="keyframes";if(h&&a==null)return l.push(s[0]+";");for(let m in a){let g=a[m];if(/&/.test(m))o(m.split(/,\s*/).map(b=>s.map(v=>b.replace(/&/,v))).reduce((b,v)=>b.concat(v)),g,l);else if(g&&typeof g=="object"){if(!h)throw new RangeError("The value of a property ("+m+") should be a primitive value.");o(i(m),g,d,f)}else g!=null&&d.push(m.replace(/_.*/,"").replace(/[A-Z]/g,b=>"-"+b.toLowerCase())+": "+g+";")}(d.length||f)&&l.push((r&&!h&&!c?s.map(r):s).join(", ")+" {"+d.join(" ")+"}")}for(let s in e)o(i(s),e[s],this.rules)}getRules(){return this.rules.join(`
|
|
58
|
+
`)}static newName(){let e=a1[s1]||1;return a1[s1]=e+1,su+e.toString(36)}static mount(e,n,r){let i=e[au],o=r&&r.nonce;i?o&&i.setNonce(o):i=new oT(e,o),i.mount(Array.isArray(n)?n:[n],e)}}let l1=new Map;class oT{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let o=l1.get(r);if(o)return e[au]=o;this.sheet=new i.CSSStyleSheet,l1.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[au]=this}mount(e,n){let r=this.sheet,i=0,o=0;for(let s=0;s<e.length;s++){let a=e[s],l=this.modules.indexOf(a);if(l<o&&l>-1&&(this.modules.splice(l,1),o--,l=-1),l==-1){if(this.modules.splice(o++,0,a),r)for(let c=0;c<a.rules.length;c++)r.insertRule(a.rules[c],i++)}else{for(;o<l;)i+=this.modules[o++].rules.length;i+=a.rules.length,o++}}if(r)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let s="";for(let l=0;l<this.modules.length;l++)s+=this.modules[l].getRules()+`
|
|
59
|
+
`;this.styleTag.textContent=s;let a=n.head||n;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var wr={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Yo={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},sT=typeof navigator<"u"&&/Mac/.test(navigator.platform),aT=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var ft=0;ft<10;ft++)wr[48+ft]=wr[96+ft]=String(ft);for(var ft=1;ft<=24;ft++)wr[ft+111]="F"+ft;for(var ft=65;ft<=90;ft++)wr[ft]=String.fromCharCode(ft+32),Yo[ft]=String.fromCharCode(ft);for(var zc in wr)Yo.hasOwnProperty(zc)||(Yo[zc]=wr[zc]);function lT(t){var e=sT&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||aT&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Yo:wr)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function Xo(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function lu(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function ka(t,e){if(!e.anchorNode)return!1;try{return lu(t,e.anchorNode)}catch{return!1}}function Hi(t){return t.nodeType==3?Yr(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function Oo(t,e,n,r){return n?c1(t,e,n,r,-1)||c1(t,e,n,r,1):!1}function Gr(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function Ja(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function c1(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Mn(t))){if(t.nodeName=="DIV")return!1;let o=t.parentNode;if(!o||o.nodeType!=1)return!1;e=Gr(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=i<0?Mn(t):0}else return!1}}function Mn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function xs(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function cT(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function Ib(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function dT(t,e,n,r,i,o,s,a){let l=t.ownerDocument,c=l.defaultView||window;for(let d=t,h=!1;d&&!h;)if(d.nodeType==1){let f,m=d==l.body,g=1,b=1;if(m)f=cT(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(d).position)&&(h=!0),d.scrollHeight<=d.clientHeight&&d.scrollWidth<=d.clientWidth){d=d.assignedSlot||d.parentNode;continue}let y=d.getBoundingClientRect();({scaleX:g,scaleY:b}=Ib(d,y)),f={left:y.left,right:y.left+d.clientWidth*g,top:y.top,bottom:y.top+d.clientHeight*b}}let v=0,x=0;if(i=="nearest")e.top<f.top?(x=e.top-(f.top+s),n>0&&e.bottom>f.bottom+x&&(x=e.bottom-f.bottom+s)):e.bottom>f.bottom&&(x=e.bottom-f.bottom+s,n<0&&e.top-x<f.top&&(x=e.top-(f.top+s)));else{let y=e.bottom-e.top,$=f.bottom-f.top;x=(i=="center"&&y<=$?e.top+y/2-$/2:i=="start"||i=="center"&&n<0?e.top-s:e.bottom-$+s)-f.top}if(r=="nearest"?e.left<f.left?(v=e.left-(f.left+o),n>0&&e.right>f.right+v&&(v=e.right-f.right+o)):e.right>f.right&&(v=e.right-f.right+o,n<0&&e.left<f.left+v&&(v=e.left-(f.left+o))):v=(r=="center"?e.left+(e.right-e.left)/2-(f.right-f.left)/2:r=="start"==a?e.left-o:e.right-(f.right-f.left)+o)-f.left,v||x)if(m)c.scrollBy(v,x);else{let y=0,$=0;if(x){let k=d.scrollTop;d.scrollTop+=x/b,$=(d.scrollTop-k)*b}if(v){let k=d.scrollLeft;d.scrollLeft+=v/g,y=(d.scrollLeft-k)*g}e={left:e.left-y,top:e.top-$,right:e.right-y,bottom:e.bottom-$},y&&Math.abs(y-v)<1&&(r="nearest"),$&&Math.abs($-x)<1&&(i="nearest")}if(m)break;(e.top<f.top||e.bottom>f.bottom||e.left<f.left||e.right>f.right)&&(e={left:Math.max(e.left,f.left),right:Math.min(e.right,f.right),top:Math.max(e.top,f.top),bottom:Math.min(e.bottom,f.bottom)}),d=d.assignedSlot||d.parentNode}else if(d.nodeType==11)d=d.host;else break}function uT(t){let e=t.ownerDocument,n,r;for(let i=t.parentNode;i&&!(i==e.body||n&&r);)if(i.nodeType==1)!r&&i.scrollHeight>i.clientHeight&&(r=i),!n&&i.scrollWidth>i.clientWidth&&(n=i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;return{x:n,y:r}}class hT{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?Mn(n):0),r,Math.min(e.focusOffset,r?Mn(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let mi=null;function jb(t){if(t.setActive)return t.setActive();if(mi)return t.focus(mi);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(mi==null?{get preventScroll(){return mi={preventScroll:!0},!0}}:void 0),!mi){mi=!1;for(let n=0;n<e.length;){let r=e[n++],i=e[n++],o=e[n++];r.scrollTop!=i&&(r.scrollTop=i),r.scrollLeft!=o&&(r.scrollLeft=o)}}}let d1;function Yr(t,e,n=e){let r=d1||(d1=document.createRange());return r.setEnd(t,n),r.setStart(t,e),r}function Ti(t,e,n,r){let i={key:e,code:e,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let o=new KeyboardEvent("keydown",i);o.synthetic=!0,t.dispatchEvent(o);let s=new KeyboardEvent("keyup",i);return s.synthetic=!0,t.dispatchEvent(s),o.defaultPrevented||s.defaultPrevented}function fT(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function Db(t){for(;t.attributes.length;)t.removeAttributeNode(t.attributes[0])}function mT(t,e){let n=e.focusNode,r=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=r)return!1;for(r=Math.min(r,Mn(n));;)if(r){if(n.nodeType!=1)return!1;let i=n.childNodes[r-1];i.contentEditable=="false"?r--:(n=i,r=Mn(n))}else{if(n==t)return!0;r=Gr(n),n=n.parentNode}}function Ob(t){return t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function Lb(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=Mn(n)}else if(n.parentNode&&!Ja(n))r=Gr(n),n=n.parentNode;else return null}}function Nb(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!Ja(n))r=Gr(n)+1,n=n.parentNode;else return null}}class yt{constructor(e,n,r=!0){this.node=e,this.offset=n,this.precise=r}static before(e,n){return new yt(e.parentNode,Gr(e),n)}static after(e,n){return new yt(e.parentNode,Gr(e)+1,n)}}const pf=[];class He{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let n=this.posAtStart;for(let r of this.children){if(r==e)return n;n+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,n){if(this.flags&2){let r=this.dom,i=null,o;for(let s of this.children){if(s.flags&7){if(!s.dom&&(o=i?i.nextSibling:r.firstChild)){let a=He.get(o);(!a||!a.parent&&a.canReuseDOM(s))&&s.reuseDOM(o)}s.sync(e,n),s.flags&=-8}if(o=i?i.nextSibling:r.firstChild,n&&!n.written&&n.node==r&&o!=s.dom&&(n.written=!0),s.dom.parentNode==r)for(;o&&o!=s.dom;)o=u1(o);else r.insertBefore(s.dom,o);i=s.dom}for(o=i?i.nextSibling:r.firstChild,o&&n&&n.node==r&&(n.written=!0);o;)o=u1(o)}else if(this.flags&1)for(let r of this.children)r.flags&7&&(r.sync(e,n),r.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,n){let r;if(e==this.dom)r=this.dom.childNodes[n];else{let i=Mn(e)==0?0:n==0?-1:1;for(;;){let o=e.parentNode;if(o==this.dom)break;i==0&&o.firstChild!=o.lastChild&&(e==o.firstChild?i=-1:i=1),e=o}i<0?r=e:r=e.nextSibling}if(r==this.dom.firstChild)return 0;for(;r&&!He.get(r);)r=r.nextSibling;if(!r)return this.length;for(let i=0,o=0;;i++){let s=this.children[i];if(s.dom==r)return o;o+=s.length+s.breakAfter}}domBoundsAround(e,n,r=0){let i=-1,o=-1,s=-1,a=-1;for(let l=0,c=r,d=r;l<this.children.length;l++){let h=this.children[l],f=c+h.length;if(c<e&&f>n)return h.domBoundsAround(e,n,c);if(f>=e&&i==-1&&(i=l,o=c),c>n&&h.dom.parentNode==this.dom){s=l,a=d;break}d=f,c=f+h.breakAfter}return{from:o,to:a<0?r+this.length:a,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:s<this.children.length&&s>=0?this.children[s].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let n=this.parent;n;n=n.parent){if(e&&(n.flags|=2),n.flags&1)return;n.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let n=e.parent;if(!n)return e;e=n}}replaceChildren(e,n,r=pf){this.markDirty();for(let i=e;i<n;i++){let o=this.children[i];o.parent==this&&r.indexOf(o)<0&&o.destroy()}r.length<250?this.children.splice(e,n-e,...r):this.children=[].concat(this.children.slice(0,e),r,this.children.slice(n));for(let i=0;i<r.length;i++)r[i].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new Bb(this.children,e,this.children.length)}childPos(e,n=1){return this.childCursor().findPos(e,n)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+(e=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,n,r,i,o,s){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!((this.flags|e.flags)&8)}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}}He.prototype.breakAfter=0;function u1(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Bb{constructor(e,n,r){this.children=e,this.pos=n,this.i=r,this.off=0}findPos(e,n=1){for(;;){if(e>this.pos||e==this.pos&&(n>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function Fb(t,e,n,r,i,o,s,a,l){let{children:c}=t,d=c.length?c[e]:null,h=o.length?o[o.length-1]:null,f=h?h.breakAfter:s;if(!(e==r&&d&&!s&&!f&&o.length<2&&d.merge(n,i,o.length?h:null,n==0,a,l))){if(r<c.length){let m=c[r];m&&(i<m.length||m.breakAfter&&h?.breakAfter)?(e==r&&(m=m.split(i),i=0),!f&&h&&m.merge(0,i,h,!0,0,l)?o[o.length-1]=m:((i||m.children.length&&!m.children[0].length)&&m.merge(0,i,null,!1,0,l),o.push(m))):m?.breakAfter&&(h?h.breakAfter=1:s=1),r++}for(d&&(d.breakAfter=s,n>0&&(!s&&o.length&&d.merge(n,d.length,o[0],!1,a,0)?d.breakAfter=o.shift().breakAfter:(n<d.length||d.children.length&&d.children[d.children.length-1].length==0)&&d.merge(n,d.length,null,!1,a,0),e++));e<r&&o.length;)if(c[r-1].become(o[o.length-1]))r--,o.pop(),l=o.length?0:a;else if(c[e].become(o[0]))e++,o.shift(),a=o.length?0:l;else break;!o.length&&e&&r<c.length&&!c[e-1].breakAfter&&c[r].merge(0,0,c[e-1],!1,a,l)&&e--,(e<r||o.length)&&t.replaceChildren(e,r,o)}}function Vb(t,e,n,r,i,o){let s=t.childCursor(),{i:a,off:l}=s.findPos(n,1),{i:c,off:d}=s.findPos(e,-1),h=e-n;for(let f of r)h+=f.length;t.length+=h,Fb(t,c,d,a,l,r,0,i,o)}let It=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},cu=typeof document<"u"?document:{documentElement:{style:{}}};const du=/Edge\/(\d+)/.exec(It.userAgent),_b=/MSIE \d/.test(It.userAgent),uu=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(It.userAgent),Ql=!!(_b||uu||du),h1=!Ql&&/gecko\/(\d+)/i.test(It.userAgent),Hc=!Ql&&/Chrome\/(\d+)/.exec(It.userAgent),pT="webkitFontSmoothing"in cu.documentElement.style,zb=!Ql&&/Apple Computer/.test(It.vendor),f1=zb&&(/Mobile\/\w+/.test(It.userAgent)||It.maxTouchPoints>2);var me={mac:f1||/Mac/.test(It.platform),windows:/Win/.test(It.platform),linux:/Linux|X11/.test(It.platform),ie:Ql,ie_version:_b?cu.documentMode||6:uu?+uu[1]:du?+du[1]:0,gecko:h1,gecko_version:h1?+(/Firefox\/(\d+)/.exec(It.userAgent)||[0,0])[1]:0,chrome:!!Hc,chrome_version:Hc?+Hc[1]:0,ios:f1,android:/Android\b/.test(It.userAgent),safari:zb,webkit_version:pT?+(/\bAppleWebKit\/(\d+)/.exec(It.userAgent)||[0,0])[1]:0,tabSize:cu.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const gT=256;class ln extends He{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,n){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(n&&n.node==this.dom&&(n.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,n,r){return this.flags&8||r&&(!(r instanceof ln)||this.length-(n-e)+r.length>gT||r.flags&8)?!1:(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(n),this.markDirty(),!0)}split(e){let n=new ln(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),n.flags|=this.flags&8,n}localPosFromDOM(e,n){return e==this.dom?n:n?this.text.length:0}domAtPos(e){return new yt(this.dom,e)}domBoundsAround(e,n,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,n){return bT(this.dom,e,n)}}class Qn extends He{constructor(e,n=[],r=0){super(),this.mark=e,this.children=n,this.length=r;for(let i of n)i.setParent(this)}setAttrs(e){if(Db(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let n in this.mark.attrs)e.setAttribute(n,this.mark.attrs[n]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,n){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,n)}merge(e,n,r,i,o,s){return r&&(!(r instanceof Qn&&r.mark.eq(this.mark))||e&&o<=0||n<this.length&&s<=0)?!1:(Vb(this,e,n,r?r.children.slice():[],o-1,s-1),this.markDirty(),!0)}split(e){let n=[],r=0,i=-1,o=0;for(let a of this.children){let l=r+a.length;l>e&&n.push(r<e?a.split(e-r):a),i<0&&r>=e&&(i=o),r=l,o++}let s=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new Qn(this.mark,n,s)}domAtPos(e){return Hb(this,e)}coordsAt(e,n){return Wb(this,e,n)}}function bT(t,e,n){let r=t.nodeValue.length;e>r&&(e=r);let i=e,o=e,s=0;e==0&&n<0||e==r&&n>=0?me.chrome||me.gecko||(e?(i--,s=1):o<r&&(o++,s=-1)):n<0?i--:o<r&&o++;let a=Yr(t,i,o).getClientRects();if(!a.length)return null;let l=a[(s?s<0:n>=0)?0:a.length-1];return me.safari&&!s&&l.width==0&&(l=Array.prototype.find.call(a,c=>c.width)||l),s?xs(l,s<0):l||null}class ur extends He{static create(e,n,r){return new ur(e,n,r)}constructor(e,n,r){super(),this.widget=e,this.length=n,this.side=r,this.prevWidget=null}split(e){let n=ur.create(this.widget,this.length-e,this.side);return this.length-=e,n}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,n,r,i,o,s){return r&&(!(r instanceof ur)||!this.widget.compare(r.widget)||e>0&&o<=0||n<this.length&&s<=0)?!1:(this.length=e+(r?r.length:0)+(this.length-n),!0)}become(e){return e instanceof ur&&e.side==this.side&&this.widget.constructor==e.widget.constructor?(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(this.length==0)return Oe.empty;let e=this;for(;e.parent;)e=e.parent;let{view:n}=e,r=n&&n.state.doc,i=this.posAtStart;return r?r.slice(i,i+this.length):Oe.empty}domAtPos(e){return(this.length?e==0:this.side>0)?yt.before(this.dom):yt.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,n){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;let i=this.dom.getClientRects(),o=null;if(!i.length)return null;let s=this.side?this.side<0:e>0;for(let a=s?i.length-1:0;o=i[a],!(e>0?a==0:a==i.length-1||o.top<o.bottom);a+=s?-1:1);return xs(o,!s)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class Pi extends He{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof Pi&&e.side==this.side}split(){return new Pi(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?yt.before(this.dom):yt.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Oe.empty}get isHidden(){return!0}}ln.prototype.children=ur.prototype.children=Pi.prototype.children=pf;function Hb(t,e){let n=t.dom,{children:r}=t,i=0;for(let o=0;i<r.length;i++){let s=r[i],a=o+s.length;if(!(a==o&&s.getSide()<=0)){if(e>o&&e<a&&s.dom.parentNode==n)return s.domAtPos(e-o);if(e<=o)break;o=a}}for(let o=i;o>0;o--){let s=r[o-1];if(s.dom.parentNode==n)return s.domAtPos(s.length)}for(let o=i;o<r.length;o++){let s=r[o];if(s.dom.parentNode==n)return s.domAtPos(0)}return new yt(n,0)}function Pb(t,e,n){let r,{children:i}=t;n>0&&e instanceof Qn&&i.length&&(r=i[i.length-1])instanceof Qn&&r.mark.eq(e.mark)?Pb(r,e.children[0],n-1):(i.push(e),e.setParent(t)),t.length+=e.length}function Wb(t,e,n){let r=null,i=-1,o=null,s=-1;function a(c,d){for(let h=0,f=0;h<c.children.length&&f<=d;h++){let m=c.children[h],g=f+m.length;g>=d&&(m.children.length?a(m,d-f):(!o||o.isHidden&&(n>0||xT(o,m)))&&(g>d||f==g&&m.getSide()>0)?(o=m,s=d-f):(f<d||f==g&&m.getSide()<0&&!m.isHidden)&&(r=m,i=d-f)),f=g}}a(t,e);let l=(n<0?r:o)||r||o;return l?l.coordsAt(Math.max(0,l==r?i:s),n):vT(t)}function vT(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=Hi(e);return n[n.length-1]||null}function xT(t,e){let n=t.coordsAt(0,1),r=e.coordsAt(0,1);return n&&r&&r.top<n.bottom}function hu(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}const m1=Object.create(null);function el(t,e,n){if(t==e)return!0;t||(t=m1),e||(e=m1);let r=Object.keys(t),i=Object.keys(e);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let o of r)if(o!=n&&(i.indexOf(o)==-1||t[o]!==e[o]))return!1;return!0}function fu(t,e,n){let r=!1;if(e)for(let i in e)n&&i in n||(r=!0,i=="style"?t.style.cssText="":t.removeAttribute(i));if(n)for(let i in n)e&&e[i]==n[i]||(r=!0,i=="style"?t.style.cssText=n[i]:t.setAttribute(i,n[i]));return r}function wT(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let r=t.attributes[n];e[r.name]=r.value}return e}class ir{eq(e){return!1}updateDOM(e,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var Rt=function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t}(Rt||(Rt={}));class xe extends Kr{constructor(e,n,r,i){super(),this.startSide=e,this.endSide=n,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(e){return new ws(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return n+=r&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new yr(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:o,end:s}=qb(e,n);r=(o?n?-3e8:-1:5e8)-1,i=(s?n?2e8:1:-6e8)+1}return new yr(e,r,i,n,e.widget||null,!0)}static line(e){return new ys(e)}static set(e,n=!1){return De.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}xe.none=De.empty;class ws extends xe{constructor(e){let{start:n,end:r}=qb(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var n,r;return this==e||e instanceof ws&&this.tagName==e.tagName&&(this.class||((n=this.attrs)===null||n===void 0?void 0:n.class))==(e.class||((r=e.attrs)===null||r===void 0?void 0:r.class))&&el(this.attrs,e.attrs,"class")}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}ws.prototype.point=!1;class ys extends xe{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof ys&&this.spec.class==e.spec.class&&el(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}ys.prototype.mapMode=kt.TrackBefore;ys.prototype.point=!0;class yr extends xe{constructor(e,n,r,i,o,s){super(n,r,o,e),this.block=i,this.isReplace=s,this.mapMode=i?n<=0?kt.TrackBefore:kt.TrackAfter:kt.TrackDel}get type(){return this.startSide!=this.endSide?Rt.WidgetRange:this.startSide<=0?Rt.WidgetBefore:Rt.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof yr&&yT(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}yr.prototype.point=!0;function qb(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function yT(t,e){return t==e||!!(t&&e&&t.compare(e))}function Aa(t,e,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=t?n[i]=Math.max(n[i],e):n.push(t,e)}class tt extends He{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,n,r,i,o,s){if(r){if(!(r instanceof tt))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),Vb(this,e,n,r?r.children.slice():[],o,s),!0}split(e){let n=new tt;if(n.breakAfter=this.breakAfter,this.length==0)return n;let{i:r,off:i}=this.childPos(e);i&&(n.append(this.children[r].split(i),0),this.children[r].merge(i,this.children[r].length,null,!1,0,0),r++);for(let o=r;o<this.children.length;o++)n.append(this.children[o],0);for(;r>0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=e,n}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){el(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,n){Pb(this,e,n)}addLineDeco(e){let n=e.spec.attributes,r=e.spec.class;n&&(this.attrs=hu(n,this.attrs||{})),r&&(this.attrs=hu({class:r},this.attrs||{}))}domAtPos(e){return Hb(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,n){var r;this.dom?this.flags&4&&(Db(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(fu(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,n);let i=this.dom.lastChild;for(;i&&He.get(i)instanceof Qn;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((r=He.get(i))===null||r===void 0?void 0:r.isEditable)==!1&&(!me.ios||!this.children.some(o=>o instanceof ln))){let o=document.createElement("BR");o.cmIgnore=!0,this.dom.appendChild(o)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,n;for(let r of this.children){if(!(r instanceof ln)||/[^ -~]/.test(r.text))return null;let i=Hi(r.dom);if(i.length!=1)return null;e+=i[0].width,n=i[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:n}:null}coordsAt(e,n){let r=Wb(this,e,n);if(!this.children.length&&r&&this.parent){let{heightOracle:i}=this.parent.view.viewState,o=r.bottom-r.top;if(Math.abs(o-i.lineHeight)<2&&i.textHeight<o){let s=(o-i.textHeight)/2;return{top:r.top+s,bottom:r.bottom-s,left:r.left,right:r.left}}}return r}become(e){return e instanceof tt&&this.children.length==0&&e.children.length==0&&el(this.attrs,e.attrs)&&this.breakAfter==e.breakAfter}covers(){return!0}static find(e,n){for(let r=0,i=0;r<e.children.length;r++){let o=e.children[r],s=i+o.length;if(s>=n){if(o instanceof tt)return o;if(s>n)break}i=s+o.breakAfter}return null}}class Un extends He{constructor(e,n,r){super(),this.widget=e,this.length=n,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(e,n,r,i,o,s){return r&&(!(r instanceof Un)||!this.widget.compare(r.widget)||e>0&&o<=0||n<this.length&&s<=0)?!1:(this.length=e+(r?r.length:0)+(this.length-n),!0)}domAtPos(e){return e==0?yt.before(this.dom):yt.after(this.dom,e==this.length)}split(e){let n=this.length-e;this.length=e;let r=new Un(this.widget,n,this.deco);return r.breakAfter=this.breakAfter,r}get children(){return pf}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):Oe.empty}domBoundsAround(){return null}become(e){return e instanceof Un&&e.widget.constructor==this.widget.constructor?(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,n){let r=this.widget.coordsAt(this.dom,e,n);return r||(this.widget instanceof mu?null:xs(this.dom.getBoundingClientRect(),this.length?e==0:n<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:n,endSide:r}=this.deco;return n==r?!1:e<0?n<0:r>0}}class mu extends ir{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class Lo{constructor(e,n,r,i){this.doc=e,this.pos=n,this.end=r,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=n}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof Un&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new tt),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(ea(new Pi(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof Un)&&this.getLine()}buildText(e,n,r){for(;e>0;){if(this.textOff==this.text.length){let{value:o,lineBreak:s,done:a}=this.cursor.next(this.skip);if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(s){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=o,this.textOff=0}let i=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(n.slice(n.length-r)),this.getLine().append(ea(new ln(this.text.slice(this.textOff,this.textOff+i)),n),r),this.atCursorPos=!0,this.textOff+=i,e-=i,r=0}}span(e,n,r,i){this.buildText(n-e,r,i),this.pos=n,this.openStart<0&&(this.openStart=i)}point(e,n,r,i,o,s){if(this.disallowBlockEffectsFor[s]&&r instanceof yr){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(n>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let a=n-e;if(r instanceof yr)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Un(r.widget||Wi.block,a,r));else{let l=ur.create(r.widget||Wi.inline,a,a?0:r.startSide),c=this.atCursorPos&&!l.isEditable&&o<=i.length&&(e<n||r.startSide>0),d=!l.isEditable&&(e<n||o>i.length||r.startSide<=0),h=this.getLine();this.pendingBuffer==2&&!c&&!l.isEditable&&(this.pendingBuffer=0),this.flushBuffer(i),c&&(h.append(ea(new Pi(1),i),o),o=i.length+Math.max(0,o-i.length)),h.append(ea(l,i),o),this.atCursorPos=d,this.pendingBuffer=d?e<n||o>i.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=n),this.openStart<0&&(this.openStart=o)}static build(e,n,r,i,o){let s=new Lo(e,n,r,o);return s.openEnd=De.spans(i,n,r,s),s.openStart<0&&(s.openStart=s.openEnd),s.finish(s.openEnd),s}}function ea(t,e){for(let n of e)t=new Qn(n,[t],t.length);return t}class Wi extends ir{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Wi.inline=new Wi("span");Wi.block=new Wi("div");var We=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(We||(We={}));const Xr=We.LTR,gf=We.RTL;function Ub(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const CT=Ub("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),$T=Ub("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),pu=Object.create(null),gn=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);pu[e]=n,pu[n]=-e}function Kb(t){return t<=247?CT[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?$T[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const ST=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class hr{get dir(){return this.level%2?gf:Xr}constructor(e,n,r){this.from=e,this.to=n,this.level=r}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,r,i){let o=-1;for(let s=0;s<e.length;s++){let a=e[s];if(a.from<=n&&a.to>=n){if(a.level==r)return s;(o<0||(i!=0?i<0?a.from<n:a.to>n:e[o].level>a.level))&&(o=s)}}if(o<0)throw new RangeError("Index out of range");return o}}function Gb(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],i=e[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!Gb(r.inner,i.inner))return!1}return!0}const ze=[];function kT(t,e,n,r,i){for(let o=0;o<=r.length;o++){let s=o?r[o-1].to:e,a=o<r.length?r[o].from:n,l=o?256:i;for(let c=s,d=l,h=l;c<a;c++){let f=Kb(t.charCodeAt(c));f==512?f=d:f==8&&h==4&&(f=16),ze[c]=f==4?2:f,f&7&&(h=f),d=f}for(let c=s,d=l,h=l;c<a;c++){let f=ze[c];if(f==128)c<a-1&&d==ze[c+1]&&d&24?f=ze[c]=d:ze[c]=256;else if(f==64){let m=c+1;for(;m<a&&ze[m]==64;)m++;let g=c&&d==8||m<n&&ze[m]==8?h==1?1:8:256;for(let b=c;b<m;b++)ze[b]=g;c=m-1}else f==8&&h==1&&(ze[c]=1);d=f,f&7&&(h=f)}}}function AT(t,e,n,r,i){let o=i==1?2:1;for(let s=0,a=0,l=0;s<=r.length;s++){let c=s?r[s-1].to:e,d=s<r.length?r[s].from:n;for(let h=c,f,m,g;h<d;h++)if(m=pu[f=t.charCodeAt(h)])if(m<0){for(let b=a-3;b>=0;b-=3)if(gn[b+1]==-m){let v=gn[b+2],x=v&2?i:v&4?v&1?o:i:0;x&&(ze[h]=ze[gn[b]]=x),a=b;break}}else{if(gn.length==189)break;gn[a++]=h,gn[a++]=f,gn[a++]=l}else if((g=ze[h])==2||g==1){let b=g==i;l=b?0:1;for(let v=a-3;v>=0;v-=3){let x=gn[v+2];if(x&2)break;if(b)gn[v+2]|=2;else{if(x&4)break;gn[v+2]|=4}}}}}function RT(t,e,n,r){for(let i=0,o=r;i<=n.length;i++){let s=i?n[i-1].to:t,a=i<n.length?n[i].from:e;for(let l=s;l<a;){let c=ze[l];if(c==256){let d=l+1;for(;;)if(d==a){if(i==n.length)break;d=n[i++].to,a=i<n.length?n[i].from:e}else if(ze[d]==256)d++;else break;let h=o==1,f=(d<e?ze[d]:r)==1,m=h==f?h?1:2:r;for(let g=d,b=i,v=b?n[b-1].to:t;g>l;)g==v&&(g=n[--b].from,v=b?n[b-1].to:t),ze[--g]=m;l=d}else o=c,l++}}}function gu(t,e,n,r,i,o,s){let a=r%2?2:1;if(r%2==i%2)for(let l=e,c=0;l<n;){let d=!0,h=!1;if(c==o.length||l<o[c].from){let b=ze[l];b!=a&&(d=!1,h=b==16)}let f=!d&&a==1?[]:null,m=d?r:r+1,g=l;e:for(;;)if(c<o.length&&g==o[c].from){if(h)break e;let b=o[c];if(!d)for(let v=b.to,x=c+1;;){if(v==n)break e;if(x<o.length&&o[x].from==v)v=o[x++].to;else{if(ze[v]==a)break e;break}}if(c++,f)f.push(b);else{b.from>l&&s.push(new hr(l,b.from,m));let v=b.direction==Xr!=!(m%2);bu(t,v?r+1:r,i,b.inner,b.from,b.to,s),l=b.to}g=b.to}else{if(g==n||(d?ze[g]!=a:ze[g]==a))break;g++}f?gu(t,l,g,r+1,i,f,s):l<g&&s.push(new hr(l,g,m)),l=g}else for(let l=n,c=o.length;l>e;){let d=!0,h=!1;if(!c||l>o[c-1].to){let b=ze[l-1];b!=a&&(d=!1,h=b==16)}let f=!d&&a==1?[]:null,m=d?r:r+1,g=l;e:for(;;)if(c&&g==o[c-1].to){if(h)break e;let b=o[--c];if(!d)for(let v=b.from,x=c;;){if(v==e)break e;if(x&&o[x-1].to==v)v=o[--x].from;else{if(ze[v-1]==a)break e;break}}if(f)f.push(b);else{b.to<l&&s.push(new hr(b.to,l,m));let v=b.direction==Xr!=!(m%2);bu(t,v?r+1:r,i,b.inner,b.from,b.to,s),l=b.from}g=b.from}else{if(g==e||(d?ze[g-1]!=a:ze[g-1]==a))break;g--}f?gu(t,g,l,r+1,i,f,s):g<l&&s.push(new hr(g,l,m)),l=g}}function bu(t,e,n,r,i,o,s){let a=e%2?2:1;kT(t,i,o,r,a),AT(t,i,o,r,a),RT(i,o,r,a),gu(t,i,o,e,n,r,s)}function TT(t,e,n){if(!t)return[new hr(0,0,e==gf?1:0)];if(e==Xr&&!n.length&&!ST.test(t))return Yb(t.length);if(n.length)for(;t.length>ze.length;)ze[ze.length]=256;let r=[],i=e==Xr?0:1;return bu(t,i,i,n,0,t.length,r),r}function Yb(t){return[new hr(0,t,0)]}let Xb="";function MT(t,e,n,r,i){var o;let s=r.head-t.from,a=hr.find(e,s,(o=r.bidiLevel)!==null&&o!==void 0?o:-1,r.assoc),l=e[a],c=l.side(i,n);if(s==c){let f=a+=i?1:-1;if(f<0||f>=e.length)return null;l=e[a=f],s=l.side(!i,n),c=l.side(i,n)}let d=pt(t.text,s,l.forward(i,n));(d<l.from||d>l.to)&&(d=c),Xb=t.text.slice(Math.min(s,d),Math.max(s,d));let h=a==(i?e.length-1:0)?null:e[a+(i?1:-1)];return h&&d==c&&h.level+(i?0:1)<l.level?H.cursor(h.side(!i,n)+t.from,h.forward(i,n)?1:-1,h.level):H.cursor(d+t.from,l.forward(i,n)?-1:1,l.level)}function ET(t,e,n){for(let r=e;r<n;r++){let i=Kb(t.charCodeAt(r));if(i==1)return Xr;if(i==2||i==4)return gf}return Xr}const Qb=he.define(),Zb=he.define(),Jb=he.define(),ev=he.define(),vu=he.define(),tv=he.define(),nv=he.define(),bf=he.define(),vf=he.define(),rv=he.define({combine:t=>t.some(e=>e)}),iv=he.define({combine:t=>t.some(e=>e)}),ov=he.define();class Mi{constructor(e,n="nearest",r="nearest",i=5,o=5,s=!1){this.range=e,this.y=n,this.x=r,this.yMargin=i,this.xMargin=o,this.isSnapshot=s}map(e){return e.empty?this:new Mi(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Mi(H.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const ta=Ae.define({map:(t,e)=>t.map(e)}),sv=Ae.define();function Dt(t,e,n){let r=t.facet(ev);r.length?r[0](e):window.onerror?window.onerror(String(e),n,void 0,void 0,e):n?console.error(n+":",e):console.error(e)}const Hn=he.define({combine:t=>t.length?t[0]:!0});let IT=0;const Ao=he.define();class Je{constructor(e,n,r,i,o){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.extension=o(this)}static define(e,n){const{eventHandlers:r,eventObservers:i,provide:o,decorations:s}=n||{};return new Je(IT++,e,r,i,a=>{let l=[Ao.of(a)];return s&&l.push(Qo.of(c=>{let d=c.plugin(a);return d?s(d):xe.none})),o&&l.push(o(a)),l})}static fromClass(e,n){return Je.define(r=>new e(r),n)}}class Pc{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(Dt(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(n){Dt(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){Dt(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const av=he.define(),xf=he.define(),Qo=he.define(),lv=he.define(),wf=he.define(),cv=he.define();function p1(t,e){let n=t.state.facet(cv);if(!n.length)return n;let r=n.map(o=>o instanceof Function?o(t):o),i=[];return De.spans(r,e.from,e.to,{point(){},span(o,s,a,l){let c=o-e.from,d=s-e.from,h=i;for(let f=a.length-1;f>=0;f--,l--){let m=a[f].spec.bidiIsolate,g;if(m==null&&(m=ET(e.text,c,d)),l>0&&h.length&&(g=h[h.length-1]).to==c&&g.direction==m)g.to=d,h=g.inner;else{let b={from:c,to:d,direction:m,inner:[]};h.push(b),h=b.inner}}}}),i}const dv=he.define();function yf(t){let e=0,n=0,r=0,i=0;for(let o of t.state.facet(dv)){let s=o(t);s&&(s.left!=null&&(e=Math.max(e,s.left)),s.right!=null&&(n=Math.max(n,s.right)),s.top!=null&&(r=Math.max(r,s.top)),s.bottom!=null&&(i=Math.max(i,s.bottom)))}return{left:e,right:n,top:r,bottom:i}}const Ro=he.define();class Gt{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new Gt(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let i=e[n-1];if(!(i.fromA>r.toA)){if(i.toA<r.fromA)break;r=r.join(i),e.splice(n-1,1)}}return e.splice(n,0,r),e}static extendWithRanges(e,n){if(n.length==0)return e;let r=[];for(let i=0,o=0,s=0,a=0;;i++){let l=i==e.length?null:e[i],c=s-a,d=l?l.fromB:1e9;for(;o<n.length&&n[o]<d;){let h=n[o],f=n[o+1],m=Math.max(a,h),g=Math.min(d,f);if(m<=g&&new Gt(m+c,g+c,m,g).addToSet(r),f>d)break;o+=2}if(!l)return r;new Gt(l.fromA,l.toA,l.fromB,l.toB).addToSet(r),s=l.toA,a=l.toB}}}class tl{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=ot.empty(this.startState.doc.length);for(let o of r)this.changes=this.changes.compose(o.changes);let i=[];this.changes.iterChangedRanges((o,s,a,l)=>i.push(new Gt(o,s,a,l))),this.changedRanges=i}static create(e,n,r){return new tl(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class g1 extends He{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=xe.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new tt],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Gt(0,0,0,e.state.doc.length)],0,null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:c,toA:d})=>d<this.minWidthFrom||c>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!FT(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let o=i>-1?DT(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:d}=this.hasComposition;r=new Gt(c,d,e.changes.mapPos(c,-1),e.changes.mapPos(d,1)).addToSet(r.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(me.ie||me.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,a=this.updateDeco(),l=NT(s,a,e.changes);return r=Gt.extendWithRanges(r,l),!(this.flags&7)&&r.length==0?!1:(this.updateInner(r,e.startState.doc.length,o),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,n,r);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=me.chrome||me.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,s),this.flags&=-8,s&&(s.written||i.selectionRange.focusNode!=s.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(s=>s.flags&=-9);let o=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.children)s instanceof Un&&s.widget instanceof mu&&o.push(s.dom);i.updateGaps(o)}updateChildren(e,n,r){let i=r?r.range.addToSet(e.slice()):e,o=this.childCursor(n);for(let s=i.length-1;;s--){let a=s>=0?i[s]:null;if(!a)break;let{fromA:l,toA:c,fromB:d,toB:h}=a,f,m,g,b;if(r&&r.range.fromB<h&&r.range.toB>d){let k=Lo.build(this.view.state.doc,d,r.range.fromB,this.decorations,this.dynamicDecorationMap),S=Lo.build(this.view.state.doc,r.range.toB,h,this.decorations,this.dynamicDecorationMap);m=k.breakAtStart,g=k.openStart,b=S.openEnd;let R=this.compositionView(r);S.breakAtStart?R.breakAfter=1:S.content.length&&R.merge(R.length,R.length,S.content[0],!1,S.openStart,0)&&(R.breakAfter=S.content[0].breakAfter,S.content.shift()),k.content.length&&R.merge(0,0,k.content[k.content.length-1],!0,0,k.openEnd)&&k.content.pop(),f=k.content.concat(R).concat(S.content)}else({content:f,breakAtStart:m,openStart:g,openEnd:b}=Lo.build(this.view.state.doc,d,h,this.decorations,this.dynamicDecorationMap));let{i:v,off:x}=o.findPos(c,1),{i:y,off:$}=o.findPos(l,-1);Fb(this,y,$,v,x,f,m,g,b)}r&&this.fixCompositionDOM(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(sv)&&(this.editContextFormatting=r.value)}compositionView(e){let n=new ln(e.text.nodeValue);n.flags|=8;for(let{deco:i}of e.marks)n=new Qn(i,[n],n.length);let r=new tt;return r.append(n,0),r}fixCompositionDOM(e){let n=(o,s)=>{s.flags|=8|(s.children.some(l=>l.flags&7)?1:0),this.markedForComposition.add(s);let a=He.get(o);a&&a!=s&&(a.dom=null),s.setDOM(o)},r=this.childPos(e.range.fromB,1),i=this.children[r.i];n(e.line,i);for(let o=e.marks.length-1;o>=-1;o--)r=i.childPos(r.off,1),i=i.children[r.i],n(o>=0?e.marks[o].node:e.text,i)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,i=r==this.dom,o=!i&&!(this.view.state.facet(Hn)||this.dom.tabIndex>-1)&&ka(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(i||n||o))return;let s=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,l=this.moveToLine(this.domAtPos(a.anchor)),c=a.empty?l:this.moveToLine(this.domAtPos(a.head));if(me.gecko&&a.empty&&!this.hasComposition&&jT(l)){let h=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(h,l.node.childNodes[l.offset]||null)),l=c=new yt(h,0),s=!0}let d=this.view.observer.selectionRange;(s||!d.focusNode||(!Oo(l.node,l.offset,d.anchorNode,d.anchorOffset)||!Oo(c.node,c.offset,d.focusNode,d.focusOffset))&&!this.suppressWidgetCursorChange(d,a))&&(this.view.observer.ignore(()=>{me.android&&me.chrome&&this.dom.contains(d.focusNode)&&BT(d.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let h=Xo(this.view.root);if(h)if(a.empty){if(me.gecko){let f=OT(l.node,l.offset);if(f&&f!=3){let m=(f==1?Lb:Nb)(l.node,l.offset);m&&(l=new yt(m.node,m.offset))}}h.collapse(l.node,l.offset),a.bidiLevel!=null&&h.caretBidiLevel!==void 0&&(h.caretBidiLevel=a.bidiLevel)}else if(h.extend){h.collapse(l.node,l.offset);try{h.extend(c.node,c.offset)}catch{}}else{let f=document.createRange();a.anchor>a.head&&([l,c]=[c,l]),f.setEnd(c.node,c.offset),f.setStart(l.node,l.offset),h.removeAllRanges(),h.addRange(f)}o&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(l,c)),this.impreciseAnchor=l.precise?null:new yt(d.anchorNode,d.anchorOffset),this.impreciseHead=c.precise?null:new yt(d.focusNode,d.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&Oo(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=Xo(e.root),{anchorNode:i,anchorOffset:o}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let s=tt.find(this,n.head);if(!s)return;let a=s.posAtStart;if(n.head==a||n.head==a+s.length)return;let l=this.coordsAt(n.head,-1),c=this.coordsAt(n.head,1);if(!l||!c||l.bottom>c.top)return;let d=this.domAtPos(n.head+n.assoc);r.collapse(d.node,d.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let h=e.observer.selectionRange;e.docView.posFromDOM(h.anchorNode,h.anchorOffset)!=n.from&&r.collapse(i,o)}moveToLine(e){let n=this.dom,r;if(e.node!=n)return e;for(let i=e.offset;!r&&i<n.childNodes.length;i++){let o=He.get(n.childNodes[i]);o instanceof tt&&(r=o.domAtPos(0))}for(let i=e.offset-1;!r&&i>=0;i--){let o=He.get(n.childNodes[i]);o instanceof tt&&(r=o.domAtPos(o.length))}return r?new yt(r.node,r.offset,!0):e}nearest(e){for(let n=e;n;){let r=He.get(n);if(r&&r.rootView==this)return r;n=n.parentNode}return null}posFromDOM(e,n){let r=this.nearest(e);if(!r)throw new RangeError("Trying to find position for a DOM position outside of the document");return r.localPosFromDOM(e,n)+r.posAtStart}domAtPos(e){let{i:n,off:r}=this.childCursor().findPos(e,-1);for(;n<this.children.length-1;){let i=this.children[n];if(r<i.length||i instanceof tt)break;n++,r=0}return this.children[n].domAtPos(r)}coordsAt(e,n){let r=null,i=0;for(let o=this.length,s=this.children.length-1;s>=0;s--){let a=this.children[s],l=o-a.breakAfter,c=l-a.length;if(l<e)break;if(c<=e&&(c<e||a.covers(-1))&&(l>e||a.covers(1))&&(!r||a instanceof tt&&!(r instanceof tt&&n>=0)))r=a,i=c;else if(r&&c==e&&l==e&&a instanceof Un&&Math.abs(n)<2){if(a.deco.startSide<0)break;s&&(r=null)}o=c}return r?r.coordsAt(e-i,n):null}coordsForChar(e){let{i:n,off:r}=this.childPos(e,1),i=this.children[n];if(!(i instanceof tt))return null;for(;i.children.length;){let{i:a,off:l}=i.childPos(r,1);for(;;a++){if(a==i.children.length)return null;if((i=i.children[a]).length)break}r=l}if(!(i instanceof ln))return null;let o=pt(i.text,r);if(o==r)return null;let s=Yr(i.dom,r,o).getClientRects();for(let a=0;a<s.length;a++){let l=s[a];if(a==s.length-1||l.top<l.bottom&&l.left<l.right)return l}return null}measureVisibleLineHeights(e){let n=[],{from:r,to:i}=e,o=this.view.contentDOM.clientWidth,s=o>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==We.LTR;for(let c=0,d=0;d<this.children.length;d++){let h=this.children[d],f=c+h.length;if(f>i)break;if(c>=r){let m=h.dom.getBoundingClientRect();if(n.push(m.height),s){let g=h.dom.lastChild,b=g?Hi(g):[];if(b.length){let v=b[b.length-1],x=l?v.right-m.left:m.right-v.left;x>a&&(a=x,this.minWidth=o,this.minWidthFrom=c,this.minWidthTo=f)}}}c=f+h.breakAfter}return n}textDirectionAt(e){let{i:n}=this.childPos(e,1);return getComputedStyle(this.children[n].dom).direction=="rtl"?We.RTL:We.LTR}measureTextSize(){for(let o of this.children)if(o instanceof tt){let s=o.measureTextSize();if(s)return s}let e=document.createElement("div"),n,r,i;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let o=Hi(e.firstChild)[0];n=e.getBoundingClientRect().height,r=o?o.width/27:7,i=o?o.height:n,e.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}childCursor(e=this.length){let n=this.children.length;return n&&(e-=this.children[--n].length),new Bb(this.children,e,n)}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,i=0;;i++){let o=i==n.viewports.length?null:n.viewports[i],s=o?o.from-1:this.length;if(s>r){let a=(n.lineBlockAt(s).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(xe.replace({widget:new mu(a),block:!0,inclusive:!0,isBlockGap:!0}).range(r,s))}if(!o)break;r=o.to+1}return xe.set(e)}updateDeco(){let e=1,n=this.view.state.facet(Qo).map(o=>(this.dynamicDecorationMap[e++]=typeof o=="function")?o(this.view):o),r=!1,i=this.view.state.facet(lv).map((o,s)=>{let a=typeof o=="function";return a&&(r=!0),a?o(this.view):o});for(i.length&&(this.dynamicDecorationMap[e++]=r,n.push(De.join(i))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;return this.decorations}scrollIntoView(e){if(e.isSnapshot){let c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(ov))try{if(c(this.view,e.range,e))return!0}catch(d){Dt(this.view.state,d,"scroll handler")}let{range:n}=e,r=this.coordsAt(n.head,n.empty?n.assoc:n.head>n.anchor?-1:1),i;if(!r)return;!n.empty&&(i=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,i.left),top:Math.min(r.top,i.top),right:Math.max(r.right,i.right),bottom:Math.max(r.bottom,i.bottom)});let o=yf(this.view),s={left:r.left-o.left,top:r.top-o.top,right:r.right+o.right,bottom:r.bottom+o.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;dT(this.view.scrollDOM,s,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,a),-a),Math.max(Math.min(e.yMargin,l),-l),this.view.textDirection==We.LTR)}}function jT(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function uv(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=Lb(n.focusNode,n.focusOffset),i=Nb(n.focusNode,n.focusOffset),o=r||i;if(i&&r&&i.node!=r.node){let a=He.get(i.node);if(!a||a instanceof ln&&a.text!=i.node.nodeValue)o=i;else if(t.docView.lastCompositionAfterCursor){let l=He.get(r.node);!l||l instanceof ln&&l.text!=r.node.nodeValue||(o=i)}}if(t.docView.lastCompositionAfterCursor=o!=r,!o)return null;let s=e-o.offset;return{from:s,to:s+o.node.nodeValue.length,node:o.node}}function DT(t,e,n){let r=uv(t,n);if(!r)return null;let{node:i,from:o,to:s}=r,a=i.nodeValue;if(/[\n\r]/.test(a)||t.state.doc.sliceString(r.from,r.to)!=a)return null;let l=e.invertedDesc,c=new Gt(l.mapPos(o),l.mapPos(s),o,s),d=[];for(let h=i.parentNode;;h=h.parentNode){let f=He.get(h);if(f instanceof Qn)d.push({node:h,deco:f.mark});else{if(f instanceof tt||h.nodeName=="DIV"&&h.parentNode==t.contentDOM)return{range:c,text:i,marks:d,line:h};if(h!=t.contentDOM)d.push({node:h,deco:new ws({inclusive:!0,attributes:wT(h),tagName:h.tagName.toLowerCase()})});else return null}}}function OT(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let LT=class{constructor(){this.changes=[]}compareRange(e,n){Aa(e,n,this.changes)}comparePoint(e,n){Aa(e,n,this.changes)}boundChange(e){Aa(e,e,this.changes)}};function NT(t,e,n){let r=new LT;return De.compare(t,e,n,r),r.changes}function BT(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function FT(t,e){let n=!1;return e&&t.iterChangedRanges((r,i)=>{r<e.to&&i>e.from&&(n=!0)}),n}function VT(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),o=e-i.from;if(i.length==0)return H.cursor(e);o==0?n=1:o==i.length&&(n=-1);let s=o,a=o;n<0?s=pt(i.text,o,!1):a=pt(i.text,o);let l=r(i.text.slice(s,a));for(;s>0;){let c=pt(i.text,s,!1);if(r(i.text.slice(c,s))!=l)break;s=c}for(;a<i.length;){let c=pt(i.text,a);if(r(i.text.slice(a,c))!=l)break;a=c}return H.range(s+i.from,a+i.from)}function _T(t,e){return e.left>t?e.left-t:Math.max(0,t-e.right)}function zT(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function Wc(t,e){return t.top<e.bottom-1&&t.bottom>e.top+1}function b1(t,e){return e<t.top?{top:e,left:t.left,right:t.right,bottom:t.bottom}:t}function v1(t,e){return e>t.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function xu(t,e,n){let r,i,o,s,a=!1,l,c,d,h;for(let g=t.firstChild;g;g=g.nextSibling){let b=Hi(g);for(let v=0;v<b.length;v++){let x=b[v];i&&Wc(i,x)&&(x=b1(v1(x,i.bottom),i.top));let y=_T(e,x),$=zT(n,x);if(y==0&&$==0)return g.nodeType==3?x1(g,e,n):xu(g,e,n);if(!r||s>$||s==$&&o>y){r=g,i=x,o=y,s=$;let k=$?n<x.top?-1:1:y?e<x.left?-1:1:0;a=!k||(k>0?v<b.length-1:v>0)}y==0?n>x.bottom&&(!d||d.bottom<x.bottom)?(l=g,d=x):n<x.top&&(!h||h.top>x.top)&&(c=g,h=x):d&&Wc(d,x)?d=v1(d,x.bottom):h&&Wc(h,x)&&(h=b1(h,x.top))}}if(d&&d.bottom>=n?(r=l,i=d):h&&h.top<=n&&(r=c,i=h),!r)return{node:t,offset:0};let f=Math.max(i.left,Math.min(i.right,e));if(r.nodeType==3)return x1(r,f,n);if(a&&r.contentEditable!="false")return xu(r,f,n);let m=Array.prototype.indexOf.call(t.childNodes,r)+(e>=(i.left+i.right)/2?1:0);return{node:t,offset:m}}function x1(t,e,n){let r=t.nodeValue.length,i=-1,o=1e9,s=0;for(let a=0;a<r;a++){let l=Yr(t,a,a+1).getClientRects();for(let c=0;c<l.length;c++){let d=l[c];if(d.top==d.bottom)continue;s||(s=e-d.left);let h=(d.top>n?d.top-n:n-d.bottom)-1;if(d.left-1<=e&&d.right+1>=e&&h<o){let f=e>=(d.left+d.right)/2,m=f;if((me.chrome||me.gecko)&&Yr(t,a).getBoundingClientRect().left==d.right&&(m=!f),h<=0)return{node:t,offset:a+(m?1:0)};i=a+(m?1:0),o=h}}}return{node:t,offset:i>-1?i:s>0?t.nodeValue.length:0}}function hv(t,e,n,r=-1){var i,o;let s=t.contentDOM.getBoundingClientRect(),a=s.top+t.viewState.paddingTop,l,{docHeight:c}=t.viewState,{x:d,y:h}=e,f=h-a;if(f<0)return 0;if(f>c)return t.state.doc.length;for(let k=t.viewState.heightOracle.textHeight/2,S=!1;l=t.elementAtHeight(f),l.type!=Rt.Text;)for(;f=r>0?l.bottom+k:l.top-k,!(f>=0&&f<=c);){if(S)return n?null:0;S=!0,r=-r}h=a+f;let m=l.from;if(m<t.viewport.from)return t.viewport.from==0?0:n?null:w1(t,s,l,d,h);if(m>t.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:n?null:w1(t,s,l,d,h);let g=t.dom.ownerDocument,b=t.root.elementFromPoint?t.root:g,v=b.elementFromPoint(d,h);v&&!t.contentDOM.contains(v)&&(v=null),v||(d=Math.max(s.left+1,Math.min(s.right-1,d)),v=b.elementFromPoint(d,h),v&&!t.contentDOM.contains(v)&&(v=null));let x,y=-1;if(v&&((i=t.docView.nearest(v))===null||i===void 0?void 0:i.isEditable)!=!1){if(g.caretPositionFromPoint){let k=g.caretPositionFromPoint(d,h);k&&({offsetNode:x,offset:y}=k)}else if(g.caretRangeFromPoint){let k=g.caretRangeFromPoint(d,h);k&&({startContainer:x,startOffset:y}=k,(!t.contentDOM.contains(x)||me.safari&&HT(x,y,d)||me.chrome&&PT(x,y,d))&&(x=void 0))}x&&(y=Math.min(Mn(x),y))}if(!x||!t.docView.dom.contains(x)){let k=tt.find(t.docView,m);if(!k)return f>l.top+l.height/2?l.to:l.from;({node:x,offset:y}=xu(k.dom,d,h))}let $=t.docView.nearest(x);if(!$)return null;if($.isWidget&&((o=$.dom)===null||o===void 0?void 0:o.nodeType)==1){let k=$.dom.getBoundingClientRect();return e.y<k.top||e.y<=k.bottom&&e.x<=(k.left+k.right)/2?$.posAtStart:$.posAtEnd}else return $.localPosFromDOM(x,y)+$.posAtStart}function w1(t,e,n,r,i){let o=Math.round((r-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let a=t.viewState.heightOracle.textHeight,l=Math.floor((i-n.top-(t.defaultLineHeight-a)*.5)/a);o+=l*t.viewState.heightOracle.lineLength}let s=t.state.sliceDoc(n.from,n.to);return n.from+ou(s,o,t.state.tabSize)}function HT(t,e,n){let r;if(t.nodeType!=3||e!=(r=t.nodeValue.length))return!1;for(let i=t.nextSibling;i;i=i.nextSibling)if(i.nodeType!=1||i.nodeName!="BR")return!1;return Yr(t,r-1,r).getBoundingClientRect().left>n}function PT(t,e,n){if(e!=0)return!1;for(let i=t;;){let o=i.parentNode;if(!o||o.nodeType!=1||o.firstChild!=i)return!1;if(o.classList.contains("cm-line"))break;i=o}let r=t.nodeType==1?t.getBoundingClientRect():Yr(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return n-r.left>5}function wu(t,e,n){let r=t.lineBlockAt(e);if(Array.isArray(r.type)){let i;for(let o of r.type){if(o.from>e)break;if(!(o.to<e)){if(o.from<e&&o.to>e)return o;(!i||o.type==Rt.Text&&(i.type!=o.type||(n<0?o.from<e:o.to>e)))&&(i=o)}}return i||r}return r}function WT(t,e,n,r){let i=wu(t,e.head,e.assoc||-1),o=!r||i.type!=Rt.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(o){let s=t.dom.getBoundingClientRect(),a=t.textDirectionAt(i.from),l=t.posAtCoords({x:n==(a==We.LTR)?s.right-1:s.left+1,y:(o.top+o.bottom)/2});if(l!=null)return H.cursor(l,n?-1:1)}return H.cursor(n?i.to:i.from,n?-1:1)}function y1(t,e,n,r){let i=t.state.doc.lineAt(e.head),o=t.bidiSpans(i),s=t.textDirectionAt(i.from);for(let a=e,l=null;;){let c=MT(i,o,s,a,n),d=Xb;if(!c){if(i.number==(n?t.state.doc.lines:1))return a;d=`
|
|
60
|
+
`,i=t.state.doc.line(i.number+(n?1:-1)),o=t.bidiSpans(i),c=t.visualLineSide(i,!n)}if(l){if(!l(d))return a}else{if(!r)return c;l=r(d)}a=c}}function qT(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return o=>{let s=r(o);return i==qe.Space&&(i=s),i==s}}function UT(t,e,n,r){let i=e.head,o=n?1:-1;if(i==(n?t.state.doc.length:0))return H.cursor(i,e.assoc);let s=e.goalColumn,a,l=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(i,e.assoc||-1),d=t.documentTop;if(c)s==null&&(s=c.left-l.left),a=o<0?c.top:c.bottom;else{let m=t.viewState.lineBlockAt(i);s==null&&(s=Math.min(l.right-l.left,t.defaultCharacterWidth*(i-m.from))),a=(o<0?m.top:m.bottom)+d}let h=l.left+s,f=r??t.viewState.heightOracle.textHeight>>1;for(let m=0;;m+=10){let g=a+(f+m)*o,b=hv(t,{x:h,y:g},!1,o);if(g<l.top||g>l.bottom||(o<0?b<i:b>i)){let v=t.docView.coordsForChar(b),x=!v||g<v.top?-1:1;return H.cursor(b,x,void 0,s)}}}function Ra(t,e,n){for(;;){let r=0;for(let i of t)i.between(e-1,e+1,(o,s,a)=>{if(e>o&&e<s){let l=r||n||(e-o<s-e?-1:1);e=l<0?o:s,r=l}});if(!r)return e}}function qc(t,e,n){let r=Ra(t.state.facet(wf).map(i=>i(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:H.cursor(r,r<n.from?1:-1)}const To="";class KT{constructor(e,n){this.points=e,this.text="",this.lineSeparator=n.facet(Me.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=To}readRange(e,n){if(!e)return this;let r=e.parentNode;for(let i=e;;){this.findPointBefore(r,i);let o=this.text.length;this.readNode(i);let s=i.nextSibling;if(s==n)break;let a=He.get(i),l=He.get(s);(a&&l?a.breakAfter:(a?a.breakAfter:Ja(i))||Ja(s)&&(i.nodeName!="BR"||i.cmIgnore)&&this.text.length>o)&&this.lineBreak(),i=s}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let o=-1,s=1,a;if(this.lineSeparator?(o=n.indexOf(this.lineSeparator,r),s=this.lineSeparator.length):(a=i.exec(n))&&(o=a.index,s=a[0].length),this.append(n.slice(r,o<0?n.length:o)),o<0)break;if(this.lineBreak(),s>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=s-1);r=o+s}}readNode(e){if(e.cmIgnore)return;let n=He.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(GT(e,r.node,r.offset)?n:0))}}function GT(t,e,n){for(;;){if(!e||n<Mn(e))return!1;if(e==t)return!0;n=Gr(e)+1,e=e.parentNode}}class C1{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class YT{constructor(e,n,r,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:o,impreciseAnchor:s}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=e.docView.domBoundsAround(n,r,0))){let a=o||s?[]:ZT(e),l=new KT(a,e.state);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=JT(a,this.bounds.from)}else{let a=e.observer.selectionRange,l=o&&o.node==a.focusNode&&o.offset==a.focusOffset||!lu(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),c=s&&s.node==a.anchorNode&&s.offset==a.anchorOffset||!lu(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),d=e.viewport;if((me.ios||me.chrome)&&e.state.selection.main.empty&&l!=c&&(d.from>0||d.to<e.state.doc.length)){let h=Math.min(l,c),f=Math.max(l,c),m=d.from-h,g=d.to-f;(m==0||m==1||h==0)&&(g==0||g==-1||f==e.state.doc.length)&&(l=0,c=e.state.doc.length)}this.newSel=H.single(c,l)}}}function fv(t,e){let n,{newSel:r}=e,i=t.state.selection.main,o=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:s,to:a}=e.bounds,l=i.from,c=null;(o===8||me.android&&e.text.length<a-s)&&(l=i.to,c="end");let d=QT(t.state.doc.sliceString(s,a,To),e.text,l-s,c);d&&(me.chrome&&o==13&&d.toB==d.from+2&&e.text.slice(d.from,d.toB)==To+To&&d.toB--,n={from:s+d.from,to:s+d.toA,insert:Oe.of(e.text.slice(d.from,d.toB).split(To))})}else r&&(!t.hasFocus&&t.state.facet(Hn)||r.main.eq(i))&&(r=null);if(!n&&!r)return!1;if(!n&&e.typeOver&&!i.empty&&r&&r.main.empty?n={from:i.from,to:i.to,insert:t.state.doc.slice(i.from,i.to)}:(me.mac||me.android)&&n&&n.from==n.to&&n.from==i.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=H.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:Oe.of([n.insert.toString().replace("."," ")])}):n&&n.from>=i.from&&n.to<=i.to&&(n.from!=i.from||n.to!=i.to)&&i.to-i.from-(n.to-n.from)<=4?n={from:i.from,to:i.to,insert:t.state.doc.slice(i.from,n.from).append(n.insert).append(t.state.doc.slice(n.to,i.to))}:me.chrome&&n&&n.from==n.to&&n.from==i.head&&n.insert.toString()==`
|
|
61
|
+
`&&t.lineWrapping&&(r&&(r=H.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:Oe.of([" "])}),n)return Cf(t,n,r,o);if(r&&!r.main.eq(i)){let s=!1,a="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(s=!0),a=t.inputState.lastSelectionOrigin),t.dispatch({selection:r,scrollIntoView:s,userEvent:a}),!0}else return!1}function Cf(t,e,n,r=-1){if(me.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(me.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&t.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Ti(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>i.head)&&Ti(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&Ti(t.contentDOM,"Delete",46)))return!0;let o=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let s,a=()=>s||(s=XT(t,e,n));return t.state.facet(tv).some(l=>l(t,e.from,e.to,o,a))||t.dispatch(a()),!0}function XT(t,e,n){let r,i=t.state,o=i.selection.main;if(e.from>=o.from&&e.to<=o.to&&e.to-e.from>=(o.to-o.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let a=o.from<e.from?i.sliceDoc(o.from,e.from):"",l=o.to>e.to?i.sliceDoc(e.to,o.to):"";r=i.replaceSelection(t.state.toText(a+e.insert.sliceString(0,void 0,t.state.lineBreak)+l))}else{let a=i.changes(e),l=n&&n.main.to<=a.newLength?n.main:void 0;if(i.selection.ranges.length>1&&t.inputState.composing>=0&&e.to<=o.to&&e.to>=o.to-10){let c=t.state.sliceDoc(e.from,e.to),d,h=n&&uv(t,n.main.head);if(h){let g=e.insert.length-(e.to-e.from);d={from:h.from,to:h.to-g}}else d=t.state.doc.lineAt(o.head);let f=o.to-e.to,m=o.to-o.from;r=i.changeByRange(g=>{if(g.from==o.from&&g.to==o.to)return{changes:a,range:l||g.map(a)};let b=g.to-f,v=b-c.length;if(g.to-g.from!=m||t.state.sliceDoc(v,b)!=c||g.to>=d.from&&g.from<=d.to)return{range:g};let x=i.changes({from:v,to:b,insert:e.insert}),y=g.to-o.to;return{changes:x,range:l?H.range(Math.max(0,l.anchor+y),Math.max(0,l.head+y)):g.map(x)}})}else r={changes:a,selection:l&&i.selection.replaceRange(l)}}let s="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,s+=".compose",t.inputState.compositionFirstChange&&(s+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function QT(t,e,n,r){let i=Math.min(t.length,e.length),o=0;for(;o<i&&t.charCodeAt(o)==e.charCodeAt(o);)o++;if(o==i&&t.length==e.length)return null;let s=t.length,a=e.length;for(;s>0&&a>0&&t.charCodeAt(s-1)==e.charCodeAt(a-1);)s--,a--;if(r=="end"){let l=Math.max(0,o-Math.min(s,a));n-=s+l-o}if(s<o&&t.length<e.length){let l=n<=o&&n>=s?o-n:0;o-=l,a=o+(a-s),s=o}else if(a<o){let l=n<=o&&n>=a?o-n:0;o-=l,s=o+(s-a),a=o}return{from:o,toA:s,toB:a}}function ZT(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}=t.observer.selectionRange;return n&&(e.push(new C1(n,r)),(i!=n||o!=r)&&e.push(new C1(i,o))),e}function JT(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?H.single(n+e,r+e):null}class eM{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,me.safari&&e.contentDOM.addEventListener("input",()=>null),me.gecko&&gM(e.contentDOM.ownerDocument)}handleEvent(e){!lM(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=tM(e),r=this.handlers,i=this.view.contentDOM;for(let o in n)if(o!="scroll"){let s=!n[o].handlers.length,a=r[o];a&&s!=!a.handlers.length&&(i.removeEventListener(o,this.handleEvent),a=null),a||i.addEventListener(o,this.handleEvent,{passive:s})}for(let o in r)o!="scroll"&&!n[o]&&i.removeEventListener(o,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&pv.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),me.android&&me.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return me.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=mv.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||nM.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Ti(this.view.contentDOM,n.key,n.keyCode,n instanceof KeyboardEvent?n:void 0))}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:me.safari&&!me.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function $1(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){Dt(n.state,i)}}}function tM(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let i=r.spec;if(i&&i.domEventHandlers)for(let o in i.domEventHandlers){let s=i.domEventHandlers[o];s&&n(o).handlers.push($1(r.value,s))}if(i&&i.domEventObservers)for(let o in i.domEventObservers){let s=i.domEventObservers[o];s&&n(o).observers.push($1(r.value,s))}}for(let r in cn)n(r).handlers.push(cn[r]);for(let r in Yt)n(r).observers.push(Yt[r]);return e}const mv=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],nM="dthko",pv=[16,17,18,20,91,92,224,225],na=6;function ra(t){return Math.max(0,t)*.7+8}function rM(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class iM{constructor(e,n,r,i){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=uT(e.contentDOM),this.atoms=e.state.facet(wf).map(s=>s(e));let o=e.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(Me.allowMultipleSelections)&&oM(e,n),this.dragging=aM(e,n)&&vv(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&rM(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,i=0,o=0,s=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:s}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=yf(this.view);e.clientX-l.left<=i+na?n=-ra(i-e.clientX):e.clientX+l.right>=s-na&&(n=ra(e.clientX-s)),e.clientY-l.top<=o+na?r=-ra(o-e.clientY):e.clientY+l.bottom>=a-na&&(r=ra(e.clientY-a)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let n=null;for(let r=0;r<e.ranges.length;r++){let i=e.ranges[r],o=null;if(i.empty){let s=Ra(this.atoms,i.from,0);s!=i.from&&(o=H.cursor(s,-1))}else{let s=Ra(this.atoms,i.from,-1),a=Ra(this.atoms,i.to,1);(s!=i.from||a!=i.to)&&(o=H.range(i.from==i.anchor?s:a,i.from==i.head?s:a))}o&&(n||(n=e.ranges.slice()),n[r]=o)}return n?H.create(n,e.mainIndex):e}select(e){let{view:n}=this,r=this.skipAtoms(this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function oM(t,e){let n=t.state.facet(Qb);return n.length?n[0](e):me.mac?e.metaKey:e.ctrlKey}function sM(t,e){let n=t.state.facet(Zb);return n.length?n[0](e):me.mac?!e.altKey:!e.ctrlKey}function aM(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=Xo(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let o=0;o<i.length;o++){let s=i[o];if(s.left<=e.clientX&&s.right>=e.clientX&&s.top<=e.clientY&&s.bottom>=e.clientY)return!0}return!1}function lM(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=He.get(n))&&r.ignoreEvent(e))return!1;return!0}const cn=Object.create(null),Yt=Object.create(null),gv=me.ie&&me.ie_version<15||me.ios&&me.webkit_version<604;function cM(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),bv(t,n.value)},50)}function Zl(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function bv(t,e){e=Zl(t.state,bf,e);let{state:n}=t,r,i=1,o=n.toText(e),s=o.lines==n.selection.ranges.length;if(yu!=null&&n.selection.ranges.every(l=>l.empty)&&yu==o.toString()){let l=-1;r=n.changeByRange(c=>{let d=n.doc.lineAt(c.from);if(d.from==l)return{range:c};l=d.from;let h=n.toText((s?o.line(i++).text:e)+n.lineBreak);return{changes:{from:d.from,insert:h},range:H.cursor(c.from+h.length)}})}else s?r=n.changeByRange(l=>{let c=o.line(i++);return{changes:{from:l.from,to:l.to,insert:c.text},range:H.cursor(l.from+c.length)}}):r=n.replaceSelection(o);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}Yt.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};cn.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);Yt.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};Yt.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};cn.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(Jb))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=hM(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new iM(t,e,n,r)),r&&t.observer.ignore(()=>{jb(t.contentDOM);let o=t.root.activeElement;o&&!o.contains(t.contentDOM)&&o.blur()});let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}return!1};function S1(t,e,n,r){if(r==1)return H.cursor(e,n);if(r==2)return VT(t.state,e,n);{let i=tt.find(t.docView,e),o=t.state.doc.lineAt(i?i.posAtEnd:e),s=i?i.posAtStart:o.from,a=i?i.posAtEnd:o.to;return a<t.state.doc.length&&a==o.to&&a++,H.range(s,a)}}let k1=(t,e,n)=>e>=n.top&&e<=n.bottom&&t>=n.left&&t<=n.right;function dM(t,e,n,r){let i=tt.find(t.docView,e);if(!i)return 1;let o=e-i.posAtStart;if(o==0)return 1;if(o==i.length)return-1;let s=i.coordsAt(o,-1);if(s&&k1(n,r,s))return-1;let a=i.coordsAt(o,1);return a&&k1(n,r,a)?1:s&&s.bottom>=r?-1:1}function A1(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:n,bias:dM(t,n,e.clientX,e.clientY)}}const uM=me.ie&&me.ie_version<=11;let R1=null,T1=0,M1=0;function vv(t){if(!uM)return t.detail;let e=R1,n=M1;return R1=t,M1=Date.now(),T1=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(T1+1)%3:1}function hM(t,e){let n=A1(t,e),r=vv(e),i=t.state.selection;return{update(o){o.docChanged&&(n.pos=o.changes.mapPos(n.pos),i=i.map(o.changes))},get(o,s,a){let l=A1(t,o),c,d=S1(t,l.pos,l.bias,r);if(n.pos!=l.pos&&!s){let h=S1(t,n.pos,n.bias,r),f=Math.min(h.from,d.from),m=Math.max(h.to,d.to);d=f<d.from?H.range(f,m):H.range(m,f)}return s?i.replaceRange(i.main.extend(d.from,d.to)):a&&r==1&&i.ranges.length>1&&(c=fM(i,l.pos))?c:a?i.addRange(d):H.create([d])}}}function fM(t,e){for(let n=0;n<t.ranges.length;n++){let{from:r,to:i}=t.ranges[n];if(r<=e&&i>=e)return H.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}cn.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let i=t.docView.nearest(e.target);if(i&&i.isWidget){let o=i.posAtStart,s=o+i.length;(o>=n.to||s<=n.from)&&(n=H.range(o,s))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",Zl(t.state,vf,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};cn.dragend=t=>(t.inputState.draggedContent=null,!1);function E1(t,e,n,r){if(n=Zl(t.state,bf,n),!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:o}=t.inputState,s=r&&o&&sM(t,e)?{from:o.from,to:o.to}:null,a={from:i,insert:n},l=t.state.changes(s?[s,a]:a);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:s?"move.drop":"input.drop"}),t.inputState.draggedContent=null}cn.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,o=()=>{++i==n.length&&E1(t,e,r.filter(s=>s!=null).join(t.state.lineBreak),!1)};for(let s=0;s<n.length;s++){let a=new FileReader;a.onerror=o,a.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(r[s]=a.result),o()},a.readAsText(n[s])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return E1(t,e,r,!0),!0}return!1};cn.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=gv?null:e.clipboardData;return n?(bv(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(cM(t),!1)};function mM(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function pM(t){let e=[],n=[],r=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),n.push(i));if(!e.length){let i=-1;for(let{from:o}of t.selection.ranges){let s=t.doc.lineAt(o);s.number>i&&(e.push(s.text),n.push({from:s.from,to:Math.min(t.doc.length,s.to+1)})),i=s.number}r=!0}return{text:Zl(t,vf,e.join(t.lineBreak)),ranges:n,linewise:r}}let yu=null;cn.copy=cn.cut=(t,e)=>{let{text:n,ranges:r,linewise:i}=pM(t.state);if(!n&&!i)return!1;yu=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let o=gv?null:e.clipboardData;return o?(o.clearData(),o.setData("text/plain",n),!0):(mM(t,n),!1)};const xv=On.define();function wv(t,e){let n=[];for(let r of t.facet(nv)){let i=r(t,e);i&&n.push(i)}return n.length?t.update({effects:n,annotations:xv.of(!0)}):null}function yv(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=wv(t.state,e);n?t.dispatch(n):t.update([])}},10)}Yt.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),yv(t)};Yt.blur=t=>{t.observer.clearSelectionRange(),yv(t)};Yt.compositionstart=Yt.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};Yt.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,me.chrome&&me.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};Yt.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};cn.beforeinput=(t,e)=>{var n,r;if(e.inputType=="insertReplacementText"&&t.observer.editContext){let o=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),s=e.getTargetRanges();if(o&&s.length){let a=s[0],l=t.posAtDOM(a.startContainer,a.startOffset),c=t.posAtDOM(a.endContainer,a.endOffset);return Cf(t,{from:l,to:c,insert:t.state.toText(o)},null),!0}}let i;if(me.chrome&&me.android&&(i=mv.find(o=>o.inputType==e.inputType))&&(t.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let o=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var s;(((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0)>o+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return me.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),me.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>Yt.compositionend(t,e),20),!1};const I1=new Set;function gM(t){I1.has(t)||(I1.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const j1=["pre-wrap","normal","pre-line","break-spaces"];let qi=!1;function D1(){qi=!1}class bM{constructor(e){this.lineWrapping=e,this.doc=Oe.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return j1.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];i<0?r++:this.heightSamples[Math.floor(i*10)]||(n=!0,this.heightSamples[Math.floor(i*10)]=!0)}return n}refresh(e,n,r,i,o,s){let a=j1.indexOf(e)>-1,l=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=o,l){this.heightSamples={};for(let c=0;c<s.length;c++){let d=s[c];d<0?c++:this.heightSamples[Math.floor(d*10)]=!0}}return l}}class vM{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class wn{constructor(e,n,r,i,o){this.from=e,this.length=n,this.top=r,this.height=i,this._content=o}get type(){return typeof this._content=="number"?Rt.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof yr?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new wn(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var Pe=function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t}(Pe||(Pe={}));const Ta=.001;class Tt{constructor(e,n,r=2){this.length=e,this.height=n,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Ta&&(qi=!0),this.height=e)}replace(e,n,r){return Tt.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let o=this,s=r.doc;for(let a=i.length-1;a>=0;a--){let{fromA:l,toA:c,fromB:d,toB:h}=i[a],f=o.lineAt(l,Pe.ByPosNoHeight,r.setDoc(n),0,0),m=f.to>=c?f:o.lineAt(c,Pe.ByPosNoHeight,r,0,0);for(h+=m.to-c,c=m.to;a>0&&f.from<=i[a-1].toA;)l=i[a-1].fromA,d=i[a-1].fromB,a--,l<f.from&&(f=o.lineAt(l,Pe.ByPosNoHeight,r,0,0));d+=f.from-l,l=f.from;let g=$f.build(r.setDoc(s),e,d,h);o=nl(o,o.replace(l,c,g))}return o.updateHeight(r,0)}static empty(){return new zt(0,0)}static of(e){if(e.length==1)return e[0];let n=0,r=e.length,i=0,o=0;for(;;)if(n==r)if(i>o*2){let a=e[n-1];a.break?e.splice(--n,1,a.left,null,a.right):e.splice(--n,1,a.left,a.right),r+=1+a.break,i-=a.size}else if(o>i*2){let a=e[r];a.break?e.splice(r,1,a.left,null,a.right):e.splice(r,1,a.left,a.right),r+=2+a.break,o-=a.size}else break;else if(i<o){let a=e[n++];a&&(i+=a.size)}else{let a=e[--r];a&&(o+=a.size)}let s=0;return e[n-1]==null?(s=1,n--):e[n]==null&&(s=1,r++),new xM(Tt.of(e.slice(0,n)),s,Tt.of(e.slice(r)))}}function nl(t,e){return t==e?t:(t.constructor!=e.constructor&&(qi=!0),e)}Tt.prototype.size=1;class Cv extends Tt{constructor(e,n,r){super(e,n),this.deco=r}blockAt(e,n,r,i){return new wn(i,this.length,r,this.height,this.deco||0)}lineAt(e,n,r,i,o){return this.blockAt(0,r,i,o)}forEachLine(e,n,r,i,o,s){e<=o+this.length&&n>=o&&s(this.blockAt(0,r,i,o))}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setHeight(i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class zt extends Cv{constructor(e,n){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,n,r,i){return new wn(i,this.length,r,this.height,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof zt||i instanceof ht&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof ht?i=new zt(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):Tt.of(r)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setHeight(i.heights[i.index++]):(r||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class ht extends Tt{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,i=e.doc.lineAt(n+this.length).number,o=i-r+1,s,a=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*o);s=l/o,this.length>o+1&&(a=(this.height-l)/(this.length-o-1))}else s=this.height/o;return{firstLine:r,lastLine:i,perLine:s,perChar:a}}blockAt(e,n,r,i){let{firstLine:o,lastLine:s,perLine:a,perChar:l}=this.heightMetrics(n,i);if(n.lineWrapping){let c=i+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),d=n.doc.lineAt(c),h=a+d.length*l,f=Math.max(r,e-h/2);return new wn(d.from,d.length,f,h,0)}else{let c=Math.max(0,Math.min(s-o,Math.floor((e-r)/a))),{from:d,length:h}=n.doc.line(o+c);return new wn(d,h,r+a*c,a,0)}}lineAt(e,n,r,i,o){if(n==Pe.ByHeight)return this.blockAt(e,r,i,o);if(n==Pe.ByPosNoHeight){let{from:m,to:g}=r.doc.lineAt(e);return new wn(m,g-m,0,0,0)}let{firstLine:s,perLine:a,perChar:l}=this.heightMetrics(r,o),c=r.doc.lineAt(e),d=a+c.length*l,h=c.number-s,f=i+a*h+l*(c.from-o-h);return new wn(c.from,c.length,Math.max(i,Math.min(f,i+this.height-d)),d,0)}forEachLine(e,n,r,i,o,s){e=Math.max(e,o),n=Math.min(n,o+this.length);let{firstLine:a,perLine:l,perChar:c}=this.heightMetrics(r,o);for(let d=e,h=i;d<=n;){let f=r.doc.lineAt(d);if(d==e){let g=f.number-a;h+=l*g+c*(e-o-g)}let m=l+c*f.length;s(new wn(f.from,f.length,h,m,0)),h+=m,d=f.to+1}}replace(e,n,r){let i=this.length-n;if(i>0){let o=r[r.length-1];o instanceof ht?r[r.length-1]=new ht(o.length+i):r.push(null,new ht(i-1))}if(e>0){let o=r[0];o instanceof ht?r[0]=new ht(e+o.length):r.unshift(new ht(e-1),null)}return Tt.of(r)}decomposeLeft(e,n){n.push(new ht(e-1),null)}decomposeRight(e,n){n.push(null,new ht(this.length-e-1))}updateHeight(e,n=0,r=!1,i){let o=n+this.length;if(i&&i.from<=n+this.length&&i.more){let s=[],a=Math.max(n,i.from),l=-1;for(i.from>n&&s.push(new ht(i.from-n-1).updateHeight(e,n));a<=o&&i.more;){let d=e.doc.lineAt(a).length;s.length&&s.push(null);let h=i.heights[i.index++];l==-1?l=h:Math.abs(h-l)>=Ta&&(l=-2);let f=new zt(d,h);f.outdated=!1,s.push(f),a+=d+1}a<=o&&s.push(null,new ht(o-a).updateHeight(e,a));let c=Tt.of(s);return(l<0||Math.abs(c.height-this.height)>=Ta||Math.abs(l-this.heightMetrics(e,n).perLine)>=Ta)&&(qi=!0),nl(this,c)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class xM extends Tt{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,i){let o=r+this.left.height;return e<o?this.left.blockAt(e,n,r,i):this.right.blockAt(e,n,o,i+this.left.length+this.break)}lineAt(e,n,r,i,o){let s=i+this.left.height,a=o+this.left.length+this.break,l=n==Pe.ByHeight?e<s:e<a,c=l?this.left.lineAt(e,n,r,i,o):this.right.lineAt(e,n,r,s,a);if(this.break||(l?c.to<a:c.from>a))return c;let d=n==Pe.ByPosNoHeight?Pe.ByPosNoHeight:Pe.ByPos;return l?c.join(this.right.lineAt(a,d,r,s,a)):this.left.lineAt(a,d,r,i,o).join(c)}forEachLine(e,n,r,i,o,s){let a=i+this.left.height,l=o+this.left.length+this.break;if(this.break)e<l&&this.left.forEachLine(e,n,r,i,o,s),n>=l&&this.right.forEachLine(e,n,r,a,l,s);else{let c=this.lineAt(l,Pe.ByPos,r,i,o);e<c.from&&this.left.forEachLine(e,c.from-1,r,i,o,s),c.to>=e&&c.from<=n&&s(c),n>c.to&&this.right.forEachLine(c.to+1,n,r,a,l,s)}}replace(e,n,r){let i=this.left.length+this.break;if(n<i)return this.balanced(this.left.replace(e,n,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,n-i,r));let o=[];e>0&&this.decomposeLeft(e,o);let s=o.length;for(let a of r)o.push(a);if(e>0&&O1(o,s-1),n<this.length){let a=o.length;this.decomposeRight(n,o),O1(o,a)}return Tt.of(o)}decomposeLeft(e,n){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(r++,e>=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,n);e<r&&this.left.decomposeRight(e,n),this.break&&e<i&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?Tt.of(this.break?[e,null,n]:[e,n]):(this.left=nl(this.left,e),this.right=nl(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,i){let{left:o,right:s}=this,a=n+o.length+this.break,l=null;return i&&i.from<=n+o.length&&i.more?l=o=o.updateHeight(e,n,r,i):o.updateHeight(e,n,r),i&&i.from<=a+s.length&&i.more?l=s=s.updateHeight(e,a,r,i):s.updateHeight(e,a,r),l?this.balanced(o,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function O1(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof ht&&(r=t[e+1])instanceof ht&&t.splice(e-1,3,new ht(n.length+1+r.length))}const wM=5;class $f{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof zt?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new zt(r-this.pos,-1)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e<n||r.heightRelevant){let i=r.widget?r.widget.estimatedHeight:0,o=r.widget?r.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let s=n-e;r.block?this.addBlock(new Cv(s,i,r)):(s||o||i>=wM)&&this.addLineDeco(i,o,s)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new zt(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,n){let r=new ht(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof zt)return e;let n=new zt(0,-1);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof zt)&&!this.isCovered?this.nodes.push(new zt(0,-1)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let i of this.nodes)i instanceof zt&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(e,n,r,i){let o=new $f(r,e);return De.spans(n,r,i,o,0),o.finish(r)}}function yM(t,e,n){let r=new CM;return De.compare(t,e,n,r,0),r.changes}class CM{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,r,i){(e<n||r&&r.heightRelevant||i&&i.heightRelevant)&&Aa(e,n,this.changes,5)}}function $M(t,e){let n=t.getBoundingClientRect(),r=t.ownerDocument,i=r.defaultView||window,o=Math.max(0,n.left),s=Math.min(i.innerWidth,n.right),a=Math.max(0,n.top),l=Math.min(i.innerHeight,n.bottom);for(let c=t.parentNode;c&&c!=r.body;)if(c.nodeType==1){let d=c,h=window.getComputedStyle(d);if((d.scrollHeight>d.clientHeight||d.scrollWidth>d.clientWidth)&&h.overflow!="visible"){let f=d.getBoundingClientRect();o=Math.max(o,f.left),s=Math.min(s,f.right),a=Math.max(a,f.top),l=Math.min(c==t.parentNode?i.innerHeight:l,f.bottom)}c=h.position=="absolute"||h.position=="fixed"?d.offsetParent:d.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:o-n.left,right:Math.max(o,s)-n.left,top:a-(n.top+e),bottom:Math.max(a,l)-(n.top+e)}}function SM(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}function kM(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class Uc{constructor(e,n,r,i){this.from=e,this.to=n,this.size=r,this.displaySize=i}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],o=n[r];if(i.from!=o.from||i.to!=o.to||i.size!=o.size)return!1}return!0}draw(e,n){return xe.replace({widget:new AM(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class AM extends ir{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class L1{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=N1,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=We.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=e.facet(xf).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new bM(n),this.stateDeco=e.facet(Qo).filter(r=>typeof r!="function"),this.heightMap=Tt.empty().applyChanges(this.stateDeco,Oe.empty,this.heightOracle.setDoc(e.doc),[new Gt(0,0,0,e.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=xe.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!e.some(({from:o,to:s})=>i>=o&&i<=s)){let{from:o,to:s}=this.lineBlockAt(i);e.push(new ia(o,s))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?N1:new Sf(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Mo(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(Qo).filter(d=>typeof d!="function");let i=e.changedRanges,o=Gt.extendWithRanges(i,yM(r,this.stateDeco,e?e.changes:ot.empty(this.state.doc.length))),s=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);D1(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=s||qi)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=s);let l=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<l.from||n.range.head>l.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,n));let c=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(iv)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,o=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?We.RTL:We.LTR;let s=this.heightOracle.mustRefreshForWrapping(o),a=n.getBoundingClientRect(),l=s||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let c=0,d=0;if(a.width&&a.height){let{scaleX:k,scaleY:S}=Ib(n,a);(k>.005&&Math.abs(this.scaleX-k)>.005||S>.005&&Math.abs(this.scaleY-S)>.005)&&(this.scaleX=k,this.scaleY=S,c|=16,s=l=!0)}let h=(parseInt(r.paddingTop)||0)*this.scaleY,f=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=h||this.paddingBottom!=f)&&(this.paddingTop=h,this.paddingBottom=f,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let m=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=m&&(this.scrollAnchorHeight=-1,this.scrollTop=m),this.scrolledToBottom=Ob(e.scrollDOM);let g=(this.printing?kM:$M)(n,this.paddingTop),b=g.top-this.pixelViewport.top,v=g.bottom-this.pixelViewport.bottom;this.pixelViewport=g;let x=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(x!=this.inView&&(this.inView=x,x&&(l=!0)),!this.inView&&!this.scrollTarget&&!SM(e.dom))return 0;let y=a.width;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),l){let k=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(k)&&(s=!0),s||i.lineWrapping&&Math.abs(y-this.contentDOMWidth)>i.charWidth){let{lineHeight:S,charWidth:R,textHeight:A}=e.docView.measureTextSize();s=S>0&&i.refresh(o,S,R,A,y/R,k),s&&(e.docView.minWidth=0,c|=16)}b>0&&v>0?d=Math.max(b,v):b<0&&v<0&&(d=Math.min(b,v)),D1();for(let S of this.viewports){let R=S.from==this.viewport.from?k:e.docView.measureVisibleLineHeights(S);this.heightMap=(s?Tt.empty().applyChanges(this.stateDeco,Oe.empty,this.heightOracle,[new Gt(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,s,new vM(S.from,R))}qi&&(c|=2)}let $=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return $&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),c|=this.updateForViewport()),(c&2||$)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,o=this.heightOracle,{visibleTop:s,visibleBottom:a}=this,l=new ia(i.lineAt(s-r*1e3,Pe.ByHeight,o,0,0).from,i.lineAt(a+(1-r)*1e3,Pe.ByHeight,o,0,0).to);if(n){let{head:c}=n.range;if(c<l.from||c>l.to){let d=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),h=i.lineAt(c,Pe.ByPos,o,0,0),f;n.y=="center"?f=(h.top+h.bottom)/2-d/2:n.y=="start"||n.y=="nearest"&&c<l.from?f=h.top:f=h.bottom-d,l=new ia(i.lineAt(f-1e3/2,Pe.ByHeight,o,0,0).from,i.lineAt(f+d+1e3/2,Pe.ByHeight,o,0,0).to)}}return l}mapViewport(e,n){let r=n.mapPos(e.from,-1),i=n.mapPos(e.to,1);return new ia(this.heightMap.lineAt(r,Pe.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,Pe.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},r=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,Pe.ByPos,this.heightOracle,0,0),{bottom:o}=this.heightMap.lineAt(n,Pe.ByPos,this.heightOracle,0,0),{visibleTop:s,visibleBottom:a}=this;return(e==0||i<=s-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||o>=a+Math.max(10,Math.min(r,250)))&&i>s-2*1e3&&o<a+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let r=[];for(let i of e)n.touchesRange(i.from,i.to)||r.push(new Uc(n.mapPos(i.from),n.mapPos(i.to),i.size,i.displaySize));return r}ensureLineGaps(e,n){let r=this.heightOracle.lineWrapping,i=r?1e4:2e3,o=i>>1,s=i<<1;if(this.defaultTextDirection!=We.LTR&&!r)return[];let a=[],l=(d,h,f,m)=>{if(h-d<o)return;let g=this.state.selection.main,b=[g.from];g.empty||b.push(g.to);for(let x of b)if(x>d&&x<h){l(d,x-10,f,m),l(x+10,h,f,m);return}let v=TM(e,x=>x.from>=f.from&&x.to<=f.to&&Math.abs(x.from-d)<o&&Math.abs(x.to-h)<o&&!b.some(y=>x.from<y&&x.to>y));if(!v){if(h<f.to&&n&&r&&n.visibleRanges.some($=>$.from<=h&&$.to>=h)){let $=n.moveToLineBoundary(H.cursor(h),!1,!0).head;$>d&&(h=$)}let x=this.gapSize(f,d,h,m),y=r||x<2e6?x:2e6;v=new Uc(d,h,x,y)}a.push(v)},c=d=>{if(d.length<s||d.type!=Rt.Text)return;let h=RM(d.from,d.to,this.stateDeco);if(h.total<s)return;let f=this.scrollTarget?this.scrollTarget.range.head:null,m,g;if(r){let b=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,v,x;if(f!=null){let y=sa(h,f),$=((this.visibleBottom-this.visibleTop)/2+b)/d.height;v=y-$,x=y+$}else v=(this.visibleTop-d.top-b)/d.height,x=(this.visibleBottom-d.top+b)/d.height;m=oa(h,v),g=oa(h,x)}else{let b=h.total*this.heightOracle.charWidth,v=i*this.heightOracle.charWidth,x=0;if(b>2e6)for(let R of e)R.from>=d.from&&R.from<d.to&&R.size!=R.displaySize&&R.from*this.heightOracle.charWidth+x<this.pixelViewport.left&&(x=R.size-R.displaySize);let y=this.pixelViewport.left+x,$=this.pixelViewport.right+x,k,S;if(f!=null){let R=sa(h,f),A=(($-y)/2+v)/b;k=R-A,S=R+A}else k=(y-v)/b,S=($+v)/b;m=oa(h,k),g=oa(h,S)}m>d.from&&l(d.from,m,d,h),g<d.to&&l(g,d.to,d,h)};for(let d of this.viewportLines)Array.isArray(d.type)?d.type.forEach(c):c(d);return a}gapSize(e,n,r,i){let o=sa(i,r)-sa(i,n);return this.heightOracle.lineWrapping?e.height*o:i.total*this.heightOracle.charWidth*o}updateLineGaps(e){Uc.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=xe.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];De.spans(n,this.viewport.from,this.viewport.to,{span(o,s){r.push({from:o,to:s})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let o=0;o<r.length&&!(i&8);o++){let s=this.visibleRanges[o],a=r[o];(s.from!=a.from||s.to!=a.to)&&(i|=4,e&&e.mapPos(s.from,-1)==a.from&&e.mapPos(s.to,1)==a.to||(i|=8))}return this.visibleRanges=r,i}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||Mo(this.heightMap.lineAt(e,Pe.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||Mo(this.heightMap.lineAt(this.scaler.fromDOM(e),Pe.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return Mo(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}let ia=class{constructor(e,n){this.from=e,this.to=n}};function RM(t,e,n){let r=[],i=t,o=0;return De.spans(n,t,e,{span(){},point(s,a){s>i&&(r.push({from:i,to:s}),o+=s-i),i=a}},20),i<e&&(r.push({from:i,to:e}),o+=e-i),{total:o,ranges:r}}function oa({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let i=0;;i++){let{from:o,to:s}=e[i],a=s-o;if(r<=a)return o+r;r-=a}}function sa(t,e){let n=0;for(let{from:r,to:i}of t.ranges){if(e<=i){n+=e-r;break}n+=i-r}return n/t.total}function TM(t,e){for(let n of t)if(e(n))return n}const N1={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};class Sf{constructor(e,n,r){let i=0,o=0,s=0;this.viewports=r.map(({from:a,to:l})=>{let c=n.lineAt(a,Pe.ByPos,e,0,0).top,d=n.lineAt(l,Pe.ByPos,e,0,0).bottom;return i+=d-c,{from:a,to:l,top:c,bottom:d,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let a of this.viewports)a.domTop=s+(a.top-o)*this.scale,s=a.domBottom=a.domTop+(a.bottom-a.top),o=a.bottom}toDOM(e){for(let n=0,r=0,i=0;;n++){let o=n<this.viewports.length?this.viewports[n]:null;if(!o||e<o.top)return i+(e-r)*this.scale;if(e<=o.bottom)return o.domTop+(e-o.top);r=o.bottom,i=o.domBottom}}fromDOM(e){for(let n=0,r=0,i=0;;n++){let o=n<this.viewports.length?this.viewports[n]:null;if(!o||e<o.domTop)return r+(e-i)/this.scale;if(e<=o.domBottom)return o.top+(e-o.domTop);r=o.bottom,i=o.domBottom}}eq(e){return e instanceof Sf?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,r)=>n.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function Mo(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new wn(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>Mo(i,e)):t._content)}const aa=he.define({combine:t=>t.join(" ")}),Cu=he.define({combine:t=>t.indexOf(!0)>-1}),$u=xr.newName(),$v=xr.newName(),Sv=xr.newName(),kv={"&light":"."+$v,"&dark":"."+Sv};function Su(t,e,n){return new xr(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return t;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):t+" "+r}})}const MM=Su("."+$u,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},kv),EM={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Kc=me.ie&&me.ie_version<=11;class IM{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new hT,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(me.ie&&me.ie_version<=11||me.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&e.constructor.EDIT_CONTEXT!==!1&&!(me.chrome&&me.chrome_version<126)&&(this.editContext=new DM(e),e.state.facet(Hn)&&(e.contentDOM.editContext=this.editContext.editContext)),Kc&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(Hn)?r.root.activeElement!=this.dom:!ka(this.dom,i))return;let o=i.anchorNode&&r.docView.nearest(i.anchorNode);if(o&&o.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(me.ie&&me.ie_version<=11||me.android&&me.chrome)&&!r.state.selection.main.empty&&i.focusNode&&Oo(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=Xo(e.root);if(!n)return!1;let r=me.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&jM(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=ka(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&mT(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let r=this.dom;r;)if(r.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=n)r.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,EM),Kc&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Kc&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var r;if(!this.delayedAndroidKey){let i=()=>{let o=this.delayedAndroidKey;o&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=o.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&o.force&&Ti(this.dom,o.key,o.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let o of e){let s=this.readMutation(o);s&&(s.typeOver&&(i=!0),n==-1?{from:n,to:r}=s:(n=Math.min(s.from,n),r=Math.max(s.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&ka(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new YT(this.view,e,n,r);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=fv(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!n.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),i}readMutation(e){let n=this.view.docView.nearest(e.target);if(!n||n.ignoreMutation(e))return null;if(n.markDirty(e.type=="attributes"),e.type=="attributes"&&(n.flags|=4),e.type=="childList"){let r=B1(n,e.previousSibling||e.target.previousSibling,-1),i=B1(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Hn)!=e.state.facet(Hn)&&(e.view.contentDOM.editContext=e.state.facet(Hn)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function B1(t,e,n){for(;e;){let r=He.get(e);if(r&&r.parent==t)return r;let i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function F1(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.docView.domAtPos(t.state.selection.main.anchor);return Oo(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function jM(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return F1(t,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?F1(t,n):null}class DM{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let i=e.state.selection.main,{anchor:o,head:s}=i,a=this.toEditorPos(r.updateRangeStart),l=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:a,drifted:!1});let c={from:a,to:l,insert:Oe.of(r.text.split(`
|
|
62
|
+
`))};if(c.from==this.from&&o<this.from?c.from=o:c.to==this.to&&o>this.to&&(c.to=o),c.from==c.to&&!c.insert.length){let d=H.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));d.main.eq(i)||e.dispatch({selection:d,userEvent:"select"});return}if((me.mac||me.android)&&c.from==s-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(c={from:a,to:l,insert:Oe.of([r.text.replace("."," ")])}),this.pendingContextChange=c,!e.state.readOnly){let d=this.to-this.from+(c.to-c.from+c.insert.length);Cf(e,c,H.single(this.toEditorPos(r.selectionStart,d),this.toEditorPos(r.selectionEnd,d)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state))},this.handlers.characterboundsupdate=r=>{let i=[],o=null;for(let s=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);s<a;s++){let l=e.coordsForChar(s);o=l&&new DOMRect(l.left,l.top,l.right-l.left,l.bottom-l.top)||o||new DOMRect,i.push(o)}n.updateCharacterBounds(r.rangeStart,i)},this.handlers.textformatupdate=r=>{let i=[];for(let o of r.getTextFormats()){let s=o.underlineStyle,a=o.underlineThickness;if(s!="None"&&a!="None"){let l=this.toEditorPos(o.rangeStart),c=this.toEditorPos(o.rangeEnd);if(l<c){let d=`text-decoration: underline ${s=="Dashed"?"dashed ":s=="Squiggle"?"wavy ":""}${a=="Thin"?1:2}px`;i.push(xe.mark({attributes:{style:d}}).range(l,c))}}}e.dispatch({effects:sv.of(xe.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=Xo(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((o,s,a,l,c)=>{if(r)return;let d=c.length-(s-o);if(i&&s>=i.to)if(i.from==o&&i.to==s&&i.insert.eq(c)){i=this.pendingContextChange=null,n+=d,this.to+=d;return}else i=null,this.revertPending(e.state);if(o+=n,s+=n,s<=this.from)this.from+=d,this.to+=d;else if(o<this.to){if(o<this.from||s>this.to||this.to-this.from+c.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(o),this.toContextPos(s),c.toString()),this.to+=d}n+=d}),i&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class ie{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(o=>r(o,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||fT(e.parent)||document,this.viewState=new L1(e.state||Me.create(e)),e.scrollTo&&e.scrollTo.is(ta)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Ao).map(i=>new Pc(i));for(let i of this.plugins)i.update(this);this.observer=new IM(this),this.inputState=new eM(this),this.inputState.ensureHandlers(this.plugins),this.docView=new g1(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let n=e.length==1&&e[0]instanceof st?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,o=this.state;for(let f of e){if(f.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=f.state}if(this.destroyed){this.viewState.state=o;return}let s=this.hasFocus,a=0,l=null;e.some(f=>f.annotation(xv))?(this.inputState.notifiedFocused=s,a=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,l=wv(o,s),l||(a=1));let c=this.observer.delayedAndroidKey,d=null;if(c?(this.observer.clearDelayedAndroidKey(),d=this.observer.readChange(),(d&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(d=null)):this.observer.clear(),o.facet(Me.phrases)!=this.state.facet(Me.phrases))return this.setState(o);i=tl.create(this,o,e),i.flags|=a;let h=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(h&&(h=h.map(f.changes)),f.scrollIntoView){let{main:m}=f.state.selection;h=new Mi(m.empty?m:H.cursor(m.head,m.head>m.anchor?-1:1))}for(let m of f.effects)m.is(ta)&&(h=m.value.clip(this.state))}this.viewState.update(i,h),this.bidiCache=rl.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(Ro)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(aa)!=i.state.facet(aa)&&(this.viewState.mustMeasureContent=!0),(n||r||h||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let f of this.state.facet(vu))try{f(i)}catch(m){Dt(this.state,m,"update listener")}(l||d)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),d&&!fv(this,d)&&c.force&&Ti(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new L1(e),this.plugins=e.facet(Ao).map(r=>new Pc(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new g1(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(Ao),r=e.state.facet(Ao);if(n!=r){let i=[];for(let o of r){let s=n.indexOf(o);if(s<0)i.push(new Pc(o));else{let a=this.plugins[s];a.mustUpdate=e,i.push(a)}}for(let o of this.plugins)o.mustUpdate!=e&&o.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(r){Dt(this.state,r,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.scrollDOM,i=r.scrollTop*this.scaleY,{scrollAnchorPos:o,scrollAnchorHeight:s}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(s<0)if(Ob(r))o=-1,s=this.viewState.heightMap.height;else{let m=this.viewState.scrollAnchorAt(i);o=m.from,s=m.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];l&4||([this.measureRequests,c]=[c,this.measureRequests]);let d=c.map(m=>{try{return m.read(this)}catch(g){return Dt(this.state,g),V1}}),h=tl.create(this,this.state,[]),f=!1;h.flags|=l,n?n.flags|=l:n=h,this.updateState=2,h.empty||(this.updatePlugins(h),this.inputState.update(h),this.updateAttrs(),f=this.docView.update(h),f&&this.docViewUpdate());for(let m=0;m<c.length;m++)if(d[m]!=V1)try{let g=c[m];g.write&&g.write(d[m],this)}catch(g){Dt(this.state,g)}if(f&&this.docView.updateSelection(!0),!h.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,s=-1;continue}else{let g=(o<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(o).top)-s;if(g>1||g<-1){i=i+g,r.scrollTop=i/this.scaleY,s=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let a of this.state.facet(vu))a(n)}get themeClasses(){return $u+" "+(this.state.facet(Cu)?Sv:$v)+" "+this.state.facet(aa)}updateAttrs(){let e=_1(this,av,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Hn)?"true":"false",class:"cm-content",style:`${me.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),_1(this,xf,n);let r=this.observer.ignore(()=>{let i=fu(this.contentDOM,this.contentAttrs,n),o=fu(this.dom,this.editorAttrs,e);return i||o});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let i of r.effects)if(i.is(ie.announce)){n&&(this.announceDOM.textContent=""),n=!1;let o=this.announceDOM.appendChild(document.createElement("div"));o.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(Ro);let e=this.state.facet(ie.cspNonce);xr.mount(this.root,this.styleModules.concat(MM).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.spec!=e)&&this.pluginMap.set(e,n=this.plugins.find(r=>r.spec==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return qc(this,e,y1(this,e,n,r))}moveByGroup(e,n){return qc(this,e,y1(this,e,n,r=>qT(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),o=r[n?r.length-1:0];return H.cursor(o.side(n,i)+e.from,o.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return WT(this,e,n,r)}moveVertically(e,n,r){return qc(this,e,UT(this,e,n,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){return this.readMeasured(),hv(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),o=this.bidiSpans(i),s=o[hr.find(o,e-i.from,-1,n)];return xs(r,s.dir==We.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(rv)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>OM)return Yb(e.length);let n=this.textDirectionAt(e.from),r;for(let o of this.bidiCache)if(o.from==e.from&&o.dir==n&&(o.fresh||Gb(o.isolates,r=p1(this,e))))return o.order;r||(r=p1(this,e));let i=TT(e.text,n,r);return this.bidiCache.push(new rl(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||me.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{jb(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return ta.of(new Mi(typeof e=="number"?H.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return ta.of(new Mi(H.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Je.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Je.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=xr.newName(),i=[aa.of(r),Ro.of(Su(`.${r}`,e))];return n&&n.dark&&i.push(Cu.of(!0)),i}static baseTheme(e){return si.lowest(Ro.of(Su("."+$u,e,kv)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&He.get(r)||He.get(e);return((n=i?.rootView)===null||n===void 0?void 0:n.view)||null}}ie.styleModule=Ro;ie.inputHandler=tv;ie.clipboardInputFilter=bf;ie.clipboardOutputFilter=vf;ie.scrollHandler=ov;ie.focusChangeEffect=nv;ie.perLineTextDirection=rv;ie.exceptionSink=ev;ie.updateListener=vu;ie.editable=Hn;ie.mouseSelectionStyle=Jb;ie.dragMovesSelection=Zb;ie.clickAddsSelectionRange=Qb;ie.decorations=Qo;ie.outerDecorations=lv;ie.atomicRanges=wf;ie.bidiIsolatedRanges=cv;ie.scrollMargins=dv;ie.darkTheme=Cu;ie.cspNonce=he.define({combine:t=>t.length?t[0]:""});ie.contentAttributes=xf;ie.editorAttributes=av;ie.lineWrapping=ie.contentAttributes.of({class:"cm-lineWrapping"});ie.announce=Ae.define();const OM=4096,V1={};class rl{constructor(e,n,r,i,o,s){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=o,this.order=s}static update(e,n){if(n.empty&&!e.some(o=>o.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:We.LTR;for(let o=Math.max(0,e.length-10);o<e.length;o++){let s=e[o];s.dir==i&&!n.touchesRange(s.from,s.to)&&r.push(new rl(n.mapPos(s.from,1),n.mapPos(s.to,-1),s.dir,s.isolates,!1,s.order))}return r}}function _1(t,e,n){for(let r=t.state.facet(e),i=r.length-1;i>=0;i--){let o=r[i],s=typeof o=="function"?o(t):o;s&&hu(s,n)}return n}const LM=me.mac?"mac":me.windows?"win":me.linux?"linux":"key";function NM(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,o,s,a;for(let l=0;l<n.length-1;++l){const c=n[l];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))o=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))e=="mac"?a=!0:o=!0;else throw new Error("Unrecognized modifier name: "+c)}return i&&(r="Alt-"+r),o&&(r="Ctrl-"+r),a&&(r="Meta-"+r),s&&(r="Shift-"+r),r}function la(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}const BM=si.default(ie.domEventHandlers({keydown(t,e){return Rv(Av(e.state),t,e,"editor")}})),Jl=he.define({enables:BM}),z1=new WeakMap;function Av(t){let e=t.facet(Jl),n=z1.get(e);return n||z1.set(e,n=_M(e.reduce((r,i)=>r.concat(i),[]))),n}function FM(t,e,n){return Rv(Av(t.state),e,t,n)}let lr=null;const VM=4e3;function _M(t,e=LM){let n=Object.create(null),r=Object.create(null),i=(s,a)=>{let l=r[s];if(l==null)r[s]=a;else if(l!=a)throw new Error("Key binding "+s+" is used both as a regular binding and as a multi-stroke prefix")},o=(s,a,l,c,d)=>{var h,f;let m=n[s]||(n[s]=Object.create(null)),g=a.split(/ (?!$)/).map(x=>NM(x,e));for(let x=1;x<g.length;x++){let y=g.slice(0,x).join(" ");i(y,!0),m[y]||(m[y]={preventDefault:!0,stopPropagation:!1,run:[$=>{let k=lr={view:$,prefix:y,scope:s};return setTimeout(()=>{lr==k&&(lr=null)},VM),!0}]})}let b=g.join(" ");i(b,!1);let v=m[b]||(m[b]={preventDefault:!1,stopPropagation:!1,run:((f=(h=m._any)===null||h===void 0?void 0:h.run)===null||f===void 0?void 0:f.slice())||[]});l&&v.run.push(l),c&&(v.preventDefault=!0),d&&(v.stopPropagation=!0)};for(let s of t){let a=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let c of a){let d=n[c]||(n[c]=Object.create(null));d._any||(d._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:h}=s;for(let f in d)d[f].run.push(m=>h(m,ku))}let l=s[e]||s.key;if(l)for(let c of a)o(c,l,s.run,s.preventDefault,s.stopPropagation),s.shift&&o(c,"Shift-"+l,s.shift,s.preventDefault,s.stopPropagation)}return n}let ku=null;function Rv(t,e,n,r){ku=e;let i=lT(e),o=Et(i,0),s=xn(o)==i.length&&i!=" ",a="",l=!1,c=!1,d=!1;lr&&lr.view==n&&lr.scope==r&&(a=lr.prefix+" ",pv.indexOf(e.keyCode)<0&&(c=!0,lr=null));let h=new Set,f=v=>{if(v){for(let x of v.run)if(!h.has(x)&&(h.add(x),x(n)))return v.stopPropagation&&(d=!0),!0;v.preventDefault&&(v.stopPropagation&&(d=!0),c=!0)}return!1},m=t[r],g,b;return m&&(f(m[a+la(i,e,!s)])?l=!0:s&&(e.altKey||e.metaKey||e.ctrlKey)&&!(me.windows&&e.ctrlKey&&e.altKey)&&(g=wr[e.keyCode])&&g!=i?(f(m[a+la(g,e,!0)])||e.shiftKey&&(b=Yo[e.keyCode])!=i&&b!=g&&f(m[a+la(b,e,!1)]))&&(l=!0):s&&e.shiftKey&&f(m[a+la(i,e,!0)])&&(l=!0),!l&&f(m._any)&&(l=!0)),c&&(l=!0),l&&d&&e.stopPropagation(),ku=null,l}class Cs{constructor(e,n,r,i,o){this.className=e,this.left=n,this.top=r,this.width=i,this.height=o}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,n){return n.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,n,r){if(r.empty){let i=e.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let o=Tv(e);return[new Cs(n,i.left-o.left,i.top-o.top,null,i.bottom-i.top)]}else return zM(e,n,r)}}function Tv(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==We.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function H1(t,e,n,r){let i=t.coordsAtPos(e,n*2);if(!i)return r;let o=t.dom.getBoundingClientRect(),s=(i.top+i.bottom)/2,a=t.posAtCoords({x:o.left+1,y:s}),l=t.posAtCoords({x:o.right-1,y:s});return a==null||l==null?r:{from:Math.max(r.from,Math.min(a,l)),to:Math.min(r.to,Math.max(a,l))}}function zM(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let r=Math.max(n.from,t.viewport.from),i=Math.min(n.to,t.viewport.to),o=t.textDirection==We.LTR,s=t.contentDOM,a=s.getBoundingClientRect(),l=Tv(t),c=s.querySelector(".cm-line"),d=c&&window.getComputedStyle(c),h=a.left+(d?parseInt(d.paddingLeft)+Math.min(0,parseInt(d.textIndent)):0),f=a.right-(d?parseInt(d.paddingRight):0),m=wu(t,r,1),g=wu(t,i,-1),b=m.type==Rt.Text?m:null,v=g.type==Rt.Text?g:null;if(b&&(t.lineWrapping||m.widgetLineBreaks)&&(b=H1(t,r,1,b)),v&&(t.lineWrapping||g.widgetLineBreaks)&&(v=H1(t,i,-1,v)),b&&v&&b.from==v.from&&b.to==v.to)return y($(n.from,n.to,b));{let S=b?$(n.from,null,b):k(m,!1),R=v?$(null,n.to,v):k(g,!0),A=[];return(b||m).to<(v||g).from-(b&&v?1:0)||m.widgetLineBreaks>1&&S.bottom+t.defaultLineHeight/2<R.top?A.push(x(h,S.bottom,f,R.top)):S.bottom<R.top&&t.elementAtHeight((S.bottom+R.top)/2).type==Rt.Text&&(S.bottom=R.top=(S.bottom+R.top)/2),y(S).concat(A).concat(y(R))}function x(S,R,A,I){return new Cs(e,S-l.left,R-l.top,A-S,I-R)}function y({top:S,bottom:R,horizontal:A}){let I=[];for(let E=0;E<A.length;E+=2)I.push(x(A[E],S,A[E+1],R));return I}function $(S,R,A){let I=1e9,E=-1e9,j=[];function O(V,q,J,W,K){let F=t.coordsAtPos(V,V==A.to?-2:2),Q=t.coordsAtPos(J,J==A.from?2:-2);!F||!Q||(I=Math.min(F.top,Q.top,I),E=Math.max(F.bottom,Q.bottom,E),K==We.LTR?j.push(o&&q?h:F.left,o&&W?f:Q.right):j.push(!o&&W?h:Q.left,!o&&q?f:F.right))}let D=S??A.from,B=R??A.to;for(let V of t.visibleRanges)if(V.to>D&&V.from<B)for(let q=Math.max(V.from,D),J=Math.min(V.to,B);;){let W=t.state.doc.lineAt(q);for(let K of t.bidiSpans(W)){let F=K.from+W.from,Q=K.to+W.from;if(F>=J)break;Q>q&&O(Math.max(F,q),S==null&&F<=D,Math.min(Q,J),R==null&&Q>=B,K.dir)}if(q=W.to+1,q>=J)break}return j.length==0&&O(D,S==null,B,R==null,t.textDirection),{top:I,bottom:E,horizontal:j}}function k(S,R){let A=a.top+(R?S.top:S.bottom);return{top:A,bottom:A,horizontal:[]}}}function HM(t,e){return t.constructor==e.constructor&&t.eq(e)}class PM{constructor(e,n){this.view=e,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet(Ma)!=e.state.facet(Ma)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let n=0,r=e.facet(Ma);for(;n<r.length&&r[n]!=this.layer;)n++;this.dom.style.zIndex=String((this.layer.above?150:-1)-n)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:n}=this.view;(e!=this.scaleX||n!=this.scaleY)&&(this.scaleX=e,this.scaleY=n,this.dom.style.transform=`scale(${1/e}, ${1/n})`)}draw(e){if(e.length!=this.drawn.length||e.some((n,r)=>!HM(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let i of e)i.update&&n&&i.constructor&&this.drawn[r].constructor&&i.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(i.draw(),n);for(;n;){let i=n.nextSibling;n.remove(),n=i}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Ma=he.define();function Mv(t){return[Je.define(e=>new PM(e,t)),Ma.of(t)]}const Zo=he.define({combine(t){return Ln(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function WM(t={}){return[Zo.of(t),qM,UM,KM,iv.of(!0)]}function Ev(t){return t.startState.facet(Zo)!=t.state.facet(Zo)}const qM=Mv({above:!0,markers(t){let{state:e}=t,n=e.facet(Zo),r=[];for(let i of e.selection.ranges){let o=i==e.selection.main;if(i.empty||n.drawRangeCursor){let s=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=i.empty?i:H.cursor(i.head,i.head>i.anchor?-1:1);for(let l of Cs.forRange(t,s,a))r.push(l)}}return r},update(t,e){t.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=Ev(t);return n&&P1(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){P1(e.state,t)},class:"cm-cursorLayer"});function P1(t,e){e.style.animationDuration=t.facet(Zo).cursorBlinkRate+"ms"}const UM=Mv({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:Cs.forRange(t,"cm-selectionBackground",e)).reduce((e,n)=>e.concat(n))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||Ev(t)},class:"cm-selectionLayer"}),KM=si.highest(ie.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),Iv=Ae.define({map(t,e){return t==null?null:e.mapPos(t)}}),Eo=ut.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((n,r)=>r.is(Iv)?r.value:n,t)}}),GM=Je.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let n=t.state.field(Eo);n==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(Eo)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(Eo),n=e!=null&&t.coordsAtPos(e);if(!n)return null;let r=t.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+t.scrollDOM.scrollLeft*t.scaleX,top:n.top-r.top+t.scrollDOM.scrollTop*t.scaleY,height:n.bottom-n.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:n}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/n+"px",this.cursor.style.height=t.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(Eo)!=t&&this.view.dispatch({effects:Iv.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function YM(){return[Eo,GM]}function W1(t,e,n,r,i){e.lastIndex=0;for(let o=t.iterRange(n,r),s=n,a;!o.next().done;s+=o.value.length)if(!o.lineBreak)for(;a=e.exec(o.value);)i(s+a.index,a)}function XM(t,e){let n=t.visibleRanges;if(n.length==1&&n[0].from==t.viewport.from&&n[0].to==t.viewport.to)return n;let r=[];for(let{from:i,to:o}of n)i=Math.max(t.state.doc.lineAt(i).from,i-e),o=Math.min(t.state.doc.lineAt(o).to,o+e),r.length&&r[r.length-1].to>=i?r[r.length-1].to=o:r.push({from:i,to:o});return r}class QM{constructor(e){const{regexp:n,decoration:r,decorate:i,boundary:o,maxLength:s=1e3}=e;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,i)this.addMatch=(a,l,c,d)=>i(d,c,c+a[0].length,a,l);else if(typeof r=="function")this.addMatch=(a,l,c,d)=>{let h=r(a,l,c);h&&d(c,c+a[0].length,h)};else if(r)this.addMatch=(a,l,c,d)=>d(c,c+a[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=o,this.maxLength=s}createDeco(e){let n=new Xn,r=n.add.bind(n);for(let{from:i,to:o}of XM(e,this.maxLength))W1(e.state.doc,this.regexp,i,o,(s,a)=>this.addMatch(a,e,s,r));return n.finish()}updateDeco(e,n){let r=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((o,s,a,l)=>{l>=e.view.viewport.from&&a<=e.view.viewport.to&&(r=Math.min(a,r),i=Math.max(l,i))}),e.viewportMoved||i-r>1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,n.map(e.changes),r,i):n}updateRange(e,n,r,i){for(let o of e.visibleRanges){let s=Math.max(o.from,r),a=Math.min(o.to,i);if(a>s){let l=e.state.doc.lineAt(s),c=l.to<a?e.state.doc.lineAt(a):l,d=Math.max(o.from,l.from),h=Math.min(o.to,c.to);if(this.boundary){for(;s>l.from;s--)if(this.boundary.test(l.text[s-1-l.from])){d=s;break}for(;a<c.to;a++)if(this.boundary.test(c.text[a-c.from])){h=a;break}}let f=[],m,g=(b,v,x)=>f.push(x.range(b,v));if(l==c)for(this.regexp.lastIndex=d-l.from;(m=this.regexp.exec(l.text))&&m.index<h-l.from;)this.addMatch(m,e,m.index+l.from,g);else W1(e.state.doc,this.regexp,d,h,(b,v)=>this.addMatch(v,e,b,g));n=n.update({filterFrom:d,filterTo:h,filter:(b,v)=>b<d||v>h,add:f})}}return n}}const Au=/x/.unicode!=null?"gu":"g",ZM=new RegExp(`[\0-\b
|
|
63
|
+
--\u2028\u2029\uFEFF-]`,Au),JM={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Gc=null;function eE(){var t;if(Gc==null&&typeof document<"u"&&document.body){let e=document.body.style;Gc=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return Gc||!1}const Ea=he.define({combine(t){let e=Ln(t,{render:null,specialChars:ZM,addSpecialChars:null});return(e.replaceTabs=!eE())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Au)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Au)),e}});function tE(t={}){return[Ea.of(t),nE()]}let q1=null;function nE(){return q1||(q1=Je.fromClass(class{constructor(t){this.view=t,this.decorations=xe.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(Ea)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new QM({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:i}=n.state,o=Et(e[0],0);if(o==9){let s=i.lineAt(r),a=n.state.tabSize,l=io(s.text,a,r-s.from);return xe.replace({widget:new sE((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=xe.replace({widget:new oE(t,o)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(Ea);t.startState.facet(Ea)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const rE="•";function iE(t){return t>=32?rE:t==10?"":String.fromCharCode(9216+t)}class oE extends ir{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=iE(this.code),r=e.state.phrase("Control character")+" "+(JM[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let o=document.createElement("span");return o.textContent=n,o.title=r,o.setAttribute("aria-label",r),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class sE extends ir{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function aE(){return cE}const lE=xe.line({class:"cm-activeLine"}),cE=Je.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let i=t.lineBlockAt(r.head);i.from>e&&(n.push(lE.range(i.from)),e=i.from)}return xe.set(n)}},{decorations:t=>t.decorations});class dE extends ir{constructor(e){super(),this.content=e}toDOM(e){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(e){let n=e.firstChild?Hi(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),i=xs(n[0],r.direction!="rtl"),o=parseInt(r.lineHeight);return i.bottom-i.top>o*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+o}:i}ignoreEvent(){return!1}}function uE(t){let e=Je.fromClass(class{constructor(n){this.view=n,this.placeholder=t?xe.set([xe.widget({widget:new dE(t),side:1}).range(0)]):xe.none}get decorations(){return this.view.state.doc.length?xe.none:this.placeholder}},{decorations:n=>n.decorations});return typeof t=="string"?[e,ie.contentAttributes.of({"aria-placeholder":t})]:e}const Ru=2e3;function hE(t,e,n){let r=Math.min(e.line,n.line),i=Math.max(e.line,n.line),o=[];if(e.off>Ru||n.off>Ru||e.col<0||n.col<0){let s=Math.min(e.off,n.off),a=Math.max(e.off,n.off);for(let l=r;l<=i;l++){let c=t.doc.line(l);c.length<=a&&o.push(H.range(c.from+s,c.to+a))}}else{let s=Math.min(e.col,n.col),a=Math.max(e.col,n.col);for(let l=r;l<=i;l++){let c=t.doc.line(l),d=ou(c.text,s,t.tabSize,!0);if(d<0)o.push(H.cursor(c.to));else{let h=ou(c.text,a,t.tabSize);o.push(H.range(c.from+d,c.from+h))}}}return o}function fE(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}function U1(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),r=t.state.doc.lineAt(n),i=n-r.from,o=i>Ru?-1:i==r.length?fE(t,e.clientX):io(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:o,off:i}}function mE(t,e){let n=U1(t,e),r=t.state.selection;return n?{update(i){if(i.docChanged){let o=i.changes.mapPos(i.startState.doc.line(n.line).from),s=i.state.doc.lineAt(o);n={line:s.number,col:n.col,off:Math.min(n.off,s.length)},r=r.map(i.changes)}},get(i,o,s){let a=U1(t,i);if(!a)return r;let l=hE(t.state,n,a);return l.length?s?H.create(l.concat(r.ranges)):H.create(l):r}}:null}function pE(t){let e=n=>n.altKey&&n.button==0;return ie.mouseSelectionStyle.of((n,r)=>e(r)?mE(n,r):null)}const gE={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},bE={style:"cursor: crosshair"};function vE(t={}){let[e,n]=gE[t.key||"Alt"],r=Je.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||n(i))},keyup(i){(i.keyCode==e||!n(i))&&this.set(!1)},mousemove(i){this.set(n(i))}}});return[r,ie.contentAttributes.of(i=>{var o;return!((o=i.plugin(r))===null||o===void 0)&&o.isDown?bE:null})]}const go="-10000px";class jv{constructor(e,n,r,i){this.facet=n,this.createTooltipView=r,this.removeTooltipView=i,this.input=e.state.facet(n),this.tooltips=this.input.filter(s=>s);let o=null;this.tooltipViews=this.tooltips.map(s=>o=r(s,o))}update(e,n){var r;let i=e.state.facet(this.facet),o=i.filter(l=>l);if(i===this.input){for(let l of this.tooltipViews)l.update&&l.update(e);return!1}let s=[],a=n?[]:null;for(let l=0;l<o.length;l++){let c=o[l],d=-1;if(c){for(let h=0;h<this.tooltips.length;h++){let f=this.tooltips[h];f&&f.create==c.create&&(d=h)}if(d<0)s[l]=this.createTooltipView(c,l?s[l-1]:null),a&&(a[l]=!!c.above);else{let h=s[l]=this.tooltipViews[d];a&&(a[l]=n[d]),h.update&&h.update(e)}}}for(let l of this.tooltipViews)s.indexOf(l)<0&&(this.removeTooltipView(l),(r=l.destroy)===null||r===void 0||r.call(l));return n&&(a.forEach((l,c)=>n[c]=l),n.length=a.length),this.input=i,this.tooltips=o,this.tooltipViews=s,!0}}function xE(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const Yc=he.define({combine:t=>{var e,n,r;return{position:me.ios?"absolute":((e=t.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(i=>i.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=t.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||xE}}}),K1=new WeakMap,kf=Je.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(Yc);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new jv(t,Af,(n,r)=>this.createTooltip(n,r),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,r=t.state.facet(Yc);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),r=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",n.dom.appendChild(i)}return n.dom.style.position=this.position,n.dom.style.top=go,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(t=r.destroy)===null||t===void 0||t.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:o}=this.manager.tooltipViews[0];if(me.gecko)n=o.offsetParent!=this.container.ownerDocument.body;else if(o.style.top==go&&o.style.left=="0px"){let s=o.getBoundingClientRect();n=Math.abs(s.top+1e4)>1||Math.abs(s.left)>1}}if(n||this.position=="absolute")if(this.parent){let o=this.parent.getBoundingClientRect();o.width&&o.height&&(t=o.width/this.parent.offsetWidth,e=o.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=yf(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((o,s)=>{let a=this.manager.tooltipViews[s];return a.getCoords?a.getCoords(o.pos):this.view.coordsAtPos(o.pos)}),size:this.manager.tooltipViews.map(({dom:o})=>o.getBoundingClientRect()),space:this.view.state.facet(Yc).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:n}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{visible:n,space:r,scaleX:i,scaleY:o}=t,s=[];for(let a=0;a<this.manager.tooltips.length;a++){let l=this.manager.tooltips[a],c=this.manager.tooltipViews[a],{dom:d}=c,h=t.pos[a],f=t.size[a];if(!h||l.clip!==!1&&(h.bottom<=Math.max(n.top,r.top)||h.top>=Math.min(n.bottom,r.bottom)||h.right<Math.max(n.left,r.left)-.1||h.left>Math.min(n.right,r.right)+.1)){d.style.top=go;continue}let m=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,g=m?7:0,b=f.right-f.left,v=(e=K1.get(c))!==null&&e!==void 0?e:f.bottom-f.top,x=c.offset||yE,y=this.view.textDirection==We.LTR,$=f.width>r.right-r.left?y?r.left:r.right-f.width:y?Math.max(r.left,Math.min(h.left-(m?14:0)+x.x,r.right-b)):Math.min(Math.max(r.left,h.left-b+(m?14:0)-x.x),r.right-b),k=this.above[a];!l.strictSide&&(k?h.top-v-g-x.y<r.top:h.bottom+v+g+x.y>r.bottom)&&k==r.bottom-h.bottom>h.top-r.top&&(k=this.above[a]=!k);let S=(k?h.top-r.top:r.bottom-h.bottom)-g;if(S<v&&c.resize!==!1){if(S<this.view.defaultLineHeight){d.style.top=go;continue}K1.set(c,v),d.style.height=(v=S)/o+"px"}else d.style.height&&(d.style.height="");let R=k?h.top-v-g-x.y:h.bottom+g+x.y,A=$+b;if(c.overlap!==!0)for(let I of s)I.left<A&&I.right>$&&I.top<R+v&&I.bottom>R&&(R=k?I.top-v-2-g:I.bottom+g+2);if(this.position=="absolute"?(d.style.top=(R-t.parent.top)/o+"px",G1(d,($-t.parent.left)/i)):(d.style.top=R/o+"px",G1(d,$/i)),m){let I=h.left+(y?x.x:-x.x)-($+14-7);m.style.left=I/i+"px"}c.overlap!==!0&&s.push({left:$,top:R,right:A,bottom:R+v}),d.classList.toggle("cm-tooltip-above",k),d.classList.toggle("cm-tooltip-below",!k),c.positioned&&c.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=go}},{eventObservers:{scroll(){this.maybeMeasure()}}});function G1(t,e){let n=parseInt(t.style.left,10);(isNaN(n)||Math.abs(e-n)>1)&&(t.style.left=e+"px")}const wE=ie.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),yE={x:0,y:0},Af=he.define({enables:[kf,wE]}),il=he.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])});class ec{static create(e){return new ec(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new jv(e,il,(n,r)=>this.createHostedView(n,r),n=>n.dom.remove())}createHostedView(e,n){let r=e.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(e){for(let n of this.manager.tooltipViews)n.mount&&n.mount(e);this.mounted=!0}positioned(e){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let n of this.manager.tooltipViews)(e=n.destroy)===null||e===void 0||e.call(n)}passProp(e){let n;for(let r of this.manager.tooltipViews){let i=r[e];if(i!==void 0){if(n===void 0)n=i;else if(n!==i)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const CE=Af.compute([il],t=>{let e=t.facet(il);return e.length===0?null:{pos:Math.min(...e.map(n=>n.pos)),end:Math.max(...e.map(n=>{var r;return(r=n.end)!==null&&r!==void 0?r:n.pos})),create:ec.create,above:e[0].above,arrow:e.some(n=>n.arrow)}});class $E{constructor(e,n,r,i,o){this.view=e,this.source=n,this.field=r,this.setHover=i,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:n}=this,r=e.docView.nearest(n.target);if(!r)return;let i,o=1;if(r instanceof ur)i=r.posAtStart;else{if(i=e.posAtCoords(n),i==null)return;let a=e.coordsAtPos(i);if(!a||n.y<a.top||n.y>a.bottom||n.x<a.left-e.defaultCharacterWidth||n.x>a.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(i)).find(d=>d.from<=i&&d.to>=i),c=l&&l.dir==We.RTL?-1:1;o=n.x<a.left?-c:c}let s=this.source(e,i,o);if(s?.then){let a=this.pending={pos:i};s.then(l=>{this.pending==a&&(this.pending=null,l&&!(Array.isArray(l)&&!l.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])}))},l=>Dt(e.state,l,"hover tooltip"))}else s&&!(Array.isArray(s)&&!s.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(s)?s:[s])})}get tooltip(){let e=this.view.plugin(kf),n=e?e.manager.tooltips.findIndex(r=>r.create==ec.create):-1;return n>-1?e.manager.tooltipViews[n]:null}mousemove(e){var n,r;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:o}=this;if(i.length&&o&&!SE(o.dom,e)||this.pending){let{pos:s}=i[0]||this.pending,a=(r=(n=i[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:s;(s==a?this.view.posAtCoords(this.lastMove)!=s:!kE(this.view,s,a,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length){let{tooltip:r}=this;r&&r.dom.contains(e.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let n=r=>{e.removeEventListener("mouseleave",n),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const ca=4;function SE(t,e){let{left:n,right:r,top:i,bottom:o}=t.getBoundingClientRect(),s;if(s=t.querySelector(".cm-tooltip-arrow")){let a=s.getBoundingClientRect();i=Math.min(a.top,i),o=Math.max(a.bottom,o)}return e.clientX>=n-ca&&e.clientX<=r+ca&&e.clientY>=i-ca&&e.clientY<=o+ca}function kE(t,e,n,r,i,o){let s=t.scrollDOM.getBoundingClientRect(),a=t.documentTop+t.documentPadding.top+t.contentHeight;if(s.left>r||s.right<r||s.top>i||Math.min(s.bottom,a)<i)return!1;let l=t.posAtCoords({x:r,y:i},!1);return l>=e&&l<=n}function AE(t,e={}){let n=Ae.define(),r=ut.define({create(){return[]},update(i,o){if(i.length&&(e.hideOnChange&&(o.docChanged||o.selection)?i=[]:e.hideOn&&(i=i.filter(s=>!e.hideOn(o,s))),o.docChanged)){let s=[];for(let a of i){let l=o.changes.mapPos(a.pos,-1,kt.TrackDel);if(l!=null){let c=Object.assign(Object.create(null),a);c.pos=l,c.end!=null&&(c.end=o.changes.mapPos(c.end)),s.push(c)}}i=s}for(let s of o.effects)s.is(n)&&(i=s.value),s.is(RE)&&(i=[]);return i},provide:i=>il.from(i)});return{active:r,extension:[r,Je.define(i=>new $E(i,t,r,n,e.hoverTime||300)),CE]}}function Dv(t,e){let n=t.plugin(kf);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}const RE=Ae.define(),Y1=he.define({combine(t){let e,n;for(let r of t)e=e||r.topContainer,n=n||r.bottomContainer;return{topContainer:e,bottomContainer:n}}});function Jo(t,e){let n=t.plugin(Ov),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const Ov=Je.fromClass(class{constructor(t){this.input=t.state.facet(es),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(Y1);this.top=new da(t,!0,e.topContainer),this.bottom=new da(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(Y1);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new da(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new da(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(es);if(n!=this.input){let r=n.filter(l=>l),i=[],o=[],s=[],a=[];for(let l of r){let c=this.specs.indexOf(l),d;c<0?(d=l(t.view),a.push(d)):(d=this.panels[c],d.update&&d.update(t)),i.push(d),(d.top?o:s).push(d)}this.specs=r,this.panels=i,this.top.sync(o),this.bottom.sync(s);for(let l of a)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let r of this.panels)r.update&&r.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>ie.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class da{constructor(e,n,r){this.view=e,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=X1(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=X1(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function X1(t){let e=t.nextSibling;return t.remove(),e}const es=he.define({enables:Ov});class Zn extends Kr{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Zn.prototype.elementClass="";Zn.prototype.toDOM=void 0;Zn.prototype.mapMode=kt.TrackBefore;Zn.prototype.startSide=Zn.prototype.endSide=-1;Zn.prototype.point=!0;const Ia=he.define(),TE=he.define(),ME={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>De.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},No=he.define();function EE(t){return[Lv(),No.of(Object.assign(Object.assign({},ME),t))]}const Q1=he.define({combine:t=>t.some(e=>e)});function Lv(t){return[IE]}const IE=Je.fromClass(class{constructor(t){this.view=t,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(No).map(e=>new J1(t,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!t.state.facet(Q1),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}t.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(Q1)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&this.dom.remove();let n=De.iter(this.view.state.facet(Ia),this.view.viewport.from),r=[],i=this.gutters.map(o=>new jE(o,this.view.viewport,-this.view.documentPadding.top));for(let o of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(o.type)){let s=!0;for(let a of o.type)if(a.type==Rt.Text&&s){Tu(n,r,a.from);for(let l of i)l.line(this.view,a,r);s=!1}else if(a.widget)for(let l of i)l.widget(this.view,a)}else if(o.type==Rt.Text){Tu(n,r,o.from);for(let s of i)s.line(this.view,o,r)}else if(o.widget)for(let s of i)s.widget(this.view,o);for(let o of i)o.finish();t&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(t){let e=t.startState.facet(No),n=t.state.facet(No),r=t.docChanged||t.heightChanged||t.viewportChanged||!De.eq(t.startState.facet(Ia),t.state.facet(Ia),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let i of this.gutters)i.update(t)&&(r=!0);else{r=!0;let i=[];for(let o of n){let s=e.indexOf(o);s<0?i.push(new J1(this.view,o)):(this.gutters[s].update(t),i.push(this.gutters[s]))}for(let o of this.gutters)o.dom.remove(),i.indexOf(o)<0&&o.destroy();for(let o of i)this.dom.appendChild(o.dom);this.gutters=i}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove()}},{provide:t=>ie.scrollMargins.of(e=>{let n=e.plugin(t);return!n||n.gutters.length==0||!n.fixed?null:e.textDirection==We.LTR?{left:n.dom.offsetWidth*e.scaleX}:{right:n.dom.offsetWidth*e.scaleX}})});function Z1(t){return Array.isArray(t)?t:[t]}function Tu(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class jE{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=De.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:i}=this,o=(n.top-this.height)/e.scaleY,s=n.height/e.scaleY;if(this.i==i.elements.length){let a=new Nv(e,s,o,r);i.elements.push(a),i.dom.appendChild(a.dom)}else i.elements[this.i].update(e,s,o,r);this.height=n.bottom,this.i++}line(e,n,r){let i=[];Tu(this.cursor,i,n.from),r.length&&(i=i.concat(r));let o=this.gutter.config.lineMarker(e,n,i);o&&i.unshift(o);let s=this.gutter;i.length==0&&!s.config.renderEmptyElements||this.addElement(e,n,i)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),i=r?[r]:null;for(let o of e.state.facet(TE)){let s=o(e,n.widget,n);s&&(i||(i=[])).push(s)}i&&this.addElement(e,n,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class J1{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,i=>{let o=i.target,s;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let l=o.getBoundingClientRect();s=(l.top+l.bottom)/2}else s=i.clientY;let a=e.lineBlockAtHeight(s-e.documentTop);n.domEventHandlers[r](e,a,i)&&i.preventDefault()});this.markers=Z1(n.markers(e)),n.initialSpacer&&(this.spacer=new Nv(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=Z1(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!De.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class Nv{constructor(e,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,i)}update(e,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),DE(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let o=0,s=0;;){let a=s,l=o<n.length?n[o++]:null,c=!1;if(l){let d=l.elementClass;d&&(r+=" "+d);for(let h=s;h<this.markers.length;h++)if(this.markers[h].compare(l)){a=h,c=!0;break}}else a=this.markers.length;for(;s<a;){let d=this.markers[s++];if(d.toDOM){d.destroy(i);let h=i.nextSibling;i.remove(),i=h}}if(!l)break;l.toDOM&&(c?i=i.nextSibling:this.dom.insertBefore(l.toDOM(e),i)),c&&s++}this.dom.className=r,this.markers=n}destroy(){this.setMarkers(null,[])}}function DE(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].compare(e[n]))return!1;return!0}const OE=he.define(),LE=he.define(),bi=he.define({combine(t){return Ln(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,n){let r=Object.assign({},e);for(let i in n){let o=r[i],s=n[i];r[i]=o?(a,l,c)=>o(a,l,c)||s(a,l,c):s}return r}})}});class Xc extends Zn{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Qc(t,e){return t.state.facet(bi).formatNumber(e,t.state)}const NE=No.compute([bi],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(OE)},lineMarker(e,n,r){return r.some(i=>i.toDOM)?null:new Xc(Qc(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let i of e.state.facet(LE)){let o=i(e,n,r);if(o)return o}return null},lineMarkerChange:e=>e.startState.facet(bi)!=e.state.facet(bi),initialSpacer(e){return new Xc(Qc(e,em(e.state.doc.lines)))},updateSpacer(e,n){let r=Qc(n.view,em(n.view.state.doc.lines));return r==e.number?e:new Xc(r)},domEventHandlers:t.facet(bi).domEventHandlers}));function BE(t={}){return[bi.of(t),Lv(),NE]}function em(t){let e=9;for(;e<t;)e=e*10+9;return e}const FE=new class extends Zn{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},VE=Ia.compute(["selection"],t=>{let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.head).from;i>n&&(n=i,e.push(FE.range(i)))}return De.of(e)});function _E(){return VE}var Zc;const vi=new Te;function zE(t){return he.define({combine:t?e=>e.concat(t):void 0})}const HE=new Te;class rn{constructor(e,n,r=[],i=""){this.data=e,this.name=i,Me.prototype.hasOwnProperty("tree")||Object.defineProperty(Me.prototype,"tree",{get(){return Ct(this)}}),this.parser=n,this.extension=[Cr.of(this),Me.languageData.of((o,s,a)=>{let l=tm(o,s,a),c=l.type.prop(vi);if(!c)return[];let d=o.facet(c),h=l.type.prop(HE);if(h){let f=l.resolve(s-l.from,a);for(let m of h)if(m.test(f,o)){let g=o.facet(m.facet);return m.type=="replace"?g:g.concat(d)}}return d})].concat(r)}isActiveAt(e,n,r=-1){return tm(e,n,r).type.prop(vi)==this.data}findRegions(e){let n=e.facet(Cr);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(o,s)=>{if(o.prop(vi)==this.data){r.push({from:s,to:s+o.length});return}let a=o.prop(Te.mounted);if(a){if(a.tree.prop(vi)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+s,to:l.to+s});else r.push({from:s,to:s+o.length});return}else if(a.overlay){let l=r.length;if(i(a.tree,a.overlay[0].from+s),r.length>l)return}}for(let l=0;l<o.children.length;l++){let c=o.children[l];c instanceof rt&&i(c,o.positions[l]+s)}};return i(Ct(e),0),r}get allowsNesting(){return!0}}rn.setState=Ae.define();function tm(t,e,n){let r=t.facet(Cr),i=Ct(t).topNode;if(!r||r.allowsNesting)for(let o=i;o;o=o.enter(e,n,lt.ExcludeBuffers))o.type.isTop&&(i=o);return i}class ol extends rn{constructor(e,n,r){super(e,n,[],r),this.parser=n}static define(e){let n=zE(e.languageData);return new ol(n,e.parser.configure({props:[vi.add(r=>r.isTop?n:void 0)]}),e.name)}configure(e,n){return new ol(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Ct(t){let e=t.field(rn.state,!1);return e?e.tree:rt.empty}class PE{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e<r||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let bo=null;class sl{constructor(e,n,r=[],i,o,s,a,l){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=o,this.viewport=s,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new sl(e,n,[],rt.empty,0,r,[],null)}startParse(){return this.parser.startParse(new PE(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=rt.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(_r.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(_r.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=bo;bo=this;try{return e()}finally{bo=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=nm(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:o,viewport:s,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((c,d,h,f)=>l.push({fromA:c,toA:d,fromB:h,toB:f})),r=_r.applyChanges(r,l),i=rt.empty,o=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){a=[];for(let c of this.skipped){let d=e.mapPos(c.from,1),h=e.mapPos(c.to,-1);d<h&&a.push({from:d,to:h})}}}return new sl(this.parser,n,r,i,o,s,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:o}=this.skipped[r];i<e.to&&o>e.from&&(this.fragments=nm(this.fragments,i,o),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends cb{createParse(n,r,i){let o=i[0].from,s=i[i.length-1].to;return{parsedPos:o,advance(){let l=bo;if(l){for(let c of i)l.tempSkipped.push(c);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=s,new rt(Lt.none,[],[],s-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return bo}}function nm(t,e,n){return _r.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class Ui{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new Ui(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=sl.create(e.facet(Cr).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new Ui(r)}}rn.state=ut.define({create:Ui.init,update(t,e){for(let n of e.effects)if(n.is(rn.setState))return n.value;return e.startState.facet(Cr)!=e.state.facet(Cr)?Ui.init(e.state):t.apply(e)}});let Bv=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Bv=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const Jc=typeof navigator<"u"&&(!((Zc=navigator.scheduling)===null||Zc===void 0)&&Zc.isInputPending)?()=>navigator.scheduling.isInputPending():null,WE=Je.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(rn.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(rn.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=Bv(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,o=r.field(rn.state);if(o.tree==o.context.tree&&o.context.isDone(i+1e5))return;let s=Date.now()+Math.min(this.chunkBudget,100,e&&!Jc?Math.max(25,e.timeRemaining()-5):1e9),a=o.context.treeLen<i&&r.doc.length>i+1e3,l=o.context.work(()=>Jc&&Jc()||Date.now()>s,i+(a?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:rn.setState.of(new Ui(o.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Dt(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Cr=he.define({combine(t){return t.length?t[0]:null},enables:t=>[rn.state,WE,ie.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class qE{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const UE=he.define(),tc=he.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function al(t){let e=t.facet(tc);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function ts(t,e){let n="",r=t.tabSize,i=t.facet(tc)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let o=0;o<e;o++)n+=i;return n}function Rf(t,e){t instanceof Me&&(t=new nc(t));for(let r of t.state.facet(UE)){let i=r(t,e);if(i!==void 0)return i}let n=Ct(t.state);return n.length>=e?KE(t,n,e):null}class nc{constructor(e,n={}){this.state=e,this.options=n,this.unit=al(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:o}=this.options;return i!=null&&i>=r.from&&i<=r.to?o&&i==e?{text:"",from:e}:(n<0?i<e:i<=e)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(e,n);return r.slice(e-i,Math.min(r.length,e+100-i))}column(e,n=1){let{text:r,from:i}=this.lineAt(e,n),o=this.countColumn(r,e-i),s=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return s>-1&&(o+=s-this.countColumn(r,r.search(/\S|$/))),o}countColumn(e,n=e.length){return io(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),o=this.options.overrideIndentation;if(o){let s=o(i);if(s>-1)return s}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Fv=new Te;function KE(t,e,n){let r=e.resolveStack(n),i=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let o=[];for(let s=i;s&&!(s.from==r.node.from&&s.type==r.node.type);s=s.parent)o.push(s);for(let s=o.length-1;s>=0;s--)r={node:o[s],next:r}}return Vv(r,t,n)}function Vv(t,e,n){for(let r=t;r;r=r.next){let i=YE(r.node);if(i)return i(Tf.create(e,n,r))}return 0}function GE(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function YE(t){let e=t.type.prop(Fv);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(Te.closedBy))){let i=t.lastChild,o=i&&r.indexOf(i.name)>-1;return s=>JE(s,!0,1,void 0,o&&!GE(s)?i.from:void 0)}return t.parent==null?XE:null}function XE(){return 0}class Tf extends nc{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new Tf(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(QE(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return Vv(this.context.next,this.base,this.pos)}}function QE(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function ZE(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,o=t.state.doc.lineAt(n.from),s=i==null||i<=o.from?o.to:Math.min(o.to,i);for(let a=n.to;;){let l=e.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped){if(l.from>=s)return null;let c=/^ */.exec(o.text.slice(n.to-o.from))[0].length;return{from:n.from,to:n.to+c}}a=l.to}}function JE(t,e,n,r,i){let o=t.textAfter,s=o.match(/^\s*/)[0].length,a=r&&o.slice(s,s+r.length)==r||i==t.pos+s,l=ZE(t);return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*n)}function rm({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const eI=200;function tI(){return Me.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,i=n.lineAt(r);if(r>i.from+eI)return t;let o=n.sliceString(i.from,r);if(!e.some(c=>c.test(o)))return t;let{state:s}=t,a=-1,l=[];for(let{head:c}of s.selection.ranges){let d=s.doc.lineAt(c);if(d.from==a)continue;a=d.from;let h=Rf(s,d.from);if(h==null)continue;let f=/^\s*/.exec(d.text)[0],m=ts(s,h);f!=m&&l.push({from:d.from,to:d.from+f.length,insert:m})}return l.length?[t,{changes:l,sequential:!0}]:t})}const nI=he.define(),_v=new Te;function rI(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}function iI(t,e,n){let r=Ct(t);if(r.length<n)return null;let i=r.resolveStack(n,1),o=null;for(let s=i;s;s=s.next){let a=s.node;if(a.to<=n||a.from>n)continue;if(o&&a.from<e)break;let l=a.type.prop(_v);if(l&&(a.to<r.length-50||r.length==t.doc.length||!oI(a))){let c=l(a,t);c&&c.from<=n&&c.from>=e&&c.to>n&&(o=c)}}return o}function oI(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function ll(t,e,n){for(let r of t.facet(nI)){let i=r(t,e,n);if(i)return i}return iI(t,e,n)}function zv(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const rc=Ae.define({map:zv}),$s=Ae.define({map:zv});function Hv(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(r=>r.from<=n&&r.to>=n)||e.push(t.lineBlockAt(n));return e}const Qr=ut.define({create(){return xe.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)if(n.is(rc)&&!sI(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(qv),i=r?xe.replace({widget:new fI(r(e.state,n.value))}):im;t=t.update({add:[i.range(n.value.from,n.value.to)]})}else n.is($s)&&(t=t.update({filter:(r,i)=>n.value.from!=r||n.value.to!=i,filterFrom:n.value.from,filterTo:n.value.to}));if(e.selection){let n=!1,{head:r}=e.selection.main;t.between(r,r,(i,o)=>{i<r&&o>r&&(n=!0)}),n&&(t=t.update({filterFrom:r,filterTo:r,filter:(i,o)=>o<=r||i>=r}))}return t},provide:t=>ie.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n<t.length;){let r=t[n++],i=t[n++];if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");e.push(im.range(r,i))}return xe.set(e,!0)}});function cl(t,e,n){var r;let i=null;return(r=t.field(Qr,!1))===null||r===void 0||r.between(e,n,(o,s)=>{(!i||i.from>o)&&(i={from:o,to:s})}),i}function sI(t,e,n){let r=!1;return t.between(e,e,(i,o)=>{i==e&&o==n&&(r=!0)}),r}function Pv(t,e){return t.field(Qr,!1)?e:e.concat(Ae.appendConfig.of(Uv()))}const aI=t=>{for(let e of Hv(t)){let n=ll(t.state,e.from,e.to);if(n)return t.dispatch({effects:Pv(t.state,[rc.of(n),Wv(t,n)])}),!0}return!1},lI=t=>{if(!t.state.field(Qr,!1))return!1;let e=[];for(let n of Hv(t)){let r=cl(t.state,n.from,n.to);r&&e.push($s.of(r),Wv(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function Wv(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,i=t.state.doc.lineAt(e.to).number;return ie.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${i}.`)}const cI=t=>{let{state:e}=t,n=[];for(let r=0;r<e.doc.length;){let i=t.lineBlockAt(r),o=ll(e,i.from,i.to);o&&n.push(rc.of(o)),r=(o?t.lineBlockAt(o.to):i).to+1}return n.length&&t.dispatch({effects:Pv(t.state,n)}),!!n.length},dI=t=>{let e=t.state.field(Qr,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,i)=>{n.push($s.of({from:r,to:i}))}),t.dispatch({effects:n}),!0},uI=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:aI},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:lI},{key:"Ctrl-Alt-[",run:cI},{key:"Ctrl-Alt-]",run:dI}],hI={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},qv=he.define({combine(t){return Ln(t,hI)}});function Uv(t){return[Qr,gI]}function Kv(t,e){let{state:n}=t,r=n.facet(qv),i=s=>{let a=t.lineBlockAt(t.posAtDOM(s.target)),l=cl(t.state,a.from,a.to);l&&t.dispatch({effects:$s.of(l)}),s.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,i,e);let o=document.createElement("span");return o.textContent=r.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=i,o}const im=xe.replace({widget:new class extends ir{toDOM(t){return Kv(t,null)}}});class fI extends ir{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Kv(e,this.value)}}const mI={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class ed extends Zn{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}}function pI(t={}){let e=Object.assign(Object.assign({},mI),t),n=new ed(e,!0),r=new ed(e,!1),i=Je.fromClass(class{constructor(s){this.from=s.viewport.from,this.markers=this.buildMarkers(s)}update(s){(s.docChanged||s.viewportChanged||s.startState.facet(Cr)!=s.state.facet(Cr)||s.startState.field(Qr,!1)!=s.state.field(Qr,!1)||Ct(s.startState)!=Ct(s.state)||e.foldingChanged(s))&&(this.markers=this.buildMarkers(s.view))}buildMarkers(s){let a=new Xn;for(let l of s.viewportLineBlocks){let c=cl(s.state,l.from,l.to)?r:ll(s.state,l.from,l.to)?n:null;c&&a.add(l.from,l.from,c)}return a.finish()}}),{domEventHandlers:o}=e;return[i,EE({class:"cm-foldGutter",markers(s){var a;return((a=s.plugin(i))===null||a===void 0?void 0:a.markers)||De.empty},initialSpacer(){return new ed(e,!1)},domEventHandlers:Object.assign(Object.assign({},o),{click:(s,a,l)=>{if(o.click&&o.click(s,a,l))return!0;let c=cl(s.state,a.from,a.to);if(c)return s.dispatch({effects:$s.of(c)}),!0;let d=ll(s.state,a.from,a.to);return d?(s.dispatch({effects:rc.of(d)}),!0):!1}})}),Uv()]}const gI=ie.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Ss{constructor(e,n){this.specs=e;let r;function i(a){let l=xr.newName();return(r||(r=Object.create(null)))["."+l]=a,l}const o=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,s=n.scope;this.scope=s instanceof rn?a=>a.prop(vi)==s.data:s?a=>a==s:void 0,this.style=hb(e.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:o}).style,this.module=r?new xr(r):null,this.themeType=n.themeType}static define(e,n){return new Ss(e,n||{})}}const Mu=he.define(),Gv=he.define({combine(t){return t.length?[t[0]]:null}});function td(t){let e=t.facet(Mu);return e.length?e:t.facet(Gv)}function Yv(t,e){let n=[vI],r;return t instanceof Ss&&(t.module&&n.push(ie.styleModule.of(t.module)),r=t.themeType),e?.fallback?n.push(Gv.of(t)):r?n.push(Mu.computeN([ie.darkTheme],i=>i.facet(ie.darkTheme)==(r=="dark")?[t]:[])):n.push(Mu.of(t)),n}class bI{constructor(e){this.markCache=Object.create(null),this.tree=Ct(e.state),this.decorations=this.buildDeco(e,td(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=Ct(e.state),r=td(e.state),i=r!=td(e.startState),{viewport:o}=e.view,s=e.changes.mapPos(this.decoratedTo,1);n.length<o.to&&!i&&n.type==this.tree.type&&s>=o.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=s):(n!=this.tree||e.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=o.to)}buildDeco(e,n){if(!n||!this.tree.length)return xe.none;let r=new Xn;for(let{from:i,to:o}of e.visibleRanges)LR(this.tree,n,(s,a,l)=>{r.add(s,a,this.markCache[l]||(this.markCache[l]=xe.mark({class:l})))},i,o);return r.finish()}}const vI=si.high(Je.fromClass(bI,{decorations:t=>t.decorations})),xI=Ss.define([{tag:L.meta,color:"#404740"},{tag:L.link,textDecoration:"underline"},{tag:L.heading,textDecoration:"underline",fontWeight:"bold"},{tag:L.emphasis,fontStyle:"italic"},{tag:L.strong,fontWeight:"bold"},{tag:L.strikethrough,textDecoration:"line-through"},{tag:L.keyword,color:"#708"},{tag:[L.atom,L.bool,L.url,L.contentSeparator,L.labelName],color:"#219"},{tag:[L.literal,L.inserted],color:"#164"},{tag:[L.string,L.deleted],color:"#a11"},{tag:[L.regexp,L.escape,L.special(L.string)],color:"#e40"},{tag:L.definition(L.variableName),color:"#00f"},{tag:L.local(L.variableName),color:"#30a"},{tag:[L.typeName,L.namespace],color:"#085"},{tag:L.className,color:"#167"},{tag:[L.special(L.variableName),L.macroName],color:"#256"},{tag:L.definition(L.propertyName),color:"#00c"},{tag:L.comment,color:"#940"},{tag:L.invalid,color:"#f00"}]),wI=ie.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Xv=1e4,Qv="()[]{}",Zv=he.define({combine(t){return Ln(t,{afterCursor:!0,brackets:Qv,maxScanDistance:Xv,renderMatch:$I})}}),yI=xe.mark({class:"cm-matchingBracket"}),CI=xe.mark({class:"cm-nonmatchingBracket"});function $I(t){let e=[],n=t.matched?yI:CI;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}const SI=ut.define({create(){return xe.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(Zv);for(let i of e.state.selection.ranges){if(!i.empty)continue;let o=yn(e.state,i.head,-1,r)||i.head>0&&yn(e.state,i.head-1,1,r)||r.afterCursor&&(yn(e.state,i.head,1,r)||i.head<e.state.doc.length&&yn(e.state,i.head+1,-1,r));o&&(n=n.concat(r.renderMatch(o,e.state)))}return xe.set(n,!0)},provide:t=>ie.decorations.from(t)}),kI=[SI,wI];function AI(t={}){return[Zv.of(t),kI]}const RI=new Te;function Eu(t,e,n){let r=t.prop(e<0?Te.openedBy:Te.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function Iu(t){let e=t.type.prop(RI);return e?e(t.node):t}function yn(t,e,n,r={}){let i=r.maxScanDistance||Xv,o=r.brackets||Qv,s=Ct(t),a=s.resolveInner(e,n);for(let l=a;l;l=l.parent){let c=Eu(l.type,n,o);if(c&&l.from<l.to){let d=Iu(l);if(d&&(n>0?e>=d.from&&e<d.to:e>d.from&&e<=d.to))return TI(t,e,n,l,d,c,o)}}return MI(t,e,n,s,a.type,i,o)}function TI(t,e,n,r,i,o,s){let a=r.parent,l={from:i.from,to:i.to},c=0,d=a?.cursor();if(d&&(n<0?d.childBefore(r.from):d.childAfter(r.to)))do if(n<0?d.to<=r.from:d.from>=r.to){if(c==0&&o.indexOf(d.type.name)>-1&&d.from<d.to){let h=Iu(d);return{start:l,end:h?{from:h.from,to:h.to}:void 0,matched:!0}}else if(Eu(d.type,n,s))c++;else if(Eu(d.type,-n,s)){if(c==0){let h=Iu(d);return{start:l,end:h&&h.from<h.to?{from:h.from,to:h.to}:void 0,matched:!1}}c--}}while(n<0?d.prevSibling():d.nextSibling());return{start:l,matched:!1}}function MI(t,e,n,r,i,o,s){let a=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),l=s.indexOf(a);if(l<0||l%2==0!=n>0)return null;let c={from:n<0?e-1:e,to:n>0?e+1:e},d=t.doc.iterRange(e,n>0?t.doc.length:0),h=0;for(let f=0;!d.next().done&&f<=o;){let m=d.value;n<0&&(f+=m.length);let g=e+f*n;for(let b=n>0?0:m.length-1,v=n>0?m.length:-1;b!=v;b+=n){let x=s.indexOf(m[b]);if(!(x<0||r.resolveInner(g+b,1).type!=i))if(x%2==0==n>0)h++;else{if(h==1)return{start:c,end:{from:g+b,to:g+b+1},matched:x>>1==l>>1};h--}}n>0&&(f+=m.length)}return d.done?{start:c,matched:!1}:null}const EI=Object.create(null),om=[Lt.none],sm=[],am=Object.create(null),II=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])II[t]=jI(EI,e);function nd(t,e){sm.indexOf(t)>-1||(sm.push(t),console.warn(e))}function jI(t,e){let n=[];for(let a of e.split(" ")){let l=[];for(let c of a.split(".")){let d=t[c]||L[c];d?typeof d=="function"?l.length?l=l.map(d):nd(c,`Modifier ${c} used at start of tag`):l.length?nd(c,`Tag ${c} used as modifier`):l=Array.isArray(d)?d:[d]:nd(c,`Unknown highlighting tag ${c}`)}for(let c of l)n.push(c)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(a=>a.id),o=am[i];if(o)return o.id;let s=am[i]=Lt.define({id:om.length,name:r,props:[db({[r]:n})]});return om.push(s),s.id}We.RTL,We.LTR;const DI=()=>t=>{try{JSON.parse(t.state.doc.toString())}catch(e){if(!(e instanceof SyntaxError))throw e;const n=OI(e,t.state.doc);return[{from:n,message:e.message,severity:"error",to:n}]}return[]};function OI(t,e){let n;return(n=t.message.match(/at position (\d+)/))?Math.min(+n[1],e.length):(n=t.message.match(/at line (\d+) column (\d+)/))?Math.min(e.line(+n[1]).from+ +n[2]-1,e.length):0}const LI=ol.define({name:"json",parser:VR.configure({props:[Fv.add({Object:rm({except:/^\s*\}/}),Array:rm({except:/^\s*\]/})}),_v.add({"Object Array":rI})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function NI(){return new qE(LI)}function BI(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}const FI=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=Ef(t.state,n.from);return r.line?VI(t):r.block?zI(t):!1};function Mf(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=t(e,n);return i?(r(n.update(i)),!0):!1}}const VI=Mf(WI,0),_I=Mf(Jv,0),zI=Mf((t,e)=>Jv(t,e,PI(e)),0);function Ef(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const vo=50;function HI(t,{open:e,close:n},r,i){let o=t.sliceDoc(r-vo,r),s=t.sliceDoc(i,i+vo),a=/\s*$/.exec(o)[0].length,l=/^\s*/.exec(s)[0].length,c=o.length-a;if(o.slice(c-e.length,c)==e&&s.slice(l,l+n.length)==n)return{open:{pos:r-a,margin:a&&1},close:{pos:i+l,margin:l&&1}};let d,h;i-r<=2*vo?d=h=t.sliceDoc(r,i):(d=t.sliceDoc(r,r+vo),h=t.sliceDoc(i-vo,i));let f=/^\s*/.exec(d)[0].length,m=/\s*$/.exec(h)[0].length,g=h.length-m-n.length;return d.slice(f,f+e.length)==e&&h.slice(g,g+n.length)==n?{open:{pos:r+f+e.length,margin:/\s/.test(d.charAt(f+e.length))?1:0},close:{pos:i-m-n.length,margin:/\s/.test(h.charAt(g-1))?1:0}}:null}function PI(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),i=n.to<=r.to?r:t.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:t.doc.lineAt(n.to-1));let o=e.length-1;o>=0&&e[o].to>r.from?e[o].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function Jv(t,e,n=e.selection.ranges){let r=n.map(o=>Ef(e,o.from).block);if(!r.every(o=>o))return null;let i=n.map((o,s)=>HI(e,r[s],o.from,o.to));if(t!=2&&!i.every(o=>o))return{changes:e.changes(n.map((o,s)=>i[s]?[]:[{from:o.from,insert:r[s].open+" "},{from:o.to,insert:" "+r[s].close}]))};if(t!=1&&i.some(o=>o)){let o=[];for(let s=0,a;s<i.length;s++)if(a=i[s]){let l=r[s],{open:c,close:d}=a;o.push({from:c.pos-l.open.length,to:c.pos+c.margin},{from:d.pos-d.margin,to:d.pos+l.close.length})}return{changes:o}}return null}function WI(t,e,n=e.selection.ranges){let r=[],i=-1;for(let{from:o,to:s}of n){let a=r.length,l=1e9,c=Ef(e,o).line;if(c){for(let d=o;d<=s;){let h=e.doc.lineAt(d);if(h.from>i&&(o==s||s>h.from)){i=h.from;let f=/^\s*/.exec(h.text)[0].length,m=f==h.length,g=h.text.slice(f,f+c.length)==c?f:-1;f<h.text.length&&f<l&&(l=f),r.push({line:h,comment:g,token:c,indent:f,empty:m,single:!1})}d=h.to+1}if(l<1e9)for(let d=a;d<r.length;d++)r[d].indent<r[d].line.text.length&&(r[d].indent=l);r.length==a+1&&(r[a].single=!0)}}if(t!=2&&r.some(o=>o.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:a,token:l,indent:c,empty:d,single:h}of r)(h||!d)&&o.push({from:a.from+c,insert:l+" "});let s=e.changes(o);return{changes:s,selection:e.selection.map(s,1)}}else if(t!=1&&r.some(o=>o.comment>=0)){let o=[];for(let{line:s,comment:a,token:l}of r)if(a>=0){let c=s.from+a,d=c+l.length;s.text[d-s.from]==" "&&d++,o.push({from:c,to:d})}return{changes:o}}return null}const ju=On.define(),qI=On.define(),UI=he.define(),e5=he.define({combine(t){return Ln(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,i)=>e(r,i)||n(r,i)})}}),t5=ut.define({create(){return Cn.empty},update(t,e){let n=e.state.facet(e5),r=e.annotation(ju);if(r){let l=Ot.fromTransaction(e,r.selection),c=r.side,d=c==0?t.undone:t.done;return l?d=dl(d,d.length,n.minDepth,l):d=i5(d,e.startState.selection),new Cn(c==0?r.rest:d,c==0?d:r.rest)}let i=e.annotation(qI);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(st.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let o=Ot.fromTransaction(e),s=e.annotation(st.time),a=e.annotation(st.userEvent);return o?t=t.addChanges(o,s,a,n,e):e.selection&&(t=t.addSelection(e.startState.selection,s,a,n.newGroupDelay)),(i=="full"||i=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new Cn(t.done.map(Ot.fromJSON),t.undone.map(Ot.fromJSON))}});function KI(t={}){return[t5,e5.of(t),ie.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?n5:e.inputType=="historyRedo"?Du:null;return r?(e.preventDefault(),r(n)):!1}})]}function ic(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(t5,!1);if(!i)return!1;let o=i.pop(t,n,e);return o?(r(o),!0):!1}}const n5=ic(0,!1),Du=ic(1,!1),GI=ic(0,!0),YI=ic(1,!0);class Ot{constructor(e,n,r,i,o){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}setSelAfter(e){return new Ot(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new Ot(e.changes&&ot.fromJSON(e.changes),[],e.mapped&&kn.fromJSON(e.mapped),e.startSelection&&H.fromJSON(e.startSelection),e.selectionsAfter.map(H.fromJSON))}static fromTransaction(e,n){let r=qt;for(let i of e.startState.facet(UI)){let o=i(e);o.length&&(r=r.concat(o))}return!r.length&&e.changes.empty?null:new Ot(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,qt)}static selection(e){return new Ot(void 0,qt,void 0,void 0,e)}}function dl(t,e,n,r){let i=e+1>n+20?e-n-1:0,o=t.slice(i,e);return o.push(r),o}function XI(t,e){let n=[],r=!1;return t.iterChangedRanges((i,o)=>n.push(i,o)),e.iterChangedRanges((i,o,s,a)=>{for(let l=0;l<n.length;){let c=n[l++],d=n[l++];a>=c&&s<=d&&(r=!0)}}),r}function QI(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function r5(t,e){return t.length?e.length?t.concat(e):t:e}const qt=[],ZI=200;function i5(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-ZI));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),dl(t,t.length-1,1e9,n.setSelAfter(r)))}else return[Ot.selection([e])]}function JI(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function rd(t,e){if(!t.length)return t;let n=t.length,r=qt;for(;n;){let i=ej(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let o=t.slice(0,n);return o[n-1]=i,o}else e=i.mapped,n--,r=i.selectionsAfter}return r.length?[Ot.selection(r)]:qt}function ej(t,e,n){let r=r5(t.selectionsAfter.length?t.selectionsAfter.map(a=>a.map(e)):qt,n);if(!t.changes)return Ot.selection(r);let i=t.changes.map(e),o=e.mapDesc(t.changes,!0),s=t.mapped?t.mapped.composeDesc(o):o;return new Ot(i,Ae.mapEffects(t.effects,e),s,t.startSelection.map(o),r)}const tj=/^(input\.type|delete)($|\.)/;class Cn{constructor(e,n,r=0,i=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new Cn(this.done,this.undone):this}addChanges(e,n,r,i,o){let s=this.done,a=s[s.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!r||tj.test(r))&&(!a.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(o,XI(a.changes,e.changes))||r=="input.type.compose")?s=dl(s,s.length-1,i.minDepth,new Ot(e.changes.compose(a.changes),r5(Ae.mapEffects(e.effects,a.changes),a.effects),a.mapped,a.startSelection,qt)):s=dl(s,s.length,i.minDepth,e),new Cn(s,qt,n,r)}addSelection(e,n,r,i){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:qt;return o.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&QI(o[o.length-1],e)?this:new Cn(i5(this.done,e),this.undone,n,r)}addMapping(e){return new Cn(rd(this.done,e),rd(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,r){let i=e==0?this.done:this.undone;if(i.length==0)return null;let o=i[i.length-1],s=o.selectionsAfter[0]||n.selection;if(r&&o.selectionsAfter.length)return n.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:ju.of({side:e,rest:JI(i),selection:s}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(o.changes){let a=i.length==1?qt:i.slice(0,i.length-1);return o.mapped&&(a=rd(a,o.mapped)),n.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:ju.of({side:e,rest:a,selection:s}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Cn.empty=new Cn(qt,qt);const nj=[{key:"Mod-z",run:n5,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Du,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Du,preventDefault:!0},{key:"Mod-u",run:GI,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:YI,preventDefault:!0}];function oo(t,e){return H.create(t.ranges.map(e),t.mainIndex)}function Nn(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function hn({state:t,dispatch:e},n){let r=oo(t.selection,n);return r.eq(t.selection,!0)?!1:(e(Nn(t,r)),!0)}function oc(t,e){return H.cursor(e?t.to:t.from)}function o5(t,e){return hn(t,n=>n.empty?t.moveByChar(n,e):oc(n,e))}function $t(t){return t.textDirectionAt(t.state.selection.main.head)==We.LTR}const s5=t=>o5(t,!$t(t)),a5=t=>o5(t,$t(t));function l5(t,e){return hn(t,n=>n.empty?t.moveByGroup(n,e):oc(n,e))}const rj=t=>l5(t,!$t(t)),ij=t=>l5(t,$t(t));function oj(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function sc(t,e,n){let r=Ct(t).resolveInner(e.head),i=n?Te.closedBy:Te.openedBy;for(let l=e.head;;){let c=n?r.childAfter(l):r.childBefore(l);if(!c)break;oj(t,c,i)?r=c:l=n?c.to:c.from}let o=r.type.prop(i),s,a;return o&&(s=n?yn(t,r.from,1):yn(t,r.to,-1))&&s.matched?a=n?s.end.to:s.end.from:a=n?r.to:r.from,H.cursor(a,n?-1:1)}const sj=t=>hn(t,e=>sc(t.state,e,!$t(t))),aj=t=>hn(t,e=>sc(t.state,e,$t(t)));function c5(t,e){return hn(t,n=>{if(!n.empty)return oc(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const d5=t=>c5(t,!1),u5=t=>c5(t,!0);function h5(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,r=0,i;if(e){for(let o of t.state.facet(ie.scrollMargins)){let s=o(t);s?.top&&(n=Math.max(s?.top,n)),s?.bottom&&(r=Math.max(s?.bottom,r))}i=t.scrollDOM.clientHeight-n-r}else i=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:e,height:Math.max(t.defaultLineHeight,i-5)}}function f5(t,e){let n=h5(t),{state:r}=t,i=oo(r.selection,s=>s.empty?t.moveVertically(s,e,n.height):oc(s,e));if(i.eq(r.selection))return!1;let o;if(n.selfScroll){let s=t.coordsAtPos(r.selection.main.head),a=t.scrollDOM.getBoundingClientRect(),l=a.top+n.marginTop,c=a.bottom-n.marginBottom;s&&s.top>l&&s.bottom<c&&(o=ie.scrollIntoView(i.main.head,{y:"start",yMargin:s.top-l}))}return t.dispatch(Nn(r,i),{effects:o}),!0}const lm=t=>f5(t,!1),Ou=t=>f5(t,!0);function Tr(t,e,n){let r=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,n);if(i.head==e.head&&i.head!=(n?r.to:r.from)&&(i=t.moveToLineBoundary(e,n,!1)),!n&&i.head==r.from&&r.length){let o=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;o&&e.head!=r.from+o&&(i=H.cursor(r.from+o))}return i}const lj=t=>hn(t,e=>Tr(t,e,!0)),cj=t=>hn(t,e=>Tr(t,e,!1)),dj=t=>hn(t,e=>Tr(t,e,!$t(t))),uj=t=>hn(t,e=>Tr(t,e,$t(t))),hj=t=>hn(t,e=>H.cursor(t.lineBlockAt(e.head).from,1)),fj=t=>hn(t,e=>H.cursor(t.lineBlockAt(e.head).to,-1));function mj(t,e,n){let r=!1,i=oo(t.selection,o=>{let s=yn(t,o.head,-1)||yn(t,o.head,1)||o.head>0&&yn(t,o.head-1,1)||o.head<t.doc.length&&yn(t,o.head+1,-1);if(!s||!s.end)return o;r=!0;let a=s.start.from==o.head?s.end.to:s.end.from;return H.cursor(a)});return r?(e(Nn(t,i)),!0):!1}const pj=({state:t,dispatch:e})=>mj(t,e);function Xt(t,e){let n=oo(t.state.selection,r=>{let i=e(r);return H.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(Nn(t.state,n)),!0)}function m5(t,e){return Xt(t,n=>t.moveByChar(n,e))}const p5=t=>m5(t,!$t(t)),g5=t=>m5(t,$t(t));function b5(t,e){return Xt(t,n=>t.moveByGroup(n,e))}const gj=t=>b5(t,!$t(t)),bj=t=>b5(t,$t(t)),vj=t=>Xt(t,e=>sc(t.state,e,!$t(t))),xj=t=>Xt(t,e=>sc(t.state,e,$t(t)));function v5(t,e){return Xt(t,n=>t.moveVertically(n,e))}const x5=t=>v5(t,!1),w5=t=>v5(t,!0);function y5(t,e){return Xt(t,n=>t.moveVertically(n,e,h5(t).height))}const cm=t=>y5(t,!1),dm=t=>y5(t,!0),wj=t=>Xt(t,e=>Tr(t,e,!0)),yj=t=>Xt(t,e=>Tr(t,e,!1)),Cj=t=>Xt(t,e=>Tr(t,e,!$t(t))),$j=t=>Xt(t,e=>Tr(t,e,$t(t))),Sj=t=>Xt(t,e=>H.cursor(t.lineBlockAt(e.head).from)),kj=t=>Xt(t,e=>H.cursor(t.lineBlockAt(e.head).to)),um=({state:t,dispatch:e})=>(e(Nn(t,{anchor:0})),!0),hm=({state:t,dispatch:e})=>(e(Nn(t,{anchor:t.doc.length})),!0),fm=({state:t,dispatch:e})=>(e(Nn(t,{anchor:t.selection.main.anchor,head:0})),!0),mm=({state:t,dispatch:e})=>(e(Nn(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),Aj=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),Rj=({state:t,dispatch:e})=>{let n=ac(t).map(({from:r,to:i})=>H.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:H.create(n),userEvent:"select"})),!0},Tj=({state:t,dispatch:e})=>{let n=oo(t.selection,r=>{let i=Ct(t),o=i.resolveStack(r.from,1);if(r.empty){let s=i.resolveStack(r.from,-1);s.node.from>=o.node.from&&s.node.to<=o.node.to&&(o=s)}for(let s=o;s;s=s.next){let{node:a}=s;if((a.from<r.from&&a.to>=r.to||a.to>r.to&&a.from<=r.from)&&s.next)return H.range(a.to,a.from)}return r});return n.eq(t.selection)?!1:(e(Nn(t,n)),!0)},Mj=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=H.create([n.main]):n.main.empty||(r=H.create([H.cursor(n.main.head)])),r?(e(Nn(t,r)),!0):!1};function ks(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(o=>{let{from:s,to:a}=o;if(s==a){let l=e(o);l<s?(n="delete.backward",l=ua(t,l,!1)):l>s&&(n="delete.forward",l=ua(t,l,!0)),s=Math.min(s,l),a=Math.max(a,l)}else s=ua(t,s,!1),a=ua(t,a,!0);return s==a?{range:o}:{changes:{from:s,to:a},range:H.cursor(s,s<o.head?-1:1)}});return i.changes.empty?!1:(t.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?ie.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function ua(t,e,n){if(t instanceof ie)for(let r of t.state.facet(ie.atomicRanges).map(i=>i(t)))r.between(e,e,(i,o)=>{i<e&&o>e&&(e=n?o:i)});return e}const C5=(t,e,n)=>ks(t,r=>{let i=r.from,{state:o}=t,s=o.doc.lineAt(i),a,l;if(n&&!e&&i>s.from&&i<s.from+200&&!/[^ \t]/.test(a=s.text.slice(0,i-s.from))){if(a[a.length-1]==" ")return i-1;let c=io(a,o.tabSize),d=c%al(o)||al(o);for(let h=0;h<d&&a[a.length-1-h]==" ";h++)i--;l=i}else l=pt(s.text,i-s.from,e,e)+s.from,l==i&&s.number!=(e?o.doc.lines:1)?l+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(s.text.slice(l-s.from,i-s.from))&&(l=pt(s.text,l-s.from,!1,!1)+s.from);return l}),Lu=t=>C5(t,!1,!0),$5=t=>C5(t,!0,!1),S5=(t,e)=>ks(t,n=>{let r=n.head,{state:i}=t,o=i.doc.lineAt(r),s=i.charCategorizer(r);for(let a=null;;){if(r==(e?o.to:o.from)){r==n.head&&o.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let l=pt(o.text,r-o.from,e)+o.from,c=o.text.slice(Math.min(r,l)-o.from,Math.max(r,l)-o.from),d=s(c);if(a!=null&&d!=a)break;(c!=" "||r!=n.head)&&(a=d),r=l}return r}),k5=t=>S5(t,!1),Ej=t=>S5(t,!0),Ij=t=>ks(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),jj=t=>ks(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),Dj=t=>ks(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),Oj=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:Oe.of(["",""])},range:H.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},Lj=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let i=r.from,o=t.doc.lineAt(i),s=i==o.from?i-1:pt(o.text,i-o.from,!1)+o.from,a=i==o.to?i+1:pt(o.text,i-o.from,!0)+o.from;return{changes:{from:s,to:a,insert:t.doc.slice(i,a).append(t.doc.slice(s,i))},range:H.cursor(a)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function ac(t){let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.from),o=t.doc.lineAt(r.to);if(!r.empty&&r.to==o.from&&(o=t.doc.lineAt(r.to-1)),n>=i.number){let s=e[e.length-1];s.to=o.to,s.ranges.push(r)}else e.push({from:i.from,to:o.to,ranges:[r]});n=o.number+1}return e}function A5(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let o of ac(t)){if(n?o.to==t.doc.length:o.from==0)continue;let s=t.doc.lineAt(n?o.to+1:o.from-1),a=s.length+1;if(n){r.push({from:o.to,to:s.to},{from:o.from,insert:s.text+t.lineBreak});for(let l of o.ranges)i.push(H.range(Math.min(t.doc.length,l.anchor+a),Math.min(t.doc.length,l.head+a)))}else{r.push({from:s.from,to:o.from},{from:o.to,insert:t.lineBreak+s.text});for(let l of o.ranges)i.push(H.range(l.anchor-a,l.head-a))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:H.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Nj=({state:t,dispatch:e})=>A5(t,e,!1),Bj=({state:t,dispatch:e})=>A5(t,e,!0);function R5(t,e,n){if(t.readOnly)return!1;let r=[];for(let i of ac(t))n?r.push({from:i.from,insert:t.doc.slice(i.from,i.to)+t.lineBreak}):r.push({from:i.to,insert:t.lineBreak+t.doc.slice(i.from,i.to)});return e(t.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Fj=({state:t,dispatch:e})=>R5(t,e,!1),Vj=({state:t,dispatch:e})=>R5(t,e,!0),_j=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(ac(e).map(({from:i,to:o})=>(i>0?i--:o<e.doc.length&&o++,{from:i,to:o}))),r=oo(e.selection,i=>{let o;if(t.lineWrapping){let s=t.lineBlockAt(i.head),a=t.coordsAtPos(i.head,i.assoc||1);a&&(o=s.bottom+t.documentTop-a.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,o)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function zj(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=Ct(t).resolveInner(e),r=n.childBefore(e),i=n.childAfter(e),o;return r&&i&&r.to<=e&&i.from>=e&&(o=r.type.prop(Te.closedBy))&&o.indexOf(i.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const pm=T5(!1),Hj=T5(!0);function T5(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:o,to:s}=i,a=e.doc.lineAt(o),l=!t&&o==s&&zj(e,o);t&&(o=s=(s<=a.to?a:e.doc.lineAt(s)).to);let c=new nc(e,{simulateBreak:o,simulateDoubleBreak:!!l}),d=Rf(c,o);for(d==null&&(d=io(/^\s*/.exec(e.doc.lineAt(o).text)[0],e.tabSize));s<a.to&&/\s/.test(a.text[s-a.from]);)s++;l?{from:o,to:s}=l:o>a.from&&o<a.from+100&&!/\S/.test(a.text.slice(0,o))&&(o=a.from);let h=["",ts(e,d)];return l&&h.push(ts(e,c.lineIndent(a.from,-1))),{changes:{from:o,to:s,insert:Oe.of(h)},range:H.cursor(o+1+h[1].length)}});return n(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function If(t,e){let n=-1;return t.changeByRange(r=>{let i=[];for(let s=r.from;s<=r.to;){let a=t.doc.lineAt(s);a.number>n&&(r.empty||r.to>a.from)&&(e(a,i,r),n=a.number),s=a.to+1}let o=t.changes(i);return{changes:i,range:H.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}const Pj=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new nc(t,{overrideIndentation:o=>{let s=n[o];return s??-1}}),i=If(t,(o,s,a)=>{let l=Rf(r,o.from);if(l==null)return;/\S/.test(o.text)||(l=0);let c=/^\s*/.exec(o.text)[0],d=ts(t,l);(c!=d||a.from<o.from+c.length)&&(n[o.from]=l,s.push({from:o.from,to:o.from+c.length,insert:d}))});return i.changes.empty||e(t.update(i,{userEvent:"indent"})),!0},M5=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(If(t,(n,r)=>{r.push({from:n.from,insert:t.facet(tc)})}),{userEvent:"input.indent"})),!0),E5=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(If(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let o=io(i,t.tabSize),s=0,a=ts(t,Math.max(0,o-al(t)));for(;s<i.length&&s<a.length&&i.charCodeAt(s)==a.charCodeAt(s);)s++;r.push({from:n.from+s,to:n.from+i.length,insert:a.slice(s)})}),{userEvent:"delete.dedent"})),!0),Wj=t=>(t.setTabFocusMode(),!0),qj=[{key:"Ctrl-b",run:s5,shift:p5,preventDefault:!0},{key:"Ctrl-f",run:a5,shift:g5},{key:"Ctrl-p",run:d5,shift:x5},{key:"Ctrl-n",run:u5,shift:w5},{key:"Ctrl-a",run:hj,shift:Sj},{key:"Ctrl-e",run:fj,shift:kj},{key:"Ctrl-d",run:$5},{key:"Ctrl-h",run:Lu},{key:"Ctrl-k",run:Ij},{key:"Ctrl-Alt-h",run:k5},{key:"Ctrl-o",run:Oj},{key:"Ctrl-t",run:Lj},{key:"Ctrl-v",run:Ou}],Uj=[{key:"ArrowLeft",run:s5,shift:p5,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:rj,shift:gj,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:dj,shift:Cj,preventDefault:!0},{key:"ArrowRight",run:a5,shift:g5,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:ij,shift:bj,preventDefault:!0},{mac:"Cmd-ArrowRight",run:uj,shift:$j,preventDefault:!0},{key:"ArrowUp",run:d5,shift:x5,preventDefault:!0},{mac:"Cmd-ArrowUp",run:um,shift:fm},{mac:"Ctrl-ArrowUp",run:lm,shift:cm},{key:"ArrowDown",run:u5,shift:w5,preventDefault:!0},{mac:"Cmd-ArrowDown",run:hm,shift:mm},{mac:"Ctrl-ArrowDown",run:Ou,shift:dm},{key:"PageUp",run:lm,shift:cm},{key:"PageDown",run:Ou,shift:dm},{key:"Home",run:cj,shift:yj,preventDefault:!0},{key:"Mod-Home",run:um,shift:fm},{key:"End",run:lj,shift:wj,preventDefault:!0},{key:"Mod-End",run:hm,shift:mm},{key:"Enter",run:pm,shift:pm},{key:"Mod-a",run:Aj},{key:"Backspace",run:Lu,shift:Lu},{key:"Delete",run:$5},{key:"Mod-Backspace",mac:"Alt-Backspace",run:k5},{key:"Mod-Delete",mac:"Alt-Delete",run:Ej},{mac:"Mod-Backspace",run:jj},{mac:"Mod-Delete",run:Dj}].concat(qj.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),Kj=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:sj,shift:vj},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:aj,shift:xj},{key:"Alt-ArrowUp",run:Nj},{key:"Shift-Alt-ArrowUp",run:Fj},{key:"Alt-ArrowDown",run:Bj},{key:"Shift-Alt-ArrowDown",run:Vj},{key:"Escape",run:Mj},{key:"Mod-Enter",run:Hj},{key:"Alt-l",mac:"Ctrl-l",run:Rj},{key:"Mod-i",run:Tj,preventDefault:!0},{key:"Mod-[",run:E5},{key:"Mod-]",run:M5},{key:"Mod-Alt-\\",run:Pj},{key:"Shift-Mod-k",run:_j},{key:"Shift-Mod-\\",run:pj},{key:"Mod-/",run:FI},{key:"Alt-A",run:_I},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Wj}].concat(Uj),Gj={key:"Tab",run:M5,shift:E5};function _e(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i=="string"?t.setAttribute(r,i):i!=null&&(t[r]=i)}e++}for(;e<arguments.length;e++)I5(t,arguments[e]);return t}function I5(t,e){if(typeof e=="string")t.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)t.appendChild(e);else if(Array.isArray(e))for(var n=0;n<e.length;n++)I5(t,e[n]);else throw new RangeError("Unsupported child node: "+e)}const gm=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class Ki{constructor(e,n,r=0,i=e.length,o,s){this.test=s,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=o?a=>o(gm(a)):gm,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Et(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let n=uf(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=xn(e);let i=this.normalize(n);if(i.length)for(let o=0,s=r;;o++){let a=i.charCodeAt(o),l=this.match(a,s,this.bufferPos+this.bufferStart);if(o==i.length-1){if(l)return this.value=l,this;break}s==r&&o<n.length&&n.charCodeAt(o)==a&&s++}}}match(e,n,r){let i=null;for(let o=0;o<this.matches.length;o+=2){let s=this.matches[o],a=!1;this.query.charCodeAt(s)==e&&(s==this.query.length-1?i={from:this.matches[o+1],to:r}:(this.matches[o]++,a=!0)),a||(this.matches.splice(o,2),o-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?i={from:n,to:r}:this.matches.push(1,n)),i&&this.test&&!this.test(i.from,i.to,this.buffer,this.bufferStart)&&(i=null),i}}typeof Symbol<"u"&&(Ki.prototype[Symbol.iterator]=function(){return this});const j5={from:-1,to:-1,match:/.*/.exec("")},jf="gm"+(/x/.unicode==null?"":"u");class D5{constructor(e,n,r,i=0,o=e.length){if(this.text=e,this.to=o,this.curLine="",this.done=!1,this.value=j5,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new O5(e,n,r,i,o);this.re=new RegExp(n,jf+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=e.iter();let s=e.lineAt(i);this.curLineStart=s.from,this.matchPos=ul(e,i),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,i=r+n[0].length;if(this.matchPos=ul(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<i||r>this.value.to)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const id=new WeakMap;class Ei{constructor(e,n){this.from=e,this.text=n}get to(){return this.from+this.text.length}static get(e,n,r){let i=id.get(e);if(!i||i.from>=r||i.to<=n){let a=new Ei(n,e.sliceString(n,r));return id.set(e,a),a}if(i.from==n&&i.to==r)return i;let{text:o,from:s}=i;return s>n&&(o=e.sliceString(n,s)+o,s=n),i.to<r&&(o+=e.sliceString(i.to,r)),id.set(e,new Ei(s,o)),new Ei(n,o.slice(n-s,r-s))}}class O5{constructor(e,n,r,i,o){this.text=e,this.to=o,this.done=!1,this.value=j5,this.matchPos=ul(e,i),this.re=new RegExp(n,jf+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=Ei.get(e,i,this.chunkEnd(i+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==e&&(this.re.lastIndex=e+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,i=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},this.matchPos=ul(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ei.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(D5.prototype[Symbol.iterator]=O5.prototype[Symbol.iterator]=function(){return this});function Yj(t){try{return new RegExp(t,jf),!0}catch{return!1}}function ul(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e<n.to&&(r=n.text.charCodeAt(e-n.from))>=56320&&r<57344;)e++;return e}function Nu(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),n=_e("input",{class:"cm-textfield",name:"line",value:e}),r=_e("form",{class:"cm-gotoLine",onkeydown:o=>{o.keyCode==27?(o.preventDefault(),t.dispatch({effects:Bo.of(!1)}),t.focus()):o.keyCode==13&&(o.preventDefault(),i())},onsubmit:o=>{o.preventDefault(),i()}},_e("label",t.state.phrase("Go to line"),": ",n)," ",_e("button",{class:"cm-button",type:"submit"},t.state.phrase("go")),_e("button",{name:"close",onclick:()=>{t.dispatch({effects:Bo.of(!1)}),t.focus()},"aria-label":t.state.phrase("close"),type:"button"},["×"]));function i(){let o=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!o)return;let{state:s}=t,a=s.doc.lineAt(s.selection.main.head),[,l,c,d,h]=o,f=d?+d.slice(1):0,m=c?+c:a.number;if(c&&h){let v=m/100;l&&(v=v*(l=="-"?-1:1)+a.number/s.doc.lines),m=Math.round(s.doc.lines*v)}else c&&l&&(m=m*(l=="-"?-1:1)+a.number);let g=s.doc.line(Math.max(1,Math.min(s.doc.lines,m))),b=H.cursor(g.from+Math.max(0,Math.min(f,g.length)));t.dispatch({effects:[Bo.of(!1),ie.scrollIntoView(b.from,{y:"center"})],selection:b}),t.focus()}return{dom:r}}const Bo=Ae.define(),bm=ut.define({create(){return!0},update(t,e){for(let n of e.effects)n.is(Bo)&&(t=n.value);return t},provide:t=>es.from(t,e=>e?Nu:null)}),Xj=t=>{let e=Jo(t,Nu);if(!e){let n=[Bo.of(!0)];t.state.field(bm,!1)==null&&n.push(Ae.appendConfig.of([bm,Qj])),t.dispatch({effects:n}),e=Jo(t,Nu)}return e&&e.dom.querySelector("input").select(),!0},Qj=ie.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),Zj={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Jj=he.define({combine(t){return Ln(t,Zj,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function eD(t){return[oD,iD]}const tD=xe.mark({class:"cm-selectionMatch"}),nD=xe.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function vm(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=qe.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=qe.Word)}function rD(t,e,n,r){return t(e.sliceDoc(n,n+1))==qe.Word&&t(e.sliceDoc(r-1,r))==qe.Word}const iD=Je.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(Jj),{state:n}=t,r=n.selection;if(r.ranges.length>1)return xe.none;let i=r.main,o,s=null;if(i.empty){if(!e.highlightWordAroundCursor)return xe.none;let l=n.wordAt(i.head);if(!l)return xe.none;s=n.charCategorizer(i.head),o=n.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l<e.minSelectionLength||l>200)return xe.none;if(e.wholeWords){if(o=n.sliceDoc(i.from,i.to),s=n.charCategorizer(i.head),!(vm(s,n,i.from,i.to)&&rD(s,n,i.from,i.to)))return xe.none}else if(o=n.sliceDoc(i.from,i.to),!o)return xe.none}let a=[];for(let l of t.visibleRanges){let c=new Ki(n.doc,o,l.from,l.to);for(;!c.next().done;){let{from:d,to:h}=c.value;if((!s||vm(s,n,d,h))&&(i.empty&&d<=i.from&&h>=i.to?a.push(nD.range(d,h)):(d>=i.to||h<=i.from)&&a.push(tD.range(d,h)),a.length>e.maxMatches))return xe.none}}return xe.set(a)}},{decorations:t=>t.decorations}),oD=ie.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),sD=({state:t,dispatch:e})=>{let{selection:n}=t,r=H.create(n.ranges.map(i=>t.wordAt(i.head)||H.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(e(t.update({selection:r})),!0)};function aD(t,e){let{main:n,ranges:r}=t.selection,i=t.wordAt(n.head),o=i&&i.from==n.from&&i.to==n.to;for(let s=!1,a=new Ki(t.doc,e,r[r.length-1].to);;)if(a.next(),a.done){if(s)return null;a=new Ki(t.doc,e,0,Math.max(0,r[r.length-1].from-1)),s=!0}else{if(s&&r.some(l=>l.from==a.value.from))continue;if(o){let l=t.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}const lD=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(o=>o.from===o.to))return sD({state:t,dispatch:e});let r=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(o=>t.sliceDoc(o.from,o.to)!=r))return!1;let i=aD(t,r);return i?(e(t.update({selection:t.selection.addRange(H.range(i.from,i.to),!1),effects:ie.scrollIntoView(i.to)})),!0):!1},so=he.define({combine(t){return Ln(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new wD(e),scrollToMatch:e=>ie.scrollIntoView(e)})}});class L5{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||Yj(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?`
|
|
64
|
+
`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new hD(this):new dD(this)}getCursor(e,n=0,r){let i=e.doc?e:Me.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?gi(this,i,n,r):pi(this,i,n,r)}}class N5{constructor(e){this.spec=e}}function pi(t,e,n,r){return new Ki(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:i=>i.toLowerCase(),t.wholeWord?cD(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function cD(t,e){return(n,r,i,o)=>((o>n||o+i.length<r)&&(o=Math.max(0,n-2),i=t.sliceString(o,Math.min(t.length,r+2))),(e(hl(i,n-o))!=qe.Word||e(fl(i,n-o))!=qe.Word)&&(e(fl(i,r-o))!=qe.Word||e(hl(i,r-o))!=qe.Word))}class dD extends N5{constructor(e){super(e)}nextMatch(e,n,r){let i=pi(this.spec,e,r,e.doc.length).nextOverlapping();if(i.done){let o=Math.min(e.doc.length,n+this.spec.unquoted.length);i=pi(this.spec,e,0,o).nextOverlapping()}return i.done||i.value.from==n&&i.value.to==r?null:i.value}prevMatchInRange(e,n,r){for(let i=r;;){let o=Math.max(n,i-1e4-this.spec.unquoted.length),s=pi(this.spec,e,o,i),a=null;for(;!s.nextOverlapping().done;)a=s.value;if(a)return a;if(o==n)return null;i-=1e4}}prevMatch(e,n,r){let i=this.prevMatchInRange(e,0,n);return i||(i=this.prevMatchInRange(e,Math.max(0,r-this.spec.unquoted.length),e.doc.length)),i&&(i.from!=n||i.to!=r)?i:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,n){let r=pi(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let o=pi(this.spec,e,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}function gi(t,e,n,r){return new D5(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?uD(e.charCategorizer(e.selection.main.head)):void 0},n,r)}function hl(t,e){return t.slice(pt(t,e,!1),e)}function fl(t,e){return t.slice(e,pt(t,e))}function uD(t){return(e,n,r)=>!r[0].length||(t(hl(r.input,r.index))!=qe.Word||t(fl(r.input,r.index))!=qe.Word)&&(t(fl(r.input,r.index+r[0].length))!=qe.Word||t(hl(r.input,r.index+r[0].length))!=qe.Word)}class hD extends N5{nextMatch(e,n,r){let i=gi(this.spec,e,r,e.doc.length).next();return i.done&&(i=gi(this.spec,e,0,n).next()),i.done?null:i.value}prevMatchInRange(e,n,r){for(let i=1;;i++){let o=Math.max(n,r-i*1e4),s=gi(this.spec,e,o,r),a=null;for(;!s.next().done;)a=s.value;if(a&&(o==n||a.from>o+10))return a;if(o==n)return null}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,r)=>{if(r=="&")return e.match[0];if(r=="$")return"$";for(let i=r.length;i>0;i--){let o=+r.slice(0,i);if(o>0&&o<e.match.length)return e.match[o]+r.slice(i)}return n})}matchAll(e,n){let r=gi(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let o=gi(this.spec,e,Math.max(0,n-250),Math.min(r+250,e.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}const ns=Ae.define(),Df=Ae.define(),fr=ut.define({create(t){return new od(Bu(t).create(),null)},update(t,e){for(let n of e.effects)n.is(ns)?t=new od(n.value.create(),t.panel):n.is(Df)&&(t=new od(t.query,n.value?Of:null));return t},provide:t=>es.from(t,e=>e.panel)});class od{constructor(e,n){this.query=e,this.panel=n}}const fD=xe.mark({class:"cm-searchMatch"}),mD=xe.mark({class:"cm-searchMatch cm-searchMatch-selected"}),pD=Je.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(fr))}update(t){let e=t.state.field(fr);(e!=t.startState.field(fr)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return xe.none;let{view:n}=this,r=new Xn;for(let i=0,o=n.visibleRanges,s=o.length;i<s;i++){let{from:a,to:l}=o[i];for(;i<s-1&&l>o[i+1].from-2*250;)l=o[++i].to;t.highlight(n.state,a,l,(c,d)=>{let h=n.state.selection.ranges.some(f=>f.from==c&&f.to==d);r.add(c,d,h?mD:fD)})}return r.finish()}},{decorations:t=>t.decorations});function As(t){return e=>{let n=e.state.field(fr,!1);return n&&n.query.spec.valid?t(e,n):V5(e)}}const ml=As((t,{query:e})=>{let{to:n}=t.state.selection.main,r=e.nextMatch(t.state,n,n);if(!r)return!1;let i=H.single(r.from,r.to),o=t.state.facet(so);return t.dispatch({selection:i,effects:[Lf(t,r),o.scrollToMatch(i.main,t)],userEvent:"select.search"}),F5(t),!0}),pl=As((t,{query:e})=>{let{state:n}=t,{from:r}=n.selection.main,i=e.prevMatch(n,r,r);if(!i)return!1;let o=H.single(i.from,i.to),s=t.state.facet(so);return t.dispatch({selection:o,effects:[Lf(t,i),s.scrollToMatch(o.main,t)],userEvent:"select.search"}),F5(t),!0}),gD=As((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:H.create(n.map(r=>H.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),bD=({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,o=[],s=0;for(let a=new Ki(t.doc,t.sliceDoc(r,i));!a.next().done;){if(o.length>1e3)return!1;a.value.from==r&&(s=o.length),o.push(H.range(a.value.from,a.value.to))}return e(t.update({selection:H.create(o,s),userEvent:"select.search.matches"})),!0},xm=As((t,{query:e})=>{let{state:n}=t,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let o=e.nextMatch(n,r,r);if(!o)return!1;let s=o,a=[],l,c,d=[];if(s.from==r&&s.to==i&&(c=n.toText(e.getReplacement(s)),a.push({from:s.from,to:s.to,insert:c}),s=e.nextMatch(n,s.from,s.to),d.push(ie.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))),s){let h=a.length==0||a[0].from>=o.to?0:o.to-o.from-c.length;l=H.single(s.from-h,s.to-h),d.push(Lf(t,s)),d.push(n.facet(so).scrollToMatch(l.main,t))}return t.dispatch({changes:a,selection:l,effects:d,userEvent:"input.replace"}),!0}),vD=As((t,{query:e})=>{if(t.state.readOnly)return!1;let n=e.matchAll(t.state,1e9).map(i=>{let{from:o,to:s}=i;return{from:o,to:s,insert:e.getReplacement(i)}});if(!n.length)return!1;let r=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:ie.announce.of(r),userEvent:"input.replace.all"}),!0});function Of(t){return t.state.facet(so).createPanel(t)}function Bu(t,e){var n,r,i,o,s;let a=t.selection.main,l=a.empty||a.to>a.from+100?"":t.sliceDoc(a.from,a.to);if(e&&!l)return e;let c=t.facet(so);return new L5({search:((n=e?.literal)!==null&&n!==void 0?n:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(r=e?.caseSensitive)!==null&&r!==void 0?r:c.caseSensitive,literal:(i=e?.literal)!==null&&i!==void 0?i:c.literal,regexp:(o=e?.regexp)!==null&&o!==void 0?o:c.regexp,wholeWord:(s=e?.wholeWord)!==null&&s!==void 0?s:c.wholeWord})}function B5(t){let e=Jo(t,Of);return e&&e.dom.querySelector("[main-field]")}function F5(t){let e=B5(t);e&&e==t.root.activeElement&&e.select()}const V5=t=>{let e=t.state.field(fr,!1);if(e&&e.panel){let n=B5(t);if(n&&n!=t.root.activeElement){let r=Bu(t.state,e.query.spec);r.valid&&t.dispatch({effects:ns.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[Df.of(!0),e?ns.of(Bu(t.state,e.query.spec)):Ae.appendConfig.of(CD)]});return!0},_5=t=>{let e=t.state.field(fr,!1);if(!e||!e.panel)return!1;let n=Jo(t,Of);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:Df.of(!1)}),!0},xD=[{key:"Mod-f",run:V5,scope:"editor search-panel"},{key:"F3",run:ml,shift:pl,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:ml,shift:pl,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:_5,scope:"editor search-panel"},{key:"Mod-Shift-l",run:bD},{key:"Mod-Alt-g",run:Xj},{key:"Mod-d",run:lD,preventDefault:!0}];class wD{constructor(e){this.view=e;let n=this.query=e.state.field(fr).query.spec;this.commit=this.commit.bind(this),this.searchField=_e("input",{value:n.search,placeholder:Vt(e,"Find"),"aria-label":Vt(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=_e("input",{value:n.replace,placeholder:Vt(e,"Replace"),"aria-label":Vt(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=_e("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=_e("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=_e("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,o,s){return _e("button",{class:"cm-button",name:i,onclick:o,type:"button"},s)}this.dom=_e("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>ml(e),[Vt(e,"next")]),r("prev",()=>pl(e),[Vt(e,"previous")]),r("select",()=>gD(e),[Vt(e,"all")]),_e("label",null,[this.caseField,Vt(e,"match case")]),_e("label",null,[this.reField,Vt(e,"regexp")]),_e("label",null,[this.wordField,Vt(e,"by word")]),...e.state.readOnly?[]:[_e("br"),this.replaceField,r("replace",()=>xm(e),[Vt(e,"replace")]),r("replaceAll",()=>vD(e),[Vt(e,"replace all")])],_e("button",{name:"close",onclick:()=>_5(e),"aria-label":Vt(e,"close"),type:"button"},["×"])])}commit(){let e=new L5({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:ns.of(e)}))}keydown(e){FM(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?pl:ml)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),xm(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(ns)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(so).top}}function Vt(t,e){return t.state.phrase(e)}const ha=30,fa=/[\s\.,:;?!]/;function Lf(t,{from:e,to:n}){let r=t.state.doc.lineAt(e),i=t.state.doc.lineAt(n).to,o=Math.max(r.from,e-ha),s=Math.min(i,n+ha),a=t.state.sliceDoc(o,s);if(o!=r.from){for(let l=0;l<ha;l++)if(!fa.test(a[l+1])&&fa.test(a[l])){a=a.slice(l);break}}if(s!=i){for(let l=a.length-1;l>a.length-ha;l--)if(!fa.test(a[l-1])&&fa.test(a[l])){a=a.slice(0,l);break}}return ie.announce.of(`${t.state.phrase("current match")}. ${a} ${t.state.phrase("on line")} ${r.number}.`)}const yD=ie.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),CD=[fr,si.low(pD),yD];class z5{constructor(e,n,r,i){this.state=e,this.pos=n,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=Ct(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),o=i.search(H5(e,!1));return o<0?null:{from:r+o,to:this.pos,text:i.slice(o)}}get aborted(){return this.abortListeners==null}addEventListener(e,n,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function wm(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function $D(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let o=1;o<i.length;o++)n[i[o]]=!0}let r=wm(e)+wm(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function SD(t){let e=t.map(i=>typeof i=="string"?{label:i}:i),[n,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:$D(e);return i=>{let o=i.matchBefore(r);return o||i.explicit?{from:o?o.from:i.pos,options:e,validFor:n}:null}}let ym=class{constructor(e,n,r,i){this.completion=e,this.source=n,this.match=r,this.score=i}};function zr(t){return t.selection.main.from}function H5(t,e){var n;let{source:r}=t,i=e&&r[0]!="^",o=r[r.length-1]!="$";return!i&&!o?t:new RegExp(`${i?"^":""}(?:${r})${o?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":"")}const P5=On.define();function kD(t,e,n,r){let{main:i}=t.selection,o=n-i.from,s=r-i.from;return Object.assign(Object.assign({},t.changeByRange(a=>{if(a!=i&&n!=r&&t.sliceDoc(a.from+o,a.from+s)!=t.sliceDoc(n,r))return{range:a};let l=t.toText(e);return{changes:{from:a.from+o,to:r==i.from?a.to:a.from+s,insert:l},range:H.cursor(a.from+o+l.length)}})),{scrollIntoView:!0,userEvent:"input.complete"})}const Cm=new WeakMap;function AD(t){if(!Array.isArray(t))return t;let e=Cm.get(t);return e||Cm.set(t,e=SD(t)),e}const gl=Ae.define(),rs=Ae.define();class RD{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n<e.length;){let r=Et(e,n),i=xn(r);this.chars.push(r);let o=e.slice(n,n+i),s=o.toUpperCase();this.folded.push(Et(s==o?o.toLowerCase():s,0)),n+=i}this.astral=e.length!=this.chars.length}ret(e,n){return this.score=e,this.matched=n,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:n,folded:r,any:i,precise:o,byWord:s}=this;if(n.length==1){let y=Et(e,0),$=xn(y),k=$==e.length?0:-100;if(y!=n[0])if(y==r[0])k+=-200;else return null;return this.ret(k,[0,$])}let a=e.indexOf(this.pattern);if(a==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let l=n.length,c=0;if(a<0){for(let y=0,$=Math.min(e.length,200);y<$&&c<l;){let k=Et(e,y);(k==n[c]||k==r[c])&&(i[c++]=y),y+=xn(k)}if(c<l)return null}let d=0,h=0,f=!1,m=0,g=-1,b=-1,v=/[a-z]/.test(e),x=!0;for(let y=0,$=Math.min(e.length,200),k=0;y<$&&h<l;){let S=Et(e,y);a<0&&(d<l&&S==n[d]&&(o[d++]=y),m<l&&(S==n[m]||S==r[m]?(m==0&&(g=y),b=y+1,m++):m=0));let R,A=S<255?S>=48&&S<=57||S>=97&&S<=122?2:S>=65&&S<=90?1:0:(R=uf(S))!=R.toLowerCase()?1:R!=R.toUpperCase()?2:0;(!y||A==1&&v||k==0&&A!=0)&&(n[h]==S||r[h]==S&&(f=!0)?s[h++]=y:s.length&&(x=!1)),k=A,y+=xn(S)}return h==l&&s[0]==0&&x?this.result(-100+(f?-200:0),s,e):m==l&&g==0?this.ret(-200-e.length+(b==e.length?0:-100),[0,b]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):m==l?this.ret(-900-e.length,[g,b]):h==l?this.result(-100+(f?-200:0)+-700+(x?0:-1100),s,e):n.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,n,r){let i=[],o=0;for(let s of n){let a=s+(this.astral?xn(Et(r,s)):1);o&&i[o-1]==s?i[o-1]=a:(i[o++]=s,i[o++]=a)}return this.ret(e-r.length,i)}}class TD{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let n=e.slice(0,this.pattern.length),r=n==this.pattern?0:n.toLowerCase()==this.folded?-200:null;return r==null?null:(this.matched=[0,n.length],this.score=r+(e.length==this.pattern.length?0:-100),this)}}const ct=he.define({combine(t){return Ln(t,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:MD,filterStrict:!1,compareCompletions:(e,n)=>e.label.localeCompare(n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,n)=>e&&n,closeOnBlur:(e,n)=>e&&n,icons:(e,n)=>e&&n,tooltipClass:(e,n)=>r=>$m(e(r),n(r)),optionClass:(e,n)=>r=>$m(e(r),n(r)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function $m(t,e){return t?e?t+" "+e:t:e}function MD(t,e,n,r,i,o){let s=t.textDirection==We.RTL,a=s,l=!1,c="top",d,h,f=e.left-i.left,m=i.right-e.right,g=r.right-r.left,b=r.bottom-r.top;if(a&&f<Math.min(g,m)?a=!1:!a&&m<Math.min(g,f)&&(a=!0),g<=(a?f:m))d=Math.max(i.top,Math.min(n.top,i.bottom-b))-e.top,h=Math.min(400,a?f:m);else{l=!0,h=Math.min(400,(s?e.right:i.right-e.left)-30);let y=i.bottom-e.bottom;y>=b||y>e.top?d=n.bottom-e.top:(c="bottom",d=e.bottom-n.top)}let v=(e.bottom-e.top)/o.offsetHeight,x=(e.right-e.left)/o.offsetWidth;return{style:`${c}: ${d/v}px; max-width: ${h/x}px`,class:"cm-completionInfo-"+(l?s?"left-narrow":"right-narrow":a?"left":"right")}}function ED(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(n,r,i,o){let s=document.createElement("span");s.className="cm-completionLabel";let a=n.displayLabel||n.label,l=0;for(let c=0;c<o.length;){let d=o[c++],h=o[c++];d>l&&s.appendChild(document.createTextNode(a.slice(l,d)));let f=s.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(a.slice(d,h))),f.className="cm-completionMatchedText",l=h}return l<a.length&&s.appendChild(document.createTextNode(a.slice(l))),s},position:50},{render(n){if(!n.detail)return null;let r=document.createElement("span");return r.className="cm-completionDetail",r.textContent=n.detail,r},position:80}),e.sort((n,r)=>n.position-r.position).map(n=>n.render)}function sd(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let i=Math.floor(e/n);return{from:i*n,to:(i+1)*n}}let r=Math.floor((t-e)/n);return{from:t-(r+1)*n,to:t-r*n}}class ID{constructor(e,n,r){this.view=e,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let i=e.state.field(n),{options:o,selected:s}=i.open,a=e.state.facet(ct);this.optionContent=ED(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=sd(o.length,s,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",l=>{let{options:c}=e.state.field(n).open;for(let d=l.target,h;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(h=/-(\d+)$/.exec(d.id))&&+h[1]<c.length){this.applyCompletion(e,c[+h[1]]),l.preventDefault();return}}),this.dom.addEventListener("focusout",l=>{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(ct).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:rs.of(null)})}),this.showOptions(o,i.id)}mount(){this.updateSel()}showOptions(e,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var n;let r=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=i){let{options:o,selected:s,disabled:a}=r.open;(!i.open||i.open.options!=o)&&(this.range=sd(o.length,s,e.state.facet(ct).maxRenderedOptions),this.showOptions(o,r.id)),this.updateSel(),a!=((n=i.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let n=this.tooltipClass(e);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),n=e.open;if((n.selected>-1&&n.selected<this.range.from||n.selected>=this.range.to)&&(this.range=sd(n.options.length,n.selected,this.view.state.facet(ct).maxRenderedOptions),this.showOptions(n.options,e.id)),this.updateSelectedOption(n.selected)){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:i}=r;if(!i)return;let o=typeof i=="string"?document.createTextNode(i):i(r);if(!o)return;"then"in o?o.then(s=>{s&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(s,r)}).catch(s=>Dt(this.view.state,s,"completion info")):this.addInfoPane(o,r)}}addInfoPane(e,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:o}=e;r.appendChild(i),this.infoDestroy=o||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let n=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&r.removeAttribute("aria-selected");return n&&DD(this.list,n),n}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),o=this.space;if(!o){let s=this.dom.ownerDocument.documentElement;o={left:0,top:0,right:s.clientWidth,bottom:s.clientHeight}}return i.top>Math.min(o.bottom,n.bottom)-10||i.bottom<Math.max(o.top,n.top)+10?null:this.view.state.facet(ct).positionInfo(this.view,n,i,r,o,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,n,r){const i=document.createElement("ul");i.id=n,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions")),i.addEventListener("mousedown",s=>{s.target==i&&s.preventDefault()});let o=null;for(let s=r.from;s<r.to;s++){let{completion:a,match:l}=e[s],{section:c}=a;if(c){let f=typeof c=="string"?c:c.name;if(f!=o&&(s>r.from||r.from==0))if(o=f,typeof c!="string"&&c.header)i.appendChild(c.header(c));else{let m=i.appendChild(document.createElement("completion-section"));m.textContent=f}}const d=i.appendChild(document.createElement("li"));d.id=n+"-"+s,d.setAttribute("role","option");let h=this.optionClass(a);h&&(d.className=h);for(let f of this.optionContent){let m=f(a,this.view.state,this.view,l);m&&d.appendChild(m)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.to<e.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function jD(t,e){return n=>new ID(n,t,e)}function DD(t,e){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=n.height/t.offsetHeight;r.top<n.top?t.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(t.scrollTop+=(r.bottom-n.bottom)/i)}function Sm(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function OD(t,e){let n=[],r=null,i=c=>{n.push(c);let{section:d}=c.completion;if(d){r||(r=[]);let h=typeof d=="string"?d:d.name;r.some(f=>f.name==h)||r.push(typeof d=="string"?{name:h}:d)}},o=e.facet(ct);for(let c of t)if(c.hasResult()){let d=c.result.getMatch;if(c.result.filter===!1)for(let h of c.result.options)i(new ym(h,c.source,d?d(h):[],1e9-n.length));else{let h=e.sliceDoc(c.from,c.to),f,m=o.filterStrict?new TD(h):new RD(h);for(let g of c.result.options)if(f=m.match(g.label)){let b=g.displayLabel?d?d(g,f.matched):[]:f.matched;i(new ym(g,c.source,b,f.score+(g.boost||0)))}}}if(r){let c=Object.create(null),d=0,h=(f,m)=>{var g,b;return((g=f.rank)!==null&&g!==void 0?g:1e9)-((b=m.rank)!==null&&b!==void 0?b:1e9)||(f.name<m.name?-1:1)};for(let f of r.sort(h))d-=1e5,c[f.name]=d;for(let f of n){let{section:m}=f.completion;m&&(f.score+=c[typeof m=="string"?m:m.name])}}let s=[],a=null,l=o.compareCompletions;for(let c of n.sort((d,h)=>h.score-d.score||l(d.completion,h.completion))){let d=c.completion;!a||a.label!=d.label||a.detail!=d.detail||a.type!=null&&d.type!=null&&a.type!=d.type||a.apply!=d.apply||a.boost!=d.boost?s.push(c):Sm(c.completion)>Sm(a)&&(s[s.length-1]=c),a=c.completion}return s}class xi{constructor(e,n,r,i,o,s){this.options=e,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=o,this.disabled=s}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new xi(this.options,km(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,i,o,s){if(i&&!s&&e.some(c=>c.isPending))return i.setDisabled();let a=OD(e,n);if(!a.length)return i&&e.some(c=>c.isPending)?i.setDisabled():null;let l=n.facet(ct).selectOnOpen?0:-1;if(i&&i.selected!=l&&i.selected!=-1){let c=i.options[i.selected].completion;for(let d=0;d<a.length;d++)if(a[d].completion==c){l=d;break}}return new xi(a,km(r,l),{pos:e.reduce((c,d)=>d.hasResult()?Math.min(c,d.from):c,1e8),create:_D,above:o.aboveCursor},i?i.timestamp:Date.now(),l,!1)}map(e){return new xi(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new xi(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class bl{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new bl(FD,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(ct),o=(r.override||n.languageDataAt("autocomplete",zr(n)).map(AD)).map(l=>(this.active.find(d=>d.source==l)||new Ut(l,this.active.some(d=>d.state!=0)?1:0)).update(e,r));o.length==this.active.length&&o.every((l,c)=>l==this.active[c])&&(o=this.active);let s=this.open,a=e.effects.some(l=>l.is(Nf));s&&e.docChanged&&(s=s.map(e.changes)),e.selection||o.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!LD(o,this.active)||a?s=xi.build(o,n,this.id,s,r,a):s&&s.disabled&&!o.some(l=>l.isPending)&&(s=null),!s&&o.every(l=>!l.isPending)&&o.some(l=>l.hasResult())&&(o=o.map(l=>l.hasResult()?new Ut(l.source,0):l));for(let l of e.effects)l.is(q5)&&(s=s&&s.setSelected(l.value,this.id));return o==this.active&&s==this.open?this:new bl(o,this.id,s)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?ND:BD}}function LD(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n<t.length&&!t[n].hasResult();)n++;for(;r<e.length&&!e[r].hasResult();)r++;let i=n==t.length,o=r==e.length;if(i||o)return i==o;if(t[n++].result!=e[r++].result)return!1}}const ND={"aria-autocomplete":"list"},BD={};function km(t,e){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(n["aria-activedescendant"]=t+"-"+e),n}const FD=[];function W5(t,e){if(t.isUserEvent("input.complete")){let r=t.annotation(P5);if(r&&e.activateOnCompletion(r))return 12}let n=t.isUserEvent("input.type");return n&&e.activateOnTyping?5:n?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class Ut{constructor(e,n,r=!1){this.source=e,this.state=n,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(e,n){let r=W5(e,n),i=this;(r&8||r&16&&this.touches(e))&&(i=new Ut(i.source,0)),r&4&&i.state==0&&(i=new Ut(this.source,1)),i=i.updateFor(e,r);for(let o of e.effects)if(o.is(gl))i=new Ut(i.source,1,o.value);else if(o.is(rs))i=new Ut(i.source,0);else if(o.is(Nf))for(let s of o.value)s.source==i.source&&(i=s);return i}updateFor(e,n){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(zr(e.state))}}class Ii extends Ut{constructor(e,n,r,i,o,s){super(e,3,n),this.limit=r,this.result=i,this.from=o,this.to=s}hasResult(){return!0}updateFor(e,n){var r;if(!(n&3))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let o=e.changes.mapPos(this.from),s=e.changes.mapPos(this.to,1),a=zr(e.state);if(a>s||!i||n&2&&(zr(e.startState)==this.from||a<this.limit))return new Ut(this.source,n&4?1:0);let l=e.changes.mapPos(this.limit);return VD(i.validFor,e.state,o,s)?new Ii(this.source,this.explicit,l,i,o,s):i.update&&(i=i.update(i,o,s,new z5(e.state,a,!1)))?new Ii(this.source,this.explicit,l,i,i.from,(r=i.to)!==null&&r!==void 0?r:zr(e.state)):new Ut(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new Ii(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Ut(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function VD(t,e,n,r){if(!t)return!1;let i=e.sliceDoc(n,r);return typeof t=="function"?t(i,n,r,e):H5(t,!0).test(i)}const Nf=Ae.define({map(t,e){return t.map(n=>n.map(e))}}),q5=Ae.define(),jt=ut.define({create(){return bl.start()},update(t,e){return t.update(e)},provide:t=>[Af.from(t,e=>e.tooltip),ie.contentAttributes.from(t,e=>e.attrs)]});function Bf(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(jt).active.find(i=>i.source==e.source);return r instanceof Ii?(typeof n=="string"?t.dispatch(Object.assign(Object.assign({},kD(t.state,n,r.from,r.to)),{annotations:P5.of(e.completion)})):n(t,e.completion,r.from,r.to),!0):!1}const _D=jD(jt,Bf);function ma(t,e="option"){return n=>{let r=n.state.field(jt,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(ct).interactionDelay)return!1;let i=1,o;e=="page"&&(o=Dv(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:s}=r.open.options,a=r.open.selected>-1?r.open.selected+i*(t?1:-1):t?0:s-1;return a<0?a=e=="page"?0:s-1:a>=s&&(a=e=="page"?s-1:0),n.dispatch({effects:q5.of(a)}),!0}}const zD=t=>{let e=t.state.field(jt,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<t.state.facet(ct).interactionDelay?!1:Bf(t,e.open.options[e.open.selected])},Am=t=>t.state.field(jt,!1)?(t.dispatch({effects:gl.of(!0)}),!0):!1,HD=t=>{let e=t.state.field(jt,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:rs.of(null)}),!0)};class PD{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const WD=50,qD=1e3,UD=Je.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(jt).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(jt),n=t.state.facet(ct);if(!t.selectionSet&&!t.docChanged&&t.startState.field(jt)==e)return;let r=t.transactions.some(o=>{let s=W5(o,n);return s&8||(o.selection||o.docChanged)&&!(s&3)});for(let o=0;o<this.running.length;o++){let s=this.running[o];if(r||s.context.abortOnDocChange&&t.docChanged||s.updates.length+t.transactions.length>WD&&Date.now()-s.time>qD){for(let a of s.context.abortListeners)try{a()}catch(l){Dt(this.view.state,l)}s.context.abortListeners=null,this.running.splice(o--,1)}else s.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(o=>o.effects.some(s=>s.is(gl)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(o=>o.isPending&&!this.running.some(s=>s.active.source==o.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let o of t.transactions)o.isUserEvent("input.type")?this.composing=2:this.composing==2&&o.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(jt);for(let n of e.active)n.isPending&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(ct).updateSyncTime))}startQuery(t){let{state:e}=this.view,n=zr(e),r=new z5(e,n,t.explicit,this.view),i=new PD(t,r);this.running.push(i),Promise.resolve(t.source(r)).then(o=>{i.context.aborted||(i.done=o||null,this.scheduleAccept())},o=>{this.view.dispatch({effects:rs.of(null)}),Dt(this.view.state,o)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(ct).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(ct),r=this.view.state.field(jt);for(let i=0;i<this.running.length;i++){let o=this.running[i];if(o.done===void 0)continue;if(this.running.splice(i--,1),o.done){let a=zr(o.updates.length?o.updates[0].startState:this.view.state),l=Math.min(a,o.done.from+(o.active.explicit?0:1)),c=new Ii(o.active.source,o.active.explicit,l,o.done,o.done.from,(t=o.done.to)!==null&&t!==void 0?t:a);for(let d of o.updates)c=c.update(d,n);if(c.hasResult()){e.push(c);continue}}let s=r.active.find(a=>a.source==o.active.source);if(s&&s.isPending)if(o.done==null){let a=new Ut(o.active.source,0);for(let l of o.updates)a=a.update(l,n);a.isPending||e.push(a)}else this.startQuery(s)}(e.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:Nf.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(jt,!1);if(e&&e.tooltip&&this.view.state.facet(ct).closeOnBlur){let n=e.open&&Dv(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:rs.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:gl.of(!1)}),20),this.composing=0}}}),KD=typeof navigator=="object"&&/Win/.test(navigator.platform),GD=si.highest(ie.domEventHandlers({keydown(t,e){let n=e.state.field(jt,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(KD&&t.altKey)||t.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(s=>s.source==r.source),o=r.completion.commitCharacters||i.result.commitCharacters;return o&&o.indexOf(t.key)>-1&&Bf(e,r),!1}})),YD=ie.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),is={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Nr=Ae.define({map(t,e){let n=e.mapPos(t,-1,kt.TrackAfter);return n??void 0}}),Ff=new class extends Kr{};Ff.startSide=1;Ff.endSide=-1;const U5=ut.define({create(){return De.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(Nr)&&(t=t.update({add:[Ff.range(n.value,n.value+1)]}));return t}});function XD(){return[ZD,U5]}const ad="()[]{}<>«»»«[]{}";function K5(t){for(let e=0;e<ad.length;e+=2)if(ad.charCodeAt(e)==t)return ad.charAt(e+1);return uf(t<128?t:t+1)}function G5(t,e){return t.languageDataAt("closeBrackets",e)[0]||is}const QD=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),ZD=ie.inputHandler.of((t,e,n,r)=>{if((QD?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(r.length>2||r.length==2&&xn(Et(r,0))==1||e!=i.from||n!=i.to)return!1;let o=tO(t.state,r);return o?(t.dispatch(o),!0):!1}),JD=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=G5(t,t.selection.main.head).brackets||is.brackets,i=null,o=t.changeByRange(s=>{if(s.empty){let a=nO(t.doc,s.head);for(let l of r)if(l==a&&lc(t.doc,s.head)==K5(Et(l,0)))return{changes:{from:s.head-l.length,to:s.head+l.length},range:H.cursor(s.head-l.length)}}return{range:i=s}});return i||e(t.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},eO=[{key:"Backspace",run:JD}];function tO(t,e){let n=G5(t,t.selection.main.head),r=n.brackets||is.brackets;for(let i of r){let o=K5(Et(i,0));if(e==i)return o==i?oO(t,i,r.indexOf(i+i+i)>-1,n):rO(t,i,o,n.before||is.before);if(e==o&&Y5(t,t.selection.main.from))return iO(t,i,o)}return null}function Y5(t,e){let n=!1;return t.field(U5).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function lc(t,e){let n=t.sliceString(e,e+2);return n.slice(0,xn(Et(n,0)))}function nO(t,e){let n=t.sliceString(e-2,e);return xn(Et(n,0))==n.length?n:n.slice(1)}function rO(t,e,n,r){let i=null,o=t.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:n,from:s.to}],effects:Nr.of(s.to+e.length),range:H.range(s.anchor+e.length,s.head+e.length)};let a=lc(t.doc,s.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:e+n,from:s.head},effects:Nr.of(s.head+e.length),range:H.cursor(s.head+e.length)}:{range:i=s}});return i?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function iO(t,e,n){let r=null,i=t.changeByRange(o=>o.empty&&lc(t.doc,o.head)==n?{changes:{from:o.head,to:o.head+n.length,insert:n},range:H.cursor(o.head+n.length)}:r={range:o});return r?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function oO(t,e,n,r){let i=r.stringPrefixes||is.stringPrefixes,o=null,s=t.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:e,from:a.to}],effects:Nr.of(a.to+e.length),range:H.range(a.anchor+e.length,a.head+e.length)};let l=a.head,c=lc(t.doc,l),d;if(c==e){if(Rm(t,l))return{changes:{insert:e+e,from:l},effects:Nr.of(l+e.length),range:H.cursor(l+e.length)};if(Y5(t,l)){let f=n&&t.sliceDoc(l,l+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+f.length,insert:f},range:H.cursor(l+f.length)}}}else{if(n&&t.sliceDoc(l-2*e.length,l)==e+e&&(d=Tm(t,l-2*e.length,i))>-1&&Rm(t,d))return{changes:{insert:e+e+e+e,from:l},effects:Nr.of(l+e.length),range:H.cursor(l+e.length)};if(t.charCategorizer(l)(c)!=qe.Word&&Tm(t,l,i)>-1&&!sO(t,l,e,i))return{changes:{insert:e+e,from:l},effects:Nr.of(l+e.length),range:H.cursor(l+e.length)}}return{range:o=a}});return o?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Rm(t,e){let n=Ct(t).resolveInner(e+1);return n.parent&&n.from==e}function sO(t,e,n,r){let i=Ct(t).resolveInner(e,-1),o=r.reduce((s,a)=>Math.max(s,a.length),0);for(let s=0;s<5;s++){let a=t.sliceDoc(i.from,Math.min(i.to,i.from+n.length+o)),l=a.indexOf(n);if(!l||l>-1&&r.indexOf(a.slice(0,l))>-1){let d=i.firstChild;for(;d&&d.from==i.from&&d.to-d.from>n.length+l;){if(t.sliceDoc(d.to-n.length,d.to)==n)return!1;d=d.firstChild}return!0}let c=i.to==e&&i.parent;if(!c)break;i=c}return!1}function Tm(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=qe.Word)return e;for(let i of n){let o=e-i.length;if(t.sliceDoc(o,e)==i&&r(t.sliceDoc(o-1,o))!=qe.Word)return o}return-1}function aO(t={}){return[GD,jt,ct.of(t),UD,lO,YD]}const X5=[{key:"Ctrl-Space",run:Am},{mac:"Alt-`",run:Am},{key:"Escape",run:HD},{key:"ArrowDown",run:ma(!0)},{key:"ArrowUp",run:ma(!1)},{key:"PageDown",run:ma(!0,"page")},{key:"PageUp",run:ma(!1,"page")},{key:"Enter",run:zD}],lO=si.highest(Jl.computeN([ct],t=>t.facet(ct).defaultKeymap?[X5]:[]));class Mm{constructor(e,n,r){this.from=e,this.to=n,this.diagnostic=r}}class Or{constructor(e,n,r){this.diagnostics=e,this.panel=n,this.selected=r}static init(e,n,r){let i=r.facet(os).markerFilter;i&&(e=i(e,r));let o=e.slice().sort((d,h)=>d.from-h.from||d.to-h.to),s=new Xn,a=[],l=0;for(let d=0;;){let h=d==o.length?null:o[d];if(!h&&!a.length)break;let f,m;for(a.length?(f=l,m=a.reduce((b,v)=>Math.min(b,v.to),h&&h.from>f?h.from:1e8)):(f=h.from,m=h.to,a.push(h),d++);d<o.length;){let b=o[d];if(b.from==f&&(b.to>b.from||b.to==f))a.push(b),d++,m=Math.min(b.to,m);else{m=Math.min(b.from,m);break}}let g=yO(a);if(a.some(b=>b.from==b.to||b.from==b.to-1&&r.doc.lineAt(b.from).to==b.from))s.add(f,f,xe.widget({widget:new bO(g),diagnostics:a.slice()}));else{let b=a.reduce((v,x)=>x.markClass?v+" "+x.markClass:v,"");s.add(f,m,xe.mark({class:"cm-lintRange cm-lintRange-"+g+b,diagnostics:a.slice(),inclusiveEnd:a.some(v=>v.to>m)}))}l=m;for(let b=0;b<a.length;b++)a[b].to<=l&&a.splice(b--,1)}let c=s.finish();return new Or(c,n,Gi(c))}}function Gi(t,e=null,n=0){let r=null;return t.between(n,1e9,(i,o,{spec:s})=>{if(!(e&&s.diagnostics.indexOf(e)<0))if(!r)r=new Mm(i,o,e||s.diagnostics[0]);else{if(s.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new Mm(r.from,o,r.diagnostic)}}),r}function cO(t,e){let n=e.pos,r=e.end||n,i=t.state.facet(os).hideOn(t,n,r);if(i!=null)return i;let o=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(s=>s.is(Q5))||t.changes.touchesRange(o.from,Math.max(o.to,r)))}function dO(t,e){return t.field(Pt,!1)?e:e.concat(Ae.appendConfig.of(CO))}const Q5=Ae.define(),Vf=Ae.define(),Z5=Ae.define(),Pt=ut.define({create(){return new Or(xe.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),r=null,i=t.panel;if(t.selected){let o=e.changes.mapPos(t.selected.from,1);r=Gi(n,t.selected.diagnostic,o)||Gi(n,null,o)}!n.size&&i&&e.state.facet(os).autoPanel&&(i=null),t=new Or(n,i,r)}for(let n of e.effects)if(n.is(Q5)){let r=e.state.facet(os).autoPanel?n.value.length?ss.open:null:t.panel;t=Or.init(n.value,r,e.state)}else n.is(Vf)?t=new Or(t.diagnostics,n.value?ss.open:null,t.selected):n.is(Z5)&&(t=new Or(t.diagnostics,t.panel,n.value));return t},provide:t=>[es.from(t,e=>e.panel),ie.decorations.from(t,e=>e.diagnostics)]}),uO=xe.mark({class:"cm-lintRange cm-lintRange-active"});function hO(t,e,n){let{diagnostics:r}=t.state.field(Pt),i,o=-1,s=-1;r.between(e-(n<0?1:0),e+(n>0?1:0),(l,c,{spec:d})=>{if(e>=l&&e<=c&&(l==c||(e>l||n>0)&&(e<c||n<0)))return i=d.diagnostics,o=l,s=c,!1});let a=t.state.facet(os).tooltipFilter;return i&&a&&(i=a(i,t.state)),i?{pos:o,end:s,above:t.state.doc.lineAt(o).to<s,create(){return{dom:fO(t,i)}}}:null}function fO(t,e){return _e("ul",{class:"cm-tooltip-lint"},e.map(n=>ex(t,n,!1)))}const mO=t=>{let e=t.state.field(Pt,!1);(!e||!e.panel)&&t.dispatch({effects:dO(t.state,[Vf.of(!0)])});let n=Jo(t,ss.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},Em=t=>{let e=t.state.field(Pt,!1);return!e||!e.panel?!1:(t.dispatch({effects:Vf.of(!1)}),!0)},pO=t=>{let e=t.state.field(Pt,!1);if(!e)return!1;let n=t.state.selection.main,r=e.diagnostics.iter(n.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)?!1:(t.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},gO=[{key:"Mod-Shift-m",run:mO,preventDefault:!0},{key:"F8",run:pO}],os=he.define({combine(t){return Object.assign({sources:t.map(e=>e.source).filter(e=>e!=null)},Ln(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,n)=>e?n?r=>e(r)||n(r):e:n}))}});function J5(t){let e=[];if(t)e:for(let{name:n}of t){for(let r=0;r<n.length;r++){let i=n[r];if(/[a-zA-Z]/.test(i)&&!e.some(o=>o.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function ex(t,e,n){var r;let i=n?J5(e.actions):[];return _e("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},_e("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((o,s)=>{let a=!1,l=f=>{if(f.preventDefault(),a)return;a=!0;let m=Gi(t.state.field(Pt).diagnostics,e);m&&o.apply(t,m.from,m.to)},{name:c}=o,d=i[s]?c.indexOf(i[s]):-1,h=d<0?c:[c.slice(0,d),_e("u",c.slice(d,d+1)),c.slice(d+1)];return _e("button",{type:"button",class:"cm-diagnosticAction",onclick:l,onmousedown:l,"aria-label":` Action: ${c}${d<0?"":` (access key "${i[s]})"`}.`},h)}),e.source&&_e("div",{class:"cm-diagnosticSource"},e.source))}class bO extends ir{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return _e("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class Im{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=ex(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class ss{constructor(e){this.view=e,this.items=[];let n=i=>{if(i.keyCode==27)Em(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:o}=this.items[this.selectedIndex],s=J5(o.actions);for(let a=0;a<s.length;a++)if(s[a].toUpperCase().charCodeAt(0)==i.keyCode){let l=Gi(this.view.state.field(Pt).diagnostics,o);l&&o.actions[a].apply(e,l.from,l.to)}}else return;i.preventDefault()},r=i=>{for(let o=0;o<this.items.length;o++)this.items[o].dom.contains(i.target)&&this.moveSelection(o)};this.list=_e("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:r}),this.dom=_e("div",{class:"cm-panel-lint"},this.list,_e("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>Em(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Pt).selected;if(!e)return-1;for(let n=0;n<this.items.length;n++)if(this.items[n].diagnostic==e.diagnostic)return n;return-1}update(){let{diagnostics:e,selected:n}=this.view.state.field(Pt),r=0,i=!1,o=null,s=new Set;for(e.between(0,this.view.state.doc.length,(a,l,{spec:c})=>{for(let d of c.diagnostics){if(s.has(d))continue;s.add(d);let h=-1,f;for(let m=r;m<this.items.length;m++)if(this.items[m].diagnostic==d){h=m;break}h<0?(f=new Im(this.view,d),this.items.splice(r,0,f),i=!0):(f=this.items[h],h>r&&(this.items.splice(r,h-r),i=!0)),n&&f.diagnostic==n.diagnostic?f.dom.hasAttribute("aria-selected")||(f.dom.setAttribute("aria-selected","true"),o=f):f.dom.hasAttribute("aria-selected")&&f.dom.removeAttribute("aria-selected"),r++}});r<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();this.items.length==0&&(this.items.push(new Im(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),o?(this.list.setAttribute("aria-activedescendant",o.id),this.view.requestMeasure({key:this,read:()=>({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:a,panel:l})=>{let c=l.height/this.list.offsetHeight;a.top<l.top?this.list.scrollTop-=(l.top-a.top)/c:a.bottom>l.bottom&&(this.list.scrollTop+=(a.bottom-l.bottom)/c)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function n(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)n();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)n()}moveSelection(e){if(this.selectedIndex<0)return;let n=this.view.state.field(Pt),r=Gi(n.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:Z5.of(r)})}static open(e){return new ss(e)}}function vO(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(t)}</svg>')`}function pa(t){return vO(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${t}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const xO=ie.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:pa("#d11")},".cm-lintRange-warning":{backgroundImage:pa("orange")},".cm-lintRange-info":{backgroundImage:pa("#999")},".cm-lintRange-hint":{backgroundImage:pa("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function wO(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function yO(t){let e="hint",n=1;for(let r of t){let i=wO(r.severity);i>n&&(n=i,e=r.severity)}return e}const CO=[Pt,ie.decorations.compute([Pt],t=>{let{selected:e,panel:n}=t.field(Pt);return!e||!n||e.from==e.to?xe.none:xe.set([uO.range(e.from,e.to)])}),AE(hO,{hideOn:cO}),xO];var jm=function(e){e===void 0&&(e={});var{crosshairCursor:n=!1}=e,r=[];e.closeBracketsKeymap!==!1&&(r=r.concat(eO)),e.defaultKeymap!==!1&&(r=r.concat(Kj)),e.searchKeymap!==!1&&(r=r.concat(xD)),e.historyKeymap!==!1&&(r=r.concat(nj)),e.foldKeymap!==!1&&(r=r.concat(uI)),e.completionKeymap!==!1&&(r=r.concat(X5)),e.lintKeymap!==!1&&(r=r.concat(gO));var i=[];return e.lineNumbers!==!1&&i.push(BE()),e.highlightActiveLineGutter!==!1&&i.push(_E()),e.highlightSpecialChars!==!1&&i.push(tE()),e.history!==!1&&i.push(KI()),e.foldGutter!==!1&&i.push(pI()),e.drawSelection!==!1&&i.push(WM()),e.dropCursor!==!1&&i.push(YM()),e.allowMultipleSelections!==!1&&i.push(Me.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&i.push(tI()),e.syntaxHighlighting!==!1&&i.push(Yv(xI,{fallback:!0})),e.bracketMatching!==!1&&i.push(AI()),e.closeBrackets!==!1&&i.push(XD()),e.autocompletion!==!1&&i.push(aO()),e.rectangularSelection!==!1&&i.push(pE()),n!==!1&&i.push(vE()),e.highlightActiveLine!==!1&&i.push(aE()),e.highlightSelectionMatches!==!1&&i.push(eD()),e.tabSize&&typeof e.tabSize=="number"&&i.push(tc.of(" ".repeat(e.tabSize))),i.concat([Jl.of(r.flat())]).filter(Boolean)};const $O="#e5c07b",Dm="#e06c75",SO="#56b6c2",kO="#ffffff",ja="#abb2bf",Fu="#7d8799",AO="#61afef",RO="#98c379",Om="#d19a66",TO="#c678dd",MO="#21252b",Lm="#2c313a",Nm="#282c34",ld="#353a42",EO="#3E4451",Bm="#528bff",IO=ie.theme({"&":{color:ja,backgroundColor:Nm},".cm-content":{caretColor:Bm},".cm-cursor, .cm-dropCursor":{borderLeftColor:Bm},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:EO},".cm-panels":{backgroundColor:MO,color:ja},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Nm,color:Fu,border:"none"},".cm-activeLineGutter":{backgroundColor:Lm},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:ld},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:ld,borderBottomColor:ld},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Lm,color:ja}}},{dark:!0}),jO=Ss.define([{tag:L.keyword,color:TO},{tag:[L.name,L.deleted,L.character,L.propertyName,L.macroName],color:Dm},{tag:[L.function(L.variableName),L.labelName],color:AO},{tag:[L.color,L.constant(L.name),L.standard(L.name)],color:Om},{tag:[L.definition(L.name),L.separator],color:ja},{tag:[L.typeName,L.className,L.number,L.changed,L.annotation,L.modifier,L.self,L.namespace],color:$O},{tag:[L.operator,L.operatorKeyword,L.url,L.escape,L.regexp,L.link,L.special(L.string)],color:SO},{tag:[L.meta,L.comment],color:Fu},{tag:L.strong,fontWeight:"bold"},{tag:L.emphasis,fontStyle:"italic"},{tag:L.strikethrough,textDecoration:"line-through"},{tag:L.link,color:Fu,textDecoration:"underline"},{tag:L.heading,fontWeight:"bold",color:Dm},{tag:[L.atom,L.bool,L.special(L.variableName)],color:Om},{tag:[L.processingInstruction,L.string,L.inserted],color:RO},{tag:L.invalid,color:kO}]),DO=[IO,Yv(jO)];var OO=ie.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),LO=function(e){e===void 0&&(e={});var{indentWithTab:n=!0,editable:r=!0,readOnly:i=!1,theme:o="light",placeholder:s="",basicSetup:a=!0}=e,l=[];switch(n&&l.unshift(Jl.of([Gj])),a&&(typeof a=="boolean"?l.unshift(jm()):l.unshift(jm(a))),s&&l.unshift(uE(s)),o){case"light":l.push(OO);break;case"dark":l.push(DO);break;case"none":break;default:l.push(o);break}return r===!1&&l.push(ie.editable.of(!1)),i&&l.push(Me.readOnly.of(!0)),[...l]},NO=t=>({line:t.state.doc.lineAt(t.state.selection.main.from),lineCount:t.state.doc.lines,lineBreak:t.state.lineBreak,length:t.state.doc.length,readOnly:t.state.readOnly,tabSize:t.state.tabSize,selection:t.state.selection,selectionAsSingle:t.state.selection.asSingle().main,ranges:t.state.selection.ranges,selectionCode:t.state.sliceDoc(t.state.selection.main.from,t.state.selection.main.to),selections:t.state.selection.ranges.map(e=>t.state.sliceDoc(e.from,e.to)),selectedText:t.state.selection.ranges.some(e=>!e.empty)}),Fm=On.define(),BO=[];function tx(t){var{value:e,selection:n,onChange:r,onStatistics:i,onCreateEditor:o,onUpdate:s,extensions:a=BO,autoFocus:l,theme:c="light",height:d=null,minHeight:h=null,maxHeight:f=null,width:m=null,minWidth:g=null,maxWidth:b=null,placeholder:v="",editable:x=!0,readOnly:y=!1,indentWithTab:$=!0,basicSetup:k=!0,root:S,initialState:R}=t,[A,I]=p.useState(),[E,j]=p.useState(),[O,D]=p.useState(),B=ie.theme({"&":{height:d,minHeight:h,maxHeight:f,width:m,minWidth:g,maxWidth:b},"& .cm-scroller":{height:"100% !important"}}),V=ie.updateListener.of(W=>{if(W.docChanged&&typeof r=="function"&&!W.transactions.some(Q=>Q.annotation(Fm))){var K=W.state.doc,F=K.toString();r(F,W)}i&&i(NO(W))}),q=LO({theme:c,editable:x,readOnly:y,placeholder:v,indentWithTab:$,basicSetup:k}),J=[V,B,...q];return s&&typeof s=="function"&&J.push(ie.updateListener.of(s)),J=J.concat(a),p.useEffect(()=>{if(A&&!O){var W={doc:e,selection:n,extensions:J},K=R?Me.fromJSON(R.json,W,R.fields):Me.create(W);if(D(K),!E){var F=new ie({state:K,parent:A,root:S});j(F),o&&o(F,K)}}return()=>{E&&(D(void 0),j(void 0))}},[A,O]),p.useEffect(()=>I(t.container),[t.container]),p.useEffect(()=>()=>{E&&(E.destroy(),j(void 0))},[E]),p.useEffect(()=>{l&&E&&E.focus()},[l,E]),p.useEffect(()=>{E&&E.dispatch({effects:Ae.reconfigure.of(J)})},[c,a,d,h,f,m,g,b,v,x,y,$,k,r,s]),p.useEffect(()=>{if(e!==void 0){var W=E?E.state.doc.toString():"";E&&e!==W&&E.dispatch({changes:{from:0,to:W.length,insert:e||""},annotations:[Fm.of(!0)]})}},[e,E]),{state:O,setState:D,view:E,setView:j,container:A,setContainer:I}}var FO=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],VO=p.forwardRef((t,e)=>{var{className:n,value:r="",selection:i,extensions:o=[],onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:c,autoFocus:d,theme:h="light",height:f,minHeight:m,maxHeight:g,width:b,minWidth:v,maxWidth:x,basicSetup:y,placeholder:$,indentWithTab:k,editable:S,readOnly:R,root:A,initialState:I}=t,E=BI(t,FO),j=p.useRef(null),{state:O,view:D,container:B}=tx({container:j.current,root:A,value:r,autoFocus:d,theme:h,height:f,minHeight:m,maxHeight:g,width:b,minWidth:v,maxWidth:x,basicSetup:y,placeholder:$,indentWithTab:k,editable:S,readOnly:R,selection:i,onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:c,extensions:o,initialState:I});if(p.useImperativeHandle(e,()=>({editor:j.current,state:O,view:D}),[j,B,O,D]),typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var V=typeof h=="string"?"cm-theme-"+h:"cm-theme";return u.jsx("div",N({ref:j,className:""+V+(n?" "+n:"")},E))});VO.displayName="CodeMirror";let cd=new Map,Vu=!1;try{Vu=new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay==="exceptZero"}catch{}let vl=!1;try{vl=new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style==="unit"}catch{}const nx={degree:{narrow:{default:"°","ja-JP":" 度","zh-TW":"度","sl-SI":" °"}}};class rx{format(e){let n="";if(!Vu&&this.options.signDisplay!=null?n=zO(this.numberFormatter,this.options.signDisplay,e):n=this.numberFormatter.format(e),this.options.style==="unit"&&!vl){var r;let{unit:i,unitDisplay:o="short",locale:s}=this.resolvedOptions();if(!i)return n;let a=(r=nx[i])===null||r===void 0?void 0:r[o];n+=a[s]||a.default}return n}formatToParts(e){return this.numberFormatter.formatToParts(e)}formatRange(e,n){if(typeof this.numberFormatter.formatRange=="function")return this.numberFormatter.formatRange(e,n);if(n<e)throw new RangeError("End date must be >= start date");return`${this.format(e)} – ${this.format(n)}`}formatRangeToParts(e,n){if(typeof this.numberFormatter.formatRangeToParts=="function")return this.numberFormatter.formatRangeToParts(e,n);if(n<e)throw new RangeError("End date must be >= start date");let r=this.numberFormatter.formatToParts(e),i=this.numberFormatter.formatToParts(n);return[...r.map(o=>({...o,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...i.map(o=>({...o,source:"endRange"}))]}resolvedOptions(){let e=this.numberFormatter.resolvedOptions();return!Vu&&this.options.signDisplay!=null&&(e={...e,signDisplay:this.options.signDisplay}),!vl&&this.options.style==="unit"&&(e={...e,style:"unit",unit:this.options.unit,unitDisplay:this.options.unitDisplay}),e}constructor(e,n={}){this.numberFormatter=_O(e,n),this.options=n}}function _O(t,e={}){let{numberingSystem:n}=e;if(n&&t.includes("-nu-")&&(t.includes("-u-")||(t+="-u-"),t+=`-nu-${n}`),e.style==="unit"&&!vl){var r;let{unit:s,unitDisplay:a="short"}=e;if(!s)throw new Error('unit option must be provided with style: "unit"');if(!(!((r=nx[s])===null||r===void 0)&&r[a]))throw new Error(`Unsupported unit ${s} with unitDisplay = ${a}`);e={...e,style:"decimal"}}let i=t+(e?Object.entries(e).sort((s,a)=>s[0]<a[0]?-1:1).join():"");if(cd.has(i))return cd.get(i);let o=new Intl.NumberFormat(t,e);return cd.set(i,o),o}function zO(t,e,n){if(e==="auto")return t.format(n);if(e==="never")return t.format(Math.abs(n));{let r=!1;if(e==="always"?r=n>0||Object.is(n,0):e==="exceptZero"&&(Object.is(n,-0)||Object.is(n,0)?n=Math.abs(n):r=n>0),r){let i=t.format(-n),o=t.format(n),s=i.replace(o,"").replace(/\u200e|\u061C/,"");return[...s].length!==1&&console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"),i.replace(o,"!!!").replace(s,"+").replace("!!!",o)}else return t.format(n)}}const HO=new RegExp("^.*\\(.*\\).*$"),PO=["latn","arab","hanidec"];class ix{parse(e){return dd(this.locale,this.options,e).parse(e)}isValidPartialNumber(e,n,r){return dd(this.locale,this.options,e).isValidPartialNumber(e,n,r)}getNumberingSystem(e){return dd(this.locale,this.options,e).options.numberingSystem}constructor(e,n={}){this.locale=e,this.options=n}}const Vm=new Map;function dd(t,e,n){let r=_m(t,e);if(!t.includes("-nu-")&&!r.isValidPartialNumber(n)){for(let i of PO)if(i!==r.options.numberingSystem){let o=_m(t+(t.includes("-u-")?"-nu-":"-u-nu-")+i,e);if(o.isValidPartialNumber(n))return o}}return r}function _m(t,e){let n=t+(e?Object.entries(e).sort((i,o)=>i[0]<o[0]?-1:1).join():""),r=Vm.get(n);return r||(r=new WO(t,e),Vm.set(n,r)),r}class WO{parse(e){let n=this.sanitize(e);if(this.symbols.group&&(n=ga(n,this.symbols.group,"")),this.symbols.decimal&&(n=n.replace(this.symbols.decimal,".")),this.symbols.minusSign&&(n=n.replace(this.symbols.minusSign,"-")),n=n.replace(this.symbols.numeral,this.symbols.index),this.options.style==="percent"){let s=n.indexOf("-");n=n.replace("-","");let a=n.indexOf(".");a===-1&&(a=n.length),n=n.replace(".",""),a-2===0?n=`0.${n}`:a-2===-1?n=`0.0${n}`:a-2===-2?n="0.00":n=`${n.slice(0,a-2)}.${n.slice(a-2)}`,s>-1&&(n=`-${n}`)}let r=n?+n:NaN;if(isNaN(r))return NaN;if(this.options.style==="percent"){var i,o;let s={...this.options,style:"decimal",minimumFractionDigits:Math.min(((i=this.options.minimumFractionDigits)!==null&&i!==void 0?i:0)+2,20),maximumFractionDigits:Math.min(((o=this.options.maximumFractionDigits)!==null&&o!==void 0?o:0)+2,20)};return new ix(this.locale,s).parse(new rx(this.locale,s).format(r))}return this.options.currencySign==="accounting"&&HO.test(e)&&(r=-1*r),r}sanitize(e){return e=e.replace(this.symbols.literals,""),this.symbols.minusSign&&(e=e.replace("-",this.symbols.minusSign)),this.options.numberingSystem==="arab"&&(this.symbols.decimal&&(e=e.replace(",",this.symbols.decimal),e=e.replace("،",this.symbols.decimal)),this.symbols.group&&(e=ga(e,".",this.symbols.group))),this.options.locale==="fr-FR"&&(e=ga(e,"."," ")),e}isValidPartialNumber(e,n=-1/0,r=1/0){return e=this.sanitize(e),this.symbols.minusSign&&e.startsWith(this.symbols.minusSign)&&n<0?e=e.slice(this.symbols.minusSign.length):this.symbols.plusSign&&e.startsWith(this.symbols.plusSign)&&r>0&&(e=e.slice(this.symbols.plusSign.length)),this.symbols.group&&e.startsWith(this.symbols.group)||this.symbols.decimal&&e.indexOf(this.symbols.decimal)>-1&&this.options.maximumFractionDigits===0?!1:(this.symbols.group&&(e=ga(e,this.symbols.group,"")),e=e.replace(this.symbols.numeral,""),this.symbols.decimal&&(e=e.replace(this.symbols.decimal,"")),e.length===0)}constructor(e,n={}){this.locale=e,this.formatter=new Intl.NumberFormat(e,n),this.options=this.formatter.resolvedOptions(),this.symbols=UO(e,this.formatter,this.options,n);var r,i;this.options.style==="percent"&&(((r=this.options.minimumFractionDigits)!==null&&r!==void 0?r:0)>18||((i=this.options.maximumFractionDigits)!==null&&i!==void 0?i:0)>18)&&console.warn("NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.")}}const zm=new Set(["decimal","fraction","integer","minusSign","plusSign","group"]),qO=[0,4,2,1,11,20,3,7,100,21,.1,1.1];function UO(t,e,n,r){var i,o,s,a;let l=new Intl.NumberFormat(t,{...n,minimumSignificantDigits:1,maximumSignificantDigits:21}),c=l.formatToParts(-10000.111),d=l.formatToParts(10000.111),h=qO.map(j=>l.formatToParts(j));var f;let m=(f=(i=c.find(j=>j.type==="minusSign"))===null||i===void 0?void 0:i.value)!==null&&f!==void 0?f:"-",g=(o=d.find(j=>j.type==="plusSign"))===null||o===void 0?void 0:o.value;!g&&(r?.signDisplay==="exceptZero"||r?.signDisplay==="always")&&(g="+");let v=(s=new Intl.NumberFormat(t,{...n,minimumFractionDigits:2,maximumFractionDigits:2}).formatToParts(.001).find(j=>j.type==="decimal"))===null||s===void 0?void 0:s.value,x=(a=c.find(j=>j.type==="group"))===null||a===void 0?void 0:a.value,y=c.filter(j=>!zm.has(j.type)).map(j=>Hm(j.value)),$=h.flatMap(j=>j.filter(O=>!zm.has(O.type)).map(O=>Hm(O.value))),k=[...new Set([...y,...$])].sort((j,O)=>O.length-j.length),S=k.length===0?new RegExp("[\\p{White_Space}]","gu"):new RegExp(`${k.join("|")}|[\\p{White_Space}]`,"gu"),R=[...new Intl.NumberFormat(n.locale,{useGrouping:!1}).format(9876543210)].reverse(),A=new Map(R.map((j,O)=>[j,O])),I=new RegExp(`[${R.join("")}]`,"g");return{minusSign:m,plusSign:g,decimal:v,group:x,literals:S,numeral:I,index:j=>String(A.get(j))}}function ga(t,e,n){return t.replaceAll?t.replaceAll(e,n):t.split(e).join(n)}function Hm(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const ox="Popover",[sx,hP]=et(ox,[Sr]),ax=Sr(),[fP,ao]=sx(ox),KO="PopoverTrigger",GO=p.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=ao(KO,n),o=ax(n),s=ye(e,i.triggerRef),a=p.createElement(ge.button,N({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":dx(i.open)},r,{ref:s,onClick:X(t.onClick,i.onOpenToggle)}));return i.hasCustomAnchor?a:p.createElement(hs,N({asChild:!0},o),a)}),lx="PopoverPortal",[YO,XO]=sx(lx,{forceMount:void 0}),QO=t=>{const{__scopePopover:e,forceMount:n,children:r,container:i}=t,o=ao(lx,e);return p.createElement(YO,{scope:e,forceMount:n},p.createElement(at,{present:n||o.open},p.createElement(Ji,{asChild:!0,container:i},r)))},as="PopoverContent",ZO=p.forwardRef((t,e)=>{const n=XO(as,t.__scopePopover),{forceMount:r=n.forceMount,...i}=t,o=ao(as,t.__scopePopover);return p.createElement(at,{present:r||o.open},o.modal?p.createElement(JO,N({},i,{ref:e})):p.createElement(eL,N({},i,{ref:e})))}),JO=p.forwardRef((t,e)=>{const n=ao(as,t.__scopePopover),r=p.useRef(null),i=ye(e,r),o=p.useRef(!1);return p.useEffect(()=>{const s=r.current;if(s)return ps(s)},[]),p.createElement(Wl,{as:Rn,allowPinchZoom:!0},p.createElement(cx,N({},t,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:X(t.onCloseAutoFocus,s=>{var a;s.preventDefault(),o.current||(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:X(t.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;o.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:X(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})))}),eL=p.forwardRef((t,e)=>{const n=ao(as,t.__scopePopover),r=p.useRef(!1),i=p.useRef(!1);return p.createElement(cx,N({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s;if((s=t.onCloseAutoFocus)===null||s===void 0||s.call(t,o),!o.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),o.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:o=>{var s,a;(s=t.onInteractOutside)===null||s===void 0||s.call(t,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}}))}),cx=p.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,...h}=t,f=ao(as,n),m=ax(n);return eo(),p.createElement(to,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},p.createElement(ti,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1)},p.createElement(fs,N({"data-state":dx(f.open),role:"dialog",id:f.contentId},m,h,{ref:e,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))});function dx(t){return t?"open":"closed"}const tL=GO,nL=QO,rL=ZO,ux="Progress",cc=100,[iL,mP]=et(ux),[oL,sL]=iL(ux),hx=p.forwardRef((t,e)=>{const{__scopeProgress:n,value:r,max:i,getValueLabel:o=cL,...s}=t,a=_u(i)?i:cc,l=mx(r,a)?r:null,c=xl(l)?o(l,a):void 0;return p.createElement(oL,{scope:n,value:l,max:a},p.createElement(ge.div,N({"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":xl(l)?l:void 0,"aria-valuetext":c,role:"progressbar","data-state":fx(l,a),"data-value":l??void 0,"data-max":a},s,{ref:e})))});hx.propTypes={max(t,e,n){const r=t[e],i=String(r);return r&&!_u(r)?new Error(dL(i,n)):null},value(t,e,n){const r=t[e],i=String(r),o=_u(t.max)?t.max:cc;return r!=null&&!mx(r,o)?new Error(uL(i,n)):null}};const aL="ProgressIndicator",lL=p.forwardRef((t,e)=>{var n;const{__scopeProgress:r,...i}=t,o=sL(aL,r);return p.createElement(ge.div,N({"data-state":fx(o.value,o.max),"data-value":(n=o.value)!==null&&n!==void 0?n:void 0,"data-max":o.max},i,{ref:e}))});function cL(t,e){return`${Math.round(t/e*100)}%`}function fx(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function xl(t){return typeof t=="number"}function _u(t){return xl(t)&&!isNaN(t)&&t>0}function mx(t,e){return xl(t)&&!isNaN(t)&&t<=e&&t>=0}function dL(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${cc}\`.`}function uL(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be:
|
|
65
|
+
- a positive number
|
|
66
|
+
- less than the value passed to \`max\` (or ${cc} if no \`max\` prop is set)
|
|
67
|
+
- \`null\` if the progress is indeterminate.
|
|
68
|
+
|
|
69
|
+
Defaulting to \`null\`.`}const hL=hx,fL=lL,px="Radio",[mL,gx]=et(px),[pL,gL]=mL(px),bL=p.forwardRef((t,e)=>{const{__scopeRadio:n,name:r,checked:i=!1,required:o,disabled:s,value:a="on",onCheck:l,...c}=t,[d,h]=p.useState(null),f=ye(e,b=>h(b)),m=p.useRef(!1),g=d?!!d.closest("form"):!0;return p.createElement(pL,{scope:n,checked:i,disabled:s},p.createElement(ge.button,N({type:"button",role:"radio","aria-checked":i,"data-state":bx(i),"data-disabled":s?"":void 0,disabled:s,value:a},c,{ref:f,onClick:X(t.onClick,b=>{i||l?.(),g&&(m.current=b.isPropagationStopped(),m.current||b.stopPropagation())})})),g&&p.createElement(wL,{control:d,bubbles:!m.current,name:r,value:a,checked:i,required:o,disabled:s,style:{transform:"translateX(-100%)"}}))}),vL="RadioIndicator",xL=p.forwardRef((t,e)=>{const{__scopeRadio:n,forceMount:r,...i}=t,o=gL(vL,n);return p.createElement(at,{present:r||o.checked},p.createElement(ge.span,N({"data-state":bx(o.checked),"data-disabled":o.disabled?"":void 0},i,{ref:e})))}),wL=t=>{const{control:e,checked:n,bubbles:r=!0,...i}=t,o=p.useRef(null),s=Bl(n),a=El(e);return p.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&h){const f=new Event("click",{bubbles:r});h.call(l,n),l.dispatchEvent(f)}},[s,n,r]),p.createElement("input",N({type:"radio","aria-hidden":!0,defaultChecked:n},i,{tabIndex:-1,ref:o,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function bx(t){return t?"checked":"unchecked"}const yL=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],vx="RadioGroup",[CL,pP]=et(vx,[ro,gx]),xx=ro(),wx=gx(),[$L,SL]=CL(vx),kL=p.forwardRef((t,e)=>{const{__scopeRadioGroup:n,name:r,defaultValue:i,value:o,required:s=!1,disabled:a=!1,orientation:l,dir:c,loop:d=!0,onValueChange:h,...f}=t,m=xx(n),g=ni(c),[b,v]=mt({prop:o,defaultProp:i,onChange:h});return p.createElement($L,{scope:n,name:r,required:s,disabled:a,value:b,onValueChange:v},p.createElement(Jh,N({asChild:!0},m,{orientation:l,dir:g,loop:d}),p.createElement(ge.div,N({role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:g},f,{ref:e}))))}),AL="RadioGroupItem",RL=p.forwardRef((t,e)=>{const{__scopeRadioGroup:n,disabled:r,...i}=t,o=SL(AL,n),s=o.disabled||r,a=xx(n),l=wx(n),c=p.useRef(null),d=ye(e,c),h=o.value===i.value,f=p.useRef(!1);return p.useEffect(()=>{const m=b=>{yL.includes(b.key)&&(f.current=!0)},g=()=>f.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",g),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",g)}},[]),p.createElement(ef,N({asChild:!0},a,{focusable:!s,active:h}),p.createElement(bL,N({disabled:s,required:o.required,checked:h},l,i,{name:o.name,ref:d,onCheck:()=>o.onValueChange(i.value),onKeyDown:X(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:X(i.onFocus,()=>{var m;f.current&&((m=c.current)===null||m===void 0||m.click())})})))}),TL=p.forwardRef((t,e)=>{const{__scopeRadioGroup:n,...r}=t,i=wx(n);return p.createElement(xL,N({},i,r,{ref:e}))}),ML=kL,EL=RL,IL=TL,yx="Switch",[jL,gP]=et(yx),[DL,OL]=jL(yx),LL=p.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:s,disabled:a,value:l="on",onCheckedChange:c,...d}=t,[h,f]=p.useState(null),m=ye(e,y=>f(y)),g=p.useRef(!1),b=h?!!h.closest("form"):!0,[v=!1,x]=mt({prop:i,defaultProp:o,onChange:c});return p.createElement(DL,{scope:n,checked:v,disabled:a},p.createElement(ge.button,N({type:"button",role:"switch","aria-checked":v,"aria-required":s,"data-state":Cx(v),"data-disabled":a?"":void 0,disabled:a,value:l},d,{ref:m,onClick:X(t.onClick,y=>{x($=>!$),b&&(g.current=y.isPropagationStopped(),g.current||y.stopPropagation())})})),b&&p.createElement(FL,{control:h,bubbles:!g.current,name:r,value:l,checked:v,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),NL="SwitchThumb",BL=p.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,i=OL(NL,n);return p.createElement(ge.span,N({"data-state":Cx(i.checked),"data-disabled":i.disabled?"":void 0},r,{ref:e}))}),FL=t=>{const{control:e,checked:n,bubbles:r=!0,...i}=t,o=p.useRef(null),s=Bl(n),a=El(e);return p.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&h){const f=new Event("click",{bubbles:r});h.call(l,n),l.dispatchEvent(f)}},[s,n,r]),p.createElement("input",N({type:"checkbox","aria-hidden":!0,defaultChecked:n},i,{tabIndex:-1,ref:o,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function Cx(t){return t?"checked":"unchecked"}const VL=LL,_L=BL,$x="Tabs",[zL,bP]=et($x,[ro]),Sx=ro(),[HL,_f]=zL($x),PL=p.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=t,d=ni(a),[h,f]=mt({prop:r,onChange:i,defaultProp:o});return p.createElement(HL,{scope:n,baseId:gt(),value:h,onValueChange:f,orientation:s,dir:d,activationMode:l},p.createElement(ge.div,N({dir:d,"data-orientation":s},c,{ref:e})))}),WL="TabsList",qL=p.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...i}=t,o=_f(WL,n),s=Sx(n);return p.createElement(Jh,N({asChild:!0},s,{orientation:o.orientation,dir:o.dir,loop:r}),p.createElement(ge.div,N({role:"tablist","aria-orientation":o.orientation},i,{ref:e})))}),UL="TabsTrigger",KL=p.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=t,s=_f(UL,n),a=Sx(n),l=kx(s.baseId,r),c=Ax(s.baseId,r),d=r===s.value;return p.createElement(ef,N({asChild:!0},a,{focusable:!i,active:d}),p.createElement(ge.button,N({type:"button",role:"tab","aria-selected":d,"aria-controls":c,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l},o,{ref:e,onMouseDown:X(t.onMouseDown,h=>{!i&&h.button===0&&h.ctrlKey===!1?s.onValueChange(r):h.preventDefault()}),onKeyDown:X(t.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&s.onValueChange(r)}),onFocus:X(t.onFocus,()=>{const h=s.activationMode!=="manual";!d&&!i&&h&&s.onValueChange(r)})})))}),GL="TabsContent",YL=p.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=t,a=_f(GL,n),l=kx(a.baseId,r),c=Ax(a.baseId,r),d=r===a.value,h=p.useRef(d);return p.useEffect(()=>{const f=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(f)},[]),p.createElement(at,{present:i||d},({present:f})=>p.createElement(ge.div,N({"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:c,tabIndex:0},s,{ref:e,style:{...t.style,animationDuration:h.current?"0s":void 0}}),f&&o))});function kx(t,e){return`${t}-trigger-${e}`}function Ax(t,e){return`${t}-content-${e}`}const XL=PL,QL=qL,ZL=KL,JL=YL,Rs=(t,e)=>{const n=w.createContext(e),r=o=>{const{children:s,...a}=o,l=w.useMemo(()=>a,Object.values(a));return u.jsx(n.Provider,{value:l,children:s})};function i(o){const s=w.useContext(n);if(s)return s;if(e!==void 0)return e;throw new Error(`\`${o}\` must be used within \`${t}\``)}return r.displayName=`${t}Provider`,[r,i]};function eN(t,e){return typeof t=="string"?!1:e in t}function Da(t,e,n){return t&&e&&eN(t,e)?t[e]:n}const Pm={padding:["padding-block-start","padding-inline-end","padding-block-end","padding-inline-start"],paddingTop:"padding-block-start",paddingRight:"padding-inline-end",paddingBottom:"padding-block-end",paddingLeft:"padding-inline-start",margin:["margin-block-start","margin-inline-end","margin-block-end","margin-inline-start"],marginLeft:"margin-inline-start",marginRight:"margin-inline-end",marginTop:"margin-block-start",marginBottom:"margin-block-end",borderRadius:"border-radius",borderStyle:"border-style",borderWidth:"border-width",borderColor:"border-color",fontSize:"font-size",fontWeight:"font-weight",lineHeight:"line-height",zIndex:"z-index",boxShadow:"box-shadow",pointerEvents:"pointer-events",textAlign:"text-align",textTransform:"text-transform",textDecoration:"text-decoration",flexGrow:"flex-grow",flexShrink:"flex-shrink",flexBasis:"flex-basis",minWidth:"min-width",maxWidth:"max-width",minHeight:"min-height",maxHeight:"max-height",flexDirection:"flex-direction",flexWrap:"flex-wrap",justifyContent:"justify-content",alignItems:"align-items"},tN=t=>{const[e,n,r,i]=t,o=n??e;return[e,o,r??e,i??o]};function nN(t,e){switch(t){case"gap":case"padding":case"margin":case"paddingTop":case"paddingLeft":case"paddingRight":case"paddingBottom":case"marginTop":case"marginLeft":case"marginRight":case"marginBottom":case"left":case"right":case"top":case"bottom":case"width":case"maxWidth":case"minWidth":case"height":case"maxHeight":case"minHeight":case"borderRadius":case"borderWidth":return e.spaces;case"color":case"background":case"borderColor":return e.colors;case"fontSize":return e.fontSizes;case"fontWeight":return e.fontWeights;case"lineHeight":return e.lineHeights;case"zIndex":return e.zIndices;case"boxShadow":return e.shadows;default:return null}}const dc=(t,e)=>{const n=Object.entries(t).reduce((r,i)=>{const[o,s]=i,a=nN(o,e),l=Object.prototype.hasOwnProperty.call(Pm,o)?Pm[o]:o;return l&&(s||s===0)&&(typeof s=="object"&&!Array.isArray(s)?Object.entries(s).forEach(([c,d])=>{r[c]={...r[c],...Wm(l,d,a)}}):r.initial={...r.initial,...Wm(l,s,a)}),r},{initial:{},small:{},medium:{},large:{}});return Object.entries(n).reduce((r,[i,o])=>{if(o&&Object.keys(o).length>0){const s=Object.entries(o).reduce((a,[l,c])=>(a.push(`${l}: ${c};`),a),[]).join(`
|
|
70
|
+
`);i==="initial"?r.push(s):r.push(`${e.breakpoints[i]}{ ${s} }`)}return r},[]).join(`
|
|
71
|
+
`)},Wm=(t,e,n)=>{if(Array.isArray(t)&&Array.isArray(e)){const r=tN(e);return t.reduce((i,o,s)=>(i[o]=Da(n,r[s],r[s]),i),{})}else return Array.isArray(t)&&!Array.isArray(e)?t.reduce((r,i)=>(r[i]=Da(n,e,e),r),{}):!Array.isArray(t)&&!Array.isArray(e)?{[t]:Da(n,e,e)}:(console.warn("You've passed an array of values to a property that does not support it. Please check the property and value you're passing."),{})},Mt=w.forwardRef,re=Mt((t,e)=>{const{background:n,basis:r,borderColor:i,color:o,flex:s,fontSize:a,grow:l,hasRadius:c,padding:d,paddingBottom:h,paddingLeft:f,paddingRight:m,paddingTop:g,margin:b,marginLeft:v,marginBottom:x,marginRight:y,marginTop:$,shadow:k,shrink:S,lineHeight:R,fontWeight:A,width:I,minWidth:E,maxWidth:j,height:O,minHeight:D,maxHeight:B,top:V,left:q,bottom:J,right:W,borderRadius:K,borderStyle:F,borderWidth:Q,tag:pe,pointerEvents:we,display:ce,position:Ce,zIndex:P,overflow:oe,cursor:_,transition:G,transform:Z,animation:ne,textAlign:ae,textTransform:be,...le}=t,Le=pe||"div",$e={$background:n,$basis:r,$borderColor:i,$color:o,$flex:s,$fontSize:a,$grow:l,$hasRadius:c,$padding:d,$paddingBottom:h,$paddingLeft:f,$paddingRight:m,$paddingTop:g,$margin:b,$marginLeft:v,$marginBottom:x,$marginRight:y,$marginTop:$,$shadow:k,$shrink:S,$lineHeight:R,$fontWeight:A,$width:I,$minWidth:E,$maxWidth:j,$height:O,$minHeight:D,$maxHeight:B,$top:V,$left:q,$bottom:J,$right:W,$borderRadius:K,$borderStyle:F,$borderWidth:Q,$pointerEvents:we,$display:ce,$position:Ce,$zIndex:P,$overflow:oe,$cursor:_,$transition:G,$transform:Z,$animation:ne,$textAlign:ae,$textTransform:be};return u.jsx(rN,{as:Le,ref:e,...$e,...le})}),rN=C.styled.div`
|
|
72
|
+
${({theme:t,...e})=>dc({padding:e.$padding,paddingTop:e.$paddingTop,paddingBottom:e.$paddingBottom,paddingLeft:e.$paddingLeft,paddingRight:e.$paddingRight,margin:e.$margin,marginTop:e.$marginTop,marginBottom:e.$marginBottom,marginLeft:e.$marginLeft,marginRight:e.$marginRight,top:e.$top,left:e.$left,bottom:e.$bottom,right:e.$right,width:e.$width,minWidth:e.$minWidth,maxWidth:e.$maxWidth,height:e.$height,minHeight:e.$minHeight,maxHeight:e.$maxHeight,color:e.$color,background:e.$background,fontSize:e.$fontSize,fontWeight:e.$fontWeight,lineHeight:e.$lineHeight,borderRadius:e.$hasRadius?t.borderRadius:e.$borderRadius,borderStyle:e.$borderColor&&!e.$borderStyle?"solid":e.$borderStyle,borderWidth:e.$borderColor&&!e.$borderWidth?"1px":e.$borderWidth,borderColor:e.$borderColor,zIndex:e.$zIndex,boxShadow:e.$shadow,display:e.$display,pointerEvents:e.$pointerEvents,cursor:e.$cursor,textAlign:e.$textAlign,textTransform:e.$textTransform,transition:e.$transition,transform:e.$transform,animation:e.$animation,position:e.$position,overflow:e.$overflow,flex:e.$flex,flexShrink:e.$shrink,flexGrow:e.$grow,flexBasis:e.$basis},t)};
|
|
73
|
+
`,Y=Mt((t,e)=>{const{className:n,alignItems:r,direction:i,inline:o,gap:s,justifyContent:a,wrap:l,...c}=t,d={$alignItems:r,$direction:i,$gap:s,$justifyContent:a,$wrap:l,$inline:o};return u.jsx(iN,{className:n,ref:e,...d,...c})}),iN=C.styled(re)`
|
|
74
|
+
${({theme:t,$display:e="flex",$alignItems:n="center",$direction:r="row",...i})=>dc({gap:i.$gap,alignItems:n,justifyContent:i.$justifyContent,flexWrap:i.$wrap,flexDirection:r,display:i.$inline?"inline-flex":e},t)};
|
|
75
|
+
`,oN="alpha",sN="beta",aN="delta",lN="epsilon",qm="omega",cN="pi",dN="sigma",Rx=C.css`
|
|
76
|
+
display: block;
|
|
77
|
+
white-space: nowrap;
|
|
78
|
+
overflow: hidden;
|
|
79
|
+
text-overflow: ellipsis;
|
|
80
|
+
`,uN=({$variant:t=qm,theme:e})=>{switch(t){case oN:return`
|
|
81
|
+
font-weight: ${e.fontWeights.bold};
|
|
82
|
+
font-size: ${e.fontSizes[5]};
|
|
83
|
+
line-height: ${e.lineHeights[2]};
|
|
84
|
+
`;case sN:return`
|
|
85
|
+
font-weight: ${e.fontWeights.bold};
|
|
86
|
+
font-size: ${e.fontSizes[4]};
|
|
87
|
+
line-height: ${e.lineHeights[1]};
|
|
88
|
+
`;case aN:return`
|
|
89
|
+
font-weight: ${e.fontWeights.semiBold};
|
|
90
|
+
font-size: ${e.fontSizes[3]};
|
|
91
|
+
line-height: ${e.lineHeights[2]};
|
|
92
|
+
`;case lN:return`
|
|
93
|
+
font-size: ${e.fontSizes[3]};
|
|
94
|
+
line-height: ${e.lineHeights[6]};
|
|
95
|
+
`;case qm:return`
|
|
96
|
+
font-size: ${e.fontSizes[2]};
|
|
97
|
+
line-height: ${e.lineHeights[4]};
|
|
98
|
+
`;case cN:return`
|
|
99
|
+
font-size: ${e.fontSizes[1]};
|
|
100
|
+
line-height: ${e.lineHeights[3]};
|
|
101
|
+
`;case dN:return`
|
|
102
|
+
font-weight: ${e.fontWeights.bold};
|
|
103
|
+
font-size: ${e.fontSizes[0]};
|
|
104
|
+
line-height: ${e.lineHeights[5]};
|
|
105
|
+
text-transform: uppercase;
|
|
106
|
+
`;default:return`
|
|
107
|
+
font-size: ${e.fontSizes[2]};
|
|
108
|
+
`}},ee=Mt((t,e)=>{const{ellipsis:n,textColor:r="currentcolor",textDecoration:i,textTransform:o,variant:s,lineHeight:a,fontWeight:l,fontSize:c,...d}=t,h={$ellipsis:n,$textColor:r,$textDecoration:i,$textTransform:o,$variant:s,$lineHeight:a,$fontWeight:l,$fontSize:c};return u.jsx(hN,{ref:e,tag:"span",...h,...d})}),hN=C.styled(re)`
|
|
109
|
+
${uN}
|
|
110
|
+
${({$ellipsis:t})=>t?Rx:""}
|
|
111
|
+
|
|
112
|
+
${({theme:t,...e})=>dc({color:e.$textColor,textDecoration:e.$textDecoration,textTransform:e.$textTransform,lineHeight:e.$lineHeight,fontWeight:e.$fontWeight,fontSize:e.$fontSize},t)}
|
|
113
|
+
`,[fN,zf]=Rs("Accordion"),mN=w.forwardRef(({children:t,size:e="S",...n},r)=>u.jsx(pN,{ref:r,$size:e,collapsible:!0,...n,type:"single",children:u.jsx(fN,{size:e,children:t})})),pN=C.styled(FC)`
|
|
114
|
+
background-color: ${t=>t.theme.colors.neutral0};
|
|
115
|
+
|
|
116
|
+
${t=>t.$size==="S"?C.css`
|
|
117
|
+
border-radius: ${e=>e.theme.borderRadius};
|
|
118
|
+
border: solid 1px ${e=>e.theme.colors.neutral200};
|
|
119
|
+
`:C.css``}
|
|
120
|
+
`,gN=w.forwardRef((t,e)=>{const{size:n}=zf("Item");return u.jsx(bN,{$size:n,"data-size":n,ref:e,...t})}),bN=C.styled(VC)`
|
|
121
|
+
overflow: hidden;
|
|
122
|
+
margin: 1px 0;
|
|
123
|
+
|
|
124
|
+
&:first-child {
|
|
125
|
+
border-top-left-radius: 0.3rem;
|
|
126
|
+
border-top-right-radius: 0.3rem;
|
|
127
|
+
margin-top: 0;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&:last-child {
|
|
131
|
+
border-bottom-left-radius: 0.3rem;
|
|
132
|
+
border-bottom-right-radius: 0.3rem;
|
|
133
|
+
margin-bottom: 0;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
&[data-size='S'] {
|
|
137
|
+
& + & {
|
|
138
|
+
border-top: solid 1px ${t=>t.theme.colors.neutral200};
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&[data-state='open'] {
|
|
143
|
+
box-shadow: 0 0 0 1px ${t=>t.theme.colors.primary600};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
&:not([data-disabled]):hover {
|
|
147
|
+
box-shadow: 0 0 0 1px ${t=>t.theme.colors.primary600};
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/* This applies our desired focus effect correctly. */
|
|
151
|
+
&:focus-within {
|
|
152
|
+
position: relative;
|
|
153
|
+
z-index: 1;
|
|
154
|
+
box-shadow: 0 0 0 1px ${t=>t.theme.colors.primary600};
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
158
|
+
transition: box-shadow ${t=>t.theme.motion.timings[120]}
|
|
159
|
+
${t=>t.theme.motion.easings.easeOutQuad};
|
|
160
|
+
}
|
|
161
|
+
`,vN=w.forwardRef(({caretPosition:t="left",description:e,icon:n,iconProps:r,children:i,...o},s)=>{const{size:a}=zf("Trigger");return u.jsxs(Mx,{$caretPosition:t,$size:a,ref:s,...o,children:[t==="left"?u.jsx(wl,{$size:a,children:u.jsx(br,{width:a==="S"?"1.2rem":"1.6rem",height:a==="S"?"1.2rem":"1.6rem"})}):null,u.jsxs(Y,{tag:"span",gap:2,overflow:"hidden",children:[n&&a==="S"?u.jsx(Tx,{children:u.jsx(n,{...r})}):null,u.jsxs(Y,{alignItems:"flex-start",direction:"column",tag:"span",ref:s,overflow:"hidden",children:[u.jsx(ee,{fontWeight:a==="S"?"bold":void 0,ellipsis:!0,variant:a==="M"?"delta":void 0,textAlign:"left",width:"100%",children:i}),e&&a==="M"?u.jsx(ee,{textAlign:"left",children:e}):null]})]}),t==="right"?u.jsx(wl,{$size:a,children:u.jsx(br,{width:a==="S"?"1.2rem":"1.6rem",height:a==="S"?"1.2rem":"1.6rem"})}):null]})}),Tx=C.styled(re)`
|
|
162
|
+
color: ${t=>t.theme.colors.neutral500};
|
|
163
|
+
display: flex;
|
|
164
|
+
|
|
165
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
166
|
+
transition: ${t=>t.theme.transitions.color};
|
|
167
|
+
}
|
|
168
|
+
`,wl=C.styled(Y).attrs(t=>({...t,tag:"span"}))`
|
|
169
|
+
background-color: ${t=>t.theme.colors.neutral200};
|
|
170
|
+
width: ${t=>t.$size==="S"?"2.4rem":"3.2rem"};
|
|
171
|
+
height: ${t=>t.$size==="S"?"2.4rem":"3.2rem"};
|
|
172
|
+
flex: ${t=>t.$size==="S"?"0 0 2.4rem":"0 0 3.2rem"};
|
|
173
|
+
border-radius: 50%;
|
|
174
|
+
justify-content: center;
|
|
175
|
+
|
|
176
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
177
|
+
transition:
|
|
178
|
+
transform ${t=>t.theme.motion.timings[200]} ${t=>t.theme.motion.easings.authenticMotion},
|
|
179
|
+
${t=>t.theme.transitions.backgroundColor};
|
|
180
|
+
}
|
|
181
|
+
`,Mx=C.styled(zC)`
|
|
182
|
+
display: flex;
|
|
183
|
+
align-items: center;
|
|
184
|
+
justify-content: ${t=>t.$caretPosition==="left"?"flex-start":"space-between"};
|
|
185
|
+
width: 100%;
|
|
186
|
+
gap: ${t=>t.theme.spaces[4]};
|
|
187
|
+
padding-inline: ${t=>t.$size==="S"?t.theme.spaces[4]:t.theme.spaces[6]};
|
|
188
|
+
padding-block: ${t=>t.$size==="S"?t.theme.spaces[3]:t.theme.spaces[6]};
|
|
189
|
+
cursor: pointer;
|
|
190
|
+
color: ${t=>t.theme.colors.neutral800};
|
|
191
|
+
overflow: hidden;
|
|
192
|
+
|
|
193
|
+
&[data-disabled] {
|
|
194
|
+
cursor: default;
|
|
195
|
+
color: ${t=>t.theme.colors.neutral600};
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
&[data-state='open'] > ${wl} {
|
|
199
|
+
transform: rotate(180deg);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/* we remove the default focus because the entire item should have the focus style and the default would be hidden. */
|
|
203
|
+
&:focus-visible {
|
|
204
|
+
outline: none;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
208
|
+
transition: ${t=>t.theme.transitions.color};
|
|
209
|
+
}
|
|
210
|
+
`,xN=w.forwardRef((t,e)=>{const{size:n}=zf("Trigger");return u.jsx(Ex,{$size:n,...t,ref:e})}),Ex=C.styled(Y).attrs(t=>({...t,tag:"span"}))`
|
|
211
|
+
padding-inline: ${t=>t.$size==="S"?t.theme.spaces[2]:t.theme.spaces[6]};
|
|
212
|
+
padding-block: ${t=>t.$size==="S"?t.theme.spaces[2]:t.theme.spaces[6]};
|
|
213
|
+
|
|
214
|
+
// Remove default IconButton styles so there are no backgrounds or borders.
|
|
215
|
+
& > button {
|
|
216
|
+
border: none;
|
|
217
|
+
background: none;
|
|
218
|
+
color: ${t=>t.theme.colors.neutral600};
|
|
219
|
+
|
|
220
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
221
|
+
transition: ${t=>t.theme.transitions.color};
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
`,wN=w.forwardRef(({variant:t="primary",...e},n)=>u.jsx(yN,{$variant:t,ref:n,...e})),yN=C.styled(_C)`
|
|
225
|
+
display: flex;
|
|
226
|
+
align-items: center;
|
|
227
|
+
background-color: ${t=>t.$variant==="primary"?t.theme.colors.neutral0:t.theme.colors.neutral100};
|
|
228
|
+
|
|
229
|
+
&[data-disabled] {
|
|
230
|
+
background-color: ${t=>t.theme.colors.neutral150};
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
&:not([data-disabled]) {
|
|
234
|
+
&:hover,
|
|
235
|
+
&[data-state='open'] {
|
|
236
|
+
background-color: ${t=>t.theme.colors.primary100};
|
|
237
|
+
|
|
238
|
+
& > ${Mx} {
|
|
239
|
+
color: ${t=>t.theme.colors.primary600};
|
|
240
|
+
|
|
241
|
+
& ${Tx} {
|
|
242
|
+
color: ${t=>t.theme.colors.primary600};
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
& ${wl} {
|
|
246
|
+
background-color: ${t=>t.theme.colors.primary200};
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
& > ${Ex} > button {
|
|
251
|
+
color: ${t=>t.theme.colors.primary600};
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
257
|
+
transition: ${t=>t.theme.transitions.backgroundColor};
|
|
258
|
+
}
|
|
259
|
+
`,CN=w.forwardRef((t,e)=>u.jsx(kN,{ref:e,...t})),$N=C.keyframes`
|
|
260
|
+
from {
|
|
261
|
+
height: 0;
|
|
262
|
+
}
|
|
263
|
+
to {
|
|
264
|
+
height: var(--radix-accordion-content-height);
|
|
265
|
+
}
|
|
266
|
+
`,SN=C.keyframes`
|
|
267
|
+
from {
|
|
268
|
+
height: var(--radix-accordion-content-height);
|
|
269
|
+
}
|
|
270
|
+
to {
|
|
271
|
+
height: 0;
|
|
272
|
+
}
|
|
273
|
+
`,kN=C.styled(HC)`
|
|
274
|
+
overflow: hidden;
|
|
275
|
+
|
|
276
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
277
|
+
&[data-state='open'] {
|
|
278
|
+
animation: ${$N} ${t=>t.theme.motion.timings[320]}
|
|
279
|
+
${t=>t.theme.motion.easings.authenticMotion};
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
&[data-state='closed'] {
|
|
283
|
+
animation: ${SN} ${t=>t.theme.motion.timings[320]}
|
|
284
|
+
${t=>t.theme.motion.easings.authenticMotion};
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
`,xo=Object.freeze(Object.defineProperty({__proto__:null,Actions:xN,Content:CN,Header:wN,Item:gN,Root:mN,Trigger:vN},Symbol.toStringTag,{value:"Module"})),uc=C.css`
|
|
288
|
+
position: relative;
|
|
289
|
+
outline: none;
|
|
290
|
+
|
|
291
|
+
&:after {
|
|
292
|
+
transition-property: all;
|
|
293
|
+
transition-duration: 0.2s;
|
|
294
|
+
border-radius: 8px;
|
|
295
|
+
content: '';
|
|
296
|
+
position: absolute;
|
|
297
|
+
top: -4px;
|
|
298
|
+
bottom: -4px;
|
|
299
|
+
left: -4px;
|
|
300
|
+
right: -4px;
|
|
301
|
+
border: 2px solid transparent;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
&:focus-visible {
|
|
305
|
+
outline: none;
|
|
306
|
+
|
|
307
|
+
&:after {
|
|
308
|
+
border-radius: 8px;
|
|
309
|
+
content: '';
|
|
310
|
+
position: absolute;
|
|
311
|
+
top: -5px;
|
|
312
|
+
bottom: -5px;
|
|
313
|
+
left: -5px;
|
|
314
|
+
right: -5px;
|
|
315
|
+
border: 2px solid ${t=>t.theme.colors.primary600};
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
`,Mr=({tag:t,...e})=>{const n=t||"span";return u.jsx(AN,{...e,as:n})},AN=C.styled.span`
|
|
319
|
+
border: 0;
|
|
320
|
+
clip: rect(0 0 0 0);
|
|
321
|
+
height: 1px;
|
|
322
|
+
margin: -1px;
|
|
323
|
+
overflow: hidden;
|
|
324
|
+
padding: 0;
|
|
325
|
+
position: absolute;
|
|
326
|
+
width: 1px;
|
|
327
|
+
`,Yi=({children:t,label:e})=>{const n=w.Children.only(t);return u.jsxs(u.Fragment,{children:[w.cloneElement(n,{"aria-hidden":"true",focusable:"false"}),u.jsx(Mr,{children:e})]})};Yi.displayName="AccessibleIcon";const Ix=t=>{switch(t){case"danger":return"danger100";case"success":return"success100";case"warning":return"warning100";default:return"primary100"}},RN=t=>Ix(t).replace("100","200"),zu=({theme:t,$variant:e})=>e==="danger"?t.colors.danger700:e==="success"?t.colors.success700:e==="warning"?t.colors.warning700:t.colors.primary700,TN=C.styled(re)`
|
|
328
|
+
${uc};
|
|
329
|
+
`,MN=C.styled(Y)`
|
|
330
|
+
svg {
|
|
331
|
+
height: 100%;
|
|
332
|
+
width: 100%;
|
|
333
|
+
|
|
334
|
+
path {
|
|
335
|
+
fill: ${zu};
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
`,EN=({variant:t,...e})=>t==="success"?u.jsx(R$,{...e}):t==="danger"||t==="warning"?u.jsx(l2,{...e}):u.jsx(i2,{...e}),IN=C.styled(re)`
|
|
339
|
+
& a > span {
|
|
340
|
+
color: ${zu};
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
svg path {
|
|
344
|
+
fill: ${zu};
|
|
345
|
+
}
|
|
346
|
+
`,jN=({title:t,children:e,variant:n="default",onClose:r,closeLabel:i,titleAs:o="p",action:s,...a})=>u.jsxs(Y,{alignItems:"flex-start",background:Ix(n),borderColor:RN(n),shadow:"filterShadow",gap:3,hasRadius:!0,padding:5,paddingRight:6,...a,children:[u.jsx(MN,{height:"2rem",shrink:0,$variant:n,width:"2rem",children:u.jsx(EN,{"aria-hidden":!0,variant:n})}),u.jsxs(Y,{alignItems:"start",gap:s?2:1,wrap:"wrap",role:n==="danger"?"alert":"status",width:"100%",children:[t&&u.jsx(ee,{fontWeight:"bold",textColor:"neutral800",tag:o,children:t}),u.jsx(ee,{tag:"p",textColor:"neutral800",children:e}),s&&u.jsx(IN,{$variant:n,children:s})]}),u.jsx(TN,{tag:"button",background:"transparent",borderColor:void 0,height:"1.6rem",width:"1.6rem",marginTop:1,onClick:r,color:"neutral700",children:u.jsx(Yi,{label:i,children:u.jsx(ri,{})})})]});function An({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=jx({defaultProp:e,onChange:n}),o=t!==void 0,s=o?t:r,a=nt(n),l=w.useCallback(c=>{if(o){const h=typeof c=="function"?c(t):c;h!==t&&a(h)}else i(c)},[o,t,i,a]);return[s,l]}function jx({defaultProp:t,onChange:e}){const n=w.useState(t),[r]=n,i=w.useRef(r),o=nt(e);return w.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const Hu={easeInSine:"cubic-bezier(0.47, 0, 0.745, 0.715)",easeOutSine:"cubic-bezier(0.39, 0.575, 0.565, 1)",easeInOutSine:"cubic-bezier(0.39, 0.575, 0.565, 1)",easeInQuad:"cubic-bezier(0.55, 0.085, 0.68, 0.53)",easeOutQuad:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",easeInOutQuad:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",easeInCubic:"cubic-bezier(0.55, 0.055, 0.675, 0.19)",easeOutCubic:"cubic-bezier(0.215, 0.61, 0.355, 1)",easeInOutCubic:"cubic-bezier(0.215, 0.61, 0.355, 1)",easeInQuart:"cubic-bezier(0.895, 0.03, 0.685, 0.22)",easeOutQuart:"cubic-bezier(0.165, 0.84, 0.44, 1)",easeInOutQuart:"cubic-bezier(0.165, 0.84, 0.44, 1)",easeInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",easeOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",easeInOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",easeInExpo:"cubic-bezier(0.95, 0.05, 0.795, 0.035)",easeOutExpo:"cubic-bezier(0.19, 1, 0.22, 1)",easeInOutExpo:"cubic-bezier(0.19, 1, 0.22, 1)",easeInCirc:"cubic-bezier(0.6, 0.04, 0.98, 0.335)",easeOutCirc:"cubic-bezier(0.075, 0.82, 0.165, 1)",easeInOutCirc:"cubic-bezier(0.075, 0.82, 0.165, 1)",easeInBack:"cubic-bezier(0.6, -0.28, 0.735, 0.045)",easeOutBack:"cubic-bezier(0.175, 0.885, 0.32, 1.275)",easeInOutBack:"cubic-bezier(0.68, -0.55, 0.265, 1.55)",easeInOutFast:"cubic-bezier(1,0,0,1)",authenticMotion:"cubic-bezier(.4,0,.2,1)"},Pu={320:"320ms",200:"200ms",120:"120ms"},DN={color:`color ${Pu[120]} ${Hu.easeOutQuad}`,backgroundColor:`background-color ${Pu[120]} ${Hu.easeOutQuad}`},Ze={overlayFadeIn:C.keyframes`
|
|
347
|
+
from {
|
|
348
|
+
opacity: 0;
|
|
349
|
+
}
|
|
350
|
+
to {
|
|
351
|
+
opacity: 0.2;
|
|
352
|
+
}
|
|
353
|
+
`,modalPopIn:C.keyframes`
|
|
354
|
+
from {
|
|
355
|
+
transform:translate(-50%, -50%) scale(0.8);
|
|
356
|
+
opacity: 0;
|
|
357
|
+
}
|
|
358
|
+
to {
|
|
359
|
+
transform: translate(-50%, -50%) scale(1);
|
|
360
|
+
opacity: 1;
|
|
361
|
+
}
|
|
362
|
+
`,modalPopOut:C.keyframes`
|
|
363
|
+
from {
|
|
364
|
+
transform: translate(-50%, -50%) scale(1);
|
|
365
|
+
opacity: 1;
|
|
366
|
+
}
|
|
367
|
+
to {
|
|
368
|
+
transform:translate(-50%, -50%) scale(0.8);
|
|
369
|
+
opacity: 0;
|
|
370
|
+
}
|
|
371
|
+
`,popIn:C.keyframes`
|
|
372
|
+
from {
|
|
373
|
+
transform: scale(0.8);
|
|
374
|
+
opacity: 0;
|
|
375
|
+
}
|
|
376
|
+
to {
|
|
377
|
+
transform: scale(1);
|
|
378
|
+
opacity: 1;
|
|
379
|
+
}
|
|
380
|
+
`,popOut:C.keyframes`
|
|
381
|
+
from {
|
|
382
|
+
transform: scale(1);
|
|
383
|
+
opacity: 1;
|
|
384
|
+
}
|
|
385
|
+
to {
|
|
386
|
+
transform: scale(0.8);
|
|
387
|
+
opacity: 0;
|
|
388
|
+
}
|
|
389
|
+
`,slideDownIn:C.keyframes`
|
|
390
|
+
from {
|
|
391
|
+
opacity: 0;
|
|
392
|
+
transform: translateY(-10px);
|
|
393
|
+
}
|
|
394
|
+
to {
|
|
395
|
+
opacity: 1;
|
|
396
|
+
transform: translateY(0);
|
|
397
|
+
}
|
|
398
|
+
`,slideDownOut:C.keyframes`
|
|
399
|
+
from {
|
|
400
|
+
opacity: 1;
|
|
401
|
+
transform: translateY(0);
|
|
402
|
+
}
|
|
403
|
+
to {
|
|
404
|
+
opacity: 0;
|
|
405
|
+
transform: translateY(-10px);
|
|
406
|
+
}
|
|
407
|
+
`,slideUpIn:C.keyframes`
|
|
408
|
+
from {
|
|
409
|
+
opacity: 0;
|
|
410
|
+
transform: translateY(10px);
|
|
411
|
+
}
|
|
412
|
+
to {
|
|
413
|
+
opacity: 1;
|
|
414
|
+
transform: translateY(0);
|
|
415
|
+
}
|
|
416
|
+
`,slideUpOut:C.keyframes`
|
|
417
|
+
from {
|
|
418
|
+
opacity: 1;
|
|
419
|
+
transform: translateY(0);
|
|
420
|
+
}
|
|
421
|
+
to {
|
|
422
|
+
opacity: 0;
|
|
423
|
+
transform: translateY(10px);
|
|
424
|
+
}
|
|
425
|
+
`,fadeIn:C.keyframes`
|
|
426
|
+
from {
|
|
427
|
+
opacity: 0;
|
|
428
|
+
}
|
|
429
|
+
to {
|
|
430
|
+
opacity: 1;
|
|
431
|
+
}
|
|
432
|
+
`,fadeOut:C.keyframes`
|
|
433
|
+
from {
|
|
434
|
+
opacity: 1;
|
|
435
|
+
}
|
|
436
|
+
to {
|
|
437
|
+
opacity: 0;
|
|
438
|
+
}
|
|
439
|
+
`},ls=32,Um=2;w.forwardRef(({onLoadingStatusChange:t,delayMs:e=600,src:n,alt:r,fallback:i,preview:o=!1,...s},a)=>{const[l,c]=An({onChange:t}),[d,h]=w.useState(!1),f=o&&l==="loaded",m=g=>{f&&h(g)};return u.jsxs(sg,{onOpenChange:m,children:[u.jsx(ag,{asChild:!0,children:u.jsxs(Wu,{ref:a,...s,children:[f?u.jsx(ON,{width:"100%",height:"100%",position:"absolute",background:"neutral0",zIndex:"overlay",style:{opacity:d?.4:0}}):null,u.jsx(LN,{src:n,alt:r,onLoadingStatusChange:c}),u.jsx(o9,{delayMs:e,children:u.jsx(ee,{fontWeight:"bold",textTransform:"uppercase",children:i})})]})}),f?u.jsx(lg,{children:u.jsx(NN,{side:"top",sideOffset:4,children:u.jsx(BN,{src:n,alt:r})})}):null]})});const Dx=C.css`
|
|
440
|
+
display: inline-flex;
|
|
441
|
+
align-items: center;
|
|
442
|
+
justify-content: center;
|
|
443
|
+
vertical-align: middle;
|
|
444
|
+
overflow: hidden;
|
|
445
|
+
user-select: none;
|
|
446
|
+
overflow: hidden;
|
|
447
|
+
border-radius: 50%;
|
|
448
|
+
`,Ox=C.css`
|
|
449
|
+
width: 100%;
|
|
450
|
+
height: 100%;
|
|
451
|
+
object-fit: cover;
|
|
452
|
+
border-radius: inherit;
|
|
453
|
+
`,Wu=C.styled(r9)`
|
|
454
|
+
position: relative;
|
|
455
|
+
z-index: 0;
|
|
456
|
+
${Dx}
|
|
457
|
+
width: ${ls/10}rem;
|
|
458
|
+
height: ${ls/10}rem;
|
|
459
|
+
/* TODO: we should get the user email & hash it to turn it into a hex-value so different emails can consistently get a different background */
|
|
460
|
+
background-color: ${t=>t.theme.colors.primary600};
|
|
461
|
+
color: ${t=>t.theme.colors.neutral0};
|
|
462
|
+
`,ON=C.styled(re)`
|
|
463
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
464
|
+
transition: opacity ${t=>t.theme.motion.timings[200]}
|
|
465
|
+
${t=>t.theme.motion.easings.authenticMotion};
|
|
466
|
+
}
|
|
467
|
+
`,LN=C.styled(i9)`
|
|
468
|
+
${Ox}
|
|
469
|
+
`,NN=C.styled(cg)`
|
|
470
|
+
${Dx}
|
|
471
|
+
width: ${ls*Um/10}rem;
|
|
472
|
+
height: ${ls*Um/10}rem;
|
|
473
|
+
|
|
474
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
475
|
+
animation: ${Ze.fadeIn} ${t=>t.theme.motion.timings[200]}
|
|
476
|
+
${t=>t.theme.motion.easings.authenticMotion};
|
|
477
|
+
}
|
|
478
|
+
`,BN=C.styled.img`
|
|
479
|
+
${Ox}
|
|
480
|
+
`;w.forwardRef((t,e)=>u.jsx(FN,{...t,ref:e,tag:"div"}));const FN=C.styled(Y)`
|
|
481
|
+
& > ${Wu} + ${Wu} {
|
|
482
|
+
margin-left: -${ls/10/2}rem;
|
|
483
|
+
}
|
|
484
|
+
`,Lx=({active:t=!1,size:e="M",textColor:n="neutral600",backgroundColor:r="neutral150",children:i,minWidth:o=5,...s})=>{const a=e==="S"?1:2;return u.jsx(VN,{inline:!0,alignItems:"center",justifyContent:"center",minWidth:o,paddingLeft:a,paddingRight:a,background:t?"primary200":r,$size:e,...s,children:u.jsx(ee,{variant:"sigma",textColor:t?"primary600":n,lineHeight:"1rem",children:i})})},VN=C.styled(Y)`
|
|
485
|
+
border-radius: ${({theme:t,$size:e})=>e==="S"?"2px":t.borderRadius};
|
|
486
|
+
${({$size:t,theme:e})=>t==="S"?C.css`
|
|
487
|
+
padding-block: 0.3rem;
|
|
488
|
+
padding-inline ${e.spaces[1]}
|
|
489
|
+
`:C.css`
|
|
490
|
+
padding-block: 0.7rem;
|
|
491
|
+
padding-inline ${e.spaces[2]}
|
|
492
|
+
`};
|
|
493
|
+
`,Ts=Mt(({href:t,disabled:e=!1,isExternal:n=!1,...r},i)=>u.jsx(_N,{tag:"a",ref:i,target:n?"_blank":void 0,rel:n?"noreferrer noopener":void 0,href:t,tabIndex:e?-1:void 0,"aria-disabled":e,pointerEvents:e?"none":void 0,cursor:e?void 0:"pointer",...r})),_N=C.styled(re)`
|
|
494
|
+
text-decoration: none;
|
|
495
|
+
|
|
496
|
+
&:visited {
|
|
497
|
+
color: inherit;
|
|
498
|
+
}
|
|
499
|
+
`,Nx=()=>u.jsx(re,{"aria-hidden":!0,paddingLeft:1,paddingRight:1,children:u.jsx(ee,{variant:"pi",textColor:"neutral500",children:"/"})});Nx.displayName="Divider";const zN=C.styled(Y)`
|
|
500
|
+
// CrumbLinks do have padding-x, because they need to have a
|
|
501
|
+
// interaction effect, which mis-aligns the breadcrumbs on the left.
|
|
502
|
+
// This normalizes the behavior by moving the first item to left by
|
|
503
|
+
// the same amount it has inner padding
|
|
504
|
+
& > *:first-child {
|
|
505
|
+
margin-left: ${({theme:t})=>`calc(-1*${t.spaces[2]})`};
|
|
506
|
+
}
|
|
507
|
+
`,HN=w.forwardRef(({label:t,children:e,...n},r)=>{const i=w.Children.toArray(e);return u.jsx(re,{"aria-label":t,tag:"nav",...n,ref:r,children:u.jsx(zN,{tag:"ol",children:w.Children.map(i,(o,s)=>{const a=i.length>1&&s+1<i.length;return u.jsxs(Y,{inline:!0,tag:"li",children:[o,a&&u.jsx(Nx,{})]})})})})});HN.displayName="Breadcrumbs";const PN=w.forwardRef(({children:t,isCurrent:e=!1,...n},r)=>u.jsx(re,{paddingLeft:2,paddingRight:2,paddingTop:1,paddingBottom:1,ref:r,children:u.jsx(ee,{variant:"pi",textColor:"neutral800",fontWeight:e?"bold":"regular","aria-current":e,...n,children:t})}));PN.displayName="Crumb";const WN=C.styled(Ts)`
|
|
508
|
+
border-radius: ${({theme:t})=>t.borderRadius};
|
|
509
|
+
color: ${({theme:t})=>t.colors.neutral600};
|
|
510
|
+
font-size: ${({theme:t})=>t.fontSizes[1]};
|
|
511
|
+
line-height: ${({theme:t})=>t.lineHeights[4]};
|
|
512
|
+
padding: ${({theme:t})=>`${t.spaces[1]} ${t.spaces[2]}`};
|
|
513
|
+
text-decoration: none;
|
|
514
|
+
|
|
515
|
+
:hover,
|
|
516
|
+
:focus {
|
|
517
|
+
background-color: ${({theme:t})=>t.colors.neutral200};
|
|
518
|
+
color: ${({theme:t})=>t.colors.neutral700};
|
|
519
|
+
}
|
|
520
|
+
`,qN=w.forwardRef(({children:t,...e},n)=>u.jsx(WN,{ref:n,...e,children:t}));qN.displayName="CrumbLink";const Xi=t=>t.replaceAll(":","");function UN(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function Bx(...t){return e=>t.forEach(n=>UN(n,e))}function Nt(...t){return w.useCallback(Bx(...t),t)}const KN=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Zr=KN()?p.useEffect:p.useLayoutEffect,GN=w.useId||(()=>{});let YN=0;const fn=t=>{const[e,n]=w.useState(GN());return Zr(()=>{t||n(r=>r??String(YN++))},[t]),t?.toString()??(e||"")},Ms=(t,e,{selectorToWatch:n,skipWhen:r=!1})=>{const i=Sh(e);w.useEffect(()=>{if(r||!t.current)return;const o={root:t.current,rootMargin:"0px"},s=c=>{c.forEach(d=>{d.isIntersecting&&t.current&&t.current.scrollHeight>t.current.clientHeight&&i(d)})},a=new IntersectionObserver(s,o),l=t.current.querySelector(n);return l&&a.observe(l),()=>{a.disconnect()}},[r,i,n,t])},Hf="success-light",Pf="danger-light",hc="default",Es="tertiary",Is="secondary",Fx="danger",Vx="success",fc="ghost",Wf=[Hf,Pf],XN=[hc,Es,Is,Fx,Vx,fc,...Wf],QN=["XS","S","M","L"],en=t=>t===Hf||t===Pf?`${t.substring(0,t.lastIndexOf("-"))}`:t===Es?"neutral":t===hc||t===Is||XN.every(e=>e!==t)?"primary":`${t}`,_x=({theme:t})=>C.css`
|
|
521
|
+
border: 1px solid ${t.colors.neutral200};
|
|
522
|
+
background: ${t.colors.neutral150};
|
|
523
|
+
color: ${t.colors.neutral600};
|
|
524
|
+
cursor: default;
|
|
525
|
+
`,zx=({theme:t,$variant:e})=>[...Wf,Is].includes(e)?C.css`
|
|
526
|
+
background-color: ${t.colors.neutral0};
|
|
527
|
+
`:e===Es?C.css`
|
|
528
|
+
background-color: ${t.colors.neutral100};
|
|
529
|
+
`:e===fc?C.css`
|
|
530
|
+
background-color: ${t.colors.neutral100};
|
|
531
|
+
`:e===hc?C.css`
|
|
532
|
+
border: 1px solid ${t.colors.buttonPrimary500};
|
|
533
|
+
background: ${t.colors.buttonPrimary500};
|
|
534
|
+
`:C.css`
|
|
535
|
+
border: 1px solid ${t.colors[`${en(e)}500`]};
|
|
536
|
+
background: ${t.colors[`${en(e)}500`]};
|
|
537
|
+
`,Hx=({theme:t,$variant:e})=>[...Wf,Is].includes(e)?C.css`
|
|
538
|
+
background-color: ${t.colors.neutral0};
|
|
539
|
+
border: 1px solid ${t.colors[`${en(e)}600`]};
|
|
540
|
+
color: ${t.colors[`${en(e)}600`]};
|
|
541
|
+
`:e===Es||e===fc?C.css`
|
|
542
|
+
background-color: ${t.colors.neutral150};
|
|
543
|
+
`:C.css`
|
|
544
|
+
border: 1px solid ${t.colors[`${en(e)}600`]};
|
|
545
|
+
background: ${t.colors[`${en(e)}600`]};
|
|
546
|
+
`,Px=({theme:t,$variant:e})=>{switch(e){case Pf:case Hf:case Is:return C.css`
|
|
547
|
+
border: 1px solid ${t.colors[`${en(e)}200`]};
|
|
548
|
+
background: ${t.colors[`${en(e)}100`]};
|
|
549
|
+
color: ${t.colors[`${en(e)}700`]};
|
|
550
|
+
`;case Es:return C.css`
|
|
551
|
+
border: 1px solid ${t.colors.neutral200};
|
|
552
|
+
background: ${t.colors.neutral0};
|
|
553
|
+
color: ${t.colors.neutral800};
|
|
554
|
+
`;case fc:return C.css`
|
|
555
|
+
border: 1px solid transparent;
|
|
556
|
+
background: transparent;
|
|
557
|
+
color: ${t.colors.neutral800};
|
|
558
|
+
|
|
559
|
+
svg {
|
|
560
|
+
fill: ${t.colors.neutral500};
|
|
561
|
+
}
|
|
562
|
+
`;case Vx:case Fx:return C.css`
|
|
563
|
+
border: 1px solid ${t.colors[`${en(e)}600`]};
|
|
564
|
+
background: ${t.colors[`${en(e)}600`]};
|
|
565
|
+
color: ${t.colors.neutral0};
|
|
566
|
+
`;default:return C.css`
|
|
567
|
+
border: 1px solid ${t.colors.buttonPrimary600};
|
|
568
|
+
background: ${t.colors.buttonPrimary600};
|
|
569
|
+
color: ${t.colors.buttonNeutral0};
|
|
570
|
+
`}},Xe=Mt(({variant:t=hc,startIcon:e,endIcon:n,disabled:r=!1,children:i,onClick:o,size:s=QN[1],loading:a=!1,fullWidth:l=!1,...c},d)=>{const h=r||a,f=m=>{!h&&o&&o(m)};return u.jsxs(eB,{ref:d,"aria-disabled":h,disabled:h,$size:s,$variant:t,tag:"button",onClick:f,hasRadius:!0,gap:2,inline:!0,alignItems:"center",justifyContent:"center",width:l?"100%":void 0,paddingLeft:4,paddingRight:4,cursor:"pointer",...c,children:[(e||a)&&u.jsx(Y,{tag:"span","aria-hidden":!0,children:a?u.jsx(JN,{}):e}),u.jsx(ee,{variant:s==="S"?"pi":void 0,fontWeight:"bold",children:i}),n&&u.jsx(Y,{tag:"span","aria-hidden":!0,children:n})]})}),ZN=C.keyframes`
|
|
571
|
+
from {
|
|
572
|
+
transform: rotate(0deg);
|
|
573
|
+
}
|
|
574
|
+
to {
|
|
575
|
+
transform: rotate(359deg);
|
|
576
|
+
}
|
|
577
|
+
`,JN=C.styled(o2)`
|
|
578
|
+
animation: ${ZN} 2s infinite linear;
|
|
579
|
+
will-change: transform;
|
|
580
|
+
`,eB=C.styled(Y)`
|
|
581
|
+
height: ${({theme:t,$size:e})=>t.sizes.button[e]};
|
|
582
|
+
text-decoration: none;
|
|
583
|
+
${Px}
|
|
584
|
+
|
|
585
|
+
&:hover {
|
|
586
|
+
${zx}
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
&:active {
|
|
590
|
+
${Hx}
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
&[aria-disabled='true'] {
|
|
594
|
+
${_x}
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
598
|
+
transition:
|
|
599
|
+
${t=>t.theme.transitions.backgroundColor},
|
|
600
|
+
${t=>t.theme.transitions.color},
|
|
601
|
+
border-color ${t=>t.theme.motion.timings[200]} ${t=>t.theme.motion.easings.easeOutQuad};
|
|
602
|
+
}
|
|
603
|
+
`,qf=w.forwardRef(({children:t,description:e,label:n,defaultOpen:r,open:i,onOpenChange:o,delayDuration:s=500,disableHoverableContent:a,...l},c)=>!n&&!e?t:u.jsxs(sg,{defaultOpen:r,open:i,onOpenChange:o,delayDuration:s,disableHoverableContent:a,children:[u.jsx(ag,{asChild:!0,children:t}),u.jsx(lg,{children:u.jsx(tB,{ref:c,sideOffset:8,...l,children:u.jsx(ee,{variant:"pi",fontWeight:"bold",children:n||e})})})]})),tB=C.styled(cg)`
|
|
604
|
+
background-color: ${t=>t.theme.colors.neutral900};
|
|
605
|
+
color: ${t=>t.theme.colors.neutral0};
|
|
606
|
+
padding-inline: ${t=>t.theme.spaces[2]};
|
|
607
|
+
padding-block: ${t=>t.theme.spaces[2]};
|
|
608
|
+
border-radius: ${t=>t.theme.borderRadius};
|
|
609
|
+
z-index: ${t=>t.theme.zIndices.tooltip};
|
|
610
|
+
will-change: opacity;
|
|
611
|
+
transform-origin: var(--radix-tooltip-content-transform-origin);
|
|
612
|
+
|
|
613
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
614
|
+
animation: ${Ze.fadeIn} ${t=>t.theme.motion.timings[200]}
|
|
615
|
+
${t=>t.theme.motion.easings.authenticMotion};
|
|
616
|
+
}
|
|
617
|
+
`,At=Mt(({label:t,background:e,children:n,disabled:r=!1,onClick:i,size:o="S",variant:s="tertiary",withTooltip:a=!0,...l},c)=>{const d=f=>{!r&&i&&i(f)},h=u.jsx(Io,{"aria-disabled":r,background:r?"neutral150":e,tag:"button",display:"inline-flex",justifyContent:"center",hasRadius:!0,cursor:"pointer",...l,ref:c,$size:o,onClick:d,$variant:s,children:u.jsx(Yi,{label:t,children:n})});return a?u.jsx(qf,{label:t,children:h}):h}),Io=C.styled(Y)`
|
|
618
|
+
text-decoration: none;
|
|
619
|
+
|
|
620
|
+
${t=>{switch(t.$size){case"XS":return C.css`
|
|
621
|
+
padding-block: 0.25rem;
|
|
622
|
+
padding-inline: 0.25rem;
|
|
623
|
+
`;case"S":return C.css`
|
|
624
|
+
padding-block: 0.7rem;
|
|
625
|
+
padding-inline: 0.7rem;
|
|
626
|
+
`;case"M":return C.css`
|
|
627
|
+
padding-block: 0.9rem;
|
|
628
|
+
padding-inline: 0.9rem;
|
|
629
|
+
`;case"L":return C.css`
|
|
630
|
+
padding-block: 1.1rem;
|
|
631
|
+
padding-inline: 1.1rem;
|
|
632
|
+
`}}}
|
|
633
|
+
${Px}
|
|
634
|
+
${t=>t.$variant==="tertiary"?C.css`
|
|
635
|
+
color: ${t.theme.colors.neutral500};
|
|
636
|
+
`:""}
|
|
637
|
+
|
|
638
|
+
&:hover {
|
|
639
|
+
${zx}
|
|
640
|
+
${t=>t.$variant==="tertiary"?C.css`
|
|
641
|
+
color: ${t.theme.colors.neutral600};
|
|
642
|
+
`:""}
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
&:active {
|
|
646
|
+
${Hx}
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
&[aria-disabled='true'] {
|
|
650
|
+
${_x}
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
654
|
+
transition:
|
|
655
|
+
${t=>t.theme.transitions.backgroundColor},
|
|
656
|
+
${t=>t.theme.transitions.color},
|
|
657
|
+
border-color ${t=>t.theme.motion.timings[200]} ${t=>t.theme.motion.easings.easeOutQuad};
|
|
658
|
+
}
|
|
659
|
+
`,Wx=C.styled(Y)`
|
|
660
|
+
& ${Io}:first-child {
|
|
661
|
+
border-radius: ${({theme:t})=>`${t.borderRadius} 0 0 ${t.borderRadius}`};
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
& ${Io}:last-child {
|
|
665
|
+
border-radius: ${({theme:t})=>`0 ${t.borderRadius} ${t.borderRadius} 0`};
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
& ${Io} {
|
|
669
|
+
border-radius: 0;
|
|
670
|
+
|
|
671
|
+
& + ${Io} {
|
|
672
|
+
border-left: none;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
`,qx=Mt(({children:t,href:e,disabled:n=!1,startIcon:r,endIcon:i,isExternal:o=!1,...s},a)=>u.jsxs(nB,{ref:a,href:e,disabled:n,isExternal:o,...s,children:[r,u.jsx(ee,{textColor:n?"neutral600":"primary600",children:t}),i,e&&!i&&o&&u.jsx(b8,{})]})),nB=C.styled(Ts)`
|
|
676
|
+
display: inline-flex;
|
|
677
|
+
align-items: center;
|
|
678
|
+
text-decoration: none;
|
|
679
|
+
gap: ${({theme:t})=>t.spaces[2]};
|
|
680
|
+
pointer-events: ${({disabled:t})=>t?"none":void 0};
|
|
681
|
+
|
|
682
|
+
svg {
|
|
683
|
+
font-size: 1rem;
|
|
684
|
+
|
|
685
|
+
path {
|
|
686
|
+
fill: ${({disabled:t,theme:e})=>t?e.colors.neutral600:e.colors.primary600};
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
&:hover {
|
|
691
|
+
& > span {
|
|
692
|
+
color: ${({theme:t})=>t.colors.primary500};
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
svg path {
|
|
696
|
+
fill: ${({theme:t})=>t.colors.primary500};
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
&:active {
|
|
701
|
+
color: ${({theme:t})=>t.colors.primary700};
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
${uc};
|
|
705
|
+
`,rB=Rk,iB=w.forwardRef(({label:t,endIcon:e=u.jsx(br,{width:"1.2rem",height:"1.2rem","aria-hidden":!0}),tag:n=Xe,icon:r,...i},o)=>{const s={...i,ref:o,type:"button"};return u.jsx(Tk,{asChild:!0,disabled:s.disabled,children:n===At?u.jsx(At,{label:t,variant:"tertiary",...s,children:r}):u.jsx(Xe,{endIcon:e,variant:"ghost",...s})})}),oB=w.forwardRef(({children:t,intersectionId:e,onCloseAutoFocus:n,popoverPlacement:r="bottom-start",...i},o)=>{const[s,a]=r.split("-");return u.jsx(T2,{children:u.jsx(sB,{align:a,side:s,loop:!0,onCloseAutoFocus:n,asChild:!0,children:u.jsxs(Ux,{ref:o,direction:"column",borderColor:"neutral150",hasRadius:!0,background:"neutral0",shadow:"filterShadow",maxHeight:"15rem",padding:1,marginTop:1,marginBottom:1,alignItems:"flex-start",position:"relative",overflow:"auto",...i,children:[t,u.jsx(re,{id:e,width:"100%",height:"1px"})]})})})}),Ux=C.styled(Y)`
|
|
706
|
+
scrollbar-width: none;
|
|
707
|
+
-ms-overflow-style: none;
|
|
708
|
+
-webkit-overflow-scrolling: touch;
|
|
709
|
+
z-index: ${t=>t.theme.zIndices.popover};
|
|
710
|
+
|
|
711
|
+
&::-webkit-scrollbar {
|
|
712
|
+
display: none;
|
|
713
|
+
}
|
|
714
|
+
`,sB=C.styled(Mk)`
|
|
715
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
716
|
+
animation-duration: ${t=>t.theme.motion.timings[200]};
|
|
717
|
+
|
|
718
|
+
&[data-state='open'] {
|
|
719
|
+
animation-timing-function: ${t=>t.theme.motion.easings.authenticMotion};
|
|
720
|
+
|
|
721
|
+
&[data-side='top'] {
|
|
722
|
+
animation-name: ${Ze.slideUpIn};
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
&[data-side='bottom'] {
|
|
726
|
+
animation-name: ${Ze.slideDownIn};
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
`,Kx=({theme:t})=>C.css`
|
|
731
|
+
text-align: left;
|
|
732
|
+
width: 100%;
|
|
733
|
+
border-radius: ${t.borderRadius};
|
|
734
|
+
padding: ${t.spaces[2]} ${t.spaces[4]};
|
|
735
|
+
|
|
736
|
+
&[aria-disabled='true'] {
|
|
737
|
+
cursor: not-allowed;
|
|
738
|
+
color: ${t.colors.neutral500};
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
&[data-highlighted] {
|
|
742
|
+
background-color: ${t.colors.primary100};
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
&:focus-visible {
|
|
746
|
+
outline: none;
|
|
747
|
+
|
|
748
|
+
&:after {
|
|
749
|
+
content: none;
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
`,aB=C.styled(Y)`
|
|
753
|
+
${Kx}
|
|
754
|
+
`;C.styled(qx)`
|
|
755
|
+
/* We include this here again because typically when people use OptionLink they provide an as prop which cancels the Box props */
|
|
756
|
+
color: ${({theme:t,color:e})=>Da(t.colors,e,void 0)};
|
|
757
|
+
text-decoration: none;
|
|
758
|
+
|
|
759
|
+
&:hover {
|
|
760
|
+
color: unset;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
/* TODO: do we need this? */
|
|
764
|
+
svg > path,
|
|
765
|
+
&:focus-visible svg > path {
|
|
766
|
+
fill: currentColor;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
${Kx}
|
|
770
|
+
`;const lB=C.styled(re)`
|
|
771
|
+
/* Negative horizontal margin to compensate Menu.Content's padding */
|
|
772
|
+
margin: ${({theme:t})=>t.spaces[1]} -${({theme:t})=>t.spaces[1]};
|
|
773
|
+
width: calc(100% + ${({theme:t})=>t.spaces[2]});
|
|
774
|
+
/* Hide separator if there's nothing above in the menu */
|
|
775
|
+
&:first-child {
|
|
776
|
+
display: none;
|
|
777
|
+
}
|
|
778
|
+
`;w.forwardRef((t,e)=>u.jsx(Ik,{...t,asChild:!0,children:u.jsx(lB,{height:"1px",shrink:0,background:"neutral150",ref:e})}));w.forwardRef((t,e)=>u.jsx(Ek,{asChild:!0,children:u.jsx(cB,{ref:e,variant:"sigma",textColor:"neutral600",...t})}));const cB=C.styled(ee)`
|
|
779
|
+
padding: ${({theme:t})=>t.spaces[2]} ${({theme:t})=>t.spaces[4]};
|
|
780
|
+
`;w.forwardRef(({disabled:t=!1,...e},n)=>u.jsx(jk,{asChild:!0,disabled:t,children:u.jsxs(dB,{ref:n,color:"neutral800",tag:"button",type:"button",background:"transparent",borderStyle:"none",gap:5,...e,children:[u.jsx(ee,{children:e.children}),u.jsx(Gh,{fill:"neutral500",height:"1.2rem",width:"1.2rem"})]})}));const dB=C.styled(aB)`
|
|
781
|
+
&[data-state='open'] {
|
|
782
|
+
background-color: ${({theme:t})=>t.colors.primary100};
|
|
783
|
+
}
|
|
784
|
+
`;w.forwardRef((t,e)=>u.jsx(T2,{children:u.jsx(Dk,{sideOffset:8,asChild:!0,children:u.jsx(Ux,{ref:e,direction:"column",borderStyle:"solid",borderWidth:"1px",borderColor:"neutral150",hasRadius:!0,background:"neutral0",shadow:"filterShadow",maxHeight:"15rem",padding:1,alignItems:"flex-start",overflow:"auto",...t})})}));const uB=rB,hB=iB,fB=oB,mB=w.forwardRef(({children:t,onOpen:e,onClose:n,popoverPlacement:r,onReachEnd:i,...o},s)=>{const a=w.useRef(null),l=Nt(s,a),c=w.useRef(null),[d,h]=w.useState(!1),f=v=>{i&&i(v)},m=v=>{v&&typeof e=="function"?e():!v&&typeof n=="function"&&n(),h(v)},g=fn(),b=`intersection-${Xi(g)}`;return Ms(c,f,{selectorToWatch:`#${b}`,skipWhen:!d}),u.jsxs(uB,{onOpenChange:m,children:[u.jsx(hB,{ref:l,...o,children:o.label}),u.jsx(fB,{ref:c,intersectionId:b,popoverPlacement:r,children:t})]})}),pB=C.styled(mB)`
|
|
785
|
+
padding: ${({theme:t})=>`${t.spaces[1]} ${t.spaces[2]}`};
|
|
786
|
+
height: unset;
|
|
787
|
+
|
|
788
|
+
:hover,
|
|
789
|
+
:focus {
|
|
790
|
+
background-color: ${({theme:t})=>t.colors.neutral200};
|
|
791
|
+
}
|
|
792
|
+
`,gB=w.forwardRef(({children:t,...e},n)=>u.jsx(pB,{ref:n,endIcon:null,size:"S",...e,children:t}));gB.displayName="CrumbSimpleMenu";const Gx=w.createContext({id:""}),Yx=()=>w.useContext(Gx),bB=w.forwardRef(({id:t,...e},n)=>{const r=fn(t),i=w.useMemo(()=>({id:r}),[r]);return u.jsx(Gx.Provider,{value:i,children:u.jsx(re,{ref:n,id:t,tabIndex:0,hasRadius:!0,background:"neutral0",borderStyle:"solid",borderWidth:"1px",borderColor:"neutral150",shadow:"tableShadow",tag:"article","aria-labelledby":`${r}-title`,...e})})}),vB=w.forwardRef(({position:t,...e},n)=>u.jsx(xB,{ref:n,$position:t,...e,direction:"row",gap:2})),xB=C.styled(Y)`
|
|
793
|
+
position: absolute;
|
|
794
|
+
top: ${({theme:t})=>t.spaces[3]};
|
|
795
|
+
right: ${({$position:t,theme:e})=>{if(t==="end")return e.spaces[3]}};
|
|
796
|
+
left: ${({$position:t,theme:e})=>{if(t==="start")return e.spaces[3]}};
|
|
797
|
+
`;C.styled.img`
|
|
798
|
+
// inline flows is based on typography and displays an extra white space below the image
|
|
799
|
+
// switch to block is required in order to make the img stick the bottom of the container
|
|
800
|
+
// addition infos: https://stackoverflow.com/questions/5804256/image-inside-div-has-extra-space-below-the-image
|
|
801
|
+
margin: 0;
|
|
802
|
+
padding: 0;
|
|
803
|
+
max-height: 100%;
|
|
804
|
+
max-width: 100%;
|
|
805
|
+
object-fit: contain;
|
|
806
|
+
`;C.styled.div`
|
|
807
|
+
display: flex;
|
|
808
|
+
justify-content: center;
|
|
809
|
+
height: ${({$size:t})=>t==="S"?"8.8rem":"16.4rem"};
|
|
810
|
+
width: 100%;
|
|
811
|
+
background: repeating-conic-gradient(${({theme:t})=>t.colors.neutral100} 0% 25%, transparent 0% 50%) 50% / 20px
|
|
812
|
+
20px;
|
|
813
|
+
border-top-left-radius: ${({theme:t})=>t.borderRadius};
|
|
814
|
+
border-top-right-radius: ${({theme:t})=>t.borderRadius};
|
|
815
|
+
`;C.styled.div`
|
|
816
|
+
margin-left: auto;
|
|
817
|
+
flex-shrink: 0;
|
|
818
|
+
`;C.styled(Lx)`
|
|
819
|
+
margin-left: ${({theme:t})=>t.spaces[1]};
|
|
820
|
+
`;const Km=t=>u.jsx(re,{paddingLeft:3,paddingRight:3,paddingTop:2,paddingBottom:2,children:u.jsx(Y,{...t,alignItems:"flex-start"})}),wB=({fill:t,...e})=>{const{colors:n}=C.useTheme();return u.jsx(re,{tag:"svg",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",fill:t?n[t]:void 0,...e,children:u.jsx("path",{d:"M29.0613 10.0613L13.0613 26.0613C12.9219 26.2011 12.7563 26.3121 12.574 26.3878C12.3917 26.4635 12.1962 26.5024 11.9988 26.5024C11.8013 26.5024 11.6059 26.4635 11.4235 26.3878C11.2412 26.3121 11.0756 26.2011 10.9363 26.0613L3.93626 19.0613C3.79673 18.9217 3.68605 18.7561 3.61053 18.5738C3.53502 18.3915 3.49615 18.1961 3.49615 17.9988C3.49615 17.8014 3.53502 17.606 3.61053 17.4237C3.68605 17.2414 3.79673 17.0758 3.93626 16.9363C4.07579 16.7967 4.24143 16.686 4.42374 16.6105C4.60604 16.535 4.80143 16.4962 4.99876 16.4962C5.19608 16.4962 5.39147 16.535 5.57378 16.6105C5.75608 16.686 5.92173 16.7967 6.06126 16.9363L12 22.875L26.9388 7.93876C27.2205 7.65697 27.6027 7.49866 28.0013 7.49866C28.3998 7.49866 28.782 7.65697 29.0638 7.93876C29.3455 8.22055 29.5039 8.60274 29.5039 9.00126C29.5039 9.39977 29.3455 9.78197 29.0638 10.0638L29.0613 10.0613Z"})})},Gm=w.forwardRef(({defaultChecked:t,checked:e,onCheckedChange:n,...r},i)=>{const o=w.useRef(null),[s,a]=An({defaultProp:t,prop:e,onChange:n}),l=Nt(o,i);return u.jsx(yB,{ref:l,checked:s,onCheckedChange:a,...r,children:u.jsxs(CB,{forceMount:!0,children:[s===!0?u.jsx(wB,{width:"1.6rem",fill:"neutral0"}):null,s==="indeterminate"?u.jsx(s2,{fill:"neutral0"}):null]})})}),yB=C.styled(zk)`
|
|
821
|
+
background: ${t=>t.theme.colors.neutral0};
|
|
822
|
+
width: 2rem;
|
|
823
|
+
height: 2rem;
|
|
824
|
+
border-radius: ${t=>t.theme.borderRadius};
|
|
825
|
+
border: 1px solid ${t=>t.theme.colors.neutral300};
|
|
826
|
+
position: relative;
|
|
827
|
+
z-index: 0;
|
|
828
|
+
display: flex;
|
|
829
|
+
justify-content: center;
|
|
830
|
+
align-items: center;
|
|
831
|
+
// this ensures the checkbox is always a square even in flex-containers.
|
|
832
|
+
flex: 0 0 2rem;
|
|
833
|
+
|
|
834
|
+
&[data-state='checked'],
|
|
835
|
+
&[data-state='indeterminate'] {
|
|
836
|
+
border: 1px solid ${t=>t.theme.colors.primary600};
|
|
837
|
+
background-color: ${t=>t.theme.colors.primary600};
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
&[data-disabled] {
|
|
841
|
+
background-color: ${t=>t.theme.colors.neutral200};
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
/* increase target size for touch devices https://www.w3.org/WAI/WCAG21/Understanding/target-size.html */
|
|
845
|
+
&::before {
|
|
846
|
+
content: '';
|
|
847
|
+
position: absolute;
|
|
848
|
+
top: 50%;
|
|
849
|
+
left: 50%;
|
|
850
|
+
transform: translate(-50%, -50%);
|
|
851
|
+
width: 100%;
|
|
852
|
+
height: 100%;
|
|
853
|
+
z-index: -1;
|
|
854
|
+
min-width: 44px;
|
|
855
|
+
min-height: 44px;
|
|
856
|
+
}
|
|
857
|
+
`,CB=C.styled(Hk)`
|
|
858
|
+
display: inline-flex;
|
|
859
|
+
pointer-events: auto !important;
|
|
860
|
+
width: 100%;
|
|
861
|
+
height: 100%;
|
|
862
|
+
cursor: pointer;
|
|
863
|
+
justify-content: center;
|
|
864
|
+
align-items: center;
|
|
865
|
+
|
|
866
|
+
&[data-disabled] {
|
|
867
|
+
cursor: not-allowed;
|
|
868
|
+
}
|
|
869
|
+
`,cs=w.forwardRef(({children:t,...e},n)=>{const r=fn(e.id);return t?u.jsxs(Y,{gap:2,children:[u.jsx(Gm,{id:r,...e}),u.jsx(ee,{tag:"label",textColor:"neutral800",htmlFor:r,children:t})]}):u.jsx(Gm,{ref:n,...e})});w.forwardRef((t,e)=>{const{id:n}=Yx();return u.jsx(vB,{position:"start",children:u.jsx(cs,{"aria-labelledby":`${n}-title`,...t,ref:e})})});C.styled(re)`
|
|
870
|
+
word-break: break-all;
|
|
871
|
+
`;C.styled(Y)`
|
|
872
|
+
border-bottom: 1px solid ${({theme:t})=>t.colors.neutral150};
|
|
873
|
+
`;const $B=t=>{const{id:e}=Yx();return u.jsx(ee,{variant:"pi",id:`${e}-title`,textColor:"neutral800",fontWeight:"bold",tag:"div",...t})},xt={DOWN:"ArrowDown",UP:"ArrowUp",RIGHT:"ArrowRight",LEFT:"ArrowLeft",ESCAPE:"Escape",ENTER:"Enter",END:"End",HOME:"Home",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown"},SB=C.styled(re)`
|
|
874
|
+
grid-template-columns: auto 1fr auto;
|
|
875
|
+
grid-template-areas: 'startAction slides endAction';
|
|
876
|
+
`,kB=C.styled(Y)`
|
|
877
|
+
grid-area: slides;
|
|
878
|
+
`,Ym=C.styled(re)`
|
|
879
|
+
grid-area: ${({$area:t})=>t};
|
|
880
|
+
|
|
881
|
+
&:focus svg path,
|
|
882
|
+
&:hover svg path {
|
|
883
|
+
fill: ${({theme:t})=>t.colors.neutral900};
|
|
884
|
+
}
|
|
885
|
+
`,AB=w.forwardRef(({actions:t,children:e,label:n,nextLabel:r,onNext:i,onPrevious:o,previousLabel:s,secondaryLabel:a,selectedSlide:l,...c},d)=>{const h=w.useRef(null),f=w.useRef(null),m=w.Children.map(e,(b,v)=>w.cloneElement(b,{selected:v===l})),g=b=>{switch(b.key){case xt.RIGHT:{b.preventDefault(),f?.current&&f.current.focus(),i&&i();break}case xt.LEFT:{b.preventDefault(),h?.current&&h.current.focus(),o&&o();break}}};return u.jsx(re,{ref:d,...c,onKeyDown:g,children:u.jsxs(re,{padding:2,borderColor:"neutral200",hasRadius:!0,background:"neutral100",children:[u.jsxs(SB,{tag:"section","aria-roledescription":"carousel","aria-label":n,display:"grid",position:"relative",children:[m&&m.length>1&&u.jsxs(u.Fragment,{children:[u.jsx(Ym,{tag:"button",onClick:o,$area:"startAction",ref:h,type:"button",children:u.jsx(Yi,{label:s,children:u.jsx(n2,{width:"1.6rem",height:"1.6rem",fill:"neutral600"})})}),u.jsx(Ym,{tag:"button",onClick:i,$area:"endAction",ref:f,type:"button",children:u.jsx(Yi,{label:r,children:u.jsx(Gh,{width:"1.6rem",height:"1.6rem",fill:"neutral600"})})})]}),u.jsx(kB,{"aria-live":"polite",paddingLeft:2,paddingRight:2,width:"100%",overflow:"hidden",children:m}),t]}),a&&u.jsx(re,{paddingTop:2,paddingLeft:4,paddingRight:4,children:u.jsx(qf,{label:a,children:u.jsx(Y,{justifyContent:"center",children:u.jsx(ee,{variant:"pi",textColor:"neutral600",ellipsis:!0,children:a})})})})]})})}),RB={accordions:{S:"4.8rem",M:"8.8rem"},button:{S:"3.2rem",M:"3.6rem",L:"4rem"}},TB={sizes:RB,zIndices:{navigation:100,overlay:300,modal:310,dialog:320,popover:500,notification:700,tooltip:1e3},spaces:["0px","4px","8px","12px","16px","20px","24px","32px","40px","48px","56px","64px"],borderRadius:"4px",breakpoints:{initial:"@media(min-width: 0px)",small:"@media(min-width: 520px)",medium:"@media(min-width: 768px)",large:"@media(min-width: 1080px)"},fontSizes:["1.1rem","1.2rem","1.4rem","1.6rem","1.8rem","3.2rem"],lineHeights:[1.14,1.22,1.25,1.33,1.43,1.45,1.5],fontWeights:{regular:400,semiBold:500,bold:600},transitions:DN,motion:{easings:Hu,timings:Pu}},MB={color:{alternative100:"#f6ecfc",alternative200:"#e0c1f4",alternative500:"#ac73e6",alternative600:"#9736e8",alternative700:"#8312d1",buttonNeutral0:"#ffffff",buttonPrimary500:"#7b79ff",buttonPrimary600:"#4945ff",danger100:"#fcecea",danger200:"#f5c0b8",danger500:"#ee5e52",danger600:"#d02b20",danger700:"#b72b1a",neutral0:"#ffffff",neutral100:"#f6f6f9",neutral1000:"#181826",neutral150:"#eaeaef",neutral200:"#dcdce4",neutral300:"#c0c0cf",neutral400:"#a5a5ba",neutral500:"#8e8ea9",neutral600:"#666687",neutral700:"#4a4a6a",neutral800:"#32324d",neutral900:"#212134",primary100:"#f0f0ff",primary200:"#d9d8ff",primary500:"#7b79ff",primary600:"#4945ff",primary700:"#271fe0",secondary100:"#eaf5ff",secondary200:"#b8e1ff",secondary500:"#66b7f1",secondary600:"#0c75af",secondary700:"#006096",success100:"#eafbe7",success200:"#c6f0c2",success500:"#5cb176",success600:"#328048",success700:"#2f6846",warning100:"#fdf4dc",warning200:"#fae7b9",warning500:"#f29d41",warning600:"#d9822f",warning700:"#be5d01"}},EB={shadow:{filterShadow:"0px 1px 4px rgba(33, 33, 52, 0.1)",focus:"inset 2px 0px 0px rgb(39, 31, 224), inset 0px 2px 0px rgb(39, 31, 224), inset -2px 0px 0px rgb(39, 31, 224), inset 0px -2px 0px rgb(39, 31, 224)",focusShadow:"0px 0px 6px rgba(76, 191, 255, 0.75)",popupShadow:"0px 2px 15px rgba(33, 33, 52, 0.1)",tableShadow:"0px 1px 4px rgba(33, 33, 52, 0.1)"}},IB={colors:MB.color,shadows:EB.shadow,...TB},Er=(t="&")=>({theme:e,$hasError:n=!1})=>C.css`
|
|
886
|
+
outline: none;
|
|
887
|
+
box-shadow: none;
|
|
888
|
+
transition-property: border-color, box-shadow, fill;
|
|
889
|
+
transition-duration: 0.2s;
|
|
890
|
+
|
|
891
|
+
${t}:focus-within {
|
|
892
|
+
border: 1px solid ${n?e.colors.danger600:e.colors.primary600};
|
|
893
|
+
box-shadow: ${n?e.colors.danger600:e.colors.primary600} 0px 0px 0px 2px;
|
|
894
|
+
}
|
|
895
|
+
`,[jB,Bt]=Rs("Field",{}),Jr=w.forwardRef(({children:t,name:e,error:n=!1,hint:r,id:i,required:o=!1,...s},a)=>{const l=fn(i),[c,d]=w.useState();return u.jsx(jB,{name:e,id:l,error:n,hint:r,required:o,labelNode:c,setLabelNode:d,children:u.jsx(Y,{direction:"column",alignItems:"stretch",gap:1,ref:a,...s,children:t})})}),Uf=w.forwardRef(({children:t,action:e,...n},r)=>{const{id:i,required:o,setLabelNode:s}=Bt("Label"),a=Nt(r,s);return t?u.jsxs(DB,{ref:a,variant:"pi",textColor:"neutral800",fontWeight:"bold",...n,id:`${i}-label`,htmlFor:i,tag:"label",ellipsis:!0,children:[t,o&&u.jsx(ee,{"aria-hidden":!0,lineHeight:"1em",textColor:"danger600",children:"*"}),e&&u.jsx(OB,{marginLeft:1,children:e})]}):null}),DB=C.styled(ee)`
|
|
896
|
+
display: flex;
|
|
897
|
+
`,OB=C.styled(Y)`
|
|
898
|
+
line-height: 0;
|
|
899
|
+
color: ${({theme:t})=>t.colors.neutral500};
|
|
900
|
+
`,mc=w.forwardRef(({endAction:t,startAction:e,disabled:n=!1,onChange:r,hasError:i,required:o,className:s,size:a="M",...l},c)=>{const{id:d,error:h,hint:f,name:m,required:g}=Bt("Input");let b;h?b=`${d}-error`:f&&(b=`${d}-hint`);const v=!!h,x=w.useRef(null),y=w.useRef(null),$=Nt(y,c),k=S=>{!n&&r&&r(S)};return w.useLayoutEffect(()=>{if(x.current&&y.current){const S=x.current.offsetWidth,R=y.current;if(R){const A=S+8+16;R.style.paddingRight=`${A}px`}}},[t]),u.jsxs(BB,{gap:2,justifyContent:"space-between",$hasError:v||i,$disabled:n,$size:a,$hasLeftAction:!!e,$hasRightAction:!!t,className:s,children:[e,u.jsx(LB,{id:d,name:m,ref:$,$size:a,"aria-describedby":b,"aria-invalid":v||i,"aria-disabled":n,disabled:n,"data-disabled":n?"":void 0,onChange:k,"aria-required":g||o,$hasLeftAction:!!e,$hasRightAction:!!t,...l}),t&&u.jsx(NB,{ref:x,children:t})]})}),LB=C.styled.input`
|
|
901
|
+
border: none;
|
|
902
|
+
border-radius: ${({theme:t})=>t.borderRadius};
|
|
903
|
+
cursor: ${t=>t["aria-disabled"]?"not-allowed":void 0};
|
|
904
|
+
|
|
905
|
+
color: ${({theme:t})=>t.colors.neutral800};
|
|
906
|
+
font-weight: 400;
|
|
907
|
+
font-size: ${t=>t.theme.fontSizes[2]};
|
|
908
|
+
line-height: 2.2rem;
|
|
909
|
+
display: block;
|
|
910
|
+
width: 100%;
|
|
911
|
+
background: inherit;
|
|
912
|
+
|
|
913
|
+
::placeholder {
|
|
914
|
+
color: ${({theme:t})=>t.colors.neutral500};
|
|
915
|
+
opacity: 1;
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
&[aria-disabled='true'] {
|
|
919
|
+
color: inherit;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
//focus managed by InputWrapper
|
|
923
|
+
&:focus {
|
|
924
|
+
outline: none;
|
|
925
|
+
box-shadow: none;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
${t=>{switch(t.$size){case"S":return C.css`
|
|
929
|
+
padding-inline-start: ${t.$hasLeftAction?0:t.theme.spaces[4]};
|
|
930
|
+
padding-inline-end: ${t.$hasRightAction?0:t.theme.spaces[4]};
|
|
931
|
+
padding-block: ${t.theme.spaces[1]};
|
|
932
|
+
`;default:return C.css`
|
|
933
|
+
padding-inline-start: ${t.$hasLeftAction?0:t.theme.spaces[4]};
|
|
934
|
+
padding-inline-end: ${t.$hasRightAction?0:t.theme.spaces[4]};
|
|
935
|
+
padding-block: ${t.theme.spaces[2]};
|
|
936
|
+
`}}}
|
|
937
|
+
`,NB=C.styled(Y)`
|
|
938
|
+
position: absolute;
|
|
939
|
+
right: ${({theme:t})=>t.spaces[4]};
|
|
940
|
+
top: 50%;
|
|
941
|
+
transform: translateY(-50%);
|
|
942
|
+
`,BB=C.styled(Y)`
|
|
943
|
+
border: 1px solid ${({theme:t,$hasError:e})=>e?t.colors.danger600:t.colors.neutral200};
|
|
944
|
+
border-radius: ${({theme:t})=>t.borderRadius};
|
|
945
|
+
background: ${({theme:t})=>t.colors.neutral0};
|
|
946
|
+
padding-inline-start: ${({$hasLeftAction:t,theme:e})=>t?e.spaces[4]:0};
|
|
947
|
+
position: relative;
|
|
948
|
+
|
|
949
|
+
${Er()}
|
|
950
|
+
${({theme:t,$disabled:e})=>e?C.css`
|
|
951
|
+
color: ${t.colors.neutral600};
|
|
952
|
+
background: ${t.colors.neutral150};
|
|
953
|
+
`:void 0};
|
|
954
|
+
`,Xx=()=>{const{id:t,hint:e,error:n}=Bt("Hint");return!e||n?null:u.jsx(ee,{variant:"pi",tag:"p",id:`${t}-hint`,textColor:"neutral600",children:e})},Qx=()=>{const{id:t,error:e}=Bt("Error");return!e||typeof e!="string"?null:u.jsx(ee,{variant:"pi",tag:"p",id:`${t}-error`,textColor:"danger600","data-strapi-field-error":!0,children:e})},FB=w.forwardRef(({label:t,children:e,...n},r)=>u.jsx(VB,{justifyContent:"unset",background:"transparent",borderStyle:"none",...n,type:"button",tag:"button",ref:r,children:u.jsx(Yi,{label:t,children:e})})),VB=C.styled(Y)`
|
|
955
|
+
font-size: 1.6rem;
|
|
956
|
+
padding: 0;
|
|
957
|
+
`,_B=Object.freeze(Object.defineProperty({__proto__:null,Action:FB,Error:Qx,Hint:Xx,Input:mc,Label:Uf,Root:Jr,useField:Bt},Symbol.toStringTag,{value:"Module"}));w.forwardRef(({actions:t,children:e,error:n,hint:r,label:i,labelAction:o,nextLabel:s,onNext:a,onPrevious:l,previousLabel:c,required:d,secondaryLabel:h,selectedSlide:f,id:m,...g},b)=>{const v=fn(m);return u.jsx(Jr,{hint:r,error:n,id:v,required:d,children:u.jsxs(Y,{direction:"column",alignItems:"stretch",gap:1,children:[i&&u.jsx(Uf,{action:o,children:i}),u.jsx(AB,{ref:b,actions:t,label:i,nextLabel:s,onNext:a,onPrevious:l,previousLabel:c,secondaryLabel:h,selectedSlide:f,id:v,...g,children:e}),u.jsx(Xx,{}),u.jsx(Qx,{})]})})});C.styled(re)`
|
|
958
|
+
${Rx}
|
|
959
|
+
`;const pc=w.forwardRef(({children:t,viewportRef:e,...n},r)=>u.jsxs(zB,{ref:r,...n,children:[u.jsx(HB,{ref:e,children:t}),u.jsx(Xm,{orientation:"vertical",children:u.jsx(Qm,{})}),u.jsx(Xm,{orientation:"horizontal",children:u.jsx(Qm,{})})]})),zB=C.styled(iA)`
|
|
960
|
+
width: 100%;
|
|
961
|
+
height: 100%;
|
|
962
|
+
overflow: hidden;
|
|
963
|
+
display: flex;
|
|
964
|
+
`,HB=C.styled(oA)`
|
|
965
|
+
min-width: 100%;
|
|
966
|
+
`,Xm=C.styled(sA)`
|
|
967
|
+
display: flex;
|
|
968
|
+
/* ensures no selection */
|
|
969
|
+
user-select: none;
|
|
970
|
+
/* disable browser handling of all panning and zooming gestures on touch devices */
|
|
971
|
+
touch-action: none;
|
|
972
|
+
|
|
973
|
+
&[data-orientation='vertical'] {
|
|
974
|
+
width: 0.4rem;
|
|
975
|
+
margin: 0.4rem;
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
&[data-orientation='horizontal'] {
|
|
979
|
+
flex-direction: column;
|
|
980
|
+
height: 0.4rem;
|
|
981
|
+
margin: 0.4rem;
|
|
982
|
+
}
|
|
983
|
+
`,Qm=C.styled(aA)`
|
|
984
|
+
position: relative;
|
|
985
|
+
flex: 1;
|
|
986
|
+
background-color: ${t=>t.theme.colors.neutral150};
|
|
987
|
+
border-radius: 0.4rem;
|
|
988
|
+
|
|
989
|
+
/* increase target size for touch devices https://www.w3.org/WAI/WCAG21/Understanding/target-size.html */
|
|
990
|
+
&::before {
|
|
991
|
+
content: '';
|
|
992
|
+
position: absolute;
|
|
993
|
+
top: 50%;
|
|
994
|
+
left: 50%;
|
|
995
|
+
transform: translate(-50%, -50%);
|
|
996
|
+
width: 100%;
|
|
997
|
+
height: 100%;
|
|
998
|
+
min-width: 44px;
|
|
999
|
+
min-height: 44px;
|
|
1000
|
+
}
|
|
1001
|
+
`,PB="data:image/svg+xml,%3csvg%20width='63'%20height='63'%20viewBox='0%200%2063%2063'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42.5563%2011.9816C39.484%2010.3071%2035.8575%209.29097%2032.3354%209.13521C28.6443%208.92888%2024.8295%209.72318%2021.3336%2011.4129C20.9123%2011.5901%2020.5376%2011.8101%2020.1722%2012.0249L20.0108%2012.1179C19.8774%2012.1951%2019.7441%2012.2724%2019.608%2012.3536C19.3253%2012.5146%2019.0492%2012.6744%2018.7544%2012.8792C18.5463%2013.0329%2018.3395%2013.1759%2018.1301%2013.323C17.5658%2013.7208%2016.9868%2014.1317%2016.4983%2014.5979C14.8476%2015.9524%2013.5571%2017.6075%2012.6071%2018.9214C10.4365%2022.1566%209.08622%2025.9567%208.80702%2029.6143L8.7764%2030.1588C8.73328%2030.9196%208.68476%2031.7057%208.75353%2032.4555C8.76648%2032.6084%208.7661%2032.7638%208.77506%2032.914C8.78895%2033.229%208.80152%2033.5373%208.846%2033.8672L9.07396%2035.4221C9.09756%2035.5764%209.1198%2035.7413%209.1633%2035.9263L9.65919%2037.9272L10.138%2039.2823C10.2729%2039.6673%2010.4158%2040.0751%2010.6%2040.43C12.0292%2043.637%2014.1425%2046.4578%2016.7063%2048.585C19.0508%2050.5296%2021.824%2052.0023%2024.7491%2052.8452L26.2371%2053.2376C26.3781%2053.2693%2026.4926%2053.2889%2026.6031%2053.3058L26.7775%2053.3311C27.0052%2053.3636%2027.2195%2053.3986%2027.4445%2053.435C27.8598%2053.5076%2028.2672%2053.5748%2028.7079%2053.6183L30.5641%2053.7229C30.9516%2053.7249%2031.3352%2053.7068%2031.7081%2053.6874C31.9039%2053.681%2032.0984%2053.6681%2032.3288%2053.662C34.5253%2053.4772%2036.5106%2053.0634%2038.0516%2052.4652C38.1769%2052.4171%2038.3008%2052.3796%2038.4234%2052.3355C38.6727%2052.2499%2038.9259%2052.167%2039.1432%2052.0599L40.8591%2051.2626L42.5702%2050.266C42.9009%2050.0682%2043.0205%2049.6414%2042.8282%2049.2984C42.632%2048.9526%2042.2034%2048.8308%2041.8634%2049.0166L40.1792%2049.9218L38.4995%2050.6224C38.3169%2050.6953%2038.121%2050.7534%2037.9224%2050.8155C37.7838%2050.8489%2037.6518%2050.8983%2037.5012%2050.9408C36.0711%2051.435%2034.2445%2051.7425%2032.244%2051.8346C32.0442%2051.8383%2031.8471%2051.8379%2031.654%2051.8403C31.3051%2051.8414%2030.9602%2051.8451%2030.6392%2051.8305L28.9177%2051.6725C28.5476%2051.619%2028.1695%2051.5427%2027.7848%2051.4678C27.5639%2051.4167%2027.3376%2051.3737%2027.1299%2051.3374L26.9529%2051.2987C26.8704%2051.2834%2026.7772%2051.2667%2026.7333%2051.2543L25.3466%2050.8322C22.7651%2049.9789%2020.33%2048.5729%2018.2942%2046.7557C16.1056%2044.7951%2014.3339%2042.2335%2013.1742%2039.3582C12.0276%2036.6013%2011.5988%2033.2792%2011.9716%2030.0076C12.3145%2027.0213%2013.3948%2024.1635%2015.1858%2021.5083C15.3034%2021.3339%2015.421%2021.1596%2015.5212%2021.0196C16.4309%2019.8688%2017.5408%2018.5589%2018.9483%2017.496C19.3367%2017.1525%2019.7862%2016.856%2020.2611%2016.5478C20.4878%2016.4009%2020.7079%2016.2553%2020.8907%2016.1306C21.0974%2016.0048%2021.3188%2015.8831%2021.5348%2015.7694C21.6761%2015.6975%2021.8162%2015.619%2021.9388%2015.5576L22.1002%2015.4646C22.4002%2015.3037%2022.6749%2015.1546%2022.9908%2015.039L24.1186%2014.5715C24.3399%2014.4844%2024.5718%2014.4159%2024.7997%2014.3447C24.953%2014.2982%2025.0982%2014.2635%2025.2635%2014.2078C25.786%2014.0182%2026.3283%2013.9112%2026.9105%2013.7965C27.117%2013.7571%2027.3302%2013.7163%2027.5608%2013.6585C27.7553%2013.611%2027.9737%2013.5969%2028.2082%2013.5762C28.364%2013.5603%2028.5172%2013.5483%2028.6318%2013.5333C28.7876%2013.5173%2028.9342%2013.5066%2029.0927%2013.4867C29.3285%2013.4555%2029.5456%2013.4347%2029.7494%2013.4337C30.0237%2013.44%2030.2994%2013.4357%2030.5777%2013.4274C31.0811%2013.421%2031.5579%2013.4197%2032.0318%2013.4914C34.9664%2013.7352%2037.7144%2014.6085%2040.2052%2016.0868C42.3489%2017.3655%2044.2716%2019.1525%2045.7607%2021.264C47.0255%2023.0628%2047.9756%2025.0528%2048.4928%2027.0393C48.572%2027.3176%2048.6299%2027.5931%2048.6839%2027.8659C48.7154%2028.0428%2048.7563%2028.2145%2048.7892%2028.3636C48.8037%2028.4541%2048.8208%2028.5406%2048.8445%2028.6258C48.8749%2028.7443%2048.8986%2028.864%2048.9116%2028.9651L48.9793%2029.6047C48.9922%2029.7748%2049.0132%2029.9331%2049.0301%2030.0887C49.0668%2030.3268%2049.0889%2030.5608%2049.0964%2030.7561L49.1083%2031.9001C49.1312%2032.3307%2049.089%2032.7116%2049.0522%2033.0673C49.0384%2033.2598%2049.0126%2033.4443%2049.0123%2033.5824C48.9961%2033.6926%2048.9918%2033.7935%2048.9836%2033.8917C48.9753%2034.0072%2048.9724%2034.1148%2048.9414%2034.2554L48.5449%2036.3059C48.3134%2037.8623%2049.3793%2039.3365%2050.9488%2039.5822C52.0417%2039.7601%2053.1536%2039.2819%2053.7711%2038.3664C54.0063%2038.0176%2054.1604%2037.6257%2054.2227%2037.2064L54.5217%2035.2574C54.5514%2035.0756%2054.572%2034.83%2054.5846%2034.5791L54.6028%2034.2338C54.6098%2034.0598%2054.6223%2033.8779%2054.6347%2033.6788C54.6734%2033.1052%2054.7163%2032.4479%2054.6619%2031.8058L54.5867%2030.4289C54.5622%2030.0952%2054.5097%2029.76%2054.4559%2029.4181C54.431%2029.2572%2054.4048%2029.0896%2054.3826%2028.9074L54.2687%2028.104C54.2332%2027.9244%2054.1804%2027.7273%2054.1329%2027.5396L54.0643%2027.2454C54.0195%2027.071%2053.9773%2026.8927%2053.9338%2026.7076C53.8455%2026.3309%2053.7479%2025.9422%2053.613%2025.5571C52.84%2023.0292%2051.5383%2020.5194%2049.8338%2018.2799C47.8544%2015.682%2045.3333%2013.5087%2042.5563%2011.9816Z'%20fill='%234945FF'/%3e%3c/svg%3e",yl=w.forwardRef(({children:t,small:e=!1,...n},r)=>u.jsxs("div",{role:"alert","aria-live":"assertive",ref:r,...n,children:[u.jsx(Mr,{children:t}),u.jsx(qB,{src:PB,"aria-hidden":!0,$small:e})]})),WB=C.keyframes`
|
|
1002
|
+
from {
|
|
1003
|
+
transform: rotate(0deg);
|
|
1004
|
+
}
|
|
1005
|
+
to {
|
|
1006
|
+
transform: rotate(359deg);
|
|
1007
|
+
}
|
|
1008
|
+
`,qB=C.styled.img`
|
|
1009
|
+
animation: ${WB} 1s infinite linear;
|
|
1010
|
+
will-change: transform;
|
|
1011
|
+
${({$small:t,theme:e})=>t&&`width: ${e.spaces[6]}; height: ${e.spaces[6]};`}
|
|
1012
|
+
`,Zx=w.forwardRef(({allowCustomValue:t,autocomplete:e,children:n,className:r,clearLabel:i="Clear",creatable:o=!1,creatableStartIcon:s,createMessage:a=we=>`Create "${we}"`,defaultFilterValue:l,defaultTextValue:c,defaultOpen:d=!1,open:h,onOpenChange:f,disabled:m=!1,hasError:g,id:b,filterValue:v,hasMoreItems:x=!1,isPrintableCharacter:y,loading:$=!1,loadingMessage:k="Loading content...",name:S,noOptionsMessage:R=()=>"No results found",onChange:A,onClear:I,onCreateOption:E,onFilterValueChange:j,onInputChange:O,onTextValueChange:D,onLoadMore:B,placeholder:V="Select or enter a value",required:q=!1,size:J="M",startIcon:W,textValue:K,value:F,...Q},pe)=>{const[we,ce]=An({prop:h,defaultProp:d,onChange:f}),[Ce,P]=An({prop:K,defaultProp:t&&!c?F:c,onChange:D}),[oe,_]=An({prop:v,defaultProp:l,onChange:j}),G=w.useRef(null),Z=w.useRef(null),ne=Nt(Z,pe),ae=w.useRef(null),be=vt=>{I&&!m&&(P(""),_(""),I(vt),Z.current.focus())},le=vt=>{ce(vt)},Le=vt=>{P(vt)},$e=vt=>{_(vt)},Be=vt=>{O&&O(vt)},se=vt=>{A&&A(vt)},Ee=vt=>{B&&x&&!$&&B(vt)},Ge=()=>{E&&Ce&&o!=="visible"?E(Ce):E&&o==="visible"&&(E(),ce(!1))},U=fn(),ve=`intersection-${Xi(U)}`;Ms(G,Ee,{selectorToWatch:`#${ve}`,skipWhen:!we});const{error:Ie,...Re}=Bt("Combobox"),fe=!!Ie||g,ke=Re.id??b,Ne=Re.name??S,bt=Re.required||q;let uo;return Ie?uo=`${ke}-error`:Re.hint&&(uo=`${ke}-hint`),u.jsxs(nn.Root,{autocomplete:e||(o===!0?"list":"both"),onOpenChange:le,open:we,onTextValueChange:Le,textValue:Ce,allowCustomValue:!!o||t,disabled:m,required:bt,value:F,onValueChange:se,filterValue:oe,onFilterValueChange:$e,isPrintableCharacter:y,visible:o==="visible",children:[u.jsxs(UB,{$hasError:fe,$size:J,className:r,children:[u.jsxs(Y,{flex:"1",tag:"span",gap:3,children:[W?u.jsx(Y,{flex:"0 0 1.6rem",tag:"span","aria-hidden":!0,children:W}):null,u.jsx(KB,{placeholder:V,id:ke,"aria-invalid":!!Ie,onChange:Be,ref:ne,name:Ne,"aria-describedby":uo,...Q})]}),u.jsxs(Y,{tag:"span",gap:3,children:[Ce&&I?u.jsx(At,{size:"XS",variant:"ghost",onClick:be,"aria-disabled":m,"aria-label":i,label:i,ref:ae,children:u.jsx(ri,{})}):null,u.jsx(GB,{children:u.jsx(br,{fill:"neutral500"})})]})]}),u.jsx(nn.Portal,{children:u.jsx(YB,{sideOffset:4,children:u.jsxs(nn.Viewport,{ref:G,children:[u.jsxs(QB,{children:[n,o!==!0&&!$?u.jsx(nn.NoValueFound,{asChild:!0,children:u.jsx(qu,{$hasHover:!1,children:u.jsx(ee,{children:R(Ce??"")})})}):null,$?u.jsx(Y,{justifyContent:"center",alignItems:"center",paddingTop:2,paddingBottom:2,children:u.jsx(yl,{small:!0,children:k})}):null,u.jsx(re,{id:ve,width:"100%",height:"1px"})]}),o?u.jsx(XB,{onPointerUp:Ge,onClick:Ge,asChild:!0,children:u.jsx(qu,{children:u.jsxs(Y,{gap:2,children:[s&&u.jsx(re,{tag:"span","aria-hidden":!0,display:"inline-flex",children:s}),u.jsx(ee,{children:a(Ce??"")})]})})}):null]})})})]})}),UB=C.styled(nn.Trigger)`
|
|
1013
|
+
position: relative;
|
|
1014
|
+
border: 1px solid ${({theme:t,$hasError:e})=>e?t.colors.danger600:t.colors.neutral200};
|
|
1015
|
+
border-radius: ${({theme:t})=>t.borderRadius};
|
|
1016
|
+
background: ${({theme:t})=>t.colors.neutral0};
|
|
1017
|
+
overflow: hidden;
|
|
1018
|
+
display: flex;
|
|
1019
|
+
align-items: center;
|
|
1020
|
+
justify-content: space-between;
|
|
1021
|
+
gap: ${({theme:t})=>t.spaces[4]};
|
|
1022
|
+
|
|
1023
|
+
${t=>{switch(t.$size){case"S":return C.css`
|
|
1024
|
+
padding-inline-start: ${({theme:e})=>e.spaces[4]};
|
|
1025
|
+
padding-inline-end: ${({theme:e})=>e.spaces[3]};
|
|
1026
|
+
padding-block: ${({theme:e})=>e.spaces[1]};
|
|
1027
|
+
`;default:return C.css`
|
|
1028
|
+
padding-inline-start: ${({theme:e})=>e.spaces[4]};
|
|
1029
|
+
padding-inline-end: ${({theme:e})=>e.spaces[3]};
|
|
1030
|
+
padding-block: ${({theme:e})=>e.spaces[2]};
|
|
1031
|
+
`}}}
|
|
1032
|
+
|
|
1033
|
+
&[data-disabled] {
|
|
1034
|
+
color: ${({theme:t})=>t.colors.neutral600};
|
|
1035
|
+
background: ${({theme:t})=>t.colors.neutral150};
|
|
1036
|
+
cursor: not-allowed;
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
/* Required to ensure the below inputFocusStyles are adhered too */
|
|
1040
|
+
&:focus-visible {
|
|
1041
|
+
outline: none;
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
${({theme:t,$hasError:e})=>Er()({theme:t,$hasError:e})};
|
|
1045
|
+
`,KB=C.styled(nn.TextInput)`
|
|
1046
|
+
width: 100%;
|
|
1047
|
+
font-size: 1.4rem;
|
|
1048
|
+
line-height: 2.2rem;
|
|
1049
|
+
color: ${({theme:t})=>t.colors.neutral800};
|
|
1050
|
+
padding: 0;
|
|
1051
|
+
border: none;
|
|
1052
|
+
background-color: transparent;
|
|
1053
|
+
|
|
1054
|
+
&:focus-visible {
|
|
1055
|
+
outline: none;
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
&[aria-disabled='true'] {
|
|
1059
|
+
cursor: inherit;
|
|
1060
|
+
}
|
|
1061
|
+
`,GB=C.styled(nn.Icon)`
|
|
1062
|
+
border: none;
|
|
1063
|
+
background: transparent;
|
|
1064
|
+
padding: 0;
|
|
1065
|
+
color: ${({theme:t})=>t.colors.neutral600};
|
|
1066
|
+
display: flex;
|
|
1067
|
+
|
|
1068
|
+
&[aria-disabled='true'] {
|
|
1069
|
+
cursor: inherit;
|
|
1070
|
+
}
|
|
1071
|
+
`,YB=C.styled(nn.Content)`
|
|
1072
|
+
background: ${({theme:t})=>t.colors.neutral0};
|
|
1073
|
+
box-shadow: ${({theme:t})=>t.shadows.filterShadow};
|
|
1074
|
+
border: 1px solid ${({theme:t})=>t.colors.neutral150};
|
|
1075
|
+
border-radius: ${({theme:t})=>t.borderRadius};
|
|
1076
|
+
width: var(--radix-combobox-trigger-width);
|
|
1077
|
+
/* This is from the design-system figma file. */
|
|
1078
|
+
max-height: 15rem;
|
|
1079
|
+
z-index: ${({theme:t})=>t.zIndices.popover};
|
|
1080
|
+
|
|
1081
|
+
&:focus-visible {
|
|
1082
|
+
outline: ${({theme:t})=>`2px solid ${t.colors.primary600}`};
|
|
1083
|
+
outline-offset: 2px;
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1087
|
+
animation-duration: ${t=>t.theme.motion.timings[200]};
|
|
1088
|
+
|
|
1089
|
+
/* The select can't animate out yet, watch https://github.com/radix-ui/primitives/issues/1893, or take a look and solve it yourself. */
|
|
1090
|
+
&[data-state='open'] {
|
|
1091
|
+
animation-timing-function: ${t=>t.theme.motion.easings.authenticMotion};
|
|
1092
|
+
|
|
1093
|
+
&[data-side='top'] {
|
|
1094
|
+
animation-name: ${Ze.slideUpIn};
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
&[data-side='bottom'] {
|
|
1098
|
+
animation-name: ${Ze.slideDownIn};
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
`,XB=C.styled(nn.CreateItem)`
|
|
1103
|
+
&& {
|
|
1104
|
+
border-top: 1px solid ${({theme:t})=>t.colors.neutral150};
|
|
1105
|
+
background: ${({theme:t})=>t.colors.neutral0};
|
|
1106
|
+
cursor: pointer;
|
|
1107
|
+
padding: ${({theme:t})=>t.spaces[1]};
|
|
1108
|
+
position: sticky;
|
|
1109
|
+
bottom: 0;
|
|
1110
|
+
left: 0;
|
|
1111
|
+
}
|
|
1112
|
+
&&:hover,
|
|
1113
|
+
&&[data-highlighted] {
|
|
1114
|
+
background-color: transparent;
|
|
1115
|
+
}
|
|
1116
|
+
&& > div {
|
|
1117
|
+
padding: ${({theme:t})=>t.spaces[2]} ${({theme:t})=>t.spaces[4]};
|
|
1118
|
+
}
|
|
1119
|
+
&& > div:hover,
|
|
1120
|
+
&&[data-highlighted] > div {
|
|
1121
|
+
background-color: ${({theme:t})=>t.colors.primary100};
|
|
1122
|
+
}
|
|
1123
|
+
`,QB=C.styled(pc)`
|
|
1124
|
+
padding: ${({theme:t})=>t.spaces[1]};
|
|
1125
|
+
`,Jx=w.forwardRef(({children:t,value:e,disabled:n,textValue:r,...i},o)=>u.jsx(nn.ComboboxItem,{asChild:!0,value:e,disabled:n,textValue:r,children:u.jsx(qu,{ref:o,...i,children:u.jsx(nn.ItemText,{asChild:!0,children:u.jsx(ee,{children:t})})})})),qu=C.styled.div`
|
|
1126
|
+
width: 100%;
|
|
1127
|
+
border: none;
|
|
1128
|
+
text-align: left;
|
|
1129
|
+
outline-offset: -3px;
|
|
1130
|
+
padding: ${({theme:t})=>t.spaces[2]} ${({theme:t})=>t.spaces[4]};
|
|
1131
|
+
background-color: ${({theme:t})=>t.colors.neutral0};
|
|
1132
|
+
border-radius: ${({theme:t})=>t.borderRadius};
|
|
1133
|
+
user-select: none;
|
|
1134
|
+
|
|
1135
|
+
&[data-state='checked'] {
|
|
1136
|
+
background-color: ${({theme:t})=>t.colors.primary100};
|
|
1137
|
+
color: ${({theme:t})=>t.colors.primary600};
|
|
1138
|
+
font-weight: bold;
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
&:hover,
|
|
1142
|
+
&[data-highlighted] {
|
|
1143
|
+
outline: none;
|
|
1144
|
+
background-color: ${({theme:t,$hasHover:e=!0})=>e?t.colors.primary100:t.colors.neutral0};
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
&[data-highlighted] {
|
|
1148
|
+
color: ${({theme:t})=>t.colors.primary600};
|
|
1149
|
+
font-weight: bold;
|
|
1150
|
+
}
|
|
1151
|
+
`,ZB=HA,JB=w.forwardRef((t,e)=>u.jsx(PA,{...t,asChild:!0,ref:e})),eF=w.forwardRef((t,e)=>u.jsxs(WA,{children:[u.jsx(tF,{}),u.jsx(nF,{ref:e,...t})]})),tF=C.styled(qA)`
|
|
1152
|
+
background-color: ${t=>t.theme.colors.neutral800};
|
|
1153
|
+
position: fixed;
|
|
1154
|
+
inset: 0;
|
|
1155
|
+
z-index: ${t=>t.theme.zIndices.overlay};
|
|
1156
|
+
opacity: 0.2;
|
|
1157
|
+
|
|
1158
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1159
|
+
animation: ${Ze.overlayFadeIn} ${t=>t.theme.motion.timings[200]}
|
|
1160
|
+
${t=>t.theme.motion.easings.authenticMotion};
|
|
1161
|
+
}
|
|
1162
|
+
`,nF=C.styled(UA)`
|
|
1163
|
+
max-width: 42rem;
|
|
1164
|
+
height: min-content;
|
|
1165
|
+
width: 100%;
|
|
1166
|
+
overflow: hidden;
|
|
1167
|
+
margin: 0 auto;
|
|
1168
|
+
display: flex;
|
|
1169
|
+
flex-direction: column;
|
|
1170
|
+
|
|
1171
|
+
position: fixed;
|
|
1172
|
+
top: 50%;
|
|
1173
|
+
left: 50%;
|
|
1174
|
+
transform: translate(-50%, -50%);
|
|
1175
|
+
|
|
1176
|
+
border-radius: ${t=>t.theme.borderRadius};
|
|
1177
|
+
background-color: ${t=>t.theme.colors.neutral0};
|
|
1178
|
+
box-shadow: ${t=>t.theme.shadows.popupShadow};
|
|
1179
|
+
z-index: ${t=>t.theme.zIndices.modal};
|
|
1180
|
+
|
|
1181
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1182
|
+
&[data-state='open'] {
|
|
1183
|
+
animation-duration: ${t=>t.theme.motion.timings[200]};
|
|
1184
|
+
animation-timing-function: ${t=>t.theme.motion.easings.authenticMotion};
|
|
1185
|
+
animation-name: ${Ze.modalPopIn};
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
&[data-state='closed'] {
|
|
1189
|
+
animation-duration: ${t=>t.theme.motion.timings[120]};
|
|
1190
|
+
animation-timing-function: ${t=>t.theme.motion.easings.easeOutQuad};
|
|
1191
|
+
animation-name: ${Ze.modalPopOut};
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
`,rF=w.forwardRef(({children:t,...e},n)=>u.jsx(YA,{asChild:!0,children:u.jsx(iF,{tag:"h2",variant:"beta",ref:n,padding:6,fontWeight:"bold",...e,children:t})})),iF=C.styled(ee)`
|
|
1195
|
+
display: flex;
|
|
1196
|
+
justify-content: center;
|
|
1197
|
+
border-bottom: solid 1px ${t=>t.theme.colors.neutral150};
|
|
1198
|
+
`,oF=w.forwardRef(({children:t,icon:e,...n},r)=>u.jsx(Y,{ref:r,gap:2,direction:"column",paddingTop:8,paddingBottom:8,paddingLeft:6,paddingRight:6,...n,children:typeof t=="string"?u.jsxs(u.Fragment,{children:[e?w.cloneElement(e,{width:24,height:24}):null,u.jsx(ew,{children:t})]}):t})),ew=w.forwardRef((t,e)=>u.jsx(XA,{asChild:!0,children:u.jsx(ee,{ref:e,variant:"omega",...t,tag:"p"})})),sF=w.forwardRef((t,e)=>u.jsx(aF,{ref:e,gap:2,padding:4,justifyContent:"space-between",...t,tag:"footer"})),aF=C.styled(Y)`
|
|
1199
|
+
border-top: solid 1px ${t=>t.theme.colors.neutral150};
|
|
1200
|
+
flex: 1;
|
|
1201
|
+
`,lF=w.forwardRef((t,e)=>u.jsx(GA,{...t,asChild:!0,ref:e})),cF=w.forwardRef((t,e)=>u.jsx(KA,{...t,asChild:!0,ref:e})),wo=Object.freeze(Object.defineProperty({__proto__:null,Action:cF,Body:oF,Cancel:lF,Content:eF,Description:ew,Footer:sF,Header:rF,Root:ZB,Trigger:JB},Symbol.toStringTag,{value:"Module"}));function Kn(t,e){const n=w.useRef(null);return e&&n.current&&dF(e,n.current)&&(e=n.current),n.current=e??null,w.useMemo(()=>new Cy(t,e),[t,e])}function dF(t,e){if(t===e)return!0;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const i of n)if(e[i]!==t[i])return!1;return!0}const ud={Log:"live-region-log",Status:"live-region-status",Alert:"live-region-alert"},uF=()=>u.jsxs(Mr,{children:[u.jsx("p",{role:"log","aria-live":"polite",id:ud.Log,"aria-relevant":"all"}),u.jsx("p",{role:"status","aria-live":"polite",id:ud.Status,"aria-relevant":"all"}),u.jsx("p",{role:"alert","aria-live":"assertive",id:ud.Alert,"aria-relevant":"all"})]}),hF=C.createGlobalStyle`
|
|
1202
|
+
${C.css`
|
|
1203
|
+
*,
|
|
1204
|
+
*::before,
|
|
1205
|
+
*::after {
|
|
1206
|
+
box-sizing: border-box;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
* {
|
|
1210
|
+
margin: 0;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
html {
|
|
1214
|
+
/* Sets 1rem === 10px */
|
|
1215
|
+
font-size: 62.5%;
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
body {
|
|
1219
|
+
height: 100%;
|
|
1220
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
|
|
1221
|
+
'Helvetica Neue', sans-serif;
|
|
1222
|
+
color: ${({theme:t})=>t.colors.neutral800};
|
|
1223
|
+
line-height: 1.5;
|
|
1224
|
+
-webkit-font-smoothing: antialiased;
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
img,
|
|
1228
|
+
picture,
|
|
1229
|
+
video,
|
|
1230
|
+
canvas {
|
|
1231
|
+
display: block;
|
|
1232
|
+
max-width: 100%;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
input,
|
|
1236
|
+
button,
|
|
1237
|
+
textarea,
|
|
1238
|
+
select {
|
|
1239
|
+
padding: 0;
|
|
1240
|
+
font: inherit;
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
button {
|
|
1244
|
+
border: unset;
|
|
1245
|
+
background: unset;
|
|
1246
|
+
padding: unset;
|
|
1247
|
+
margin: unset;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
p,
|
|
1251
|
+
h1,
|
|
1252
|
+
h2,
|
|
1253
|
+
h3,
|
|
1254
|
+
h4,
|
|
1255
|
+
h5,
|
|
1256
|
+
h6 {
|
|
1257
|
+
overflow-wrap: break-word;
|
|
1258
|
+
font: unset;
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
#root {
|
|
1262
|
+
isolation: isolate;
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
ol,
|
|
1266
|
+
ul {
|
|
1267
|
+
list-style: none;
|
|
1268
|
+
padding: unset;
|
|
1269
|
+
margin: unset;
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
table {
|
|
1273
|
+
border-collapse: collapse;
|
|
1274
|
+
border-spacing: 0;
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
*:focus-visible {
|
|
1278
|
+
outline: 2px solid ${({theme:t})=>t.colors.primary600};
|
|
1279
|
+
outline-offset: 2px;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
*:has(> :disabled:not(button)) {
|
|
1283
|
+
cursor: not-allowed !important;
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
[aria-disabled='true']:not(button) {
|
|
1287
|
+
cursor: not-allowed !important;
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
/* Focusing the button with a mouse, touch, or stylus will show a subtle drop shadow. */
|
|
1291
|
+
*:focus:not(:focus-visible) {
|
|
1292
|
+
outline: none;
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
.lock-body-scroll {
|
|
1296
|
+
height: 100vh;
|
|
1297
|
+
overflow-y: hidden;
|
|
1298
|
+
}
|
|
1299
|
+
`}
|
|
1300
|
+
`,Zm="en-EN",tw=()=>typeof navigator>"u"?Zm:navigator.language?navigator.language:Zm,[fF,gc]=Rs("StrapiDesignSystem",{locale:tw()}),nw=({children:t,locale:e=tw(),theme:n=IB,tooltipConfig:r})=>(Zr(()=>{const i=document.createElement("style");i.type="text/css",i.appendChild(document.createTextNode(`
|
|
1301
|
+
* {
|
|
1302
|
+
-webkit-transition: none !important;
|
|
1303
|
+
-moz-transition: none !important;
|
|
1304
|
+
-o-transition: none !important;
|
|
1305
|
+
-ms-transition: none !important;
|
|
1306
|
+
transition: none !important;
|
|
1307
|
+
animation: none !important;
|
|
1308
|
+
}
|
|
1309
|
+
`)),document.head.appendChild(i),window.getComputedStyle(i).opacity,document.head.removeChild(i)},[n]),u.jsx(fF,{locale:e,children:u.jsxs(C.ThemeProvider,{theme:n,children:[u.jsx(v6,{...r,children:t}),u.jsx(uF,{}),u.jsx(hF,{})]})})),mF=Vy,rw=w.forwardRef(({container:t=globalThis?.document?.body,...e},n)=>t?ds.createPortal(u.jsx(re,{ref:n,...e}),t):null);rw.displayName="Portal";const pF=w.forwardRef(({onClear:t,clearLabel:e="Clear",startIcon:n,disabled:r,hasError:i,children:o,id:s,size:a="M",withTags:l,...c},d)=>{const h=w.useRef(null),f=b=>{t&&!r&&(t(b),h.current.focus())},{labelNode:m}=Bt("SelectTrigger"),g=Nt(h,d);return u.jsx(dn.Trigger,{asChild:!0,children:u.jsxs(bF,{"aria-disabled":r,$hasError:i,ref:g,alignItems:"center",justifyContent:"space-between",position:"relative",overflow:"hidden",hasRadius:!0,background:r?"neutral150":"neutral0",gap:4,cursor:"default","aria-labelledby":m?`${s}-label`:void 0,$size:a,$withTags:l,...c,children:[u.jsxs(Y,{flex:"1",tag:"span",gap:3,children:[n&&u.jsx(Y,{tag:"span","aria-hidden":!0,children:n}),o]}),u.jsxs(Y,{tag:"span",gap:3,children:[t?u.jsx(gF,{tag:"button",hasRadius:!0,background:"transparent",role:"button",tabIndex:0,onClick:f,"aria-disabled":r,"aria-label":e,title:e,cursor:"pointer",children:u.jsx(ri,{})}):null,u.jsx(vF,{children:u.jsx(br,{})})]})]})})}),gF=C.styled(re)`
|
|
1310
|
+
border: none;
|
|
1311
|
+
display: flex;
|
|
1312
|
+
|
|
1313
|
+
svg {
|
|
1314
|
+
height: 1.1rem;
|
|
1315
|
+
width: 1.1rem;
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
svg path {
|
|
1319
|
+
fill: ${({theme:t})=>t.colors.neutral500};
|
|
1320
|
+
}
|
|
1321
|
+
`,bF=C.styled(Y)`
|
|
1322
|
+
border: 1px solid ${({theme:t,$hasError:e})=>e?t.colors.danger600:t.colors.neutral200};
|
|
1323
|
+
${t=>{switch(t.$size){case"S":return C.css`
|
|
1324
|
+
padding-block: ${t.theme.spaces[1]};
|
|
1325
|
+
padding-inline-start: ${t.$withTags?t.theme.spaces[1]:t.theme.spaces[4]};
|
|
1326
|
+
padding-inline-end: ${t.theme.spaces[3]};
|
|
1327
|
+
`;default:return C.css`
|
|
1328
|
+
padding-block: ${t.$withTags?"0.3rem":t.theme.spaces[2]};
|
|
1329
|
+
padding-inline-start: ${t.$withTags?t.theme.spaces[1]:t.theme.spaces[4]};
|
|
1330
|
+
padding-inline-end: ${t.theme.spaces[3]};
|
|
1331
|
+
`}}}
|
|
1332
|
+
cursor: pointer;
|
|
1333
|
+
|
|
1334
|
+
&[aria-disabled='true'] {
|
|
1335
|
+
color: ${t=>t.theme.colors.neutral500};
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
/* Required to ensure the below inputFocusStyles are adhered too */
|
|
1339
|
+
&:focus-visible {
|
|
1340
|
+
outline: none;
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
${({theme:t,$hasError:e})=>Er()({theme:t,$hasError:e})};
|
|
1344
|
+
`,vF=C.styled(dn.Icon)`
|
|
1345
|
+
display: flex;
|
|
1346
|
+
& > svg {
|
|
1347
|
+
fill: ${({theme:t})=>t.colors.neutral500};
|
|
1348
|
+
}
|
|
1349
|
+
`,xF=w.forwardRef(({children:t,placeholder:e,...n},r)=>u.jsx(wF,{ref:r,ellipsis:!0,...n,children:u.jsx(yF,{placeholder:e,children:t})})),wF=C.styled(ee)`
|
|
1350
|
+
flex: 1;
|
|
1351
|
+
font-size: 1.4rem;
|
|
1352
|
+
line-height: 2.2rem;
|
|
1353
|
+
`,yF=C.styled(dn.Value)`
|
|
1354
|
+
display: flex;
|
|
1355
|
+
gap: ${({theme:t})=>t.spaces[1]};
|
|
1356
|
+
flex-wrap: wrap;
|
|
1357
|
+
`,CF=w.forwardRef((t,e)=>u.jsx($F,{ref:e,...t,children:u.jsx(pc,{children:t.children})})),$F=C.styled(dn.Content)`
|
|
1358
|
+
background: ${({theme:t})=>t.colors.neutral0};
|
|
1359
|
+
box-shadow: ${({theme:t})=>t.shadows.filterShadow};
|
|
1360
|
+
border: 1px solid ${({theme:t})=>t.colors.neutral150};
|
|
1361
|
+
border-radius: ${({theme:t})=>t.borderRadius};
|
|
1362
|
+
min-width: var(--radix-select-trigger-width);
|
|
1363
|
+
max-height: 15.6rem;
|
|
1364
|
+
z-index: ${({theme:t})=>t.zIndices.popover};
|
|
1365
|
+
|
|
1366
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1367
|
+
animation-duration: ${t=>t.theme.motion.timings[200]};
|
|
1368
|
+
|
|
1369
|
+
/* The select can't animate out yet, watch https://github.com/radix-ui/primitives/issues/1893, or take a look and solve it yourself. */
|
|
1370
|
+
&[data-state='open'] {
|
|
1371
|
+
animation-timing-function: ${t=>t.theme.motion.easings.authenticMotion};
|
|
1372
|
+
|
|
1373
|
+
&[data-side='top'] {
|
|
1374
|
+
animation-name: ${Ze.slideUpIn};
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
&[data-side='bottom'] {
|
|
1378
|
+
animation-name: ${Ze.slideDownIn};
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
`,SF=C.styled(dn.Viewport)`
|
|
1383
|
+
padding: ${({theme:t})=>t.spaces[1]};
|
|
1384
|
+
`,kF=w.forwardRef((t,e)=>u.jsx(RF,{ref:e,...t})),AF=C.css`
|
|
1385
|
+
width: 100%;
|
|
1386
|
+
border: none;
|
|
1387
|
+
text-align: left;
|
|
1388
|
+
outline-offset: -3px;
|
|
1389
|
+
border-radius: ${t=>t.theme.borderRadius};
|
|
1390
|
+
padding: ${t=>`${t.theme.spaces[2]} ${t.theme.spaces[4]}`};
|
|
1391
|
+
padding-left: ${({theme:t})=>t.spaces[4]};
|
|
1392
|
+
background-color: ${({theme:t})=>t.colors.neutral0};
|
|
1393
|
+
display: flex;
|
|
1394
|
+
align-items: center;
|
|
1395
|
+
gap: ${({theme:t})=>t.spaces[2]};
|
|
1396
|
+
white-space: nowrap;
|
|
1397
|
+
user-select: none;
|
|
1398
|
+
color: ${({theme:t})=>t.colors.neutral800};
|
|
1399
|
+
|
|
1400
|
+
&:focus-visible {
|
|
1401
|
+
outline: none;
|
|
1402
|
+
background-color: ${({theme:t})=>t.colors.primary100};
|
|
1403
|
+
cursor: pointer;
|
|
1404
|
+
}
|
|
1405
|
+
`,RF=C.styled(dn.Item)`
|
|
1406
|
+
${AF}
|
|
1407
|
+
|
|
1408
|
+
&:hover {
|
|
1409
|
+
background-color: ${({theme:t})=>t.colors.primary100};
|
|
1410
|
+
cursor: pointer;
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
&[data-state='checked'] {
|
|
1414
|
+
font-weight: bold;
|
|
1415
|
+
color: ${({theme:t})=>t.colors.primary600};
|
|
1416
|
+
font-weight: bold;
|
|
1417
|
+
}
|
|
1418
|
+
`,iw=dn.Root,ow=pF,sw=xF,aw=dn.Portal,lw=CF,cw=SF,Kf=kF,dw=dn.ItemIndicator,uw=dn.ItemText,TF=dn.Group,Jn=w.forwardRef(({children:t,clearLabel:e="Clear",customizeContent:n,disabled:r,hasError:i,id:o,name:s,onChange:a,onClear:l,onCloseAutoFocus:c,onReachEnd:d,placeholder:h,required:f,size:m,startIcon:g,value:b,...v},x)=>{const[y,$]=w.useState(),[k,S]=w.useState(!1),R=pe=>{S(pe)},A=pe=>{l&&l(pe),a||$("")},I=pe=>{a?a(typeof b=="number"?Number(pe):pe):$(pe)},E=w.useRef(null),j=fn(),O=`intersection-${Xi(j)}`;Ms(E,pe=>{d&&d(pe)},{selectorToWatch:`#${O}`,skipWhen:!k});const{error:B,required:V,...q}=Bt("SingleSelect"),J=!!B||i,W=q.id??o,K=q.name??s;let F;B?F=`${W}-error`:q.hint&&(F=`${W}-hint`);const Q=(typeof b<"u"&&b!==null?b.toString():y)??"";return u.jsxs(iw,{onOpenChange:R,disabled:r,required:V??f,onValueChange:I,value:Q,...v,children:[u.jsx(ow,{ref:x,id:W,name:K,startIcon:g,hasError:J,disabled:r,clearLabel:e,onClear:Q&&l?A:void 0,"aria-label":v["aria-label"],"aria-describedby":F??v["aria-describedby"],size:m,children:u.jsx(sw,{placeholder:h,textColor:Q?"neutral800":"neutral600",children:Q&&n?n(Q):void 0})}),u.jsx(aw,{children:u.jsx(lw,{position:"popper",sideOffset:4,onCloseAutoFocus:c,children:u.jsxs(cw,{ref:E,children:[t,u.jsx(re,{id:O,width:"100%",height:"1px"})]})})})]})}),er=w.forwardRef(({value:t,startIcon:e,children:n,...r},i)=>u.jsxs(Kf,{ref:i,value:t.toString(),...r,children:[e&&u.jsx(Y,{tag:"span","aria-hidden":!0,children:e}),u.jsx(ee,{lineHeight:"20px",width:"100%",children:u.jsx(uw,{children:n})})]})),MF=200,Jm=15,[EF,lo]=Rs("DatePicker"),IF=w.forwardRef(({calendarLabel:t,className:e,initialDate:n,locale:r,maxDate:i,minDate:o,monthSelectLabel:s="Month",onChange:a,value:l,yearSelectLabel:c="Year",hasError:d,id:h,name:f,disabled:m=!1,required:g=!1,onClear:b,clearLabel:v="Clear",size:x="M",...y},$)=>{const k=Li(),S=gc("DatePicker"),R=r??S.locale,A=Kn(R,{day:"2-digit",month:"2-digit",year:"numeric"}),[I,E]=w.useState(!1),[j,O]=w.useState(null),[D,B]=w.useState(null),[V,q]=w.useState(null),[J,W]=w.useState(),[K,F]=An({defaultProp:n?jr(n):void 0,prop:l?jr(l):void 0,onChange($e){a&&a($e?.toDate(k))}}),[Q,pe]=w.useMemo(()=>{const $e=n?jr(n):Xu("UTC"),Be=o?jr(o):$e.set({day:1,month:1,year:$e.year-MF});let se=i?jr(i):$e.set({day:31,month:12,year:$e.year+Jm});return se.compare(Be)<0&&(se=Be.set({day:31,month:12,year:Be.year+Jm})),[Be,se]},[o,i,n]),[we,ce]=w.useState(jF({currentValue:K,minDate:Q,maxDate:pe})),Ce=fn(),P=w.useRef(null),oe=$e=>{b&&!m&&(W(""),F(void 0),b($e),D?.focus())},_=w.useCallback($e=>{$e&&K&&ce(K),E($e)},[K]);Zr(()=>{if(l){const $e=jr(l);W(A.format($e.toDate(k))),ce($e)}else W("")},[l,A,k]),Zr(()=>{if(n&&J===void 0){const $e=jr(n);W(A.format($e.toDate(k)))}},[n,J,A,k]);const{error:G,...Z}=Bt("Combobox"),ne=!!G||d,ae=Z.id??h,be=Z.name??f,le=Z.required||g;let Le;return G?Le=`${ae}-error`:Z.hint&&(Le=`${ae}-hint`),u.jsxs(EF,{calendarDate:we,content:V,contentId:Ce,disabled:m,locale:R,minDate:Q,maxDate:pe,open:I,onCalendarDateChange:ce,onContentChange:q,onOpenChange:_,onTextInputChange:B,onTextValueChange:W,onTriggerChange:O,onValueChange:F,required:le,textInput:D,textValue:J,timeZone:k,trigger:j,value:K,children:[u.jsxs(OF,{className:e,hasError:ne,size:x,children:[u.jsx(u$,{fill:"neutral500","aria-hidden":!0}),u.jsx(BF,{ref:$,"aria-describedby":Le,id:ae,name:be,...y}),J&&b?u.jsx(At,{size:"XS",variant:"ghost",onClick:oe,"aria-disabled":m,"aria-label":v,label:v,ref:P,children:u.jsx(ri,{})}):null]}),u.jsx(rw,{children:u.jsx(zF,{label:t,children:u.jsx(UF,{monthSelectLabel:s,yearSelectLabel:c})})})]})}),ep=t=>!!t.match(/^[^a-zA-Z]*$/),jF=({currentValue:t,minDate:e,maxDate:n})=>{const r=Xu("UTC");return t||(xd(e,r)===e&&wd(n,r)===n?r:xd(e,r)===r?e:wd(n,r)===r?n:r)},DF="DatePickerTrigger",OF=w.forwardRef(({hasError:t,size:e,...n},r)=>{const i=lo(DF),o=Nt(r,a=>i.onTriggerChange(a)),s=()=>{i.disabled||i.onOpenChange(!0)};return u.jsx(to,{asChild:!0,trapped:i.open,onMountAutoFocus:a=>{a.preventDefault()},onUnmountAutoFocus:a=>{document.getSelection()?.empty(),a.preventDefault()},children:u.jsx(LF,{ref:o,$hasError:t,$size:e,...n,hasRadius:!0,gap:3,overflow:"hidden",background:i.disabled?"neutral150":"neutral0",onClick:Fr(n.onClick,()=>{i.textInput?.focus()}),onPointerDown:Fr(n.onPointerDown,a=>{const l=a.target;l.hasPointerCapture(a.pointerId)&&l.releasePointerCapture(a.pointerId),(l.closest("button")??l.closest("div"))===a.currentTarget&&a.button===0&&a.ctrlKey===!1&&(s(),i.textInput?.focus())})})})}),LF=C.styled(Y)`
|
|
1419
|
+
border: 1px solid ${({theme:t,$hasError:e})=>e?t.colors.danger600:t.colors.neutral200};
|
|
1420
|
+
${t=>{switch(t.$size){case"S":return C.css`
|
|
1421
|
+
padding-block: ${t.theme.spaces[1]};
|
|
1422
|
+
padding-inline: ${t.theme.spaces[3]};
|
|
1423
|
+
`;default:return C.css`
|
|
1424
|
+
padding-block: ${t.theme.spaces[2]};
|
|
1425
|
+
padding-inline: ${t.theme.spaces[3]};
|
|
1426
|
+
`}}}
|
|
1427
|
+
|
|
1428
|
+
& > svg {
|
|
1429
|
+
flex: 1 0 auto;
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
&[data-disabled] {
|
|
1433
|
+
color: ${({theme:t})=>t.colors.neutral600};
|
|
1434
|
+
background: ${({theme:t})=>t.colors.neutral150};
|
|
1435
|
+
cursor: not-allowed;
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
/* Required to ensure the below inputFocusStyles are adhered too */
|
|
1439
|
+
&:focus-visible {
|
|
1440
|
+
outline: none;
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
${({theme:t,$hasError:e})=>Er()({theme:t,$hasError:e})};
|
|
1444
|
+
`,NF="DatePickerTextInput",BF=w.forwardRef(({placeholder:t,...e},n)=>{const r=lo(NF),{onTextValueChange:i,textValue:o,onTextInputChange:s,onOpenChange:a,disabled:l,locale:c}=r,d=Nt(n,x=>s(x)),h=()=>{l||a(!0)},f=Kn(c,{year:"numeric",month:"2-digit",day:"2-digit"}),[m,g,b]=w.useMemo(()=>{const x=f.formatToParts(new Date),y=x.filter(S=>S.type==="year"||S.type==="month"||S.type==="day"),$=y.map(S=>{switch(S.type){case"day":return"DD";case"month":return"MM";case"year":return"YYYY";default:return""}}),k=x.find(S=>S.type==="literal")?.value??"";return[$,k,y]},[f]),v=m.map(x=>`\\d{${x.length}}`).join(`\\${g}`);return u.jsx(VF,{role:"combobox",type:"text",inputMode:"numeric",ref:d,"aria-autocomplete":"none","aria-controls":r.contentId,"aria-disabled":r.disabled,"aria-expanded":r.open,"aria-required":r.required,"aria-haspopup":"dialog","data-state":r.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,pattern:v,placeholder:t??m.join(g),...e,value:o??"",onBlur:Fr(e.onBlur,()=>{if(!r.textValue){r.onValueChange(void 0);return}r.onTextValueChange(f.format(r.calendarDate.toDate(r.timeZone))),r.onValueChange(r.calendarDate)}),onChange:Fr(e.onChange,x=>{if(ep(x.target.value)){const y=x.target.value.split(g),[$,k,S]=b.map((B,V)=>{const q=y[V];return{...B,value:q}}).sort((B,V)=>B.type==="year"?1:V.type==="year"?-1:B.type==="month"?1:V.type==="month"?-1:0).map(B=>B.value),R=r.calendarDate.year;let A=r.calendarDate.year;if(S){const B=S.length===1?`0${S}`:S;A=S.length<3?Number(`${R}`.slice(0,4-B.length)+B):Number(B)}S&&S.length<3&&A>r.maxDate.year&&(A-=100);const I=r.calendarDate.set({year:A}),E=I.calendar.getMonthsInYear(I),j=I.set({month:k&&Number(k)<=E?Number(k):void 0}),O=j.calendar.getDaysInMonth(j),D=j.set({day:$&&Number($)<=O?Number($):void 0});r.onCalendarDateChange(FF(D,r.minDate,r.maxDate)),r.onTextValueChange(x.target.value)}}),onKeyDown:Fr(e.onKeyDown,x=>{if(!r.open&&(ep(x.key)||["ArrowDown","Backspace"].includes(x.key)))h();else if(["Tab"].includes(x.key)&&r.open)x.preventDefault();else if(["Escape"].includes(x.key))r.open?r.onOpenChange(!1):(r.onValueChange(void 0),r.onTextValueChange("")),x.preventDefault();else if(r.open&&["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(x.key))switch(x.preventDefault(),x.key){case"ArrowDown":{const y=r.calendarDate.add({weeks:1});if(r.maxDate&&y.compare(r.maxDate)>0)return;r.onCalendarDateChange(y);return}case"ArrowRight":{const y=r.calendarDate.add({days:1});if(r.maxDate&&y.compare(r.maxDate)>0)return;r.onCalendarDateChange(y);return}case"ArrowUp":{const y=r.calendarDate.subtract({weeks:1});if(r.minDate&&y.compare(r.minDate)<0)return;r.onCalendarDateChange(y);return}case"ArrowLeft":{const y=r.calendarDate.subtract({days:1});if(r.minDate&&y.compare(r.minDate)<0)return;r.onCalendarDateChange(y)}}else r.open&&["Enter"].includes(x.key)&&(x.preventDefault(),i(f.format(r.calendarDate.toDate(r.timeZone))),r.onValueChange(r.calendarDate),r.onOpenChange(!1))})})});function FF(t,e,n){return e&&(t=wd(t,e)),n&&(t=xd(t,n)),t}const VF=C.styled.input`
|
|
1445
|
+
width: 100%;
|
|
1446
|
+
font-size: 1.4rem;
|
|
1447
|
+
line-height: 2.2rem;
|
|
1448
|
+
color: ${({theme:t})=>t.colors.neutral800};
|
|
1449
|
+
border: none;
|
|
1450
|
+
background-color: transparent;
|
|
1451
|
+
|
|
1452
|
+
&:focus-visible {
|
|
1453
|
+
outline: none;
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
&[aria-disabled='true'] {
|
|
1457
|
+
cursor: inherit;
|
|
1458
|
+
}
|
|
1459
|
+
`,_F="DatePickerContent",zF=w.forwardRef((t,e)=>{const[n,r]=w.useState(),i=lo(_F);if(Zr(()=>{r(new DocumentFragment)},[]),!i.open){const o=n;return o?ds.createPortal(u.jsx("div",{children:t.children}),o):null}return u.jsx(PF,{...t,ref:e})}),HF="DatePickerContent",PF=w.forwardRef((t,e)=>{const{label:n="Choose date",...r}=t,{onOpenChange:i,...o}=lo(HF),{x:s,y:a,refs:l,strategy:c,placement:d}=QA({strategy:"fixed",placement:"bottom-start",middleware:[ZA({mainAxis:4}),JA(),eR()],elements:{reference:o.trigger},whileElementsMounted:Up});w.useEffect(()=>{const f=()=>{i(!1)};return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[i]);const h=Nt(e,f=>o.onContentChange(f),l.setFloating);return eo(),u.jsx(ib,{allowPinchZoom:!0,children:u.jsx(mF,{asChild:!0,onFocusOutside:f=>{f.preventDefault()},onDismiss:()=>{i(!1)},children:u.jsx(WF,{ref:h,"data-state":o.open?"open":"closed","data-side":d.includes("top")?"top":"bottom",onContextMenu:f=>f.preventDefault(),id:o.contentId,role:"dialog","aria-modal":"true","aria-label":n,style:{left:s,top:a,position:c},hasRadius:!0,background:"neutral0",padding:1,...r})})})}),WF=C.styled(re)`
|
|
1460
|
+
box-shadow: ${({theme:t})=>t.shadows.filterShadow};
|
|
1461
|
+
z-index: ${({theme:t})=>t.zIndices.popover};
|
|
1462
|
+
border: 1px solid ${({theme:t})=>t.colors.neutral150};
|
|
1463
|
+
|
|
1464
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1465
|
+
animation-duration: ${t=>t.theme.motion.timings[200]};
|
|
1466
|
+
|
|
1467
|
+
&[data-state='open'] {
|
|
1468
|
+
animation-timing-function: ${t=>t.theme.motion.easings.authenticMotion};
|
|
1469
|
+
|
|
1470
|
+
&[data-side='top'] {
|
|
1471
|
+
animation-name: ${Ze.slideUpIn};
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
&[data-side='bottom'] {
|
|
1475
|
+
animation-name: ${Ze.slideDownIn};
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
`,qF="DatePickerCalendar",UF=w.forwardRef(({monthSelectLabel:t,yearSelectLabel:e,...n},r)=>{const{locale:i,timeZone:o,minDate:s,maxDate:a,calendarDate:l,onCalendarDateChange:c}=lo(qF),d=Zw(l),h=w.useMemo(()=>{const $=s.year,k=a.year;return[...Array(k-$+1).keys()].map(S=>($+S).toString())},[s,a]),f=Kn(i,{month:"long"}),m=w.useMemo(()=>[...Array(l.calendar.getMonthsInYear(l)).keys()].map($=>f.format(l.set({month:$+1}).toDate(o))),[l,f,o]),g=Kn(i,{weekday:"short"}),b=w.useMemo(()=>{const $=yp(Xu(o),i);return[...new Array(7).keys()].map(k=>{const R=$.add({days:k}).toDate(o);return g.format(R)})},[o,i,g]),v=$=>{if(typeof $=="number")return;const k=l.set({month:m.indexOf($)+1});c(k)},x=$=>{if(typeof $=="number")return;const k=l.set({year:parseInt($,10)});c(k)},y=KF(d,i);return u.jsxs(Y,{ref:r,direction:"column",alignItems:"stretch",padding:4,...n,children:[u.jsxs(GF,{justifyContent:"flex-start",paddingBottom:4,paddingLeft:2,paddingRight:2,gap:2,children:[u.jsx(Jr,{children:u.jsx(Jn,{"aria-label":t,value:m[l.month-1],onChange:v,children:m.map($=>u.jsx(er,{value:$,children:$},$))})}),u.jsx(Jr,{children:u.jsx(Jn,{value:l.year.toString(),"aria-label":e,onChange:x,children:h.map($=>u.jsx(er,{value:$,children:$},$))})})]}),u.jsxs("table",{role:"grid",children:[u.jsx("thead",{"aria-hidden":!0,children:u.jsx("tr",{"aria-rowindex":0,children:b.map(($,k)=>u.jsx(YF,{"aria-colindex":k,children:$},$))})}),u.jsx("tbody",{children:[...new Array(6).keys()].map($=>u.jsx("tr",{"aria-rowindex":$+2,children:y($).map((k,S)=>k?u.jsx(ZF,{"aria-colindex":S+1,date:k,startDate:d,disabled:s.compare(k)>0||k.compare(a)>0},k.toString()):u.jsx(hw,{"aria-colindex":S+1},S+1))},$))})]})]})}),KF=(t,e)=>n=>{let r=t.add({weeks:n});const i=[];r=yp(r,e);const o=xp(r,e);for(let s=0;s<o;s++)i.push(null);for(;i.length<7;){i.push(r);const s=r.add({days:1});if(vp(r,s))break;r=s}for(;i.length<7;)i.push(null);return i},GF=C.styled(Y)`
|
|
1480
|
+
div[role='combobox'] {
|
|
1481
|
+
border: 1px solid transparent;
|
|
1482
|
+
background: transparent;
|
|
1483
|
+
font-weight: ${t=>t.theme.fontWeights.bold};
|
|
1484
|
+
|
|
1485
|
+
svg {
|
|
1486
|
+
fill: ${({theme:t})=>t.colors.neutral500};
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
&:hover {
|
|
1490
|
+
background-color: ${({theme:t})=>t.colors.neutral100};
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
`,YF=w.forwardRef(({children:t,...e},n)=>u.jsx(XF,{tag:"th",role:"gridcell",ref:n,...e,height:"2.4rem",width:"3.2rem",children:u.jsx(ee,{variant:"pi",fontWeight:"bold",color:"neutral800",children:t.slice(0,2)})})),XF=C.styled(re)`
|
|
1494
|
+
border-radius: ${({theme:t})=>t.borderRadius};
|
|
1495
|
+
text-transform: capitalize;
|
|
1496
|
+
`,QF="DatePickerCalendarCell",ZF=w.forwardRef(({date:t,startDate:e,disabled:n,...r},i)=>{const{timeZone:o,locale:s,calendarDate:a,onValueChange:l,onOpenChange:c,onTextValueChange:d,onCalendarDateChange:h}=lo(QF),f=vp(a,t),m=Kn(s,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),g=w.useMemo(()=>m.format(t.toDate(o)),[m,t,o]),b=Kn(s,{day:"numeric",calendar:t.calendar.identifier}),v=w.useMemo(()=>b.formatToParts(t.toDate(o)).find(S=>S.type==="day").value,[b,t,o]),x=Kn(s,{day:"2-digit",month:"2-digit",year:"numeric"}),y=Jw(e),$=t.compare(e)<0||t.compare(y)>0;let k="neutral900";return f?k="primary600":$&&(k="neutral600"),u.jsx(hw,{tag:"td",role:"gridcell",ref:i,"aria-selected":f,...r,hasRadius:!0,"aria-label":g,tabIndex:f?0:-1,background:f?"primary100":"neutral0",cursor:"pointer",onPointerDown:Fr(r.onPointerDown,S=>{S.preventDefault(),h(t),l(t),d(x.format(t.toDate(o))),c(!1)}),"aria-disabled":n,children:u.jsx(ee,{variant:"pi",textColor:k,children:v})})}),hw=C.styled(re)`
|
|
1497
|
+
text-align: center;
|
|
1498
|
+
padding: 0.7rem;
|
|
1499
|
+
// Trick to prevent the outline from overflowing because of the general outline-offset
|
|
1500
|
+
outline-offset: -2px !important;
|
|
1501
|
+
&[aria-disabled='true'] {
|
|
1502
|
+
pointer-events: none;
|
|
1503
|
+
opacity: 0.5;
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
&[aria-disabled='false'] {
|
|
1507
|
+
&:hover {
|
|
1508
|
+
background: ${({theme:t})=>t.colors.primary100};
|
|
1509
|
+
color: ${({theme:t})=>t.colors.primary600};
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
`,jr=t=>{const e=t.toISOString(),n=jp(e,"UTC");return kp(n)},hd=t=>!!t.match(/^[^a-zA-Z]*$/);function JF(t=""){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const eV=w.forwardRef(({step:t=15,value:e,defaultValue:n,onChange:r,...i},o)=>{const s=gc("TimePicker"),[a,l]=w.useState(""),[c,d]=An({prop:e,defaultProp:n,onChange:r}),h=Kn(s.locale,{hour:"2-digit",minute:"2-digit",hour12:!1}),f=w.useMemo(()=>{const k=h.formatToParts(new Date),{value:S}=k.find(R=>R.type==="literal");return S},[h]),m=w.useMemo(()=>{const k=60/t;return[...Array(24).keys()].flatMap(S=>[...Array(k).keys()].map(R=>h.format(new Date(0,0,0,S,R*t))))},[t,h]),g=k=>{(!k||hd(k))&&l(k)},b=k=>{const[S,R]=k.split(f);if(!S&&!R)return;const A=Number(S??"0"),I=Number(R??"0");if(!(A>23||I>59))return h.format(new Date(0,0,0,A,I))},v=k=>{const S=b(k.target.value);S?(l(S),d(S)):l(c)},x=k=>{if(typeof k<"u"){const S=b(k);d(S)}else d(k)};w.useEffect(()=>{const k=typeof e>"u"?"":e;hd(k)&&l(k)},[e,l]);const $=`\\d{2}${JF(f)}\\d{2}`;return u.jsx(Zx,{...i,ref:o,value:c,onChange:x,isPrintableCharacter:hd,allowCustomValue:!0,placeholder:`--${f}--`,autocomplete:"none",startIcon:u.jsx(B$,{fill:"neutral500"}),inputMode:"numeric",pattern:$,textValue:a,onTextValueChange:g,onBlur:v,children:m.map(k=>u.jsx(Jx,{value:k,children:k},k))})}),tV=C.styled(IF)`
|
|
1513
|
+
flex: 1 1 70%;
|
|
1514
|
+
min-width: 120px;
|
|
1515
|
+
`,nV=C.styled(eV)`
|
|
1516
|
+
flex: 1 1 30%;
|
|
1517
|
+
min-width: 140px;
|
|
1518
|
+
`;w.forwardRef(({clearLabel:t="clear",dateLabel:e="Choose date",timeLabel:n="Choose time",disabled:r=!1,hasError:i,onChange:o,onClear:s,required:a=!1,step:l,value:c,initialDate:d,size:h,...f},m)=>{const g=w.useRef(null),[b,v]=An({defaultProp:d?yo(d,!1):void 0,prop:c?yo(c,!1):c??void 0,onChange(B){o&&o(B?.toDate(Li()))}}),x=gc("DateTimePicker"),y=Kn(x.locale,{hour:"2-digit",minute:"2-digit",hour12:!1}),$=b?y.format(b.toDate(Li())):"",k=B=>{let V=B?yo(B):void 0;if(!(V&&b&&V.compare(b)===0)){if($&&V){const[q,J]=$.split(":");V=V.set({hour:parseInt(q,10),minute:parseInt(J,10)})}v(V)}},S=B=>{if(!B)return;const[V,q]=B.split(":"),J=b?b.set({hour:parseInt(V,10),minute:parseInt(q,10)}):yo(new Date).set({hour:parseInt(V,10),minute:parseInt(q,10)});v(J)},R=B=>{v(void 0),s&&s(B)},A=()=>{const B=b?b.set({hour:0,minute:0}):yo(new Date);v(B)},I=Nt(g,m),{error:E,id:j,labelNode:O}=Bt("DateTimePicker"),D=!!E||i;return u.jsxs(Y,{"aria-labelledby":O?`${j}-label`:void 0,role:"group",flex:"1",gap:1,children:[u.jsx(Jr,{children:u.jsx(tV,{...f,size:h,value:b?.toDate("UTC"),onChange:k,required:a,onClear:s?R:void 0,clearLabel:`${t} date`,disabled:r,ref:I,"aria-label":e})}),u.jsx(Jr,{children:u.jsx(nV,{size:h,hasError:D,value:$,onChange:S,onClear:s&&$!==void 0&&$!=="00:00"?A:void 0,clearLabel:`${t} time`,required:a,disabled:r,step:l,"aria-label":n})})]})});const yo=(t,e=!0)=>{const n=t.toISOString();let r=my(n);return e&&(r=r.set({hour:0,minute:0})),Pr(r)},ji=w.forwardRef((t,e)=>u.jsx(rV,{ref:e,background:"neutral150",...t,"data-orientation":"horizontal",role:"separator",tag:"div"})),rV=C.styled(re)`
|
|
1519
|
+
height: 1px;
|
|
1520
|
+
border: none;
|
|
1521
|
+
/* If contained in a Flex parent we want to prevent the Divider to shink */
|
|
1522
|
+
flex-shrink: 0;
|
|
1523
|
+
`,iV=C.styled(re)`
|
|
1524
|
+
svg {
|
|
1525
|
+
height: 8.8rem;
|
|
1526
|
+
}
|
|
1527
|
+
`;w.forwardRef(({icon:t,content:e,action:n,hasRadius:r=!0,shadow:i="tableShadow"},o)=>u.jsxs(Y,{ref:o,alignItems:"center",direction:"column",padding:11,background:"neutral0",hasRadius:r,shadow:i,children:[t?u.jsx(iV,{paddingBottom:6,"aria-hidden":!0,children:t}):null,u.jsx(re,{paddingBottom:4,children:u.jsx(ee,{variant:"delta",tag:"p",textAlign:"center",textColor:"neutral600",children:e})}),n]}));const fw=Ae.define(),mw=Ae.define(),oV=xe.mark({attributes:{style:"background-color: yellow; color: black"}}),sV=ut.define({create(){return xe.none},update(t,e){return t=t.map(e.changes),e.effects.forEach(n=>{n.is(fw)?t=t.update({add:n.value,sort:!0}):n.is(mw)&&(t=t.update({filter:n.value}))}),t},provide:t=>ie.decorations.from(t)});w.forwardRef(({hasError:t,required:e,id:n,value:r="",disabled:i=!1,onChange:o=()=>null,...s},a)=>{const l=w.useRef(),c=w.useRef(),d=w.useRef(),{error:h,...f}=Bt("JsonInput"),m=!!h||t,g=f.id??n,b=f.required||e;let v;h?v=`${g}-error`:f.hint&&(v=`${g}-hint`);const x=E=>{const j=c.current?.doc;if(j){const{text:O,to:D}=j.line(E),B=D-O.trimStart().length;D>B&&d.current?.dispatch({effects:fw.of([oV.range(B,D)])})}},y=()=>{const E=c.current?.doc;if(E){const j=E.length||0;d.current?.dispatch({effects:mw.of((O,D)=>D<=0||O>=j)})}},$=({state:E,view:j})=>{d.current=j,c.current=E,y();const D=DI()(j);D.length&&x(E.doc.lineAt(D[0].from).number)},k=(E,j)=>{$(j),o(E)},S=(E,j)=>{d.current=E,c.current=j,$({view:E,state:j})},{setContainer:R,view:A}=tx({value:r,onCreateEditor:S,container:l.current,editable:!i,extensions:[NI(),sV],onChange:k,theme:"dark",basicSetup:{lineNumbers:!0,bracketMatching:!0,closeBrackets:!0,indentOnInput:!0,syntaxHighlighting:!0,highlightSelectionMatches:!0,tabSize:2}}),I=Nt(l,R);return w.useImperativeHandle(a,()=>({...A?.dom,focus(){A&&A.focus()},scrollIntoView(E){A&&A.dom.scrollIntoView(E)}}),[A]),u.jsx(aV,{ref:I,$disabled:i,$hasError:m,alignItems:"stretch",fontSize:2,hasRadius:!0,"aria-required":b,id:g,"aria-describedby":v,...s})});const aV=C.styled(Y)`
|
|
1528
|
+
line-height: ${({theme:t})=>t.lineHeights[2]};
|
|
1529
|
+
|
|
1530
|
+
.cm-editor {
|
|
1531
|
+
/**
|
|
1532
|
+
* Hard coded since the color is the same between themes,
|
|
1533
|
+
* theme.colors.neutral800 changes between themes
|
|
1534
|
+
*/
|
|
1535
|
+
background-color: #32324d;
|
|
1536
|
+
width: 100%;
|
|
1537
|
+
outline: none;
|
|
1538
|
+
cursor: ${({$disabled:t})=>t?"not-allowed":"text"};
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
.cm-scroller {
|
|
1542
|
+
border: 1px solid ${({theme:t,$hasError:e})=>e?t.colors.danger600:t.colors.neutral200};
|
|
1543
|
+
/* inputFocusStyle will receive hasError prop */
|
|
1544
|
+
${Er()}
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
.cm-editor,
|
|
1548
|
+
.cm-scroller {
|
|
1549
|
+
border-radius: ${({theme:t})=>t.borderRadius};
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
.cm-gutters,
|
|
1553
|
+
.cm-activeLineGutter {
|
|
1554
|
+
/**
|
|
1555
|
+
* Hard coded since the color is the same between themes,
|
|
1556
|
+
* theme.colors.neutral700 changes between themes
|
|
1557
|
+
*/
|
|
1558
|
+
background-color: #4a4a6a;
|
|
1559
|
+
}
|
|
1560
|
+
`;Mt(({disabled:t,...e},n)=>u.jsx(Xe,{ref:n,tag:Ts,tabIndex:t?-1:void 0,disabled:t,...e}));C.styled(re)`
|
|
1561
|
+
// To prevent global outline on focus visible to force an outline when Main is focused
|
|
1562
|
+
&:focus-visible {
|
|
1563
|
+
outline: none;
|
|
1564
|
+
}
|
|
1565
|
+
`;C.styled(re)`
|
|
1566
|
+
text-decoration: none;
|
|
1567
|
+
|
|
1568
|
+
&:focus {
|
|
1569
|
+
left: ${({theme:t})=>t.spaces[3]};
|
|
1570
|
+
top: ${({theme:t})=>t.spaces[3]};
|
|
1571
|
+
}
|
|
1572
|
+
`;const lV=U2,cV=w.forwardRef((t,e)=>u.jsx(K2,{...t,asChild:!0,ref:e})),dV=w.forwardRef((t,e)=>u.jsxs(G2,{children:[u.jsx(uV,{}),u.jsx(hV,{ref:e,...t})]})),uV=C.styled(Y2)`
|
|
1573
|
+
background-color: ${t=>t.theme.colors.neutral800};
|
|
1574
|
+
position: fixed;
|
|
1575
|
+
inset: 0;
|
|
1576
|
+
z-index: ${t=>t.theme.zIndices.overlay};
|
|
1577
|
+
opacity: 0.2;
|
|
1578
|
+
will-change: opacity;
|
|
1579
|
+
|
|
1580
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1581
|
+
animation: ${Ze.overlayFadeIn} ${t=>t.theme.motion.timings[200]}
|
|
1582
|
+
${t=>t.theme.motion.easings.authenticMotion};
|
|
1583
|
+
}
|
|
1584
|
+
`,hV=C.styled(X2)`
|
|
1585
|
+
max-width: 83rem;
|
|
1586
|
+
max-height: 90vh;
|
|
1587
|
+
height: auto;
|
|
1588
|
+
width: 60%;
|
|
1589
|
+
overflow: hidden;
|
|
1590
|
+
margin: 0 auto;
|
|
1591
|
+
display: flex;
|
|
1592
|
+
flex-direction: column;
|
|
1593
|
+
|
|
1594
|
+
position: fixed;
|
|
1595
|
+
top: 50%;
|
|
1596
|
+
left: 50%;
|
|
1597
|
+
transform: translate(-50%, -50%);
|
|
1598
|
+
|
|
1599
|
+
border-radius: ${t=>t.theme.borderRadius};
|
|
1600
|
+
background-color: ${t=>t.theme.colors.neutral0};
|
|
1601
|
+
box-shadow: ${t=>t.theme.shadows.popupShadow};
|
|
1602
|
+
z-index: ${t=>t.theme.zIndices.modal};
|
|
1603
|
+
|
|
1604
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1605
|
+
&[data-state='open'] {
|
|
1606
|
+
animation-duration: ${t=>t.theme.motion.timings[200]};
|
|
1607
|
+
animation-timing-function: ${t=>t.theme.motion.easings.authenticMotion};
|
|
1608
|
+
animation-name: ${Ze.modalPopIn};
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1611
|
+
&[data-state='closed'] {
|
|
1612
|
+
animation-duration: ${t=>t.theme.motion.timings[120]};
|
|
1613
|
+
animation-timing-function: ${t=>t.theme.motion.easings.easeOutQuad};
|
|
1614
|
+
animation-name: ${Ze.modalPopOut};
|
|
1615
|
+
}
|
|
1616
|
+
}
|
|
1617
|
+
`,pw=w.forwardRef((t,e)=>u.jsx(sf,{...t,asChild:!0,ref:e})),fV=w.forwardRef(({children:t,closeLabel:e="Close modal",...n},r)=>u.jsxs(mV,{ref:r,padding:4,paddingLeft:5,paddingRight:5,background:"neutral100",justifyContent:"space-between",...n,tag:"header",children:[t,u.jsx(pw,{children:u.jsx(At,{withTooltip:!1,label:e,children:u.jsx(ri,{})})})]})),mV=C.styled(Y)`
|
|
1618
|
+
border-bottom: solid 1px ${t=>t.theme.colors.neutral150};
|
|
1619
|
+
`,pV=w.forwardRef((t,e)=>u.jsx(Q2,{asChild:!0,children:u.jsx(ee,{tag:"h2",variant:"omega",fontWeight:"bold",ref:e,...t})})),gV=w.forwardRef(({children:t,...e},n)=>u.jsx(bV,{ref:n,...e,children:t})),bV=C.styled(pc)`
|
|
1620
|
+
padding-inline: ${t=>t.theme.spaces[8]};
|
|
1621
|
+
|
|
1622
|
+
& > div {
|
|
1623
|
+
padding-block: ${t=>t.theme.spaces[8]};
|
|
1624
|
+
|
|
1625
|
+
& > div {
|
|
1626
|
+
// the scroll area component applies a display: table to the child, which we don't want.
|
|
1627
|
+
display: block !important;
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
`,vV=w.forwardRef((t,e)=>u.jsx(xV,{ref:e,padding:4,paddingLeft:5,paddingRight:5,background:"neutral100",justifyContent:"space-between",...t,tag:"footer"})),xV=C.styled(Y)`
|
|
1631
|
+
border-top: solid 1px ${t=>t.theme.colors.neutral150};
|
|
1632
|
+
flex: 1;
|
|
1633
|
+
`,dt=Object.freeze(Object.defineProperty({__proto__:null,Body:gV,Close:pw,Content:dV,Footer:vV,Header:fV,Root:lV,Title:pV,Trigger:cV},Symbol.toStringTag,{value:"Module"})),wV="",yV=w.forwardRef(({startAction:t,locale:e,onValueChange:n,value:r,step:i=1,disabled:o=!1,...s},a)=>{const l=gc("NumberInput"),c=e||l.locale,d=w.useRef(new ix(c,{style:"decimal"})),h=w.useRef(new rx(c,{maximumFractionDigits:20})),[f,m]=CV({prop(R){const A=String(r);return isNaN(Number(A))||A!==R&&R!==""?R:h.current.format(Number(r))},defaultProp:wV,onChange(R){const A=d.current.parse(R??"");n(isNaN(A)?void 0:A)}}),g=R=>{m(String(R))},b=({target:{value:R}})=>{d.current.isValidPartialNumber(R)&&g(R)},x=(R=>{const A=R.toString();return A.includes(".")?A.split(".")[1].length:0})(i),y=()=>{if(!f){g(i);return}const R=d.current.parse(f),A=isNaN(R)?i:R+i,I=parseFloat(A.toFixed(x));g(h.current.format(I))},$=()=>{if(!f){g(-i);return}const R=d.current.parse(f),A=isNaN(R)?-i:R-i,I=parseFloat(A.toFixed(x));g(h.current.format(I))},k=R=>{if(!o)switch(R.key){case xt.DOWN:{R.preventDefault(),$();break}case xt.UP:{R.preventDefault(),y();break}}},S=()=>{if(f){const R=d.current.parse(f),A=isNaN(R)?"":h.current.format(R);g(A)}};return u.jsx(mc,{ref:a,startAction:t,disabled:o,type:"text",inputMode:"decimal",onChange:b,onKeyDown:k,onBlur:S,value:f,endAction:u.jsxs(Y,{direction:"column",children:[u.jsx(tp,{disabled:o,"aria-hidden":!0,$reverse:!0,onClick:y,tabIndex:-1,type:"button","data-testid":"ArrowUp",children:u.jsx(br,{fill:"neutral500"})}),u.jsx(tp,{disabled:o,"aria-hidden":!0,onClick:$,tabIndex:-1,type:"button","data-testid":"ArrowDown",children:u.jsx(br,{fill:"neutral500"})})]}),...s})}),tp=C.styled.button`
|
|
1634
|
+
display: flex;
|
|
1635
|
+
justify-content: center;
|
|
1636
|
+
align-items: center;
|
|
1637
|
+
transform: translateY(${({$reverse:t})=>t?"-2px":"2px"});
|
|
1638
|
+
cursor: ${({disabled:t})=>t?"not-allowed":void 0};
|
|
1639
|
+
height: 1.1rem;
|
|
1640
|
+
|
|
1641
|
+
svg {
|
|
1642
|
+
width: 1.2rem;
|
|
1643
|
+
transform: ${({$reverse:t})=>t?"rotateX(180deg)":void 0};
|
|
1644
|
+
}
|
|
1645
|
+
`;function CV({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=jx({defaultProp:e,onChange:n}),o=t!==void 0,s=t instanceof Function?t(r):t,a=o?s:r,l=Sh(n),c=w.useCallback(d=>{if(o){const f=typeof d=="function"?d(s):d;f!==s&&(l(f),i(d))}else i(d)},[o,s,i,l]);return[a,c]}const $V=w.createContext({activePage:1,pageCount:1}),Gf=()=>w.useContext($V);Mt(({children:t,...e},n)=>{const{activePage:r}=Gf(),i=r===1;return u.jsxs(bw,{ref:n,"aria-disabled":i,tabIndex:i?-1:void 0,...e,children:[u.jsx(Mr,{children:t}),u.jsx(n2,{"aria-hidden":!0})]})});Mt(({children:t,...e},n)=>{const{activePage:r,pageCount:i}=Gf(),o=r===i;return u.jsxs(bw,{ref:n,"aria-disabled":o,tabIndex:o?-1:void 0,...e,children:[u.jsx(Mr,{children:t}),u.jsx(Gh,{"aria-hidden":!0})]})});const gw=C.styled(Ts)`
|
|
1646
|
+
padding: ${({theme:t})=>t.spaces[3]};
|
|
1647
|
+
border-radius: ${({theme:t})=>t.borderRadius};
|
|
1648
|
+
box-shadow: ${({$active:t,theme:e})=>t?e.shadows.filterShadow:void 0};
|
|
1649
|
+
text-decoration: none;
|
|
1650
|
+
display: flex;
|
|
1651
|
+
|
|
1652
|
+
${uc}
|
|
1653
|
+
`,bw=C.styled(gw)`
|
|
1654
|
+
font-size: 1.1rem;
|
|
1655
|
+
|
|
1656
|
+
svg path {
|
|
1657
|
+
fill: ${t=>t["aria-disabled"]?t.theme.colors.neutral300:t.theme.colors.neutral600};
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
&:focus,
|
|
1661
|
+
&:hover {
|
|
1662
|
+
svg path {
|
|
1663
|
+
fill: ${t=>t["aria-disabled"]?t.theme.colors.neutral300:t.theme.colors.neutral700};
|
|
1664
|
+
}
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
${t=>t["aria-disabled"]?`
|
|
1668
|
+
pointer-events: none;
|
|
1669
|
+
`:void 0}
|
|
1670
|
+
`;Mt(({number:t,children:e,...n},r)=>{const{activePage:i}=Gf(),o=i===t;return u.jsxs(SV,{ref:r,...n,"aria-current":o,$active:o,children:[u.jsx(Mr,{children:e}),u.jsx(ee,{"aria-hidden":!0,fontWeight:o?"bold":void 0,lineHeight:"revert",variant:"pi",children:t})]})});const SV=C.styled(gw)`
|
|
1671
|
+
color: ${({theme:t,$active:e})=>e?t.colors.primary700:t.colors.neutral800};
|
|
1672
|
+
background: ${({theme:t,$active:e})=>e?t.colors.neutral0:void 0};
|
|
1673
|
+
|
|
1674
|
+
&:hover {
|
|
1675
|
+
box-shadow: ${({theme:t})=>t.shadows.filterShadow};
|
|
1676
|
+
}
|
|
1677
|
+
`;w.forwardRef((t,e)=>u.jsx(tL,{...t,asChild:!0,ref:e}));w.forwardRef((t,e)=>u.jsx(nL,{children:u.jsx(kV,{sideOffset:4,side:"bottom",align:"start",...t,ref:e})}));const kV=C.styled(rL)`
|
|
1678
|
+
box-shadow: ${({theme:t})=>t.shadows.filterShadow};
|
|
1679
|
+
z-index: ${({theme:t})=>t.zIndices.popover};
|
|
1680
|
+
background-color: ${t=>t.theme.colors.neutral0};
|
|
1681
|
+
border: 1px solid ${({theme:t})=>t.colors.neutral150};
|
|
1682
|
+
border-radius: ${({theme:t})=>t.borderRadius};
|
|
1683
|
+
|
|
1684
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1685
|
+
animation-duration: ${t=>t.theme.motion.timings[200]};
|
|
1686
|
+
|
|
1687
|
+
&[data-state='open'] {
|
|
1688
|
+
animation-timing-function: ${t=>t.theme.motion.easings.authenticMotion};
|
|
1689
|
+
|
|
1690
|
+
&[data-side='top'] {
|
|
1691
|
+
animation-name: ${Ze.slideUpIn};
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
&[data-side='bottom'] {
|
|
1695
|
+
animation-name: ${Ze.slideDownIn};
|
|
1696
|
+
}
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
&[data-state='closed'] {
|
|
1700
|
+
animation-timing-function: ${t=>t.theme.motion.easings.easeOutQuad};
|
|
1701
|
+
|
|
1702
|
+
&[data-side='top'] {
|
|
1703
|
+
animation-name: ${Ze.slideUpOut};
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1706
|
+
&[data-side='bottom'] {
|
|
1707
|
+
animation-name: ${Ze.slideDownOut};
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1711
|
+
`;w.forwardRef(({children:t,intersectionId:e,onReachEnd:n,...r},i)=>{const o=w.useRef(null),s=Nt(o,i),a=fn();return Ms(o,n??(()=>{}),{selectorToWatch:`#${Xi(a)}`,skipWhen:!e||!n}),u.jsxs(AV,{ref:s,...r,children:[t,e&&n&&u.jsx(re,{id:Xi(a),width:"100%",height:"1px"})]})});const AV=C.styled(pc)`
|
|
1712
|
+
height: 20rem;
|
|
1713
|
+
`;w.forwardRef(({size:t="M",value:e,...n},r)=>u.jsx(RV,{ref:r,$size:t,...n,children:u.jsx(TV,{style:{transform:`translate3D(-${100-(e??0)}%, 0, 0)`}})}));const RV=C.styled(hL)`
|
|
1714
|
+
position: relative;
|
|
1715
|
+
overflow: hidden;
|
|
1716
|
+
width: ${t=>t.$size==="S"?"7.8rem":"10.2rem"};
|
|
1717
|
+
height: ${t=>t.$size==="S"?"0.4rem":"0.8rem"};
|
|
1718
|
+
background-color: ${t=>t.theme.colors.neutral600};
|
|
1719
|
+
border-radius: ${t=>t.theme.borderRadius};
|
|
1720
|
+
|
|
1721
|
+
/* Fix overflow clipping in Safari */
|
|
1722
|
+
/* https://gist.github.com/domske/b66047671c780a238b51c51ffde8d3a0 */
|
|
1723
|
+
transform: translateZ(0);
|
|
1724
|
+
`,TV=C.styled(fL)`
|
|
1725
|
+
background-color: ${({theme:t})=>t.colors.neutral0};
|
|
1726
|
+
border-radius: ${({theme:t})=>t.borderRadius};
|
|
1727
|
+
width: 100%;
|
|
1728
|
+
height: 100%;
|
|
1729
|
+
|
|
1730
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1731
|
+
transition: transform ${t=>t.theme.motion.timings[320]}
|
|
1732
|
+
${t=>t.theme.motion.easings.authenticMotion};
|
|
1733
|
+
}
|
|
1734
|
+
`;w.forwardRef((t,e)=>u.jsx(MV,{ref:e,...t}));const MV=C.styled(ML)`
|
|
1735
|
+
display: flex;
|
|
1736
|
+
flex-direction: column;
|
|
1737
|
+
gap: ${t=>t.theme.spaces[3]};
|
|
1738
|
+
`;w.forwardRef(({children:t,id:e,...n},r)=>{const i=fn(e);return u.jsxs(Y,{gap:2,children:[u.jsx(EV,{id:i,ref:r,...n,children:u.jsx(IV,{})}),u.jsx(ee,{tag:"label",htmlFor:i,children:t})]})});const EV=C.styled(EL)`
|
|
1739
|
+
background: ${t=>t.theme.colors.neutral0};
|
|
1740
|
+
width: 2rem;
|
|
1741
|
+
height: 2rem;
|
|
1742
|
+
flex: 0 0 2rem;
|
|
1743
|
+
border-radius: 50%;
|
|
1744
|
+
border: 1px solid ${t=>t.theme.colors.neutral300};
|
|
1745
|
+
position: relative;
|
|
1746
|
+
cursor: pointer;
|
|
1747
|
+
z-index: 0;
|
|
1748
|
+
|
|
1749
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1750
|
+
transition: border-color ${t=>t.theme.motion.timings[120]}
|
|
1751
|
+
${t=>t.theme.motion.easings.easeOutQuad};
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
&[data-state='checked'] {
|
|
1755
|
+
border: 1px solid ${t=>t.theme.colors.primary600};
|
|
1756
|
+
}
|
|
1757
|
+
|
|
1758
|
+
&[data-disabled] {
|
|
1759
|
+
cursor: not-allowed;
|
|
1760
|
+
background-color: ${t=>t.theme.colors.neutral200};
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1763
|
+
/* increase target size for touch devices https://www.w3.org/WAI/WCAG21/Understanding/target-size.html */
|
|
1764
|
+
&::before {
|
|
1765
|
+
content: '';
|
|
1766
|
+
position: absolute;
|
|
1767
|
+
top: 50%;
|
|
1768
|
+
left: 50%;
|
|
1769
|
+
transform: translate(-50%, -50%);
|
|
1770
|
+
width: 100%;
|
|
1771
|
+
height: 100%;
|
|
1772
|
+
min-width: 44px;
|
|
1773
|
+
min-height: 44px;
|
|
1774
|
+
}
|
|
1775
|
+
`,IV=C.styled(IL)`
|
|
1776
|
+
display: flex;
|
|
1777
|
+
align-items: center;
|
|
1778
|
+
justify-content: center;
|
|
1779
|
+
width: 100%;
|
|
1780
|
+
height: 100%;
|
|
1781
|
+
position: relative;
|
|
1782
|
+
|
|
1783
|
+
&[data-state='checked'] {
|
|
1784
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1785
|
+
animation: ${Ze.popIn} ${t=>t.theme.motion.timings[200]};
|
|
1786
|
+
}
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1789
|
+
&::after {
|
|
1790
|
+
content: '';
|
|
1791
|
+
display: block;
|
|
1792
|
+
width: 1rem;
|
|
1793
|
+
height: 1rem;
|
|
1794
|
+
border-radius: 50%;
|
|
1795
|
+
background: ${t=>t.theme.colors.primary600};
|
|
1796
|
+
}
|
|
1797
|
+
`,jV=t=>{const e=t.querySelector('[tabindex="0"]');e&&e.focus()},vw=w.createContext({rowIndex:0,colIndex:0,setTableValues(){throw new Error("setTableValues must be initialized via the RawTableContext.Provider")}}),DV=()=>w.useContext(vw),OV=w.forwardRef(({colCount:t,rowCount:e,jumpStep:n=3,initialCol:r=0,initialRow:i=0,...o},s)=>{const a=w.useRef(null),l=w.useRef(!1),c=Nt(a,s),[d,h]=w.useState(i),[f,m]=w.useState(r),g=w.useCallback(({colIndex:x,rowIndex:y})=>{m(x),h(y)},[]);w.useEffect(()=>{l.current&&jV(a.current),l.current||(l.current=!0)},[f,d]);const b=x=>{switch(x.key){case xt.RIGHT:{x.preventDefault(),m(y=>y<t-1?y+1:y);break}case xt.LEFT:{x.preventDefault(),m(y=>y>0?y-1:y);break}case xt.UP:{x.preventDefault(),h(y=>y>0?y-1:y);break}case xt.DOWN:{x.preventDefault(),h(y=>y<e-1?y+1:y);break}case xt.HOME:{x.preventDefault(),x.ctrlKey&&h(0),m(0);break}case xt.END:{x.preventDefault(),x.ctrlKey&&h(e-1),m(t-1);break}case xt.PAGE_DOWN:{x.preventDefault(),h(y=>y+n<e?y+n:e-1);break}case xt.PAGE_UP:{x.preventDefault(),h(y=>y-n>0?y-n:0);break}}},v=w.useMemo(()=>({rowIndex:d,colIndex:f,setTableValues:g}),[f,d,g]);return u.jsx(vw.Provider,{value:v,children:u.jsx("table",{role:"grid",ref:c,"aria-rowcount":e,"aria-colcount":t,onKeyDown:b,...o})})}),Co=(t,e)=>[...t.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')].filter(i=>!i.hasAttribute("disabled")),fd=t=>t.filter(e=>e.tagName==="INPUT"?e.type!=="checkbox"&&e.type!=="radio":!1),xw=w.forwardRef(({coords:t={col:0,row:0},tag:e="td",...n},r)=>{const i=w.useRef(null),o=Nt(r,i),{rowIndex:s,colIndex:a,setTableValues:l}=DV(),[c,d]=w.useState(!1),h=g=>{const b=Co(i.current);if(b.length===0||b.length===1&&fd(b).length===0)return;if(b.length>1&&!b.find(x=>x.tagName!=="BUTTON")){g.preventDefault();const x=b.findIndex(y=>y===document.activeElement);if(g.key===xt.RIGHT){const y=b[x+1];y&&(g.stopPropagation(),y.focus())}else if(g.key===xt.LEFT){const y=b[x-1];y&&(g.stopPropagation(),y.focus())}return}const v=g.key===xt.ENTER;if(v&&!c)d(!0);else if((g.key===xt.ESCAPE||v)&&c){if(v&&document.activeElement?.tagName==="A")return;d(!1),i.current.focus()}else c&&g.stopPropagation()},f=s===t.row-1&&a===t.col-1;Zr(()=>{const g=Co(i.current);g.length===0||g.length===1&&fd(g).length!==0||g.length>1&&g.find(b=>b.tagName!=="BUTTON")?(i.current.setAttribute("tabIndex",!c&&f?"0":"-1"),g.forEach((b,v)=>{b.setAttribute("tabIndex",c?"0":"-1"),c&&v===0&&b.focus()})):g.forEach(b=>{b.setAttribute("tabIndex",f?"0":"-1")})},[c,f]);const m=w.useCallback(()=>{const g=Co(i.current);g.length>=1&&(fd(g).length!==0||!g.find(b=>b.tagName!=="BUTTON"))&&d(!0),l({rowIndex:t.row-1,colIndex:t.col-1})},[t,l]);return Zr(()=>{const g=i.current;return Co(g).forEach(v=>{v.addEventListener("focus",m)}),()=>{Co(g).forEach(x=>{x.removeEventListener("focus",m)})}},[m]),u.jsx(re,{role:"gridcell",tag:e,ref:o,onKeyDown:h,...n})}),LV=t=>u.jsx(xw,{...t,tag:"th"}),NV=({children:t,...e})=>{const n=w.Children.toArray(t).map(r=>w.isValidElement(r)?w.cloneElement(r,{"aria-rowindex":1}):r);return u.jsx("thead",{...e,children:n})},BV=({children:t,...e})=>{const n=w.Children.toArray(t).map((r,i)=>w.isValidElement(r)?w.cloneElement(r,{"aria-rowindex":i+2}):r);return u.jsx("tbody",{...e,children:n})},FV=({children:t,...e})=>{const n=w.Children.toArray(t).map((r,i)=>w.isValidElement(r)?w.cloneElement(r,{"aria-colindex":i+1,coords:{col:i+1,row:e["aria-rowindex"]}}):r);return u.jsx(re,{tag:"tr",...e,children:n})},VV=C.styled(ri)`
|
|
1798
|
+
font-size: 0.5rem;
|
|
1799
|
+
path {
|
|
1800
|
+
fill: ${({theme:t})=>t.colors.neutral500};
|
|
1801
|
+
}
|
|
1802
|
+
`,ww=C.styled(a2)`
|
|
1803
|
+
font-size: 1rem;
|
|
1804
|
+
path {
|
|
1805
|
+
fill: ${({theme:t})=>t.colors.neutral500};
|
|
1806
|
+
}
|
|
1807
|
+
`,_V=C.styled.div`
|
|
1808
|
+
border-radius: ${({theme:t})=>t.borderRadius};
|
|
1809
|
+
border: 1px solid ${({theme:t})=>t.colors.neutral150}
|
|
1810
|
+
|
|
1811
|
+
&:focus-within {
|
|
1812
|
+
${ww} {
|
|
1813
|
+
fill: ${({theme:t})=>t.colors.primary600};
|
|
1814
|
+
}
|
|
1815
|
+
}
|
|
1816
|
+
`,zV=C.styled(mc)`
|
|
1817
|
+
border: 1px solid ${({theme:t})=>t.colors.neutral150}
|
|
1818
|
+
height: 16px;
|
|
1819
|
+
padding: 0 0 0 8px;
|
|
1820
|
+
color: ${({theme:t})=>t.colors.neutral800};
|
|
1821
|
+
|
|
1822
|
+
&::placeholder {
|
|
1823
|
+
color: ${({theme:t})=>t.colors.neutral500};
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1826
|
+
&:hover {
|
|
1827
|
+
button {
|
|
1828
|
+
cursor: pointer;
|
|
1829
|
+
}
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1832
|
+
${Er()}
|
|
1833
|
+
`,HV=w.forwardRef(({name:t,children:e,value:n="",onClear:r,clearLabel:i="Clear",...o},s)=>{const a=w.useRef(null),l=n.length>0,c=h=>{r(h),a.current.focus()},d=Bx(s,a);return u.jsx(_V,{children:u.jsxs(Jr,{name:t,children:[u.jsx(Mr,{children:u.jsx(Uf,{children:e})}),u.jsx(zV,{size:"S",ref:d,value:n,startAction:u.jsx(ww,{"aria-hidden":!0}),endAction:l?u.jsx(At,{onClick:c,onMouseDown:h=>{h.preventDefault()},label:i,size:"XS",variant:"ghost",type:"button",children:u.jsx(VV,{})}):void 0,...o})]})})}),PV=C.styled(re)`
|
|
1834
|
+
display: inline-flex;
|
|
1835
|
+
border: none;
|
|
1836
|
+
|
|
1837
|
+
& > svg {
|
|
1838
|
+
height: 1.2rem;
|
|
1839
|
+
width: 1.2rem;
|
|
1840
|
+
}
|
|
1841
|
+
|
|
1842
|
+
& > svg path {
|
|
1843
|
+
fill: ${({theme:t,...e})=>e["aria-disabled"]?t.colors.neutral600:t.colors.primary600};
|
|
1844
|
+
}
|
|
1845
|
+
|
|
1846
|
+
&:hover {
|
|
1847
|
+
cursor: ${({$iconAction:t})=>t?"pointer":"initial"};
|
|
1848
|
+
}
|
|
1849
|
+
`,yw=({children:t,icon:e,label:n,disabled:r=!1,onClick:i,...o})=>{const s=a=>{r||!i||i(a)};return u.jsxs(Y,{inline:!0,background:r?"neutral200":"primary100",color:r?"neutral700":"primary600",paddingLeft:3,paddingRight:1,borderColor:r?"neutral300":"primary200",hasRadius:!0,height:"3.2rem",...o,children:[u.jsx(WV,{$disabled:r,variant:"pi",fontWeight:"bold",children:t}),u.jsx(PV,{tag:"button",disabled:r,"aria-disabled":r,"aria-label":n,padding:2,onClick:s,$iconAction:!!i,children:e})]})},WV=C.styled(ee)`
|
|
1850
|
+
color: inherit;
|
|
1851
|
+
border-right: 1px solid ${({theme:t,$disabled:e})=>e?t.colors.neutral300:t.colors.primary200};
|
|
1852
|
+
padding-right: ${({theme:t})=>t.spaces[2]};
|
|
1853
|
+
`,wi=w.forwardRef(({children:t,clearLabel:e="Clear",customizeContent:n,disabled:r,hasError:i,id:o,name:s,onChange:a,onClear:l,onCloseAutoFocus:c,onReachEnd:d,placeholder:h,required:f,size:m,startIcon:g,value:b,withTags:v,...x},y)=>{const $=w.useRef(null),[k,S]=w.useState(),[R,A]=w.useState(!1),I=ce=>{a?a(ce):S(ce)},E=ce=>()=>{const Ce=Array.isArray(b)?b.filter(P=>P!==ce):(k??[]).filter(P=>P!==ce);a?a(Ce):S(Ce)},j=ce=>{A(ce)},O=fn(),D=`intersection-${Xi(O)}`;Ms($,ce=>{d&&d(ce)},{selectorToWatch:`#${D}`,skipWhen:!R});const V=typeof b<"u"&&b!==null?b:k,q=ce=>ce&&typeof ce=="object"&&ce.value?u.jsx(yw,{tabIndex:-1,disabled:r,icon:u.jsx(ri,{width:`${14/16}rem`,height:`${14/16}rem`}),onClick:E(ce.value),children:ce.textValue},ce.value):null,{error:J,...W}=Bt("MultiSelect"),K=!!J||i,F=W.id??o,Q=W.name??s,pe=W.required??f;let we;return J?we=`${F}-error`:W.hint&&(we=`${F}-hint`),u.jsxs(iw,{onOpenChange:j,disabled:r,required:pe,onValueChange:I,value:V,...x,multi:!0,children:[u.jsx(ow,{ref:y,id:F,name:Q,"aria-label":x["aria-label"],"aria-describedby":we??x["aria-describedby"],startIcon:g,hasError:K,disabled:r,clearLabel:e,onClear:V?.length?l:void 0,withTags:!!(v&&(V?.length??!1)),size:m,children:u.jsx(sw,{placeholder:h,textColor:V?.length?"neutral800":"neutral600",children:V?.length?v?q:n?n(V):void 0:void 0})}),u.jsx(aw,{children:u.jsx(lw,{position:"popper",sideOffset:4,onCloseAutoFocus:c,children:u.jsxs(cw,{ref:$,children:[t,u.jsx(re,{id:D,width:"100%",height:"1px"})]})})})]})}),Br=w.forwardRef(({value:t,children:e,startIcon:n,...r},i)=>u.jsxs(Kf,{ref:i,value:t.toString(),...r,children:[n&&u.jsx(re,{tag:"span","aria-hidden":!0,children:n}),u.jsx(dw,{children:({isSelected:o,isIntermediate:s})=>u.jsx(cs,{checked:s?"indeterminate":o})}),u.jsx(ee,{children:u.jsx(uw,{children:e})})]}));w.forwardRef(({children:t,label:e,startIcon:n,values:r=[],...i},o)=>u.jsxs(TF,{ref:o,children:[u.jsxs(Kf,{value:r,...i,children:[n&&u.jsx(re,{tag:"span","aria-hidden":!0,children:n}),u.jsx(dw,{children:({isSelected:s,isIntermediate:a})=>u.jsx(cs,{checked:a?"indeterminate":s})}),u.jsx(ee,{children:e})]}),t]}));C.styled(Br)`
|
|
1854
|
+
padding-left: ${({theme:t})=>t.spaces[7]};
|
|
1855
|
+
`;const qV="23.2rem";w.forwardRef(({...t},e)=>u.jsx(UV,{ref:e,...t,tag:"nav"}));const UV=C.styled(re)`
|
|
1856
|
+
width: ${qV};
|
|
1857
|
+
background: ${({theme:t})=>t.colors.neutral100};
|
|
1858
|
+
position: sticky;
|
|
1859
|
+
top: 0;
|
|
1860
|
+
height: 100vh;
|
|
1861
|
+
overflow-y: auto;
|
|
1862
|
+
border-right: 1px solid ${({theme:t})=>t.colors.neutral200};
|
|
1863
|
+
z-index: 1;
|
|
1864
|
+
`;C.styled(ji)`
|
|
1865
|
+
width: 2.4rem;
|
|
1866
|
+
background-color: ${({theme:t})=>t.colors.neutral200};
|
|
1867
|
+
`;Mt(({active:t,children:e,icon:n=null,withBullet:r=!1,isSubSectionChild:i=!1,...o},s)=>u.jsxs(KV,{background:"neutral100",paddingLeft:i?9:7,paddingBottom:2,paddingTop:2,ref:s,...o,children:[u.jsxs(Y,{children:[n?u.jsx(GV,{children:n}):u.jsx(Uu,{$active:t}),u.jsx(ee,{paddingLeft:2,children:e})]}),r&&u.jsx(Y,{paddingRight:4,children:u.jsx(Uu,{$active:!0})})]}));const Uu=C.styled.span`
|
|
1868
|
+
width: 0.4rem;
|
|
1869
|
+
height: 0.4rem;
|
|
1870
|
+
background-color: ${({theme:t,$active:e})=>e?t.colors.primary600:t.colors.neutral600};
|
|
1871
|
+
border-radius: 50%;
|
|
1872
|
+
`,KV=C.styled(Ts)`
|
|
1873
|
+
display: flex;
|
|
1874
|
+
align-items: center;
|
|
1875
|
+
justify-content: space-between;
|
|
1876
|
+
text-decoration: none;
|
|
1877
|
+
color: ${({theme:t})=>t.colors.neutral800};
|
|
1878
|
+
svg > * {
|
|
1879
|
+
fill: ${({theme:t})=>t.colors.neutral600};
|
|
1880
|
+
}
|
|
1881
|
+
|
|
1882
|
+
&.active {
|
|
1883
|
+
${({theme:t})=>C.css`
|
|
1884
|
+
background-color: ${t.colors.primary100};
|
|
1885
|
+
border-right: 2px solid ${t.colors.primary600};
|
|
1886
|
+
color: ${t.colors.primary700};
|
|
1887
|
+
font-weight: 500;
|
|
1888
|
+
`}
|
|
1889
|
+
|
|
1890
|
+
${Uu} {
|
|
1891
|
+
background-color: ${({theme:t})=>t.colors.primary600};
|
|
1892
|
+
}
|
|
1893
|
+
}
|
|
1894
|
+
|
|
1895
|
+
&:focus-visible {
|
|
1896
|
+
outline-offset: -2px;
|
|
1897
|
+
}
|
|
1898
|
+
`,GV=C.styled.div`
|
|
1899
|
+
svg {
|
|
1900
|
+
height: 1.6rem;
|
|
1901
|
+
width: 1.6rem;
|
|
1902
|
+
}
|
|
1903
|
+
`;C.styled.button`
|
|
1904
|
+
border: none;
|
|
1905
|
+
padding: 0;
|
|
1906
|
+
background: transparent;
|
|
1907
|
+
display: flex;
|
|
1908
|
+
align-items: center;
|
|
1909
|
+
`;C.styled(re)`
|
|
1910
|
+
& > svg {
|
|
1911
|
+
height: 0.4rem;
|
|
1912
|
+
fill: ${({theme:t})=>t.colors.neutral500};
|
|
1913
|
+
}
|
|
1914
|
+
`;w.forwardRef(({visibleLabels:t,onLabel:e="On",offLabel:n="Off",onCheckedChange:r,checked:i,defaultChecked:o,disabled:s,...a},l)=>{const[c,d]=An({prop:i,defaultProp:o}),h=f=>{d(f)};return u.jsxs(Y,{gap:3,children:[u.jsx(YV,{ref:l,onCheckedChange:Fr(r,h),checked:c,disabled:s,...a,children:u.jsx(XV,{})}),t?u.jsx(QV,{"aria-hidden":!0,"data-disabled":s,"data-state":c?"checked":"unchecked",children:c?e:n}):null]})});const YV=C.styled(VL)`
|
|
1915
|
+
width: 4rem;
|
|
1916
|
+
height: 2.4rem;
|
|
1917
|
+
border-radius: 1.2rem;
|
|
1918
|
+
background-color: ${({theme:t})=>t.colors.danger500};
|
|
1919
|
+
|
|
1920
|
+
&[data-state='checked'] {
|
|
1921
|
+
background-color: ${({theme:t})=>t.colors.success500};
|
|
1922
|
+
}
|
|
1923
|
+
|
|
1924
|
+
&[data-disabled] {
|
|
1925
|
+
background-color: ${({theme:t})=>t.colors.neutral300};
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1928
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1929
|
+
transition: ${t=>t.theme.transitions.backgroundColor};
|
|
1930
|
+
}
|
|
1931
|
+
`,XV=C.styled(_L)`
|
|
1932
|
+
display: block;
|
|
1933
|
+
height: 1.6rem;
|
|
1934
|
+
width: 1.6rem;
|
|
1935
|
+
border-radius: 50%;
|
|
1936
|
+
background-color: ${({theme:t})=>t.colors.neutral0};
|
|
1937
|
+
transform: translateX(4px);
|
|
1938
|
+
|
|
1939
|
+
&[data-state='checked'] {
|
|
1940
|
+
transform: translateX(20px);
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1943
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1944
|
+
transition: transform ${t=>t.theme.motion.timings[120]}
|
|
1945
|
+
${t=>t.theme.motion.easings.authenticMotion};
|
|
1946
|
+
}
|
|
1947
|
+
`,QV=C.styled(ee)`
|
|
1948
|
+
color: ${t=>t.theme.colors.danger600};
|
|
1949
|
+
|
|
1950
|
+
&[data-state='checked'] {
|
|
1951
|
+
color: ${t=>t.theme.colors.success600};
|
|
1952
|
+
}
|
|
1953
|
+
|
|
1954
|
+
&[data-disabled='true'] {
|
|
1955
|
+
color: ${({theme:t})=>t.colors.neutral500};
|
|
1956
|
+
}
|
|
1957
|
+
`,[ZV,Yf]=Rs("Tabs");w.forwardRef(({disabled:t=!1,variant:e="regular",hasError:n,...r},i)=>u.jsx(ZV,{disabled:t,hasError:n,variant:e,children:u.jsx(JV,{ref:i,...r})}));const JV=C.styled(XL)`
|
|
1958
|
+
width: 100%;
|
|
1959
|
+
position: relative;
|
|
1960
|
+
`;w.forwardRef((t,e)=>{const{variant:n}=Yf("List");return u.jsx(e_,{ref:e,...t,$variant:n})});const e_=C.styled(QL)`
|
|
1961
|
+
display: flex;
|
|
1962
|
+
align-items: ${t=>t.$variant==="regular"?"flex-end":"unset"};
|
|
1963
|
+
position: relative;
|
|
1964
|
+
z-index: 0;
|
|
1965
|
+
`;w.forwardRef(({children:t,disabled:e,...n},r)=>{const{disabled:i,variant:o,hasError:s}=Yf("Trigger"),a=i===!0||i===n.value||e,l=s===n.value;return u.jsxs(t_,{ref:r,...n,$hasError:l,$variant:o,disabled:a,children:[u.jsx($w,{fontWeight:"bold",variant:o==="simple"?"sigma":void 0,children:t}),o==="simple"?u.jsx(Cw,{}):null]})});const Cw=C.styled.span`
|
|
1966
|
+
display: block;
|
|
1967
|
+
width: 100%;
|
|
1968
|
+
background-color: currentColor;
|
|
1969
|
+
position: absolute;
|
|
1970
|
+
bottom: 0;
|
|
1971
|
+
left: 0;
|
|
1972
|
+
opacity: 0;
|
|
1973
|
+
height: 0.2rem;
|
|
1974
|
+
`,$w=C.styled(ee)``,t_=C.styled(ZL)`
|
|
1975
|
+
position: relative;
|
|
1976
|
+
color: ${t=>t.$hasError?t.theme.colors.danger600:t.theme.colors.neutral600};
|
|
1977
|
+
cursor: pointer;
|
|
1978
|
+
z-index: 0;
|
|
1979
|
+
|
|
1980
|
+
${t=>t.$variant==="simple"?C.css`
|
|
1981
|
+
padding-block: ${e=>e.theme.spaces[4]};
|
|
1982
|
+
padding-inline: ${e=>e.theme.spaces[4]};
|
|
1983
|
+
|
|
1984
|
+
& > ${$w} {
|
|
1985
|
+
line-height: 1.2rem;
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
&[data-state='active'] {
|
|
1989
|
+
color: ${t.$hasError?t.theme.colors.danger600:t.theme.colors.primary700};
|
|
1990
|
+
|
|
1991
|
+
& > ${Cw} {
|
|
1992
|
+
opacity: 1;
|
|
1993
|
+
}
|
|
1994
|
+
}
|
|
1995
|
+
`:C.css`
|
|
1996
|
+
padding-block: ${e=>e.theme.spaces[3]};
|
|
1997
|
+
padding-inline: ${e=>e.theme.spaces[3]};
|
|
1998
|
+
flex: 1;
|
|
1999
|
+
background-color: ${e=>e.theme.colors.neutral100};
|
|
2000
|
+
border-bottom: solid 1px ${e=>e.theme.colors.neutral150};
|
|
2001
|
+
|
|
2002
|
+
&:not([data-state='active']) + &:not([data-state='active']) {
|
|
2003
|
+
border-left: solid 1px ${e=>e.theme.colors.neutral150};
|
|
2004
|
+
}
|
|
2005
|
+
|
|
2006
|
+
&[data-state='active'] {
|
|
2007
|
+
padding-block: ${e=>e.theme.spaces[4]};
|
|
2008
|
+
padding-inline: ${e=>e.theme.spaces[4]};
|
|
2009
|
+
color: ${t.$hasError?t.theme.colors.danger600:t.theme.colors.primary700};
|
|
2010
|
+
border-top-right-radius: ${e=>e.theme.borderRadius};
|
|
2011
|
+
border-top-left-radius: ${e=>e.theme.borderRadius};
|
|
2012
|
+
background-color: ${e=>e.theme.colors.neutral0};
|
|
2013
|
+
border-bottom: solid 1px ${e=>e.theme.colors.neutral0};
|
|
2014
|
+
box-shadow: ${t.theme.shadows.tableShadow};
|
|
2015
|
+
z-index: 1;
|
|
2016
|
+
}
|
|
2017
|
+
`}
|
|
2018
|
+
|
|
2019
|
+
&[data-disabled] {
|
|
2020
|
+
cursor: not-allowed;
|
|
2021
|
+
color: ${t=>t.theme.colors.neutral400};
|
|
2022
|
+
}
|
|
2023
|
+
`;w.forwardRef((t,e)=>{const{variant:n}=Yf("Content");return u.jsx(n_,{$variant:n,ref:e,...t})});const n_=C.styled(JL)`
|
|
2024
|
+
${t=>t.$variant==="simple"?C.css``:C.css`
|
|
2025
|
+
position: relative;
|
|
2026
|
+
z-index: 1;
|
|
2027
|
+
background-color: ${e=>e.theme.colors.neutral0};
|
|
2028
|
+
`}
|
|
2029
|
+
`,r_=C.styled(re)`
|
|
2030
|
+
overflow: hidden;
|
|
2031
|
+
border: 1px solid ${({theme:t})=>t.colors.neutral150};
|
|
2032
|
+
`,i_=C.styled(OV)`
|
|
2033
|
+
width: 100%;
|
|
2034
|
+
white-space: nowrap;
|
|
2035
|
+
`,o_=C.styled(re)`
|
|
2036
|
+
&:before {
|
|
2037
|
+
// TODO: make sure to add a token for this weird stuff
|
|
2038
|
+
background: linear-gradient(90deg, #c0c0cf 0%, rgba(0, 0, 0, 0) 100%);
|
|
2039
|
+
opacity: 0.2;
|
|
2040
|
+
position: absolute;
|
|
2041
|
+
height: 100%;
|
|
2042
|
+
content: ${({$overflowing:t})=>t==="both"||t==="left"?"''":void 0};
|
|
2043
|
+
box-shadow: ${({theme:t})=>t.shadows.tableShadow};
|
|
2044
|
+
width: ${({theme:t})=>t.spaces[2]};
|
|
2045
|
+
left: 0;
|
|
2046
|
+
}
|
|
2047
|
+
|
|
2048
|
+
&:after {
|
|
2049
|
+
// TODO: make sure to add a token for this weird stuff
|
|
2050
|
+
background: linear-gradient(270deg, #c0c0cf 0%, rgba(0, 0, 0, 0) 100%);
|
|
2051
|
+
opacity: 0.2;
|
|
2052
|
+
position: absolute;
|
|
2053
|
+
height: 100%;
|
|
2054
|
+
content: ${({$overflowing:t})=>t==="both"||t==="right"?"''":void 0};
|
|
2055
|
+
box-shadow: ${({theme:t})=>t.shadows.tableShadow};
|
|
2056
|
+
width: ${({theme:t})=>t.spaces[2]};
|
|
2057
|
+
right: 0;
|
|
2058
|
+
top: 0;
|
|
2059
|
+
}
|
|
2060
|
+
`,s_=C.styled(re)`
|
|
2061
|
+
overflow-x: auto;
|
|
2062
|
+
`,Sw=w.forwardRef(({footer:t,...e},n)=>{const r=w.useRef(null),[i,o]=w.useState(),s=a=>{const l=a.target.scrollWidth-a.target.clientWidth;if(a.target.scrollLeft===0){o("right");return}if(a.target.scrollLeft===l){o("left");return}a.target.scrollLeft>0&&o("both")};return w.useEffect(()=>{r.current.scrollWidth>r.current.clientWidth&&o("right")},[]),u.jsxs(r_,{shadow:"tableShadow",hasRadius:!0,background:"neutral0",children:[u.jsx(o_,{$overflowing:i,position:"relative",children:u.jsx(s_,{ref:r,onScroll:s,paddingLeft:6,paddingRight:6,children:u.jsx(i_,{ref:n,...e})})}),t]})}),a_=C.styled(BV)`
|
|
2063
|
+
& tr:last-of-type {
|
|
2064
|
+
border-bottom: none;
|
|
2065
|
+
}
|
|
2066
|
+
`,kw=({children:t,...e})=>u.jsx(a_,{...e,children:t}),l_=C.styled(NV)`
|
|
2067
|
+
border-bottom: 1px solid ${({theme:t})=>t.colors.neutral150};
|
|
2068
|
+
`,Aw=({children:t,...e})=>u.jsx(l_,{...e,children:t}),c_=C.styled(FV)`
|
|
2069
|
+
border-bottom: 1px solid ${({theme:t})=>t.colors.neutral150};
|
|
2070
|
+
|
|
2071
|
+
& td,
|
|
2072
|
+
& th {
|
|
2073
|
+
padding: ${({theme:t})=>t.spaces[4]};
|
|
2074
|
+
}
|
|
2075
|
+
|
|
2076
|
+
& td:first-of-type,
|
|
2077
|
+
& th:first-of-type {
|
|
2078
|
+
padding: 0 ${({theme:t})=>t.spaces[1]};
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2081
|
+
// Resetting padding values and fixing a height
|
|
2082
|
+
th {
|
|
2083
|
+
padding-top: 0;
|
|
2084
|
+
padding-bottom: 0;
|
|
2085
|
+
height: 5.6rem;
|
|
2086
|
+
}
|
|
2087
|
+
`,Cl=t=>u.jsx(c_,{...t}),Rw=C.styled(xw)`
|
|
2088
|
+
vertical-align: middle;
|
|
2089
|
+
text-align: left;
|
|
2090
|
+
outline-offset: -4px;
|
|
2091
|
+
|
|
2092
|
+
/**
|
|
2093
|
+
* Hack to make sure the checkbox looks aligned
|
|
2094
|
+
*/
|
|
2095
|
+
input {
|
|
2096
|
+
vertical-align: sub;
|
|
2097
|
+
}
|
|
2098
|
+
`,Zt=w.forwardRef(({children:t,action:e,...n},r)=>u.jsx(Rw,{color:"neutral600",as:LV,ref:r,...n,children:u.jsxs(Y,{children:[t,e]})})),Jt=w.forwardRef(({children:t,...e},n)=>u.jsx(Rw,{color:"neutral800",ref:n,...e,children:t})),d_=C.styled(re)`
|
|
2099
|
+
height: 2.4rem;
|
|
2100
|
+
width: 2.4rem;
|
|
2101
|
+
border-radius: 50%;
|
|
2102
|
+
display: flex;
|
|
2103
|
+
justify-content: center;
|
|
2104
|
+
align-items: center;
|
|
2105
|
+
|
|
2106
|
+
svg {
|
|
2107
|
+
height: 1rem;
|
|
2108
|
+
width: 1rem;
|
|
2109
|
+
}
|
|
2110
|
+
|
|
2111
|
+
svg path {
|
|
2112
|
+
fill: ${({theme:t})=>t.colors.primary600};
|
|
2113
|
+
}
|
|
2114
|
+
`,u_=C.styled(re)`
|
|
2115
|
+
border-radius: 0 0 ${({theme:t})=>t.borderRadius} ${({theme:t})=>t.borderRadius};
|
|
2116
|
+
display: block;
|
|
2117
|
+
width: 100%;
|
|
2118
|
+
border: none;
|
|
2119
|
+
`,h_=({children:t,icon:e,...n})=>u.jsxs("div",{children:[u.jsx(ji,{}),u.jsx(u_,{tag:"button",background:"primary100",padding:5,...n,children:u.jsxs(Y,{children:[u.jsx(d_,{"aria-hidden":!0,background:"primary200",children:e}),u.jsx(re,{paddingLeft:3,children:u.jsx(ee,{variant:"pi",fontWeight:"bold",textColor:"primary600",children:t})})]})})]}),f_=Mt(({children:t,startIcon:e,endIcon:n,disabled:r=!1,loading:i=!1,...o},s)=>{const a=r||i;return u.jsxs(g_,{ref:s,disabled:a,"aria-disabled":a,tag:"button",type:"button",gap:2,...o,children:[i?u.jsx(p_,{"aria-hidden":!0,children:u.jsx(o2,{})}):e,u.jsx(ee,{variant:"pi",children:t}),n]})}),m_=C.keyframes`
|
|
2120
|
+
from {
|
|
2121
|
+
transform: rotate(0deg);
|
|
2122
|
+
}
|
|
2123
|
+
to {
|
|
2124
|
+
transform: rotate(359deg);
|
|
2125
|
+
}
|
|
2126
|
+
`,p_=C.styled.span`
|
|
2127
|
+
display: flex;
|
|
2128
|
+
animation: ${m_} 2s infinite linear;
|
|
2129
|
+
will-change: transform;
|
|
2130
|
+
`,g_=C.styled(Y)`
|
|
2131
|
+
border: none;
|
|
2132
|
+
background-color: transparent;
|
|
2133
|
+
color: ${t=>t.theme.colors.primary600};
|
|
2134
|
+
cursor: pointer;
|
|
2135
|
+
|
|
2136
|
+
&[aria-disabled='true'] {
|
|
2137
|
+
pointer-events: none;
|
|
2138
|
+
color: ${t=>t.theme.colors.neutral600};
|
|
2139
|
+
}
|
|
2140
|
+
|
|
2141
|
+
${uc}
|
|
2142
|
+
`,$r=w.forwardRef((t,e)=>u.jsx(mc,{ref:e,...t}));$r.displayName="TextInput";w.forwardRef(({disabled:t,hasError:e,id:n,name:r,required:i,...o},s)=>{const{error:a,...l}=Bt("Textarea"),c=!!a||e,d=l.id??n,h=l.name??r,f=l.required||i;let m;return a?m=`${d}-error`:l.hint&&(m=`${d}-hint`),u.jsx(b_,{borderColor:c?"danger600":"neutral200",$hasError:c,hasRadius:!0,children:u.jsx(v_,{"aria-invalid":c,"aria-required":f,tag:"textarea",background:t?"neutral150":"neutral0",color:t?"neutral600":"neutral800",disabled:t,fontSize:2,hasRadius:!0,ref:s,lineHeight:4,padding:4,width:"100%",height:"100%",id:d,name:h,"aria-describedby":m,...o})})});const b_=C.styled(re)`
|
|
2143
|
+
height: 10.5rem;
|
|
2144
|
+
${Er()}
|
|
2145
|
+
`,v_=C.styled(re)`
|
|
2146
|
+
border: none;
|
|
2147
|
+
resize: none;
|
|
2148
|
+
|
|
2149
|
+
::placeholder {
|
|
2150
|
+
color: ${({theme:t})=>t.colors.neutral500};
|
|
2151
|
+
font-size: ${({theme:t})=>t.fontSizes[2]};
|
|
2152
|
+
color: ${({theme:t})=>t.colors.neutral500};
|
|
2153
|
+
opacity: 1;
|
|
2154
|
+
}
|
|
2155
|
+
|
|
2156
|
+
&:focus-within {
|
|
2157
|
+
outline: none;
|
|
2158
|
+
}
|
|
2159
|
+
|
|
2160
|
+
&:disabled {
|
|
2161
|
+
cursor: not-allowed;
|
|
2162
|
+
}
|
|
2163
|
+
`,$n=w.forwardRef(({offLabel:t,onLabel:e,disabled:n,hasError:r,required:i,id:o,name:s,checked:a,onChange:l,...c},d)=>{const[h=!1,f]=An({prop:a}),m=h!==null&&!h,{error:g,...b}=Bt("Toggle"),v=!!g||r,x=b.id??o,y=b.name??s,$=b.required||i;let k;return g?k=`${x}-error`:b.hint&&(k=`${x}-hint`),u.jsxs(x_,{position:"relative",hasRadius:!0,padding:1,background:n?"neutral150":"neutral100",borderStyle:"solid",borderWidth:"1px",borderColor:"neutral200",wrap:"wrap",cursor:n?"not-allowed":"pointer",$hasError:v,children:[u.jsx(np,{hasRadius:!0,flex:"1 1 50%",paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3,justifyContent:"center",background:n&&m?"neutral200":m?"neutral0":"transparent",borderColor:n&&m?"neutral300":m?"neutral200":n?"neutral150":"neutral100",children:u.jsx(ee,{variant:"pi",fontWeight:"bold",textTransform:"uppercase",textColor:n?"neutral700":m?"danger700":"neutral600",children:t})}),u.jsx(np,{hasRadius:!0,flex:"1 1 50%",paddingLeft:3,paddingRight:3,justifyContent:"center",background:n&&h?"neutral200":h?"neutral0":"transparent",borderColor:n&&h?"neutral300":h?"neutral200":n?"neutral150":"neutral100",children:u.jsx(ee,{variant:"pi",fontWeight:"bold",textTransform:"uppercase",textColor:n?"neutral700":h?"primary600":"neutral600",children:e})}),u.jsx(w_,{...c,id:x,name:y,ref:d,onChange:S=>{f(S.currentTarget.checked),l?.(S)},type:"checkbox","aria-required":$,disabled:n,"aria-disabled":n,checked:!!h,"aria-describedby":k})]})}),x_=C.styled(Y)`
|
|
2164
|
+
${Er()}
|
|
2165
|
+
`,np=C.styled(Y)`
|
|
2166
|
+
padding-block: 0.6rem;
|
|
2167
|
+
`,w_=C.styled.input`
|
|
2168
|
+
height: 100%;
|
|
2169
|
+
left: 0;
|
|
2170
|
+
opacity: 0;
|
|
2171
|
+
position: absolute;
|
|
2172
|
+
top: 0;
|
|
2173
|
+
z-index: 0;
|
|
2174
|
+
width: 100%;
|
|
2175
|
+
`,y_=Mt((t,e)=>{const{gap:n=0,gridCols:r=12,...i}=t;return u.jsx(C_,{ref:e,$gap:n,$gridCols:r,...i})}),C_=C.styled(re)`
|
|
2176
|
+
display: grid;
|
|
2177
|
+
grid-template-columns: repeat(${({$gridCols:t})=>t}, 1fr);
|
|
2178
|
+
${({theme:t,$gap:e})=>dc({gap:e},t)}
|
|
2179
|
+
`,$_=Mt(({col:t,s:e,xs:n,m:r,...i},o)=>u.jsx(S_,{ref:o,$col:t,$s:e,$xs:n,$m:r,...i})),S_=C.styled(Y)`
|
|
2180
|
+
grid-column: span ${({$xs:t})=>t??12};
|
|
2181
|
+
max-width: 100%;
|
|
2182
|
+
|
|
2183
|
+
${({theme:t})=>t.breakpoints.small} {
|
|
2184
|
+
grid-column: span ${({$s:t,$xs:e})=>t??e??12};
|
|
2185
|
+
}
|
|
2186
|
+
|
|
2187
|
+
${({theme:t})=>t.breakpoints.medium} {
|
|
2188
|
+
grid-column: span ${({$m:t,$s:e,$xs:n})=>t??e??n??12};
|
|
2189
|
+
}
|
|
2190
|
+
|
|
2191
|
+
${({theme:t})=>t.breakpoints.large} {
|
|
2192
|
+
grid-column: span ${({$col:t,$m:e,$s:n,$xs:r})=>t??e??n??r??12};
|
|
2193
|
+
}
|
|
2194
|
+
`,de=Object.freeze(Object.defineProperty({__proto__:null,Item:$_,Root:y_},Symbol.toStringTag,{value:"Module"})),rp={en:()=>Promise.resolve().then(()=>require("../_chunks/en-CKowl_sX.js")),fr:()=>Promise.resolve().then(()=>require("../_chunks/fr-BjVniZne.js")),ca:()=>Promise.resolve().then(()=>require("../_chunks/ca-BzGBgdJx.js"))},Ku=t=>`${Qt}.${t}`,M=(t,e)=>({id:Ku(t),defaultMessage:e??Ku(t)}),md=t=>`plugin::navigation.${t}`,pd={read:"read",update:"update",settings:"settings"},Hr={access:[{action:md(pd.read),subject:null}],update:[{action:md(pd.update),subject:null}],settings:[{action:md(pd.settings),subject:null}]},Xf=z.z.object({name:z.z.string().refine(t=>!t.includes(" "),{message:"No space allowed"}),label:z.z.string(),required:z.z.boolean().optional(),enabled:z.z.boolean().optional()}),k_=Xf.extend({type:z.z.literal("select"),multi:z.z.boolean(),options:z.z.array(z.z.string())}),A_=Xf.extend({type:z.z.enum(["boolean","string"]),multi:z.z.literal(!1).optional(),options:z.z.array(z.z.string()).max(0).optional()}),R_=Xf.extend({type:z.z.literal("media"),multi:z.z.literal(!1).optional(),options:z.z.array(z.z.string()).max(0).optional()}),Tw=z.z.union([A_,R_,k_]),T_=z.z.union([z.z.literal("audience"),Tw]),M_=z.z.object({additionalFields:z.z.array(T_),allowedLevels:z.z.number(),availableAudience:z.z.object({id:z.z.number(),documentId:z.z.string(),name:z.z.string(),key:z.z.string()}).array(),contentTypes:z.z.array(z.z.string()),contentTypesNameFields:z.z.record(z.z.string(),z.z.array(z.z.string())),contentTypesPopulate:z.z.record(z.z.string(),z.z.array(z.z.string())),gql:z.z.object({navigationItemRelated:z.z.array(z.z.string())}),pathDefaultFields:z.z.record(z.z.string(),z.z.any()),cascadeMenuAttached:z.z.boolean(),preferCustomContentTypes:z.z.boolean(),isCacheEnabled:z.z.boolean().optional(),isCachePluginEnabled:z.z.boolean().optional()}),E_=z.z.object({uid:z.z.string(),isDisplayed:z.z.boolean(),apiID:z.z.string(),kind:z.z.enum(["collectionType","singleType"]),info:z.z.object({singularName:z.z.string(),pluralName:z.z.string(),displayName:z.z.string(),description:z.z.string().optional()}),attributes:z.z.record(z.z.string(),z.z.unknown())}),I_=T.object({id:T.number(),documentId:T.string(),name:T.string(),key:T.string()}),Mw=T.enum(["INTERNAL","EXTERNAL","WRAPPER"]),j_=T.object({id:T.number(),documentId:T.string(),title:T.string(),type:Mw,path:T.string(),externalPath:T.string().or(T.null()).optional(),uiRouterKey:T.string(),menuAttached:T.boolean(),order:T.number().int(),collapsed:T.boolean(),autoSync:T.boolean().or(T.null()).optional(),related:T.object({documentId:T.string().optional(),__type:T.string()}).catchall(T.unknown()).nullish(),additionalFields:T.record(T.string(),T.unknown()).or(T.null()).optional(),audience:T.array(I_).or(T.null()).optional(),viewId:T.number().optional(),viewParentId:T.number().optional(),structureId:T.string().optional(),removed:T.boolean().optional(),isSearchActive:T.boolean().optional(),updated:T.boolean().optional()}),Ew=j_.extend({items:T.lazy(()=>Ew.array().or(T.null())).optional()}),ip=T.object({id:T.number(),documentId:T.string(),name:T.string(),slug:T.string(),locale:T.string(),visible:T.boolean(),items:T.array(Ew)}),Qf=T.object({name:T.string().refine(t=>!t.includes(" "),{message:"No space allowed"}),label:T.string(),required:T.boolean().optional(),enabled:T.boolean().optional()}),D_=Qf.extend({type:T.literal("select"),multi:T.boolean(),options:T.array(T.string())}),O_=Qf.extend({type:T.enum(["boolean","string"]),multi:T.literal(!1).optional(),options:T.array(T.string()).max(0).optional()}),L_=Qf.extend({type:T.literal("media"),multi:T.literal(!1).optional(),options:T.array(T.string()).max(0).optional()}),N_=O_.or(L_).or(D_),B_=T.union([T.literal("audience"),N_]),F_=T.object({uid:T.string(),name:T.string(),draftAndPublish:T.boolean(),isSingle:T.boolean(),description:T.string(),collectionName:T.string(),contentTypeName:T.string(),label:T.string(),labelSingular:T.string(),endpoint:T.string(),available:T.boolean(),visible:T.boolean()}),V_=T.object({additionalFields:T.array(B_),allowedLevels:T.number(),availableAudience:T.object({id:T.number(),documentId:T.string(),name:T.string(),key:T.string()}).array(),contentTypes:T.array(T.string()),contentTypesNameFields:T.record(T.string(),T.array(T.string())),contentTypesPopulate:T.record(T.string(),T.array(T.string())),gql:T.object({navigationItemRelated:T.array(T.string())}),pathDefaultFields:T.record(T.string(),T.string().array()),cascadeMenuAttached:T.boolean(),preferCustomContentTypes:T.boolean(),allowedContentTypes:T.string().array(),restrictedContentTypes:T.string().array(),isCacheEnabled:T.boolean().optional(),isCachePluginEnabled:T.boolean().optional()}),op=V_.omit({contentTypes:!0}).extend({contentTypes:F_.array()}),__=T.object({defaultLocale:T.string(),restLocale:T.string().array()}),z_=T.enum(["collectionType","singleType"]),H_=T.object({singularName:T.string(),pluralName:T.string(),displayName:T.string(),description:T.string().optional(),name:T.string().optional()}),Iw=T.object({required:T.boolean().optional(),max:T.number().optional(),min:T.number().optional(),minLength:T.number().optional(),maxLength:T.number().optional(),private:T.boolean().optional(),configurable:T.boolean().optional(),default:T.any().optional()}),P_=T.enum(["string","text","richtext","blocks","email","password","date","time","datetime","timestamp","boolean","integer","biginteger","float","decimal","json","relation","media"]),W_=Iw.extend({type:P_}),q_=Iw.extend({type:T.literal("enumeration"),enum:T.string().array()}),U_=T.object({type:T.literal("component"),component:T.string(),repeatable:T.boolean().optional()}),K_=T.object({type:T.literal("dynamiczone"),components:T.string().array()}),G_=T.object({media:T.literal("media"),allowedTypes:T.enum(["images","videos","audios","files"]).array(),required:T.boolean().optional()}),Y_=T.enum(["oneToOne","oneToMany","manyToOne","manyToMany","morphToMany","manyToMorph"]),X_=T.object({type:T.literal("relation"),relation:Y_,target:T.string(),mappedBy:T.string().optional(),inversedBy:T.string().optional()}),Q_=T.record(T.string(),T.union([W_,q_,U_,K_,X_,G_])),Z_=T.object({kind:z_,collectionName:T.string(),info:H_,options:T.object({draftAndPublish:T.boolean().optional(),hidden:T.boolean().optional(),templateName:T.string().optional()}).optional(),attributes:Q_,actions:T.record(T.string(),T.any()).optional(),lifecycles:T.record(T.string(),T.any()).optional(),uid:T.string(),apiName:T.string().optional(),associations:T.object({model:T.string(),alias:T.string()}).array().optional(),modelName:T.string().optional(),plugin:T.string().optional(),pluginOptions:T.record(T.string(),T.any()).optional(),isSingle:T.boolean().optional()});Z_.pick({info:!0,kind:!0,attributes:!0,options:!0});const J_=T.object({id:T.number(),documentId:T.string(),locale:T.string().or(T.null()).optional()}).and(T.record(T.string(),T.any())),ez=T.object({slug:T.string()}),tz=T.object({externalPath:T.string().or(T.null()).optional(),path:T.string().or(T.null()).optional(),related:T.object({documentId:T.string().optional(),__type:T.string()}).catchall(T.unknown()).nullish(),title:T.string(),type:Mw,uiRouterKey:T.string()}),Ue="navigation",it=ue.once(t=>({getIndexPrefix(){return[Ue]},readAll(){return t.get(`/${Ue}`).then(({data:e})=>ip.array().parse(e))},readAllIndex(){return[Ue,"navigations"]},delete(e){return t.del(`/${Ue}/${e}`)},create(e){return t.post(`/${Ue}/`,e)},update(e){return t.put(`/${Ue}/${e.documentId}`,e).then(({data:n})=>n).then(ip.parse)},purge({documentId:e,withLangVersions:n}){return t.del(`/${Ue}/cache/purge/${e??""}?clearLocalisations=${!!n}`)},slugify(e){const n=new URLSearchParams;return n.append("q",e),t.get(`/${Ue}/slug?${n.toString()}`).then(({data:r})=>ez.parse(r)).then(({slug:r})=>r)},readConfig(){return t.get(`/${Ue}/config`).then(({data:e})=>op.parse(e))},readConfigIndex(){return[Ue,"config"]},healthCheck(){return t.get("/_health")},healthCheckIndex(){return["health"]},readNavigationItemFromLocale({source:e,structureId:n,target:r,documentId:i}){return t.get(`/${Ue}/i18n/item/read/${i}/${e}/${r}?path=${n}`)},updateConfig(e){return t.put(`/${Ue}/config`,e).then(()=>{})},restart(){return t.get(`/${Ue}/settings/restart`).then(()=>{})},restoreConfig(){return t.del(`/${Ue}/config`).then(()=>{})},readSettingsConfig(){return t.get(`/${Ue}/settings/config`).then(({data:e})=>{const n=op.parse(e);return{...n,contentTypes:n.contentTypes.map(({uid:r})=>r)}})},readSettingsConfigIndex(){return[Ue,"config"]},readContentType(){return t.get("/content-manager/content-types").then(({data:e})=>E_.array().parse(e.data))},readContentTypeIndex(){return[Ue,"content-manager","content-types"]},readContentTypeItems({uid:e,locale:n,query:r}){const i=new URLSearchParams;return r&&i.append("_q",r),n&&i.append("locale",n),t.get(`/${Ue}/content-type-items/${e}?${i.toString()}`).then(({data:o})=>J_.array().parse(o))},readContentTypeItemsIndex({uid:e,locale:n,query:r}){return[Ue,"content-manager","content-type-items",e,n,r]},readLocale(){return t.get(`/${Ue}/settings/locale`).then(e=>__.parse(e.data))},readLocaleIndex(){return[Ue,"locale"]},copyNavigationLocale({documentId:e,source:n,target:r}){return t.put(`/${Ue}/i18n/copy/${e}/${n}/${r}`)},copyNavigationItemLocale({source:e,structureId:n="",target:r}){return t.get(`/${Ue}/i18n/item/read/${e}/${r}?path=${n}`).then(i=>tz.parse(i.data))}})),nz=u.jsx(l2,{}),Zf=({isVisible:t=!1,isActionAsync:e=!1,children:n,onConfirm:r,onCancel:i,header:o,labelCancel:s,labelConfirm:a,iconConfirm:l,mainIcon:c=nz})=>{const{formatMessage:d}=Ve.useIntl();return t?u.jsx(wo.Root,{open:t,onOpenChange:h=>{!h&&t&&i?.(void 0)},title:o||d(M("components.confirmation.dialog.header","Confirmation")),children:u.jsxs(wo.Content,{children:[u.jsx(wo.Body,{icon:c,children:u.jsx(Y,{justifyContent:"center",children:u.jsx(ee,{id:"dialog-confirm-description",children:n||d(M("components.confirmation.dialog.description"))})})}),u.jsxs(wo.Footer,{children:[u.jsx(wo.Cancel,{children:u.jsx(Xe,{fullWidth:!0,onClick:i,variant:"tertiary",disabled:e,children:s||d(M("components.confirmation.dialog.button.cancel","Cancel"))})}),u.jsx(Xe,{fullWidth:!0,onClick:r,variant:"danger-light",startIcon:l||u.jsx(Ho,{}),disabled:e,children:a||d(M("components.confirmation.dialog.button.confirm","Confirm"))})]})]})}):null},sp=u.jsx(u.Fragment,{}),rz=({onConfirm:t,onCancel:e})=>{const{formatMessage:n}=Ve.useIntl();return u.jsx(Zf,{isVisible:!0,header:n(M("pages.view.actions.i18nCopyItems.confirmation.header")),labelConfirm:n(M("pages.view.actions.i18nCopyItems.confirmation.confirm")),iconConfirm:sp,mainIcon:sp,onConfirm:t,onCancel:e,children:n(M("pages.view.actions.i18nCopyItems.confirmation.content"))})},Jf=()=>{const t=Se.getFetchClient(),e=it(t);return Fe.useQuery({queryKey:e.readLocaleIndex(),queryFn:e.readLocale,staleTime:1/0})},jw=t=>{const e=Se.getFetchClient(),n=it(e);return Fe.useQuery({queryKey:n.readContentTypeItemsIndex(t),queryFn:()=>n.readContentTypeItems(t),staleTime:1e3*60*3,enabled:!!t.uid})},iz=()=>{const t=Se.getFetchClient(),e=it(t);return Fe.useQuery({queryKey:e.readContentTypeIndex(),queryFn:()=>e.readContentType(),staleTime:1e3*60*3})},oz=()=>{const t=Se.getFetchClient(),e=it(t),n=Fe.useQueryClient();return()=>{n.resetQueries({queryKey:e.readAllIndex()})}},sz=()=>{const t=Se.getFetchClient(),e=it(t),n=Fe.useQueryClient();return()=>{n.resetQueries({queryKey:e.readContentTypeIndex()})}},e0=()=>{const t=Se.getFetchClient(),e=it(t);return Fe.useQuery({queryKey:e.readAllIndex(),queryFn(){return e.readAll().then(n=>n.map(r=>({...r,items:r.items.map($l)})))},staleTime:1e3*60*5})},az=()=>{const t=Fe.useQueryClient(),e=Se.getFetchClient(),n=it(e);return p.useCallback(()=>{t.invalidateQueries({queryKey:n.getIndexPrefix()})},[t,e,n])},lz=()=>{const t=Se.getFetchClient(),e=it(t);return Fe.useMutation({mutationFn(n){return Promise.all(n.map(e.delete))}})},cz=()=>{const t=Se.getFetchClient(),e=it(t);return Fe.useMutation({mutationFn:e.copyNavigationItemLocale})},dz=()=>{const t=Se.getFetchClient(),e=it(t),n=Fe.useQueryClient();return Fe.useMutation({mutationFn:e.copyNavigationLocale,onSuccess(){n.invalidateQueries({queryKey:e.readAllIndex()})}})},uz=()=>{const t=Se.getFetchClient(),e=it(t),n=Fe.useQueryClient();return Fe.useMutation({mutationFn:e.create,onSuccess(){n.invalidateQueries({queryKey:e.readAllIndex()})}})},Dw=t=>{const e=Se.getFetchClient(),n=it(e),r=Fe.useQueryClient();return Fe.useMutation({mutationFn:n.update,onSuccess(i){r.invalidateQueries({queryKey:n.readAllIndex()}),t?.(i)}})},Ow=()=>{const t=Se.getFetchClient(),e=it(t);return Fe.useMutation({mutationFn(n){return n?.length?Promise.all(n.map(r=>e.purge({documentId:r,withLangVersions:!0}))):e.purge({})}})},js=()=>{const t=Se.getFetchClient(),e=it(t);return Fe.useQuery({queryKey:e.readConfigIndex(),queryFn:e.readConfig})},hz=t=>{const[e,n]=p.useState(!1),[r,i]=p.useState(void 0),o=p.useCallback(()=>{n(!1)},[n]),s=p.useCallback(()=>{r&&(t(r),n(!1))},[t,r]),a=p.useMemo(()=>e?u.jsx(rz,{onConfirm:s,onCancel:o}):null,[e,s,o]);return p.useMemo(()=>({setI18nCopyModalOpened:n,setI18nCopySourceLocale:i,i18nCopyItemsModal:a,i18nCopySourceLocale:r}),[i,n,a,r])},$l=t=>({...t,viewId:Math.floor(Math.random()*152e4),items:t.items?.map($l)}),$o=(t=[])=>ue.orderBy(t,["order"],["asc"]).map((e,n)=>{const r=n+1;return{...e,order:r,updated:e.updated||r!==e.order}}),ba=(t,e)=>t.type==="INTERNAL"?{type:"INTERNAL",collapsed:!!t.collapsed,id:t.id,documentId:t.documentId,menuAttached:!!t.menuAttached,order:t.order??0,path:t.path,title:t.title,uiRouterKey:t.uiRouterKey,additionalFields:t.additionalFields,audience:t.audience?.map(n=>e.availableAudience.find(r=>r.documentId===n))??[],autoSync:t.autoSync,items:t.items?.length?Di(t,t.items,e):t.items,related:{__type:t.relatedType,documentId:t.related},viewId:t.viewId,viewParentId:t.viewParentId,structureId:t.structureId,removed:t.removed,updated:t.updated}:t.type==="EXTERNAL"?{type:"EXTERNAL",collapsed:!!t.collapsed,id:t.id,documentId:t.documentId,menuAttached:!!t.menuAttached,order:t.order??0,title:t.title,uiRouterKey:t.uiRouterKey,additionalFields:t.additionalFields,autoSync:t.autoSync,items:t.items?.length?Di(t,t.items,e):t.items,path:"",viewId:t.viewId,structureId:t.structureId,viewParentId:t.viewParentId,removed:t.removed,updated:t.updated,externalPath:t.externalPath??"",audience:t.audience?.map(n=>e.availableAudience.find(r=>r.documentId===n))??[]}:{type:"WRAPPER",collapsed:!!t.collapsed,id:t.id,documentId:t.documentId,menuAttached:!!t.menuAttached,order:t.order??0,path:t.path??"",title:t.title,uiRouterKey:t.uiRouterKey,additionalFields:t.additionalFields,audience:t.audience?.map(n=>e.availableAudience.find(r=>r.documentId===n))??[],autoSync:t.autoSync,items:t.items?.length?Di(t,t.items,e):t.items,viewId:t.viewId,viewParentId:t.viewParentId,structureId:t.structureId,removed:t.removed,updated:t.updated},Di=(t,e=[],n)=>{if(!t.viewParentId){if(t.viewId){const i=e.map(o=>o.viewId===t.viewId?ba(t,n):{...o,items:o.items?.length?Di(t,o.items,n):o.items});return $o(i)}return[...$o([...e,ba({...t,viewId:Date.now()},n)])]}const r=e.map(i=>{const o=i.items||[];if(t.viewParentId===i.viewId){if(!t.viewId)return{...i,items:[...$o([...o,ba({...t,viewId:Date.now()},n)])]};const s=o.map(a=>a.viewId===t.viewId?ba(t,n):a);return{...i,items:$o(s)}}return{...i,items:i.items?.length?Di(t,i.items,n):i.items}});return $o(r)},Sl=(t,e)=>{const n=e?.contentTypes??[],r=e?.contentTypesNameFields??{},i=r.default??[],{__collectionUid:o}=t,s=n.find(({uid:d})=>d===o);if(s?.isSingle)return s.labelSingular;const a=[...i,...i.map(d=>ue.capitalize(d))],l=ue.get(r,`${s?s.uid:o}`,a),c=(ue.isEmpty(l)?a:l).map(d=>t[d]).filter(d=>d);return ue.first(c)||""},fz=({relatedRef:t,relatedType:e={},type:n,isCollection:r})=>r?e.available||t.available:n==="INTERNAL"&&(t?"publishedAt"in t:!1)?ue.get(t,"publishedAt",!0):!0,mr=(t,e=!1)=>{const{__type:n,documentId:r}=t.type==="INTERNAL"&&t.related?t.related:{__type:"",documentId:""};return t.type==="INTERNAL"?{type:"INTERNAL",id:t.id,documentId:t.documentId,additionalFields:t.additionalFields??{},path:t.path??"",relatedType:n,related:r,title:t.title,uiRouterKey:t.uiRouterKey,autoSync:t.autoSync??void 0,collapsed:t.collapsed,externalPath:void 0,order:t.order??0,menuAttached:t.menuAttached,viewId:t.viewId,viewParentId:t.viewParentId,items:e?t.items:t.items?.map(i=>mr(i))??void 0,removed:t.removed,updated:t.updated,isSearchActive:t.isSearchActive}:t.type==="EXTERNAL"?{type:"EXTERNAL",id:t.id,documentId:t.documentId,additionalFields:t.additionalFields??{},title:t.title,uiRouterKey:t.uiRouterKey,autoSync:t.autoSync??void 0,collapsed:t.collapsed,externalPath:t.externalPath,order:t.order??0,menuAttached:t.menuAttached,viewId:t.viewId,viewParentId:t.viewParentId,items:e?t.items:t.items?.map(i=>mr(i))??void 0,removed:t.removed,updated:t.updated,isSearchActive:t.isSearchActive}:{type:"WRAPPER",id:t.id,documentId:t.documentId,additionalFields:t.additionalFields??{},title:t.title,uiRouterKey:t.uiRouterKey,autoSync:t.autoSync??void 0,collapsed:t.collapsed,order:t.order??0,menuAttached:t.menuAttached,viewId:t.viewId,viewParentId:t.viewParentId,items:e?t.items:t.items?.map(i=>mr(i))??void 0,removed:t.removed,updated:t.updated,isSearchActive:t.isSearchActive,path:t.path??""}},Lw=t=>t.find(({isPending:e})=>e),yi=(t,e)=>t.collapsed!==e?{...t,collapsed:e,updated:!0,items:t.items?.map(n=>yi(n,e))}:{...t,items:t.items?.map(n=>yi(n,e))},co=({start:t,end:e})=>u.jsxs(dt.Footer,{children:[u.jsx(dt.Close,{children:ap(t)}),ap(e)]}),ap=t=>t?u.jsx(Xe,{onClick:t.onClick,variant:t.variant,disabled:t.disabled,children:t.children}):null,mz=({alreadyUsedNames:t})=>z.z.object({name:z.z.string().min(2).and(z.z.string().refine(e=>!t.includes(e),"Name already used")),visible:z.z.boolean()}),Nw=({navigation:t,onChange:e,alreadyUsedNames:n=[],isLoading:r})=>{const[i,o]=p.useState({}),[s,a]=p.useState(),{formatMessage:l}=Ve.useIntl(),{name:c,visible:d}=i,h=(g,b,v)=>{if(v){let x=g,y=b;if(ue.isObject(g)){const{name:$,value:k}=g.target;x=$,y=ue.isNil(y)?k:y}return ue.isString(x)&&f(x,y),v(g,y)}},f=(g,b)=>{o(ue.set({...i},g,b))},m=g=>{const b=ue.get(s,g);if(b)return b};return p.useEffect(()=>{t&&(t.name?o({...t}):(o({name:"New navigation",visible:!0}),e({name:"New navigation",visible:!0,disabled:!0})))},[]),p.useEffect(()=>{if(`${c}-${d}`!=`${t.name}-${t.visible}`){const{error:g}=mz({alreadyUsedNames:n}).safeParse(i);e({...t,name:c,visible:d,disabled:!ue.isEmpty(g?.issues)}),a(g?g.issues.reduce((b,v)=>({...b,[v.path.join(".")]:v.message}),{}):void 0)}},[c,d]),u.jsx(Se.Form,{width:"auto",height:"auto",method:"POST",initialValues:i,children:({values:g,onChange:b})=>u.jsxs(de.Root,{gap:5,children:[u.jsx(de.Item,{col:6,children:u.jsx(je.Field,{name:"name",label:l(M("popup.navigation.form.name.label","Name")),error:m("name"),children:u.jsx($r,{name:"name",type:"string",placeholder:l(M("popup.navigation.form.name.placeholder","Navigations's name")),onChange:(v,x)=>h(v,x,b),value:g.name,disabled:r})})}),u.jsx(de.Item,{col:6,children:u.jsx(je.Field,{name:"visible",label:l(M("popup.navigation.form.visible.label","Visibility")),error:m("visible"),children:u.jsx($n,{name:"visible",checked:g.visible,onChange:v=>h(v,!g.visible,b),onLabel:l(M("popup.navigation.form.visible.toggle.visible")),offLabel:l(M("popup.navigation.form.visible.toggle.hidden")),disabled:r,width:"100%"})})})]})})},pz={name:"",items:[],visible:!1},gz=({setState:t,current:e,isLoading:n,alreadyUsedNames:r})=>{const i=p.useCallback(({disabled:o,...s})=>{t({view:"CREATE",current:s,alreadyUsedNames:r,disabled:o})},[t]);return u.jsx(Nw,{alreadyUsedNames:r,navigation:e,onChange:i,isLoading:n})},bz=({onSubmit:t,onReset:e,disabled:n,isLoading:r})=>{const{formatMessage:i}=Ve.useIntl();return u.jsx(co,{start:{children:i(M("popup.item.form.button.cancel")),variant:"tertiary",disabled:r,onClick:e},end:{children:i(M("popup.navigation.manage.button.save")),variant:"default",disabled:r||n,onClick:t}})},vz=u.jsx(Yh,{}),xz=u.jsx(Qh,{}),lp=u.jsx(A8,{}),wz=({navigations:t,selected:e,setState:n})=>{const r=js(),i=!!e.length,{formatMessage:o}=Ve.useIntl(),s=Jf(),a=p.useCallback(()=>n({navigations:t,selected:i?[]:t.map(v=>v),view:"LIST"}),[n,t,i]),l=p.useMemo(()=>new Set(e.map(Oa.prop("documentId"))),[e]),c=(v,x)=>()=>{n({navigations:t,selected:x?e.filter(({documentId:y})=>y!==v.documentId):e.concat([v]),view:"LIST"})},d=v=>()=>{n({view:"EDIT",current:v,navigation:v,alreadyUsedNames:t.reduce((x,{name:y})=>y!==v.name?x.concat([y]):x,[])})},h=v=>()=>{n({view:"DELETE",navigations:v})},f=v=>()=>{n({view:"CACHE_PURGE",navigations:v})},m=p.useCallback(h(e),[h]),g=p.useCallback(f(e),[f]),b=v=>[v].concat(t.filter(x=>x.documentId===v.documentId&&x.locale!==v.locale));return u.jsxs(u.Fragment,{children:[u.jsx(de.Root,{children:u.jsx(de.Item,{col:12,paddingBottom:3,children:i?u.jsxs(Y,{direction:"row",gap:1,children:[u.jsx(re,{paddingRight:3,children:o(M("popup.navigation.manage.table.hasSelected"),{count:e.length})}),u.jsx(Xe,{onClick:m,variant:"tertiary",children:o(M("popup.navigation.manage.button.delete"))}),r.data?.isCacheEnabled?u.jsx(Xe,{onClick:g,variant:"tertiary",children:o(M("popup.navigation.manage.button.purge"))}):null]}):null})}),u.jsxs(Sw,{rowCount:t.length,colCount:6,children:[u.jsx(Aw,{children:u.jsxs(Cl,{children:[u.jsx(Zt,{children:u.jsx(cs,{onCheckedChange:a,check:i})}),u.jsx(Zt,{children:u.jsx(ee,{textColor:"neutral800",children:o(M("popup.navigation.manage.table.id"))})}),u.jsx(Zt,{children:u.jsx(ee,{textColor:"neutral800",children:o(M("popup.navigation.manage.table.name"))})}),u.jsx(Zt,{children:u.jsx(ee,{textColor:"neutral800",children:o(M("popup.navigation.manage.table.locale"))})}),u.jsx(Zt,{children:u.jsx(ee,{textColor:"neutral800",children:o(M("popup.navigation.manage.table.visibility"))})}),u.jsx(Zt,{children:r.data?.isCacheEnabled?u.jsx(Y,{direction:"row",children:u.jsx(re,{paddingLeft:1,children:u.jsx(At,{onClick:f([]),label:o(M("popup.navigation.manage.button.purge")),noBorder:!0,children:lp})})}):null})]})}),u.jsx(kw,{children:t.filter(({locale:v})=>v===s.data?.defaultLocale).map(v=>u.jsxs(Cl,{children:[u.jsx(Jt,{children:u.jsx(cs,{onCheckedChange:c(v,l.has(v.documentId)),checked:l.has(v.documentId)})}),u.jsx(Jt,{children:u.jsx(ee,{textColor:"neutral800",children:v.documentId})}),u.jsx(Jt,{children:u.jsx(ee,{textColor:"neutral800",children:v.name})}),u.jsx(Jt,{children:u.jsx(ee,{textColor:"neutral800",children:b(v).map(Oa.prop("locale")).join(", ")})}),u.jsx(Jt,{children:u.jsx(ee,{textColor:"neutral800",children:v.visible?o(M("popup.navigation.manage.navigation.visible")):o(M("popup.navigation.manage.navigation.hidden"))})}),u.jsx(Jt,{children:u.jsxs(Y,{width:"100%",direction:"row",alignItems:"center",justifyContent:"flex-end",children:[u.jsx(re,{paddingLeft:1,children:u.jsx(At,{onClick:d(v),label:o(M("popup.navigation.manage.button.edit")),noBorder:!0,children:vz})}),u.jsx(re,{paddingLeft:1,children:u.jsx(At,{onClick:h([v]),label:o(M("popup.navigation.manage.button.delete")),noBorder:!0,children:xz})}),r.data?.isCacheEnabled?u.jsx(re,{paddingLeft:1,children:u.jsx(At,{onClick:f([v]),label:o(M("popup.navigation.manage.button.purge")),noBorder:!0,children:lp})}):null]})})]},v.documentId))})]})]})},yz=({onClose:t,state:e,setState:n,navigations:r,isLoading:i})=>{const{formatMessage:o}=Ve.useIntl();return u.jsx(co,{start:{onClick:t,variant:"tertiary",disabled:i,children:o(M("popup.item.form.button.cancel"))},end:{onClick:()=>n({view:"CREATE",alreadyUsedNames:r.map(({name:s})=>s),current:pz}),variant:"default",disabled:i,children:o(M("popup.navigation.manage.button.create"))}})},Cz=({navigations:t})=>{const{formatMessage:e}=Ve.useIntl();return u.jsxs(de.Root,{children:[u.jsx(de.Item,{col:12,paddingBottom:1,children:u.jsx(Y,{children:u.jsx(ee,{variant:"beta",children:e(M("popup.navigation.manage.delete.header"))})})}),u.jsx(de.Item,{col:12,paddingBottom:1,children:u.jsx(ee,{variant:"omega",fontWeight:"semiBold",children:Sz(t)})})]})},$z=({state:t,onSubmit:e,onReset:n,isLoading:r})=>{const{formatMessage:i}=Ve.useIntl();return u.jsx(co,{start:{children:i(M("popup.item.form.button.cancel")),disabled:r,onClick:n,variant:"tertiary"},end:{children:i(M("popup.navigation.manage.button.delete")),disabled:r,onClick:e,variant:"danger"}})},Sz=t=>t.map(Oa.prop("name")).join(", "),kz=({errors:t})=>{const{formatMessage:e}=Ve.useIntl(),{toggleNotification:n}=Se.useNotification();return p.useEffect(()=>{t.map(r=>{n({type:"warning",message:e({id:"",defaultMessage:r.message})}),console.error(r)})},[]),u.jsx(de.Root,{children:u.jsx(de.Item,{col:12,children:e(M("popup.navigation.manage.error.message"))})})},Az=({onReset:t})=>{const{formatMessage:e}=Ve.useIntl();return u.jsx(co,{end:{children:e(M("popup.navigation.manage.button.goBack")),onClick:t,variant:"secondary"}})},Rz=({alreadyUsedNames:t,current:e,isLoading:n,navigation:r,setState:i})=>{const o=p.useMemo(()=>e??r,[e]),s=p.useCallback(({disabled:a,...l})=>{i({view:"EDIT",alreadyUsedNames:t,current:l,disabled:a,navigation:r})},[i,r,t]);return u.jsx(Nw,{navigation:o,onChange:s,isLoading:n,alreadyUsedNames:t})},Tz=({onSubmit:t,onReset:e,disabled:n,isLoading:r})=>{const{formatMessage:i}=Ve.useIntl();return u.jsx(co,{start:{children:i(M("popup.item.form.button.cancel")),disabled:r,onClick:e,variant:"tertiary"},end:{children:i(M("popup.navigation.manage.button.save")),disabled:r||n,onClick:t,variant:"secondary"}})},Mz=({navigations:t})=>{const{formatMessage:e}=Ve.useIntl();return u.jsxs(de.Root,{children:[u.jsx(de.Item,{col:12,paddingBottom:1,children:u.jsx(Y,{children:u.jsx(ee,{variant:"beta",children:e(M("popup.navigation.manage.purge.header"))})})}),u.jsx(de.Item,{col:12,paddingBottom:1,children:u.jsx(ee,{variant:"omega",fontWeight:"semiBold",children:Iz(t)})})]})},Ez=({onSubmit:t,onReset:e,isLoading:n})=>{const{formatMessage:r}=Ve.useIntl();return u.jsx(co,{start:{children:r(M("popup.item.form.button.cancel")),disabled:n,onClick:e,variant:"tertiary"},end:{children:r(M("popup.navigation.manage.footer.button.purge")),disabled:n,onClick:t,variant:"danger"}})},Iz=t=>t.map(Oa.prop("name")).join(", "),jz=({initialState:t,isOpened:e,onClose:n})=>{const{formatMessage:r}=Ve.useIntl(),[i,o]=p.useState(t),{toggleNotification:s}=Se.useNotification(),a=az(),l=lz(),c=uz(),d=Dw(),h=Ow(),f=e0(),m=Jf(),g=p.useMemo(()=>ue.sortBy(f.data??[],"id"),[f.data]),b=Lw([l,f,c,d,h,m]),v=p.useCallback(()=>o({view:"INITIAL"}),[o]),x=p.useCallback(async()=>{const S=i.view==="DELETE"?()=>{l.mutate(i.navigations.reduce((R,A)=>(A.documentId&&R.push(A.documentId),R),[]),{onSuccess:a})}:i.view==="EDIT"?()=>{d.mutate(i.current,{onSuccess(){a(),s({type:"success",message:r(M("notification.navigation.submit"))})},onError(R){console.warn(R),s({type:"warning",message:r(M("notification.navigation.error"),{errorTitles:""})})}})}:i.view==="CREATE"&&i.current?()=>{c.mutate(i.current,{onSuccess(){a(),s({type:"success",message:r(M("notification.navigation.submit"))})},onError(R){console.warn(R),s({type:"warning",message:r(M("notification.navigation.error"),{errorTitles:""})})}})}:i.view==="CACHE_PURGE"?()=>{h.mutate(i.navigations.reduce((R,A)=>(A.documentId&&R.push(A.documentId),R),[]),{onSuccess:a})}:()=>{};try{S(),o({view:"INITIAL"})}catch(R){o({view:"ERROR",errors:R instanceof Error?[R]:[]})}},[i,o,a,c,h,d,l,s,r,M]);p.useEffect(()=>{(i.view==="INITIAL"||i.view==="LIST")&&o({view:"LIST",navigations:g,selected:[]})},[i.view,g]);const y=Dz(i,r,!!b),$=Oz(i,o,!!b),k=Lz({state:i,setState:o,onClose:n,onSubmit:x,onReset:v,navigations:g,isLoading:!!b});return u.jsx(dt.Root,{labelledBy:"condition-modal-breadcrumbs",onOpenChange:S=>{S||n?.()},open:e,children:u.jsxs(dt.Content,{children:[u.jsx(dt.Header,{children:u.jsx(ee,{variant:"omega",fontWeight:"bold",textColor:"neutral800",as:"h2",children:y})}),u.jsx(dt.Body,{children:$}),k]})})},Dz=(t,e,n)=>{switch(t.view){case"LIST":case"CREATE":case"ERROR":case"CACHE_PURGE":case"DELETE":return u.jsxs(Y,{direction:"row",children:[n?u.jsx(yl,{small:!0}):null,e(M(`popup.navigation.manage.header.${t.view}`))]});case"EDIT":return u.jsxs(Y,{direction:"row",children:[n?u.jsx(yl,{small:!0}):null,e(M("popup.navigation.manage.header.EDIT"),{name:t.navigation.name})]});case"INITIAL":return null;default:return t0(t)}},Oz=(t,e,n)=>{const r={setState:e,isLoading:n};switch(t.view){case"LIST":return u.jsx(wz,{...t,...r});case"EDIT":return u.jsx(Rz,{...t,...r});case"CREATE":return u.jsx(gz,{...t,...r});case"DELETE":return u.jsx(Cz,{...t,...r});case"CACHE_PURGE":return u.jsx(Mz,{...t,...r});case"INITIAL":return u.jsx(yl,{small:!0});case"ERROR":return u.jsx(kz,{...t,...r});default:return t0(t)}},Lz=t=>{switch(t.state.view){case"LIST":return u.jsx(yz,{...t});case"CREATE":return u.jsx(bz,{...t,disabled:t.state.disabled});case"EDIT":return u.jsx(Tz,{...t,disabled:t.state.disabled});case"DELETE":return u.jsx($z,{...t});case"CACHE_PURGE":return u.jsx(Ez,{...t});case"ERROR":return u.jsx(Az,{...t});case"INITIAL":return null;default:return t0(t.state)}},t0=t=>(console.warn(`Unknown state "${t?.view}". (${JSON.stringify(t)})`),null),Nz=()=>{const[t,e]=p.useState(!1),n=p.useCallback(()=>e(!0),[e]),r=p.useCallback(()=>e(!1),[e]),i=p.useMemo(()=>t?u.jsx(jz,{initialState:{view:"INITIAL"},isOpened:!0,onClose:r}):null,[t,r]);return p.useMemo(()=>({navigationManagerModal:i,openNavigationManagerModal:n,closeNavigationManagerModal:r}),[i,n,r])},cp=u.jsx(Ho,{}),Bz=({activeNavigation:t,availableNavigations:e,structureHasErrors:n,structureHasChanged:r,handleChangeSelection:i,handleLocalizationSelection:o,handleSave:s,handleCachePurge:a,permissions:l={},locale:c,currentLocale:d})=>{const{formatMessage:h}=Ve.useIntl(),{openNavigationManagerModal:f,navigationManagerModal:m}=Nz(),g=!!c.restLocale,{canUpdate:b}=l,v=js();return u.jsx(u.Fragment,{children:u.jsx(Se.Layouts.Header,{title:h(M("header.title","UI Navigation")),subtitle:h(M("header.description")),primaryAction:u.jsxs(Y,{direction:"row",size:2,children:[u.jsx(re,{children:u.jsxs(de.Root,{gap:4,style:v.data?.isCacheEnabled?{display:"flex"}:void 0,children:[g?null:u.jsx(de.Item,{col:2}),b&&u.jsx(de.Item,{col:3,children:u.jsx(Xe,{onClick:f,startIcon:null,type:"button",variant:"secondary",fullWidth:!0,size:"S",children:h(M("header.action.manage"))})}),u.jsx(de.Item,{col:b?4:10,children:u.jsx(_B.Root,{width:"100%",children:u.jsx(Jn,{type:"select",placeholder:"Change navigation",name:"navigationSelect",onChange:x=>{const y=e.find(({documentId:$})=>x===$);y&&i(y)},value:t?.documentId,size:"S",style:null,children:e.filter(({locale:x})=>x===d).map(({documentId:x,name:y})=>u.jsx(er,{value:x,children:y},x))})})}),g?u.jsx(de.Item,{col:2,children:u.jsx(Jn,{type:"select",placeholder:h(M("pages.main.header.localization.select.placeholder")),name:"navigationLocalizationSelect",onChange:o,value:d,size:"S",children:[c.defaultLocale,...c.restLocale].map(x=>u.jsx(er,{value:x,children:x},x))})}):null,b&&u.jsx(de.Item,{col:3,children:u.jsx(Xe,{onClick:s,startIcon:cp,disabled:n||!r,type:"submit",fullWidth:!0,size:"S",children:h(M("submit.cta.save"))})}),v.data?.isCacheEnabled&&u.jsx(de.Item,{col:3,children:u.jsx(Xe,{onClick:a,startIcon:cp,variant:"danger",type:"submit",fullWidth:!0,size:"S",children:h(M("submit.cta.cache.purge"))})})]})}),b&&m]}),secondaryAction:u.jsx(yw,{icon:u.jsx(i2,{"aria-hidden":!0}),children:t?h(M("header.meta"),{id:t?.documentId,key:t?.slug}):null})})})},Fz=({startActions:t,endActions:e})=>u.jsxs(Y,{justifyContent:"space-between",width:"100%",children:[u.jsx(Y,{alignItems:"space-between",children:t}),u.jsx(Y,{alignItems:"space-between",children:e})]}),Vz=En.default.div`
|
|
8
2195
|
border-radius: 50%;
|
|
9
2196
|
background: #dcdce4;
|
|
10
2197
|
width: 25px;
|
|
@@ -13,12 +2200,12 @@
|
|
|
13
2200
|
justify-content: center;
|
|
14
2201
|
align-items: center;
|
|
15
2202
|
margin-right: 8px;
|
|
16
|
-
`,
|
|
17
|
-
border: 1px solid ${({theme:
|
|
2203
|
+
`,_z=({toggle:t,collapsed:e,itemsCount:n})=>u.jsxs(Y,{justifyContent:"space-between",alignItems:"center",onClick:t,cursor:"pointer",style:{marginRight:"16px"},children:[u.jsx(Vz,{children:e?u.jsx(br,{width:"16px",height:"9px"}):u.jsx(b$,{width:"16px",height:"9px"})}),u.jsxs(ee,{variant:"pi",children:[n," nested items"]})]}),Bw=En.default(Lx)`
|
|
2204
|
+
border: 1px solid ${({theme:t,borderColor:e})=>t.colors[e]};
|
|
18
2205
|
|
|
19
|
-
${({small:
|
|
20
|
-
padding: ${
|
|
21
|
-
margin: 0px ${
|
|
2206
|
+
${({small:t,theme:e})=>t&&`
|
|
2207
|
+
padding: ${e.spaces[1]} ${e.spaces[2]};
|
|
2208
|
+
margin: 0px ${e.spaces[3]};
|
|
22
2209
|
vertical-align: middle;
|
|
23
2210
|
|
|
24
2211
|
cursor: default;
|
|
@@ -29,35 +2216,35 @@
|
|
|
29
2216
|
vertical-align: middle;
|
|
30
2217
|
}
|
|
31
2218
|
`}
|
|
32
|
-
`,
|
|
2219
|
+
`,zz=En.default.span`
|
|
33
2220
|
display: flex;
|
|
34
2221
|
align-items: center;
|
|
35
2222
|
justify-content: center;
|
|
36
2223
|
|
|
37
2224
|
height: 32px;
|
|
38
2225
|
width: 32px;
|
|
39
|
-
padding: ${({theme:
|
|
2226
|
+
padding: ${({theme:t})=>t.spaces[2]};
|
|
40
2227
|
|
|
41
|
-
background: ${({theme:
|
|
42
|
-
border: 1px solid ${({theme:
|
|
43
|
-
border-radius: ${({theme:
|
|
2228
|
+
background: ${({theme:t,isActive:e})=>e?t.colors.neutral150:t.colors.neutral0};
|
|
2229
|
+
border: 1px solid ${({theme:t})=>t.colors.neutral200};
|
|
2230
|
+
border-radius: ${({theme:t})=>t.borderRadius};
|
|
44
2231
|
cursor: pointer;
|
|
45
2232
|
transition: background-color 0.3s ease-in;
|
|
46
2233
|
|
|
47
2234
|
svg {
|
|
48
|
-
height: ${({theme:
|
|
49
|
-
width: ${({theme:
|
|
2235
|
+
height: ${({theme:t})=>t.spaces[3]};
|
|
2236
|
+
width: ${({theme:t})=>t.spaces[3]};
|
|
50
2237
|
|
|
51
2238
|
> g,
|
|
52
2239
|
path {
|
|
53
|
-
fill: ${({theme:
|
|
2240
|
+
fill: ${({theme:t})=>t.colors.neutral500};
|
|
54
2241
|
}
|
|
55
2242
|
}
|
|
56
2243
|
&:hover {
|
|
57
2244
|
svg {
|
|
58
2245
|
> g,
|
|
59
2246
|
path {
|
|
60
|
-
fill: ${({theme:
|
|
2247
|
+
fill: ${({theme:t})=>t.colors.neutral600};
|
|
61
2248
|
}
|
|
62
2249
|
}
|
|
63
2250
|
}
|
|
@@ -65,19 +2252,19 @@
|
|
|
65
2252
|
svg {
|
|
66
2253
|
> g,
|
|
67
2254
|
path {
|
|
68
|
-
fill: ${({theme:
|
|
2255
|
+
fill: ${({theme:t})=>t.colors.neutral400};
|
|
69
2256
|
}
|
|
70
2257
|
}
|
|
71
2258
|
}
|
|
72
2259
|
&[aria-disabled='true'] {
|
|
73
|
-
background-color: ${({theme:
|
|
2260
|
+
background-color: ${({theme:t})=>t.colors.neutral150};
|
|
74
2261
|
svg {
|
|
75
2262
|
path {
|
|
76
|
-
fill: ${({theme:
|
|
2263
|
+
fill: ${({theme:t})=>t.colors.neutral600};
|
|
77
2264
|
}
|
|
78
2265
|
}
|
|
79
2266
|
}
|
|
80
|
-
`,
|
|
2267
|
+
`,Hz=w.default.forwardRef((t,e)=>u.jsx(zz,{...t,ref:e,children:u.jsx(s8,{})})),Pz=En.default($B)`
|
|
81
2268
|
width: 100%;
|
|
82
2269
|
|
|
83
2270
|
display: flex;
|
|
@@ -86,12 +2273,12 @@
|
|
|
86
2273
|
align-items: center;
|
|
87
2274
|
|
|
88
2275
|
> div > * {
|
|
89
|
-
margin: 0px ${({theme:
|
|
2276
|
+
margin: 0px ${({theme:t})=>t.spaces[1]};
|
|
90
2277
|
}
|
|
91
|
-
`,
|
|
2278
|
+
`,Wz=u.jsx(Yh,{}),qz=u.jsx(Qh,{}),Uz=u.jsx(r2,{}),Kz=u.jsx(KC,{}),Gz={zIndex:2},Yz={maxWidth:"425px"},Xz=({title:t,path:e,icon:n,removed:r,canUpdate:i,onItemRemove:o,onItemEdit:s,onItemRestore:a,dragRef:l,isSearchActive:c})=>{const{formatMessage:d}=Ve.useIntl();return u.jsxs(Pz,{children:[u.jsxs(Y,{alignItems:"center",children:[i&&u.jsx(Hz,{ref:l,isActive:c}),u.jsx(ee,{variant:"omega",fontWeight:"bold",children:t}),u.jsx(ee,{variant:"omega",fontWeight:"bold",textColor:"neutral500",ellipsis:!0,style:Yz,children:e}),u.jsx(Y,{children:n})]}),u.jsxs(Y,{alignItems:"center",style:Gz,children:[r&&u.jsx(Bw,{borderColor:"danger200",backgroundColor:"danger100",textColor:"danger600",children:d(M("components.navigationItem.badge.removed"))}),u.jsxs(Wx,{children:[u.jsx(gd,{isActive:c,disabled:r,onClick:s,label:d(M(`components.navigationItem.action.${i?"edit":"view"}`,i?"Edit":"View")),children:i?Wz:Uz}),i&&u.jsx(u.Fragment,{children:r?u.jsx(gd,{isActive:c,onClick:a,label:d(M("components.navigationItem.action.restore","Restore")),variant:"success-light",children:Kz}):u.jsx(gd,{isActive:c,onClick:o,variant:"danger-light",label:d(M("components.navigationItem.action.remove","Remove")),children:qz})})]})]})]})},gd=En.default(At)`
|
|
92
2279
|
transition: background-color 0.3s ease-in;
|
|
93
|
-
${({isActive:
|
|
94
|
-
`,
|
|
2280
|
+
${({isActive:t,theme:e})=>t?`background-color: ${e.colors.neutral150} ;`:""}
|
|
2281
|
+
`,Qz=En.default.div`
|
|
95
2282
|
width: 100%;
|
|
96
2283
|
height: 100%;
|
|
97
2284
|
position: absolute;
|
|
@@ -100,22 +2287,22 @@
|
|
|
100
2287
|
z-index: 1;
|
|
101
2288
|
|
|
102
2289
|
background: rgba(255, 255, 255, 0.75);
|
|
103
|
-
`,
|
|
2290
|
+
`,Zz=En.default.div`
|
|
104
2291
|
position: relative;
|
|
105
|
-
margin-top: ${({theme:
|
|
106
|
-
margin-left: ${({level:
|
|
2292
|
+
margin-top: ${({theme:t})=>t.spaces[2]};
|
|
2293
|
+
margin-left: ${({level:t})=>t&&"54px"};
|
|
107
2294
|
|
|
108
|
-
${({level:
|
|
2295
|
+
${({level:t,theme:e,isLast:n})=>t&&`
|
|
109
2296
|
&::before {
|
|
110
|
-
${!
|
|
2297
|
+
${!n&&'content: "";'}
|
|
111
2298
|
display: block;
|
|
112
|
-
top: ${
|
|
2299
|
+
top: ${e.spaces[1]};
|
|
113
2300
|
left: -24px;
|
|
114
2301
|
position: absolute;
|
|
115
|
-
height: calc(100% + ${
|
|
2302
|
+
height: calc(100% + ${e.spaces[2]});
|
|
116
2303
|
width: 19px;
|
|
117
2304
|
border: 0px solid transparent;
|
|
118
|
-
border-left: 4px solid ${
|
|
2305
|
+
border-left: 4px solid ${e.colors.neutral300};
|
|
119
2306
|
}
|
|
120
2307
|
|
|
121
2308
|
&::after {
|
|
@@ -124,35 +2311,35 @@
|
|
|
124
2311
|
height: 22px;
|
|
125
2312
|
width: 19px;
|
|
126
2313
|
position: absolute;
|
|
127
|
-
top: ${
|
|
128
|
-
left: -${
|
|
2314
|
+
top: ${e.spaces[1]};
|
|
2315
|
+
left: -${e.spaces[6]};
|
|
129
2316
|
|
|
130
2317
|
background: transparent;
|
|
131
|
-
border: 4px solid ${
|
|
2318
|
+
border: 4px solid ${e.colors.neutral300};
|
|
132
2319
|
border-top: transparent;
|
|
133
2320
|
border-right: transparent;
|
|
134
2321
|
border-radius: 0 0 0 100%;
|
|
135
2322
|
}
|
|
136
2323
|
`};
|
|
137
|
-
`,
|
|
2324
|
+
`,Jz=({item:t,isLast:e=!1,level:n=0,levelPath:r="",isParentAttachedToMenu:i,onItemLevelAdd:o,onItemRemove:s,onItemRestore:a,onItemEdit:l,onItemReOrder:c,onItemToggleCollapse:d,displayChildren:h,permissions:f,structureId:m,viewParentId:g,locale:b})=>{const v=mr(t,!0),{formatMessage:x}=Ve.useIntl(),y=js(),$=v.type==="EXTERNAL",k=v.type==="WRAPPER",S=ue.isNumber(y.data?.allowedLevels)?n<y.data.allowedLevels-1:!0,R=ue.isNumber(y.data?.allowedLevels)?n<y.data.allowedLevels:!0,A=!ue.isEmpty(t.items)&&!h,I=$?void 0:`${r==="/"?"":r}/${v.path==="/"?"":v.path}`.replace("//","/"),E=jw({uid:v.type==="INTERNAL"?v.relatedType??"":"",locale:b}),O=iz().data?.find(ne=>v.type==="INTERNAL"?ne.uid===v.relatedType:!1),D=O?.uid.includes("api::"),B=E.data?.find(ne=>v.type==="INTERNAL"?ne.documentId===v.related:!1)??{documentId:"",id:0},V=!!B?.publishedAt,q=$?"":Sl(B,y.data),J=O?.info.displayName??"",W=V?"success":"secondary",K=f.canUpdate,F=p.useRef(null),Q=p.useRef(null),pe=p.useRef(null),[,we]=vd.useDrop({accept:`navigation-item_${r}`,hover(ne,ae){const be=ne.order??0,le=t.order??0;if(be===le)return;const Le=Q.current.getBoundingClientRect(),$e=(Le.bottom-Le.top)/2,Be=ae.getClientOffset();if(!Be)return;const se=Be.y-Le.top,Ge=se>$e?(t.order??0)+.5:(t.order??0)-.5;be<le&&se<$e||be>le&&se>$e||c({item:mr(ne,!0),newOrder:Ge})},collect:ne=>({isOverCurrent:ne.isOver({shallow:!0})})}),[{isDragging:ce},Ce,P]=vd.useDrag({type:`navigation-item_${r}`,item:()=>t,collect:ne=>({isDragging:ne.isDragging()})}),oe={dragRef:Ce(F),dropRef:we(Q),previewRef:P(pe)},_=ne=>{const ae=O?.kind==="singleType",be=ne?.locale?`?plugins[i18n][locale]=${ne?.locale}`:"";return`/admin/content-manager/${ae?"single-types":"collection-types"}/${O?.uid}${ae?"":"/"+ne?.documentId}${be}`},G=p.useCallback(ne=>{if(!K)return;const ae=(v.items??[]).reduce((be,{order:le})=>be<le?le:be,0);return o(ne,v.viewId,S,I,v.menuAttached,`${m}.${v.items?.length??0}`,ae)},[v.viewId,S,I,v.menuAttached,m,v.items,K]);p.useEffect(()=>{v.isSearchActive&&oe.dropRef?.current?.scrollIntoView?.({behavior:"smooth",block:"center",inline:"center"})},[v.isSearchActive,oe.dropRef.current]);const Z=C.useTheme();return u.jsxs(Zz,{level:n,isLast:e,style:{opacity:ce?.2:1},ref:oe?oe.dropRef:void 0,children:[u.jsxs(bB,{style:{width:"728px",zIndex:1,position:"relative",overflow:"hidden",backgroundColor:v.isSearchActive?Z.colors.secondary100:void 0,borderColor:v.isSearchActive?Z.colors.secondary200:void 0,transition:"background-color 0.3s ease-in"},children:[v.removed&&u.jsx(Qz,{}),u.jsxs("div",{ref:oe.previewRef,children:[u.jsx(Km,{children:u.jsx(Xz,{title:t.title??"",path:$?v.externalPath:I,icon:$?u.jsx(d8,{}):k?u.jsx(U$,{}):u.jsx(dS,{}),onItemRemove:()=>s({...t,viewParentId:g}),onItemEdit:()=>{const{__type:ne,documentId:ae}=t.related??{};t.type!=="EXTERNAL"&&t.type!=="INTERNAL"&&t.type!=="WRAPPER"||l({item:t.type==="INTERNAL"?{...t,type:"INTERNAL",isMenuAllowedLevel:R,isParentAttachedToMenu:i,isSearchActive:!1,relatedType:ne??"",related:ae??"",additionalFields:t.additionalFields??{},items:t.items??[],autoSync:t.autoSync??!0,externalPath:void 0,viewParentId:g,audience:t.audience?.map(({documentId:be})=>be)??[]}:t.type==="EXTERNAL"?{...t,type:"EXTERNAL",isMenuAllowedLevel:R,isParentAttachedToMenu:i,isSearchActive:!1,relatedType:void 0,related:void 0,additionalFields:t.additionalFields??{},items:t.items??[],autoSync:t.autoSync??!0,externalPath:t.externalPath??"",viewParentId:g,audience:t.audience?.map(({documentId:be})=>be)??[]}:{...t,type:"WRAPPER",isMenuAllowedLevel:R,isParentAttachedToMenu:i,isSearchActive:!1,additionalFields:t.additionalFields??{},items:t.items??[],autoSync:t.autoSync??!0,viewParentId:g,audience:t.audience?.map(({documentId:be})=>be)??[]},levelPath:r,isParentAttachedToMenu:i})},onItemRestore:()=>a({...t,viewParentId:g}),dragRef:oe.dragRef,removed:v.removed,canUpdate:K,isSearchActive:v.isSearchActive})}),u.jsx(ji,{}),u.jsx(Km,{style:{padding:"8px"},children:u.jsxs(Y,{style:{width:"100%"},direction:"row",alignItems:"center",justifyContent:"space-between",children:[u.jsxs(Y,{children:[!ue.isEmpty(t.items)&&u.jsx(_z,{toggle:()=>d({...t,viewParentId:g}),collapsed:v.collapsed,itemsCount:t.items?.length??0}),K&&S&&u.jsx(f_,{disabled:v.removed,startIcon:u.jsx(Xh,{}),onClick:G,children:u.jsx(ee,{variant:"pi",fontWeight:"bold",textColor:v.removed?"neutral600":"primary600",children:x(M("components.navigationItem.action.newItem"))})})]}),v.type==="INTERNAL"&&v.related&&!B.id?u.jsxs(Y,{justifyContent:"center",alignItems:"center",children:[u.jsxs(ee,{variant:"omega",textColor:"neutral600",children:[J," / "]}),u.jsx(ee,{variant:"omega",textColor:"neutral800",children:x(M("components.navigationItem.related.localeMissing"))})]}):null,q&&u.jsxs(Y,{justifyContent:"center",alignItems:"center",children:[u.jsx(Bw,{borderColor:`${W}200`,backgroundColor:`${W}100`,textColor:`${W}600`,className:"action",small:!0,children:x(M(`components.navigationItem.badge.${V?"published":"draft"}`))}),u.jsxs(ee,{variant:"omega",textColor:"neutral600",children:[J," / "]}),u.jsx(ee,{variant:"omega",textColor:"neutral800",children:q}),D&&u.jsx(qx,{href:_(B??void 0),endIcon:u.jsx(e$,{}),children:" "})]})]})})]})]}),A&&!v.removed&&!v.collapsed&&u.jsx(Fw,{onItemLevelAdd:o,onItemRemove:s,onItemEdit:l,onItemRestore:a,onItemReOrder:c,onItemToggleCollapse:d,isParentAttachedToMenu:v.menuAttached,items:t.items??[],level:n+1,levelPath:I,permissions:f,structurePrefix:m,viewParentId:v.viewId,locale:b})]})},eH=En.default.div`
|
|
138
2325
|
position: relative;
|
|
139
|
-
${({level:
|
|
2326
|
+
${({level:t,theme:e})=>t&&`
|
|
140
2327
|
&::before {
|
|
141
2328
|
content: "";
|
|
142
2329
|
display: block;
|
|
143
|
-
height: ${
|
|
2330
|
+
height: ${e.spaces[3]};
|
|
144
2331
|
width: 19px;
|
|
145
2332
|
|
|
146
2333
|
position: absolute;
|
|
147
|
-
top: -${
|
|
2334
|
+
top: -${e.spaces[2]};
|
|
148
2335
|
left: 30px;
|
|
149
2336
|
|
|
150
2337
|
border: 0px solid transparent;
|
|
151
|
-
border-left: 4px solid ${
|
|
2338
|
+
border-left: 4px solid ${e.colors.neutral300};
|
|
152
2339
|
}
|
|
153
2340
|
`};
|
|
154
|
-
`,Ft=({isParentAttachedToMenu:e=!1,items:n,level:i=0,levelPath:s="",onItemEdit:d,onItemLevelAdd:r,onItemRemove:h,onItemRestore:x,onItemReOrder:F,onItemToggleCollapse:g,displayFlat:f,permissions:S,structurePrefix:b,viewParentId:$,locale:I})=>t.jsx(ha,{"data-level":i,children:n?.map((T,u)=>t.jsx(ga,{item:T,isLast:u===n.length-1,level:i,levelPath:s,isParentAttachedToMenu:e,onItemRestore:x,onItemLevelAdd:r,onItemRemove:h,onItemEdit:d,onItemReOrder:F,onItemToggleCollapse:g,displayChildren:f,permissions:S,structureId:b?`${b}.${u}`:u.toString(),viewParentId:$,locale:I},`list-item-${T.viewId||u}`))}),fa="",ya={type:"media",multiple:!1,required:!1,allowedTypes:["images"],pluginOptions:{i18n:{localized:!1}}},xa=({name:e,field:n,isLoading:i,onChange:s,onChangeEnhancer:d,value:r,disabled:h})=>{const{toggleNotification:x}=P.useNotification(),{formatMessage:F}=H.useIntl(),f=P.useStrapiApp("AdditionalFieldInput",b=>b.fields).media,S=p.useMemo(()=>({id:n.name,name:e||n.name,disabled:i||h}),[n,i]);switch(p.useEffect(()=>{if(n.type==="media"){const b=j.isNull(r)?void 0:r;d(S.name,b,s)}},[r]),n.type){case"boolean":return t.jsx(a.Toggle,{...S,checked:!!r,onChange:b=>d(b,!r,s),onLabel:"true",offLabel:"false",type:"checkbox"});case"string":return t.jsx(a.TextInput,{...S,onChange:(b,$)=>d(b,$,s),value:r||fa});case"select":return n.multi?t.jsx(a.MultiSelect,{...S,onChange:b=>d(S.name,b,s),value:j.isNil(r)?n.multi?[]:null:r,multi:n.multi,withTags:n.multi,children:n.options.map((b,$)=>t.jsx(a.MultiSelectOption,{value:b,children:b},`${n.name}-option-${$}`))}):t.jsx(a.SingleSelect,{...S,onChange:b=>d(S.name,b,s),value:j.isNil(r)?n.multi?[]:null:r,multi:n.multi,withTags:n.multi,children:n.options.map((b,$)=>t.jsx(a.SingleSelectOption,{value:b,children:b},`${n.name}-option-${$}`))});case"media":return t.jsx(f,{...S,...ya,value:r});default:throw x({type:"warning",message:F(l("notification.error.customField.type"))}),new Error("Type of custom field is unsupported")}},ba=({handleCancel:e,handleSubmit:n,submitDisabled:i,canUpdate:s})=>{const{formatMessage:d}=H.useIntl();return s?t.jsxs(a.Modal.Footer,{children:[t.jsx(a.Modal.Close,{children:t.jsx(a.Button,{onClick:e,variant:"tertiary",children:d(l("popup.item.form.button.cancel"))})}),t.jsx(a.Button,{onClick:n,disabled:i,children:d(l("popup.item.form.button.save"))})]}):null},ja=[/^mailto:[\w-\.]+@([\w-]+\.)+[\w-]{2,}$/,/^tel:(\+\d{1,3})?[\s]?(\(?\d{2,3}\)?)?[\s.-]?(\d{3})?[\s.-]?\d{3,4}$/,/^#.*/,/(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/,/(\/[a-z0-9\-._~%!$&'()*+,;=:@]+)+\/?/],Ye=({additionalFields:e})=>c.z.object({title:c.z.string(),autoSync:c.z.boolean().optional(),removed:c.z.boolean().optional(),updated:c.z.boolean().optional(),uiRouterKey:c.z.string(),levelPath:c.z.string().optional(),isMenuAllowedLevel:c.z.boolean().optional(),parentAttachedToMenu:c.z.boolean().optional(),viewId:c.z.number().optional(),structureId:c.z.string().optional(),menuAttached:c.z.boolean().optional(),collapsed:c.z.boolean().optional(),isSearchActive:c.z.boolean().optional(),viewParentId:c.z.number().optional(),id:c.z.number().optional(),documentId:c.z.string().optional(),audience:c.z.string().array().optional(),order:c.z.number().optional(),items:c.z.any().array().optional(),additionalFields:c.z.object(e.reduce((n,i)=>{if(typeof i=="string")return n;switch(i.type){case"string":n[i.name]=i.required?c.z.string():c.z.string().optional();break;case"boolean":n[i.name]=i.required?c.z.boolean():c.z.boolean().optional();case"media":n[i.name]=i.required?c.z.any():c.z.any().optional();case"select":{i.multi?n[i.name]=i.required?c.z.string().array():c.z.string().array().optional():n[i.name]=i.required?c.z.string():c.z.string().optional();break}}return n},{}))}),Ia=({additionalFields:e,isSingleSelected:n})=>Ye({additionalFields:e}).extend({type:c.z.literal("INTERNAL"),path:c.z.string(),externalPath:c.z.string().optional(),relatedType:c.z.string(),related:n?c.z.string().optional():c.z.string()}),Ca=({isSingleSelected:e,additionalFields:n})=>Ye({additionalFields:n}).extend({type:c.z.literal("EXTERNAL"),path:c.z.string().or(c.z.null()).optional(),externalPath:c.z.string().min(1).refine(i=>ja.some(s=>s.test(i))),relatedType:c.z.string().optional(),related:c.z.string().optional()}),va=({isSingleSelected:e,additionalFields:n})=>Ye({additionalFields:n}).extend({type:c.z.literal("WRAPPER"),path:c.z.string().or(c.z.null()).optional()}),Ta=e=>c.z.discriminatedUnion("type",[Ca(e),Ia(e),va(e)]),lt={autoSync:!0,type:"INTERNAL",relatedType:"",menuAttached:!1,title:"",externalPath:"",path:"",additionalFields:{},audience:[],updated:!1,uiRouterKey:""},wa=()=>{const e=P.getFetchClient(),n=ee(e);return W.useMutation({mutationFn(i){return n.slugify(i)}})},Sa=async({slugify:e,title:n,config:i,related:s,relatedType:d,contentTypeItems:r})=>{if(n)return n?await e(n):void 0;if(s){const h=Be({...r?.find(x=>x.documentId===s.toString())??{documentId:"",id:0},__collectionUid:d},i);return h?await e(h):void 0}},Fa=({currentType:e,config:n,contentTypeItems:i,currentRelated:s,currentRelatedType:d,isSingleSelected:r})=>{if(e!=="INTERNAL"||!d)return"";const h=n?.pathDefaultFields[d]??[];if(j.isEmpty(e)&&!j.isEmpty(h)){const x=r?j.first(i??[]):i?.find(({id:g})=>g===s);return h.map(g=>x?.[g]??"").filter(g=>!!g.toString().trim())[0]??""}return""},Na=({currentPath:e,isExternal:n,current:i,currentType:s="INTERNAL",config:d,contentTypeItems:r,currentRelated:h,currentRelatedType:x,isSingleSelected:F})=>{if(!n){const g=j.isEmpty(e)||e==="/"?Fa({currentType:s,config:d,contentTypeItems:r,currentRelated:h,currentRelatedType:x,isSingleSelected:F}):e||"";return`${i.levelPath!=="/"?`${i.levelPath}`:""}/${g}`.replace("//","/")}},dt=(e,n)=>n?e.find(i=>i.value===n)?.label??"":"",ct=({name:e,onClear:n,onChange:i,options:s,value:d,disabled:r})=>{const[h,x]=p.useState(dt(s,d));return p.useEffect(()=>{x(dt(s,d))},[d,s]),t.jsx(a.Combobox,{name:e,autocomplete:"list",onClear:n,onChange:i,onTextValueChange:x,value:d,textValue:h,options:s,disabled:r,width:"100%",children:s.map(({key:F,label:g,value:f})=>t.jsx(a.ComboboxOption,{value:f,children:g},F))})},Aa=[],Ra=({availableLocale:e,isLoading:n,current:i=lt,onSubmit:s,onCancel:d,appendLabelPublicationStatus:r=Ea,locale:h,permissions:x={},currentNavigation:F})=>{const{formatMessage:g}=H.useIntl(),[f,S]=p.useState(n),{canUpdate:b}=x,[$,I]=p.useState(!1),[T,u]=p.useState(),[v,A]=p.useState({}),[V,le]=p.useState(),M=ke(),J=M.data?.availableAudience??[],ne=M.data?.contentTypes??[],{toggleNotification:be}=P.useNotification(),je=Tn(),ce=Xe(),te=(m,L,K)=>{if(K){let q=m,C=L;if(j.isObject(m)){const{name:B,value:U}=m.target;q=B,C=j.isNil(C)?U:C}return j.isString(q)&&Z(q,C),K(m,C)}},Z=(m,L)=>{A(j.set({...v,additionalFields:{...v.additionalFields},updated:!0},m,L))},ie=m=>A({...v,additionalFields:{...v.additionalFields},updated:!0,...m}),ue=m=>({...m,additionalFields:M.data?.additionalFields.reduce((L,K)=>{const{name:q,type:C}=K;if(q in(m.additionalFields??{})){let B=m.additionalFields[q];switch(C){case"boolean":B=j.isBoolean(B)?`${B}`:B;break;case"media":B=B&&JSON.stringify(B);break}return{...L,[q]:B}}return L},{})||{}}),Ie=m=>({...m,additionalFields:M.data?.additionalFields.reduce((L,K)=>{const{name:q,type:C}=K;if(q in(m.additionalFields??{})){let B=m.additionalFields[q];switch(C){case"boolean":B=B==="true";break;case"media":B=B&&JSON.parse(B);break}return{...L,[q]:B}}return L},{})||{}}),Ce=async(m,L)=>{m.preventDefault();const K=ue(L),{success:q,data:C,error:B}=Ta({isSingleSelected:$,additionalFields:M.data?.additionalFields??Aa}).safeParse(K);if(q){const U=C.title.trim()?C.title.trim():C.type==="INTERNAL"?E(C?.related?.toString(),C.relatedType,$):"";S(!0);const he=await Sa(C.type==="INTERNAL"?{slugify:D.mutateAsync,title:U,related:C.related,relatedType:C.relatedType}:{slugify:D.mutateAsync,title:U});if(D.reset(),S(!1),!he){be({type:"warning",message:g(l("popup.item.form.uiRouter.unableToRender"))});return}s(C.type==="INTERNAL"?{...C,title:U,uiRouterKey:he}:{...C,title:U,uiRouterKey:he})}else B&&le(B.issues.reduce((U,he)=>({...U,[he.path.join(".")]:he.message}),{}))},oe=(m,L)=>j.get(V,m)?g(l(L??m)):void 0,ve=i.type==="INTERNAL"?i.relatedType:void 0,{path:Se,type:pe,title:Te,autoSync:Fe}=v,{relatedType:ae,related:ye}=v.type==="INTERNAL"?v:{related:void 0,relatedType:void 0},y=pe==="EXTERNAL",z=pe==="INTERNAL",w=y?"externalPath":"path",R=z&&!$&&j.isNil(ye)||f,k=It({uid:ae??"",locale:h}),D=wa(),X=p.useMemo(()=>e.map((m,L)=>({key:`${m}-${L}`,value:m,label:m})),[e]),_=p.useMemo(()=>J.map(m=>({value:m.documentId??0,label:m.name??" "})),[J]),E=p.useCallback((m,L,K)=>{let q;if(K){if(q=k.data?.find(C=>C.uid===L||C.__collectionUid===L),!q)return ne.find(C=>C.uid===L)?.contentTypeName}else q={...k.data?.find(({documentId:B})=>B===m)||{documentId:null},__collectionUid:L};return Be(q,M.data)},[k.data,M.data,ne]),re=(M.data?.contentTypes.length?["INTERNAL","EXTERNAL","WRAPPER"]:["EXTERNAL","WRAPPER"]).map(m=>({key:m,value:m,label:g(l(`popup.item.form.type.${m.toLowerCase()}.label`))})),ge=j.sortBy(k.data?.map(m=>{const L=r(Be({...m,__collectionUid:ae},M.data),m,!1);return{key:m?.documentId?.toString(),value:m?.documentId?.toString(),label:L}})??[],m=>m.label),N=p.useMemo(()=>j.sortBy(M.data?.contentTypes?.filter(m=>m.isSingle?!!(ae&&[ae,ve].includes(m.uid)):!0).map(m=>({key:m.uid,value:m.uid,label:m.contentTypeName})),m=>m.label),[M.data,ae]),Q=j.isEmpty(ge),se=p.useCallback(async m=>{m.preventDefault(),m.stopPropagation();const L=ce.data?.find(({locale:K})=>K===T);L&&(S(!0),je.mutate({target:F.documentId,structureId:i.structureId,source:L.documentId},{onSuccess(K){je.reset();const{type:q,externalPath:C,path:B,related:U,title:he,uiRouterKey:At}=K,{__type:et,documentId:tt}=U??{};Z("type",q),Z("externalPath",C??void 0),Z("path",B??void 0),Z("title",he),Z("uiRouterKey",At),et&&tt&&(Z("related",tt),Z("relatedType",et))},onSettled(){S(!1)}}))},[S,je,ce]);return p.useEffect(()=>{A(Ie({...lt,...i}))},[i]),p.useEffect(()=>{if(ae){const m=M.data?.contentTypes.find(L=>L.uid===ae);if(m&&(I(m.isSingle),m.isSingle&&k.data?.length)){const L=k.data[0];L&&Z("related",L.documentId)}}},[ae,M.data,k.data]),p.useEffect(()=>{if(Fe&&pe==="INTERNAL"&&ye&&ae&&M.data){const m=k.data?.find(L=>L.documentId===ye);if(m){const{contentTypesNameFields:L,pathDefaultFields:K}=M.data,q=K[ae]?.reduce((U,he)=>U||m?.[he],void 0),C=(L[ae]??[]).concat(L.default??[]).reduce((U,he)=>U||m?.[he],void 0),B=[];q&&q!==Se&&B.push({name:"path",value:q}),C&&C!==Te&&B.push({name:"title",value:C}),setTimeout(()=>{B.forEach(U=>{Z(U.name,U.value)})},100)}}},[Te,Se,Fe,pe,ye,ae,M.data,k.data]),t.jsxs(t.Fragment,{children:[t.jsx(a.Modal.Body,{children:t.jsx(P.Form,{width:"auto",height:"auto",method:"POST",initialValues:v,children:({values:m,onChange:L})=>{const K=m.type==="INTERNAL"?m:{related:void 0,relatedType:void 0},q=Na({currentPath:m.path,isExternal:m.type==="EXTERNAL",current:i,currentType:m.type,config:M.data,contentTypeItems:k.data,currentRelated:K.related,currentRelatedType:K.relatedType,isSingleSelected:$});return t.jsxs(t.Fragment,{children:[t.jsxs(a.Grid.Root,{gap:5,paddingBottom:1,children:[t.jsx(a.Grid.Item,{alignItems:"flex-start",col:8,children:t.jsx(G.Field,{name:"type",label:g(l("popup.item.form.type.label","Internal link")),error:oe("type"),hint:g(l("popup.item.form.title.placeholder","e.g. Blog")),children:t.jsx(a.SingleSelect,{onChange:C=>te("type",C,L),value:m.type,name:"type",disabled:!b,width:"100%",children:re.map(({key:C,label:B,value:U})=>t.jsx(a.SingleSelectOption,{value:U,children:B},C))})})},"title"),t.jsx(a.Grid.Item,{alignItems:"flex-start",col:4,children:t.jsx(G.Field,{name:"menuAttached",label:g(l("popup.item.form.menuAttached.label","MenuAttached")),error:oe("menuAttached"),hint:g(l("popup.item.form.menuAttached.placeholder","is menu item attached to menu")),children:t.jsx(a.Toggle,{name:"menuAttached",checked:m.menuAttached,onChange:C=>te(C,!m.menuAttached,L),value:m.menuAttached,onLabel:g(l("popup.item.form.menuAttached.value.yes","yes")),offLabel:g(l("popup.item.form.menuAttached.value.no","no")),disabled:!b||(M.data?.cascadeMenuAttached?!(i.isMenuAllowedLevel&&i.parentAttachedToMenu):!1),width:"100%"})})},"menuAttached")]}),t.jsxs(a.Grid.Root,{gap:5,paddingTop:1,paddingBottom:1,children:[t.jsx(a.Grid.Item,{alignItems:"flex-start",col:m.type==="INTERNAL"?8:12,children:t.jsx(G.Field,{name:"title",label:g(l("popup.item.form.title.label","Title")),error:oe("title"),hint:g(l("popup.item.form.title.placeholder","e.g. Blog")),children:t.jsx(a.TextInput,{type:"string",disabled:!b||m.autoSync&&m.type==="INTERNAL",name:"title",onChange:(C,B)=>te(C,B,L),value:m.title})})},"title"),m.type==="INTERNAL"&&t.jsx(a.Grid.Item,{alignItems:"flex-start",col:4,children:t.jsx(G.Field,{name:"autoSync",label:g(l("popup.item.form.autoSync.label","Read fields from related")),error:oe("autoSync"),children:t.jsx(a.Toggle,{name:"autoSync",checked:m.autoSync,onChange:C=>te(C,!m.autoSync,L),onLabel:"Enabled",offLabel:"Disabled"})})},"autoSync")]}),t.jsx(a.Grid.Root,{gap:5,paddingTop:1,paddingBottom:1,children:t.jsx(a.Grid.Item,{alignItems:"flex-start",col:12,children:t.jsx(G.Field,{name:w,label:g(l(`popup.item.form.${w}.label`,"Path")),error:oe(w,`popup.item.form.${w}.validation.type`),hint:[g(l(`popup.item.form.${w}.placeholder`,"e.g. Blog")),q?g(l("popup.item.form.type.external.description"),{value:q}):""].join(" "),children:t.jsx(a.TextInput,{disabled:!b,name:w,onChange:(C,B)=>te(C,B,L),value:m[w],width:"100%"})})},"title")}),m.type==="INTERNAL"&&t.jsxs(a.Grid.Root,{gap:5,paddingTop:1,paddingBottom:1,children:[t.jsx(a.Grid.Item,{alignItems:"flex-start",col:m.relatedType&&!$?6:12,children:t.jsx(G.Field,{name:"relatedType",label:g(l("popup.item.form.relatedType.label","Related Type")),error:oe("relatedType"),hint:!f&&j.isEmpty(N)?g(l("popup.item.form.relatedType.empty","There are no more content types")):void 0,children:t.jsx(ct,{name:"relatedType",onClear:()=>ie({related:void 0,title:void 0,relatedType:void 0}),onChange:C=>ie({related:void 0,title:m.autoSync?"":m.title,relatedType:C}),value:m.relatedType,options:M.data?.contentTypes.map(C=>({key:C.uid,value:C.uid,label:C.contentTypeName}))??[],disabled:!M.data?.contentTypes.length||!b})})}),m.relatedType&&!$&&t.jsx(a.Grid.Item,{alignItems:"flex-start",col:6,children:t.jsx(G.Field,{name:"related",label:g(l("popup.item.form.related.label","Related")),error:oe("related"),hint:!f&&Q?g(l("popup.item.form.related.empty","There are no more entities"),{contentTypeName:m.relatedType}):void 0,children:t.jsx(ct,{name:"related",onClear:()=>te("related",void 0,L),onChange:C=>te("related",C,L),value:m.related,options:ge,disabled:f||Q||!b})})})]}),!j.isEmpty(M.data?.additionalFields)&&t.jsxs(t.Fragment,{children:[t.jsx(a.Grid.Root,{gap:5,paddingTop:1,paddingBottom:1,children:t.jsx(a.Grid.Item,{col:12,lg:12,children:t.jsx(a.Divider,{width:"100%"})})}),t.jsxs(a.Grid.Root,{gap:5,paddingTop:1,paddingBottom:1,children:[M.data?.additionalFields.map((C,B)=>{if(C!=="audience")return t.jsx(a.Grid.Item,{alignItems:"flex-start",col:6,children:t.jsx(G.Field,{name:`additionalFields.${C.name}`,label:C.label,error:oe(`additionalFields.${C.name}`),children:t.jsx(xa,{name:`additionalFields.${C.name}`,field:C,isLoading:f,onChange:L,onChangeEnhancer:te,value:j.get(m?.additionalFields,C.name),disabled:!b})})},C.name)}),M.data?.additionalFields.map((C,B)=>{if(C==="audience")return t.jsx(a.Grid.Item,{alignItems:"flex-start",col:12,children:t.jsx(G.Field,{name:"audience",label:g(l("popup.item.form.audience.label")),error:oe("audience"),hint:!f&&j.isEmpty(_)?g(l("popup.item.form.title.placeholder","e.g. Blog")):void 0,children:t.jsx(a.MultiSelect,{name:"audience",value:m.audience,onChange:U=>te("audience",U,L),width:"100%",children:_.map(({value:U,label:he})=>t.jsx(a.MultiSelectOption,{value:U,children:he},U))})})},"audience")})]}),t.jsx(a.Grid.Root,{gap:5,paddingTop:1,paddingBottom:1,children:t.jsx(a.Grid.Item,{col:12,lg:12,children:t.jsx(a.Divider,{width:"100%"})})})]}),X&&X.length>1&&t.jsx(a.Grid.Root,{gap:5,paddingTop:1,paddingBottom:1,children:t.jsxs(a.Grid.Item,{alignItems:"flex-start",col:12,children:[t.jsx(a.Divider,{marginTop:5,marginBottom:5}),t.jsxs(a.Grid.Root,{gap:5,children:[t.jsx(a.Grid.Item,{alignItems:"flex-start",col:6,lg:12,children:t.jsx(G.Field,{name:"i18n.locale",label:g(l("popup.item.form.i18n.locale.label","Copy details from")),children:t.jsx(a.SingleSelect,{name:"i18n.locale",onChange:u,value:T,disabled:f||!b,placeholder:g(l("popup.item.form.i18n.locale.placeholder","locale")),children:X.map(({key:C,label:B,value:U})=>t.jsx(a.SingleSelectOption,{value:U,children:B},C))})})}),b&&t.jsx(a.Grid.Item,{alignItems:"flex-start",col:6,lg:12,paddingTop:6,children:t.jsx(a.Box,{children:t.jsx(a.Button,{variant:"tertiary",onClick:se,disabled:f||!T,children:g(l("popup.item.form.i18n.locale.button"))})})})]})]},"title")}),t.jsx(a.Grid.Root,{gap:5,children:t.jsx(a.Grid.Item,{alignItems:"flex-start",col:12},"title")})]})}})}),t.jsx(ba,{handleSubmit:m=>Ce(m,v),handleCancel:d,submitDisabled:R,canUpdate:b})]})},Ea=()=>"",La=({isNewItem:e,canUpdate:n})=>{const{formatMessage:i}=H.useIntl();let s="view";return n&&(s=e?"new":"edit"),t.jsx(a.Modal.Header,{children:t.jsx(a.Typography,{variant:"omega",fontWeight:"bold",textColor:"neutral800",as:"h2",id:"asset-dialog-title",children:i(l(`popup.item.header.${s}`))})})},$a=({availableLocale:e,isOpen:n,isLoading:i,currentItem:s={},onSubmit:d,onClose:r,locale:h,permissions:x,currentNavigation:F})=>{const{formatMessage:g}=H.useIntl(),f=$=>{d($)},S=($,I,T)=>`${Nn({relatedRef:I,type:I.isSingle?"INTERNAL":I.type,isCollection:T})?"":`[${g(l("notification.navigation.item.relation.status.draft"))}] `.toUpperCase()}${$}`,b=!!s.viewId;return t.jsx(a.Modal.Root,{labelledBy:"condition-modal-breadcrumbs",onOpenChange:$=>{$||r({preventDefault(){},stopPropagation(){},target:{}})},open:n,children:t.jsxs(a.Modal.Content,{children:[t.jsx(La,{isNewItem:!b,canUpdate:x?.canUpdate}),t.jsx(Ra,{availableLocale:e,current:s,isLoading:i,onSubmit:f,onCancel:r,appendLabelPublicationStatus:S,locale:h,permissions:x,currentNavigation:F})]})})},Ve=0,Pa=({value:e,setValue:n,initialIndex:i=Ve})=>{const[s,d]=p.useState(e),[r,h]=p.useState(e),[x,F]=p.useState(i),[g,f]=p.useState(!!e),S=p.useRef(null),{formatMessage:b}=H.useIntl();p.useEffect(()=>{g&&setTimeout(()=>{S.current?.querySelector("input")?.focus()},0)},[g]),p.useEffect(()=>{x&&s===r&&n({value:s,index:x})},[x,s,r]),p.useEffect(()=>{s!==r&&(h(s),F(Ve),n({value:s,index:Ve}))},[s,r]);const $=p.useCallback(u=>{u.code.toLowerCase()==="enter"&&F(v=>v+1)},[]),I=p.useCallback(u=>{d(u.target.value)},[d]),T=p.useCallback(()=>{d(""),f(!1)},[d,f]);return g?t.jsxs("div",{ref:S,children:[t.jsx(a.Searchbar,{name:"searchbar",onClear:T,value:e,size:"S",onChange:I,clearLabel:"Clearing the search",placeholder:b(l("pages.main.search.placeholder","Type to start searching...")),onKeyDown:$,children:"Search for navigation items"}),t.jsx(a.Typography,{variant:"pi",fontColor:"neutral150",style:{margin:"3px 0 0",display:"inline-block"},children:b(l("pages.main.search.subLabel","press ENTER to highlight next item"))})]}):t.jsx(a.IconButton,{children:t.jsx(O.Search,{}),onClick:()=>f(!g)})},ka=new W.QueryClient,za=()=>{const{formatMessage:e}=H.useIntl(),n=He(),[i,s]=p.useState(),[d,r]=p.useState(),[h,x]=p.useState(),[F,g]=p.useState(!1),[f,S]=p.useState(!1),[b,$]=p.useState(),I=p.useMemo(()=>({access:Ae.access||Ae.update,update:Ae.update}),[]),{isLoading:T,allowedActions:{canUpdate:u,canAccess:v}}=P.useRBAC(I),A=Xe(),V=ke(),le=vt(),M=Tt([A,{isPending:T}]),J=wn(),[{value:ne,index:be},je]=p.useState({value:"",index:0}),ce=j.isEmpty(ne),te=(ne||"").toLowerCase(),Z=(N,Q,se)=>{const m=N.reduce((L,K)=>{const q=K.items?.length?Z(K.items??[],Q):[];return Q(K)?[K,...q,...L]:[...q,...L]},[]);if(se!==void 0){const L=se%m.length;return m.map((K,q)=>L===q?{...K,isSearchActive:!0}:K)}return m},ie=ce?[]:Z(d?.items.map(N=>({...N}))??[],N=>(N?.title||"").toLowerCase().includes(te),te?be:void 0),ue=p.useCallback((N,Q={})=>{x(Q),g(N)},[g]),Ie=p.useCallback((N,Q,se=!0,m="",L=!0,K="0",q=0)=>{u&&(N.preventDefault(),N.stopPropagation(),ue(!0,{viewParentId:Q,isMenuAllowedLevel:se,levelPath:m,parentAttachedToMenu:L,structureId:K,viewId:void 0,order:q+1}))},[ue,u]),Ce=p.useMemo(()=>(n.data?[n.data.defaultLocale,...n.data.restLocale]:[]).filter(N=>N!==b),[n.data,b]),oe=In(),ve=jn(),{i18nCopyItemsModal:Se,i18nCopySourceLocale:pe,setI18nCopyModalOpened:Te,setI18nCopySourceLocale:Fe}=Fn(p.useCallback(N=>{const Q=A.data?.find(({locale:se,documentId:m})=>se===N&&m===d?.documentId);Q&&Q.documentId&&d?.documentId&&J.mutate({source:Q.locale,target:d.locale,documentId:Q.documentId},{onSuccess(se){J.reset(),r({...se.data,items:se.data.items.map(Ze)}),oe(),ve()}})},[d])),ae=p.useCallback(()=>{pe&&Te(!0)},[Te,pe]),ye=Ct(()=>{s({documentId:d?.documentId,id:d?.id}),r(void 0)}),y=()=>{d&&ye.mutate(d)},z=N=>{N.preventDefault(),N.stopPropagation(),N.target.tagName!=="HTML"&&ue(!1)},w=({item:N,newOrder:Q})=>{_({...N,order:Q})},R=N=>{_(Ne({...N,removed:!0},!0))},k=N=>{_(Ne({...N,removed:!1},!0))},D=N=>{_(Ne({...N,collapsed:!N.collapsed,updated:!0,isSearchActive:!1},!0))},X=({item:N,levelPath:Q="",parentAttachedToMenu:se=!0})=>{ue(!0,{...N,levelPath:Q,parentAttachedToMenu:se})},_=N=>{if(d&&V.data){const Q=Ee(N,d?.items??[],V.data);r({...d,items:Q}),S(!0),g(!1)}},E=ce?d?.items??[]:ie,me=p.useCallback(()=>{d&&r({...d,items:d.items.map(N=>Re(N,!1))})},[r,d,Re]),re=p.useCallback(()=>{d&&r({...d,items:d.items.map(N=>Re(N,!0))})},[r,d,Re]),ge=[{onClick:me,type:"submit",variant:"tertiary",tradId:"header.action.expandAll",margin:"8px"},{onClick:re,type:"submit",variant:"tertiary",tradId:"header.action.collapseAll",margin:"8px"}];return u&&ge.push({onClick:Ie,type:"submit",variant:"primary",tradId:"header.action.newItem",startIcon:t.jsx(O.Plus,{}),margin:"8px"}),p.useEffect(()=>{if(!d&&A.data?.[0]){let N;i?.documentId&&(N=A.data.find(Q=>Q.documentId===i.documentId&&Q.id===i.id)),s(void 0),r(N||j.first(A.data))}},[A.data]),p.useEffect(()=>{!b&&n.data?.defaultLocale&&$(n.data?.defaultLocale)},[A.data]),p.useEffect(()=>{if(d&&b!==d.locale){s(void 0);const N=A.data?.find(Q=>Q.documentId===d.documentId&&Q.locale===b);N&&N.documentId===d.documentId&&N.locale!==d.locale&&r(N)}},[d,b,A.data]),p.useEffect(()=>{!b&&n.data?.defaultLocale&&$(n.data.defaultLocale)},[A.data]),!A.data||!n.data||M?t.jsx(P.Page.Loading,{}):t.jsxs(P.Layouts.Root,{children:[t.jsx(P.Page.Title,{children:e(l("header.title","UI Navigation"))}),t.jsxs(P.Page.Main,{children:[t.jsx(Jn,{availableNavigations:A.data,activeNavigation:d,handleCachePurge:()=>le.mutate(void 0),handleChangeSelection:r,handleLocalizationSelection:$,handleSave:y,locale:n.data,structureHasChanged:f,permissions:{canUpdate:u},currentLocale:b}),t.jsxs(P.Layouts.Content,{children:[t.jsx(Yn,{startActions:t.jsx(Pa,{value:ne,setValue:je}),endActions:ge.map(({tradId:N,margin:Q,...se},m)=>t.jsx(a.Box,{marginLeft:Q,children:t.jsxs(a.Button,{...se,children:[" ",e(l(N))," "]})},m))}),d?.items.length?t.jsx(Ft,{items:E,onItemLevelAdd:Ie,onItemRemove:R,onItemEdit:X,onItemRestore:k,onItemReOrder:w,onItemToggleCollapse:D,displayFlat:!ce,isParentAttachedToMenu:!0,permissions:{canUpdate:u,canAccess:v},structurePrefix:"",locale:b??""}):t.jsxs(a.Flex,{direction:"column",minHeight:"400px",justifyContent:"center",children:[t.jsx(a.Box,{padding:4,children:t.jsx(a.Typography,{variant:"beta",textColor:"neutral600",children:e(l("empty.description"))})}),u&&t.jsx(a.Button,{variant:"secondary",startIcon:t.jsx(O.ListPlus,{}),label:e(l("empty.cta")),onClick:Ie,children:e(l("empty.cta"))}),u&&Ce.length?t.jsxs(a.Flex,{direction:"column",justifyContent:"center",children:[t.jsx(a.Box,{paddingTop:3,paddingBottom:3,children:t.jsx(a.Typography,{variant:"beta",textColor:"neutral600",children:e(l("view.i18n.fill.cta.header"))})}),t.jsxs(a.Flex,{direction:"row",justifyContent:"center",alignItems:"center",children:[t.jsx(a.Box,{paddingLeft:1,paddingRight:1,children:t.jsx(a.SingleSelect,{onChange:Fe,value:pe,size:"S",children:Ce.map(N=>t.jsx(a.SingleSelectOption,{value:N,children:e(l("view.i18n.fill.option"),{locale:N})},N))})}),t.jsx(a.Box,{paddingLeft:1,paddingRight:1,children:t.jsx(a.Button,{variant:"tertiary",onClick:ae,disabled:!pe,size:"S",children:e(l("view.i18n.fill.cta.button"))})})]})]}):null]}),F&&b&&d&&t.jsx($a,{availableLocale:Ce,currentItem:h,onSubmit:_,onClose:z,locale:b,permissions:{canUpdate:u},isOpen:F,isLoading:T,currentNavigation:d}),u&&Se]})]})]})};function Ma(){const e=G.usePluginTheme();return t.jsx(W.QueryClientProvider,{client:ka,children:t.jsx(a.DesignSystemProvider,{theme:e,children:t.jsx(za,{})})})}const Ba=()=>t.jsx(_e.DndProvider,{backend:Rt.HTML5Backend,children:t.jsxs(De.Routes,{children:[t.jsx(De.Route,{path:"/",index:!0,Component:Ma}),t.jsx(De.Route,{path:"/*",Component:P.Page.Error})]})}),Da=we.default(a.Alert)`
|
|
2341
|
+
`,Fw=({isParentAttachedToMenu:t=!1,items:e,level:n=0,levelPath:r="",onItemEdit:i,onItemLevelAdd:o,onItemRemove:s,onItemRestore:a,onItemReOrder:l,onItemToggleCollapse:c,displayFlat:d,permissions:h,structurePrefix:f,viewParentId:m,locale:g})=>u.jsx(eH,{"data-level":n,children:e?.map((b,v)=>u.jsx(Jz,{item:b,isLast:v===e.length-1,level:n,levelPath:r,isParentAttachedToMenu:t,onItemRestore:a,onItemLevelAdd:o,onItemRemove:s,onItemEdit:i,onItemReOrder:l,onItemToggleCollapse:c,displayChildren:d,permissions:h,structureId:f?`${f}.${v}`:v.toString(),viewParentId:m,locale:g},`list-item-${b.viewId||v}`))}),tH="",nH={type:"media",multiple:!1,required:!1,allowedTypes:["images"],pluginOptions:{i18n:{localized:!1}}},rH=({name:t,field:e,isLoading:n,onChange:r,onChangeEnhancer:i,value:o,disabled:s})=>{const{toggleNotification:a}=Se.useNotification(),{formatMessage:l}=Ve.useIntl(),d=Se.useStrapiApp("AdditionalFieldInput",f=>f.fields).media,h=p.useMemo(()=>({id:e.name,name:t||e.name,disabled:n||s}),[e,n]);switch(p.useEffect(()=>{if(e.type==="media"){const f=ue.isNull(o)?void 0:o;i(h.name,f,r)}},[o]),e.type){case"boolean":return u.jsx($n,{...h,checked:!!o,onChange:f=>i(f,!o,r),onLabel:"true",offLabel:"false",type:"checkbox"});case"string":return u.jsx($r,{...h,onChange:(f,m)=>i(f,m,r),value:o||tH});case"select":return e.multi?u.jsx(wi,{...h,onChange:f=>i(h.name,f,r),value:ue.isNil(o)?e.multi?[]:null:o,multi:e.multi,withTags:e.multi,children:e.options.map((f,m)=>u.jsx(Br,{value:f,children:f},`${e.name}-option-${m}`))}):u.jsx(Jn,{...h,onChange:f=>i(h.name,f,r),value:ue.isNil(o)?e.multi?[]:null:o,multi:e.multi,withTags:e.multi,children:e.options.map((f,m)=>u.jsx(er,{value:f,children:f},`${e.name}-option-${m}`))});case"media":return u.jsx(d,{...h,...nH,value:o});default:throw a({type:"warning",message:l(M("notification.error.customField.type"))}),new Error("Type of custom field is unsupported")}},iH=({handleCancel:t,handleSubmit:e,submitDisabled:n,canUpdate:r})=>{const{formatMessage:i}=Ve.useIntl();return r?u.jsxs(dt.Footer,{children:[u.jsx(dt.Close,{children:u.jsx(Xe,{onClick:t,variant:"tertiary",children:i(M("popup.item.form.button.cancel"))})}),u.jsx(Xe,{onClick:e,disabled:n,children:i(M("popup.item.form.button.save"))})]}):null},oH=[/^mailto:[\w-\.]+@([\w-]+\.)+[\w-]{2,}$/,/^tel:(\+\d{1,3})?[\s]?(\(?\d{2,3}\)?)?[\s.-]?(\d{3})?[\s.-]?\d{3,4}$/,/^#.*/,/(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/,/(\/[a-z0-9\-._~%!$&'()*+,;=:@]+)+\/?/],n0=({additionalFields:t})=>z.z.object({title:z.z.string(),autoSync:z.z.boolean().optional(),removed:z.z.boolean().optional(),updated:z.z.boolean().optional(),uiRouterKey:z.z.string(),levelPath:z.z.string().optional(),isMenuAllowedLevel:z.z.boolean().optional(),parentAttachedToMenu:z.z.boolean().optional(),viewId:z.z.number().optional(),structureId:z.z.string().optional(),menuAttached:z.z.boolean().optional(),collapsed:z.z.boolean().optional(),isSearchActive:z.z.boolean().optional(),viewParentId:z.z.number().optional(),id:z.z.number().optional(),documentId:z.z.string().optional(),audience:z.z.string().array().optional(),order:z.z.number().optional(),items:z.z.any().array().optional(),additionalFields:z.z.object(t.reduce((e,n)=>{if(typeof n=="string")return e;switch(n.type){case"string":e[n.name]=n.required?z.z.string():z.z.string().optional();break;case"boolean":e[n.name]=n.required?z.z.boolean():z.z.boolean().optional();case"media":e[n.name]=n.required?z.z.any():z.z.any().optional();case"select":{n.multi?e[n.name]=n.required?z.z.string().array():z.z.string().array().optional():e[n.name]=n.required?z.z.string():z.z.string().optional();break}}return e},{}))}),sH=({additionalFields:t,isSingleSelected:e})=>n0({additionalFields:t}).extend({type:z.z.literal("INTERNAL"),path:z.z.string(),externalPath:z.z.string().optional(),relatedType:z.z.string(),related:e?z.z.string().optional():z.z.string()}),aH=({isSingleSelected:t,additionalFields:e})=>n0({additionalFields:e}).extend({type:z.z.literal("EXTERNAL"),path:z.z.string().or(z.z.null()).optional(),externalPath:z.z.string().min(1).refine(n=>oH.some(r=>r.test(n))),relatedType:z.z.string().optional(),related:z.z.string().optional()}),lH=({isSingleSelected:t,additionalFields:e})=>n0({additionalFields:e}).extend({type:z.z.literal("WRAPPER"),path:z.z.string().or(z.z.null()).optional()}),cH=t=>z.z.discriminatedUnion("type",[aH(t),sH(t),lH(t)]),dp={autoSync:!0,type:"INTERNAL",relatedType:"",menuAttached:!1,title:"",externalPath:"",path:"",additionalFields:{},audience:[],updated:!1,uiRouterKey:""},dH=()=>{const t=Se.getFetchClient(),e=it(t);return Fe.useMutation({mutationFn(n){return e.slugify(n)}})},uH=async({slugify:t,title:e,config:n,related:r,relatedType:i,contentTypeItems:o})=>{if(e)return e?await t(e):void 0;if(r){const s=Sl({...o?.find(a=>a.documentId===r.toString())??{documentId:"",id:0},__collectionUid:i},n);return s?await t(s):void 0}},hH=({currentType:t,config:e,contentTypeItems:n,currentRelated:r,currentRelatedType:i,isSingleSelected:o})=>{if(t!=="INTERNAL"||!i)return"";const s=e?.pathDefaultFields[i]??[];if(ue.isEmpty(t)&&!ue.isEmpty(s)){const a=o?ue.first(n??[]):n?.find(({id:c})=>c===r);return s.map(c=>a?.[c]??"").filter(c=>!!c.toString().trim())[0]??""}return""},fH=({currentPath:t,isExternal:e,current:n,currentType:r="INTERNAL",config:i,contentTypeItems:o,currentRelated:s,currentRelatedType:a,isSingleSelected:l})=>{if(!e){const c=ue.isEmpty(t)||t==="/"?hH({currentType:r,config:i,contentTypeItems:o,currentRelated:s,currentRelatedType:a,isSingleSelected:l}):t||"";return`${n.levelPath!=="/"?`${n.levelPath}`:""}/${c}`.replace("//","/")}},up=(t,e)=>e?t.find(n=>n.value===e)?.label??"":"",hp=({name:t,onClear:e,onChange:n,options:r,value:i,disabled:o})=>{const[s,a]=p.useState(up(r,i));return p.useEffect(()=>{a(up(r,i))},[i,r]),u.jsx(Zx,{name:t,autocomplete:"list",onClear:e,onChange:n,onTextValueChange:a,value:i,textValue:s,options:r,disabled:o,width:"100%",children:r.map(({key:l,label:c,value:d})=>u.jsx(Jx,{value:d,children:c},l))})},mH=[],pH=({availableLocale:t,isLoading:e,current:n=dp,onSubmit:r,onCancel:i,appendLabelPublicationStatus:o=gH,locale:s,permissions:a={},currentNavigation:l})=>{const{formatMessage:c}=Ve.useIntl(),[d,h]=p.useState(e),{canUpdate:f}=a,[m,g]=p.useState(!1),[b,v]=p.useState(),[x,y]=p.useState({}),[$,k]=p.useState(),S=js(),R=S.data?.availableAudience??[],A=S.data?.contentTypes??[],{toggleNotification:I}=Se.useNotification(),E=cz(),j=e0(),O=(U,ve,Ie)=>{if(Ie){let Re=U,fe=ve;if(ue.isObject(U)){const{name:ke,value:Ne}=U.target;Re=ke,fe=ue.isNil(fe)?Ne:fe}return ue.isString(Re)&&D(Re,fe),Ie(U,fe)}},D=(U,ve)=>{y(ue.set({...x,additionalFields:{...x.additionalFields},updated:!0},U,ve))},B=U=>y({...x,additionalFields:{...x.additionalFields},updated:!0,...U}),V=U=>({...U,additionalFields:S.data?.additionalFields.reduce((ve,Ie)=>{const{name:Re,type:fe}=Ie;if(Re in(U.additionalFields??{})){let ke=U.additionalFields[Re];switch(fe){case"boolean":ke=ue.isBoolean(ke)?`${ke}`:ke;break;case"media":ke=ke&&JSON.stringify(ke);break}return{...ve,[Re]:ke}}return ve},{})||{}}),q=U=>({...U,additionalFields:S.data?.additionalFields.reduce((ve,Ie)=>{const{name:Re,type:fe}=Ie;if(Re in(U.additionalFields??{})){let ke=U.additionalFields[Re];switch(fe){case"boolean":ke=ke==="true";break;case"media":ke=ke&&JSON.parse(ke);break}return{...ve,[Re]:ke}}return ve},{})||{}}),J=async(U,ve)=>{U.preventDefault();const Ie=V(ve),{success:Re,data:fe,error:ke}=cH({isSingleSelected:m,additionalFields:S.data?.additionalFields??mH}).safeParse(Ie);if(Re){const Ne=fe.title.trim()?fe.title.trim():fe.type==="INTERNAL"?le(fe?.related?.toString(),fe.relatedType,m):"";h(!0);const bt=await uH(fe.type==="INTERNAL"?{slugify:ne.mutateAsync,title:Ne,related:fe.related,relatedType:fe.relatedType}:{slugify:ne.mutateAsync,title:Ne});if(ne.reset(),h(!1),!bt){I({type:"warning",message:c(M("popup.item.form.uiRouter.unableToRender"))});return}r(fe.type==="INTERNAL"?{...fe,title:Ne,uiRouterKey:bt}:{...fe,title:Ne,uiRouterKey:bt})}else ke&&k(ke.issues.reduce((Ne,bt)=>({...Ne,[bt.path.join(".")]:bt.message}),{}))},W=(U,ve)=>ue.get($,U)?c(M(ve??U)):void 0,K=n.type==="INTERNAL"?n.relatedType:void 0,{path:F,type:Q,title:pe,autoSync:we}=x,{relatedType:ce,related:Ce}=x.type==="INTERNAL"?x:{related:void 0,relatedType:void 0},P=Q==="EXTERNAL",oe=Q==="INTERNAL",_=P?"externalPath":"path",G=oe&&!m&&ue.isNil(Ce)||d,Z=jw({uid:ce??"",locale:s}),ne=dH(),ae=p.useMemo(()=>t.map((U,ve)=>({key:`${U}-${ve}`,value:U,label:U})),[t]),be=p.useMemo(()=>R.map(U=>({value:U.documentId??0,label:U.name??" "})),[R]),le=p.useCallback((U,ve,Ie)=>{let Re;if(Ie){if(Re=Z.data?.find(fe=>fe.uid===ve||fe.__collectionUid===ve),!Re)return A.find(fe=>fe.uid===ve)?.contentTypeName}else Re={...Z.data?.find(({documentId:ke})=>ke===U)||{documentId:null},__collectionUid:ve};return Sl(Re,S.data)},[Z.data,S.data,A]),$e=(S.data?.contentTypes.length?["INTERNAL","EXTERNAL","WRAPPER"]:["EXTERNAL","WRAPPER"]).map(U=>({key:U,value:U,label:c(M(`popup.item.form.type.${U.toLowerCase()}.label`))})),Be=ue.sortBy(Z.data?.map(U=>{const ve=o(Sl({...U,__collectionUid:ce},S.data),U,!1);return{key:U?.documentId?.toString(),value:U?.documentId?.toString(),label:ve}})??[],U=>U.label),se=p.useMemo(()=>ue.sortBy(S.data?.contentTypes?.filter(U=>U.isSingle?!!(ce&&[ce,K].includes(U.uid)):!0).map(U=>({key:U.uid,value:U.uid,label:U.contentTypeName})),U=>U.label),[S.data,ce]),Ee=ue.isEmpty(Be),Ge=p.useCallback(async U=>{U.preventDefault(),U.stopPropagation();const ve=j.data?.find(({locale:Ie})=>Ie===b);ve&&(h(!0),E.mutate({target:l.documentId,structureId:n.structureId,source:ve.documentId},{onSuccess(Ie){E.reset();const{type:Re,externalPath:fe,path:ke,related:Ne,title:bt,uiRouterKey:uo}=Ie,{__type:vt,documentId:r0}=Ne??{};D("type",Re),D("externalPath",fe??void 0),D("path",ke??void 0),D("title",bt),D("uiRouterKey",uo),vt&&r0&&(D("related",r0),D("relatedType",vt))},onSettled(){h(!1)}}))},[h,E,j]);return p.useEffect(()=>{y(q({...dp,...n}))},[n]),p.useEffect(()=>{if(ce){const U=S.data?.contentTypes.find(ve=>ve.uid===ce);if(U&&(g(U.isSingle),U.isSingle&&Z.data?.length)){const ve=Z.data[0];ve&&D("related",ve.documentId)}}},[ce,S.data,Z.data]),p.useEffect(()=>{if(we&&Q==="INTERNAL"&&Ce&&ce&&S.data){const U=Z.data?.find(ve=>ve.documentId===Ce);if(U){const{contentTypesNameFields:ve,pathDefaultFields:Ie}=S.data,Re=Ie[ce]?.reduce((Ne,bt)=>Ne||U?.[bt],void 0),fe=(ve[ce]??[]).concat(ve.default??[]).reduce((Ne,bt)=>Ne||U?.[bt],void 0),ke=[];Re&&Re!==F&&ke.push({name:"path",value:Re}),fe&&fe!==pe&&ke.push({name:"title",value:fe}),setTimeout(()=>{ke.forEach(Ne=>{D(Ne.name,Ne.value)})},100)}}},[pe,F,we,Q,Ce,ce,S.data,Z.data]),u.jsxs(u.Fragment,{children:[u.jsx(dt.Body,{children:u.jsx(Se.Form,{width:"auto",height:"auto",method:"POST",initialValues:x,children:({values:U,onChange:ve})=>{const Ie=U.type==="INTERNAL"?U:{related:void 0,relatedType:void 0},Re=fH({currentPath:U.path,isExternal:U.type==="EXTERNAL",current:n,currentType:U.type,config:S.data,contentTypeItems:Z.data,currentRelated:Ie.related,currentRelatedType:Ie.relatedType,isSingleSelected:m});return u.jsxs(u.Fragment,{children:[u.jsxs(de.Root,{gap:5,paddingBottom:1,children:[u.jsx(de.Item,{alignItems:"flex-start",col:8,children:u.jsx(je.Field,{name:"type",label:c(M("popup.item.form.type.label","Internal link")),error:W("type"),hint:c(M("popup.item.form.title.placeholder","e.g. Blog")),children:u.jsx(Jn,{onChange:fe=>O("type",fe,ve),value:U.type,name:"type",disabled:!f,width:"100%",children:$e.map(({key:fe,label:ke,value:Ne})=>u.jsx(er,{value:Ne,children:ke},fe))})})},"title"),u.jsx(de.Item,{alignItems:"flex-start",col:4,children:u.jsx(je.Field,{name:"menuAttached",label:c(M("popup.item.form.menuAttached.label","MenuAttached")),error:W("menuAttached"),hint:c(M("popup.item.form.menuAttached.placeholder","is menu item attached to menu")),children:u.jsx($n,{name:"menuAttached",checked:U.menuAttached,onChange:fe=>O(fe,!U.menuAttached,ve),value:U.menuAttached,onLabel:c(M("popup.item.form.menuAttached.value.yes","yes")),offLabel:c(M("popup.item.form.menuAttached.value.no","no")),disabled:!f||(S.data?.cascadeMenuAttached?!(n.isMenuAllowedLevel&&n.parentAttachedToMenu):!1),width:"100%"})})},"menuAttached")]}),u.jsxs(de.Root,{gap:5,paddingTop:1,paddingBottom:1,children:[u.jsx(de.Item,{alignItems:"flex-start",col:U.type==="INTERNAL"?8:12,children:u.jsx(je.Field,{name:"title",label:c(M("popup.item.form.title.label","Title")),error:W("title"),hint:c(M("popup.item.form.title.placeholder","e.g. Blog")),children:u.jsx($r,{type:"string",disabled:!f||U.autoSync&&U.type==="INTERNAL",name:"title",onChange:(fe,ke)=>O(fe,ke,ve),value:U.title})})},"title"),U.type==="INTERNAL"&&u.jsx(de.Item,{alignItems:"flex-start",col:4,children:u.jsx(je.Field,{name:"autoSync",label:c(M("popup.item.form.autoSync.label","Read fields from related")),error:W("autoSync"),children:u.jsx($n,{name:"autoSync",checked:U.autoSync,onChange:fe=>O(fe,!U.autoSync,ve),onLabel:"Enabled",offLabel:"Disabled"})})},"autoSync")]}),u.jsx(de.Root,{gap:5,paddingTop:1,paddingBottom:1,children:u.jsx(de.Item,{alignItems:"flex-start",col:12,children:u.jsx(je.Field,{name:_,label:c(M(`popup.item.form.${_}.label`,"Path")),error:W(_,`popup.item.form.${_}.validation.type`),hint:[c(M(`popup.item.form.${_}.placeholder`,"e.g. Blog")),Re?c(M("popup.item.form.type.external.description"),{value:Re}):""].join(" "),children:u.jsx($r,{disabled:!f,name:_,onChange:(fe,ke)=>O(fe,ke,ve),value:U[_],width:"100%"})})},"title")}),U.type==="INTERNAL"&&u.jsxs(de.Root,{gap:5,paddingTop:1,paddingBottom:1,children:[u.jsx(de.Item,{alignItems:"flex-start",col:U.relatedType&&!m?6:12,children:u.jsx(je.Field,{name:"relatedType",label:c(M("popup.item.form.relatedType.label","Related Type")),error:W("relatedType"),hint:!d&&ue.isEmpty(se)?c(M("popup.item.form.relatedType.empty","There are no more content types")):void 0,children:u.jsx(hp,{name:"relatedType",onClear:()=>B({related:void 0,title:void 0,relatedType:void 0}),onChange:fe=>B({related:void 0,title:U.autoSync?"":U.title,relatedType:fe}),value:U.relatedType,options:S.data?.contentTypes.map(fe=>({key:fe.uid,value:fe.uid,label:fe.contentTypeName}))??[],disabled:!S.data?.contentTypes.length||!f})})}),U.relatedType&&!m&&u.jsx(de.Item,{alignItems:"flex-start",col:6,children:u.jsx(je.Field,{name:"related",label:c(M("popup.item.form.related.label","Related")),error:W("related"),hint:!d&&Ee?c(M("popup.item.form.related.empty","There are no more entities"),{contentTypeName:U.relatedType}):void 0,children:u.jsx(hp,{name:"related",onClear:()=>O("related",void 0,ve),onChange:fe=>O("related",fe,ve),value:U.related,options:Be,disabled:d||Ee||!f})})})]}),!ue.isEmpty(S.data?.additionalFields)&&u.jsxs(u.Fragment,{children:[u.jsx(de.Root,{gap:5,paddingTop:1,paddingBottom:1,children:u.jsx(de.Item,{col:12,lg:12,children:u.jsx(ji,{width:"100%"})})}),u.jsxs(de.Root,{gap:5,paddingTop:1,paddingBottom:1,children:[S.data?.additionalFields.map((fe,ke)=>{if(fe!=="audience")return u.jsx(de.Item,{alignItems:"flex-start",col:6,children:u.jsx(je.Field,{name:`additionalFields.${fe.name}`,label:fe.label,error:W(`additionalFields.${fe.name}`),children:u.jsx(rH,{name:`additionalFields.${fe.name}`,field:fe,isLoading:d,onChange:ve,onChangeEnhancer:O,value:ue.get(U?.additionalFields,fe.name),disabled:!f})})},fe.name)}),S.data?.additionalFields.map((fe,ke)=>{if(fe==="audience")return u.jsx(de.Item,{alignItems:"flex-start",col:12,children:u.jsx(je.Field,{name:"audience",label:c(M("popup.item.form.audience.label")),error:W("audience"),hint:!d&&ue.isEmpty(be)?c(M("popup.item.form.title.placeholder","e.g. Blog")):void 0,children:u.jsx(wi,{name:"audience",value:U.audience,onChange:Ne=>O("audience",Ne,ve),width:"100%",children:be.map(({value:Ne,label:bt})=>u.jsx(Br,{value:Ne,children:bt},Ne))})})},"audience")})]}),u.jsx(de.Root,{gap:5,paddingTop:1,paddingBottom:1,children:u.jsx(de.Item,{col:12,lg:12,children:u.jsx(ji,{width:"100%"})})})]}),ae&&ae.length>1&&u.jsx(de.Root,{gap:5,paddingTop:1,paddingBottom:1,children:u.jsxs(de.Item,{alignItems:"flex-start",col:12,children:[u.jsx(ji,{marginTop:5,marginBottom:5}),u.jsxs(de.Root,{gap:5,children:[u.jsx(de.Item,{alignItems:"flex-start",col:6,lg:12,children:u.jsx(je.Field,{name:"i18n.locale",label:c(M("popup.item.form.i18n.locale.label","Copy details from")),children:u.jsx(Jn,{name:"i18n.locale",onChange:v,value:b,disabled:d||!f,placeholder:c(M("popup.item.form.i18n.locale.placeholder","locale")),children:ae.map(({key:fe,label:ke,value:Ne})=>u.jsx(er,{value:Ne,children:ke},fe))})})}),f&&u.jsx(de.Item,{alignItems:"flex-start",col:6,lg:12,paddingTop:6,children:u.jsx(re,{children:u.jsx(Xe,{variant:"tertiary",onClick:Ge,disabled:d||!b,children:c(M("popup.item.form.i18n.locale.button"))})})})]})]},"title")}),u.jsx(de.Root,{gap:5,children:u.jsx(de.Item,{alignItems:"flex-start",col:12},"title")})]})}})}),u.jsx(iH,{handleSubmit:U=>J(U,x),handleCancel:i,submitDisabled:G,canUpdate:f})]})},gH=()=>"",bH=({isNewItem:t,canUpdate:e})=>{const{formatMessage:n}=Ve.useIntl();let r="view";return e&&(r=t?"new":"edit"),u.jsx(dt.Header,{children:u.jsx(ee,{variant:"omega",fontWeight:"bold",textColor:"neutral800",as:"h2",id:"asset-dialog-title",children:n(M(`popup.item.header.${r}`))})})},vH=({availableLocale:t,isOpen:e,isLoading:n,currentItem:r={},onSubmit:i,onClose:o,locale:s,permissions:a,currentNavigation:l})=>{const{formatMessage:c}=Ve.useIntl(),d=m=>{i(m)},h=(m,g,b)=>`${fz({relatedRef:g,type:g.isSingle?"INTERNAL":g.type,isCollection:b})?"":`[${c(M("notification.navigation.item.relation.status.draft"))}] `.toUpperCase()}${m}`,f=!!r.viewId;return u.jsx(dt.Root,{labelledBy:"condition-modal-breadcrumbs",onOpenChange:m=>{m||o({preventDefault(){},stopPropagation(){},target:{}})},open:e,children:u.jsxs(dt.Content,{children:[u.jsx(bH,{isNewItem:!f,canUpdate:a?.canUpdate}),u.jsx(pH,{availableLocale:t,current:r,isLoading:n,onSubmit:d,onCancel:o,appendLabelPublicationStatus:h,locale:s,permissions:a,currentNavigation:l})]})})},bd=0,xH=({value:t,setValue:e,initialIndex:n=bd})=>{const[r,i]=p.useState(t),[o,s]=p.useState(t),[a,l]=p.useState(n),[c,d]=p.useState(!!t),h=p.useRef(null),{formatMessage:f}=Ve.useIntl();p.useEffect(()=>{c&&setTimeout(()=>{h.current?.querySelector("input")?.focus()},0)},[c]),p.useEffect(()=>{a&&r===o&&e({value:r,index:a})},[a,r,o]),p.useEffect(()=>{r!==o&&(s(r),l(bd),e({value:r,index:bd}))},[r,o]);const m=p.useCallback(v=>{v.code.toLowerCase()==="enter"&&l(x=>x+1)},[]),g=p.useCallback(v=>{i(v.target.value)},[i]),b=p.useCallback(()=>{i(""),d(!1)},[i,d]);return c?u.jsxs("div",{ref:h,children:[u.jsx(HV,{name:"searchbar",onClear:b,value:t,size:"S",onChange:g,clearLabel:"Clearing the search",placeholder:f(M("pages.main.search.placeholder","Type to start searching...")),onKeyDown:m,children:"Search for navigation items"}),u.jsx(ee,{variant:"pi",fontColor:"neutral150",style:{margin:"3px 0 0",display:"inline-block"},children:f(M("pages.main.search.subLabel","press ENTER to highlight next item"))})]}):u.jsx(At,{children:u.jsx(a2,{}),onClick:()=>d(!c)})},wH=new Fe.QueryClient,yH=()=>{const{formatMessage:t}=Ve.useIntl(),e=Jf(),[n,r]=p.useState(),[i,o]=p.useState(),[s,a]=p.useState(),[l,c]=p.useState(!1),[d,h]=p.useState(!1),[f,m]=p.useState(),g=p.useMemo(()=>({access:Hr.access||Hr.update,update:Hr.update}),[]),{isLoading:b,allowedActions:{canUpdate:v,canAccess:x}}=Se.useRBAC(g),y=e0(),$=js(),k=Ow(),S=Lw([y,{isPending:b}]),R=dz(),[{value:A,index:I},E]=p.useState({value:"",index:0}),j=ue.isEmpty(A),O=(A||"").toLowerCase(),D=(se,Ee,Ge)=>{const U=se.reduce((ve,Ie)=>{const Re=Ie.items?.length?D(Ie.items??[],Ee):[];return Ee(Ie)?[Ie,...Re,...ve]:[...Re,...ve]},[]);if(Ge!==void 0){const ve=Ge%U.length;return U.map((Ie,Re)=>ve===Re?{...Ie,isSearchActive:!0}:Ie)}return U},B=j?[]:D(i?.items.map(se=>({...se}))??[],se=>(se?.title||"").toLowerCase().includes(O),O?I:void 0),V=p.useCallback((se,Ee={})=>{a(Ee),c(se)},[c]),q=p.useCallback((se,Ee,Ge=!0,U="",ve=!0,Ie="0",Re=0)=>{v&&(se.preventDefault(),se.stopPropagation(),V(!0,{viewParentId:Ee,isMenuAllowedLevel:Ge,levelPath:U,parentAttachedToMenu:ve,structureId:Ie,viewId:void 0,order:Re+1}))},[V,v]),J=p.useMemo(()=>(e.data?[e.data.defaultLocale,...e.data.restLocale]:[]).filter(se=>se!==f),[e.data,f]),W=sz(),K=oz(),{i18nCopyItemsModal:F,i18nCopySourceLocale:Q,setI18nCopyModalOpened:pe,setI18nCopySourceLocale:we}=hz(p.useCallback(se=>{const Ee=y.data?.find(({locale:Ge,documentId:U})=>Ge===se&&U===i?.documentId);Ee&&Ee.documentId&&i?.documentId&&R.mutate({source:Ee.locale,target:i.locale,documentId:Ee.documentId},{onSuccess(Ge){R.reset(),o({...Ge.data,items:Ge.data.items.map($l)}),W(),K()}})},[i])),ce=p.useCallback(()=>{Q&&pe(!0)},[pe,Q]),Ce=Dw(se=>{o({...se,items:se.items.map($l)}),r({documentId:se.documentId,id:se.id}),h(!1)}),P=()=>{i&&Ce.mutate(i)},oe=se=>{se.preventDefault(),se.stopPropagation(),se.target.tagName!=="HTML"&&V(!1)},_=({item:se,newOrder:Ee})=>{be({...se,order:Ee})},G=se=>{be(mr({...se,removed:!0},!0))},Z=se=>{be(mr({...se,removed:!1},!0))},ne=se=>{be(mr({...se,collapsed:!se.collapsed,updated:!0,isSearchActive:!1},!0))},ae=({item:se,levelPath:Ee="",parentAttachedToMenu:Ge=!0})=>{V(!0,{...se,levelPath:Ee,parentAttachedToMenu:Ge})},be=se=>{if(i&&$.data){const Ee=Di(se,i?.items??[],$.data);o({...i,items:Ee}),h(!0),c(!1)}},le=j?i?.items??[]:B,Le=p.useCallback(()=>{i&&o({...i,items:i.items.map(se=>yi(se,!1))})},[o,i,yi]),$e=p.useCallback(()=>{i&&o({...i,items:i.items.map(se=>yi(se,!0))})},[o,i,yi]),Be=[{onClick:Le,type:"submit",variant:"tertiary",tradId:"header.action.expandAll",margin:"8px"},{onClick:$e,type:"submit",variant:"tertiary",tradId:"header.action.collapseAll",margin:"8px"}];return v&&Be.push({onClick:q,type:"submit",variant:"primary",tradId:"header.action.newItem",startIcon:u.jsx(Xh,{}),margin:"8px"}),p.useEffect(()=>{if(!i&&y.data?.[0]){let se;n?.documentId&&(se=y.data.find(Ee=>Ee.documentId===n.documentId&&Ee.id===n.id)),r(void 0),o(se||ue.first(y.data))}},[y.data,i]),p.useEffect(()=>{!f&&e.data?.defaultLocale&&m(e.data?.defaultLocale)},[y.data]),p.useEffect(()=>{if(i&&f!==i.locale){r(void 0);const se=y.data?.find(Ee=>Ee.documentId===i.documentId&&Ee.locale===f);se&&se.documentId===i.documentId&&se.locale!==i.locale&&o(se)}},[i,f,y.data]),p.useEffect(()=>{!f&&e.data?.defaultLocale&&m(e.data.defaultLocale)},[y.data]),!y.data||!e.data||S?u.jsx(Se.Page.Loading,{}):u.jsxs(Se.Layouts.Root,{children:[u.jsx(Se.Page.Title,{children:t(M("header.title","UI Navigation"))}),u.jsxs(Se.Page.Main,{children:[u.jsx(Bz,{availableNavigations:y.data,activeNavigation:i,handleCachePurge:()=>k.mutate(void 0),handleChangeSelection:o,handleLocalizationSelection:m,handleSave:P,locale:e.data,structureHasChanged:d,permissions:{canUpdate:v},currentLocale:f}),u.jsxs(Se.Layouts.Content,{children:[u.jsx(Fz,{startActions:u.jsx(xH,{value:A,setValue:E}),endActions:Be.map(({tradId:se,margin:Ee,...Ge},U)=>u.jsx(re,{marginLeft:Ee,children:u.jsxs(Xe,{...Ge,children:[" ",t(M(se))," "]})},U))}),i?.items.length?u.jsx(Fw,{items:le,onItemLevelAdd:q,onItemRemove:G,onItemEdit:ae,onItemRestore:Z,onItemReOrder:_,onItemToggleCollapse:ne,displayFlat:!j,isParentAttachedToMenu:!0,permissions:{canUpdate:v,canAccess:x},structurePrefix:"",locale:f??""}):u.jsxs(Y,{direction:"column",minHeight:"400px",justifyContent:"center",children:[u.jsx(re,{padding:4,children:u.jsx(ee,{variant:"beta",textColor:"neutral600",children:t(M("empty.description"))})}),v&&u.jsx(Xe,{variant:"secondary",startIcon:u.jsx(mS,{}),label:t(M("empty.cta")),onClick:q,children:t(M("empty.cta"))}),v&&J.length?u.jsxs(Y,{direction:"column",justifyContent:"center",children:[u.jsx(re,{paddingTop:3,paddingBottom:3,children:u.jsx(ee,{variant:"beta",textColor:"neutral600",children:t(M("view.i18n.fill.cta.header"))})}),u.jsxs(Y,{direction:"row",justifyContent:"center",alignItems:"center",children:[u.jsx(re,{paddingLeft:1,paddingRight:1,children:u.jsx(Jn,{onChange:we,value:Q,size:"S",children:J.map(se=>u.jsx(er,{value:se,children:t(M("view.i18n.fill.option"),{locale:se})},se))})}),u.jsx(re,{paddingLeft:1,paddingRight:1,children:u.jsx(Xe,{variant:"tertiary",onClick:ce,disabled:!Q,size:"S",children:t(M("view.i18n.fill.cta.button"))})})]})]}):null]}),l&&f&&i&&u.jsx(vH,{availableLocale:J,currentItem:s,onSubmit:be,onClose:oe,locale:f,permissions:{canUpdate:v},isOpen:l,isLoading:b,currentNavigation:i}),v&&F]})]})]})};function CH(){const t=je.usePluginTheme();return u.jsx(Fe.QueryClientProvider,{client:wH,children:u.jsx(nw,{theme:t,children:u.jsx(yH,{})})})}const $H=()=>u.jsx(vd.DndProvider,{backend:_w.HTML5Backend,children:u.jsxs(bc.Routes,{children:[u.jsx(bc.Route,{path:"/",index:!0,Component:CH}),u.jsx(bc.Route,{path:"/*",Component:Se.Page.Error})]})}),SH=En.default(jN)`
|
|
155
2342
|
[role='status'] {
|
|
156
2343
|
flex-direction: column;
|
|
157
2344
|
}
|
|
158
|
-
`,qa=({onChange:e,initialValue:n,...i})=>{const[s,d]=p.useState(j.isArray(n)?n.reduce((h,x)=>`${h}${x}; `,""):""),r=h=>{const x=h?.target.value??"",F=x.split(";").map(g=>g.trim()).filter(g=>!!g.length);d(x??""),e(F)};return t.jsx(a.TextInput,{...i,onChange:r,value:s})},Oa=["string","boolean","select","media"],de="pages.settings.form.customFields.popup.",Ga=e=>e.map((n,i)=>({key:`${n}-${i}`,metadatas:{intlLabel:{id:n,defaultMessage:n},hidden:!1,disabled:!1},value:n,label:n})),Va=({isEditForm:e,customField:n,onSubmit:i,onClose:s})=>{const d=Ga(Oa),{formatMessage:r}=H.useIntl(),[h,x]=p.useState({}),[F,g]=p.useState(),{type:f}=h;p.useEffect(()=>{n&&x({...n})},[n]);const S=(T,u,v)=>{if(v){let A=T,V=u;if(j.isObject(T)){const{name:le,value:M}=T.target;A=le,V=j.isNil(V)?M:V}return j.isString(A)&&b(A,V),v(T,V)}},b=(T,u)=>{x(j.set({...h},T,u))},$=T=>{if(j.get(F,T))return r(l(T))},I=(T,u)=>{const{success:v,data:A,error:V}=yt.safeParse({...u,enabled:!0});v?i(A):V&&g(V.issues.reduce((le,M)=>({...le,[M.path.join(".")]:M.message}),{}))};return t.jsxs(t.Fragment,{children:[t.jsx(a.Modal.Body,{children:t.jsx(P.Form,{method:"POST",width:"auto",height:"auto",initialValues:h,children:({values:T,onChange:u})=>t.jsxs(a.Grid.Root,{gap:5,children:[t.jsx(a.Grid.Item,{col:12,children:t.jsx(G.Field,{name:"name",label:r(l(`${de}name.label`)),hint:r(l(`${de}name.description`)),error:$("name"),children:t.jsx(a.TextInput,{name:"name",value:T.name,onChange:(v,A)=>S(v,A,u),placeholder:r(l(`${de}name.placeholder`)),type:"string",disabled:e,width:"100%"})})},"name"),t.jsx(a.Grid.Item,{col:12,children:t.jsx(G.Field,{name:"label",label:r(l(`${de}label.label`)),hint:r(l(`${de}label.description`)),error:$("label"),children:t.jsx(a.TextInput,{name:"label",value:T.label,onChange:(v,A)=>S(v,A,u),placeholder:r(l(`${de}label.placeholder`)),type:"string",width:"100%"})})},"label"),t.jsx(a.Grid.Item,{col:12,children:t.jsx(G.Field,{name:"type",label:r(l(`${de}type.label`)),hint:r(l(`${de}type.description`)),children:t.jsx(a.SingleSelect,{name:"type",value:T.type,onChange:v=>S("type",v,u),disabled:e,width:"100%",children:d.map(({key:v,label:A,value:V})=>t.jsx(a.SingleSelectOption,{value:V,children:A},v))})})},"type"),f==="select"&&t.jsxs(t.Fragment,{children:[t.jsx(a.Grid.Item,{col:12,children:t.jsx(G.Field,{name:"multi",label:r(l(`${de}multi.label`)),hint:r(l(`${de}multi.description`)),error:$("multi"),children:t.jsx(a.Toggle,{name:"multi",checked:T.multi,onChange:v=>S(v,!T.multi,u),onLabel:"true",offLabel:"false",width:"100%"})})},"multi"),t.jsx(a.Grid.Item,{col:12,children:t.jsx(G.Field,{name:"options",label:r(l(`${de}options.label`)),hint:r(l(`${de}options.description`)),error:$("options"),children:t.jsx(qa,{name:"options",onChange:v=>S("options",v,u),initialValue:T.options})})},"options")]}),t.jsx(a.Grid.Item,{col:12,children:t.jsx(G.Field,{name:"required",label:r(l(`${de}required.label`)),hint:r(l(`${de}required.description`)),error:$("required"),children:t.jsx(a.Toggle,{name:"required",placeholder:r(l(`${de}required.placeholder`)),checked:T.required,onChange:v=>S(v,!T.required,u),onLabel:"true",offLabel:"false",width:"100%"})})},"required")]})})}),t.jsxs(a.Modal.Footer,{children:[t.jsx(a.Modal.Close,{children:t.jsx(a.Button,{onClick:s,variant:"tertiary",children:r(l("popup.item.form.button.cancel"))})}),t.jsx(a.Button,{onClick:T=>I(T,h),children:r(l("popup.item.form.button.save"))})]})]})},_a=({isOpen:e,onClose:n,onSubmit:i,data:s})=>{const d=!!s,{formatMessage:r}=H.useIntl();return t.jsx(a.Modal.Root,{onOpenChange:h=>{h||n()},open:e,labelledBy:"custom-field-modal",children:t.jsxs(a.Modal.Content,{children:[t.jsx(a.Modal.Header,{children:t.jsx(a.Typography,{variant:"omega",fontWeight:"bold",textColor:"neutral800",as:"h2",id:"asset-dialog-title",children:r(l(`pages.settings.form.customFields.popup.header.${d?"edit":"new"}`))})}),t.jsx(Va,{isEditForm:d,customField:j.pick(s,"name","label","type","required","options","multi"),onSubmit:i,onClose:n})]})})},ut=t.jsx(O.PriceTag,{}),Qa=t.jsx(O.Plus,{}),fe="pages.settings.form.customFields.table.",Ka=({data:e=[],onOpenModal:n,onRemoveCustomField:i,onToggleCustomField:s})=>{const[d,r]=p.useState(!1),[h,x]=p.useState(null),{toggleNotification:F}=P.useNotification(),g=p.useMemo(()=>j.sortBy(e,"name"),[e]),{formatMessage:f}=H.useIntl(),S=p.useCallback(I=>{x(I),r(!0)},[x,r]),b=p.useCallback(()=>{x(null),r(!1)},[x,r]),$=p.useCallback(()=>{h===null?F({type:"warning",message:f(l(`${fe}confirmation.error`))}):i(h),b()},[b,h,Qe,i,F]);return t.jsxs(t.Fragment,{children:[t.jsx(We,{isVisible:d,header:f(l(`${fe}confirmation.header`)),children:f(l(`${fe}confirmation.message`)),labelConfirm:f(l(`${fe}confirmation.confirm`)),iconConfirm:ut,mainIcon:ut,onConfirm:$,onCancel:b}),t.jsxs(a.Table,{width:"100%",colCount:4,rowCount:e.length+1,footer:t.jsx(a.TFooter,{onClick:I=>{I.preventDefault(),n(null)},icon:Qa,children:f(l(`${fe}footer`))}),children:[t.jsx(a.Thead,{children:t.jsxs(a.Tr,{children:[t.jsx(a.Th,{width:"20%",children:t.jsx(a.Typography,{variant:"sigma",textColor:"neutral600",children:f(l(`${fe}header.name`))})}),t.jsx(a.Th,{width:"60%",children:t.jsx(a.Typography,{variant:"sigma",textColor:"neutral600",children:f(l(`${fe}header.label`))})}),t.jsx(a.Th,{width:"15%",children:t.jsx(a.Typography,{variant:"sigma",textColor:"neutral600",children:f(l(`${fe}header.type`))})}),t.jsx(a.Th,{width:"5%",children:t.jsx(a.Typography,{variant:"sigma",textColor:"neutral600",children:f(l(`${fe}header.required`))})}),t.jsx(a.Th,{children:t.jsx(a.VisuallyHidden,{})})]})}),t.jsx(a.Tbody,{children:g.map(I=>typeof I!="string"?t.jsxs(a.Tr,{children:[t.jsx(a.Td,{width:"20%",children:t.jsx(a.Typography,{fontWeight:"semiBold",textColor:"neutral800",children:I.name})}),t.jsx(a.Td,{width:"60%",children:t.jsx(a.Typography,{textColor:"neutral800",children:I.label})}),t.jsx(a.Td,{width:"15%",children:t.jsx(a.Typography,{textColor:"neutral800",children:I.type})}),t.jsx(a.Td,{width:"5%",children:t.jsx(a.Tooltip,{description:f(l(`${fe}${I.required?"required":"notRequired"}`)),children:t.jsx(a.Typography,{textColor:"neutral800",children:I.required?t.jsx(O.Check,{}):t.jsx(O.Minus,{})})})}),t.jsx(a.Td,{children:t.jsx(a.Flex,{width:"100%",justifyContent:"flex-end",alignItems:"center",children:t.jsxs(a.IconButtonGroup,{children:[t.jsx(a.IconButton,{onClick:()=>s(I),label:f(l(`${fe}${I.enabled?"disable":"enable"}`)),variant:I.enabled?"success-light":"tertiary",children:I.enabled?t.jsx(O.Eye,{}):t.jsx(O.EyeStriked,{}),style:{minWidth:50}}),t.jsx(a.IconButton,{onClick:()=>n(I),label:f(l(`${fe}edit`)),children:t.jsx(O.Pencil,{}),style:{minWidth:50}}),t.jsx(a.IconButton,{onClick:()=>S(I),label:f(l(`${fe}remove`)),children:t.jsx(O.Trash,{}),style:{minWidth:50}})]})})})]},I.name):null)})]})]})},Ua=/^(?<type>[a-z0-9-]+)\:{2}(?<api>[a-z0-9-]+)\.{1}(?<contentType>[a-z0-9-]+)$/i,Wa=(e="",n={})=>{const{allowedContentTypes:i=[],restrictedContentTypes:s=[],contentTypes:d=[],preferCustomContentTypes:r=!1}=n,x=(r?["api::",...d]:i).filter(g=>e.includes(g)||e===g).length>0,F=s.filter(g=>e.includes(g)||e===g).length===0;return!!e&&x&&F},Ha=(e="")=>{const n=r=>r.split("-").map(h=>j.capitalize(h)).join(""),[i,s,d]=Xa(e);return i==="api"?n(d):`${n(s)}${n(d)}`},Xa=(e="")=>e.split(Ua).filter(n=>n&&n.length>0),pt="SERVER OFFLINE",Nt=(e,n)=>new Promise(i=>{fetch(`${window.strapi.backendURL}/_health`,{method:"HEAD",mode:"no-cors",headers:{"Content-Type":"application/json","Keep-Alive":"false"}}).then(s=>{if(s.status>=400)throw new Error;if(!n)throw new Error(pt);i(e)}).catch(s=>{setTimeout(()=>Nt(e,s.message!==pt).then(i),100)})}),Za=()=>{const e=P.getFetchClient(),n=ee(e);return W.useQuery({queryKey:n.readSettingsConfigIndex(),queryFn(){return n.readSettingsConfig()},staleTime:1e3*60*5})},Ja=()=>{const e=P.getFetchClient(),n=ee(e),i=W.useQuery({queryKey:n.healthCheckIndex(),queryFn:()=>n.healthCheck(),retry:!0,retryDelay:1e3*5,enabled:!1});return W.useMutation({mutationFn:()=>n.restart().then(()=>i.refetch())})},Ya=()=>{const e=P.getFetchClient(),n=ee(e);return W.useMutation({mutationFn:()=>n.restoreConfig()})},ei=()=>{const e=P.getFetchClient(),n=ee(e);return W.useQuery({queryKey:n.readContentTypeIndex(),queryFn:()=>n.readContentType(),staleTime:1/0})},ti=()=>{const e=P.getFetchClient(),n=ee(e);return W.useMutation({mutationFn(i){return n.updateConfig({...i,contentTypesNameFields:Object.fromEntries(i.contentTypesNameFields.map(({key:s,fields:d})=>[s,d])),contentTypesPopulate:Object.fromEntries(i.contentTypesPopulate.map(({key:s,fields:d})=>[s,d])),pathDefaultFields:Object.fromEntries(i.pathDefaultFields.map(({key:s,fields:d})=>[s,d])),additionalFields:i.audienceFieldChecked?[...i.additionalFields,"audience"]:i.additionalFields,gql:{navigationItemRelated:i.contentTypes.map(s=>Ha(s))}})}})},ni=Gt.omit({contentTypesNameFields:!0}).extend({audienceFieldChecked:c.z.boolean(),contentTypesNameFields:c.z.object({key:c.z.string(),fields:c.z.string().array()}).array(),contentTypesPopulate:c.z.object({key:c.z.string(),fields:c.z.string().array()}).array(),pathDefaultFields:c.z.object({key:c.z.string(),fields:c.z.string().array()}).array()}),Pe={background:"neutral0",hasRadius:!0,shadow:"filterShadow",padding:6},ai=["relation","media","component","dynamiczone"],mt=new W.QueryClient,ii=()=>{const e=Za(),n=ei(),i=ti(),s=Ya(),d=Ja(),{formatMessage:r}=H.useIntl(),[h,x]=p.useState({required:!1}),[F,g]=p.useState(!1),f=P.useAuth("SettingsPage",y=>y.permissions),S=p.useMemo(()=>!!f.find(({action:y})=>y===Ae.settings[0].action),[f]),b=p.useMemo(()=>!!f.find(({action:y})=>y===Ae.access[0].action),[f]),$=e.isPending||n.isPending||i.isPending||d.isPending||s.isPending,[I,T]=p.useState({}),[u,v]=p.useState(),[A,V]=p.useState(!1),[le,M]=p.useState(!1),[J,ne]=p.useState(null),{contentTypesNameFields:be,contentTypes:je,additionalFields:ce,preferCustomContentTypes:te}=I,Z=(y,z,w)=>{if(w){let R=y,k=z;if(j.isObject(y)){const{name:D,value:X}=y.target;R=D,k=j.isNil(k)?X:k}return j.isString(R)&&ie(R,k),w(y,k)}},ie=(y,z)=>{T(w=>j.set({...w},y,z))},ue=y=>{if(j.get(u,y))return r(l(y))},Ie=y=>{ne(y),V(!0)},Ce=y=>{const z=ce.filter(w=>typeof w!="string"?w.name!==y.name:!0);ie("additionalFields",z),ne(null),V(!1)},oe=y=>{const z={...y,enabled:!y.enabled},w=ce.map(R=>typeof R!="string"&&y.name===R.name?z:R);ie("additionalFields",w)},ve=y=>{const w=!!ce.find(R=>typeof R!="string"?R.name===y.name:!1)?ce.map(R=>typeof R!="string"&&y.name===R.name?y:R):[...ce,y];ie("additionalFields",w),ne(null),V(!1)},Se=$?[]:j.sortBy(Object.values(n.data??[]).filter(({uid:y})=>Wa(y,{allowedContentTypes:e.data?.allowedContentTypes,restrictedContentTypes:e.data?.restrictedContentTypes,preferCustomContentTypes:te,contentTypes:je})).map(y=>{const z=n.data?.find(w=>w.uid===y.uid);if(z){const{isDisplayed:w,kind:R}=z;return{...y,available:w,isSingle:R==="singleType"}}return y}),y=>y.info.displayName),pe=(y,z)=>{const{success:w,data:R,error:k}=ni.safeParse(z);w?i.mutate(R,{onSuccess(){x({required:!0}),i.reset()}}):k&&(v(k.issues.reduce((D,X)=>({...D,[X.path.join(".")]:X.message}),{})),console.warn("Invalid form data",k))},Te=async y=>{M(!1),y&&(s.mutate(),x({required:!0}))},Fe=async()=>{d.mutate(void 0,{onSuccess(){g(!0),Nt(!0).then(y=>{y&&window.location.reload()})},onError(){x({required:!1})}})},ae=()=>x({required:!1}),ye=(y,z)=>{const w=z.map(k=>({key:k,fields:y[k]??[]}));return Object.entries(y).filter(([k,D])=>!z.includes(k)).map(([k,D])=>({key:k,fields:D})).concat(w)};return p.useEffect(()=>{if(e.data){const{additionalFields:y,contentTypes:z,contentTypesNameFields:w,contentTypesPopulate:R,pathDefaultFields:k}=e.data;T({...e.data,additionalFields:y.filter(D=>typeof D!="string"),audienceFieldChecked:y.includes("audience"),contentTypesNameFields:ye(w,z),contentTypesPopulate:ye(R,z),pathDefaultFields:ye(k,z)})}},[e.data]),S?$||F?t.jsx(P.Page.Loading,{}):t.jsxs(P.Layouts.Root,{children:[t.jsxs(P.Page.Main,{children:[t.jsx(P.Page.Title,{children:r(l("pages.settings.header.title"))}),t.jsx(P.Layouts.Header,{title:r(l("pages.settings.header.title")),subtitle:r(l("pages.settings.header.description")),primaryAction:b?t.jsx(a.Button,{startIcon:t.jsx(O.Check,{}),disabled:h.required,onClick:y=>pe(y,I),children:r(l("pages.settings.actions.submit"))}):null}),t.jsx(P.Layouts.Content,{children:t.jsx(P.Form,{method:"POST",width:"auto",height:"auto",initialValues:I,children:({values:y,onChange:z})=>t.jsxs(a.Flex,{direction:"column",gap:4,children:[h.required&&t.jsx(a.Box,{...Pe,width:"100%",children:t.jsx(Da,{closeLabel:r(l("pages.settings.actions.restart.alert.cancel")),title:r(l("pages.settings.actions.restart.alert.title")),action:t.jsx(a.Box,{children:t.jsx(a.Button,{onClick:Fe,startIcon:t.jsx(O.Play,{}),children:r(l("pages.settings.actions.restart.label"))})}),onClose:ae,children:t.jsxs(t.Fragment,{children:[t.jsx(a.Box,{paddingBottom:1,children:r(l("pages.settings.actions.restart.alert.description"))}),h.reasons?.map((w,R)=>t.jsx(a.Box,{paddingBottom:1,children:r(l(`pages.settings.actions.restart.alert.reason.${w}`))},R))]})})}),t.jsx(a.Box,{...Pe,width:"100%",children:t.jsxs(a.Flex,{direction:"column",alignItems:"flex-start",gap:2,children:[t.jsx(a.Typography,{variant:"delta",as:"h2",children:r(l("pages.settings.general.title"))}),t.jsx(a.Grid.Root,{gap:4,width:"100%",children:t.jsx(a.Grid.Item,{col:12,s:12,xs:12,children:t.jsxs(a.Grid.Root,{gap:4,width:"100%",children:[t.jsx(a.Grid.Item,{col:4,s:12,xs:12,children:t.jsx(G.Field,{name:"preferCustomContentTypes",label:r(l("pages.settings.form.preferCustomContentTypes.label")),hint:r(l("pages.settings.form.preferCustomContentTypes.hint")),children:t.jsx(a.Toggle,{name:"preferCustomContentTypes",checked:y.preferCustomContentTypes,onChange:w=>Z(w,!y.preferCustomContentTypes,z),onLabel:r(l("components.toggle.enabled")),offLabel:r(l("components.toggle.disabled")),disabled:h.required,width:"100%"})})}),t.jsx(a.Grid.Item,{col:8,s:12,xs:12,children:t.jsx(G.Field,{name:"contentTypes",label:r(l("pages.settings.form.contentTypes.label")),hint:r(l("pages.settings.form.contentTypes.hint")),children:t.jsx(a.MultiSelect,{name:"contentTypes",label:r(l("pages.settings.form.contentTypes.label")),"aria-label":r(l("pages.settings.form.contentTypes.label")),placeholder:r(l("pages.settings.form.contentTypes.placeholder")),value:y.contentTypes,onChange:w=>{Z("contentTypes",w,z);const{contentTypesNameFields:R=[],contentTypesPopulate:k=[],pathDefaultFields:D=[]}=y,X=w.filter(E=>!R.find(me=>me.key===E))??[],_=R.filter(E=>!w.includes(E.key)||E.key==="default").map(({key:E})=>E)??[];ie("contentTypesNameFields",[...R.filter(({key:E})=>!_.includes(E)||E==="default")??[],...X.map(E=>({key:E,fields:[]}))]),ie("contentTypesPopulate",[...k.filter(({key:E})=>!_.includes(E)||E==="default")??[],...X.map(E=>({key:E,fields:[]}))]),ie("pathDefaultFields",[...D.filter(({key:E})=>!_.includes(E)||E==="default")??[],...X.map(E=>({key:E,fields:[]}))])},disabled:h.required,error:ue("contentTypes"),withTags:!0,width:"100%",children:Se.map(w=>t.jsx(a.MultiSelectOption,{value:w.uid,children:w.info.displayName},w.uid))})})}),t.jsx(a.Grid.Item,{col:12,s:12,xs:12,children:je?.length?t.jsx(a.Accordion.Root,{style:{width:"100%"},children:be.map((w,R)=>{const k=n.data?.find(({uid:E})=>E===w.key),D=k?.attributes??{},X=Object.keys(D).sort(),_=X.filter(E=>ai.includes(D[E]?.type));return k?t.jsxs(a.Accordion.Item,{value:w.key,children:[t.jsx(a.Accordion.Header,{children:t.jsx(a.Accordion.Trigger,{children:k?.info.displayName??r(l("pages.settings.form.nameField.default"))})}),t.jsx(a.Accordion.Content,{children:t.jsxs(a.Grid.Root,{gap:4,padding:2,children:[t.jsx(a.Grid.Item,{col:12,s:12,xs:12,children:t.jsx(G.Field,{name:`contentTypesNameFields[${R}]`,label:r(l("pages.settings.form.nameField.label")),hint:r(l(`pages.settings.form.nameField.${j.isEmpty(j.get(y,`contentTypesNameFields[${R}].fields`,[]))?"empty":"hint"}`)),children:t.jsx(a.MultiSelect,{name:`contentTypesNameFields[${R}]`,placeholder:r(l("pages.settings.form.nameField.placeholder")),value:j.get(y,`contentTypesNameFields[${R}].fields`),onChange:E=>{const me=j.get(y,"contentTypesNameFields",[]).map((re,ge)=>ge===R?{...re,fields:E}:re);return Z("contentTypesNameFields",me,z)},disabled:h.required,error:ue(`contentTypesNameFields[${R}]`),withTags:!0,children:X.map(E=>t.jsx(a.MultiSelectOption,{value:E,children:E},E))})})}),t.jsx(a.Grid.Item,{col:12,s:12,xs:12,children:t.jsx(G.Field,{name:`contentTypesPopulate[${R-1}]`,label:r(l("pages.settings.form.populate.label")),hint:r(l(`pages.settings.form.populate.${j.isEmpty(j.get(y,`contentTypesPopulate[${R-1}]fields`,[]))?"empty":"hint"}`)),children:t.jsx(a.MultiSelect,{width:"100%",name:`contentTypesPopulate[${R-1}]`,placeholder:r(l("pages.settings.form.populate.placeholder")),value:j.get(y,`contentTypesPopulate[${R-1}].fields`,[]),onChange:E=>{const me=j.get(y,"contentTypesPopulate",[]).map((re,ge)=>ge===R-1?{...re,fields:E}:re);return Z("contentTypesPopulate",me,z)},disabled:h.required,error:ue(`contentTypesPopulate[${R-1}]`),withTags:!0,children:_.map(E=>t.jsx(a.MultiSelectOption,{value:E,children:E},E))})})}),t.jsx(a.Grid.Item,{col:12,s:12,xs:12,children:t.jsx(G.Field,{name:`pathDefaultFields[${R-1}]`,label:r(l("pages.settings.form.pathDefaultFields.label")),hint:r(l(`pages.settings.form.pathDefaultFields.${j.isEmpty(j.get(y,`pathDefaultFields[${R-1}].fields`,[]))?"empty":"hint"}`)),children:t.jsx(a.MultiSelect,{name:`pathDefaultFields[${R-1}]`,width:"100%",placeholder:r(l("pages.settings.form.pathDefaultFields.placeholder")),value:j.get(y,`pathDefaultFields[${R-1}].fields`,[]),onChange:E=>{const me=j.get(y,"pathDefaultFields",[]).map((re,ge)=>ge===R-1?{...re,fields:E}:re);return Z("pathDefaultFields",me,z)},disabled:h.required,error:ue(`pathDefaultFields[${R-1}]`),withTags:!0,children:X.map(E=>t.jsx(a.MultiSelectOption,{value:E,children:E},E))})})})]})})]},w.key):null})}):null})]})})})]})}),t.jsx(a.Box,{...Pe,width:"100%",children:t.jsxs(a.Flex,{direction:"column",alignItems:"flex-start",gap:2,children:[t.jsx(a.Typography,{variant:"delta",as:"h2",children:r(l("pages.settings.additional.title"))}),t.jsxs(a.Grid.Root,{gap:4,width:"100%",children:[t.jsx(a.Grid.Item,{col:4,s:12,xs:12,children:t.jsx(a.Box,{width:"100%",children:t.jsx(G.Field,{name:"allowedLevels",label:r(l("pages.settings.form.allowedLevels.label")),hint:r(l("pages.settings.form.allowedLevels.hint")),children:t.jsx(a.NumberInput,{width:"100%",name:"allowedLevels",type:"number",placeholder:r(l("pages.settings.form.allowedLevels.placeholder")),onChange:(w,R)=>{if(j.isObject(w)){const k=parseInt(w.target.value);return Z(w.target.name,j.isNaN(k)?0:k,z)}return Z(w,R,z)},value:y.allowedLevels,disabled:h.required})})})}),t.jsx(a.Grid.Item,{col:4,s:12,xs:12,children:t.jsx(G.Field,{name:"cascadeMenuAttached",label:r(l("pages.settings.form.cascadeMenuAttached.label")),hint:r(l("pages.settings.form.cascadeMenuAttached.hint")),children:t.jsx(a.Toggle,{width:"100%",name:"cascadeMenuAttached",checked:y.cascadeMenuAttached,onChange:w=>Z(w,!y.cascadeMenuAttached,z),onLabel:r(l("components.toggle.enabled")),offLabel:r(l("components.toggle.disabled")),disabled:h.required})})}),t.jsx(a.Grid.Item,{col:4,s:12,xs:12,children:t.jsx(G.Field,{name:"audienceFieldChecked",label:r(l("pages.settings.form.audience.label")),hint:r(l("pages.settings.form.audience.hint")),children:t.jsx(a.Toggle,{name:"audienceFieldChecked",checked:y.audienceFieldChecked,onChange:w=>Z(w,!y.audienceFieldChecked,z),onLabel:r(l("components.toggle.enabled")),offLabel:r(l("components.toggle.disabled")),disabled:h.required,width:"100%"})})}),e.data?.isCachePluginEnabled&&t.jsx(a.Grid.Item,{col:12,s:12,xs:12,children:t.jsx(G.Field,{name:"isCacheEnabled",label:r(l("pages.settings.form.cache.label")),hint:r(l("pages.settings.form.cache.hint")),children:t.jsx(a.Toggle,{name:"isCacheEnabled",checked:y.isCacheEnabled,onChange:w=>Z(w,!y.isCacheEnabled,z),onLabel:r(l("components.toggle.enabled")),offLabel:r(l("components.toggle.disabled")),disabled:h.required,width:"100%"})})})]})]})}),t.jsxs(a.Box,{...Pe,width:"100%",children:[t.jsx(a.Typography,{variant:"delta",as:"h2",children:r(l("pages.settings.customFields.title"))}),t.jsx(a.Box,{padding:1}),t.jsx(Ka,{data:ce,onOpenModal:Ie,onRemoveCustomField:Ce,onToggleCustomField:oe})]}),t.jsx(a.Box,{...Pe,width:"100%",children:t.jsxs(a.Flex,{direction:"column",alignItems:"flex-start",gap:2,children:[t.jsx(a.Typography,{variant:"delta",as:"h2",children:r(l("pages.settings.restoring.title"))}),t.jsxs(a.Grid.Root,{gap:4,width:"100%",children:[t.jsx(a.Grid.Item,{col:12,s:12,xs:12,children:t.jsx(a.Typography,{children:r(l("pages.settings.actions.restore.description"))})}),t.jsxs(a.Grid.Item,{col:12,s:12,xs:12,children:[b?t.jsx(a.Button,{variant:"danger-light",startIcon:t.jsx(O.Check,{}),onClick:()=>M(!0),children:r(l("pages.settings.actions.restore.label"))}):null,t.jsx(We,{isVisible:le,header:r(l("pages.settings.actions.restore.confirmation.header")),labelConfirm:r(l("pages.settings.actions.restore.confirmation.confirm")),iconConfirm:t.jsx(O.Typhoon,{}),onConfirm:()=>Te(!0),onCancel:()=>Te(!1),children:r(l("pages.settings.actions.restore.confirmation.description"))})]})]})]})})]})})})]}),A&&t.jsx(_a,{onClose:()=>V(!1),onSubmit:ve,isOpen:A,data:J})]}):t.jsx(P.Page.NoPermissions,{})};function oi(){mt.invalidateQueries();const e=G.usePluginTheme();return t.jsx(W.QueryClientProvider,{client:mt,children:t.jsx(a.DesignSystemProvider,{theme:e,children:t.jsx(ii,{})})})}const si="navigation",gt="Navigation",ri={register(e){e.createSettingSection({id:xe,intlLabel:{id:`${xe}.plugin.section.name`,defaultMessage:`${gt} plugin`}},[{intlLabel:{id:`${xe}.plugin.section.item`,defaultMessage:"Configuration"},id:"navigation",to:xe,Component(){return oi},permissions:Ae.settings}]),e.addMenuLink({to:`plugins/${xe}`,icon:Mt,intlLabel:{id:`${xe}.plugin.name`,defaultMessage:gt},Component(){return Ba},permissions:Ae.access,position:1}),e.registerPlugin({id:xe,initializer:$t,isReady:!1,name:si})},registerTrads:async function({locales:e=[]}){return Promise.all(e.map(async n=>n in nt?nt[n]().then(({default:s})=>({data:G.prefixPluginTranslations(G.flattenObject(s),xe),locale:n})):{data:G.prefixPluginTranslations(G.flattenObject({}),xe),locale:n}))}};module.exports=ri;
|
|
2345
|
+
`,kH=({onChange:t,initialValue:e,...n})=>{const[r,i]=p.useState(ue.isArray(e)?e.reduce((s,a)=>`${s}${a}; `,""):""),o=s=>{const a=s?.target.value??"",l=a.split(";").map(c=>c.trim()).filter(c=>!!c.length);i(a??""),t(l)};return u.jsx($r,{...n,onChange:o,value:r})},AH=["string","boolean","select","media"],St="pages.settings.form.customFields.popup.",RH=t=>t.map((e,n)=>({key:`${e}-${n}`,metadatas:{intlLabel:{id:e,defaultMessage:e},hidden:!1,disabled:!1},value:e,label:e})),TH=({isEditForm:t,customField:e,onSubmit:n,onClose:r})=>{const i=RH(AH),{formatMessage:o}=Ve.useIntl(),[s,a]=p.useState({}),[l,c]=p.useState(),{type:d}=s;p.useEffect(()=>{e&&a({...e})},[e]);const h=(b,v,x)=>{if(x){let y=b,$=v;if(ue.isObject(b)){const{name:k,value:S}=b.target;y=k,$=ue.isNil($)?S:$}return ue.isString(y)&&f(y,$),x(b,$)}},f=(b,v)=>{a(ue.set({...s},b,v))},m=b=>{if(ue.get(l,b))return o(M(b))},g=(b,v)=>{const{success:x,data:y,error:$}=Tw.safeParse({...v,enabled:!0});x?n(y):$&&c($.issues.reduce((k,S)=>({...k,[S.path.join(".")]:S.message}),{}))};return u.jsxs(u.Fragment,{children:[u.jsx(dt.Body,{children:u.jsx(Se.Form,{method:"POST",width:"auto",height:"auto",initialValues:s,children:({values:b,onChange:v})=>u.jsxs(de.Root,{gap:5,children:[u.jsx(de.Item,{col:12,children:u.jsx(je.Field,{name:"name",label:o(M(`${St}name.label`)),hint:o(M(`${St}name.description`)),error:m("name"),children:u.jsx($r,{name:"name",value:b.name,onChange:(x,y)=>h(x,y,v),placeholder:o(M(`${St}name.placeholder`)),type:"string",disabled:t,width:"100%"})})},"name"),u.jsx(de.Item,{col:12,children:u.jsx(je.Field,{name:"label",label:o(M(`${St}label.label`)),hint:o(M(`${St}label.description`)),error:m("label"),children:u.jsx($r,{name:"label",value:b.label,onChange:(x,y)=>h(x,y,v),placeholder:o(M(`${St}label.placeholder`)),type:"string",width:"100%"})})},"label"),u.jsx(de.Item,{col:12,children:u.jsx(je.Field,{name:"type",label:o(M(`${St}type.label`)),hint:o(M(`${St}type.description`)),children:u.jsx(Jn,{name:"type",value:b.type,onChange:x=>h("type",x,v),disabled:t,width:"100%",children:i.map(({key:x,label:y,value:$})=>u.jsx(er,{value:$,children:y},x))})})},"type"),d==="select"&&u.jsxs(u.Fragment,{children:[u.jsx(de.Item,{col:12,children:u.jsx(je.Field,{name:"multi",label:o(M(`${St}multi.label`)),hint:o(M(`${St}multi.description`)),error:m("multi"),children:u.jsx($n,{name:"multi",checked:b.multi,onChange:x=>h(x,!b.multi,v),onLabel:"true",offLabel:"false",width:"100%"})})},"multi"),u.jsx(de.Item,{col:12,children:u.jsx(je.Field,{name:"options",label:o(M(`${St}options.label`)),hint:o(M(`${St}options.description`)),error:m("options"),children:u.jsx(kH,{name:"options",onChange:x=>h("options",x,v),initialValue:b.options})})},"options")]}),u.jsx(de.Item,{col:12,children:u.jsx(je.Field,{name:"required",label:o(M(`${St}required.label`)),hint:o(M(`${St}required.description`)),error:m("required"),children:u.jsx($n,{name:"required",placeholder:o(M(`${St}required.placeholder`)),checked:b.required,onChange:x=>h(x,!b.required,v),onLabel:"true",offLabel:"false",width:"100%"})})},"required")]})})}),u.jsxs(dt.Footer,{children:[u.jsx(dt.Close,{children:u.jsx(Xe,{onClick:r,variant:"tertiary",children:o(M("popup.item.form.button.cancel"))})}),u.jsx(Xe,{onClick:b=>g(b,s),children:o(M("popup.item.form.button.save"))})]})]})},MH=({isOpen:t,onClose:e,onSubmit:n,data:r})=>{const i=!!r,{formatMessage:o}=Ve.useIntl();return u.jsx(dt.Root,{onOpenChange:s=>{s||e()},open:t,labelledBy:"custom-field-modal",children:u.jsxs(dt.Content,{children:[u.jsx(dt.Header,{children:u.jsx(ee,{variant:"omega",fontWeight:"bold",textColor:"neutral800",as:"h2",id:"asset-dialog-title",children:o(M(`pages.settings.form.customFields.popup.header.${i?"edit":"new"}`))})}),u.jsx(TH,{isEditForm:i,customField:ue.pick(r,"name","label","type","required","options","multi"),onSubmit:n,onClose:e})]})})},fp=u.jsx(s7,{}),EH=u.jsx(Xh,{}),_t="pages.settings.form.customFields.table.",IH=({data:t=[],onOpenModal:e,onRemoveCustomField:n,onToggleCustomField:r})=>{const[i,o]=p.useState(!1),[s,a]=p.useState(null),{toggleNotification:l}=Se.useNotification(),c=p.useMemo(()=>ue.sortBy(t,"name"),[t]),{formatMessage:d}=Ve.useIntl(),h=p.useCallback(g=>{a(g),o(!0)},[a,o]),f=p.useCallback(()=>{a(null),o(!1)},[a,o]),m=p.useCallback(()=>{s===null?l({type:"warning",message:d(M(`${_t}confirmation.error`))}):n(s),f()},[f,s,Ku,n,l]);return u.jsxs(u.Fragment,{children:[u.jsx(Zf,{isVisible:i,header:d(M(`${_t}confirmation.header`)),children:d(M(`${_t}confirmation.message`)),labelConfirm:d(M(`${_t}confirmation.confirm`)),iconConfirm:fp,mainIcon:fp,onConfirm:m,onCancel:f}),u.jsxs(Sw,{width:"100%",colCount:4,rowCount:t.length+1,footer:u.jsx(h_,{onClick:g=>{g.preventDefault(),e(null)},icon:EH,children:d(M(`${_t}footer`))}),children:[u.jsx(Aw,{children:u.jsxs(Cl,{children:[u.jsx(Zt,{width:"20%",children:u.jsx(ee,{variant:"sigma",textColor:"neutral600",children:d(M(`${_t}header.name`))})}),u.jsx(Zt,{width:"60%",children:u.jsx(ee,{variant:"sigma",textColor:"neutral600",children:d(M(`${_t}header.label`))})}),u.jsx(Zt,{width:"15%",children:u.jsx(ee,{variant:"sigma",textColor:"neutral600",children:d(M(`${_t}header.type`))})}),u.jsx(Zt,{width:"5%",children:u.jsx(ee,{variant:"sigma",textColor:"neutral600",children:d(M(`${_t}header.required`))})}),u.jsx(Zt,{children:u.jsx(Mr,{})})]})}),u.jsx(kw,{children:c.map(g=>typeof g!="string"?u.jsxs(Cl,{children:[u.jsx(Jt,{width:"20%",children:u.jsx(ee,{fontWeight:"semiBold",textColor:"neutral800",children:g.name})}),u.jsx(Jt,{width:"60%",children:u.jsx(ee,{textColor:"neutral800",children:g.label})}),u.jsx(Jt,{width:"15%",children:u.jsx(ee,{textColor:"neutral800",children:g.type})}),u.jsx(Jt,{width:"5%",children:u.jsx(qf,{description:d(M(`${_t}${g.required?"required":"notRequired"}`)),children:u.jsx(ee,{textColor:"neutral800",children:g.required?u.jsx(Ho,{}):u.jsx(s2,{})})})}),u.jsx(Jt,{children:u.jsx(Y,{width:"100%",justifyContent:"flex-end",alignItems:"center",children:u.jsxs(Wx,{children:[u.jsx(At,{onClick:()=>r(g),label:d(M(`${_t}${g.enabled?"disable":"enable"}`)),variant:g.enabled?"success-light":"tertiary",children:g.enabled?u.jsx(r2,{}):u.jsx(C8,{}),style:{minWidth:50}}),u.jsx(At,{onClick:()=>e(g),label:d(M(`${_t}edit`)),children:u.jsx(Yh,{}),style:{minWidth:50}}),u.jsx(At,{onClick:()=>h(g),label:d(M(`${_t}remove`)),children:u.jsx(Qh,{}),style:{minWidth:50}})]})})})]},g.name):null)})]})]})},jH=/^(?<type>[a-z0-9-]+)\:{2}(?<api>[a-z0-9-]+)\.{1}(?<contentType>[a-z0-9-]+)$/i,DH=(t="",e={})=>{const{allowedContentTypes:n=[],restrictedContentTypes:r=[],contentTypes:i=[],preferCustomContentTypes:o=!1}=e,a=(o?["api::",...i]:n).filter(c=>t.includes(c)||t===c).length>0,l=r.filter(c=>t.includes(c)||t===c).length===0;return!!t&&a&&l},OH=(t="")=>{const e=o=>o.split("-").map(s=>ue.capitalize(s)).join(""),[n,r,i]=LH(t);return n==="api"?e(i):`${e(r)}${e(i)}`},LH=(t="")=>t.split(jH).filter(e=>e&&e.length>0),mp="SERVER OFFLINE",Vw=(t,e)=>new Promise(n=>{fetch(`${window.strapi.backendURL}/_health`,{method:"HEAD",mode:"no-cors",headers:{"Content-Type":"application/json","Keep-Alive":"false"}}).then(r=>{if(r.status>=400)throw new Error;if(!e)throw new Error(mp);n(t)}).catch(r=>{setTimeout(()=>Vw(t,r.message!==mp).then(n),100)})}),NH=()=>{const t=Se.getFetchClient(),e=it(t);return Fe.useQuery({queryKey:e.readSettingsConfigIndex(),queryFn(){return e.readSettingsConfig()},staleTime:1e3*60*5})},BH=()=>{const t=Se.getFetchClient(),e=it(t),n=Fe.useQuery({queryKey:e.healthCheckIndex(),queryFn:()=>e.healthCheck(),retry:!0,retryDelay:1e3*5,enabled:!1});return Fe.useMutation({mutationFn:()=>e.restart().then(()=>n.refetch())})},FH=()=>{const t=Se.getFetchClient(),e=it(t);return Fe.useMutation({mutationFn:()=>e.restoreConfig()})},VH=()=>{const t=Se.getFetchClient(),e=it(t);return Fe.useQuery({queryKey:e.readContentTypeIndex(),queryFn:()=>e.readContentType(),staleTime:1/0})},_H=()=>{const t=Se.getFetchClient(),e=it(t);return Fe.useMutation({mutationFn(n){return e.updateConfig({...n,contentTypesNameFields:Object.fromEntries(n.contentTypesNameFields.map(({key:r,fields:i})=>[r,i])),contentTypesPopulate:Object.fromEntries(n.contentTypesPopulate.map(({key:r,fields:i})=>[r,i])),pathDefaultFields:Object.fromEntries(n.pathDefaultFields.map(({key:r,fields:i})=>[r,i])),additionalFields:n.audienceFieldChecked?[...n.additionalFields,"audience"]:n.additionalFields,gql:{navigationItemRelated:n.contentTypes.map(r=>OH(r))}})}})},zH=M_.omit({contentTypesNameFields:!0}).extend({audienceFieldChecked:z.z.boolean(),contentTypesNameFields:z.z.object({key:z.z.string(),fields:z.z.string().array()}).array(),contentTypesPopulate:z.z.object({key:z.z.string(),fields:z.z.string().array()}).array(),pathDefaultFields:z.z.object({key:z.z.string(),fields:z.z.string().array()}).array()}),So={background:"neutral0",hasRadius:!0,shadow:"filterShadow",padding:6},HH=["relation","media","component","dynamiczone"],pp=new Fe.QueryClient,PH=()=>{const t=NH(),e=VH(),n=_H(),r=FH(),i=BH(),{formatMessage:o}=Ve.useIntl(),[s,a]=p.useState({required:!1}),[l,c]=p.useState(!1),d=Se.useAuth("SettingsPage",P=>P.permissions),h=p.useMemo(()=>!!d.find(({action:P})=>P===Hr.settings[0].action),[d]),f=p.useMemo(()=>!!d.find(({action:P})=>P===Hr.access[0].action),[d]),m=t.isPending||e.isPending||n.isPending||i.isPending||r.isPending,[g,b]=p.useState({}),[v,x]=p.useState(),[y,$]=p.useState(!1),[k,S]=p.useState(!1),[R,A]=p.useState(null),{contentTypesNameFields:I,contentTypes:E,additionalFields:j,preferCustomContentTypes:O}=g,D=(P,oe,_)=>{if(_){let G=P,Z=oe;if(ue.isObject(P)){const{name:ne,value:ae}=P.target;G=ne,Z=ue.isNil(Z)?ae:Z}return ue.isString(G)&&B(G,Z),_(P,Z)}},B=(P,oe)=>{b(_=>ue.set({..._},P,oe))},V=P=>{if(ue.get(v,P))return o(M(P))},q=P=>{A(P),$(!0)},J=P=>{const oe=j.filter(_=>typeof _!="string"?_.name!==P.name:!0);B("additionalFields",oe),A(null),$(!1)},W=P=>{const oe={...P,enabled:!P.enabled},_=j.map(G=>typeof G!="string"&&P.name===G.name?oe:G);B("additionalFields",_)},K=P=>{const _=!!j.find(G=>typeof G!="string"?G.name===P.name:!1)?j.map(G=>typeof G!="string"&&P.name===G.name?P:G):[...j,P];B("additionalFields",_),A(null),$(!1)},F=m?[]:ue.sortBy(Object.values(e.data??[]).filter(({uid:P})=>DH(P,{allowedContentTypes:t.data?.allowedContentTypes,restrictedContentTypes:t.data?.restrictedContentTypes,preferCustomContentTypes:O,contentTypes:E})).map(P=>{const oe=e.data?.find(_=>_.uid===P.uid);if(oe){const{isDisplayed:_,kind:G}=oe;return{...P,available:_,isSingle:G==="singleType"}}return P}),P=>P.info.displayName),Q=(P,oe)=>{const{success:_,data:G,error:Z}=zH.safeParse(oe);_?n.mutate(G,{onSuccess(){a({required:!0}),n.reset()}}):Z&&(x(Z.issues.reduce((ne,ae)=>({...ne,[ae.path.join(".")]:ae.message}),{})),console.warn("Invalid form data",Z))},pe=async P=>{S(!1),P&&(r.mutate(),a({required:!0}))},we=async()=>{i.mutate(void 0,{onSuccess(){c(!0),Vw(!0).then(P=>{P&&window.location.reload()})},onError(){a({required:!1})}})},ce=()=>a({required:!1}),Ce=(P,oe)=>{const _=oe.map(Z=>({key:Z,fields:P[Z]??[]}));return Object.entries(P).filter(([Z,ne])=>!oe.includes(Z)).map(([Z,ne])=>({key:Z,fields:ne})).concat(_)};return p.useEffect(()=>{if(t.data){const{additionalFields:P,contentTypes:oe,contentTypesNameFields:_,contentTypesPopulate:G,pathDefaultFields:Z}=t.data;b({...t.data,additionalFields:P.filter(ne=>typeof ne!="string"),audienceFieldChecked:P.includes("audience"),contentTypesNameFields:Ce(_,oe),contentTypesPopulate:Ce(G,oe),pathDefaultFields:Ce(Z,oe)})}},[t.data]),h?m||l?u.jsx(Se.Page.Loading,{}):u.jsxs(Se.Layouts.Root,{children:[u.jsxs(Se.Page.Main,{children:[u.jsx(Se.Page.Title,{children:o(M("pages.settings.header.title"))}),u.jsx(Se.Layouts.Header,{title:o(M("pages.settings.header.title")),subtitle:o(M("pages.settings.header.description")),primaryAction:f?u.jsx(Xe,{startIcon:u.jsx(Ho,{}),disabled:s.required,onClick:P=>Q(P,g),children:o(M("pages.settings.actions.submit"))}):null}),u.jsx(Se.Layouts.Content,{children:u.jsx(Se.Form,{method:"POST",width:"auto",height:"auto",initialValues:g,children:({values:P,onChange:oe})=>u.jsxs(Y,{direction:"column",gap:4,children:[s.required&&u.jsx(re,{...So,width:"100%",children:u.jsx(SH,{closeLabel:o(M("pages.settings.actions.restart.alert.cancel")),title:o(M("pages.settings.actions.restart.alert.title")),action:u.jsx(re,{children:u.jsx(Xe,{onClick:we,startIcon:u.jsx(JS,{}),children:o(M("pages.settings.actions.restart.label"))})}),onClose:ce,children:u.jsxs(u.Fragment,{children:[u.jsx(re,{paddingBottom:1,children:o(M("pages.settings.actions.restart.alert.description"))}),s.reasons?.map((_,G)=>u.jsx(re,{paddingBottom:1,children:o(M(`pages.settings.actions.restart.alert.reason.${_}`))},G))]})})}),u.jsx(re,{...So,width:"100%",children:u.jsxs(Y,{direction:"column",alignItems:"flex-start",gap:2,children:[u.jsx(ee,{variant:"delta",as:"h2",children:o(M("pages.settings.general.title"))}),u.jsx(de.Root,{gap:4,width:"100%",children:u.jsx(de.Item,{col:12,s:12,xs:12,children:u.jsxs(de.Root,{gap:4,width:"100%",children:[u.jsx(de.Item,{col:4,s:12,xs:12,children:u.jsx(je.Field,{name:"preferCustomContentTypes",label:o(M("pages.settings.form.preferCustomContentTypes.label")),hint:o(M("pages.settings.form.preferCustomContentTypes.hint")),children:u.jsx($n,{name:"preferCustomContentTypes",checked:P.preferCustomContentTypes,onChange:_=>D(_,!P.preferCustomContentTypes,oe),onLabel:o(M("components.toggle.enabled")),offLabel:o(M("components.toggle.disabled")),disabled:s.required,width:"100%"})})}),u.jsx(de.Item,{col:8,s:12,xs:12,children:u.jsx(je.Field,{name:"contentTypes",label:o(M("pages.settings.form.contentTypes.label")),hint:o(M("pages.settings.form.contentTypes.hint")),children:u.jsx(wi,{name:"contentTypes",label:o(M("pages.settings.form.contentTypes.label")),"aria-label":o(M("pages.settings.form.contentTypes.label")),placeholder:o(M("pages.settings.form.contentTypes.placeholder")),value:P.contentTypes,onChange:_=>{D("contentTypes",_,oe);const{contentTypesNameFields:G=[],contentTypesPopulate:Z=[],pathDefaultFields:ne=[]}=P,ae=_.filter(le=>!G.find(Le=>Le.key===le))??[],be=G.filter(le=>!_.includes(le.key)||le.key==="default").map(({key:le})=>le)??[];B("contentTypesNameFields",[...G.filter(({key:le})=>!be.includes(le)||le==="default")??[],...ae.map(le=>({key:le,fields:[]}))]),B("contentTypesPopulate",[...Z.filter(({key:le})=>!be.includes(le)||le==="default")??[],...ae.map(le=>({key:le,fields:[]}))]),B("pathDefaultFields",[...ne.filter(({key:le})=>!be.includes(le)||le==="default")??[],...ae.map(le=>({key:le,fields:[]}))])},disabled:s.required,error:V("contentTypes"),withTags:!0,width:"100%",children:F.map(_=>u.jsx(Br,{value:_.uid,children:_.info.displayName},_.uid))})})}),u.jsx(de.Item,{col:12,s:12,xs:12,children:E?.length?u.jsx(xo.Root,{style:{width:"100%"},children:I.map((_,G)=>{const Z=e.data?.find(({uid:le})=>le===_.key),ne=Z?.attributes??{},ae=Object.keys(ne).sort(),be=ae.filter(le=>HH.includes(ne[le]?.type));return Z?u.jsxs(xo.Item,{value:_.key,children:[u.jsx(xo.Header,{children:u.jsx(xo.Trigger,{children:Z?.info.displayName??o(M("pages.settings.form.nameField.default"))})}),u.jsx(xo.Content,{children:u.jsxs(de.Root,{gap:4,padding:2,children:[u.jsx(de.Item,{col:12,s:12,xs:12,children:u.jsx(je.Field,{name:`contentTypesNameFields[${G}]`,label:o(M("pages.settings.form.nameField.label")),hint:o(M(`pages.settings.form.nameField.${ue.isEmpty(ue.get(P,`contentTypesNameFields[${G}].fields`,[]))?"empty":"hint"}`)),children:u.jsx(wi,{name:`contentTypesNameFields[${G}]`,placeholder:o(M("pages.settings.form.nameField.placeholder")),value:ue.get(P,`contentTypesNameFields[${G}].fields`),onChange:le=>{const Le=ue.get(P,"contentTypesNameFields",[]).map(($e,Be)=>Be===G?{...$e,fields:le}:$e);return D("contentTypesNameFields",Le,oe)},disabled:s.required,error:V(`contentTypesNameFields[${G}]`),withTags:!0,children:ae.map(le=>u.jsx(Br,{value:le,children:le},le))})})}),u.jsx(de.Item,{col:12,s:12,xs:12,children:u.jsx(je.Field,{name:`contentTypesPopulate[${G-1}]`,label:o(M("pages.settings.form.populate.label")),hint:o(M(`pages.settings.form.populate.${ue.isEmpty(ue.get(P,`contentTypesPopulate[${G-1}]fields`,[]))?"empty":"hint"}`)),children:u.jsx(wi,{width:"100%",name:`contentTypesPopulate[${G-1}]`,placeholder:o(M("pages.settings.form.populate.placeholder")),value:ue.get(P,`contentTypesPopulate[${G-1}].fields`,[]),onChange:le=>{const Le=ue.get(P,"contentTypesPopulate",[]).map(($e,Be)=>Be===G-1?{...$e,fields:le}:$e);return D("contentTypesPopulate",Le,oe)},disabled:s.required,error:V(`contentTypesPopulate[${G-1}]`),withTags:!0,children:be.map(le=>u.jsx(Br,{value:le,children:le},le))})})}),u.jsx(de.Item,{col:12,s:12,xs:12,children:u.jsx(je.Field,{name:`pathDefaultFields[${G-1}]`,label:o(M("pages.settings.form.pathDefaultFields.label")),hint:o(M(`pages.settings.form.pathDefaultFields.${ue.isEmpty(ue.get(P,`pathDefaultFields[${G-1}].fields`,[]))?"empty":"hint"}`)),children:u.jsx(wi,{name:`pathDefaultFields[${G-1}]`,width:"100%",placeholder:o(M("pages.settings.form.pathDefaultFields.placeholder")),value:ue.get(P,`pathDefaultFields[${G-1}].fields`,[]),onChange:le=>{const Le=ue.get(P,"pathDefaultFields",[]).map(($e,Be)=>Be===G-1?{...$e,fields:le}:$e);return D("pathDefaultFields",Le,oe)},disabled:s.required,error:V(`pathDefaultFields[${G-1}]`),withTags:!0,children:ae.map(le=>u.jsx(Br,{value:le,children:le},le))})})})]})})]},_.key):null})}):null})]})})})]})}),u.jsx(re,{...So,width:"100%",children:u.jsxs(Y,{direction:"column",alignItems:"flex-start",gap:2,children:[u.jsx(ee,{variant:"delta",as:"h2",children:o(M("pages.settings.additional.title"))}),u.jsxs(de.Root,{gap:4,width:"100%",children:[u.jsx(de.Item,{col:4,s:12,xs:12,children:u.jsx(re,{width:"100%",children:u.jsx(je.Field,{name:"allowedLevels",label:o(M("pages.settings.form.allowedLevels.label")),hint:o(M("pages.settings.form.allowedLevels.hint")),children:u.jsx(yV,{width:"100%",name:"allowedLevels",type:"number",placeholder:o(M("pages.settings.form.allowedLevels.placeholder")),onChange:(_,G)=>{if(ue.isObject(_)){const Z=parseInt(_.target.value);return D(_.target.name,ue.isNaN(Z)?0:Z,oe)}return D(_,G,oe)},value:P.allowedLevels,disabled:s.required})})})}),u.jsx(de.Item,{col:4,s:12,xs:12,children:u.jsx(je.Field,{name:"cascadeMenuAttached",label:o(M("pages.settings.form.cascadeMenuAttached.label")),hint:o(M("pages.settings.form.cascadeMenuAttached.hint")),children:u.jsx($n,{width:"100%",name:"cascadeMenuAttached",checked:P.cascadeMenuAttached,onChange:_=>D(_,!P.cascadeMenuAttached,oe),onLabel:o(M("components.toggle.enabled")),offLabel:o(M("components.toggle.disabled")),disabled:s.required})})}),u.jsx(de.Item,{col:4,s:12,xs:12,children:u.jsx(je.Field,{name:"audienceFieldChecked",label:o(M("pages.settings.form.audience.label")),hint:o(M("pages.settings.form.audience.hint")),children:u.jsx($n,{name:"audienceFieldChecked",checked:P.audienceFieldChecked,onChange:_=>D(_,!P.audienceFieldChecked,oe),onLabel:o(M("components.toggle.enabled")),offLabel:o(M("components.toggle.disabled")),disabled:s.required,width:"100%"})})}),t.data?.isCachePluginEnabled&&u.jsx(de.Item,{col:12,s:12,xs:12,children:u.jsx(je.Field,{name:"isCacheEnabled",label:o(M("pages.settings.form.cache.label")),hint:o(M("pages.settings.form.cache.hint")),children:u.jsx($n,{name:"isCacheEnabled",checked:P.isCacheEnabled,onChange:_=>D(_,!P.isCacheEnabled,oe),onLabel:o(M("components.toggle.enabled")),offLabel:o(M("components.toggle.disabled")),disabled:s.required,width:"100%"})})})]})]})}),u.jsxs(re,{...So,width:"100%",children:[u.jsx(ee,{variant:"delta",as:"h2",children:o(M("pages.settings.customFields.title"))}),u.jsx(re,{padding:1}),u.jsx(IH,{data:j,onOpenModal:q,onRemoveCustomField:J,onToggleCustomField:W})]}),u.jsx(re,{...So,width:"100%",children:u.jsxs(Y,{direction:"column",alignItems:"flex-start",gap:2,children:[u.jsx(ee,{variant:"delta",as:"h2",children:o(M("pages.settings.restoring.title"))}),u.jsxs(de.Root,{gap:4,width:"100%",children:[u.jsx(de.Item,{col:12,s:12,xs:12,children:u.jsx(ee,{children:o(M("pages.settings.actions.restore.description"))})}),u.jsxs(de.Item,{col:12,s:12,xs:12,children:[f?u.jsx(Xe,{variant:"danger-light",startIcon:u.jsx(Ho,{}),onClick:()=>S(!0),children:o(M("pages.settings.actions.restore.label"))}):null,u.jsx(Zf,{isVisible:k,header:o(M("pages.settings.actions.restore.confirmation.header")),labelConfirm:o(M("pages.settings.actions.restore.confirmation.confirm")),iconConfirm:u.jsx(V7,{}),onConfirm:()=>pe(!0),onCancel:()=>pe(!1),children:o(M("pages.settings.actions.restore.confirmation.description"))})]})]})]})})]})})})]}),y&&u.jsx(MH,{onClose:()=>$(!1),onSubmit:K,isOpen:y,data:R})]}):u.jsx(Se.Page.NoPermissions,{})};function WH(){pp.invalidateQueries();const t=je.usePluginTheme();return u.jsx(Fe.QueryClientProvider,{client:pp,children:u.jsx(nw,{theme:t,children:u.jsx(PH,{})})})}const qH="navigation",gp="Navigation",UH={register(t){t.createSettingSection({id:Qt,intlLabel:{id:`${Qt}.plugin.section.name`,defaultMessage:`${gp} plugin`}},[{intlLabel:{id:`${Qt}.plugin.section.item`,defaultMessage:"Configuration"},id:"navigation",to:Qt,Component(){return WH},permissions:Hr.settings}]),t.addMenuLink({to:`plugins/${Qt}`,icon:Uw,intlLabel:{id:`${Qt}.plugin.name`,defaultMessage:gp},Component(){return $H},permissions:Hr.access,position:1}),t.registerPlugin({id:Qt,initializer:Hw,isReady:!1,name:qH})},registerTrads:async function({locales:t=[]}){return Promise.all(t.map(async e=>e in rp?rp[e]().then(({default:r})=>({data:je.prefixPluginTranslations(je.flattenObject(r),Qt),locale:e})):{data:je.prefixPluginTranslations(je.flattenObject({}),Qt),locale:e}))}};module.exports=UH;
|