@prismicio/editor-fields 0.4.63 → 0.4.64-alpha.fix-simulator-issue.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/EditorConfig.d.ts +12 -3
- package/dist/core/APIExplorer/APIExplorer.d.ts +2 -0
- package/dist/core/APIExplorer/components/APIExplorerContext.d.ts +54 -0
- package/dist/core/APIExplorer/components/APIExplorerRequest.d.ts +2 -0
- package/dist/core/APIExplorer/components/APIExplorerResponse.d.ts +2 -0
- package/dist/core/APIExplorer/components/Request/GetByTypeRequest.d.ts +1 -0
- package/dist/core/APIExplorer/components/Request/GetByUIDRequest.d.ts +1 -0
- package/dist/core/APIExplorer/components/Request/GetRepositoryRequest.d.ts +1 -0
- package/dist/core/APIExplorer/components/Request/GetRequest.d.ts +1 -0
- package/dist/core/APIExplorer/components/Request/GetSingleRequest.d.ts +1 -0
- package/dist/core/APIExplorer/components/Request/components/RequestFormInput.d.ts +4 -0
- package/dist/core/APIExplorer/components/Request/components/RequestFormInputBase.d.ts +6 -0
- package/dist/core/APIExplorer/components/Request/components/RequestFormSelect.d.ts +4 -0
- package/dist/core/APIExplorer/components/Request/components/RequestPaginationFieldset.d.ts +5 -0
- package/dist/core/APIExplorer/components/Request/components/RequestTypeFieldset.d.ts +7 -0
- package/dist/core/APIExplorer/components/Request/components/index.d.ts +3 -0
- package/dist/core/APIExplorer/components/Request/createRequest.d.ts +20 -0
- package/dist/core/APIExplorer/components/Request/index.d.ts +1 -0
- package/dist/core/APIExplorer/components/Request/types.d.ts +14 -0
- package/dist/core/APIExplorer/index.d.ts +1 -0
- package/dist/core/MediaLibrary/hooks/mediaLibraryData.d.ts +80 -80
- package/dist/core/MediaLibrary/hooks/tagData.d.ts +3 -3
- package/dist/core/MediaLibrary/hooks/useMediaLibraryUpload.d.ts +8 -8
- package/dist/core/MediaLibrary/hooks/useSelectedMedia.d.ts +8 -8
- package/dist/core/UnsplashLibrary/unsplashData.d.ts +9 -9
- package/dist/core/service/aiSeoMetadata.d.ts +2 -6
- package/dist/core/service/customType.d.ts +20 -20
- package/dist/core/service/document.d.ts +213 -213
- package/dist/core/service/documentSearch.d.ts +47 -47
- package/dist/core/service/repository.d.ts +30 -30
- package/dist/core/service/role.d.ts +267 -46
- package/dist/core/service/user.d.ts +11 -7
- package/dist/fields/ImageField/useImageField.d.ts +8 -8
- package/dist/fields/ImageField/useImageFieldImageUpload.d.ts +8 -8
- package/dist/fields/LinkField/Documents/documentsData.d.ts +16 -16
- package/dist/fields/LinkField/useLinkField.d.ts +1 -1
- package/dist/fields/RichTextField/RichTextField.d.ts +2 -0
- package/dist/fields/RichTextField/coreExtensions/ListItem.d.ts +4 -4
- package/dist/fields/RichTextField/extensions/Image/useImageView.d.ts +8 -8
- package/dist/fields/RichTextField/extensions/Table/Table.d.ts +4 -4
- package/dist/fields/RichTextField/extensions/Table/TableCell/TableCell.d.ts +10 -0
- package/dist/fields/RichTextField/extensions/Table/TableCell/TableHeaderCell.d.ts +10 -0
- package/dist/fields/RichTextField/extensions/Table/TableCell/index.d.ts +2 -0
- package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/TableHandles/TableHandlesPlugin.d.ts +8 -0
- package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/TableHandles/TableHandlesPluginView.d.ts +34 -0
- package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/TableHandles/events.d.ts +19 -0
- package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/TableHandles/index.d.ts +1 -0
- package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/TableHandles/utils.d.ts +23 -0
- package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/index.d.ts +1 -0
- package/dist/fields/RichTextField/extensions/Table/TableCell/types.d.ts +17 -0
- package/dist/fields/RichTextField/extensions/Table/TableCell/utils.d.ts +15 -0
- package/dist/fields/RichTextField/extensions/Table/TableEvent.d.ts +31 -0
- package/dist/fields/RichTextField/extensions/Table/TableLimitToast.d.ts +7 -0
- package/dist/fields/RichTextField/extensions/Table/TableRow.d.ts +9 -0
- package/dist/fields/RichTextField/extensions/Table/TableView.d.ts +20 -0
- package/dist/fields/RichTextField/extensions/Table/menus/TableColumnMenu.d.ts +11 -0
- package/dist/fields/RichTextField/extensions/Table/menus/TableFloatingMenus.d.ts +7 -0
- package/dist/fields/RichTextField/extensions/Table/menus/TableRowMenu.d.ts +10 -0
- package/dist/fields/RichTextField/extensions/Table/menus/TriggerAnchor.d.ts +11 -0
- package/dist/fields/RichTextField/extensions/Table/menus/index.d.ts +2 -0
- package/dist/fields/RichTextField/extensions/Table/menus/utils.d.ts +23 -0
- package/dist/fields/RichTextField/extensions/Table/utils.d.ts +60 -0
- package/dist/fields/RichTextField/extensions/extensions.d.ts +1 -1
- package/dist/index.cjs.js +138 -38
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +59001 -10823
- package/dist/slices/utils.d.ts +4 -4
- package/package.json +6 -6
package/dist/index.cjs.js
CHANGED
|
@@ -1,38 +1,138 @@
|
|
|
1
|
-
"use strict";var Zi=Object.defineProperty;var Ji=(e,t,n)=>t in e?Zi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var W=(e,t,n)=>(Ji(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("react/jsx-runtime"),r=require("@prismicio/editor-ui"),f=require("react"),te=require("@prismicio/editor-support/URL"),K=require("@prismicio/types-internal/lib/content"),w=require("@prismicio/types-internal/lib/customtypes"),oe=require("@tanstack/react-query"),Ge=require("@prismicio/editor-support/Object"),E=require("@prismicio/editor-support/React"),cn=require("@prismicio/editor-support/Date"),O=require("@prismicio/editor-support/Array"),R=require("@prismicio/editor-support/Suspense"),Ae=require("@prismicio/editor-support/String"),U=require("@prismicio/editor-support/Http"),p=require("zod"),ee=require("@prismicio/editor-support/Set"),ae=require("@prismicio/editor-support/Type"),Xi=require("@prismicio/editor-support/Map"),X=require("@tiptap/core"),$i=require("@tiptap/extension-history"),er=require("@tiptap/extension-list-keymap"),ne=require("@tiptap/react"),tr=require("@tiptap/extension-document"),aA=require("@tiptap/extension-hard-break"),nr=require("@tiptap/extension-list-item"),Ar=require("@tiptap/extension-paragraph"),or=require("@prismicio/richtext"),ir=require("@tiptap/extension-text"),rr=require("@tiptap/extension-bold"),sr=require("@tiptap/extension-bullet-list"),ar=require("@tiptap/extension-code-block"),lr=require("@tiptap/extension-heading"),cr=require("@prismicio/editor-support/DOM"),dr=require("@tiptap/extension-italic"),ur=require("@tiptap/extension-ordered-list"),gr=require("@tiptap/extension-table"),lA=require("@tiptap/extension-table-cell"),cA=require("@tiptap/extension-table-header"),dA=require("@tiptap/extension-table-row"),Se=require("@tiptap/pm/tables"),hr=require("@tiptap/extension-placeholder"),ce=require("@floating-ui/react-dom-interactions"),pr=require("@tiptap/suggestion"),mr=require("@prismicio/editor-support/Number"),Dn=require("@aws-sdk/client-bedrock-runtime"),fr=require("@prismicio/editor-support/Animation"),uA={next:"Next.js",nuxt:"Nuxt",sveltekit:"SvelteKit",other:"Other"},gA={next:"npx create-next-app@latest",nuxt:"npx nuxi@latest init",sveltekit:"npx sv create"},Cr=18,xr=41,yr=24;function Ot(e){const t=e.code.split(`
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
- Place the most important keyword(s) at the beginning.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
`)}function gt(e){if(K.isWidgetContent(e)){if(e.__TYPE__==="UIDContent")return e.value;if(e.__TYPE__==="StructuredTextContent"){const[t]=e.value;return!t||t.type==="image"||t.type==="embed"?void 0:t.content.text}if(e.__TYPE__==="FieldContent"&&e.type==="Text")return e.value}}function IA(e){return e.length>=300}const kr=p.z.object({id:p.z.string(),label:p.z.string(),repeatable:p.z.boolean(),status:p.z.boolean()});function Er(e,t,n){return U.request(new URL("customtypes",e),{headers:{repository:t},credentials:U.getRequestCredentials(n),okType:p.z.array(kr)})}function $e(e){const{baseUrl:t,repository:n,authStrategy:o}=e;return oe.queryOptions({queryKey:["customTypes"],queryFn:()=>Er(t,n,o)})}function Dr(e,t){e.prefetchQuery($e(t))}function Rr(e,t){return e.fetchQuery($e(t))}function un(e){return oe.useSuspenseQuery($e(e))}function Qr(e){const{id:t,baseUrl:n,repository:o,authStrategy:i}=e,a=un({baseUrl:n,repository:o,authStrategy:i}).data.find(l=>l.id===t);if(!a)throw new Error(`Custom type "${t}" does not exist`);return a}function Mr(e,t){return e.invalidateQueries($e(t))}function qr(e){const{id:t,baseUrl:n,repository:o,authStrategy:i}=e,s=new URL(`customtypes/${t}`,n);return s.searchParams.set("static","true"),U.request(s,{headers:{repository:o},credentials:U.getRequestCredentials(i),okType:Pr})}const Pr=p.z.unknown().transform((e,t)=>{const n=w.StaticCustomType.decode(e);return n._tag==="Right"?n.right:(t.addIssue({code:p.z.ZodIssueCode.custom,message:"Invalid custom type."}),p.z.NEVER)});function jA(e){const{id:t}=e;return oe.queryOptions({queryKey:["customTypes","static",t],queryFn:()=>qr(e)})}function Or(e){return oe.useSuspenseQuery(jA(e))}function Vr(e,t){e.prefetchQuery(jA(t))}const Yr=p.z.object({id:p.z.string().optional(),first_name:p.z.string().optional(),last_name:p.z.string().optional(),email:p.z.string().optional(),uploadedAvatar:p.z.string().optional()}),gn=p.z.object({id:p.z.string(),name:p.z.string(),is_master:p.z.boolean().optional()}).transform(e=>({id:e.id,label:e.name,...e.is_master!==void 0?{isMaster:e.is_master}:{}})),FA=p.z.discriminatedUnion("status",[p.z.object({status:p.z.literal("unclassified")}),p.z.object({status:p.z.literal("published")}),p.z.object({status:p.z.literal("release"),release_id:p.z.string()}),p.z.object({status:p.z.literal("archived")})]),SA=p.z.object({version_id:p.z.string(),tags:p.z.array(p.z.string()),preview_image:p.z.string().optional(),last_modified_date:p.z.coerce.date(),uid:p.z.string().optional()}),bA=FA.and(SA.extend({custom_type_label:p.z.string(),preview_summary:p.z.string().optional(),author:Yr})),KA=FA.and(SA.extend({custom_type_id:p.z.string().optional(),summary:p.z.string().optional(),author_ids:p.z.array(p.z.string()).optional(),highlights:p.z.object({uid:p.z.string().optional()}).optional()}));function UA(e){return bA.safeParse(e).success}function Wt(e){return KA.safeParse(e).success}const TA=p.z.string().nullish().transform(e=>e??"Untitled"),hn=p.z.object({id:p.z.string(),title:TA,custom_type_id:p.z.string(),group_lang_id:p.z.string(),language:gn,versions:p.z.array(bA)}),Wr=p.z.object({total:p.z.number(),cursor:p.z.string().optional(),results:p.z.array(hn)}),Hr=p.z.object({id:p.z.string(),title:TA,custom_type_id:p.z.string(),group_lang_id:p.z.string(),interesting_versions:p.z.array(KA),locale_id:p.z.string().optional()}).transform(e=>{const{interesting_versions:t,...n}=e;return{versions:t,...n}}),_r=p.z.object({results:p.z.array(Hr)});function pn(e){const{baseUrl:t,authStrategy:n,limit:o,cursor:i,statuses:s,authors:a,language:l,groupLangIds:d,documentIds:c,customTypes:u,tags:h,term:g,uids:m,signal:C}=e,y=new URL("documents/search",t),x=Ge.filterValues({statuses:s,authors:a,language:l,groupLangIds:d,customTypes:u,tags:h,term:g,documentIds:c,limit:o,cursor:i,uids:m},I=>!(I===""||Array.isArray(I)&&I.length===0));return U.request(y,{credentials:U.getRequestCredentials(n),okType:Wr,signal:C,method:"POST",body:x})}function wA(e,t,n,o){const i=new URL(e);return i.search=n,U.request(i,{credentials:U.getRequestCredentials(t),okType:_r,...o})}function LA(e){const{repository:t,searchTerm:n,tags:o,authors:i,status:s,localeId:a,customTypesIds:l}=e,d=new URLSearchParams;return d.append("repository",t),n&&d.append("searchTerm",n),o!=null&&o.length&&d.append("tags",o.toString()),i!=null&&i.length&&d.append("authors",i.toString()),s!=null&&s.length&&d.append("status",s.toString()),a&&d.append("localeId",a),l!=null&&l.length&&d.append("customTypesIds",l.toString()),d.toString()}function vA(e){return e.reduce((t,n)=>{if(n.values.every(i=>i===""||i===void 0))return t;const o=n.values.map(i=>[n.name,i??""]);return t.concat(o)},[])}function et(e,t,n){return U.request(new URL(`documents/${n}`,e),{credentials:U.getRequestCredentials(t),okType:hn})}const zr=p.z.custom().transform((e,t)=>{const n=K.Document.decode(e);return n._tag==="Left"?(t.addIssue({code:p.z.ZodIssueCode.custom,message:"Invalid document."}),p.z.NEVER):n.right}),Nr=p.z.unknown().transform((e,t)=>{const n=K.SliceItemContent.decode(e);return n._tag==="Right"?n.right:(t.addIssue({code:p.z.ZodIssueCode.custom,message:"Invalid slice content."}),p.z.NEVER)}),de={all:()=>["documents"],lists:()=>[...de.all(),"list"],list:e=>[...de.lists(),e],infiniteLists:()=>[...de.all(),"list:infinite"],infiniteList:e=>[...de.infiniteLists(),e]};function Gr(e,t){e.setQueriesData({queryKey:de.lists()},n=>n&&Mn(n,t)),e.setQueriesData({queryKey:de.infiniteLists()},n=>n&&{...n,pages:n.pages.map(o=>Mn(o,t))})}function Mn(e,t){const n=e.results.flatMap(o=>{const i=t(o,e);return i?[i]:[]});return{...e,results:n,total:e.total+(n.length-e.results.length)}}async function Zr(e){await e.invalidateQueries({queryKey:de.lists()}),await e.invalidateQueries({queryKey:de.infiniteLists()})}function mn(e){return oe.useSuspenseQuery(kA(e))}function kA(e){return oe.queryOptions({queryKey:de.list(e),queryFn:({queryKey:[,,t]})=>pn(t)})}async function EA(e){const{coreApiBaseUrl:t,documentSearchBaseUrl:n,authStrategy:o,repository:i,searchTerm:s="",customTypes:a,tags:l,authors:d,status:c,locale:u,signal:h,storageVersion:g}=e;if(g&&g.major<=6){const I=c!=null&&c.length?c:["published","unclassified","release"];return{results:(await pn({baseUrl:t,authStrategy:o,tags:l,customTypes:a,language:u,term:s,authors:d,statuses:I,limit:200})).results}}const m=LA({repository:i,searchTerm:s,tags:l,authors:d,status:c,localeId:u,customTypesIds:a});return{results:(await wA(n,o,m,{signal:h})).results}}function DA(e){const{searchTerm:t,customTypes:n,tags:o,authors:i,status:s,locale:a,config:l,storageVersion:d}=e;l.searchDocuments||V("searchDocuments");const{coreApiBaseUrl:c,documentSearchBaseUrl:u,authStrategy:h,repository:g}=l;return oe.queryOptions({queryKey:["searchDocuments",{coreApiBaseUrl:c,documentSearchBaseUrl:u,authStrategy:h,repository:g,searchTerm:t,customTypes:n,tags:o,authors:i,status:s,locale:a,storageVersion:d}],queryFn:({queryKey:[,m],signal:C})=>EA({...m,signal:C})})}const Jr=p.z.object({id:p.z.string(),firstname:p.z.string().optional(),lastname:p.z.string().optional(),email:p.z.string(),uploadedAvatar:p.z.string().optional()}),RA=p.z.array(Jr),Xr=p.z.object({slicemachineEnabled:p.z.boolean()}),QA=["next","nuxt","sveltekit"];function $r(e){return QA.includes(e)}const Ft=p.z.preprocess(e=>typeof e=="string"&&$r(e)?e:"other",p.z.enum([...QA,"other"])),es=p.z.object({simulator_url:p.z.string().url().nullish(),languages:p.z.array(gn).transform(e=>O.sort(e,t=>t.label)),authors:RA.optional().default([]),quotas:Xr.optional().default({slicemachineEnabled:!1}),framework:Ft.optional().default("other"),starterId:p.z.string().optional(),storageVersion:p.z.object({major:p.z.number().int(),minor:p.z.number().int()}),uploadedAvatar:p.z.string().url().optional()}).transform(({simulator_url:e,framework:t,...n})=>{const o=e&&MA(e)?e:void 0;return{...n,framework:t,simulatorUrl:o,isSupportedFramework:t!=="other"}});function St(e,t){return U.request(new URL("repository",e),{credentials:U.getRequestCredentials(t),okType:es})}function MA(e){const t=te.toURL(e);return t?t.pathname.endsWith("/slice-simulator"):!1}const ts=p.z.object({results:p.z.array(p.z.string())});function qA(e,t){return U.request(new URL("repository/tags",e),{credentials:U.getRequestCredentials(t),okType:ts})}const ns=p.z.object({maxNbEnvironments:p.z.number(),integrationFieldsEnabled:p.z.boolean(),personalEnvironmentsEnabled:p.z.boolean(),sliceMachineEnabled:p.z.boolean()}),PA=p.z.object({_id:p.z.string(),name:p.z.string(),onboarding:p.z.object({completedSteps:p.z.array(p.z.string()),isDismissed:p.z.boolean()}),framework:Ft.optional().default("other"),quotas:ns.optional().default({maxNbEnvironments:0,integrationFieldsEnabled:!1,personalEnvironmentsEnabled:!1,sliceMachineEnabled:!1}),storageVersion:p.z.object({major:p.z.number().int(),minor:p.z.number().int()}),authors:RA.optional().default([])});function As(e,t,n){const o=new URL("",e);return o.searchParams.append("repository",t),U.request(o,{headers:{repository:t},credentials:U.getRequestCredentials(n),okType:PA})}const os=p.z.enum(["createPrismicProject","chooseLocale","createProject","setupSliceMachine","createPageType","codePage","createSlice","reviewAndPush","createContent","renderPage"]),OA=p.z.object({completedSteps:p.z.array(p.z.string()),isDismissed:p.z.boolean(),context:p.z.object({framework:Ft,starterId:p.z.string().nullable().optional()})}),VA=p.z.object({completedSteps:p.z.array(p.z.string())}),YA=p.z.object({isDismissed:p.z.boolean()});function is(e,t,n){const o=new URL("onboarding",e);return o.searchParams.append("repository",t),U.request(o,{headers:{repository:t},credentials:U.getRequestCredentials(n),okType:OA})}function rs(e,t,n,o){const i=new URL(`onboarding/${e}/toggle`,t);return i.searchParams.append("repository",n),U.request(i,{method:"PATCH",headers:{repository:n},credentials:U.getRequestCredentials(o),okType:VA})}function ss(e,t,n){const o=new URL("onboarding/toggle",e);return o.searchParams.append("repository",t),U.request(o,{method:"PATCH",headers:{repository:t},credentials:U.getRequestCredentials(n),okType:YA})}const WA=p.z.string(),HA=p.z.enum(["Manager","Writer","Readonly"]),bt=p.z.record(WA,HA),fn=p.z.record(p.z.string(),bt),Kt=p.z.object({id:p.z.string(),name:p.z.string(),customTypes:p.z.array(p.z.string()),rolesPerLocale:bt.optional(),rolesPerLocaleByUser:fn.optional()});p.z.object({name:p.z.string(),customTypes:p.z.array(p.z.string()),rolesPerLocale:bt.optional(),rolesPerLocaleByUser:fn.optional()});const as=p.z.object({results:p.z.array(Kt)});function _A(e){const{baseUrl:t,repository:n,authStrategy:o}=e,i=new URL("team-spaces",t);return i.searchParams.append("repository",n),U.request(i,{method:"GET",credentials:U.getRequestCredentials(o),okType:as})}function ls(e){return oe.queryOptions({queryKey:["teamSpaces",e],queryFn:()=>_A(e),select:t=>t.results})}function cs(){const e=oe.useQueryClient();return()=>e.invalidateQueries({queryKey:["teamSpaces"]})}function ds(e){const{baseUrl:t,repository:n,authStrategy:o,payload:i}=e,s=new URL("team-spaces",t);return s.searchParams.append("repository",n),U.request(s,{method:"POST",body:i,credentials:U.getRequestCredentials(o),okType:Kt})}function us(e){const{baseUrl:t,repository:n,authStrategy:o,payload:i,teamSpaceId:s}=e,a=new URL(`team-spaces/${s}`,t);return a.searchParams.append("repository",n),U.request(a,{method:"PUT",body:i,credentials:U.getRequestCredentials(o),okType:Kt})}function gs(e){const{baseUrl:t,repository:n,authStrategy:o,teamSpaceId:i}=e,s=new URL(`team-spaces/${i}`,t);return s.searchParams.append("repository",n),U.request(s,{method:"DELETE",credentials:U.getRequestCredentials(o),okType:p.z.unknown()})}const zA=p.z.enum(["Owner","Administrator","Writer","Manager","Readonly"]),hs=p.z.record(zA.optional()),ps=zA.or(hs),ms={SuperUser:"SuperUser",Owner:"Owner",Administrator:"Administrator",Manager:"Publisher",Writer:"Writer",Readonly:"Contributor"},NA=p.z.object({shortId:p.z.string(),intercomHash:p.z.string(),email:p.z.string(),firstName:p.z.string(),lastName:p.z.string(),superPower:p.z.boolean(),repositories:p.z.array(p.z.object({domain:p.z.string(),name:p.z.string().optional(),role:ps}))});async function GA(e,t){const n=new URL("profile",e);return await U.request(n,{credentials:U.getRequestCredentials(t),okType:NA})}function Cn(){const e=L();e.userServiceBaseUrl||V("userServiceBaseUrl");const{authStrategy:t,userServiceBaseUrl:n}=e;return R.useRequest(GA,[n,t])}const fs="https://prismic.io/docs/guides/manage-images#supported-media";function tt(){const e=L();e.mediaLibrary||V("mediaLibrary");const{assetsApiBaseUrl:t,authStrategy:n,repository:o}=e,{items:i}=R.useRequest(ZA,[t,o,n]);return{tags:i}}function ZA(e,t,n){return U.request(new URL("tags",e),{credentials:U.getRequestCredentials(n),okType:Cs,headers:{repository:t}})}const JA=1,XA=20,xn=p.z.string().min(JA).max(XA),yn=p.z.object({id:p.z.string(),name:xn,uploader_id:p.z.string().optional(),created_at:p.z.number(),last_modified:p.z.number(),count:p.z.number().optional().default(0)}),Cs=p.z.object({items:p.z.array(yn)});function nt(e){R.updateFetcherData(ZA,t=>{const{items:n}=t,o=e(n);if(o)return{items:o}})}function xs(e){const{assetType:t,keyword:n,mode:o,tagIds:i}=e,s=L();s.mediaLibrary||V("mediaLibrary");const{onAnalyticsEvent:a}=s,l=R.useFetcherData(ie),d=l[l.length-1],c=f.useRef(d);c.current=d,f.useEffect(()=>{if(!a||!n||!c.current||c.current.keyword!==n)return;const u=String(n.split(" ").length),h=String(c.current.total),g=i.join(",");a("Media Library Search",{searchQuery:n,numberOfWords:u,numberOfResults:h,timeToGetResults:c.current.time,assetType:t,mode:o,tags:g})},[n,t,o,a,i])}function ys(e){const{assetType:t,mediaDialogOpen:n}=e,o=L(),i=R.useFetcherData(ie),s=f.useRef(0);f.useEffect(()=>{n&&(s.current=performance.now())},[n]);function a(l){if(!o.onAnalyticsEvent||!o.mediaLibrary)return;const d=i[i.length-1];if(!d)return;const{keyword:c,uploaderId:u,tags:h}=d,g=to(i,c,t,u,h),m=String(c.split(" ").length),C=String(d.total),y=g.findIndex(j=>j.id===l),x=String(y+1),I=[l].join(","),B=(performance.now()-s.current).toFixed(0);o.onAnalyticsEvent("Media Added To Page",{assetType:t,searchQuery:c,numberOfWords:m,numberOfResults:C,searchPosition:x,mediaIds:I,timeToAddMediaToPage:B,tags:h})}return a}const rt=p.z.array(p.z.string()).optional().transform(e=>e==null?void 0:e[0]),Ut=p.z.object({id:p.z.string(),kind:p.z.string(),extension:p.z.string().optional(),filename:p.z.string(),width:p.z.number().optional(),height:p.z.number().optional(),last_modified:p.z.number(),url:p.z.string(),alt:p.z.string().optional(),uploader_id:p.z.string().optional(),size:p.z.number(),notes:p.z.string().optional(),credits:p.z.string().optional(),search_highlight:p.z.object({filename:rt,alt:rt,notes:rt,credits:rt}).optional(),tags:p.z.array(yn)}),$A={"X-Prismic-Source":"Wroom"},Bs=p.z.object({total:p.z.number(),cursor:p.z.string().optional(),items:p.z.array(Ut)}),eo=30;function ie(e,t,n,o,i,s,a,l,d){const c=e?new URL("assets",e):void 0,u=new URLSearchParams(vA([{name:"limit",values:[`${eo}`]},{name:"cursor",values:[d]},{name:"keyword",values:[o]},{name:"assetType",values:[i]},{name:"uploaderId",values:[s]},{name:"tags",values:a.split(",")}])).toString(),h=Bs.transform(m=>({...m,keyword:o,assetType:i,uploaderId:s,tags:a,page:l})),g=performance.now();return U.request(`${(c==null?void 0:c.href)??""}?${u}`,{headers:{repository:t,...$A},credentials:U.getRequestCredentials(n),okType:h}).then(m=>({...m,time:(performance.now()-g).toFixed(0)}))}R.cache.registerFetcherConfig(ie,{revalidationStrategy:{type:"never"}});const G={keyword:"",assetType:"all",uploaderId:void 0,tagIds:[]};function Is(e){const{initialAssetType:t=G.assetType,mode:n}=e,o=L(),[i,s]=f.useState({...G,assetType:t,page:0});o.mediaLibrary||V("mediaLibrary");const{assetsApiBaseUrl:a,authStrategy:l,repository:d}=o,{page:c,cursor:u,keyword:h,assetType:g,uploaderId:m,tagIds:C}=i,y=R.useRequest(ie,Xe({assetsApiBaseUrl:a,authStrategy:l,repository:d,keyword:h,assetType:g,uploaderId:m,tagIds:C,page:c,cursor:u}));xs({assetType:g,keyword:h,tagIds:C,mode:n});const x=bs(h,g,m,C),I=y.total!==x.length;function B(){y.cursor!==void 0&&s(v=>({...v,page:v.page+1,cursor:y.cursor}))}function j(v){s(F=>({...F,page:0,cursor:void 0})),Le((F,T)=>{if(T.page===0)return[...v,...F]})}function S(v){s(F=>({...F,...v,page:0,cursor:void 0}))}function b(){s(v=>({...v,...G,assetType:t==="all"?G.assetType:v.assetType,page:0,cursor:void 0}))}return{keyword:h,assetType:g,uploaderId:m,tagIds:C,setFilters:S,resetFilters:b,media:x,mediaTotal:y.total,limit:eo,hasNextPage:I,fetchNextPage:B,updateMedia:js,unshiftMedia:j,deleteMedia:Fs,deleteSearchData:Ss,revalidateFirstPage:no}}function js(e){Le(t=>t.flatMap(n=>{const o=e.find(i=>i.id===n.id);return o?o.response===void 0?[]:{...n,...o.response}:n}))}function Fs(e){Le(t=>t.filter(n=>!e.includes(n.id)))}function Ss(e){const{keyword:t,assetType:n,uploaderId:o,tagIds:i}=e,s=i==null?void 0:i.join(",");R.updateFetcherData(ie,a=>{if(!(a.keyword===t&&a.assetType===n&&a.uploaderId===o&&a.tags===s))return a})}function to(e,t,n,o,i){const s=e.filter(d=>d.keyword===t&&d.assetType===n&&d.uploaderId===o&&d.tags===i),l=O.sort(s,d=>d.page).flatMap(d=>d.items);return t?O.uniqBy(l,d=>d.id):l}function bs(e,t,n,o){const i=R.useFetcherData(ie);return to(i,e,t,n,o.join(","))}function Le(e){R.updateFetcherData(ie,t=>{const{items:n,total:o}=t,i=e(n,t);if(i)return{...t,total:o+(i.length-n.length),items:i}})}function no(e){const{config:t,keyword:n=G.keyword,assetType:o=G.assetType,tagIds:i=G.tagIds}=e;if(!t.mediaLibrary)throw new Error("media library is not configured");const{assetsApiBaseUrl:s,authStrategy:a,repository:l}=t;R.revalidateData(ie,Xe({assetsApiBaseUrl:s,repository:l,authStrategy:a,keyword:n,assetType:o,tagIds:i,page:0}))}function Ao(e){const{config:t,keyword:n=G.keyword,assetType:o=G.assetType,tagIds:i=G.tagIds}=e;if(!t.mediaLibrary)throw new Error("media library is not configured");R.updateFetcherData(ie,s=>s.page===0?s:void 0),no({config:t,keyword:n,assetType:o,tagIds:i})}function Xe(e){return[e.assetsApiBaseUrl,e.repository,e.authStrategy,e.keyword,e.assetType,e.uploaderId,e.tagIds.join(","),e.page,e.cursor]}function oo(){const e=L();e.mediaLibrary||V("mediaLibrary");const{assetsApiBaseUrl:t,coreApiBaseUrl:n,authStrategy:o,repository:i}=e,{authors:s}=R.useRequest(St,[n,o]),{items:a}=R.useRequest(io,[t,i,o]),{shortId:l}=Cn(),d=new Map(s.map(h=>[h.id,h])),c=[];for(const h of a){if(h.id==="ghost"){c.push({id:h.id,name:"Ghost",uploadedAvatar:"https://images.prismic.io/page-builder-assets/ZuAXWBoQrfVKl5sD_ghost_user.png?auto=format,compress&w=64"});continue}const g=d.get(h.id);if(!g)continue;let m;if(g.uploadedAvatar){const C=new URL(g.uploadedAvatar);C.searchParams.set("w","64"),m=C.toString()}c.push({id:h.id,name:[g.firstname,g.lastname].filter(Boolean).join(" "),firstName:g.firstname,lastName:g.lastname,email:g.email,uploadedAvatar:m})}const u=new Map(c.map(h=>[h.id,h]));return{uploaders:O.sort(c,h=>h.id===l?0:1,h=>h.name),uploadersById:u}}function io(e,t,n){return U.request(new URL("uploaders",e),{credentials:U.getRequestCredentials(n),okType:Us,headers:{repository:t}})}const Ks=p.z.object({id:p.z.string()}),Us=p.z.object({items:p.z.array(Ks)});function ro(){const e=L();e.mediaLibrary||V("mediaLibrary");const{assetsApiBaseUrl:t,authStrategy:n,repository:o}=e;return()=>{R.revalidateData(io,[t,o,n])}}function Ts(e){const{revalidate:t,config:n,keyword:o,assetType:i,uploaderId:s,tagIds:a}=e,{assetsApiBaseUrl:l=void 0,repository:d="",authStrategy:c="token"}=n.mediaLibrary?n:{},[u,h]=f.useState(!1),[g,m]=f.useState(!1),C={assetsApiBaseUrl:l,repository:d,authStrategy:c,keyword:o,assetType:i,uploaderId:s,tagIds:a,page:0},{revalidateData:y}=R.useCacheRevalidation({fetcher:ie,requestParams:Xe(C),validator:(B,j)=>{var v,F;const S=((v=B.items[0])==null?void 0:v.id)??"",b=((F=j.items[0])==null?void 0:F.id)??"";return S!==b||B.total!==(j==null?void 0:j.total)},onCacheInvalidated:()=>m(!0),every:6e4}),x=B=>{y(Xe({...C,...B}))};f.useEffect(()=>{u&&(m(!1),h(!1))},[u]);function I(){h(!0),t()}return{isMediaRevalidationInProgress:u,isMediaCacheInvalid:g,revalidateMedia:I,revalidateWithParams:x}}function ws(e){const{onBeforeUpload:t,onComplete:n}=e,[o,i]=f.useState([]),s=o.some(u=>u.status==="idle"||u.status==="uploading"),a=L();function l(){if(!o.length||o.some(m=>m.status==="uploading")||o.every(m=>m.status==="error"))return;const u=o.find(m=>m.status==="idle");if(!u)return;let h=o;function g(m){h=m(h),i(h),h.every(y=>y.status==="success"||y.status==="error")&&setTimeout(()=>{i([]),n==null||n(h)},1500)}g(m=>m.map(C=>C.id===u.id?{...C,status:"uploading"}:C)),so({file:u.file,config:a}).then(m=>{g(C=>C.map(y=>y.id===u.id?{...y,status:"success",response:m}:y))}).catch(()=>{g(m=>m.map(C=>C.id===u.id?{...C,status:"error"}:C))})}function d(u){const h=u.map(g=>({id:`temp-${crypto.randomUUID()}`,file:g,status:"idle"}));i(h),t(h)}const c=f.useCallback(u=>{const h=[{...u,status:"idle"},...o.filter(g=>g.id!==u.id)];i(h),t(h)},[t,o]);return f.useEffect(l,[a,o,n]),{isUploading:s,uploadingFiles:o,onFilesSelected:d,onRetry:c}}async function so(e){const{file:t,config:n}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:o,repository:i,authStrategy:s}=n,a=new FormData;return a.append(t.name,t),U.request(new URL("assets",o),{headers:{repository:i,"Content-Type":"multipart/form-data",...$A},method:"POST",body:a,credentials:U.getRequestCredentials(s),okType:Ut})}const ao=f.createContext(void 0);function Ls(e){const{children:t,assetType:n=G.assetType,onSelectedChange:o,actionContainer:i}=e,s=o?"select":"browse",[a,l]=f.useTransition(),[d,c]=f.useTransition(),u=L(),{showAlert:h}=r.useAlert(),g=Cn(),m=ro(),{keyword:C,assetType:y,uploaderId:x,tagIds:I,setFilters:B,resetFilters:j,media:S,fetchNextPage:b,hasNextPage:v,updateMedia:F,unshiftMedia:T,deleteMedia:k,mediaTotal:M,deleteSearchData:_,revalidateFirstPage:ge}=Is({initialAssetType:n,mode:s}),[he,Qe]=f.useState();function Me(){Ao({config:u,keyword:C,assetType:y,uploaderId:x,tagIds:I})}const{isMediaRevalidationInProgress:D,isMediaCacheInvalid:Q,revalidateMedia:z,revalidateWithParams:pe}=Ts({config:u,revalidate:Me,keyword:C,assetType:y,uploaderId:x,tagIds:I});function ot(q){const N=q.keyword===G.keyword,re=q.assetType===n,$=q.uploaderId===G.uploaderId,me=q.tagIds.length===G.tagIds.length&&q.tagIds.every((Ni,Gi)=>Ni===G.tagIds[Gi]);return N&&re&&$&&me}function H(q){const N={keyword:C,assetType:y,tagIds:I,uploaderId:x,...q};ot(N)?pe(q):_(N),c(()=>{B(q),it.clearSelection()})}const{isUploading:qe,onFilesSelected:Oi,uploadingFiles:kn,onRetry:Vi}=ws({onBeforeUpload:q=>{j();const N=q.filter($=>$.status==="idle").map($=>({id:$.id,url:URL.createObjectURL($.file),filename:$.file.name,size:$.file.size,extension:$.file.type,kind:$.file.type,last_modified:$.file.lastModified,tags:[],uploader_id:g.shortId}));T(N);const[re]=N??[];re&&it.toggleSelection({id:re.id,isSingleSelection:!0})},onComplete:q=>{const N=q.flatMap(me=>me.status==="success"?me:(_i(me),{id:me.id,response:void 0}));F(N),ge({config:u,assetType:y,tagIds:I}),m();const re=N[0];!re||!re.response||!it.isSelected(re.id)||it.toggleSelection({id:re.response.id,isSingleSelection:!0})}}),it=je({totalItemCount:M,onChangeSelection:({selectedIds:q,selectedCount:N})=>{if(En(!1),!!o){if(N===1){const[re]=[...q];if(kn.some(me=>me.id===re&&me.status!=="success")){o(new Set);return}}o(new Set(q))}}});function Yi(q){qe||Oi(q)}function Wi(){v&&l(b)}function Hi(q,N){F([{id:q,response:N}])}function _i(q){const N=Ae.overflow(q.file.name,30);h({id:q.id,title:`The specified file "${N}" could not be uploaded.`,subtitle:A.jsxs(r.Text,{color:"inherit",children:["Read more about our"," ",A.jsx(r.Text,{color:"tomato11",href:fs,underline:!0,children:"supported media"}),"."]}),buttons:{action:{text:"Retry upload",icon:"cloudUpload",onClick:()=>Vi(q)}}})}const[zi,En]=f.useState(!1);return A.jsx(ao.Provider,{value:{isFetchingMedia:a,media:S,mediaTotal:M,onScrollToBottom:Wi,actionContainer:i,onFilesUpload:Yi,isUploading:qe,uploadingFiles:kn,isMediaRevalidationInProgress:D,isMediaCacheInvalid:Q,revalidateMedia:z,deleteMedia:k,updateMedia:Hi,keyword:C,isSearchingMedia:d,assetType:y,initialAssetType:n,uploaderId:x,tagManagerOpen:zi,setTagManagerOpen:En,tagIds:I,onFilterChange:H,openMediaSection:he,setOpenMediaSection:Qe},children:t})}function P(){const e=f.useContext(ao);if(!e)throw new Error("useMediaLibrary must be used within a MediaLibraryProvider");return e}function vs(){const e=L(),{initialAssetType:t}=P(),{assetsApiBaseUrl:n=void 0,repository:o="",authStrategy:i="token"}=e.mediaLibrary?e:{},{total:s}=R.useRequest(ie,Xe({assetsApiBaseUrl:n,authStrategy:i,repository:o,assetType:t,keyword:"",tagIds:[],page:0}));return s}function lo(){return vs()===0}function ks(){return lo()?A.jsx(Es,{}):A.jsx(uo,{})}function co(e){const{children:t}=e;return A.jsx(r.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:t})}function uo(){return A.jsx(co,{children:A.jsxs(r.BlankSlate,{children:[A.jsx(r.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),A.jsx(r.BlankSlateTitle,{size:"big",children:"Oops!"}),A.jsx(r.BlankSlateDescription,{width:360,children:"No items found matching your search"})]})})}function Es(){const{onFilesUpload:e}=P();return A.jsx(co,{children:A.jsxs(r.Box,{gap:20,flexDirection:"column",alignItems:"center",children:[A.jsx(r.Box,{maxWidth:375,children:A.jsx(r.BlankSlateTitle,{size:"big",children:"Start by uploading your files!"})}),A.jsx(r.Box,{border:!0,borderStyle:"dashed",borderRadius:4,justifyContent:"center",children:A.jsxs(r.BlankSlate,{sx:{marginBlock:80,marginInline:48},children:[A.jsx(r.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple11",backgroundColor:"purple5",size:"large"}),A.jsx(r.BlankSlateTitle,{children:"Drop your files anywhere to upload or ..."}),A.jsx(r.FileUploadButton,{onFilesSelected:e,renderButton:t=>A.jsx(r.Box,{display:"inline-flex",as:"span",children:A.jsx(r.Button,{onClick:t,color:"grey",children:"Upload media"})})}),A.jsx(r.BlankSlateDescription,{children:"Maximum upload size file: 128 MB"})]})})]})})}const ze={warning:{uploadWhileUploading:{title:"Hang tight!",description:"Your current images are still being uploaded. Once they're all set, you'll be free to upload more."}}};function Ds(){const{actionContainer:e,isUploading:t,onFilesUpload:n,assetType:o}=P();return A.jsx(go,{actionContainer:e,children:A.jsxs(r.Box,{width:"100%",gap:16,children:[A.jsx(Rs,{}),A.jsx(r.Tooltip,{title:ze.warning.uploadWhileUploading.title,content:ze.warning.uploadWhileUploading.description,visible:t,stableMount:!0,children:A.jsx(r.FileUploadButton,{disabled:t,onFilesSelected:n,startIcon:"cloudUpload",color:e?"purple":"grey",size:"large",assetType:o,children:"Upload media"})})]})})}function Rs(){const{keyword:e,onFilterChange:t,isFetchingMedia:n}=P(),[o,i]=f.useState(e);return E.useOnChange(e,()=>{e===""&&i("")}),E.useDebounce(o,300,E.useStableCallback(s=>t({keyword:s}))),A.jsx(r.Box,{width:"100%",flexDirection:"column",children:A.jsx(r.FormSearchInput,{value:o,placeholder:"Search",onValueChange:i,maxLength:200,isLoading:n&&e!==o})})}function go(e){const{children:t,actionContainer:n}=e;return n?A.jsx(r.Portal,{container:n,asChild:!0,children:t}):A.jsx(A.Fragment,{children:t})}function Qs(e){const{children:t}=e,{onFilesUpload:n,assetType:o}=P();return A.jsx(r.FileDropZone,{overlay:A.jsx(Ms,{}),onFilesSelected:n,assetType:o,children:t})}function Ms(){const{isUploading:e}=P(),t=e?ze.warning.uploadWhileUploading.title:"Drop files here",n=e?ze.warning.uploadWhileUploading.description:"Drop your files to upload them instantly to the media library.";return A.jsx(r.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:A.jsxs(r.BlankSlate,{children:[A.jsx(r.BlankSlateIcon,{name:e?"block":"cloudUpload",lineColor:e?"tomato11":"purple10",backgroundColor:e?"tomato2":"purple3",borderColor:e?"tomato6":"purple6",borderStyle:"dashed",size:"xlarge"}),A.jsx(r.BlankSlateTitle,{size:"big",children:t}),A.jsx(r.BlankSlateDescription,{width:360,children:n})]})})}function ho(){return A.jsx(r.DefaultErrorMessage,{title:"Oops! Something went wrong",description:"An error occurred while searching for your image.",errorImageSrc:r.dialogErrorImage,sx:{marginBlock:"auto",marginInline:"auto"}})}function po(e){const{mediaList:t,mediaActions:n,mediaToolbar:o,sidePane:i}=e,s=r.useMediaQuery({min:"medium"}),a=i&&s;return A.jsxs(r.Box,{display:"grid",gridTemplateRows:"auto auto 1fr",gridTemplateColumns:a?"1fr 380px":"1fr",width:"100%",height:"100%",children:[A.jsxs(r.Box,{position:"relative",display:"grid",gap:16,gridColumn:"1",gridRow:"1",padding:{right:16,bottom:16},children:[n,o]}),A.jsx(r.Box,{position:"relative",display:"grid",gridColumn:"1",gridRow:"2 / -1",children:t}),a&&i]})}function qs(){var g;const{onScrollToBottom:e,media:t,isUploading:n,uploadingFiles:o,isSearchingMedia:i,isMediaRevalidationInProgress:s,setOpenMediaSection:a,isFetchingMedia:l}=P(),d=je(),c=f.useRef(null);function u(m){d.toggleSelection({id:m,isSingleSelection:!0}),a("tags")}(n||i||s)&&((g=c.current)==null||g.scrollTo({top:0,behavior:"instant"}));function h(m,C,y){const x=C.shiftKey?t.map(({id:I})=>I):void 0;d.toggleSelection({id:m,isSingleSelection:y==="single",metaKey:C.metaKey,shiftKey:C.shiftKey,ids:x})}return A.jsxs(mo,{onScrollToBottom:e,scrollAreaRef:c,children:[t.map(m=>{var C,y;return A.jsx(r.MediaCard,{"aria-label":"media item",...m,filenameHighlight:(C=m.search_highlight)==null?void 0:C.filename,loading:i,status:(y=o.find(x=>x.id===m.id))==null?void 0:y.status,selected:d.isSelected(m.id),onCardClick:x=>h(m.id,x,"single"),onCheckedChange:(x,I)=>h(m.id,I,"multi"),onAddTagClick:()=>u(m.id)},m.id)}),A.jsx(r.Box,{gridColumn:"1 / -1",justifyContent:"center",children:A.jsx(r.AnimatedElement,{animation:{name:"fade"},children:l&&A.jsx(r.Text,{align:"center",color:"grey11",sx:{marginBlock:8},children:"Loading more items ..."})})})]})}function mo(e){const{children:t,scrollAreaRef:n,onScrollToBottom:o}=e,i=16,s=4,a="250px",l=`calc((100% - ${i*(s-1)}px) / ${s})`;return A.jsx(r.ScrollArea,{"aria-label":"Media list",ref:n,style:{display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(max(${a}, ${l}), 1fr))`,gridTemplateRows:"1fr 1fr 1fr ",gap:i,padding:2,paddingBottom:16,position:"relative"},onScrollToBottom:o,threshold:500,children:t})}function fo(e){const{children:t,hasSelectedMedia:n}=e;return A.jsx(r.Box,{overflow:"hidden",gridColumn:"2 / -1",gridRow:"1 / -1",children:A.jsx(r.ScrollArea,{style:{display:"grid",height:"100%"},children:A.jsx(r.Box,{flexGrow:1,borderRadius:{topRight:8,topLeft:8},borderStyle:n?"solid":"dashed",border:{top:!0,right:!0,left:!0,bottom:!1},minWidth:0,children:t})})})}function Co(e){const{onFilesUpload:t,isUploading:n,isInitialLoad:o=!1}=e,i=o||n;return A.jsxs(r.Box,{flexDirection:"column",justifyContent:"center",alignItems:"center",padding:16,gap:16,width:"100%",children:[A.jsx(r.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple11",backgroundColor:"purple5",size:"large"}),A.jsx(r.Box,{flexDirection:"column",gap:4,children:A.jsxs(r.Text,{align:"center",children:["Select or"," ",A.jsx(r.FileUploadButton,{disabled:i,onFilesSelected:t,renderButton:s=>A.jsx(r.Tooltip,{title:ze.warning.uploadWhileUploading.title,content:ze.warning.uploadWhileUploading.description,visible:n,children:A.jsx(r.Box,{display:"inline-flex",as:"span",children:A.jsx(r.Button,{disabled:i,onClick:s,invisible:!0,children:"upload"})})})})," ","media."]})}),A.jsx(r.FileUploadButton,{disabled:i,onFilesSelected:t,color:"grey",children:"Upload media"})]})}function xo(e){const{count:t}=e;return A.jsxs(r.Text,{variant:"bold",children:[t," item",t==1?"":"s"]})}function Ps(e){const{actionContainer:t}=e;return A.jsx(po,{sidePane:A.jsx(Ys,{}),mediaActions:A.jsx(Vs,{actionContainer:t}),mediaToolbar:A.jsx(r.Skeleton,{color:"grey5",borderRadius:12,children:A.jsx(xo,{count:888})}),mediaList:A.jsx(Os,{})})}function Os(){return A.jsx(mo,{children:O.range(1,24).map(e=>A.jsx(yo,{},e))})}function Vs(e){const{actionContainer:t}=e;return A.jsx(go,{actionContainer:t,children:A.jsxs(r.Box,{width:"100%",gap:16,children:[A.jsx(r.Box,{width:"100%",flexDirection:"column",children:A.jsx(r.FormSearchInput,{placeholder:"Search",maxLength:200,value:"",disabled:!0,onValueChange:()=>{}})}),A.jsx(r.FileUploadButton,{disabled:!0,onFilesSelected:()=>{},startIcon:"cloudUpload",color:t?"purple":"grey",size:"large",children:"Upload media"})]})})}function Ys(){return A.jsx(fo,{hasSelectedMedia:!1,children:A.jsx(Co,{onFilesUpload:()=>{},isUploading:!1,isInitialLoad:!0})})}function yo(){return A.jsx(r.Card,{variant:"outlined",padding:16,children:A.jsxs(r.CardContent,{gap:0,children:[A.jsx(r.Skeleton,{height:185,width:"100%"}),A.jsx(r.Skeleton,{height:16,width:"100%",sx:{marginTop:12}}),A.jsx(r.Skeleton,{height:10,width:100,sx:{marginTop:8}}),A.jsx(r.Skeleton,{height:1,width:"100%",sx:{marginTop:20,marginBottom:16}}),A.jsxs(r.Box,{flexDirection:"row",gap:8,children:[A.jsx(r.Skeleton,{height:24,width:54}),A.jsx(r.Skeleton,{height:24,width:45}),A.jsx(r.Skeleton,{height:24,width:62})]})]})})}const Bo=f.createContext({showToast:()=>{}});function Ws(e){const{children:t}=e,[n,o]=f.useState({title:"",seconds:5}),[i,s]=f.useState(!1),{title:a,action:l,seconds:d=1,icon:c="check"}=n,u=f.useMemo(()=>({showToast:h=>{o({seconds:d,...h}),s(!0)}}),[d]);return A.jsxs(A.Fragment,{children:[A.jsx(Hs,{}),A.jsx(r.Toast,{anchor:A.jsx(r.Box,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),open:i,onOpenChange:s,title:a,action:l,seconds:d,icon:c}),A.jsx(Bo.Provider,{value:u,children:t})]})}function Io(){return f.useContext(Bo)}function Hs(){const{revalidateMedia:e,isMediaCacheInvalid:t}=P(),[n,o]=f.useState(t);return E.useOnChange(t,o),A.jsx(r.Toast,{anchor:A.jsx(r.Box,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),open:n,title:"There have been changes to your media library",action:{title:"Update",onClick:e},cancel:{onClick:()=>o(!1)}})}function Ee(){const{media:e}=P(),t=je();return e.filter(({id:n})=>t.isSelected(n))}function _s(){const[e,t]=f.useState(!1),n=Ee(),o=je(),i=f.useMemo(()=>n.some(({id:a})=>a.startsWith("temp")),[n]),[s]=n;return s?o.selectedCount>1?A.jsxs(r.Box,{gap:8,alignItems:"center",children:[A.jsxs(r.Text,{variant:"emphasized",noWrap:!0,sx:{flexGrow:1},children:[o.selectedCount," media selected"]}),A.jsx(r.Tooltip,{content:"Open all selected media in new tabs",children:A.jsx(r.IconButton,{icon:"openInFull",variant:"solid",size:"small",onClick:()=>n.forEach(a=>window.open(a.url,"_blank"))})}),A.jsx(r.Tooltip,{content:"Remove selected media",children:A.jsx(r.IconButton,{icon:"delete",variant:"solid",color:"tomato",size:"small",hiddenLabel:"Remove media",onClick:()=>t(!0),disabled:i})}),A.jsx(qn,{open:e,onOpenChange:t,media:n})]}):A.jsxs(r.Box,{gap:8,alignItems:"center",children:[A.jsx(r.Text,{variant:"emphasized",noWrap:!0,sx:{flexGrow:1},children:s.filename}),A.jsxs(r.Box,{gap:8,children:[A.jsx(r.Tooltip,{content:"Open media in new tab",children:A.jsx(r.IconButton,{icon:"openInFull",variant:"solid",size:"small",hiddenLabel:"Open media in new tab",onClick:()=>window.open(s.url,"_blank"),disabled:i})}),A.jsx(r.Tooltip,{content:"Copy media URL",children:A.jsx(r.IconButton,{icon:"link",variant:"solid",size:"small",hiddenLabel:"Copy media URL",onClick:()=>navigator.clipboard.writeText(s.url),disabled:i})}),A.jsx(r.Tooltip,{content:"Remove media",children:A.jsx(r.IconButton,{icon:"delete",variant:"solid",color:"tomato",size:"small",hiddenLabel:"Remove media",onClick:()=>t(!0),disabled:i})}),A.jsx(qn,{open:e,onOpenChange:t,media:s})]})]}):null}function qn(e){const{open:t,onOpenChange:n,media:o}=e,i=L(),{showAlert:s}=r.useAlert(),{deleteMedia:a}=P(),l=je(),d=ro(),[c,u]=f.useState(!1),h=Array.isArray(o),g=h?"these items":"this item";function m(){u(!0);const y=l.getSelectionState().selectedIds;Ns({ids:y,config:i}).then(()=>{n(!1),a(y),l.clearSelection(),d()}).catch(()=>{n(!1),s({title:"Error",subtitle:`Something went wrong when removing ${g}.`})}).finally(()=>{u(!1)})}return A.jsxs(r.Dialog,{onOpenChange:n,open:t,size:"small",children:[A.jsx(r.DialogHeader,{icon:"alert",title:`Remove ${g} from your media library?`}),A.jsx(r.DialogDescription,{asChild:!0,children:A.jsx(r.DialogContent,{children:A.jsxs(r.Box,{padding:16,flexDirection:"column",children:[A.jsxs(r.Text,{children:["You are about to delete ",g,": ",!h&&A.jsx("b",{children:o.filename})]}),h&&A.jsx(zs,{media:o})]})})}),A.jsxs(r.DialogActions,{children:[A.jsx(r.DialogCancelButton,{}),A.jsxs(r.DialogActionButton,{onClick:m,color:"tomato",loading:c,children:["Yes, I want to remove ",g]})]})]})}const Et=15;function zs(e){const{media:t}=e,n=t.slice(0,Et),o=t.length>Et,i=o?t.length-Et:0,s=Ae.pluralize(i,"item");return A.jsxs(r.UnorderedList,{density:"compact",sx:{marginTop:8},children:[n.map((a,l)=>A.jsx(r.ListItem,{children:A.jsx("b",{children:a.filename})},l)),o&&A.jsxs(r.ListItem,{children:["And ",A.jsx("b",{children:i})," more ",s,"..."]})]})}function Ns(e){const{ids:t,config:n}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");if(t.length===0)throw new Error("No ids provided during media deletion");const{assetsApiBaseUrl:o,repository:i,authStrategy:s}=n;if(t.length===1){const[a]=t;return U.request(new URL(`assets/${a}`,o),{headers:{repository:i},method:"DELETE",credentials:U.getRequestCredentials(s),okType:p.z.unknown()})}return U.request(new URL("assets/bulk-delete",o),{headers:{repository:i},method:"POST",credentials:U.getRequestCredentials(s),okType:p.z.unknown(),body:{ids:t}})}const ye=2e3,Ze="__MAIN_THUMBNAIL__";function Ht(e,t,n){const o=e.name===Ze?void 0:e.name;let i;return t?ae.isDefined(n)?i=[n.width,n.height]:ae.isDefined(e.width)||ae.isDefined(e.height)?i=[e.width??void 0,e.height??void 0]:i=[t.origin.width,t.origin.height]:i=void 0,[o,i?`${i[0]??"auto"}×${i[1]??"auto"}px`:void 0]}function Gs(e){var t,n;return[{...(t=e.config)==null?void 0:t.constraint,name:Ze}].concat(((n=e.config)==null?void 0:n.thumbnails)??[])}function Zs(e,t){var a,l;const{__TYPE__:n,thumbnails:o,...i}=t,s=(l=(a=e.config)==null?void 0:a.thumbnails)==null?void 0:l.map(({name:d})=>o==null?void 0:o[d]);return[i,...s??[]]}function Js(e,t,n,o){const i=o.length===0?void 0:o;return e===Ze||!K.isImageContent(t)?{...t,alt:i}:{...t,thumbnails:{...t.thumbnails,[e]:{...n,alt:i}}}}function Xs(e,t){const{width:n,height:o}=t??{};return n&&o?[n,o]:n?[n,Math.round(e.height*(n/e.width))]:o?[Math.round(e.width*(o/e.height)),o]:[e.width,e.height]}function $s(e,t,n,o,i){if(ia(e)==="svg")return e;const s=new URL(e);if(i){const{x:a,y:l,width:d,height:c}=t,u=[...s.searchParams.entries(),["rect",[a,l,d,c].join(",")],["w",n],["h",o]];s.search=u.map(h=>h.join("=")).join("&")}return s.toString()}function Bn(e,t){const n=new URL(e.split("?")[0]??e);return t!=null&&t.width&&n.searchParams.set("w",t.width.toString()),t!=null&&t.height&&n.searchParams.set("h",t.height.toString()),(t!=null&&t.width||!(t!=null&&t.height))&&n.searchParams.set("dpr",Math.max(1,Math.min(window.devicePixelRatio,3)).toString()),t!=null&&t.width&&(t!=null&&t.height)&&n.searchParams.set("fit","max"),n.searchParams.set("auto","compress,format"),n.toString()}function ea(e){return Bn(e,{width:300})}function jo(e){return Bn(e,{width:800,height:800})}function ta(e){return e!=null&&e.url?jo(e.url):void 0}function na(e,t,n,o){var l,d,c,u,h;if(!n||e===Ze){const g=(l=t.config)==null?void 0:l.thumbnails,m=g&&Object.fromEntries(g.map(C=>[C.name,ct(o,C)]));return{__TYPE__:"ImageContent",...ct(o,(d=t.config)==null?void 0:d.constraint),thumbnails:m}}const i=(u=(c=t.config)==null?void 0:c.thumbnails)==null?void 0:u.find(g=>g.name===e);if(!i)return n;const s=(h=n.thumbnails)==null?void 0:h[e],a=ct(o,i);return a.url===(s==null?void 0:s.url)?n:{...n,thumbnails:Ge.mapValues(n.thumbnails??{},(g,m)=>m===e?a:g)}}function Aa(e){return"kind"in e&&"extension"in e}function ct(e,t){const{width:n,height:o,rect:i}=oa({...e,width:(e==null?void 0:e.width)??ye,height:(e==null?void 0:e.height)??ye},t),s=!!(t!=null&&t.width||t!=null&&t.height);return{provider:"imgix",url:$s(e.url,i,n,o,s),alt:e.alt,...Aa(e)?{credits:e.credits}:{},origin:{id:e.id,url:e.url,width:e.width??ye,height:e.height??ye},width:n,height:o,edit:{background:"transparent",zoom:1,crop:{x:i.x,y:i.y}}}}function oa(e,t){const[n,o]=Xs(e,t),i=Math.max(n/e.width,o/e.height),s=Math.round((e.width-n/i)/2),a=Math.round((e.height-o/i)/2),l=Math.round(n/i),d=Math.round(o/i);return{width:n,height:o,rect:{x:s,y:a,width:l,height:d}}}function ia(e){const{pathname:t}=new URL(e),n=t.lastIndexOf(".");if(n!==-1)return t.substring(n).slice(1).toLowerCase()}function ra(e){if(!e)return"";const{filename:t,extension:n}=e;return!n||!t.endsWith(`.${n}`)?t:t.slice(0,-n.length-1)}function sa(){var s;const e=Ee(),{uploadingFiles:t}=P(),[n]=e;if(!n)return null;if(e.length===2)return A.jsx(Dt,{children:e.map((a,l)=>A.jsx("div",{style:{position:"absolute",transform:l===0?"translateX(25%) rotate(15deg) ":"translateX(-25%) rotate(-15deg) "},children:A.jsx(Pn,{media:a})},a.id))});if(e.length>2)return A.jsx(Dt,{children:e.slice(-4).map((a,l)=>A.jsx("div",{style:{position:"absolute",paddingRight:l*16},children:A.jsx(Pn,{media:a})},a.id))});const o=(s=t.find(a=>a.id===n.id))==null?void 0:s.status,i=n.kind.startsWith("image");return A.jsx(r.Box,{flexDirection:"column",children:A.jsx(r.CheckerBoard,{children:A.jsx(Dt,{uploadStatus:o,hasImage:i,children:i?A.jsx(r.Image,{src:n.url,alt:n.alt,sizing:"contain"}):A.jsx(r.MediaCardPlaceholder,{kind:n.kind,filename:n.filename})})})})}function Dt(e){const{children:t,uploadStatus:n,hasImage:o}=e;return A.jsxs(r.Box,{flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",height:200,width:"100%",backgroundColor:o?"transparent":"purple2",children:[t,n&&A.jsx(aa,{uploadStatus:n})]})}function aa(e){const{uploadStatus:t}=e,{value:n,color:o,height:i,transition:s}=la(t);return A.jsx(r.Box,{position:"absolute",backgroundColor:"greyAlpha1",width:"100%",height:"100%",padding:{inline:16},justifyContent:"end",flexDirection:"column",children:A.jsx(r.ProgressBar,{value:n,color:o,height:i,transition:s})})}function la(e){switch(e){case"idle":return{value:0,height:"collapsed",color:"grey4"};case"uploading":return{value:90,transition:"slow",color:"purple9"};case"success":return{value:100,height:"collapsed",color:"purple9"};case"error":return{value:100,color:"tomato11"}}}function Pn(e){const{media:t}=e;return A.jsx(r.Box,{width:111,height:152,children:t.kind==="image"?A.jsx(r.Image,{borderRadius:8,src:Bn(t.url,{width:111,height:152}),alt:t.alt,sizing:"cover"}):A.jsx(r.MediaCardPlaceholder,{kind:t.kind,filename:t.filename})})}function ca(e){const t=e.length,n={},o=[];return e.forEach(s=>{s.tags.forEach(a=>{n[a.id]||(n[a.id]=0,o.push(a)),n[a.id]++})}),o.filter(s=>n[s.id]===t)}function Fo(e){const{tags:t,toggleAssetTag:n,getTagsLabel:o}=e,{setTagManagerOpen:i}=P(),{showToast:s}=Io(),{showAlert:a}=r.useAlert(),[l,d]=f.useState("");async function c(u,h){d("");try{await n(u,h),s({title:"Media tags were updated",seconds:3})}catch{a({title:"Error",subtitle:"Something went wrong when updating media tags"})}}return A.jsxs(r.Box,{flexDirection:"column",children:[A.jsxs(r.Box,{justifyContent:"space-between",children:[A.jsx(r.Text,{color:"grey12",variant:"bold",children:o()}),A.jsx(r.Button,{startIcon:"edit",invisible:!0,color:"dark",onClick:()=>i(!0),children:"Manage tags"})]}),A.jsxs(r.ComboBox,{sx:{marginTop:4,marginBottom:8},children:[A.jsx(da,{searchTerm:l,setSearchTerm:d}),A.jsx(r.ComboBoxContent,{children:A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(r.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting tags"}),children:A.jsx(f.Suspense,{fallback:A.jsx(r.Box,{padding:8,flexDirection:"column",gap:8,children:O.range(1,6).map(u=>A.jsx(r.Skeleton,{height:24,width:85},u))}),children:A.jsx(ua,{searchTerm:l,assignedTags:t,onToggleAssetTag:c})})})})]}),A.jsx(r.Box,{flexDirection:"column",alignItems:"flex-start",gap:8,children:t.map(u=>A.jsx(r.Badge,{title:u.name,size:"medium",color:"purple",selected:!0,onClose:()=>c(u,"remove")},u.id))})]})}function da(e){const{searchTerm:t,setSearchTerm:n}=e,o=f.useRef(null),{openMediaSection:i,setOpenMediaSection:s}=P();return f.useEffect(()=>{var a;i==="tags"&&((a=o.current)==null||a.focus(),s(void 0))},[i,s]),A.jsx(r.ComboBoxInput,{value:t,onValueChange:n,placeholder:"Add or create a new tag",ref:o})}function ua(e){const{searchTerm:t,assignedTags:n,onToggleAssetTag:o}=e,[i]=Ee(),s=L(),{showAlert:a}=r.useAlert(),{tags:l}=tt(),d=f.useMemo(()=>{const g=t.toLowerCase();return l.filter(m=>m.name.toLowerCase().includes(g))},[l,t]),u=xn.safeParse(t).success&&l.every(g=>g.name!==t);async function h(){if(!t||!i)return;let g;try{g=await ga({name:t,config:s}),nt(m=>[g,...m])}catch{a({title:"Error",subtitle:`Something went wrong when creating the tag ${t}`});return}await o(g,"add")}return i?A.jsxs(A.Fragment,{children:[!d.length&&A.jsx(r.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"No tags found"}),d.map((g,m)=>A.jsx(r.ComboBoxItem,{value:g.id,onCheckedChange:C=>o(g,C?"add":"remove"),checked:n.some(C=>C.id===g.id),children:A.jsx(r.Badge,{title:g.name,color:"purple",size:"medium",sx:{marginInline:8,marginBottom:m===d.length-1?8:4,marginTop:m===0?8:4}})},g.id)),u&&A.jsx(r.ComboBoxItem,{value:"new",onCheckedChange:h,children:A.jsxs(r.Box,{padding:8,flexDirection:"row",alignItems:"center",gap:4,children:[A.jsx(r.Icon,{name:"add",size:"small",color:"grey11"}),A.jsxs(r.Text,{color:"grey12",children:['Create tag "',t,'"']})]})})]}):null}function ga(e){const{name:t,config:n}=e;n.mediaLibrary||V("mediaLibrary");const{assetsApiBaseUrl:o,repository:i,authStrategy:s}=n;return U.request(new URL("tags",o),{headers:{repository:i},body:{name:t},method:"POST",credentials:U.getRequestCredentials(s),okType:yn})}function ha(e){const{selectedMedia:t}=e,n=L(),o=f.useMemo(()=>ca(t),[t]);async function i(a,l){const d=l==="remove",c=t.map(h=>h.id);let u=[];Le(h=>(u=h,h.map(g=>c.includes(g.id)?d?fa(g,a):ma(g,a):g)));try{await pa({tagId:a.id,assetIds:c,operation:d?"remove":"add",config:n});const h=t.length*(d?-1:1);nt(g=>g.map(m=>m.id===a.id?{...m,count:m.count+h}:m))}catch(h){throw Le(()=>u),h}}function s(){const a=o.length;return a>1?`${a} tags in common`:a===1?"1 tag in common":"Common tags"}return A.jsx(Fo,{tags:o,getTagsLabel:s,toggleAssetTag:i})}function pa(e){const{tagId:t,assetIds:n,config:o,operation:i}=e;if(!o.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:s,repository:a,authStrategy:l}=o;return U.request(new URL(`tags/${t}/assets`,s),{headers:{repository:a},body:{assetIds:n},method:i==="add"?"POST":"DELETE",credentials:U.getRequestCredentials(l),okType:p.z.unknown()})}function ma(e,t){return e.tags.some(({id:o})=>o===t.id)?e:{...e,tags:[...e.tags,t]}}function fa(e,t){const n=e.tags.filter(o=>o.id!==t.id);return{...e,tags:n}}function Ca(e){const{selectedMedia:t}=e,n=t.tags,o=L(),{updateMedia:i}=P();async function s(l,d){const c=t.tags,u=d==="remove",h=u?c.filter(g=>g.id!==l.id):[...c,l];i(t.id,{tags:h});try{await xa({mediaId:t.id,config:o,tags:h.map(g=>g.id)}),nt(g=>g.map(m=>m.id===l.id?{...m,count:m.count+(u?-1:1)}:m))}catch(g){throw i(t.id,{tags:c}),g}}function a(){const l=n.length;return l>1?`${l} tags`:l===1?"1 tag":"Tags"}return A.jsx(Fo,{tags:n,getTagsLabel:a,toggleAssetTag:s})}function xa(e){const{mediaId:t,config:n,tags:o}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:i,repository:s,authStrategy:a}=n;return U.request(new URL(`assets/${t}`,i),{headers:{repository:s},body:{tags:o},method:"PATCH",credentials:U.getRequestCredentials(a),okType:Ut})}function ya(){const[e,t]=f.useState("description");if(Ee().length!==1)return A.jsx(Sa,{});const o=e==="description",i=e==="more-info";return A.jsxs(A.Fragment,{children:[A.jsxs(r.Box,{display:"grid",gridTemplateColumns:"1fr 1fr",backgroundColor:"grey2",border:!0,borderStyle:"solid",borderRadius:8,children:[A.jsx(r.Tab,{selected:o,outline:o,transparent:!0,onClick:()=>t("description"),children:"Description"}),A.jsx(r.Tab,{selected:i,outline:i,transparent:!0,onClick:()=>t("more-info"),children:"More info"})]}),A.jsx(Ba,{tab:e})]})}function Ba(e){const{tab:t}=e;switch(t){case"description":return A.jsx(Ia,{});case"more-info":return A.jsx(ja,{})}}function Ia(){const{title:e,alt:t,onBlur:n,isUploading:o,selectedMedia:i}=bo();if(!i)return null;const{extension:s}=i;return A.jsxs(r.Box,{flexDirection:"column",gap:16,children:[A.jsx(r.FormInput,{value:e.value,onValueChange:e.set,label:"Media title",placeholder:"Media title",onBlur:n,disabled:o,suffix:s?`.${s}`:void 0}),A.jsx(r.FormInputField,{label:"Alternative text",children:A.jsx(r.ContentEditable,{content:t.displayValue,contentVersion:t.version,readOnly:o,placeholder:"A short description of the media for accessibility",multiline:!0,decorations:{em:"highlight"},onChange:t.onChange,onBlur:n})}),!o&&A.jsx(Ca,{selectedMedia:i})]})}function ja(){const{credits:e,notes:t,onBlur:n,isUploading:o,selectedMedia:i}=bo();if(!i)return null;const{uploader_id:s}=i,a=Ua(i);return A.jsxs(r.Box,{gap:8,flexDirection:"column",children:[a.map(l=>A.jsxs(r.Box,{gap:8,children:[A.jsxs(r.Text,{color:"grey11",children:[l.label,":"]}),A.jsx(r.Text,{children:l.value})]},l.label)),A.jsxs(r.Box,{gap:8,children:[A.jsx(r.Text,{color:"grey11",children:"Uploaded by:"}),A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(r.Text,{color:"grey11",children:"Error getting uploader"}),children:A.jsx(f.Suspense,{fallback:A.jsx(So,{}),children:A.jsx(Fa,{uploaderId:s})})})]}),A.jsx(r.FormInputField,{label:"Copyright",children:A.jsx(r.ContentEditable,{content:e.displayValue,contentVersion:e.version,readOnly:o,placeholder:"Media copyrights or credits",multiline:!0,decorations:{em:"highlight"},onChange:e.onChange,onBlur:n})}),A.jsx(r.FormInputField,{label:"Private notes",children:A.jsx(r.ContentEditable,{content:t.displayValue,contentVersion:t.version,readOnly:o,placeholder:"Private notes are never shared publicly",multiline:!0,decorations:{em:"highlight"},onChange:t.onChange,onBlur:n})})]})}function Fa(e){const{uploaderId:t}=e,{uploadersById:n}=oo(),o=n.get(t??"ghost");return t&&!o?A.jsx(So,{}):o?A.jsxs(A.Fragment,{children:[A.jsx(r.Avatar,{size:24,firstName:o.firstName,lastName:o.lastName,imageUrl:o.uploadedAvatar,hasBorder:!1}),A.jsx(r.Text,{children:o.name})]}):null}function So(){return A.jsx(r.Skeleton,{width:128})}function Sa(){const e=Ee(),{uploadingFiles:t}=P(),n=f.useMemo(()=>t.some(o=>e.some(i=>o.id===i.id)&&o.status!=="success"),[e,t]);return A.jsx(A.Fragment,{children:!n&&A.jsx(ha,{selectedMedia:e})})}function bo(){const[e]=Ee(),{updateMedia:t,uploadingFiles:n}=P(),o=L(),{showToast:i}=Io(),s=(e==null?void 0:e.id)??"",a=st(e,"alt"),l=st(e,"notes"),d=st(e,"credits"),c=st(e,"filename",ra),u=n.some(g=>g.id===(e==null?void 0:e.id)&&g.status!=="success");async function h(){if(!e||!c.changed&&!a.changed&&!d.changed&&!l.changed)return;const{extension:g,search_highlight:m}=e,C=g?`${c.value}.${g}`:c.value;t(s,{filename:C,alt:a.value,credits:d.value,notes:l.value,search_highlight:{alt:a.changed||m==null?void 0:m.alt,credits:d.changed||m==null?void 0:m.credits,filename:c.changed||m==null?void 0:m.filename,notes:l.changed||m==null?void 0:m.notes}}),await Ka({id:s,config:o,metadata:{filename:C,alt:a.value,credits:d.value,notes:l.value}}),i({title:"Media metadata has been saved.",seconds:3})}return{selectedMedia:e,onBlur:h,isUploading:u,title:c,alt:a,credits:d,notes:l,extension:e==null?void 0:e.extension}}function st(e,t,n=o=>o==null?void 0:o[t]){var c;const o=n(e)??"",[i,s]=f.useState(o);E.useOnChange(e==null?void 0:e.id,()=>s(o));const a=(c=e==null?void 0:e.search_highlight)==null?void 0:c[t],l=!!a;function d(u){const{from:h,to:g}=u.state.selection;u.commands.selectAll(),u.commands.unsetAllMarks(),u.commands.setTextSelection({from:h,to:g}),s(u.getText())}return{value:i,set:s,displayValue:ba(a??i)??"",onChange:d,version:`${(e==null?void 0:e.id)??""}_${l}`,changed:i!==o}}function ba(e){return e==null?void 0:e.replace(/\n/g,"<br>")}function Ka(e){const{id:t,config:n,metadata:o}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:i,repository:s,authStrategy:a}=n;return U.request(new URL(`assets/${t}`,i),{headers:{repository:s},body:{...o},method:"PATCH",credentials:U.getRequestCredentials(a),okType:Ut})}function Ua(e){const{width:t,height:n,last_modified:o,size:i,extension:s}=e,a=t&&n,l={label:"Date",value:cn.prettyPrintDate(new Date(o))},d={label:"File size",value:Ae.formatBytes(i)},c=a?{label:"Dimensions",value:`${t}×${n}`}:void 0,u=a?{label:"Ratio",value:((t??0)/(n??0)).toFixed(1)}:void 0,h=s?{label:"Extension",value:s.toUpperCase()}:void 0;return[l,d,c,u,h].filter(ae.isDefined)}function Ta(){const{setTagManagerOpen:e}=P(),[t,n]=f.useState("");return A.jsxs(r.Box,{gap:20,flexDirection:"column",height:"100%",children:[A.jsxs(r.Box,{alignItems:"center",gap:4,children:[A.jsx(r.IconButton,{icon:"close",size:"small",hasPadding:!1,onClick:()=>e(!1)}),A.jsx(r.Text,{variant:"bold",children:"Tags management"})]}),A.jsxs(r.Box,{gap:16,flexDirection:"column",height:"100%",children:[A.jsx(r.FormSearchInput,{value:t,onValueChange:n,placeholder:"Search for tags",endAdornment:!1,autoFocus:!0}),A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(ka,{}),children:A.jsx(f.Suspense,{fallback:A.jsx(Ra,{}),children:A.jsx(wa,{searchTerm:t})})})]})]})}function wa(e){const{searchTerm:t}=e,{tags:n}=tt(),o=n.filter(i=>i.name.toLowerCase().includes(t.toLowerCase()));return o.length===0?A.jsx(r.Text,{color:"grey9",variant:"small",children:"No tags found"}):A.jsx(r.AnimatedList,{ariaLabel:"Tags list",getItemKey:i=>i.id,gap:16,items:o,children:i=>A.jsx(La,{tag:i})})}function La(e){const{tag:t}=e,[n,o]=f.useState(!1),i=L(),{showAlert:s}=r.useAlert(),{showToast:a}=r.useToast(),{tags:l}=tt();async function d(c){if(!xn.safeParse(c).success){s({title:"Error",subtitle:`Failed to rename tag "${t.name}" to "${c}". Tag name must be at least ${JA} and at maximum ${XA} characters long.`});return}if(l.some(g=>g.name===c)){s({title:"Error",subtitle:`Failed to rename tag "${t.name}" to "${c}". Tag with name "${c}" already exists.`});return}try{await Da({id:t.id,name:c,config:i}),nt(g=>g.map(m=>m.id===t.id?{...m,name:c}:m)),Le(g=>g.map(m=>{if(m.tags.findIndex(y=>y.id===t.id)!==-1){const y=m.tags.map(x=>x.id===t.id?{...x,name:c}:x);return{...m,tags:y}}return m})),a({title:`Tag "${t.name}" renamed to "${c}"`,seconds:3})}catch{s({title:"Error",subtitle:"Something went wrong when renaming the tag."})}}return A.jsxs(A.Fragment,{children:[A.jsxs(r.Box,{justifyContent:"space-between",children:[A.jsx(r.Badge,{title:t.name,color:"purple",size:"medium",onEdit:d}),A.jsx(r.Button,{invisible:!0,color:"tomato",textWeight:"normal",onClick:()=>o(!0),children:"Delete"})]}),A.jsx(va,{open:n,onOpenChange:o,tag:t})]})}function va(e){const{open:t,onOpenChange:n,tag:o}=e,{id:i,name:s,count:a}=o,l=L(),{showAlert:d}=r.useAlert(),[c,u]=f.useState(!1);async function h(){u(!0);try{await Ea({id:i,config:l}),nt(g=>g.filter(m=>m.id!==i)),Le(g=>g.map(m=>{if(m.tags.findIndex(y=>y.id===i)!==-1){const y=m.tags.filter(x=>x.id!==i);return{...m,tags:y}}return m}))}catch{d({title:"Error",subtitle:"Something went wrong when removing the tag."})}finally{u(!1),n(!1)}}return A.jsxs(r.Dialog,{onOpenChange:n,open:t,size:"small",children:[A.jsx(r.DialogHeader,{title:`This tag is being used on ${a} media ${Ae.pluralize(a,"item")}`}),A.jsx(r.DialogDescription,{asChild:!0,children:A.jsx(r.DialogContent,{padding:16,children:A.jsxs(r.Text,{children:["You are about to delete the tag name ",A.jsx("b",{children:s}),"."," ",a>0&&`This tag is being used on ${a} media ${Ae.pluralize(a,"item")} and will be deleted from ${Ae.pluralize(a,"it","them")}.`]})})}),A.jsxs(r.DialogActions,{children:[A.jsx(r.DialogCancelButton,{}),A.jsx(r.DialogActionButton,{onClick:h,color:"tomato",loading:c,children:"Yes, I want to delete"})]})]})}function ka(){const e=f.useContext(R.ErrorBoundaryContext);return A.jsx(r.Box,{flexDirection:"column",children:A.jsxs(r.BlankSlate,{children:[A.jsx(r.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed"}),A.jsx(r.BlankSlateTitle,{size:"big",children:"Oops!"}),A.jsx(r.BlankSlateDescription,{width:360,children:"We couldn't load your media tags."}),A.jsx(r.BlankSlateActions,{children:A.jsx(r.Button,{onClick:e==null?void 0:e.reset,size:"medium",children:"Try again"})})]})})}function Ea(e){const{id:t,config:n}=e;n.mediaLibrary||V("mediaLibrary");const{assetsApiBaseUrl:o,repository:i,authStrategy:s}=n;return U.request(new URL(`tags/${t}`,o),{headers:{repository:i},method:"DELETE",credentials:U.getRequestCredentials(s),okType:p.z.unknown()})}function Da(e){const{id:t,name:n,config:o}=e;o.mediaLibrary||V("mediaLibrary");const{assetsApiBaseUrl:i,repository:s,authStrategy:a}=o;return U.request(new URL(`tags/${t}`,i),{headers:{repository:s},method:"PATCH",credentials:U.getRequestCredentials(a),body:{name:n},okType:p.z.unknown()})}function Ra(){return A.jsx(r.Box,{flexDirection:"column",gap:16,children:O.range(1,6).map(e=>A.jsxs(r.Box,{justifyContent:"space-between",children:[A.jsx(r.Skeleton,{height:24,width:85}),A.jsx(r.Skeleton,{height:24,width:45})]},e))})}function Qa(){const e=Ee(),{onFilesUpload:t,isUploading:n,tagManagerOpen:o}=P();return e.length===0&&o===!1?A.jsx(Co,{onFilesUpload:t,isUploading:n}):A.jsx(r.Box,{flexDirection:"column",backgroundColor:"grey1",width:"100%",padding:16,gap:16,borderRadius:{topLeft:8,topRight:8},children:o?A.jsx(Ta,{}):A.jsxs(A.Fragment,{children:[A.jsx(_s,{}),A.jsx(sa,{}),A.jsx(ya,{})]})})}function Ma(){const e=je();return A.jsx(fo,{hasSelectedMedia:e.selectedCount!==0,children:A.jsx(Qa,{})})}const _t={all:{name:"All media",icon:"public"},image:{name:"Images",icon:"image"},video:{name:"Videos",icon:"videocam"},document:{name:"Documents",icon:"insertDriveFile"},audio:{name:"Audio files",icon:"musicNote"}},qa=Object.entries(_t);function Pa(){const{assetType:e,initialAssetType:t,onFilterChange:n}=P(),[o,i]=f.useState(e);E.useOnChange(e,()=>{i(e)});const[s,a]=f.useState(!1);function l(g){a(!1),i(g),n({assetType:g})}const{icon:d,name:c}=_t[o],u=_t[t].name,h=t!=="all";return A.jsxs(r.DropdownMenu,{open:s,onOpenChange:a,children:[A.jsx(r.DropdownMenuTrigger,{disabled:h,children:A.jsx(Oa,{icon:d,isDropdownDisabled:h,buttonName:c,tooltipAssetTypeName:u})}),A.jsx(r.DropdownMenuContent,{minWidth:256,align:"start",childrenFocusScope:!0,children:A.jsx(A.Fragment,{children:qa.filter(([g])=>g!==o).map(([g,{icon:m,name:C}])=>A.jsx(r.DropdownMenuItem,{startIcon:A.jsx(r.Icon,{name:m}),onSelect:()=>l(g),children:C},g))})})]})}const Oa=f.forwardRef(function(t,n){const{icon:o,isDropdownDisabled:i,buttonName:s,tooltipAssetTypeName:a,...l}=t;return A.jsx(r.Tooltip,{content:`You can only pick ${(a==null?void 0:a.toLocaleLowerCase())??"this type of media"}`,visible:i,children:A.jsx(r.Button,{startIcon:o,endIcon:"arrowDropDown",size:"small",color:"grey",disabled:i,ref:n,...l,children:s})})});function Va(e){const{optimisticTagIds:t,setOptimisticTagIds:n}=e,{onFilterChange:o}=P(),{tags:i}=tt(),s=f.useMemo(()=>Xi.groupBy(i,l=>l.id),[i]);function a(l){const d=t.filter(c=>c!==l.id);n(d),o({tagIds:d})}return A.jsx(A.Fragment,{children:t.map(l=>{var c;const d=(c=s.get(l))==null?void 0:c[0];return d?A.jsx(r.Badge,{title:d.name,size:"medium",color:"purple",onClose:()=>a(d),selected:!0},d.id):null})})}function Ya(){const{setTagManagerOpen:e,tagIds:t,onFilterChange:n}=P(),[o,i]=f.useState(""),[s,a]=f.useState(!1),[l,d]=f.useState(t);E.useOnChange(JSON.stringify(t),()=>{d(t)});function c(g){a(g),g||i("")}function u(g){const m=l.includes(g.id)?t.filter(C=>C!==g.id):[...t,g.id];d(m),n({tagIds:m}),a(!1)}function h(){a(!1),e(!0)}return A.jsxs(A.Fragment,{children:[A.jsxs(r.DropdownMenu,{open:s,onOpenChange:c,children:[A.jsx(r.DropdownMenuTrigger,{children:A.jsx(r.Button,{startIcon:"label",endIcon:"arrowDropDown",size:"small",color:"grey",children:"Tags"})}),A.jsx(r.DropdownMenuContent,{minWidth:256,align:"start",border:!1,childrenFocusScope:!0,children:A.jsxs(r.ComboBox,{variant:"attached",children:[A.jsx(r.ComboBoxInput,{value:o,onValueChange:i,placeholder:"Search for a tag",autoFocus:!0}),A.jsx(r.ComboBoxContent,{paddingBlock:4,children:A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(r.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting tags"}),children:A.jsx(f.Suspense,{fallback:A.jsx(r.Box,{padding:8,flexDirection:"column",gap:8,children:O.range(1,6).map(g=>A.jsx(r.Skeleton,{height:24,width:85},g))}),children:A.jsx(Wa,{searchTerm:o,setSearchTerm:i,onTagToggle:u,optimisticTagIds:l})})})}),A.jsx(r.ComboboxAction,{children:A.jsx(r.Button,{invisible:!0,startIcon:"edit",textWeight:"normal",color:"dark",onClick:h,children:"Manage tags"})})]})})]}),l.length>0&&A.jsx(r.ErrorBoundary,{children:A.jsx(f.Suspense,{children:A.jsx(Va,{optimisticTagIds:l,setOptimisticTagIds:d})})})]})}function Wa(e){const{onTagToggle:t,searchTerm:n,optimisticTagIds:o}=e,{tags:i}=tt(),s=f.useMemo(()=>{const a=n.toLowerCase();return i.filter(l=>l.name.toLowerCase().includes(a))},[i,n]);return A.jsxs(A.Fragment,{children:[!s.length&&A.jsx(r.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"No tags found"}),s.map(a=>{const l=o.includes(a.id);return A.jsx(r.ComboBoxItem,{value:a.id,onCheckedChange:()=>t(a),checked:l,children:A.jsx(r.Badge,{title:a.name,color:"purple",sx:{marginLeft:8,marginBottom:4,marginTop:4},size:"medium"})},a.id)})]})}function Ha(){const{uploaderId:e,onFilterChange:t}=P(),[n,o]=f.useState(""),[i,s]=f.useState(!1),[a,l]=f.useState();E.useOnChange(e,()=>{e||l(void 0)});function d(u){s(u),u||o("")}function c(u){l(u),t({uploaderId:u==null?void 0:u.id}),s(!1)}return A.jsxs(r.DropdownMenu,{open:i,onOpenChange:d,children:[A.jsx(r.DropdownMenuTrigger,{children:A.jsx(r.Button,{startIcon:"people",renderStartIcon:u=>a?A.jsx(r.Avatar,{imageUrl:a==null?void 0:a.uploadedAvatar,firstName:a.firstName,lastName:a.lastName,size:16,hasBorder:!1}):u,endIcon:"arrowDropDown",size:"small",color:"grey",children:(a==null?void 0:a.name)??"All uploaders"})}),A.jsx(r.DropdownMenuContent,{minWidth:256,align:"start",border:!1,childrenFocusScope:!0,children:A.jsxs(r.ComboBox,{variant:"attached",children:[A.jsx(r.ComboBoxInput,{value:n,onValueChange:o,placeholder:"Search for uploaders",autoFocus:!0}),A.jsx(r.ComboBoxContent,{paddingBlock:4,children:A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(r.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting uploaders"}),children:A.jsx(f.Suspense,{fallback:A.jsx(za,{}),children:A.jsx(_a,{searchTerm:n,setSearchTerm:o,onUploaderToggle:c,optimisticUploader:a})})})})]})})]})}function _a(e){const{searchTerm:t,optimisticUploader:n,onUploaderToggle:o}=e,{uploaders:i}=oo(),s=f.useMemo(()=>{const a=t.toLowerCase();return O.sort(i.filter(l=>{var d;return l.name.toLowerCase().includes(a)||((d=l.email)==null?void 0:d.toLowerCase().includes(a))}),l=>(n==null?void 0:n.id)===(l==null?void 0:l.id)?0:1)},[i,n,t]);return s.length?A.jsx(A.Fragment,{children:s.map(a=>{const l=a.id===(n==null?void 0:n.id);return A.jsx(r.ComboBoxItem,{value:a.id,onCheckedChange:()=>l?o():o(a),checked:l,children:A.jsxs(r.Box,{alignItems:"center",padding:{top:8,bottom:8,left:16,right:16},gap:8,children:[A.jsx(r.Avatar,{firstName:a.firstName,lastName:a.lastName,imageUrl:a.uploadedAvatar,hasBorder:!1}),A.jsxs(r.Box,{display:"flex",flexDirection:"column",children:[A.jsx(r.Text,{color:"grey12",variant:"normal",children:a.name}),a.email&&A.jsx(r.Text,{color:"grey10",variant:"small",children:a.email})]})]})},a.id)})}):A.jsx(r.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"No uploaders found"})}function za(){return A.jsx(r.Box,{padding:8,flexDirection:"column",gap:8,children:O.range(1,4).map(e=>A.jsx(r.Skeleton,{height:48,width:"full"},e))})}function Na(){const{media:e,mediaTotal:t}=P(),n=je();return A.jsxs(r.Box,{alignItems:"center",gap:16,children:[n.isSelectAllEnabled&&A.jsx(r.Checkbox,{onCheckedChange:n.toggleSelectAll,checked:n.selectedCount>0,indeterminate:n.selectedCount!==t,onClick:o=>o.stopPropagation(),disabled:e.length===0}),e.length!==0&&A.jsx(xo,{count:t}),A.jsxs(r.Box,{gap:8,alignItems:"center",children:[A.jsx(r.Text,{children:"Filter:"}),A.jsx(Pa,{}),A.jsx(Ha,{}),A.jsx(Ya,{})]})]})}function Ko(e){const{assetType:t,onSelectedChange:n,actionContainer:o}=e;return A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(ho,{}),children:A.jsx(f.Suspense,{fallback:A.jsx(Ps,{actionContainer:o}),children:A.jsx(xA,{children:A.jsx(Ls,{assetType:t,actionContainer:o,onSelectedChange:n,children:A.jsx(Qs,{children:A.jsx(Ga,{})})})})})})}function Ga(){const{media:e}=P(),t=lo();return A.jsx(Ws,{children:A.jsx(po,{sidePane:t?void 0:A.jsx(Ma,{}),mediaActions:A.jsx(Ds,{}),mediaToolbar:A.jsx(Na,{}),mediaList:e.length===0?A.jsx(ks,{}):A.jsx(qs,{})})})}function Za(e){const{href:t,tracking:n}=e;return A.jsx(r.Box,{justifyContent:"center",padding:{block:6},children:A.jsxs(r.Text,{href:t,variant:"smallBold",color:"grey11",onClick:()=>void n.track({event:"shared-onboarding:follow-tutorial",source:n.source}),children:["Or watch our in-depth course",A.jsx(r.Icon,{name:"playCircle",color:"grey11",size:"small",sx:{marginLeft:4}})]})})}function Ja(e){const{step:t,stepIndex:n,isOpen:o,onActionClick:i,onClose:s,contentRef:a}=e,[l,d]=f.useState(!1),[c,u]=f.useState(e.isStepComplete);f.useEffect(()=>{o&&u(e.isStepComplete)},[e.isStepComplete,o]);async function h(){if(o)try{d(!0),await i(c)}finally{d(!1)}}return A.jsxs(r.Dialog,{open:o,onOpenChange:s,size:"small",children:[A.jsx(r.DialogHeader,{title:"Onboarding"}),A.jsxs(r.DialogContent,{children:[A.jsx(r.ScrollArea,{children:A.jsxs(r.Box,{ref:a,as:"article",flexDirection:"column",padding:16,gap:16,children:[A.jsx(r.DialogDescription,{asChild:!0,children:A.jsxs("section",{children:[A.jsxs(r.Text,{sx:{marginBottom:4},color:"purple9",variant:"bold",children:["Step ",n+1]}),A.jsx(r.Text,{variant:"h3",children:t.title}),t.content]})}),t.videoUrl&&A.jsx(r.Video,{src:t.videoUrl,sizing:"contain",borderRadius:4,autoPlay:!0,loop:!0})]})}),A.jsxs(r.DialogActions,{children:[A.jsx(r.DialogCancelButton,{size:"medium",children:"Close"}),!t.defaultCompleted&&A.jsx(r.DialogActionButton,{size:"medium",onClick:h,loading:l,color:c?"darkGrey":"purple",children:c?"Undo step":"Complete step"})]})]})]})}function Xa(e){const{steps:t,completedSteps:n,onToggleStep:o,tracking:i,stepOverrides:s}=e,[a,l]=f.useState(!1),[d,c]=f.useState(t[0]),u=f.useRef(null);if(!d)return null;const h=t.findIndex(({id:x})=>x===d.id);function g(x){return n.includes(x.id)}function m(x){c(x),l(!0),i.track({event:"shared-onboarding:step-opened",stepId:x.id,stepTitle:x.title,source:i.source})}async function C(x=!1){var I;if(d&&(await o(d),!x)){(I=u.current)==null||I.animate([{opacity:0},{opacity:1}],{duration:400});const B=y();B?m(B):l(!1)}}function y(){let x=h+1;for(;x<t.length;){const I=t[x];if(I&&!g(I))return I;x++}}return A.jsxs(A.Fragment,{children:[A.jsx(Ja,{contentRef:u,isOpen:a,step:d,stepIndex:h,isStepComplete:g(d),onClose:()=>l(!1),onActionClick:C}),A.jsxs(r.DropdownMenu,{children:[A.jsx(r.DropdownMenuTrigger,{children:A.jsx(r.Button,{size:"large",color:"grey",sx:{width:"100%"},renderStartIcon:$a,children:n.length>0?"Continue":"Start now"})}),A.jsxs(r.DropdownMenuContent,{side:"right",minWidth:256,collisionPadding:8,children:[A.jsx(r.DropdownMenuLabel,{children:A.jsx(r.Text,{variant:"small",color:"grey11",sx:{marginInline:8},children:"Progress"})}),t.map((x,I)=>{const B=g(x);return A.jsx(r.DropdownMenuItem,{onSelect:(s==null?void 0:s[x.id])??(()=>m(x)),description:x.description,completed:B,endAdornment:A.jsx(r.Icon,{name:"chevronRight",size:"small",color:"grey11"}),children:`${I+1} ${x.title}`},x.id)})]})]})]})}function $a(){return A.jsx(r.Icon,{name:"arrowForward",size:"small",color:"grey11"})}function el(e){const{steps:t,completedSteps:n,tutorialLink:o,tracking:i,onToggleStep:s,onClose:a,stepOverrides:l}=e,d=n.length===t.length;return A.jsx(r.Card,{variant:d?"elevated":"animated-light",paddingBlock:16,onClose:a,children:A.jsxs(r.CardContent,{children:[A.jsxs("div",{children:[A.jsx(r.Text,{variant:"bold",children:`Build your first page in ${t.length.toString()} simple steps`}),A.jsx(r.Text,{color:"grey11",variant:"small",children:"Render a live page with content coming from Prismic."})]}),A.jsx(r.ProgressBar,{value:n.length,max:t.length,displayLabel:!0,getValueLabel:(c,u)=>`${c}/${u}`}),A.jsx(Xa,{steps:t,completedSteps:n,onToggleStep:s,tracking:i,stepOverrides:l}),o&&A.jsx(Za,{href:o,tracking:i})]})})}function tl(e){const{framework:t,projectName:n,starterId:o,repositoryName:i}=e,{frameworkNameLabel:s,createProjectCodeSnippet:a}=nl(e),l=[{id:"createPrismicProject",title:"Create your Prismic project",description:"Create and set up your project",defaultCompleted:!0,content:A.jsx(r.Text,{children:"A Prismic project is a space for managing and organizing the content of your website."})},{id:"chooseLocale",title:"Select your main locale",description:"Choose your first locale",defaultCompleted:!!o,content:A.jsx(r.Text,{children:"Locales allow you to create and manage multilingual versions of your content within a single Prismic project."})},{id:"createProject",title:`Create a ${s}project`,description:"Create and set up your project",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1727768069/DEV_TOOLS/ONBOARDING_GUIDE/Pagebuilder_onboarding_step_3_puh6fx.mp4",content:A.jsxs(A.Fragment,{children:[A.jsx(r.Text,{sx:{marginBottom:16},children:"Now that you have a Prismic project to manage the content of your website, let's create the code project that will be querying your content."}),!!a&&A.jsx(Ot,{code:`${a} ${i??"<my-project>"}`,language:"bash"}),A.jsx(r.Text,{variant:"small",sx:{marginTop:16},children:"(example for Next.js below)"})]})},{id:"setupSliceMachine",title:"Set up & run Slice Machine",description:"Prepare the code to fetch content",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1727768069/DEV_TOOLS/ONBOARDING_GUIDE/page_builder_onboarding_step_4_yl8fb8.mp4",content:A.jsxs(A.Fragment,{children:[A.jsx(r.Text,{sx:{marginBottom:16},children:`Slice Machine is the Prismic tool for creating your content models.
|
|
36
|
-
|
|
37
|
-
npx @slicemachine/init@latest --repository ${i??"<my-project>"}`,language:"bash",title:"Terminal",showLineNumbers:!1})]})},{id:"createPageType",title:"Create a Page Type",description:"Build the structure of your page",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/Create_page_type_xdn13j.mp4",content:A.jsx(r.Text,{children:"A page type is a base content structure editors will use to create pages in the Page Builder (Prismic's content creation UI). A page type can be reusable (e.g., for multiple blog posts) or single (e.g., for a one-time page like the homepage)."})},{id:"codePage",title:"Code Your Page Type",description:"Prepare code to fetch content",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/Step2_code_your_page_jatiur.mp4",content:A.jsx(r.Text,{children:"Prepare your code to query the content from the Prismic API."})},{id:"createSlice",title:"Create a Slice",description:"Build a reusable website section",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918322/DEV_TOOLS/ONBOARDING_GUIDE/Step3_add_slice_qzmvxf.mp4",content:A.jsx(r.Text,{children:"Slices are website sections that can be reused on different pages with different content. Each slice has a code component automatically generated by Slice Machine. Start with a template and look at your code to see how it's structured."})},{id:"reviewAndPush",title:"Review and Push changes",description:"Enable editors to create content",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/DevTools_Squad_push_changes_ovvmul.mp4",content:A.jsx(r.Text,{children:"Your page types and slices currently exist only in your local project. Push them to your repository to make them available for your content editors."})},{id:"createContent",title:"Create Content",description:"Publish a page to the Prismic API",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1732631905/DEV_TOOLS/ONBOARDING_GUIDE/step_9_create_content_y8m3m0.mp4",content:A.jsx(r.Text,{children:"In Prismic, content creation takes place in the Prismic Page Builder UI. Open the Page Builder and start creating your first page."})},{id:"renderPage",title:"Render Your Page",description:"View your page in the browser",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918321/DEV_TOOLS/ONBOARDING_GUIDE/Step_6_Render_Page_tnauh9.mp4",content:A.jsxs(r.Text,{children:["Now that your content is published, you can run your project in your terminal and visit the page on your local server (e.g.,"," ",A.jsx(r.Text,{component:"code",children:"localhost:3000/example-page"}),"). Your content should now be visible!"]})}],d={next:"https://prismic.dev/course/next",nuxt:"https://prismic.dev/course/nuxt",sveltekit:"https://prismic.dev/course/sveltekit"};return{steps:l,defaultCompletedStepIds:l.flatMap(c=>c.defaultCompleted?[c.id]:[]),tutorialLink:t?d[t]:void 0}}function nl(e){const{framework:t}=e;if(!t||t==="other")return{frameworkNameLabel:"",createProjectCodeSnippet:""};const n=uA[t];return{frameworkNameLabel:n?`${n} `:"",createProjectCodeSnippet:gA[t]}}const Rt=3e3,On=400;function Al(e){const{onboardingState:t,tracking:n,onToggleStep:o,onToggleGuide:i,fallback:s=null,stepOverrides:a,repositoryName:l,projectName:d}=e,{context:c,isDismissed:u}=t,{steps:h,defaultCompletedStepIds:g,tutorialLink:m}=tl({...c,repositoryName:l,projectName:d}),C=B(t.completedSteps),y=ol(x,On);if(E.useOnChange(u,()=>!u&&y.reset()),c.framework==="other")return A.jsx(A.Fragment,{children:s});function x(){i()}async function I(j){const S=await o(j.id);S.includes(j.id)&&n.track({event:"shared-onboarding:step-completed",stepId:j.id,stepTitle:j.title,source:n.source}),B(S).length===h.length&&(n.track({event:"shared-onboarding:completed",source:n.source}),y.start())}function B(j){const S=h.map(({id:b})=>b);return Array.from(new Set([...j.filter(b=>S.includes(b)),...g]))}return u?null:A.jsx(r.AnimatedElement,{enterDuration:0,exitDuration:On,children:y.status!=="hidden"&&A.jsxs("div",{ref:y.refs.container,style:{position:"relative"},children:[A.jsx(el,{steps:h,completedSteps:C,tutorialLink:m,tracking:n,onToggleStep:I,onClose:y.status!=="animating"?x:void 0,stepOverrides:a}),A.jsx("div",{ref:y.refs.cannon,style:{position:"absolute",bottom:0,left:0}})]})})}function ol(e,t=400){const n=fr.useConfetti({config:{duration:Rt}}),[o,i]=f.useState("visible"),s=f.useRef(!1),a=f.useCallback(()=>{i("animating"),setTimeout(()=>i("hidden"),Rt-t),s.current||(setTimeout(e,Rt),s.current=!0)},[e,t]),l=()=>{n.throwConfetti(),a()},d=f.useCallback(()=>{i("visible"),s.current=!1},[]);return{refs:{container:n.confettiContainerRef,cannon:n.confettiCannonRef},status:o,start:l,reset:d}}function Uo(e){const{type:t,value:n}=e,o=t===le?He.max:_e.max;return A.jsx(r.Box,{alignItems:"center",children:A.jsx(r.Tooltip,{title:il[t],content:al[t],stableMount:!0,children:A.jsx(r.Badge,{title:`${n.length} characters`,size:"medium",color:n.length>o?"tomato":"green",sx:{alignSelf:"center"}})})})}const il={[le]:"Meta title length",[ue]:"Meta description length"},rl=`${He.min}-${He.max}`,sl=`${_e.min}-${_e.max}`,al={[le]:`For optimal mobile SEO, keep your meta title within ${rl} characters to prevent it from being cut off in search results.`,[ue]:`To ensure your meta description isn’t truncated in mobile search results, aim for ${sl} characters. This helps improve visibility and click-through rates.`};function To(e){const{title:t,description:n}=e;return A.jsx(r.Card,{paddingBlock:8,paddingInline:8,variant:"highlighted",children:A.jsxs(r.CardContent,{gap:4,children:[A.jsx(r.Text,{color:"indigo11",variant:"h4",noSelect:!0,children:Ae.overflow(t,He.max)}),A.jsx(r.Text,{color:"green11",noSelect:!0,children:"https://www.yourdomain.com/"}),A.jsx(r.Text,{variant:"small",color:"grey11",noSelect:!0,children:Ae.overflow(n,_e.max)})]})})}const wo=f.createContext({editedUID:{current:!1},onEditUID:()=>{}});function Lo(e){return Object.values(e.json).some(t=>{var n;return((n=t.uid)==null?void 0:n.type)==="UID"})}function ll(e){const{content:t,customType:n}=e;return Lo(n)&&!t.uid}function vo(e){const{documentId:t,documentsWithUid:n,uid:o}=e;return n.filter(i=>t!==i.id&&dl({document:i,uid:o})&&cl({...e,document:i}))}function cl(e){const{customTypeId:t,languageId:n,document:o}=e,i=t===o.custom_type_id,s=n===o.language.id;return i&&s}function dl(e){const{document:t,uid:n}=e,o=t.versions.filter(i=>i.uid===n);return o.length===0?!0:o.some(i=>i.status!=="archived")}const Be=f.createContext(void 0);function ul(e){const{customTypeFormat:t,children:n}=e,o=f.useMemo(()=>({customTypeFormat:t,isInSlice:!1,isInGroup:!1,isInRepeatable:!1}),[t]);return A.jsx(Be.Provider,{value:o,children:n})}function gl(e){const{children:t}=e,n=f.useContext(Be),o=f.useMemo(()=>n&&{...n,isInSlice:!0},[n]);return A.jsx(Be.Provider,{value:o,children:t})}function hl(e){const{children:t}=e,n=f.useContext(Be),o=f.useMemo(()=>n&&{...n,isInGroup:!0},[n]);return A.jsx(Be.Provider,{value:o,children:t})}function pl(e){const{children:t}=e,n=f.useContext(Be),o=f.useMemo(()=>n&&{...n,isInRepeatable:!0},[n]);return A.jsx(Be.Provider,{value:o,children:t})}function ml(){return f.useContext(Be)}function Tt(e,t){return`${e}___${t}`}const ko=f.createContext({ids:[],isSelected:()=>!1,update:()=>{}});function wt(){return f.useContext(ko)}function Z(e){var t;return(t=e.config)!=null&&t.label?e.config.label:e.type!=="Boolean"&&e.type!=="Separator"&&e.type!=="Table"&&e.fieldset?e.fieldset:e.type}const In="...";function fl(e,t,n=In){var o,i;return(t?(o=e.config)==null?void 0:o.placeholder_true:(i=e.config)==null?void 0:i.placeholder_false)||n}function De(e,t=In){var n;return((n=e.config)==null?void 0:n.placeholder)||t}function Cl(e){var l;const{content:t,field:n,id:o,readOnly:i,onContentChange:s}=e,a=(t==null?void 0:t.value)??((l=n.config)==null?void 0:l.default_value)??!1;return A.jsxs(r.Field,{children:[A.jsx(r.FieldIcon,{name:"biToggle"}),A.jsx(r.FieldLabel,{htmlFor:o,children:Z(n)}),A.jsxs(r.FieldControl,{children:[A.jsx(r.Box,{padding:4,alignItems:"center",children:A.jsx(r.Text,{children:fl(n,a)})}),A.jsx(r.Switch,{id:o,sx:{alignSelf:"center",marginLeft:"auto",marginRight:12},checked:a,onCheckedChange:d=>{i||s(xl(d))}})]})]})}function xl(e){return{__TYPE__:"BooleanContent",value:e}}function yl(e){const{id:t,field:n,content:o,onContentChange:i}=e;return A.jsxs(r.Field,{children:[A.jsx(r.FieldIcon,{name:"colorLens"}),A.jsx(r.FieldLabel,{id:t,children:Z(n)}),A.jsx(r.FieldControl,{children:A.jsx(r.Box,{padding:{left:4},alignItems:"center",children:A.jsx(r.ColorInput,{onValueChange:s=>i(Bl(s)),value:o==null?void 0:o.value,"aria-labelledby":t,placeholder:De(n)})})})]})}function Bl(e){return e===void 0?void 0:{__TYPE__:"FieldContent",type:"Color",value:e}}function Il(e){const{id:t,readOnly:n,field:o,content:i,onContentChange:s}=e,a=i!=null&&i.value?cn.dateFromISOString(i.value):void 0;return A.jsxs(r.Field,{children:[A.jsx(r.FieldIcon,{name:"dateRange"}),A.jsx(r.FieldLabel,{id:t,children:Z(o)}),A.jsx(r.FieldControl,{children:A.jsx(r.Box,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:A.jsx(r.DateInput,{mode:"date","aria-labelledby":t,disabled:n,value:a,onValueChange:l=>s(jl(l))})})})]})}function jl(e){if(e)return{__TYPE__:"FieldContent",type:"Date",value:Fl(e)}}function Fl(e){const t=`${e.getFullYear()}`.padStart(4,"0"),n=`${e.getMonth()+1}`.padStart(2,"0"),o=`${e.getDate()}`.padStart(2,"0");return`${t}-${n}-${o}`}const Fe=f.forwardRef(function(t,n){const{padding:o=Eo,...i}=t;return A.jsx(r.TextInput,{...i,padding:o,ref:n,sx:{...t.sx,alignSelf:"stretch"}})}),Eo={input:{inline:4},adornment:{inline:12}},Sl=({provider:e})=>bl[e.toLowerCase()]??A.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("g",{clipPath:"url(#clip0_6524_22412)",children:A.jsx("path",{d:"M7.99992 1.33333C4.31992 1.33333 1.33325 4.32 1.33325 8C1.33325 11.68 4.31992 14.6667 7.99992 14.6667C11.6799 14.6667 14.6666 11.68 14.6666 8C14.6666 4.32 11.6799 1.33333 7.99992 1.33333ZM2.66659 8C2.66659 7.59333 2.71992 7.19333 2.80659 6.81333L5.99325 10V10.6667C5.99325 11.4 6.59325 12 7.32658 12V13.2867C4.70658 12.9533 2.66659 10.7133 2.66659 8ZM11.9266 11.6C11.7533 11.06 11.2599 10.6667 10.6599 10.6667H9.99325V8.66667C9.99325 8.3 9.69325 8 9.32658 8H5.32658V6.66667H6.65992C7.02658 6.66667 7.32658 6.36667 7.32658 6V4.66667H8.65992C9.39325 4.66667 9.99325 4.06667 9.99325 3.33333V3.06C11.9466 3.84667 13.3333 5.76667 13.3333 8C13.3333 9.38667 12.7933 10.6533 11.9266 11.6Z",fill:"#6F6E77"})}),A.jsx("defs",{children:A.jsx("clipPath",{id:"clip0_6524_22412",children:A.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),bl={codepen:A.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("g",{clipPath:"url(#clip0_6523_22409)",children:A.jsx("path",{d:"M15.9879 5.44292C15.9843 5.42352 15.981 5.40413 15.9759 5.38517C15.9726 5.37375 15.9688 5.36298 15.9651 5.35177C15.9597 5.33497 15.9541 5.31816 15.9474 5.30179C15.9427 5.29037 15.9373 5.27938 15.9321 5.26839C15.9248 5.25288 15.9173 5.23758 15.9086 5.22271C15.9026 5.21172 15.8957 5.20138 15.889 5.19082C15.8798 5.1766 15.8703 5.1626 15.8599 5.14902C15.8524 5.13889 15.8446 5.1292 15.8365 5.1195C15.8257 5.10657 15.8141 5.09429 15.8024 5.08223C15.7934 5.07318 15.7843 5.06413 15.7748 5.05529C15.7623 5.04387 15.7494 5.0331 15.7358 5.02276C15.7255 5.01479 15.7154 5.0066 15.7046 4.99927C15.7007 4.99647 15.6973 4.99324 15.6932 4.99065L8.38116 0.115543C8.15039 -0.0385144 7.84939 -0.0385144 7.61863 0.115543L0.306176 4.99044C0.302082 4.99302 0.29885 4.99626 0.294756 4.99906C0.283983 5.0066 0.273856 5.01457 0.263514 5.02254C0.250155 5.0331 0.237011 5.04387 0.224515 5.05486C0.215034 5.06348 0.205985 5.07253 0.19715 5.0818C0.185084 5.09386 0.17388 5.10614 0.162892 5.11907C0.154704 5.12877 0.146947 5.13846 0.139406 5.14924C0.129064 5.16281 0.119583 5.1766 0.110318 5.19104C0.103639 5.20159 0.0969593 5.21194 0.0907108 5.22293C0.0820922 5.23779 0.0745509 5.25309 0.0674405 5.26817C0.0622694 5.27916 0.0566673 5.29037 0.0521425 5.30157C0.0454631 5.31795 0.0396456 5.33475 0.0342589 5.35156C0.030596 5.36276 0.0267177 5.37375 0.0237011 5.38388C0.0187455 5.40284 0.0150825 5.42201 0.0116351 5.44162C0.00969592 5.45153 0.00732581 5.46123 0.00603302 5.47136C0.00215465 5.50109 0 5.53082 0 5.56121V10.4372C0 10.4673 0.00215465 10.4975 0.00646395 10.527C0.00797221 10.5378 0.0107733 10.5464 0.0129279 10.5568C0.0163753 10.5762 0.0193919 10.5955 0.0258558 10.6149C0.0288723 10.6257 0.0323198 10.6365 0.0366291 10.6483C0.0420157 10.6656 0.0474023 10.6828 0.0538662 10.6985C0.058391 10.7093 0.0646395 10.7201 0.0689488 10.7309C0.0760591 10.7459 0.0840314 10.761 0.09265 10.7768C0.098683 10.7875 0.105578 10.7983 0.112042 10.8082C0.121307 10.8233 0.131434 10.8362 0.142207 10.8491C0.149748 10.8599 0.157289 10.8685 0.165908 10.8789C0.176897 10.8918 0.187455 10.9047 0.200382 10.9162C0.209217 10.9248 0.21762 10.9355 0.228393 10.942C0.24089 10.9528 0.254249 10.9636 0.267177 10.9748C0.277519 10.9834 0.288723 10.9898 0.297342 10.9982C0.301436 11.0004 0.303806 11.0047 0.308115 11.0067L7.61863 15.8841C7.73412 15.9617 7.86641 16.0005 8 15.9998C8.13359 15.9992 8.26588 15.9611 8.38137 15.8841L15.6938 11.0092C15.6979 11.0067 15.7014 11.0036 15.7052 11.0008C15.716 10.9933 15.7261 10.9853 15.7365 10.9773C15.7498 10.9668 15.763 10.9558 15.7755 10.9446C15.785 10.9362 15.794 10.9269 15.8031 10.9179C15.8149 10.9058 15.8263 10.8935 15.8371 10.8806C15.8453 10.8709 15.8531 10.8612 15.8606 10.8509C15.8709 10.8373 15.8804 10.8233 15.8897 10.8091C15.8964 10.7987 15.903 10.7882 15.9093 10.7776C15.9179 10.7625 15.9254 10.7472 15.9328 10.7317C15.9379 10.7207 15.9433 10.7097 15.9481 10.6985C15.9548 10.6819 15.9604 10.6651 15.9657 10.6483C15.9694 10.6371 15.9733 10.6261 15.9765 10.6149C15.9815 10.596 15.9849 10.5766 15.9886 10.5572C15.9903 10.5473 15.9929 10.5376 15.994 10.5275C15.9978 10.4977 16 10.468 16 10.4376V5.5625C16 5.53212 15.9976 5.50238 15.994 5.47265C15.9922 5.46209 15.989 5.45347 15.9869 5.44292H15.9879ZM7.99978 9.62638L5.56826 8.00005L7.99978 6.37351L10.4315 8.00005L7.99978 9.62638ZM7.31245 5.17919L4.33171 7.17288L1.92561 5.56336L7.31245 1.97221V5.17919ZM3.09515 7.99984L1.37531 9.15021V6.84947L3.09515 7.99984ZM4.33171 8.82765L7.31245 10.8211V14.0281L1.92561 10.4365L4.33171 8.82722V8.82765ZM8.68733 10.8207L11.6681 8.82722L14.0744 10.4365L8.68733 14.0277V10.8207ZM12.9046 8.00027L14.6247 6.84969V9.15064L12.9046 7.99984V8.00027ZM11.6681 7.17288L8.68733 5.1794V1.97221L14.0744 5.56336L11.6681 7.17288Z",fill:"black"})}),A.jsx("defs",{children:A.jsx("clipPath",{id:"clip0_6523_22409",children:A.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),codesandbox:A.jsxs("svg",{width:"14",height:"16",viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("g",{clipPath:"url(#clip0_6523_22406)",children:A.jsx("path",{d:"M6.24312 14.1129V8.35021L1.28724 5.49888V8.78388L3.55732 10.0999V12.5702L6.24312 14.1129ZM7.53036 14.1468L10.2658 12.571V10.0422L12.5506 8.71812V5.47426L7.53036 8.3727V14.1468ZM11.8904 4.36906L9.25164 2.83995L6.93472 4.18436L4.60022 2.8386L1.93795 4.38817L6.90626 7.24665L11.8904 4.36906ZM0 12.0115V4.02675L6.91821 0L13.8378 4.00984V11.9988L6.91805 15.985L0 12.0115Z",fill:"black"})}),A.jsx("defs",{children:A.jsx("clipPath",{id:"clip0_6523_22406",children:A.jsx("rect",{width:"13.8378",height:"16",fill:"white"})})})]}),dailymotion:A.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsxs("g",{clipPath:"url(#clip0_6523_22345)",children:[A.jsx("path",{d:"M16 0H0V16H16V0Z",fill:"white"}),A.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.73038 10.3003C8.40789 10.6268 8.00377 10.7901 7.51804 10.7901C7.04025 10.7901 6.64411 10.6308 6.32956 10.3122C6.01503 9.99367 5.85776 9.58351 5.85776 9.08176C5.85776 8.60389 6.01901 8.20766 6.3415 7.89306C6.66401 7.57847 7.06016 7.42118 7.52998 7.42118C7.84849 7.42118 8.13715 7.49484 8.39594 7.64219C8.65474 7.78953 8.8558 7.99063 8.99913 8.2455C9.14246 8.50034 9.21412 8.77908 9.21412 9.08176C9.21412 9.56757 9.05287 9.97376 8.73038 10.3003ZM9.10662 3.58632V6.35792C8.82791 6.07918 8.53131 5.87808 8.21678 5.75463C7.90223 5.63118 7.54988 5.56946 7.1597 5.56946C6.53062 5.56946 5.96527 5.72476 5.4636 6.03538C4.96193 6.34597 4.57176 6.77007 4.29305 7.30768C4.01435 7.84528 3.875 8.44062 3.875 9.09369C3.875 9.76269 4.01236 10.366 4.28708 10.9036C4.5618 11.4412 4.95197 11.8653 5.45763 12.1759C5.96328 12.4865 6.54258 12.6418 7.19553 12.6418C8.14312 12.6418 8.80403 12.3312 9.17831 11.71H9.20218V12.5595H11.0894V3.15625L9.10662 3.58632Z",fill:"#232323"})]}),A.jsx("defs",{children:A.jsx("clipPath",{id:"clip0_6523_22345",children:A.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),flickr:A.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("rect",{width:"16",height:"16",fill:"white"}),A.jsxs("g",{clipPath:"url(#clip0_6523_22379)",children:[A.jsx("path",{d:"M8.43286 7.78387C8.43286 9.321 9.67925 10.5674 11.2166 10.5674C12.7538 10.5674 13.9999 9.321 13.9999 7.78387C13.9999 6.24675 12.7538 5.00061 11.2166 5.00061C9.67925 5.00061 8.43286 6.24675 8.43286 7.78387Z",fill:"#FF0084"}),A.jsx("path",{d:"M2 7.78408C2 9.32121 3.24614 10.5676 4.78352 10.5676C6.32089 10.5676 7.56703 9.32121 7.56703 7.78408C7.56703 6.24695 6.32089 5.00081 4.78352 5.00081C3.24614 5.00081 2 6.24695 2 7.78408Z",fill:"#0063DC"})]}),A.jsx("defs",{children:A.jsx("clipPath",{id:"clip0_6523_22379",children:A.jsx("rect",{width:"12",height:"5.568",fill:"white",transform:"translate(2 5)"})})})]}),giphy:A.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("rect",{width:"16",height:"16",fill:"#121212"}),A.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 3.38889V12.2778H5.11111V3.38889H4Z",fill:"#00FF99"}),A.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6663 5.61111V12.2778H11.7774V5.61111H10.6663Z",fill:"#9933FF"}),A.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.75 3H4V4.11111H8.83333V3H7.75Z",fill:"#FFF35C"}),A.jsx("path",{d:"M9.00041 4.11111H7.33374H8.83374V3.77778L9.00041 4.11111Z",fill:"#999999"}),A.jsx("path",{d:"M8.83374 4.11111H7.33374L8.44485 3L8.83374 3.77778V4.11111Z",fill:"#999237"}),A.jsx("path",{d:"M10.6663 7.44444V5.77778L11.7774 6.33333L10.6663 7.44444Z",fill:"#5C1F99"}),A.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6667 11.8889H4V13H11.7778V11.8889H10.6667Z",fill:"#00CCFF"}),A.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6668 5.22222V4.11111H9.55569V3H8.44458V3.90739V5.0185V6.33333H9.55569H10.6668H11.7779V5.22222H10.6668Z",fill:"#FF6666"})]}),instagram:A.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[A.jsxs("g",{clipPath:"url(#clip0_6523_22356)",children:[A.jsx("mask",{id:"mask0_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"16",height:"16",children:A.jsx("path",{d:"M4.70325 0.0949238C3.85627 0.1349 3.27778 0.270564 2.77227 0.468642C2.24897 0.672648 1.80537 0.946046 1.36408 1.38914C0.922279 1.83249 0.650958 2.27688 0.448504 2.8007C0.252489 3.3075 0.119662 3.88627 0.0822604 4.73377C0.045126 5.58283 0.0366102 5.85363 0.0407495 8.01522C0.0448729 10.1765 0.0544124 10.4479 0.0949012 11.2972C0.135388 12.1439 0.270546 12.7222 0.468623 13.2279C0.672886 13.7512 0.946004 14.1946 1.38935 14.6361C1.83245 15.0777 2.27708 15.3487 2.80115 15.5515C3.30744 15.7472 3.88644 15.8806 4.73369 15.9177C5.58273 15.9551 5.85379 15.9634 8.01483 15.9592C10.1769 15.9551 10.448 15.9456 11.297 15.9053C12.144 15.8648 12.722 15.7292 13.228 15.5316C13.7513 15.3268 14.1949 15.0542 14.6362 14.6109C15.0775 14.1678 15.3488 13.7231 15.5512 13.199C15.7473 12.6927 15.8806 12.1137 15.9175 11.267C15.9546 10.4174 15.9634 10.1461 15.9593 7.98478C15.9551 5.8232 15.9453 5.55239 15.9051 4.7036C15.8649 3.85609 15.7292 3.27811 15.5314 2.77208C15.3269 2.24877 15.054 1.80567 14.6109 1.36387C14.1678 0.922574 13.7232 0.650729 13.1991 0.448785C12.6926 0.252768 12.1138 0.119166 11.2666 0.0825425C10.4175 0.0448876 10.1465 0.0366393 7.98465 0.0407642C5.82336 0.0448892 5.5523 0.0541772 4.70325 0.0949238ZM4.79611 14.485C4.02004 14.4512 3.59863 14.3222 3.31776 14.2142C2.94585 14.0703 2.68046 13.8977 2.40114 13.6205C2.12234 13.3422 1.94928 13.0776 1.80408 12.7064C1.69497 12.4255 1.5637 12.0046 1.52734 11.2286C1.48788 10.3896 1.47886 10.1378 1.47498 8.01237C1.47086 5.88742 1.47859 5.63569 1.51522 4.79593C1.54848 4.02038 1.67822 3.59843 1.78602 3.31782C1.92993 2.94539 2.10196 2.68051 2.37973 2.4012C2.65801 2.12187 2.92263 1.94933 3.29402 1.80412C3.57463 1.69451 3.99555 1.56426 4.77134 1.52738C5.61084 1.48766 5.8623 1.47915 7.98723 1.47502C10.1127 1.47089 10.3644 1.47838 11.2042 1.51526C11.9797 1.54904 12.4016 1.67749 12.682 1.78607C13.0541 1.92998 13.3195 2.1015 13.5986 2.37979C13.8777 2.65808 14.0507 2.92218 14.1959 3.29435C14.3055 3.57418 14.4358 3.99562 14.4724 4.77117C14.5124 5.61068 14.5214 5.8624 14.5253 7.98736C14.5294 10.1128 14.5217 10.3646 14.4848 11.2038C14.451 11.9799 14.3223 12.4016 14.214 12.6827C14.0701 13.0543 13.898 13.3197 13.62 13.5991C13.342 13.8773 13.0774 14.0509 12.7057 14.1961C12.4256 14.3055 12.0042 14.436 11.2289 14.4729C10.3894 14.5123 10.1379 14.5214 8.01225 14.5252C5.88732 14.5294 5.63586 14.5214 4.79611 14.485ZM11.2854 3.74493C11.2864 4.27211 11.7151 4.69896 12.2422 4.69792C12.7697 4.69689 13.1965 4.2685 13.1957 3.74132C13.1947 3.21414 12.7661 2.78704 12.2386 2.78807C11.7112 2.7891 11.2844 3.21775 11.2854 3.74493ZM3.91277 8.00773C3.91714 10.2653 5.75063 12.0913 8.0076 12.0869C10.2648 12.0825 12.0919 10.2495 12.0875 7.99201C12.0831 5.73526 10.2494 3.90819 7.99188 3.91257C5.73489 3.91696 3.90837 5.75073 3.91277 8.00773ZM5.34648 8.0049C5.3439 6.53969 6.52978 5.34942 7.99471 5.34683C9.45991 5.344 10.6504 6.52937 10.6533 7.99484C10.6561 9.46031 9.47022 10.6503 8.00477 10.6532C6.53984 10.656 5.34932 9.47037 5.34648 8.0049Z",fill:"white"})}),A.jsxs("g",{mask:"url(#mask0_6523_22356)",children:[A.jsx("mask",{id:"mask1_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:A.jsx("path",{d:"M16.5905 -0.583628H-0.603516V16.6106H16.5905V-0.583628Z",fill:"white"})}),A.jsxs("g",{mask:"url(#mask1_6523_22356)",children:[A.jsx("mask",{id:"mask2_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:A.jsx("path",{d:"M16.6701 -0.663237H-0.683105V16.6902H16.6701V-0.663237Z",fill:"white"})}),A.jsxs("g",{mask:"url(#mask2_6523_22356)",children:[A.jsx("mask",{id:"mask3_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:A.jsx("path",{d:"M16.6701 -0.663237H-0.683105V16.6902H16.6701V-0.663237Z",fill:"white"})}),A.jsx("g",{mask:"url(#mask3_6523_22356)",children:A.jsx("rect",{x:"-0.688721",y:"-0.665792",width:"17.3622",height:"17.3622",fill:"url(#pattern0)"})})]})]})]})]}),A.jsxs("defs",{children:[A.jsx("pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:A.jsx("use",{xlinkHref:"#image0_6523_22356",transform:"scale(0.000439947)"})}),A.jsx("clipPath",{id:"clip0_6523_22356",children:A.jsx("rect",{width:"16",height:"16",fill:"white"})}),A.jsx("image",{id:"image0_6523_22356",width:"2273",height:"2275",xlinkHref:"data:image/jpeg;base64,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Hbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfw5h277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3XY/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26j+GHbqP4Yduo38MO3Ub+GHbqP4Yduo/hh26j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmNh25jYduY2HbmNh25jYduY2HbmNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh0+Nh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jhz+j7fweHn/AFd+fp9v6v8Ape79DDf1JLc930/LnmGfj9H0+v7/APAf6c32/wAQ/wCR+n/5f9383/iNaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca0415xrzjXnGvONeca8415xrzjXnGvONeca8415xrzjXnGvONeca8415xrzjXnGvONeYa8w15hrzDXmGvMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMNeYa8w15hrzDXnGvONeca8415xrzjXnGvONeca041pxrTjWnGtONaca041pxrTjWnGtONacas41ZxqzjVnGrONWcas41ZxqzjVnGrONScak41JxqTjUUGooNRQaig1FBqKDTUGmoNNQaag01BpqDTUGmoNNQaag0lBpKDSUGkoNJQaSg0lBpKDSUGioNFQaKg0VBoqDRVGiqNFUaKo0FRoKjQVGgqNBUaCo0FRoKjQVGgqPXqj16o9eqPXqj16o9eqPXqj16o9eqPXqj1yo9cqPXKj1yo9cqPXLD1yw9csPXLD1yw9csPWrD1qw9asPWrD1qw9asPWrD1qw9asPWrD1qw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1aw9WsPVrD1aw9WsPVrD1aw9WsPVrD1aw9WsPVrB34/8Ay/z/AH/53yHY/wDU/E/0v+P7/wCz/9k="})]})]}),pinterest:A.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsxs("g",{clipPath:"url(#clip0_6570_25513)",children:[A.jsx("rect",{width:"15.996",height:"16",rx:"2",fill:"#CC2127"}),A.jsx("path",{d:"M7.999 2C4.68555 2 2 4.68555 2 7.999C2 10.5406 3.58174 12.7102 5.81336 13.5861C5.76137 13.1121 5.71338 12.3843 5.83336 11.8644C5.94134 11.3964 6.53724 8.88285 6.53724 8.88285C6.53724 8.88285 6.35727 8.52291 6.35727 7.993C6.35727 7.15914 6.84119 6.53524 7.44309 6.53524C7.95501 6.53524 8.20297 6.91918 8.20297 7.3811C8.20297 7.89502 7.87502 8.66489 7.70705 9.37877C7.56507 9.97667 8.007 10.4626 8.5949 10.4626C9.66072 10.4626 10.4806 9.33878 10.4806 7.71505C10.4806 6.27929 9.44876 5.27345 7.975 5.27345C6.26729 5.27345 5.26546 6.55324 5.26546 7.87702C5.26546 8.39293 5.46342 8.94484 5.71138 9.24679C5.75937 9.30678 5.76737 9.35877 5.75337 9.41876C5.70738 9.60873 5.6074 10.0167 5.5874 10.0987C5.56141 10.2086 5.50142 10.2326 5.38743 10.1786C4.63756 9.83069 4.16964 8.73488 4.16964 7.85502C4.16964 5.96334 5.54541 4.22563 8.13298 4.22563C10.2146 4.22563 11.8304 5.70938 11.8304 7.69105C11.8304 9.75871 10.5266 11.4224 8.71688 11.4224C8.10898 11.4224 7.53708 11.1065 7.34111 10.7345C7.34111 10.7345 7.04116 11.8804 6.96717 12.1603C6.83119 12.6822 6.46526 13.3341 6.2213 13.732C6.7832 13.906 7.3791 14 7.997 14C11.3104 14 13.996 11.3144 13.996 8.001C13.998 4.68555 11.3124 2 7.999 2Z",fill:"white"})]}),A.jsx("defs",{children:A.jsx("clipPath",{id:"clip0_6570_25513",children:A.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),spotify:A.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("g",{clipPath:"url(#clip0_6523_22402)",children:A.jsx("path",{d:"M12.6609 7.10585C10.121 5.59751 5.93158 5.45882 3.50697 6.1947C3.11759 6.31287 2.70584 6.09298 2.5879 5.70373C2.46988 5.31411 2.68945 4.90265 3.07911 4.78429C5.86241 3.93945 10.4892 4.1026 13.4132 5.83828C13.7634 6.04622 13.8782 6.49851 13.6707 6.84813C13.4629 7.19833 13.0103 7.31376 12.6609 7.10585ZM12.5777 9.33993C12.3995 9.62908 12.0215 9.71979 11.7327 9.54223C9.61522 8.24063 6.38637 7.86357 3.88123 8.624C3.55636 8.72218 3.21323 8.53899 3.11455 8.21475C3.01666 7.88989 3.19992 7.54738 3.5242 7.44859C6.38597 6.58018 9.9436 7.00081 12.3756 8.49536C12.6644 8.67322 12.7553 9.05146 12.5777 9.33993ZM11.6136 11.4855C11.472 11.7177 11.1697 11.7904 10.9383 11.6489C9.08801 10.518 6.75909 10.2627 4.01637 10.8891C3.75207 10.9497 3.48866 10.7841 3.42838 10.5198C3.36785 10.2556 3.53284 9.99217 3.79772 9.93186C6.79916 9.2457 9.37381 9.54101 11.4506 10.8101C11.6822 10.9515 11.7551 11.254 11.6136 11.4855ZM8.00002 0.120623C3.64839 0.120623 0.120605 3.64834 0.120605 7.99989C0.120605 12.352 3.64839 15.8794 8.00002 15.8794C12.3517 15.8794 15.8794 12.352 15.8794 7.99989C15.8794 3.64834 12.3517 0.120623 8.00002 0.120623Z",fill:"#1ED760"})}),A.jsx("defs",{children:A.jsx("clipPath",{id:"clip0_6523_22402",children:A.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),twitter:A.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:A.jsx("path",{d:"M14.3193 4.31285C14.329 4.45301 14.329 4.59317 14.329 4.73462C14.329 9.04475 11.0516 14.0156 5.05865 14.0156V14.0131C3.28832 14.0156 1.55478 13.508 0.0644531 12.5507C0.321873 12.5817 0.580582 12.5972 0.839937 12.5979C2.30703 12.5992 3.7322 12.1063 4.88639 11.1988C3.4922 11.1724 2.26961 10.2623 1.84252 8.93366C2.3309 9.02796 2.83413 9.00858 3.31349 8.87746C1.79349 8.57001 0.699937 7.23299 0.699937 5.68023C0.699937 5.66602 0.699937 5.65246 0.699937 5.63889C1.15284 5.89144 1.65994 6.0316 2.17865 6.0471C0.747034 5.08923 0.305743 3.18251 1.17026 1.69176C2.82445 3.7296 5.2651 4.96844 7.8851 5.09956C7.62252 3.96664 7.98123 2.77947 8.82768 1.98307C10.1399 0.748096 12.2038 0.811395 13.4374 2.12452C14.167 1.98048 14.8664 1.71243 15.5064 1.33264C15.2632 2.0877 14.7541 2.72909 14.0741 3.13665C14.7199 3.06044 15.3509 2.88734 15.9451 2.62316C15.5077 3.2794 14.9567 3.85103 14.3193 4.31285Z",fill:"#1D9BF0"})}),vimeo:A.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsxs("g",{clipPath:"url(#clip0_6523_22340)",children:[A.jsx("path",{d:"M16 14.4C16 15.28 15.28 16 14.4 16H1.6C0.72 16 0 15.28 0 14.4V1.6C0 0.72 0.72 0 1.6 0H14.4C15.28 0 16 0.72 16 1.6V14.4Z",fill:"#1AB7EA"}),A.jsx("path",{d:"M13.9945 5.3084C13.9391 6.42815 13.1229 7.97447 11.5458 9.93402C9.91331 11.9736 8.52987 13 7.40928 13C6.70372 13 6.12267 12.3735 5.63846 11.1338C5.32027 9.98735 4.98824 8.85427 4.67005 7.70786C4.31036 6.46814 3.92299 5.84161 3.50796 5.84161C3.42495 5.84161 3.10676 6.02824 2.56721 6.38816L2 5.68165C2.59488 5.1751 3.17593 4.68187 3.75698 4.17532C4.54554 3.52214 5.14042 3.17555 5.54162 3.13556C6.46853 3.05557 7.04958 3.66877 7.27093 4.97514C7.50612 6.40149 7.67213 7.28129 7.75514 7.62788C8.01799 8.80095 8.32235 9.40081 8.64054 9.40081C8.88956 9.40081 9.26309 9.01423 9.77497 8.2544C10.273 7.49457 10.5497 6.90804 10.5774 6.50813C10.6465 5.85494 10.3837 5.52169 9.77497 5.52169C9.48444 5.52169 9.19392 5.58834 8.88956 5.70831C9.48444 3.84206 10.605 2.94893 12.2652 3.00225C13.4826 3.02891 14.0637 3.80207 13.9945 5.3084Z",fill:"white"})]}),A.jsx("defs",{children:A.jsx("clipPath",{id:"clip0_6523_22340",children:A.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),youtube:A.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("path",{d:"M15.6656 3.75817C15.4816 3.06609 14.9395 2.5211 14.2511 2.33614C13.0034 2 8 2 8 2C8 2 2.99666 2 1.7489 2.33614C1.06051 2.5211 0.518324 3.06609 0.334339 3.75817C0 5.01251 0 7.62963 0 7.62963C0 7.62963 0 10.2467 0.334339 11.5012C0.518324 12.1932 1.06051 12.7381 1.7489 12.9232C2.99666 13.2593 8 13.2593 8 13.2593C8 13.2593 13.0034 13.2593 14.2511 12.9232C14.9395 12.7381 15.4816 12.1932 15.6656 11.5012C16 10.2467 16 7.62963 16 7.62963C16 7.62963 16 5.01251 15.6656 3.75817Z",fill:"#ED1D24"}),A.jsx("path",{d:"M6.36353 10.0058L10.5453 7.62974L6.36353 5.25349V10.0058Z",fill:"white"})]})};function Do(e){const{debouncedUrl:t,content:n,onContentChange:o,selected:i}=e,s=f.useRef(null),[a,l]=f.useState(!1);E.useOnChange(t,()=>{var c;a&&(l(!1),(c=s.current)==null||c.reset())});function d(){l(!0),o(void 0)}return te.toURL(t)?t===(n==null?void 0:n.embed_url)?A.jsx(zt,{content:n,selected:i}):A.jsx(r.ErrorBoundary,{ref:s,renderError:Kl,onError:d,children:A.jsx(f.Suspense,{fallback:n&&A.jsx(zt,{content:n,selected:i}),children:A.jsx(Ul,{url:t,selected:i,onContentChange:o})})}):null}function Kl(){return A.jsxs(r.Box,{backgroundColor:"grey2",borderRadius:6,padding:16,gap:4,children:[A.jsx(r.Icon,{name:"alert",size:"small",color:"grey11"}),A.jsx(r.Text,{variant:"smallBold",color:"grey11",children:"There is no embed data available."})]})}function zt(e){const{content:t,selected:n}=e,{thumbnail:o,provider:i,author:s,url:a,subtitle:l}=vl(t);return A.jsxs(r.PreviewCard,{selected:n,children:[A.jsx(r.PreviewImage,{src:o.url,aspectRatio:o.aspectRatio}),A.jsxs(r.PreviewContent,{children:[A.jsxs(r.Box,{display:"flex",alignItems:"center",gap:4,children:[A.jsx(Sl,{provider:i}),A.jsx(r.Text,{variant:"smallBold",color:"grey12",noWrap:!0,children:i}),s&&A.jsx(r.Text,{variant:"small",color:"grey11",noWrap:!0,children:s})]}),A.jsx(r.Text,{variant:"smallBold",href:a,children:l})]})]})}function Ul(e){const{url:t,onContentChange:n,selected:o}=e,i=Tl({url:t,onContentChange:n});return A.jsx(zt,{content:i,selected:o})}function Tl(e){const{url:t,onContentChange:n}=e,{embedApiEndpoint:o}=L(),i=R.useRequest(wl,[t,o]),s=E.useStableCallback(n);return f.useEffect(()=>{const a=r.handleEditorFlushSyncError(()=>s(i));return()=>{clearTimeout(a)}},[i,s]),i}function wl(e,t){const n=new URL(t);return n.searchParams.set("url",e),U.request(n,{okType:Ll(e)})}function Ll(e){return p.z.object({type:p.z.string(),version:p.z.string().or(p.z.number()).nullish(),title:p.z.string().nullish(),author_name:p.z.string().nullish(),author_url:p.z.string().nullish(),provider_name:p.z.string().nullish(),provider_url:p.z.string().nullish(),cache_age:p.z.string().or(p.z.number()).nullish(),thumbnail_url:p.z.string().nullish(),thumbnail_width:p.z.number().nullish(),thumbnail_height:p.z.number().nullish(),html:p.z.string().nullish()}).passthrough().transform(t=>{const n={embed_url:e};return{...n,__TYPE__:"EmbedContent",type:t.type,version:t.version,title:t.title,author_name:t.author_name,author_url:t.author_url,provider_name:t.provider_name,provider_url:t.provider_url,cache_age:t.cache_age,thumbnail_url:t.thumbnail_url,thumbnail_width:t.thumbnail_width,thumbnail_height:t.thumbnail_height,html:t.html,all:{...n,...t}}})}function vl(e){let t="";switch(e.type){case"video":t=e.title??"";break;case"photo":t=`View this post${e.provider_name?` on ${e.provider_name}`:""}`;break;default:t=`Open${e.provider_name?` on ${e.provider_name}`:""}`}return{url:e.embed_url,thumbnail:{url:e.thumbnail_url??"",aspectRatio:e.type==="video"?"16:9":"1:1"},provider:e.provider_name??"",author:e.author_name??"",subtitle:t}}function kl(e){const{id:t,readOnly:n,field:o,content:i,onContentChange:s}=e,a=E.useDebounceState({initialState:(i==null?void 0:i.embed_url)??"",startTransition:f.startTransition});function l(d){a.set(d),te.toURL(d)||s(void 0)}return A.jsxs(r.Field,{footer:te.toURL(a.value)&&A.jsx(r.FieldFooter,{children:A.jsx(Do,{debouncedUrl:a.debouncedValue,content:i,onContentChange:s})}),children:[A.jsx(r.FieldIcon,{name:"cloud"}),A.jsx(r.FieldLabel,{htmlFor:t,children:Z(o)}),A.jsx(r.FieldControl,{children:A.jsx(Fe,{id:t,readOnly:n,placeholder:De(o),value:a.value,onValueChange:l,variant:te.toURL(a.value)?"link":"normal",endAdornment:A.jsx(r.Button,{startIcon:"close",color:"grey",size:"small",disabled:!a,onClick:()=>l("")})})})]})}function Ro(e){return!(e.lat>85||e.lat<-85||e.lng>180||e.lng<-180)}function Qt(e){const t=/^.*@(-?\d+.\d+),(-?\d+.\d+).*$/,n=e.match(t);if(!n)return;const o=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(o)||isNaN(i))return;const s={lat:o,lng:i};if(Ro(s))return s}function Vn(e){return e?`${e.lat}, ${e.lng}`:""}function Yn(e){const t=/\(?([\d|.|-]*)[\s+]*,[\s]*([\d|.|-]*)\)?/,n=e.match(t);if(!n)return Qt(e);const o=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(o)||isNaN(i))return Qt(e);const s={lat:o,lng:i};return Ro(s)?s:Qt(e)}function El(e){const{field:t,id:n,readOnly:o,...i}=e,{onValueChange:s,displayedValue:a,onBlur:l,clearValue:d,isValidCoordinates:c}=Dl(i);return A.jsxs(r.Field,{children:[A.jsx(r.FieldIcon,{name:"place"}),A.jsx(r.FieldLabel,{htmlFor:n,children:Z(t)}),A.jsx(r.FieldControl,{children:A.jsx(Fe,{id:n,onValueChange:s,placeholder:In,readOnly:o,value:a,onBlur:l,variant:c?"link":"normal",endAdornment:A.jsx(r.Button,{startIcon:"close",color:"grey",size:"small",disabled:!a,onClick:d})})})]})}function Dl(e){const{content:t,onContentChange:n}=e,o=Vn(t==null?void 0:t.position),[i,s]=f.useState(o);function a(){const c=Yn(i);if(!c)return s(""),n(void 0);const{lat:u,lng:h}=c;s(Vn({lat:u,lng:h})),n({__TYPE__:"GeoPointContent",position:{lat:u,lng:h}})}function l(){s(""),n(void 0)}const d=!!Yn(i);return{displayedValue:i,isValidCoordinates:d,onValueChange:s,onBlur:a,clearValue:l}}function Qo(e){const{fieldLabel:t,imageLabel:n=[]}=e;return A.jsxs(r.CardHeaderTitle,{children:[A.jsx(r.Text,{variant:"bold",noWrap:!0,children:Ae.overflow(t,30)}),n.length!==0&&A.jsx(r.Text,{color:"grey11",noSelect:!0,children:` • ${n.join(" • ")}`})]})}function Mo(e){const{fieldLabel:t,isUpdating:n,readOnly:o,onMediaDialogOpenChange:i}=e;return A.jsxs(A.Fragment,{children:[A.jsx(r.CardHeader,{sx:{flexWrap:"wrap"},children:A.jsx(Qo,{fieldLabel:t})}),A.jsx(r.CardContent,{children:A.jsx(r.Card,{color:"grey2",variant:"dashed",paddingBlock:12,radius:4,sx:{width:"100%"},children:A.jsx(r.CardContent,{children:A.jsxs(r.BlankSlate,{variant:"horizontal",children:[A.jsx(r.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple9",backgroundColor:"purple4",size:"small"}),A.jsx(r.BlankSlateTitle,{children:n?"Preparing your image...":"You haven't selected an image"}),!o&&A.jsx(r.BlankSlateActions,{children:A.jsx(r.Button,{disabled:n,onClick:()=>i(!0),size:"medium",children:"Select image"})})]})})})})]})}const Rl=p.object({id:p.string(),width:p.number(),height:p.number(),urls:p.object({full:p.string(),small:p.string().transform(ea)}),alt_description:p.string().optional(),description:p.string().nullable()}),Ql=p.object({results:p.array(Rl)}).transform(e=>e.results);function qo(e,t){const n=new URL("search/photos",e);return n.searchParams.set("page","1"),n.searchParams.set("per_page","28"),n.searchParams.set("query",t),U.request(n,{okType:Ql})}R.cache.registerFetcherConfig(qo,{cacheCapacity:5,revalidationStrategy:{type:"never"}});function Ml(e,t){const n=f.useRef(),o=L(),i=R.useRequest(qo,[e,t]);return E.useDebounce(t,1e3,()=>{var s;n.current&&t!==n.current&&((s=o.onAnalyticsEvent)==null||s.call(o,"Unsplash Image Searched")),n.current=t}),i}function ql(e){const{onSelectedChange:t}=e,[n,o]=f.useTransition(),i=E.useDebounceState({initialState:"",ms:300,startTransition:o});return A.jsxs(r.Box,{flexDirection:"column",gap:16,width:"100%",position:"relative",children:[A.jsx(r.FormSearchInput,{value:i.value,placeholder:"Search on Unsplash.com",onValueChange:i.set}),A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(ho,{}),children:A.jsx(f.Suspense,{fallback:A.jsx(Ol,{}),children:A.jsx(Pl,{term:i.debouncedValue,loading:n,onSelectedChange:t})})})]})}function Pl(e){const{term:t,onSelectedChange:n,loading:o}=e,{media:i,toggleSelected:s,selectedImageId:a}=Vl({term:t,onSelectedChange:n});return A.jsxs(A.Fragment,{children:[i.length>0&&A.jsx(Po,{children:i==null?void 0:i.map(l=>{const c=new URL(l.urls.full).searchParams.get("fm")??"jpg";return A.jsx(r.MediaCard,{url:l.urls.small,filename:l.description??"Unsplash Image",selected:a===l.id,onCardClick:()=>s(l),onCheckedChange:()=>s(l),extension:c,kind:"image",width:l.width,height:l.height,loading:o},l.id)})}),i.length===0&&A.jsx(uo,{})]})}function Po(e){const{children:t}=e;return A.jsx(r.ScrollArea,{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 250px), 1fr))",gap:16,padding:2,paddingBottom:16,position:"relative",width:"100%"},children:t})}function Ol(){return A.jsx(Po,{children:O.range(1,24).map(e=>A.jsx(yo,{},e))})}function Vl(e){var c;const{term:t,onSelectedChange:n}=e,{unsplashApiBaseUrl:o}=L(),i=Ml(o,t||"citrus fruit"),s=(c=i==null?void 0:i[0])==null?void 0:c.id,[a,l]=f.useState();f.useEffect(()=>{n==null||n([]),l(void 0)},[s,n]);function d(u){if(u.id===a)return l(void 0),n==null?void 0:n([]);l(u.id),n==null||n([{...u,url:u.urls.full,alt:u.alt_description}])}return{media:i,toggleSelected:d,selectedImageId:a}}function jn(e){const{open:t,onOpenChange:n,onMediaSelected:o,assetType:i}=e,s=L(),a=s.mediaLibrary,[l,d]=f.useState(()=>a?"media":"unsplash"),[c,u]=f.useState(new Set),[h,g]=f.useState([]),m=c.size+h.length,C=R.useFetcherData(ie);f.useEffect(()=>{!t||!a||Ao({config:s,assetType:i})},[t,s,i,a]);function y(b){if(b!=="media"&&b!=="unsplash")throw new Error(`Invalid option ${b}.`);d(b)}function x(b){b||u(new Set),n(b)}const I=ys({assetType:i,mediaDialogOpen:t});function B(){var b;switch(l){case"unsplash":{const v=h[0];if(!v)return;o(v),(b=s.onAnalyticsEvent)==null||b.call(s,"Unsplash Image Added");break}case"media":{const T=C.flatMap(k=>k.items).filter(k=>c.has(k.id))[0];if(!T)return;o(T),I(T.id);break}}}function j(){if(m===0)return"Select a media item to add to the page";if(m>1)return"Only one media item can be added to the page"}const{containerRef:S}=r.useAlert();return A.jsxs(r.Dialog,{open:t,onOpenChange:x,size:{width:"min(calc(100% - 48px), 2000px)",height:"calc(100% - 30px)"},position:"center",onPointerDownOutside:b=>{S&&E.refContainsTarget(S,b.target)&&b.preventDefault()},children:[A.jsx(r.DialogHeader,{icon:"image",title:"Media library"}),A.jsx(r.DialogDescription,{hidden:!0,children:"Select a media item to add to the page"}),A.jsxs(r.DialogOptions,{value:l,onValueChange:y,padding:"small",width:"auto",children:[a&&A.jsx(r.DialogOptionsItem,{value:"media",icon:"photo"}),A.jsx(r.DialogOptionsItem,{value:"unsplash",icon:"unsplash"})]}),A.jsx(r.DialogContent,{children:A.jsx(r.Box,{flexDirection:"column",flexGrow:1,overflow:"hidden",children:A.jsxs(r.Box,{overflow:"hidden",backgroundColor:"grey2",padding:{top:16,inline:16},flexGrow:1,children:[l==="media"&&A.jsx(Ko,{assetType:i,onSelectedChange:u}),l==="unsplash"&&A.jsx(ql,{onSelectedChange:g})]})})}),A.jsxs(r.DialogActions,{children:[A.jsx(r.DialogCancelButton,{}),A.jsx(r.DialogActionButton,{onClick:B,disabled:m!==1,tooltipLabel:j(),children:"Add to page"})]})]})}const Oo=f.forwardRef(function(t,n){const{isMediaDialogOpen:o,selected:i,children:s,onMediaSelected:a,onMediaDialogOpenChange:l}=t;function d(c){a(c),l(!1)}return A.jsxs(r.Card,{ref:n,color:i?"indigo2":"grey2",variant:i?"selected":"dashed",paddingBlock:12,radius:4,children:[s,A.jsx(jn,{open:o,onOpenChange:l,onMediaSelected:d,assetType:"image"})]})});function Vo(e){const{uploadImage:t,children:n,isUploading:o,disabled:i}=e;if(i)return A.jsx(A.Fragment,{children:n});function s(a){if(o)return;const l=a[0];l&&t(l)}return A.jsx(r.FileDropZone,{assetType:"image",maxFiles:1,onFilesSelected:s,overlay:A.jsx(Yl,{isUploading:o}),children:n})}function Yl(e){const{isUploading:t}=e,n=t?"You can't upload while the upload is ongoing":"Drop image to instantly upload";return A.jsx(r.Box,{justifyContent:"center",flexDirection:"column",height:"100%",padding:8,children:A.jsxs(r.BlankSlate,{children:[A.jsx(r.BlankSlateIcon,{name:t?"block":"cloudUpload",lineColor:t?"tomato11":"purple10",backgroundColor:t?"tomato2":"purple3",borderColor:t?"tomato6":"purple6",borderStyle:"dashed",size:"small"}),A.jsx(r.BlankSlateTitle,{size:"regular",children:n})]})})}function Yo(e){const{contentView:t,croppedImage:n}=e,{width:o,height:i,x:s,y:a,zoom:l}=n,d=Hl({origin:t.origin,croppedImage:n});return{...t,width:o,height:i,url:d,edit:{...t.edit,zoom:l,crop:{x:s,y:a}}}}function Wl(e){var c,u,h;const{field:t,content:n,thumbnail:o,croppedImage:i}=e;if(o===Ze)return Wo({content:n,croppedImage:i});const s=K.isImageContent(n),a=(u=(c=t==null?void 0:t.config)==null?void 0:c.thumbnails)==null?void 0:u.find(g=>g.name===o),l=s?(h=n.thumbnails)==null?void 0:h[o]:void 0;if(!a||!l)return n;const d=Yo({contentView:l,croppedImage:i});return d.url===l.url?n:{...n,thumbnails:s?{...n.thumbnails,[o]:d}:void 0}}function Wo(e){const{content:t,croppedImage:n}=e,o=Yo({contentView:t,croppedImage:n});return o.url===t.url?t:{...t,...o}}function Hl(e){const{origin:t,croppedImage:n}=e,{x:o,y:i,width:s,height:a,cropHeight:l,cropWidth:d}=n,c=new URL(t.url),u=t.height!==a||t.width!==s;if(o!==0||i!==0||l!==t.height||d!==t.width){const g=[o,i,d,l].map(Math.round).join(",");c.searchParams.set("rect",g),c.searchParams.set("w",s.toString()),c.searchParams.set("h",a.toString())}return u&&(c.searchParams.set("w",s.toString()),c.searchParams.set("h",a.toString())),c.toString()}function _l(e){const{edit:{crop:{x:t,y:n},zoom:o},width:i,height:s,origin:{width:a,height:l}}=e;let d,c;const u=a/l,h=i/s;return h>=u?(d=a/o,c=d/h):(c=l/o,d=c*h),{x:t,y:n,width:i,height:s,zoom:o,cropWidth:d,cropHeight:c}}function zl(e){const{selectedImage:t,imageCrop:n,setImageCrop:o}=e,{width:i,height:s,zoom:a,cropHeight:l,cropWidth:d}=n,c=t.contentView,u={x:n.x,y:n.y,width:d,height:l},[h,g]=f.useState(),m=(c==null?void 0:c.origin.url)??"",C=!(t!=null&&t.thumbnail.height&&(t!=null&&t.thumbnail.width));function y(S,b){const v=parseInt(b);isNaN(v)||v<=0||!C||o({...n,[S]:v})}function x(S){o({...n,cropWidth:S.width,cropHeight:S.height,x:S.x,y:S.y})}function I(S){o({...n,zoom:S})}function B(){g(at),o({...n,...at})}function j(){c&&(g(at),o({...n,...at,zoom:1,cropWidth:c.width,cropHeight:c.height}))}return A.jsxs(r.Box,{padding:{inline:24,block:16},flexDirection:"column",gap:16,height:"100%",overflowY:"auto",alignItems:"center",children:[A.jsxs(r.Box,{gap:8,height:32,alignItems:"flex-start",width:"100%",children:[A.jsx(r.Tooltip,{content:"Center",children:A.jsx(r.Button,{color:"grey",size:"medium",startIcon:"centerFocusWeak",onClick:B})}),A.jsx(r.Tooltip,{content:"Cover",children:A.jsx(r.Button,{color:"grey",size:"medium",startIcon:"zoomOutMap",onClick:j})}),A.jsx(r.Separator,{orientation:"vertical"}),A.jsx(r.FormInput,{prefix:"W",prefixTooltip:"Width",placeholder:"width",type:"number",size:"medium",value:String(i),onValueChange:S=>y("width",S),sx:{width:100},disabled:!C}),A.jsx(r.FormInput,{prefix:"H",prefixTooltip:"Height",placeholder:"height",type:"number",size:"medium",value:String(s),onValueChange:S=>y("height",S),sx:{width:100},disabled:!C})]}),A.jsx(r.Cropper,{image:m,aspect:i/s,crop:h??{x:0,y:0},onCropChange:g,zoom:a,onZoomChange:I,onCropAreaChange:(S,b)=>x(b),initialCroppedAreaPixels:u}),A.jsx(r.Box,{width:"100%",maxWidth:320,children:A.jsx(r.Slider,{min:1,max:3,step:.01,value:[a],onValueChange:([S])=>I(S??1)})})]})}const at={x:0,y:0};function Nl(e){const{trigger:t,initialImages:n,renderTooltip:o}=e,{open:i,onOpenChange:s,ready:a,option:l,selectedImage:d,croppedImage:c,setCroppedImage:u,setReady:h,setOption:g}=Gl(e);return A.jsxs(r.Dialog,{trigger:t,onAnimationEnd:()=>h(!0),open:i,onOpenChange:s,renderTooltip:o,children:[A.jsx(r.DialogHeader,{icon:"photo",title:"Image editor"}),A.jsx(r.DialogDescription,{hidden:!0,children:"Crop your image to the desired size."}),A.jsx(r.DialogOptions,{value:String(l),onValueChange:m=>g(Number(m)),children:n.map((m,C)=>A.jsx(r.DialogOptionsItem,{value:String(C),icon:"photo",title:m.labels[0]??"Main",subtitle:m.labels[1]??""},m.thumbnail.name))}),d&&A.jsx(r.DialogContent,{children:a&&c&&A.jsx(zl,{selectedImage:d,imageCrop:c,setImageCrop:u},d.thumbnail.name)})]})}function Gl(e){const{initialImages:t,initialOption:n,onClose:o}=e,[i,s]=f.useState(x),[a,l]=f.useState(!1),[d,c]=f.useState(!1),[u,h]=f.useState(n);function g(I){I?(h(n),s(x())):(c(!1),o({option:u,croppedImages:i})),l(I)}const m=t[u],C=i[(m==null?void 0:m.thumbnail.name)??""];function y(I){if(!m)return;const B=m.thumbnail.name;s({...i,[B]:I})}function x(){return t.reduce((I,B)=>(B.contentView&&(I[B.thumbnail.name]=_l(B.contentView)),I),{})}return{open:a,ready:d,option:u,selectedImage:m,croppedImage:C,setCroppedImage:y,setReady:c,setOption:h,onClose:o,onOpenChange:g}}function Zl(e){const{readOnly:t,altText:n,selected:o,onValueChange:i}=e,s=f.useId();return A.jsxs(r.Field,{selected:o,children:[A.jsx(r.FieldLabel,{htmlFor:s,children:"Alt text"}),A.jsx(r.FieldControl,{children:A.jsx(r.Box,{flexGrow:1,height:40,children:A.jsx(Fe,{id:s,placeholder:"Short description for the visually impaired",readOnly:t,value:n,padding:{input:{inline:12}},onValueChange:i})})})]})}function Jl(e){const{fieldLabel:t,imageLabel:n,initialImages:o,page:i,displaySeparator:s=!0,isSVGContentView:a,visibility:l,onClear:d,onCropperDialogClose:c,onMediaDialogOpenChange:u}=e;return A.jsxs(r.Box,{display:"flex",flexDirection:"column",gap:12,children:[A.jsxs(r.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:4,children:[A.jsx(Qo,{fieldLabel:t,imageLabel:n}),A.jsxs(r.CardHeaderActions,{sx:{visibility:l},children:[A.jsx(Nl,{trigger:A.jsx(r.Button,{startIcon:"crop",disabled:a,hiddenLabel:"Crop & Resize"}),renderTooltip:h=>A.jsx(r.Tooltip,{content:"Crop & Resize",children:h}),initialImages:o,initialOption:i,onClose:c}),A.jsx(r.Tooltip,{content:"Replace",children:A.jsx(r.Button,{startIcon:"imageSearch",hiddenLabel:"Replace",onClick:()=>u(!0)})}),A.jsx(r.Tooltip,{content:"Clear",children:A.jsx(r.Button,{onClick:d,startIcon:"delete",hiddenLabel:"Clear"})})]})]}),s&&A.jsx(r.Separator,{style:"dashed",decorative:!0})]})}function ve(e){const{description:t,largeIconName:n="public",loading:o,error:i,onEdit:s,onUnlink:a}=e,l=i?A.jsx(nc,{}):A.jsx(tc,{...e,largeIconName:n,loading:o});return A.jsx(r.Card,{sx:{width:420},children:A.jsxs(r.CardContent,{gap:12,children:[A.jsxs(r.Box,{display:"grid",gridTemplateColumns:"max-content 1fr min-content",gridTemplateRows:"1fr",gap:8,children:[l,A.jsxs(r.ButtonGroup,{size:"medium",color:"grey",sx:{justifySelf:"end"},children:[s&&A.jsx(r.Button,{startIcon:"edit",onClick:s}),a&&A.jsx(r.Button,{startIcon:"linkOff",onClick:a})]})]}),!i&&A.jsx(ec,{description:t,loading:o})]})})}function Xl(e){const{url:t,title:n,loading:o}=e;return o?A.jsx(Ho,{height:16,width:80}):n?A.jsx(r.Text,{variant:"smallBold",href:t==null?void 0:t.toString(),children:n}):null}function $l(e){const{subTitle:t,loading:n}=e;return n?A.jsx(r.Box,{padding:{block:2},children:A.jsx(Ho,{height:12,width:60})}):t?A.jsx(r.Text,{variant:"small",color:"grey11",noWrap:!0,children:t}):null}function ec(e){const{description:t,loading:n}=e;return!t||n?null:A.jsx(r.Text,{variant:"small",color:"grey11",children:t})}function tc(e){const{largeIconName:t,title:n,url:o,loading:i,subTitle:s}=e;return A.jsxs(A.Fragment,{children:[A.jsx(r.ConjoinedIcons,{largeIconName:t,smallIconName:"link"}),A.jsxs(r.Box,{flexDirection:"column",minWidth:0,children:[A.jsx(Xl,{title:n,url:o,loading:i}),A.jsx($l,{subTitle:s,loading:i})]})]})}function nc(){return A.jsxs(r.Box,{alignItems:"center",gap:8,children:[A.jsx(r.BackgroundIcon,{name:"alert",color:"tomato",size:"small"}),A.jsx(r.Text,{color:"tomato11",children:"Failed to load linked document data"})]})}function Ho(e){const{width:t,height:n}=e;return A.jsx(r.Skeleton,{color:"grey5",borderRadius:6,width:t,height:n})}function Wn(){const e=L();e.searchDocuments||V("searchDocuments");const{coreApiBaseUrl:t,authStrategy:n}=e,o=R.useRequest(St,[t,n]);return new Set(o.languages.map(i=>({id:i.id,label:i.label})))}function Ac(){const e=L();e.searchDocuments||V("searchDocuments");const{coreApiBaseUrl:t,authStrategy:n}=e,o=R.useRequest(qA,[t,n]);return new Set(o.results.map(i=>({id:i,label:i})))}function _o(){const e=L();e.searchDocuments||V("searchDocuments");const{customTypesApiBaseUrl:t,repository:n,authStrategy:o}=e,i=un({baseUrl:t,repository:n,authStrategy:o});return new Set(i.data)}function oc(e){const{documentTypeId:t,documentUrl:n,title:o,statusColor:i,description:s,tags:a,tagsFilter:l,previewImageUrl:d,highlighted:c,highlightedUID:u,searchTerm:h,onSelect:g}=e;function m(C){return C.nativeEvent instanceof MouseEvent&&(C.metaKey||C.ctrlKey)?window.open(n,"_blank"):g()}return A.jsxs(r.Card,{paddingBlock:16,onSelect:m,variant:c?"highlighted":void 0,color:c?"purple2":void 0,sx:{marginBlock:c?4:0,marginInline:4,flexShrink:0},children:[A.jsx(r.CardContent,{children:A.jsxs(r.Box,{justifyContent:"space-between",gap:6,children:[A.jsxs(r.Box,{flexDirection:"column",gap:4,alignItems:"flex-start",flexGrow:1,children:[A.jsx(ic,{documentTypeId:t}),A.jsx(sc,{title:o,statusColor:i,searchTerm:h}),u&&h&&A.jsx(dc,{uid:u,searchTerm:h}),A.jsx(ac,{description:s})]}),A.jsx(lc,{previewImageUrl:d})]})}),a.length>0&&A.jsx(cc,{tags:a,tagsFilter:l})]})}function ic(e){const{documentTypeId:t}=e;return A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(r.Badge,{maxWidth:150,size:"medium",title:"Type: error",icon:"description"}),children:A.jsx(f.Suspense,{fallback:A.jsx(r.Skeleton,{width:150,height:24}),children:A.jsx(rc,{documentTypeId:t})})})}function rc(e){const{documentTypeId:t}=e,o=[..._o()].find(i=>i.id===t);return A.jsx(r.Badge,{size:"medium",title:`Type: ${(o==null?void 0:o.label)??"Unknown"}`,icon:"description"})}function sc(e){const{title:t,statusColor:n,searchTerm:o}=e;return A.jsxs(r.Box,{gap:8,alignItems:"center",children:[A.jsx(r.Dot,{color:n}),A.jsx(zo,{text:t,highlight:o})]})}function ac(e){const{description:t}=e,n=t==null?void 0:t.substring(0,150);return n?A.jsx(r.Text,{variant:"small",color:"grey11",children:`${n}${n!==t?"...":""}`}):A.jsx(r.Text,{variant:"smallItalic",color:"grey11",children:"No description available"})}function lc(e){const{previewImageUrl:t}=e;return A.jsx(r.Box,{width:142,height:90,backgroundColor:"grey2",border:!0,borderRadius:6,flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4,flexShrink:0,padding:8,children:t?A.jsx(r.Image,{src:t,sizing:"cover"}):A.jsxs(A.Fragment,{children:[A.jsx(r.Icon,{name:"hideImage",size:"large",color:"grey11"}),A.jsx(r.Text,{color:"grey11",variant:"small",children:"No preview available"})]})})}function cc(e){const{tags:t}=e;return A.jsxs(r.CardFooter,{children:[A.jsxs(r.Box,{gap:4,alignItems:"center",children:[A.jsx(r.Icon,{name:"label",size:"small",color:"grey11"}),A.jsx(r.Text,{variant:"small",color:"grey11",children:"Tags:"})]}),A.jsx(r.TextOverflow,{children:t.map(n=>A.jsx(r.Badge,{size:"medium",title:n,sx:{marginRight:8}},n))})]})}function dc(e){const{uid:t,searchTerm:n}=e;return A.jsxs(r.Box,{alignItems:"flex-start",children:[A.jsx(r.Icon,{name:"tag",color:"green11",sx:{width:12,height:12}}),A.jsx(zo,{variant:"uid",highlight:n,text:t})]})}function zo(e){const{text:t,highlight:n,variant:o="title"}=e,i=uc[o],s=n?t.split(new RegExp(`(${Ae.escapeStringRegexp(n)})`,"gi")):[t];return A.jsx(r.Text,{variant:i.textVariants.text,color:i.colors.text,hyphens:!0,overflowWrap:"anywhere",children:s.map((a,l)=>a.toLowerCase()===(n==null?void 0:n.toLowerCase())?A.jsx(r.Text,{variant:i.textVariants.highlight,hyphens:!0,overflowWrap:"anywhere",highlight:!0,highlightColor:i.colors.highlight,highlightBorderRadius:2,color:i.colors.highlightText,children:a},l):a)})}const uc={title:{colors:{text:void 0,highlight:void 0,highlightText:"purple11"},textVariants:{text:"bold",highlight:"bold"}},uid:{colors:{text:"green11",highlight:"green3",highlightText:"green11"},textVariants:{text:"extraSmall",highlight:"extraSmall"}}};function gc(e){const{searchTerm:t,tagsFilter:n,typesFilter:o,localesFilter:i}=e,s=L();s.searchDocuments||V("searchDocuments");const{storageVersion:a}=R.useRequest(St,[s.coreApiBaseUrl,s.authStrategy]);s.searchDocuments||V("searchDocuments");const{status:l}=s,{data:d}=oe.useSuspenseQuery({...DA({searchTerm:t,tags:[...ee.map(n,c=>c.id)],customTypes:[...ee.map(o,c=>c.id)],locale:[...ee.map(i,c=>c.id)][0]??"",status:Vt[l],storageVersion:a,config:s}),select:c=>hc(c.results,Vt[l]),staleTime:300});return{documents:d.results}}function hc(e,t){return{results:e.flatMap(o=>{const s=o.versions.filter(a=>t.includes(a.status));return s.length===0?[]:{...o,versions:s}})}}function pc(e,t){const n=L(),o=E.useDebounceState({initialState:""}),[i,s]=f.useState(new Set),[a,l]=f.useState(new Set);function d(){return!n.searchDocuments||!n.localeId?new Set:new Set([{id:n.localeId,label:n.localeId}])}const[c,u]=f.useState(d),h=ee.union(a,ht(e)),g=ee.union(i,ht(t));return{searchTerm:o,filteredTags:i,setFilteredTags:s,filteredCustomTypes:a,setFilteredCustomTypes:l,filteredLocales:c,setFilteredLocales:u,typesFilter:h,tagsFilter:g}}function ht(e){return e?ee.map(e,t=>({id:t,label:t})):new Set}function mc(e){const{filteredLocales:t,setFilteredLocales:n,filteredTags:o,setFilteredTags:i,filteredCustomTypes:s,setFilteredCustomTypes:a,fixedTags:l,fixedCustomTypes:d}=e;return A.jsxs(A.Fragment,{children:[A.jsx(Cc,{selectedValues:t,onSelectedValuesChange:n}),A.jsx(Nt,{selectedValues:o,fixedSelectedValues:ht(l),onSelectedValuesChange:i,label:"Tags",icon:"label",fetchFilters:Ac}),A.jsx(Nt,{selectedValues:s,fixedSelectedValues:ht(d),onSelectedValuesChange:a,label:"Type",icon:"description",fetchFilters:_o})]})}function Nt(e){const[t,n]=f.useState(!1),o=f.useRef(null);return A.jsx(r.ErrorBoundary,{ref:o,renderError:()=>{var i;return A.jsx(r.FilterField,{mode:"error",onErrorRetry:(i=o.current)==null?void 0:i.reset,open:t,setOpen:n,values:new Set,...e})},children:A.jsx(f.Suspense,{fallback:A.jsx(r.FilterField,{mode:"loading",open:t,setOpen:n,values:new Set,...e}),children:A.jsx(fc,{open:t,setOpen:n,...e})})})}function fc(e){const{open:t,setOpen:n,onSelectedValuesChange:o,fixedSelectedValues:i,selectedValues:s,label:a,icon:l,fetchFilters:d,multiple:c}=e,u=d();return A.jsx(r.FilterField,{open:t,setOpen:n,label:a,icon:l,selectedValues:s,values:new Set(u),fixedSelectedValues:i,onSelectedValuesChange:o,multiple:c})}function Cc(e){const{selectedValues:t,onSelectedValuesChange:n}=e,[o,i]=f.useState(ee.first(t));function s(l){n(l),i(ee.first(l))}const a=ee.find(Wn(),l=>{var d;return l.id===((d=ee.first(t))==null?void 0:d.id)});return(a==null?void 0:a.label)!==(o==null?void 0:o.label)&&i(a),A.jsx(Nt,{selectedValues:new Set(o?[o]:[]),onSelectedValuesChange:s,label:"Locale",icon:"public",fetchFilters:Wn,multiple:!1})}function No(e){const{onSelectDocument:t,fixedCustomTypes:n,fixedTags:o,linkedDocumentId:i,...s}=e,a=L(),{searchTerm:l,filteredTags:d,setFilteredTags:c,filteredCustomTypes:u,setFilteredCustomTypes:h,filteredLocales:g,setFilteredLocales:m,typesFilter:C,tagsFilter:y}=pc(n,o);return A.jsxs(r.Dialog,{size:{height:727,width:656},hasClose:!1,...s,children:[A.jsx(r.DialogTitle,{hidden:!0,children:"Link to a page"}),A.jsx(r.DialogDescription,{hidden:!0,children:"Search and select a page to link to"}),A.jsx(r.DialogContent,{children:A.jsxs(r.Box,{flexDirection:"column",height:"100%",children:[A.jsxs(r.Box,{padding:{top:16,inline:16,bottom:8},flexDirection:"column",gap:12,children:[A.jsx(r.FormInput,{value:l.value,onValueChange:l.set,placeholder:"Search a page",icon:"search"}),a.searchDocuments&&A.jsx(mc,{filteredTags:d,setFilteredTags:c,filteredCustomTypes:u,setFilteredCustomTypes:h,filteredLocales:g,setFilteredLocales:m,fixedTags:o,fixedCustomTypes:n})]}),a.searchDocuments?A.jsx(xc,{searchTerm:l.debouncedValue,tagsFilter:y,typesFilter:C,localesFilter:g,onSelectDocument:t,linkedDocumentId:i}):A.jsx(Zo,{title:"Oops!",message:"Slice Machine does not yet support mock data for linked documents in the simulator."})]})})]})}function xc(e){const{searchTerm:t,tagsFilter:n,typesFilter:o,localesFilter:i,linkedDocumentId:s,onSelectDocument:a}=e;return A.jsxs(r.ScrollArea,{style:{flexGrow:1,paddingBottom:r.theme.space[16],paddingInline:r.theme.space[12],display:"flex",flexDirection:"column"},children:[s&&A.jsxs(A.Fragment,{children:[A.jsx(_n,{children:"Linked page"}),A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(Hn,{description:"An error occurred while fetching the linked page."}),children:A.jsx(f.Suspense,{fallback:Sc,children:A.jsx(Ic,{linkedDocumentId:s,tagsFilter:n,onSelectDocument:a})})})]}),A.jsx(_n,{children:"Link to a page"}),A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(Hn,{description:"An error occurred while fetching pages."}),children:A.jsx(f.Suspense,{fallback:Bc,children:A.jsx(yc,{searchTerm:t,tagsFilter:n,localesFilter:i,typesFilter:o,linkedDocumentId:s,onSelectDocument:a})})})]})}function yc(e){const{searchTerm:t,tagsFilter:n,localesFilter:o,typesFilter:i,linkedDocumentId:s,onSelectDocument:a}=e,{documents:l}=gc({searchTerm:t,tagsFilter:n,localesFilter:o,typesFilter:i}),d=l.filter(c=>c.id!==s);return d.length===0?A.jsx(Zo,{title:l.length===1?"No other pages found!":void 0}):A.jsx(r.Box,{flexDirection:"column",gap:12,children:d.map(c=>{const u=c==null?void 0:c.versions[0];return u?A.jsx(Go,{document:c,version:u,tagsFilter:n,searchTerm:t,onSelectDocument:a},`${c.id}-${u.status}`):null})})}const Bc=A.jsx(r.Box,{flexDirection:"column",gap:12,children:O.range(1,3).map(e=>A.jsx(r.Skeleton,{height:124,sx:{marginInline:4},zIndex:-1},e))});function Hn(e){const{description:t}=e;return A.jsx(r.Box,{flexDirection:"column",alignItems:"center",justifyContent:"center",children:A.jsx(r.DefaultErrorMessage,{title:"Request failed",description:t,errorImageSrc:r.dialogErrorImage})})}function Ic(e){const{linkedDocumentId:t,tagsFilter:n,onSelectDocument:o}=e,i=bc(t),s=jc(i);return A.jsx(Go,{document:i,version:s,tagsFilter:n,onSelectDocument:o,highlighted:!0})}function jc(e){return f.useMemo(()=>Fc(e),[e])}function Fc(e){return O.sort(e.versions,t=>t.status==="unclassified"||t.status==="published"?-1:0,t=>t.status==="release"?-1:0,t=>-t.last_modified_date.getTime())[0]}const Sc=A.jsx(r.Skeleton,{height:124,sx:{marginBlock:4,marginInline:4},zIndex:-1});function bc(e){const t=L();t.searchDocuments||V("searchDocuments");const{coreApiBaseUrl:n,authStrategy:o}=t;return R.useRequest(et,[n,o,e])}function Go(e){var g;const{document:t,version:n,tagsFilter:o,highlighted:i,onSelectDocument:s,searchTerm:a}=e,l=L();if(!t||!n)return null;const d=dn({documentId:t.id,versionId:n.status==="archived"?n.version_id:void 0,releaseId:n.status==="release"?n.release_id:void 0,status:n.status,baseUrl:l.baseUrl}),c=Kc({tags:n.tags,tagsFilter:o}),u=Wt(n)&&n.summary||UA(n)&&n.preview_summary||"",h=Wt(n)?(g=n.highlights)==null?void 0:g.uid:void 0;return A.jsx(oc,{documentTypeId:t.custom_type_id,documentUrl:d,description:u,tags:c,title:t.title,previewImageUrl:n.preview_image,onSelect:()=>s(t.id),statusColor:fA[n.status].color,highlighted:i,highlightedUID:h,searchTerm:a})}function _n(e){const{children:t}=e;return A.jsx(r.Box,{position:"sticky",top:0,backgroundColor:"white",padding:{block:6,inline:4},children:A.jsx(r.Text,{variant:"smallBold",color:"grey11",children:t})})}function Zo(e){const{title:t="No pages found!",message:n="Consider using different keywords or tweaking your filters to find what you need."}=e;return A.jsx(r.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:A.jsxs(r.BlankSlate,{children:[A.jsx(r.BlankSlateIcon,{name:"close",lineColor:"tomato11",backgroundColor:"tomato4",size:48}),A.jsx(r.BlankSlateTitle,{size:"big",children:t}),A.jsx(r.BlankSlateDescription,{width:360,children:n})]})})}function Kc(e){const{tags:t,tagsFilter:n}=e,o=[...n].map(s=>s.label).reverse();return O.sort(t,s=>-o.indexOf(s))}function Jo(e){const{hasLink:t,onUnlink:n,selectEnabled:o,selectedType:i,value:s,onOpenLinkModal:a,onValueChange:l,openInNewTab:d=!0,condensedButtons:c=!1,showNewTabButton:u=!1,displayTextEnabled:h,variants:g,variant:m,onVariantChange:C}=e;return A.jsxs(A.Fragment,{children:[!h&&u&&d&&A.jsx(r.Badge,{title:"Open in a new tab",color:"indigo",size:"small",icon:"openInNew",onClick:a}),!t&&o&&A.jsxs(r.Select,{value:i==="any"?void 0:i,color:"grey",size:"small",boldTriggerText:!0,position:"popper",sideOffset:4,startIcon:We({selectType:i}),disabled:!o,onValueChange:l,placeholder:c?"":Pe("any"),onlyStartIcon:c&&i!==void 0,renderTrigger:({button:y})=>A.jsx(r.Tooltip,{content:Pe(i),visible:c,children:y}),children:[A.jsx(r.SelectItem,{value:"web",icon:"public",children:Pe("web")}),A.jsx(r.SelectItem,{value:"document",icon:"description",children:Pe("document")}),A.jsx(r.SelectItem,{value:"media",icon:"image",children:Pe("media")})]},i===void 0?"unlinked":"linked"),!t&&!o&&A.jsx(r.Button,{startIcon:We({selectType:i}),color:"grey",textColor:"link",textWeight:"normal",size:"small",onClick:a,children:Pe(i)}),t&&!h&&A.jsx(r.Button,{startIcon:"close",color:"grey",size:"small",onClick:n,"aria-label":"Close"}),t&&h&&A.jsxs(r.ButtonGroup,{density:"compact",children:[A.jsx(r.Button,{startIcon:We({selectType:i}),renderEndIcon:()=>d&&i==="web"?A.jsx(r.Icon,{name:"openInNew",size:"extraSmall",color:"indigo11"}):null,color:"grey",textColor:"link",textWeight:"normal",size:"small",disabled:!t,onClick:a,children:s.length>30?`${s.slice(0,30)}...`:s}),A.jsx(r.Button,{startIcon:"close",color:"grey",size:"small",onClick:n})]}),g.length>1&&A.jsx(r.Select,{value:m,color:"grey",size:"small",boldTriggerText:!0,position:"popper",sideOffset:4,startIcon:"colorLens",onValueChange:C,children:g.map((y,x)=>A.jsx(r.SelectItem,{value:y,children:y},`${y}-${x}`))})]})}function Pe(e){if(!e||e==="any")return"Choose link type";switch(e){case"document":return"Link to Prismic page";case"web":return"Link to web page";case"media":return"Link to media"}}function Xo(e){const{onEdit:t,onUnlink:n,url:o,title:i,subTitle:s}=e,[a,l]=f.useState(null);return A.jsx(r.Card,{paddingBlock:16,ref:l,children:A.jsxs(r.CardContent,{children:[A.jsx(Tc,{url:o,title:i,subTitle:s,onEdit:t,onUnlink:n,container:a}),o&&A.jsx(r.CheckerBoard,{children:A.jsx(Uc,{children:A.jsx(r.Image,{src:o,alt:i,sizing:"contain"})})})]})})}function Uc(e){const{children:t}=e;return A.jsx(r.Box,{flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",height:327,children:t})}function Tc(e){const{url:t,title:n,subTitle:o,onEdit:i,onUnlink:s,container:a}=e;return A.jsxs(r.Box,{flexDirection:"row",justifyContent:"space-between",gap:8,children:[A.jsxs(r.Box,{gap:8,minWidth:0,children:[A.jsx(r.ConjoinedIcons,{largeIconName:"image",smallIconName:"link"}),A.jsxs(r.Box,{flexDirection:"column",minWidth:0,children:[A.jsx(r.Text,{noWrap:!0,variant:"smallBold",href:t,inline:!0,children:n}),A.jsx(r.Text,{variant:"small",color:"grey11",children:o})]})]}),A.jsxs(r.ButtonGroup,{size:"medium",color:"grey",children:[i&&A.jsx(r.Tooltip,{content:"Edit link",side:"top",container:a,children:A.jsx(r.Button,{startIcon:"edit",onClick:i})}),s&&A.jsx(r.Tooltip,{content:"Remove link",side:"top",container:a,children:A.jsx(r.Button,{startIcon:"linkOff",onClick:s})})]})]})}function wc(e){var he,Qe,Me;const{field:t,content:n,onContentChange:o}=e,i=B(),s=((he=t.config)==null?void 0:he.allowText)??!1,a=s&&(n==null?void 0:n.value.text)||void 0,l=((Qe=t.config)==null?void 0:Qe.variants)??[],c=(n==null?void 0:n.value.variant)&&l.includes(n==null?void 0:n.value.variant)?n==null?void 0:n.value.variant:l[0],[u,h]=f.useState(I),g=K.FilledExternalLinkContent.is(n==null?void 0:n.value)&&(n==null?void 0:n.value.target)||void 0,[m,C]=f.useState(!1),y=f.useRef(null);E.useOnChange(i,_);const x=u?Lc[u]:void 0;function I(){var D,Q;return!((D=t.config)!=null&&D.select)||n!=null&&n.value.__TYPE__?n==null?void 0:n.value.__TYPE__:zn[(Q=t.config)==null?void 0:Q.select]}function B(){return n?K.FilledDocumentLinkContent.is(n.value)?n.value.id:K.FilledExternalLinkContent.is(n.value)?n.value.url:K.FilledFileLinkContent.is(n.value)||K.FilledImageLinkContent.is(n.value)?n.value.name:"":""}function j(D){var pe;const{displayText:Q,variant:z}=D;if(!Q&&!z)return o(void 0);switch((pe=t.config)==null?void 0:pe.select){case"web":return o({__TYPE__:"LinkContent",key:Oe(n),value:{__TYPE__:"ExternalLink",kind:"web",...Q&&{text:Q},...z&&{variant:z}}});case"document":return o({__TYPE__:"LinkContent",key:Oe(n),value:{__TYPE__:"DocumentLink",kind:"document",...Q&&{text:Q},...z&&{variant:z}}});case"media":return o({__TYPE__:"LinkContent",key:Oe(n),value:{__TYPE__:"MediaLink",kind:"media",...Q&&{text:Q},...z&&{variant:z}}});default:return o({__TYPE__:"LinkContent",key:Oe(n),value:{__TYPE__:"AnyLink",kind:"any",...Q&&{text:Q},...z&&{variant:z}}})}}function S(D,Q){if(!D)return j({displayText:a,variant:c});const{newTab:z=!1}=Q??{},pe=z?"_blank":void 0;switch(u){case"ExternalLink":return o({__TYPE__:"LinkContent",key:Oe(n),value:{__TYPE__:"ExternalLink",url:D,target:pe,...a&&{text:a},...c&&{variant:c}}});case"DocumentLink":return o({__TYPE__:"LinkContent",key:Oe(n),value:{__TYPE__:"DocumentLink",id:D,...a&&{text:a},...c&&{variant:c}}});default:return o(void 0)}}function b(D){return n?o({__TYPE__:n.__TYPE__,key:n.key,value:{...n.value,text:D}}):j({displayText:D})}function v(D){return n?o({__TYPE__:n.__TYPE__,key:n.key,value:{...n.value,variant:D}}):j({variant:D})}const F=kc();function T(D){h(D?zn[D]:void 0),S(""),D&&D!=="any"&&F(D)}function k(D){S(D)}function M(){C(!0)}function _(){var D;m&&(C(!1),(D=y.current)==null||D.reset())}function ge(D){const Q=$o({media:D});switch(Q.value.__TYPE__){case"ImageLink":return o({__TYPE__:Q.__TYPE__,key:Q.key,value:{...Q.value,...a&&{text:a},...c&&{variant:c}}});case"FileLink":return o({__TYPE__:Q.__TYPE__,key:Q.key,value:{...Q.value,...a&&{text:a},...c&&{variant:c}}})}}return{contentType:u,selectType:x,fieldValue:i,onDisplayTextChange:b,onValueChange:S,onTypeChange:T,placeholder:De(t),isTypeSelectEnabled:!((Me=t.config)!=null&&Me.select),onDocumentSelected:k,onError:M,errorBoundaryRef:y,isTargetNewTab:g==="_blank",onMediaSelected:ge,displayTextEnabled:s,displayText:a??"",variants:l,variant:c,onVariantChange:v}}function Oe(e){return e?e.key:crypto.randomUUID()}const Lc={AnyLink:"any",DocumentLink:"document",ExternalLink:"web",FileLink:"media",ImageLink:"media",MediaLink:"media"},zn={any:"AnyLink",document:"DocumentLink",web:"ExternalLink",media:"FileLink"};function vc(e){const t=L();t.searchDocuments||V("searchDocuments");const{coreApiBaseUrl:n,authStrategy:o}=t;return R.useRequest(et,[n,o,e]).title}R.cache.registerFetcherConfig(et,{concurrency:50});function $o(e){var i,s,a,l,d,c;const{media:t}=e,n="kind"in t;return n&&t.kind==="image"?{__TYPE__:"LinkContent",key:crypto.randomUUID(),value:{__TYPE__:"ImageLink",id:t.id,name:t.filename,url:t.url,kind:"image",size:t.size.toString(),height:((i=t.height)==null?void 0:i.toString())??`${ye}`,width:((s=t.width)==null?void 0:s.toString())??`${ye}`,date:((a=t.last_modified)==null?void 0:a.toString())??""}}:n?{__TYPE__:"LinkContent",key:crypto.randomUUID(),value:{__TYPE__:"FileLink",id:t.id,name:t.filename,kind:"file",url:t.url,size:t.size.toString(),date:((l=t.last_modified)==null?void 0:l.toString())??""}}:{__TYPE__:"LinkContent",key:crypto.randomUUID(),value:{__TYPE__:"ImageLink",id:t.id,name:(t==null?void 0:t.alt)??t.url,kind:"image",url:t.url,size:"0",height:((d=t.height)==null?void 0:d.toString())??`${ye}`,width:((c=t.width)==null?void 0:c.toString())??`${ye}`}}}const kc=()=>{const e=ml(),{onAnalyticsEvent:t}=L();function n(o){e&&t&&t("Generic Link Added",{type:o,isInSlice:String(e.isInSlice),isInGroup:String(e.isInGroup),isInRepeatable:String(e.isInRepeatable),customTypeFormat:e.customTypeFormat??"custom"})}return n};function Ec(e){const{open:t,onOpenChange:n,showNewTabButton:o}=e,{url:i,setUrl:s,openInNewTab:a,setOpenInNewTab:l,disabled:d,onUpdate:c}=Dc(e);return A.jsxs(r.Dialog,{open:t,onOpenChange:n,size:"small",noDescription:!0,children:[A.jsx(r.DialogHeader,{title:"Set Link URL"}),A.jsxs(r.DialogContent,{padding:16,children:[A.jsx(r.FormInput,{value:i,onValueChange:s,placeholder:"Paste URL",icon:"public"}),o&&A.jsx(r.InlineLabel,{value:"Open in a new tab",children:A.jsx(r.Checkbox,{checked:a,onCheckedChange:l})})]}),A.jsxs(r.DialogActions,{children:[A.jsx(r.DialogCancelButton,{}),A.jsx(r.DialogActionButton,{onClick:c,disabled:d,children:"Update"})]})]})}function Dc(e){const{url:t,openInNewTab:n,onUpdate:o,open:i}=e,[s,a]=f.useState(t),[l,d]=f.useState(n);E.useOnChange(i,()=>{i&&(a(t),d(n))});const c=!s||s===t&&l===n;function u(){o(s,{newTab:l})}return{url:s,setUrl:a,openInNewTab:l,disabled:c,setOpenInNewTab:d,onUpdate:u}}function Fn(e){var Q,z,pe,ot;const{content:t,field:n,id:o,onContentChange:i,appearance:s="normal",backgroundColor:a="grey1"}=e,l=E.useDebounceState({initialState:!1}),[d,c]=f.useState(),{contentType:u,fieldValue:h,errorBoundaryRef:g,onDocumentSelected:m,onError:C,onMediaSelected:y,onValueChange:x,selectType:I,onTypeChange:B,isTypeSelectEnabled:j,displayTextEnabled:S,...b}=wc({content:t,field:n,onContentChange:i}),v=u==="DocumentLink"&&h!=="",T=u==="ExternalLink"&&te.toURL(h),k=!!((Q=n.config)!=null&&Q.allowTargetBlank);function M(){switch(u){case"DocumentLink":return c("document");case"ExternalLink":return c("web");case"FileLink":case"ImageLink":case"MediaLink":return c("media");default:return c(void 0)}}const _={...b,id:o,onFocus:()=>l.set(!0),onBlur:()=>l.set(!1),onOpenLinkModal:M,onUnlink:()=>{j?B(void 0):x("")},onSelectValueChange:H=>{B(H),c(H)},value:h,allowTargetBlank:k,selectType:I,onValueChange:x,isTypeSelectEnabled:j,displayTextEnabled:S,onKeyDown(H){S||(H.key==="Enter"||H.key===" ")&&(M(),H.preventDefault())},onClick:()=>{S||M()},appearance:s},{searchDocuments:ge}=L();function he(H){if(H)return;const qe=t&&t.value.__TYPE__!=="AnyLink";!H&&!qe&&j&&B(void 0),c(void 0)}function Qe(H,qe){x(H,qe),c(void 0)}function Me(H){y(H),c(void 0)}function D(H){m(H),c(void 0)}return A.jsxs(A.Fragment,{children:[A.jsxs(r.Popover,{align:"start",sideOffset:-3,focusOnEnter:!1,open:l.debouncedValue,anchor:A.jsxs(r.Field,{variant:Rc(s),color:a,children:[v?A.jsx(qc,{documentId:h,displayTextEnabled:S}):A.jsx(r.FieldIcon,{name:We({selectType:I,displayTextEnabled:S})}),s!=="compact"&&A.jsx(r.FieldLabel,{htmlFor:o,children:Z(n)}),A.jsx(r.FieldControl,{children:v&&ge?A.jsx(Oc,{errorBoundaryRef:g,onError:C,fallback:A.jsx(Gt,{..._,value:"..."}),renderError:()=>Qc(_),children:A.jsx(Mc,{..._,documentId:h})}):A.jsx(Gt,{..._})})]}),children:[T&&A.jsx(ve,{url:T,title:te.getUrlTitle(T)??"",subTitle:T.toString()}),t&&K.FilledImageLinkContent.is(t.value)&&A.jsx(Xo,{url:t.value.url,title:t.value.name,subTitle:`${t.value.width} x ${t.value.height} pixels`})]}),A.jsx(Ec,{open:d==="web",onOpenChange:he,onUpdate:Qe,url:h,openInNewTab:b.isTargetNewTab,showNewTabButton:!!((z=n.config)!=null&&z.allowTargetBlank)}),A.jsx(jn,{open:d==="media",onOpenChange:he,onMediaSelected:Me,assetType:"all"}),A.jsx(No,{open:d==="document",onOpenChange:he,onSelectDocument:D,fixedCustomTypes:new Set((pe=n.config)==null?void 0:pe.customtypes),fixedTags:new Set((ot=n.config)==null?void 0:ot.tags),linkedDocumentId:t&&K.FilledDocumentLinkContent.is(t.value)?t.value.id:void 0})]})}function Rc(e){switch(e){case"compact":return"compact";case"normal":return"normal";default:return}}function Qc(e){return A.jsx(Gt,{...e})}function Gt(e){const{id:t,value:n,onOpenLinkModal:o,onBlur:i,isTypeSelectEnabled:s,selectType:a,onSelectValueChange:l,onUnlink:d,isTargetNewTab:c,allowTargetBlank:u,displayTextEnabled:h,displayText:g,onFocus:m,onClick:C,onKeyDown:y,appearance:x,placeholder:I,variants:B,variant:j,onVariantChange:S,onDisplayTextChange:b,onValueChange:v}=e;return A.jsx(r.Box,{padding:{block:4},width:"100%",children:A.jsx(Fe,{id:t,textOverflow:"ellipsis",variant:h?"normal":"link",readOnly:!h,placeholder:h?"Add your display text":I,padding:ei(x),value:h?g:n,cursor:ti({value:n,displayTextEnabled:h,isTypeSelectEnabled:s}),onBlur:i,onFocus:m,onClick:C,onKeyDown:y,onValueChange:h?b:v,endAdornment:A.jsx(Jo,{hasLink:!!(n&&a),onUnlink:d,selectEnabled:s,selectedType:a,value:n,onOpenLinkModal:o,onValueChange:l,openInNewTab:c,condensedButtons:x==="condensedButtons",showNewTabButton:u&&a==="web",displayTextEnabled:h,variants:B,variant:j,onVariantChange:S})})})}function Mc(e){const{id:t,documentId:n,onOpenLinkModal:o,isTypeSelectEnabled:i,selectType:s,displayTextEnabled:a,onSelectValueChange:l,onUnlink:d,onFocus:c,onClick:u,onKeyDown:h,appearance:g,variants:m,variant:C,displayText:y,onVariantChange:x,onDisplayTextChange:I}=e,B=vc(n),j=ni(n);return A.jsx(Fe,{id:t,textOverflow:"ellipsis",padding:ei(g),placeholder:a?"Add your display text":void 0,readOnly:!a,value:a?y:B,variant:a?"normal":"link",cursor:ti({value:B,displayTextEnabled:a,isTypeSelectEnabled:i}),onFocus:c,onClick:u,onKeyDown:h,onValueChange:a?I:void 0,endAdornment:A.jsxs(r.Box,{gap:4,children:[j&&A.jsx(r.Badge,{title:"Broken Link",color:"tomato"}),A.jsx(Jo,{hasLink:!0,onUnlink:d,selectEnabled:i,selectedType:s,value:B,onOpenLinkModal:o,condensedButtons:g==="condensedButtons",onValueChange:l,displayTextEnabled:a,variants:m,variant:C,onVariantChange:x})]})})}function qc(e){const{documentId:t,displayTextEnabled:n}=e;return A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(r.FieldIcon,{name:"warning"}),children:A.jsx(f.Suspense,{fallback:A.jsx(r.FieldIcon,{name:We({selectType:"document",displayTextEnabled:n})}),children:A.jsx(Pc,{documentId:t,displayTextEnabled:n})})})}function Pc(e){const{displayTextEnabled:t,documentId:n}=e;return ni(n)?A.jsx(r.FieldIcon,{name:"linkOff"}):A.jsx(r.FieldIcon,{name:We({selectType:"document",displayTextEnabled:t})})}function ei(e){switch(e){case"compact":return{input:{inline:4}};default:return}}function Oc(e){const{errorBoundaryRef:t,onError:n,children:o,fallback:i,renderError:s}=e;return A.jsx(r.ErrorBoundary,{ref:t,onError:n,renderError:s,children:A.jsx(f.Suspense,{fallback:i,children:o})})}function We(e){const{selectType:t,displayTextEnabled:n}=e;if(n)return"notes";switch(t){case"document":return"description";case"web":return"public";case"media":return"image";default:return"link"}}function ti(e){const{value:t,displayTextEnabled:n,isTypeSelectEnabled:o}=e;return n?"text":o&&!t?"default":"pointer"}function Vc(e){const{onContentChange:t,...n}=e;function o(i){const s=K.FilledLinkContent.is(i)?i:void 0;t(s)}return A.jsx(Fn,{...n,onContentChange:o})}function ni(e){const t=L();t.uidField||V("uidField");const{coreApiBaseUrl:n,authStrategy:o}=t,{data:i}=mn({baseUrl:n,authStrategy:o,documentIds:[e],statuses:["archived","unclassified","published"]});if(i.results.length===0||i.results.length>1)return!1;const s=i.results[0];return s==null?void 0:s.versions.every(a=>a.status==="archived")}function Yc(e){const{onDelete:t,isDeleteEnabled:n,onMoveUp:o,onMoveDown:i,isMoveUpEnabled:s,isMoveDownEnabled:a}=e;return A.jsxs(r.DropdownMenu,{children:[A.jsx(r.DropdownMenuTrigger,{children:A.jsx(r.IconButton,{hiddenLabel:"Link actions",icon:"moreVert",size:"small",variant:"solid"})}),A.jsxs(r.DropdownMenuContent,{children:[A.jsx(r.DropdownMenuLabel,{children:A.jsx(r.Text,{variant:"small",color:"grey11",children:"Item options"})}),A.jsx(r.DropdownMenuItem,{onSelect:o,startIcon:A.jsx(r.Icon,{name:"arrowUpward"}),disabled:!s,children:"Move up"}),A.jsx(r.DropdownMenuItem,{onSelect:i,startIcon:A.jsx(r.Icon,{name:"arrowDownward"}),disabled:!a,children:"Move down"}),A.jsx(r.DropdownMenuItem,{color:"tomato",onSelect:t,startIcon:A.jsx(r.Icon,{name:"delete",color:"tomato9"}),disabled:!n,children:"Delete"})]})]})}function Wc(e){const{field:t,content:n,onContentChange:o}=e,{config:i}=t,s=f.useMemo(()=>Mt({config:i}),[i]),a=n!=null&&n.value.length?n.value:[s];function l(g){const m=O.insertAtIndex(a,g,Mt({config:i}));o(Je(m))}function d(g,m){var x;const C=[...a],y=Mt({config:i,key:(x=C[m])==null?void 0:x.key});C[m]=g??y,o(Je(C))}function c(g){o(Je(g))}function u(g){const m=O.removeIndex(a,g);o(Je(m))}function h(g,m){const C=O.move(a,m,m+Hc(g));o(Je(C))}return{links:a,updateLink:d,updateLinks:c,addLink:l,deleteLink:u,moveLink:h}}function Hc(e){switch(e){case"up":return-1;case"down":return 1}}function Mt(e){const{config:t,key:n=crypto.randomUUID()}=e,o=_c(t==null?void 0:t.select);return t!=null&&t.allowText&&(o.text=""),{__TYPE__:"LinkContent",key:n,value:o}}function _c(e){switch(e){case"web":return{__TYPE__:"ExternalLink",kind:"web"};case"document":return{__TYPE__:"DocumentLink",kind:"document"};case"media":return{__TYPE__:"MediaLink",kind:"media"};default:return{__TYPE__:"AnyLink",kind:"any"}}}function Je(e){return{__TYPE__:"RepeatableContent",type:"Link",value:e}}function zc(e){const{id:t,field:n}=e,o=Wc(e),[i,s]=f.useState(!1),{links:a}=o;return A.jsx(pl,{children:A.jsxs(r.FieldSet,{id:t,legend:Nc(n.config),variant:"compact",selected:i,children:[A.jsx(Gc,{field:n,items:a,onItemDelete:o.deleteLink,onItemChange:o.updateLink,onItemMove:o.moveLink,onItemAdd:o.addLink,onItemReorder:o.updateLinks,onDragStatusChange:s}),A.jsx(r.Button,{startIcon:"add",color:"grey",onClick:()=>o.addLink(a.length),sx:{marginInline:4,marginBlock:4},children:"Add"})]})})}function Nc(e){return e!=null&&e.label?`Multiple • ${e.label}`:"Multiple"}function Gc(e){const{field:t,items:n,onItemChange:o,onItemDelete:i,onItemMove:s}=e,a=n.length>1,l=Zc(e);return A.jsx(r.AnimatedList,{items:n,getItemKey:d=>d.key,ariaLabel:"Link list",dnd:l,children:(d,c)=>A.jsxs(r.Draggable,{disabled:!a,children:[A.jsx(Fn,{appearance:"compact",content:d,field:t,onContentChange:u=>o(u,c),backgroundColor:"transparent"}),A.jsx(Yc,{onDelete:()=>i(c),isDeleteEnabled:n.length>1,onMoveUp:()=>s("up",c),isMoveUpEnabled:c>0,onMoveDown:()=>s("down",c),isMoveDownEnabled:c<n.length-1})]})})}function Zc(e){const{onDragStatusChange:t,onItemReorder:n,onItemAdd:o}=e,{scrollOffsetTop:i}=L(),s=E.useStableCallback(o);return{renderDropIndicator:l=>A.jsx(Jc,{...l,onItemAdd:s}),scrollOffsetTop:i,onDragChange:t,onReorder:n}}function Jc(e){const{isDropTarget:t,itemIndex:n,position:o,itemCount:i,onItemAdd:s}=e;return n===0&&o==="before"?A.jsx(Nn,{isDropTarget:t,position:"before"}):n===i-1&&o==="after"?A.jsx(Nn,{isDropTarget:t,position:"after"}):A.jsx(Xc,{index:n,isDropTarget:t,onItemAdd:s})}function Xc(e){const{index:t,onItemAdd:n,isDropTarget:o}=e,[i,s]=f.useState(0);function a(){n(t+1),s(l=>l+1)}return A.jsx(r.HairlineButton,{icon:"add",size:"small",variant:"rightDashed",tooltip:{content:"Add item below"},onClick:a,dropMode:o,sx:{marginInline:4}},i)}function Nn(e){const{isDropTarget:t,position:n}=e;return A.jsx(r.AnimatedElement,{enterDuration:150,animation:{name:"expand-vertical"},children:t&&A.jsx(r.Box,{children:A.jsx(r.Line,{color:"purple",thickness:2,sx:{width:"100%",marginBottom:n==="before"?4:void 0,marginTop:n==="after"?4:void 0}},"line")})})}function $c(e){const{linkTo:t,onLinkToChange:n}=e,o=ed(t);return A.jsx(Vc,{content:o,onContentChange:i=>n(td(i)),field:{type:"Link",config:{label:"Link",allowTargetBlank:!0,allowText:!1}},appearance:"condensedButtons"})}function ed(e){const[t]=f.useState(()=>crypto.randomUUID());if(e)return{__TYPE__:"LinkContent",key:t,value:e}}function td(e){return e==null?void 0:e.value}function Ai(e){var j,S;const{allContentViews:t,content:n,contentView:o,fieldLabel:i,imageLabel:s,initialImages:a,isUpdating:l,page:d=0,readOnly:c,thumbnailName:u,onClear:h,onContentChange:g,onCropperDialogClose:m,onPageChange:C,onMediaDialogOpenChange:y}=e,x=((S=(j=n==null?void 0:n.url)==null?void 0:j.split("?")[0])==null?void 0:S.slice(-4))===".svg",I=n!=null&&n.url&&!c?"visible":"hidden",B=!K.isImageContent(n);return A.jsxs(r.Box,{display:"flex",gap:12,padding:{inline:12},children:[A.jsx(r.Box,{children:A.jsx(r.Carousel,{getItemSource:ta,items:t,onPageChange:C,page:d,buttonSize:"small",renderPrevTooltip:b=>A.jsx(r.Tooltip,{content:"Previous",children:b}),renderNextTooltip:b=>A.jsx(r.Tooltip,{content:"Next",children:b}),style:B?{width:181,height:142}:{width:123,height:93},children:b=>(b==null?void 0:b.url)&&A.jsx(r.CarouselItem,{"aria-label":"Image Field Item",src:jo(b.url),alt:b.alt??void 0,isUpdating:l,disableAnimation:B},`${u}_${b.url}`)})}),A.jsxs(r.Box,{width:"100%",display:"flex",flexDirection:"column",gap:B?16:12,children:[A.jsx(Jl,{fieldLabel:i,imageLabel:s,initialImages:a,page:d,displaySeparator:!B,isSVGContentView:x,visibility:I,onClear:h,onCropperDialogClose:m,onMediaDialogOpenChange:y}),A.jsx(Zl,{readOnly:c||!o,altText:(o==null?void 0:o.alt)??"",onValueChange:b=>{o&&g(Js(u,n,o,b))}}),B&&A.jsx($c,{linkTo:n.linkTo,onLinkToChange:b=>{g({...n,linkTo:b})}})]})]})}function oi(e){const{onMediaSelected:t}=e,n=L(),{showAlert:o}=r.useAlert(),{mutate:i,isPending:s}=oe.useMutation({mutationFn:a=>so({file:a,config:n}),onSuccess:a=>{t(a)},onError:()=>{o({title:"Error uploading image",subtitle:"Please try again"})}});return{uploadImage:i,isUploadingImage:s}}function nd(e){const{content:t,onContentChange:n,field:o}=e,[i,s]=f.useState(0),[a,l]=f.useTransition(),d=Gs(o),c=d[i],u=t?Zs(o,t):void 0,h=u==null?void 0:u[i];function g(B){if(!c)return;const j=na(c.name,o,t,B);j!==t&&l(()=>n(j))}function m(B){l(()=>s(B))}function C({option:B,croppedImages:j}){if(s(B),!t)return;const S=Object.entries(j).reduce((b,[v,F])=>Wl({field:o,content:b,thumbnail:v,croppedImage:F}),t);S!==t&&l(()=>n(S))}function y(){s==null||s(0),n(void 0)}const{uploadImage:x,isUploadingImage:I}=oi({onMediaSelected:g});return{onCropperDialogClose:C,onPageChange:m,onMediaSelected:g,isUpdating:a,page:i,thumbnail:c,allThumbnails:d,allContentViews:u,contentView:h,onClear:y,uploadImage:x,isUploadingImage:I}}function Ad(e){const{content:t,field:n,readOnly:o,onContentChange:i}=e,s=t&&t.origin.url.length>0,{onCropperDialogClose:a,onPageChange:l,isUpdating:d,page:c,onMediaSelected:u,thumbnail:h,allThumbnails:g,allContentViews:m,contentView:C,onClear:y,uploadImage:x,isUploadingImage:I}=nd({field:n,content:t,onContentChange:i}),[B,j]=f.useState(!1),S=Z(n),b=g.map((k,M)=>{const _=m==null?void 0:m[M];return{thumbnail:k,contentView:_,labels:Ht(k,t,_)}}),v=h&&s?Ht(h,t,C).filter(ae.isDefined):[],F=h&&t&&s&&m,T=I||d;return A.jsx(Oo,{isMediaDialogOpen:B,onMediaSelected:u,onMediaDialogOpenChange:j,children:A.jsx(f.Suspense,{fallback:A.jsx("div",{style:{height:95}}),children:F?A.jsx(Ai,{allContentViews:m,content:t,contentView:C,fieldLabel:S,imageLabel:v,initialImages:b,isUpdating:T,page:c,readOnly:o,thumbnailName:h.name,onClear:y,onContentChange:i,onCropperDialogClose:a,onMediaDialogOpenChange:j,onPageChange:l}):A.jsx(Vo,{uploadImage:x,isUploading:I,disabled:o||B,children:A.jsx(Mo,{fieldLabel:S,isUpdating:T,readOnly:o,onMediaDialogOpenChange:j})})})})}function od(e){var x,I;const{searchTerm:t,catalogId:n}=e,o=L();o.integrationFields||V("integrationFields");const{integrationFieldsApiBaseUrl:i,repository:s,authStrategy:a}=o,[l,d]=f.useState(1),[c,u]=f.useState([]),[h,g]=f.useState(""),m=R.useRequest(id,[i,a,s,n,t,t===h?l:1]);t!==h?(g(t),d(1),u(m.items)):m.items.length>0&&((x=O.last(c))==null?void 0:x.id)!==((I=O.last(m.items))==null?void 0:I.id)&&u(B=>B.concat(m.items));const C=l<m.totalPages;function y(){C&&d(B=>B+1)}return{items:c,response:m,fetchNextPage:y,hasNextPage:C}}function id(e,t,n,o,i,s=1,a=30){const l=new URL(`if/search/${o}`,e);return l.searchParams.set("searchTerm",i),l.searchParams.set("limit",a.toString()),l.searchParams.set("page",s.toString()),U.request(l,{headers:{repository:n},credentials:U.getRequestCredentials(t),okType:rd})}const ii=p.z.object({id:p.z.string(),title:p.z.string(),imageURL:p.z.string().optional(),description:p.z.string().optional()}),rd=p.z.object({items:p.z.array(ii),totalPages:p.z.number(),page:p.z.number()});function ri(e){const{itemId:t,catalogId:n}=e,o=L();o.integrationFields||V("integrationFields");const{integrationFieldsApiBaseUrl:i,repository:s,authStrategy:a}=o,d=R.useRequest(sd,[i,a,s,n,t]).items[0];if(!d)throw new Error("Item not found");return{item:d}}function sd(e,t,n,o,i){const s=new URL(`if/read/${o}`,e);return s.searchParams.set("ids",[i].toString()),U.request(s,{headers:{repository:n},credentials:U.getRequestCredentials(t),okType:ad})}const ad=p.z.object({items:p.z.array(ii)});function Sn(e){const{item:t,onClick:n,catalogId:o}=e;return A.jsxs(r.PreviewCard,{variant:"large",onClick:n,children:[A.jsx(ld,{src:t.imageURL??"",alt:t.title}),A.jsxs(r.PreviewContent,{children:[A.jsx(r.Badge,{title:`Catalog: ${o}`,icon:"multipleStop",size:"medium"}),A.jsx(r.Text,{variant:"bold",color:"grey12",sx:{marginTop:4},children:t.title}),A.jsx(r.Text,{variant:"small",color:"grey11",children:t.description??t.id})]})]})}const lt=76;function ld(e){const{src:t,alt:n}=e;return t?A.jsx(r.PreviewImage,{src:t,alt:n,width:lt,height:lt,framed:!0}):A.jsxs(r.Box,{borderRadius:6,backgroundColor:"grey2",height:lt,width:lt,flexDirection:"column",alignItems:"center",justifyContent:"center",border:!0,padding:{inline:4,block:8},children:[A.jsx(r.Icon,{name:"hideImage",size:"large",color:"grey11"}),A.jsx(r.Text,{color:"grey11",variant:"small",noSelect:!0,align:"center",children:"No preview image"})]})}function Ve(){return A.jsxs(r.PreviewCard,{variant:"large",children:[A.jsx(r.Skeleton,{height:76,width:76}),A.jsxs(r.PreviewContent,{children:[A.jsx(r.Skeleton,{height:24,width:168}),A.jsx(r.Skeleton,{height:24,width:240,sx:{marginTop:4}}),A.jsx(r.Skeleton,{height:16,width:144})]})]})}function cd(e){const{open:t,onOpenChange:n,catalogId:o,onSelectItem:i}=e,s=E.useDebounceState({initialState:""}),a=L();return A.jsx(r.Dialog,{open:t,onOpenChange:n,hasClose:!1,size:{width:612,height:724},noDescription:!0,children:A.jsx(r.DialogContent,{children:A.jsxs(r.Box,{flexDirection:"column",height:"100%",children:[A.jsxs(r.Box,{padding:{top:16,inline:16},flexDirection:"column",gap:8,children:[A.jsx(r.FormSearchInput,{value:s.value,onValueChange:s.set,placeholder:"Search in your catalog"}),A.jsx(r.DialogTitle,{asChild:!0,children:A.jsx(r.Text,{variant:"smallBold",color:"grey11",children:"Select an item"})})]}),a.integrationFields?A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(Zt,{message:"There was an error while fetching your catalog items."}),children:A.jsx(f.Suspense,{fallback:A.jsxs(r.Box,{flexDirection:"column",gap:12,padding:{top:10,inline:16,bottom:16},children:[A.jsx(Ve,{}),A.jsx(Ve,{}),A.jsx(Ve,{}),A.jsx(Ve,{}),A.jsx(Ve,{})]}),children:A.jsx(dd,{searchTerm:s.debouncedValue,catalogId:o,onItemClick:i})})}):A.jsx(Zt,{message:"Slice Machine does not yet support mock data for integration field in the simulator."})]})})})}function dd(e){const{catalogId:t,searchTerm:n,onItemClick:o}=e,[i,s]=f.useTransition(),{items:a,hasNextPage:l,fetchNextPage:d}=od({catalogId:t,searchTerm:n});return A.jsx(A.Fragment,{children:A.jsxs(r.ScrollArea,{onScrollToBottom:()=>l&&s(d),style:{flexGrow:1,paddingTop:r.theme.space[10],paddingBottom:r.theme.space[16],paddingInline:r.theme.space[16],display:"flex",flexDirection:"column",gap:r.theme.space[12]},threshold:252,children:[a.length===0?A.jsx(Zt,{}):a.map(c=>A.jsx(Sn,{item:c,catalogId:t,onClick:()=>o(c)},c.id)),A.jsx(r.AnimatedElement,{animation:{name:"fade"},children:i&&A.jsx(r.Text,{color:"grey11",align:"center",sx:{marginBlock:8},children:"Loading more results ..."})})]})})}function Zt(e){const{message:t="We can't find any items matching your search"}=e,n="Oops!";return A.jsx(r.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:A.jsxs(r.BlankSlate,{children:[A.jsx(r.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),A.jsx(r.BlankSlateTitle,{size:"big",children:n}),A.jsx(r.BlankSlateDescription,{width:360,children:t})]})})}function ud(e){const{itemId:t,item:n}=e,o=L();return t&&n&&n.id===t?A.jsx(Ye,{...e,value:n.title}):t&&o.integrationFields?A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(Ye,{...e,value:t}),children:A.jsx(f.Suspense,{fallback:A.jsx(Ye,{...e,value:t}),children:A.jsx(pd,{...e,itemId:t})},t)},t):t&&!o.integrationFields?A.jsx(Ye,{...e,value:t}):A.jsx(Ye,{...e,value:""})}function gd(e){const{catalogId:t,itemId:n,item:o}=e,i=L();return n&&o&&o.id===n?A.jsx(r.FieldFooter,{children:A.jsx(Sn,{catalogId:t,item:o})}):n&&i.integrationFields?A.jsx(r.ErrorBoundary,{renderError:()=>null,children:A.jsx(r.FieldFooter,{children:A.jsx(f.Suspense,{fallback:A.jsx(Ve,{}),children:A.jsx(hd,{catalogId:t,itemId:n})},n)})},n):null}function hd(e){const{itemId:t,catalogId:n}=e,{item:o}=ri({catalogId:n,itemId:t});return A.jsx(Sn,{catalogId:n,item:o})}function Ye(e){const{id:t,field:n,readOnly:o,value:i,onFocus:s,onClearItem:a}=e;return A.jsx(Fe,{id:t,placeholder:De(n),readOnly:!0,variant:"link",value:i,...!o&&{cursor:"pointer",onFocus:s},endAdornment:A.jsx(r.Button,{startIcon:"close",color:"grey",size:"small",disabled:!i,onClick:a})})}function pd(e){const{itemId:t,catalogId:n}=e,{item:o}=ri({catalogId:n,itemId:t});return A.jsx(Ye,{...e,value:o.title})}function md(e){var m;const{id:t,field:n,content:o,readOnly:i,onContentChange:s}=e,[a,l]=f.useState(!1),[d,c]=f.useState(),u=(m=n.config)==null?void 0:m.catalog;if(!u)return null;function h(C){s({value:C.id,__TYPE__:"IntegrationFieldsContent"}),c(C),l(!1)}function g(){s(void 0),c(void 0)}return A.jsxs(A.Fragment,{children:[A.jsxs(r.Field,{footer:A.jsx(gd,{catalogId:u,item:d,itemId:o==null?void 0:o.value}),children:[A.jsx(r.FieldIcon,{name:"multipleStop"}),A.jsx(r.FieldLabel,{htmlFor:t,children:Z(n)}),A.jsx(r.FieldControl,{children:A.jsx(ud,{id:t,field:n,readOnly:i,catalogId:u,item:d,itemId:o==null?void 0:o.value,onFocus:()=>l(!0),onClearItem:g})})]}),A.jsx(cd,{open:a,onOpenChange:l,catalogId:u,onSelectItem:h})]})}function si(e){const{content:t,field:n,id:o,onContentChange:i,readOnly:s,endAdornment:a,placeholder:l}=e;return A.jsxs(r.Field,{children:[A.jsx(r.FieldIcon,{name:"notes"}),A.jsx(r.FieldLabel,{htmlFor:o,children:Z(n)}),A.jsxs(r.FieldControl,{children:[A.jsx(r.TextArea,{id:o,placeholder:l||De(n),readOnly:s,paddingLeft:4,paddingRight:12,sx:{flexGrow:1},value:(t==null?void 0:t.value)??"",onChange:d=>{i(fd(d))}}),a]})]})}function fd(e){return e.length===0?void 0:{__TYPE__:"FieldContent",type:"Text",value:e}}function Cd(e){var l;const{content:t,id:n,field:o,onContentChange:i,readOnly:s}=e,a={id:n,readOnly:s,onContentChange:i};return(l=o.config)!=null&&l.repeat?A.jsx(zc,{...a,field:o,content:hA(t)}):A.jsx(Fn,{...a,field:o,content:pA(t)})}const xd=({content:e,field:t,id:n,onContentChange:o,readOnly:i})=>{var l,d;const s=Number(e==null?void 0:e.value),a=Number.isFinite(s)?s:void 0;return A.jsxs(r.Field,{children:[A.jsx(r.FieldIcon,{name:"pin"}),A.jsx(r.FieldLabel,{htmlFor:n,children:Z(t)}),A.jsx(r.FieldControl,{children:A.jsx(r.NumberInput,{id:n,value:a,min:(l=t.config)==null?void 0:l.min,max:(d=t.config)==null?void 0:d.max,padding:Eo,placeholder:De(t),readOnly:i,onValueChange:c=>o(yd(c))})})]})};function yd(e){return e===void 0?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(e)}}function Bd(e){return e.type==="table"}const Te={...w.RichTextNodeType,table:"table"};function Id(e){return!!(e&&e.has(Te.table))}var Re=(e=>(e.Document="document",e.Mark="mark",e.Node="node",e))(Re||{}),Ke=(e=>(e.Text="text",e.Embed="embed",e.Image="image",e.Table="table",e))(Ke||{});class jd{constructor(t,n,o){W(this,"extType","document");this.name=t,this.component=n,this.converter=o}}class At{constructor(t,n,o,i,s,a=!1){W(this,"extType","node");W(this,"nodeType","text");this.richTextNodeTypes=t,this.name=n,this.component=o,this.converter=i,this.placeholder=s,this.lockedFormat=a}}function ai(e){return e instanceof At}class Fd{constructor(t,n,o,i){W(this,"extType","node");W(this,"nodeType","embed");this.richTextNodeTypes=t,this.name=n,this.component=o,this.converter=i}}class Sd{constructor(t,n,o,i){W(this,"extType","node");W(this,"nodeType","image");this.richTextNodeTypes=t,this.name=n,this.component=o,this.converter=i}}class bd extends At{constructor(t,n,o,i,s){super(t,"heading",n,i,s),this.levels=o}}class bn extends At{constructor(t,n,o,i){super(t,n,o,i)}}class Kd{constructor(t,n,o,i){W(this,"extType","node");W(this,"nodeType","table");this.richTextNodeTypes=t,this.name=n,this.component=o,this.converter=i}}function Ud(e){return e instanceof bn}const Ie={isHardBreak(e){return e.type.name===aA.name},children:{reduce(e,t,n){let o=n;return e.forEach((i,s,a)=>{o=t(o,i,a)}),o},map(e,t){return this.reduce(e,(n,o)=>[...n,t(o)],[])},exists(e,t){return this.reduce(e,(n,o)=>n||t(o),!1)},filter(e,t){return this.reduce(e,(n,o)=>[...n,...t(o)?[o]:[]],[])}},marks:{reduce(e,t,n){let o=n;return e.marks.forEach((i,s)=>{o=t(o,i,s)}),o},map(e,t){return this.reduce(e,(n,o)=>[...n,t(o)],[])},filter(e,t){return this.reduce(e,(n,o)=>[...n,...t(o)?[o]:[]],[])}}};function Td(e){if(!e||!(e!=null&&e.single)&&!(e!=null&&e.multi))return Gn();const t=wd(e);if(!t.size)return Gn();const n=Ld(t),o=vd(n,e);return{nodeTypes:t,extensions:o}}function wd(e){const n=(e.single||e.multi||"").split(/\s*,\s*/).map(o=>{if(o==="table")return o;const i=w.RichTextNodeTypeCodec.decode(o);return i._tag==="Right"?i.right:void 0}).filter(ae.isDefined);return new Set(n)}function Ld(e){return Di(e).filter(n=>ee.some(e,o=>n.richTextNodeTypes.includes(o)))}function vd(e,t){var o;const n=new Set(e);return ee.some(n,Ud)&&n.add(J),ee.some(n,ai)||n.add(J),(o=t==null?void 0:t.labels)!=null&&o.length&&n.add(wn),[...n]}function Gn(){return{extensions:Di(),nodeTypes:new Set(Ge.keys(w.RichTextNodeTypeCodec.keys))}}class kd{constructor(t,n,o){W(this,"extType",Re.Mark);W(this,"richTextNodeTypes",[w.RichTextNodeType.strong]);this.name=t,this.component=n,this.converter=o}}const li="bold",ci=rr.extend({name:li}),Ed={fromPrismic(e){return function(){var t;return(t=e.marks[ci.name])==null?void 0:t.create()}},toPrismic(){}},Dd=new kd(li,ci,Ed),Kn=Dd,di=nr.extend({name:"listItem",content:"paragraph*",addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name)}}}),Rd={fromPrismic(e){return function(t){var o;const n=J.converter.fromPrismic(e)(t);if(n)return(o=e.nodes[di.name])==null?void 0:o.create({},n)}},toPrismic(e,t){return Ie.children.reduce(e,(n,o)=>{const i=J.converter.toPrismic(o),s=(()=>i instanceof Array?i.map(a=>({...a,type:t})):i?[{...i,type:t}]:[])();return[...n,...s]},[])}},Ne={component:di,converter:Rd,placeholder:"List"};function Qd(e,t){return e.copy(e.content.append(t.content))}function Md(e){return e.reduce((t,n)=>{const o=(t[n.type]||[]).concat(n);return{...t,[n.type]:o}},{})}function Zn(e){return e.sort((t,n)=>t.start-n.start)}function qd(e){const t=Md(e),n=Object.entries(t).map(([o,i])=>Zn(i).reduce((a,l)=>{if(!a.length)return[l];const d=a.length-1,c=a[d];return c?c.end<l.start?[...a,l]:c.end>=l.end?a:[...a.slice(0,d),{...c,end:l.end}]:a},[])).flat();return Zn(n)}const pt=aA.extend({name:"hard_break"}),mt=`
|
|
38
|
-
`,ui={fromPrismic(e){return function(t){var n;if(t===mt)return(n=e.nodes[pt.name])==null?void 0:n.create({})}},toPrismic(e){if(e.type.name===pt.name)return mt}},qt={isEmptyLine(e){return e.length===0},isFirst(e){return e===0}};function Pd(e,t){return function(n){const o=ui.fromPrismic(e)(mt);if(!o)return[n(t)];const i=t.split(mt);return i.length===1?t.length?[n(t)]:[o]:i.reduce((s,a,l)=>qt.isFirst(l)?qt.isEmptyLine(a)?s:[...s,n(a)]:qt.isEmptyLine(a)?[...s,o]:[...s,o,n(a)],[])}}const Od={name:pt.name,component:pt,converter:ui,splitTextToNodes:Pd},ft=Od,gi={fromPrismic(e){return t=>{switch(t.type){case"hyperlink":return Ti.converter.fromPrismic(e)(t);case"em":return Tn.converter.fromPrismic(e)(t);case"strong":return Kn.converter.fromPrismic(e)(t);case"label":return wn.converter.fromPrismic(e)(t);case"list-item":return}}},toPrismic(e,t,n){const o=Ei.find(i=>e.type.name===i.name);if(!o)throw new Error(`Invalid mark extension '${e.type.name}'.`);switch(o.name){case"bold":return{type:"strong",start:t,end:n};case"em":return{type:o.name,start:t,end:n};case"hyperlink":return{type:o.name,start:t,end:n,data:o.converter.toPrismic(e)};case"label":return{type:o.name,start:t,end:n,data:o.converter.toPrismic(e)}}}},Vd={strong:"bold",label:"label",em:"em",hyperlink:"hyperlink","list-item":void 0},Jn=ir.extend({name:"text"}),Yd={fromPrismic(e){return function(t,n,o=!1){const i={type:t,text:n.content.text,spans:n.content.spans||[]};return or.serialize([i],Wd(e,o)).flat()}},toPrismic(e,t,n){const o=Ie.children.reduce(e,(i,s)=>{const a=(()=>s.type.name===ft.name?ft.converter.toPrismic(s):s.textContent)(),l=a?i.text+a:i.text,d=i.text.length,c=l.length,u=(()=>s.marks.length?Ie.marks.map(s,g=>gi.toPrismic(g,d,c)):void 0)();return{...i,text:l,spans:u?[...i.spans,...u]:i.spans}},{text:"",spans:[]});return{type:t,content:{text:o.text,spans:[...qd(o.spans)].sort((i,s)=>i.type.localeCompare(s.type))},...n}}};function Wd(e,t=!1){return(n,o,i,s)=>{if(n==="span"&&i&&i.length)return t?[e.text(i)]:ft.splitTextToNodes(e,i)(d=>e.text(d));const a=gi.fromPrismic(e)(o);return a?Hd(a,s):s.flat()}}function Hd(e,t){return t.flat().map(o=>{const s=[...o.marks,e].sort((a,l)=>a.type.name.localeCompare(l.type.name));return o.mark(s)})}const _d={name:Jn.name,component:Jn,converter:Yd},ke=_d,Un="document";function zd(e){return tr.extend({name:Un,content:e?"block+":"block"})}function Nd(e){return{fromPrismic(t,n,o){var s;const i=o.value.reduce((a,l)=>{const{extension:d,block:c}=Xd(e,l,t,n),u=Zd({extension:d,block:c,schema:t}),h=a.slice(0,a.length-1),g=O.last(a),m=Jd({node:u,previousNode:g});return m.updatedNode?[...m.merged?h:a,m.updatedNode]:a},[]);return(s=t.nodes[Un])==null?void 0:s.create({},i)},toPrismic(t){return{__TYPE__:"StructuredTextContent",value:[...Ie.children.reduce(t,(o,i)=>{const s=Object.values(e).find(l=>i.type.name===l.name),a=s==null?void 0:s.converter.toPrismic(i);return a||console.warn(`Cannot convert node of type '${i.type.name}'.`),a?[...o,...a instanceof Array?a:[a]]:o},[])]}}}}const Gd=new jd(Un,zd,Nd),Jt=Gd;function Zd(e){const{extension:t,block:n,schema:o}=e;if(t)switch(t.nodeType){case Ke.Embed:return K.EmbedBlock.is(n)?t.converter.fromPrismic(o)(n):void 0;case Ke.Text:return K.TextBlock.is(n)?t.converter.fromPrismic(o)(n):void 0;case Ke.Image:return K.ImageBlock.is(n)?t.converter.fromPrismic(o)(n):void 0;case Ke.Table:return Bd(n)?t.converter.fromPrismic(o)(n):void 0}}function Jd(e){const{node:t,previousNode:n}=e;return!t||!n?{merged:!1,updatedNode:t}:t.type.name===n.type.name&&(t.type.name===xt.name||t.type.name===Bt.name)?{merged:!0,updatedNode:Qd(n,t)}:{merged:!1,updatedNode:t}}function Xd(e,t,n,o){var l;const i=e.find(d=>d.richTextNodeTypes.includes(t.type)&&o.has(t.type));if(i)return{extension:i,block:t};if(!K.TextBlock.is(t))return{extension:void 0,block:t};const s=e.find(d=>ai(d)&&d.name in n.nodes),a=(l=t.content.spans)==null?void 0:l.filter(d=>{const c=Vd[d.type];return c&&c in n.marks});return{extension:s,block:{...t,content:{text:t.content.text,spans:a}}}}const dt="ltr",Ue="rtl",Ce="dir",Xn=w.RichTextNodeType.rtl,$d=X.Extension.create({name:"textDirection",addOptions(){return{supportedExtensionNames:[]}},addGlobalAttributes(){return[{types:this.options.supportedExtensionNames,attributes:{[Ce]:{default:dt,parseHTML:e=>e.getAttribute(Ce),renderHTML:e=>({[Ce]:Xt(e[Ce])})}}}]},addCommands(){return{setDirection:e=>({commands:t})=>{switch(e){case dt:return t.setLeftToRight();case Ue:return t.setRightToLeft()}},toggleDirection:e=>({commands:t})=>{const n=e===Ue?dt:Ue;return t.setDirection(n)},setRightToLeft:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.updateAttributes(t,{[Ce]:Ue})),setLeftToRight:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.resetAttributes(t,Ce))}},addKeyboardShortcuts(){return{"Mod-Shift-r":()=>this.editor.commands.setRightToLeft(),"Mod-Shift-l":()=>this.editor.commands.setLeftToRight()}}}),xe={parseNodeAttrsDirection(e){return Xt(e[Ce])},fromPrismic(e){return{[Ce]:Xt(e.direction)}},toPrismic(e){return{direction:this.parseNodeAttrsDirection(e.attrs)}}};function Xt(e){return e===Ue?Ue:dt}const Ct=Ar.extend({name:"paragraph",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",X.mergeAttributes(this.options.HTMLAttributes,e),0]}}),eu={fromPrismic(e){return function(t){var o;const n=ke.converter.fromPrismic(e)(Ct.name,t);return(o=e.nodes[Ct.name])==null?void 0:o.create(xe.fromPrismic(t),n)}},toPrismic(e){return ke.converter.toPrismic(e,w.RichTextNodeType.paragraph,xe.toPrismic(e))}},tu=new At([w.RichTextNodeType.paragraph],Ct.name,Ct,eu,"Type '/' for commands"),J=tu,nu=e=>hr.configure({includeChildren:!0,placeholder:t=>Au(t,e),showOnlyCurrent:!1,showOnlyWhenEditable:!1});function Au(e,t){const{editor:n,hasAnchor:o,pos:i,node:s}=e,{placeholderByNodeType:a,unfocusedPlaceholder:l,nodeExtensions:d}=t,c=!Ie.children.exists(n.state.doc,B=>B===s),u=n.isEditable;if(l&&!n.isFocused&&n.isEmpty&&i===0)return l;const h=s.type.name!==J.name,g=n.isFocused&&o||h||c,m=d.filter(B=>B!==J).length>1;function C(B){return B===J.placeholder?u&&g&&m:u&&g}function y(){if(c)return Ne.placeholder;const B=a[s.type.name];return typeof B=="string"?B:B==null?void 0:B(s.attrs)}const x=y();return C(x)&&x||""}const hi=["ArrowDown","ArrowUp","End","Home"],pi=["Enter"],ou=["Escape",...hi,...pi],iu=X.Extension.create({name:"slash-commands",addOptions(){return{nodeTypes:[]}},addProseMirrorPlugins(){const e=ut(Ri,this.options.nodeTypes);return e.length>1?[pr.Suggestion({allowSpaces:!0,char:"/",editor:this.editor,startOfLine:!0,allow:({state:t})=>{const n=t.selection.$from;return n.parent.type.name===J.name&&n.depth===1},command:({editor:t,props:n,range:o})=>{n.runCommands(t,{deleteRange:o})},items:({query:t})=>{const n=t.toLocaleLowerCase().trim();return e.filter(o=>{var i,s;return((i=o.shortText)==null?void 0:i.toLocaleLowerCase().includes(n))||((s=o.text)==null?void 0:s.toLocaleLowerCase().includes(n))})},render:()=>{let t;return{onStart:n=>{t=new ne.ReactRenderer(ru,{editor:n.editor,props:n}),document.body.appendChild(t.element)},onUpdate:n=>{t==null||t.updateProps(n)},onKeyDown:({event:n})=>{var o;return!!(ou.includes(n.key)&&((o=t==null?void 0:t.ref)!=null&&o.handleKeyDown(n)))},onExit:()=>{t==null||t.destroy(),t==null||t.element.remove()}}}})]:[]}}),ru=f.forwardRef(function(t,n){const{command:o,decorationNode:i,editor:s,items:a}=t,[l,d]=f.useState(!0),{context:c,floating:u,reference:h,x:g,y:m}=ce.useFloating({middleware:[ce.offset(0),ce.flip(),ce.shift({limiter:ce.limitShift()})],onOpenChange:d,open:l,placement:"top-start",strategy:"fixed",whileElementsMounted:ce.autoUpdate});f.useLayoutEffect(()=>{h(i)},[h,i]),f.useEffect(()=>{let F;const T=()=>{F=window.setTimeout(()=>{d(!0)})},k=()=>{d(!1)};return s.on("focus",T).on("blur",k),()=>{s.off("focus",T).off("blur",k),clearTimeout(F)}},[s]);const[C,y]=f.useState(0),x=f.useRef([]);E.useOnChange(a,()=>{y(0),x.current=[]});const{getFloatingProps:I,getItemProps:B,getReferenceProps:j}=ce.useInteractions([ce.useDismiss(c,{outsidePointerDown:!1}),ce.useListNavigation(c,{activeIndex:C,listRef:x,onNavigate:F=>{y(T=>F??T)},openOnArrowKeyDown:!1,virtual:!0}),ce.useRole(c,{role:"menu"})]),b=j().onKeyDown;f.useImperativeHandle(n,()=>({handleKeyDown:F=>{if(l){if(hi.includes(F.key)&&b(F),pi.includes(F.key)){const T=a[C];T!==void 0&&o(T)}return!0}else return!1}}),[C,o,a,b,l]);const v=g!==null&&m!==null;return l?A.jsxs(r.Box,{...I(),minWidth:256,backgroundColor:"grey1",border:!0,borderStyle:"solid",borderRadius:6,flexDirection:"column",ref:u,top:0,left:0,position:"fixed",transform:v?`translate3d(${Math.round(g)}px, ${Math.round(m)}px, 0)`:"translate3d(0, -200%, 0)",overflow:"hidden",children:[a.map((F,T)=>{const k=B({onClick:()=>{o(F)},onPointerDown:M=>{M.preventDefault()}});return f.createElement($n,{...k,key:F.nodeType,ref:M=>{x.current[T]=M},active:T===C,isFirstItem:T===0,isLastItem:T===a.length-1,shortcut:`/${F.shortText??""}`},F.text)}),a.length===0&&A.jsx($n,{...B({onPointerDown:F=>{F.preventDefault()}}),disabled:!0,ref:F=>{x.current[0]=F},children:"No results"})]}):null}),$n=f.forwardRef(function(t,n){const{children:o,disabled:i=!1,shortcut:s,active:a=!1,isFirstItem:l=!1,isLastItem:d=!1,...c}=t;return A.jsx("div",{...c,role:"button",style:{cursor:i?"default":"pointer"},ref:n,children:A.jsxs(r.Box,{alignItems:"center",height:32,flexDirection:"row",gap:8,padding:8,backgroundColor:a?"grey4":"inherit",justifyContent:"space-between",opacity:i?.5:1,children:[A.jsx(r.Text,{color:"grey12",component:"span",children:o}),s&&A.jsx(r.Text,{color:"inherit",component:"span",variant:"small",children:s})]})})});function su(e,t){var d,c;const n=t.map(u=>u.richTextNodeTypes).flat(),i={placeholderByNodeType:au(t),unfocusedPlaceholder:(d=e.config)==null?void 0:d.placeholder,nodeExtensions:t},s=n.includes(Te.orderedList)||n.includes(Te.list),a=!n.includes(Te.table);return[Jt.component(((c=e.config)==null?void 0:c.single)===void 0),ke.component,ft.component,a?nu(i):void 0,s?Ne.component:void 0,iu.configure({nodeTypes:n})].filter(ae.isDefined)}function au(e){return e.reduce((t,n)=>(n.nodeType===Ke.Text&&(t[n.name]=n.placeholder),t),{})}const $t=sr.extend({name:"bulletList",parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",X.mergeAttributes(this.options.HTMLAttributes,e),0]}}).configure({itemTypeName:"listItem"}),lu={fromPrismic(e){return function(t){var o;const n=Ne.converter.fromPrismic(e)(t);if(n)return(o=e.nodes[$t.name])==null?void 0:o.create(xe.fromPrismic(t),n)}},toPrismic(e){return Ie.children.map(e,t=>Ne.converter.toPrismic(t,w.RichTextNodeType.list).filter(ae.isDefined)).flat()}},cu=new bn([w.RichTextNodeType.list],$t.name,$t,lu),xt=cu,yt=ar.extend({name:"preformatted",addAttributes(){return{language:{default:null,parseHTML:e=>{var s;const{languageClassPrefix:t}=this.options,i=[...((s=e.firstElementChild)==null?void 0:s.classList)||[]].filter(a=>a.startsWith(t)).map(a=>a.replace(t,""))[0];return i||null},renderHTML:e=>e.language?{class:this.options.languageClassPrefix+e.language}:null}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({HTMLAttributes:e}){return["pre",X.mergeAttributes(this.options.HTMLAttributes),["code",e,0]]}}).configure({exitOnTripleEnter:!1}),du={fromPrismic(e){return function(t){var o;const n=ke.converter.fromPrismic(e)(yt.name,t,!0);return(o=e.nodes[yt.name])==null?void 0:o.create(xe.fromPrismic(t),n)}},toPrismic(e){return ke.converter.toPrismic(e,w.RichTextNodeType.preformatted,xe.toPrismic(e))}},uu=new At([w.RichTextNodeType.preformatted],yt.name,yt,du,"",!0),mi=uu;function fi(e){const{editor:t,getPos:n,node:o}=e,[i,s]=f.useState(!1);return f.useEffect(()=>{function a(){const{from:d,to:c}=t.state.selection,u=n(),h=n()+o.nodeSize,g=d<=u&&c>=h;s(g)}function l(){s(!1)}return t.on("blur",l),t.on("selectionUpdate",a),()=>{t.off("blur",l),t.off("selectionUpdate",a)}},[t,n,o.nodeSize]),{selected:i}}function gu(e,t,n){const{node:o}=e,i=o.attrs.content,s=E.useStableCallback(e.updateAttributes),a=E.useDebounceState({initialState:(i==null?void 0:i.embed_url)??"",startTransition:f.startTransition});function l(u){s({content:u})}function d(u){a.set(u),te.toURL(u)||l(void 0)}const{onKeyDown:c}=hu(e,a.value,t,n);return{inputRef:t,containerRef:n,onKeyDown:c,url:a.value,urlChanged:d,onContentChange:l,debouncedUrl:a.debouncedValue,content:e.node.attrs.content}}function hu(e,t,n,o){const{editor:i,getPos:s,node:a}=e,[l,d]=f.useState(!0);f.useEffect(()=>{!l||!e.editor.isFocused||r.handleEditorFlushSyncError(()=>{var u;return(u=n.current)==null?void 0:u.focus()})},[n,l,e.editor.isFocused]);function c(u){const h=s(),g=s()+a.nodeSize;u.code==="Enter"&&(d(!1),i.chain().insertContentAt(g,{type:"paragraph"}).focus(g+1).run()),u.code==="Backspace"&&t===""&&i.chain().deleteRange({from:h,to:g}).focus(g+1).run(),u.code==="ArrowUp"&&(d(!1),i.chain().focus(h-1).run()),u.code==="ArrowDown"&&(d(!1),i.chain().focus(g+1).run())}return{containerRef:o,inputRef:n,onKeyDown:c}}function pu(e){const t=f.useRef(null),n=f.useRef(null),{onKeyDown:o,url:i,urlChanged:s,onContentChange:a,debouncedUrl:l,content:d}=gu(e,t,n),{selected:c}=fi(e);return A.jsx(ne.NodeViewWrapper,{className:"custom-embed",children:A.jsxs("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:[A.jsxs(r.Box,{flexGrow:1,alignItems:"center",children:[A.jsx(r.Icon,{size:"small",name:"cloud",color:"grey11"}),A.jsx(r.Box,{flexGrow:1,height:40,ref:n,children:A.jsx(Fe,{id:"id",ref:t,value:i,variant:te.toURL(i)?"link":"normal",placeholder:"Paste your link here",onValueChange:s,onKeyDown:o})})]}),te.toURL(i)&&A.jsx(Do,{selected:c,debouncedUrl:l,onContentChange:a,content:d})]})})}const en=X.Node.create({name:"embed",group:"block",atom:!0,content:"block*",marks:"",addAttributes(){return{content:{default:void 0}}},addCommands(){return{setEmbed:()=>({tr:e,dispatch:t})=>{const n=this.type.create();return t&&e.replaceSelectionWith(n),!0}}},parseHTML(){return[{tag:"embed"}]},renderHTML(){return["embed"]},addNodeView(){return ne.ReactNodeViewRenderer(pu)}}),mu={fromPrismic(e){return function(t){var n;return(n=e.nodes[en.name])==null?void 0:n.create({content:t.data})}},toPrismic(e){return e.attrs.content===void 0?{type:"embed",data:{type:"embed",embed_url:"",__TYPE__:"EmbedContent",all:[]}}:{type:"embed",data:{...e.attrs.content}}}},Ci=new Fd([w.RichTextNodeType.embed],en.name,en,mu),tn="heading";function Lt(e){switch(e){case 1:return w.RichTextNodeType.heading1;case 2:return w.RichTextNodeType.heading2;case 3:return w.RichTextNodeType.heading3;case 4:return w.RichTextNodeType.heading4;case 5:return w.RichTextNodeType.heading5;case 6:return w.RichTextNodeType.heading6}}function eA(e){return{fullName:Lt(e),level:e}}const xi=[1,2,3,4,5,6];function yi(e,t=xi){const n=new RegExp(`^heading([${t.join(",")}]){1}$`),o=e.match(n);if(!o||!o[1])return;const i=parseInt(o[1]);return{fullName:Lt(i),level:i}}function Bi(e,t){const n=e.level;if(t.includes(n))return{fullName:Lt(n),level:n}}const fu=e=>{const t=e[0]??1;return{fromPrismic(n){return function(o){var a;const i=ke.converter.fromPrismic(n)(tn,o),s=yi(o.type,e)||eA(t);return(a=n.nodes[tn])==null?void 0:a.create({level:s.level,...xe.fromPrismic(o)},i)}},toPrismic(n){const{fullName:o}=Bi(n.attrs,e)||eA(t);return ke.converter.toPrismic(n,o,xe.toPrismic(n))}}};function Cu(e){return e?e.size?Array.from(e.values()).reduce((n,o)=>{const i=yi(o);return i?[...n,i.level]:n},[]).sort((n,o)=>n-o):[]:xi}function xu(e){return lr.extend({name:"heading"}).configure({levels:e})}const be={name:tn,build:e=>{const t=Cu(e);if(!t)return;const n=t.map(o=>Lt(o));return new bd(n,xu(t),t,fu(t),o=>{const i=Bi(o,t);return i&&`Heading ${i.level}`})}};function yu(e){const{content:t,thumbnail:n,imageViewProps:{getPos:o,updateAttributes:i,editor:s,node:a}}=e,[l,d]=f.useTransition();function c(y){d(()=>i({content:y}))}function u(y){const x=ct(y),I=o()+a.nodeSize;c({...t,...x}),s.chain().focus(I+1).run()}function h({croppedImages:y}){if(!t)return;const x=y[n.name];if(!x)return;const I=Wo({content:t,croppedImage:x});I!==t&&c(I)}function g(){const y=o(),x=o()+a.nodeSize;s.chain().deleteRange({from:y,to:x}).focus(x).run()}const{uploadImage:m,isUploadingImage:C}=oi({onMediaSelected:u});return{onMediaSelected:u,onCropperDialogClose:h,isUpdating:l,updateContent:c,onClear:g,uploadImage:m,isUploadingImage:C}}function Bu(e){const{node:t}=e,n=t.attrs.content,{selected:o}=fi(e),i=f.useRef(null),s={width:void 0,height:void 0,name:Ze},{onMediaSelected:a,onCropperDialogClose:l,isUpdating:d,updateContent:c,onClear:u,uploadImage:h,isUploadingImage:g}=yu({content:n,thumbnail:s,imageViewProps:e}),[m,C]=f.useState(!1),y="Feature image",x=(n==null?void 0:n.width)===0&&(n==null?void 0:n.height)===0,I=n&&!x?[`${n.width}×${n.height}px`]:[],B={thumbnail:s,contentView:n,labels:Ht(s,n,n)};f.useLayoutEffect(()=>{var b;const S=(b=i==null?void 0:i.current)==null?void 0:b.closest(`.${Ii}`);cr.isHTMLElement(S)&&S.style.removeProperty("min-height")},[]);const j=g||d;return A.jsx(ne.NodeViewWrapper,{children:A.jsx(Oo,{ref:i,isMediaDialogOpen:m,selected:o,onMediaSelected:a,onMediaDialogOpenChange:C,children:A.jsx(f.Suspense,{fallback:Fu,children:n!=null&&n.url?A.jsx(Ai,{allContentViews:[n],content:n,contentView:n,fieldLabel:y,imageLabel:I,initialImages:[B],isUpdating:j,readOnly:!1,thumbnailName:s.name,onClear:u,onContentChange:c,onCropperDialogClose:l,onMediaDialogOpenChange:C}):A.jsx(Vo,{uploadImage:h,isUploading:g,disabled:m,children:A.jsx(Mo,{fieldLabel:y,isUpdating:j,readOnly:!1,onMediaDialogOpenChange:C})})})})})}const Ii="imageViewNodeWrapper",ji=144,Iu=94;function ju(e){return(e?Iu:ji)+12+12+1+1}const Fu=A.jsx("div",{style:{height:ji}}),nn=X.Node.create({name:"image",group:"block",atom:!0,addAttributes(){return{content:{default:void 0}}},addCommands(){return{setImage:()=>e=>{const{dispatch:t,tr:n}=e,o=this.type.create();return t&&n.replaceSelectionWith(o),!0}}},parseHTML(){return[{tag:"image"}]},renderHTML({HTMLAttributes:e}){return["image",e]},addNodeView(){return function(t){const n=t.node.attrs.content===void 0;return ne.ReactNodeViewRenderer(Bu,{attrs:{style:`min-height: ${ju(n)}px`,class:Ii}})(t)}}}),Su={fromPrismic(e){return function(t){var n;return(n=e.nodes[nn.name])==null?void 0:n.create({content:t.data})}},toPrismic(e){if(e.attrs.content!==void 0)return{type:"image",data:{...e.attrs.content}}}},Fi=new Sd([w.RichTextNodeType.image],nn.name,nn,Su);class bu{constructor(t,n,o){W(this,"extType",Re.Mark);W(this,"richTextNodeTypes",[w.RichTextNodeType.em]);this.name=t,this.component=n,this.converter=o}}const Si="em",bi=dr.extend({name:Si}),Ku={fromPrismic(e){return function(){var t;return(t=e.marks[bi.name])==null?void 0:t.create()}},toPrismic(){}},Uu=new bu(Si,bi,Ku),Tn=Uu;class Tu{constructor(t,n,o){W(this,"extType",Re.Mark);W(this,"richTextNodeTypes",[]);this.name=t,this.component=n,this.converter=o}}const Ki="label",An=X.Mark.create({name:Ki,priority:1e3,keepOnSplit:!1,inclusive:!1,addOptions(){return{htmlAttributes:{style:"background-color: hsl(251, 89%, 96%); border: 1px dashed rgba(68, 53, 146, 0.4); border-radius: 0px 2px 2px 2px"}}},addAttributes(){return{label:{default:""}}},addCommands(){return{setLabel:e=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,e).run(),unsetLabel:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},renderHTML({HTMLAttributes:e}){return["span",X.mergeAttributes(this.options.htmlAttributes,e),0]}}),wu={fromPrismic(e){return function(t){var i;const n=t.data,o={type:An.name,label:n};return(i=e.marks[An.name])==null?void 0:i.create(o)}},toPrismic(e){return e.attrs.label}},wn=new Tu(Ki,An,wu);class Lu{constructor(t,n,o){W(this,"extType",Re.Mark);W(this,"richTextNodeTypes",[w.RichTextNodeType.hyperlink]);this.name=t,this.component=n,this.converter=o}}const Ui="hyperlink",fe=X.Mark.create({name:Ui,priority:1e3,keepOnSplit:!1,inclusive:!1,addOptions(){return{openOnClick:!1,linkOnPaste:!0,autolink:!0,protocols:[],htmlAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null,id:""},validate:void 0}},addAttributes(){return{href:{default:""},id:{default:""},target:{default:"_blank"},rel:{default:"noopener noreferrer nofollow"},class:{default:null},media:{default:null}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:e}){return["a",X.mergeAttributes(this.options.htmlAttributes,e),0]},addCommands(){return{setWebLink:e=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,e).setMeta("preventAutolink",!0).run(),setDocumentLink:e=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,e).setMeta("preventAutolink",!0).run(),setMediaLink:e=>({chain:t})=>{const n=on($o({media:e.media}).value);return t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,{media:n}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}}}),vu={fromPrismic(e){return function(t){var o,i,s,a;const n=t.data;if(n.__TYPE__==="DocumentLink"){const l={type:fe.name,id:n.id};return(o=e.marks[fe.name])==null?void 0:o.create(l)}if(n.__TYPE__==="ImageLink"){const l={type:fe.name,media:on(n)};return(i=e.marks[fe.name])==null?void 0:i.create(l)}if(n.__TYPE__==="FileLink"){const l={type:fe.name,media:on(n)};return(s=e.marks[fe.name])==null?void 0:s.create(l)}if(n.__TYPE__==="ExternalLink"){const l={type:fe.name,url:n.url,href:n.url,target:n.target};return(a=e.marks[fe.name])==null?void 0:a.create(l)}}},toPrismic(e){return e.attrs.media?wi(e.attrs.media):e.attrs.id?{__TYPE__:"DocumentLink",id:e.attrs.id}:{__TYPE__:"ExternalLink",url:e.attrs.href,target:e.attrs.target}}},Ti=new Lu(Ui,fe,vu);function on(e){return JSON.stringify(e)}function wi(e){return JSON.parse(e)}const rn=ur.extend({name:"orderedList",addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",X.mergeAttributes(this.options.HTMLAttributes,n),0]:["ol",X.mergeAttributes(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}}}).configure({itemTypeName:"listItem"}),ku={fromPrismic(e){return function(t){var o;const n=Ne.converter.fromPrismic(e)(t);if(n)return(o=e.nodes[rn.name])==null?void 0:o.create(xe.fromPrismic(t),n)}},toPrismic(e){return Ie.children.map(e,t=>Ne.converter.toPrismic(t,w.RichTextNodeType.orderedList).filter(ae.isDefined)).flat()}},Eu=new bn([w.RichTextNodeType.orderedList],rn.name,rn,ku),Bt=Eu;function Du({editor:e}){const t=e.isActive("table")&&e.isActive("innerTable");return A.jsxs(ne.NodeViewWrapper,{className:r.tableFieldStyles.tableWithControls,children:[A.jsx(ne.NodeViewContent,{className:r.tableFieldStyles.tableContent}),A.jsx("button",{type:"button",className:r.tableFieldStyles.addTableRowButton,onClick:e.commands.addRowEnd,"aria-disabled":!t,"aria-label":"Add row",title:"Add row",children:A.jsx(r.Icon,{name:"add",size:"small"})}),A.jsx("button",{type:"button",className:r.tableFieldStyles.addTableColumnButton,onClick:e.commands.addColumnEnd,"aria-disabled":!t,"aria-label":"Add column",title:"Add column",children:A.jsx(r.Icon,{name:"add",size:"small"})})]})}function vt(e,t){const n=e.nodes[t];if(!n)throw new Error(`Unwanted state: ${t} not found in schema.`);return n}function Li(e){return t=>{switch(t.type){case"hyperlink":case"paragraph":case"strong":case"em":return J.converter.fromPrismic(e)(t)||[];default:return[]}}}const tA={fromPrismic(e){return function(t){return vt(e,lA.TableCell.name).create({colspan:1,rowspan:1,colwidth:null},t.content.value.flatMap(Li(e)))}},toPrismic(e){const t=[];return e.content.forEach(n=>{const o=J.converter.toPrismic(n);K.TextBlock.is(o)&&t.push(o)}),{type:"tableCell",content:{__TYPE__:"StructuredTextContent",value:t}}}},nA={fromPrismic(e){return function(t){return vt(e,cA.TableHeader.name).create({colspan:1,rowspan:1,colwidth:null},t.content.value.flatMap(Li(e)))}},toPrismic(e){const t=[];return e.content.forEach(n=>{const o=J.converter.toPrismic(n);K.TextBlock.is(o)&&t.push(o)}),{type:"tableHeader",content:{__TYPE__:"StructuredTextContent",value:t}}}},AA={fromPrismic(e){return function(t){return vt(e,dA.TableRow.name).create({},t.content.map(o=>{switch(o.type){case"tableHeader":return nA.fromPrismic(e)(o);case"tableCell":return tA.fromPrismic(e)(o)}}))}},toPrismic(e){const t=[];return e.content.forEach(n=>{switch(n.type.name){case"tableHeader":{t.push(nA.toPrismic(n));break}case"tableCell":{t.push(tA.toPrismic(n));break}}}),{type:"tableRow",content:t}}},sn=gr.Table.extend({name:"innerTable",group:"table",addNodeView(){return({node:e})=>new Se.TableView(e,120)},addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),addRowEnd:()=>({dispatch:t,state:n})=>{if(!Se.isInTable(n))return!1;if(t){const o=Se.selectedRect(n),i=o.map.height;t(Se.addRow(n.tr,o,i))}return!0},addColumnEnd:()=>({dispatch:t,state:n})=>{if(!Se.isInTable(n))return!1;if(t){const o=Se.selectedRect(n),i=o.map.width;t(Se.addColumn(n.tr,o,i))}return!0}}}}),Ru={fromPrismic(e){return function(t){const o=vt(e,sn.name).create({},t.content.map(AA.fromPrismic(e))),i=e.nodes[vi.name];return i?i.create({},o):o}},toPrismic(e){var n;const t=((n=e.content.firstChild)==null?void 0:n.type.name)===sn.name?e.content.firstChild:e;return{type:"table",content:Ie.children.map(t,o=>AA.toPrismic(o))}}},vi=ne.Node.create({name:"table",group:"block",content:"innerTable",selectable:!1,parseHTML(){return[{tag:"div"}]},renderHTML({HTMLAttributes:e}){return["div",e,0]},addNodeView(){return ne.ReactNodeViewRenderer(Du)}}),Qu=new Kd([Te.table],Te.table,[vi,sn,dA.TableRow,cA.TableHeader,lA.TableCell],Ru),ki=[Kn,Tn,Ti],Ei=[...ki,wn];function Di(e){return Id(e)?[...ki,J,Qu].filter(ae.isDefined):[J,xt,Bt,be.build(e),mi,Ci,Fi,...Ei].filter(ae.isDefined)}const Ri=[{nodeType:w.RichTextNodeType.paragraph,icon:"textFields",isActive:e=>e.isActive(J.name)&&!e.isActive(xt.name)&&!e.isActive(Bt.name),runCommands:Y((e,t)=>e.clearNodes().setDirection(se(t))),shortText:"par",text:"Paragraph"},{nodeType:w.RichTextNodeType.heading1,icon:"looks1",isActive:e=>e.isActive(be.name,{level:1}),runCommands:Y((e,t)=>e.setHeading({level:1}).setDirection(se(t))),shortText:"h1",text:"Heading 1"},{nodeType:w.RichTextNodeType.heading2,icon:"looks2",isActive:e=>e.isActive(be.name,{level:2}),runCommands:Y((e,t)=>e.setHeading({level:2}).setDirection(se(t))),shortText:"h2",text:"Heading 2"},{nodeType:w.RichTextNodeType.heading3,icon:"looks3",isActive:e=>e.isActive(be.name,{level:3}),runCommands:Y((e,t)=>e.setHeading({level:3}).setDirection(se(t))),shortText:"h3",text:"Heading 3"},{nodeType:w.RichTextNodeType.heading4,icon:"looks4",isActive:e=>e.isActive(be.name,{level:4}),runCommands:Y((e,t)=>e.setHeading({level:4}).setDirection(se(t))),shortText:"h4",text:"Heading 4"},{nodeType:w.RichTextNodeType.heading5,icon:"looks5",isActive:e=>e.isActive(be.name,{level:5}),runCommands:Y((e,t)=>e.setHeading({level:5}).setDirection(se(t))),shortText:"h5",text:"Heading 5"},{nodeType:w.RichTextNodeType.heading6,icon:"looks6",isActive:e=>e.isActive(be.name,{level:6}),runCommands:Y((e,t)=>e.setHeading({level:6}).setDirection(se(t))),shortText:"h6",text:"Heading 6"},{nodeType:w.RichTextNodeType.list,icon:"formatListBulleted",isActive:e=>e.isActive(xt.name),runCommands:Y((e,t)=>e.toggleBulletList().setDirection(se(t))),shortText:"bull",text:"Bulleted list"},{nodeType:w.RichTextNodeType.orderedList,icon:"formatListNumbered",isActive:e=>e.isActive(Bt.name),runCommands:Y((e,t)=>e.toggleOrderedList().setDirection(se(t))),shortText:"num",text:"Numbered list"},{nodeType:w.RichTextNodeType.preformatted,icon:"dataObject",isActive:e=>e.isActive(mi.name),runCommands:Y((e,t)=>e.setCodeBlock().setDirection(se(t))),shortText:"code",text:"Code"},{nodeType:w.RichTextNodeType.embed,icon:"cloud",isActive:e=>e.isActive(Ci.name),runCommands:Y(e=>e.setEmbed()),shortText:"emb",text:"Embed"},{nodeType:w.RichTextNodeType.image,icon:"image",isActive:e=>e.isActive(Fi.name),runCommands:Y(e=>e.setImage()),shortText:"img",text:"Image"}],Mu=[{nodeType:w.RichTextNodeType.strong,icon:"formatBold",isActive:e=>e.isActive(Kn.name),runCommands:Y(e=>e.toggleBold())},{nodeType:w.RichTextNodeType.em,icon:"formatItalic",isActive:e=>e.isActive(Tn.name),runCommands:Y(e=>e.toggleItalic())}],qu=[{nodeType:w.RichTextNodeType.rtl,icon:"formatTextDirectionRToL",isActive:e=>e.isActive({[Ce]:Ue}),runCommands:Y((e,t)=>e.toggleDirection(se(t)))}];function Y(e){return(t,n={})=>{let o=n.can===!0?t.can().chain():t.chain().focus();return n.deleteRange!==void 0&&(o=o.deleteRange(n.deleteRange)),n.can?Pu(t,o,e):e(o,t).run()}}function se(e){const t=e.state.selection.$from.parent.attrs;return xe.parseNodeAttrsDirection(t)}function ut(e,t){return e.filter(n=>t.includes(n.nodeType))}function Pu(e,t,n){try{return n(t,e).run()}catch{return!1}}function Ou(e){const{items:t,editor:n}=e;return t.length===0?null:A.jsxs(A.Fragment,{children:[t.map(o=>A.jsx(r.ToolbarToggleButton,{disabled:!o.runCommands(n,{can:!0}),onPressedChange:()=>{o.runCommands(n)},pressed:o.isActive(n),startIcon:o.icon},o.nodeType)),A.jsx(r.ToolbarSeparator,{})]})}function Vu(e){const{labels:t,editor:n}=e,o=n.getAttributes("label").label;return A.jsxs(A.Fragment,{children:[A.jsxs(r.DropdownMenu,{children:[A.jsx(r.DropdownMenuTrigger,{disabled:t.length===0,children:A.jsx(r.Button,{endIcon:"arrowDropDown",size:"small",color:"grey",children:oA(o??"Labels")})}),A.jsx(r.DropdownMenuContent,{align:"start",asPortal:!1,maxHeight:256,avoidCollisions:!1,children:t.map((i,s)=>{const a=o===i;return A.jsx(r.DropdownMenuItem,{onSelect:()=>a?n.commands.unsetLabel():Yu(n,i),endIcon:a&&A.jsx(r.Icon,{name:"check",size:"extraSmall"}),children:oA(i)},`${i}-${s}`)})})]}),A.jsx(r.ToolbarSeparator,{})]})}function Yu(e,t){Y(o=>o.setLabel({label:t}))(e)}function oA(e){return Ae.overflow(e,20)}function Wu(e){const{editor:t}=e,n=t.getAttributes("label");if(!n.label)return null;const o=n.label;return A.jsx(r.Box,{backgroundColor:"purple9",padding:{block:2,inline:4},alignItems:"center",borderRadius:{topLeft:2,topRight:2,bottomRight:2},maxWidth:125,children:A.jsx(r.Text,{color:"white",variant:"small",noWrap:!0,children:o})})}function Hu(e){const{disabled:t,showWebLinkModal:n,showDocumentsLinkModal:o,showMediaLinkModal:i}=_u(e);return A.jsxs(A.Fragment,{children:[A.jsxs(r.ToolbarButtonGroup,{density:"compact",children:[A.jsx(r.ToolbarButton,{disabled:t,startIcon:"link",onClick:n},w.RichTextNodeType.hyperlink),A.jsxs(r.DropdownMenu,{children:[A.jsx(r.DropdownMenuTrigger,{children:A.jsx(r.ToolbarButton,{startIcon:"arrowDropDown"})}),A.jsxs(r.DropdownMenuContent,{align:"end",asPortal:!1,children:[A.jsx(r.DropdownMenuItem,{startIcon:A.jsx(r.Icon,{name:"public"}),onSelect:n,children:"Link to web page"}),A.jsx(r.DropdownMenuItem,{startIcon:A.jsx(r.Icon,{name:"description"}),onSelect:o,children:"Link to document"}),A.jsx(r.DropdownMenuItem,{startIcon:A.jsx(r.Icon,{name:"image"}),onSelect:i,children:"Link to media"})]})]})]}),A.jsx(r.ToolbarSeparator,{})]})}function _u(e){const{editor:t,setModal:n}=e;function o(){n("webLink")}function i(){n("documentLink")}function s(){n("mediaLink")}return{disabled:!Y(l=>l.setWebLink({href:""}))(t,{can:!0}),showWebLinkModal:o,showDocumentsLinkModal:i,showMediaLinkModal:s}}function zu(e){const{docId:t,onEdit:n,onUnlink:o}=e,i=Nu(t),s=L();if(!i)return null;const a=i.versions[0],l=dn({status:a==null?void 0:a.status,releaseId:(a==null?void 0:a.status)==="release"?a.release_id:void 0,documentId:i.id,versionId:a==null?void 0:a.version_id,baseUrl:s.baseUrl}),d=(a==null?void 0:a.preview_summary)??"",c=(a==null?void 0:a.custom_type_label)??"";return A.jsx(ve,{url:l,title:i.title,subTitle:c,description:d,onEdit:n,onUnlink:o,largeIconName:"description"})}function Nu(e){const t=L();t.searchDocuments||V("searchDocuments");const{coreApiBaseUrl:n,authStrategy:o}=t;return R.useRequest(et,[n,o,e])}function Gu(e){const{editor:t}=e,{searchDocuments:n}=L(),o=t.getAttributes(w.RichTextNodeType.hyperlink);if(o.id&&n){const i=o.id;return A.jsx(Zu,{docId:i,...e})}if(o.href){const i=o.href;return A.jsx(Ju,{url:i,...e})}if(o.media){const i=wi(o.media);return A.jsx(Xu,{media:i,...e})}return null}function Zu(e){const{editor:t,onEditDocumentLink:n,docId:o}=e;return A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(ve,{title:"Failed to Load Linked Document Data",error:!0,onEdit:n,onUnlink:()=>we(t)}),children:A.jsx(f.Suspense,{fallback:A.jsx(ve,{loading:!0,onEdit:n,onUnlink:()=>we(t)}),children:A.jsx(zu,{docId:o,onEdit:n,onUnlink:()=>we(t)})})})}function Ju(e){const{url:t,editor:n,onEditWebLink:o}=e,i=te.toURL(t);return i?A.jsx(ve,{url:t,title:te.getUrlTitle(i),subTitle:t,onEdit:o,onUnlink:()=>we(n)}):A.jsx(ve,{url:t,subTitle:t,onEdit:o,onUnlink:()=>we(n)})}function Xu(e){const{media:t,editor:n,onEditMediaLink:o}=e;return K.FilledImageLinkContent.is(t)?A.jsx(Xo,{url:t.url,title:t.name,subTitle:`${t.width} x ${t.height} pixels`,onEdit:o,onUnlink:()=>we(n)}):K.FilledFileLinkContent.is(t)?A.jsx(ve,{url:t.url,title:t.name,subTitle:$u({filename:t.name}),largeIconName:"insertDriveFile",onEdit:o,onUnlink:()=>we(n)}):null}function we(e){Y(n=>n.unsetLink())(e)}function $u(e){const{filename:t}=e,n=t.split(".").pop();return n?n.toLowerCase():""}function eg(e){const{open:t}=e,{onOpenChange:n,onSelectDocument:o}=tg(e);return A.jsx(No,{open:t,onOpenChange:n,onSelectDocument:o})}function tg(e){const{editor:t,setOpen:n}=e;function o(s){Y(l=>l.extendMarkRange(w.RichTextNodeType.hyperlink).setDocumentLink({id:s}))(t),n(!1)}function i(s){n(s)}return{onSelectDocument:o,onOpenChange:i}}function ng(e){const{open:t}=e,{onOpenChange:n,onMediaSelected:o}=Ag(e);return A.jsx(jn,{open:t,onOpenChange:n,onMediaSelected:o,assetType:"all"})}function Ag(e){const{editor:t,setOpen:n}=e;function o(i){Y(a=>a.extendMarkRange(w.RichTextNodeType.hyperlink).setMediaLink({media:i}))(t),n(!1)}return{onMediaSelected:o,onOpenChange:n}}function og(e){const{open:t,setOpen:n}=e,{url:o,setUrl:i,openInNewTab:s,setOpenInNewTab:a,disabled:l,onUpdate:d}=ig(e);return A.jsxs(r.Dialog,{open:t,onOpenChange:n,size:"small",noDescription:!0,children:[A.jsx(r.DialogHeader,{title:"Set Link URL"}),A.jsxs(r.DialogContent,{padding:16,children:[A.jsx(r.FormInput,{value:o,onValueChange:i,placeholder:"Paste URL",icon:"public"}),o&&A.jsx(r.InlineLabel,{value:"Open in new tab",children:A.jsx(r.Checkbox,{checked:s,onCheckedChange:a})})]}),A.jsxs(r.DialogActions,{children:[A.jsx(r.DialogCancelButton,{}),A.jsx(r.DialogActionButton,{onClick:d,disabled:l,children:"Update"})]})]})}function ig(e){const{editor:t,open:n,setOpen:o}=e,i=rg(t),[s,a]=f.useState(i.url),[l,d]=f.useState(i.openInNewTab);E.useOnChange(n,()=>{n&&(a(i.url),d(i.openInNewTab))});const c=!s||s===i.url&&l===i.openInNewTab;function u(){const h=l?"_blank":"_self";Y(g=>g.extendMarkRange(w.RichTextNodeType.hyperlink).setWebLink({href:s,target:h}))(t),o(!1)}return{url:s,setUrl:a,openInNewTab:l,disabled:c,setOpenInNewTab:d,onUpdate:u}}function rg(e){const t=e.getAttributes(w.RichTextNodeType.hyperlink);return{url:t.href??"",openInNewTab:t.target==="_blank"}}function sg(e){const{items:t,editor:n}=e;return t.length===0?null:A.jsxs(A.Fragment,{children:[A.jsx(r.ToolbarToggleButtonGroup,{onValueChange:o=>{t.forEach(i=>{(i.isActive(n)&&!o.includes(i.nodeType)||!i.isActive(n)&&o.includes(i.nodeType))&&i.runCommands(n)})},type:"multiple",value:t.filter(o=>o.isActive(n)).map(o=>o.nodeType),children:t.map(o=>A.jsx(r.ToolbarToggleButtonGroupItem,{disabled:!o.runCommands(n,{can:!0}),startIcon:o.icon,value:o.nodeType},o.nodeType))},"mark"),A.jsx(r.ToolbarSeparator,{})]})}function ag(e){var o;const{items:t,editor:n}=e;return t.length===0?null:A.jsxs(A.Fragment,{children:[A.jsxs(r.DropdownMenu,{children:[A.jsx(r.DropdownMenuTrigger,{disabled:t.length===1,children:A.jsx(r.Button,{endIcon:"arrowDropDown",size:"small",color:"grey",children:((o=t.find(i=>i.isActive(n)))==null?void 0:o.text)??""})}),A.jsx(r.DropdownMenuContent,{align:"start",asPortal:!1,maxHeight:256,avoidCollisions:!1,children:t.map(i=>A.jsx(r.DropdownMenuItem,{onSelect:()=>{i.runCommands(n)},children:i.text},i.nodeType))})]}),A.jsx(r.ToolbarSeparator,{})]})}function Pt(e){return{duration:100,hideOnClick:!0,offset:e,placement:"top-start",appendTo:document.querySelector("body > div")??"parent"}}function lg(e){const{editor:t,nodeTypes:n,labels:o,hideDisabledOptions:i=!1}=e,[s,a]=f.useState(),l=n.includes(w.RichTextNodeType.hyperlink),d=!s,{shouldShowBubbleMenu:c,shouldshowPopover:u}=dg({editor:t}),[h,g]=f.useState(!0);f.useEffect(()=>{g(!1)},[]);function m(x){a(x?"webLink":void 0)}function C(x){a(x?"documentLink":void 0)}function y(x){a(x?"mediaLink":void 0)}return h?null:A.jsxs(A.Fragment,{children:[A.jsx(ne.BubbleMenu,{editor:t,tippyOptions:Pt([-48,0]),shouldShow:c,children:d&&A.jsx(cg,{editor:t,nodeTypes:n,labels:o,setModal:a,hideDisabledOptions:i})}),A.jsx(ne.BubbleMenu,{editor:t,tippyOptions:Pt([-48,0]),shouldShow:x=>u(x,"hyperlink"),children:d&&A.jsx(Gu,{editor:t,onEditWebLink:()=>a("webLink"),onEditDocumentLink:()=>a("documentLink"),onEditMediaLink:()=>a("mediaLink")})}),A.jsx(ne.BubbleMenu,{editor:t,tippyOptions:Pt([0,0]),shouldShow:x=>u(x,"label"),children:A.jsx(Wu,{editor:t})}),l&&A.jsxs(A.Fragment,{children:[A.jsx(og,{open:s==="webLink",setOpen:m,editor:t}),A.jsx(eg,{open:s==="documentLink",setOpen:C,editor:t}),A.jsx(ng,{open:s==="mediaLink",setOpen:y,editor:t})]})]})}function cg(e){const{editor:t,nodeTypes:n,labels:o,setModal:i,hideDisabledOptions:s}=e,a=n.includes("hyperlink"),l=o.length>0,d=ut(Ri,n),c=ut(Mu,n),u=ut(qu,n),h=s&&d.length===1?0:d.length,g=h+c.length+u.length+Number(a);return g===0?null:A.jsxs(r.Toolbar,{children:[h>0&&A.jsx(ag,{items:d,editor:t}),l&&A.jsx(Vu,{labels:o,editor:t}),A.jsx(sg,{items:c,editor:t}),a&&A.jsx(Hu,{editor:t,setModal:i}),A.jsx(Ou,{items:u,editor:t}),g>1&&A.jsx(r.ToolbarButton,{onClick:()=>{t.chain().focus().clearNodes().unsetAllMarks().run()},startIcon:"formatClear"},"clear")]})}function dg(e){const{editor:t}=e;function n(i){const{view:s,state:a,from:l,to:d}=i;if(!s.hasFocus())return!1;const{doc:c,selection:u}=a;return!(t.isActive(w.RichTextNodeType.preformatted)||u.empty||c.textBetween(l,d).length===0)}function o(i,s){const{view:a,state:l,from:d,to:c}=i,u=a.state.doc.nodeAt(d),{doc:h,selection:g}=l;return!g.empty||h.textBetween(d,c).length>0?!1:!!(u!=null&&u.marks.some(C=>C.type.name===s))}return{shouldShowBubbleMenu:n,shouldshowPopover:o}}function Qi(e){const{content:t,field:n,id:o,readOnly:i}=e,s=ug(n),a=t&&Jt.converter(s.nodeExtensions).fromPrismic(s.schema,s.nodeTypes,t),l=E.useStableCallback(e.onContentChange),d=r.useEditor({content:a==null?void 0:a.toJSON(),editable:!i,editorProps:{attributes:{class:`${r.contentEditableClass} ${r.contentEditableMultilinePlaceholderClass}`,id:o,tabIndex:"0"}},extensions:s.allComponents,injectCSS:!1,onUpdate({editor:c}){if(c.isEmpty)return l(void 0);const u=Jt.converter(s.nodeExtensions).toPrismic(c.state.doc);l(u)}},[s,i]);return A.jsxs(r.Field,{children:[A.jsx(r.FieldLabel,{htmlFor:o,children:Z(n)}),A.jsxs(r.FieldControl,{children:[d.isEditable&&A.jsx(lg,{editor:d,nodeTypes:s.names,labels:s.labels,hideDisabledOptions:!0}),A.jsx(ne.EditorContent,{editor:d,style:{flexGrow:1}})]})]})}function ug(e){var n,o;const t=`${((n=e.config)==null?void 0:n.multi)??""}-${((o=e.config)==null?void 0:o.single)??""}`;return f.useMemo(()=>{var C;const{extensions:i,nodeTypes:s}=Td(e.config),a=i.filter(gg),l=i.flatMap(y=>y.richTextNodeTypes);s.has(Xn)&&l.push(Xn);const d=i.flatMap(y=>y.component),c=i.filter(hg).map(y=>y.name),u=[...d,...su(e,a),$d.configure({supportedExtensionNames:c}),er,$i.History],h=u.map(y=>y.name),g=X.getSchema(u),m=pg((C=e.config)==null?void 0:C.labels);return{allComponents:u,extensionNames:h,nodeTypes:s,nodeExtensions:a,names:l,schema:g,labels:m}},[t])}function gg(e){return e.extType===Re.Node}function hg(e){return!(e.extType!==Re.Node||e.nodeType!==Ke.Text||e.lockedFormat)}function pg(e){return Array.from(e??[])}function mg(e){const{content:t,field:n,id:o,readOnly:i,onContentChange:s}=e,{placeholder:a,options:l}=n.config??{},d=!!(l!=null&&l.includes("")),c=xg(n),u=fg({content:t,placeholder:a,defaultValue:c,canHaveEmptyValue:d}),h=a&&c===void 0||a===void 0&&!d;return A.jsxs(r.Field,{children:[A.jsx(r.FieldIcon,{name:"arrowDropDownCircle"}),A.jsx(r.FieldLabel,{htmlFor:o,children:Z(n)}),A.jsx(r.FieldControl,{children:A.jsxs(r.Select,{id:o,size:"large",color:"grey",value:u,disabled:i,renderTrigger:()=>A.jsx(r.SelectGhostTrigger,{id:o}),onValueChange:g=>{s(Cg({value:g,placeholder:a}))},children:[h&&A.jsx(r.SelectItem,{value:a||It,children:a||""}),l==null?void 0:l.map(g=>A.jsx(r.SelectItem,{value:g||It,children:g},g))]})})]})}function fg(e){const{content:t,placeholder:n,defaultValue:o,canHaveEmptyValue:i}=e;let{value:s}=t??{};return s===""&&i?It:(s===""&&(s=void 0),s??o??n??"")}function Cg(e){const{placeholder:t}=e;let{value:n}=e;if(n!==t)return n===It&&(n=""),{__TYPE__:"FieldContent",type:"Select",value:n}}function xg(e){var t,n;return((t=e.config)==null?void 0:t.default_value)===void 0||(n=e.config.options)==null?void 0:n[0]}const It=" ";function yg(e){const{field:t,content:n,onContentChange:o,...i}=e;function s(a){if(!a)return o(void 0);e.onContentChange(Fg(a))}return A.jsx(Qi,{...i,field:Sg(t),content:Ig(n),onContentChange:s})}const Bg={__TYPE__:"StructuredTextContent",value:[{type:"paragraph",content:{text:""}}]},iA=Array.from({length:3},()=>({type:"tableRow",content:Array.from({length:2},()=>({type:"tableCell",content:Bg}))}));function Ig(e){return{__TYPE__:"StructuredTextContent",value:[{type:"table",content:jg(e)}]}}function jg(e){const t=K.TableContent.decode(e);return t._tag==="Left"||!t.right.content.some(o=>o.content.some(i=>i.content.value.some(({type:s})=>s)))?iA:t.right.content}function Fg(e){return{__TYPE__:"TableContent",content:e.value.flatMap(t=>t.type==="table"?t.content:[])}}function Sg(e){var t;return{...w.TableCell,config:{...w.TableCell.config,label:(t=e.config)==null?void 0:t.label,allowTargetBlank:!0,multi:[w.TableCell.config.multi,Te.table].join(",")}}}function bg(e){const{id:t,readOnly:n,field:o,content:i,onContentChange:s}=e,a=i!=null&&i.value?cn.dateFromISOString(i.value):void 0;return A.jsxs(r.Field,{children:[A.jsx(r.FieldIcon,{name:"event"}),A.jsx(r.FieldLabel,{id:t,children:Z(o)}),A.jsx(r.FieldControl,{children:A.jsx(r.Box,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:A.jsx(r.DateInput,{mode:"date-time","aria-labelledby":t,disabled:n,value:a,onValueChange:l=>s(Kg(l))})})})]})}function Kg(e){if(e)return{__TYPE__:"FieldContent",type:"Timestamp",value:Ug(e)}}function Ug(e){const t=`${e.getUTCFullYear()}`.padStart(4,"0"),n=`${e.getUTCMonth()+1}`.padStart(2,"0"),o=`${e.getUTCDate()}`.padStart(2,"0"),i=`${e.getUTCHours()}`.padStart(2,"0"),s=`${e.getUTCMinutes()}`.padStart(2,"0");return`${t}-${n}-${o}T${i}:${s}:00+00:00`}function kt(e){const{id:t,readOnly:n,content:o,nestableWidget:i}=e,s=E.useStableCallback(e.onContentChange);return f.useMemo(()=>{const a={id:t,readOnly:n,onContentChange:s};return i.type==="Boolean"?A.jsx(Cl,{...a,field:i,content:K.isBooleanContent(o)?o:void 0}):i.type==="Date"?A.jsx(Il,{...a,field:i,content:K.isDateContent(o)?o:void 0}):i.type==="Timestamp"?A.jsx(bg,{...a,field:i,content:K.isTimestampContent(o)?o:void 0}):i.type==="Image"?A.jsx(Ad,{...a,field:i,content:K.isImageContent(o)?o:void 0}):i.type==="Link"?A.jsx(Cd,{...a,field:i,content:o}):i.type==="Number"?A.jsx(xd,{...a,field:i,content:K.isNumberContent(o)?o:void 0}):i.type==="StructuredText"?A.jsx(Qi,{...a,field:i,content:K.isRichTextContent(o)?o:void 0}):i.type==="Select"?A.jsx(mg,{...a,field:i,content:K.isSelectContent(o)?o:void 0}):i.type==="Text"?A.jsx(si,{...a,field:i,content:K.isTextContent(o)?o:void 0}):i.type==="Embed"?A.jsx(kl,{...a,field:i,content:K.isEmbedContent(o)?o:void 0}):i.type==="Color"?A.jsx(yl,{...a,field:i,content:K.isColorContent(o)?o:void 0}):i.type==="GeoPoint"?A.jsx(El,{...a,field:i,content:K.isGeoPointContent(o)?o:void 0}):i.type==="IntegrationFields"?A.jsx(md,{...a,field:i,content:K.isIntegrationFieldContent(o)?o:void 0}):i.type==="Table"?A.jsx(yg,{...a,field:i,content:K.isTableContent(o)?o:void 0}):null},[o,t,i,s,n])}function Tg(e){const{content:t,id:n,nonRepeatableZone:o,onContentChange:i,readOnly:s}=e,a=f.useMemo(()=>Object.entries(o),[o]);return A.jsx(A.Fragment,{children:a.map(([l,d])=>{const c=t[l];return A.jsx(kt,{id:`${n}.${l}`,readOnly:s,nestableWidget:d,content:K.isNestableContent(c)?c:void 0,onContentChange:u=>{i(wg(t,l,u))}},l)})})}function wg(e,t,n){return n?{...e,[t]:n}:Ge.removeKey(e,t)}function Ln(e){var s,a;const{group:t,content:n,onContentChange:o,...i}=e;return A.jsx(hl,{children:A.jsx(vn,{...i,title:an(t),addItemButtonTitle:`Add item in "${an(t)}"`,repeatable:((s=t.config)==null?void 0:s.repeat)!==!1,repeatableZone:((a=t.config)==null?void 0:a.fields)??{},content:n==null?void 0:n.value,onContentChange:l=>{o({__TYPE__:"GroupContentType",value:l})}})})}function an(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}function Mi(e){const{id:t,readOnly:n,content:o,widget:i}=e,s=E.useStableCallback(e.onContentChange);return f.useMemo(()=>{const a={id:t,readOnly:n,onContentChange:s};return i.type==="Group"?A.jsx(Ln,{...a,group:i,content:K.isGroupContent(o)?o:void 0}):A.jsx(kt,{...a,nestableWidget:i,content:K.isNestableContent(o)?o:void 0})},[o,t,i,s,n])}function vn(e){const{id:t,title:n,addItemButtonTitle:o,content:i,onContentChange:s,readOnly:a,repeatable:l=!0,repeatableZone:d}=e,c=Object.entries(d);let u=i??[kg];!l&&u.length>1&&(u=u.slice(0,1));const{scrollOffsetTop:h}=L(),g=f.useRef(new WeakMap);Lg(g.current,u);function m(B){return g.current.get(B)??"!bugged!"}function C(B){const j=ln();s(O.insertAtIndex(u,B,j))}function y(B){const{index:j,offset:S}=B;s(O.move(u,j,j+S))}function x(B){s(O.removeIndex(u,B))}function I(B,j,S,b){const v=Dg(B,[S,b]),F=Eg(u,[j,v]);vg(g.current,B,v),s(F)}return Object.keys(d).length===0?null:A.jsx(r.Group,{title:n??"Repeatable zone",addItemButtonTitle:o??"Add item in repeatable zone",items:u,maxItems:l?void 0:1,getItemKey:m,onAddItem:C,dnd:{scrollOffsetTop:h,onReorder:s,renderDragPreview:({index:B})=>A.jsx(Rg,{title:n??"Repeatable zone",index:B}),renderDropIndicator:Qg},children:(B,j)=>{const S=new Map(B.value),b=m(B);return A.jsx(r.LazyRender,{keepLoaded:!0,loadWhenSearching:!0,children:A.jsx(r.GroupItem,{index:j,title:`${j+1} • Item`,onMove:y,onDelete:x,children:c.map(([v,F])=>A.jsx(Mi,{id:`${t}[${b}].${v}`,content:S.get(v),widget:F,onContentChange:T=>I(B,j,v,T),readOnly:a},v))})})}})}function Lg(e,t){t.forEach(n=>{e.has(n)||e.set(n,mr.uniqueNumber())})}function vg(e,t,n){const o=e.get(t);o!==void 0&&e.set(n,o)}const kg={__TYPE__:"GroupItemContent",value:[]};function Eg(e,t){const[n,o]=t;return o?e.map((i,s)=>s===n?o:i):e.filter((i,s)=>s!==n)}function Dg(e,t){const[n,o]=t;if(!o){const s=e.value.filter(([a])=>a!==n);return ln(s)}const i=Array.from(new Map(e.value).set(n,o));return ln(i)}function ln(e=[]){return{__TYPE__:"GroupItemContent",value:e}}function Rg(e){const{title:t,index:n}=e;return A.jsxs(r.Box,{padding:{block:8,inline:12},backgroundColor:"grey3",border:!0,borderRadius:6,alignItems:"center",justifyContent:"space-between",width:"100%",children:[A.jsxs("div",{children:[A.jsx(r.Text,{variant:"smallBold",color:"grey11",children:t??"Repeatable zone"}),A.jsxs(r.Text,{variant:"small",color:"grey11",children:[n+1," • Item"]})]}),A.jsx(r.Icon,{name:"dragIndicator",size:"small",color:"grey8"})]})}function Qg(e){const{isDropTarget:t,itemIndex:n,position:o}=e,i=t?A.jsx(r.Line,{color:"purple",thickness:2,sx:{position:"absolute",left:0,right:0,bottom:n===0&&o==="before"?0:void 0}},"line"):void 0;return A.jsx(r.AnimatedElement,{enterDuration:150,children:i})}function Mg(e){const{compositeSlice:t,content:n,onContentChange:o,sliceKey:i,id:s,readOnly:a,header:l}=e,d=wt();function c(){i&&d.update({id:i,requestedFrom:"sliceFieldSet"})}return A.jsxs(r.FieldSet,{id:i&&Tt("sliceFieldSet",i),selected:i?d.isSelected(i):!1,onFocus:c,legend:qg(t),header:l,children:[A.jsx(Tg,{id:s,readOnly:a,nonRepeatableZone:t["non-repeat"]??{},content:n.nonRepeat,onContentChange:u=>{o({...n,nonRepeat:u})}}),A.jsx(vn,{id:s,readOnly:a,repeatableZone:t.repeat??{},content:n.repeat,onContentChange:u=>{o({...n,repeat:u})}})]})}function qg(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}const qi={__TYPE__:"ImageContent",edit:{background:"",crop:{x:0,y:0},zoom:0},height:0,width:0,origin:{height:0,width:0,id:"",url:""},url:""};function Pg(e){const{field:t}=e;if(t.type==="Image")return qi}function Og(e){const{content:t,legacySlice:n,sliceKey:o,id:i,readOnly:s,onContentChange:a,header:l}=e,d=wt();function c(){o&&d.update({id:o,requestedFrom:"sliceFieldSet"})}const u=n.type==="Group"?an(n):Z(n);return A.jsx(r.FieldSet,{id:o&&Tt("sliceFieldSet",o),selected:o?d.isSelected(o):!1,onFocus:c,legend:u,header:l,children:n.type==="Group"?A.jsx(Ln,{id:i,readOnly:s,onContentChange:a,group:n,content:K.isGroupContent(t)?t:void 0}):A.jsx(kt,{id:i,readOnly:s,nestableWidget:n,content:K.isNestableContent(t)?t:void 0,onContentChange:h=>{const g=Pg({field:n});!h&&g&&a(g),h&&a(h)}})})}function Vg(e){const{content:t,id:n,slicePrimaryZone:o,onContentChange:i,readOnly:s}=e,a=f.useMemo(()=>Object.entries(o),[o]);return A.jsx(A.Fragment,{children:a.map(([l,d])=>{const c=t[l];return A.jsx(Mi,{id:`${n}.${l}`,readOnly:s,widget:d,content:K.isSlicePrimaryContent(c)?c:void 0,onContentChange:u=>{i(Yg(t,l,u))}},l)})})}function Yg(e,t,n){return n?{...e,[t]:n}:Ge.removeKey(e,t)}function Pi(e){const{config:t,content:n,sliceKey:o,readOnly:i=!1,sharedSlice:s,onContentChange:a,...l}=e,d=Wg(s,n.variation),c=f.useId(),h={id:l.id??c,readOnly:i},g=wt();function m(){o&&g.update({id:o,requestedFrom:"sliceFieldSet"})}return d===void 0?null:A.jsx(jt.Provider,{value:t,children:A.jsx(gl,{children:A.jsxs(r.FieldSet,{id:o&&Tt("sliceFieldSet",o),selected:o?g.isSelected(o):!1,onFocus:m,legend:Hg(s,d),children:[A.jsx(r.LazyRender,{heightEstimate:400,gap:16,keepLoaded:!0,loadWhenSearching:!0,children:A.jsx(Vg,{...h,slicePrimaryZone:d.primary??{},content:n.primary,onContentChange:C=>{a({...n,primary:C})}})}),A.jsx(vn,{...h,repeatableZone:d.items??{},content:n.items,onContentChange:C=>{a({...n,items:C})}})]})})})}function Wg(e,t){return f.useMemo(()=>e.variations.find(n=>n.id===t),[e,t])}function Hg(e,t){return[e.name,t.name].join(" • ")}function rA(e){var d,c;const{sliceZone:t,onChange:n,slices:o,sliceContent:i}=e,s=(c=(d=t.config)==null?void 0:d.labels)==null?void 0:c[i.name];if(!s)return null;const a=s.find(u=>u.name===i.maybeLabel);function l(u){const h=o.value.map(g=>g.key===i.key?{...g,maybeLabel:u}:g);n({...o,value:h})}return A.jsxs(A.Fragment,{children:[A.jsx(r.Text,{component:"span",variant:"smallBold",children:"•"}),A.jsxs(r.DropdownMenu,{children:[A.jsx(r.DropdownMenuTrigger,{children:A.jsx(r.Button,{color:"grey",size:"small",endIcon:"arrowDropDown",invisible:!0,children:(a==null?void 0:a.display)??"Slice variation"})}),A.jsxs(r.DropdownMenuContent,{align:"start",maxHeight:256,children:[A.jsx(r.DropdownMenuItem,{onSelect:()=>l(void 0),endIcon:i.maybeLabel===void 0?A.jsx(r.Icon,{name:"check"}):void 0,children:"..."}),s==null?void 0:s.map(u=>A.jsx(r.DropdownMenuItem,{onSelect:()=>l(u.name),endIcon:u.name===i.maybeLabel?A.jsx(r.Icon,{name:"check"}):void 0,children:u.display??"[Missing display value]"},u.name))]})]})]})}function _g(e){const{content:t,id:n,onContentChange:o,readOnly:i,sliceZone:s}=e,a=L();return A.jsx(A.Fragment,{children:t==null?void 0:t.value.map((l,d)=>{var g,m;const c=(m=(g=s.config)==null?void 0:g.choices)==null?void 0:m[l.name];if(c===void 0)return null;const u=l.widget,h={id:`${n}[${l.key}]`,key:l.key,sliceKey:l.key,onContentChange:C=>{const y={...l,widget:C},x=zg(t,[d,y]);o(x)},readOnly:i};return c.type==="SharedSlice"?K.isSharedSliceContent(u)?A.jsx(Pi,{...h,config:a,sharedSlice:c,content:u}):null:c.type==="Slice"?K.isCompositeSliceContent(u)?A.jsx(Mg,{...h,compositeSlice:c,content:u,header:A.jsx(rA,{sliceContent:l,sliceZone:s,slices:t,onChange:o})}):null:K.isSimpleSliceContent(u)?A.jsx(Og,{...h,legacySlice:c,content:u,header:A.jsx(rA,{sliceContent:l,sliceZone:s,slices:t,onChange:o})}):null})})}function zg(e,[t,n]){return{__TYPE__:"SliceContentType",value:e.value.map((o,i)=>i===t?n:o)}}function Ng(e){const{content:t,metadataFieldType:n,documentId:o,documentContent:i,documentCustomType:s,documentLocale:a,...l}=e,{showAlert:d}=r.useAlert(),[c,u]=f.useState(!1),h=L(),g=f.useMemo(()=>BA(i,s),[i,s]),m=IA(g);async function C(){if(!h.aiSeoMetadataEnabled)return;const{awsBedrockRegion:y,awsBedrockAccessKeyId:x,awsBedrockSecretAccessKey:I,trackMetadataGeneration:B}=h;u(!0);try{const j=await yA({pageTextContent:g,contentLocale:a,config:{region:y,accessKeyId:x,secretAccessKey:I}});e.onContentChange({__TYPE__:"FieldContent",type:"Text",value:j[n]}),B({documentId:o,locale:a,suggestion:j[n],type:n})}catch{d({id:n,title:"Error",subtitle:`Failed to generate SEO metadata for ${sA[n]}`})}u(!1)}return A.jsx(si,{...l,content:t,placeholder:`${sA[n]}..`,endAdornment:A.jsxs(A.Fragment,{children:[A.jsx(Uo,{type:n,value:(t==null?void 0:t.value)||""}),A.jsx(r.Tooltip,{content:m?"Generate SEO metadata from your page content.":"Your page content is too short to generate SEO metadata.",children:A.jsx(r.Button,{disabled:!m,onClick:C,size:"small",color:"grey",startIcon:"autoFixHigh",loading:c,sx:{alignSelf:"center",marginInline:8},children:"Generate"})})]})})}const sA={[le]:"Meta title",[ue]:"Meta description"};function Gg(e){const{id:t,field:n,content:o,onContentChange:i}=e,s=E.useDebounceState({state:(o==null?void 0:o.value)??"",synchronize:!0}),{onEditUID:a}=f.useContext(wo);function l(c){a();const u=Ae.slugify(c);i(Xg(u)),s.set(u)}function d(c){l(c.clipboardData.getData("Text").trim()),c.preventDefault()}return A.jsxs(r.Field,{children:[A.jsx(r.FieldIcon,{name:"tag"}),A.jsx(r.FieldLabel,{htmlFor:t,children:Z(n)}),A.jsx(r.FieldControl,{children:A.jsx(Fe,{id:t,variant:"success",placeholder:De(n,"Enter a unique identifier"),value:s.value,onPaste:d,onValueChange:l,endAdornment:A.jsx(r.AnimatedElement,{enterDuration:150,children:A.jsx(Zg,{uid:s.debouncedValue})})})})]})}function Zg(e){const{uid:t}=e,n=L();return t?n.uidField?A.jsx(r.ErrorBoundary,{children:A.jsx(f.Suspense,{children:A.jsx(Jg,{uid:t})})}):null:A.jsx(r.Badge,{color:"tomato",title:"Required",size:"medium"})}function Jg(e){const t=$g(e),n=L();if(!t.documentId)return null;const o=dn({status:t.status,releaseId:t.releaseId,documentId:t.documentId,versionId:t.versionId,baseUrl:n.baseUrl});return A.jsx("a",{href:o.href,target:"_blank",rel:"noreferrer",children:A.jsx(r.Badge,{color:"tomato",size:"medium",title:A.jsxs(r.Text,{color:"tomato11",variant:"small",children:["Value already used in"," ",A.jsx(r.Text,{color:"tomato11",variant:"small",underline:!0,children:"another document"})]})})})}function Xg(e){return e===""?void 0:{__TYPE__:"UIDContent",value:e}}function $g(e){var g,m,C,y;const{uid:t}=e,n=L();n.uidField||V("uidField");const{coreApiBaseUrl:o,authStrategy:i,customTypeId:s,localeId:a,documentId:l}=n,{data:d}=mn({baseUrl:o,authStrategy:i,uids:[t]}),c=d.results,h=vo({customTypeId:s,languageId:a,documentsWithUid:c,documentId:l,uid:t})[0];return h?{documentId:h.id,versionId:(g=h.versions[0])==null?void 0:g.version_id,status:(m=h.versions[0])==null?void 0:m.status,releaseId:((C=h.versions[0])==null?void 0:C.status)==="release"?(y=h.versions[0])==null?void 0:y.release_id:void 0}:{}}function eh(e){const{id:t,readOnly:n,staticZone:o,content:i,onContentChange:s,documentId:a,documentContent:l,documentCustomType:d,documentLocale:c}=e,u=L(),h=f.useMemo(()=>Object.entries(o),[o]),g=f.useRef(i);if(f.useEffect(()=>{g.current=i},[i]),h.length===0)return null;const m=nh(h),C=gt(i[le])||"Meta title..",y=gt(i[ue])||"Meta description..";return A.jsxs(r.FieldSet,{legend:"Page data",children:[m&&A.jsx(To,{title:C,description:y}),h.map(([x,I])=>{const B={id:`${t}.${x}`,onContentChange:S=>{const{[x]:b,...v}=g.current;s({...v,...S!==void 0&&{[x]:S}})},readOnly:n},j=i[x];return I.type==="UID"?f.createElement(Gg,{...B,content:K.isUIDContent(j)?j:void 0,key:x,field:I}):I.type==="Group"?f.createElement(Ln,{...B,content:K.isGroupContent(j)?j:void 0,group:I,key:x}):u.aiSeoMetadataEnabled&&th(x)&&I.type==="Text"?f.createElement(Ng,{...B,content:K.isTextContent(j)?j:void 0,field:I,key:x,metadataFieldType:x,documentId:a,documentContent:l,documentCustomType:d,documentLocale:c}):f.createElement(kt,{...B,content:K.isNestableContent(j)?j:void 0,key:x,nestableWidget:I})})]})}function th(e){return e===le||e===ue}const nh=e=>{var t,n;return((t=e[0])==null?void 0:t[0])===le&&((n=e[1])==null?void 0:n[0])===ue};function Ah(e){const{id:t,readOnly:n,section:o,content:i,onContentChange:s,documentId:a,documentContent:l,documentCustomType:d,documentLocale:c}=e,[u,h]=ih(o),[g,m]=rh(i);return A.jsxs("div",{style:{display:"flex",flexDirection:"column",position:"relative",zIndex:0},children:[A.jsx(eh,{id:t,readOnly:n,staticZone:u,documentId:a,content:g,onContentChange:C=>s({...m,...C}),documentContent:l,documentCustomType:d,documentLocale:c}),h.map(([C,y])=>{const x=m[C];return A.jsx(_g,{id:`${t}.${C}`,readOnly:n,sliceZone:y,content:x,onContentChange:I=>s({...g,...m,[C]:I})},C)})]})}function oh(e){return e.type==="Choice"||e.type==="Slices"}function ih(e){return Object.entries(e).reduce(([t,n],[o,i])=>(oh(i)?n.push([o,i]):Object.assign(t,{[o]:i}),[t,n]),[{},[]])}function rh(e){return Object.entries(e).reduce(([t,n],[o,i])=>{const s={[o]:i};return Object.assign(K.isSlicesContent(i)?n:t,s),[t,n]},[{},{}])}function sh(e){const{config:t,readOnly:n=!1,customType:o,sectionName:i,documentId:s,content:a,locale:l,onContentChange:d}=e,c=f.useId();if(Ge.isEmpty(o.json))return null;const u=ah(o,i),[h,g]=lh(u,a);return A.jsx(jt.Provider,{value:t,children:A.jsx(ul,{customTypeFormat:o.format,children:A.jsx(Ah,{id:c,readOnly:n,section:u,documentId:s,content:h,onContentChange:m=>d({...g,...m}),documentContent:a,documentCustomType:o,documentLocale:l})})})}function ah(e,t){const n=e.json[t];if(n===void 0)throw new Error(`Cannot find a section with name '${t}'.`);return n}function lh(e,t){return Object.entries(t).reduce(([n,o],[i,s])=>{const a=e[i]!==void 0,l={[i]:s};return[{...n,...a?l:{}},{...o,...a?{}:l}]},[{},{}])}exports.BasicRole=HA;exports.DeferredCodeBlock=Ot;exports.DocumentEditor=sh;exports.EditorConfigContext=jt;exports.EditorErrorBoundary=Sr;exports.LocaleId=WA;exports.MediaLibrary=Ko;exports.MetadataBadge=Uo;exports.MetadataPreview=To;exports.OnboardingGuide=Al;exports.OnboardingStepId=os;exports.RolesPerLocale=bt;exports.RolesPerLocaleByUser=fn;exports.SelectionManagerProvider=xA;exports.SharedSliceEditor=Pi;exports.SliceSelectionContext=ko;exports.TeamSpace=Kt;exports.UIDContext=wo;exports.createSearchParams=vA;exports.createTeamSpace=ds;exports.defaultGroupContentWithOneItem=mA;exports.defaultImageContentWidget=qi;exports.deleteTeamSpace=gs;exports.documentKeys=de;exports.documentMetaSchema=hn;exports.documentSchema=zr;exports.documentStatus=fA;exports.extractTextFromField=gt;exports.fetchCustomTypes=Rr;exports.frameworkCreateProjectCodeSnippet=gA;exports.frameworkLabels=uA;exports.generateSEOMetadata=yA;exports.getConflictingUidDocuments=vo;exports.getCustomTypesOptions=$e;exports.getDocumentById=et;exports.getDocumentList=pn;exports.getDocumentListOptions=kA;exports.getOnboarding=is;exports.getPageTextContent=BA;exports.getProfile=GA;exports.getRepository=St;exports.getRepositoryTags=qA;exports.getRepositoryV2=As;exports.getSliceSelectionDOMId=Tt;exports.getTeamSpaces=_A;exports.getTeamSpacesOptions=ls;exports.hasUIDField=Lo;exports.invalidateCustomTypes=Mr;exports.invalidateDocumentListData=Zr;exports.isDocumentSearchVersion=Wt;exports.isDocumentVersion=UA;exports.isMissingUID=ll;exports.isPageContentRelevantForAISeo=IA;exports.isValidSimulatorURL=MA;exports.languageSchema=gn;exports.makeSearchFullTextDocumentsQueryString=LA;exports.metaDescriptionConfig=_e;exports.metaDescriptionProperty=ue;exports.metaTitleConfig=He;exports.metaTitleProperty=le;exports.onboardingStateSchema=OA;exports.onboardingToggleResultSchema=YA;exports.onboardingToggleStepResultSchema=VA;exports.prefetchCustomTypes=Dr;exports.prefetchStaticCustomType=Vr;exports.prepareDocumentForSave=Br;exports.profileResponse=NA;exports.repositoryFramework=Ft;exports.repositorySchemaV2=PA;exports.roleMap=ms;exports.searchDocumentStatus=Vt;exports.searchDocuments=EA;exports.searchDocumentsQueryOptions=DA;exports.searchFullTextDocuments=wA;exports.sliceItemContentSchema=Nr;exports.suppressErrors=Ur;exports.throwConfigError=V;exports.toggleOnboarding=ss;exports.toggleOnboardingStep=rs;exports.updateDocumentListData=Gr;exports.updateTeamSpace=us;exports.useCustomType=Qr;exports.useCustomTypes=un;exports.useDocumentList=mn;exports.useInvalidateTeamSpaces=cs;exports.useProfile=Cn;exports.useSelectionManager=je;exports.useSliceSelection=wt;exports.useStaticCustomType=Or;
|
|
1
|
+
"use strict";var lX=Object.defineProperty;var cX=(e,t,n)=>t in e?lX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var dn=(e,t,n)=>(cX(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),m=require("@prismicio/editor-ui"),I=require("react"),ni=require("@prismicio/editor-support/URL"),li=require("@tanstack/react-query"),Pd=require("@prismicio/editor-support/Object"),ze=require("@prismicio/editor-support/React"),rx=require("@prismicio/editor-support/Date"),wt=require("@prismicio/editor-support/Array"),et=require("@prismicio/editor-support/Suspense"),ri=require("@prismicio/editor-support/String"),se=require("@prismicio/editor-support/Http"),ei=require("@prismicio/editor-support/Set"),Qi=require("@prismicio/editor-support/Type"),dX=require("@prismicio/editor-support/Map"),ix=require("react-dom"),fX=require("@prismicio/editor-support/DOM"),pX=require("@prismicio/editor-support/Number"),hX=require("@prismicio/editor-support/Animation");function oU(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Fe=oU(I),AX=oU(ix),aU={next:"Next.js",nuxt:"Nuxt",sveltekit:"SvelteKit",other:"Other"},sU={next:"npx create-next-app@latest",nuxt:"npx nuxi@latest init",sveltekit:"npx sv create"},uU=e=>Array.isArray(e)?`[${e.map(uU).join(", ")}]`:typeof e=="string"?`"${e}"`:e instanceof Date?`${e.getTime()}`:`${e}`,ct=e=>(n,...r)=>{const i=r.map(uU).join(", "),o=n&&r.length?", ":"";return`[${e}(${n}${o}${i})]`},uj=e=>{const t=ct(e);return r=>t(r)},mX=e=>{const t=ct(e);return(...r)=>t("",...r)},ma={at:ct("at"),not:ct("not"),any:ct("any"),in:ct("in"),fulltext:ct("fulltext"),has:uj("has"),missing:uj("missing"),similar:mX("similar"),geopointNear:ct("geopoint.near"),numberLessThan:ct("number.lt"),numberGreaterThan:ct("number.gt"),numberInRange:ct("number.inRange"),dateAfter:ct("date.after"),dateBefore:ct("date.before"),dateBetween:ct("date.between"),dateDayOfMonth:ct("date.day-of-month"),dateDayOfMonthAfter:ct("date.day-of-month-after"),dateDayOfMonthBefore:ct("date.day-of-month-before"),dateDayOfWeek:ct("date.day-of-week"),dateDayOfWeekAfter:ct("date.day-of-week-after"),dateDayOfWeekBefore:ct("date.day-of-week-before"),dateMonth:ct("date.month"),dateMonthAfter:ct("date.month-after"),dateMonthBefore:ct("date.month-before"),dateYear:ct("date.year"),dateHour:ct("date.hour"),dateHourAfter:ct("date.hour-after"),dateHourBefore:ct("date.hour-before")},Cs=e=>Array.isArray(e)?e:[e],sr=(e={},t)=>({...e,filters:[...e.filters||[],...Cs(t)]}),gX=e=>typeof e=="function"?e:()=>e,lU="7.15.1",qu=e=>`https://prismic.dev/msg/client/v${lU}/${e}`,lj=e=>ma.at("document.tags",Cs(e));var vX=Object.defineProperty,yX=(e,t,n)=>t in e?vX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cj=(e,t,n)=>yX(e,typeof t!="symbol"?t+"":t,n);class Si extends Error{constructor(t="An invalid API response was returned",n,r){super(t),cj(this,"url"),cj(this,"response"),this.url=n,this.response=r}}const ox=(e,t)=>{const n=e.find(r=>t(r));if(!n)throw new Si("Ref could not be found.",void 0,void 0);return n},dj=e=>ox(e,t=>t.isMasterRef),FC=(e,t)=>ox(e,n=>n.id===t),jC=(e,t)=>ox(e,n=>n.label===t),bX="io.prismic.preview",fj=e=>e.replace(/%3B/g,";"),CX=e=>{const t=e.split("; ");let n;for(const r of t){const i=r.split("=");if(fj(i[0]).replace(/%3D/g,"=")===bX){n=fj(i.slice(1).join("="));break}}return n},SX=e=>e.replace(/(\n| )*( |{|})(\n| )*/gm,(t,n,r)=>r),ug=e=>ma.any("document.tags",Cs(e)),Fc=e=>ma.at("document.type",e);class dy extends Si{}class Cw extends Si{}class wX extends Si{}class _X extends dy{}class pj extends dy{}class LC extends dy{}class xX extends Cw{}const _p={Any:"Any",Document:"Document",Media:"Media",Web:"Web"},TX=e=>{var t;return{link_type:_p.Document,id:e.id,uid:e.uid||void 0,type:e.type,tags:e.tags,lang:e.lang,url:e.url==null?void 0:e.url,slug:(t=e.slugs)==null?void 0:t[0],...e.data&&Object.keys(e.data).length>0?{data:e.data}:{}}},IX=(e,...t)=>{if(!e)return null;const n="link_type"in e?e:TX(e),[r]=t;let i;switch(typeof r=="function"||r==null?i={linkResolver:r}:i={...r},n.link_type){case _p.Media:case _p.Web:return"url"in n?n.url:null;case _p.Document:{if("id"in n&&i.linkResolver){const o=i.linkResolver(n);if(o!=null)return o}return"url"in n&&n.url?n.url:null}case _p.Any:default:return null}},EX=e=>new Promise(t=>setTimeout(t,e)),RX=({interval:e}={})=>{const t=[];let n=!1,r=0;const i=()=>{var u;!n&&t.length>0&&((u=t.shift())==null||u(),n=!0)},o=()=>{n=!1,i()},a=async(u,l,c)=>{const f=Date.now()-r;e&&f<e&&await EX(e-f);const p=(async()=>u(...c))();l(p);try{await p}catch{}r=Date.now(),o()},s=(u,l,c)=>{new Promise(f=>{t.push(f)}).then(a.bind(void 0,u,l,c)),(async()=>(await Promise.resolve(),n||i()))()};return(u,...l)=>new Promise(c=>{s(u,c,l)})};var $X=Object.defineProperty,kX=(e,t,n)=>t in e?$X(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lg=(e,t,n)=>kX(e,typeof t!="symbol"?t+"":t,n);const OX=1500;class MX{constructor(t){if(lg(this,"fetchFn"),lg(this,"fetchOptions"),lg(this,"queuedFetchJobs",{}),lg(this,"dedupedFetchJobs",{}),this.fetchOptions=t.fetchOptions,typeof t.fetch=="function")this.fetchFn=t.fetch;else if(typeof globalThis.fetch=="function")this.fetchFn=globalThis.fetch;else throw new Si("A valid fetch implementation was not provided. In environments where fetch is not available (including Node.js), a fetch implementation must be provided via a polyfill or the `fetch` option.",void 0,void 0);this.fetchFn===globalThis.fetch&&(this.fetchFn=this.fetchFn.bind(globalThis))}async fetch(t,n={}){var r,i,o,a,s;const u={...this.fetchOptions,...n.fetchOptions,headers:{...(r=this.fetchOptions)==null?void 0:r.headers,...(i=n.fetchOptions)==null?void 0:i.headers},signal:((o=n.fetchOptions)==null?void 0:o.signal)||n.signal||((a=this.fetchOptions)==null?void 0:a.signal)};return(s=n.fetchOptions)!=null&&s.body?this.queueFetch(t,u):this.dedupeFetch(t,u)}queueFetch(t,n={}){const r=new URL(t).hostname;return this.queuedFetchJobs[r]||(this.queuedFetchJobs[r]=RX({interval:OX})),this.queuedFetchJobs[r](()=>this.createFetchJob(t,n))}dedupeFetch(t,n={}){let r;return this.dedupedFetchJobs[t]&&this.dedupedFetchJobs[t].has(n.signal)?r=this.dedupedFetchJobs[t].get(n.signal):(this.dedupedFetchJobs[t]=this.dedupedFetchJobs[t]||new Map,r=this.createFetchJob(t,n).finally(()=>{var i,o;(i=this.dedupedFetchJobs[t])==null||i.delete(n.signal),((o=this.dedupedFetchJobs[t])==null?void 0:o.size)===0&&delete this.dedupedFetchJobs[t]}),this.dedupedFetchJobs[t].set(n.signal,r)),r}createFetchJob(t,n={}){return this.fetchFn(t,n).then(async r=>{let i,o;if(r.ok)try{i=await r.json()}catch{}else try{o=await r.text(),i=JSON.parse(o)}catch{}return{status:r.status,headers:r.headers,json:i,text:o}})}}const FX="x-d",jX="x-c",LX={accessToken:"access_token"},DX=e=>{if(typeof e=="string"){if(process.env.NODE_ENV==="development"){const[t,n]=e.split(" "),r=n==="desc"?`{ field: "${t}", direction: "desc" }`:`{ field: "${t}" }`;console.warn(`[@prismicio/client] A string value was provided to the \`orderings\` query parameter. Strings are deprecated. Please convert it to the object form: ${r}. For more details, see ${qu("orderings-must-be-an-array-of-objects")}`)}return e}return e.direction==="desc"?`${e.field} desc`:e.field},UX=(e,t)=>{const{filters:n,predicates:r,...i}=t,o=new URL("documents/search",`${e}/`);if(n){process.env.NODE_ENV==="development"&&!Array.isArray(n)&&console.warn(`[@prismicio/client] A non-array value was provided to the \`filters\` query parameter (\`${n}\`). Non-array values are deprecated. Please convert it to an array. For more details, see ${qu("filters-must-be-an-array")}`);for(const a of Cs(n))o.searchParams.append("q",`[${a}]`)}if(r)for(const a of Cs(r))o.searchParams.append("q",`[${a}]`);for(const a in i){const s=LX[a]||a;let u=i[a];if(s==="orderings"){const l=i[s];l!=null&&(process.env.NODE_ENV==="development"&&typeof l=="string"&&console.warn(`[@prismicio/client] A string value was provided to the \`orderings\` query parameter. Strings are deprecated. Please convert it to an array of objects. For more details, see ${qu("orderings-must-be-an-array-of-objects")}`),u=`[${Cs(l).map(f=>DX(f)).join(",")}]`)}else s==="routes"&&typeof i[s]=="object"&&(u=JSON.stringify(Cs(i[s])));u!=null&&o.searchParams.set(s,Cs(u).join(","))}return o.searchParams.set(jX,`js-${lU}`),process.env.NODE_ENV==="development"&&o.searchParams.set(FX,"1"),o.toString()},BX=e=>/^[a-zA-Z0-9][-a-zA-Z0-9]{2,}[a-zA-Z0-9]$/.test(e),PX=e=>{if(BX(e))return`https://${e}.cdn.prismic.io/api/v2`;throw new Si(`An invalid Prismic repository name was given: ${e}`,void 0,void 0)},WX=e=>{try{const t=new URL(e).hostname;if(t.endsWith("prismic.io")||t.endsWith("wroom.io")||t.endsWith("wroom.test"))return t.split(".")[0]}catch{}throw new Si(`An invalid Prismic Document API endpoint was provided: ${e}`,void 0,void 0)},DC=e=>{try{return new URL(e),!0}catch{return!1}};var NX=Object.defineProperty,cU=e=>{throw TypeError(e)},KX=(e,t,n)=>t in e?NX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gs=(e,t,n)=>KX(e,typeof t!="symbol"?t+"":t,n),dU=(e,t,n)=>t.has(e)||cU("Cannot "+n),hj=(e,t,n)=>(dU(e,t,"read from private field"),n?n.call(e):t.get(e)),qX=(e,t,n)=>t.has(e)?cU("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),VX=(e,t,n,r)=>(dU(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),xp;const zX=100,QX=5e3,HX=500,YX=1e3,GX=3;var So;(function(e){e.Master="Master",e.ReleaseID="ReleaseID",e.ReleaseLabel="ReleaseLabel",e.Manual="Manual"})(So||(So={}));class JX extends MX{constructor(t,n={}){if(super(n),qX(this,xp),gs(this,"documentAPIEndpoint"),gs(this,"accessToken"),gs(this,"routes"),gs(this,"brokenRoute"),gs(this,"defaultParams"),gs(this,"refState",{mode:So.Master,autoPreviewsEnabled:!0}),gs(this,"cachedRepository"),gs(this,"cachedRepositoryExpiration",0),(n.documentAPIEndpoint||DC(t))&&process.env.NODE_ENV==="development"){const r=n.documentAPIEndpoint||t;if(/\.prismic\.io\/(?!api\/v2\/?)/i.test(r))throw new Si("@prismicio/client only supports Prismic Rest API V2. Please provide only the repository name to the first createClient() parameter or use the getRepositoryEndpoint() helper to generate a valid Rest API V2 endpoint URL.",void 0,void 0);const i=new URL(r).hostname.toLowerCase();i.endsWith(".prismic.io")&&!i.endsWith(".cdn.prismic.io")&&console.warn(`[@prismicio/client] The client was created with a non-CDN endpoint. Convert it to the CDN endpoint for better performance. For more details, see ${qu("endpoint-must-use-cdn")}`),n.documentAPIEndpoint&&DC(t)&&t!==n.documentAPIEndpoint&&console.warn(`[@prismicio/client] Multiple incompatible endpoints were provided. Create the client using a repository name to prevent this error. For more details, see ${qu("prefer-repository-name")}`)}if(DC(t)){this.documentAPIEndpoint=t;try{this.repositoryName=WX(t)}catch{console.warn(`[@prismicio/client] A repository name could not be inferred from the provided endpoint (\`${t}\`). Some methods will be disabled. Create the client using a repository name to prevent this warning. For more details, see ${qu("prefer-repository-name")}`)}}else this.documentAPIEndpoint=n.documentAPIEndpoint||PX(t),this.repositoryName=t;this.accessToken=n.accessToken,this.routes=n.routes,this.brokenRoute=n.brokenRoute,this.defaultParams=n.defaultParams,n.ref&&this.queryContentFromRef(n.ref),this.graphQLFetch=this.graphQLFetch.bind(this)}set repositoryName(t){VX(this,xp,t)}get repositoryName(){if(!hj(this,xp))throw new Si(`A repository name is required for this method but one could not be inferred from the provided API endpoint (\`${this.documentAPIEndpoint}\`). To fix this error, provide a repository name when creating the client. For more details, see ${qu("prefer-repository-name")}`,void 0,void 0);return hj(this,xp)}set endpoint(t){this.documentAPIEndpoint=t}get endpoint(){return this.documentAPIEndpoint}enableAutoPreviews(){this.refState.autoPreviewsEnabled=!0}enableAutoPreviewsFromReq(t){this.refState.httpRequest=t,this.refState.autoPreviewsEnabled=!0}disableAutoPreviews(){this.refState.autoPreviewsEnabled=!1}async get(t){const{data:n}=await this._get(t);return n}async getFirst(t){var n;const r={...t};!(t&&t.page)&&!(t!=null&&t.pageSize)&&(r.pageSize=((n=this.defaultParams)==null?void 0:n.pageSize)??1);const{data:i,url:o}=await this._get(r),a=i.results[0];if(a)return a;throw new Cw("No documents were returned",o,void 0)}async dangerouslyGetAll(t={}){var n;const{limit:r=1/0,...i}=t,o={...i,pageSize:Math.min(r,i.pageSize||((n=this.defaultParams)==null?void 0:n.pageSize)||zX)},a=[];let s;for(;(!s||s.next_page)&&a.length<r;){const u=s?s.page+1:void 0;s=await this.get({...o,page:u}),a.push(...s.results),s.next_page&&await new Promise(l=>setTimeout(l,HX))}return a.slice(0,r)}async getByID(t,n){return await this.getFirst(sr(n,ma.at("document.id",t)))}async getByIDs(t,n){return await this.get(sr(n,ma.in("document.id",t)))}async getAllByIDs(t,n){return await this.dangerouslyGetAll(sr(n,ma.in("document.id",t)))}async getByUID(t,n,r){return await this.getFirst(sr(r,[Fc(t),ma.at(`my.${t}.uid`,n)]))}async getByUIDs(t,n,r){return await this.get(sr(r,[Fc(t),ma.in(`my.${t}.uid`,n)]))}async getAllByUIDs(t,n,r){return await this.dangerouslyGetAll(sr(r,[Fc(t),ma.in(`my.${t}.uid`,n)]))}async getSingle(t,n){return await this.getFirst(sr(n,Fc(t)))}async getByType(t,n){return await this.get(sr(n,Fc(t)))}async getAllByType(t,n){return await this.dangerouslyGetAll(sr(n,Fc(t)))}async getByTag(t,n){return await this.get(sr(n,ug(t)))}async getAllByTag(t,n){return await this.dangerouslyGetAll(sr(n,ug(t)))}async getByEveryTag(t,n){return await this.get(sr(n,lj(t)))}async getAllByEveryTag(t,n){return await this.dangerouslyGetAll(sr(n,lj(t)))}async getBySomeTags(t,n){return await this.get(sr(n,ug(t)))}async getAllBySomeTags(t,n){return await this.dangerouslyGetAll(sr(n,ug(t)))}async getRepository(t){const n=new URL(this.documentAPIEndpoint);return this.accessToken&&n.searchParams.set("access_token",this.accessToken),await this.fetch(n.toString(),t)}async getRefs(t){return(await this.getRepository(t)).refs}async getRefByID(t,n){const r=await this.getRefs(n);return FC(r,t)}async getRefByLabel(t,n){const r=await this.getRefs(n);return jC(r,t)}async getMasterRef(t){const n=await this.getRefs(t);return dj(n)}async getReleases(t){return(await this.getRefs(t)).filter(r=>!r.isMasterRef)}async getReleaseByID(t,n){const r=await this.getReleases(n);return FC(r,t)}async getReleaseByLabel(t,n){const r=await this.getReleases(n);return jC(r,t)}async getTags(t){try{const n=await this.getCachedRepositoryForm("tags",t),r=new URL(n.action);return this.accessToken&&r.searchParams.set("access_token",this.accessToken),await this.fetch(r.toString(),t)}catch{return(await this.getRepository(t)).tags}}async buildQueryURL({signal:t,fetchOptions:n,...r}={}){const i=r.ref||await this.getResolvedRefString({signal:t,fetchOptions:n}),o=r.integrationFieldsRef||(await this.getCachedRepository({signal:t,fetchOptions:n})).integrationFieldsRef||void 0;return UX(this.documentAPIEndpoint,{...this.defaultParams,...r,ref:i,integrationFieldsRef:o,routes:r.routes||this.routes,brokenRoute:r.brokenRoute||this.brokenRoute,accessToken:r.accessToken||this.accessToken})}async resolvePreviewURL(t){var n,r;let i=t.documentID,o=t.previewToken;if(typeof globalThis.location<"u"){const a=new URLSearchParams(globalThis.location.search);i=i||a.get("documentId"),o=o||a.get("token")}else if(this.refState.httpRequest){if("query"in this.refState.httpRequest)i=i||((n=this.refState.httpRequest.query)==null?void 0:n.documentId),o=o||((r=this.refState.httpRequest.query)==null?void 0:r.token);else if("url"in this.refState.httpRequest&&this.refState.httpRequest.url){const a=new URL(this.refState.httpRequest.url,"missing-host://").searchParams;i=i||a.get("documentId"),o=o||a.get("token")}}if(i!=null&&o!=null){const a=await this.getByID(i,{ref:o,lang:"*",signal:t.signal,fetchOptions:t.fetchOptions}),s=IX(a,{linkResolver:t.linkResolver});if(typeof s=="string")return s}return t.defaultURL}queryLatestContent(){this.refState.mode=So.Master}queryContentFromReleaseByID(t){this.refState={...this.refState,mode:So.ReleaseID,releaseID:t}}queryContentFromReleaseByLabel(t){this.refState={...this.refState,mode:So.ReleaseLabel,releaseLabel:t}}queryContentFromRef(t){this.refState={...this.refState,mode:So.Manual,ref:t}}async graphQLFetch(t,n){const r=await this.getCachedRepository(),i=await this.getResolvedRefString(),o={"Prismic-ref":i,Authorization:this.accessToken?`Token ${this.accessToken}`:"",...n?n.headers:{}};r.integrationFieldsRef&&(o["Prismic-integration-field-ref"]=r.integrationFieldsRef);const a={};for(const l in o)o[l]&&(a[l.toLowerCase()]=o[l]);const s=new URL(t);s.searchParams.set("ref",i);const u=s.searchParams.get("query");return u&&s.searchParams.set("query",SX(u)),await this.fetchFn(s.toString(),{...n,headers:a})}async getCachedRepository(t){return(!this.cachedRepository||Date.now()>=this.cachedRepositoryExpiration)&&(this.cachedRepositoryExpiration=Date.now()+QX,this.cachedRepository=await this.getRepository(t)),this.cachedRepository}async getCachedRepositoryForm(t,n){const i=(await this.getCachedRepository(n)).forms[t];if(!i)throw new Si(`Form with name "${t}" could not be found`,void 0,void 0);return i}async getResolvedRefString(t){var n,r;if(this.refState.autoPreviewsEnabled){let a,s;if((n=this.refState.httpRequest)!=null&&n.headers?"get"in this.refState.httpRequest.headers&&typeof this.refState.httpRequest.headers.get=="function"?s=this.refState.httpRequest.headers.get("cookie"):"cookie"in this.refState.httpRequest.headers&&(s=this.refState.httpRequest.headers.cookie):(r=globalThis.document)!=null&&r.cookie&&(s=globalThis.document.cookie),s&&(a=CX(s)),a)return a}const i=await this.getCachedRepository(t),o=this.refState.mode;if(o===So.ReleaseID)return FC(i.refs,this.refState.releaseID).ref;if(o===So.ReleaseLabel)return jC(i.refs,this.refState.releaseLabel).ref;if(o===So.Manual){const a=await gX(this.refState.ref)();if(typeof a=="string")return a}return dj(i.refs).ref}async _get(t,n=0){var r,i;const o=await this.buildQueryURL(t);try{return{data:await this.fetch(o,t),url:o}}catch(a){if(!(a instanceof LC||a instanceof pj)||n>=GX-1)throw a;t!=null&&t.ref||(this.cachedRepository=void 0);const s=(i=(r=a.message.match(/Master ref is: (?<ref>.*)$/))==null?void 0:r.groups)==null?void 0:i.ref;if(!s)throw a;const u=new URL(o).searchParams.get("ref"),l=a instanceof LC?"invalid":"expired";return console.warn(`The ref (${u}) was ${l}. Now retrying with the latest master ref (${s}). If you were previewing content, the response will not include draft content.`),await this._get({...t,ref:s},n+1)}}async fetch(t,n={}){const r=await super.fetch(t,n);if(r.status!==404&&r.status!==429&&r.json==null)throw new Si(void 0,t,r.json||r.text);switch(r.status){case 200:case 201:return r.json;case 400:throw new wX(r.json.message,t,r.json);case 401:case 403:throw new dy(r.json.error||r.json.message,t,r.json);case 404:throw r.json===void 0?new xX(`Prismic repository not found. Check that "${this.documentAPIEndpoint}" is pointing to the correct repository.`,t,t.startsWith(this.documentAPIEndpoint)?void 0:r.text):r.json.type==="api_notfound_error"?new LC(r.json.message,t,r.json):r.json.type==="api_security_error"&&/preview token.*expired/i.test(r.json.message)?new _X(r.json.message,t,r.json):new Cw(r.json.message,t,r.json);case 410:throw new pj(r.json.message,t,r.json);case 429:{const i=Number(r.headers.get("retry-after")),o=Number.isNaN(i)?YX:i;return await new Promise((a,s)=>{setTimeout(async()=>{try{a(await this.fetch(t,n))}catch(u){s(u)}},o)})}}throw new Si(void 0,t,r.json)}}xp=new WeakMap;const ZX=(e,t)=>new JX(e,t),fy=I.createContext(void 0);function we(){const e=I.useContext(fy);if(!e)throw new Error("Missing EditorConfigContext.Provider");return e}class Sw extends Error{}function Rt(e){throw new Sw(`Missing EditorConfig.${e}`)}function XX(){if(new URL(location.href).searchParams.has("debug"))return;const n=console.error.bind(console);console.error=(...r)=>{r[0]instanceof Sw||eee(r)||n(...r)},window.addEventListener("error",r=>{r.error instanceof Sw&&r.preventDefault(),tee(r.error)&&r.preventDefault()})}function eee(e){const t="Warning: flushSync was called from inside a lifecycle method",n=typeof e[0]=="string"&&e[0].includes(t),r=typeof e[1]=="string"&&e[1].includes("RichTextField");return n&&r}function tee(e){const t=/Invalid content for node document: <(bulletList|orderedList)\(listItem*/,n=e.message;return!!(typeof n=="string"&&n.match(t))}function ud(e){const{label:t,size:n,...r}=e;return d.jsxs(m.Box,{display:"grid",gap:8,gridTemplateColumns:"1fr 1fr",children:[d.jsx(m.Box,{borderRadius:6,backgroundColor:"grey2",border:!0,alignItems:"center",padding:{inline:12},children:d.jsx(m.Text,{variant:"normal",component:"label",color:"grey10",children:t})}),d.jsx(m.FormInput,{...r,size:"medium"})]})}function fU(){var r,i;const e=Ea();function t(o){e.setPagination({...e.pagination,page:o?Math.max(1,parseInt(o)):void 0})}function n(o){e.setPagination({...e.pagination,pageSize:o?Math.min(Math.max(1,parseInt(o)),100):void 0})}return d.jsxs(d.Fragment,{children:[d.jsx(ud,{type:"number",value:((r=e.pagination.page)==null?void 0:r.toString())??"",onValueChange:t,label:"PAGE",placeholder:"1"}),d.jsx(ud,{type:"number",value:((i=e.pagination.pageSize)==null?void 0:i.toString())??"",onValueChange:n,label:"PAGE SIZE",placeholder:"20"})]})}const Aj={type:"getByType",Fieldset(){var n,r;const e=Ea();function t(i){e.setRequestOptions("getByType",{...e.options.getByType,type:i})}return d.jsxs(d.Fragment,{children:[d.jsx(ud,{value:((n=e.options.getByType)==null?void 0:n.type)??"",onValueChange:t,label:"TYPE *",placeholder:"page",size:"medium",error:!((r=e.options.getByType)!=null&&r.type)}),d.jsx(fU,{})]})},getSnippet(e){const t=[];return e.page&&t.push(` page: ${e.page}`),e.pageSize&&t.push(` pageSize: ${e.pageSize}`),t.length?`client.getByType(${e.type?`"${e.type}"`:"type"}, {
|
|
2
|
+
${t.join(`,
|
|
3
|
+
`)}
|
|
4
|
+
})`:`client.getByType(${e.type?`"${e.type}"`:"type"})`},run(e,t){return e.getByType(String(t.type),{page:t.page,pageSize:t.pageSize})}},mj={type:"getByUID",Fieldset(){var r,i,o,a;const e=Ea();function t(s){e.setRequestOptions("getByUID",{...e.options.getByUID,type:s})}function n(s){e.setRequestOptions("getByUID",{...e.options.getByUID,uid:s})}return d.jsxs(d.Fragment,{children:[d.jsx(ud,{value:((r=e.options.getByUID)==null?void 0:r.type)??"",onValueChange:t,label:"TYPE *",placeholder:"page",size:"medium",error:!((i=e.options.getByUID)!=null&&i.type)}),d.jsx(ud,{value:((o=e.options.getByUID)==null?void 0:o.uid)??"",onValueChange:n,label:"UID *",placeholder:"homepage",size:"medium",error:!((a=e.options.getByUID)!=null&&a.uid)})]})},getSnippet(e){return`client.getByUID(${e.type?`"${e.type}"`:"type"}, ${e.uid?`"${e.uid}"`:"uid"})`},run(e,t){return e.getByUID(String(t.type),String(t.uid))}},gj={type:"getRepository",getSnippet(){return"client.getRepository()"},run(e){return e.getRepository()}},vj={type:"get",Fieldset(){return d.jsx(fU,{})},getSnippet(e){const t=[];return e.page&&t.push(` page: ${e.page}`),e.pageSize&&t.push(` pageSize: ${e.pageSize}`),t.length?`client.get({
|
|
5
|
+
${t.join(`,
|
|
6
|
+
`)}
|
|
7
|
+
})`:"client.get()"},run(e,t){return e.get({page:t.page,pageSize:t.pageSize})}},yj={type:"getSingle",Fieldset(){var n,r;const e=Ea();function t(i){e.setRequestOptions("getSingle",{...e.options.getSingle,type:i})}return d.jsx(d.Fragment,{children:d.jsx(ud,{value:((n=e.options.getSingle)==null?void 0:n.type)??"",onValueChange:t,label:"TYPE *",placeholder:"settings",size:"medium",error:!((r=e.options.getSingle)!=null&&r.type)})})},getSnippet(e){return`client.getSingle(${e.type?`"${e.type}"`:"type"})`},run(e,t){return e.getSingle(String(t.type))}},py={[vj.type]:vj,[Aj.type]:Aj,[mj.type]:mj,[yj.type]:yj,[gj.type]:gj},pU=I.createContext(void 0),nee=e=>{const{children:t}=e,n=we(),[r,i]=I.useState({repository:{id:"repository"in n?n.repository:"",accessToken:""},type:"get",options:{},pagination:{}}),a={...r,...{setRepositoryID(s){i(u=>({...u,repository:{...u.repository,id:s}}))},setRepositoryAccessToken(s){i(u=>({...u,repository:{...u.repository,accessToken:s}}))},setRequestType(s){i(u=>({...u,type:s}))},setRequestOptions(s,u){i(l=>({...l,options:{...l.options,[s]:u}}))},setPagination(s){i(u=>({...u,pagination:s}))},async run(){var f,p;i(h=>({...h,response:{status:"pending"}})),(f=n.onAnalyticsEvent)==null||f.call(n,"API Explorer Request",{type:a.type,repositoryID:a.repository.id});let s,u;const l=ZX(r.repository.id,{accessToken:r.repository.accessToken,fetch(h,A){return s=new URL(h).searchParams.get("ref")??void 0,u=h,fetch(h,A)}}),c=Date.now();try{const h=await py[r.type].run(l,{...r.options[r.type],...r.pagination});i(A=>({...A,response:{status:"success",duration:Date.now()-c,ref:s,url:u,data:h}}))}catch(h){const A=h instanceof Error?h:new Error("Unknown error");i(g=>({...g,response:{status:"error",duration:Date.now()-c,url:u,error:A}})),(p=n.onAnalyticsEvent)==null||p.call(n,"API Explorer Request Error",{type:a.type,repositoryID:a.repository.id,url:u,error:A.message})}}}};return I.useEffect(()=>{a.run()},[]),d.jsx(pU.Provider,{value:{request:a},children:t})};function ree(){const e=I.useContext(pU);if(!e)throw new Error("useAPIExplorer must be used within an APIExplorerProvider");return e}function Ea(){return ree().request}const iee=18,oee=41,aee=24;function sv(e){const t=e.code.split(`
|
|
8
|
+
`).length;return d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(m.Alert,{icon:"alert",title:"Oops! We couldn't load the Code Block",color:"error",noShadow:!0,footerButtons:{action:{onClick:()=>window.location.reload(),text:"Refresh page"}}}),children:d.jsx(I.Suspense,{fallback:d.jsx(m.Skeleton,{height:oee+aee+t*iee,borderRadius:6}),children:d.jsx(m.LazyCodeBlock,{...e})})})}function see(){const e=Ea();return d.jsx(m.Box,{display:"grid",gridTemplateRows:"minmax(0, 1fr)",minHeight:0,minWidth:0,children:d.jsx(m.Form,{onSubmit:e.run,children:d.jsxs(m.Box,{display:"grid",gridTemplateRows:"auto 1fr",borderRadius:8,border:!0,minHeight:0,minWidth:0,children:[d.jsx(m.Box,{as:"header",padding:{inline:16},alignItems:"center",border:{bottom:!0},minHeight:48,children:d.jsx(m.Text,{variant:"small",component:"h2",color:"grey9",children:"Request"})}),d.jsxs(m.Box,{display:"flex",flexDirection:"column",overflowY:"auto",children:[d.jsx(uee,{}),d.jsx(lee,{}),d.jsx(cee,{}),d.jsx(fee,{})]})]})})})}function uee(){const e=Ea();return d.jsx(m.Box,{padding:16,border:{bottom:!0},display:"grid",children:d.jsx(m.Select,{color:"grey",size:"large",side:"bottom",flexContent:!0,boldTriggerText:!0,endIcon:"unfoldMore",value:e.type,onValueChange:t=>e.setRequestType(t),children:Object.values(py).map(({type:t})=>d.jsx(m.SelectItem,{value:t,children:t},t))})})}function lee(){const e=Ea(),t=py[e.type].Fieldset;return t?d.jsxs(m.Box,{display:"flex",flexDirection:"column",padding:16,border:{bottom:!0},gap:8,children:[d.jsx(m.Text,{variant:"emphasized",component:"h3",color:"grey11",children:"Params"}),d.jsx(t,{})]}):null}function cee(){return d.jsx(m.Box,{padding:16,border:{bottom:!0},display:"grid",children:d.jsx(m.Button,{type:"submit",color:"purple",size:"large",endIcon:"arrowForward",children:"Send"})})}const dee="https://prismic.io/docs/technical-reference/prismicio-client";function fee(){const e=Ea(),[t,n]=I.useState("");return I.useEffect(()=>{const r=e.repository.accessToken?`const client = createClient("${e.repository.id}", {
|
|
9
|
+
accessToken: process.env.PRISMIC_ACCESS_TOKEN,
|
|
10
|
+
})`:`const client = createClient("${e.repository.id}")`,i=py[e.type].getSnippet({...e.options[e.type],...e.pagination});n(`${r}
|
|
11
|
+
|
|
12
|
+
const response = await ${i}`)},[e.repository,e.type,e.options,e.pagination]),d.jsxs(m.Box,{display:"flex",flexDirection:"column",padding:16,gap:8,children:[d.jsx(m.Text,{variant:"emphasized",component:"h3",color:"grey11",children:"Client code"}),d.jsx(sv,{title:"request.ts",language:"typescript",code:t,showLineNumbers:!1}),d.jsxs(m.Text,{children:["Learn more on"," ",d.jsx(m.Text,{component:"a",href:dee,target:"blank",underline:!0,children:"@prismicio/client documentation"}),"."]})]})}const Vu=(e,t,n,r,i)=>{if(!r)throw new Error(i??`Invalid property path: ${t}
|
|
13
|
+
Couldn't access "${n}" in ${JSON.stringify(e)}`)},bj=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Dg=e=>Array.isArray(e),hU=(e,t)=>e.filter((n,r)=>r!==t),pee=(e,t,n,r={})=>{const{remove:i=!1,createNew:o=!0,noError:a=!1}=r,s=e,u=typeof(l=t)=="string"?l:typeof l=="number"?String(l):l.reduce((p,h)=>typeof h=="number"?`${p}[${h}]`:p===""?h:`${p}.${h}`,"");var l;const c=Object.assign(Object.assign({},r),{remove:i,createNew:o,noError:a,fullData:s,fullPath:u}),f=Array.isArray(t)?t:(p=>Array.isArray(p)?p:p.split(/(\.|\[\d+\])/).filter(h=>h!=="."&&h!=="").map(h=>{const A=/\[(\d+)\]/.exec(h);return A?Number(A[1]):h}).flat())(t).filter(p=>p!=="");return Dg(e)&&i&&f.length===1?hU(e,f[0]):Tp(e,f,n,c)},Tp=(e,t,n,r)=>{const i=bj(e)?Object.assign({},e):null,o=Dg(e)?[...e]:null;if(t.length===0)return e;if(!i&&!o)throw new Error("Can't assign property -- invalid input object");const{createNew:a,remove:s,noError:u,fullData:l,fullPath:c}=r,f=t[0];if(o&&typeof f=="string")return o.map(g=>Tp(g,t,n,r));if(t.length===1){if(i&&typeof f=="string"){const g=hee(i,f,n,r);return g??i}return o&&typeof f=="number"?(Aee(o,f,n,r),o):(Vu(l,c,f,u),e)}const p=i||o||[];if(s&&t.length===2&&typeof t[1]=="number"){const g=p[f],y=t[1];return Dg(g)?p[f]=hU(g,y):Vu(l,c,f,u,"Trying to remove an indexed item from an object that is not an array"),p}const h=t.slice(1);if(f in e){if(A=p[f],!Dg(A)&&!bj(A)){if(!a)return Vu(l,c,f,u),p;p[f]={}}return p[f]=Tp(p[f],h,n,r),p}var A;if(a){const g=typeof h[0]=="number"?[]:{};if(i)return p[f]=g,p[f]=Tp(p[f],h,n,r),p;if(o&&Array.isArray(p)){p.push(g);const y=p.length-1;return p[y]=Tp(p[y],h,n,r),p}}return Vu(l,c,f,u),p},hee=(e,t,n,r)=>{const{remove:i,createNew:o,noError:a,insertAfter:s,insertBefore:u,fullData:l,fullPath:c}=r;if(u!==void 0||s!==void 0){const p=Object.entries(e);let h=1/0;return h=typeof u=="number"?u:typeof s=="number"?s:p.findIndex(([A,g])=>A===(u??s)),s&&h++,p.splice(h,0,[t,n]),Object.fromEntries(p)}const f=t in e;i?f?delete e[t]:Vu(l,c,t,a):o||f?e[t]=n:Vu(l,c,t,a)},Aee=(e,t,n,r)=>{const{noError:i,fullData:o,fullPath:a,createNew:s,insert:u}=r;u&&e.splice(t,0,n),t in e?e[t]=n:s?e.push(n):Vu(o,a,t,i)},th=(e,t,n)=>{const r=Array.isArray(t)?t:mee(t);if(r.length===0)return e;const i=r[0];if(Array.isArray(e)&&typeof i!="number")return e.map(a=>th(a,r,n));if(typeof e!="object"||e===null||!(i in e))return gee(e,i,n);const o=e[i];return r.length===1?o:th(o,r.slice(1),n)},mee=e=>e.split(/(\.|\[\d+\])/).filter(t=>t!=="."&&t!=="").map(t=>{const n=/\[(\d+)\]/.exec(t);return n?Number(n[1]):t}).flat(),gee=(e,t,n)=>{if(n===void 0)throw new Error(`Unable to extract object property
|
|
14
|
+
Looking for property: ${t}
|
|
15
|
+
In object: ${JSON.stringify(e)}`);return n};function Wc(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(l){try{u(r.next(l))}catch(c){o(c)}}function s(l){try{u(r.throw(l))}catch(c){o(c)}}function u(l){var c;l.done?i(l.value):(c=l.value,c instanceof n?c:new n(function(f){f(c)})).then(a,s)}u((r=r.apply(e,t||[])).next())})}const AU=({className:e,name:t,value:n,setValue:r,handleKeyPress:i,styles:o,textAreaRef:a})=>{if(typeof n!="string")return null;const s=n.slice(-1)===`
|
|
16
|
+
`?n+".":n;return d.jsxs("div",{style:{display:"grid"},children:[d.jsx("textarea",{id:`${t}_textarea`,ref:a,style:Object.assign({height:"auto",gridArea:"1 / 1 / 2 / 2",overflowY:"auto",whiteSpace:"pre-wrap"},o),rows:1,className:e,name:`${t}_textarea`,value:n,onChange:u=>r(u.target.value),autoFocus:!0,onFocus:u=>{n.length<40&&u.target.select()},onKeyDown:i}),d.jsx("span",{className:e,style:Object.assign({visibility:"hidden",height:"auto",gridArea:"1 / 1 / 2 / 2",color:"red",opacity:.9,whiteSpace:"pre-wrap",overflowY:"auto",border:"1px solid transparent"},o),children:s})]})},ld=e=>e!==null&&typeof e=="object",mU=(e,t,n,r="")=>{if(!n&&!r)return!0;switch(e){case"collection":if(n){if(n(t,r))return!0;if(!ww(r,t,n))return!1}if(!n&&r&&!ww(r,t))return!1;break;case"value":if(n&&!n(t,r)||!n&&r&&!cd(t,r))return!1}return!0},ww=(e="",t,n=cd)=>{const r=t.value;return Object.entries(r).some(([i,o])=>{const a=[...t.path,i],s=Object.assign(Object.assign({},t),{key:i,path:a,level:t.level+1,value:o,size:a.length,parentData:r});return ld(o)?ww(e,s,n):n(s,e)})},cd=(e,t="")=>{const{value:n}=e;if(n===null&&"null".includes(t.toLowerCase()))return!0;switch(typeof n){case"string":return n.toLowerCase().includes(t.toLowerCase());case"number":return!!String(n).includes(t);case"boolean":return n?"true".includes(t.toLowerCase())||t==="1":"false".includes(t.toLowerCase())||t==="0";default:return!1}},Cj=({key:e,path:t},n="")=>!!cd({value:e},n)||!!t.some(r=>cd({value:r},n)),vee=(e,t=200)=>typeof e=="string"?e.length<t?e:`${e.slice(0,t-2).trim()}...`:e,Wd=(e,t)=>(t??"")+e.map(n=>n===""?String.fromCharCode(0):n).join("."),ax=e=>e.shiftKey?"Shift":e.metaKey?"Meta":e.ctrlKey?"Control":e.altKey?"Alt":void 0,yee=(e,t,n)=>{const r=e.key,i=ax(e);if(Array.isArray(t))return!!i&&t.includes(i);const{key:o,modifier:a}=t;return(n!=="stringLineBreak"||r!=="Enter"||i!=="Shift"||o!=="Enter"||!(a!=null&&a.includes("Shift")))&&r===o&&(a===i||Array.isArray(a)&&a.includes(i))},Mu={key:"Enter"},Sj={confirm:Mu,cancel:{key:"Escape"},objectConfirm:Object.assign(Object.assign({},Mu),{modifier:["Meta","Shift","Control"]}),objectLineBreak:Mu,stringConfirm:Mu,stringLineBreak:Object.assign(Object.assign({},Mu),{modifier:["Shift"]}),numberConfirm:Mu,numberUp:{key:"ArrowUp"},numberDown:{key:"ArrowDown"},tabForward:{key:"Tab"},tabBack:{key:"Tab",modifier:"Shift"},booleanConfirm:Mu,booleanToggle:{key:" "},clipboardModifier:["Meta","Control"],collapseModifier:["Alt"]},Ts=(e,t,n="next",r)=>{const i=t.slice(0,t.length-1),o=t.slice(-1)[0];if(o===void 0)return null;const a=th(e,i),s=bee(a);Array.isArray(a)||r(s,({key:c,value:f})=>[c,f]);const u=s.findIndex(c=>c.key===o),l=s[u+(n==="next"?1:-1)];return l?ld(l.value)?Object.keys(l.value).length===0?Ts(e,[...i,l.key],n,r):gU(e,[...i,l.key],n,r):[...i,l.key]:i.length===0?null:Ts(e,i,n,r)},gU=(e,t,n="next",r)=>{const i=th(e,t);if(!ld(i))return t;const o=Array.isArray(i)?i.map((s,u)=>u):Object.keys(i);r(o,s=>[s,i]);const a=n==="next"?o[0]:o[o.length-1];return gU(e,[...t,a],n,r)},bee=e=>Array.isArray(e)?e.map((t,n)=>({index:n,value:t,key:n})):Object.entries(e).map(([t,n],r)=>({key:t,value:n,index:r})),vU=(e,t)=>{var n,r,i,o;const a=e.current,s=(n=a==null?void 0:a.selectionStart)!==null&&n!==void 0?n:1/0,u=(r=a==null?void 0:a.selectionEnd)!==null&&r!==void 0?r:1/0,l=((i=a==null?void 0:a.textContent)===null||i===void 0?void 0:i.slice(0,s))+t+((o=a==null?void 0:a.textContent)===null||o===void 0?void 0:o.slice(u));return a.value=l,a==null||a.setSelectionRange(s+1,s+1),l},sx={displayName:"Default",fragments:{edit:"rgb(42, 161, 152)"},styles:{container:{backgroundColor:"#f6f6f6",fontFamily:"monospace"},collection:{},collectionInner:{},collectionElement:{},dropZone:{},property:"#292929",bracket:{color:"rgb(0, 43, 54)",fontWeight:"bold"},itemCount:{color:"rgba(0, 0, 0, 0.3)",fontStyle:"italic"},string:"rgb(203, 75, 22)",number:"rgb(38, 139, 210)",boolean:"green",null:{color:"rgb(220, 50, 47)",fontVariant:"small-caps",fontWeight:"bold"},input:["#292929"],inputHighlight:"#b3d8ff",error:{fontSize:"0.8em",color:"red",fontWeight:"bold"},iconCollection:"rgb(0, 43, 54)",iconEdit:"edit",iconDelete:"rgb(203, 75, 22)",iconAdd:"edit",iconCopy:"rgb(38, 139, 210)",iconOk:"green",iconCancel:"rgb(203, 75, 22)"}},yU=I.createContext({getStyles:()=>({}),icons:{}}),Cee=({theme:e=sx,icons:t={},docRoot:n,children:r})=>{const i=See(e,n);return d.jsx(yU.Provider,{value:{getStyles:(o,a)=>typeof i[o]=="function"?i[o](a):i[o],icons:t},children:r})},Bo=()=>I.useContext(yU),See=(e,t)=>{var n,r,i,o;const a={},s=(Array.isArray(e)?e:[e]).map(c=>wee(c)?UC({fragments:{},styles:c},a):UC(c,a)),u=UC(sx,{});Object.keys(u).forEach(c=>{const f=c;s.forEach(p=>{p[f]&&(u[f]=Object.assign(Object.assign({},u[f]),p[f]))})});const l=Object.assign({},u);return Object.entries(a).forEach(([c,f])=>{const p=c;l[p]=h=>{const A=f(h)||{};return Object.assign(Object.assign({},u[p]),A)}}),typeof(l==null?void 0:l.inputHighlight)!="function"&&(!((n=l==null?void 0:l.inputHighlight)===null||n===void 0)&&n.backgroundColor)&&t.style.setProperty("--jer-highlight-color",(r=l==null?void 0:l.inputHighlight)===null||r===void 0?void 0:r.backgroundColor),typeof(l==null?void 0:l.iconCopy)!="function"&&(!((i=l==null?void 0:l.iconCopy)===null||i===void 0)&&i.color)&&t.style.setProperty("--jer-icon-copy-color",(o=l==null?void 0:l.iconCopy)===null||o===void 0?void 0:o.color),l},UC=(e,t)=>{const{fragments:n,styles:r}=e,i={};return Object.entries(r).forEach(([o,a])=>{const s=(Array.isArray(a)?a:[a]).reduce((u,l)=>{var c,f;if(typeof l=="function")return t[o]=l,Object.assign({},u);if(typeof l=="string"){const p=(c=n==null?void 0:n[l])!==null&&c!==void 0?c:l;return typeof p=="string"?Object.assign(Object.assign({},u),{[(f=_ee[o])!==null&&f!==void 0?f:"color"]:p}):Object.assign(Object.assign({},u),p)}return Object.assign(Object.assign({},u),l)},{});i[o]=s}),i},wee=e=>!("styles"in e),_ee={container:"backgroundColor",collection:"backgroundColor",collectionInner:"backgroundColor",collectionElement:"backgroundColor",dropZone:"borderColor",inputHighlight:"backgroundColor"},bU=I.createContext({collapseState:null,setCollapseState:()=>{},doesPathMatch:()=>!1,currentlyEditingElement:null,setCurrentlyEditingElement:()=>{},previouslyEditedElement:null,setPreviouslyEditedElement:()=>{},areChildrenBeingEdited:()=>!1,dragSource:{path:null,pathString:null},setDragSource:()=>{},tabDirection:"next",setTabDirection:()=>{}}),xee=({children:e})=>{const[t,n]=I.useState(null),[r,i]=I.useState(null),[o,a]=I.useState({path:null,pathString:null}),s=I.useRef(null),u=I.useRef("next"),l=I.useRef(null);return d.jsx(bU.Provider,{value:{collapseState:t,setCollapseState:c=>{n(c),c!==null&&setTimeout(()=>n(null),2e3)},doesPathMatch:c=>{if(t===null)return!1;for(const[f,p]of t.path.entries())if(p!==c[f])return!1;return!0},currentlyEditingElement:r,setCurrentlyEditingElement:(c,f)=>{const p=typeof c=="string"||c===null?c:Wd(c,f==="key"?"key_":void 0);r!==null&&p!==null&&s.current!==null&&s.current(),i(p),s.current=typeof f=="function"?f:null},areChildrenBeingEdited:c=>r!==null&&r.includes(c),previouslyEditedElement:l.current,setPreviouslyEditedElement:c=>{l.current=c},tabDirection:u.current,setTabDirection:c=>{u.current=c},dragSource:o,setDragSource:a},children:e})},Yh=()=>I.useContext(bU),_w="**INVALID_FUNCTION**",Tee=({value:e,setValue:t,isEditing:n,path:r,setIsEditing:i,handleEdit:o,stringTruncate:a,showStringQuotes:s,nodeData:u,handleKeyboard:l,keyboardCommon:c})=>{const{getStyles:f}=Bo(),p=I.useRef(null),h=Wd(r),A=s?'"':"";return n?d.jsx(AU,{className:"jer-input-text",textAreaRef:p,name:h,value:e,setValue:t,isEditing:n,handleKeyPress:g=>{l(g,Object.assign({stringConfirm:o,stringLineBreak:()=>{const y=vU(p,`
|
|
17
|
+
`);t(y)}},c))},styles:f("input",u)}):d.jsxs("div",{id:`${h}_display`,onDoubleClick:()=>i(!0),onClick:g=>{(g.getModifierState("Control")||g.getModifierState("Meta"))&&i(!0)},className:"jer-value-string",style:f("string",u),children:[A,vee(e,a),A]})},Iee=({value:e,setValue:t,isEditing:n,path:r,setIsEditing:i,handleEdit:o,nodeData:a,handleKeyboard:s,keyboardCommon:u})=>{const{getStyles:l}=Bo();return n?d.jsx("input",{className:"jer-input-number",type:"text",name:Wd(r),value:e,onChange:c=>t(c.target.value.replace(/[^0-9.-]/g,"")),autoFocus:!0,onFocus:c=>c.target.select(),onKeyDown:c=>s(c,Object.assign({numberConfirm:o,numberUp:()=>t(Number(e)+1),numberDown:()=>t(Number(e)-1)},u)),style:Object.assign({width:String(e).length/1.5+2+"em"},l("input",a))}):d.jsx("span",{onDoubleClick:()=>i(!0),className:"jer-value-number",style:l("number",a),children:e})},Eee=({value:e,setValue:t,isEditing:n,path:r,setIsEditing:i,handleEdit:o,nodeData:a,handleKeyboard:s,keyboardCommon:u})=>{const{getStyles:l}=Bo();return n?d.jsx("input",{className:"jer-input-boolean",type:"checkbox",name:Wd(r),checked:e,onChange:()=>t(!e),onKeyDown:c=>{c.key===" "&&c.preventDefault(),s(c,Object.assign({booleanConfirm:o,booleanToggle:()=>t(!e)},u))},autoFocus:!0}):d.jsx("span",{onDoubleClick:()=>i(!0),className:"jer-value-boolean",style:l("boolean",a),children:String(e)})},Ree=({value:e,isEditing:t,setIsEditing:n,handleEdit:r,nodeData:i,handleKeyboard:o,keyboardCommon:a})=>{const{getStyles:s}=Bo(),u=I.useRef();I.useEffect(()=>{if(t)return u.current=window.setTimeout(()=>window.addEventListener("keydown",l),100),()=>window.removeEventListener("keydown",l);window.clearTimeout(u.current)},[t]);const l=c=>o(c,Object.assign({confirm:r},a));return d.jsx("div",{onDoubleClick:()=>n(!0),className:"jer-value-null",style:s("null",i),children:String(e)})},$ee=({value:e})=>{let t="Error!";switch(typeof e){case"string":e===_w&&(t="Function");break;case"undefined":t="Undefined";break;case"symbol":t="Symbol"}return d.jsx("span",{className:"jer-value-invalid",children:t})},kee=({size:e,style:t,className:n})=>d.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:e,height:e,className:n,style:t,children:[d.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4z"}),d.jsx("path",{d:"M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2zm0 18c-4.411 0-8-3.589-8-8s3.589-8 8-8 8 3.589 8 8-3.589 8-8 8z"})]}),Oee=({size:e,style:t,className:n})=>d.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:e,height:e,className:n,style:t,transform:"translate(0, 0.5)",children:[d.jsx("path",{d:"M7 17.013l4.413-.015 9.632-9.54c.378-.378.586-.88.586-1.414s-.208-1.036-.586-1.414l-1.586-1.586c-.756-.756-2.075-.752-2.825-.003L7 12.583v4.43zM18.045 4.458l1.589 1.583-1.597 1.582-1.586-1.585 1.594-1.58zM9 13.417l6.03-5.973 1.586 1.586-6.029 5.971L9 15.006v-1.589z"}),d.jsx("path",{d:"M5 21h14c1.103 0 2-.897 2-2v-8.668l-2 2V19H8.158c-.026 0-.053.01-.079.01-.033 0-.066-.009-.1-.01H5V5h6.847l2-2H5c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2z"})]}),Mee=({size:e,style:t,className:n})=>d.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:e,height:e,className:n,style:t,children:d.jsx("path",{d:"M6 19a2 2 0 002 2h8a2 2 0 002-2V7H6v12m2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12M15.5 4l-1-1h-5l-1 1H5v2h14V4h-3.5z"})}),Fee=({size:e,style:t,className:n})=>d.jsxs("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:e,height:e,className:n,style:t,children:[d.jsx("path",{d:"M9 2 H15 A1 1 0 0 1 16 3 V5 A1 1 0 0 1 15 6 H9 A1 1 0 0 1 8 5 V3 A1 1 0 0 1 9 2 z"}),d.jsx("path",{d:"M8 4H6a2 2 0 00-2 2v14a2 2 0 002 2h12a2 2 0 002-2v-2M16 4h2a2 2 0 012 2v4M21 14H11"}),d.jsx("path",{d:"M15 10l-4 4 4 4"})]}),jee=({size:e,style:t,className:n})=>d.jsxs("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:e,height:e,className:n,style:t,children:[d.jsx("path",{d:"M22 11.08V12a10 10 0 11-5.93-9.14"}),d.jsx("path",{d:"M22 4L12 14.01l-3-3"})]}),Lee=({size:e,style:t,className:n})=>d.jsx("svg",{baseProfile:"tiny",viewBox:"0 0 24 24",fill:"currentColor",width:e,height:e,className:n,style:t,children:d.jsx("path",{d:"M12 4c-4.411 0-8 3.589-8 8s3.589 8 8 8 8-3.589 8-8-3.589-8-8-8zm-5 8c0-.832.224-1.604.584-2.295l6.711 6.711A4.943 4.943 0 0112 17c-2.757 0-5-2.243-5-5zm9.416 2.295L9.705 7.584A4.943 4.943 0 0112 7c2.757 0 5 2.243 5 5 0 .832-.224 1.604-.584 2.295z"})}),Dee=({size:e,style:t,className:n})=>d.jsx("svg",{viewBox:"0 0 512 512",fill:"currentColor",width:e,height:e,className:n,style:t,children:d.jsx("path",{d:"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"})}),zu=({name:e,nodeData:t,rotate:n})=>{var r,i,o,a,s,u,l;const{getStyles:c,icons:f}=Bo(),p={size:"1.4em",className:"jer-icon"};switch(e){case"add":return(r=f==null?void 0:f.add)!==null&&r!==void 0?r:d.jsx(kee,Object.assign({},p,{style:c("iconAdd",t)}));case"edit":return(i=f==null?void 0:f.edit)!==null&&i!==void 0?i:d.jsx(Oee,Object.assign({},p,{style:c("iconEdit",t)}));case"delete":return(o=f==null?void 0:f.delete)!==null&&o!==void 0?o:d.jsx(Mee,Object.assign({},p,{style:c("iconDelete",t),size:"1.45em"}));case"copy":return(a=f==null?void 0:f.copy)!==null&&a!==void 0?a:d.jsx(Fee,Object.assign({},p,{style:c("iconCopy",t),size:"1.2em"}));case"ok":return(s=f==null?void 0:f.ok)!==null&&s!==void 0?s:d.jsx(jee,Object.assign({},p,{style:Object.assign({fontSize:"90%"},c("iconOk",t))}));case"cancel":return(u=f==null?void 0:f.cancel)!==null&&u!==void 0?u:d.jsx(Lee,Object.assign({},p,{style:Object.assign({fontSize:"130%"},c("iconCancel",t))}));case"chevron":return(l=f==null?void 0:f.chevron)!==null&&l!==void 0?l:d.jsx(Dee,{size:"1em",style:c("iconCollection",t)});default:return d.jsx(d.Fragment,{})}},CU=({startEdit:e,handleDelete:t,handleAdd:n,enableClipboard:r,type:i,customButtons:o,nodeData:a,translate:s,keyboardControls:u,handleKeyboard:l})=>{const{getStyles:c}=Bo(),f=s("KEY_NEW",a),[p,h]=I.useState(!1),[A,g]=I.useState(f),{key:y,path:C,value:_}=a;return d.jsxs("div",{className:"jer-edit-buttons",style:{opacity:p?1:void 0},children:[r&&d.jsx("div",{onClick:b=>{var v;b.stopPropagation();let S,w,T="value",E="",R=null;if(r){const O=ax(b);if(O&&u.clipboardModifier.includes(O)?(S=Uee(C),E=S,T="path"):(S=_,E=i?JSON.stringify(_,null,2):String(S)),!navigator.clipboard)return void(typeof r=="function"&&r({success:!1,value:S,stringValue:E,path:C,key:y,type:T,errorMessage:"Can't access clipboard API"}));(v=navigator.clipboard)===null||v===void 0||v.writeText(E).then(()=>w=!0).catch($=>{w=!1,R=$.message}).finally(()=>{typeof r=="function"&&r({success:w,errorMessage:R,value:S,stringValue:E,path:C,key:y,type:T})})}},className:"jer-copy-pulse",children:d.jsx(zu,{name:"copy",nodeData:a})}),e&&d.jsx("div",{onClick:b=>{b.stopPropagation(),e()},children:d.jsx(zu,{name:"edit",nodeData:a})}),t&&d.jsx("div",{onClick:b=>{b.stopPropagation(),t()},children:d.jsx(zu,{name:"delete",nodeData:a})}),n&&d.jsx("div",{onClick:b=>{b.stopPropagation(),i==="object"?h(!0):n("")},children:d.jsx(zu,{name:"add",nodeData:a})}),o==null?void 0:o.map(({Element:b,onClick:v},S)=>d.jsx("div",{onClick:w=>v&&v(a,w),children:d.jsx(b,{nodeData:a})},S)),p&&n&&i==="object"&&d.jsxs(d.Fragment,{children:[d.jsx("input",{className:"jer-input-new-key",type:"text",name:"new-object-key",value:A,onChange:b=>g(b.target.value),autoFocus:!0,onFocus:b=>b.target.select(),onKeyDown:b=>{l(b,{stringConfirm:()=>{n&&(h(!1),n(A),g(f))},cancel:()=>{h(!1),g(f)}})},style:c("input",a)}),d.jsx(ux,{onOk:b=>{A&&(b.stopPropagation(),h(!1),n(A))},onCancel:b=>{b.stopPropagation(),h(!1)},nodeData:a})]})]})},ux=({onOk:e,onCancel:t,nodeData:n})=>d.jsxs("div",{className:"jer-confirm-buttons",children:[d.jsx("div",{onClick:e,children:d.jsx(zu,{name:"ok",nodeData:n})}),d.jsx("div",{onClick:t,children:d.jsx(zu,{name:"cancel",nodeData:n})})]}),Uee=e=>e.reduce((t,n)=>typeof n=="number"?`${t}[${n}]`:t===""?n:`${t}.${n}`,""),Bee=["string","number","boolean","null","object","array"],SU=(e=[],t)=>{const n=e.filter(({condition:A})=>A(t));if(n.length===0)return{};const r=n[0],{element:i,wrapperElement:o,customNodeProps:a,wrapperProps:s,hideKey:u=!1,showEditTools:l=!0,showOnEdit:c=!1,showOnView:f=!0,showCollectionWrapper:p=!0}=r,h=function(A,g){var y={};for(var C in A)Object.prototype.hasOwnProperty.call(A,C)&&g.indexOf(C)<0&&(y[C]=A[C]);if(A!=null&&typeof Object.getOwnPropertySymbols=="function"){var _=0;for(C=Object.getOwnPropertySymbols(A);_<C.length;_++)g.indexOf(C[_])<0&&Object.prototype.propertyIsEnumerable.call(A,C[_])&&(y[C[_]]=A[C[_]])}return y}(r,["element","wrapperElement","customNodeProps","wrapperProps","hideKey","showEditTools","showOnEdit","showOnView","showCollectionWrapper"]);return Object.assign({CustomNode:i,CustomWrapper:o,customNodeProps:a,wrapperProps:s,hideKey:u,showEditTools:l,showOnEdit:c,showOnView:f,showCollectionWrapper:p},h)},wU=({props:e,collapsed:t})=>{const{data:n,nodeData:r,parentData:i,onEdit:o,onError:a,showErrorMessages:s,restrictEditFilter:u,restrictDeleteFilter:l,restrictAddFilter:c,restrictDragFilter:f,translate:p,errorMessageTimeout:h}=e,{currentlyEditingElement:A,setCurrentlyEditingElement:g}=Yh(),[y,C]=I.useState(null),_=Object.assign(Object.assign({},r),{collapsed:t}),{path:b,key:v,size:S}=_,w=Wd(b),T=I.useMemo(()=>!u(_),[_]),E=I.useMemo(()=>!l(_),[_]),R=I.useMemo(()=>!c(_),[_]),O=I.useMemo(()=>!f(_)&&E&&A===null,[_]),$=N=>{s&&(C(N),setTimeout(()=>C(null),h)),console.warn("Error",N)},B=I.useMemo(()=>(N,Y)=>{$(N.message),a&&a({currentData:_.fullData,errorValue:Y,currentValue:n,name:v,path:b,error:N})},[a,s]),K=A===w,H=A===`key_${w}`,z=typeof b.slice(-1)[0]=="number";return{pathString:w,nodeData:_,path:b,name:v,size:S,canEdit:T,canDelete:E,canAdd:R,canDrag:O,error:y,showError:$,onError:B,setError:C,handleEditKey:N=>{if(g(null),v===N||!i)return;const Y=b.slice(0,-1);if(Object.keys(i).includes(N))return void B({code:"KEY_EXISTS",message:p("ERROR_KEY_EXISTS",_)},N);const ee=Object.fromEntries(Object.entries(i).map(([F,M])=>F===v?[N,M]:[F,M]));o(ee,Y).then(F=>{F&&B({code:"UPDATE_ERROR",message:F},N)})},derivedValues:{isEditing:K,isEditingKey:H,isArray:z,canEditKey:i!==null&&T&&R&&E&&!z}}},_U=({canDrag:e,canDragOnto:t,path:n,nodeData:r,onMove:i,onError:o,translate:a})=>{const{getStyles:s}=Bo(),{dragSource:u,setDragSource:l}=Yh(),[c,f]=I.useState(!1),p=Wd(n),h=I.useMemo(()=>e?{onDragStart:C=>{C.stopPropagation(),l({path:n,pathString:p})},onDragEnd:C=>{C.stopPropagation(),l({path:null,pathString:null})}}:{},[e]),A=I.useMemo(()=>C=>t?{onDragOver:_=>{_.stopPropagation(),_.preventDefault()},onDrop:_=>{_.stopPropagation(),y(C),l({path:null,pathString:null}),f(!1)},onDragEnter:_=>{var b;_.stopPropagation(),p.startsWith((b=u.pathString)!==null&&b!==void 0?b:"")||f(C)},onDragExit:_=>{_.stopPropagation(),f(!1)}}:{},[u,t]),g=I.useMemo(()=>t&&u.pathString!==null?d.jsx("div",Object.assign({className:"jer-drop-target-bottom",style:{height:"50%",position:"absolute",width:"100%",top:"50%",zIndex:n.length}},A("below"))):null,[u,t]),y=C=>{var _,b;const v=(_=u.path)===null||_===void 0?void 0:_.slice(-1)[0],S=(b=u.path)===null||b===void 0?void 0:b.slice(0,-1).join("."),w=n.slice(0,-1).join(""),{parentData:T}=r;typeof v=="string"&&T&&!Array.isArray(T)&&Object.keys(T).includes(v)&&v in T&&S!==w?o({code:"KEY_EXISTS",message:a("ERROR_KEY_EXISTS",r)},v):i(u.path,n,C).then(E=>{E&&o({code:"UPDATE_ERROR",message:E},r.value)})};return{dragSourceProps:h,getDropTargetProps:A,BottomDropTarget:g,DropTargetPadding:({position:C,nodeData:_})=>c===C?d.jsx("div",{className:"jer-drag-n-drop-padding",style:s("dropZone",_)}):null,handleDrop:y}},Pee=(e,t,n)=>{var r,i,o;const a=parseInt((r=getComputedStyle(n.current).getPropertyValue("line-height"))!==null&&r!==void 0?r:"16px"),s=((o=(i=t.current)===null||i===void 0?void 0:i.offsetWidth)!==null&&o!==void 0?o:0)/(.5*a),u=JSON.stringify(e,null,2).replace(/\\n/g,`
|
|
18
|
+
`).split(`
|
|
19
|
+
`).map(l=>Math.ceil(l.length/s)).reduce((l,c)=>l+c,0)*a;return Math.min(u+30,window.innerHeight-50)},xU=e=>{const{data:t,parentData:n,onEdit:r,onDelete:i,onChange:o,onMove:a,enableClipboard:s,canDragOnto:u,restrictTypeSelection:l,searchFilter:c,searchText:f,showLabel:p,stringTruncate:h,showStringQuotes:A,indent:g,translate:y,customNodeDefinitions:C,handleKeyboard:_,keyboardControls:b,sort:v}=e,{getStyles:S}=Bo(),{setCurrentlyEditingElement:w,setCollapseState:T,previouslyEditedElement:E,setPreviouslyEditedElement:R,tabDirection:O,setTabDirection:$}=Yh(),[B,K]=I.useState(typeof t=="function"?_w:t),{pathString:H,nodeData:z,path:N,name:Y,canEdit:ee,canDelete:F,canDrag:M,error:W,onError:re,handleEditKey:Ie,derivedValues:Ce}=wU({props:e}),{dragSourceProps:P,getDropTargetProps:ae,BottomDropTarget:Ge,DropTargetPadding:ve}=_U({canDrag:M,canDragOnto:u,path:N,nodeData:z,onMove:a,onError:re,translate:y}),De=SU(C,z),[mt,rn]=I.useState(cg(t,De)),Ht=I.useCallback(j=>{if(!o)return void K(j);const te=o({currentData:z.fullData,newValue:j,currentValue:B,name:Y,path:N});K(te)},[o]);I.useEffect(()=>{K(typeof t=="function"?_w:t),rn(cg(t,De))},[t,W]);const{CustomNode:_e,customNodeProps:Ze,hideKey:pt,showEditTools:tt=!0,showOnEdit:lt,showOnView:Yt}=De,Sn=[...Bee,...C.filter(({showInTypesSelector:j=!1,name:te})=>j&&!!te).map(({name:j})=>j)],Gt=I.useMemo(()=>{if(typeof l=="boolean")return l?[]:Sn;if(Array.isArray(l))return l;const j=l(z);return typeof j=="boolean"?j?[]:Sn:j},[z,l]),{isEditing:It}=Ce,_r=mU("value",z,c,f);if(It&&(!_r||!ee)){const j=Ts(z.fullData,N,O,v);w(j||E)}if(!_r)return null;const Bt=()=>{let j;switch(w(null),mt){case"object":j={[y("DEFAULT_NEW_KEY",z)]:B};break;case"array":j=B??[];break;case"number":{const te=Number(B);j=isNaN(te)?0:te;break}default:j=B}r(j,N).then(te=>{te&&re({code:"UPDATE_ERROR",message:te},j)})},Jt=()=>{w(null),K(t),rn(cg(t,De))},{isEditingKey:on,canEditKey:xr}=Ce,Tr=!It&&W,Me=It&&Gt.length>0,$e=mt!=="invalid"&&!W&&tt,D=p&&on,L=p&&!on&&!pt,U={value:B,parentData:n,setValue:Ht,isEditing:It,setIsEditing:ee?()=>w(N):()=>{},handleEdit:Bt,handleCancel:Jt,path:N,stringTruncate:h,showStringQuotes:A,nodeData:z,translate:y,handleKeyboard:_,keyboardCommon:{cancel:Jt,tabForward:()=>{$("next"),R(H);const j=Ts(z.fullData,N,"next",v);j&&(Bt(),w(j))},tabBack:()=>{$("prev"),R(H);const j=Ts(z.fullData,N,"prev",v);j&&(Bt(),w(j))}}},ce=_e&&(It&<||!It&&Yt)?d.jsx(_e,Object.assign({},e,{value:B,customNodeProps:Ze,setValue:Ht,handleEdit:Bt,handleCancel:Jt,handleKeyPress:j=>_(j,{stringConfirm:Bt,cancel:Jt}),isEditing:It,setIsEditing:()=>w(N),getStyles:S})):Wee(cg(t),U);return d.jsxs("div",Object.assign({className:"jer-component jer-value-component",style:{marginLeft:g/2+"em",position:"relative"},draggable:M},P,ae("above"),{children:[Ge,d.jsx(ve,{position:"above",nodeData:z}),d.jsxs("div",{className:"jer-value-main-row",style:{flexWrap:Y.length>10?"wrap":"nowrap"},children:[L&&d.jsx("span",{className:"jer-key-text",style:Object.assign(Object.assign({},S("property",z)),{minWidth:`${Math.min(String(Y).length+1,5)}ch`,flexShrink:Y.length>10?1:0}),onDoubleClick:()=>xr&&w(N,"key"),children:Y===""?d.jsx("span",{className:N.length>0?"jer-empty-string":void 0}):`${Y}:`}),D&&d.jsx("input",{className:"jer-input-text jer-key-edit",type:"text",name:H,defaultValue:Y,autoFocus:!0,onFocus:j=>j.target.select(),onKeyDown:j=>_(j,{stringConfirm:()=>Ie(j.target.value),cancel:Jt,tabForward:()=>{Ie(j.target.value),w(N)},tabBack:()=>{Ie(j.target.value),w(Ts(z.fullData,N,"prev",v))}}),style:{width:String(Y).length/1.5+.5+"em"}}),d.jsxs("div",{className:"jer-value-and-buttons",children:[d.jsx("div",{className:"jer-input-component",children:ce}),It?d.jsx(ux,{onOk:Bt,onCancel:Jt,nodeData:z}):$e&&d.jsx(CU,{startEdit:ee?()=>w(N,Jt):void 0,handleDelete:F?()=>{i(B,N).then(j=>{j&&re({code:"DELETE_ERROR",message:j},B)})}:void 0,enableClipboard:s,translate:y,customButtons:e.customButtons,nodeData:z,handleKeyboard:_,keyboardControls:b}),Me&&d.jsxs("div",{className:"jer-select",children:[d.jsx("select",{name:`${Y}-type-select`,className:"jer-type-select",onChange:j=>(te=>{const pe=C.find(ue=>ue.name===te);if(pe)r(pe.defaultValue,N),rn(te),w(null),T({path:N,collapsed:!1});else{const ue=Nee(B,te,y("DEFAULT_NEW_KEY",z),De!=null&&De.CustomNode?y("DEFAULT_STRING",z):void 0);Ht(ue),r(ue,N).then(be=>{be&&(re({code:"UPDATE_ERROR",message:be},ue),w(null))})}})(j.target.value),value:mt,children:Gt.map(j=>d.jsx("option",{value:j,children:j},j))}),d.jsx("span",{className:"focus"})]}),Tr&&d.jsx("span",{className:"jer-error-slug",style:S("error",z),children:W})]})]}),d.jsx(ve,{position:"below",nodeData:z})]}))},cg=(e,t)=>t!=null&&t.CustomNode&&(t!=null&&t.name)&&t.showInTypesSelector?t.name:typeof e=="string"?"string":typeof e=="number"?"number":typeof e=="boolean"?"boolean":e===null?"null":"invalid",Wee=(e,t)=>{const n=t.value;switch(e){case"string":return d.jsx(Tee,Object.assign({},t,{value:n}));case"number":return d.jsx(Iee,Object.assign({},t,{value:n}));case"boolean":return d.jsx(Eee,Object.assign({},t,{value:n}));case"null":return d.jsx(Ree,Object.assign({},t));default:return d.jsx($ee,Object.assign({},t))}},Nee=(e,t,n,r)=>{switch(t){case"string":return r??String(e);case"number":{const i=Number(e);return isNaN(i)?0:i}case"boolean":return!!e;case"null":return null;case"object":return{[n]:e};case"array":return[e];default:return String(e)}},TU=e=>{const{getStyles:t}=Bo(),{collapseState:n,setCollapseState:r,doesPathMatch:i,currentlyEditingElement:o,setCurrentlyEditingElement:a,areChildrenBeingEdited:s}=Yh(),{mainContainerRef:u,data:l,nodeData:c,parentData:f,showCollectionCount:p,onEdit:h,onAdd:A,onDelete:g,canDragOnto:y,collapseFilter:C,collapseAnimationTime:_,onMove:b,enableClipboard:v,searchFilter:S,searchText:w,indent:T,sort:E,showArrayIndices:R,defaultValue:O,translate:$,customNodeDefinitions:B,jsonParse:K,jsonStringify:H,TextEditor:z,keyboardControls:N,handleKeyboard:Y,insertAtTop:ee}=e,[F,M]=I.useState(H(l)),W=C(c),{contentRef:re,isAnimating:Ie,maxHeight:Ce,collapsed:P,animateCollapse:ae}=((me,at,ms,Co)=>{const[ag,sg]=I.useState(ms?0:void 0),[EC,uX]=I.useState(ms),RC=I.useRef(!1),$C=I.useRef(null),oj=I.useRef(0),aj=I.useRef();return{contentRef:$C,isAnimating:RC.current,animateCollapse:kC=>{var OC,MC;if(EC!==kC){switch(window.clearTimeout(aj.current),RC.current=!0,kC){case!0:{const sj=(MC=(OC=$C.current)===null||OC===void 0?void 0:OC.offsetHeight)!==null&&MC!==void 0?MC:0;oj.current=sj,sg(sj),setTimeout(()=>{sg(0)},5);break}case!1:sg(oj.current||Pee(me,$C,Co))}uX(!EC),aj.current=window.setTimeout(()=>{RC.current=!1,kC||sg(void 0)},at)}},maxHeight:ag,collapsed:EC}})(l,_,W,u),{pathString:Ge,nodeData:ve,path:De,name:mt,size:rn,canEdit:Ht,canDelete:_e,canAdd:Ze,canDrag:pt,error:tt,setError:lt,onError:Yt,handleEditKey:Sn,derivedValues:Gt}=wU({props:e,collapsed:P}),{dragSourceProps:It,getDropTargetProps:_r,BottomDropTarget:Bt,DropTargetPadding:Jt}=_U({canDrag:pt,canDragOnto:y,path:De,nodeData:ve,onMove:b,onError:Yt,translate:$}),on=I.useRef(!W);I.useEffect(()=>{M(H(l)),_n&&a(null)},[l]),I.useEffect(()=>{const me=C(ve)&&!Gt.isEditing;on.current=!me,ae(me)},[C]),I.useEffect(()=>{n!==null&&i(De)&&(on.current=!0,ae(n.collapsed))},[n]);const xr=I.useRef(null),Tr=I.useMemo(()=>(me,at)=>typeof O!="function"?O:O(me,at),[O]),{CustomNode:Me,customNodeProps:$e,CustomWrapper:D,wrapperProps:L={},hideKey:U,showEditTools:ce=!0,showOnEdit:j,showOnView:te,showCollectionWrapper:pe=!0}=I.useMemo(()=>SU(B,ve),[]),ue=s(Ge);if(ue&&P&&ae(!1),!(mU("collection",ve,S,w)||ve.level===0)&&!ue)return null;const be=Array.isArray(l)?"array":"object",ot=be==="array"?{open:"[",close:"]"}:{open:"{",close:"}"},wn=me=>{if(me.key!=="Tab"||me.getModifierState("Shift"))Y(me,{objectConfirm:ku,cancel:sa});else{me.preventDefault();const at=vU(xr," ");M(at)}},bo=me=>{const at=ax(me);if(at&&N.collapseModifier.includes(at))return on.current=!0,void r({collapsed:!P,path:De});o&&o.includes(Ge)||(on.current=!0,r(null),ae(!P))},ku=()=>{try{const me=K(F);if(a(null),lt(null),JSON.stringify(me)===JSON.stringify(l))return;h(me,De).then(at=>{at&&Yt({code:"UPDATE_ERROR",message:at},me)})}catch{Yt({code:"INVALID_JSON",message:$("ERROR_INVALID_JSON",ve)},F)}},aa=De.length>0?()=>{g(l,De).then(me=>{me&&Yt({code:"DELETE_ERROR",message:me},l)})}:void 0,sa=()=>{a(null),lt(null),M(H(l))},{isEditing:_n,isEditingKey:As,isArray:TC,canEditKey:Ap}=Gt,Ou=p==="when-closed"?P:p,iX=!_n&&ce,oX=(R||!TC)&&!U&&mt!==void 0,aX=Me&&(_n&&j||!_n&&te),og=Object.entries(l).map(([me,at])=>[be==="array"?Number(me):me,at]);be==="object"&&E(og,me=>me);const ej=on.current?_n?d.jsxs("div",{className:"jer-collection-text-edit",children:[z?d.jsx(z,{value:F,onChange:M,onKeyDown:me=>Y(me,{objectConfirm:ku,cancel:sa})}):d.jsx(AU,{textAreaRef:xr,className:"jer-collection-text-area",name:Ge,value:F,setValue:M,isEditing:_n,handleKeyPress:wn,styles:t("input",ve)}),d.jsx("div",{className:"jer-collection-input-button-row",children:d.jsx(ux,{onOk:ku,onCancel:sa,nodeData:ve})})]}):og.map(([me,at],ms)=>{const Co={key:me,value:at,path:[...De,me],level:De.length+1,index:ms,size:ld(at)?Object.keys(at).length:1,parentData:l,fullData:ve.fullData};return d.jsx("div",{className:"jer-collection-element",style:t("collectionElement",Co),children:ld(at)?d.jsx(TU,Object.assign({},e,{data:at,parentData:l,nodeData:Co,showCollectionCount:p,canDragOnto:Ht}),me):d.jsx(xU,Object.assign({},e,{data:at,parentData:l,nodeData:Co,canDragOnto:Ht,showLabel:be==="object"||R}),me)},me)}):null,IC=!!pe&&P&&!ue;IC||(on.current=!0);const tj=Object.assign(Object.assign({},e),{data:l,value:l,parentData:f,nodeData:ve,setValue:me=>Wc(void 0,void 0,void 0,function*(){return yield h(me,De)}),handleEdit:ku,handleCancel:sa,handleKeyPress:wn,isEditing:_n,setIsEditing:()=>a(De),getStyles:t,canDragOnto:Ht}),sX=aX?d.jsx(Me,Object.assign({customNodeProps:$e},tj,{children:ej})):ej,nj=As?d.jsx("input",{className:"jer-input-text jer-key-edit",type:"text",name:Ge,defaultValue:mt,autoFocus:!0,onFocus:me=>me.target.select(),onKeyDown:me=>Y(me,{stringConfirm:()=>Sn(me.target.value),cancel:sa,tabForward:()=>{Sn(me.target.value);const at=og==null?void 0:og[0][0];a(at?[...De,at]:Ts(ve.fullData,De,"next",E))},tabBack:()=>{Sn(me.target.value),a(Ts(ve.fullData,De,"prev",E))}}),style:{width:String(mt).length/1.5+.5+"em"}}):oX&&d.jsx("span",{className:"jer-key-text",style:t("property",ve),onClick:me=>me.stopPropagation(),onDoubleClick:()=>Ap&&a(De,"key"),children:mt===""?d.jsx("span",{className:De.length>0?"jer-empty-string":void 0}):`${mt}:`}),rj=iX&&d.jsx(CU,{startEdit:Ht?()=>{on.current=!0,a(De)}:void 0,handleAdd:Ze?me=>{ae(!1);const at=Tr(ve,me);if(be==="array"){const ms=ee.array?0:l.length,Co=ee.array?{insert:!0}:{};A(at,[...De,ms],Co).then(ag=>{ag&&Yt({code:"ADD_ERROR",message:ag},at)})}else if(me in l)Yt({code:"KEY_EXISTS",message:$("ERROR_KEY_EXISTS",ve)},me);else{const ms=ee.object?{insertBefore:0}:{};A(at,[...De,me],ms).then(Co=>{Co&&Yt({code:"ADD_ERROR",message:Co},at)})}}:void 0,handleDelete:_e?aa:void 0,enableClipboard:v,type:be,nodeData:ve,translate:$,customButtons:e.customButtons,keyboardControls:N,handleKeyboard:Y}),ij=d.jsxs("div",Object.assign({className:"jer-component jer-collection-component",style:Object.assign(Object.assign({marginLeft:(De.length===0?0:T/2)+"em"},t("collection",ve)),{position:"relative"}),draggable:pt},It,_r("above"),{children:[d.jsx("div",{className:"jer-clickzone",style:{width:T/2+1+"em",zIndex:10+2*ve.level},onClick:me=>bo(me)}),!_n&&Bt,d.jsx(Jt,{position:"above",nodeData:ve}),pe?d.jsxs("div",{className:"jer-collection-header-row",style:{position:"relative"},onClick:me=>bo(me),children:[d.jsxs("div",{className:"jer-collection-name",children:[d.jsx("div",{className:"jer-collapse-icon jer-accordion-icon"+(P?" jer-rotate-90":""),style:{zIndex:11+2*ve.level},onClick:me=>bo(me),children:d.jsx(zu,{name:"chevron",rotate:P,nodeData:ve})}),nj,!_n&&d.jsx("span",{className:"jer-brackets jer-bracket-open",style:t("bracket",ve),children:ot.open})]}),!_n&&Ou&&d.jsx("div",{className:"jer-collection-item-count"+(Ou?" jer-visible":" jer-hidden"),style:t("itemCount",ve),children:rn===1?$("ITEM_SINGLE",Object.assign(Object.assign({},ve),{size:1}),1):$("ITEMS_MULTIPLE",ve,rn)}),d.jsx("div",{className:"jer-brackets"+(IC?" jer-visible":" jer-hidden"),style:t("bracket",ve),children:ot.close}),rj]}):U?d.jsx(d.Fragment,{}):d.jsxs("div",{className:"jer-collection-header-row",style:{position:"relative"},children:[nj,rj]}),d.jsxs("div",{className:"jer-collection-inner",style:Object.assign({overflowY:IC||Ie?"clip":"visible",maxHeight:ue?void 0:Ce},t("collectionInner",ve)),ref:re,children:[sX,d.jsx("div",{className:_n?"jer-collection-error-row":"jer-collection-error-row-edit",children:tt&&d.jsx("span",{className:"jer-error-slug",style:t("error",ve),children:tt})}),!_n&&pe&&d.jsx("div",{className:"jer-brackets jer-bracket-outside",style:Object.assign(Object.assign({},t("bracket",ve)),{marginLeft:(T<3?-1:T<6?-.5:0)+"em"}),children:ot.close})]}),d.jsx(Jt,{position:"below",nodeData:ve})]}));return D?d.jsx(D,Object.assign({customNodeProps:L},tj,{children:ij})):ij},Kee={ITEM_SINGLE:"{{count}} item",ITEMS_MULTIPLE:"{{count}} items",KEY_NEW:"Enter new key",ERROR_KEY_EXISTS:"Key already exists",ERROR_INVALID_JSON:"Invalid JSON",ERROR_UPDATE:"Update unsuccessful",ERROR_DELETE:"Delete unsuccessful",ERROR_ADD:"Adding node unsuccessful",DEFAULT_STRING:"New data!",DEFAULT_NEW_KEY:"key"},qee=(e,t)=>(n,r,i)=>((o,a,s,u,l)=>{if(a[u]){const f=a[u](s);if(f!==null)return f}const c=u in o?o[u]:Kee[u];return l===void 0?c:c==null?void 0:c.replace("{{count}}",String(l))})(e,t,r,n,i);var wj=[],mp=[];(function(e,t){if(e&&typeof document<"u"){var n,r=t.prepend===!0?"prepend":"append",i=t.singleTag===!0,o=typeof t.container=="string"?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(i){var a=wj.indexOf(o);a===-1&&(a=wj.push(o)-1,mp[a]={}),n=mp[a]&&mp[a][r]?mp[a][r]:mp[a][r]=s()}else n=s();e.charCodeAt(0)===65279&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function s(){var u=document.createElement("style");if(u.setAttribute("type","text/css"),t.attributes)for(var l=Object.keys(t.attributes),c=0;c<l.length;c++)u.setAttribute(l[c],t.attributes[l[c]]);var f=r==="prepend"?"afterbegin":"beforeend";return o.insertAdjacentElement(f,u),u}})(':root{--jer-select-border:#b6b6b6;--jer-select-focus:#777;--jer-select-arrow:#777;--jer-form-border:1px solid #ededf0;--jer-form-border-focus:1px solid #e2e2e2;--jer-expand-transition-time:0.3s;--jer-highlight-color:#b3d8ff}.jer-visible{opacity:1}.jer-hidden,.jer-visible{transition:var(--jer-expand-transition-time)}.jer-hidden{opacity:0}.jer-select select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:none;color:#000;cursor:inherit;font-family:inherit;font-size:.8em;line-height:inherit;margin:0;outline:none;padding:0 1em 0 0;z-index:1}select::-ms-expand{display:none}.jer-select{align-items:center;background-color:#fff;background-image:linear-gradient(0deg,#f9f9f9,#fff 33%);border:1px solid var(--jer-select-border);border-radius:.25em;cursor:pointer;display:grid;grid-template-areas:"select";line-height:1.1;max-width:15ch;min-width:12ch;padding:.25em .5em;position:relative}.jer-select select,.jer-select:after{grid-area:select}.jer-select:not(.jer-select--multiple):after{background-color:var(--jer-select-arrow);clip-path:polygon(100% 0,0 0,50% 100%);content:"";height:.5em;justify-self:end;width:.8em}select:focus+.focus{border:1px solid var(--jer-select-focus);border-radius:inherit;bottom:-1px;left:-1px;position:absolute;right:-1px;top:-1px}.jer-editor-container{border-radius:.5em;font-size:16px;line-height:1;padding:1em 1em 1em 2em;position:relative;text-align:left}.jer-editor-container textarea{border:var(--jer-form-border);border-radius:.3em;color:var(--jer-input-color);outline:none}.jer-editor-container textarea:focus{border:var(--jer-form-border-focus)}.jer-editor-container input{border:var(--jer-form-border);border-radius:.3em;font-family:inherit;outline:none}.jer-editor-container input:focus{border:var(--jer-form-border-focus)}.jer-editor-container ::selection{background-color:var(--jer-highlight-color)}.jer-collection-header-row,.jer-value-main-row{align-items:center;display:flex;gap:.3em;min-height:1.7em}.jer-collection-header-row{display:flex;flex-wrap:wrap}.jer-collapse-icon{left:-1.2em;position:absolute;top:.35em}.jer-collection-inner{position:relative;transition:var(--jer-expand-transition-time)}.jer-collection-text-edit{align-items:flex-start;display:flex;flex-direction:column;gap:.3em}.jer-collection-text-area{font-family:inherit;font-size:.85em;max-height:40em;overflow:hidden;padding:.2em .5em 0;resize:both}.jer-collection-input-button-row{display:flex;font-size:150%;justify-content:flex-end;margin-top:.4em;width:100%}.jer-collection-error-row{bottom:.5em;position:absolute}.jer-error-slug{margin-left:1em}.jer-value-component{position:relative}.jer-value-main-row{display:flex;gap:0}.jer-value-and-buttons{align-items:center;display:flex;justify-content:flex-start;padding-left:.5em}.jer-value-error-row{position:absolute}.jer-value-string{line-height:1.3em;overflow-wrap:anywhere;white-space:pre-wrap}.jer-hyperlink{text-decoration:underline}.jer-input-text{font-family:inherit;font-size:.9em;height:1.4em;line-height:1.2em;margin:0;min-width:6em;overflow:hidden;padding:.25em .5em .2em;resize:none}.jer-input-boolean{margin-left:.3em;margin-right:.3em;transform:scale(1.5)}.jer-key-text{line-height:1.1em;white-space:pre-wrap;word-break:break-word}.jer-key-edit{font-size:inherit;font-size:.9em;padding:0 .3em}.jer-value-invalid{font-style:italic;opacity:.5}.jer-input-number{font-size:90%;min-width:3em}.jer-confirm-buttons,.jer-edit-buttons{align-items:center;cursor:pointer;display:flex;height:1em}.jer-input-buttons{gap:.4em}.jer-edit-buttons{gap:.4em;margin-left:.5em;opacity:0}.jer-confirm-buttons{gap:.2em;margin-left:.4em}.jer-edit-buttons:hover{opacity:1;position:relative}.jer-collection-header-row:hover>.jer-edit-buttons,.jer-value-and-buttons:hover>.jer-edit-buttons,.jer-value-main-row:hover>.jer-edit-buttons{opacity:1}.jer-copy-pulse{position:relative;transition:transform var(--jer-expand-transition-time)}.jer-copy-pulse:hover{opacity:.85;transform:scale(1.2);transition:.3s}.jer-copy-pulse:after{border-radius:50%;box-shadow:0 0 15px 5px var(--jer-icon-copy-color);content:"";display:block;height:100%;left:0;opacity:0;position:absolute;top:0;transition:all .5s;width:100%}.jer-copy-pulse:active:after{border-radius:4em;box-shadow:0 0 0 0 var(--jer-icon-copy-color);left:0;opacity:1;position:absolute;top:0;transition:0s}.jer-copy-pulse:active{top:.07em}.jer-rotate-90{transform:rotate(-90deg)}.jer-accordion-icon,.jer-rotate-90{transition:transform var(--jer-expand-transition-time)}.jer-icon:hover{opacity:.85;transform:scale(1.2);transition:.3s}.jer-empty-string:after{content:"<empty string>:";font-size:90%;font-style:italic}.jer-drag-n-drop-padding{border:1px dashed #e0e0e0;border-radius:.3em;height:.5em}.jer-clickzone{height:calc(100% - .8em);left:-1em;position:absolute;top:1.2em}',{});const Vee=({data:e,setData:t,rootName:n="root",onUpdate:r=()=>{},onEdit:i=r,onDelete:o=r,onAdd:a=r,onChange:s,onError:u,showErrorMessages:l=!0,enableClipboard:c=!0,indent:f=2,collapse:p=!1,collapseAnimationTime:h=300,showCollectionCount:A=!0,restrictEdit:g=!1,restrictDelete:y=!1,restrictAdd:C=!1,restrictTypeSelection:_=!1,restrictDrag:b=!0,searchFilter:v,searchText:S,searchDebounceTime:w=350,keySort:T=!1,showArrayIndices:E=!0,showStringQuotes:R=!0,defaultValue:O=null,minWidth:$=250,maxWidth:B="min(600px, 90vw)",rootFontSize:K,stringTruncate:H=250,translations:z={},className:N,id:Y,customText:ee={},customNodeDefinitions:F=[],customButtons:M=[],jsonParse:W=JSON.parse,jsonStringify:re=Ge=>JSON.stringify(Ge,null,2),TextEditor:Ie,errorMessageTimeout:Ce=2500,keyboardControls:P={},insertAtTop:ae=!1})=>{const{getStyles:Ge}=Bo(),{setCurrentlyEditingElement:ve}=Yh(),De=I.useCallback(vp(p),[p]),mt=I.useCallback(qee(z,ee),[z,ee]),[rn,Ht]=I.useState(S),[_e,Ze]=(({setData:Me,data:$e})=>{const[D,L]=I.useState(Me?void 0:$e),U=I.useCallback(ce=>{Me?Me(ce):L(ce)},[Me]);return I.useEffect(()=>{Me||L($e)},[$e]),[Me?$e:D,U]})({setData:t,data:e}),pt=I.useRef(null);I.useEffect(()=>{ve(null);const Me=setTimeout(()=>Ht(S),w);return()=>clearTimeout(Me)},[S,w]);const tt={key:n,path:[],level:0,index:0,value:_e,size:typeof _e=="object"&&_e!==null?Object.keys(_e).length:1,parentData:null,fullData:_e},lt=(Me,$e)=>Wc(void 0,void 0,void 0,function*(){const D=yield Me($e);if(D===!0||D===void 0)return void Ze($e.newData);const L=Hee(D)?D:["error",D],[U,ce]=L;if(U==="error")return Ze($e.currentData),ce===!1?mt("ERROR_UPDATE",tt):String(ce);Ze(ce)}),Yt=I.useMemo(()=>vp(g),[g]),Sn=I.useMemo(()=>vp(y),[y]),Gt=I.useMemo(()=>vp(C),[C]),It=I.useMemo(()=>vp(b),[b]),_r=I.useMemo(()=>Qee(v),[v]),Bt=I.useMemo(()=>(Me=>{const $e=Object.assign({},Sj);for(const D of Object.keys(Sj)){const L=D;if(Me[L]){const U=Me[L],ce=["clipboardModifier","collapseModifier"].includes(D)?Array.isArray(U)?U:[U]:typeof U=="string"?{key:U}:U;$e[L]=ce,["stringConfirm","numberConfirm","booleanConfirm"].forEach(j=>{!Me[j]&&Me.confirm&&($e[j]=$e.confirm)})}}return $e})(P),[P]),Jt=I.useCallback((Me,$e)=>((D,L,U)=>{const ce=Object.entries(L);for(const[j,te]of ce)if(yee(U,D[j],j)){U.preventDefault(),te();break}})(Bt,$e,Me),[P]),on=I.useCallback((Me,$e)=>{T!==!1&&(typeof T!="function"?Me.sort((D,L)=>{const U=$e(D)[0],ce=$e(L)[0];return U<ce?-1:U>ce?1:0}):Me.sort((D,L)=>T($e(D),$e(L))))},[T]),xr={mainContainerRef:pt,name:n,nodeData:tt,onEdit:(Me,$e)=>Wc(void 0,void 0,void 0,function*(){const{currentData:D,newData:L,currentValue:U,newValue:ce}=gp(_e,$e,Me,"update");if(U!==ce)return yield lt(i,{currentData:D,newData:L,currentValue:U,newValue:ce,name:$e.slice(-1)[0],path:$e})}),onDelete:(Me,$e)=>Wc(void 0,void 0,void 0,function*(){const{currentData:D,newData:L,currentValue:U,newValue:ce}=gp(_e,$e,Me,"delete");return yield lt(o,{currentData:D,newData:L,currentValue:U,newValue:ce,name:$e.slice(-1)[0],path:$e})}),onAdd:(Me,$e,D)=>Wc(void 0,void 0,void 0,function*(){const{currentData:L,newData:U,currentValue:ce,newValue:j}=gp(_e,$e,Me,"add",D);return yield lt(a,{currentData:L,newData:U,currentValue:ce,newValue:j,name:$e.slice(-1)[0],path:$e})}),onChange:s,onError:u,showErrorMessages:l,onMove:(Me,$e,D)=>Wc(void 0,void 0,void 0,function*(){if(Me===null)return;const{currentData:L,newData:U,currentValue:ce}=gp(_e,Me,"","delete"),j=Me.slice(-1)[0],te=$e.slice(0,-1),pe=$e.slice(-1)[0];let ue=typeof pe=="number"?D==="above"?pe:pe+1:typeof j=="number"?`arr_${j}`:j;Me.slice(0,-1).join(".")===$e.slice(0,-1).join(".")&&typeof j=="number"&&typeof ue=="number"&&j<ue&&(ue-=1);const be=typeof ue=="number"?{insert:!0}:D==="above"?{insertBefore:pe}:{insertAfter:pe},{newData:ot,newValue:wn}=gp(U,[...te,ue],ce,"add",be);return yield lt(i,{currentData:L,newData:ot,currentValue:ce,newValue:wn,name:$e.slice(-1)[0],path:$e})}),showCollectionCount:A,collapseFilter:De,collapseAnimationTime:h,restrictEditFilter:Yt,restrictDeleteFilter:Sn,restrictAddFilter:Gt,restrictTypeSelection:_,restrictDragFilter:It,canDragOnto:!1,searchFilter:_r,searchText:rn,enableClipboard:c,keySort:T,sort:on,showArrayIndices:E,showStringQuotes:R,indent:f,defaultValue:O,stringTruncate:H,translate:mt,customNodeDefinitions:F,customButtons:M,parentData:null,jsonParse:W,jsonStringify:re,TextEditor:Ie,errorMessageTimeout:Ce,handleKeyboard:Jt,keyboardControls:Bt,insertAtTop:{object:ae===!0||ae==="object",array:ae===!0||ae==="array"}},Tr=Object.assign(Object.assign({},Ge("container",tt)),{minWidth:$,maxWidth:B});return Tr.fontSize=K??Tr.fontSize,d.jsx("div",{id:Y,ref:pt,className:`jer-editor-container ${N??""}`,style:Tr,children:ld(_e)?d.jsx(TU,Object.assign({data:_e},xr)):d.jsx(xU,Object.assign({data:_e,showLabel:!0},xr))})},zee=e=>{var t;const[n,r]=I.useState();I.useEffect(()=>{const a=document.documentElement;r(a)},[]);const{collapseAnimationTime:i=300}=e;if(!n)return null;const o=getComputedStyle(n).getPropertyValue("--jer-expand-transition-time");return 1e3*parseFloat(o)!==i&&n.style.setProperty("--jer-expand-transition-time",i/1e3+"s"),d.jsx(Cee,{theme:(t=e.theme)!==null&&t!==void 0?t:sx,icons:e.icons,docRoot:n,children:d.jsx(xee,{children:d.jsx(Vee,Object.assign({},e))})})},gp=(e,t,n,r,i={})=>{if(t.length===0)return{currentData:e,newData:n,currentValue:e,newValue:n};const o=Object.assign({remove:r==="delete"},i),a=r!=="add"?th(e,t):void 0;return{currentData:e,newData:pee(e,t,n,o),currentValue:a,newValue:r!=="delete"?n:void 0}},vp=e=>typeof e=="boolean"?()=>e:typeof e=="number"?({level:t})=>t>=e:e,Qee=e=>{if(e!==void 0)return e==="value"?cd:e==="key"?Cj:e==="all"?(t,n)=>cd(t,n)||Cj(t,n):e},Hee=e=>Array.isArray(e)&&e.length===2&&["error","value"].includes(e[0]);function Yee(){var t,n,r;const e=Ea();return d.jsxs(m.Box,{display:"grid",gridTemplateRows:"auto auto 1fr",borderRadius:{topLeft:8,topRight:8},border:{top:!0,right:!0,left:!0,bottom:!1},minHeight:0,minWidth:0,children:[d.jsx(m.Box,{as:"header",padding:{inline:16},alignItems:"center",border:{bottom:!0},minHeight:48,children:d.jsx(m.Text,{variant:"small",component:"h2",color:"grey9",children:"Response"})}),((t=e.response)==null?void 0:t.status)==="pending"&&d.jsx(Gee,{}),((n=e.response)==null?void 0:n.status)==="error"&&d.jsx(Jee,{response:e.response}),((r=e.response)==null?void 0:r.status)==="success"&&d.jsx(Zee,{response:e.response})]})}function Gee(){return d.jsx(m.Box,{display:"grid",children:d.jsx(m.Box,{padding:16,justifyContent:"center",children:d.jsx(m.Alert,{color:"info",icon:"terminal",title:"Fetching data",titleLoading:!0})})})}function Jee(e){const{response:t}=e;return d.jsx(m.Box,{display:"grid",children:d.jsx(m.Box,{padding:16,justifyContent:"center",children:d.jsx(m.Alert,{color:"error",icon:"alert",title:"Error fetching data",subtitle:t.error.message})})})}function Zee(e){const{response:t}=e;return d.jsxs(d.Fragment,{children:[d.jsx(Xee,{response:t}),d.jsx(ete,{response:t})]})}function Xee(e){const{response:t}=e;let n=null;return"total_results_size"in t.data?n=t.data.total_results_size:Array.isArray(t.data)&&(n=t.data.length),d.jsxs(m.Box,{as:"header",padding:{inline:16},alignItems:"center",border:{bottom:!0},minHeight:48,children:[d.jsx(m.Box,{flexGrow:1,gap:12,children:!!t.ref&&d.jsx(m.Badge,{icon:"tag",title:d.jsxs(d.Fragment,{children:[d.jsxs(m.Text,{variant:"small",color:"grey11",children:["ref: $",t.ref]}),d.jsx(m.Icon,{name:"contentCopy",size:"extraSmall",color:"grey11"})]}),size:"medium",color:"grey",onClick:()=>navigator.clipboard.writeText(t.ref??"")})}),d.jsxs(m.Box,{gap:12,children:[!!n&&d.jsx(d.Fragment,{children:d.jsxs(m.Box,{alignItems:"center",gap:4,children:[d.jsx(m.Icon,{name:"insertDriveFile",size:"extraSmall",color:"grey11"}),d.jsxs(m.Text,{variant:"small",color:"grey11",component:"p",children:[ri.pluralize(n,"Document","Documents")," ",d.jsx(m.Text,{variant:"small",color:"purple9",component:"span",children:n})]})]})}),!!t.duration&&d.jsx(d.Fragment,{children:d.jsxs(m.Box,{alignItems:"center",gap:4,children:[d.jsx(m.Icon,{name:"schedule",size:"extraSmall",color:"grey11"}),d.jsxs(m.Text,{variant:"small",color:"grey11",component:"p",children:["Time"," ",d.jsxs(m.Text,{variant:"small",color:"green9",component:"span",children:[t.duration.toString(),"ms"]})]})]})})]})]})}function ete(e){const{response:t}=e;return d.jsxs(m.Box,{display:"flex",flexDirection:"column",overflowY:"auto",backgroundColor:"white",children:[d.jsx("div",{style:{position:"sticky",top:0,left:0,zIndex:1},children:d.jsxs(m.Box,{position:"absolute",top:16,right:16,gap:8,children:[d.jsx(m.Button,{startIcon:"contentCopy",color:"grey",onClick:()=>navigator.clipboard.writeText(JSON.stringify(t.data,null,2)),children:"Copy"}),t.url&&d.jsx(m.Button,{endIcon:"link",asChild:!0,color:"grey",children:d.jsx("a",{href:t.url,target:"_blank",rel:"noreferrer",title:"Open CDN response in a new tab"})})]})}),d.jsx(zee,{className:"responsePreview",data:t.data,enableClipboard:!1,restrictEdit:!0,restrictDelete:!0,restrictAdd:!0,theme:[{styles:{container:{backgroundColor:"transparent",fontFamily:'Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace'},property:"#0550ae",bracket:{color:"#1f2328",fontWeight:"normal"},string:"##0a3069",number:"#0550ae",boolean:"#0550ae",null:{color:"#0550ae",fontVariant:"initial",fontWeight:"normal"}}}],icons:{chevron:d.jsx(m.Icon,{name:"expandMore",size:"small"})},indent:3,collapse:3,collapseAnimationTime:0,rootName:"",showArrayIndices:!1,showStringQuotes:!0,showCollectionCount:"when-closed",stringTruncate:1/0,minWidth:"100%",maxWidth:"auto",rootFontSize:"calc(14rem / 16)"}),d.jsx("style",{children:`
|
|
20
|
+
.responsePreview {
|
|
21
|
+
/* Fixing weird text alignment */
|
|
22
|
+
& .jer-value-main-row {
|
|
23
|
+
min-height: 1.5em;
|
|
24
|
+
}
|
|
25
|
+
& .jer-key-text:has(+ div .jer-value-string) {
|
|
26
|
+
align-self: baseline;
|
|
27
|
+
line-height: 1.5em;
|
|
28
|
+
}
|
|
29
|
+
& .jer-value-string {
|
|
30
|
+
line-height: 1.5em;
|
|
31
|
+
}
|
|
32
|
+
& .jer-value-and-buttons:has(.jer-value-string) {
|
|
33
|
+
align-self: baseline;
|
|
34
|
+
}
|
|
35
|
+
& .jer-brackets::before {
|
|
36
|
+
content: " ";
|
|
37
|
+
}
|
|
38
|
+
& .jer-rotate-90 {
|
|
39
|
+
transform: rotate(-90deg) translateX(.1em);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
& .jer-input-component [class*=jer-value]::after,
|
|
43
|
+
& .jer-bracket-outside::after,
|
|
44
|
+
& .jer-brackets.jer-visible::after {
|
|
45
|
+
content: ",";
|
|
46
|
+
color: #1f2328;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
& .jer-bracket-outside::before {
|
|
50
|
+
white-space: pre;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* Removing awkward UX */
|
|
54
|
+
& .jer-clickzone {
|
|
55
|
+
display: none;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
& .jer-collapse-icon {
|
|
59
|
+
left: -1.4rem;
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
`})]})}function tte(){return d.jsx(m.Box,{display:"grid",gridTemplateColumns:"380px 1px minmax(0, 1fr)",width:"100%",height:"100%",gap:16,children:d.jsxs(nee,{children:[d.jsx(see,{}),d.jsx(m.Separator,{orientation:"vertical",style:"dashed",decorative:!0}),d.jsx(Yee,{})]})})}var Se=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function kl(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var fe={},xw=function(e,t){return xw=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},xw(e,t)};function nte(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");xw(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Tw=function(){return Tw=Object.assign||function(t){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)&&(t[o]=n[o])}return t},Tw.apply(this,arguments)};function rte(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ite(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function ote(e,t){return function(n,r){t(n,r,e)}}function ate(e,t,n,r,i,o){function a(C){if(C!==void 0&&typeof C!="function")throw new TypeError("Function expected");return C}for(var s=r.kind,u=s==="getter"?"get":s==="setter"?"set":"value",l=!t&&e?r.static?e:e.prototype:null,c=t||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),f,p=!1,h=n.length-1;h>=0;h--){var A={};for(var g in r)A[g]=g==="access"?{}:r[g];for(var g in r.access)A.access[g]=r.access[g];A.addInitializer=function(C){if(p)throw new TypeError("Cannot add initializers after decoration has completed");o.push(a(C||null))};var y=(0,n[h])(s==="accessor"?{get:c.get,set:c.set}:c[u],A);if(s==="accessor"){if(y===void 0)continue;if(y===null||typeof y!="object")throw new TypeError("Object expected");(f=a(y.get))&&(c.get=f),(f=a(y.set))&&(c.set=f),(f=a(y.init))&&i.push(f)}else(f=a(y))&&(s==="field"?i.push(f):c[u]=f)}l&&Object.defineProperty(l,r.name,c),p=!0}function ste(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0}function ute(e){return typeof e=="symbol"?e:"".concat(e)}function lte(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function cte(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function dte(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{l(r.next(c))}catch(f){a(f)}}function u(c){try{l(r.throw(c))}catch(f){a(f)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(e,t||[])).next())})}function fte(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1],o=l;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(l);break}o[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(c){l=[6,c],i=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var lx=Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]};function pte(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&lx(t,e,n)}function Iw(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function IU(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function hte(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(IU(arguments[t]));return e}function Ate(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}function mte(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function nh(e){return this instanceof nh?(this.v=e,this):new nh(e)}function gte(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,o=[];return i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i;function a(p){r[p]&&(i[p]=function(h){return new Promise(function(A,g){o.push([p,h,A,g])>1||s(p,h)})})}function s(p,h){try{u(r[p](h))}catch(A){f(o[0][3],A)}}function u(p){p.value instanceof nh?Promise.resolve(p.value.v).then(l,c):f(o[0][2],p)}function l(p){s("next",p)}function c(p){s("throw",p)}function f(p,h){p(h),o.shift(),o.length&&s(o[0][0],o[0][1])}}function vte(e){var t,n;return t={},r("next"),r("throw",function(i){throw i}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(i,o){t[i]=e[i]?function(a){return(n=!n)?{value:nh(e[i](a)),done:!1}:o?o(a):a}:o}}function yte(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof Iw=="function"?Iw(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=e[o]&&function(a){return new Promise(function(s,u){a=e[o](a),i(s,u,a.done,a.value)})}}function i(o,a,s,u){Promise.resolve(u).then(function(l){o({value:l,done:s})},a)}}function bte(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var Cte=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function Ste(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&lx(t,e,n);return Cte(t,e),t}function wte(e){return e&&e.__esModule?e:{default:e}}function _te(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}function xte(e,t,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,n):i?i.value=n:t.set(e,n),n}function Tte(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}const Ite=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Tw},__asyncDelegator:vte,__asyncGenerator:gte,__asyncValues:yte,__await:nh,__awaiter:dte,__classPrivateFieldGet:_te,__classPrivateFieldIn:Tte,__classPrivateFieldSet:xte,__createBinding:lx,__decorate:ite,__esDecorate:ate,__exportStar:pte,__extends:nte,__generator:fte,__importDefault:wte,__importStar:Ste,__makeTemplateObject:bte,__metadata:cte,__param:ote,__propKey:ute,__read:IU,__rest:rte,__runInitializers:ste,__setFunctionName:lte,__spread:hte,__spreadArray:mte,__spreadArrays:Ate,__values:Iw},Symbol.toStringTag,{value:"Module"})),G=kl(Ite);var Ir={};function EU(e){return function(t){return function(n){return n.reduce(function(r,i){return e.alt(r,function(){return i})},t)}}}const Ete=Object.freeze(Object.defineProperty({__proto__:null,altAll:EU},Symbol.toStringTag,{value:"Module"}));function Rte(e){return EU(e)(e.zero())}const $te=Object.freeze(Object.defineProperty({__proto__:null,altAll:Rte},Symbol.toStringTag,{value:"Module"}));var RU=function(e){return function(){return{meet:function(t,n){return function(r){return e.meet(t(r),n(r))}},join:function(t,n){return function(r){return e.join(t(r),n(r))}},zero:function(){return e.zero},one:function(){return e.one},implies:function(t,n){return function(r){return e.implies(t(r),n(r))}},not:function(t){return function(n){return e.not(t(n))}}}}},cx=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},$U=function(e){var t=cx(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}},dx=function(e){return{add:function(t,n){return function(r){return e.add(t(r),n(r))}},zero:function(){return e.zero},mul:function(t,n){return function(r){return e.mul(t(r),n(r))}},one:function(){return e.one}}},kU=function(e){var t=dx(e);return{add:t.add,mul:t.mul,one:t.one,zero:t.zero,sub:function(n,r){return function(i){return e.sub(n(i),r(i))}}}},kte=function(e){return function(t){return t(e)}};function Q(e){return e}var dd=Q;function Lr(e){return function(){return e}}var fx=Lr(!0),OU=Lr(!1),MU=Lr(null),px=Lr(void 0),Ote=px;function Mte(e){return function(t,n){return e(n,t)}}function X(e,t,n,r,i,o,a,s,u){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return o(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return a(o(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return s(a(o(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return u(s(a(o(i(r(n(t(e.apply(this,arguments)))))))))}}}function FU(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e}function Fte(e){return e+1}function jte(e){return e-1}function jU(e){throw new Error("Called `absurd` function which should be uncallable")}function Lte(e){return function(t){return e.apply(void 0,t)}}function Dte(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e(t)}}function x(e,t,n,r,i,o,a,s,u){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return o(i(r(n(t(e)))));case 7:return a(o(i(r(n(t(e))))));case 8:return s(a(o(i(r(n(t(e)))))));case 9:return u(s(a(o(i(r(n(t(e))))))));default:{for(var l=arguments[0],c=1;c<arguments.length;c++)l=arguments[c](l);return l}}}var Ute=jU,Dr=function(e,t){return t};function Bte(e){return function(t){return!e(t)}}var Pte=function(){return{concat:function(e,t){return X(e,t)},empty:Q}};const LU=Object.freeze(Object.defineProperty({__proto__:null,SK:Dr,absurd:jU,apply:kte,constFalse:OU,constNull:MU,constTrue:fx,constUndefined:px,constVoid:Ote,constant:Lr,decrement:jte,flip:Mte,flow:X,getBooleanAlgebra:RU,getEndomorphismMonoid:Pte,getMonoid:$U,getRing:kU,getSemigroup:cx,getSemiring:dx,hole:Ute,identity:Q,increment:Fte,not:Bte,pipe:x,tuple:FU,tupled:Lte,unsafeCoerce:dd,untupled:Dte},Symbol.toStringTag,{value:"Module"}));var Wte=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},en=function(e){return e._tag==="None"},$t=function(e){return e._tag==="Some"},Re={_tag:"None"},ye=function(e){return{_tag:"Some",value:e}},An=function(e){return e._tag==="Left"},hx=function(e){return e._tag==="Right"},Ca=function(e){return{_tag:"Left",left:e}},Ys=function(e){return{_tag:"Right",right:e}},Gh=function(e){return[e]},_t=function(e){return e.length>0},ci=function(e){return e[0]},Nd=function(e){return e.slice(1)},jn=[],gn={},gt=Object.prototype.hasOwnProperty,hy=function(e){return Wte([e[0]],e.slice(1),!0)};function Ra(e,t){return function(n){return function(r){return e.ap(e.map(r,function(i){return function(o){return t.ap(i,o)}}),n)}}}function Kt(e){return function(t){return function(n){return e.ap(e.map(n,function(r){return function(){return r}}),t)}}}function qt(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(r){return r}}),t)}}}function Vt(e){return function(t,n){return function(r){return e.ap(e.map(r,function(i){return function(o){var a;return Object.assign({},i,(a={},a[t]=o,a))}}),n)}}}function vn(e){return function(t){return{concat:function(n,r){return e.ap(e.map(n,function(i){return function(o){return t.concat(i,o)}}),r)}}}}function Ax(e,t,n){return function(r){for(var i=Array(n.length+1),o=0;o<n.length;o++)i[o]=n[o];return i[n.length]=r,t===0?e.apply(null,i):Ax(e,t-1,i)}}var BC={1:function(e){return[e]},2:function(e){return function(t){return[e,t]}},3:function(e){return function(t){return function(n){return[e,t,n]}}},4:function(e){return function(t){return function(n){return function(r){return[e,t,n,r]}}}},5:function(e){return function(t){return function(n){return function(r){return function(i){return[e,t,n,r,i]}}}}}};function Nte(e){return gt.call(BC,e)||(BC[e]=Ax(FU,e-1,[])),BC[e]}function Kte(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=Nte(r),o=e.map(t[0],i),a=1;a<r;a++)o=e.ap(o,t[a]);return o}}function qte(e){var t=e.length;switch(t){case 1:return function(n){var r;return r={},r[e[0]]=n,r};case 2:return function(n){return function(r){var i;return i={},i[e[0]]=n,i[e[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return o={},o[e[0]]=n,o[e[1]]=r,o[e[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return a={},a[e[0]]=n,a[e[1]]=r,a[e[2]]=i,a[e[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var s;return s={},s[e[0]]=n,s[e[1]]=r,s[e[2]]=i,s[e[3]]=o,s[e[4]]=a,s}}}}};default:return Ax(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i={},o=0;o<t;o++)i[e[o]]=n[o];return i},t-1,[])}}function Vte(e){return function(t){for(var n=Object.keys(t),r=n.length,i=qte(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}const zte=Object.freeze(Object.defineProperty({__proto__:null,ap:Ra,apFirst:Kt,apS:Vt,apSecond:qt,getApplySemigroup:vn,sequenceS:Vte,sequenceT:Kte},Symbol.toStringTag,{value:"Module"}));function Kd(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function He(e){return function(t){return function(n){return e.map(n,function(r){return r(t)})}}}function zt(e){return function(t){return function(n){return e.map(n,function(r){var i;return i={},i[t]=r,i})}}}function qd(e,t){var n=Kd(e,t);return{map:function(r,i){return x(r,n(i))}}}const Qte=Object.freeze(Object.defineProperty({__proto__:null,bindTo:zt,flap:He,getFunctorComposition:qd,map:Kd},Symbol.toStringTag,{value:"Module"}));function $i(e){var t=vn(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function DU(e,t){var n=qd(e,t).map,r=Ra(e,t);return{map:n,of:function(i){return e.of(t.of(i))},ap:function(i,o){return x(i,r(o))}}}const Hte=Object.freeze(Object.defineProperty({__proto__:null,getApplicativeComposition:DU,getApplicativeMonoid:$i},Symbol.toStringTag,{value:"Module"}));function vt(e){return function(t){return function(n){return e.chain(n,function(r){return e.map(t(r),function(){return r})})}}}function Qt(e){return function(t,n){return function(r){return e.chain(r,function(i){return e.map(n(i),function(o){var a;return Object.assign({},i,(a={},a[t]=o,a))})})}}}const Yte=Object.freeze(Object.defineProperty({__proto__:null,bind:Qt,chainFirst:vt},Symbol.toStringTag,{value:"Module"}));function Po(e){return function(t){return function(n){return e.fromEither(en(n)?Ca(t()):Ys(n.value))}}}function Gs(e){return function(t,n){return function(r){return e.fromEither(t(r)?Ys(r):Ca(n(r)))}}}function Wo(e){var t=Po(e);return function(n){var r=t(n);return function(i){return X(i,r)}}}function Ol(e,t){var n=Wo(e);return function(r){var i=n(r);return function(o){return function(a){return t.chain(a,i(o))}}}}function di(e){return function(t){return X(t,e.fromEither)}}function $a(e,t){var n=di(e);return function(r){return function(i){return t.chain(i,n(r))}}}function ka(e,t){return X(di(e),vt(t))}function Ml(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?Ys(o):Ca(r(o)))})}}}const Gte=Object.freeze(Object.defineProperty({__proto__:null,chainEitherK:$a,chainFirstEitherK:ka,chainOptionK:Ol,filterOrElse:Ml,fromEitherK:di,fromOption:Po,fromOptionK:Wo,fromPredicate:Gs},Symbol.toStringTag,{value:"Module"}));var ki=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},UU=function(e){return ki(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})},BU=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ki(function(n,r){return e.every(function(i,o){return i.equals(n[o],r[o])})})},Jte=function(e,t){return x(e,PU(t))},PU=function(e){return function(t){return ki(function(n,r){return t.equals(e(n),e(r))})}},WU="Eq",Vd={equals:function(e,t){return e===t}},Zte={equals:function(){return!0}},NU=function(){return{concat:function(e,t){return ki(function(n,r){return e.equals(n,r)&&t.equals(n,r)})}}},Xte=function(){return{concat:NU().concat,empty:Zte}},KU={URI:WU,contramap:Jte},ene=BU,tne=UU,nne=Vd.equals,rne=KU,ine=Vd,one=Vd,ane=Vd,sne={equals:function(e,t){return e.valueOf()===t.valueOf()}};const une=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:KU,URI:WU,contramap:PU,eq:rne,eqBoolean:ine,eqDate:sne,eqNumber:ane,eqStrict:Vd,eqString:one,fromEquals:ki,getMonoid:Xte,getSemigroup:NU,getStructEq:tne,getTupleEq:ene,strictEqual:nne,struct:UU,tuple:BU},Symbol.toStringTag,{value:"Module"}));var qU=function(e){return function(t,n){return t===n||e(t,n)===0}},Fl=function(e){return{equals:qU(e),compare:function(t,n){return t===n?0:e(t,n)}}},VU=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Fl(function(n,r){for(var i=0;i<e.length-1;i++){var o=e[i].compare(n[i],r[i]);if(o!==0)return o}return e[i].compare(n[i],r[i])})},mx=function(e){return Fl(function(t,n){return e.compare(n,t)})},lne=function(e,t){return x(e,Ay(t))},Ay=function(e){return function(t){return Fl(function(n,r){return t.compare(e(n),e(r))})}},zU="Ord",QU=function(){return{concat:function(e,t){return Fl(function(n,r){var i=e.compare(n,r);return i!==0?i:t.compare(n,r)})}}},gx=function(){return{concat:QU().concat,empty:Fl(function(){return 0})}},HU={URI:zU,contramap:lne},cne={equals:fx,compare:Lr(0)},dne=function(e){return function(t){return function(n){return n===t||e.compare(n,t)===0}}},YU=function(e){return function(t,n){return e.compare(t,n)===-1}},GU=function(e){return function(t,n){return e.compare(t,n)===1}},fne=function(e){return function(t,n){return e.compare(t,n)!==1}},pne=function(e){return function(t,n){return e.compare(t,n)!==-1}},my=function(e){return function(t,n){return t===n||e.compare(t,n)<1?t:n}},gy=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}},JU=function(e){var t=my(e),n=gy(e);return function(r,i){return function(o){return n(t(o,i),r)}}},hne=function(e){var t=YU(e),n=GU(e);return function(r,i){return function(o){return!(t(o,r)||n(o,i))}}},Ane=VU,mne=mx,gne=HU;function vne(e,t){return e<t?-1:e>t?1:0}var vx={equals:Vd.equals,compare:vne},yne=vx,bne=vx,uv=vx,Cne=x(uv,Ay(function(e){return e.valueOf()}));const Sne=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:HU,URI:zU,between:hne,clamp:JU,contramap:Ay,equals:dne,equalsDefault:qU,fromCompare:Fl,geq:pne,getDualOrd:mne,getMonoid:gx,getSemigroup:QU,getTupleOrd:Ane,gt:GU,leq:fne,lt:YU,max:gy,min:my,ord:gne,ordBoolean:yne,ordDate:Cne,ordNumber:uv,ordString:bne,reverse:mx,trivial:cne,tuple:VU},Symbol.toStringTag,{value:"Module"}));var ZU=function(e){return{concat:function(t,n){return e.concat(n,t)}}},wne=function(e){return function(t){return{concat:function(n,r){return e(n)?t.concat(n,r):r}}}},_ne=function(e){return function(t){return{concat:function(n,r){return e(r)?t.concat(n,r):n}}}},xne=function(e){return function(t){return{concat:function(n,r){return t.concat(e(n),e(r))}}}},XU=function(e){return function(t){return function(n){return n.reduce(function(r,i){return e.concat(r,i)},t)}}};const Tne=Object.freeze(Object.defineProperty({__proto__:null,concatAll:XU,endo:xne,filterFirst:wne,filterSecond:_ne,reverse:ZU},Symbol.toStringTag,{value:"Module"}));var vy=function(e){return{concat:my(e)}},yy=function(e){return{concat:gy(e)}},yx=function(e){return{concat:function(){return e}}},bx=ZU,Cx=function(e){return{concat:function(t,n){var r={};for(var i in e)gt.call(e,i)&&(r[i]=e[i].concat(t[i],n[i]));return r}}},Sx=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{concat:function(n,r){return e.map(function(i,o){return i.concat(n[o],r[o])})}}},eB=function(e){return function(t){return{concat:function(n,r){return t.concat(n,t.concat(e,r))}}}},wx=function(){return{concat:Q}},by=function(){return{concat:function(e,t){return t}}},_x=XU,tB=yx(void 0),Ine=function(){return{concat:function(e,t){return Object.assign({},e,t)}}},Ene=by,Rne=wx,$ne=Sx,kne=Cx,One=bx,Mne=yy,Fne=vy,jne=eB;function Lne(e){var t=_x(e);return function(n,r){return r===void 0?t(n):t(n)(r)}}var nB={concat:function(e,t){return e&&t}},rB={concat:function(e,t){return e||t}},Dne=cx,iB={concat:function(e,t){return e+t}},oB={concat:function(e,t){return e+t}},aB={concat:function(e,t){return e*t}};const sB=Object.freeze(Object.defineProperty({__proto__:null,concatAll:_x,constant:yx,first:wx,fold:Lne,getDualSemigroup:One,getFirstSemigroup:Rne,getFunctionSemigroup:Dne,getIntercalateSemigroup:jne,getJoinSemigroup:Mne,getLastSemigroup:Ene,getMeetSemigroup:Fne,getObjectSemigroup:Ine,getStructSemigroup:kne,getTupleSemigroup:$ne,intercalate:eB,last:by,max:yy,min:vy,reverse:bx,semigroupAll:nB,semigroupAny:rB,semigroupProduct:aB,semigroupString:iB,semigroupSum:oB,semigroupVoid:tB,struct:Cx,tuple:Sx},Symbol.toStringTag,{value:"Module"}));var rh=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Jh=jn,No=_t,Cy=function(e,t){return e<0||e>=t.length},xx=function(e){return function(t){return rh([e],t,!0)}},fd=xx,Tx=function(e){return function(t){return rh(rh([],t,!0),[e],!1)}},Sy=Tx,wy=function(e,t,n){if(No(n)){var r=hy(n);return r.splice(e,0,t),r}return[t]},Ix=function(e,t,n){if(n[e]===t)return n;var r=hy(n);return r[e]=t,r},Ex=function(e){return function(t){if(t.length===1)return t;for(var n=[gr(t)],r=Gi(t),i=function(u){n.every(function(l){return!e.equals(l,u)})&&n.push(u)},o=0,a=r;o<a.length;o++){var s=a[o];i(s)}return n}},uB=function(e){if(No(e)){var t=gx();return Ox(e.reduce(t.concat,t.empty))}return Q},Rx=function(e){var t=Ex(e);return function(n){return function(r){return t(x(r,Zh(n)))}}},$x=function(e){return function(t){var n=t.length,r=Math.round(e)%n;if(Cy(Math.abs(r),t)||r===0)return t;if(r<0){var i=Ty(-r)(t),o=i[0],a=i[1];return x(a,Zh(o))}else return $x(r-n)(t)}},kx=function(e){return No(e)?ye(e):Re},_y=function(e){return function(t){for(var n=Math.max(0,Math.floor(t)),r=[e(0)],i=1;i<n;i++)r.push(e(i));return r}},Une=function(e){return _y(function(){return e})},lB=function(e,t){return e<=t?_y(function(n){return e+n})(t-e+1):[e]},cB=function(e){return[gr(e),Gi(e)]},dB=function(e){return[zd(e),Zs(e)]},Bne=function(e){return kx(e.slice())};function fB(e){return function(t){return t.concat(e)}}function Zh(e,t){return t?e.concat(t):function(n){return n.concat(e)}}var Pne=function(e){return e.length===1?e:rh([Zs(e)],e.slice(0,-1).reverse(),!0)};function pB(e){return function(t){var n=t.length;if(n===0)return Jh;for(var r=[],i=t[0],o=[i],a=1;a<n;a++){var s=t[a];e.equals(s,i)?o.push(s):(r.push(o),i=s,o=[i])}return r.push(o),r}}var Wne=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);gt.call(n,a)?n[a].push(o):n[a]=[o]}return n}},Ox=function(e){return function(t){return t.length===1?t:t.slice().sort(e.compare)}},Nne=function(e,t){return hB(e,function(){return t})},hB=function(e,t){return function(n){return Cy(e,n)?Re:ye(Ix(e,t(n[e]),n))}},AB=function(e,t,n){for(var r=[n(e[0],t[0])],i=Math.min(e.length,t.length),o=1;o<i;o++)r[o]=n(e[o],t[o]);return r};function mB(e,t){return t===void 0?function(n){return mB(n,e)}:AB(e,t,function(n,r){return[n,r]})}var Kne=function(e){for(var t=[e[0][0]],n=[e[0][1]],r=1;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},xy=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},Mx=function(e){return function(t){var n=Gi(t);return No(n)?x(n,xy(e),fd(gr(t))):t}},gB=function(e){return function(t){for(var n=hy(e(0,gr(t))),r=1;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},Fx=function(e){return function(t){for(var n=e(t),r=n[0],i=n[1],o=[r],a=i;No(a);){var s=e(a),u=s[0],l=s[1];o.push(u),a=l}return o}},Ty=function(e){return function(t){var n=Math.max(1,e);return n>=t.length?[t,Jh]:[x(t.slice(1,n),fd(gr(t))),t.slice(n)]}},vB=function(e){return Fx(Ty(e))},eo=function(e,t){return x(e,Nx(t))},jx=function(e,t){return x(e,Kx(t))},Xh=function(e,t){return x(e,_B(t))},Lx=function(e,t){return x(e,Iy(t))},yB=function(e,t){return x(e,Wx(t))},eA=function(e,t,n){return x(e,qx(t,n))},tA=function(e){var t=Vx(e);return function(n,r){return x(n,t(r))}},nA=function(e,t,n){return x(e,zx(t,n))},Dx=function(e){var t=xB(e);return function(n,r){return x(n,t(r))}},bB=function(e,t){return x(e,wB(t))},Ux=function(e,t,n){return x(e,Ey(t,n))},Bx=function(e){var t=Qx(e);return function(n,r){return x(n,t(r))}},Px=function(e,t,n){return x(e,Ry(t,n))},CB=function(e){var t=ky(e);return function(n,r){return x(n,t(r))}},Js=Gh,SB=function(e){return function(t){return x(t,fB(e()))}},wB=SB,_B=function(e){return Iy(function(t){return x(e,Nx(t))})},Iy=function(e){return gB(function(t,n){return e(n)})},Wx=function(e){return function(t){for(var n=Gi(t),r=[e(t)];No(n);)r.push(e(n)),n=Gi(n);return r}},qne=Wx(Q),Vne=Iy(Q),Nx=function(e){return Kx(function(t,n){return e(n)})},Kx=function(e){return function(t){for(var n=[e(0,gr(t))],r=1;r<t.length;r++)n.push(e(r,t[r]));return n}},qx=function(e,t){return Ey(e,function(n,r,i){return t(r,i)})},Vx=function(e){return function(t){return function(n){return n.slice(1).reduce(function(r,i){return e.concat(r,t(i))},t(n[0]))}}},zx=function(e,t){return Ry(e,function(n,r,i){return t(r,i)})},Ey=function(e,t){return function(n){return n.reduce(function(r,i,o){return t(o,r,i)},e)}},Qx=function(e){return function(t){return function(n){return n.slice(1).reduce(function(r,i,o){return e.concat(r,t(o+1,i))},t(0,n[0]))}}},Ry=function(e,t){return function(n){return n.reduceRight(function(r,i,o){return t(o,i,r)},e)}},xB=function(e){var t=ky(e);return function(n){return t(function(r,i){return n(i)})}},$y=function(e){return ky(e)(Dr)},ky=function(e){return function(t){return function(n){for(var r=e.map(t(0,gr(n)),Js),i=1;i<n.length;i++)r=e.ap(e.map(r,function(o){return function(a){return x(o,Sy(a))}}),t(i,n[i]));return r}}},Oy=ci,mr="ReadonlyNonEmptyArray",TB=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},zne=function(){return{concat:Zh}},IB=function(e){return ki(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},Qne=function(e){var t=Rx(e);return{concat:function(n,r){return t(r)(n)}}},Hx={URI:mr,map:eo},Hne=He(Hx),Yne={URI:mr,of:Js},Gne={URI:mr,map:eo,mapWithIndex:jx},My={URI:mr,map:eo,ap:Xh},Jne=Kt(My),Zne=qt(My),Xne={URI:mr,map:eo,ap:Xh,of:Js},Yx={URI:mr,map:eo,ap:Xh,chain:Lx},ere=vt(Yx),tre={URI:mr,map:eo,ap:Xh,of:Js,chain:Lx},nre={URI:mr,reduce:eA,foldMap:tA,reduceRight:nA},rre={URI:mr,reduce:eA,foldMap:tA,reduceRight:nA,reduceWithIndex:Ux,foldMapWithIndex:Bx,reduceRightWithIndex:Px},ire={URI:mr,map:eo,reduce:eA,foldMap:tA,reduceRight:nA,traverse:Dx,sequence:$y},ore={URI:mr,map:eo,mapWithIndex:jx,reduce:eA,foldMap:tA,reduceRight:nA,traverse:Dx,sequence:$y,reduceWithIndex:Ux,foldMapWithIndex:Bx,reduceRightWithIndex:Px,traverseWithIndex:CB},are={URI:mr,map:eo,alt:bB},sre={URI:mr,map:eo,extend:yB,extract:Oy},ure=Js(gn),lre=zt(Hx),cre=Qt(Yx),dre=Vt(My),gr=Oy,Gi=Nd,Zs=function(e){return e[e.length-1]},zd=function(e){return e.slice(0,-1)},EB=function(e){var t=vy(e);return function(n){return n.reduce(t.concat)}},RB=function(e){var t=yy(e);return function(n){return n.reduce(t.concat)}},Fy=function(e){return function(t){return t.reduce(e.concat)}},fre=function(e){return function(t){return e(gr(t),Gi(t))}},pre=function(e){return function(t){return e(zd(t),Zs(t))}},$B=function(e){return function(t){return rh([e(gr(t))],Gi(t),!0)}},hre=function(e){return $B(function(){return e})},kB=function(e){return function(t){return x(zd(t),Sy(e(Zs(t))))}},Are=function(e){return kB(function(){return e})},Gx=function(e){var t=Fy(e);return function(n){return X(Mx(n),t)}};function mre(e){var t=Ox(e),n=pB(e);return function(r){return No(r)?n(t(r)):Jh}}function gre(e){return OB(function(t,n){return e(n)})}var OB=function(e){return function(t){return kx(t.filter(function(n,r){return e(r,n)}))}},vre=cB,yre=dB;function MB(e,t){return t===void 0?fd(e):x(t,fd(e))}var FB=function(e,t){return x(e,Zh([t]))},bre=function(e,t){return function(n){return e<0||e>n.length?Re:ye(wy(e,t,n))}},Cre=xy,Sre=Fy,wre={URI:mr,of:Js,map:eo,mapWithIndex:jx,ap:Xh,chain:Lx,extend:yB,extract:Oy,reduce:eA,foldMap:tA,reduceRight:nA,traverse:Dx,sequence:$y,reduceWithIndex:Ux,foldMapWithIndex:Bx,reduceRightWithIndex:Px,traverseWithIndex:CB,alt:bB};const _re=Object.freeze(Object.defineProperty({__proto__:null,Alt:are,Applicative:Xne,Apply:My,Chain:Yx,Comonad:sre,Do:ure,Foldable:nre,FoldableWithIndex:rre,Functor:Hx,FunctorWithIndex:Gne,Monad:tre,Pointed:Yne,Traversable:ire,TraversableWithIndex:ore,URI:mr,alt:wB,altW:SB,ap:_B,apFirst:Jne,apS:dre,apSecond:Zne,append:Sy,appendW:Tx,bind:cre,bindTo:lre,chain:Iy,chainFirst:ere,chainWithIndex:gB,chop:Fx,chunksOf:vB,concat:Zh,concatAll:Fy,concatW:fB,cons:MB,duplicate:qne,empty:Jh,extend:Wx,extract:Oy,filter:gre,filterWithIndex:OB,flap:Hne,flatten:Vne,fold:Sre,foldMap:Vx,foldMapWithIndex:Qx,fromArray:Bne,fromReadonlyArray:kx,getEq:IB,getSemigroup:zne,getShow:TB,getUnionSemigroup:Qne,group:pB,groupBy:Wne,groupSort:mre,head:gr,init:zd,insertAt:bre,intercalate:Gx,intersperse:Mx,isNonEmpty:No,isOutOfBound:Cy,last:Zs,makeBy:_y,map:Nx,mapWithIndex:Kx,matchLeft:fre,matchRight:pre,max:RB,min:EB,modifyAt:hB,modifyHead:$B,modifyLast:kB,of:Js,prepend:fd,prependAll:xy,prependToAll:Cre,prependW:xx,range:lB,readonlyNonEmptyArray:wre,reduce:qx,reduceRight:zx,reduceRightWithIndex:Ry,reduceWithIndex:Ey,replicate:Une,reverse:Pne,rotate:$x,sequence:$y,snoc:FB,sort:Ox,sortBy:uB,splitAt:Ty,tail:Gi,traverse:xB,traverseWithIndex:ky,unappend:dB,uncons:vre,union:Rx,uniq:Ex,unprepend:cB,unsafeInsertAt:wy,unsafeUpdateAt:Ix,unsnoc:yre,unzip:Kne,updateAt:Nne,updateHead:hre,updateLast:Are,zip:mB,zipWith:AB},Symbol.toStringTag,{value:"Module"}));var ih=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Oa=function(e){return e.length>0},jy=function(e,t){return e<0||e>=t.length},Jx=function(e){return function(t){return ih([e],t,!0)}},pd=Jx,Zx=function(e){return function(t){return ih(ih([],t,!0),[e],!1)}},rA=Zx,Xx=function(e,t,n){if(Oa(n)){var r=iA(n);return r.splice(e,0,t),r}return[t]},eT=function(e,t,n){var r=iA(n);return r[e]=t,r},tT=function(e){return function(t){if(t.length===1)return Qd(t);for(var n=[Oi(t)],r=Ji(t),i=function(u){n.every(function(l){return!e.equals(l,u)})&&n.push(u)},o=0,a=r;o<a.length;o++){var s=a[o];i(s)}return n}},jB=function(e){if(Oa(e)){var t=gx();return oT(e.reduce(t.concat,t.empty))}return Qd},nT=function(e){var t=tT(e);return function(n){return function(r){return t(x(r,Dy(n)))}}},rT=function(e){return function(t){var n=t.length,r=Math.round(e)%n;if(jy(Math.abs(r),t)||r===0)return Qd(t);if(r<0){var i=By(-r)(t),o=i[0],a=i[1];return x(a,Dy(o))}else return rT(r-n)(t)}},iA=hy,iT=function(e){return Oa(e)?ye(e):Re},Ly=function(e){return function(t){for(var n=Math.max(0,Math.floor(t)),r=[e(0)],i=1;i<n;i++)r.push(e(i));return r}},xre=function(e){return Ly(function(){return e})},LB=function(e,t){return e<=t?Ly(function(n){return e+n})(t-e+1):[e]},DB=function(e){return[Oi(e),Ji(e)]},UB=function(e){return[Yd(e),Hd(e)]};function BB(e){return function(t){return t.concat(e)}}function Dy(e,t){return t?e.concat(t):function(n){return n.concat(e)}}var Tre=function(e){return ih([Hd(e)],e.slice(0,-1).reverse(),!0)};function PB(e){return function(t){var n=t.length;if(n===0)return[];for(var r=[],i=t[0],o=[i],a=1;a<n;a++){var s=t[a];e.equals(s,i)?o.push(s):(r.push(o),i=s,o=[i])}return r.push(o),r}}var Ire=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);gt.call(n,a)?n[a].push(o):n[a]=[o]}return n}},oT=function(e){return function(t){return t.slice().sort(e.compare)}},Ere=function(e,t){return function(n){return e<0||e>n.length?Re:ye(Xx(e,t,n))}},Rre=function(e,t){return WB(e,function(){return t})},WB=function(e,t){return function(n){return jy(e,n)?Re:ye(eT(e,t(n[e]),n))}},Qd=iA,Xs=function(e){return[e]},NB=function(e,t,n){for(var r=[n(e[0],t[0])],i=Math.min(e.length,t.length),o=1;o<i;o++)r[o]=n(e[o],t[o]);return r};function KB(e,t){return t===void 0?function(n){return KB(n,e)}:NB(e,t,function(n,r){return[n,r]})}var $re=function(e){for(var t=[e[0][0]],n=[e[0][1]],r=1;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},Uy=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},qB=function(e){return function(t){var n=Ji(t);return Oa(n)?x(n,Uy(e),pd(Oi(t))):Qd(t)}},VB=Qx,zB=Vx,QB=function(e){return function(t){for(var n=iA(e(0,Oi(t))),r=1;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},aT=function(e){return function(t){for(var n=e(t),r=n[0],i=n[1],o=[r],a=i;Oa(a);){var s=e(a),u=s[0],l=s[1];o.push(u),a=l}return o}},By=function(e){return function(t){var n=Math.max(1,e);return n>=t.length?[Qd(t),[]]:[x(t.slice(1,n),pd(Oi(t))),t.slice(n)]}},HB=function(e){return aT(By(e))},to=function(e,t){return x(e,hT(t))},sT=function(e,t){return x(e,AT(t))},oA=function(e,t){return x(e,eP(t))},uT=function(e,t){return x(e,Py(t))},YB=function(e,t){return x(e,pT(t))},aA=function(e,t,n){return x(e,tP(t,n))},sA=function(e){var t=zB(e);return function(n,r){return x(n,t(r))}},uA=function(e,t,n){return x(e,rP(t,n))},lT=function(e){var t=oP(e);return function(n,r){return x(n,t(r))}},GB=function(e,t){return x(e,XB(t))},cT=function(e,t,n){return x(e,nP(t,n))},dT=function(e){var t=VB(e);return function(n,r){return x(n,t(r))}},fT=function(e,t,n){return x(e,iP(t,n))},JB=function(e){var t=Ny(e);return function(n,r){return x(n,t(r))}},ZB=function(e){return function(t){return x(t,BB(e()))}},XB=ZB,eP=function(e){return Py(function(t){return x(e,hT(t))})},Py=function(e){return QB(function(t,n){return e(n)})},pT=function(e){return function(t){for(var n=Ji(t),r=[e(t)];Oa(n);)r.push(e(n)),n=Ji(n);return r}},kre=pT(Q),Ore=Py(Q),hT=function(e){return AT(function(t,n){return e(n)})},AT=function(e){return function(t){for(var n=[e(0,Oi(t))],r=1;r<t.length;r++)n.push(e(r,t[r]));return n}},tP=qx,nP=Ey,rP=zx,iP=Ry,oP=function(e){var t=Ny(e);return function(n){return t(function(r,i){return n(i)})}},Wy=function(e){return Ny(e)(function(t,n){return n})},Ny=function(e){return function(t){return function(n){for(var r=e.map(t(0,Oi(n)),Xs),i=1;i<n.length;i++)r=e.ap(e.map(r,function(o){return function(a){return x(o,rA(a))}}),t(i,n[i]));return r}}},mT=gr,vr="NonEmptyArray",Mre=TB,Fre=function(){return{concat:Dy}},jre=IB,Lre=function(e){var t=nT(e);return{concat:function(n,r){return t(r)(n)}}},gT={URI:vr,map:to},Dre=He(gT),Ure={URI:vr,of:Xs},Bre={URI:vr,map:to,mapWithIndex:sT},Ky={URI:vr,map:to,ap:oA},Pre=Kt(Ky),Wre=qt(Ky),Nre={URI:vr,map:to,ap:oA,of:Xs},vT={URI:vr,map:to,ap:oA,chain:uT},Kre=vt(vT),qre={URI:vr,map:to,ap:oA,of:Xs,chain:uT},Vre={URI:vr,reduce:aA,foldMap:sA,reduceRight:uA},zre={URI:vr,reduce:aA,foldMap:sA,reduceRight:uA,reduceWithIndex:cT,foldMapWithIndex:dT,reduceRightWithIndex:fT},Qre={URI:vr,map:to,reduce:aA,foldMap:sA,reduceRight:uA,traverse:lT,sequence:Wy},Hre={URI:vr,map:to,mapWithIndex:sT,reduce:aA,foldMap:sA,reduceRight:uA,traverse:lT,sequence:Wy,reduceWithIndex:cT,foldMapWithIndex:dT,reduceRightWithIndex:fT,traverseWithIndex:JB},Yre={URI:vr,map:to,alt:GB},Gre={URI:vr,map:to,extend:YB,extract:mT},Jre=Xs(gn),Zre=zt(gT),Xre=Qt(vT),eie=Vt(Ky),Oi=gr,Ji=function(e){return e.slice(1)},Hd=Zs,Yd=function(e){return e.slice(0,-1)},tie=EB,nie=RB,rie=function(e){return function(t){return t.reduce(e.concat)}},iie=function(e){return function(t){return e(Oi(t),Ji(t))}},oie=function(e){return function(t){return e(Yd(t),Hd(t))}},aP=function(e){return function(t){return ih([e(Oi(t))],Ji(t),!0)}},aie=function(e){return aP(function(){return e})},sP=function(e){return function(t){return x(Yd(t),rA(e(Hd(t))))}},sie=function(e){return sP(function(){return e})},uie=Gx;function lie(e){var t=oT(e),n=PB(e);return function(r){return Oa(r)?n(t(r)):[]}}function cie(e){return uP(function(t,n){return e(n)})}var uP=function(e){return function(t){return iT(t.filter(function(n,r){return e(r,n)}))}},die=DB,fie=UB;function lP(e,t){return t===void 0?pd(e):x(t,pd(e))}var cP=function(e,t){return x(e,rA(t))},pie=Uy,hie=Fy,Aie={URI:vr,of:Xs,map:to,mapWithIndex:sT,ap:oA,chain:uT,extend:YB,extract:mT,reduce:aA,foldMap:sA,reduceRight:uA,traverse:lT,sequence:Wy,reduceWithIndex:cT,foldMapWithIndex:dT,reduceRightWithIndex:fT,traverseWithIndex:JB,alt:GB};const mie=Object.freeze(Object.defineProperty({__proto__:null,Alt:Yre,Applicative:Nre,Apply:Ky,Chain:vT,Comonad:Gre,Do:Jre,Foldable:Vre,FoldableWithIndex:zre,Functor:gT,FunctorWithIndex:Bre,Monad:qre,Pointed:Ure,Traversable:Qre,TraversableWithIndex:Hre,URI:vr,alt:XB,altW:ZB,ap:eP,apFirst:Pre,apS:eie,apSecond:Wre,append:rA,appendW:Zx,bind:Xre,bindTo:Zre,chain:Py,chainFirst:Kre,chainWithIndex:QB,chop:aT,chunksOf:HB,concat:Dy,concatAll:rie,concatW:BB,cons:lP,copy:Qd,duplicate:kre,extend:pT,extract:mT,filter:cie,filterWithIndex:uP,flap:Dre,flatten:Ore,fold:hie,foldMap:zB,foldMapWithIndex:VB,fromArray:iT,fromReadonlyNonEmptyArray:iA,getEq:jre,getSemigroup:Fre,getShow:Mre,getUnionSemigroup:Lre,group:PB,groupBy:Ire,groupSort:lie,head:Oi,init:Yd,insertAt:Ere,intercalate:uie,intersperse:qB,isNonEmpty:Oa,isOutOfBound:jy,last:Hd,makeBy:Ly,map:hT,mapWithIndex:AT,matchLeft:iie,matchRight:oie,max:nie,min:tie,modifyAt:WB,modifyHead:aP,modifyLast:sP,nonEmptyArray:Aie,of:Xs,prepend:pd,prependAll:Uy,prependToAll:pie,prependW:Jx,range:LB,reduce:tP,reduceRight:rP,reduceRightWithIndex:iP,reduceWithIndex:nP,replicate:xre,reverse:Tre,rotate:rT,sequence:Wy,snoc:cP,sort:oT,sortBy:jB,splitAt:By,tail:Ji,traverse:oP,traverseWithIndex:Ny,unappend:UB,uncons:die,union:nT,uniq:tT,unprepend:DB,unsafeInsertAt:Xx,unsafeUpdateAt:eT,unsnoc:fie,unzip:$re,updateAt:Rre,updateHead:aie,updateLast:sie,zip:KB,zipWith:NB},Symbol.toStringTag,{value:"Module"}));var gie=function(e){return typeof e=="number"},yT={equals:function(e,t){return e===t}},qy={equals:yT.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},vie={equals:yT.equals,compare:qy.compare,top:1/0,bottom:-1/0},yie={show:function(e){return JSON.stringify(e)}},dP={concat:function(e,t){return e-t}},bT={concat:function(e,t){return e+t}},CT={concat:function(e,t){return e*t}},bie={concat:bT.concat,empty:0},Cie={concat:CT.concat,empty:1},Sie={add:bT.concat,zero:0,mul:CT.concat,one:1,sub:dP.concat,degree:function(e){return 1},div:function(e,t){return e/t},mod:function(e,t){return e%t}};const wie=Object.freeze(Object.defineProperty({__proto__:null,Bounded:vie,Eq:yT,Field:Sie,MagmaSub:dP,MonoidProduct:Cie,MonoidSum:bie,Ord:qy,SemigroupProduct:CT,SemigroupSum:bT,Show:yie,isNumber:gie},Symbol.toStringTag,{value:"Module"}));var Be=function(e,t){return{left:e,right:t}},_ie=function(e,t){return x(e,fP(t))},xie=function(e,t){return x(e,pP(t))},Tie=function(e,t,n){return x(e,hP(t,n))},fP=function(e){return function(t){return Be(Vy(t),e(zy(t)))}},pP=function(e){return function(t){return Be(e(Vy(t)),zy(t))}},hP=function(e,t){return function(n){return Be(e(Vy(n)),t(zy(n)))}},ST="Separated",Iie={URI:ST,mapLeft:xie,bimap:Tie},AP={URI:ST,map:_ie},Eie=He(AP),Vy=function(e){return e.left},zy=function(e){return e.right};const Rie=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:Iie,Functor:AP,URI:ST,bimap:hP,flap:Eie,left:Vy,map:fP,mapLeft:pP,right:zy,separated:Be},Symbol.toStringTag,{value:"Module"}));function no(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.separate)}}}function ro(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.compact)}}}function wT(e){return function(t){var n=e.wither(t);return function(r){return function(i){return n(i,function(o){return t.map(r(o),function(a){return a?ye(o):Re})})}}}}const $ie=Object.freeze(Object.defineProperty({__proto__:null,filterE:wT,wiltDefault:no,witherDefault:ro},Symbol.toStringTag,{value:"Module"}));function Gd(e,t){return function(n){return n?t.of(void 0):e.zero()}}const kie=Object.freeze(Object.defineProperty({__proto__:null,guard:Gd},Symbol.toStringTag,{value:"Module"}));var Oie=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Oo=function(e){return e.length===0},Nt=No,Mie=fd,Fie=xx,Qy=Sy,jie=Tx,mP=function(e,t){return e<=0?jt:_y(t)(e)},Lie=function(e,t){return mP(e,function(){return t})};function Die(e){return function(t){return e(t)?[t]:jt}}var gP=function(e){return en(e)?jt:[e.value]},vP=function(e){return An(e)?jt:[e.right]},yP=function(e,t){return function(n){return Nt(n)?t(n):e()}},bP=yP,CP=function(e,t){return function(n){return Nt(n)?t(gr(n),Gi(n)):e()}},SP=CP,Uie=SP,wP=function(e,t){return function(n){return Nt(n)?t(zd(n),Zs(n)):e()}},_P=wP,Bie=_P,xP=function(e){return function(t){if(Oo(t))return jt;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},Pie=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[0]=e;for(var o=0;o<r;o++)i[o+1]=t(i[o],n[o]);return i}},Wie=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[r]=e;for(var o=r-1;o>=0;o--)i[o]=t(n[o],i[o+1]);return i}},Nie=function(e){return e.length},Jd=Cy;function ll(e,t){return t===void 0?function(n){return ll(e,n)}:Jd(e,t)?Re:ye(t[e])}var TP=function(e){return Nt(e)?ye(gr(e)):Re},IP=function(e){return Nt(e)?ye(Zs(e)):Re},Kie=function(e){return Nt(e)?ye(Gi(e)):Re},qie=function(e){return Nt(e)?ye(zd(e)):Re},Vie=function(e){return function(t){return Jd(e,t)?t:e===0?jt:t.slice(0,e)}},zie=function(e){return function(t){return Jd(e,t)?t:e===0?jt:t.slice(-e)}};function Qie(e){return function(t){for(var n=[],r=0,i=t;r<i.length;r++){var o=i[r];if(!e(o))break;n.push(o)}var a=n.length;return a===t.length?t:a===0?jt:n}}var EP=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r};function Hie(e){return function(t){var n=DP(EP(t,e))(t),r=n[0],i=n[1];return{init:r,rest:i}}}var Yie=function(e){return function(t){return e<=0||Oo(t)?t:e>=t.length?jt:t.slice(e,t.length)}},Gie=function(e){return function(t){return e<=0||Oo(t)?t:e>=t.length?jt:t.slice(0,t.length-e)}};function Jie(e){return function(t){var n=EP(t,e);return n===0?t:n===t.length?jt:t.slice(n)}}var Hy=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return ye(n);return Re}};function Yy(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return ye(t[n]);return Re}}var RP=function(e){return function(t){for(var n=0;n<t.length;n++){var r=e(t[n]);if($t(r))return r}return Re}};function $P(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return ye(t[n]);return Re}}var kP=function(e){return function(t){for(var n=t.length-1;n>=0;n--){var r=e(t[n]);if($t(r))return r}return Re}},OP=function(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return ye(n);return Re}},Zie=function(e,t){return function(n){return e<0||e>n.length?Re:ye(wy(e,t,n))}},Xie=function(e,t){return MP(e,function(){return t})},eoe=function(e){return function(t){return Jd(e,t)?Re:ye(lW(e,t))}},MP=function(e,t){return function(n){return Jd(e,n)?Re:ye(o0(e,t(n[e]),n))}},toe=function(e){return e.length<=1?e:e.slice().reverse()},noe=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Right"&&t.push(r.right)}return t},roe=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Left"&&t.push(r.left)}return t},ioe=function(e){return function(t){return t.length<=1?t:t.slice().sort(e.compare)}},FP=function(e,t,n){for(var r=[],i=Math.min(e.length,t.length),o=0;o<i;o++)r[o]=n(e[o],t[o]);return r};function jP(e,t){return t===void 0?function(n){return jP(n,e)}:FP(e,t,function(n,r){return[n,r]})}var ooe=function(e){for(var t=[],n=[],r=0;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},LP=function(e){var t=xy(e);return function(n){return Nt(n)?t(n):n}},aoe=function(e){var t=Mx(e);return function(n){return Nt(n)?t(n):n}},soe=function(e){var t=$x(e);return function(n){return Nt(n)?t(n):n}};function lA(e){return function(t,n){if(n===void 0){var r=lA(e);return function(a){return r(t,a)}}for(var i=function(a){return e.equals(a,t)},o=0;o<n.length;o++)if(i(n[o]))return!0;return!1}}var uoe=function(e){var t=Ex(e);return function(n){return Nt(n)?t(n):n}},loe=function(e){var t=uB(e);return function(n){return Nt(n)?t(n):n}},coe=function(e){var t=Fx(e);return function(n){return Nt(n)?t(n):jt}},DP=function(e){return function(t){return e>=1&&Nt(t)?Ty(e)(t):Oo(t)?[t,jt]:[jt,t]}},doe=function(e){var t=vB(e);return function(n){return Nt(n)?t(n):jt}},foe=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return gP(e.apply(void 0,t))}};function poe(e,t,n){n===void 0&&(n=function(){return!0});var r=function(i,o){return Nt(o)?x(gr(o),dA(function(a){return r(x(i,Qy(a)),Gi(o))})):n.apply(void 0,i)?[t.apply(void 0,i)]:jt};return r(jt,e)}var UP=function(e){return function(t){return Oo(t)?e:Oo(e)?t:t.concat(e)}},hoe=UP;function _T(e){var t=Rx(e);return function(n,r){if(r===void 0){var i=_T(e);return function(o){return i(o,n)}}return Nt(n)&&Nt(r)?t(r)(n):Nt(n)?n:r}}function xT(e){var t=lA(e);return function(n,r){if(r===void 0){var i=xT(e);return function(o){return i(o,n)}}return n.filter(function(o){return t(o,r)})}}function TT(e){var t=lA(e);return function(n,r){if(r===void 0){var i=TT(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var Ln=function(e,t){return x(e,MT(t))},Gy=function(e,t){return x(e,HP(t))},eu=function(e,t){return x(e,QP(t))},cA=function(e,t){return x(e,dA(t))},Jy=function(e,t){return x(e,YP(t))},Zy=function(e,t){return x(e,jT(t))},Xy=function(e,t){return x(e,GP(t))},e0=function(e,t){return x(e,JP(t))},BP=function(e,t){return x(e,LT(t))},PP=function(e,t){return x(e,DT(t))},IT=function(e,t){return x(e,zP(t))},jl=function(e,t,n){return x(e,BT(t,n))},Zd=function(e){var t=PT(e);return function(n,r){return x(n,t(r))}},Xd=function(e,t,n){return x(e,WT(t,n))},ET=function(e,t,n){return x(e,fA(t,n))},RT=function(e){var t=n0(e);return function(n,r){return x(n,t(r))}},$T=function(e,t,n){return x(e,r0(t,n))},WP=function(e,t){return x(e,FT(t))},NP=function(e,t){return x(e,ZP(t))},KP=function(e,t){return x(e,UT(t))},t0=function(e){var t=XP(e);return function(n,r){return x(n,t(r))}},qP=function(e){var t=NT(e);return function(n,r){return x(n,t(r))}},kT=function(e,t){return x(e,HT(t))},OT=function(e,t){return x(e,YT(t))},Ll=Js,ef=function(){return jt},VP=function(e){return function(t){return t.concat(e())}},zP=VP,QP=function(e){return dA(function(t){return x(e,MT(t))})},dA=function(e){return function(t){return x(t,xP(function(n,r){return e(r)}))}},Aoe=dA(Q),MT=function(e){return function(t){return t.map(function(n){return e(n)})}},HP=function(e){return function(t){return t.map(function(n,r){return e(r,n)})}},tf=function(e){for(var t=[],n=[],r=0,i=e;r<i.length;r++){var o=i[r];o._tag==="Left"?t.push(o.left):n.push(o.right)}return Be(t,n)},YP=function(e){return function(t){return t.filter(e)}},FT=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);$t(i)&&n.push(i.value)}return n}},jT=function(e){return FT(function(t,n){return e(n)})},nf=jT(Q),GP=function(e){return LT(function(t,n){return e(n)})},LT=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];e(i,o)?r.push(o):n.push(o)}return Be(n,r)}},JP=function(e){return DT(function(t,n){return e(n)})},DT=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=e(i,t[i]);o._tag==="Left"?n.push(o.left):r.push(o.right)}return Be(n,r)}},ZP=function(e){return function(t){return t.filter(function(n,r){return e(r,n)})}},UT=function(e){return function(t){return t.map(function(n,r){return e(t.slice(r))})}},moe=UT(Q),n0=function(e){return function(t){return function(n){return n.reduce(function(r,i,o){return e.concat(r,t(o,i))},e.empty)}}},BT=function(e,t){return fA(e,function(n,r,i){return t(r,i)})},PT=function(e){var t=n0(e);return function(n){return t(function(r,i){return n(i)})}},fA=function(e,t){return function(n){for(var r=n.length,i=e,o=0;o<r;o++)i=t(o,i,n[o]);return i}},WT=function(e,t){return r0(e,function(n,r,i){return t(r,i)})},r0=function(e,t){return function(n){return n.reduceRight(function(r,i,o){return t(o,i,r)},e)}},XP=function(e){var t=NT(e);return function(n){return t(function(r,i){return n(i)})}},pA=function(e){return function(t){return jl(t,e.of(ef()),function(n,r){return e.ap(e.map(n,function(i){return function(o){return x(i,Qy(o))}}),r)})}},NT=function(e){return function(t){return fA(e.of(ef()),function(n,r,i){return e.ap(e.map(r,function(o){return function(a){return x(o,Qy(a))}}),t(n,i))})}},goe=function(e){var t=GT(e);return function(n){return function(r){return t(r,n)}}},voe=function(e){var t=JT(e);return function(n){return function(r){return t(r,n)}}},KT=function(e,t){for(var n=[],r=e;;){var i=t(r);if($t(i)){var o=i.value,a=o[0],s=o[1];n.push(a),r=s}else break}return n},yt="ReadonlyArray",eW=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},tW=function(){return{concat:function(e,t){return Oo(e)?t:Oo(t)?e:e.concat(t)}}},yoe=function(){return{concat:tW().concat,empty:jt}},nW=function(e){return ki(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},rW=function(e){return Fl(function(t,n){for(var r=t.length,i=n.length,o=Math.min(r,i),a=0;a<o;a++){var s=e.compare(t[a],n[a]);if(s!==0)return s}return qy.compare(r,i)})},iW=function(e){var t=_T(e);return{concat:function(n,r){return t(r)(n)}}},boe=function(e){return{concat:iW(e).concat,empty:jt}},Coe=function(e){var t=xT(e);return{concat:function(n,r){return t(r)(n)}}},Soe=function(e){var t=TT(e);return{concat:function(n,r){return t(r)(n)}}},qT={URI:yt,map:Ln},woe=He(qT),oW={URI:yt,of:Ll},_oe={URI:yt,map:Ln,mapWithIndex:Gy},i0={URI:yt,map:Ln,ap:eu},xoe=Kt(i0),Toe=qt(i0),Ioe={URI:yt,map:Ln,ap:eu,of:Ll},VT={URI:yt,map:Ln,ap:eu,chain:cA},Eoe={URI:yt,map:Ln,ap:eu,of:Ll,chain:cA},Roe=vt(VT),$oe={URI:yt,unfold:KT},koe={URI:yt,map:Ln,alt:IT},aW={URI:yt,zero:ef},Ooe=Gd(aW,oW),Moe={URI:yt,map:Ln,ap:eu,of:Ll,alt:IT,zero:ef},Foe={URI:yt,map:Ln,extend:KP},zT={URI:yt,compact:nf,separate:tf},joe={URI:yt,map:Ln,compact:nf,separate:tf,filter:Jy,filterMap:Zy,partition:Xy,partitionMap:e0},Loe={URI:yt,map:Ln,mapWithIndex:Gy,compact:nf,separate:tf,filter:Jy,filterMap:Zy,partition:Xy,partitionMap:e0,partitionMapWithIndex:PP,partitionWithIndex:BP,filterMapWithIndex:WP,filterWithIndex:NP},Doe={URI:yt,reduce:jl,foldMap:Zd,reduceRight:Xd},Uoe={URI:yt,reduce:jl,foldMap:Zd,reduceRight:Xd,reduceWithIndex:ET,foldMapWithIndex:RT,reduceRightWithIndex:$T},QT={URI:yt,map:Ln,reduce:jl,foldMap:Zd,reduceRight:Xd,traverse:t0,sequence:pA},Boe={URI:yt,map:Ln,mapWithIndex:Gy,reduce:jl,foldMap:Zd,reduceRight:Xd,reduceWithIndex:ET,foldMapWithIndex:RT,reduceRightWithIndex:$T,traverse:t0,sequence:pA,traverseWithIndex:qP},HT=function(e){return function(t){for(var n=Oie([],e(t),!0),r=[];n.length>0;){var i=n.shift();An(i)?n.unshift.apply(n,e(i.left)):r.push(i.right)}return r}},Poe={URI:yt,map:Ln,ap:eu,chain:cA,chainRec:kT},YT=function(e){return function(t){var n=e(t),r=[],i=[];function o(l){An(l)?e(l.left).forEach(function(c){return r.push(c)}):i.push(l.right)}for(var a=0,s=n;a<s.length;a++){var u=s[a];o(u)}for(;r.length>0;)o(r.shift());return i}},Woe={URI:yt,map:Ln,ap:eu,chain:cA,chainRec:OT},GT=ro(QT,zT),JT=no(QT,zT),sW={URI:yt,map:Ln,compact:nf,separate:tf,filter:Jy,filterMap:Zy,partition:Xy,partitionMap:e0,reduce:jl,foldMap:Zd,reduceRight:Xd,traverse:t0,sequence:pA,wither:GT,wilt:JT},Noe=wT(sW),uW={URI:yt,fromEither:vP},Koe=di(uW),qoe=wy,o0=function(e,t,n){return Nt(n)?Ix(e,t,n):n},lW=function(e,t){var n=t.slice();return n.splice(e,1),n},Voe=function(e){return e.slice()},zoe=function(e){return Oo(e)?jt:e.slice()},jt=Jh;function cW(e){return function(t){return t.every(e)}}var dW=function(e){return function(t){return t.some(e)}},Qoe=dW,fW=function(e){var t=Gx(e);return function(n){return bP(function(){return e.empty},t(n))}},Hoe=Ll(gn),Yoe=zt(qT),Goe=Qt(VT),Joe=Vt(i0),Zoe=lB,Xoe=MB,eae=FB,tae=LP,nae={URI:yt,compact:nf,separate:tf,map:Ln,ap:eu,of:Ll,chain:cA,filter:Jy,filterMap:Zy,partition:Xy,partitionMap:e0,mapWithIndex:Gy,partitionMapWithIndex:PP,partitionWithIndex:BP,filterMapWithIndex:WP,filterWithIndex:NP,alt:IT,zero:ef,unfold:KT,reduce:jl,foldMap:Zd,reduceRight:Xd,traverse:t0,sequence:pA,reduceWithIndex:ET,foldMapWithIndex:RT,reduceRightWithIndex:$T,traverseWithIndex:qP,extend:KP,wither:GT,wilt:JT};const rae=Object.freeze(Object.defineProperty({__proto__:null,Alt:koe,Alternative:Moe,Applicative:Ioe,Apply:i0,Chain:VT,ChainRecBreadthFirst:Woe,ChainRecDepthFirst:Poe,Compactable:zT,Do:Hoe,Extend:Foe,Filterable:joe,FilterableWithIndex:Loe,Foldable:Doe,FoldableWithIndex:Uoe,FromEither:uW,Functor:qT,FunctorWithIndex:_oe,Monad:Eoe,Pointed:oW,Traversable:QT,TraversableWithIndex:Boe,URI:yt,Unfoldable:$oe,Witherable:sW,Zero:aW,_chainRecBreadthFirst:OT,_chainRecDepthFirst:kT,alt:zP,altW:VP,ap:QP,apFirst:xoe,apS:Joe,apSecond:Toe,append:Qy,appendW:jie,bind:Goe,bindTo:Yoe,chain:dA,chainFirst:Roe,chainRecBreadthFirst:YT,chainRecDepthFirst:HT,chainWithIndex:xP,chop:coe,chunksOf:doe,compact:nf,comprehension:poe,concat:hoe,concatW:UP,cons:Xoe,deleteAt:eoe,difference:TT,dropLeft:Yie,dropLeftWhile:Jie,dropRight:Gie,duplicate:moe,elem:lA,empty:jt,every:cW,exists:Qoe,extend:UT,filter:YP,filterE:Noe,filterMap:jT,filterMapWithIndex:FT,filterWithIndex:ZP,findFirst:Yy,findFirstMap:RP,findIndex:Hy,findLast:$P,findLastIndex:OP,findLastMap:kP,flap:woe,flatten:Aoe,foldLeft:Uie,foldMap:PT,foldMapWithIndex:n0,foldRight:Bie,fromArray:zoe,fromEither:vP,fromEitherK:Koe,fromOption:gP,fromOptionK:foe,fromPredicate:Die,getDifferenceMagma:Soe,getEq:nW,getIntersectionSemigroup:Coe,getMonoid:yoe,getOrd:rW,getSemigroup:tW,getShow:eW,getUnionMonoid:boe,getUnionSemigroup:iW,guard:Ooe,head:TP,init:qie,insertAt:Zie,intercalate:fW,intersection:xT,intersperse:aoe,isEmpty:Oo,isNonEmpty:Nt,isOutOfBound:Jd,last:IP,lefts:roe,lookup:ll,makeBy:mP,map:MT,mapWithIndex:HP,match:bP,matchLeft:SP,matchLeftW:CP,matchRight:_P,matchRightW:wP,matchW:yP,modifyAt:MP,of:Ll,partition:GP,partitionMap:JP,partitionMapWithIndex:DT,partitionWithIndex:LT,prepend:Mie,prependAll:LP,prependToAll:tae,prependW:Fie,range:Zoe,readonlyArray:nae,reduce:BT,reduceRight:WT,reduceRightWithIndex:r0,reduceWithIndex:fA,replicate:Lie,reverse:toe,rights:noe,rotate:soe,scanLeft:Pie,scanRight:Wie,separate:tf,sequence:pA,size:Nie,snoc:eae,some:dW,sort:ioe,sortBy:loe,spanLeft:Hie,splitAt:DP,tail:Kie,takeLeft:Vie,takeLeftWhile:Qie,takeRight:zie,toArray:Voe,traverse:XP,traverseWithIndex:NT,unfold:KT,union:_T,uniq:uoe,unsafeDeleteAt:lW,unsafeInsertAt:qoe,unsafeUpdateAt:o0,unzip:ooe,updateAt:Xie,wilt:voe,wither:goe,zero:ef,zip:jP,zipWith:FP},Symbol.toStringTag,{value:"Module"}));var Ds=function(e){return e.length===0},tn=Oa,iae=pd,oae=Jx,a0=rA,aae=Zx,pW=function(e,t){return e<=0?[]:Ly(t)(e)},sae=function(e,t){return pW(e,function(){return t})};function uae(e){return function(t){return e(t)?[t]:[]}}var hW=function(e){return en(e)?[]:[e.value]},AW=function(e){return An(e)?[]:[e.right]},mW=function(e,t){return function(n){return tn(n)?t(n):e()}},lae=mW,gW=function(e,t){return function(n){return tn(n)?t(Oi(n),Ji(n)):e()}},vW=gW,cae=vW,yW=function(e,t){return function(n){return tn(n)?t(Yd(n),Hd(n)):e()}},bW=yW,dae=bW,CW=function(e){return function(t){for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},fae=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[0]=e;for(var o=0;o<r;o++)i[o+1]=t(i[o],n[o]);return i}},pae=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[r]=e;for(var o=r-1;o>=0;o--)i[o]=t(n[o],i[o+1]);return i}},hae=function(e){return e.length},hA=jy,Aae=ll,mae=TP,gae=IP,vae=function(e){return tn(e)?ye(Ji(e)):Re},yae=function(e){return tn(e)?ye(Yd(e)):Re},bae=function(e){return function(t){return hA(e,t)?Gn(t):t.slice(0,e)}},Cae=function(e){return function(t){return hA(e,t)?Gn(t):e===0?[]:t.slice(-e)}};function Sae(e){return function(t){for(var n=[],r=0,i=t;r<i.length;r++){var o=i[r];if(!e(o))break;n.push(o)}return n}}var SW=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r};function wae(e){return function(t){var n=IW(SW(t,e))(t),r=n[0],i=n[1];return{init:r,rest:i}}}var _ae=function(e){return function(t){return e<=0||Ds(t)?Gn(t):e>=t.length?[]:t.slice(e,t.length)}},xae=function(e){return function(t){return e<=0||Ds(t)?Gn(t):e>=t.length?[]:t.slice(0,t.length-e)}};function Tae(e){return function(t){return t.slice(SW(t,e))}}var Iae=Hy;function Eae(e){return Yy(e)}var Rae=RP;function $ae(e){return $P(e)}var kae=kP,Oae=OP,Gn=function(e){return e.slice()},Mae=function(e,t){return function(n){return e<0||e>n.length?Re:ye(nN(e,t,n))}},Fae=function(e,t){return wW(e,function(){return t})},jae=function(e){return function(t){return hA(e,t)?Re:ye(iN(e,t))}},wW=function(e,t){return function(n){return hA(e,n)?Re:ye(rN(e,t(n[e]),n))}},Lae=function(e){return Ds(e)?[]:e.slice().reverse()},Dae=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Right"&&t.push(r.right)}return t},Uae=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Left"&&t.push(r.left)}return t},Bae=function(e){return function(t){return t.length<=1?Gn(t):t.slice().sort(e.compare)}},_W=function(e,t,n){for(var r=[],i=Math.min(e.length,t.length),o=0;o<i;o++)r[o]=n(e[o],t[o]);return r};function xW(e,t){return t===void 0?function(n){return xW(n,e)}:_W(e,t,function(n,r){return[n,r]})}var Pae=function(e){for(var t=[],n=[],r=0;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},TW=function(e){var t=Uy(e);return function(n){return tn(n)?t(n):[]}},Wae=function(e){var t=qB(e);return function(n){return tn(n)?t(n):Gn(n)}},Nae=function(e){var t=rT(e);return function(n){return tn(n)?t(n):Gn(n)}},ZT=lA,Kae=function(e){var t=tT(e);return function(n){return tn(n)?t(n):Gn(n)}},qae=function(e){var t=jB(e);return function(n){return tn(n)?t(n):Gn(n)}},Vae=function(e){var t=aT(e);return function(n){return tn(n)?t(n):[]}},IW=function(e){return function(t){return e>=1&&tn(t)?By(e)(t):Ds(t)?[Gn(t),[]]:[[],Gn(t)]}},zae=function(e){var t=HB(e);return function(n){return tn(n)?t(n):[]}},Qae=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return hW(e.apply(void 0,t))}};function Hae(e,t,n){n===void 0&&(n=function(){return!0});var r=function(i,o){return tn(o)?x(Oi(o),mA(function(a){return r(x(i,a0(a)),Ji(o))})):n.apply(void 0,i)?[t.apply(void 0,i)]:[]};return r([],e)}var EW=function(e){return function(t){return Ds(t)?Gn(e):Ds(e)?Gn(t):t.concat(e)}},Yae=EW;function XT(e){var t=nT(e);return function(n,r){if(r===void 0){var i=XT(e);return function(o){return i(o,n)}}return tn(n)&&tn(r)?t(r)(n):tn(n)?Gn(n):Gn(r)}}function eI(e){var t=ZT(e);return function(n,r){if(r===void 0){var i=eI(e);return function(o){return i(o,n)}}return n.filter(function(o){return t(o,r)})}}function tI(e){var t=ZT(e);return function(n,r){if(r===void 0){var i=tI(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var Dn=function(e,t){return x(e,aI(t))},s0=function(e,t){return x(e,LW(t))},tu=function(e,t){return x(e,jW(t))},AA=function(e,t){return x(e,mA(t))},u0=function(e,t){return x(e,DW(t))},l0=function(e,t){return x(e,uI(t))},c0=function(e,t){return x(e,UW(t))},d0=function(e,t){return x(e,BW(t))},RW=function(e,t){return x(e,lI(t))},$W=function(e,t){return x(e,cI(t))},nI=function(e,t){return x(e,WW(t))},Dl=function(e,t,n){return x(e,VW(t,n))},rf=function(e){var t=KW(e);return function(n,r){return x(n,t(r))}},of=function(e,t,n){return x(e,zW(t,n))},rI=function(e,t,n){return x(e,fI(t,n))},iI=function(e){var t=qW(e);return function(n,r){return x(n,t(r))}},oI=function(e,t,n){return x(e,QW(t,n))},kW=function(e,t){return x(e,sI(t))},OW=function(e,t){return x(e,NW(t))},MW=function(e,t){return x(e,dI(t))},f0=function(e){var t=p0(e);return function(n,r){return x(n,t(r))}},FW=function(e){var t=pI(e);return function(n,r){return x(n,t(r))}},Gae=kT,Jae=OT,nu=Xs,af=function(){return[]},aI=function(e){return function(t){return t.map(function(n){return e(n)})}},jW=function(e){return mA(function(t){return x(e,aI(t))})},mA=function(e){return function(t){return x(t,CW(function(n,r){return e(r)}))}},Zae=mA(Q),LW=function(e){return function(t){return t.map(function(n,r){return e(r,n)})}},sI=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);$t(i)&&n.push(i.value)}return n}},uI=function(e){return sI(function(t,n){return e(n)})},sf=uI(Q),uf=function(e){for(var t=[],n=[],r=0,i=e;r<i.length;r++){var o=i[r];o._tag==="Left"?t.push(o.left):n.push(o.right)}return Be(t,n)},DW=function(e){return function(t){return t.filter(e)}},UW=function(e){return lI(function(t,n){return e(n)})},lI=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];e(i,o)?r.push(o):n.push(o)}return Be(n,r)}},BW=function(e){return cI(function(t,n){return e(n)})},cI=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=e(i,t[i]);o._tag==="Left"?n.push(o.left):r.push(o.right)}return Be(n,r)}},PW=function(e){return function(t){return t.concat(e())}},WW=PW,NW=function(e){return function(t){return t.filter(function(n,r){return e(r,n)})}},dI=function(e){return function(t){return t.map(function(n,r){return e(t.slice(r))})}},Xae=dI(Q),KW=PT,qW=n0,VW=BT,fI=fA,zW=WT,QW=r0,p0=function(e){var t=pI(e);return function(n){return t(function(r,i){return n(i)})}},gA=function(e){return function(t){return Dl(t,e.of(af()),function(n,r){return e.ap(e.map(n,function(i){return function(o){return x(i,a0(o))}}),r)})}},pI=function(e){return function(t){return fI(e.of(af()),function(n,r,i){return e.ap(e.map(r,function(o){return function(a){return x(o,a0(a))}}),t(n,i))})}},ese=function(e){var t=bI(e);return function(n){return function(r){return t(r,n)}}},tse=function(e){var t=CI(e);return function(n){return function(r){return t(r,n)}}},hI=function(e,t){for(var n=[],r=e;;){var i=t(r);if($t(i)){var o=i.value,a=o[0],s=o[1];n.push(a),r=s}else break}return n},bt="Array",nse=eW,HW=function(){return{concat:function(e,t){return e.concat(t)}}},AI=function(){return{concat:HW().concat,empty:[]}},YW=nW,rse=rW,GW=function(e){var t=XT(e);return{concat:function(n,r){return t(r)(n)}}},ise=function(e){return{concat:GW(e).concat,empty:[]}},ose=function(e){var t=eI(e);return{concat:function(n,r){return t(r)(n)}}},ase=function(e){var t=tI(e);return{concat:function(n,r){return t(r)(n)}}},mI={URI:bt,map:Dn},sse=He(mI),JW={URI:bt,of:nu},use={URI:bt,map:Dn,mapWithIndex:s0},h0={URI:bt,map:Dn,ap:tu},lse=Kt(h0),cse=qt(h0),dse={URI:bt,map:Dn,ap:tu,of:nu},gI={URI:bt,map:Dn,ap:tu,chain:AA},fse=vt(gI),pse={URI:bt,map:Dn,ap:tu,of:nu,chain:AA},hse={URI:bt,unfold:hI},Ase={URI:bt,map:Dn,alt:nI},ZW={URI:bt,zero:af},mse=Gd(ZW,JW),gse={URI:bt,map:Dn,ap:tu,of:nu,alt:nI,zero:af},vse={URI:bt,map:Dn,extend:MW},vI={URI:bt,compact:sf,separate:uf},yse={URI:bt,map:Dn,compact:sf,separate:uf,filter:u0,filterMap:l0,partition:c0,partitionMap:d0},bse={URI:bt,map:Dn,mapWithIndex:s0,compact:sf,separate:uf,filter:u0,filterMap:l0,partition:c0,partitionMap:d0,partitionMapWithIndex:$W,partitionWithIndex:RW,filterMapWithIndex:kW,filterWithIndex:OW},XW={URI:bt,reduce:Dl,foldMap:rf,reduceRight:of},Cse={URI:bt,reduce:Dl,foldMap:rf,reduceRight:of,reduceWithIndex:rI,foldMapWithIndex:iI,reduceRightWithIndex:oI},yI={URI:bt,map:Dn,reduce:Dl,foldMap:rf,reduceRight:of,traverse:f0,sequence:gA},Sse={URI:bt,map:Dn,mapWithIndex:s0,reduce:Dl,foldMap:rf,reduceRight:of,reduceWithIndex:rI,foldMapWithIndex:iI,reduceRightWithIndex:oI,traverse:f0,sequence:gA,traverseWithIndex:FW},bI=ro(yI,vI),CI=no(yI,vI),eN={URI:bt,map:Dn,compact:sf,separate:uf,filter:u0,filterMap:l0,partition:c0,partitionMap:d0,reduce:Dl,foldMap:rf,reduceRight:of,traverse:f0,sequence:gA,wither:bI,wilt:CI},wse=HT,_se={URI:bt,map:Dn,ap:tu,chain:AA,chainRec:Gae},xse=YT,Tse={URI:bt,map:Dn,ap:tu,chain:AA,chainRec:Jae},Ise=wT(eN),tN={URI:bt,fromEither:AW},Ese=di(tN),nN=Xx,rN=function(e,t,n){return tn(n)?eT(e,t,n):[]},iN=function(e,t){var n=t.slice();return n.splice(e,1),n},Rse=cW,oN=function(e){return function(t){return t.some(e)}},$se=oN,kse=fW,Ose=nu(gn),Mse=zt(mI),Fse=Qt(gI),jse=Vt(h0),Lse=LB,Dse=[],Use=lP,Bse=cP,Pse=TW,Wse={URI:bt,compact:sf,separate:uf,map:Dn,ap:tu,of:nu,chain:AA,filter:u0,filterMap:l0,partition:c0,partitionMap:d0,mapWithIndex:s0,partitionMapWithIndex:$W,partitionWithIndex:RW,filterMapWithIndex:kW,filterWithIndex:OW,alt:nI,zero:af,unfold:hI,reduce:Dl,foldMap:rf,reduceRight:of,traverse:f0,sequence:gA,reduceWithIndex:rI,foldMapWithIndex:iI,reduceRightWithIndex:oI,traverseWithIndex:FW,extend:MW,wither:bI,wilt:CI};const Nse=Object.freeze(Object.defineProperty({__proto__:null,Alt:Ase,Alternative:gse,Applicative:dse,Apply:h0,Chain:gI,ChainRecBreadthFirst:Tse,ChainRecDepthFirst:_se,Compactable:vI,Do:Ose,Extend:vse,Filterable:yse,FilterableWithIndex:bse,Foldable:XW,FoldableWithIndex:Cse,FromEither:tN,Functor:mI,FunctorWithIndex:use,Monad:pse,Pointed:JW,Traversable:yI,TraversableWithIndex:Sse,URI:bt,Unfoldable:hse,Witherable:eN,Zero:ZW,alt:WW,altW:PW,ap:jW,apFirst:lse,apS:jse,apSecond:cse,append:a0,appendW:aae,array:Wse,bind:Fse,bindTo:Mse,chain:mA,chainFirst:fse,chainRecBreadthFirst:xse,chainRecDepthFirst:wse,chainWithIndex:CW,chop:Vae,chunksOf:zae,compact:sf,comprehension:Hae,concat:Yae,concatW:EW,cons:Use,copy:Gn,deleteAt:jae,difference:tI,dropLeft:_ae,dropLeftWhile:Tae,dropRight:xae,duplicate:Xae,elem:ZT,empty:Dse,every:Rse,exists:$se,extend:dI,filter:DW,filterE:Ise,filterMap:uI,filterMapWithIndex:sI,filterWithIndex:NW,findFirst:Eae,findFirstMap:Rae,findIndex:Iae,findLast:$ae,findLastIndex:Oae,findLastMap:kae,flap:sse,flatten:Zae,foldLeft:cae,foldMap:KW,foldMapWithIndex:qW,foldRight:dae,fromEither:AW,fromEitherK:Ese,fromOption:hW,fromOptionK:Qae,fromPredicate:uae,getDifferenceMagma:ase,getEq:YW,getIntersectionSemigroup:ose,getMonoid:AI,getOrd:rse,getSemigroup:HW,getShow:nse,getUnionMonoid:ise,getUnionSemigroup:GW,guard:mse,head:mae,init:yae,insertAt:Mae,intercalate:kse,intersection:eI,intersperse:Wae,isEmpty:Ds,isNonEmpty:tn,isOutOfBound:hA,last:gae,lefts:Uae,lookup:Aae,makeBy:pW,map:aI,mapWithIndex:LW,match:lae,matchLeft:vW,matchLeftW:gW,matchRight:bW,matchRightW:yW,matchW:mW,modifyAt:wW,of:nu,partition:UW,partitionMap:BW,partitionMapWithIndex:cI,partitionWithIndex:lI,prepend:iae,prependAll:TW,prependToAll:Pse,prependW:oae,range:Lse,reduce:VW,reduceRight:zW,reduceRightWithIndex:QW,reduceWithIndex:fI,replicate:sae,reverse:Lae,rights:Dae,rotate:Nae,scanLeft:fae,scanRight:pae,separate:uf,sequence:gA,size:hae,snoc:Bse,some:oN,sort:Bae,sortBy:qae,spanLeft:wae,splitAt:IW,tail:vae,takeLeft:bae,takeLeftWhile:Sae,takeRight:Cae,traverse:p0,traverseWithIndex:pI,unfold:hI,union:XT,uniq:Kae,unsafeDeleteAt:iN,unsafeInsertAt:nN,unsafeUpdateAt:rN,unzip:Pae,updateAt:Fae,wilt:tse,wither:ese,zero:af,zip:xW,zipWith:_W},Symbol.toStringTag,{value:"Module"})),Kse=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var qse=function(e){return typeof e=="boolean"},aN=function(e,t){return function(n){return n?t():e()}},sN=aN,uN=sN,Vse=uN,lN={equals:function(e,t){return e===t}},zse={meet:function(e,t){return e&&t},join:function(e,t){return e||t},zero:!1,one:!0,implies:function(e,t){return!e||t},not:function(e){return!e}},cN={concat:function(e,t){return e&&t}},dN={concat:function(e,t){return e||t}},Qse={concat:cN.concat,empty:!0},Hse={concat:dN.concat,empty:!1},Yse={equals:lN.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},Gse={show:function(e){return JSON.stringify(e)}};const Jse=Object.freeze(Object.defineProperty({__proto__:null,BooleanAlgebra:zse,Eq:lN,MonoidAll:Qse,MonoidAny:Hse,Ord:Yse,SemigroupAll:cN,SemigroupAny:dN,Show:Gse,fold:Vse,foldW:sN,isBoolean:qse,match:uN,matchW:aN},Symbol.toStringTag,{value:"Module"}));var fN=function(e){return{meet:function(t,n){return e.join(t,n)},join:function(t,n){return e.meet(t,n)},zero:e.one,one:e.zero,implies:function(t,n){return e.join(e.not(t),n)},not:e.not}},Zse={meet:function(){},join:function(){},zero:void 0,one:void 0,implies:function(){},not:function(){}},Xse=fN,eue={meet:function(e,t){return e&&t},join:function(e,t){return e||t},zero:!1,one:!0,implies:function(e,t){return!e||t},not:function(e){return!e}},tue=RU;const nue=Object.freeze(Object.defineProperty({__proto__:null,booleanAlgebraBoolean:eue,booleanAlgebraVoid:Zse,getDualBooleanAlgebra:Xse,getFunctionBooleanAlgebra:tue,reverse:fN},Symbol.toStringTag,{value:"Module"}));var rue=function(e){return JU(e)(e.bottom,e.top)},iue=function(e){var t=mx(e);return{equals:t.equals,compare:t.compare,top:e.bottom,bottom:e.top}},oue={equals:uv.equals,compare:uv.compare,top:1/0,bottom:-1/0};const aue=Object.freeze(Object.defineProperty({__proto__:null,boundedNumber:oue,clamp:rue,reverse:iue},Symbol.toStringTag,{value:"Module"}));function pN(e){return{meet:my(e),join:gy(e)}}const sue=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxDistributiveLattice:pN},Symbol.toStringTag,{value:"Module"}));function uue(e){var t=pN(e);return function(n,r){return{join:t.join,meet:t.meet,zero:n,one:r}}}const lue=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxBoundedDistributiveLattice:uue},Symbol.toStringTag,{value:"Module"})),cue=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),due=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),fue=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),pue=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var SI=function(e,t){for(var n=t(e);n._tag==="Left";)n=t(n.left);return n.right};const hue=Object.freeze(Object.defineProperty({__proto__:null,tailRec:SI},Symbol.toStringTag,{value:"Module"}));function wI(e,t){return function(n,r){return t.compose(e.right(r),e.left(n))}}function hN(e,t){var n=wI(e,t);return function(r,i){return t.compose(e.promap(t.id(),function(o){return o._tag==="Left"?o.left:o.right},Q),n(r,i))}}function Aue(e){return wI(e,e)}function mue(e){return hN(e,e)}const gue=Object.freeze(Object.defineProperty({__proto__:null,fanIn:hN,fanin:mue,split:wI,splitChoice:Aue},Symbol.toStringTag,{value:"Module"})),vue=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var yue=function(e,t){return x(e,AN(t))},AN=function(e){return function(t){return X(e,t)}},mN="Predicate",gN=function(){return{concat:function(e,t){return x(e,yN(t))}}},bue=function(){return{concat:gN().concat,empty:OU}},vN=function(){return{concat:function(e,t){return x(e,bN(t))}}},Cue=function(){return{concat:vN().concat,empty:fx}},Sue={URI:mN,contramap:yue},oh=function(e){return function(t){return!e(t)}},yN=function(e){return function(t){return function(n){return t(n)||e(n)}}},bN=function(e){return function(t){return function(n){return t(n)&&e(n)}}};const wue=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:Sue,URI:mN,and:bN,contramap:AN,getMonoidAll:Cue,getMonoidAny:bue,getSemigroupAll:vN,getSemigroupAny:gN,not:oh,or:yN},Symbol.toStringTag,{value:"Module"}));var dt=Re,kt=ye;function A0(e){return function(t){return e(t)?kt(t):dt}}var m0=function(e){return e._tag==="Right"?dt:kt(e.left)},vA=function(e){return e._tag==="Left"?dt:kt(e.right)},fi=function(e,t){return x(e,Ko(t))},Ul=function(e,t){return x(e,_N(t))},g0=function(e,t){return x(e,yA(t))},v0=function(e,t,n){return x(e,TN(t,n))},y0=function(e){var t=IN(e);return function(n,r){return x(n,t(r))}},b0=function(e,t,n){return x(e,EN(t,n))},_I=function(e){var t=LN(e);return function(n,r){return x(n,t(r))}},xI=function(e,t){return x(e,$N(t))},ah=function(e,t){return x(e,ON(t))},TI=function(e,t){return x(e,MN(t))},CN=function(e,t){return x(e,$I(t))},II=function(e,t){return x(e,FN(t))},EI=function(e,t){return x(e,jN(t))},un="Option",_ue=function(e){return{show:function(t){return Qe(t)?"none":"some(".concat(e.show(t.value),")")}}},SN=function(e){return{equals:function(t,n){return t===n||(Qe(t)?Qe(n):Qe(n)?!1:e.equals(t.value,n.value))}}},xue=function(e){return{equals:SN(e).equals,compare:function(t,n){return t===n?0:lv(t)?lv(n)?e.compare(t.value,n.value):1:-1}}},RI=function(e){return{concat:function(t,n){return Qe(t)?n:Qe(n)?t:kt(e.concat(t.value,n.value))},empty:dt}},Ko=function(e){return function(t){return Qe(t)?dt:kt(e(t.value))}},lf={URI:un,map:fi},Ma=kt,wN={URI:un,of:Ma},_N=function(e){return function(t){return Qe(t)||Qe(e)?dt:kt(t.value(e.value))}},cf={URI:un,map:fi,ap:Ul},xN={URI:un,map:fi,ap:Ul,of:Ma},yA=function(e){return function(t){return Qe(t)?dt:e(t.value)}},bA={URI:un,map:fi,ap:Ul,chain:g0},Tue={URI:un,map:fi,ap:Ul,of:Ma,chain:g0},TN=function(e,t){return function(n){return Qe(n)?e:t(e,n.value)}},IN=function(e){return function(t){return function(n){return Qe(n)?e.empty:t(n.value)}}},EN=function(e,t){return function(n){return Qe(n)?e:t(n.value,e)}},Iue={URI:un,reduce:v0,foldMap:y0,reduceRight:b0},RN=function(e){return function(t){return Qe(t)?e():t}},$N=RN,Eue={URI:un,map:fi,alt:xI},C0=function(){return dt},kN={URI:un,zero:C0},Rue=Gd(kN,wN),$ue={URI:un,map:fi,ap:Ul,of:Ma,alt:xI,zero:C0},$I=function(e){return function(t){return Qe(t)?dt:kt(e(t))}},kue={URI:un,map:fi,extend:CN},df=yA(Q),Oue=Be(dt,dt),ff=function(e){return Qe(e)?Oue:Be(m0(e.value),vA(e.value))},Bl={URI:un,compact:df,separate:ff},ON=function(e){return function(t){return Qe(t)?dt:e(t.value)?t:dt}},MN=function(e){return function(t){return Qe(t)?dt:e(t.value)}},FN=function(e){return function(t){return Be(ah(t,oh(e)),ah(t,e))}},jN=function(e){return X(Ko(e),ff)},Fa={URI:un,map:fi,compact:df,separate:ff,filter:ah,filterMap:TI,partition:II,partitionMap:EI},LN=function(e){return function(t){return function(n){return Qe(n)?e.of(dt):e.map(t(n.value),kt)}}},S0=function(e){return function(t){return Qe(t)?e.of(dt):e.map(t.value,kt)}},kI={URI:un,map:fi,reduce:v0,foldMap:y0,reduceRight:b0,traverse:_I,sequence:S0},OI=ro(kI,Bl),MI=no(kI,Bl),Mue=function(e){var t=OI(e);return function(n){return function(r){return t(r,n)}}},Fue=function(e){var t=MI(e);return function(n){return function(r){return t(r,n)}}},jue={URI:un,map:fi,reduce:v0,foldMap:y0,reduceRight:b0,traverse:_I,sequence:S0,compact:df,separate:ff,filter:ah,filterMap:TI,partition:II,partitionMap:EI,wither:OI,wilt:MI},FI=function(){return dt},Lue={URI:un,map:fi,ap:Ul,of:Ma,chain:g0,throwError:FI},pf=vA,w0={URI:un,fromEither:pf},lv=$t,Qe=function(e){return e._tag==="None"},jI=function(e,t){return function(n){return Qe(n)?e():t(n.value)}},Due=jI,ja=jI,ru=ja,DN=function(e){return function(t){return Qe(t)?e():t.value}},LI=DN,Uue=He(lf),Bue=Kt(cf),Pue=qt(cf),Wue=df,Nue=vt(bA),Kue=$I(Q),que=di(w0),Vue=$a(w0,bA),zue=ka(w0,bA),Pl=function(e){return e==null?dt:kt(e)},UN=function(e){try{return kt(e())}catch{return dt}},Que=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return UN(function(){return e.apply(void 0,t)})}},Hue=function(e){return X(e,Pl)},BN=function(e){return function(t){return Qe(t)?dt:Pl(e(t.value))}},DI=ja(MU,Q),PN=ja(px,Q);function WN(e){return function(t,n){if(n===void 0){var r=WN(e);return function(i){return r(t,i)}}return Qe(n)?!1:e.equals(t,n.value)}}var Yue=function(e){return function(t){return Qe(t)?!1:e(t.value)}},Gue=Ma(gn),Jue=zt(lf),Zue=Qt(bA),Xue=Vt(cf),NN=Ma(jn),_0=function(e){return function(t){var n=e(0,ci(t));if(Qe(n))return dt;for(var r=[n.value],i=1;i<t.length;i++){var o=e(i,t[i]);if(Qe(o))return dt;r.push(o.value)}return kt(r)}},UI=function(e){var t=_0(e);return function(n){return _t(n)?t(n):NN}},ele=UI,KN=function(e){return UI(function(t,n){return e(n)})},tle=KN(Q);function nle(e){return function(t){return lv(e(t))}}var rle=BN,qN={URI:un,map:fi,of:Ma,ap:Ul,chain:g0,reduce:v0,foldMap:y0,reduceRight:b0,traverse:_I,sequence:S0,zero:C0,alt:xI,extend:CN,compact:df,separate:ff,filter:ah,filterMap:TI,partition:II,partitionMap:EI,wither:OI,wilt:MI,throwError:FI},ile=vn(cf),ole=$i(xN),VN=function(){return RI(wx())},ale=function(){return RI(by())};const sle=Object.freeze(Object.defineProperty({__proto__:null,Alt:Eue,Alternative:$ue,ApT:NN,Applicative:xN,Apply:cf,Chain:bA,Compactable:Bl,Do:Gue,Extend:kue,Filterable:Fa,Foldable:Iue,FromEither:w0,Functor:lf,Monad:Tue,MonadThrow:Lue,Pointed:wN,Traversable:kI,URI:un,Witherable:jue,Zero:kN,alt:$N,altW:RN,ap:_N,apFirst:Bue,apS:Xue,apSecond:Pue,bind:Zue,bindTo:Jue,chain:yA,chainEitherK:Vue,chainFirst:Nue,chainFirstEitherK:zue,chainNullableK:BN,compact:df,duplicate:Kue,elem:WN,exists:Yue,extend:$I,filter:ON,filterMap:MN,flap:Uue,flatten:Wue,fold:ru,foldMap:IN,foldW:Due,fromEither:pf,fromEitherK:que,fromNullable:Pl,fromNullableK:Hue,fromPredicate:A0,getApplyMonoid:ole,getApplySemigroup:ile,getEq:SN,getFirstMonoid:VN,getLastMonoid:ale,getLeft:m0,getMonoid:RI,getOrElse:LI,getOrElseW:DN,getOrd:xue,getRefinement:nle,getRight:vA,getShow:_ue,guard:Rue,isNone:Qe,isSome:lv,map:Ko,mapNullable:rle,match:ja,matchW:jI,none:dt,of:Ma,option:qN,partition:FN,partitionMap:jN,reduce:TN,reduceRight:EN,separate:ff,sequence:S0,sequenceArray:tle,some:kt,throwError:FI,toNullable:DI,toUndefined:PN,traverse:LN,traverseArray:KN,traverseArrayWithIndex:ele,traverseReadonlyArrayWithIndex:UI,traverseReadonlyNonEmptyArrayWithIndex:_0,tryCatch:UN,tryCatchK:Que,wilt:Fue,wither:Mue,zero:C0},Symbol.toStringTag,{value:"Module"}));function qo(e,t){return function(n){return e.map(n,t.compact)}}function La(e,t,n){var r=qo(e,t),i=Kd(e,n);return function(o){return Be(r(x(o,i(m0))),r(x(o,i(vA))))}}function ule(e,t){var n=qd(e,t).map;return{map:n,compact:qo(e,t),separate:La(e,t,t)}}const lle=Object.freeze(Object.defineProperty({__proto__:null,compact:qo,getCompactableComposition:ule,separate:La},Symbol.toStringTag,{value:"Module"}));var cle=function(e){return function(){return console.log(e)}},dle=function(e){return function(){return console.warn(e)}},fle=function(e){return function(){return console.error(e)}},ple=function(e){return function(){return console.info(e)}};const hle=Object.freeze(Object.defineProperty({__proto__:null,error:fle,info:ple,log:cle,warn:dle},Symbol.toStringTag,{value:"Module"}));var hf=dd;function Ale(e){return{show:function(t){return"make(".concat(e.show(t),")")}}}var mle=Q,gle=Q,vle=Q,yle=Q,ble=Q,Cle=Q,Sle=Q,wle=Q,_le=Q;function zN(e){return{URI:Wl,_E:void 0,map:BI,ap:function(t,n){return hf(e.concat(t,n))}}}function QN(e){var t=zN(e);return{URI:Wl,_E:void 0,map:t.map,ap:t.ap,of:function(){return hf(e.empty)}}}var HN=function(e,t){return x(e,JN())},BI=function(e,t){return x(e,ZN())},YN=function(e,t,n){return x(e,XN(t))},GN=function(e,t){return x(e,eK(t))},JN=function(){return dd},ZN=function(){return dd},XN=function(e){return function(t){return hf(e(t))}},eK=function(e){return function(t){return hf(e(t))}},Wl="Const",tK={URI:Wl,map:BI},xle=He(tK),Tle={URI:Wl,contramap:HN},Ile={URI:Wl,bimap:YN,mapLeft:GN},Ele={URI:Wl,map:BI,contramap:HN,bimap:YN,mapLeft:GN};const Rle=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:Ile,Contravariant:Tle,Functor:tK,URI:Wl,bimap:XN,const_:Ele,contramap:JN,flap:xle,getApplicative:QN,getApply:zN,getBooleanAlgebra:_le,getBounded:vle,getEq:mle,getHeytingAlgebra:wle,getMonoid:ble,getOrd:gle,getRing:Sle,getSemigroup:yle,getSemiring:Cle,getShow:Ale,make:hf,map:ZN,mapLeft:eK},Symbol.toStringTag,{value:"Module"})),$le=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var kle={equals:function(e,t){return e.valueOf()===t.valueOf()}},Ole={equals:function(e,t){return e.getDate()===t.getDate()}},Mle={equals:function(e,t){return e.getMonth()===t.getMonth()}},Fle={equals:function(e,t){return e.getFullYear()===t.getFullYear()}},jle=x(qy,Ay(function(e){return e.valueOf()})),Lle=function(){return new Date},Dle=function(){return new Date().getTime()};const Ule=Object.freeze(Object.defineProperty({__proto__:null,Eq:kle,Ord:jle,create:Lle,eqDate:Ole,eqMonth:Mle,eqYear:Fle,now:Dle},Symbol.toStringTag,{value:"Module"}));var Lt=Ca,Je=Ys,er=function(e,t){return x(e,ql(t))},Nl=function(e,t){return x(e,oK(t))},Af=function(e,t){return x(e,Mi(t))},CA=function(e,t,n){return x(e,sK(t,n))},SA=function(e){return function(t,n){var r=uK(e);return x(t,r(n))}},wA=function(e,t,n){return x(e,lK(t,n))},x0=function(e){var t=cK(e);return function(n,r){return x(n,t(r))}},PI=function(e,t,n){return x(e,VI(t,n))},WI=function(e,t){return x(e,IA(t))},nK=function(e,t){return x(e,fK(t))},NI=function(e,t){return x(e,zI(t))},KI=function(e,t){return SI(t(e),function(n){return le(n)?Je(Lt(n.left)):le(n.right)?Lt(t(n.right.left)):Je(Je(n.right.right))})},Ut="Either",Ble=function(e,t){return{show:function(n){return le(n)?"left(".concat(e.show(n.left),")"):"right(".concat(t.show(n.right),")")}}},Ple=function(e,t){return{equals:function(n,r){return n===r||(le(n)?le(r)&&e.equals(n.left,r.left):QI(r)&&t.equals(n.right,r.right))}}},_A=function(e){return{concat:function(t,n){return le(n)?t:le(t)?n:Je(e.concat(t.right,n.right))}}},Kl=function(e){var t=Lt(e.empty);return{URI:Ut,_E:void 0,compact:function(n){return le(n)?n:n.right._tag==="None"?t:Je(n.right.value)},separate:function(n){return le(n)?Be(n,n):le(n.right)?Be(Je(n.right.left),t):Be(t,Je(n.right.right))}}},mf=function(e){var t=Lt(e.empty),n=Kl(e),r=n.compact,i=n.separate,o=function(s,u){return le(s)||u(s.right)?s:t},a=function(s,u){return le(s)?Be(s,s):u(s.right)?Be(t,Je(s.right)):Be(Je(s.right),t)};return{URI:Ut,_E:void 0,map:er,compact:r,separate:i,filter:o,filterMap:function(s,u){if(le(s))return s;var l=u(s.right);return l._tag==="None"?t:Je(l.value)},partition:a,partitionMap:function(s,u){if(le(s))return Be(s,s);var l=u(s.right);return le(l)?Be(Je(l.left),t):Be(t,Je(l.right))}}},Wle=function(e){var t=mf(e),n=Kl(e);return{URI:Ut,_E:void 0,map:er,compact:t.compact,separate:t.separate,filter:t.filter,filterMap:t.filterMap,partition:t.partition,partitionMap:t.partitionMap,traverse:x0,sequence:TA,reduce:CA,foldMap:SA,reduceRight:wA,wither:ro(Ew,n),wilt:no(Ew,n)}},iu=function(e){return{URI:Ut,_E:void 0,map:er,ap:function(t,n){return le(t)?le(n)?Lt(e.concat(t.left,n.left)):t:le(n)?n:Je(t.right(n.right))},of:Vo}},rK=function(e){return{URI:Ut,_E:void 0,map:er,alt:function(t,n){if(QI(t))return t;var r=n();return le(r)?Lt(e.concat(t.left,r.left)):r}}},ql=function(e){return function(t){return le(t)?t:Je(e(t.right))}},ou={URI:Ut,map:er},Vo=Je,Nle={URI:Ut,of:Vo},iK=function(e){return function(t){return le(t)?t:le(e)?e:Je(t.right(e.right))}},oK=iK,gf={URI:Ut,map:er,ap:Nl},aK={URI:Ut,map:er,ap:Nl,of:Vo},qI=function(e){return function(t){return le(t)?t:e(t.right)}},Mi=qI,xA={URI:Ut,map:er,ap:Nl,chain:Af},Kle={URI:Ut,map:er,ap:Nl,of:Vo,chain:Af},sK=function(e,t){return function(n){return le(n)?e:t(e,n.right)}},uK=function(e){return function(t){return function(n){return le(n)?e.empty:t(n.right)}}},lK=function(e,t){return function(n){return le(n)?e:t(n.right,e)}},qle={URI:Ut,reduce:CA,foldMap:SA,reduceRight:wA},cK=function(e){return function(t){return function(n){return le(n)?e.of(Lt(n.left)):e.map(t(n.right),Je)}}},TA=function(e){return function(t){return le(t)?e.of(Lt(t.left)):e.map(t.right,Je)}},Ew={URI:Ut,map:er,reduce:CA,foldMap:SA,reduceRight:wA,traverse:x0,sequence:TA},VI=function(e,t){return function(n){return le(n)?Lt(e(n.left)):Je(t(n.right))}},IA=function(e){return function(t){return le(t)?Lt(e(t.left)):t}},Vle={URI:Ut,bimap:PI,mapLeft:WI},dK=function(e){return function(t){return le(t)?e():t}},fK=dK,zle={URI:Ut,map:er,alt:nK},zI=function(e){return function(t){return le(t)?t:Je(e(t))}},Qle={URI:Ut,map:er,extend:NI},Hle={URI:Ut,map:er,ap:Nl,chain:Af,chainRec:KI},T0=Lt,Yle={URI:Ut,map:er,ap:Nl,of:Vo,chain:Af,throwError:T0},vf={URI:Ut,fromEither:Q},Gle=Gs(vf),pK=Po(vf),le=An,QI=hx,HI=function(e,t){return function(n){return le(n)?e(n.left):t(n.right)}},hK=HI,au=HI,YI=au,AK=function(e){return function(t){return le(t)?e(t.left):t.right}},Jle=AK,Zle=He(ou),mK=Kt(gf),Xle=mK,gK=qt(gf),ece=gK,vK=vt(xA),tce=vK,yK=qI(Q),nce=yK,rce=zI(Q),ice=Wo(vf),oce=Ol(vf,xA),bK=Ml(vf,xA),ace=bK,CK=function(e){return le(e)?Je(e.left):Lt(e.right)},SK=function(e){return function(t){return le(t)?e(t.left):t}},wK=SK,GI=function(e){return function(t){return t==null?Lt(e):Je(t)}},Vl=function(e,t){try{return Je(e())}catch(n){return Lt(t(n))}},sce=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Vl(function(){return e.apply(void 0,n)},t)}},_K=function(e){var t=GI(e);return function(n){return X(n,t)}},uce=function(e){var t=_K(e);return function(n){return Mi(t(n))}},xK=hK(Q,Q);function lce(e){return e instanceof Error?e:new Error(String(e))}function TK(e){return function(t,n){if(n===void 0){var r=TK(e);return function(i){return r(t,i)}}return le(n)?!1:e.equals(t,n.right)}}var cce=function(e){return function(t){return le(t)?!1:e(t.right)}},dce=Vo(gn),fce=zt(ou),IK=Qt(xA),pce=IK,EK=Vt(gf),hce=EK,RK=Vo(jn),EA=function(e){return function(t){var n=e(0,ci(t));if(le(n))return n;for(var r=[n.right],i=1;i<t.length;i++){var o=e(i,t[i]);if(le(o))return o;r.push(o.right)}return Je(r)}},JI=function(e){var t=EA(e);return function(n){return _t(n)?t(n):RK}},Ace=JI,$K=function(e){return JI(function(t,n){return e(n)})},mce=$K(Q);function gce(e,t){return Vl(function(){return JSON.parse(e)},t)}var vce=function(e,t){return Vl(function(){var n=JSON.stringify(e);if(typeof n!="string")throw new Error("Converting unsupported structure to JSON");return n},t)},yce={URI:Ut,map:er,of:Vo,ap:Nl,chain:Af,reduce:CA,foldMap:SA,reduceRight:wA,traverse:x0,sequence:TA,bimap:PI,mapLeft:WI,alt:nK,extend:NI,chainRec:KI,throwError:T0},bce=vn(gf),Cce=$i(aK),Sce=function(e,t){return vn(iu(e))(t)},wce=function(e,t){return $i(iu(e))(t)};function _ce(e){var t=iu(e).ap,n=rK(e).alt;return{URI:Ut,_E:void 0,map:er,of:Vo,chain:Af,bimap:PI,mapLeft:WI,reduce:CA,foldMap:SA,reduceRight:wA,extend:NI,traverse:x0,sequence:TA,chainRec:KI,throwError:T0,ap:t,alt:n}}const kK=Object.freeze(Object.defineProperty({__proto__:null,Alt:zle,ApT:RK,Applicative:aK,Apply:gf,Bifunctor:Vle,Chain:xA,ChainRec:Hle,Do:dce,Extend:Qle,Foldable:qle,FromEither:vf,Functor:ou,Monad:Kle,MonadThrow:Yle,Pointed:Nle,Traversable:Ew,URI:Ut,alt:fK,altW:dK,ap:oK,apFirst:mK,apFirstW:Xle,apS:EK,apSW:hce,apSecond:gK,apSecondW:ece,apW:iK,bimap:VI,bind:IK,bindTo:fce,bindW:pce,chain:Mi,chainFirst:vK,chainFirstW:tce,chainNullableK:uce,chainOptionK:oce,chainW:qI,duplicate:rce,either:yce,elem:TK,exists:cce,extend:zI,filterOrElse:bK,filterOrElseW:ace,flap:Zle,flatten:nce,flattenW:yK,fold:YI,foldMap:uK,foldW:hK,fromNullable:GI,fromNullableK:_K,fromOption:pK,fromOptionK:ice,fromPredicate:Gle,getAltValidation:rK,getApplicativeValidation:iu,getApplyMonoid:Cce,getApplySemigroup:bce,getCompactable:Kl,getEq:Ple,getFilterable:mf,getOrElse:Jle,getOrElseW:AK,getSemigroup:_A,getShow:Ble,getValidation:_ce,getValidationMonoid:wce,getValidationSemigroup:Sce,getWitherable:Wle,isLeft:le,isRight:QI,left:Lt,map:ql,mapLeft:IA,match:au,matchW:HI,of:Vo,orElse:wK,orElseW:SK,parseJSON:gce,reduce:sK,reduceRight:lK,right:Je,sequence:TA,sequenceArray:mce,stringifyJSON:vce,swap:CK,throwError:T0,toError:lce,toUnion:xK,traverse:cK,traverseArray:$K,traverseArrayWithIndex:Ace,traverseReadonlyArrayWithIndex:JI,traverseReadonlyNonEmptyArrayWithIndex:EA,tryCatch:Vl,tryCatchK:sce},Symbol.toStringTag,{value:"Module"}));function zl(e){return X(Je,e.of)}function yf(e){return X(Lt,e.of)}function bf(e){return function(t){return e.map(t,Je)}}function Cf(e){return function(t){return e.map(t,Lt)}}function I0(e){return function(t){return X(GI(t),e.of)}}function E0(e){var t=I0(e);return function(n){var r=t(n);return function(i){return X(i,r)}}}function ZI(e){var t=Ql(e),n=E0(e);return function(r){var i=n(r);return function(o){return t(i(o))}}}function Sf(e){return Kd(e,ou)}function wf(e){return Ra(e,gf)}function Ql(e){return function(t){return function(n){return e.chain(n,function(r){return le(r)?e.of(r):t(r.right)})}}}function _f(e){return function(t){return function(n){return e.chain(n,function(r){return le(r)?t():e.of(r)})}}}function xf(e){return function(t,n){return function(r){return e.map(r,VI(t,n))}}}function Tf(e){return function(t){return function(n){return e.map(n,IA(t))}}}function RA(e,t){return function(n){return function(r){return e.chain(r,au(function(i){return e.map(n(),IA(function(o){return t.concat(i,o)}))},zl(e)))}}}function $A(e){return function(t,n){return function(r){return e.map(r,au(t,n))}}}function If(e){return function(t,n){return function(r){return e.chain(r,au(t,n))}}}function Ef(e){return function(t){return function(n){return e.chain(n,au(t,e.of))}}}function Hl(e){return function(t){return function(n){return e.chain(n,function(r){return le(r)?t(r.left):e.of(r)})}}}function kA(e){var t=Hl(e);return function(n){return t(function(r){return e.map(n(r),function(i){return le(i)?i:Lt(r)})})}}function OA(e){return function(t){return function(n){return e.chain(n,au(function(r){return e.map(t(r),Lt)},function(r){return e.of(Je(r))}))}}}function Rf(e){return function(t){return e.map(t,CK)}}function MA(e){return function(t){return e.map(t,xK)}}function xce(e){var t=wf(e),n=Sf(e),r=Ql(e),i=_f(e),o=xf(e),a=Tf(e),s=If(e),u=Ef(e),l=Hl(e);return{map:function(c,f){return x(c,n(f))},ap:function(c,f){return x(c,t(f))},of:zl(e),chain:function(c,f){return x(c,r(f))},alt:function(c,f){return x(c,i(f))},bimap:function(c,f,p){return x(c,o(f,p))},mapLeft:function(c,f){return x(c,a(f))},fold:function(c,f,p){return x(c,s(f,p))},getOrElse:function(c,f){return x(c,u(f))},orElse:function(c,f){return x(c,l(f))},swap:Rf(e),rightM:bf(e),leftM:Cf(e),left:yf(e)}}const Tce=Object.freeze(Object.defineProperty({__proto__:null,alt:_f,altValidation:RA,ap:wf,bimap:xf,chain:Ql,chainNullableK:ZI,fromNullable:I0,fromNullableK:E0,getEitherM:xce,getOrElse:Ef,left:yf,leftF:Cf,map:Sf,mapLeft:Tf,match:$A,matchE:If,orElse:Hl,orElseFirst:kA,orLeft:OA,right:zl,rightF:bf,swap:Rf,toUnion:MA},Symbol.toStringTag,{value:"Module"}));var Ice="Endomorphism",OK=function(){return{concat:function(e,t){return X(e,t)}}},MK=function(){return{concat:OK().concat,empty:Q}};const Ece=Object.freeze(Object.defineProperty({__proto__:null,URI:Ice,getMonoid:MK,getSemigroup:OK},Symbol.toStringTag,{value:"Module"})),Rce=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function FK(e,t){var n=t.zero,r=function(i,o){return e.equals(o,n)?i:r(o,t.mod(i,o))};return r}function $ce(e,t){var n=t.zero,r=FK(e,t);return function(i,o){return e.equals(i,n)||e.equals(o,n)?n:t.div(t.mul(i,o),r(i,o))}}var kce={add:function(e,t){return e+t},zero:0,mul:function(e,t){return e*t},one:1,sub:function(e,t){return e-t},degree:function(e){return 1},div:function(e,t){return e/t},mod:function(e,t){return e%t}};const Oce=Object.freeze(Object.defineProperty({__proto__:null,fieldNumber:kce,gcd:FK,lcm:$ce},Symbol.toStringTag,{value:"Module"}));function Da(e,t){return function(n){return function(r){return e.map(r,function(i){return t.filter(i,n)})}}}function Ua(e,t){return function(n){return function(r){return e.map(r,function(i){return t.filterMap(i,n)})}}}function su(e,t){var n=Da(e,t);return function(r){var i=n(oh(r)),o=n(r);return function(a){return Be(i(a),o(a))}}}function uu(e,t){var n=Ua(e,t);return function(r){return function(i){return Be(x(i,n(function(o){return m0(r(o))})),x(i,n(function(o){return vA(r(o))})))}}}function Mce(e,t){var n=qd(e,t).map,r=qo(e,t),i=La(e,t,t),o=Da(e,t),a=Ua(e,t),s=su(e,t),u=uu(e,t);return{map:n,compact:r,separate:i,filter:function(l,c){return x(l,o(c))},filterMap:function(l,c){return x(l,a(c))},partition:function(l,c){return x(l,s(c))},partitionMap:function(l,c){return x(l,u(c))}}}const Fce=Object.freeze(Object.defineProperty({__proto__:null,filter:Da,filterMap:Ua,getFilterableComposition:Mce,partition:su,partitionMap:uu},Symbol.toStringTag,{value:"Module"})),jce=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function jK(e,t){return function(n,r){return function(i){return e.reduce(i,n,function(o,a){return t.reduce(a,o,r)})}}}function LK(e,t){return function(n){var r=e.foldMap(n),i=t.foldMap(n);return function(o){return function(a){return r(a,function(s){return i(s,o)})}}}}function DK(e,t){return function(n,r){return function(i){return e.reduceRight(i,n,function(o,a){return t.reduceRight(o,a,r)})}}}function Lce(e,t){return function(n,r){return function(i){return t.reduce(i,e.of(n),function(o,a){return e.chain(o,function(s){return r(s,a)})})}}}function Dce(e,t){return function(n,r){var i=function(o,a){var s=o.init,u=o.acc;return s?{init:!1,acc:a}:{init:!1,acc:e.concat(e.concat(u,n),a)}};return t.reduce(r,{init:!0,acc:e.empty},i).acc}}function UK(e){return function(t){return e.reduce(t,[],function(n,r){return n.push(r),n})}}function Uce(e,t){var n=function(i,o){return e.ap(e.map(i,Lr),o)},r=e.of(void 0);return function(i,o){return t.reduce(i,r,function(a,s){return n(a,o(s))})}}function Bce(e,t){return function(n,r,i){return t.reduce(n,e.of(r),function(o,a){return e.chain(o,function(s){return i(s,a)})})}}var Pce=UK;function XI(e,t){var n=jK(e,t),r=LK(e,t),i=DK(e,t);return{reduce:function(o,a,s){return x(o,n(a,s))},foldMap:function(o){var a=r(o);return function(s,u){return x(s,a(u))}},reduceRight:function(o,a,s){return x(o,i(a,s))}}}const Wce=Object.freeze(Object.defineProperty({__proto__:null,foldM:Bce,foldMap:LK,getFoldableComposition:XI,intercalate:Dce,reduce:jK,reduceM:Lce,reduceRight:DK,toArray:Pce,toReadonlyArray:UK,traverse_:Uce},Symbol.toStringTag,{value:"Module"}));function BK(e,t){return function(n,r){return function(i){return e.reduceWithIndex(i,n,function(o,a,s){return t.reduceWithIndex(s,a,function(u,l,c){return r([o,u],l,c)})})}}}function PK(e,t){return function(n){var r=e.foldMapWithIndex(n),i=t.foldMapWithIndex(n);return function(o){return function(a){return r(a,function(s,u){return i(u,function(l,c){return o([s,l],c)})})}}}}function WK(e,t){return function(n,r){return function(i){return e.reduceRightWithIndex(i,n,function(o,a,s){return t.reduceRightWithIndex(a,s,function(u,l,c){return r([o,u],l,c)})})}}}function Nce(e,t){var n=XI(e,t),r=BK(e,t),i=PK(e,t),o=WK(e,t);return{reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:function(a,s,u){return x(a,r(s,u))},foldMapWithIndex:function(a){var s=i(a);return function(u,l){return x(u,s(l))}},reduceRightWithIndex:function(a,s,u){return x(a,o(s,u))}}}const Kce=Object.freeze(Object.defineProperty({__proto__:null,foldMapWithIndex:PK,getFoldableWithIndexComposition:Nce,reduceRightWithIndex:WK,reduceWithIndex:BK},Symbol.toStringTag,{value:"Module"}));function zo(e){return function(t){return X(t,e.fromIO)}}function Ba(e,t){return function(n){var r=X(n,e.fromIO);return function(i){return t.chain(i,r)}}}function Pa(e,t){var n=vt(t);return function(r){return n(X(r,e.fromIO))}}const qce=Object.freeze(Object.defineProperty({__proto__:null,chainFirstIOK:Pa,chainIOK:Ba,fromIOK:zo},Symbol.toStringTag,{value:"Module"}));var NK=function(){return Q},Vce=Q,FA=function(e){return function(t){return function(n){return t(e(n))}}},jA=function(e){return function(t){return e(t)(t)}},zce=jA,Wa=function(e,t){return x(e,Yl(t))},LA=function(e,t){return x(e,VK(t))},eE=function(e,t){return x(e,zK(t))},KK=function(e,t){return x(e,HK(t))},R0=function(e,t,n){return x(e,YK(t,n))},Yl=function(e){return function(t){return function(n){return e(t(n))}}},qK=function(e){return function(t){return function(n){return t(n)(e(n))}}},VK=qK,Qo=Lr,tE=function(e){return function(t){return function(n){return e(t(n))(n)}}},zK=tE,QK=tE(Q),Qce=QK,HK=function(e){return function(t){return X(e,t)}},YK=function(e,t){return function(n){return function(r){return t(n(e(r)))}}},nE=function(){return Q},rE=function(e){return function(t){var n=t[0],r=t[1];return[e(n),r]}},iE=function(e){return function(t){var n=t[0],r=t[1];return[n,e(r)]}},oE=function(e){return YI(function(t){return Ca(e(t))},Je)},aE=function(e){return YI(Lt,function(t){return Ys(e(t))})},Fi="Reader",kn={URI:Fi,map:Wa},Hce=He(kn),sE={URI:Fi,of:Qo},Na={URI:Fi,map:Wa,ap:LA},GK=Kt(Na),Yce=GK,JK=qt(Na),Gce=JK,ZK={URI:Fi,map:Wa,ap:LA,of:Qo},uE={URI:Fi,map:Wa,ap:LA,chain:eE},Ka={URI:Fi,map:Wa,of:Qo,ap:LA,chain:eE},XK=vt(uE),Jce=XK,Zce={URI:Fi,map:Wa,promap:R0},Xce={URI:Fi,compose:KK,id:nE},ede={URI:Fi,map:Wa,promap:R0,first:rE,second:iE},tde={URI:Fi,map:Wa,promap:R0,left:oE,right:aE},nde=zt(kn),e3=Qt(uE),rde=e3,ide=Qo(gn),t3=Vt(Na),ode=t3,n3=Qo(jn),Gl=function(e){return function(t){return function(n){for(var r=[e(0,ci(t))(n)],i=1;i<t.length;i++)r.push(e(i,t[i])(n));return r}}},lE=function(e){var t=Gl(e);return function(n){return _t(n)?t(n):n3}},ade=lE,r3=function(e){return lE(function(t,n){return e(n)})},sde=r3(Q),ude={URI:Fi,map:Wa,of:Qo,ap:LA,chain:eE,promap:R0,compose:KK,id:nE,first:rE,second:iE,left:oE,right:aE},lde=vn(Na),cde=$i(ZK);const dde=Object.freeze(Object.defineProperty({__proto__:null,ApT:n3,Applicative:ZK,Apply:Na,Category:Xce,Chain:uE,Choice:tde,Do:ide,Functor:kn,Monad:Ka,Pointed:sE,Profunctor:Zce,Strong:ede,URI:Fi,ap:VK,apFirst:GK,apFirstW:Yce,apS:t3,apSW:ode,apSecond:JK,apSecondW:Gce,apW:qK,ask:NK,asks:Vce,asksReader:zce,asksReaderW:jA,bind:e3,bindTo:nde,bindW:rde,chain:zK,chainFirst:XK,chainFirstW:Jce,chainW:tE,compose:HK,first:rE,flap:Hce,flatten:Qce,flattenW:QK,getMonoid:cde,getSemigroup:lde,id:nE,left:oE,local:FA,map:Yl,of:Qo,promap:YK,reader:ude,right:aE,second:iE,sequenceArray:sde,traverseArray:r3,traverseArrayWithIndex:ade,traverseReadonlyArrayWithIndex:lE,traverseReadonlyNonEmptyArrayWithIndex:Gl},Symbol.toStringTag,{value:"Module"}));function DA(e){return function(){return e.fromReader(NK())}}function UA(e){return e.fromReader}function Jl(e){return function(t){return X(t,e.fromReader)}}function BA(e,t){var n=Jl(e);return function(r){return function(i){return t.chain(i,n(r))}}}function PA(e,t){return X(Jl(e),vt(t))}const fde=Object.freeze(Object.defineProperty({__proto__:null,ask:DA,asks:UA,chainFirstReaderK:PA,chainReaderK:BA,fromReaderK:Jl},Symbol.toStringTag,{value:"Module"}));var i3=function(){return function(e){return[e,e]}},o3=function(e){return function(){return[void 0,e]}},a3=function(e){return function(t){return[void 0,e(t)]}},s3=function(e){return function(t){return[e(t),t]}},WA=function(e,t){return x(e,l3(t))},$0=function(e,t){return x(e,c3(t))},u3=function(e,t){return x(e,cE(t))},l3=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return[e(i),o]}}},c3=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1],a=e(o),s=a[0],u=a[1];return[i(s),u]}}},NA=function(e){return function(t){return[e,t]}},cE=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return e(i)(o)}}},pde=cE(Q),lu="State",dE={URI:lu,map:WA},hde=He(dE),Ade={URI:lu,of:NA},k0={URI:lu,map:WA,ap:$0},mde=Kt(k0),gde=qt(k0),vde={URI:lu,map:WA,ap:$0,of:NA},fE={URI:lu,map:WA,ap:$0,chain:u3},d3={URI:lu,map:WA,ap:$0,of:NA,chain:u3},yde=vt(fE),bde={URI:lu,fromState:Q},Cde=function(e){return function(t){return t(e)[0]}},Sde=function(e){return function(t){return t(e)[1]}},wde=zt(dE),_de=Qt(fE),xde=Vt(k0),f3=function(e){return function(t){return function(n){for(var r=e(0,ci(t))(n),i=r[0],o=r[1],a=[i],s=o,u=1;u<t.length;u++){var l=e(u,t[u])(s),c=l[0],f=l[1];a.push(c),s=f}return[a,s]}}},pE=function(e){var t=f3(e);return function(n){return _t(n)?t(n):NA(jn)}},Tde=pE,p3=function(e){return pE(function(t,n){return e(n)})},Ide=p3(Q),Ede=function(e,t){return e(t)[0]},Rde=function(e,t){return e(t)[1]},$de=d3;const kde=Object.freeze(Object.defineProperty({__proto__:null,Applicative:vde,Apply:k0,Chain:fE,FromState:bde,Functor:dE,Monad:d3,Pointed:Ade,URI:lu,ap:c3,apFirst:mde,apS:xde,apSecond:gde,bind:_de,bindTo:wde,chain:cE,chainFirst:yde,evalState:Ede,evaluate:Cde,execState:Rde,execute:Sde,flap:hde,flatten:pde,get:i3,gets:s3,map:l3,modify:a3,of:NA,put:o3,sequenceArray:Ide,state:$de,traverseArray:p3,traverseArrayWithIndex:Tde,traverseReadonlyArrayWithIndex:pE,traverseReadonlyNonEmptyArrayWithIndex:f3},Symbol.toStringTag,{value:"Module"}));function h3(e){return function(){return e.fromState(i3())}}function A3(e){return function(t){return e.fromState(o3(t))}}function m3(e){return X(a3,e.fromState)}function g3(e){return X(s3,e.fromState)}function hE(e){return function(t){return X(t,e.fromState)}}function v3(e,t){var n=hE(e);return function(r){return function(i){return t.chain(i,n(r))}}}const Ode=Object.freeze(Object.defineProperty({__proto__:null,chainStateK:v3,fromStateK:hE,get:h3,gets:g3,modify:m3,put:A3},Symbol.toStringTag,{value:"Module"}));function Zl(e){return function(t){return X(t,e.fromTask)}}function $f(e,t){return function(n){var r=X(n,e.fromTask);return function(i){return t.chain(i,r)}}}function kf(e,t){var n=vt(t);return function(r){return n(X(r,e.fromTask))}}const Mde=Object.freeze(Object.defineProperty({__proto__:null,chainFirstTaskK:kf,chainTaskK:$f,fromTaskK:Zl},Symbol.toStringTag,{value:"Module"}));function y3(e){return function(t){return X(t,e.fromThese)}}const Fde=Object.freeze(Object.defineProperty({__proto__:null,fromTheseK:y3},Symbol.toStringTag,{value:"Module"}));function b3(e,t){return function(n){return function(r){return e.mapWithIndex(r,function(i,o){return t.mapWithIndex(o,function(a,s){return n([i,a],s)})})}}}function jde(e,t){var n=qd(e,t).map,r=b3(e,t);return{map:n,mapWithIndex:function(i,o){return x(i,r(o))}}}const Lde=Object.freeze(Object.defineProperty({__proto__:null,getFunctorWithIndexComposition:jde,mapWithIndex:b3},Symbol.toStringTag,{value:"Module"})),Dde=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Ude=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Bde=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Ho=function(e,t){return x(e,x3(t))},Of=function(e,t){return x(e,T3(t))},O0=function(e,t){return x(e,vE(t))},AE=function(e,t,n){return x(e,I3(t,n))},mE=function(e){return function(t,n){return x(t,E3()(n))}},gE=function(e,t,n){return x(e,R3(t,n))},C3=function(e,t){return x(e,O3())},S3=function(e,t){return x(e,yE(t))},w3=function(e){var t=$3(e);return function(n,r){return x(n,t(r))}},_3=SI,x3=function(e){return function(t){return e(t)}},T3=function(e){return function(t){return t(e)}},Mf=Q,vE=function(e){return function(t){return e(t)}},yE=function(e){return function(t){return e(t)}},bE=Q,Pde=yE(Q),Wde=vE(Q),I3=function(e,t){return function(n){return t(e,n)}},E3=function(){return function(e){return function(t){return e(t)}}},R3=function(e,t){return function(n){return t(n,e)}},$3=function(e){return function(t){return function(n){return e.map(t(n),Q)}}},CE=function(e){return function(t){return e.map(t,Q)}},k3=function(){return Q},O3=k3,pi="Identity",Nde=Q,Kde=Q,SE={URI:pi,map:Ho},qde=He(SE),Vde={URI:pi,of:Mf},M0={URI:pi,map:Ho,ap:Of},zde=Kt(M0),Qde=qt(M0),Hde={URI:pi,map:Ho,ap:Of,of:Mf},wE={URI:pi,map:Ho,ap:Of,chain:O0},Yde={URI:pi,map:Ho,ap:Of,of:Mf,chain:O0},Gde=vt(wE),Jde={URI:pi,reduce:AE,foldMap:mE,reduceRight:gE},Zde={URI:pi,map:Ho,reduce:AE,foldMap:mE,reduceRight:gE,traverse:w3,sequence:CE},Xde={URI:pi,map:Ho,alt:C3},efe={URI:pi,map:Ho,extend:S3,extract:bE},tfe={URI:pi,map:Ho,ap:Of,chain:O0,chainRec:_3},nfe=Mf(gn),rfe=zt(SE),ife=Qt(wE),ofe=Vt(M0),afe={URI:pi,map:Ho,ap:Of,of:Mf,chain:O0,reduce:AE,foldMap:mE,reduceRight:gE,traverse:w3,sequence:CE,alt:C3,extract:bE,extend:S3,chainRec:_3};const sfe=Object.freeze(Object.defineProperty({__proto__:null,Alt:Xde,Applicative:Hde,Apply:M0,Chain:wE,ChainRec:tfe,Comonad:efe,Do:nfe,Foldable:Jde,Functor:SE,Monad:Yde,Pointed:Vde,Traversable:Zde,URI:pi,alt:O3,altW:k3,ap:T3,apFirst:zde,apS:ofe,apSecond:Qde,bind:ife,bindTo:rfe,chain:vE,chainFirst:Gde,duplicate:Pde,extend:yE,extract:bE,flap:qde,flatten:Wde,foldMap:E3,getEq:Kde,getShow:Nde,identity:afe,map:x3,of:Mf,reduce:I3,reduceRight:R3,sequence:CE,traverse:$3},Symbol.toStringTag,{value:"Module"})),ufe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var qa=function(e,t){return function(){return t(e())}},cu=function(e,t){return function(){return e()(t())}},Ff=function(e,t){return function(){return t(e())()}},M3=function(e,t){return function(){for(var n=t(e)();n._tag==="Left";)n=t(n.left)();return n.right}},Yo=function(e){return function(t){return qa(t,e)}},lfe=function(e){return function(t){return cu(t,e)}},io=Lr,_E=function(e){return function(t){return Ff(t,e)}},cfe=_E(Q),oo="IO",ht={URI:oo,map:qa},dfe=He(ht),Go={URI:oo,of:io},Va={URI:oo,map:qa,ap:cu},ffe=Kt(Va),pfe=qt(Va),F3={URI:oo,map:qa,ap:cu,of:io},F0={URI:oo,map:qa,ap:cu,chain:Ff},Ur={URI:oo,map:qa,ap:cu,of:io,chain:Ff},hfe=vt(F0),xE=Q,Afe={URI:oo,map:qa,ap:cu,of:io,chain:Ff,fromIO:xE},mfe={URI:oo,map:qa,ap:cu,chain:Ff,chainRec:M3},gfe={URI:oo,fromIO:Q},vfe=io(gn),yfe=zt(ht),bfe=Qt(F0),Cfe=Vt(Va),j3=io(jn),j0=function(e){return function(t){return function(){for(var n=[e(0,ci(t))()],r=1;r<t.length;r++)n.push(e(r,t[r])());return n}}},TE=function(e){var t=j0(e);return function(n){return _t(n)?t(n):j3}},Sfe=TE,L3=function(e){return TE(function(t,n){return e(n)})},wfe=L3(Q),_fe={URI:oo,map:qa,of:io,ap:cu,chain:Ff,fromIO:xE,chainRec:M3},xfe=vn(Va),Tfe=$i(F3);const Ife=Object.freeze(Object.defineProperty({__proto__:null,ApT:j3,Applicative:F3,Apply:Va,Chain:F0,ChainRec:mfe,Do:vfe,FromIO:gfe,Functor:ht,Monad:Ur,MonadIO:Afe,Pointed:Go,URI:oo,ap:lfe,apFirst:ffe,apS:Cfe,apSecond:pfe,bind:bfe,bindTo:yfe,chain:_E,chainFirst:hfe,flap:dfe,flatten:cfe,fromIO:xE,getMonoid:Tfe,getSemigroup:xfe,io:_fe,map:Yo,of:io,sequenceArray:wfe,traverseArray:L3,traverseArrayWithIndex:Sfe,traverseReadonlyArrayWithIndex:TE,traverseReadonlyNonEmptyArrayWithIndex:j0},Symbol.toStringTag,{value:"Module"}));var D3=yf(Go),U3=zl(Go),B3=bf(ht),Efe=Cf(ht),P3=io,KA=B3,W3=$A(ht),Rfe=W3,IE=If(Ur),$fe=IE,N3=IE,kfe=N3,K3=Ef(Ur),Ofe=K3,q3=function(e,t){return function(){return Vl(e,t)}},Mfe=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return q3(function(){return e.apply(void 0,n)},t)}},Ffe=MA(ht),V3=Hl(Ur),jfe=V3,EE=kA(Ur),Lfe=EE,Dfe=function(e){return EE(n5(e))},Ufe=OA(Ur),Bfe=Rf(ht),Br=function(e,t){return x(e,kE(t))},Xl=function(e,t){return x(e,OE(t))},Pfe=function(e,t){return x(e,L0(function(n){return x(t,kE(n))}))},jf=function(e,t){return x(e,L0(t))},RE=function(e,t,n){return x(e,Q3(t,n))},$E=function(e,t){return x(e,H3(t))},z3=function(e,t){return x(e,ME(t))},kE=Sf(ht),Q3=xf(ht),H3=Tf(ht),OE=wf(Va),Wfe=OE,ji=U3,L0=Ql(Ur),cv=L0,Y3=cv(Q),Nfe=Y3,ME=_f(Ur),Kfe=ME,D0=D3,nn="IOEither";function G3(e){var t=Ra(Va,iu(e));return{URI:nn,_E:void 0,map:Br,ap:function(n,r){return x(n,t(r))},of:ji}}function J3(e){var t=RA(Ur,e);return{URI:nn,_E:void 0,map:Br,alt:function(n,r){return x(n,t(r))}}}var Z3=function(e){var t=Kl(e);return{URI:nn,_E:void 0,compact:qo(ht,t),separate:La(ht,t,ou)}};function qfe(e){var t=mf(e),n=Z3(e),r=Da(ht,t),i=Ua(ht,t),o=su(ht,t),a=uu(ht,t);return{URI:nn,_E:void 0,map:Br,compact:n.compact,separate:n.separate,filter:function(s,u){return x(s,r(u))},filterMap:function(s,u){return x(s,i(u))},partition:function(s,u){return x(s,o(u))},partitionMap:function(s,u){return x(s,a(u))}}}var FE={URI:nn,map:Br},Vfe=He(FE),zfe={URI:nn,of:ji},Qfe={URI:nn,bimap:RE,mapLeft:$E},qA={URI:nn,map:Br,ap:Xl},X3=Kt(qA),Hfe=X3,e5=qt(qA),Yfe=e5,jE={URI:nn,map:Br,ap:Xl,of:ji},Gfe={URI:nn,map:Br,ap:Pfe,of:ji},za={URI:nn,map:Br,ap:Xl,chain:jf},Jfe={URI:nn,map:Br,ap:Xl,of:ji,chain:jf},t5=vt(za),Zfe=t5,Xfe={URI:nn,map:Br,alt:z3},epe={URI:nn,map:Br,ap:Xl,of:ji,chain:jf,fromIO:KA},tpe={URI:nn,map:Br,ap:Xl,of:ji,chain:jf,throwError:D0},U0={URI:nn,fromIO:KA},n5=zo(U0),npe=Ba(U0,za),rpe=Pa(U0,za),Qa={URI:nn,fromEither:P3},ipe=Po(Qa),ope=Wo(Qa),ape=Ol(Qa,za),r5=$a(Qa,za),spe=r5,i5=ka(Qa,za),upe=i5,lpe=Gs(Qa),o5=Ml(Qa,za),cpe=o5,dpe=di(Qa),fpe=function(e,t,n){return a5(e,t,n)},a5=function(e,t,n){return x(e,cv(function(r){return x(t(r),_E(function(i){return x(n(r,i),cv(function(){return io(i)}))}))}))},ppe=ji(gn),hpe=zt(FE),s5=Qt(za),Ape=s5,u5=Vt(qA),mpe=u5,LE=ji(jn),l5=function(e){return X(j0(e),Yo(EA(Dr)))},DE=function(e){var t=l5(e);return function(n){return _t(n)?t(n):LE}},c5=function(e){return function(t){return function(){var n=e(0,ci(t))();if(An(n))return n;for(var r=[n.right],i=1;i<t.length;i++){var o=e(i,t[i])();if(An(o))return o;r.push(o.right)}return Ys(r)}}},UE=function(e){var t=c5(e);return function(n){return _t(n)?t(n):LE}},gpe=DE,d5=function(e){return DE(function(t,n){return e(n)})},vpe=d5(Q),ype=UE,f5=function(e){return UE(function(t,n){return e(n)})},bpe=f5(Q),Cpe=jE,Spe={URI:nn,bimap:RE,mapLeft:$E,map:Br,of:ji,ap:Xl,chain:jf,alt:z3,fromIO:KA,throwError:D0},wpe=vn(qA),_pe=$i(jE),xpe=function(e){return vn(Va)(_A(e))};function Tpe(e){var t=G3(e),n=J3(e);return{URI:nn,_E:void 0,map:Br,ap:t.ap,of:ji,chain:jf,bimap:RE,mapLeft:$E,alt:n.alt,fromIO:KA,throwError:D0}}const Ipe=Object.freeze(Object.defineProperty({__proto__:null,Alt:Xfe,ApT:LE,Applicative:Cpe,ApplicativePar:jE,ApplicativeSeq:Gfe,ApplyPar:qA,Bifunctor:Qfe,Chain:za,Do:ppe,FromEither:Qa,FromIO:U0,Functor:FE,Monad:Jfe,MonadIO:epe,MonadThrow:tpe,Pointed:zfe,URI:nn,alt:ME,altW:Kfe,ap:OE,apFirst:X3,apFirstW:Hfe,apS:u5,apSW:mpe,apSecond:e5,apSecondW:Yfe,apW:Wfe,bimap:Q3,bind:s5,bindTo:hpe,bindW:Ape,bracket:fpe,bracketW:a5,chain:L0,chainEitherK:r5,chainEitherKW:spe,chainFirst:t5,chainFirstEitherK:i5,chainFirstEitherKW:upe,chainFirstIOK:rpe,chainFirstW:Zfe,chainIOK:npe,chainOptionK:ape,chainW:cv,filterOrElse:o5,filterOrElseW:cpe,flap:Vfe,flatten:Nfe,flattenW:Y3,fold:$fe,foldW:kfe,fromEither:P3,fromEitherK:dpe,fromIO:KA,fromIOK:n5,fromOption:ipe,fromOptionK:ope,fromPredicate:lpe,getAltIOValidation:J3,getApplicativeIOValidation:G3,getApplyMonoid:_pe,getApplySemigroup:wpe,getCompactable:Z3,getFilterable:qfe,getIOValidation:Tpe,getOrElse:K3,getOrElseW:Ofe,getSemigroup:xpe,ioEither:Spe,left:D3,leftIO:Efe,map:kE,mapLeft:H3,match:W3,matchE:IE,matchEW:N3,matchW:Rfe,of:ji,orElse:V3,orElseFirst:EE,orElseFirstIOK:Dfe,orElseFirstW:Lfe,orElseW:jfe,orLeft:Ufe,right:U3,rightIO:B3,sequenceArray:vpe,sequenceSeqArray:bpe,swap:Bfe,throwError:D0,toUnion:Ffe,traverseArray:d5,traverseArrayWithIndex:gpe,traverseReadonlyArrayWithIndex:DE,traverseReadonlyArrayWithIndexSeq:UE,traverseReadonlyNonEmptyArrayWithIndex:l5,traverseReadonlyNonEmptyArrayWithIndexSeq:c5,traverseSeqArray:f5,traverseSeqArrayWithIndex:ype,tryCatch:q3,tryCatchK:Mfe},Symbol.toStringTag,{value:"Module"}));function VA(e){return X(kt,e.of)}function zA(e){return Lr(e.of(dt))}function B0(e){return function(t){return e.map(t,kt)}}function P0(e){return X(Pl,e.of)}function W0(e){var t=P0(e);return function(n){return X(n,t)}}function BE(e){var t=Lf(e),n=W0(e);return function(r){return t(n(r))}}function N0(e){return function(t){return X(t,e.of)}}function PE(e){var t=Lf(e),n=N0(e);return function(r){return t(n(r))}}function WE(e){return function(t){return function(n){return e.of(A0(t)(n))}}}function NE(e){return X(pf,e.of)}function KE(e){return function(t,n){return function(r){return e.map(r,ja(t,n))}}}function K0(e){return function(t,n){return function(r){return e.chain(r,ja(t,n))}}}function q0(e){return function(t){return function(n){return e.chain(n,ja(t,e.of))}}}function V0(e){return Kd(e,lf)}function z0(e){return Ra(e,cf)}function Lf(e){var t=zA(e);return function(n){return function(r){return e.chain(r,ja(function(){return t()},n))}}}function Q0(e){var t=VA(e);return function(n){return function(r){return e.chain(r,ja(n,t))}}}function Epe(e){var t=z0(e),n=V0(e),r=Lf(e),i=Q0(e),o=K0(e),a=q0(e),s=zA(e);return{map:function(u,l){return x(u,n(l))},ap:function(u,l){return x(u,t(l))},of:VA(e),chain:function(u,l){return x(u,r(l))},alt:function(u,l){return x(u,i(l))},fold:function(u,l,c){return x(u,o(l,c))},getOrElse:function(u,l){return x(u,a(l))},fromM:B0(e),none:function(){return s()}}}const Rpe=Object.freeze(Object.defineProperty({__proto__:null,alt:Q0,ap:z0,chain:Lf,chainNullableK:BE,chainOptionK:PE,fromEither:NE,fromF:B0,fromNullable:P0,fromNullableK:W0,fromOptionK:N0,fromPredicate:WE,getOptionM:Epe,getOrElse:q0,map:V0,match:KE,matchE:K0,some:VA,zero:zA},Symbol.toStringTag,{value:"Module"}));var p5=VA(Go),$pe=WE(Go),kpe=io,h5=NE(Go),qE=B0(ht),Ope=Yo(pf),A5=KE(ht),Mpe=A5,VE=K0(F0),Fpe=VE,jpe=VE,m5=q0(Ur),Lpe=m5,Dpe=Yo(PN),Upe=Yo(DI),Bpe=P0(Go),Ppe=W0(Go),Wpe=BE(Ur),Npe=N0(Go),Kpe=PE(Ur),g5=V0(ht),v5=z0(Va),du=p5,zE=Lf(Ur),qpe=zE(Q),QE=Q0(Ur),Vpe=QE,H0=zA(Go),zpe=H0(),HE=qo(ht,Bl),YE=La(ht,Bl,lf),y5=Da(ht,Fa),b5=Ua(ht,Fa),C5=su(ht,Fa),S5=uu(ht,Fa),Ha=function(e,t){return x(e,g5(t))},Df=function(e,t){return x(e,v5(t))},GE=function(e,t){return x(e,zE(t))},w5=function(e,t){return x(e,QE(t))},Qpe=function(e,t){return x(e,y5(t))},Hpe=function(e,t){return x(e,b5(t))},Ype=function(e,t){return x(e,C5(t))},Gpe=function(e,t){return x(e,S5(t))},Pr="IOOption",JE={URI:Pr,map:Ha},Jpe=He(JE),_5={URI:Pr,of:du},Y0={URI:Pr,map:Ha,ap:Df},Zpe=Kt(Y0),Xpe=qt(Y0),ehe={URI:Pr,map:Ha,ap:Df,of:du},ec={URI:Pr,map:Ha,ap:Df,chain:GE},the=vt(ec),nhe={URI:Pr,map:Ha,alt:w5},x5={URI:Pr,zero:H0},rhe=Gd(x5,_5),ihe={URI:Pr,map:Ha,ap:Df,of:du,alt:w5,zero:H0},ohe={URI:Pr,map:Ha,ap:Df,of:du,chain:GE},ahe={URI:Pr,map:Ha,ap:Df,of:du,chain:GE,fromIO:qE},she={URI:Pr,compact:HE,separate:YE},uhe={URI:Pr,map:Ha,compact:HE,separate:YE,filter:Qpe,filterMap:Hpe,partition:Ype,partitionMap:Gpe},G0={URI:Pr,fromIO:qE},lhe=zo(G0),che=Ba(G0,ec),dhe=Pa(G0,ec),J0={URI:Pr,fromEither:h5},fhe=di(J0),phe=$a(J0,ec),hhe=ka(J0,ec),Ahe=du(gn),mhe=zt(JE),ghe=Qt(ec),vhe=Vt(Y0),T5=du(jn),I5=function(e){return X(j0(e),Yo(_0(Dr)))},yhe=function(e){var t=I5(e);return function(n){return _t(n)?t(n):T5}};const bhe=Object.freeze(Object.defineProperty({__proto__:null,Alt:nhe,Alternative:ihe,ApT:T5,Applicative:ehe,Apply:Y0,Chain:ec,Compactable:she,Do:Ahe,Filterable:uhe,FromEither:J0,FromIO:G0,Functor:JE,Monad:ohe,MonadIO:ahe,Pointed:_5,Zero:x5,alt:QE,altW:Vpe,ap:v5,apFirst:Zpe,apS:vhe,apSecond:Xpe,bind:ghe,bindTo:mhe,chain:zE,chainEitherK:phe,chainFirst:the,chainFirstEitherK:hhe,chainFirstIOK:dhe,chainIOK:che,chainNullableK:Wpe,chainOptionK:Kpe,compact:HE,filter:y5,filterMap:b5,flap:Jpe,flatten:qpe,fold:Fpe,fromEither:h5,fromEitherK:fhe,fromIO:qE,fromIOEither:Ope,fromIOK:lhe,fromNullable:Bpe,fromNullableK:Ppe,fromOption:kpe,fromOptionK:Npe,fromPredicate:$pe,getOrElse:m5,getOrElseW:Lpe,guard:rhe,map:g5,match:A5,matchE:VE,matchEW:jpe,matchW:Mpe,none:zpe,of:du,partition:C5,partitionMap:S5,separate:YE,some:p5,toNullable:Upe,toUndefined:Dpe,traverseReadonlyArrayWithIndex:yhe,traverseReadonlyNonEmptyArrayWithIndex:I5,zero:H0},Symbol.toStringTag,{value:"Module"}));var E5=function(){function e(t){var n=this;this.value=t,this.read=function(){return n.value},this.write=this.write.bind(this),this.modify=this.modify.bind(this)}return e.prototype.write=function(t){var n=this;return function(){n.value=t}},e.prototype.modify=function(t){var n=this;return function(){n.value=t(n.value)}},e}();function Che(e){return function(){return new E5(e)}}const She=Object.freeze(Object.defineProperty({__proto__:null,IORef:E5,newIORef:Che},Symbol.toStringTag,{value:"Module"})),whe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var _he=function(e){return Vl(function(){return JSON.parse(e)},Q)},xhe=function(e){return Vl(function(){var t=JSON.stringify(e);if(typeof t!="string")throw new Error("Converting unsupported structure to JSON");return t},Q)};const The=Object.freeze(Object.defineProperty({__proto__:null,parse:_he,stringify:xhe},Symbol.toStringTag,{value:"Module"})),Ihe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Ehe=function(e){return new Map(e)};function Rhe(e){return new Map(e)}function R5(e,t){return{show:function(n){var r=[];return n.forEach(function(i,o){r.push("[".concat(e.show(o),", ").concat(t.show(i),"]"))}),"new Map([".concat(r.sort().join(", "),"])")}}}var $5=function(e){return e.size},Mo=function(e){return e.size===0};function Z0(e){var t=tc(e);return function(n,r){if(r===void 0){var i=Z0(e);return function(o){return i(n,o)}}return $t(t(n,r))}}function ZE(e){return function(t,n){if(n===void 0){var r=ZE(e);return function(s){return r(t,s)}}for(var i=n.values(),o;!(o=i.next()).done;){var a=o.value;if(e.equals(t,a))return!0}return!1}}var Uf=function(e){return function(t){return Array.from(t.keys()).sort(e.compare)}},$he=function(e){return function(t){return Array.from(t.values()).sort(e.compare)}};function k5(e){var t=Uf(e);return function(n){return function(r){for(var i=[],o=t(r),a=0,s=o;a<s.length;a++){var u=s[a];i.push(n(u,r.get(u)))}return i}}}var O5=function(e){return k5(e)(function(t,n){return[t,n]})};function khe(e,t){var n=O5(e);return function(r){var i=n(r),o=i.length;return t.unfold(0,function(a){return a<o?ye([i[a],a+1]):Re})}}var M5=function(e){var t=Ya(e);return function(n,r){var i=t(n);return function(o){var a=i(o);if(en(a)){var s=new Map(o);return s.set(n,r),s}else if(a.value[1]!==r){var s=new Map(o);return s.set(a.value[0],r),s}return o}}},F5=function(e){var t=Ya(e);return function(n){return function(r){var i=t(n,r);if($t(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},Ohe=function(e){var t=j5(e);return function(n,r){return t(n,function(){return r})}},j5=function(e){var t=Ya(e);return function(n,r){return function(i){var o=t(n,i);if(en(o))return Re;var a=o.value,s=a[0],u=a[1],l=r(u);if(l===u)return ye(i);var c=new Map(i);return c.set(s,l),ye(c)}}};function Mhe(e){var t=tc(e),n=F5(e);return function(r){var i=n(r);return function(o){return x(t(r,o),Ko(function(a){return[a,i(o)]}))}}}function Ya(e){return function(t,n){if(n===void 0){var r=Ya(e);return function(l){return r(t,l)}}for(var i=n.entries(),o;!(o=i.next()).done;){var a=o.value,s=a[0],u=a[1];if(e.equals(s,t))return ye([s,u])}return Re}}function tc(e){var t=Ya(e);return function(n,r){if(r===void 0){var i=tc(e);return function(o){return i(n,o)}}return x(t(n,r),Ko(function(o){o[0];var a=o[1];return a}))}}function X0(e,t){var n=Ya(e);return function(r,i){if(i===void 0){var o=X0(e,t);return function(p){return o(p,r)}}for(var a=r.entries(),s;!(s=a.next()).done;){var u=s.value,l=u[0],c=u[1],f=n(l,i);if(en(f)||!e.equals(l,f.value[0])||!t.equals(c,f.value[1]))return!1}return!0}}var eb=new Map;function L5(e,t){var n=X0(e,t);return ki(function(r,i){return n(r,i)&&n(i,r)})}function Fhe(e,t){var n=Ya(e);return{concat:function(r,i){if(Mo(r))return i;if(Mo(i))return r;for(var o=new Map(r),a=i.entries(),s;!(s=a.next()).done;){var u=s.value,l=u[0],c=u[1],f=n(l,r);$t(f)?o.set(f.value[0],t.concat(f.value[1],c)):o.set(l,c)}return o},empty:eb}}var jhe=function(e,t){return new Map([[e,t]])};function Lhe(e,t,n){return function(r){var i=Ya(e);return n.reduce(r,new Map,function(o,a){var s=a[0],u=a[1],l=i(s,o);return $t(l)?o.set(l.value[0],t.concat(l.value[1],u)):o.set(s,u),o})}}var Bf=function(e,t){for(var n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],s=o[1];n.set(a,t(a,s))}return n},D5=function(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,s=a[0],u=a[1],l=e(s,u);An(l)?n.set(s,l.left):r.set(s,l.right)}return Be(n,r)}};function U5(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,s=a[0],u=a[1];e(s,u)?r.set(s,u):n.set(s,u)}return Be(n,r)}}var B5=function(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],s=o[1],u=e(a,s);$t(u)&&n.set(a,u.value)}return n}};function P5(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],s=o[1];e(a,s)&&n.set(a,s)}return n}}var Ga=function(e,t){return Bf(e,function(n,r){return t(r)})},QA=function(e,t){return W5(e,function(n,r){return t(r)})},HA=function(e,t){return N5(e,function(n,r){return t(r)})},YA=function(e,t){return K5(e,function(n,r){return t(r)})},GA=function(e,t){return q5(e,function(n,r){return t(r)})},W5=function(e,t){return x(e,P5(t))},N5=function(e,t){return x(e,B5(t))},K5=function(e,t){return x(e,U5(t))},q5=function(e,t){return x(e,D5(t))},Pf=function(e){for(var t=new Map,n=e.entries(),r;!(r=n.next()).done;){var i=r.value,o=i[0],a=i[1];$t(a)&&t.set(o,a.value)}return t},Dhe=function(e){return function(t){return QA(t,e)}},Uhe=function(e){return function(t){return HA(t,e)}},Bhe=function(e){return function(t){return Ga(t,e)}},Phe=function(e){return function(t){return Bf(t,e)}},Whe=function(e){return function(t){return YA(t,e)}},Nhe=function(e){return function(t){return GA(t,e)}},Wf=function(e){for(var t=new Map,n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],s=o[1];An(s)?t.set(a,s.left):n.set(a,s.right)}return Be(t,n)},Li="ReadonlyMap",V5=function(e,t){var n=iR(e,t);return{concat:function(r,i){return n(i)(r)}}},Khe=function(e,t){return{concat:V5(e,t).concat,empty:eb}},qhe=function(e,t){var n=oR(e,t);return{concat:function(r,i){return n(i)(r)}}},Vhe=function(e){return function(){var t=aR(e);return{concat:function(n,r){return t(r)(n)}}}};function zhe(){return{URI:Li,_E:void 0,map:Ga,mapWithIndex:Bf,compact:Pf,separate:Wf,filter:QA,filterMap:HA,partition:YA,partitionMap:GA,partitionMapWithIndex:q5,partitionWithIndex:K5,filterMapWithIndex:N5,filterWithIndex:W5}}var z5={URI:Li,map:Ga},Qhe=He(z5),Hhe=function(){return{URI:Li,_E:void 0,map:Ga,mapWithIndex:Bf}},Rw={URI:Li,compact:Pf,separate:Wf},Yhe={URI:Li,map:Ga,compact:Pf,separate:Wf,filter:QA,filterMap:HA,partition:YA,partitionMap:GA},XE=function(e){var t=nb(e);return function(n,r){return t(n,function(i,o,a){return r(o,a)})}},eR=function(e){var t=rb(e);return function(n){var r=t(n);return function(i){return r(function(o,a){return i(a)})}}},tR=function(e){var t=ib(e);return function(n,r){return t(n,function(i,o,a){return r(o,a)})}},tb=function(e){var t=XE(e),n=eR(e),r=tR(e);return{URI:Li,_E:void 0,reduce:function(i,o,a){return x(i,t(o,a))},foldMap:function(i){var o=n(i);return function(a,s){return x(a,o(s))}},reduceRight:function(i,o,a){return x(i,r(o,a))}}},nb=function(e){var t=Uf(e);return function(n,r){return function(i){for(var o=n,a=0,s=t(i);a<s.length;a++){var u=s[a];o=r(u,o,i.get(u))}return o}}},rb=function(e){var t=Uf(e);return function(n){return function(r){return function(i){for(var o=n.empty,a=0,s=t(i);a<s.length;a++){var u=s[a];o=n.concat(o,r(u,i.get(u)))}return o}}}},ib=function(e){var t=Uf(e);return function(n,r){return function(i){for(var o=n,a=t(i),s=a.length,u=s-1;u>=0;u--){var l=a[u];o=r(l,i.get(l),o)}return o}}},nR=function(e){var t=tb(e),n=nb(e),r=rb(e),i=ib(e);return{URI:Li,_E:void 0,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:function(o,a,s){return x(o,n(a,s))},foldMapWithIndex:function(o){var a=r(o);return function(s,u){return x(s,a(u))}},reduceRightWithIndex:function(o,a,s){return x(o,i(a,s))}}},Ghe=function(e){var t=rR(e),n=tb(e);return{URI:Li,_E:void 0,map:Ga,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:t.traverse,sequence:t.sequence}},rR=function(e){var t=nR(e),n=Uf(e),r=function(a){return function(s,u){for(var l=a.of(new Map),c=n(s),f=c.length,p=function(A){var g=c[A],y=s.get(g);l=a.ap(a.map(l,function(C){return function(_){return C.set(g,_)}}),u(g,y))},h=0;h<f;h++)p(h);return l}},i=function(a){var s=r(a);return function(u,l){return s(u,function(c,f){return l(f)})}},o=function(a){var s=r(a);return function(u){return s(u,Dr)}};return{URI:Li,_E:void 0,map:Ga,mapWithIndex:Bf,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverse:i,sequence:o,traverseWithIndex:r}};function Jhe(e){var t=rR(e);return{URI:Li,_E:void 0,map:Ga,compact:Pf,separate:Wf,filter:QA,filterMap:HA,partition:YA,partitionMap:GA,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,traverse:t.traverse,sequence:t.sequence,mapWithIndex:Bf,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverseWithIndex:t.traverseWithIndex,wilt:no(t,Rw),wither:ro(t,Rw)}}var iR=function(e,t){var n=tc(e);return function(r){return function(i){if(Mo(i))return r;if(Mo(r))return i;for(var o=new Map,a=i.entries(),s;!(s=a.next()).done;){var u=s.value,l=u[0],c=u[1],f=n(l)(r);$t(f)?o.set(l,t.concat(c,f.value)):o.set(l,c)}for(var p=r.entries();!(s=p.next()).done;){var h=s.value,l=h[0],c=h[1],f=n(l)(o);en(f)&&o.set(l,c)}return o}}},oR=function(e,t){var n=tc(e);return function(r){return function(i){if(Mo(i)||Mo(r))return eb;for(var o=new Map,a=i.entries(),s;!(s=a.next()).done;){var u=s.value,l=u[0],c=u[1],f=n(l)(r);$t(f)&&o.set(l,t.concat(c,f.value))}return o}}},aR=function(e){var t=Z0(e);return function(n){return function(r){if(Mo(r))return n;if(Mo(n))return r;for(var i=new Map,o=r.entries(),a;!(a=o.next()).done;){var s=a.value,u=s[0],l=s[1];t(u)(n)||i.set(u,l)}for(var c=n.entries();!(a=c.next()).done;){var f=a.value,u=f[0],l=f[1];t(u)(r)||i.set(u,l)}return i}}},Zhe=M5,Xhe={URI:Li,map:Ga,compact:Pf,separate:Wf,filter:QA,filterMap:HA,partition:YA,partitionMap:GA};const eAe=Object.freeze(Object.defineProperty({__proto__:null,Compactable:Rw,Filterable:Yhe,Functor:z5,URI:Li,collect:k5,compact:Pf,deleteAt:F5,difference:aR,elem:ZE,empty:eb,filter:Dhe,filterMap:Uhe,filterMapWithIndex:B5,filterWithIndex:P5,flap:Qhe,foldMap:eR,foldMapWithIndex:rb,fromFoldable:Lhe,fromMap:Ehe,getDifferenceMagma:Vhe,getEq:L5,getFilterableWithIndex:zhe,getFoldable:tb,getFoldableWithIndex:nR,getFunctorWithIndex:Hhe,getIntersectionSemigroup:qhe,getMonoid:Fhe,getShow:R5,getTraversable:Ghe,getTraversableWithIndex:rR,getUnionMonoid:Khe,getUnionSemigroup:V5,getWitherable:Jhe,insertAt:Zhe,intersection:oR,isEmpty:Mo,isSubmap:X0,keys:Uf,lookup:tc,lookupWithKey:Ya,map:Bhe,mapWithIndex:Phe,member:Z0,modifyAt:j5,partition:Whe,partitionMap:Nhe,partitionMapWithIndex:D5,partitionWithIndex:U5,pop:Mhe,readonlyMap:Xhe,reduce:XE,reduceRight:tR,reduceRightWithIndex:ib,reduceWithIndex:nb,separate:Wf,singleton:jhe,size:$5,toMap:Rhe,toReadonlyArray:O5,toUnfoldable:khe,union:iR,updateAt:Ohe,upsertAt:M5,values:$he},Symbol.toStringTag,{value:"Module"}));var hd=function(){return hd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},hd.apply(this,arguments)},tAe=R5,nAe=$5,Sa=Mo,rAe=Z0,iAe=ZE,sR=function(e){return function(t){return Array.from(t.keys()).sort(e.compare)}},oAe=function(e){return function(t){return Array.from(t.values()).sort(e.compare)}};function Q5(e){var t=sR(e);return function(n){return function(r){for(var i=[],o=t(r),a=0,s=o;a<s.length;a++){var u=s[a];i.push(n(u,r.get(u)))}return i}}}function H5(e){return Q5(e)(function(t,n){return[t,n]})}function aAe(e,t){var n=H5(e);return function(r){var i=n(r),o=i.length;return t.unfold(0,function(a){return a<o?ye([i[a],a+1]):Re})}}var Y5=function(e){var t=nc(e);return function(n,r){var i=t(n);return function(o){var a=i(o);if(en(a)){var s=new Map(o);return s.set(n,r),s}else if(a.value[1]!==r){var s=new Map(o);return s.set(a.value[0],r),s}return o}}},G5=function(e){var t=nc(e);return function(n){return function(r){var i=t(n,r);if($t(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},sAe=function(e){var t=J5(e);return function(n,r){return t(n,function(){return r})}},J5=function(e){var t=nc(e);return function(n,r){return function(i){var o=t(n,i);if(en(o))return Re;var a=new Map(i);return a.set(o.value[0],r(o.value[1])),ye(a)}}};function uAe(e){var t=Z5(e),n=G5(e);return function(r){var i=n(r);return function(o){return x(t(r,o),Ko(function(a){return[a,i(o)]}))}}}function nc(e){return function(t,n){if(n===void 0){var r=nc(e);return function(l){return r(t,l)}}for(var i=n.entries(),o;!(o=i.next()).done;){var a=o.value,s=a[0],u=a[1];if(e.equals(s,t))return ye([s,u])}return Re}}var Z5=tc,lAe=X0,cAe=L5;function dAe(e,t){var n=nc(e);return{concat:function(r,i){if(Sa(r))return i;if(Sa(i))return r;for(var o=new Map(r),a=i.entries(),s;!(s=a.next()).done;){var u=s.value,l=u[0],c=u[1],f=n(l,r);$t(f)?o.set(f.value[0],t.concat(f.value[1],c)):o.set(l,c)}return o},empty:new Map}}var fAe=function(e,t){return new Map([[e,t]])};function pAe(e,t,n){return function(r){var i=nc(e);return n.reduce(r,new Map,function(o,a){var s=a[0],u=a[1],l=i(s,o);return $t(l)?o.set(l.value[0],t.concat(l.value[1],u)):o.set(s,u),o})}}var JA=function(e,t){for(var n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],s=o[1];n.set(a,t(a,s))}return n},X5=function(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,s=a[0],u=a[1],l=e(s,u);An(l)?n.set(s,l.left):r.set(s,l.right)}return Be(n,r)}};function e6(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,s=a[0],u=a[1];e(s,u)?r.set(s,u):n.set(s,u)}return Be(n,r)}}var t6=function(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],s=o[1],u=e(a,s);$t(u)&&n.set(a,u.value)}return n}};function n6(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],s=o[1];e(a,s)&&n.set(a,s)}return n}}var Nf=function(e,t){return JA(e,function(n,r){return t(r)})},ob=function(e,t){return r6(e,function(n,r){return t(r)})},ab=function(e,t){return i6(e,function(n,r){return t(r)})},sb=function(e,t){return o6(e,function(n,r){return t(r)})},ub=function(e,t){return a6(e,function(n,r){return t(r)})},r6=function(e,t){return x(e,n6(t))},i6=function(e,t){return x(e,t6(t))},o6=function(e,t){return x(e,e6(t))},a6=function(e,t){return x(e,X5(t))},ZA=function(e){for(var t=new Map,n=e.entries(),r;!(r=n.next()).done;){var i=r.value,o=i[0],a=i[1];$t(a)&&t.set(o,a.value)}return t},hAe=function(e){return function(t){return ob(t,e)}},AAe=function(e){return function(t){return ab(t,e)}},mAe=function(e){return function(t){return Nf(t,e)}},gAe=function(e){return function(t){return JA(t,e)}},vAe=function(e){return function(t){return sb(t,e)}},yAe=function(e){return function(t){return ub(t,e)}},XA=function(e){for(var t=new Map,n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],s=o[1];An(s)?t.set(a,s.left):n.set(a,s.right)}return Be(t,n)},Ja="Map",s6=function(e,t){var n=f6(e,t);return{concat:function(r,i){return n(i)(r)}}},bAe=function(e,t){return{concat:s6(e,t).concat,empty:new Map}},CAe=function(e,t){var n=p6(e,t);return{concat:function(r,i){return n(i)(r)}}},SAe=function(e){return function(){var t=h6(e);return{concat:function(n,r){return t(r)(n)}}}};function wAe(){return{URI:Ja,_E:void 0,map:Nf,mapWithIndex:JA,compact:ZA,separate:XA,filter:ob,filterMap:ab,partition:sb,partitionMap:ub,partitionMapWithIndex:a6,partitionWithIndex:o6,filterMapWithIndex:i6,filterWithIndex:r6}}function _Ae(e){var t=l6(e);return{URI:Ja,_E:void 0,map:Nf,compact:ZA,separate:XA,filter:ob,filterMap:ab,partition:sb,partitionMap:ub,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,traverse:t.traverse,sequence:t.sequence,mapWithIndex:JA,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverseWithIndex:t.traverseWithIndex,wilt:no(t,$w),wither:ro(t,$w)}}var xAe=XE,TAe=eR,IAe=tR,EAe=function(e){return hd(hd({},tb(e)),{URI:Ja})},RAe=nb,$Ae=rb,kAe=ib,u6=function(e){return hd(hd({},nR(e)),{URI:Ja})},l6=function(e){var t=u6(e),n=sR(e),r=function(a){return function(s,u){for(var l=a.of(new Map),c=n(s),f=c.length,p=function(A){var g=c[A],y=s.get(g);l=a.ap(a.map(l,function(C){return function(_){return C.set(g,_)}}),u(g,y))},h=0;h<f;h++)p(h);return l}},i=function(a){var s=r(a);return function(u,l){return s(u,function(c,f){return l(f)})}},o=function(a){var s=r(a);return function(u){return s(u,function(l,c){return c})}};return{URI:Ja,_E:void 0,map:Nf,mapWithIndex:JA,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverse:i,sequence:o,traverseWithIndex:r}},c6={URI:Ja,map:Nf},OAe=He(c6),$w={URI:Ja,compact:ZA,separate:XA},d6={URI:Ja,map:Nf,compact:ZA,separate:XA,filter:ob,filterMap:ab,partition:sb,partitionMap:ub},dv=function(e){return new Map(e)},f6=function(e,t){var n=iR(e,t);return function(r){return function(i){return Sa(i)?dv(r):Sa(r)?dv(i):n(r)(i)}}},p6=function(e,t){var n=oR(e,t);return function(r){return function(i){return Sa(i)||Sa(r)?new Map:n(r)(i)}}},h6=function(e){var t=aR(e);return function(n){return function(r){return Sa(r)?dv(n):Sa(n)?dv(r):t(n)(r)}}},MAe=new Map,FAe=Y5,jAe=d6;const LAe=Object.freeze(Object.defineProperty({__proto__:null,Compactable:$w,Filterable:d6,Functor:c6,URI:Ja,collect:Q5,compact:ZA,deleteAt:G5,difference:h6,elem:iAe,empty:MAe,filter:hAe,filterMap:AAe,filterMapWithIndex:t6,filterWithIndex:n6,flap:OAe,foldMap:TAe,foldMapWithIndex:$Ae,fromFoldable:pAe,getDifferenceMagma:SAe,getEq:cAe,getFilterableWithIndex:wAe,getFoldable:EAe,getFoldableWithIndex:u6,getIntersectionSemigroup:CAe,getMonoid:dAe,getShow:tAe,getTraversableWithIndex:l6,getUnionMonoid:bAe,getUnionSemigroup:s6,getWitherable:_Ae,insertAt:FAe,intersection:p6,isEmpty:Sa,isSubmap:lAe,keys:sR,lookup:Z5,lookupWithKey:nc,map:mAe,mapWithIndex:gAe,map_:jAe,member:rAe,modifyAt:J5,partition:vAe,partitionMap:yAe,partitionMapWithIndex:X5,partitionWithIndex:e6,pop:uAe,reduce:xAe,reduceRight:IAe,reduceRightWithIndex:kAe,reduceWithIndex:RAe,separate:XA,singleton:fAe,size:nAe,toArray:H5,toUnfoldable:aAe,union:f6,updateAt:sAe,upsertAt:Y5,values:oAe},Symbol.toStringTag,{value:"Module"})),DAe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),UAe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),BAe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),PAe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),WAe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var A6=function(e){return{concat:vy(e).concat,empty:e.top}},m6=function(e){return{concat:yy(e).concat,empty:e.bottom}},uR=function(e){return{concat:bx(e).concat,empty:e.empty}},g6=function(e){var t={};for(var n in e)gt.call(e,n)&&(t[n]=e[n].empty);return{concat:Cx(e).concat,empty:t}},v6=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{concat:Sx.apply(sB,e).concat,empty:e.map(function(n){return n.empty})}},y6=function(e){return _x(e)(e.empty)},NAe={concat:tB.concat,empty:void 0},KAe=v6,qAe=g6,VAe=uR,zAe=m6,QAe=A6,HAe=y6,b6={concat:nB.concat,empty:!0},C6={concat:rB.concat,empty:!1},YAe=$U,GAe=function(){return uR(MK())},JAe={concat:iB.concat,empty:""},ZAe={concat:oB.concat,empty:0},XAe={concat:aB.concat,empty:1};const eme=Object.freeze(Object.defineProperty({__proto__:null,concatAll:y6,fold:HAe,getDualMonoid:VAe,getEndomorphismMonoid:GAe,getFunctionMonoid:YAe,getJoinMonoid:zAe,getMeetMonoid:QAe,getStructMonoid:qAe,getTupleMonoid:KAe,max:m6,min:A6,monoidAll:b6,monoidAny:C6,monoidProduct:XAe,monoidString:JAe,monoidSum:ZAe,monoidVoid:NAe,reverse:uR,struct:g6,tuple:v6},Symbol.toStringTag,{value:"Module"})),tme=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var S6=function(e,t,n){return function(r){return r===-1?e():r===0?t():n()}},nme=S6,w6=function(e){return e===-1?1:e===1?-1:0},_6={equals:function(e,t){return e===t}},lR={concat:function(e,t){return e!==0?e:t}},x6={concat:lR.concat,empty:0},rme=function(e){return e<=-1?-1:e>=1?1:0},ime=w6,ome=lR,ame=_6,sme=x6;const ume=Object.freeze(Object.defineProperty({__proto__:null,Eq:_6,Monoid:x6,Semigroup:lR,eqOrdering:ame,invert:ime,match:nme,matchW:S6,monoidOrdering:sme,reverse:w6,semigroupOrdering:ome,sign:rme},Symbol.toStringTag,{value:"Module"}));var lme=function(e){return typeof e.map=="function"},cme=function(e){return typeof e.contramap=="function"},dme=function(e){return typeof e.mapWithIndex=="function"},fme=function(e){return typeof e.ap=="function"},pme=function(e){return typeof e.chain=="function"},hme=function(e){return typeof e.bimap=="function"},Ame=function(e){return typeof e.extend=="function"},mme=function(e){return typeof e.reduce=="function"},gme=function(e){return typeof e.reduceWithIndex=="function"},vme=function(e){return typeof e.alt=="function"},yme=function(e){return typeof e.compact=="function"},bme=function(e){return typeof e.filter=="function"},Cme=function(e){return typeof e.filterWithIndex=="function"},Sme=function(e){return typeof e.promap=="function"},wme=function(e){return typeof e.compose=="function"},_me=function(e){return typeof e.throwError=="function"};function xme(e){var t={};if(lme(e)){var n=function(F){return function(M){return e.map(M,F)}};t.map=n}if(cme(e)){var r=function(F){return function(M){return e.contramap(M,F)}};t.contramap=r}if(dme(e)){var i=function(F){return function(M){return e.mapWithIndex(M,F)}};t.mapWithIndex=i}if(fme(e)){var o=function(F){return function(M){return e.ap(M,F)}},a=function(F){return function(M){return e.ap(e.map(M,function(W){return function(){return W}}),F)}};t.ap=o,t.apFirst=a,t.apSecond=function(F){return function(M){return e.ap(e.map(M,function(){return function(W){return W}}),F)}}}if(pme(e)){var s=function(F){return function(M){return e.chain(M,F)}},u=function(F){return function(M){return e.chain(M,function(W){return e.map(F(W),function(){return W})})}},l=function(F){return e.chain(F,Q)};t.chain=s,t.chainFirst=u,t.flatten=l}if(hme(e)){var c=function(F,M){return function(W){return e.bimap(W,F,M)}},f=function(F){return function(M){return e.mapLeft(M,F)}};t.bimap=c,t.mapLeft=f}if(Ame(e)){var p=function(F){return function(M){return e.extend(M,F)}},h=function(F){return e.extend(F,Q)};t.extend=p,t.duplicate=h}if(mme(e)){var A=function(F,M){return function(W){return e.reduce(W,F,M)}},g=function(F){var M=e.foldMap(F);return function(W){return function(re){return M(re,W)}}},y=function(F,M){return function(W){return e.reduceRight(W,F,M)}};t.reduce=A,t.foldMap=g,t.reduceRight=y}if(gme(e)){var C=function(F,M){return function(W){return e.reduceWithIndex(W,F,M)}},_=function(F){var M=e.foldMapWithIndex(F);return function(W){return function(re){return M(re,W)}}},b=function(F,M){return function(W){return e.reduceRightWithIndex(W,F,M)}};t.reduceWithIndex=C,t.foldMapWithIndex=_,t.reduceRightWithIndex=b}if(vme(e)){var v=function(F){return function(M){return e.alt(M,F)}};t.alt=v}if(yme(e)&&(t.compact=e.compact,t.separate=e.separate),bme(e)){var S=function(F){return function(M){return e.filter(M,F)}},w=function(F){return function(M){return e.filterMap(M,F)}},T=function(F){return function(M){return e.partition(M,F)}},E=function(F){return function(M){return e.partitionMap(M,F)}};t.filter=S,t.filterMap=w,t.partition=T,t.partitionMap=E}if(Cme(e)){var R=function(F){return function(M){return e.filterWithIndex(M,F)}},O=function(F){return function(M){return e.filterMapWithIndex(M,F)}},$=function(F){return function(M){return e.partitionWithIndex(M,F)}},B=function(F){return function(M){return e.partitionMapWithIndex(M,F)}};t.filterWithIndex=R,t.filterMapWithIndex=O,t.partitionWithIndex=$,t.partitionMapWithIndex=B}if(Sme(e)){var K=function(F,M){return function(W){return e.promap(W,F,M)}};t.promap=K}if(wme(e)){var H=function(F){return function(M){return e.compose(M,F)}};t.compose=H}if(_me(e)){var z=function(F){return function(M){return M._tag==="None"?e.throwError(F()):e.of(M.value)}},N=function(F){return F._tag==="Left"?e.throwError(F.left):e.of(F.right)},Y=function(F,M){return function(W){return F(W)?e.of(W):e.throwError(M(W))}},ee=function(F,M){return function(W){return e.chain(W,function(re){return F(re)?e.of(re):e.throwError(M(re))})}};t.fromOption=z,t.fromEither=N,t.fromPredicate=Y,t.filterOrElse=ee}return t}var ge=x;const Tme=Object.freeze(Object.defineProperty({__proto__:null,pipe:ge,pipeable:xme},Symbol.toStringTag,{value:"Module"})),Ime=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Eme=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var lb=function(){return Math.random()};function T6(e,t){return x(lb,Yo(function(n){return Math.floor((t-e+1)*n+e)}))}function Rme(e,t){return x(lb,Yo(function(n){return(t-e)*n+e}))}var $me=x(lb,Yo(function(e){return e<.5})),kme=function(e){return x(T6(0,e.length-1),Yo(function(t){return e[t]}))};const Ome=Object.freeze(Object.defineProperty({__proto__:null,random:lb,randomBool:$me,randomElem:kme,randomInt:T6,randomRange:Rme},Symbol.toStringTag,{value:"Module"}));var cR=yf(sE),I6=zl(sE),E6=bf(kn),Mme=Cf(kn),R6=Qo,$6=E6,k6=$A(kn),Fme=k6,dR=If(Ka),jme=dR,O6=dR,Lme=O6,M6=Ef(Ka),Dme=M6,Ume=MA(kn),Bme=FA,F6=jA,Pme=F6,j6=Hl(Ka),Wme=j6,L6=kA(Ka),Nme=L6,Kme=OA(Ka),qme=Rf(kn),Di=function(e,t){return x(e,U6(t))},fR=function(e,t,n){return x(e,B6(t,n))},pR=function(e,t){return x(e,P6(t))},Kf=function(e,t){return x(e,hR(t))},em=function(e,t){return x(e,AR(t))},D6=function(e,t){return x(e,mR(t))},U6=Sf(kn),B6=xf(kn),P6=Tf(kn),hR=wf(Na),Vme=hR,Jo=I6,AR=Ql(Ka),W6=AR,N6=W6(Q),zme=N6,mR=_f(Ka),Qme=mR,gR=cR,yn="ReaderEither",K6=function(e){var t=Kl(e);return{URI:yn,_E:void 0,compact:qo(kn,t),separate:La(kn,t,ou)}};function Hme(e){var t=mf(e),n=K6(e),r=Da(kn,t),i=Ua(kn,t),o=su(kn,t),a=uu(kn,t);return{URI:yn,_E:void 0,map:Di,compact:n.compact,separate:n.separate,filter:function(s,u){return x(s,r(u))},filterMap:function(s,u){return x(s,i(u))},partition:function(s,u){return x(s,o(u))},partitionMap:function(s,u){return x(s,a(u))}}}function q6(e){var t=Ra(Na,iu(e));return{URI:yn,_E:void 0,map:Di,ap:function(n,r){return x(n,t(r))},of:Jo}}function V6(e){var t=RA(Ka,e);return{URI:yn,_E:void 0,map:Di,alt:function(n,r){return x(n,t(r))}}}var vR={URI:yn,map:Di},Yme=He(vR),Gme={URI:yn,of:Jo},tm={URI:yn,map:Di,ap:Kf},z6=Kt(tm),Jme=z6,Q6=qt(tm),Zme=Q6,H6={URI:yn,map:Di,ap:Kf,of:Jo},Za={URI:yn,map:Di,ap:Kf,chain:em},Xme={URI:yn,map:Di,ap:Kf,of:Jo,chain:em},Y6=vt(Za),ege=Y6,tge={URI:yn,bimap:fR,mapLeft:pR},nge={URI:yn,map:Di,alt:D6},qf={URI:yn,fromReader:$6},rge=DA(qf),ige=UA(qf),oge=Jl(qf),G6=BA(qf,Za),age=G6,J6=PA(qf,Za),sge=J6,uge={URI:yn,map:Di,ap:Kf,of:Jo,chain:em,throwError:gR},Xa={URI:yn,fromEither:R6},lge=Po(Xa),cge=Wo(Xa),dge=Ol(Xa,Za),Z6=$a(Xa,Za),fge=Z6,X6=ka(Xa,Za),pge=X6,hge=Gs(Xa),e4=Ml(Xa,Za),Age=e4,mge=di(Xa),gge=Jo(gn),vge=zt(vR),t4=Qt(Za),yge=t4,n4=Vt(tm),bge=n4,r4=Jo(jn),i4=function(e){return X(Gl(e),Yl(EA(Dr)))},yR=function(e){var t=i4(e);return function(n){return _t(n)?t(n):r4}},Cge=yR,o4=function(e){return yR(function(t,n){return e(n)})},Sge=o4(Q),wge={URI:yn,bimap:fR,mapLeft:pR,map:Di,of:Jo,ap:Kf,chain:em,alt:D6,throwError:cR},_ge=vn(tm),xge=$i(H6),Tge=function(e){return vn(Na)(_A(e))};function Ige(e){var t=q6(e),n=V6(e);return{URI:yn,_E:void 0,map:Di,ap:t.ap,of:Jo,chain:em,bimap:fR,mapLeft:pR,alt:n.alt,throwError:gR}}const Ege=Object.freeze(Object.defineProperty({__proto__:null,Alt:nge,ApT:r4,Applicative:H6,Apply:tm,Bifunctor:tge,Chain:Za,Do:gge,FromEither:Xa,FromReader:qf,Functor:vR,Monad:Xme,MonadThrow:uge,Pointed:Gme,URI:yn,alt:mR,altW:Qme,ap:hR,apFirst:z6,apFirstW:Jme,apS:n4,apSW:bge,apSecond:Q6,apSecondW:Zme,apW:Vme,ask:rge,asks:ige,asksReaderEither:Pme,asksReaderEitherW:F6,bimap:B6,bind:t4,bindTo:vge,bindW:yge,chain:AR,chainEitherK:Z6,chainEitherKW:fge,chainFirst:Y6,chainFirstEitherK:X6,chainFirstEitherKW:pge,chainFirstReaderK:J6,chainFirstReaderKW:sge,chainFirstW:ege,chainOptionK:dge,chainReaderK:G6,chainReaderKW:age,chainW:W6,filterOrElse:e4,filterOrElseW:Age,flap:Yme,flatten:zme,flattenW:N6,fold:jme,foldW:Lme,fromEither:R6,fromEitherK:mge,fromOption:lge,fromOptionK:cge,fromPredicate:hge,fromReader:$6,fromReaderK:oge,getAltReaderValidation:V6,getApplicativeReaderValidation:q6,getApplyMonoid:xge,getApplySemigroup:_ge,getCompactable:K6,getFilterable:Hme,getOrElse:M6,getOrElseW:Dme,getReaderValidation:Ige,getSemigroup:Tge,left:cR,leftReader:Mme,local:Bme,map:U6,mapLeft:P6,match:k6,matchE:dR,matchEW:O6,matchW:Fme,of:Jo,orElse:j6,orElseFirst:L6,orElseFirstW:Nme,orElseW:Wme,orLeft:Kme,readerEither:wge,right:I6,rightReader:E6,sequenceArray:Sge,swap:qme,throwError:gR,toUnion:Ume,traverseArray:o4,traverseArrayWithIndex:Cge,traverseReadonlyArrayWithIndex:yR,traverseReadonlyNonEmptyArrayWithIndex:i4},Symbol.toStringTag,{value:"Module"}));function bR(e){return function(t){return function(){return e.of(t)}}}function CR(e){return function(t){return function(n){return function(r){return e.map(n(r),t)}}}}function SR(e){return function(t){return function(n){return function(r){return e.ap(n(r),t(r))}}}}function wR(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(i){return t(i)(r)})}}}}function _R(e){return function(t){return X(t,e.of)}}function Rge(e){return function(t){return X(t,e)}}function $ge(e){var t=SR(e),n=CR(e),r=wR(e);return{map:function(i,o){return x(i,n(o))},ap:function(i,o){return x(i,t(o))},of:bR(e),chain:function(i,o){return x(i,r(o))},ask:function(){return e.of},asks:function(i){return X(i,e.of)},local:function(i,o){return function(a){return i(o(a))}},fromReader:_R(e),fromM:function(i){return function(){return i}}}}const kge=Object.freeze(Object.defineProperty({__proto__:null,ap:SR,chain:wR,fromNaturalTransformation:Rge,fromReader:_R,getReaderM:$ge,map:CR,of:bR},Symbol.toStringTag,{value:"Module"}));var yr=function(e){return function(){return Promise.resolve().then(e)}};function Oge(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var ao=function(e,t){return x(e,fu(t))},rc=function(e,t){return x(e,a4(t))},xR=function(e,t){return x(e,nm(function(n){return x(t,fu(n))}))},Vf=function(e,t){return x(e,nm(t))},fu=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},a4=function(e){return function(t){return function(){return Promise.all([Promise.resolve().then(t),Promise.resolve().then(e)]).then(function(n){var r=n[0],i=n[1];return r(i)})}}},tr=function(e){return function(){return Promise.resolve(e)}},nm=function(e){return function(t){return function(){return Promise.resolve().then(t).then(function(n){return e(n)()})}}},Mge=nm(Q),br="Task";function Fge(){return{concat:function(e,t){return function(){return Promise.race([Promise.resolve().then(e),Promise.resolve().then(t)])}},empty:u4}}var Ke={URI:br,map:ao},jge=He(Ke),Un={URI:br,of:tr},ic={URI:br,map:ao,ap:rc},Lge=Kt(ic),Dge=qt(ic),rm={URI:br,map:ao,ap:rc,of:tr},cb={URI:br,map:ao,ap:xR},s4={URI:br,map:ao,ap:xR,of:tr},zf={URI:br,map:ao,ap:rc,chain:Vf},bn={URI:br,map:ao,of:tr,ap:rc,chain:Vf},Uge={URI:br,map:ao,of:tr,ap:rc,chain:Vf,fromIO:yr},im=Q,Bge={URI:br,map:ao,of:tr,ap:rc,chain:Vf,fromIO:yr,fromTask:im},Pge=vt(zf),db={URI:br,fromIO:yr},Wge=zo(db),Nge=Ba(db,zf),Kge=Pa(db,zf),qge={URI:br,fromIO:yr,fromTask:im},u4=function(){return new Promise(function(e){})},Vge=tr(gn),zge=zt(Ke),Qge=Qt(zf),Hge=Vt(ic),TR=tr(jn),Qf=function(e){return function(t){return function(){return Promise.all(t.map(function(n,r){return Promise.resolve().then(function(){return e(r,n)()})}))}}},IR=function(e){var t=Qf(e);return function(n){return _t(n)?t(n):TR}},ER=function(e){return function(t){return function(){return Nd(t).reduce(function(n,r,i){return n.then(function(o){return Promise.resolve().then(e(i+1,r)).then(function(a){return o.push(a),o})})},Promise.resolve().then(e(0,ci(t))).then(Gh))}}},RR=function(e){var t=ER(e);return function(n){return _t(n)?t(n):TR}},Yge=IR,l4=function(e){return IR(function(t,n){return e(n)})},Gge=l4(Q),Jge=RR,c4=function(e){return RR(function(t,n){return e(n)})},Zge=c4(Q),Xge={URI:br,map:ao,of:tr,ap:rc,chain:Vf,fromIO:yr,fromTask:im},eve={URI:br,map:ao,of:tr,ap:xR,chain:Vf,fromIO:yr,fromTask:im},tve=vn(cb),nve=$i(s4);const rve=Object.freeze(Object.defineProperty({__proto__:null,ApT:TR,ApplicativePar:rm,ApplicativeSeq:s4,ApplyPar:ic,ApplySeq:cb,Chain:zf,Do:Vge,FromIO:db,FromTask:qge,Functor:Ke,Monad:bn,MonadIO:Uge,MonadTask:Bge,Pointed:Un,URI:br,ap:a4,apFirst:Lge,apS:Hge,apSecond:Dge,bind:Qge,bindTo:zge,chain:nm,chainFirst:Pge,chainFirstIOK:Kge,chainIOK:Nge,delay:Oge,flap:jge,flatten:Mge,fromIO:yr,fromIOK:Wge,fromTask:im,getMonoid:nve,getRaceMonoid:Fge,getSemigroup:tve,map:fu,never:u4,of:tr,sequenceArray:Gge,sequenceSeqArray:Zge,task:Xge,taskSeq:eve,traverseArray:l4,traverseArrayWithIndex:Yge,traverseReadonlyArrayWithIndex:IR,traverseReadonlyArrayWithIndexSeq:RR,traverseReadonlyNonEmptyArrayWithIndex:Qf,traverseReadonlyNonEmptyArrayWithIndexSeq:ER,traverseSeqArray:c4,traverseSeqArrayWithIndex:Jge},Symbol.toStringTag,{value:"Module"}));var d4=_R(Un),Hf=Qo,oc=X(yr,Hf),ive=FA,f4=jA,ove=f4,so=function(e,t){return x(e,kR(t))},ac=function(e,t){return x(e,OR(t))},$R=function(e,t){return x(e,fb(function(n){return x(t,kR(n))}))},Yf=function(e,t){return x(e,fb(t))},kR=CR(Ke),OR=SR(ic),ave=OR,Ui=bR(Un),fb=wR(bn),p4=fb,h4=p4(Q),sve=h4,nr="ReaderTask",On={URI:nr,map:so},uve=He(On),om={URI:nr,of:Ui},am={URI:nr,map:so,ap:ac},lve=Kt(am),cve=qt(am),dve={URI:nr,map:so,ap:ac,of:Ui},MR={URI:nr,map:so,ap:$R},A4={URI:nr,map:so,ap:$R,of:Ui},Zo={URI:nr,map:so,ap:ac,chain:Yf},es={URI:nr,map:so,of:Ui,ap:ac,chain:Yf},fve={URI:nr,map:so,of:Ui,ap:ac,chain:Yf,fromIO:oc},pve={URI:nr,map:so,of:Ui,ap:ac,chain:Yf,fromIO:oc,fromTask:Hf},m4=vt(Zo),hve=m4,pb={URI:nr,fromIO:oc},Ave=zo(pb),mve=Ba(pb,Zo),gve=Pa(pb,Zo),Gf={URI:nr,fromReader:d4},vve=DA(Gf),yve=UA(Gf),bve=Jl(Gf),g4=BA(Gf,Zo),Cve=g4,v4=PA(Gf,Zo),Sve=v4,hb={URI:nr,fromIO:oc,fromTask:Hf},wve=Zl(hb),_ve=$f(hb,Zo),xve=kf(hb,Zo),Tve=Ui(gn),Ive=zt(On),y4=Qt(Zo),Eve=y4,b4=Vt(am),Rve=b4,FR=Ui(jn),C4=function(e){return X(Gl(e),Yl(Qf(Dr)))},jR=function(e){var t=C4(e);return function(n){return _t(n)?t(n):FR}},S4=function(e){return X(Gl(e),Yl(ER(Dr)))},LR=function(e){var t=S4(e);return function(n){return _t(n)?t(n):FR}},$ve=jR,w4=function(e){return jR(function(t,n){return e(n)})},kve=w4(Q),Ove=LR,_4=function(e){return LR(function(t,n){return e(n)})},Mve=_4(Q),Fve={URI:nr,map:so,of:Ui,ap:ac,chain:Yf,fromIO:oc,fromTask:Hf},jve={URI:nr,map:so,of:Ui,ap:$R,chain:Yf,fromIO:oc,fromTask:Hf},Lve=vn(MR),Dve=$i(A4);function Uve(e,t){return e(t)()}const Bve=Object.freeze(Object.defineProperty({__proto__:null,ApT:FR,ApplicativePar:dve,ApplicativeSeq:A4,ApplyPar:am,ApplySeq:MR,Chain:Zo,Do:Tve,FromIO:pb,FromReader:Gf,FromTask:hb,Functor:On,Monad:es,MonadIO:fve,MonadTask:pve,Pointed:om,URI:nr,ap:OR,apFirst:lve,apS:b4,apSW:Rve,apSecond:cve,apW:ave,ask:vve,asks:yve,asksReaderTask:ove,asksReaderTaskW:f4,bind:y4,bindTo:Ive,bindW:Eve,chain:fb,chainFirst:m4,chainFirstIOK:gve,chainFirstReaderK:v4,chainFirstReaderKW:Sve,chainFirstTaskK:xve,chainFirstW:hve,chainIOK:mve,chainReaderK:g4,chainReaderKW:Cve,chainTaskK:_ve,chainW:p4,flap:uve,flatten:sve,flattenW:h4,fromIO:oc,fromIOK:Ave,fromReader:d4,fromReaderK:bve,fromTask:Hf,fromTaskK:wve,getMonoid:Dve,getSemigroup:Lve,local:ive,map:kR,of:Ui,readerTask:Fve,readerTaskSeq:jve,run:Uve,sequenceArray:kve,sequenceSeqArray:Mve,traverseArray:w4,traverseArrayWithIndex:$ve,traverseReadonlyArrayWithIndex:jR,traverseReadonlyArrayWithIndexSeq:LR,traverseReadonlyNonEmptyArrayWithIndex:C4,traverseReadonlyNonEmptyArrayWithIndexSeq:S4,traverseSeqArray:_4,traverseSeqArrayWithIndex:Ove},Symbol.toStringTag,{value:"Module"}));var Pve=function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{l(r.next(c))}catch(f){a(f)}}function u(c){try{l(r.throw(c))}catch(f){a(f)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(e,t||[])).next())})},Wve=function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1],o=l;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(l);break}o[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(c){l=[6,c],i=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},DR=yf(Un),UR=zl(Un),Ab=bf(Ke),BR=Cf(Ke),PR=X(yr,Ab),x4=X(yr,BR),pu=PR,Jf=Ab,WR=tr,NR=yr,T4=function(e){return fu(pK(e))},I4=$A(Ke),Nve=I4,KR=If(bn),Kve=KR,E4=KR,qve=E4,R4=Ef(bn),Vve=R4,$4=function(e,t){return function(){return Pve(void 0,void 0,void 0,function(){var n;return Wve(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(Ys)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,Ca(t(n))];case 3:return[2]}})})}},zve=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return $4(function(){return e.apply(void 0,n)},t)}},Qve=MA(Ke),Hve=I0(Un),Yve=E0(Un),Gve=ZI(bn),k4=Hl(bn),Jve=k4,mb=kA(bn),Zve=mb,Xve=function(e){return mb(Y4(e))},eye=function(e){return mb(G4(e))},tye=OA(bn),nye=Rf(Ke),O4=function(e){var t=T4(e);return function(n){return X(n,t)}},M4=function(e){return function(t){return function(n){return x(n,sm(O4(e)(t)))}}},rye=M4,F4=function(e){return X(e,NR)},j4=function(e){return sh(F4(e))},iye=j4,Bn=function(e,t){return x(e,zR(t))},hu=function(e,t){return x(e,QR(t))},qR=function(e,t){return x(e,sm(function(n){return x(t,zR(n))}))},Au=function(e,t){return x(e,sm(t))},gb=function(e,t,n){return x(e,L4(t,n))},vb=function(e,t){return x(e,D4(t))},VR=function(e,t){return x(e,HR(t))},zR=Sf(Ke),L4=xf(Ke),D4=Tf(Ke),QR=wf(ic),oye=QR,sm=Ql(bn),sh=sm,U4=sh(Q),aye=U4,HR=_f(bn),sye=HR,Wr=UR,um=DR,xt="TaskEither";function YR(e,t){var n=Ra(e,iu(t));return{URI:xt,_E:void 0,map:Bn,ap:function(r,i){return x(r,n(i))},of:Wr}}function B4(e){var t=RA(bn,e);return{URI:xt,_E:void 0,map:Bn,alt:function(n,r){return x(n,t(r))}}}var P4=function(e){var t=Kl(e);return{URI:xt,_E:void 0,compact:qo(Ke,t),separate:La(Ke,t,ou)}};function uye(e){var t=mf(e),n=P4(e),r=Da(Ke,t),i=Ua(Ke,t),o=su(Ke,t),a=uu(Ke,t);return{URI:xt,_E:void 0,map:Bn,compact:n.compact,separate:n.separate,filter:function(s,u){return x(s,r(u))},filterMap:function(s,u){return x(s,i(u))},partition:function(s,u){return x(s,o(u))},partitionMap:function(s,u){return x(s,a(u))}}}var GR={URI:xt,map:Bn},lye=He(GR),cye={URI:xt,of:Wr},yb={URI:xt,map:Bn,ap:hu},W4=Kt(yb),dye=W4,N4=qt(yb),fye=N4,pye={URI:xt,map:Bn,ap:hu,of:Wr},K4={URI:xt,map:Bn,ap:qR},q4={URI:xt,map:Bn,ap:qR,of:Wr},uo={URI:xt,map:Bn,ap:hu,chain:Au},hye={URI:xt,map:Bn,ap:hu,chain:Au,of:Wr},Aye={URI:xt,map:Bn,ap:hu,chain:Au,of:Wr,fromIO:pu},mye={URI:xt,map:Bn,ap:hu,chain:Au,of:Wr,fromIO:pu,fromTask:Jf},gye={URI:xt,map:Bn,ap:hu,chain:Au,of:Wr,throwError:um},V4=vt(uo),vye=V4,yye={URI:xt,bimap:gb,mapLeft:vb},bye={URI:xt,map:Bn,alt:VR},ts={URI:xt,fromEither:WR},Cye=Po(ts),Sye=Wo(ts),wye=Ol(ts,uo),z4=$a(ts,uo),_ye=z4,Q4=ka(ts,uo),xye=Q4,Tye=Gs(ts),H4=Ml(ts,uo),Iye=H4,Eye=di(ts),bb={URI:xt,fromIO:pu},Y4=zo(bb),Rye=Ba(bb,uo),$ye=Pa(bb,uo),Cb={URI:xt,fromIO:pu,fromTask:Jf},G4=Zl(Cb),kye=$f(Cb,uo),Oye=kf(Cb,uo);function Mye(e){return function(){var t=Array.prototype.slice.call(arguments);return function(){return new Promise(function(n){var r=function(i,o){return i!=null?n(Ca(i)):n(Ys(o))};e.apply(null,t.concat(r))})}}}var Fye=function(e,t,n){return JR(e,t,n)},JR=function(e,t,n){return x(e,sh(function(r){return x(t(r),nm(function(i){return x(n(r,i),sh(function(){return tr(i)}))}))}))},jye=Wr(gn),Lye=zt(GR),J4=Qt(uo),Dye=J4,Z4=Vt(yb),Uye=Z4,ZR=Wr(jn),XR=function(e){return X(Qf(e),fu(EA(Dr)))},e$=function(e){var t=XR(e);return function(n){return _t(n)?t(n):ZR}},t$=function(e){return function(t){return function(){return Nd(t).reduce(function(n,r,i){return n.then(function(o){return An(o)?n:e(i+1,r)().then(function(a){return An(a)?a:(o.right.push(a.right),o)})})},e(0,ci(t))().then(ql(Gh)))}}},n$=function(e){var t=t$(e);return function(n){return _t(n)?t(n):ZR}},Bye=e$,X4=function(e){return e$(function(t,n){return e(n)})},Pye=X4(Q),Wye=n$,e9=function(e){return n$(function(t,n){return e(n)})},Nye=e9(Q),Kye={URI:xt,bimap:gb,mapLeft:vb,map:Bn,of:Wr,ap:hu,chain:Au,alt:VR,fromIO:pu,fromTask:Jf,throwError:um},qye={URI:xt,bimap:gb,mapLeft:vb,map:Bn,of:Wr,ap:qR,chain:Au,alt:VR,fromIO:pu,fromTask:Jf,throwError:um},Vye=vn(K4),zye=$i(q4),Qye=function(e){return vn(cb)(_A(e))};function Hye(e){var t=YR(rm,e),n=B4(e);return{URI:xt,_E:void 0,map:Bn,ap:t.ap,of:Wr,chain:Au,bimap:gb,mapLeft:vb,alt:n.alt,fromIO:pu,fromTask:Jf,throwError:um}}const Yye=Object.freeze(Object.defineProperty({__proto__:null,Alt:bye,ApT:ZR,ApplicativePar:pye,ApplicativeSeq:q4,ApplyPar:yb,ApplySeq:K4,Bifunctor:yye,Chain:uo,Do:jye,FromEither:ts,FromIO:bb,FromTask:Cb,Functor:GR,Monad:hye,MonadIO:Aye,MonadTask:mye,MonadThrow:gye,Pointed:cye,URI:xt,alt:HR,altW:sye,ap:QR,apFirst:W4,apFirstW:dye,apS:Z4,apSW:Uye,apSecond:N4,apSecondW:fye,apW:oye,bimap:L4,bind:J4,bindTo:Lye,bindW:Dye,bracket:Fye,bracketW:JR,chain:sm,chainEitherK:z4,chainEitherKW:_ye,chainFirst:V4,chainFirstEitherK:Q4,chainFirstEitherKW:xye,chainFirstIOK:$ye,chainFirstTaskK:Oye,chainFirstW:vye,chainIOEitherK:iye,chainIOEitherKW:j4,chainIOK:Rye,chainNullableK:Gve,chainOptionK:wye,chainTaskK:kye,chainTaskOptionK:rye,chainTaskOptionKW:M4,chainW:sh,filterOrElse:H4,filterOrElseW:Iye,flap:lye,flatten:aye,flattenW:U4,fold:Kve,foldW:qve,fromEither:WR,fromEitherK:Eye,fromIO:pu,fromIOEither:NR,fromIOEitherK:F4,fromIOK:Y4,fromNullable:Hve,fromNullableK:Yve,fromOption:Cye,fromOptionK:Sye,fromPredicate:Tye,fromTask:Jf,fromTaskK:G4,fromTaskOption:T4,fromTaskOptionK:O4,getAltTaskValidation:B4,getApplicativeTaskValidation:YR,getApplyMonoid:zye,getApplySemigroup:Vye,getCompactable:P4,getFilterable:uye,getOrElse:R4,getOrElseW:Vve,getSemigroup:Qye,getTaskValidation:Hye,left:DR,leftIO:x4,leftTask:BR,map:zR,mapLeft:D4,match:I4,matchE:KR,matchEW:E4,matchW:Nve,of:Wr,orElse:k4,orElseFirst:mb,orElseFirstIOK:Xve,orElseFirstTaskK:eye,orElseFirstW:Zve,orElseW:Jve,orLeft:tye,right:UR,rightIO:PR,rightTask:Ab,sequenceArray:Pye,sequenceSeqArray:Nye,swap:nye,taskEither:Kye,taskEitherSeq:qye,taskify:Mye,throwError:um,toUnion:Qve,traverseArray:X4,traverseArrayWithIndex:Bye,traverseReadonlyArrayWithIndex:e$,traverseReadonlyArrayWithIndexSeq:n$,traverseReadonlyNonEmptyArrayWithIndex:XR,traverseReadonlyNonEmptyArrayWithIndexSeq:t$,traverseSeqArray:e9,traverseSeqArrayWithIndex:Wye,tryCatch:$4,tryCatchK:zve},Symbol.toStringTag,{value:"Module"}));var mu=Qo,Sb=yf(om),r$=zl(om),i$=X(Ab,mu),t9=X(BR,mu),o$=function(e){return X(e,UR)},n9=function(e){return X(e,DR)},r9=bf(On),Gye=Cf(On),a$=X(PR,mu),i9=X(x4,mu),o9=Ui,a9=o$,gu=a$,Zf=i$,s$=X(NR,mu),u$=function(e){return X(e,WR)},s9=$A(On),Jye=s9,l$=If(Zo),Zye=l$,u9=l$,Xye=u9,l9=Ef(es),e0e=l9,t0e=MA(On),n0e=I0(om),r0e=E0(om),i0e=ZI(es),o0e=FA,c9=jA,a0e=c9,d9=Hl(es),s0e=d9,f9=kA(es),u0e=f9,l0e=OA(es),c0e=Rf(On),p9=function(e){return X(e,s$)},h9=function(e){return Xf(p9(e))},d0e=h9,c$=function(e){return X(e,mu)},A9=function(e){return Xf(c$(e))},f0e=A9,m9=function(e){return Eb(c$(e))},p0e=m9,d$=function(e){return X(e,u$)},g9=function(e){return Xf(d$(e))},h0e=g9,v9=function(e){return Eb(d$(e))},A0e=v9,Pn=function(e,t){return x(e,lm(t))},vu=function(e,t){return x(e,m$(t))},f$=function(e,t){return x(e,xb(function(n){return x(t,lm(n))}))},yu=function(e,t){return x(e,xb(t))},p$=function(e,t){return x(e,Tb(t))},wb=function(e,t,n){return x(e,h$(t,n))},_b=function(e,t){return x(e,A$(t))},lm=Sf(On),h$=xf(On),A$=Tf(On),m$=wf(am),m0e=m$,Nr=r$,xb=Ql(es),Xf=xb,y9=Xf(Q),g0e=y9,Tb=_f(es),b9=Tb,cm=Sb,Ct="ReaderTaskEither",C9=function(e){var t=Kl(e);return{URI:Ct,_E:void 0,compact:qo(On,t),separate:La(On,t,ou)}};function v0e(e){var t=mf(e),n=C9(e),r=Da(On,t),i=Ua(On,t),o=su(On,t),a=uu(On,t);return{URI:Ct,_E:void 0,map:Pn,compact:n.compact,separate:n.separate,filter:function(s,u){return x(s,r(u))},filterMap:function(s,u){return x(s,i(u))},partition:function(s,u){return x(s,o(u))},partitionMap:function(s,u){return x(s,a(u))}}}function S9(e,t){var n=Ra(Na,YR(e,t));return{URI:Ct,_E:void 0,map:Pn,ap:function(r,i){return x(r,n(i))},of:Nr}}function w9(e){var t=RA(es,e);return{URI:Ct,_E:void 0,map:Pn,alt:function(n,r){return x(n,t(r))}}}var sc={URI:Ct,map:Pn},y0e=He(sc),g$={URI:Ct,of:Nr},Ib={URI:Ct,map:Pn,ap:vu},_9=Kt(Ib),b0e=_9,x9=qt(Ib),C0e=x9,S0e={URI:Ct,map:Pn,ap:vu,of:Nr},T9={URI:Ct,map:Pn,ap:f$},I9={URI:Ct,map:Pn,ap:f$,of:Nr},Cr={URI:Ct,map:Pn,ap:vu,chain:yu},w0e={URI:Ct,map:Pn,ap:vu,chain:yu,of:Nr},_0e={URI:Ct,map:Pn,ap:vu,chain:yu,of:Nr,fromIO:gu},x0e={URI:Ct,map:Pn,ap:vu,chain:yu,of:Nr,fromIO:gu,fromTask:Zf},T0e={URI:Ct,map:Pn,ap:vu,chain:yu,of:Nr,throwError:cm},E9=vt(Cr),Eb=E9,I0e={URI:Ct,bimap:wb,mapLeft:_b},E0e={URI:Ct,map:Pn,alt:p$},ep={URI:Ct,fromReader:a9},R0e=DA(ep),$0e=UA(ep),k0e=Jl(ep),R9=BA(ep,Cr),O0e=R9,$9=PA(ep,Cr),M0e=$9,v$=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return r9(e.apply(void 0,t))}},k9=function(e){return Xf(v$(e))},F0e=k9,O9=function(e){return Eb(v$(e))},j0e=O9,ns={URI:Ct,fromEither:o9},L0e=Po(ns),D0e=Wo(ns),U0e=Ol(ns,Cr),M9=$a(ns,Cr),B0e=M9,F9=ka(ns,Cr),P0e=F9,W0e=Gs(ns),j9=Ml(ns,Cr),N0e=j9,K0e=di(ns),Rb={URI:Ct,fromIO:gu},q0e=zo(Rb),V0e=Ba(Rb,Cr),z0e=Pa(Rb,Cr),$b={URI:Ct,fromIO:gu,fromTask:Zf},Q0e=Zl($b),H0e=$f($b,Cr),Y0e=kf($b,Cr);function G0e(e,t,n){return L9(e,t,n)}function L9(e,t,n){return function(r){return JR(e(r),function(i){return t(i)(r)},function(i,o){return n(i,o)(r)})}}var J0e=Nr(gn),Z0e=zt(sc),D9=Qt(Cr),X0e=D9,U9=Vt(Ib),ebe=U9,y$=Nr(jn),B9=function(e){return X(Gl(e),Yl(XR(Dr)))},b$=function(e){var t=B9(e);return function(n){return _t(n)?t(n):y$}},P9=function(e){return X(Gl(e),Yl(t$(Dr)))},C$=function(e){var t=P9(e);return function(n){return _t(n)?t(n):y$}},tbe=b$,W9=function(e){return b$(function(t,n){return e(n)})},nbe=W9(Q),rbe=C$,N9=function(e){return C$(function(t,n){return e(n)})},ibe=N9(Q),obe={URI:Ct,map:Pn,of:Nr,ap:vu,chain:yu,alt:p$,bimap:wb,mapLeft:_b,fromIO:gu,fromTask:Zf,throwError:cm},abe={URI:Ct,map:Pn,of:Nr,ap:f$,chain:yu,alt:p$,bimap:wb,mapLeft:_b,fromIO:gu,fromTask:Zf,throwError:cm},sbe=vn(T9),ube=$i(I9),lbe=function(e){return vn(MR)(_A(e))};function cbe(e){var t=S9(rm,e),n=w9(e);return{URI:Ct,_E:void 0,map:Pn,of:Nr,chain:yu,bimap:wb,mapLeft:_b,ap:t.ap,alt:n.alt,fromIO:gu,fromTask:Zf,throwError:cm}}function dbe(e,t){return e(t)()}const fbe=Object.freeze(Object.defineProperty({__proto__:null,Alt:E0e,ApT:y$,ApplicativePar:S0e,ApplicativeSeq:I9,ApplyPar:Ib,ApplySeq:T9,Bifunctor:I0e,Chain:Cr,Do:J0e,FromEither:ns,FromIO:Rb,FromReader:ep,FromTask:$b,Functor:sc,Monad:w0e,MonadIO:_0e,MonadTask:x0e,MonadThrow:T0e,Pointed:g$,URI:Ct,alt:Tb,altW:b9,ap:m$,apFirst:_9,apFirstW:b0e,apS:U9,apSW:ebe,apSecond:x9,apSecondW:C0e,apW:m0e,ask:R0e,asks:$0e,asksReaderTaskEither:a0e,asksReaderTaskEitherW:c9,bimap:h$,bind:D9,bindTo:Z0e,bindW:X0e,bracket:G0e,bracketW:L9,chain:xb,chainEitherK:M9,chainEitherKW:B0e,chainFirst:E9,chainFirstEitherK:F9,chainFirstEitherKW:P0e,chainFirstIOK:z0e,chainFirstReaderEitherK:A0e,chainFirstReaderEitherKW:v9,chainFirstReaderK:$9,chainFirstReaderKW:M0e,chainFirstReaderTaskK:j0e,chainFirstReaderTaskKW:O9,chainFirstTaskEitherK:p0e,chainFirstTaskEitherKW:m9,chainFirstTaskK:Y0e,chainFirstW:Eb,chainIOEitherK:d0e,chainIOEitherKW:h9,chainIOK:V0e,chainNullableK:i0e,chainOptionK:U0e,chainReaderEitherK:h0e,chainReaderEitherKW:g9,chainReaderK:R9,chainReaderKW:O0e,chainReaderTaskK:F0e,chainReaderTaskKW:k9,chainTaskEitherK:f0e,chainTaskEitherKW:A9,chainTaskK:H0e,chainW:Xf,filterOrElse:j9,filterOrElseW:N0e,flap:y0e,flatten:g0e,flattenW:y9,fold:Zye,foldW:Xye,fromEither:o9,fromEitherK:K0e,fromIO:gu,fromIOEither:s$,fromIOEitherK:p9,fromIOK:q0e,fromNullable:n0e,fromNullableK:r0e,fromOption:L0e,fromOptionK:D0e,fromPredicate:W0e,fromReader:a9,fromReaderEither:u$,fromReaderEitherK:d$,fromReaderK:k0e,fromReaderTaskK:v$,fromTask:Zf,fromTaskEither:mu,fromTaskEitherK:c$,fromTaskK:Q0e,getAltReaderTaskValidation:w9,getApplicativeReaderTaskValidation:S9,getApplyMonoid:ube,getApplySemigroup:sbe,getCompactable:C9,getFilterable:v0e,getOrElse:l9,getOrElseW:e0e,getReaderTaskValidation:cbe,getSemigroup:lbe,left:Sb,leftIO:i9,leftReader:n9,leftReaderTask:Gye,leftTask:t9,local:o0e,map:lm,mapLeft:A$,match:s9,matchE:l$,matchEW:u9,matchW:Jye,of:Nr,orElse:d9,orElseFirst:f9,orElseFirstW:u0e,orElseW:s0e,orLeft:l0e,readerTaskEither:obe,readerTaskEitherSeq:abe,right:r$,rightIO:a$,rightReader:o$,rightReaderTask:r9,rightTask:i$,run:dbe,sequenceArray:nbe,sequenceSeqArray:ibe,swap:c0e,throwError:cm,toUnion:t0e,traverseArray:W9,traverseArrayWithIndex:tbe,traverseReadonlyArrayWithIndex:b$,traverseReadonlyArrayWithIndexSeq:C$,traverseReadonlyNonEmptyArrayWithIndex:B9,traverseReadonlyNonEmptyArrayWithIndexSeq:P9,traverseSeqArray:N9,traverseSeqArrayWithIndex:rbe},Symbol.toStringTag,{value:"Module"}));var K9={equals:function(e,t){return e===t}},q9={concat:function(e,t){return e+t}},V9="",pbe={concat:q9.concat,empty:V9},Z={equals:K9.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},hbe={show:function(e){return JSON.stringify(e)}},Abe=function(e){return typeof e=="string"},mbe=function(e){return e.toUpperCase()},gbe=function(e){return e.toLowerCase()},vbe=function(e,t){return function(n){return n.replace(e,t)}},ybe=function(e){return e.trim()},bbe=function(e){return e.trimLeft()},Cbe=function(e){return e.trimRight()},Sbe=function(e,t){return function(n){return n.slice(e,t)}},wbe=function(e){return e.length===0},_be=function(e){return e.length},xbe=function(e){return function(t){var n=t.split(e);return No(n)?n:[t]}},Tbe=function(e,t){return function(n){return n.includes(e,t)}},Ibe=function(e,t){return function(n){return n.startsWith(e,t)}},Ebe=function(e,t){return function(n){return n.endsWith(e,t)}};const Rbe=Object.freeze(Object.defineProperty({__proto__:null,Eq:K9,Monoid:pbe,Ord:Z,Semigroup:q9,Show:hbe,empty:V9,endsWith:Ebe,includes:Tbe,isEmpty:wbe,isString:Abe,replace:vbe,size:_be,slice:Sbe,split:xbe,startsWith:Ibe,toLowerCase:gbe,toUpperCase:mbe,trim:ybe,trimLeft:bbe,trimRight:Cbe},Symbol.toStringTag,{value:"Module"}));var $be=function(e){return Object.assign({},e)},kbe=function(e){return Object.assign({},e)},z9=function(e){return Object.keys(e).length},Fo=function(e){for(var t in e)if(gt.call(e,t))return!1;return!0},tp=function(e){return function(t){return Object.keys(t).sort(e.compare)}},Obe=tp(Z);function kb(e){if(typeof e=="function")return kb(Z)(e);var t=tp(e);return function(n){return function(r){for(var i=[],o=0,a=t(r);o<a.length;o++){var s=a[o];i.push(n(s,r[s]))}return i}}}var S$=kb(Z)(function(e,t){return[e,t]});function Mbe(e){return function(t){var n=S$(t),r=n.length;return e.unfold(0,function(i){return i<r?ye([n[i],i+1]):Re})}}var w$=function(e,t){return function(n){if(gt.call(n,e)&&n[e]===t)return n;var r=Object.assign({},n);return r[e]=t,r}},wa=function(e,t){return gt.call(t,e)};function _$(e){return function(t){if(!gt.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}var Fbe=function(e,t){return function(n){if(!wa(e,n))return Re;if(n[e]===t)return ye(n);var r=Object.assign({},n);return r[e]=t,ye(r)}},jbe=function(e,t){return function(n){if(!wa(e,n))return Re;var r=t(n[e]);if(r===n[e])return ye(n);var i=Object.assign({},n);return i[e]=r,ye(i)}};function Lbe(e){var t=_$(e);return function(n){var r=cl(e,n);return en(r)?Re:ye([r.value,t(n)])}}function Ob(e){return function(t,n){if(n===void 0){var r=Ob(e);return function(o){return r(o,t)}}for(var i in t)if(!gt.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function cl(e,t){return t===void 0?function(n){return cl(e,n)}:gt.call(t,e)?ye(t[e]):Re}var dm={};function Mb(e){return function(t){var n={};for(var r in t)gt.call(t,r)&&(n[r]=e(r,t[r]));return n}}function x$(e){return Mb(function(t,n){return e(n)})}function Ad(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===2)return Ad(Z).apply(void 0,e);var n=tp(e[0]);return function(r,i){return function(o){for(var a=r,s=n(o),u=s.length,l=0;l<u;l++){var c=s[l];a=i(c,a,o[c])}return a}}}function md(e){if("compare"in e){var t=tp(e);return function(n){return function(r){return function(i){for(var o=n.empty,a=t(i),s=a.length,u=0;u<s;u++){var l=a[u];o=n.concat(o,r(l,i[l]))}return o}}}}return md(Z)(e)}function gd(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===2)return gd(Z).apply(void 0,e);var n=tp(e[0]);return function(r,i){return function(o){for(var a=r,s=n(o),u=s.length,l=u-1;l>=0;l--){var c=s[l];a=i(c,o[c],a)}return a}}}var Q9=function(e,t){var n;return n={},n[e]=t,n};function H9(e){var t=pm(Z)(e);return function(n){return function(r){return t(r,n)}}}function Fb(e){var t=Xo(Z)(e);return function(n){return function(r){return t(r,n)}}}function np(e){return fm(Z)(e)}var Dbe=function(e){var t=Fb(e);return function(n){return function(r){return e.map(x(r,t(n)),rs)}}},Ube=function(e){var t=Fb(e);return function(n){return function(r){return e.map(x(r,t(n)),is)}}};function jb(e){return function(t){var n={},r={};for(var i in t)if(gt.call(t,i)){var o=e(i,t[i]);switch(o._tag){case"Left":n[i]=o.left;break;case"Right":r[i]=o.right;break}}return Be(n,r)}}function Lb(e){return function(t){var n={},r={};for(var i in t)if(gt.call(t,i)){var o=t[i];e(i,o)?r[i]=o:n[i]=o}return Be(n,r)}}function Db(e){return function(t){var n={};for(var r in t)if(gt.call(t,r)){var i=e(r,t[r]);$t(i)&&(n[r]=i.value)}return n}}function Ub(e){return function(t){var n={},r=!1;for(var i in t)if(gt.call(t,i)){var o=t[i];e(i,o)?n[i]=o:r=!0}return r?n:t}}function Y9(e,t){var n=T$(e,t);return function(r){return n(r,Q)}}function T$(e,t){return function(n,r){return t.reduce(n,{},function(i,o){var a=r(o),s=a[0],u=a[1];return i[s]=gt.call(i,s)?e.concat(i[s],u):u,i})}}var Bbe=S$,Pbe=function(e){for(var t={},n=0,r=e;n<r.length;n++){var i=r[n];t[i[0]]=i[1]}return t};function G9(e){return function(t){for(var n in t)if(!e(t[n]))return!1;return!0}}function J9(e){return function(t){for(var n in t)if(e(t[n]))return!0;return!1}}function I$(e){return function(t,n){if(n===void 0){var r=I$(e);return function(o){return r(t,o)}}for(var i in n)if(e.equals(n[i],t))return!0;return!1}}var E$=function(e){return function(t){return function(n){if(Fo(n))return t;if(Fo(t))return n;var r={};for(var i in n)wa(i,t)?r[i]=e.concat(n[i],t[i]):r[i]=n[i];for(var i in t)wa(i,r)||(r[i]=t[i]);return r}}},R$=function(e){return function(t){return function(n){if(Fo(n)||Fo(t))return dm;var r={};for(var i in n)wa(i,t)&&(r[i]=e.concat(n[i],t[i]));return r}}},$$=function(e){return function(t){if(Fo(t))return e;if(Fo(e))return t;var n={};for(var r in t)wa(r,e)||(n[r]=t[r]);for(var r in e)wa(r,t)||(n[r]=e[r]);return n}},hi=function(e,t){return x(e,x$(t))},uc=function(e,t){return x(e,Mb(t))},Ai=function(e){var t=uh(e);return function(n,r,i){return x(n,t(r,i))}},mi=function(e){return function(t){var n=lh(e)(t);return function(r,i){return x(r,n(i))}}},gi=function(e){var t=ch(e);return function(n,r,i){return x(n,t(r,i))}},lc=function(e,t){return x(e,k$(t))},cc=function(e,t){return x(e,O$(t))},dc=function(e,t){return x(e,M$(t))},fc=function(e,t){return x(e,F$(t))},pc=function(e){var t=Ad(e);return function(n,r,i){return x(n,t(r,i))}},hc=function(e){var t=md(e);return function(n){var r=t(n);return function(i,o){return x(i,r(o))}}},Ac=function(e){var t=gd(e);return function(n,r,i){return x(n,t(r,i))}},Bb=function(e,t){return x(e,jb(t))},Pb=function(e,t){return x(e,Lb(t))},Wb=function(e,t){return x(e,Db(t))},Nb=function(e,t){return x(e,Ub(t))},Xo=function(e){var t=pm(e);return function(n){var r=t(n);return function(i,o){return r(i,X(Dr,o))}}},fm=function(e){var t=Xo(e);return function(n){var r=t(n);return function(i){return r(i,Q)}}},pm=function(e){return function(t){var n=tp(e);return function(r,i){var o=n(r);if(o.length===0)return t.of(dm);for(var a=t.of({}),s=function(f){a=t.ap(t.map(a,function(p){return function(h){var A;return Object.assign({},p,(A={},A[f]=h,A))}}),i(f,r[f]))},u=0,l=o;u<l.length;u++){var c=l[u];s(c)}return a}}},k$=function(e){return Ub(function(t,n){return e(n)})},O$=function(e){return Db(function(t,n){return e(n)})},M$=function(e){return Lb(function(t,n){return e(n)})},F$=function(e){return jb(function(t,n){return e(n)})};function uh(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===1){var n=Ad(e[0]);return function(r,i){return n(r,function(o,a,s){return i(a,s)})}}return uh(Z).apply(void 0,e)}function lh(e){if("compare"in e){var t=md(e);return function(n){var r=t(n);return function(i){return r(function(o,a){return i(a)})}}}return lh(Z)(e)}function ch(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===1){var n=gd(e[0]);return function(r,i){return n(r,function(o,a,s){return i(a,s)})}}return ch(Z).apply(void 0,e)}var rs=function(e){var t={};for(var n in e)if(gt.call(e,n)){var r=e[n];$t(r)&&(t[n]=r.value)}return t},is=function(e){var t={},n={};for(var r in e)if(gt.call(e,r)){var i=e[r];An(i)?t[r]=i.left:n[r]=i.right}return Be(t,n)},Wn="ReadonlyRecord";function fv(e){return"compare"in e?function(t){return{show:function(n){var r=kb(e)(function(i,o){return"".concat(JSON.stringify(i),": ").concat(t.show(o))})(n).join(", ");return r===""?"{}":"{ ".concat(r," }")}}}:fv(Z)(e)}function Z9(e){var t=Ob(e);return ki(function(n,r){return t(n)(r)&&t(r)(n)})}function X9(e){return{concat:function(t,n){if(Fo(t))return n;if(Fo(n))return t;var r=Object.assign({},t);for(var i in n)gt.call(n,i)&&(r[i]=gt.call(t,i)?e.concat(t[i],n[i]):n[i]);return r},empty:dm}}var e8={URI:Wn,map:hi},Wbe=He(e8),Nbe={URI:Wn,map:hi,mapWithIndex:uc},Kbe=function(e){return{URI:Wn,reduce:Ai(e),foldMap:mi(e),reduceRight:gi(e)}},qbe=function(e){return{URI:Wn,reduce:Ai(e),foldMap:mi(e),reduceRight:gi(e),reduceWithIndex:pc(e),foldMapWithIndex:hc(e),reduceRightWithIndex:Ac(e)}},dh={URI:Wn,compact:rs,separate:is},Vbe={URI:Wn,map:hi,compact:rs,separate:is,filter:lc,filterMap:cc,partition:dc,partitionMap:fc},zbe={URI:Wn,map:hi,mapWithIndex:uc,compact:rs,separate:is,filter:lc,filterMap:cc,partition:dc,partitionMap:fc,filterMapWithIndex:Wb,filterWithIndex:Nb,partitionMapWithIndex:Bb,partitionWithIndex:Pb},t8=function(e){return{URI:Wn,map:hi,reduce:Ai(e),foldMap:mi(e),reduceRight:gi(e),traverse:Xo(e),sequence:fm(e)}},Qbe=function(e){return{URI:Wn,map:hi,mapWithIndex:uc,reduce:Ai(e),foldMap:mi(e),reduceRight:gi(e),reduceWithIndex:pc(e),foldMapWithIndex:hc(e),reduceRightWithIndex:Ac(e),traverse:Xo(e),sequence:fm(e),traverseWithIndex:pm(e)}},Hbe=function(e){var t=t8(e);return{URI:Wn,map:hi,reduce:Ai(e),foldMap:mi(e),reduceRight:gi(e),traverse:t.traverse,sequence:t.sequence,compact:rs,separate:is,filter:lc,filterMap:cc,partition:dc,partitionMap:fc,wither:ro(t,dh),wilt:no(t,dh)}},n8=function(e){var t=E$(e);return{concat:function(n,r){return t(r)(n)}}},Ybe=function(e){return{concat:n8(e).concat,empty:dm}},Gbe=function(e){var t=R$(e);return{concat:function(n,r){return t(r)(n)}}},Jbe=function(){return{concat:function(e,t){return $$(t)(e)}}},Zbe={URI:Wn,reduce:Ai(Z),foldMap:mi(Z),reduceRight:gi(Z)},Xbe={URI:Wn,reduce:Ai(Z),foldMap:mi(Z),reduceRight:gi(Z),reduceWithIndex:pc(Z),foldMapWithIndex:hc(Z),reduceRightWithIndex:Ac(Z)},j$={URI:Wn,map:hi,reduce:Ai(Z),foldMap:mi(Z),reduceRight:gi(Z),traverse:Xo(Z),sequence:np},e1e={URI:Wn,map:hi,mapWithIndex:uc,reduce:Ai(Z),foldMap:mi(Z),reduceRight:gi(Z),reduceWithIndex:pc(Z),foldMapWithIndex:hc(Z),reduceRightWithIndex:Ac(Z),traverse:Xo(Z),sequence:np,traverseWithIndex:pm(Z)},r8=ro(j$,dh),i8=no(j$,dh),t1e={URI:Wn,map:hi,reduce:Ai(Z),foldMap:mi(Z),reduceRight:gi(Z),traverse:Xo(Z),sequence:np,compact:rs,separate:is,filter:lc,filterMap:cc,partition:dc,partitionMap:fc,wither:r8,wilt:i8},L$=w$;function o8(e,t){return gt.call(t===void 0?this:t,e)}var n1e={URI:Wn,map:hi,reduce:Ai(Z),foldMap:mi(Z),reduceRight:gi(Z),traverse:Xo(Z),sequence:np,compact:rs,separate:is,filter:lc,filterMap:cc,partition:dc,partitionMap:fc,mapWithIndex:uc,reduceWithIndex:pc(Z),foldMapWithIndex:hc(Z),reduceRightWithIndex:Ac(Z),filterMapWithIndex:Wb,filterWithIndex:Nb,partitionMapWithIndex:Bb,partitionWithIndex:Pb,traverseWithIndex:pm(Z),wither:r8,wilt:i8};const r1e=Object.freeze(Object.defineProperty({__proto__:null,Compactable:dh,Filterable:Vbe,FilterableWithIndex:zbe,Foldable:Zbe,FoldableWithIndex:Xbe,Functor:e8,FunctorWithIndex:Nbe,Traversable:j$,TraversableWithIndex:e1e,URI:Wn,Witherable:t1e,_filter:lc,_filterMap:cc,_filterMapWithIndex:Wb,_filterWithIndex:Nb,_foldMap:mi,_foldMapWithIndex:hc,_map:hi,_mapWithIndex:uc,_partition:dc,_partitionMap:fc,_partitionMapWithIndex:Bb,_partitionWithIndex:Pb,_reduce:Ai,_reduceRight:gi,_reduceRightWithIndex:Ac,_reduceWithIndex:pc,_sequence:fm,_traverse:Xo,collect:kb,compact:rs,deleteAt:_$,difference:$$,elem:I$,empty:dm,every:G9,filter:k$,filterMap:O$,filterMapWithIndex:Db,filterWithIndex:Ub,flap:Wbe,foldMap:lh,foldMapWithIndex:md,fromEntries:Pbe,fromFoldable:Y9,fromFoldableMap:T$,fromRecord:$be,getDifferenceMagma:Jbe,getEq:Z9,getFoldable:Kbe,getFoldableWithIndex:qbe,getIntersectionSemigroup:Gbe,getMonoid:X9,getShow:fv,getTraversable:t8,getTraversableWithIndex:Qbe,getUnionMonoid:Ybe,getUnionSemigroup:n8,getWitherable:Hbe,has:wa,hasOwnProperty:o8,insertAt:L$,intersection:R$,isEmpty:Fo,isSubrecord:Ob,keys:Obe,lookup:cl,map:x$,mapWithIndex:Mb,modifyAt:jbe,partition:M$,partitionMap:F$,partitionMapWithIndex:jb,partitionWithIndex:Lb,pop:Lbe,readonlyRecord:n1e,reduce:uh,reduceRight:ch,reduceRightWithIndex:gd,reduceWithIndex:Ad,separate:is,sequence:np,singleton:Q9,size:z9,some:J9,toEntries:Bbe,toReadonlyArray:S$,toRecord:kbe,toUnfoldable:Mbe,traverse:Fb,traverseWithIndex:H9,union:E$,updateAt:Fbe,upsertAt:w$,wilt:Ube,wither:Dbe},Symbol.toStringTag,{value:"Module"}));var i1e=function(e){return new Set(e)},o1e=function(e){return new Set([e])},a8=function(e){return function(t){for(var n=t.length,r=new Set,i=Mn(e),o=0;o<n;o++){var a=t[o];i(a,r)||r.add(a)}return r}};function a1e(e){return new Set(e)}function s1e(e){var t=Mn(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);t(a,i)||i.add(a)}),i}}}function u1e(e){var t=Mn(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){n(o).forEach(function(a){t(a,i)||i.add(a)})}),i}}}function D$(e){return function(t){for(var n=t.values(),r,i=new Set;!(r=n.next()).done;){var o=r.value;e(o)&&i.add(o)}return i}}function l1e(e){return function(t){for(var n=t.values(),r,i=new Set,o=new Set;!(r=n.next()).done;){var a=r.value;e(a)?i.add(a):o.add(a)}return Be(o,i)}}function U$(e){var t=Mn(e);return function(n,r){if(r===void 0){var i=U$(e);return function(a){return i(n,a)}}if(fh(n))return r;if(fh(r))return n;var o=new Set(n);return r.forEach(function(a){t(a,o)||o.add(a)}),o}}function B$(e){var t=Mn(e);return function(n,r){if(r===void 0){var i=B$(e);return function(a){return i(a,n)}}if(fh(n)||fh(r))return W$;var o=new Set;return n.forEach(function(a){t(a,r)&&o.add(a)}),o}}function c1e(e,t){return function(n){return function(r){for(var i=r.values(),o,a=new Set,s=new Set,u=Mn(e),l=Mn(t);!(o=i.next()).done;){var c=n(o.value);switch(c._tag){case"Left":u(c.left,a)||a.add(c.left);break;case"Right":l(c.right,s)||s.add(c.right);break}}return Be(a,s)}}}function P$(e){var t=Mn(e);return function(n,r){if(r===void 0){var i=P$(e);return function(o){return i(o,n)}}return D$(function(o){return!t(o,r)})(n)}}function s8(e){var t=Kb(e);return function(n,r){return function(i){return t(i).reduce(r,n)}}}function u8(e,t){var n=Kb(e);return function(r){return function(i){return n(i).reduce(function(o,a){return t.concat(o,r(a))},t.empty)}}}var l8=function(e){var t=Kb(e);return function(n,r){return function(i){return t(i).reduceRight(function(o,a){return r(a,o)},n)}}};function c8(e){var t=Mn(e);return function(n){return function(r){if(t(n)(r))return r;var i=new Set(r);return i.add(n),i}}}var d8=function(e){return function(t){return function(n){return D$(function(r){return!e.equals(t,r)})(n)}}},d1e=function(e){var t=Mn(e),n=d8(e),r=c8(e);return function(i){return function(o){return(t(i,o)?n:r)(i)(o)}}},f1e=function(e){return f8(e)(Q)};function p1e(e,t){return function(n){var r=Mn(e),i=Mn(t),o=new Set,a=new Set;return n.forEach(function(s){switch(s._tag){case"Left":r(s.left,o)||o.add(s.left);break;case"Right":i(s.right,a)||a.add(s.right);break}}),Be(o,a)}}function f8(e){var t=Mn(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);a._tag==="Some"&&!t(a.value,i)&&i.add(a.value)}),i}}}var W$=new Set,fh=function(e){return e.size===0},h1e=function(e){return e.size},N$=function(e){return function(t){for(var n=t.values(),r,i=!1;!i&&!(r=n.next()).done;)i=e(r.value);return i}};function K$(e){return oh(N$(oh(e)))}function hm(e){var t=Mn(e);return function(n,r){if(r===void 0){var i=hm(e);return function(o){return i(o,n)}}return K$(function(o){return t(o,r)})(n)}}function Mn(e){return function(t,n){if(n===void 0){var r=Mn(e);return function(s){return r(t,s)}}for(var i=n.values(),o,a=!1;!a&&!(o=i.next()).done;)a=e.equals(t,o.value);return a}}var Kb=function(e){return function(t){var n=[];return t.forEach(function(r){return n.push(r)}),n.sort(e.compare)}},A1e="ReadonlySet";function p8(e){return{show:function(t){var n=[];return t.forEach(function(r){n.push(e.show(r))}),"new Set([".concat(n.sort().join(", "),"])")}}}function h8(e){var t=hm(e);return ki(function(n,r){return t(n,r)&&t(r,n)})}var A8=function(e){return{concat:U$(e)}},m1e=function(e){return{concat:A8(e).concat,empty:W$}},g1e=function(e){return{concat:B$(e)}},v1e=function(e){return{concat:P$(e)}},y1e=a8;const b1e=Object.freeze(Object.defineProperty({__proto__:null,URI:A1e,chain:u1e,compact:f1e,difference:P$,elem:Mn,empty:W$,every:K$,filter:D$,filterMap:f8,foldMap:u8,fromArray:y1e,fromReadonlyArray:a8,fromSet:i1e,getDifferenceMagma:v1e,getEq:h8,getIntersectionSemigroup:g1e,getShow:p8,getUnionMonoid:m1e,getUnionSemigroup:A8,insert:c8,intersection:B$,isEmpty:fh,isSubset:hm,map:s1e,partition:l1e,partitionMap:c1e,reduce:s8,reduceRight:l8,remove:d8,separate:p1e,singleton:o1e,size:h1e,some:N$,toReadonlyArray:Kb,toSet:a1e,toggle:d1e,union:U$},Symbol.toStringTag,{value:"Module"}));function mn(e){return e[0]}function Jn(e){return e[1]}var C1e=function(e){return[Jn(e),mn(e)]};function q$(e){return{URI:vi,_E:void 0,map:Am,ap:function(t,n){return[mn(t)(mn(n)),e.concat(Jn(t),Jn(n))]}}}var m8=function(e){return function(t){return[t,e.empty]}};function S1e(e){var t=q$(e);return{URI:vi,_E:void 0,map:t.map,ap:t.ap,of:m8(e)}}function V$(e){var t=q$(e);return{URI:vi,_E:void 0,map:t.map,ap:t.ap,chain:function(n,r){var i=r(mn(n)),o=i[0],a=i[1];return[o,e.concat(Jn(n),a)]}}}function w1e(e){var t=V$(e);return{URI:vi,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,of:m8(e)}}function _1e(e){var t=function(r,i){for(var o=i(r),a=e.empty,s=mn(o);s._tag==="Left";)a=e.concat(a,Jn(o)),o=i(s.left),s=mn(o);return[s.right,e.concat(a,Jn(o))]},n=V$(e);return{URI:vi,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,chainRec:t}}var g8=function(e,t){return x(e,w8(t))},Am=function(e,t){return x(e,Y$(t))},v8=function(e,t,n){return x(e,S8(t,n))},y8=function(e,t){return x(e,G$(t))},b8=function(e,t){return x(e,J$(t))},z$=function(e,t,n){return x(e,Z$(t,n))},Q$=function(e){var t=X$();return function(n,r){return x(n,t(r))}},H$=function(e,t,n){return x(e,ek(t,n))},C8=function(e){var t=_8(e);return function(n,r){return x(n,t(r))}},S8=function(e,t){return function(n){return[t(mn(n)),e(Jn(n))]}},Y$=function(e){return function(t){return[e(mn(t)),Jn(t)]}},G$=function(e){return function(t){return[mn(t),e(Jn(t))]}},w8=function(e){return function(t){return[mn(t),Jn(e)]}},J$=function(e){return function(t){return[e(t),Jn(t)]}},qb=mn,x1e=J$(Q),Z$=function(e,t){return function(n){return t(e,mn(n))}},X$=function(){return function(e){return function(t){return e(mn(t))}}},ek=function(e,t){return function(n){return t(mn(n),e)}},_8=function(e){return function(t){return function(n){return e.map(t(mn(n)),function(r){return[r,Jn(n)]})}}},tk=function(e){return function(t){return e.map(mn(t),function(n){return[n,Jn(t)]})}},vi="ReadonlyTuple",x8={URI:vi,map:Am},T1e=He(x8),I1e={URI:vi,bimap:v8,mapLeft:y8},E1e={URI:vi,compose:g8},R1e={URI:vi,map:Am,extend:b8,extract:qb},$1e={URI:vi,reduce:z$,foldMap:Q$,reduceRight:H$},k1e={URI:vi,map:Am,reduce:z$,foldMap:Q$,reduceRight:H$,traverse:C8,sequence:tk},O1e=Y$,M1e=G$,F1e={URI:vi,compose:g8,map:Am,bimap:v8,mapLeft:y8,extract:qb,extend:b8,reduce:z$,foldMap:Q$,reduceRight:H$,traverse:C8,sequence:tk};const j1e=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:I1e,Comonad:R1e,Foldable:$1e,Functor:x8,Semigroupoid:E1e,Traversable:k1e,URI:vi,bimap:S8,compose:w8,duplicate:x1e,extend:J$,extract:qb,flap:T1e,foldMap:X$,fst:mn,getApplicative:S1e,getApply:q$,getChain:V$,getChainRec:_1e,getMonad:w1e,map:O1e,mapFst:Y$,mapLeft:M1e,mapSnd:G$,readonlyTuple:F1e,reduce:Z$,reduceRight:ek,sequence:tk,snd:Jn,swap:C1e,traverse:_8},Symbol.toStringTag,{value:"Module"}));var vd=function(){return vd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},vd.apply(this,arguments)},L1e=z9,dl=Fo,nk=function(e){return function(t){return Object.keys(t).sort(e.compare)}},D1e=nk(Z);function rk(e){if(typeof e=="function")return rk(Z)(e);var t=nk(e);return function(n){return function(r){for(var i=[],o=0,a=t(r);o<a.length;o++){var s=a[o];i.push(n(s,r[s]))}return i}}}var ik=rk(Z)(function(e,t){return[e,t]});function U1e(e){return function(t){var n=ik(t),r=n.length;return e.unfold(0,function(i){return i<r?ye([n[i],i+1]):Re})}}var T8=w$,I8=wa;function E8(e){return function(t){if(!gt.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}var B1e=function(e,t){return R8(e,function(){return t})},R8=function(e,t){return function(n){if(!I8(e,n))return Re;var r=Object.assign({},n);return r[e]=t(n[e]),ye(r)}};function P1e(e){var t=E8(e);return function(n){var r=$8(e,n);return en(r)?Re:ye([r.value,t(n)])}}var W1e=Ob,$8=cl,N1e=Mb,K1e=x$;function q1e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?Ad(e[0]):Ad(Z).apply(void 0,e)}function V1e(e){return"compare"in e?md(e):md(Z)(e)}function z1e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?gd(e[0]):gd(Z).apply(void 0,e)}var Q1e=Q9;function H1e(e){return H9(e)}function ok(e){return Fb(e)}function mm(e){return np(e)}var Y1e=function(e){var t=ok(e);return function(n){return function(r){return e.map(x(r,t(n)),bu)}}},G1e=function(e){var t=ok(e);return function(n){return function(r){return e.map(x(r,t(n)),Cu)}}},J1e=jb;function Z1e(e){return Lb(e)}var X1e=Db;function eCe(e){return Ub(e)}function k8(e,t){return Y9(e,t)}var tCe=ik,nCe=function(e){return k8(by(),XW)(e)};function rCe(e,t){return T$(e,t)}var iCe=G9,oCe=J9,aCe=I$,O8=function(e){var t=E$(e);return function(n){return function(r){return dl(r)?vd({},n):dl(n)?vd({},r):t(n)(r)}}},M8=function(e){return function(t){return function(n){return dl(n)||dl(t)?{}:R$(e)(t)(n)}}},F8=function(e){return function(t){return dl(t)?vd({},e):dl(e)?vd({},t):$$(e)(t)}},lo=hi,gm=uc,co=Ai,fo=mi,po=gi,vm=lc,ym=cc,bm=dc,Cm=fc,Sm=pc,wm=hc,_m=Ac,j8=Bb,L8=Pb,D8=Wb,U8=Nb,rp=Xo,B8=fm,ak=function(e){return function(t){var n=nk(e);return function(r,i){var o=n(r);if(o.length===0)return t.of({});for(var a=t.of({}),s=function(f){a=t.ap(t.map(a,function(p){return function(h){return p[f]=h,p}}),i(f,r[f]))},u=0,l=o;u<l.length;u++){var c=l[u];s(c)}return a}}},sCe=k$,uCe=O$,lCe=M$,cCe=F$;function dCe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?uh(e[0]):uh(Z).apply(void 0,e)}function fCe(e){return"compare"in e?lh(e):lh(Z)(e)}function pCe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?ch(e[0]):ch(Z).apply(void 0,e)}var bu=rs,Cu=is,Nn="Record";function hCe(e){return"compare"in e?fv(e):fv(Z)(e)}var ACe=Z9,mCe=X9,P8={URI:Nn,map:lo},gCe=He(P8),vCe={URI:Nn,map:lo,mapWithIndex:gm},yCe=function(e){return{URI:Nn,reduce:co(e),foldMap:fo(e),reduceRight:po(e)}},bCe=function(e){return{URI:Nn,reduce:co(e),foldMap:fo(e),reduceRight:po(e),reduceWithIndex:Sm(e),foldMapWithIndex:wm(e),reduceRightWithIndex:_m(e)}},ph={URI:Nn,compact:bu,separate:Cu},CCe={URI:Nn,map:lo,compact:bu,separate:Cu,filter:vm,filterMap:ym,partition:bm,partitionMap:Cm},SCe={URI:Nn,map:lo,mapWithIndex:gm,compact:bu,separate:Cu,filter:vm,filterMap:ym,partition:bm,partitionMap:Cm,filterMapWithIndex:D8,filterWithIndex:U8,partitionMapWithIndex:j8,partitionWithIndex:L8},W8=function(e){return{URI:Nn,map:lo,reduce:co(e),foldMap:fo(e),reduceRight:po(e),traverse:rp(e),sequence:B8(e)}},wCe=function(e){return{URI:Nn,map:lo,mapWithIndex:gm,reduce:co(e),foldMap:fo(e),reduceRight:po(e),reduceWithIndex:Sm(e),foldMapWithIndex:wm(e),reduceRightWithIndex:_m(e),traverse:rp(e),sequence:B8(e),traverseWithIndex:ak(e)}},_Ce=function(e){var t=W8(e);return{URI:Nn,map:lo,reduce:co(e),foldMap:fo(e),reduceRight:po(e),traverse:t.traverse,sequence:t.sequence,compact:bu,separate:Cu,filter:vm,filterMap:ym,partition:bm,partitionMap:Cm,wither:ro(t,ph),wilt:no(t,ph)}},N8=function(e){var t=O8(e);return{concat:function(n,r){return t(r)(n)}}},xCe=function(e){return{concat:N8(e).concat,empty:{}}},TCe=function(e){var t=M8(e);return{concat:function(n,r){return t(r)(n)}}},ICe=function(){return{concat:function(e,t){return F8(t)(e)}}},ECe={URI:Nn,reduce:co(Z),foldMap:fo(Z),reduceRight:po(Z)},RCe={URI:Nn,reduce:co(Z),foldMap:fo(Z),reduceRight:po(Z),reduceWithIndex:Sm(Z),foldMapWithIndex:wm(Z),reduceRightWithIndex:_m(Z)},sk={URI:Nn,map:lo,reduce:co(Z),foldMap:fo(Z),reduceRight:po(Z),traverse:rp(Z),sequence:mm},$Ce={URI:Nn,map:lo,mapWithIndex:gm,reduce:co(Z),foldMap:fo(Z),reduceRight:po(Z),reduceWithIndex:Sm(Z),foldMapWithIndex:wm(Z),reduceRightWithIndex:_m(Z),traverse:rp(Z),sequence:mm,traverseWithIndex:ak(Z)},K8=ro(sk,ph),q8=no(sk,ph),kCe={URI:Nn,map:lo,reduce:co(Z),foldMap:fo(Z),reduceRight:po(Z),traverse:rp(Z),sequence:mm,compact:bu,separate:Cu,filter:vm,filterMap:ym,partition:bm,partitionMap:Cm,wither:K8,wilt:q8},OCe={},MCe=T8,FCe=o8,jCe={URI:Nn,map:lo,reduce:co(Z),foldMap:fo(Z),reduceRight:po(Z),traverse:rp(Z),sequence:mm,compact:bu,separate:Cu,filter:vm,filterMap:ym,partition:bm,partitionMap:Cm,mapWithIndex:gm,reduceWithIndex:Sm(Z),foldMapWithIndex:wm(Z),reduceRightWithIndex:_m(Z),filterMapWithIndex:D8,filterWithIndex:U8,partitionMapWithIndex:j8,partitionWithIndex:L8,traverseWithIndex:ak(Z),wither:K8,wilt:q8};const LCe=Object.freeze(Object.defineProperty({__proto__:null,Compactable:ph,Filterable:CCe,FilterableWithIndex:SCe,Foldable:ECe,FoldableWithIndex:RCe,Functor:P8,FunctorWithIndex:vCe,Traversable:sk,TraversableWithIndex:$Ce,URI:Nn,Witherable:kCe,collect:rk,compact:bu,deleteAt:E8,difference:F8,elem:aCe,empty:OCe,every:iCe,filter:sCe,filterMap:uCe,filterMapWithIndex:X1e,filterWithIndex:eCe,flap:gCe,foldMap:fCe,foldMapWithIndex:V1e,fromEntries:nCe,fromFoldable:k8,fromFoldableMap:rCe,getDifferenceMagma:ICe,getEq:ACe,getFoldable:yCe,getFoldableWithIndex:bCe,getIntersectionSemigroup:TCe,getMonoid:mCe,getShow:hCe,getTraversable:W8,getTraversableWithIndex:wCe,getUnionMonoid:xCe,getUnionSemigroup:N8,getWitherable:_Ce,has:I8,hasOwnProperty:FCe,insertAt:MCe,intersection:M8,isEmpty:dl,isSubrecord:W1e,keys:D1e,lookup:$8,map:K1e,mapWithIndex:N1e,modifyAt:R8,partition:lCe,partitionMap:cCe,partitionMapWithIndex:J1e,partitionWithIndex:Z1e,pop:P1e,record:jCe,reduce:dCe,reduceRight:pCe,reduceRightWithIndex:z1e,reduceWithIndex:q1e,separate:Cu,sequence:mm,singleton:Q1e,size:L1e,some:oCe,toArray:ik,toEntries:tCe,toUnfoldable:U1e,traverse:ok,traverseWithIndex:H1e,union:O8,updateAt:B1e,upsertAt:T8,wilt:G1e,wither:Y1e},Symbol.toStringTag,{value:"Module"}));var DCe=function(e){return function(t){return $t(e(t))}},UCe=function(e){return function(t){return hx(e(t))}},BCe=function(){return function(e){return!0}},PCe=function(e){return function(t){return!e(t)}},WCe=function(e){return function(t){return function(n){return t(n)||e(n)}}},NCe=function(e){return function(t){return function(n){return t(n)&&e(n)}}},KCe=function(){return function(e){return!1}},qCe=function(e){return function(t){return function(n){return t(n)&&e(n)}}};const VCe=Object.freeze(Object.defineProperty({__proto__:null,and:NCe,compose:qCe,fromEitherK:UCe,fromOptionK:DCe,id:BCe,not:PCe,or:WCe,zero:KCe},Symbol.toStringTag,{value:"Module"}));var V8=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{add:function(n,r){return e.map(function(i,o){return i.add(n[o],r[o])})},zero:e.map(function(n){return n.zero}),mul:function(n,r){return e.map(function(i,o){return i.mul(n[o],r[o])})},one:e.map(function(n){return n.one}),sub:function(n,r){return e.map(function(i,o){return i.sub(n[o],r[o])})}}},zCe=function(e){return function(t){return e.sub(e.zero,t)}},QCe=V8,HCe=kU;const YCe=Object.freeze(Object.defineProperty({__proto__:null,getFunctionRing:HCe,getTupleRing:QCe,negate:zCe,tuple:V8},Symbol.toStringTag,{value:"Module"})),GCe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var JCe=dx;const ZCe=Object.freeze(Object.defineProperty({__proto__:null,getFunctionSemiring:JCe},Symbol.toStringTag,{value:"Module"}));var XCe=p8,eSe=h8;function tSe(e){var t=Fr(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);t(a,i)||i.add(a)}),i}}}function nSe(e){var t=Fr(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){n(o).forEach(function(a){t(a,i)||i.add(a)})}),i}}}function uk(e){return function(t){for(var n=t.values(),r,i=new Set;!(r=n.next()).done;){var o=r.value;e(o)&&i.add(o)}return i}}function rSe(e){return function(t){for(var n=t.values(),r,i=new Set,o=new Set;!(r=n.next()).done;){var a=r.value;e(a)?i.add(a):o.add(a)}return Be(o,i)}}function lk(e){var t=Fr(e);return function(n,r){if(r===void 0){var i=lk(e);return function(a){return i(n,a)}}if(hh(n))return r;if(hh(r))return n;var o=new Set(n);return r.forEach(function(a){t(a,o)||o.add(a)}),o}}function ck(e){var t=Fr(e);return function(n,r){if(r===void 0){var i=ck(e);return function(a){return i(a,n)}}if(hh(n)||hh(r))return new Set;var o=new Set;return n.forEach(function(a){t(a,r)&&o.add(a)}),o}}function iSe(e,t){return function(n){return function(r){for(var i=r.values(),o,a=new Set,s=new Set,u=Fr(e),l=Fr(t);!(o=i.next()).done;){var c=n(o.value);switch(c._tag){case"Left":u(c.left,a)||a.add(c.left);break;case"Right":l(c.right,s)||s.add(c.right);break}}return Be(a,s)}}}function dk(e){var t=Fr(e);return function(n,r){if(r===void 0){var i=dk(e);return function(o){return i(o,n)}}return uk(function(o){return!t(o,r)})(n)}}var z8=function(e){return{concat:lk(e)}},oSe=function(e){return{concat:z8(e).concat,empty:new Set}},aSe=function(e){return{concat:ck(e)}},sSe=function(e){return{concat:dk(e)}},uSe=s8,lSe=u8,cSe=l8,dSe=function(e){return new Set([e])};function Q8(e){var t=Fr(e);return function(n){return function(r){if(t(n)(r))return r;var i=new Set(r);return i.add(n),i}}}var H8=function(e){return function(t){return function(n){return uk(function(r){return!e.equals(t,r)})(n)}}},fSe=function(e){var t=Fr(e),n=H8(e),r=Q8(e);return function(i){return function(o){return(t(i,o)?n:r)(i)(o)}}},Y8=function(e){return function(t){for(var n=t.length,r=new Set,i=Fr(e),o=0;o<n;o++){var a=t[o];i(a,r)||r.add(a)}return r}},pSe=function(e){return G8(e)(Q)};function hSe(e,t){return function(n){var r=Fr(e),i=Fr(t),o=new Set,a=new Set;return n.forEach(function(s){switch(s._tag){case"Left":r(s.left,o)||o.add(s.left);break;case"Right":i(s.right,a)||a.add(s.right);break}}),Be(o,a)}}function G8(e){var t=Fr(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);a._tag==="Some"&&!t(a.value,i)&&i.add(a.value)}),i}}}var ASe=new Set,hh=function(e){return e.size===0},mSe=function(e){return e.size},gSe=N$,J8=K$,vSe=hm,Fr=Mn,Z8=function(e){return function(t){var n=[];return t.forEach(function(r){return n.push(r)}),n.sort(e.compare)}},ySe=hm;const bSe=Object.freeze(Object.defineProperty({__proto__:null,chain:nSe,compact:pSe,difference:dk,elem:Fr,empty:ASe,every:J8,filter:uk,filterMap:G8,foldMap:lSe,fromArray:Y8,getDifferenceMagma:sSe,getEq:eSe,getIntersectionSemigroup:aSe,getShow:XCe,getUnionMonoid:oSe,getUnionSemigroup:z8,insert:Q8,intersection:ck,isEmpty:hh,isSubset:vSe,map:tSe,partition:rSe,partitionMap:iSe,reduce:uSe,reduceRight:cSe,remove:H8,separate:hSe,singleton:dSe,size:mSe,some:gSe,subset:ySe,toArray:Z8,toggle:fSe,union:lk},Symbol.toStringTag,{value:"Module"}));var X8=function(e){return{show:function(t){var n="{";for(var r in e)gt.call(e,r)&&(n+=" ".concat(r,": ").concat(e[r].show(t[r]),","));return n.length>1&&(n=n.slice(0,-1)+" "),n+="}",n}}},eq=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{show:function(n){return"[".concat(n.map(function(r,i){return e[i].show(r)}).join(", "),"]")}}},CSe=eq,SSe=X8,wSe={show:function(e){return JSON.stringify(e)}},_Se={show:function(e){return JSON.stringify(e)}},xSe={show:function(e){return JSON.stringify(e)}};const TSe=Object.freeze(Object.defineProperty({__proto__:null,getStructShow:SSe,getTupleShow:CSe,showBoolean:wSe,showNumber:xSe,showString:_Se,struct:X8,tuple:eq},Symbol.toStringTag,{value:"Module"}));function fk(e){return function(t){return function(n){return e.of([t,n])}}}function pk(e){return function(t){return function(n){return function(r){return e.map(n(r),function(i){var o=i[0],a=i[1];return[t(o),a]})}}}}function hk(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(i){var o=i[0],a=i[1];return e.map(t(a),function(s){var u=s[0],l=s[1];return[o(u),l]})})}}}}function Ak(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(i){var o=i[0],a=i[1];return t(o)(a)})}}}}function mk(e){return function(t){return function(n){return e.of(t(n))}}}function gk(e){return function(t){return function(n){return e.map(t,function(r){return[r,n]})}}}function vk(e){return function(t){return function(n){return e.map(n(t),function(r){var i=r[0];return i})}}}function yk(e){return function(t){return function(n){return e.map(n(t),Jn)}}}function ISe(e){var t=hk(e),n=pk(e),r=Ak(e),i=vk(e),o=yk(e);return{map:function(a,s){return x(a,n(s))},ap:function(a,s){return x(a,t(s))},of:fk(e),chain:function(a,s){return x(a,r(s))},get:function(){return function(a){return e.of([a,a])}},put:function(a){return function(){return e.of([void 0,a])}},modify:function(a){return function(s){return e.of([void 0,a(s)])}},gets:function(a){return function(s){return e.of([a(s),s])}},fromState:mk(e),fromM:gk(e),evalState:function(a,s){return x(a,i(s))},execState:function(a,s){return x(a,o(s))}}}const ESe=Object.freeze(Object.defineProperty({__proto__:null,ap:hk,chain:Ak,evaluate:vk,execute:yk,fromF:gk,fromState:mk,getStateM:ISe,map:pk,of:fk},Symbol.toStringTag,{value:"Module"}));var bk=function(e){return function(){return Sb(e)}},Ck=fk(g$);function tq(e){return ho(i$(e))}function RSe(e){return ho(t9(e))}function nq(e){return ho(o$(e))}function $Se(e){return ho(n9(e))}function rq(e){return ho(a$(e))}function kSe(e){return ho(i9(e))}var OSe=function(e){return X(e,r$)},MSe=function(e){return function(t){return Sb(e(t)[0])}},iq=au(function(e){return bk(e)},Ck),oq=nq,mc=rq,xm=tq,aq=mk(g$),sq=function(e){return ho(mu(e))},uq=function(e){return ho(s$(e))},FSe=function(e){return ho(u$(e))},ho=gk(sc),jSe=function(e){return function(t){return X(t,FA(e))}},lq=function(e){return function(t){return function(n){return e(n)(t)(n)}}},LSe=lq,cq=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return uq(e.apply(void 0,t))}},dq=function(e){return function(t){return x(t,Tm(cq(e)))}},DSe=dq,fq=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return sq(e.apply(void 0,t))}},pq=function(e){return function(t){return x(t,Tm(fq(e)))}},USe=pq,hq=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return ho(e.apply(void 0,t))}},Aq=function(e){return function(t){return x(t,Tm(hq(e)))}},BSe=Aq,Ao=function(e,t){return x(e,mq(t))},as=function(e,t){return x(e,wk(t))},gc=function(e,t){return x(e,_k(t))},Sk=function(e,t){return function(n){return x(e(n),Tb(function(){return t()(n)}))}},Vb=function(e,t,n){return function(r){return x(e(r),h$(t,function(i){var o=i[0],a=i[1];return[n(o),a]}))}},zb=function(e,t){return function(n){return x(e(n),A$(t))}},mq=pk(sc),PSe=function(e,t){return function(n){return Vb(n,e,t)}},WSe=function(e){return function(t){return zb(t,e)}},wk=hk(Cr),NSe=wk,ea=Ck,_k=Ak(Cr),Tm=_k,gq=Tm(Q),KSe=gq,vq=function(e){return function(t){return function(n){return x(t(n),b9(function(){return e()(n)}))}}},qSe=vq,Qb=bk,ln="StateReaderTaskEither",xk={URI:ln,map:Ao},VSe=He(xk),zSe={URI:ln,of:ea},Hb={URI:ln,map:Ao,ap:as},yq=Kt(Hb),QSe=yq,bq=qt(Hb),HSe=bq,YSe={URI:ln,map:Ao,ap:as,of:ea},Kr={URI:ln,map:Ao,ap:as,chain:gc},vc={URI:ln,fromState:aq},GSe=h3(vc),JSe=A3(vc),ZSe=m3(vc),XSe=g3(vc),ewe=hE(vc),twe=v3(vc,Kr),nwe={URI:ln,map:Ao,ap:as,of:ea,chain:gc},rwe={URI:ln,map:Ao,ap:as,of:ea,chain:gc,fromIO:mc},iwe={URI:ln,map:Ao,ap:as,of:ea,chain:gc,fromIO:mc,fromTask:xm},owe={URI:ln,map:Ao,ap:as,of:ea,chain:gc,throwError:Qb},Cq=vt(Kr),awe=Cq,swe={URI:ln,bimap:Vb,mapLeft:zb},uwe={URI:ln,map:Ao,alt:Sk},ip={URI:ln,fromReader:oq},lwe=DA(ip),cwe=UA(ip),dwe=Jl(ip),Sq=BA(ip,Kr),fwe=Sq,wq=PA(ip,Kr),pwe=wq,ss={URI:ln,fromEither:iq},hwe=Po(ss),Awe=Wo(ss),mwe=Ol(ss,Kr),_q=$a(ss,Kr),gwe=_q,xq=ka(ss,Kr),vwe=xq,ywe=Gs(ss),Tq=Ml(ss,Kr),bwe=Tq,Cwe=di(ss),Yb={URI:ln,fromIO:mc},Swe=zo(Yb),wwe=Ba(Yb,Kr),_we=Pa(Yb,Kr),Gb={URI:ln,fromIO:mc,fromTask:xm},xwe=Zl(Gb),Twe=$f(Gb,Kr),Iwe=kf(Gb,Kr),Ewe=vk(sc),Rwe=yk(sc),$we=zt(xk),Iq=Qt(Kr),kwe=Iq,Eq=Vt(Hb),Owe=Eq,Rq=function(e){return function(t){return function(n){return function(r){return function(){return Nd(t).reduce(function(i,o,a){return i.then(function(s){return An(s)?i:e(a+1,o)(s.right[1])(r)().then(function(u){if(An(u))return u;var l=u.right,c=l[0],f=l[1];return s.right[0].push(c),s.right[1]=f,s})})},e(0,ci(t))(n)(r)().then(ql(function(i){var o=i[0],a=i[1];return[[o],a]})))}}}}},Tk=function(e){var t=Rq(e);return function(n){return _t(n)?t(n):ea(jn)}},Mwe=Tk,$q=function(e){return Tk(function(t,n){return e(n)})},Fwe=$q(Q),jwe={URI:ln,map:Ao,of:ea,ap:as,chain:gc,bimap:Vb,mapLeft:zb,alt:Sk,fromIO:mc,fromTask:xm,throwError:Qb},Lwe={URI:ln,map:Ao,of:ea,ap:as,chain:gc,bimap:Vb,mapLeft:zb,alt:Sk,fromIO:mc,fromTask:xm,throwError:Qb},Dwe=function(e,t){return x(e(t),lm(function(n){var r=n[0];return r}))},Uwe=function(e,t){return x(e(t),lm(function(n){n[0];var r=n[1];return r}))};function Bwe(e,t,n){return e(t)(n)()}const Pwe=Object.freeze(Object.defineProperty({__proto__:null,Alt:uwe,Applicative:YSe,Apply:Hb,Bifunctor:swe,Chain:Kr,FromEither:ss,FromIO:Yb,FromReader:ip,FromState:vc,FromTask:Gb,Functor:xk,Monad:nwe,MonadIO:rwe,MonadTask:iwe,MonadThrow:owe,Pointed:zSe,URI:ln,alt:qSe,altW:vq,ap:wk,apFirst:yq,apFirstW:QSe,apS:Eq,apSW:Owe,apSecond:bq,apSecondW:HSe,apW:NSe,ask:lwe,asks:cwe,asksStateReaderTaskEither:LSe,asksStateReaderTaskEitherW:lq,bimap:PSe,bind:Iq,bindTo:$we,bindW:kwe,chain:_k,chainEitherK:_q,chainEitherKW:gwe,chainFirst:Cq,chainFirstEitherK:xq,chainFirstEitherKW:vwe,chainFirstIOK:_we,chainFirstReaderK:wq,chainFirstReaderKW:pwe,chainFirstTaskK:Iwe,chainFirstW:awe,chainIOEitherK:DSe,chainIOEitherKW:dq,chainIOK:wwe,chainOptionK:mwe,chainReaderK:Sq,chainReaderKW:fwe,chainReaderTaskEitherK:BSe,chainReaderTaskEitherKW:Aq,chainStateK:twe,chainTaskEitherK:USe,chainTaskEitherKW:pq,chainTaskK:Twe,chainW:Tm,evalState:Dwe,evaluate:Ewe,execState:Uwe,execute:Rwe,filterOrElse:Tq,filterOrElseW:bwe,flap:VSe,flatten:KSe,flattenW:gq,fromEither:iq,fromEitherK:Cwe,fromIO:mc,fromIOEither:uq,fromIOEitherK:cq,fromIOK:Swe,fromOption:hwe,fromOptionK:Awe,fromPredicate:ywe,fromReader:oq,fromReaderEither:FSe,fromReaderK:dwe,fromReaderTaskEither:ho,fromReaderTaskEitherK:hq,fromState:aq,fromStateK:ewe,fromTask:xm,fromTaskEither:sq,fromTaskEitherK:fq,fromTaskK:xwe,get:GSe,gets:XSe,left:bk,leftIO:kSe,leftReader:$Se,leftState:MSe,leftTask:RSe,local:jSe,map:mq,mapLeft:WSe,modify:ZSe,of:ea,put:JSe,right:Ck,rightIO:rq,rightReader:nq,rightState:OSe,rightTask:tq,run:Bwe,sequenceArray:Fwe,stateReaderTaskEither:jwe,stateReaderTaskEitherSeq:Lwe,throwError:Qb,traverseArray:$q,traverseArrayWithIndex:Mwe,traverseReadonlyArrayWithIndex:Tk,traverseReadonlyNonEmptyArrayWithIndex:Rq},Symbol.toStringTag,{value:"Module"}));function Wwe(e){return function(t){return{peek:t.peek,pos:e}}}function Nwe(e){return function(t){return{peek:t.peek,pos:e(t.pos)}}}function Kwe(e){return function(t){return t.peek(e(t.pos))}}function qwe(e){return function(t){return function(n){return e.map(t(n.pos),function(r){return n.peek(r)})}}}var kq=function(e,t){return x(e,Mq(t))},Vwe=function(e,t){return x(e,Ik(t))},Ik=function(e){return function(t){return{peek:function(n){return e({peek:t.peek,pos:n})},pos:t.pos}}},Oq=function(e){return e.peek(e.pos)},zwe=Ik(Q),Mq=function(e){return function(t){return{peek:function(n){return e(t.peek(n))},pos:t.pos}}},Ek="Store",Fq={URI:Ek,map:kq},Qwe=He(Fq),jq={URI:Ek,map:kq,extend:Vwe,extract:Oq},Hwe=jq;const Ywe=Object.freeze(Object.defineProperty({__proto__:null,Comonad:jq,Functor:Fq,URI:Ek,duplicate:zwe,experiment:qwe,extend:Ik,extract:Oq,flap:Qwe,map:Mq,peeks:Kwe,seek:Wwe,seeks:Nwe,store:Hwe},Symbol.toStringTag,{value:"Module"}));function Rk(e,t){return function(n,r){return t.compose(e.second(r),e.first(n))}}function Lq(e,t){var n=Rk(e,t);return function(r,i){return t.compose(n(r,i),e.promap(t.id(),Q,function(o){return[o,o]}))}}function Gwe(e){return Rk(e,e)}function Jwe(e){return Lq(e,e)}const Zwe=Object.freeze(Object.defineProperty({__proto__:null,fanOut:Lq,fanout:Jwe,split:Rk,splitStrong:Gwe},Symbol.toStringTag,{value:"Module"}));var Xwe=function(){return{concat:function(e,t){return Object.assign({},e,t)}}},e_e=function(e){return function(t){var n={};for(var r in t)gt.call(t,r)&&(n[r]=e[r](t[r]));return n}};const t_e=Object.freeze(Object.defineProperty({__proto__:null,evolve:e_e,getAssignSemigroup:Xwe},Symbol.toStringTag,{value:"Module"}));var n_e=function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{l(r.next(c))}catch(f){a(f)}}function u(c){try{l(r.throw(c))}catch(f){a(f)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(e,t||[])).next())})},r_e=function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1],o=l;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(l);break}o[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(c){l=[6,c],i=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},Dq=VA(Un),i_e=WE(Un),o_e=tr,Uq=NE(Un),Im=function(e){return Jb(yr(e))},Jb=B0(Ke),a_e=fu(pf),Bq=KE(Ke),s_e=Bq,$k=K0(zf),u_e=$k,Pq=$k,l_e=Pq,Wq=q0(bn),c_e=Wq,d_e=P0(Un),Nq=function(e){return function(){return n_e(void 0,void 0,void 0,function(){return r_e(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e().then(ye)];case 1:return[2,t.sent()];case 2:return t.sent(),[2,Re];case 3:return[2]}})})}},f_e=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Nq(function(){return e.apply(void 0,t)})}},p_e=W0(Un),h_e=BE(bn),A_e=N0(Un),m_e=PE(bn),kk=V0(Ke),Kq=z0(ic),ta=Dq,Zb=Lf(bn),g_e=Zb(Q),Ok=Q0(bn),v_e=Ok,Xb=zA(Un),y_e=Xb(),Mk=qo(Ke,Bl),Fk=La(Ke,Bl,lf),qq=Da(Ke,Fa),Vq=Ua(Ke,Fa),zq=su(Ke,Fa),Qq=uu(Ke,Fa),Bi=function(e,t){return x(e,kk(t))},yc=function(e,t){return x(e,Kq(t))},e1=function(e,t){return x(e,Zb(t))},Hq=function(e,t){return x(e,Ok(t))},b_e=function(e,t){return x(e,qq(t))},C_e=function(e,t){return x(e,Vq(t))},S_e=function(e,t){return x(e,zq(t))},w_e=function(e,t){return x(e,Qq(t))},Cn="TaskOption",jk={URI:Cn,map:Bi},__e=He(jk),Yq={URI:Cn,of:ta},t1={URI:Cn,map:Bi,ap:yc},x_e=Kt(t1),T_e=qt(t1),I_e={URI:Cn,map:Bi,ap:yc,of:ta},Gq=function(e,t){return x(e,Zb(function(n){return x(t,kk(n))}))},E_e={URI:Cn,map:Bi,ap:Gq},R_e={URI:Cn,map:Bi,ap:Gq,of:ta},us={URI:Cn,map:Bi,ap:yc,chain:e1},$_e=vt(us),k_e={URI:Cn,map:Bi,alt:Hq},Jq={URI:Cn,zero:Xb},O_e=Gd(Jq,Yq),M_e={URI:Cn,map:Bi,ap:yc,of:ta,alt:Hq,zero:Xb},F_e={URI:Cn,map:Bi,ap:yc,of:ta,chain:e1},j_e={URI:Cn,map:Bi,ap:yc,of:ta,chain:e1,fromIO:Im},L_e={URI:Cn,map:Bi,ap:yc,of:ta,chain:e1,fromIO:Im,fromTask:Jb},D_e={URI:Cn,compact:Mk,separate:Fk},U_e={URI:Cn,map:Bi,compact:Mk,separate:Fk,filter:b_e,filterMap:C_e,partition:S_e,partitionMap:w_e},n1={URI:Cn,fromIO:Im},B_e=zo(n1),P_e=Ba(n1,us),W_e=Pa(n1,us),r1={URI:Cn,fromEither:Uq},N_e=di(r1),K_e=$a(r1,us),q_e=ka(r1,us),i1={URI:Cn,fromIO:Im,fromTask:Jb},V_e=Zl(i1),z_e=$f(i1,us),Q_e=kf(i1,us),H_e=ta(gn),Y_e=zt(jk),G_e=Qt(us),J_e=Vt(t1),Lk=ta(jn),Zq=function(e){return X(Qf(e),fu(_0(Dr)))},Dk=function(e){var t=Zq(e);return function(n){return _t(n)?t(n):Lk}},Xq=function(e){return function(t){return function(){return Nd(t).reduce(function(n,r,i){return n.then(function(o){return en(o)?n:e(i+1,r)().then(function(a){return en(a)?a:(o.value.push(a.value),o)})})},e(0,ci(t))().then(Ko(Gh)))}}},Uk=function(e){var t=Xq(e);return function(n){return _t(n)?t(n):Lk}},Z_e=Dk,e7=function(e){return Dk(function(t,n){return e(n)})},X_e=e7(Q),exe=Uk,t7=function(e){return Uk(function(t,n){return e(n)})},txe=t7(Q);const nxe=Object.freeze(Object.defineProperty({__proto__:null,Alt:k_e,Alternative:M_e,ApT:Lk,ApplicativePar:I_e,ApplicativeSeq:R_e,ApplyPar:t1,ApplySeq:E_e,Chain:us,Compactable:D_e,Do:H_e,Filterable:U_e,FromEither:r1,FromIO:n1,FromTask:i1,Functor:jk,Monad:F_e,MonadIO:j_e,MonadTask:L_e,Pointed:Yq,Zero:Jq,alt:Ok,altW:v_e,ap:Kq,apFirst:x_e,apS:J_e,apSecond:T_e,bind:G_e,bindTo:Y_e,chain:Zb,chainEitherK:K_e,chainFirst:$_e,chainFirstEitherK:q_e,chainFirstIOK:W_e,chainFirstTaskK:Q_e,chainIOK:P_e,chainNullableK:h_e,chainOptionK:m_e,chainTaskK:z_e,compact:Mk,filter:qq,filterMap:Vq,flap:__e,flatten:g_e,fold:u_e,foldW:l_e,fromEither:Uq,fromEitherK:N_e,fromIO:Im,fromIOK:B_e,fromNullable:d_e,fromNullableK:p_e,fromOption:o_e,fromOptionK:A_e,fromPredicate:i_e,fromTask:Jb,fromTaskEither:a_e,fromTaskK:V_e,getOrElse:Wq,getOrElseW:c_e,guard:O_e,map:kk,match:Bq,matchE:$k,matchEW:Pq,matchW:s_e,none:y_e,of:ta,partition:zq,partitionMap:Qq,separate:Fk,sequenceArray:X_e,sequenceSeqArray:txe,some:Dq,traverseArray:e7,traverseArrayWithIndex:Z_e,traverseReadonlyArrayWithIndex:Dk,traverseReadonlyArrayWithIndexSeq:Uk,traverseReadonlyNonEmptyArrayWithIndex:Zq,traverseReadonlyNonEmptyArrayWithIndexSeq:Xq,traverseSeqArray:t7,traverseSeqArrayWithIndex:exe,tryCatch:Nq,tryCatchK:f_e,zero:Xb},Symbol.toStringTag,{value:"Module"}));var Xe=function(e){return e._tag==="Left"},Wt=function(e){return e._tag==="Right"};function fl(e){return e._tag==="Both"}function $n(e){return{_tag:"Left",left:e}}function qr(e){return{_tag:"Right",right:e}}function st(e,t){return{_tag:"Both",left:e,right:t}}var Bk=function(e,t,n){return function(r){switch(r._tag){case"Left":return e(r.left);case"Right":return t(r.right);case"Both":return n(r.left,r.right)}}},rxe=Bk,Us=Bk,ixe=Us,n7=Us(qr,$n,function(e,t){return st(t,e)});function oxe(e,t){return{show:Us(function(n){return"left(".concat(e.show(n),")")},function(n){return"right(".concat(t.show(n),")")},function(n,r){return"both(".concat(e.show(n),", ").concat(t.show(r),")")})}}function axe(e,t){return ki(function(n,r){return Xe(n)?Xe(r)&&e.equals(n.left,r.left):Wt(n)?Wt(r)&&t.equals(n.right,r.right):fl(r)&&e.equals(n.left,r.left)&&t.equals(n.right,r.right)})}function r7(e,t){return{concat:function(n,r){return Xe(n)?Xe(r)?$n(e.concat(n.left,r.left)):Wt(r)?st(n.left,r.right):st(e.concat(n.left,r.left),r.right):Wt(n)?Xe(r)?st(r.left,n.right):Wt(r)?qr(t.concat(n.right,r.right)):st(r.left,t.concat(n.right,r.right)):Xe(r)?st(e.concat(n.left,r.left),n.right):Wt(r)?st(n.left,t.concat(n.right,r.right)):st(e.concat(n.left,r.left),t.concat(n.right,r.right))}}}var o1=function(e){return{URI:yi,_E:void 0,map:bc,ap:function(t,n){return Xe(t)?Xe(n)?$n(e.concat(t.left,n.left)):Wt(n)?$n(t.left):$n(e.concat(t.left,n.left)):Wt(t)?Xe(n)?$n(n.left):Wt(n)?qr(t.right(n.right)):st(n.left,t.right(n.right)):Xe(n)?$n(e.concat(t.left,n.left)):Wt(n)?st(t.left,t.right(n.right)):st(e.concat(t.left,n.left),t.right(n.right))}}};function sxe(e){var t=o1(e);return{URI:yi,_E:void 0,map:bc,ap:t.ap,of:Em}}function i7(e){var t=o1(e),n=function(r,i){if(Xe(r))return r;if(Wt(r))return i(r.right);var o=i(r.right);return Xe(o)?$n(e.concat(r.left,o.left)):Wt(o)?st(r.left,o.right):st(e.concat(r.left,o.left),o.right)};return{URI:yi,_E:void 0,map:bc,ap:t.ap,chain:n}}function uxe(e){var t=i7(e);return{URI:yi,_E:void 0,map:bc,of:Em,ap:t.ap,chain:t.chain,throwError:$n}}function lxe(e){return Xe(e)?ye(e.left):Wt(e)?Re:ye(e.left)}function cxe(e){return Xe(e)?Re:(Wt(e),ye(e.right))}function dxe(e){return function(t){return en(t)?$n(e):st(e,t.value)}}function fxe(e){return function(t){return en(t)?qr(e):st(t.value,e)}}function pxe(e){return Xe(e)?ye(e.left):Re}function hxe(e){return Wt(e)?ye(e.right):Re}var Axe=function(e,t){return en(e)?en(t)?Re:ye(qr(t.value)):en(t)?ye($n(e.value)):ye(st(e.value,t.value))},bc=function(e,t){return x(e,Vk(t))},o7=function(e,t,n){return x(e,Kk(t,n))},a7=function(e,t){return x(e,qk(t))},Pk=function(e,t,n){return x(e,u7(t,n))},Wk=function(e){var t=l7(e);return function(n,r){return x(n,t(r))}},Nk=function(e,t,n){return x(e,c7(t,n))},s7=function(e){var t=d7(e);return function(n,r){return x(n,t(r))}},Kk=function(e,t){return function(n){return Xe(n)?$n(e(n.left)):Wt(n)?qr(t(n.right)):st(e(n.left),t(n.right))}},qk=function(e){return function(t){return Xe(t)?$n(e(t.left)):fl(t)?st(e(t.left),t.right):t}},Vk=function(e){return function(t){return Xe(t)?t:Wt(t)?qr(e(t.right)):st(t.left,e(t.right))}},u7=function(e,t){return function(n){return Xe(n)?e:t(e,n.right)}},l7=function(e){return function(t){return function(n){return Xe(n)?e.empty:t(n.right)}}},c7=function(e,t){return function(n){return Xe(n)?e:t(n.right,e)}},d7=function(e){return function(t){return function(n){return Xe(n)?e.of(n):Wt(n)?e.map(t(n.right),qr):e.map(t(n.right),function(r){return st(n.left,r)})}}},zk=function(e){return function(t){return Xe(t)?e.of(t):Wt(t)?e.map(t.right,qr):e.map(t.right,function(n){return st(t.left,n)})}},Em=qr,yi="These",Qk={URI:yi,map:bc},mxe=He(Qk),gxe={URI:yi,of:Em},vxe={URI:yi,bimap:o7,mapLeft:a7},yxe={URI:yi,fromThese:Q},bxe={URI:yi,reduce:Pk,foldMap:Wk,reduceRight:Nk},Cxe={URI:yi,map:bc,reduce:Pk,foldMap:Wk,reduceRight:Nk,traverse:s7,sequence:zk},Hk={URI:yi,fromEither:Q},Sxe=Po(Hk),wxe=Wo(Hk),_xe=function(e){return function(t){return function(n){return Xe(n)?!1:e.equals(t,n.right)}}},xxe=function(e){return function(t){return Xe(t)?!1:e(t.right)}},Yk=function(e,t){return function(n){return Xe(n)?[n.left,t()]:Wt(n)?[e(),n.right]:[n.left,n.right]}},Txe=function(e,t){return Yk(function(){return e},function(){return t})},f7=Em(jn),Gk=function(e){return function(t){return function(n){var r=Re,i=t(0,ci(n));if(Xe(i))return i;fl(i)&&(r=ye(i.left));for(var o=[i.right],a=1;a<n.length;a++){var s=t(a,n[a]);if(Xe(s))return s;fl(s)&&(r=en(r)?ye(s.left):ye(e.concat(r.value,s.left))),o.push(s.right)}return en(r)?qr(o):st(r.value,o)}}},Ixe=function(e){return function(t){var n=Gk(e)(t);return function(r){return _t(r)?n(r):f7}}},Exe={URI:yi,map:bc,bimap:o7,mapLeft:a7,reduce:Pk,foldMap:Wk,reduceRight:Nk,traverse:s7,sequence:zk};const Rxe=Object.freeze(Object.defineProperty({__proto__:null,ApT:f7,Bifunctor:vxe,Foldable:bxe,FromEither:Hk,FromThese:yxe,Functor:Qk,Pointed:gxe,Traversable:Cxe,URI:yi,bimap:Kk,both:st,elem:_xe,exists:xxe,flap:mxe,fold:ixe,foldMap:l7,foldW:rxe,fromOption:Sxe,fromOptionK:wxe,fromOptions:Axe,getApplicative:sxe,getApply:o1,getChain:i7,getEq:axe,getLeft:lxe,getLeftOnly:pxe,getMonad:uxe,getRight:cxe,getRightOnly:hxe,getSemigroup:r7,getShow:oxe,isBoth:fl,isLeft:Xe,isRight:Wt,left:$n,leftOrBoth:dxe,map:Vk,mapLeft:qk,match:Us,matchW:Bk,of:Em,reduce:u7,reduceRight:c7,right:qr,rightOrBoth:fxe,sequence:zk,swap:n7,these:Exe,toTuple:Txe,toTuple2:Yk,traverse:d7,traverseReadonlyArrayWithIndex:Ixe,traverseReadonlyNonEmptyArrayWithIndex:Gk},Symbol.toStringTag,{value:"Module"}));function pv(e){return X(qr,e.of)}function a1(e){return X($n,e.of)}function Jk(e){return X(st,e.of)}function Zk(e){return function(t){return e.map(t,qr)}}function Xk(e){return function(t){return e.map(t,$n)}}function eO(e){return Kd(e,Qk)}function tO(e,t){return Ra(e,o1(t))}function nO(e,t){var n=a1(e);return function(r){return function(i){return e.chain(i,Us(n,r,function(o,a){return e.map(r(a),Us(function(s){return $n(t.concat(o,s))},function(s){return st(o,s)},function(s,u){return st(t.concat(o,s),u)}))}))}}}function rO(e){return function(t,n){return function(r){return e.map(r,Kk(t,n))}}}function iO(e){return function(t){return function(n){return e.map(n,qk(t))}}}function p7(e){return function(t,n,r){return function(i){return e.map(i,Us(t,n,r))}}}function oO(e){return function(t,n,r){return function(i){return e.chain(i,Us(t,n,r))}}}function aO(e){return function(t){return e.map(t,n7)}}function sO(e){return function(t,n){return function(r){return e.map(r,Yk(t,n))}}}function $xe(e){var t=eO(e),n=rO(e),r=iO(e),i=oO(e),o=sO(e),a=pv(e),s=function(u,l){return x(u,t(l))};return{map:s,bimap:function(u,l,c){return x(u,n(l,c))},mapLeft:function(u,l){return x(u,r(l))},fold:function(u,l,c,f){return x(u,i(l,c,f))},swap:aO(e),rightM:Zk(e),leftM:Xk(e),left:a1(e),right:pv(e),both:Jk(e),toTuple:function(u,l,c){return x(u,o(function(){return l},function(){return c}))},getMonad:function(u){var l=tO(e,u),c=nO(e,u);return{_E:void 0,map:s,of:a,ap:function(f,p){return x(f,l(p))},chain:function(f,p){return x(f,c(p))}}}}}const kxe=Object.freeze(Object.defineProperty({__proto__:null,ap:tO,bimap:rO,both:Jk,chain:nO,getTheseM:$xe,left:a1,leftF:Xk,map:eO,mapLeft:iO,match:p7,matchE:oO,right:pv,rightF:Zk,swap:aO,toTuple2:sO},Symbol.toStringTag,{value:"Module"}));var Oxe=a1(Un),h7=pv(Un),Mxe=Jk(Un),uO=Zk(Ke),A7=Xk(Ke),m7=X(yr,uO),Fxe=X(yr,A7),g7=tr,v7=tr,s1=m7,jxe=yr,lO=uO,y7=p7(Ke),Lxe=y7,b7=oO(bn),C7=b7,S7=C7,Dxe=S7,Uxe=aO(Ke),Cc=function(e,t){return x(e,w7(t))},cO=function(e,t,n){return x(e,_7(t,n))},dO=function(e,t){return x(e,x7(t))},w7=eO(Ke),_7=rO(Ke),x7=iO(Ke),Rm=h7,Sr="TaskThese",fO=function(e,t){var n=tO(e,t);return{URI:Sr,_E:void 0,map:Cc,ap:function(r,i){return x(r,n(i))}}};function T7(e,t){var n=fO(e,t).ap;return{URI:Sr,_E:void 0,map:Cc,ap:n,of:Rm}}function I7(e){var t=fO(rm,e),n=nO(bn,e);return{URI:Sr,_E:void 0,map:Cc,ap:t.ap,chain:function(r,i){return x(r,n(i))}}}function Bxe(e){var t=T7(rm,e),n=I7(e);return{URI:Sr,_E:void 0,map:Cc,ap:t.ap,of:Rm,chain:n.chain,fromIO:s1,fromTask:lO}}var E7={URI:Sr,map:Cc},Pxe=He(E7),Wxe={URI:Sr,of:Rm},Nxe={URI:Sr,bimap:cO,mapLeft:dO},u1={URI:Sr,fromEither:g7},Kxe=Po(u1),qxe=Wo(u1),Vxe=Gs(u1),R7={URI:Sr,fromThese:v7},zxe=y3(R7),$7={URI:Sr,fromIO:s1},Qxe=zo($7),k7={URI:Sr,fromIO:s1,fromTask:lO},Hxe=Zl(k7),O7=sO(Ke),pO=Rm(jn),M7=function(e){var t=Gk(e);return function(n){return X(Qf(n),fu(t(Dr)))}},Yxe=function(e){return function(t){var n=M7(e)(t);return function(r){return _t(r)?n(r):pO}}},F7=function(e){return function(t){return function(n){return function(){return Nd(n).reduce(function(r,i,o){return r.then(function(a){return Xe(a)?r:t(o+1,i)().then(function(s){if(Xe(s))return s;if(fl(s)){var u=a.right;return u.push(s.right),fl(a)?st(e.concat(a.left,s.left),u):st(s.left,u)}return a.right.push(s.right),a})})},t(0,ci(n))().then(Vk(Gh)))}}}},Gxe=function(e){return function(t){var n=F7(e)(t);return function(r){return _t(r)?n(r):pO}}},Jxe={URI:Sr,map:Cc},Zxe={URI:Sr,bimap:cO,mapLeft:dO},Xxe=function(e,t){return O7(function(){return e},function(){return t})},eTe={URI:Sr,map:Cc,bimap:cO,mapLeft:dO},tTe=function(e,t){return vn(cb)(r7(e,t))};const nTe=Object.freeze(Object.defineProperty({__proto__:null,ApT:pO,Bifunctor:Nxe,FromEither:u1,FromIO:$7,FromTask:k7,FromThese:R7,Functor:E7,Pointed:Wxe,URI:Sr,bifunctorTaskThese:Zxe,bimap:_7,both:Mxe,flap:Pxe,fold:C7,foldW:Dxe,fromEither:g7,fromIO:s1,fromIOEither:jxe,fromIOK:Qxe,fromOption:Kxe,fromOptionK:qxe,fromPredicate:Vxe,fromTask:lO,fromTaskK:Hxe,fromThese:v7,fromTheseK:zxe,functorTaskThese:Jxe,getApplicative:T7,getApply:fO,getChain:I7,getMonad:Bxe,getSemigroup:tTe,left:Oxe,leftIO:Fxe,leftTask:A7,map:w7,mapLeft:x7,match:y7,matchE:b7,matchEW:S7,matchW:Lxe,of:Rm,right:h7,rightIO:m7,rightTask:uO,swap:Uxe,taskThese:eTe,toTuple:Xxe,toTuple2:O7,traverseReadonlyArrayWithIndex:Yxe,traverseReadonlyArrayWithIndexSeq:Gxe,traverseReadonlyNonEmptyArrayWithIndex:M7,traverseReadonlyNonEmptyArrayWithIndexSeq:F7},Symbol.toStringTag,{value:"Module"}));function rTe(e,t){return function(n){return n(t(n(e.empty)))}}function iTe(e){return function(t){return[e(t),t]}}function oTe(e){return function(t){return function(n){return[t(n),e(n)]}}}function aTe(e){return function(t){return function(n){return t(e(n))}}}function sTe(e){function t(r,i){return function(o){return i(function(a){return r(e.concat(o,a))})}}function n(r){return r(e.empty)}return{URI:hO,_E:void 0,map:j7,extend:t,extract:n}}var j7=function(e,t){return x(e,L7(t))},L7=function(e){return function(t){return function(n){return e(t(n))}}},hO="Traced",AO={URI:hO,map:j7},uTe=He(AO),lTe=AO;const cTe=Object.freeze(Object.defineProperty({__proto__:null,Functor:AO,URI:hO,censor:aTe,flap:uTe,getComonad:sTe,listen:iTe,listens:oTe,map:L7,traced:lTe,tracks:rTe},Symbol.toStringTag,{value:"Module"}));function D7(e,t){return function(n){var r=e.traverse(n),i=t.traverse(n);return function(o){return function(a){return r(a,function(s){return i(s,o)})}}}}function U7(e,t){return function(n){var r=e.sequence(n),i=t.sequence(n);return function(o){return r(e.map(o,i))}}}function dTe(e,t){var n=qd(e,t).map,r=XI(e,t),i=D7(e,t),o=U7(e,t);return{map:n,reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,traverse:function(a){var s=i(a);return function(u,l){return x(u,s(l))}},sequence:function(a){var s=o(a);return function(u){return x(u,s)}}}}const fTe=Object.freeze(Object.defineProperty({__proto__:null,getTraversableComposition:dTe,sequence:U7,traverse:D7},Symbol.toStringTag,{value:"Module"})),pTe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function B7(e,t){return t===void 0&&(t=[]),{value:e,forest:t}}function hTe(e){var t=function(n){return Ds(n.forest)?"make(".concat(e.show(n.value),")"):"make(".concat(e.show(n.value),", [").concat(n.forest.map(t).join(", "),"])")};return{show:t}}function ATe(e){var t,n=ki(function(r,i){return e.equals(r.value,i.value)&&t.equals(r.forest,i.forest)});return t=YW(n),n}var P7=function(e,t){for(var n="",r=t.length,i,o=0;o<r;o++){i=t[o];var a=o===r-1;n+=e+(a?"└":"├")+"─ "+i.value,n+=P7(e+(r>1&&!a?"│ ":" "),i.forest)}return n};function W7(e){return P7(`
|
|
64
|
+
`,e)}function mTe(e){return e.value+W7(e.forest)}function N7(e,t){var n=t(e),r=n[0],i=n[1];return{value:r,forest:K7(i,t)}}function K7(e,t){return e.map(function(n){return N7(n,t)})}function q7(e){var t=V7(e);return function(n,r){return e.chain(r(n),function(i){var o=i[0],a=i[1];return e.map(t(a,r),function(s){return{value:o,forest:s}})})}}function V7(e){var t=p0(e);return function(n,r){return x(n,t(function(i){return q7(e)(i,r)}))}}function gTe(e){var t=function(n){return e(n.value,n.forest.map(t))};return t}var Su=function(e,t){return x(e,c1(t))},op=function(e,t){return x(e,$m(function(n){return x(t,c1(n))}))},mO=function(e,t){return x(e,$m(t))},gO=function(e,t,n){return x(e,d1(t,n))},vO=function(e){var t=H7(e);return function(n,r){return x(n,t(r))}},yO=function(e,t,n){return x(e,bO(t,n))},z7=function(e,t){return x(e,l1(t))},Q7=function(e){var t=SO(e);return function(n,r){return x(n,t(r))}},vTe=function(e){return function(t){return op(t,e)}},$m=function(e){return function(t){var n=e(t.value),r=n.value,i=n.forest,o=AI().concat;return{value:r,forest:o(i,t.forest.map($m(e)))}}},l1=function(e){return function(t){return{value:e(t),forest:t.forest.map(l1(e))}}},yTe=l1(Q),bTe=$m(Q),c1=function(e){return function(t){return{value:e(t.value),forest:t.forest.map(c1(e))}}},d1=function(e,t){return function(n){for(var r=t(e,n.value),i=n.forest.length,o=0;o<i;o++)r=x(n.forest[o],d1(r,t));return r}},H7=function(e){return function(t){return d1(e.empty,function(n,r){return e.concat(n,t(r))})}},bO=function(e,t){return function(n){for(var r=e,i=n.forest.length,o=i-1;o>=0;o--)r=x(n.forest[o],bO(r,t));return t(n.value,r)}},CO=function(e){return e.value},SO=function(e){var t=p0(e),n=function(r){return function(i){return e.ap(e.map(r(i.value),function(o){return function(a){return{value:o,forest:a}}}),x(i.forest,t(n(r))))}};return n},wO=function(e){return SO(e)(Q)},ap=function(e){return B7(e)},mo="Tree",_O={URI:mo,map:Su},CTe=He(_O),STe={URI:mo,of:ap},f1={URI:mo,map:Su,ap:op},wTe=Kt(f1),_Te=qt(f1),xTe={URI:mo,map:Su,ap:op,of:ap},xO={URI:mo,map:Su,ap:op,chain:mO},TTe={URI:mo,map:Su,ap:op,of:ap,chain:mO},ITe=vt(xO),ETe={URI:mo,reduce:gO,foldMap:vO,reduceRight:yO},RTe={URI:mo,map:Su,reduce:gO,foldMap:vO,reduceRight:yO,traverse:Q7,sequence:wO},$Te={URI:mo,map:Su,extend:z7,extract:CO},kTe=ap(gn),OTe=zt(_O),MTe=Qt(xO),FTe=Vt(f1);function jTe(e){var t=function(n,r){return e.equals(n,r.value)||r.forest.some(function(i){return t(n,i)})};return t}var Y7=function(e){return function(t){return e(t.value)||t.forest.some(Y7(e))}},LTe={URI:mo,map:Su,of:ap,ap:op,chain:mO,reduce:gO,foldMap:vO,reduceRight:yO,traverse:Q7,sequence:wO,extract:CO,extend:z7};const DTe=Object.freeze(Object.defineProperty({__proto__:null,Applicative:xTe,Apply:f1,Chain:xO,Comonad:$Te,Do:kTe,Foldable:ETe,Functor:_O,Monad:TTe,Pointed:STe,Traversable:RTe,URI:mo,ap:vTe,apFirst:wTe,apS:FTe,apSecond:_Te,bind:MTe,bindTo:OTe,chain:$m,chainFirst:ITe,drawForest:W7,drawTree:mTe,duplicate:yTe,elem:jTe,exists:Y7,extend:l1,extract:CO,flap:CTe,flatten:bTe,fold:gTe,foldMap:H7,getEq:ATe,getShow:hTe,make:B7,map:c1,of:ap,reduce:d1,reduceRight:bO,sequence:wO,traverse:SO,tree:LTe,unfoldForest:K7,unfoldForestM:V7,unfoldTree:N7,unfoldTreeM:q7},Symbol.toStringTag,{value:"Module"}));var oi=mn,jr=Jn,UTe=function(e){return[jr(e),oi(e)]};function TO(e){return{URI:bi,_E:void 0,map:km,ap:function(t,n){return[oi(t)(oi(n)),e.concat(jr(t),jr(n))]}}}var G7=function(e){return function(t){return[t,e.empty]}};function BTe(e){var t=TO(e);return{URI:bi,_E:void 0,map:t.map,ap:t.ap,of:G7(e)}}function IO(e){var t=TO(e);return{URI:bi,_E:void 0,map:t.map,ap:t.ap,chain:function(n,r){var i=r(oi(n)),o=i[0],a=i[1];return[o,e.concat(jr(n),a)]}}}function PTe(e){var t=IO(e);return{URI:bi,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,of:G7(e)}}function WTe(e){var t=function(r,i){for(var o=i(r),a=e.empty,s=oi(o);s._tag==="Left";)a=e.concat(a,jr(o)),o=i(s.left),s=oi(o);return[s.right,e.concat(a,jr(o))]},n=IO(e);return{URI:bi,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,chainRec:t}}var J7=function(e,t){return x(e,rV(t))},km=function(e,t){return x(e,kO(t))},Z7=function(e,t,n){return x(e,nV(t,n))},X7=function(e,t){return x(e,OO(t))},eV=function(e,t){return x(e,MO(t))},EO=function(e,t,n){return x(e,oV(t,n))},RO=function(e){var t=iV();return function(n,r){return x(n,t(r))}},$O=function(e,t,n){return x(e,aV(t,n))};function tV(e){var t=sV(e);return function(n,r){return x(n,t(r))}}var nV=function(e,t){return function(n){return[t(oi(n)),e(jr(n))]}},kO=function(e){return function(t){return[e(oi(t)),jr(t)]}},OO=function(e){return function(t){return[oi(t),e(jr(t))]}},rV=function(e){return function(t){return[oi(t),jr(e)]}},MO=function(e){return function(t){return[e(t),jr(t)]}},NTe=MO(Q),FO=qb,iV=X$,oV=Z$,aV=ek,sV=function(e){return function(t){return function(n){return e.map(t(oi(n)),function(r){return[r,jr(n)]})}}},jO=function(e){return function(t){return e.map(oi(t),function(n){return[n,jr(t)]})}},bi="Tuple",uV={URI:bi,map:km},KTe=He(uV),qTe={URI:bi,bimap:Z7,mapLeft:X7},VTe={URI:bi,compose:J7},zTe={URI:bi,map:km,extend:eV,extract:FO},QTe={URI:bi,reduce:EO,foldMap:RO,reduceRight:$O},HTe={URI:bi,map:km,reduce:EO,foldMap:RO,reduceRight:$O,traverse:tV,sequence:jO},YTe=kO,GTe=OO,JTe={URI:bi,compose:J7,map:km,bimap:Z7,mapLeft:X7,extract:FO,extend:eV,reduce:EO,foldMap:RO,reduceRight:$O,traverse:tV,sequence:jO};const ZTe=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:qTe,Comonad:zTe,Foldable:QTe,Functor:uV,Semigroupoid:VTe,Traversable:HTe,URI:bi,bimap:nV,compose:rV,duplicate:NTe,extend:MO,extract:FO,flap:KTe,foldMap:iV,fst:oi,getApplicative:BTe,getApply:TO,getChain:IO,getChainRec:WTe,getMonad:PTe,map:YTe,mapFst:kO,mapLeft:GTe,mapSnd:OO,reduce:oV,reduceRight:aV,sequence:jO,snd:jr,swap:UTe,traverse:sV,tuple:JTe},Symbol.toStringTag,{value:"Module"})),XTe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function eIe(e,t){var n=DU(t,iu(e));return{map:n.map,ap:n.ap,of:n.of,chain:function(r,i){return t.chain(r,function(o){return An(o)?t.of(Ca(o.left)):i(o.right)})},alt:function(r,i){return t.chain(r,function(o){return hx(o)?t.of(o):t.map(i(),function(a){return An(a)?Ca(e.concat(o.left,a.left)):a})})}}}const tIe=Object.freeze(Object.defineProperty({__proto__:null,getValidationM:eIe},Symbol.toStringTag,{value:"Module"}));var lV=yx(void 0),nIe={concat:lV.concat,empty:void 0};const rIe=Object.freeze(Object.defineProperty({__proto__:null,Monoid:nIe,Semigroup:lV},Symbol.toStringTag,{value:"Module"}));var iIe=function(e){return function(){return[void 0,e]}},oIe=function(e){return function(){var t=e(),n=t[0],r=t[1];return[[n,r],r]}},aIe=function(e){return function(){var t=e(),n=t[0],r=n[0],i=n[1],o=t[1];return[r,i(o)]}},sIe=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[[r,e(i)],i]}}},uIe=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[r,e(i)]}}},Om=function(e,t){return x(e,cV(t))},cV=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[e(r),i]}}},Sc="Writer",dV=function(e){return{URI:Sc,_E:void 0,of:function(t){return function(){return[t,e.empty]}}}},LO=function(e){return{URI:Sc,_E:void 0,map:Om,ap:function(t,n){return function(){var r=t(),i=r[0],o=r[1],a=n(),s=a[0],u=a[1];return[i(s),e.concat(o,u)]}}}},fV=function(e){var t=LO(e),n=dV(e);return{URI:Sc,_E:void 0,map:Om,ap:t.ap,of:n.of}};function pV(e){var t=LO(e);return{URI:Sc,_E:void 0,map:Om,ap:t.ap,chain:function(n,r){return function(){var i=n(),o=i[0],a=i[1],s=r(o)(),u=s[0],l=s[1];return[u,e.concat(a,l)]}}}}function lIe(e){var t=fV(e),n=pV(e);return{URI:Sc,_E:void 0,map:Om,ap:t.ap,of:t.of,chain:n.chain}}var DO={URI:Sc,map:Om},cIe=He(DO),dIe=function(e){return e()[0]},fIe=function(e){return e()[1]},pIe=function(e){return e()[0]},hIe=function(e){return e()[1]},AIe=DO;const mIe=Object.freeze(Object.defineProperty({__proto__:null,Functor:DO,URI:Sc,censor:uIe,evalWriter:pIe,evaluate:dIe,execWriter:hIe,execute:fIe,flap:cIe,getApplicative:fV,getApply:LO,getChain:pV,getMonad:lIe,getPointed:dV,listen:oIe,listens:sIe,map:cV,pass:aIe,tell:iIe,writer:AIe},Symbol.toStringTag,{value:"Module"}));function gIe(e){var t=function(n,r){return function(){return e.map(n(),function(i){var o=i[0],a=i[1];return[r(o),a]})}};return{map:t,evalWriter:function(n){return e.map(n(),function(r){var i=r[0];return i})},execWriter:function(n){return e.map(n(),function(r){r[0];var i=r[1];return i})},tell:function(n){return function(){return e.of([void 0,n])}},listen:function(n){return function(){return e.map(n(),function(r){var i=r[0],o=r[1];return[[i,o],o]})}},pass:function(n){return function(){return e.map(n(),function(r){var i=r[0],o=i[0],a=i[1],s=r[1];return[o,a(s)]})}},listens:function(n,r){return function(){return e.map(n(),function(i){var o=i[0],a=i[1];return[[o,r(a)],a]})}},censor:function(n,r){return function(){return e.map(n(),function(i){var o=i[0],a=i[1];return[o,r(a)]})}},getMonad:function(n){return{_E:void 0,map:t,of:function(r){return function(){return e.of([r,n.empty])}},ap:function(r,i){return function(){return e.chain(r(),function(o){var a=o[0],s=o[1];return e.map(i(),function(u){var l=u[0],c=u[1];return[a(l),n.concat(s,c)]})})}},chain:function(r,i){return function(){return e.chain(r(),function(o){var a=o[0],s=o[1];return e.map(i(a)(),function(u){var l=u[0],c=u[1];return[l,n.concat(s,c)]})})}}}}}}const vIe=Object.freeze(Object.defineProperty({__proto__:null,getWriterM:gIe},Symbol.toStringTag,{value:"Module"})),yIe=Object.freeze(Object.defineProperty({__proto__:null,alt:Ete,alternative:$te,applicative:Hte,apply:zte,array:Nse,bifunctor:Kse,boolean:Jse,booleanAlgebra:nue,bounded:aue,boundedDistributiveLattice:lue,boundedJoinSemilattice:cue,boundedLattice:due,boundedMeetSemilattice:fue,category:pue,chain:Yte,chainRec:hue,choice:gue,comonad:vue,compactable:lle,console:hle,const:Rle,contravariant:$le,date:Ule,distributiveLattice:sue,either:kK,eitherT:Tce,endomorphism:Ece,eq:une,extend:Rce,field:Oce,filterable:Fce,filterableWithIndex:jce,foldable:Wce,foldableWithIndex:Kce,fromEither:Gte,fromIO:qce,fromReader:fde,fromState:Ode,fromTask:Mde,fromThese:Fde,function:LU,functor:Qte,functorWithIndex:Lde,group:Dde,heytingAlgebra:Ude,hkt:Bde,identity:sfe,invariant:ufe,io:Ife,ioEither:Ipe,ioOption:bhe,ioRef:She,joinSemilattice:whe,json:The,lattice:Ihe,magma:Tne,map:LAe,meetSemilattice:DAe,monad:UAe,monadIO:BAe,monadTask:PAe,monadThrow:WAe,monoid:eme,naturalTransformation:tme,nonEmptyArray:mie,number:wie,option:sle,optionT:Rpe,ord:Sne,ordering:ume,pipeable:Tme,pointed:Ime,predicate:wue,profunctor:Eme,random:Ome,reader:dde,readerEither:Ege,readerT:kge,readerTask:Bve,readerTaskEither:fbe,readonlyArray:rae,readonlyMap:eAe,readonlyNonEmptyArray:_re,readonlyRecord:r1e,readonlySet:b1e,readonlyTuple:j1e,record:LCe,refinement:VCe,ring:YCe,semigroup:sB,semigroupoid:GCe,semiring:ZCe,separated:Rie,set:bSe,show:TSe,state:kde,stateReaderTaskEither:Pwe,stateT:ESe,store:Ywe,string:Rbe,strong:Zwe,struct:t_e,task:rve,taskEither:Yye,taskOption:nxe,taskThese:nTe,these:Rxe,theseT:kxe,traced:cTe,traversable:fTe,traversableWithIndex:pTe,tree:DTe,tuple:ZTe,unfoldable:XTe,validationT:tIe,void:rIe,witherable:$ie,writer:mIe,writerT:vIe,zero:kie},Symbol.toStringTag,{value:"Module"})),ut=kl(yIe);var cn={},yd={},En={},Ye={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getEndomorphismMonoid=e.not=e.SK=e.hole=e.pipe=e.untupled=e.tupled=e.absurd=e.decrement=e.increment=e.tuple=e.flow=e.flip=e.constVoid=e.constUndefined=e.constNull=e.constFalse=e.constTrue=e.constant=e.unsafeCoerce=e.identity=e.apply=e.getRing=e.getSemiring=e.getMonoid=e.getSemigroup=e.getBooleanAlgebra=void 0;var t=function(S){return function(){return{meet:function(w,T){return function(E){return S.meet(w(E),T(E))}},join:function(w,T){return function(E){return S.join(w(E),T(E))}},zero:function(){return S.zero},one:function(){return S.one},implies:function(w,T){return function(E){return S.implies(w(E),T(E))}},not:function(w){return function(T){return S.not(w(T))}}}}};e.getBooleanAlgebra=t;var n=function(S){return function(){return{concat:function(w,T){return function(E){return S.concat(w(E),T(E))}}}}};e.getSemigroup=n;var r=function(S){var w=(0,e.getSemigroup)(S);return function(){return{concat:w().concat,empty:function(){return S.empty}}}};e.getMonoid=r;var i=function(S){return{add:function(w,T){return function(E){return S.add(w(E),T(E))}},zero:function(){return S.zero},mul:function(w,T){return function(E){return S.mul(w(E),T(E))}},one:function(){return S.one}}};e.getSemiring=i;var o=function(S){var w=(0,e.getSemiring)(S);return{add:w.add,mul:w.mul,one:w.one,zero:w.zero,sub:function(T,E){return function(R){return S.sub(T(R),E(R))}}}};e.getRing=o;var a=function(S){return function(w){return w(S)}};e.apply=a;function s(S){return S}e.identity=s,e.unsafeCoerce=s;function u(S){return function(){return S}}e.constant=u,e.constTrue=u(!0),e.constFalse=u(!1),e.constNull=u(null),e.constUndefined=u(void 0),e.constVoid=e.constUndefined;function l(S){return function(w,T){return S(T,w)}}e.flip=l;function c(S,w,T,E,R,O,$,B,K){switch(arguments.length){case 1:return S;case 2:return function(){return w(S.apply(this,arguments))};case 3:return function(){return T(w(S.apply(this,arguments)))};case 4:return function(){return E(T(w(S.apply(this,arguments))))};case 5:return function(){return R(E(T(w(S.apply(this,arguments)))))};case 6:return function(){return O(R(E(T(w(S.apply(this,arguments))))))};case 7:return function(){return $(O(R(E(T(w(S.apply(this,arguments)))))))};case 8:return function(){return B($(O(R(E(T(w(S.apply(this,arguments))))))))};case 9:return function(){return K(B($(O(R(E(T(w(S.apply(this,arguments)))))))))}}}e.flow=c;function f(){for(var S=[],w=0;w<arguments.length;w++)S[w]=arguments[w];return S}e.tuple=f;function p(S){return S+1}e.increment=p;function h(S){return S-1}e.decrement=h;function A(S){throw new Error("Called `absurd` function which should be uncallable")}e.absurd=A;function g(S){return function(w){return S.apply(void 0,w)}}e.tupled=g;function y(S){return function(){for(var w=[],T=0;T<arguments.length;T++)w[T]=arguments[T];return S(w)}}e.untupled=y;function C(S,w,T,E,R,O,$,B,K){switch(arguments.length){case 1:return S;case 2:return w(S);case 3:return T(w(S));case 4:return E(T(w(S)));case 5:return R(E(T(w(S))));case 6:return O(R(E(T(w(S)))));case 7:return $(O(R(E(T(w(S))))));case 8:return B($(O(R(E(T(w(S)))))));case 9:return K(B($(O(R(E(T(w(S))))))));default:{for(var H=arguments[0],z=1;z<arguments.length;z++)H=arguments[z](H);return H}}}e.pipe=C,e.hole=A;var _=function(S,w){return w};e.SK=_;function b(S){return function(w){return!S(w)}}e.not=b;var v=function(){return{concat:function(S,w){return c(S,w)},empty:s}};e.getEndomorphismMonoid=v})(Ye);var Ne={},bIe=Se&&Se.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.fromReadonlyNonEmptyArray=Ne.has=Ne.emptyRecord=Ne.emptyReadonlyArray=Ne.tail=Ne.head=Ne.isNonEmpty=Ne.singleton=Ne.right=Ne.left=Ne.isRight=Ne.isLeft=Ne.some=Ne.none=Ne.isSome=Ne.isNone=void 0;var CIe=function(e){return e._tag==="None"};Ne.isNone=CIe;var SIe=function(e){return e._tag==="Some"};Ne.isSome=SIe;Ne.none={_tag:"None"};var wIe=function(e){return{_tag:"Some",value:e}};Ne.some=wIe;var _Ie=function(e){return e._tag==="Left"};Ne.isLeft=_Ie;var xIe=function(e){return e._tag==="Right"};Ne.isRight=xIe;var TIe=function(e){return{_tag:"Left",left:e}};Ne.left=TIe;var IIe=function(e){return{_tag:"Right",right:e}};Ne.right=IIe;var EIe=function(e){return[e]};Ne.singleton=EIe;var RIe=function(e){return e.length>0};Ne.isNonEmpty=RIe;var $Ie=function(e){return e[0]};Ne.head=$Ie;var kIe=function(e){return e.slice(1)};Ne.tail=kIe;Ne.emptyReadonlyArray=[];Ne.emptyRecord={};Ne.has=Object.prototype.hasOwnProperty;var OIe=function(e){return bIe([e[0]],e.slice(1),!0)};Ne.fromReadonlyNonEmptyArray=OIe;var MIe=Se&&Se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),FIe=Se&&Se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),jIe=Se&&Se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&MIe(t,e,n);return FIe(t,e),t};Object.defineProperty(En,"__esModule",{value:!0});En.sequenceS=En.sequenceT=En.getApplySemigroup=En.apS=En.apSecond=En.apFirst=En.ap=void 0;var LIe=Ye,DIe=jIe(Ne);function UIe(e,t){return function(n){return function(r){return e.ap(e.map(r,function(i){return function(o){return t.ap(i,o)}}),n)}}}En.ap=UIe;function BIe(e){return function(t){return function(n){return e.ap(e.map(n,function(r){return function(){return r}}),t)}}}En.apFirst=BIe;function PIe(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(r){return r}}),t)}}}En.apSecond=PIe;function WIe(e){return function(t,n){return function(r){return e.ap(e.map(r,function(i){return function(o){var a;return Object.assign({},i,(a={},a[t]=o,a))}}),n)}}}En.apS=WIe;function NIe(e){return function(t){return{concat:function(n,r){return e.ap(e.map(n,function(i){return function(o){return t.concat(i,o)}}),r)}}}}En.getApplySemigroup=NIe;function UO(e,t,n){return function(r){for(var i=Array(n.length+1),o=0;o<n.length;o++)i[o]=n[o];return i[n.length]=r,t===0?e.apply(null,i):UO(e,t-1,i)}}var PC={1:function(e){return[e]},2:function(e){return function(t){return[e,t]}},3:function(e){return function(t){return function(n){return[e,t,n]}}},4:function(e){return function(t){return function(n){return function(r){return[e,t,n,r]}}}},5:function(e){return function(t){return function(n){return function(r){return function(i){return[e,t,n,r,i]}}}}}};function KIe(e){return DIe.has.call(PC,e)||(PC[e]=UO(LIe.tuple,e-1,[])),PC[e]}function qIe(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=KIe(r),o=e.map(t[0],i),a=1;a<r;a++)o=e.ap(o,t[a]);return o}}En.sequenceT=qIe;function VIe(e){var t=e.length;switch(t){case 1:return function(n){var r;return r={},r[e[0]]=n,r};case 2:return function(n){return function(r){var i;return i={},i[e[0]]=n,i[e[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return o={},o[e[0]]=n,o[e[1]]=r,o[e[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return a={},a[e[0]]=n,a[e[1]]=r,a[e[2]]=i,a[e[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var s;return s={},s[e[0]]=n,s[e[1]]=r,s[e[2]]=i,s[e[3]]=o,s[e[4]]=a,s}}}}};default:return UO(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i={},o=0;o<t;o++)i[e[o]]=n[o];return i},t-1,[])}}function zIe(e){return function(t){for(var n=Object.keys(t),r=n.length,i=VIe(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}En.sequenceS=zIe;var wi={};Object.defineProperty(wi,"__esModule",{value:!0});wi.getFunctorComposition=wi.bindTo=wi.flap=wi.map=void 0;var QIe=Ye;function hV(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}wi.map=hV;function HIe(e){return function(t){return function(n){return e.map(n,function(r){return r(t)})}}}wi.flap=HIe;function YIe(e){return function(t){return function(n){return e.map(n,function(r){var i;return i={},i[t]=r,i})}}}wi.bindTo=YIe;function GIe(e,t){var n=hV(e,t);return{map:function(r,i){return(0,QIe.pipe)(r,n(i))}}}wi.getFunctorComposition=GIe;Object.defineProperty(yd,"__esModule",{value:!0});yd.getApplicativeComposition=yd.getApplicativeMonoid=void 0;var AV=En,JIe=Ye,ZIe=wi;function XIe(e){var t=(0,AV.getApplySemigroup)(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}yd.getApplicativeMonoid=XIe;function eEe(e,t){var n=(0,ZIe.getFunctorComposition)(e,t).map,r=(0,AV.ap)(e,t);return{map:n,of:function(i){return e.of(t.of(i))},ap:function(i,o){return(0,JIe.pipe)(i,r(o))}}}yd.getApplicativeComposition=eEe;var pl={};Object.defineProperty(pl,"__esModule",{value:!0});pl.bind=pl.chainFirst=void 0;function tEe(e){return function(t){return function(n){return e.chain(n,function(r){return e.map(t(r),function(){return r})})}}}pl.chainFirst=tEe;function nEe(e){return function(t,n){return function(r){return e.chain(r,function(i){return e.map(n(i),function(o){var a;return Object.assign({},i,(a={},a[t]=o,a))})})}}}pl.bind=nEe;var p1={};Object.defineProperty(p1,"__esModule",{value:!0});p1.tailRec=void 0;var rEe=function(e,t){for(var n=t(e);n._tag==="Left";)n=t(n.left);return n.right};p1.tailRec=rEe;var fn={},iEe=Se&&Se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),oEe=Se&&Se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),aEe=Se&&Se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&iEe(t,e,n);return oEe(t,e),t};Object.defineProperty(fn,"__esModule",{value:!0});fn.filterOrElse=fn.chainFirstEitherK=fn.chainEitherK=fn.fromEitherK=fn.chainOptionK=fn.fromOptionK=fn.fromPredicate=fn.fromOption=void 0;var sEe=pl,BO=Ye,Gu=aEe(Ne);function mV(e){return function(t){return function(n){return e.fromEither(Gu.isNone(n)?Gu.left(t()):Gu.right(n.value))}}}fn.fromOption=mV;function uEe(e){return function(t,n){return function(r){return e.fromEither(t(r)?Gu.right(r):Gu.left(n(r)))}}}fn.fromPredicate=uEe;function gV(e){var t=mV(e);return function(n){var r=t(n);return function(i){return(0,BO.flow)(i,r)}}}fn.fromOptionK=gV;function lEe(e,t){var n=gV(e);return function(r){var i=n(r);return function(o){return function(a){return t.chain(a,i(o))}}}}fn.chainOptionK=lEe;function PO(e){return function(t){return(0,BO.flow)(t,e.fromEither)}}fn.fromEitherK=PO;function cEe(e,t){var n=PO(e);return function(r){return function(i){return t.chain(i,n(r))}}}fn.chainEitherK=cEe;function dEe(e,t){return(0,BO.flow)(PO(e),(0,sEe.chainFirst)(t))}fn.chainFirstEitherK=dEe;function fEe(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?Gu.right(o):Gu.left(r(o)))})}}}fn.filterOrElse=fEe;var vV={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.right=e.left=e.flap=e.Functor=e.Bifunctor=e.URI=e.bimap=e.mapLeft=e.map=e.separated=void 0;var t=Ye,n=wi,r=function(p,h){return{left:p,right:h}};e.separated=r;var i=function(p,h){return(0,t.pipe)(p,(0,e.map)(h))},o=function(p,h){return(0,t.pipe)(p,(0,e.mapLeft)(h))},a=function(p,h,A){return(0,t.pipe)(p,(0,e.bimap)(h,A))},s=function(p){return function(h){return(0,e.separated)((0,e.left)(h),p((0,e.right)(h)))}};e.map=s;var u=function(p){return function(h){return(0,e.separated)(p((0,e.left)(h)),(0,e.right)(h))}};e.mapLeft=u;var l=function(p,h){return function(A){return(0,e.separated)(p((0,e.left)(A)),h((0,e.right)(A)))}};e.bimap=l,e.URI="Separated",e.Bifunctor={URI:e.URI,mapLeft:o,bimap:a},e.Functor={URI:e.URI,map:i},e.flap=(0,n.flap)(e.Functor);var c=function(p){return p.left};e.left=c;var f=function(p){return p.right};e.right=f})(vV);var Ms={},pEe=Se&&Se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),hEe=Se&&Se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),AEe=Se&&Se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&pEe(t,e,n);return hEe(t,e),t};Object.defineProperty(Ms,"__esModule",{value:!0});Ms.filterE=Ms.witherDefault=Ms.wiltDefault=void 0;var _j=AEe(Ne);function mEe(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.separate)}}}Ms.wiltDefault=mEe;function gEe(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.compact)}}}Ms.witherDefault=gEe;function vEe(e){return function(t){var n=e.wither(t);return function(r){return function(i){return n(i,function(o){return t.map(r(o),function(a){return a?_j.some(o):_j.none})})}}}}Ms.filterE=vEe;(function(e){var t=Se&&Se.__createBinding||(Object.create?function(D,L,U,ce){ce===void 0&&(ce=U);var j=Object.getOwnPropertyDescriptor(L,U);(!j||("get"in j?!L.__esModule:j.writable||j.configurable))&&(j={enumerable:!0,get:function(){return L[U]}}),Object.defineProperty(D,ce,j)}:function(D,L,U,ce){ce===void 0&&(ce=U),D[ce]=L[U]}),n=Se&&Se.__setModuleDefault||(Object.create?function(D,L){Object.defineProperty(D,"default",{enumerable:!0,value:L})}:function(D,L){D.default=L}),r=Se&&Se.__importStar||function(D){if(D&&D.__esModule)return D;var L={};if(D!=null)for(var U in D)U!=="default"&&Object.prototype.hasOwnProperty.call(D,U)&&t(L,D,U);return n(L,D),L};Object.defineProperty(e,"__esModule",{value:!0}),e.fold=e.match=e.foldW=e.matchW=e.isRight=e.isLeft=e.fromOption=e.fromPredicate=e.FromEither=e.MonadThrow=e.throwError=e.ChainRec=e.Extend=e.extend=e.Alt=e.alt=e.altW=e.Bifunctor=e.mapLeft=e.bimap=e.Traversable=e.sequence=e.traverse=e.Foldable=e.reduceRight=e.foldMap=e.reduce=e.Monad=e.Chain=e.chain=e.chainW=e.Applicative=e.Apply=e.ap=e.apW=e.Pointed=e.of=e.Functor=e.map=e.getAltValidation=e.getApplicativeValidation=e.getWitherable=e.getFilterable=e.getCompactable=e.getSemigroup=e.getEq=e.getShow=e.URI=e.right=e.left=void 0,e.getValidation=e.getValidationMonoid=e.getValidationSemigroup=e.getApplyMonoid=e.getApplySemigroup=e.either=e.stringifyJSON=e.parseJSON=e.sequenceArray=e.traverseArray=e.traverseArrayWithIndex=e.traverseReadonlyArrayWithIndex=e.traverseReadonlyNonEmptyArrayWithIndex=e.ApT=e.apSW=e.apS=e.bindW=e.bind=e.bindTo=e.Do=e.exists=e.elem=e.toError=e.toUnion=e.chainNullableK=e.fromNullableK=e.tryCatchK=e.tryCatch=e.fromNullable=e.orElse=e.orElseW=e.swap=e.filterOrElseW=e.filterOrElse=e.chainOptionK=e.fromOptionK=e.duplicate=e.flatten=e.flattenW=e.chainFirstW=e.chainFirst=e.apSecondW=e.apSecond=e.apFirstW=e.apFirst=e.flap=e.getOrElse=e.getOrElseW=void 0;var i=yd,o=En,a=pl,s=p1,u=fn,l=Ye,c=wi,f=r(Ne),p=vV,h=Ms;e.left=f.left,e.right=f.right;var A=function(D,L){return(0,l.pipe)(D,(0,e.map)(L))},g=function(D,L){return(0,l.pipe)(D,(0,e.ap)(L))},y=function(D,L){return(0,l.pipe)(D,(0,e.chain)(L))},C=function(D,L,U){return(0,l.pipe)(D,(0,e.reduce)(L,U))},_=function(D){return function(L,U){var ce=(0,e.foldMap)(D);return(0,l.pipe)(L,ce(U))}},b=function(D,L,U){return(0,l.pipe)(D,(0,e.reduceRight)(L,U))},v=function(D){var L=(0,e.traverse)(D);return function(U,ce){return(0,l.pipe)(U,L(ce))}},S=function(D,L,U){return(0,l.pipe)(D,(0,e.bimap)(L,U))},w=function(D,L){return(0,l.pipe)(D,(0,e.mapLeft)(L))},T=function(D,L){return(0,l.pipe)(D,(0,e.alt)(L))},E=function(D,L){return(0,l.pipe)(D,(0,e.extend)(L))},R=function(D,L){return(0,s.tailRec)(L(D),function(U){return(0,e.isLeft)(U)?(0,e.right)((0,e.left)(U.left)):(0,e.isLeft)(U.right)?(0,e.left)(L(U.right.left)):(0,e.right)((0,e.right)(U.right.right))})};e.URI="Either";var O=function(D,L){return{show:function(U){return(0,e.isLeft)(U)?"left(".concat(D.show(U.left),")"):"right(".concat(L.show(U.right),")")}}};e.getShow=O;var $=function(D,L){return{equals:function(U,ce){return U===ce||((0,e.isLeft)(U)?(0,e.isLeft)(ce)&&D.equals(U.left,ce.left):(0,e.isRight)(ce)&&L.equals(U.right,ce.right))}}};e.getEq=$;var B=function(D){return{concat:function(L,U){return(0,e.isLeft)(U)?L:(0,e.isLeft)(L)?U:(0,e.right)(D.concat(L.right,U.right))}}};e.getSemigroup=B;var K=function(D){var L=(0,e.left)(D.empty);return{URI:e.URI,_E:void 0,compact:function(U){return(0,e.isLeft)(U)?U:U.right._tag==="None"?L:(0,e.right)(U.right.value)},separate:function(U){return(0,e.isLeft)(U)?(0,p.separated)(U,U):(0,e.isLeft)(U.right)?(0,p.separated)((0,e.right)(U.right.left),L):(0,p.separated)(L,(0,e.right)(U.right.right))}}};e.getCompactable=K;var H=function(D){var L=(0,e.left)(D.empty),U=(0,e.getCompactable)(D),ce=U.compact,j=U.separate,te=function(ue,be){return(0,e.isLeft)(ue)||be(ue.right)?ue:L},pe=function(ue,be){return(0,e.isLeft)(ue)?(0,p.separated)(ue,ue):be(ue.right)?(0,p.separated)(L,(0,e.right)(ue.right)):(0,p.separated)((0,e.right)(ue.right),L)};return{URI:e.URI,_E:void 0,map:A,compact:ce,separate:j,filter:te,filterMap:function(ue,be){if((0,e.isLeft)(ue))return ue;var ot=be(ue.right);return ot._tag==="None"?L:(0,e.right)(ot.value)},partition:pe,partitionMap:function(ue,be){if((0,e.isLeft)(ue))return(0,p.separated)(ue,ue);var ot=be(ue.right);return(0,e.isLeft)(ot)?(0,p.separated)((0,e.right)(ot.left),L):(0,p.separated)(L,(0,e.right)(ot.right))}}};e.getFilterable=H;var z=function(D){var L=(0,e.getFilterable)(D),U=(0,e.getCompactable)(D);return{URI:e.URI,_E:void 0,map:A,compact:L.compact,separate:L.separate,filter:L.filter,filterMap:L.filterMap,partition:L.partition,partitionMap:L.partitionMap,traverse:v,sequence:e.sequence,reduce:C,foldMap:_,reduceRight:b,wither:(0,h.witherDefault)(e.Traversable,U),wilt:(0,h.wiltDefault)(e.Traversable,U)}};e.getWitherable=z;var N=function(D){return{URI:e.URI,_E:void 0,map:A,ap:function(L,U){return(0,e.isLeft)(L)?(0,e.isLeft)(U)?(0,e.left)(D.concat(L.left,U.left)):L:(0,e.isLeft)(U)?U:(0,e.right)(L.right(U.right))},of:e.of}};e.getApplicativeValidation=N;var Y=function(D){return{URI:e.URI,_E:void 0,map:A,alt:function(L,U){if((0,e.isRight)(L))return L;var ce=U();return(0,e.isLeft)(ce)?(0,e.left)(D.concat(L.left,ce.left)):ce}}};e.getAltValidation=Y;var ee=function(D){return function(L){return(0,e.isLeft)(L)?L:(0,e.right)(D(L.right))}};e.map=ee,e.Functor={URI:e.URI,map:A},e.of=e.right,e.Pointed={URI:e.URI,of:e.of};var F=function(D){return function(L){return(0,e.isLeft)(L)?L:(0,e.isLeft)(D)?D:(0,e.right)(L.right(D.right))}};e.apW=F,e.ap=e.apW,e.Apply={URI:e.URI,map:A,ap:g},e.Applicative={URI:e.URI,map:A,ap:g,of:e.of};var M=function(D){return function(L){return(0,e.isLeft)(L)?L:D(L.right)}};e.chainW=M,e.chain=e.chainW,e.Chain={URI:e.URI,map:A,ap:g,chain:y},e.Monad={URI:e.URI,map:A,ap:g,of:e.of,chain:y};var W=function(D,L){return function(U){return(0,e.isLeft)(U)?D:L(D,U.right)}};e.reduce=W;var re=function(D){return function(L){return function(U){return(0,e.isLeft)(U)?D.empty:L(U.right)}}};e.foldMap=re;var Ie=function(D,L){return function(U){return(0,e.isLeft)(U)?D:L(U.right,D)}};e.reduceRight=Ie,e.Foldable={URI:e.URI,reduce:C,foldMap:_,reduceRight:b};var Ce=function(D){return function(L){return function(U){return(0,e.isLeft)(U)?D.of((0,e.left)(U.left)):D.map(L(U.right),e.right)}}};e.traverse=Ce;var P=function(D){return function(L){return(0,e.isLeft)(L)?D.of((0,e.left)(L.left)):D.map(L.right,e.right)}};e.sequence=P,e.Traversable={URI:e.URI,map:A,reduce:C,foldMap:_,reduceRight:b,traverse:v,sequence:e.sequence};var ae=function(D,L){return function(U){return(0,e.isLeft)(U)?(0,e.left)(D(U.left)):(0,e.right)(L(U.right))}};e.bimap=ae;var Ge=function(D){return function(L){return(0,e.isLeft)(L)?(0,e.left)(D(L.left)):L}};e.mapLeft=Ge,e.Bifunctor={URI:e.URI,bimap:S,mapLeft:w};var ve=function(D){return function(L){return(0,e.isLeft)(L)?D():L}};e.altW=ve,e.alt=e.altW,e.Alt={URI:e.URI,map:A,alt:T};var De=function(D){return function(L){return(0,e.isLeft)(L)?L:(0,e.right)(D(L))}};e.extend=De,e.Extend={URI:e.URI,map:A,extend:E},e.ChainRec={URI:e.URI,map:A,ap:g,chain:y,chainRec:R},e.throwError=e.left,e.MonadThrow={URI:e.URI,map:A,ap:g,of:e.of,chain:y,throwError:e.throwError},e.FromEither={URI:e.URI,fromEither:l.identity},e.fromPredicate=(0,u.fromPredicate)(e.FromEither),e.fromOption=(0,u.fromOption)(e.FromEither),e.isLeft=f.isLeft,e.isRight=f.isRight;var mt=function(D,L){return function(U){return(0,e.isLeft)(U)?D(U.left):L(U.right)}};e.matchW=mt,e.foldW=e.matchW,e.match=e.matchW,e.fold=e.match;var rn=function(D){return function(L){return(0,e.isLeft)(L)?D(L.left):L.right}};e.getOrElseW=rn,e.getOrElse=e.getOrElseW,e.flap=(0,c.flap)(e.Functor),e.apFirst=(0,o.apFirst)(e.Apply),e.apFirstW=e.apFirst,e.apSecond=(0,o.apSecond)(e.Apply),e.apSecondW=e.apSecond,e.chainFirst=(0,a.chainFirst)(e.Chain),e.chainFirstW=e.chainFirst,e.flattenW=(0,e.chainW)(l.identity),e.flatten=e.flattenW,e.duplicate=(0,e.extend)(l.identity),e.fromOptionK=(0,u.fromOptionK)(e.FromEither),e.chainOptionK=(0,u.chainOptionK)(e.FromEither,e.Chain),e.filterOrElse=(0,u.filterOrElse)(e.FromEither,e.Chain),e.filterOrElseW=e.filterOrElse;var Ht=function(D){return(0,e.isLeft)(D)?(0,e.right)(D.left):(0,e.left)(D.right)};e.swap=Ht;var _e=function(D){return function(L){return(0,e.isLeft)(L)?D(L.left):L}};e.orElseW=_e,e.orElse=e.orElseW;var Ze=function(D){return function(L){return L==null?(0,e.left)(D):(0,e.right)(L)}};e.fromNullable=Ze;var pt=function(D,L){try{return(0,e.right)(D())}catch(U){return(0,e.left)(L(U))}};e.tryCatch=pt;var tt=function(D,L){return function(){for(var U=[],ce=0;ce<arguments.length;ce++)U[ce]=arguments[ce];return(0,e.tryCatch)(function(){return D.apply(void 0,U)},L)}};e.tryCatchK=tt;var lt=function(D){var L=(0,e.fromNullable)(D);return function(U){return(0,l.flow)(U,L)}};e.fromNullableK=lt;var Yt=function(D){var L=(0,e.fromNullableK)(D);return function(U){return(0,e.chain)(L(U))}};e.chainNullableK=Yt,e.toUnion=(0,e.foldW)(l.identity,l.identity);function Sn(D){return D instanceof Error?D:new Error(String(D))}e.toError=Sn;function Gt(D){return function(L,U){if(U===void 0){var ce=Gt(D);return function(j){return ce(L,j)}}return(0,e.isLeft)(U)?!1:D.equals(L,U.right)}}e.elem=Gt;var It=function(D){return function(L){return(0,e.isLeft)(L)?!1:D(L.right)}};e.exists=It,e.Do=(0,e.of)(f.emptyRecord),e.bindTo=(0,c.bindTo)(e.Functor),e.bind=(0,a.bind)(e.Chain),e.bindW=e.bind,e.apS=(0,o.apS)(e.Apply),e.apSW=e.apS,e.ApT=(0,e.of)(f.emptyReadonlyArray);var _r=function(D){return function(L){var U=D(0,f.head(L));if((0,e.isLeft)(U))return U;for(var ce=[U.right],j=1;j<L.length;j++){var te=D(j,L[j]);if((0,e.isLeft)(te))return te;ce.push(te.right)}return(0,e.right)(ce)}};e.traverseReadonlyNonEmptyArrayWithIndex=_r;var Bt=function(D){var L=(0,e.traverseReadonlyNonEmptyArrayWithIndex)(D);return function(U){return f.isNonEmpty(U)?L(U):e.ApT}};e.traverseReadonlyArrayWithIndex=Bt,e.traverseArrayWithIndex=e.traverseReadonlyArrayWithIndex;var Jt=function(D){return(0,e.traverseReadonlyArrayWithIndex)(function(L,U){return D(U)})};e.traverseArray=Jt,e.sequenceArray=(0,e.traverseArray)(l.identity);function on(D,L){return(0,e.tryCatch)(function(){return JSON.parse(D)},L)}e.parseJSON=on;var xr=function(D,L){return(0,e.tryCatch)(function(){var U=JSON.stringify(D);if(typeof U!="string")throw new Error("Converting unsupported structure to JSON");return U},L)};e.stringifyJSON=xr,e.either={URI:e.URI,map:A,of:e.of,ap:g,chain:y,reduce:C,foldMap:_,reduceRight:b,traverse:v,sequence:e.sequence,bimap:S,mapLeft:w,alt:T,extend:E,chainRec:R,throwError:e.throwError},e.getApplySemigroup=(0,o.getApplySemigroup)(e.Apply),e.getApplyMonoid=(0,i.getApplicativeMonoid)(e.Applicative);var Tr=function(D,L){return(0,o.getApplySemigroup)((0,e.getApplicativeValidation)(D))(L)};e.getValidationSemigroup=Tr;var Me=function(D,L){return(0,i.getApplicativeMonoid)((0,e.getApplicativeValidation)(D))(L)};e.getValidationMonoid=Me;function $e(D){var L=(0,e.getApplicativeValidation)(D).ap,U=(0,e.getAltValidation)(D).alt;return{URI:e.URI,_E:void 0,map:A,of:e.of,chain:y,bimap:S,mapLeft:w,reduce:C,foldMap:_,reduceRight:b,extend:E,traverse:v,sequence:e.sequence,chainRec:R,throwError:e.throwError,ap:L,alt:U}}e.getValidation=$e})(cn);var rt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),bd=function(){return bd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},bd.apply(this,arguments)},yEe=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},na=Lt,it=function(e,t,n){return na([{value:e,context:t,message:n}])},Ue=Je,ke=function(){function e(t,n,r,i){this.name=t,this.is=n,this.validate=r,this.encode=i,this.decode=this.decode.bind(this)}return e.prototype.pipe=function(t,n){var r=this;return n===void 0&&(n="pipe(".concat(this.name,", ").concat(t.name,")")),new e(n,t.is,function(i,o){var a=r.validate(i,o);return le(a)?a:t.validate(a.right,o)},this.encode===qe&&t.encode===qe?qe:function(i){return r.encode(t.encode(i))})},e.prototype.asDecoder=function(){return this},e.prototype.asEncoder=function(){return this},e.prototype.decode=function(t){return this.validate(t,[{key:"",type:this,actual:t}])},e}(),qe=function(e){return e};function yV(e){return e.displayName||e.name||"<function".concat(e.length,">")}function bEe(e,t){return{key:e,type:t}}function Zi(e,t,n,r){for(var i=e.length,o=Array(i+1),a=0;a<i;a++)o[a]=e[a];return o[i]={key:t,type:n,actual:r},o}function _a(e,t){for(var n=t.length,r=0;r<n;r++)e.push(t[r])}var hl=Object.prototype.hasOwnProperty;function kw(e){return Object.keys(e).map(function(t){return"".concat(t,": ").concat(e[t].name)}).join(", ")}function Ah(e){for(var t=0;t<e.length;t++)if(e[t].encode!==qe)return!1;return!0}function bV(e){return"{ ".concat(kw(e)," }")}function CV(e){return"Partial<".concat(e,">")}function CEe(e,t,n,r){r===void 0&&(r="{ [K in ".concat(t.name,"]: ").concat(n.name," }"));var i=e.length;return new qO(r,function(o){return hr.is(o)&&e.every(function(a){return n.is(o[a])})},function(o,a){var s=hr.validate(o,a);if(le(s))return s;for(var u=s.right,l={},c=[],f=!1,p=0;p<i;p++){var h=e[p],A=u[h],g=n.validate(A,Zi(a,h,n,A));if(le(g))_a(c,g.left);else{var y=g.right;f=f||y!==A,l[h]=y}}return c.length>0?na(c):Ue(f||Object.keys(u).length!==i?l:u)},n.encode===qe?qe:function(o){for(var a={},s=0;s<i;s++){var u=e[s];a[u]=n.encode(o[u])}return a},t,n)}function WO(e){var t;if(_V(e)){var n=e.value;if(go.is(n))return t={},t[n]=null,t}else{if(IEe(e))return e.keys;if(TV(e)){var r=e.types.map(function(i){return WO(i)});return r.some(hv.is)?void 0:Object.assign.apply(Object,yEe([{}],r,!1))}}}function SEe(e,t,n){return n===void 0&&(n="{ [K in ".concat(e.name,"]: ").concat(t.name," }")),new qO(n,function(r){return hr.is(r)?Object.keys(r).every(function(i){return e.is(i)&&t.is(r[i])}):Tj(t)&&Array.isArray(r)},function(r,i){if(hr.is(r)){for(var o={},a=[],s=Object.keys(r),u=s.length,l=!1,c=0;c<u;c++){var f=s[c],p=r[f],h=e.validate(f,Zi(i,f,e,f));if(le(h))_a(a,h.left);else{var A=h.right;l=l||A!==f,f=A;var g=t.validate(p,Zi(i,f,t,p));if(le(g))_a(a,g.left);else{var y=g.right;l=l||y!==p,o[f]=y}}}return a.length>0?na(a):Ue(l?o:r)}return Tj(t)&&Array.isArray(r)?Ue(r):it(r,i)},e.encode===qe&&t.encode===qe?qe:function(r){for(var i={},o=Object.keys(r),a=o.length,s=0;s<a;s++){var u=o[s];i[String(e.encode(u))]=t.encode(r[u])}return i},e,t)}function SV(e){return"("+e.map(function(t){return t.name}).join(" | ")+")"}function Ow(e,t){for(var n=!0,r=!0,i=!hr.is(e),o=0,a=t;o<a.length;o++){var s=a[o];s!==e&&(n=!1),hr.is(s)&&(r=!1)}if(n)return e;if(r)return t[t.length-1];for(var u={},l=0,c=t;l<c.length;l++){var s=c[l];for(var f in s)(!hl.call(u,f)||i||s[f]!==e[f])&&(u[f]=s[f])}return u}function Mw(e){switch(e._tag){case"RefinementType":case"ReadonlyType":return Mw(e.type);case"InterfaceType":case"StrictType":case"PartialType":return e.props;case"IntersectionType":return e.types.reduce(function(t,n){return Object.assign(t,Mw(n))},{})}}function xj(e,t){for(var n=Object.getOwnPropertyNames(e),r=!1,i={},o=0;o<n.length;o++){var a=n[o];hl.call(t,a)?i[a]=e[a]:r=!0}return r?i:e}function wEe(e){return xV(e)?"{| ".concat(kw(e.props)," |}"):EEe(e)?CV("{| ".concat(kw(e.props)," |}")):"Exact<".concat(e.name,">")}function _Ee(e){return e.length>0}var Er={};function wV(e,t){for(var n=[],r=0,i=e;r<i.length;r++){var o=i[r];t.indexOf(o)!==-1&&n.push(o)}return n}function xEe(e,t){if(e===Er)return t;if(t===Er)return e;var n=Object.assign({},e);for(var r in t)if(hl.call(e,r)){var i=wV(e[r],t[r]);if(_Ee(i))n[r]=i;else{n=Er;break}}else n[r]=t[r];return n}function TEe(e,t){if(e===Er||t===Er)return Er;var n=Er;for(var r in e)if(hl.call(t,r)){var i=wV(e[r],t[r]);i.length===0&&(n===Er&&(n={}),n[r]=e[r].concat(t[r]))}return n}function Tj(e){return e._tag==="AnyType"}function _V(e){return e._tag==="LiteralType"}function IEe(e){return e._tag==="KeyofType"}function xV(e){return e._tag==="InterfaceType"}function EEe(e){return e._tag==="PartialType"}function REe(e){return e._tag==="StrictType"}function $Ee(e){return e._tag==="ExactType"}function kEe(e){return e._tag==="RefinementType"}function OEe(e){return e._tag==="IntersectionType"}function TV(e){return e._tag==="UnionType"}function MEe(e){return e._tag==="RecursiveType"}var WC=[];function Ss(e){if(WC.indexOf(e)!==-1)return Er;if(xV(e)||REe(e)){var t=Er;for(var n in e.props){var r=e.props[n];_V(r)&&(t===Er&&(t={}),t[n]=[r.value])}return t}else{if($Ee(e)||kEe(e))return Ss(e.type);if(OEe(e))return e.types.reduce(function(o,a){return xEe(o,Ss(a))},Er);if(TV(e))return e.types.slice(1).reduce(function(o,a){return TEe(o,Ss(a))},Ss(e.types[0]));if(MEe(e)){WC.push(e);var i=Ss(e.type);return WC.pop(),i}}return Er}function IV(e){var t=Ss(e[0]),n=Object.keys(t),r=e.length,i=function(l){for(var c=t[l].slice(),f=[t[l]],p=1;p<r;p++){var h=e[p],A=Ss(h),g=A[l];if(g===void 0)return"continue-keys";if(g.some(function(y){return c.indexOf(y)!==-1}))return"continue-keys";c.push.apply(c,g),f.push(g)}return{value:[l,f]}};e:for(var o=0,a=n;o<a.length;o++){var s=a[o],u=i(s);if(typeof u=="object")return u.value;switch(u){case"continue-keys":continue e}}}var EV=function(e){rt(t,e);function t(){var n=e.call(this,"null",function(r){return r===null},function(r,i){return n.is(r)?Ue(r):it(r,i)},qe)||this;return n._tag="NullType",n}return t}(ke),Fw=new EV,RV=function(e){rt(t,e);function t(){var n=e.call(this,"undefined",function(r){return r===void 0},function(r,i){return n.is(r)?Ue(r):it(r,i)},qe)||this;return n._tag="UndefinedType",n}return t}(ke),hv=new RV,$V=function(e){rt(t,e);function t(){var n=e.call(this,"void",hv.is,hv.validate,qe)||this;return n._tag="VoidType",n}return t}(ke),Ij=new $V,kV=function(e){rt(t,e);function t(){var n=e.call(this,"unknown",function(r){return!0},Ue,qe)||this;return n._tag="UnknownType",n}return t}(ke),FEe=new kV,OV=function(e){rt(t,e);function t(){var n=e.call(this,"string",function(r){return typeof r=="string"},function(r,i){return n.is(r)?Ue(r):it(r,i)},qe)||this;return n._tag="StringType",n}return t}(ke),go=new OV,MV=function(e){rt(t,e);function t(){var n=e.call(this,"number",function(r){return typeof r=="number"},function(r,i){return n.is(r)?Ue(r):it(r,i)},qe)||this;return n._tag="NumberType",n}return t}(ke),wc=new MV,FV=function(e){rt(t,e);function t(){var n=e.call(this,"bigint",function(r){return typeof r=="bigint"},function(r,i){return n.is(r)?Ue(r):it(r,i)},qe)||this;return n._tag="BigIntType",n}return t}(ke),jEe=new FV,jV=function(e){rt(t,e);function t(){var n=e.call(this,"boolean",function(r){return typeof r=="boolean"},function(r,i){return n.is(r)?Ue(r):it(r,i)},qe)||this;return n._tag="BooleanType",n}return t}(ke),h1=new jV,LV=function(e){rt(t,e);function t(){var n=e.call(this,"UnknownArray",Array.isArray,function(r,i){return n.is(r)?Ue(r):it(r,i)},qe)||this;return n._tag="AnyArrayType",n}return t}(ke),Cd=new LV,DV=function(e){rt(t,e);function t(){var n=e.call(this,"UnknownRecord",function(r){var i=Object.prototype.toString.call(r);return i==="[object Object]"||i==="[object Window]"},function(r,i){return n.is(r)?Ue(r):it(r,i)},qe)||this;return n._tag="AnyDictionaryType",n}return t}(ke),hr=new DV,UV=function(e){rt(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.value=a,s._tag="LiteralType",s}return t}(ke);function Mm(e,t){t===void 0&&(t=JSON.stringify(e));var n=function(r){return r===e};return new UV(t,n,function(r,i){return n(r)?Ue(e):it(r,i)},qe,e)}var BV=function(e){rt(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.keys=a,s._tag="KeyofType",s}return t}(ke);function LEe(e,t){t===void 0&&(t=Object.keys(e).map(function(r){return JSON.stringify(r)}).join(" | "));var n=function(r){return go.is(r)&&hl.call(e,r)};return new BV(t,n,function(r,i){return n(r)?Ue(r):it(r,i)},qe,e)}var PV=function(e){rt(t,e);function t(n,r,i,o,a,s){var u=e.call(this,n,r,i,o)||this;return u.type=a,u.predicate=s,u._tag="RefinementType",u}return t}(ke);function A1(e,t,n){return QO(e,t,n)}var Av=A1(wc,function(e){return Number.isInteger(e)},"Int"),NO=function(e){rt(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.runDefinition=a,s._tag="RecursiveType",s}return t}(ke);Object.defineProperty(NO.prototype,"type",{get:function(){return this.runDefinition()},enumerable:!0,configurable:!0});function KO(e,t){var n,r=function(){return n||(n=t(i),n.name=e),n},i=new NO(e,function(o){return r().is(o)},function(o,a){return r().validate(o,a)},function(o){return r().encode(o)},r);return i}var WV=function(e){rt(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.type=a,s._tag="ArrayType",s}return t}(ke);function m1(e,t){return t===void 0&&(t="Array<".concat(e.name,">")),new WV(t,function(n){return Cd.is(n)&&n.every(e.is)},function(n,r){var i=Cd.validate(n,r);if(le(i))return i;for(var o=i.right,a=o.length,s=o,u=[],l=0;l<a;l++){var c=o[l],f=e.validate(c,Zi(r,String(l),e,c));if(le(f))_a(u,f.left);else{var p=f.right;p!==c&&(s===o&&(s=o.slice()),s[l]=p)}}return u.length>0?na(u):Ue(s)},e.encode===qe?qe:function(n){return n.map(e.encode)},e)}var NV=function(e){rt(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.props=a,s._tag="InterfaceType",s}return t}(ke);function jw(e,t){t===void 0&&(t=bV(e));var n=Object.keys(e),r=n.map(function(o){return e[o]}),i=n.length;return new NV(t,function(o){if(hr.is(o)){for(var a=0;a<i;a++){var s=n[a],u=o[s];if(u===void 0&&!hl.call(o,s)||!r[a].is(u))return!1}return!0}return!1},function(o,a){var s=hr.validate(o,a);if(le(s))return s;for(var u=s.right,l=u,c=[],f=0;f<i;f++){var p=n[f],h=l[p],A=r[f],g=A.validate(h,Zi(a,p,A,h));if(le(g))_a(c,g.left);else{var y=g.right;(y!==h||y===void 0&&!hl.call(l,p))&&(l===u&&(l=bd({},u)),l[p]=y)}}return c.length>0?na(c):Ue(l)},Ah(r)?qe:function(o){for(var a=bd({},o),s=0;s<i;s++){var u=n[s],l=r[s].encode;l!==qe&&(a[u]=l(o[u]))}return a},e)}var KV=function(e){rt(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.props=a,s._tag="PartialType",s}return t}(ke);function DEe(e,t){t===void 0&&(t=CV(bV(e)));var n=Object.keys(e),r=n.map(function(o){return e[o]}),i=n.length;return new KV(t,function(o){if(hr.is(o)){for(var a=0;a<i;a++){var s=n[a],u=o[s];if(u!==void 0&&!e[s].is(u))return!1}return!0}return!1},function(o,a){var s=hr.validate(o,a);if(le(s))return s;for(var u=s.right,l=u,c=[],f=0;f<i;f++){var p=n[f],h=l[p],A=e[p],g=A.validate(h,Zi(a,p,A,h));if(le(g))h!==void 0&&_a(c,g.left);else{var y=g.right;y!==h&&(l===u&&(l=bd({},u)),l[p]=y)}}return c.length>0?na(c):Ue(l)},Ah(r)?qe:function(o){for(var a=bd({},o),s=0;s<i;s++){var u=n[s],l=o[u];l!==void 0&&(a[u]=r[s].encode(l))}return a},e)}var qO=function(e){rt(t,e);function t(n,r,i,o,a,s){var u=e.call(this,n,r,i,o)||this;return u.domain=a,u.codomain=s,u._tag="DictionaryType",u}return t}(ke);function VO(e,t,n){var r=WO(e);return r?CEe(Object.keys(r),e,t,n):SEe(e,t,n)}var zO=function(e){rt(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.types=a,s._tag="UnionType",s}return t}(ke);function Fm(e,t){t===void 0&&(t=SV(e));var n=IV(e);if(n!==void 0&&e.length>0){var r=n[0],i=n[1],o=i.length,a=function(s){for(var u=0;u<o;u++)if(i[u].indexOf(s)!==-1)return u};return new mv(t,function(s){if(hr.is(s)){var u=a(s[r]);return u!==void 0?e[u].is(s):!1}return!1},function(s,u){var l=hr.validate(s,u);if(le(l))return l;var c=l.right,f=a(c[r]);if(f===void 0)return it(s,u);var p=e[f];return p.validate(c,Zi(u,String(f),p,c))},Ah(e)?qe:function(s){var u=a(s[r]);if(u===void 0)throw new Error("no codec found to encode value in union codec ".concat(t));return e[u].encode(s)},e,r)}else return new zO(t,function(s){return e.some(function(u){return u.is(s)})},function(s,u){for(var l=[],c=0;c<e.length;c++){var f=e[c],p=f.validate(s,Zi(u,String(c),f,s));if(le(p))_a(l,p.left);else return Ue(p.right)}return na(l)},Ah(e)?qe:function(s){for(var u=0,l=e;u<l.length;u++){var c=l[u];if(c.is(s))return c.encode(s)}throw new Error("no codec found to encode value in union type ".concat(t))},e)}var qV=function(e){rt(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.types=a,s._tag="IntersectionType",s}return t}(ke);function UEe(e,t){t===void 0&&(t="(".concat(e.map(function(r){return r.name}).join(" & "),")"));var n=e.length;return new qV(t,function(r){return e.every(function(i){return i.is(r)})},e.length===0?Ue:function(r,i){for(var o=[],a=[],s=0;s<n;s++){var u=e[s],l=u.validate(r,Zi(i,String(s),u,r));le(l)?_a(a,l.left):o.push(l.right)}return a.length>0?na(a):Ue(Ow(r,o))},e.length===0?qe:function(r){return Ow(r,e.map(function(i){return i.encode(r)}))},e)}var VV=function(e){rt(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.types=a,s._tag="TupleType",s}return t}(ke);function BEe(e,t){t===void 0&&(t="[".concat(e.map(function(r){return r.name}).join(", "),"]"));var n=e.length;return new VV(t,function(r){return Cd.is(r)&&r.length===n&&e.every(function(i,o){return i.is(r[o])})},function(r,i){var o=Cd.validate(r,i);if(le(o))return o;for(var a=o.right,s=a.length>n?a.slice(0,n):a,u=[],l=0;l<n;l++){var c=a[l],f=e[l],p=f.validate(c,Zi(i,String(l),f,c));if(le(p))_a(u,p.left);else{var h=p.right;h!==c&&(s===a&&(s=a.slice()),s[l]=h)}}return u.length>0?na(u):Ue(s)},Ah(e)?qe:function(r){return e.map(function(i,o){return i.encode(r[o])})},e)}var zV=function(e){rt(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.type=a,s._tag="ReadonlyType",s}return t}(ke);function PEe(e,t){return t===void 0&&(t="Readonly<".concat(e.name,">")),new zV(t,e.is,e.validate,e.encode,e)}var QV=function(e){rt(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.type=a,s._tag="ReadonlyArrayType",s}return t}(ke);function HV(e,t){t===void 0&&(t="ReadonlyArray<".concat(e.name,">"));var n=m1(e);return new QV(t,n.is,n.validate,n.encode,e)}var mh=function(e,t){return GV(jw(e),t)},YV=function(e){rt(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.type=a,s._tag="ExactType",s}return t}(ke);function GV(e,t){t===void 0&&(t=wEe(e));var n=Mw(e);return new YV(t,e.is,function(r,i){var o=hr.validate(r,i);if(le(o))return o;var a=e.validate(r,i);return le(a)?a:Je(xj(a.right,n))},function(r){return e.encode(xj(r,n))},e)}var JV=function(e){rt(t,e);function t(){var n=e.call(this,"Function",function(r){return typeof r=="function"},function(r,i){return n.is(r)?Ue(r):it(r,i)},qe)||this;return n._tag="FunctionType",n}return t}(ke),WEe=new JV,mv=function(e){rt(t,e);function t(n,r,i,o,a,s){var u=e.call(this,n,r,i,o,a)||this;return u.tag=s,u}return t}(zO),NEe=function(e,t,n){n===void 0&&(n=SV(t));var r=Fm(t,n);return r instanceof mv?r:(console.warn("[io-ts] Cannot build a tagged union for ".concat(n,", returning a de-optimized union")),new mv(n,r.is,r.validate,r.encode,t,e))},KEe=function(e,t){return{value:e,context:t}},ZV=function(e){return[{key:"",type:e}]},XV=function(e){rt(t,e);function t(){var n=e.call(this,"never",function(r){return!1},function(r,i){return it(r,i)},function(){throw new Error("cannot encode never")})||this;return n._tag="NeverType",n}return t}(ke),qEe=new XV,ez=function(e){rt(t,e);function t(){var n=e.call(this,"any",function(r){return!0},Ue,qe)||this;return n._tag="AnyType",n}return t}(ke),VEe=new ez,zEe=hr,tz=function(e){rt(t,e);function t(){var n=e.call(this,"object",function(r){return r!==null&&typeof r=="object"},function(r,i){return n.is(r)?Ue(r):it(r,i)},qe)||this;return n._tag="ObjectType",n}return t}(ke),QEe=new tz;function QO(e,t,n){return n===void 0&&(n="(".concat(e.name," | ").concat(yV(t),")")),new PV(n,function(r){return e.is(r)&&t(r)},function(r,i){var o=e.validate(r,i);if(le(o))return o;var a=o.right;return t(a)?Ue(a):it(a,i)},e.encode,e,t)}var HEe=QO(wc,Number.isInteger,"Integer"),YEe=VO,GEe=function(e){rt(t,e);function t(n,r,i,o,a){var s=e.call(this,n,r,i,o)||this;return s.props=a,s._tag="StrictType",s}return t}(ke);function JEe(e){return e}function ZEe(e){return function(){return e}}const XEe=Object.freeze(Object.defineProperty({__proto__:null,AnyArrayType:LV,AnyDictionaryType:DV,AnyType:ez,Array:Cd,ArrayType:WV,BigIntType:FV,BooleanType:jV,Dictionary:zEe,DictionaryType:qO,ExactType:YV,Function:WEe,FunctionType:JV,Int:Av,Integer:HEe,InterfaceType:NV,IntersectionType:qV,KeyofType:BV,LiteralType:UV,NeverType:XV,NullType:EV,NumberType:MV,ObjectType:tz,PartialType:KV,ReadonlyArrayType:QV,ReadonlyType:zV,RecursiveType:NO,RefinementType:PV,StrictType:GEe,StringType:OV,TaggedUnionType:mv,TupleType:VV,Type:ke,UndefinedType:RV,UnionType:zO,UnknownArray:Cd,UnknownRecord:hr,UnknownType:kV,VoidType:$V,alias:ZEe,any:VEe,appendContext:Zi,array:m1,bigint:jEe,boolean:h1,brand:A1,clean:JEe,dictionary:YEe,emptyTags:Er,exact:GV,failure:it,failures:na,getContextEntry:bEe,getDefaultContext:ZV,getDomainKeys:WO,getFunctionName:yV,getIndex:IV,getTags:Ss,getValidationError:KEe,identity:qe,interface:jw,intersection:UEe,keyof:LEe,literal:Mm,mergeAll:Ow,never:qEe,null:Fw,nullType:Fw,number:wc,object:QEe,partial:DEe,readonly:PEe,readonlyArray:HV,record:VO,recursion:KO,refinement:QO,strict:mh,string:go,success:Ue,taggedUnion:NEe,tuple:BEe,type:jw,undefined:hv,union:Fm,unknown:FEe,void:Ij,voidType:Ij},Symbol.toStringTag,{value:"Module"})),ne=kl(XEe);var jm={};Object.defineProperty(jm,"__esModule",{value:!0});jm.ContentPath=void 0;const Ej="::";jm.ContentPath={serialize(e){return e.map(t=>t.key).join(Ej)},current(e){return e[e.length-1]},append(e,t){return e+Ej+t},make(e){return e.reduce((t,{key:n,type:r})=>n?t.concat({key:n,type:r}):t,[])}};var _c={},g1={};Object.defineProperty(g1,"__esModule",{value:!0});g1.getAssetOrThrow=void 0;const eRe=e=>t=>{const n=e[t];if(!n)throw new Error(`Missing asset with id '${t}'!`);return n};g1.getAssetOrThrow=eRe;var v1={};Object.defineProperty(v1,"__esModule",{value:!0});v1.getEmbedOrThrow=void 0;const tRe=e=>t=>{const n=e[t];if(!n)throw new Error(`Missing embed with url '${t}'`);return n};v1.getEmbedOrThrow=tRe;var y1={},nt={};const vo=kl(LU);function nz(e,t,n){return n===void 0&&(n=e.name),new ke(n,e.is,e.validate,function(r){return t(e.encode(r))})}const nRe=Object.freeze(Object.defineProperty({__proto__:null,mapOutput:nz},Symbol.toStringTag,{value:"Module"}));var rz=A1(go,function(e){return e.length>0},"NonEmptyString");function iz(e,t){t===void 0&&(t="NonEmptyArray<"+e.name+">");var n=m1(e);return new ke(t,function(r){return n.is(r)&&tn(r)},function(r,i){return ge(n.validate(r,i),Mi(function(o){var a=iT(o);return Qe(a)?it(r,i):Ue(a.value)}))},function(r){return n.encode(r)})}function oz(e,t,n){n===void 0&&(n="Set<"+e.name+">");var r=m1(e),i=Z8(t),o=Y8(t);return new ke(n,function(a){return a instanceof Set&&J8(e.is)(a)},function(a,s){return ge(r.validate(a,s),Mi(function(u){var l=o(u);return l.size!==u.length?it(a,s):Ue(l)}))},function(a){return r.encode(i(a))})}function rRe(e,t,n){return n===void 0&&(n="ReadonlySet<"+e.name+">"),oz(e,t,n)}function HO(e,t){return new ke(e,t,function(n,r){return t(n)?Ue(n):it(n,r)},qe)}var iRe=function(e){return e instanceof Date},oRe=HO("Date",iRe),aRe=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},sRe=function(e,t){return{get:e,reverseGet:t}},az=function(e){return wu(e.get,X(e.reverseGet,Lr))},uRe=function(e){return xc(X(e.get,kt),e.reverseGet)},lRe=function(e){return ls(X(e.get,kt),X(e.reverseGet,Lr))},cRe=function(e){return sp(function(t){return function(n){return function(r){return t.map(n(e.get(r)),function(i){return e.reverseGet(i)})}}})},wu=function(e,t){return{get:e,set:t}},YO=function(e){return ls(X(e.get,kt),e.set)},dRe=function(e){return sp(function(t){return function(n){return function(r){return t.map(n(e.get(r)),function(i){return e.set(i)(r)})}}})},sz=function(e){return function(t){return wu(function(n){return e.get(t.get(n))},function(n){return function(r){return t.set(e.set(n)(t.get(r)))(r)}})}},fRe=function(e){return function(t){return xc(X(t.getOption,yA(e.getOption)),X(e.reverseGet,t.reverseGet))}},pRe=function(e){return function(t){return Tc(GO(e))(YO(t))}},hRe=function(){return wu(Q,Lr)},ARe=function(e){return function(t){return wu(function(n){return t.get(n)[e]},function(n){return function(r){var i,o=t.get(r);return n===o[e]?r:t.set(Object.assign({},o,(i={},i[e]=n,i)))(r)}})}},mRe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return wu(function(r){for(var i=n.get(r),o={},a=0,s=e;a<s.length;a++){var u=s[a];o[u]=i[u]}return o},function(r){return function(i){for(var o=n.get(i),a=0,s=e;a<s.length;a++){var u=s[a];if(r[u]!==o[u])return n.set(Object.assign({},o,r))(i)}return i}})}},gRe=function(e){return function(t){return wu(function(n){return t.get(n)[e]},function(n){return function(r){var i=t.get(r);if(n===i[e])return r;var o=i.slice();return o[e]=n,t.set(o)(r)}})}},vRe=function(e){return function(t){return ge(t,sz(PRe().at(e)))}},xc=function(e,t){return{getOption:e,reverseGet:t}},GO=function(e){return ls(e.getOption,function(t){return lz(t)(e)})},uz=function(e){return sp(function(t){return function(n){return function(r){return ge(e.getOption(r),ru(function(){return t.of(r)},function(i){return t.map(n(i),function(o){return lz(o)(e)(r)})}))}}})},yRe=function(e){return function(t){return function(n){return ge(t.getOption(n),Ko(function(r){var i=e(r);return i===r?n:t.reverseGet(i)}))}}},bRe=function(e){return function(t){var n=yRe(e)(t);return function(r){return ge(n(r),LI(function(){return r}))}}},lz=function(e){return bRe(function(){return e})},CRe=function(e){return function(t){return Tc(YO(e))(GO(t))}},SRe=function(){return xc(Pl,Q)},JO=function(e){return xc(A0(e),Q)},wRe=function(){return xc(Q,kt)},_Re=function(){return xc(pf,Je)},xRe=function(){return xc(function(e){return le(e)?kt(e.left):dt},Lt)},ls=function(e,t){return{getOption:e,set:t}},TRe=function(e){return sp(function(t){return function(n){return function(r){return ge(e.getOption(r),ru(function(){return t.of(r)},function(i){return t.map(n(i),function(o){return e.set(o)(r)})}))}}})},cz=function(e){return function(t){return function(n){return ge(t.getOption(n),Ko(function(r){var i=e(r);return i===r?n:t.set(i)(n)}))}}},dz=function(e){return function(t){var n=cz(e)(t);return function(r){return ge(n(r),LI(function(){return r}))}}},Tc=function(e){return function(t){return ls(X(t.getOption,yA(e.getOption)),function(n){return dz(e.set(n))(t)})}},IRe=function(e){return function(t){return ge(t,Tc(LRe().index(e)))}},ERe=function(e){return function(t){return ge(t,Tc(DRe().index(e)))}},RRe=function(e){return function(t){return ge(t,Tc(URe().index(e)))}},$Re=function(e){return ls(Yy(e),function(t){return function(n){return ge(Hy(e)(n),ru(function(){return n},function(r){return o0(r,t,n)}))}})},fz=function(e,t,n){if(n[e]===t)return n;var r=aRe([n[0]],n.slice(1),!0);return r[e]=t,r},kRe=function(e){return ls(Yy(e),function(t){return function(n){return ge(Hy(e)(n),ru(function(){return n},function(r){return fz(r,t,n)}))}})},sp=function(e){return{modifyF:e}};function ZO(e){return function(t){return sp(function(n){return function(r){return t.modifyF(n)(e.modifyF(n)(r))}})}}var ORe={URI:"Identity",map:function(e,t){return t(e)},of:Q,ap:function(e,t){return e(t)}},MRe=function(e){return e.URI==="Identity"};function FRe(e){return function(){return sp(function(t){var n=MRe(t)?e.map:e.traverse(t);return function(r){return function(i){return n(i,r)}}})}}function jRe(e){return ZO(FRe(e)())}var XO=function(e){return{index:e}},LRe=function(){return XO(function(e){return ls(function(t){return ll(e,t)},function(t){return function(n){return ge(ll(e,n),ru(function(){return n},function(){return o0(e,t,n)}))}})})},DRe=function(){return XO(function(e){return ls(function(t){return ll(e,t)},function(t){return function(n){return ge(ll(e,n),ru(function(){return n},function(){return fz(e,t,n)}))}})})},URe=function(){return XO(function(e){return ls(function(t){return cl(e,t)},function(t){return function(n){return n[e]===t||Qe(cl(e,n))?n:L$(e,t)(n)}})})},BRe=function(e){return{at:e}};function PRe(){return BRe(function(e){return wu(function(t){return cl(e,t)},ru(function(){return _$(e)},function(t){return L$(e,t)}))})}var pz=sRe,Lw=az,Dw=uRe,Uw=lRe,Bw=cRe,WRe=function(e){return function(t){return pz(X(t.get,e.get),X(e.reverseGet,t.reverseGet))}},NRe=function(e){return pz(e.reverseGet,e.get)},KRe=function(e){return function(t){return function(n){return t.reverseGet(e(t.get(n)))}}},hz=wu,gv=hRe,Bs=YO,Sd=dRe,Al=sz,qRe=Al,VRe=X(az,Al),Ic=pRe,eM=function(e){return X(Bs,Tc(e))},zRe=function(e){return X(Sd,ZO(e))},Az=function(e){return function(t){return function(n){var r=t.get(n),i=e(r);return r===i?n:t.set(i)(n)}}};function QRe(e){return function(t){return function(n){return function(r){return ge(n.get(r),t,function(i){return e.map(i,function(o){return n.set(o)(r)})})}}}}var HRe=function(e){return Ic(SRe())(e)};function YRe(e){return Ic(JO(e))}var mz=ARe,gz=mRe,GRe=gRe,JRe=function(e){return X(Bs,IRe(e))},ZRe=function(e){return X(Bs,ERe(e))},XRe=function(e){return X(Bs,RRe(e))},e$e=vRe,t$e=Ic(wRe()),n$e=Ic(_Re()),r$e=Ic(xRe());function i$e(e){return X(Sd,jRe(e))}function o$e(e){return eM($Re(e))}function a$e(e){return eM(kRe(e))}var s$e=function(e,t){return function(n){return vz(n,e,t)}},vz=function(e,t,n){return hz(X(e.get,t),X(n,e.set))},b1="monocle-ts/Lens",u$e={URI:b1,imap:vz},yz={URI:b1,compose:function(e,t){return Al(e)(t)}},l$e={URI:b1,compose:yz.compose,id:gv};const c$e=Object.freeze(Object.defineProperty({__proto__:null,Category:l$e,Invariant:u$e,Semigroupoid:yz,URI:b1,asOptional:Bs,asTraversal:Sd,atKey:e$e,component:GRe,compose:Al,composeIso:VRe,composeLens:qRe,composeOptional:eM,composePrism:Ic,composeTraversal:zRe,filter:YRe,findFirst:o$e,findFirstNonEmpty:a$e,fromNullable:HRe,id:gv,imap:s$e,index:JRe,indexNonEmpty:ZRe,key:XRe,left:r$e,lens:hz,modify:Az,modifyF:QRe,prop:mz,props:gz,right:n$e,some:t$e,traverse:i$e},Symbol.toStringTag,{value:"Module"}));var Rj=TRe,Qu=Tc,d$e=cz,f$e=dz,p$e=JO,Pw=GO,Ww=uz,Nw=fRe,h$e=CRe,va=ZO,bz=function(e){return function(t){return t.modifyF(ORe)(e)}},A$e=function(e){return bz(function(){return e})};function m$e(e){return va(uz(JO(e)))}var $j=function(e){return new Sz(e.get,e.reverseGet)},Xc=function(e){return new tM(e.get,e.set)},Vp=function(e){return new wz(e.getOption,e.reverseGet)},_i=function(e){return new g$e(e.getOption,e.set)},Qr=function(e){return new v$e(e.modifyF)},Cz=function(e,t,n){var r;return n===e[t]?e:Object.assign({},e,(r={},r[t]=n,r))},Sz=function(){function e(t,n){this.get=t,this.reverseGet=n,this._tag="Iso",this.unwrap=this.get,this.to=this.get,this.wrap=this.reverseGet,this.from=this.reverseGet}return e.prototype.reverse=function(){return $j(NRe(this))},e.prototype.modify=function(t){return KRe(t)(this)},e.prototype.asLens=function(){return Xc(Lw(this))},e.prototype.asPrism=function(){return Vp(Dw(this))},e.prototype.asOptional=function(){return _i(Uw(this))},e.prototype.asTraversal=function(){return Qr(Bw(this))},e.prototype.asFold=function(){var t=this;return new up(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.asGetter=function(){var t=this;return new xz(function(n){return t.get(n)})},e.prototype.asSetter=function(){var t=this;return new Lm(function(n){return t.modify(n)})},e.prototype.compose=function(t){return $j(WRe(t)(this))},e.prototype.composeIso=function(t){return this.compose(t)},e.prototype.composeLens=function(t){return Xc(ge(this,Lw,Al(t)))},e.prototype.composePrism=function(t){return Vp(ge(this,Dw,Nw(t)))},e.prototype.composeOptional=function(t){return _i(ge(this,Uw,Qu(t)))},e.prototype.composeTraversal=function(t){return Qr(ge(this,Bw,va(t)))},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeGetter=function(t){return this.asGetter().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e}(),tM=function(){function e(t,n){this.get=t,this.set=n,this._tag="Lens"}return e.fromPath=function(){var t=e.fromProp();return function(n){var r=t(n[0]);return n.slice(1).reduce(function(i,o){return i.compose(t(o))},r)}},e.fromProp=function(){return function(t){return Xc(ge(gv(),mz(t)))}},e.fromProps=function(){return function(t){return Xc(ge(gv(),gz.apply(c$e,t)))}},e.fromNullableProp=function(){return function(t,n){return new e(function(r){var i=Pl(r[t]);return Qe(i)?n:i.value},function(r){return function(i){return Cz(i,t,r)}})}},e.prototype.modify=function(t){return Az(t)(this)},e.prototype.asOptional=function(){return _i(Bs(this))},e.prototype.asTraversal=function(){return Qr(Sd(this))},e.prototype.asSetter=function(){var t=this;return new Lm(function(n){return t.modify(n)})},e.prototype.asGetter=function(){var t=this;return new xz(function(n){return t.get(n)})},e.prototype.asFold=function(){var t=this;return new up(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.compose=function(t){return Xc(Al(t)(this))},e.prototype.composeLens=function(t){return this.compose(t)},e.prototype.composeGetter=function(t){return this.asGetter().compose(t)},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeOptional=function(t){return _i(ge(this,Bs,Qu(t)))},e.prototype.composeTraversal=function(t){return Qr(ge(this,Sd,va(t)))},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeIso=function(t){return Xc(ge(this,Al(ge(t,Lw))))},e.prototype.composePrism=function(t){return _i(Ic(t)(this))},e}(),wz=function(){function e(t,n){this.getOption=t,this.reverseGet=n,this._tag="Prism"}return e.fromPredicate=function(t){return Vp(p$e(t))},e.some=function(){return _z},e.prototype.modify=function(t){var n=this;return function(r){var i=n.modifyOption(t)(r);return Qe(i)?r:i.value}},e.prototype.modifyOption=function(t){var n=this;return function(r){return qN.map(n.getOption(r),function(i){var o=t(i);return o===i?r:n.reverseGet(o)})}},e.prototype.set=function(t){return this.modify(function(){return t})},e.prototype.asOptional=function(){return _i(Pw(this))},e.prototype.asTraversal=function(){return Qr(Ww(this))},e.prototype.asSetter=function(){var t=this;return new Lm(function(n){return t.modify(n)})},e.prototype.asFold=function(){var t=this;return new up(function(n){return function(r){return function(i){var o=t.getOption(i);return Qe(o)?n.empty:r(o.value)}}})},e.prototype.compose=function(t){return Vp(Nw(t)(this))},e.prototype.composePrism=function(t){return this.compose(t)},e.prototype.composeOptional=function(t){return _i(ge(this,Pw,Qu(t)))},e.prototype.composeTraversal=function(t){return Qr(ge(this,Ww,va(t)))},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeIso=function(t){return Vp(ge(this,Nw(ge(t,Dw))))},e.prototype.composeLens=function(t){return _i(h$e(t)(this))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),_z=new wz(Q,kt),g$e=function(){function e(t,n){this.getOption=t,this.set=n,this._tag="Optional"}return e.fromPath=function(){var t=e.fromNullableProp();return function(n){var r=t(n[0]);return n.slice(1).reduce(function(i,o){return i.compose(t(o))},r)}},e.fromNullableProp=function(){return function(t){return new e(function(n){return Pl(n[t])},function(n){return function(r){return r[t]==null?r:Cz(r,t,n)}})}},e.fromOptionProp=function(){var t=tM.fromProp();return function(n){return t(n).composePrism(_z)}},e.prototype.modify=function(t){return f$e(t)(this)},e.prototype.modifyOption=function(t){return d$e(t)(this)},e.prototype.asTraversal=function(){return Qr(Rj(this))},e.prototype.asFold=function(){var t=this;return new up(function(n){return function(r){return function(i){var o=t.getOption(i);return Qe(o)?n.empty:r(o.value)}}})},e.prototype.asSetter=function(){var t=this;return new Lm(function(n){return t.modify(n)})},e.prototype.compose=function(t){return _i(Qu(t)(this))},e.prototype.composeOptional=function(t){return this.compose(t)},e.prototype.composeTraversal=function(t){return Qr(ge(this,Rj,va(t)))},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeLens=function(t){return _i(ge(this,Qu(ge(t,Bs))))},e.prototype.composePrism=function(t){return _i(ge(this,Qu(ge(t,Pw))))},e.prototype.composeIso=function(t){return _i(ge(this,Qu(ge(t,Uw))))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),v$e=function(){function e(t){this.modifyF=t,this._tag="Traversal"}return e.prototype.modify=function(t){return bz(t)(this)},e.prototype.set=function(t){return A$e(t)(this)},e.prototype.filter=function(t){return Qr(m$e(t)(this))},e.prototype.asFold=function(){var t=this;return new up(function(n){return function(r){return t.modifyF(QN(n))(function(i){return hf(r(i))})}})},e.prototype.asSetter=function(){var t=this;return new Lm(function(n){return t.modify(n)})},e.prototype.compose=function(t){return Qr(va(t)(this))},e.prototype.composeTraversal=function(t){return this.compose(t)},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeOptional=function(t){return this.compose(t.asTraversal())},e.prototype.composeLens=function(t){return Qr(ge(this,va(ge(t,Sd))))},e.prototype.composePrism=function(t){return Qr(ge(this,va(ge(t,Ww))))},e.prototype.composeIso=function(t){return Qr(ge(this,va(ge(t,Bw))))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),xz=function(){function e(t){this.get=t,this._tag="Getter"}return e.prototype.asFold=function(){var t=this;return new up(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.compose=function(t){var n=this;return new e(function(r){return t.get(n.get(r))})},e.prototype.composeGetter=function(t){return this.compose(t)},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeLens=function(t){return this.compose(t.asGetter())},e.prototype.composeIso=function(t){return this.compose(t.asGetter())},e.prototype.composeTraversal=function(t){return this.asFold().compose(t.asFold())},e.prototype.composeOptional=function(t){return this.asFold().compose(t.asFold())},e.prototype.composePrism=function(t){return this.asFold().compose(t.asFold())},e}(),up=function(){function e(t){this.foldMap=t,this._tag="Fold",this.getAll=t(AI())(nu),this.exist=t(C6),this.all=t(b6),this.foldMapFirst=t(VN())}return e.prototype.compose=function(t){var n=this;return new e(function(r){return function(i){return n.foldMap(r)(t.foldMap(r)(i))}})},e.prototype.composeFold=function(t){return this.compose(t)},e.prototype.composeGetter=function(t){return this.compose(t.asFold())},e.prototype.composeTraversal=function(t){return this.compose(t.asFold())},e.prototype.composeOptional=function(t){return this.compose(t.asFold())},e.prototype.composeLens=function(t){return this.compose(t.asFold())},e.prototype.composePrism=function(t){return this.compose(t.asFold())},e.prototype.composeIso=function(t){return this.compose(t.asFold())},e.prototype.find=function(t){return this.foldMapFirst(A0(t))},e.prototype.headOption=function(t){return this.find(function(){return!0})(t)},e}(),Lm=function(){function e(t){this.modify=t,this._tag="Setter"}return e.prototype.set=function(t){return this.modify(Lr(t))},e.prototype.compose=function(t){var n=this;return new e(function(r){return n.modify(t.modify(r))})},e.prototype.composeSetter=function(t){return this.compose(t)},e.prototype.composeTraversal=function(t){return this.compose(t.asSetter())},e.prototype.composeOptional=function(t){return this.compose(t.asSetter())},e.prototype.composeLens=function(t){return this.compose(t.asSetter())},e.prototype.composePrism=function(t){return this.compose(t.asSetter())},e.prototype.composeIso=function(t){return this.compose(t.asSetter())},e}(),y$e=new Sz(dd,dd);function b$e(){return y$e}function C$e(e,t){t===void 0&&(t="fromNewtype("+e.name+")");var n=b$e();return new ke(t,function(r){return e.is(r)},function(r,i){return ge(e.validate(r,i),ql(n.wrap))},function(r){return e.encode(n.unwrap(r))})}var S$e=mh({_tag:Mm("None")}),w$e=Mm("Some");function Tz(e,t){return t===void 0&&(t="Option<"+e.name+">"),Fm([S$e,mh({_tag:w$e,value:e},"Some<"+e.name+">")],t)}function _$e(e,t){return t===void 0&&(t="Option<"+e.name+">"),new ke(t,Tz(e).is,function(n,r){return n==null?Ue(dt):ge(e.validate(n,r),ql(kt))},function(n){return DI(ge(n,Ko(e.encode)))})}var x$e=new ke("DateFromISOString",function(e){return e instanceof Date},function(e,t){return ge(go.validate(e,t),Mi(function(n){var r=new Date(n);return isNaN(r.getTime())?it(e,t):Ue(r)}))},function(e){return e.toISOString()});function T$e(e,t){return t===void 0&&(t="ReadonlyNonEmptyArray<"+e.name+">"),iz(e,t)}function Iz(e){var t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t}var I$e=new ke("DateFromNumber",function(e){return e instanceof Date},function(e,t){return ge(wc.validate(e,t),Mi(function(n){var r=new Date(n);return isNaN(r.getTime())?it(e,t):Ue(r)}))},function(e){return e.getTime()});function C1(e,t,n){n===void 0&&(n=e.name);var r=Iz(e);return r.validate=t,r.decode=function(i){return t(i,ZV(r))},r.name=n,r}function E$e(e,t,n){return n===void 0&&(n="withFallback("+e.name+")"),C1(e,function(r,i){return wK(function(){return Ue(t)})(e.validate(r,i))},n)}var R$e=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,$$e=A1(go,function(e){return R$e.test(e)},"UUID");function k$e(e,t,n){return n===void 0&&(n="fromNullable("+e.name+")"),C1(e,function(r,i){return r==null?Ue(t):e.validate(r,i)},n)}var O$e=new ke("BooleanFromString",h1.is,function(e,t){return ge(go.validate(e,t),Mi(function(n){return n==="true"?Ue(!0):n==="false"?Ue(!1):it(e,t)}))},String);function M$e(e,t){return C1(e,function(n,r){return IA(function(){return[{value:n,context:r,message:t(n,r),actual:n}]})(e.validate(n,r))})}function Ez(e){switch(e._tag){case"InterfaceType":return e.props;case"ExactType":return Ez(e.type)}}var F$e=tM.fromProp();function j$e(e){var t={};for(var n in Ez(e))t[n]=F$e(n);return t}var L$e=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},D$e=HO("RegExp",L$e),U$e=new ke("DateFromUnixTime",function(e){return e instanceof Date},function(e,t){return ge(Av.validate(e,t),Mi(function(n){var r=new Date(n*1e3);return isNaN(r.getTime())?it(e,t):Ue(r)}))},function(e){return Math.floor(e.getTime()/1e3)}),Kw=new ke("NumberFromString",wc.is,function(e,t){return ge(go.validate(e,t),Mi(function(n){var r=+n;return isNaN(r)||n.trim()===""?it(e,t):Ue(r)}))},String),B$e=new ke("IntFromString",Av.is,function(e,t){return ge(Kw.validate(e,t),Mi(function(n){return Av.is(n)?Ue(n):it(e,t)}))},Kw.encode),Rz=KO("JsonArray",function(){return HV(S1)}),$z=KO("JsonRecord",function(){return VO(go,S1)}),S1=Fm([h1,wc,go,Fw,Rz,$z],"Json"),P$e=new ke("JsonFromString",S1.is,function(e,t){try{return Ue(JSON.parse(e))}catch{return it(e,t)}},function(e){return JSON.stringify(e)}),W$e=Mm("Left"),N$e=Mm("Right");function K$e(e,t,n){return n===void 0&&(n="Either<"+e.name+", "+t.name+">"),Fm([mh({_tag:W$e,left:e},"Left<"+e.name+">"),mh({_tag:N$e,right:t},"Right<"+e.name+">")],n)}var q$e=new ke("BigIntFromString",function(e){return typeof e=="bigint"},function(e,t){return ge(go.validate(e,t),Mi(function(n){if(!rz.is(n.trim()))return it(e,t);try{return Ue(BigInt(n))}catch{return it(e,t)}}))},String);function V$e(e,t,n){return n===void 0&&(n=e.name),new ke(n,e.is,e.validate,t)}var z$e=new ke("BooleanFromNumber",h1.is,function(e,t){return ge(wc.validate(e,t),ql(function(n){return n!==0}))},Number);const Q$e=Object.freeze(Object.defineProperty({__proto__:null,BigIntFromString:q$e,BooleanFromNumber:z$e,BooleanFromString:O$e,DateFromISOString:x$e,DateFromNumber:I$e,DateFromUnixTime:U$e,IntFromString:B$e,Json:S1,JsonArray:Rz,JsonFromString:P$e,JsonRecord:$z,NonEmptyString:rz,NumberFromString:Kw,UUID:$$e,clone:Iz,date:oRe,either:K$e,fromNewtype:C$e,fromNullable:k$e,fromRefinement:HO,getLenses:j$e,mapOutput:nz,nonEmptyArray:iz,option:Tz,optionFromNullable:_$e,readonlyNonEmptyArray:T$e,readonlySetFromArray:rRe,regexp:D$e,setFromArray:oz,withEncode:V$e,withFallback:E$e,withMessage:M$e,withValidate:C1},Symbol.toStringTag,{value:"Module"})),w1=kl(Q$e),H$e=kl(nRe);Object.defineProperty(nt,"__esModule",{value:!0});nt.withCustomError=nt.addType=nt.isEmpty=nt.objectToMap=nt.grouped=nt.formatDate=nt.formatDateTime=nt.filterDouble=nt.refineType=nt.nullable=void 0;const Y$e=G,kz=ut,G$e=vo,nd=(0,Y$e.__importStar)(ne),J$e=w1,Z$e=H$e;function X$e(e){return nd.union([e,nd.null,nd.undefined])}nt.nullable=X$e;function eke(e,t,n){return new nd.Type(t,e.is,(r,i)=>(0,G$e.pipe)(e.validate(r,i),kz.either.chain(o=>n(o)?nd.success(o):nd.failure(r,i))),e.encode)}nt.refineType=eke;function tke(e){if(e==="")return null;const t=Number(e);return Number.isNaN(t)?null:t}nt.filterDouble=tke;function nke(e){return e.toISOString().replace(/\.\d{3}Z$/,"+0000")}nt.formatDateTime=nke;function rke(e){return e.toISOString().replace(/T.*/,"")}nt.formatDate=rke;function ike(e,t){return e.reduce((n,r,i)=>(i%t===0?n.push([r]):n[Math.floor(i/t)].push(r),n),new Array)}nt.grouped=ike;function oke(e){return new Map(Object.entries(e))}nt.objectToMap=oke;function ake(e){for(const t in e)return!1;return!0}nt.isEmpty=ake;function ske(e,t){return(0,Z$e.mapOutput)(e,n=>({...n,__TYPE__:t}))}nt.addType=ske;function uke(e,t){return(0,J$e.withValidate)(e,(n,r)=>kz.either.mapLeft(i=>i.find(o=>o.message)?i:[{value:n,context:r,message:t(n,r),actual:n}])(e.validate(n,r)))}nt.withCustomError=uke;Object.defineProperty(y1,"__esModule",{value:!0});y1.WidgetKey=void 0;const lke=G,cke=(0,lke.__importStar)(ne),dke=nt,fke=new RegExp("^[^<>]+$");y1.WidgetKey=(0,dke.refineType)(cke.string,"WidgetKey",e=>e.length===0||fke.test(e));(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(g1,e),(0,t.__exportStar)(v1,e),(0,t.__exportStar)(y1,e)})(_c);var he={},Oz={},lp={},_1={},x1={};Object.defineProperty(x1,"__esModule",{value:!0});x1.clone=void 0;function pke(e){var t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t}x1.clone=pke;var hke=Se&&Se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Ake=Se&&Se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),mke=Se&&Se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&hke(t,e,n);return Ake(t,e),t};Object.defineProperty(_1,"__esModule",{value:!0});_1.withValidate=void 0;var gke=mke(ne),vke=x1;function yke(e,t,n){n===void 0&&(n=e.name);var r=vke.clone(e);return r.validate=t,r.decode=function(i){return t(i,gke.getDefaultContext(r))},r.name=n,r}_1.withValidate=yke;var bke=Se&&Se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Cke=Se&&Se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Ske=Se&&Se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&bke(t,e,n);return Cke(t,e),t};Object.defineProperty(lp,"__esModule",{value:!0});lp.withFallback=void 0;var wke=Ske(ne),_ke=_1,xke=cn;function Tke(e,t,n){return n===void 0&&(n="withFallback("+e.name+")"),_ke.withValidate(e,function(r,i){return xke.orElse(function(){return wke.success(t)})(e.validate(r,i))},n)}lp.withFallback=Tke;var NC={},pn={};Object.defineProperty(pn,"__esModule",{value:!0});pn.EmptyArray=pn.EmptyObject=pn.Boolean=pn.NumberOrNull=pn.Number=pn.StringOrNull=pn.String=void 0;const Ike=G,Eke=ut,Rke=Ye,Zt=(0,Ike.__importStar)(ne),Dm=nt;pn.String=(0,Dm.withCustomError)(Zt.string,()=>"The value must be a string");pn.StringOrNull=(0,Dm.withCustomError)(Zt.union([Zt.string,Zt.null]),()=>"The value must be a string or null");pn.Number=(0,Dm.withCustomError)(Zt.number,()=>"The value must be a number");pn.NumberOrNull=(0,Dm.withCustomError)(Zt.union([Zt.number,Zt.null]),()=>"The value must be a number or null");pn.Boolean=(0,Dm.withCustomError)(Zt.boolean,()=>"The value must be a boolean");pn.EmptyObject=Zt.UnknownRecord.pipe(new Zt.Type("emptyObject",e=>Zt.UnknownRecord.is(e),(e,t)=>Object.keys(e).length>0?Zt.failure(e,t,"The object is not empty."):Zt.success({}),Zt.identity));pn.EmptyArray=new Zt.Type("emptyArray",e=>Zt.UnknownArray.is(e)&&e.length===0,(e,t)=>(0,Rke.pipe)(Zt.UnknownArray.decode(e),Eke.either.chain(n=>n.length>0?Zt.failure(e,t,"The array is not empty."):Zt.success(new Array))),()=>[]);var dg={};const cs=kl(kK);var kj;function $ke(){if(kj)return dg;kj=1,Object.defineProperty(dg,"__esModule",{value:!0});const e=G,t=cs,n=vo,r=(0,e.__importStar)(ne),i=ft();return dg.default=new r.Type("dateFromString",o=>o instanceof Date,(o,a)=>(0,n.pipe)(i.String.validate(o,a),(0,t.chain)(s=>{const u=new Date(s);return isNaN(u.getTime())?r.failure(o,a):r.success(u)})),o=>o.toISOString()),dg}var nM={};Object.defineProperty(nM,"__esModule",{value:!0});const kke=G,Oke=cs,Mke=vo,jc=(0,kke.__importStar)(ne);nM.default=new jc.Type("dateFromStringOrNumber",e=>e instanceof Date,(e,t)=>(0,Mke.pipe)(jc.union([jc.number,jc.string]).validate(e,t),(0,Oke.chain)(n=>{const r=new Date(n);return isNaN(r.getTime())?jc.failure(e,t):jc.success(r)})),e=>e);var rM={};Object.defineProperty(rM,"__esModule",{value:!0});const Fke=G,jke=cs,Lke=vo,fg=(0,Fke.__importStar)(ne);rM.default=new fg.Type("dateFromTsMs",e=>e instanceof Date,(e,t)=>(0,Lke.pipe)(fg.number.validate(e,t),(0,jke.chain)(n=>{const r=new Date(n);return isNaN(r.getTime())?fg.failure(e,t):fg.success(r)})),e=>e.getTime());var Mz={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmptyArrayOrElse=e.EmptyObjectOrElse=e.NullOrElse=e.DefaultOrElse=void 0;const t=G,n=cn,r=(0,t.__importStar)(ne),i=pn,o=l=>c=>new r.Type(`DefaultOrElse<${l.name}, ${c.name}>`,f=>f===null||c.is(f),(f,p)=>(0,n.isRight)(l.validate(f,p))?r.success(null):c.validate(f,p),f=>f?c.encode(f):void 0);e.DefaultOrElse=o;const a=l=>(0,e.DefaultOrElse)(r.null)(l);e.NullOrElse=a;const s=l=>(0,e.DefaultOrElse)(i.EmptyObject)(l);e.EmptyObjectOrElse=s;const u=l=>(0,e.DefaultOrElse)(i.EmptyArray)(l);e.EmptyArrayOrElse=u})(Mz);var iM={};Object.defineProperty(iM,"__esModule",{value:!0});const Dke=G,Uke=cs,Bke=vo,Fu=(0,Dke.__importStar)(ne);iM.default=new Fu.Type("IntFromNumber",Fu.Int.is,(e,t)=>(0,Bke.pipe)(Fu.number.validate(e,t),(0,Uke.chain)(n=>Fu.Int.is(n)?Fu.success(n):Fu.success(Math.round(n)))),Fu.Int.encode);var oM={};Object.defineProperty(oM,"__esModule",{value:!0});const Pke=G,Wke=cs,Nke=vo,Lc=(0,Pke.__importStar)(ne),Kke=/^([0-9]+)px$/;oM.default=new Lc.Type("IntFromPixels",Lc.Int.is,(e,t)=>(0,Nke.pipe)(Lc.string.validate(e,t),(0,Wke.chain)(n=>{try{const r=n.match(Kke);if(!r)return Lc.failure(e,t);const i=parseInt(r[1]);return Lc.success(i)}catch{return Lc.failure(e,t)}})),String);var aM={};Object.defineProperty(aM,"__esModule",{value:!0});const qke=G,Vke=(0,qke.__importStar)(ne),Oj=nt;aM.default=(0,Oj.withCustomError)((0,Oj.refineType)(Vke.string,"nonEmptyString",e=>e.trim().length>0),()=>"The value must be a non-empty string");var sM={},T1={};Object.defineProperty(T1,"__esModule",{value:!0});const zke=G,Qke=(0,zke.__importStar)(ne),Hke=nt;T1.default=(0,Hke.nullable)(Qke.string);Object.defineProperty(sM,"__esModule",{value:!0});const Yke=G,Gke=cs,Jke=vo,KC=ne,Zke=(0,Yke.__importDefault)(T1);sM.default=new KC.Type("nonEmptyStringOrNull",e=>typeof e=="string"||e===null,(e,t)=>(0,Jke.pipe)(Zke.default.validate(e,t),(0,Gke.chain)(n=>typeof n=="string"&&n.length>0?(0,KC.success)(n):(0,KC.success)(null))),e=>e);var uM={};Object.defineProperty(uM,"__esModule",{value:!0});const Xke=G,eOe=(0,Xke.__importStar)(ne),tOe=nt;uM.default=(0,tOe.nullable)(eOe.number);var lM={};Object.defineProperty(lM,"__esModule",{value:!0});const nOe=G,pg=(0,nOe.__importStar)(ne),Mj=pn;lM.default=(e,t,n)=>Mj.Number.pipe(new pg.Type("numberInRange",r=>Mj.Number.is(r),(r,i)=>r>t||r<e?pg.failure(r,i,`${n} must be a number between ${e} and ${t}`):pg.success(r),pg.identity));var cM={};Object.defineProperty(cM,"__esModule",{value:!0});const rOe=G,iOe=cs,oOe=vo,hg=(0,rOe.__importStar)(ne);cM.default=new hg.Type("StringFromInt",hg.string.is,(e,t)=>(0,oOe.pipe)(hg.boolean.validate(e,t),(0,iOe.chain)(n=>hg.success(n.toString()))),e=>e);var dM={};Object.defineProperty(dM,"__esModule",{value:!0});const aOe=G,sOe=cs,uOe=vo,Ag=(0,aOe.__importStar)(ne);dM.default=new Ag.Type("StringFromInt",Ag.string.is,(e,t)=>(0,uOe.pipe)(Ag.number.validate(e,t),(0,sOe.chain)(n=>Ag.success(n.toString()))),e=>e);var Fj;function ft(){return Fj||(Fj=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StringOrNull=e.StringFromNumber=e.StringFromBoolean=e.NumberRange=e.NumberOrNull=e.NonEmptyStringOrNull=e.NonEmptyString=e.IntFromPixels=e.IntFromNumber=e.Function=e.DateFromTsMs=e.DateFromStringOrNumber=e.DateFromString=void 0;const t=G;(0,t.__exportStar)(pn,e);var n=$ke();Object.defineProperty(e,"DateFromString",{enumerable:!0,get:function(){return(0,t.__importDefault)(n).default}});var r=nM;Object.defineProperty(e,"DateFromStringOrNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(r).default}});var i=rM;Object.defineProperty(e,"DateFromTsMs",{enumerable:!0,get:function(){return(0,t.__importDefault)(i).default}}),(0,t.__exportStar)(Mz,e),e.Function=(0,t.__importStar)(nt);var o=iM;Object.defineProperty(e,"IntFromNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(o).default}});var a=oM;Object.defineProperty(e,"IntFromPixels",{enumerable:!0,get:function(){return(0,t.__importDefault)(a).default}});var s=aM;Object.defineProperty(e,"NonEmptyString",{enumerable:!0,get:function(){return(0,t.__importDefault)(s).default}});var u=sM;Object.defineProperty(e,"NonEmptyStringOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(u).default}});var l=uM;Object.defineProperty(e,"NumberOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(l).default}});var c=lM;Object.defineProperty(e,"NumberRange",{enumerable:!0,get:function(){return(0,t.__importDefault)(c).default}});var f=cM;Object.defineProperty(e,"StringFromBoolean",{enumerable:!0,get:function(){return(0,t.__importDefault)(f).default}});var p=dM;Object.defineProperty(e,"StringFromNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(p).default}});var h=T1;Object.defineProperty(e,"StringOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(h).default}})}(NC)),NC}var Vi={},Hr={},cp={},ds={},fM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BooleanField=e.BooleanConfig=e.BooleanFieldType=void 0;const n=(0,G.__importStar)(ne),r=ft();e.BooleanFieldType="Boolean",e.BooleanConfig=n.exact(n.partial({label:r.StringOrNull,default_value:n.boolean,placeholder_true:n.string,placeholder_false:n.string})),e.BooleanField=n.exact(n.intersection([n.type({type:n.literal(e.BooleanFieldType)}),n.partial({config:e.BooleanConfig})]))})(fM);var pM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Color=e.ColorConfig=e.ColorFieldType=void 0;const n=(0,G.__importStar)(ne),r=ft();e.ColorFieldType="Color",e.ColorConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string})),e.Color=n.exact(n.intersection([n.type({type:n.literal(e.ColorFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.ColorConfig})]))})(pM);var hM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Date=e.DateConfig=e.DateFieldType=void 0;const n=(0,G.__importStar)(ne),r=ft();e.DateFieldType="Date",e.DateConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default:n.string})),e.Date=n.exact(n.intersection([n.type({type:n.literal(e.DateFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.DateConfig})]))})(hM);var AM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Embed=e.EmbedConfig=e.EmbedFieldType=void 0;const n=(0,G.__importStar)(ne),r=ft();e.EmbedFieldType="Embed",e.EmbedConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,useAsTitle:n.boolean})),e.Embed=n.exact(n.intersection([n.type({type:n.literal(e.EmbedFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.EmbedConfig})]))})(AM);var mM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPoint=e.GeoPointConfig=e.GeoPointFieldType=void 0;const n=(0,G.__importStar)(ne),r=ft();e.GeoPointFieldType="GeoPoint",e.GeoPointConfig=n.exact(n.partial({label:r.StringOrNull})),e.GeoPoint=n.exact(n.intersection([n.type({type:n.literal(e.GeoPointFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.GeoPointConfig})]))})(mM);var gM={},Um={},I1={},dp={},ml={};Object.defineProperty(ml,"__esModule",{value:!0});ml.pipe=ml.pipeable=void 0;var qw=Ye,lOe=function(e){return typeof e.map=="function"},cOe=function(e){return typeof e.contramap=="function"},dOe=function(e){return typeof e.mapWithIndex=="function"},fOe=function(e){return typeof e.ap=="function"},pOe=function(e){return typeof e.chain=="function"},hOe=function(e){return typeof e.bimap=="function"},AOe=function(e){return typeof e.extend=="function"},mOe=function(e){return typeof e.reduce=="function"},gOe=function(e){return typeof e.reduceWithIndex=="function"},vOe=function(e){return typeof e.alt=="function"},yOe=function(e){return typeof e.compact=="function"},bOe=function(e){return typeof e.filter=="function"},COe=function(e){return typeof e.filterWithIndex=="function"},SOe=function(e){return typeof e.promap=="function"},wOe=function(e){return typeof e.compose=="function"},_Oe=function(e){return typeof e.throwError=="function"};function xOe(e){var t={};if(lOe(e)){var n=function(F){return function(M){return e.map(M,F)}};t.map=n}if(cOe(e)){var r=function(F){return function(M){return e.contramap(M,F)}};t.contramap=r}if(dOe(e)){var i=function(F){return function(M){return e.mapWithIndex(M,F)}};t.mapWithIndex=i}if(fOe(e)){var o=function(F){return function(M){return e.ap(M,F)}},a=function(F){return function(M){return e.ap(e.map(M,function(W){return function(){return W}}),F)}};t.ap=o,t.apFirst=a,t.apSecond=function(F){return function(M){return e.ap(e.map(M,function(){return function(W){return W}}),F)}}}if(pOe(e)){var s=function(F){return function(M){return e.chain(M,F)}},u=function(F){return function(M){return e.chain(M,function(W){return e.map(F(W),function(){return W})})}},l=function(F){return e.chain(F,qw.identity)};t.chain=s,t.chainFirst=u,t.flatten=l}if(hOe(e)){var c=function(F,M){return function(W){return e.bimap(W,F,M)}},f=function(F){return function(M){return e.mapLeft(M,F)}};t.bimap=c,t.mapLeft=f}if(AOe(e)){var p=function(F){return function(M){return e.extend(M,F)}},h=function(F){return e.extend(F,qw.identity)};t.extend=p,t.duplicate=h}if(mOe(e)){var A=function(F,M){return function(W){return e.reduce(W,F,M)}},g=function(F){var M=e.foldMap(F);return function(W){return function(re){return M(re,W)}}},y=function(F,M){return function(W){return e.reduceRight(W,F,M)}};t.reduce=A,t.foldMap=g,t.reduceRight=y}if(gOe(e)){var C=function(F,M){return function(W){return e.reduceWithIndex(W,F,M)}},_=function(F){var M=e.foldMapWithIndex(F);return function(W){return function(re){return M(re,W)}}},b=function(F,M){return function(W){return e.reduceRightWithIndex(W,F,M)}};t.reduceWithIndex=C,t.foldMapWithIndex=_,t.reduceRightWithIndex=b}if(vOe(e)){var v=function(F){return function(M){return e.alt(M,F)}};t.alt=v}if(yOe(e)&&(t.compact=e.compact,t.separate=e.separate),bOe(e)){var S=function(F){return function(M){return e.filter(M,F)}},w=function(F){return function(M){return e.filterMap(M,F)}},T=function(F){return function(M){return e.partition(M,F)}},E=function(F){return function(M){return e.partitionMap(M,F)}};t.filter=S,t.filterMap=w,t.partition=T,t.partitionMap=E}if(COe(e)){var R=function(F){return function(M){return e.filterWithIndex(M,F)}},O=function(F){return function(M){return e.filterMapWithIndex(M,F)}},$=function(F){return function(M){return e.partitionWithIndex(M,F)}},B=function(F){return function(M){return e.partitionMapWithIndex(M,F)}};t.filterWithIndex=R,t.filterMapWithIndex=O,t.partitionWithIndex=$,t.partitionMapWithIndex=B}if(SOe(e)){var K=function(F,M){return function(W){return e.promap(W,F,M)}};t.promap=K}if(wOe(e)){var H=function(F){return function(M){return e.compose(M,F)}};t.compose=H}if(_Oe(e)){var z=function(F){return function(M){return M._tag==="None"?e.throwError(F()):e.of(M.value)}},N=function(F){return F._tag==="Left"?e.throwError(F.left):e.of(F.right)},Y=function(F,M){return function(W){return F(W)?e.of(W):e.throwError(M(W))}},ee=function(F,M){return function(W){return e.chain(W,function(re){return F(re)?e.of(re):e.throwError(M(re))})}};t.fromOption=z,t.fromEither=N,t.fromPredicate=Y,t.filterOrElse=ee}return t}ml.pipeable=xOe;ml.pipe=qw.pipe;var TOe=Se&&Se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),IOe=Se&&Se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),EOe=Se&&Se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&TOe(t,e,n);return IOe(t,e),t};Object.defineProperty(dp,"__esModule",{value:!0});dp.NumberFromString=void 0;var yp=EOe(ne),ROe=ml,$Oe=cn;dp.NumberFromString=new yp.Type("NumberFromString",yp.number.is,function(e,t){return ROe.pipe(yp.string.validate(e,t),$Oe.chain(function(n){var r=+n;return isNaN(r)||n.trim()===""?yp.failure(e,t):yp.success(r)}))},String);var kOe=Se&&Se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),OOe=Se&&Se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),MOe=Se&&Se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&kOe(t,e,n);return OOe(t,e),t};Object.defineProperty(I1,"__esModule",{value:!0});I1.IntFromString=void 0;var bp=MOe(ne),jj=dp,FOe=ml,jOe=cn;I1.IntFromString=new bp.Type("IntFromString",bp.Int.is,function(e,t){return FOe.pipe(jj.NumberFromString.validate(e,t),jOe.chain(function(n){return bp.Int.is(n)?bp.success(n):bp.failure(e,t)}))},jj.NumberFromString.encode);Object.defineProperty(Um,"__esModule",{value:!0});const LOe=G,DOe=cn,da=(0,LOe.__importStar)(ne),UOe=I1,Lj=ft(),Dj=new da.Type("SideConstraints",e=>!e||typeof e=="number",(e,t)=>DOe.either.chain(da.union([da.literal("auto"),da.literal(""),da.Int,UOe.IntFromString,Lj.IntFromNumber,Lj.IntFromPixels,da.null]).validate(e,t),n=>n==="auto"||n===""?da.success(null):da.success(n)),e=>e),BOe=da.partial({width:Dj,height:Dj});Um.default=BOe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Image=e.ImageConfig=e.Thumbnail=e.ImageFieldType=void 0;const t=G,n=(0,t.__importStar)(ne),r=ft(),i=(0,t.__importDefault)(Um);e.ImageFieldType="Image",e.Thumbnail=n.exact(n.intersection([n.type({name:n.string}),i.default])),e.ImageConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,constraint:i.default,thumbnails:n.readonlyArray(e.Thumbnail)})),e.Image=n.exact(n.intersection([n.type({type:n.literal(e.ImageFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.ImageConfig})]))})(gM);var vM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationField=e.IntegrationFieldConfig=e.IntegrationFieldType=void 0;const n=(0,G.__importStar)(ne),r=ft();e.IntegrationFieldType="IntegrationFields",e.IntegrationFieldConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,catalog:n.string})),e.IntegrationField=n.exact(n.intersection([n.type({type:n.literal(e.IntegrationFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.IntegrationFieldConfig})]))})(vM);var yM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Link=e.LinkConfig=e.LinkFieldType=void 0;const t=G,n=cn,r=(0,t.__importStar)(ne),i=lp,o=ft(),a=l=>{if(l instanceof Array&&l.reduce((f,p)=>f&&typeof p=="string",!0))return r.success(l)},s=l=>{if(typeof l=="string")return r.success([l])},u=new r.Type("MasksArrayString",l=>l instanceof Array,(l,c)=>n.either.chain(r.union([r.array(r.string),r.string]).validate(l,c),f=>a(f)||s(f)||r.failure(l,c)),l=>l);e.LinkFieldType="Link",e.LinkConfig=r.exact(r.partial({label:o.StringOrNull,useAsTitle:r.boolean,placeholder:r.string,select:(0,i.withFallback)(r.union([r.literal("media"),r.literal("document"),r.literal("web"),r.null]),null),customtypes:r.readonlyArray(r.string),masks:u,tags:u,allowTargetBlank:r.boolean,allowText:r.boolean,repeat:r.boolean,variants:r.array(r.string)})),e.Link=r.exact(r.intersection([r.type({type:r.literal(e.LinkFieldType)}),r.partial({fieldset:o.StringOrNull,config:e.LinkConfig})]))})(yM);var bM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Number=e.NumberConfig=e.NumberFieldType=void 0;const n=(0,G.__importStar)(ne),r=dp,i=ft();e.NumberFieldType="Number",e.NumberConfig=n.exact(n.partial({label:i.StringOrNull,placeholder:n.string,min:n.union([n.number,r.NumberFromString]),max:n.union([n.number,r.NumberFromString]),step:n.union([n.number,r.NumberFromString])})),e.Number=n.exact(n.intersection([n.type({type:n.literal(e.NumberFieldType)}),n.partial({fieldset:i.StringOrNull,config:e.NumberConfig})]))})(bM);var CM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Range=e.RangeConfig=e.RangeFieldType=void 0;const n=(0,G.__importStar)(ne),r=dp,i=ft();e.RangeFieldType="Range",e.RangeConfig=n.exact(n.partial({label:i.StringOrNull,placeholder:n.string,min:n.union([n.number,r.NumberFromString]),max:n.union([n.number,r.NumberFromString]),step:n.union([n.number,r.NumberFromString])})),e.Range=n.exact(n.intersection([n.type({type:n.literal(e.RangeFieldType)}),n.partial({fieldset:i.StringOrNull,config:e.RangeConfig})]))})(CM);var E1={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RichText=e.RichTextConfig=e.RichTextNodeTypeCodec=e.RichTextNodeType=e.DEFAULT_OPTION=e.RichTextFieldType=void 0;const t=G,n=ut,r=cn,i=Ye,o=(0,t.__importStar)(ne),a=ft(),s=(0,t.__importDefault)(Um);e.RichTextFieldType="StructuredText",e.DEFAULT_OPTION="paragraph",e.RichTextNodeType={heading1:"heading1",heading2:"heading2",heading3:"heading3",heading4:"heading4",heading5:"heading5",heading6:"heading6",paragraph:"paragraph",strong:"strong",em:"em",preformatted:"preformatted",hyperlink:"hyperlink",image:"image",embed:"embed",list:"list-item",orderedList:"o-list-item",rtl:"rtl"},e.RichTextNodeTypeCodec=o.keyof({[e.RichTextNodeType.heading1]:null,[e.RichTextNodeType.heading2]:null,[e.RichTextNodeType.heading3]:null,[e.RichTextNodeType.heading4]:null,[e.RichTextNodeType.heading5]:null,[e.RichTextNodeType.heading6]:null,[e.RichTextNodeType.paragraph]:null,[e.RichTextNodeType.strong]:null,[e.RichTextNodeType.em]:null,[e.RichTextNodeType.preformatted]:null,[e.RichTextNodeType.hyperlink]:null,[e.RichTextNodeType.image]:null,[e.RichTextNodeType.embed]:null,[e.RichTextNodeType.list]:null,[e.RichTextNodeType.orderedList]:null,[e.RichTextNodeType.rtl]:null});const u=new o.Type("RichTextOptions",A=>typeof A=="string",A=>(0,i.pipe)(o.union([o.string,o.null]).decode(A),n.either.map(g=>{if(!g)return e.DEFAULT_OPTION;const C=g.split(",").map(_=>_.trim()).filter(_=>(0,r.getOrElseW)(()=>{})(e.RichTextNodeTypeCodec.decode(_)));return C.length?C.join(","):e.DEFAULT_OPTION})),A=>A),l=A=>{if(!A)return o.success([])},c=A=>{if(A instanceof Object){const g=A;if(!Object.entries(g).length)return o.success([]);if(g[""])return o.success(g[""].map(C=>C.name));const y=Object.entries(g).reduce((C,[,_])=>C.concat(_.map(b=>b.name)),[]).filter(Boolean);return o.success(y)}},f=A=>{if(A instanceof Array&&A.reduce((y,C)=>y&&typeof C=="string",!0))return o.success(A)},p=A=>{if(typeof A=="string")return o.success([A])},h=new o.Type("RichTextLabels",A=>A instanceof Array,(A,g)=>{const y=o.record(o.string,o.readonlyArray(o.record(o.literal("name"),o.string))),C=o.readonlyArray(o.string);return(0,i.pipe)(o.union([y,C,o.string,o.null]).decode(A),n.either.chain(_=>l(_)||f(_)||c(_)||p(_)||o.failure(A,g)))},A=>A);e.RichTextConfig=o.exact(o.partial({label:a.StringOrNull,placeholder:o.string,useAsTitle:o.boolean,single:u,multi:u,imageConstraint:s.default,labels:h,allowTargetBlank:o.boolean})),e.RichText=o.exact(o.intersection([o.type({type:o.literal(e.RichTextFieldType)}),o.partial({fieldset:a.StringOrNull,config:e.RichTextConfig})]))})(E1);var SM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Select=e.SelectConfig=e.SelectFieldType=void 0;const n=(0,G.__importStar)(ne),r=ft();e.SelectFieldType="Select",e.SelectConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default_value:n.string,options:n.readonlyArray(n.union([n.string,r.StringFromNumber,r.StringFromBoolean]))})),e.Select=n.exact(n.intersection([n.type({type:n.literal(e.SelectFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.SelectConfig})]))})(SM);var wM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Separator=e.SeparatorConfig=e.SeparatorFieldType=void 0;const n=(0,G.__importStar)(ne),r=ft();e.SeparatorFieldType="Separator",e.SeparatorConfig=n.exact(n.partial({label:r.StringOrNull})),e.Separator=n.exact(n.intersection([n.type({type:n.literal(e.SeparatorFieldType)}),n.partial({config:e.SeparatorConfig})]))})(wM);var _M={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TableCell=e.Table=e.TableFieldType=void 0;const n=(0,G.__importStar)(ne),r=ft(),i=E1;e.TableFieldType="Table";const o=n.exact(n.partial({label:r.StringOrNull}));e.Table=n.exact(n.intersection([n.type({type:n.literal(e.TableFieldType)}),n.partial({config:o})])),e.TableCell={type:"StructuredText",config:{multi:[i.RichTextNodeType.paragraph,i.RichTextNodeType.strong,i.RichTextNodeType.em,i.RichTextNodeType.hyperlink].join(",")}}})(_M);var xM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Text=e.TextConfig=e.TextFieldType=void 0;const n=(0,G.__importStar)(ne),r=ft();e.TextFieldType="Text",e.TextConfig=n.exact(n.partial({label:r.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),e.Text=n.exact(n.intersection([n.type({type:n.literal(e.TextFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.TextConfig})]))})(xM);var TM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Timestamp=e.TimestampConfig=e.TimestampFieldType=void 0;const n=(0,G.__importStar)(ne),r=ft();e.TimestampFieldType="Timestamp",e.TimestampConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default:n.string})),e.Timestamp=n.exact(n.intersection([n.type({type:n.literal(e.TimestampFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.TimestampConfig})]))})(TM);Object.defineProperty(ds,"__esModule",{value:!0});ds.NestableWidget=void 0;const POe=G,WOe=(0,POe.__importStar)(ne),NOe=fM,KOe=pM,qOe=hM,VOe=AM,zOe=mM,QOe=gM,HOe=vM,YOe=yM,GOe=bM,JOe=CM,ZOe=E1,XOe=SM,eMe=wM,tMe=_M,nMe=xM,rMe=TM;ds.NestableWidget=WOe.union([KOe.Color,NOe.BooleanField,VOe.Embed,zOe.GeoPoint,qOe.Date,GOe.Number,JOe.Range,ZOe.RichText,XOe.Select,eMe.Separator,tMe.Table,nMe.Text,rMe.Timestamp,YOe.Link,QOe.Image,HOe.IntegrationField]);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Group=e.GroupConfig=e.NestedGroup=e.NestedGroupConfig=e.GroupFieldType=void 0;const n=(0,G.__importStar)(ne),r=_c,i=ft(),o=ds;e.GroupFieldType="Group";const a=u=>n.exact(n.partial({label:i.StringOrNull,repeat:n.boolean,fields:n.record(r.WidgetKey,u)})),s=u=>n.exact(n.intersection([n.type({type:n.literal(e.GroupFieldType)}),n.partial({fieldset:i.StringOrNull,icon:n.string,description:n.string,config:a(u)})]));e.NestedGroupConfig=a(o.NestableWidget),e.NestedGroup=s(o.NestableWidget),e.GroupConfig=a(n.union([o.NestableWidget,e.NestedGroup])),e.Group=s(n.union([o.NestableWidget,e.NestedGroup]))})(cp);var Bm={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(fM,e),(0,t.__exportStar)(pM,e),(0,t.__exportStar)(hM,e),(0,t.__exportStar)(AM,e),(0,t.__exportStar)(mM,e),(0,t.__exportStar)(gM,e),(0,t.__exportStar)(vM,e),(0,t.__exportStar)(yM,e),(0,t.__exportStar)(ds,e),(0,t.__exportStar)(bM,e),(0,t.__exportStar)(CM,e),(0,t.__exportStar)(E1,e),(0,t.__exportStar)(SM,e),(0,t.__exportStar)(wM,e),(0,t.__exportStar)(_M,e),(0,t.__exportStar)(xM,e),(0,t.__exportStar)(TM,e)})(Bm);var IM={},R1={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isCompositeSlice=e.CompositeSlice=e.CompositeSliceConfig=e.CompositeSliceType=void 0;const n=(0,G.__importStar)(ne),r=_c,i=ft(),o=ds;e.CompositeSliceType="Slice",e.CompositeSliceConfig=n.exact(n.partial({label:i.StringOrNull})),e.CompositeSlice=n.exact(n.intersection([n.type({type:n.literal(e.CompositeSliceType)}),n.partial({fieldset:i.StringOrNull,description:n.string,icon:n.string,display:n.string,"non-repeat":n.record(r.WidgetKey,o.NestableWidget),repeat:n.record(r.WidgetKey,o.NestableWidget),config:e.CompositeSliceConfig})]));function a(s){return s.type==="Slice"}e.isCompositeSlice=a})(R1);var gl={};Object.defineProperty(gl,"__esModule",{value:!0});gl.isLegacySlice=gl.LegacySlice=void 0;const iMe=G,oMe=(0,iMe.__importStar)(ne),aMe=cp,sMe=ds;gl.LegacySlice=oMe.union([sMe.NestableWidget,aMe.NestedGroup]);function uMe(e){return e.type!=="Slice"&&e.type!=="SharedSlice"}gl.isLegacySlice=uMe;var Pm={},vl={};Object.defineProperty(vl,"__esModule",{value:!0});vl.isSlicePrimaryWidget=vl.SlicePrimaryWidget=void 0;const lMe=G,cMe=(0,lMe.__importStar)(ne),Fz=cp,jz=Bm;vl.SlicePrimaryWidget=cMe.union([jz.NestableWidget,Fz.Group]);const dMe=e=>jz.NestableWidget.is(e)||Fz.Group.is(e);vl.isSlicePrimaryWidget=dMe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isDynamicSharedSlice=e.isStaticSharedSlice=e.SharedSlice=e.SharedSliceType=e.Variation=void 0;const n=(0,G.__importStar)(ne),r=lp,i=_c,o=ds,a=vl,s="https://images.prismic.io/slice-machine/621a5ec4-0387-4bc5-9860-2dd46cbc07cd_default_ss.png?auto=compress,format";e.Variation=n.exact(n.intersection([n.type({id:n.string,name:n.string,description:n.string,imageUrl:(0,r.withFallback)(n.string,s),docURL:n.string,version:n.string}),n.partial({display:n.string,primary:n.record(i.WidgetKey,a.SlicePrimaryWidget),items:n.record(i.WidgetKey,o.NestableWidget)})])),e.SharedSliceType="SharedSlice";const u=n.string,l=n.string;e.SharedSlice=n.exact(n.intersection([n.type({id:n.string,type:n.literal(e.SharedSliceType),name:n.string,variations:n.readonlyArray(e.Variation)}),n.partial({description:n.string,legacyPaths:n.record(u,l)})]));function c(p){return p.type==="SharedSlice"}e.isStaticSharedSlice=c;function f(p){return p.type==="SharedSlice"}e.isDynamicSharedSlice=f})(Pm);var Wm={};Object.defineProperty(Wm,"__esModule",{value:!0});Wm.SharedSliceRef=void 0;const fMe=G,qC=(0,fMe.__importStar)(ne),pMe=Pm;Wm.SharedSliceRef=qC.exact(qC.type({type:qC.literal(pMe.SharedSliceType)}));(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Slices=e.DynamicSlices=e.StaticSlices=e.slicesReader=e.DynamicSlicesConfig=e.StaticSlicesConfig=e.slicesConfigReader=e.SlicesLabels=e.SlicesFieldType=e.LegacySlicesFieldType=void 0;const n=(0,G.__importStar)(ne),r=_c,i=ft(),o=R1,a=gl,s=Pm,u=Wm;e.LegacySlicesFieldType="Choice",e.SlicesFieldType="Slices",e.SlicesLabels=n.union([n.record(n.string,n.readonlyArray(n.exact(n.intersection([n.type({name:n.string}),n.partial({display:n.string})])))),n.null]);function l(p){return n.exact(n.partial({label:i.StringOrNull,labels:e.SlicesLabels,choices:n.record(r.WidgetKey,n.union([a.LegacySlice,o.CompositeSlice,p]))}))}e.slicesConfigReader=l,e.StaticSlicesConfig=l(s.SharedSlice),e.DynamicSlicesConfig=l(u.SharedSliceRef);const c={toStatic(p,h){const A=Object.entries(p.choices||{}).reduce((g,[y,C])=>{if(C.type==="SharedSlice"){const _=h.get(y);return _?{...g,[y]:_}:g}else return{...g,[y]:C}},{});return{...p,choices:A}}};function f(p){return n.exact(n.intersection([n.type({type:n.keyof({[e.SlicesFieldType]:null,[e.LegacySlicesFieldType]:null})}),n.partial({fieldset:i.StringOrNull,config:p})]))}e.slicesReader=f,e.StaticSlices=f(e.StaticSlicesConfig),e.DynamicSlices=f(e.DynamicSlicesConfig),e.Slices={toStatic(p,h){return p.config?{...p,config:c.toStatic(p.config,h)}:p}}})(IM);var EM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UID=e.UIDConfig=e.UIDFieldType=void 0;const n=(0,G.__importStar)(ne),r=ft();e.UIDFieldType="UID",e.UIDConfig=n.exact(n.partial({label:r.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),e.UID=n.exact(n.intersection([n.type({type:n.literal(e.UIDFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.UIDConfig})]))})(EM);Object.defineProperty(Hr,"__esModule",{value:!0});Hr.Widgets=Hr.FieldType=Hr.DynamicWidget=Hr.StaticWidget=Hr.widgetReader=void 0;const hMe=G,Lz=(0,hMe.__importStar)(ne),Dz=cp,qn=Bm,AMe=ds,gh=IM,Uz=EM;function RM(e){return Lz.union([Uz.UID,AMe.NestableWidget,Dz.Group,e])}Hr.widgetReader=RM;Hr.StaticWidget=RM(gh.StaticSlices);Hr.DynamicWidget=RM(gh.DynamicSlices);Hr.FieldType=Lz.keyof({[qn.ColorFieldType]:null,[qn.BooleanFieldType]:null,[qn.NumberFieldType]:null,[qn.EmbedFieldType]:null,[qn.GeoPointFieldType]:null,[qn.DateFieldType]:null,[qn.RangeFieldType]:null,[qn.RichTextFieldType]:null,[qn.SelectFieldType]:null,[qn.SeparatorFieldType]:null,[qn.TableFieldType]:null,[qn.TextFieldType]:null,[qn.TimestampFieldType]:null,[qn.LinkFieldType]:null,[qn.ImageFieldType]:null,[qn.IntegrationFieldType]:null,[Uz.UIDFieldType]:null,[Dz.GroupFieldType]:null,[gh.SlicesFieldType]:null,[gh.LegacySlicesFieldType]:null});Hr.Widgets={toStatic(e,t){switch(e.type){case"Choice":case"Slices":return gh.Slices.toStatic(e,t);default:return e}}};Object.defineProperty(Vi,"__esModule",{value:!0});Vi.Sections=Vi.DynamicSection=Vi.StaticSection=Vi.sectionReader=void 0;const mMe=G,gMe=(0,mMe.__importStar)(ne),vMe=_c,$M=Hr;function kM(e){return gMe.record(vMe.WidgetKey,e)}Vi.sectionReader=kM;Vi.StaticSection=kM($M.StaticWidget);Vi.DynamicSection=kM($M.DynamicWidget);Vi.Sections={toStatic(e,t){return Object.entries(e).reduce((r,[i,o])=>({...r,[i]:$M.Widgets.toStatic(o,t)}),{})}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.collectSharedSlices=e.flattenCustomTypeFields=e.filterMissingSharedSlices=e.collectWidgets=e.validateSlices=e.toStatic=e.flattenSections=e.flattenWidgets=e.CustomType=e.StaticCustomType=e.CustomTypeFormat=void 0;const t=G,n=cn,r=(0,t.__importStar)(ne),i=lp,o=ft(),a=Vi;e.CustomTypeFormat={page:"page",custom:"custom"};class s extends Error{constructor(v){super(),Object.defineProperty(this,"slices",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"message",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.slices=v,this.message=this._formatError(v)}_formatError(v){return`The following slices doesn't exists in your Prismic repository:
|
|
65
|
+
${v.map(w=>` - ${w}`).join(`
|
|
66
|
+
`)}
|
|
67
|
+
`}}function u(b){return r.exact(r.intersection([r.type({id:r.string,label:o.StringOrNull,repeatable:(0,i.withFallback)(r.boolean,!0),json:r.record(r.string,b),status:(0,i.withFallback)(r.boolean,!0)}),r.partial({format:(0,i.withFallback)(r.keyof(e.CustomTypeFormat),"custom")})]))}e.StaticCustomType=u(a.StaticSection),e.CustomType=u(a.DynamicSection);function l(b){return Object.entries(b.json).reduce((v,[,S])=>{const w=Object.entries(S);return v.concat(w)},[])}e.flattenWidgets=l;function c(b){return Object.entries(b.json).reduce((v,[,S])=>{const w=Object.entries(S);return v.concat(w)},[])}e.flattenSections=c;function f(b){return l(b).filter(([,w])=>w.type==="Slices").reduce((w,[,T])=>{const E=Object.entries(T.config&&T.config.choices?T.config.choices:{}).filter(([,R])=>R.type==="SharedSlice").map(([R])=>R);return w.concat(E)},[])}function p(b){const v=f(b);return function(S){return v.map(S)}}function h(b,v){const S=Object.entries(b.json).reduce((w,[T,E])=>({...w,[T]:a.Sections.toStatic(E,v)}),{});return{...b,json:S}}e.toStatic=h;function A(b,v){const S=p(b)(w=>{if(!v.get(w))return w}).filter(Boolean);return S.length>0?(0,n.left)(new s(S)):(0,n.right)(b)}e.validateSlices=A;function g(b,v){const S=Object.entries(b.json).reduce((w,[T,E])=>{const R=Object.entries(E).reduce((O,[$,B])=>{const K=v($,B);return K?{...O,[$]:K}:O},{});return{...w,[T]:R}},{});return{...b,json:S}}e.collectWidgets=g;function y(b,v){return g(b,(S,w)=>{if(w.type==="Slices"){if(!w.config||!w.config.choices)return w;const T=Object.entries(w.config.choices).reduce((R,[O,$])=>$.type==="SharedSlice"&&!v.get(O)?R:{...R,[O]:$},{}),E={...w.config,choices:T};return{...w,config:E}}return w})}e.filterMissingSharedSlices=y;function C(b){return Object.values(b.json).reduce((v,S)=>({...v,...S}),{})}e.flattenCustomTypeFields=C;function _(b){return Object.entries(b.fields).reduce((v,[,S])=>{var w;return S.type==="Slices"||S.type==="Choice"?{...v,...Object.entries(((w=S.config)===null||w===void 0?void 0:w.choices)||{}).reduce((T,[E,R])=>R.type==="SharedSlice"?{...T,[E]:R}:T,{})}:v},{})}e.collectSharedSlices=_})(Oz);var Bz={},$1={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiffOperation=void 0,function(t){t.Added="added",t.Removed="removed",t.Updated="updated"}(e.DiffOperation||(e.DiffOperation={}))})($1);var k1={},ba={},O1={};Object.defineProperty(O1,"__esModule",{value:!0});O1.HexaColor=void 0;const yMe=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;O1.HexaColor={is:e=>yMe.test(e)};var M1={};Object.defineProperty(M1,"__esModule",{value:!0});M1.toRecord=void 0;function bMe(e,t){return e.reduce((n,r)=>{const i=t(r);return{...n,[i]:r}},{})}M1.toRecord=bMe;var Yr={};Object.defineProperty(Yr,"__esModule",{value:!0});Yr.mapValues=Yr.isObject=Yr.withOptionals=Yr.isNotEmpty=Yr.zipObjects=void 0;const CMe=G,SMe=cn,VC=(0,CMe.__importStar)(ne);function wMe(e,t){return[...new Set(Object.keys(e||{}).concat(Object.keys(t||{})))].reduce((r,i)=>{const o=e==null?void 0:e[i],a=t==null?void 0:t[i];return{...r,[i]:{left:o,right:a}}},{})}Yr.zipObjects=wMe;function _Me(e){return!!Object.keys(e).length}Yr.isNotEmpty=_Me;function xMe(e,t){return{...e,...t.reduce((n,[r,i])=>i?{...n,[r]:i}:n,{})}}Yr.withOptionals=xMe;const TMe=VC.record(VC.string,VC.unknown);function IMe(e){return(0,SMe.isRight)(TMe.decode(e))}Yr.isObject=IMe;function EMe(e,t){return Object.entries(e).reduce((n,[r,i])=>({...n,[r]:t(i,r)}),{})}Yr.mapValues=EMe;Object.defineProperty(ba,"__esModule",{value:!0});ba.Objects=ba.Arrays=ba.HexaColorCode=void 0;const OM=G;ba.HexaColorCode=(0,OM.__importStar)(O1);ba.Arrays=(0,OM.__importStar)(M1);ba.Objects=(0,OM.__importStar)(Yr);var Nm={};Object.defineProperty(Nm,"__esModule",{value:!0});Nm.VariationComparator=void 0;const vv=ba,zC=cp,ws=$1;function RMe(e,t){const n=vv.Objects.zipObjects(e,t);return Object.entries(n).reduce((r,[i,o])=>i==="primary"||i==="items"||(o==null?void 0:o.left)===(o==null?void 0:o.right)?r:{...r,[i]:o==null?void 0:o.right},{})}function yv(e,t){const n=vv.Objects.zipObjects(e,t),r=Object.entries(n).reduce((i,[o,a])=>{if(JSON.stringify(a==null?void 0:a.left)===JSON.stringify(a==null?void 0:a.right))return i;const s=(()=>{var u,l,c,f,p,h,A;if(!(!(a!=null&&a.left)&&!(a!=null&&a.right))){if(a!=null&&a.left&&!a.right)return{op:ws.DiffOperation.Removed};if(!(a!=null&&a.left)&&(a!=null&&a.right)){if(((u=a.right)===null||u===void 0?void 0:u.type)===zC.GroupFieldType){const g={...a.right,config:{...a.right.config,fields:{}}};return g.config.fields=yv(void 0,(l=a.right.config)===null||l===void 0?void 0:l.fields)||{},{op:ws.DiffOperation.Added,value:g}}return{op:ws.DiffOperation.Added,value:a.right}}if(((c=a.right)===null||c===void 0?void 0:c.type)===zC.GroupFieldType){const g={...a.right,config:{...a.right.config,fields:{}}};return g.config.fields=yv(((f=a.left)===null||f===void 0?void 0:f.type)===zC.GroupFieldType?(h=(p=a.left)===null||p===void 0?void 0:p.config)===null||h===void 0?void 0:h.fields:void 0,(A=a.right.config)===null||A===void 0?void 0:A.fields)||{},{op:ws.DiffOperation.Updated,value:g}}return{op:ws.DiffOperation.Updated,value:a.right}}})();return s?{...i,[o]:s}:i},{});return vv.Objects.isNotEmpty(r)?r:void 0}Nm.VariationComparator={compare(e,t){if(e&&!t)return{op:ws.DiffOperation.Removed};if(!e&&t)return{op:ws.DiffOperation.Added,value:t};const n=RMe(e,t),r=yv(e==null?void 0:e.primary,t==null?void 0:t.primary),i=yv(e==null?void 0:e.items,t==null?void 0:t.items),o={...n,...r?{primary:r}:{},...i?{items:i}:{}};if(vv.Objects.isNotEmpty(o))return{op:ws.DiffOperation.Updated,value:o}}};Object.defineProperty(k1,"__esModule",{value:!0});k1.SliceComparator=void 0;const Nc=ba,QC=$1,$Me=Nm;function kMe(e,t){const n=Nc.Objects.zipObjects(e,t);return Object.entries(n).reduce((r,[i,o])=>i==="variations"||(o==null?void 0:o.left)===(o==null?void 0:o.right)?r:{...r,[i]:o==null?void 0:o.right},{})}k1.SliceComparator={compare(e,t){if(!e&&t)return{op:QC.DiffOperation.Added,value:t};if(e&&!t)return{op:QC.DiffOperation.Removed};const n=kMe(e,t),r=Nc.Objects.zipObjects(e&&Nc.Arrays.toRecord(e.variations,a=>a.id),t&&Nc.Arrays.toRecord(t.variations,a=>a.id)),i=Object.entries(r).reduce((a,[s,u])=>{if(!u)return a;const l=$Me.VariationComparator.compare(u.left,u.right);return l?{...a,[s]:l}:a},{}),o={...n,...Nc.Objects.isNotEmpty(i)?{variations:i}:{}};if(Nc.Objects.isNotEmpty(o))return{op:QC.DiffOperation.Updated,value:o}}};var Pz={};Object.defineProperty(Pz,"__esModule",{value:!0});(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)($1,e),(0,t.__exportStar)(k1,e),(0,t.__exportStar)(Nm,e),(0,t.__exportStar)(Pz,e)})(Bz);var ra={},Wz={};(function(e){var t=Se&&Se.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageConstraint=void 0;var n=Um;Object.defineProperty(e,"ImageConstraint",{enumerable:!0,get:function(){return t(n).default}})})(Wz);var Nz={},Kz={};Object.defineProperty(Kz,"__esModule",{value:!0});var F1={};Object.defineProperty(F1,"__esModule",{value:!0});F1.SlicesTypes=void 0;const OMe=G,MMe=(0,OMe.__importStar)(ne),FMe=R1,jMe=Pm;F1.SlicesTypes=MMe.keyof({[FMe.CompositeSliceType]:null,[jMe.SharedSliceType]:null});(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(R1,e),(0,t.__exportStar)(gl,e),(0,t.__exportStar)(Pm,e),(0,t.__exportStar)(Wm,e),(0,t.__exportStar)(Kz,e),(0,t.__exportStar)(vl,e),(0,t.__exportStar)(IM,e),(0,t.__exportStar)(F1,e)})(Nz);(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(cp,e),(0,t.__exportStar)(Bm,e),(0,t.__exportStar)(Wz,e),(0,t.__exportStar)(Nz,e),(0,t.__exportStar)(EM,e),(0,t.__exportStar)(Hr,e)})(ra);(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(Oz,e),(0,t.__exportStar)(Bz,e),(0,t.__exportStar)(Vi,e),(0,t.__exportStar)(ra,e)})(he);var HC={},YC={},ju={},Uj;function Ot(){if(Uj)return ju;Uj=1,Object.defineProperty(ju,"__esModule",{value:!0}),ju.hasContentType=ju.hasFieldContentType=void 0;const e=cn,t=DM();function n(i){var o;return r(i)&&i.__TYPE__===t.FieldContentType&&((o=i)===null||o===void 0?void 0:o.type)!==void 0&&typeof i.type=="string"&&(0,e.isRight)(t.FieldType.decode(i.type))}ju.hasFieldContentType=n;function r(i){return typeof i=="object"&&i!==null&&"__TYPE__"in i}return ju.hasContentType=r,ju}var Bj;function qz(){return Bj||(Bj=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmptyContent=e.EmptyLegacy=e.isEmptyContent=e.EmptyContentType=void 0;const t=G,n=ut,r=Ye,i=(0,t.__importStar)(ne),o=Ot();e.EmptyContentType="EmptyContent";const a=l=>(0,o.hasContentType)(l)&&l.__TYPE__===e.EmptyContentType;e.isEmptyContent=a;const s=i.union([i.null,i.type({value:i.null})]),u=l=>new i.Type("EmptyLegacy",e.isEmptyContent,c=>(0,r.pipe)(s.decode(c),n.either.map(()=>({type:l,__TYPE__:e.EmptyContentType}))),()=>null);e.EmptyLegacy=u,e.EmptyContent=i.strict({type:i.string,__TYPE__:i.literal(e.EmptyContentType)})}(YC)),YC}var GC={},dr={};Object.defineProperty(dr,"__esModule",{value:!0});dr.defaultCtx=dr.getFieldCtx=dr.LegacyContentCtx=dr.FieldOrSliceType=void 0;const LMe=G,JC=(0,LMe.__importStar)(ne),Pj=ra;dr.FieldOrSliceType=JC.union([JC.union([Pj.FieldType,Pj.SlicesTypes]),JC.literal("Repeatable.Link")]);class MM{constructor(t,n,r){Object.defineProperty(this,"fieldKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"prefixedKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"keyOfType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fieldPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fieldType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"allTypes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.fieldKey=t,this.fieldPath=n||[],this.allTypes=r||new Map;const i=Array.of(this.fieldPath,[this.fieldKey]).flat().join(".");this.prefixedKey=i,this.keyOfType=`${i}_TYPE`,this.fieldType=this.allTypes.get(this.prefixedKey)}}dr.LegacyContentCtx=MM;function DMe(e,t,n){return new MM(e,[...t.fieldPath,t.fieldKey,...n||[]],t.allTypes)}dr.getFieldCtx=DMe;function UMe(e,t=new Map){return new MM(e,[],t)}dr.defaultCtx=UMe;var ZC={},XC={},Wj;function Vz(){return Wj||(Wj=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BooleanContentDefaultValue=e.BooleanContent=e.BooleanLegacy=e.isBooleanContent=e.BooleanContentType=void 0;const t=G,n=ut,r=Ye,i=(0,t.__importStar)(ne),o=Ot();e.BooleanContentType="BooleanContent";const a=l=>(0,o.hasContentType)(l)&&l.__TYPE__===e.BooleanContentType;e.isBooleanContent=a;const s=l=>new i.Type("BooleanLegacy",e.isBooleanContent,c=>(0,r.pipe)(i.boolean.decode(c),n.either.map(f=>e.BooleanContent.encode({value:f,__TYPE__:e.BooleanContentType}))),c=>({content:c.value,types:{[l.keyOfType]:"Boolean"}}));e.BooleanLegacy=s,e.BooleanContent=i.strict({__TYPE__:i.literal(e.BooleanContentType),value:i.boolean});const u=l=>{var c;return((c=l.config)===null||c===void 0?void 0:c.default_value)!==void 0?{__TYPE__:e.BooleanContentType,value:l.config.default_value||!1}:void 0};e.BooleanContentDefaultValue=u}(XC)),XC}var eS={},Nj;function FM(){return Nj||(Nj=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmbedContent=e.EmbedLegacy=e.EmbedContentLegacy=e.isEmbedContent=e.EmbedContentType=void 0;const t=G,n=ut,r=Ye,i=(0,t.__importStar)(ne),o=ft(),a=Ot();e.EmbedContentType="EmbedContent";const s=l=>(0,a.hasContentType)(l)&&l.__TYPE__===e.EmbedContentType;e.isEmbedContent=s,e.EmbedContentLegacy=i.exact(i.intersection([i.type({embed_url:i.string,type:i.string}),i.partial({version:i.union([i.string,i.number,i.null]),title:o.StringOrNull,author_name:o.StringOrNull,author_url:o.StringOrNull,provider_name:o.StringOrNull,provider_url:o.StringOrNull,cache_age:i.union([i.string,i.number,i.null]),thumbnail_url:o.StringOrNull,thumbnail_width:o.NumberOrNull,thumbnail_height:o.NumberOrNull,html:o.StringOrNull})]));const u=l=>new i.Type("EmbedLegacy",e.isEmbedContent,c=>(0,r.pipe)(e.EmbedContentLegacy.decode(c),n.either.map(f=>({...f,all:c,__TYPE__:e.EmbedContentType}))),c=>({content:c.all,types:{[l.keyOfType]:"Embed"}}));e.EmbedLegacy=u,e.EmbedContent=i.intersection([e.EmbedContentLegacy,i.strict({__TYPE__:i.literal(e.EmbedContentType),all:i.unknown})])}(eS)),eS}var tS={},nS={},fs={};Object.defineProperty(fs,"__esModule",{value:!0});const BMe=G,PMe=cs,WMe=vo,mg=(0,BMe.__importStar)(ne);function NMe(e){let t=0;for(;t<e.length&&e[t]<=" ";)t++;let n=e.length;for(;t<n&&e[n-1]<=" ";)n--;return e.substring(t,n)}fs.default=new mg.Type("TrimmedString",mg.string.is,(e,t)=>(0,WMe.pipe)(mg.string.validate(e,t),(0,PMe.chain)(n=>mg.success(NMe(n)))),e=>e);var Pi={};Object.defineProperty(Pi,"__esModule",{value:!0});Pi.FieldContentType=void 0;Pi.FieldContentType="FieldContent";var Kj;function qj(){return Kj||(Kj=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ColorContent=e.ColorLegacy=e.isColorContent=void 0;const t=G,n=ut,r=Ye,i=(0,t.__importStar)(ne),o=ra,a=(0,t.__importDefault)(fs),s=Ot(),u=Pi,l=f=>(0,s.hasContentType)(f)&&f.__TYPE__===u.FieldContentType&&(0,s.hasFieldContentType)(f)&&f.type==="Color";e.isColorContent=l;const c=f=>new i.Type("ColorLegacy",e.isColorContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(h=>e.ColorContent.encode({value:h,type:o.ColorFieldType,__TYPE__:u.FieldContentType}))),p=>({content:p.value,types:{[f.keyOfType]:o.ColorFieldType}}));e.ColorLegacy=c,e.ColorContent=i.strict({type:i.literal(o.ColorFieldType),value:a.default,__TYPE__:i.literal(u.FieldContentType)})}(nS)),nS}var rS={},Vj;function zj(){return Vj||(Vj=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DateContent=e.DateLegacy=e.isDateContent=void 0;const t=G,n=ut,r=Ye,i=(0,t.__importStar)(ne),o=ra,a=(0,t.__importDefault)(fs),s=Ot(),u=Pi,l=f=>(0,s.hasContentType)(f)&&f.__TYPE__===u.FieldContentType&&(0,s.hasFieldContentType)(f)&&f.type==="Date";e.isDateContent=l;const c=f=>new i.Type("DateLegacy",e.isDateContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(h=>e.DateContent.encode({value:h,type:o.DateFieldType,__TYPE__:u.FieldContentType}))),p=>({content:p.value,types:{[f.keyOfType]:o.DateFieldType}}));e.DateLegacy=c,e.DateContent=i.strict({type:i.literal(o.DateFieldType),value:a.default,__TYPE__:i.literal(u.FieldContentType)})}(rS)),rS}var iS={},Qj;function Hj(){return Qj||(Qj=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NumberContent=e.NumberLegacy=e.isNumberContent=void 0;const t=G,n=ut,r=Ye,i=(0,t.__importStar)(ne),o=ra,a=(0,t.__importDefault)(fs),s=Ot(),u=Pi,l=f=>(0,s.hasContentType)(f)&&f.__TYPE__===u.FieldContentType&&(0,s.hasFieldContentType)(f)&&f.type==="Number";e.isNumberContent=l;const c=f=>new i.Type("NumberLegacy",e.isNumberContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(h=>e.NumberContent.encode({value:h,type:o.NumberFieldType,__TYPE__:u.FieldContentType}))),p=>({content:p.value,types:{[f.keyOfType]:o.NumberFieldType}}));e.NumberLegacy=c,e.NumberContent=i.strict({type:i.literal(o.NumberFieldType),value:a.default,__TYPE__:i.literal(u.FieldContentType)})}(iS)),iS}var oS={},Yj;function Gj(){return Yj||(Yj=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RangeContent=e.RangeLegacy=e.isRangeContent=void 0;const t=G,n=ut,r=Ye,i=(0,t.__importStar)(ne),o=ra,a=(0,t.__importDefault)(fs),s=Ot(),u=Pi,l=f=>(0,s.hasContentType)(f)&&f.__TYPE__===u.FieldContentType&&(0,s.hasFieldContentType)(f)&&f.type==="Range";e.isRangeContent=l;const c=f=>new i.Type("RangeLegacy",e.isRangeContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(h=>e.RangeContent.encode({value:h,type:o.RangeFieldType,__TYPE__:u.FieldContentType}))),p=>({content:p.value,types:{[f.keyOfType]:o.RangeFieldType}}));e.RangeLegacy=c,e.RangeContent=i.strict({type:i.literal(o.RangeFieldType),value:a.default,__TYPE__:i.literal(u.FieldContentType)})}(oS)),oS}var aS={},Jj;function Zj(){return Jj||(Jj=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SelectContentDefaultValue=e.SelectContent=e.SelectLegacy=e.isSelectContent=void 0;const t=G,n=ut,r=Ye,i=(0,t.__importStar)(ne),o=ra,a=(0,t.__importDefault)(fs),s=Ot(),u=Pi,l=p=>(0,s.hasContentType)(p)&&p.__TYPE__===u.FieldContentType&&(0,s.hasFieldContentType)(p)&&p.type==="Select";e.isSelectContent=l;const c=p=>new i.Type("SelectLegacy",e.isSelectContent,h=>(0,r.pipe)(a.default.decode(h),n.either.map(A=>e.SelectContent.encode({value:A,type:o.SelectFieldType,__TYPE__:u.FieldContentType}))),h=>({content:h.value,types:{[p.keyOfType]:o.SelectFieldType}}));e.SelectLegacy=c,e.SelectContent=i.strict({type:i.literal(o.SelectFieldType),value:a.default,__TYPE__:i.literal(u.FieldContentType)});const f=p=>{var h;return!((h=p.config)===null||h===void 0)&&h.default_value?{__TYPE__:u.FieldContentType,type:o.SelectFieldType,value:p.config.default_value||""}:void 0};e.SelectContentDefaultValue=f}(aS)),aS}var sS={},Xj;function eL(){return Xj||(Xj=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextContent=e.TextLegacy=e.isTextContent=void 0;const t=G,n=ut,r=Ye,i=(0,t.__importStar)(ne),o=ra,a=(0,t.__importDefault)(fs),s=Ot(),u=Pi,l=f=>(0,s.hasContentType)(f)&&f.__TYPE__===u.FieldContentType&&(0,s.hasFieldContentType)(f)&&f.type==="Text";e.isTextContent=l;const c=f=>new i.Type("TextLegacy",e.isTextContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(h=>e.TextContent.encode({value:h,type:o.TextFieldType,__TYPE__:u.FieldContentType}))),p=>({content:p.value,types:{[f.keyOfType]:o.TextFieldType}}));e.TextLegacy=c,e.TextContent=i.strict({type:i.literal(o.TextFieldType),value:a.default,__TYPE__:i.literal(u.FieldContentType)})}(sS)),sS}var uS={},tL;function nL(){return tL||(tL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TimestampContent=e.TimestampLegacy=e.isTimestampContent=void 0;const t=G,n=ut,r=Ye,i=(0,t.__importStar)(ne),o=ra,a=(0,t.__importDefault)(fs),s=Ot(),u=Pi,l=f=>(0,s.hasContentType)(f)&&f.__TYPE__===u.FieldContentType&&(0,s.hasFieldContentType)(f)&&f.type==="Timestamp";e.isTimestampContent=l;const c=f=>new i.Type("TimestampLegacy",e.isTimestampContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(h=>e.TimestampContent.encode({value:h,type:o.TimestampFieldType,__TYPE__:u.FieldContentType}))),p=>({content:p.value,types:{[f.keyOfType]:o.TimestampFieldType}}));e.TimestampLegacy=c,e.TimestampContent=i.strict({type:i.literal(o.TimestampFieldType),value:a.default,__TYPE__:i.literal(u.FieldContentType)})}(uS)),uS}var rL;function zz(){return rL||(rL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FieldContent=e.FieldType=void 0;const t=G,n=(0,t.__importStar)(ne),r=qj(),i=zj(),o=Hj(),a=Gj(),s=Zj(),u=eL(),l=nL();e.FieldType=n.keyof({Text:null,Date:null,Timestamp:null,Color:null,Number:null,Range:null,Select:null}),e.FieldContent=n.union([i.DateContent,r.ColorContent,o.NumberContent,a.RangeContent,s.SelectContent,u.TextContent,l.TimestampContent]),(0,t.__exportStar)(qj(),e),(0,t.__exportStar)(Pi,e),(0,t.__exportStar)(zj(),e),(0,t.__exportStar)(Hj(),e),(0,t.__exportStar)(Gj(),e),(0,t.__exportStar)(Zj(),e),(0,t.__exportStar)(eL(),e),(0,t.__exportStar)(nL(),e)}(tS)),tS}var lS={},iL;function Qz(){return iL||(iL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPointContent=e.GeoPointLegacy=e.isGeoPointContent=e.GeoPointContentType=void 0;const t=G,n=ut,r=vo,i=(0,t.__importStar)(ne),o=Ot();e.GeoPointContentType="GeoPointContent";const a=l=>(0,o.hasContentType)(l)&&l.__TYPE__===e.GeoPointContentType;e.isGeoPointContent=a;const s=i.strict({position:i.strict({lat:i.number,lng:i.number})}),u=l=>new i.Type("GeoPointLegacy",e.isGeoPointContent,c=>(0,r.pipe)(s.decode(c),n.either.map(f=>e.GeoPointContent.encode({...f,__TYPE__:e.GeoPointContentType}))),c=>({content:{position:c.position},types:{[l.keyOfType]:"GeoPoint"}}));e.GeoPointLegacy=u,e.GeoPointContent=i.intersection([s,i.strict({__TYPE__:i.literal(e.GeoPointContentType)})])}(lS)),lS}var cS={},oL;function jM(){return oL||(oL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageContent=e.ImageLegacy=e.ImageContentView=e.isImageContent=e.ImageContentType=void 0;const t=G,n=ut,r=Ye,i=(0,t.__importStar)(ne),o=Yr,a=ft(),s=Ot();e.ImageContentType="ImageContent";const u=p=>(0,s.hasContentType)(p)&&p.__TYPE__===e.ImageContentType;e.isImageContent=u;const l=i.exact(i.type({id:i.string,url:i.string,width:i.number,height:i.number}));e.ImageContentView=i.exact(i.intersection([i.type({origin:l,width:i.number,height:i.number,edit:i.type({zoom:i.number,crop:i.type({x:i.number,y:i.number}),background:i.string})}),i.partial({url:i.string,credits:a.NonEmptyStringOrNull,alt:a.NonEmptyStringOrNull,provider:a.StringOrNull})]));const c=i.intersection([e.ImageContentView,i.partial({thumbnails:i.record(i.string,e.ImageContentView)})]),f=p=>new i.Type("ImageLegacy",e.isImageContent,h=>(0,r.pipe)(c.decode(h),n.either.map(A=>e.ImageContent.encode({...A,__TYPE__:e.ImageContentType}))),h=>({content:(0,o.withOptionals)({edit:h.edit,height:h.height,origin:h.origin,width:h.width},[["alt",h.alt],["credits",h.credits],["provider",h.provider],["thumbnails",h.thumbnails],["url",h.url]]),types:{[p.keyOfType]:"Image"}}));e.ImageLegacy=f,e.ImageContent=i.intersection([c,i.strict({__TYPE__:i.literal(e.ImageContentType)})])}(cS)),cS}var dS={},aL;function Hz(){return aL||(aL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationFieldContent=e.IntegrationFieldLegacy=e.isIntegrationFieldContent=e.IntegrationFieldContentType=void 0;const t=G,n=ut,r=Ye,i=(0,t.__importStar)(ne),o=Ot();e.IntegrationFieldContentType="IntegrationFieldsContent";const a=u=>(0,o.hasContentType)(u)&&u.__TYPE__===e.IntegrationFieldContentType;e.isIntegrationFieldContent=a;const s=u=>new i.Type("IntegrationFieldLegacy",e.isIntegrationFieldContent,l=>(0,r.pipe)(i.string.decode(l),n.either.map(c=>e.IntegrationFieldContent.encode({value:c,__TYPE__:e.IntegrationFieldContentType}))),l=>({content:l.value,types:{[u.keyOfType]:"IntegrationFields"}}));e.IntegrationFieldLegacy=s,e.IntegrationFieldContent=i.strict({__TYPE__:i.literal(e.IntegrationFieldContentType),value:i.string})}(dS)),dS}var fS={},Yz={},j1={},L1={};Object.defineProperty(L1,"__esModule",{value:!0});L1.default=qMe;let gg;const KMe=new Uint8Array(16);function qMe(){if(!gg&&(gg=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!gg))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return gg(KMe)}var _u={},Ec={},D1={};Object.defineProperty(D1,"__esModule",{value:!0});D1.default=void 0;var VMe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;D1.default=VMe;Object.defineProperty(Ec,"__esModule",{value:!0});Ec.default=void 0;var zMe=QMe(D1);function QMe(e){return e&&e.__esModule?e:{default:e}}function HMe(e){return typeof e=="string"&&zMe.default.test(e)}var YMe=HMe;Ec.default=YMe;Object.defineProperty(_u,"__esModule",{value:!0});_u.default=void 0;_u.unsafeStringify=Gz;var GMe=JMe(Ec);function JMe(e){return e&&e.__esModule?e:{default:e}}const Tn=[];for(let e=0;e<256;++e)Tn.push((e+256).toString(16).slice(1));function Gz(e,t=0){return Tn[e[t+0]]+Tn[e[t+1]]+Tn[e[t+2]]+Tn[e[t+3]]+"-"+Tn[e[t+4]]+Tn[e[t+5]]+"-"+Tn[e[t+6]]+Tn[e[t+7]]+"-"+Tn[e[t+8]]+Tn[e[t+9]]+"-"+Tn[e[t+10]]+Tn[e[t+11]]+Tn[e[t+12]]+Tn[e[t+13]]+Tn[e[t+14]]+Tn[e[t+15]]}function ZMe(e,t=0){const n=Gz(e,t);if(!(0,GMe.default)(n))throw TypeError("Stringified UUID is invalid");return n}var XMe=ZMe;_u.default=XMe;Object.defineProperty(j1,"__esModule",{value:!0});j1.default=void 0;var eFe=nFe(L1),tFe=_u;function nFe(e){return e&&e.__esModule?e:{default:e}}let sL,pS,hS=0,AS=0;function rFe(e,t,n){let r=t&&n||0;const i=t||new Array(16);e=e||{};let o=e.node||sL,a=e.clockseq!==void 0?e.clockseq:pS;if(o==null||a==null){const p=e.random||(e.rng||eFe.default)();o==null&&(o=sL=[p[0]|1,p[1],p[2],p[3],p[4],p[5]]),a==null&&(a=pS=(p[6]<<8|p[7])&16383)}let s=e.msecs!==void 0?e.msecs:Date.now(),u=e.nsecs!==void 0?e.nsecs:AS+1;const l=s-hS+(u-AS)/1e4;if(l<0&&e.clockseq===void 0&&(a=a+1&16383),(l<0||s>hS)&&e.nsecs===void 0&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");hS=s,AS=u,pS=a,s+=122192928e5;const c=((s&268435455)*1e4+u)%4294967296;i[r++]=c>>>24&255,i[r++]=c>>>16&255,i[r++]=c>>>8&255,i[r++]=c&255;const f=s/4294967296*1e4&268435455;i[r++]=f>>>8&255,i[r++]=f&255,i[r++]=f>>>24&15|16,i[r++]=f>>>16&255,i[r++]=a>>>8|128,i[r++]=a&255;for(let p=0;p<6;++p)i[r+p]=o[p];return t||(0,tFe.unsafeStringify)(i)}var iFe=rFe;j1.default=iFe;var U1={},Ps={},Km={};Object.defineProperty(Km,"__esModule",{value:!0});Km.default=void 0;var oFe=aFe(Ec);function aFe(e){return e&&e.__esModule?e:{default:e}}function sFe(e){if(!(0,oFe.default)(e))throw TypeError("Invalid UUID");let t;const n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=t&255,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=t&255,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=t&255,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=t&255,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=t&255,n}var uFe=sFe;Km.default=uFe;Object.defineProperty(Ps,"__esModule",{value:!0});Ps.URL=Ps.DNS=void 0;Ps.default=pFe;var lFe=_u,cFe=dFe(Km);function dFe(e){return e&&e.__esModule?e:{default:e}}function fFe(e){e=unescape(encodeURIComponent(e));const t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}const Jz="6ba7b810-9dad-11d1-80b4-00c04fd430c8";Ps.DNS=Jz;const Zz="6ba7b811-9dad-11d1-80b4-00c04fd430c8";Ps.URL=Zz;function pFe(e,t,n){function r(i,o,a,s){var u;if(typeof i=="string"&&(i=fFe(i)),typeof o=="string"&&(o=(0,cFe.default)(o)),((u=o)===null||u===void 0?void 0:u.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let l=new Uint8Array(16+i.length);if(l.set(o),l.set(i,o.length),l=n(l),l[6]=l[6]&15|t,l[8]=l[8]&63|128,a){s=s||0;for(let c=0;c<16;++c)a[s+c]=l[c];return a}return(0,lFe.unsafeStringify)(l)}try{r.name=e}catch{}return r.DNS=Jz,r.URL=Zz,r}var B1={};Object.defineProperty(B1,"__esModule",{value:!0});B1.default=void 0;function hFe(e){if(typeof e=="string"){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return AFe(mFe(gFe(e),e.length*8))}function AFe(e){const t=[],n=e.length*32,r="0123456789abcdef";for(let i=0;i<n;i+=8){const o=e[i>>5]>>>i%32&255,a=parseInt(r.charAt(o>>>4&15)+r.charAt(o&15),16);t.push(a)}return t}function Xz(e){return(e+64>>>9<<4)+14+1}function mFe(e,t){e[t>>5]|=128<<t%32,e[Xz(t)-1]=t;let n=1732584193,r=-271733879,i=-1732584194,o=271733878;for(let a=0;a<e.length;a+=16){const s=n,u=r,l=i,c=o;n=Vn(n,r,i,o,e[a],7,-680876936),o=Vn(o,n,r,i,e[a+1],12,-389564586),i=Vn(i,o,n,r,e[a+2],17,606105819),r=Vn(r,i,o,n,e[a+3],22,-1044525330),n=Vn(n,r,i,o,e[a+4],7,-176418897),o=Vn(o,n,r,i,e[a+5],12,1200080426),i=Vn(i,o,n,r,e[a+6],17,-1473231341),r=Vn(r,i,o,n,e[a+7],22,-45705983),n=Vn(n,r,i,o,e[a+8],7,1770035416),o=Vn(o,n,r,i,e[a+9],12,-1958414417),i=Vn(i,o,n,r,e[a+10],17,-42063),r=Vn(r,i,o,n,e[a+11],22,-1990404162),n=Vn(n,r,i,o,e[a+12],7,1804603682),o=Vn(o,n,r,i,e[a+13],12,-40341101),i=Vn(i,o,n,r,e[a+14],17,-1502002290),r=Vn(r,i,o,n,e[a+15],22,1236535329),n=zn(n,r,i,o,e[a+1],5,-165796510),o=zn(o,n,r,i,e[a+6],9,-1069501632),i=zn(i,o,n,r,e[a+11],14,643717713),r=zn(r,i,o,n,e[a],20,-373897302),n=zn(n,r,i,o,e[a+5],5,-701558691),o=zn(o,n,r,i,e[a+10],9,38016083),i=zn(i,o,n,r,e[a+15],14,-660478335),r=zn(r,i,o,n,e[a+4],20,-405537848),n=zn(n,r,i,o,e[a+9],5,568446438),o=zn(o,n,r,i,e[a+14],9,-1019803690),i=zn(i,o,n,r,e[a+3],14,-187363961),r=zn(r,i,o,n,e[a+8],20,1163531501),n=zn(n,r,i,o,e[a+13],5,-1444681467),o=zn(o,n,r,i,e[a+2],9,-51403784),i=zn(i,o,n,r,e[a+7],14,1735328473),r=zn(r,i,o,n,e[a+12],20,-1926607734),n=Qn(n,r,i,o,e[a+5],4,-378558),o=Qn(o,n,r,i,e[a+8],11,-2022574463),i=Qn(i,o,n,r,e[a+11],16,1839030562),r=Qn(r,i,o,n,e[a+14],23,-35309556),n=Qn(n,r,i,o,e[a+1],4,-1530992060),o=Qn(o,n,r,i,e[a+4],11,1272893353),i=Qn(i,o,n,r,e[a+7],16,-155497632),r=Qn(r,i,o,n,e[a+10],23,-1094730640),n=Qn(n,r,i,o,e[a+13],4,681279174),o=Qn(o,n,r,i,e[a],11,-358537222),i=Qn(i,o,n,r,e[a+3],16,-722521979),r=Qn(r,i,o,n,e[a+6],23,76029189),n=Qn(n,r,i,o,e[a+9],4,-640364487),o=Qn(o,n,r,i,e[a+12],11,-421815835),i=Qn(i,o,n,r,e[a+15],16,530742520),r=Qn(r,i,o,n,e[a+2],23,-995338651),n=Hn(n,r,i,o,e[a],6,-198630844),o=Hn(o,n,r,i,e[a+7],10,1126891415),i=Hn(i,o,n,r,e[a+14],15,-1416354905),r=Hn(r,i,o,n,e[a+5],21,-57434055),n=Hn(n,r,i,o,e[a+12],6,1700485571),o=Hn(o,n,r,i,e[a+3],10,-1894986606),i=Hn(i,o,n,r,e[a+10],15,-1051523),r=Hn(r,i,o,n,e[a+1],21,-2054922799),n=Hn(n,r,i,o,e[a+8],6,1873313359),o=Hn(o,n,r,i,e[a+15],10,-30611744),i=Hn(i,o,n,r,e[a+6],15,-1560198380),r=Hn(r,i,o,n,e[a+13],21,1309151649),n=Hn(n,r,i,o,e[a+4],6,-145523070),o=Hn(o,n,r,i,e[a+11],10,-1120210379),i=Hn(i,o,n,r,e[a+2],15,718787259),r=Hn(r,i,o,n,e[a+9],21,-343485551),n=Is(n,s),r=Is(r,u),i=Is(i,l),o=Is(o,c)}return[n,r,i,o]}function gFe(e){if(e.length===0)return[];const t=e.length*8,n=new Uint32Array(Xz(t));for(let r=0;r<t;r+=8)n[r>>5]|=(e[r/8]&255)<<r%32;return n}function Is(e,t){const n=(e&65535)+(t&65535);return(e>>16)+(t>>16)+(n>>16)<<16|n&65535}function vFe(e,t){return e<<t|e>>>32-t}function P1(e,t,n,r,i,o){return Is(vFe(Is(Is(t,e),Is(r,o)),i),n)}function Vn(e,t,n,r,i,o,a){return P1(t&n|~t&r,e,t,i,o,a)}function zn(e,t,n,r,i,o,a){return P1(t&r|n&~r,e,t,i,o,a)}function Qn(e,t,n,r,i,o,a){return P1(t^n^r,e,t,i,o,a)}function Hn(e,t,n,r,i,o,a){return P1(n^(t|~r),e,t,i,o,a)}var yFe=hFe;B1.default=yFe;Object.defineProperty(U1,"__esModule",{value:!0});U1.default=void 0;var bFe=eQ(Ps),CFe=eQ(B1);function eQ(e){return e&&e.__esModule?e:{default:e}}const SFe=(0,bFe.default)("v3",48,CFe.default);var wFe=SFe;U1.default=wFe;var W1={},N1={};Object.defineProperty(N1,"__esModule",{value:!0});N1.default=void 0;const _Fe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);var xFe={randomUUID:_Fe};N1.default=xFe;Object.defineProperty(W1,"__esModule",{value:!0});W1.default=void 0;var uL=tQ(N1),TFe=tQ(L1),IFe=_u;function tQ(e){return e&&e.__esModule?e:{default:e}}function EFe(e,t,n){if(uL.default.randomUUID&&!t&&!e)return uL.default.randomUUID();e=e||{};const r=e.random||(e.rng||TFe.default)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return(0,IFe.unsafeStringify)(r)}var RFe=EFe;W1.default=RFe;var K1={},q1={};Object.defineProperty(q1,"__esModule",{value:!0});q1.default=void 0;function $Fe(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:return t^n^r;case 2:return t&n^t&r^n&r;case 3:return t^n^r}}function mS(e,t){return e<<t|e>>>32-t}function kFe(e){const t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){const a=unescape(encodeURIComponent(e));e=[];for(let s=0;s<a.length;++s)e.push(a.charCodeAt(s))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const r=e.length/4+2,i=Math.ceil(r/16),o=new Array(i);for(let a=0;a<i;++a){const s=new Uint32Array(16);for(let u=0;u<16;++u)s[u]=e[a*64+u*4]<<24|e[a*64+u*4+1]<<16|e[a*64+u*4+2]<<8|e[a*64+u*4+3];o[a]=s}o[i-1][14]=(e.length-1)*8/Math.pow(2,32),o[i-1][14]=Math.floor(o[i-1][14]),o[i-1][15]=(e.length-1)*8&4294967295;for(let a=0;a<i;++a){const s=new Uint32Array(80);for(let h=0;h<16;++h)s[h]=o[a][h];for(let h=16;h<80;++h)s[h]=mS(s[h-3]^s[h-8]^s[h-14]^s[h-16],1);let u=n[0],l=n[1],c=n[2],f=n[3],p=n[4];for(let h=0;h<80;++h){const A=Math.floor(h/20),g=mS(u,5)+$Fe(A,l,c,f)+p+t[A]+s[h]>>>0;p=f,f=c,c=mS(l,30)>>>0,l=u,u=g}n[0]=n[0]+u>>>0,n[1]=n[1]+l>>>0,n[2]=n[2]+c>>>0,n[3]=n[3]+f>>>0,n[4]=n[4]+p>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,n[0]&255,n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,n[1]&255,n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,n[2]&255,n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,n[3]&255,n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,n[4]&255]}var OFe=kFe;q1.default=OFe;Object.defineProperty(K1,"__esModule",{value:!0});K1.default=void 0;var MFe=nQ(Ps),FFe=nQ(q1);function nQ(e){return e&&e.__esModule?e:{default:e}}const jFe=(0,MFe.default)("v5",80,FFe.default);var LFe=jFe;K1.default=LFe;var V1={};Object.defineProperty(V1,"__esModule",{value:!0});V1.default=void 0;var DFe="00000000-0000-0000-0000-000000000000";V1.default=DFe;var z1={};Object.defineProperty(z1,"__esModule",{value:!0});z1.default=void 0;var UFe=BFe(Ec);function BFe(e){return e&&e.__esModule?e:{default:e}}function PFe(e){if(!(0,UFe.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}var WFe=PFe;z1.default=WFe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"NIL",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"v1",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"v3",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"v4",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"v5",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"validate",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return a.default}});var t=c(j1),n=c(U1),r=c(W1),i=c(K1),o=c(V1),a=c(z1),s=c(Ec),u=c(_u),l=c(Km);function c(f){return f&&f.__esModule?f:{default:f}}})(Yz);var lL;function Q1(){return lL||(lL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FilledLinkContent=e.FilledLink=e.FilledLinkContentLegacy=e.FilledLinkLegacy=e.isFilledLinkContent=e.LinkContent=e.Link=e.LinkContentLegacy=e.LinkLegacy=e.isLinkContent=e.LinkContentType=e.AnyLinkContent=e.AnyLinkType=e.ExternalLinkContent=e.FilledExternalLinkContent=e.ExternalLinkType=e.DocumentLinkContent=e.FilledDocumentLinkContent=e.DocumentLinkType=e.MediaLinkContent=e.MediaLinkType=e.FileLinkContent=e.FilledFileLinkContent=e.FileLinkType=e.ImageLinkContent=e.FilledImageLinkContent=e.ImageLinkType=void 0;const t=G,n=ut,r=Ye,i=(0,t.__importStar)(ne),o=w1,a=Yz,s=ft(),u=nt,l=Ot(),c=P=>typeof P=="string"&&(0,a.validate)(P),f=new i.Type("UUID",c,(P,ae)=>typeof P>"u"?i.success((0,a.v4)()):c(P)?i.success(P):i.failure(P,ae),i.identity);function p(P){return i.intersection([i.strict({key:f}),P])}e.ImageLinkType="ImageLink";const h=P=>typeof P=="string",A=new i.Type("ImageLinkKind",P=>h(P),(P,ae)=>h(P)?i.success("image"):i.failure(P,ae),()=>"image"),g=i.intersection([i.strict({kind:A,id:i.string,url:i.string,height:i.string,width:i.string,size:i.string,name:i.string}),i.exact(i.partial({date:s.StringOrNull}))]),y=new i.Type("FilledImageLink",P=>(0,l.hasContentType)(P)&&P.__TYPE__===e.ImageLinkType,P=>(0,r.pipe)(g.decode(P),n.either.map(ae=>e.FilledImageLinkContent.encode({...ae,__TYPE__:e.ImageLinkType}))),P=>g.encode(P));e.FilledImageLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.ImageLinkType)}),g]);const C=i.intersection([i.union([g,i.strict({kind:i.literal("image")})]),i.exact(i.partial({text:i.string,variant:i.string}))]),_=new i.Type("ImageLink",P=>(0,l.hasContentType)(P)&&P.__TYPE__===e.ImageLinkType,P=>(0,r.pipe)(C.decode(P),n.either.map(ae=>e.ImageLinkContent.encode({...ae,__TYPE__:e.ImageLinkType}))),P=>C.encode(P));e.ImageLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.ImageLinkType)}),C]),e.FileLinkType="FileLink";const b=P=>typeof P=="string",v=new i.Type("FileLinkKind",P=>b(P),(P,ae)=>b(P)?i.success("file"):i.failure(P,ae),()=>"file"),S=i.exact(i.intersection([i.type({kind:v,id:i.string,url:i.string,name:i.string,size:(0,o.withFallback)(i.string,"0")}),i.partial({date:s.StringOrNull})])),w=new i.Type("FilledFileLink",P=>(0,l.hasContentType)(P)&&P.__TYPE__===e.FileLinkType,P=>(0,r.pipe)(S.decode(P),n.either.map(ae=>e.FilledFileLinkContent.encode({...ae,__TYPE__:e.FileLinkType}))),P=>S.encode(P));e.FilledFileLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.FileLinkType)}),S]);const T=i.intersection([i.union([S,i.strict({kind:i.literal("file")})]),i.exact(i.partial({text:i.string,variant:i.string}))]),E=new i.Type("FileLink",P=>(0,l.hasContentType)(P)&&P.__TYPE__===e.FileLinkType,P=>(0,r.pipe)(T.decode(P),n.either.map(ae=>e.FileLinkContent.encode({...ae,__TYPE__:e.FileLinkType}))),P=>T.encode(P));e.FileLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.FileLinkType)}),T]),e.MediaLinkType="MediaLink";const R=i.intersection([i.strict({kind:i.literal("media")}),i.exact(i.partial({text:i.string,variant:i.string}))]),O=new i.Type("MediaLink",P=>(0,l.hasContentType)(P)&&P.__TYPE__===e.MediaLinkType,P=>(0,r.pipe)(R.decode(P),n.either.map(ae=>e.MediaLinkContent.encode({...ae,__TYPE__:e.MediaLinkType}))),P=>R.encode(P));e.MediaLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.MediaLinkType)}),R]),e.DocumentLinkType="DocumentLink";const $=i.strict({id:s.NonEmptyString}),B=new i.Type("FilledDocumentLink",P=>(0,l.hasContentType)(P)&&P.__TYPE__===e.DocumentLinkType,P=>(0,r.pipe)($.decode(P),n.either.map(ae=>e.FilledDocumentLinkContent.encode({...ae,__TYPE__:e.DocumentLinkType}))),P=>$.encode(P));e.FilledDocumentLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.DocumentLinkType)}),$]);const K=i.intersection([i.union([$,i.strict({kind:i.literal("document")})]),i.exact(i.partial({text:i.string,variant:i.string}))]),H=new i.Type("DocumentLink",P=>(0,l.hasContentType)(P)&&P.__TYPE__===e.DocumentLinkType,P=>(0,r.pipe)(K.decode(P),n.either.map(ae=>e.DocumentLinkContent.encode({...ae,__TYPE__:e.DocumentLinkType}))),P=>K.encode(P));e.DocumentLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.DocumentLinkType)}),K]),e.ExternalLinkType="ExternalLink";const z=i.exact(i.intersection([i.type({url:i.string}),i.partial({kind:i.literal("web"),target:s.StringOrNull,preview:(0,u.nullable)(i.partial({title:i.string}))})])),N=new i.Type("FilledExternalLink",P=>(0,l.hasContentType)(P)&&P.__TYPE__===e.ExternalLinkType,P=>(0,r.pipe)(z.decode(P),n.either.map(ae=>e.FilledExternalLinkContent.encode({...ae,__TYPE__:e.ExternalLinkType}))),P=>z.encode(P));e.FilledExternalLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.ExternalLinkType)}),z]);const Y=i.intersection([i.union([z,i.strict({kind:i.literal("web")})]),i.exact(i.partial({text:i.string,variant:i.string}))]),ee=new i.Type("ExternalLink",P=>(0,l.hasContentType)(P)&&P.__TYPE__===e.ExternalLinkType,P=>(0,r.pipe)(Y.decode(P),n.either.map(ae=>e.ExternalLinkContent.encode({...ae,__TYPE__:e.ExternalLinkType}))),P=>Y.encode(P));e.ExternalLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.ExternalLinkType)}),Y]),e.AnyLinkType="AnyLink";const F=i.exact(i.intersection([i.type({kind:(0,o.withFallback)(i.literal("any"),"any")}),i.partial({text:i.string,variant:i.string})])),M=new i.Type("AnyLink",P=>(0,l.hasContentType)(P)&&P.__TYPE__===e.AnyLinkType,P=>(0,r.pipe)(F.decode(P),n.either.map(ae=>e.AnyLinkContent.encode({...ae,__TYPE__:e.AnyLinkType}))),P=>F.encode(P));e.AnyLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.AnyLinkType)}),F]),e.LinkContentType="LinkContent";const W=P=>(0,l.hasContentType)(P)&&P.__TYPE__===e.LinkContentType;e.isLinkContent=W,e.LinkLegacy=p(i.union([_,E,H,ee,O,M]));const re=P=>new i.Type("LinkLegacy",e.isLinkContent,ae=>(0,r.pipe)(e.LinkLegacy.decode(ae),n.either.map(({key:Ge,...ve})=>e.LinkContent.encode({__TYPE__:"LinkContent",key:Ge,value:ve}))),({key:ae,value:Ge})=>({content:e.LinkLegacy.encode({...Ge,key:ae}),types:{[P.keyOfType]:"Link"}}));e.LinkContentLegacy=re,e.Link=i.union([e.ImageLinkContent,e.FileLinkContent,e.DocumentLinkContent,e.ExternalLinkContent,e.MediaLinkContent,e.AnyLinkContent]),e.LinkContent=p(i.strict({__TYPE__:i.literal(e.LinkContentType),value:e.Link}));const Ie=P=>(0,l.hasContentType)(P)&&P.__TYPE__===e.LinkContentType;e.isFilledLinkContent=Ie,e.FilledLinkLegacy=i.union([y,w,B,N]);const Ce=P=>{const ae=p(e.FilledLinkLegacy);return new i.Type("FilledLinkLegacy",e.isFilledLinkContent,Ge=>(0,r.pipe)(ae.decode(Ge),n.either.map(({key:ve,...De})=>e.FilledLinkContent.encode({__TYPE__:"LinkContent",key:ve,value:De}))),({key:Ge,value:ve})=>({content:ae.encode({...ve,key:Ge}),types:{[P.keyOfType]:"Link"}}))};e.FilledLinkContentLegacy=Ce,e.FilledLink=i.union([e.FilledImageLinkContent,e.FilledFileLinkContent,e.FilledDocumentLinkContent,e.FilledExternalLinkContent]),e.FilledLinkContent=p(i.strict({__TYPE__:i.literal(e.LinkContentType),value:e.FilledLink}))}(fS)),fS}var Ni={},gS={},cL;function rQ(){return cL||(cL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.traverseRepeatableContent=e.RepeatableLegacy=e.isRepeatableContent=e.RepeatableContent=void 0;const t=G,n=ut,r=cn,i=Ye,o=(0,t.__importStar)(ne),a=Ot(),s=Q1(),u="RepeatableContent";e.RepeatableContent=o.strict({__TYPE__:o.literal(u),type:o.literal("Link"),value:o.array(s.LinkContent)});const l=p=>(0,a.hasContentType)(p)&&p.__TYPE__===u;e.isRepeatableContent=l;const c=(p,h)=>new o.Type("RepeatableLegacy",e.isRepeatableContent,A=>(0,i.pipe)(o.array(o.unknown).decode(A),n.either.map(y=>({value:y.reduce((_,b)=>{let v;switch(h){case"Link":v=(0,s.LinkContentLegacy)(p).decode(b);break}return!v||(0,r.isLeft)(v)?_:[..._,v.right]},[]),type:h,__TYPE__:"RepeatableContent"}))),A=>({content:o.array(s.LinkContent).encode(A.value).reduce((C,_)=>{let b;switch(_.__TYPE__){case s.LinkContentType:b=(0,s.LinkContentLegacy)(p).encode(_);break}return b?[...C,b]:C},[]).map(C=>C.content),types:{[p.keyOfType]:`Repeatable.${h}`}}));e.RepeatableLegacy=c;function f({path:p,key:h,apiId:A,model:g,content:y}){return C=>{const _=y.value.reduce((b,v,S)=>{const w=p.concat([{key:S.toString(),type:"Widget"}]),T=(g==null?void 0:g.type)==="Link"&&g.config?{...g,config:{...g.config,repeat:!1}}:g,E=C({path:w,key:h,apiId:A,model:T,content:v});return!E||!(0,s.isLinkContent)(E)?b:b.concat(E)},[]);return C({path:p,key:h,apiId:A,model:g,content:{__TYPE__:y.__TYPE__,type:y.type,value:_}})}}e.traverseRepeatableContent=f}(gS)),gS}var vS={},yS={},dL;function fL(){return dL||(dL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Block=e.BlockLegacy=e.TextBlockLegacy=e.TextBlock=e.checkEmbedBlock=e.EmbedBlock=e.checkImageBlock=e.ImageBlock=e.ValidatedSpans=e.SpanLegacy=e.Span=void 0;const t=G,n=ut,r=cn,i=Ye,o=(0,t.__importStar)(ne),a=w1,s=Bm,u=ft(),l=nt,c=FM(),f=jM(),p=Q1(),h=R=>o.strict({data:R,start:o.number,end:o.number,type:o.literal(s.RichTextNodeType.hyperlink)}),A=o.strict({data:(0,a.withFallback)(o.string,""),start:o.number,end:o.number,type:o.literal("label")}),g=o.strict({start:o.number,end:o.number,type:o.keyof({[s.RichTextNodeType.strong]:null,[s.RichTextNodeType.em]:null,"list-item":null})});e.Span=o.union([h(p.FilledLink),A,g]),e.SpanLegacy=o.union([h(p.FilledLinkLegacy),A,g]);const y=R=>new o.Type("ValidatedSpans",O=>Array.isArray(O)&&O.every(R.is),(O,$)=>{if(Array.isArray(O)){const B=O.reduce((K,H)=>{const z=R.decode(H);return(0,r.isLeft)(z)?K:[...K,z.right]},[]).sort((K,H)=>K.start-H.start);return o.success(B)}else return o.failure(O,$)},O=>O.reduce(($,B)=>{const K=R.encode(B);return[...$,K]},[]));e.ValidatedSpans=y;const C=R=>o.exact(o.intersection([o.type({type:o.literal(s.RichTextNodeType.image),data:o.intersection([f.ImageContentView,o.partial({linkTo:(0,l.nullable)(R)})])}),o.partial({label:u.StringOrNull,direction:u.StringOrNull})]));e.ImageBlock=C(p.FilledLink);const _=C(p.FilledLinkLegacy);function b(R){return R.type===s.RichTextNodeType.image}e.checkImageBlock=b;const v=o.exact(o.intersection([o.type({type:o.literal(s.RichTextNodeType.embed),data:o.unknown}),o.partial({label:u.StringOrNull,direction:u.StringOrNull})])),S=new o.Type("EmbedBlockLegacy",R=>R.type==="embed",R=>(0,i.pipe)(v.decode(R),n.either.chain(O=>n.either.map($=>[O,$])(c.EmbedContentLegacy.decode(O.data))),n.either.map(([O,$])=>e.EmbedBlock.encode({...O,data:{...$,__TYPE__:c.EmbedContentType,all:O.data}}))),R=>({...v.encode(R),data:c.EmbedContentLegacy.encode(R.data)}));e.EmbedBlock=o.exact(o.intersection([o.type({type:o.literal(s.RichTextNodeType.embed),data:c.EmbedContent}),o.partial({label:u.StringOrNull,direction:u.StringOrNull})]));function w(R){return R.type===s.RichTextNodeType.embed}e.checkEmbedBlock=w;const T=R=>o.exact(o.intersection([o.type({type:(0,l.refineType)(s.RichTextNodeTypeCodec,`string which isn't ${s.RichTextNodeType.image} ${s.RichTextNodeType.embed}`,O=>O!==s.RichTextNodeType.image&&O!==s.RichTextNodeType.embed),content:o.intersection([o.type({text:o.string}),o.partial({spans:(0,e.ValidatedSpans)(R)})])}),o.partial({label:o.string,direction:o.string})]));e.TextBlock=T(e.Span),e.TextBlockLegacy=T(e.SpanLegacy);const E=o.union([S,_,e.TextBlockLegacy]);e.BlockLegacy=new o.Type("BlockLegacy",R=>S.is(R)||_.is(R)||e.TextBlockLegacy.is(R),R=>E.decode(R),R=>(()=>e.ImageBlock.is(R)?_.encode(R):e.EmbedBlock.is(R)?S.encode(R):e.TextBlockLegacy.encode(R))()),e.Block=o.union([e.ImageBlock,e.EmbedBlock,e.TextBlock])}(yS)),yS}var pL;function LM(){return pL||(pL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RichTextLegacy=e.RichTextContent=e.RichTextLegacyContent=e.isRichTextContent=e.RichTextContentType=void 0;const t=G,n=ut,r=Ye,i=(0,t.__importStar)(ne),o=Ot(),a=fL();e.RichTextContentType="StructuredTextContent";const s=l=>(0,o.hasContentType)(l)&&l.__TYPE__===e.RichTextContentType;e.isRichTextContent=s,e.RichTextLegacyContent=i.array(a.BlockLegacy),e.RichTextContent=i.strict({__TYPE__:i.literal(e.RichTextContentType),value:i.array(a.Block)}),(0,t.__exportStar)(fL(),e);const u=l=>new i.Type("RichTextLegacy",e.isRichTextContent,c=>(0,r.pipe)(e.RichTextLegacyContent.decode(c),n.either.map(f=>({value:f,__TYPE__:e.RichTextContentType}))),c=>({content:e.RichTextLegacyContent.encode(c.value),types:{[l.keyOfType]:"StructuredText"}}));e.RichTextLegacy=u}(vS)),vS}var bS={},hL;function iQ(){return hL||(hL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SeparatorContent=e.SeparatorLegacy=e.isSeparatorContent=e.SeparatorContentType=void 0;const n=(0,G.__importStar)(ne),r=Ot();e.SeparatorContentType="SeparatorContent";const i=a=>(0,r.hasContentType)(a)&&a.__TYPE__===e.SeparatorContentType;e.isSeparatorContent=i;const o=a=>new n.Type("SeparatorLegacy",e.isSeparatorContent,()=>n.success(e.SeparatorContent.encode({__TYPE__:e.SeparatorContentType})),()=>({content:{},types:{[a.keyOfType]:"Separator"}}));e.SeparatorLegacy=o,e.SeparatorContent=n.strict({__TYPE__:n.literal(e.SeparatorContentType)})}(bS)),bS}var CS={},AL;function oQ(){return AL||(AL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.traverseTableContent=e.TableLegacy=e.TableContent=e.isTableContent=e.TableContentType=void 0;const t=G,n=ut,r=Ye,i=(0,t.__importStar)(ne),o=he,a=Ot(),s=LM();e.TableContentType="TableContent";const u=y=>(0,a.hasContentType)(y)&&y.__TYPE__===e.TableContentType;e.isTableContent=u;const l=i.strict({type:i.union([i.literal("tableHeader"),i.literal("tableCell")]),content:s.RichTextContent}),c=i.strict({type:i.literal("tableRow"),content:i.array(l)});e.TableContent=i.strict({__TYPE__:i.literal(e.TableContentType),content:i.array(c)});const f=i.strict({type:i.union([i.literal("tableHeader"),i.literal("tableCell")]),content:s.RichTextLegacyContent}),p=i.strict({type:i.literal("tableRow"),content:i.array(f)}),h=i.strict({content:i.array(p)}),A=y=>new i.Type("TableLegacy",e.isTableContent,C=>(0,r.pipe)(h.decode(C),n.either.map(_=>({__TYPE__:"TableContent",content:_.content.map(b=>({...b,content:b.content.map(v=>({...v,content:{__TYPE__:"StructuredTextContent",value:v.content}}))}))}))),C=>({content:h.encode({content:C.content.map(_=>({..._,content:_.content.map(b=>({...b,content:b.content.value}))}))}),types:{[y.keyOfType]:"Table"}}));e.TableLegacy=A;function g({path:y,key:C,apiId:_,model:b,content:v}){return S=>{const w=v.content.map((T,E)=>({...T,content:T.content.map((R,O)=>{const $=y.concat([{key:[E.toString(),O.toString()].join(","),type:"Widget"}]),B=S({path:$,key:C,apiId:_,model:o.TableCell,content:{__TYPE__:R.content.__TYPE__,value:R.content.value}})||{__TYPE__:"StructuredTextContent",value:[]};return{...R,content:B}})}));return S({path:y,key:C,apiId:_,model:b,content:{__TYPE__:v.__TYPE__,content:w}})}}e.traverseTableContent=g}(CS)),CS}var mL;function NFe(){if(mL)return Ni;mL=1,Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.NestableLegacy=Ni.isNestableContent=Ni.NestableContentDefaultValue=Ni.NestableContent=void 0;const e=G,t=cn,n=(0,e.__importStar)(ne),r=qz(),i=Vz(),o=FM(),a=zz(),s=Pi,u=Qz(),l=jM(),c=Hz(),f=Q1(),p=rQ(),h=LM(),A=iQ(),g=oQ();Ni.NestableContent=n.union([r.EmptyContent,i.BooleanContent,o.EmbedContent,a.TextContent,a.TimestampContent,a.SelectContent,a.RangeContent,a.NumberContent,a.DateContent,a.ColorContent,u.GeoPointContent,l.ImageContent,c.IntegrationFieldContent,f.LinkContent,h.RichTextContent,A.SeparatorContent,g.TableContent,p.RepeatableContent]);const y=b=>{switch(b.type){case"Boolean":return(0,i.BooleanContentDefaultValue)(b);case"Select":return(0,a.SelectContentDefaultValue)(b);default:return}};Ni.NestableContentDefaultValue=y;const C=b=>(0,a.isTextContent)(b)||(0,a.isColorContent)(b)||(0,a.isDateContent)(b)||(0,a.isTimestampContent)(b)||(0,a.isNumberContent)(b)||(0,a.isRangeContent)(b)||(0,a.isSelectContent)(b)||(0,u.isGeoPointContent)(b)||(0,h.isRichTextContent)(b)||(0,i.isBooleanContent)(b)||(0,o.isEmbedContent)(b)||(0,l.isImageContent)(b)||(0,c.isIntegrationFieldContent)(b)||(0,f.isLinkContent)(b)||(0,A.isSeparatorContent)(b)||(0,g.isTableContent)(b)||(0,r.isEmptyContent)(b)||(0,p.isRepeatableContent)(b);Ni.isNestableContent=C;const _=b=>({decode(v){if(!b.fieldType)return;const S=(0,r.EmptyLegacy)(b.fieldType).decode(v);if((0,t.isRight)(S))return S;const w=(()=>{switch(b.fieldType){case"Text":return(0,a.TextLegacy)(b);case"Color":return(0,a.ColorLegacy)(b);case"Date":return(0,a.DateLegacy)(b);case"Timestamp":return(0,a.TimestampLegacy)(b);case"Number":return(0,a.NumberLegacy)(b);case"Range":return(0,a.RangeLegacy)(b);case"Select":return(0,a.SelectLegacy)(b);case"GeoPoint":return(0,u.GeoPointLegacy)(b);case"StructuredText":return(0,h.RichTextLegacy)(b);case"Boolean":return(0,i.BooleanLegacy)(b);case"Embed":return(0,o.EmbedLegacy)(b);case"Image":return(0,l.ImageLegacy)(b);case"IntegrationFields":return(0,c.IntegrationFieldLegacy)(b);case"Link":return(0,f.LinkContentLegacy)(b);case"Separator":return(0,A.SeparatorLegacy)(b);case"Table":return(0,g.TableLegacy)(b);case"Repeatable.Link":return(0,p.RepeatableLegacy)(b,"Link");default:return}})();if(w)return w.decode(v)},encode(v){switch(v.__TYPE__){case s.FieldContentType:return v.type==="Text"?(0,a.TextLegacy)(b).encode(v):v.type==="Color"?(0,a.ColorLegacy)(b).encode(v):v.type==="Range"?(0,a.RangeLegacy)(b).encode(v):v.type==="Date"?(0,a.DateLegacy)(b).encode(v):v.type==="Number"?(0,a.NumberLegacy)(b).encode(v):v.type==="Timestamp"?(0,a.TimestampLegacy)(b).encode(v):v.type==="Select"?(0,a.SelectLegacy)(b).encode(v):void 0;case u.GeoPointContentType:return(0,u.GeoPointLegacy)(b).encode(v);case h.RichTextContentType:return(0,h.RichTextLegacy)(b).encode(v);case o.EmbedContentType:return(0,o.EmbedLegacy)(b).encode(v);case i.BooleanContentType:return(0,i.BooleanLegacy)(b).encode(v);case l.ImageContentType:return(0,l.ImageLegacy)(b).encode(v);case c.IntegrationFieldContentType:return(0,c.IntegrationFieldLegacy)(b).encode(v);case f.LinkContentType:return(0,f.LinkContentLegacy)(b).encode(v);case A.SeparatorContentType:return(0,A.SeparatorLegacy)(b).encode(v);case g.TableContentType:return(0,g.TableLegacy)(b).encode(v);case"RepeatableContent":return(0,p.RepeatableLegacy)(b,v.type).encode(v);default:return}}});return Ni.NestableLegacy=_,Ni}var gL;function ia(){return gL||(gL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(Vz(),e),(0,t.__exportStar)(FM(),e),(0,t.__exportStar)(zz(),e),(0,t.__exportStar)(Qz(),e),(0,t.__exportStar)(jM(),e),(0,t.__exportStar)(Hz(),e),(0,t.__exportStar)(Q1(),e),(0,t.__exportStar)(NFe(),e),(0,t.__exportStar)(rQ(),e),(0,t.__exportStar)(LM(),e),(0,t.__exportStar)(iQ(),e),(0,t.__exportStar)(oQ(),e)}(ZC)),ZC}var ua={},vL;function H1(){if(vL)return ua;vL=1,Object.defineProperty(ua,"__esModule",{value:!0}),ua.repeatableContentWithDefaultNestableContentValues=ua.withDefaultNestableContentValues=ua.withDefaultSlicePrimaryContentValues=void 0;const e=he,t=ps(),n=ia();function r(a,s){const u=s;for(const[l,c]of Object.entries(a)){const f=s[l];if(f===void 0){if(c.type===e.GroupFieldType)u[l]=(0,t.groupContentWithDefaultValues)(c,t.GroupContentDefaultValue);else{const p=(0,n.NestableContentDefaultValue)(c);p&&(u[l]=p)}continue}c.type===e.GroupFieldType&&(0,t.isGroupContent)(f)&&(u[l]=(0,t.groupContentWithDefaultValues)(c,f))}return u}ua.withDefaultSlicePrimaryContentValues=r;function i(a,s){return Object.entries(a).reduce((u,[l,c])=>{if(s[l]===void 0){const f=(0,n.NestableContentDefaultValue)(c);return f!==void 0?{...u,[l]:f}:u}return u},s)}ua.withDefaultNestableContentValues=i;function o(a,s){const u=Object.entries(a);return s.map(l=>u.reduce((c,[f,p])=>{var h;const A=l.value.find(([g])=>g===f);if(p.type==="Group"){const g=(0,t.groupContentWithDefaultValues)(p,(h=A==null?void 0:A[1])!==null&&h!==void 0?h:{__TYPE__:t.GroupContentType,value:[]});return{...c,value:[...c.value.filter(([y])=>y!==f),...g?[[f,g]]:[]]}}else if(!A){const g=(0,n.NestableContentDefaultValue)(p);return{...c,value:[...c.value,...g?[[f,g]]:[]]}}return c},l))}return ua.repeatableContentWithDefaultNestableContentValues=o,ua}var yL;function ps(){return yL||(yL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.traverseGroupItemsContent=e.traverseGroupContent=e.groupContentWithDefaultValues=e.GroupLegacy=e.GroupItemLegacy=e.GroupContentDefaultValue=e.isGroupContent=e.GroupContent=e.GroupItemContent=e.GroupContentType=e.GroupItemContentType=void 0;const t=G,n=ut,r=cn,i=Ye,o=(0,t.__importStar)(ne),a=he,s=dr,u=Ot(),l=ia(),c=H1();e.GroupItemContentType="GroupItemContent",e.GroupContentType="GroupContentType",e.GroupItemContent=o.recursion("GroupItemContent",()=>o.strict({__TYPE__:o.literal(e.GroupItemContentType),value:o.array(o.tuple([o.string,o.union([l.NestableContent,e.GroupContent])]))})),e.GroupContent=o.recursion("GroupContent",()=>o.strict({__TYPE__:o.literal(e.GroupContentType),value:o.array(e.GroupItemContent)}));const f=_=>(0,u.hasContentType)(_)&&_.__TYPE__===e.GroupContentType;e.isGroupContent=f,e.GroupContentDefaultValue={__TYPE__:e.GroupContentType,value:[]};const p=o.record(o.string,o.unknown),h=_=>new o.Type("GroupItemLegacy",b=>(0,u.hasContentType)(b)&&b.__TYPE__===e.GroupItemContentType,b=>(0,i.pipe)(p.decode(b),n.either.map(S=>({value:Object.entries(S).reduce((T,[E,R])=>{const O=(0,s.getFieldCtx)(E,_),$=O.fieldType===a.GroupFieldType?(0,e.GroupLegacy)(O).decode(R):(0,l.NestableLegacy)(O).decode(R);return!$||(0,r.isLeft)($)?T:[...T,[E,$.right]]},[]),__TYPE__:e.GroupItemContentType}))),b=>b.value.reduce((v,[S,w])=>{const T=(0,s.getFieldCtx)(S,_),E=(0,e.isGroupContent)(w)?(0,e.GroupLegacy)(T).encode(w):(0,l.NestableLegacy)(T).encode(w);return E?{content:{...v.content,[S]:E.content},types:{...v.types,...E.types}}:v},{content:{},types:{}}));e.GroupItemLegacy=h;const A=_=>{const b=o.array(o.union([o.null,(0,e.GroupItemLegacy)(_)])),v=o.array((0,e.GroupItemLegacy)(_));return new o.Type("GroupLegacy",e.isGroupContent,S=>(0,i.pipe)(b.decode(S),n.either.map(w=>({value:w.map(T=>T===null?{__TYPE__:e.GroupItemContentType,value:[]}:T),__TYPE__:e.GroupContentType}))),S=>{const w=v.encode(S.value);return{content:w.map(T=>T.content),types:w.reduce((T,E)=>({...T,...E.types}),{[_.keyOfType]:a.GroupFieldType})}})};e.GroupLegacy=A;function g(_,b){var v;const S=(v=_.config)===null||v===void 0?void 0:v.fields;return S?{...b,value:(0,c.repeatableContentWithDefaultNestableContentValues)(S,b.value)}:b}e.groupContentWithDefaultValues=g;function y({path:_,key:b,apiId:v,model:S,content:w}){return T=>{var E;const R=C({path:_,model:(E=S==null?void 0:S.config)===null||E===void 0?void 0:E.fields,content:w.value})(T);return T({path:_,key:b,apiId:v,model:S,content:{__TYPE__:w.__TYPE__,value:R}})}}e.traverseGroupContent=y;function C({path:_,model:b,content:v}){return S=>v.map((w,T)=>{const E=_.concat([{key:T.toString(),type:"GroupItem"}]),R=w.value.reduce((O,[$,B])=>{const K=b==null?void 0:b[$];let H;return(0,e.isGroupContent)(B)?H=y({path:E.concat([{key:$,type:"Widget"}]),key:$,apiId:$,model:(K==null?void 0:K.type)==="Group"?K:void 0,content:B})(S):(0,l.isRepeatableContent)(B)?H=(0,l.traverseRepeatableContent)({path:E.concat([{key:$,type:"Widget"}]),key:$,apiId:$,model:(K==null?void 0:K.type)==="Link"?K:void 0,content:B})(S):(0,l.isTableContent)(B)?H=(0,l.traverseTableContent)({path:E.concat([{key:$,type:"Widget"}]),key:$,apiId:$,model:(K==null?void 0:K.type)==="Table"?K:void 0,content:B})(S):H=S({path:E.concat([{key:$,type:"Widget"}]),key:$,apiId:$,model:K,content:B}),!H||!((0,l.isNestableContent)(H)||(0,e.isGroupContent)(H))?O:O.concat([[$,H]])},[]);return{__TYPE__:w.__TYPE__,value:R}})}e.traverseGroupItemsContent=C}(GC)),GC}var SS={},wS={},_S={},Lu={},bL;function aQ(){if(bL)return Lu;bL=1,Object.defineProperty(Lu,"__esModule",{value:!0}),Lu.RepeatableWidgets=Lu.RepeatableWidgetsLegacy=void 0;const t=(0,G.__importStar)(ne),n=ps(),r=ia(),i=s=>t.array((0,n.GroupItemLegacy)(s));Lu.RepeatableWidgetsLegacy=i;const o=t.tuple([t.string,t.union([r.NestableContent,n.GroupContent])]),a=t.strict({__TYPE__:t.literal(n.GroupItemContentType),value:t.array(o)});return Lu.RepeatableWidgets=t.array(a),Lu}var CL;function bv(){return CL||(CL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.migrateCompositeSlice=e.traverseCompositeSliceContent=e.compositeSliceContentWithDefaultValues=e.CompositeSliceContent=e.CompositeSliceLegacy=e.isCompositeSliceContent=e.CompositeSliceContentType=void 0;const t=G,n=ut,r=cn,i=Ye,o=(0,t.__importStar)(ne),a=dr,s=Ot(),u=ps(),l=ia(),c=H1(),f=aQ();e.CompositeSliceContentType="CompositeSliceContent";const p=_=>(0,s.hasContentType)(_)&&_.__TYPE__===e.CompositeSliceContentType;e.isCompositeSliceContent=p;const h=o.exact(o.partial({repeat:o.array(o.unknown),"non-repeat":o.UnknownRecord})),A=_=>new o.Type("CompositeSliceLegacy",e.isCompositeSliceContent,b=>(0,i.pipe)(h.decode(b),n.either.map(v=>{const S=(()=>{const T=(0,a.getFieldCtx)("repeat",_),E=(0,f.RepeatableWidgetsLegacy)(T).decode(v.repeat);if(!(!E||(0,r.isLeft)(E)))return E.right})()||[];return{nonRepeat:Object.entries(v["non-repeat"]||{}).reduce((T,[E,R])=>{const O=(0,a.getFieldCtx)(E,_,["non-repeat"]);if(!O)return T;const $=(0,l.NestableLegacy)(O).decode(R);return!$||(0,r.isLeft)($)?T:{...T,[E]:$.right}},{}),repeat:S,__TYPE__:e.CompositeSliceContentType}})),b=>{const v=Object.entries(b.nonRepeat).reduce((w,[T,E])=>{const R=(0,a.getFieldCtx)(T,_,["non-repeat"]),O=(0,l.NestableLegacy)(R).encode(E);return O?{content:{...w.content,[T]:O.content},types:{...w.types,...O.types}}:w},{content:{},types:{}}),S=(()=>{const w=(0,a.getFieldCtx)("repeat",_);return(0,f.RepeatableWidgetsLegacy)(w).encode(b.repeat)})()||[];return{content:{"non-repeat":v.content,repeat:S.map(w=>w.content)},types:{[_.keyOfType]:"Slice",...v.types,...S.reduce((w,T)=>({...w,...T.types}),{})}}});e.CompositeSliceLegacy=A,e.CompositeSliceContent=o.strict({__TYPE__:o.literal(e.CompositeSliceContentType),nonRepeat:o.record(o.string,l.NestableContent),repeat:f.RepeatableWidgets});function g(_,b){var v,S;const w=(0,c.withDefaultNestableContentValues)((v=_["non-repeat"])!==null&&v!==void 0?v:{},b.nonRepeat),T=(0,c.repeatableContentWithDefaultNestableContentValues)((S=_.repeat)!==null&&S!==void 0?S:{},b.repeat);return{...b,nonRepeat:w,repeat:T}}e.compositeSliceContentWithDefaultValues=g;function y({path:_,sliceKey:b,sliceName:v,model:S,content:w}){return(T,E)=>{const R=Object.entries(w.widget.nonRepeat).reduce(($,[B,K])=>{const H=(()=>{var N,Y,ee;return(S==null?void 0:S.type)==="SharedSlice"?(Y=(N=S==null?void 0:S.fields)===null||N===void 0?void 0:N.primary)===null||Y===void 0?void 0:Y[B]:(ee=S==null?void 0:S["non-repeat"])===null||ee===void 0?void 0:ee[B]})(),z=T({path:_.concat([{key:"non-repeat",type:"primary"},{key:B,type:"Widget"}]),key:B,apiId:v,model:H,content:K});return z?(0,l.isNestableContent)(z)?{...$,[B]:z}:(console.warn(`Warn: Non nestable content with key [${B}] detected in a composite slice [${v}] with key [${b}]`),$):$},{}),O=(0,u.traverseGroupItemsContent)({path:_.concat([{key:"repeat",type:"items"}]),model:(S==null?void 0:S.type)==="SharedSlice"?S==null?void 0:S.fields.items:S==null?void 0:S.repeat,content:w.widget.repeat})(T);return E({key:b,apiId:v,path:_,model:S,content:{...w,widget:{__TYPE__:"CompositeSliceContent",repeat:O,nonRepeat:R}}})}}e.traverseCompositeSliceContent=y;function C(_,b){const[,v]=b.key.split("$");return{key:`${_.sliceName}$${v}`,name:_.sliceName,maybeLabel:b.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:_.variationId,primary:Object.entries(b.widget.nonRepeat).reduce((S,[w,T])=>{var E;return!((E=_.fields.primary)===null||E===void 0)&&E[w]?{...S,[w]:T}:(console.warn(`The widget ${w} in the non-repeat zone of the composite slice [${_.sliceName}] with key [${b.key}] doesn't exist in the model.`),S)},{}),items:b.widget.repeat.map(S=>({__TYPE__:"GroupItemContent",value:S.value.reduce((w,[T,E])=>{var R;return!((R=_.fields.items)===null||R===void 0)&&R[T]?w.concat([[T,E]]):(console.warn(`The widget ${T} in the repeat zone of the composite slice [${_.sliceName}] with key [${b.key}] doesn't exist in the model.`),w)},[])}),[])}}}e.migrateCompositeSlice=C}(_S)),_S}var xS={},la={},SL;function sQ(){if(SL)return la;SL=1,Object.defineProperty(la,"__esModule",{value:!0}),la.isSlicePrimaryContent=la.SlicePrimaryLegacy=la.SlicePrimaryContent=void 0;const t=(0,G.__importStar)(ne),n=he,r=ps(),i=ia();la.SlicePrimaryContent=t.union([i.NestableContent,r.GroupContent]);const o=s=>{const u=(0,r.GroupLegacy)(s),l=(0,i.NestableLegacy)(s);return{decode(c){return s.fieldType===n.GroupFieldType?u.decode(c):l.decode(c)},encode(c){return(0,r.isGroupContent)(c)?u.encode(c):l.encode(c)}}};la.SlicePrimaryLegacy=o;const a=s=>(0,i.isNestableContent)(s)||(0,r.isGroupContent)(s);return la.isSlicePrimaryContent=a,la}var wL;function Cv(){return wL||(wL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.traverseSharedSliceContent=e.sharedSliceContentWithDefaultValues=e.SharedSliceContent=e.SharedSliceLegacy=e.isSharedSliceContent=e.SharedSliceContentType=void 0;const t=G,n=ut,r=cn,i=Ye,o=(0,t.__importStar)(ne),a=w1,s=he,u=dr,l=Ot(),c=ps(),f=ia(),p=H1(),h=aQ(),A=sQ();e.SharedSliceContentType="SharedSliceContent";const g=v=>(0,l.hasContentType)(v)&&v.__TYPE__===e.SharedSliceContentType;e.isSharedSliceContent=g;const y=o.exact(o.type({variation:o.string,items:(0,a.withFallback)(o.array(o.unknown),[]),primary:(0,a.withFallback)(o.UnknownRecord,{})})),C=v=>new o.Type("SharedSliceLegacy",e.isSharedSliceContent,S=>(0,i.pipe)(y.decode(S),n.either.map(w=>{const T=(()=>{const R=(0,u.getFieldCtx)("items",v,["variations",w.variation]),O=(0,h.RepeatableWidgetsLegacy)(R).decode(w.items);if(!(!O||(0,r.isLeft)(O)))return O.right})()||[],E=Object.entries(w.primary).reduce((R,[O,$])=>{const B=(0,u.getFieldCtx)(O,v,["variations",w.variation,"primary"]),K=(0,A.SlicePrimaryLegacy)(B).decode($);return!K||(0,r.isLeft)(K)?R:{...R,[O]:K.right}},{});return{variation:w.variation,primary:E,items:T,__TYPE__:e.SharedSliceContentType}})),S=>{const w=Object.entries(S.primary).reduce((E,[R,O])=>{const $=(0,u.getFieldCtx)(R,v,["variations",S.variation,"primary"]),B=(0,A.SlicePrimaryLegacy)($).encode(O);return B?{content:{...E.content,[R]:B.content},types:{...E.types,...B.types}}:E},{content:{},types:{}}),T=(()=>{const E=(0,u.getFieldCtx)("items",v,["variations",S.variation]);return(0,h.RepeatableWidgetsLegacy)(E).encode(S.items)})()||[];return{content:{primary:w.content,items:T.map(E=>E.content),variation:S.variation},types:{[v.keyOfType]:"SharedSlice",...w.types,...T.reduce((E,R)=>({...E,...R.types}),{})}}});e.SharedSliceLegacy=C,e.SharedSliceContent=o.strict({__TYPE__:o.literal(e.SharedSliceContentType),variation:o.string,primary:o.record(o.string,A.SlicePrimaryContent),items:h.RepeatableWidgets});function _(v,S){var w,T;const E=v.variations.find(K=>K.id===S.variation),R=(w=E==null?void 0:E.primary)!==null&&w!==void 0?w:{},O=(T=E==null?void 0:E.items)!==null&&T!==void 0?T:{},$=(0,p.withDefaultSlicePrimaryContentValues)(R,S.primary),B=(0,p.repeatableContentWithDefaultNestableContentValues)(O,S.items);return{...S,primary:$,items:B}}e.sharedSliceContentWithDefaultValues=_;function b({path:v,sliceKey:S,sliceName:w,model:T,content:E}){return(R,O)=>{const $=Object.entries(E.widget.primary).reduce((K,[H,z])=>{var N,Y;const ee=(Y=(N=T==null?void 0:T.fields)===null||N===void 0?void 0:N.primary)===null||Y===void 0?void 0:Y[H],F=(()=>(0,c.isGroupContent)(z)?(0,c.traverseGroupContent)({path:v.concat([{key:"primary",type:"primary"},{key:H,type:"Widget"}]),key:H,apiId:H,content:z,model:(ee==null?void 0:ee.type)===s.GroupFieldType?ee:void 0})(R):(0,f.isRepeatableContent)(z)?(0,f.traverseRepeatableContent)({path:v.concat([{key:"primary",type:"primary"},{key:H,type:"Widget"}]),key:H,apiId:H,content:z,model:(ee==null?void 0:ee.type)==="Link"?ee:void 0})(R):(0,f.isTableContent)(z)?(0,f.traverseTableContent)({path:v.concat([{key:"primary",type:"primary"},{key:H,type:"Widget"}]),key:H,apiId:H,content:z,model:(ee==null?void 0:ee.type)==="Table"?ee:void 0})(R):(0,f.isNestableContent)(z)?R({path:v.concat([{key:"primary",type:"primary"},{key:H,type:"Widget"}]),key:H,apiId:H,model:ee,content:z}):void 0)();return F?((0,A.isSlicePrimaryContent)(F)||console.warn(`Warn: Non nestable or group content with key [${H}] detected in a shared slice [${w}] with key [${S}]`),{...K,[H]:F}):K},{}),B=(0,c.traverseGroupItemsContent)({path:v.concat([{key:"items",type:"items"}]),model:T==null?void 0:T.fields.items,content:E.widget.items})(R);return O({key:S,apiId:w,path:v,model:T,content:{...E,widget:{__TYPE__:"SharedSliceContent",variation:E.widget.variation,primary:$,items:B}}})}}e.traverseSharedSliceContent=b}(xS)),xS}var zr={},_L;function Sv(){if(_L)return zr;_L=1,Object.defineProperty(zr,"__esModule",{value:!0}),zr.migrateSimpleSlice=zr.traverseSimpleSliceContent=zr.SimpleSliceLegacy=zr.isSimpleSliceContent=zr.SimpleSliceContent=void 0;const t=(0,G.__importStar)(ne),n=ps(),r=ia();zr.SimpleSliceContent=t.union([r.NestableContent,n.GroupContent]);const i=u=>(0,r.isNestableContent)(u)||(0,n.isGroupContent)(u);zr.isSimpleSliceContent=i;const o=u=>({decode:(()=>u.fieldType==="Group"?(0,n.GroupLegacy)(u).decode.bind(null):(0,r.NestableLegacy)(u).decode.bind(null))(),encode:l=>{switch(l.__TYPE__){case"GroupContentType":return(0,n.GroupLegacy)(u).encode(l);default:return(0,r.NestableLegacy)(u).encode(l)}}});zr.SimpleSliceLegacy=o;function a({path:u,sliceKey:l,sliceName:c,model:f,content:p}){return(h,A)=>{if((0,n.isGroupContent)(p.widget)){const y=(0,n.traverseGroupContent)({path:u,key:p.key,apiId:p.name,model:(()=>{if((f==null?void 0:f.type)==="Group")return f;if((f==null?void 0:f.type)==="SharedSlice")return{type:"Group",config:{fields:f.fields.items||{}}}})(),content:p.widget})(h);return y&&A({key:p.key,apiId:p.name,path:u,model:f,content:{...p,widget:y}})}const g=h({key:p.key,apiId:p.name,path:u,model:(()=>{var y;if((f==null?void 0:f.type)==="SharedSlice")return(y=f.fields.primary)===null||y===void 0?void 0:y[p.name];if((f==null?void 0:f.type)!=="Group")return f})(),content:p.widget});return g&&A({key:l,apiId:c,path:u,model:f,content:{...p,widget:g}})}}zr.traverseSimpleSliceContent=a;function s(u,l){var c;const[,f]=l.key.split("$"),p=`${u.sliceName}$${f}`;return l.widget.__TYPE__==="GroupContentType"?{key:p,name:u.sliceName,maybeLabel:l.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:u.variationId,primary:{},items:l.widget.value.map(h=>({__TYPE__:"GroupItemContent",value:h.value.reduce((A,[g,y])=>{var C;return!((C=u.fields.items)===null||C===void 0)&&C[g]?A.concat([[g,y]]):A},[])}),[])}}:{key:p,name:u.sliceName,maybeLabel:l.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:u.variationId,primary:!((c=u.fields.primary)===null||c===void 0)&&c[l.name]?{[l.name]:l.widget}:{},items:[]}}}return zr.migrateSimpleSlice=s,zr}var xL;function uQ(){return xL||(xL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SliceContent=e.SliceLegacy=void 0;const t=G,n=(0,t.__importStar)(ne),r=bv(),i=Cv(),o=Sv(),a=s=>({decode:u=>(()=>{switch(s.fieldType){case"Slice":return(0,r.CompositeSliceLegacy)(s);case"SharedSlice":return(0,i.SharedSliceLegacy)(s);default:return(0,o.SimpleSliceLegacy)(s)}})().decode(u),encode:u=>{switch(u.__TYPE__){case"SharedSliceContent":return(0,i.SharedSliceLegacy)(s).encode(u);case"CompositeSliceContent":return(0,r.CompositeSliceLegacy)(s).encode(u);default:return(0,o.SimpleSliceLegacy)(s).encode(u)}}});e.SliceLegacy=a,e.SliceContent=n.union([r.CompositeSliceContent,i.SharedSliceContent,o.SimpleSliceContent]),(0,t.__exportStar)(bv(),e),(0,t.__exportStar)(Cv(),e),(0,t.__exportStar)(Sv(),e),(0,t.__exportStar)(sQ(),e)}(wS)),wS}var xn={},TL;function lQ(){if(TL)return xn;TL=1,Object.defineProperty(xn,"__esModule",{value:!0}),xn.migrateSliceItem=xn.SlicesItemLegacy=xn.sliceItemContentWithDefaultValues=xn.isSimpleSliceItemContent=xn.isCompositeSliceItemContent=xn.isSharedSliceItemContent=xn.SliceItemContent=void 0;const e=G,t=ut,n=cn,r=Ye,i=(0,e.__importStar)(ne),o=nt,a=dr,s=ps(),u=ia(),l=H1(),c=uQ(),f=bv(),p=Cv(),h=Sv();xn.SliceItemContent=i.type({key:i.string,name:i.string,maybeLabel:i.union([i.string,i.undefined]),widget:c.SliceContent});function A(S){return(0,p.isSharedSliceContent)(S.widget)}xn.isSharedSliceItemContent=A;function g(S){return(0,f.isCompositeSliceContent)(S.widget)}xn.isCompositeSliceItemContent=g;function y(S){return(0,s.isGroupContent)(S.widget)||(0,u.isNestableContent)(S.widget)}xn.isSimpleSliceItemContent=y;function C(S,w){var T;if(S.type==="SharedSlice"&&(0,p.isSharedSliceContent)(w))return(0,c.sharedSliceContentWithDefaultValues)(S,w);if(S.type==="Slice"&&(0,f.isCompositeSliceContent)(w))return(0,c.compositeSliceContentWithDefaultValues)(S,w);if(S.type==="Group"&&(0,s.isGroupContent)(w)&&(!((T=S.config)===null||T===void 0)&&T.fields)){const E=(0,l.repeatableContentWithDefaultNestableContentValues)(S.config.fields,w.value);return{...w,value:E}}return w}xn.sliceItemContentWithDefaultValues=C;const _=i.exact(i.intersection([i.type({key:i.string,value:i.unknown}),i.partial({label:(0,o.nullable)(i.string)})])),b=S=>new i.Type("SlicesItemLegacy",w=>((0,p.isSharedSliceContent)(w.widget),(0,f.isCompositeSliceContent)(w.widget),(0,h.isSimpleSliceContent)(w.widget)),(w,T)=>(0,r.pipe)(_.decode(w),t.either.chain(E=>{var R;const O=E.key.indexOf("$"),$=E.key.substring(0,O>0?O:void 0),B=(0,a.getFieldCtx)($,S),K=(0,c.SliceLegacy)(B).decode(E.value);return!K||(0,n.isLeft)(K)?i.failure(w,T):i.success({key:E.key,name:$,maybeLabel:(R=E.label)!==null&&R!==void 0?R:void 0,widget:K.right})})),w=>{const T=(0,a.getFieldCtx)(w.name,S),E=(0,c.SliceLegacy)(T).encode(w.widget);return{content:{key:w.key,label:w.maybeLabel,value:(E==null?void 0:E.content)||{}},types:(E==null?void 0:E.types)||{}}});xn.SlicesItemLegacy=b;const v=({model:S,content:w})=>g(w)&&(S==null?void 0:S.type)==="SharedSlice"?(0,f.migrateCompositeSlice)(S,w):y(w)&&(S==null?void 0:S.type)==="SharedSlice"?(0,h.migrateSimpleSlice)(S,w):w;return xn.migrateSliceItem=v,xn}var TS={},IL;function KFe(){return IL||(IL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.traverseSlices=e.slicesContentWithDefaultValues=e.SlicesContent=e.SlicesLegacy=e.isSlicesContent=e.SlicesContentType=void 0;const t=G,n=ut,r=Ye,i=(0,t.__importStar)(ne),o=jm,a=he,s=Ot(),u=bv(),l=Cv(),c=Sv(),f=lQ();e.SlicesContentType="SliceContentType";const p=C=>(0,s.hasContentType)(C)&&C.__TYPE__===e.SlicesContentType;e.isSlicesContent=p;const h=C=>{const _=i.array((0,f.SlicesItemLegacy)(C));return new i.Type("SlicesLegacy",e.isSlicesContent,b=>(0,r.pipe)(_.decode(b),n.either.map(v=>({__TYPE__:e.SlicesContentType,value:v}))),b=>{const v=_.encode(b.value);return{content:v.map(S=>S.content),types:v.reduce((S,w)=>({...S,...w.types}),{[C.keyOfType]:"Slices"})}})};e.SlicesLegacy=h,e.SlicesContent=i.type({__TYPE__:i.literal(e.SlicesContentType),value:i.array(f.SliceItemContent)});function A(C,_){var b;const v=(b=C==null?void 0:C.config)===null||b===void 0?void 0:b.choices;if(v===void 0)return _;const S=_.value.map(w=>{const T=v[w.name];if(T){const E=(0,f.sliceItemContentWithDefaultValues)(T,w.widget);return{...w,widget:E}}return w});return{..._,value:S}}e.slicesContentWithDefaultValues=A;function g(C,_,b){var v,S;const w=(S=(v=_==null?void 0:_.config)===null||v===void 0?void 0:v.choices)===null||S===void 0?void 0:S[b.name],T=()=>{if((0,f.isSharedSliceItemContent)(b)&&w&&(0,a.isStaticSharedSlice)(w)){const O=w.variations.find($=>$.id===b.widget.variation);return O?{type:"SharedSlice",sliceName:w.id,variationId:O.id,fields:{primary:O.primary||{},items:O.items||{}}}:void 0}},E=()=>{var O;const $=o.ContentPath.append(o.ContentPath.serialize(C),b.name),B=Object.values(((O=_==null?void 0:_.config)===null||O===void 0?void 0:O.choices)||{}).find(H=>{var z;return(0,a.isStaticSharedSlice)(H)?!!(!((z=H.legacyPaths)===null||z===void 0)&&z[$]):!1});if(!B)return;const K=B==null?void 0:B.variations.find(H=>{var z;return H.id===((z=B.legacyPaths)===null||z===void 0?void 0:z[$])});if(K)return{type:"SharedSlice",sliceName:B.id,variationId:K.id,fields:{primary:K.primary||{},items:K.items||{}}}},R=()=>{if(w){if((0,a.isCompositeSlice)(w))return{type:"Slice","non-repeat":w["non-repeat"]||{},repeat:w.repeat||{}};if((0,a.isLegacySlice)(w))return w}};return T()||E()||R()}function y({path:C,key:_,model:b,content:v}){return({transformWidget:S=({content:T})=>T,transformSlice:w=({content:T})=>T})=>{const T=v.value.reduce((E,R)=>{const O=b&&g(C,b,R),$=(()=>{if((0,f.isSharedSliceItemContent)(R))return(0,l.traverseSharedSliceContent)({path:C.concat({key:R.key,type:"SharedSlice"}),sliceKey:R.key,sliceName:R.name,model:(O==null?void 0:O.type)==="SharedSlice"?O:void 0,content:R})(S,w);if((0,f.isCompositeSliceItemContent)(R))return(0,u.traverseCompositeSliceContent)({path:C.concat({key:R.key,type:"Slice"}),sliceKey:R.key,sliceName:R.name,model:(O==null?void 0:O.type)==="Slice"||(O==null?void 0:O.type)==="SharedSlice"?O:void 0,content:R})(S,w);if((0,f.isSimpleSliceItemContent)(R))return(0,c.traverseSimpleSliceContent)({path:C.concat({key:R.key,type:"LegacySlice"}),sliceKey:R.key,sliceName:R.name,model:O&&(O==null?void 0:O.type)!=="Slice"?O:void 0,content:R})(S,w)})();return $?E.concat($):E},[]);return S({path:C,key:_,apiId:_,model:b,content:{__TYPE__:v.__TYPE__,value:T}})}}e.traverseSlices=y}(TS)),TS}var EL;function cQ(){return EL||(EL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(uQ(),e),(0,t.__exportStar)(lQ(),e),(0,t.__exportStar)(KFe(),e)}(SS)),SS}var IS={},RL;function dQ(){return RL||(RL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UIDContent=e.UIDLegacy=e.isUIDContent=e.UIDContentType=void 0;const t=G,n=ut,r=Ye,i=(0,t.__importStar)(ne),o=Ot();e.UIDContentType="UIDContent";const a=u=>(0,o.hasContentType)(u)&&u.__TYPE__===e.UIDContentType;e.isUIDContent=a;const s=u=>new i.Type("UIDLegacy",e.isUIDContent,l=>(0,r.pipe)(i.string.decode(l),n.either.map(c=>e.UIDContent.encode({value:c,__TYPE__:e.UIDContentType}))),l=>({content:l.value,types:{[u.keyOfType]:"UID"}}));e.UIDLegacy=s,e.UIDContent=i.type({__TYPE__:i.literal(e.UIDContentType),value:i.string})}(IS)),IS}var ca={},$L;function qFe(){if($L)return ca;$L=1,Object.defineProperty(ca,"__esModule",{value:!0}),ca.WidgetLegacy=ca.isWidgetContent=ca.WidgetContent=void 0;const t=(0,G.__importStar)(ne),n=ps(),r=ia(),i=cQ(),o=dQ();ca.WidgetContent=t.union([n.GroupContent,r.NestableContent,o.UIDContent,i.SlicesContent]);const a=u=>(0,n.isGroupContent)(u)||(0,r.isNestableContent)(u)||(0,o.isUIDContent)(u)||(0,i.isSlicesContent)(u);ca.isWidgetContent=a;const s=u=>({decode(l){if(!u.fieldType)return;const c=(()=>{switch(u.fieldType){case"UID":return(0,o.UIDLegacy)(u);case"Group":return(0,n.GroupLegacy)(u);case"Choice":case"Slices":return(0,i.SlicesLegacy)(u);default:return(0,r.NestableLegacy)(u)}})();if(c)return c.decode(l)},encode(l){switch(l.__TYPE__){case o.UIDContentType:return(0,o.UIDLegacy)(u).encode(l);case n.GroupContentType:return(0,n.GroupLegacy)(u).encode(l);case i.SlicesContentType:return(0,i.SlicesLegacy)(u).encode(l);default:return(0,r.NestableLegacy)(u).encode(l)}}});return ca.WidgetLegacy=s,ca}var kL;function DM(){return kL||(kL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(qz(),e),(0,t.__exportStar)(ps(),e),(0,t.__exportStar)(ia(),e),(0,t.__exportStar)(cQ(),e),(0,t.__exportStar)(dQ(),e),(0,t.__exportStar)(qFe(),e)}(HC)),HC}Object.defineProperty(Ir,"__esModule",{value:!0});Ir.migrateDocument=Ir.collectWidgets=Ir.traverseDocument=Ir.fillDocumentWithDefaultValues=Ir.DocumentLegacy=Ir.Document=void 0;const VFe=G,fQ=ut,UM=cn,pQ=Ye,wd=(0,VFe.__importStar)(ne),hQ=jm,BM=_c,_d=he,Gr=DM(),Vw=dr;Ir.Document=wd.record(BM.WidgetKey,Gr.WidgetContent);const zFe=wd.record(BM.WidgetKey,wd.unknown),PM=e=>new wd.Type("Document",t=>!!t&&typeof t=="object",t=>(0,pQ.pipe)(zFe.decode(t),fQ.either.map(n=>Object.entries(n).reduce((r,[i,o])=>{const a=(0,Vw.defaultCtx)(i,e),s=(0,Gr.WidgetLegacy)(a).decode(o);return!s||(0,UM.isLeft)(s)?r:{...r,[i]:s.right}},{}))),t=>Object.entries(t).reduce((n,[r,i])=>{const o=(0,Vw.defaultCtx)(r,e),a=(0,Gr.WidgetLegacy)(o).encode(i);return a?{content:{...n.content,[r]:a.content},types:{...n.types,...a.types}}:n},{content:{},types:{}}));function AQ(e){const t=Object.entries(e),{types:n,widgets:r}=t.reduce((a,[s,u])=>{if(s.endsWith("_TYPE")){const l=Vw.FieldOrSliceType.decode(u);if((0,UM.isRight)(l))return{...a,types:a.types.set(s.substring(0,s.length-5),l.right)}}return!s.endsWith("_POSITION")&&!s.endsWith("_TYPE")?{...a,widgets:{...a.widgets,[s]:u}}:a},{types:new Map,widgets:{}}),i=e.slugs_INTERNAL||[],o=e.uid;return{widgets:r,types:n,uid:o,slugs:i}}function QFe(e,t){const n=(0,pQ.pipe)(wd.record(BM.WidgetKey,wd.unknown).decode(e),fQ.either.chain(r=>{const{types:i,widgets:o}=AQ(r);return PM(i).decode(o)}));return(0,UM.isLeft)(n)?void 0:mQ(n.right,t)}function HFe(e){const t=PM().encode(e);return{...t.content,...t.types}}Ir.DocumentLegacy={_codec:PM,extractMetadata:AQ,parse:QFe,encode:HFe};function WM(e){return{customTypeId:e==null?void 0:e.id,fields:Object.fromEntries((0,_d.flattenSections)(e))}}function YFe(e,t){const{fields:n}=e&&_d.StaticCustomType.is(e)?WM(e):e;return Object.entries(n).reduce((r,[i,o])=>{const a=t[i],s=(()=>{switch(o.type){case"Group":return(0,Gr.isGroupContent)(a)?(0,Gr.groupContentWithDefaultValues)(o,a):a;case"Choice":case"Slices":return(0,Gr.isSlicesContent)(a)?(0,Gr.slicesContentWithDefaultValues)(o,a):a;default:return a===void 0&&_d.NestableWidget.is(o)?(0,Gr.NestableContentDefaultValue)(o):a}})();return s?{...r,[i]:s}:r},t)}Ir.fillDocumentWithDefaultValues=YFe;function NM({document:e,customType:t}){const n=t&&_d.StaticCustomType.is(t)?WM(t):t;return({transformWidget:r=({content:o})=>o,transformSlice:i=({content:o})=>o})=>{const o=n&&Object.entries(n.fields).reduce((a,[s,u])=>({...a,[s]:u}),{});return Object.entries(e).reduce((a,[s,u])=>{const l=o&&o[s],c=hQ.ContentPath.make([{key:n==null?void 0:n.customTypeId,type:"CustomType"},{key:s,type:"Widget"}]),f=(()=>{switch(u.__TYPE__){case"SliceContentType":return(0,Gr.traverseSlices)({path:c,key:s,model:(l==null?void 0:l.type)==="Slices"||(l==null?void 0:l.type)==="Choice"?l:void 0,content:u})({transformWidget:r,transformSlice:i});case"GroupContentType":return(0,Gr.traverseGroupContent)({path:c,key:s,apiId:s,model:(l==null?void 0:l.type)==="Group"?l:void 0,content:u})(r);case"RepeatableContent":return(0,Gr.traverseRepeatableContent)({path:c,key:s,apiId:s,model:(l==null?void 0:l.type)==="Link"?l:void 0,content:u})(r);case"TableContent":return(0,Gr.traverseTableContent)({path:c,key:s,apiId:s,model:(l==null?void 0:l.type)==="Table"?l:void 0,content:u})(r);default:return r({path:c,key:s,apiId:s,model:(l==null?void 0:l.type)!=="Group"&&(l==null?void 0:l.type)!=="Slices"&&(l==null?void 0:l.type)!=="Choice"?l:void 0,content:u})}})();return{...a,...f?{[s]:f}:{}}},{})}}Ir.traverseDocument=NM;function GFe(e,t){const n={};return NM({document:e})({transformWidget:({content:r,path:i})=>{const o=hQ.ContentPath.serialize(i);return t(r,i)&&(n[o]=r),r}}),n}Ir.collectWidgets=GFe;function mQ(e,t){const n=_d.StaticCustomType.is(t)?WM(t):t;return Object.values((0,_d.collectSharedSlices)(n)).some(i=>!!i.legacyPaths)?NM({document:e,customType:t})({transformSlice:Gr.migrateSliceItem}):e}Ir.migrateDocument=mQ;(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(Ir,e),(0,t.__exportStar)(DM(),e),(0,t.__exportStar)(dr,e)})(fe);function gQ(e){if(fe.isRepeatableContent(e))return e;if(fe.isLinkContent(e))return{__TYPE__:"RepeatableContent",type:"Link",value:[e]}}function vQ(e){if(fe.isLinkContent(e))return e;if(fe.isRepeatableContent(e)){const[t]=e.value;if(fe.isLinkContent(t))return t}}function JFe(e,t){let n=eje(e,t);return n=ZFe(e,n),n=XFe(e,n),fe.fillDocumentWithDefaultValues(e,n)}function ZFe(e,t){return he.flattenSections(e).reduce((r,[i,o])=>!t[i]&&o.type==="Group"?{...r,[i]:yQ}:r,t)}function XFe(e,t){return fe.traverseDocument({document:t,customType:e})({transformWidget({model:n,content:r}){return n?r:void 0},transformSlice(n){return n.model?n.content:void 0}})}function eje(e,t){return fe.traverseDocument({document:t,customType:e})({transformWidget({model:n,content:r}){if((n==null?void 0:n.type)==="Link"){const{repeat:i}=n.config??{};switch(r.__TYPE__){case"LinkContent":return i?gQ(r)??r:r;case"RepeatableContent":return i?r:vQ(r)??r;default:return r}}return r}})}const yQ={__TYPE__:"GroupContentType",value:[{__TYPE__:"GroupItemContent",value:[]}]},bQ={unclassified:{title:"Draft",color:"amber"},published:{title:"Live",color:"green"},release:{title:"Planned",color:"purple"},archived:{title:"Archived",color:"grey"}},zw={unclassified:["unclassified","published"],archived:["unclassified","published"],release:["release","published"],published:["published","unclassified"]};function KM(e){const{documentId:t,versionId:n,baseUrl:r,status:i,releaseId:o}=e,a={s:i,v:n,r:o},s=ni.createRouteParams({params:a}),u=new URLSearchParams(s).toString();return new URL(`pages/${t}?${u}`,r)}function tje(e){const{children:t,...n}=e;return d.jsx(li.QueryErrorResetBoundary,{children:({reset:r})=>d.jsx(m.ErrorBoundary,{...n,onReset:r,children:t})})}const CQ=I.createContext(void 0),nje={selectedIds:new Set,excludedIds:new Set,isAllSelected:!1};function SQ(e){const{children:t,initialState:n,initialTotalItemCount:r,isSelectAllEnabled:i=!1}=e,o=I.useRef(),a=I.useRef(r||0);function s(){if(n&&n.selectedIds){const T=[...n.selectedIds].pop();T&&(o.current=T)}return{...nje,...n}}const[u,l]=I.useState(s),c=I.useMemo(()=>{const{selectedIds:T,excludedIds:E,isAllSelected:R}=u;return R?a.current-E.size:T.size},[u]),f=I.useCallback(T=>{const{isAllSelected:E,selectedIds:R,excludedIds:O}=u;return E?!O.has(T):R.has(T)},[u]),p=I.useCallback(()=>{const{isAllSelected:T,selectedIds:E,excludedIds:R}=u;return{selectedIds:[...E],excludedIds:[...R],isAllSelected:T,selectedCount:c}},[u,c]),h=ze.useStableCallback(()=>{i&&l({isAllSelected:!0,selectedIds:new Set,excludedIds:new Set})}),A=ze.useStableCallback(()=>{l({isAllSelected:!1,selectedIds:new Set,excludedIds:new Set})});I.useEffect(()=>{const{isAllSelected:T,selectedIds:E,excludedIds:R}=u,O=a.current;if(!(O===0||!i)){if(T&&R.size===O){A();return}if(!T&&E.size===O){h();return}}},[u,i,h,A]);const g=ze.useStableCallback(T=>{const{id:E,isSingleSelection:R,metaKey:O,shiftKey:$,ids:B}=T;return $&&B&&B.length>0&&o.current?C(E,B,o.current):R&&!O?y(E):f(E)?v([E]):b([E]),o.current=E,f(E)});function y(T){f(T)&&c===1?l(E=>({...E,selectedIds:new Set})):l({isAllSelected:!1,selectedIds:new Set([T]),excludedIds:new Set})}function C(T,E,R){const O=rje(E,R,T),$=f(T);return $?v(O):b(O),$}const _=ze.useStableCallback(()=>{c>0?A():h()});function b(T){const{isAllSelected:E}=u;if(E){l(R=>({...R,excludedIds:OL(R.excludedIds,T)}));return}l(R=>({...R,selectedIds:ML(R.selectedIds,T)}))}function v(T){const{isAllSelected:E}=u;if(E){l(R=>({...R,excludedIds:ML(R.excludedIds,T)}));return}l(R=>({...R,selectedIds:OL(R.selectedIds,T)}))}function S(T){a.current=T}const w=I.useMemo(()=>({selectedCount:c,state:u,totalItemCount:a.current,isSelected:f,isSelectAllEnabled:i,getSelectionState:p,toggleSelection:g,toggleSelectAll:_,clearSelection:A,setTotalItemCount:S}),[u,A,p,i,f,c,_,g]);return d.jsx(CQ.Provider,{value:w,children:t})}function xu(e){const t=I.useContext(CQ);if(t===void 0)throw new Error("useSelectionManagerContext must be used within a SelectionManagerProvider");const{totalItemCount:n,onChangeSelection:r}=e||{},{setTotalItemCount:i,totalItemCount:o,state:a,getSelectionState:s,...u}=t;n!==void 0&&n!==o&&i(n);const l=ze.useStableCallback(r);return I.useEffect(()=>{l==null||l(s())},[s,l,a]),{...u,getSelectionState:s,isAllSelected:a.isAllSelected}}function rje(e,t,n){const r=e.indexOf(t),i=e.indexOf(n);if(i===-1)throw new Error("targetId must be in the array");return r===-1?[n]:r<=i?e.slice(r,i+1):e.slice(i,r+1)}function OL(e,t){const n=new Set(e);return t.forEach(r=>n.delete(r)),n}function ML(e,t){return new Set([...e,...t])}var Ve;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const a of i)o[a]=a;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),a={};for(const s of o)a[s]=i[s];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=(i,o)=>{for(const a of i)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Ve||(Ve={}));var Qw;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Qw||(Qw={}));const oe=Ve.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_s=e=>{switch(typeof e){case"undefined":return oe.undefined;case"string":return oe.string;case"number":return isNaN(e)?oe.nan:oe.number;case"boolean":return oe.boolean;case"function":return oe.function;case"bigint":return oe.bigint;case"symbol":return oe.symbol;case"object":return Array.isArray(e)?oe.array:e===null?oe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?oe.promise:typeof Map<"u"&&e instanceof Map?oe.map:typeof Set<"u"&&e instanceof Set?oe.set:typeof Date<"u"&&e instanceof Date?oe.date:oe.object;default:return oe.unknown}},J=Ve.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),ije=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class ii extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let s=r,u=0;for(;u<a.path.length;){const l=a.path[u];u===a.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(n(a))):s[l]=s[l]||{_errors:[]},s=s[l],u++}}};return i(this),r}static assert(t){if(!(t instanceof ii))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ve.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}ii.create=e=>new ii(e);const xd=(e,t)=>{let n;switch(e.code){case J.invalid_type:e.received===oe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case J.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ve.jsonStringifyReplacer)}`;break;case J.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ve.joinValues(e.keys,", ")}`;break;case J.invalid_union:n="Invalid input";break;case J.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ve.joinValues(e.options)}`;break;case J.invalid_enum_value:n=`Invalid enum value. Expected ${Ve.joinValues(e.options)}, received '${e.received}'`;break;case J.invalid_arguments:n="Invalid function arguments";break;case J.invalid_return_type:n="Invalid function return type";break;case J.invalid_date:n="Invalid date";break;case J.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ve.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case J.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case J.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case J.custom:n="Invalid input";break;case J.invalid_intersection_types:n="Intersection results could not be merged";break;case J.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case J.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ve.assertNever(e)}return{message:n}};let wQ=xd;function oje(e){wQ=e}function wv(){return wQ}const _v=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let s="";const u=r.filter(l=>!!l).slice().reverse();for(const l of u)s=l(a,{data:t,defaultError:s}).message;return{...i,path:o,message:s}},aje=[];function ie(e,t){const n=wv(),r=_v({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===xd?void 0:xd].filter(i=>!!i)});e.common.issues.push(r)}class Zn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return Ee;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n){const o=await i.key,a=await i.value;r.push({key:o,value:a})}return Zn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return Ee;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}}const Ee=Object.freeze({status:"aborted"}),ed=e=>({status:"dirty",value:e}),Ar=e=>({status:"valid",value:e}),Hw=e=>e.status==="aborted",Yw=e=>e.status==="dirty",vh=e=>e.status==="valid",yh=e=>typeof Promise<"u"&&e instanceof Promise;function xv(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}function _Q(e,t,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,n):i?i.value=n:t.set(e,n),n}var Ae;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ae||(Ae={}));var Ip,Ep;class jo{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const FL=(e,t)=>{if(vh(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new ii(e.common.issues);return this._error=n,this._error}}};function Le(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,s)=>{var u,l;const{message:c}=e;return a.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:(u=c??r)!==null&&u!==void 0?u:s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:(l=c??n)!==null&&l!==void 0?l:s.defaultError}},description:i}}class Pe{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return _s(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:_s(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Zn,ctx:{common:t.parent.common,data:t.data,parsedType:_s(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(yh(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_s(t)},o=this._parseSync({data:t,path:i.path,parent:i});return FL(i,o)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_s(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(yh(i)?i:Promise.resolve(i));return FL(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const a=t(i),s=()=>o.addIssue({code:J.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(u=>u?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new Xi({schema:this,typeName:Te.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Io.create(this,this._def)}nullable(){return qs.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Hi.create(this,this._def)}promise(){return Id.create(this,this._def)}or(t){return wh.create([this,t],this._def)}and(t){return _h.create(this,t,this._def)}transform(t){return new Xi({...Le(this._def),schema:this,typeName:Te.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Rh({...Le(this._def),innerType:this,defaultValue:n,typeName:Te.ZodDefault})}brand(){return new qM({typeName:Te.ZodBranded,type:this,...Le(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new $h({...Le(this._def),innerType:this,catchValue:n,typeName:Te.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return qm.create(this,t)}readonly(){return kh.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const sje=/^c[^\s-]{8,}$/i,uje=/^[0-9a-z]+$/,lje=/^[0-9A-HJKMNP-TV-Z]{26}$/,cje=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,dje=/^[a-z0-9_-]{21}$/i,fje=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,pje=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,hje="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ES;const Aje=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,mje=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,gje=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,xQ="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",vje=new RegExp(`^${xQ}$`);function TQ(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function yje(e){return new RegExp(`^${TQ(e)}$`)}function IQ(e){let t=`${xQ}T${TQ(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function bje(e,t){return!!((t==="v4"||!t)&&Aje.test(e)||(t==="v6"||!t)&&mje.test(e))}class zi extends Pe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==oe.string){const o=this._getOrReturnCtx(t);return ie(o,{code:J.invalid_type,expected:oe.string,received:o.parsedType}),Ee}const r=new Zn;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),ie(i,{code:J.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),ie(i,{code:J.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,s=t.data.length<o.value;(a||s)&&(i=this._getOrReturnCtx(t,i),a?ie(i,{code:J.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&ie(i,{code:J.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")pje.test(t.data)||(i=this._getOrReturnCtx(t,i),ie(i,{validation:"email",code:J.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")ES||(ES=new RegExp(hje,"u")),ES.test(t.data)||(i=this._getOrReturnCtx(t,i),ie(i,{validation:"emoji",code:J.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")cje.test(t.data)||(i=this._getOrReturnCtx(t,i),ie(i,{validation:"uuid",code:J.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")dje.test(t.data)||(i=this._getOrReturnCtx(t,i),ie(i,{validation:"nanoid",code:J.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")sje.test(t.data)||(i=this._getOrReturnCtx(t,i),ie(i,{validation:"cuid",code:J.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")uje.test(t.data)||(i=this._getOrReturnCtx(t,i),ie(i,{validation:"cuid2",code:J.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")lje.test(t.data)||(i=this._getOrReturnCtx(t,i),ie(i,{validation:"ulid",code:J.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),ie(i,{validation:"url",code:J.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),ie(i,{validation:"regex",code:J.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),ie(i,{code:J.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),ie(i,{code:J.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),ie(i,{code:J.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?IQ(o).test(t.data)||(i=this._getOrReturnCtx(t,i),ie(i,{code:J.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?vje.test(t.data)||(i=this._getOrReturnCtx(t,i),ie(i,{code:J.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?yje(o).test(t.data)||(i=this._getOrReturnCtx(t,i),ie(i,{code:J.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?fje.test(t.data)||(i=this._getOrReturnCtx(t,i),ie(i,{validation:"duration",code:J.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?bje(t.data,o.version)||(i=this._getOrReturnCtx(t,i),ie(i,{validation:"ip",code:J.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?gje.test(t.data)||(i=this._getOrReturnCtx(t,i),ie(i,{validation:"base64",code:J.invalid_string,message:o.message}),r.dirty()):Ve.assertNever(o);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:J.invalid_string,...Ae.errToObj(r)})}_addCheck(t){return new zi({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ae.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ae.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ae.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ae.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ae.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ae.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ae.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ae.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ae.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ae.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...Ae.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Ae.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Ae.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ae.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Ae.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ae.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ae.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ae.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ae.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ae.errToObj(n)})}nonempty(t){return this.min(1,Ae.errToObj(t))}trim(){return new zi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new zi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new zi({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}zi.create=e=>{var t;return new zi({checks:[],typeName:Te.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Le(e)})};function Cje(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(e.toFixed(i).replace(".","")),a=parseInt(t.toFixed(i).replace(".",""));return o%a/Math.pow(10,i)}class Ws extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==oe.number){const o=this._getOrReturnCtx(t);return ie(o,{code:J.invalid_type,expected:oe.number,received:o.parsedType}),Ee}let r;const i=new Zn;for(const o of this._def.checks)o.kind==="int"?Ve.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ie(r,{code:J.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),ie(r,{code:J.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),ie(r,{code:J.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?Cje(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),ie(r,{code:J.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ie(r,{code:J.not_finite,message:o.message}),i.dirty()):Ve.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ae.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ae.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ae.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ae.toString(n))}setLimit(t,n,r,i){return new Ws({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ae.toString(i)}]})}_addCheck(t){return new Ws({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ae.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ae.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ae.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ae.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ae.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ae.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ae.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ae.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ae.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ve.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Ws.create=e=>new Ws({checks:[],typeName:Te.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Le(e)});class Ns extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==oe.bigint){const o=this._getOrReturnCtx(t);return ie(o,{code:J.invalid_type,expected:oe.bigint,received:o.parsedType}),Ee}let r;const i=new Zn;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),ie(r,{code:J.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),ie(r,{code:J.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ie(r,{code:J.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Ve.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ae.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ae.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ae.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ae.toString(n))}setLimit(t,n,r,i){return new Ns({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ae.toString(i)}]})}_addCheck(t){return new Ns({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ae.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ae.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ae.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ae.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ae.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Ns.create=e=>{var t;return new Ns({checks:[],typeName:Te.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Le(e)})};class bh extends Pe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==oe.boolean){const r=this._getOrReturnCtx(t);return ie(r,{code:J.invalid_type,expected:oe.boolean,received:r.parsedType}),Ee}return Ar(t.data)}}bh.create=e=>new bh({typeName:Te.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Le(e)});class yl extends Pe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==oe.date){const o=this._getOrReturnCtx(t);return ie(o,{code:J.invalid_type,expected:oe.date,received:o.parsedType}),Ee}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return ie(o,{code:J.invalid_date}),Ee}const r=new Zn;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),ie(i,{code:J.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),ie(i,{code:J.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Ve.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new yl({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ae.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ae.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}yl.create=e=>new yl({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Te.ZodDate,...Le(e)});class Tv extends Pe{_parse(t){if(this._getType(t)!==oe.symbol){const r=this._getOrReturnCtx(t);return ie(r,{code:J.invalid_type,expected:oe.symbol,received:r.parsedType}),Ee}return Ar(t.data)}}Tv.create=e=>new Tv({typeName:Te.ZodSymbol,...Le(e)});class Ch extends Pe{_parse(t){if(this._getType(t)!==oe.undefined){const r=this._getOrReturnCtx(t);return ie(r,{code:J.invalid_type,expected:oe.undefined,received:r.parsedType}),Ee}return Ar(t.data)}}Ch.create=e=>new Ch({typeName:Te.ZodUndefined,...Le(e)});class Sh extends Pe{_parse(t){if(this._getType(t)!==oe.null){const r=this._getOrReturnCtx(t);return ie(r,{code:J.invalid_type,expected:oe.null,received:r.parsedType}),Ee}return Ar(t.data)}}Sh.create=e=>new Sh({typeName:Te.ZodNull,...Le(e)});class Td extends Pe{constructor(){super(...arguments),this._any=!0}_parse(t){return Ar(t.data)}}Td.create=e=>new Td({typeName:Te.ZodAny,...Le(e)});class Ju extends Pe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ar(t.data)}}Ju.create=e=>new Ju({typeName:Te.ZodUnknown,...Le(e)});class xa extends Pe{_parse(t){const n=this._getOrReturnCtx(t);return ie(n,{code:J.invalid_type,expected:oe.never,received:n.parsedType}),Ee}}xa.create=e=>new xa({typeName:Te.ZodNever,...Le(e)});class Iv extends Pe{_parse(t){if(this._getType(t)!==oe.undefined){const r=this._getOrReturnCtx(t);return ie(r,{code:J.invalid_type,expected:oe.void,received:r.parsedType}),Ee}return Ar(t.data)}}Iv.create=e=>new Iv({typeName:Te.ZodVoid,...Le(e)});class Hi extends Pe{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==oe.array)return ie(n,{code:J.invalid_type,expected:oe.array,received:n.parsedType}),Ee;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,s=n.data.length<i.exactLength.value;(a||s)&&(ie(n,{code:a?J.too_big:J.too_small,minimum:s?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(ie(n,{code:J.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(ie(n,{code:J.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,s)=>i.type._parseAsync(new jo(n,a,n.path,s)))).then(a=>Zn.mergeArray(r,a));const o=[...n.data].map((a,s)=>i.type._parseSync(new jo(n,a,n.path,s)));return Zn.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new Hi({...this._def,minLength:{value:t,message:Ae.toString(n)}})}max(t,n){return new Hi({...this._def,maxLength:{value:t,message:Ae.toString(n)}})}length(t,n){return new Hi({...this._def,exactLength:{value:t,message:Ae.toString(n)}})}nonempty(t){return this.min(1,t)}}Hi.create=(e,t)=>new Hi({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Te.ZodArray,...Le(t)});function Kc(e){if(e instanceof Et){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Io.create(Kc(r))}return new Et({...e._def,shape:()=>t})}else return e instanceof Hi?new Hi({...e._def,type:Kc(e.element)}):e instanceof Io?Io.create(Kc(e.unwrap())):e instanceof qs?qs.create(Kc(e.unwrap())):e instanceof Lo?Lo.create(e.items.map(t=>Kc(t))):e}class Et extends Pe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Ve.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==oe.object){const l=this._getOrReturnCtx(t);return ie(l,{code:J.invalid_type,expected:oe.object,received:l.parsedType}),Ee}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof xa&&this._def.unknownKeys==="strip"))for(const l in i.data)a.includes(l)||s.push(l);const u=[];for(const l of a){const c=o[l],f=i.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new jo(i,f,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof xa){const l=this._def.unknownKeys;if(l==="passthrough")for(const c of s)u.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(l==="strict")s.length>0&&(ie(i,{code:J.unrecognized_keys,keys:s}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const c of s){const f=i.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new jo(i,f,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const l=[];for(const c of u){const f=await c.key,p=await c.value;l.push({key:f,value:p,alwaysSet:c.alwaysSet})}return l}).then(l=>Zn.mergeObjectSync(r,l)):Zn.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(t){return Ae.errToObj,new Et({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,a,s;const u=(a=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(s=Ae.errToObj(t).message)!==null&&s!==void 0?s:u}:{message:u}}}:{}})}strip(){return new Et({...this._def,unknownKeys:"strip"})}passthrough(){return new Et({...this._def,unknownKeys:"passthrough"})}extend(t){return new Et({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Et({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Te.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Et({...this._def,catchall:t})}pick(t){const n={};return Ve.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Et({...this._def,shape:()=>n})}omit(t){const n={};return Ve.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Et({...this._def,shape:()=>n})}deepPartial(){return Kc(this)}partial(t){const n={};return Ve.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new Et({...this._def,shape:()=>n})}required(t){const n={};return Ve.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Io;)o=o._def.innerType;n[r]=o}}),new Et({...this._def,shape:()=>n})}keyof(){return EQ(Ve.objectKeys(this.shape))}}Et.create=(e,t)=>new Et({shape:()=>e,unknownKeys:"strip",catchall:xa.create(),typeName:Te.ZodObject,...Le(t)});Et.strictCreate=(e,t)=>new Et({shape:()=>e,unknownKeys:"strict",catchall:xa.create(),typeName:Te.ZodObject,...Le(t)});Et.lazycreate=(e,t)=>new Et({shape:e,unknownKeys:"strip",catchall:xa.create(),typeName:Te.ZodObject,...Le(t)});class wh extends Pe{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const s of o)if(s.result.status==="valid")return s.result;for(const s of o)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(s=>new ii(s.ctx.common.issues));return ie(n,{code:J.invalid_union,unionErrors:a}),Ee}if(n.common.async)return Promise.all(r.map(async o=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let o;const a=[];for(const u of r){const l={...n,common:{...n.common,issues:[]},parent:null},c=u._parseSync({data:n.data,path:n.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:l}),l.common.issues.length&&a.push(l.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const s=a.map(u=>new ii(u));return ie(n,{code:J.invalid_union,unionErrors:s}),Ee}}get options(){return this._def.options}}wh.create=(e,t)=>new wh({options:e,typeName:Te.ZodUnion,...Le(t)});const fa=e=>e instanceof Th?fa(e.schema):e instanceof Xi?fa(e.innerType()):e instanceof Ih?[e.value]:e instanceof Ks?e.options:e instanceof Eh?Ve.objectValues(e.enum):e instanceof Rh?fa(e._def.innerType):e instanceof Ch?[void 0]:e instanceof Sh?[null]:e instanceof Io?[void 0,...fa(e.unwrap())]:e instanceof qs?[null,...fa(e.unwrap())]:e instanceof qM||e instanceof kh?fa(e.unwrap()):e instanceof $h?fa(e._def.innerType):[];class Y1 extends Pe{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.object)return ie(n,{code:J.invalid_type,expected:oe.object,received:n.parsedType}),Ee;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(ie(n,{code:J.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Ee)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const a=fa(o.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const s of a){if(i.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);i.set(s,o)}}return new Y1({typeName:Te.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Le(r)})}}function Gw(e,t){const n=_s(e),r=_s(t);if(e===t)return{valid:!0,data:e};if(n===oe.object&&r===oe.object){const i=Ve.objectKeys(t),o=Ve.objectKeys(e).filter(s=>i.indexOf(s)!==-1),a={...e,...t};for(const s of o){const u=Gw(e[s],t[s]);if(!u.valid)return{valid:!1};a[s]=u.data}return{valid:!0,data:a}}else if(n===oe.array&&r===oe.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const a=e[o],s=t[o],u=Gw(a,s);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return n===oe.date&&r===oe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class _h extends Pe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,a)=>{if(Hw(o)||Hw(a))return Ee;const s=Gw(o.value,a.value);return s.valid?((Yw(o)||Yw(a))&&n.dirty(),{status:n.value,value:s.data}):(ie(r,{code:J.invalid_intersection_types}),Ee)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>i(o,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}_h.create=(e,t,n)=>new _h({left:e,right:t,typeName:Te.ZodIntersection,...Le(n)});class Lo extends Pe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.array)return ie(r,{code:J.invalid_type,expected:oe.array,received:r.parsedType}),Ee;if(r.data.length<this._def.items.length)return ie(r,{code:J.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ee;!this._def.rest&&r.data.length>this._def.items.length&&(ie(r,{code:J.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((a,s)=>{const u=this._def.items[s]||this._def.rest;return u?u._parse(new jo(r,a,r.path,s)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>Zn.mergeArray(n,a)):Zn.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new Lo({...this._def,rest:t})}}Lo.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Lo({items:e,typeName:Te.ZodTuple,rest:null,...Le(t)})};class xh extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.object)return ie(r,{code:J.invalid_type,expected:oe.object,received:r.parsedType}),Ee;const i=[],o=this._def.keyType,a=this._def.valueType;for(const s in r.data)i.push({key:o._parse(new jo(r,s,r.path,s)),value:a._parse(new jo(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?Zn.mergeObjectAsync(n,i):Zn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Pe?new xh({keyType:t,valueType:n,typeName:Te.ZodRecord,...Le(r)}):new xh({keyType:zi.create(),valueType:t,typeName:Te.ZodRecord,...Le(n)})}}class Ev extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.map)return ie(r,{code:J.invalid_type,expected:oe.map,received:r.parsedType}),Ee;const i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([s,u],l)=>({key:i._parse(new jo(r,s,r.path,[l,"key"])),value:o._parse(new jo(r,u,r.path,[l,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const u of a){const l=await u.key,c=await u.value;if(l.status==="aborted"||c.status==="aborted")return Ee;(l.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(l.value,c.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const u of a){const l=u.key,c=u.value;if(l.status==="aborted"||c.status==="aborted")return Ee;(l.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(l.value,c.value)}return{status:n.value,value:s}}}}Ev.create=(e,t,n)=>new Ev({valueType:t,keyType:e,typeName:Te.ZodMap,...Le(n)});class bl extends Pe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.set)return ie(r,{code:J.invalid_type,expected:oe.set,received:r.parsedType}),Ee;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(ie(r,{code:J.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(ie(r,{code:J.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function a(u){const l=new Set;for(const c of u){if(c.status==="aborted")return Ee;c.status==="dirty"&&n.dirty(),l.add(c.value)}return{status:n.value,value:l}}const s=[...r.data.values()].map((u,l)=>o._parse(new jo(r,u,r.path,l)));return r.common.async?Promise.all(s).then(u=>a(u)):a(s)}min(t,n){return new bl({...this._def,minSize:{value:t,message:Ae.toString(n)}})}max(t,n){return new bl({...this._def,maxSize:{value:t,message:Ae.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}bl.create=(e,t)=>new bl({valueType:e,minSize:null,maxSize:null,typeName:Te.ZodSet,...Le(t)});class rd extends Pe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.function)return ie(n,{code:J.invalid_type,expected:oe.function,received:n.parsedType}),Ee;function r(s,u){return _v({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,wv(),xd].filter(l=>!!l),issueData:{code:J.invalid_arguments,argumentsError:u}})}function i(s,u){return _v({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,wv(),xd].filter(l=>!!l),issueData:{code:J.invalid_return_type,returnTypeError:u}})}const o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Id){const s=this;return Ar(async function(...u){const l=new ii([]),c=await s._def.args.parseAsync(u,o).catch(h=>{throw l.addIssue(r(u,h)),l}),f=await Reflect.apply(a,this,c);return await s._def.returns._def.type.parseAsync(f,o).catch(h=>{throw l.addIssue(i(f,h)),l})})}else{const s=this;return Ar(function(...u){const l=s._def.args.safeParse(u,o);if(!l.success)throw new ii([r(u,l.error)]);const c=Reflect.apply(a,this,l.data),f=s._def.returns.safeParse(c,o);if(!f.success)throw new ii([i(c,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new rd({...this._def,args:Lo.create(t).rest(Ju.create())})}returns(t){return new rd({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new rd({args:t||Lo.create([]).rest(Ju.create()),returns:n||Ju.create(),typeName:Te.ZodFunction,...Le(r)})}}class Th extends Pe{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Th.create=(e,t)=>new Th({getter:e,typeName:Te.ZodLazy,...Le(t)});class Ih extends Pe{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ie(n,{received:n.data,code:J.invalid_literal,expected:this._def.value}),Ee}return{status:"valid",value:t.data}}get value(){return this._def.value}}Ih.create=(e,t)=>new Ih({value:e,typeName:Te.ZodLiteral,...Le(t)});function EQ(e,t){return new Ks({values:e,typeName:Te.ZodEnum,...Le(t)})}class Ks extends Pe{constructor(){super(...arguments),Ip.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return ie(n,{expected:Ve.joinValues(r),received:n.parsedType,code:J.invalid_type}),Ee}if(xv(this,Ip,"f")||_Q(this,Ip,new Set(this._def.values),"f"),!xv(this,Ip,"f").has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return ie(n,{received:n.data,code:J.invalid_enum_value,options:r}),Ee}return Ar(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Ks.create(t,{...this._def,...n})}exclude(t,n=this._def){return Ks.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Ip=new WeakMap;Ks.create=EQ;class Eh extends Pe{constructor(){super(...arguments),Ep.set(this,void 0)}_parse(t){const n=Ve.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==oe.string&&r.parsedType!==oe.number){const i=Ve.objectValues(n);return ie(r,{expected:Ve.joinValues(i),received:r.parsedType,code:J.invalid_type}),Ee}if(xv(this,Ep,"f")||_Q(this,Ep,new Set(Ve.getValidEnumValues(this._def.values)),"f"),!xv(this,Ep,"f").has(t.data)){const i=Ve.objectValues(n);return ie(r,{received:r.data,code:J.invalid_enum_value,options:i}),Ee}return Ar(t.data)}get enum(){return this._def.values}}Ep=new WeakMap;Eh.create=(e,t)=>new Eh({values:e,typeName:Te.ZodNativeEnum,...Le(t)});class Id extends Pe{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.promise&&n.common.async===!1)return ie(n,{code:J.invalid_type,expected:oe.promise,received:n.parsedType}),Ee;const r=n.parsedType===oe.promise?n.data:Promise.resolve(n.data);return Ar(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Id.create=(e,t)=>new Id({type:e,typeName:Te.ZodPromise,...Le(t)});class Xi extends Pe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Te.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:a=>{ie(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const a=i.transform(r.data,o);if(r.common.async)return Promise.resolve(a).then(async s=>{if(n.value==="aborted")return Ee;const u=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return u.status==="aborted"?Ee:u.status==="dirty"||n.value==="dirty"?ed(u.value):u});{if(n.value==="aborted")return Ee;const s=this._def.schema._parseSync({data:a,path:r.path,parent:r});return s.status==="aborted"?Ee:s.status==="dirty"||n.value==="dirty"?ed(s.value):s}}if(i.type==="refinement"){const a=s=>{const u=i.refinement(s,o);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Ee:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?Ee:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!vh(a))return a;const s=i.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>vh(a)?Promise.resolve(i.transform(a.value,o)).then(s=>({status:n.value,value:s})):a);Ve.assertNever(i)}}Xi.create=(e,t,n)=>new Xi({schema:e,typeName:Te.ZodEffects,effect:t,...Le(n)});Xi.createWithPreprocess=(e,t,n)=>new Xi({schema:t,effect:{type:"preprocess",transform:e},typeName:Te.ZodEffects,...Le(n)});class Io extends Pe{_parse(t){return this._getType(t)===oe.undefined?Ar(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Io.create=(e,t)=>new Io({innerType:e,typeName:Te.ZodOptional,...Le(t)});class qs extends Pe{_parse(t){return this._getType(t)===oe.null?Ar(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}qs.create=(e,t)=>new qs({innerType:e,typeName:Te.ZodNullable,...Le(t)});class Rh extends Pe{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Rh.create=(e,t)=>new Rh({innerType:e,typeName:Te.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Le(t)});class $h extends Pe{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return yh(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ii(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ii(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}$h.create=(e,t)=>new $h({innerType:e,typeName:Te.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Le(t)});class Rv extends Pe{_parse(t){if(this._getType(t)!==oe.nan){const r=this._getOrReturnCtx(t);return ie(r,{code:J.invalid_type,expected:oe.nan,received:r.parsedType}),Ee}return{status:"valid",value:t.data}}}Rv.create=e=>new Rv({typeName:Te.ZodNaN,...Le(e)});const Sje=Symbol("zod_brand");class qM extends Pe{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class qm extends Pe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Ee:o.status==="dirty"?(n.dirty(),ed(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Ee:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new qm({in:t,out:n,typeName:Te.ZodPipeline})}}class kh extends Pe{_parse(t){const n=this._def.innerType._parse(t),r=i=>(vh(i)&&(i.value=Object.freeze(i.value)),i);return yh(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}kh.create=(e,t)=>new kh({innerType:e,typeName:Te.ZodReadonly,...Le(t)});function RQ(e,t={},n){return e?Td.create().superRefine((r,i)=>{var o,a;if(!e(r)){const s=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,u=(a=(o=s.fatal)!==null&&o!==void 0?o:n)!==null&&a!==void 0?a:!0,l=typeof s=="string"?{message:s}:s;i.addIssue({code:"custom",...l,fatal:u})}}):Td.create()}const wje={object:Et.lazycreate};var Te;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Te||(Te={}));const _je=(e,t={message:`Input not instance of ${e.name}`})=>RQ(n=>n instanceof e,t),Nu=zi.create,$v=Ws.create,xje=Rv.create,Tje=Ns.create,$Q=bh.create,Ije=yl.create,Eje=Tv.create,Rje=Ch.create,$je=Sh.create,kje=Td.create,Oje=Ju.create,Mje=xa.create,Fje=Iv.create,kQ=Hi.create,kv=Et.create,jje=Et.strictCreate,Lje=wh.create,Dje=Y1.create,Uje=_h.create,Bje=Lo.create,Pje=xh.create,Wje=Ev.create,Nje=bl.create,Kje=rd.create,qje=Th.create,Vje=Ih.create,zje=Ks.create,Qje=Eh.create,Hje=Id.create,jL=Xi.create,Yje=Io.create,Gje=qs.create,Jje=Xi.createWithPreprocess,Zje=qm.create,Xje=()=>Nu().optional(),eLe=()=>$v().optional(),tLe=()=>$Q().optional(),nLe={string:e=>zi.create({...e,coerce:!0}),number:e=>Ws.create({...e,coerce:!0}),boolean:e=>bh.create({...e,coerce:!0}),bigint:e=>Ns.create({...e,coerce:!0}),date:e=>yl.create({...e,coerce:!0})},rLe=Ee;var k=Object.freeze({__proto__:null,defaultErrorMap:xd,setErrorMap:oje,getErrorMap:wv,makeIssue:_v,EMPTY_PATH:aje,addIssueToContext:ie,ParseStatus:Zn,INVALID:Ee,DIRTY:ed,OK:Ar,isAborted:Hw,isDirty:Yw,isValid:vh,isAsync:yh,get util(){return Ve},get objectUtil(){return Qw},ZodParsedType:oe,getParsedType:_s,ZodType:Pe,datetimeRegex:IQ,ZodString:zi,ZodNumber:Ws,ZodBigInt:Ns,ZodBoolean:bh,ZodDate:yl,ZodSymbol:Tv,ZodUndefined:Ch,ZodNull:Sh,ZodAny:Td,ZodUnknown:Ju,ZodNever:xa,ZodVoid:Iv,ZodArray:Hi,ZodObject:Et,ZodUnion:wh,ZodDiscriminatedUnion:Y1,ZodIntersection:_h,ZodTuple:Lo,ZodRecord:xh,ZodMap:Ev,ZodSet:bl,ZodFunction:rd,ZodLazy:Th,ZodLiteral:Ih,ZodEnum:Ks,ZodNativeEnum:Eh,ZodPromise:Id,ZodEffects:Xi,ZodTransformer:Xi,ZodOptional:Io,ZodNullable:qs,ZodDefault:Rh,ZodCatch:$h,ZodNaN:Rv,BRAND:Sje,ZodBranded:qM,ZodPipeline:qm,ZodReadonly:kh,custom:RQ,Schema:Pe,ZodSchema:Pe,late:wje,get ZodFirstPartyTypeKind(){return Te},coerce:nLe,any:kje,array:kQ,bigint:Tje,boolean:$Q,date:Ije,discriminatedUnion:Dje,effect:jL,enum:zje,function:Kje,instanceof:_je,intersection:Uje,lazy:qje,literal:Vje,map:Wje,nan:xje,nativeEnum:Qje,never:Mje,null:$je,nullable:Gje,number:$v,object:kv,oboolean:tLe,onumber:eLe,optional:Yje,ostring:Xje,pipeline:Zje,preprocess:Jje,promise:Hje,record:Pje,set:Nje,strictObject:jje,string:Nu,symbol:Eje,transformer:jL,tuple:Bje,undefined:Rje,union:Lje,unknown:Oje,void:Fje,NEVER:rLe,ZodIssueCode:J,quotelessJson:ije,ZodError:ii});const oa="meta_title",hs="meta_description",iLe=k.object({[oa]:k.string(),[hs]:k.string()});async function OQ(e,t,n,r){const i=new URL("generate-seo-metadata",t);return i.searchParams.set("repository",e),se.request(i,{credentials:se.getRequestCredentials(n),okType:iLe,method:"POST",body:r})}const Oh={min:50,max:60},Mh={min:120,max:165};function MQ(e,t){const n=[];return fe.traverseDocument({document:e,customType:t})({transformWidget:({content:i,model:o,apiId:a})=>{var s;if(!(a===oa||a===hs)&&(fe.isRichTextContent(i)&&(o==null?void 0:o.type)==="StructuredText"||fe.isTextContent(i)&&(o==null?void 0:o.type)==="Text"||fe.isUIDContent(i)&&(o==null?void 0:o.type)==="UID")){const u=Ov(i);u&&n.push({label:((s=o.config)==null?void 0:s.label)||"",value:u})}}}),n.map(i=>JSON.stringify(i)).join(`
|
|
68
|
+
`)}function Ov(e){if(fe.isWidgetContent(e)){if(e.__TYPE__==="UIDContent")return e.value;if(e.__TYPE__==="StructuredTextContent"){const[t]=e.value;return!t||t.type==="image"||t.type==="embed"?void 0:t.content.text}if(e.__TYPE__==="FieldContent"&&e.type==="Text")return e.value}}function FQ(e){return e.length>=300}const oLe=k.object({id:k.string(),label:k.string(),repeatable:k.boolean(),status:k.boolean()});async function aLe(e,t,n){const r=await se.request(new URL("customtypes",e),{headers:{repository:t},credentials:se.getRequestCredentials(n),okType:k.array(oLe)});return wt.sort(r,i=>i.label)}function Vm(e){const{baseUrl:t,repository:n,authStrategy:r}=e;return li.queryOptions({queryKey:["customTypes"],queryFn:()=>aLe(t,n,r)})}function sLe(e,t){e.prefetchQuery(Vm(t))}function uLe(e,t){return e.fetchQuery(Vm(t))}function VM(e){return li.useSuspenseQuery(Vm(e))}function lLe(e){const{id:t,baseUrl:n,repository:r,authStrategy:i}=e,a=VM({baseUrl:n,repository:r,authStrategy:i}).data.find(s=>s.id===t);if(!a)throw new Error(`Custom type "${t}" does not exist`);return a}function cLe(e,t){return e.invalidateQueries(Vm(t))}function dLe(e){const{id:t,baseUrl:n,repository:r,authStrategy:i}=e,o=new URL(`customtypes/${t}`,n);return o.searchParams.set("static","true"),se.request(o,{headers:{repository:r},credentials:se.getRequestCredentials(i),okType:fLe})}const fLe=k.unknown().transform((e,t)=>{const n=he.StaticCustomType.decode(e);return n._tag==="Right"?n.right:(t.addIssue({code:k.ZodIssueCode.custom,message:"Invalid custom type."}),k.NEVER)});function jQ(e){const{id:t}=e;return li.queryOptions({queryKey:["customTypes","static",t],queryFn:()=>dLe(e)})}function pLe(e){return li.useSuspenseQuery(jQ(e))}function hLe(e,t){e.prefetchQuery(jQ(t))}const ALe=k.object({id:k.string().optional(),first_name:k.string().optional(),last_name:k.string().optional(),email:k.string().optional(),uploadedAvatar:k.string().optional()}),zM=k.object({id:k.string(),name:k.string(),is_master:k.boolean().optional()}).transform(e=>({id:e.id,label:e.name,...e.is_master!==void 0?{isMaster:e.is_master}:{}})),LQ=k.discriminatedUnion("status",[k.object({status:k.literal("unclassified")}),k.object({status:k.literal("published")}),k.object({status:k.literal("release"),release_id:k.string()}),k.object({status:k.literal("archived")})]),DQ=k.object({version_id:k.string(),tags:k.array(k.string()),preview_image:k.string().optional(),last_modified_date:k.coerce.date(),uid:k.string().optional()}),UQ=LQ.and(DQ.extend({custom_type_label:k.string(),preview_summary:k.string().optional(),author:ALe})),BQ=LQ.and(DQ.extend({custom_type_id:k.string().optional(),summary:k.string().optional(),author_ids:k.array(k.string()).optional(),highlights:k.object({uid:k.string().optional()}).optional()}));function PQ(e){return UQ.safeParse(e).success}function Jw(e){return BQ.safeParse(e).success}const WQ=k.string().nullish().transform(e=>e??"Untitled"),QM=k.object({id:k.string(),title:WQ,custom_type_id:k.string(),group_lang_id:k.string(),language:zM,versions:k.array(UQ)}),mLe=k.object({total:k.number(),cursor:k.string().optional(),results:k.array(QM)}),gLe=k.object({id:k.string(),title:WQ,custom_type_id:k.string(),group_lang_id:k.string(),interesting_versions:k.array(BQ),locale_id:k.string().optional()}).transform(e=>{const{interesting_versions:t,...n}=e;return{versions:t,...n}}),vLe=k.object({results:k.array(gLe)});function HM(e){const{baseUrl:t,authStrategy:n,limit:r,cursor:i,statuses:o,authors:a,language:s,groupLangIds:u,documentIds:l,customTypes:c,tags:f,term:p,uids:h,signal:A}=e,g=new URL("documents/search",t),y=Pd.filterValues({statuses:o,authors:a,language:s,groupLangIds:u,customTypes:c,tags:f,term:p,documentIds:l,limit:r,cursor:i,uids:h},C=>!(C===""||Array.isArray(C)&&C.length===0));return se.request(g,{credentials:se.getRequestCredentials(n),okType:mLe,signal:A,method:"POST",body:y})}function NQ(e,t,n,r){const i=new URL(e);return i.search=n,se.request(i,{credentials:se.getRequestCredentials(t),okType:vLe,...r})}function KQ(e){const{repository:t,searchTerm:n,tags:r,authors:i,status:o,localeId:a,customTypesIds:s}=e,u=new URLSearchParams;return u.append("repository",t),n&&u.append("searchTerm",n),r!=null&&r.length&&u.append("tags",r.toString()),i!=null&&i.length&&u.append("authors",i.toString()),o!=null&&o.length&&u.append("status",o.toString()),a&&u.append("localeId",a),s!=null&&s.length&&u.append("customTypesIds",s.toString()),u.toString()}function qQ(e){return e.reduce((t,n)=>{if(n.values.every(i=>i===""||i===void 0))return t;const r=n.values.map(i=>[n.name,i??""]);return t.concat(r)},[])}function zm(e,t,n){return se.request(new URL(`documents/${n}`,e),{credentials:se.getRequestCredentials(t),okType:QM})}const yLe=k.custom().transform((e,t)=>{const n=fe.Document.decode(e);return n._tag==="Left"?(t.addIssue({code:k.ZodIssueCode.custom,message:"Invalid document."}),k.NEVER):n.right}),bLe=k.unknown().transform((e,t)=>{const n=fe.SliceItemContent.decode(e);return n._tag==="Right"?n.right:(t.addIssue({code:k.ZodIssueCode.custom,message:"Invalid slice content."}),k.NEVER)}),xo={all:()=>["documents"],lists:()=>[...xo.all(),"list"],list:e=>[...xo.lists(),e],infiniteLists:()=>[...xo.all(),"list:infinite"],infiniteList:e=>[...xo.infiniteLists(),e]};function CLe(e,t){e.setQueriesData({queryKey:xo.lists()},n=>n&&LL(n,t)),e.setQueriesData({queryKey:xo.infiniteLists()},n=>n&&{...n,pages:n.pages.map(r=>LL(r,t))})}function LL(e,t){const n=e.results.flatMap(r=>{const i=t(r,e);return i?[i]:[]});return{...e,results:n,total:e.total+(n.length-e.results.length)}}async function SLe(e){await e.invalidateQueries({queryKey:xo.lists()}),await e.invalidateQueries({queryKey:xo.infiniteLists()})}function YM(e){return li.useSuspenseQuery(VQ(e))}function VQ(e){return li.queryOptions({queryKey:xo.list(e),queryFn:({queryKey:[,,t]})=>HM(t)})}async function zQ(e){const{coreApiBaseUrl:t,documentSearchBaseUrl:n,authStrategy:r,repository:i,searchTerm:o="",customTypes:a,tags:s,authors:u,status:l,locale:c,signal:f,storageVersion:p}=e;if(p&&p.major<=6){const C=l!=null&&l.length?l:["published","unclassified","release"];return{results:(await HM({baseUrl:t,authStrategy:r,tags:s,customTypes:a,language:c,term:o,authors:u,statuses:C,limit:200})).results}}const h=KQ({repository:i,searchTerm:o,tags:s,authors:u,status:l,localeId:c,customTypesIds:a});return{results:(await NQ(n,r,h,{signal:f})).results}}function QQ(e){const{searchTerm:t,customTypes:n,tags:r,authors:i,status:o,locale:a,config:s,storageVersion:u}=e;s.searchDocuments||Rt("searchDocuments");const{coreApiBaseUrl:l,documentSearchBaseUrl:c,authStrategy:f,repository:p}=s;return li.queryOptions({queryKey:["searchDocuments",{coreApiBaseUrl:l,documentSearchBaseUrl:c,authStrategy:f,repository:p,searchTerm:t,customTypes:n,tags:r,authors:i,status:o,locale:a,storageVersion:u}],queryFn:({queryKey:[,h],signal:A})=>zQ({...h,signal:A})})}const wLe=k.object({id:k.string(),firstname:k.string().optional(),lastname:k.string().optional(),email:k.string(),uploadedAvatar:k.string().optional()}),HQ=k.array(wLe),_Le=k.object({slicemachineEnabled:k.boolean()}),YQ=["next","nuxt","sveltekit"];function xLe(e){return YQ.includes(e)}const G1=k.preprocess(e=>typeof e=="string"&&xLe(e)?e:"other",k.enum([...YQ,"other"])),TLe=k.object({simulator_url:k.string().url().nullish(),languages:k.array(zM).transform(e=>wt.sort(e,t=>t.label)),authors:HQ.optional().default([]),quotas:_Le.optional().default({slicemachineEnabled:!1}),framework:G1.optional().default("other"),starterId:k.string().optional(),storageVersion:k.object({major:k.number().int(),minor:k.number().int()}),uploadedAvatar:k.string().url().optional()}).transform(({simulator_url:e,framework:t,...n})=>{const r=e&&GQ(e)?e:void 0;return{...n,framework:t,simulatorUrl:r,isSupportedFramework:t!=="other"}});function J1(e,t){return se.request(new URL("repository",e),{credentials:se.getRequestCredentials(t),okType:TLe})}function GQ(e){const t=ni.toURL(e);return t?t.pathname.endsWith("/slice-simulator"):!1}const ILe=k.object({results:k.array(k.string())});function JQ(e,t){return se.request(new URL("repository/tags",e),{credentials:se.getRequestCredentials(t),okType:ILe})}const ELe=k.object({maxNbEnvironments:k.number(),integrationFieldsEnabled:k.boolean(),personalEnvironmentsEnabled:k.boolean(),sliceMachineEnabled:k.boolean()}),ZQ=k.object({_id:k.string(),name:k.string(),onboarding:k.object({completedSteps:k.array(k.string()),isDismissed:k.boolean()}),framework:G1.optional().default("other"),quotas:ELe.optional().default({maxNbEnvironments:0,integrationFieldsEnabled:!1,personalEnvironmentsEnabled:!1,sliceMachineEnabled:!1}),storageVersion:k.object({major:k.number().int(),minor:k.number().int()}),authors:HQ.optional().default([])});function RLe(e,t,n){const r=new URL("",e);return r.searchParams.append("repository",t),se.request(r,{headers:{repository:t},credentials:se.getRequestCredentials(n),okType:ZQ})}const $Le=k.enum(["createPrismicProject","chooseLocale","createProject","setupSliceMachine","createPageType","codePage","createSlice","reviewAndPush","createContent","renderPage"]),XQ=k.object({completedSteps:k.array(k.string()),isDismissed:k.boolean(),context:k.object({framework:G1,starterId:k.string().nullable().optional()})}),eH=k.object({completedSteps:k.array(k.string())}),tH=k.object({isDismissed:k.boolean()});function kLe(e,t,n){const r=new URL("onboarding",e);return r.searchParams.append("repository",t),se.request(r,{headers:{repository:t},credentials:se.getRequestCredentials(n),okType:XQ})}function OLe(e,t,n,r){const i=new URL(`onboarding/${e}/toggle`,t);return i.searchParams.append("repository",n),se.request(i,{method:"PATCH",headers:{repository:n},credentials:se.getRequestCredentials(r),okType:eH})}function MLe(e,t,n){const r=new URL("onboarding/toggle",e);return r.searchParams.append("repository",t),se.request(r,{method:"PATCH",headers:{repository:t},credentials:se.getRequestCredentials(n),okType:tH})}const Zw=k.enum(["SuperUser","Owner","Administrator","Manager","Writer","Readonly"]);function FLe(e="Readonly"){return e==="Administrator"||e==="SuperUser"||e==="Owner"}const jLe={SuperUser:"SuperUser",Owner:"Owner",Administrator:"Administrator",Manager:"Publisher",Writer:"Writer",Readonly:"Read-only"};function LLe(e){return jLe[e]}const DLe=k.enum([Zw.enum.Manager,Zw.enum.Writer]),GM=k.record(DLe),JM=k.record(k.object({rolesPerLocale:GM})),ULe=k.record(k.object({rolesPerLocale:GM,rolesPerUser:JM})),BLe=k.object({rolesPerUser:k.record(Zw)}),PLe=k.object({rolesPerUser:JM}),WLe=k.object({rolesPerLocale:GM,rolesPerUser:JM,rolesPerTeamSpace:ULe}),NLe=k.object({repository:BLe.optional(),locale:PLe.optional(),teamSpace:WLe.optional()});function nH(e){const{baseUrl:t,repository:n,authStrategy:r,scopes:i,userIds:o,localeIds:a,teamSpaceIds:s,fetchEnabled:u}=e;if(!u)return Promise.resolve({});const l=new URL("roles",t);return l.searchParams.append("repository",n),i!=null&&i.length&&l.searchParams.set("scopes",i.join(",")),o!=null&&o.length&&l.searchParams.set("userIds",o.join(",")),a!=null&&a.length&&l.searchParams.set("localeIds",a.join(",")),s!=null&&s.length&&l.searchParams.set("teamSpaceIds",s.join(",")),se.request(l,{method:"GET",credentials:se.getRequestCredentials(r),okType:NLe})}function KLe(e){return li.queryOptions({queryKey:["roles",e],queryFn:()=>nH(e)})}function qLe(e){const{baseUrl:t,repository:n,authStrategy:r,payload:i}=e,o=new URL("roles",t);return o.searchParams.append("repository",n),se.request(o,{method:"PATCH",body:i,credentials:se.getRequestCredentials(r),okType:k.unknown()})}const Z1=k.object({id:k.string(),name:k.string(),customTypes:k.array(k.string())});k.object({name:k.string(),customTypes:k.array(k.string())});const VLe=k.object({results:k.array(Z1)});function rH(e){const{baseUrl:t,repository:n,authStrategy:r}=e,i=new URL("team-spaces",t);return i.searchParams.append("repository",n),se.request(i,{method:"GET",credentials:se.getRequestCredentials(r),okType:VLe})}function zLe(e){return li.queryOptions({queryKey:["teamSpaces",e],queryFn:()=>rH(e),select:t=>t.results})}function QLe(){const e=li.useQueryClient();return()=>e.invalidateQueries({queryKey:["teamSpaces"]})}function HLe(e){const{baseUrl:t,repository:n,authStrategy:r,payload:i}=e,o=new URL("team-spaces",t);return o.searchParams.append("repository",n),se.request(o,{method:"POST",body:i,credentials:se.getRequestCredentials(r),okType:Z1})}function YLe(e){const{baseUrl:t,repository:n,authStrategy:r,payload:i,teamSpaceId:o}=e,a=new URL(`team-spaces/${o}`,t);return a.searchParams.append("repository",n),se.request(a,{method:"PUT",body:i,credentials:se.getRequestCredentials(r),okType:Z1})}function GLe(e){const{baseUrl:t,repository:n,authStrategy:r,teamSpaceId:i}=e,o=new URL(`team-spaces/${i}`,t);return o.searchParams.append("repository",n),se.request(o,{method:"DELETE",credentials:se.getRequestCredentials(r),okType:k.unknown()})}const iH=k.enum(["SuperUser","Owner","Administrator","Writer","Manager","Readonly"]),JLe=k.record(iH.optional()),ZLe=iH.or(JLe),XLe={SuperUser:"SuperUser",Owner:"Owner",Administrator:"Administrator",Manager:"Publisher",Writer:"Writer",Readonly:"Contributor"},oH=k.object({userId:k.string(),shortId:k.string(),intercomHash:k.string(),email:k.string(),firstName:k.string(),lastName:k.string(),superPower:k.boolean(),repositories:k.array(k.object({domain:k.string(),name:k.string().optional(),role:ZLe}))});async function aH(e,t){const n=new URL("profile",e);return await se.request(n,{credentials:se.getRequestCredentials(t),okType:oH})}function ZM(){const e=we();e.userServiceBaseUrl||Rt("userServiceBaseUrl");const{authStrategy:t,userServiceBaseUrl:n}=e;return et.useRequest(aH,[n,t])}const e2e="https://prismic.io/docs/guides/manage-images#supported-media";function Qm(){const e=we();e.mediaLibrary||Rt("mediaLibrary");const{assetsApiBaseUrl:t,authStrategy:n,repository:r}=e,{items:i}=et.useRequest(sH,[t,r,n]);return{tags:i}}function sH(e,t,n){return se.request(new URL("tags",e),{credentials:se.getRequestCredentials(n),okType:t2e,headers:{repository:t}})}const uH=1,lH=20,XM=k.string().min(uH).max(lH),eF=k.object({id:k.string(),name:XM,uploader_id:k.string().optional(),created_at:k.number(),last_modified:k.number(),count:k.number().optional().default(0)}),t2e=k.object({items:k.array(eF)});function Hm(e){et.updateFetcherData(sH,t=>{const{items:n}=t,r=e(n);if(r)return{items:r}})}function n2e(e){const{assetType:t,keyword:n,mode:r,tagIds:i}=e,o=we();o.mediaLibrary||Rt("mediaLibrary");const{onAnalyticsEvent:a}=o,s=et.useFetcherData(Wi),u=s[s.length-1],l=I.useRef(u);l.current=u,I.useEffect(()=>{if(!a||!n||!l.current||l.current.keyword!==n)return;const c=String(n.split(" ").length),f=String(l.current.total),p=i.join(",");a("Media Library Search",{searchQuery:n,numberOfWords:c,numberOfResults:f,timeToGetResults:l.current.time,assetType:t,mode:r,tags:p})},[n,t,r,a,i])}function r2e(e){const{assetType:t,mediaDialogOpen:n}=e,r=we(),i=et.useFetcherData(Wi),o=I.useRef(0);I.useEffect(()=>{n&&(o.current=performance.now())},[n]);function a(s){if(!r.onAnalyticsEvent||!r.mediaLibrary)return;const u=i[i.length-1];if(!u)return;const{keyword:l,uploaderId:c,tags:f}=u,p=fH(i,l,t,c,f),h=String(l.split(" ").length),A=String(u.total),g=p.findIndex(b=>b.id===s),y=String(g+1),C=[s].join(","),_=(performance.now()-o.current).toFixed(0);r.onAnalyticsEvent("Media Added To Page",{assetType:t,searchQuery:l,numberOfWords:h,numberOfResults:A,searchPosition:y,mediaIds:C,timeToAddMediaToPage:_,tags:f})}return a}const vg=k.array(k.string()).optional().transform(e=>e==null?void 0:e[0]),X1=k.object({id:k.string(),kind:k.string(),extension:k.string().optional(),filename:k.string(),width:k.number().optional(),height:k.number().optional(),last_modified:k.number(),url:k.string(),alt:k.string().optional(),uploader_id:k.string().optional(),size:k.number(),notes:k.string().optional(),credits:k.string().optional(),search_highlight:k.object({filename:vg,alt:vg,notes:vg,credits:vg}).optional(),tags:k.array(eF)}),cH={"X-Prismic-Source":"Wroom"},i2e=k.object({total:k.number(),cursor:k.string().optional(),items:k.array(X1)}),dH=30;function Wi(e,t,n,r,i,o,a,s,u){const l=e?new URL("assets",e):void 0,c=new URLSearchParams(qQ([{name:"limit",values:[`${dH}`]},{name:"cursor",values:[u]},{name:"keyword",values:[r]},{name:"assetType",values:[i]},{name:"uploaderId",values:[o]},{name:"tags",values:a.split(",")}])).toString(),f=i2e.transform(h=>({...h,keyword:r,assetType:i,uploaderId:o,tags:a,page:s})),p=performance.now();return se.request(`${(l==null?void 0:l.href)??""}?${c}`,{headers:{repository:t,...cH},credentials:se.getRequestCredentials(n),okType:f}).then(h=>({...h,time:(performance.now()-p).toFixed(0)}))}et.cache.registerFetcherConfig(Wi,{revalidationStrategy:{type:"never"}});const cr={keyword:"",assetType:"all",uploaderId:void 0,tagIds:[]};function o2e(e){const{initialAssetType:t=cr.assetType,mode:n}=e,r=we(),[i,o]=I.useState({...cr,assetType:t,page:0});r.mediaLibrary||Rt("mediaLibrary");const{assetsApiBaseUrl:a,authStrategy:s,repository:u}=r,{page:l,cursor:c,keyword:f,assetType:p,uploaderId:h,tagIds:A}=i,g=et.useRequest(Wi,Fh({assetsApiBaseUrl:a,authStrategy:s,repository:u,keyword:f,assetType:p,uploaderId:h,tagIds:A,page:l,cursor:c}));n2e({assetType:p,keyword:f,tagIds:A,mode:n});const y=l2e(f,p,h,A),C=g.total!==y.length;function _(){g.cursor!==void 0&&o(w=>({...w,page:w.page+1,cursor:g.cursor}))}function b(w){o(T=>({...T,page:0,cursor:void 0})),Cl((T,E)=>{if(E.page===0)return[...w,...T]})}function v(w){o(T=>({...T,...w,page:0,cursor:void 0}))}function S(){o(w=>({...w,...cr,assetType:t==="all"?cr.assetType:w.assetType,page:0,cursor:void 0}))}return{keyword:f,assetType:p,uploaderId:h,tagIds:A,setFilters:v,resetFilters:S,media:y,mediaTotal:g.total,limit:dH,hasNextPage:C,fetchNextPage:_,updateMedia:a2e,unshiftMedia:b,deleteMedia:s2e,deleteSearchData:u2e,revalidateFirstPage:pH}}function a2e(e){Cl(t=>t.flatMap(n=>{const r=e.find(i=>i.id===n.id);return r?r.response===void 0?[]:{...n,...r.response}:n}))}function s2e(e){Cl(t=>t.filter(n=>!e.includes(n.id)))}function u2e(e){const{keyword:t,assetType:n,uploaderId:r,tagIds:i}=e,o=i==null?void 0:i.join(",");et.updateFetcherData(Wi,a=>{if(!(a.keyword===t&&a.assetType===n&&a.uploaderId===r&&a.tags===o))return a})}function fH(e,t,n,r,i){const o=e.filter(u=>u.keyword===t&&u.assetType===n&&u.uploaderId===r&&u.tags===i),s=wt.sort(o,u=>u.page).flatMap(u=>u.items);return t?wt.uniqBy(s,u=>u.id):s}function l2e(e,t,n,r){const i=et.useFetcherData(Wi);return fH(i,e,t,n,r.join(","))}function Cl(e){et.updateFetcherData(Wi,t=>{const{items:n,total:r}=t,i=e(n,t);if(i)return{...t,total:r+(i.length-n.length),items:i}})}function pH(e){const{config:t,keyword:n=cr.keyword,assetType:r=cr.assetType,tagIds:i=cr.tagIds}=e;if(!t.mediaLibrary)throw new Error("media library is not configured");const{assetsApiBaseUrl:o,authStrategy:a,repository:s}=t;et.revalidateData(Wi,Fh({assetsApiBaseUrl:o,repository:s,authStrategy:a,keyword:n,assetType:r,tagIds:i,page:0}))}function hH(e){const{config:t,keyword:n=cr.keyword,assetType:r=cr.assetType,tagIds:i=cr.tagIds}=e;if(!t.mediaLibrary)throw new Error("media library is not configured");et.updateFetcherData(Wi,o=>o.page===0?o:void 0),pH({config:t,keyword:n,assetType:r,tagIds:i})}function Fh(e){return[e.assetsApiBaseUrl,e.repository,e.authStrategy,e.keyword,e.assetType,e.uploaderId,e.tagIds.join(","),e.page,e.cursor]}function AH(){const e=we();e.mediaLibrary||Rt("mediaLibrary");const{assetsApiBaseUrl:t,coreApiBaseUrl:n,authStrategy:r,repository:i}=e,{authors:o}=et.useRequest(J1,[n,r]),{items:a}=et.useRequest(mH,[t,i,r]),{shortId:s}=ZM(),u=new Map(o.map(f=>[f.id,f])),l=[];for(const f of a){if(f.id==="ghost"){l.push({id:f.id,name:"Ghost",uploadedAvatar:"https://images.prismic.io/page-builder-assets/ZuAXWBoQrfVKl5sD_ghost_user.png?auto=format,compress&w=64"});continue}const p=u.get(f.id);if(!p)continue;let h;if(p.uploadedAvatar){const A=new URL(p.uploadedAvatar);A.searchParams.set("w","64"),h=A.toString()}l.push({id:f.id,name:[p.firstname,p.lastname].filter(Boolean).join(" "),firstName:p.firstname,lastName:p.lastname,email:p.email,uploadedAvatar:h})}const c=new Map(l.map(f=>[f.id,f]));return{uploaders:wt.sort(l,f=>f.id===s?0:1,f=>f.name),uploadersById:c}}function mH(e,t,n){return se.request(new URL("uploaders",e),{credentials:se.getRequestCredentials(n),okType:d2e,headers:{repository:t}})}const c2e=k.object({id:k.string()}),d2e=k.object({items:k.array(c2e)});function gH(){const e=we();e.mediaLibrary||Rt("mediaLibrary");const{assetsApiBaseUrl:t,authStrategy:n,repository:r}=e;return()=>{et.revalidateData(mH,[t,r,n])}}function f2e(e){const{revalidate:t,config:n,keyword:r,assetType:i,uploaderId:o,tagIds:a}=e,{assetsApiBaseUrl:s=void 0,repository:u="",authStrategy:l="token"}=n.mediaLibrary?n:{},[c,f]=I.useState(!1),[p,h]=I.useState(!1),A={assetsApiBaseUrl:s,repository:u,authStrategy:l,keyword:r,assetType:i,uploaderId:o,tagIds:a,page:0},{revalidateData:g}=et.useCacheRevalidation({fetcher:Wi,requestParams:Fh(A),validator:(_,b)=>{var w,T;const v=((w=_.items[0])==null?void 0:w.id)??"",S=((T=b.items[0])==null?void 0:T.id)??"";return v!==S||_.total!==(b==null?void 0:b.total)},onCacheInvalidated:()=>h(!0),every:6e4}),y=_=>{g(Fh({...A,..._}))};I.useEffect(()=>{c&&(h(!1),f(!1))},[c]);function C(){f(!0),t()}return{isMediaRevalidationInProgress:c,isMediaCacheInvalid:p,revalidateMedia:C,revalidateWithParams:y}}function p2e(e){const{onBeforeUpload:t,onComplete:n}=e,[r,i]=I.useState([]),o=r.some(c=>c.status==="idle"||c.status==="uploading"),a=we();function s(){if(!r.length||r.some(h=>h.status==="uploading")||r.every(h=>h.status==="error"))return;const c=r.find(h=>h.status==="idle");if(!c)return;let f=r;function p(h){f=h(f),i(f),f.every(g=>g.status==="success"||g.status==="error")&&setTimeout(()=>{i([]),n==null||n(f)},1500)}p(h=>h.map(A=>A.id===c.id?{...A,status:"uploading"}:A)),vH({file:c.file,config:a}).then(h=>{p(A=>A.map(g=>g.id===c.id?{...g,status:"success",response:h}:g))}).catch(()=>{p(h=>h.map(A=>A.id===c.id?{...A,status:"error"}:A))})}function u(c){const f=c.map(p=>({id:`temp-${crypto.randomUUID()}`,file:p,status:"idle"}));i(f),t(f)}const l=I.useCallback(c=>{const f=[{...c,status:"idle"},...r.filter(p=>p.id!==c.id)];i(f),t(f)},[t,r]);return I.useEffect(s,[a,r,n]),{isUploading:o,uploadingFiles:r,onFilesSelected:u,onRetry:l}}async function vH(e){const{file:t,config:n}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n,a=new FormData;return a.append(t.name,t),se.request(new URL("assets",r),{headers:{repository:i,"Content-Type":"multipart/form-data",...cH},method:"POST",body:a,credentials:se.getRequestCredentials(o),okType:X1})}const yH=I.createContext(void 0);function h2e(e){const{children:t,assetType:n=cr.assetType,onSelectedChange:r,actionContainer:i}=e,o=r?"select":"browse",[a,s]=I.useTransition(),[u,l]=I.useTransition(),c=we(),{showAlert:f}=m.useAlert(),p=ZM(),h=gH(),{keyword:A,assetType:g,uploaderId:y,tagIds:C,setFilters:_,resetFilters:b,media:v,fetchNextPage:S,hasNextPage:w,updateMedia:T,unshiftMedia:E,deleteMedia:R,mediaTotal:O,deleteSearchData:$,revalidateFirstPage:B}=o2e({initialAssetType:n,mode:o}),[K,H]=I.useState();function z(){hH({config:c,keyword:A,assetType:g,uploaderId:y,tagIds:C})}const{isMediaRevalidationInProgress:N,isMediaCacheInvalid:Y,revalidateMedia:ee,revalidateWithParams:F}=f2e({config:c,revalidate:z,keyword:A,assetType:g,uploaderId:y,tagIds:C});function M(_e){const Ze=_e.keyword===cr.keyword,pt=_e.assetType===n,tt=_e.uploaderId===cr.uploaderId,lt=_e.tagIds.length===cr.tagIds.length&&_e.tagIds.every((Yt,Sn)=>Yt===cr.tagIds[Sn]);return Ze&&pt&&tt&<}function W(_e){const Ze={keyword:A,assetType:g,tagIds:C,uploaderId:y,..._e};M(Ze)?F(_e):$(Ze),l(()=>{_(_e),ae.clearSelection()})}const{isUploading:re,onFilesSelected:Ie,uploadingFiles:Ce,onRetry:P}=p2e({onBeforeUpload:_e=>{b();const Ze=_e.filter(tt=>tt.status==="idle").map(tt=>({id:tt.id,url:URL.createObjectURL(tt.file),filename:tt.file.name,size:tt.file.size,extension:tt.file.type,kind:tt.file.type,last_modified:tt.file.lastModified,tags:[],uploader_id:p.shortId}));E(Ze);const[pt]=Ze??[];pt&&ae.toggleSelection({id:pt.id,isSingleSelection:!0})},onComplete:_e=>{const Ze=_e.flatMap(lt=>lt.status==="success"?lt:(mt(lt),{id:lt.id,response:void 0}));T(Ze),B({config:c,assetType:g,tagIds:C}),h();const pt=Ze[0];!pt||!pt.response||!ae.isSelected(pt.id)||ae.toggleSelection({id:pt.response.id,isSingleSelection:!0})}}),ae=xu({totalItemCount:O,onChangeSelection:({selectedIds:_e,selectedCount:Ze})=>{if(Ht(!1),!!r){if(Ze===1){const[pt]=[..._e];if(Ce.some(lt=>lt.id===pt&<.status!=="success")){r(new Set);return}}r(new Set(_e))}}});function Ge(_e){re||Ie(_e)}function ve(){w&&s(S)}function De(_e,Ze){T([{id:_e,response:Ze}])}function mt(_e){const Ze=ri.overflow(_e.file.name,30);f({id:_e.id,title:`The specified file "${Ze}" could not be uploaded.`,subtitle:d.jsxs(m.Text,{color:"inherit",children:["Read more about our"," ",d.jsx(m.Text,{color:"tomato11",href:e2e,underline:!0,children:"supported media"}),"."]}),buttons:{action:{text:"Retry upload",icon:"cloudUpload",onClick:()=>P(_e)}}})}const[rn,Ht]=I.useState(!1);return d.jsx(yH.Provider,{value:{isFetchingMedia:a,media:v,mediaTotal:O,onScrollToBottom:ve,actionContainer:i,onFilesUpload:Ge,isUploading:re,uploadingFiles:Ce,isMediaRevalidationInProgress:N,isMediaCacheInvalid:Y,revalidateMedia:ee,deleteMedia:R,updateMedia:De,keyword:A,isSearchingMedia:u,assetType:g,initialAssetType:n,uploaderId:y,tagManagerOpen:rn,setTagManagerOpen:Ht,tagIds:C,onFilterChange:W,openMediaSection:K,setOpenMediaSection:H},children:t})}function Tt(){const e=I.useContext(yH);if(!e)throw new Error("useMediaLibrary must be used within a MediaLibraryProvider");return e}function A2e(){const e=we(),{initialAssetType:t}=Tt(),{assetsApiBaseUrl:n=void 0,repository:r="",authStrategy:i="token"}=e.mediaLibrary?e:{},{total:o}=et.useRequest(Wi,Fh({assetsApiBaseUrl:n,authStrategy:i,repository:r,assetType:t,keyword:"",tagIds:[],page:0}));return o}function bH(){return A2e()===0}function m2e(){return bH()?d.jsx(g2e,{}):d.jsx(SH,{})}function CH(e){const{children:t}=e;return d.jsx(m.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:t})}function SH(){return d.jsx(CH,{children:d.jsxs(m.BlankSlate,{children:[d.jsx(m.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),d.jsx(m.BlankSlateTitle,{size:"big",children:"Oops!"}),d.jsx(m.BlankSlateDescription,{width:360,children:"No items found matching your search"})]})})}function g2e(){const{onFilesUpload:e}=Tt();return d.jsx(CH,{children:d.jsxs(m.Box,{gap:20,flexDirection:"column",alignItems:"center",children:[d.jsx(m.Box,{maxWidth:375,children:d.jsx(m.BlankSlateTitle,{size:"big",children:"Start by uploading your files!"})}),d.jsx(m.Box,{border:!0,borderStyle:"dashed",borderRadius:4,justifyContent:"center",children:d.jsxs(m.BlankSlate,{sx:{marginBlock:80,marginInline:48},children:[d.jsx(m.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple11",backgroundColor:"purple5",size:"large"}),d.jsx(m.BlankSlateTitle,{children:"Drop your files anywhere to upload or ..."}),d.jsx(m.FileUploadButton,{onFilesSelected:e,renderButton:t=>d.jsx(m.Box,{display:"inline-flex",as:"span",children:d.jsx(m.Button,{onClick:t,color:"grey",children:"Upload media"})})}),d.jsx(m.BlankSlateDescription,{children:"Maximum upload size file: 128 MB"})]})})]})})}const Ed={warning:{uploadWhileUploading:{title:"Hang tight!",description:"Your current images are still being uploaded. Once they're all set, you'll be free to upload more."}}};function v2e(){const{actionContainer:e,isUploading:t,onFilesUpload:n,assetType:r}=Tt();return d.jsx(wH,{actionContainer:e,children:d.jsxs(m.Box,{width:"100%",gap:16,children:[d.jsx(y2e,{}),d.jsx(m.Tooltip,{title:Ed.warning.uploadWhileUploading.title,content:Ed.warning.uploadWhileUploading.description,visible:t,stableMount:!0,children:d.jsx(m.FileUploadButton,{disabled:t,onFilesSelected:n,startIcon:"cloudUpload",color:e?"purple":"grey",size:"large",assetType:r,children:"Upload media"})})]})})}function y2e(){const{keyword:e,onFilterChange:t,isFetchingMedia:n}=Tt(),[r,i]=I.useState(e);return ze.useOnChange(e,()=>{e===""&&i("")}),ze.useDebounce(r,300,ze.useStableCallback(o=>t({keyword:o}))),d.jsx(m.Box,{width:"100%",flexDirection:"column",children:d.jsx(m.FormSearchInput,{value:r,placeholder:"Search",onValueChange:i,maxLength:200,isLoading:n&&e!==r})})}function wH(e){const{children:t,actionContainer:n}=e;return n?d.jsx(m.Portal,{container:n,asChild:!0,children:t}):d.jsx(d.Fragment,{children:t})}function b2e(e){const{children:t}=e,{onFilesUpload:n,assetType:r}=Tt();return d.jsx(m.FileDropZone,{overlay:d.jsx(C2e,{}),onFilesSelected:n,assetType:r,children:t})}function C2e(){const{isUploading:e}=Tt(),t=e?Ed.warning.uploadWhileUploading.title:"Drop files here",n=e?Ed.warning.uploadWhileUploading.description:"Drop your files to upload them instantly to the media library.";return d.jsx(m.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:d.jsxs(m.BlankSlate,{children:[d.jsx(m.BlankSlateIcon,{name:e?"block":"cloudUpload",lineColor:e?"tomato11":"purple10",backgroundColor:e?"tomato2":"purple3",borderColor:e?"tomato6":"purple6",borderStyle:"dashed",size:"xlarge"}),d.jsx(m.BlankSlateTitle,{size:"big",children:t}),d.jsx(m.BlankSlateDescription,{width:360,children:n})]})})}function _H(){return d.jsx(m.DefaultErrorMessage,{title:"Oops! Something went wrong",description:"An error occurred while searching for your image.",errorImageSrc:m.dialogErrorImage,sx:{marginBlock:"auto",marginInline:"auto"}})}function xH(e){const{mediaList:t,mediaActions:n,mediaToolbar:r,sidePane:i}=e,o=m.useMediaQuery({min:"medium"}),a=i&&o;return d.jsxs(m.Box,{display:"grid",gridTemplateRows:"auto auto 1fr",gridTemplateColumns:a?"1fr 380px":"1fr",width:"100%",height:"100%",children:[d.jsxs(m.Box,{position:"relative",display:"grid",gap:16,gridColumn:"1",gridRow:"1",padding:{right:16,bottom:16},children:[n,r]}),d.jsx(m.Box,{position:"relative",display:"grid",gridColumn:"1",gridRow:"2 / -1",children:t}),a&&i]})}function S2e(){var p;const{onScrollToBottom:e,media:t,isUploading:n,uploadingFiles:r,isSearchingMedia:i,isMediaRevalidationInProgress:o,setOpenMediaSection:a,isFetchingMedia:s}=Tt(),u=xu(),l=I.useRef(null);function c(h){u.toggleSelection({id:h,isSingleSelection:!0}),a("tags")}(n||i||o)&&((p=l.current)==null||p.scrollTo({top:0,behavior:"instant"}));function f(h,A,g){const y=A.shiftKey?t.map(({id:C})=>C):void 0;u.toggleSelection({id:h,isSingleSelection:g==="single",metaKey:A.metaKey,shiftKey:A.shiftKey,ids:y})}return d.jsxs(TH,{onScrollToBottom:e,scrollAreaRef:l,children:[t.map(h=>{var A,g;return d.jsx(m.MediaCard,{"aria-label":"media item",...h,filenameHighlight:(A=h.search_highlight)==null?void 0:A.filename,loading:i,status:(g=r.find(y=>y.id===h.id))==null?void 0:g.status,selected:u.isSelected(h.id),onCardClick:y=>f(h.id,y,"single"),onCheckedChange:(y,C)=>f(h.id,C,"multi"),onAddTagClick:()=>c(h.id)},h.id)}),d.jsx(m.Box,{gridColumn:"1 / -1",justifyContent:"center",children:d.jsx(m.AnimatedElement,{animation:{name:"fade"},children:s&&d.jsx(m.Text,{align:"center",color:"grey11",sx:{marginBlock:8},children:"Loading more items ..."})})})]})}function TH(e){const{children:t,scrollAreaRef:n,onScrollToBottom:r}=e,i=16,o=4,a="250px",s=`calc((100% - ${i*(o-1)}px) / ${o})`;return d.jsx(m.ScrollArea,{"aria-label":"Media list",ref:n,style:{display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(max(${a}, ${s}), 1fr))`,gridTemplateRows:"1fr 1fr 1fr ",gap:i,padding:2,paddingBottom:16,position:"relative"},onScrollToBottom:r,threshold:500,children:t})}function IH(e){const{children:t,hasSelectedMedia:n}=e;return d.jsx(m.Box,{overflow:"hidden",gridColumn:"2 / -1",gridRow:"1 / -1",children:d.jsx(m.ScrollArea,{style:{display:"grid",height:"100%"},children:d.jsx(m.Box,{flexGrow:1,borderRadius:{topRight:8,topLeft:8},borderStyle:n?"solid":"dashed",border:{top:!0,right:!0,left:!0,bottom:!1},minWidth:0,children:t})})})}function EH(e){const{onFilesUpload:t,isUploading:n,isInitialLoad:r=!1}=e,i=r||n;return d.jsxs(m.Box,{flexDirection:"column",justifyContent:"center",alignItems:"center",padding:16,gap:16,width:"100%",children:[d.jsx(m.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple11",backgroundColor:"purple5",size:"large"}),d.jsx(m.Box,{flexDirection:"column",gap:4,children:d.jsxs(m.Text,{align:"center",children:["Select or"," ",d.jsx(m.FileUploadButton,{disabled:i,onFilesSelected:t,renderButton:o=>d.jsx(m.Tooltip,{title:Ed.warning.uploadWhileUploading.title,content:Ed.warning.uploadWhileUploading.description,visible:n,children:d.jsx(m.Box,{display:"inline-flex",as:"span",children:d.jsx(m.Button,{disabled:i,onClick:o,invisible:!0,children:"upload"})})})})," ","media."]})}),d.jsx(m.FileUploadButton,{disabled:i,onFilesSelected:t,color:"grey",children:"Upload media"})]})}function RH(e){const{count:t}=e;return d.jsxs(m.Text,{variant:"bold",children:[t," item",t==1?"":"s"]})}function w2e(e){const{actionContainer:t}=e;return d.jsx(xH,{sidePane:d.jsx(T2e,{}),mediaActions:d.jsx(x2e,{actionContainer:t}),mediaToolbar:d.jsx(m.Skeleton,{color:"grey5",borderRadius:12,children:d.jsx(RH,{count:888})}),mediaList:d.jsx(_2e,{})})}function _2e(){return d.jsx(TH,{children:wt.range(1,24).map(e=>d.jsx($H,{},e))})}function x2e(e){const{actionContainer:t}=e;return d.jsx(wH,{actionContainer:t,children:d.jsxs(m.Box,{width:"100%",gap:16,children:[d.jsx(m.Box,{width:"100%",flexDirection:"column",children:d.jsx(m.FormSearchInput,{placeholder:"Search",maxLength:200,value:"",disabled:!0,onValueChange:()=>{}})}),d.jsx(m.FileUploadButton,{disabled:!0,onFilesSelected:()=>{},startIcon:"cloudUpload",color:t?"purple":"grey",size:"large",children:"Upload media"})]})})}function T2e(){return d.jsx(IH,{hasSelectedMedia:!1,children:d.jsx(EH,{onFilesUpload:()=>{},isUploading:!1,isInitialLoad:!0})})}function $H(){return d.jsx(m.Card,{variant:"outlined",padding:16,children:d.jsxs(m.CardContent,{gap:0,children:[d.jsx(m.Skeleton,{height:185,width:"100%"}),d.jsx(m.Skeleton,{height:16,width:"100%",sx:{marginTop:12}}),d.jsx(m.Skeleton,{height:10,width:100,sx:{marginTop:8}}),d.jsx(m.Skeleton,{height:1,width:"100%",sx:{marginTop:20,marginBottom:16}}),d.jsxs(m.Box,{flexDirection:"row",gap:8,children:[d.jsx(m.Skeleton,{height:24,width:54}),d.jsx(m.Skeleton,{height:24,width:45}),d.jsx(m.Skeleton,{height:24,width:62})]})]})})}const kH=I.createContext({showToast:()=>{}});function I2e(e){const{children:t}=e,[n,r]=I.useState({title:"",seconds:5}),[i,o]=I.useState(!1),{title:a,action:s,seconds:u=1,icon:l="check"}=n,c=I.useMemo(()=>({showToast:f=>{r({seconds:u,...f}),o(!0)}}),[u]);return d.jsxs(d.Fragment,{children:[d.jsx(E2e,{}),d.jsx(m.Toast,{anchor:d.jsx(m.Box,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),open:i,onOpenChange:o,title:a,action:s,seconds:u,icon:l}),d.jsx(kH.Provider,{value:c,children:t})]})}function OH(){return I.useContext(kH)}function E2e(){const{revalidateMedia:e,isMediaCacheInvalid:t}=Tt(),[n,r]=I.useState(t);return ze.useOnChange(t,r),d.jsx(m.Toast,{anchor:d.jsx(m.Box,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),open:n,title:"There have been changes to your media library",action:{title:"Update",onClick:e},cancel:{onClick:()=>r(!1)}})}function Rc(){const{media:e}=Tt(),t=xu();return e.filter(({id:n})=>t.isSelected(n))}function R2e(){const[e,t]=I.useState(!1),n=Rc(),r=xu(),i=I.useMemo(()=>n.some(({id:a})=>a.startsWith("temp")),[n]),[o]=n;return o?r.selectedCount>1?d.jsxs(m.Box,{gap:8,alignItems:"center",children:[d.jsxs(m.Text,{variant:"emphasized",noWrap:!0,sx:{flexGrow:1},children:[r.selectedCount," media selected"]}),d.jsx(m.Tooltip,{content:"Open all selected media in new tabs",children:d.jsx(m.IconButton,{icon:"openInFull",variant:"solid",size:"small",onClick:()=>n.forEach(a=>window.open(a.url,"_blank"))})}),d.jsx(m.Tooltip,{content:"Remove selected media",children:d.jsx(m.IconButton,{icon:"delete",variant:"solid",color:"tomato",size:"small",hiddenLabel:"Remove media",onClick:()=>t(!0),disabled:i})}),d.jsx(DL,{open:e,onOpenChange:t,media:n})]}):d.jsxs(m.Box,{gap:8,alignItems:"center",children:[d.jsx(m.Text,{variant:"emphasized",noWrap:!0,sx:{flexGrow:1},children:o.filename}),d.jsxs(m.Box,{gap:8,children:[d.jsx(m.Tooltip,{content:"Open media in new tab",children:d.jsx(m.IconButton,{icon:"openInFull",variant:"solid",size:"small",hiddenLabel:"Open media in new tab",onClick:()=>window.open(o.url,"_blank"),disabled:i})}),d.jsx(m.Tooltip,{content:"Copy media URL",children:d.jsx(m.IconButton,{icon:"link",variant:"solid",size:"small",hiddenLabel:"Copy media URL",onClick:()=>navigator.clipboard.writeText(o.url),disabled:i})}),d.jsx(m.Tooltip,{content:"Remove media",children:d.jsx(m.IconButton,{icon:"delete",variant:"solid",color:"tomato",size:"small",hiddenLabel:"Remove media",onClick:()=>t(!0),disabled:i})}),d.jsx(DL,{open:e,onOpenChange:t,media:o})]})]}):null}function DL(e){const{open:t,onOpenChange:n,media:r}=e,i=we(),{showAlert:o}=m.useAlert(),{deleteMedia:a}=Tt(),s=xu(),u=gH(),[l,c]=I.useState(!1),f=Array.isArray(r),p=f?"these items":"this item";function h(){c(!0);const g=s.getSelectionState().selectedIds;k2e({ids:g,config:i}).then(()=>{n(!1),a(g),s.clearSelection(),u()}).catch(()=>{n(!1),o({title:"Error",subtitle:`Something went wrong when removing ${p}.`})}).finally(()=>{c(!1)})}return d.jsxs(m.Dialog,{onOpenChange:n,open:t,size:"small",children:[d.jsx(m.DialogHeader,{icon:"alert",title:`Remove ${p} from your media library?`}),d.jsx(m.DialogDescription,{asChild:!0,children:d.jsx(m.DialogContent,{children:d.jsxs(m.Box,{padding:16,flexDirection:"column",children:[d.jsxs(m.Text,{children:["You are about to delete ",p,": ",!f&&d.jsx("b",{children:r.filename})]}),f&&d.jsx($2e,{media:r})]})})}),d.jsxs(m.DialogActions,{children:[d.jsx(m.DialogCancelButton,{}),d.jsxs(m.DialogActionButton,{onClick:h,color:"tomato",loading:l,children:["Yes, I want to remove ",p]})]})]})}const RS=15;function $2e(e){const{media:t}=e,n=t.slice(0,RS),r=t.length>RS,i=r?t.length-RS:0,o=ri.pluralize(i,"item");return d.jsxs(m.UnorderedList,{density:"compact",sx:{marginTop:8},children:[n.map((a,s)=>d.jsx(m.ListItem,{children:d.jsx("b",{children:a.filename})},s)),r&&d.jsxs(m.ListItem,{children:["And ",d.jsx("b",{children:i})," more ",o,"..."]})]})}function k2e(e){const{ids:t,config:n}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");if(t.length===0)throw new Error("No ids provided during media deletion");const{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n;if(t.length===1){const[a]=t;return se.request(new URL(`assets/${a}`,r),{headers:{repository:i},method:"DELETE",credentials:se.getRequestCredentials(o),okType:k.unknown()})}return se.request(new URL("assets/bulk-delete",r),{headers:{repository:i},method:"POST",credentials:se.getRequestCredentials(o),okType:k.unknown(),body:{ids:t}})}const Es=2e3,fp="__MAIN_THUMBNAIL__";function Xw(e,t,n){const r=e.name===fp?void 0:e.name;let i;return t?Qi.isDefined(n)?i=[n.width,n.height]:Qi.isDefined(e.width)||Qi.isDefined(e.height)?i=[e.width??void 0,e.height??void 0]:i=[t.origin.width,t.origin.height]:i=void 0,[r,i?`${i[0]??"auto"}×${i[1]??"auto"}px`:void 0]}function O2e(e){var t,n;return[{...(t=e.config)==null?void 0:t.constraint,name:fp}].concat(((n=e.config)==null?void 0:n.thumbnails)??[])}function M2e(e,t){var a,s;const{__TYPE__:n,thumbnails:r,...i}=t,o=(s=(a=e.config)==null?void 0:a.thumbnails)==null?void 0:s.map(({name:u})=>r==null?void 0:r[u]);return[i,...o??[]]}function F2e(e,t,n,r){const i=r.length===0?void 0:r;return e===fp||!fe.isImageContent(t)?{...t,alt:i}:{...t,thumbnails:{...t.thumbnails,[e]:{...n,alt:i}}}}function j2e(e,t){const{width:n,height:r}=t??{};return n&&r?[n,r]:n?[n,Math.round(e.height*(n/e.width))]:r?[Math.round(e.width*(r/e.height)),r]:[e.width,e.height]}function L2e(e,t,n,r,i){if(N2e(e)==="svg")return e;const o=new URL(e);if(i){const{x:a,y:s,width:u,height:l}=t,c=[...o.searchParams.entries(),["rect",[a,s,u,l].join(",")],["w",n],["h",r]];o.search=c.map(f=>f.join("=")).join("&")}return o.toString()}function tF(e,t){const n=new URL(e.split("?")[0]??e);return t!=null&&t.width&&n.searchParams.set("w",t.width.toString()),t!=null&&t.height&&n.searchParams.set("h",t.height.toString()),(t!=null&&t.width||!(t!=null&&t.height))&&n.searchParams.set("dpr",Math.max(1,Math.min(window.devicePixelRatio,3)).toString()),t!=null&&t.width&&(t!=null&&t.height)&&n.searchParams.set("fit","max"),n.searchParams.set("auto","compress,format"),n.toString()}function D2e(e){return tF(e,{width:300})}function MH(e){return tF(e,{width:800,height:800})}function U2e(e){return e!=null&&e.url?MH(e.url):void 0}function B2e(e,t,n,r){var s,u,l,c,f;if(!n||e===fp){const p=(s=t.config)==null?void 0:s.thumbnails,h=p&&Object.fromEntries(p.map(A=>[A.name,Ug(r,A)]));return{__TYPE__:"ImageContent",...Ug(r,(u=t.config)==null?void 0:u.constraint),thumbnails:h}}const i=(c=(l=t.config)==null?void 0:l.thumbnails)==null?void 0:c.find(p=>p.name===e);if(!i)return n;const o=(f=n.thumbnails)==null?void 0:f[e],a=Ug(r,i);return a.url===(o==null?void 0:o.url)?n:{...n,thumbnails:Pd.mapValues(n.thumbnails??{},(p,h)=>h===e?a:p)}}function P2e(e){return"kind"in e&&"extension"in e}function Ug(e,t){const{width:n,height:r,rect:i}=W2e({...e,width:(e==null?void 0:e.width)??Es,height:(e==null?void 0:e.height)??Es},t),o=!!(t!=null&&t.width||t!=null&&t.height);return{provider:"imgix",url:L2e(e.url,i,n,r,o),alt:e.alt,...P2e(e)?{credits:e.credits}:{},origin:{id:e.id,url:e.url,width:e.width??Es,height:e.height??Es},width:n,height:r,edit:{background:"transparent",zoom:1,crop:{x:i.x,y:i.y}}}}function W2e(e,t){const[n,r]=j2e(e,t),i=Math.max(n/e.width,r/e.height),o=Math.round((e.width-n/i)/2),a=Math.round((e.height-r/i)/2),s=Math.round(n/i),u=Math.round(r/i);return{width:n,height:r,rect:{x:o,y:a,width:s,height:u}}}function N2e(e){const{pathname:t}=new URL(e),n=t.lastIndexOf(".");if(n!==-1)return t.substring(n).slice(1).toLowerCase()}function K2e(e){if(!e)return"";const{filename:t,extension:n}=e;return!n||!t.endsWith(`.${n}`)?t:t.slice(0,-n.length-1)}function q2e(){var o;const e=Rc(),{uploadingFiles:t}=Tt(),[n]=e;if(!n)return null;if(e.length===2)return d.jsx($S,{children:e.map((a,s)=>d.jsx("div",{style:{position:"absolute",transform:s===0?"translateX(25%) rotate(15deg) ":"translateX(-25%) rotate(-15deg) "},children:d.jsx(UL,{media:a})},a.id))});if(e.length>2)return d.jsx($S,{children:e.slice(-4).map((a,s)=>d.jsx("div",{style:{position:"absolute",paddingRight:s*16},children:d.jsx(UL,{media:a})},a.id))});const r=(o=t.find(a=>a.id===n.id))==null?void 0:o.status,i=n.kind.startsWith("image");return d.jsx(m.Box,{flexDirection:"column",children:d.jsx(m.CheckerBoard,{children:d.jsx($S,{uploadStatus:r,hasImage:i,children:i?d.jsx(m.Image,{src:n.url,alt:n.alt,sizing:"contain"}):d.jsx(m.MediaCardPlaceholder,{kind:n.kind,filename:n.filename})})})})}function $S(e){const{children:t,uploadStatus:n,hasImage:r}=e;return d.jsxs(m.Box,{flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",height:200,width:"100%",backgroundColor:r?"transparent":"purple2",children:[t,n&&d.jsx(V2e,{uploadStatus:n})]})}function V2e(e){const{uploadStatus:t}=e,{value:n,color:r,height:i,transition:o}=z2e(t);return d.jsx(m.Box,{position:"absolute",backgroundColor:"greyAlpha1",width:"100%",height:"100%",padding:{inline:16},justifyContent:"end",flexDirection:"column",children:d.jsx(m.ProgressBar,{value:n,color:r,height:i,transition:o})})}function z2e(e){switch(e){case"idle":return{value:0,height:"collapsed",color:"grey4"};case"uploading":return{value:90,transition:"slow",color:"purple9"};case"success":return{value:100,height:"collapsed",color:"purple9"};case"error":return{value:100,color:"tomato11"}}}function UL(e){const{media:t}=e;return d.jsx(m.Box,{width:111,height:152,children:t.kind==="image"?d.jsx(m.Image,{borderRadius:8,src:tF(t.url,{width:111,height:152}),alt:t.alt,sizing:"cover"}):d.jsx(m.MediaCardPlaceholder,{kind:t.kind,filename:t.filename})})}function Q2e(e){const t=e.length,n={},r=[];return e.forEach(o=>{o.tags.forEach(a=>{n[a.id]||(n[a.id]=0,r.push(a)),n[a.id]++})}),r.filter(o=>n[o.id]===t)}function FH(e){const{tags:t,toggleAssetTag:n,getTagsLabel:r}=e,{setTagManagerOpen:i}=Tt(),{showToast:o}=OH(),{showAlert:a}=m.useAlert(),[s,u]=I.useState("");async function l(c,f){u("");try{await n(c,f),o({title:"Media tags were updated",seconds:3})}catch{a({title:"Error",subtitle:"Something went wrong when updating media tags"})}}return d.jsxs(m.Box,{flexDirection:"column",children:[d.jsxs(m.Box,{justifyContent:"space-between",children:[d.jsx(m.Text,{color:"grey12",variant:"bold",children:r()}),d.jsx(m.Button,{startIcon:"edit",invisible:!0,color:"dark",onClick:()=>i(!0),children:"Manage tags"})]}),d.jsxs(m.ComboBox,{sx:{marginTop:4,marginBottom:8},children:[d.jsx(H2e,{searchTerm:s,setSearchTerm:u}),d.jsx(m.ComboBoxContent,{children:d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(m.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting tags"}),children:d.jsx(I.Suspense,{fallback:d.jsx(m.Box,{padding:8,flexDirection:"column",gap:8,children:wt.range(1,6).map(c=>d.jsx(m.Skeleton,{height:24,width:85},c))}),children:d.jsx(Y2e,{searchTerm:s,assignedTags:t,onToggleAssetTag:l})})})})]}),d.jsx(m.Box,{flexDirection:"column",alignItems:"flex-start",gap:8,children:t.map(c=>d.jsx(m.Badge,{title:c.name,size:"medium",color:"purple",selected:!0,onClose:()=>l(c,"remove")},c.id))})]})}function H2e(e){const{searchTerm:t,setSearchTerm:n}=e,r=I.useRef(null),{openMediaSection:i,setOpenMediaSection:o}=Tt();return I.useEffect(()=>{var a;i==="tags"&&((a=r.current)==null||a.focus(),o(void 0))},[i,o]),d.jsx(m.ComboBoxInput,{value:t,onValueChange:n,placeholder:"Add or create a new tag",ref:r})}function Y2e(e){const{searchTerm:t,assignedTags:n,onToggleAssetTag:r}=e,[i]=Rc(),o=we(),{showAlert:a}=m.useAlert(),{tags:s}=Qm(),u=I.useMemo(()=>{const p=t.toLowerCase();return s.filter(h=>h.name.toLowerCase().includes(p))},[s,t]),c=XM.safeParse(t).success&&s.every(p=>p.name!==t);async function f(){if(!t||!i)return;let p;try{p=await G2e({name:t,config:o}),Hm(h=>[p,...h])}catch{a({title:"Error",subtitle:`Something went wrong when creating the tag ${t}`});return}await r(p,"add")}return i?d.jsxs(d.Fragment,{children:[!u.length&&d.jsx(m.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"No tags found"}),u.map((p,h)=>d.jsx(m.ComboBoxItem,{value:p.id,onCheckedChange:A=>r(p,A?"add":"remove"),checked:n.some(A=>A.id===p.id),children:d.jsx(m.Badge,{title:p.name,color:"purple",size:"medium",sx:{marginInline:8,marginBottom:h===u.length-1?8:4,marginTop:h===0?8:4}})},p.id)),c&&d.jsx(m.ComboBoxItem,{value:"new",onCheckedChange:f,children:d.jsxs(m.Box,{padding:8,flexDirection:"row",alignItems:"center",gap:4,children:[d.jsx(m.Icon,{name:"add",size:"small",color:"grey11"}),d.jsxs(m.Text,{color:"grey12",children:['Create tag "',t,'"']})]})})]}):null}function G2e(e){const{name:t,config:n}=e;n.mediaLibrary||Rt("mediaLibrary");const{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n;return se.request(new URL("tags",r),{headers:{repository:i},body:{name:t},method:"POST",credentials:se.getRequestCredentials(o),okType:eF})}function J2e(e){const{selectedMedia:t}=e,n=we(),r=I.useMemo(()=>Q2e(t),[t]);async function i(a,s){const u=s==="remove",l=t.map(f=>f.id);let c=[];Cl(f=>(c=f,f.map(p=>l.includes(p.id)?u?eDe(p,a):X2e(p,a):p)));try{await Z2e({tagId:a.id,assetIds:l,operation:u?"remove":"add",config:n});const f=t.length*(u?-1:1);Hm(p=>p.map(h=>h.id===a.id?{...h,count:h.count+f}:h))}catch(f){throw Cl(()=>c),f}}function o(){const a=r.length;return a>1?`${a} tags in common`:a===1?"1 tag in common":"Common tags"}return d.jsx(FH,{tags:r,getTagsLabel:o,toggleAssetTag:i})}function Z2e(e){const{tagId:t,assetIds:n,config:r,operation:i}=e;if(!r.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:o,repository:a,authStrategy:s}=r;return se.request(new URL(`tags/${t}/assets`,o),{headers:{repository:a},body:{assetIds:n},method:i==="add"?"POST":"DELETE",credentials:se.getRequestCredentials(s),okType:k.unknown()})}function X2e(e,t){return e.tags.some(({id:r})=>r===t.id)?e:{...e,tags:[...e.tags,t]}}function eDe(e,t){const n=e.tags.filter(r=>r.id!==t.id);return{...e,tags:n}}function tDe(e){const{selectedMedia:t}=e,n=t.tags,r=we(),{updateMedia:i}=Tt();async function o(s,u){const l=t.tags,c=u==="remove",f=c?l.filter(p=>p.id!==s.id):[...l,s];i(t.id,{tags:f});try{await nDe({mediaId:t.id,config:r,tags:f.map(p=>p.id)}),Hm(p=>p.map(h=>h.id===s.id?{...h,count:h.count+(c?-1:1)}:h))}catch(p){throw i(t.id,{tags:l}),p}}function a(){const s=n.length;return s>1?`${s} tags`:s===1?"1 tag":"Tags"}return d.jsx(FH,{tags:n,getTagsLabel:a,toggleAssetTag:o})}function nDe(e){const{mediaId:t,config:n,tags:r}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:i,repository:o,authStrategy:a}=n;return se.request(new URL(`assets/${t}`,i),{headers:{repository:o},body:{tags:r},method:"PATCH",credentials:se.getRequestCredentials(a),okType:X1})}function rDe(){const[e,t]=I.useState("description");if(Rc().length!==1)return d.jsx(uDe,{});const r=e==="description",i=e==="more-info";return d.jsxs(d.Fragment,{children:[d.jsxs(m.Box,{display:"grid",gridTemplateColumns:"1fr 1fr",backgroundColor:"grey2",border:!0,borderStyle:"solid",borderRadius:8,children:[d.jsx(m.Tab,{selected:r,outline:r,transparent:!0,onClick:()=>t("description"),children:"Description"}),d.jsx(m.Tab,{selected:i,outline:i,transparent:!0,onClick:()=>t("more-info"),children:"More info"})]}),d.jsx(iDe,{tab:e})]})}function iDe(e){const{tab:t}=e;switch(t){case"description":return d.jsx(oDe,{});case"more-info":return d.jsx(aDe,{})}}function oDe(){const{title:e,alt:t,onBlur:n,isUploading:r,selectedMedia:i}=LH();if(!i)return null;const{extension:o}=i;return d.jsxs(m.Box,{flexDirection:"column",gap:16,children:[d.jsx(m.FormInput,{value:e.value,onValueChange:e.set,label:"Media title",placeholder:"Media title",onBlur:n,disabled:r,suffix:o?`.${o}`:void 0}),d.jsx(m.FormInputField,{label:"Alternative text",children:d.jsx(m.ContentEditable,{content:t.displayValue,contentVersion:t.version,readOnly:r,placeholder:"A short description of the media for accessibility",multiline:!0,decorations:{em:"highlight"},onChange:t.onChange,onBlur:n})}),!r&&d.jsx(tDe,{selectedMedia:i})]})}function aDe(){const{credits:e,notes:t,onBlur:n,isUploading:r,selectedMedia:i}=LH();if(!i)return null;const{uploader_id:o}=i,a=dDe(i);return d.jsxs(m.Box,{gap:8,flexDirection:"column",children:[a.map(s=>d.jsxs(m.Box,{gap:8,children:[d.jsxs(m.Text,{color:"grey11",children:[s.label,":"]}),d.jsx(m.Text,{children:s.value})]},s.label)),d.jsxs(m.Box,{gap:8,children:[d.jsx(m.Text,{color:"grey11",children:"Uploaded by:"}),d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(m.Text,{color:"grey11",children:"Error getting uploader"}),children:d.jsx(I.Suspense,{fallback:d.jsx(jH,{}),children:d.jsx(sDe,{uploaderId:o})})})]}),d.jsx(m.FormInputField,{label:"Copyright",children:d.jsx(m.ContentEditable,{content:e.displayValue,contentVersion:e.version,readOnly:r,placeholder:"Media copyrights or credits",multiline:!0,decorations:{em:"highlight"},onChange:e.onChange,onBlur:n})}),d.jsx(m.FormInputField,{label:"Private notes",children:d.jsx(m.ContentEditable,{content:t.displayValue,contentVersion:t.version,readOnly:r,placeholder:"Private notes are never shared publicly",multiline:!0,decorations:{em:"highlight"},onChange:t.onChange,onBlur:n})})]})}function sDe(e){const{uploaderId:t}=e,{uploadersById:n}=AH(),r=n.get(t??"ghost");return t&&!r?d.jsx(jH,{}):r?d.jsxs(d.Fragment,{children:[d.jsx(m.Avatar,{size:24,firstName:r.firstName,lastName:r.lastName,imageUrl:r.uploadedAvatar,hasBorder:!1}),d.jsx(m.Text,{children:r.name})]}):null}function jH(){return d.jsx(m.Skeleton,{width:128})}function uDe(){const e=Rc(),{uploadingFiles:t}=Tt(),n=I.useMemo(()=>t.some(r=>e.some(i=>r.id===i.id)&&r.status!=="success"),[e,t]);return d.jsx(d.Fragment,{children:!n&&d.jsx(J2e,{selectedMedia:e})})}function LH(){const[e]=Rc(),{updateMedia:t,uploadingFiles:n}=Tt(),r=we(),{showToast:i}=OH(),o=(e==null?void 0:e.id)??"",a=yg(e,"alt"),s=yg(e,"notes"),u=yg(e,"credits"),l=yg(e,"filename",K2e),c=n.some(p=>p.id===(e==null?void 0:e.id)&&p.status!=="success");async function f(){if(!e||!l.changed&&!a.changed&&!u.changed&&!s.changed)return;const{extension:p,search_highlight:h}=e,A=p?`${l.value}.${p}`:l.value;t(o,{filename:A,alt:a.value,credits:u.value,notes:s.value,search_highlight:{alt:a.changed||h==null?void 0:h.alt,credits:u.changed||h==null?void 0:h.credits,filename:l.changed||h==null?void 0:h.filename,notes:s.changed||h==null?void 0:h.notes}}),await cDe({id:o,config:r,metadata:{filename:A,alt:a.value,credits:u.value,notes:s.value}}),i({title:"Media metadata has been saved.",seconds:3})}return{selectedMedia:e,onBlur:f,isUploading:c,title:l,alt:a,credits:u,notes:s,extension:e==null?void 0:e.extension}}function yg(e,t,n=r=>r==null?void 0:r[t]){var l;const r=n(e)??"",[i,o]=I.useState(r);ze.useOnChange(e==null?void 0:e.id,()=>o(r));const a=(l=e==null?void 0:e.search_highlight)==null?void 0:l[t],s=!!a;function u(c){const{from:f,to:p}=c.state.selection;c.commands.selectAll(),c.commands.unsetAllMarks(),c.commands.setTextSelection({from:f,to:p}),o(c.getText())}return{value:i,set:o,displayValue:lDe(a??i)??"",onChange:u,version:`${(e==null?void 0:e.id)??""}_${s}`,changed:i!==r}}function lDe(e){return e==null?void 0:e.replace(/\n/g,"<br>")}function cDe(e){const{id:t,config:n,metadata:r}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:i,repository:o,authStrategy:a}=n;return se.request(new URL(`assets/${t}`,i),{headers:{repository:o},body:{...r},method:"PATCH",credentials:se.getRequestCredentials(a),okType:X1})}function dDe(e){const{width:t,height:n,last_modified:r,size:i,extension:o}=e,a=t&&n,s={label:"Date",value:rx.prettyPrintDate(new Date(r))},u={label:"File size",value:ri.formatBytes(i)},l=a?{label:"Dimensions",value:`${t}×${n}`}:void 0,c=a?{label:"Ratio",value:((t??0)/(n??0)).toFixed(1)}:void 0,f=o?{label:"Extension",value:o.toUpperCase()}:void 0;return[s,u,l,c,f].filter(Qi.isDefined)}function fDe(){const{setTagManagerOpen:e}=Tt(),[t,n]=I.useState("");return d.jsxs(m.Box,{gap:20,flexDirection:"column",height:"100%",children:[d.jsxs(m.Box,{alignItems:"center",gap:4,children:[d.jsx(m.IconButton,{icon:"close",size:"small",hasPadding:!1,onClick:()=>e(!1)}),d.jsx(m.Text,{variant:"bold",children:"Tags management"})]}),d.jsxs(m.Box,{gap:16,flexDirection:"column",height:"100%",children:[d.jsx(m.FormSearchInput,{value:t,onValueChange:n,placeholder:"Search for tags",endAdornment:!1,autoFocus:!0}),d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(mDe,{}),children:d.jsx(I.Suspense,{fallback:d.jsx(yDe,{}),children:d.jsx(pDe,{searchTerm:t})})})]})]})}function pDe(e){const{searchTerm:t}=e,{tags:n}=Qm(),r=n.filter(i=>i.name.toLowerCase().includes(t.toLowerCase()));return r.length===0?d.jsx(m.Text,{color:"grey9",variant:"small",children:"No tags found"}):d.jsx(m.AnimatedList,{ariaLabel:"Tags list",getItemKey:i=>i.id,gap:16,items:r,children:i=>d.jsx(hDe,{tag:i})})}function hDe(e){const{tag:t}=e,[n,r]=I.useState(!1),i=we(),{showAlert:o}=m.useAlert(),{showToast:a}=m.useToast(),{tags:s}=Qm();async function u(l){if(!XM.safeParse(l).success){o({title:"Error",subtitle:`Failed to rename tag "${t.name}" to "${l}". Tag name must be at least ${uH} and at maximum ${lH} characters long.`});return}if(s.some(p=>p.name===l)){o({title:"Error",subtitle:`Failed to rename tag "${t.name}" to "${l}". Tag with name "${l}" already exists.`});return}try{await vDe({id:t.id,name:l,config:i}),Hm(p=>p.map(h=>h.id===t.id?{...h,name:l}:h)),Cl(p=>p.map(h=>{if(h.tags.findIndex(g=>g.id===t.id)!==-1){const g=h.tags.map(y=>y.id===t.id?{...y,name:l}:y);return{...h,tags:g}}return h})),a({title:`Tag "${t.name}" renamed to "${l}"`,seconds:3})}catch{o({title:"Error",subtitle:"Something went wrong when renaming the tag."})}}return d.jsxs(d.Fragment,{children:[d.jsxs(m.Box,{justifyContent:"space-between",children:[d.jsx(m.Badge,{title:t.name,color:"purple",size:"medium",onEdit:u}),d.jsx(m.Button,{invisible:!0,color:"tomato",textWeight:"normal",onClick:()=>r(!0),children:"Delete"})]}),d.jsx(ADe,{open:n,onOpenChange:r,tag:t})]})}function ADe(e){const{open:t,onOpenChange:n,tag:r}=e,{id:i,name:o,count:a}=r,s=we(),{showAlert:u}=m.useAlert(),[l,c]=I.useState(!1);async function f(){c(!0);try{await gDe({id:i,config:s}),Hm(p=>p.filter(h=>h.id!==i)),Cl(p=>p.map(h=>{if(h.tags.findIndex(g=>g.id===i)!==-1){const g=h.tags.filter(y=>y.id!==i);return{...h,tags:g}}return h}))}catch{u({title:"Error",subtitle:"Something went wrong when removing the tag."})}finally{c(!1),n(!1)}}return d.jsxs(m.Dialog,{onOpenChange:n,open:t,size:"small",children:[d.jsx(m.DialogHeader,{title:`This tag is being used on ${a} media ${ri.pluralize(a,"item")}`}),d.jsx(m.DialogDescription,{asChild:!0,children:d.jsx(m.DialogContent,{padding:16,children:d.jsxs(m.Text,{children:["You are about to delete the tag name ",d.jsx("b",{children:o}),"."," ",a>0&&`This tag is being used on ${a} media ${ri.pluralize(a,"item")} and will be deleted from ${ri.pluralize(a,"it","them")}.`]})})}),d.jsxs(m.DialogActions,{children:[d.jsx(m.DialogCancelButton,{}),d.jsx(m.DialogActionButton,{onClick:f,color:"tomato",loading:l,children:"Yes, I want to delete"})]})]})}function mDe(){const e=I.useContext(et.ErrorBoundaryContext);return d.jsx(m.Box,{flexDirection:"column",children:d.jsxs(m.BlankSlate,{children:[d.jsx(m.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed"}),d.jsx(m.BlankSlateTitle,{size:"big",children:"Oops!"}),d.jsx(m.BlankSlateDescription,{width:360,children:"We couldn't load your media tags."}),d.jsx(m.BlankSlateActions,{children:d.jsx(m.Button,{onClick:e==null?void 0:e.reset,size:"medium",children:"Try again"})})]})})}function gDe(e){const{id:t,config:n}=e;n.mediaLibrary||Rt("mediaLibrary");const{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n;return se.request(new URL(`tags/${t}`,r),{headers:{repository:i},method:"DELETE",credentials:se.getRequestCredentials(o),okType:k.unknown()})}function vDe(e){const{id:t,name:n,config:r}=e;r.mediaLibrary||Rt("mediaLibrary");const{assetsApiBaseUrl:i,repository:o,authStrategy:a}=r;return se.request(new URL(`tags/${t}`,i),{headers:{repository:o},method:"PATCH",credentials:se.getRequestCredentials(a),body:{name:n},okType:k.unknown()})}function yDe(){return d.jsx(m.Box,{flexDirection:"column",gap:16,children:wt.range(1,6).map(e=>d.jsxs(m.Box,{justifyContent:"space-between",children:[d.jsx(m.Skeleton,{height:24,width:85}),d.jsx(m.Skeleton,{height:24,width:45})]},e))})}function bDe(){const e=Rc(),{onFilesUpload:t,isUploading:n,tagManagerOpen:r}=Tt();return e.length===0&&r===!1?d.jsx(EH,{onFilesUpload:t,isUploading:n}):d.jsx(m.Box,{flexDirection:"column",backgroundColor:"grey1",width:"100%",padding:16,gap:16,borderRadius:{topLeft:8,topRight:8},children:r?d.jsx(fDe,{}):d.jsxs(d.Fragment,{children:[d.jsx(R2e,{}),d.jsx(q2e,{}),d.jsx(rDe,{})]})})}function CDe(){const e=xu();return d.jsx(IH,{hasSelectedMedia:e.selectedCount!==0,children:d.jsx(bDe,{})})}const e_={all:{name:"All media",icon:"public"},image:{name:"Images",icon:"image"},video:{name:"Videos",icon:"videocam"},document:{name:"Documents",icon:"insertDriveFile"},audio:{name:"Audio files",icon:"musicNote"}},SDe=Object.entries(e_);function wDe(){const{assetType:e,initialAssetType:t,onFilterChange:n}=Tt(),[r,i]=I.useState(e);ze.useOnChange(e,()=>{i(e)});const[o,a]=I.useState(!1);function s(p){a(!1),i(p),n({assetType:p})}const{icon:u,name:l}=e_[r],c=e_[t].name,f=t!=="all";return d.jsxs(m.DropdownMenu,{open:o,onOpenChange:a,children:[d.jsx(m.DropdownMenuTrigger,{disabled:f,children:d.jsx(_De,{icon:u,isDropdownDisabled:f,buttonName:l,tooltipAssetTypeName:c})}),d.jsx(m.DropdownMenuContent,{minWidth:256,align:"start",childrenFocusScope:!0,children:d.jsx(d.Fragment,{children:SDe.filter(([p])=>p!==r).map(([p,{icon:h,name:A}])=>d.jsx(m.DropdownMenuItem,{startIcon:d.jsx(m.Icon,{name:h}),onSelect:()=>s(p),children:A},p))})})]})}const _De=I.forwardRef(function(t,n){const{icon:r,isDropdownDisabled:i,buttonName:o,tooltipAssetTypeName:a,...s}=t;return d.jsx(m.Tooltip,{content:`You can only pick ${(a==null?void 0:a.toLocaleLowerCase())??"this type of media"}`,visible:i,children:d.jsx(m.Button,{startIcon:r,endIcon:"arrowDropDown",size:"small",color:"grey",disabled:i,ref:n,...s,children:o})})});function xDe(e){const{optimisticTagIds:t,setOptimisticTagIds:n}=e,{onFilterChange:r}=Tt(),{tags:i}=Qm(),o=I.useMemo(()=>dX.groupBy(i,s=>s.id),[i]);function a(s){const u=t.filter(l=>l!==s.id);n(u),r({tagIds:u})}return d.jsx(d.Fragment,{children:t.map(s=>{var l;const u=(l=o.get(s))==null?void 0:l[0];return u?d.jsx(m.Badge,{title:u.name,size:"medium",color:"purple",onClose:()=>a(u),selected:!0},u.id):null})})}function TDe(){const{setTagManagerOpen:e,tagIds:t,onFilterChange:n}=Tt(),[r,i]=I.useState(""),[o,a]=I.useState(!1),[s,u]=I.useState(t);ze.useOnChange(JSON.stringify(t),()=>{u(t)});function l(p){a(p),p||i("")}function c(p){const h=s.includes(p.id)?t.filter(A=>A!==p.id):[...t,p.id];u(h),n({tagIds:h}),a(!1)}function f(){a(!1),e(!0)}return d.jsxs(d.Fragment,{children:[d.jsxs(m.DropdownMenu,{open:o,onOpenChange:l,children:[d.jsx(m.DropdownMenuTrigger,{children:d.jsx(m.Button,{startIcon:"label",endIcon:"arrowDropDown",size:"small",color:"grey",children:"Tags"})}),d.jsx(m.DropdownMenuContent,{minWidth:256,align:"start",border:!1,childrenFocusScope:!0,children:d.jsxs(m.ComboBox,{variant:"attached",children:[d.jsx(m.ComboBoxInput,{value:r,onValueChange:i,placeholder:"Search for a tag",autoFocus:!0}),d.jsx(m.ComboBoxContent,{paddingBlock:4,children:d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(m.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting tags"}),children:d.jsx(I.Suspense,{fallback:d.jsx(m.Box,{padding:8,flexDirection:"column",gap:8,children:wt.range(1,6).map(p=>d.jsx(m.Skeleton,{height:24,width:85},p))}),children:d.jsx(IDe,{searchTerm:r,setSearchTerm:i,onTagToggle:c,optimisticTagIds:s})})})}),d.jsx(m.ComboboxAction,{children:d.jsx(m.Button,{invisible:!0,startIcon:"edit",textWeight:"normal",color:"dark",onClick:f,children:"Manage tags"})})]})})]}),s.length>0&&d.jsx(m.ErrorBoundary,{children:d.jsx(I.Suspense,{children:d.jsx(xDe,{optimisticTagIds:s,setOptimisticTagIds:u})})})]})}function IDe(e){const{onTagToggle:t,searchTerm:n,optimisticTagIds:r}=e,{tags:i}=Qm(),o=I.useMemo(()=>{const a=n.toLowerCase();return i.filter(s=>s.name.toLowerCase().includes(a))},[i,n]);return d.jsxs(d.Fragment,{children:[!o.length&&d.jsx(m.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"No tags found"}),o.map(a=>{const s=r.includes(a.id);return d.jsx(m.ComboBoxItem,{value:a.id,onCheckedChange:()=>t(a),checked:s,children:d.jsx(m.Badge,{title:a.name,color:"purple",sx:{marginLeft:8,marginBottom:4,marginTop:4},size:"medium"})},a.id)})]})}function EDe(){const{uploaderId:e,onFilterChange:t}=Tt(),[n,r]=I.useState(""),[i,o]=I.useState(!1),[a,s]=I.useState();ze.useOnChange(e,()=>{e||s(void 0)});function u(c){o(c),c||r("")}function l(c){s(c),t({uploaderId:c==null?void 0:c.id}),o(!1)}return d.jsxs(m.DropdownMenu,{open:i,onOpenChange:u,children:[d.jsx(m.DropdownMenuTrigger,{children:d.jsx(m.Button,{startIcon:"people",renderStartIcon:c=>a?d.jsx(m.Avatar,{imageUrl:a==null?void 0:a.uploadedAvatar,firstName:a.firstName,lastName:a.lastName,size:16,hasBorder:!1}):c,endIcon:"arrowDropDown",size:"small",color:"grey",children:(a==null?void 0:a.name)??"All uploaders"})}),d.jsx(m.DropdownMenuContent,{minWidth:256,align:"start",border:!1,childrenFocusScope:!0,children:d.jsxs(m.ComboBox,{variant:"attached",children:[d.jsx(m.ComboBoxInput,{value:n,onValueChange:r,placeholder:"Search for uploaders",autoFocus:!0}),d.jsx(m.ComboBoxContent,{paddingBlock:4,children:d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(m.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting uploaders"}),children:d.jsx(I.Suspense,{fallback:d.jsx($De,{}),children:d.jsx(RDe,{searchTerm:n,setSearchTerm:r,onUploaderToggle:l,optimisticUploader:a})})})})]})})]})}function RDe(e){const{searchTerm:t,optimisticUploader:n,onUploaderToggle:r}=e,{uploaders:i}=AH(),o=I.useMemo(()=>{const a=t.toLowerCase();return wt.sort(i.filter(s=>{var u;return s.name.toLowerCase().includes(a)||((u=s.email)==null?void 0:u.toLowerCase().includes(a))}),s=>(n==null?void 0:n.id)===(s==null?void 0:s.id)?0:1)},[i,n,t]);return o.length?d.jsx(d.Fragment,{children:o.map(a=>{const s=a.id===(n==null?void 0:n.id);return d.jsx(m.ComboBoxItem,{value:a.id,onCheckedChange:()=>s?r():r(a),checked:s,children:d.jsxs(m.Box,{alignItems:"center",padding:{top:8,bottom:8,left:16,right:16},gap:8,children:[d.jsx(m.Avatar,{firstName:a.firstName,lastName:a.lastName,imageUrl:a.uploadedAvatar,hasBorder:!1}),d.jsxs(m.Box,{display:"flex",flexDirection:"column",children:[d.jsx(m.Text,{color:"grey12",variant:"normal",children:a.name}),a.email&&d.jsx(m.Text,{color:"grey10",variant:"small",children:a.email})]})]})},a.id)})}):d.jsx(m.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"No uploaders found"})}function $De(){return d.jsx(m.Box,{padding:8,flexDirection:"column",gap:8,children:wt.range(1,4).map(e=>d.jsx(m.Skeleton,{height:48,width:"full"},e))})}function kDe(){const{media:e,mediaTotal:t}=Tt(),n=xu();return d.jsxs(m.Box,{alignItems:"center",gap:16,children:[n.isSelectAllEnabled&&d.jsx(m.Checkbox,{onCheckedChange:n.toggleSelectAll,checked:n.selectedCount>0,indeterminate:n.selectedCount!==t,onClick:r=>r.stopPropagation(),disabled:e.length===0}),e.length!==0&&d.jsx(RH,{count:t}),d.jsxs(m.Box,{gap:8,alignItems:"center",children:[d.jsx(m.Text,{children:"Filter:"}),d.jsx(wDe,{}),d.jsx(EDe,{}),d.jsx(TDe,{})]})]})}function DH(e){const{assetType:t,onSelectedChange:n,actionContainer:r}=e;return d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(_H,{}),children:d.jsx(I.Suspense,{fallback:d.jsx(w2e,{actionContainer:r}),children:d.jsx(SQ,{children:d.jsx(h2e,{assetType:t,actionContainer:r,onSelectedChange:n,children:d.jsx(b2e,{children:d.jsx(ODe,{})})})})})})}function ODe(){const{media:e}=Tt(),t=bH();return d.jsx(I2e,{children:d.jsx(xH,{sidePane:t?void 0:d.jsx(CDe,{}),mediaActions:d.jsx(v2e,{}),mediaToolbar:d.jsx(kDe,{}),mediaList:e.length===0?d.jsx(m2e,{}):d.jsx(S2e,{})})})}function MDe(e){const{href:t,tracking:n}=e;return d.jsx(m.Box,{justifyContent:"center",padding:{block:6},children:d.jsxs(m.Text,{href:t,variant:"smallBold",color:"grey11",onClick:()=>void n.track({event:"shared-onboarding:follow-tutorial",source:n.source}),children:["Or watch our in-depth course",d.jsx(m.Icon,{name:"playCircle",color:"grey11",size:"small",sx:{marginLeft:4}})]})})}function FDe(e){const{step:t,stepIndex:n,isOpen:r,onActionClick:i,onClose:o,contentRef:a}=e,[s,u]=I.useState(!1),[l,c]=I.useState(e.isStepComplete);I.useEffect(()=>{r&&c(e.isStepComplete)},[e.isStepComplete,r]);async function f(){if(r)try{u(!0),await i(l)}finally{u(!1)}}return d.jsxs(m.Dialog,{open:r,onOpenChange:o,size:"small",children:[d.jsx(m.DialogHeader,{title:"Onboarding"}),d.jsxs(m.DialogContent,{children:[d.jsx(m.ScrollArea,{children:d.jsxs(m.Box,{ref:a,as:"article",flexDirection:"column",padding:16,gap:16,children:[d.jsx(m.DialogDescription,{asChild:!0,children:d.jsxs("section",{children:[d.jsxs(m.Text,{sx:{marginBottom:4},color:"purple9",variant:"bold",children:["Step ",n+1]}),d.jsx(m.Text,{variant:"h3",children:t.title}),t.content]})}),t.videoUrl&&d.jsx(m.Video,{src:t.videoUrl,sizing:"contain",borderRadius:4,autoPlay:!0,loop:!0})]})}),d.jsxs(m.DialogActions,{children:[d.jsx(m.DialogCancelButton,{size:"medium",children:"Close"}),!t.defaultCompleted&&d.jsx(m.DialogActionButton,{size:"medium",onClick:f,loading:s,color:l?"darkGrey":"purple",children:l?"Undo step":"Complete step"})]})]})]})}function jDe(e){const{steps:t,completedSteps:n,onToggleStep:r,tracking:i,stepOverrides:o}=e,[a,s]=I.useState(!1),[u,l]=I.useState(t[0]),c=I.useRef(null);if(!u)return null;const f=t.findIndex(({id:y})=>y===u.id);function p(y){return n.includes(y.id)}function h(y){l(y),s(!0),i.track({event:"shared-onboarding:step-opened",stepId:y.id,stepTitle:y.title,source:i.source})}async function A(y=!1){var C;if(u&&(await r(u),!y)){(C=c.current)==null||C.animate([{opacity:0},{opacity:1}],{duration:400});const _=g();_?h(_):s(!1)}}function g(){let y=f+1;for(;y<t.length;){const C=t[y];if(C&&!p(C))return C;y++}}return d.jsxs(d.Fragment,{children:[d.jsx(FDe,{contentRef:c,isOpen:a,step:u,stepIndex:f,isStepComplete:p(u),onClose:()=>s(!1),onActionClick:A}),d.jsxs(m.DropdownMenu,{children:[d.jsx(m.DropdownMenuTrigger,{children:d.jsx(m.Button,{size:"large",color:"grey",sx:{width:"100%"},renderStartIcon:LDe,children:n.length>0?"Continue":"Start now"})}),d.jsxs(m.DropdownMenuContent,{side:"right",minWidth:256,collisionPadding:8,children:[d.jsx(m.DropdownMenuLabel,{children:d.jsx(m.Text,{variant:"small",color:"grey11",sx:{marginInline:8},children:"Progress"})}),t.map((y,C)=>{const _=p(y);return d.jsx(m.DropdownMenuItem,{onSelect:(o==null?void 0:o[y.id])??(()=>h(y)),description:y.description,completed:_,endAdornment:d.jsx(m.Icon,{name:"chevronRight",size:"small",color:"grey11"}),children:`${C+1} ${y.title}`},y.id)})]})]})]})}function LDe(){return d.jsx(m.Icon,{name:"arrowForward",size:"small",color:"grey11"})}function DDe(e){const{steps:t,completedSteps:n,tutorialLink:r,tracking:i,onToggleStep:o,onClose:a,stepOverrides:s}=e,u=n.length===t.length;return d.jsx(m.Card,{variant:u?"elevated":"animated-light",paddingBlock:16,onClose:a,children:d.jsxs(m.CardContent,{children:[d.jsxs("div",{children:[d.jsx(m.Text,{variant:"bold",children:`Build your first page in ${t.length.toString()} simple steps`}),d.jsx(m.Text,{color:"grey11",variant:"small",children:"Render a live page with content coming from Prismic."})]}),d.jsx(m.ProgressBar,{value:n.length,max:t.length,displayLabel:!0,getValueLabel:(l,c)=>`${l}/${c}`}),d.jsx(jDe,{steps:t,completedSteps:n,onToggleStep:o,tracking:i,stepOverrides:s}),r&&d.jsx(MDe,{href:r,tracking:i})]})})}function UDe(e){const{framework:t,projectName:n,starterId:r,repositoryName:i}=e,{frameworkNameLabel:o,createProjectCodeSnippet:a}=BDe(e),s=[{id:"createPrismicProject",title:"Create your Prismic project",description:"Create and set up your project",defaultCompleted:!0,content:d.jsx(m.Text,{children:"A Prismic project is a space for managing and organizing the content of your website."})},{id:"chooseLocale",title:"Select your main locale",description:"Choose your first locale",defaultCompleted:!!r,content:d.jsx(m.Text,{children:"Locales allow you to create and manage multilingual versions of your content within a single Prismic project."})},{id:"createProject",title:`Create a ${o}project`,description:"Create and set up your project",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1727768069/DEV_TOOLS/ONBOARDING_GUIDE/Pagebuilder_onboarding_step_3_puh6fx.mp4",content:d.jsxs(d.Fragment,{children:[d.jsx(m.Text,{sx:{marginBottom:16},children:"Now that you have a Prismic project to manage the content of your website, let's create the code project that will be querying your content."}),!!a&&d.jsx(sv,{code:`${a} ${i??"<my-project>"}`,language:"bash"}),d.jsx(m.Text,{variant:"small",sx:{marginTop:16},children:"(example for Next.js below)"})]})},{id:"setupSliceMachine",title:"Set up & run Slice Machine",description:"Prepare the code to fetch content",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1727768069/DEV_TOOLS/ONBOARDING_GUIDE/page_builder_onboarding_step_4_yl8fb8.mp4",content:d.jsxs(d.Fragment,{children:[d.jsx(m.Text,{sx:{marginBottom:16},children:`Slice Machine is the Prismic tool for creating your content models.
|
|
69
|
+
Install it in your ${o}project by running these commands:`}),d.jsx(sv,{code:`cd ${n??"<your project name>"}
|
|
70
|
+
npx @slicemachine/init@latest --repository ${i??"<my-project>"}`,language:"bash",title:"Terminal",showLineNumbers:!1})]})},{id:"createPageType",title:"Create a Page Type",description:"Build the structure of your page",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/Create_page_type_xdn13j.mp4",content:d.jsx(m.Text,{children:"A page type is a base content structure editors will use to create pages in the Page Builder (Prismic's content creation UI). A page type can be reusable (e.g., for multiple blog posts) or single (e.g., for a one-time page like the homepage)."})},{id:"codePage",title:"Code Your Page Type",description:"Prepare code to fetch content",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/Step2_code_your_page_jatiur.mp4",content:d.jsx(m.Text,{children:"Prepare your code to query the content from the Prismic API."})},{id:"createSlice",title:"Create a Slice",description:"Build a reusable website section",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918322/DEV_TOOLS/ONBOARDING_GUIDE/Step3_add_slice_qzmvxf.mp4",content:d.jsx(m.Text,{children:"Slices are website sections that can be reused on different pages with different content. Each slice has a code component automatically generated by Slice Machine. Start with a template and look at your code to see how it's structured."})},{id:"reviewAndPush",title:"Review and Push changes",description:"Enable editors to create content",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/DevTools_Squad_push_changes_ovvmul.mp4",content:d.jsx(m.Text,{children:"Your page types and slices currently exist only in your local project. Push them to your repository to make them available for your content editors."})},{id:"createContent",title:"Create Content",description:"Publish a page to the Prismic API",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1732631905/DEV_TOOLS/ONBOARDING_GUIDE/step_9_create_content_y8m3m0.mp4",content:d.jsx(m.Text,{children:"In Prismic, content creation takes place in the Prismic Page Builder UI. Open the Page Builder and start creating your first page."})},{id:"renderPage",title:"Render Your Page",description:"View your page in the browser",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918321/DEV_TOOLS/ONBOARDING_GUIDE/Step_6_Render_Page_tnauh9.mp4",content:d.jsxs(m.Text,{children:["Now that your content is published, you can run your project in your terminal and visit the page on your local server (e.g.,"," ",d.jsx(m.Text,{component:"code",children:"localhost:3000/example-page"}),"). Your content should now be visible!"]})}],u={next:"https://prismic.dev/course/next",nuxt:"https://prismic.dev/course/nuxt",sveltekit:"https://prismic.dev/course/sveltekit"};return{steps:s,defaultCompletedStepIds:s.flatMap(l=>l.defaultCompleted?[l.id]:[]),tutorialLink:t?u[t]:void 0}}function BDe(e){const{framework:t}=e;if(!t||t==="other")return{frameworkNameLabel:"",createProjectCodeSnippet:""};const n=aU[t];return{frameworkNameLabel:n?`${n} `:"",createProjectCodeSnippet:sU[t]}}const kS=3e3,BL=400;function PDe(e){const{onboardingState:t,tracking:n,onToggleStep:r,onToggleGuide:i,fallback:o=null,stepOverrides:a,repositoryName:s,projectName:u}=e,{context:l,isDismissed:c}=t,{steps:f,defaultCompletedStepIds:p,tutorialLink:h}=UDe({...l,repositoryName:s,projectName:u}),A=_(t.completedSteps),g=WDe(y,BL);if(ze.useOnChange(c,()=>!c&&g.reset()),l.framework==="other")return d.jsx(d.Fragment,{children:o});function y(){i()}async function C(b){const v=await r(b.id);v.includes(b.id)&&n.track({event:"shared-onboarding:step-completed",stepId:b.id,stepTitle:b.title,source:n.source}),_(v).length===f.length&&(n.track({event:"shared-onboarding:completed",source:n.source}),g.start())}function _(b){const v=f.map(({id:S})=>S);return Array.from(new Set([...b.filter(S=>v.includes(S)),...p]))}return c?null:d.jsx(m.AnimatedElement,{enterDuration:0,exitDuration:BL,children:g.status!=="hidden"&&d.jsxs("div",{ref:g.refs.container,style:{position:"relative"},children:[d.jsx(DDe,{steps:f,completedSteps:A,tutorialLink:h,tracking:n,onToggleStep:C,onClose:g.status!=="animating"?y:void 0,stepOverrides:a}),d.jsx("div",{ref:g.refs.cannon,style:{position:"absolute",bottom:0,left:0}})]})})}function WDe(e,t=400){const n=hX.useConfetti({config:{duration:kS}}),[r,i]=I.useState("visible"),o=I.useRef(!1),a=I.useCallback(()=>{i("animating"),setTimeout(()=>i("hidden"),kS-t),o.current||(setTimeout(e,kS),o.current=!0)},[e,t]),s=()=>{n.throwConfetti(),a()},u=I.useCallback(()=>{i("visible"),o.current=!1},[]);return{refs:{container:n.confettiContainerRef,cannon:n.confettiCannonRef},status:r,start:s,reset:u}}function UH(e){const{type:t,value:n}=e,r=t===oa?Oh.max:Mh.max;return d.jsx(m.Box,{alignItems:"center",children:d.jsx(m.Tooltip,{title:NDe[t],content:VDe[t],stableMount:!0,children:d.jsx(m.Badge,{title:`${n.length} characters`,size:"medium",color:n.length>r?"tomato":"green",sx:{alignSelf:"center"}})})})}const NDe={[oa]:"Meta title length",[hs]:"Meta description length"},KDe=`${Oh.min}-${Oh.max}`,qDe=`${Mh.min}-${Mh.max}`,VDe={[oa]:`For optimal mobile SEO, keep your meta title within ${KDe} characters to prevent it from being cut off in search results.`,[hs]:`To ensure your meta description isn’t truncated in mobile search results, aim for ${qDe} characters. This helps improve visibility and click-through rates.`};function BH(e){const{title:t,description:n}=e;return d.jsx(m.Card,{paddingBlock:8,paddingInline:8,variant:"highlighted",children:d.jsxs(m.CardContent,{gap:4,children:[d.jsx(m.Text,{color:"indigo11",variant:"h4",noSelect:!0,children:ri.overflow(t,Oh.max)}),d.jsx(m.Text,{color:"green11",noSelect:!0,children:"https://www.yourdomain.com/"}),d.jsx(m.Text,{variant:"small",color:"grey11",noSelect:!0,children:ri.overflow(n,Mh.max)})]})})}const PH=I.createContext({editedUID:{current:!1},onEditUID:()=>{}});function WH(e){return Object.values(e.json).some(t=>{var n;return((n=t.uid)==null?void 0:n.type)==="UID"})}function zDe(e){const{content:t,customType:n}=e;return WH(n)&&!t.uid}function NH(e){const{documentId:t,documentsWithUid:n,uid:r}=e;return n.filter(i=>t!==i.id&&HDe({document:i,uid:r})&&QDe({...e,document:i}))}function QDe(e){const{customTypeId:t,languageId:n,document:r}=e,i=t===r.custom_type_id,o=n===r.language.id;return i&&o}function HDe(e){const{document:t,uid:n}=e,r=t.versions.filter(i=>i.uid===n);return r.length===0?!0:r.some(i=>i.status!=="archived")}const Vs=I.createContext(void 0);function YDe(e){const{customTypeFormat:t,children:n}=e,r=I.useMemo(()=>({customTypeFormat:t,isInSlice:!1,isInGroup:!1,isInRepeatable:!1}),[t]);return d.jsx(Vs.Provider,{value:r,children:n})}function GDe(e){const{children:t}=e,n=I.useContext(Vs),r=I.useMemo(()=>n&&{...n,isInSlice:!0},[n]);return d.jsx(Vs.Provider,{value:r,children:t})}function JDe(e){const{children:t}=e,n=I.useContext(Vs),r=I.useMemo(()=>n&&{...n,isInGroup:!0},[n]);return d.jsx(Vs.Provider,{value:r,children:t})}function ZDe(e){const{children:t}=e,n=I.useContext(Vs),r=I.useMemo(()=>n&&{...n,isInRepeatable:!0},[n]);return d.jsx(Vs.Provider,{value:r,children:t})}function XDe(){return I.useContext(Vs)}function eC(e,t){return`${e}___${t}`}const KH=I.createContext({ids:[],isSelected:()=>!1,update:()=>{}});function tC(){return I.useContext(KH)}function wr(e){var t;return(t=e.config)!=null&&t.label?e.config.label:e.type!=="Boolean"&&e.type!=="Separator"&&e.type!=="Table"&&e.fieldset?e.fieldset:e.type}const nF="...";function eUe(e,t,n=nF){var r,i;return(t?(r=e.config)==null?void 0:r.placeholder_true:(i=e.config)==null?void 0:i.placeholder_false)||n}function $c(e,t=nF){var n;return((n=e.config)==null?void 0:n.placeholder)||t}function tUe(e){var s;const{content:t,field:n,id:r,readOnly:i,onContentChange:o}=e,a=(t==null?void 0:t.value)??((s=n.config)==null?void 0:s.default_value)??!1;return d.jsxs(m.Field,{children:[d.jsx(m.FieldIcon,{name:"biToggle"}),d.jsx(m.FieldLabel,{htmlFor:r,children:wr(n)}),d.jsxs(m.FieldControl,{children:[d.jsx(m.Box,{padding:4,alignItems:"center",children:d.jsx(m.Text,{children:eUe(n,a)})}),d.jsx(m.Switch,{id:r,sx:{alignSelf:"center",marginLeft:"auto",marginRight:12},checked:a,onCheckedChange:u=>{i||o(nUe(u))}})]})]})}function nUe(e){return{__TYPE__:"BooleanContent",value:e}}function rUe(e){const{id:t,field:n,content:r,onContentChange:i}=e;return d.jsxs(m.Field,{children:[d.jsx(m.FieldIcon,{name:"colorLens"}),d.jsx(m.FieldLabel,{id:t,children:wr(n)}),d.jsx(m.FieldControl,{children:d.jsx(m.Box,{padding:{left:4},alignItems:"center",children:d.jsx(m.ColorInput,{onValueChange:o=>i(iUe(o)),value:r==null?void 0:r.value,"aria-labelledby":t,placeholder:$c(n)})})})]})}function iUe(e){return e===void 0?void 0:{__TYPE__:"FieldContent",type:"Color",value:e}}function oUe(e){const{id:t,readOnly:n,field:r,content:i,onContentChange:o}=e,a=i!=null&&i.value?rx.dateFromISOString(i.value):void 0;return d.jsxs(m.Field,{children:[d.jsx(m.FieldIcon,{name:"dateRange"}),d.jsx(m.FieldLabel,{id:t,children:wr(r)}),d.jsx(m.FieldControl,{children:d.jsx(m.Box,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:d.jsx(m.DateInput,{mode:"date","aria-labelledby":t,disabled:n,value:a,onValueChange:s=>o(aUe(s))})})})]})}function aUe(e){if(e)return{__TYPE__:"FieldContent",type:"Date",value:sUe(e)}}function sUe(e){const t=`${e.getFullYear()}`.padStart(4,"0"),n=`${e.getMonth()+1}`.padStart(2,"0"),r=`${e.getDate()}`.padStart(2,"0");return`${t}-${n}-${r}`}const Tu=I.forwardRef(function(t,n){const{padding:r=qH,...i}=t;return d.jsx(m.TextInput,{...i,padding:r,ref:n,sx:{...t.sx,alignSelf:"stretch"}})}),qH={input:{inline:4},adornment:{inline:12}},uUe=({provider:e})=>lUe[e.toLowerCase()]??d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("g",{clipPath:"url(#clip0_6524_22412)",children:d.jsx("path",{d:"M7.99992 1.33333C4.31992 1.33333 1.33325 4.32 1.33325 8C1.33325 11.68 4.31992 14.6667 7.99992 14.6667C11.6799 14.6667 14.6666 11.68 14.6666 8C14.6666 4.32 11.6799 1.33333 7.99992 1.33333ZM2.66659 8C2.66659 7.59333 2.71992 7.19333 2.80659 6.81333L5.99325 10V10.6667C5.99325 11.4 6.59325 12 7.32658 12V13.2867C4.70658 12.9533 2.66659 10.7133 2.66659 8ZM11.9266 11.6C11.7533 11.06 11.2599 10.6667 10.6599 10.6667H9.99325V8.66667C9.99325 8.3 9.69325 8 9.32658 8H5.32658V6.66667H6.65992C7.02658 6.66667 7.32658 6.36667 7.32658 6V4.66667H8.65992C9.39325 4.66667 9.99325 4.06667 9.99325 3.33333V3.06C11.9466 3.84667 13.3333 5.76667 13.3333 8C13.3333 9.38667 12.7933 10.6533 11.9266 11.6Z",fill:"#6F6E77"})}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6524_22412",children:d.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),lUe={codepen:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("g",{clipPath:"url(#clip0_6523_22409)",children:d.jsx("path",{d:"M15.9879 5.44292C15.9843 5.42352 15.981 5.40413 15.9759 5.38517C15.9726 5.37375 15.9688 5.36298 15.9651 5.35177C15.9597 5.33497 15.9541 5.31816 15.9474 5.30179C15.9427 5.29037 15.9373 5.27938 15.9321 5.26839C15.9248 5.25288 15.9173 5.23758 15.9086 5.22271C15.9026 5.21172 15.8957 5.20138 15.889 5.19082C15.8798 5.1766 15.8703 5.1626 15.8599 5.14902C15.8524 5.13889 15.8446 5.1292 15.8365 5.1195C15.8257 5.10657 15.8141 5.09429 15.8024 5.08223C15.7934 5.07318 15.7843 5.06413 15.7748 5.05529C15.7623 5.04387 15.7494 5.0331 15.7358 5.02276C15.7255 5.01479 15.7154 5.0066 15.7046 4.99927C15.7007 4.99647 15.6973 4.99324 15.6932 4.99065L8.38116 0.115543C8.15039 -0.0385144 7.84939 -0.0385144 7.61863 0.115543L0.306176 4.99044C0.302082 4.99302 0.29885 4.99626 0.294756 4.99906C0.283983 5.0066 0.273856 5.01457 0.263514 5.02254C0.250155 5.0331 0.237011 5.04387 0.224515 5.05486C0.215034 5.06348 0.205985 5.07253 0.19715 5.0818C0.185084 5.09386 0.17388 5.10614 0.162892 5.11907C0.154704 5.12877 0.146947 5.13846 0.139406 5.14924C0.129064 5.16281 0.119583 5.1766 0.110318 5.19104C0.103639 5.20159 0.0969593 5.21194 0.0907108 5.22293C0.0820922 5.23779 0.0745509 5.25309 0.0674405 5.26817C0.0622694 5.27916 0.0566673 5.29037 0.0521425 5.30157C0.0454631 5.31795 0.0396456 5.33475 0.0342589 5.35156C0.030596 5.36276 0.0267177 5.37375 0.0237011 5.38388C0.0187455 5.40284 0.0150825 5.42201 0.0116351 5.44162C0.00969592 5.45153 0.00732581 5.46123 0.00603302 5.47136C0.00215465 5.50109 0 5.53082 0 5.56121V10.4372C0 10.4673 0.00215465 10.4975 0.00646395 10.527C0.00797221 10.5378 0.0107733 10.5464 0.0129279 10.5568C0.0163753 10.5762 0.0193919 10.5955 0.0258558 10.6149C0.0288723 10.6257 0.0323198 10.6365 0.0366291 10.6483C0.0420157 10.6656 0.0474023 10.6828 0.0538662 10.6985C0.058391 10.7093 0.0646395 10.7201 0.0689488 10.7309C0.0760591 10.7459 0.0840314 10.761 0.09265 10.7768C0.098683 10.7875 0.105578 10.7983 0.112042 10.8082C0.121307 10.8233 0.131434 10.8362 0.142207 10.8491C0.149748 10.8599 0.157289 10.8685 0.165908 10.8789C0.176897 10.8918 0.187455 10.9047 0.200382 10.9162C0.209217 10.9248 0.21762 10.9355 0.228393 10.942C0.24089 10.9528 0.254249 10.9636 0.267177 10.9748C0.277519 10.9834 0.288723 10.9898 0.297342 10.9982C0.301436 11.0004 0.303806 11.0047 0.308115 11.0067L7.61863 15.8841C7.73412 15.9617 7.86641 16.0005 8 15.9998C8.13359 15.9992 8.26588 15.9611 8.38137 15.8841L15.6938 11.0092C15.6979 11.0067 15.7014 11.0036 15.7052 11.0008C15.716 10.9933 15.7261 10.9853 15.7365 10.9773C15.7498 10.9668 15.763 10.9558 15.7755 10.9446C15.785 10.9362 15.794 10.9269 15.8031 10.9179C15.8149 10.9058 15.8263 10.8935 15.8371 10.8806C15.8453 10.8709 15.8531 10.8612 15.8606 10.8509C15.8709 10.8373 15.8804 10.8233 15.8897 10.8091C15.8964 10.7987 15.903 10.7882 15.9093 10.7776C15.9179 10.7625 15.9254 10.7472 15.9328 10.7317C15.9379 10.7207 15.9433 10.7097 15.9481 10.6985C15.9548 10.6819 15.9604 10.6651 15.9657 10.6483C15.9694 10.6371 15.9733 10.6261 15.9765 10.6149C15.9815 10.596 15.9849 10.5766 15.9886 10.5572C15.9903 10.5473 15.9929 10.5376 15.994 10.5275C15.9978 10.4977 16 10.468 16 10.4376V5.5625C16 5.53212 15.9976 5.50238 15.994 5.47265C15.9922 5.46209 15.989 5.45347 15.9869 5.44292H15.9879ZM7.99978 9.62638L5.56826 8.00005L7.99978 6.37351L10.4315 8.00005L7.99978 9.62638ZM7.31245 5.17919L4.33171 7.17288L1.92561 5.56336L7.31245 1.97221V5.17919ZM3.09515 7.99984L1.37531 9.15021V6.84947L3.09515 7.99984ZM4.33171 8.82765L7.31245 10.8211V14.0281L1.92561 10.4365L4.33171 8.82722V8.82765ZM8.68733 10.8207L11.6681 8.82722L14.0744 10.4365L8.68733 14.0277V10.8207ZM12.9046 8.00027L14.6247 6.84969V9.15064L12.9046 7.99984V8.00027ZM11.6681 7.17288L8.68733 5.1794V1.97221L14.0744 5.56336L11.6681 7.17288Z",fill:"black"})}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6523_22409",children:d.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),codesandbox:d.jsxs("svg",{width:"14",height:"16",viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("g",{clipPath:"url(#clip0_6523_22406)",children:d.jsx("path",{d:"M6.24312 14.1129V8.35021L1.28724 5.49888V8.78388L3.55732 10.0999V12.5702L6.24312 14.1129ZM7.53036 14.1468L10.2658 12.571V10.0422L12.5506 8.71812V5.47426L7.53036 8.3727V14.1468ZM11.8904 4.36906L9.25164 2.83995L6.93472 4.18436L4.60022 2.8386L1.93795 4.38817L6.90626 7.24665L11.8904 4.36906ZM0 12.0115V4.02675L6.91821 0L13.8378 4.00984V11.9988L6.91805 15.985L0 12.0115Z",fill:"black"})}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6523_22406",children:d.jsx("rect",{width:"13.8378",height:"16",fill:"white"})})})]}),dailymotion:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsxs("g",{clipPath:"url(#clip0_6523_22345)",children:[d.jsx("path",{d:"M16 0H0V16H16V0Z",fill:"white"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.73038 10.3003C8.40789 10.6268 8.00377 10.7901 7.51804 10.7901C7.04025 10.7901 6.64411 10.6308 6.32956 10.3122C6.01503 9.99367 5.85776 9.58351 5.85776 9.08176C5.85776 8.60389 6.01901 8.20766 6.3415 7.89306C6.66401 7.57847 7.06016 7.42118 7.52998 7.42118C7.84849 7.42118 8.13715 7.49484 8.39594 7.64219C8.65474 7.78953 8.8558 7.99063 8.99913 8.2455C9.14246 8.50034 9.21412 8.77908 9.21412 9.08176C9.21412 9.56757 9.05287 9.97376 8.73038 10.3003ZM9.10662 3.58632V6.35792C8.82791 6.07918 8.53131 5.87808 8.21678 5.75463C7.90223 5.63118 7.54988 5.56946 7.1597 5.56946C6.53062 5.56946 5.96527 5.72476 5.4636 6.03538C4.96193 6.34597 4.57176 6.77007 4.29305 7.30768C4.01435 7.84528 3.875 8.44062 3.875 9.09369C3.875 9.76269 4.01236 10.366 4.28708 10.9036C4.5618 11.4412 4.95197 11.8653 5.45763 12.1759C5.96328 12.4865 6.54258 12.6418 7.19553 12.6418C8.14312 12.6418 8.80403 12.3312 9.17831 11.71H9.20218V12.5595H11.0894V3.15625L9.10662 3.58632Z",fill:"#232323"})]}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6523_22345",children:d.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),flickr:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("rect",{width:"16",height:"16",fill:"white"}),d.jsxs("g",{clipPath:"url(#clip0_6523_22379)",children:[d.jsx("path",{d:"M8.43286 7.78387C8.43286 9.321 9.67925 10.5674 11.2166 10.5674C12.7538 10.5674 13.9999 9.321 13.9999 7.78387C13.9999 6.24675 12.7538 5.00061 11.2166 5.00061C9.67925 5.00061 8.43286 6.24675 8.43286 7.78387Z",fill:"#FF0084"}),d.jsx("path",{d:"M2 7.78408C2 9.32121 3.24614 10.5676 4.78352 10.5676C6.32089 10.5676 7.56703 9.32121 7.56703 7.78408C7.56703 6.24695 6.32089 5.00081 4.78352 5.00081C3.24614 5.00081 2 6.24695 2 7.78408Z",fill:"#0063DC"})]}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6523_22379",children:d.jsx("rect",{width:"12",height:"5.568",fill:"white",transform:"translate(2 5)"})})})]}),giphy:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("rect",{width:"16",height:"16",fill:"#121212"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 3.38889V12.2778H5.11111V3.38889H4Z",fill:"#00FF99"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6663 5.61111V12.2778H11.7774V5.61111H10.6663Z",fill:"#9933FF"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.75 3H4V4.11111H8.83333V3H7.75Z",fill:"#FFF35C"}),d.jsx("path",{d:"M9.00041 4.11111H7.33374H8.83374V3.77778L9.00041 4.11111Z",fill:"#999999"}),d.jsx("path",{d:"M8.83374 4.11111H7.33374L8.44485 3L8.83374 3.77778V4.11111Z",fill:"#999237"}),d.jsx("path",{d:"M10.6663 7.44444V5.77778L11.7774 6.33333L10.6663 7.44444Z",fill:"#5C1F99"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6667 11.8889H4V13H11.7778V11.8889H10.6667Z",fill:"#00CCFF"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6668 5.22222V4.11111H9.55569V3H8.44458V3.90739V5.0185V6.33333H9.55569H10.6668H11.7779V5.22222H10.6668Z",fill:"#FF6666"})]}),instagram:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[d.jsxs("g",{clipPath:"url(#clip0_6523_22356)",children:[d.jsx("mask",{id:"mask0_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"16",height:"16",children:d.jsx("path",{d:"M4.70325 0.0949238C3.85627 0.1349 3.27778 0.270564 2.77227 0.468642C2.24897 0.672648 1.80537 0.946046 1.36408 1.38914C0.922279 1.83249 0.650958 2.27688 0.448504 2.8007C0.252489 3.3075 0.119662 3.88627 0.0822604 4.73377C0.045126 5.58283 0.0366102 5.85363 0.0407495 8.01522C0.0448729 10.1765 0.0544124 10.4479 0.0949012 11.2972C0.135388 12.1439 0.270546 12.7222 0.468623 13.2279C0.672886 13.7512 0.946004 14.1946 1.38935 14.6361C1.83245 15.0777 2.27708 15.3487 2.80115 15.5515C3.30744 15.7472 3.88644 15.8806 4.73369 15.9177C5.58273 15.9551 5.85379 15.9634 8.01483 15.9592C10.1769 15.9551 10.448 15.9456 11.297 15.9053C12.144 15.8648 12.722 15.7292 13.228 15.5316C13.7513 15.3268 14.1949 15.0542 14.6362 14.6109C15.0775 14.1678 15.3488 13.7231 15.5512 13.199C15.7473 12.6927 15.8806 12.1137 15.9175 11.267C15.9546 10.4174 15.9634 10.1461 15.9593 7.98478C15.9551 5.8232 15.9453 5.55239 15.9051 4.7036C15.8649 3.85609 15.7292 3.27811 15.5314 2.77208C15.3269 2.24877 15.054 1.80567 14.6109 1.36387C14.1678 0.922574 13.7232 0.650729 13.1991 0.448785C12.6926 0.252768 12.1138 0.119166 11.2666 0.0825425C10.4175 0.0448876 10.1465 0.0366393 7.98465 0.0407642C5.82336 0.0448892 5.5523 0.0541772 4.70325 0.0949238ZM4.79611 14.485C4.02004 14.4512 3.59863 14.3222 3.31776 14.2142C2.94585 14.0703 2.68046 13.8977 2.40114 13.6205C2.12234 13.3422 1.94928 13.0776 1.80408 12.7064C1.69497 12.4255 1.5637 12.0046 1.52734 11.2286C1.48788 10.3896 1.47886 10.1378 1.47498 8.01237C1.47086 5.88742 1.47859 5.63569 1.51522 4.79593C1.54848 4.02038 1.67822 3.59843 1.78602 3.31782C1.92993 2.94539 2.10196 2.68051 2.37973 2.4012C2.65801 2.12187 2.92263 1.94933 3.29402 1.80412C3.57463 1.69451 3.99555 1.56426 4.77134 1.52738C5.61084 1.48766 5.8623 1.47915 7.98723 1.47502C10.1127 1.47089 10.3644 1.47838 11.2042 1.51526C11.9797 1.54904 12.4016 1.67749 12.682 1.78607C13.0541 1.92998 13.3195 2.1015 13.5986 2.37979C13.8777 2.65808 14.0507 2.92218 14.1959 3.29435C14.3055 3.57418 14.4358 3.99562 14.4724 4.77117C14.5124 5.61068 14.5214 5.8624 14.5253 7.98736C14.5294 10.1128 14.5217 10.3646 14.4848 11.2038C14.451 11.9799 14.3223 12.4016 14.214 12.6827C14.0701 13.0543 13.898 13.3197 13.62 13.5991C13.342 13.8773 13.0774 14.0509 12.7057 14.1961C12.4256 14.3055 12.0042 14.436 11.2289 14.4729C10.3894 14.5123 10.1379 14.5214 8.01225 14.5252C5.88732 14.5294 5.63586 14.5214 4.79611 14.485ZM11.2854 3.74493C11.2864 4.27211 11.7151 4.69896 12.2422 4.69792C12.7697 4.69689 13.1965 4.2685 13.1957 3.74132C13.1947 3.21414 12.7661 2.78704 12.2386 2.78807C11.7112 2.7891 11.2844 3.21775 11.2854 3.74493ZM3.91277 8.00773C3.91714 10.2653 5.75063 12.0913 8.0076 12.0869C10.2648 12.0825 12.0919 10.2495 12.0875 7.99201C12.0831 5.73526 10.2494 3.90819 7.99188 3.91257C5.73489 3.91696 3.90837 5.75073 3.91277 8.00773ZM5.34648 8.0049C5.3439 6.53969 6.52978 5.34942 7.99471 5.34683C9.45991 5.344 10.6504 6.52937 10.6533 7.99484C10.6561 9.46031 9.47022 10.6503 8.00477 10.6532C6.53984 10.656 5.34932 9.47037 5.34648 8.0049Z",fill:"white"})}),d.jsxs("g",{mask:"url(#mask0_6523_22356)",children:[d.jsx("mask",{id:"mask1_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:d.jsx("path",{d:"M16.5905 -0.583628H-0.603516V16.6106H16.5905V-0.583628Z",fill:"white"})}),d.jsxs("g",{mask:"url(#mask1_6523_22356)",children:[d.jsx("mask",{id:"mask2_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:d.jsx("path",{d:"M16.6701 -0.663237H-0.683105V16.6902H16.6701V-0.663237Z",fill:"white"})}),d.jsxs("g",{mask:"url(#mask2_6523_22356)",children:[d.jsx("mask",{id:"mask3_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:d.jsx("path",{d:"M16.6701 -0.663237H-0.683105V16.6902H16.6701V-0.663237Z",fill:"white"})}),d.jsx("g",{mask:"url(#mask3_6523_22356)",children:d.jsx("rect",{x:"-0.688721",y:"-0.665792",width:"17.3622",height:"17.3622",fill:"url(#pattern0)"})})]})]})]})]}),d.jsxs("defs",{children:[d.jsx("pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:d.jsx("use",{xlinkHref:"#image0_6523_22356",transform:"scale(0.000439947)"})}),d.jsx("clipPath",{id:"clip0_6523_22356",children:d.jsx("rect",{width:"16",height:"16",fill:"white"})}),d.jsx("image",{id:"image0_6523_22356",width:"2273",height:"2275",xlinkHref:"data:image/jpeg;base64,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Hbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfw5h277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3XY/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26j+GHbqP4Yduo38MO3Ub+GHbqP4Yduo/hh26j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmNh25jYduY2HbmNh25jYduY2HbmNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh0+Nh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jhz+j7fweHn/AFd+fp9v6v8Ape79DDf1JLc930/LnmGfj9H0+v7/APAf6c32/wAQ/wCR+n/5f9383/iNaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca0415xrzjXnGvONeca8415xrzjXnGvONeca8415xrzjXnGvONeca8415xrzjXnGvONeYa8w15hrzDXmGvMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMNeYa8w15hrzDXnGvONeca8415xrzjXnGvONeca041pxrTjWnGtONaca041pxrTjWnGtONacas41ZxqzjVnGrONWcas41ZxqzjVnGrONScak41JxqTjUUGooNRQaig1FBqKDTUGmoNNQaag01BpqDTUGmoNNQaag0lBpKDSUGkoNJQaSg0lBpKDSUGioNFQaKg0VBoqDRVGiqNFUaKo0FRoKjQVGgqNBUaCo0FRoKjQVGgqPXqj16o9eqPXqj16o9eqPXqj16o9eqPXqj1yo9cqPXKj1yo9cqPXLD1yw9csPXLD1yw9csPWrD1qw9asPWrD1qw9asPWrD1qw9asPWrD1qw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1aw9WsPVrD1aw9WsPVrD1aw9WsPVrD1aw9WsPVrB34/8Ay/z/AH/53yHY/wDU/E/0v+P7/wCz/9k="})]})]}),pinterest:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsxs("g",{clipPath:"url(#clip0_6570_25513)",children:[d.jsx("rect",{width:"15.996",height:"16",rx:"2",fill:"#CC2127"}),d.jsx("path",{d:"M7.999 2C4.68555 2 2 4.68555 2 7.999C2 10.5406 3.58174 12.7102 5.81336 13.5861C5.76137 13.1121 5.71338 12.3843 5.83336 11.8644C5.94134 11.3964 6.53724 8.88285 6.53724 8.88285C6.53724 8.88285 6.35727 8.52291 6.35727 7.993C6.35727 7.15914 6.84119 6.53524 7.44309 6.53524C7.95501 6.53524 8.20297 6.91918 8.20297 7.3811C8.20297 7.89502 7.87502 8.66489 7.70705 9.37877C7.56507 9.97667 8.007 10.4626 8.5949 10.4626C9.66072 10.4626 10.4806 9.33878 10.4806 7.71505C10.4806 6.27929 9.44876 5.27345 7.975 5.27345C6.26729 5.27345 5.26546 6.55324 5.26546 7.87702C5.26546 8.39293 5.46342 8.94484 5.71138 9.24679C5.75937 9.30678 5.76737 9.35877 5.75337 9.41876C5.70738 9.60873 5.6074 10.0167 5.5874 10.0987C5.56141 10.2086 5.50142 10.2326 5.38743 10.1786C4.63756 9.83069 4.16964 8.73488 4.16964 7.85502C4.16964 5.96334 5.54541 4.22563 8.13298 4.22563C10.2146 4.22563 11.8304 5.70938 11.8304 7.69105C11.8304 9.75871 10.5266 11.4224 8.71688 11.4224C8.10898 11.4224 7.53708 11.1065 7.34111 10.7345C7.34111 10.7345 7.04116 11.8804 6.96717 12.1603C6.83119 12.6822 6.46526 13.3341 6.2213 13.732C6.7832 13.906 7.3791 14 7.997 14C11.3104 14 13.996 11.3144 13.996 8.001C13.998 4.68555 11.3124 2 7.999 2Z",fill:"white"})]}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6570_25513",children:d.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),spotify:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("g",{clipPath:"url(#clip0_6523_22402)",children:d.jsx("path",{d:"M12.6609 7.10585C10.121 5.59751 5.93158 5.45882 3.50697 6.1947C3.11759 6.31287 2.70584 6.09298 2.5879 5.70373C2.46988 5.31411 2.68945 4.90265 3.07911 4.78429C5.86241 3.93945 10.4892 4.1026 13.4132 5.83828C13.7634 6.04622 13.8782 6.49851 13.6707 6.84813C13.4629 7.19833 13.0103 7.31376 12.6609 7.10585ZM12.5777 9.33993C12.3995 9.62908 12.0215 9.71979 11.7327 9.54223C9.61522 8.24063 6.38637 7.86357 3.88123 8.624C3.55636 8.72218 3.21323 8.53899 3.11455 8.21475C3.01666 7.88989 3.19992 7.54738 3.5242 7.44859C6.38597 6.58018 9.9436 7.00081 12.3756 8.49536C12.6644 8.67322 12.7553 9.05146 12.5777 9.33993ZM11.6136 11.4855C11.472 11.7177 11.1697 11.7904 10.9383 11.6489C9.08801 10.518 6.75909 10.2627 4.01637 10.8891C3.75207 10.9497 3.48866 10.7841 3.42838 10.5198C3.36785 10.2556 3.53284 9.99217 3.79772 9.93186C6.79916 9.2457 9.37381 9.54101 11.4506 10.8101C11.6822 10.9515 11.7551 11.254 11.6136 11.4855ZM8.00002 0.120623C3.64839 0.120623 0.120605 3.64834 0.120605 7.99989C0.120605 12.352 3.64839 15.8794 8.00002 15.8794C12.3517 15.8794 15.8794 12.352 15.8794 7.99989C15.8794 3.64834 12.3517 0.120623 8.00002 0.120623Z",fill:"#1ED760"})}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6523_22402",children:d.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),twitter:d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:d.jsx("path",{d:"M14.3193 4.31285C14.329 4.45301 14.329 4.59317 14.329 4.73462C14.329 9.04475 11.0516 14.0156 5.05865 14.0156V14.0131C3.28832 14.0156 1.55478 13.508 0.0644531 12.5507C0.321873 12.5817 0.580582 12.5972 0.839937 12.5979C2.30703 12.5992 3.7322 12.1063 4.88639 11.1988C3.4922 11.1724 2.26961 10.2623 1.84252 8.93366C2.3309 9.02796 2.83413 9.00858 3.31349 8.87746C1.79349 8.57001 0.699937 7.23299 0.699937 5.68023C0.699937 5.66602 0.699937 5.65246 0.699937 5.63889C1.15284 5.89144 1.65994 6.0316 2.17865 6.0471C0.747034 5.08923 0.305743 3.18251 1.17026 1.69176C2.82445 3.7296 5.2651 4.96844 7.8851 5.09956C7.62252 3.96664 7.98123 2.77947 8.82768 1.98307C10.1399 0.748096 12.2038 0.811395 13.4374 2.12452C14.167 1.98048 14.8664 1.71243 15.5064 1.33264C15.2632 2.0877 14.7541 2.72909 14.0741 3.13665C14.7199 3.06044 15.3509 2.88734 15.9451 2.62316C15.5077 3.2794 14.9567 3.85103 14.3193 4.31285Z",fill:"#1D9BF0"})}),vimeo:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsxs("g",{clipPath:"url(#clip0_6523_22340)",children:[d.jsx("path",{d:"M16 14.4C16 15.28 15.28 16 14.4 16H1.6C0.72 16 0 15.28 0 14.4V1.6C0 0.72 0.72 0 1.6 0H14.4C15.28 0 16 0.72 16 1.6V14.4Z",fill:"#1AB7EA"}),d.jsx("path",{d:"M13.9945 5.3084C13.9391 6.42815 13.1229 7.97447 11.5458 9.93402C9.91331 11.9736 8.52987 13 7.40928 13C6.70372 13 6.12267 12.3735 5.63846 11.1338C5.32027 9.98735 4.98824 8.85427 4.67005 7.70786C4.31036 6.46814 3.92299 5.84161 3.50796 5.84161C3.42495 5.84161 3.10676 6.02824 2.56721 6.38816L2 5.68165C2.59488 5.1751 3.17593 4.68187 3.75698 4.17532C4.54554 3.52214 5.14042 3.17555 5.54162 3.13556C6.46853 3.05557 7.04958 3.66877 7.27093 4.97514C7.50612 6.40149 7.67213 7.28129 7.75514 7.62788C8.01799 8.80095 8.32235 9.40081 8.64054 9.40081C8.88956 9.40081 9.26309 9.01423 9.77497 8.2544C10.273 7.49457 10.5497 6.90804 10.5774 6.50813C10.6465 5.85494 10.3837 5.52169 9.77497 5.52169C9.48444 5.52169 9.19392 5.58834 8.88956 5.70831C9.48444 3.84206 10.605 2.94893 12.2652 3.00225C13.4826 3.02891 14.0637 3.80207 13.9945 5.3084Z",fill:"white"})]}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6523_22340",children:d.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),youtube:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("path",{d:"M15.6656 3.75817C15.4816 3.06609 14.9395 2.5211 14.2511 2.33614C13.0034 2 8 2 8 2C8 2 2.99666 2 1.7489 2.33614C1.06051 2.5211 0.518324 3.06609 0.334339 3.75817C0 5.01251 0 7.62963 0 7.62963C0 7.62963 0 10.2467 0.334339 11.5012C0.518324 12.1932 1.06051 12.7381 1.7489 12.9232C2.99666 13.2593 8 13.2593 8 13.2593C8 13.2593 13.0034 13.2593 14.2511 12.9232C14.9395 12.7381 15.4816 12.1932 15.6656 11.5012C16 10.2467 16 7.62963 16 7.62963C16 7.62963 16 5.01251 15.6656 3.75817Z",fill:"#ED1D24"}),d.jsx("path",{d:"M6.36353 10.0058L10.5453 7.62974L6.36353 5.25349V10.0058Z",fill:"white"})]})};function VH(e){const{debouncedUrl:t,content:n,onContentChange:r,selected:i}=e,o=I.useRef(null),[a,s]=I.useState(!1);ze.useOnChange(t,()=>{var l;a&&(s(!1),(l=o.current)==null||l.reset())});function u(){s(!0),r(void 0)}return ni.toURL(t)?t===(n==null?void 0:n.embed_url)?d.jsx(t_,{content:n,selected:i}):d.jsx(m.ErrorBoundary,{ref:o,renderError:cUe,onError:u,children:d.jsx(I.Suspense,{fallback:n&&d.jsx(t_,{content:n,selected:i}),children:d.jsx(dUe,{url:t,selected:i,onContentChange:r})})}):null}function cUe(){return d.jsxs(m.Box,{backgroundColor:"grey2",borderRadius:6,padding:16,gap:4,children:[d.jsx(m.Icon,{name:"alert",size:"small",color:"grey11"}),d.jsx(m.Text,{variant:"smallBold",color:"grey11",children:"There is no embed data available."})]})}function t_(e){const{content:t,selected:n}=e,{thumbnail:r,provider:i,author:o,url:a,subtitle:s}=AUe(t);return d.jsxs(m.PreviewCard,{selected:n,children:[d.jsx(m.PreviewImage,{src:r.url,aspectRatio:r.aspectRatio}),d.jsxs(m.PreviewContent,{children:[d.jsxs(m.Box,{display:"flex",alignItems:"center",gap:4,children:[d.jsx(uUe,{provider:i}),d.jsx(m.Text,{variant:"smallBold",color:"grey12",noWrap:!0,children:i}),o&&d.jsx(m.Text,{variant:"small",color:"grey11",noWrap:!0,children:o})]}),d.jsx(m.Text,{variant:"smallBold",href:a,children:s})]})]})}function dUe(e){const{url:t,onContentChange:n,selected:r}=e,i=fUe({url:t,onContentChange:n});return d.jsx(t_,{content:i,selected:r})}function fUe(e){const{url:t,onContentChange:n}=e,{embedApiEndpoint:r}=we(),i=et.useRequest(pUe,[t,r]),o=ze.useStableCallback(n);return I.useEffect(()=>{const a=m.handleEditorFlushSyncError(()=>o(i));return()=>{clearTimeout(a)}},[i,o]),i}function pUe(e,t){const n=new URL(t);return n.searchParams.set("url",e),se.request(n,{okType:hUe(e)})}function hUe(e){return k.object({type:k.string(),version:k.string().or(k.number()).nullish(),title:k.string().nullish(),author_name:k.string().nullish(),author_url:k.string().nullish(),provider_name:k.string().nullish(),provider_url:k.string().nullish(),cache_age:k.string().or(k.number()).nullish(),thumbnail_url:k.string().nullish(),thumbnail_width:k.number().nullish(),thumbnail_height:k.number().nullish(),html:k.string().nullish()}).passthrough().transform(t=>{const n={embed_url:e};return{...n,__TYPE__:"EmbedContent",type:t.type,version:t.version,title:t.title,author_name:t.author_name,author_url:t.author_url,provider_name:t.provider_name,provider_url:t.provider_url,cache_age:t.cache_age,thumbnail_url:t.thumbnail_url,thumbnail_width:t.thumbnail_width,thumbnail_height:t.thumbnail_height,html:t.html,all:{...n,...t}}})}function AUe(e){let t="";switch(e.type){case"video":t=e.title??"";break;case"photo":t=`View this post${e.provider_name?` on ${e.provider_name}`:""}`;break;default:t=`Open${e.provider_name?` on ${e.provider_name}`:""}`}return{url:e.embed_url,thumbnail:{url:e.thumbnail_url??"",aspectRatio:e.type==="video"?"16:9":"1:1"},provider:e.provider_name??"",author:e.author_name??"",subtitle:t}}function mUe(e){const{id:t,readOnly:n,field:r,content:i,onContentChange:o}=e,a=ze.useDebounceState({initialState:(i==null?void 0:i.embed_url)??"",startTransition:I.startTransition});function s(u){a.set(u),ni.toURL(u)||o(void 0)}return d.jsxs(m.Field,{footer:ni.toURL(a.value)&&d.jsx(m.FieldFooter,{children:d.jsx(VH,{debouncedUrl:a.debouncedValue,content:i,onContentChange:o})}),children:[d.jsx(m.FieldIcon,{name:"cloud"}),d.jsx(m.FieldLabel,{htmlFor:t,children:wr(r)}),d.jsx(m.FieldControl,{children:d.jsx(Tu,{id:t,readOnly:n,placeholder:$c(r),value:a.value,onValueChange:s,variant:ni.toURL(a.value)?"link":"normal",endAdornment:d.jsx(m.Button,{startIcon:"close",color:"grey",size:"small",disabled:!a,onClick:()=>s("")})})})]})}function zH(e){return!(e.lat>85||e.lat<-85||e.lng>180||e.lng<-180)}function OS(e){const t=/^.*@(-?\d+.\d+),(-?\d+.\d+).*$/,n=e.match(t);if(!n)return;const r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return;const o={lat:r,lng:i};if(zH(o))return o}function PL(e){return e?`${e.lat}, ${e.lng}`:""}function WL(e){const t=/\(?([\d|.|-]*)[\s+]*,[\s]*([\d|.|-]*)\)?/,n=e.match(t);if(!n)return OS(e);const r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return OS(e);const o={lat:r,lng:i};return zH(o)?o:OS(e)}function gUe(e){const{field:t,id:n,readOnly:r,...i}=e,{onValueChange:o,displayedValue:a,onBlur:s,clearValue:u,isValidCoordinates:l}=vUe(i);return d.jsxs(m.Field,{children:[d.jsx(m.FieldIcon,{name:"place"}),d.jsx(m.FieldLabel,{htmlFor:n,children:wr(t)}),d.jsx(m.FieldControl,{children:d.jsx(Tu,{id:n,onValueChange:o,placeholder:nF,readOnly:r,value:a,onBlur:s,variant:l?"link":"normal",endAdornment:d.jsx(m.Button,{startIcon:"close",color:"grey",size:"small",disabled:!a,onClick:u})})})]})}function vUe(e){const{content:t,onContentChange:n}=e,r=PL(t==null?void 0:t.position),[i,o]=I.useState(r);function a(){const l=WL(i);if(!l)return o(""),n(void 0);const{lat:c,lng:f}=l;o(PL({lat:c,lng:f})),n({__TYPE__:"GeoPointContent",position:{lat:c,lng:f}})}function s(){o(""),n(void 0)}const u=!!WL(i);return{displayedValue:i,isValidCoordinates:u,onValueChange:o,onBlur:a,clearValue:s}}function QH(e){const{fieldLabel:t,imageLabel:n=[]}=e;return d.jsxs(m.CardHeaderTitle,{children:[d.jsx(m.Text,{variant:"bold",noWrap:!0,children:ri.overflow(t,30)}),n.length!==0&&d.jsx(m.Text,{color:"grey11",noSelect:!0,children:` • ${n.join(" • ")}`})]})}function HH(e){const{fieldLabel:t,isUpdating:n,readOnly:r,onMediaDialogOpenChange:i}=e;return d.jsxs(d.Fragment,{children:[d.jsx(m.CardHeader,{sx:{flexWrap:"wrap"},children:d.jsx(QH,{fieldLabel:t})}),d.jsx(m.CardContent,{children:d.jsx(m.Card,{color:"grey2",variant:"dashed",paddingBlock:12,radius:4,sx:{width:"100%"},children:d.jsx(m.CardContent,{children:d.jsxs(m.BlankSlate,{variant:"horizontal",children:[d.jsx(m.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple9",backgroundColor:"purple4",size:"small"}),d.jsx(m.BlankSlateTitle,{children:n?"Preparing your image...":"You haven't selected an image"}),!r&&d.jsx(m.BlankSlateActions,{children:d.jsx(m.Button,{disabled:n,onClick:()=>i(!0),size:"medium",children:"Select image"})})]})})})})]})}const yUe=kv({id:Nu(),width:$v(),height:$v(),urls:kv({full:Nu(),small:Nu().transform(D2e)}),alt_description:Nu().optional(),description:Nu().nullable()}),bUe=kv({results:kQ(yUe)}).transform(e=>e.results);function YH(e,t){const n=new URL("search/photos",e);return n.searchParams.set("page","1"),n.searchParams.set("per_page","28"),n.searchParams.set("query",t),se.request(n,{okType:bUe})}et.cache.registerFetcherConfig(YH,{cacheCapacity:5,revalidationStrategy:{type:"never"}});function CUe(e,t){const n=I.useRef(),r=we(),i=et.useRequest(YH,[e,t]);return ze.useDebounce(t,1e3,()=>{var o;n.current&&t!==n.current&&((o=r.onAnalyticsEvent)==null||o.call(r,"Unsplash Image Searched")),n.current=t}),i}function SUe(e){const{onSelectedChange:t}=e,[n,r]=I.useTransition(),i=ze.useDebounceState({initialState:"",ms:300,startTransition:r});return d.jsxs(m.Box,{flexDirection:"column",gap:16,width:"100%",position:"relative",children:[d.jsx(m.FormSearchInput,{value:i.value,placeholder:"Search on Unsplash.com",onValueChange:i.set}),d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(_H,{}),children:d.jsx(I.Suspense,{fallback:d.jsx(_Ue,{}),children:d.jsx(wUe,{term:i.debouncedValue,loading:n,onSelectedChange:t})})})]})}function wUe(e){const{term:t,onSelectedChange:n,loading:r}=e,{media:i,toggleSelected:o,selectedImageId:a}=xUe({term:t,onSelectedChange:n});return d.jsxs(d.Fragment,{children:[i.length>0&&d.jsx(GH,{children:i==null?void 0:i.map(s=>{const l=new URL(s.urls.full).searchParams.get("fm")??"jpg";return d.jsx(m.MediaCard,{url:s.urls.small,filename:s.description??"Unsplash Image",selected:a===s.id,onCardClick:()=>o(s),onCheckedChange:()=>o(s),extension:l,kind:"image",width:s.width,height:s.height,loading:r},s.id)})}),i.length===0&&d.jsx(SH,{})]})}function GH(e){const{children:t}=e;return d.jsx(m.ScrollArea,{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 250px), 1fr))",gap:16,padding:2,paddingBottom:16,position:"relative",width:"100%"},children:t})}function _Ue(){return d.jsx(GH,{children:wt.range(1,24).map(e=>d.jsx($H,{},e))})}function xUe(e){var l;const{term:t,onSelectedChange:n}=e,{unsplashApiBaseUrl:r}=we(),i=CUe(r,t||"citrus fruit"),o=(l=i==null?void 0:i[0])==null?void 0:l.id,[a,s]=I.useState();I.useEffect(()=>{n==null||n([]),s(void 0)},[o,n]);function u(c){if(c.id===a)return s(void 0),n==null?void 0:n([]);s(c.id),n==null||n([{...c,url:c.urls.full,alt:c.alt_description}])}return{media:i,toggleSelected:u,selectedImageId:a}}function rF(e){const{open:t,onOpenChange:n,onMediaSelected:r,assetType:i}=e,o=we(),a=o.mediaLibrary,[s,u]=I.useState(()=>a?"media":"unsplash"),[l,c]=I.useState(new Set),[f,p]=I.useState([]),h=l.size+f.length,A=et.useFetcherData(Wi);I.useEffect(()=>{!t||!a||hH({config:o,assetType:i})},[t,o,i,a]);function g(S){if(S!=="media"&&S!=="unsplash")throw new Error(`Invalid option ${S}.`);u(S)}function y(S){S||c(new Set),n(S)}const C=r2e({assetType:i,mediaDialogOpen:t});function _(){var S;switch(s){case"unsplash":{const w=f[0];if(!w)return;r(w),(S=o.onAnalyticsEvent)==null||S.call(o,"Unsplash Image Added");break}case"media":{const E=A.flatMap(R=>R.items).filter(R=>l.has(R.id))[0];if(!E)return;r(E),C(E.id);break}}}function b(){if(h===0)return"Select a media item to add to the page";if(h>1)return"Only one media item can be added to the page"}const{containerRef:v}=m.useAlert();return d.jsxs(m.Dialog,{open:t,onOpenChange:y,size:{width:"min(calc(100% - 48px), 2000px)",height:"calc(100% - 30px)"},position:"center",onPointerDownOutside:S=>{v&&ze.refContainsTarget(v,S.target)&&S.preventDefault()},children:[d.jsx(m.DialogHeader,{icon:"image",title:"Media library"}),d.jsx(m.DialogDescription,{hidden:!0,children:"Select a media item to add to the page"}),d.jsxs(m.DialogOptions,{value:s,onValueChange:g,padding:"small",width:"auto",children:[a&&d.jsx(m.DialogOptionsItem,{value:"media",icon:"photo"}),d.jsx(m.DialogOptionsItem,{value:"unsplash",icon:"unsplash"})]}),d.jsx(m.DialogContent,{children:d.jsx(m.Box,{flexDirection:"column",flexGrow:1,overflow:"hidden",children:d.jsxs(m.Box,{overflow:"hidden",backgroundColor:"grey2",padding:{top:16,inline:16},flexGrow:1,children:[s==="media"&&d.jsx(DH,{assetType:i,onSelectedChange:c}),s==="unsplash"&&d.jsx(SUe,{onSelectedChange:p})]})})}),d.jsxs(m.DialogActions,{children:[d.jsx(m.DialogCancelButton,{}),d.jsx(m.DialogActionButton,{onClick:_,disabled:h!==1,tooltipLabel:b(),children:"Add to page"})]})]})}const JH=I.forwardRef(function(t,n){const{isMediaDialogOpen:r,selected:i,children:o,onMediaSelected:a,onMediaDialogOpenChange:s}=t;function u(l){a(l),s(!1)}return d.jsxs(m.Card,{ref:n,color:i?"indigo2":"grey2",variant:i?"selected":"dashed",paddingBlock:12,radius:4,children:[o,d.jsx(rF,{open:r,onOpenChange:s,onMediaSelected:u,assetType:"image"})]})});function ZH(e){const{uploadImage:t,children:n,isUploading:r,disabled:i}=e;if(i)return d.jsx(d.Fragment,{children:n});function o(a){if(r)return;const s=a[0];s&&t(s)}return d.jsx(m.FileDropZone,{assetType:"image",maxFiles:1,onFilesSelected:o,overlay:d.jsx(TUe,{isUploading:r}),children:n})}function TUe(e){const{isUploading:t}=e,n=t?"You can't upload while the upload is ongoing":"Drop image to instantly upload";return d.jsx(m.Box,{justifyContent:"center",flexDirection:"column",height:"100%",padding:8,children:d.jsxs(m.BlankSlate,{children:[d.jsx(m.BlankSlateIcon,{name:t?"block":"cloudUpload",lineColor:t?"tomato11":"purple10",backgroundColor:t?"tomato2":"purple3",borderColor:t?"tomato6":"purple6",borderStyle:"dashed",size:"small"}),d.jsx(m.BlankSlateTitle,{size:"regular",children:n})]})})}function XH(e){const{contentView:t,croppedImage:n}=e,{width:r,height:i,x:o,y:a,zoom:s}=n,u=EUe({origin:t.origin,croppedImage:n});return{...t,width:r,height:i,url:u,edit:{...t.edit,zoom:s,crop:{x:o,y:a}}}}function IUe(e){var l,c,f;const{field:t,content:n,thumbnail:r,croppedImage:i}=e;if(r===fp)return eY({content:n,croppedImage:i});const o=fe.isImageContent(n),a=(c=(l=t==null?void 0:t.config)==null?void 0:l.thumbnails)==null?void 0:c.find(p=>p.name===r),s=o?(f=n.thumbnails)==null?void 0:f[r]:void 0;if(!a||!s)return n;const u=XH({contentView:s,croppedImage:i});return u.url===s.url?n:{...n,thumbnails:o?{...n.thumbnails,[r]:u}:void 0}}function eY(e){const{content:t,croppedImage:n}=e,r=XH({contentView:t,croppedImage:n});return r.url===t.url?t:{...t,...r}}function EUe(e){const{origin:t,croppedImage:n}=e,{x:r,y:i,width:o,height:a,cropHeight:s,cropWidth:u}=n,l=new URL(t.url),c=t.height!==a||t.width!==o;if(r!==0||i!==0||s!==t.height||u!==t.width){const p=[r,i,u,s].map(Math.round).join(",");l.searchParams.set("rect",p),l.searchParams.set("w",o.toString()),l.searchParams.set("h",a.toString())}return c&&(l.searchParams.set("w",o.toString()),l.searchParams.set("h",a.toString())),l.toString()}function RUe(e){const{edit:{crop:{x:t,y:n},zoom:r},width:i,height:o,origin:{width:a,height:s}}=e;let u,l;const c=a/s,f=i/o;return f>=c?(u=a/r,l=u/f):(l=s/r,u=l*f),{x:t,y:n,width:i,height:o,zoom:r,cropWidth:u,cropHeight:l}}function $Ue(e){const{selectedImage:t,imageCrop:n,setImageCrop:r}=e,{width:i,height:o,zoom:a,cropHeight:s,cropWidth:u}=n,l=t.contentView,c={x:n.x,y:n.y,width:u,height:s},[f,p]=I.useState(),h=(l==null?void 0:l.origin.url)??"",A=!(t!=null&&t.thumbnail.height&&(t!=null&&t.thumbnail.width));function g(v,S){const w=parseInt(S);isNaN(w)||w<=0||!A||r({...n,[v]:w})}function y(v){r({...n,cropWidth:v.width,cropHeight:v.height,x:v.x,y:v.y})}function C(v){r({...n,zoom:v})}function _(){p(bg),r({...n,...bg})}function b(){l&&(p(bg),r({...n,...bg,zoom:1,cropWidth:l.width,cropHeight:l.height}))}return d.jsxs(m.Box,{padding:{inline:24,block:16},flexDirection:"column",gap:16,height:"100%",overflowY:"auto",alignItems:"center",children:[d.jsxs(m.Box,{gap:8,height:32,alignItems:"flex-start",width:"100%",children:[d.jsx(m.Tooltip,{content:"Center",children:d.jsx(m.Button,{color:"grey",size:"medium",startIcon:"centerFocusWeak",onClick:_})}),d.jsx(m.Tooltip,{content:"Cover",children:d.jsx(m.Button,{color:"grey",size:"medium",startIcon:"zoomOutMap",onClick:b})}),d.jsx(m.Separator,{orientation:"vertical"}),d.jsx(m.FormInput,{prefix:"W",prefixTooltip:"Width",placeholder:"width",type:"number",size:"medium",value:String(i),onValueChange:v=>g("width",v),sx:{width:100},disabled:!A}),d.jsx(m.FormInput,{prefix:"H",prefixTooltip:"Height",placeholder:"height",type:"number",size:"medium",value:String(o),onValueChange:v=>g("height",v),sx:{width:100},disabled:!A})]}),d.jsx(m.Cropper,{image:h,aspect:i/o,crop:f??{x:0,y:0},onCropChange:p,zoom:a,onZoomChange:C,onCropAreaChange:(v,S)=>y(S),initialCroppedAreaPixels:c}),d.jsx(m.Box,{width:"100%",maxWidth:320,children:d.jsx(m.Slider,{min:1,max:3,step:.01,value:[a],onValueChange:([v])=>C(v??1)})})]})}const bg={x:0,y:0};function kUe(e){const{trigger:t,initialImages:n,renderTooltip:r}=e,{open:i,onOpenChange:o,ready:a,option:s,selectedImage:u,croppedImage:l,setCroppedImage:c,setReady:f,setOption:p}=OUe(e);return d.jsxs(m.Dialog,{trigger:t,onAnimationEnd:()=>f(!0),open:i,onOpenChange:o,renderTooltip:r,children:[d.jsx(m.DialogHeader,{icon:"photo",title:"Image editor"}),d.jsx(m.DialogDescription,{hidden:!0,children:"Crop your image to the desired size."}),d.jsx(m.DialogOptions,{value:String(s),onValueChange:h=>p(Number(h)),children:n.map((h,A)=>d.jsx(m.DialogOptionsItem,{value:String(A),icon:"photo",title:h.labels[0]??"Main",subtitle:h.labels[1]??""},h.thumbnail.name))}),u&&d.jsx(m.DialogContent,{children:a&&l&&d.jsx($Ue,{selectedImage:u,imageCrop:l,setImageCrop:c},u.thumbnail.name)})]})}function OUe(e){const{initialImages:t,initialOption:n,onClose:r}=e,[i,o]=I.useState(y),[a,s]=I.useState(!1),[u,l]=I.useState(!1),[c,f]=I.useState(n);function p(C){C?(f(n),o(y())):(l(!1),r({option:c,croppedImages:i})),s(C)}const h=t[c],A=i[(h==null?void 0:h.thumbnail.name)??""];function g(C){if(!h)return;const _=h.thumbnail.name;o({...i,[_]:C})}function y(){return t.reduce((C,_)=>(_.contentView&&(C[_.thumbnail.name]=RUe(_.contentView)),C),{})}return{open:a,ready:u,option:c,selectedImage:h,croppedImage:A,setCroppedImage:g,setReady:l,setOption:f,onClose:r,onOpenChange:p}}function MUe(e){const{readOnly:t,altText:n,selected:r,onValueChange:i}=e,o=I.useId();return d.jsxs(m.Field,{selected:r,children:[d.jsx(m.FieldLabel,{htmlFor:o,children:"Alt text"}),d.jsx(m.FieldControl,{children:d.jsx(m.Box,{flexGrow:1,height:40,children:d.jsx(Tu,{id:o,placeholder:"Short description for the visually impaired",readOnly:t,value:n,padding:{input:{inline:12}},onValueChange:i})})})]})}function FUe(e){const{fieldLabel:t,imageLabel:n,initialImages:r,page:i,displaySeparator:o=!0,isSVGContentView:a,visibility:s,onClear:u,onCropperDialogClose:l,onMediaDialogOpenChange:c}=e;return d.jsxs(m.Box,{display:"flex",flexDirection:"column",gap:12,children:[d.jsxs(m.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:4,children:[d.jsx(QH,{fieldLabel:t,imageLabel:n}),d.jsxs(m.CardHeaderActions,{sx:{visibility:s},children:[d.jsx(kUe,{trigger:d.jsx(m.Button,{startIcon:"crop",disabled:a,hiddenLabel:"Crop & Resize"}),renderTooltip:f=>d.jsx(m.Tooltip,{content:"Crop & Resize",children:f}),initialImages:r,initialOption:i,onClose:l}),d.jsx(m.Tooltip,{content:"Replace",children:d.jsx(m.Button,{startIcon:"imageSearch",hiddenLabel:"Replace",onClick:()=>c(!0)})}),d.jsx(m.Tooltip,{content:"Clear",children:d.jsx(m.Button,{onClick:u,startIcon:"delete",hiddenLabel:"Clear"})})]})]}),o&&d.jsx(m.Separator,{style:"dashed",decorative:!0})]})}function Sl(e){const{description:t,largeIconName:n="public",loading:r,error:i,onEdit:o,onUnlink:a}=e,s=i?d.jsx(BUe,{}):d.jsx(UUe,{...e,largeIconName:n,loading:r});return d.jsx(m.Card,{sx:{width:420},children:d.jsxs(m.CardContent,{gap:12,children:[d.jsxs(m.Box,{display:"grid",gridTemplateColumns:"max-content 1fr min-content",gridTemplateRows:"1fr",gap:8,children:[s,d.jsxs(m.ButtonGroup,{size:"medium",color:"grey",sx:{justifySelf:"end"},children:[o&&d.jsx(m.Button,{startIcon:"edit",onClick:o}),a&&d.jsx(m.Button,{startIcon:"linkOff",onClick:a})]})]}),!i&&d.jsx(DUe,{description:t,loading:r})]})})}function jUe(e){const{url:t,title:n,loading:r}=e;return r?d.jsx(tY,{height:16,width:80}):n?d.jsx(m.Text,{variant:"smallBold",href:t==null?void 0:t.toString(),children:n}):null}function LUe(e){const{subTitle:t,loading:n}=e;return n?d.jsx(m.Box,{padding:{block:2},children:d.jsx(tY,{height:12,width:60})}):t?d.jsx(m.Text,{variant:"small",color:"grey11",noWrap:!0,children:t}):null}function DUe(e){const{description:t,loading:n}=e;return!t||n?null:d.jsx(m.Text,{variant:"small",color:"grey11",children:t})}function UUe(e){const{largeIconName:t,title:n,url:r,loading:i,subTitle:o}=e;return d.jsxs(d.Fragment,{children:[d.jsx(m.ConjoinedIcons,{largeIconName:t,smallIconName:"link"}),d.jsxs(m.Box,{flexDirection:"column",minWidth:0,children:[d.jsx(jUe,{title:n,url:r,loading:i}),d.jsx(LUe,{subTitle:o,loading:i})]})]})}function BUe(){return d.jsxs(m.Box,{alignItems:"center",gap:8,children:[d.jsx(m.BackgroundIcon,{name:"alert",color:"tomato",size:"small"}),d.jsx(m.Text,{color:"tomato11",children:"Failed to load linked document data"})]})}function tY(e){const{width:t,height:n}=e;return d.jsx(m.Skeleton,{color:"grey5",borderRadius:6,width:t,height:n})}function NL(){const e=we();e.searchDocuments||Rt("searchDocuments");const{coreApiBaseUrl:t,authStrategy:n}=e,r=et.useRequest(J1,[t,n]);return new Set(r.languages.map(i=>({id:i.id,label:i.label})))}function PUe(){const e=we();e.searchDocuments||Rt("searchDocuments");const{coreApiBaseUrl:t,authStrategy:n}=e,r=et.useRequest(JQ,[t,n]);return new Set(r.results.map(i=>({id:i,label:i})))}function nY(){const e=we();e.searchDocuments||Rt("searchDocuments");const{customTypesApiBaseUrl:t,repository:n,authStrategy:r}=e,i=VM({baseUrl:t,repository:n,authStrategy:r});return new Set(i.data)}function WUe(e){const{documentTypeId:t,documentUrl:n,title:r,statusColor:i,description:o,tags:a,tagsFilter:s,previewImageUrl:u,highlighted:l,highlightedUID:c,searchTerm:f,onSelect:p}=e;function h(A){return A.nativeEvent instanceof MouseEvent&&(A.metaKey||A.ctrlKey)?window.open(n,"_blank"):p()}return d.jsxs(m.Card,{paddingBlock:16,onSelect:h,variant:l?"highlighted":void 0,color:l?"purple2":void 0,sx:{marginBlock:l?4:0,marginInline:4,flexShrink:0},children:[d.jsx(m.CardContent,{children:d.jsxs(m.Box,{justifyContent:"space-between",gap:6,children:[d.jsxs(m.Box,{flexDirection:"column",gap:4,alignItems:"flex-start",flexGrow:1,children:[d.jsx(NUe,{documentTypeId:t}),d.jsx(qUe,{title:r,statusColor:i,searchTerm:f}),c&&f&&d.jsx(HUe,{uid:c,searchTerm:f}),d.jsx(VUe,{description:o})]}),d.jsx(zUe,{previewImageUrl:u})]})}),a.length>0&&d.jsx(QUe,{tags:a,tagsFilter:s})]})}function NUe(e){const{documentTypeId:t}=e;return d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(m.Badge,{maxWidth:150,size:"medium",title:"Type: error",icon:"description"}),children:d.jsx(I.Suspense,{fallback:d.jsx(m.Skeleton,{width:150,height:24}),children:d.jsx(KUe,{documentTypeId:t})})})}function KUe(e){const{documentTypeId:t}=e,r=[...nY()].find(i=>i.id===t);return d.jsx(m.Badge,{size:"medium",title:`Type: ${(r==null?void 0:r.label)??"Unknown"}`,icon:"description"})}function qUe(e){const{title:t,statusColor:n,searchTerm:r}=e;return d.jsxs(m.Box,{gap:8,alignItems:"center",children:[d.jsx(m.Dot,{color:n}),d.jsx(rY,{text:t,highlight:r})]})}function VUe(e){const{description:t}=e,n=t==null?void 0:t.substring(0,150);return n?d.jsx(m.Text,{variant:"small",color:"grey11",children:`${n}${n!==t?"...":""}`}):d.jsx(m.Text,{variant:"smallItalic",color:"grey11",children:"No description available"})}function zUe(e){const{previewImageUrl:t}=e;return d.jsx(m.Box,{width:142,height:90,backgroundColor:"grey2",border:!0,borderRadius:6,flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4,flexShrink:0,padding:8,children:t?d.jsx(m.Image,{src:t,sizing:"cover"}):d.jsxs(d.Fragment,{children:[d.jsx(m.Icon,{name:"hideImage",size:"large",color:"grey11"}),d.jsx(m.Text,{color:"grey11",variant:"small",children:"No preview available"})]})})}function QUe(e){const{tags:t}=e;return d.jsxs(m.CardFooter,{children:[d.jsxs(m.Box,{gap:4,alignItems:"center",children:[d.jsx(m.Icon,{name:"label",size:"small",color:"grey11"}),d.jsx(m.Text,{variant:"small",color:"grey11",children:"Tags:"})]}),d.jsx(m.TextOverflow,{children:t.map(n=>d.jsx(m.Badge,{size:"medium",title:n,sx:{marginRight:8}},n))})]})}function HUe(e){const{uid:t,searchTerm:n}=e;return d.jsxs(m.Box,{alignItems:"flex-start",children:[d.jsx(m.Icon,{name:"tag",color:"green11",sx:{width:12,height:12}}),d.jsx(rY,{variant:"uid",highlight:n,text:t})]})}function rY(e){const{text:t,highlight:n,variant:r="title"}=e,i=YUe[r],o=n?t.split(new RegExp(`(${ri.escapeStringRegexp(n)})`,"gi")):[t];return d.jsx(m.Text,{variant:i.textVariants.text,color:i.colors.text,hyphens:!0,overflowWrap:"anywhere",children:o.map((a,s)=>a.toLowerCase()===(n==null?void 0:n.toLowerCase())?d.jsx(m.Text,{variant:i.textVariants.highlight,hyphens:!0,overflowWrap:"anywhere",highlight:!0,highlightColor:i.colors.highlight,highlightBorderRadius:2,color:i.colors.highlightText,children:a},s):a)})}const YUe={title:{colors:{text:void 0,highlight:void 0,highlightText:"purple11"},textVariants:{text:"bold",highlight:"bold"}},uid:{colors:{text:"green11",highlight:"green3",highlightText:"green11"},textVariants:{text:"extraSmall",highlight:"extraSmall"}}};function GUe(e){const{searchTerm:t,tagsFilter:n,typesFilter:r,localesFilter:i}=e,o=we();o.searchDocuments||Rt("searchDocuments");const{storageVersion:a}=et.useRequest(J1,[o.coreApiBaseUrl,o.authStrategy]);o.searchDocuments||Rt("searchDocuments");const{status:s}=o,{data:u}=li.useSuspenseQuery({...QQ({searchTerm:t,tags:[...ei.map(n,l=>l.id)],customTypes:[...ei.map(r,l=>l.id)],locale:[...ei.map(i,l=>l.id)][0]??"",status:zw[s],storageVersion:a,config:o}),select:l=>JUe(l.results,zw[s]),staleTime:300});return{documents:u.results}}function JUe(e,t){return{results:e.flatMap(r=>{const o=r.versions.filter(a=>t.includes(a.status));return o.length===0?[]:{...r,versions:o}})}}function ZUe(e,t){const n=we(),r=ze.useDebounceState({initialState:""}),[i,o]=I.useState(new Set),[a,s]=I.useState(new Set);function u(){return!n.searchDocuments||!n.localeId?new Set:new Set([{id:n.localeId,label:n.localeId}])}const[l,c]=I.useState(u),f=ei.union(a,Mv(e)),p=ei.union(i,Mv(t));return{searchTerm:r,filteredTags:i,setFilteredTags:o,filteredCustomTypes:a,setFilteredCustomTypes:s,filteredLocales:l,setFilteredLocales:c,typesFilter:f,tagsFilter:p}}function Mv(e){return e?ei.map(e,t=>({id:t,label:t})):new Set}function XUe(e){const{filteredLocales:t,setFilteredLocales:n,filteredTags:r,setFilteredTags:i,filteredCustomTypes:o,setFilteredCustomTypes:a,fixedTags:s,fixedCustomTypes:u}=e;return d.jsxs(d.Fragment,{children:[d.jsx(tBe,{selectedValues:t,onSelectedValuesChange:n}),d.jsx(n_,{selectedValues:r,fixedSelectedValues:Mv(s),onSelectedValuesChange:i,label:"Tags",icon:"label",fetchFilters:PUe}),d.jsx(n_,{selectedValues:o,fixedSelectedValues:Mv(u),onSelectedValuesChange:a,label:"Type",icon:"description",fetchFilters:nY})]})}function n_(e){const[t,n]=I.useState(!1),r=I.useRef(null);return d.jsx(m.ErrorBoundary,{ref:r,renderError:()=>{var i;return d.jsx(m.FilterField,{mode:"error",onErrorRetry:(i=r.current)==null?void 0:i.reset,open:t,setOpen:n,values:new Set,...e})},children:d.jsx(I.Suspense,{fallback:d.jsx(m.FilterField,{mode:"loading",open:t,setOpen:n,values:new Set,...e}),children:d.jsx(eBe,{open:t,setOpen:n,...e})})})}function eBe(e){const{open:t,setOpen:n,onSelectedValuesChange:r,fixedSelectedValues:i,selectedValues:o,label:a,icon:s,fetchFilters:u,multiple:l}=e,c=u();return d.jsx(m.FilterField,{open:t,setOpen:n,label:a,icon:s,selectedValues:o,values:new Set(c),fixedSelectedValues:i,onSelectedValuesChange:r,multiple:l})}function tBe(e){const{selectedValues:t,onSelectedValuesChange:n}=e,[r,i]=I.useState(ei.first(t));function o(s){n(s),i(ei.first(s))}const a=ei.find(NL(),s=>{var u;return s.id===((u=ei.first(t))==null?void 0:u.id)});return(a==null?void 0:a.label)!==(r==null?void 0:r.label)&&i(a),d.jsx(n_,{selectedValues:new Set(r?[r]:[]),onSelectedValuesChange:o,label:"Locale",icon:"public",fetchFilters:NL,multiple:!1})}function iY(e){const{onSelectDocument:t,fixedCustomTypes:n,fixedTags:r,linkedDocumentId:i,...o}=e,a=we(),{searchTerm:s,filteredTags:u,setFilteredTags:l,filteredCustomTypes:c,setFilteredCustomTypes:f,filteredLocales:p,setFilteredLocales:h,typesFilter:A,tagsFilter:g}=ZUe(n,r);return d.jsxs(m.Dialog,{size:{height:727,width:656},hasClose:!1,...o,children:[d.jsx(m.DialogTitle,{hidden:!0,children:"Link to a page"}),d.jsx(m.DialogDescription,{hidden:!0,children:"Search and select a page to link to"}),d.jsx(m.DialogContent,{children:d.jsxs(m.Box,{flexDirection:"column",height:"100%",children:[d.jsxs(m.Box,{padding:{top:16,inline:16,bottom:8},flexDirection:"column",gap:12,children:[d.jsx(m.FormInput,{value:s.value,onValueChange:s.set,placeholder:"Search a page",icon:"search"}),a.searchDocuments&&d.jsx(XUe,{filteredTags:u,setFilteredTags:l,filteredCustomTypes:c,setFilteredCustomTypes:f,filteredLocales:p,setFilteredLocales:h,fixedTags:r,fixedCustomTypes:n})]}),a.searchDocuments?d.jsx(nBe,{searchTerm:s.debouncedValue,tagsFilter:g,typesFilter:A,localesFilter:p,onSelectDocument:t,linkedDocumentId:i}):d.jsx(aY,{title:"Oops!",message:"Slice Machine does not yet support mock data for linked documents in the simulator."})]})})]})}function nBe(e){const{searchTerm:t,tagsFilter:n,typesFilter:r,localesFilter:i,linkedDocumentId:o,onSelectDocument:a}=e;return d.jsxs(m.ScrollArea,{style:{flexGrow:1,paddingBottom:m.theme.space[16],paddingInline:m.theme.space[12],display:"flex",flexDirection:"column"},children:[o&&d.jsxs(d.Fragment,{children:[d.jsx(qL,{children:"Linked page"}),d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(KL,{description:"An error occurred while fetching the linked page."}),children:d.jsx(I.Suspense,{fallback:uBe,children:d.jsx(oBe,{linkedDocumentId:o,tagsFilter:n,onSelectDocument:a})})})]}),d.jsx(qL,{children:"Link to a page"}),d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(KL,{description:"An error occurred while fetching pages."}),children:d.jsx(I.Suspense,{fallback:iBe,children:d.jsx(rBe,{searchTerm:t,tagsFilter:n,localesFilter:i,typesFilter:r,linkedDocumentId:o,onSelectDocument:a})})})]})}function rBe(e){const{searchTerm:t,tagsFilter:n,localesFilter:r,typesFilter:i,linkedDocumentId:o,onSelectDocument:a}=e,{documents:s}=GUe({searchTerm:t,tagsFilter:n,localesFilter:r,typesFilter:i}),u=s.filter(l=>l.id!==o);return u.length===0?d.jsx(aY,{title:s.length===1?"No other pages found!":void 0}):d.jsx(m.Box,{flexDirection:"column",gap:12,children:u.map(l=>{const c=l==null?void 0:l.versions[0];return c?d.jsx(oY,{document:l,version:c,tagsFilter:n,searchTerm:t,onSelectDocument:a},`${l.id}-${c.status}`):null})})}const iBe=d.jsx(m.Box,{flexDirection:"column",gap:12,children:wt.range(1,3).map(e=>d.jsx(m.Skeleton,{height:124,sx:{marginInline:4},zIndex:-1},e))});function KL(e){const{description:t}=e;return d.jsx(m.Box,{flexDirection:"column",alignItems:"center",justifyContent:"center",children:d.jsx(m.DefaultErrorMessage,{title:"Request failed",description:t,errorImageSrc:m.dialogErrorImage})})}function oBe(e){const{linkedDocumentId:t,tagsFilter:n,onSelectDocument:r}=e,i=lBe(t),o=aBe(i);return d.jsx(oY,{document:i,version:o,tagsFilter:n,onSelectDocument:r,highlighted:!0})}function aBe(e){return I.useMemo(()=>sBe(e),[e])}function sBe(e){return wt.sort(e.versions,t=>t.status==="unclassified"||t.status==="published"?-1:0,t=>t.status==="release"?-1:0,t=>-t.last_modified_date.getTime())[0]}const uBe=d.jsx(m.Skeleton,{height:124,sx:{marginBlock:4,marginInline:4},zIndex:-1});function lBe(e){const t=we();t.searchDocuments||Rt("searchDocuments");const{coreApiBaseUrl:n,authStrategy:r}=t;return et.useRequest(zm,[n,r,e])}function oY(e){var p;const{document:t,version:n,tagsFilter:r,highlighted:i,onSelectDocument:o,searchTerm:a}=e,s=we();if(!t||!n)return null;const u=KM({documentId:t.id,versionId:n.status==="archived"?n.version_id:void 0,releaseId:n.status==="release"?n.release_id:void 0,status:n.status,baseUrl:s.baseUrl}),l=cBe({tags:n.tags,tagsFilter:r}),c=Jw(n)&&n.summary||PQ(n)&&n.preview_summary||"",f=Jw(n)?(p=n.highlights)==null?void 0:p.uid:void 0;return d.jsx(WUe,{documentTypeId:t.custom_type_id,documentUrl:u,description:c,tags:l,title:t.title,previewImageUrl:n.preview_image,onSelect:()=>o(t.id),statusColor:bQ[n.status].color,highlighted:i,highlightedUID:f,searchTerm:a})}function qL(e){const{children:t}=e;return d.jsx(m.Box,{position:"sticky",top:0,backgroundColor:"white",padding:{block:6,inline:4},children:d.jsx(m.Text,{variant:"smallBold",color:"grey11",children:t})})}function aY(e){const{title:t="No pages found!",message:n="Consider using different keywords or tweaking your filters to find what you need."}=e;return d.jsx(m.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:d.jsxs(m.BlankSlate,{children:[d.jsx(m.BlankSlateIcon,{name:"close",lineColor:"tomato11",backgroundColor:"tomato4",size:48}),d.jsx(m.BlankSlateTitle,{size:"big",children:t}),d.jsx(m.BlankSlateDescription,{width:360,children:n})]})})}function cBe(e){const{tags:t,tagsFilter:n}=e,r=[...n].map(o=>o.label).reverse();return wt.sort(t,o=>-r.indexOf(o))}function sY(e){const{hasLink:t,onUnlink:n,selectEnabled:r,selectedType:i,value:o,onOpenLinkModal:a,onValueChange:s,openInNewTab:u=!0,condensedButtons:l=!1,showNewTabButton:c=!1,displayTextEnabled:f,variants:p,variant:h,onVariantChange:A}=e;return d.jsxs(d.Fragment,{children:[!f&&c&&u&&d.jsx(m.Badge,{title:"Open in a new tab",color:"indigo",size:"small",icon:"openInNew",onClick:a}),!t&&r&&d.jsxs(m.Select,{value:i==="any"?void 0:i,color:"grey",size:"small",boldTriggerText:!0,position:"popper",sideOffset:4,startIcon:id({selectType:i}),disabled:!r,onValueChange:s,placeholder:l?"":Dc("any"),onlyStartIcon:l&&i!==void 0,renderTrigger:({button:g})=>d.jsx(m.Tooltip,{content:Dc(i),visible:l,children:g}),children:[d.jsx(m.SelectItem,{value:"web",icon:"public",children:Dc("web")}),d.jsx(m.SelectItem,{value:"document",icon:"description",children:Dc("document")}),d.jsx(m.SelectItem,{value:"media",icon:"image",children:Dc("media")})]},i===void 0?"unlinked":"linked"),!t&&!r&&d.jsx(m.Button,{startIcon:id({selectType:i}),color:"grey",textColor:"link",textWeight:"normal",size:"small",onClick:a,children:Dc(i)}),t&&!f&&d.jsx(m.Button,{startIcon:"close",color:"grey",size:"small",onClick:n,"aria-label":"Close"}),t&&f&&d.jsxs(m.ButtonGroup,{density:"compact",children:[d.jsx(m.Button,{startIcon:id({selectType:i}),renderEndIcon:()=>u&&i==="web"?d.jsx(m.Icon,{name:"openInNew",size:"extraSmall",color:"indigo11"}):null,color:"grey",textColor:"link",textWeight:"normal",size:"small",disabled:!t,onClick:a,children:o.length>30?`${o.slice(0,30)}...`:o}),d.jsx(m.Button,{startIcon:"close",color:"grey",size:"small",onClick:n})]}),p.length>1&&d.jsx(m.Select,{value:h,color:"grey",size:"small",boldTriggerText:!0,position:"popper",sideOffset:4,startIcon:"colorLens",onValueChange:A,children:p.map((g,y)=>d.jsx(m.SelectItem,{value:g,children:g},`${g}-${y}`))})]})}function Dc(e){if(!e||e==="any")return"Choose link type";switch(e){case"document":return"Link to Prismic page";case"web":return"Link to web page";case"media":return"Link to media"}}function uY(e){const{onEdit:t,onUnlink:n,url:r,title:i,subTitle:o}=e,[a,s]=I.useState(null);return d.jsx(m.Card,{paddingBlock:16,ref:s,children:d.jsxs(m.CardContent,{children:[d.jsx(fBe,{url:r,title:i,subTitle:o,onEdit:t,onUnlink:n,container:a}),r&&d.jsx(m.CheckerBoard,{children:d.jsx(dBe,{children:d.jsx(m.Image,{src:r,alt:i,sizing:"contain"})})})]})})}function dBe(e){const{children:t}=e;return d.jsx(m.Box,{flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",height:327,children:t})}function fBe(e){const{url:t,title:n,subTitle:r,onEdit:i,onUnlink:o,container:a}=e;return d.jsxs(m.Box,{flexDirection:"row",justifyContent:"space-between",gap:8,children:[d.jsxs(m.Box,{gap:8,minWidth:0,children:[d.jsx(m.ConjoinedIcons,{largeIconName:"image",smallIconName:"link"}),d.jsxs(m.Box,{flexDirection:"column",minWidth:0,children:[d.jsx(m.Text,{noWrap:!0,variant:"smallBold",href:t,inline:!0,children:n}),d.jsx(m.Text,{variant:"small",color:"grey11",children:r})]})]}),d.jsxs(m.ButtonGroup,{size:"medium",color:"grey",children:[i&&d.jsx(m.Tooltip,{content:"Edit link",side:"top",container:a,children:d.jsx(m.Button,{startIcon:"edit",onClick:i})}),o&&d.jsx(m.Tooltip,{content:"Remove link",side:"top",container:a,children:d.jsx(m.Button,{startIcon:"linkOff",onClick:o})})]})]})}function pBe(e){var K,H,z;const{field:t,content:n,onContentChange:r}=e,i=_(),o=((K=t.config)==null?void 0:K.allowText)??!1,a=o&&(n==null?void 0:n.value.text)||void 0,s=((H=t.config)==null?void 0:H.variants)??[],l=(n==null?void 0:n.value.variant)&&s.includes(n==null?void 0:n.value.variant)?n==null?void 0:n.value.variant:s[0],[c,f]=I.useState(C),p=fe.FilledExternalLinkContent.is(n==null?void 0:n.value)&&(n==null?void 0:n.value.target)||void 0,[h,A]=I.useState(!1),g=I.useRef(null);ze.useOnChange(i,$);const y=c?hBe[c]:void 0;function C(){var N,Y;return!((N=t.config)!=null&&N.select)||n!=null&&n.value.__TYPE__?n==null?void 0:n.value.__TYPE__:VL[(Y=t.config)==null?void 0:Y.select]}function _(){return n?fe.FilledDocumentLinkContent.is(n.value)?n.value.id:fe.FilledExternalLinkContent.is(n.value)?n.value.url:fe.FilledFileLinkContent.is(n.value)||fe.FilledImageLinkContent.is(n.value)?n.value.name:"":""}function b(N){var F;const{displayText:Y,variant:ee}=N;if(!Y&&!ee)return r(void 0);switch((F=t.config)==null?void 0:F.select){case"web":return r({__TYPE__:"LinkContent",key:Uc(n),value:{__TYPE__:"ExternalLink",kind:"web",...Y&&{text:Y},...ee&&{variant:ee}}});case"document":return r({__TYPE__:"LinkContent",key:Uc(n),value:{__TYPE__:"DocumentLink",kind:"document",...Y&&{text:Y},...ee&&{variant:ee}}});case"media":return r({__TYPE__:"LinkContent",key:Uc(n),value:{__TYPE__:"MediaLink",kind:"media",...Y&&{text:Y},...ee&&{variant:ee}}});default:return r({__TYPE__:"LinkContent",key:Uc(n),value:{__TYPE__:"AnyLink",kind:"any",...Y&&{text:Y},...ee&&{variant:ee}}})}}function v(N,Y){if(!N)return b({displayText:a,variant:l});const{newTab:ee=!1}=Y??{},F=ee?"_blank":void 0;switch(c){case"ExternalLink":return r({__TYPE__:"LinkContent",key:Uc(n),value:{__TYPE__:"ExternalLink",url:N,target:F,...a&&{text:a},...l&&{variant:l}}});case"DocumentLink":return r({__TYPE__:"LinkContent",key:Uc(n),value:{__TYPE__:"DocumentLink",id:N,...a&&{text:a},...l&&{variant:l}}});default:return r(void 0)}}function S(N){return n?r({__TYPE__:n.__TYPE__,key:n.key,value:{...n.value,text:N}}):b({displayText:N})}function w(N){return n?r({__TYPE__:n.__TYPE__,key:n.key,value:{...n.value,variant:N}}):b({variant:N})}const T=mBe();function E(N){f(N?VL[N]:void 0),v(""),N&&N!=="any"&&T(N)}function R(N){v(N)}function O(){A(!0)}function $(){var N;h&&(A(!1),(N=g.current)==null||N.reset())}function B(N){const Y=lY({media:N});switch(Y.value.__TYPE__){case"ImageLink":return r({__TYPE__:Y.__TYPE__,key:Y.key,value:{...Y.value,...a&&{text:a},...l&&{variant:l}}});case"FileLink":return r({__TYPE__:Y.__TYPE__,key:Y.key,value:{...Y.value,...a&&{text:a},...l&&{variant:l}}})}}return{contentType:c,selectType:y,fieldValue:i,onDisplayTextChange:S,onValueChange:v,onTypeChange:E,placeholder:$c(t),isTypeSelectEnabled:!((z=t.config)!=null&&z.select),onDocumentSelected:R,onError:O,errorBoundaryRef:g,isTargetNewTab:p==="_blank",onMediaSelected:B,displayTextEnabled:o,displayText:a??"",variants:s,variant:l,onVariantChange:w}}function Uc(e){return e?e.key:crypto.randomUUID()}const hBe={AnyLink:"any",DocumentLink:"document",ExternalLink:"web",FileLink:"media",ImageLink:"media",MediaLink:"media"},VL={any:"AnyLink",document:"DocumentLink",web:"ExternalLink",media:"FileLink"};function ABe(e){const t=we();t.searchDocuments||Rt("searchDocuments");const{coreApiBaseUrl:n,authStrategy:r}=t;return et.useRequest(zm,[n,r,e]).title}et.cache.registerFetcherConfig(zm,{concurrency:50});function lY(e){var i,o,a,s,u,l;const{media:t}=e,n="kind"in t;return n&&t.kind==="image"?{__TYPE__:"LinkContent",key:crypto.randomUUID(),value:{__TYPE__:"ImageLink",id:t.id,name:t.filename,url:t.url,kind:"image",size:t.size.toString(),height:((i=t.height)==null?void 0:i.toString())??`${Es}`,width:((o=t.width)==null?void 0:o.toString())??`${Es}`,date:((a=t.last_modified)==null?void 0:a.toString())??""}}:n?{__TYPE__:"LinkContent",key:crypto.randomUUID(),value:{__TYPE__:"FileLink",id:t.id,name:t.filename,kind:"file",url:t.url,size:t.size.toString(),date:((s=t.last_modified)==null?void 0:s.toString())??""}}:{__TYPE__:"LinkContent",key:crypto.randomUUID(),value:{__TYPE__:"ImageLink",id:t.id,name:(t==null?void 0:t.alt)??t.url,kind:"image",url:t.url,size:"0",height:((u=t.height)==null?void 0:u.toString())??`${Es}`,width:((l=t.width)==null?void 0:l.toString())??`${Es}`}}}const mBe=()=>{const e=XDe(),{onAnalyticsEvent:t}=we();function n(r){e&&t&&t("Generic Link Added",{type:r,isInSlice:String(e.isInSlice),isInGroup:String(e.isInGroup),isInRepeatable:String(e.isInRepeatable),customTypeFormat:e.customTypeFormat??"custom"})}return n};function gBe(e){const{open:t,onOpenChange:n,showNewTabButton:r}=e,{url:i,setUrl:o,openInNewTab:a,setOpenInNewTab:s,disabled:u,onUpdate:l}=vBe(e);return d.jsxs(m.Dialog,{open:t,onOpenChange:n,size:"small",noDescription:!0,children:[d.jsx(m.DialogHeader,{title:"Set Link URL"}),d.jsxs(m.DialogContent,{padding:16,children:[d.jsx(m.FormInput,{value:i,onValueChange:o,placeholder:"Paste URL",icon:"public"}),r&&d.jsx(m.InlineLabel,{value:"Open in a new tab",children:d.jsx(m.Checkbox,{checked:a,onCheckedChange:s})})]}),d.jsxs(m.DialogActions,{children:[d.jsx(m.DialogCancelButton,{}),d.jsx(m.DialogActionButton,{onClick:l,disabled:u,children:"Update"})]})]})}function vBe(e){const{url:t,openInNewTab:n,onUpdate:r,open:i}=e,[o,a]=I.useState(t),[s,u]=I.useState(n);ze.useOnChange(i,()=>{i&&(a(t),u(n))});const l=!o||o===t&&s===n;function c(){r(o,{newTab:s})}return{url:o,setUrl:a,openInNewTab:s,disabled:l,setOpenInNewTab:u,onUpdate:c}}function iF(e){var Y,ee,F,M;const{content:t,field:n,id:r,onContentChange:i,appearance:o="normal",backgroundColor:a="grey1"}=e,s=ze.useDebounceState({initialState:!1}),[u,l]=I.useState(),{contentType:c,fieldValue:f,errorBoundaryRef:p,onDocumentSelected:h,onError:A,onMediaSelected:g,onValueChange:y,selectType:C,onTypeChange:_,isTypeSelectEnabled:b,displayTextEnabled:v,...S}=pBe({content:t,field:n,onContentChange:i}),w=c==="DocumentLink"&&f!=="",E=c==="ExternalLink"&&ni.toURL(f),R=!!((Y=n.config)!=null&&Y.allowTargetBlank);function O(){switch(c){case"DocumentLink":return l("document");case"ExternalLink":return l("web");case"FileLink":case"ImageLink":case"MediaLink":return l("media");default:return l(void 0)}}const $={...S,id:r,onFocus:()=>s.set(!0),onBlur:()=>s.set(!1),onOpenLinkModal:O,onUnlink:()=>{b?_(void 0):y("")},onSelectValueChange:W=>{_(W),l(W)},value:f,allowTargetBlank:R,selectType:C,onValueChange:y,isTypeSelectEnabled:b,displayTextEnabled:v,onKeyDown(W){v||(W.key==="Enter"||W.key===" ")&&(O(),W.preventDefault())},onClick:()=>{v||O()},appearance:o},{searchDocuments:B}=we();function K(W){if(W)return;const re=t&&t.value.__TYPE__!=="AnyLink";!W&&!re&&b&&_(void 0),l(void 0)}function H(W,re){y(W,re),l(void 0)}function z(W){g(W),l(void 0)}function N(W){h(W),l(void 0)}return d.jsxs(d.Fragment,{children:[d.jsxs(m.Popover,{align:"start",sideOffset:-3,focusOnEnter:!1,open:s.debouncedValue,anchor:d.jsxs(m.Field,{variant:yBe(o),color:a,children:[w?d.jsx(SBe,{documentId:f,displayTextEnabled:v}):d.jsx(m.FieldIcon,{name:id({selectType:C,displayTextEnabled:v})}),o!=="compact"&&d.jsx(m.FieldLabel,{htmlFor:r,children:wr(n)}),d.jsx(m.FieldControl,{children:w&&B?d.jsx(_Be,{errorBoundaryRef:p,onError:A,fallback:d.jsx(r_,{...$,value:"..."}),renderError:()=>bBe($),children:d.jsx(CBe,{...$,documentId:f})}):d.jsx(r_,{...$})})]}),children:[E&&d.jsx(Sl,{url:E,title:ni.getUrlTitle(E)??"",subTitle:E.toString()}),t&&fe.FilledImageLinkContent.is(t.value)&&d.jsx(uY,{url:t.value.url,title:t.value.name,subTitle:`${t.value.width} x ${t.value.height} pixels`})]}),d.jsx(gBe,{open:u==="web",onOpenChange:K,onUpdate:H,url:f,openInNewTab:S.isTargetNewTab,showNewTabButton:!!((ee=n.config)!=null&&ee.allowTargetBlank)}),d.jsx(rF,{open:u==="media",onOpenChange:K,onMediaSelected:z,assetType:"all"}),d.jsx(iY,{open:u==="document",onOpenChange:K,onSelectDocument:N,fixedCustomTypes:new Set((F=n.config)==null?void 0:F.customtypes),fixedTags:new Set((M=n.config)==null?void 0:M.tags),linkedDocumentId:t&&fe.FilledDocumentLinkContent.is(t.value)?t.value.id:void 0})]})}function yBe(e){switch(e){case"compact":return"compact";case"normal":return"normal";default:return}}function bBe(e){return d.jsx(r_,{...e})}function r_(e){const{id:t,value:n,onOpenLinkModal:r,onBlur:i,isTypeSelectEnabled:o,selectType:a,onSelectValueChange:s,onUnlink:u,isTargetNewTab:l,allowTargetBlank:c,displayTextEnabled:f,displayText:p,onFocus:h,onClick:A,onKeyDown:g,appearance:y,placeholder:C,variants:_,variant:b,onVariantChange:v,onDisplayTextChange:S,onValueChange:w}=e;return d.jsx(m.Box,{padding:{block:4},width:"100%",children:d.jsx(Tu,{id:t,textOverflow:"ellipsis",variant:f?"normal":"link",readOnly:!f,placeholder:f?"Add your display text":C,padding:cY(y),value:f?p:n,cursor:dY({value:n,displayTextEnabled:f,isTypeSelectEnabled:o}),onBlur:i,onFocus:h,onClick:A,onKeyDown:g,onValueChange:f?S:w,endAdornment:d.jsx(sY,{hasLink:!!(n&&a),onUnlink:u,selectEnabled:o,selectedType:a,value:n,onOpenLinkModal:r,onValueChange:s,openInNewTab:l,condensedButtons:y==="condensedButtons",showNewTabButton:c&&a==="web",displayTextEnabled:f,variants:_,variant:b,onVariantChange:v})})})}function CBe(e){const{id:t,documentId:n,onOpenLinkModal:r,isTypeSelectEnabled:i,selectType:o,displayTextEnabled:a,onSelectValueChange:s,onUnlink:u,onFocus:l,onClick:c,onKeyDown:f,appearance:p,variants:h,variant:A,displayText:g,onVariantChange:y,onDisplayTextChange:C}=e,_=ABe(n),b=fY(n);return d.jsx(Tu,{id:t,textOverflow:"ellipsis",padding:cY(p),placeholder:a?"Add your display text":void 0,readOnly:!a,value:a?g:_,variant:a?"normal":"link",cursor:dY({value:_,displayTextEnabled:a,isTypeSelectEnabled:i}),onFocus:l,onClick:c,onKeyDown:f,onValueChange:a?C:void 0,endAdornment:d.jsxs(m.Box,{gap:4,children:[b&&d.jsx(m.Badge,{title:"Broken Link",color:"tomato"}),d.jsx(sY,{hasLink:!0,onUnlink:u,selectEnabled:i,selectedType:o,value:_,onOpenLinkModal:r,condensedButtons:p==="condensedButtons",onValueChange:s,displayTextEnabled:a,variants:h,variant:A,onVariantChange:y})]})})}function SBe(e){const{documentId:t,displayTextEnabled:n}=e;return d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(m.FieldIcon,{name:"warning"}),children:d.jsx(I.Suspense,{fallback:d.jsx(m.FieldIcon,{name:id({selectType:"document",displayTextEnabled:n})}),children:d.jsx(wBe,{documentId:t,displayTextEnabled:n})})})}function wBe(e){const{displayTextEnabled:t,documentId:n}=e;return fY(n)?d.jsx(m.FieldIcon,{name:"linkOff"}):d.jsx(m.FieldIcon,{name:id({selectType:"document",displayTextEnabled:t})})}function cY(e){switch(e){case"compact":return{input:{inline:4}};default:return}}function _Be(e){const{errorBoundaryRef:t,onError:n,children:r,fallback:i,renderError:o}=e;return d.jsx(m.ErrorBoundary,{ref:t,onError:n,renderError:o,children:d.jsx(I.Suspense,{fallback:i,children:r})})}function id(e){const{selectType:t,displayTextEnabled:n}=e;if(n)return"notes";switch(t){case"document":return"description";case"web":return"public";case"media":return"image";default:return"link"}}function dY(e){const{value:t,displayTextEnabled:n,isTypeSelectEnabled:r}=e;return n?"text":r&&!t?"default":"pointer"}function xBe(e){const{onContentChange:t,...n}=e;function r(i){const o=fe.FilledLinkContent.is(i)?i:void 0;t(o)}return d.jsx(iF,{...n,onContentChange:r})}function fY(e){const t=we();t.uidField||Rt("uidField");const{coreApiBaseUrl:n,authStrategy:r}=t,{data:i}=YM({baseUrl:n,authStrategy:r,documentIds:[e],statuses:["archived","unclassified","published"]});if(i.results.length===0||i.results.length>1)return!1;const o=i.results[0];return o==null?void 0:o.versions.every(a=>a.status==="archived")}function TBe(e){const{onDelete:t,isDeleteEnabled:n,onMoveUp:r,onMoveDown:i,isMoveUpEnabled:o,isMoveDownEnabled:a}=e;return d.jsxs(m.DropdownMenu,{children:[d.jsx(m.DropdownMenuTrigger,{children:d.jsx(m.IconButton,{hiddenLabel:"Link actions",icon:"moreVert",size:"small",variant:"solid"})}),d.jsxs(m.DropdownMenuContent,{children:[d.jsx(m.DropdownMenuLabel,{children:d.jsx(m.Text,{variant:"small",color:"grey11",children:"Item options"})}),d.jsx(m.DropdownMenuItem,{onSelect:r,startIcon:d.jsx(m.Icon,{name:"arrowUpward"}),disabled:!o,children:"Move up"}),d.jsx(m.DropdownMenuItem,{onSelect:i,startIcon:d.jsx(m.Icon,{name:"arrowDownward"}),disabled:!a,children:"Move down"}),d.jsx(m.DropdownMenuItem,{color:"tomato",onSelect:t,startIcon:d.jsx(m.Icon,{name:"delete",color:"tomato9"}),disabled:!n,children:"Delete"})]})]})}function IBe(e){const{field:t,content:n,onContentChange:r}=e,{config:i}=t,o=I.useMemo(()=>MS({config:i}),[i]),a=n!=null&&n.value.length?n.value:[o];function s(p){const h=wt.insertAtIndex(a,p,MS({config:i}));r(Cp(h))}function u(p,h){var y;const A=[...a],g=MS({config:i,key:(y=A[h])==null?void 0:y.key});A[h]=p??g,r(Cp(A))}function l(p){r(Cp(p))}function c(p){const h=wt.removeIndex(a,p);r(Cp(h))}function f(p,h){const A=wt.move(a,h,h+EBe(p));r(Cp(A))}return{links:a,updateLink:u,updateLinks:l,addLink:s,deleteLink:c,moveLink:f}}function EBe(e){switch(e){case"up":return-1;case"down":return 1}}function MS(e){const{config:t,key:n=crypto.randomUUID()}=e,r=RBe(t==null?void 0:t.select);return t!=null&&t.allowText&&(r.text=""),{__TYPE__:"LinkContent",key:n,value:r}}function RBe(e){switch(e){case"web":return{__TYPE__:"ExternalLink",kind:"web"};case"document":return{__TYPE__:"DocumentLink",kind:"document"};case"media":return{__TYPE__:"MediaLink",kind:"media"};default:return{__TYPE__:"AnyLink",kind:"any"}}}function Cp(e){return{__TYPE__:"RepeatableContent",type:"Link",value:e}}function $Be(e){const{id:t,field:n}=e,r=IBe(e),[i,o]=I.useState(!1),{links:a}=r;return d.jsx(ZDe,{children:d.jsxs(m.FieldSet,{id:t,legend:kBe(n.config),variant:"compact",selected:i,children:[d.jsx(OBe,{field:n,items:a,onItemDelete:r.deleteLink,onItemChange:r.updateLink,onItemMove:r.moveLink,onItemAdd:r.addLink,onItemReorder:r.updateLinks,onDragStatusChange:o}),d.jsx(m.Button,{startIcon:"add",color:"grey",onClick:()=>r.addLink(a.length),sx:{marginInline:4,marginBlock:4},children:"Add"})]})})}function kBe(e){return e!=null&&e.label?`Multiple • ${e.label}`:"Multiple"}function OBe(e){const{field:t,items:n,onItemChange:r,onItemDelete:i,onItemMove:o}=e,a=n.length>1,s=MBe(e);return d.jsx(m.AnimatedList,{items:n,getItemKey:u=>u.key,ariaLabel:"Link list",dnd:s,children:(u,l)=>d.jsxs(m.Draggable,{disabled:!a,children:[d.jsx(iF,{appearance:"compact",content:u,field:t,onContentChange:c=>r(c,l),backgroundColor:"transparent"}),d.jsx(TBe,{onDelete:()=>i(l),isDeleteEnabled:n.length>1,onMoveUp:()=>o("up",l),isMoveUpEnabled:l>0,onMoveDown:()=>o("down",l),isMoveDownEnabled:l<n.length-1})]})})}function MBe(e){const{onDragStatusChange:t,onItemReorder:n,onItemAdd:r}=e,{scrollOffsetTop:i}=we(),o=ze.useStableCallback(r);return{renderDropIndicator:s=>d.jsx(FBe,{...s,onItemAdd:o}),scrollOffsetTop:i,onDragChange:t,onReorder:n}}function FBe(e){const{isDropTarget:t,itemIndex:n,position:r,itemCount:i,onItemAdd:o}=e;return n===0&&r==="before"?d.jsx(zL,{isDropTarget:t,position:"before"}):n===i-1&&r==="after"?d.jsx(zL,{isDropTarget:t,position:"after"}):d.jsx(jBe,{index:n,isDropTarget:t,onItemAdd:o})}function jBe(e){const{index:t,onItemAdd:n,isDropTarget:r}=e,[i,o]=I.useState(0);function a(){n(t+1),o(s=>s+1)}return d.jsx(m.HairlineButton,{icon:"add",size:"small",variant:"rightDashed",tooltip:{content:"Add item below"},onClick:a,dropMode:r,sx:{marginInline:4}},i)}function zL(e){const{isDropTarget:t,position:n}=e;return d.jsx(m.AnimatedElement,{enterDuration:150,animation:{name:"expand-vertical"},children:t&&d.jsx(m.Box,{children:d.jsx(m.Line,{color:"purple",thickness:2,sx:{width:"100%",marginBottom:n==="before"?4:void 0,marginTop:n==="after"?4:void 0}},"line")})})}function LBe(e){const{linkTo:t,onLinkToChange:n}=e,r=DBe(t);return d.jsx(xBe,{content:r,onContentChange:i=>n(UBe(i)),field:{type:"Link",config:{label:"Link",allowTargetBlank:!0,allowText:!1}},appearance:"condensedButtons"})}function DBe(e){const[t]=I.useState(()=>crypto.randomUUID());if(e)return{__TYPE__:"LinkContent",key:t,value:e}}function UBe(e){return e==null?void 0:e.value}function pY(e){var b,v;const{allContentViews:t,content:n,contentView:r,fieldLabel:i,imageLabel:o,initialImages:a,isUpdating:s,page:u=0,readOnly:l,thumbnailName:c,onClear:f,onContentChange:p,onCropperDialogClose:h,onPageChange:A,onMediaDialogOpenChange:g}=e,y=((v=(b=n==null?void 0:n.url)==null?void 0:b.split("?")[0])==null?void 0:v.slice(-4))===".svg",C=n!=null&&n.url&&!l?"visible":"hidden",_=!fe.isImageContent(n);return d.jsxs(m.Box,{display:"flex",gap:12,padding:{inline:12},children:[d.jsx(m.Box,{children:d.jsx(m.Carousel,{getItemSource:U2e,items:t,onPageChange:A,page:u,buttonSize:"small",renderPrevTooltip:S=>d.jsx(m.Tooltip,{content:"Previous",children:S}),renderNextTooltip:S=>d.jsx(m.Tooltip,{content:"Next",children:S}),style:_?{width:181,height:142}:{width:123,height:93},children:S=>(S==null?void 0:S.url)&&d.jsx(m.CarouselItem,{"aria-label":"Image Field Item",src:MH(S.url),alt:S.alt??void 0,isUpdating:s,disableAnimation:_},`${c}_${S.url}`)})}),d.jsxs(m.Box,{width:"100%",display:"flex",flexDirection:"column",gap:_?16:12,children:[d.jsx(FUe,{fieldLabel:i,imageLabel:o,initialImages:a,page:u,displaySeparator:!_,isSVGContentView:y,visibility:C,onClear:f,onCropperDialogClose:h,onMediaDialogOpenChange:g}),d.jsx(MUe,{readOnly:l||!r,altText:(r==null?void 0:r.alt)??"",onValueChange:S=>{r&&p(F2e(c,n,r,S))}}),_&&d.jsx(LBe,{linkTo:n.linkTo,onLinkToChange:S=>{p({...n,linkTo:S})}})]})]})}function hY(e){const{onMediaSelected:t}=e,n=we(),{showAlert:r}=m.useAlert(),{mutate:i,isPending:o}=li.useMutation({mutationFn:a=>vH({file:a,config:n}),onSuccess:a=>{t(a)},onError:()=>{r({title:"Error uploading image",subtitle:"Please try again"})}});return{uploadImage:i,isUploadingImage:o}}function BBe(e){const{content:t,onContentChange:n,field:r}=e,[i,o]=I.useState(0),[a,s]=I.useTransition(),u=O2e(r),l=u[i],c=t?M2e(r,t):void 0,f=c==null?void 0:c[i];function p(_){if(!l)return;const b=B2e(l.name,r,t,_);b!==t&&s(()=>n(b))}function h(_){s(()=>o(_))}function A({option:_,croppedImages:b}){if(o(_),!t)return;const v=Object.entries(b).reduce((S,[w,T])=>IUe({field:r,content:S,thumbnail:w,croppedImage:T}),t);v!==t&&s(()=>n(v))}function g(){o==null||o(0),n(void 0)}const{uploadImage:y,isUploadingImage:C}=hY({onMediaSelected:p});return{onCropperDialogClose:A,onPageChange:h,onMediaSelected:p,isUpdating:a,page:i,thumbnail:l,allThumbnails:u,allContentViews:c,contentView:f,onClear:g,uploadImage:y,isUploadingImage:C}}function PBe(e){const{content:t,field:n,readOnly:r,onContentChange:i}=e,o=t&&t.origin.url.length>0,{onCropperDialogClose:a,onPageChange:s,isUpdating:u,page:l,onMediaSelected:c,thumbnail:f,allThumbnails:p,allContentViews:h,contentView:A,onClear:g,uploadImage:y,isUploadingImage:C}=BBe({field:n,content:t,onContentChange:i}),[_,b]=I.useState(!1),v=wr(n),S=p.map((R,O)=>{const $=h==null?void 0:h[O];return{thumbnail:R,contentView:$,labels:Xw(R,t,$)}}),w=f&&o?Xw(f,t,A).filter(Qi.isDefined):[],T=f&&t&&o&&h,E=C||u;return d.jsx(JH,{isMediaDialogOpen:_,onMediaSelected:c,onMediaDialogOpenChange:b,children:d.jsx(I.Suspense,{fallback:d.jsx("div",{style:{height:95}}),children:T?d.jsx(pY,{allContentViews:h,content:t,contentView:A,fieldLabel:v,imageLabel:w,initialImages:S,isUpdating:E,page:l,readOnly:r,thumbnailName:f.name,onClear:g,onContentChange:i,onCropperDialogClose:a,onMediaDialogOpenChange:b,onPageChange:s}):d.jsx(ZH,{uploadImage:y,isUploading:C,disabled:r||_,children:d.jsx(HH,{fieldLabel:v,isUpdating:E,readOnly:r,onMediaDialogOpenChange:b})})})})}function WBe(e){var y,C;const{searchTerm:t,catalogId:n}=e,r=we();r.integrationFields||Rt("integrationFields");const{integrationFieldsApiBaseUrl:i,repository:o,authStrategy:a}=r,[s,u]=I.useState(1),[l,c]=I.useState([]),[f,p]=I.useState(""),h=et.useRequest(NBe,[i,a,o,n,t,t===f?s:1]);t!==f?(p(t),u(1),c(h.items)):h.items.length>0&&((y=wt.last(l))==null?void 0:y.id)!==((C=wt.last(h.items))==null?void 0:C.id)&&c(_=>_.concat(h.items));const A=s<h.totalPages;function g(){A&&u(_=>_+1)}return{items:l,response:h,fetchNextPage:g,hasNextPage:A}}function NBe(e,t,n,r,i,o=1,a=30){const s=new URL(`if/search/${r}`,e);return s.searchParams.set("searchTerm",i),s.searchParams.set("limit",a.toString()),s.searchParams.set("page",o.toString()),se.request(s,{headers:{repository:n},credentials:se.getRequestCredentials(t),okType:KBe})}const AY=k.object({id:k.string(),title:k.string(),imageURL:k.string().optional(),description:k.string().optional()}),KBe=k.object({items:k.array(AY),totalPages:k.number(),page:k.number()});function mY(e){const{itemId:t,catalogId:n}=e,r=we();r.integrationFields||Rt("integrationFields");const{integrationFieldsApiBaseUrl:i,repository:o,authStrategy:a}=r,u=et.useRequest(qBe,[i,a,o,n,t]).items[0];if(!u)throw new Error("Item not found");return{item:u}}function qBe(e,t,n,r,i){const o=new URL(`if/read/${r}`,e);return o.searchParams.set("ids",[i].toString()),se.request(o,{headers:{repository:n},credentials:se.getRequestCredentials(t),okType:VBe})}const VBe=k.object({items:k.array(AY)});function oF(e){const{item:t,onClick:n,catalogId:r}=e;return d.jsxs(m.PreviewCard,{variant:"large",onClick:n,children:[d.jsx(zBe,{src:t.imageURL??"",alt:t.title}),d.jsxs(m.PreviewContent,{children:[d.jsx(m.Badge,{title:`Catalog: ${r}`,icon:"multipleStop",size:"medium"}),d.jsx(m.Text,{variant:"bold",color:"grey12",sx:{marginTop:4},children:t.title}),d.jsx(m.Text,{variant:"small",color:"grey11",children:t.description??t.id})]})]})}const Cg=76;function zBe(e){const{src:t,alt:n}=e;return t?d.jsx(m.PreviewImage,{src:t,alt:n,width:Cg,height:Cg,framed:!0}):d.jsxs(m.Box,{borderRadius:6,backgroundColor:"grey2",height:Cg,width:Cg,flexDirection:"column",alignItems:"center",justifyContent:"center",border:!0,padding:{inline:4,block:8},children:[d.jsx(m.Icon,{name:"hideImage",size:"large",color:"grey11"}),d.jsx(m.Text,{color:"grey11",variant:"small",noSelect:!0,align:"center",children:"No preview image"})]})}function qc(){return d.jsxs(m.PreviewCard,{variant:"large",children:[d.jsx(m.Skeleton,{height:76,width:76}),d.jsxs(m.PreviewContent,{children:[d.jsx(m.Skeleton,{height:24,width:168}),d.jsx(m.Skeleton,{height:24,width:240,sx:{marginTop:4}}),d.jsx(m.Skeleton,{height:16,width:144})]})]})}function QBe(e){const{open:t,onOpenChange:n,catalogId:r,onSelectItem:i}=e,o=ze.useDebounceState({initialState:""}),a=we();return d.jsx(m.Dialog,{open:t,onOpenChange:n,hasClose:!1,size:{width:612,height:724},noDescription:!0,children:d.jsx(m.DialogContent,{children:d.jsxs(m.Box,{flexDirection:"column",height:"100%",children:[d.jsxs(m.Box,{padding:{top:16,inline:16},flexDirection:"column",gap:8,children:[d.jsx(m.FormSearchInput,{value:o.value,onValueChange:o.set,placeholder:"Search in your catalog"}),d.jsx(m.DialogTitle,{asChild:!0,children:d.jsx(m.Text,{variant:"smallBold",color:"grey11",children:"Select an item"})})]}),a.integrationFields?d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(i_,{message:"There was an error while fetching your catalog items."}),children:d.jsx(I.Suspense,{fallback:d.jsxs(m.Box,{flexDirection:"column",gap:12,padding:{top:10,inline:16,bottom:16},children:[d.jsx(qc,{}),d.jsx(qc,{}),d.jsx(qc,{}),d.jsx(qc,{}),d.jsx(qc,{})]}),children:d.jsx(HBe,{searchTerm:o.debouncedValue,catalogId:r,onItemClick:i})})}):d.jsx(i_,{message:"Slice Machine does not yet support mock data for integration field in the simulator."})]})})})}function HBe(e){const{catalogId:t,searchTerm:n,onItemClick:r}=e,[i,o]=I.useTransition(),{items:a,hasNextPage:s,fetchNextPage:u}=WBe({catalogId:t,searchTerm:n});return d.jsx(d.Fragment,{children:d.jsxs(m.ScrollArea,{onScrollToBottom:()=>s&&o(u),style:{flexGrow:1,paddingTop:m.theme.space[10],paddingBottom:m.theme.space[16],paddingInline:m.theme.space[16],display:"flex",flexDirection:"column",gap:m.theme.space[12]},threshold:252,children:[a.length===0?d.jsx(i_,{}):a.map(l=>d.jsx(oF,{item:l,catalogId:t,onClick:()=>r(l)},l.id)),d.jsx(m.AnimatedElement,{animation:{name:"fade"},children:i&&d.jsx(m.Text,{color:"grey11",align:"center",sx:{marginBlock:8},children:"Loading more results ..."})})]})})}function i_(e){const{message:t="We can't find any items matching your search"}=e,n="Oops!";return d.jsx(m.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:d.jsxs(m.BlankSlate,{children:[d.jsx(m.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),d.jsx(m.BlankSlateTitle,{size:"big",children:n}),d.jsx(m.BlankSlateDescription,{width:360,children:t})]})})}function YBe(e){const{itemId:t,item:n}=e,r=we();return t&&n&&n.id===t?d.jsx(Vc,{...e,value:n.title}):t&&r.integrationFields?d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(Vc,{...e,value:t}),children:d.jsx(I.Suspense,{fallback:d.jsx(Vc,{...e,value:t}),children:d.jsx(ZBe,{...e,itemId:t})},t)},t):t&&!r.integrationFields?d.jsx(Vc,{...e,value:t}):d.jsx(Vc,{...e,value:""})}function GBe(e){const{catalogId:t,itemId:n,item:r}=e,i=we();return n&&r&&r.id===n?d.jsx(m.FieldFooter,{children:d.jsx(oF,{catalogId:t,item:r})}):n&&i.integrationFields?d.jsx(m.ErrorBoundary,{renderError:()=>null,children:d.jsx(m.FieldFooter,{children:d.jsx(I.Suspense,{fallback:d.jsx(qc,{}),children:d.jsx(JBe,{catalogId:t,itemId:n})},n)})},n):null}function JBe(e){const{itemId:t,catalogId:n}=e,{item:r}=mY({catalogId:n,itemId:t});return d.jsx(oF,{catalogId:n,item:r})}function Vc(e){const{id:t,field:n,readOnly:r,value:i,onFocus:o,onClearItem:a}=e;return d.jsx(Tu,{id:t,placeholder:$c(n),readOnly:!0,variant:"link",value:i,...!r&&{cursor:"pointer",onFocus:o},endAdornment:d.jsx(m.Button,{startIcon:"close",color:"grey",size:"small",disabled:!i,onClick:a})})}function ZBe(e){const{itemId:t,catalogId:n}=e,{item:r}=mY({catalogId:n,itemId:t});return d.jsx(Vc,{...e,value:r.title})}function XBe(e){var h;const{id:t,field:n,content:r,readOnly:i,onContentChange:o}=e,[a,s]=I.useState(!1),[u,l]=I.useState(),c=(h=n.config)==null?void 0:h.catalog;if(!c)return null;function f(A){o({value:A.id,__TYPE__:"IntegrationFieldsContent"}),l(A),s(!1)}function p(){o(void 0),l(void 0)}return d.jsxs(d.Fragment,{children:[d.jsxs(m.Field,{footer:d.jsx(GBe,{catalogId:c,item:u,itemId:r==null?void 0:r.value}),children:[d.jsx(m.FieldIcon,{name:"multipleStop"}),d.jsx(m.FieldLabel,{htmlFor:t,children:wr(n)}),d.jsx(m.FieldControl,{children:d.jsx(YBe,{id:t,field:n,readOnly:i,catalogId:c,item:u,itemId:r==null?void 0:r.value,onFocus:()=>s(!0),onClearItem:p})})]}),d.jsx(QBe,{open:a,onOpenChange:s,catalogId:c,onSelectItem:f})]})}function gY(e){const{content:t,field:n,id:r,onContentChange:i,readOnly:o,endAdornment:a,placeholder:s}=e;return d.jsxs(m.Field,{children:[d.jsx(m.FieldIcon,{name:"notes"}),d.jsx(m.FieldLabel,{htmlFor:r,children:wr(n)}),d.jsxs(m.FieldControl,{children:[d.jsx(m.TextArea,{id:r,placeholder:s||$c(n),readOnly:o,paddingLeft:4,paddingRight:12,sx:{flexGrow:1},value:(t==null?void 0:t.value)??"",onChange:u=>{i(ePe(u))}}),a]})]})}function ePe(e){return e.length===0?void 0:{__TYPE__:"FieldContent",type:"Text",value:e}}function tPe(e){var s;const{content:t,id:n,field:r,onContentChange:i,readOnly:o}=e,a={id:n,readOnly:o,onContentChange:i};return(s=r.config)!=null&&s.repeat?d.jsx($Be,{...a,field:r,content:gQ(t)}):d.jsx(iF,{...a,field:r,content:vQ(t)})}const nPe=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var s,u;const o=Number(e==null?void 0:e.value),a=Number.isFinite(o)?o:void 0;return d.jsxs(m.Field,{children:[d.jsx(m.FieldIcon,{name:"pin"}),d.jsx(m.FieldLabel,{htmlFor:n,children:wr(t)}),d.jsx(m.FieldControl,{children:d.jsx(m.NumberInput,{id:n,value:a,min:(s=t.config)==null?void 0:s.min,max:(u=t.config)==null?void 0:u.max,padding:qH,placeholder:$c(t),readOnly:i,onValueChange:l=>r(rPe(l))})})]})};function rPe(e){return e===void 0?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(e)}}function In(e){this.content=e}In.prototype={constructor:In,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return i==-1?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new In(o)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new In(n)},addToStart:function(e,t){return new In([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new In(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(o==-1?i.length:o,0,t,n),new In(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=In.from(e),e.size?new In(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=In.from(e),e.size?new In(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=In.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}};In.from=function(e){if(e instanceof In)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new In(t)};function vY(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let a=0;i.text[a]==o.text[a];a++)n++;return n}if(i.content.size||o.content.size){let a=vY(i.content,o.content,n+1);if(a!=null)return a}n+=i.nodeSize}}function yY(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let a=e.child(--i),s=t.child(--o),u=a.nodeSize;if(a==s){n-=u,r-=u;continue}if(!a.sameMarkup(s))return{a:n,b:r};if(a.isText&&a.text!=s.text){let l=0,c=Math.min(a.text.length,s.text.length);for(;l<c&&a.text[a.text.length-l-1]==s.text[s.text.length-l-1];)l++,n--,r--;return{a:n,b:r}}if(a.content.size||s.content.size){let l=yY(a.content,s.content,n-1,r-1);if(l)return l}n-=u,r-=u}}class q{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,o){for(let a=0,s=0;s<n;a++){let u=this.content[a],l=s+u.nodeSize;if(l>t&&r(u,i+s,o||null,a)!==!1&&u.content.size){let c=s+1;u.nodesBetween(Math.max(0,t-c),Math.min(u.content.size,n-c),r,i+c)}s=l}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let o="",a=!0;return this.nodesBetween(t,n,(s,u)=>{let l=s.isText?s.text.slice(Math.max(t,u)-u,n-u):s.isLeaf?i?typeof i=="function"?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&l||s.isTextblock)&&r&&(a?a=!1:o+=r),o+=l},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<t.content.length;o++)i.push(t.content[o]);return new q(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let o=0,a=0;a<n;o++){let s=this.content[o],u=a+s.nodeSize;u>t&&((a<t||u>n)&&(s.isText?s=s.cut(Math.max(0,t-a),Math.min(s.text.length,n-a)):s=s.cut(Math.max(0,t-a-1),Math.min(s.content.size,n-a-1))),r.push(s),i+=s.nodeSize),a=u}return new q(r,i)}cutByIndex(t,n){return t==n?q.empty:t==0&&n==this.content.length?this:new q(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new q(i,o)}addToStart(t){return new q([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new q(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];t(i,r,n),r+=i.nodeSize}}findDiffStart(t,n=0){return vY(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return yY(this,t,n,r)}findIndex(t,n=-1){if(t==0)return Sg(0,t);if(t==this.size)return Sg(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),a=i+o.nodeSize;if(a>=t)return a==t||n>0?Sg(r+1,a):Sg(r,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return q.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new q(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return q.empty;let n,r=0;for(let i=0;i<t.length;i++){let o=t[i];r+=o.nodeSize,i&&o.isText&&t[i-1].sameMarkup(o)?(n||(n=t.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new q(n||t,r)}static from(t){if(!t)return q.empty;if(t instanceof q)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new q([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}q.empty=new q([],0);const FS={index:0,offset:0};function Sg(e,t){return FS.index=e,FS.offset=t,FS}function Fv(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!Fv(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!Fv(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let St=class o_{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let i=0;i<t.length;i++){let o=t[i];if(this.eq(o))return t;if(this.type.excludes(o.type))n||(n=t.slice(0,i));else{if(o.type.excludes(this.type))return t;!r&&o.type.rank>this.type.rank&&(n||(n=t.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Fv(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return o_.none;if(t instanceof o_)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};St.none=[];class wl extends Error{}class V{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=CY(this.content,t+this.openStart,n);return r&&new V(r,this.openStart,this.openEnd)}removeBetween(t,n){return new V(bY(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return V.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new V(q.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=t.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new V(t,r,i)}}V.empty=new V(q.empty,0,0);function bY(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:a,offset:s}=e.findIndex(n);if(i==t||o.isText){if(s!=n&&!e.child(a).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(bY(o.content,t-i-1,n-i-1)))}function CY(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),a=e.maybeChild(i);if(o==t||a.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=CY(a.content,t-o-1,n);return s&&e.replaceChild(i,a.copy(s))}function iPe(e,t,n){if(n.openStart>e.depth)throw new wl("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new wl("Inconsistent open depths");return SY(e,t,n,0)}function SY(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let a=SY(e,t,n,r+1);return o.copy(o.content.replaceChild(i,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let a=e.parent,s=a.content;return Xu(a,s.cut(0,e.parentOffset).append(n.content).append(s.cut(t.parentOffset)))}else{let{start:a,end:s}=oPe(n,e);return Xu(o,_Y(e,a,s,t,r))}else return Xu(o,jv(e,t,r))}function wY(e,t){if(!t.type.compatibleContent(e.type))throw new wl("Cannot join "+t.type.name+" onto "+e.type.name)}function a_(e,t,n){let r=e.node(n);return wY(r,t.node(n)),r}function Zu(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function zp(e,t,n,r){let i=(t||e).node(n),o=0,a=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(Zu(e.nodeAfter,r),o++));for(let s=o;s<a;s++)Zu(i.child(s),r);t&&t.depth==n&&t.textOffset&&Zu(t.nodeBefore,r)}function Xu(e,t){return e.type.checkContent(t),e.copy(t)}function _Y(e,t,n,r,i){let o=e.depth>i&&a_(e,t,i+1),a=r.depth>i&&a_(n,r,i+1),s=[];return zp(null,e,i,s),o&&a&&t.index(i)==n.index(i)?(wY(o,a),Zu(Xu(o,_Y(e,t,n,r,i+1)),s)):(o&&Zu(Xu(o,jv(e,t,i+1)),s),zp(t,n,i,s),a&&Zu(Xu(a,jv(n,r,i+1)),s)),zp(r,null,i,s),new q(s)}function jv(e,t,n){let r=[];if(zp(null,e,n,r),e.depth>n){let i=a_(e,t,n+1);Zu(Xu(i,jv(e,t,n+1)),r)}return zp(t,null,n,r),new q(r)}function oPe(e,t){let n=t.depth-e.openStart,i=t.node(n).copy(e.content);for(let o=n-1;o>=0;o--)i=t.node(o).copy(q.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}class jh{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=t.child(n);return r?t.child(n).cut(r):i}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<t;o++)i+=r.child(o).nodeSize;return i}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return St.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let s=r;r=i,i=s}let o=r.marks;for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!i||!o[a].isInSet(i.marks))&&(o=o[a--].removeFromSet(o));return o}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=t.parent.maybeChild(t.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Lv(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let a=t;;){let{index:s,offset:u}=a.content.findIndex(o),l=o-u;if(r.push(a,s,i+u),!l||(a=a.child(s),a.isText))break;o=l-1,i+=u+1}return new jh(n,r,o)}static resolveCached(t,n){let r=QL.get(t);if(r)for(let o=0;o<r.elts.length;o++){let a=r.elts[o];if(a.pos==n)return a}else QL.set(t,r=new aPe);let i=r.elts[r.i]=jh.resolve(t,n);return r.i=(r.i+1)%sPe,i}}class aPe{constructor(){this.elts=[],this.i=0}}const sPe=12,QL=new WeakMap;class Lv{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const uPe=Object.create(null);let el=class s_{constructor(t,n,r,i=St.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||q.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,i=0){this.content.nodesBetween(t,n,r,i,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,i){return this.content.textBetween(t,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&Fv(this.attrs,n||t.defaultAttrs||uPe)&&St.sameSet(this.marks,r||St.none)}copy(t=null){return t==this.content?this:new s_(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new s_(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return V.empty;let i=this.resolve(t),o=this.resolve(n),a=r?0:i.sharedDepth(n),s=i.start(a),l=i.node(a).content.cut(i.pos-s,o.pos-s);return new V(l,i.depth-a,o.depth-a)}replace(t,n,r){return iPe(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(i==t||n.isText)return n;t-=i+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(t){return jh.resolveCached(this,t)}resolveNoCache(t){return jh.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),xY(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=q.empty,i=0,o=r.childCount){let a=this.contentMatchAt(t).matchFragment(r,i,o),s=a&&a.matchFragment(this.content,n);if(!s||!s.validEnd)return!1;for(let u=i;u<o;u++)if(!this.type.allowsMarks(r.child(u).marks))return!1;return!0}canReplaceWith(t,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(t).matchType(r),a=o&&o.matchFragment(this.content,n);return a?a.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=St.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),t=r.addToSet(t)}if(!St.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=q.fromJSON(t,n.content),o=t.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};el.prototype.text=void 0;class Dv extends el{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):xY(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Dv(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Dv(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function xY(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class _l{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new lPe(t,n);if(r.next==null)return _l.empty;let i=TY(r);r.next&&r.err("Unexpected trailing text");let o=mPe(APe(i));return gPe(o,r),o}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(t.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let i=[this];function o(a,s){let u=a.matchFragment(t,r);if(u&&(!n||u.validEnd))return q.from(s.map(l=>l.createAndFill()));for(let l=0;l<a.next.length;l++){let{type:c,next:f}=a.next[l];if(!(c.isText||c.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let p=o(f,s.concat(c));if(p)return p}}return null}return o(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(t)){let a=[];for(let s=i;s.type;s=s.via)a.push(s.type);return a.reverse()}for(let a=0;a<o.next.length;a++){let{type:s,next:u}=o.next[a];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in n)&&(!i.type||u.validEnd)&&(r.push({match:s.contentMatch,type:s,via:i}),n[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let i=0;i<r.next.length;i++)t.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),t.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)o+=(a?", ":"")+r.next[a].type.name+"->"+t.indexOf(r.next[a].next);return o}).join(`
|
|
71
|
+
`)}}_l.empty=new _l(!0);class lPe{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function TY(e){let t=[];do t.push(cPe(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function cPe(e){let t=[];do t.push(dPe(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function dPe(e){let t=hPe(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=fPe(e,t);else break;return t}function HL(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function fPe(e,t){let n=HL(e),r=n;return e.eat(",")&&(e.next!="}"?r=HL(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function pPe(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let a=n[o];a.isInGroup(t)&&i.push(a)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function hPe(e){if(e.eat("(")){let t=TY(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=pPe(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function APe(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(a,s,u){let l={term:u,to:s};return t[a].push(l),l}function i(a,s){a.forEach(u=>u.to=s)}function o(a,s){if(a.type=="choice")return a.exprs.reduce((u,l)=>u.concat(o(l,s)),[]);if(a.type=="seq")for(let u=0;;u++){let l=o(a.exprs[u],s);if(u==a.exprs.length-1)return l;i(l,s=n())}else if(a.type=="star"){let u=n();return r(s,u),i(o(a.expr,u),u),[r(u)]}else if(a.type=="plus"){let u=n();return i(o(a.expr,s),u),i(o(a.expr,u),u),[r(u)]}else{if(a.type=="opt")return[r(s)].concat(o(a.expr,s));if(a.type=="range"){let u=s;for(let l=0;l<a.min;l++){let c=n();i(o(a.expr,u),c),u=c}if(a.max==-1)i(o(a.expr,u),u);else for(let l=a.min;l<a.max;l++){let c=n();r(u,c),i(o(a.expr,u),c),u=c}return[r(u)]}else{if(a.type=="name")return[r(s,void 0,a.value)];throw new Error("Unknown expr type")}}}}function IY(e,t){return t-e}function YL(e,t){let n=[];return r(t),n.sort(IY);function r(i){let o=e[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let a=0;a<o.length;a++){let{term:s,to:u}=o[a];!s&&n.indexOf(u)==-1&&r(u)}}}function mPe(e){let t=Object.create(null);return n(YL(e,0));function n(r){let i=[];r.forEach(a=>{e[a].forEach(({term:s,to:u})=>{if(!s)return;let l;for(let c=0;c<i.length;c++)i[c][0]==s&&(l=i[c][1]);YL(e,u).forEach(c=>{l||i.push([s,l=[]]),l.indexOf(c)==-1&&l.push(c)})})});let o=t[r.join(",")]=new _l(r.indexOf(e.length-1)>-1);for(let a=0;a<i.length;a++){let s=i[a][1].sort(IY);o.next.push({type:i[a][0],next:t[s.join(",")]||n(s)})}return o}}function gPe(e,t){for(let n=0,r=[e];n<r.length;n++){let i=r[n],o=!i.validEnd,a=[];for(let s=0;s<i.next.length;s++){let{type:u,next:l}=i.next[s];a.push(u.name),o&&!(u.isText||u.hasRequiredAttrs())&&(o=!1),r.indexOf(l)==-1&&r.push(l)}o&&t.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function EY(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function RY(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let o=e[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function $Y(e,t,n,r){for(let i in t)if(!(i in e))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in e){let o=e[i];o.validate&&o.validate(t[i])}}function kY(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new yPe(e,r,t[r]);return n}let GL=class OY{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=kY(t,r.attrs),this.defaultAttrs=EY(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==_l.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:RY(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new el(this,this.computeAttrs(t),q.from(n),St.setFrom(r))}createChecked(t=null,n,r){return n=q.from(n),this.checkContent(n),new el(this,this.computeAttrs(t),n,St.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=q.from(n),n.size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(q.empty,!0);return o?new el(this,t,n.append(o),St.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){$Y(this.attrs,t,"node",this.name)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:St.none:t}static compile(t,n){let r=Object.create(null);t.forEach((o,a)=>r[o]=new OY(o,n,a));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function vPe(e,t,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${o}`)}}class yPe{constructor(t,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?vPe(t,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class nC{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=kY(t,i.attrs),this.excluded=null;let o=EY(this.attrs);this.instance=o?new St(this,o):null}create(t=null){return!t&&this.instance?this.instance:new St(this,RY(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((o,a)=>r[o]=new nC(o,i++,n,a)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}checkAttrs(t){$Y(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class MY{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in t)n[i]=t[i];n.nodes=In.from(t.nodes),n.marks=In.from(t.marks||{}),this.nodes=GL.compile(this.spec.nodes,this),this.marks=nC.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],a=o.spec.content||"",s=o.spec.marks;if(o.contentMatch=r[a]||(r[a]=_l.parse(a,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=s=="_"?null:s?JL(this,s.split(" ")):s==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],a=o.spec.excludes;o.excluded=a==null?[o]:a==""?[]:JL(this,a.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,i){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof GL){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,i)}text(t,n){let r=this.nodes.text;return new Dv(r,r.defaultAttrs,t,St.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return el.fromJSON(this,t)}markFromJSON(t){return St.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function JL(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],a=o;if(o)n.push(o);else for(let s in e.marks){let u=e.marks[s];(i=="_"||u.spec.group&&u.spec.group.split(" ").indexOf(i)>-1)&&n.push(a=u)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}function bPe(e){return e.tag!=null}function CPe(e){return e.style!=null}class tl{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(bPe(i))this.tags.push(i);else if(CPe(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=t.nodes[i.node];return o.contentMatch.matchType(o)})}parse(t,n={}){let r=new XL(this,n,!1);return r.addAll(t,St.none,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new XL(this,n,!0);return r.addAll(t,St.none,n.from,n.to),V.maxOpen(r.finish())}matchTag(t,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(_Pe(t,o.tag)&&(o.namespace===void 0||t.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}matchStyle(t,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let a=this.styles[o],s=a.style;if(!(s.indexOf(t)!=0||a.context&&!r.matchesContext(a.context)||s.length>t.length&&(s.charCodeAt(t.length)!=61||s.slice(t.length+1)!=n))){if(a.getAttrs){let u=a.getAttrs(n);if(u===!1)continue;a.attrs=u||void 0}return a}}}static schemaRules(t){let n=[];function r(i){let o=i.priority==null?50:i.priority,a=0;for(;a<n.length;a++){let s=n[a];if((s.priority==null?50:s.priority)<o)break}n.splice(a,0,i)}for(let i in t.marks){let o=t.marks[i].spec.parseDOM;o&&o.forEach(a=>{r(a=e2(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in t.nodes){let o=t.nodes[i].spec.parseDOM;o&&o.forEach(a=>{r(a=e2(a)),a.node||a.ignore||a.mark||(a.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new tl(t,tl.schemaRules(t)))}}const FY={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},SPe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},jY={ol:!0,ul:!0},Lh=1,u_=2,Qp=4;function ZL(e,t,n){return t!=null?(t?Lh:0)|(t==="full"?u_:0):e&&e.whitespace=="pre"?Lh|u_:n&~Qp}class wg{constructor(t,n,r,i,o,a){this.type=t,this.attrs=n,this.marks=r,this.solid=i,this.options=a,this.content=[],this.activeMarks=St.none,this.match=o||(a&Qp?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(q.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(t.type))?(this.match=r,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&Lh)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=q.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(q.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!FY.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class XL{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,a=ZL(null,n.preserveWhitespace,0)|(r?Qp:0);i?o=new wg(i.type,i.attrs,St.none,!0,n.topMatch||i.type.contentMatch,a):r?o=new wg(null,null,St.none,!0,null,a):o=new wg(t.schema.topNodeType,null,St.none,!0,null,a),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let r=t.nodeValue,i=this.top,o=i.options&u_?"full":this.localPreserveWS||(i.options&Lh)>0;if(o==="full"||i.inlineContext(t)||/[^ \t\r\n\u000c]/.test(r)){if(o)o!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
|
|
72
|
+
`);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],s=t.previousSibling;(!a||s&&s.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(t)}else this.findInside(t)}addElement(t,n,r){let i=this.localPreserveWS,o=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let a=t.nodeName.toLowerCase(),s;jY.hasOwnProperty(a)&&this.parser.normalizeLists&&wPe(t);let u=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(s=this.parser.matchTag(t,this,r));e:if(u?u.ignore:SPe.hasOwnProperty(a))this.findInside(t),this.ignoreFallback(t,n);else if(!u||u.skip||u.closeParent){u&&u.closeParent?this.open=Math.max(0,this.open-1):u&&u.skip.nodeType&&(t=u.skip);let l,c=this.needsBlock;if(FY.hasOwnProperty(a))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),l=!0,o.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,n);break e}let f=u&&u.skip?n:this.readStyles(t,n);f&&this.addAll(t,f),l&&this.sync(o),this.needsBlock=c}else{let l=this.readStyles(t,n);l&&this.addElementByRule(t,u,l,u.consuming===!1?s:void 0)}this.localPreserveWS=i}leafFallback(t,n){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
|
|
73
|
+
`),n)}ignoreFallback(t,n){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(t,n){let r=t.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],a=r.getPropertyValue(o);if(a)for(let s=void 0;;){let u=this.parser.matchStyle(o,a,this,s);if(!u)break;if(u.ignore)return null;if(u.clearMark?n=n.filter(l=>!u.clearMark(l)):n=n.concat(this.parser.schema.marks[u.mark].create(u.attrs)),u.consuming===!1)s=u;else break}}return n}addElementByRule(t,n,r,i){let o,a;if(n.node)if(a=this.parser.schema.nodes[n.node],a.isLeaf)this.insertNode(a.create(n.attrs),r)||this.leafFallback(t,r);else{let u=this.enter(a,n.attrs||null,r,n.preserveWhitespace);u&&(o=!0,r=u)}else{let u=this.parser.schema.marks[n.mark];r=r.concat(u.create(n.attrs))}let s=this.top;if(a&&a.isLeaf)this.findInside(t);else if(i)this.addElement(t,r,i);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(u=>this.insertNode(u,r));else{let u=t;typeof n.contentElement=="string"?u=t.querySelector(n.contentElement):typeof n.contentElement=="function"?u=n.contentElement(t):n.contentElement&&(u=n.contentElement),this.findAround(t,u,!0),this.addAll(u,r),this.findAround(t,u,!1)}o&&this.sync(s)&&this.open--}addAll(t,n,r,i){let o=r||0;for(let a=r?t.childNodes[r]:t.firstChild,s=i==null?null:t.childNodes[i];a!=s;a=a.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(a,n);this.findAtPoint(t,o)}findPlace(t,n){let r,i;for(let o=this.open;o>=0;o--){let a=this.nodes[o],s=a.findWrapping(t);if(s&&(!r||r.length>s.length)&&(r=s,i=a,!s.length)||a.solid)break}if(!r)return null;this.sync(i);for(let o=0;o<r.length;o++)n=this.enterInner(r[o],null,n,!1);return n}insertNode(t,n){if(t.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let r=this.findPlace(t,n);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(t.type));let o=St.none;for(let a of r.concat(t.marks))(i.type?i.type.allowsMarkType(a.type):t2(a.type,t.type))&&(o=a.addToSet(o));return i.content.push(t.mark(o)),!0}return!1}enter(t,n,r,i){let o=this.findPlace(t.create(n),r);return o&&(o=this.enterInner(t,n,r,!0,i)),o}enterInner(t,n,r,i=!1,o){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(t);let s=ZL(t,o,a.options);a.options&Qp&&a.content.length==0&&(s|=Qp);let u=St.none;return r=r.filter(l=>(a.type?a.type.allowsMarkType(l.type):t2(l.type,t))?(u=l.addToSet(u),!1):!0),this.nodes.push(new wg(t,n,u,i,null,s)),this.open++,r}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Lh)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&t.nodeType==1&&t.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),a=(s,u)=>{for(;s>=0;s--){let l=n[s];if(l==""){if(s==n.length-1||s==0)continue;for(;u>=o;u--)if(a(s-1,u))return!0;return!1}else{let c=u>0||u==0&&i?this.nodes[u].type:r&&u>=o?r.node(u-o).type:null;if(!c||c.name!=l&&!c.isInGroup(l))return!1;u--}}return!0};return a(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function wPe(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&jY.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function _Pe(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function e2(e){let t={};for(let n in e)t[n]=e[n];return t}function t2(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],a=s=>{o.push(s);for(let u=0;u<s.edgeCount;u++){let{type:l,next:c}=s.edge(u);if(l==t||o.indexOf(c)<0&&a(c))return!0}};if(a(i.contentMatch))return!0}}class Ym{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=jS(n).createDocumentFragment());let i=r,o=[];return t.forEach(a=>{if(o.length||a.marks.length){let s=0,u=0;for(;s<o.length&&u<a.marks.length;){let l=a.marks[u];if(!this.marks[l.type.name]){u++;continue}if(!l.eq(o[s][0])||l.type.spec.spanning===!1)break;s++,u++}for(;s<o.length;)i=o.pop()[1];for(;u<a.marks.length;){let l=a.marks[u++],c=this.serializeMark(l,a.isInline,n);c&&(o.push([l,i]),i.appendChild(c.dom),i=c.contentDOM||c.dom)}}i.appendChild(this.serializeNodeInner(a,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:i}=Bg(jS(n),this.nodes[t.type.name](t),null,t.attrs);if(i){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,i)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let i=t.marks.length-1;i>=0;i--){let o=this.serializeMark(t.marks[i],t.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(t,n,r={}){let i=this.marks[t.type.name];return i&&Bg(jS(r),i(t,n),null,t.attrs)}static renderSpec(t,n,r=null,i){return Bg(t,n,r,i)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Ym(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=n2(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return n2(t.marks)}}function n2(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function jS(e){return e.document||window.document}const r2=new WeakMap;function xPe(e){let t=r2.get(e);return t===void 0&&r2.set(e,t=TPe(e)),t}function TPe(e){let t=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")t||(t=[]),t.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(e),t}function Bg(e,t,n,r){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=xPe(r))&&o.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a=i.indexOf(" ");a>0&&(n=i.slice(0,a),i=i.slice(a+1));let s,u=n?e.createElementNS(n,i):e.createElement(i),l=t[1],c=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){c=2;for(let f in l)if(l[f]!=null){let p=f.indexOf(" ");p>0?u.setAttributeNS(f.slice(0,p),f.slice(p+1),l[f]):u.setAttribute(f,l[f])}}for(let f=c;f<t.length;f++){let p=t[f];if(p===0){if(f<t.length-1||f>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:h,contentDOM:A}=Bg(e,p,n,r);if(u.appendChild(h),A){if(s)throw new RangeError("Multiple content holes");s=A}}}return{dom:u,contentDOM:s}}const LY=65535,DY=Math.pow(2,16);function IPe(e,t){return e+t*DY}function i2(e){return e&LY}function EPe(e){return(e-(e&LY))/DY}const UY=1,BY=2,Pg=4,PY=8;let l_=class{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&PY)>0}get deletedBefore(){return(this.delInfo&(UY|Pg))>0}get deletedAfter(){return(this.delInfo&(BY|Pg))>0}get deletedAcross(){return(this.delInfo&Pg)>0}},Rd=class zc{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&zc.empty)return zc.empty}recover(t){let n=0,r=i2(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+EPe(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let u=this.ranges[s]-(this.inverted?i:0);if(u>t)break;let l=this.ranges[s+o],c=this.ranges[s+a],f=u+l;if(t<=f){let p=l?t==u?-1:t==f?1:n:n,h=u+i+(p<0?0:c);if(r)return h;let A=t==(n<0?u:f)?null:IPe(s/3,t-u),g=t==u?BY:t==f?UY:Pg;return(n<0?t!=u:t!=f)&&(g|=PY),new l_(h,g,A)}i+=c-l}return r?t+i:new l_(t+i,0,null)}touches(t,n){let r=0,i=i2(n),o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let u=this.ranges[s]-(this.inverted?r:0);if(u>t)break;let l=this.ranges[s+o],c=u+l;if(t<=c&&s==i*3)return!0;r+=this.ranges[s+a]-l}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],s=a-(this.inverted?o:0),u=a+(this.inverted?0:o),l=this.ranges[i+n],c=this.ranges[i+r];t(s,s+l,u,u+c),o+=c-l}}invert(){return new zc(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?zc.empty:new zc(t<0?[0,-t,0]:[0,0,t])}};Rd.empty=new Rd([]);let RPe=class Wg{constructor(t=[],n,r=0,i=t.length){this.maps=t,this.mirror=n,this.from=r,this.to=i}slice(t=0,n=this.maps.length){return new Wg(this.maps,this.mirror,t,n)}copy(){return new Wg(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,n){this.to=this.maps.push(t),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(t){for(let n=0,r=this.maps.length;n<t.maps.length;n++){let i=t.getMirror(n);this.appendMap(t.maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this.maps.length+t.maps.length;n>=0;n--){let i=t.getMirror(n);this.appendMap(t.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let t=new Wg;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this.maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let i=0;for(let o=this.from;o<this.to;o++){let a=this.maps[o],s=a.mapResult(t,n);if(s.recover!=null){let u=this.getMirror(o);if(u!=null&&u>o&&u<this.to){o=u,t=this.maps[u].recover(s.recover);continue}}i|=s.delInfo,t=s.pos}return r?t:new l_(t,i,null)}};const LS=Object.create(null);let Vr=class{getMap(){return Rd.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=LS[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in LS)throw new RangeError("Duplicate use of step JSON ID "+t);return LS[t]=n,n.prototype.jsonID=t,n}},Rr=class Rp{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Rp(t,null)}static fail(t){return new Rp(null,t)}static fromReplace(t,n,r,i){try{return Rp.ok(t.replace(n,r,i))}catch(o){if(o instanceof wl)return Rp.fail(o.message);throw o}}};function aF(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(aF(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return q.fromArray(r)}let WY=class $p extends Vr{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new V(aF(n.content,(a,s)=>!a.isAtom||!s.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return Rr.fromReplace(t,this.from,this.to,o)}invert(){return new NY(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new $p(n.pos,r.pos,this.mark)}merge(t){return t instanceof $p&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new $p(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new $p(n.from,n.to,t.markFromJSON(n.mark))}};Vr.jsonID("addMark",WY);let NY=class kp extends Vr{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new V(aF(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return Rr.fromReplace(t,this.from,this.to,r)}invert(){return new WY(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new kp(n.pos,r.pos,this.mark)}merge(t){return t instanceof kp&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new kp(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new kp(n.from,n.to,t.markFromJSON(n.mark))}};Vr.jsonID("removeMark",NY);let KY=class Op extends Vr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Rr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Rr.fromReplace(t,this.pos,this.pos+1,new V(q.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Op(this.pos,n.marks[i]);return new Op(this.pos,this.mark)}}return new qY(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Op(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Op(n.pos,t.markFromJSON(n.mark))}};Vr.jsonID("addNodeMark",KY);let qY=class c_ extends Vr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Rr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Rr.fromReplace(t,this.pos,this.pos+1,new V(q.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new KY(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new c_(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new c_(n.pos,t.markFromJSON(n.mark))}};Vr.jsonID("removeNodeMark",qY);let VY=class Du extends Vr{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&d_(t,this.from,this.to)?Rr.fail("Structure replace would overwrite content"):Rr.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Rd([this.from,this.to-this.from,this.slice.size])}invert(t){return new Du(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Du(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof Du)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?V.empty:new V(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Du(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?V.empty:new V(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Du(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Du(n.from,n.to,V.fromJSON(t,n.slice),!!n.structure)}};Vr.jsonID("replace",VY);let pp=class Ng extends Vr{constructor(t,n,r,i,o,a,s=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=s}apply(t){if(this.structure&&(d_(t,this.from,this.gapFrom)||d_(t,this.gapTo,this.to)))return Rr.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Rr.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Rr.fromReplace(t,this.from,this.to,r):Rr.fail("Content does not fit in gap")}getMap(){return new Rd([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new Ng(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=t.map(this.gapFrom,-1),o=t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new Ng(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ng(n.from,n.to,n.gapFrom,n.gapTo,V.fromJSON(t,n.slice),n.insert,!!n.structure)}};Vr.jsonID("replaceAround",pp);function d_(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function $Pe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function kPe(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth;;--r){let i=e.$from.node(r),o=e.$from.index(r),a=e.$to.indexAfter(r);if(r<e.depth&&i.canReplace(o,a,n))return r;if(r==0||i.type.spec.isolating||!$Pe(i,o,a))break}return null}function OPe(e,t,n=null,r=e){let i=MPe(e,t),o=i&&FPe(r,t);return o?i.map(o2).concat({type:t,attrs:n}).concat(o.map(o2)):null}function o2(e){return{type:e,attrs:null}}function MPe(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let a=o.length?o[0]:t;return n.canReplaceWith(r,i,a)?o:null}function FPe(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),a=t.contentMatch.findWrapping(o.type);if(!a)return null;let u=(a.length?a[a.length-1]:t).contentMatch;for(let l=r;u&&l<i;l++)u=u.matchType(n.child(l).type);return!u||!u.validEnd?null:a}function jPe(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let l=i.depth-1,c=n-2;l>o;l--,c--){let f=i.node(l),p=i.index(l);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(p,f.childCount),A=r&&r[c+1];A&&(h=h.replaceChild(0,A.type.create(A.attrs)));let g=r&&r[c]||f;if(!f.canReplace(p+1,f.childCount)||!g.type.validContent(h))return!1}let s=i.indexAfter(o),u=r&&r[0];return i.node(o).canReplaceWith(s,s,u?u.type:i.node(o+1).type)}function LPe(e,t){let n=e.resolve(t),r=n.index();return DPe(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function DPe(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function UPe(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let a=r.depth;a>=0;a--){let s=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,u=r.index(a)+(s>0?1:0),l=r.node(a),c=!1;if(o==1)c=l.canReplace(u,u,i);else{let f=l.contentMatchAt(u).findWrapping(i.firstChild.type);c=f&&l.canReplaceWith(u,u,f[0])}if(c)return s==0?r.pos:s<0?r.before(a+1):r.after(a+1)}return null}let BPe=class Kg extends Vr{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return Rr.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Rr.fromReplace(t,this.pos,this.pos+1,new V(q.from(i),0,n.isLeaf?0:1))}getMap(){return Rd.empty}invert(t){return new Kg(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Kg(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Kg(n.pos,n.attr,n.value)}};Vr.jsonID("attr",BPe);let Dh=class extends Error{};Dh=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Dh.prototype=Object.create(Error.prototype);Dh.prototype.constructor=Dh;Dh.prototype.name="TransformError";const DS=Object.create(null);class je{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new zY(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=V.empty){let r=n.content.lastChild,i=null;for(let s=0;s<n.openEnd;s++)i=r,r=r.lastChild;let o=t.steps.length,a=this.ranges;for(let s=0;s<a.length;s++){let{$from:u,$to:l}=a[s],c=t.mapping.slice(o);t.replaceRange(c.map(u.pos),c.map(l.pos),s?V.empty:n),s==0&&u2(t,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:a,$to:s}=i[o],u=t.mapping.slice(r),l=u.map(a.pos),c=u.map(s.pos);o?t.deleteRange(l,c):(t.replaceRangeWith(l,c,n),u2(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new Oe(t):Qc(t.node(0),t.parent,t.pos,t.index(),n,r);if(i)return i;for(let o=t.depth-1;o>=0;o--){let a=n<0?Qc(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):Qc(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,n,r);if(a)return a}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new xi(t.node(0))}static atStart(t){return Qc(t,t,0,0,1)||new xi(t)}static atEnd(t){return Qc(t,t,t.content.size,t.childCount,-1)||new xi(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=DS[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in DS)throw new RangeError("Duplicate use of selection JSON ID "+t);return DS[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Oe.between(this.$anchor,this.$head).getBookmark()}}je.prototype.visible=!0;class zY{constructor(t,n){this.$from=t,this.$to=n}}let a2=!1;function s2(e){!a2&&!e.parent.inlineContent&&(a2=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Oe extends je{constructor(t,n=t){s2(t),s2(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return je.near(r);let i=t.resolve(n.map(this.anchor));return new Oe(i.parent.inlineContent?i:r,r)}replace(t,n=V.empty){if(super.replace(t,n),n==V.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof Oe&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new rC(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Oe(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let i=t.resolve(n);return new this(i,r==n?i:t.resolve(r))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=je.findFrom(n,r,!0)||je.findFrom(n,-r,!0);if(o)n=o.$head;else return je.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(je.findFrom(t,-r,!0)||je.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new Oe(t,n)}}je.jsonID("text",Oe);class rC{constructor(t,n){this.anchor=t,this.head=n}map(t){return new rC(t.map(this.anchor),t.map(this.head))}resolve(t){return Oe.between(t.resolve(this.anchor),t.resolve(this.head))}}class xe extends je{constructor(t){let n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);super(t,r),this.node=n}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=t.resolve(i);return r?je.near(o):new xe(o)}content(){return new V(q.from(this.node),0,0)}eq(t){return t instanceof xe&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new sF(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new xe(t.resolve(n.anchor))}static create(t,n){return new xe(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}xe.prototype.visible=!1;je.jsonID("node",xe);class sF{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new rC(r,r):new sF(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&xe.isSelectable(r)?new xe(n):je.near(n)}}class xi extends je{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=V.empty){if(n==V.empty){t.delete(0,t.doc.content.size);let r=je.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new xi(t)}map(t){return new xi(t)}eq(t){return t instanceof xi}getBookmark(){return PPe}}je.jsonID("all",xi);const PPe={map(){return this},resolve(e){return new xi(e)}};function Qc(e,t,n,r,i,o=!1){if(t.inlineContent)return Oe.create(e,n);for(let a=r-(i>0?0:1);i>0?a<t.childCount:a>=0;a+=i){let s=t.child(a);if(s.isAtom){if(!o&&xe.isSelectable(s))return xe.create(e,n-(i<0?s.nodeSize:0))}else{let u=Qc(e,s,n+i,i<0?s.childCount:0,i,o);if(u)return u}n+=s.nodeSize*i}return null}function u2(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof VY||i instanceof pp))return;let o=e.mapping.maps[r],a;o.forEach((s,u,l,c)=>{a==null&&(a=c)}),e.setSelection(je.near(e.doc.resolve(a),n))}function l2(e,t){return!t||!e?e:e.bind(t)}class _g{constructor(t,n,r){this.name=t,this.init=l2(n.init,r),this.apply=l2(n.apply,r)}}new _g("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new _g("selection",{init(e,t){return e.selection||je.atStart(t.doc)},apply(e){return e.selection}}),new _g("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new _g("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}});function QY(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=QY(i,t,{})),n[r]=i}return n}class Kn{constructor(t){this.spec=t,this.props={},t.props&&QY(t.props,this,this.props),this.key=t.key?t.key.key:HY("plugin")}getState(t){return t[this.key]}}const US=Object.create(null);function HY(e){return e in US?e+"$"+ ++US[e]:(US[e]=0,e+"$")}class rr{constructor(t="key"){this.key=HY(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const kc=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},YY=function(e,t,n,r){return n&&(c2(e,t,n,r,-1)||c2(e,t,n,r,1))},WPe=/^(img|br|input|textarea|hr)$/i;function c2(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Uv(e))){let o=e.parentNode;if(!o||o.nodeType!=1||uF(e)||WPe.test(e.nodeName)||e.contentEditable=="false")return!1;t=kc(e)+(i<0?0:1),e=o}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.contentEditable=="false")return!1;t=i<0?Uv(e):0}else return!1}}function Uv(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function NPe(e,t,n){for(let r=t==0,i=t==Uv(e);r||i;){if(e==n)return!0;let o=kc(e);if(e=e.parentNode,!e)return!1;r=r&&o==0,i=i&&o==Uv(e)}}function uF(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const GY=function(e){return e.focusNode&&YY(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function JY(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const Do=typeof navigator<"u"?navigator:null,d2=typeof document<"u"?document:null,Iu=Do&&Do.userAgent||"",f_=/Edge\/(\d+)/.exec(Iu),ZY=/MSIE \d/.exec(Iu),p_=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Iu),Gm=!!(ZY||p_||f_),XY=ZY?document.documentMode:p_?+p_[1]:f_?+f_[1]:0,iC=!Gm&&/gecko\/(\d+)/i.test(Iu);iC&&+(/Firefox\/(\d+)/.exec(Iu)||[0,0])[1];const h_=!Gm&&/Chrome\/(\d+)/.exec(Iu),Eu=!!h_,eG=h_?+h_[1]:0,Oc=!Gm&&!!Do&&/Apple Computer/.test(Do.vendor),lF=Oc&&(/Mobile\/\w+/.test(Iu)||!!Do&&Do.maxTouchPoints>2),Ci=lF||(Do?/Mac/.test(Do.platform):!1),KPe=Do?/Win/.test(Do.platform):!1,Jm=/Android \d/.test(Iu),cF=!!d2&&"webkitFontSmoothing"in d2.documentElement.style,qPe=cF?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function VPe(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&i.size==0,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let s=r.resolve(a),u,l;if(GY(n)){for(u=a;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&xe.isSelectable(f)&&i.parent&&!(f.isInline&&NPe(n.focusNode,n.focusOffset,i.dom))){let p=i.posBefore;l=new xe(a==p?s:r.resolve(p))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let f=a,p=a;for(let h=0;h<n.rangeCount;h++){let A=n.getRangeAt(h);f=Math.min(f,e.docView.posFromDOM(A.startContainer,A.startOffset,1)),p=Math.max(p,e.docView.posFromDOM(A.endContainer,A.endOffset,-1))}if(f<0)return null;[u,a]=p==e.state.selection.anchor?[p,f]:[f,p],s=r.resolve(a)}else u=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null}let c=r.resolve(u);if(!l){let f=t=="pointer"||e.state.selection.head<s.pos&&!o?1:-1;l=nG(e,c,s,f)}return l}function tG(e){return e.editable?e.hasFocus():YPe(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function dF(e,t=!1){let n=e.state.selection;if(HPe(e,n),!!tG(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Eu){let r=e.domSelectionRange(),i=e.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&YY(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)QPe(e);else{let{anchor:r,head:i}=n,o,a;f2&&!(n instanceof Oe)&&(n.$from.parent.inlineContent||(o=p2(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=p2(e,n.to))),e.docView.setSelection(r,i,e,t),f2&&(o&&h2(o),a&&h2(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&zPe(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const f2=Oc||Eu&&eG<63;function p2(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(Oc&&i&&i.contentEditable=="false")return BS(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return BS(i);if(o)return BS(o)}}function BS(e){return e.contentEditable="true",Oc&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function h2(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function zPe(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!tG(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function QPe(e){let t=e.domSelection(),n=document.createRange();if(!t)return;let r=e.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setStart(r.parentNode,kc(r)+1):n.setStart(r,0),n.collapse(!0),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&Gm&&XY<=11&&(r.disabled=!0,r.disabled=!1)}function HPe(e,t){if(t instanceof xe){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(A2(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else A2(e)}function A2(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function nG(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||Oe.between(t,n,r)}function YPe(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function A_(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&je.findFrom(o,t)}function ys(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function m2(e,t,n){let r=e.state.selection;if(r instanceof Oe)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let a=e.state.doc.resolve(i.pos+o.nodeSize*(t<0?-1:1));return ys(e,new Oe(r.$anchor,a))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let i=A_(e.state,t);return i&&i instanceof xe?ys(e,i):!1}else if(!(Ci&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,a;if(!o||o.isText)return!1;let s=t<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(a=e.docView.descAt(s))&&!a.contentDOM?xe.isSelectable(o)?ys(e,new xe(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):cF?ys(e,new Oe(e.state.doc.resolve(t<0?s:s+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof xe&&r.node.isInline)return ys(e,new Oe(t>0?r.$to:r.$from));{let i=A_(e.state,t);return i?ys(e,i):!1}}}function Bv(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Hp(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function Bc(e,t){return t<0?GPe(e):JPe(e)}function GPe(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,a=!1;for(iC&&n.nodeType==1&&r<Bv(n)&&Hp(n.childNodes[r],-1)&&(a=!0);;)if(r>0){if(n.nodeType!=1)break;{let s=n.childNodes[r-1];if(Hp(s,-1))i=n,o=--r;else if(s.nodeType==3)n=s,r=n.nodeValue.length;else break}}else{if(rG(n))break;{let s=n.previousSibling;for(;s&&Hp(s,-1);)i=n.parentNode,o=kc(s),s=s.previousSibling;if(s)n=s,r=Bv(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}a?m_(e,n,r):i&&m_(e,i,o)}function JPe(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=Bv(n),o,a;for(;;)if(r<i){if(n.nodeType!=1)break;let s=n.childNodes[r];if(Hp(s,1))o=n,a=++r;else break}else{if(rG(n))break;{let s=n.nextSibling;for(;s&&Hp(s,1);)o=s.parentNode,a=kc(s)+1,s=s.nextSibling;if(s)n=s,r=0,i=Bv(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}}o&&m_(e,o,a)}function rG(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function ZPe(e,t){for(;e&&t==e.childNodes.length&&!uF(e);)t=kc(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=0}}function XPe(e,t){for(;e&&!t&&!uF(e);)t=kc(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=e.childNodes.length}}function m_(e,t,n){if(t.nodeType!=3){let o,a;(a=ZPe(t,n))?(t=a,n=0):(o=XPe(t,n))&&(t=o,n=o.nodeValue.length)}let r=e.domSelection();if(!r)return;if(GY(r)){let o=document.createRange();o.setEnd(t,n),o.setStart(t,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&dF(e)},50)}function g2(e,t){let n=e.state.doc.resolve(t);if(!(Eu||KPe)&&n.parent.inlineContent){let i=e.coordsAtPos(t);if(t>n.start()){let o=e.coordsAtPos(t-1),a=(o.top+o.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(t<n.end()){let o=e.coordsAtPos(t+1),a=(o.top+o.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function v2(e,t,n){let r=e.state.selection;if(r instanceof Oe&&!r.empty||n.indexOf("s")>-1||Ci&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let a=A_(e.state,t);if(a&&a instanceof xe)return ys(e,a)}if(!i.parent.inlineContent){let a=t<0?i:o,s=r instanceof xi?je.near(a,t):je.findFrom(a,t);return s?ys(e,s):!1}return!1}function y2(e,t){if(!(e.state.selection instanceof Oe))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let a=e.state.tr;return t<0?a.delete(n.pos-o.nodeSize,n.pos):a.delete(n.pos,n.pos+o.nodeSize),e.dispatch(a),!0}return!1}function b2(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function eWe(e){if(!Oc||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;b2(e,r,"true"),setTimeout(()=>b2(e,r,"false"),20)}return!1}function tWe(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function nWe(e,t){let n=t.keyCode,r=tWe(t);if(n==8||Ci&&n==72&&r=="c")return y2(e,-1)||Bc(e,-1);if(n==46&&!t.shiftKey||Ci&&n==68&&r=="c")return y2(e,1)||Bc(e,1);if(n==13||n==27)return!0;if(n==37||Ci&&n==66&&r=="c"){let i=n==37?g2(e,e.state.selection.from)=="ltr"?-1:1:-1;return m2(e,i,r)||Bc(e,i)}else if(n==39||Ci&&n==70&&r=="c"){let i=n==39?g2(e,e.state.selection.from)=="ltr"?1:-1:1;return m2(e,i,r)||Bc(e,i)}else{if(n==38||Ci&&n==80&&r=="c")return v2(e,-1,r)||Bc(e,-1);if(n==40||Ci&&n==78&&r=="c")return eWe(e)||v2(e,1,r)||Bc(e,1);if(r==(Ci?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function iG(e,t){e.someProp("transformCopied",h=>{t=h(t,e)});let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let h=r.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let a=e.someProp("clipboardSerializer")||Ym.fromSchema(e.state.schema),s=cG(),u=s.createElement("div");u.appendChild(a.serializeFragment(r,{document:s}));let l=u.firstChild,c,f=0;for(;l&&l.nodeType==1&&(c=lG[l.nodeName.toLowerCase()]);){for(let h=c.length-1;h>=0;h--){let A=s.createElement(c[h]);for(;u.firstChild;)A.appendChild(u.firstChild);u.appendChild(A),f++}l=u.firstChild}l&&l.nodeType==1&&l.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let p=e.someProp("clipboardTextSerializer",h=>h(t,e))||t.content.textBetween(0,t.content.size,`
|
|
74
|
+
|
|
75
|
+
`);return{dom:u,text:p,slice:t}}function oG(e,t,n,r,i){let o=i.parent.type.spec.code,a,s;if(!n&&!t)return null;let u=t&&(r||o||!n);if(u){if(e.someProp("transformPastedText",p=>{t=p(t,o||r,e)}),o)return t?new V(q.from(e.state.schema.text(t.replace(/\r\n?/g,`
|
|
76
|
+
`))),0,0):V.empty;let f=e.someProp("clipboardTextParser",p=>p(t,i,r,e));if(f)s=f;else{let p=i.marks(),{schema:h}=e.state,A=Ym.fromSchema(h);a=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(g=>{let y=a.appendChild(document.createElement("p"));g&&y.appendChild(A.serializeNode(h.text(g,p)))})}}else e.someProp("transformPastedHTML",f=>{n=f(n,e)}),a=aWe(n),cF&&sWe(a);let l=a&&a.querySelector("[data-pm-slice]"),c=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let f=+c[3];f>0;f--){let p=a.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;a=p}if(s||(s=(e.someProp("clipboardParser")||e.someProp("domParser")||tl.fromSchema(e.state.schema)).parseSlice(a,{preserveWhitespace:!!(u||c),context:i,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!rWe.test(p.parentNode.nodeName)?{ignore:!0}:null}})),c)s=uWe(C2(s,+c[1],+c[2]),c[4]);else if(s=V.maxOpen(iWe(s.content,i),!0),s.openStart||s.openEnd){let f=0,p=0;for(let h=s.content.firstChild;f<s.openStart&&!h.type.spec.isolating;f++,h=h.firstChild);for(let h=s.content.lastChild;p<s.openEnd&&!h.type.spec.isolating;p++,h=h.lastChild);s=C2(s,f,p)}return e.someProp("transformPasted",f=>{s=f(s,e)}),s}const rWe=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function iWe(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.index(n)),o,a=[];if(e.forEach(s=>{if(!a)return;let u=i.findWrapping(s.type),l;if(!u)return a=null;if(l=a.length&&o.length&&sG(u,o,s,a[a.length-1],0))a[a.length-1]=l;else{a.length&&(a[a.length-1]=uG(a[a.length-1],o.length));let c=aG(s,u);a.push(c),i=i.matchType(c.type),o=u}}),a)return q.from(a)}return e}function aG(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,q.from(e));return e}function sG(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=sG(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(q.from(aG(n,e,i+1))))}}function uG(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,uG(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(q.empty,!0);return e.copy(n.append(r))}function g_(e,t,n,r,i,o){let a=t<0?e.firstChild:e.lastChild,s=a.content;return e.childCount>1&&(o=0),i<r-1&&(s=g_(s,t,n,r,i+1,o)),i>=n&&(s=t<0?a.contentMatchAt(0).fillBefore(s,o<=i).append(s):s.append(a.contentMatchAt(a.childCount).fillBefore(q.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(s))}function C2(e,t,n){return t<e.openStart&&(e=new V(g_(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new V(g_(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const lG={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let S2=null;function cG(){return S2||(S2=document.implementation.createHTMLDocument("title"))}let PS=null;function oWe(e){let t=window.trustedTypes;return t?(PS||(PS=t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),PS.createHTML(e)):e}function aWe(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=cG().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&lG[r[1].toLowerCase()])&&(e=i.map(o=>"<"+o+">").join("")+e+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=oWe(e),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function sWe(e){let t=e.querySelectorAll(Eu?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function uWe(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:o,openEnd:a}=e;for(let s=r.length-2;s>=0;s-=2){let u=n.nodes[r[s]];if(!u||u.hasRequiredAttrs())break;i=q.from(u.create(r[s+1],i)),o++,a++}return new V(i,o,a)}const yo={},ai={};function Rs(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}ai.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!fG(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Jm&&Eu&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),lF&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",i=>i(e,JY(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||nWe(e,n)?n.preventDefault():Rs(e,"key")};ai.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};ai.keypress=(e,t)=>{let n=t;if(fG(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Ci&&n.metaKey)return;if(e.someProp("handleKeyPress",i=>i(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof Oe)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!e.someProp("handleTextInput",o=>o(e,r.$from.pos,r.$to.pos,i))&&e.dispatch(e.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function oC(e){return{left:e.clientX,top:e.clientY}}function lWe(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function fF(e,t,n,r,i){if(r==-1)return!1;let o=e.state.doc.resolve(r);for(let a=o.depth+1;a>0;a--)if(e.someProp(t,s=>a>o.depth?s(e,n,o.nodeAfter,o.before(a),i,!0):s(e,n,o.node(a),o.before(a),i,!1)))return!0;return!1}function od(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n=="pointer"&&r.setMeta("pointer",!0),e.dispatch(r)}function cWe(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&xe.isSelectable(r)?(od(e,new xe(n),"pointer"),!0):!1}function dWe(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof xe&&(r=n.node);let o=e.state.doc.resolve(t);for(let a=o.depth+1;a>0;a--){let s=a>o.depth?o.nodeAfter:o.node(a);if(xe.isSelectable(s)){r&&n.$from.depth>0&&a>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(a);break}}return i!=null?(od(e,xe.create(e.state.doc,i),"pointer"),!0):!1}function fWe(e,t,n,r,i){return fF(e,"handleClickOn",t,n,r)||e.someProp("handleClick",o=>o(e,t,r))||(i?dWe(e,n):cWe(e,n))}function pWe(e,t,n,r){return fF(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",i=>i(e,t,r))}function hWe(e,t,n,r){return fF(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",i=>i(e,t,r))||AWe(e,n,r)}function AWe(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(od(e,Oe.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(t);for(let o=i.depth+1;o>0;o--){let a=o>i.depth?i.nodeAfter:i.node(o),s=i.before(o);if(a.inlineContent)od(e,Oe.create(r,s+1,s+1+a.content.size),"pointer");else if(xe.isSelectable(a))od(e,xe.create(r,s),"pointer");else continue;return!0}}function pF(e){return Pv(e)}const dG=Ci?"metaKey":"ctrlKey";yo.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=pF(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&lWe(n,e.input.lastClick)&&!n[dG]&&(e.input.lastClick.type=="singleClick"?o="doubleClick":e.input.lastClick.type=="doubleClick"&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let a=e.posAtCoords(oC(n));a&&(o=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new mWe(e,a,n,!!r)):(o=="doubleClick"?pWe:hWe)(e,a.pos,a.inside,n)?n.preventDefault():Rs(e,"pointer"))};class mWe{constructor(t,n,r,i){this.view=t,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[dG],this.allowDefault=r.shiftKey;let o,a;if(n.inside>-1)o=t.state.doc.nodeAt(n.inside),a=n.inside;else{let c=t.state.doc.resolve(n.pos);o=c.parent,a=c.depth?c.before():0}const s=i?null:r.target,u=s?t.docView.nearestDesc(s,!0):null;this.target=u&&u.dom.nodeType==1?u.dom:null;let{selection:l}=t.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||l instanceof xe&&l.from<=a&&l.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&iC&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Rs(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>dF(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(oC(t))),this.updateAllowDefault(t),this.allowDefault||!n?Rs(this.view,"pointer"):fWe(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||Oc&&this.mightDrag&&!this.mightDrag.node.isAtom||Eu&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(od(this.view,je.near(this.view.state.doc.resolve(n.pos)),"pointer"),t.preventDefault()):Rs(this.view,"pointer")}move(t){this.updateAllowDefault(t),Rs(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}yo.touchstart=e=>{e.input.lastTouch=Date.now(),pF(e),Rs(e,"pointer")};yo.touchmove=e=>{e.input.lastTouch=Date.now(),Rs(e,"pointer")};yo.contextmenu=e=>pF(e);function fG(e,t){return e.composing?!0:Oc&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const gWe=Jm?5e3:-1;ai.compositionstart=ai.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof Oe&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||n.marks(),Pv(e,!0),e.markCursor=null;else if(Pv(e,!t.selection.empty),iC&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let a=o<0?i.lastChild:i.childNodes[o-1];if(!a)break;if(a.nodeType==3){let s=e.domSelection();s&&s.collapse(a,a.nodeValue.length);break}else i=a,o=-1}}e.input.composing=!0}pG(e,gWe)};ai.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,pG(e,20))};function pG(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Pv(e),t))}function vWe(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=yWe());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function yWe(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Pv(e,t=!1){if(!(Jm&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),vWe(e),t||e.docView&&e.docView.dirty){let n=VPe(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!e.state.selection.empty?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function bWe(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const Uh=Gm&&XY<15||lF&&qPe<604;yo.copy=ai.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type=="cut";if(r.empty)return;let o=Uh?null:n.clipboardData,a=r.content(),{dom:s,text:u}=iG(e,a);o?(n.preventDefault(),o.clearData(),o.setData("text/html",s.innerHTML),o.setData("text/plain",u)):bWe(e,s),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function CWe(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function SWe(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?v_(e,r.value,null,i,t):v_(e,r.textContent,r.innerHTML,i,t)},50)}function v_(e,t,n,r,i){let o=oG(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",u=>u(e,i,o||V.empty)))return!0;if(!o)return!1;let a=CWe(o),s=a?e.state.tr.replaceSelectionWith(a,r):e.state.tr.replaceSelection(o);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function hG(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}ai.paste=(e,t)=>{let n=t;if(e.composing&&!Jm)return;let r=Uh?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&v_(e,hG(r),r.getData("text/html"),i,n)?n.preventDefault():SWe(e,n)};class wWe{constructor(t,n,r){this.slice=t,this.move=n,this.node=r}}const AG=Ci?"altKey":"ctrlKey";yo.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(oC(n)),a;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof xe?i.to-1:i.to))){if(r&&r.mightDrag)a=xe.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=e.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=e.docView&&(a=xe.create(e.state.doc,f.posBefore))}}let s=(a||e.state.selection).content(),{dom:u,text:l,slice:c}=iG(e,s);(!n.dataTransfer.files.length||!Eu||eG>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Uh?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",Uh||n.dataTransfer.setData("text/plain",l),e.dragging=new wWe(c,!n[AG],a)};yo.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};ai.dragover=ai.dragenter=(e,t)=>t.preventDefault();ai.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(oC(n));if(!i)return;let o=e.state.doc.resolve(i.pos),a=r&&r.slice;a?e.someProp("transformPasted",A=>{a=A(a,e)}):a=oG(e,hG(n.dataTransfer),Uh?null:n.dataTransfer.getData("text/html"),!1,o);let s=!!(r&&!n[AG]);if(e.someProp("handleDrop",A=>A(e,n,a||V.empty,s))){n.preventDefault();return}if(!a)return;n.preventDefault();let u=a?UPe(e.state.doc,o.pos,a):o.pos;u==null&&(u=o.pos);let l=e.state.tr;if(s){let{node:A}=r;A?A.replace(l):l.deleteSelection()}let c=l.mapping.map(u),f=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,p=l.doc;if(f?l.replaceRangeWith(c,c,a.content.firstChild):l.replaceRange(c,c,a),l.doc.eq(p))return;let h=l.doc.resolve(c);if(f&&xe.isSelectable(a.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(a.content.firstChild))l.setSelection(new xe(h));else{let A=l.mapping.map(u);l.mapping.maps[l.mapping.maps.length-1].forEach((g,y,C,_)=>A=_),l.setSelection(nG(e,h,l.doc.resolve(A)))}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"))};yo.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&dF(e)},20))};yo.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};yo.beforeinput=(e,t)=>{if(Eu&&Jm&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",o=>o(e,JY(8,"Backspace")))))return;let{$cursor:i}=e.state.selection;i&&i.pos>0&&e.dispatch(e.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let e in ai)yo[e]=ai[e];function Bh(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Wv{constructor(t,n){this.toDOM=t,this.spec=n||nl,this.side=this.spec.side||0}map(t,n,r,i){let{pos:o,deleted:a}=t.mapResult(n.from+i,this.side<0?-1:1);return a?null:new $r(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof Wv&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Bh(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Fs{constructor(t,n){this.attrs=t,this.spec=n||nl}map(t,n,r,i){let o=t.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,a=t.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=a?null:new $r(o,a,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof Fs&&Bh(this.attrs,t.attrs)&&Bh(this.spec,t.spec)}static is(t){return t.type instanceof Fs}destroy(){}}let _We=class mG{constructor(t,n){this.attrs=t,this.spec=n||nl}map(t,n,r,i){let o=t.mapResult(n.from+i,1);if(o.deleted)return null;let a=t.mapResult(n.to+i,-1);return a.deleted||a.pos<=o.pos?null:new $r(o.pos-r,a.pos-r,this)}valid(t,n){let{index:r,offset:i}=t.content.findIndex(n.from),o;return i==n.from&&!(o=t.child(r)).isText&&i+o.nodeSize==n.to}eq(t){return this==t||t instanceof mG&&Bh(this.attrs,t.attrs)&&Bh(this.spec,t.spec)}destroy(){}};class $r{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new $r(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,r){return this.type.map(t,this,n,r)}static widget(t,n,r){return new $r(t,t,new Wv(n,r))}static inline(t,n,r,i){return new $r(t,n,new Fs(r,i))}static node(t,n,r,i){return new $r(t,n,new _We(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Fs}get widget(){return this.type instanceof Wv}}const Hc=[],nl={};class Mt{constructor(t,n){this.local=t.length?t:Hc,this.children=n.length?n:Hc}static create(t,n){return n.length?Nv(n,t,0,nl):ur}find(t,n,r){let i=[];return this.findInner(t??0,n??1e9,i,0,r),i}findInner(t,n,r,i,o){for(let a=0;a<this.local.length;a++){let s=this.local[a];s.from<=n&&s.to>=t&&(!o||o(s.spec))&&r.push(s.copy(s.from+i,s.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<n&&this.children[a+1]>t){let s=this.children[a]+1;this.children[a+2].findInner(t-s,n-s,r,i+s,o)}}map(t,n,r){return this==ur||t.maps.length==0?this:this.mapInner(t,n,0,0,r||nl)}mapInner(t,n,r,i,o){let a;for(let s=0;s<this.local.length;s++){let u=this.local[s].map(t,r,i);u&&u.type.valid(n,u)?(a||(a=[])).push(u):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?xWe(this.children,a||[],t,n,r,i,o):a?new Mt(a.sort(rl),Hc):ur}add(t,n){return n.length?this==ur?Mt.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,o=0;t.forEach((s,u)=>{let l=u+r,c;if(c=vG(n,s,l)){for(i||(i=this.children.slice());o<i.length&&i[o]<u;)o+=3;i[o]==u?i[o+2]=i[o+2].addInner(s,c,l+1):i.splice(o,0,u,u+s.nodeSize,Nv(c,s,l+1,nl)),o+=3}});let a=gG(o?yG(n):n,-r);for(let s=0;s<a.length;s++)a[s].type.valid(t,a[s])||a.splice(s--,1);return new Mt(a.length?this.local.concat(a).sort(rl):this.local,i||this.children)}remove(t){return t.length==0||this==ur?this:this.removeInner(t,0)}removeInner(t,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let a,s=r[o]+n,u=r[o+1]+n;for(let c=0,f;c<t.length;c++)(f=t[c])&&f.from>s&&f.to<u&&(t[c]=null,(a||(a=[])).push(f));if(!a)continue;r==this.children&&(r=this.children.slice());let l=r[o+2].removeInner(a,s+1);l!=ur?r[o+2]=l:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,a;o<t.length;o++)if(a=t[o])for(let s=0;s<i.length;s++)i[s].eq(a,n)&&(i==this.local&&(i=this.local.slice()),i.splice(s--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Mt(i,r):ur}forChild(t,n){if(this==ur)return this;if(n.isLeaf)return Mt.empty;let r,i;for(let s=0;s<this.children.length;s+=3)if(this.children[s]>=t){this.children[s]==t&&(r=this.children[s+2]);break}let o=t+1,a=o+n.content.size;for(let s=0;s<this.local.length;s++){let u=this.local[s];if(u.from<a&&u.to>o&&u.type instanceof Fs){let l=Math.max(o,u.from)-o,c=Math.min(a,u.to)-o;l<c&&(i||(i=[])).push(u.copy(l,c))}}if(i){let s=new Mt(i.sort(rl),Hc);return r?new Ku([s,r]):s}return r||ur}eq(t){if(this==t)return!0;if(!(t instanceof Mt)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return hF(this.localsInner(t))}localsInner(t){if(this==ur)return Hc;if(t.inlineContent||!this.local.some(Fs.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Fs||n.push(this.local[r]);return n}forEachSet(t){t(this)}}Mt.empty=new Mt([],[]);Mt.removeOverlap=hF;const ur=Mt.empty;class Ku{constructor(t){this.members=t}map(t,n){const r=this.members.map(i=>i.map(t,n,nl));return Ku.from(r)}forChild(t,n){if(n.isLeaf)return Mt.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(t,n);o!=ur&&(o instanceof Ku?r=r.concat(o.members):r.push(o))}return Ku.from(r)}eq(t){if(!(t instanceof Ku)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(t);if(o.length)if(!n)n=o;else{r&&(n=n.slice(),r=!1);for(let a=0;a<o.length;a++)n.push(o[a])}}return n?hF(r?n:n.sort(rl)):Hc}static from(t){switch(t.length){case 0:return ur;case 1:return t[0];default:return new Ku(t.every(n=>n instanceof Mt)?t:t.reduce((n,r)=>n.concat(r instanceof Mt?r:r.members),[]))}}forEachSet(t){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(t)}}function xWe(e,t,n,r,i,o,a){let s=e.slice();for(let l=0,c=o;l<n.maps.length;l++){let f=0;n.maps[l].forEach((p,h,A,g)=>{let y=g-A-(h-p);for(let C=0;C<s.length;C+=3){let _=s[C+1];if(_<0||p>_+c-f)continue;let b=s[C]+c-f;h>=b?s[C+1]=p<=b?-2:-1:p>=c&&y&&(s[C]+=y,s[C+1]+=y)}f+=y}),c=n.maps[l].map(c,-1)}let u=!1;for(let l=0;l<s.length;l+=3)if(s[l+1]<0){if(s[l+1]==-2){u=!0,s[l+1]=-1;continue}let c=n.map(e[l]+o),f=c-i;if(f<0||f>=r.content.size){u=!0;continue}let p=n.map(e[l+1]+o,-1),h=p-i,{index:A,offset:g}=r.content.findIndex(f),y=r.maybeChild(A);if(y&&g==f&&g+y.nodeSize==h){let C=s[l+2].mapInner(n,y,c+1,e[l]+o+1,a);C!=ur?(s[l]=f,s[l+1]=h,s[l+2]=C):(s[l+1]=-2,u=!0)}else u=!0}if(u){let l=TWe(s,e,t,n,i,o,a),c=Nv(l,r,0,a);t=c.local;for(let f=0;f<s.length;f+=3)s[f+1]<0&&(s.splice(f,3),f-=3);for(let f=0,p=0;f<c.children.length;f+=3){let h=c.children[f];for(;p<s.length&&s[p]<h;)p+=3;s.splice(p,0,c.children[f],c.children[f+1],c.children[f+2])}}return new Mt(t.sort(rl),s)}function gG(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new $r(i.from+t,i.to+t,i.type))}return n}function TWe(e,t,n,r,i,o,a){function s(u,l){for(let c=0;c<u.local.length;c++){let f=u.local[c].map(r,i,l);f?n.push(f):a.onRemove&&a.onRemove(u.local[c].spec)}for(let c=0;c<u.children.length;c+=3)s(u.children[c+2],u.children[c]+l+1)}for(let u=0;u<e.length;u+=3)e[u+1]==-1&&s(e[u+2],t[u]+o+1);return n}function vG(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let o=0,a;o<e.length;o++)(a=e[o])&&a.from>n&&a.to<r&&((i||(i=[])).push(a),e[o]=null);return i}function yG(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Nv(e,t,n,r){let i=[],o=!1;t.forEach((s,u)=>{let l=vG(e,s,u+n);if(l){o=!0;let c=Nv(l,s,n+u+1,r);c!=ur&&i.push(u,u+s.nodeSize,c)}});let a=gG(o?yG(e):e,-n).sort(rl);for(let s=0;s<a.length;s++)a[s].type.valid(t,a[s])||(r.onRemove&&r.onRemove(a[s].spec),a.splice(s--,1));return a.length||i.length?new Mt(a,i):ur}function rl(e,t){return e.from-t.from||e.to-t.to}function hF(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from==r.from){o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),w2(t,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),w2(t,i,r.copy(o.from,r.to)));break}}}return t}function w2(e,t,n){for(;t<e.length&&rl(n,e[t])>0;)t++;e.splice(t,0,n)}var zs={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:"'"},Kv={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},IWe=typeof navigator<"u"&&/Mac/.test(navigator.platform),EWe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Rn=0;Rn<10;Rn++)zs[48+Rn]=zs[96+Rn]=String(Rn);for(var Rn=1;Rn<=24;Rn++)zs[Rn+111]="F"+Rn;for(var Rn=65;Rn<=90;Rn++)zs[Rn]=String.fromCharCode(Rn+32),Kv[Rn]=String.fromCharCode(Rn);for(var WS in zs)Kv.hasOwnProperty(WS)||(Kv[WS]=zs[WS]);function RWe(e){var t=IWe&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||EWe&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?Kv:zs)[e.keyCode]||e.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}const $We=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function kWe(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,i,o,a;for(let s=0;s<t.length-1;s++){let u=t[s];if(/^(cmd|meta|m)$/i.test(u))a=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))i=!0;else if(/^s(hift)?$/i.test(u))o=!0;else if(/^mod$/i.test(u))$We?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+u)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),a&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function OWe(e){let t=Object.create(null);for(let n in e)t[kWe(n)]=e[n];return t}function NS(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function MWe(e){return new Kn({props:{handleKeyDown:bG(e)}})}function bG(e){let t=OWe(e);return function(n,r){let i=RWe(r),o,a=t[NS(i,r)];if(a&&a(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let s=t[NS(i,r,!1)];if(s&&s(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=zs[r.keyCode])&&o!=i){let s=t[NS(o,r)];if(s&&s(n.state,n.dispatch,n))return!0}}return!1}}const CG=65535,SG=Math.pow(2,16);function FWe(e,t){return e+t*SG}function _2(e){return e&CG}function jWe(e){return(e-(e&CG))/SG}const wG=1,_G=2,qg=4,xG=8;let x2=class{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&xG)>0}get deletedBefore(){return(this.delInfo&(wG|qg))>0}get deletedAfter(){return(this.delInfo&(_G|qg))>0}get deletedAcross(){return(this.delInfo&qg)>0}},xl=class Yc{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Yc.empty)return Yc.empty}recover(t){let n=0,r=_2(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+jWe(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let u=this.ranges[s]-(this.inverted?i:0);if(u>t)break;let l=this.ranges[s+o],c=this.ranges[s+a],f=u+l;if(t<=f){let p=l?t==u?-1:t==f?1:n:n,h=u+i+(p<0?0:c);if(r)return h;let A=t==(n<0?u:f)?null:FWe(s/3,t-u),g=t==u?_G:t==f?wG:qg;return(n<0?t!=u:t!=f)&&(g|=xG),new x2(h,g,A)}i+=c-l}return r?t+i:new x2(t+i,0,null)}touches(t,n){let r=0,i=_2(n),o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let u=this.ranges[s]-(this.inverted?r:0);if(u>t)break;let l=this.ranges[s+o],c=u+l;if(t<=c&&s==i*3)return!0;r+=this.ranges[s+a]-l}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],s=a-(this.inverted?o:0),u=a+(this.inverted?0:o),l=this.ranges[i+n],c=this.ranges[i+r];t(s,s+l,u,u+c),o+=c-l}}invert(){return new Yc(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Yc.empty:new Yc(t<0?[0,-t,0]:[0,0,t])}};xl.empty=new xl([]);const KS=Object.create(null);let ir=class{getMap(){return xl.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=KS[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in KS)throw new RangeError("Duplicate use of step JSON ID "+t);return KS[t]=n,n.prototype.jsonID=t,n}},fr=class Mp{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Mp(t,null)}static fail(t){return new Mp(null,t)}static fromReplace(t,n,r,i){try{return Mp.ok(t.replace(n,r,i))}catch(o){if(o instanceof wl)return Mp.fail(o.message);throw o}}};function AF(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(AF(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return q.fromArray(r)}let TG=class Fp extends ir{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new V(AF(n.content,(a,s)=>!a.isAtom||!s.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return fr.fromReplace(t,this.from,this.to,o)}invert(){return new IG(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Fp(n.pos,r.pos,this.mark)}merge(t){return t instanceof Fp&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Fp(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Fp(n.from,n.to,t.markFromJSON(n.mark))}};ir.jsonID("addMark",TG);let IG=class jp extends ir{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new V(AF(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return fr.fromReplace(t,this.from,this.to,r)}invert(){return new TG(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new jp(n.pos,r.pos,this.mark)}merge(t){return t instanceof jp&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new jp(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new jp(n.from,n.to,t.markFromJSON(n.mark))}};ir.jsonID("removeMark",IG);let EG=class Lp extends ir{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return fr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return fr.fromReplace(t,this.pos,this.pos+1,new V(q.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Lp(this.pos,n.marks[i]);return new Lp(this.pos,this.mark)}}return new RG(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Lp(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Lp(n.pos,t.markFromJSON(n.mark))}};ir.jsonID("addNodeMark",EG);let RG=class y_ extends ir{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return fr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return fr.fromReplace(t,this.pos,this.pos+1,new V(q.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new EG(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new y_(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new y_(n.pos,t.markFromJSON(n.mark))}};ir.jsonID("removeNodeMark",RG);let $G=class Uu extends ir{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&b_(t,this.from,this.to)?fr.fail("Structure replace would overwrite content"):fr.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new xl([this.from,this.to-this.from,this.slice.size])}invert(t){return new Uu(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Uu(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof Uu)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?V.empty:new V(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Uu(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?V.empty:new V(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Uu(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Uu(n.from,n.to,V.fromJSON(t,n.slice),!!n.structure)}};ir.jsonID("replace",$G);let kG=class Vg extends ir{constructor(t,n,r,i,o,a,s=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=s}apply(t){if(this.structure&&(b_(t,this.from,this.gapFrom)||b_(t,this.gapTo,this.to)))return fr.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return fr.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?fr.fromReplace(t,this.from,this.to,r):fr.fail("Content does not fit in gap")}getMap(){return new xl([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new Vg(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new Vg(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Vg(n.from,n.to,n.gapFrom,n.gapTo,V.fromJSON(t,n.slice),n.insert,!!n.structure)}};ir.jsonID("replaceAround",kG);function b_(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function LWe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function DWe(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth;;--r){let i=e.$from.node(r),o=e.$from.index(r),a=e.$to.indexAfter(r);if(r<e.depth&&i.canReplace(o,a,n))return r;if(r==0||i.type.spec.isolating||!LWe(i,o,a))break}return null}function UWe(e,t,n=null,r=e){let i=BWe(e,t),o=i&&PWe(r,t);return o?i.map(T2).concat({type:t,attrs:n}).concat(o.map(T2)):null}function T2(e){return{type:e,attrs:null}}function BWe(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let a=o.length?o[0]:t;return n.canReplaceWith(r,i,a)?o:null}function PWe(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),a=t.contentMatch.findWrapping(o.type);if(!a)return null;let u=(a.length?a[a.length-1]:t).contentMatch;for(let l=r;u&&l<i;l++)u=u.matchType(n.child(l).type);return!u||!u.validEnd?null:a}function zg(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let l=i.depth-1,c=n-2;l>o;l--,c--){let f=i.node(l),p=i.index(l);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(p,f.childCount),A=r&&r[c+1];A&&(h=h.replaceChild(0,A.type.create(A.attrs)));let g=r&&r[c]||f;if(!f.canReplace(p+1,f.childCount)||!g.type.validContent(h))return!1}let s=i.indexAfter(o),u=r&&r[0];return i.node(o).canReplaceWith(s,s,u?u.type:i.node(o+1).type)}function mF(e,t){let n=e.resolve(t),r=n.index();return OG(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function WWe(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let o=t.child(i),a=o.type==r?e.type.schema.nodes.text:o.type;if(n=n.matchType(a),!n||!e.type.allowsMarks(o.marks))return!1}return n.validEnd}function OG(e,t){return!!(e&&t&&!e.isLeaf&&WWe(e,t))}function MG(e,t,n=-1){let r=e.resolve(t);for(let i=r.depth;;i--){let o,a,s=r.index(i);if(i==r.depth?(o=r.nodeBefore,a=r.nodeAfter):n>0?(o=r.node(i+1),s++,a=r.node(i).maybeChild(s)):(o=r.node(i).maybeChild(s-1),a=r.node(i+1)),o&&!o.isTextblock&&OG(o,a)&&r.node(i).canReplace(s,s+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}let NWe=class Qg extends ir{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return fr.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return fr.fromReplace(t,this.pos,this.pos+1,new V(q.from(i),0,n.isLeaf?0:1))}getMap(){return xl.empty}invert(t){return new Qg(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Qg(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Qg(n.pos,n.attr,n.value)}};ir.jsonID("attr",NWe);let KWe=class C_ extends ir{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return fr.ok(r)}getMap(){return xl.empty}invert(t){return new C_(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new C_(n.attr,n.value)}};ir.jsonID("docAttr",KWe);let Ph=class extends Error{};Ph=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Ph.prototype=Object.create(Error.prototype);Ph.prototype.constructor=Ph;Ph.prototype.name="TransformError";const FG=65535,jG=Math.pow(2,16);function qWe(e,t){return e+t*jG}function I2(e){return e&FG}function VWe(e){return(e-(e&FG))/jG}const LG=1,DG=2,Hg=4,UG=8;let E2=class{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&UG)>0}get deletedBefore(){return(this.delInfo&(LG|Hg))>0}get deletedAfter(){return(this.delInfo&(DG|Hg))>0}get deletedAcross(){return(this.delInfo&Hg)>0}},Tl=class Gc{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Gc.empty)return Gc.empty}recover(t){let n=0,r=I2(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+VWe(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let u=this.ranges[s]-(this.inverted?i:0);if(u>t)break;let l=this.ranges[s+o],c=this.ranges[s+a],f=u+l;if(t<=f){let p=l?t==u?-1:t==f?1:n:n,h=u+i+(p<0?0:c);if(r)return h;let A=t==(n<0?u:f)?null:qWe(s/3,t-u),g=t==u?DG:t==f?LG:Hg;return(n<0?t!=u:t!=f)&&(g|=UG),new E2(h,g,A)}i+=c-l}return r?t+i:new E2(t+i,0,null)}touches(t,n){let r=0,i=I2(n),o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let u=this.ranges[s]-(this.inverted?r:0);if(u>t)break;let l=this.ranges[s+o],c=u+l;if(t<=c&&s==i*3)return!0;r+=this.ranges[s+a]-l}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],s=a-(this.inverted?o:0),u=a+(this.inverted?0:o),l=this.ranges[i+n],c=this.ranges[i+r];t(s,s+l,u,u+c),o+=c-l}}invert(){return new Gc(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Gc.empty:new Gc(t<0?[0,-t,0]:[0,0,t])}};Tl.empty=new Tl([]);const qS=Object.create(null);let or=class{getMap(){return Tl.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=qS[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in qS)throw new RangeError("Duplicate use of step JSON ID "+t);return qS[t]=n,n.prototype.jsonID=t,n}},pr=class Dp{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Dp(t,null)}static fail(t){return new Dp(null,t)}static fromReplace(t,n,r,i){try{return Dp.ok(t.replace(n,r,i))}catch(o){if(o instanceof wl)return Dp.fail(o.message);throw o}}};function gF(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(gF(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return q.fromArray(r)}let BG=class Up extends or{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new V(gF(n.content,(a,s)=>!a.isAtom||!s.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return pr.fromReplace(t,this.from,this.to,o)}invert(){return new PG(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Up(n.pos,r.pos,this.mark)}merge(t){return t instanceof Up&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Up(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Up(n.from,n.to,t.markFromJSON(n.mark))}};or.jsonID("addMark",BG);let PG=class Bp extends or{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new V(gF(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return pr.fromReplace(t,this.from,this.to,r)}invert(){return new BG(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Bp(n.pos,r.pos,this.mark)}merge(t){return t instanceof Bp&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Bp(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Bp(n.from,n.to,t.markFromJSON(n.mark))}};or.jsonID("removeMark",PG);let WG=class Pp extends or{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return pr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return pr.fromReplace(t,this.pos,this.pos+1,new V(q.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Pp(this.pos,n.marks[i]);return new Pp(this.pos,this.mark)}}return new NG(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Pp(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Pp(n.pos,t.markFromJSON(n.mark))}};or.jsonID("addNodeMark",WG);let NG=class S_ extends or{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return pr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return pr.fromReplace(t,this.pos,this.pos+1,new V(q.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new WG(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new S_(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new S_(n.pos,t.markFromJSON(n.mark))}};or.jsonID("removeNodeMark",NG);let aC=class Bu extends or{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&w_(t,this.from,this.to)?pr.fail("Structure replace would overwrite content"):pr.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Tl([this.from,this.to-this.from,this.slice.size])}invert(t){return new Bu(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Bu(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof Bu)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?V.empty:new V(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Bu(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?V.empty:new V(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Bu(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Bu(n.from,n.to,V.fromJSON(t,n.slice),!!n.structure)}};or.jsonID("replace",aC);let qv=class Yg extends or{constructor(t,n,r,i,o,a,s=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=s}apply(t){if(this.structure&&(w_(t,this.from,this.gapFrom)||w_(t,this.gapTo,this.to)))return pr.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return pr.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?pr.fromReplace(t,this.from,this.to,r):pr.fail("Content does not fit in gap")}getMap(){return new Tl([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new Yg(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new Yg(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Yg(n.from,n.to,n.gapFrom,n.gapTo,V.fromJSON(t,n.slice),n.insert,!!n.structure)}};or.jsonID("replaceAround",qv);function w_(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function zWe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function sC(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth;;--r){let i=e.$from.node(r),o=e.$from.index(r),a=e.$to.indexAfter(r);if(r<e.depth&&i.canReplace(o,a,n))return r;if(r==0||i.type.spec.isolating||!zWe(i,o,a))break}return null}function QWe(e,t,n=null,r=e){let i=HWe(e,t),o=i&&YWe(r,t);return o?i.map(R2).concat({type:t,attrs:n}).concat(o.map(R2)):null}function R2(e){return{type:e,attrs:null}}function HWe(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let a=o.length?o[0]:t;return n.canReplaceWith(r,i,a)?o:null}function YWe(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),a=t.contentMatch.findWrapping(o.type);if(!a)return null;let u=(a.length?a[a.length-1]:t).contentMatch;for(let l=r;u&&l<i;l++)u=u.matchType(n.child(l).type);return!u||!u.validEnd?null:a}function GWe(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let l=i.depth-1,c=n-2;l>o;l--,c--){let f=i.node(l),p=i.index(l);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(p,f.childCount),A=r&&r[c+1];A&&(h=h.replaceChild(0,A.type.create(A.attrs)));let g=r&&r[c]||f;if(!f.canReplace(p+1,f.childCount)||!g.type.validContent(h))return!1}let s=i.indexAfter(o),u=r&&r[0];return i.node(o).canReplaceWith(s,s,u?u.type:i.node(o+1).type)}function uC(e,t){let n=e.resolve(t),r=n.index();return KG(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function JWe(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let o=t.child(i),a=o.type==r?e.type.schema.nodes.text:o.type;if(n=n.matchType(a),!n||!e.type.allowsMarks(o.marks))return!1}return n.validEnd}function KG(e,t){return!!(e&&t&&!e.isLeaf&&JWe(e,t))}function qG(e,t,n=-1){let r=e.resolve(t);for(let i=r.depth;;i--){let o,a,s=r.index(i);if(i==r.depth?(o=r.nodeBefore,a=r.nodeAfter):n>0?(o=r.node(i+1),s++,a=r.node(i).maybeChild(s)):(o=r.node(i).maybeChild(s-1),a=r.node(i+1)),o&&!o.isTextblock&&KG(o,a)&&r.node(i).canReplace(s,s+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}function vF(e,t,n=t,r=V.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return ZWe(i,o,r)?new aC(t,n,r):new XWe(i,o,r).fit()}function ZWe(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}let XWe=class{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=q.empty;for(let i=0;i<=t.depth;i++){let o=t.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(i))})}for(let i=t.depth;i>0;i--)this.placed=q.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let l=this.findFittable();l?this.placeNodes(l):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;let o=this.placed,a=r.depth,s=i.depth;for(;a&&s&&o.childCount==1;)o=o.firstChild.content,a--,s--;let u=new V(o,a,s);return t>-1?new qv(r.pos,t,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new aC(r.pos,i.pos,u):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<t;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){t=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=VS(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let a=i.firstChild;for(let s=this.depth;s>=0;s--){let{type:u,match:l}=this.frontier[s],c,f=null;if(n==1&&(a?l.matchType(a.type)||(f=l.fillBefore(q.from(a),!1)):o&&u.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:s,parent:o,inject:f};if(n==2&&a&&(c=l.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:s,parent:o,wrap:c};if(o&&l.matchType(o.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=VS(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new V(t,n+1,Math.max(r,i.size+n>=t.size-r?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=VS(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new V(Wp(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new V(Wp(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let g=0;g<o.length;g++)this.openFrontierNode(o[g]);let a=this.unplaced,s=r?r.content:a.content,u=a.openStart-t,l=0,c=[],{match:f,type:p}=this.frontier[n];if(i){for(let g=0;g<i.childCount;g++)c.push(i.child(g));f=f.matchFragment(i)}let h=s.size+t-(a.content.size-a.openEnd);for(;l<s.childCount;){let g=s.child(l),y=f.matchType(g.type);if(!y)break;l++,(l>1||u==0||g.content.size)&&(f=y,c.push(VG(g.mark(p.allowedMarks(g.marks)),l==1?u:0,l==s.childCount?h:-1)))}let A=l==s.childCount;A||(h=-1),this.placed=Np(this.placed,n,q.from(c)),this.frontier[n].match=f,A&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=s;g<h;g++){let C=y.lastChild;this.frontier.push({type:C.type,match:C.contentMatchAt(C.childCount)}),y=C.content}this.unplaced=A?t==0?V.empty:new V(Wp(a.content,t-1,1),t-1,h<0?a.openEnd:t-1):new V(Wp(a.content,t,l),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!zS(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),a=zS(t,n,i,r,o);if(a){for(let s=n-1;s>=0;s--){let{match:u,type:l}=this.frontier[s],c=zS(t,s,l,u,!0);if(!c||c.childCount)continue e}return{depth:n,fit:a,move:o?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Np(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let i=t.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,t.index(r));this.openFrontierNode(i.type,i.attrs,o)}return t}openFrontierNode(t,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=Np(this.placed,this.depth,q.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(q.empty,!0);n.childCount&&(this.placed=Np(this.placed,this.frontier.length,n))}};function Wp(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Wp(e.firstChild.content,t-1,n)))}function Np(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Np(e.lastChild.content,t-1,n)))}function VS(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function VG(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,VG(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(q.empty,!0)))),e.copy(r)}function zS(e,t,n,r,i){let o=e.node(t),a=i?e.indexAfter(t):e.index(t);if(a==o.childCount&&!n.compatibleContent(o.type))return null;let s=r.fillBefore(o.content,!0,a);return s&&!eNe(n,o.content,a)?s:null}function eNe(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}let tNe=class Gg extends or{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return pr.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return pr.fromReplace(t,this.pos,this.pos+1,new V(q.from(i),0,n.isLeaf?0:1))}getMap(){return Tl.empty}invert(t){return new Gg(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Gg(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Gg(n.pos,n.attr,n.value)}};or.jsonID("attr",tNe);let nNe=class __ extends or{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return pr.ok(r)}getMap(){return Tl.empty}invert(t){return new __(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new __(n.attr,n.value)}};or.jsonID("docAttr",nNe);let Wh=class extends Error{};Wh=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Wh.prototype=Object.create(Error.prototype);Wh.prototype.constructor=Wh;Wh.prototype.name="TransformError";const rNe=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function zG(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const iNe=(e,t,n)=>{let r=zG(e,n);if(!r)return!1;let i=yF(r);if(!i){let a=r.blockRange(),s=a&&sC(a);return s==null?!1:(t&&t(e.tr.lift(a,s).scrollIntoView()),!0)}let o=i.nodeBefore;if(GG(e,i,t,-1))return!0;if(r.parent.content.size==0&&($d(o,"end")||xe.isSelectable(o)))for(let a=r.depth;;a--){let s=vF(e.doc,r.before(a),r.after(a),V.empty);if(s&&s.slice.size<s.to-s.from){if(t){let u=e.tr.step(s);u.setSelection($d(o,"end")?je.findFrom(u.doc.resolve(u.mapping.map(i.pos,-1)),-1):xe.create(u.doc,i.pos-o.nodeSize)),t(u.scrollIntoView())}return!0}if(a==1||r.node(a-1).childCount>1)break}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},oNe=(e,t,n)=>{let r=zG(e,n);if(!r)return!1;let i=yF(r);return i?QG(e,i,t):!1},aNe=(e,t,n)=>{let r=HG(e,n);if(!r)return!1;let i=bF(r);return i?QG(e,i,t):!1};function QG(e,t,n){let r=t.nodeBefore,i=r,o=t.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let c=i.lastChild;if(!c)return!1;i=c}let a=t.nodeAfter,s=a,u=t.pos+1;for(;!s.isTextblock;u++){if(s.type.spec.isolating)return!1;let c=s.firstChild;if(!c)return!1;s=c}let l=vF(e.doc,o,u,V.empty);if(!l||l.from!=o||l instanceof aC&&l.slice.size>=u-o)return!1;if(n){let c=e.tr.step(l);c.setSelection(Oe.create(c.doc,o)),n(c.scrollIntoView())}return!0}function $d(e,t,n=!1){for(let r=e;r;r=t=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const sNe=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=yF(r)}let a=o&&o.nodeBefore;return!a||!xe.isSelectable(a)?!1:(t&&t(e.tr.setSelection(xe.create(e.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function yF(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function HG(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const uNe=(e,t,n)=>{let r=HG(e,n);if(!r)return!1;let i=bF(r);if(!i)return!1;let o=i.nodeAfter;if(GG(e,i,t,1))return!0;if(r.parent.content.size==0&&($d(o,"start")||xe.isSelectable(o))){let a=vF(e.doc,r.before(),r.after(),V.empty);if(a&&a.slice.size<a.to-a.from){if(t){let s=e.tr.step(a);s.setSelection($d(o,"start")?je.findFrom(s.doc.resolve(s.mapping.map(i.pos)),1):xe.create(s.doc,s.mapping.map(i.pos))),t(s.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},lNe=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=bF(r)}let a=o&&o.nodeAfter;return!a||!xe.isSelectable(a)?!1:(t&&t(e.tr.setSelection(xe.create(e.doc,o.pos)).scrollIntoView()),!0)};function bF(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const cNe=(e,t)=>{let n=e.selection,r=n instanceof xe,i;if(r){if(n.node.isTextblock||!uC(e.doc,n.from))return!1;i=n.from}else if(i=qG(e.doc,n.from,-1),i==null)return!1;if(t){let o=e.tr.join(i);r&&o.setSelection(xe.create(o.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(o.scrollIntoView())}return!0},dNe=(e,t)=>{let n=e.selection,r;if(n instanceof xe){if(n.node.isTextblock||!uC(e.doc,n.to))return!1;r=n.to}else if(r=qG(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},fNe=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&sC(i);return o==null?!1:(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)},pNe=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
|
|
77
|
+
`).scrollIntoView()),!0)};function YG(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const hNe=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),a=YG(i.contentMatchAt(o));if(!a||!i.canReplaceWith(o,o,a))return!1;if(t){let s=n.after(),u=e.tr.replaceWith(s,s,a.createAndFill());u.setSelection(je.near(u.doc.resolve(s),1)),t(u.scrollIntoView())}return!0},ANe=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof xi||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=YG(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,s=e.tr.insert(a,o.createAndFill());s.setSelection(Oe.create(s.doc,a+1)),t(s.scrollIntoView())}return!0},mNe=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(GWe(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&sC(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},gNe=(e,t)=>{let{$from:n,to:r}=e.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),t&&t(e.tr.setSelection(xe.create(e.doc,i))),!0)};function vNe(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(o,o+1)||!(i.isTextblock||uC(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function GG(e,t,n,r){let i=t.nodeBefore,o=t.nodeAfter,a,s,u=i.type.spec.isolating||o.type.spec.isolating;if(!u&&vNe(e,t,n))return!0;let l=!u&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(a=(s=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&s.matchType(a[0]||o.type).validEnd){if(n){let h=t.pos+o.nodeSize,A=q.empty;for(let C=a.length-1;C>=0;C--)A=q.from(a[C].create(null,A));A=q.from(i.copy(A));let g=e.tr.step(new qv(t.pos-1,h,t.pos,h,new V(A,1,0),a.length,!0)),y=g.doc.resolve(h+2*a.length);y.nodeAfter&&y.nodeAfter.type==i.type&&uC(g.doc,y.pos)&&g.join(y.pos),n(g.scrollIntoView())}return!0}let c=o.type.spec.isolating||r>0&&u?null:je.findFrom(t,1),f=c&&c.$from.blockRange(c.$to),p=f&&sC(f);if(p!=null&&p>=t.depth)return n&&n(e.tr.lift(f,p).scrollIntoView()),!0;if(l&&$d(o,"start",!0)&&$d(i,"end")){let h=i,A=[];for(;A.push(h),!h.isTextblock;)h=h.lastChild;let g=o,y=1;for(;!g.isTextblock;g=g.firstChild)y++;if(h.canReplace(h.childCount,h.childCount,g.content)){if(n){let C=q.empty;for(let b=A.length-1;b>=0;b--)C=q.from(A[b].copy(C));let _=e.tr.step(new qv(t.pos-A.length,t.pos+o.nodeSize,t.pos+y,t.pos+o.nodeSize-y,new V(C,A.length,0),0,!0));n(_.scrollIntoView())}return!0}}return!1}function JG(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(t.tr.setSelection(Oe.create(t.doc,e<0?i.start(o):i.end(o)))),!0):!1}}const yNe=JG(-1),bNe=JG(1);function CNe(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),s=a&&QWe(a,e,t);return s?(r&&r(n.tr.wrap(a,s).scrollIntoView()),!0):!1}}function $2(e,t=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:a},$to:{pos:s}}=n.selection.ranges[o];n.doc.nodesBetween(a,s,(u,l)=>{if(i)return!1;if(!(!u.isTextblock||u.hasMarkup(e,t)))if(u.type==e)i=!0;else{let c=n.doc.resolve(l),f=c.index();i=c.parent.canReplaceWith(f,f+1,e)}})}if(!i)return!1;if(r){let o=n.tr;for(let a=0;a<n.selection.ranges.length;a++){let{$from:{pos:s},$to:{pos:u}}=n.selection.ranges[a];o.setBlockType(s,u,e,t)}r(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function SNe(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),s=!1,u=a;if(!a)return!1;if(a.depth>=2&&i.node(a.depth-1).type.compatibleContent(e)&&a.startIndex==0){if(i.index(a.depth-1)==0)return!1;let c=n.doc.resolve(a.start-2);u=new Lv(c,c,a.depth),a.endIndex<a.parent.childCount&&(a=new Lv(i,n.doc.resolve(o.end(a.depth)),a.depth)),s=!0}let l=OPe(u,e,t,a);return l?(r&&r(wNe(n.tr,a,l,s,e).scrollIntoView()),!0):!1}}function wNe(e,t,n,r,i){let o=q.empty;for(let c=n.length-1;c>=0;c--)o=q.from(n[c].type.create(n[c].attrs,o));e.step(new pp(t.start-(r?2:0),t.end,t.start,t.end,new V(o,0,0),n.length,!0));let a=0;for(let c=0;c<n.length;c++)n[c].type==i&&(a=c+1);let s=n.length-a,u=t.start+n.length-(r?2:0),l=t.parent;for(let c=t.startIndex,f=t.endIndex,p=!0;c<f;c++,p=!1)!p&&jPe(e.doc,u,s)&&(e.split(u,s),u+=2*s),u+=l.child(c).nodeSize;return e}function _Ne(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==e);return o?n?r.node(o.depth-1).type==e?xNe(t,n,e,o):TNe(t,n,o):!0:!1}}function xNe(e,t,n,r){let i=e.tr,o=r.end,a=r.$to.end(r.depth);o<a&&(i.step(new pp(o-1,a,o,a,new V(q.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Lv(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const s=kPe(r);if(s==null)return!1;i.lift(r,s);let u=i.mapping.map(o,-1)-1;return LPe(i.doc,u)&&i.join(u),t(i.scrollIntoView()),!0}function TNe(e,t,n){let r=e.tr,i=n.parent;for(let h=n.end,A=n.endIndex-1,g=n.startIndex;A>g;A--)h-=i.child(A).nodeSize,r.delete(h-1,h+1);let o=r.doc.resolve(n.start),a=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,u=n.endIndex==i.childCount,l=o.node(-1),c=o.index(-1);if(!l.canReplace(c+(s?0:1),c+1,a.content.append(u?q.empty:q.from(i))))return!1;let f=o.pos,p=f+a.nodeSize;return r.step(new pp(f-(s?1:0),p+(u?1:0),f+1,p-1,new V((s?q.empty:q.from(i.copy(q.empty))).append(u?q.empty:q.from(i.copy(q.empty))),s?0:1,u?0:1),s?0:1)),t(r.scrollIntoView()),!0}function INe(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,l=>l.childCount>0&&l.firstChild.type==e);if(!o)return!1;let a=o.startIndex;if(a==0)return!1;let s=o.parent,u=s.child(a-1);if(u.type!=e)return!1;if(n){let l=u.lastChild&&u.lastChild.type==s.type,c=q.from(l?e.create():null),f=new V(q.from(e.create(null,q.from(s.type.create(null,c)))),l?3:1,0),p=o.start,h=o.end;n(t.tr.step(new pp(p-(l?3:1),h,p,h,f,1,!0)).scrollIntoView())}return!0}}function lC(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}class CF{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,a=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([s,u])=>[s,(...c)=>{const f=u(...c)(a);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,s=[],u=!!t,l=t||o.tr,c=()=>(!u&&n&&!l.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(l),s.every(p=>p===!0)),f={...Object.fromEntries(Object.entries(r).map(([p,h])=>[p,(...g)=>{const y=this.buildProps(l,n),C=h(...g)(y);return s.push(C),f}])),run:c};return f}createCan(t){const{rawCommands:n,state:r}=this,i=!1,o=t||r.tr,a=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([u,l])=>[u,(...c)=>l(...c)({...a,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(t,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,s={tr:t,editor:i,view:a,state:lC({state:o,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t,n),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map(([u,l])=>[u,(...c)=>l(...c)(s)]))}};return s}}function de(e,t,n){return e.config[t]===void 0&&e.parent?de(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?de(e.parent,t,n):null}):e.config[t]}function cC(e){const t=e.filter(i=>i.type==="extension"),n=e.filter(i=>i.type==="node"),r=e.filter(i=>i.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function ZG(e){const t=[],{nodeExtensions:n,markExtensions:r}=cC(e),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(a=>{const s={name:a.name,options:a.options,storage:a.storage,extensions:i},u=de(a,"addGlobalAttributes",s);if(!u)return;u().forEach(c=>{c.types.forEach(f=>{Object.entries(c.attributes).forEach(([p,h])=>{t.push({type:f,name:p,attribute:{...o,...h}})})})})}),i.forEach(a=>{const s={name:a.name,options:a.options,storage:a.storage},u=de(a,"addAttributes",s);if(!u)return;const l=u();Object.entries(l).forEach(([c,f])=>{const p={...o,...f};typeof(p==null?void 0:p.default)=="function"&&(p.default=p.default()),p!=null&&p.isRequired&&(p==null?void 0:p.default)===void 0&&delete p.default,t.push({type:a.name,name:c,attribute:p})})}),t}function an(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function Dt(...e){return e.filter(t=>!!t).reduce((t,n)=>{const r={...t};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const s=o?String(o).split(" "):[],u=r[i]?r[i].split(" "):[],l=s.filter(c=>!u.includes(c));r[i]=[...u,...l].join(" ")}else if(i==="style"){const s=o?o.split(";").map(c=>c.trim()).filter(Boolean):[],u=r[i]?r[i].split(";").map(c=>c.trim()).filter(Boolean):[],l=new Map;u.forEach(c=>{const[f,p]=c.split(":").map(h=>h.trim());l.set(f,p)}),s.forEach(c=>{const[f,p]=c.split(":").map(h=>h.trim());l.set(f,p)}),r[i]=Array.from(l.entries()).map(([c,f])=>`${c}: ${f}`).join("; ")}else r[i]=o}),r},{})}function Vv(e,t){return t.filter(n=>n.type===e.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>Dt(n,r),{})}function ENe(e){return typeof e=="function"}function We(e,t=void 0,...n){return ENe(e)?t?e.bind(t)(...n):e(...n):e}function RNe(e={}){return Object.keys(e).length===0&&e.constructor===Object}function $Ne(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function k2(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;const i=t.reduce((o,a)=>{const s=a.attribute.parseHTML?a.attribute.parseHTML(n):$Ne(n.getAttribute(a.name));return s==null?o:{...o,[a.name]:s}},{});return{...r,...i}}}}function O2(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&RNe(n)?!1:n!=null))}function XG(e,t){var n;const r=ZG(e),{nodeExtensions:i,markExtensions:o}=cC(e),a=(n=i.find(l=>de(l,"topNode")))===null||n===void 0?void 0:n.name,s=Object.fromEntries(i.map(l=>{const c=r.filter(C=>C.type===l.name),f={name:l.name,options:l.options,storage:l.storage,editor:t},p=e.reduce((C,_)=>{const b=de(_,"extendNodeSchema",f);return{...C,...b?b(l):{}}},{}),h=O2({...p,content:We(de(l,"content",f)),marks:We(de(l,"marks",f)),group:We(de(l,"group",f)),inline:We(de(l,"inline",f)),atom:We(de(l,"atom",f)),selectable:We(de(l,"selectable",f)),draggable:We(de(l,"draggable",f)),code:We(de(l,"code",f)),whitespace:We(de(l,"whitespace",f)),linebreakReplacement:We(de(l,"linebreakReplacement",f)),defining:We(de(l,"defining",f)),isolating:We(de(l,"isolating",f)),attrs:Object.fromEntries(c.map(C=>{var _;return[C.name,{default:(_=C==null?void 0:C.attribute)===null||_===void 0?void 0:_.default}]}))}),A=We(de(l,"parseHTML",f));A&&(h.parseDOM=A.map(C=>k2(C,c)));const g=de(l,"renderHTML",f);g&&(h.toDOM=C=>g({node:C,HTMLAttributes:Vv(C,c)}));const y=de(l,"renderText",f);return y&&(h.toText=y),[l.name,h]})),u=Object.fromEntries(o.map(l=>{const c=r.filter(y=>y.type===l.name),f={name:l.name,options:l.options,storage:l.storage,editor:t},p=e.reduce((y,C)=>{const _=de(C,"extendMarkSchema",f);return{...y,..._?_(l):{}}},{}),h=O2({...p,inclusive:We(de(l,"inclusive",f)),excludes:We(de(l,"excludes",f)),group:We(de(l,"group",f)),spanning:We(de(l,"spanning",f)),code:We(de(l,"code",f)),attrs:Object.fromEntries(c.map(y=>{var C;return[y.name,{default:(C=y==null?void 0:y.attribute)===null||C===void 0?void 0:C.default}]}))}),A=We(de(l,"parseHTML",f));A&&(h.parseDOM=A.map(y=>k2(y,c)));const g=de(l,"renderHTML",f);return g&&(h.toDOM=y=>g({mark:y,HTMLAttributes:Vv(y,c)})),[l.name,h]}));return new MY({topNode:a,nodes:s,marks:u})}function QS(e,t){return t.nodes[e]||t.marks[e]||null}function M2(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}function eJ(e,t){const n=Ym.fromSchema(t).serializeFragment(e),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}const kNe=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(i,o,a,s)=>{var u,l;const c=((l=(u=i.type.spec).toText)===null||l===void 0?void 0:l.call(u,{node:i,pos:o,parent:a,index:s}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?c:c.slice(0,Math.max(0,r-o))}),n};function SF(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class wF{constructor(t){this.find=t.find,this.handler=t.handler}}const ONe=(e,t)=>{if(SF(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function xg(e){var t;const{editor:n,from:r,to:i,text:o,rules:a,plugin:s}=e,{view:u}=n;if(u.composing)return!1;const l=u.state.doc.resolve(r);if(l.parent.type.spec.code||!((t=l.nodeBefore||l.nodeAfter)===null||t===void 0)&&t.marks.find(p=>p.type.spec.code))return!1;let c=!1;const f=kNe(l)+o;return a.forEach(p=>{if(c)return;const h=ONe(f,p.find);if(!h)return;const A=u.state.tr,g=lC({state:u.state,transaction:A}),y={from:r-(h[0].length-o.length),to:i},{commands:C,chain:_,can:b}=new CF({editor:n,state:g});p.handler({state:g,range:y,match:h,commands:C,chain:_,can:b})===null||!A.steps.length||(A.setMeta(s,{transform:A,from:r,to:i,text:o}),u.dispatch(A),c=!0)}),c}function MNe(e){const{editor:t,rules:n}=e,r=new Kn({state:{init(){return null},apply(i,o,a){const s=i.getMeta(r);if(s)return s;const u=i.getMeta("applyInputRules");return!!u&&setTimeout(()=>{let{text:c}=u;typeof c=="string"?c=c:c=eJ(q.from(c),a.schema);const{from:f}=u,p=f+c.length;xg({editor:t,from:f,to:p,text:c,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,a,s){return xg({editor:t,from:o,to:a,text:s,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&xg({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:a}=i.state.selection;return a?xg({editor:t,from:a.pos,to:a.pos,text:`
|
|
78
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function FNe(e){return Object.prototype.toString.call(e).slice(8,-1)}function Tg(e){return FNe(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function dC(e,t){const n={...e};return Tg(e)&&Tg(t)&&Object.keys(t).forEach(r=>{Tg(t[r])&&Tg(e[r])?n[r]=dC(e[r],t[r]):n[r]=t[r]}),n}let Zm=class x_{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=We(de(this,"addOptions",{name:this.name}))),this.storage=We(de(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new x_(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>dC(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new x_(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=We(de(n,"addOptions",{name:n.name})),n.storage=We(de(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){const a=i.marks();if(!!!a.find(l=>(l==null?void 0:l.type.name)===n.name))return!1;const u=a.find(l=>(l==null?void 0:l.type.name)===n.name);return u&&r.removeStoredMark(u),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}};function jNe(e){return typeof e=="number"}class LNe{constructor(t){this.find=t.find,this.handler=t.handler}}const DNe=(e,t,n)=>{if(SF(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=e,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function UNe(e){const{editor:t,state:n,from:r,to:i,rule:o,pasteEvent:a,dropEvent:s}=e,{commands:u,chain:l,can:c}=new CF({editor:t,state:n}),f=[];return n.doc.nodesBetween(r,i,(h,A)=>{if(!h.isTextblock||h.type.spec.code)return;const g=Math.max(r,A),y=Math.min(i,A+h.content.size),C=h.textBetween(g-A,y-A,void 0,"");DNe(C,o.find,a).forEach(b=>{if(b.index===void 0)return;const v=g+b.index+1,S=v+b[0].length,w={from:n.tr.mapping.map(v),to:n.tr.mapping.map(S)},T=o.handler({state:n,range:w,match:b,commands:u,chain:l,can:c,pasteEvent:a,dropEvent:s});f.push(T)})}),f.every(h=>h!==null)}let Ig=null;const BNe=e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)===null||t===void 0||t.setData("text/html",e),n};function PNe(e){const{editor:t,rules:n}=e;let r=null,i=!1,o=!1,a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,s;try{s=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{s=null}const u=({state:c,from:f,to:p,rule:h,pasteEvt:A})=>{const g=c.tr,y=lC({state:c,transaction:g});if(!(!UNe({editor:t,state:y,from:Math.max(f-1,0),to:p.b-1,rule:h,pasteEvent:A,dropEvent:s})||!g.steps.length)){try{s=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{s=null}return a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}};return n.map(c=>new Kn({view(f){const p=A=>{var g;r=!((g=f.dom.parentElement)===null||g===void 0)&&g.contains(A.target)?f.dom.parentElement:null,r&&(Ig=t)},h=()=>{Ig&&(Ig=null)};return window.addEventListener("dragstart",p),window.addEventListener("dragend",h),{destroy(){window.removeEventListener("dragstart",p),window.removeEventListener("dragend",h)}}},props:{handleDOMEvents:{drop:(f,p)=>{if(o=r===f.dom.parentElement,s=p,!o){const h=Ig;h&&setTimeout(()=>{const A=h.state.selection;A&&h.commands.deleteRange({from:A.from,to:A.to})},10)}return!1},paste:(f,p)=>{var h;const A=(h=p.clipboardData)===null||h===void 0?void 0:h.getData("text/html");return a=p,i=!!(A!=null&&A.includes("data-pm-slice")),!1}}},appendTransaction:(f,p,h)=>{const A=f[0],g=A.getMeta("uiEvent")==="paste"&&!i,y=A.getMeta("uiEvent")==="drop"&&!o,C=A.getMeta("applyPasteRules"),_=!!C;if(!g&&!y&&!_)return;if(_){let{text:S}=C;typeof S=="string"?S=S:S=eJ(q.from(S),h.schema);const{from:w}=C,T=w+S.length,E=BNe(S);return u({rule:c,state:h,from:w,to:{b:T},pasteEvt:E})}const b=p.doc.content.findDiffStart(h.doc.content),v=p.doc.content.findDiffEnd(h.doc.content);if(!(!jNe(b)||!v||b===v.b))return u({rule:c,state:h,from:b,to:v,pasteEvt:a})}}))}function WNe(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return Array.from(new Set(t))}class td{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=td.resolve(t),this.schema=XG(this.extensions,n),this.setupExtensions()}static resolve(t){const n=td.sort(td.flatten(t)),r=WNe(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(t){return t.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=de(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(t){return t.sort((r,i)=>{const o=de(r,"priority")||100,a=de(i,"priority")||100;return o>a?-1:o<a?1:0})}get commands(){return this.extensions.reduce((t,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:QS(n.name,this.schema)},i=de(n,"addCommands",r);return i?{...t,...i()}:t},{})}get plugins(){const{editor:t}=this,n=td.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(a=>{const s={name:a.name,options:a.options,storage:a.storage,editor:t,type:QS(a.name,this.schema)},u=[],l=de(a,"addKeyboardShortcuts",s);let c={};if(a.type==="mark"&&de(a,"exitable",s)&&(c.ArrowRight=()=>Zm.handleExit({editor:t,mark:a})),l){const g=Object.fromEntries(Object.entries(l()).map(([y,C])=>[y,()=>C({editor:t})]));c={...c,...g}}const f=MWe(c);u.push(f);const p=de(a,"addInputRules",s);M2(a,t.options.enableInputRules)&&p&&r.push(...p());const h=de(a,"addPasteRules",s);M2(a,t.options.enablePasteRules)&&h&&i.push(...h());const A=de(a,"addProseMirrorPlugins",s);if(A){const g=A();u.push(...g)}return u}).flat();return[MNe({editor:t,rules:r}),...PNe({editor:t,rules:i}),...o]}get attributes(){return ZG(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:n}=cC(this.extensions);return Object.fromEntries(n.filter(r=>!!de(r,"addNodeView")).map(r=>{const i=this.attributes.filter(u=>u.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:t,type:an(r.name,this.schema)},a=de(r,"addNodeView",o);if(!a)return[];const s=(u,l,c,f,p)=>{const h=Vv(u,i);return a()({node:u,view:l,getPos:c,decorations:f,innerDecorations:p,editor:t,extension:r,HTMLAttributes:h})};return[r.name,s]}))}setupExtensions(){this.extensions.forEach(t=>{var n;this.editor.extensionStorage[t.name]=t.storage;const r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:QS(t.name,this.schema)};t.type==="mark"&&(!((n=We(de(t,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(t.name);const i=de(t,"onBeforeCreate",r),o=de(t,"onCreate",r),a=de(t,"onUpdate",r),s=de(t,"onSelectionUpdate",r),u=de(t,"onTransaction",r),l=de(t,"onFocus",r),c=de(t,"onBlur",r),f=de(t,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),a&&this.editor.on("update",a),s&&this.editor.on("selectionUpdate",s),u&&this.editor.on("transaction",u),l&&this.editor.on("focus",l),c&&this.editor.on("blur",c),f&&this.editor.on("destroy",f)})}}class Fn{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=We(de(this,"addOptions",{name:this.name}))),this.storage=We(de(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Fn(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>dC(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new Fn({...this.config,...t});return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=We(de(n,"addOptions",{name:n.name})),n.storage=We(de(n,"addStorage",{name:n.name,options:n.options})),n}}function NNe(e,t,n){const{from:r,to:i}=t,{blockSeparator:o=`
|
|
79
|
+
|
|
80
|
+
`,textSerializers:a={}}=n||{};let s="";return e.nodesBetween(r,i,(u,l,c,f)=>{var p;u.isBlock&&l>r&&(s+=o);const h=a==null?void 0:a[u.type.name];if(h)return c&&(s+=h({node:u,pos:l,parent:c,index:f,range:t})),!1;u.isText&&(s+=(p=u==null?void 0:u.text)===null||p===void 0?void 0:p.slice(Math.max(r,l)-l,i-l))}),s}function KNe(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}Fn.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Kn({key:new rr("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,a=Math.min(...o.map(c=>c.$from.pos)),s=Math.max(...o.map(c=>c.$to.pos)),u=KNe(n);return NNe(r,{from:a,to:s},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:u})}}})]}});const qNe=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),VNe=(e=!1)=>({commands:t})=>t.setContent("",e),zNe=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:a})=>{e.doc.nodesBetween(o.pos,a.pos,(s,u)=>{if(s.type.isText)return;const{doc:l,mapping:c}=t,f=l.resolve(c.map(u)),p=l.resolve(c.map(u+s.nodeSize)),h=f.blockRange(p);if(!h)return;const A=DWe(h);if(s.type.isTextblock){const{defaultType:g}=f.parent.contentMatchAt(f.index());t.setNodeMarkup(h.start,g)}(A||A===0)&&t.lift(h,A)})}),!0},QNe=e=>t=>e(t),HNe=()=>({state:e,dispatch:t})=>ANe(e,t),YNe=(e,t)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const a=r.mapping.map(t);return r.insert(a,o.content),r.setSelection(new Oe(r.doc.resolve(a-1))),!0},GNe=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(t){const s=i.before(o),u=i.after(o);e.delete(s,u).scrollIntoView()}return!0}return!1},JNe=e=>({tr:t,state:n,dispatch:r})=>{const i=an(e,n.schema),o=t.selection.$anchor;for(let a=o.depth;a>0;a-=1)if(o.node(a).type===i){if(r){const u=o.before(a),l=o.after(a);t.delete(u,l).scrollIntoView()}return!0}return!1},ZNe=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},XNe=()=>({state:e,dispatch:t})=>rNe(e,t),eKe=()=>({commands:e})=>e.keyboardShortcut("Enter"),tKe=()=>({state:e,dispatch:t})=>hNe(e,t);function zv(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:SF(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function tJ(e,t,n={}){return e.find(r=>r.type===t&&zv(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function F2(e,t,n={}){return!!tJ(e,t,n)}function _F(e,t,n){var r;if(!e||!t)return;let i=e.parent.childAfter(e.parentOffset);if((!i.node||!i.node.marks.some(c=>c.type===t))&&(i=e.parent.childBefore(e.parentOffset)),!i.node||!i.node.marks.some(c=>c.type===t)||(n=n||((r=i.node.marks[0])===null||r===void 0?void 0:r.attrs),!tJ([...i.node.marks],t,n)))return;let a=i.index,s=e.start()+i.offset,u=a+1,l=s+i.node.nodeSize;for(;a>0&&F2([...e.parent.child(a-1).marks],t,n);)a-=1,s-=e.parent.child(a).nodeSize;for(;u<e.parent.childCount&&F2([...e.parent.child(u).marks],t,n);)l+=e.parent.child(u).nodeSize,u+=1;return{from:s,to:l}}function Ru(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}const nKe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=Ru(e,r.schema),{doc:a,selection:s}=n,{$from:u,from:l,to:c}=s;if(i){const f=_F(u,o,t);if(f&&f.from<=l&&f.to>=c){const p=Oe.create(a,f.from,f.to);n.setSelection(p)}}return!0},rKe=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function xF(e){return e instanceof Oe}function ya(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function iKe(e,t=null){if(!t)return null;const n=je.atStart(e),r=je.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const i=n.from,o=r.to;return t==="all"?Oe.create(e,ya(0,i,o),ya(e.content.size,i,o)):Oe.create(e,ya(t,i,o),ya(t,i,o))}function nJ(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function fC(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const oKe=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const a=()=>{(fC()||nJ())&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t!=null&&t.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&e===null||e===!1)return!0;if(o&&e===null&&!xF(n.state.selection))return a(),!0;const s=iKe(i.doc,e)||n.state.selection,u=n.state.selection.eq(s);return o&&(u||i.setSelection(s),u&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},aKe=(e,t)=>n=>e.every((r,i)=>t(r,{...n,index:i})),sKe=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),rJ=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&rJ(r)}return e};function Eg(e){const t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,"text/html").body;return rJ(n)}function Qv(e,t,n){if(e instanceof el||e instanceof q)return e;n={slice:!0,parseOptions:{},...n};const r=typeof e=="object"&&e!==null,i=typeof e=="string";if(r)try{if(Array.isArray(e)&&e.length>0)return q.fromArray(e.map(s=>t.nodeFromJSON(s)));const a=t.nodeFromJSON(e);return n.errorOnInvalidContent&&a.check(),a}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",o),Qv("",t,n)}if(i){if(n.errorOnInvalidContent){let a=!1,s="";const u=new MY({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:l=>(a=!0,s=typeof l=="string"?l:l.outerHTML,null)}]}})});if(n.slice?tl.fromSchema(u).parseSlice(Eg(e),n.parseOptions):tl.fromSchema(u).parse(Eg(e),n.parseOptions),n.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${s}`)})}const o=tl.fromSchema(t);return n.slice?o.parseSlice(Eg(e),n.parseOptions).content:o.parse(Eg(e),n.parseOptions)}return Qv("",t,n)}function uKe(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof $G||i instanceof kG))return;const o=e.mapping.maps[r];let a=0;o.forEach((s,u,l,c)=>{a===0&&(a=c)}),e.setSelection(je.near(e.doc.resolve(a),n))}const lKe=e=>!("type"in e),cKe=(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{var a;if(i){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let s;try{s=Qv(t,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(a=n.errorOnInvalidContent)!==null&&a!==void 0?a:o.options.enableContentCheck})}catch(A){return o.emit("contentError",{editor:o,error:A,disableCollaboration:()=>{o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}}),!1}let{from:u,to:l}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},c=!0,f=!0;if((lKe(s)?s:[s]).forEach(A=>{A.check(),c=c?A.isText&&A.marks.length===0:!1,f=f?A.isBlock:!1}),u===l&&f){const{parent:A}=r.doc.resolve(u);A.isTextblock&&!A.type.spec.code&&!A.childCount&&(u-=1,l+=1)}let h;if(c){if(Array.isArray(t))h=t.map(A=>A.text||"").join("");else if(t instanceof q){let A="";t.forEach(g=>{g.text&&(A+=g.text)}),h=A}else typeof t=="object"&&t&&t.text?h=t.text:h=t;r.insertText(h,u,l)}else h=s,r.replaceWith(u,l,h);n.updateSelection&&uKe(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:h}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:h})}return!0},dKe=()=>({state:e,dispatch:t})=>cNe(e,t),fKe=()=>({state:e,dispatch:t})=>dNe(e,t),pKe=()=>({state:e,dispatch:t})=>iNe(e,t),hKe=()=>({state:e,dispatch:t})=>uNe(e,t),AKe=()=>({state:e,dispatch:t,tr:n})=>{try{const r=MG(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},mKe=()=>({state:e,dispatch:t,tr:n})=>{try{const r=MG(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},gKe=()=>({state:e,dispatch:t})=>oNe(e,t),vKe=()=>({state:e,dispatch:t})=>aNe(e,t);function iJ(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function yKe(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let r,i,o,a;for(let s=0;s<t.length-1;s+=1){const u=t[s];if(/^(cmd|meta|m)$/i.test(u))a=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))i=!0;else if(/^s(hift)?$/i.test(u))o=!0;else if(/^mod$/i.test(u))fC()||iJ()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${u}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),a&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}const bKe=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const o=yKe(e).split(/-(?!$)/),a=o.find(l=>!["Alt","Ctrl","Meta","Shift"].includes(l)),s=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),u=t.captureTransaction(()=>{n.someProp("handleKeyDown",l=>l(n,s))});return u==null||u.steps.forEach(l=>{const c=l.map(r.mapping);c&&i&&r.maybeStep(c)}),!0};function kd(e,t,n={}){const{from:r,to:i,empty:o}=e.selection,a=t?an(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(f,p)=>{if(f.isText)return;const h=Math.max(r,p),A=Math.min(i,p+f.nodeSize);s.push({node:f,from:h,to:A})});const u=i-r,l=s.filter(f=>a?a.name===f.node.type.name:!0).filter(f=>zv(f.node.attrs,n,{strict:!1}));return o?!!l.length:l.reduce((f,p)=>f+p.to-p.from,0)>=u}const CKe=(e,t={})=>({state:n,dispatch:r})=>{const i=an(e,n.schema);return kd(n,i,t)?fNe(n,r):!1},SKe=()=>({state:e,dispatch:t})=>mNe(e,t),wKe=e=>({state:t,dispatch:n})=>{const r=an(e,t.schema);return _Ne(r)(t,n)},_Ke=()=>({state:e,dispatch:t})=>pNe(e,t);function oJ(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function j2(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,i)=>(n.includes(i)||(r[i]=e[i]),r),{})}const xKe=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null;const s=oJ(typeof e=="string"?e:e.name,r.schema);return s?(s==="node"&&(o=an(e,r.schema)),s==="mark"&&(a=Ru(e,r.schema)),i&&n.selection.ranges.forEach(u=>{r.doc.nodesBetween(u.$from.pos,u.$to.pos,(l,c)=>{o&&o===l.type&&n.setNodeMarkup(c,void 0,j2(l.attrs,t)),a&&l.marks.length&&l.marks.forEach(f=>{a===f.type&&n.addMark(c,c+l.nodeSize,a.create(j2(f.attrs,t)))})})}),!0):!1},TKe=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),IKe=()=>({tr:e,dispatch:t})=>{if(t){const n=new xi(e.doc);e.setSelection(n)}return!0},EKe=()=>({state:e,dispatch:t})=>sNe(e,t),RKe=()=>({state:e,dispatch:t})=>lNe(e,t),$Ke=()=>({state:e,dispatch:t})=>gNe(e,t),kKe=()=>({state:e,dispatch:t})=>bNe(e,t),OKe=()=>({state:e,dispatch:t})=>yNe(e,t);function MKe(e,t,n={},r={}){return Qv(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const FKe=(e,t=!1,n={},r={})=>({editor:i,tr:o,dispatch:a,commands:s})=>{var u,l;const{doc:c}=o;if(n.preserveWhitespace!=="full"){const f=MKe(e,i.schema,n,{errorOnInvalidContent:(u=r.errorOnInvalidContent)!==null&&u!==void 0?u:i.options.enableContentCheck});return a&&o.replaceWith(0,c.content.size,f).setMeta("preventUpdate",!t),!0}return a&&o.setMeta("preventUpdate",!t),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:n,errorOnInvalidContent:(l=r.errorOnInvalidContent)!==null&&l!==void 0?l:i.options.enableContentCheck})};function jKe(e,t){const n=Ru(t,e.schema),{from:r,to:i,empty:o}=e.selection,a=[];o?(e.storedMarks&&a.push(...e.storedMarks),a.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,u=>{a.push(...u.marks)});const s=a.find(u=>u.type.name===n.name);return s?{...s.attrs}:{}}function LKe(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function aJ(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function pC(e){return t=>aJ(t.$from,e)}function DKe(e,t){const n=td.resolve(e);return XG(n,t)}function sJ(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(i=>{const o=n.resolve(e),a=_F(o,i.type);a&&r.push({mark:i,...a})}):n.nodesBetween(e,t,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(a=>({from:o,to:o+i.nodeSize,mark:a})))}),r}const UKe=(e,t,n,r=20)=>{const i=e.doc.resolve(n);let o=r,a=null;for(;o>0&&a===null;){const s=i.node(o);(s==null?void 0:s.type.name)===t?a=s:o-=1}return[a,o]};function Jg(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=e.find(o=>o.type===t&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function BKe(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?Ru(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>zv(f.attrs,n,{strict:!1}));let a=0;const s=[];if(i.forEach(({$from:f,$to:p})=>{const h=f.pos,A=p.pos;e.doc.nodesBetween(h,A,(g,y)=>{if(!g.isText&&!g.marks.length)return;const C=Math.max(h,y),_=Math.min(A,y+g.nodeSize),b=_-C;a+=b,s.push(...g.marks.map(v=>({mark:v,from:C,to:_})))})}),a===0)return!1;const u=s.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>zv(f.mark.attrs,n,{strict:!1})).reduce((f,p)=>f+p.to-p.from,0),l=s.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,p)=>f+p.to-p.from,0);return(u>0?u+l:u)>=a}const PKe=(e,t)=>{const{$from:n,$to:r,$anchor:i}=e.selection;if(t){const o=pC(s=>s.type.name===t)(e.selection);if(!o)return!1;const a=e.doc.resolve(o.pos+1);return i.pos+1===a.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},WKe=e=>{const{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function L2(e,t){const{nodeExtensions:n}=cC(t),r=n.find(a=>a.name===e);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=We(de(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function TF(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(e.type.name==="hardBreak")return!0;if(e.isText)return/^\s*$/m.test((r=e.text)!==null&&r!==void 0?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let i=!0;return e.content.forEach(o=>{i!==!1&&(TF(o,{ignoreWhitespace:n,checkChildren:t})||(i=!1))}),i}return!1}function NKe(e){return e instanceof xe}function KKe(e,t,n){const i=e.state.doc.content.size,o=ya(t,0,i),a=ya(n,0,i),s=e.coordsAtPos(o),u=e.coordsAtPos(a,-1),l=Math.min(s.top,u.top),c=Math.max(s.bottom,u.bottom),f=Math.min(s.left,u.left),p=Math.max(s.right,u.right),h=p-f,A=c-l,C={top:l,bottom:c,left:f,right:p,width:h,height:A,x:f,y:l};return{...C,toJSON:()=>C}}function qKe(e,t,n){var r;const{selection:i}=t;let o=null;if(xF(i)&&(o=i.$cursor),o){const s=(r=e.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(s)||!s.some(u=>u.type.excludes(n))}const{ranges:a}=i;return a.some(({$from:s,$to:u})=>{let l=s.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(s.pos,u.pos,(c,f,p)=>{if(l)return!1;if(c.isInline){const h=!p||p.type.allowsMarkType(n),A=!!n.isInSet(c.marks)||!c.marks.some(g=>g.type.excludes(n));l=h&&A}return!l}),l})}const VKe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:a,ranges:s}=o,u=Ru(e,r.schema);if(i)if(a){const l=jKe(r,u);n.addStoredMark(u.create({...l,...t}))}else s.forEach(l=>{const c=l.$from.pos,f=l.$to.pos;r.doc.nodesBetween(c,f,(p,h)=>{const A=Math.max(h,c),g=Math.min(h+p.nodeSize,f);p.marks.find(C=>C.type===u)?p.marks.forEach(C=>{u===C.type&&n.addMark(A,g,u.create({...C.attrs,...t}))}):n.addMark(A,g,u.create(t))})});return qKe(r,n,u)},zKe=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),QKe=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const o=an(e,n.schema);let a;return n.selection.$anchor.sameParent(n.selection.$head)&&(a=n.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:s})=>$2(o,{...a,...t})(n)?!0:s.clearNodes()).command(({state:s})=>$2(o,{...a,...t})(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},HKe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,i=ya(e,0,r.content.size),o=xe.create(r,i);t.setSelection(o)}return!0},YKe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:i,to:o}=typeof e=="number"?{from:e,to:e}:e,a=Oe.atStart(r).from,s=Oe.atEnd(r).to,u=ya(i,a,s),l=ya(o,a,s),c=Oe.create(r,u,l);t.setSelection(c)}return!0},GKe=e=>({state:t,dispatch:n})=>{const r=an(e,t.schema);return INe(r)(t,n)};function D2(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(i=>t==null?void 0:t.includes(i.type.name));e.tr.ensureMarks(r)}}const JKe=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:a}=t,{$from:s,$to:u}=o,l=i.extensionManager.attributes,c=Jg(l,s.node().type.name,s.node().attrs);if(o instanceof xe&&o.node.isBlock)return!s.parentOffset||!zg(a,s.pos)?!1:(r&&(e&&D2(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;const f=u.parentOffset===u.parent.content.size,p=s.depth===0?void 0:LKe(s.node(-1).contentMatchAt(s.indexAfter(-1)));let h=f&&p?[{type:p,attrs:c}]:void 0,A=zg(t.doc,t.mapping.map(s.pos),1,h);if(!h&&!A&&zg(t.doc,t.mapping.map(s.pos),1,p?[{type:p}]:void 0)&&(A=!0,h=p?[{type:p,attrs:c}]:void 0),r){if(A&&(o instanceof Oe&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,h),p&&!f&&!s.parentOffset&&s.parent.type!==p)){const g=t.mapping.map(s.before()),y=t.doc.resolve(g);s.node(-1).canReplaceWith(y.index(),y.index()+1,p)&&t.setNodeMarkup(t.mapping.map(s.before()),p)}e&&D2(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return A},ZKe=(e,t={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var a;const s=an(e,r.schema),{$from:u,$to:l}=r.selection,c=r.selection.node;if(c&&c.isBlock||u.depth<2||!u.sameParent(l))return!1;const f=u.node(-1);if(f.type!==s)return!1;const p=o.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==s||u.index(-2)!==u.node(-2).childCount-1)return!1;if(i){let C=q.empty;const _=u.index(-1)?1:u.index(-2)?2:3;for(let E=u.depth-_;E>=u.depth-3;E-=1)C=q.from(u.node(E).copy(C));const b=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,v={...Jg(p,u.node().type.name,u.node().attrs),...t},S=((a=s.contentMatch.defaultType)===null||a===void 0?void 0:a.createAndFill(v))||void 0;C=C.append(q.from(s.createAndFill(null,S)||void 0));const w=u.before(u.depth-(_-1));n.replace(w,u.after(-b),new V(C,4-_,0));let T=-1;n.doc.nodesBetween(w,n.doc.content.size,(E,R)=>{if(T>-1)return!1;E.isTextblock&&E.content.size===0&&(T=R+1)}),T>-1&&n.setSelection(Oe.near(n.doc.resolve(T))),n.scrollIntoView()}return!0}const h=l.pos===u.end()?f.contentMatchAt(0).defaultType:null,A={...Jg(p,f.type.name,f.attrs),...t},g={...Jg(p,u.node().type.name,u.node().attrs),...t};n.delete(u.pos,l.pos);const y=h?[{type:s,attrs:A},{type:h,attrs:g}]:[{type:s,attrs:A}];if(!zg(n.doc,u.pos,2))return!1;if(i){const{selection:C,storedMarks:_}=r,{splittableMarks:b}=o.extensionManager,v=_||C.$to.parentOffset&&C.$from.marks();if(n.split(u.pos,2,y).scrollIntoView(),!v||!i)return!0;const S=v.filter(w=>b.includes(w.type.name));n.ensureMarks(S)}return!0},HS=(e,t)=>{const n=pC(a=>a.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&mF(e.doc,n.pos)&&e.join(n.pos),!0},YS=(e,t)=>{const n=pC(a=>a.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&mF(e.doc,r)&&e.join(r),!0},XKe=(e,t,n,r={})=>({editor:i,tr:o,state:a,dispatch:s,chain:u,commands:l,can:c})=>{const{extensions:f,splittableMarks:p}=i.extensionManager,h=an(e,a.schema),A=an(t,a.schema),{selection:g,storedMarks:y}=a,{$from:C,$to:_}=g,b=C.blockRange(_),v=y||g.$to.parentOffset&&g.$from.marks();if(!b)return!1;const S=pC(w=>L2(w.type.name,f))(g);if(b.depth>=1&&S&&b.depth-S.depth<=1){if(S.node.type===h)return l.liftListItem(A);if(L2(S.node.type.name,f)&&h.validContent(S.node.content)&&s)return u().command(()=>(o.setNodeMarkup(S.pos,h),!0)).command(()=>HS(o,h)).command(()=>YS(o,h)).run()}return!n||!v||!s?u().command(()=>c().wrapInList(h,r)?!0:l.clearNodes()).wrapInList(h,r).command(()=>HS(o,h)).command(()=>YS(o,h)).run():u().command(()=>{const w=c().wrapInList(h,r),T=v.filter(E=>p.includes(E.type.name));return o.ensureMarks(T),w?!0:l.clearNodes()}).wrapInList(h,r).command(()=>HS(o,h)).command(()=>YS(o,h)).run()},e3e=(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,a=Ru(e,r.schema);return BKe(r,a,t)?i.unsetMark(a,{extendEmptyMarkRange:o}):i.setMark(a,t)},t3e=(e,t,n={})=>({state:r,commands:i})=>{const o=an(e,r.schema),a=an(t,r.schema),s=kd(r,o,n);let u;return r.selection.$anchor.sameParent(r.selection.$head)&&(u=r.selection.$anchor.parent.attrs),s?i.setNode(a,u):i.setNode(o,{...u,...n})},n3e=(e,t={})=>({state:n,commands:r})=>{const i=an(e,n.schema);return kd(n,i,t)?r.lift(i):r.wrapIn(i,t)},r3e=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(e))){if(t){const a=e.tr,s=o.transform;for(let u=s.steps.length-1;u>=0;u-=1)a.step(s.steps[u].invert(s.docs[u]));if(o.text){const u=a.doc.resolve(o.from).marks();a.replaceWith(o.from,o.to,e.schema.text(o.text,u))}else a.delete(o.from,o.to)}return!0}}return!1},i3e=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(o=>{e.removeMark(o.$from.pos,o.$to.pos)}),!0},o3e=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:a=!1}=t,{selection:s}=n,u=Ru(e,r.schema),{$from:l,empty:c,ranges:f}=s;if(!i)return!0;if(c&&a){let{from:p,to:h}=s;const A=(o=l.marks().find(y=>y.type===u))===null||o===void 0?void 0:o.attrs,g=_F(l,u,A);g&&(p=g.from,h=g.to),n.removeMark(p,h,u)}else f.forEach(p=>{n.removeMark(p.$from.pos,p.$to.pos,u)});return n.removeStoredMark(u),!0},a3e=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null;const s=oJ(typeof e=="string"?e:e.name,r.schema);return s?(s==="node"&&(o=an(e,r.schema)),s==="mark"&&(a=Ru(e,r.schema)),i&&n.selection.ranges.forEach(u=>{const l=u.$from.pos,c=u.$to.pos;let f,p,h,A;n.selection.empty?r.doc.nodesBetween(l,c,(g,y)=>{o&&o===g.type&&(h=Math.max(y,l),A=Math.min(y+g.nodeSize,c),f=y,p=g)}):r.doc.nodesBetween(l,c,(g,y)=>{y<l&&o&&o===g.type&&(h=Math.max(y,l),A=Math.min(y+g.nodeSize,c),f=y,p=g),y>=l&&y<=c&&(o&&o===g.type&&n.setNodeMarkup(y,void 0,{...g.attrs,...t}),a&&g.marks.length&&g.marks.forEach(C=>{if(a===C.type){const _=Math.max(y,l),b=Math.min(y+g.nodeSize,c);n.addMark(_,b,a.create({...C.attrs,...t}))}}))}),p&&(f!==void 0&&n.setNodeMarkup(f,void 0,{...p.attrs,...t}),a&&p.marks.length&&p.marks.forEach(g=>{a===g.type&&n.addMark(h,A,a.create({...g.attrs,...t}))}))}),!0):!1},s3e=(e,t={})=>({state:n,dispatch:r})=>{const i=an(e,n.schema);return CNe(i,t)(n,r)},u3e=(e,t={})=>({state:n,dispatch:r})=>{const i=an(e,n.schema);return SNe(i,t)(n,r)};var l3e=Object.freeze({__proto__:null,blur:qNe,clearContent:VNe,clearNodes:zNe,command:QNe,createParagraphNear:HNe,cut:YNe,deleteCurrentNode:GNe,deleteNode:JNe,deleteRange:ZNe,deleteSelection:XNe,enter:eKe,exitCode:tKe,extendMarkRange:nKe,first:rKe,focus:oKe,forEach:aKe,insertContent:sKe,insertContentAt:cKe,joinBackward:pKe,joinDown:fKe,joinForward:hKe,joinItemBackward:AKe,joinItemForward:mKe,joinTextblockBackward:gKe,joinTextblockForward:vKe,joinUp:dKe,keyboardShortcut:bKe,lift:CKe,liftEmptyBlock:SKe,liftListItem:wKe,newlineInCode:_Ke,resetAttributes:xKe,scrollIntoView:TKe,selectAll:IKe,selectNodeBackward:EKe,selectNodeForward:RKe,selectParentNode:$Ke,selectTextblockEnd:kKe,selectTextblockStart:OKe,setContent:FKe,setMark:VKe,setMeta:zKe,setNode:QKe,setNodeSelection:HKe,setTextSelection:YKe,sinkListItem:GKe,splitBlock:JKe,splitListItem:ZKe,toggleList:XKe,toggleMark:e3e,toggleNode:t3e,toggleWrap:n3e,undoInputRule:r3e,unsetAllMarks:i3e,unsetMark:o3e,updateAttributes:a3e,wrapIn:s3e,wrapInList:u3e});Fn.create({name:"commands",addCommands(){return{...l3e}}});Fn.create({name:"drop",addProseMirrorPlugins(){return[new Kn({key:new rr("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}});Fn.create({name:"editable",addProseMirrorPlugins(){return[new Kn({key:new rr("editable"),props:{editable:()=>this.editor.options.editable}})]}});Fn.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Kn({key:new rr("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}});Fn.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:s})=>{const{selection:u,doc:l}=s,{empty:c,$anchor:f}=u,{pos:p,parent:h}=f,A=f.parent.isTextblock&&p>0?s.doc.resolve(p-1):f,g=A.parent.type.spec.isolating,y=f.pos-f.parentOffset,C=g&&A.parent.childCount===1?y===f.pos:je.atStart(l).from===p;return!c||!h.type.isTextblock||h.textContent.length||!C||C&&f.parent.type.name==="paragraph"?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return fC()||iJ()?o:i},addProseMirrorPlugins(){return[new Kn({key:new rr("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(g=>g.getMeta("composition")))return;const r=e.some(g=>g.docChanged)&&!t.doc.eq(n.doc),i=e.some(g=>g.getMeta("preventClearDocument"));if(!r||i)return;const{empty:o,from:a,to:s}=t.selection,u=je.atStart(t.doc).from,l=je.atEnd(t.doc).to;if(o||!(a===u&&s===l)||!TF(n.doc))return;const p=n.tr,h=lC({state:n,transaction:p}),{commands:A}=new CF({editor:this.editor,state:h});if(A.clearNodes(),!!p.steps.length)return p}})]}});Fn.create({name:"paste",addProseMirrorPlugins(){return[new Kn({key:new rr("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}});Fn.create({name:"tabindex",addProseMirrorPlugins(){return[new Kn({key:new rr("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});function Hv(e){return new wF({find:e.find,handler:({state:t,range:n,match:r})=>{const i=We(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=t,a=r[r.length-1],s=r[0];if(a){const u=s.search(/\S/),l=n.from+s.indexOf(a),c=l+a.length;if(sJ(n.from,n.to,t.doc).filter(h=>h.mark.type.excluded.find(g=>g===e.type&&g!==h.mark.type)).filter(h=>h.to>l).length)return null;c<n.to&&o.delete(c,n.to),l>n.from&&o.delete(n.from+u,l);const p=n.from+u+a.length;o.addMark(n.from+u,p,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function T_(e){return new wF({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=We(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)}})}function Yv(e){return new wF({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{const o=We(e.getAttributes,void 0,r)||{},a=t.tr.delete(n.from,n.to),u=a.doc.resolve(n.from).blockRange(),l=u&&UWe(u,e.type,o);if(!l)return null;if(a.wrap(u,l),e.keepMarks&&e.editor){const{selection:f,storedMarks:p}=t,{splittableMarks:h}=e.editor.extensionManager,A=p||f.$to.parentOffset&&f.$from.marks();if(A){const g=A.filter(y=>h.includes(y.type.name));a.ensureMarks(g)}}if(e.keepAttributes){const f=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,o).run()}const c=a.doc.resolve(n.from-1).nodeBefore;c&&c.type===e.type&&mF(a.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,c))&&a.join(n.from-1)}})}class sn{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=We(de(this,"addOptions",{name:this.name}))),this.storage=We(de(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new sn(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>dC(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new sn(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=We(de(n,"addOptions",{name:n.name})),n.storage=We(de(n,"addStorage",{name:n.name,options:n.options})),n}}class c3e{constructor(t,n,r){this.isDragging=!1,this.component=t,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.innerDecorations=n.innerDecorations,this.view=n.view,this.HTMLAttributes=n.HTMLAttributes,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(t){var n,r,i,o,a,s,u;const{view:l}=this.editor,c=t.target,f=c.nodeType===3?(n=c.parentElement)===null||n===void 0?void 0:n.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||!((r=this.contentDOM)===null||r===void 0)&&r.contains(c)||!f)return;let p=0,h=0;if(this.dom!==f){const C=this.dom.getBoundingClientRect(),_=f.getBoundingClientRect(),b=(i=t.offsetX)!==null&&i!==void 0?i:(o=t.nativeEvent)===null||o===void 0?void 0:o.offsetX,v=(a=t.offsetY)!==null&&a!==void 0?a:(s=t.nativeEvent)===null||s===void 0?void 0:s.offsetY;p=_.x-C.x+b,h=_.y-C.y+v}(u=t.dataTransfer)===null||u===void 0||u.setDragImage(this.dom,p,h);const A=this.getPos();if(typeof A!="number")return;const g=xe.create(l.state.doc,A),y=l.state.tr.setSelection(g);l.dispatch(y)}stopEvent(t){var n;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:t});const r=t.target;if(!(this.dom.contains(r)&&!(!((n=this.contentDOM)===null||n===void 0)&&n.contains(r))))return!1;const o=t.type.startsWith("drag"),a=t.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!a&&!o)return!0;const{isEditable:u}=this.editor,{isDragging:l}=this,c=!!this.node.type.spec.draggable,f=xe.isSelectable(this.node),p=t.type==="copy",h=t.type==="paste",A=t.type==="cut",g=t.type==="mousedown";if(!c&&f&&o&&t.target===this.dom&&t.preventDefault(),c&&o&&!l&&t.target===this.dom)return t.preventDefault(),!1;if(c&&u&&!l&&g){const y=r.closest("[data-drag-handle]");y&&(this.dom===y||this.dom.contains(y))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(l||a||p||h||A||g&&f)}ignoreMutation(t){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:t}):this.node.isLeaf||this.node.isAtom?!0:t.type==="selection"||this.dom.contains(t.target)&&t.type==="childList"&&(fC()||nJ())&&this.editor.isFocused&&[...Array.from(t.addedNodes),...Array.from(t.removedNodes)].every(r=>r.isContentEditable)?!1:this.contentDOM===t.target&&t.type==="attributes"?!0:!this.contentDOM.contains(t.target)}updateAttributes(t){this.editor.commands.command(({tr:n})=>{const r=this.getPos();return typeof r!="number"?!1:(n.setNodeMarkup(r,void 0,{...this.node.attrs,...t}),!0)})}deleteNode(){const t=this.getPos();if(typeof t!="number")return;const n=t+this.node.nodeSize;this.editor.commands.deleteRange({from:t,to:n})}}function Gv(e){return new LNe({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{const o=We(e.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:a}=t,s=r[r.length-1],u=r[0];let l=n.to;if(s){const c=u.search(/\S/),f=n.from+u.indexOf(s),p=f+s.length;if(sJ(n.from,n.to,t.doc).filter(A=>A.mark.type.excluded.find(y=>y===e.type&&y!==A.mark.type)).filter(A=>A.to>f).length)return null;p<n.to&&a.delete(p,n.to),f>n.from&&a.delete(n.from+c,f),l=n.from+c+s.length,a.addMark(n.from+c,l,e.type.create(o||{})),a.removeStoredMark(e.type)}}})}function d3e(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var Jv=200,hn=function(){};hn.prototype.append=function(t){return t.length?(t=hn.from(t),!this.length&&t||t.length<Jv&&this.leafAppend(t)||this.length<Jv&&t.leafPrepend(this)||this.appendInner(t)):this};hn.prototype.prepend=function(t){return t.length?hn.from(t).append(this):this};hn.prototype.appendInner=function(t){return new f3e(this,t)};hn.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?hn.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};hn.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};hn.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)};hn.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,a){return i.push(t(o,a))},n,r),i};hn.from=function(t){return t instanceof hn?t:t&&t.length?new uJ(t):hn.empty};var uJ=function(e){function t(r){e.call(this),this.values=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new t(this.values.slice(i,o))},t.prototype.getInner=function(i){return this.values[i]},t.prototype.forEachInner=function(i,o,a,s){for(var u=o;u<a;u++)if(i(this.values[u],s+u)===!1)return!1},t.prototype.forEachInvertedInner=function(i,o,a,s){for(var u=o-1;u>=a;u--)if(i(this.values[u],s+u)===!1)return!1},t.prototype.leafAppend=function(i){if(this.length+i.length<=Jv)return new t(this.values.concat(i.flatten()))},t.prototype.leafPrepend=function(i){if(this.length+i.length<=Jv)return new t(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(hn);hn.empty=new uJ([]);var f3e=function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,i,o,a){var s=this.left.length;if(i<s&&this.left.forEachInner(r,i,Math.min(o,s),a)===!1||o>s&&this.right.forEachInner(r,Math.max(i-s,0),Math.min(this.length,o)-s,a+s)===!1)return!1},t.prototype.forEachInvertedInner=function(r,i,o,a){var s=this.left.length;if(i>s&&this.right.forEachInvertedInner(r,i-s,Math.max(o,s)-s,a+s)===!1||o<s&&this.left.forEachInvertedInner(r,Math.min(i,s),o,a)===!1)return!1},t.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},t.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new t(i,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t}(hn);const p3e=500;class qi{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let a=t.tr,s,u,l=[],c=[];return this.items.forEach((f,p)=>{if(!f.step){i||(i=this.remapping(r,p+1),o=i.maps.length),o--,c.push(f);return}if(i){c.push(new wo(f.map));let h=f.step.map(i.slice(o)),A;h&&a.maybeStep(h).doc&&(A=a.mapping.maps[a.mapping.maps.length-1],l.push(new wo(A,void 0,void 0,l.length+c.length))),o--,A&&i.appendMap(A,o)}else a.maybeStep(f.step);if(f.selection)return s=i?f.selection.map(i.slice(o)):f.selection,u=new qi(this.items.slice(0,r).append(c.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:a,selection:s}}addTransform(t,n,r,i){let o=[],a=this.eventCount,s=this.items,u=!i&&s.length?s.get(s.length-1):null;for(let c=0;c<t.steps.length;c++){let f=t.steps[c].invert(t.docs[c]),p=new wo(t.mapping.maps[c],f,n),h;(h=u&&u.merge(p))&&(p=h,c?o.pop():s=s.slice(0,s.length-1)),o.push(p),n&&(a++,n=void 0),i||(u=p)}let l=a-r.depth;return l>A3e&&(s=h3e(s,l),a-=l),new qi(s.append(o),a)}remapping(t,n){let r=new RPe;return this.items.forEach((i,o)=>{let a=i.mirrorOffset!=null&&o-i.mirrorOffset>=t?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},t,n),r}addMaps(t){return this.eventCount==0?this:new qi(this.items.append(t.map(n=>new wo(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=t.mapping,a=t.steps.length,s=this.eventCount;this.items.forEach(p=>{p.selection&&s--},i);let u=n;this.items.forEach(p=>{let h=o.getMirror(--u);if(h==null)return;a=Math.min(a,h);let A=o.maps[h];if(p.step){let g=t.steps[h].invert(t.docs[h]),y=p.selection&&p.selection.map(o.slice(u+1,h));y&&s++,r.push(new wo(A,g,y))}else r.push(new wo(A))},i);let l=[];for(let p=n;p<a;p++)l.push(new wo(o.maps[p]));let c=this.items.slice(0,i).append(l).append(r),f=new qi(c,s);return f.emptyItemCount()>p3e&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],o=0;return this.items.forEach((a,s)=>{if(s>=t)i.push(a),a.selection&&o++;else if(a.step){let u=a.step.map(n.slice(r)),l=u&&u.getMap();if(r--,l&&n.appendMap(l,r),u){let c=a.selection&&a.selection.map(n.slice(r));c&&o++;let f=new wo(l.invert(),u,c),p,h=i.length-1;(p=i.length&&i[h].merge(f))?i[h]=p:i.push(f)}}else a.map&&r--},this.items.length,0),new qi(hn.from(i.reverse()),o)}}qi.empty=new qi(hn.empty,0);function h3e(e,t){let n;return e.forEach((r,i)=>{if(r.selection&&t--==0)return n=i,!1}),e.slice(n)}class wo{constructor(t,n,r,i){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=i}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new wo(n.getMap().invert(),n,this.selection)}}}class bs{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const A3e=20;function m3e(e,t,n,r){let i=n.getMeta(il),o;if(i)return i.historyState;n.getMeta(y3e)&&(e=new bs(e.done,e.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(a&&a.getMeta(il))return a.getMeta(il).redo?new bs(e.done.addTransform(n,void 0,r,Zg(t)),e.undone,U2(n.mapping.maps),e.prevTime,e.prevComposition):new bs(e.done,e.undone.addTransform(n,void 0,r,Zg(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let s=n.getMeta("composition"),u=e.prevTime==0||!a&&e.prevComposition!=s&&(e.prevTime<(n.time||0)-r.newGroupDelay||!g3e(n,e.prevRanges)),l=a?GS(e.prevRanges,n.mapping):U2(n.mapping.maps);return new bs(e.done.addTransform(n,u?t.selection.getBookmark():void 0,r,Zg(t)),qi.empty,l,n.time,s??e.prevComposition)}else return(o=n.getMeta("rebased"))?new bs(e.done.rebased(n,o),e.undone.rebased(n,o),GS(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new bs(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),GS(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function g3e(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<t.length;o+=2)r<=t[o+1]&&i>=t[o]&&(n=!0)}),n}function U2(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((r,i,o,a)=>t.push(o,a));return t}function GS(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}function v3e(e,t,n){let r=Zg(t),i=il.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;let a=o.selection.resolve(o.transform.doc),s=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,r),u=new bs(n?s:o.remaining,n?o.remaining:s,null,0,-1);return o.transform.setSelection(a).setMeta(il,{redo:n,historyState:u})}let JS=!1,B2=null;function Zg(e){let t=e.plugins;if(B2!=t){JS=!1,B2=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){JS=!0;break}}return JS}const il=new rr("history"),y3e=new rr("closeHistory");function b3e(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Kn({key:il,state:{init(){return new bs(qi.empty,qi.empty,null,0,-1)},apply(t,n,r){return m3e(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,i=r=="historyUndo"?cJ:r=="historyRedo"?dJ:null;return i?(n.preventDefault(),i(t.state,t.dispatch)):!1}}}})}function lJ(e,t){return(n,r)=>{let i=il.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let o=v3e(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}const cJ=lJ(!1,!0),dJ=lJ(!0,!0),C3e=Fn.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>cJ(e,t),redo:()=>({state:e,dispatch:t})=>dJ(e,t)}},addProseMirrorPlugins(){return[b3e(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),hC=(e,t)=>{const{$from:n}=t.selection,r=an(e,t.schema);let i=null,o=n.depth,a=n.pos,s=null;for(;o>0&&s===null;)i=n.node(o),i.type===r?s=o:(o-=1,a-=1);return s===null?null:{$pos:t.doc.resolve(a),depth:s}},fJ=(e,t)=>{const n=hC(e,t);if(!n)return!1;const[,r]=UKe(t,e,n.$pos.pos+4);return r},S3e=(e,t,n)=>{const{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),o=e.doc.resolve(i).node();return!(!o||!n.includes(o.type.name))},w3e=(e,t)=>{var n;const{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-2);return!(i.index()===0||((n=i.nodeBefore)===null||n===void 0?void 0:n.type.name)!==e)},_3e=(e,t,n)=>{if(!n)return!1;const r=an(e,t.schema);let i=!1;return n.descendants(o=>{o.type===r&&(i=!0)}),i},P2=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!kd(e.state,t)&&S3e(e.state,t,n)){const{$anchor:s}=e.state.selection,u=e.state.doc.resolve(s.before()-1),l=[];u.node().descendants((p,h)=>{p.type.name===t&&l.push({node:p,pos:h})});const c=l.at(-1);if(!c)return!1;const f=e.state.doc.resolve(u.start()+c.pos+1);return e.chain().cut({from:s.start()-1,to:s.end()+1},f.end()).joinForward().run()}if(!kd(e.state,t)||!WKe(e.state))return!1;const r=hC(t,e.state);if(!r)return!1;const o=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),a=_3e(t,e.state,o);return w3e(t,e.state)&&!a?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},x3e=(e,t)=>{const n=fJ(e,t),r=hC(e,t);return!r||!n?!1:n>r.depth},T3e=(e,t)=>{const n=fJ(e,t),r=hC(e,t);return!r||!n?!1:n<r.depth},W2=(e,t)=>{if(!kd(e.state,t)||!PKe(e.state,t))return!1;const{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:x3e(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():T3e(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},I3e=Fn.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&W2(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&W2(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&P2(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&P2(e,n,r)&&(t=!0)}),t}}}});var kr="top",Ii="bottom",Ei="right",Or="left",IF="auto",Xm=[kr,Ii,Ei,Or],Od="start",Nh="end",E3e="clippingParents",pJ="viewport",Sp="popper",R3e="reference",N2=Xm.reduce(function(e,t){return e.concat([t+"-"+Od,t+"-"+Nh])},[]),hJ=[].concat(Xm,[IF]).reduce(function(e,t){return e.concat([t,t+"-"+Od,t+"-"+Nh])},[]),$3e="beforeRead",k3e="read",O3e="afterRead",M3e="beforeMain",F3e="main",j3e="afterMain",L3e="beforeWrite",D3e="write",U3e="afterWrite",B3e=[$3e,k3e,O3e,M3e,F3e,j3e,L3e,D3e,U3e];function Uo(e){return e?(e.nodeName||"").toLowerCase():null}function si(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Il(e){var t=si(e).Element;return e instanceof t||e instanceof Element}function Ti(e){var t=si(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function EF(e){if(typeof ShadowRoot>"u")return!1;var t=si(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function P3e(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!Ti(o)||!Uo(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function W3e(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=a.reduce(function(u,l){return u[l]="",u},{});!Ti(i)||!Uo(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(u){i.removeAttribute(u)}))})}}const AJ={name:"applyStyles",enabled:!0,phase:"write",fn:P3e,effect:W3e,requires:["computeStyles"]};function Eo(e){return e.split("-")[0]}var ol=Math.max,Zv=Math.min,Md=Math.round;function I_(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function mJ(){return!/^((?!chrome|android).)*safari/i.test(I_())}function Fd(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&Ti(e)&&(i=e.offsetWidth>0&&Md(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Md(r.height)/e.offsetHeight||1);var a=Il(e)?si(e):window,s=a.visualViewport,u=!mJ()&&n,l=(r.left+(u&&s?s.offsetLeft:0))/i,c=(r.top+(u&&s?s.offsetTop:0))/o,f=r.width/i,p=r.height/o;return{width:f,height:p,top:c,right:l+f,bottom:c+p,left:l,x:l,y:c}}function RF(e){var t=Fd(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function gJ(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&EF(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Ta(e){return si(e).getComputedStyle(e)}function N3e(e){return["table","td","th"].indexOf(Uo(e))>=0}function $u(e){return((Il(e)?e.ownerDocument:e.document)||window.document).documentElement}function AC(e){return Uo(e)==="html"?e:e.assignedSlot||e.parentNode||(EF(e)?e.host:null)||$u(e)}function K2(e){return!Ti(e)||Ta(e).position==="fixed"?null:e.offsetParent}function K3e(e){var t=/firefox/i.test(I_()),n=/Trident/i.test(I_());if(n&&Ti(e)){var r=Ta(e);if(r.position==="fixed")return null}var i=AC(e);for(EF(i)&&(i=i.host);Ti(i)&&["html","body"].indexOf(Uo(i))<0;){var o=Ta(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function eg(e){for(var t=si(e),n=K2(e);n&&N3e(n)&&Ta(n).position==="static";)n=K2(n);return n&&(Uo(n)==="html"||Uo(n)==="body"&&Ta(n).position==="static")?t:n||K3e(e)||t}function $F(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Yp(e,t,n){return ol(e,Zv(t,n))}function q3e(e,t,n){var r=Yp(e,t,n);return r>n?n:r}function vJ(){return{top:0,right:0,bottom:0,left:0}}function yJ(e){return Object.assign({},vJ(),e)}function bJ(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var V3e=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,yJ(typeof t!="number"?t:bJ(t,Xm))};function z3e(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Eo(n.placement),u=$F(s),l=[Or,Ei].indexOf(s)>=0,c=l?"height":"width";if(!(!o||!a)){var f=V3e(i.padding,n),p=RF(o),h=u==="y"?kr:Or,A=u==="y"?Ii:Ei,g=n.rects.reference[c]+n.rects.reference[u]-a[u]-n.rects.popper[c],y=a[u]-n.rects.reference[u],C=eg(o),_=C?u==="y"?C.clientHeight||0:C.clientWidth||0:0,b=g/2-y/2,v=f[h],S=_-p[c]-f[A],w=_/2-p[c]/2+b,T=Yp(v,w,S),E=u;n.modifiersData[r]=(t={},t[E]=T,t.centerOffset=T-w,t)}}function Q3e(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||gJ(t.elements.popper,i)&&(t.elements.arrow=i))}const H3e={name:"arrow",enabled:!0,phase:"main",fn:z3e,effect:Q3e,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function jd(e){return e.split("-")[1]}var Y3e={top:"auto",right:"auto",bottom:"auto",left:"auto"};function G3e(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:Md(n*i)/i||0,y:Md(r*i)/i||0}}function q2(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,u=e.gpuAcceleration,l=e.adaptive,c=e.roundOffsets,f=e.isFixed,p=a.x,h=p===void 0?0:p,A=a.y,g=A===void 0?0:A,y=typeof c=="function"?c({x:h,y:g}):{x:h,y:g};h=y.x,g=y.y;var C=a.hasOwnProperty("x"),_=a.hasOwnProperty("y"),b=Or,v=kr,S=window;if(l){var w=eg(n),T="clientHeight",E="clientWidth";if(w===si(n)&&(w=$u(n),Ta(w).position!=="static"&&s==="absolute"&&(T="scrollHeight",E="scrollWidth")),w=w,i===kr||(i===Or||i===Ei)&&o===Nh){v=Ii;var R=f&&w===S&&S.visualViewport?S.visualViewport.height:w[T];g-=R-r.height,g*=u?1:-1}if(i===Or||(i===kr||i===Ii)&&o===Nh){b=Ei;var O=f&&w===S&&S.visualViewport?S.visualViewport.width:w[E];h-=O-r.width,h*=u?1:-1}}var $=Object.assign({position:s},l&&Y3e),B=c===!0?G3e({x:h,y:g},si(n)):{x:h,y:g};if(h=B.x,g=B.y,u){var K;return Object.assign({},$,(K={},K[v]=_?"0":"",K[b]=C?"0":"",K.transform=(S.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",K))}return Object.assign({},$,(t={},t[v]=_?g+"px":"",t[b]=C?h+"px":"",t.transform="",t))}function J3e(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,s=n.roundOffsets,u=s===void 0?!0:s,l={placement:Eo(t.placement),variation:jd(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,q2(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,q2(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Z3e={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:J3e,data:{}};var Rg={passive:!0};function X3e(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,u=si(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&l.forEach(function(c){c.addEventListener("scroll",n.update,Rg)}),s&&u.addEventListener("resize",n.update,Rg),function(){o&&l.forEach(function(c){c.removeEventListener("scroll",n.update,Rg)}),s&&u.removeEventListener("resize",n.update,Rg)}}const e5e={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:X3e,data:{}};var t5e={left:"right",right:"left",bottom:"top",top:"bottom"};function Xg(e){return e.replace(/left|right|bottom|top/g,function(t){return t5e[t]})}var n5e={start:"end",end:"start"};function V2(e){return e.replace(/start|end/g,function(t){return n5e[t]})}function kF(e){var t=si(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function OF(e){return Fd($u(e)).left+kF(e).scrollLeft}function r5e(e,t){var n=si(e),r=$u(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,u=0;if(i){o=i.width,a=i.height;var l=mJ();(l||!l&&t==="fixed")&&(s=i.offsetLeft,u=i.offsetTop)}return{width:o,height:a,x:s+OF(e),y:u}}function i5e(e){var t,n=$u(e),r=kF(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=ol(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=ol(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+OF(e),u=-r.scrollTop;return Ta(i||n).direction==="rtl"&&(s+=ol(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:u}}function MF(e){var t=Ta(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function CJ(e){return["html","body","#document"].indexOf(Uo(e))>=0?e.ownerDocument.body:Ti(e)&&MF(e)?e:CJ(AC(e))}function Gp(e,t){var n;t===void 0&&(t=[]);var r=CJ(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=si(r),a=i?[o].concat(o.visualViewport||[],MF(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(Gp(AC(a)))}function E_(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function o5e(e,t){var n=Fd(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function z2(e,t,n){return t===pJ?E_(r5e(e,n)):Il(t)?o5e(t,n):E_(i5e($u(e)))}function a5e(e){var t=Gp(AC(e)),n=["absolute","fixed"].indexOf(Ta(e).position)>=0,r=n&&Ti(e)?eg(e):e;return Il(r)?t.filter(function(i){return Il(i)&&gJ(i,r)&&Uo(i)!=="body"}):[]}function s5e(e,t,n,r){var i=t==="clippingParents"?a5e(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(u,l){var c=z2(e,l,r);return u.top=ol(c.top,u.top),u.right=Zv(c.right,u.right),u.bottom=Zv(c.bottom,u.bottom),u.left=ol(c.left,u.left),u},z2(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function SJ(e){var t=e.reference,n=e.element,r=e.placement,i=r?Eo(r):null,o=r?jd(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,u;switch(i){case kr:u={x:a,y:t.y-n.height};break;case Ii:u={x:a,y:t.y+t.height};break;case Ei:u={x:t.x+t.width,y:s};break;case Or:u={x:t.x-n.width,y:s};break;default:u={x:t.x,y:t.y}}var l=i?$F(i):null;if(l!=null){var c=l==="y"?"height":"width";switch(o){case Od:u[l]=u[l]-(t[c]/2-n[c]/2);break;case Nh:u[l]=u[l]+(t[c]/2-n[c]/2);break}}return u}function Kh(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,s=n.boundary,u=s===void 0?E3e:s,l=n.rootBoundary,c=l===void 0?pJ:l,f=n.elementContext,p=f===void 0?Sp:f,h=n.altBoundary,A=h===void 0?!1:h,g=n.padding,y=g===void 0?0:g,C=yJ(typeof y!="number"?y:bJ(y,Xm)),_=p===Sp?R3e:Sp,b=e.rects.popper,v=e.elements[A?_:p],S=s5e(Il(v)?v:v.contextElement||$u(e.elements.popper),u,c,a),w=Fd(e.elements.reference),T=SJ({reference:w,element:b,strategy:"absolute",placement:i}),E=E_(Object.assign({},b,T)),R=p===Sp?E:w,O={top:S.top-R.top+C.top,bottom:R.bottom-S.bottom+C.bottom,left:S.left-R.left+C.left,right:R.right-S.right+C.right},$=e.modifiersData.offset;if(p===Sp&&$){var B=$[i];Object.keys(O).forEach(function(K){var H=[Ei,Ii].indexOf(K)>=0?1:-1,z=[kr,Ii].indexOf(K)>=0?"y":"x";O[K]+=B[z]*H})}return O}function u5e(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,u=n.allowedAutoPlacements,l=u===void 0?hJ:u,c=jd(r),f=c?s?N2:N2.filter(function(A){return jd(A)===c}):Xm,p=f.filter(function(A){return l.indexOf(A)>=0});p.length===0&&(p=f);var h=p.reduce(function(A,g){return A[g]=Kh(e,{placement:g,boundary:i,rootBoundary:o,padding:a})[Eo(g)],A},{});return Object.keys(h).sort(function(A,g){return h[A]-h[g]})}function l5e(e){if(Eo(e)===IF)return[];var t=Xg(e);return[V2(e),t,V2(t)]}function c5e(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!0:a,u=n.fallbackPlacements,l=n.padding,c=n.boundary,f=n.rootBoundary,p=n.altBoundary,h=n.flipVariations,A=h===void 0?!0:h,g=n.allowedAutoPlacements,y=t.options.placement,C=Eo(y),_=C===y,b=u||(_||!A?[Xg(y)]:l5e(y)),v=[y].concat(b).reduce(function(Ce,P){return Ce.concat(Eo(P)===IF?u5e(t,{placement:P,boundary:c,rootBoundary:f,padding:l,flipVariations:A,allowedAutoPlacements:g}):P)},[]),S=t.rects.reference,w=t.rects.popper,T=new Map,E=!0,R=v[0],O=0;O<v.length;O++){var $=v[O],B=Eo($),K=jd($)===Od,H=[kr,Ii].indexOf(B)>=0,z=H?"width":"height",N=Kh(t,{placement:$,boundary:c,rootBoundary:f,altBoundary:p,padding:l}),Y=H?K?Ei:Or:K?Ii:kr;S[z]>w[z]&&(Y=Xg(Y));var ee=Xg(Y),F=[];if(o&&F.push(N[B]<=0),s&&F.push(N[Y]<=0,N[ee]<=0),F.every(function(Ce){return Ce})){R=$,E=!1;break}T.set($,F)}if(E)for(var M=A?3:1,W=function(P){var ae=v.find(function(Ge){var ve=T.get(Ge);if(ve)return ve.slice(0,P).every(function(De){return De})});if(ae)return R=ae,"break"},re=M;re>0;re--){var Ie=W(re);if(Ie==="break")break}t.placement!==R&&(t.modifiersData[r]._skip=!0,t.placement=R,t.reset=!0)}}const d5e={name:"flip",enabled:!0,phase:"main",fn:c5e,requiresIfExists:["offset"],data:{_skip:!1}};function Q2(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function H2(e){return[kr,Ei,Ii,Or].some(function(t){return e[t]>=0})}function f5e(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=Kh(t,{elementContext:"reference"}),s=Kh(t,{altBoundary:!0}),u=Q2(a,r),l=Q2(s,i,o),c=H2(u),f=H2(l);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:l,isReferenceHidden:c,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":f})}const p5e={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:f5e};function h5e(e,t,n){var r=Eo(e),i=[Or,kr].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[Or,Ei].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function A5e(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=hJ.reduce(function(c,f){return c[f]=h5e(f,t.rects,o),c},{}),s=a[t.placement],u=s.x,l=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=a}const m5e={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:A5e};function g5e(e){var t=e.state,n=e.name;t.modifiersData[n]=SJ({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const v5e={name:"popperOffsets",enabled:!0,phase:"read",fn:g5e,data:{}};function y5e(e){return e==="x"?"y":"x"}function b5e(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!1:a,u=n.boundary,l=n.rootBoundary,c=n.altBoundary,f=n.padding,p=n.tether,h=p===void 0?!0:p,A=n.tetherOffset,g=A===void 0?0:A,y=Kh(t,{boundary:u,rootBoundary:l,padding:f,altBoundary:c}),C=Eo(t.placement),_=jd(t.placement),b=!_,v=$F(C),S=y5e(v),w=t.modifiersData.popperOffsets,T=t.rects.reference,E=t.rects.popper,R=typeof g=="function"?g(Object.assign({},t.rects,{placement:t.placement})):g,O=typeof R=="number"?{mainAxis:R,altAxis:R}:Object.assign({mainAxis:0,altAxis:0},R),$=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,B={x:0,y:0};if(w){if(o){var K,H=v==="y"?kr:Or,z=v==="y"?Ii:Ei,N=v==="y"?"height":"width",Y=w[v],ee=Y+y[H],F=Y-y[z],M=h?-E[N]/2:0,W=_===Od?T[N]:E[N],re=_===Od?-E[N]:-T[N],Ie=t.elements.arrow,Ce=h&&Ie?RF(Ie):{width:0,height:0},P=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:vJ(),ae=P[H],Ge=P[z],ve=Yp(0,T[N],Ce[N]),De=b?T[N]/2-M-ve-ae-O.mainAxis:W-ve-ae-O.mainAxis,mt=b?-T[N]/2+M+ve+Ge+O.mainAxis:re+ve+Ge+O.mainAxis,rn=t.elements.arrow&&eg(t.elements.arrow),Ht=rn?v==="y"?rn.clientTop||0:rn.clientLeft||0:0,_e=(K=$==null?void 0:$[v])!=null?K:0,Ze=Y+De-_e-Ht,pt=Y+mt-_e,tt=Yp(h?Zv(ee,Ze):ee,Y,h?ol(F,pt):F);w[v]=tt,B[v]=tt-Y}if(s){var lt,Yt=v==="x"?kr:Or,Sn=v==="x"?Ii:Ei,Gt=w[S],It=S==="y"?"height":"width",_r=Gt+y[Yt],Bt=Gt-y[Sn],Jt=[kr,Or].indexOf(C)!==-1,on=(lt=$==null?void 0:$[S])!=null?lt:0,xr=Jt?_r:Gt-T[It]-E[It]-on+O.altAxis,Tr=Jt?Gt+T[It]+E[It]-on-O.altAxis:Bt,Me=h&&Jt?q3e(xr,Gt,Tr):Yp(h?xr:_r,Gt,h?Tr:Bt);w[S]=Me,B[S]=Me-Gt}t.modifiersData[r]=B}}const C5e={name:"preventOverflow",enabled:!0,phase:"main",fn:b5e,requiresIfExists:["offset"]};function S5e(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function w5e(e){return e===si(e)||!Ti(e)?kF(e):S5e(e)}function _5e(e){var t=e.getBoundingClientRect(),n=Md(t.width)/e.offsetWidth||1,r=Md(t.height)/e.offsetHeight||1;return n!==1||r!==1}function x5e(e,t,n){n===void 0&&(n=!1);var r=Ti(t),i=Ti(t)&&_5e(t),o=$u(t),a=Fd(e,i,n),s={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((Uo(t)!=="body"||MF(o))&&(s=w5e(t)),Ti(t)?(u=Fd(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):o&&(u.x=OF(o))),{x:a.left+s.scrollLeft-u.x,y:a.top+s.scrollTop-u.y,width:a.width,height:a.height}}function T5e(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var u=t.get(s);u&&i(u)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function I5e(e){var t=T5e(e);return B3e.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function E5e(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function R5e(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Y2={placement:"bottom",modifiers:[],strategy:"absolute"};function G2(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function $5e(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,o=i===void 0?Y2:i;return function(s,u,l){l===void 0&&(l=o);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},Y2,o),modifiersData:{},elements:{reference:s,popper:u},attributes:{},styles:{}},f=[],p=!1,h={state:c,setOptions:function(C){var _=typeof C=="function"?C(c.options):C;g(),c.options=Object.assign({},o,c.options,_),c.scrollParents={reference:Il(s)?Gp(s):s.contextElement?Gp(s.contextElement):[],popper:Gp(u)};var b=I5e(R5e([].concat(r,c.options.modifiers)));return c.orderedModifiers=b.filter(function(v){return v.enabled}),A(),h.update()},forceUpdate:function(){if(!p){var C=c.elements,_=C.reference,b=C.popper;if(G2(_,b)){c.rects={reference:x5e(_,eg(b),c.options.strategy==="fixed"),popper:RF(b)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(O){return c.modifiersData[O.name]=Object.assign({},O.data)});for(var v=0;v<c.orderedModifiers.length;v++){if(c.reset===!0){c.reset=!1,v=-1;continue}var S=c.orderedModifiers[v],w=S.fn,T=S.options,E=T===void 0?{}:T,R=S.name;typeof w=="function"&&(c=w({state:c,options:E,name:R,instance:h})||c)}}}},update:E5e(function(){return new Promise(function(y){h.forceUpdate(),y(c)})}),destroy:function(){g(),p=!0}};if(!G2(s,u))return h;h.setOptions(l).then(function(y){!p&&l.onFirstUpdate&&l.onFirstUpdate(y)});function A(){c.orderedModifiers.forEach(function(y){var C=y.name,_=y.options,b=_===void 0?{}:_,v=y.effect;if(typeof v=="function"){var S=v({state:c,name:C,instance:h,options:b}),w=function(){};f.push(S||w)}})}function g(){f.forEach(function(y){return y()}),f=[]}return h}}var k5e=[e5e,v5e,Z3e,AJ,m5e,d5e,C5e,H3e,p5e],O5e=$5e({defaultModifiers:k5e}),M5e="tippy-box",wJ="tippy-content",F5e="tippy-backdrop",_J="tippy-arrow",xJ="tippy-svg-arrow",Pu={passive:!0,capture:!0},TJ=function(){return document.body};function j5e(e,t){return{}.hasOwnProperty.call(e,t)}function ZS(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function FF(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function IJ(e,t){return typeof e=="function"?e.apply(void 0,t):e}function J2(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function L5e(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function D5e(e){return e.split(/\s+/).filter(Boolean)}function Jc(e){return[].concat(e)}function Z2(e,t){e.indexOf(t)===-1&&e.push(t)}function U5e(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function B5e(e){return e.split("-")[0]}function Xv(e){return[].slice.call(e)}function X2(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function Jp(){return document.createElement("div")}function qh(e){return["Element","Fragment"].some(function(t){return FF(e,t)})}function P5e(e){return FF(e,"NodeList")}function W5e(e){return FF(e,"MouseEvent")}function N5e(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function K5e(e){return qh(e)?[e]:P5e(e)?Xv(e):Array.isArray(e)?e:Xv(document.querySelectorAll(e))}function XS(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function eD(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function q5e(e){var t,n=Jc(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function V5e(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,a=i.popperState,s=i.props,u=s.interactiveBorder,l=B5e(a.placement),c=a.modifiersData.offset;if(!c)return!0;var f=l==="bottom"?c.top.y:0,p=l==="top"?c.bottom.y:0,h=l==="right"?c.left.x:0,A=l==="left"?c.right.x:0,g=o.top-r+f>u,y=r-o.bottom-p>u,C=o.left-n+h>u,_=n-o.right-A>u;return g||y||C||_})}function ew(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function tD(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var _o={isTouch:!1},nD=0;function z5e(){_o.isTouch||(_o.isTouch=!0,window.performance&&document.addEventListener("mousemove",EJ))}function EJ(){var e=performance.now();e-nD<20&&(_o.isTouch=!1,document.removeEventListener("mousemove",EJ)),nD=e}function Q5e(){var e=document.activeElement;if(N5e(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function H5e(){document.addEventListener("touchstart",z5e,Pu),window.addEventListener("blur",Q5e)}var Y5e=typeof window<"u"&&typeof document<"u",G5e=Y5e?!!window.msCrypto:!1;function Pc(e){var t=e==="destroy"?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function rD(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function J5e(e){return rD(`
|
|
81
|
+
%ctippy.js
|
|
82
|
+
|
|
83
|
+
%c`+rD(e)+`
|
|
84
|
+
|
|
85
|
+
%c👷 This is a development-only message. It will be removed in production.
|
|
86
|
+
`)}function RJ(e){return[J5e(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var Vh;process.env.NODE_ENV!=="production"&&Z5e();function Z5e(){Vh=new Set}function Aa(e,t){if(e&&!Vh.has(t)){var n;Vh.add(t),(n=console).warn.apply(n,RJ(t))}}function R_(e,t){if(e&&!Vh.has(t)){var n;Vh.add(t),(n=console).error.apply(n,RJ(t))}}function X5e(e){var t=!e,n=Object.prototype.toString.call(e)==="[object Object]"&&!e.addEventListener;R_(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),R_(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var $J={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},e6e={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Jr=Object.assign({appendTo:TJ,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},$J,e6e),t6e=Object.keys(Jr),n6e=function(t){process.env.NODE_ENV!=="production"&&OJ(t,[]);var n=Object.keys(t);n.forEach(function(r){Jr[r]=t[r]})};function kJ(e){var t=e.plugins||[],n=t.reduce(function(r,i){var o=i.name,a=i.defaultValue;if(o){var s;r[o]=e[o]!==void 0?e[o]:(s=Jr[o])!=null?s:a}return r},{});return Object.assign({},e,n)}function r6e(e,t){var n=t?Object.keys(kJ(Object.assign({},Jr,{plugins:t}))):t6e,r=n.reduce(function(i,o){var a=(e.getAttribute("data-tippy-"+o)||"").trim();if(!a)return i;if(o==="content")i[o]=a;else try{i[o]=JSON.parse(a)}catch{i[o]=a}return i},{});return r}function iD(e,t){var n=Object.assign({},t,{content:IJ(t.content,[e])},t.ignoreAttributes?{}:r6e(e,t.plugins));return n.aria=Object.assign({},Jr.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}function OJ(e,t){e===void 0&&(e={}),t===void 0&&(t=[]);var n=Object.keys(e);n.forEach(function(r){var i=L5e(Jr,Object.keys($J)),o=!j5e(i,r);o&&(o=t.filter(function(a){return a.name===r}).length===0),Aa(o,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
|
|
87
|
+
|
|
88
|
+
`,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
|
|
89
|
+
`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var i6e=function(){return"innerHTML"};function $_(e,t){e[i6e()]=t}function oD(e){var t=Jp();return e===!0?t.className=_J:(t.className=xJ,qh(e)?t.appendChild(e):$_(t,e)),t}function aD(e,t){qh(t.content)?($_(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?$_(e,t.content):e.textContent=t.content)}function k_(e){var t=e.firstElementChild,n=Xv(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(wJ)}),arrow:n.find(function(r){return r.classList.contains(_J)||r.classList.contains(xJ)}),backdrop:n.find(function(r){return r.classList.contains(F5e)})}}function MJ(e){var t=Jp(),n=Jp();n.className=M5e,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Jp();r.className=wJ,r.setAttribute("data-state","hidden"),aD(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props);function i(o,a){var s=k_(t),u=s.box,l=s.content,c=s.arrow;a.theme?u.setAttribute("data-theme",a.theme):u.removeAttribute("data-theme"),typeof a.animation=="string"?u.setAttribute("data-animation",a.animation):u.removeAttribute("data-animation"),a.inertia?u.setAttribute("data-inertia",""):u.removeAttribute("data-inertia"),u.style.maxWidth=typeof a.maxWidth=="number"?a.maxWidth+"px":a.maxWidth,a.role?u.setAttribute("role",a.role):u.removeAttribute("role"),(o.content!==a.content||o.allowHTML!==a.allowHTML)&&aD(l,e.props),a.arrow?c?o.arrow!==a.arrow&&(u.removeChild(c),u.appendChild(oD(a.arrow))):u.appendChild(oD(a.arrow)):c&&u.removeChild(c)}return{popper:t,onUpdate:i}}MJ.$$tippy=!0;var o6e=1,$g=[],tw=[];function a6e(e,t){var n=iD(e,Object.assign({},Jr,kJ(X2(t)))),r,i,o,a=!1,s=!1,u=!1,l=!1,c,f,p,h=[],A=J2(Ze,n.interactiveDebounce),g,y=o6e++,C=null,_=U5e(n.plugins),b={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},v={id:y,reference:e,popper:Jp(),popperInstance:C,props:n,state:b,plugins:_,clearDelayTimeouts:xr,setProps:Tr,setContent:Me,show:$e,hide:D,hideWithInteractivity:L,enable:Jt,disable:on,unmount:U,destroy:ce};if(!n.render)return process.env.NODE_ENV!=="production"&&R_(!0,"render() function has not been supplied."),v;var S=n.render(v),w=S.popper,T=S.onUpdate;w.setAttribute("data-tippy-root",""),w.id="tippy-"+v.id,v.popper=w,e._tippy=v,w._tippy=v;var E=_.map(function(j){return j.fn(v)}),R=e.hasAttribute("aria-expanded");return rn(),M(),Y(),ee("onCreate",[v]),n.showOnCreate&&_r(),w.addEventListener("mouseenter",function(){v.props.interactive&&v.state.isVisible&&v.clearDelayTimeouts()}),w.addEventListener("mouseleave",function(){v.props.interactive&&v.props.trigger.indexOf("mouseenter")>=0&&H().addEventListener("mousemove",A)}),v;function O(){var j=v.props.touch;return Array.isArray(j)?j:[j,0]}function $(){return O()[0]==="hold"}function B(){var j;return!!((j=v.props.render)!=null&&j.$$tippy)}function K(){return g||e}function H(){var j=K().parentNode;return j?q5e(j):document}function z(){return k_(w)}function N(j){return v.state.isMounted&&!v.state.isVisible||_o.isTouch||c&&c.type==="focus"?0:ZS(v.props.delay,j?0:1,Jr.delay)}function Y(j){j===void 0&&(j=!1),w.style.pointerEvents=v.props.interactive&&!j?"":"none",w.style.zIndex=""+v.props.zIndex}function ee(j,te,pe){if(pe===void 0&&(pe=!0),E.forEach(function(be){be[j]&&be[j].apply(be,te)}),pe){var ue;(ue=v.props)[j].apply(ue,te)}}function F(){var j=v.props.aria;if(j.content){var te="aria-"+j.content,pe=w.id,ue=Jc(v.props.triggerTarget||e);ue.forEach(function(be){var ot=be.getAttribute(te);if(v.state.isVisible)be.setAttribute(te,ot?ot+" "+pe:pe);else{var wn=ot&&ot.replace(pe,"").trim();wn?be.setAttribute(te,wn):be.removeAttribute(te)}})}}function M(){if(!(R||!v.props.aria.expanded)){var j=Jc(v.props.triggerTarget||e);j.forEach(function(te){v.props.interactive?te.setAttribute("aria-expanded",v.state.isVisible&&te===K()?"true":"false"):te.removeAttribute("aria-expanded")})}}function W(){H().removeEventListener("mousemove",A),$g=$g.filter(function(j){return j!==A})}function re(j){if(!(_o.isTouch&&(u||j.type==="mousedown"))){var te=j.composedPath&&j.composedPath()[0]||j.target;if(!(v.props.interactive&&tD(w,te))){if(Jc(v.props.triggerTarget||e).some(function(pe){return tD(pe,te)})){if(_o.isTouch||v.state.isVisible&&v.props.trigger.indexOf("click")>=0)return}else ee("onClickOutside",[v,j]);v.props.hideOnClick===!0&&(v.clearDelayTimeouts(),v.hide(),s=!0,setTimeout(function(){s=!1}),v.state.isMounted||ae())}}}function Ie(){u=!0}function Ce(){u=!1}function P(){var j=H();j.addEventListener("mousedown",re,!0),j.addEventListener("touchend",re,Pu),j.addEventListener("touchstart",Ce,Pu),j.addEventListener("touchmove",Ie,Pu)}function ae(){var j=H();j.removeEventListener("mousedown",re,!0),j.removeEventListener("touchend",re,Pu),j.removeEventListener("touchstart",Ce,Pu),j.removeEventListener("touchmove",Ie,Pu)}function Ge(j,te){De(j,function(){!v.state.isVisible&&w.parentNode&&w.parentNode.contains(w)&&te()})}function ve(j,te){De(j,te)}function De(j,te){var pe=z().box;function ue(be){be.target===pe&&(ew(pe,"remove",ue),te())}if(j===0)return te();ew(pe,"remove",f),ew(pe,"add",ue),f=ue}function mt(j,te,pe){pe===void 0&&(pe=!1);var ue=Jc(v.props.triggerTarget||e);ue.forEach(function(be){be.addEventListener(j,te,pe),h.push({node:be,eventType:j,handler:te,options:pe})})}function rn(){$()&&(mt("touchstart",_e,{passive:!0}),mt("touchend",pt,{passive:!0})),D5e(v.props.trigger).forEach(function(j){if(j!=="manual")switch(mt(j,_e),j){case"mouseenter":mt("mouseleave",pt);break;case"focus":mt(G5e?"focusout":"blur",tt);break;case"focusin":mt("focusout",tt);break}})}function Ht(){h.forEach(function(j){var te=j.node,pe=j.eventType,ue=j.handler,be=j.options;te.removeEventListener(pe,ue,be)}),h=[]}function _e(j){var te,pe=!1;if(!(!v.state.isEnabled||lt(j)||s)){var ue=((te=c)==null?void 0:te.type)==="focus";c=j,g=j.currentTarget,M(),!v.state.isVisible&&W5e(j)&&$g.forEach(function(be){return be(j)}),j.type==="click"&&(v.props.trigger.indexOf("mouseenter")<0||a)&&v.props.hideOnClick!==!1&&v.state.isVisible?pe=!0:_r(j),j.type==="click"&&(a=!pe),pe&&!ue&&Bt(j)}}function Ze(j){var te=j.target,pe=K().contains(te)||w.contains(te);if(!(j.type==="mousemove"&&pe)){var ue=It().concat(w).map(function(be){var ot,wn=be._tippy,bo=(ot=wn.popperInstance)==null?void 0:ot.state;return bo?{popperRect:be.getBoundingClientRect(),popperState:bo,props:n}:null}).filter(Boolean);V5e(ue,j)&&(W(),Bt(j))}}function pt(j){var te=lt(j)||v.props.trigger.indexOf("click")>=0&&a;if(!te){if(v.props.interactive){v.hideWithInteractivity(j);return}Bt(j)}}function tt(j){v.props.trigger.indexOf("focusin")<0&&j.target!==K()||v.props.interactive&&j.relatedTarget&&w.contains(j.relatedTarget)||Bt(j)}function lt(j){return _o.isTouch?$()!==j.type.indexOf("touch")>=0:!1}function Yt(){Sn();var j=v.props,te=j.popperOptions,pe=j.placement,ue=j.offset,be=j.getReferenceClientRect,ot=j.moveTransition,wn=B()?k_(w).arrow:null,bo=be?{getBoundingClientRect:be,contextElement:be.contextElement||K()}:e,ku={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(_n){var As=_n.state;if(B()){var TC=z(),Ap=TC.box;["placement","reference-hidden","escaped"].forEach(function(Ou){Ou==="placement"?Ap.setAttribute("data-placement",As.placement):As.attributes.popper["data-popper-"+Ou]?Ap.setAttribute("data-"+Ou,""):Ap.removeAttribute("data-"+Ou)}),As.attributes.popper={}}}},aa=[{name:"offset",options:{offset:ue}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ot}},ku];B()&&wn&&aa.push({name:"arrow",options:{element:wn,padding:3}}),aa.push.apply(aa,(te==null?void 0:te.modifiers)||[]),v.popperInstance=O5e(bo,w,Object.assign({},te,{placement:pe,onFirstUpdate:p,modifiers:aa}))}function Sn(){v.popperInstance&&(v.popperInstance.destroy(),v.popperInstance=null)}function Gt(){var j=v.props.appendTo,te,pe=K();v.props.interactive&&j===TJ||j==="parent"?te=pe.parentNode:te=IJ(j,[pe]),te.contains(w)||te.appendChild(w),v.state.isMounted=!0,Yt(),process.env.NODE_ENV!=="production"&&Aa(v.props.interactive&&j===Jr.appendTo&&pe.nextElementSibling!==w,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
|
|
90
|
+
|
|
91
|
+
`,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
|
|
92
|
+
|
|
93
|
+
`,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
|
|
94
|
+
|
|
95
|
+
`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function It(){return Xv(w.querySelectorAll("[data-tippy-root]"))}function _r(j){v.clearDelayTimeouts(),j&&ee("onTrigger",[v,j]),P();var te=N(!0),pe=O(),ue=pe[0],be=pe[1];_o.isTouch&&ue==="hold"&&be&&(te=be),te?r=setTimeout(function(){v.show()},te):v.show()}function Bt(j){if(v.clearDelayTimeouts(),ee("onUntrigger",[v,j]),!v.state.isVisible){ae();return}if(!(v.props.trigger.indexOf("mouseenter")>=0&&v.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(j.type)>=0&&a)){var te=N(!1);te?i=setTimeout(function(){v.state.isVisible&&v.hide()},te):o=requestAnimationFrame(function(){v.hide()})}}function Jt(){v.state.isEnabled=!0}function on(){v.hide(),v.state.isEnabled=!1}function xr(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function Tr(j){if(process.env.NODE_ENV!=="production"&&Aa(v.state.isDestroyed,Pc("setProps")),!v.state.isDestroyed){ee("onBeforeUpdate",[v,j]),Ht();var te=v.props,pe=iD(e,Object.assign({},te,X2(j),{ignoreAttributes:!0}));v.props=pe,rn(),te.interactiveDebounce!==pe.interactiveDebounce&&(W(),A=J2(Ze,pe.interactiveDebounce)),te.triggerTarget&&!pe.triggerTarget?Jc(te.triggerTarget).forEach(function(ue){ue.removeAttribute("aria-expanded")}):pe.triggerTarget&&e.removeAttribute("aria-expanded"),M(),Y(),T&&T(te,pe),v.popperInstance&&(Yt(),It().forEach(function(ue){requestAnimationFrame(ue._tippy.popperInstance.forceUpdate)})),ee("onAfterUpdate",[v,j])}}function Me(j){v.setProps({content:j})}function $e(){process.env.NODE_ENV!=="production"&&Aa(v.state.isDestroyed,Pc("show"));var j=v.state.isVisible,te=v.state.isDestroyed,pe=!v.state.isEnabled,ue=_o.isTouch&&!v.props.touch,be=ZS(v.props.duration,0,Jr.duration);if(!(j||te||pe||ue)&&!K().hasAttribute("disabled")&&(ee("onShow",[v],!1),v.props.onShow(v)!==!1)){if(v.state.isVisible=!0,B()&&(w.style.visibility="visible"),Y(),P(),v.state.isMounted||(w.style.transition="none"),B()){var ot=z(),wn=ot.box,bo=ot.content;XS([wn,bo],0)}p=function(){var aa;if(!(!v.state.isVisible||l)){if(l=!0,w.offsetHeight,w.style.transition=v.props.moveTransition,B()&&v.props.animation){var sa=z(),_n=sa.box,As=sa.content;XS([_n,As],be),eD([_n,As],"visible")}F(),M(),Z2(tw,v),(aa=v.popperInstance)==null||aa.forceUpdate(),ee("onMount",[v]),v.props.animation&&B()&&ve(be,function(){v.state.isShown=!0,ee("onShown",[v])})}},Gt()}}function D(){process.env.NODE_ENV!=="production"&&Aa(v.state.isDestroyed,Pc("hide"));var j=!v.state.isVisible,te=v.state.isDestroyed,pe=!v.state.isEnabled,ue=ZS(v.props.duration,1,Jr.duration);if(!(j||te||pe)&&(ee("onHide",[v],!1),v.props.onHide(v)!==!1)){if(v.state.isVisible=!1,v.state.isShown=!1,l=!1,a=!1,B()&&(w.style.visibility="hidden"),W(),ae(),Y(!0),B()){var be=z(),ot=be.box,wn=be.content;v.props.animation&&(XS([ot,wn],ue),eD([ot,wn],"hidden"))}F(),M(),v.props.animation?B()&&Ge(ue,v.unmount):v.unmount()}}function L(j){process.env.NODE_ENV!=="production"&&Aa(v.state.isDestroyed,Pc("hideWithInteractivity")),H().addEventListener("mousemove",A),Z2($g,A),A(j)}function U(){process.env.NODE_ENV!=="production"&&Aa(v.state.isDestroyed,Pc("unmount")),v.state.isVisible&&v.hide(),v.state.isMounted&&(Sn(),It().forEach(function(j){j._tippy.unmount()}),w.parentNode&&w.parentNode.removeChild(w),tw=tw.filter(function(j){return j!==v}),v.state.isMounted=!1,ee("onHidden",[v]))}function ce(){process.env.NODE_ENV!=="production"&&Aa(v.state.isDestroyed,Pc("destroy")),!v.state.isDestroyed&&(v.clearDelayTimeouts(),v.unmount(),Ht(),delete e._tippy,v.state.isDestroyed=!0,ee("onDestroy",[v]))}}function tg(e,t){t===void 0&&(t={});var n=Jr.plugins.concat(t.plugins||[]);process.env.NODE_ENV!=="production"&&(X5e(e),OJ(t,n)),H5e();var r=Object.assign({},t,{plugins:n}),i=K5e(e);if(process.env.NODE_ENV!=="production"){var o=qh(r.content),a=i.length>1;Aa(o&&a,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
|
|
96
|
+
|
|
97
|
+
`,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
|
|
98
|
+
|
|
99
|
+
`,`1) content: element.innerHTML
|
|
100
|
+
`,"2) content: () => element.cloneNode(true)"].join(" "))}var s=i.reduce(function(u,l){var c=l&&a6e(l,r);return c&&u.push(c),u},[]);return qh(e)?s[0]:s}tg.defaultProps=Jr;tg.setDefaultProps=n6e;tg.currentInput=_o;Object.assign({},AJ,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});tg.setDefaultProps({render:MJ});class s6e{constructor({editor:t,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:a}){this.preventHide=!1,this.shouldShow=({view:s,state:u,from:l,to:c})=>{const{doc:f,selection:p}=u,{empty:h}=p,A=!f.textBetween(l,c).length&&xF(u.selection),g=this.element.contains(document.activeElement);return!(!(s.hasFocus()||g)||h||A||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var u;if(this.preventHide){this.preventHide=!1;return}s!=null&&s.relatedTarget&&(!((u=this.element.parentNode)===null||u===void 0)&&u.contains(s.relatedTarget))||(s==null?void 0:s.relatedTarget)!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.handleDebouncedUpdate=(s,u)=>{const l=!(u!=null&&u.selection.eq(s.state.selection)),c=!(u!=null&&u.doc.eq(s.state.doc));!l&&!c||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(s,l,c,u)},this.updateDelay))},this.updateHandler=(s,u,l,c)=>{var f,p,h;const{state:A,composing:g}=s,{selection:y}=A;if(g||!u&&!l)return;this.createTooltip();const{ranges:_}=y,b=Math.min(..._.map(w=>w.$from.pos)),v=Math.max(..._.map(w=>w.$to.pos));if(!((f=this.shouldShow)===null||f===void 0?void 0:f.call(this,{editor:this.editor,element:this.element,view:s,state:A,oldState:c,from:b,to:v}))){this.hide();return}(p=this.tippy)===null||p===void 0||p.setProps({getReferenceClientRect:((h=this.tippyOptions)===null||h===void 0?void 0:h.getReferenceClientRect)||(()=>{if(NKe(A.selection)){let w=s.nodeDOM(b);if(w){const T=w.dataset.nodeViewWrapper?w:w.querySelector("[data-node-view-wrapper]");if(T&&(w=T.firstChild),w)return w.getBoundingClientRect()}}return KKe(s,b,v)})}),this.show()},this.editor=t,this.element=n,this.view=r,this.updateDelay=o,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:t}=this.editor.options,n=!!t.parentElement;this.tippy||!n||(this.tippy=tg(t,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(t,n){const{state:r}=t,i=r.selection.from!==r.selection.to;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(t,n);return}const o=!(n!=null&&n.selection.eq(t.state.selection)),a=!(n!=null&&n.doc.eq(t.state.doc));this.updateHandler(t,o,a,n)}show(){var t;(t=this.tippy)===null||t===void 0||t.show()}hide(){var t;(t=this.tippy)===null||t===void 0||t.hide()}destroy(){var t,n;!((t=this.tippy)===null||t===void 0)&&t.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const FJ=e=>new Kn({key:typeof e.pluginKey=="string"?new rr(e.pluginKey):e.pluginKey,view:t=>new s6e({view:t,...e})});Fn.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[FJ({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});var O_={exports:{}},nw={};/**
|
|
101
|
+
* @license React
|
|
102
|
+
* use-sync-external-store-shim.production.min.js
|
|
103
|
+
*
|
|
104
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
105
|
+
*
|
|
106
|
+
* This source code is licensed under the MIT license found in the
|
|
107
|
+
* LICENSE file in the root directory of this source tree.
|
|
108
|
+
*/var sD;function u6e(){if(sD)return nw;sD=1;var e=I;function t(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function s(f,p){var h=p(),A=r({inst:{value:h,getSnapshot:p}}),g=A[0].inst,y=A[1];return o(function(){g.value=h,g.getSnapshot=p,u(g)&&y({inst:g})},[f,h,p]),i(function(){return u(g)&&y({inst:g}),f(function(){u(g)&&y({inst:g})})},[f]),a(h),h}function u(f){var p=f.getSnapshot;f=f.value;try{var h=p();return!n(f,h)}catch{return!0}}function l(f,p){return p()}var c=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:s;return nw.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:c,nw}var rw={};/**
|
|
109
|
+
* @license React
|
|
110
|
+
* use-sync-external-store-shim.development.js
|
|
111
|
+
*
|
|
112
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
113
|
+
*
|
|
114
|
+
* This source code is licensed under the MIT license found in the
|
|
115
|
+
* LICENSE file in the root directory of this source tree.
|
|
116
|
+
*/var uD;function l6e(){return uD||(uD=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=I,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(b){{for(var v=arguments.length,S=new Array(v>1?v-1:0),w=1;w<v;w++)S[w-1]=arguments[w];r("error",b,S)}}function r(b,v,S){{var w=t.ReactDebugCurrentFrame,T=w.getStackAddendum();T!==""&&(v+="%s",S=S.concat([T]));var E=S.map(function(R){return String(R)});E.unshift("Warning: "+v),Function.prototype.apply.call(console[b],console,E)}}function i(b,v){return b===v&&(b!==0||1/b===1/v)||b!==b&&v!==v}var o=typeof Object.is=="function"?Object.is:i,a=e.useState,s=e.useEffect,u=e.useLayoutEffect,l=e.useDebugValue,c=!1,f=!1;function p(b,v,S){c||e.startTransition!==void 0&&(c=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var w=v();if(!f){var T=v();o(w,T)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var E=a({inst:{value:w,getSnapshot:v}}),R=E[0].inst,O=E[1];return u(function(){R.value=w,R.getSnapshot=v,h(R)&&O({inst:R})},[b,w,v]),s(function(){h(R)&&O({inst:R});var $=function(){h(R)&&O({inst:R})};return b($)},[b]),l(w),w}function h(b){var v=b.getSnapshot,S=b.value;try{var w=v();return!o(S,w)}catch{return!0}}function A(b,v,S){return v()}var g=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",y=!g,C=y?A:p,_=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:C;rw.useSyncExternalStore=_,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),rw}process.env.NODE_ENV==="production"?O_.exports=u6e():O_.exports=l6e();var jF=O_.exports;const c6e=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},d6e=({contentComponent:e})=>{const t=jF.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return I.createElement(I.Fragment,null,Object.values(t))};function f6e(){const e=new Set;let t={};return{subscribe(n){return e.add(n),()=>{e.delete(n)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:ix.createPortal(r.reactElement,r.element,n)},e.forEach(i=>i())},removeRenderer(n){const r={...t};delete r[n],t=r,e.forEach(i=>i())}}}class p6e extends I.Component{constructor(t){var n;super(t),this.editorContentRef=I.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((n=t.editor)===null||n===void 0)&&n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const t=this.props.editor;if(t&&!t.isDestroyed&&t.options.element){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.options.element.childNodes),t.setOptions({element:n}),t.contentComponent=f6e(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=t.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),t.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const t=this.props.editor;if(!t||(this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null,!t.options.element.firstChild))return;const n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){const{editor:t,innerRef:n,...r}=this.props;return I.createElement(I.Fragment,null,I.createElement("div",{ref:c6e(n,this.editorContentRef),...r}),(t==null?void 0:t.contentComponent)&&I.createElement(d6e,{contentComponent:t.contentComponent}))}}const h6e=I.forwardRef((e,t)=>{const n=I.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return I.createElement(p6e,{key:n,innerRef:t,...e})}),A6e=I.memo(h6e);var iw={};/**
|
|
117
|
+
* @license React
|
|
118
|
+
* use-sync-external-store-shim/with-selector.production.min.js
|
|
119
|
+
*
|
|
120
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
121
|
+
*
|
|
122
|
+
* This source code is licensed under the MIT license found in the
|
|
123
|
+
* LICENSE file in the root directory of this source tree.
|
|
124
|
+
*/var lD;function m6e(){if(lD)return iw;lD=1;var e=I,t=jF;function n(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,s=e.useMemo,u=e.useDebugValue;return iw.useSyncExternalStoreWithSelector=function(l,c,f,p,h){var A=o(null);if(A.current===null){var g={hasValue:!1,value:null};A.current=g}else g=A.current;A=s(function(){function C(w){if(!_){if(_=!0,b=w,w=p(w),h!==void 0&&g.hasValue){var T=g.value;if(h(T,w))return v=T}return v=w}if(T=v,r(b,w))return T;var E=p(w);return h!==void 0&&h(T,E)?T:(b=w,v=E)}var _=!1,b,v,S=f===void 0?null:f;return[function(){return C(c())},S===null?void 0:function(){return C(S())}]},[c,f,p,h]);var y=i(l,A[0],A[1]);return a(function(){g.hasValue=!0,g.value=y},[y]),u(y),y},iw}var ow={};/**
|
|
125
|
+
* @license React
|
|
126
|
+
* use-sync-external-store-shim/with-selector.development.js
|
|
127
|
+
*
|
|
128
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
129
|
+
*
|
|
130
|
+
* This source code is licensed under the MIT license found in the
|
|
131
|
+
* LICENSE file in the root directory of this source tree.
|
|
132
|
+
*/var cD;function g6e(){return cD||(cD=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=I,t=jF;function n(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,s=e.useMemo,u=e.useDebugValue;function l(c,f,p,h,A){var g=o(null),y;g.current===null?(y={hasValue:!1,value:null},g.current=y):y=g.current;var C=s(function(){var S=!1,w,T,E=function(B){if(!S){S=!0,w=B;var K=h(B);if(A!==void 0&&y.hasValue){var H=y.value;if(A(H,K))return T=H,H}return T=K,K}var z=w,N=T;if(r(z,B))return N;var Y=h(B);return A!==void 0&&A(N,Y)?N:(w=B,T=Y,Y)},R=p===void 0?null:p,O=function(){return E(f())},$=R===null?void 0:function(){return E(R())};return[O,$]},[f,p,h,A]),_=C[0],b=C[1],v=i(c,_,b);return a(function(){y.hasValue=!0,y.value=v},[v]),u(v),v}ow.useSyncExternalStoreWithSelector=l,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),ow}process.env.NODE_ENV==="production"?m6e():g6e();process.env.NODE_ENV;const jJ=I.createContext({editor:null});jJ.Consumer;const v6e=()=>I.useContext(jJ),aw=e=>{const[t,n]=I.useState(null),{editor:r}=v6e();return I.useEffect(()=>{var i;if(!t||!((i=e.editor)===null||i===void 0)&&i.isDestroyed||r!=null&&r.isDestroyed)return;const{pluginKey:o="bubbleMenu",editor:a,tippyOptions:s={},updateDelay:u,shouldShow:l=null}=e,c=a||r;if(!c){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const f=FJ({updateDelay:u,editor:c,element:t,pluginKey:o,shouldShow:l,tippyOptions:s});return c.registerPlugin(f),()=>{c.unregisterPlugin(o)}},[e.editor,r,t]),I.createElement("div",{ref:n,className:e.className,style:{visibility:"hidden"}},e.children)},LJ=I.createContext({onDragStart:void 0}),DJ=()=>I.useContext(LJ),y6e=e=>{const t=e.as||"div",{nodeViewContentRef:n}=DJ();return I.createElement(t,{...e,ref:n,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...e.style}})},LF=I.forwardRef((e,t)=>{const{onDragStart:n}=DJ(),r=e.as||"div";return I.createElement(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});function b6e(e){return!!(typeof e=="function"&&e.prototype&&e.prototype.isReactComponent)}function C6e(e){var t;return typeof e=="object"&&((t=e.$$typeof)===null||t===void 0?void 0:t.toString())==="Symbol(react.forward_ref)"}class UJ{constructor(t,{editor:n,props:r={},as:i="div",className:o=""}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=t,this.editor=n,this.props=r,this.element=document.createElement(i),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),this.editor.isInitialized?ix.flushSync(()=>{this.render()}):this.render()}render(){var t;const n=this.component,r=this.props,i=this.editor;(b6e(n)||C6e(n))&&(r.ref=o=>{this.ref=o}),this.reactElement=I.createElement(n,{...r}),(t=i==null?void 0:i.contentComponent)===null||t===void 0||t.setRenderer(this.id,this)}updateProps(t={}){this.props={...this.props,...t},this.render()}destroy(){var t;const n=this.editor;(t=n==null?void 0:n.contentComponent)===null||t===void 0||t.removeRenderer(this.id)}updateAttributes(t){Object.keys(t).forEach(n=>{this.element.setAttribute(n,t[n])})}}class S6e extends c3e{mount(){const t={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(l={})=>this.updateAttributes(l),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const l=c=>c.charAt(0).toUpperCase()+c.substring(1);this.component.displayName=l(this.extension.name)}const i={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:l=>{l&&this.contentDOMElement&&l.firstChild!==this.contentDOMElement&&l.appendChild(this.contentDOMElement)}},o=this.component,a=I.memo(l=>I.createElement(LJ.Provider,{value:i},I.createElement(o,l)));a.displayName="ReactNodeView",this.node.isLeaf?this.contentDOMElement=null:this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.style.whiteSpace="inherit");let s=this.node.isInline?"span":"div";this.options.as&&(s=this.options.as);const{className:u=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new UJ(a,{editor:this.editor,props:t,as:s,className:`node-${this.node.type.name} ${u}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes()}get dom(){var t;if(this.renderer.element.firstElementChild&&!(!((t=this.renderer.element.firstElementChild)===null||t===void 0)&&t.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){const{from:t,to:n}=this.editor.state.selection,r=this.getPos();if(typeof r=="number")if(t<=r&&n>=r+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(t,n,r){const i=o=>{this.renderer.updateProps(o),typeof this.options.attrs=="function"&&this.updateElementAttributes()};if(t.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const o=this.node,a=this.decorations,s=this.innerDecorations;return this.node=t,this.decorations=n,this.innerDecorations=r,this.options.update({oldNode:o,oldDecorations:a,newNode:t,newDecorations:n,oldInnerDecorations:s,innerDecorations:r,updateProps:()=>i({node:t,decorations:n,innerDecorations:r})})}return t===this.node&&this.decorations===n&&this.innerDecorations===r||(this.node=t,this.decorations=n,this.innerDecorations=r,i({node:t,decorations:n,innerDecorations:r})),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null}updateElementAttributes(){if(this.options.attrs){let t={};if(typeof this.options.attrs=="function"){const n=this.editor.extensionManager.attributes,r=Vv(this.node,n);t=this.options.attrs({node:this.node,HTMLAttributes:r})}else t=this.options.attrs;this.renderer.updateAttributes(t)}}}function DF(e,t){return n=>n.editor.contentComponent?new S6e(e,n,t):{}}function BJ(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=BJ(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function w6e(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=BJ(e))&&(r&&(r+=" "),r+=t);return r}function _6e(e){return e.type==="table"}const al={...he.RichTextNodeType,table:"table"};function x6e(e){return!!(e&&e.has(al.table))}const T6e=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,I6e=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,E6e=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,R6e=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,$6e=Zm.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return["strong",Dt(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Hv({find:T6e,type:this.type}),Hv({find:E6e,type:this.type})]},addPasteRules(){return[Gv({find:I6e,type:this.type}),Gv({find:R6e,type:this.type})]}});var Mc=(e=>(e.Document="document",e.Mark="mark",e.Node="node",e))(Mc||{}),Hu=(e=>(e.Text="text",e.Embed="embed",e.Image="image",e.Table="table",e))(Hu||{});class k6e{constructor(t,n,r){dn(this,"extType","document");this.name=t,this.component=n,this.converter=r}}class ng{constructor(t,n,r,i,o,a=!1){dn(this,"extType","node");dn(this,"nodeType","text");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i,this.placeholder=o,this.lockedFormat=a}}function PJ(e){return e instanceof ng}class O6e{constructor(t,n,r,i){dn(this,"extType","node");dn(this,"nodeType","embed");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}class M6e{constructor(t,n,r,i){dn(this,"extType","node");dn(this,"nodeType","image");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}class F6e extends ng{constructor(t,n,r,i,o){super(t,"heading",n,i,o),this.levels=r}}class UF extends ng{constructor(t,n,r,i){super(t,n,r,i)}}class j6e{constructor(t,n,r,i){dn(this,"extType","node");dn(this,"nodeType","table");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}function L6e(e){return e instanceof UF}const WJ=sn.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",Dt(this.options.HTMLAttributes,e)]},renderText(){return`
|
|
133
|
+
`},addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:s}=r.extensionManager,u=o||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:l,dispatch:c})=>{if(c&&u&&a){const f=u.filter(p=>s.includes(p.type.name));l.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Qs={isHardBreak(e){return e.type.name===WJ.name},children:{reduce(e,t,n){let r=n;return e.forEach((i,o,a)=>{r=t(r,i,a)}),r},map(e,t){return this.reduce(e,(n,r)=>[...n,t(r)],[])},exists(e,t){return this.reduce(e,(n,r)=>n||t(r),!1)},filter(e,t){return this.reduce(e,(n,r)=>[...n,...t(r)?[r]:[]],[])}},marks:{reduce(e,t,n){let r=n;return e.marks.forEach((i,o)=>{r=t(r,i,o)}),r},map(e,t){return this.reduce(e,(n,r)=>[...n,t(r)],[])},filter(e,t){return this.reduce(e,(n,r)=>[...n,...t(r)?[r]:[]],[])}}};function D6e(e){if(!e||!(e!=null&&e.single)&&!(e!=null&&e.multi))return dD();const t=U6e(e);if(!t.size)return dD();const n=B6e(t),r=P6e(n,e);return{nodeTypes:t,extensions:r}}function U6e(e){const n=(e.single||e.multi||"").split(/\s*,\s*/).map(r=>{if(r==="table")return r;const i=he.RichTextNodeTypeCodec.decode(r);return i._tag==="Right"?i.right:void 0}).filter(Qi.isDefined);return new Set(n)}function B6e(e){return JZ(e).filter(n=>ei.some(e,r=>n.richTextNodeTypes.includes(r)))}function P6e(e,t){var r;const n=new Set(e);return ei.some(n,L6e)&&n.add(Mr),ei.some(n,PJ)||n.add(Mr),(r=t==null?void 0:t.labels)!=null&&r.length&&n.add(zF),[...n]}function dD(){return{extensions:JZ(),nodeTypes:new Set(Pd.keys(he.RichTextNodeTypeCodec.keys))}}class W6e{constructor(t,n,r){dn(this,"extType",Mc.Mark);dn(this,"richTextNodeTypes",[he.RichTextNodeType.strong]);this.name=t,this.component=n,this.converter=r}}const NJ="bold",KJ=$6e.extend({name:NJ}),N6e={fromPrismic(e){return function(){var t;return(t=e.marks[KJ.name])==null?void 0:t.create()}},toPrismic(){}},K6e=new W6e(NJ,KJ,N6e),BF=K6e,q6e="listItem",fD="textStyle",pD=/^\s*([-+*])\s$/,V6e=sn.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",Dt(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(q6e,this.editor.getAttributes(fD)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=Yv({find:pD,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Yv({find:pD,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(fD),editor:this.editor})),[e]}}),z6e=sn.create({name:"doc",topNode:!0,content:"block+"}),Q6e=sn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",Dt(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),qJ=Q6e.extend({name:"listItem",content:"paragraph*",addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name)}}}),H6e={fromPrismic(e){return function(t){var r;const n=Mr.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[qJ.name])==null?void 0:r.create({},n)}},toPrismic(e,t){return Qs.children.reduce(e,(n,r)=>{const i=Mr.converter.toPrismic(r),o=(()=>i instanceof Array?i.map(a=>({...a,type:t})):i?[{...i,type:t}]:[])();return[...n,...o]},[])}},Ld={component:qJ,converter:H6e,placeholder:"List"};function Y6e(e,t){return e.copy(e.content.append(t.content))}const Zc={heading1:"heading1",heading2:"heading2",heading3:"heading3",heading4:"heading4",heading5:"heading5",heading6:"heading6",paragraph:"paragraph",preformatted:"preformatted",strong:"strong",em:"em",listItem:"list-item",oListItem:"o-list-item",list:"group-list-item",oList:"group-o-list-item",image:"image",embed:"embed",hyperlink:"hyperlink",label:"label",span:"span"},mC=()=>(++mC.i).toString();mC.i=0;const G6e=e=>{const t=J6e(e),n=[];for(let r=0;r<t.length;r++)n.push(VJ(t[r]));return{key:mC(),children:n}},Zp=(e,t=[])=>({key:mC(),type:e.type,text:"text"in e?e.text:void 0,node:e,children:t}),sw=e=>Zp({type:Zc.span,text:e,spans:[]}),J6e=e=>{const t=e.slice(0);for(let n=0;n<t.length;n++){const r=t[n];if(r.type===Zc.listItem||r.type===Zc.oListItem){const i=[r];for(;t[n+1]&&t[n+1].type===r.type;)i.push(t[n+1]),t.splice(n,1);r.type===Zc.listItem?t[n]={type:Zc.list,items:i}:t[n]={type:Zc.oList,items:i}}}return t},VJ=e=>{if("text"in e)return Zp(e,zJ(e.spans,e));if("items"in e){const t=[];for(let n=0;n<e.items.length;n++)t.push(VJ(e.items[n]));return Zp(e,t)}return Zp(e)},zJ=(e,t,n)=>{if(!e.length)return[sw(t.text)];const r=e.slice(0);r.sort((o,a)=>o.start-a.start||a.end-o.end);const i=[];for(let o=0;o<r.length;o++){const a=r[o],s=n&&n.start||0,u=a.start-s,l=a.end-s,c=t.text.slice(u,l),f=[];for(let h=o;h<r.length;h++){const A=r[h];A!==a&&A.start>=a.start&&A.end<=a.end&&(f.push(A),r.splice(h,1),h--)}o===0&&u>0&&i.push(sw(t.text.slice(0,u)));const p={...a,text:c};i.push(Zp(p,zJ(f,{...t,text:c},a))),l<t.text.length&&i.push(sw(t.text.slice(l,r[o+1]?r[o+1].start-s:void 0)))}return i},Z6e=(e,t)=>QJ(G6e(e).children,t),QJ=(e,t)=>{const n=[];for(let r=0;r<e.length;r++){const i=e[r],o=t(i.type,i.node,i.text,QJ(i.children,t),i.key);o!=null&&n.push(o)}return n},X6e=sn.create({name:"text",group:"inline"});function e4e(e){return e.reduce((t,n)=>{const r=(t[n.type]||[]).concat(n);return{...t,[n.type]:r}},{})}function hD(e){return e.sort((t,n)=>t.start-n.start)}function t4e(e){const t=e4e(e),n=Object.entries(t).map(([r,i])=>hD(i).reduce((a,s)=>{if(!a.length)return[s];const u=a.length-1,l=a[u];return l?l.end<s.start?[...a,s]:l.end>=s.end?a:[...a.slice(0,u),{...l,end:s.end}]:a},[])).flat();return hD(n)}const ey=WJ.extend({name:"hard_break"}),ty=`
|
|
134
|
+
`,HJ={fromPrismic(e){return function(t){var n;if(t===ty)return(n=e.nodes[ey.name])==null?void 0:n.create({})}},toPrismic(e){if(e.type.name===ey.name)return ty}},uw={isEmptyLine(e){return e.length===0},isFirst(e){return e===0}};function n4e(e,t){return function(n){const r=HJ.fromPrismic(e)(ty);if(!r)return[n(t)];const i=t.split(ty);return i.length===1?t.length?[n(t)]:[r]:i.reduce((o,a,s)=>uw.isFirst(s)?uw.isEmptyLine(a)?o:[...o,n(a)]:uw.isEmptyLine(a)?[...o,r]:[...o,r,n(a)],[])}}const r4e={name:ey.name,component:ey,converter:HJ,splitTextToNodes:n4e},ny=r4e,YJ={fromPrismic(e){return t=>{switch(t.type){case"hyperlink":return wZ.converter.fromPrismic(e)(t);case"em":return VF.converter.fromPrismic(e)(t);case"strong":return BF.converter.fromPrismic(e)(t);case"label":return zF.converter.fromPrismic(e)(t);case"list-item":return}}},toPrismic(e,t,n){const r=GZ.find(i=>e.type.name===i.name);if(!r)throw new Error(`Invalid mark extension '${e.type.name}'.`);switch(r.name){case"bold":return{type:"strong",start:t,end:n};case"em":return{type:r.name,start:t,end:n};case"hyperlink":return{type:r.name,start:t,end:n,data:r.converter.toPrismic(e)};case"label":return{type:r.name,start:t,end:n,data:r.converter.toPrismic(e)}}}},i4e={strong:"bold",label:"label",em:"em",hyperlink:"hyperlink","list-item":void 0},AD=X6e.extend({name:"text"}),o4e={fromPrismic(e){return function(t,n,r=!1){const i={type:t,text:n.content.text,spans:n.content.spans||[]};return Z6e([i],a4e(e,r)).flat()}},toPrismic(e,t,n){const r=Qs.children.reduce(e,(i,o)=>{const a=(()=>o.type.name===ny.name?ny.converter.toPrismic(o):o.textContent)(),s=a?i.text+a:i.text,u=i.text.length,l=s.length,c=(()=>o.marks.length?Qs.marks.map(o,p=>YJ.toPrismic(p,u,l)):void 0)();return{...i,text:s,spans:c?[...i.spans,...c]:i.spans}},{text:"",spans:[]});return{type:t,content:{text:r.text,spans:[...t4e(r.spans)].sort((i,o)=>i.type.localeCompare(o.type))},...n}}};function a4e(e,t=!1){return(n,r,i,o)=>{if(n==="span"&&i&&i.length)return t?[e.text(i)]:ny.splitTextToNodes(e,i)(u=>e.text(u));const a=YJ.fromPrismic(e)(r);return a?s4e(a,o):o.flat()}}function s4e(e,t){return t.flat().map(r=>{const o=[...r.marks,e].sort((a,s)=>a.type.name.localeCompare(s.type.name));return r.mark(o)})}const u4e={name:AD.name,component:AD,converter:o4e},El=u4e,PF="document";function l4e(e){return z6e.extend({name:PF,content:e?"block+":"block"})}function c4e(e){return{fromPrismic(t,n,r){var o;const i=r.value.reduce((a,s)=>{const{extension:u,block:l}=h4e(e,s,t,n),c=f4e({extension:u,block:l,schema:t}),f=a.slice(0,a.length-1),p=wt.last(a),h=p4e({node:c,previousNode:p});return h.updatedNode?[...h.merged?f:a,h.updatedNode]:a},[]);return(o=t.nodes[PF])==null?void 0:o.create({},i)},toPrismic(t){return{__TYPE__:"StructuredTextContent",value:[...Qs.children.reduce(t,(r,i)=>{const o=Object.values(e).find(s=>i.type.name===s.name),a=o==null?void 0:o.converter.toPrismic(i);return a||console.warn(`Cannot convert node of type '${i.type.name}'.`),a?[...r,...a instanceof Array?a:[a]]:r},[])]}}}}const d4e=new k6e(PF,l4e,c4e),M_=d4e;function f4e(e){const{extension:t,block:n,schema:r}=e;if(t)switch(t.nodeType){case Hu.Embed:return fe.EmbedBlock.is(n)?t.converter.fromPrismic(r)(n):void 0;case Hu.Text:return fe.TextBlock.is(n)?t.converter.fromPrismic(r)(n):void 0;case Hu.Image:return fe.ImageBlock.is(n)?t.converter.fromPrismic(r)(n):void 0;case Hu.Table:return _6e(n)?t.converter.fromPrismic(r)(n):void 0}}function p4e(e){const{node:t,previousNode:n}=e;return!t||!n?{merged:!1,updatedNode:t}:t.type.name===n.type.name&&(t.type.name===sy.name||t.type.name===ly.name)?{merged:!0,updatedNode:Y6e(n,t)}:{merged:!1,updatedNode:t}}function h4e(e,t,n,r){var s;const i=e.find(u=>u.richTextNodeTypes.includes(t.type)&&r.has(t.type));if(i)return{extension:i,block:t};if(!fe.TextBlock.is(t))return{extension:void 0,block:t};const o=e.find(u=>PJ(u)&&u.name in n.nodes),a=(s=t.content.spans)==null?void 0:s.filter(u=>{const l=i4e[u.type];return l&&l in n.marks});return{extension:o,block:{...t,content:{text:t.content.text,spans:a}}}}const A4e=Fn.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Kn({key:new rr("placeholder"),props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,i=[];if(!n)return null;const o=this.editor.isEmpty;return e.descendants((a,s)=>{const u=r>=s&&r<=s+a.nodeSize,l=!a.isLeaf&&TF(a);if((u||!this.options.showOnlyCurrent)&&l){const c=[this.options.emptyNodeClass];o&&c.push(this.options.emptyEditorClass);const f=$r.node(s,s+a.nodeSize,{class:c.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:s,hasAnchor:u}):this.options.placeholder});i.push(f)}return this.options.includeChildren}),Mt.create(e,i)}}})]}}),m4e=sn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",Dt(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),ev="ltr",Yu="rtl",ga="dir",mD=he.RichTextNodeType.rtl,g4e=Fn.create({name:"textDirection",addOptions(){return{supportedExtensionNames:[]}},addGlobalAttributes(){return[{types:this.options.supportedExtensionNames,attributes:{[ga]:{default:ev,parseHTML:e=>e.getAttribute(ga),renderHTML:e=>({[ga]:F_(e[ga])})}}}]},addCommands(){return{setDirection:e=>({commands:t})=>{switch(e){case ev:return t.setLeftToRight();case Yu:return t.setRightToLeft()}},toggleDirection:e=>({commands:t})=>{const n=e===Yu?ev:Yu;return t.setDirection(n)},setRightToLeft:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.updateAttributes(t,{[ga]:Yu})),setLeftToRight:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.resetAttributes(t,ga))}},addKeyboardShortcuts(){return{"Mod-Shift-r":()=>this.editor.commands.setRightToLeft(),"Mod-Shift-l":()=>this.editor.commands.setLeftToRight()}}}),Ia={parseNodeAttrsDirection(e){return F_(e[ga])},fromPrismic(e){return{[ga]:F_(e.direction)}},toPrismic(e){return{direction:this.parseNodeAttrsDirection(e.attrs)}}};function F_(e){return e===Yu?Yu:ev}const ry=m4e.extend({name:"paragraph",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",Dt(this.options.HTMLAttributes,e),0]}}),v4e={fromPrismic(e){return function(t){var r;const n=El.converter.fromPrismic(e)(ry.name,t);return(r=e.nodes[ry.name])==null?void 0:r.create(Ia.fromPrismic(t),n)}},toPrismic(e){return El.converter.toPrismic(e,he.RichTextNodeType.paragraph,Ia.toPrismic(e))}},y4e=new ng([he.RichTextNodeType.paragraph],ry.name,ry,v4e,"Type '/' for commands"),Mr=y4e,b4e=e=>A4e.configure({includeChildren:!0,placeholder:t=>C4e(t,e),showOnlyCurrent:!1,showOnlyWhenEditable:!1});function C4e(e,t){const{editor:n,hasAnchor:r,pos:i,node:o}=e,{placeholderByNodeType:a,unfocusedPlaceholder:s,nodeExtensions:u}=t,l=!Qs.children.exists(n.state.doc,_=>_===o),c=n.isEditable;if(s&&!n.isFocused&&n.isEmpty&&i===0)return s;const f=o.type.name!==Mr.name,p=n.isFocused&&r||f||l,h=u.filter(_=>_!==Mr).length>1;function A(_){return _===Mr.placeholder?c&&p&&h:c&&p}function g(){if(l)return Ld.placeholder;const _=a[o.type.name];return typeof _=="string"?_:_==null?void 0:_(o.attrs)}const y=g();return A(y)&&y||""}function gC(e){return e.split("-")[1]}function GJ(e){return e==="y"?"height":"width"}function js(e){return e.split("-")[0]}function rg(e){return["top","bottom"].includes(js(e))?"x":"y"}function gD(e,t,n){let{reference:r,floating:i}=e;const o=r.x+r.width/2-i.width/2,a=r.y+r.height/2-i.height/2,s=rg(t),u=GJ(s),l=r[u]/2-i[u]/2,c=s==="x";let f;switch(js(t)){case"top":f={x:o,y:r.y-i.height};break;case"bottom":f={x:o,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:a};break;case"left":f={x:r.x-i.width,y:a};break;default:f={x:r.x,y:r.y}}switch(gC(t)){case"start":f[s]-=l*(n&&c?-1:1);break;case"end":f[s]+=l*(n&&c?-1:1)}return f}const S4e=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=gD(l,r,u),p=r,h={},A=0;for(let g=0;g<s.length;g++){const{name:y,fn:C}=s[g],{x:_,y:b,data:v,reset:S}=await C({x:c,y:f,initialPlacement:r,placement:p,strategy:i,middlewareData:h,rects:l,platform:a,elements:{reference:e,floating:t}});c=_??c,f=b??f,h={...h,[y]:{...h[y],...v}},S&&A<=50&&(A++,typeof S=="object"&&(S.placement&&(p=S.placement),S.rects&&(l=S.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):S.rects),{x:c,y:f}=gD(l,p,u)),g=-1)}return{x:c,y:f,placement:p,strategy:i,middlewareData:h}};function w4e(e){return typeof e!="number"?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(e):{top:e,right:e,bottom:e,left:e}}function j_(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function JJ(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=t,A=w4e(h),g=s[p?f==="floating"?"reference":"floating":f],y=j_(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(g)))==null||n?g:g.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:l,rootBoundary:c,strategy:u})),C=f==="floating"?{...a.floating,x:r,y:i}:a.reference,_=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),b=await(o.isElement==null?void 0:o.isElement(_))&&await(o.getScale==null?void 0:o.getScale(_))||{x:1,y:1},v=j_(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:C,offsetParent:_,strategy:u}):C);return{top:(y.top-v.top+A.top)/b.y,bottom:(v.bottom-y.bottom+A.bottom)/b.y,left:(y.left-v.left+A.left)/b.x,right:(v.right-y.right+A.right)/b.x}}const _4e=Math.min,x4e=Math.max;function vD(e,t,n){return x4e(e,_4e(t,n))}const T4e=["top","right","bottom","left"];T4e.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const I4e={left:"right",right:"left",bottom:"top",top:"bottom"};function iy(e){return e.replace(/left|right|bottom|top/g,t=>I4e[t])}function E4e(e,t,n){n===void 0&&(n=!1);const r=gC(e),i=rg(e),o=GJ(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=iy(a)),{main:a,cross:iy(a)}}const R4e={start:"end",end:"start"};function lw(e){return e.replace(/start|end/g,t=>R4e[t])}const $4e=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:s,elements:u}=t,{mainAxis:l=!0,crossAxis:c=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:A=!0,...g}=e,y=js(r),C=js(a)===a,_=await(s.isRTL==null?void 0:s.isRTL(u.floating)),b=f||(C||!A?[iy(a)]:function($){const B=iy($);return[lw($),B,lw(B)]}(a));f||h==="none"||b.push(...function($,B,K,H){const z=gC($);let N=function(Y,ee,F){const M=["left","right"],W=["right","left"],re=["top","bottom"],Ie=["bottom","top"];switch(Y){case"top":case"bottom":return F?ee?W:M:ee?M:W;case"left":case"right":return ee?re:Ie;default:return[]}}(js($),K==="start",H);return z&&(N=N.map(Y=>Y+"-"+z),B&&(N=N.concat(N.map(lw)))),N}(a,A,h,_));const v=[a,...b],S=await JJ(t,g),w=[];let T=((n=i.flip)==null?void 0:n.overflows)||[];if(l&&w.push(S[y]),c){const{main:$,cross:B}=E4e(r,o,_);w.push(S[$],S[B])}if(T=[...T,{placement:r,overflows:w}],!w.every($=>$<=0)){var E,R;const $=(((E=i.flip)==null?void 0:E.index)||0)+1,B=v[$];if(B)return{data:{index:$,overflows:T},reset:{placement:B}};let K=(R=T.filter(H=>H.overflows[0]<=0).sort((H,z)=>H.overflows[1]-z.overflows[1])[0])==null?void 0:R.placement;if(!K)switch(p){case"bestFit":{var O;const H=(O=T.map(z=>[z.placement,z.overflows.filter(N=>N>0).reduce((N,Y)=>N+Y,0)]).sort((z,N)=>z[1]-N[1])[0])==null?void 0:O[0];H&&(K=H);break}case"initialPlacement":K=a}if(r!==K)return{reset:{placement:K}}}return{}}}},k4e=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await async function(o,a){const{placement:s,platform:u,elements:l}=o,c=await(u.isRTL==null?void 0:u.isRTL(l.floating)),f=js(s),p=gC(s),h=rg(s)==="x",A=["left","top"].includes(f)?-1:1,g=c&&h?-1:1,y=typeof a=="function"?a(o):a;let{mainAxis:C,crossAxis:_,alignmentAxis:b}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...y};return p&&typeof b=="number"&&(_=p==="end"?-1*b:b),h?{x:_*g,y:C*A}:{x:C*A,y:_*g}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function ZJ(e){return e==="x"?"y":"x"}const O4e=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:y=>{let{x:C,y:_}=y;return{x:C,y:_}}},...u}=e,l={x:n,y:r},c=await JJ(t,u),f=rg(js(i)),p=ZJ(f);let h=l[f],A=l[p];if(o){const y=f==="y"?"bottom":"right";h=vD(h+c[f==="y"?"top":"left"],h,h-c[y])}if(a){const y=p==="y"?"bottom":"right";A=vD(A+c[p==="y"?"top":"left"],A,A-c[y])}const g=s.fn({...t,[f]:h,[p]:A});return{...g,data:{x:g.x-n,y:g.y-r}}}}},M4e=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:u=!0,crossAxis:l=!0}=e,c={x:n,y:r},f=rg(i),p=ZJ(f);let h=c[f],A=c[p];const g=typeof s=="function"?s(t):s,y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(u){const b=f==="y"?"height":"width",v=o.reference[f]-o.floating[b]+y.mainAxis,S=o.reference[f]+o.reference[b]-y.mainAxis;h<v?h=v:h>S&&(h=S)}if(l){var C,_;const b=f==="y"?"width":"height",v=["top","left"].includes(js(i)),S=o.reference[p]-o.floating[b]+(v&&((C=a.offset)==null?void 0:C[p])||0)+(v?0:y.crossAxis),w=o.reference[p]+o.reference[b]+(v?0:((_=a.offset)==null?void 0:_[p])||0)-(v?y.crossAxis:0);A<S?A=S:A>w&&(A=w)}return{[f]:h,[p]:A}}}};function ti(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ro(e){return ti(e).getComputedStyle(e)}const yD=Math.min,Xp=Math.max,oy=Math.round;function XJ(e){const t=Ro(e);let n=parseFloat(t.width),r=parseFloat(t.height);const i=e.offsetWidth,o=e.offsetHeight,a=oy(n)!==i||oy(r)!==o;return a&&(n=i,r=o),{width:n,height:r,fallback:a}}function Hs(e){return tZ(e)?(e.nodeName||"").toLowerCase():""}let kg;function eZ(){if(kg)return kg;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(kg=e.brands.map(t=>t.brand+"/"+t.version).join(" "),kg):navigator.userAgent}function $o(e){return e instanceof ti(e).HTMLElement}function Yi(e){return e instanceof ti(e).Element}function tZ(e){return e instanceof ti(e).Node}function bD(e){return typeof ShadowRoot>"u"?!1:e instanceof ti(e).ShadowRoot||e instanceof ShadowRoot}function vC(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Ro(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function F4e(e){return["table","td","th"].includes(Hs(e))}function L_(e){const t=/firefox/i.test(eZ()),n=Ro(e),r=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!=="none"||n.perspective!=="none"||!!r&&r!=="none"||t&&n.willChange==="filter"||t&&!!n.filter&&n.filter!=="none"||["transform","perspective"].some(i=>n.willChange.includes(i))||["paint","layout","strict","content"].some(i=>{const o=n.contain;return o!=null&&o.includes(i)})}function D_(){return/^((?!chrome|android).)*safari/i.test(eZ())}function WF(e){return["html","body","#document"].includes(Hs(e))}function nZ(e){return Yi(e)?e:e.contextElement}const rZ={x:1,y:1};function ad(e){const t=nZ(e);if(!$o(t))return rZ;const n=t.getBoundingClientRect(),{width:r,height:i,fallback:o}=XJ(t);let a=(o?oy(n.width):n.width)/r,s=(o?oy(n.height):n.height)/i;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}function Rl(e,t,n,r){var i,o;t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),s=nZ(e);let u=rZ;t&&(r?Yi(r)&&(u=ad(r)):u=ad(e));const l=s?ti(s):window,c=D_()&&n;let f=(a.left+(c&&((i=l.visualViewport)==null?void 0:i.offsetLeft)||0))/u.x,p=(a.top+(c&&((o=l.visualViewport)==null?void 0:o.offsetTop)||0))/u.y,h=a.width/u.x,A=a.height/u.y;if(s){const g=ti(s),y=r&&Yi(r)?ti(r):r;let C=g.frameElement;for(;C&&r&&y!==g;){const _=ad(C),b=C.getBoundingClientRect(),v=getComputedStyle(C);b.x+=(C.clientLeft+parseFloat(v.paddingLeft))*_.x,b.y+=(C.clientTop+parseFloat(v.paddingTop))*_.y,f*=_.x,p*=_.y,h*=_.x,A*=_.y,f+=b.x,p+=b.y,C=ti(C).frameElement}}return{width:h,height:A,top:p,right:f+h,bottom:p+A,left:f,x:f,y:p}}function Ls(e){return((tZ(e)?e.ownerDocument:e.document)||window.document).documentElement}function yC(e){return Yi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function iZ(e){return Rl(Ls(e)).left+yC(e).scrollLeft}function zh(e){if(Hs(e)==="html")return e;const t=e.assignedSlot||e.parentNode||bD(e)&&e.host||Ls(e);return bD(t)?t.host:t}function oZ(e){const t=zh(e);return WF(t)?t.ownerDocument.body:$o(t)&&vC(t)?t:oZ(t)}function sl(e,t){var n;t===void 0&&(t=[]);const r=oZ(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=ti(r);return i?t.concat(o,o.visualViewport||[],vC(r)?r:[]):t.concat(r,sl(r))}function CD(e,t,n){let r;if(t==="viewport")r=function(a,s){const u=ti(a),l=Ls(a),c=u.visualViewport;let f=l.clientWidth,p=l.clientHeight,h=0,A=0;if(c){f=c.width,p=c.height;const g=D_();(!g||g&&s==="fixed")&&(h=c.offsetLeft,A=c.offsetTop)}return{width:f,height:p,x:h,y:A}}(e,n);else if(t==="document")r=function(a){const s=Ls(a),u=yC(a),l=a.ownerDocument.body,c=Xp(s.scrollWidth,s.clientWidth,l.scrollWidth,l.clientWidth),f=Xp(s.scrollHeight,s.clientHeight,l.scrollHeight,l.clientHeight);let p=-u.scrollLeft+iZ(a);const h=-u.scrollTop;return Ro(l).direction==="rtl"&&(p+=Xp(s.clientWidth,l.clientWidth)-c),{width:c,height:f,x:p,y:h}}(Ls(e));else if(Yi(t))r=function(a,s){const u=Rl(a,!0,s==="fixed"),l=u.top+a.clientTop,c=u.left+a.clientLeft,f=$o(a)?ad(a):{x:1,y:1};return{width:a.clientWidth*f.x,height:a.clientHeight*f.y,x:c*f.x,y:l*f.y}}(t,n);else{const a={...t};if(D_()){var i,o;const s=ti(e);a.x-=((i=s.visualViewport)==null?void 0:i.offsetLeft)||0,a.y-=((o=s.visualViewport)==null?void 0:o.offsetTop)||0}r=a}return j_(r)}function SD(e,t){return $o(e)&&Ro(e).position!=="fixed"?t?t(e):e.offsetParent:null}function wD(e,t){const n=ti(e);let r=SD(e,t);for(;r&&F4e(r)&&Ro(r).position==="static";)r=SD(r,t);return r&&(Hs(r)==="html"||Hs(r)==="body"&&Ro(r).position==="static"&&!L_(r))?n:r||function(i){let o=zh(i);for(;$o(o)&&!WF(o);){if(L_(o))return o;o=zh(o)}return null}(e)||n}function j4e(e,t,n){const r=$o(t),i=Ls(t),o=Rl(e,!0,n==="fixed",t);let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&n!=="fixed")if((Hs(t)!=="body"||vC(i))&&(a=yC(t)),$o(t)){const u=Rl(t,!0);s.x=u.x+t.clientLeft,s.y=u.y+t.clientTop}else i&&(s.x=iZ(i));return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}const L4e={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=n==="clippingAncestors"?function(l,c){const f=c.get(l);if(f)return f;let p=sl(l).filter(y=>Yi(y)&&Hs(y)!=="body"),h=null;const A=Ro(l).position==="fixed";let g=A?zh(l):l;for(;Yi(g)&&!WF(g);){const y=Ro(g),C=L_(g);y.position==="fixed"?h=null:(A?C||h:C||y.position!=="static"||!h||!["absolute","fixed"].includes(h.position))?h=y:p=p.filter(_=>_!==g),g=zh(g)}return c.set(l,p),p}(t,this._c):[].concat(n),a=[...o,r],s=a[0],u=a.reduce((l,c)=>{const f=CD(t,c,i);return l.top=Xp(f.top,l.top),l.right=yD(f.right,l.right),l.bottom=yD(f.bottom,l.bottom),l.left=Xp(f.left,l.left),l},CD(t,s,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=$o(n),o=Ls(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0},s={x:1,y:1};const u={x:0,y:0};if((i||!i&&r!=="fixed")&&((Hs(n)!=="body"||vC(o))&&(a=yC(n)),$o(n))){const l=Rl(n);s=ad(n),u.x=l.x+n.clientLeft,u.y=l.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-a.scrollLeft*s.x+u.x,y:t.y*s.y-a.scrollTop*s.y+u.y}},isElement:Yi,getDimensions:function(e){return $o(e)?XJ(e):e.getBoundingClientRect()},getOffsetParent:wD,getDocumentElement:Ls,getScale:ad,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||wD,o=this.getDimensions;return{reference:j4e(t,await i(n),r),floating:{x:0,y:0,...await o(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>Ro(e).direction==="rtl"};function D4e(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:s=!1}=r,u=i&&!s,l=u||o?[...Yi(e)?sl(e):e.contextElement?sl(e.contextElement):[],...sl(t)]:[];l.forEach(h=>{u&&h.addEventListener("scroll",n,{passive:!0}),o&&h.addEventListener("resize",n)});let c,f=null;if(a){let h=!0;f=new ResizeObserver(()=>{h||n(),h=!1}),Yi(e)&&!s&&f.observe(e),Yi(e)||!e.contextElement||s||f.observe(e.contextElement),f.observe(t)}let p=s?Rl(e):null;return s&&function h(){const A=Rl(e);!p||A.x===p.x&&A.y===p.y&&A.width===p.width&&A.height===p.height||n(),p=A,c=requestAnimationFrame(h)}(),n(),()=>{var h;l.forEach(A=>{u&&A.removeEventListener("scroll",n),o&&A.removeEventListener("resize",n)}),(h=f)==null||h.disconnect(),f=null,s&&cancelAnimationFrame(c)}}const U4e=(e,t,n)=>{const r=new Map,i={platform:L4e,...n},o={...i.platform,_c:r};return S4e(e,t,{...i,platform:o})};var tv=typeof document<"u"?I.useLayoutEffect:I.useEffect;function ay(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!ay(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!ay(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function _D(e){const t=Fe.useRef(e);return tv(()=>{t.current=e}),t}function B4e(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,whileElementsMounted:o,open:a}=e,[s,u]=Fe.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[l,c]=Fe.useState(r);ay(l,r)||c(r);const f=Fe.useRef(null),p=Fe.useRef(null),h=Fe.useRef(s),A=_D(o),g=_D(i),[y,C]=Fe.useState(null),[_,b]=Fe.useState(null),v=Fe.useCallback(O=>{f.current!==O&&(f.current=O,C(O))},[]),S=Fe.useCallback(O=>{p.current!==O&&(p.current=O,b(O))},[]),w=Fe.useCallback(()=>{if(!f.current||!p.current)return;const O={placement:t,strategy:n,middleware:l};g.current&&(O.platform=g.current),U4e(f.current,p.current,O).then($=>{const B={...$,isPositioned:!0};T.current&&!ay(h.current,B)&&(h.current=B,AX.flushSync(()=>{u(B)}))})},[l,t,n,g]);tv(()=>{a===!1&&h.current.isPositioned&&(h.current.isPositioned=!1,u(O=>({...O,isPositioned:!1})))},[a]);const T=Fe.useRef(!1);tv(()=>(T.current=!0,()=>{T.current=!1}),[]),tv(()=>{if(y&&_){if(A.current)return A.current(y,_,w);w()}},[y,_,w,A]);const E=Fe.useMemo(()=>({reference:f,floating:p,setReference:v,setFloating:S}),[v,S]),R=Fe.useMemo(()=>({reference:y,floating:_}),[y,_]);return Fe.useMemo(()=>({...s,update:w,refs:E,elements:R,reference:v,floating:S}),[s,w,E,R,v,S])}var $s=typeof document<"u"?I.useLayoutEffect:I.useEffect;function P4e(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter(r=>r!==n))}}}let cw=!1,W4e=0;const xD=()=>"floating-ui-"+W4e++;function N4e(){const[e,t]=Fe.useState(()=>cw?xD():void 0);return $s(()=>{e==null&&t(xD())},[]),Fe.useEffect(()=>{cw||(cw=!0)},[]),e}const TD=Fe["useId".toString()],ID=TD??N4e,K4e=Fe.createContext(null),q4e=Fe.createContext(null),aZ=()=>{var e,t;return(e=(t=Fe.useContext(K4e))==null?void 0:t.id)!=null?e:null},NF=()=>Fe.useContext(q4e);function KF(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function sZ(e){var t;return(t=KF(e).defaultView)!=null?t:window}function nv(e){return e?e instanceof sZ(e).Element:!1}function V4e(e){return e?e instanceof sZ(e).HTMLElement:!1}const ED=Fe["useInsertionEffect".toString()];function U_(e){const t=Fe.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return ED?ED(()=>{t.current=e}):t.current=e,Fe.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function z4e(e){let{open:t=!1,onOpenChange:n,whileElementsMounted:r,placement:i,middleware:o,strategy:a,nodeId:s}=e===void 0?{}:e;const[u,l]=Fe.useState(null),c=NF(),f=Fe.useRef(null),p=Fe.useRef({}),h=Fe.useState(()=>P4e())[0],A=B4e({placement:i,middleware:o,strategy:a,whileElementsMounted:r}),g=U_(n),y=Fe.useMemo(()=>({...A.refs,domReference:f}),[A.refs]),C=Fe.useMemo(()=>({...A,refs:y,dataRef:p,nodeId:s,events:h,open:t,onOpenChange:g,_:{domReference:u}}),[A,s,h,t,g,y,u]);$s(()=>{const v=c==null?void 0:c.nodesRef.current.find(S=>S.id===s);v&&(v.context=C)});const{reference:_}=A,b=Fe.useCallback(v=>{(nv(v)||v===null)&&(C.refs.domReference.current=v,l(v)),_(v)},[_,C.refs]);return Fe.useMemo(()=>({...A,context:C,refs:y,reference:b}),[A,y,C,b])}function dw(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(i=>i?i[n]:null).concat(e).reduce((i,o)=>(o&&Object.entries(o).forEach(a=>{let[s,u]=a;if(s.indexOf("on")===0){if(r.has(s)||r.set(s,[]),typeof u=="function"){var l;(l=r.get(s))==null||l.push(u),i[s]=function(){for(var c,f=arguments.length,p=new Array(f),h=0;h<f;h++)p[h]=arguments[h];(c=r.get(s))==null||c.forEach(A=>A(...p))}}}else i[s]=u}),i),{})}}const Q4e=function(e){return e===void 0&&(e=[]),{getReferenceProps:t=>dw(t,e,"reference"),getFloatingProps:t=>dw(t,e,"floating"),getItemProps:t=>dw(t,e,"item")}};function fw(e,t){var n;let r=(n=e.filter(a=>{var s;return a.parentId===t&&((s=a.context)==null?void 0:s.open)}))!=null?n:[],i=r;for(;i.length;){var o;i=(o=e.filter(a=>{var s;return(s=i)==null?void 0:s.some(u=>{var l;return a.parentId===u.id&&((l=a.context)==null?void 0:l.open)})}))!=null?o:[],r=r.concat(i)}return r}function RD(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function H4e(e){return"composedPath"in e?e.composedPath()[0]:e.target}function vs(e){e.preventDefault(),e.stopPropagation()}function Y4e(e){const t=I.useRef(e);return $s(()=>{t.current=e}),t}function $D(e){const t=I.useRef();return $s(()=>{t.current=e},[e]),t.current}const G4e=function(e,t){let{open:n}=e,{enabled:r=!0,role:i="dialog"}=t===void 0?{}:t;const o=ID(),a=ID(),s={id:o,role:i};return r?i==="tooltip"?{reference:{"aria-describedby":n?o:void 0},floating:s}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":i==="alertdialog"?"dialog":i,"aria-controls":n?o:void 0,...i==="listbox"&&{role:"combobox"},...i==="menu"&&{id:a}},floating:{...s,...i==="menu"&&{"aria-labelledby":a}}}:{}};function pw(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}const J4e=function(e,t){let{open:n,onOpenChange:r,refs:i,events:o,nodeId:a}=e,{enabled:s=!0,escapeKey:u=!0,outsidePointerDown:l=!0,referencePointerDown:c=!1,ancestorScroll:f=!1,bubbles:p=!0}=t===void 0?{}:t;const h=NF(),A=aZ()!=null,g=Fe.useRef(!1);return Fe.useEffect(()=>{if(!n||!s)return;function y(S){if(S.key==="Escape"){if(!p&&h&&fw(h.nodesRef.current,a).length>0)return;o.emit("dismiss",{preventScroll:!1}),r(!1)}}function C(S){const w=g.current;if(g.current=!1,w)return;const T=H4e(S);if(nv(T)&&i.floating.current){var E;const O=(E=i.floating.current.ownerDocument.defaultView)!=null?E:window,$=T.scrollWidth>T.clientWidth,B=T.scrollHeight>T.clientHeight;let K=B&&S.offsetX>T.clientWidth;if(B&&O.getComputedStyle(T).direction==="rtl"&&(K=S.offsetX<=T.offsetWidth-T.clientWidth),K||$&&S.offsetY>T.clientHeight)return}const R=h&&fw(h.nodesRef.current,a).some(O=>{var $;return pw(S,($=O.context)==null?void 0:$.refs.floating.current)});pw(S,i.floating.current)||pw(S,i.domReference.current)||R||!p&&h&&fw(h.nodesRef.current,a).length>0||(o.emit("dismiss",A?{preventScroll:!0}:!1),r(!1))}function _(){r(!1)}const b=KF(i.floating.current);u&&b.addEventListener("keydown",y),l&&b.addEventListener("pointerdown",C);const v=(f?[...nv(i.reference.current)?sl(i.reference.current):[],...nv(i.floating.current)?sl(i.floating.current):[]]:[]).filter(S=>{var w;return S!==((w=b.defaultView)==null?void 0:w.visualViewport)});return v.forEach(S=>S.addEventListener("scroll",_,{passive:!0})),()=>{u&&b.removeEventListener("keydown",y),l&&b.removeEventListener("pointerdown",C),v.forEach(S=>S.removeEventListener("scroll",_))}},[u,l,o,h,a,n,r,f,s,p,i,A]),s?{reference:{onPointerDown(){c&&(o.emit("dismiss"),r(!1))}},floating:{onPointerDownCapture(){g.current=!0}}}:{}},qF="ArrowUp",bC="ArrowDown",Dd="ArrowLeft",ig="ArrowRight";function Og(e,t,n){return Math.floor(e/t)!==n}function wp(e,t){return t<0||t>=e.current.length}function Yn(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=t===void 0?{}:t;const a=e.current;let s=n;do{var u,l;s=s+(r?-o:o)}while(s>=0&&s<=a.length-1&&(i?i.includes(s):a[s]==null||(u=a[s])!=null&&u.hasAttribute("disabled")||((l=a[s])==null?void 0:l.getAttribute("aria-disabled"))==="true"));return s}function CC(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function kD(e,t){return CC(t,e===qF||e===bC,e===Dd||e===ig)}function hw(e,t,n){return CC(t,e===bC,n?e===Dd:e===ig)||e==="Enter"||e==" "||e===""}function Z4e(e,t,n){return CC(t,n?e===Dd:e===ig,e===bC)}function X4e(e,t,n){return CC(t,n?e===ig:e===Dd,e===qF)}function Aw(e,t){return Yn(e,{disabledIndices:t})}function OD(e,t){return Yn(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}const e9e=function(e,t){let{open:n,onOpenChange:r,refs:i}=e,{listRef:o,activeIndex:a,onNavigate:s=()=>{},enabled:u=!0,selectedIndex:l=null,allowEscape:c=!1,loop:f=!1,nested:p=!1,rtl:h=!1,virtual:A=!1,focusItemOnOpen:g="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:C=!0,disabledIndices:_=void 0,orientation:b="vertical",cols:v=1}=t===void 0?{listRef:{current:[]},activeIndex:null,onNavigate:()=>{}}:t;process.env.NODE_ENV!=="production"&&(c&&(f||console.warn(["Floating UI: `useListNavigation` looping must be enabled to allow","escaping."].join(" ")),A||console.warn(["Floating UI: `useListNavigation` must be virtual to allow","escaping."].join(" "))),b==="vertical"&&v>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const S=aZ(),w=NF(),T=$D(n),E=U_(s),R=U_($D(s)),O=Fe.useRef(g),$=Fe.useRef(l??-1),B=Fe.useRef(null),K=Y4e(_),H=Fe.useRef(!1),z=Fe.useRef(-1),[N,Y]=Fe.useState(),ee=Fe.useCallback((M,W)=>{z.current=requestAnimationFrame(()=>{if(A){var re;Y((re=M.current[W.current])==null?void 0:re.id)}else{var Ie;(Ie=M.current[W.current])==null||Ie.focus({preventScroll:!0})}})},[A]);$s(()=>{u&&(!T&&n&&O.current&&l!=null&&E(l),T&&!n&&(cancelAnimationFrame(z.current),$.current=-1,R(null)))},[n,T,l,o,ee,u,E,R]),$s(()=>{if(u&&n)if(a==null){if(l!=null)return;T&&($.current=-1,ee(o,$)),!T&&O.current&&(B.current!=null||O.current===!0&&B.current==null)&&($.current=B.current==null||hw(B.current,b,h)||p?Aw(o,K.current):OD(o,K.current),E($.current),ee(o,$))}else wp(o,a)||($.current=a,ee(o,$))},[n,T,a,l,p,o,E,ee,u,c,b,h,A,K]),$s(()=>{if(u&&!n&&T){var M,W;const re=w==null||(M=w.nodesRef.current.find(Ie=>Ie.id===S))==null||(W=M.context)==null?void 0:W.refs.floating.current;re&&!re.contains(RD(KF(re)))&&re.focus({preventScroll:!0})}},[u,n,T,w,S]),$s(()=>{B.current=null});function F(M){if(H.current=!0,p&&X4e(M.key,b,h)){vs(M),r(!1),V4e(i.domReference.current)&&i.domReference.current.focus();return}const W=$.current,re=Aw(o,_),Ie=OD(o,_);if(M.key==="Home"&&($.current=re,E($.current)),M.key==="End"&&($.current=Ie,E($.current)),v>1){const Ce=$.current;if(M.key===qF){if(vs(M),Ce===-1)$.current=Ie;else if($.current=Yn(o,{startingIndex:Ce,amount:v,decrement:!0,disabledIndices:_}),f&&(Ce-v<re||$.current<0)){const P=Ce%v,ae=Ie%v,Ge=Ie-(ae-P);ae===P?$.current=Ie:$.current=ae>P?Ge:Ge-v}wp(o,$.current)&&($.current=Ce),E($.current)}if(M.key===bC&&(vs(M),Ce===-1?$.current=re:($.current=Yn(o,{startingIndex:Ce,amount:v,disabledIndices:_}),f&&Ce+v>Ie&&($.current=Yn(o,{startingIndex:Ce%v-v,amount:v,disabledIndices:_}))),wp(o,$.current)&&($.current=Ce),E($.current)),b==="both"){const P=Math.floor(Ce/v);M.key===ig&&(vs(M),Ce%v!==v-1?($.current=Yn(o,{startingIndex:Ce,disabledIndices:_}),f&&Og($.current,v,P)&&($.current=Yn(o,{startingIndex:Ce-Ce%v-1,disabledIndices:_}))):f&&($.current=Yn(o,{startingIndex:Ce-Ce%v-1,disabledIndices:_})),Og($.current,v,P)&&($.current=Ce)),M.key===Dd&&(vs(M),Ce%v!==0?($.current=Yn(o,{startingIndex:Ce,disabledIndices:_,decrement:!0}),f&&Og($.current,v,P)&&($.current=Yn(o,{startingIndex:Ce+(v-Ce%v),decrement:!0,disabledIndices:_}))):f&&($.current=Yn(o,{startingIndex:Ce+(v-Ce%v),decrement:!0,disabledIndices:_})),Og($.current,v,P)&&($.current=Ce));const ae=Math.floor(Ie/v)===P;wp(o,$.current)&&(f&&ae?$.current=M.key===Dd?Ie:Yn(o,{startingIndex:Ce-Ce%v-1,disabledIndices:_}):$.current=Ce),E($.current);return}}if(kD(M.key,b)){if(vs(M),n&&!A&&RD(M.currentTarget.ownerDocument)===M.currentTarget){$.current=hw(M.key,b,h)?re:Ie,E($.current);return}hw(M.key,b,h)?f?$.current=W>=Ie?c&&W!==o.current.length?-1:re:Yn(o,{startingIndex:W,disabledIndices:_}):$.current=Math.min(Ie,Yn(o,{startingIndex:W,disabledIndices:_})):f?$.current=W<=re?c&&W!==-1?o.current.length:Ie:Yn(o,{startingIndex:W,decrement:!0,disabledIndices:_}):$.current=Math.max(re,Yn(o,{startingIndex:W,decrement:!0,disabledIndices:_})),wp(o,$.current)?E(null):E($.current)}}return u?{reference:{...A&&n&&a!=null&&{"aria-activedescendant":N},onKeyDown(M){if(H.current=!0,A&&n)return F(M);if((M.key.indexOf("Arrow")===0||M.key==="Enter"||M.key===" "||M.key==="")&&(B.current=M.key),p){Z4e(M.key,b,h)&&(vs(M),n?($.current=Aw(o,_),E($.current)):r(!0));return}kD(M.key,b)&&(l!=null&&($.current=l),vs(M),!n&&C?r(!0):F(M),n&&E($.current))}},floating:{"aria-orientation":b==="both"?void 0:b,...A&&a!=null&&{"aria-activedescendant":N},onKeyDown:F,onPointerMove(){H.current=!1}},item:{onFocus(M){let{currentTarget:W}=M;const re=o.current.indexOf(W);re!==-1&&E(re)},onClick:M=>{let{currentTarget:W}=M;return W.focus({preventScroll:!0})},...y&&{onMouseMove(M){let{currentTarget:W}=M;const re=W;if(re){const Ie=o.current.indexOf(re);Ie!==-1&&E(Ie)}},onPointerLeave(){if(!H.current&&($.current=-1,ee(o,$),E(null),!A)){var M;(M=i.floating.current)==null||M.focus({preventScroll:!0})}}}}}:{}};function t9e(e){var t;const{char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:o,startOfLine:a,$position:s}=e,u=r&&!i,l=d3e(n),c=new RegExp(`\\s${l}$`),f=a?"^":"",p=i?"":l,h=u?new RegExp(`${f}${l}.*?(?=\\s${p}|$)`,"gm"):new RegExp(`${f}(?:^)?${l}[^\\s${p}]*`,"gm"),A=((t=s.nodeBefore)===null||t===void 0?void 0:t.isText)&&s.nodeBefore.text;if(!A)return null;const g=s.pos-A.length,y=Array.from(A.matchAll(h)).pop();if(!y||y.input===void 0||y.index===void 0)return null;const C=y.input.slice(Math.max(0,y.index-1),y.index),_=new RegExp(`^[${o==null?void 0:o.join("")}\0]?$`).test(C);if(o!==null&&!_)return null;const b=g+y.index;let v=b+y[0].length;return u&&c.test(A.slice(v-1,v+1))&&(y[0]+=" ",v+=1),b<s.pos&&v>=s.pos?{range:{from:b,to:v},query:y[0].slice(n.length),text:y[0]}:null}const n9e=new rr("suggestion");function r9e({pluginKey:e=n9e,editor:t,char:n="@",allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:o=[" "],startOfLine:a=!1,decorationTag:s="span",decorationClass:u="suggestion",command:l=()=>null,items:c=()=>[],render:f=()=>({}),allow:p=()=>!0,findSuggestionMatch:h=t9e}){let A;const g=f==null?void 0:f(),y=new Kn({key:e,view(){return{update:async(C,_)=>{var b,v,S,w,T,E,R;const O=(b=this.key)===null||b===void 0?void 0:b.getState(_),$=(v=this.key)===null||v===void 0?void 0:v.getState(C.state),B=O.active&&$.active&&O.range.from!==$.range.from,K=!O.active&&$.active,H=O.active&&!$.active,z=!K&&!H&&O.query!==$.query,N=K||B&&z,Y=z||B,ee=H||B&&z;if(!N&&!Y&&!ee)return;const F=ee&&!N?O:$,M=C.dom.querySelector(`[data-decoration-id="${F.decorationId}"]`);A={editor:t,range:F.range,query:F.query,text:F.text,items:[],command:W=>l({editor:t,range:F.range,props:W}),decorationNode:M,clientRect:M?()=>{var W;const{decorationId:re}=(W=this.key)===null||W===void 0?void 0:W.getState(t.state),Ie=C.dom.querySelector(`[data-decoration-id="${re}"]`);return(Ie==null?void 0:Ie.getBoundingClientRect())||null}:null},N&&((S=g==null?void 0:g.onBeforeStart)===null||S===void 0||S.call(g,A)),Y&&((w=g==null?void 0:g.onBeforeUpdate)===null||w===void 0||w.call(g,A)),(Y||N)&&(A.items=await c({editor:t,query:F.query})),ee&&((T=g==null?void 0:g.onExit)===null||T===void 0||T.call(g,A)),Y&&((E=g==null?void 0:g.onUpdate)===null||E===void 0||E.call(g,A)),N&&((R=g==null?void 0:g.onStart)===null||R===void 0||R.call(g,A))},destroy:()=>{var C;A&&((C=g==null?void 0:g.onExit)===null||C===void 0||C.call(g,A))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(C,_,b,v){const{isEditable:S}=t,{composing:w}=t.view,{selection:T}=C,{empty:E,from:R}=T,O={..._};if(O.composing=w,S&&(E||t.view.composing)){(R<_.range.from||R>_.range.to)&&!w&&!_.composing&&(O.active=!1);const $=h({char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:o,startOfLine:a,$position:T.$from}),B=`id_${Math.floor(Math.random()*4294967295)}`;$&&p({editor:t,state:v,range:$.range,isActive:_.active})?(O.active=!0,O.decorationId=_.decorationId?_.decorationId:B,O.range=$.range,O.query=$.query,O.text=$.text):O.active=!1}else O.active=!1;return O.active||(O.decorationId=null,O.range={from:0,to:0},O.query=null,O.text=null),O}},props:{handleKeyDown(C,_){var b;const{active:v,range:S}=y.getState(C.state);return v&&((b=g==null?void 0:g.onKeyDown)===null||b===void 0?void 0:b.call(g,{view:C,event:_,range:S}))||!1},decorations(C){const{active:_,range:b,decorationId:v}=y.getState(C);return _?Mt.create(C.doc,[$r.inline(b.from,b.to,{nodeName:s,class:u,"data-decoration-id":v})]):null}}});return y}const uZ=["ArrowDown","ArrowUp","End","Home"],lZ=["Enter"],i9e=["Escape",...uZ,...lZ],o9e=Fn.create({name:"slash-commands",addOptions(){return{nodeTypes:[]}},addProseMirrorPlugins(){const e=av(ZZ,this.options.nodeTypes);return e.length>1?[r9e({allowSpaces:!0,char:"/",editor:this.editor,startOfLine:!0,allow:({state:t})=>{const n=t.selection.$from;return n.parent.type.name===Mr.name&&n.depth===1},command:({editor:t,props:n,range:r})=>{n.runCommands(t,{deleteRange:r})},items:({query:t})=>{const n=t.toLocaleLowerCase().trim();return e.filter(r=>{var i,o;return((i=r.shortText)==null?void 0:i.toLocaleLowerCase().includes(n))||((o=r.text)==null?void 0:o.toLocaleLowerCase().includes(n))})},render:()=>{let t;return{onStart:n=>{t=new UJ(a9e,{editor:n.editor,props:n}),document.body.appendChild(t.element)},onUpdate:n=>{t==null||t.updateProps(n)},onKeyDown:({event:n})=>{var r;return!!(i9e.includes(n.key)&&((r=t==null?void 0:t.ref)!=null&&r.handleKeyDown(n)))},onExit:()=>{t==null||t.destroy(),t==null||t.element.remove()}}}})]:[]}}),a9e=I.forwardRef(function(t,n){const{command:r,decorationNode:i,editor:o,items:a}=t,[s,u]=I.useState(!0),{context:l,floating:c,reference:f,x:p,y:h}=z4e({middleware:[k4e(0),$4e(),O4e({limiter:M4e()})],onOpenChange:u,open:s,placement:"top-start",strategy:"fixed",whileElementsMounted:D4e});I.useLayoutEffect(()=>{f(i)},[f,i]),I.useEffect(()=>{let T;const E=()=>{T=window.setTimeout(()=>{u(!0)})},R=()=>{u(!1)};return o.on("focus",E).on("blur",R),()=>{o.off("focus",E).off("blur",R),clearTimeout(T)}},[o]);const[A,g]=I.useState(0),y=I.useRef([]);ze.useOnChange(a,()=>{g(0),y.current=[]});const{getFloatingProps:C,getItemProps:_,getReferenceProps:b}=Q4e([J4e(l,{outsidePointerDown:!1}),e9e(l,{activeIndex:A,listRef:y,onNavigate:T=>{g(E=>T??E)},openOnArrowKeyDown:!1,virtual:!0}),G4e(l,{role:"menu"})]),S=b().onKeyDown;I.useImperativeHandle(n,()=>({handleKeyDown:T=>{if(s){if(uZ.includes(T.key)&&S(T),lZ.includes(T.key)){const E=a[A];E!==void 0&&r(E)}return!0}else return!1}}),[A,r,a,S,s]);const w=p!==null&&h!==null;return s?d.jsxs(m.Box,{...C(),minWidth:256,backgroundColor:"grey1",border:!0,borderStyle:"solid",borderRadius:6,flexDirection:"column",ref:c,top:0,left:0,position:"fixed",transform:w?`translate3d(${Math.round(p)}px, ${Math.round(h)}px, 0)`:"translate3d(0, -200%, 0)",overflow:"hidden",children:[a.map((T,E)=>{const R=_({onClick:()=>{r(T)},onPointerDown:O=>{O.preventDefault()}});return I.createElement(MD,{...R,key:T.nodeType,ref:O=>{y.current[E]=O},active:E===A,isFirstItem:E===0,isLastItem:E===a.length-1,shortcut:`/${T.shortText??""}`},T.text)}),a.length===0&&d.jsx(MD,{..._({onPointerDown:T=>{T.preventDefault()}}),disabled:!0,ref:T=>{y.current[0]=T},children:"No results"})]}):null}),MD=I.forwardRef(function(t,n){const{children:r,disabled:i=!1,shortcut:o,active:a=!1,isFirstItem:s=!1,isLastItem:u=!1,...l}=t;return d.jsx("div",{...l,role:"button",style:{cursor:i?"default":"pointer"},ref:n,children:d.jsxs(m.Box,{alignItems:"center",height:32,flexDirection:"row",gap:8,padding:8,backgroundColor:a?"grey4":"inherit",justifyContent:"space-between",opacity:i?.5:1,children:[d.jsx(m.Text,{color:"grey12",component:"span",children:r}),o&&d.jsx(m.Text,{color:"inherit",component:"span",variant:"small",children:o})]})})});function s9e(e,t){var u,l;const n=t.map(c=>c.richTextNodeTypes).flat(),i={placeholderByNodeType:u9e(t),unfocusedPlaceholder:(u=e.config)==null?void 0:u.placeholder,nodeExtensions:t},o=n.includes(al.orderedList)||n.includes(al.list),a=!n.includes(al.table);return[M_.component(((l=e.config)==null?void 0:l.single)===void 0),El.component,ny.component,a?b4e(i):void 0,o?Ld.component:void 0,o9e.configure({nodeTypes:n})].filter(Qi.isDefined)}function u9e(e){return e.reduce((t,n)=>(n.nodeType===Hu.Text&&(t[n.name]=n.placeholder),t),{})}const B_=V6e.extend({name:"bulletList",parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",Dt(this.options.HTMLAttributes,e),0]}}).configure({itemTypeName:"listItem"}),l9e={fromPrismic(e){return function(t){var r;const n=Ld.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[B_.name])==null?void 0:r.create(Ia.fromPrismic(t),n)}},toPrismic(e){return Qs.children.map(e,t=>Ld.converter.toPrismic(t,he.RichTextNodeType.list).filter(Qi.isDefined)).flat()}},c9e=new UF([he.RichTextNodeType.list],B_.name,B_,l9e),sy=c9e,d9e=/^```([a-z]+)?[\s\n]$/,f9e=/^~~~([a-z]+)?[\s\n]$/,p9e=sn.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,o=[...((t=e.firstElementChild)===null||t===void 0?void 0:t.classList)||[]].filter(a=>a.startsWith(n)).map(a=>a.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",Dt(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,a=r.parent.textContent.endsWith(`
|
|
135
|
+
|
|
136
|
+
`);return!o||!a?!1:e.chain().command(({tr:s})=>(s.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const s=i.after();return s===void 0?!1:r.nodeAt(s)?e.commands.command(({tr:l})=>(l.setSelection(je.near(r.resolve(s))),!0)):e.commands.exitCode()}}},addInputRules(){return[T_({find:d9e,type:this.type,getAttributes:e=>({language:e[1]})}),T_({find:f9e,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Kn({key:new rr("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!n||!o)return!1;const{tr:a,schema:s}=e.state,u=s.text(n.replace(/\r\n?/g,`
|
|
137
|
+
`));return a.replaceSelectionWith(this.type.create({language:o},u)),a.selection.$from.parent.type!==this.type&&a.setSelection(Oe.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta("paste",!0),e.dispatch(a),!0}}})]}}),uy=p9e.extend({name:"preformatted",addAttributes(){return{language:{default:null,parseHTML:e=>{var o;const{languageClassPrefix:t}=this.options,i=[...((o=e.firstElementChild)==null?void 0:o.classList)||[]].filter(a=>a.startsWith(t)).map(a=>a.replace(t,""))[0];return i||null},renderHTML:e=>e.language?{class:this.options.languageClassPrefix+e.language}:null}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({HTMLAttributes:e}){return["pre",Dt(this.options.HTMLAttributes),["code",e,0]]}}).configure({exitOnTripleEnter:!1}),h9e={fromPrismic(e){return function(t){var r;const n=El.converter.fromPrismic(e)(uy.name,t,!0);return(r=e.nodes[uy.name])==null?void 0:r.create(Ia.fromPrismic(t),n)}},toPrismic(e){return El.converter.toPrismic(e,he.RichTextNodeType.preformatted,Ia.toPrismic(e))}},A9e=new ng([he.RichTextNodeType.preformatted],uy.name,uy,h9e,"",!0),cZ=A9e;function dZ(e){const{editor:t,getPos:n,node:r}=e,[i,o]=I.useState(!1);return I.useEffect(()=>{function a(){const{from:u,to:l}=t.state.selection,c=n(),f=n()+r.nodeSize,p=u<=c&&l>=f;o(p)}function s(){o(!1)}return t.on("blur",s),t.on("selectionUpdate",a),()=>{t.off("blur",s),t.off("selectionUpdate",a)}},[t,n,r.nodeSize]),{selected:i}}function m9e(e,t,n){const{node:r}=e,i=r.attrs.content,o=ze.useStableCallback(e.updateAttributes),a=ze.useDebounceState({initialState:(i==null?void 0:i.embed_url)??"",startTransition:I.startTransition});function s(c){o({content:c})}function u(c){a.set(c),ni.toURL(c)||s(void 0)}const{onKeyDown:l}=g9e(e,a.value,t,n);return{inputRef:t,containerRef:n,onKeyDown:l,url:a.value,urlChanged:u,onContentChange:s,debouncedUrl:a.debouncedValue,content:e.node.attrs.content}}function g9e(e,t,n,r){const{editor:i,getPos:o,node:a}=e,[s,u]=I.useState(!0);I.useEffect(()=>{!s||!e.editor.isFocused||m.handleEditorFlushSyncError(()=>{var c;return(c=n.current)==null?void 0:c.focus()})},[n,s,e.editor.isFocused]);function l(c){const f=o(),p=o()+a.nodeSize;c.code==="Enter"&&(u(!1),i.chain().insertContentAt(p,{type:"paragraph"}).focus(p+1).run()),c.code==="Backspace"&&t===""&&i.chain().deleteRange({from:f,to:p}).focus(p+1).run(),c.code==="ArrowUp"&&(u(!1),i.chain().focus(f-1).run()),c.code==="ArrowDown"&&(u(!1),i.chain().focus(p+1).run())}return{containerRef:r,inputRef:n,onKeyDown:l}}function v9e(e){const t=I.useRef(null),n=I.useRef(null),{onKeyDown:r,url:i,urlChanged:o,onContentChange:a,debouncedUrl:s,content:u}=m9e(e,t,n),{selected:l}=dZ(e);return d.jsx(LF,{className:"custom-embed",children:d.jsxs("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:[d.jsxs(m.Box,{flexGrow:1,alignItems:"center",children:[d.jsx(m.Icon,{size:"small",name:"cloud",color:"grey11"}),d.jsx(m.Box,{flexGrow:1,height:40,ref:n,children:d.jsx(Tu,{id:"id",ref:t,value:i,variant:ni.toURL(i)?"link":"normal",placeholder:"Paste your link here",onValueChange:o,onKeyDown:r})})]}),ni.toURL(i)&&d.jsx(VH,{selected:l,debouncedUrl:s,onContentChange:a,content:u})]})})}const P_=sn.create({name:"embed",group:"block",atom:!0,content:"block*",marks:"",addAttributes(){return{content:{default:void 0}}},addCommands(){return{setEmbed:()=>({tr:e,dispatch:t})=>{const n=this.type.create();return t&&e.replaceSelectionWith(n),!0}}},parseHTML(){return[{tag:"embed"}]},renderHTML(){return["embed"]},addNodeView(){return DF(v9e)}}),y9e={fromPrismic(e){return function(t){var n;return(n=e.nodes[P_.name])==null?void 0:n.create({content:t.data})}},toPrismic(e){return e.attrs.content===void 0?{type:"embed",data:{type:"embed",embed_url:"",__TYPE__:"EmbedContent",all:[]}}:{type:"embed",data:{...e.attrs.content}}}},fZ=new O6e([he.RichTextNodeType.embed],P_.name,P_,y9e),b9e=sn.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,Dt(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>T_({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),W_="heading";function SC(e){switch(e){case 1:return he.RichTextNodeType.heading1;case 2:return he.RichTextNodeType.heading2;case 3:return he.RichTextNodeType.heading3;case 4:return he.RichTextNodeType.heading4;case 5:return he.RichTextNodeType.heading5;case 6:return he.RichTextNodeType.heading6}}function FD(e){return{fullName:SC(e),level:e}}const pZ=[1,2,3,4,5,6];function hZ(e,t=pZ){const n=new RegExp(`^heading([${t.join(",")}]){1}$`),r=e.match(n);if(!r||!r[1])return;const i=parseInt(r[1]);return{fullName:SC(i),level:i}}function AZ(e,t){const n=e.level;if(t.includes(n))return{fullName:SC(n),level:n}}const C9e=e=>{const t=e[0]??1;return{fromPrismic(n){return function(r){var a;const i=El.converter.fromPrismic(n)(W_,r),o=hZ(r.type,e)||FD(t);return(a=n.nodes[W_])==null?void 0:a.create({level:o.level,...Ia.fromPrismic(r)},i)}},toPrismic(n){const{fullName:r}=AZ(n.attrs,e)||FD(t);return El.converter.toPrismic(n,r,Ia.toPrismic(n))}}};function S9e(e){return e?e.size?Array.from(e.values()).reduce((n,r)=>{const i=hZ(r);return i?[...n,i.level]:n},[]).sort((n,r)=>n-r):[]:pZ}function w9e(e){return b9e.extend({name:"heading"}).configure({levels:e})}const Wu={name:W_,build:e=>{const t=S9e(e);if(!t)return;const n=t.map(r=>SC(r));return new F6e(n,w9e(t),t,C9e(t),r=>{const i=AZ(r,t);return i&&`Heading ${i.level}`})}};function _9e(e){const{content:t,thumbnail:n,imageViewProps:{getPos:r,updateAttributes:i,editor:o,node:a}}=e,[s,u]=I.useTransition();function l(g){u(()=>i({content:g}))}function c(g){const y=Ug(g),C=r()+a.nodeSize;l({...t,...y}),o.chain().focus(C+1).run()}function f({croppedImages:g}){if(!t)return;const y=g[n.name];if(!y)return;const C=eY({content:t,croppedImage:y});C!==t&&l(C)}function p(){const g=r(),y=r()+a.nodeSize;o.chain().deleteRange({from:g,to:y}).focus(y).run()}const{uploadImage:h,isUploadingImage:A}=hY({onMediaSelected:c});return{onMediaSelected:c,onCropperDialogClose:f,isUpdating:s,updateContent:l,onClear:p,uploadImage:h,isUploadingImage:A}}function x9e(e){const{node:t}=e,n=t.attrs.content,{selected:r}=dZ(e),i=I.useRef(null),o={width:void 0,height:void 0,name:fp},{onMediaSelected:a,onCropperDialogClose:s,isUpdating:u,updateContent:l,onClear:c,uploadImage:f,isUploadingImage:p}=_9e({content:n,thumbnail:o,imageViewProps:e}),[h,A]=I.useState(!1),g="Feature image",y=(n==null?void 0:n.width)===0&&(n==null?void 0:n.height)===0,C=n&&!y?[`${n.width}×${n.height}px`]:[],_={thumbnail:o,contentView:n,labels:Xw(o,n,n)};I.useLayoutEffect(()=>{var S;const v=(S=i==null?void 0:i.current)==null?void 0:S.closest(`.${mZ}`);fX.isHTMLElement(v)&&v.style.removeProperty("min-height")},[]);const b=p||u;return d.jsx(LF,{children:d.jsx(JH,{ref:i,isMediaDialogOpen:h,selected:r,onMediaSelected:a,onMediaDialogOpenChange:A,children:d.jsx(I.Suspense,{fallback:E9e,children:n!=null&&n.url?d.jsx(pY,{allContentViews:[n],content:n,contentView:n,fieldLabel:g,imageLabel:C,initialImages:[_],isUpdating:b,readOnly:!1,thumbnailName:o.name,onClear:c,onContentChange:l,onCropperDialogClose:s,onMediaDialogOpenChange:A}):d.jsx(ZH,{uploadImage:f,isUploading:p,disabled:h,children:d.jsx(HH,{fieldLabel:g,isUpdating:b,readOnly:!1,onMediaDialogOpenChange:A})})})})})}const mZ="imageViewNodeWrapper",gZ=144,T9e=94;function I9e(e){return(e?T9e:gZ)+12+12+1+1}const E9e=d.jsx("div",{style:{height:gZ}}),N_=sn.create({name:"image",group:"block",atom:!0,addAttributes(){return{content:{default:void 0}}},addCommands(){return{setImage:()=>e=>{const{dispatch:t,tr:n}=e,r=this.type.create();return t&&n.replaceSelectionWith(r),!0}}},parseHTML(){return[{tag:"image"}]},renderHTML({HTMLAttributes:e}){return["image",e]},addNodeView(){return function(t){const n=t.node.attrs.content===void 0;return DF(x9e,{attrs:{style:`min-height: ${I9e(n)}px`,class:mZ}})(t)}}}),R9e={fromPrismic(e){return function(t){var n;return(n=e.nodes[N_.name])==null?void 0:n.create({content:t.data})}},toPrismic(e){if(e.attrs.content!==void 0)return{type:"image",data:{...e.attrs.content}}}},vZ=new M6e([he.RichTextNodeType.image],N_.name,N_,R9e),$9e=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,k9e=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,O9e=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,M9e=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,F9e=Zm.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",Dt(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Hv({find:$9e,type:this.type}),Hv({find:O9e,type:this.type})]},addPasteRules(){return[Gv({find:k9e,type:this.type}),Gv({find:M9e,type:this.type})]}});class j9e{constructor(t,n,r){dn(this,"extType",Mc.Mark);dn(this,"richTextNodeTypes",[he.RichTextNodeType.em]);this.name=t,this.component=n,this.converter=r}}const yZ="em",bZ=F9e.extend({name:yZ}),L9e={fromPrismic(e){return function(){var t;return(t=e.marks[bZ.name])==null?void 0:t.create()}},toPrismic(){}},D9e=new j9e(yZ,bZ,L9e),VF=D9e;class U9e{constructor(t,n,r){dn(this,"extType",Mc.Mark);dn(this,"richTextNodeTypes",[]);this.name=t,this.component=n,this.converter=r}}const CZ="label",K_=Zm.create({name:CZ,priority:1e3,keepOnSplit:!1,inclusive:!1,addOptions(){return{htmlAttributes:{style:"background-color: hsl(251, 89%, 96%); border: 1px dashed rgba(68, 53, 146, 0.4); border-radius: 0px 2px 2px 2px"}}},addAttributes(){return{label:{default:""}}},addCommands(){return{setLabel:e=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,e).run(),unsetLabel:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},renderHTML({HTMLAttributes:e}){return["span",Dt(this.options.htmlAttributes,e),0]}}),B9e={fromPrismic(e){return function(t){var i;const n=t.data,r={type:K_.name,label:n};return(i=e.marks[K_.name])==null?void 0:i.create(r)}},toPrismic(e){return e.attrs.label}},zF=new U9e(CZ,K_,B9e);class P9e{constructor(t,n,r){dn(this,"extType",Mc.Mark);dn(this,"richTextNodeTypes",[he.RichTextNodeType.hyperlink]);this.name=t,this.component=n,this.converter=r}}const SZ="hyperlink",pa=Zm.create({name:SZ,priority:1e3,keepOnSplit:!1,inclusive:!1,addOptions(){return{openOnClick:!1,linkOnPaste:!0,autolink:!0,protocols:[],htmlAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null,id:""},validate:void 0}},addAttributes(){return{href:{default:""},id:{default:""},target:{default:"_blank"},rel:{default:"noopener noreferrer nofollow"},class:{default:null},media:{default:null}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:e}){return["a",Dt(this.options.htmlAttributes,e),0]},addCommands(){return{setWebLink:e=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,e).setMeta("preventAutolink",!0).run(),setDocumentLink:e=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,e).setMeta("preventAutolink",!0).run(),setMediaLink:e=>({chain:t})=>{const n=q_(lY({media:e.media}).value);return t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,{media:n}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}}}),W9e={fromPrismic(e){return function(t){var r,i,o,a;const n=t.data;if(n.__TYPE__==="DocumentLink"){const s={type:pa.name,id:n.id};return(r=e.marks[pa.name])==null?void 0:r.create(s)}if(n.__TYPE__==="ImageLink"){const s={type:pa.name,media:q_(n)};return(i=e.marks[pa.name])==null?void 0:i.create(s)}if(n.__TYPE__==="FileLink"){const s={type:pa.name,media:q_(n)};return(o=e.marks[pa.name])==null?void 0:o.create(s)}if(n.__TYPE__==="ExternalLink"){const s={type:pa.name,url:n.url,href:n.url,target:n.target};return(a=e.marks[pa.name])==null?void 0:a.create(s)}}},toPrismic(e){return e.attrs.media?_Z(e.attrs.media):e.attrs.id?{__TYPE__:"DocumentLink",id:e.attrs.id}:{__TYPE__:"ExternalLink",url:e.attrs.href,target:e.attrs.target}}},wZ=new P9e(SZ,pa,W9e);function q_(e){return JSON.stringify(e)}function _Z(e){return JSON.parse(e)}const N9e="listItem",jD="textStyle",LD=/^(\d+)\.\s$/,K9e=sn.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:e=>e.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",Dt(this.options.HTMLAttributes,n),0]:["ol",Dt(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(N9e,this.editor.getAttributes(jD)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=Yv({find:LD,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Yv({find:LD,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(jD)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),V_=K9e.extend({name:"orderedList",addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",Dt(this.options.HTMLAttributes,n),0]:["ol",Dt(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}}}).configure({itemTypeName:"listItem"}),q9e={fromPrismic(e){return function(t){var r;const n=Ld.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[V_.name])==null?void 0:r.create(Ia.fromPrismic(t),n)}},toPrismic(e){return Qs.children.map(e,t=>Ld.converter.toPrismic(t,he.RichTextNodeType.orderedList).filter(Qi.isDefined)).flat()}},V9e=new UF([he.RichTextNodeType.orderedList],V_.name,V_,q9e),ly=V9e,xZ=65535,TZ=Math.pow(2,16);function z9e(e,t){return e+t*TZ}function DD(e){return e&xZ}function Q9e(e){return(e-(e&xZ))/TZ}const IZ=1,EZ=2,rv=4,RZ=8;class z_{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&RZ)>0}get deletedBefore(){return(this.delInfo&(IZ|rv))>0}get deletedAfter(){return(this.delInfo&(EZ|rv))>0}get deletedAcross(){return(this.delInfo&rv)>0}}class Zr{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Zr.empty)return Zr.empty}recover(t){let n=0,r=DD(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+Q9e(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let u=this.ranges[s]-(this.inverted?i:0);if(u>t)break;let l=this.ranges[s+o],c=this.ranges[s+a],f=u+l;if(t<=f){let p=l?t==u?-1:t==f?1:n:n,h=u+i+(p<0?0:c);if(r)return h;let A=t==(n<0?u:f)?null:z9e(s/3,t-u),g=t==u?EZ:t==f?IZ:rv;return(n<0?t!=u:t!=f)&&(g|=RZ),new z_(h,g,A)}i+=c-l}return r?t+i:new z_(t+i,0,null)}touches(t,n){let r=0,i=DD(n),o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let u=this.ranges[s]-(this.inverted?r:0);if(u>t)break;let l=this.ranges[s+o],c=u+l;if(t<=c&&s==i*3)return!0;r+=this.ranges[s+a]-l}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],s=a-(this.inverted?o:0),u=a+(this.inverted?0:o),l=this.ranges[i+n],c=this.ranges[i+r];t(s,s+l,u,u+c),o+=c-l}}invert(){return new Zr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Zr.empty:new Zr(t<0?[0,-t,0]:[0,0,t])}}Zr.empty=new Zr([]);class eh{constructor(t=[],n,r=0,i=t.length){this.maps=t,this.mirror=n,this.from=r,this.to=i}slice(t=0,n=this.maps.length){return new eh(this.maps,this.mirror,t,n)}copy(){return new eh(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,n){this.to=this.maps.push(t),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(t){for(let n=0,r=this.maps.length;n<t.maps.length;n++){let i=t.getMirror(n);this.appendMap(t.maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this.maps.length+t.maps.length;n>=0;n--){let i=t.getMirror(n);this.appendMap(t.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let t=new eh;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this.maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let i=0;for(let o=this.from;o<this.to;o++){let a=this.maps[o],s=a.mapResult(t,n);if(s.recover!=null){let u=this.getMirror(o);if(u!=null&&u>o&&u<this.to){o=u,t=this.maps[u].recover(s.recover);continue}}i|=s.delInfo,t=s.pos}return r?t:new z_(t,i,null)}}const mw=Object.create(null);class ar{getMap(){return Zr.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=mw[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in mw)throw new RangeError("Duplicate use of step JSON ID "+t);return mw[t]=n,n.prototype.jsonID=t,n}}class Xt{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Xt(t,null)}static fail(t){return new Xt(null,t)}static fromReplace(t,n,r,i){try{return Xt.ok(t.replace(n,r,i))}catch(o){if(o instanceof wl)return Xt.fail(o.message);throw o}}}function QF(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(QF(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return q.fromArray(r)}class ks extends ar{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new V(QF(n.content,(a,s)=>!a.isAtom||!s.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return Xt.fromReplace(t,this.from,this.to,o)}invert(){return new To(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new ks(n.pos,r.pos,this.mark)}merge(t){return t instanceof ks&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new ks(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new ks(n.from,n.to,t.markFromJSON(n.mark))}}ar.jsonID("addMark",ks);class To extends ar{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new V(QF(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return Xt.fromReplace(t,this.from,this.to,r)}invert(){return new ks(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new To(n.pos,r.pos,this.mark)}merge(t){return t instanceof To&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new To(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new To(n.from,n.to,t.markFromJSON(n.mark))}}ar.jsonID("removeMark",To);class Os extends ar{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Xt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Xt.fromReplace(t,this.pos,this.pos+1,new V(q.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Os(this.pos,n.marks[i]);return new Os(this.pos,this.mark)}}return new Ud(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Os(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Os(n.pos,t.markFromJSON(n.mark))}}ar.jsonID("addNodeMark",Os);class Ud extends ar{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Xt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Xt.fromReplace(t,this.pos,this.pos+1,new V(q.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Os(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Ud(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Ud(n.pos,t.markFromJSON(n.mark))}}ar.jsonID("removeNodeMark",Ud);class lr extends ar{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&Q_(t,this.from,this.to)?Xt.fail("Structure replace would overwrite content"):Xt.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Zr([this.from,this.to-this.from,this.slice.size])}invert(t){return new lr(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new lr(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof lr)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?V.empty:new V(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new lr(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?V.empty:new V(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new lr(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new lr(n.from,n.to,V.fromJSON(t,n.slice),!!n.structure)}}ar.jsonID("replace",lr);class ko extends ar{constructor(t,n,r,i,o,a,s=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=s}apply(t){if(this.structure&&(Q_(t,this.from,this.gapFrom)||Q_(t,this.gapTo,this.to)))return Xt.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Xt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Xt.fromReplace(t,this.from,this.to,r):Xt.fail("Content does not fit in gap")}getMap(){return new Zr([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new ko(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new ko(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ko(n.from,n.to,n.gapFrom,n.gapTo,V.fromJSON(t,n.slice),n.insert,!!n.structure)}}ar.jsonID("replaceAround",ko);function Q_(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function H9e(e,t,n,r){let i=[],o=[],a,s;e.doc.nodesBetween(t,n,(u,l,c)=>{if(!u.isInline)return;let f=u.marks;if(!r.isInSet(f)&&c.type.allowsMarkType(r.type)){let p=Math.max(l,t),h=Math.min(l+u.nodeSize,n),A=r.addToSet(f);for(let g=0;g<f.length;g++)f[g].isInSet(A)||(a&&a.to==p&&a.mark.eq(f[g])?a.to=h:i.push(a=new To(p,h,f[g])));s&&s.to==p?s.to=h:o.push(s=new ks(p,h,r))}}),i.forEach(u=>e.step(u)),o.forEach(u=>e.step(u))}function Y9e(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,(a,s)=>{if(!a.isInline)return;o++;let u=null;if(r instanceof nC){let l=a.marks,c;for(;c=r.isInSet(l);)(u||(u=[])).push(c),l=c.removeFromSet(l)}else r?r.isInSet(a.marks)&&(u=[r]):u=a.marks;if(u&&u.length){let l=Math.min(s+a.nodeSize,n);for(let c=0;c<u.length;c++){let f=u[c],p;for(let h=0;h<i.length;h++){let A=i[h];A.step==o-1&&f.eq(i[h].style)&&(p=A)}p?(p.to=l,p.step=o):i.push({style:f,from:Math.max(s,t),to:l,step:o})}}}),i.forEach(a=>e.step(new To(a.from,a.to,a.style)))}function HF(e,t,n,r=n.contentMatch,i=!0){let o=e.doc.nodeAt(t),a=[],s=t+1;for(let u=0;u<o.childCount;u++){let l=o.child(u),c=s+l.nodeSize,f=r.matchType(l.type);if(!f)a.push(new lr(s,c,V.empty));else{r=f;for(let p=0;p<l.marks.length;p++)n.allowsMarkType(l.marks[p].type)||e.step(new To(s,c,l.marks[p]));if(i&&l.isText&&n.whitespace!="pre"){let p,h=/\r?\n|\r/g,A;for(;p=h.exec(l.text);)A||(A=new V(q.from(n.schema.text(" ",n.allowedMarks(l.marks))),0,0)),a.push(new lr(s+p.index,s+p.index+p[0].length,A))}}s=c}if(!r.validEnd){let u=r.fillBefore(q.empty,!0);e.replace(s,s,new V(u,0,0))}for(let u=a.length-1;u>=0;u--)e.step(a[u])}function G9e(e,t,n){let{$from:r,$to:i,depth:o}=t,a=r.before(o+1),s=i.after(o+1),u=a,l=s,c=q.empty,f=0;for(let A=o,g=!1;A>n;A--)g||r.index(A)>0?(g=!0,c=q.from(r.node(A).copy(c)),f++):u--;let p=q.empty,h=0;for(let A=o,g=!1;A>n;A--)g||i.after(A+1)<i.end(A)?(g=!0,p=q.from(i.node(A).copy(p)),h++):l++;e.step(new ko(u,l,a,s,new V(c.append(p),f,h),c.size-f,!0))}function J9e(e,t,n){let r=q.empty;for(let a=n.length-1;a>=0;a--){if(r.size){let s=n[a].type.contentMatch.matchFragment(r);if(!s||!s.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=q.from(n[a].type.create(n[a].attrs,r))}let i=t.start,o=t.end;e.step(new ko(i,o,i,o,new V(r,0,0),n.length,!0))}function Z9e(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,(a,s)=>{let u=typeof i=="function"?i(a):i;if(a.isTextblock&&!a.hasMarkup(r,u)&&X9e(e.doc,e.mapping.slice(o).map(s),r)){let l=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",A=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!A?l=!1:!h&&A&&(l=!0)}l===!1&&kZ(e,a,s,o),HF(e,e.mapping.slice(o).map(s,1),r,void 0,l===null);let c=e.mapping.slice(o),f=c.map(s,1),p=c.map(s+a.nodeSize,1);return e.step(new ko(f,p,f+1,p-1,new V(q.from(r.create(u,null,a.marks)),0,0),1,!0)),l===!0&&$Z(e,a,s,o),!1}})}function $Z(e,t,n,r){t.forEach((i,o)=>{if(i.isText){let a,s=/\r?\n|\r/g;for(;a=s.exec(i.text);){let u=e.mapping.slice(r).map(n+1+o+a.index);e.replaceWith(u,u+1,t.type.schema.linebreakReplacement.create())}}})}function kZ(e,t,n,r){t.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let a=e.mapping.slice(r).map(n+1+o);e.replaceWith(a,a+1,t.type.schema.text(`
|
|
138
|
+
`))}})}function X9e(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function e8e(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let a=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,a);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new ko(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new V(q.from(a),0,0),1,!0))}function t8e(e,t,n=1,r){let i=e.doc.resolve(t),o=q.empty,a=q.empty;for(let s=i.depth,u=i.depth-n,l=n-1;s>u;s--,l--){o=q.from(i.node(s).copy(o));let c=r&&r[l];a=q.from(c?c.type.create(c.attrs,a):i.node(s).copy(a))}e.step(new lr(t,t,new V(o.append(a),n,n),!0))}function n8e(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,o=e.doc.resolve(t-n),a=o.node().type;if(i&&a.inlineContent){let c=a.whitespace=="pre",f=!!a.contentMatch.matchType(i);c&&!f?r=!1:!c&&f&&(r=!0)}let s=e.steps.length;if(r===!1){let c=e.doc.resolve(t+n);kZ(e,c.node(),c.before(),s)}a.inlineContent&&HF(e,t+n-1,a,o.node().contentMatchAt(o.index()),r==null);let u=e.mapping.slice(s),l=u.map(t-n);if(e.step(new lr(l,u.map(t+n,-1),V.empty,!0)),r===!0){let c=e.doc.resolve(l);$Z(e,c.node(),c.before(),e.steps.length)}return e}function r8e(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function i8e(e,t,n=t,r=V.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return OZ(i,o,r)?new lr(t,n,r):new o8e(i,o,r).fit()}function OZ(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class o8e{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=q.empty;for(let i=0;i<=t.depth;i++){let o=t.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(i))})}for(let i=t.depth;i>0;i--)this.placed=q.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let l=this.findFittable();l?this.placeNodes(l):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;let o=this.placed,a=r.depth,s=i.depth;for(;a&&s&&o.childCount==1;)o=o.firstChild.content,a--,s--;let u=new V(o,a,s);return t>-1?new ko(r.pos,t,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new lr(r.pos,i.pos,u):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<t;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){t=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=gw(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let a=i.firstChild;for(let s=this.depth;s>=0;s--){let{type:u,match:l}=this.frontier[s],c,f=null;if(n==1&&(a?l.matchType(a.type)||(f=l.fillBefore(q.from(a),!1)):o&&u.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:s,parent:o,inject:f};if(n==2&&a&&(c=l.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:s,parent:o,wrap:c};if(o&&l.matchType(o.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=gw(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new V(t,n+1,Math.max(r,i.size+n>=t.size-r?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=gw(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new V(Kp(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new V(Kp(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let g=0;g<o.length;g++)this.openFrontierNode(o[g]);let a=this.unplaced,s=r?r.content:a.content,u=a.openStart-t,l=0,c=[],{match:f,type:p}=this.frontier[n];if(i){for(let g=0;g<i.childCount;g++)c.push(i.child(g));f=f.matchFragment(i)}let h=s.size+t-(a.content.size-a.openEnd);for(;l<s.childCount;){let g=s.child(l),y=f.matchType(g.type);if(!y)break;l++,(l>1||u==0||g.content.size)&&(f=y,c.push(MZ(g.mark(p.allowedMarks(g.marks)),l==1?u:0,l==s.childCount?h:-1)))}let A=l==s.childCount;A||(h=-1),this.placed=qp(this.placed,n,q.from(c)),this.frontier[n].match=f,A&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=s;g<h;g++){let C=y.lastChild;this.frontier.push({type:C.type,match:C.contentMatchAt(C.childCount)}),y=C.content}this.unplaced=A?t==0?V.empty:new V(Kp(a.content,t-1,1),t-1,h<0?a.openEnd:t-1):new V(Kp(a.content,t,l),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!vw(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),a=vw(t,n,i,r,o);if(a){for(let s=n-1;s>=0;s--){let{match:u,type:l}=this.frontier[s],c=vw(t,s,l,u,!0);if(!c||c.childCount)continue e}return{depth:n,fit:a,move:o?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=qp(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let i=t.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,t.index(r));this.openFrontierNode(i.type,i.attrs,o)}return t}openFrontierNode(t,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=qp(this.placed,this.depth,q.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(q.empty,!0);n.childCount&&(this.placed=qp(this.placed,this.frontier.length,n))}}function Kp(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Kp(e.firstChild.content,t-1,n)))}function qp(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(qp(e.lastChild.content,t-1,n)))}function gw(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function MZ(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,MZ(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(q.empty,!0)))),e.copy(r)}function vw(e,t,n,r,i){let o=e.node(t),a=i?e.indexAfter(t):e.index(t);if(a==o.childCount&&!n.compatibleContent(o.type))return null;let s=r.fillBefore(o.content,!0,a);return s&&!a8e(n,o.content,a)?s:null}function a8e(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function s8e(e){return e.spec.defining||e.spec.definingForContent}function u8e(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(OZ(i,o,r))return e.step(new lr(t,n,r));let a=jZ(i,e.doc.resolve(n));a[a.length-1]==0&&a.pop();let s=-(i.depth+1);a.unshift(s);for(let p=i.depth,h=i.pos-1;p>0;p--,h--){let A=i.node(p).type.spec;if(A.defining||A.definingAsContext||A.isolating)break;a.indexOf(p)>-1?s=p:i.before(p)==h&&a.splice(1,0,-p)}let u=a.indexOf(s),l=[],c=r.openStart;for(let p=r.content,h=0;;h++){let A=p.firstChild;if(l.push(A),h==r.openStart)break;p=A.content}for(let p=c-1;p>=0;p--){let h=l[p],A=s8e(h.type);if(A&&!h.sameMarkup(i.node(Math.abs(s)-1)))c=p;else if(A||!h.type.isTextblock)break}for(let p=r.openStart;p>=0;p--){let h=(p+c+1)%(r.openStart+1),A=l[h];if(A)for(let g=0;g<a.length;g++){let y=a[(g+u)%a.length],C=!0;y<0&&(C=!1,y=-y);let _=i.node(y-1),b=i.index(y-1);if(_.canReplaceWith(b,b,A.type,A.marks))return e.replace(i.before(y),C?o.after(y):n,new V(FZ(r.content,0,r.openStart,h),h,r.openEnd))}}let f=e.steps.length;for(let p=a.length-1;p>=0&&(e.replace(t,n,r),!(e.steps.length>f));p--){let h=a[p];h<0||(t=i.before(h),n=o.after(h))}}function FZ(e,t,n,r,i){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(FZ(o.content,t+1,n,r,o)))}if(t>r){let o=i.contentMatchAt(0),a=o.fillBefore(e).append(e);e=a.append(o.matchFragment(a).fillBefore(q.empty,!0))}return e}function l8e(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=r8e(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new V(q.from(r),0,0))}function c8e(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=jZ(r,i);for(let a=0;a<o.length;a++){let s=o[a],u=a==o.length-1;if(u&&s==0||r.node(s).type.contentMatch.validEnd)return e.delete(r.start(s),i.end(s));if(s>0&&(u||r.node(s-1).canReplace(r.index(s-1),i.indexAfter(s-1))))return e.delete(r.before(s),i.after(s))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function jZ(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let o=e.start(i);if(o<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(o==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==o-1)&&n.push(i)}return n}class sd extends ar{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return Xt.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Xt.fromReplace(t,this.pos,this.pos+1,new V(q.from(i),0,n.isLeaf?0:1))}getMap(){return Zr.empty}invert(t){return new sd(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new sd(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new sd(n.pos,n.attr,n.value)}}ar.jsonID("attr",sd);class Qh extends ar{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return Xt.ok(r)}getMap(){return Zr.empty}invert(t){return new Qh(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Qh(n.attr,n.value)}}ar.jsonID("docAttr",Qh);let Bd=class extends Error{};Bd=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Bd.prototype=Object.create(Error.prototype);Bd.prototype.constructor=Bd;Bd.prototype.name="TransformError";class d8e{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new eh}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Bd(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,r=V.empty){let i=i8e(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new V(q.from(r),0,0))}delete(t,n){return this.replace(t,n,V.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return u8e(this,t,n,r),this}replaceRangeWith(t,n,r){return l8e(this,t,n,r),this}deleteRange(t,n){return c8e(this,t,n),this}lift(t,n){return G9e(this,t,n),this}join(t,n=1){return n8e(this,t,n),this}wrap(t,n){return J9e(this,t,n),this}setBlockType(t,n=t,r,i=null){return Z9e(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i){return e8e(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new sd(t,n,r)),this}setDocAttribute(t,n){return this.step(new Qh(t,n)),this}addNodeMark(t,n){return this.step(new Os(t,n)),this}removeNodeMark(t,n){if(!(n instanceof St)){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Ud(t,n)),this}split(t,n=1,r){return t8e(this,t,n,r),this}addMark(t,n,r){return H9e(this,t,n,r),this}removeMark(t,n,r){return Y9e(this,t,n,r),this}clearIncompatible(t,n,r){return HF(this,t,n,r),this}}var H_,Y_;if(typeof WeakMap<"u"){let e=new WeakMap;H_=t=>e.get(t),Y_=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;H_=r=>{for(let i=0;i<e.length;i+=2)if(e[i]==r)return e[i+1]},Y_=(r,i)=>(n==10&&(n=0),e[n++]=r,e[n++]=i)}var Ft=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const r=t%this.width,i=t/this.width|0;let o=r+1,a=i+1;for(let s=1;o<this.width&&this.map[t+s]==n;s++)o++;for(let s=1;a<this.height&&this.map[t+this.width*s]==n;s++)a++;return{left:r,top:i,right:o,bottom:a}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:r,right:i,top:o,bottom:a}=this.findCell(e);return t=="horiz"?(n<0?r==0:i==this.width)?null:this.map[o*this.width+(n<0?r-1:i)]:(n<0?o==0:a==this.height)?null:this.map[r+this.width*(n<0?o-1:a)]}rectBetween(e,t){const{left:n,right:r,top:i,bottom:o}=this.findCell(e),{left:a,right:s,top:u,bottom:l}=this.findCell(t);return{left:Math.min(n,a),top:Math.min(i,u),right:Math.max(r,s),bottom:Math.max(o,l)}}cellsInRect(e){const t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){const o=r*this.width+i,a=this.map[o];n[a]||(n[a]=!0,!(i==e.left&&i&&this.map[o-1]==a||r==e.top&&r&&this.map[o-this.width]==a)&&t.push(a))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){const o=i+n.child(r).nodeSize;if(r==e){let a=t+e*this.width;const s=(e+1)*this.width;for(;a<s&&this.map[a]<i;)a++;return a==s?o-1:this.map[a]}i=o}}static get(e){return H_(e)||Y_(e,f8e(e))}};function f8e(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=p8e(e),n=e.childCount,r=[];let i=0,o=null;const a=[];for(let l=0,c=t*n;l<c;l++)r[l]=0;for(let l=0,c=0;l<n;l++){const f=e.child(l);c++;for(let A=0;;A++){for(;i<r.length&&r[i]!=0;)i++;if(A==f.childCount)break;const g=f.child(A),{colspan:y,rowspan:C,colwidth:_}=g.attrs;for(let b=0;b<C;b++){if(b+l>=n){(o||(o=[])).push({type:"overlong_rowspan",pos:c,n:C-b});break}const v=i+b*t;for(let S=0;S<y;S++){r[v+S]==0?r[v+S]=c:(o||(o=[])).push({type:"collision",row:l,pos:c,n:y-S});const w=_&&_[S];if(w){const T=(v+S)%t*2,E=a[T];E==null||E!=w&&a[T+1]==1?(a[T]=w,a[T+1]=1):E==w&&a[T+1]++}}}i+=y,c+=g.nodeSize}const p=(l+1)*t;let h=0;for(;i<p;)r[i++]==0&&h++;h&&(o||(o=[])).push({type:"missing",row:l,n:h}),c++}(t===0||n===0)&&(o||(o=[])).push({type:"zero_sized"});const s=new Ft(t,n,r,o);let u=!1;for(let l=0;!u&&l<a.length;l+=2)a[l]!=null&&a[l+1]<n&&(u=!0);return u&&h8e(s,a,e),s}function p8e(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){const i=e.child(r);let o=0;if(n)for(let a=0;a<r;a++){const s=e.child(a);for(let u=0;u<s.childCount;u++){const l=s.child(u);a+l.attrs.rowspan>r&&(o+=l.attrs.colspan)}}for(let a=0;a<i.childCount;a++){const s=i.child(a);o+=s.attrs.colspan,s.attrs.rowspan>1&&(n=!0)}t==-1?t=o:t!=o&&(t=Math.max(t,o))}return t}function h8e(e,t,n){e.problems||(e.problems=[]);const r={};for(let i=0;i<e.map.length;i++){const o=e.map[i];if(r[o])continue;r[o]=!0;const a=n.nodeAt(o);if(!a)throw new RangeError(`No cell with offset ${o} found`);let s=null;const u=a.attrs;for(let l=0;l<u.colspan;l++){const c=(i+l)%e.width,f=t[c*2];f!=null&&(!u.colwidth||u.colwidth[l]!=f)&&((s||(s=A8e(u)))[l]=f)}s&&e.problems.unshift({type:"colwidth mismatch",pos:o,colwidth:s})}}function A8e(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function Xn(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}var xs=new rr("selectingCells");function hp(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function m8e(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function ui(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function wC(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=hp(t.$head)||g8e(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function g8e(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const r=t.type.spec.tableRole;if(r=="cell"||r=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const r=t.type.spec.tableRole;if(r=="cell"||r=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function G_(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function v8e(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function YF(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function LZ(e,t,n){const r=e.node(-1),i=Ft.get(r),o=e.start(-1),a=i.nextCell(e.pos-o,t,n);return a==null?null:e.node(0).resolve(o+a)}function $l(e,t,n=1){const r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function DZ(e,t,n=1){const r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;i<n;i++)r.colwidth.splice(t,0,0)}return r}function y8e(e,t,n){const r=Xn(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var At=class ha extends je{constructor(t,n=t){const r=t.node(-1),i=Ft.get(r),o=t.start(-1),a=i.rectBetween(t.pos-o,n.pos-o),s=t.node(0),u=i.cellsInRect(a).filter(c=>c!=n.pos-o);u.unshift(n.pos-o);const l=u.map(c=>{const f=r.nodeAt(c);if(!f)throw RangeError(`No cell with offset ${c} found`);const p=o+c+1;return new zY(s.resolve(p),s.resolve(p+f.content.size))});super(l[0].$from,l[0].$to,l),this.$anchorCell=t,this.$headCell=n}map(t,n){const r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(G_(r)&&G_(i)&&YF(r,i)){const o=this.$anchorCell.node(-1)!=r.node(-1);return o&&this.isRowSelection()?ha.rowSelection(r,i):o&&this.isColSelection()?ha.colSelection(r,i):new ha(r,i)}return Oe.between(r,i)}content(){const t=this.$anchorCell.node(-1),n=Ft.get(t),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),o={},a=[];for(let u=i.top;u<i.bottom;u++){const l=[];for(let c=u*n.width+i.left,f=i.left;f<i.right;f++,c++){const p=n.map[c];if(o[p])continue;o[p]=!0;const h=n.findCell(p);let A=t.nodeAt(p);if(!A)throw RangeError(`No cell with offset ${p} found`);const g=i.left-h.left,y=h.right-i.right;if(g>0||y>0){let C=A.attrs;if(g>0&&(C=$l(C,0,g)),y>0&&(C=$l(C,C.colspan-y,y)),h.left<i.left){if(A=A.type.createAndFill(C),!A)throw RangeError(`Could not create cell with attrs ${JSON.stringify(C)}`)}else A=A.type.create(C,A.content)}if(h.top<i.top||h.bottom>i.bottom){const C={...A.attrs,rowspan:Math.min(h.bottom,i.bottom)-Math.max(h.top,i.top)};h.top<i.top?A=A.type.createAndFill(C):A=A.type.create(C,A.content)}l.push(A)}a.push(t.child(u).copy(q.from(l)))}const s=this.isColSelection()&&this.isRowSelection()?t:a;return new V(q.from(s),1,1)}replace(t,n=V.empty){const r=t.steps.length,i=this.ranges;for(let a=0;a<i.length;a++){const{$from:s,$to:u}=i[a],l=t.mapping.slice(r);t.replace(l.map(s.pos),l.map(u.pos),a?V.empty:n)}const o=je.findFrom(t.doc.resolve(t.mapping.slice(r).map(this.to)),-1);o&&t.setSelection(o)}replaceWith(t,n){this.replace(t,new V(q.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),r=Ft.get(n),i=this.$anchorCell.start(-1),o=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let a=0;a<o.length;a++)t(n.nodeAt(o[a]),i+o[a])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const r=t+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const r=t.node(-1),i=Ft.get(r),o=t.start(-1),a=i.findCell(t.pos-o),s=i.findCell(n.pos-o),u=t.node(0);return a.top<=s.top?(a.top>0&&(t=u.resolve(o+i.map[a.left])),s.bottom<i.height&&(n=u.resolve(o+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=u.resolve(o+i.map[s.left])),a.bottom<i.height&&(t=u.resolve(o+i.map[i.width*(i.height-1)+a.right-1]))),new ha(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=Ft.get(t),r=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-r),o=n.colCount(this.$headCell.pos-r);if(Math.min(i,o)>0)return!1;const a=i+this.$anchorCell.nodeAfter.attrs.colspan,s=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,s)==n.width}eq(t){return t instanceof ha&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const r=t.node(-1),i=Ft.get(r),o=t.start(-1),a=i.findCell(t.pos-o),s=i.findCell(n.pos-o),u=t.node(0);return a.left<=s.left?(a.left>0&&(t=u.resolve(o+i.map[a.top*i.width])),s.right<i.width&&(n=u.resolve(o+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=u.resolve(o+i.map[s.top*i.width])),a.right<i.width&&(t=u.resolve(o+i.map[i.width*(a.top+1)-1]))),new ha(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new ha(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new ha(t.resolve(n),t.resolve(r))}getBookmark(){return new b8e(this.$anchorCell.pos,this.$headCell.pos)}};At.prototype.visible=!1;je.jsonID("cell",At);var b8e=class UZ{constructor(t,n){this.anchor=t,this.head=n}map(t){return new UZ(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),r=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&YF(n,r)?new At(n,r):je.near(r,1)}};function C8e(e){if(!(e.selection instanceof At))return null;const t=[];return e.selection.forEachCell((n,r)=>{t.push($r.node(r,r+n.nodeSize,{class:"selectedCell"}))}),Mt.create(e.doc,t)}function S8e({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let o=t.depth;o>=0&&!(t.before(o+1)>t.start(o));o--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function w8e({$from:e,$to:t}){let n,r;for(let i=e.depth;i>0;i--){const o=e.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){n=o;break}}for(let i=t.depth;i>0;i--){const o=t.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){r=o;break}}return n!==r&&t.parentOffset===0}function _8e(e,t,n){const r=(t||e).selection,i=(t||e).doc;let o,a;if(r instanceof xe&&(a=r.node.type.spec.tableRole)){if(a=="cell"||a=="header_cell")o=At.create(i,r.from);else if(a=="row"){const s=i.resolve(r.from+1);o=At.rowSelection(s,s)}else if(!n){const s=Ft.get(r.node),u=r.from+1,l=u+s.map[s.width*s.height-1];o=At.create(i,u+1,l)}}else r instanceof Oe&&S8e(r)?o=Oe.create(i,r.from):r instanceof Oe&&w8e(r)&&(o=Oe.create(i,r.$from.start(),r.$from.end()));return o&&(t||(t=e.tr)).setSelection(o),t}var x8e=new rr("fix-tables");function BZ(e,t,n,r){const i=e.childCount,o=t.childCount;e:for(let a=0,s=0;a<o;a++){const u=t.child(a);for(let l=s,c=Math.min(i,a+3);l<c;l++)if(e.child(l)==u){s=l+1,n+=u.nodeSize;continue e}r(u,n),s<i&&e.child(s).sameMarkup(u)?BZ(e.child(s),u,n+1,r):u.nodesBetween(0,u.content.size,r,n+1),n+=u.nodeSize}}function PZ(e,t){let n;const r=(i,o)=>{i.type.spec.tableRole=="table"&&(n=T8e(e,i,o,n))};return t?t.doc!=e.doc&&BZ(t.doc,e.doc,0,r):e.doc.descendants(r),n}function T8e(e,t,n,r){const i=Ft.get(t);if(!i.problems)return r;r||(r=e.tr);const o=[];for(let u=0;u<i.height;u++)o.push(0);for(let u=0;u<i.problems.length;u++){const l=i.problems[u];if(l.type=="collision"){const c=t.nodeAt(l.pos);if(!c)continue;const f=c.attrs;for(let p=0;p<f.rowspan;p++)o[l.row+p]+=l.n;r.setNodeMarkup(r.mapping.map(n+1+l.pos),null,$l(f,f.colspan-l.n,l.n))}else if(l.type=="missing")o[l.row]+=l.n;else if(l.type=="overlong_rowspan"){const c=t.nodeAt(l.pos);if(!c)continue;r.setNodeMarkup(r.mapping.map(n+1+l.pos),null,{...c.attrs,rowspan:c.attrs.rowspan-l.n})}else if(l.type=="colwidth mismatch"){const c=t.nodeAt(l.pos);if(!c)continue;r.setNodeMarkup(r.mapping.map(n+1+l.pos),null,{...c.attrs,colwidth:l.colwidth})}else if(l.type=="zero_sized"){const c=r.mapping.map(n);r.delete(c,c+t.nodeSize)}}let a,s;for(let u=0;u<o.length;u++)o[u]&&(a==null&&(a=u),s=u);for(let u=0,l=n+1;u<i.height;u++){const c=t.child(u),f=l+c.nodeSize,p=o[u];if(p>0){let h="cell";c.firstChild&&(h=c.firstChild.type.spec.tableRole);const A=[];for(let y=0;y<p;y++){const C=Xn(e.schema)[h].createAndFill();C&&A.push(C)}const g=(u==0||a==u-1)&&s==u?l+1:f-1;r.insert(r.mapping.map(g),A)}l=f}return r.setMeta(x8e,{fixTables:!0})}function Ri(e){const t=e.selection,n=wC(e),r=n.node(-1),i=n.start(-1),o=Ft.get(r);return{...t instanceof At?o.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):o.findCell(n.pos-i),tableStart:i,map:o,table:r}}function GF(e,{map:t,tableStart:n,table:r},i){let o=i>0?-1:0;y8e(t,r,i+o)&&(o=i==0||i==t.width?null:0);for(let a=0;a<t.height;a++){const s=a*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){const u=t.map[s],l=r.nodeAt(u);e.setNodeMarkup(e.mapping.map(n+u),null,DZ(l.attrs,i-t.colCount(u))),a+=l.attrs.rowspan-1}else{const u=o==null?Xn(r.type.schema).cell:r.nodeAt(t.map[s+o]).type,l=t.positionAt(a,i,r);e.insert(e.mapping.map(n+l),u.createAndFill())}}return e}function I8e(e,t){if(!ui(e))return!1;if(t){const n=Ri(e);t(GF(e.tr,n,n.left))}return!0}function E8e(e,t){if(!ui(e))return!1;if(t){const n=Ri(e);t(GF(e.tr,n,n.right))}return!0}function R8e(e,{map:t,table:n,tableStart:r},i){const o=e.mapping.maps.length;for(let a=0;a<t.height;){const s=a*t.width+i,u=t.map[s],l=n.nodeAt(u),c=l.attrs;if(i>0&&t.map[s-1]==u||i<t.width-1&&t.map[s+1]==u)e.setNodeMarkup(e.mapping.slice(o).map(r+u),null,$l(c,i-t.colCount(u)));else{const f=e.mapping.slice(o).map(r+u);e.delete(f,f+l.nodeSize)}a+=c.rowspan}}function $8e(e,t){if(!ui(e))return!1;if(t){const n=Ri(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;R8e(r,n,i),i!=n.left;i--){const o=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!o)throw RangeError("No table found");n.table=o,n.map=Ft.get(o)}t(r)}return!0}function k8e(e,t,n){var r;const i=Xn(t.type.schema).header_cell;for(let o=0;o<e.width;o++)if(((r=t.nodeAt(e.map[o+n*e.width]))==null?void 0:r.type)!=i)return!1;return!0}function JF(e,{map:t,tableStart:n,table:r},i){var o;let a=n;for(let l=0;l<i;l++)a+=r.child(l).nodeSize;const s=[];let u=i>0?-1:0;k8e(t,r,i+u)&&(u=i==0||i==t.height?null:0);for(let l=0,c=t.width*i;l<t.width;l++,c++)if(i>0&&i<t.height&&t.map[c]==t.map[c-t.width]){const f=t.map[c],p=r.nodeAt(f).attrs;e.setNodeMarkup(n+f,null,{...p,rowspan:p.rowspan+1}),l+=p.colspan-1}else{const f=u==null?Xn(r.type.schema).cell:(o=r.nodeAt(t.map[c+u*t.width]))==null?void 0:o.type,p=f==null?void 0:f.createAndFill();p&&s.push(p)}return e.insert(a,Xn(r.type.schema).row.create(null,s)),e}function O8e(e,t){if(!ui(e))return!1;if(t){const n=Ri(e);t(JF(e.tr,n,n.top))}return!0}function M8e(e,t){if(!ui(e))return!1;if(t){const n=Ri(e);t(JF(e.tr,n,n.bottom))}return!0}function F8e(e,{map:t,table:n,tableStart:r},i){let o=0;for(let l=0;l<i;l++)o+=n.child(l).nodeSize;const a=o+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(o+r,a+r);const u=new Set;for(let l=0,c=i*t.width;l<t.width;l++,c++){const f=t.map[c];if(!u.has(f)){if(u.add(f),i>0&&f==t.map[c-t.width]){const p=n.nodeAt(f).attrs;e.setNodeMarkup(e.mapping.slice(s).map(f+r),null,{...p,rowspan:p.rowspan-1}),l+=p.colspan-1}else if(i<t.height&&f==t.map[c+t.width]){const p=n.nodeAt(f),h=p.attrs,A=p.type.create({...h,rowspan:p.attrs.rowspan-1},p.content),g=t.positionAt(i+1,l,n);e.insert(e.mapping.slice(s).map(r+g),A),l+=h.colspan-1}}}}function j8e(e,t){if(!ui(e))return!1;if(t){const n=Ri(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;F8e(r,n,i),i!=n.top;i--){const o=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!o)throw RangeError("No table found");n.table=o,n.map=Ft.get(n.table)}t(r)}return!0}function UD(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function L8e({width:e,height:t,map:n},r){let i=r.top*e+r.left,o=i,a=(r.bottom-1)*e+r.left,s=i+(r.right-r.left-1);for(let u=r.top;u<r.bottom;u++){if(r.left>0&&n[o]==n[o-1]||r.right<e&&n[s]==n[s+1])return!0;o+=e,s+=e}for(let u=r.left;u<r.right;u++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[a]==n[a+e])return!0;i++,a++}return!1}function BD(e,t){const n=e.selection;if(!(n instanceof At)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=Ri(e),{map:i}=r;if(L8e(i,r))return!1;if(t){const o=e.tr,a={};let s=q.empty,u,l;for(let c=r.top;c<r.bottom;c++)for(let f=r.left;f<r.right;f++){const p=i.map[c*i.width+f],h=r.table.nodeAt(p);if(!(a[p]||!h))if(a[p]=!0,u==null)u=p,l=h;else{UD(h)||(s=s.append(h.content));const A=o.mapping.map(p+r.tableStart);o.delete(A,A+h.nodeSize)}}if(u==null||l==null)return!0;if(o.setNodeMarkup(u+r.tableStart,null,{...DZ(l.attrs,l.attrs.colspan,r.right-r.left-l.attrs.colspan),rowspan:r.bottom-r.top}),s.size){const c=u+1+l.content.size,f=UD(l)?u+1:c;o.replaceWith(f+r.tableStart,c+r.tableStart,s)}o.setSelection(new At(o.doc.resolve(u+r.tableStart))),t(o)}return!0}function PD(e,t){const n=Xn(e.schema);return D8e(({node:r})=>n[r.type.spec.tableRole])(e,t)}function D8e(e){return(t,n)=>{var r;const i=t.selection;let o,a;if(i instanceof At){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;o=i.$anchorCell.nodeAfter,a=i.$anchorCell.pos}else{if(o=m8e(i.$from),!o)return!1;a=(r=hp(i.$from))==null?void 0:r.pos}if(o==null||a==null||o.attrs.colspan==1&&o.attrs.rowspan==1)return!1;if(n){let s=o.attrs;const u=[],l=s.colwidth;s.rowspan>1&&(s={...s,rowspan:1}),s.colspan>1&&(s={...s,colspan:1});const c=Ri(t),f=t.tr;for(let h=0;h<c.right-c.left;h++)u.push(l?{...s,colwidth:l&&l[h]?[l[h]]:null}:s);let p;for(let h=c.top;h<c.bottom;h++){let A=c.map.positionAt(h,c.left,c.table);h==c.top&&(A+=o.nodeSize);for(let g=c.left,y=0;g<c.right;g++,y++)g==c.left&&h==c.top||f.insert(p=f.mapping.map(A+c.tableStart,1),e({node:o,row:h,col:g}).createAndFill(u[y]))}f.setNodeMarkup(a,e({node:o,row:c.top,col:c.left}),u[0]),i instanceof At&&f.setSelection(new At(f.doc.resolve(i.$anchorCell.pos),p?f.doc.resolve(p):void 0)),n(f)}return!0}}function U8e(e,t){return function(n,r){if(!ui(n))return!1;const i=wC(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){const o=n.tr;n.selection instanceof At?n.selection.forEachCell((a,s)=>{a.attrs[e]!==t&&o.setNodeMarkup(s,null,{...a.attrs,[e]:t})}):o.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(o)}return!0}}function B8e(e){return function(t,n){if(!ui(t))return!1;if(n){const r=Xn(t.schema),i=Ri(t),o=t.tr,a=i.map.cellsInRect(e=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=a.map(u=>i.table.nodeAt(u));for(let u=0;u<a.length;u++)s[u].type==r.header_cell&&o.setNodeMarkup(i.tableStart+a[u],r.cell,s[u].attrs);if(o.steps.length==0)for(let u=0;u<a.length;u++)o.setNodeMarkup(i.tableStart+a[u],r.header_cell,s[u].attrs);n(o)}return!0}}function WD(e,t,n){const r=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let i=0;i<r.length;i++){const o=t.table.nodeAt(r[i]);if(o&&o.type!==n.header_cell)return!1}return!0}function Hh(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?B8e(e):function(n,r){if(!ui(n))return!1;if(r){const i=Xn(n.schema),o=Ri(n),a=n.tr,s=WD("row",o,i),u=WD("column",o,i),c=(e==="column"?s:e==="row"?u:!1)?1:0,f=e=="column"?{left:0,top:c,right:1,bottom:o.map.height}:e=="row"?{left:c,top:0,right:o.map.width,bottom:1}:o,p=e=="column"?u?i.cell:i.header_cell:e=="row"?s?i.cell:i.header_cell:i.cell;o.map.cellsInRect(f).forEach(h=>{const A=h+o.tableStart,g=a.doc.nodeAt(A);g&&a.setNodeMarkup(A,p,g.attrs)}),r(a)}return!0}}Hh("row",{useDeprecatedLogic:!0});Hh("column",{useDeprecatedLogic:!0});var P8e=Hh("cell",{useDeprecatedLogic:!0});function W8e(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let r=e.index(-1)-1,i=e.before();r>=0;r--){const o=e.node(-1).child(r),a=o.lastChild;if(a)return i-1-a.nodeSize;i-=o.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let r=e.indexAfter(-1),i=e.after();r<n.childCount;r++){const o=n.child(r);if(o.childCount)return i+1;i+=o.nodeSize}}return null}function ND(e){return function(t,n){if(!ui(t))return!1;const r=W8e(wC(t),e);if(r==null)return!1;if(n){const i=t.doc.resolve(r);n(t.tr.setSelection(Oe.between(i,v8e(i))).scrollIntoView())}return!0}}function N8e(e,t){const n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function Mg(e,t){const n=e.selection;if(!(n instanceof At))return!1;if(t){const r=e.tr,i=Xn(e.schema).cell.createAndFill().content;n.forEachCell((o,a)=>{o.content.eq(i)||r.replace(r.mapping.map(a+1),r.mapping.map(a+o.nodeSize-1),new V(i,0,0))}),r.docChanged&&t(r)}return!0}function K8e(e){if(!e.size)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole=="table");)n--,r--,t=t.child(0).content;const i=t.child(0),o=i.type.spec.tableRole,a=i.type.schema,s=[];if(o=="row")for(let u=0;u<t.childCount;u++){let l=t.child(u).content;const c=u?0:Math.max(0,n-1),f=u<t.childCount-1?0:Math.max(0,r-1);(c||f)&&(l=J_(Xn(a).row,new V(l,c,f)).content),s.push(l)}else if(o=="cell"||o=="header_cell")s.push(n||r?J_(Xn(a).row,new V(t,n,r)).content:t);else return null;return q8e(a,s)}function q8e(e,t){const n=[];for(let i=0;i<t.length;i++){const o=t[i];for(let a=o.childCount-1;a>=0;a--){const{rowspan:s,colspan:u}=o.child(a).attrs;for(let l=i;l<i+s;l++)n[l]=(n[l]||0)+u}}let r=0;for(let i=0;i<n.length;i++)r=Math.max(r,n[i]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(q.empty),n[i]<r){const o=Xn(e).cell.createAndFill(),a=[];for(let s=n[i];s<r;s++)a.push(o);t[i]=t[i].append(q.from(a))}return{height:t.length,width:r,rows:t}}function J_(e,t){const n=e.createAndFill();return new d8e(n).replace(0,n.content.size,t).doc}function V8e({width:e,height:t,rows:n},r,i){if(e!=r){const o=[],a=[];for(let s=0;s<n.length;s++){const u=n[s],l=[];for(let c=o[s]||0,f=0;c<r;f++){let p=u.child(f%u.childCount);c+p.attrs.colspan>r&&(p=p.type.createChecked($l(p.attrs,p.attrs.colspan,c+p.attrs.colspan-r),p.content)),l.push(p),c+=p.attrs.colspan;for(let h=1;h<p.attrs.rowspan;h++)o[s+h]=(o[s+h]||0)+p.attrs.colspan}a.push(q.from(l))}n=a,e=r}if(t!=i){const o=[];for(let a=0,s=0;a<i;a++,s++){const u=[],l=n[s%t];for(let c=0;c<l.childCount;c++){let f=l.child(c);a+f.attrs.rowspan>i&&(f=f.type.create({...f.attrs,rowspan:Math.max(1,i-f.attrs.rowspan)},f.content)),u.push(f)}o.push(q.from(u))}n=o,t=i}return{width:e,height:t,rows:n}}function z8e(e,t,n,r,i,o,a){const s=e.doc.type.schema,u=Xn(s);let l,c;if(i>t.width)for(let f=0,p=0;f<t.height;f++){const h=n.child(f);p+=h.nodeSize;const A=[];let g;h.lastChild==null||h.lastChild.type==u.cell?g=l||(l=u.cell.createAndFill()):g=c||(c=u.header_cell.createAndFill());for(let y=t.width;y<i;y++)A.push(g);e.insert(e.mapping.slice(a).map(p-1+r),A)}if(o>t.height){const f=[];for(let A=0,g=(t.height-1)*t.width;A<Math.max(t.width,i);A++){const y=A>=t.width?!1:n.nodeAt(t.map[g+A]).type==u.header_cell;f.push(y?c||(c=u.header_cell.createAndFill()):l||(l=u.cell.createAndFill()))}const p=u.row.create(null,q.from(f)),h=[];for(let A=t.height;A<o;A++)h.push(p);e.insert(e.mapping.slice(a).map(r+n.nodeSize-2),h)}return!!(l||c)}function KD(e,t,n,r,i,o,a,s){if(a==0||a==t.height)return!1;let u=!1;for(let l=i;l<o;l++){const c=a*t.width+l,f=t.map[c];if(t.map[c-t.width]==f){u=!0;const p=n.nodeAt(f),{top:h,left:A}=t.findCell(f);e.setNodeMarkup(e.mapping.slice(s).map(f+r),null,{...p.attrs,rowspan:a-h}),e.insert(e.mapping.slice(s).map(t.positionAt(a,A,n)),p.type.createAndFill({...p.attrs,rowspan:h+p.attrs.rowspan-a})),l+=p.attrs.colspan-1}}return u}function qD(e,t,n,r,i,o,a,s){if(a==0||a==t.width)return!1;let u=!1;for(let l=i;l<o;l++){const c=l*t.width+a,f=t.map[c];if(t.map[c-1]==f){u=!0;const p=n.nodeAt(f),h=t.colCount(f),A=e.mapping.slice(s).map(f+r);e.setNodeMarkup(A,null,$l(p.attrs,a-h,p.attrs.colspan-(a-h))),e.insert(A+p.nodeSize,p.type.createAndFill($l(p.attrs,0,a-h))),l+=p.attrs.rowspan-1}}return u}function VD(e,t,n,r,i){let o=n?e.doc.nodeAt(n-1):e.doc;if(!o)throw new Error("No table found");let a=Ft.get(o);const{top:s,left:u}=r,l=u+i.width,c=s+i.height,f=e.tr;let p=0;function h(){if(o=n?f.doc.nodeAt(n-1):f.doc,!o)throw new Error("No table found");a=Ft.get(o),p=f.mapping.maps.length}z8e(f,a,o,n,l,c,p)&&h(),KD(f,a,o,n,u,l,s,p)&&h(),KD(f,a,o,n,u,l,c,p)&&h(),qD(f,a,o,n,s,c,u,p)&&h(),qD(f,a,o,n,s,c,l,p)&&h();for(let A=s;A<c;A++){const g=a.positionAt(A,u,o),y=a.positionAt(A,l,o);f.replace(f.mapping.slice(p).map(g+n),f.mapping.slice(p).map(y+n),new V(i.rows[A-s],0,0))}h(),f.setSelection(new At(f.doc.resolve(n+a.positionAt(s,u,o)),f.doc.resolve(n+a.positionAt(c-1,l-1,o)))),t(f)}var Q8e=bG({ArrowLeft:Fg("horiz",-1),ArrowRight:Fg("horiz",1),ArrowUp:Fg("vert",-1),ArrowDown:Fg("vert",1),"Shift-ArrowLeft":jg("horiz",-1),"Shift-ArrowRight":jg("horiz",1),"Shift-ArrowUp":jg("vert",-1),"Shift-ArrowDown":jg("vert",1),Backspace:Mg,"Mod-Backspace":Mg,Delete:Mg,"Mod-Delete":Mg});function iv(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function Fg(e,t){return(n,r,i)=>{if(!i)return!1;const o=n.selection;if(o instanceof At)return iv(n,r,je.near(o.$headCell,t));if(e!="horiz"&&!o.empty)return!1;const a=WZ(i,e,t);if(a==null)return!1;if(e=="horiz")return iv(n,r,je.near(n.doc.resolve(o.head+t),t));{const s=n.doc.resolve(a),u=LZ(s,e,t);let l;return u?l=je.near(u,1):t<0?l=je.near(n.doc.resolve(s.before(-1)),-1):l=je.near(n.doc.resolve(s.after(-1)),1),iv(n,r,l)}}}function jg(e,t){return(n,r,i)=>{if(!i)return!1;const o=n.selection;let a;if(o instanceof At)a=o;else{const u=WZ(i,e,t);if(u==null)return!1;a=new At(n.doc.resolve(u))}const s=LZ(a.$headCell,e,t);return s?iv(n,r,new At(a.$anchorCell,s)):!1}}function H8e(e,t){const n=e.state.doc,r=hp(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new At(r))),!0):!1}function Y8e(e,t,n){if(!ui(e.state))return!1;let r=K8e(n);const i=e.state.selection;if(i instanceof At){r||(r={width:1,height:1,rows:[q.from(J_(Xn(e.state.schema).cell,n))]});const o=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),s=Ft.get(o).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=V8e(r,s.right-s.left,s.bottom-s.top),VD(e.state,e.dispatch,a,s,r),!0}else if(r){const o=wC(e.state),a=o.start(-1);return VD(e.state,e.dispatch,a,Ft.get(o.node(-1)).findCell(o.pos-a),r),!0}else return!1}function G8e(e,t){var n;if(t.ctrlKey||t.metaKey)return;const r=zD(e,t.target);let i;if(t.shiftKey&&e.state.selection instanceof At)o(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&r&&(i=hp(e.state.selection.$anchor))!=null&&((n=yw(e,t))==null?void 0:n.pos)!=i.pos)o(i,t),t.preventDefault();else if(!r)return;function o(u,l){let c=yw(e,l);const f=xs.getState(e.state)==null;if(!c||!YF(u,c))if(f)c=u;else return;const p=new At(u,c);if(f||!e.state.selection.eq(p)){const h=e.state.tr.setSelection(p);f&&h.setMeta(xs,u.pos),e.dispatch(h)}}function a(){e.root.removeEventListener("mouseup",a),e.root.removeEventListener("dragstart",a),e.root.removeEventListener("mousemove",s),xs.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(xs,-1))}function s(u){const l=u,c=xs.getState(e.state);let f;if(c!=null)f=e.state.doc.resolve(c);else if(zD(e,l.target)!=r&&(f=yw(e,t),!f))return a();f&&o(f,l)}e.root.addEventListener("mouseup",a),e.root.addEventListener("dragstart",a),e.root.addEventListener("mousemove",s)}function WZ(e,t,n){if(!(e.state.selection instanceof Oe))return null;const{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){const o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if(o.type.spec.tableRole=="cell"||o.type.spec.tableRole=="header_cell"){const s=r.before(i),u=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(u)?s:null}}return null}function zD(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function yw(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});return n&&n?hp(e.state.doc.resolve(n.pos)):null}var NZ=class{constructor(t,n){this.node=t,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Z_(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,Z_(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function Z_(e,t,n,r,i,o){var a;let s=0,u=!0,l=t.firstChild;const c=e.firstChild;if(c){for(let f=0,p=0;f<c.childCount;f++){const{colspan:h,colwidth:A}=c.child(f).attrs;for(let g=0;g<h;g++,p++){const y=i==p?o:A&&A[g],C=y?y+"px":"";if(s+=y||r,y||(u=!1),l)l.style.width!=C&&(l.style.width=C),l=l.nextSibling;else{const _=document.createElement("col");_.style.width=C,t.appendChild(_)}}}for(;l;){const f=l.nextSibling;(a=l.parentNode)==null||a.removeChild(l),l=f}u?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}}var Xr=new rr("tableColumnResizing");function J8e({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=NZ,lastColumnResizable:i=!0}={}){const o=new Kn({key:Xr,state:{init(a,s){var u,l;const c=(l=(u=o.spec)==null?void 0:u.props)==null?void 0:l.nodeViews,f=Xn(s.schema).table.name;return r&&c&&(c[f]=(p,h)=>new r(p,n,h)),new Z8e(-1,!1)},apply(a,s){return s.apply(a)}},props:{attributes:a=>{const s=Xr.getState(a);return s&&s.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(a,s)=>{X8e(a,s,e,i)},mouseleave:a=>{eqe(a)},mousedown:(a,s)=>{tqe(a,s,t,n)}},decorations:a=>{const s=Xr.getState(a);if(s&&s.activeHandle>-1)return aqe(a,s.activeHandle)},nodeViews:{}}});return o}var Z8e=class ov{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,r=t.getMeta(Xr);if(r&&r.setHandle!=null)return new ov(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new ov(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let i=t.mapping.map(n.activeHandle,-1);return G_(t.doc.resolve(i))||(i=-1),new ov(i,n.dragging)}return n}};function X8e(e,t,n,r){if(!e.editable)return;const i=Xr.getState(e.state);if(i&&!i.dragging){const o=rqe(t.target);let a=-1;if(o){const{left:s,right:u}=o.getBoundingClientRect();t.clientX-s<=n?a=QD(e,t,"left",n):u-t.clientX<=n&&(a=QD(e,t,"right",n))}if(a!=i.activeHandle){if(!r&&a!==-1){const s=e.state.doc.resolve(a),u=s.node(-1),l=Ft.get(u),c=s.start(-1);if(l.colCount(s.pos-c)+s.nodeAfter.attrs.colspan-1==l.width-1)return}KZ(e,a)}}}function eqe(e){if(!e.editable)return;const t=Xr.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&KZ(e,-1)}function tqe(e,t,n,r){var i;if(!e.editable)return!1;const o=(i=e.dom.ownerDocument.defaultView)!=null?i:window,a=Xr.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;const s=e.state.doc.nodeAt(a.activeHandle),u=nqe(e,a.activeHandle,s.attrs);e.dispatch(e.state.tr.setMeta(Xr,{setDragging:{startX:t.clientX,startWidth:u}}));function l(f){o.removeEventListener("mouseup",l),o.removeEventListener("mousemove",c);const p=Xr.getState(e.state);p!=null&&p.dragging&&(iqe(e,p.activeHandle,HD(p.dragging,f,n)),e.dispatch(e.state.tr.setMeta(Xr,{setDragging:null})))}function c(f){if(!f.which)return l(f);const p=Xr.getState(e.state);if(p&&p.dragging){const h=HD(p.dragging,f,n);YD(e,p.activeHandle,h,r)}}return YD(e,a.activeHandle,u,r),o.addEventListener("mouseup",l),o.addEventListener("mousemove",c),t.preventDefault(),!0}function nqe(e,t,{colspan:n,colwidth:r}){const i=r&&r[r.length-1];if(i)return i;const o=e.domAtPos(t);let s=o.node.childNodes[o.offset].offsetWidth,u=n;if(r)for(let l=0;l<n;l++)r[l]&&(s-=r[l],u--);return s/u}function rqe(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function QD(e,t,n,r){const i=n=="right"?-r:r,o=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!o)return-1;const{pos:a}=o,s=hp(e.state.doc.resolve(a));if(!s)return-1;if(n=="right")return s.pos;const u=Ft.get(s.node(-1)),l=s.start(-1),c=u.map.indexOf(s.pos-l);return c%u.width==0?-1:l+u.map[c-1]}function HD(e,t,n){const r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function KZ(e,t){e.dispatch(e.state.tr.setMeta(Xr,{setHandle:t}))}function iqe(e,t,n){const r=e.state.doc.resolve(t),i=r.node(-1),o=Ft.get(i),a=r.start(-1),s=o.colCount(r.pos-a)+r.nodeAfter.attrs.colspan-1,u=e.state.tr;for(let l=0;l<o.height;l++){const c=l*o.width+s;if(l&&o.map[c]==o.map[c-o.width])continue;const f=o.map[c],p=i.nodeAt(f).attrs,h=p.colspan==1?0:s-o.colCount(f);if(p.colwidth&&p.colwidth[h]==n)continue;const A=p.colwidth?p.colwidth.slice():oqe(p.colspan);A[h]=n,u.setNodeMarkup(a+f,null,{...p,colwidth:A})}u.docChanged&&e.dispatch(u)}function YD(e,t,n,r){const i=e.state.doc.resolve(t),o=i.node(-1),a=i.start(-1),s=Ft.get(o).colCount(i.pos-a)+i.nodeAfter.attrs.colspan-1;let u=e.domAtPos(i.start(-1)).node;for(;u&&u.nodeName!="TABLE";)u=u.parentNode;u&&Z_(o,u.firstChild,u,r,s,n)}function oqe(e){return Array(e).fill(0)}function aqe(e,t){var n;const r=[],i=e.doc.resolve(t),o=i.node(-1);if(!o)return Mt.empty;const a=Ft.get(o),s=i.start(-1),u=a.colCount(i.pos-s)+i.nodeAfter.attrs.colspan-1;for(let l=0;l<a.height;l++){const c=u+l*a.width;if((u==a.width-1||a.map[c]!=a.map[c+1])&&(l==0||a.map[c]!=a.map[c-a.width])){const f=a.map[c],p=s+f+o.nodeAt(f).nodeSize-1,h=document.createElement("div");h.className="column-resize-handle",(n=Xr.getState(e))!=null&&n.dragging&&r.push($r.node(s+f,s+f+o.nodeAt(f).nodeSize,{class:"column-resize-dragging"})),r.push($r.widget(p,h))}}return Mt.create(e.doc,r)}function sqe({allowTableNodeSelection:e=!1}={}){return new Kn({key:xs,state:{init(){return null},apply(t,n){const r=t.getMeta(xs);if(r!=null)return r==-1?null:r;if(n==null||!t.docChanged)return n;const{deleted:i,pos:o}=t.mapping.mapResult(n);return i?null:o}},props:{decorations:C8e,handleDOMEvents:{mousedown:G8e},createSelectionBetween(t){return xs.getState(t.state)!=null?t.state.selection:null},handleTripleClick:H8e,handleKeyDown:Q8e,handlePaste:Y8e},appendTransaction(t,n,r){return _8e(r,PZ(r,n),e)}})}function X_(e,t){return t?["width",`${Math.max(t,e)}px`]:["min-width",`${e}px`]}function GD(e,t,n,r,i,o){var a;let s=0,u=!0,l=t.firstChild;const c=e.firstChild;if(c!==null)for(let f=0,p=0;f<c.childCount;f+=1){const{colspan:h,colwidth:A}=c.child(f).attrs;for(let g=0;g<h;g+=1,p+=1){const y=i===p?o:A&&A[g],C=y?`${y}px`:"";if(s+=y||r,y||(u=!1),l){if(l.style.width!==C){const[_,b]=X_(r,y);l.style.setProperty(_,b)}l=l.nextSibling}else{const _=document.createElement("col"),[b,v]=X_(r,y);_.style.setProperty(b,v),t.appendChild(_)}}}for(;l;){const f=l.nextSibling;(a=l.parentNode)===null||a===void 0||a.removeChild(l),l=f}u?(n.style.width=`${s}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${s}px`)}class uqe{constructor(t,n){this.node=t,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),GD(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!==this.node.type?!1:(this.node=t,GD(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return t.type==="attributes"&&(t.target===this.table||this.colgroup.contains(t.target))}}function lqe(e,t,n,r){let i=0,o=!0;const a=[],s=e.firstChild;if(!s)return{};for(let f=0,p=0;f<s.childCount;f+=1){const{colspan:h,colwidth:A}=s.child(f).attrs;for(let g=0;g<h;g+=1,p+=1){const y=n===p?r:A&&A[g];i+=y||t,y||(o=!1);const[C,_]=X_(t,y);a.push(["col",{style:`${C}: ${_}`}])}}const u=o?`${i}px`:"",l=o?"":`${i}px`;return{colgroup:["colgroup",{},...a],tableWidth:u,tableMinWidth:l}}function JD(e,t){return t?e.createChecked(null,t):e.createAndFill()}function cqe(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;const t={};return Object.keys(e.nodes).forEach(n=>{const r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}function dqe(e,t,n,r,i){const o=cqe(e),a=[],s=[];for(let l=0;l<n;l+=1){const c=JD(o.cell,i);if(c&&s.push(c),r){const f=JD(o.header_cell,i);f&&a.push(f)}}const u=[];for(let l=0;l<t;l+=1)u.push(o.row.createChecked(null,r&&l===0?a:s));return o.table.createChecked(null,u)}function fqe(e){return e instanceof At}const Lg=({editor:e})=>{const{selection:t}=e.state;if(!fqe(t))return!1;let n=0;const r=aJ(t.ranges[0].$from,o=>o.type.name==="table");return r==null||r.node.descendants(o=>{if(o.type.name==="table")return!1;["tableCell","tableHeader"].includes(o.type.name)&&(n+=1)}),n===t.ranges.length?(e.commands.deleteTable(),!0):!1},pqe=sn.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:uqe,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:e,HTMLAttributes:t}){const{colgroup:n,tableWidth:r,tableMinWidth:i}=lqe(e,this.options.cellMinWidth);return["table",Dt(this.options.HTMLAttributes,t,{style:r?`width: ${r}`:`min-width: ${i}`}),n,["tbody",0]]},addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:o})=>{const a=dqe(o.schema,e,t,n);if(i){const s=r.selection.from+1;r.replaceSelectionWith(a).scrollIntoView().setSelection(Oe.near(r.doc.resolve(s)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>I8e(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>E8e(e,t),deleteColumn:()=>({state:e,dispatch:t})=>$8e(e,t),addRowBefore:()=>({state:e,dispatch:t})=>O8e(e,t),addRowAfter:()=>({state:e,dispatch:t})=>M8e(e,t),deleteRow:()=>({state:e,dispatch:t})=>j8e(e,t),deleteTable:()=>({state:e,dispatch:t})=>N8e(e,t),mergeCells:()=>({state:e,dispatch:t})=>BD(e,t),splitCell:()=>({state:e,dispatch:t})=>PD(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>Hh("column")(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>Hh("row")(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>P8e(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>BD(e,t)?!0:PD(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>U8e(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>ND(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>ND(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&PZ(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){const r=At.create(t.doc,e.anchorCell,e.headCell);t.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:Lg,"Mod-Backspace":Lg,Delete:Lg,"Mod-Delete":Lg}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[J8e({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],sqe({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){const t={name:e.name,options:e.options,storage:e.storage};return{tableRole:We(de(e,"tableRole",t))}}}),qZ=sn.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?t.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:e}){return["td",Dt(this.options.HTMLAttributes,e),0]}}),VZ=sn.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?t.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:e}){return["th",Dt(this.options.HTMLAttributes,e),0]}}),zZ=sn.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:e}){return["tr",Dt(this.options.HTMLAttributes,e),0]}});function hqe({editor:e}){const t=I.useRef(null),n=e.isActive("table")&&e.isActive("innerTable");function r(){e.commands.addColumnToEnd()&&t.current&&(t.current.scrollLeft=t.current.scrollWidth)}return d.jsxs(LF,{ref:t,className:m.tableFieldStyles.tableWithControls,children:[d.jsxs("div",{className:m.tableFieldStyles.tableOuterWrapper,children:[d.jsx(y6e,{}),d.jsx("button",{type:"button",className:m.tableFieldStyles.addTableRowButton,onClick:e.commands.addRowToEnd,"aria-disabled":!n,"aria-label":"Add row",title:"Add row",children:d.jsx(m.Icon,{name:"add",size:"small"})})]}),d.jsx("button",{type:"button",className:m.tableFieldStyles.addTableColumnButton,onClick:r,"aria-disabled":!n,"aria-label":"Add column",title:"Add column",children:d.jsx(m.Icon,{name:"add",size:"small"})})]})}function _C(e,t){const n=e.nodes[t];if(!n)throw new Error(`Unwanted state: ${t} not found in schema.`);return n}function QZ(e){return t=>{switch(t.type){case"hyperlink":case"paragraph":case"strong":case"em":return Mr.converter.fromPrismic(e)(t)||[];default:return[]}}}const ZD={fromPrismic(e){return function(t){return _C(e,qZ.name).create({colspan:1,rowspan:1,colwidth:null},t.content.value.flatMap(QZ(e)))}},toPrismic(e){const t=[];return e.content.forEach(n=>{const r=Mr.converter.toPrismic(n);fe.TextBlock.is(r)&&t.push(r)}),{type:"tableCell",content:{__TYPE__:"StructuredTextContent",value:t}}}},XD={fromPrismic(e){return function(t){return _C(e,VZ.name).create({colspan:1,rowspan:1,colwidth:null},t.content.value.flatMap(QZ(e)))}},toPrismic(e){const t=[];return e.content.forEach(n=>{const r=Mr.converter.toPrismic(n);fe.TextBlock.is(r)&&t.push(r)}),{type:"tableHeader",content:{__TYPE__:"StructuredTextContent",value:t}}}},eU={fromPrismic(e){return function(t){return _C(e,zZ.name).create({},t.content.map(r=>{switch(r.type){case"tableHeader":return XD.fromPrismic(e)(r);case"tableCell":return ZD.fromPrismic(e)(r)}}))}},toPrismic(e){const t=[];return e.content.forEach(n=>{switch(n.type.name){case"tableHeader":{t.push(XD.toPrismic(n));break}case"tableCell":{t.push(ZD.toPrismic(n));break}}}),{type:"tableRow",content:t}}},ex=pqe.extend({name:"innerTable",group:"table",addNodeView(){return({node:e})=>new NZ(e,120)},addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),addRowToEnd:()=>({dispatch:t,state:n})=>{if(!ui(n))return!1;if(t){const r=Ri(n),i=r.map.height;t(JF(n.tr,r,i))}return!0},addColumnToEnd:()=>({dispatch:t,state:n})=>{if(!ui(n))return!1;if(t){const r=Ri(n),i=r.map.width;t(GF(n.tr,r,i))}return!0}}}}),Aqe={fromPrismic(e){return function(t){const r=_C(e,ex.name).create({},t.content.map(eU.fromPrismic(e))),i=e.nodes[HZ.name];return i?i.create({},r):r}},toPrismic(e){var n;const t=((n=e.content.firstChild)==null?void 0:n.type.name)===ex.name?e.content.firstChild:e;return{type:"table",content:Qs.children.map(t,r=>eU.toPrismic(r))}}},HZ=sn.create({name:"table",group:"block",content:"innerTable",selectable:!1,parseHTML(){return[{tag:"div"}]},renderHTML({HTMLAttributes:e}){return["div",e,0]},addNodeView(){return DF(hqe)}}),mqe=new j6e([al.table],al.table,[HZ,ex,zZ,VZ,qZ],Aqe),YZ=[BF,VF,wZ],GZ=[...YZ,zF];function JZ(e){return x6e(e)?[...YZ,Mr,mqe].filter(Qi.isDefined):[Mr,sy,ly,Wu.build(e),cZ,fZ,vZ,...GZ].filter(Qi.isDefined)}const ZZ=[{nodeType:he.RichTextNodeType.paragraph,icon:"textFields",isActive:e=>e.isActive(Mr.name)&&!e.isActive(sy.name)&&!e.isActive(ly.name),runCommands:Pt((e,t)=>e.clearNodes().setDirection(Ki(t))),shortText:"par",text:"Paragraph"},{nodeType:he.RichTextNodeType.heading1,icon:"looks1",isActive:e=>e.isActive(Wu.name,{level:1}),runCommands:Pt((e,t)=>e.setHeading({level:1}).setDirection(Ki(t))),shortText:"h1",text:"Heading 1"},{nodeType:he.RichTextNodeType.heading2,icon:"looks2",isActive:e=>e.isActive(Wu.name,{level:2}),runCommands:Pt((e,t)=>e.setHeading({level:2}).setDirection(Ki(t))),shortText:"h2",text:"Heading 2"},{nodeType:he.RichTextNodeType.heading3,icon:"looks3",isActive:e=>e.isActive(Wu.name,{level:3}),runCommands:Pt((e,t)=>e.setHeading({level:3}).setDirection(Ki(t))),shortText:"h3",text:"Heading 3"},{nodeType:he.RichTextNodeType.heading4,icon:"looks4",isActive:e=>e.isActive(Wu.name,{level:4}),runCommands:Pt((e,t)=>e.setHeading({level:4}).setDirection(Ki(t))),shortText:"h4",text:"Heading 4"},{nodeType:he.RichTextNodeType.heading5,icon:"looks5",isActive:e=>e.isActive(Wu.name,{level:5}),runCommands:Pt((e,t)=>e.setHeading({level:5}).setDirection(Ki(t))),shortText:"h5",text:"Heading 5"},{nodeType:he.RichTextNodeType.heading6,icon:"looks6",isActive:e=>e.isActive(Wu.name,{level:6}),runCommands:Pt((e,t)=>e.setHeading({level:6}).setDirection(Ki(t))),shortText:"h6",text:"Heading 6"},{nodeType:he.RichTextNodeType.list,icon:"formatListBulleted",isActive:e=>e.isActive(sy.name),runCommands:Pt((e,t)=>e.toggleBulletList().setDirection(Ki(t))),shortText:"bull",text:"Bulleted list"},{nodeType:he.RichTextNodeType.orderedList,icon:"formatListNumbered",isActive:e=>e.isActive(ly.name),runCommands:Pt((e,t)=>e.toggleOrderedList().setDirection(Ki(t))),shortText:"num",text:"Numbered list"},{nodeType:he.RichTextNodeType.preformatted,icon:"dataObject",isActive:e=>e.isActive(cZ.name),runCommands:Pt((e,t)=>e.setCodeBlock().setDirection(Ki(t))),shortText:"code",text:"Code"},{nodeType:he.RichTextNodeType.embed,icon:"cloud",isActive:e=>e.isActive(fZ.name),runCommands:Pt(e=>e.setEmbed()),shortText:"emb",text:"Embed"},{nodeType:he.RichTextNodeType.image,icon:"image",isActive:e=>e.isActive(vZ.name),runCommands:Pt(e=>e.setImage()),shortText:"img",text:"Image"}],gqe=[{nodeType:he.RichTextNodeType.strong,icon:"formatBold",isActive:e=>e.isActive(BF.name),runCommands:Pt(e=>e.toggleBold())},{nodeType:he.RichTextNodeType.em,icon:"formatItalic",isActive:e=>e.isActive(VF.name),runCommands:Pt(e=>e.toggleItalic())}],vqe=[{nodeType:he.RichTextNodeType.rtl,icon:"formatTextDirectionRToL",isActive:e=>e.isActive({[ga]:Yu}),runCommands:Pt((e,t)=>e.toggleDirection(Ki(t)))}];function Pt(e){return(t,n={})=>{let r=n.can===!0?t.can().chain():t.chain().focus();return n.deleteRange!==void 0&&(r=r.deleteRange(n.deleteRange)),n.can?yqe(t,r,e):e(r,t).run()}}function Ki(e){const t=e.state.selection.$from.parent.attrs;return Ia.parseNodeAttrsDirection(t)}function av(e,t){return e.filter(n=>t.includes(n.nodeType))}function yqe(e,t,n){try{return n(t,e).run()}catch{return!1}}function bqe(e){const{items:t,editor:n}=e;return t.length===0?null:d.jsxs(d.Fragment,{children:[t.map(r=>d.jsx(m.ToolbarToggleButton,{disabled:!r.runCommands(n,{can:!0}),onPressedChange:()=>{r.runCommands(n)},pressed:r.isActive(n),startIcon:r.icon},r.nodeType)),d.jsx(m.ToolbarSeparator,{})]})}function Cqe(e){const{labels:t,editor:n}=e,r=n.getAttributes("label").label;return d.jsxs(d.Fragment,{children:[d.jsxs(m.DropdownMenu,{children:[d.jsx(m.DropdownMenuTrigger,{disabled:t.length===0,children:d.jsx(m.Button,{endIcon:"arrowDropDown",size:"small",color:"grey",children:tU(r??"Labels")})}),d.jsx(m.DropdownMenuContent,{align:"start",asPortal:!1,maxHeight:256,avoidCollisions:!1,children:t.map((i,o)=>{const a=r===i;return d.jsx(m.DropdownMenuItem,{onSelect:()=>a?n.commands.unsetLabel():Sqe(n,i),endIcon:a&&d.jsx(m.Icon,{name:"check",size:"extraSmall"}),children:tU(i)},`${i}-${o}`)})})]}),d.jsx(m.ToolbarSeparator,{})]})}function Sqe(e,t){Pt(r=>r.setLabel({label:t}))(e)}function tU(e){return ri.overflow(e,20)}function wqe(e){const{editor:t}=e,n=t.getAttributes("label");if(!n.label)return null;const r=n.label;return d.jsx(m.Box,{backgroundColor:"purple9",padding:{block:2,inline:4},alignItems:"center",borderRadius:{topLeft:2,topRight:2,bottomRight:2},maxWidth:125,children:d.jsx(m.Text,{color:"white",variant:"small",noWrap:!0,children:r})})}function _qe(e){const{disabled:t,showWebLinkModal:n,showDocumentsLinkModal:r,showMediaLinkModal:i}=xqe(e);return d.jsxs(d.Fragment,{children:[d.jsxs(m.ToolbarButtonGroup,{density:"compact",children:[d.jsx(m.ToolbarButton,{disabled:t,startIcon:"link",onClick:n},he.RichTextNodeType.hyperlink),d.jsxs(m.DropdownMenu,{children:[d.jsx(m.DropdownMenuTrigger,{children:d.jsx(m.ToolbarButton,{startIcon:"arrowDropDown"})}),d.jsxs(m.DropdownMenuContent,{align:"end",asPortal:!1,children:[d.jsx(m.DropdownMenuItem,{startIcon:d.jsx(m.Icon,{name:"public"}),onSelect:n,children:"Link to web page"}),d.jsx(m.DropdownMenuItem,{startIcon:d.jsx(m.Icon,{name:"description"}),onSelect:r,children:"Link to document"}),d.jsx(m.DropdownMenuItem,{startIcon:d.jsx(m.Icon,{name:"image"}),onSelect:i,children:"Link to media"})]})]})]}),d.jsx(m.ToolbarSeparator,{})]})}function xqe(e){const{editor:t,setModal:n}=e;function r(){n("webLink")}function i(){n("documentLink")}function o(){n("mediaLink")}return{disabled:!Pt(s=>s.setWebLink({href:""}))(t,{can:!0}),showWebLinkModal:r,showDocumentsLinkModal:i,showMediaLinkModal:o}}function Tqe(e){const{docId:t,onEdit:n,onUnlink:r}=e,i=Iqe(t),o=we();if(!i)return null;const a=i.versions[0],s=KM({status:a==null?void 0:a.status,releaseId:(a==null?void 0:a.status)==="release"?a.release_id:void 0,documentId:i.id,versionId:a==null?void 0:a.version_id,baseUrl:o.baseUrl}),u=(a==null?void 0:a.preview_summary)??"",l=(a==null?void 0:a.custom_type_label)??"";return d.jsx(Sl,{url:s,title:i.title,subTitle:l,description:u,onEdit:n,onUnlink:r,largeIconName:"description"})}function Iqe(e){const t=we();t.searchDocuments||Rt("searchDocuments");const{coreApiBaseUrl:n,authStrategy:r}=t;return et.useRequest(zm,[n,r,e])}function Eqe(e){const{editor:t}=e,{searchDocuments:n}=we(),r=t.getAttributes(he.RichTextNodeType.hyperlink);if(r.id&&n){const i=r.id;return d.jsx(Rqe,{docId:i,...e})}if(r.href){const i=r.href;return d.jsx($qe,{url:i,...e})}if(r.media){const i=_Z(r.media);return d.jsx(kqe,{media:i,...e})}return null}function Rqe(e){const{editor:t,onEditDocumentLink:n,docId:r}=e;return d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(Sl,{title:"Failed to Load Linked Document Data",error:!0,onEdit:n,onUnlink:()=>ul(t)}),children:d.jsx(I.Suspense,{fallback:d.jsx(Sl,{loading:!0,onEdit:n,onUnlink:()=>ul(t)}),children:d.jsx(Tqe,{docId:r,onEdit:n,onUnlink:()=>ul(t)})})})}function $qe(e){const{url:t,editor:n,onEditWebLink:r}=e,i=ni.toURL(t);return i?d.jsx(Sl,{url:t,title:ni.getUrlTitle(i),subTitle:t,onEdit:r,onUnlink:()=>ul(n)}):d.jsx(Sl,{url:t,subTitle:t,onEdit:r,onUnlink:()=>ul(n)})}function kqe(e){const{media:t,editor:n,onEditMediaLink:r}=e;return fe.FilledImageLinkContent.is(t)?d.jsx(uY,{url:t.url,title:t.name,subTitle:`${t.width} x ${t.height} pixels`,onEdit:r,onUnlink:()=>ul(n)}):fe.FilledFileLinkContent.is(t)?d.jsx(Sl,{url:t.url,title:t.name,subTitle:Oqe({filename:t.name}),largeIconName:"insertDriveFile",onEdit:r,onUnlink:()=>ul(n)}):null}function ul(e){Pt(n=>n.unsetLink())(e)}function Oqe(e){const{filename:t}=e,n=t.split(".").pop();return n?n.toLowerCase():""}function Mqe(e){const{open:t}=e,{onOpenChange:n,onSelectDocument:r}=Fqe(e);return d.jsx(iY,{open:t,onOpenChange:n,onSelectDocument:r})}function Fqe(e){const{editor:t,setOpen:n}=e;function r(o){Pt(s=>s.extendMarkRange(he.RichTextNodeType.hyperlink).setDocumentLink({id:o}))(t),n(!1)}function i(o){n(o)}return{onSelectDocument:r,onOpenChange:i}}function jqe(e){const{open:t}=e,{onOpenChange:n,onMediaSelected:r}=Lqe(e);return d.jsx(rF,{open:t,onOpenChange:n,onMediaSelected:r,assetType:"all"})}function Lqe(e){const{editor:t,setOpen:n}=e;function r(i){Pt(a=>a.extendMarkRange(he.RichTextNodeType.hyperlink).setMediaLink({media:i}))(t),n(!1)}return{onMediaSelected:r,onOpenChange:n}}function Dqe(e){const{open:t,setOpen:n}=e,{url:r,setUrl:i,openInNewTab:o,setOpenInNewTab:a,disabled:s,onUpdate:u}=Uqe(e);return d.jsxs(m.Dialog,{open:t,onOpenChange:n,size:"small",noDescription:!0,children:[d.jsx(m.DialogHeader,{title:"Set Link URL"}),d.jsxs(m.DialogContent,{padding:16,children:[d.jsx(m.FormInput,{value:r,onValueChange:i,placeholder:"Paste URL",icon:"public"}),r&&d.jsx(m.InlineLabel,{value:"Open in new tab",children:d.jsx(m.Checkbox,{checked:o,onCheckedChange:a})})]}),d.jsxs(m.DialogActions,{children:[d.jsx(m.DialogCancelButton,{}),d.jsx(m.DialogActionButton,{onClick:u,disabled:s,children:"Update"})]})]})}function Uqe(e){const{editor:t,open:n,setOpen:r}=e,i=Bqe(t),[o,a]=I.useState(i.url),[s,u]=I.useState(i.openInNewTab);ze.useOnChange(n,()=>{n&&(a(i.url),u(i.openInNewTab))});const l=!o||o===i.url&&s===i.openInNewTab;function c(){const f=s?"_blank":"_self";Pt(p=>p.extendMarkRange(he.RichTextNodeType.hyperlink).setWebLink({href:o,target:f}))(t),r(!1)}return{url:o,setUrl:a,openInNewTab:s,disabled:l,setOpenInNewTab:u,onUpdate:c}}function Bqe(e){const t=e.getAttributes(he.RichTextNodeType.hyperlink);return{url:t.href??"",openInNewTab:t.target==="_blank"}}function Pqe(e){const{items:t,editor:n}=e;return t.length===0?null:d.jsxs(d.Fragment,{children:[d.jsx(m.ToolbarToggleButtonGroup,{onValueChange:r=>{t.forEach(i=>{(i.isActive(n)&&!r.includes(i.nodeType)||!i.isActive(n)&&r.includes(i.nodeType))&&i.runCommands(n)})},type:"multiple",value:t.filter(r=>r.isActive(n)).map(r=>r.nodeType),children:t.map(r=>d.jsx(m.ToolbarToggleButtonGroupItem,{disabled:!r.runCommands(n,{can:!0}),startIcon:r.icon,value:r.nodeType},r.nodeType))},"mark"),d.jsx(m.ToolbarSeparator,{})]})}function Wqe(e){var r;const{items:t,editor:n}=e;return t.length===0?null:d.jsxs(d.Fragment,{children:[d.jsxs(m.DropdownMenu,{children:[d.jsx(m.DropdownMenuTrigger,{disabled:t.length===1,children:d.jsx(m.Button,{endIcon:"arrowDropDown",size:"small",color:"grey",children:((r=t.find(i=>i.isActive(n)))==null?void 0:r.text)??""})}),d.jsx(m.DropdownMenuContent,{align:"start",asPortal:!1,maxHeight:256,avoidCollisions:!1,children:t.map(i=>d.jsx(m.DropdownMenuItem,{onSelect:()=>{i.runCommands(n)},children:i.text},i.nodeType))})]}),d.jsx(m.ToolbarSeparator,{})]})}function bw(e){return{duration:100,hideOnClick:!0,offset:e,placement:"top-start",appendTo:document.querySelector("body > div")??"parent"}}function Nqe(e){const{editor:t,nodeTypes:n,labels:r,hideDisabledOptions:i=!1}=e,[o,a]=I.useState(),s=n.includes(he.RichTextNodeType.hyperlink),u=!o,{shouldShowBubbleMenu:l,shouldshowPopover:c}=qqe({editor:t}),[f,p]=I.useState(!0);I.useEffect(()=>{p(!1)},[]);function h(y){a(y?"webLink":void 0)}function A(y){a(y?"documentLink":void 0)}function g(y){a(y?"mediaLink":void 0)}return f?null:d.jsxs(d.Fragment,{children:[d.jsx(aw,{editor:t,tippyOptions:bw([-48,0]),shouldShow:l,children:u&&d.jsx(Kqe,{editor:t,nodeTypes:n,labels:r,setModal:a,hideDisabledOptions:i})}),d.jsx(aw,{editor:t,tippyOptions:bw([-48,0]),shouldShow:y=>c(y,"hyperlink"),children:u&&d.jsx(Eqe,{editor:t,onEditWebLink:()=>a("webLink"),onEditDocumentLink:()=>a("documentLink"),onEditMediaLink:()=>a("mediaLink")})}),d.jsx(aw,{editor:t,tippyOptions:bw([0,0]),shouldShow:y=>c(y,"label"),children:d.jsx(wqe,{editor:t})}),s&&d.jsxs(d.Fragment,{children:[d.jsx(Dqe,{open:o==="webLink",setOpen:h,editor:t}),d.jsx(Mqe,{open:o==="documentLink",setOpen:A,editor:t}),d.jsx(jqe,{open:o==="mediaLink",setOpen:g,editor:t})]})]})}function Kqe(e){const{editor:t,nodeTypes:n,labels:r,setModal:i,hideDisabledOptions:o}=e,a=n.includes("hyperlink"),s=r.length>0,u=av(ZZ,n),l=av(gqe,n),c=av(vqe,n),f=o&&u.length===1?0:u.length,p=f+l.length+c.length+Number(a);return p===0?null:d.jsxs(m.Toolbar,{children:[f>0&&d.jsx(Wqe,{items:u,editor:t}),s&&d.jsx(Cqe,{labels:r,editor:t}),d.jsx(Pqe,{items:l,editor:t}),a&&d.jsx(_qe,{editor:t,setModal:i}),d.jsx(bqe,{items:c,editor:t}),p>1&&d.jsx(m.ToolbarButton,{onClick:()=>{t.chain().focus().clearNodes().unsetAllMarks().run()},startIcon:"formatClear"},"clear")]})}function qqe(e){const{editor:t}=e;function n(i){const{view:o,state:a,from:s,to:u}=i;if(!o.hasFocus())return!1;const{doc:l,selection:c}=a;return!(t.isActive(he.RichTextNodeType.preformatted)||c.empty||l.textBetween(s,u).length===0)}function r(i,o){const{view:a,state:s,from:u,to:l}=i,c=a.state.doc.nodeAt(u),{doc:f,selection:p}=s;return!p.empty||f.textBetween(u,l).length>0?!1:!!(c!=null&&c.marks.some(A=>A.type.name===o))}return{shouldShowBubbleMenu:n,shouldshowPopover:r}}function XZ(e){const{content:t,field:n,id:r,readOnly:i,padding:o="normal",scroll:a="hidden"}=e,s=Vqe(n),u=t&&M_.converter(s.nodeExtensions).fromPrismic(s.schema,s.nodeTypes,t),l=ze.useStableCallback(e.onContentChange),c=m.useEditor({content:u==null?void 0:u.toJSON(),editable:!i,editorProps:{attributes:{class:w6e(o==="zero"?m.contentEditableNoPaddingClass:m.contentEditableClass,m.contentEditableMultilinePlaceholderClass),id:r,tabIndex:"0"}},extensions:s.allComponents,injectCSS:!1,onUpdate({editor:f}){if(f.isEmpty)return l(void 0);const p=M_.converter(s.nodeExtensions).toPrismic(f.state.doc);l(p)}},[s,i]);return d.jsxs(m.Field,{display:a==="x-auto"?"grid":"flex",children:[d.jsx(m.FieldLabel,{htmlFor:r,children:wr(n)}),d.jsxs(m.FieldControl,{children:[c.isEditable&&d.jsx(Nqe,{editor:c,nodeTypes:s.names,labels:s.labels,hideDisabledOptions:!0}),d.jsx(A6e,{editor:c,style:{width:"100%"}})]})]})}function Vqe(e){var n,r;const t=`${((n=e.config)==null?void 0:n.multi)??""}-${((r=e.config)==null?void 0:r.single)??""}`;return I.useMemo(()=>{var A;const{extensions:i,nodeTypes:o}=D6e(e.config),a=i.filter(zqe),s=i.flatMap(g=>g.richTextNodeTypes);o.has(mD)&&s.push(mD);const u=i.flatMap(g=>g.component),l=i.filter(Qqe).map(g=>g.name),c=[...u,...s9e(e,a),g4e.configure({supportedExtensionNames:l}),I3e,C3e],f=c.map(g=>g.name),p=DKe(c),h=Hqe((A=e.config)==null?void 0:A.labels);return{allComponents:c,extensionNames:f,nodeTypes:o,nodeExtensions:a,names:s,schema:p,labels:h}},[t])}function zqe(e){return e.extType===Mc.Node}function Qqe(e){return!(e.extType!==Mc.Node||e.nodeType!==Hu.Text||e.lockedFormat)}function Hqe(e){return Array.from(e??[])}function Yqe(e){const{content:t,field:n,id:r,readOnly:i,onContentChange:o}=e,{placeholder:a,options:s}=n.config??{},u=!!(s!=null&&s.includes("")),l=Zqe(n),c=Gqe({content:t,placeholder:a,defaultValue:l,canHaveEmptyValue:u}),f=a&&l===void 0||a===void 0&&!u;return d.jsxs(m.Field,{children:[d.jsx(m.FieldIcon,{name:"arrowDropDownCircle"}),d.jsx(m.FieldLabel,{htmlFor:r,children:wr(n)}),d.jsx(m.FieldControl,{children:d.jsxs(m.Select,{id:r,size:"large",color:"grey",value:c,disabled:i,renderTrigger:()=>d.jsx(m.SelectGhostTrigger,{id:r}),onValueChange:p=>{o(Jqe({value:p,placeholder:a}))},children:[f&&d.jsx(m.SelectItem,{value:a||cy,children:a||""}),s==null?void 0:s.map(p=>d.jsx(m.SelectItem,{value:p||cy,children:p},p))]})})]})}function Gqe(e){const{content:t,placeholder:n,defaultValue:r,canHaveEmptyValue:i}=e;let{value:o}=t??{};return o===""&&i?cy:(o===""&&(o=void 0),o??r??n??"")}function Jqe(e){const{placeholder:t}=e;let{value:n}=e;if(n!==t)return n===cy&&(n=""),{__TYPE__:"FieldContent",type:"Select",value:n}}function Zqe(e){var t,n;return((t=e.config)==null?void 0:t.default_value)===void 0||(n=e.config.options)==null?void 0:n[0]}const cy=" ",nU=eX(2,3),Xqe={__TYPE__:"TableContent",content:eX(1,1)};function e7e(e){const{field:t,content:n,onContentChange:r,...i}=e;function o(a){if(!a)return r(Xqe);e.onContentChange(r7e(a))}return d.jsx(XZ,{...i,field:i7e(t),content:t7e(n),onContentChange:o,scroll:"x-auto",padding:"zero"})}function eX(e,t){return Array.from({length:e},()=>({type:"tableRow",content:Array.from({length:t},()=>({type:"tableCell",content:{__TYPE__:"StructuredTextContent",value:[{type:"paragraph",content:{text:""}}]}}))}))}function t7e(e){return{__TYPE__:"StructuredTextContent",value:[{type:"table",content:n7e(e)}]}}function n7e(e){const t=fe.TableContent.decode(e);return t._tag==="Left"||!t.right.content.some(r=>r.content.some(i=>i.content.value.some(({type:o})=>o)))?nU:t.right.content}function r7e(e){return{__TYPE__:"TableContent",content:e.value.flatMap(t=>t.type==="table"?t.content:[])}}function i7e(e){var t;return{...he.TableCell,config:{...he.TableCell.config,label:(t=e.config)==null?void 0:t.label,allowTargetBlank:!0,multi:[he.TableCell.config.multi,al.table].join(",")}}}function o7e(e){const{id:t,readOnly:n,field:r,content:i,onContentChange:o}=e,a=i!=null&&i.value?rx.dateFromISOString(i.value):void 0;return d.jsxs(m.Field,{children:[d.jsx(m.FieldIcon,{name:"event"}),d.jsx(m.FieldLabel,{id:t,children:wr(r)}),d.jsx(m.FieldControl,{children:d.jsx(m.Box,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:d.jsx(m.DateInput,{mode:"date-time","aria-labelledby":t,disabled:n,value:a,onValueChange:s=>o(a7e(s))})})})]})}function a7e(e){if(e)return{__TYPE__:"FieldContent",type:"Timestamp",value:s7e(e)}}function s7e(e){const t=`${e.getUTCFullYear()}`.padStart(4,"0"),n=`${e.getUTCMonth()+1}`.padStart(2,"0"),r=`${e.getUTCDate()}`.padStart(2,"0"),i=`${e.getUTCHours()}`.padStart(2,"0"),o=`${e.getUTCMinutes()}`.padStart(2,"0");return`${t}-${n}-${r}T${i}:${o}:00+00:00`}function xC(e){const{id:t,readOnly:n,content:r,nestableWidget:i}=e,o=ze.useStableCallback(e.onContentChange);return I.useMemo(()=>{const a={id:t,readOnly:n,onContentChange:o};return i.type==="Boolean"?d.jsx(tUe,{...a,field:i,content:fe.isBooleanContent(r)?r:void 0}):i.type==="Date"?d.jsx(oUe,{...a,field:i,content:fe.isDateContent(r)?r:void 0}):i.type==="Timestamp"?d.jsx(o7e,{...a,field:i,content:fe.isTimestampContent(r)?r:void 0}):i.type==="Image"?d.jsx(PBe,{...a,field:i,content:fe.isImageContent(r)?r:void 0}):i.type==="Link"?d.jsx(tPe,{...a,field:i,content:r}):i.type==="Number"?d.jsx(nPe,{...a,field:i,content:fe.isNumberContent(r)?r:void 0}):i.type==="StructuredText"?d.jsx(XZ,{...a,field:i,content:fe.isRichTextContent(r)?r:void 0}):i.type==="Select"?d.jsx(Yqe,{...a,field:i,content:fe.isSelectContent(r)?r:void 0}):i.type==="Text"?d.jsx(gY,{...a,field:i,content:fe.isTextContent(r)?r:void 0}):i.type==="Embed"?d.jsx(mUe,{...a,field:i,content:fe.isEmbedContent(r)?r:void 0}):i.type==="Color"?d.jsx(rUe,{...a,field:i,content:fe.isColorContent(r)?r:void 0}):i.type==="GeoPoint"?d.jsx(gUe,{...a,field:i,content:fe.isGeoPointContent(r)?r:void 0}):i.type==="IntegrationFields"?d.jsx(XBe,{...a,field:i,content:fe.isIntegrationFieldContent(r)?r:void 0}):i.type==="Table"?d.jsx(e7e,{...a,field:i,content:fe.isTableContent(r)?r:void 0}):null},[r,t,i,o,n])}function u7e(e){const{content:t,id:n,nonRepeatableZone:r,onContentChange:i,readOnly:o}=e,a=I.useMemo(()=>Object.entries(r),[r]);return d.jsx(d.Fragment,{children:a.map(([s,u])=>{const l=t[s];return d.jsx(xC,{id:`${n}.${s}`,readOnly:o,nestableWidget:u,content:fe.isNestableContent(l)?l:void 0,onContentChange:c=>{i(l7e(t,s,c))}},s)})})}function l7e(e,t,n){return n?{...e,[t]:n}:Pd.removeKey(e,t)}function ZF(e){var o,a;const{group:t,content:n,onContentChange:r,...i}=e;return d.jsx(JDe,{children:d.jsx(XF,{...i,title:tx(t),addItemButtonTitle:`Add item in "${tx(t)}"`,repeatable:((o=t.config)==null?void 0:o.repeat)!==!1,repeatableZone:((a=t.config)==null?void 0:a.fields)??{},content:n==null?void 0:n.value,onContentChange:s=>{r({__TYPE__:"GroupContentType",value:s})}})})}function tx(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}function tX(e){const{id:t,readOnly:n,content:r,widget:i}=e,o=ze.useStableCallback(e.onContentChange);return I.useMemo(()=>{const a={id:t,readOnly:n,onContentChange:o};return i.type==="Group"?d.jsx(ZF,{...a,group:i,content:fe.isGroupContent(r)?r:void 0}):d.jsx(xC,{...a,nestableWidget:i,content:fe.isNestableContent(r)?r:void 0})},[r,t,i,o,n])}function XF(e){const{id:t,title:n,addItemButtonTitle:r,content:i,onContentChange:o,readOnly:a,repeatable:s=!0,repeatableZone:u}=e,l=Object.entries(u);let c=i??[f7e];!s&&c.length>1&&(c=c.slice(0,1));const{scrollOffsetTop:f}=we(),p=I.useRef(new WeakMap);c7e(p.current,c);function h(_){return p.current.get(_)??"!bugged!"}function A(_){const b=nx();o(wt.insertAtIndex(c,_,b))}function g(_){const{index:b,offset:v}=_;o(wt.move(c,b,b+v))}function y(_){o(wt.removeIndex(c,_))}function C(_,b,v,S){const w=h7e(_,[v,S]),T=p7e(c,[b,w]);d7e(p.current,_,w),o(T)}return Object.keys(u).length===0?null:d.jsx(m.Group,{title:n??"Repeatable zone",addItemButtonTitle:r??"Add item in repeatable zone",items:c,maxItems:s?void 0:1,getItemKey:h,onAddItem:A,dnd:{scrollOffsetTop:f,onReorder:o,renderDragPreview:({index:_})=>d.jsx(A7e,{title:n??"Repeatable zone",index:_}),renderDropIndicator:m7e},children:(_,b)=>{const v=new Map(_.value),S=h(_);return d.jsx(m.LazyRender,{keepLoaded:!0,loadWhenSearching:!0,children:d.jsx(m.GroupItem,{index:b,title:`${b+1} • Item`,onMove:g,onDelete:y,children:l.map(([w,T])=>d.jsx(tX,{id:`${t}[${S}].${w}`,content:v.get(w),widget:T,onContentChange:E=>C(_,b,w,E),readOnly:a},w))})})}})}function c7e(e,t){t.forEach(n=>{e.has(n)||e.set(n,pX.uniqueNumber())})}function d7e(e,t,n){const r=e.get(t);r!==void 0&&e.set(n,r)}const f7e={__TYPE__:"GroupItemContent",value:[]};function p7e(e,t){const[n,r]=t;return r?e.map((i,o)=>o===n?r:i):e.filter((i,o)=>o!==n)}function h7e(e,t){const[n,r]=t;if(!r){const o=e.value.filter(([a])=>a!==n);return nx(o)}const i=Array.from(new Map(e.value).set(n,r));return nx(i)}function nx(e=[]){return{__TYPE__:"GroupItemContent",value:e}}function A7e(e){const{title:t,index:n}=e;return d.jsxs(m.Box,{padding:{block:8,inline:12},backgroundColor:"grey3",border:!0,borderRadius:6,alignItems:"center",justifyContent:"space-between",width:"100%",children:[d.jsxs("div",{children:[d.jsx(m.Text,{variant:"smallBold",color:"grey11",children:t??"Repeatable zone"}),d.jsxs(m.Text,{variant:"small",color:"grey11",children:[n+1," • Item"]})]}),d.jsx(m.Icon,{name:"dragIndicator",size:"small",color:"grey8"})]})}function m7e(e){const{isDropTarget:t,itemIndex:n,position:r}=e,i=t?d.jsx(m.Line,{color:"purple",thickness:2,sx:{position:"absolute",left:0,right:0,bottom:n===0&&r==="before"?0:void 0}},"line"):void 0;return d.jsx(m.AnimatedElement,{enterDuration:150,children:i})}function g7e(e){const{compositeSlice:t,content:n,onContentChange:r,sliceKey:i,id:o,readOnly:a,header:s}=e,u=tC();function l(){i&&u.update({id:i,requestedFrom:"sliceFieldSet"})}return d.jsxs(m.FieldSet,{id:i&&eC("sliceFieldSet",i),selected:i?u.isSelected(i):!1,onFocus:l,legend:v7e(t),header:s,children:[d.jsx(u7e,{id:o,readOnly:a,nonRepeatableZone:t["non-repeat"]??{},content:n.nonRepeat,onContentChange:c=>{r({...n,nonRepeat:c})}}),d.jsx(XF,{id:o,readOnly:a,repeatableZone:t.repeat??{},content:n.repeat,onContentChange:c=>{r({...n,repeat:c})}})]})}function v7e(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}const nX={__TYPE__:"ImageContent",edit:{background:"",crop:{x:0,y:0},zoom:0},height:0,width:0,origin:{height:0,width:0,id:"",url:""},url:""};function y7e(e){const{field:t}=e;if(t.type==="Image")return nX}function b7e(e){const{content:t,legacySlice:n,sliceKey:r,id:i,readOnly:o,onContentChange:a,header:s}=e,u=tC();function l(){r&&u.update({id:r,requestedFrom:"sliceFieldSet"})}const c=n.type==="Group"?tx(n):wr(n);return d.jsx(m.FieldSet,{id:r&&eC("sliceFieldSet",r),selected:r?u.isSelected(r):!1,onFocus:l,legend:c,header:s,children:n.type==="Group"?d.jsx(ZF,{id:i,readOnly:o,onContentChange:a,group:n,content:fe.isGroupContent(t)?t:void 0}):d.jsx(xC,{id:i,readOnly:o,nestableWidget:n,content:fe.isNestableContent(t)?t:void 0,onContentChange:f=>{const p=y7e({field:n});!f&&p&&a(p),f&&a(f)}})})}function C7e(e){const{content:t,id:n,slicePrimaryZone:r,onContentChange:i,readOnly:o}=e,a=I.useMemo(()=>Object.entries(r),[r]);return d.jsx(d.Fragment,{children:a.map(([s,u])=>{const l=t[s];return d.jsx(tX,{id:`${n}.${s}`,readOnly:o,widget:u,content:fe.isSlicePrimaryContent(l)?l:void 0,onContentChange:c=>{i(S7e(t,s,c))}},s)})})}function S7e(e,t,n){return n?{...e,[t]:n}:Pd.removeKey(e,t)}function rX(e){const{config:t,content:n,sliceKey:r,readOnly:i=!1,sharedSlice:o,onContentChange:a,...s}=e,u=w7e(o,n.variation),l=I.useId(),f={id:s.id??l,readOnly:i},p=tC();function h(){r&&p.update({id:r,requestedFrom:"sliceFieldSet"})}return u===void 0?null:d.jsx(fy.Provider,{value:t,children:d.jsx(GDe,{children:d.jsxs(m.FieldSet,{id:r&&eC("sliceFieldSet",r),selected:r?p.isSelected(r):!1,onFocus:h,legend:_7e(o,u),children:[d.jsx(m.LazyRender,{heightEstimate:400,gap:16,keepLoaded:!0,loadWhenSearching:!0,children:d.jsx(C7e,{...f,slicePrimaryZone:u.primary??{},content:n.primary,onContentChange:A=>{a({...n,primary:A})}})}),d.jsx(XF,{...f,repeatableZone:u.items??{},content:n.items,onContentChange:A=>{a({...n,items:A})}})]})})})}function w7e(e,t){return I.useMemo(()=>e.variations.find(n=>n.id===t),[e,t])}function _7e(e,t){return[e.name,t.name].join(" • ")}function rU(e){var u,l;const{sliceZone:t,onChange:n,slices:r,sliceContent:i}=e,o=(l=(u=t.config)==null?void 0:u.labels)==null?void 0:l[i.name];if(!o)return null;const a=o.find(c=>c.name===i.maybeLabel);function s(c){const f=r.value.map(p=>p.key===i.key?{...p,maybeLabel:c}:p);n({...r,value:f})}return d.jsxs(d.Fragment,{children:[d.jsx(m.Text,{component:"span",variant:"smallBold",children:"•"}),d.jsxs(m.DropdownMenu,{children:[d.jsx(m.DropdownMenuTrigger,{children:d.jsx(m.Button,{color:"grey",size:"small",endIcon:"arrowDropDown",invisible:!0,children:(a==null?void 0:a.display)??"Slice variation"})}),d.jsxs(m.DropdownMenuContent,{align:"start",maxHeight:256,children:[d.jsx(m.DropdownMenuItem,{onSelect:()=>s(void 0),endIcon:i.maybeLabel===void 0?d.jsx(m.Icon,{name:"check"}):void 0,children:"..."}),o==null?void 0:o.map(c=>d.jsx(m.DropdownMenuItem,{onSelect:()=>s(c.name),endIcon:c.name===i.maybeLabel?d.jsx(m.Icon,{name:"check"}):void 0,children:c.display??"[Missing display value]"},c.name))]})]})]})}function x7e(e){const{content:t,id:n,onContentChange:r,readOnly:i,sliceZone:o}=e,a=we();return d.jsx(d.Fragment,{children:t==null?void 0:t.value.map((s,u)=>{var p,h;const l=(h=(p=o.config)==null?void 0:p.choices)==null?void 0:h[s.name];if(l===void 0)return null;const c=s.widget,f={id:`${n}[${s.key}]`,key:s.key,sliceKey:s.key,onContentChange:A=>{const g={...s,widget:A},y=T7e(t,[u,g]);r(y)},readOnly:i};return l.type==="SharedSlice"?fe.isSharedSliceContent(c)?d.jsx(rX,{...f,config:a,sharedSlice:l,content:c}):null:l.type==="Slice"?fe.isCompositeSliceContent(c)?d.jsx(g7e,{...f,compositeSlice:l,content:c,header:d.jsx(rU,{sliceContent:s,sliceZone:o,slices:t,onChange:r})}):null:fe.isSimpleSliceContent(c)?d.jsx(b7e,{...f,legacySlice:l,content:c,header:d.jsx(rU,{sliceContent:s,sliceZone:o,slices:t,onChange:r})}):null})})}function T7e(e,[t,n]){return{__TYPE__:"SliceContentType",value:e.value.map((r,i)=>i===t?n:r)}}function I7e(e){const{content:t,metadataFieldType:n,documentId:r,documentContent:i,documentCustomType:o,documentLocale:a,...s}=e,{showAlert:u}=m.useAlert(),[l,c]=I.useState(!1),f=we(),p=I.useMemo(()=>MQ(i,o),[i,o]),h=FQ(p);async function A(){if(!f.aiSeoMetadataEnabled)return;const{trackMetadataGeneration:g,authStrategy:y,documentBaseUrl:C,repository:_}=f;c(!0);try{const b=await OQ(_,C,y,{pageTextContent:p,contentLocale:a});e.onContentChange({__TYPE__:"FieldContent",type:"Text",value:b[n]}),g({documentId:r,locale:a,suggestion:b[n],type:n})}catch{u({id:n,title:"Error",subtitle:`Failed to generate SEO metadata for ${iU[n]}`})}c(!1)}return d.jsx(gY,{...s,content:t,placeholder:`${iU[n]}..`,endAdornment:d.jsxs(d.Fragment,{children:[d.jsx(UH,{type:n,value:(t==null?void 0:t.value)||""}),d.jsx(m.Tooltip,{content:h?"Generate SEO metadata from your page content.":"Your page content is too short to generate SEO metadata.",children:d.jsx(m.Button,{disabled:!h,onClick:A,size:"small",color:"grey",startIcon:"autoFixHigh",loading:l,sx:{alignSelf:"center",marginInline:8},children:"Generate"})})]})})}const iU={[oa]:"Meta title",[hs]:"Meta description"};function E7e(e){const{id:t,field:n,content:r,onContentChange:i}=e,o=ze.useDebounceState({state:(r==null?void 0:r.value)??"",synchronize:!0}),{onEditUID:a}=I.useContext(PH);function s(l){a();const c=ri.slugify(l);i(k7e(c)),o.set(c)}function u(l){s(l.clipboardData.getData("Text").trim()),l.preventDefault()}return d.jsxs(m.Field,{children:[d.jsx(m.FieldIcon,{name:"tag"}),d.jsx(m.FieldLabel,{htmlFor:t,children:wr(n)}),d.jsx(m.FieldControl,{children:d.jsx(Tu,{id:t,variant:"success",placeholder:$c(n,"Enter a unique identifier"),value:o.value,onPaste:u,onValueChange:s,endAdornment:d.jsx(m.AnimatedElement,{enterDuration:150,children:d.jsx(R7e,{uid:o.debouncedValue})})})})]})}function R7e(e){const{uid:t}=e,n=we();return t?n.uidField?d.jsx(m.ErrorBoundary,{children:d.jsx(I.Suspense,{children:d.jsx($7e,{uid:t})})}):null:d.jsx(m.Badge,{color:"tomato",title:"Required",size:"medium"})}function $7e(e){const t=O7e(e),n=we();if(!t.documentId)return null;const r=KM({status:t.status,releaseId:t.releaseId,documentId:t.documentId,versionId:t.versionId,baseUrl:n.baseUrl});return d.jsx("a",{href:r.href,target:"_blank",rel:"noreferrer",children:d.jsx(m.Badge,{color:"tomato",size:"medium",title:d.jsxs(m.Text,{color:"tomato11",variant:"small",children:["Value already used in"," ",d.jsx(m.Text,{color:"tomato11",variant:"small",underline:!0,children:"another document"})]})})})}function k7e(e){return e===""?void 0:{__TYPE__:"UIDContent",value:e}}function O7e(e){var p,h,A,g;const{uid:t}=e,n=we();n.uidField||Rt("uidField");const{coreApiBaseUrl:r,authStrategy:i,customTypeId:o,localeId:a,documentId:s}=n,{data:u}=YM({baseUrl:r,authStrategy:i,uids:[t]}),l=u.results,f=NH({customTypeId:o,languageId:a,documentsWithUid:l,documentId:s,uid:t})[0];return f?{documentId:f.id,versionId:(p=f.versions[0])==null?void 0:p.version_id,status:(h=f.versions[0])==null?void 0:h.status,releaseId:((A=f.versions[0])==null?void 0:A.status)==="release"?(g=f.versions[0])==null?void 0:g.release_id:void 0}:{}}function M7e(e){const{id:t,readOnly:n,staticZone:r,content:i,onContentChange:o,documentId:a,documentContent:s,documentCustomType:u,documentLocale:l}=e,c=we(),f=I.useMemo(()=>Object.entries(r),[r]),p=I.useRef(i);if(I.useEffect(()=>{p.current=i},[i]),f.length===0)return null;const h=j7e(f),A=Ov(i[oa])||"Meta title..",g=Ov(i[hs])||"Meta description..";return d.jsxs(m.FieldSet,{legend:"Page data",children:[h&&d.jsx(BH,{title:A,description:g}),f.map(([y,C])=>{const _={id:`${t}.${y}`,onContentChange:v=>{const{[y]:S,...w}=p.current;o({...w,...v!==void 0&&{[y]:v}})},readOnly:n},b=i[y];return C.type==="UID"?I.createElement(E7e,{..._,content:fe.isUIDContent(b)?b:void 0,key:y,field:C}):C.type==="Group"?I.createElement(ZF,{..._,content:fe.isGroupContent(b)?b:void 0,group:C,key:y}):c.aiSeoMetadataEnabled&&F7e(y)&&C.type==="Text"?I.createElement(I7e,{..._,content:fe.isTextContent(b)?b:void 0,field:C,key:y,metadataFieldType:y,documentId:a,documentContent:s,documentCustomType:u,documentLocale:l}):I.createElement(xC,{..._,content:fe.isNestableContent(b)?b:void 0,key:y,nestableWidget:C})})]})}function F7e(e){return e===oa||e===hs}const j7e=e=>{var t,n;return((t=e[0])==null?void 0:t[0])===oa&&((n=e[1])==null?void 0:n[0])===hs};function L7e(e){const{id:t,readOnly:n,section:r,content:i,onContentChange:o,documentId:a,documentContent:s,documentCustomType:u,documentLocale:l}=e,[c,f]=U7e(r),[p,h]=B7e(i);return d.jsxs("div",{style:{display:"flex",flexDirection:"column",position:"relative",zIndex:0},children:[d.jsx(M7e,{id:t,readOnly:n,staticZone:c,documentId:a,content:p,onContentChange:A=>o({...h,...A}),documentContent:s,documentCustomType:u,documentLocale:l}),f.map(([A,g])=>{const y=h[A];return d.jsx(x7e,{id:`${t}.${A}`,readOnly:n,sliceZone:g,content:y,onContentChange:C=>o({...p,...h,[A]:C})},A)})]})}function D7e(e){return e.type==="Choice"||e.type==="Slices"}function U7e(e){return Object.entries(e).reduce(([t,n],[r,i])=>(D7e(i)?n.push([r,i]):Object.assign(t,{[r]:i}),[t,n]),[{},[]])}function B7e(e){return Object.entries(e).reduce(([t,n],[r,i])=>{const o={[r]:i};return Object.assign(fe.isSlicesContent(i)?n:t,o),[t,n]},[{},{}])}function P7e(e){const{config:t,readOnly:n=!1,customType:r,sectionName:i,documentId:o,content:a,locale:s,onContentChange:u}=e,l=I.useId();if(Pd.isEmpty(r.json))return null;const c=W7e(r,i),[f,p]=N7e(c,a);return d.jsx(fy.Provider,{value:t,children:d.jsx(YDe,{customTypeFormat:r.format,children:d.jsx(L7e,{id:l,readOnly:n,section:c,documentId:o,content:f,onContentChange:h=>u({...p,...h}),documentContent:a,documentCustomType:r,documentLocale:s})})})}function W7e(e,t){const n=e.json[t];if(n===void 0)throw new Error(`Cannot find a section with name '${t}'.`);return n}function N7e(e,t){return Object.entries(t).reduce(([n,r],[i,o])=>{const a=e[i]!==void 0,s={[i]:o};return[{...n,...a?s:{}},{...r,...a?{}:s}]},[{},{}])}exports.APIExplorer=tte;exports.DeferredCodeBlock=sv;exports.DocumentEditor=P7e;exports.EditorConfigContext=fy;exports.EditorErrorBoundary=tje;exports.MediaLibrary=DH;exports.MetadataBadge=UH;exports.MetadataPreview=BH;exports.OnboardingGuide=PDe;exports.OnboardingStepId=$Le;exports.SelectionManagerProvider=SQ;exports.SharedSliceEditor=rX;exports.SliceSelectionContext=KH;exports.TeamSpace=Z1;exports.UIDContext=PH;exports.createSearchParams=qQ;exports.createTeamSpace=HLe;exports.defaultGroupContentWithOneItem=yQ;exports.defaultImageContentWidget=nX;exports.deleteTeamSpace=GLe;exports.documentKeys=xo;exports.documentMetaSchema=QM;exports.documentSchema=yLe;exports.documentStatus=bQ;exports.extractTextFromField=Ov;exports.fetchCustomTypes=uLe;exports.frameworkCreateProjectCodeSnippet=sU;exports.frameworkLabels=aU;exports.generateSEOMetadata=OQ;exports.getConflictingUidDocuments=NH;exports.getCustomTypesOptions=Vm;exports.getDocumentById=zm;exports.getDocumentList=HM;exports.getDocumentListOptions=VQ;exports.getOnboarding=kLe;exports.getPageTextContent=MQ;exports.getProfile=aH;exports.getRepository=J1;exports.getRepositoryTags=JQ;exports.getRepositoryV2=RLe;exports.getRoleLabel=LLe;exports.getRoles=nH;exports.getRolesOptions=KLe;exports.getSliceSelectionDOMId=eC;exports.getTeamSpaces=rH;exports.getTeamSpacesOptions=zLe;exports.hasUIDField=WH;exports.invalidateCustomTypes=cLe;exports.invalidateDocumentListData=SLe;exports.isAdminRole=FLe;exports.isDocumentSearchVersion=Jw;exports.isDocumentVersion=PQ;exports.isMissingUID=zDe;exports.isPageContentRelevantForAISeo=FQ;exports.isValidSimulatorURL=GQ;exports.languageSchema=zM;exports.makeSearchFullTextDocumentsQueryString=KQ;exports.metaDescriptionConfig=Mh;exports.metaDescriptionProperty=hs;exports.metaTitleConfig=Oh;exports.metaTitleProperty=oa;exports.onboardingStateSchema=XQ;exports.onboardingToggleResultSchema=tH;exports.onboardingToggleStepResultSchema=eH;exports.prefetchCustomTypes=sLe;exports.prefetchStaticCustomType=hLe;exports.prepareDocumentForSave=JFe;exports.profileResponse=oH;exports.repositoryFramework=G1;exports.repositorySchemaV2=ZQ;exports.roleMap=XLe;exports.searchDocumentStatus=zw;exports.searchDocuments=zQ;exports.searchDocumentsQueryOptions=QQ;exports.searchFullTextDocuments=NQ;exports.sliceItemContentSchema=bLe;exports.suppressErrors=XX;exports.throwConfigError=Rt;exports.toggleOnboarding=MLe;exports.toggleOnboardingStep=OLe;exports.updateDocumentListData=CLe;exports.updateRoles=qLe;exports.updateTeamSpace=YLe;exports.useCustomType=lLe;exports.useCustomTypes=VM;exports.useDocumentList=YM;exports.useInvalidateTeamSpaces=QLe;exports.useProfile=ZM;exports.useSelectionManager=xu;exports.useSliceSelection=tC;exports.useStaticCustomType=pLe;
|