@prismicio/editor-fields 0.4.63 → 0.4.64-alpha.fix-simulator-issue.1

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.
Files changed (67) hide show
  1. package/dist/EditorConfig.d.ts +12 -3
  2. package/dist/core/APIExplorer/APIExplorer.d.ts +2 -0
  3. package/dist/core/APIExplorer/components/APIExplorerContext.d.ts +54 -0
  4. package/dist/core/APIExplorer/components/APIExplorerRequest.d.ts +2 -0
  5. package/dist/core/APIExplorer/components/APIExplorerResponse.d.ts +2 -0
  6. package/dist/core/APIExplorer/components/Request/GetByTypeRequest.d.ts +1 -0
  7. package/dist/core/APIExplorer/components/Request/GetByUIDRequest.d.ts +1 -0
  8. package/dist/core/APIExplorer/components/Request/GetRepositoryRequest.d.ts +1 -0
  9. package/dist/core/APIExplorer/components/Request/GetRequest.d.ts +1 -0
  10. package/dist/core/APIExplorer/components/Request/GetSingleRequest.d.ts +1 -0
  11. package/dist/core/APIExplorer/components/Request/components/RequestFormInput.d.ts +4 -0
  12. package/dist/core/APIExplorer/components/Request/components/RequestFormInputBase.d.ts +6 -0
  13. package/dist/core/APIExplorer/components/Request/components/RequestFormSelect.d.ts +4 -0
  14. package/dist/core/APIExplorer/components/Request/components/RequestPaginationFieldset.d.ts +5 -0
  15. package/dist/core/APIExplorer/components/Request/components/RequestTypeFieldset.d.ts +7 -0
  16. package/dist/core/APIExplorer/components/Request/components/index.d.ts +3 -0
  17. package/dist/core/APIExplorer/components/Request/createRequest.d.ts +20 -0
  18. package/dist/core/APIExplorer/components/Request/index.d.ts +1 -0
  19. package/dist/core/APIExplorer/components/Request/types.d.ts +14 -0
  20. package/dist/core/APIExplorer/index.d.ts +1 -0
  21. package/dist/core/MediaLibrary/hooks/mediaLibraryData.d.ts +45 -45
  22. package/dist/core/MediaLibrary/hooks/useMediaLibraryUpload.d.ts +5 -5
  23. package/dist/core/MediaLibrary/hooks/useSelectedMedia.d.ts +5 -5
  24. package/dist/core/UnsplashLibrary/unsplashData.d.ts +18 -18
  25. package/dist/core/service/aiSeoMetadata.d.ts +2 -6
  26. package/dist/core/service/customType.d.ts +19 -19
  27. package/dist/core/service/document.d.ts +101 -101
  28. package/dist/core/service/documentSearch.d.ts +30 -30
  29. package/dist/core/service/onboarding.d.ts +3 -3
  30. package/dist/core/service/repository.d.ts +6 -6
  31. package/dist/core/service/role.d.ts +257 -36
  32. package/dist/core/service/user.d.ts +11 -7
  33. package/dist/fields/ImageField/useImageField.d.ts +5 -5
  34. package/dist/fields/ImageField/useImageFieldImageUpload.d.ts +5 -5
  35. package/dist/fields/LinkField/Documents/documentsData.d.ts +10 -10
  36. package/dist/fields/LinkField/LinkField.d.ts +1 -1
  37. package/dist/fields/RichTextField/RichTextField.d.ts +7 -0
  38. package/dist/fields/RichTextField/extensions/Image/useImageView.d.ts +5 -5
  39. package/dist/fields/RichTextField/extensions/Table/Table.d.ts +4 -4
  40. package/dist/fields/RichTextField/extensions/Table/TableCell/TableCell.d.ts +10 -0
  41. package/dist/fields/RichTextField/extensions/Table/TableCell/TableHeaderCell.d.ts +10 -0
  42. package/dist/fields/RichTextField/extensions/Table/TableCell/index.d.ts +2 -0
  43. package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/TableHandles/TableHandlesPlugin.d.ts +8 -0
  44. package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/TableHandles/TableHandlesPluginView.d.ts +34 -0
  45. package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/TableHandles/events.d.ts +19 -0
  46. package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/TableHandles/index.d.ts +1 -0
  47. package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/TableHandles/utils.d.ts +21 -0
  48. package/dist/fields/RichTextField/extensions/Table/TableCell/plugins/index.d.ts +1 -0
  49. package/dist/fields/RichTextField/extensions/Table/TableCell/types.d.ts +17 -0
  50. package/dist/fields/RichTextField/extensions/Table/TableCell/utils.d.ts +15 -0
  51. package/dist/fields/RichTextField/extensions/Table/TableEvent.d.ts +31 -0
  52. package/dist/fields/RichTextField/extensions/Table/TableLimitToast.d.ts +7 -0
  53. package/dist/fields/RichTextField/extensions/Table/TableRow.d.ts +9 -0
  54. package/dist/fields/RichTextField/extensions/Table/TableView.d.ts +22 -0
  55. package/dist/fields/RichTextField/extensions/Table/menus/TableColumnMenu.d.ts +11 -0
  56. package/dist/fields/RichTextField/extensions/Table/menus/TableFloatingMenus.d.ts +7 -0
  57. package/dist/fields/RichTextField/extensions/Table/menus/TableRowMenu.d.ts +10 -0
  58. package/dist/fields/RichTextField/extensions/Table/menus/TriggerAnchor.d.ts +11 -0
  59. package/dist/fields/RichTextField/extensions/Table/menus/index.d.ts +2 -0
  60. package/dist/fields/RichTextField/extensions/Table/menus/utils.d.ts +23 -0
  61. package/dist/fields/RichTextField/extensions/Table/utils.d.ts +9 -0
  62. package/dist/fields/RichTextField/extensions/extensions.d.ts +1 -1
  63. package/dist/index.cjs.js +138 -38
  64. package/dist/index.d.ts +1 -0
  65. package/dist/index.es.js +59273 -10833
  66. package/dist/slices/utils.d.ts +4 -4
  67. 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
- `).length;return A.jsx(r.ErrorBoundary,{renderError:()=>A.jsx(r.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:A.jsx(f.Suspense,{fallback:A.jsx(r.Skeleton,{height:xr+yr+t*Cr,borderRadius:6}),children:A.jsx(r.LazyCodeBlock,{...e})})})}function hA(e){if(K.isRepeatableContent(e))return e;if(K.isLinkContent(e))return{__TYPE__:"RepeatableContent",type:"Link",value:[e]}}function pA(e){if(K.isLinkContent(e))return e;if(K.isRepeatableContent(e)){const[t]=e.value;if(K.isLinkContent(t))return t}}function Br(e,t){let n=Fr(e,t);return n=Ir(e,n),n=jr(e,n),K.fillDocumentWithDefaultValues(e,n)}function Ir(e,t){return w.flattenSections(e).reduce((o,[i,s])=>!t[i]&&s.type==="Group"?{...o,[i]:mA}:o,t)}function jr(e,t){return K.traverseDocument({document:t,customType:e})({transformWidget({model:n,content:o}){return n?o:void 0},transformSlice(n){return n.model?n.content:void 0}})}function Fr(e,t){return K.traverseDocument({document:t,customType:e})({transformWidget({model:n,content:o}){if((n==null?void 0:n.type)==="Link"){const{repeat:i}=n.config??{};switch(o.__TYPE__){case"LinkContent":return i?hA(o)??o:o;case"RepeatableContent":return i?o:pA(o)??o;default:return o}}return o}})}const mA={__TYPE__:"GroupContentType",value:[{__TYPE__:"GroupItemContent",value:[]}]},fA={unclassified:{title:"Draft",color:"amber"},published:{title:"Live",color:"green"},release:{title:"Planned",color:"purple"},archived:{title:"Archived",color:"grey"}},Vt={unclassified:["unclassified","published"],archived:["unclassified","published"],release:["release","published"],published:["published","unclassified"]};function dn(e){const{documentId:t,versionId:n,baseUrl:o,status:i,releaseId:s}=e,a={s:i,v:n,r:s},l=te.createRouteParams({params:a}),d=new URLSearchParams(l).toString();return new URL(`pages/${t}?${d}`,o)}function Sr(e){const{children:t,...n}=e;return A.jsx(oe.QueryErrorResetBoundary,{children:({reset:o})=>A.jsx(r.ErrorBoundary,{...n,onReset:o,children:t})})}const CA=f.createContext(void 0),br={selectedIds:new Set,excludedIds:new Set,isAllSelected:!1};function xA(e){const{children:t,initialState:n,initialTotalItemCount:o,isSelectAllEnabled:i=!1}=e,s=f.useRef(),a=f.useRef(o||0);function l(){if(n&&n.selectedIds){const F=[...n.selectedIds].pop();F&&(s.current=F)}return{...br,...n}}const[d,c]=f.useState(l),u=f.useMemo(()=>{const{selectedIds:F,excludedIds:T,isAllSelected:k}=d;return k?a.current-T.size:F.size},[d]),h=f.useCallback(F=>{const{isAllSelected:T,selectedIds:k,excludedIds:M}=d;return T?!M.has(F):k.has(F)},[d]),g=f.useCallback(()=>{const{isAllSelected:F,selectedIds:T,excludedIds:k}=d;return{selectedIds:[...T],excludedIds:[...k],isAllSelected:F,selectedCount:u}},[d,u]),m=E.useStableCallback(()=>{i&&c({isAllSelected:!0,selectedIds:new Set,excludedIds:new Set})}),C=E.useStableCallback(()=>{c({isAllSelected:!1,selectedIds:new Set,excludedIds:new Set})});f.useEffect(()=>{const{isAllSelected:F,selectedIds:T,excludedIds:k}=d,M=a.current;if(!(M===0||!i)){if(F&&k.size===M){C();return}if(!F&&T.size===M){m();return}}},[d,i,m,C]);const y=E.useStableCallback(F=>{const{id:T,isSingleSelection:k,metaKey:M,shiftKey:_,ids:ge}=F;return _&&ge&&ge.length>0&&s.current?I(T,ge,s.current):k&&!M?x(T):h(T)?S([T]):j([T]),s.current=T,h(T)});function x(F){h(F)&&u===1?c(T=>({...T,selectedIds:new Set})):c({isAllSelected:!1,selectedIds:new Set([F]),excludedIds:new Set})}function I(F,T,k){const M=Kr(T,k,F),_=h(F);return _?S(M):j(M),_}const B=E.useStableCallback(()=>{u>0?C():m()});function j(F){const{isAllSelected:T}=d;if(T){c(k=>({...k,excludedIds:Rn(k.excludedIds,F)}));return}c(k=>({...k,selectedIds:Qn(k.selectedIds,F)}))}function S(F){const{isAllSelected:T}=d;if(T){c(k=>({...k,excludedIds:Qn(k.excludedIds,F)}));return}c(k=>({...k,selectedIds:Rn(k.selectedIds,F)}))}function b(F){a.current=F}const v=f.useMemo(()=>({selectedCount:u,state:d,totalItemCount:a.current,isSelected:h,isSelectAllEnabled:i,getSelectionState:g,toggleSelection:y,toggleSelectAll:B,clearSelection:C,setTotalItemCount:b}),[d,C,g,i,h,u,B,y]);return A.jsx(CA.Provider,{value:v,children:t})}function je(e){const t=f.useContext(CA);if(t===void 0)throw new Error("useSelectionManagerContext must be used within a SelectionManagerProvider");const{totalItemCount:n,onChangeSelection:o}=e||{},{setTotalItemCount:i,totalItemCount:s,state:a,getSelectionState:l,...d}=t;n!==void 0&&n!==s&&i(n);const c=E.useStableCallback(o);return f.useEffect(()=>{c==null||c(l())},[l,c,a]),{...d,getSelectionState:l,isAllSelected:a.isAllSelected}}function Kr(e,t,n){const o=e.indexOf(t),i=e.indexOf(n);if(i===-1)throw new Error("targetId must be in the array");return o===-1?[n]:o<=i?e.slice(o,i+1):e.slice(i,o+1)}function Rn(e,t){const n=new Set(e);return t.forEach(o=>n.delete(o)),n}function Qn(e,t){return new Set([...e,...t])}const jt=f.createContext(void 0);function L(){const e=f.useContext(jt);if(!e)throw new Error("Missing EditorConfigContext.Provider");return e}class Yt extends Error{}function V(e){throw new Yt(`Missing EditorConfig.${e}`)}function Ur(){if(new URL(location.href).searchParams.has("debug"))return;const n=console.error.bind(console);console.error=(...o)=>{o[0]instanceof Yt||Tr(o)||n(...o)},window.addEventListener("error",o=>{o.error instanceof Yt&&o.preventDefault(),wr(o.error)&&o.preventDefault()})}function Tr(e){const t="Warning: flushSync was called from inside a lifecycle method",n=typeof e[0]=="string"&&e[0].includes(t),o=typeof e[1]=="string"&&e[1].includes("RichTextField");return n&&o}function wr(e){const t=/Invalid content for node document: <(bulletList|orderedList)\(listItem*/,n=e.message;return!!(typeof n=="string"&&n.match(t))}const le="meta_title",ue="meta_description",Lr=p.z.object({[le]:p.z.string(),[ue]:p.z.string()});async function yA(e){var s,a,l,d;const{pageTextContent:t,contentLocale:n,config:o}=e,i=new Dn.BedrockRuntimeClient({region:o.region,credentials:{accessKeyId:o.accessKeyId,secretAccessKey:o.secretAccessKey}});try{const c=new Dn.ConverseCommand({modelId:"anthropic.claude-3-5-sonnet-20240620-v1:0",system:[{text:vr(n)}],messages:[{role:"user",content:[{text:`Input:
3
- ${t}`}]}]}),u=await i.send(c);return Lr.parse(JSON.parse(((d=(l=(a=(s=u.output)==null?void 0:s.message)==null?void 0:a.content)==null?void 0:l[0])==null?void 0:d.text)||""))}catch(c){throw console.error("Failed to generate SEO metadata",c),c}}const He={min:50,max:60},_e={min:120,max:165};function vr(e="en-us"){return`
4
- You are an expert SEO specialist specializing in mobile-first optimization. Your task is to analyze the provided website content and generate a meta title and meta description optimized for mobile SEO. Follow these steps precisely:
5
-
6
- 1. Language Context:
7
- The language of the content is provided as ${e}. If ${e} is invalid, missing, or cannot be used, identify the language of the content directly and write the meta information in that language. Do not explicitly mention the language in the output.
8
-
9
- 2. Content Analysis:
10
- Examine the input text to identify the main topic, primary keywords, and core intent of the content. Focus on the most SEO-relevant sections, typically in headings, titles, and introductory paragraphs.
11
- - If the content is comparing two or more entities (e.g., "Prismic vs Contentful" or "Product A vs Product B"), ensure the meta title and description reflect both the comparison aspect and the conclusion (if any).
12
- - The meta title and description should highlight the core subject of the comparison (e.g., comparing CMS tools) while also acknowledging any key takeaways or recommendations (e.g., the superiority of one tool over the other).
13
- -For comparison content, do not focus solely on one of the entities or the conclusion—balance both the topic of the comparison and the outcome to provide clarity on what the page is addressing.
14
-
15
- 3.Meta Title Creation:
16
- - Write a concise, compelling meta title, it must be near ${He.min} characters. (never exceed this limit)
17
- - Place the most important keyword(s) at the beginning.
18
- - Ensure it is accurate, engaging, and click-worthy.
19
-
20
- 4. Meta Description Creation:
21
- - Write a clear, informative meta description, it must be near ${_e.min} characters. (never exceed this limit)
22
- - Prioritize key information in the first sentence.
23
- - Include primary keywords naturally, summarize the content, and use action-oriented language.
24
-
25
- 5. Best Practices:
26
- - Avoid keyword stuffing and write in a natural, user-friendly tone.
27
- - Adapt the meta information to align with language-specific nuances and SEO conventions.
28
- - Ensure both the meta title and description are unique, relevant, and aligned with the page’s content.
29
- - Do not reference or use any existing meta titles or descriptions already in the content. Be creative and generate unique meta information.
30
-
31
- 6. Output Requirements:
32
- - Return the results in JSON format with only two keys: "${le}" and "${ue}".
33
- - Do not include any additional text or explanations.
34
- `}function BA(e,t){const n=[];return K.traverseDocument({document:e,customType:t})({transformWidget:({content:i,model:s,apiId:a})=>{var l;if(!(a===le||a===ue)&&(K.isRichTextContent(i)&&(s==null?void 0:s.type)==="StructuredText"||K.isTextContent(i)&&(s==null?void 0:s.type)==="Text"||K.isUIDContent(i)&&(s==null?void 0:s.type)==="UID")){const d=gt(i);d&&n.push({label:((l=s.config)==null?void 0:l.label)||"",value:d})}}}),n.map(i=>JSON.stringify(i)).join(`
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
- Install it in your ${s}project by running these commands:`}),A.jsx(Ot,{code:`cd ${n??"<your project name>"}
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 mX=Object.defineProperty;var gX=(e,t,n)=>t in e?mX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var $t=(e,t,n)=>(gX(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),A=require("@prismicio/editor-ui"),I=require("react"),ri=require("@prismicio/editor-support/URL"),ui=require("@tanstack/react-query"),Pd=require("@prismicio/editor-support/Object"),ze=require("@prismicio/editor-support/React"),ix=require("@prismicio/editor-support/Date"),_t=require("@prismicio/editor-support/Array"),et=require("@prismicio/editor-support/Suspense"),Ar=require("@prismicio/editor-support/String"),se=require("@prismicio/editor-support/Http"),ti=require("@prismicio/editor-support/Set"),Qi=require("@prismicio/editor-support/Type"),vX=require("@prismicio/editor-support/Map"),ox=require("react-dom"),yX=require("@prismicio/editor-support/DOM"),bX=require("@prismicio/editor-support/Number"),CX=require("@prismicio/editor-support/Animation");function sU(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=sU(I),SX=sU(ox),lU={next:"Next.js",nuxt:"Nuxt",sveltekit:"SvelteKit",other:"Other"},uU={next:"npx create-next-app@latest",nuxt:"npx nuxi@latest init",sveltekit:"npx sv create"},cU=e=>Array.isArray(e)?`[${e.map(cU).join(", ")}]`:typeof e=="string"?`"${e}"`:e instanceof Date?`${e.getTime()}`:`${e}`,ct=e=>(n,...r)=>{const i=r.map(cU).join(", "),o=n&&r.length?", ":"";return`[${e}(${n}${o}${i})]`},lj=e=>{const t=ct(e);return r=>t(r)},wX=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:lj("has"),missing:lj("missing"),similar:wX("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)]}),_X=e=>typeof e=="function"?e:()=>e,dU="7.15.1",ql=e=>`https://prismic.dev/msg/client/v${dU}/${e}`,uj=e=>ma.at("document.tags",Cs(e));var xX=Object.defineProperty,TX=(e,t,n)=>t in e?xX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cj=(e,t,n)=>TX(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 ax=(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=>ax(e,t=>t.isMasterRef),jC=(e,t)=>ax(e,n=>n.id===t),LC=(e,t)=>ax(e,n=>n.label===t),IX="io.prismic.preview",fj=e=>e.replace(/%3B/g,";"),EX=e=>{const t=e.split("; ");let n;for(const r of t){const i=r.split("=");if(fj(i[0]).replace(/%3D/g,"=")===IX){n=fj(i.slice(1).join("="));break}}return n},RX=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 fy extends Si{}class Sw extends Si{}class $X extends Si{}class kX extends fy{}class pj extends fy{}class DC extends fy{}class OX extends Sw{}const _p={Any:"Any",Document:"Document",Media:"Media",Web:"Web"},MX=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}:{}}},FX=(e,...t)=>{if(!e)return null;const n="link_type"in e?e:MX(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}},jX=e=>new Promise(t=>setTimeout(t,e)),LX=({interval:e}={})=>{const t=[];let n=!1,r=0;const i=()=>{var l;!n&&t.length>0&&((l=t.shift())==null||l(),n=!0)},o=()=>{n=!1,i()},a=async(l,u,c)=>{const f=Date.now()-r;e&&f<e&&await jX(e-f);const p=(async()=>l(...c))();u(p);try{await p}catch{}r=Date.now(),o()},s=(l,u,c)=>{new Promise(f=>{t.push(f)}).then(a.bind(void 0,l,u,c)),(async()=>(await Promise.resolve(),n||i()))()};return(l,...u)=>new Promise(c=>{s(l,c,u)})};var DX=Object.defineProperty,UX=(e,t,n)=>t in e?DX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cg=(e,t,n)=>UX(e,typeof t!="symbol"?t+"":t,n);const BX=1500;class PX{constructor(t){if(cg(this,"fetchFn"),cg(this,"fetchOptions"),cg(this,"queuedFetchJobs",{}),cg(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 l={...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,l):this.dedupeFetch(t,l)}queueFetch(t,n={}){const r=new URL(t).hostname;return this.queuedFetchJobs[r]||(this.queuedFetchJobs[r]=LX({interval:BX})),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 WX="x-d",NX="x-c",KX={accessToken:"access_token"},qX=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 ${ql("orderings-must-be-an-array-of-objects")}`)}return e}return e.direction==="desc"?`${e.field} desc`:e.field},VX=(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 ${ql("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=KX[a]||a;let l=i[a];if(s==="orderings"){const u=i[s];u!=null&&(process.env.NODE_ENV==="development"&&typeof u=="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 ${ql("orderings-must-be-an-array-of-objects")}`),l=`[${Cs(u).map(f=>qX(f)).join(",")}]`)}else s==="routes"&&typeof i[s]=="object"&&(l=JSON.stringify(Cs(i[s])));l!=null&&o.searchParams.set(s,Cs(l).join(","))}return o.searchParams.set(NX,`js-${dU}`),process.env.NODE_ENV==="development"&&o.searchParams.set(WX,"1"),o.toString()},zX=e=>/^[a-zA-Z0-9][-a-zA-Z0-9]{2,}[a-zA-Z0-9]$/.test(e),QX=e=>{if(zX(e))return`https://${e}.cdn.prismic.io/api/v2`;throw new Si(`An invalid Prismic repository name was given: ${e}`,void 0,void 0)},HX=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)},UC=e=>{try{return new URL(e),!0}catch{return!1}};var YX=Object.defineProperty,fU=e=>{throw TypeError(e)},GX=(e,t,n)=>t in e?YX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gs=(e,t,n)=>GX(e,typeof t!="symbol"?t+"":t,n),pU=(e,t,n)=>t.has(e)||fU("Cannot "+n),hj=(e,t,n)=>(pU(e,t,"read from private field"),n?n.call(e):t.get(e)),JX=(e,t,n)=>t.has(e)?fU("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ZX=(e,t,n,r)=>(pU(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),xp;const XX=100,eee=5e3,tee=500,nee=1e3,ree=3;var So;(function(e){e.Master="Master",e.ReleaseID="ReleaseID",e.ReleaseLabel="ReleaseLabel",e.Manual="Manual"})(So||(So={}));class iee extends PX{constructor(t,n={}){if(super(n),JX(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||UC(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 ${ql("endpoint-must-use-cdn")}`),n.documentAPIEndpoint&&UC(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 ${ql("prefer-repository-name")}`)}if(UC(t)){this.documentAPIEndpoint=t;try{this.repositoryName=HX(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 ${ql("prefer-repository-name")}`)}}else this.documentAPIEndpoint=n.documentAPIEndpoint||QX(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){ZX(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 ${ql("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 Sw("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)||XX)},a=[];let s;for(;(!s||s.next_page)&&a.length<r;){const l=s?s.page+1:void 0;s=await this.get({...o,page:l}),a.push(...s.results),s.next_page&&await new Promise(u=>setTimeout(u,tee))}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,uj(t)))}async getAllByEveryTag(t,n){return await this.dangerouslyGetAll(sr(n,uj(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 jC(r,t)}async getRefByLabel(t,n){const r=await this.getRefs(n);return LC(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 jC(r,t)}async getReleaseByLabel(t,n){const r=await this.getReleases(n);return LC(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 VX(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=FX(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 u in o)o[u]&&(a[u.toLowerCase()]=o[u]);const s=new URL(t);s.searchParams.set("ref",i);const l=s.searchParams.get("query");return l&&s.searchParams.set("query",RX(l)),await this.fetchFn(s.toString(),{...n,headers:a})}async getCachedRepository(t){return(!this.cachedRepository||Date.now()>=this.cachedRepositoryExpiration)&&(this.cachedRepositoryExpiration=Date.now()+eee,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=EX(s)),a)return a}const i=await this.getCachedRepository(t),o=this.refState.mode;if(o===So.ReleaseID)return jC(i.refs,this.refState.releaseID).ref;if(o===So.ReleaseLabel)return LC(i.refs,this.refState.releaseLabel).ref;if(o===So.Manual){const a=await _X(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 DC||a instanceof pj)||n>=ree-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 l=new URL(o).searchParams.get("ref"),u=a instanceof DC?"invalid":"expired";return console.warn(`The ref (${l}) was ${u}. 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 $X(r.json.message,t,r.json);case 401:case 403:throw new fy(r.json.error||r.json.message,t,r.json);case 404:throw r.json===void 0?new OX(`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 DC(r.json.message,t,r.json):r.json.type==="api_security_error"&&/preview token.*expired/i.test(r.json.message)?new kX(r.json.message,t,r.json):new Sw(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)?nee:i;return await new Promise((a,s)=>{setTimeout(async()=>{try{a(await this.fetch(t,n))}catch(l){s(l)}},o)})}}throw new Si(void 0,t,r.json)}}xp=new WeakMap;const oee=(e,t)=>new iee(e,t),py=I.createContext(void 0);function we(){const e=I.useContext(py);if(!e)throw new Error("Missing EditorConfigContext.Provider");return e}class ww extends Error{}function Mt(e){throw new ww(`Missing EditorConfig.${e}`)}function aee(){if(new URL(location.href).searchParams.has("debug"))return;const n=console.error.bind(console);console.error=(...r)=>{r[0]instanceof ww||see(r)||n(...r)},window.addEventListener("error",r=>{r.error instanceof ww&&r.preventDefault(),lee(r.error)&&r.preventDefault()})}function see(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 lee(e){const t=/Invalid content for node document: <(bulletList|orderedList)\(listItem*/,n=e.message;return!!(typeof n=="string"&&n.match(t))}function ld(e){const{label:t,size:n,...r}=e;return d.jsxs(A.Box,{display:"grid",gap:8,gridTemplateColumns:"1fr 1fr",children:[d.jsx(A.Box,{borderRadius:6,backgroundColor:"grey2",border:!0,alignItems:"center",padding:{inline:12},children:d.jsx(A.Text,{variant:"normal",component:"label",color:"grey10",children:t})}),d.jsx(A.FormInput,{...r,size:"medium"})]})}function hU(){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(ld,{type:"number",value:((r=e.pagination.page)==null?void 0:r.toString())??"",onValueChange:t,label:"PAGE",placeholder:"1"}),d.jsx(ld,{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(ld,{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(hU,{})]})},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(ld,{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(ld,{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(hU,{})},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(ld,{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))}},hy={[vj.type]:vj,[Aj.type]:Aj,[mj.type]:mj,[yj.type]:yj,[gj.type]:gj},AU=I.createContext(void 0),uee=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(l=>({...l,repository:{...l.repository,id:s}}))},setRepositoryAccessToken(s){i(l=>({...l,repository:{...l.repository,accessToken:s}}))},setRequestType(s){i(l=>({...l,type:s}))},setRequestOptions(s,l){i(u=>({...u,options:{...u.options,[s]:l}}))},setPagination(s){i(l=>({...l,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,l;const u=oee(r.repository.id,{accessToken:r.repository.accessToken,fetch(h,m){return s=new URL(h).searchParams.get("ref")??void 0,l=h,fetch(h,m)}}),c=Date.now();try{const h=await hy[r.type].run(u,{...r.options[r.type],...r.pagination});i(m=>({...m,response:{status:"success",duration:Date.now()-c,ref:s,url:l,data:h}}))}catch(h){const m=h instanceof Error?h:new Error("Unknown error");i(g=>({...g,response:{status:"error",duration:Date.now()-c,url:l,error:m}})),(p=n.onAnalyticsEvent)==null||p.call(n,"API Explorer Request Error",{type:a.type,repositoryID:a.repository.id,url:l,error:m.message})}}}};return I.useEffect(()=>{a.run()},[]),d.jsx(AU.Provider,{value:{request:a},children:t})};function cee(){const e=I.useContext(AU);if(!e)throw new Error("useAPIExplorer must be used within an APIExplorerProvider");return e}function Ea(){return cee().request}const dee=18,fee=41,pee=24;function lv(e){const t=e.code.split(`
8
+ `).length;return d.jsx(A.ErrorBoundary,{renderError:()=>d.jsx(A.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(A.Skeleton,{height:fee+pee+t*dee,borderRadius:6}),children:d.jsx(A.LazyCodeBlock,{...e})})})}function hee(){const e=Ea();return d.jsx(A.Box,{display:"grid",gridTemplateRows:"minmax(0, 1fr)",minHeight:0,minWidth:0,children:d.jsx(A.Form,{onSubmit:e.run,children:d.jsxs(A.Box,{display:"grid",gridTemplateRows:"auto 1fr",borderRadius:8,border:!0,minHeight:0,minWidth:0,children:[d.jsx(A.Box,{as:"header",padding:{inline:16},alignItems:"center",border:{bottom:!0},minHeight:48,children:d.jsx(A.Text,{variant:"small",component:"h2",color:"grey9",children:"Request"})}),d.jsxs(A.Box,{display:"flex",flexDirection:"column",overflowY:"auto",children:[d.jsx(Aee,{}),d.jsx(mee,{}),d.jsx(gee,{}),d.jsx(yee,{})]})]})})})}function Aee(){const e=Ea();return d.jsx(A.Box,{padding:16,border:{bottom:!0},display:"grid",children:d.jsx(A.Select,{color:"grey",size:"large",side:"bottom",flexContent:!0,boldTriggerText:!0,endIcon:"unfoldMore",value:e.type,onValueChange:t=>e.setRequestType(t),children:Object.values(hy).map(({type:t})=>d.jsx(A.SelectItem,{value:t,children:t},t))})})}function mee(){const e=Ea(),t=hy[e.type].Fieldset;return t?d.jsxs(A.Box,{display:"flex",flexDirection:"column",padding:16,border:{bottom:!0},gap:8,children:[d.jsx(A.Text,{variant:"emphasized",component:"h3",color:"grey11",children:"Params"}),d.jsx(t,{})]}):null}function gee(){return d.jsx(A.Box,{padding:16,border:{bottom:!0},display:"grid",children:d.jsx(A.Button,{type:"submit",color:"purple",size:"large",endIcon:"arrowForward",children:"Send"})})}const vee="https://prismic.io/docs/technical-reference/prismicio-client";function yee(){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=hy[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(A.Box,{display:"flex",flexDirection:"column",padding:16,gap:8,children:[d.jsx(A.Text,{variant:"emphasized",component:"h3",color:"grey11",children:"Client code"}),d.jsx(lv,{title:"request.ts",language:"typescript",code:t,showLineNumbers:!1}),d.jsxs(A.Text,{children:["Learn more on"," ",d.jsx(A.Text,{component:"a",href:vee,target:"blank",underline:!0,children:"@prismicio/client documentation"}),"."]})]})}const Vl=(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),Ug=e=>Array.isArray(e),mU=(e,t)=>e.filter((n,r)=>r!==t),bee=(e,t,n,r={})=>{const{remove:i=!1,createNew:o=!0,noError:a=!1}=r,s=e,l=typeof(u=t)=="string"?u:typeof u=="number"?String(u):u.reduce((p,h)=>typeof h=="number"?`${p}[${h}]`:p===""?h:`${p}.${h}`,"");var u;const c=Object.assign(Object.assign({},r),{remove:i,createNew:o,noError:a,fullData:s,fullPath:l}),f=Array.isArray(t)?t:(p=>Array.isArray(p)?p:p.split(/(\.|\[\d+\])/).filter(h=>h!=="."&&h!=="").map(h=>{const m=/\[(\d+)\]/.exec(h);return m?Number(m[1]):h}).flat())(t).filter(p=>p!=="");return Ug(e)&&i&&f.length===1?mU(e,f[0]):Tp(e,f,n,c)},Tp=(e,t,n,r)=>{const i=bj(e)?Object.assign({},e):null,o=Ug(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:l,fullData:u,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=Cee(i,f,n,r);return g??i}return o&&typeof f=="number"?(See(o,f,n,r),o):(Vl(u,c,f,l),e)}const p=i||o||[];if(s&&t.length===2&&typeof t[1]=="number"){const g=p[f],y=t[1];return Ug(g)?p[f]=mU(g,y):Vl(u,c,f,l,"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(m=p[f],!Ug(m)&&!bj(m)){if(!a)return Vl(u,c,f,l),p;p[f]={}}return p[f]=Tp(p[f],h,n,r),p}var m;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 Vl(u,c,f,l),p},Cee=(e,t,n,r)=>{const{remove:i,createNew:o,noError:a,insertAfter:s,insertBefore:l,fullData:u,fullPath:c}=r;if(l!==void 0||s!==void 0){const p=Object.entries(e);let h=1/0;return h=typeof l=="number"?l:typeof s=="number"?s:p.findIndex(([m,g])=>m===(l??s)),s&&h++,p.splice(h,0,[t,n]),Object.fromEntries(p)}const f=t in e;i?f?delete e[t]:Vl(u,c,t,a):o||f?e[t]=n:Vl(u,c,t,a)},See=(e,t,n,r)=>{const{noError:i,fullData:o,fullPath:a,createNew:s,insert:l}=r;l&&e.splice(t,0,n),t in e?e[t]=n:s?e.push(n):Vl(o,a,t,i)},th=(e,t,n)=>{const r=Array.isArray(t)?t:wee(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 _ee(e,i,n);const o=e[i];return r.length===1?o:th(o,r.slice(1),n)},wee=e=>e.split(/(\.|\[\d+\])/).filter(t=>t!=="."&&t!=="").map(t=>{const n=/\[(\d+)\]/.exec(t);return n?Number(n[1]):t}).flat(),_ee=(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(u){try{l(r.next(u))}catch(c){o(c)}}function s(u){try{l(r.throw(u))}catch(c){o(c)}}function l(u){var c;u.done?i(u.value):(c=u.value,c instanceof n?c:new n(function(f){f(c)})).then(a,s)}l((r=r.apply(e,t||[])).next())})}const gU=({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:l=>r(l.target.value),autoFocus:!0,onFocus:l=>{n.length<40&&l.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})]})},ud=e=>e!==null&&typeof e=="object",vU=(e,t,n,r="")=>{if(!n&&!r)return!0;switch(e){case"collection":if(n){if(n(t,r))return!0;if(!_w(r,t,n))return!1}if(!n&&r&&!_w(r,t))return!1;break;case"value":if(n&&!n(t,r)||!n&&r&&!cd(t,r))return!1}return!0},_w=(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 ud(o)?_w(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)),xee=(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("."),sx=e=>e.shiftKey?"Shift":e.metaKey?"Meta":e.ctrlKey?"Control":e.altKey?"Alt":void 0,Tee=(e,t,n)=>{const r=e.key,i=sx(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))},Ml={key:"Enter"},Sj={confirm:Ml,cancel:{key:"Escape"},objectConfirm:Object.assign(Object.assign({},Ml),{modifier:["Meta","Shift","Control"]}),objectLineBreak:Ml,stringConfirm:Ml,stringLineBreak:Object.assign(Object.assign({},Ml),{modifier:["Shift"]}),numberConfirm:Ml,numberUp:{key:"ArrowUp"},numberDown:{key:"ArrowDown"},tabForward:{key:"Tab"},tabBack:{key:"Tab",modifier:"Shift"},booleanConfirm:Ml,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=Iee(a);Array.isArray(a)||r(s,({key:c,value:f})=>[c,f]);const l=s.findIndex(c=>c.key===o),u=s[l+(n==="next"?1:-1)];return u?ud(u.value)?Object.keys(u.value).length===0?Ts(e,[...i,u.key],n,r):yU(e,[...i,u.key],n,r):[...i,u.key]:i.length===0?null:Ts(e,i,n,r)},yU=(e,t,n="next",r)=>{const i=th(e,t);if(!ud(i))return t;const o=Array.isArray(i)?i.map((s,l)=>l):Object.keys(i);r(o,s=>[s,i]);const a=n==="next"?o[0]:o[o.length-1];return yU(e,[...t,a],n,r)},Iee=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})),bU=(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,l=(r=a==null?void 0:a.selectionEnd)!==null&&r!==void 0?r:1/0,u=((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(l));return a.value=u,a==null||a.setSelectionRange(s+1,s+1),u},lx={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)"}},CU=I.createContext({getStyles:()=>({}),icons:{}}),Eee=({theme:e=lx,icons:t={},docRoot:n,children:r})=>{const i=Ree(e,n);return d.jsx(CU.Provider,{value:{getStyles:(o,a)=>typeof i[o]=="function"?i[o](a):i[o],icons:t},children:r})},Bo=()=>I.useContext(CU),Ree=(e,t)=>{var n,r,i,o;const a={},s=(Array.isArray(e)?e:[e]).map(c=>$ee(c)?BC({fragments:{},styles:c},a):BC(c,a)),l=BC(lx,{});Object.keys(l).forEach(c=>{const f=c;s.forEach(p=>{p[f]&&(l[f]=Object.assign(Object.assign({},l[f]),p[f]))})});const u=Object.assign({},l);return Object.entries(a).forEach(([c,f])=>{const p=c;u[p]=h=>{const m=f(h)||{};return Object.assign(Object.assign({},l[p]),m)}}),typeof(u==null?void 0:u.inputHighlight)!="function"&&(!((n=u==null?void 0:u.inputHighlight)===null||n===void 0)&&n.backgroundColor)&&t.style.setProperty("--jer-highlight-color",(r=u==null?void 0:u.inputHighlight)===null||r===void 0?void 0:r.backgroundColor),typeof(u==null?void 0:u.iconCopy)!="function"&&(!((i=u==null?void 0:u.iconCopy)===null||i===void 0)&&i.color)&&t.style.setProperty("--jer-icon-copy-color",(o=u==null?void 0:u.iconCopy)===null||o===void 0?void 0:o.color),u},BC=(e,t)=>{const{fragments:n,styles:r}=e,i={};return Object.entries(r).forEach(([o,a])=>{const s=(Array.isArray(a)?a:[a]).reduce((l,u)=>{var c,f;if(typeof u=="function")return t[o]=u,Object.assign({},l);if(typeof u=="string"){const p=(c=n==null?void 0:n[u])!==null&&c!==void 0?c:u;return typeof p=="string"?Object.assign(Object.assign({},l),{[(f=kee[o])!==null&&f!==void 0?f:"color"]:p}):Object.assign(Object.assign({},l),p)}return Object.assign(Object.assign({},l),u)},{});i[o]=s}),i},$ee=e=>!("styles"in e),kee={container:"backgroundColor",collection:"backgroundColor",collectionInner:"backgroundColor",collectionElement:"backgroundColor",dropZone:"borderColor",inputHighlight:"backgroundColor"},SU=I.createContext({collapseState:null,setCollapseState:()=>{},doesPathMatch:()=>!1,currentlyEditingElement:null,setCurrentlyEditingElement:()=>{},previouslyEditedElement:null,setPreviouslyEditedElement:()=>{},areChildrenBeingEdited:()=>!1,dragSource:{path:null,pathString:null},setDragSource:()=>{},tabDirection:"next",setTabDirection:()=>{}}),Oee=({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),l=I.useRef("next"),u=I.useRef(null);return d.jsx(SU.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:u.current,setPreviouslyEditedElement:c=>{u.current=c},tabDirection:l.current,setTabDirection:c=>{l.current=c},dragSource:o,setDragSource:a},children:e})},Yh=()=>I.useContext(SU),xw="**INVALID_FUNCTION**",Mee=({value:e,setValue:t,isEditing:n,path:r,setIsEditing:i,handleEdit:o,stringTruncate:a,showStringQuotes:s,nodeData:l,handleKeyboard:u,keyboardCommon:c})=>{const{getStyles:f}=Bo(),p=I.useRef(null),h=Wd(r),m=s?'"':"";return n?d.jsx(gU,{className:"jer-input-text",textAreaRef:p,name:h,value:e,setValue:t,isEditing:n,handleKeyPress:g=>{u(g,Object.assign({stringConfirm:o,stringLineBreak:()=>{const y=bU(p,`
17
+ `);t(y)}},c))},styles:f("input",l)}):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",l),children:[m,xee(e,a),m]})},Fee=({value:e,setValue:t,isEditing:n,path:r,setIsEditing:i,handleEdit:o,nodeData:a,handleKeyboard:s,keyboardCommon:l})=>{const{getStyles:u}=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)},l)),style:Object.assign({width:String(e).length/1.5+2+"em"},u("input",a))}):d.jsx("span",{onDoubleClick:()=>i(!0),className:"jer-value-number",style:u("number",a),children:e})},jee=({value:e,setValue:t,isEditing:n,path:r,setIsEditing:i,handleEdit:o,nodeData:a,handleKeyboard:s,keyboardCommon:l})=>{const{getStyles:u}=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)},l))},autoFocus:!0}):d.jsx("span",{onDoubleClick:()=>i(!0),className:"jer-value-boolean",style:u("boolean",a),children:String(e)})},Lee=({value:e,isEditing:t,setIsEditing:n,handleEdit:r,nodeData:i,handleKeyboard:o,keyboardCommon:a})=>{const{getStyles:s}=Bo(),l=I.useRef();I.useEffect(()=>{if(t)return l.current=window.setTimeout(()=>window.addEventListener("keydown",u),100),()=>window.removeEventListener("keydown",u);window.clearTimeout(l.current)},[t]);const u=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)})},Dee=({value:e})=>{let t="Error!";switch(typeof e){case"string":e===xw&&(t="Function");break;case"undefined":t="Undefined";break;case"symbol":t="Symbol"}return d.jsx("span",{className:"jer-value-invalid",children:t})},Uee=({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"})]}),Bee=({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"})]}),Pee=({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"})}),Wee=({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"})]}),Nee=({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"})]}),Kee=({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"})}),qee=({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"})}),zl=({name:e,nodeData:t,rotate:n})=>{var r,i,o,a,s,l,u;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(Uee,Object.assign({},p,{style:c("iconAdd",t)}));case"edit":return(i=f==null?void 0:f.edit)!==null&&i!==void 0?i:d.jsx(Bee,Object.assign({},p,{style:c("iconEdit",t)}));case"delete":return(o=f==null?void 0:f.delete)!==null&&o!==void 0?o:d.jsx(Pee,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(Wee,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(Nee,Object.assign({},p,{style:Object.assign({fontSize:"90%"},c("iconOk",t))}));case"cancel":return(l=f==null?void 0:f.cancel)!==null&&l!==void 0?l:d.jsx(Kee,Object.assign({},p,{style:Object.assign({fontSize:"130%"},c("iconCancel",t))}));case"chevron":return(u=f==null?void 0:f.chevron)!==null&&u!==void 0?u:d.jsx(qee,{size:"1em",style:c("iconCollection",t)});default:return d.jsx(d.Fragment,{})}},wU=({startEdit:e,handleDelete:t,handleAdd:n,enableClipboard:r,type:i,customButtons:o,nodeData:a,translate:s,keyboardControls:l,handleKeyboard:u})=>{const{getStyles:c}=Bo(),f=s("KEY_NEW",a),[p,h]=I.useState(!1),[m,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=sx(b);if(O&&l.clipboardModifier.includes(O)?(S=Vee(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(zl,{name:"copy",nodeData:a})}),e&&d.jsx("div",{onClick:b=>{b.stopPropagation(),e()},children:d.jsx(zl,{name:"edit",nodeData:a})}),t&&d.jsx("div",{onClick:b=>{b.stopPropagation(),t()},children:d.jsx(zl,{name:"delete",nodeData:a})}),n&&d.jsx("div",{onClick:b=>{b.stopPropagation(),i==="object"?h(!0):n("")},children:d.jsx(zl,{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:m,onChange:b=>g(b.target.value),autoFocus:!0,onFocus:b=>b.target.select(),onKeyDown:b=>{u(b,{stringConfirm:()=>{n&&(h(!1),n(m),g(f))},cancel:()=>{h(!1),g(f)}})},style:c("input",a)}),d.jsx(ux,{onOk:b=>{m&&(b.stopPropagation(),h(!1),n(m))},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(zl,{name:"ok",nodeData:n})}),d.jsx("div",{onClick:t,children:d.jsx(zl,{name:"cancel",nodeData:n})})]}),Vee=e=>e.reduce((t,n)=>typeof n=="number"?`${t}[${n}]`:t===""?n:`${t}.${n}`,""),zee=["string","number","boolean","null","object","array"],_U=(e=[],t)=>{const n=e.filter(({condition:m})=>m(t));if(n.length===0)return{};const r=n[0],{element:i,wrapperElement:o,customNodeProps:a,wrapperProps:s,hideKey:l=!1,showEditTools:u=!0,showOnEdit:c=!1,showOnView:f=!0,showCollectionWrapper:p=!0}=r,h=function(m,g){var y={};for(var C in m)Object.prototype.hasOwnProperty.call(m,C)&&g.indexOf(C)<0&&(y[C]=m[C]);if(m!=null&&typeof Object.getOwnPropertySymbols=="function"){var _=0;for(C=Object.getOwnPropertySymbols(m);_<C.length;_++)g.indexOf(C[_])<0&&Object.prototype.propertyIsEnumerable.call(m,C[_])&&(y[C[_]]=m[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:l,showEditTools:u,showOnEdit:c,showOnView:f,showCollectionWrapper:p},h)},xU=({props:e,collapsed:t})=>{const{data:n,nodeData:r,parentData:i,onEdit:o,onError:a,showErrorMessages:s,restrictEditFilter:l,restrictDeleteFilter:u,restrictAddFilter:c,restrictDragFilter:f,translate:p,errorMessageTimeout:h}=e,{currentlyEditingElement:m,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(()=>!l(_),[_]),E=I.useMemo(()=>!u(_),[_]),R=I.useMemo(()=>!c(_),[_]),O=I.useMemo(()=>!f(_)&&E&&m===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=m===w,H=m===`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}}},TU=({canDrag:e,canDragOnto:t,path:n,nodeData:r,onMove:i,onError:o,translate:a})=>{const{getStyles:s}=Bo(),{dragSource:l,setDragSource:u}=Yh(),[c,f]=I.useState(!1),p=Wd(n),h=I.useMemo(()=>e?{onDragStart:C=>{C.stopPropagation(),u({path:n,pathString:p})},onDragEnd:C=>{C.stopPropagation(),u({path:null,pathString:null})}}:{},[e]),m=I.useMemo(()=>C=>t?{onDragOver:_=>{_.stopPropagation(),_.preventDefault()},onDrop:_=>{_.stopPropagation(),y(C),u({path:null,pathString:null}),f(!1)},onDragEnter:_=>{var b;_.stopPropagation(),p.startsWith((b=l.pathString)!==null&&b!==void 0?b:"")||f(C)},onDragExit:_=>{_.stopPropagation(),f(!1)}}:{},[l,t]),g=I.useMemo(()=>t&&l.pathString!==null?d.jsx("div",Object.assign({className:"jer-drop-target-bottom",style:{height:"50%",position:"absolute",width:"100%",top:"50%",zIndex:n.length}},m("below"))):null,[l,t]),y=C=>{var _,b;const v=(_=l.path)===null||_===void 0?void 0:_.slice(-1)[0],S=(b=l.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(l.path,n,C).then(E=>{E&&o({code:"UPDATE_ERROR",message:E},r.value)})};return{dragSourceProps:h,getDropTargetProps:m,BottomDropTarget:g,DropTargetPadding:({position:C,nodeData:_})=>c===C?d.jsx("div",{className:"jer-drag-n-drop-padding",style:s("dropZone",_)}):null,handleDrop:y}},Qee=(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),l=JSON.stringify(e,null,2).replace(/\\n/g,`
18
+ `).split(`
19
+ `).map(u=>Math.ceil(u.length/s)).reduce((u,c)=>u+c,0)*a;return Math.min(l+30,window.innerHeight-50)},IU=e=>{const{data:t,parentData:n,onEdit:r,onDelete:i,onChange:o,onMove:a,enableClipboard:s,canDragOnto:l,restrictTypeSelection:u,searchFilter:c,searchText:f,showLabel:p,stringTruncate:h,showStringQuotes:m,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"?xw:t),{pathString:H,nodeData:z,path:N,name:Y,canEdit:ee,canDelete:F,canDrag:M,error:W,onError:re,handleEditKey:Ie,derivedValues:Ce}=xU({props:e}),{dragSourceProps:P,getDropTargetProps:ae,BottomDropTarget:Ge,DropTargetPadding:ve}=TU({canDrag:M,canDragOnto:l,path:N,nodeData:z,onMove:a,onError:re,translate:y}),De=_U(C,z),[mt,on]=I.useState(dg(t,De)),Yt=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"?xw:t),on(dg(t,De))},[t,W]);const{CustomNode:_e,customNodeProps:Ze,hideKey:ht,showEditTools:tt=!0,showOnEdit:ut,showOnView:Gt}=De,wn=[...zee,...C.filter(({showInTypesSelector:j=!1,name:te})=>j&&!!te).map(({name:j})=>j)],Jt=I.useMemo(()=>{if(typeof u=="boolean")return u?[]:wn;if(Array.isArray(u))return u;const j=u(z);return typeof j=="boolean"?j?[]:wn:j},[z,u]),{isEditing:Rt}=Ce,Tr=vU("value",z,c,f);if(Rt&&(!Tr||!ee)){const j=Ts(z.fullData,N,O,v);w(j||E)}if(!Tr)return null;const Pt=()=>{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)})},Zt=()=>{w(null),K(t),on(dg(t,De))},{isEditingKey:an,canEditKey:Ir}=Ce,Er=!Rt&&W,Me=Rt&&Jt.length>0,$e=mt!=="invalid"&&!W&&tt,D=p&&an,L=p&&!an&&!ht,U={value:B,parentData:n,setValue:Yt,isEditing:Rt,setIsEditing:ee?()=>w(N):()=>{},handleEdit:Pt,handleCancel:Zt,path:N,stringTruncate:h,showStringQuotes:m,nodeData:z,translate:y,handleKeyboard:_,keyboardCommon:{cancel:Zt,tabForward:()=>{$("next"),R(H);const j=Ts(z.fullData,N,"next",v);j&&(Pt(),w(j))},tabBack:()=>{$("prev"),R(H);const j=Ts(z.fullData,N,"prev",v);j&&(Pt(),w(j))}}},ce=_e&&(Rt&&ut||!Rt&&Gt)?d.jsx(_e,Object.assign({},e,{value:B,customNodeProps:Ze,setValue:Yt,handleEdit:Pt,handleCancel:Zt,handleKeyPress:j=>_(j,{stringConfirm:Pt,cancel:Zt}),isEditing:Rt,setIsEditing:()=>w(N),getStyles:S})):Hee(dg(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:()=>Ir&&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:Zt,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}),Rt?d.jsx(ux,{onOk:Pt,onCancel:Zt,nodeData:z}):$e&&d.jsx(wU,{startEdit:ee?()=>w(N,Zt):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(le=>le.name===te);if(pe)r(pe.defaultValue,N),on(te),w(null),T({path:N,collapsed:!1});else{const le=Yee(B,te,y("DEFAULT_NEW_KEY",z),De!=null&&De.CustomNode?y("DEFAULT_STRING",z):void 0);Yt(le),r(le,N).then(be=>{be&&(re({code:"UPDATE_ERROR",message:be},le),w(null))})}})(j.target.value),value:mt,children:Jt.map(j=>d.jsx("option",{value:j,children:j},j))}),d.jsx("span",{className:"focus"})]}),Er&&d.jsx("span",{className:"jer-error-slug",style:S("error",z),children:W})]})]}),d.jsx(ve,{position:"below",nodeData:z})]}))},dg=(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",Hee=(e,t)=>{const n=t.value;switch(e){case"string":return d.jsx(Mee,Object.assign({},t,{value:n}));case"number":return d.jsx(Fee,Object.assign({},t,{value:n}));case"boolean":return d.jsx(jee,Object.assign({},t,{value:n}));case"null":return d.jsx(Lee,Object.assign({},t));default:return d.jsx(Dee,Object.assign({},t))}},Yee=(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)}},EU=e=>{const{getStyles:t}=Bo(),{collapseState:n,setCollapseState:r,doesPathMatch:i,currentlyEditingElement:o,setCurrentlyEditingElement:a,areChildrenBeingEdited:s}=Yh(),{mainContainerRef:l,data:u,nodeData:c,parentData:f,showCollectionCount:p,onEdit:h,onAdd:m,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(u)),W=C(c),{contentRef:re,isAnimating:Ie,maxHeight:Ce,collapsed:P,animateCollapse:ae}=((me,at,ms,Co)=>{const[sg,lg]=I.useState(ms?0:void 0),[RC,AX]=I.useState(ms),$C=I.useRef(!1),kC=I.useRef(null),oj=I.useRef(0),aj=I.useRef();return{contentRef:kC,isAnimating:$C.current,animateCollapse:OC=>{var MC,FC;if(RC!==OC){switch(window.clearTimeout(aj.current),$C.current=!0,OC){case!0:{const sj=(FC=(MC=kC.current)===null||MC===void 0?void 0:MC.offsetHeight)!==null&&FC!==void 0?FC:0;oj.current=sj,lg(sj),setTimeout(()=>{lg(0)},5);break}case!1:lg(oj.current||Qee(me,kC,Co))}AX(!RC),aj.current=window.setTimeout(()=>{$C.current=!1,OC||lg(void 0)},at)}},maxHeight:sg,collapsed:RC}})(u,_,W,l),{pathString:Ge,nodeData:ve,path:De,name:mt,size:on,canEdit:Yt,canDelete:_e,canAdd:Ze,canDrag:ht,error:tt,setError:ut,onError:Gt,handleEditKey:wn,derivedValues:Jt}=xU({props:e,collapsed:P}),{dragSourceProps:Rt,getDropTargetProps:Tr,BottomDropTarget:Pt,DropTargetPadding:Zt}=TU({canDrag:ht,canDragOnto:y,path:De,nodeData:ve,onMove:b,onError:Gt,translate:$}),an=I.useRef(!W);I.useEffect(()=>{M(H(u)),xn&&a(null)},[u]),I.useEffect(()=>{const me=C(ve)&&!Jt.isEditing;an.current=!me,ae(me)},[C]),I.useEffect(()=>{n!==null&&i(De)&&(an.current=!0,ae(n.collapsed))},[n]);const Ir=I.useRef(null),Er=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(()=>_U(B,ve),[]),le=s(Ge);if(le&&P&&ae(!1),!(vU("collection",ve,S,w)||ve.level===0)&&!le)return null;const be=Array.isArray(u)?"array":"object",ot=be==="array"?{open:"[",close:"]"}:{open:"{",close:"}"},_n=me=>{if(me.key!=="Tab"||me.getModifierState("Shift"))Y(me,{objectConfirm:kl,cancel:sa});else{me.preventDefault();const at=bU(Ir," ");M(at)}},bo=me=>{const at=sx(me);if(at&&N.collapseModifier.includes(at))return an.current=!0,void r({collapsed:!P,path:De});o&&o.includes(Ge)||(an.current=!0,r(null),ae(!P))},kl=()=>{try{const me=K(F);if(a(null),ut(null),JSON.stringify(me)===JSON.stringify(u))return;h(me,De).then(at=>{at&&Gt({code:"UPDATE_ERROR",message:at},me)})}catch{Gt({code:"INVALID_JSON",message:$("ERROR_INVALID_JSON",ve)},F)}},aa=De.length>0?()=>{g(u,De).then(me=>{me&&Gt({code:"DELETE_ERROR",message:me},u)})}:void 0,sa=()=>{a(null),ut(null),M(H(u))},{isEditing:xn,isEditingKey:As,isArray:IC,canEditKey:Ap}=Jt,Ol=p==="when-closed"?P:p,dX=!xn&&ce,fX=(R||!IC)&&!U&&mt!==void 0,pX=Me&&(xn&&j||!xn&&te),ag=Object.entries(u).map(([me,at])=>[be==="array"?Number(me):me,at]);be==="object"&&E(ag,me=>me);const ej=an.current?xn?d.jsxs("div",{className:"jer-collection-text-edit",children:[z?d.jsx(z,{value:F,onChange:M,onKeyDown:me=>Y(me,{objectConfirm:kl,cancel:sa})}):d.jsx(gU,{textAreaRef:Ir,className:"jer-collection-text-area",name:Ge,value:F,setValue:M,isEditing:xn,handleKeyPress:_n,styles:t("input",ve)}),d.jsx("div",{className:"jer-collection-input-button-row",children:d.jsx(ux,{onOk:kl,onCancel:sa,nodeData:ve})})]}):ag.map(([me,at],ms)=>{const Co={key:me,value:at,path:[...De,me],level:De.length+1,index:ms,size:ud(at)?Object.keys(at).length:1,parentData:u,fullData:ve.fullData};return d.jsx("div",{className:"jer-collection-element",style:t("collectionElement",Co),children:ud(at)?d.jsx(EU,Object.assign({},e,{data:at,parentData:u,nodeData:Co,showCollectionCount:p,canDragOnto:Yt}),me):d.jsx(IU,Object.assign({},e,{data:at,parentData:u,nodeData:Co,canDragOnto:Yt,showLabel:be==="object"||R}),me)},me)}):null,EC=!!pe&&P&&!le;EC||(an.current=!0);const tj=Object.assign(Object.assign({},e),{data:u,value:u,parentData:f,nodeData:ve,setValue:me=>Wc(void 0,void 0,void 0,function*(){return yield h(me,De)}),handleEdit:kl,handleCancel:sa,handleKeyPress:_n,isEditing:xn,setIsEditing:()=>a(De),getStyles:t,canDragOnto:Yt}),hX=pX?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:()=>wn(me.target.value),cancel:sa,tabForward:()=>{wn(me.target.value);const at=ag==null?void 0:ag[0][0];a(at?[...De,at]:Ts(ve.fullData,De,"next",E))},tabBack:()=>{wn(me.target.value),a(Ts(ve.fullData,De,"prev",E))}}),style:{width:String(mt).length/1.5+.5+"em"}}):fX&&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=dX&&d.jsx(wU,{startEdit:Yt?()=>{an.current=!0,a(De)}:void 0,handleAdd:Ze?me=>{ae(!1);const at=Er(ve,me);if(be==="array"){const ms=ee.array?0:u.length,Co=ee.array?{insert:!0}:{};m(at,[...De,ms],Co).then(sg=>{sg&&Gt({code:"ADD_ERROR",message:sg},at)})}else if(me in u)Gt({code:"KEY_EXISTS",message:$("ERROR_KEY_EXISTS",ve)},me);else{const ms=ee.object?{insertBefore:0}:{};m(at,[...De,me],ms).then(Co=>{Co&&Gt({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:ht},Rt,Tr("above"),{children:[d.jsx("div",{className:"jer-clickzone",style:{width:T/2+1+"em",zIndex:10+2*ve.level},onClick:me=>bo(me)}),!xn&&Pt,d.jsx(Zt,{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(zl,{name:"chevron",rotate:P,nodeData:ve})}),nj,!xn&&d.jsx("span",{className:"jer-brackets jer-bracket-open",style:t("bracket",ve),children:ot.open})]}),!xn&&Ol&&d.jsx("div",{className:"jer-collection-item-count"+(Ol?" jer-visible":" jer-hidden"),style:t("itemCount",ve),children:on===1?$("ITEM_SINGLE",Object.assign(Object.assign({},ve),{size:1}),1):$("ITEMS_MULTIPLE",ve,on)}),d.jsx("div",{className:"jer-brackets"+(EC?" 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:EC||Ie?"clip":"visible",maxHeight:le?void 0:Ce},t("collectionInner",ve)),ref:re,children:[hX,d.jsx("div",{className:xn?"jer-collection-error-row":"jer-collection-error-row-edit",children:tt&&d.jsx("span",{className:"jer-error-slug",style:t("error",ve),children:tt})}),!xn&&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(Zt,{position:"below",nodeData:ve})]}));return D?d.jsx(D,Object.assign({customNodeProps:L},tj,{children:ij})):ij},Gee={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"},Jee=(e,t)=>(n,r,i)=>((o,a,s,l,u)=>{if(a[l]){const f=a[l](s);if(f!==null)return f}const c=l in o?o[l]:Gee[l];return u===void 0?c:c==null?void 0:c.replace("{{count}}",String(u))})(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 l=document.createElement("style");if(l.setAttribute("type","text/css"),t.attributes)for(var u=Object.keys(t.attributes),c=0;c<u.length;c++)l.setAttribute(u[c],t.attributes[u[c]]);var f=r==="prepend"?"afterbegin":"beforeend";return o.insertAdjacentElement(f,l),l}})(':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 Zee=({data:e,setData:t,rootName:n="root",onUpdate:r=()=>{},onEdit:i=r,onDelete:o=r,onAdd:a=r,onChange:s,onError:l,showErrorMessages:u=!0,enableClipboard:c=!0,indent:f=2,collapse:p=!1,collapseAnimationTime:h=300,showCollectionCount:m=!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(Jee(z,ee),[z,ee]),[on,Yt]=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}),ht=I.useRef(null);I.useEffect(()=>{ve(null);const Me=setTimeout(()=>Yt(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},ut=(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=tte(D)?D:["error",D],[U,ce]=L;if(U==="error")return Ze($e.currentData),ce===!1?mt("ERROR_UPDATE",tt):String(ce);Ze(ce)}),Gt=I.useMemo(()=>vp(g),[g]),wn=I.useMemo(()=>vp(y),[y]),Jt=I.useMemo(()=>vp(C),[C]),Rt=I.useMemo(()=>vp(b),[b]),Tr=I.useMemo(()=>ete(v),[v]),Pt=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]),Zt=I.useCallback((Me,$e)=>((D,L,U)=>{const ce=Object.entries(L);for(const[j,te]of ce)if(Tee(U,D[j],j)){U.preventDefault(),te();break}})(Pt,$e,Me),[P]),an=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]),Ir={mainContainerRef:ht,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 ut(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 ut(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 ut(a,{currentData:L,newData:U,currentValue:ce,newValue:j,name:$e.slice(-1)[0],path:$e})}),onChange:s,onError:l,showErrorMessages:u,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 le=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 le=="number"&&j<le&&(le-=1);const be=typeof le=="number"?{insert:!0}:D==="above"?{insertBefore:pe}:{insertAfter:pe},{newData:ot,newValue:_n}=gp(U,[...te,le],ce,"add",be);return yield ut(i,{currentData:L,newData:ot,currentValue:ce,newValue:_n,name:$e.slice(-1)[0],path:$e})}),showCollectionCount:m,collapseFilter:De,collapseAnimationTime:h,restrictEditFilter:Gt,restrictDeleteFilter:wn,restrictAddFilter:Jt,restrictTypeSelection:_,restrictDragFilter:Rt,canDragOnto:!1,searchFilter:Tr,searchText:on,enableClipboard:c,keySort:T,sort:an,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:Zt,keyboardControls:Pt,insertAtTop:{object:ae===!0||ae==="object",array:ae===!0||ae==="array"}},Er=Object.assign(Object.assign({},Ge("container",tt)),{minWidth:$,maxWidth:B});return Er.fontSize=K??Er.fontSize,d.jsx("div",{id:Y,ref:ht,className:`jer-editor-container ${N??""}`,style:Er,children:ud(_e)?d.jsx(EU,Object.assign({data:_e},Ir)):d.jsx(IU,Object.assign({data:_e,showLabel:!0},Ir))})},Xee=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(Eee,{theme:(t=e.theme)!==null&&t!==void 0?t:lx,icons:e.icons,docRoot:n,children:d.jsx(Oee,{children:d.jsx(Zee,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:bee(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,ete=e=>{if(e!==void 0)return e==="value"?cd:e==="key"?Cj:e==="all"?(t,n)=>cd(t,n)||Cj(t,n):e},tte=e=>Array.isArray(e)&&e.length===2&&["error","value"].includes(e[0]);function nte(){var t,n,r;const e=Ea();return d.jsxs(A.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(A.Box,{as:"header",padding:{inline:16},alignItems:"center",border:{bottom:!0},minHeight:48,children:d.jsx(A.Text,{variant:"small",component:"h2",color:"grey9",children:"Response"})}),((t=e.response)==null?void 0:t.status)==="pending"&&d.jsx(rte,{}),((n=e.response)==null?void 0:n.status)==="error"&&d.jsx(ite,{response:e.response}),((r=e.response)==null?void 0:r.status)==="success"&&d.jsx(ote,{response:e.response})]})}function rte(){return d.jsx(A.Box,{display:"grid",children:d.jsx(A.Box,{padding:16,justifyContent:"center",children:d.jsx(A.Alert,{color:"info",icon:"terminal",title:"Fetching data",titleLoading:!0})})})}function ite(e){const{response:t}=e;return d.jsx(A.Box,{display:"grid",children:d.jsx(A.Box,{padding:16,justifyContent:"center",children:d.jsx(A.Alert,{color:"error",icon:"alert",title:"Error fetching data",subtitle:t.error.message})})})}function ote(e){const{response:t}=e;return d.jsxs(d.Fragment,{children:[d.jsx(ate,{response:t}),d.jsx(ste,{response:t})]})}function ate(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(A.Box,{as:"header",padding:{inline:16},alignItems:"center",border:{bottom:!0},minHeight:48,children:[d.jsx(A.Box,{flexGrow:1,gap:12,children:!!t.ref&&d.jsx(A.Badge,{icon:"tag",title:d.jsxs(d.Fragment,{children:[d.jsxs(A.Text,{variant:"small",color:"grey11",children:["ref: $",t.ref]}),d.jsx(A.Icon,{name:"contentCopy",size:"extraSmall",color:"grey11"})]}),size:"medium",color:"grey",onClick:()=>navigator.clipboard.writeText(t.ref??"")})}),d.jsxs(A.Box,{gap:12,children:[!!n&&d.jsx(d.Fragment,{children:d.jsxs(A.Box,{alignItems:"center",gap:4,children:[d.jsx(A.Icon,{name:"insertDriveFile",size:"extraSmall",color:"grey11"}),d.jsxs(A.Text,{variant:"small",color:"grey11",component:"p",children:[Ar.pluralize(n,"Document","Documents")," ",d.jsx(A.Text,{variant:"small",color:"purple9",component:"span",children:n})]})]})}),!!t.duration&&d.jsx(d.Fragment,{children:d.jsxs(A.Box,{alignItems:"center",gap:4,children:[d.jsx(A.Icon,{name:"schedule",size:"extraSmall",color:"grey11"}),d.jsxs(A.Text,{variant:"small",color:"grey11",component:"p",children:["Time"," ",d.jsxs(A.Text,{variant:"small",color:"green9",component:"span",children:[t.duration.toString(),"ms"]})]})]})})]})]})}function ste(e){const{response:t}=e;return d.jsxs(A.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(A.Box,{position:"absolute",top:16,right:16,gap:8,children:[d.jsx(A.Button,{startIcon:"contentCopy",color:"grey",onClick:()=>navigator.clipboard.writeText(JSON.stringify(t.data,null,2)),children:"Copy"}),t.url&&d.jsx(A.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(Xee,{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(A.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 lte(){return d.jsx(A.Box,{display:"grid",gridTemplateColumns:"380px 1px minmax(0, 1fr)",width:"100%",height:"100%",gap:16,children:d.jsxs(uee,{children:[d.jsx(hee,{}),d.jsx(A.Separator,{orientation:"vertical",style:"dashed",decorative:!0}),d.jsx(nte,{})]})})}var Se=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ku(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={},Tw=function(e,t){return Tw=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])},Tw(e,t)};function ute(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Tw(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Iw=function(){return Iw=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},Iw.apply(this,arguments)};function cte(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 dte(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 fte(e,t){return function(n,r){t(n,r,e)}}function pte(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,l=s==="getter"?"get":s==="setter"?"set":"value",u=!t&&e?r.static?e:e.prototype:null,c=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),f,p=!1,h=n.length-1;h>=0;h--){var m={};for(var g in r)m[g]=g==="access"?{}:r[g];for(var g in r.access)m.access[g]=r.access[g];m.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[l],m);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[l]=f)}u&&Object.defineProperty(u,r.name,c),p=!0}function hte(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 Ate(e){return typeof e=="symbol"?e:"".concat(e)}function mte(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 gte(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function vte(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{u(r.next(c))}catch(f){a(f)}}function l(c){try{u(r.throw(c))}catch(f){a(f)}}function u(c){c.done?o(c.value):i(c.value).then(s,l)}u((r=r.apply(e,t||[])).next())})}function yte(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(u){return function(c){return l([u,c])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var cx=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 bte(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&cx(t,e,n)}function Ew(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 RU(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 Cte(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(RU(arguments[t]));return e}function Ste(){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 wte(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 _te(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(m,g){o.push([p,h,m,g])>1||s(p,h)})})}function s(p,h){try{l(r[p](h))}catch(m){f(o[0][3],m)}}function l(p){p.value instanceof nh?Promise.resolve(p.value.v).then(u,c):f(o[0][2],p)}function u(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 xte(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 Tte(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 Ew=="function"?Ew(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,l){a=e[o](a),i(s,l,a.done,a.value)})}}function i(o,a,s,l){Promise.resolve(l).then(function(u){o({value:u,done:s})},a)}}function Ite(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var Ete=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function Rte(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)&&cx(t,e,n);return Ete(t,e),t}function $te(e){return e&&e.__esModule?e:{default:e}}function kte(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 Ote(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 Mte(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 Fte=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Iw},__asyncDelegator:xte,__asyncGenerator:_te,__asyncValues:Tte,__await:nh,__awaiter:vte,__classPrivateFieldGet:kte,__classPrivateFieldIn:Mte,__classPrivateFieldSet:Ote,__createBinding:cx,__decorate:dte,__esDecorate:pte,__exportStar:bte,__extends:ute,__generator:yte,__importDefault:$te,__importStar:Rte,__makeTemplateObject:Ite,__metadata:gte,__param:fte,__propKey:Ate,__read:RU,__rest:cte,__runInitializers:hte,__setFunctionName:mte,__spread:Cte,__spreadArray:wte,__spreadArrays:Ste,__values:Ew},Symbol.toStringTag,{value:"Module"})),G=ku(Fte);var Rr={};function $U(e){return function(t){return function(n){return n.reduce(function(r,i){return e.alt(r,function(){return i})},t)}}}const jte=Object.freeze(Object.defineProperty({__proto__:null,altAll:$U},Symbol.toStringTag,{value:"Module"}));function Lte(e){return $U(e)(e.zero())}const Dte=Object.freeze(Object.defineProperty({__proto__:null,altAll:Lte},Symbol.toStringTag,{value:"Module"}));var kU=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))}}}}},dx=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},OU=function(e){var t=dx(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}},fx=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}}},MU=function(e){var t=fx(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))}}}},Ute=function(e){return function(t){return t(e)}};function Q(e){return e}var dd=Q;function Dr(e){return function(){return e}}var px=Dr(!0),FU=Dr(!1),jU=Dr(null),hx=Dr(void 0),Bte=hx;function Pte(e){return function(t,n){return e(n,t)}}function X(e,t,n,r,i,o,a,s,l){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 l(s(a(o(i(r(n(t(e.apply(this,arguments)))))))))}}}function LU(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e}function Wte(e){return e+1}function Nte(e){return e-1}function DU(e){throw new Error("Called `absurd` function which should be uncallable")}function Kte(e){return function(t){return e.apply(void 0,t)}}function qte(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,l){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 l(s(a(o(i(r(n(t(e))))))));default:{for(var u=arguments[0],c=1;c<arguments.length;c++)u=arguments[c](u);return u}}}var Vte=DU,Ur=function(e,t){return t};function zte(e){return function(t){return!e(t)}}var Qte=function(){return{concat:function(e,t){return X(e,t)},empty:Q}};const UU=Object.freeze(Object.defineProperty({__proto__:null,SK:Ur,absurd:DU,apply:Ute,constFalse:FU,constNull:jU,constTrue:px,constUndefined:hx,constVoid:Bte,constant:Dr,decrement:Nte,flip:Pte,flow:X,getBooleanAlgebra:kU,getEndomorphismMonoid:Qte,getMonoid:OU,getRing:MU,getSemigroup:dx,getSemiring:fx,hole:Vte,identity:Q,increment:Wte,not:zte,pipe:x,tuple:LU,tupled:Kte,unsafeCoerce:dd,untupled:qte},Symbol.toStringTag,{value:"Module"}));var Hte=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))},tn=function(e){return e._tag==="None"},Ft=function(e){return e._tag==="Some"},Re={_tag:"None"},ye=function(e){return{_tag:"Some",value:e}},hn=function(e){return e._tag==="Left"},Ax=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]},Tt=function(e){return e.length>0},ci=function(e){return e[0]},Nd=function(e){return e.slice(1)},Ln=[],gn={},gt=Object.prototype.hasOwnProperty,Ay=function(e){return Hte([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 qt(e){return function(t){return function(n){return e.ap(e.map(n,function(r){return function(){return r}}),t)}}}function Vt(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(r){return r}}),t)}}}function zt(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 mx(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):mx(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 Yte(e){return gt.call(PC,e)||(PC[e]=mx(LU,e-1,[])),PC[e]}function Gte(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=Yte(r),o=e.map(t[0],i),a=1;a<r;a++)o=e.ap(o,t[a]);return o}}function Jte(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 mx(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 Zte(e){return function(t){for(var n=Object.keys(t),r=n.length,i=Jte(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}const Xte=Object.freeze(Object.defineProperty({__proto__:null,ap:Ra,apFirst:qt,apS:zt,apSecond:Vt,getApplySemigroup:vn,sequenceS:Zte,sequenceT:Gte},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 Qt(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 ene=Object.freeze(Object.defineProperty({__proto__:null,bindTo:Qt,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 BU(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 tne=Object.freeze(Object.defineProperty({__proto__:null,getApplicativeComposition:BU,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 Ht(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 nne=Object.freeze(Object.defineProperty({__proto__:null,bind:Ht,chainFirst:vt},Symbol.toStringTag,{value:"Module"}));function Po(e){return function(t){return function(n){return e.fromEither(tn(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 Ou(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 Mu(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 rne=Object.freeze(Object.defineProperty({__proto__:null,chainEitherK:$a,chainFirstEitherK:ka,chainOptionK:Ou,filterOrElse:Mu,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)}}},PU=function(e){return ki(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})},WU=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])})})},ine=function(e,t){return x(e,NU(t))},NU=function(e){return function(t){return ki(function(n,r){return t.equals(e(n),e(r))})}},KU="Eq",Vd={equals:function(e,t){return e===t}},one={equals:function(){return!0}},qU=function(){return{concat:function(e,t){return ki(function(n,r){return e.equals(n,r)&&t.equals(n,r)})}}},ane=function(){return{concat:qU().concat,empty:one}},VU={URI:KU,contramap:ine},sne=WU,lne=PU,une=Vd.equals,cne=VU,dne=Vd,fne=Vd,pne=Vd,hne={equals:function(e,t){return e.valueOf()===t.valueOf()}};const Ane=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:VU,URI:KU,contramap:NU,eq:cne,eqBoolean:dne,eqDate:hne,eqNumber:pne,eqStrict:Vd,eqString:fne,fromEquals:ki,getMonoid:ane,getSemigroup:qU,getStructEq:lne,getTupleEq:sne,strictEqual:une,struct:PU,tuple:WU},Symbol.toStringTag,{value:"Module"}));var zU=function(e){return function(t,n){return t===n||e(t,n)===0}},Fu=function(e){return{equals:zU(e),compare:function(t,n){return t===n?0:e(t,n)}}},QU=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Fu(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])})},gx=function(e){return Fu(function(t,n){return e.compare(n,t)})},mne=function(e,t){return x(e,my(t))},my=function(e){return function(t){return Fu(function(n,r){return t.compare(e(n),e(r))})}},HU="Ord",YU=function(){return{concat:function(e,t){return Fu(function(n,r){var i=e.compare(n,r);return i!==0?i:t.compare(n,r)})}}},vx=function(){return{concat:YU().concat,empty:Fu(function(){return 0})}},GU={URI:HU,contramap:mne},gne={equals:px,compare:Dr(0)},vne=function(e){return function(t){return function(n){return n===t||e.compare(n,t)===0}}},JU=function(e){return function(t,n){return e.compare(t,n)===-1}},ZU=function(e){return function(t,n){return e.compare(t,n)===1}},yne=function(e){return function(t,n){return e.compare(t,n)!==1}},bne=function(e){return function(t,n){return e.compare(t,n)!==-1}},gy=function(e){return function(t,n){return t===n||e.compare(t,n)<1?t:n}},vy=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}},XU=function(e){var t=gy(e),n=vy(e);return function(r,i){return function(o){return n(t(o,i),r)}}},Cne=function(e){var t=JU(e),n=ZU(e);return function(r,i){return function(o){return!(t(o,r)||n(o,i))}}},Sne=QU,wne=gx,_ne=GU;function xne(e,t){return e<t?-1:e>t?1:0}var yx={equals:Vd.equals,compare:xne},Tne=yx,Ine=yx,uv=yx,Ene=x(uv,my(function(e){return e.valueOf()}));const Rne=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:GU,URI:HU,between:Cne,clamp:XU,contramap:my,equals:vne,equalsDefault:zU,fromCompare:Fu,geq:bne,getDualOrd:wne,getMonoid:vx,getSemigroup:YU,getTupleOrd:Sne,gt:ZU,leq:yne,lt:JU,max:vy,min:gy,ord:_ne,ordBoolean:Tne,ordDate:Ene,ordNumber:uv,ordString:Ine,reverse:gx,trivial:gne,tuple:QU},Symbol.toStringTag,{value:"Module"}));var eB=function(e){return{concat:function(t,n){return e.concat(n,t)}}},$ne=function(e){return function(t){return{concat:function(n,r){return e(n)?t.concat(n,r):r}}}},kne=function(e){return function(t){return{concat:function(n,r){return e(r)?t.concat(n,r):n}}}},One=function(e){return function(t){return{concat:function(n,r){return t.concat(e(n),e(r))}}}},tB=function(e){return function(t){return function(n){return n.reduce(function(r,i){return e.concat(r,i)},t)}}};const Mne=Object.freeze(Object.defineProperty({__proto__:null,concatAll:tB,endo:One,filterFirst:$ne,filterSecond:kne,reverse:eB},Symbol.toStringTag,{value:"Module"}));var yy=function(e){return{concat:gy(e)}},by=function(e){return{concat:vy(e)}},bx=function(e){return{concat:function(){return e}}},Cx=eB,Sx=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}}},wx=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])})}}},nB=function(e){return function(t){return{concat:function(n,r){return t.concat(n,t.concat(e,r))}}}},_x=function(){return{concat:Q}},Cy=function(){return{concat:function(e,t){return t}}},xx=tB,rB=bx(void 0),Fne=function(){return{concat:function(e,t){return Object.assign({},e,t)}}},jne=Cy,Lne=_x,Dne=wx,Une=Sx,Bne=Cx,Pne=by,Wne=yy,Nne=nB;function Kne(e){var t=xx(e);return function(n,r){return r===void 0?t(n):t(n)(r)}}var iB={concat:function(e,t){return e&&t}},oB={concat:function(e,t){return e||t}},qne=dx,aB={concat:function(e,t){return e+t}},sB={concat:function(e,t){return e+t}},lB={concat:function(e,t){return e*t}};const uB=Object.freeze(Object.defineProperty({__proto__:null,concatAll:xx,constant:bx,first:_x,fold:Kne,getDualSemigroup:Bne,getFirstSemigroup:Lne,getFunctionSemigroup:qne,getIntercalateSemigroup:Nne,getJoinSemigroup:Pne,getLastSemigroup:jne,getMeetSemigroup:Wne,getObjectSemigroup:Fne,getStructSemigroup:Une,getTupleSemigroup:Dne,intercalate:nB,last:Cy,max:by,min:yy,reverse:Cx,semigroupAll:iB,semigroupAny:oB,semigroupProduct:lB,semigroupString:aB,semigroupSum:sB,semigroupVoid:rB,struct:Sx,tuple:wx},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=Ln,No=Tt,Sy=function(e,t){return e<0||e>=t.length},Tx=function(e){return function(t){return rh([e],t,!0)}},fd=Tx,Ix=function(e){return function(t){return rh(rh([],t,!0),[e],!1)}},wy=Ix,_y=function(e,t,n){if(No(n)){var r=Ay(n);return r.splice(e,0,t),r}return[t]},Ex=function(e,t,n){if(n[e]===t)return n;var r=Ay(n);return r[e]=t,r},Rx=function(e){return function(t){if(t.length===1)return t;for(var n=[yr(t)],r=Gi(t),i=function(l){n.every(function(u){return!e.equals(u,l)})&&n.push(l)},o=0,a=r;o<a.length;o++){var s=a[o];i(s)}return n}},cB=function(e){if(No(e)){var t=vx();return Mx(e.reduce(t.concat,t.empty))}return Q},$x=function(e){var t=Rx(e);return function(n){return function(r){return t(x(r,Zh(n)))}}},kx=function(e){return function(t){var n=t.length,r=Math.round(e)%n;if(Sy(Math.abs(r),t)||r===0)return t;if(r<0){var i=Iy(-r)(t),o=i[0],a=i[1];return x(a,Zh(o))}else return kx(r-n)(t)}},Ox=function(e){return No(e)?ye(e):Re},xy=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}},Vne=function(e){return xy(function(){return e})},dB=function(e,t){return e<=t?xy(function(n){return e+n})(t-e+1):[e]},fB=function(e){return[yr(e),Gi(e)]},pB=function(e){return[zd(e),Zs(e)]},zne=function(e){return Ox(e.slice())};function hB(e){return function(t){return t.concat(e)}}function Zh(e,t){return t?e.concat(t):function(n){return n.concat(e)}}var Qne=function(e){return e.length===1?e:rh([Zs(e)],e.slice(0,-1).reverse(),!0)};function AB(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 Hne=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}},Mx=function(e){return function(t){return t.length===1?t:t.slice().sort(e.compare)}},Yne=function(e,t){return mB(e,function(){return t})},mB=function(e,t){return function(n){return Sy(e,n)?Re:ye(Ex(e,t(n[e]),n))}},gB=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 vB(e,t){return t===void 0?function(n){return vB(n,e)}:gB(e,t,function(n,r){return[n,r]})}var Gne=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]},Ty=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},Fx=function(e){return function(t){var n=Gi(t);return No(n)?x(n,Ty(e),fd(yr(t))):t}},yB=function(e){return function(t){for(var n=Ay(e(0,yr(t))),r=1;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},jx=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),l=s[0],u=s[1];o.push(l),a=u}return o}},Iy=function(e){return function(t){var n=Math.max(1,e);return n>=t.length?[t,Jh]:[x(t.slice(1,n),fd(yr(t))),t.slice(n)]}},bB=function(e){return jx(Iy(e))},eo=function(e,t){return x(e,Kx(t))},Lx=function(e,t){return x(e,qx(t))},Xh=function(e,t){return x(e,TB(t))},Dx=function(e,t){return x(e,Ey(t))},CB=function(e,t){return x(e,Nx(t))},eA=function(e,t,n){return x(e,Vx(t,n))},tA=function(e){var t=zx(e);return function(n,r){return x(n,t(r))}},nA=function(e,t,n){return x(e,Qx(t,n))},Ux=function(e){var t=IB(e);return function(n,r){return x(n,t(r))}},SB=function(e,t){return x(e,xB(t))},Bx=function(e,t,n){return x(e,Ry(t,n))},Px=function(e){var t=Hx(e);return function(n,r){return x(n,t(r))}},Wx=function(e,t,n){return x(e,$y(t,n))},wB=function(e){var t=Oy(e);return function(n,r){return x(n,t(r))}},Js=Gh,_B=function(e){return function(t){return x(t,hB(e()))}},xB=_B,TB=function(e){return Ey(function(t){return x(e,Kx(t))})},Ey=function(e){return yB(function(t,n){return e(n)})},Nx=function(e){return function(t){for(var n=Gi(t),r=[e(t)];No(n);)r.push(e(n)),n=Gi(n);return r}},Jne=Nx(Q),Zne=Ey(Q),Kx=function(e){return qx(function(t,n){return e(n)})},qx=function(e){return function(t){for(var n=[e(0,yr(t))],r=1;r<t.length;r++)n.push(e(r,t[r]));return n}},Vx=function(e,t){return Ry(e,function(n,r,i){return t(r,i)})},zx=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]))}}},Qx=function(e,t){return $y(e,function(n,r,i){return t(r,i)})},Ry=function(e,t){return function(n){return n.reduce(function(r,i,o){return t(o,r,i)},e)}},Hx=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]))}}},$y=function(e,t){return function(n){return n.reduceRight(function(r,i,o){return t(o,i,r)},e)}},IB=function(e){var t=Oy(e);return function(n){return t(function(r,i){return n(i)})}},ky=function(e){return Oy(e)(Ur)},Oy=function(e){return function(t){return function(n){for(var r=e.map(t(0,yr(n)),Js),i=1;i<n.length;i++)r=e.ap(e.map(r,function(o){return function(a){return x(o,wy(a))}}),t(i,n[i]));return r}}},My=ci,vr="ReadonlyNonEmptyArray",EB=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},Xne=function(){return{concat:Zh}},RB=function(e){return ki(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},ere=function(e){var t=$x(e);return{concat:function(n,r){return t(r)(n)}}},Yx={URI:vr,map:eo},tre=He(Yx),nre={URI:vr,of:Js},rre={URI:vr,map:eo,mapWithIndex:Lx},Fy={URI:vr,map:eo,ap:Xh},ire=qt(Fy),ore=Vt(Fy),are={URI:vr,map:eo,ap:Xh,of:Js},Gx={URI:vr,map:eo,ap:Xh,chain:Dx},sre=vt(Gx),lre={URI:vr,map:eo,ap:Xh,of:Js,chain:Dx},ure={URI:vr,reduce:eA,foldMap:tA,reduceRight:nA},cre={URI:vr,reduce:eA,foldMap:tA,reduceRight:nA,reduceWithIndex:Bx,foldMapWithIndex:Px,reduceRightWithIndex:Wx},dre={URI:vr,map:eo,reduce:eA,foldMap:tA,reduceRight:nA,traverse:Ux,sequence:ky},fre={URI:vr,map:eo,mapWithIndex:Lx,reduce:eA,foldMap:tA,reduceRight:nA,traverse:Ux,sequence:ky,reduceWithIndex:Bx,foldMapWithIndex:Px,reduceRightWithIndex:Wx,traverseWithIndex:wB},pre={URI:vr,map:eo,alt:SB},hre={URI:vr,map:eo,extend:CB,extract:My},Are=Js(gn),mre=Qt(Yx),gre=Ht(Gx),vre=zt(Fy),yr=My,Gi=Nd,Zs=function(e){return e[e.length-1]},zd=function(e){return e.slice(0,-1)},$B=function(e){var t=yy(e);return function(n){return n.reduce(t.concat)}},kB=function(e){var t=by(e);return function(n){return n.reduce(t.concat)}},jy=function(e){return function(t){return t.reduce(e.concat)}},yre=function(e){return function(t){return e(yr(t),Gi(t))}},bre=function(e){return function(t){return e(zd(t),Zs(t))}},OB=function(e){return function(t){return rh([e(yr(t))],Gi(t),!0)}},Cre=function(e){return OB(function(){return e})},MB=function(e){return function(t){return x(zd(t),wy(e(Zs(t))))}},Sre=function(e){return MB(function(){return e})},Jx=function(e){var t=jy(e);return function(n){return X(Fx(n),t)}};function wre(e){var t=Mx(e),n=AB(e);return function(r){return No(r)?n(t(r)):Jh}}function _re(e){return FB(function(t,n){return e(n)})}var FB=function(e){return function(t){return Ox(t.filter(function(n,r){return e(r,n)}))}},xre=fB,Tre=pB;function jB(e,t){return t===void 0?fd(e):x(t,fd(e))}var LB=function(e,t){return x(e,Zh([t]))},Ire=function(e,t){return function(n){return e<0||e>n.length?Re:ye(_y(e,t,n))}},Ere=Ty,Rre=jy,$re={URI:vr,of:Js,map:eo,mapWithIndex:Lx,ap:Xh,chain:Dx,extend:CB,extract:My,reduce:eA,foldMap:tA,reduceRight:nA,traverse:Ux,sequence:ky,reduceWithIndex:Bx,foldMapWithIndex:Px,reduceRightWithIndex:Wx,traverseWithIndex:wB,alt:SB};const kre=Object.freeze(Object.defineProperty({__proto__:null,Alt:pre,Applicative:are,Apply:Fy,Chain:Gx,Comonad:hre,Do:Are,Foldable:ure,FoldableWithIndex:cre,Functor:Yx,FunctorWithIndex:rre,Monad:lre,Pointed:nre,Traversable:dre,TraversableWithIndex:fre,URI:vr,alt:xB,altW:_B,ap:TB,apFirst:ire,apS:vre,apSecond:ore,append:wy,appendW:Ix,bind:gre,bindTo:mre,chain:Ey,chainFirst:sre,chainWithIndex:yB,chop:jx,chunksOf:bB,concat:Zh,concatAll:jy,concatW:hB,cons:jB,duplicate:Jne,empty:Jh,extend:Nx,extract:My,filter:_re,filterWithIndex:FB,flap:tre,flatten:Zne,fold:Rre,foldMap:zx,foldMapWithIndex:Hx,fromArray:zne,fromReadonlyArray:Ox,getEq:RB,getSemigroup:Xne,getShow:EB,getUnionSemigroup:ere,group:AB,groupBy:Hne,groupSort:wre,head:yr,init:zd,insertAt:Ire,intercalate:Jx,intersperse:Fx,isNonEmpty:No,isOutOfBound:Sy,last:Zs,makeBy:xy,map:Kx,mapWithIndex:qx,matchLeft:yre,matchRight:bre,max:kB,min:$B,modifyAt:mB,modifyHead:OB,modifyLast:MB,of:Js,prepend:fd,prependAll:Ty,prependToAll:Ere,prependW:Tx,range:dB,readonlyNonEmptyArray:$re,reduce:Vx,reduceRight:Qx,reduceRightWithIndex:$y,reduceWithIndex:Ry,replicate:Vne,reverse:Qne,rotate:kx,sequence:ky,snoc:LB,sort:Mx,sortBy:cB,splitAt:Iy,tail:Gi,traverse:IB,traverseWithIndex:Oy,unappend:pB,uncons:xre,union:$x,uniq:Rx,unprepend:fB,unsafeInsertAt:_y,unsafeUpdateAt:Ex,unsnoc:Tre,unzip:Gne,updateAt:Yne,updateHead:Cre,updateLast:Sre,zip:vB,zipWith:gB},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},Ly=function(e,t){return e<0||e>=t.length},Zx=function(e){return function(t){return ih([e],t,!0)}},pd=Zx,Xx=function(e){return function(t){return ih(ih([],t,!0),[e],!1)}},rA=Xx,eT=function(e,t,n){if(Oa(n)){var r=iA(n);return r.splice(e,0,t),r}return[t]},tT=function(e,t,n){var r=iA(n);return r[e]=t,r},nT=function(e){return function(t){if(t.length===1)return Qd(t);for(var n=[Oi(t)],r=Ji(t),i=function(l){n.every(function(u){return!e.equals(u,l)})&&n.push(l)},o=0,a=r;o<a.length;o++){var s=a[o];i(s)}return n}},DB=function(e){if(Oa(e)){var t=vx();return aT(e.reduce(t.concat,t.empty))}return Qd},rT=function(e){var t=nT(e);return function(n){return function(r){return t(x(r,Uy(n)))}}},iT=function(e){return function(t){var n=t.length,r=Math.round(e)%n;if(Ly(Math.abs(r),t)||r===0)return Qd(t);if(r<0){var i=Py(-r)(t),o=i[0],a=i[1];return x(a,Uy(o))}else return iT(r-n)(t)}},iA=Ay,oT=function(e){return Oa(e)?ye(e):Re},Dy=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}},Ore=function(e){return Dy(function(){return e})},UB=function(e,t){return e<=t?Dy(function(n){return e+n})(t-e+1):[e]},BB=function(e){return[Oi(e),Ji(e)]},PB=function(e){return[Yd(e),Hd(e)]};function WB(e){return function(t){return t.concat(e)}}function Uy(e,t){return t?e.concat(t):function(n){return n.concat(e)}}var Mre=function(e){return ih([Hd(e)],e.slice(0,-1).reverse(),!0)};function NB(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 Fre=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}},aT=function(e){return function(t){return t.slice().sort(e.compare)}},jre=function(e,t){return function(n){return e<0||e>n.length?Re:ye(eT(e,t,n))}},Lre=function(e,t){return KB(e,function(){return t})},KB=function(e,t){return function(n){return Ly(e,n)?Re:ye(tT(e,t(n[e]),n))}},Qd=iA,Xs=function(e){return[e]},qB=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 VB(e,t){return t===void 0?function(n){return VB(n,e)}:qB(e,t,function(n,r){return[n,r]})}var Dre=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]},By=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},zB=function(e){return function(t){var n=Ji(t);return Oa(n)?x(n,By(e),pd(Oi(t))):Qd(t)}},QB=Hx,HB=zx,YB=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}},sT=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),l=s[0],u=s[1];o.push(l),a=u}return o}},Py=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)]}},GB=function(e){return sT(Py(e))},to=function(e,t){return x(e,AT(t))},lT=function(e,t){return x(e,mT(t))},oA=function(e,t){return x(e,nP(t))},uT=function(e,t){return x(e,Wy(t))},JB=function(e,t){return x(e,hT(t))},aA=function(e,t,n){return x(e,rP(t,n))},sA=function(e){var t=HB(e);return function(n,r){return x(n,t(r))}},lA=function(e,t,n){return x(e,oP(t,n))},cT=function(e){var t=sP(e);return function(n,r){return x(n,t(r))}},ZB=function(e,t){return x(e,tP(t))},dT=function(e,t,n){return x(e,iP(t,n))},fT=function(e){var t=QB(e);return function(n,r){return x(n,t(r))}},pT=function(e,t,n){return x(e,aP(t,n))},XB=function(e){var t=Ky(e);return function(n,r){return x(n,t(r))}},eP=function(e){return function(t){return x(t,WB(e()))}},tP=eP,nP=function(e){return Wy(function(t){return x(e,AT(t))})},Wy=function(e){return YB(function(t,n){return e(n)})},hT=function(e){return function(t){for(var n=Ji(t),r=[e(t)];Oa(n);)r.push(e(n)),n=Ji(n);return r}},Ure=hT(Q),Bre=Wy(Q),AT=function(e){return mT(function(t,n){return e(n)})},mT=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}},rP=Vx,iP=Ry,oP=Qx,aP=$y,sP=function(e){var t=Ky(e);return function(n){return t(function(r,i){return n(i)})}},Ny=function(e){return Ky(e)(function(t,n){return n})},Ky=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}}},gT=yr,br="NonEmptyArray",Pre=EB,Wre=function(){return{concat:Uy}},Nre=RB,Kre=function(e){var t=rT(e);return{concat:function(n,r){return t(r)(n)}}},vT={URI:br,map:to},qre=He(vT),Vre={URI:br,of:Xs},zre={URI:br,map:to,mapWithIndex:lT},qy={URI:br,map:to,ap:oA},Qre=qt(qy),Hre=Vt(qy),Yre={URI:br,map:to,ap:oA,of:Xs},yT={URI:br,map:to,ap:oA,chain:uT},Gre=vt(yT),Jre={URI:br,map:to,ap:oA,of:Xs,chain:uT},Zre={URI:br,reduce:aA,foldMap:sA,reduceRight:lA},Xre={URI:br,reduce:aA,foldMap:sA,reduceRight:lA,reduceWithIndex:dT,foldMapWithIndex:fT,reduceRightWithIndex:pT},eie={URI:br,map:to,reduce:aA,foldMap:sA,reduceRight:lA,traverse:cT,sequence:Ny},tie={URI:br,map:to,mapWithIndex:lT,reduce:aA,foldMap:sA,reduceRight:lA,traverse:cT,sequence:Ny,reduceWithIndex:dT,foldMapWithIndex:fT,reduceRightWithIndex:pT,traverseWithIndex:XB},nie={URI:br,map:to,alt:ZB},rie={URI:br,map:to,extend:JB,extract:gT},iie=Xs(gn),oie=Qt(vT),aie=Ht(yT),sie=zt(qy),Oi=yr,Ji=function(e){return e.slice(1)},Hd=Zs,Yd=function(e){return e.slice(0,-1)},lie=$B,uie=kB,cie=function(e){return function(t){return t.reduce(e.concat)}},die=function(e){return function(t){return e(Oi(t),Ji(t))}},fie=function(e){return function(t){return e(Yd(t),Hd(t))}},lP=function(e){return function(t){return ih([e(Oi(t))],Ji(t),!0)}},pie=function(e){return lP(function(){return e})},uP=function(e){return function(t){return x(Yd(t),rA(e(Hd(t))))}},hie=function(e){return uP(function(){return e})},Aie=Jx;function mie(e){var t=aT(e),n=NB(e);return function(r){return Oa(r)?n(t(r)):[]}}function gie(e){return cP(function(t,n){return e(n)})}var cP=function(e){return function(t){return oT(t.filter(function(n,r){return e(r,n)}))}},vie=BB,yie=PB;function dP(e,t){return t===void 0?pd(e):x(t,pd(e))}var fP=function(e,t){return x(e,rA(t))},bie=By,Cie=jy,Sie={URI:br,of:Xs,map:to,mapWithIndex:lT,ap:oA,chain:uT,extend:JB,extract:gT,reduce:aA,foldMap:sA,reduceRight:lA,traverse:cT,sequence:Ny,reduceWithIndex:dT,foldMapWithIndex:fT,reduceRightWithIndex:pT,traverseWithIndex:XB,alt:ZB};const wie=Object.freeze(Object.defineProperty({__proto__:null,Alt:nie,Applicative:Yre,Apply:qy,Chain:yT,Comonad:rie,Do:iie,Foldable:Zre,FoldableWithIndex:Xre,Functor:vT,FunctorWithIndex:zre,Monad:Jre,Pointed:Vre,Traversable:eie,TraversableWithIndex:tie,URI:br,alt:tP,altW:eP,ap:nP,apFirst:Qre,apS:sie,apSecond:Hre,append:rA,appendW:Xx,bind:aie,bindTo:oie,chain:Wy,chainFirst:Gre,chainWithIndex:YB,chop:sT,chunksOf:GB,concat:Uy,concatAll:cie,concatW:WB,cons:dP,copy:Qd,duplicate:Ure,extend:hT,extract:gT,filter:gie,filterWithIndex:cP,flap:qre,flatten:Bre,fold:Cie,foldMap:HB,foldMapWithIndex:QB,fromArray:oT,fromReadonlyNonEmptyArray:iA,getEq:Nre,getSemigroup:Wre,getShow:Pre,getUnionSemigroup:Kre,group:NB,groupBy:Fre,groupSort:mie,head:Oi,init:Yd,insertAt:jre,intercalate:Aie,intersperse:zB,isNonEmpty:Oa,isOutOfBound:Ly,last:Hd,makeBy:Dy,map:AT,mapWithIndex:mT,matchLeft:die,matchRight:fie,max:uie,min:lie,modifyAt:KB,modifyHead:lP,modifyLast:uP,nonEmptyArray:Sie,of:Xs,prepend:pd,prependAll:By,prependToAll:bie,prependW:Zx,range:UB,reduce:rP,reduceRight:oP,reduceRightWithIndex:aP,reduceWithIndex:iP,replicate:Ore,reverse:Mre,rotate:iT,sequence:Ny,snoc:fP,sort:aT,sortBy:DB,splitAt:Py,tail:Ji,traverse:sP,traverseWithIndex:Ky,unappend:PB,uncons:vie,union:rT,uniq:nT,unprepend:BB,unsafeInsertAt:eT,unsafeUpdateAt:tT,unsnoc:yie,unzip:Dre,updateAt:Lre,updateHead:pie,updateLast:hie,zip:VB,zipWith:qB},Symbol.toStringTag,{value:"Module"}));var _ie=function(e){return typeof e=="number"},bT={equals:function(e,t){return e===t}},Vy={equals:bT.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},xie={equals:bT.equals,compare:Vy.compare,top:1/0,bottom:-1/0},Tie={show:function(e){return JSON.stringify(e)}},pP={concat:function(e,t){return e-t}},CT={concat:function(e,t){return e+t}},ST={concat:function(e,t){return e*t}},Iie={concat:CT.concat,empty:0},Eie={concat:ST.concat,empty:1},Rie={add:CT.concat,zero:0,mul:ST.concat,one:1,sub:pP.concat,degree:function(e){return 1},div:function(e,t){return e/t},mod:function(e,t){return e%t}};const $ie=Object.freeze(Object.defineProperty({__proto__:null,Bounded:xie,Eq:bT,Field:Rie,MagmaSub:pP,MonoidProduct:Eie,MonoidSum:Iie,Ord:Vy,SemigroupProduct:ST,SemigroupSum:CT,Show:Tie,isNumber:_ie},Symbol.toStringTag,{value:"Module"}));var Be=function(e,t){return{left:e,right:t}},kie=function(e,t){return x(e,hP(t))},Oie=function(e,t){return x(e,AP(t))},Mie=function(e,t,n){return x(e,mP(t,n))},hP=function(e){return function(t){return Be(zy(t),e(Qy(t)))}},AP=function(e){return function(t){return Be(e(zy(t)),Qy(t))}},mP=function(e,t){return function(n){return Be(e(zy(n)),t(Qy(n)))}},wT="Separated",Fie={URI:wT,mapLeft:Oie,bimap:Mie},gP={URI:wT,map:kie},jie=He(gP),zy=function(e){return e.left},Qy=function(e){return e.right};const Lie=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:Fie,Functor:gP,URI:wT,bimap:mP,flap:jie,left:zy,map:hP,mapLeft:AP,right:Qy,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 _T(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 Die=Object.freeze(Object.defineProperty({__proto__:null,filterE:_T,wiltDefault:no,witherDefault:ro},Symbol.toStringTag,{value:"Module"}));function Gd(e,t){return function(n){return n?t.of(void 0):e.zero()}}const Uie=Object.freeze(Object.defineProperty({__proto__:null,guard:Gd},Symbol.toStringTag,{value:"Module"}));var Bie=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},Kt=No,Pie=fd,Wie=Tx,Hy=wy,Nie=Ix,vP=function(e,t){return e<=0?Dt:xy(t)(e)},Kie=function(e,t){return vP(e,function(){return t})};function qie(e){return function(t){return e(t)?[t]:Dt}}var yP=function(e){return tn(e)?Dt:[e.value]},bP=function(e){return hn(e)?Dt:[e.right]},CP=function(e,t){return function(n){return Kt(n)?t(n):e()}},SP=CP,wP=function(e,t){return function(n){return Kt(n)?t(yr(n),Gi(n)):e()}},_P=wP,Vie=_P,xP=function(e,t){return function(n){return Kt(n)?t(zd(n),Zs(n)):e()}},TP=xP,zie=TP,IP=function(e){return function(t){if(Oo(t))return Dt;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},Qie=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}},Hie=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}},Yie=function(e){return e.length},Jd=Sy;function uu(e,t){return t===void 0?function(n){return uu(e,n)}:Jd(e,t)?Re:ye(t[e])}var EP=function(e){return Kt(e)?ye(yr(e)):Re},RP=function(e){return Kt(e)?ye(Zs(e)):Re},Gie=function(e){return Kt(e)?ye(Gi(e)):Re},Jie=function(e){return Kt(e)?ye(zd(e)):Re},Zie=function(e){return function(t){return Jd(e,t)?t:e===0?Dt:t.slice(0,e)}},Xie=function(e){return function(t){return Jd(e,t)?t:e===0?Dt:t.slice(-e)}};function eoe(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?Dt:n}}var $P=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r};function toe(e){return function(t){var n=BP($P(t,e))(t),r=n[0],i=n[1];return{init:r,rest:i}}}var noe=function(e){return function(t){return e<=0||Oo(t)?t:e>=t.length?Dt:t.slice(e,t.length)}},roe=function(e){return function(t){return e<=0||Oo(t)?t:e>=t.length?Dt:t.slice(0,t.length-e)}};function ioe(e){return function(t){var n=$P(t,e);return n===0?t:n===t.length?Dt:t.slice(n)}}var Yy=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return ye(n);return Re}};function Gy(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return ye(t[n]);return Re}}var kP=function(e){return function(t){for(var n=0;n<t.length;n++){var r=e(t[n]);if(Ft(r))return r}return Re}};function OP(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return ye(t[n]);return Re}}var MP=function(e){return function(t){for(var n=t.length-1;n>=0;n--){var r=e(t[n]);if(Ft(r))return r}return Re}},FP=function(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return ye(n);return Re}},ooe=function(e,t){return function(n){return e<0||e>n.length?Re:ye(_y(e,t,n))}},aoe=function(e,t){return jP(e,function(){return t})},soe=function(e){return function(t){return Jd(e,t)?Re:ye(dW(e,t))}},jP=function(e,t){return function(n){return Jd(e,n)?Re:ye(a0(e,t(n[e]),n))}},loe=function(e){return e.length<=1?e:e.slice().reverse()},uoe=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Right"&&t.push(r.right)}return t},coe=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Left"&&t.push(r.left)}return t},doe=function(e){return function(t){return t.length<=1?t:t.slice().sort(e.compare)}},LP=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 DP(e,t){return t===void 0?function(n){return DP(n,e)}:LP(e,t,function(n,r){return[n,r]})}var foe=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]},UP=function(e){var t=Ty(e);return function(n){return Kt(n)?t(n):n}},poe=function(e){var t=Fx(e);return function(n){return Kt(n)?t(n):n}},hoe=function(e){var t=kx(e);return function(n){return Kt(n)?t(n):n}};function uA(e){return function(t,n){if(n===void 0){var r=uA(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 Aoe=function(e){var t=Rx(e);return function(n){return Kt(n)?t(n):n}},moe=function(e){var t=cB(e);return function(n){return Kt(n)?t(n):n}},goe=function(e){var t=jx(e);return function(n){return Kt(n)?t(n):Dt}},BP=function(e){return function(t){return e>=1&&Kt(t)?Iy(e)(t):Oo(t)?[t,Dt]:[Dt,t]}},voe=function(e){var t=bB(e);return function(n){return Kt(n)?t(n):Dt}},yoe=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return yP(e.apply(void 0,t))}};function boe(e,t,n){n===void 0&&(n=function(){return!0});var r=function(i,o){return Kt(o)?x(yr(o),dA(function(a){return r(x(i,Hy(a)),Gi(o))})):n.apply(void 0,i)?[t.apply(void 0,i)]:Dt};return r(Dt,e)}var PP=function(e){return function(t){return Oo(t)?e:Oo(e)?t:t.concat(e)}},Coe=PP;function xT(e){var t=$x(e);return function(n,r){if(r===void 0){var i=xT(e);return function(o){return i(o,n)}}return Kt(n)&&Kt(r)?t(r)(n):Kt(n)?n:r}}function TT(e){var t=uA(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)})}}function IT(e){var t=uA(e);return function(n,r){if(r===void 0){var i=IT(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,FT(t))},Jy=function(e,t){return x(e,GP(t))},el=function(e,t){return x(e,YP(t))},cA=function(e,t){return x(e,dA(t))},Zy=function(e,t){return x(e,JP(t))},Xy=function(e,t){return x(e,LT(t))},e0=function(e,t){return x(e,ZP(t))},t0=function(e,t){return x(e,XP(t))},WP=function(e,t){return x(e,DT(t))},NP=function(e,t){return x(e,UT(t))},ET=function(e,t){return x(e,HP(t))},ju=function(e,t,n){return x(e,PT(t,n))},Zd=function(e){var t=WT(e);return function(n,r){return x(n,t(r))}},Xd=function(e,t,n){return x(e,NT(t,n))},RT=function(e,t,n){return x(e,fA(t,n))},$T=function(e){var t=r0(e);return function(n,r){return x(n,t(r))}},kT=function(e,t,n){return x(e,i0(t,n))},KP=function(e,t){return x(e,jT(t))},qP=function(e,t){return x(e,eW(t))},VP=function(e,t){return x(e,BT(t))},n0=function(e){var t=tW(e);return function(n,r){return x(n,t(r))}},zP=function(e){var t=KT(e);return function(n,r){return x(n,t(r))}},OT=function(e,t){return x(e,YT(t))},MT=function(e,t){return x(e,GT(t))},Lu=Js,ef=function(){return Dt},QP=function(e){return function(t){return t.concat(e())}},HP=QP,YP=function(e){return dA(function(t){return x(e,FT(t))})},dA=function(e){return function(t){return x(t,IP(function(n,r){return e(r)}))}},Soe=dA(Q),FT=function(e){return function(t){return t.map(function(n){return e(n)})}},GP=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)},JP=function(e){return function(t){return t.filter(e)}},jT=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);Ft(i)&&n.push(i.value)}return n}},LT=function(e){return jT(function(t,n){return e(n)})},nf=LT(Q),ZP=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=t[i];e(i,o)?r.push(o):n.push(o)}return Be(n,r)}},XP=function(e){return UT(function(t,n){return e(n)})},UT=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)}},eW=function(e){return function(t){return t.filter(function(n,r){return e(r,n)})}},BT=function(e){return function(t){return t.map(function(n,r){return e(t.slice(r))})}},woe=BT(Q),r0=function(e){return function(t){return function(n){return n.reduce(function(r,i,o){return e.concat(r,t(o,i))},e.empty)}}},PT=function(e,t){return fA(e,function(n,r,i){return t(r,i)})},WT=function(e){var t=r0(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}},NT=function(e,t){return i0(e,function(n,r,i){return t(r,i)})},i0=function(e,t){return function(n){return n.reduceRight(function(r,i,o){return t(o,i,r)},e)}},tW=function(e){var t=KT(e);return function(n){return t(function(r,i){return n(i)})}},pA=function(e){return function(t){return ju(t,e.of(ef()),function(n,r){return e.ap(e.map(n,function(i){return function(o){return x(i,Hy(o))}}),r)})}},KT=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,Hy(a))}}),t(n,i))})}},_oe=function(e){var t=JT(e);return function(n){return function(r){return t(r,n)}}},xoe=function(e){var t=ZT(e);return function(n){return function(r){return t(r,n)}}},qT=function(e,t){for(var n=[],r=e;;){var i=t(r);if(Ft(i)){var o=i.value,a=o[0],s=o[1];n.push(a),r=s}else break}return n},yt="ReadonlyArray",nW=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},rW=function(){return{concat:function(e,t){return Oo(e)?t:Oo(t)?e:e.concat(t)}}},Toe=function(){return{concat:rW().concat,empty:Dt}},iW=function(e){return ki(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},oW=function(e){return Fu(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 Vy.compare(r,i)})},aW=function(e){var t=xT(e);return{concat:function(n,r){return t(r)(n)}}},Ioe=function(e){return{concat:aW(e).concat,empty:Dt}},Eoe=function(e){var t=TT(e);return{concat:function(n,r){return t(r)(n)}}},Roe=function(e){var t=IT(e);return{concat:function(n,r){return t(r)(n)}}},VT={URI:yt,map:Dn},$oe=He(VT),sW={URI:yt,of:Lu},koe={URI:yt,map:Dn,mapWithIndex:Jy},o0={URI:yt,map:Dn,ap:el},Ooe=qt(o0),Moe=Vt(o0),Foe={URI:yt,map:Dn,ap:el,of:Lu},zT={URI:yt,map:Dn,ap:el,chain:cA},joe={URI:yt,map:Dn,ap:el,of:Lu,chain:cA},Loe=vt(zT),Doe={URI:yt,unfold:qT},Uoe={URI:yt,map:Dn,alt:ET},lW={URI:yt,zero:ef},Boe=Gd(lW,sW),Poe={URI:yt,map:Dn,ap:el,of:Lu,alt:ET,zero:ef},Woe={URI:yt,map:Dn,extend:VP},QT={URI:yt,compact:nf,separate:tf},Noe={URI:yt,map:Dn,compact:nf,separate:tf,filter:Zy,filterMap:Xy,partition:e0,partitionMap:t0},Koe={URI:yt,map:Dn,mapWithIndex:Jy,compact:nf,separate:tf,filter:Zy,filterMap:Xy,partition:e0,partitionMap:t0,partitionMapWithIndex:NP,partitionWithIndex:WP,filterMapWithIndex:KP,filterWithIndex:qP},qoe={URI:yt,reduce:ju,foldMap:Zd,reduceRight:Xd},Voe={URI:yt,reduce:ju,foldMap:Zd,reduceRight:Xd,reduceWithIndex:RT,foldMapWithIndex:$T,reduceRightWithIndex:kT},HT={URI:yt,map:Dn,reduce:ju,foldMap:Zd,reduceRight:Xd,traverse:n0,sequence:pA},zoe={URI:yt,map:Dn,mapWithIndex:Jy,reduce:ju,foldMap:Zd,reduceRight:Xd,reduceWithIndex:RT,foldMapWithIndex:$T,reduceRightWithIndex:kT,traverse:n0,sequence:pA,traverseWithIndex:zP},YT=function(e){return function(t){for(var n=Bie([],e(t),!0),r=[];n.length>0;){var i=n.shift();hn(i)?n.unshift.apply(n,e(i.left)):r.push(i.right)}return r}},Qoe={URI:yt,map:Dn,ap:el,chain:cA,chainRec:OT},GT=function(e){return function(t){var n=e(t),r=[],i=[];function o(u){hn(u)?e(u.left).forEach(function(c){return r.push(c)}):i.push(u.right)}for(var a=0,s=n;a<s.length;a++){var l=s[a];o(l)}for(;r.length>0;)o(r.shift());return i}},Hoe={URI:yt,map:Dn,ap:el,chain:cA,chainRec:MT},JT=ro(HT,QT),ZT=no(HT,QT),uW={URI:yt,map:Dn,compact:nf,separate:tf,filter:Zy,filterMap:Xy,partition:e0,partitionMap:t0,reduce:ju,foldMap:Zd,reduceRight:Xd,traverse:n0,sequence:pA,wither:JT,wilt:ZT},Yoe=_T(uW),cW={URI:yt,fromEither:bP},Goe=di(cW),Joe=_y,a0=function(e,t,n){return Kt(n)?Ex(e,t,n):n},dW=function(e,t){var n=t.slice();return n.splice(e,1),n},Zoe=function(e){return e.slice()},Xoe=function(e){return Oo(e)?Dt:e.slice()},Dt=Jh;function fW(e){return function(t){return t.every(e)}}var pW=function(e){return function(t){return t.some(e)}},eae=pW,hW=function(e){var t=Jx(e);return function(n){return SP(function(){return e.empty},t(n))}},tae=Lu(gn),nae=Qt(VT),rae=Ht(zT),iae=zt(o0),oae=dB,aae=jB,sae=LB,lae=UP,uae={URI:yt,compact:nf,separate:tf,map:Dn,ap:el,of:Lu,chain:cA,filter:Zy,filterMap:Xy,partition:e0,partitionMap:t0,mapWithIndex:Jy,partitionMapWithIndex:NP,partitionWithIndex:WP,filterMapWithIndex:KP,filterWithIndex:qP,alt:ET,zero:ef,unfold:qT,reduce:ju,foldMap:Zd,reduceRight:Xd,traverse:n0,sequence:pA,reduceWithIndex:RT,foldMapWithIndex:$T,reduceRightWithIndex:kT,traverseWithIndex:zP,extend:VP,wither:JT,wilt:ZT};const cae=Object.freeze(Object.defineProperty({__proto__:null,Alt:Uoe,Alternative:Poe,Applicative:Foe,Apply:o0,Chain:zT,ChainRecBreadthFirst:Hoe,ChainRecDepthFirst:Qoe,Compactable:QT,Do:tae,Extend:Woe,Filterable:Noe,FilterableWithIndex:Koe,Foldable:qoe,FoldableWithIndex:Voe,FromEither:cW,Functor:VT,FunctorWithIndex:koe,Monad:joe,Pointed:sW,Traversable:HT,TraversableWithIndex:zoe,URI:yt,Unfoldable:Doe,Witherable:uW,Zero:lW,_chainRecBreadthFirst:MT,_chainRecDepthFirst:OT,alt:HP,altW:QP,ap:YP,apFirst:Ooe,apS:iae,apSecond:Moe,append:Hy,appendW:Nie,bind:rae,bindTo:nae,chain:dA,chainFirst:Loe,chainRecBreadthFirst:GT,chainRecDepthFirst:YT,chainWithIndex:IP,chop:goe,chunksOf:voe,compact:nf,comprehension:boe,concat:Coe,concatW:PP,cons:aae,deleteAt:soe,difference:IT,dropLeft:noe,dropLeftWhile:ioe,dropRight:roe,duplicate:woe,elem:uA,empty:Dt,every:fW,exists:eae,extend:BT,filter:JP,filterE:Yoe,filterMap:LT,filterMapWithIndex:jT,filterWithIndex:eW,findFirst:Gy,findFirstMap:kP,findIndex:Yy,findLast:OP,findLastIndex:FP,findLastMap:MP,flap:$oe,flatten:Soe,foldLeft:Vie,foldMap:WT,foldMapWithIndex:r0,foldRight:zie,fromArray:Xoe,fromEither:bP,fromEitherK:Goe,fromOption:yP,fromOptionK:yoe,fromPredicate:qie,getDifferenceMagma:Roe,getEq:iW,getIntersectionSemigroup:Eoe,getMonoid:Toe,getOrd:oW,getSemigroup:rW,getShow:nW,getUnionMonoid:Ioe,getUnionSemigroup:aW,guard:Boe,head:EP,init:Jie,insertAt:ooe,intercalate:hW,intersection:TT,intersperse:poe,isEmpty:Oo,isNonEmpty:Kt,isOutOfBound:Jd,last:RP,lefts:coe,lookup:uu,makeBy:vP,map:FT,mapWithIndex:GP,match:SP,matchLeft:_P,matchLeftW:wP,matchRight:TP,matchRightW:xP,matchW:CP,modifyAt:jP,of:Lu,partition:ZP,partitionMap:XP,partitionMapWithIndex:UT,partitionWithIndex:DT,prepend:Pie,prependAll:UP,prependToAll:lae,prependW:Wie,range:oae,readonlyArray:uae,reduce:PT,reduceRight:NT,reduceRightWithIndex:i0,reduceWithIndex:fA,replicate:Kie,reverse:loe,rights:uoe,rotate:hoe,scanLeft:Qie,scanRight:Hie,separate:tf,sequence:pA,size:Yie,snoc:sae,some:pW,sort:doe,sortBy:moe,spanLeft:toe,splitAt:BP,tail:Gie,takeLeft:Zie,takeLeftWhile:eoe,takeRight:Xie,toArray:Zoe,traverse:tW,traverseWithIndex:KT,unfold:qT,union:xT,uniq:Aoe,unsafeDeleteAt:dW,unsafeInsertAt:Joe,unsafeUpdateAt:a0,unzip:foe,updateAt:aoe,wilt:xoe,wither:_oe,zero:ef,zip:DP,zipWith:LP},Symbol.toStringTag,{value:"Module"}));var Ds=function(e){return e.length===0},nn=Oa,dae=pd,fae=Zx,s0=rA,pae=Xx,AW=function(e,t){return e<=0?[]:Dy(t)(e)},hae=function(e,t){return AW(e,function(){return t})};function Aae(e){return function(t){return e(t)?[t]:[]}}var mW=function(e){return tn(e)?[]:[e.value]},gW=function(e){return hn(e)?[]:[e.right]},vW=function(e,t){return function(n){return nn(n)?t(n):e()}},mae=vW,yW=function(e,t){return function(n){return nn(n)?t(Oi(n),Ji(n)):e()}},bW=yW,gae=bW,CW=function(e,t){return function(n){return nn(n)?t(Yd(n),Hd(n)):e()}},SW=CW,vae=SW,wW=function(e){return function(t){for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},yae=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}},bae=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}},Cae=function(e){return e.length},hA=Ly,Sae=uu,wae=EP,_ae=RP,xae=function(e){return nn(e)?ye(Ji(e)):Re},Tae=function(e){return nn(e)?ye(Yd(e)):Re},Iae=function(e){return function(t){return hA(e,t)?Jn(t):t.slice(0,e)}},Eae=function(e){return function(t){return hA(e,t)?Jn(t):e===0?[]:t.slice(-e)}};function Rae(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 _W=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r};function $ae(e){return function(t){var n=RW(_W(t,e))(t),r=n[0],i=n[1];return{init:r,rest:i}}}var kae=function(e){return function(t){return e<=0||Ds(t)?Jn(t):e>=t.length?[]:t.slice(e,t.length)}},Oae=function(e){return function(t){return e<=0||Ds(t)?Jn(t):e>=t.length?[]:t.slice(0,t.length-e)}};function Mae(e){return function(t){return t.slice(_W(t,e))}}var Fae=Yy;function jae(e){return Gy(e)}var Lae=kP;function Dae(e){return OP(e)}var Uae=MP,Bae=FP,Jn=function(e){return e.slice()},Pae=function(e,t){return function(n){return e<0||e>n.length?Re:ye(iN(e,t,n))}},Wae=function(e,t){return xW(e,function(){return t})},Nae=function(e){return function(t){return hA(e,t)?Re:ye(aN(e,t))}},xW=function(e,t){return function(n){return hA(e,n)?Re:ye(oN(e,t(n[e]),n))}},Kae=function(e){return Ds(e)?[]:e.slice().reverse()},qae=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Right"&&t.push(r.right)}return t},Vae=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Left"&&t.push(r.left)}return t},zae=function(e){return function(t){return t.length<=1?Jn(t):t.slice().sort(e.compare)}},TW=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 IW(e,t){return t===void 0?function(n){return IW(n,e)}:TW(e,t,function(n,r){return[n,r]})}var Qae=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]},EW=function(e){var t=By(e);return function(n){return nn(n)?t(n):[]}},Hae=function(e){var t=zB(e);return function(n){return nn(n)?t(n):Jn(n)}},Yae=function(e){var t=iT(e);return function(n){return nn(n)?t(n):Jn(n)}},XT=uA,Gae=function(e){var t=nT(e);return function(n){return nn(n)?t(n):Jn(n)}},Jae=function(e){var t=DB(e);return function(n){return nn(n)?t(n):Jn(n)}},Zae=function(e){var t=sT(e);return function(n){return nn(n)?t(n):[]}},RW=function(e){return function(t){return e>=1&&nn(t)?Py(e)(t):Ds(t)?[Jn(t),[]]:[[],Jn(t)]}},Xae=function(e){var t=GB(e);return function(n){return nn(n)?t(n):[]}},ese=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return mW(e.apply(void 0,t))}};function tse(e,t,n){n===void 0&&(n=function(){return!0});var r=function(i,o){return nn(o)?x(Oi(o),mA(function(a){return r(x(i,s0(a)),Ji(o))})):n.apply(void 0,i)?[t.apply(void 0,i)]:[]};return r([],e)}var $W=function(e){return function(t){return Ds(t)?Jn(e):Ds(e)?Jn(t):t.concat(e)}},nse=$W;function eI(e){var t=rT(e);return function(n,r){if(r===void 0){var i=eI(e);return function(o){return i(o,n)}}return nn(n)&&nn(r)?t(r)(n):nn(n)?Jn(n):Jn(r)}}function tI(e){var t=XT(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)})}}function nI(e){var t=XT(e);return function(n,r){if(r===void 0){var i=nI(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var Un=function(e,t){return x(e,sI(t))},l0=function(e,t){return x(e,UW(t))},tl=function(e,t){return x(e,DW(t))},AA=function(e,t){return x(e,mA(t))},u0=function(e,t){return x(e,BW(t))},c0=function(e,t){return x(e,uI(t))},d0=function(e,t){return x(e,PW(t))},f0=function(e,t){return x(e,WW(t))},kW=function(e,t){return x(e,cI(t))},OW=function(e,t){return x(e,dI(t))},rI=function(e,t){return x(e,KW(t))},Du=function(e,t,n){return x(e,QW(t,n))},rf=function(e){var t=VW(e);return function(n,r){return x(n,t(r))}},of=function(e,t,n){return x(e,HW(t,n))},iI=function(e,t,n){return x(e,pI(t,n))},oI=function(e){var t=zW(e);return function(n,r){return x(n,t(r))}},aI=function(e,t,n){return x(e,YW(t,n))},MW=function(e,t){return x(e,lI(t))},FW=function(e,t){return x(e,qW(t))},jW=function(e,t){return x(e,fI(t))},p0=function(e){var t=h0(e);return function(n,r){return x(n,t(r))}},LW=function(e){var t=hI(e);return function(n,r){return x(n,t(r))}},rse=OT,ise=MT,nl=Xs,af=function(){return[]},sI=function(e){return function(t){return t.map(function(n){return e(n)})}},DW=function(e){return mA(function(t){return x(e,sI(t))})},mA=function(e){return function(t){return x(t,wW(function(n,r){return e(r)}))}},ose=mA(Q),UW=function(e){return function(t){return t.map(function(n,r){return e(r,n)})}},lI=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);Ft(i)&&n.push(i.value)}return n}},uI=function(e){return lI(function(t,n){return e(n)})},sf=uI(Q),lf=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)},BW=function(e){return function(t){return t.filter(e)}},PW=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=t[i];e(i,o)?r.push(o):n.push(o)}return Be(n,r)}},WW=function(e){return dI(function(t,n){return e(n)})},dI=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)}},NW=function(e){return function(t){return t.concat(e())}},KW=NW,qW=function(e){return function(t){return t.filter(function(n,r){return e(r,n)})}},fI=function(e){return function(t){return t.map(function(n,r){return e(t.slice(r))})}},ase=fI(Q),VW=WT,zW=r0,QW=PT,pI=fA,HW=NT,YW=i0,h0=function(e){var t=hI(e);return function(n){return t(function(r,i){return n(i)})}},gA=function(e){return function(t){return Du(t,e.of(af()),function(n,r){return e.ap(e.map(n,function(i){return function(o){return x(i,s0(o))}}),r)})}},hI=function(e){return function(t){return pI(e.of(af()),function(n,r,i){return e.ap(e.map(r,function(o){return function(a){return x(o,s0(a))}}),t(n,i))})}},sse=function(e){var t=CI(e);return function(n){return function(r){return t(r,n)}}},lse=function(e){var t=SI(e);return function(n){return function(r){return t(r,n)}}},AI=function(e,t){for(var n=[],r=e;;){var i=t(r);if(Ft(i)){var o=i.value,a=o[0],s=o[1];n.push(a),r=s}else break}return n},bt="Array",use=nW,GW=function(){return{concat:function(e,t){return e.concat(t)}}},mI=function(){return{concat:GW().concat,empty:[]}},JW=iW,cse=oW,ZW=function(e){var t=eI(e);return{concat:function(n,r){return t(r)(n)}}},dse=function(e){return{concat:ZW(e).concat,empty:[]}},fse=function(e){var t=tI(e);return{concat:function(n,r){return t(r)(n)}}},pse=function(e){var t=nI(e);return{concat:function(n,r){return t(r)(n)}}},gI={URI:bt,map:Un},hse=He(gI),XW={URI:bt,of:nl},Ase={URI:bt,map:Un,mapWithIndex:l0},A0={URI:bt,map:Un,ap:tl},mse=qt(A0),gse=Vt(A0),vse={URI:bt,map:Un,ap:tl,of:nl},vI={URI:bt,map:Un,ap:tl,chain:AA},yse=vt(vI),bse={URI:bt,map:Un,ap:tl,of:nl,chain:AA},Cse={URI:bt,unfold:AI},Sse={URI:bt,map:Un,alt:rI},eN={URI:bt,zero:af},wse=Gd(eN,XW),_se={URI:bt,map:Un,ap:tl,of:nl,alt:rI,zero:af},xse={URI:bt,map:Un,extend:jW},yI={URI:bt,compact:sf,separate:lf},Tse={URI:bt,map:Un,compact:sf,separate:lf,filter:u0,filterMap:c0,partition:d0,partitionMap:f0},Ise={URI:bt,map:Un,mapWithIndex:l0,compact:sf,separate:lf,filter:u0,filterMap:c0,partition:d0,partitionMap:f0,partitionMapWithIndex:OW,partitionWithIndex:kW,filterMapWithIndex:MW,filterWithIndex:FW},tN={URI:bt,reduce:Du,foldMap:rf,reduceRight:of},Ese={URI:bt,reduce:Du,foldMap:rf,reduceRight:of,reduceWithIndex:iI,foldMapWithIndex:oI,reduceRightWithIndex:aI},bI={URI:bt,map:Un,reduce:Du,foldMap:rf,reduceRight:of,traverse:p0,sequence:gA},Rse={URI:bt,map:Un,mapWithIndex:l0,reduce:Du,foldMap:rf,reduceRight:of,reduceWithIndex:iI,foldMapWithIndex:oI,reduceRightWithIndex:aI,traverse:p0,sequence:gA,traverseWithIndex:LW},CI=ro(bI,yI),SI=no(bI,yI),nN={URI:bt,map:Un,compact:sf,separate:lf,filter:u0,filterMap:c0,partition:d0,partitionMap:f0,reduce:Du,foldMap:rf,reduceRight:of,traverse:p0,sequence:gA,wither:CI,wilt:SI},$se=YT,kse={URI:bt,map:Un,ap:tl,chain:AA,chainRec:rse},Ose=GT,Mse={URI:bt,map:Un,ap:tl,chain:AA,chainRec:ise},Fse=_T(nN),rN={URI:bt,fromEither:gW},jse=di(rN),iN=eT,oN=function(e,t,n){return nn(n)?tT(e,t,n):[]},aN=function(e,t){var n=t.slice();return n.splice(e,1),n},Lse=fW,sN=function(e){return function(t){return t.some(e)}},Dse=sN,Use=hW,Bse=nl(gn),Pse=Qt(gI),Wse=Ht(vI),Nse=zt(A0),Kse=UB,qse=[],Vse=dP,zse=fP,Qse=EW,Hse={URI:bt,compact:sf,separate:lf,map:Un,ap:tl,of:nl,chain:AA,filter:u0,filterMap:c0,partition:d0,partitionMap:f0,mapWithIndex:l0,partitionMapWithIndex:OW,partitionWithIndex:kW,filterMapWithIndex:MW,filterWithIndex:FW,alt:rI,zero:af,unfold:AI,reduce:Du,foldMap:rf,reduceRight:of,traverse:p0,sequence:gA,reduceWithIndex:iI,foldMapWithIndex:oI,reduceRightWithIndex:aI,traverseWithIndex:LW,extend:jW,wither:CI,wilt:SI};const Yse=Object.freeze(Object.defineProperty({__proto__:null,Alt:Sse,Alternative:_se,Applicative:vse,Apply:A0,Chain:vI,ChainRecBreadthFirst:Mse,ChainRecDepthFirst:kse,Compactable:yI,Do:Bse,Extend:xse,Filterable:Tse,FilterableWithIndex:Ise,Foldable:tN,FoldableWithIndex:Ese,FromEither:rN,Functor:gI,FunctorWithIndex:Ase,Monad:bse,Pointed:XW,Traversable:bI,TraversableWithIndex:Rse,URI:bt,Unfoldable:Cse,Witherable:nN,Zero:eN,alt:KW,altW:NW,ap:DW,apFirst:mse,apS:Nse,apSecond:gse,append:s0,appendW:pae,array:Hse,bind:Wse,bindTo:Pse,chain:mA,chainFirst:yse,chainRecBreadthFirst:Ose,chainRecDepthFirst:$se,chainWithIndex:wW,chop:Zae,chunksOf:Xae,compact:sf,comprehension:tse,concat:nse,concatW:$W,cons:Vse,copy:Jn,deleteAt:Nae,difference:nI,dropLeft:kae,dropLeftWhile:Mae,dropRight:Oae,duplicate:ase,elem:XT,empty:qse,every:Lse,exists:Dse,extend:fI,filter:BW,filterE:Fse,filterMap:uI,filterMapWithIndex:lI,filterWithIndex:qW,findFirst:jae,findFirstMap:Lae,findIndex:Fae,findLast:Dae,findLastIndex:Bae,findLastMap:Uae,flap:hse,flatten:ose,foldLeft:gae,foldMap:VW,foldMapWithIndex:zW,foldRight:vae,fromEither:gW,fromEitherK:jse,fromOption:mW,fromOptionK:ese,fromPredicate:Aae,getDifferenceMagma:pse,getEq:JW,getIntersectionSemigroup:fse,getMonoid:mI,getOrd:cse,getSemigroup:GW,getShow:use,getUnionMonoid:dse,getUnionSemigroup:ZW,guard:wse,head:wae,init:Tae,insertAt:Pae,intercalate:Use,intersection:tI,intersperse:Hae,isEmpty:Ds,isNonEmpty:nn,isOutOfBound:hA,last:_ae,lefts:Vae,lookup:Sae,makeBy:AW,map:sI,mapWithIndex:UW,match:mae,matchLeft:bW,matchLeftW:yW,matchRight:SW,matchRightW:CW,matchW:vW,modifyAt:xW,of:nl,partition:PW,partitionMap:WW,partitionMapWithIndex:dI,partitionWithIndex:cI,prepend:dae,prependAll:EW,prependToAll:Qse,prependW:fae,range:Kse,reduce:QW,reduceRight:HW,reduceRightWithIndex:YW,reduceWithIndex:pI,replicate:hae,reverse:Kae,rights:qae,rotate:Yae,scanLeft:yae,scanRight:bae,separate:lf,sequence:gA,size:Cae,snoc:zse,some:sN,sort:zae,sortBy:Jae,spanLeft:$ae,splitAt:RW,tail:xae,takeLeft:Iae,takeLeftWhile:Rae,takeRight:Eae,traverse:h0,traverseWithIndex:hI,unfold:AI,union:eI,uniq:Gae,unsafeDeleteAt:aN,unsafeInsertAt:iN,unsafeUpdateAt:oN,unzip:Qae,updateAt:Wae,wilt:lse,wither:sse,zero:af,zip:IW,zipWith:TW},Symbol.toStringTag,{value:"Module"})),Gse=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Jse=function(e){return typeof e=="boolean"},lN=function(e,t){return function(n){return n?t():e()}},uN=lN,cN=uN,Zse=cN,dN={equals:function(e,t){return e===t}},Xse={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}},fN={concat:function(e,t){return e&&t}},pN={concat:function(e,t){return e||t}},ele={concat:fN.concat,empty:!0},tle={concat:pN.concat,empty:!1},nle={equals:dN.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},rle={show:function(e){return JSON.stringify(e)}};const ile=Object.freeze(Object.defineProperty({__proto__:null,BooleanAlgebra:Xse,Eq:dN,MonoidAll:ele,MonoidAny:tle,Ord:nle,SemigroupAll:fN,SemigroupAny:pN,Show:rle,fold:Zse,foldW:uN,isBoolean:Jse,match:cN,matchW:lN},Symbol.toStringTag,{value:"Module"}));var hN=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}},ole={meet:function(){},join:function(){},zero:void 0,one:void 0,implies:function(){},not:function(){}},ale=hN,sle={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}},lle=kU;const ule=Object.freeze(Object.defineProperty({__proto__:null,booleanAlgebraBoolean:sle,booleanAlgebraVoid:ole,getDualBooleanAlgebra:ale,getFunctionBooleanAlgebra:lle,reverse:hN},Symbol.toStringTag,{value:"Module"}));var cle=function(e){return XU(e)(e.bottom,e.top)},dle=function(e){var t=gx(e);return{equals:t.equals,compare:t.compare,top:e.bottom,bottom:e.top}},fle={equals:uv.equals,compare:uv.compare,top:1/0,bottom:-1/0};const ple=Object.freeze(Object.defineProperty({__proto__:null,boundedNumber:fle,clamp:cle,reverse:dle},Symbol.toStringTag,{value:"Module"}));function AN(e){return{meet:gy(e),join:vy(e)}}const hle=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxDistributiveLattice:AN},Symbol.toStringTag,{value:"Module"}));function Ale(e){var t=AN(e);return function(n,r){return{join:t.join,meet:t.meet,zero:n,one:r}}}const mle=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxBoundedDistributiveLattice:Ale},Symbol.toStringTag,{value:"Module"})),gle=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),vle=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),yle=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),ble=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var wI=function(e,t){for(var n=t(e);n._tag==="Left";)n=t(n.left);return n.right};const Cle=Object.freeze(Object.defineProperty({__proto__:null,tailRec:wI},Symbol.toStringTag,{value:"Module"}));function _I(e,t){return function(n,r){return t.compose(e.right(r),e.left(n))}}function mN(e,t){var n=_I(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 Sle(e){return _I(e,e)}function wle(e){return mN(e,e)}const _le=Object.freeze(Object.defineProperty({__proto__:null,fanIn:mN,fanin:wle,split:_I,splitChoice:Sle},Symbol.toStringTag,{value:"Module"})),xle=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Tle=function(e,t){return x(e,gN(t))},gN=function(e){return function(t){return X(e,t)}},vN="Predicate",yN=function(){return{concat:function(e,t){return x(e,CN(t))}}},Ile=function(){return{concat:yN().concat,empty:FU}},bN=function(){return{concat:function(e,t){return x(e,SN(t))}}},Ele=function(){return{concat:bN().concat,empty:px}},Rle={URI:vN,contramap:Tle},oh=function(e){return function(t){return!e(t)}},CN=function(e){return function(t){return function(n){return t(n)||e(n)}}},SN=function(e){return function(t){return function(n){return t(n)&&e(n)}}};const $le=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:Rle,URI:vN,and:SN,contramap:gN,getMonoidAll:Ele,getMonoidAny:Ile,getSemigroupAll:bN,getSemigroupAny:yN,not:oh,or:CN},Symbol.toStringTag,{value:"Module"}));var ft=Re,jt=ye;function m0(e){return function(t){return e(t)?jt(t):ft}}var g0=function(e){return e._tag==="Right"?ft:jt(e.left)},vA=function(e){return e._tag==="Left"?ft:jt(e.right)},fi=function(e,t){return x(e,Ko(t))},Uu=function(e,t){return x(e,TN(t))},v0=function(e,t){return x(e,yA(t))},y0=function(e,t,n){return x(e,EN(t,n))},b0=function(e){var t=RN(e);return function(n,r){return x(n,t(r))}},C0=function(e,t,n){return x(e,$N(t,n))},xI=function(e){var t=UN(e);return function(n,r){return x(n,t(r))}},TI=function(e,t){return x(e,ON(t))},ah=function(e,t){return x(e,FN(t))},II=function(e,t){return x(e,jN(t))},wN=function(e,t){return x(e,kI(t))},EI=function(e,t){return x(e,LN(t))},RI=function(e,t){return x(e,DN(t))},ln="Option",kle=function(e){return{show:function(t){return Qe(t)?"none":"some(".concat(e.show(t.value),")")}}},_N=function(e){return{equals:function(t,n){return t===n||(Qe(t)?Qe(n):Qe(n)?!1:e.equals(t.value,n.value))}}},Ole=function(e){return{equals:_N(e).equals,compare:function(t,n){return t===n?0:cv(t)?cv(n)?e.compare(t.value,n.value):1:-1}}},$I=function(e){return{concat:function(t,n){return Qe(t)?n:Qe(n)?t:jt(e.concat(t.value,n.value))},empty:ft}},Ko=function(e){return function(t){return Qe(t)?ft:jt(e(t.value))}},uf={URI:ln,map:fi},Ma=jt,xN={URI:ln,of:Ma},TN=function(e){return function(t){return Qe(t)||Qe(e)?ft:jt(t.value(e.value))}},cf={URI:ln,map:fi,ap:Uu},IN={URI:ln,map:fi,ap:Uu,of:Ma},yA=function(e){return function(t){return Qe(t)?ft:e(t.value)}},bA={URI:ln,map:fi,ap:Uu,chain:v0},Mle={URI:ln,map:fi,ap:Uu,of:Ma,chain:v0},EN=function(e,t){return function(n){return Qe(n)?e:t(e,n.value)}},RN=function(e){return function(t){return function(n){return Qe(n)?e.empty:t(n.value)}}},$N=function(e,t){return function(n){return Qe(n)?e:t(n.value,e)}},Fle={URI:ln,reduce:y0,foldMap:b0,reduceRight:C0},kN=function(e){return function(t){return Qe(t)?e():t}},ON=kN,jle={URI:ln,map:fi,alt:TI},S0=function(){return ft},MN={URI:ln,zero:S0},Lle=Gd(MN,xN),Dle={URI:ln,map:fi,ap:Uu,of:Ma,alt:TI,zero:S0},kI=function(e){return function(t){return Qe(t)?ft:jt(e(t))}},Ule={URI:ln,map:fi,extend:wN},df=yA(Q),Ble=Be(ft,ft),ff=function(e){return Qe(e)?Ble:Be(g0(e.value),vA(e.value))},Bu={URI:ln,compact:df,separate:ff},FN=function(e){return function(t){return Qe(t)?ft:e(t.value)?t:ft}},jN=function(e){return function(t){return Qe(t)?ft:e(t.value)}},LN=function(e){return function(t){return Be(ah(t,oh(e)),ah(t,e))}},DN=function(e){return X(Ko(e),ff)},Fa={URI:ln,map:fi,compact:df,separate:ff,filter:ah,filterMap:II,partition:EI,partitionMap:RI},UN=function(e){return function(t){return function(n){return Qe(n)?e.of(ft):e.map(t(n.value),jt)}}},w0=function(e){return function(t){return Qe(t)?e.of(ft):e.map(t.value,jt)}},OI={URI:ln,map:fi,reduce:y0,foldMap:b0,reduceRight:C0,traverse:xI,sequence:w0},MI=ro(OI,Bu),FI=no(OI,Bu),Ple=function(e){var t=MI(e);return function(n){return function(r){return t(r,n)}}},Wle=function(e){var t=FI(e);return function(n){return function(r){return t(r,n)}}},Nle={URI:ln,map:fi,reduce:y0,foldMap:b0,reduceRight:C0,traverse:xI,sequence:w0,compact:df,separate:ff,filter:ah,filterMap:II,partition:EI,partitionMap:RI,wither:MI,wilt:FI},jI=function(){return ft},Kle={URI:ln,map:fi,ap:Uu,of:Ma,chain:v0,throwError:jI},pf=vA,_0={URI:ln,fromEither:pf},cv=Ft,Qe=function(e){return e._tag==="None"},LI=function(e,t){return function(n){return Qe(n)?e():t(n.value)}},qle=LI,ja=LI,rl=ja,BN=function(e){return function(t){return Qe(t)?e():t.value}},DI=BN,Vle=He(uf),zle=qt(cf),Qle=Vt(cf),Hle=df,Yle=vt(bA),Gle=kI(Q),Jle=di(_0),Zle=$a(_0,bA),Xle=ka(_0,bA),Pu=function(e){return e==null?ft:jt(e)},PN=function(e){try{return jt(e())}catch{return ft}},eue=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return PN(function(){return e.apply(void 0,t)})}},tue=function(e){return X(e,Pu)},WN=function(e){return function(t){return Qe(t)?ft:Pu(e(t.value))}},UI=ja(jU,Q),NN=ja(hx,Q);function KN(e){return function(t,n){if(n===void 0){var r=KN(e);return function(i){return r(t,i)}}return Qe(n)?!1:e.equals(t,n.value)}}var nue=function(e){return function(t){return Qe(t)?!1:e(t.value)}},rue=Ma(gn),iue=Qt(uf),oue=Ht(bA),aue=zt(cf),qN=Ma(Ln),x0=function(e){return function(t){var n=e(0,ci(t));if(Qe(n))return ft;for(var r=[n.value],i=1;i<t.length;i++){var o=e(i,t[i]);if(Qe(o))return ft;r.push(o.value)}return jt(r)}},BI=function(e){var t=x0(e);return function(n){return Tt(n)?t(n):qN}},sue=BI,VN=function(e){return BI(function(t,n){return e(n)})},lue=VN(Q);function uue(e){return function(t){return cv(e(t))}}var cue=WN,zN={URI:ln,map:fi,of:Ma,ap:Uu,chain:v0,reduce:y0,foldMap:b0,reduceRight:C0,traverse:xI,sequence:w0,zero:S0,alt:TI,extend:wN,compact:df,separate:ff,filter:ah,filterMap:II,partition:EI,partitionMap:RI,wither:MI,wilt:FI,throwError:jI},due=vn(cf),fue=$i(IN),QN=function(){return $I(_x())},pue=function(){return $I(Cy())};const hue=Object.freeze(Object.defineProperty({__proto__:null,Alt:jle,Alternative:Dle,ApT:qN,Applicative:IN,Apply:cf,Chain:bA,Compactable:Bu,Do:rue,Extend:Ule,Filterable:Fa,Foldable:Fle,FromEither:_0,Functor:uf,Monad:Mle,MonadThrow:Kle,Pointed:xN,Traversable:OI,URI:ln,Witherable:Nle,Zero:MN,alt:ON,altW:kN,ap:TN,apFirst:zle,apS:aue,apSecond:Qle,bind:oue,bindTo:iue,chain:yA,chainEitherK:Zle,chainFirst:Yle,chainFirstEitherK:Xle,chainNullableK:WN,compact:df,duplicate:Gle,elem:KN,exists:nue,extend:kI,filter:FN,filterMap:jN,flap:Vle,flatten:Hle,fold:rl,foldMap:RN,foldW:qle,fromEither:pf,fromEitherK:Jle,fromNullable:Pu,fromNullableK:tue,fromPredicate:m0,getApplyMonoid:fue,getApplySemigroup:due,getEq:_N,getFirstMonoid:QN,getLastMonoid:pue,getLeft:g0,getMonoid:$I,getOrElse:DI,getOrElseW:BN,getOrd:Ole,getRefinement:uue,getRight:vA,getShow:kle,guard:Lle,isNone:Qe,isSome:cv,map:Ko,mapNullable:cue,match:ja,matchW:LI,none:ft,of:Ma,option:zN,partition:LN,partitionMap:DN,reduce:EN,reduceRight:$N,separate:ff,sequence:w0,sequenceArray:lue,some:jt,throwError:jI,toNullable:UI,toUndefined:NN,traverse:UN,traverseArray:VN,traverseArrayWithIndex:sue,traverseReadonlyArrayWithIndex:BI,traverseReadonlyNonEmptyArrayWithIndex:x0,tryCatch:PN,tryCatchK:eue,wilt:Wle,wither:Ple,zero:S0},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(g0))),r(x(o,i(vA))))}}function Aue(e,t){var n=qd(e,t).map;return{map:n,compact:qo(e,t),separate:La(e,t,t)}}const mue=Object.freeze(Object.defineProperty({__proto__:null,compact:qo,getCompactableComposition:Aue,separate:La},Symbol.toStringTag,{value:"Module"}));var gue=function(e){return function(){return console.log(e)}},vue=function(e){return function(){return console.warn(e)}},yue=function(e){return function(){return console.error(e)}},bue=function(e){return function(){return console.info(e)}};const Cue=Object.freeze(Object.defineProperty({__proto__:null,error:yue,info:bue,log:gue,warn:vue},Symbol.toStringTag,{value:"Module"}));var hf=dd;function Sue(e){return{show:function(t){return"make(".concat(e.show(t),")")}}}var wue=Q,_ue=Q,xue=Q,Tue=Q,Iue=Q,Eue=Q,Rue=Q,$ue=Q,kue=Q;function HN(e){return{URI:Wu,_E:void 0,map:PI,ap:function(t,n){return hf(e.concat(t,n))}}}function YN(e){var t=HN(e);return{URI:Wu,_E:void 0,map:t.map,ap:t.ap,of:function(){return hf(e.empty)}}}var GN=function(e,t){return x(e,XN())},PI=function(e,t){return x(e,eK())},JN=function(e,t,n){return x(e,tK(t))},ZN=function(e,t){return x(e,nK(t))},XN=function(){return dd},eK=function(){return dd},tK=function(e){return function(t){return hf(e(t))}},nK=function(e){return function(t){return hf(e(t))}},Wu="Const",rK={URI:Wu,map:PI},Oue=He(rK),Mue={URI:Wu,contramap:GN},Fue={URI:Wu,bimap:JN,mapLeft:ZN},jue={URI:Wu,map:PI,contramap:GN,bimap:JN,mapLeft:ZN};const Lue=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:Fue,Contravariant:Mue,Functor:rK,URI:Wu,bimap:tK,const_:jue,contramap:XN,flap:Oue,getApplicative:YN,getApply:HN,getBooleanAlgebra:kue,getBounded:xue,getEq:wue,getHeytingAlgebra:$ue,getMonoid:Iue,getOrd:_ue,getRing:Rue,getSemigroup:Tue,getSemiring:Eue,getShow:Sue,make:hf,map:eK,mapLeft:nK},Symbol.toStringTag,{value:"Module"})),Due=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Uue={equals:function(e,t){return e.valueOf()===t.valueOf()}},Bue={equals:function(e,t){return e.getDate()===t.getDate()}},Pue={equals:function(e,t){return e.getMonth()===t.getMonth()}},Wue={equals:function(e,t){return e.getFullYear()===t.getFullYear()}},Nue=x(Vy,my(function(e){return e.valueOf()})),Kue=function(){return new Date},que=function(){return new Date().getTime()};const Vue=Object.freeze(Object.defineProperty({__proto__:null,Eq:Uue,Ord:Nue,create:Kue,eqDate:Bue,eqMonth:Pue,eqYear:Wue,now:que},Symbol.toStringTag,{value:"Module"}));var Ut=Ca,Je=Ys,tr=function(e,t){return x(e,qu(t))},Nu=function(e,t){return x(e,sK(t))},Af=function(e,t){return x(e,Mi(t))},CA=function(e,t,n){return x(e,uK(t,n))},SA=function(e){return function(t,n){var r=cK(e);return x(t,r(n))}},wA=function(e,t,n){return x(e,dK(t,n))},T0=function(e){var t=fK(e);return function(n,r){return x(n,t(r))}},WI=function(e,t,n){return x(e,zI(t,n))},NI=function(e,t){return x(e,IA(t))},iK=function(e,t){return x(e,hK(t))},KI=function(e,t){return x(e,QI(t))},qI=function(e,t){return wI(t(e),function(n){return ue(n)?Je(Ut(n.left)):ue(n.right)?Ut(t(n.right.left)):Je(Je(n.right.right))})},Bt="Either",zue=function(e,t){return{show:function(n){return ue(n)?"left(".concat(e.show(n.left),")"):"right(".concat(t.show(n.right),")")}}},Que=function(e,t){return{equals:function(n,r){return n===r||(ue(n)?ue(r)&&e.equals(n.left,r.left):HI(r)&&t.equals(n.right,r.right))}}},_A=function(e){return{concat:function(t,n){return ue(n)?t:ue(t)?n:Je(e.concat(t.right,n.right))}}},Ku=function(e){var t=Ut(e.empty);return{URI:Bt,_E:void 0,compact:function(n){return ue(n)?n:n.right._tag==="None"?t:Je(n.right.value)},separate:function(n){return ue(n)?Be(n,n):ue(n.right)?Be(Je(n.right.left),t):Be(t,Je(n.right.right))}}},mf=function(e){var t=Ut(e.empty),n=Ku(e),r=n.compact,i=n.separate,o=function(s,l){return ue(s)||l(s.right)?s:t},a=function(s,l){return ue(s)?Be(s,s):l(s.right)?Be(t,Je(s.right)):Be(Je(s.right),t)};return{URI:Bt,_E:void 0,map:tr,compact:r,separate:i,filter:o,filterMap:function(s,l){if(ue(s))return s;var u=l(s.right);return u._tag==="None"?t:Je(u.value)},partition:a,partitionMap:function(s,l){if(ue(s))return Be(s,s);var u=l(s.right);return ue(u)?Be(Je(u.left),t):Be(t,Je(u.right))}}},Hue=function(e){var t=mf(e),n=Ku(e);return{URI:Bt,_E:void 0,map:tr,compact:t.compact,separate:t.separate,filter:t.filter,filterMap:t.filterMap,partition:t.partition,partitionMap:t.partitionMap,traverse:T0,sequence:TA,reduce:CA,foldMap:SA,reduceRight:wA,wither:ro(Rw,n),wilt:no(Rw,n)}},il=function(e){return{URI:Bt,_E:void 0,map:tr,ap:function(t,n){return ue(t)?ue(n)?Ut(e.concat(t.left,n.left)):t:ue(n)?n:Je(t.right(n.right))},of:Vo}},oK=function(e){return{URI:Bt,_E:void 0,map:tr,alt:function(t,n){if(HI(t))return t;var r=n();return ue(r)?Ut(e.concat(t.left,r.left)):r}}},qu=function(e){return function(t){return ue(t)?t:Je(e(t.right))}},ol={URI:Bt,map:tr},Vo=Je,Yue={URI:Bt,of:Vo},aK=function(e){return function(t){return ue(t)?t:ue(e)?e:Je(t.right(e.right))}},sK=aK,gf={URI:Bt,map:tr,ap:Nu},lK={URI:Bt,map:tr,ap:Nu,of:Vo},VI=function(e){return function(t){return ue(t)?t:e(t.right)}},Mi=VI,xA={URI:Bt,map:tr,ap:Nu,chain:Af},Gue={URI:Bt,map:tr,ap:Nu,of:Vo,chain:Af},uK=function(e,t){return function(n){return ue(n)?e:t(e,n.right)}},cK=function(e){return function(t){return function(n){return ue(n)?e.empty:t(n.right)}}},dK=function(e,t){return function(n){return ue(n)?e:t(n.right,e)}},Jue={URI:Bt,reduce:CA,foldMap:SA,reduceRight:wA},fK=function(e){return function(t){return function(n){return ue(n)?e.of(Ut(n.left)):e.map(t(n.right),Je)}}},TA=function(e){return function(t){return ue(t)?e.of(Ut(t.left)):e.map(t.right,Je)}},Rw={URI:Bt,map:tr,reduce:CA,foldMap:SA,reduceRight:wA,traverse:T0,sequence:TA},zI=function(e,t){return function(n){return ue(n)?Ut(e(n.left)):Je(t(n.right))}},IA=function(e){return function(t){return ue(t)?Ut(e(t.left)):t}},Zue={URI:Bt,bimap:WI,mapLeft:NI},pK=function(e){return function(t){return ue(t)?e():t}},hK=pK,Xue={URI:Bt,map:tr,alt:iK},QI=function(e){return function(t){return ue(t)?t:Je(e(t))}},ece={URI:Bt,map:tr,extend:KI},tce={URI:Bt,map:tr,ap:Nu,chain:Af,chainRec:qI},I0=Ut,nce={URI:Bt,map:tr,ap:Nu,of:Vo,chain:Af,throwError:I0},vf={URI:Bt,fromEither:Q},rce=Gs(vf),AK=Po(vf),ue=hn,HI=Ax,YI=function(e,t){return function(n){return ue(n)?e(n.left):t(n.right)}},mK=YI,al=YI,GI=al,gK=function(e){return function(t){return ue(t)?e(t.left):t.right}},ice=gK,oce=He(ol),vK=qt(gf),ace=vK,yK=Vt(gf),sce=yK,bK=vt(xA),lce=bK,CK=VI(Q),uce=CK,cce=QI(Q),dce=Wo(vf),fce=Ou(vf,xA),SK=Mu(vf,xA),pce=SK,wK=function(e){return ue(e)?Je(e.left):Ut(e.right)},_K=function(e){return function(t){return ue(t)?e(t.left):t}},xK=_K,JI=function(e){return function(t){return t==null?Ut(e):Je(t)}},Vu=function(e,t){try{return Je(e())}catch(n){return Ut(t(n))}},hce=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Vu(function(){return e.apply(void 0,n)},t)}},TK=function(e){var t=JI(e);return function(n){return X(n,t)}},Ace=function(e){var t=TK(e);return function(n){return Mi(t(n))}},IK=mK(Q,Q);function mce(e){return e instanceof Error?e:new Error(String(e))}function EK(e){return function(t,n){if(n===void 0){var r=EK(e);return function(i){return r(t,i)}}return ue(n)?!1:e.equals(t,n.right)}}var gce=function(e){return function(t){return ue(t)?!1:e(t.right)}},vce=Vo(gn),yce=Qt(ol),RK=Ht(xA),bce=RK,$K=zt(gf),Cce=$K,kK=Vo(Ln),EA=function(e){return function(t){var n=e(0,ci(t));if(ue(n))return n;for(var r=[n.right],i=1;i<t.length;i++){var o=e(i,t[i]);if(ue(o))return o;r.push(o.right)}return Je(r)}},ZI=function(e){var t=EA(e);return function(n){return Tt(n)?t(n):kK}},Sce=ZI,OK=function(e){return ZI(function(t,n){return e(n)})},wce=OK(Q);function _ce(e,t){return Vu(function(){return JSON.parse(e)},t)}var xce=function(e,t){return Vu(function(){var n=JSON.stringify(e);if(typeof n!="string")throw new Error("Converting unsupported structure to JSON");return n},t)},Tce={URI:Bt,map:tr,of:Vo,ap:Nu,chain:Af,reduce:CA,foldMap:SA,reduceRight:wA,traverse:T0,sequence:TA,bimap:WI,mapLeft:NI,alt:iK,extend:KI,chainRec:qI,throwError:I0},Ice=vn(gf),Ece=$i(lK),Rce=function(e,t){return vn(il(e))(t)},$ce=function(e,t){return $i(il(e))(t)};function kce(e){var t=il(e).ap,n=oK(e).alt;return{URI:Bt,_E:void 0,map:tr,of:Vo,chain:Af,bimap:WI,mapLeft:NI,reduce:CA,foldMap:SA,reduceRight:wA,extend:KI,traverse:T0,sequence:TA,chainRec:qI,throwError:I0,ap:t,alt:n}}const MK=Object.freeze(Object.defineProperty({__proto__:null,Alt:Xue,ApT:kK,Applicative:lK,Apply:gf,Bifunctor:Zue,Chain:xA,ChainRec:tce,Do:vce,Extend:ece,Foldable:Jue,FromEither:vf,Functor:ol,Monad:Gue,MonadThrow:nce,Pointed:Yue,Traversable:Rw,URI:Bt,alt:hK,altW:pK,ap:sK,apFirst:vK,apFirstW:ace,apS:$K,apSW:Cce,apSecond:yK,apSecondW:sce,apW:aK,bimap:zI,bind:RK,bindTo:yce,bindW:bce,chain:Mi,chainFirst:bK,chainFirstW:lce,chainNullableK:Ace,chainOptionK:fce,chainW:VI,duplicate:cce,either:Tce,elem:EK,exists:gce,extend:QI,filterOrElse:SK,filterOrElseW:pce,flap:oce,flatten:uce,flattenW:CK,fold:GI,foldMap:cK,foldW:mK,fromNullable:JI,fromNullableK:TK,fromOption:AK,fromOptionK:dce,fromPredicate:rce,getAltValidation:oK,getApplicativeValidation:il,getApplyMonoid:Ece,getApplySemigroup:Ice,getCompactable:Ku,getEq:Que,getFilterable:mf,getOrElse:ice,getOrElseW:gK,getSemigroup:_A,getShow:zue,getValidation:kce,getValidationMonoid:$ce,getValidationSemigroup:Rce,getWitherable:Hue,isLeft:ue,isRight:HI,left:Ut,map:qu,mapLeft:IA,match:al,matchW:YI,of:Vo,orElse:xK,orElseW:_K,parseJSON:_ce,reduce:uK,reduceRight:dK,right:Je,sequence:TA,sequenceArray:wce,stringifyJSON:xce,swap:wK,throwError:I0,toError:mce,toUnion:IK,traverse:fK,traverseArray:OK,traverseArrayWithIndex:Sce,traverseReadonlyArrayWithIndex:ZI,traverseReadonlyNonEmptyArrayWithIndex:EA,tryCatch:Vu,tryCatchK:hce},Symbol.toStringTag,{value:"Module"}));function zu(e){return X(Je,e.of)}function yf(e){return X(Ut,e.of)}function bf(e){return function(t){return e.map(t,Je)}}function Cf(e){return function(t){return e.map(t,Ut)}}function E0(e){return function(t){return X(JI(t),e.of)}}function R0(e){var t=E0(e);return function(n){var r=t(n);return function(i){return X(i,r)}}}function XI(e){var t=Qu(e),n=R0(e);return function(r){var i=n(r);return function(o){return t(i(o))}}}function Sf(e){return Kd(e,ol)}function wf(e){return Ra(e,gf)}function Qu(e){return function(t){return function(n){return e.chain(n,function(r){return ue(r)?e.of(r):t(r.right)})}}}function _f(e){return function(t){return function(n){return e.chain(n,function(r){return ue(r)?t():e.of(r)})}}}function xf(e){return function(t,n){return function(r){return e.map(r,zI(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,al(function(i){return e.map(n(),IA(function(o){return t.concat(i,o)}))},zu(e)))}}}function $A(e){return function(t,n){return function(r){return e.map(r,al(t,n))}}}function If(e){return function(t,n){return function(r){return e.chain(r,al(t,n))}}}function Ef(e){return function(t){return function(n){return e.chain(n,al(t,e.of))}}}function Hu(e){return function(t){return function(n){return e.chain(n,function(r){return ue(r)?t(r.left):e.of(r)})}}}function kA(e){var t=Hu(e);return function(n){return t(function(r){return e.map(n(r),function(i){return ue(i)?i:Ut(r)})})}}function OA(e){return function(t){return function(n){return e.chain(n,al(function(r){return e.map(t(r),Ut)},function(r){return e.of(Je(r))}))}}}function Rf(e){return function(t){return e.map(t,wK)}}function MA(e){return function(t){return e.map(t,IK)}}function Oce(e){var t=wf(e),n=Sf(e),r=Qu(e),i=_f(e),o=xf(e),a=Tf(e),s=If(e),l=Ef(e),u=Hu(e);return{map:function(c,f){return x(c,n(f))},ap:function(c,f){return x(c,t(f))},of:zu(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,l(f))},orElse:function(c,f){return x(c,u(f))},swap:Rf(e),rightM:bf(e),leftM:Cf(e),left:yf(e)}}const Mce=Object.freeze(Object.defineProperty({__proto__:null,alt:_f,altValidation:RA,ap:wf,bimap:xf,chain:Qu,chainNullableK:XI,fromNullable:E0,fromNullableK:R0,getEitherM:Oce,getOrElse:Ef,left:yf,leftF:Cf,map:Sf,mapLeft:Tf,match:$A,matchE:If,orElse:Hu,orElseFirst:kA,orLeft:OA,right:zu,rightF:bf,swap:Rf,toUnion:MA},Symbol.toStringTag,{value:"Module"}));var Fce="Endomorphism",FK=function(){return{concat:function(e,t){return X(e,t)}}},jK=function(){return{concat:FK().concat,empty:Q}};const jce=Object.freeze(Object.defineProperty({__proto__:null,URI:Fce,getMonoid:jK,getSemigroup:FK},Symbol.toStringTag,{value:"Module"})),Lce=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function LK(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 Dce(e,t){var n=t.zero,r=LK(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 Uce={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 Bce=Object.freeze(Object.defineProperty({__proto__:null,fieldNumber:Uce,gcd:LK,lcm:Dce},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 sl(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 ll(e,t){var n=Ua(e,t);return function(r){return function(i){return Be(x(i,n(function(o){return g0(r(o))})),x(i,n(function(o){return vA(r(o))})))}}}function Pce(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=sl(e,t),l=ll(e,t);return{map:n,compact:r,separate:i,filter:function(u,c){return x(u,o(c))},filterMap:function(u,c){return x(u,a(c))},partition:function(u,c){return x(u,s(c))},partitionMap:function(u,c){return x(u,l(c))}}}const Wce=Object.freeze(Object.defineProperty({__proto__:null,filter:Da,filterMap:Ua,getFilterableComposition:Pce,partition:sl,partitionMap:ll},Symbol.toStringTag,{value:"Module"})),Nce=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function DK(e,t){return function(n,r){return function(i){return e.reduce(i,n,function(o,a){return t.reduce(a,o,r)})}}}function UK(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 BK(e,t){return function(n,r){return function(i){return e.reduceRight(i,n,function(o,a){return t.reduceRight(o,a,r)})}}}function Kce(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 qce(e,t){return function(n,r){var i=function(o,a){var s=o.init,l=o.acc;return s?{init:!1,acc:a}:{init:!1,acc:e.concat(e.concat(l,n),a)}};return t.reduce(r,{init:!0,acc:e.empty},i).acc}}function PK(e){return function(t){return e.reduce(t,[],function(n,r){return n.push(r),n})}}function Vce(e,t){var n=function(i,o){return e.ap(e.map(i,Dr),o)},r=e.of(void 0);return function(i,o){return t.reduce(i,r,function(a,s){return n(a,o(s))})}}function zce(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 Qce=PK;function eE(e,t){var n=DK(e,t),r=UK(e,t),i=BK(e,t);return{reduce:function(o,a,s){return x(o,n(a,s))},foldMap:function(o){var a=r(o);return function(s,l){return x(s,a(l))}},reduceRight:function(o,a,s){return x(o,i(a,s))}}}const Hce=Object.freeze(Object.defineProperty({__proto__:null,foldM:zce,foldMap:UK,getFoldableComposition:eE,intercalate:qce,reduce:DK,reduceM:Kce,reduceRight:BK,toArray:Qce,toReadonlyArray:PK,traverse_:Vce},Symbol.toStringTag,{value:"Module"}));function WK(e,t){return function(n,r){return function(i){return e.reduceWithIndex(i,n,function(o,a,s){return t.reduceWithIndex(s,a,function(l,u,c){return r([o,l],u,c)})})}}}function NK(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,l){return i(l,function(u,c){return o([s,u],c)})})}}}}function KK(e,t){return function(n,r){return function(i){return e.reduceRightWithIndex(i,n,function(o,a,s){return t.reduceRightWithIndex(a,s,function(l,u,c){return r([o,l],u,c)})})}}}function Yce(e,t){var n=eE(e,t),r=WK(e,t),i=NK(e,t),o=KK(e,t);return{reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:function(a,s,l){return x(a,r(s,l))},foldMapWithIndex:function(a){var s=i(a);return function(l,u){return x(l,s(u))}},reduceRightWithIndex:function(a,s,l){return x(a,o(s,l))}}}const Gce=Object.freeze(Object.defineProperty({__proto__:null,foldMapWithIndex:NK,getFoldableWithIndexComposition:Yce,reduceRightWithIndex:KK,reduceWithIndex:WK},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 Jce=Object.freeze(Object.defineProperty({__proto__:null,chainFirstIOK:Pa,chainIOK:Ba,fromIOK:zo},Symbol.toStringTag,{value:"Module"}));var qK=function(){return Q},Zce=Q,FA=function(e){return function(t){return function(n){return t(e(n))}}},jA=function(e){return function(t){return e(t)(t)}},Xce=jA,Wa=function(e,t){return x(e,Yu(t))},LA=function(e,t){return x(e,QK(t))},tE=function(e,t){return x(e,HK(t))},VK=function(e,t){return x(e,GK(t))},$0=function(e,t,n){return x(e,JK(t,n))},Yu=function(e){return function(t){return function(n){return e(t(n))}}},zK=function(e){return function(t){return function(n){return t(n)(e(n))}}},QK=zK,Qo=Dr,nE=function(e){return function(t){return function(n){return e(t(n))(n)}}},HK=nE,YK=nE(Q),ede=YK,GK=function(e){return function(t){return X(e,t)}},JK=function(e,t){return function(n){return function(r){return t(n(e(r)))}}},rE=function(){return Q},iE=function(e){return function(t){var n=t[0],r=t[1];return[e(n),r]}},oE=function(e){return function(t){var n=t[0],r=t[1];return[n,e(r)]}},aE=function(e){return GI(function(t){return Ca(e(t))},Je)},sE=function(e){return GI(Ut,function(t){return Ys(e(t))})},Fi="Reader",On={URI:Fi,map:Wa},tde=He(On),lE={URI:Fi,of:Qo},Na={URI:Fi,map:Wa,ap:LA},ZK=qt(Na),nde=ZK,XK=Vt(Na),rde=XK,e3={URI:Fi,map:Wa,ap:LA,of:Qo},uE={URI:Fi,map:Wa,ap:LA,chain:tE},Ka={URI:Fi,map:Wa,of:Qo,ap:LA,chain:tE},t3=vt(uE),ide=t3,ode={URI:Fi,map:Wa,promap:$0},ade={URI:Fi,compose:VK,id:rE},sde={URI:Fi,map:Wa,promap:$0,first:iE,second:oE},lde={URI:Fi,map:Wa,promap:$0,left:aE,right:sE},ude=Qt(On),n3=Ht(uE),cde=n3,dde=Qo(gn),r3=zt(Na),fde=r3,i3=Qo(Ln),Gu=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}}},cE=function(e){var t=Gu(e);return function(n){return Tt(n)?t(n):i3}},pde=cE,o3=function(e){return cE(function(t,n){return e(n)})},hde=o3(Q),Ade={URI:Fi,map:Wa,of:Qo,ap:LA,chain:tE,promap:$0,compose:VK,id:rE,first:iE,second:oE,left:aE,right:sE},mde=vn(Na),gde=$i(e3);const vde=Object.freeze(Object.defineProperty({__proto__:null,ApT:i3,Applicative:e3,Apply:Na,Category:ade,Chain:uE,Choice:lde,Do:dde,Functor:On,Monad:Ka,Pointed:lE,Profunctor:ode,Strong:sde,URI:Fi,ap:QK,apFirst:ZK,apFirstW:nde,apS:r3,apSW:fde,apSecond:XK,apSecondW:rde,apW:zK,ask:qK,asks:Zce,asksReader:Xce,asksReaderW:jA,bind:n3,bindTo:ude,bindW:cde,chain:HK,chainFirst:t3,chainFirstW:ide,chainW:nE,compose:GK,first:iE,flap:tde,flatten:ede,flattenW:YK,getMonoid:gde,getSemigroup:mde,id:rE,left:aE,local:FA,map:Yu,of:Qo,promap:JK,reader:Ade,right:sE,second:oE,sequenceArray:hde,traverseArray:o3,traverseArrayWithIndex:pde,traverseReadonlyArrayWithIndex:cE,traverseReadonlyNonEmptyArrayWithIndex:Gu},Symbol.toStringTag,{value:"Module"}));function DA(e){return function(){return e.fromReader(qK())}}function UA(e){return e.fromReader}function Ju(e){return function(t){return X(t,e.fromReader)}}function BA(e,t){var n=Ju(e);return function(r){return function(i){return t.chain(i,n(r))}}}function PA(e,t){return X(Ju(e),vt(t))}const yde=Object.freeze(Object.defineProperty({__proto__:null,ask:DA,asks:UA,chainFirstReaderK:PA,chainReaderK:BA,fromReaderK:Ju},Symbol.toStringTag,{value:"Module"}));var a3=function(){return function(e){return[e,e]}},s3=function(e){return function(){return[void 0,e]}},l3=function(e){return function(t){return[void 0,e(t)]}},u3=function(e){return function(t){return[e(t),t]}},WA=function(e,t){return x(e,d3(t))},k0=function(e,t){return x(e,f3(t))},c3=function(e,t){return x(e,dE(t))},d3=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return[e(i),o]}}},f3=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1],a=e(o),s=a[0],l=a[1];return[i(s),l]}}},NA=function(e){return function(t){return[e,t]}},dE=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return e(i)(o)}}},bde=dE(Q),ul="State",fE={URI:ul,map:WA},Cde=He(fE),Sde={URI:ul,of:NA},O0={URI:ul,map:WA,ap:k0},wde=qt(O0),_de=Vt(O0),xde={URI:ul,map:WA,ap:k0,of:NA},pE={URI:ul,map:WA,ap:k0,chain:c3},p3={URI:ul,map:WA,ap:k0,of:NA,chain:c3},Tde=vt(pE),Ide={URI:ul,fromState:Q},Ede=function(e){return function(t){return t(e)[0]}},Rde=function(e){return function(t){return t(e)[1]}},$de=Qt(fE),kde=Ht(pE),Ode=zt(O0),h3=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,l=1;l<t.length;l++){var u=e(l,t[l])(s),c=u[0],f=u[1];a.push(c),s=f}return[a,s]}}},hE=function(e){var t=h3(e);return function(n){return Tt(n)?t(n):NA(Ln)}},Mde=hE,A3=function(e){return hE(function(t,n){return e(n)})},Fde=A3(Q),jde=function(e,t){return e(t)[0]},Lde=function(e,t){return e(t)[1]},Dde=p3;const Ude=Object.freeze(Object.defineProperty({__proto__:null,Applicative:xde,Apply:O0,Chain:pE,FromState:Ide,Functor:fE,Monad:p3,Pointed:Sde,URI:ul,ap:f3,apFirst:wde,apS:Ode,apSecond:_de,bind:kde,bindTo:$de,chain:dE,chainFirst:Tde,evalState:jde,evaluate:Ede,execState:Lde,execute:Rde,flap:Cde,flatten:bde,get:a3,gets:u3,map:d3,modify:l3,of:NA,put:s3,sequenceArray:Fde,state:Dde,traverseArray:A3,traverseArrayWithIndex:Mde,traverseReadonlyArrayWithIndex:hE,traverseReadonlyNonEmptyArrayWithIndex:h3},Symbol.toStringTag,{value:"Module"}));function m3(e){return function(){return e.fromState(a3())}}function g3(e){return function(t){return e.fromState(s3(t))}}function v3(e){return X(l3,e.fromState)}function y3(e){return X(u3,e.fromState)}function AE(e){return function(t){return X(t,e.fromState)}}function b3(e,t){var n=AE(e);return function(r){return function(i){return t.chain(i,n(r))}}}const Bde=Object.freeze(Object.defineProperty({__proto__:null,chainStateK:b3,fromStateK:AE,get:m3,gets:y3,modify:v3,put:g3},Symbol.toStringTag,{value:"Module"}));function Zu(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 Pde=Object.freeze(Object.defineProperty({__proto__:null,chainFirstTaskK:kf,chainTaskK:$f,fromTaskK:Zu},Symbol.toStringTag,{value:"Module"}));function C3(e){return function(t){return X(t,e.fromThese)}}const Wde=Object.freeze(Object.defineProperty({__proto__:null,fromTheseK:C3},Symbol.toStringTag,{value:"Module"}));function S3(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 Nde(e,t){var n=qd(e,t).map,r=S3(e,t);return{map:n,mapWithIndex:function(i,o){return x(i,r(o))}}}const Kde=Object.freeze(Object.defineProperty({__proto__:null,getFunctorWithIndexComposition:Nde,mapWithIndex:S3},Symbol.toStringTag,{value:"Module"})),qde=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Vde=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),zde=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Ho=function(e,t){return x(e,I3(t))},Of=function(e,t){return x(e,E3(t))},M0=function(e,t){return x(e,yE(t))},mE=function(e,t,n){return x(e,R3(t,n))},gE=function(e){return function(t,n){return x(t,$3()(n))}},vE=function(e,t,n){return x(e,k3(t,n))},w3=function(e,t){return x(e,F3())},_3=function(e,t){return x(e,bE(t))},x3=function(e){var t=O3(e);return function(n,r){return x(n,t(r))}},T3=wI,I3=function(e){return function(t){return e(t)}},E3=function(e){return function(t){return t(e)}},Mf=Q,yE=function(e){return function(t){return e(t)}},bE=function(e){return function(t){return e(t)}},CE=Q,Qde=bE(Q),Hde=yE(Q),R3=function(e,t){return function(n){return t(e,n)}},$3=function(){return function(e){return function(t){return e(t)}}},k3=function(e,t){return function(n){return t(n,e)}},O3=function(e){return function(t){return function(n){return e.map(t(n),Q)}}},SE=function(e){return function(t){return e.map(t,Q)}},M3=function(){return Q},F3=M3,pi="Identity",Yde=Q,Gde=Q,wE={URI:pi,map:Ho},Jde=He(wE),Zde={URI:pi,of:Mf},F0={URI:pi,map:Ho,ap:Of},Xde=qt(F0),efe=Vt(F0),tfe={URI:pi,map:Ho,ap:Of,of:Mf},_E={URI:pi,map:Ho,ap:Of,chain:M0},nfe={URI:pi,map:Ho,ap:Of,of:Mf,chain:M0},rfe=vt(_E),ife={URI:pi,reduce:mE,foldMap:gE,reduceRight:vE},ofe={URI:pi,map:Ho,reduce:mE,foldMap:gE,reduceRight:vE,traverse:x3,sequence:SE},afe={URI:pi,map:Ho,alt:w3},sfe={URI:pi,map:Ho,extend:_3,extract:CE},lfe={URI:pi,map:Ho,ap:Of,chain:M0,chainRec:T3},ufe=Mf(gn),cfe=Qt(wE),dfe=Ht(_E),ffe=zt(F0),pfe={URI:pi,map:Ho,ap:Of,of:Mf,chain:M0,reduce:mE,foldMap:gE,reduceRight:vE,traverse:x3,sequence:SE,alt:w3,extract:CE,extend:_3,chainRec:T3};const hfe=Object.freeze(Object.defineProperty({__proto__:null,Alt:afe,Applicative:tfe,Apply:F0,Chain:_E,ChainRec:lfe,Comonad:sfe,Do:ufe,Foldable:ife,Functor:wE,Monad:nfe,Pointed:Zde,Traversable:ofe,URI:pi,alt:F3,altW:M3,ap:E3,apFirst:Xde,apS:ffe,apSecond:efe,bind:dfe,bindTo:cfe,chain:yE,chainFirst:rfe,duplicate:Qde,extend:bE,extract:CE,flap:Jde,flatten:Hde,foldMap:$3,getEq:Gde,getShow:Yde,identity:pfe,map:I3,of:Mf,reduce:R3,reduceRight:k3,sequence:SE,traverse:O3},Symbol.toStringTag,{value:"Module"})),Afe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var qa=function(e,t){return function(){return t(e())}},cl=function(e,t){return function(){return e()(t())}},Ff=function(e,t){return function(){return t(e())()}},j3=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)}},mfe=function(e){return function(t){return cl(t,e)}},io=Dr,xE=function(e){return function(t){return Ff(t,e)}},gfe=xE(Q),oo="IO",At={URI:oo,map:qa},vfe=He(At),Go={URI:oo,of:io},Va={URI:oo,map:qa,ap:cl},yfe=qt(Va),bfe=Vt(Va),L3={URI:oo,map:qa,ap:cl,of:io},j0={URI:oo,map:qa,ap:cl,chain:Ff},Br={URI:oo,map:qa,ap:cl,of:io,chain:Ff},Cfe=vt(j0),TE=Q,Sfe={URI:oo,map:qa,ap:cl,of:io,chain:Ff,fromIO:TE},wfe={URI:oo,map:qa,ap:cl,chain:Ff,chainRec:j3},_fe={URI:oo,fromIO:Q},xfe=io(gn),Tfe=Qt(At),Ife=Ht(j0),Efe=zt(Va),D3=io(Ln),L0=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}}},IE=function(e){var t=L0(e);return function(n){return Tt(n)?t(n):D3}},Rfe=IE,U3=function(e){return IE(function(t,n){return e(n)})},$fe=U3(Q),kfe={URI:oo,map:qa,of:io,ap:cl,chain:Ff,fromIO:TE,chainRec:j3},Ofe=vn(Va),Mfe=$i(L3);const Ffe=Object.freeze(Object.defineProperty({__proto__:null,ApT:D3,Applicative:L3,Apply:Va,Chain:j0,ChainRec:wfe,Do:xfe,FromIO:_fe,Functor:At,Monad:Br,MonadIO:Sfe,Pointed:Go,URI:oo,ap:mfe,apFirst:yfe,apS:Efe,apSecond:bfe,bind:Ife,bindTo:Tfe,chain:xE,chainFirst:Cfe,flap:vfe,flatten:gfe,fromIO:TE,getMonoid:Mfe,getSemigroup:Ofe,io:kfe,map:Yo,of:io,sequenceArray:$fe,traverseArray:U3,traverseArrayWithIndex:Rfe,traverseReadonlyArrayWithIndex:IE,traverseReadonlyNonEmptyArrayWithIndex:L0},Symbol.toStringTag,{value:"Module"}));var B3=yf(Go),P3=zu(Go),W3=bf(At),jfe=Cf(At),N3=io,KA=W3,K3=$A(At),Lfe=K3,EE=If(Br),Dfe=EE,q3=EE,Ufe=q3,V3=Ef(Br),Bfe=V3,z3=function(e,t){return function(){return Vu(e,t)}},Pfe=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return z3(function(){return e.apply(void 0,n)},t)}},Wfe=MA(At),Q3=Hu(Br),Nfe=Q3,RE=kA(Br),Kfe=RE,qfe=function(e){return RE(i5(e))},Vfe=OA(Br),zfe=Rf(At),Pr=function(e,t){return x(e,OE(t))},Xu=function(e,t){return x(e,ME(t))},Qfe=function(e,t){return x(e,D0(function(n){return x(t,OE(n))}))},jf=function(e,t){return x(e,D0(t))},$E=function(e,t,n){return x(e,Y3(t,n))},kE=function(e,t){return x(e,G3(t))},H3=function(e,t){return x(e,FE(t))},OE=Sf(At),Y3=xf(At),G3=Tf(At),ME=wf(Va),Hfe=ME,ji=P3,D0=Qu(Br),dv=D0,J3=dv(Q),Yfe=J3,FE=_f(Br),Gfe=FE,U0=B3,rn="IOEither";function Z3(e){var t=Ra(Va,il(e));return{URI:rn,_E:void 0,map:Pr,ap:function(n,r){return x(n,t(r))},of:ji}}function X3(e){var t=RA(Br,e);return{URI:rn,_E:void 0,map:Pr,alt:function(n,r){return x(n,t(r))}}}var e5=function(e){var t=Ku(e);return{URI:rn,_E:void 0,compact:qo(At,t),separate:La(At,t,ol)}};function Jfe(e){var t=mf(e),n=e5(e),r=Da(At,t),i=Ua(At,t),o=sl(At,t),a=ll(At,t);return{URI:rn,_E:void 0,map:Pr,compact:n.compact,separate:n.separate,filter:function(s,l){return x(s,r(l))},filterMap:function(s,l){return x(s,i(l))},partition:function(s,l){return x(s,o(l))},partitionMap:function(s,l){return x(s,a(l))}}}var jE={URI:rn,map:Pr},Zfe=He(jE),Xfe={URI:rn,of:ji},epe={URI:rn,bimap:$E,mapLeft:kE},qA={URI:rn,map:Pr,ap:Xu},t5=qt(qA),tpe=t5,n5=Vt(qA),npe=n5,LE={URI:rn,map:Pr,ap:Xu,of:ji},rpe={URI:rn,map:Pr,ap:Qfe,of:ji},za={URI:rn,map:Pr,ap:Xu,chain:jf},ipe={URI:rn,map:Pr,ap:Xu,of:ji,chain:jf},r5=vt(za),ope=r5,ape={URI:rn,map:Pr,alt:H3},spe={URI:rn,map:Pr,ap:Xu,of:ji,chain:jf,fromIO:KA},lpe={URI:rn,map:Pr,ap:Xu,of:ji,chain:jf,throwError:U0},B0={URI:rn,fromIO:KA},i5=zo(B0),upe=Ba(B0,za),cpe=Pa(B0,za),Qa={URI:rn,fromEither:N3},dpe=Po(Qa),fpe=Wo(Qa),ppe=Ou(Qa,za),o5=$a(Qa,za),hpe=o5,a5=ka(Qa,za),Ape=a5,mpe=Gs(Qa),s5=Mu(Qa,za),gpe=s5,vpe=di(Qa),ype=function(e,t,n){return l5(e,t,n)},l5=function(e,t,n){return x(e,dv(function(r){return x(t(r),xE(function(i){return x(n(r,i),dv(function(){return io(i)}))}))}))},bpe=ji(gn),Cpe=Qt(jE),u5=Ht(za),Spe=u5,c5=zt(qA),wpe=c5,DE=ji(Ln),d5=function(e){return X(L0(e),Yo(EA(Ur)))},UE=function(e){var t=d5(e);return function(n){return Tt(n)?t(n):DE}},f5=function(e){return function(t){return function(){var n=e(0,ci(t))();if(hn(n))return n;for(var r=[n.right],i=1;i<t.length;i++){var o=e(i,t[i])();if(hn(o))return o;r.push(o.right)}return Ys(r)}}},BE=function(e){var t=f5(e);return function(n){return Tt(n)?t(n):DE}},_pe=UE,p5=function(e){return UE(function(t,n){return e(n)})},xpe=p5(Q),Tpe=BE,h5=function(e){return BE(function(t,n){return e(n)})},Ipe=h5(Q),Epe=LE,Rpe={URI:rn,bimap:$E,mapLeft:kE,map:Pr,of:ji,ap:Xu,chain:jf,alt:H3,fromIO:KA,throwError:U0},$pe=vn(qA),kpe=$i(LE),Ope=function(e){return vn(Va)(_A(e))};function Mpe(e){var t=Z3(e),n=X3(e);return{URI:rn,_E:void 0,map:Pr,ap:t.ap,of:ji,chain:jf,bimap:$E,mapLeft:kE,alt:n.alt,fromIO:KA,throwError:U0}}const Fpe=Object.freeze(Object.defineProperty({__proto__:null,Alt:ape,ApT:DE,Applicative:Epe,ApplicativePar:LE,ApplicativeSeq:rpe,ApplyPar:qA,Bifunctor:epe,Chain:za,Do:bpe,FromEither:Qa,FromIO:B0,Functor:jE,Monad:ipe,MonadIO:spe,MonadThrow:lpe,Pointed:Xfe,URI:rn,alt:FE,altW:Gfe,ap:ME,apFirst:t5,apFirstW:tpe,apS:c5,apSW:wpe,apSecond:n5,apSecondW:npe,apW:Hfe,bimap:Y3,bind:u5,bindTo:Cpe,bindW:Spe,bracket:ype,bracketW:l5,chain:D0,chainEitherK:o5,chainEitherKW:hpe,chainFirst:r5,chainFirstEitherK:a5,chainFirstEitherKW:Ape,chainFirstIOK:cpe,chainFirstW:ope,chainIOK:upe,chainOptionK:ppe,chainW:dv,filterOrElse:s5,filterOrElseW:gpe,flap:Zfe,flatten:Yfe,flattenW:J3,fold:Dfe,foldW:Ufe,fromEither:N3,fromEitherK:vpe,fromIO:KA,fromIOK:i5,fromOption:dpe,fromOptionK:fpe,fromPredicate:mpe,getAltIOValidation:X3,getApplicativeIOValidation:Z3,getApplyMonoid:kpe,getApplySemigroup:$pe,getCompactable:e5,getFilterable:Jfe,getIOValidation:Mpe,getOrElse:V3,getOrElseW:Bfe,getSemigroup:Ope,ioEither:Rpe,left:B3,leftIO:jfe,map:OE,mapLeft:G3,match:K3,matchE:EE,matchEW:q3,matchW:Lfe,of:ji,orElse:Q3,orElseFirst:RE,orElseFirstIOK:qfe,orElseFirstW:Kfe,orElseW:Nfe,orLeft:Vfe,right:P3,rightIO:W3,sequenceArray:xpe,sequenceSeqArray:Ipe,swap:zfe,throwError:U0,toUnion:Wfe,traverseArray:p5,traverseArrayWithIndex:_pe,traverseReadonlyArrayWithIndex:UE,traverseReadonlyArrayWithIndexSeq:BE,traverseReadonlyNonEmptyArrayWithIndex:d5,traverseReadonlyNonEmptyArrayWithIndexSeq:f5,traverseSeqArray:h5,traverseSeqArrayWithIndex:Tpe,tryCatch:z3,tryCatchK:Pfe},Symbol.toStringTag,{value:"Module"}));function VA(e){return X(jt,e.of)}function zA(e){return Dr(e.of(ft))}function P0(e){return function(t){return e.map(t,jt)}}function W0(e){return X(Pu,e.of)}function N0(e){var t=W0(e);return function(n){return X(n,t)}}function PE(e){var t=Lf(e),n=N0(e);return function(r){return t(n(r))}}function K0(e){return function(t){return X(t,e.of)}}function WE(e){var t=Lf(e),n=K0(e);return function(r){return t(n(r))}}function NE(e){return function(t){return function(n){return e.of(m0(t)(n))}}}function KE(e){return X(pf,e.of)}function qE(e){return function(t,n){return function(r){return e.map(r,ja(t,n))}}}function q0(e){return function(t,n){return function(r){return e.chain(r,ja(t,n))}}}function V0(e){return function(t){return function(n){return e.chain(n,ja(t,e.of))}}}function z0(e){return Kd(e,uf)}function Q0(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 H0(e){var t=VA(e);return function(n){return function(r){return e.chain(r,ja(n,t))}}}function jpe(e){var t=Q0(e),n=z0(e),r=Lf(e),i=H0(e),o=q0(e),a=V0(e),s=zA(e);return{map:function(l,u){return x(l,n(u))},ap:function(l,u){return x(l,t(u))},of:VA(e),chain:function(l,u){return x(l,r(u))},alt:function(l,u){return x(l,i(u))},fold:function(l,u,c){return x(l,o(u,c))},getOrElse:function(l,u){return x(l,a(u))},fromM:P0(e),none:function(){return s()}}}const Lpe=Object.freeze(Object.defineProperty({__proto__:null,alt:H0,ap:Q0,chain:Lf,chainNullableK:PE,chainOptionK:WE,fromEither:KE,fromF:P0,fromNullable:W0,fromNullableK:N0,fromOptionK:K0,fromPredicate:NE,getOptionM:jpe,getOrElse:V0,map:z0,match:qE,matchE:q0,some:VA,zero:zA},Symbol.toStringTag,{value:"Module"}));var A5=VA(Go),Dpe=NE(Go),Upe=io,m5=KE(Go),VE=P0(At),Bpe=Yo(pf),g5=qE(At),Ppe=g5,zE=q0(j0),Wpe=zE,Npe=zE,v5=V0(Br),Kpe=v5,qpe=Yo(NN),Vpe=Yo(UI),zpe=W0(Go),Qpe=N0(Go),Hpe=PE(Br),Ype=K0(Go),Gpe=WE(Br),y5=z0(At),b5=Q0(Va),dl=A5,QE=Lf(Br),Jpe=QE(Q),HE=H0(Br),Zpe=HE,Y0=zA(Go),Xpe=Y0(),YE=qo(At,Bu),GE=La(At,Bu,uf),C5=Da(At,Fa),S5=Ua(At,Fa),w5=sl(At,Fa),_5=ll(At,Fa),Ha=function(e,t){return x(e,y5(t))},Df=function(e,t){return x(e,b5(t))},JE=function(e,t){return x(e,QE(t))},x5=function(e,t){return x(e,HE(t))},ehe=function(e,t){return x(e,C5(t))},the=function(e,t){return x(e,S5(t))},nhe=function(e,t){return x(e,w5(t))},rhe=function(e,t){return x(e,_5(t))},Wr="IOOption",ZE={URI:Wr,map:Ha},ihe=He(ZE),T5={URI:Wr,of:dl},G0={URI:Wr,map:Ha,ap:Df},ohe=qt(G0),ahe=Vt(G0),she={URI:Wr,map:Ha,ap:Df,of:dl},ec={URI:Wr,map:Ha,ap:Df,chain:JE},lhe=vt(ec),uhe={URI:Wr,map:Ha,alt:x5},I5={URI:Wr,zero:Y0},che=Gd(I5,T5),dhe={URI:Wr,map:Ha,ap:Df,of:dl,alt:x5,zero:Y0},fhe={URI:Wr,map:Ha,ap:Df,of:dl,chain:JE},phe={URI:Wr,map:Ha,ap:Df,of:dl,chain:JE,fromIO:VE},hhe={URI:Wr,compact:YE,separate:GE},Ahe={URI:Wr,map:Ha,compact:YE,separate:GE,filter:ehe,filterMap:the,partition:nhe,partitionMap:rhe},J0={URI:Wr,fromIO:VE},mhe=zo(J0),ghe=Ba(J0,ec),vhe=Pa(J0,ec),Z0={URI:Wr,fromEither:m5},yhe=di(Z0),bhe=$a(Z0,ec),Che=ka(Z0,ec),She=dl(gn),whe=Qt(ZE),_he=Ht(ec),xhe=zt(G0),E5=dl(Ln),R5=function(e){return X(L0(e),Yo(x0(Ur)))},The=function(e){var t=R5(e);return function(n){return Tt(n)?t(n):E5}};const Ihe=Object.freeze(Object.defineProperty({__proto__:null,Alt:uhe,Alternative:dhe,ApT:E5,Applicative:she,Apply:G0,Chain:ec,Compactable:hhe,Do:She,Filterable:Ahe,FromEither:Z0,FromIO:J0,Functor:ZE,Monad:fhe,MonadIO:phe,Pointed:T5,Zero:I5,alt:HE,altW:Zpe,ap:b5,apFirst:ohe,apS:xhe,apSecond:ahe,bind:_he,bindTo:whe,chain:QE,chainEitherK:bhe,chainFirst:lhe,chainFirstEitherK:Che,chainFirstIOK:vhe,chainIOK:ghe,chainNullableK:Hpe,chainOptionK:Gpe,compact:YE,filter:C5,filterMap:S5,flap:ihe,flatten:Jpe,fold:Wpe,fromEither:m5,fromEitherK:yhe,fromIO:VE,fromIOEither:Bpe,fromIOK:mhe,fromNullable:zpe,fromNullableK:Qpe,fromOption:Upe,fromOptionK:Ype,fromPredicate:Dpe,getOrElse:v5,getOrElseW:Kpe,guard:che,map:y5,match:g5,matchE:zE,matchEW:Npe,matchW:Ppe,none:Xpe,of:dl,partition:w5,partitionMap:_5,separate:GE,some:A5,toNullable:Vpe,toUndefined:qpe,traverseReadonlyArrayWithIndex:The,traverseReadonlyNonEmptyArrayWithIndex:R5,zero:Y0},Symbol.toStringTag,{value:"Module"}));var $5=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 Ehe(e){return function(){return new $5(e)}}const Rhe=Object.freeze(Object.defineProperty({__proto__:null,IORef:$5,newIORef:Ehe},Symbol.toStringTag,{value:"Module"})),$he=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var khe=function(e){return Vu(function(){return JSON.parse(e)},Q)},Ohe=function(e){return Vu(function(){var t=JSON.stringify(e);if(typeof t!="string")throw new Error("Converting unsupported structure to JSON");return t},Q)};const Mhe=Object.freeze(Object.defineProperty({__proto__:null,parse:khe,stringify:Ohe},Symbol.toStringTag,{value:"Module"})),Fhe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var jhe=function(e){return new Map(e)};function Lhe(e){return new Map(e)}function k5(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 O5=function(e){return e.size},Mo=function(e){return e.size===0};function X0(e){var t=tc(e);return function(n,r){if(r===void 0){var i=X0(e);return function(o){return i(n,o)}}return Ft(t(n,r))}}function XE(e){return function(t,n){if(n===void 0){var r=XE(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)}},Dhe=function(e){return function(t){return Array.from(t.values()).sort(e.compare)}};function M5(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 l=s[a];i.push(n(l,r.get(l)))}return i}}}var F5=function(e){return M5(e)(function(t,n){return[t,n]})};function Uhe(e,t){var n=F5(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 j5=function(e){var t=Ya(e);return function(n,r){var i=t(n);return function(o){var a=i(o);if(tn(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}}},L5=function(e){var t=Ya(e);return function(n){return function(r){var i=t(n,r);if(Ft(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},Bhe=function(e){var t=D5(e);return function(n,r){return t(n,function(){return r})}},D5=function(e){var t=Ya(e);return function(n,r){return function(i){var o=t(n,i);if(tn(o))return Re;var a=o.value,s=a[0],l=a[1],u=r(l);if(u===l)return ye(i);var c=new Map(i);return c.set(s,u),ye(c)}}};function Phe(e){var t=tc(e),n=L5(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(u){return r(t,u)}}for(var i=n.entries(),o;!(o=i.next()).done;){var a=o.value,s=a[0],l=a[1];if(e.equals(s,t))return ye([s,l])}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 eb(e,t){var n=Ya(e);return function(r,i){if(i===void 0){var o=eb(e,t);return function(p){return o(p,r)}}for(var a=r.entries(),s;!(s=a.next()).done;){var l=s.value,u=l[0],c=l[1],f=n(u,i);if(tn(f)||!e.equals(u,f.value[0])||!t.equals(c,f.value[1]))return!1}return!0}}var tb=new Map;function U5(e,t){var n=eb(e,t);return ki(function(r,i){return n(r,i)&&n(i,r)})}function Whe(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 l=s.value,u=l[0],c=l[1],f=n(u,r);Ft(f)?o.set(f.value[0],t.concat(f.value[1],c)):o.set(u,c)}return o},empty:tb}}var Nhe=function(e,t){return new Map([[e,t]])};function Khe(e,t,n){return function(r){var i=Ya(e);return n.reduce(r,new Map,function(o,a){var s=a[0],l=a[1],u=i(s,o);return Ft(u)?o.set(u.value[0],t.concat(u.value[1],l)):o.set(s,l),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},B5=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],l=a[1],u=e(s,l);hn(u)?n.set(s,u.left):r.set(s,u.right)}return Be(n,r)}};function P5(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],l=a[1];e(s,l)?r.set(s,l):n.set(s,l)}return Be(n,r)}}var W5=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],l=e(a,s);Ft(l)&&n.set(a,l.value)}return n}};function N5(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 K5(e,function(n,r){return t(r)})},HA=function(e,t){return q5(e,function(n,r){return t(r)})},YA=function(e,t){return V5(e,function(n,r){return t(r)})},GA=function(e,t){return z5(e,function(n,r){return t(r)})},K5=function(e,t){return x(e,N5(t))},q5=function(e,t){return x(e,W5(t))},V5=function(e,t){return x(e,P5(t))},z5=function(e,t){return x(e,B5(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];Ft(a)&&t.set(o,a.value)}return t},qhe=function(e){return function(t){return QA(t,e)}},Vhe=function(e){return function(t){return HA(t,e)}},zhe=function(e){return function(t){return Ga(t,e)}},Qhe=function(e){return function(t){return Bf(t,e)}},Hhe=function(e){return function(t){return YA(t,e)}},Yhe=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];hn(s)?t.set(a,s.left):n.set(a,s.right)}return Be(t,n)},Li="ReadonlyMap",Q5=function(e,t){var n=oR(e,t);return{concat:function(r,i){return n(i)(r)}}},Ghe=function(e,t){return{concat:Q5(e,t).concat,empty:tb}},Jhe=function(e,t){var n=aR(e,t);return{concat:function(r,i){return n(i)(r)}}},Zhe=function(e){return function(){var t=sR(e);return{concat:function(n,r){return t(r)(n)}}}};function Xhe(){return{URI:Li,_E:void 0,map:Ga,mapWithIndex:Bf,compact:Pf,separate:Wf,filter:QA,filterMap:HA,partition:YA,partitionMap:GA,partitionMapWithIndex:z5,partitionWithIndex:V5,filterMapWithIndex:q5,filterWithIndex:K5}}var H5={URI:Li,map:Ga},eAe=He(H5),tAe=function(){return{URI:Li,_E:void 0,map:Ga,mapWithIndex:Bf}},$w={URI:Li,compact:Pf,separate:Wf},nAe={URI:Li,map:Ga,compact:Pf,separate:Wf,filter:QA,filterMap:HA,partition:YA,partitionMap:GA},eR=function(e){var t=rb(e);return function(n,r){return t(n,function(i,o,a){return r(o,a)})}},tR=function(e){var t=ib(e);return function(n){var r=t(n);return function(i){return r(function(o,a){return i(a)})}}},nR=function(e){var t=ob(e);return function(n,r){return t(n,function(i,o,a){return r(o,a)})}},nb=function(e){var t=eR(e),n=tR(e),r=nR(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))}}},rb=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 l=s[a];o=r(l,o,i.get(l))}return o}}},ib=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 l=s[a];o=n.concat(o,r(l,i.get(l)))}return o}}}},ob=function(e){var t=Uf(e);return function(n,r){return function(i){for(var o=n,a=t(i),s=a.length,l=s-1;l>=0;l--){var u=a[l];o=r(u,i.get(u),o)}return o}}},rR=function(e){var t=nb(e),n=rb(e),r=ib(e),i=ob(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,l){return x(s,a(l))}},reduceRightWithIndex:function(o,a,s){return x(o,i(a,s))}}},rAe=function(e){var t=iR(e),n=nb(e);return{URI:Li,_E:void 0,map:Ga,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:t.traverse,sequence:t.sequence}},iR=function(e){var t=rR(e),n=Uf(e),r=function(a){return function(s,l){for(var u=a.of(new Map),c=n(s),f=c.length,p=function(m){var g=c[m],y=s.get(g);u=a.ap(a.map(u,function(C){return function(_){return C.set(g,_)}}),l(g,y))},h=0;h<f;h++)p(h);return u}},i=function(a){var s=r(a);return function(l,u){return s(l,function(c,f){return u(f)})}},o=function(a){var s=r(a);return function(l){return s(l,Ur)}};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 iAe(e){var t=iR(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,$w),wither:ro(t,$w)}}var oR=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 l=s.value,u=l[0],c=l[1],f=n(u)(r);Ft(f)?o.set(u,t.concat(c,f.value)):o.set(u,c)}for(var p=r.entries();!(s=p.next()).done;){var h=s.value,u=h[0],c=h[1],f=n(u)(o);tn(f)&&o.set(u,c)}return o}}},aR=function(e,t){var n=tc(e);return function(r){return function(i){if(Mo(i)||Mo(r))return tb;for(var o=new Map,a=i.entries(),s;!(s=a.next()).done;){var l=s.value,u=l[0],c=l[1],f=n(u)(r);Ft(f)&&o.set(u,t.concat(c,f.value))}return o}}},sR=function(e){var t=X0(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,l=s[0],u=s[1];t(l)(n)||i.set(l,u)}for(var c=n.entries();!(a=c.next()).done;){var f=a.value,l=f[0],u=f[1];t(l)(r)||i.set(l,u)}return i}}},oAe=j5,aAe={URI:Li,map:Ga,compact:Pf,separate:Wf,filter:QA,filterMap:HA,partition:YA,partitionMap:GA};const sAe=Object.freeze(Object.defineProperty({__proto__:null,Compactable:$w,Filterable:nAe,Functor:H5,URI:Li,collect:M5,compact:Pf,deleteAt:L5,difference:sR,elem:XE,empty:tb,filter:qhe,filterMap:Vhe,filterMapWithIndex:W5,filterWithIndex:N5,flap:eAe,foldMap:tR,foldMapWithIndex:ib,fromFoldable:Khe,fromMap:jhe,getDifferenceMagma:Zhe,getEq:U5,getFilterableWithIndex:Xhe,getFoldable:nb,getFoldableWithIndex:rR,getFunctorWithIndex:tAe,getIntersectionSemigroup:Jhe,getMonoid:Whe,getShow:k5,getTraversable:rAe,getTraversableWithIndex:iR,getUnionMonoid:Ghe,getUnionSemigroup:Q5,getWitherable:iAe,insertAt:oAe,intersection:aR,isEmpty:Mo,isSubmap:eb,keys:Uf,lookup:tc,lookupWithKey:Ya,map:zhe,mapWithIndex:Qhe,member:X0,modifyAt:D5,partition:Hhe,partitionMap:Yhe,partitionMapWithIndex:B5,partitionWithIndex:P5,pop:Phe,readonlyMap:aAe,reduce:eR,reduceRight:nR,reduceRightWithIndex:ob,reduceWithIndex:rb,separate:Wf,singleton:Nhe,size:O5,toMap:Lhe,toReadonlyArray:F5,toUnfoldable:Uhe,union:oR,updateAt:Bhe,upsertAt:j5,values:Dhe},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)},lAe=k5,uAe=O5,Sa=Mo,cAe=X0,dAe=XE,lR=function(e){return function(t){return Array.from(t.keys()).sort(e.compare)}},fAe=function(e){return function(t){return Array.from(t.values()).sort(e.compare)}};function Y5(e){var t=lR(e);return function(n){return function(r){for(var i=[],o=t(r),a=0,s=o;a<s.length;a++){var l=s[a];i.push(n(l,r.get(l)))}return i}}}function G5(e){return Y5(e)(function(t,n){return[t,n]})}function pAe(e,t){var n=G5(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 J5=function(e){var t=nc(e);return function(n,r){var i=t(n);return function(o){var a=i(o);if(tn(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}}},Z5=function(e){var t=nc(e);return function(n){return function(r){var i=t(n,r);if(Ft(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},hAe=function(e){var t=X5(e);return function(n,r){return t(n,function(){return r})}},X5=function(e){var t=nc(e);return function(n,r){return function(i){var o=t(n,i);if(tn(o))return Re;var a=new Map(i);return a.set(o.value[0],r(o.value[1])),ye(a)}}};function AAe(e){var t=e6(e),n=Z5(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(u){return r(t,u)}}for(var i=n.entries(),o;!(o=i.next()).done;){var a=o.value,s=a[0],l=a[1];if(e.equals(s,t))return ye([s,l])}return Re}}var e6=tc,mAe=eb,gAe=U5;function vAe(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 l=s.value,u=l[0],c=l[1],f=n(u,r);Ft(f)?o.set(f.value[0],t.concat(f.value[1],c)):o.set(u,c)}return o},empty:new Map}}var yAe=function(e,t){return new Map([[e,t]])};function bAe(e,t,n){return function(r){var i=nc(e);return n.reduce(r,new Map,function(o,a){var s=a[0],l=a[1],u=i(s,o);return Ft(u)?o.set(u.value[0],t.concat(u.value[1],l)):o.set(s,l),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},t6=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],l=a[1],u=e(s,l);hn(u)?n.set(s,u.left):r.set(s,u.right)}return Be(n,r)}};function n6(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],l=a[1];e(s,l)?r.set(s,l):n.set(s,l)}return Be(n,r)}}var r6=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],l=e(a,s);Ft(l)&&n.set(a,l.value)}return n}};function i6(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)})},ab=function(e,t){return o6(e,function(n,r){return t(r)})},sb=function(e,t){return a6(e,function(n,r){return t(r)})},lb=function(e,t){return s6(e,function(n,r){return t(r)})},ub=function(e,t){return l6(e,function(n,r){return t(r)})},o6=function(e,t){return x(e,i6(t))},a6=function(e,t){return x(e,r6(t))},s6=function(e,t){return x(e,n6(t))},l6=function(e,t){return x(e,t6(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];Ft(a)&&t.set(o,a.value)}return t},CAe=function(e){return function(t){return ab(t,e)}},SAe=function(e){return function(t){return sb(t,e)}},wAe=function(e){return function(t){return Nf(t,e)}},_Ae=function(e){return function(t){return JA(t,e)}},xAe=function(e){return function(t){return lb(t,e)}},TAe=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];hn(s)?t.set(a,s.left):n.set(a,s.right)}return Be(t,n)},Ja="Map",u6=function(e,t){var n=h6(e,t);return{concat:function(r,i){return n(i)(r)}}},IAe=function(e,t){return{concat:u6(e,t).concat,empty:new Map}},EAe=function(e,t){var n=A6(e,t);return{concat:function(r,i){return n(i)(r)}}},RAe=function(e){return function(){var t=m6(e);return{concat:function(n,r){return t(r)(n)}}}};function $Ae(){return{URI:Ja,_E:void 0,map:Nf,mapWithIndex:JA,compact:ZA,separate:XA,filter:ab,filterMap:sb,partition:lb,partitionMap:ub,partitionMapWithIndex:l6,partitionWithIndex:s6,filterMapWithIndex:a6,filterWithIndex:o6}}function kAe(e){var t=d6(e);return{URI:Ja,_E:void 0,map:Nf,compact:ZA,separate:XA,filter:ab,filterMap:sb,partition:lb,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,kw),wither:ro(t,kw)}}var OAe=eR,MAe=tR,FAe=nR,jAe=function(e){return hd(hd({},nb(e)),{URI:Ja})},LAe=rb,DAe=ib,UAe=ob,c6=function(e){return hd(hd({},rR(e)),{URI:Ja})},d6=function(e){var t=c6(e),n=lR(e),r=function(a){return function(s,l){for(var u=a.of(new Map),c=n(s),f=c.length,p=function(m){var g=c[m],y=s.get(g);u=a.ap(a.map(u,function(C){return function(_){return C.set(g,_)}}),l(g,y))},h=0;h<f;h++)p(h);return u}},i=function(a){var s=r(a);return function(l,u){return s(l,function(c,f){return u(f)})}},o=function(a){var s=r(a);return function(l){return s(l,function(u,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}},f6={URI:Ja,map:Nf},BAe=He(f6),kw={URI:Ja,compact:ZA,separate:XA},p6={URI:Ja,map:Nf,compact:ZA,separate:XA,filter:ab,filterMap:sb,partition:lb,partitionMap:ub},fv=function(e){return new Map(e)},h6=function(e,t){var n=oR(e,t);return function(r){return function(i){return Sa(i)?fv(r):Sa(r)?fv(i):n(r)(i)}}},A6=function(e,t){var n=aR(e,t);return function(r){return function(i){return Sa(i)||Sa(r)?new Map:n(r)(i)}}},m6=function(e){var t=sR(e);return function(n){return function(r){return Sa(r)?fv(n):Sa(n)?fv(r):t(n)(r)}}},PAe=new Map,WAe=J5,NAe=p6;const KAe=Object.freeze(Object.defineProperty({__proto__:null,Compactable:kw,Filterable:p6,Functor:f6,URI:Ja,collect:Y5,compact:ZA,deleteAt:Z5,difference:m6,elem:dAe,empty:PAe,filter:CAe,filterMap:SAe,filterMapWithIndex:r6,filterWithIndex:i6,flap:BAe,foldMap:MAe,foldMapWithIndex:DAe,fromFoldable:bAe,getDifferenceMagma:RAe,getEq:gAe,getFilterableWithIndex:$Ae,getFoldable:jAe,getFoldableWithIndex:c6,getIntersectionSemigroup:EAe,getMonoid:vAe,getShow:lAe,getTraversableWithIndex:d6,getUnionMonoid:IAe,getUnionSemigroup:u6,getWitherable:kAe,insertAt:WAe,intersection:A6,isEmpty:Sa,isSubmap:mAe,keys:lR,lookup:e6,lookupWithKey:nc,map:wAe,mapWithIndex:_Ae,map_:NAe,member:cAe,modifyAt:X5,partition:xAe,partitionMap:TAe,partitionMapWithIndex:t6,partitionWithIndex:n6,pop:AAe,reduce:OAe,reduceRight:FAe,reduceRightWithIndex:UAe,reduceWithIndex:LAe,separate:XA,singleton:yAe,size:uAe,toArray:G5,toUnfoldable:pAe,union:h6,updateAt:hAe,upsertAt:J5,values:fAe},Symbol.toStringTag,{value:"Module"})),qAe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),VAe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),zAe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),QAe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),HAe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var g6=function(e){return{concat:yy(e).concat,empty:e.top}},v6=function(e){return{concat:by(e).concat,empty:e.bottom}},uR=function(e){return{concat:Cx(e).concat,empty:e.empty}},y6=function(e){var t={};for(var n in e)gt.call(e,n)&&(t[n]=e[n].empty);return{concat:Sx(e).concat,empty:t}},b6=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{concat:wx.apply(uB,e).concat,empty:e.map(function(n){return n.empty})}},C6=function(e){return xx(e)(e.empty)},YAe={concat:rB.concat,empty:void 0},GAe=b6,JAe=y6,ZAe=uR,XAe=v6,eme=g6,tme=C6,S6={concat:iB.concat,empty:!0},w6={concat:oB.concat,empty:!1},nme=OU,rme=function(){return uR(jK())},ime={concat:aB.concat,empty:""},ome={concat:sB.concat,empty:0},ame={concat:lB.concat,empty:1};const sme=Object.freeze(Object.defineProperty({__proto__:null,concatAll:C6,fold:tme,getDualMonoid:ZAe,getEndomorphismMonoid:rme,getFunctionMonoid:nme,getJoinMonoid:XAe,getMeetMonoid:eme,getStructMonoid:JAe,getTupleMonoid:GAe,max:v6,min:g6,monoidAll:S6,monoidAny:w6,monoidProduct:ame,monoidString:ime,monoidSum:ome,monoidVoid:YAe,reverse:uR,struct:y6,tuple:b6},Symbol.toStringTag,{value:"Module"})),lme=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var _6=function(e,t,n){return function(r){return r===-1?e():r===0?t():n()}},ume=_6,x6=function(e){return e===-1?1:e===1?-1:0},T6={equals:function(e,t){return e===t}},cR={concat:function(e,t){return e!==0?e:t}},I6={concat:cR.concat,empty:0},cme=function(e){return e<=-1?-1:e>=1?1:0},dme=x6,fme=cR,pme=T6,hme=I6;const Ame=Object.freeze(Object.defineProperty({__proto__:null,Eq:T6,Monoid:I6,Semigroup:cR,eqOrdering:pme,invert:dme,match:ume,matchW:_6,monoidOrdering:hme,reverse:x6,semigroupOrdering:fme,sign:cme},Symbol.toStringTag,{value:"Module"}));var mme=function(e){return typeof e.map=="function"},gme=function(e){return typeof e.contramap=="function"},vme=function(e){return typeof e.mapWithIndex=="function"},yme=function(e){return typeof e.ap=="function"},bme=function(e){return typeof e.chain=="function"},Cme=function(e){return typeof e.bimap=="function"},Sme=function(e){return typeof e.extend=="function"},wme=function(e){return typeof e.reduce=="function"},_me=function(e){return typeof e.reduceWithIndex=="function"},xme=function(e){return typeof e.alt=="function"},Tme=function(e){return typeof e.compact=="function"},Ime=function(e){return typeof e.filter=="function"},Eme=function(e){return typeof e.filterWithIndex=="function"},Rme=function(e){return typeof e.promap=="function"},$me=function(e){return typeof e.compose=="function"},kme=function(e){return typeof e.throwError=="function"};function Ome(e){var t={};if(mme(e)){var n=function(F){return function(M){return e.map(M,F)}};t.map=n}if(gme(e)){var r=function(F){return function(M){return e.contramap(M,F)}};t.contramap=r}if(vme(e)){var i=function(F){return function(M){return e.mapWithIndex(M,F)}};t.mapWithIndex=i}if(yme(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(bme(e)){var s=function(F){return function(M){return e.chain(M,F)}},l=function(F){return function(M){return e.chain(M,function(W){return e.map(F(W),function(){return W})})}},u=function(F){return e.chain(F,Q)};t.chain=s,t.chainFirst=l,t.flatten=u}if(Cme(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(Sme(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(wme(e)){var m=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=m,t.foldMap=g,t.reduceRight=y}if(_me(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(xme(e)){var v=function(F){return function(M){return e.alt(M,F)}};t.alt=v}if(Tme(e)&&(t.compact=e.compact,t.separate=e.separate),Ime(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(Eme(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(Rme(e)){var K=function(F,M){return function(W){return e.promap(W,F,M)}};t.promap=K}if($me(e)){var H=function(F){return function(M){return e.compose(M,F)}};t.compose=H}if(kme(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 Mme=Object.freeze(Object.defineProperty({__proto__:null,pipe:ge,pipeable:Ome},Symbol.toStringTag,{value:"Module"})),Fme=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),jme=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var cb=function(){return Math.random()};function E6(e,t){return x(cb,Yo(function(n){return Math.floor((t-e+1)*n+e)}))}function Lme(e,t){return x(cb,Yo(function(n){return(t-e)*n+e}))}var Dme=x(cb,Yo(function(e){return e<.5})),Ume=function(e){return x(E6(0,e.length-1),Yo(function(t){return e[t]}))};const Bme=Object.freeze(Object.defineProperty({__proto__:null,random:cb,randomBool:Dme,randomElem:Ume,randomInt:E6,randomRange:Lme},Symbol.toStringTag,{value:"Module"}));var dR=yf(lE),R6=zu(lE),$6=bf(On),Pme=Cf(On),k6=Qo,O6=$6,M6=$A(On),Wme=M6,fR=If(Ka),Nme=fR,F6=fR,Kme=F6,j6=Ef(Ka),qme=j6,Vme=MA(On),zme=FA,L6=jA,Qme=L6,D6=Hu(Ka),Hme=D6,U6=kA(Ka),Yme=U6,Gme=OA(Ka),Jme=Rf(On),Di=function(e,t){return x(e,P6(t))},pR=function(e,t,n){return x(e,W6(t,n))},hR=function(e,t){return x(e,N6(t))},Kf=function(e,t){return x(e,AR(t))},em=function(e,t){return x(e,mR(t))},B6=function(e,t){return x(e,gR(t))},P6=Sf(On),W6=xf(On),N6=Tf(On),AR=wf(Na),Zme=AR,Jo=R6,mR=Qu(Ka),K6=mR,q6=K6(Q),Xme=q6,gR=_f(Ka),ege=gR,vR=dR,yn="ReaderEither",V6=function(e){var t=Ku(e);return{URI:yn,_E:void 0,compact:qo(On,t),separate:La(On,t,ol)}};function tge(e){var t=mf(e),n=V6(e),r=Da(On,t),i=Ua(On,t),o=sl(On,t),a=ll(On,t);return{URI:yn,_E:void 0,map:Di,compact:n.compact,separate:n.separate,filter:function(s,l){return x(s,r(l))},filterMap:function(s,l){return x(s,i(l))},partition:function(s,l){return x(s,o(l))},partitionMap:function(s,l){return x(s,a(l))}}}function z6(e){var t=Ra(Na,il(e));return{URI:yn,_E:void 0,map:Di,ap:function(n,r){return x(n,t(r))},of:Jo}}function Q6(e){var t=RA(Ka,e);return{URI:yn,_E:void 0,map:Di,alt:function(n,r){return x(n,t(r))}}}var yR={URI:yn,map:Di},nge=He(yR),rge={URI:yn,of:Jo},tm={URI:yn,map:Di,ap:Kf},H6=qt(tm),ige=H6,Y6=Vt(tm),oge=Y6,G6={URI:yn,map:Di,ap:Kf,of:Jo},Za={URI:yn,map:Di,ap:Kf,chain:em},age={URI:yn,map:Di,ap:Kf,of:Jo,chain:em},J6=vt(Za),sge=J6,lge={URI:yn,bimap:pR,mapLeft:hR},uge={URI:yn,map:Di,alt:B6},qf={URI:yn,fromReader:O6},cge=DA(qf),dge=UA(qf),fge=Ju(qf),Z6=BA(qf,Za),pge=Z6,X6=PA(qf,Za),hge=X6,Age={URI:yn,map:Di,ap:Kf,of:Jo,chain:em,throwError:vR},Xa={URI:yn,fromEither:k6},mge=Po(Xa),gge=Wo(Xa),vge=Ou(Xa,Za),e4=$a(Xa,Za),yge=e4,t4=ka(Xa,Za),bge=t4,Cge=Gs(Xa),n4=Mu(Xa,Za),Sge=n4,wge=di(Xa),_ge=Jo(gn),xge=Qt(yR),r4=Ht(Za),Tge=r4,i4=zt(tm),Ige=i4,o4=Jo(Ln),a4=function(e){return X(Gu(e),Yu(EA(Ur)))},bR=function(e){var t=a4(e);return function(n){return Tt(n)?t(n):o4}},Ege=bR,s4=function(e){return bR(function(t,n){return e(n)})},Rge=s4(Q),$ge={URI:yn,bimap:pR,mapLeft:hR,map:Di,of:Jo,ap:Kf,chain:em,alt:B6,throwError:dR},kge=vn(tm),Oge=$i(G6),Mge=function(e){return vn(Na)(_A(e))};function Fge(e){var t=z6(e),n=Q6(e);return{URI:yn,_E:void 0,map:Di,ap:t.ap,of:Jo,chain:em,bimap:pR,mapLeft:hR,alt:n.alt,throwError:vR}}const jge=Object.freeze(Object.defineProperty({__proto__:null,Alt:uge,ApT:o4,Applicative:G6,Apply:tm,Bifunctor:lge,Chain:Za,Do:_ge,FromEither:Xa,FromReader:qf,Functor:yR,Monad:age,MonadThrow:Age,Pointed:rge,URI:yn,alt:gR,altW:ege,ap:AR,apFirst:H6,apFirstW:ige,apS:i4,apSW:Ige,apSecond:Y6,apSecondW:oge,apW:Zme,ask:cge,asks:dge,asksReaderEither:Qme,asksReaderEitherW:L6,bimap:W6,bind:r4,bindTo:xge,bindW:Tge,chain:mR,chainEitherK:e4,chainEitherKW:yge,chainFirst:J6,chainFirstEitherK:t4,chainFirstEitherKW:bge,chainFirstReaderK:X6,chainFirstReaderKW:hge,chainFirstW:sge,chainOptionK:vge,chainReaderK:Z6,chainReaderKW:pge,chainW:K6,filterOrElse:n4,filterOrElseW:Sge,flap:nge,flatten:Xme,flattenW:q6,fold:Nme,foldW:Kme,fromEither:k6,fromEitherK:wge,fromOption:mge,fromOptionK:gge,fromPredicate:Cge,fromReader:O6,fromReaderK:fge,getAltReaderValidation:Q6,getApplicativeReaderValidation:z6,getApplyMonoid:Oge,getApplySemigroup:kge,getCompactable:V6,getFilterable:tge,getOrElse:j6,getOrElseW:qme,getReaderValidation:Fge,getSemigroup:Mge,left:dR,leftReader:Pme,local:zme,map:P6,mapLeft:N6,match:M6,matchE:fR,matchEW:F6,matchW:Wme,of:Jo,orElse:D6,orElseFirst:U6,orElseFirstW:Yme,orElseW:Hme,orLeft:Gme,readerEither:$ge,right:R6,rightReader:$6,sequenceArray:Rge,swap:Jme,throwError:vR,toUnion:Vme,traverseArray:s4,traverseArrayWithIndex:Ege,traverseReadonlyArrayWithIndex:bR,traverseReadonlyNonEmptyArrayWithIndex:a4},Symbol.toStringTag,{value:"Module"}));function CR(e){return function(t){return function(){return e.of(t)}}}function SR(e){return function(t){return function(n){return function(r){return e.map(n(r),t)}}}}function wR(e){return function(t){return function(n){return function(r){return e.ap(n(r),t(r))}}}}function _R(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(i){return t(i)(r)})}}}}function xR(e){return function(t){return X(t,e.of)}}function Lge(e){return function(t){return X(t,e)}}function Dge(e){var t=wR(e),n=SR(e),r=_R(e);return{map:function(i,o){return x(i,n(o))},ap:function(i,o){return x(i,t(o))},of:CR(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:xR(e),fromM:function(i){return function(){return i}}}}const Uge=Object.freeze(Object.defineProperty({__proto__:null,ap:wR,chain:_R,fromNaturalTransformation:Lge,fromReader:xR,getReaderM:Dge,map:SR,of:CR},Symbol.toStringTag,{value:"Module"}));var Cr=function(e){return function(){return Promise.resolve().then(e)}};function Bge(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,fl(t))},rc=function(e,t){return x(e,l4(t))},TR=function(e,t){return x(e,nm(function(n){return x(t,fl(n))}))},Vf=function(e,t){return x(e,nm(t))},fl=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},l4=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)})}}},nr=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)()})}}},Pge=nm(Q),Sr="Task";function Wge(){return{concat:function(e,t){return function(){return Promise.race([Promise.resolve().then(e),Promise.resolve().then(t)])}},empty:c4}}var Ke={URI:Sr,map:ao},Nge=He(Ke),Bn={URI:Sr,of:nr},ic={URI:Sr,map:ao,ap:rc},Kge=qt(ic),qge=Vt(ic),rm={URI:Sr,map:ao,ap:rc,of:nr},db={URI:Sr,map:ao,ap:TR},u4={URI:Sr,map:ao,ap:TR,of:nr},zf={URI:Sr,map:ao,ap:rc,chain:Vf},bn={URI:Sr,map:ao,of:nr,ap:rc,chain:Vf},Vge={URI:Sr,map:ao,of:nr,ap:rc,chain:Vf,fromIO:Cr},im=Q,zge={URI:Sr,map:ao,of:nr,ap:rc,chain:Vf,fromIO:Cr,fromTask:im},Qge=vt(zf),fb={URI:Sr,fromIO:Cr},Hge=zo(fb),Yge=Ba(fb,zf),Gge=Pa(fb,zf),Jge={URI:Sr,fromIO:Cr,fromTask:im},c4=function(){return new Promise(function(e){})},Zge=nr(gn),Xge=Qt(Ke),eve=Ht(zf),tve=zt(ic),IR=nr(Ln),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)()})}))}}},ER=function(e){var t=Qf(e);return function(n){return Tt(n)?t(n):IR}},RR=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))}}},$R=function(e){var t=RR(e);return function(n){return Tt(n)?t(n):IR}},nve=ER,d4=function(e){return ER(function(t,n){return e(n)})},rve=d4(Q),ive=$R,f4=function(e){return $R(function(t,n){return e(n)})},ove=f4(Q),ave={URI:Sr,map:ao,of:nr,ap:rc,chain:Vf,fromIO:Cr,fromTask:im},sve={URI:Sr,map:ao,of:nr,ap:TR,chain:Vf,fromIO:Cr,fromTask:im},lve=vn(db),uve=$i(u4);const cve=Object.freeze(Object.defineProperty({__proto__:null,ApT:IR,ApplicativePar:rm,ApplicativeSeq:u4,ApplyPar:ic,ApplySeq:db,Chain:zf,Do:Zge,FromIO:fb,FromTask:Jge,Functor:Ke,Monad:bn,MonadIO:Vge,MonadTask:zge,Pointed:Bn,URI:Sr,ap:l4,apFirst:Kge,apS:tve,apSecond:qge,bind:eve,bindTo:Xge,chain:nm,chainFirst:Qge,chainFirstIOK:Gge,chainIOK:Yge,delay:Bge,flap:Nge,flatten:Pge,fromIO:Cr,fromIOK:Hge,fromTask:im,getMonoid:uve,getRaceMonoid:Wge,getSemigroup:lve,map:fl,never:c4,of:nr,sequenceArray:rve,sequenceSeqArray:ove,task:ave,taskSeq:sve,traverseArray:d4,traverseArrayWithIndex:nve,traverseReadonlyArrayWithIndex:ER,traverseReadonlyArrayWithIndexSeq:$R,traverseReadonlyNonEmptyArrayWithIndex:Qf,traverseReadonlyNonEmptyArrayWithIndexSeq:RR,traverseSeqArray:f4,traverseSeqArrayWithIndex:ive},Symbol.toStringTag,{value:"Module"}));var p4=xR(Bn),Hf=Qo,oc=X(Cr,Hf),dve=FA,h4=jA,fve=h4,so=function(e,t){return x(e,OR(t))},ac=function(e,t){return x(e,MR(t))},kR=function(e,t){return x(e,pb(function(n){return x(t,OR(n))}))},Yf=function(e,t){return x(e,pb(t))},OR=SR(Ke),MR=wR(ic),pve=MR,Ui=CR(Bn),pb=_R(bn),A4=pb,m4=A4(Q),hve=m4,rr="ReaderTask",Mn={URI:rr,map:so},Ave=He(Mn),om={URI:rr,of:Ui},am={URI:rr,map:so,ap:ac},mve=qt(am),gve=Vt(am),vve={URI:rr,map:so,ap:ac,of:Ui},FR={URI:rr,map:so,ap:kR},g4={URI:rr,map:so,ap:kR,of:Ui},Zo={URI:rr,map:so,ap:ac,chain:Yf},es={URI:rr,map:so,of:Ui,ap:ac,chain:Yf},yve={URI:rr,map:so,of:Ui,ap:ac,chain:Yf,fromIO:oc},bve={URI:rr,map:so,of:Ui,ap:ac,chain:Yf,fromIO:oc,fromTask:Hf},v4=vt(Zo),Cve=v4,hb={URI:rr,fromIO:oc},Sve=zo(hb),wve=Ba(hb,Zo),_ve=Pa(hb,Zo),Gf={URI:rr,fromReader:p4},xve=DA(Gf),Tve=UA(Gf),Ive=Ju(Gf),y4=BA(Gf,Zo),Eve=y4,b4=PA(Gf,Zo),Rve=b4,Ab={URI:rr,fromIO:oc,fromTask:Hf},$ve=Zu(Ab),kve=$f(Ab,Zo),Ove=kf(Ab,Zo),Mve=Ui(gn),Fve=Qt(Mn),C4=Ht(Zo),jve=C4,S4=zt(am),Lve=S4,jR=Ui(Ln),w4=function(e){return X(Gu(e),Yu(Qf(Ur)))},LR=function(e){var t=w4(e);return function(n){return Tt(n)?t(n):jR}},_4=function(e){return X(Gu(e),Yu(RR(Ur)))},DR=function(e){var t=_4(e);return function(n){return Tt(n)?t(n):jR}},Dve=LR,x4=function(e){return LR(function(t,n){return e(n)})},Uve=x4(Q),Bve=DR,T4=function(e){return DR(function(t,n){return e(n)})},Pve=T4(Q),Wve={URI:rr,map:so,of:Ui,ap:ac,chain:Yf,fromIO:oc,fromTask:Hf},Nve={URI:rr,map:so,of:Ui,ap:kR,chain:Yf,fromIO:oc,fromTask:Hf},Kve=vn(FR),qve=$i(g4);function Vve(e,t){return e(t)()}const zve=Object.freeze(Object.defineProperty({__proto__:null,ApT:jR,ApplicativePar:vve,ApplicativeSeq:g4,ApplyPar:am,ApplySeq:FR,Chain:Zo,Do:Mve,FromIO:hb,FromReader:Gf,FromTask:Ab,Functor:Mn,Monad:es,MonadIO:yve,MonadTask:bve,Pointed:om,URI:rr,ap:MR,apFirst:mve,apS:S4,apSW:Lve,apSecond:gve,apW:pve,ask:xve,asks:Tve,asksReaderTask:fve,asksReaderTaskW:h4,bind:C4,bindTo:Fve,bindW:jve,chain:pb,chainFirst:v4,chainFirstIOK:_ve,chainFirstReaderK:b4,chainFirstReaderKW:Rve,chainFirstTaskK:Ove,chainFirstW:Cve,chainIOK:wve,chainReaderK:y4,chainReaderKW:Eve,chainTaskK:kve,chainW:A4,flap:Ave,flatten:hve,flattenW:m4,fromIO:oc,fromIOK:Sve,fromReader:p4,fromReaderK:Ive,fromTask:Hf,fromTaskK:$ve,getMonoid:qve,getSemigroup:Kve,local:dve,map:OR,of:Ui,readerTask:Wve,readerTaskSeq:Nve,run:Vve,sequenceArray:Uve,sequenceSeqArray:Pve,traverseArray:x4,traverseArrayWithIndex:Dve,traverseReadonlyArrayWithIndex:LR,traverseReadonlyArrayWithIndexSeq:DR,traverseReadonlyNonEmptyArrayWithIndex:w4,traverseReadonlyNonEmptyArrayWithIndexSeq:_4,traverseSeqArray:T4,traverseSeqArrayWithIndex:Bve},Symbol.toStringTag,{value:"Module"}));var Qve=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{u(r.next(c))}catch(f){a(f)}}function l(c){try{u(r.throw(c))}catch(f){a(f)}}function u(c){c.done?o(c.value):i(c.value).then(s,l)}u((r=r.apply(e,t||[])).next())})},Hve=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(u){return function(c){return l([u,c])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},UR=yf(Bn),BR=zu(Bn),mb=bf(Ke),PR=Cf(Ke),WR=X(Cr,mb),I4=X(Cr,PR),pl=WR,Jf=mb,NR=nr,KR=Cr,E4=function(e){return fl(AK(e))},R4=$A(Ke),Yve=R4,qR=If(bn),Gve=qR,$4=qR,Jve=$4,k4=Ef(bn),Zve=k4,O4=function(e,t){return function(){return Qve(void 0,void 0,void 0,function(){var n;return Hve(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]}})})}},Xve=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return O4(function(){return e.apply(void 0,n)},t)}},eye=MA(Ke),tye=E0(Bn),nye=R0(Bn),rye=XI(bn),M4=Hu(bn),iye=M4,gb=kA(bn),oye=gb,aye=function(e){return gb(J4(e))},sye=function(e){return gb(Z4(e))},lye=OA(bn),uye=Rf(Ke),F4=function(e){var t=E4(e);return function(n){return X(n,t)}},j4=function(e){return function(t){return function(n){return x(n,sm(F4(e)(t)))}}},cye=j4,L4=function(e){return X(e,KR)},D4=function(e){return sh(L4(e))},dye=D4,Pn=function(e,t){return x(e,QR(t))},hl=function(e,t){return x(e,HR(t))},VR=function(e,t){return x(e,sm(function(n){return x(t,QR(n))}))},Al=function(e,t){return x(e,sm(t))},vb=function(e,t,n){return x(e,U4(t,n))},yb=function(e,t){return x(e,B4(t))},zR=function(e,t){return x(e,YR(t))},QR=Sf(Ke),U4=xf(Ke),B4=Tf(Ke),HR=wf(ic),fye=HR,sm=Qu(bn),sh=sm,P4=sh(Q),pye=P4,YR=_f(bn),hye=YR,Nr=BR,lm=UR,It="TaskEither";function GR(e,t){var n=Ra(e,il(t));return{URI:It,_E:void 0,map:Pn,ap:function(r,i){return x(r,n(i))},of:Nr}}function W4(e){var t=RA(bn,e);return{URI:It,_E:void 0,map:Pn,alt:function(n,r){return x(n,t(r))}}}var N4=function(e){var t=Ku(e);return{URI:It,_E:void 0,compact:qo(Ke,t),separate:La(Ke,t,ol)}};function Aye(e){var t=mf(e),n=N4(e),r=Da(Ke,t),i=Ua(Ke,t),o=sl(Ke,t),a=ll(Ke,t);return{URI:It,_E:void 0,map:Pn,compact:n.compact,separate:n.separate,filter:function(s,l){return x(s,r(l))},filterMap:function(s,l){return x(s,i(l))},partition:function(s,l){return x(s,o(l))},partitionMap:function(s,l){return x(s,a(l))}}}var JR={URI:It,map:Pn},mye=He(JR),gye={URI:It,of:Nr},bb={URI:It,map:Pn,ap:hl},K4=qt(bb),vye=K4,q4=Vt(bb),yye=q4,bye={URI:It,map:Pn,ap:hl,of:Nr},V4={URI:It,map:Pn,ap:VR},z4={URI:It,map:Pn,ap:VR,of:Nr},lo={URI:It,map:Pn,ap:hl,chain:Al},Cye={URI:It,map:Pn,ap:hl,chain:Al,of:Nr},Sye={URI:It,map:Pn,ap:hl,chain:Al,of:Nr,fromIO:pl},wye={URI:It,map:Pn,ap:hl,chain:Al,of:Nr,fromIO:pl,fromTask:Jf},_ye={URI:It,map:Pn,ap:hl,chain:Al,of:Nr,throwError:lm},Q4=vt(lo),xye=Q4,Tye={URI:It,bimap:vb,mapLeft:yb},Iye={URI:It,map:Pn,alt:zR},ts={URI:It,fromEither:NR},Eye=Po(ts),Rye=Wo(ts),$ye=Ou(ts,lo),H4=$a(ts,lo),kye=H4,Y4=ka(ts,lo),Oye=Y4,Mye=Gs(ts),G4=Mu(ts,lo),Fye=G4,jye=di(ts),Cb={URI:It,fromIO:pl},J4=zo(Cb),Lye=Ba(Cb,lo),Dye=Pa(Cb,lo),Sb={URI:It,fromIO:pl,fromTask:Jf},Z4=Zu(Sb),Uye=$f(Sb,lo),Bye=kf(Sb,lo);function Pye(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 Wye=function(e,t,n){return ZR(e,t,n)},ZR=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 nr(i)}))}))}))},Nye=Nr(gn),Kye=Qt(JR),X4=Ht(lo),qye=X4,e9=zt(bb),Vye=e9,XR=Nr(Ln),e$=function(e){return X(Qf(e),fl(EA(Ur)))},t$=function(e){var t=e$(e);return function(n){return Tt(n)?t(n):XR}},n$=function(e){return function(t){return function(){return Nd(t).reduce(function(n,r,i){return n.then(function(o){return hn(o)?n:e(i+1,r)().then(function(a){return hn(a)?a:(o.right.push(a.right),o)})})},e(0,ci(t))().then(qu(Gh)))}}},r$=function(e){var t=n$(e);return function(n){return Tt(n)?t(n):XR}},zye=t$,t9=function(e){return t$(function(t,n){return e(n)})},Qye=t9(Q),Hye=r$,n9=function(e){return r$(function(t,n){return e(n)})},Yye=n9(Q),Gye={URI:It,bimap:vb,mapLeft:yb,map:Pn,of:Nr,ap:hl,chain:Al,alt:zR,fromIO:pl,fromTask:Jf,throwError:lm},Jye={URI:It,bimap:vb,mapLeft:yb,map:Pn,of:Nr,ap:VR,chain:Al,alt:zR,fromIO:pl,fromTask:Jf,throwError:lm},Zye=vn(V4),Xye=$i(z4),e0e=function(e){return vn(db)(_A(e))};function t0e(e){var t=GR(rm,e),n=W4(e);return{URI:It,_E:void 0,map:Pn,ap:t.ap,of:Nr,chain:Al,bimap:vb,mapLeft:yb,alt:n.alt,fromIO:pl,fromTask:Jf,throwError:lm}}const n0e=Object.freeze(Object.defineProperty({__proto__:null,Alt:Iye,ApT:XR,ApplicativePar:bye,ApplicativeSeq:z4,ApplyPar:bb,ApplySeq:V4,Bifunctor:Tye,Chain:lo,Do:Nye,FromEither:ts,FromIO:Cb,FromTask:Sb,Functor:JR,Monad:Cye,MonadIO:Sye,MonadTask:wye,MonadThrow:_ye,Pointed:gye,URI:It,alt:YR,altW:hye,ap:HR,apFirst:K4,apFirstW:vye,apS:e9,apSW:Vye,apSecond:q4,apSecondW:yye,apW:fye,bimap:U4,bind:X4,bindTo:Kye,bindW:qye,bracket:Wye,bracketW:ZR,chain:sm,chainEitherK:H4,chainEitherKW:kye,chainFirst:Q4,chainFirstEitherK:Y4,chainFirstEitherKW:Oye,chainFirstIOK:Dye,chainFirstTaskK:Bye,chainFirstW:xye,chainIOEitherK:dye,chainIOEitherKW:D4,chainIOK:Lye,chainNullableK:rye,chainOptionK:$ye,chainTaskK:Uye,chainTaskOptionK:cye,chainTaskOptionKW:j4,chainW:sh,filterOrElse:G4,filterOrElseW:Fye,flap:mye,flatten:pye,flattenW:P4,fold:Gve,foldW:Jve,fromEither:NR,fromEitherK:jye,fromIO:pl,fromIOEither:KR,fromIOEitherK:L4,fromIOK:J4,fromNullable:tye,fromNullableK:nye,fromOption:Eye,fromOptionK:Rye,fromPredicate:Mye,fromTask:Jf,fromTaskK:Z4,fromTaskOption:E4,fromTaskOptionK:F4,getAltTaskValidation:W4,getApplicativeTaskValidation:GR,getApplyMonoid:Xye,getApplySemigroup:Zye,getCompactable:N4,getFilterable:Aye,getOrElse:k4,getOrElseW:Zve,getSemigroup:e0e,getTaskValidation:t0e,left:UR,leftIO:I4,leftTask:PR,map:QR,mapLeft:B4,match:R4,matchE:qR,matchEW:$4,matchW:Yve,of:Nr,orElse:M4,orElseFirst:gb,orElseFirstIOK:aye,orElseFirstTaskK:sye,orElseFirstW:oye,orElseW:iye,orLeft:lye,right:BR,rightIO:WR,rightTask:mb,sequenceArray:Qye,sequenceSeqArray:Yye,swap:uye,taskEither:Gye,taskEitherSeq:Jye,taskify:Pye,throwError:lm,toUnion:eye,traverseArray:t9,traverseArrayWithIndex:zye,traverseReadonlyArrayWithIndex:t$,traverseReadonlyArrayWithIndexSeq:r$,traverseReadonlyNonEmptyArrayWithIndex:e$,traverseReadonlyNonEmptyArrayWithIndexSeq:n$,traverseSeqArray:n9,traverseSeqArrayWithIndex:Hye,tryCatch:O4,tryCatchK:Xve},Symbol.toStringTag,{value:"Module"}));var ml=Qo,wb=yf(om),i$=zu(om),o$=X(mb,ml),r9=X(PR,ml),a$=function(e){return X(e,BR)},i9=function(e){return X(e,UR)},o9=bf(Mn),r0e=Cf(Mn),s$=X(WR,ml),a9=X(I4,ml),s9=Ui,l9=a$,gl=s$,Zf=o$,l$=X(KR,ml),u$=function(e){return X(e,NR)},u9=$A(Mn),i0e=u9,c$=If(Zo),o0e=c$,c9=c$,a0e=c9,d9=Ef(es),s0e=d9,l0e=MA(Mn),u0e=E0(om),c0e=R0(om),d0e=XI(es),f0e=FA,f9=jA,p0e=f9,p9=Hu(es),h0e=p9,h9=kA(es),A0e=h9,m0e=OA(es),g0e=Rf(Mn),A9=function(e){return X(e,l$)},m9=function(e){return Xf(A9(e))},v0e=m9,d$=function(e){return X(e,ml)},g9=function(e){return Xf(d$(e))},y0e=g9,v9=function(e){return Rb(d$(e))},b0e=v9,f$=function(e){return X(e,u$)},y9=function(e){return Xf(f$(e))},C0e=y9,b9=function(e){return Rb(f$(e))},S0e=b9,Wn=function(e,t){return x(e,um(t))},vl=function(e,t){return x(e,g$(t))},p$=function(e,t){return x(e,Tb(function(n){return x(t,um(n))}))},yl=function(e,t){return x(e,Tb(t))},h$=function(e,t){return x(e,Ib(t))},_b=function(e,t,n){return x(e,A$(t,n))},xb=function(e,t){return x(e,m$(t))},um=Sf(Mn),A$=xf(Mn),m$=Tf(Mn),g$=wf(am),w0e=g$,Kr=i$,Tb=Qu(es),Xf=Tb,C9=Xf(Q),_0e=C9,Ib=_f(es),S9=Ib,cm=wb,Ct="ReaderTaskEither",w9=function(e){var t=Ku(e);return{URI:Ct,_E:void 0,compact:qo(Mn,t),separate:La(Mn,t,ol)}};function x0e(e){var t=mf(e),n=w9(e),r=Da(Mn,t),i=Ua(Mn,t),o=sl(Mn,t),a=ll(Mn,t);return{URI:Ct,_E:void 0,map:Wn,compact:n.compact,separate:n.separate,filter:function(s,l){return x(s,r(l))},filterMap:function(s,l){return x(s,i(l))},partition:function(s,l){return x(s,o(l))},partitionMap:function(s,l){return x(s,a(l))}}}function _9(e,t){var n=Ra(Na,GR(e,t));return{URI:Ct,_E:void 0,map:Wn,ap:function(r,i){return x(r,n(i))},of:Kr}}function x9(e){var t=RA(es,e);return{URI:Ct,_E:void 0,map:Wn,alt:function(n,r){return x(n,t(r))}}}var sc={URI:Ct,map:Wn},T0e=He(sc),v$={URI:Ct,of:Kr},Eb={URI:Ct,map:Wn,ap:vl},T9=qt(Eb),I0e=T9,I9=Vt(Eb),E0e=I9,R0e={URI:Ct,map:Wn,ap:vl,of:Kr},E9={URI:Ct,map:Wn,ap:p$},R9={URI:Ct,map:Wn,ap:p$,of:Kr},wr={URI:Ct,map:Wn,ap:vl,chain:yl},$0e={URI:Ct,map:Wn,ap:vl,chain:yl,of:Kr},k0e={URI:Ct,map:Wn,ap:vl,chain:yl,of:Kr,fromIO:gl},O0e={URI:Ct,map:Wn,ap:vl,chain:yl,of:Kr,fromIO:gl,fromTask:Zf},M0e={URI:Ct,map:Wn,ap:vl,chain:yl,of:Kr,throwError:cm},$9=vt(wr),Rb=$9,F0e={URI:Ct,bimap:_b,mapLeft:xb},j0e={URI:Ct,map:Wn,alt:h$},ep={URI:Ct,fromReader:l9},L0e=DA(ep),D0e=UA(ep),U0e=Ju(ep),k9=BA(ep,wr),B0e=k9,O9=PA(ep,wr),P0e=O9,y$=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return o9(e.apply(void 0,t))}},M9=function(e){return Xf(y$(e))},W0e=M9,F9=function(e){return Rb(y$(e))},N0e=F9,ns={URI:Ct,fromEither:s9},K0e=Po(ns),q0e=Wo(ns),V0e=Ou(ns,wr),j9=$a(ns,wr),z0e=j9,L9=ka(ns,wr),Q0e=L9,H0e=Gs(ns),D9=Mu(ns,wr),Y0e=D9,G0e=di(ns),$b={URI:Ct,fromIO:gl},J0e=zo($b),Z0e=Ba($b,wr),X0e=Pa($b,wr),kb={URI:Ct,fromIO:gl,fromTask:Zf},ebe=Zu(kb),tbe=$f(kb,wr),nbe=kf(kb,wr);function rbe(e,t,n){return U9(e,t,n)}function U9(e,t,n){return function(r){return ZR(e(r),function(i){return t(i)(r)},function(i,o){return n(i,o)(r)})}}var ibe=Kr(gn),obe=Qt(sc),B9=Ht(wr),abe=B9,P9=zt(Eb),sbe=P9,b$=Kr(Ln),W9=function(e){return X(Gu(e),Yu(e$(Ur)))},C$=function(e){var t=W9(e);return function(n){return Tt(n)?t(n):b$}},N9=function(e){return X(Gu(e),Yu(n$(Ur)))},S$=function(e){var t=N9(e);return function(n){return Tt(n)?t(n):b$}},lbe=C$,K9=function(e){return C$(function(t,n){return e(n)})},ube=K9(Q),cbe=S$,q9=function(e){return S$(function(t,n){return e(n)})},dbe=q9(Q),fbe={URI:Ct,map:Wn,of:Kr,ap:vl,chain:yl,alt:h$,bimap:_b,mapLeft:xb,fromIO:gl,fromTask:Zf,throwError:cm},pbe={URI:Ct,map:Wn,of:Kr,ap:p$,chain:yl,alt:h$,bimap:_b,mapLeft:xb,fromIO:gl,fromTask:Zf,throwError:cm},hbe=vn(E9),Abe=$i(R9),mbe=function(e){return vn(FR)(_A(e))};function gbe(e){var t=_9(rm,e),n=x9(e);return{URI:Ct,_E:void 0,map:Wn,of:Kr,chain:yl,bimap:_b,mapLeft:xb,ap:t.ap,alt:n.alt,fromIO:gl,fromTask:Zf,throwError:cm}}function vbe(e,t){return e(t)()}const ybe=Object.freeze(Object.defineProperty({__proto__:null,Alt:j0e,ApT:b$,ApplicativePar:R0e,ApplicativeSeq:R9,ApplyPar:Eb,ApplySeq:E9,Bifunctor:F0e,Chain:wr,Do:ibe,FromEither:ns,FromIO:$b,FromReader:ep,FromTask:kb,Functor:sc,Monad:$0e,MonadIO:k0e,MonadTask:O0e,MonadThrow:M0e,Pointed:v$,URI:Ct,alt:Ib,altW:S9,ap:g$,apFirst:T9,apFirstW:I0e,apS:P9,apSW:sbe,apSecond:I9,apSecondW:E0e,apW:w0e,ask:L0e,asks:D0e,asksReaderTaskEither:p0e,asksReaderTaskEitherW:f9,bimap:A$,bind:B9,bindTo:obe,bindW:abe,bracket:rbe,bracketW:U9,chain:Tb,chainEitherK:j9,chainEitherKW:z0e,chainFirst:$9,chainFirstEitherK:L9,chainFirstEitherKW:Q0e,chainFirstIOK:X0e,chainFirstReaderEitherK:S0e,chainFirstReaderEitherKW:b9,chainFirstReaderK:O9,chainFirstReaderKW:P0e,chainFirstReaderTaskK:N0e,chainFirstReaderTaskKW:F9,chainFirstTaskEitherK:b0e,chainFirstTaskEitherKW:v9,chainFirstTaskK:nbe,chainFirstW:Rb,chainIOEitherK:v0e,chainIOEitherKW:m9,chainIOK:Z0e,chainNullableK:d0e,chainOptionK:V0e,chainReaderEitherK:C0e,chainReaderEitherKW:y9,chainReaderK:k9,chainReaderKW:B0e,chainReaderTaskK:W0e,chainReaderTaskKW:M9,chainTaskEitherK:y0e,chainTaskEitherKW:g9,chainTaskK:tbe,chainW:Xf,filterOrElse:D9,filterOrElseW:Y0e,flap:T0e,flatten:_0e,flattenW:C9,fold:o0e,foldW:a0e,fromEither:s9,fromEitherK:G0e,fromIO:gl,fromIOEither:l$,fromIOEitherK:A9,fromIOK:J0e,fromNullable:u0e,fromNullableK:c0e,fromOption:K0e,fromOptionK:q0e,fromPredicate:H0e,fromReader:l9,fromReaderEither:u$,fromReaderEitherK:f$,fromReaderK:U0e,fromReaderTaskK:y$,fromTask:Zf,fromTaskEither:ml,fromTaskEitherK:d$,fromTaskK:ebe,getAltReaderTaskValidation:x9,getApplicativeReaderTaskValidation:_9,getApplyMonoid:Abe,getApplySemigroup:hbe,getCompactable:w9,getFilterable:x0e,getOrElse:d9,getOrElseW:s0e,getReaderTaskValidation:gbe,getSemigroup:mbe,left:wb,leftIO:a9,leftReader:i9,leftReaderTask:r0e,leftTask:r9,local:f0e,map:um,mapLeft:m$,match:u9,matchE:c$,matchEW:c9,matchW:i0e,of:Kr,orElse:p9,orElseFirst:h9,orElseFirstW:A0e,orElseW:h0e,orLeft:m0e,readerTaskEither:fbe,readerTaskEitherSeq:pbe,right:i$,rightIO:s$,rightReader:a$,rightReaderTask:o9,rightTask:o$,run:vbe,sequenceArray:ube,sequenceSeqArray:dbe,swap:g0e,throwError:cm,toUnion:l0e,traverseArray:K9,traverseArrayWithIndex:lbe,traverseReadonlyArrayWithIndex:C$,traverseReadonlyArrayWithIndexSeq:S$,traverseReadonlyNonEmptyArrayWithIndex:W9,traverseReadonlyNonEmptyArrayWithIndexSeq:N9,traverseSeqArray:q9,traverseSeqArrayWithIndex:cbe},Symbol.toStringTag,{value:"Module"}));var V9={equals:function(e,t){return e===t}},z9={concat:function(e,t){return e+t}},Q9="",bbe={concat:z9.concat,empty:Q9},Z={equals:V9.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},Cbe={show:function(e){return JSON.stringify(e)}},Sbe=function(e){return typeof e=="string"},wbe=function(e){return e.toUpperCase()},_be=function(e){return e.toLowerCase()},xbe=function(e,t){return function(n){return n.replace(e,t)}},Tbe=function(e){return e.trim()},Ibe=function(e){return e.trimLeft()},Ebe=function(e){return e.trimRight()},Rbe=function(e,t){return function(n){return n.slice(e,t)}},$be=function(e){return e.length===0},kbe=function(e){return e.length},Obe=function(e){return function(t){var n=t.split(e);return No(n)?n:[t]}},Mbe=function(e,t){return function(n){return n.includes(e,t)}},Fbe=function(e,t){return function(n){return n.startsWith(e,t)}},jbe=function(e,t){return function(n){return n.endsWith(e,t)}};const Lbe=Object.freeze(Object.defineProperty({__proto__:null,Eq:V9,Monoid:bbe,Ord:Z,Semigroup:z9,Show:Cbe,empty:Q9,endsWith:jbe,includes:Mbe,isEmpty:$be,isString:Sbe,replace:xbe,size:kbe,slice:Rbe,split:Obe,startsWith:Fbe,toLowerCase:_be,toUpperCase:wbe,trim:Tbe,trimLeft:Ibe,trimRight:Ebe},Symbol.toStringTag,{value:"Module"}));var Dbe=function(e){return Object.assign({},e)},Ube=function(e){return Object.assign({},e)},H9=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)}},Bbe=tp(Z);function Ob(e){if(typeof e=="function")return Ob(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 w$=Ob(Z)(function(e,t){return[e,t]});function Pbe(e){return function(t){var n=w$(t),r=n.length;return e.unfold(0,function(i){return i<r?ye([n[i],i+1]):Re})}}var _$=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 x$(e){return function(t){if(!gt.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}var Wbe=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)}},Nbe=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 Kbe(e){var t=x$(e);return function(n){var r=cu(e,n);return tn(r)?Re:ye([r.value,t(n)])}}function Mb(e){return function(t,n){if(n===void 0){var r=Mb(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 cu(e,t){return t===void 0?function(n){return cu(e,n)}:gt.call(t,e)?ye(t[e]):Re}var dm={};function Fb(e){return function(t){var n={};for(var r in t)gt.call(t,r)&&(n[r]=e(r,t[r]));return n}}function T$(e){return Fb(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),l=s.length,u=0;u<l;u++){var c=s[u];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,l=0;l<s;l++){var u=a[l];o=n.concat(o,r(u,i[u]))}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),l=s.length,u=l-1;u>=0;u--){var c=s[u];a=i(c,o[c],a)}return a}}}var Y9=function(e,t){var n;return n={},n[e]=t,n};function G9(e){var t=pm(Z)(e);return function(n){return function(r){return t(r,n)}}}function jb(e){var t=Xo(Z)(e);return function(n){return function(r){return t(r,n)}}}function np(e){return fm(Z)(e)}var qbe=function(e){var t=jb(e);return function(n){return function(r){return e.map(x(r,t(n)),rs)}}},Vbe=function(e){var t=jb(e);return function(n){return function(r){return e.map(x(r,t(n)),is)}}};function Lb(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 Db(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 Ub(e){return function(t){var n={};for(var r in t)if(gt.call(t,r)){var i=e(r,t[r]);Ft(i)&&(n[r]=i.value)}return n}}function Bb(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 J9(e,t){var n=I$(e,t);return function(r){return n(r,Q)}}function I$(e,t){return function(n,r){return t.reduce(n,{},function(i,o){var a=r(o),s=a[0],l=a[1];return i[s]=gt.call(i,s)?e.concat(i[s],l):l,i})}}var zbe=w$,Qbe=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 Z9(e){return function(t){for(var n in t)if(!e(t[n]))return!1;return!0}}function X9(e){return function(t){for(var n in t)if(e(t[n]))return!0;return!1}}function E$(e){return function(t,n){if(n===void 0){var r=E$(e);return function(o){return r(t,o)}}for(var i in n)if(e.equals(n[i],t))return!0;return!1}}var R$=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}}},$$=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}}},k$=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,T$(t))},lc=function(e,t){return x(e,Fb(t))},Ai=function(e){var t=lh(e);return function(n,r,i){return x(n,t(r,i))}},mi=function(e){return function(t){var n=uh(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))}},uc=function(e,t){return x(e,O$(t))},cc=function(e,t){return x(e,M$(t))},dc=function(e,t){return x(e,F$(t))},fc=function(e,t){return x(e,j$(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))}},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))},Kb=function(e,t){return x(e,Bb(t))},Xo=function(e){var t=pm(e);return function(n){var r=t(n);return function(i,o){return r(i,X(Ur,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 m;return Object.assign({},p,(m={},m[f]=h,m))}}),i(f,r[f]))},l=0,u=o;l<u.length;l++){var c=u[l];s(c)}return a}}},O$=function(e){return Bb(function(t,n){return e(n)})},M$=function(e){return Ub(function(t,n){return e(n)})},F$=function(e){return Db(function(t,n){return e(n)})},j$=function(e){return Lb(function(t,n){return e(n)})};function lh(){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 lh(Z).apply(void 0,e)}function uh(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 uh(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];Ft(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];hn(i)?t[r]=i.left:n[r]=i.right}return Be(t,n)},Nn="ReadonlyRecord";function pv(e){return"compare"in e?function(t){return{show:function(n){var r=Ob(e)(function(i,o){return"".concat(JSON.stringify(i),": ").concat(t.show(o))})(n).join(", ");return r===""?"{}":"{ ".concat(r," }")}}}:pv(Z)(e)}function e8(e){var t=Mb(e);return ki(function(n,r){return t(n)(r)&&t(r)(n)})}function t8(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 n8={URI:Nn,map:hi},Hbe=He(n8),Ybe={URI:Nn,map:hi,mapWithIndex:lc},Gbe=function(e){return{URI:Nn,reduce:Ai(e),foldMap:mi(e),reduceRight:gi(e)}},Jbe=function(e){return{URI:Nn,reduce:Ai(e),foldMap:mi(e),reduceRight:gi(e),reduceWithIndex:pc(e),foldMapWithIndex:hc(e),reduceRightWithIndex:Ac(e)}},dh={URI:Nn,compact:rs,separate:is},Zbe={URI:Nn,map:hi,compact:rs,separate:is,filter:uc,filterMap:cc,partition:dc,partitionMap:fc},Xbe={URI:Nn,map:hi,mapWithIndex:lc,compact:rs,separate:is,filter:uc,filterMap:cc,partition:dc,partitionMap:fc,filterMapWithIndex:Nb,filterWithIndex:Kb,partitionMapWithIndex:Pb,partitionWithIndex:Wb},r8=function(e){return{URI:Nn,map:hi,reduce:Ai(e),foldMap:mi(e),reduceRight:gi(e),traverse:Xo(e),sequence:fm(e)}},e1e=function(e){return{URI:Nn,map:hi,mapWithIndex:lc,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)}},t1e=function(e){var t=r8(e);return{URI:Nn,map:hi,reduce:Ai(e),foldMap:mi(e),reduceRight:gi(e),traverse:t.traverse,sequence:t.sequence,compact:rs,separate:is,filter:uc,filterMap:cc,partition:dc,partitionMap:fc,wither:ro(t,dh),wilt:no(t,dh)}},i8=function(e){var t=R$(e);return{concat:function(n,r){return t(r)(n)}}},n1e=function(e){return{concat:i8(e).concat,empty:dm}},r1e=function(e){var t=$$(e);return{concat:function(n,r){return t(r)(n)}}},i1e=function(){return{concat:function(e,t){return k$(t)(e)}}},o1e={URI:Nn,reduce:Ai(Z),foldMap:mi(Z),reduceRight:gi(Z)},a1e={URI:Nn,reduce:Ai(Z),foldMap:mi(Z),reduceRight:gi(Z),reduceWithIndex:pc(Z),foldMapWithIndex:hc(Z),reduceRightWithIndex:Ac(Z)},L$={URI:Nn,map:hi,reduce:Ai(Z),foldMap:mi(Z),reduceRight:gi(Z),traverse:Xo(Z),sequence:np},s1e={URI:Nn,map:hi,mapWithIndex:lc,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)},o8=ro(L$,dh),a8=no(L$,dh),l1e={URI:Nn,map:hi,reduce:Ai(Z),foldMap:mi(Z),reduceRight:gi(Z),traverse:Xo(Z),sequence:np,compact:rs,separate:is,filter:uc,filterMap:cc,partition:dc,partitionMap:fc,wither:o8,wilt:a8},D$=_$;function s8(e,t){return gt.call(t===void 0?this:t,e)}var u1e={URI:Nn,map:hi,reduce:Ai(Z),foldMap:mi(Z),reduceRight:gi(Z),traverse:Xo(Z),sequence:np,compact:rs,separate:is,filter:uc,filterMap:cc,partition:dc,partitionMap:fc,mapWithIndex:lc,reduceWithIndex:pc(Z),foldMapWithIndex:hc(Z),reduceRightWithIndex:Ac(Z),filterMapWithIndex:Nb,filterWithIndex:Kb,partitionMapWithIndex:Pb,partitionWithIndex:Wb,traverseWithIndex:pm(Z),wither:o8,wilt:a8};const c1e=Object.freeze(Object.defineProperty({__proto__:null,Compactable:dh,Filterable:Zbe,FilterableWithIndex:Xbe,Foldable:o1e,FoldableWithIndex:a1e,Functor:n8,FunctorWithIndex:Ybe,Traversable:L$,TraversableWithIndex:s1e,URI:Nn,Witherable:l1e,_filter:uc,_filterMap:cc,_filterMapWithIndex:Nb,_filterWithIndex:Kb,_foldMap:mi,_foldMapWithIndex:hc,_map:hi,_mapWithIndex:lc,_partition:dc,_partitionMap:fc,_partitionMapWithIndex:Pb,_partitionWithIndex:Wb,_reduce:Ai,_reduceRight:gi,_reduceRightWithIndex:Ac,_reduceWithIndex:pc,_sequence:fm,_traverse:Xo,collect:Ob,compact:rs,deleteAt:x$,difference:k$,elem:E$,empty:dm,every:Z9,filter:O$,filterMap:M$,filterMapWithIndex:Ub,filterWithIndex:Bb,flap:Hbe,foldMap:uh,foldMapWithIndex:md,fromEntries:Qbe,fromFoldable:J9,fromFoldableMap:I$,fromRecord:Dbe,getDifferenceMagma:i1e,getEq:e8,getFoldable:Gbe,getFoldableWithIndex:Jbe,getIntersectionSemigroup:r1e,getMonoid:t8,getShow:pv,getTraversable:r8,getTraversableWithIndex:e1e,getUnionMonoid:n1e,getUnionSemigroup:i8,getWitherable:t1e,has:wa,hasOwnProperty:s8,insertAt:D$,intersection:$$,isEmpty:Fo,isSubrecord:Mb,keys:Bbe,lookup:cu,map:T$,mapWithIndex:Fb,modifyAt:Nbe,partition:F$,partitionMap:j$,partitionMapWithIndex:Lb,partitionWithIndex:Db,pop:Kbe,readonlyRecord:u1e,reduce:lh,reduceRight:ch,reduceRightWithIndex:gd,reduceWithIndex:Ad,separate:is,sequence:np,singleton:Y9,size:H9,some:X9,toEntries:zbe,toReadonlyArray:w$,toRecord:Ube,toUnfoldable:Pbe,traverse:jb,traverseWithIndex:G9,union:R$,updateAt:Wbe,upsertAt:_$,wilt:Vbe,wither:qbe},Symbol.toStringTag,{value:"Module"}));var d1e=function(e){return new Set(e)},f1e=function(e){return new Set([e])},l8=function(e){return function(t){for(var n=t.length,r=new Set,i=Fn(e),o=0;o<n;o++){var a=t[o];i(a,r)||r.add(a)}return r}};function p1e(e){return new Set(e)}function h1e(e){var t=Fn(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 A1e(e){var t=Fn(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 U$(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 m1e(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 B$(e){var t=Fn(e);return function(n,r){if(r===void 0){var i=B$(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 P$(e){var t=Fn(e);return function(n,r){if(r===void 0){var i=P$(e);return function(a){return i(a,n)}}if(fh(n)||fh(r))return N$;var o=new Set;return n.forEach(function(a){t(a,r)&&o.add(a)}),o}}function g1e(e,t){return function(n){return function(r){for(var i=r.values(),o,a=new Set,s=new Set,l=Fn(e),u=Fn(t);!(o=i.next()).done;){var c=n(o.value);switch(c._tag){case"Left":l(c.left,a)||a.add(c.left);break;case"Right":u(c.right,s)||s.add(c.right);break}}return Be(a,s)}}}function W$(e){var t=Fn(e);return function(n,r){if(r===void 0){var i=W$(e);return function(o){return i(o,n)}}return U$(function(o){return!t(o,r)})(n)}}function u8(e){var t=qb(e);return function(n,r){return function(i){return t(i).reduce(r,n)}}}function c8(e,t){var n=qb(e);return function(r){return function(i){return n(i).reduce(function(o,a){return t.concat(o,r(a))},t.empty)}}}var d8=function(e){var t=qb(e);return function(n,r){return function(i){return t(i).reduceRight(function(o,a){return r(a,o)},n)}}};function f8(e){var t=Fn(e);return function(n){return function(r){if(t(n)(r))return r;var i=new Set(r);return i.add(n),i}}}var p8=function(e){return function(t){return function(n){return U$(function(r){return!e.equals(t,r)})(n)}}},v1e=function(e){var t=Fn(e),n=p8(e),r=f8(e);return function(i){return function(o){return(t(i,o)?n:r)(i)(o)}}},y1e=function(e){return h8(e)(Q)};function b1e(e,t){return function(n){var r=Fn(e),i=Fn(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 h8(e){var t=Fn(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 N$=new Set,fh=function(e){return e.size===0},C1e=function(e){return e.size},K$=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 q$(e){return oh(K$(oh(e)))}function hm(e){var t=Fn(e);return function(n,r){if(r===void 0){var i=hm(e);return function(o){return i(o,n)}}return q$(function(o){return t(o,r)})(n)}}function Fn(e){return function(t,n){if(n===void 0){var r=Fn(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 qb=function(e){return function(t){var n=[];return t.forEach(function(r){return n.push(r)}),n.sort(e.compare)}},S1e="ReadonlySet";function A8(e){return{show:function(t){var n=[];return t.forEach(function(r){n.push(e.show(r))}),"new Set([".concat(n.sort().join(", "),"])")}}}function m8(e){var t=hm(e);return ki(function(n,r){return t(n,r)&&t(r,n)})}var g8=function(e){return{concat:B$(e)}},w1e=function(e){return{concat:g8(e).concat,empty:N$}},_1e=function(e){return{concat:P$(e)}},x1e=function(e){return{concat:W$(e)}},T1e=l8;const I1e=Object.freeze(Object.defineProperty({__proto__:null,URI:S1e,chain:A1e,compact:y1e,difference:W$,elem:Fn,empty:N$,every:q$,filter:U$,filterMap:h8,foldMap:c8,fromArray:T1e,fromReadonlyArray:l8,fromSet:d1e,getDifferenceMagma:x1e,getEq:m8,getIntersectionSemigroup:_1e,getShow:A8,getUnionMonoid:w1e,getUnionSemigroup:g8,insert:f8,intersection:P$,isEmpty:fh,isSubset:hm,map:h1e,partition:m1e,partitionMap:g1e,reduce:u8,reduceRight:d8,remove:p8,separate:b1e,singleton:f1e,size:C1e,some:K$,toReadonlyArray:qb,toSet:p1e,toggle:v1e,union:B$},Symbol.toStringTag,{value:"Module"}));function An(e){return e[0]}function Zn(e){return e[1]}var E1e=function(e){return[Zn(e),An(e)]};function V$(e){return{URI:vi,_E:void 0,map:Am,ap:function(t,n){return[An(t)(An(n)),e.concat(Zn(t),Zn(n))]}}}var v8=function(e){return function(t){return[t,e.empty]}};function R1e(e){var t=V$(e);return{URI:vi,_E:void 0,map:t.map,ap:t.ap,of:v8(e)}}function z$(e){var t=V$(e);return{URI:vi,_E:void 0,map:t.map,ap:t.ap,chain:function(n,r){var i=r(An(n)),o=i[0],a=i[1];return[o,e.concat(Zn(n),a)]}}}function $1e(e){var t=z$(e);return{URI:vi,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,of:v8(e)}}function k1e(e){var t=function(r,i){for(var o=i(r),a=e.empty,s=An(o);s._tag==="Left";)a=e.concat(a,Zn(o)),o=i(s.left),s=An(o);return[s.right,e.concat(a,Zn(o))]},n=z$(e);return{URI:vi,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,chainRec:t}}var y8=function(e,t){return x(e,x8(t))},Am=function(e,t){return x(e,G$(t))},b8=function(e,t,n){return x(e,_8(t,n))},C8=function(e,t){return x(e,J$(t))},S8=function(e,t){return x(e,Z$(t))},Q$=function(e,t,n){return x(e,X$(t,n))},H$=function(e){var t=ek();return function(n,r){return x(n,t(r))}},Y$=function(e,t,n){return x(e,tk(t,n))},w8=function(e){var t=T8(e);return function(n,r){return x(n,t(r))}},_8=function(e,t){return function(n){return[t(An(n)),e(Zn(n))]}},G$=function(e){return function(t){return[e(An(t)),Zn(t)]}},J$=function(e){return function(t){return[An(t),e(Zn(t))]}},x8=function(e){return function(t){return[An(t),Zn(e)]}},Z$=function(e){return function(t){return[e(t),Zn(t)]}},Vb=An,O1e=Z$(Q),X$=function(e,t){return function(n){return t(e,An(n))}},ek=function(){return function(e){return function(t){return e(An(t))}}},tk=function(e,t){return function(n){return t(An(n),e)}},T8=function(e){return function(t){return function(n){return e.map(t(An(n)),function(r){return[r,Zn(n)]})}}},nk=function(e){return function(t){return e.map(An(t),function(n){return[n,Zn(t)]})}},vi="ReadonlyTuple",I8={URI:vi,map:Am},M1e=He(I8),F1e={URI:vi,bimap:b8,mapLeft:C8},j1e={URI:vi,compose:y8},L1e={URI:vi,map:Am,extend:S8,extract:Vb},D1e={URI:vi,reduce:Q$,foldMap:H$,reduceRight:Y$},U1e={URI:vi,map:Am,reduce:Q$,foldMap:H$,reduceRight:Y$,traverse:w8,sequence:nk},B1e=G$,P1e=J$,W1e={URI:vi,compose:y8,map:Am,bimap:b8,mapLeft:C8,extract:Vb,extend:S8,reduce:Q$,foldMap:H$,reduceRight:Y$,traverse:w8,sequence:nk};const N1e=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:F1e,Comonad:L1e,Foldable:D1e,Functor:I8,Semigroupoid:j1e,Traversable:U1e,URI:vi,bimap:_8,compose:x8,duplicate:O1e,extend:Z$,extract:Vb,flap:M1e,foldMap:ek,fst:An,getApplicative:R1e,getApply:V$,getChain:z$,getChainRec:k1e,getMonad:$1e,map:B1e,mapFst:G$,mapLeft:P1e,mapSnd:J$,readonlyTuple:W1e,reduce:X$,reduceRight:tk,sequence:nk,snd:Zn,swap:E1e,traverse:T8},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)},K1e=H9,du=Fo,rk=function(e){return function(t){return Object.keys(t).sort(e.compare)}},q1e=rk(Z);function ik(e){if(typeof e=="function")return ik(Z)(e);var t=rk(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 ok=ik(Z)(function(e,t){return[e,t]});function V1e(e){return function(t){var n=ok(t),r=n.length;return e.unfold(0,function(i){return i<r?ye([n[i],i+1]):Re})}}var E8=_$,R8=wa;function $8(e){return function(t){if(!gt.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}var z1e=function(e,t){return k8(e,function(){return t})},k8=function(e,t){return function(n){if(!R8(e,n))return Re;var r=Object.assign({},n);return r[e]=t(n[e]),ye(r)}};function Q1e(e){var t=$8(e);return function(n){var r=O8(e,n);return tn(r)?Re:ye([r.value,t(n)])}}var H1e=Mb,O8=cu,Y1e=Fb,G1e=T$;function J1e(){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 Z1e(e){return"compare"in e?md(e):md(Z)(e)}function X1e(){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 eCe=Y9;function tCe(e){return G9(e)}function ak(e){return jb(e)}function mm(e){return np(e)}var nCe=function(e){var t=ak(e);return function(n){return function(r){return e.map(x(r,t(n)),bl)}}},rCe=function(e){var t=ak(e);return function(n){return function(r){return e.map(x(r,t(n)),Cl)}}},iCe=Lb;function oCe(e){return Db(e)}var aCe=Ub;function sCe(e){return Bb(e)}function M8(e,t){return J9(e,t)}var lCe=ok,uCe=function(e){return M8(Cy(),tN)(e)};function cCe(e,t){return I$(e,t)}var dCe=Z9,fCe=X9,pCe=E$,F8=function(e){var t=R$(e);return function(n){return function(r){return du(r)?vd({},n):du(n)?vd({},r):t(n)(r)}}},j8=function(e){return function(t){return function(n){return du(n)||du(t)?{}:$$(e)(t)(n)}}},L8=function(e){return function(t){return du(t)?vd({},e):du(e)?vd({},t):k$(e)(t)}},uo=hi,gm=lc,co=Ai,fo=mi,po=gi,vm=uc,ym=cc,bm=dc,Cm=fc,Sm=pc,wm=hc,_m=Ac,D8=Pb,U8=Wb,B8=Nb,P8=Kb,rp=Xo,W8=fm,sk=function(e){return function(t){var n=rk(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]))},l=0,u=o;l<u.length;l++){var c=u[l];s(c)}return a}}},hCe=O$,ACe=M$,mCe=F$,gCe=j$;function vCe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?lh(e[0]):lh(Z).apply(void 0,e)}function yCe(e){return"compare"in e?uh(e):uh(Z)(e)}function bCe(){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 bl=rs,Cl=is,Kn="Record";function CCe(e){return"compare"in e?pv(e):pv(Z)(e)}var SCe=e8,wCe=t8,N8={URI:Kn,map:uo},_Ce=He(N8),xCe={URI:Kn,map:uo,mapWithIndex:gm},TCe=function(e){return{URI:Kn,reduce:co(e),foldMap:fo(e),reduceRight:po(e)}},ICe=function(e){return{URI:Kn,reduce:co(e),foldMap:fo(e),reduceRight:po(e),reduceWithIndex:Sm(e),foldMapWithIndex:wm(e),reduceRightWithIndex:_m(e)}},ph={URI:Kn,compact:bl,separate:Cl},ECe={URI:Kn,map:uo,compact:bl,separate:Cl,filter:vm,filterMap:ym,partition:bm,partitionMap:Cm},RCe={URI:Kn,map:uo,mapWithIndex:gm,compact:bl,separate:Cl,filter:vm,filterMap:ym,partition:bm,partitionMap:Cm,filterMapWithIndex:B8,filterWithIndex:P8,partitionMapWithIndex:D8,partitionWithIndex:U8},K8=function(e){return{URI:Kn,map:uo,reduce:co(e),foldMap:fo(e),reduceRight:po(e),traverse:rp(e),sequence:W8(e)}},$Ce=function(e){return{URI:Kn,map:uo,mapWithIndex:gm,reduce:co(e),foldMap:fo(e),reduceRight:po(e),reduceWithIndex:Sm(e),foldMapWithIndex:wm(e),reduceRightWithIndex:_m(e),traverse:rp(e),sequence:W8(e),traverseWithIndex:sk(e)}},kCe=function(e){var t=K8(e);return{URI:Kn,map:uo,reduce:co(e),foldMap:fo(e),reduceRight:po(e),traverse:t.traverse,sequence:t.sequence,compact:bl,separate:Cl,filter:vm,filterMap:ym,partition:bm,partitionMap:Cm,wither:ro(t,ph),wilt:no(t,ph)}},q8=function(e){var t=F8(e);return{concat:function(n,r){return t(r)(n)}}},OCe=function(e){return{concat:q8(e).concat,empty:{}}},MCe=function(e){var t=j8(e);return{concat:function(n,r){return t(r)(n)}}},FCe=function(){return{concat:function(e,t){return L8(t)(e)}}},jCe={URI:Kn,reduce:co(Z),foldMap:fo(Z),reduceRight:po(Z)},LCe={URI:Kn,reduce:co(Z),foldMap:fo(Z),reduceRight:po(Z),reduceWithIndex:Sm(Z),foldMapWithIndex:wm(Z),reduceRightWithIndex:_m(Z)},lk={URI:Kn,map:uo,reduce:co(Z),foldMap:fo(Z),reduceRight:po(Z),traverse:rp(Z),sequence:mm},DCe={URI:Kn,map:uo,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:sk(Z)},V8=ro(lk,ph),z8=no(lk,ph),UCe={URI:Kn,map:uo,reduce:co(Z),foldMap:fo(Z),reduceRight:po(Z),traverse:rp(Z),sequence:mm,compact:bl,separate:Cl,filter:vm,filterMap:ym,partition:bm,partitionMap:Cm,wither:V8,wilt:z8},BCe={},PCe=E8,WCe=s8,NCe={URI:Kn,map:uo,reduce:co(Z),foldMap:fo(Z),reduceRight:po(Z),traverse:rp(Z),sequence:mm,compact:bl,separate:Cl,filter:vm,filterMap:ym,partition:bm,partitionMap:Cm,mapWithIndex:gm,reduceWithIndex:Sm(Z),foldMapWithIndex:wm(Z),reduceRightWithIndex:_m(Z),filterMapWithIndex:B8,filterWithIndex:P8,partitionMapWithIndex:D8,partitionWithIndex:U8,traverseWithIndex:sk(Z),wither:V8,wilt:z8};const KCe=Object.freeze(Object.defineProperty({__proto__:null,Compactable:ph,Filterable:ECe,FilterableWithIndex:RCe,Foldable:jCe,FoldableWithIndex:LCe,Functor:N8,FunctorWithIndex:xCe,Traversable:lk,TraversableWithIndex:DCe,URI:Kn,Witherable:UCe,collect:ik,compact:bl,deleteAt:$8,difference:L8,elem:pCe,empty:BCe,every:dCe,filter:hCe,filterMap:ACe,filterMapWithIndex:aCe,filterWithIndex:sCe,flap:_Ce,foldMap:yCe,foldMapWithIndex:Z1e,fromEntries:uCe,fromFoldable:M8,fromFoldableMap:cCe,getDifferenceMagma:FCe,getEq:SCe,getFoldable:TCe,getFoldableWithIndex:ICe,getIntersectionSemigroup:MCe,getMonoid:wCe,getShow:CCe,getTraversable:K8,getTraversableWithIndex:$Ce,getUnionMonoid:OCe,getUnionSemigroup:q8,getWitherable:kCe,has:R8,hasOwnProperty:WCe,insertAt:PCe,intersection:j8,isEmpty:du,isSubrecord:H1e,keys:q1e,lookup:O8,map:G1e,mapWithIndex:Y1e,modifyAt:k8,partition:mCe,partitionMap:gCe,partitionMapWithIndex:iCe,partitionWithIndex:oCe,pop:Q1e,record:NCe,reduce:vCe,reduceRight:bCe,reduceRightWithIndex:X1e,reduceWithIndex:J1e,separate:Cl,sequence:mm,singleton:eCe,size:K1e,some:fCe,toArray:ok,toEntries:lCe,toUnfoldable:V1e,traverse:ak,traverseWithIndex:tCe,union:F8,updateAt:z1e,upsertAt:E8,wilt:rCe,wither:nCe},Symbol.toStringTag,{value:"Module"}));var qCe=function(e){return function(t){return Ft(e(t))}},VCe=function(e){return function(t){return Ax(e(t))}},zCe=function(){return function(e){return!0}},QCe=function(e){return function(t){return!e(t)}},HCe=function(e){return function(t){return function(n){return t(n)||e(n)}}},YCe=function(e){return function(t){return function(n){return t(n)&&e(n)}}},GCe=function(){return function(e){return!1}},JCe=function(e){return function(t){return function(n){return t(n)&&e(n)}}};const ZCe=Object.freeze(Object.defineProperty({__proto__:null,and:YCe,compose:JCe,fromEitherK:VCe,fromOptionK:qCe,id:zCe,not:QCe,or:HCe,zero:GCe},Symbol.toStringTag,{value:"Module"}));var Q8=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])})}}},XCe=function(e){return function(t){return e.sub(e.zero,t)}},eSe=Q8,tSe=MU;const nSe=Object.freeze(Object.defineProperty({__proto__:null,getFunctionRing:tSe,getTupleRing:eSe,negate:XCe,tuple:Q8},Symbol.toStringTag,{value:"Module"})),rSe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var iSe=fx;const oSe=Object.freeze(Object.defineProperty({__proto__:null,getFunctionSemiring:iSe},Symbol.toStringTag,{value:"Module"}));var aSe=A8,sSe=m8;function lSe(e){var t=jr(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 uSe(e){var t=jr(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 cSe(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 ck(e){var t=jr(e);return function(n,r){if(r===void 0){var i=ck(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 dk(e){var t=jr(e);return function(n,r){if(r===void 0){var i=dk(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 dSe(e,t){return function(n){return function(r){for(var i=r.values(),o,a=new Set,s=new Set,l=jr(e),u=jr(t);!(o=i.next()).done;){var c=n(o.value);switch(c._tag){case"Left":l(c.left,a)||a.add(c.left);break;case"Right":u(c.right,s)||s.add(c.right);break}}return Be(a,s)}}}function fk(e){var t=jr(e);return function(n,r){if(r===void 0){var i=fk(e);return function(o){return i(o,n)}}return uk(function(o){return!t(o,r)})(n)}}var H8=function(e){return{concat:ck(e)}},fSe=function(e){return{concat:H8(e).concat,empty:new Set}},pSe=function(e){return{concat:dk(e)}},hSe=function(e){return{concat:fk(e)}},ASe=u8,mSe=c8,gSe=d8,vSe=function(e){return new Set([e])};function Y8(e){var t=jr(e);return function(n){return function(r){if(t(n)(r))return r;var i=new Set(r);return i.add(n),i}}}var G8=function(e){return function(t){return function(n){return uk(function(r){return!e.equals(t,r)})(n)}}},ySe=function(e){var t=jr(e),n=G8(e),r=Y8(e);return function(i){return function(o){return(t(i,o)?n:r)(i)(o)}}},J8=function(e){return function(t){for(var n=t.length,r=new Set,i=jr(e),o=0;o<n;o++){var a=t[o];i(a,r)||r.add(a)}return r}},bSe=function(e){return Z8(e)(Q)};function CSe(e,t){return function(n){var r=jr(e),i=jr(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 Z8(e){var t=jr(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 SSe=new Set,hh=function(e){return e.size===0},wSe=function(e){return e.size},_Se=K$,X8=q$,xSe=hm,jr=Fn,eq=function(e){return function(t){var n=[];return t.forEach(function(r){return n.push(r)}),n.sort(e.compare)}},TSe=hm;const ISe=Object.freeze(Object.defineProperty({__proto__:null,chain:uSe,compact:bSe,difference:fk,elem:jr,empty:SSe,every:X8,filter:uk,filterMap:Z8,foldMap:mSe,fromArray:J8,getDifferenceMagma:hSe,getEq:sSe,getIntersectionSemigroup:pSe,getShow:aSe,getUnionMonoid:fSe,getUnionSemigroup:H8,insert:Y8,intersection:dk,isEmpty:hh,isSubset:xSe,map:lSe,partition:cSe,partitionMap:dSe,reduce:ASe,reduceRight:gSe,remove:G8,separate:CSe,singleton:vSe,size:wSe,some:_Se,subset:TSe,toArray:eq,toggle:ySe,union:ck},Symbol.toStringTag,{value:"Module"}));var tq=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}}},nq=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(", "),"]")}}},ESe=nq,RSe=tq,$Se={show:function(e){return JSON.stringify(e)}},kSe={show:function(e){return JSON.stringify(e)}},OSe={show:function(e){return JSON.stringify(e)}};const MSe=Object.freeze(Object.defineProperty({__proto__:null,getStructShow:RSe,getTupleShow:ESe,showBoolean:$Se,showNumber:OSe,showString:kSe,struct:tq,tuple:nq},Symbol.toStringTag,{value:"Module"}));function pk(e){return function(t){return function(n){return e.of([t,n])}}}function hk(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 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 e.map(t(a),function(s){var l=s[0],u=s[1];return[o(l),u]})})}}}}function mk(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 gk(e){return function(t){return function(n){return e.of(t(n))}}}function vk(e){return function(t){return function(n){return e.map(t,function(r){return[r,n]})}}}function yk(e){return function(t){return function(n){return e.map(n(t),function(r){var i=r[0];return i})}}}function bk(e){return function(t){return function(n){return e.map(n(t),Zn)}}}function FSe(e){var t=Ak(e),n=hk(e),r=mk(e),i=yk(e),o=bk(e);return{map:function(a,s){return x(a,n(s))},ap:function(a,s){return x(a,t(s))},of:pk(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:gk(e),fromM:vk(e),evalState:function(a,s){return x(a,i(s))},execState:function(a,s){return x(a,o(s))}}}const jSe=Object.freeze(Object.defineProperty({__proto__:null,ap:Ak,chain:mk,evaluate:yk,execute:bk,fromF:vk,fromState:gk,getStateM:FSe,map:hk,of:pk},Symbol.toStringTag,{value:"Module"}));var Ck=function(e){return function(){return wb(e)}},Sk=pk(v$);function rq(e){return ho(o$(e))}function LSe(e){return ho(r9(e))}function iq(e){return ho(a$(e))}function DSe(e){return ho(i9(e))}function oq(e){return ho(s$(e))}function USe(e){return ho(a9(e))}var BSe=function(e){return X(e,i$)},PSe=function(e){return function(t){return wb(e(t)[0])}},aq=al(function(e){return Ck(e)},Sk),sq=iq,mc=oq,xm=rq,lq=gk(v$),uq=function(e){return ho(ml(e))},cq=function(e){return ho(l$(e))},WSe=function(e){return ho(u$(e))},ho=vk(sc),NSe=function(e){return function(t){return X(t,FA(e))}},dq=function(e){return function(t){return function(n){return e(n)(t)(n)}}},KSe=dq,fq=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return cq(e.apply(void 0,t))}},pq=function(e){return function(t){return x(t,Tm(fq(e)))}},qSe=pq,hq=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return uq(e.apply(void 0,t))}},Aq=function(e){return function(t){return x(t,Tm(hq(e)))}},VSe=Aq,mq=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return ho(e.apply(void 0,t))}},gq=function(e){return function(t){return x(t,Tm(mq(e)))}},zSe=gq,Ao=function(e,t){return x(e,vq(t))},as=function(e,t){return x(e,_k(t))},gc=function(e,t){return x(e,xk(t))},wk=function(e,t){return function(n){return x(e(n),Ib(function(){return t()(n)}))}},zb=function(e,t,n){return function(r){return x(e(r),A$(t,function(i){var o=i[0],a=i[1];return[n(o),a]}))}},Qb=function(e,t){return function(n){return x(e(n),m$(t))}},vq=hk(sc),QSe=function(e,t){return function(n){return zb(n,e,t)}},HSe=function(e){return function(t){return Qb(t,e)}},_k=Ak(wr),YSe=_k,ea=Sk,xk=mk(wr),Tm=xk,yq=Tm(Q),GSe=yq,bq=function(e){return function(t){return function(n){return x(t(n),S9(function(){return e()(n)}))}}},JSe=bq,Hb=Ck,un="StateReaderTaskEither",Tk={URI:un,map:Ao},ZSe=He(Tk),XSe={URI:un,of:ea},Yb={URI:un,map:Ao,ap:as},Cq=qt(Yb),ewe=Cq,Sq=Vt(Yb),twe=Sq,nwe={URI:un,map:Ao,ap:as,of:ea},qr={URI:un,map:Ao,ap:as,chain:gc},vc={URI:un,fromState:lq},rwe=m3(vc),iwe=g3(vc),owe=v3(vc),awe=y3(vc),swe=AE(vc),lwe=b3(vc,qr),uwe={URI:un,map:Ao,ap:as,of:ea,chain:gc},cwe={URI:un,map:Ao,ap:as,of:ea,chain:gc,fromIO:mc},dwe={URI:un,map:Ao,ap:as,of:ea,chain:gc,fromIO:mc,fromTask:xm},fwe={URI:un,map:Ao,ap:as,of:ea,chain:gc,throwError:Hb},wq=vt(qr),pwe=wq,hwe={URI:un,bimap:zb,mapLeft:Qb},Awe={URI:un,map:Ao,alt:wk},ip={URI:un,fromReader:sq},mwe=DA(ip),gwe=UA(ip),vwe=Ju(ip),_q=BA(ip,qr),ywe=_q,xq=PA(ip,qr),bwe=xq,ss={URI:un,fromEither:aq},Cwe=Po(ss),Swe=Wo(ss),wwe=Ou(ss,qr),Tq=$a(ss,qr),_we=Tq,Iq=ka(ss,qr),xwe=Iq,Twe=Gs(ss),Eq=Mu(ss,qr),Iwe=Eq,Ewe=di(ss),Gb={URI:un,fromIO:mc},Rwe=zo(Gb),$we=Ba(Gb,qr),kwe=Pa(Gb,qr),Jb={URI:un,fromIO:mc,fromTask:xm},Owe=Zu(Jb),Mwe=$f(Jb,qr),Fwe=kf(Jb,qr),jwe=yk(sc),Lwe=bk(sc),Dwe=Qt(Tk),Rq=Ht(qr),Uwe=Rq,$q=zt(Yb),Bwe=$q,kq=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 hn(s)?i:e(a+1,o)(s.right[1])(r)().then(function(l){if(hn(l))return l;var u=l.right,c=u[0],f=u[1];return s.right[0].push(c),s.right[1]=f,s})})},e(0,ci(t))(n)(r)().then(qu(function(i){var o=i[0],a=i[1];return[[o],a]})))}}}}},Ik=function(e){var t=kq(e);return function(n){return Tt(n)?t(n):ea(Ln)}},Pwe=Ik,Oq=function(e){return Ik(function(t,n){return e(n)})},Wwe=Oq(Q),Nwe={URI:un,map:Ao,of:ea,ap:as,chain:gc,bimap:zb,mapLeft:Qb,alt:wk,fromIO:mc,fromTask:xm,throwError:Hb},Kwe={URI:un,map:Ao,of:ea,ap:as,chain:gc,bimap:zb,mapLeft:Qb,alt:wk,fromIO:mc,fromTask:xm,throwError:Hb},qwe=function(e,t){return x(e(t),um(function(n){var r=n[0];return r}))},Vwe=function(e,t){return x(e(t),um(function(n){n[0];var r=n[1];return r}))};function zwe(e,t,n){return e(t)(n)()}const Qwe=Object.freeze(Object.defineProperty({__proto__:null,Alt:Awe,Applicative:nwe,Apply:Yb,Bifunctor:hwe,Chain:qr,FromEither:ss,FromIO:Gb,FromReader:ip,FromState:vc,FromTask:Jb,Functor:Tk,Monad:uwe,MonadIO:cwe,MonadTask:dwe,MonadThrow:fwe,Pointed:XSe,URI:un,alt:JSe,altW:bq,ap:_k,apFirst:Cq,apFirstW:ewe,apS:$q,apSW:Bwe,apSecond:Sq,apSecondW:twe,apW:YSe,ask:mwe,asks:gwe,asksStateReaderTaskEither:KSe,asksStateReaderTaskEitherW:dq,bimap:QSe,bind:Rq,bindTo:Dwe,bindW:Uwe,chain:xk,chainEitherK:Tq,chainEitherKW:_we,chainFirst:wq,chainFirstEitherK:Iq,chainFirstEitherKW:xwe,chainFirstIOK:kwe,chainFirstReaderK:xq,chainFirstReaderKW:bwe,chainFirstTaskK:Fwe,chainFirstW:pwe,chainIOEitherK:qSe,chainIOEitherKW:pq,chainIOK:$we,chainOptionK:wwe,chainReaderK:_q,chainReaderKW:ywe,chainReaderTaskEitherK:zSe,chainReaderTaskEitherKW:gq,chainStateK:lwe,chainTaskEitherK:VSe,chainTaskEitherKW:Aq,chainTaskK:Mwe,chainW:Tm,evalState:qwe,evaluate:jwe,execState:Vwe,execute:Lwe,filterOrElse:Eq,filterOrElseW:Iwe,flap:ZSe,flatten:GSe,flattenW:yq,fromEither:aq,fromEitherK:Ewe,fromIO:mc,fromIOEither:cq,fromIOEitherK:fq,fromIOK:Rwe,fromOption:Cwe,fromOptionK:Swe,fromPredicate:Twe,fromReader:sq,fromReaderEither:WSe,fromReaderK:vwe,fromReaderTaskEither:ho,fromReaderTaskEitherK:mq,fromState:lq,fromStateK:swe,fromTask:xm,fromTaskEither:uq,fromTaskEitherK:hq,fromTaskK:Owe,get:rwe,gets:awe,left:Ck,leftIO:USe,leftReader:DSe,leftState:PSe,leftTask:LSe,local:NSe,map:vq,mapLeft:HSe,modify:owe,of:ea,put:iwe,right:Sk,rightIO:oq,rightReader:iq,rightState:BSe,rightTask:rq,run:zwe,sequenceArray:Wwe,stateReaderTaskEither:Nwe,stateReaderTaskEitherSeq:Kwe,throwError:Hb,traverseArray:Oq,traverseArrayWithIndex:Pwe,traverseReadonlyArrayWithIndex:Ik,traverseReadonlyNonEmptyArrayWithIndex:kq},Symbol.toStringTag,{value:"Module"}));function Hwe(e){return function(t){return{peek:t.peek,pos:e}}}function Ywe(e){return function(t){return{peek:t.peek,pos:e(t.pos)}}}function Gwe(e){return function(t){return t.peek(e(t.pos))}}function Jwe(e){return function(t){return function(n){return e.map(t(n.pos),function(r){return n.peek(r)})}}}var Mq=function(e,t){return x(e,jq(t))},Zwe=function(e,t){return x(e,Ek(t))},Ek=function(e){return function(t){return{peek:function(n){return e({peek:t.peek,pos:n})},pos:t.pos}}},Fq=function(e){return e.peek(e.pos)},Xwe=Ek(Q),jq=function(e){return function(t){return{peek:function(n){return e(t.peek(n))},pos:t.pos}}},Rk="Store",Lq={URI:Rk,map:Mq},e_e=He(Lq),Dq={URI:Rk,map:Mq,extend:Zwe,extract:Fq},t_e=Dq;const n_e=Object.freeze(Object.defineProperty({__proto__:null,Comonad:Dq,Functor:Lq,URI:Rk,duplicate:Xwe,experiment:Jwe,extend:Ek,extract:Fq,flap:e_e,map:jq,peeks:Gwe,seek:Hwe,seeks:Ywe,store:t_e},Symbol.toStringTag,{value:"Module"}));function $k(e,t){return function(n,r){return t.compose(e.second(r),e.first(n))}}function Uq(e,t){var n=$k(e,t);return function(r,i){return t.compose(n(r,i),e.promap(t.id(),Q,function(o){return[o,o]}))}}function r_e(e){return $k(e,e)}function i_e(e){return Uq(e,e)}const o_e=Object.freeze(Object.defineProperty({__proto__:null,fanOut:Uq,fanout:i_e,split:$k,splitStrong:r_e},Symbol.toStringTag,{value:"Module"}));var a_e=function(){return{concat:function(e,t){return Object.assign({},e,t)}}},s_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 l_e=Object.freeze(Object.defineProperty({__proto__:null,evolve:s_e,getAssignSemigroup:a_e},Symbol.toStringTag,{value:"Module"}));var u_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{u(r.next(c))}catch(f){a(f)}}function l(c){try{u(r.throw(c))}catch(f){a(f)}}function u(c){c.done?o(c.value):i(c.value).then(s,l)}u((r=r.apply(e,t||[])).next())})},c_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(u){return function(c){return l([u,c])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Bq=VA(Bn),d_e=NE(Bn),f_e=nr,Pq=KE(Bn),Im=function(e){return Zb(Cr(e))},Zb=P0(Ke),p_e=fl(pf),Wq=qE(Ke),h_e=Wq,kk=q0(zf),A_e=kk,Nq=kk,m_e=Nq,Kq=V0(bn),g_e=Kq,v_e=W0(Bn),qq=function(e){return function(){return u_e(void 0,void 0,void 0,function(){return c_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]}})})}},y_e=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return qq(function(){return e.apply(void 0,t)})}},b_e=N0(Bn),C_e=PE(bn),S_e=K0(Bn),w_e=WE(bn),Ok=z0(Ke),Vq=Q0(ic),ta=Bq,Xb=Lf(bn),__e=Xb(Q),Mk=H0(bn),x_e=Mk,e1=zA(Bn),T_e=e1(),Fk=qo(Ke,Bu),jk=La(Ke,Bu,uf),zq=Da(Ke,Fa),Qq=Ua(Ke,Fa),Hq=sl(Ke,Fa),Yq=ll(Ke,Fa),Bi=function(e,t){return x(e,Ok(t))},yc=function(e,t){return x(e,Vq(t))},t1=function(e,t){return x(e,Xb(t))},Gq=function(e,t){return x(e,Mk(t))},I_e=function(e,t){return x(e,zq(t))},E_e=function(e,t){return x(e,Qq(t))},R_e=function(e,t){return x(e,Hq(t))},$_e=function(e,t){return x(e,Yq(t))},Cn="TaskOption",Lk={URI:Cn,map:Bi},k_e=He(Lk),Jq={URI:Cn,of:ta},n1={URI:Cn,map:Bi,ap:yc},O_e=qt(n1),M_e=Vt(n1),F_e={URI:Cn,map:Bi,ap:yc,of:ta},Zq=function(e,t){return x(e,Xb(function(n){return x(t,Ok(n))}))},j_e={URI:Cn,map:Bi,ap:Zq},L_e={URI:Cn,map:Bi,ap:Zq,of:ta},ls={URI:Cn,map:Bi,ap:yc,chain:t1},D_e=vt(ls),U_e={URI:Cn,map:Bi,alt:Gq},Xq={URI:Cn,zero:e1},B_e=Gd(Xq,Jq),P_e={URI:Cn,map:Bi,ap:yc,of:ta,alt:Gq,zero:e1},W_e={URI:Cn,map:Bi,ap:yc,of:ta,chain:t1},N_e={URI:Cn,map:Bi,ap:yc,of:ta,chain:t1,fromIO:Im},K_e={URI:Cn,map:Bi,ap:yc,of:ta,chain:t1,fromIO:Im,fromTask:Zb},q_e={URI:Cn,compact:Fk,separate:jk},V_e={URI:Cn,map:Bi,compact:Fk,separate:jk,filter:I_e,filterMap:E_e,partition:R_e,partitionMap:$_e},r1={URI:Cn,fromIO:Im},z_e=zo(r1),Q_e=Ba(r1,ls),H_e=Pa(r1,ls),i1={URI:Cn,fromEither:Pq},Y_e=di(i1),G_e=$a(i1,ls),J_e=ka(i1,ls),o1={URI:Cn,fromIO:Im,fromTask:Zb},Z_e=Zu(o1),X_e=$f(o1,ls),exe=kf(o1,ls),txe=ta(gn),nxe=Qt(Lk),rxe=Ht(ls),ixe=zt(n1),Dk=ta(Ln),e7=function(e){return X(Qf(e),fl(x0(Ur)))},Uk=function(e){var t=e7(e);return function(n){return Tt(n)?t(n):Dk}},t7=function(e){return function(t){return function(){return Nd(t).reduce(function(n,r,i){return n.then(function(o){return tn(o)?n:e(i+1,r)().then(function(a){return tn(a)?a:(o.value.push(a.value),o)})})},e(0,ci(t))().then(Ko(Gh)))}}},Bk=function(e){var t=t7(e);return function(n){return Tt(n)?t(n):Dk}},oxe=Uk,n7=function(e){return Uk(function(t,n){return e(n)})},axe=n7(Q),sxe=Bk,r7=function(e){return Bk(function(t,n){return e(n)})},lxe=r7(Q);const uxe=Object.freeze(Object.defineProperty({__proto__:null,Alt:U_e,Alternative:P_e,ApT:Dk,ApplicativePar:F_e,ApplicativeSeq:L_e,ApplyPar:n1,ApplySeq:j_e,Chain:ls,Compactable:q_e,Do:txe,Filterable:V_e,FromEither:i1,FromIO:r1,FromTask:o1,Functor:Lk,Monad:W_e,MonadIO:N_e,MonadTask:K_e,Pointed:Jq,Zero:Xq,alt:Mk,altW:x_e,ap:Vq,apFirst:O_e,apS:ixe,apSecond:M_e,bind:rxe,bindTo:nxe,chain:Xb,chainEitherK:G_e,chainFirst:D_e,chainFirstEitherK:J_e,chainFirstIOK:H_e,chainFirstTaskK:exe,chainIOK:Q_e,chainNullableK:C_e,chainOptionK:w_e,chainTaskK:X_e,compact:Fk,filter:zq,filterMap:Qq,flap:k_e,flatten:__e,fold:A_e,foldW:m_e,fromEither:Pq,fromEitherK:Y_e,fromIO:Im,fromIOK:z_e,fromNullable:v_e,fromNullableK:b_e,fromOption:f_e,fromOptionK:S_e,fromPredicate:d_e,fromTask:Zb,fromTaskEither:p_e,fromTaskK:Z_e,getOrElse:Kq,getOrElseW:g_e,guard:B_e,map:Ok,match:Wq,matchE:kk,matchEW:Nq,matchW:h_e,none:T_e,of:ta,partition:Hq,partitionMap:Yq,separate:jk,sequenceArray:axe,sequenceSeqArray:lxe,some:Bq,traverseArray:n7,traverseArrayWithIndex:oxe,traverseReadonlyArrayWithIndex:Uk,traverseReadonlyArrayWithIndexSeq:Bk,traverseReadonlyNonEmptyArrayWithIndex:e7,traverseReadonlyNonEmptyArrayWithIndexSeq:t7,traverseSeqArray:r7,traverseSeqArrayWithIndex:sxe,tryCatch:qq,tryCatchK:y_e,zero:e1},Symbol.toStringTag,{value:"Module"}));var Xe=function(e){return e._tag==="Left"},Nt=function(e){return e._tag==="Right"};function fu(e){return e._tag==="Both"}function kn(e){return{_tag:"Left",left:e}}function Vr(e){return{_tag:"Right",right:e}}function st(e,t){return{_tag:"Both",left:e,right:t}}var Pk=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)}}},cxe=Pk,Us=Pk,dxe=Us,i7=Us(Vr,kn,function(e,t){return st(t,e)});function fxe(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 pxe(e,t){return ki(function(n,r){return Xe(n)?Xe(r)&&e.equals(n.left,r.left):Nt(n)?Nt(r)&&t.equals(n.right,r.right):fu(r)&&e.equals(n.left,r.left)&&t.equals(n.right,r.right)})}function o7(e,t){return{concat:function(n,r){return Xe(n)?Xe(r)?kn(e.concat(n.left,r.left)):Nt(r)?st(n.left,r.right):st(e.concat(n.left,r.left),r.right):Nt(n)?Xe(r)?st(r.left,n.right):Nt(r)?Vr(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):Nt(r)?st(n.left,t.concat(n.right,r.right)):st(e.concat(n.left,r.left),t.concat(n.right,r.right))}}}var a1=function(e){return{URI:yi,_E:void 0,map:bc,ap:function(t,n){return Xe(t)?Xe(n)?kn(e.concat(t.left,n.left)):Nt(n)?kn(t.left):kn(e.concat(t.left,n.left)):Nt(t)?Xe(n)?kn(n.left):Nt(n)?Vr(t.right(n.right)):st(n.left,t.right(n.right)):Xe(n)?kn(e.concat(t.left,n.left)):Nt(n)?st(t.left,t.right(n.right)):st(e.concat(t.left,n.left),t.right(n.right))}}};function hxe(e){var t=a1(e);return{URI:yi,_E:void 0,map:bc,ap:t.ap,of:Em}}function a7(e){var t=a1(e),n=function(r,i){if(Xe(r))return r;if(Nt(r))return i(r.right);var o=i(r.right);return Xe(o)?kn(e.concat(r.left,o.left)):Nt(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 Axe(e){var t=a7(e);return{URI:yi,_E:void 0,map:bc,of:Em,ap:t.ap,chain:t.chain,throwError:kn}}function mxe(e){return Xe(e)?ye(e.left):Nt(e)?Re:ye(e.left)}function gxe(e){return Xe(e)?Re:(Nt(e),ye(e.right))}function vxe(e){return function(t){return tn(t)?kn(e):st(e,t.value)}}function yxe(e){return function(t){return tn(t)?Vr(e):st(t.value,e)}}function bxe(e){return Xe(e)?ye(e.left):Re}function Cxe(e){return Nt(e)?ye(e.right):Re}var Sxe=function(e,t){return tn(e)?tn(t)?Re:ye(Vr(t.value)):tn(t)?ye(kn(e.value)):ye(st(e.value,t.value))},bc=function(e,t){return x(e,zk(t))},s7=function(e,t,n){return x(e,qk(t,n))},l7=function(e,t){return x(e,Vk(t))},Wk=function(e,t,n){return x(e,c7(t,n))},Nk=function(e){var t=d7(e);return function(n,r){return x(n,t(r))}},Kk=function(e,t,n){return x(e,f7(t,n))},u7=function(e){var t=p7(e);return function(n,r){return x(n,t(r))}},qk=function(e,t){return function(n){return Xe(n)?kn(e(n.left)):Nt(n)?Vr(t(n.right)):st(e(n.left),t(n.right))}},Vk=function(e){return function(t){return Xe(t)?kn(e(t.left)):fu(t)?st(e(t.left),t.right):t}},zk=function(e){return function(t){return Xe(t)?t:Nt(t)?Vr(e(t.right)):st(t.left,e(t.right))}},c7=function(e,t){return function(n){return Xe(n)?e:t(e,n.right)}},d7=function(e){return function(t){return function(n){return Xe(n)?e.empty:t(n.right)}}},f7=function(e,t){return function(n){return Xe(n)?e:t(n.right,e)}},p7=function(e){return function(t){return function(n){return Xe(n)?e.of(n):Nt(n)?e.map(t(n.right),Vr):e.map(t(n.right),function(r){return st(n.left,r)})}}},Qk=function(e){return function(t){return Xe(t)?e.of(t):Nt(t)?e.map(t.right,Vr):e.map(t.right,function(n){return st(t.left,n)})}},Em=Vr,yi="These",Hk={URI:yi,map:bc},wxe=He(Hk),_xe={URI:yi,of:Em},xxe={URI:yi,bimap:s7,mapLeft:l7},Txe={URI:yi,fromThese:Q},Ixe={URI:yi,reduce:Wk,foldMap:Nk,reduceRight:Kk},Exe={URI:yi,map:bc,reduce:Wk,foldMap:Nk,reduceRight:Kk,traverse:u7,sequence:Qk},Yk={URI:yi,fromEither:Q},Rxe=Po(Yk),$xe=Wo(Yk),kxe=function(e){return function(t){return function(n){return Xe(n)?!1:e.equals(t,n.right)}}},Oxe=function(e){return function(t){return Xe(t)?!1:e(t.right)}},Gk=function(e,t){return function(n){return Xe(n)?[n.left,t()]:Nt(n)?[e(),n.right]:[n.left,n.right]}},Mxe=function(e,t){return Gk(function(){return e},function(){return t})},h7=Em(Ln),Jk=function(e){return function(t){return function(n){var r=Re,i=t(0,ci(n));if(Xe(i))return i;fu(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;fu(s)&&(r=tn(r)?ye(s.left):ye(e.concat(r.value,s.left))),o.push(s.right)}return tn(r)?Vr(o):st(r.value,o)}}},Fxe=function(e){return function(t){var n=Jk(e)(t);return function(r){return Tt(r)?n(r):h7}}},jxe={URI:yi,map:bc,bimap:s7,mapLeft:l7,reduce:Wk,foldMap:Nk,reduceRight:Kk,traverse:u7,sequence:Qk};const Lxe=Object.freeze(Object.defineProperty({__proto__:null,ApT:h7,Bifunctor:xxe,Foldable:Ixe,FromEither:Yk,FromThese:Txe,Functor:Hk,Pointed:_xe,Traversable:Exe,URI:yi,bimap:qk,both:st,elem:kxe,exists:Oxe,flap:wxe,fold:dxe,foldMap:d7,foldW:cxe,fromOption:Rxe,fromOptionK:$xe,fromOptions:Sxe,getApplicative:hxe,getApply:a1,getChain:a7,getEq:pxe,getLeft:mxe,getLeftOnly:bxe,getMonad:Axe,getRight:gxe,getRightOnly:Cxe,getSemigroup:o7,getShow:fxe,isBoth:fu,isLeft:Xe,isRight:Nt,left:kn,leftOrBoth:vxe,map:zk,mapLeft:Vk,match:Us,matchW:Pk,of:Em,reduce:c7,reduceRight:f7,right:Vr,rightOrBoth:yxe,sequence:Qk,swap:i7,these:jxe,toTuple:Mxe,toTuple2:Gk,traverse:p7,traverseReadonlyArrayWithIndex:Fxe,traverseReadonlyNonEmptyArrayWithIndex:Jk},Symbol.toStringTag,{value:"Module"}));function hv(e){return X(Vr,e.of)}function s1(e){return X(kn,e.of)}function Zk(e){return X(st,e.of)}function Xk(e){return function(t){return e.map(t,Vr)}}function eO(e){return function(t){return e.map(t,kn)}}function tO(e){return Kd(e,Hk)}function nO(e,t){return Ra(e,a1(t))}function rO(e,t){var n=s1(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 kn(t.concat(o,s))},function(s){return st(o,s)},function(s,l){return st(t.concat(o,s),l)}))}))}}}function iO(e){return function(t,n){return function(r){return e.map(r,qk(t,n))}}}function oO(e){return function(t){return function(n){return e.map(n,Vk(t))}}}function A7(e){return function(t,n,r){return function(i){return e.map(i,Us(t,n,r))}}}function aO(e){return function(t,n,r){return function(i){return e.chain(i,Us(t,n,r))}}}function sO(e){return function(t){return e.map(t,i7)}}function lO(e){return function(t,n){return function(r){return e.map(r,Gk(t,n))}}}function Dxe(e){var t=tO(e),n=iO(e),r=oO(e),i=aO(e),o=lO(e),a=hv(e),s=function(l,u){return x(l,t(u))};return{map:s,bimap:function(l,u,c){return x(l,n(u,c))},mapLeft:function(l,u){return x(l,r(u))},fold:function(l,u,c,f){return x(l,i(u,c,f))},swap:sO(e),rightM:Xk(e),leftM:eO(e),left:s1(e),right:hv(e),both:Zk(e),toTuple:function(l,u,c){return x(l,o(function(){return u},function(){return c}))},getMonad:function(l){var u=nO(e,l),c=rO(e,l);return{_E:void 0,map:s,of:a,ap:function(f,p){return x(f,u(p))},chain:function(f,p){return x(f,c(p))}}}}}const Uxe=Object.freeze(Object.defineProperty({__proto__:null,ap:nO,bimap:iO,both:Zk,chain:rO,getTheseM:Dxe,left:s1,leftF:eO,map:tO,mapLeft:oO,match:A7,matchE:aO,right:hv,rightF:Xk,swap:sO,toTuple2:lO},Symbol.toStringTag,{value:"Module"}));var Bxe=s1(Bn),m7=hv(Bn),Pxe=Zk(Bn),uO=Xk(Ke),g7=eO(Ke),v7=X(Cr,uO),Wxe=X(Cr,g7),y7=nr,b7=nr,l1=v7,Nxe=Cr,cO=uO,C7=A7(Ke),Kxe=C7,S7=aO(bn),w7=S7,_7=w7,qxe=_7,Vxe=sO(Ke),Cc=function(e,t){return x(e,x7(t))},dO=function(e,t,n){return x(e,T7(t,n))},fO=function(e,t){return x(e,I7(t))},x7=tO(Ke),T7=iO(Ke),I7=oO(Ke),Rm=m7,_r="TaskThese",pO=function(e,t){var n=nO(e,t);return{URI:_r,_E:void 0,map:Cc,ap:function(r,i){return x(r,n(i))}}};function E7(e,t){var n=pO(e,t).ap;return{URI:_r,_E:void 0,map:Cc,ap:n,of:Rm}}function R7(e){var t=pO(rm,e),n=rO(bn,e);return{URI:_r,_E:void 0,map:Cc,ap:t.ap,chain:function(r,i){return x(r,n(i))}}}function zxe(e){var t=E7(rm,e),n=R7(e);return{URI:_r,_E:void 0,map:Cc,ap:t.ap,of:Rm,chain:n.chain,fromIO:l1,fromTask:cO}}var $7={URI:_r,map:Cc},Qxe=He($7),Hxe={URI:_r,of:Rm},Yxe={URI:_r,bimap:dO,mapLeft:fO},u1={URI:_r,fromEither:y7},Gxe=Po(u1),Jxe=Wo(u1),Zxe=Gs(u1),k7={URI:_r,fromThese:b7},Xxe=C3(k7),O7={URI:_r,fromIO:l1},eTe=zo(O7),M7={URI:_r,fromIO:l1,fromTask:cO},tTe=Zu(M7),F7=lO(Ke),hO=Rm(Ln),j7=function(e){var t=Jk(e);return function(n){return X(Qf(n),fl(t(Ur)))}},nTe=function(e){return function(t){var n=j7(e)(t);return function(r){return Tt(r)?n(r):hO}}},L7=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(fu(s)){var l=a.right;return l.push(s.right),fu(a)?st(e.concat(a.left,s.left),l):st(s.left,l)}return a.right.push(s.right),a})})},t(0,ci(n))().then(zk(Gh)))}}}},rTe=function(e){return function(t){var n=L7(e)(t);return function(r){return Tt(r)?n(r):hO}}},iTe={URI:_r,map:Cc},oTe={URI:_r,bimap:dO,mapLeft:fO},aTe=function(e,t){return F7(function(){return e},function(){return t})},sTe={URI:_r,map:Cc,bimap:dO,mapLeft:fO},lTe=function(e,t){return vn(db)(o7(e,t))};const uTe=Object.freeze(Object.defineProperty({__proto__:null,ApT:hO,Bifunctor:Yxe,FromEither:u1,FromIO:O7,FromTask:M7,FromThese:k7,Functor:$7,Pointed:Hxe,URI:_r,bifunctorTaskThese:oTe,bimap:T7,both:Pxe,flap:Qxe,fold:w7,foldW:qxe,fromEither:y7,fromIO:l1,fromIOEither:Nxe,fromIOK:eTe,fromOption:Gxe,fromOptionK:Jxe,fromPredicate:Zxe,fromTask:cO,fromTaskK:tTe,fromThese:b7,fromTheseK:Xxe,functorTaskThese:iTe,getApplicative:E7,getApply:pO,getChain:R7,getMonad:zxe,getSemigroup:lTe,left:Bxe,leftIO:Wxe,leftTask:g7,map:x7,mapLeft:I7,match:C7,matchE:S7,matchEW:_7,matchW:Kxe,of:Rm,right:m7,rightIO:v7,rightTask:uO,swap:Vxe,taskThese:sTe,toTuple:aTe,toTuple2:F7,traverseReadonlyArrayWithIndex:nTe,traverseReadonlyArrayWithIndexSeq:rTe,traverseReadonlyNonEmptyArrayWithIndex:j7,traverseReadonlyNonEmptyArrayWithIndexSeq:L7},Symbol.toStringTag,{value:"Module"}));function cTe(e,t){return function(n){return n(t(n(e.empty)))}}function dTe(e){return function(t){return[e(t),t]}}function fTe(e){return function(t){return function(n){return[t(n),e(n)]}}}function pTe(e){return function(t){return function(n){return t(e(n))}}}function hTe(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:AO,_E:void 0,map:D7,extend:t,extract:n}}var D7=function(e,t){return x(e,U7(t))},U7=function(e){return function(t){return function(n){return e(t(n))}}},AO="Traced",mO={URI:AO,map:D7},ATe=He(mO),mTe=mO;const gTe=Object.freeze(Object.defineProperty({__proto__:null,Functor:mO,URI:AO,censor:pTe,flap:ATe,getComonad:hTe,listen:dTe,listens:fTe,map:U7,traced:mTe,tracks:cTe},Symbol.toStringTag,{value:"Module"}));function B7(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 P7(e,t){return function(n){var r=e.sequence(n),i=t.sequence(n);return function(o){return r(e.map(o,i))}}}function vTe(e,t){var n=qd(e,t).map,r=eE(e,t),i=B7(e,t),o=P7(e,t);return{map:n,reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,traverse:function(a){var s=i(a);return function(l,u){return x(l,s(u))}},sequence:function(a){var s=o(a);return function(l){return x(l,s)}}}}const yTe=Object.freeze(Object.defineProperty({__proto__:null,getTraversableComposition:vTe,sequence:P7,traverse:B7},Symbol.toStringTag,{value:"Module"})),bTe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function W7(e,t){return t===void 0&&(t=[]),{value:e,forest:t}}function CTe(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 STe(e){var t,n=ki(function(r,i){return e.equals(r.value,i.value)&&t.equals(r.forest,i.forest)});return t=JW(n),n}var N7=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+=N7(e+(r>1&&!a?"│ ":" "),i.forest)}return n};function K7(e){return N7(`
64
+ `,e)}function wTe(e){return e.value+K7(e.forest)}function q7(e,t){var n=t(e),r=n[0],i=n[1];return{value:r,forest:V7(i,t)}}function V7(e,t){return e.map(function(n){return q7(n,t)})}function z7(e){var t=Q7(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 Q7(e){var t=h0(e);return function(n,r){return x(n,t(function(i){return z7(e)(i,r)}))}}function _Te(e){var t=function(n){return e(n.value,n.forest.map(t))};return t}var Sl=function(e,t){return x(e,d1(t))},op=function(e,t){return x(e,$m(function(n){return x(t,d1(n))}))},gO=function(e,t){return x(e,$m(t))},vO=function(e,t,n){return x(e,f1(t,n))},yO=function(e){var t=G7(e);return function(n,r){return x(n,t(r))}},bO=function(e,t,n){return x(e,CO(t,n))},H7=function(e,t){return x(e,c1(t))},Y7=function(e){var t=wO(e);return function(n,r){return x(n,t(r))}},xTe=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=mI().concat;return{value:r,forest:o(i,t.forest.map($m(e)))}}},c1=function(e){return function(t){return{value:e(t),forest:t.forest.map(c1(e))}}},TTe=c1(Q),ITe=$m(Q),d1=function(e){return function(t){return{value:e(t.value),forest:t.forest.map(d1(e))}}},f1=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],f1(r,t));return r}},G7=function(e){return function(t){return f1(e.empty,function(n,r){return e.concat(n,t(r))})}},CO=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],CO(r,t));return t(n.value,r)}},SO=function(e){return e.value},wO=function(e){var t=h0(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},_O=function(e){return wO(e)(Q)},ap=function(e){return W7(e)},mo="Tree",xO={URI:mo,map:Sl},ETe=He(xO),RTe={URI:mo,of:ap},p1={URI:mo,map:Sl,ap:op},$Te=qt(p1),kTe=Vt(p1),OTe={URI:mo,map:Sl,ap:op,of:ap},TO={URI:mo,map:Sl,ap:op,chain:gO},MTe={URI:mo,map:Sl,ap:op,of:ap,chain:gO},FTe=vt(TO),jTe={URI:mo,reduce:vO,foldMap:yO,reduceRight:bO},LTe={URI:mo,map:Sl,reduce:vO,foldMap:yO,reduceRight:bO,traverse:Y7,sequence:_O},DTe={URI:mo,map:Sl,extend:H7,extract:SO},UTe=ap(gn),BTe=Qt(xO),PTe=Ht(TO),WTe=zt(p1);function NTe(e){var t=function(n,r){return e.equals(n,r.value)||r.forest.some(function(i){return t(n,i)})};return t}var J7=function(e){return function(t){return e(t.value)||t.forest.some(J7(e))}},KTe={URI:mo,map:Sl,of:ap,ap:op,chain:gO,reduce:vO,foldMap:yO,reduceRight:bO,traverse:Y7,sequence:_O,extract:SO,extend:H7};const qTe=Object.freeze(Object.defineProperty({__proto__:null,Applicative:OTe,Apply:p1,Chain:TO,Comonad:DTe,Do:UTe,Foldable:jTe,Functor:xO,Monad:MTe,Pointed:RTe,Traversable:LTe,URI:mo,ap:xTe,apFirst:$Te,apS:WTe,apSecond:kTe,bind:PTe,bindTo:BTe,chain:$m,chainFirst:FTe,drawForest:K7,drawTree:wTe,duplicate:TTe,elem:NTe,exists:J7,extend:c1,extract:SO,flap:ETe,flatten:ITe,fold:_Te,foldMap:G7,getEq:STe,getShow:CTe,make:W7,map:d1,of:ap,reduce:f1,reduceRight:CO,sequence:_O,traverse:wO,tree:KTe,unfoldForest:V7,unfoldForestM:Q7,unfoldTree:q7,unfoldTreeM:z7},Symbol.toStringTag,{value:"Module"}));var oi=An,Lr=Zn,VTe=function(e){return[Lr(e),oi(e)]};function IO(e){return{URI:bi,_E:void 0,map:km,ap:function(t,n){return[oi(t)(oi(n)),e.concat(Lr(t),Lr(n))]}}}var Z7=function(e){return function(t){return[t,e.empty]}};function zTe(e){var t=IO(e);return{URI:bi,_E:void 0,map:t.map,ap:t.ap,of:Z7(e)}}function EO(e){var t=IO(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(Lr(n),a)]}}}function QTe(e){var t=EO(e);return{URI:bi,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,of:Z7(e)}}function HTe(e){var t=function(r,i){for(var o=i(r),a=e.empty,s=oi(o);s._tag==="Left";)a=e.concat(a,Lr(o)),o=i(s.left),s=oi(o);return[s.right,e.concat(a,Lr(o))]},n=EO(e);return{URI:bi,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,chainRec:t}}var X7=function(e,t){return x(e,oV(t))},km=function(e,t){return x(e,OO(t))},eV=function(e,t,n){return x(e,iV(t,n))},tV=function(e,t){return x(e,MO(t))},nV=function(e,t){return x(e,FO(t))},RO=function(e,t,n){return x(e,sV(t,n))},$O=function(e){var t=aV();return function(n,r){return x(n,t(r))}},kO=function(e,t,n){return x(e,lV(t,n))};function rV(e){var t=uV(e);return function(n,r){return x(n,t(r))}}var iV=function(e,t){return function(n){return[t(oi(n)),e(Lr(n))]}},OO=function(e){return function(t){return[e(oi(t)),Lr(t)]}},MO=function(e){return function(t){return[oi(t),e(Lr(t))]}},oV=function(e){return function(t){return[oi(t),Lr(e)]}},FO=function(e){return function(t){return[e(t),Lr(t)]}},YTe=FO(Q),jO=Vb,aV=ek,sV=X$,lV=tk,uV=function(e){return function(t){return function(n){return e.map(t(oi(n)),function(r){return[r,Lr(n)]})}}},LO=function(e){return function(t){return e.map(oi(t),function(n){return[n,Lr(t)]})}},bi="Tuple",cV={URI:bi,map:km},GTe=He(cV),JTe={URI:bi,bimap:eV,mapLeft:tV},ZTe={URI:bi,compose:X7},XTe={URI:bi,map:km,extend:nV,extract:jO},eIe={URI:bi,reduce:RO,foldMap:$O,reduceRight:kO},tIe={URI:bi,map:km,reduce:RO,foldMap:$O,reduceRight:kO,traverse:rV,sequence:LO},nIe=OO,rIe=MO,iIe={URI:bi,compose:X7,map:km,bimap:eV,mapLeft:tV,extract:jO,extend:nV,reduce:RO,foldMap:$O,reduceRight:kO,traverse:rV,sequence:LO};const oIe=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:JTe,Comonad:XTe,Foldable:eIe,Functor:cV,Semigroupoid:ZTe,Traversable:tIe,URI:bi,bimap:iV,compose:oV,duplicate:YTe,extend:FO,extract:jO,flap:GTe,foldMap:aV,fst:oi,getApplicative:zTe,getApply:IO,getChain:EO,getChainRec:HTe,getMonad:QTe,map:nIe,mapFst:OO,mapLeft:rIe,mapSnd:MO,reduce:sV,reduceRight:lV,sequence:LO,snd:Lr,swap:VTe,traverse:uV,tuple:iIe},Symbol.toStringTag,{value:"Module"})),aIe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function sIe(e,t){var n=BU(t,il(e));return{map:n.map,ap:n.ap,of:n.of,chain:function(r,i){return t.chain(r,function(o){return hn(o)?t.of(Ca(o.left)):i(o.right)})},alt:function(r,i){return t.chain(r,function(o){return Ax(o)?t.of(o):t.map(i(),function(a){return hn(a)?Ca(e.concat(o.left,a.left)):a})})}}}const lIe=Object.freeze(Object.defineProperty({__proto__:null,getValidationM:sIe},Symbol.toStringTag,{value:"Module"}));var dV=bx(void 0),uIe={concat:dV.concat,empty:void 0};const cIe=Object.freeze(Object.defineProperty({__proto__:null,Monoid:uIe,Semigroup:dV},Symbol.toStringTag,{value:"Module"}));var dIe=function(e){return function(){return[void 0,e]}},fIe=function(e){return function(){var t=e(),n=t[0],r=t[1];return[[n,r],r]}},pIe=function(e){return function(){var t=e(),n=t[0],r=n[0],i=n[1],o=t[1];return[r,i(o)]}},hIe=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[[r,e(i)],i]}}},AIe=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,fV(t))},fV=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[e(r),i]}}},Sc="Writer",pV=function(e){return{URI:Sc,_E:void 0,of:function(t){return function(){return[t,e.empty]}}}},DO=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],l=a[1];return[i(s),e.concat(o,l)]}}}},hV=function(e){var t=DO(e),n=pV(e);return{URI:Sc,_E:void 0,map:Om,ap:t.ap,of:n.of}};function AV(e){var t=DO(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)(),l=s[0],u=s[1];return[l,e.concat(a,u)]}}}}function mIe(e){var t=hV(e),n=AV(e);return{URI:Sc,_E:void 0,map:Om,ap:t.ap,of:t.of,chain:n.chain}}var UO={URI:Sc,map:Om},gIe=He(UO),vIe=function(e){return e()[0]},yIe=function(e){return e()[1]},bIe=function(e){return e()[0]},CIe=function(e){return e()[1]},SIe=UO;const wIe=Object.freeze(Object.defineProperty({__proto__:null,Functor:UO,URI:Sc,censor:AIe,evalWriter:bIe,evaluate:vIe,execWriter:CIe,execute:yIe,flap:gIe,getApplicative:hV,getApply:DO,getChain:AV,getMonad:mIe,getPointed:pV,listen:fIe,listens:hIe,map:fV,pass:pIe,tell:dIe,writer:SIe},Symbol.toStringTag,{value:"Module"}));function _Ie(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(l){var u=l[0],c=l[1];return[a(u),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(l){var u=l[0],c=l[1];return[u,n.concat(s,c)]})})}}}}}}const xIe=Object.freeze(Object.defineProperty({__proto__:null,getWriterM:_Ie},Symbol.toStringTag,{value:"Module"})),TIe=Object.freeze(Object.defineProperty({__proto__:null,alt:jte,alternative:Dte,applicative:tne,apply:Xte,array:Yse,bifunctor:Gse,boolean:ile,booleanAlgebra:ule,bounded:ple,boundedDistributiveLattice:mle,boundedJoinSemilattice:gle,boundedLattice:vle,boundedMeetSemilattice:yle,category:ble,chain:nne,chainRec:Cle,choice:_le,comonad:xle,compactable:mue,console:Cue,const:Lue,contravariant:Due,date:Vue,distributiveLattice:hle,either:MK,eitherT:Mce,endomorphism:jce,eq:Ane,extend:Lce,field:Bce,filterable:Wce,filterableWithIndex:Nce,foldable:Hce,foldableWithIndex:Gce,fromEither:rne,fromIO:Jce,fromReader:yde,fromState:Bde,fromTask:Pde,fromThese:Wde,function:UU,functor:ene,functorWithIndex:Kde,group:qde,heytingAlgebra:Vde,hkt:zde,identity:hfe,invariant:Afe,io:Ffe,ioEither:Fpe,ioOption:Ihe,ioRef:Rhe,joinSemilattice:$he,json:Mhe,lattice:Fhe,magma:Mne,map:KAe,meetSemilattice:qAe,monad:VAe,monadIO:zAe,monadTask:QAe,monadThrow:HAe,monoid:sme,naturalTransformation:lme,nonEmptyArray:wie,number:$ie,option:hue,optionT:Lpe,ord:Rne,ordering:Ame,pipeable:Mme,pointed:Fme,predicate:$le,profunctor:jme,random:Bme,reader:vde,readerEither:jge,readerT:Uge,readerTask:zve,readerTaskEither:ybe,readonlyArray:cae,readonlyMap:sAe,readonlyNonEmptyArray:kre,readonlyRecord:c1e,readonlySet:I1e,readonlyTuple:N1e,record:KCe,refinement:ZCe,ring:nSe,semigroup:uB,semigroupoid:rSe,semiring:oSe,separated:Lie,set:ISe,show:MSe,state:Ude,stateReaderTaskEither:Qwe,stateT:jSe,store:n_e,string:Lbe,strong:o_e,struct:l_e,task:cve,taskEither:n0e,taskOption:uxe,taskThese:uTe,these:Lxe,theseT:Uxe,traced:gTe,traversable:yTe,traversableWithIndex:bTe,tree:qTe,tuple:oIe,unfoldable:aIe,validationT:lIe,void:cIe,witherable:Die,writer:wIe,writerT:xIe,zero:Uie},Symbol.toStringTag,{value:"Module"})),lt=ku(TIe);var cn={},yd={},Rn={},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 l(S){return function(){return S}}e.constant=l,e.constTrue=l(!0),e.constFalse=l(!1),e.constNull=l(null),e.constUndefined=l(void 0),e.constVoid=e.constUndefined;function u(S){return function(w,T){return S(T,w)}}e.flip=u;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 m(S){throw new Error("Called `absurd` function which should be uncallable")}e.absurd=m;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=m;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={},IIe=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 EIe=function(e){return e._tag==="None"};Ne.isNone=EIe;var RIe=function(e){return e._tag==="Some"};Ne.isSome=RIe;Ne.none={_tag:"None"};var $Ie=function(e){return{_tag:"Some",value:e}};Ne.some=$Ie;var kIe=function(e){return e._tag==="Left"};Ne.isLeft=kIe;var OIe=function(e){return e._tag==="Right"};Ne.isRight=OIe;var MIe=function(e){return{_tag:"Left",left:e}};Ne.left=MIe;var FIe=function(e){return{_tag:"Right",right:e}};Ne.right=FIe;var jIe=function(e){return[e]};Ne.singleton=jIe;var LIe=function(e){return e.length>0};Ne.isNonEmpty=LIe;var DIe=function(e){return e[0]};Ne.head=DIe;var UIe=function(e){return e.slice(1)};Ne.tail=UIe;Ne.emptyReadonlyArray=[];Ne.emptyRecord={};Ne.has=Object.prototype.hasOwnProperty;var BIe=function(e){return IIe([e[0]],e.slice(1),!0)};Ne.fromReadonlyNonEmptyArray=BIe;var PIe=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]}),WIe=Se&&Se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),NIe=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)&&PIe(t,e,n);return WIe(t,e),t};Object.defineProperty(Rn,"__esModule",{value:!0});Rn.sequenceS=Rn.sequenceT=Rn.getApplySemigroup=Rn.apS=Rn.apSecond=Rn.apFirst=Rn.ap=void 0;var KIe=Ye,qIe=NIe(Ne);function VIe(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)}}}Rn.ap=VIe;function zIe(e){return function(t){return function(n){return e.ap(e.map(n,function(r){return function(){return r}}),t)}}}Rn.apFirst=zIe;function QIe(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(r){return r}}),t)}}}Rn.apSecond=QIe;function HIe(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)}}}Rn.apS=HIe;function YIe(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)}}}}Rn.getApplySemigroup=YIe;function BO(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):BO(e,t-1,i)}}var WC={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 GIe(e){return qIe.has.call(WC,e)||(WC[e]=BO(KIe.tuple,e-1,[])),WC[e]}function JIe(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=GIe(r),o=e.map(t[0],i),a=1;a<r;a++)o=e.ap(o,t[a]);return o}}Rn.sequenceT=JIe;function ZIe(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 BO(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 XIe(e){return function(t){for(var n=Object.keys(t),r=n.length,i=ZIe(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}Rn.sequenceS=XIe;var wi={};Object.defineProperty(wi,"__esModule",{value:!0});wi.getFunctorComposition=wi.bindTo=wi.flap=wi.map=void 0;var eEe=Ye;function mV(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}wi.map=mV;function tEe(e){return function(t){return function(n){return e.map(n,function(r){return r(t)})}}}wi.flap=tEe;function nEe(e){return function(t){return function(n){return e.map(n,function(r){var i;return i={},i[t]=r,i})}}}wi.bindTo=nEe;function rEe(e,t){var n=mV(e,t);return{map:function(r,i){return(0,eEe.pipe)(r,n(i))}}}wi.getFunctorComposition=rEe;Object.defineProperty(yd,"__esModule",{value:!0});yd.getApplicativeComposition=yd.getApplicativeMonoid=void 0;var gV=Rn,iEe=Ye,oEe=wi;function aEe(e){var t=(0,gV.getApplySemigroup)(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}yd.getApplicativeMonoid=aEe;function sEe(e,t){var n=(0,oEe.getFunctorComposition)(e,t).map,r=(0,gV.ap)(e,t);return{map:n,of:function(i){return e.of(t.of(i))},ap:function(i,o){return(0,iEe.pipe)(i,r(o))}}}yd.getApplicativeComposition=sEe;var pu={};Object.defineProperty(pu,"__esModule",{value:!0});pu.bind=pu.chainFirst=void 0;function lEe(e){return function(t){return function(n){return e.chain(n,function(r){return e.map(t(r),function(){return r})})}}}pu.chainFirst=lEe;function uEe(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))})})}}}pu.bind=uEe;var h1={};Object.defineProperty(h1,"__esModule",{value:!0});h1.tailRec=void 0;var cEe=function(e,t){for(var n=t(e);n._tag==="Left";)n=t(n.left);return n.right};h1.tailRec=cEe;var dn={},dEe=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]}),fEe=Se&&Se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),pEe=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)&&dEe(t,e,n);return fEe(t,e),t};Object.defineProperty(dn,"__esModule",{value:!0});dn.filterOrElse=dn.chainFirstEitherK=dn.chainEitherK=dn.fromEitherK=dn.chainOptionK=dn.fromOptionK=dn.fromPredicate=dn.fromOption=void 0;var hEe=pu,PO=Ye,Gl=pEe(Ne);function vV(e){return function(t){return function(n){return e.fromEither(Gl.isNone(n)?Gl.left(t()):Gl.right(n.value))}}}dn.fromOption=vV;function AEe(e){return function(t,n){return function(r){return e.fromEither(t(r)?Gl.right(r):Gl.left(n(r)))}}}dn.fromPredicate=AEe;function yV(e){var t=vV(e);return function(n){var r=t(n);return function(i){return(0,PO.flow)(i,r)}}}dn.fromOptionK=yV;function mEe(e,t){var n=yV(e);return function(r){var i=n(r);return function(o){return function(a){return t.chain(a,i(o))}}}}dn.chainOptionK=mEe;function WO(e){return function(t){return(0,PO.flow)(t,e.fromEither)}}dn.fromEitherK=WO;function gEe(e,t){var n=WO(e);return function(r){return function(i){return t.chain(i,n(r))}}}dn.chainEitherK=gEe;function vEe(e,t){return(0,PO.flow)(WO(e),(0,hEe.chainFirst)(t))}dn.chainFirstEitherK=vEe;function yEe(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?Gl.right(o):Gl.left(r(o)))})}}}dn.filterOrElse=yEe;var bV={};(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,m){return(0,t.pipe)(p,(0,e.bimap)(h,m))},s=function(p){return function(h){return(0,e.separated)((0,e.left)(h),p((0,e.right)(h)))}};e.map=s;var l=function(p){return function(h){return(0,e.separated)(p((0,e.left)(h)),(0,e.right)(h))}};e.mapLeft=l;var u=function(p,h){return function(m){return(0,e.separated)(p((0,e.left)(m)),h((0,e.right)(m)))}};e.bimap=u,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})(bV);var Ms={},bEe=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]}),CEe=Se&&Se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),SEe=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)&&bEe(t,e,n);return CEe(t,e),t};Object.defineProperty(Ms,"__esModule",{value:!0});Ms.filterE=Ms.witherDefault=Ms.wiltDefault=void 0;var _j=SEe(Ne);function wEe(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.separate)}}}Ms.wiltDefault=wEe;function _Ee(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.compact)}}}Ms.witherDefault=_Ee;function xEe(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=xEe;(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=Rn,a=pu,s=h1,l=dn,u=Ye,c=wi,f=r(Ne),p=bV,h=Ms;e.left=f.left,e.right=f.right;var m=function(D,L){return(0,u.pipe)(D,(0,e.map)(L))},g=function(D,L){return(0,u.pipe)(D,(0,e.ap)(L))},y=function(D,L){return(0,u.pipe)(D,(0,e.chain)(L))},C=function(D,L,U){return(0,u.pipe)(D,(0,e.reduce)(L,U))},_=function(D){return function(L,U){var ce=(0,e.foldMap)(D);return(0,u.pipe)(L,ce(U))}},b=function(D,L,U){return(0,u.pipe)(D,(0,e.reduceRight)(L,U))},v=function(D){var L=(0,e.traverse)(D);return function(U,ce){return(0,u.pipe)(U,L(ce))}},S=function(D,L,U){return(0,u.pipe)(D,(0,e.bimap)(L,U))},w=function(D,L){return(0,u.pipe)(D,(0,e.mapLeft)(L))},T=function(D,L){return(0,u.pipe)(D,(0,e.alt)(L))},E=function(D,L){return(0,u.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(le,be){return(0,e.isLeft)(le)||be(le.right)?le:L},pe=function(le,be){return(0,e.isLeft)(le)?(0,p.separated)(le,le):be(le.right)?(0,p.separated)(L,(0,e.right)(le.right)):(0,p.separated)((0,e.right)(le.right),L)};return{URI:e.URI,_E:void 0,map:m,compact:ce,separate:j,filter:te,filterMap:function(le,be){if((0,e.isLeft)(le))return le;var ot=be(le.right);return ot._tag==="None"?L:(0,e.right)(ot.value)},partition:pe,partitionMap:function(le,be){if((0,e.isLeft)(le))return(0,p.separated)(le,le);var ot=be(le.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:m,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:m,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:m,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:m},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:m,ap:g},e.Applicative={URI:e.URI,map:m,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:m,ap:g,chain:y},e.Monad={URI:e.URI,map:m,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:m,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:m,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:m,extend:E},e.ChainRec={URI:e.URI,map:m,ap:g,chain:y,chainRec:R},e.throwError=e.left,e.MonadThrow={URI:e.URI,map:m,ap:g,of:e.of,chain:y,throwError:e.throwError},e.FromEither={URI:e.URI,fromEither:u.identity},e.fromPredicate=(0,l.fromPredicate)(e.FromEither),e.fromOption=(0,l.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 on=function(D){return function(L){return(0,e.isLeft)(L)?D(L.left):L.right}};e.getOrElseW=on,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)(u.identity),e.flatten=e.flattenW,e.duplicate=(0,e.extend)(u.identity),e.fromOptionK=(0,l.fromOptionK)(e.FromEither),e.chainOptionK=(0,l.chainOptionK)(e.FromEither,e.Chain),e.filterOrElse=(0,l.filterOrElse)(e.FromEither,e.Chain),e.filterOrElseW=e.filterOrElse;var Yt=function(D){return(0,e.isLeft)(D)?(0,e.right)(D.left):(0,e.left)(D.right)};e.swap=Yt;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 ht=function(D,L){try{return(0,e.right)(D())}catch(U){return(0,e.left)(L(U))}};e.tryCatch=ht;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 ut=function(D){var L=(0,e.fromNullable)(D);return function(U){return(0,u.flow)(U,L)}};e.fromNullableK=ut;var Gt=function(D){var L=(0,e.fromNullableK)(D);return function(U){return(0,e.chain)(L(U))}};e.chainNullableK=Gt,e.toUnion=(0,e.foldW)(u.identity,u.identity);function wn(D){return D instanceof Error?D:new Error(String(D))}e.toError=wn;function Jt(D){return function(L,U){if(U===void 0){var ce=Jt(D);return function(j){return ce(L,j)}}return(0,e.isLeft)(U)?!1:D.equals(L,U.right)}}e.elem=Jt;var Rt=function(D){return function(L){return(0,e.isLeft)(L)?!1:D(L.right)}};e.exists=Rt,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 Tr=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=Tr;var Pt=function(D){var L=(0,e.traverseReadonlyNonEmptyArrayWithIndex)(D);return function(U){return f.isNonEmpty(U)?L(U):e.ApT}};e.traverseReadonlyArrayWithIndex=Pt,e.traverseArrayWithIndex=e.traverseReadonlyArrayWithIndex;var Zt=function(D){return(0,e.traverseReadonlyArrayWithIndex)(function(L,U){return D(U)})};e.traverseArray=Zt,e.sequenceArray=(0,e.traverseArray)(u.identity);function an(D,L){return(0,e.tryCatch)(function(){return JSON.parse(D)},L)}e.parseJSON=an;var Ir=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=Ir,e.either={URI:e.URI,map:m,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 Er=function(D,L){return(0,o.getApplySemigroup)((0,e.getApplicativeValidation)(D))(L)};e.getValidationSemigroup=Er;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:m,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)},TEe=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=Ut,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 ue(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 CV(e){return e.displayName||e.name||"<function".concat(e.length,">")}function IEe(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 hu=Object.prototype.hasOwnProperty;function Ow(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 SV(e){return"{ ".concat(Ow(e)," }")}function wV(e){return"Partial<".concat(e,">")}function EEe(e,t,n,r){r===void 0&&(r="{ [K in ".concat(t.name,"]: ").concat(n.name," }"));var i=e.length;return new VO(r,function(o){return mr.is(o)&&e.every(function(a){return n.is(o[a])})},function(o,a){var s=mr.validate(o,a);if(ue(s))return s;for(var l=s.right,u={},c=[],f=!1,p=0;p<i;p++){var h=e[p],m=l[h],g=n.validate(m,Zi(a,h,n,m));if(ue(g))_a(c,g.left);else{var y=g.right;f=f||y!==m,u[h]=y}}return c.length>0?na(c):Ue(f||Object.keys(l).length!==i?u:l)},n.encode===qe?qe:function(o){for(var a={},s=0;s<i;s++){var l=e[s];a[l]=n.encode(o[l])}return a},t,n)}function NO(e){var t;if(TV(e)){var n=e.value;if(go.is(n))return t={},t[n]=null,t}else{if(FEe(e))return e.keys;if(EV(e)){var r=e.types.map(function(i){return NO(i)});return r.some(Av.is)?void 0:Object.assign.apply(Object,TEe([{}],r,!1))}}}function REe(e,t,n){return n===void 0&&(n="{ [K in ".concat(e.name,"]: ").concat(t.name," }")),new VO(n,function(r){return mr.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(mr.is(r)){for(var o={},a=[],s=Object.keys(r),l=s.length,u=!1,c=0;c<l;c++){var f=s[c],p=r[f],h=e.validate(f,Zi(i,f,e,f));if(ue(h))_a(a,h.left);else{var m=h.right;u=u||m!==f,f=m;var g=t.validate(p,Zi(i,f,t,p));if(ue(g))_a(a,g.left);else{var y=g.right;u=u||y!==p,o[f]=y}}}return a.length>0?na(a):Ue(u?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 l=o[s];i[String(e.encode(l))]=t.encode(r[l])}return i},e,t)}function _V(e){return"("+e.map(function(t){return t.name}).join(" | ")+")"}function Mw(e,t){for(var n=!0,r=!0,i=!mr.is(e),o=0,a=t;o<a.length;o++){var s=a[o];s!==e&&(n=!1),mr.is(s)&&(r=!1)}if(n)return e;if(r)return t[t.length-1];for(var l={},u=0,c=t;u<c.length;u++){var s=c[u];for(var f in s)(!hu.call(l,f)||i||s[f]!==e[f])&&(l[f]=s[f])}return l}function Fw(e){switch(e._tag){case"RefinementType":case"ReadonlyType":return Fw(e.type);case"InterfaceType":case"StrictType":case"PartialType":return e.props;case"IntersectionType":return e.types.reduce(function(t,n){return Object.assign(t,Fw(n))},{})}}function xj(e,t){for(var n=Object.getOwnPropertyNames(e),r=!1,i={},o=0;o<n.length;o++){var a=n[o];hu.call(t,a)?i[a]=e[a]:r=!0}return r?i:e}function $Ee(e){return IV(e)?"{| ".concat(Ow(e.props)," |}"):jEe(e)?wV("{| ".concat(Ow(e.props)," |}")):"Exact<".concat(e.name,">")}function kEe(e){return e.length>0}var $r={};function xV(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 OEe(e,t){if(e===$r)return t;if(t===$r)return e;var n=Object.assign({},e);for(var r in t)if(hu.call(e,r)){var i=xV(e[r],t[r]);if(kEe(i))n[r]=i;else{n=$r;break}}else n[r]=t[r];return n}function MEe(e,t){if(e===$r||t===$r)return $r;var n=$r;for(var r in e)if(hu.call(t,r)){var i=xV(e[r],t[r]);i.length===0&&(n===$r&&(n={}),n[r]=e[r].concat(t[r]))}return n}function Tj(e){return e._tag==="AnyType"}function TV(e){return e._tag==="LiteralType"}function FEe(e){return e._tag==="KeyofType"}function IV(e){return e._tag==="InterfaceType"}function jEe(e){return e._tag==="PartialType"}function LEe(e){return e._tag==="StrictType"}function DEe(e){return e._tag==="ExactType"}function UEe(e){return e._tag==="RefinementType"}function BEe(e){return e._tag==="IntersectionType"}function EV(e){return e._tag==="UnionType"}function PEe(e){return e._tag==="RecursiveType"}var NC=[];function Ss(e){if(NC.indexOf(e)!==-1)return $r;if(IV(e)||LEe(e)){var t=$r;for(var n in e.props){var r=e.props[n];TV(r)&&(t===$r&&(t={}),t[n]=[r.value])}return t}else{if(DEe(e)||UEe(e))return Ss(e.type);if(BEe(e))return e.types.reduce(function(o,a){return OEe(o,Ss(a))},$r);if(EV(e))return e.types.slice(1).reduce(function(o,a){return MEe(o,Ss(a))},Ss(e.types[0]));if(PEe(e)){NC.push(e);var i=Ss(e.type);return NC.pop(),i}}return $r}function RV(e){var t=Ss(e[0]),n=Object.keys(t),r=e.length,i=function(u){for(var c=t[u].slice(),f=[t[u]],p=1;p<r;p++){var h=e[p],m=Ss(h),g=m[u];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:[u,f]}};e:for(var o=0,a=n;o<a.length;o++){var s=a[o],l=i(s);if(typeof l=="object")return l.value;switch(l){case"continue-keys":continue e}}}var $V=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),jw=new $V,kV=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),Av=new kV,OV=function(e){rt(t,e);function t(){var n=e.call(this,"void",Av.is,Av.validate,qe)||this;return n._tag="VoidType",n}return t}(ke),Ij=new OV,MV=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),WEe=new MV,FV=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 FV,jV=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 jV,LV=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),NEe=new LV,DV=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),A1=new DV,UV=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 UV,BV=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),mr=new BV,PV=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 PV(t,n,function(r,i){return n(r)?Ue(e):it(r,i)},qe,e)}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.keys=a,s._tag="KeyofType",s}return t}(ke);function KEe(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)&&hu.call(e,r)};return new WV(t,n,function(r,i){return n(r)?Ue(r):it(r,i)},qe,e)}var NV=function(e){rt(t,e);function t(n,r,i,o,a,s){var l=e.call(this,n,r,i,o)||this;return l.type=a,l.predicate=s,l._tag="RefinementType",l}return t}(ke);function m1(e,t,n){return HO(e,t,n)}var mv=m1(wc,function(e){return Number.isInteger(e)},"Int"),KO=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(KO.prototype,"type",{get:function(){return this.runDefinition()},enumerable:!0,configurable:!0});function qO(e,t){var n,r=function(){return n||(n=t(i),n.name=e),n},i=new KO(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 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.type=a,s._tag="ArrayType",s}return t}(ke);function g1(e,t){return t===void 0&&(t="Array<".concat(e.name,">")),new KV(t,function(n){return Cd.is(n)&&n.every(e.is)},function(n,r){var i=Cd.validate(n,r);if(ue(i))return i;for(var o=i.right,a=o.length,s=o,l=[],u=0;u<a;u++){var c=o[u],f=e.validate(c,Zi(r,String(u),e,c));if(ue(f))_a(l,f.left);else{var p=f.right;p!==c&&(s===o&&(s=o.slice()),s[u]=p)}}return l.length>0?na(l):Ue(s)},e.encode===qe?qe:function(n){return n.map(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.props=a,s._tag="InterfaceType",s}return t}(ke);function Lw(e,t){t===void 0&&(t=SV(e));var n=Object.keys(e),r=n.map(function(o){return e[o]}),i=n.length;return new qV(t,function(o){if(mr.is(o)){for(var a=0;a<i;a++){var s=n[a],l=o[s];if(l===void 0&&!hu.call(o,s)||!r[a].is(l))return!1}return!0}return!1},function(o,a){var s=mr.validate(o,a);if(ue(s))return s;for(var l=s.right,u=l,c=[],f=0;f<i;f++){var p=n[f],h=u[p],m=r[f],g=m.validate(h,Zi(a,p,m,h));if(ue(g))_a(c,g.left);else{var y=g.right;(y!==h||y===void 0&&!hu.call(u,p))&&(u===l&&(u=bd({},l)),u[p]=y)}}return c.length>0?na(c):Ue(u)},Ah(r)?qe:function(o){for(var a=bd({},o),s=0;s<i;s++){var l=n[s],u=r[s].encode;u!==qe&&(a[l]=u(o[l]))}return a},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.props=a,s._tag="PartialType",s}return t}(ke);function qEe(e,t){t===void 0&&(t=wV(SV(e)));var n=Object.keys(e),r=n.map(function(o){return e[o]}),i=n.length;return new VV(t,function(o){if(mr.is(o)){for(var a=0;a<i;a++){var s=n[a],l=o[s];if(l!==void 0&&!e[s].is(l))return!1}return!0}return!1},function(o,a){var s=mr.validate(o,a);if(ue(s))return s;for(var l=s.right,u=l,c=[],f=0;f<i;f++){var p=n[f],h=u[p],m=e[p],g=m.validate(h,Zi(a,p,m,h));if(ue(g))h!==void 0&&_a(c,g.left);else{var y=g.right;y!==h&&(u===l&&(u=bd({},l)),u[p]=y)}}return c.length>0?na(c):Ue(u)},Ah(r)?qe:function(o){for(var a=bd({},o),s=0;s<i;s++){var l=n[s],u=o[l];u!==void 0&&(a[l]=r[s].encode(u))}return a},e)}var VO=function(e){rt(t,e);function t(n,r,i,o,a,s){var l=e.call(this,n,r,i,o)||this;return l.domain=a,l.codomain=s,l._tag="DictionaryType",l}return t}(ke);function zO(e,t,n){var r=NO(e);return r?EEe(Object.keys(r),e,t,n):REe(e,t,n)}var QO=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=_V(e));var n=RV(e);if(n!==void 0&&e.length>0){var r=n[0],i=n[1],o=i.length,a=function(s){for(var l=0;l<o;l++)if(i[l].indexOf(s)!==-1)return l};return new gv(t,function(s){if(mr.is(s)){var l=a(s[r]);return l!==void 0?e[l].is(s):!1}return!1},function(s,l){var u=mr.validate(s,l);if(ue(u))return u;var c=u.right,f=a(c[r]);if(f===void 0)return it(s,l);var p=e[f];return p.validate(c,Zi(l,String(f),p,c))},Ah(e)?qe:function(s){var l=a(s[r]);if(l===void 0)throw new Error("no codec found to encode value in union codec ".concat(t));return e[l].encode(s)},e,r)}else return new QO(t,function(s){return e.some(function(l){return l.is(s)})},function(s,l){for(var u=[],c=0;c<e.length;c++){var f=e[c],p=f.validate(s,Zi(l,String(c),f,s));if(ue(p))_a(u,p.left);else return Ue(p.right)}return na(u)},Ah(e)?qe:function(s){for(var l=0,u=e;l<u.length;l++){var c=u[l];if(c.is(s))return c.encode(s)}throw new Error("no codec found to encode value in union type ".concat(t))},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.types=a,s._tag="IntersectionType",s}return t}(ke);function VEe(e,t){t===void 0&&(t="(".concat(e.map(function(r){return r.name}).join(" & "),")"));var n=e.length;return new zV(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 l=e[s],u=l.validate(r,Zi(i,String(s),l,r));ue(u)?_a(a,u.left):o.push(u.right)}return a.length>0?na(a):Ue(Mw(r,o))},e.length===0?qe:function(r){return Mw(r,e.map(function(i){return i.encode(r)}))},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="TupleType",s}return t}(ke);function zEe(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 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(ue(o))return o;for(var a=o.right,s=a.length>n?a.slice(0,n):a,l=[],u=0;u<n;u++){var c=a[u],f=e[u],p=f.validate(c,Zi(i,String(u),f,c));if(ue(p))_a(l,p.left);else{var h=p.right;h!==c&&(s===a&&(s=a.slice()),s[u]=h)}}return l.length>0?na(l):Ue(s)},Ah(e)?qe:function(r){return e.map(function(i,o){return i.encode(r[o])})},e)}var HV=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 QEe(e,t){return t===void 0&&(t="Readonly<".concat(e.name,">")),new HV(t,e.is,e.validate,e.encode,e)}var 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="ReadonlyArrayType",s}return t}(ke);function GV(e,t){t===void 0&&(t="ReadonlyArray<".concat(e.name,">"));var n=g1(e);return new YV(t,n.is,n.validate,n.encode,e)}var mh=function(e,t){return ZV(Lw(e),t)},JV=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 ZV(e,t){t===void 0&&(t=$Ee(e));var n=Fw(e);return new JV(t,e.is,function(r,i){var o=mr.validate(r,i);if(ue(o))return o;var a=e.validate(r,i);return ue(a)?a:Je(xj(a.right,n))},function(r){return e.encode(xj(r,n))},e)}var XV=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),HEe=new XV,gv=function(e){rt(t,e);function t(n,r,i,o,a,s){var l=e.call(this,n,r,i,o,a)||this;return l.tag=s,l}return t}(QO),YEe=function(e,t,n){n===void 0&&(n=_V(t));var r=Fm(t,n);return r instanceof gv?r:(console.warn("[io-ts] Cannot build a tagged union for ".concat(n,", returning a de-optimized union")),new gv(n,r.is,r.validate,r.encode,t,e))},GEe=function(e,t){return{value:e,context:t}},ez=function(e){return[{key:"",type:e}]},tz=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),JEe=new tz,nz=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),ZEe=new nz,XEe=mr,rz=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),eRe=new rz;function HO(e,t,n){return n===void 0&&(n="(".concat(e.name," | ").concat(CV(t),")")),new NV(n,function(r){return e.is(r)&&t(r)},function(r,i){var o=e.validate(r,i);if(ue(o))return o;var a=o.right;return t(a)?Ue(a):it(a,i)},e.encode,e,t)}var tRe=HO(wc,Number.isInteger,"Integer"),nRe=zO,rRe=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 iRe(e){return e}function oRe(e){return function(){return e}}const aRe=Object.freeze(Object.defineProperty({__proto__:null,AnyArrayType:UV,AnyDictionaryType:BV,AnyType:nz,Array:Cd,ArrayType:KV,BigIntType:LV,BooleanType:DV,Dictionary:XEe,DictionaryType:VO,ExactType:JV,Function:HEe,FunctionType:XV,Int:mv,Integer:tRe,InterfaceType:qV,IntersectionType:zV,KeyofType:WV,LiteralType:PV,NeverType:tz,NullType:$V,NumberType:jV,ObjectType:rz,PartialType:VV,ReadonlyArrayType:YV,ReadonlyType:HV,RecursiveType:KO,RefinementType:NV,StrictType:rRe,StringType:FV,TaggedUnionType:gv,TupleType:QV,Type:ke,UndefinedType:kV,UnionType:QO,UnknownArray:Cd,UnknownRecord:mr,UnknownType:MV,VoidType:OV,alias:oRe,any:ZEe,appendContext:Zi,array:g1,bigint:NEe,boolean:A1,brand:m1,clean:iRe,dictionary:nRe,emptyTags:$r,exact:ZV,failure:it,failures:na,getContextEntry:IEe,getDefaultContext:ez,getDomainKeys:NO,getFunctionName:CV,getIndex:RV,getTags:Ss,getValidationError:GEe,identity:qe,interface:Lw,intersection:VEe,keyof:KEe,literal:Mm,mergeAll:Mw,never:JEe,null:jw,nullType:jw,number:wc,object:eRe,partial:qEe,readonly:QEe,readonlyArray:GV,record:zO,recursion:qO,refinement:HO,strict:mh,string:go,success:Ue,taggedUnion:YEe,tuple:zEe,type:Lw,undefined:Av,union:Fm,unknown:WEe,void:Ij,voidType:Ij},Symbol.toStringTag,{value:"Module"})),ne=ku(aRe);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={},v1={};Object.defineProperty(v1,"__esModule",{value:!0});v1.getAssetOrThrow=void 0;const sRe=e=>t=>{const n=e[t];if(!n)throw new Error(`Missing asset with id '${t}'!`);return n};v1.getAssetOrThrow=sRe;var y1={};Object.defineProperty(y1,"__esModule",{value:!0});y1.getEmbedOrThrow=void 0;const lRe=e=>t=>{const n=e[t];if(!n)throw new Error(`Missing embed with url '${t}'`);return n};y1.getEmbedOrThrow=lRe;var b1={},nt={};const vo=ku(UU);function iz(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 uRe=Object.freeze(Object.defineProperty({__proto__:null,mapOutput:iz},Symbol.toStringTag,{value:"Module"}));var oz=m1(go,function(e){return e.length>0},"NonEmptyString");function az(e,t){t===void 0&&(t="NonEmptyArray<"+e.name+">");var n=g1(e);return new ke(t,function(r){return n.is(r)&&nn(r)},function(r,i){return ge(n.validate(r,i),Mi(function(o){var a=oT(o);return Qe(a)?it(r,i):Ue(a.value)}))},function(r){return n.encode(r)})}function sz(e,t,n){n===void 0&&(n="Set<"+e.name+">");var r=g1(e),i=eq(t),o=J8(t);return new ke(n,function(a){return a instanceof Set&&X8(e.is)(a)},function(a,s){return ge(r.validate(a,s),Mi(function(l){var u=o(l);return u.size!==l.length?it(a,s):Ue(u)}))},function(a){return r.encode(i(a))})}function cRe(e,t,n){return n===void 0&&(n="ReadonlySet<"+e.name+">"),sz(e,t,n)}function YO(e,t){return new ke(e,t,function(n,r){return t(n)?Ue(n):it(n,r)},qe)}var dRe=function(e){return e instanceof Date},fRe=YO("Date",dRe),pRe=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))},hRe=function(e,t){return{get:e,reverseGet:t}},lz=function(e){return wl(e.get,X(e.reverseGet,Dr))},ARe=function(e){return xc(X(e.get,jt),e.reverseGet)},mRe=function(e){return us(X(e.get,jt),X(e.reverseGet,Dr))},gRe=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)})}}})},wl=function(e,t){return{get:e,set:t}},GO=function(e){return us(X(e.get,jt),e.set)},vRe=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)})}}})},uz=function(e){return function(t){return wl(function(n){return e.get(t.get(n))},function(n){return function(r){return t.set(e.set(n)(t.get(r)))(r)}})}},yRe=function(e){return function(t){return xc(X(t.getOption,yA(e.getOption)),X(e.reverseGet,t.reverseGet))}},bRe=function(e){return function(t){return Tc(JO(e))(GO(t))}},CRe=function(){return wl(Q,Dr)},SRe=function(e){return function(t){return wl(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)}})}},wRe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return wl(function(r){for(var i=n.get(r),o={},a=0,s=e;a<s.length;a++){var l=s[a];o[l]=i[l]}return o},function(r){return function(i){for(var o=n.get(i),a=0,s=e;a<s.length;a++){var l=s[a];if(r[l]!==o[l])return n.set(Object.assign({},o,r))(i)}return i}})}},_Re=function(e){return function(t){return wl(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)}})}},xRe=function(e){return function(t){return ge(t,uz(QRe().at(e)))}},xc=function(e,t){return{getOption:e,reverseGet:t}},JO=function(e){return us(e.getOption,function(t){return dz(t)(e)})},cz=function(e){return sp(function(t){return function(n){return function(r){return ge(e.getOption(r),rl(function(){return t.of(r)},function(i){return t.map(n(i),function(o){return dz(o)(e)(r)})}))}}})},TRe=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)}))}}},IRe=function(e){return function(t){var n=TRe(e)(t);return function(r){return ge(n(r),DI(function(){return r}))}}},dz=function(e){return IRe(function(){return e})},ERe=function(e){return function(t){return Tc(GO(e))(JO(t))}},RRe=function(){return xc(Pu,Q)},ZO=function(e){return xc(m0(e),Q)},$Re=function(){return xc(Q,jt)},kRe=function(){return xc(pf,Je)},ORe=function(){return xc(function(e){return ue(e)?jt(e.left):ft},Ut)},us=function(e,t){return{getOption:e,set:t}},MRe=function(e){return sp(function(t){return function(n){return function(r){return ge(e.getOption(r),rl(function(){return t.of(r)},function(i){return t.map(n(i),function(o){return e.set(o)(r)})}))}}})},fz=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)}))}}},pz=function(e){return function(t){var n=fz(e)(t);return function(r){return ge(n(r),DI(function(){return r}))}}},Tc=function(e){return function(t){return us(X(t.getOption,yA(e.getOption)),function(n){return pz(e.set(n))(t)})}},FRe=function(e){return function(t){return ge(t,Tc(KRe().index(e)))}},jRe=function(e){return function(t){return ge(t,Tc(qRe().index(e)))}},LRe=function(e){return function(t){return ge(t,Tc(VRe().index(e)))}},DRe=function(e){return us(Gy(e),function(t){return function(n){return ge(Yy(e)(n),rl(function(){return n},function(r){return a0(r,t,n)}))}})},hz=function(e,t,n){if(n[e]===t)return n;var r=pRe([n[0]],n.slice(1),!0);return r[e]=t,r},URe=function(e){return us(Gy(e),function(t){return function(n){return ge(Yy(e)(n),rl(function(){return n},function(r){return hz(r,t,n)}))}})},sp=function(e){return{modifyF:e}};function XO(e){return function(t){return sp(function(n){return function(r){return t.modifyF(n)(e.modifyF(n)(r))}})}}var BRe={URI:"Identity",map:function(e,t){return t(e)},of:Q,ap:function(e,t){return e(t)}},PRe=function(e){return e.URI==="Identity"};function WRe(e){return function(){return sp(function(t){var n=PRe(t)?e.map:e.traverse(t);return function(r){return function(i){return n(i,r)}}})}}function NRe(e){return XO(WRe(e)())}var eM=function(e){return{index:e}},KRe=function(){return eM(function(e){return us(function(t){return uu(e,t)},function(t){return function(n){return ge(uu(e,n),rl(function(){return n},function(){return a0(e,t,n)}))}})})},qRe=function(){return eM(function(e){return us(function(t){return uu(e,t)},function(t){return function(n){return ge(uu(e,n),rl(function(){return n},function(){return hz(e,t,n)}))}})})},VRe=function(){return eM(function(e){return us(function(t){return cu(e,t)},function(t){return function(n){return n[e]===t||Qe(cu(e,n))?n:D$(e,t)(n)}})})},zRe=function(e){return{at:e}};function QRe(){return zRe(function(e){return wl(function(t){return cu(e,t)},rl(function(){return x$(e)},function(t){return D$(e,t)}))})}var Az=hRe,Dw=lz,Uw=ARe,Bw=mRe,Pw=gRe,HRe=function(e){return function(t){return Az(X(t.get,e.get),X(e.reverseGet,t.reverseGet))}},YRe=function(e){return Az(e.reverseGet,e.get)},GRe=function(e){return function(t){return function(n){return t.reverseGet(e(t.get(n)))}}},mz=wl,vv=CRe,Bs=GO,Sd=vRe,Au=uz,JRe=Au,ZRe=X(lz,Au),Ic=bRe,tM=function(e){return X(Bs,Tc(e))},XRe=function(e){return X(Sd,XO(e))},gz=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 e$e(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 t$e=function(e){return Ic(RRe())(e)};function n$e(e){return Ic(ZO(e))}var vz=SRe,yz=wRe,r$e=_Re,i$e=function(e){return X(Bs,FRe(e))},o$e=function(e){return X(Bs,jRe(e))},a$e=function(e){return X(Bs,LRe(e))},s$e=xRe,l$e=Ic($Re()),u$e=Ic(kRe()),c$e=Ic(ORe());function d$e(e){return X(Sd,NRe(e))}function f$e(e){return tM(DRe(e))}function p$e(e){return tM(URe(e))}var h$e=function(e,t){return function(n){return bz(n,e,t)}},bz=function(e,t,n){return mz(X(e.get,t),X(n,e.set))},C1="monocle-ts/Lens",A$e={URI:C1,imap:bz},Cz={URI:C1,compose:function(e,t){return Au(e)(t)}},m$e={URI:C1,compose:Cz.compose,id:vv};const g$e=Object.freeze(Object.defineProperty({__proto__:null,Category:m$e,Invariant:A$e,Semigroupoid:Cz,URI:C1,asOptional:Bs,asTraversal:Sd,atKey:s$e,component:r$e,compose:Au,composeIso:ZRe,composeLens:JRe,composeOptional:tM,composePrism:Ic,composeTraversal:XRe,filter:n$e,findFirst:f$e,findFirstNonEmpty:p$e,fromNullable:t$e,id:vv,imap:h$e,index:i$e,indexNonEmpty:o$e,key:a$e,left:c$e,lens:mz,modify:gz,modifyF:e$e,prop:vz,props:yz,right:u$e,some:l$e,traverse:d$e},Symbol.toStringTag,{value:"Module"}));var Rj=MRe,Ql=Tc,v$e=fz,y$e=pz,b$e=ZO,Ww=JO,Nw=cz,Kw=yRe,C$e=ERe,va=XO,Sz=function(e){return function(t){return t.modifyF(BRe)(e)}},S$e=function(e){return Sz(function(){return e})};function w$e(e){return va(cz(ZO(e)))}var $j=function(e){return new _z(e.get,e.reverseGet)},Xc=function(e){return new nM(e.get,e.set)},Vp=function(e){return new xz(e.getOption,e.reverseGet)},_i=function(e){return new _$e(e.getOption,e.set)},Hr=function(e){return new x$e(e.modifyF)},wz=function(e,t,n){var r;return n===e[t]?e:Object.assign({},e,(r={},r[t]=n,r))},_z=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(YRe(this))},e.prototype.modify=function(t){return GRe(t)(this)},e.prototype.asLens=function(){return Xc(Dw(this))},e.prototype.asPrism=function(){return Vp(Uw(this))},e.prototype.asOptional=function(){return _i(Bw(this))},e.prototype.asTraversal=function(){return Hr(Pw(this))},e.prototype.asFold=function(){var t=this;return new lp(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.asGetter=function(){var t=this;return new Iz(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(HRe(t)(this))},e.prototype.composeIso=function(t){return this.compose(t)},e.prototype.composeLens=function(t){return Xc(ge(this,Dw,Au(t)))},e.prototype.composePrism=function(t){return Vp(ge(this,Uw,Kw(t)))},e.prototype.composeOptional=function(t){return _i(ge(this,Bw,Ql(t)))},e.prototype.composeTraversal=function(t){return Hr(ge(this,Pw,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}(),nM=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(vv(),vz(t)))}},e.fromProps=function(){return function(t){return Xc(ge(vv(),yz.apply(g$e,t)))}},e.fromNullableProp=function(){return function(t,n){return new e(function(r){var i=Pu(r[t]);return Qe(i)?n:i.value},function(r){return function(i){return wz(i,t,r)}})}},e.prototype.modify=function(t){return gz(t)(this)},e.prototype.asOptional=function(){return _i(Bs(this))},e.prototype.asTraversal=function(){return Hr(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 Iz(function(n){return t.get(n)})},e.prototype.asFold=function(){var t=this;return new lp(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.compose=function(t){return Xc(Au(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,Ql(t)))},e.prototype.composeTraversal=function(t){return Hr(ge(this,Sd,va(t)))},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeIso=function(t){return Xc(ge(this,Au(ge(t,Dw))))},e.prototype.composePrism=function(t){return _i(Ic(t)(this))},e}(),xz=function(){function e(t,n){this.getOption=t,this.reverseGet=n,this._tag="Prism"}return e.fromPredicate=function(t){return Vp(b$e(t))},e.some=function(){return Tz},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 zN.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(Ww(this))},e.prototype.asTraversal=function(){return Hr(Nw(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 lp(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(Kw(t)(this))},e.prototype.composePrism=function(t){return this.compose(t)},e.prototype.composeOptional=function(t){return _i(ge(this,Ww,Ql(t)))},e.prototype.composeTraversal=function(t){return Hr(ge(this,Nw,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,Kw(ge(t,Uw))))},e.prototype.composeLens=function(t){return _i(C$e(t)(this))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),Tz=new xz(Q,jt),_$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 Pu(n[t])},function(n){return function(r){return r[t]==null?r:wz(r,t,n)}})}},e.fromOptionProp=function(){var t=nM.fromProp();return function(n){return t(n).composePrism(Tz)}},e.prototype.modify=function(t){return y$e(t)(this)},e.prototype.modifyOption=function(t){return v$e(t)(this)},e.prototype.asTraversal=function(){return Hr(Rj(this))},e.prototype.asFold=function(){var t=this;return new lp(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(Ql(t)(this))},e.prototype.composeOptional=function(t){return this.compose(t)},e.prototype.composeTraversal=function(t){return Hr(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,Ql(ge(t,Bs))))},e.prototype.composePrism=function(t){return _i(ge(this,Ql(ge(t,Ww))))},e.prototype.composeIso=function(t){return _i(ge(this,Ql(ge(t,Bw))))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),x$e=function(){function e(t){this.modifyF=t,this._tag="Traversal"}return e.prototype.modify=function(t){return Sz(t)(this)},e.prototype.set=function(t){return S$e(t)(this)},e.prototype.filter=function(t){return Hr(w$e(t)(this))},e.prototype.asFold=function(){var t=this;return new lp(function(n){return function(r){return t.modifyF(YN(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 Hr(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 Hr(ge(this,va(ge(t,Sd))))},e.prototype.composePrism=function(t){return Hr(ge(this,va(ge(t,Nw))))},e.prototype.composeIso=function(t){return Hr(ge(this,va(ge(t,Pw))))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),Iz=function(){function e(t){this.get=t,this._tag="Getter"}return e.prototype.asFold=function(){var t=this;return new lp(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}(),lp=function(){function e(t){this.foldMap=t,this._tag="Fold",this.getAll=t(mI())(nl),this.exist=t(w6),this.all=t(S6),this.foldMapFirst=t(QN())}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(m0(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(Dr(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}(),T$e=new _z(dd,dd);function I$e(){return T$e}function E$e(e,t){t===void 0&&(t="fromNewtype("+e.name+")");var n=I$e();return new ke(t,function(r){return e.is(r)},function(r,i){return ge(e.validate(r,i),qu(n.wrap))},function(r){return e.encode(n.unwrap(r))})}var R$e=mh({_tag:Mm("None")}),$$e=Mm("Some");function Ez(e,t){return t===void 0&&(t="Option<"+e.name+">"),Fm([R$e,mh({_tag:$$e,value:e},"Some<"+e.name+">")],t)}function k$e(e,t){return t===void 0&&(t="Option<"+e.name+">"),new ke(t,Ez(e).is,function(n,r){return n==null?Ue(ft):ge(e.validate(n,r),qu(jt))},function(n){return UI(ge(n,Ko(e.encode)))})}var O$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 M$e(e,t){return t===void 0&&(t="ReadonlyNonEmptyArray<"+e.name+">"),az(e,t)}function Rz(e){var t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t}var F$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 S1(e,t,n){n===void 0&&(n=e.name);var r=Rz(e);return r.validate=t,r.decode=function(i){return t(i,ez(r))},r.name=n,r}function j$e(e,t,n){return n===void 0&&(n="withFallback("+e.name+")"),S1(e,function(r,i){return xK(function(){return Ue(t)})(e.validate(r,i))},n)}var L$e=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,D$e=m1(go,function(e){return L$e.test(e)},"UUID");function U$e(e,t,n){return n===void 0&&(n="fromNullable("+e.name+")"),S1(e,function(r,i){return r==null?Ue(t):e.validate(r,i)},n)}var B$e=new ke("BooleanFromString",A1.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 P$e(e,t){return S1(e,function(n,r){return IA(function(){return[{value:n,context:r,message:t(n,r),actual:n}]})(e.validate(n,r))})}function $z(e){switch(e._tag){case"InterfaceType":return e.props;case"ExactType":return $z(e.type)}}var W$e=nM.fromProp();function N$e(e){var t={};for(var n in $z(e))t[n]=W$e(n);return t}var K$e=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},q$e=YO("RegExp",K$e),V$e=new ke("DateFromUnixTime",function(e){return e instanceof Date},function(e,t){return ge(mv.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)}),qw=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),z$e=new ke("IntFromString",mv.is,function(e,t){return ge(qw.validate(e,t),Mi(function(n){return mv.is(n)?Ue(n):it(e,t)}))},qw.encode),kz=qO("JsonArray",function(){return GV(w1)}),Oz=qO("JsonRecord",function(){return zO(go,w1)}),w1=Fm([A1,wc,go,jw,kz,Oz],"Json"),Q$e=new ke("JsonFromString",w1.is,function(e,t){try{return Ue(JSON.parse(e))}catch{return it(e,t)}},function(e){return JSON.stringify(e)}),H$e=Mm("Left"),Y$e=Mm("Right");function G$e(e,t,n){return n===void 0&&(n="Either<"+e.name+", "+t.name+">"),Fm([mh({_tag:H$e,left:e},"Left<"+e.name+">"),mh({_tag:Y$e,right:t},"Right<"+e.name+">")],n)}var J$e=new ke("BigIntFromString",function(e){return typeof e=="bigint"},function(e,t){return ge(go.validate(e,t),Mi(function(n){if(!oz.is(n.trim()))return it(e,t);try{return Ue(BigInt(n))}catch{return it(e,t)}}))},String);function Z$e(e,t,n){return n===void 0&&(n=e.name),new ke(n,e.is,e.validate,t)}var X$e=new ke("BooleanFromNumber",A1.is,function(e,t){return ge(wc.validate(e,t),qu(function(n){return n!==0}))},Number);const eke=Object.freeze(Object.defineProperty({__proto__:null,BigIntFromString:J$e,BooleanFromNumber:X$e,BooleanFromString:B$e,DateFromISOString:O$e,DateFromNumber:F$e,DateFromUnixTime:V$e,IntFromString:z$e,Json:w1,JsonArray:kz,JsonFromString:Q$e,JsonRecord:Oz,NonEmptyString:oz,NumberFromString:qw,UUID:D$e,clone:Rz,date:fRe,either:G$e,fromNewtype:E$e,fromNullable:U$e,fromRefinement:YO,getLenses:N$e,mapOutput:iz,nonEmptyArray:az,option:Ez,optionFromNullable:k$e,readonlyNonEmptyArray:M$e,readonlySetFromArray:cRe,regexp:q$e,setFromArray:sz,withEncode:Z$e,withFallback:j$e,withMessage:P$e,withValidate:S1},Symbol.toStringTag,{value:"Module"})),_1=ku(eke),tke=ku(uRe);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 nke=G,Mz=lt,rke=vo,nd=(0,nke.__importStar)(ne),ike=_1,oke=tke;function ake(e){return nd.union([e,nd.null,nd.undefined])}nt.nullable=ake;function ske(e,t,n){return new nd.Type(t,e.is,(r,i)=>(0,rke.pipe)(e.validate(r,i),Mz.either.chain(o=>n(o)?nd.success(o):nd.failure(r,i))),e.encode)}nt.refineType=ske;function lke(e){if(e==="")return null;const t=Number(e);return Number.isNaN(t)?null:t}nt.filterDouble=lke;function uke(e){return e.toISOString().replace(/\.\d{3}Z$/,"+0000")}nt.formatDateTime=uke;function cke(e){return e.toISOString().replace(/T.*/,"")}nt.formatDate=cke;function dke(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=dke;function fke(e){return new Map(Object.entries(e))}nt.objectToMap=fke;function pke(e){for(const t in e)return!1;return!0}nt.isEmpty=pke;function hke(e,t){return(0,oke.mapOutput)(e,n=>({...n,__TYPE__:t}))}nt.addType=hke;function Ake(e,t){return(0,ike.withValidate)(e,(n,r)=>Mz.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=Ake;Object.defineProperty(b1,"__esModule",{value:!0});b1.WidgetKey=void 0;const mke=G,gke=(0,mke.__importStar)(ne),vke=nt,yke=new RegExp("^[^<>]+$");b1.WidgetKey=(0,vke.refineType)(gke.string,"WidgetKey",e=>e.length===0||yke.test(e));(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(v1,e),(0,t.__exportStar)(y1,e),(0,t.__exportStar)(b1,e)})(_c);var he={},Fz={},up={},x1={},T1={};Object.defineProperty(T1,"__esModule",{value:!0});T1.clone=void 0;function bke(e){var t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t}T1.clone=bke;var Cke=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]}),Ske=Se&&Se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),wke=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)&&Cke(t,e,n);return Ske(t,e),t};Object.defineProperty(x1,"__esModule",{value:!0});x1.withValidate=void 0;var _ke=wke(ne),xke=T1;function Tke(e,t,n){n===void 0&&(n=e.name);var r=xke.clone(e);return r.validate=t,r.decode=function(i){return t(i,_ke.getDefaultContext(r))},r.name=n,r}x1.withValidate=Tke;var Ike=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]}),Eke=Se&&Se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Rke=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)&&Ike(t,e,n);return Eke(t,e),t};Object.defineProperty(up,"__esModule",{value:!0});up.withFallback=void 0;var $ke=Rke(ne),kke=x1,Oke=cn;function Mke(e,t,n){return n===void 0&&(n="withFallback("+e.name+")"),kke.withValidate(e,function(r,i){return Oke.orElse(function(){return $ke.success(t)})(e.validate(r,i))},n)}up.withFallback=Mke;var KC={},fn={};Object.defineProperty(fn,"__esModule",{value:!0});fn.EmptyArray=fn.EmptyObject=fn.Boolean=fn.NumberOrNull=fn.Number=fn.StringOrNull=fn.String=void 0;const Fke=G,jke=lt,Lke=Ye,Xt=(0,Fke.__importStar)(ne),Dm=nt;fn.String=(0,Dm.withCustomError)(Xt.string,()=>"The value must be a string");fn.StringOrNull=(0,Dm.withCustomError)(Xt.union([Xt.string,Xt.null]),()=>"The value must be a string or null");fn.Number=(0,Dm.withCustomError)(Xt.number,()=>"The value must be a number");fn.NumberOrNull=(0,Dm.withCustomError)(Xt.union([Xt.number,Xt.null]),()=>"The value must be a number or null");fn.Boolean=(0,Dm.withCustomError)(Xt.boolean,()=>"The value must be a boolean");fn.EmptyObject=Xt.UnknownRecord.pipe(new Xt.Type("emptyObject",e=>Xt.UnknownRecord.is(e),(e,t)=>Object.keys(e).length>0?Xt.failure(e,t,"The object is not empty."):Xt.success({}),Xt.identity));fn.EmptyArray=new Xt.Type("emptyArray",e=>Xt.UnknownArray.is(e)&&e.length===0,(e,t)=>(0,Lke.pipe)(Xt.UnknownArray.decode(e),jke.either.chain(n=>n.length>0?Xt.failure(e,t,"The array is not empty."):Xt.success(new Array))),()=>[]);var fg={};const cs=ku(MK);var kj;function Dke(){if(kj)return fg;kj=1,Object.defineProperty(fg,"__esModule",{value:!0});const e=G,t=cs,n=vo,r=(0,e.__importStar)(ne),i=pt();return fg.default=new r.Type("dateFromString",o=>o instanceof Date,(o,a)=>(0,n.pipe)(i.String.validate(o,a),(0,t.chain)(s=>{const l=new Date(s);return isNaN(l.getTime())?r.failure(o,a):r.success(l)})),o=>o.toISOString()),fg}var rM={};Object.defineProperty(rM,"__esModule",{value:!0});const Uke=G,Bke=cs,Pke=vo,jc=(0,Uke.__importStar)(ne);rM.default=new jc.Type("dateFromStringOrNumber",e=>e instanceof Date,(e,t)=>(0,Pke.pipe)(jc.union([jc.number,jc.string]).validate(e,t),(0,Bke.chain)(n=>{const r=new Date(n);return isNaN(r.getTime())?jc.failure(e,t):jc.success(r)})),e=>e);var iM={};Object.defineProperty(iM,"__esModule",{value:!0});const Wke=G,Nke=cs,Kke=vo,pg=(0,Wke.__importStar)(ne);iM.default=new pg.Type("dateFromTsMs",e=>e instanceof Date,(e,t)=>(0,Kke.pipe)(pg.number.validate(e,t),(0,Nke.chain)(n=>{const r=new Date(n);return isNaN(r.getTime())?pg.failure(e,t):pg.success(r)})),e=>e.getTime());var jz={};(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=fn,o=u=>c=>new r.Type(`DefaultOrElse<${u.name}, ${c.name}>`,f=>f===null||c.is(f),(f,p)=>(0,n.isRight)(u.validate(f,p))?r.success(null):c.validate(f,p),f=>f?c.encode(f):void 0);e.DefaultOrElse=o;const a=u=>(0,e.DefaultOrElse)(r.null)(u);e.NullOrElse=a;const s=u=>(0,e.DefaultOrElse)(i.EmptyObject)(u);e.EmptyObjectOrElse=s;const l=u=>(0,e.DefaultOrElse)(i.EmptyArray)(u);e.EmptyArrayOrElse=l})(jz);var oM={};Object.defineProperty(oM,"__esModule",{value:!0});const qke=G,Vke=cs,zke=vo,Fl=(0,qke.__importStar)(ne);oM.default=new Fl.Type("IntFromNumber",Fl.Int.is,(e,t)=>(0,zke.pipe)(Fl.number.validate(e,t),(0,Vke.chain)(n=>Fl.Int.is(n)?Fl.success(n):Fl.success(Math.round(n)))),Fl.Int.encode);var aM={};Object.defineProperty(aM,"__esModule",{value:!0});const Qke=G,Hke=cs,Yke=vo,Lc=(0,Qke.__importStar)(ne),Gke=/^([0-9]+)px$/;aM.default=new Lc.Type("IntFromPixels",Lc.Int.is,(e,t)=>(0,Yke.pipe)(Lc.string.validate(e,t),(0,Hke.chain)(n=>{try{const r=n.match(Gke);if(!r)return Lc.failure(e,t);const i=parseInt(r[1]);return Lc.success(i)}catch{return Lc.failure(e,t)}})),String);var sM={};Object.defineProperty(sM,"__esModule",{value:!0});const Jke=G,Zke=(0,Jke.__importStar)(ne),Oj=nt;sM.default=(0,Oj.withCustomError)((0,Oj.refineType)(Zke.string,"nonEmptyString",e=>e.trim().length>0),()=>"The value must be a non-empty string");var lM={},I1={};Object.defineProperty(I1,"__esModule",{value:!0});const Xke=G,eOe=(0,Xke.__importStar)(ne),tOe=nt;I1.default=(0,tOe.nullable)(eOe.string);Object.defineProperty(lM,"__esModule",{value:!0});const nOe=G,rOe=cs,iOe=vo,qC=ne,oOe=(0,nOe.__importDefault)(I1);lM.default=new qC.Type("nonEmptyStringOrNull",e=>typeof e=="string"||e===null,(e,t)=>(0,iOe.pipe)(oOe.default.validate(e,t),(0,rOe.chain)(n=>typeof n=="string"&&n.length>0?(0,qC.success)(n):(0,qC.success)(null))),e=>e);var uM={};Object.defineProperty(uM,"__esModule",{value:!0});const aOe=G,sOe=(0,aOe.__importStar)(ne),lOe=nt;uM.default=(0,lOe.nullable)(sOe.number);var cM={};Object.defineProperty(cM,"__esModule",{value:!0});const uOe=G,hg=(0,uOe.__importStar)(ne),Mj=fn;cM.default=(e,t,n)=>Mj.Number.pipe(new hg.Type("numberInRange",r=>Mj.Number.is(r),(r,i)=>r>t||r<e?hg.failure(r,i,`${n} must be a number between ${e} and ${t}`):hg.success(r),hg.identity));var dM={};Object.defineProperty(dM,"__esModule",{value:!0});const cOe=G,dOe=cs,fOe=vo,Ag=(0,cOe.__importStar)(ne);dM.default=new Ag.Type("StringFromInt",Ag.string.is,(e,t)=>(0,fOe.pipe)(Ag.boolean.validate(e,t),(0,dOe.chain)(n=>Ag.success(n.toString()))),e=>e);var fM={};Object.defineProperty(fM,"__esModule",{value:!0});const pOe=G,hOe=cs,AOe=vo,mg=(0,pOe.__importStar)(ne);fM.default=new mg.Type("StringFromInt",mg.string.is,(e,t)=>(0,AOe.pipe)(mg.number.validate(e,t),(0,hOe.chain)(n=>mg.success(n.toString()))),e=>e);var Fj;function pt(){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)(fn,e);var n=Dke();Object.defineProperty(e,"DateFromString",{enumerable:!0,get:function(){return(0,t.__importDefault)(n).default}});var r=rM;Object.defineProperty(e,"DateFromStringOrNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(r).default}});var i=iM;Object.defineProperty(e,"DateFromTsMs",{enumerable:!0,get:function(){return(0,t.__importDefault)(i).default}}),(0,t.__exportStar)(jz,e),e.Function=(0,t.__importStar)(nt);var o=oM;Object.defineProperty(e,"IntFromNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(o).default}});var a=aM;Object.defineProperty(e,"IntFromPixels",{enumerable:!0,get:function(){return(0,t.__importDefault)(a).default}});var s=sM;Object.defineProperty(e,"NonEmptyString",{enumerable:!0,get:function(){return(0,t.__importDefault)(s).default}});var l=lM;Object.defineProperty(e,"NonEmptyStringOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(l).default}});var u=uM;Object.defineProperty(e,"NumberOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(u).default}});var c=cM;Object.defineProperty(e,"NumberRange",{enumerable:!0,get:function(){return(0,t.__importDefault)(c).default}});var f=dM;Object.defineProperty(e,"StringFromBoolean",{enumerable:!0,get:function(){return(0,t.__importDefault)(f).default}});var p=fM;Object.defineProperty(e,"StringFromNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(p).default}});var h=I1;Object.defineProperty(e,"StringOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(h).default}})}(KC)),KC}var Vi={},Yr={},cp={},ds={},pM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BooleanField=e.BooleanConfig=e.BooleanFieldType=void 0;const n=(0,G.__importStar)(ne),r=pt();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})]))})(pM);var hM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Color=e.ColorConfig=e.ColorFieldType=void 0;const n=(0,G.__importStar)(ne),r=pt();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})]))})(hM);var AM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Date=e.DateConfig=e.DateFieldType=void 0;const n=(0,G.__importStar)(ne),r=pt();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})]))})(AM);var mM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Embed=e.EmbedConfig=e.EmbedFieldType=void 0;const n=(0,G.__importStar)(ne),r=pt();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})]))})(mM);var gM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPoint=e.GeoPointConfig=e.GeoPointFieldType=void 0;const n=(0,G.__importStar)(ne),r=pt();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})]))})(gM);var vM={},Um={},E1={},dp={},mu={};Object.defineProperty(mu,"__esModule",{value:!0});mu.pipe=mu.pipeable=void 0;var Vw=Ye,mOe=function(e){return typeof e.map=="function"},gOe=function(e){return typeof e.contramap=="function"},vOe=function(e){return typeof e.mapWithIndex=="function"},yOe=function(e){return typeof e.ap=="function"},bOe=function(e){return typeof e.chain=="function"},COe=function(e){return typeof e.bimap=="function"},SOe=function(e){return typeof e.extend=="function"},wOe=function(e){return typeof e.reduce=="function"},_Oe=function(e){return typeof e.reduceWithIndex=="function"},xOe=function(e){return typeof e.alt=="function"},TOe=function(e){return typeof e.compact=="function"},IOe=function(e){return typeof e.filter=="function"},EOe=function(e){return typeof e.filterWithIndex=="function"},ROe=function(e){return typeof e.promap=="function"},$Oe=function(e){return typeof e.compose=="function"},kOe=function(e){return typeof e.throwError=="function"};function OOe(e){var t={};if(mOe(e)){var n=function(F){return function(M){return e.map(M,F)}};t.map=n}if(gOe(e)){var r=function(F){return function(M){return e.contramap(M,F)}};t.contramap=r}if(vOe(e)){var i=function(F){return function(M){return e.mapWithIndex(M,F)}};t.mapWithIndex=i}if(yOe(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(bOe(e)){var s=function(F){return function(M){return e.chain(M,F)}},l=function(F){return function(M){return e.chain(M,function(W){return e.map(F(W),function(){return W})})}},u=function(F){return e.chain(F,Vw.identity)};t.chain=s,t.chainFirst=l,t.flatten=u}if(COe(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(SOe(e)){var p=function(F){return function(M){return e.extend(M,F)}},h=function(F){return e.extend(F,Vw.identity)};t.extend=p,t.duplicate=h}if(wOe(e)){var m=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=m,t.foldMap=g,t.reduceRight=y}if(_Oe(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(xOe(e)){var v=function(F){return function(M){return e.alt(M,F)}};t.alt=v}if(TOe(e)&&(t.compact=e.compact,t.separate=e.separate),IOe(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(EOe(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(ROe(e)){var K=function(F,M){return function(W){return e.promap(W,F,M)}};t.promap=K}if($Oe(e)){var H=function(F){return function(M){return e.compose(M,F)}};t.compose=H}if(kOe(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}mu.pipeable=OOe;mu.pipe=Vw.pipe;var MOe=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]}),FOe=Se&&Se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),jOe=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)&&MOe(t,e,n);return FOe(t,e),t};Object.defineProperty(dp,"__esModule",{value:!0});dp.NumberFromString=void 0;var yp=jOe(ne),LOe=mu,DOe=cn;dp.NumberFromString=new yp.Type("NumberFromString",yp.number.is,function(e,t){return LOe.pipe(yp.string.validate(e,t),DOe.chain(function(n){var r=+n;return isNaN(r)||n.trim()===""?yp.failure(e,t):yp.success(r)}))},String);var UOe=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]}),BOe=Se&&Se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),POe=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)&&UOe(t,e,n);return BOe(t,e),t};Object.defineProperty(E1,"__esModule",{value:!0});E1.IntFromString=void 0;var bp=POe(ne),jj=dp,WOe=mu,NOe=cn;E1.IntFromString=new bp.Type("IntFromString",bp.Int.is,function(e,t){return WOe.pipe(jj.NumberFromString.validate(e,t),NOe.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 KOe=G,qOe=cn,da=(0,KOe.__importStar)(ne),VOe=E1,Lj=pt(),Dj=new da.Type("SideConstraints",e=>!e||typeof e=="number",(e,t)=>qOe.either.chain(da.union([da.literal("auto"),da.literal(""),da.Int,VOe.IntFromString,Lj.IntFromNumber,Lj.IntFromPixels,da.null]).validate(e,t),n=>n==="auto"||n===""?da.success(null):da.success(n)),e=>e),zOe=da.partial({width:Dj,height:Dj});Um.default=zOe;(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=pt(),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})]))})(vM);var yM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationField=e.IntegrationFieldConfig=e.IntegrationFieldType=void 0;const n=(0,G.__importStar)(ne),r=pt();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})]))})(yM);var bM={};(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=up,o=pt(),a=u=>{if(u instanceof Array&&u.reduce((f,p)=>f&&typeof p=="string",!0))return r.success(u)},s=u=>{if(typeof u=="string")return r.success([u])},l=new r.Type("MasksArrayString",u=>u instanceof Array,(u,c)=>n.either.chain(r.union([r.array(r.string),r.string]).validate(u,c),f=>a(f)||s(f)||r.failure(u,c)),u=>u);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:l,tags:l,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})]))})(bM);var CM={};(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=pt();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})]))})(CM);var SM={};(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=pt();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})]))})(SM);var R1={};(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=lt,r=cn,i=Ye,o=(0,t.__importStar)(ne),a=pt(),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 l=new o.Type("RichTextOptions",m=>typeof m=="string",m=>(0,i.pipe)(o.union([o.string,o.null]).decode(m),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})),m=>m),u=m=>{if(!m)return o.success([])},c=m=>{if(m instanceof Object){const g=m;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=m=>{if(m instanceof Array&&m.reduce((y,C)=>y&&typeof C=="string",!0))return o.success(m)},p=m=>{if(typeof m=="string")return o.success([m])},h=new o.Type("RichTextLabels",m=>m instanceof Array,(m,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(m),n.either.chain(_=>u(_)||f(_)||c(_)||p(_)||o.failure(m,g)))},m=>m);e.RichTextConfig=o.exact(o.partial({label:a.StringOrNull,placeholder:o.string,useAsTitle:o.boolean,single:l,multi:l,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})]))})(R1);var wM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Select=e.SelectConfig=e.SelectFieldType=void 0;const n=(0,G.__importStar)(ne),r=pt();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})]))})(wM);var _M={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Separator=e.SeparatorConfig=e.SeparatorFieldType=void 0;const n=(0,G.__importStar)(ne),r=pt();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})]))})(_M);var xM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TableCell=e.Table=e.TableFieldType=void 0;const n=(0,G.__importStar)(ne),r=pt(),i=R1;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(",")}}})(xM);var TM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Text=e.TextConfig=e.TextFieldType=void 0;const n=(0,G.__importStar)(ne),r=pt();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})]))})(TM);var IM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Timestamp=e.TimestampConfig=e.TimestampFieldType=void 0;const n=(0,G.__importStar)(ne),r=pt();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})]))})(IM);Object.defineProperty(ds,"__esModule",{value:!0});ds.NestableWidget=void 0;const QOe=G,HOe=(0,QOe.__importStar)(ne),YOe=pM,GOe=hM,JOe=AM,ZOe=mM,XOe=gM,eMe=vM,tMe=yM,nMe=bM,rMe=CM,iMe=SM,oMe=R1,aMe=wM,sMe=_M,lMe=xM,uMe=TM,cMe=IM;ds.NestableWidget=HOe.union([GOe.Color,YOe.BooleanField,ZOe.Embed,XOe.GeoPoint,JOe.Date,rMe.Number,iMe.Range,oMe.RichText,aMe.Select,sMe.Separator,lMe.Table,uMe.Text,cMe.Timestamp,nMe.Link,eMe.Image,tMe.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=pt(),o=ds;e.GroupFieldType="Group";const a=l=>n.exact(n.partial({label:i.StringOrNull,repeat:n.boolean,fields:n.record(r.WidgetKey,l)})),s=l=>n.exact(n.intersection([n.type({type:n.literal(e.GroupFieldType)}),n.partial({fieldset:i.StringOrNull,icon:n.string,description:n.string,config:a(l)})]));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)(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)(bM,e),(0,t.__exportStar)(ds,e),(0,t.__exportStar)(CM,e),(0,t.__exportStar)(SM,e),(0,t.__exportStar)(R1,e),(0,t.__exportStar)(wM,e),(0,t.__exportStar)(_M,e),(0,t.__exportStar)(xM,e),(0,t.__exportStar)(TM,e),(0,t.__exportStar)(IM,e)})(Bm);var EM={},$1={};(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=pt(),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})($1);var gu={};Object.defineProperty(gu,"__esModule",{value:!0});gu.isLegacySlice=gu.LegacySlice=void 0;const dMe=G,fMe=(0,dMe.__importStar)(ne),pMe=cp,hMe=ds;gu.LegacySlice=fMe.union([hMe.NestableWidget,pMe.NestedGroup]);function AMe(e){return e.type!=="Slice"&&e.type!=="SharedSlice"}gu.isLegacySlice=AMe;var Pm={},vu={};Object.defineProperty(vu,"__esModule",{value:!0});vu.isSlicePrimaryWidget=vu.SlicePrimaryWidget=void 0;const mMe=G,gMe=(0,mMe.__importStar)(ne),Lz=cp,Dz=Bm;vu.SlicePrimaryWidget=gMe.union([Dz.NestableWidget,Lz.Group]);const vMe=e=>Dz.NestableWidget.is(e)||Lz.Group.is(e);vu.isSlicePrimaryWidget=vMe;(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=up,i=_c,o=ds,a=vu,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 l=n.string,u=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(l,u)})]));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 yMe=G,VC=(0,yMe.__importStar)(ne),bMe=Pm;Wm.SharedSliceRef=VC.exact(VC.type({type:VC.literal(bMe.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=pt(),o=$1,a=gu,s=Pm,l=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 u(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=u,e.StaticSlicesConfig=u(s.SharedSlice),e.DynamicSlicesConfig=u(l.SharedSliceRef);const c={toStatic(p,h){const m=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:m}}};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}}})(EM);var RM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UID=e.UIDConfig=e.UIDFieldType=void 0;const n=(0,G.__importStar)(ne),r=pt();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})]))})(RM);Object.defineProperty(Yr,"__esModule",{value:!0});Yr.Widgets=Yr.FieldType=Yr.DynamicWidget=Yr.StaticWidget=Yr.widgetReader=void 0;const CMe=G,Uz=(0,CMe.__importStar)(ne),Bz=cp,Vn=Bm,SMe=ds,gh=EM,Pz=RM;function $M(e){return Uz.union([Pz.UID,SMe.NestableWidget,Bz.Group,e])}Yr.widgetReader=$M;Yr.StaticWidget=$M(gh.StaticSlices);Yr.DynamicWidget=$M(gh.DynamicSlices);Yr.FieldType=Uz.keyof({[Vn.ColorFieldType]:null,[Vn.BooleanFieldType]:null,[Vn.NumberFieldType]:null,[Vn.EmbedFieldType]:null,[Vn.GeoPointFieldType]:null,[Vn.DateFieldType]:null,[Vn.RangeFieldType]:null,[Vn.RichTextFieldType]:null,[Vn.SelectFieldType]:null,[Vn.SeparatorFieldType]:null,[Vn.TableFieldType]:null,[Vn.TextFieldType]:null,[Vn.TimestampFieldType]:null,[Vn.LinkFieldType]:null,[Vn.ImageFieldType]:null,[Vn.IntegrationFieldType]:null,[Pz.UIDFieldType]:null,[Bz.GroupFieldType]:null,[gh.SlicesFieldType]:null,[gh.LegacySlicesFieldType]:null});Yr.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 wMe=G,_Me=(0,wMe.__importStar)(ne),xMe=_c,kM=Yr;function OM(e){return _Me.record(xMe.WidgetKey,e)}Vi.sectionReader=OM;Vi.StaticSection=OM(kM.StaticWidget);Vi.DynamicSection=OM(kM.DynamicWidget);Vi.Sections={toStatic(e,t){return Object.entries(e).reduce((r,[i,o])=>({...r,[i]:kM.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=up,o=pt(),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 l(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=l(a.StaticSection),e.CustomType=l(a.DynamicSection);function u(b){return Object.entries(b.json).reduce((v,[,S])=>{const w=Object.entries(S);return v.concat(w)},[])}e.flattenWidgets=u;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 u(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 m(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=m;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=_})(Fz);var Wz={},k1={};(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={}))})(k1);var O1={},ba={},M1={};Object.defineProperty(M1,"__esModule",{value:!0});M1.HexaColor=void 0;const TMe=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;M1.HexaColor={is:e=>TMe.test(e)};var F1={};Object.defineProperty(F1,"__esModule",{value:!0});F1.toRecord=void 0;function IMe(e,t){return e.reduce((n,r)=>{const i=t(r);return{...n,[i]:r}},{})}F1.toRecord=IMe;var Gr={};Object.defineProperty(Gr,"__esModule",{value:!0});Gr.mapValues=Gr.isObject=Gr.withOptionals=Gr.isNotEmpty=Gr.zipObjects=void 0;const EMe=G,RMe=cn,zC=(0,EMe.__importStar)(ne);function $Me(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}}},{})}Gr.zipObjects=$Me;function kMe(e){return!!Object.keys(e).length}Gr.isNotEmpty=kMe;function OMe(e,t){return{...e,...t.reduce((n,[r,i])=>i?{...n,[r]:i}:n,{})}}Gr.withOptionals=OMe;const MMe=zC.record(zC.string,zC.unknown);function FMe(e){return(0,RMe.isRight)(MMe.decode(e))}Gr.isObject=FMe;function jMe(e,t){return Object.entries(e).reduce((n,[r,i])=>({...n,[r]:t(i,r)}),{})}Gr.mapValues=jMe;Object.defineProperty(ba,"__esModule",{value:!0});ba.Objects=ba.Arrays=ba.HexaColorCode=void 0;const MM=G;ba.HexaColorCode=(0,MM.__importStar)(M1);ba.Arrays=(0,MM.__importStar)(F1);ba.Objects=(0,MM.__importStar)(Gr);var Nm={};Object.defineProperty(Nm,"__esModule",{value:!0});Nm.VariationComparator=void 0;const yv=ba,QC=cp,ws=k1;function LMe(e,t){const n=yv.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 bv(e,t){const n=yv.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 l,u,c,f,p,h,m;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(((l=a.right)===null||l===void 0?void 0:l.type)===QC.GroupFieldType){const g={...a.right,config:{...a.right.config,fields:{}}};return g.config.fields=bv(void 0,(u=a.right.config)===null||u===void 0?void 0:u.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)===QC.GroupFieldType){const g={...a.right,config:{...a.right.config,fields:{}}};return g.config.fields=bv(((f=a.left)===null||f===void 0?void 0:f.type)===QC.GroupFieldType?(h=(p=a.left)===null||p===void 0?void 0:p.config)===null||h===void 0?void 0:h.fields:void 0,(m=a.right.config)===null||m===void 0?void 0:m.fields)||{},{op:ws.DiffOperation.Updated,value:g}}return{op:ws.DiffOperation.Updated,value:a.right}}})();return s?{...i,[o]:s}:i},{});return yv.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=LMe(e,t),r=bv(e==null?void 0:e.primary,t==null?void 0:t.primary),i=bv(e==null?void 0:e.items,t==null?void 0:t.items),o={...n,...r?{primary:r}:{},...i?{items:i}:{}};if(yv.Objects.isNotEmpty(o))return{op:ws.DiffOperation.Updated,value:o}}};Object.defineProperty(O1,"__esModule",{value:!0});O1.SliceComparator=void 0;const Nc=ba,HC=k1,DMe=Nm;function UMe(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},{})}O1.SliceComparator={compare(e,t){if(!e&&t)return{op:HC.DiffOperation.Added,value:t};if(e&&!t)return{op:HC.DiffOperation.Removed};const n=UMe(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,l])=>{if(!l)return a;const u=DMe.VariationComparator.compare(l.left,l.right);return u?{...a,[s]:u}:a},{}),o={...n,...Nc.Objects.isNotEmpty(i)?{variations:i}:{}};if(Nc.Objects.isNotEmpty(o))return{op:HC.DiffOperation.Updated,value:o}}};var Nz={};Object.defineProperty(Nz,"__esModule",{value:!0});(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(k1,e),(0,t.__exportStar)(O1,e),(0,t.__exportStar)(Nm,e),(0,t.__exportStar)(Nz,e)})(Wz);var ra={},Kz={};(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}})})(Kz);var qz={},Vz={};Object.defineProperty(Vz,"__esModule",{value:!0});var j1={};Object.defineProperty(j1,"__esModule",{value:!0});j1.SlicesTypes=void 0;const BMe=G,PMe=(0,BMe.__importStar)(ne),WMe=$1,NMe=Pm;j1.SlicesTypes=PMe.keyof({[WMe.CompositeSliceType]:null,[NMe.SharedSliceType]:null});(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)($1,e),(0,t.__exportStar)(gu,e),(0,t.__exportStar)(Pm,e),(0,t.__exportStar)(Wm,e),(0,t.__exportStar)(Vz,e),(0,t.__exportStar)(vu,e),(0,t.__exportStar)(EM,e),(0,t.__exportStar)(j1,e)})(qz);(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(cp,e),(0,t.__exportStar)(Bm,e),(0,t.__exportStar)(Kz,e),(0,t.__exportStar)(qz,e),(0,t.__exportStar)(RM,e),(0,t.__exportStar)(Yr,e)})(ra);(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(Fz,e),(0,t.__exportStar)(Wz,e),(0,t.__exportStar)(Vi,e),(0,t.__exportStar)(ra,e)})(he);var YC={},GC={},jl={},Uj;function Lt(){if(Uj)return jl;Uj=1,Object.defineProperty(jl,"__esModule",{value:!0}),jl.hasContentType=jl.hasFieldContentType=void 0;const e=cn,t=UM();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))}jl.hasFieldContentType=n;function r(i){return typeof i=="object"&&i!==null&&"__TYPE__"in i}return jl.hasContentType=r,jl}var Bj;function zz(){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=lt,r=Ye,i=(0,t.__importStar)(ne),o=Lt();e.EmptyContentType="EmptyContent";const a=u=>(0,o.hasContentType)(u)&&u.__TYPE__===e.EmptyContentType;e.isEmptyContent=a;const s=i.union([i.null,i.type({value:i.null})]),l=u=>new i.Type("EmptyLegacy",e.isEmptyContent,c=>(0,r.pipe)(s.decode(c),n.either.map(()=>({type:u,__TYPE__:e.EmptyContentType}))),()=>null);e.EmptyLegacy=l,e.EmptyContent=i.strict({type:i.string,__TYPE__:i.literal(e.EmptyContentType)})}(GC)),GC}var JC={},dr={};Object.defineProperty(dr,"__esModule",{value:!0});dr.defaultCtx=dr.getFieldCtx=dr.LegacyContentCtx=dr.FieldOrSliceType=void 0;const KMe=G,ZC=(0,KMe.__importStar)(ne),Pj=ra;dr.FieldOrSliceType=ZC.union([ZC.union([Pj.FieldType,Pj.SlicesTypes]),ZC.literal("Repeatable.Link")]);class FM{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=FM;function qMe(e,t,n){return new FM(e,[...t.fieldPath,t.fieldKey,...n||[]],t.allTypes)}dr.getFieldCtx=qMe;function VMe(e,t=new Map){return new FM(e,[],t)}dr.defaultCtx=VMe;var XC={},eS={},Wj;function Qz(){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=lt,r=Ye,i=(0,t.__importStar)(ne),o=Lt();e.BooleanContentType="BooleanContent";const a=u=>(0,o.hasContentType)(u)&&u.__TYPE__===e.BooleanContentType;e.isBooleanContent=a;const s=u=>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:{[u.keyOfType]:"Boolean"}}));e.BooleanLegacy=s,e.BooleanContent=i.strict({__TYPE__:i.literal(e.BooleanContentType),value:i.boolean});const l=u=>{var c;return((c=u.config)===null||c===void 0?void 0:c.default_value)!==void 0?{__TYPE__:e.BooleanContentType,value:u.config.default_value||!1}:void 0};e.BooleanContentDefaultValue=l}(eS)),eS}var tS={},Nj;function jM(){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=lt,r=Ye,i=(0,t.__importStar)(ne),o=pt(),a=Lt();e.EmbedContentType="EmbedContent";const s=u=>(0,a.hasContentType)(u)&&u.__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 l=u=>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:{[u.keyOfType]:"Embed"}}));e.EmbedLegacy=l,e.EmbedContent=i.intersection([e.EmbedContentLegacy,i.strict({__TYPE__:i.literal(e.EmbedContentType),all:i.unknown})])}(tS)),tS}var nS={},rS={},fs={};Object.defineProperty(fs,"__esModule",{value:!0});const zMe=G,QMe=cs,HMe=vo,gg=(0,zMe.__importStar)(ne);function YMe(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 gg.Type("TrimmedString",gg.string.is,(e,t)=>(0,HMe.pipe)(gg.string.validate(e,t),(0,QMe.chain)(n=>gg.success(YMe(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=lt,r=Ye,i=(0,t.__importStar)(ne),o=ra,a=(0,t.__importDefault)(fs),s=Lt(),l=Pi,u=f=>(0,s.hasContentType)(f)&&f.__TYPE__===l.FieldContentType&&(0,s.hasFieldContentType)(f)&&f.type==="Color";e.isColorContent=u;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__:l.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(l.FieldContentType)})}(rS)),rS}var iS={},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=lt,r=Ye,i=(0,t.__importStar)(ne),o=ra,a=(0,t.__importDefault)(fs),s=Lt(),l=Pi,u=f=>(0,s.hasContentType)(f)&&f.__TYPE__===l.FieldContentType&&(0,s.hasFieldContentType)(f)&&f.type==="Date";e.isDateContent=u;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__:l.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(l.FieldContentType)})}(iS)),iS}var oS={},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=lt,r=Ye,i=(0,t.__importStar)(ne),o=ra,a=(0,t.__importDefault)(fs),s=Lt(),l=Pi,u=f=>(0,s.hasContentType)(f)&&f.__TYPE__===l.FieldContentType&&(0,s.hasFieldContentType)(f)&&f.type==="Number";e.isNumberContent=u;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__:l.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(l.FieldContentType)})}(oS)),oS}var aS={},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=lt,r=Ye,i=(0,t.__importStar)(ne),o=ra,a=(0,t.__importDefault)(fs),s=Lt(),l=Pi,u=f=>(0,s.hasContentType)(f)&&f.__TYPE__===l.FieldContentType&&(0,s.hasFieldContentType)(f)&&f.type==="Range";e.isRangeContent=u;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__:l.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(l.FieldContentType)})}(aS)),aS}var sS={},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=lt,r=Ye,i=(0,t.__importStar)(ne),o=ra,a=(0,t.__importDefault)(fs),s=Lt(),l=Pi,u=p=>(0,s.hasContentType)(p)&&p.__TYPE__===l.FieldContentType&&(0,s.hasFieldContentType)(p)&&p.type==="Select";e.isSelectContent=u;const c=p=>new i.Type("SelectLegacy",e.isSelectContent,h=>(0,r.pipe)(a.default.decode(h),n.either.map(m=>e.SelectContent.encode({value:m,type:o.SelectFieldType,__TYPE__:l.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(l.FieldContentType)});const f=p=>{var h;return!((h=p.config)===null||h===void 0)&&h.default_value?{__TYPE__:l.FieldContentType,type:o.SelectFieldType,value:p.config.default_value||""}:void 0};e.SelectContentDefaultValue=f}(sS)),sS}var lS={},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=lt,r=Ye,i=(0,t.__importStar)(ne),o=ra,a=(0,t.__importDefault)(fs),s=Lt(),l=Pi,u=f=>(0,s.hasContentType)(f)&&f.__TYPE__===l.FieldContentType&&(0,s.hasFieldContentType)(f)&&f.type==="Text";e.isTextContent=u;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__:l.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(l.FieldContentType)})}(lS)),lS}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=lt,r=Ye,i=(0,t.__importStar)(ne),o=ra,a=(0,t.__importDefault)(fs),s=Lt(),l=Pi,u=f=>(0,s.hasContentType)(f)&&f.__TYPE__===l.FieldContentType&&(0,s.hasFieldContentType)(f)&&f.type==="Timestamp";e.isTimestampContent=u;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__:l.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(l.FieldContentType)})}(uS)),uS}var rL;function Hz(){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(),l=eL(),u=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,l.TextContent,u.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)}(nS)),nS}var cS={},iL;function Yz(){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=lt,r=vo,i=(0,t.__importStar)(ne),o=Lt();e.GeoPointContentType="GeoPointContent";const a=u=>(0,o.hasContentType)(u)&&u.__TYPE__===e.GeoPointContentType;e.isGeoPointContent=a;const s=i.strict({position:i.strict({lat:i.number,lng:i.number})}),l=u=>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:{[u.keyOfType]:"GeoPoint"}}));e.GeoPointLegacy=l,e.GeoPointContent=i.intersection([s,i.strict({__TYPE__:i.literal(e.GeoPointContentType)})])}(cS)),cS}var dS={},oL;function LM(){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=lt,r=Ye,i=(0,t.__importStar)(ne),o=Gr,a=pt(),s=Lt();e.ImageContentType="ImageContent";const l=p=>(0,s.hasContentType)(p)&&p.__TYPE__===e.ImageContentType;e.isImageContent=l;const u=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:u,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(m=>e.ImageContent.encode({...m,__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)})])}(dS)),dS}var fS={},aL;function Gz(){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=lt,r=Ye,i=(0,t.__importStar)(ne),o=Lt();e.IntegrationFieldContentType="IntegrationFieldsContent";const a=l=>(0,o.hasContentType)(l)&&l.__TYPE__===e.IntegrationFieldContentType;e.isIntegrationFieldContent=a;const s=l=>new i.Type("IntegrationFieldLegacy",e.isIntegrationFieldContent,u=>(0,r.pipe)(i.string.decode(u),n.either.map(c=>e.IntegrationFieldContent.encode({value:c,__TYPE__:e.IntegrationFieldContentType}))),u=>({content:u.value,types:{[l.keyOfType]:"IntegrationFields"}}));e.IntegrationFieldLegacy=s,e.IntegrationFieldContent=i.strict({__TYPE__:i.literal(e.IntegrationFieldContentType),value:i.string})}(fS)),fS}var pS={},Jz={},L1={},D1={};Object.defineProperty(D1,"__esModule",{value:!0});D1.default=JMe;let vg;const GMe=new Uint8Array(16);function JMe(){if(!vg&&(vg=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!vg))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return vg(GMe)}var _l={},Ec={},U1={};Object.defineProperty(U1,"__esModule",{value:!0});U1.default=void 0;var ZMe=/^(?:[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;U1.default=ZMe;Object.defineProperty(Ec,"__esModule",{value:!0});Ec.default=void 0;var XMe=eFe(U1);function eFe(e){return e&&e.__esModule?e:{default:e}}function tFe(e){return typeof e=="string"&&XMe.default.test(e)}var nFe=tFe;Ec.default=nFe;Object.defineProperty(_l,"__esModule",{value:!0});_l.default=void 0;_l.unsafeStringify=Zz;var rFe=iFe(Ec);function iFe(e){return e&&e.__esModule?e:{default:e}}const In=[];for(let e=0;e<256;++e)In.push((e+256).toString(16).slice(1));function Zz(e,t=0){return In[e[t+0]]+In[e[t+1]]+In[e[t+2]]+In[e[t+3]]+"-"+In[e[t+4]]+In[e[t+5]]+"-"+In[e[t+6]]+In[e[t+7]]+"-"+In[e[t+8]]+In[e[t+9]]+"-"+In[e[t+10]]+In[e[t+11]]+In[e[t+12]]+In[e[t+13]]+In[e[t+14]]+In[e[t+15]]}function oFe(e,t=0){const n=Zz(e,t);if(!(0,rFe.default)(n))throw TypeError("Stringified UUID is invalid");return n}var aFe=oFe;_l.default=aFe;Object.defineProperty(L1,"__esModule",{value:!0});L1.default=void 0;var sFe=uFe(D1),lFe=_l;function uFe(e){return e&&e.__esModule?e:{default:e}}let sL,hS,AS=0,mS=0;function cFe(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:hS;if(o==null||a==null){const p=e.random||(e.rng||sFe.default)();o==null&&(o=sL=[p[0]|1,p[1],p[2],p[3],p[4],p[5]]),a==null&&(a=hS=(p[6]<<8|p[7])&16383)}let s=e.msecs!==void 0?e.msecs:Date.now(),l=e.nsecs!==void 0?e.nsecs:mS+1;const u=s-AS+(l-mS)/1e4;if(u<0&&e.clockseq===void 0&&(a=a+1&16383),(u<0||s>AS)&&e.nsecs===void 0&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");AS=s,mS=l,hS=a,s+=122192928e5;const c=((s&268435455)*1e4+l)%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,lFe.unsafeStringify)(i)}var dFe=cFe;L1.default=dFe;var B1={},Ps={},Km={};Object.defineProperty(Km,"__esModule",{value:!0});Km.default=void 0;var fFe=pFe(Ec);function pFe(e){return e&&e.__esModule?e:{default:e}}function hFe(e){if(!(0,fFe.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 AFe=hFe;Km.default=AFe;Object.defineProperty(Ps,"__esModule",{value:!0});Ps.URL=Ps.DNS=void 0;Ps.default=bFe;var mFe=_l,gFe=vFe(Km);function vFe(e){return e&&e.__esModule?e:{default:e}}function yFe(e){e=unescape(encodeURIComponent(e));const t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}const Xz="6ba7b810-9dad-11d1-80b4-00c04fd430c8";Ps.DNS=Xz;const eQ="6ba7b811-9dad-11d1-80b4-00c04fd430c8";Ps.URL=eQ;function bFe(e,t,n){function r(i,o,a,s){var l;if(typeof i=="string"&&(i=yFe(i)),typeof o=="string"&&(o=(0,gFe.default)(o)),((l=o)===null||l===void 0?void 0:l.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+i.length);if(u.set(o),u.set(i,o.length),u=n(u),u[6]=u[6]&15|t,u[8]=u[8]&63|128,a){s=s||0;for(let c=0;c<16;++c)a[s+c]=u[c];return a}return(0,mFe.unsafeStringify)(u)}try{r.name=e}catch{}return r.DNS=Xz,r.URL=eQ,r}var P1={};Object.defineProperty(P1,"__esModule",{value:!0});P1.default=void 0;function CFe(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 SFe(wFe(_Fe(e),e.length*8))}function SFe(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 tQ(e){return(e+64>>>9<<4)+14+1}function wFe(e,t){e[t>>5]|=128<<t%32,e[tQ(t)-1]=t;let n=1732584193,r=-271733879,i=-1732584194,o=271733878;for(let a=0;a<e.length;a+=16){const s=n,l=r,u=i,c=o;n=zn(n,r,i,o,e[a],7,-680876936),o=zn(o,n,r,i,e[a+1],12,-389564586),i=zn(i,o,n,r,e[a+2],17,606105819),r=zn(r,i,o,n,e[a+3],22,-1044525330),n=zn(n,r,i,o,e[a+4],7,-176418897),o=zn(o,n,r,i,e[a+5],12,1200080426),i=zn(i,o,n,r,e[a+6],17,-1473231341),r=zn(r,i,o,n,e[a+7],22,-45705983),n=zn(n,r,i,o,e[a+8],7,1770035416),o=zn(o,n,r,i,e[a+9],12,-1958414417),i=zn(i,o,n,r,e[a+10],17,-42063),r=zn(r,i,o,n,e[a+11],22,-1990404162),n=zn(n,r,i,o,e[a+12],7,1804603682),o=zn(o,n,r,i,e[a+13],12,-40341101),i=zn(i,o,n,r,e[a+14],17,-1502002290),r=zn(r,i,o,n,e[a+15],22,1236535329),n=Qn(n,r,i,o,e[a+1],5,-165796510),o=Qn(o,n,r,i,e[a+6],9,-1069501632),i=Qn(i,o,n,r,e[a+11],14,643717713),r=Qn(r,i,o,n,e[a],20,-373897302),n=Qn(n,r,i,o,e[a+5],5,-701558691),o=Qn(o,n,r,i,e[a+10],9,38016083),i=Qn(i,o,n,r,e[a+15],14,-660478335),r=Qn(r,i,o,n,e[a+4],20,-405537848),n=Qn(n,r,i,o,e[a+9],5,568446438),o=Qn(o,n,r,i,e[a+14],9,-1019803690),i=Qn(i,o,n,r,e[a+3],14,-187363961),r=Qn(r,i,o,n,e[a+8],20,1163531501),n=Qn(n,r,i,o,e[a+13],5,-1444681467),o=Qn(o,n,r,i,e[a+2],9,-51403784),i=Qn(i,o,n,r,e[a+7],14,1735328473),r=Qn(r,i,o,n,e[a+12],20,-1926607734),n=Hn(n,r,i,o,e[a+5],4,-378558),o=Hn(o,n,r,i,e[a+8],11,-2022574463),i=Hn(i,o,n,r,e[a+11],16,1839030562),r=Hn(r,i,o,n,e[a+14],23,-35309556),n=Hn(n,r,i,o,e[a+1],4,-1530992060),o=Hn(o,n,r,i,e[a+4],11,1272893353),i=Hn(i,o,n,r,e[a+7],16,-155497632),r=Hn(r,i,o,n,e[a+10],23,-1094730640),n=Hn(n,r,i,o,e[a+13],4,681279174),o=Hn(o,n,r,i,e[a],11,-358537222),i=Hn(i,o,n,r,e[a+3],16,-722521979),r=Hn(r,i,o,n,e[a+6],23,76029189),n=Hn(n,r,i,o,e[a+9],4,-640364487),o=Hn(o,n,r,i,e[a+12],11,-421815835),i=Hn(i,o,n,r,e[a+15],16,530742520),r=Hn(r,i,o,n,e[a+2],23,-995338651),n=Yn(n,r,i,o,e[a],6,-198630844),o=Yn(o,n,r,i,e[a+7],10,1126891415),i=Yn(i,o,n,r,e[a+14],15,-1416354905),r=Yn(r,i,o,n,e[a+5],21,-57434055),n=Yn(n,r,i,o,e[a+12],6,1700485571),o=Yn(o,n,r,i,e[a+3],10,-1894986606),i=Yn(i,o,n,r,e[a+10],15,-1051523),r=Yn(r,i,o,n,e[a+1],21,-2054922799),n=Yn(n,r,i,o,e[a+8],6,1873313359),o=Yn(o,n,r,i,e[a+15],10,-30611744),i=Yn(i,o,n,r,e[a+6],15,-1560198380),r=Yn(r,i,o,n,e[a+13],21,1309151649),n=Yn(n,r,i,o,e[a+4],6,-145523070),o=Yn(o,n,r,i,e[a+11],10,-1120210379),i=Yn(i,o,n,r,e[a+2],15,718787259),r=Yn(r,i,o,n,e[a+9],21,-343485551),n=Is(n,s),r=Is(r,l),i=Is(i,u),o=Is(o,c)}return[n,r,i,o]}function _Fe(e){if(e.length===0)return[];const t=e.length*8,n=new Uint32Array(tQ(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 xFe(e,t){return e<<t|e>>>32-t}function W1(e,t,n,r,i,o){return Is(xFe(Is(Is(t,e),Is(r,o)),i),n)}function zn(e,t,n,r,i,o,a){return W1(t&n|~t&r,e,t,i,o,a)}function Qn(e,t,n,r,i,o,a){return W1(t&r|n&~r,e,t,i,o,a)}function Hn(e,t,n,r,i,o,a){return W1(t^n^r,e,t,i,o,a)}function Yn(e,t,n,r,i,o,a){return W1(n^(t|~r),e,t,i,o,a)}var TFe=CFe;P1.default=TFe;Object.defineProperty(B1,"__esModule",{value:!0});B1.default=void 0;var IFe=nQ(Ps),EFe=nQ(P1);function nQ(e){return e&&e.__esModule?e:{default:e}}const RFe=(0,IFe.default)("v3",48,EFe.default);var $Fe=RFe;B1.default=$Fe;var N1={},K1={};Object.defineProperty(K1,"__esModule",{value:!0});K1.default=void 0;const kFe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);var OFe={randomUUID:kFe};K1.default=OFe;Object.defineProperty(N1,"__esModule",{value:!0});N1.default=void 0;var lL=rQ(K1),MFe=rQ(D1),FFe=_l;function rQ(e){return e&&e.__esModule?e:{default:e}}function jFe(e,t,n){if(lL.default.randomUUID&&!t&&!e)return lL.default.randomUUID();e=e||{};const r=e.random||(e.rng||MFe.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,FFe.unsafeStringify)(r)}var LFe=jFe;N1.default=LFe;var q1={},V1={};Object.defineProperty(V1,"__esModule",{value:!0});V1.default=void 0;function DFe(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 gS(e,t){return e<<t|e>>>32-t}function UFe(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 l=0;l<16;++l)s[l]=e[a*64+l*4]<<24|e[a*64+l*4+1]<<16|e[a*64+l*4+2]<<8|e[a*64+l*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]=gS(s[h-3]^s[h-8]^s[h-14]^s[h-16],1);let l=n[0],u=n[1],c=n[2],f=n[3],p=n[4];for(let h=0;h<80;++h){const m=Math.floor(h/20),g=gS(l,5)+DFe(m,u,c,f)+p+t[m]+s[h]>>>0;p=f,f=c,c=gS(u,30)>>>0,u=l,l=g}n[0]=n[0]+l>>>0,n[1]=n[1]+u>>>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 BFe=UFe;V1.default=BFe;Object.defineProperty(q1,"__esModule",{value:!0});q1.default=void 0;var PFe=iQ(Ps),WFe=iQ(V1);function iQ(e){return e&&e.__esModule?e:{default:e}}const NFe=(0,PFe.default)("v5",80,WFe.default);var KFe=NFe;q1.default=KFe;var z1={};Object.defineProperty(z1,"__esModule",{value:!0});z1.default=void 0;var qFe="00000000-0000-0000-0000-000000000000";z1.default=qFe;var Q1={};Object.defineProperty(Q1,"__esModule",{value:!0});Q1.default=void 0;var VFe=zFe(Ec);function zFe(e){return e&&e.__esModule?e:{default:e}}function QFe(e){if(!(0,VFe.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}var HFe=QFe;Q1.default=HFe;(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 u.default}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return l.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(L1),n=c(B1),r=c(N1),i=c(q1),o=c(z1),a=c(Q1),s=c(Ec),l=c(_l),u=c(Km);function c(f){return f&&f.__esModule?f:{default:f}}})(Jz);var uL;function H1(){return uL||(uL=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=lt,r=Ye,i=(0,t.__importStar)(ne),o=_1,a=Jz,s=pt(),l=nt,u=Lt(),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",m=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:m,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,u.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,u.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,u.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,u.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,u.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,u.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,u.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,l.nullable)(i.partial({title:i.string}))})])),N=new i.Type("FilledExternalLink",P=>(0,u.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,u.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,u.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,u.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,u.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}))}(pS)),pS}var Ni={},vS={},cL;function oQ(){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=lt,r=cn,i=Ye,o=(0,t.__importStar)(ne),a=Lt(),s=H1(),l="RepeatableContent";e.RepeatableContent=o.strict({__TYPE__:o.literal(l),type:o.literal("Link"),value:o.array(s.LinkContent)});const u=p=>(0,a.hasContentType)(p)&&p.__TYPE__===l;e.isRepeatableContent=u;const c=(p,h)=>new o.Type("RepeatableLegacy",e.isRepeatableContent,m=>(0,i.pipe)(o.array(o.unknown).decode(m),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"}))),m=>({content:o.array(s.LinkContent).encode(m.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:m,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:m,model:T,content:v});return!E||!(0,s.isLinkContent)(E)?b:b.concat(E)},[]);return C({path:p,key:h,apiId:m,model:g,content:{__TYPE__:y.__TYPE__,type:y.type,value:_}})}}e.traverseRepeatableContent=f}(vS)),vS}var yS={},bS={},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=lt,r=cn,i=Ye,o=(0,t.__importStar)(ne),a=_1,s=Bm,l=pt(),u=nt,c=jM(),f=LM(),p=H1(),h=R=>o.strict({data:R,start:o.number,end:o.number,type:o.literal(s.RichTextNodeType.hyperlink)}),m=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),m,g]),e.SpanLegacy=o.union([h(p.FilledLinkLegacy),m,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,u.nullable)(R)})])}),o.partial({label:l.StringOrNull,direction:l.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:l.StringOrNull,direction:l.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:l.StringOrNull,direction:l.StringOrNull})]));function w(R){return R.type===s.RichTextNodeType.embed}e.checkEmbedBlock=w;const T=R=>o.exact(o.intersection([o.type({type:(0,u.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])}(bS)),bS}var pL;function DM(){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=lt,r=Ye,i=(0,t.__importStar)(ne),o=Lt(),a=fL();e.RichTextContentType="StructuredTextContent";const s=u=>(0,o.hasContentType)(u)&&u.__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 l=u=>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:{[u.keyOfType]:"StructuredText"}}));e.RichTextLegacy=l}(yS)),yS}var CS={},hL;function aQ(){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=Lt();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)})}(CS)),CS}var SS={},AL;function sQ(){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=lt,r=Ye,i=(0,t.__importStar)(ne),o=he,a=Lt(),s=DM();e.TableContentType="TableContent";const l=y=>(0,a.hasContentType)(y)&&y.__TYPE__===e.TableContentType;e.isTableContent=l;const u=i.strict({type:i.union([i.literal("tableHeader"),i.literal("tableCell")]),content:s.RichTextContent}),c=i.strict({type:i.literal("tableRow"),content:i.array(u)});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)}),m=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=m;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}(SS)),SS}var mL;function YFe(){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=zz(),i=Qz(),o=jM(),a=Hz(),s=Pi,l=Yz(),u=LM(),c=Gz(),f=H1(),p=oQ(),h=DM(),m=aQ(),g=sQ();Ni.NestableContent=n.union([r.EmptyContent,i.BooleanContent,o.EmbedContent,a.TextContent,a.TimestampContent,a.SelectContent,a.RangeContent,a.NumberContent,a.DateContent,a.ColorContent,l.GeoPointContent,u.ImageContent,c.IntegrationFieldContent,f.LinkContent,h.RichTextContent,m.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,l.isGeoPointContent)(b)||(0,h.isRichTextContent)(b)||(0,i.isBooleanContent)(b)||(0,o.isEmbedContent)(b)||(0,u.isImageContent)(b)||(0,c.isIntegrationFieldContent)(b)||(0,f.isLinkContent)(b)||(0,m.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,l.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,u.ImageLegacy)(b);case"IntegrationFields":return(0,c.IntegrationFieldLegacy)(b);case"Link":return(0,f.LinkContentLegacy)(b);case"Separator":return(0,m.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 l.GeoPointContentType:return(0,l.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 u.ImageContentType:return(0,u.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 m.SeparatorContentType:return(0,m.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)(Qz(),e),(0,t.__exportStar)(jM(),e),(0,t.__exportStar)(Hz(),e),(0,t.__exportStar)(Yz(),e),(0,t.__exportStar)(LM(),e),(0,t.__exportStar)(Gz(),e),(0,t.__exportStar)(H1(),e),(0,t.__exportStar)(YFe(),e),(0,t.__exportStar)(oQ(),e),(0,t.__exportStar)(DM(),e),(0,t.__exportStar)(aQ(),e),(0,t.__exportStar)(sQ(),e)}(XC)),XC}var la={},vL;function Y1(){if(vL)return la;vL=1,Object.defineProperty(la,"__esModule",{value:!0}),la.repeatableContentWithDefaultNestableContentValues=la.withDefaultNestableContentValues=la.withDefaultSlicePrimaryContentValues=void 0;const e=he,t=ps(),n=ia();function r(a,s){const l=s;for(const[u,c]of Object.entries(a)){const f=s[u];if(f===void 0){if(c.type===e.GroupFieldType)l[u]=(0,t.groupContentWithDefaultValues)(c,t.GroupContentDefaultValue);else{const p=(0,n.NestableContentDefaultValue)(c);p&&(l[u]=p)}continue}c.type===e.GroupFieldType&&(0,t.isGroupContent)(f)&&(l[u]=(0,t.groupContentWithDefaultValues)(c,f))}return l}la.withDefaultSlicePrimaryContentValues=r;function i(a,s){return Object.entries(a).reduce((l,[u,c])=>{if(s[u]===void 0){const f=(0,n.NestableContentDefaultValue)(c);return f!==void 0?{...l,[u]:f}:l}return l},s)}la.withDefaultNestableContentValues=i;function o(a,s){const l=Object.entries(a);return s.map(u=>l.reduce((c,[f,p])=>{var h;const m=u.value.find(([g])=>g===f);if(p.type==="Group"){const g=(0,t.groupContentWithDefaultValues)(p,(h=m==null?void 0:m[1])!==null&&h!==void 0?h:{__TYPE__:t.GroupContentType,value:[]});return{...c,value:[...c.value.filter(([y])=>y!==f),...g?[[f,g]]:[]]}}else if(!m){const g=(0,n.NestableContentDefaultValue)(p);return{...c,value:[...c.value,...g?[[f,g]]:[]]}}return c},u))}return la.repeatableContentWithDefaultNestableContentValues=o,la}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=lt,r=cn,i=Ye,o=(0,t.__importStar)(ne),a=he,s=dr,l=Lt(),u=ia(),c=Y1();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([u.NestableContent,e.GroupContent])]))})),e.GroupContent=o.recursion("GroupContent",()=>o.strict({__TYPE__:o.literal(e.GroupContentType),value:o.array(e.GroupItemContent)}));const f=_=>(0,l.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,l.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,u.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,u.NestableLegacy)(T).encode(w);return E?{content:{...v.content,[S]:E.content},types:{...v.types,...E.types}}:v},{content:{},types:{}}));e.GroupItemLegacy=h;const m=_=>{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=m;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,u.isRepeatableContent)(B)?H=(0,u.traverseRepeatableContent)({path:E.concat([{key:$,type:"Widget"}]),key:$,apiId:$,model:(K==null?void 0:K.type)==="Link"?K:void 0,content:B})(S):(0,u.isTableContent)(B)?H=(0,u.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,u.isNestableContent)(H)||(0,e.isGroupContent)(H))?O:O.concat([[$,H]])},[]);return{__TYPE__:w.__TYPE__,value:R}})}e.traverseGroupItemsContent=C}(JC)),JC}var wS={},_S={},xS={},Ll={},bL;function lQ(){if(bL)return Ll;bL=1,Object.defineProperty(Ll,"__esModule",{value:!0}),Ll.RepeatableWidgets=Ll.RepeatableWidgetsLegacy=void 0;const t=(0,G.__importStar)(ne),n=ps(),r=ia(),i=s=>t.array((0,n.GroupItemLegacy)(s));Ll.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 Ll.RepeatableWidgets=t.array(a),Ll}var CL;function Cv(){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=lt,r=cn,i=Ye,o=(0,t.__importStar)(ne),a=dr,s=Lt(),l=ps(),u=ia(),c=Y1(),f=lQ();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})),m=_=>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,u.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,u.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=m,e.CompositeSliceContent=o.strict({__TYPE__:o.literal(e.CompositeSliceContentType),nonRepeat:o.record(o.string,u.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,u.isNestableContent)(z)?{...$,[B]:z}:(console.warn(`Warn: Non nestable content with key [${B}] detected in a composite slice [${v}] with key [${b}]`),$):$},{}),O=(0,l.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}(xS)),xS}var TS={},ua={},SL;function uQ(){if(SL)return ua;SL=1,Object.defineProperty(ua,"__esModule",{value:!0}),ua.isSlicePrimaryContent=ua.SlicePrimaryLegacy=ua.SlicePrimaryContent=void 0;const t=(0,G.__importStar)(ne),n=he,r=ps(),i=ia();ua.SlicePrimaryContent=t.union([i.NestableContent,r.GroupContent]);const o=s=>{const l=(0,r.GroupLegacy)(s),u=(0,i.NestableLegacy)(s);return{decode(c){return s.fieldType===n.GroupFieldType?l.decode(c):u.decode(c)},encode(c){return(0,r.isGroupContent)(c)?l.encode(c):u.encode(c)}}};ua.SlicePrimaryLegacy=o;const a=s=>(0,i.isNestableContent)(s)||(0,r.isGroupContent)(s);return ua.isSlicePrimaryContent=a,ua}var wL;function Sv(){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=lt,r=cn,i=Ye,o=(0,t.__importStar)(ne),a=_1,s=he,l=dr,u=Lt(),c=ps(),f=ia(),p=Y1(),h=lQ(),m=uQ();e.SharedSliceContentType="SharedSliceContent";const g=v=>(0,u.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,l.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,l.getFieldCtx)(O,v,["variations",w.variation,"primary"]),K=(0,m.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,l.getFieldCtx)(R,v,["variations",S.variation,"primary"]),B=(0,m.SlicePrimaryLegacy)($).encode(O);return B?{content:{...E.content,[R]:B.content},types:{...E.types,...B.types}}:E},{content:{},types:{}}),T=(()=>{const E=(0,l.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,m.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,m.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}(TS)),TS}var Qr={},_L;function wv(){if(_L)return Qr;_L=1,Object.defineProperty(Qr,"__esModule",{value:!0}),Qr.migrateSimpleSlice=Qr.traverseSimpleSliceContent=Qr.SimpleSliceLegacy=Qr.isSimpleSliceContent=Qr.SimpleSliceContent=void 0;const t=(0,G.__importStar)(ne),n=ps(),r=ia();Qr.SimpleSliceContent=t.union([r.NestableContent,n.GroupContent]);const i=l=>(0,r.isNestableContent)(l)||(0,n.isGroupContent)(l);Qr.isSimpleSliceContent=i;const o=l=>({decode:(()=>l.fieldType==="Group"?(0,n.GroupLegacy)(l).decode.bind(null):(0,r.NestableLegacy)(l).decode.bind(null))(),encode:u=>{switch(u.__TYPE__){case"GroupContentType":return(0,n.GroupLegacy)(l).encode(u);default:return(0,r.NestableLegacy)(l).encode(u)}}});Qr.SimpleSliceLegacy=o;function a({path:l,sliceKey:u,sliceName:c,model:f,content:p}){return(h,m)=>{if((0,n.isGroupContent)(p.widget)){const y=(0,n.traverseGroupContent)({path:l,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&&m({key:p.key,apiId:p.name,path:l,model:f,content:{...p,widget:y}})}const g=h({key:p.key,apiId:p.name,path:l,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&&m({key:u,apiId:c,path:l,model:f,content:{...p,widget:g}})}}Qr.traverseSimpleSliceContent=a;function s(l,u){var c;const[,f]=u.key.split("$"),p=`${l.sliceName}$${f}`;return u.widget.__TYPE__==="GroupContentType"?{key:p,name:l.sliceName,maybeLabel:u.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:l.variationId,primary:{},items:u.widget.value.map(h=>({__TYPE__:"GroupItemContent",value:h.value.reduce((m,[g,y])=>{var C;return!((C=l.fields.items)===null||C===void 0)&&C[g]?m.concat([[g,y]]):m},[])}),[])}}:{key:p,name:l.sliceName,maybeLabel:u.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:l.variationId,primary:!((c=l.fields.primary)===null||c===void 0)&&c[u.name]?{[u.name]:u.widget}:{},items:[]}}}return Qr.migrateSimpleSlice=s,Qr}var xL;function cQ(){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=Cv(),i=Sv(),o=wv(),a=s=>({decode:l=>(()=>{switch(s.fieldType){case"Slice":return(0,r.CompositeSliceLegacy)(s);case"SharedSlice":return(0,i.SharedSliceLegacy)(s);default:return(0,o.SimpleSliceLegacy)(s)}})().decode(l),encode:l=>{switch(l.__TYPE__){case"SharedSliceContent":return(0,i.SharedSliceLegacy)(s).encode(l);case"CompositeSliceContent":return(0,r.CompositeSliceLegacy)(s).encode(l);default:return(0,o.SimpleSliceLegacy)(s).encode(l)}}});e.SliceLegacy=a,e.SliceContent=n.union([r.CompositeSliceContent,i.SharedSliceContent,o.SimpleSliceContent]),(0,t.__exportStar)(Cv(),e),(0,t.__exportStar)(Sv(),e),(0,t.__exportStar)(wv(),e),(0,t.__exportStar)(uQ(),e)}(_S)),_S}var Tn={},TL;function dQ(){if(TL)return Tn;TL=1,Object.defineProperty(Tn,"__esModule",{value:!0}),Tn.migrateSliceItem=Tn.SlicesItemLegacy=Tn.sliceItemContentWithDefaultValues=Tn.isSimpleSliceItemContent=Tn.isCompositeSliceItemContent=Tn.isSharedSliceItemContent=Tn.SliceItemContent=void 0;const e=G,t=lt,n=cn,r=Ye,i=(0,e.__importStar)(ne),o=nt,a=dr,s=ps(),l=ia(),u=Y1(),c=cQ(),f=Cv(),p=Sv(),h=wv();Tn.SliceItemContent=i.type({key:i.string,name:i.string,maybeLabel:i.union([i.string,i.undefined]),widget:c.SliceContent});function m(S){return(0,p.isSharedSliceContent)(S.widget)}Tn.isSharedSliceItemContent=m;function g(S){return(0,f.isCompositeSliceContent)(S.widget)}Tn.isCompositeSliceItemContent=g;function y(S){return(0,s.isGroupContent)(S.widget)||(0,l.isNestableContent)(S.widget)}Tn.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,u.repeatableContentWithDefaultNestableContentValues)(S.config.fields,w.value);return{...w,value:E}}return w}Tn.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)||{}}});Tn.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 Tn.migrateSliceItem=v,Tn}var IS={},IL;function GFe(){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=lt,r=Ye,i=(0,t.__importStar)(ne),o=jm,a=he,s=Lt(),l=Cv(),u=Sv(),c=wv(),f=dQ();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 m(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=m;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,u.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,l.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}(IS)),IS}var EL;function fQ(){return EL||(EL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(cQ(),e),(0,t.__exportStar)(dQ(),e),(0,t.__exportStar)(GFe(),e)}(wS)),wS}var ES={},RL;function pQ(){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=lt,r=Ye,i=(0,t.__importStar)(ne),o=Lt();e.UIDContentType="UIDContent";const a=l=>(0,o.hasContentType)(l)&&l.__TYPE__===e.UIDContentType;e.isUIDContent=a;const s=l=>new i.Type("UIDLegacy",e.isUIDContent,u=>(0,r.pipe)(i.string.decode(u),n.either.map(c=>e.UIDContent.encode({value:c,__TYPE__:e.UIDContentType}))),u=>({content:u.value,types:{[l.keyOfType]:"UID"}}));e.UIDLegacy=s,e.UIDContent=i.type({__TYPE__:i.literal(e.UIDContentType),value:i.string})}(ES)),ES}var ca={},$L;function JFe(){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=fQ(),o=pQ();ca.WidgetContent=t.union([n.GroupContent,r.NestableContent,o.UIDContent,i.SlicesContent]);const a=l=>(0,n.isGroupContent)(l)||(0,r.isNestableContent)(l)||(0,o.isUIDContent)(l)||(0,i.isSlicesContent)(l);ca.isWidgetContent=a;const s=l=>({decode(u){if(!l.fieldType)return;const c=(()=>{switch(l.fieldType){case"UID":return(0,o.UIDLegacy)(l);case"Group":return(0,n.GroupLegacy)(l);case"Choice":case"Slices":return(0,i.SlicesLegacy)(l);default:return(0,r.NestableLegacy)(l)}})();if(c)return c.decode(u)},encode(u){switch(u.__TYPE__){case o.UIDContentType:return(0,o.UIDLegacy)(l).encode(u);case n.GroupContentType:return(0,n.GroupLegacy)(l).encode(u);case i.SlicesContentType:return(0,i.SlicesLegacy)(l).encode(u);default:return(0,r.NestableLegacy)(l).encode(u)}}});return ca.WidgetLegacy=s,ca}var kL;function UM(){return kL||(kL=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(zz(),e),(0,t.__exportStar)(ps(),e),(0,t.__exportStar)(ia(),e),(0,t.__exportStar)(fQ(),e),(0,t.__exportStar)(pQ(),e),(0,t.__exportStar)(JFe(),e)}(YC)),YC}Object.defineProperty(Rr,"__esModule",{value:!0});Rr.migrateDocument=Rr.collectWidgets=Rr.traverseDocument=Rr.fillDocumentWithDefaultValues=Rr.DocumentLegacy=Rr.Document=void 0;const ZFe=G,hQ=lt,BM=cn,AQ=Ye,wd=(0,ZFe.__importStar)(ne),mQ=jm,PM=_c,_d=he,Jr=UM(),zw=dr;Rr.Document=wd.record(PM.WidgetKey,Jr.WidgetContent);const XFe=wd.record(PM.WidgetKey,wd.unknown),WM=e=>new wd.Type("Document",t=>!!t&&typeof t=="object",t=>(0,AQ.pipe)(XFe.decode(t),hQ.either.map(n=>Object.entries(n).reduce((r,[i,o])=>{const a=(0,zw.defaultCtx)(i,e),s=(0,Jr.WidgetLegacy)(a).decode(o);return!s||(0,BM.isLeft)(s)?r:{...r,[i]:s.right}},{}))),t=>Object.entries(t).reduce((n,[r,i])=>{const o=(0,zw.defaultCtx)(r,e),a=(0,Jr.WidgetLegacy)(o).encode(i);return a?{content:{...n.content,[r]:a.content},types:{...n.types,...a.types}}:n},{content:{},types:{}}));function gQ(e){const t=Object.entries(e),{types:n,widgets:r}=t.reduce((a,[s,l])=>{if(s.endsWith("_TYPE")){const u=zw.FieldOrSliceType.decode(l);if((0,BM.isRight)(u))return{...a,types:a.types.set(s.substring(0,s.length-5),u.right)}}return!s.endsWith("_POSITION")&&!s.endsWith("_TYPE")?{...a,widgets:{...a.widgets,[s]:l}}:a},{types:new Map,widgets:{}}),i=e.slugs_INTERNAL||[],o=e.uid;return{widgets:r,types:n,uid:o,slugs:i}}function eje(e,t){const n=(0,AQ.pipe)(wd.record(PM.WidgetKey,wd.unknown).decode(e),hQ.either.chain(r=>{const{types:i,widgets:o}=gQ(r);return WM(i).decode(o)}));return(0,BM.isLeft)(n)?void 0:vQ(n.right,t)}function tje(e){const t=WM().encode(e);return{...t.content,...t.types}}Rr.DocumentLegacy={_codec:WM,extractMetadata:gQ,parse:eje,encode:tje};function NM(e){return{customTypeId:e==null?void 0:e.id,fields:Object.fromEntries((0,_d.flattenSections)(e))}}function nje(e,t){const{fields:n}=e&&_d.StaticCustomType.is(e)?NM(e):e;return Object.entries(n).reduce((r,[i,o])=>{const a=t[i],s=(()=>{switch(o.type){case"Group":return(0,Jr.isGroupContent)(a)?(0,Jr.groupContentWithDefaultValues)(o,a):a;case"Choice":case"Slices":return(0,Jr.isSlicesContent)(a)?(0,Jr.slicesContentWithDefaultValues)(o,a):a;default:return a===void 0&&_d.NestableWidget.is(o)?(0,Jr.NestableContentDefaultValue)(o):a}})();return s?{...r,[i]:s}:r},t)}Rr.fillDocumentWithDefaultValues=nje;function KM({document:e,customType:t}){const n=t&&_d.StaticCustomType.is(t)?NM(t):t;return({transformWidget:r=({content:o})=>o,transformSlice:i=({content:o})=>o})=>{const o=n&&Object.entries(n.fields).reduce((a,[s,l])=>({...a,[s]:l}),{});return Object.entries(e).reduce((a,[s,l])=>{const u=o&&o[s],c=mQ.ContentPath.make([{key:n==null?void 0:n.customTypeId,type:"CustomType"},{key:s,type:"Widget"}]),f=(()=>{switch(l.__TYPE__){case"SliceContentType":return(0,Jr.traverseSlices)({path:c,key:s,model:(u==null?void 0:u.type)==="Slices"||(u==null?void 0:u.type)==="Choice"?u:void 0,content:l})({transformWidget:r,transformSlice:i});case"GroupContentType":return(0,Jr.traverseGroupContent)({path:c,key:s,apiId:s,model:(u==null?void 0:u.type)==="Group"?u:void 0,content:l})(r);case"RepeatableContent":return(0,Jr.traverseRepeatableContent)({path:c,key:s,apiId:s,model:(u==null?void 0:u.type)==="Link"?u:void 0,content:l})(r);case"TableContent":return(0,Jr.traverseTableContent)({path:c,key:s,apiId:s,model:(u==null?void 0:u.type)==="Table"?u:void 0,content:l})(r);default:return r({path:c,key:s,apiId:s,model:(u==null?void 0:u.type)!=="Group"&&(u==null?void 0:u.type)!=="Slices"&&(u==null?void 0:u.type)!=="Choice"?u:void 0,content:l})}})();return{...a,...f?{[s]:f}:{}}},{})}}Rr.traverseDocument=KM;function rje(e,t){const n={};return KM({document:e})({transformWidget:({content:r,path:i})=>{const o=mQ.ContentPath.serialize(i);return t(r,i)&&(n[o]=r),r}}),n}Rr.collectWidgets=rje;function vQ(e,t){const n=_d.StaticCustomType.is(t)?NM(t):t;return Object.values((0,_d.collectSharedSlices)(n)).some(i=>!!i.legacyPaths)?KM({document:e,customType:t})({transformSlice:Jr.migrateSliceItem}):e}Rr.migrateDocument=vQ;(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(Rr,e),(0,t.__exportStar)(UM(),e),(0,t.__exportStar)(dr,e)})(fe);function yQ(e){if(fe.isRepeatableContent(e))return e;if(fe.isLinkContent(e))return{__TYPE__:"RepeatableContent",type:"Link",value:[e]}}function bQ(e){if(fe.isLinkContent(e))return e;if(fe.isRepeatableContent(e)){const[t]=e.value;if(fe.isLinkContent(t))return t}}function ije(e,t){let n=sje(e,t);return n=oje(e,n),n=aje(e,n),fe.fillDocumentWithDefaultValues(e,n)}function oje(e,t){return he.flattenSections(e).reduce((r,[i,o])=>!t[i]&&o.type==="Group"?{...r,[i]:CQ}:r,t)}function aje(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 sje(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?yQ(r)??r:r;case"RepeatableContent":return i?r:bQ(r)??r;default:return r}}return r}})}const CQ={__TYPE__:"GroupContentType",value:[{__TYPE__:"GroupItemContent",value:[]}]},SQ={unclassified:{title:"Draft",color:"amber"},published:{title:"Live",color:"green"},release:{title:"Planned",color:"purple"},archived:{title:"Archived",color:"grey"}},Qw={unclassified:["unclassified","published"],archived:["unclassified","published"],release:["release","published"],published:["published","unclassified"]};function qM(e){const{documentId:t,versionId:n,baseUrl:r,status:i,releaseId:o}=e,a={s:i,v:n,r:o},s=ri.createRouteParams({params:a}),l=new URLSearchParams(s).toString();return new URL(`pages/${t}?${l}`,r)}function lje(e){const{children:t,...n}=e;return d.jsx(ui.QueryErrorResetBoundary,{children:({reset:r})=>d.jsx(A.ErrorBoundary,{...n,onReset:r,children:t})})}const wQ=I.createContext(void 0),uje={selectedIds:new Set,excludedIds:new Set,isAllSelected:!1};function _Q(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{...uje,...n}}const[l,u]=I.useState(s),c=I.useMemo(()=>{const{selectedIds:T,excludedIds:E,isAllSelected:R}=l;return R?a.current-E.size:T.size},[l]),f=I.useCallback(T=>{const{isAllSelected:E,selectedIds:R,excludedIds:O}=l;return E?!O.has(T):R.has(T)},[l]),p=I.useCallback(()=>{const{isAllSelected:T,selectedIds:E,excludedIds:R}=l;return{selectedIds:[...E],excludedIds:[...R],isAllSelected:T,selectedCount:c}},[l,c]),h=ze.useStableCallback(()=>{i&&u({isAllSelected:!0,selectedIds:new Set,excludedIds:new Set})}),m=ze.useStableCallback(()=>{u({isAllSelected:!1,selectedIds:new Set,excludedIds:new Set})});I.useEffect(()=>{const{isAllSelected:T,selectedIds:E,excludedIds:R}=l,O=a.current;if(!(O===0||!i)){if(T&&R.size===O){m();return}if(!T&&E.size===O){h();return}}},[l,i,h,m]);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?u(E=>({...E,selectedIds:new Set})):u({isAllSelected:!1,selectedIds:new Set([T]),excludedIds:new Set})}function C(T,E,R){const O=cje(E,R,T),$=f(T);return $?v(O):b(O),$}const _=ze.useStableCallback(()=>{c>0?m():h()});function b(T){const{isAllSelected:E}=l;if(E){u(R=>({...R,excludedIds:OL(R.excludedIds,T)}));return}u(R=>({...R,selectedIds:ML(R.selectedIds,T)}))}function v(T){const{isAllSelected:E}=l;if(E){u(R=>({...R,excludedIds:ML(R.excludedIds,T)}));return}u(R=>({...R,selectedIds:OL(R.selectedIds,T)}))}function S(T){a.current=T}const w=I.useMemo(()=>({selectedCount:c,state:l,totalItemCount:a.current,isSelected:f,isSelectAllEnabled:i,getSelectionState:p,toggleSelection:g,toggleSelectAll:_,clearSelection:m,setTotalItemCount:S}),[l,m,p,i,f,c,_,g]);return d.jsx(wQ.Provider,{value:w,children:t})}function xl(e){const t=I.useContext(wQ);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,...l}=t;n!==void 0&&n!==o&&i(n);const u=ze.useStableCallback(r);return I.useEffect(()=>{u==null||u(s())},[s,u,a]),{...l,getSelectionState:s,isAllSelected:a.isAllSelected}}function cje(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 Hw;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Hw||(Hw={}));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"]),dje=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,l=0;for(;l<a.path.length;){const u=a.path[l];l===a.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(n(a))):s[u]=s[u]||{_errors:[]},s=s[u],l++}}};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 xQ=xd;function fje(e){xQ=e}function _v(){return xQ}const xv=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 l=r.filter(u=>!!u).slice().reverse();for(const u of l)s=u(a,{data:t,defaultError:s}).message;return{...i,path:o,message:s}},pje=[];function ie(e,t){const n=_v(),r=xv({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 Xn{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 Xn.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}),gr=e=>({status:"valid",value:e}),Yw=e=>e.status==="aborted",Gw=e=>e.status==="dirty",vh=e=>e.status==="valid",yh=e=>typeof Promise<"u"&&e instanceof Promise;function Tv(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 TQ(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 l,u;const{message:c}=e;return a.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:(l=c??r)!==null&&l!==void 0?l:s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:(u=c??n)!==null&&u!==void 0?u: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 Xn,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(l=>l?!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 VM({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 hje=/^c[^\s-]{8,}$/i,Aje=/^[0-9a-z]+$/,mje=/^[0-9A-HJKMNP-TV-Z]{26}$/,gje=/^[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,vje=/^[a-z0-9_-]{21}$/i,yje=/^[-+]?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)?)??$/,bje=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Cje="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let RS;const Sje=/^(?:(?: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])$/,wje=/^(([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})))$/,_je=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,IQ="((\\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])))",xje=new RegExp(`^${IQ}$`);function EQ(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 Tje(e){return new RegExp(`^${EQ(e)}$`)}function RQ(e){let t=`${IQ}T${EQ(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 Ije(e,t){return!!((t==="v4"||!t)&&Sje.test(e)||(t==="v6"||!t)&&wje.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 Xn;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")bje.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")RS||(RS=new RegExp(Cje,"u")),RS.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")gje.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")vje.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")hje.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")Aje.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")mje.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"?RQ(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"?xje.test(t.data)||(i=this._getOrReturnCtx(t,i),ie(i,{code:J.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?Tje(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"?yje.test(t.data)||(i=this._getOrReturnCtx(t,i),ie(i,{validation:"duration",code:J.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?Ije(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"?_je.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 Eje(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 Xn;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"?Eje(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 Xn;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 gr(t.data)}}bh.create=e=>new bh({typeName:Te.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Le(e)});class yu 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 Xn;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 yu({...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}}yu.create=e=>new yu({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Te.ZodDate,...Le(e)});class Iv 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 gr(t.data)}}Iv.create=e=>new Iv({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 gr(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 gr(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 gr(t.data)}}Td.create=e=>new Td({typeName:Te.ZodAny,...Le(e)});class Jl extends Pe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return gr(t.data)}}Jl.create=e=>new Jl({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 Ev 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 gr(t.data)}}Ev.create=e=>new Ev({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=>Xn.mergeArray(r,a));const o=[...n.data].map((a,s)=>i.type._parseSync(new jo(n,a,n.path,s)));return Xn.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 kt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Io.create(Kc(r))}return new kt({...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 kt 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 u=this._getOrReturnCtx(t);return ie(u,{code:J.invalid_type,expected:oe.object,received:u.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 u in i.data)a.includes(u)||s.push(u);const l=[];for(const u of a){const c=o[u],f=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new jo(i,f,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof xa){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of s)l.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(u==="strict")s.length>0&&(ie(i,{code:J.unrecognized_keys,keys:s}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of s){const f=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new jo(i,f,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of l){const f=await c.key,p=await c.value;u.push({key:f,value:p,alwaysSet:c.alwaysSet})}return u}).then(u=>Xn.mergeObjectSync(r,u)):Xn.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return Ae.errToObj,new kt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,a,s;const l=(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:l}:{message:l}}}:{}})}strip(){return new kt({...this._def,unknownKeys:"strip"})}passthrough(){return new kt({...this._def,unknownKeys:"passthrough"})}extend(t){return new kt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new kt({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 kt({...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 kt({...this._def,shape:()=>n})}omit(t){const n={};return Ve.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new kt({...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 kt({...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 kt({...this._def,shape:()=>n})}keyof(){return $Q(Ve.objectKeys(this.shape))}}kt.create=(e,t)=>new kt({shape:()=>e,unknownKeys:"strip",catchall:xa.create(),typeName:Te.ZodObject,...Le(t)});kt.strictCreate=(e,t)=>new kt({shape:()=>e,unknownKeys:"strict",catchall:xa.create(),typeName:Te.ZodObject,...Le(t)});kt.lazycreate=(e,t)=>new kt({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 l of r){const u={...n,common:{...n.common,issues:[]},parent:null},c=l._parseSync({data:n.data,path:n.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const s=a.map(l=>new ii(l));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 VM||e instanceof kh?fa(e.unwrap()):e instanceof $h?fa(e._def.innerType):[];class G1 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 G1({typeName:Te.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Le(r)})}}function Jw(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 l=Jw(e[s],t[s]);if(!l.valid)return{valid:!1};a[s]=l.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],l=Jw(a,s);if(!l.valid)return{valid:!1};i.push(l.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(Yw(o)||Yw(a))return Ee;const s=Jw(o.value,a.value);return s.valid?((Gw(o)||Gw(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 l=this._def.items[s]||this._def.rest;return l?l._parse(new jo(r,a,r.path,s)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>Xn.mergeArray(n,a)):Xn.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?Xn.mergeObjectAsync(n,i):Xn.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 Rv 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,l],u)=>({key:i._parse(new jo(r,s,r.path,[u,"key"])),value:o._parse(new jo(r,l,r.path,[u,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of a){const u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return Ee;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(u.value,c.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const l of a){const u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return Ee;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(u.value,c.value)}return{status:n.value,value:s}}}}Rv.create=(e,t,n)=>new Rv({valueType:t,keyType:e,typeName:Te.ZodMap,...Le(n)});class bu 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(l){const u=new Set;for(const c of l){if(c.status==="aborted")return Ee;c.status==="dirty"&&n.dirty(),u.add(c.value)}return{status:n.value,value:u}}const s=[...r.data.values()].map((l,u)=>o._parse(new jo(r,l,r.path,u)));return r.common.async?Promise.all(s).then(l=>a(l)):a(s)}min(t,n){return new bu({...this._def,minSize:{value:t,message:Ae.toString(n)}})}max(t,n){return new bu({...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)}}bu.create=(e,t)=>new bu({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,l){return xv({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,_v(),xd].filter(u=>!!u),issueData:{code:J.invalid_arguments,argumentsError:l}})}function i(s,l){return xv({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,_v(),xd].filter(u=>!!u),issueData:{code:J.invalid_return_type,returnTypeError:l}})}const o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Id){const s=this;return gr(async function(...l){const u=new ii([]),c=await s._def.args.parseAsync(l,o).catch(h=>{throw u.addIssue(r(l,h)),u}),f=await Reflect.apply(a,this,c);return await s._def.returns._def.type.parseAsync(f,o).catch(h=>{throw u.addIssue(i(f,h)),u})})}else{const s=this;return gr(function(...l){const u=s._def.args.safeParse(l,o);if(!u.success)throw new ii([r(l,u.error)]);const c=Reflect.apply(a,this,u.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(Jl.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(Jl.create()),returns:n||Jl.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 $Q(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(Tv(this,Ip,"f")||TQ(this,Ip,new Set(this._def.values),"f"),!Tv(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 gr(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=$Q;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(Tv(this,Ep,"f")||TQ(this,Ep,new Set(Ve.getValidEnumValues(this._def.values)),"f"),!Tv(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 gr(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 gr(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 l=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return l.status==="aborted"?Ee:l.status==="dirty"||n.value==="dirty"?ed(l.value):l});{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 l=i.refinement(s,o);if(r.common.async)return Promise.resolve(l);if(l 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?gr(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?gr(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 $v 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}}}$v.create=e=>new $v({typeName:Te.ZodNaN,...Le(e)});const Rje=Symbol("zod_brand");class VM 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 kQ(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,l=(a=(o=s.fatal)!==null&&o!==void 0?o:n)!==null&&a!==void 0?a:!0,u=typeof s=="string"?{message:s}:s;i.addIssue({code:"custom",...u,fatal:l})}}):Td.create()}const $je={object:kt.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 kje=(e,t={message:`Input not instance of ${e.name}`})=>kQ(n=>n instanceof e,t),Nl=zi.create,kv=Ws.create,Oje=$v.create,Mje=Ns.create,OQ=bh.create,Fje=yu.create,jje=Iv.create,Lje=Ch.create,Dje=Sh.create,Uje=Td.create,Bje=Jl.create,Pje=xa.create,Wje=Ev.create,MQ=Hi.create,Ov=kt.create,Nje=kt.strictCreate,Kje=wh.create,qje=G1.create,Vje=_h.create,zje=Lo.create,Qje=xh.create,Hje=Rv.create,Yje=bu.create,Gje=rd.create,Jje=Th.create,Zje=Ih.create,Xje=Ks.create,eLe=Eh.create,tLe=Id.create,jL=Xi.create,nLe=Io.create,rLe=qs.create,iLe=Xi.createWithPreprocess,oLe=qm.create,aLe=()=>Nl().optional(),sLe=()=>kv().optional(),lLe=()=>OQ().optional(),uLe={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=>yu.create({...e,coerce:!0})},cLe=Ee;var k=Object.freeze({__proto__:null,defaultErrorMap:xd,setErrorMap:fje,getErrorMap:_v,makeIssue:xv,EMPTY_PATH:pje,addIssueToContext:ie,ParseStatus:Xn,INVALID:Ee,DIRTY:ed,OK:gr,isAborted:Yw,isDirty:Gw,isValid:vh,isAsync:yh,get util(){return Ve},get objectUtil(){return Hw},ZodParsedType:oe,getParsedType:_s,ZodType:Pe,datetimeRegex:RQ,ZodString:zi,ZodNumber:Ws,ZodBigInt:Ns,ZodBoolean:bh,ZodDate:yu,ZodSymbol:Iv,ZodUndefined:Ch,ZodNull:Sh,ZodAny:Td,ZodUnknown:Jl,ZodNever:xa,ZodVoid:Ev,ZodArray:Hi,ZodObject:kt,ZodUnion:wh,ZodDiscriminatedUnion:G1,ZodIntersection:_h,ZodTuple:Lo,ZodRecord:xh,ZodMap:Rv,ZodSet:bu,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:$v,BRAND:Rje,ZodBranded:VM,ZodPipeline:qm,ZodReadonly:kh,custom:kQ,Schema:Pe,ZodSchema:Pe,late:$je,get ZodFirstPartyTypeKind(){return Te},coerce:uLe,any:Uje,array:MQ,bigint:Mje,boolean:OQ,date:Fje,discriminatedUnion:qje,effect:jL,enum:Xje,function:Gje,instanceof:kje,intersection:Vje,lazy:Jje,literal:Zje,map:Hje,nan:Oje,nativeEnum:eLe,never:Pje,null:Dje,nullable:rLe,number:kv,object:Ov,oboolean:lLe,onumber:sLe,optional:nLe,ostring:aLe,pipeline:oLe,preprocess:iLe,promise:tLe,record:Qje,set:Yje,strictObject:Nje,string:Nl,symbol:jje,transformer:jL,tuple:zje,undefined:Lje,union:Kje,unknown:Bje,void:Wje,NEVER:cLe,ZodIssueCode:J,quotelessJson:dje,ZodError:ii});const oa="meta_title",hs="meta_description",dLe=k.object({[oa]:k.string(),[hs]:k.string()});async function FQ(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:dLe,method:"POST",body:r})}const Oh={min:50,max:60},Mh={min:120,max:165};function jQ(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 l=Mv(i);l&&n.push({label:((s=o.config)==null?void 0:s.label)||"",value:l})}}}),n.map(i=>JSON.stringify(i)).join(`
68
+ `)}function Mv(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 LQ(e){return e.length>=300}const fLe=k.object({id:k.string(),label:k.string(),repeatable:k.boolean(),status:k.boolean()});async function pLe(e,t,n){const r=await se.request(new URL("customtypes",e),{headers:{repository:t},credentials:se.getRequestCredentials(n),okType:k.array(fLe)});return _t.sort(r,i=>i.label)}function Vm(e){const{baseUrl:t,repository:n,authStrategy:r}=e;return ui.queryOptions({queryKey:["customTypes"],queryFn:()=>pLe(t,n,r)})}function hLe(e,t){e.prefetchQuery(Vm(t))}function ALe(e,t){return e.fetchQuery(Vm(t))}function zM(e){return ui.useSuspenseQuery(Vm(e))}function mLe(e){const{id:t,baseUrl:n,repository:r,authStrategy:i}=e,a=zM({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 gLe(e,t){return e.invalidateQueries(Vm(t))}function vLe(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:yLe})}const yLe=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 DQ(e){const{id:t}=e;return ui.queryOptions({queryKey:["customTypes","static",t],queryFn:()=>vLe(e)})}function bLe(e){return ui.useSuspenseQuery(DQ(e))}function CLe(e,t){e.prefetchQuery(DQ(t))}const SLe=k.object({id:k.string().optional(),first_name:k.string().optional(),last_name:k.string().optional(),email:k.string().optional(),uploadedAvatar:k.string().optional()}),QM=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}:{}})),UQ=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")})]),BQ=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()}),PQ=UQ.and(BQ.extend({custom_type_label:k.string(),preview_summary:k.string().optional(),author:SLe})),WQ=UQ.and(BQ.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 NQ(e){return PQ.safeParse(e).success}function Zw(e){return WQ.safeParse(e).success}const KQ=k.string().nullish().transform(e=>e??"Untitled"),HM=k.object({id:k.string(),title:KQ,custom_type_id:k.string(),group_lang_id:k.string(),language:QM,versions:k.array(PQ)}),wLe=k.object({total:k.number(),cursor:k.string().optional(),results:k.array(HM)}),_Le=k.object({id:k.string(),title:KQ,custom_type_id:k.string(),group_lang_id:k.string(),interesting_versions:k.array(WQ),locale_id:k.string().optional()}).transform(e=>{const{interesting_versions:t,...n}=e;return{versions:t,...n}}),xLe=k.object({results:k.array(_Le)});function YM(e){const{baseUrl:t,authStrategy:n,limit:r,cursor:i,statuses:o,authors:a,language:s,groupLangIds:l,documentIds:u,customTypes:c,tags:f,term:p,uids:h,signal:m}=e,g=new URL("documents/search",t),y=Pd.filterValues({statuses:o,authors:a,language:s,groupLangIds:l,customTypes:c,tags:f,term:p,documentIds:u,limit:r,cursor:i,uids:h},C=>!(C===""||Array.isArray(C)&&C.length===0));return se.request(g,{credentials:se.getRequestCredentials(n),okType:wLe,signal:m,method:"POST",body:y})}function qQ(e,t,n,r){const i=new URL(e);return i.search=n,se.request(i,{credentials:se.getRequestCredentials(t),okType:xLe,...r})}function VQ(e){const{repository:t,searchTerm:n,tags:r,authors:i,status:o,localeId:a,customTypesIds:s}=e,l=new URLSearchParams;return l.append("repository",t),n&&l.append("searchTerm",n),r!=null&&r.length&&l.append("tags",r.toString()),i!=null&&i.length&&l.append("authors",i.toString()),o!=null&&o.length&&l.append("status",o.toString()),a&&l.append("localeId",a),s!=null&&s.length&&l.append("customTypesIds",s.toString()),l.toString()}function zQ(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:HM})}const TLe=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}),ILe=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 ELe(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 RLe(e){await e.invalidateQueries({queryKey:xo.lists()}),await e.invalidateQueries({queryKey:xo.infiniteLists()})}function GM(e){return ui.useSuspenseQuery(QQ(e))}function QQ(e){return ui.queryOptions({queryKey:xo.list(e),queryFn:({queryKey:[,,t]})=>YM(t)})}async function HQ(e){const{coreApiBaseUrl:t,documentSearchBaseUrl:n,authStrategy:r,repository:i,searchTerm:o="",customTypes:a,tags:s,authors:l,status:u,locale:c,signal:f,storageVersion:p}=e;if(p&&p.major<=6){const C=u!=null&&u.length?u:["published","unclassified","release"];return{results:(await YM({baseUrl:t,authStrategy:r,tags:s,customTypes:a,language:c,term:o,authors:l,statuses:C,limit:200})).results}}const h=VQ({repository:i,searchTerm:o,tags:s,authors:l,status:u,localeId:c,customTypesIds:a});return{results:(await qQ(n,r,h,{signal:f})).results}}function YQ(e){const{searchTerm:t,customTypes:n,tags:r,authors:i,status:o,locale:a,config:s,storageVersion:l}=e;s.searchDocuments||Mt("searchDocuments");const{coreApiBaseUrl:u,documentSearchBaseUrl:c,authStrategy:f,repository:p}=s;return ui.queryOptions({queryKey:["searchDocuments",{coreApiBaseUrl:u,documentSearchBaseUrl:c,authStrategy:f,repository:p,searchTerm:t,customTypes:n,tags:r,authors:i,status:o,locale:a,storageVersion:l}],queryFn:({queryKey:[,h],signal:m})=>HQ({...h,signal:m})})}const $Le=k.object({id:k.string(),firstname:k.string().optional(),lastname:k.string().optional(),email:k.string(),uploadedAvatar:k.string().optional()}),GQ=k.array($Le),kLe=k.object({slicemachineEnabled:k.boolean()}),JQ=["next","nuxt","sveltekit"];function OLe(e){return JQ.includes(e)}const J1=k.preprocess(e=>typeof e=="string"&&OLe(e)?e:"other",k.enum([...JQ,"other"])),MLe=k.object({simulator_url:k.string().url().nullish(),languages:k.array(QM).transform(e=>_t.sort(e,t=>t.label)),authors:GQ.optional().default([]),quotas:kLe.optional().default({slicemachineEnabled:!1}),framework:J1.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&&ZQ(e)?e:void 0;return{...n,framework:t,simulatorUrl:r,isSupportedFramework:t!=="other"}});function Z1(e,t){return se.request(new URL("repository",e),{credentials:se.getRequestCredentials(t),okType:MLe})}function ZQ(e){const t=ri.toURL(e);return t?t.pathname.endsWith("/slice-simulator"):!1}const FLe=k.object({results:k.array(k.string())});function XQ(e,t){return se.request(new URL("repository/tags",e),{credentials:se.getRequestCredentials(t),okType:FLe})}const jLe=k.object({maxNbEnvironments:k.number(),integrationFieldsEnabled:k.boolean(),personalEnvironmentsEnabled:k.boolean(),sliceMachineEnabled:k.boolean()}),eH=k.object({_id:k.string(),name:k.string(),onboarding:k.object({completedSteps:k.array(k.string()),isDismissed:k.boolean()}),framework:J1.optional().default("other"),quotas:jLe.optional().default({maxNbEnvironments:0,integrationFieldsEnabled:!1,personalEnvironmentsEnabled:!1,sliceMachineEnabled:!1}),storageVersion:k.object({major:k.number().int(),minor:k.number().int()}),authors:GQ.optional().default([])});function LLe(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:eH})}const DLe=k.enum(["createPrismicProject","chooseLocale","createProject","setupSliceMachine","createPageType","codePage","createSlice","reviewAndPush","createContent","renderPage"]),tH=k.object({completedSteps:k.array(k.string()),isDismissed:k.boolean(),context:k.object({framework:J1,starterId:k.string().nullable().optional()})}),nH=k.object({completedSteps:k.array(k.string())}),rH=k.object({isDismissed:k.boolean()});function ULe(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:tH})}function BLe(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:nH})}function PLe(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:rH})}const Xw=k.enum(["SuperUser","Owner","Administrator","Manager","Writer","Readonly"]);function WLe(e="Readonly"){return e==="Administrator"||e==="SuperUser"||e==="Owner"}const NLe={SuperUser:"SuperUser",Owner:"Owner",Administrator:"Administrator",Manager:"Publisher",Writer:"Writer",Readonly:"Read-only"};function KLe(e){return NLe[e]}const qLe=k.enum([Xw.enum.Manager,Xw.enum.Writer]),JM=k.record(qLe),ZM=k.record(k.object({rolesPerLocale:JM})),VLe=k.record(k.object({rolesPerLocale:JM,rolesPerUser:ZM})),zLe=k.object({rolesPerUser:k.record(Xw)}),QLe=k.object({rolesPerUser:ZM}),HLe=k.object({rolesPerLocale:JM,rolesPerUser:ZM,rolesPerTeamSpace:VLe}),YLe=k.object({repository:zLe.optional(),locale:QLe.optional(),teamSpace:HLe.optional()});function iH(e){const{baseUrl:t,repository:n,authStrategy:r,scopes:i,userIds:o,localeIds:a,teamSpaceIds:s,fetchEnabled:l}=e;if(!l)return Promise.resolve({});const u=new URL("roles",t);return u.searchParams.append("repository",n),i!=null&&i.length&&u.searchParams.set("scopes",i.join(",")),o!=null&&o.length&&u.searchParams.set("userIds",o.join(",")),a!=null&&a.length&&u.searchParams.set("localeIds",a.join(",")),s!=null&&s.length&&u.searchParams.set("teamSpaceIds",s.join(",")),se.request(u,{method:"GET",credentials:se.getRequestCredentials(r),okType:YLe})}function GLe(e){return ui.queryOptions({queryKey:["roles",e],queryFn:()=>iH(e)})}function JLe(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 X1=k.object({id:k.string(),name:k.string(),customTypes:k.array(k.string())});k.object({name:k.string(),customTypes:k.array(k.string())});const ZLe=k.object({results:k.array(X1)});function oH(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:ZLe})}function XLe(e){return ui.queryOptions({queryKey:["teamSpaces",e],queryFn:()=>oH(e),select:t=>t.results})}function e2e(){const e=ui.useQueryClient();return()=>e.invalidateQueries({queryKey:["teamSpaces"]})}function t2e(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:X1})}function n2e(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:X1})}function r2e(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 aH=k.enum(["SuperUser","Owner","Administrator","Writer","Manager","Readonly"]),i2e=k.record(aH.optional()),o2e=aH.or(i2e),a2e={SuperUser:"SuperUser",Owner:"Owner",Administrator:"Administrator",Manager:"Publisher",Writer:"Writer",Readonly:"Contributor"},sH=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:o2e}))});async function lH(e,t){const n=new URL("profile",e);return await se.request(n,{credentials:se.getRequestCredentials(t),okType:sH})}function XM(){const e=we();e.userServiceBaseUrl||Mt("userServiceBaseUrl");const{authStrategy:t,userServiceBaseUrl:n}=e;return et.useRequest(lH,[n,t])}const s2e="https://prismic.io/docs/guides/manage-images#supported-media";function Qm(){const e=we();e.mediaLibrary||Mt("mediaLibrary");const{assetsApiBaseUrl:t,authStrategy:n,repository:r}=e,{items:i}=et.useRequest(uH,[t,r,n]);return{tags:i}}function uH(e,t,n){return se.request(new URL("tags",e),{credentials:se.getRequestCredentials(n),okType:l2e,headers:{repository:t}})}const cH=1,dH=20,eF=k.string().min(cH).max(dH),tF=k.object({id:k.string(),name:eF,uploader_id:k.string().optional(),created_at:k.number(),last_modified:k.number(),count:k.number().optional().default(0)}),l2e=k.object({items:k.array(tF)});function Hm(e){et.updateFetcherData(uH,t=>{const{items:n}=t,r=e(n);if(r)return{items:r}})}function u2e(e){const{assetType:t,keyword:n,mode:r,tagIds:i}=e,o=we();o.mediaLibrary||Mt("mediaLibrary");const{onAnalyticsEvent:a}=o,s=et.useFetcherData(Wi),l=s[s.length-1],u=I.useRef(l);u.current=l,I.useEffect(()=>{if(!a||!n||!u.current||u.current.keyword!==n)return;const c=String(n.split(" ").length),f=String(u.current.total),p=i.join(",");a("Media Library Search",{searchQuery:n,numberOfWords:c,numberOfResults:f,timeToGetResults:u.current.time,assetType:t,mode:r,tags:p})},[n,t,r,a,i])}function c2e(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 l=i[i.length-1];if(!l)return;const{keyword:u,uploaderId:c,tags:f}=l,p=hH(i,u,t,c,f),h=String(u.split(" ").length),m=String(l.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:u,numberOfWords:h,numberOfResults:m,searchPosition:y,mediaIds:C,timeToAddMediaToPage:_,tags:f})}return a}const yg=k.array(k.string()).optional().transform(e=>e==null?void 0:e[0]),eC=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:yg,alt:yg,notes:yg,credits:yg}).optional(),tags:k.array(tF)}),fH={"X-Prismic-Source":"Wroom"},d2e=k.object({total:k.number(),cursor:k.string().optional(),items:k.array(eC)}),pH=30;function Wi(e,t,n,r,i,o,a,s,l){const u=e?new URL("assets",e):void 0,c=new URLSearchParams(zQ([{name:"limit",values:[`${pH}`]},{name:"cursor",values:[l]},{name:"keyword",values:[r]},{name:"assetType",values:[i]},{name:"uploaderId",values:[o]},{name:"tags",values:a.split(",")}])).toString(),f=d2e.transform(h=>({...h,keyword:r,assetType:i,uploaderId:o,tags:a,page:s})),p=performance.now();return se.request(`${(u==null?void 0:u.href)??""}?${c}`,{headers:{repository:t,...fH},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 f2e(e){const{initialAssetType:t=cr.assetType,mode:n}=e,r=we(),[i,o]=I.useState({...cr,assetType:t,page:0});r.mediaLibrary||Mt("mediaLibrary");const{assetsApiBaseUrl:a,authStrategy:s,repository:l}=r,{page:u,cursor:c,keyword:f,assetType:p,uploaderId:h,tagIds:m}=i,g=et.useRequest(Wi,Fh({assetsApiBaseUrl:a,authStrategy:s,repository:l,keyword:f,assetType:p,uploaderId:h,tagIds:m,page:u,cursor:c}));u2e({assetType:p,keyword:f,tagIds:m,mode:n});const y=m2e(f,p,h,m),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})),Cu((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:m,setFilters:v,resetFilters:S,media:y,mediaTotal:g.total,limit:pH,hasNextPage:C,fetchNextPage:_,updateMedia:p2e,unshiftMedia:b,deleteMedia:h2e,deleteSearchData:A2e,revalidateFirstPage:AH}}function p2e(e){Cu(t=>t.flatMap(n=>{const r=e.find(i=>i.id===n.id);return r?r.response===void 0?[]:{...n,...r.response}:n}))}function h2e(e){Cu(t=>t.filter(n=>!e.includes(n.id)))}function A2e(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 hH(e,t,n,r,i){const o=e.filter(l=>l.keyword===t&&l.assetType===n&&l.uploaderId===r&&l.tags===i),s=_t.sort(o,l=>l.page).flatMap(l=>l.items);return t?_t.uniqBy(s,l=>l.id):s}function m2e(e,t,n,r){const i=et.useFetcherData(Wi);return hH(i,e,t,n,r.join(","))}function Cu(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 AH(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 mH(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),AH({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 gH(){const e=we();e.mediaLibrary||Mt("mediaLibrary");const{assetsApiBaseUrl:t,coreApiBaseUrl:n,authStrategy:r,repository:i}=e,{authors:o}=et.useRequest(Z1,[n,r]),{items:a}=et.useRequest(vH,[t,i,r]),{shortId:s}=XM(),l=new Map(o.map(f=>[f.id,f])),u=[];for(const f of a){if(f.id==="ghost"){u.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=l.get(f.id);if(!p)continue;let h;if(p.uploadedAvatar){const m=new URL(p.uploadedAvatar);m.searchParams.set("w","64"),h=m.toString()}u.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(u.map(f=>[f.id,f]));return{uploaders:_t.sort(u,f=>f.id===s?0:1,f=>f.name),uploadersById:c}}function vH(e,t,n){return se.request(new URL("uploaders",e),{credentials:se.getRequestCredentials(n),okType:v2e,headers:{repository:t}})}const g2e=k.object({id:k.string()}),v2e=k.object({items:k.array(g2e)});function yH(){const e=we();e.mediaLibrary||Mt("mediaLibrary");const{assetsApiBaseUrl:t,authStrategy:n,repository:r}=e;return()=>{et.revalidateData(vH,[t,r,n])}}function y2e(e){const{revalidate:t,config:n,keyword:r,assetType:i,uploaderId:o,tagIds:a}=e,{assetsApiBaseUrl:s=void 0,repository:l="",authStrategy:u="token"}=n.mediaLibrary?n:{},[c,f]=I.useState(!1),[p,h]=I.useState(!1),m={assetsApiBaseUrl:s,repository:l,authStrategy:u,keyword:r,assetType:i,uploaderId:o,tagIds:a,page:0},{revalidateData:g}=et.useCacheRevalidation({fetcher:Wi,requestParams:Fh(m),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({...m,..._}))};I.useEffect(()=>{c&&(h(!1),f(!1))},[c]);function C(){f(!0),t()}return{isMediaRevalidationInProgress:c,isMediaCacheInvalid:p,revalidateMedia:C,revalidateWithParams:y}}function b2e(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(m=>m.id===c.id?{...m,status:"uploading"}:m)),bH({file:c.file,config:a}).then(h=>{p(m=>m.map(g=>g.id===c.id?{...g,status:"success",response:h}:g))}).catch(()=>{p(h=>h.map(m=>m.id===c.id?{...m,status:"error"}:m))})}function l(c){const f=c.map(p=>({id:`temp-${crypto.randomUUID()}`,file:p,status:"idle"}));i(f),t(f)}const u=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:l,onRetry:u}}async function bH(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",...fH},method:"POST",body:a,credentials:se.getRequestCredentials(o),okType:eC})}const CH=I.createContext(void 0);function C2e(e){const{children:t,assetType:n=cr.assetType,onSelectedChange:r,actionContainer:i}=e,o=r?"select":"browse",[a,s]=I.useTransition(),[l,u]=I.useTransition(),c=we(),{showAlert:f}=A.useAlert(),p=XM(),h=yH(),{keyword:m,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}=f2e({initialAssetType:n,mode:o}),[K,H]=I.useState();function z(){mH({config:c,keyword:m,assetType:g,uploaderId:y,tagIds:C})}const{isMediaRevalidationInProgress:N,isMediaCacheInvalid:Y,revalidateMedia:ee,revalidateWithParams:F}=y2e({config:c,revalidate:z,keyword:m,assetType:g,uploaderId:y,tagIds:C});function M(_e){const Ze=_e.keyword===cr.keyword,ht=_e.assetType===n,tt=_e.uploaderId===cr.uploaderId,ut=_e.tagIds.length===cr.tagIds.length&&_e.tagIds.every((Gt,wn)=>Gt===cr.tagIds[wn]);return Ze&&ht&&tt&&ut}function W(_e){const Ze={keyword:m,assetType:g,tagIds:C,uploaderId:y,..._e};M(Ze)?F(_e):$(Ze),u(()=>{_(_e),ae.clearSelection()})}const{isUploading:re,onFilesSelected:Ie,uploadingFiles:Ce,onRetry:P}=b2e({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[ht]=Ze??[];ht&&ae.toggleSelection({id:ht.id,isSingleSelection:!0})},onComplete:_e=>{const Ze=_e.flatMap(ut=>ut.status==="success"?ut:(mt(ut),{id:ut.id,response:void 0}));T(Ze),B({config:c,assetType:g,tagIds:C}),h();const ht=Ze[0];!ht||!ht.response||!ae.isSelected(ht.id)||ae.toggleSelection({id:ht.response.id,isSingleSelection:!0})}}),ae=xl({totalItemCount:O,onChangeSelection:({selectedIds:_e,selectedCount:Ze})=>{if(Yt(!1),!!r){if(Ze===1){const[ht]=[..._e];if(Ce.some(ut=>ut.id===ht&&ut.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=Ar.overflow(_e.file.name,30);f({id:_e.id,title:`The specified file "${Ze}" could not be uploaded.`,subtitle:d.jsxs(A.Text,{color:"inherit",children:["Read more about our"," ",d.jsx(A.Text,{color:"tomato11",href:s2e,underline:!0,children:"supported media"}),"."]}),buttons:{action:{text:"Retry upload",icon:"cloudUpload",onClick:()=>P(_e)}}})}const[on,Yt]=I.useState(!1);return d.jsx(CH.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:m,isSearchingMedia:l,assetType:g,initialAssetType:n,uploaderId:y,tagManagerOpen:on,setTagManagerOpen:Yt,tagIds:C,onFilterChange:W,openMediaSection:K,setOpenMediaSection:H},children:t})}function Et(){const e=I.useContext(CH);if(!e)throw new Error("useMediaLibrary must be used within a MediaLibraryProvider");return e}function S2e(){const e=we(),{initialAssetType:t}=Et(),{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 SH(){return S2e()===0}function w2e(){return SH()?d.jsx(_2e,{}):d.jsx(_H,{})}function wH(e){const{children:t}=e;return d.jsx(A.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:t})}function _H(){return d.jsx(wH,{children:d.jsxs(A.BlankSlate,{children:[d.jsx(A.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),d.jsx(A.BlankSlateTitle,{size:"big",children:"Oops!"}),d.jsx(A.BlankSlateDescription,{width:360,children:"No items found matching your search"})]})})}function _2e(){const{onFilesUpload:e}=Et();return d.jsx(wH,{children:d.jsxs(A.Box,{gap:20,flexDirection:"column",alignItems:"center",children:[d.jsx(A.Box,{maxWidth:375,children:d.jsx(A.BlankSlateTitle,{size:"big",children:"Start by uploading your files!"})}),d.jsx(A.Box,{border:!0,borderStyle:"dashed",borderRadius:4,justifyContent:"center",children:d.jsxs(A.BlankSlate,{sx:{marginBlock:80,marginInline:48},children:[d.jsx(A.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple11",backgroundColor:"purple5",size:"large"}),d.jsx(A.BlankSlateTitle,{children:"Drop your files anywhere to upload or ..."}),d.jsx(A.FileUploadButton,{onFilesSelected:e,renderButton:t=>d.jsx(A.Box,{display:"inline-flex",as:"span",children:d.jsx(A.Button,{onClick:t,color:"grey",children:"Upload media"})})}),d.jsx(A.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 x2e(){const{actionContainer:e,isUploading:t,onFilesUpload:n,assetType:r}=Et();return d.jsx(xH,{actionContainer:e,children:d.jsxs(A.Box,{width:"100%",gap:16,children:[d.jsx(T2e,{}),d.jsx(A.Tooltip,{title:Ed.warning.uploadWhileUploading.title,content:Ed.warning.uploadWhileUploading.description,visible:t,stableMount:!0,children:d.jsx(A.FileUploadButton,{disabled:t,onFilesSelected:n,startIcon:"cloudUpload",color:e?"purple":"grey",size:"large",assetType:r,children:"Upload media"})})]})})}function T2e(){const{keyword:e,onFilterChange:t,isFetchingMedia:n}=Et(),[r,i]=I.useState(e);return ze.useOnChange(e,()=>{e===""&&i("")}),ze.useDebounce(r,300,ze.useStableCallback(o=>t({keyword:o}))),d.jsx(A.Box,{width:"100%",flexDirection:"column",children:d.jsx(A.FormSearchInput,{value:r,placeholder:"Search",onValueChange:i,maxLength:200,isLoading:n&&e!==r})})}function xH(e){const{children:t,actionContainer:n}=e;return n?d.jsx(A.Portal,{container:n,asChild:!0,children:t}):d.jsx(d.Fragment,{children:t})}function I2e(e){const{children:t}=e,{onFilesUpload:n,assetType:r}=Et();return d.jsx(A.FileDropZone,{overlay:d.jsx(E2e,{}),onFilesSelected:n,assetType:r,children:t})}function E2e(){const{isUploading:e}=Et(),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(A.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:d.jsxs(A.BlankSlate,{children:[d.jsx(A.BlankSlateIcon,{name:e?"block":"cloudUpload",lineColor:e?"tomato11":"purple10",backgroundColor:e?"tomato2":"purple3",borderColor:e?"tomato6":"purple6",borderStyle:"dashed",size:"xlarge"}),d.jsx(A.BlankSlateTitle,{size:"big",children:t}),d.jsx(A.BlankSlateDescription,{width:360,children:n})]})})}function TH(){return d.jsx(A.DefaultErrorMessage,{title:"Oops! Something went wrong",description:"An error occurred while searching for your image.",errorImageSrc:A.dialogErrorImage,sx:{marginBlock:"auto",marginInline:"auto"}})}function IH(e){const{mediaList:t,mediaActions:n,mediaToolbar:r,sidePane:i}=e,o=A.useMediaQuery({min:"medium"}),a=i&&o;return d.jsxs(A.Box,{display:"grid",gridTemplateRows:"auto auto 1fr",gridTemplateColumns:a?"1fr 380px":"1fr",width:"100%",height:"100%",children:[d.jsxs(A.Box,{position:"relative",display:"grid",gap:16,gridColumn:"1",gridRow:"1",padding:{right:16,bottom:16},children:[n,r]}),d.jsx(A.Box,{position:"relative",display:"grid",gridColumn:"1",gridRow:"2 / -1",children:t}),a&&i]})}function R2e(){var p;const{onScrollToBottom:e,media:t,isUploading:n,uploadingFiles:r,isSearchingMedia:i,isMediaRevalidationInProgress:o,setOpenMediaSection:a,isFetchingMedia:s}=Et(),l=xl(),u=I.useRef(null);function c(h){l.toggleSelection({id:h,isSingleSelection:!0}),a("tags")}(n||i||o)&&((p=u.current)==null||p.scrollTo({top:0,behavior:"instant"}));function f(h,m,g){const y=m.shiftKey?t.map(({id:C})=>C):void 0;l.toggleSelection({id:h,isSingleSelection:g==="single",metaKey:m.metaKey,shiftKey:m.shiftKey,ids:y})}return d.jsxs(EH,{onScrollToBottom:e,scrollAreaRef:u,children:[t.map(h=>{var m,g;return d.jsx(A.MediaCard,{"aria-label":"media item",...h,filenameHighlight:(m=h.search_highlight)==null?void 0:m.filename,loading:i,status:(g=r.find(y=>y.id===h.id))==null?void 0:g.status,selected:l.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(A.Box,{gridColumn:"1 / -1",justifyContent:"center",children:d.jsx(A.AnimatedElement,{animation:{name:"fade"},children:s&&d.jsx(A.Text,{align:"center",color:"grey11",sx:{marginBlock:8},children:"Loading more items ..."})})})]})}function EH(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(A.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 RH(e){const{children:t,hasSelectedMedia:n}=e;return d.jsx(A.Box,{overflow:"hidden",gridColumn:"2 / -1",gridRow:"1 / -1",children:d.jsx(A.ScrollArea,{style:{display:"grid",height:"100%"},children:d.jsx(A.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 $H(e){const{onFilesUpload:t,isUploading:n,isInitialLoad:r=!1}=e,i=r||n;return d.jsxs(A.Box,{flexDirection:"column",justifyContent:"center",alignItems:"center",padding:16,gap:16,width:"100%",children:[d.jsx(A.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple11",backgroundColor:"purple5",size:"large"}),d.jsx(A.Box,{flexDirection:"column",gap:4,children:d.jsxs(A.Text,{align:"center",children:["Select or"," ",d.jsx(A.FileUploadButton,{disabled:i,onFilesSelected:t,renderButton:o=>d.jsx(A.Tooltip,{title:Ed.warning.uploadWhileUploading.title,content:Ed.warning.uploadWhileUploading.description,visible:n,children:d.jsx(A.Box,{display:"inline-flex",as:"span",children:d.jsx(A.Button,{disabled:i,onClick:o,invisible:!0,children:"upload"})})})})," ","media."]})}),d.jsx(A.FileUploadButton,{disabled:i,onFilesSelected:t,color:"grey",children:"Upload media"})]})}function kH(e){const{count:t}=e;return d.jsxs(A.Text,{variant:"bold",children:[t," item",t==1?"":"s"]})}function $2e(e){const{actionContainer:t}=e;return d.jsx(IH,{sidePane:d.jsx(M2e,{}),mediaActions:d.jsx(O2e,{actionContainer:t}),mediaToolbar:d.jsx(A.Skeleton,{color:"grey5",borderRadius:12,children:d.jsx(kH,{count:888})}),mediaList:d.jsx(k2e,{})})}function k2e(){return d.jsx(EH,{children:_t.range(1,24).map(e=>d.jsx(OH,{},e))})}function O2e(e){const{actionContainer:t}=e;return d.jsx(xH,{actionContainer:t,children:d.jsxs(A.Box,{width:"100%",gap:16,children:[d.jsx(A.Box,{width:"100%",flexDirection:"column",children:d.jsx(A.FormSearchInput,{placeholder:"Search",maxLength:200,value:"",disabled:!0,onValueChange:()=>{}})}),d.jsx(A.FileUploadButton,{disabled:!0,onFilesSelected:()=>{},startIcon:"cloudUpload",color:t?"purple":"grey",size:"large",children:"Upload media"})]})})}function M2e(){return d.jsx(RH,{hasSelectedMedia:!1,children:d.jsx($H,{onFilesUpload:()=>{},isUploading:!1,isInitialLoad:!0})})}function OH(){return d.jsx(A.Card,{variant:"outlined",padding:16,children:d.jsxs(A.CardContent,{gap:0,children:[d.jsx(A.Skeleton,{height:185,width:"100%"}),d.jsx(A.Skeleton,{height:16,width:"100%",sx:{marginTop:12}}),d.jsx(A.Skeleton,{height:10,width:100,sx:{marginTop:8}}),d.jsx(A.Skeleton,{height:1,width:"100%",sx:{marginTop:20,marginBottom:16}}),d.jsxs(A.Box,{flexDirection:"row",gap:8,children:[d.jsx(A.Skeleton,{height:24,width:54}),d.jsx(A.Skeleton,{height:24,width:45}),d.jsx(A.Skeleton,{height:24,width:62})]})]})})}const MH=I.createContext({showToast:()=>{}});function F2e(e){const{children:t}=e,[n,r]=I.useState({title:"",seconds:5}),[i,o]=I.useState(!1),{title:a,action:s,seconds:l=1,icon:u="check"}=n,c=I.useMemo(()=>({showToast:f=>{r({seconds:l,...f}),o(!0)}}),[l]);return d.jsxs(d.Fragment,{children:[d.jsx(j2e,{}),d.jsx(A.Toast,{anchor:d.jsx(A.Box,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),open:i,onOpenChange:o,title:a,action:s,seconds:l,icon:u}),d.jsx(MH.Provider,{value:c,children:t})]})}function FH(){return I.useContext(MH)}function j2e(){const{revalidateMedia:e,isMediaCacheInvalid:t}=Et(),[n,r]=I.useState(t);return ze.useOnChange(t,r),d.jsx(A.Toast,{anchor:d.jsx(A.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}=Et(),t=xl();return e.filter(({id:n})=>t.isSelected(n))}function L2e(){const[e,t]=I.useState(!1),n=Rc(),r=xl(),i=I.useMemo(()=>n.some(({id:a})=>a.startsWith("temp")),[n]),[o]=n;return o?r.selectedCount>1?d.jsxs(A.Box,{gap:8,alignItems:"center",children:[d.jsxs(A.Text,{variant:"emphasized",noWrap:!0,sx:{flexGrow:1},children:[r.selectedCount," media selected"]}),d.jsx(A.Tooltip,{content:"Open all selected media in new tabs",children:d.jsx(A.IconButton,{icon:"openInFull",variant:"solid",size:"small",onClick:()=>n.forEach(a=>window.open(a.url,"_blank"))})}),d.jsx(A.Tooltip,{content:"Remove selected media",children:d.jsx(A.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(A.Box,{gap:8,alignItems:"center",children:[d.jsx(A.Text,{variant:"emphasized",noWrap:!0,sx:{flexGrow:1},children:o.filename}),d.jsxs(A.Box,{gap:8,children:[d.jsx(A.Tooltip,{content:"Open media in new tab",children:d.jsx(A.IconButton,{icon:"openInFull",variant:"solid",size:"small",hiddenLabel:"Open media in new tab",onClick:()=>window.open(o.url,"_blank"),disabled:i})}),d.jsx(A.Tooltip,{content:"Copy media URL",children:d.jsx(A.IconButton,{icon:"link",variant:"solid",size:"small",hiddenLabel:"Copy media URL",onClick:()=>navigator.clipboard.writeText(o.url),disabled:i})}),d.jsx(A.Tooltip,{content:"Remove media",children:d.jsx(A.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}=A.useAlert(),{deleteMedia:a}=Et(),s=xl(),l=yH(),[u,c]=I.useState(!1),f=Array.isArray(r),p=f?"these items":"this item";function h(){c(!0);const g=s.getSelectionState().selectedIds;U2e({ids:g,config:i}).then(()=>{n(!1),a(g),s.clearSelection(),l()}).catch(()=>{n(!1),o({title:"Error",subtitle:`Something went wrong when removing ${p}.`})}).finally(()=>{c(!1)})}return d.jsxs(A.Dialog,{onOpenChange:n,open:t,size:"small",children:[d.jsx(A.DialogHeader,{icon:"alert",title:`Remove ${p} from your media library?`}),d.jsx(A.DialogDescription,{asChild:!0,children:d.jsx(A.DialogContent,{children:d.jsxs(A.Box,{padding:16,flexDirection:"column",children:[d.jsxs(A.Text,{children:["You are about to delete ",p,":  ",!f&&d.jsx("b",{children:r.filename})]}),f&&d.jsx(D2e,{media:r})]})})}),d.jsxs(A.DialogActions,{children:[d.jsx(A.DialogCancelButton,{}),d.jsxs(A.DialogActionButton,{onClick:h,color:"tomato",loading:u,children:["Yes, I want to remove ",p]})]})]})}const $S=15;function D2e(e){const{media:t}=e,n=t.slice(0,$S),r=t.length>$S,i=r?t.length-$S:0,o=Ar.pluralize(i,"item");return d.jsxs(A.UnorderedList,{density:"compact",sx:{marginTop:8},children:[n.map((a,s)=>d.jsx(A.ListItem,{children:d.jsx("b",{children:a.filename})},s)),r&&d.jsxs(A.ListItem,{children:["And ",d.jsx("b",{children:i})," more ",o,"..."]})]})}function U2e(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 e_(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 B2e(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 P2e(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:l})=>r==null?void 0:r[l]);return[i,...o??[]]}function W2e(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 N2e(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 K2e(e,t,n,r,i){if(Y2e(e)==="svg")return e;const o=new URL(e);if(i){const{x:a,y:s,width:l,height:u}=t,c=[...o.searchParams.entries(),["rect",[a,s,l,u].join(",")],["w",n],["h",r]];o.search=c.map(f=>f.join("=")).join("&")}return o.toString()}function nF(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 q2e(e){return nF(e,{width:300})}function jH(e){return nF(e,{width:800,height:800})}function V2e(e){return e!=null&&e.url?jH(e.url):void 0}function z2e(e,t,n,r){var s,l,u,c,f;if(!n||e===fp){const p=(s=t.config)==null?void 0:s.thumbnails,h=p&&Object.fromEntries(p.map(m=>[m.name,Bg(r,m)]));return{__TYPE__:"ImageContent",...Bg(r,(l=t.config)==null?void 0:l.constraint),thumbnails:h}}const i=(c=(u=t.config)==null?void 0:u.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=Bg(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 Q2e(e){return"kind"in e&&"extension"in e}function Bg(e,t){const{width:n,height:r,rect:i}=H2e({...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:K2e(e.url,i,n,r,o),alt:e.alt,...Q2e(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 H2e(e,t){const[n,r]=N2e(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),l=Math.round(r/i);return{width:n,height:r,rect:{x:o,y:a,width:s,height:l}}}function Y2e(e){const{pathname:t}=new URL(e),n=t.lastIndexOf(".");if(n!==-1)return t.substring(n).slice(1).toLowerCase()}function G2e(e){if(!e)return"";const{filename:t,extension:n}=e;return!n||!t.endsWith(`.${n}`)?t:t.slice(0,-n.length-1)}function J2e(){var o;const e=Rc(),{uploadingFiles:t}=Et(),[n]=e;if(!n)return null;if(e.length===2)return d.jsx(kS,{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(kS,{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(A.Box,{flexDirection:"column",children:d.jsx(A.CheckerBoard,{children:d.jsx(kS,{uploadStatus:r,hasImage:i,children:i?d.jsx(A.Image,{src:n.url,alt:n.alt,sizing:"contain"}):d.jsx(A.MediaCardPlaceholder,{kind:n.kind,filename:n.filename})})})})}function kS(e){const{children:t,uploadStatus:n,hasImage:r}=e;return d.jsxs(A.Box,{flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",height:200,width:"100%",backgroundColor:r?"transparent":"purple2",children:[t,n&&d.jsx(Z2e,{uploadStatus:n})]})}function Z2e(e){const{uploadStatus:t}=e,{value:n,color:r,height:i,transition:o}=X2e(t);return d.jsx(A.Box,{position:"absolute",backgroundColor:"greyAlpha1",width:"100%",height:"100%",padding:{inline:16},justifyContent:"end",flexDirection:"column",children:d.jsx(A.ProgressBar,{value:n,color:r,height:i,transition:o})})}function X2e(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(A.Box,{width:111,height:152,children:t.kind==="image"?d.jsx(A.Image,{borderRadius:8,src:nF(t.url,{width:111,height:152}),alt:t.alt,sizing:"cover"}):d.jsx(A.MediaCardPlaceholder,{kind:t.kind,filename:t.filename})})}function eDe(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 LH(e){const{tags:t,toggleAssetTag:n,getTagsLabel:r}=e,{setTagManagerOpen:i}=Et(),{showToast:o}=FH(),{showAlert:a}=A.useAlert(),[s,l]=I.useState("");async function u(c,f){l("");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(A.Box,{flexDirection:"column",children:[d.jsxs(A.Box,{justifyContent:"space-between",children:[d.jsx(A.Text,{color:"grey12",variant:"bold",children:r()}),d.jsx(A.Button,{startIcon:"edit",invisible:!0,color:"dark",onClick:()=>i(!0),children:"Manage tags"})]}),d.jsxs(A.ComboBox,{sx:{marginTop:4,marginBottom:8},children:[d.jsx(tDe,{searchTerm:s,setSearchTerm:l}),d.jsx(A.ComboBoxContent,{children:d.jsx(A.ErrorBoundary,{renderError:()=>d.jsx(A.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting tags"}),children:d.jsx(I.Suspense,{fallback:d.jsx(A.Box,{padding:8,flexDirection:"column",gap:8,children:_t.range(1,6).map(c=>d.jsx(A.Skeleton,{height:24,width:85},c))}),children:d.jsx(nDe,{searchTerm:s,assignedTags:t,onToggleAssetTag:u})})})})]}),d.jsx(A.Box,{flexDirection:"column",alignItems:"flex-start",gap:8,children:t.map(c=>d.jsx(A.Badge,{title:c.name,size:"medium",color:"purple",selected:!0,onClose:()=>u(c,"remove")},c.id))})]})}function tDe(e){const{searchTerm:t,setSearchTerm:n}=e,r=I.useRef(null),{openMediaSection:i,setOpenMediaSection:o}=Et();return I.useEffect(()=>{var a;i==="tags"&&((a=r.current)==null||a.focus(),o(void 0))},[i,o]),d.jsx(A.ComboBoxInput,{value:t,onValueChange:n,placeholder:"Add or create a new tag",ref:r})}function nDe(e){const{searchTerm:t,assignedTags:n,onToggleAssetTag:r}=e,[i]=Rc(),o=we(),{showAlert:a}=A.useAlert(),{tags:s}=Qm(),l=I.useMemo(()=>{const p=t.toLowerCase();return s.filter(h=>h.name.toLowerCase().includes(p))},[s,t]),c=eF.safeParse(t).success&&s.every(p=>p.name!==t);async function f(){if(!t||!i)return;let p;try{p=await rDe({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:[!l.length&&d.jsx(A.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"No tags found"}),l.map((p,h)=>d.jsx(A.ComboBoxItem,{value:p.id,onCheckedChange:m=>r(p,m?"add":"remove"),checked:n.some(m=>m.id===p.id),children:d.jsx(A.Badge,{title:p.name,color:"purple",size:"medium",sx:{marginInline:8,marginBottom:h===l.length-1?8:4,marginTop:h===0?8:4}})},p.id)),c&&d.jsx(A.ComboBoxItem,{value:"new",onCheckedChange:f,children:d.jsxs(A.Box,{padding:8,flexDirection:"row",alignItems:"center",gap:4,children:[d.jsx(A.Icon,{name:"add",size:"small",color:"grey11"}),d.jsxs(A.Text,{color:"grey12",children:['Create tag "',t,'"']})]})})]}):null}function rDe(e){const{name:t,config:n}=e;n.mediaLibrary||Mt("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:tF})}function iDe(e){const{selectedMedia:t}=e,n=we(),r=I.useMemo(()=>eDe(t),[t]);async function i(a,s){const l=s==="remove",u=t.map(f=>f.id);let c=[];Cu(f=>(c=f,f.map(p=>u.includes(p.id)?l?sDe(p,a):aDe(p,a):p)));try{await oDe({tagId:a.id,assetIds:u,operation:l?"remove":"add",config:n});const f=t.length*(l?-1:1);Hm(p=>p.map(h=>h.id===a.id?{...h,count:h.count+f}:h))}catch(f){throw Cu(()=>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(LH,{tags:r,getTagsLabel:o,toggleAssetTag:i})}function oDe(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 aDe(e,t){return e.tags.some(({id:r})=>r===t.id)?e:{...e,tags:[...e.tags,t]}}function sDe(e,t){const n=e.tags.filter(r=>r.id!==t.id);return{...e,tags:n}}function lDe(e){const{selectedMedia:t}=e,n=t.tags,r=we(),{updateMedia:i}=Et();async function o(s,l){const u=t.tags,c=l==="remove",f=c?u.filter(p=>p.id!==s.id):[...u,s];i(t.id,{tags:f});try{await uDe({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:u}),p}}function a(){const s=n.length;return s>1?`${s} tags`:s===1?"1 tag":"Tags"}return d.jsx(LH,{tags:n,getTagsLabel:a,toggleAssetTag:o})}function uDe(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:eC})}function cDe(){const[e,t]=I.useState("description");if(Rc().length!==1)return d.jsx(ADe,{});const r=e==="description",i=e==="more-info";return d.jsxs(d.Fragment,{children:[d.jsxs(A.Box,{display:"grid",gridTemplateColumns:"1fr 1fr",backgroundColor:"grey2",border:!0,borderStyle:"solid",borderRadius:8,children:[d.jsx(A.Tab,{selected:r,outline:r,transparent:!0,onClick:()=>t("description"),children:"Description"}),d.jsx(A.Tab,{selected:i,outline:i,transparent:!0,onClick:()=>t("more-info"),children:"More info"})]}),d.jsx(dDe,{tab:e})]})}function dDe(e){const{tab:t}=e;switch(t){case"description":return d.jsx(fDe,{});case"more-info":return d.jsx(pDe,{})}}function fDe(){const{title:e,alt:t,onBlur:n,isUploading:r,selectedMedia:i}=UH();if(!i)return null;const{extension:o}=i;return d.jsxs(A.Box,{flexDirection:"column",gap:16,children:[d.jsx(A.FormInput,{value:e.value,onValueChange:e.set,label:"Media title",placeholder:"Media title",onBlur:n,disabled:r,suffix:o?`.${o}`:void 0}),d.jsx(A.FormInputField,{label:"Alternative text",children:d.jsx(A.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(lDe,{selectedMedia:i})]})}function pDe(){const{credits:e,notes:t,onBlur:n,isUploading:r,selectedMedia:i}=UH();if(!i)return null;const{uploader_id:o}=i,a=vDe(i);return d.jsxs(A.Box,{gap:8,flexDirection:"column",children:[a.map(s=>d.jsxs(A.Box,{gap:8,children:[d.jsxs(A.Text,{color:"grey11",children:[s.label,":"]}),d.jsx(A.Text,{children:s.value})]},s.label)),d.jsxs(A.Box,{gap:8,children:[d.jsx(A.Text,{color:"grey11",children:"Uploaded by:"}),d.jsx(A.ErrorBoundary,{renderError:()=>d.jsx(A.Text,{color:"grey11",children:"Error getting uploader"}),children:d.jsx(I.Suspense,{fallback:d.jsx(DH,{}),children:d.jsx(hDe,{uploaderId:o})})})]}),d.jsx(A.FormInputField,{label:"Copyright",children:d.jsx(A.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(A.FormInputField,{label:"Private notes",children:d.jsx(A.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 hDe(e){const{uploaderId:t}=e,{uploadersById:n}=gH(),r=n.get(t??"ghost");return t&&!r?d.jsx(DH,{}):r?d.jsxs(d.Fragment,{children:[d.jsx(A.Avatar,{size:24,firstName:r.firstName,lastName:r.lastName,imageUrl:r.uploadedAvatar,hasBorder:!1}),d.jsx(A.Text,{children:r.name})]}):null}function DH(){return d.jsx(A.Skeleton,{width:128})}function ADe(){const e=Rc(),{uploadingFiles:t}=Et(),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(iDe,{selectedMedia:e})})}function UH(){const[e]=Rc(),{updateMedia:t,uploadingFiles:n}=Et(),r=we(),{showToast:i}=FH(),o=(e==null?void 0:e.id)??"",a=bg(e,"alt"),s=bg(e,"notes"),l=bg(e,"credits"),u=bg(e,"filename",G2e),c=n.some(p=>p.id===(e==null?void 0:e.id)&&p.status!=="success");async function f(){if(!e||!u.changed&&!a.changed&&!l.changed&&!s.changed)return;const{extension:p,search_highlight:h}=e,m=p?`${u.value}.${p}`:u.value;t(o,{filename:m,alt:a.value,credits:l.value,notes:s.value,search_highlight:{alt:a.changed||h==null?void 0:h.alt,credits:l.changed||h==null?void 0:h.credits,filename:u.changed||h==null?void 0:h.filename,notes:s.changed||h==null?void 0:h.notes}}),await gDe({id:o,config:r,metadata:{filename:m,alt:a.value,credits:l.value,notes:s.value}}),i({title:"Media metadata has been saved.",seconds:3})}return{selectedMedia:e,onBlur:f,isUploading:c,title:u,alt:a,credits:l,notes:s,extension:e==null?void 0:e.extension}}function bg(e,t,n=r=>r==null?void 0:r[t]){var u;const r=n(e)??"",[i,o]=I.useState(r);ze.useOnChange(e==null?void 0:e.id,()=>o(r));const a=(u=e==null?void 0:e.search_highlight)==null?void 0:u[t],s=!!a;function l(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:mDe(a??i)??"",onChange:l,version:`${(e==null?void 0:e.id)??""}_${s}`,changed:i!==r}}function mDe(e){return e==null?void 0:e.replace(/\n/g,"<br>")}function gDe(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:eC})}function vDe(e){const{width:t,height:n,last_modified:r,size:i,extension:o}=e,a=t&&n,s={label:"Date",value:ix.prettyPrintDate(new Date(r))},l={label:"File size",value:Ar.formatBytes(i)},u=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,l,u,c,f].filter(Qi.isDefined)}function yDe(){const{setTagManagerOpen:e}=Et(),[t,n]=I.useState("");return d.jsxs(A.Box,{gap:20,flexDirection:"column",height:"100%",children:[d.jsxs(A.Box,{alignItems:"center",gap:4,children:[d.jsx(A.IconButton,{icon:"close",size:"small",hasPadding:!1,onClick:()=>e(!1)}),d.jsx(A.Text,{variant:"bold",children:"Tags management"})]}),d.jsxs(A.Box,{gap:16,flexDirection:"column",height:"100%",children:[d.jsx(A.FormSearchInput,{value:t,onValueChange:n,placeholder:"Search for tags",endAdornment:!1,autoFocus:!0}),d.jsx(A.ErrorBoundary,{renderError:()=>d.jsx(wDe,{}),children:d.jsx(I.Suspense,{fallback:d.jsx(TDe,{}),children:d.jsx(bDe,{searchTerm:t})})})]})]})}function bDe(e){const{searchTerm:t}=e,{tags:n}=Qm(),r=n.filter(i=>i.name.toLowerCase().includes(t.toLowerCase()));return r.length===0?d.jsx(A.Text,{color:"grey9",variant:"small",children:"No tags found"}):d.jsx(A.AnimatedList,{ariaLabel:"Tags list",getItemKey:i=>i.id,gap:16,items:r,children:i=>d.jsx(CDe,{tag:i})})}function CDe(e){const{tag:t}=e,[n,r]=I.useState(!1),i=we(),{showAlert:o}=A.useAlert(),{showToast:a}=A.useToast(),{tags:s}=Qm();async function l(u){if(!eF.safeParse(u).success){o({title:"Error",subtitle:`Failed to rename tag "${t.name}" to "${u}". Tag name must be at least ${cH} and at maximum ${dH} characters long.`});return}if(s.some(p=>p.name===u)){o({title:"Error",subtitle:`Failed to rename tag "${t.name}" to "${u}". Tag with name "${u}" already exists.`});return}try{await xDe({id:t.id,name:u,config:i}),Hm(p=>p.map(h=>h.id===t.id?{...h,name:u}:h)),Cu(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:u}:y);return{...h,tags:g}}return h})),a({title:`Tag "${t.name}" renamed to "${u}"`,seconds:3})}catch{o({title:"Error",subtitle:"Something went wrong when renaming the tag."})}}return d.jsxs(d.Fragment,{children:[d.jsxs(A.Box,{justifyContent:"space-between",children:[d.jsx(A.Badge,{title:t.name,color:"purple",size:"medium",onEdit:l}),d.jsx(A.Button,{invisible:!0,color:"tomato",textWeight:"normal",onClick:()=>r(!0),children:"Delete"})]}),d.jsx(SDe,{open:n,onOpenChange:r,tag:t})]})}function SDe(e){const{open:t,onOpenChange:n,tag:r}=e,{id:i,name:o,count:a}=r,s=we(),{showAlert:l}=A.useAlert(),[u,c]=I.useState(!1);async function f(){c(!0);try{await _De({id:i,config:s}),Hm(p=>p.filter(h=>h.id!==i)),Cu(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{l({title:"Error",subtitle:"Something went wrong when removing the tag."})}finally{c(!1),n(!1)}}return d.jsxs(A.Dialog,{onOpenChange:n,open:t,size:"small",children:[d.jsx(A.DialogHeader,{title:`This tag is being used on ${a} media ${Ar.pluralize(a,"item")}`}),d.jsx(A.DialogDescription,{asChild:!0,children:d.jsx(A.DialogContent,{padding:16,children:d.jsxs(A.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 ${Ar.pluralize(a,"item")} and will be deleted from ${Ar.pluralize(a,"it","them")}.`]})})}),d.jsxs(A.DialogActions,{children:[d.jsx(A.DialogCancelButton,{}),d.jsx(A.DialogActionButton,{onClick:f,color:"tomato",loading:u,children:"Yes, I want to delete"})]})]})}function wDe(){const e=I.useContext(et.ErrorBoundaryContext);return d.jsx(A.Box,{flexDirection:"column",children:d.jsxs(A.BlankSlate,{children:[d.jsx(A.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed"}),d.jsx(A.BlankSlateTitle,{size:"big",children:"Oops!"}),d.jsx(A.BlankSlateDescription,{width:360,children:"We couldn't load your media tags."}),d.jsx(A.BlankSlateActions,{children:d.jsx(A.Button,{onClick:e==null?void 0:e.reset,size:"medium",children:"Try again"})})]})})}function _De(e){const{id:t,config:n}=e;n.mediaLibrary||Mt("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 xDe(e){const{id:t,name:n,config:r}=e;r.mediaLibrary||Mt("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 TDe(){return d.jsx(A.Box,{flexDirection:"column",gap:16,children:_t.range(1,6).map(e=>d.jsxs(A.Box,{justifyContent:"space-between",children:[d.jsx(A.Skeleton,{height:24,width:85}),d.jsx(A.Skeleton,{height:24,width:45})]},e))})}function IDe(){const e=Rc(),{onFilesUpload:t,isUploading:n,tagManagerOpen:r}=Et();return e.length===0&&r===!1?d.jsx($H,{onFilesUpload:t,isUploading:n}):d.jsx(A.Box,{flexDirection:"column",backgroundColor:"grey1",width:"100%",padding:16,gap:16,borderRadius:{topLeft:8,topRight:8},children:r?d.jsx(yDe,{}):d.jsxs(d.Fragment,{children:[d.jsx(L2e,{}),d.jsx(J2e,{}),d.jsx(cDe,{})]})})}function EDe(){const e=xl();return d.jsx(RH,{hasSelectedMedia:e.selectedCount!==0,children:d.jsx(IDe,{})})}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"}},RDe=Object.entries(t_);function $De(){const{assetType:e,initialAssetType:t,onFilterChange:n}=Et(),[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:l,name:u}=t_[r],c=t_[t].name,f=t!=="all";return d.jsxs(A.DropdownMenu,{open:o,onOpenChange:a,children:[d.jsx(A.DropdownMenuTrigger,{disabled:f,children:d.jsx(kDe,{icon:l,isDropdownDisabled:f,buttonName:u,tooltipAssetTypeName:c})}),d.jsx(A.DropdownMenuContent,{minWidth:256,align:"start",childrenFocusScope:!0,children:d.jsx(d.Fragment,{children:RDe.filter(([p])=>p!==r).map(([p,{icon:h,name:m}])=>d.jsx(A.DropdownMenuItem,{startIcon:d.jsx(A.Icon,{name:h}),onSelect:()=>s(p),children:m},p))})})]})}const kDe=I.forwardRef(function(t,n){const{icon:r,isDropdownDisabled:i,buttonName:o,tooltipAssetTypeName:a,...s}=t;return d.jsx(A.Tooltip,{content:`You can only pick ${(a==null?void 0:a.toLocaleLowerCase())??"this type of media"}`,visible:i,children:d.jsx(A.Button,{startIcon:r,endIcon:"arrowDropDown",size:"small",color:"grey",disabled:i,ref:n,...s,children:o})})});function ODe(e){const{optimisticTagIds:t,setOptimisticTagIds:n}=e,{onFilterChange:r}=Et(),{tags:i}=Qm(),o=I.useMemo(()=>vX.groupBy(i,s=>s.id),[i]);function a(s){const l=t.filter(u=>u!==s.id);n(l),r({tagIds:l})}return d.jsx(d.Fragment,{children:t.map(s=>{var u;const l=(u=o.get(s))==null?void 0:u[0];return l?d.jsx(A.Badge,{title:l.name,size:"medium",color:"purple",onClose:()=>a(l),selected:!0},l.id):null})})}function MDe(){const{setTagManagerOpen:e,tagIds:t,onFilterChange:n}=Et(),[r,i]=I.useState(""),[o,a]=I.useState(!1),[s,l]=I.useState(t);ze.useOnChange(JSON.stringify(t),()=>{l(t)});function u(p){a(p),p||i("")}function c(p){const h=s.includes(p.id)?t.filter(m=>m!==p.id):[...t,p.id];l(h),n({tagIds:h}),a(!1)}function f(){a(!1),e(!0)}return d.jsxs(d.Fragment,{children:[d.jsxs(A.DropdownMenu,{open:o,onOpenChange:u,children:[d.jsx(A.DropdownMenuTrigger,{children:d.jsx(A.Button,{startIcon:"label",endIcon:"arrowDropDown",size:"small",color:"grey",children:"Tags"})}),d.jsx(A.DropdownMenuContent,{minWidth:256,align:"start",border:!1,childrenFocusScope:!0,children:d.jsxs(A.ComboBox,{variant:"attached",children:[d.jsx(A.ComboBoxInput,{value:r,onValueChange:i,placeholder:"Search for a tag",autoFocus:!0}),d.jsx(A.ComboBoxContent,{paddingBlock:4,children:d.jsx(A.ErrorBoundary,{renderError:()=>d.jsx(A.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting tags"}),children:d.jsx(I.Suspense,{fallback:d.jsx(A.Box,{padding:8,flexDirection:"column",gap:8,children:_t.range(1,6).map(p=>d.jsx(A.Skeleton,{height:24,width:85},p))}),children:d.jsx(FDe,{searchTerm:r,setSearchTerm:i,onTagToggle:c,optimisticTagIds:s})})})}),d.jsx(A.ComboboxAction,{children:d.jsx(A.Button,{invisible:!0,startIcon:"edit",textWeight:"normal",color:"dark",onClick:f,children:"Manage tags"})})]})})]}),s.length>0&&d.jsx(A.ErrorBoundary,{children:d.jsx(I.Suspense,{children:d.jsx(ODe,{optimisticTagIds:s,setOptimisticTagIds:l})})})]})}function FDe(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(A.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(A.ComboBoxItem,{value:a.id,onCheckedChange:()=>t(a),checked:s,children:d.jsx(A.Badge,{title:a.name,color:"purple",sx:{marginLeft:8,marginBottom:4,marginTop:4},size:"medium"})},a.id)})]})}function jDe(){const{uploaderId:e,onFilterChange:t}=Et(),[n,r]=I.useState(""),[i,o]=I.useState(!1),[a,s]=I.useState();ze.useOnChange(e,()=>{e||s(void 0)});function l(c){o(c),c||r("")}function u(c){s(c),t({uploaderId:c==null?void 0:c.id}),o(!1)}return d.jsxs(A.DropdownMenu,{open:i,onOpenChange:l,children:[d.jsx(A.DropdownMenuTrigger,{children:d.jsx(A.Button,{startIcon:"people",renderStartIcon:c=>a?d.jsx(A.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(A.DropdownMenuContent,{minWidth:256,align:"start",border:!1,childrenFocusScope:!0,children:d.jsxs(A.ComboBox,{variant:"attached",children:[d.jsx(A.ComboBoxInput,{value:n,onValueChange:r,placeholder:"Search for uploaders",autoFocus:!0}),d.jsx(A.ComboBoxContent,{paddingBlock:4,children:d.jsx(A.ErrorBoundary,{renderError:()=>d.jsx(A.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting uploaders"}),children:d.jsx(I.Suspense,{fallback:d.jsx(DDe,{}),children:d.jsx(LDe,{searchTerm:n,setSearchTerm:r,onUploaderToggle:u,optimisticUploader:a})})})})]})})]})}function LDe(e){const{searchTerm:t,optimisticUploader:n,onUploaderToggle:r}=e,{uploaders:i}=gH(),o=I.useMemo(()=>{const a=t.toLowerCase();return _t.sort(i.filter(s=>{var l;return s.name.toLowerCase().includes(a)||((l=s.email)==null?void 0:l.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(A.ComboBoxItem,{value:a.id,onCheckedChange:()=>s?r():r(a),checked:s,children:d.jsxs(A.Box,{alignItems:"center",padding:{top:8,bottom:8,left:16,right:16},gap:8,children:[d.jsx(A.Avatar,{firstName:a.firstName,lastName:a.lastName,imageUrl:a.uploadedAvatar,hasBorder:!1}),d.jsxs(A.Box,{display:"flex",flexDirection:"column",children:[d.jsx(A.Text,{color:"grey12",variant:"normal",children:a.name}),a.email&&d.jsx(A.Text,{color:"grey10",variant:"small",children:a.email})]})]})},a.id)})}):d.jsx(A.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"No uploaders found"})}function DDe(){return d.jsx(A.Box,{padding:8,flexDirection:"column",gap:8,children:_t.range(1,4).map(e=>d.jsx(A.Skeleton,{height:48,width:"full"},e))})}function UDe(){const{media:e,mediaTotal:t}=Et(),n=xl();return d.jsxs(A.Box,{alignItems:"center",gap:16,children:[n.isSelectAllEnabled&&d.jsx(A.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(kH,{count:t}),d.jsxs(A.Box,{gap:8,alignItems:"center",children:[d.jsx(A.Text,{children:"Filter:"}),d.jsx($De,{}),d.jsx(jDe,{}),d.jsx(MDe,{})]})]})}function BH(e){const{assetType:t,onSelectedChange:n,actionContainer:r}=e;return d.jsx(A.ErrorBoundary,{renderError:()=>d.jsx(TH,{}),children:d.jsx(I.Suspense,{fallback:d.jsx($2e,{actionContainer:r}),children:d.jsx(_Q,{children:d.jsx(C2e,{assetType:t,actionContainer:r,onSelectedChange:n,children:d.jsx(I2e,{children:d.jsx(BDe,{})})})})})})}function BDe(){const{media:e}=Et(),t=SH();return d.jsx(F2e,{children:d.jsx(IH,{sidePane:t?void 0:d.jsx(EDe,{}),mediaActions:d.jsx(x2e,{}),mediaToolbar:d.jsx(UDe,{}),mediaList:e.length===0?d.jsx(w2e,{}):d.jsx(R2e,{})})})}function PDe(e){const{href:t,tracking:n}=e;return d.jsx(A.Box,{justifyContent:"center",padding:{block:6},children:d.jsxs(A.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(A.Icon,{name:"playCircle",color:"grey11",size:"small",sx:{marginLeft:4}})]})})}function WDe(e){const{step:t,stepIndex:n,isOpen:r,onActionClick:i,onClose:o,contentRef:a}=e,[s,l]=I.useState(!1),[u,c]=I.useState(e.isStepComplete);I.useEffect(()=>{r&&c(e.isStepComplete)},[e.isStepComplete,r]);async function f(){if(r)try{l(!0),await i(u)}finally{l(!1)}}return d.jsxs(A.Dialog,{open:r,onOpenChange:o,size:"small",children:[d.jsx(A.DialogHeader,{title:"Onboarding"}),d.jsxs(A.DialogContent,{children:[d.jsx(A.ScrollArea,{children:d.jsxs(A.Box,{ref:a,as:"article",flexDirection:"column",padding:16,gap:16,children:[d.jsx(A.DialogDescription,{asChild:!0,children:d.jsxs("section",{children:[d.jsxs(A.Text,{sx:{marginBottom:4},color:"purple9",variant:"bold",children:["Step ",n+1]}),d.jsx(A.Text,{variant:"h3",children:t.title}),t.content]})}),t.videoUrl&&d.jsx(A.Video,{src:t.videoUrl,sizing:"contain",borderRadius:4,autoPlay:!0,loop:!0})]})}),d.jsxs(A.DialogActions,{children:[d.jsx(A.DialogCancelButton,{size:"medium",children:"Close"}),!t.defaultCompleted&&d.jsx(A.DialogActionButton,{size:"medium",onClick:f,loading:s,color:u?"darkGrey":"purple",children:u?"Undo step":"Complete step"})]})]})]})}function NDe(e){const{steps:t,completedSteps:n,onToggleStep:r,tracking:i,stepOverrides:o}=e,[a,s]=I.useState(!1),[l,u]=I.useState(t[0]),c=I.useRef(null);if(!l)return null;const f=t.findIndex(({id:y})=>y===l.id);function p(y){return n.includes(y.id)}function h(y){u(y),s(!0),i.track({event:"shared-onboarding:step-opened",stepId:y.id,stepTitle:y.title,source:i.source})}async function m(y=!1){var C;if(l&&(await r(l),!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(WDe,{contentRef:c,isOpen:a,step:l,stepIndex:f,isStepComplete:p(l),onClose:()=>s(!1),onActionClick:m}),d.jsxs(A.DropdownMenu,{children:[d.jsx(A.DropdownMenuTrigger,{children:d.jsx(A.Button,{size:"large",color:"grey",sx:{width:"100%"},renderStartIcon:KDe,children:n.length>0?"Continue":"Start now"})}),d.jsxs(A.DropdownMenuContent,{side:"right",minWidth:256,collisionPadding:8,children:[d.jsx(A.DropdownMenuLabel,{children:d.jsx(A.Text,{variant:"small",color:"grey11",sx:{marginInline:8},children:"Progress"})}),t.map((y,C)=>{const _=p(y);return d.jsx(A.DropdownMenuItem,{onSelect:(o==null?void 0:o[y.id])??(()=>h(y)),description:y.description,completed:_,endAdornment:d.jsx(A.Icon,{name:"chevronRight",size:"small",color:"grey11"}),children:`${C+1} ${y.title}`},y.id)})]})]})]})}function KDe(){return d.jsx(A.Icon,{name:"arrowForward",size:"small",color:"grey11"})}function qDe(e){const{steps:t,completedSteps:n,tutorialLink:r,tracking:i,onToggleStep:o,onClose:a,stepOverrides:s}=e,l=n.length===t.length;return d.jsx(A.Card,{variant:l?"elevated":"animated-light",paddingBlock:16,onClose:a,children:d.jsxs(A.CardContent,{children:[d.jsxs("div",{children:[d.jsx(A.Text,{variant:"bold",children:`Build your first page in ${t.length.toString()} simple steps`}),d.jsx(A.Text,{color:"grey11",variant:"small",children:"Render a live page with content coming from Prismic."})]}),d.jsx(A.ProgressBar,{value:n.length,max:t.length,displayLabel:!0,getValueLabel:(u,c)=>`${u}/${c}`}),d.jsx(NDe,{steps:t,completedSteps:n,onToggleStep:o,tracking:i,stepOverrides:s}),r&&d.jsx(PDe,{href:r,tracking:i})]})})}function VDe(e){const{framework:t,projectName:n,starterId:r,repositoryName:i}=e,{frameworkNameLabel:o,createProjectCodeSnippet:a}=zDe(e),s=[{id:"createPrismicProject",title:"Create your Prismic project",description:"Create and set up your project",defaultCompleted:!0,content:d.jsx(A.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(A.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(A.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(lv,{code:`${a} ${i??"<my-project>"}`,language:"bash"}),d.jsx(A.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(A.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(lv,{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(A.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(A.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(A.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(A.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(A.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(A.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(A.Text,{component:"code",children:"localhost:3000/example-page"}),"). Your content should now be visible!"]})}],l={next:"https://prismic.dev/course/next",nuxt:"https://prismic.dev/course/nuxt",sveltekit:"https://prismic.dev/course/sveltekit"};return{steps:s,defaultCompletedStepIds:s.flatMap(u=>u.defaultCompleted?[u.id]:[]),tutorialLink:t?l[t]:void 0}}function zDe(e){const{framework:t}=e;if(!t||t==="other")return{frameworkNameLabel:"",createProjectCodeSnippet:""};const n=lU[t];return{frameworkNameLabel:n?`${n} `:"",createProjectCodeSnippet:uU[t]}}const OS=3e3,BL=400;function QDe(e){const{onboardingState:t,tracking:n,onToggleStep:r,onToggleGuide:i,fallback:o=null,stepOverrides:a,repositoryName:s,projectName:l}=e,{context:u,isDismissed:c}=t,{steps:f,defaultCompletedStepIds:p,tutorialLink:h}=VDe({...u,repositoryName:s,projectName:l}),m=_(t.completedSteps),g=HDe(y,BL);if(ze.useOnChange(c,()=>!c&&g.reset()),u.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(A.AnimatedElement,{enterDuration:0,exitDuration:BL,children:g.status!=="hidden"&&d.jsxs("div",{ref:g.refs.container,style:{position:"relative"},children:[d.jsx(qDe,{steps:f,completedSteps:m,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 HDe(e,t=400){const n=CX.useConfetti({config:{duration:OS}}),[r,i]=I.useState("visible"),o=I.useRef(!1),a=I.useCallback(()=>{i("animating"),setTimeout(()=>i("hidden"),OS-t),o.current||(setTimeout(e,OS),o.current=!0)},[e,t]),s=()=>{n.throwConfetti(),a()},l=I.useCallback(()=>{i("visible"),o.current=!1},[]);return{refs:{container:n.confettiContainerRef,cannon:n.confettiCannonRef},status:r,start:s,reset:l}}function PH(e){const{type:t,value:n}=e,r=t===oa?Oh.max:Mh.max;return d.jsx(A.Box,{alignItems:"center",children:d.jsx(A.Tooltip,{title:YDe[t],content:ZDe[t],stableMount:!0,children:d.jsx(A.Badge,{title:`${n.length} characters`,size:"medium",color:n.length>r?"tomato":"green",sx:{alignSelf:"center"}})})})}const YDe={[oa]:"Meta title length",[hs]:"Meta description length"},GDe=`${Oh.min}-${Oh.max}`,JDe=`${Mh.min}-${Mh.max}`,ZDe={[oa]:`For optimal mobile SEO, keep your meta title within ${GDe} 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 ${JDe} characters. This helps improve visibility and click-through rates.`};function WH(e){const{title:t,description:n}=e;return d.jsx(A.Card,{paddingBlock:8,paddingInline:8,variant:"highlighted",children:d.jsxs(A.CardContent,{gap:4,children:[d.jsx(A.Text,{color:"indigo11",variant:"h4",noSelect:!0,children:Ar.overflow(t,Oh.max)}),d.jsx(A.Text,{color:"green11",noSelect:!0,children:"https://www.yourdomain.com/"}),d.jsx(A.Text,{variant:"small",color:"grey11",noSelect:!0,children:Ar.overflow(n,Mh.max)})]})})}const NH=I.createContext({editedUID:{current:!1},onEditUID:()=>{}});function KH(e){return Object.values(e.json).some(t=>{var n;return((n=t.uid)==null?void 0:n.type)==="UID"})}function XDe(e){const{content:t,customType:n}=e;return KH(n)&&!t.uid}function qH(e){const{documentId:t,documentsWithUid:n,uid:r}=e;return n.filter(i=>t!==i.id&&tUe({document:i,uid:r})&&eUe({...e,document:i}))}function eUe(e){const{customTypeId:t,languageId:n,document:r}=e,i=t===r.custom_type_id,o=n===r.language.id;return i&&o}function tUe(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 nUe(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 rUe(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 iUe(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 oUe(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 aUe(){return I.useContext(Vs)}function tC(e,t){return`${e}___${t}`}const VH=I.createContext({ids:[],isSelected:()=>!1,update:()=>{}});function nC(){return I.useContext(VH)}function xr(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 rF="...";function sUe(e,t,n=rF){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=rF){var n;return((n=e.config)==null?void 0:n.placeholder)||t}function lUe(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(A.Field,{children:[d.jsx(A.FieldIcon,{name:"biToggle"}),d.jsx(A.FieldLabel,{htmlFor:r,children:xr(n)}),d.jsxs(A.FieldControl,{children:[d.jsx(A.Box,{padding:4,alignItems:"center",children:d.jsx(A.Text,{children:sUe(n,a)})}),d.jsx(A.Switch,{id:r,sx:{alignSelf:"center",marginLeft:"auto",marginRight:12},checked:a,onCheckedChange:l=>{i||o(uUe(l))}})]})]})}function uUe(e){return{__TYPE__:"BooleanContent",value:e}}function cUe(e){const{id:t,field:n,content:r,onContentChange:i}=e;return d.jsxs(A.Field,{children:[d.jsx(A.FieldIcon,{name:"colorLens"}),d.jsx(A.FieldLabel,{id:t,children:xr(n)}),d.jsx(A.FieldControl,{children:d.jsx(A.Box,{padding:{left:4},alignItems:"center",children:d.jsx(A.ColorInput,{onValueChange:o=>i(dUe(o)),value:r==null?void 0:r.value,"aria-labelledby":t,placeholder:$c(n)})})})]})}function dUe(e){return e===void 0?void 0:{__TYPE__:"FieldContent",type:"Color",value:e}}function fUe(e){const{id:t,readOnly:n,field:r,content:i,onContentChange:o}=e,a=i!=null&&i.value?ix.dateFromISOString(i.value):void 0;return d.jsxs(A.Field,{children:[d.jsx(A.FieldIcon,{name:"dateRange"}),d.jsx(A.FieldLabel,{id:t,children:xr(r)}),d.jsx(A.FieldControl,{children:d.jsx(A.Box,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:d.jsx(A.DateInput,{mode:"date","aria-labelledby":t,disabled:n,value:a,onValueChange:s=>o(pUe(s))})})})]})}function pUe(e){if(e)return{__TYPE__:"FieldContent",type:"Date",value:hUe(e)}}function hUe(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 Tl=I.forwardRef(function(t,n){const{padding:r=zH,...i}=t;return d.jsx(A.TextInput,{...i,padding:r,ref:n,sx:{...t.sx,alignSelf:"stretch"}})}),zH={input:{inline:4},adornment:{inline:12}},AUe=({provider:e})=>mUe[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"})})})]}),mUe={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 QH(e){const{debouncedUrl:t,content:n,onContentChange:r,selected:i}=e,o=I.useRef(null),[a,s]=I.useState(!1);ze.useOnChange(t,()=>{var u;a&&(s(!1),(u=o.current)==null||u.reset())});function l(){s(!0),r(void 0)}return ri.toURL(t)?t===(n==null?void 0:n.embed_url)?d.jsx(n_,{content:n,selected:i}):d.jsx(A.ErrorBoundary,{ref:o,renderError:gUe,onError:l,children:d.jsx(I.Suspense,{fallback:n&&d.jsx(n_,{content:n,selected:i}),children:d.jsx(vUe,{url:t,selected:i,onContentChange:r})})}):null}function gUe(){return d.jsxs(A.Box,{backgroundColor:"grey2",borderRadius:6,padding:16,gap:4,children:[d.jsx(A.Icon,{name:"alert",size:"small",color:"grey11"}),d.jsx(A.Text,{variant:"smallBold",color:"grey11",children:"There is no embed data available."})]})}function n_(e){const{content:t,selected:n}=e,{thumbnail:r,provider:i,author:o,url:a,subtitle:s}=SUe(t);return d.jsxs(A.PreviewCard,{selected:n,children:[d.jsx(A.PreviewImage,{src:r.url,aspectRatio:r.aspectRatio}),d.jsxs(A.PreviewContent,{children:[d.jsxs(A.Box,{display:"flex",alignItems:"center",gap:4,children:[d.jsx(AUe,{provider:i}),d.jsx(A.Text,{variant:"smallBold",color:"grey12",noWrap:!0,children:i}),o&&d.jsx(A.Text,{variant:"small",color:"grey11",noWrap:!0,children:o})]}),d.jsx(A.Text,{variant:"smallBold",href:a,children:s})]})]})}function vUe(e){const{url:t,onContentChange:n,selected:r}=e,i=yUe({url:t,onContentChange:n});return d.jsx(n_,{content:i,selected:r})}function yUe(e){const{url:t,onContentChange:n}=e,{embedApiEndpoint:r}=we(),i=et.useRequest(bUe,[t,r]),o=ze.useStableCallback(n);return I.useEffect(()=>{const a=A.handleEditorFlushSyncError(()=>o(i));return()=>{clearTimeout(a)}},[i,o]),i}function bUe(e,t){const n=new URL(t);return n.searchParams.set("url",e),se.request(n,{okType:CUe(e)})}function CUe(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 SUe(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 wUe(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(l){a.set(l),ri.toURL(l)||o(void 0)}return d.jsxs(A.Field,{footer:ri.toURL(a.value)&&d.jsx(A.FieldFooter,{children:d.jsx(QH,{debouncedUrl:a.debouncedValue,content:i,onContentChange:o})}),children:[d.jsx(A.FieldIcon,{name:"cloud"}),d.jsx(A.FieldLabel,{htmlFor:t,children:xr(r)}),d.jsx(A.FieldControl,{children:d.jsx(Tl,{id:t,readOnly:n,placeholder:$c(r),value:a.value,onValueChange:s,variant:ri.toURL(a.value)?"link":"normal",endAdornment:d.jsx(A.Button,{startIcon:"close",color:"grey",size:"small",disabled:!a,onClick:()=>s("")})})})]})}function HH(e){return!(e.lat>85||e.lat<-85||e.lng>180||e.lng<-180)}function MS(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(HH(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 MS(e);const r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return MS(e);const o={lat:r,lng:i};return HH(o)?o:MS(e)}function _Ue(e){const{field:t,id:n,readOnly:r,...i}=e,{onValueChange:o,displayedValue:a,onBlur:s,clearValue:l,isValidCoordinates:u}=xUe(i);return d.jsxs(A.Field,{children:[d.jsx(A.FieldIcon,{name:"place"}),d.jsx(A.FieldLabel,{htmlFor:n,children:xr(t)}),d.jsx(A.FieldControl,{children:d.jsx(Tl,{id:n,onValueChange:o,placeholder:rF,readOnly:r,value:a,onBlur:s,variant:u?"link":"normal",endAdornment:d.jsx(A.Button,{startIcon:"close",color:"grey",size:"small",disabled:!a,onClick:l})})})]})}function xUe(e){const{content:t,onContentChange:n}=e,r=PL(t==null?void 0:t.position),[i,o]=I.useState(r);function a(){const u=WL(i);if(!u)return o(""),n(void 0);const{lat:c,lng:f}=u;o(PL({lat:c,lng:f})),n({__TYPE__:"GeoPointContent",position:{lat:c,lng:f}})}function s(){o(""),n(void 0)}const l=!!WL(i);return{displayedValue:i,isValidCoordinates:l,onValueChange:o,onBlur:a,clearValue:s}}function YH(e){const{fieldLabel:t,imageLabel:n=[]}=e;return d.jsxs(A.CardHeaderTitle,{children:[d.jsx(A.Text,{variant:"bold",noWrap:!0,children:Ar.overflow(t,30)}),n.length!==0&&d.jsx(A.Text,{color:"grey11",noSelect:!0,children:` • ${n.join(" • ")}`})]})}function GH(e){const{fieldLabel:t,isUpdating:n,readOnly:r,onMediaDialogOpenChange:i}=e;return d.jsxs(d.Fragment,{children:[d.jsx(A.CardHeader,{sx:{flexWrap:"wrap"},children:d.jsx(YH,{fieldLabel:t})}),d.jsx(A.CardContent,{children:d.jsx(A.Card,{color:"grey2",variant:"dashed",paddingBlock:12,radius:4,sx:{width:"100%"},children:d.jsx(A.CardContent,{children:d.jsxs(A.BlankSlate,{variant:"horizontal",children:[d.jsx(A.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple9",backgroundColor:"purple4",size:"small"}),d.jsx(A.BlankSlateTitle,{children:n?"Preparing your image...":"You haven't selected an image"}),!r&&d.jsx(A.BlankSlateActions,{children:d.jsx(A.Button,{disabled:n,onClick:()=>i(!0),size:"medium",children:"Select image"})})]})})})})]})}const TUe=Ov({id:Nl(),width:kv(),height:kv(),urls:Ov({full:Nl(),small:Nl().transform(q2e)}),alt_description:Nl().optional(),description:Nl().nullable()}),IUe=Ov({results:MQ(TUe)}).transform(e=>e.results);function JH(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:IUe})}et.cache.registerFetcherConfig(JH,{cacheCapacity:5,revalidationStrategy:{type:"never"}});function EUe(e,t){const n=I.useRef(),r=we(),i=et.useRequest(JH,[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 RUe(e){const{onSelectedChange:t}=e,[n,r]=I.useTransition(),i=ze.useDebounceState({initialState:"",ms:300,startTransition:r});return d.jsxs(A.Box,{flexDirection:"column",gap:16,width:"100%",position:"relative",children:[d.jsx(A.FormSearchInput,{value:i.value,placeholder:"Search on Unsplash.com",onValueChange:i.set}),d.jsx(A.ErrorBoundary,{renderError:()=>d.jsx(TH,{}),children:d.jsx(I.Suspense,{fallback:d.jsx(kUe,{}),children:d.jsx($Ue,{term:i.debouncedValue,loading:n,onSelectedChange:t})})})]})}function $Ue(e){const{term:t,onSelectedChange:n,loading:r}=e,{media:i,toggleSelected:o,selectedImageId:a}=OUe({term:t,onSelectedChange:n});return d.jsxs(d.Fragment,{children:[i.length>0&&d.jsx(ZH,{children:i==null?void 0:i.map(s=>{const u=new URL(s.urls.full).searchParams.get("fm")??"jpg";return d.jsx(A.MediaCard,{url:s.urls.small,filename:s.description??"Unsplash Image",selected:a===s.id,onCardClick:()=>o(s),onCheckedChange:()=>o(s),extension:u,kind:"image",width:s.width,height:s.height,loading:r},s.id)})}),i.length===0&&d.jsx(_H,{})]})}function ZH(e){const{children:t}=e;return d.jsx(A.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 kUe(){return d.jsx(ZH,{children:_t.range(1,24).map(e=>d.jsx(OH,{},e))})}function OUe(e){var u;const{term:t,onSelectedChange:n}=e,{unsplashApiBaseUrl:r}=we(),i=EUe(r,t||"citrus fruit"),o=(u=i==null?void 0:i[0])==null?void 0:u.id,[a,s]=I.useState();I.useEffect(()=>{n==null||n([]),s(void 0)},[o,n]);function l(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:l,selectedImageId:a}}function iF(e){const{open:t,onOpenChange:n,onMediaSelected:r,assetType:i}=e,o=we(),a=o.mediaLibrary,[s,l]=I.useState(()=>a?"media":"unsplash"),[u,c]=I.useState(new Set),[f,p]=I.useState([]),h=u.size+f.length,m=et.useFetcherData(Wi);I.useEffect(()=>{!t||!a||mH({config:o,assetType:i})},[t,o,i,a]);function g(S){if(S!=="media"&&S!=="unsplash")throw new Error(`Invalid option ${S}.`);l(S)}function y(S){S||c(new Set),n(S)}const C=c2e({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=m.flatMap(R=>R.items).filter(R=>u.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}=A.useAlert();return d.jsxs(A.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(A.DialogHeader,{icon:"image",title:"Media library"}),d.jsx(A.DialogDescription,{hidden:!0,children:"Select a media item to add to the page"}),d.jsxs(A.DialogOptions,{value:s,onValueChange:g,padding:"small",width:"auto",children:[a&&d.jsx(A.DialogOptionsItem,{value:"media",icon:"photo"}),d.jsx(A.DialogOptionsItem,{value:"unsplash",icon:"unsplash"})]}),d.jsx(A.DialogContent,{children:d.jsx(A.Box,{flexDirection:"column",flexGrow:1,overflow:"hidden",children:d.jsxs(A.Box,{overflow:"hidden",backgroundColor:"grey2",padding:{top:16,inline:16},flexGrow:1,children:[s==="media"&&d.jsx(BH,{assetType:i,onSelectedChange:c}),s==="unsplash"&&d.jsx(RUe,{onSelectedChange:p})]})})}),d.jsxs(A.DialogActions,{children:[d.jsx(A.DialogCancelButton,{}),d.jsx(A.DialogActionButton,{onClick:_,disabled:h!==1,tooltipLabel:b(),children:"Add to page"})]})]})}const XH=I.forwardRef(function(t,n){const{isMediaDialogOpen:r,selected:i,children:o,onMediaSelected:a,onMediaDialogOpenChange:s}=t;function l(u){a(u),s(!1)}return d.jsxs(A.Card,{ref:n,color:i?"indigo2":"grey2",variant:i?"selected":"dashed",paddingBlock:12,radius:4,children:[o,d.jsx(iF,{open:r,onOpenChange:s,onMediaSelected:l,assetType:"image"})]})});function eY(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(A.FileDropZone,{assetType:"image",maxFiles:1,onFilesSelected:o,overlay:d.jsx(MUe,{isUploading:r}),children:n})}function MUe(e){const{isUploading:t}=e,n=t?"You can't upload while the upload is ongoing":"Drop image to instantly upload";return d.jsx(A.Box,{justifyContent:"center",flexDirection:"column",height:"100%",padding:8,children:d.jsxs(A.BlankSlate,{children:[d.jsx(A.BlankSlateIcon,{name:t?"block":"cloudUpload",lineColor:t?"tomato11":"purple10",backgroundColor:t?"tomato2":"purple3",borderColor:t?"tomato6":"purple6",borderStyle:"dashed",size:"small"}),d.jsx(A.BlankSlateTitle,{size:"regular",children:n})]})})}function tY(e){const{contentView:t,croppedImage:n}=e,{width:r,height:i,x:o,y:a,zoom:s}=n,l=jUe({origin:t.origin,croppedImage:n});return{...t,width:r,height:i,url:l,edit:{...t.edit,zoom:s,crop:{x:o,y:a}}}}function FUe(e){var u,c,f;const{field:t,content:n,thumbnail:r,croppedImage:i}=e;if(r===fp)return nY({content:n,croppedImage:i});const o=fe.isImageContent(n),a=(c=(u=t==null?void 0:t.config)==null?void 0:u.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 l=tY({contentView:s,croppedImage:i});return l.url===s.url?n:{...n,thumbnails:o?{...n.thumbnails,[r]:l}:void 0}}function nY(e){const{content:t,croppedImage:n}=e,r=tY({contentView:t,croppedImage:n});return r.url===t.url?t:{...t,...r}}function jUe(e){const{origin:t,croppedImage:n}=e,{x:r,y:i,width:o,height:a,cropHeight:s,cropWidth:l}=n,u=new URL(t.url),c=t.height!==a||t.width!==o;if(r!==0||i!==0||s!==t.height||l!==t.width){const p=[r,i,l,s].map(Math.round).join(",");u.searchParams.set("rect",p),u.searchParams.set("w",o.toString()),u.searchParams.set("h",a.toString())}return c&&(u.searchParams.set("w",o.toString()),u.searchParams.set("h",a.toString())),u.toString()}function LUe(e){const{edit:{crop:{x:t,y:n},zoom:r},width:i,height:o,origin:{width:a,height:s}}=e;let l,u;const c=a/s,f=i/o;return f>=c?(l=a/r,u=l/f):(u=s/r,l=u*f),{x:t,y:n,width:i,height:o,zoom:r,cropWidth:l,cropHeight:u}}function DUe(e){const{selectedImage:t,imageCrop:n,setImageCrop:r}=e,{width:i,height:o,zoom:a,cropHeight:s,cropWidth:l}=n,u=t.contentView,c={x:n.x,y:n.y,width:l,height:s},[f,p]=I.useState(),h=(u==null?void 0:u.origin.url)??"",m=!(t!=null&&t.thumbnail.height&&(t!=null&&t.thumbnail.width));function g(v,S){const w=parseInt(S);isNaN(w)||w<=0||!m||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(Cg),r({...n,...Cg})}function b(){u&&(p(Cg),r({...n,...Cg,zoom:1,cropWidth:u.width,cropHeight:u.height}))}return d.jsxs(A.Box,{padding:{inline:24,block:16},flexDirection:"column",gap:16,height:"100%",overflowY:"auto",alignItems:"center",children:[d.jsxs(A.Box,{gap:8,height:32,alignItems:"flex-start",width:"100%",children:[d.jsx(A.Tooltip,{content:"Center",children:d.jsx(A.Button,{color:"grey",size:"medium",startIcon:"centerFocusWeak",onClick:_})}),d.jsx(A.Tooltip,{content:"Cover",children:d.jsx(A.Button,{color:"grey",size:"medium",startIcon:"zoomOutMap",onClick:b})}),d.jsx(A.Separator,{orientation:"vertical"}),d.jsx(A.FormInput,{prefix:"W",prefixTooltip:"Width",placeholder:"width",type:"number",size:"medium",value:String(i),onValueChange:v=>g("width",v),sx:{width:100},disabled:!m}),d.jsx(A.FormInput,{prefix:"H",prefixTooltip:"Height",placeholder:"height",type:"number",size:"medium",value:String(o),onValueChange:v=>g("height",v),sx:{width:100},disabled:!m})]}),d.jsx(A.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(A.Box,{width:"100%",maxWidth:320,children:d.jsx(A.Slider,{min:1,max:3,step:.01,value:[a],onValueChange:([v])=>C(v??1)})})]})}const Cg={x:0,y:0};function UUe(e){const{trigger:t,initialImages:n,renderTooltip:r}=e,{open:i,onOpenChange:o,ready:a,option:s,selectedImage:l,croppedImage:u,setCroppedImage:c,setReady:f,setOption:p}=BUe(e);return d.jsxs(A.Dialog,{trigger:t,onAnimationEnd:()=>f(!0),open:i,onOpenChange:o,renderTooltip:r,children:[d.jsx(A.DialogHeader,{icon:"photo",title:"Image editor"}),d.jsx(A.DialogDescription,{hidden:!0,children:"Crop your image to the desired size."}),d.jsx(A.DialogOptions,{value:String(s),onValueChange:h=>p(Number(h)),children:n.map((h,m)=>d.jsx(A.DialogOptionsItem,{value:String(m),icon:"photo",title:h.labels[0]??"Main",subtitle:h.labels[1]??""},h.thumbnail.name))}),l&&d.jsx(A.DialogContent,{children:a&&u&&d.jsx(DUe,{selectedImage:l,imageCrop:u,setImageCrop:c},l.thumbnail.name)})]})}function BUe(e){const{initialImages:t,initialOption:n,onClose:r}=e,[i,o]=I.useState(y),[a,s]=I.useState(!1),[l,u]=I.useState(!1),[c,f]=I.useState(n);function p(C){C?(f(n),o(y())):(u(!1),r({option:c,croppedImages:i})),s(C)}const h=t[c],m=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]=LUe(_.contentView)),C),{})}return{open:a,ready:l,option:c,selectedImage:h,croppedImage:m,setCroppedImage:g,setReady:u,setOption:f,onClose:r,onOpenChange:p}}function PUe(e){const{readOnly:t,altText:n,selected:r,onValueChange:i}=e,o=I.useId();return d.jsxs(A.Field,{selected:r,children:[d.jsx(A.FieldLabel,{htmlFor:o,children:"Alt text"}),d.jsx(A.FieldControl,{children:d.jsx(A.Box,{flexGrow:1,height:40,children:d.jsx(Tl,{id:o,placeholder:"Short description for the visually impaired",readOnly:t,value:n,padding:{input:{inline:12}},onValueChange:i})})})]})}function WUe(e){const{fieldLabel:t,imageLabel:n,initialImages:r,page:i,displaySeparator:o=!0,isSVGContentView:a,visibility:s,onClear:l,onCropperDialogClose:u,onMediaDialogOpenChange:c}=e;return d.jsxs(A.Box,{display:"flex",flexDirection:"column",gap:12,children:[d.jsxs(A.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:4,children:[d.jsx(YH,{fieldLabel:t,imageLabel:n}),d.jsxs(A.CardHeaderActions,{sx:{visibility:s},children:[d.jsx(UUe,{trigger:d.jsx(A.Button,{startIcon:"crop",disabled:a,hiddenLabel:"Crop & Resize"}),renderTooltip:f=>d.jsx(A.Tooltip,{content:"Crop & Resize",children:f}),initialImages:r,initialOption:i,onClose:u}),d.jsx(A.Tooltip,{content:"Replace",children:d.jsx(A.Button,{startIcon:"imageSearch",hiddenLabel:"Replace",onClick:()=>c(!0)})}),d.jsx(A.Tooltip,{content:"Clear",children:d.jsx(A.Button,{onClick:l,startIcon:"delete",hiddenLabel:"Clear"})})]})]}),o&&d.jsx(A.Separator,{style:"dashed",decorative:!0})]})}function Su(e){const{description:t,largeIconName:n="public",loading:r,error:i,onEdit:o,onUnlink:a}=e,s=i?d.jsx(zUe,{}):d.jsx(VUe,{...e,largeIconName:n,loading:r});return d.jsx(A.Card,{sx:{width:420},children:d.jsxs(A.CardContent,{gap:12,children:[d.jsxs(A.Box,{display:"grid",gridTemplateColumns:"max-content 1fr min-content",gridTemplateRows:"1fr",gap:8,children:[s,d.jsxs(A.ButtonGroup,{size:"medium",color:"grey",sx:{justifySelf:"end"},children:[o&&d.jsx(A.Button,{startIcon:"edit",onClick:o}),a&&d.jsx(A.Button,{startIcon:"linkOff",onClick:a})]})]}),!i&&d.jsx(qUe,{description:t,loading:r})]})})}function NUe(e){const{url:t,title:n,loading:r}=e;return r?d.jsx(rY,{height:16,width:80}):n?d.jsx(A.Text,{variant:"smallBold",href:t==null?void 0:t.toString(),children:n}):null}function KUe(e){const{subTitle:t,loading:n}=e;return n?d.jsx(A.Box,{padding:{block:2},children:d.jsx(rY,{height:12,width:60})}):t?d.jsx(A.Text,{variant:"small",color:"grey11",noWrap:!0,children:t}):null}function qUe(e){const{description:t,loading:n}=e;return!t||n?null:d.jsx(A.Text,{variant:"small",color:"grey11",children:t})}function VUe(e){const{largeIconName:t,title:n,url:r,loading:i,subTitle:o}=e;return d.jsxs(d.Fragment,{children:[d.jsx(A.ConjoinedIcons,{largeIconName:t,smallIconName:"link"}),d.jsxs(A.Box,{flexDirection:"column",minWidth:0,children:[d.jsx(NUe,{title:n,url:r,loading:i}),d.jsx(KUe,{subTitle:o,loading:i})]})]})}function zUe(){return d.jsxs(A.Box,{alignItems:"center",gap:8,children:[d.jsx(A.BackgroundIcon,{name:"alert",color:"tomato",size:"small"}),d.jsx(A.Text,{color:"tomato11",children:"Failed to load linked document data"})]})}function rY(e){const{width:t,height:n}=e;return d.jsx(A.Skeleton,{color:"grey5",borderRadius:6,width:t,height:n})}function NL(){const e=we();e.searchDocuments||Mt("searchDocuments");const{coreApiBaseUrl:t,authStrategy:n}=e,r=et.useRequest(Z1,[t,n]);return new Set(r.languages.map(i=>({id:i.id,label:i.label})))}function QUe(){const e=we();e.searchDocuments||Mt("searchDocuments");const{coreApiBaseUrl:t,authStrategy:n}=e,r=et.useRequest(XQ,[t,n]);return new Set(r.results.map(i=>({id:i,label:i})))}function iY(){const e=we();e.searchDocuments||Mt("searchDocuments");const{customTypesApiBaseUrl:t,repository:n,authStrategy:r}=e,i=zM({baseUrl:t,repository:n,authStrategy:r});return new Set(i.data)}function HUe(e){const{documentTypeId:t,documentUrl:n,title:r,statusColor:i,description:o,tags:a,tagsFilter:s,previewImageUrl:l,highlighted:u,highlightedUID:c,searchTerm:f,onSelect:p}=e;function h(m){return m.nativeEvent instanceof MouseEvent&&(m.metaKey||m.ctrlKey)?window.open(n,"_blank"):p()}return d.jsxs(A.Card,{paddingBlock:16,onSelect:h,variant:u?"highlighted":void 0,color:u?"purple2":void 0,sx:{marginBlock:u?4:0,marginInline:4,flexShrink:0},children:[d.jsx(A.CardContent,{children:d.jsxs(A.Box,{justifyContent:"space-between",gap:6,children:[d.jsxs(A.Box,{flexDirection:"column",gap:4,alignItems:"flex-start",flexGrow:1,children:[d.jsx(YUe,{documentTypeId:t}),d.jsx(JUe,{title:r,statusColor:i,searchTerm:f}),c&&f&&d.jsx(tBe,{uid:c,searchTerm:f}),d.jsx(ZUe,{description:o})]}),d.jsx(XUe,{previewImageUrl:l})]})}),a.length>0&&d.jsx(eBe,{tags:a,tagsFilter:s})]})}function YUe(e){const{documentTypeId:t}=e;return d.jsx(A.ErrorBoundary,{renderError:()=>d.jsx(A.Badge,{maxWidth:150,size:"medium",title:"Type: error",icon:"description"}),children:d.jsx(I.Suspense,{fallback:d.jsx(A.Skeleton,{width:150,height:24}),children:d.jsx(GUe,{documentTypeId:t})})})}function GUe(e){const{documentTypeId:t}=e,r=[...iY()].find(i=>i.id===t);return d.jsx(A.Badge,{size:"medium",title:`Type: ${(r==null?void 0:r.label)??"Unknown"}`,icon:"description"})}function JUe(e){const{title:t,statusColor:n,searchTerm:r}=e;return d.jsxs(A.Box,{gap:8,alignItems:"center",children:[d.jsx(A.Dot,{color:n}),d.jsx(oY,{text:t,highlight:r})]})}function ZUe(e){const{description:t}=e,n=t==null?void 0:t.substring(0,150);return n?d.jsx(A.Text,{variant:"small",color:"grey11",children:`${n}${n!==t?"...":""}`}):d.jsx(A.Text,{variant:"smallItalic",color:"grey11",children:"No description available"})}function XUe(e){const{previewImageUrl:t}=e;return d.jsx(A.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(A.Image,{src:t,sizing:"cover"}):d.jsxs(d.Fragment,{children:[d.jsx(A.Icon,{name:"hideImage",size:"large",color:"grey11"}),d.jsx(A.Text,{color:"grey11",variant:"small",children:"No preview available"})]})})}function eBe(e){const{tags:t}=e;return d.jsxs(A.CardFooter,{children:[d.jsxs(A.Box,{gap:4,alignItems:"center",children:[d.jsx(A.Icon,{name:"label",size:"small",color:"grey11"}),d.jsx(A.Text,{variant:"small",color:"grey11",children:"Tags:"})]}),d.jsx(A.TextOverflow,{children:t.map(n=>d.jsx(A.Badge,{size:"medium",title:n,sx:{marginRight:8}},n))})]})}function tBe(e){const{uid:t,searchTerm:n}=e;return d.jsxs(A.Box,{alignItems:"flex-start",children:[d.jsx(A.Icon,{name:"tag",color:"green11",sx:{width:12,height:12}}),d.jsx(oY,{variant:"uid",highlight:n,text:t})]})}function oY(e){const{text:t,highlight:n,variant:r="title"}=e,i=nBe[r],o=n?t.split(new RegExp(`(${Ar.escapeStringRegexp(n)})`,"gi")):[t];return d.jsx(A.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(A.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 nBe={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 rBe(e){const{searchTerm:t,tagsFilter:n,typesFilter:r,localesFilter:i}=e,o=we();o.searchDocuments||Mt("searchDocuments");const{storageVersion:a}=et.useRequest(Z1,[o.coreApiBaseUrl,o.authStrategy]);o.searchDocuments||Mt("searchDocuments");const{status:s}=o,{data:l}=ui.useSuspenseQuery({...YQ({searchTerm:t,tags:[...ti.map(n,u=>u.id)],customTypes:[...ti.map(r,u=>u.id)],locale:[...ti.map(i,u=>u.id)][0]??"",status:Qw[s],storageVersion:a,config:o}),select:u=>iBe(u.results,Qw[s]),staleTime:300});return{documents:l.results}}function iBe(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 oBe(e,t){const n=we(),r=ze.useDebounceState({initialState:""}),[i,o]=I.useState(new Set),[a,s]=I.useState(new Set);function l(){return!n.searchDocuments||!n.localeId?new Set:new Set([{id:n.localeId,label:n.localeId}])}const[u,c]=I.useState(l),f=ti.union(a,Fv(e)),p=ti.union(i,Fv(t));return{searchTerm:r,filteredTags:i,setFilteredTags:o,filteredCustomTypes:a,setFilteredCustomTypes:s,filteredLocales:u,setFilteredLocales:c,typesFilter:f,tagsFilter:p}}function Fv(e){return e?ti.map(e,t=>({id:t,label:t})):new Set}function aBe(e){const{filteredLocales:t,setFilteredLocales:n,filteredTags:r,setFilteredTags:i,filteredCustomTypes:o,setFilteredCustomTypes:a,fixedTags:s,fixedCustomTypes:l}=e;return d.jsxs(d.Fragment,{children:[d.jsx(lBe,{selectedValues:t,onSelectedValuesChange:n}),d.jsx(r_,{selectedValues:r,fixedSelectedValues:Fv(s),onSelectedValuesChange:i,label:"Tags",icon:"label",fetchFilters:QUe}),d.jsx(r_,{selectedValues:o,fixedSelectedValues:Fv(l),onSelectedValuesChange:a,label:"Type",icon:"description",fetchFilters:iY})]})}function r_(e){const[t,n]=I.useState(!1),r=I.useRef(null);return d.jsx(A.ErrorBoundary,{ref:r,renderError:()=>{var i;return d.jsx(A.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(A.FilterField,{mode:"loading",open:t,setOpen:n,values:new Set,...e}),children:d.jsx(sBe,{open:t,setOpen:n,...e})})})}function sBe(e){const{open:t,setOpen:n,onSelectedValuesChange:r,fixedSelectedValues:i,selectedValues:o,label:a,icon:s,fetchFilters:l,multiple:u}=e,c=l();return d.jsx(A.FilterField,{open:t,setOpen:n,label:a,icon:s,selectedValues:o,values:new Set(c),fixedSelectedValues:i,onSelectedValuesChange:r,multiple:u})}function lBe(e){const{selectedValues:t,onSelectedValuesChange:n}=e,[r,i]=I.useState(ti.first(t));function o(s){n(s),i(ti.first(s))}const a=ti.find(NL(),s=>{var l;return s.id===((l=ti.first(t))==null?void 0:l.id)});return(a==null?void 0:a.label)!==(r==null?void 0:r.label)&&i(a),d.jsx(r_,{selectedValues:new Set(r?[r]:[]),onSelectedValuesChange:o,label:"Locale",icon:"public",fetchFilters:NL,multiple:!1})}function aY(e){const{onSelectDocument:t,fixedCustomTypes:n,fixedTags:r,linkedDocumentId:i,...o}=e,a=we(),{searchTerm:s,filteredTags:l,setFilteredTags:u,filteredCustomTypes:c,setFilteredCustomTypes:f,filteredLocales:p,setFilteredLocales:h,typesFilter:m,tagsFilter:g}=oBe(n,r);return d.jsxs(A.Dialog,{size:{height:727,width:656},hasClose:!1,...o,children:[d.jsx(A.DialogTitle,{hidden:!0,children:"Link to a page"}),d.jsx(A.DialogDescription,{hidden:!0,children:"Search and select a page to link to"}),d.jsx(A.DialogContent,{children:d.jsxs(A.Box,{flexDirection:"column",height:"100%",children:[d.jsxs(A.Box,{padding:{top:16,inline:16,bottom:8},flexDirection:"column",gap:12,children:[d.jsx(A.FormInput,{value:s.value,onValueChange:s.set,placeholder:"Search a page",icon:"search"}),a.searchDocuments&&d.jsx(aBe,{filteredTags:l,setFilteredTags:u,filteredCustomTypes:c,setFilteredCustomTypes:f,filteredLocales:p,setFilteredLocales:h,fixedTags:r,fixedCustomTypes:n})]}),a.searchDocuments?d.jsx(uBe,{searchTerm:s.debouncedValue,tagsFilter:g,typesFilter:m,localesFilter:p,onSelectDocument:t,linkedDocumentId:i}):d.jsx(lY,{title:"Oops!",message:"Slice Machine does not yet support mock data for linked documents in the simulator."})]})})]})}function uBe(e){const{searchTerm:t,tagsFilter:n,typesFilter:r,localesFilter:i,linkedDocumentId:o,onSelectDocument:a}=e;return d.jsxs(A.ScrollArea,{style:{flexGrow:1,paddingBottom:A.theme.space[16],paddingInline:A.theme.space[12],display:"flex",flexDirection:"column"},children:[o&&d.jsxs(d.Fragment,{children:[d.jsx(qL,{children:"Linked page"}),d.jsx(A.ErrorBoundary,{renderError:()=>d.jsx(KL,{description:"An error occurred while fetching the linked page."}),children:d.jsx(I.Suspense,{fallback:ABe,children:d.jsx(fBe,{linkedDocumentId:o,tagsFilter:n,onSelectDocument:a})})})]}),d.jsx(qL,{children:"Link to a page"}),d.jsx(A.ErrorBoundary,{renderError:()=>d.jsx(KL,{description:"An error occurred while fetching pages."}),children:d.jsx(I.Suspense,{fallback:dBe,children:d.jsx(cBe,{searchTerm:t,tagsFilter:n,localesFilter:i,typesFilter:r,linkedDocumentId:o,onSelectDocument:a})})})]})}function cBe(e){const{searchTerm:t,tagsFilter:n,localesFilter:r,typesFilter:i,linkedDocumentId:o,onSelectDocument:a}=e,{documents:s}=rBe({searchTerm:t,tagsFilter:n,localesFilter:r,typesFilter:i}),l=s.filter(u=>u.id!==o);return l.length===0?d.jsx(lY,{title:s.length===1?"No other pages found!":void 0}):d.jsx(A.Box,{flexDirection:"column",gap:12,children:l.map(u=>{const c=u==null?void 0:u.versions[0];return c?d.jsx(sY,{document:u,version:c,tagsFilter:n,searchTerm:t,onSelectDocument:a},`${u.id}-${c.status}`):null})})}const dBe=d.jsx(A.Box,{flexDirection:"column",gap:12,children:_t.range(1,3).map(e=>d.jsx(A.Skeleton,{height:124,sx:{marginInline:4},zIndex:-1},e))});function KL(e){const{description:t}=e;return d.jsx(A.Box,{flexDirection:"column",alignItems:"center",justifyContent:"center",children:d.jsx(A.DefaultErrorMessage,{title:"Request failed",description:t,errorImageSrc:A.dialogErrorImage})})}function fBe(e){const{linkedDocumentId:t,tagsFilter:n,onSelectDocument:r}=e,i=mBe(t),o=pBe(i);return d.jsx(sY,{document:i,version:o,tagsFilter:n,onSelectDocument:r,highlighted:!0})}function pBe(e){return I.useMemo(()=>hBe(e),[e])}function hBe(e){return _t.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 ABe=d.jsx(A.Skeleton,{height:124,sx:{marginBlock:4,marginInline:4},zIndex:-1});function mBe(e){const t=we();t.searchDocuments||Mt("searchDocuments");const{coreApiBaseUrl:n,authStrategy:r}=t;return et.useRequest(zm,[n,r,e])}function sY(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 l=qM({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}),u=gBe({tags:n.tags,tagsFilter:r}),c=Zw(n)&&n.summary||NQ(n)&&n.preview_summary||"",f=Zw(n)?(p=n.highlights)==null?void 0:p.uid:void 0;return d.jsx(HUe,{documentTypeId:t.custom_type_id,documentUrl:l,description:c,tags:u,title:t.title,previewImageUrl:n.preview_image,onSelect:()=>o(t.id),statusColor:SQ[n.status].color,highlighted:i,highlightedUID:f,searchTerm:a})}function qL(e){const{children:t}=e;return d.jsx(A.Box,{position:"sticky",top:0,backgroundColor:"white",padding:{block:6,inline:4},children:d.jsx(A.Text,{variant:"smallBold",color:"grey11",children:t})})}function lY(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(A.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:d.jsxs(A.BlankSlate,{children:[d.jsx(A.BlankSlateIcon,{name:"close",lineColor:"tomato11",backgroundColor:"tomato4",size:48}),d.jsx(A.BlankSlateTitle,{size:"big",children:t}),d.jsx(A.BlankSlateDescription,{width:360,children:n})]})})}function gBe(e){const{tags:t,tagsFilter:n}=e,r=[...n].map(o=>o.label).reverse();return _t.sort(t,o=>-r.indexOf(o))}function uY(e){const{hasLink:t,onUnlink:n,selectEnabled:r,selectedType:i,value:o,onOpenLinkModal:a,onValueChange:s,openInNewTab:l=!0,condensedButtons:u=!1,showNewTabButton:c=!1,displayTextEnabled:f,variants:p,variant:h,onVariantChange:m}=e;return d.jsxs(d.Fragment,{children:[!f&&c&&l&&d.jsx(A.Badge,{title:"Open in a new tab",color:"indigo",size:"small",icon:"openInNew",onClick:a}),!t&&r&&d.jsxs(A.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:u?"":Dc("any"),onlyStartIcon:u&&i!==void 0,renderTrigger:({button:g})=>d.jsx(A.Tooltip,{content:Dc(i),visible:u,children:g}),children:[d.jsx(A.SelectItem,{value:"web",icon:"public",children:Dc("web")}),d.jsx(A.SelectItem,{value:"document",icon:"description",children:Dc("document")}),d.jsx(A.SelectItem,{value:"media",icon:"image",children:Dc("media")})]},i===void 0?"unlinked":"linked"),!t&&!r&&d.jsx(A.Button,{startIcon:id({selectType:i}),color:"grey",textColor:"link",textWeight:"normal",size:"small",onClick:a,children:Dc(i)}),t&&!f&&d.jsx(A.Button,{startIcon:"close",color:"grey",size:"small",onClick:n,"aria-label":"Close"}),t&&f&&d.jsxs(A.ButtonGroup,{density:"compact",children:[d.jsx(A.Button,{startIcon:id({selectType:i}),renderEndIcon:()=>l&&i==="web"?d.jsx(A.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(A.Button,{startIcon:"close",color:"grey",size:"small",onClick:n})]}),p.length>1&&d.jsx(A.Select,{value:h,color:"grey",size:"small",boldTriggerText:!0,position:"popper",sideOffset:4,startIcon:"colorLens",onValueChange:m,children:p.map((g,y)=>d.jsx(A.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 cY(e){const{onEdit:t,onUnlink:n,url:r,title:i,subTitle:o}=e,[a,s]=I.useState(null);return d.jsx(A.Card,{paddingBlock:16,ref:s,children:d.jsxs(A.CardContent,{children:[d.jsx(yBe,{url:r,title:i,subTitle:o,onEdit:t,onUnlink:n,container:a}),r&&d.jsx(A.CheckerBoard,{children:d.jsx(vBe,{children:d.jsx(A.Image,{src:r,alt:i,sizing:"contain"})})})]})})}function vBe(e){const{children:t}=e;return d.jsx(A.Box,{flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",height:327,children:t})}function yBe(e){const{url:t,title:n,subTitle:r,onEdit:i,onUnlink:o,container:a}=e;return d.jsxs(A.Box,{flexDirection:"row",justifyContent:"space-between",gap:8,children:[d.jsxs(A.Box,{gap:8,minWidth:0,children:[d.jsx(A.ConjoinedIcons,{largeIconName:"image",smallIconName:"link"}),d.jsxs(A.Box,{flexDirection:"column",minWidth:0,children:[d.jsx(A.Text,{noWrap:!0,variant:"smallBold",href:t,inline:!0,children:n}),d.jsx(A.Text,{variant:"small",color:"grey11",children:r})]})]}),d.jsxs(A.ButtonGroup,{size:"medium",color:"grey",children:[i&&d.jsx(A.Tooltip,{content:"Edit link",side:"top",container:a,children:d.jsx(A.Button,{startIcon:"edit",onClick:i})}),o&&d.jsx(A.Tooltip,{content:"Remove link",side:"top",container:a,children:d.jsx(A.Button,{startIcon:"linkOff",onClick:o})})]})]})}function bBe(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)??[],u=(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,m]=I.useState(!1),g=I.useRef(null);ze.useOnChange(i,$);const y=c?CBe[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:u});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},...u&&{variant:u}}});case"DocumentLink":return r({__TYPE__:"LinkContent",key:Uc(n),value:{__TYPE__:"DocumentLink",id:N,...a&&{text:a},...u&&{variant:u}}});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=wBe();function E(N){f(N?VL[N]:void 0),v(""),N&&N!=="any"&&T(N)}function R(N){v(N)}function O(){m(!0)}function $(){var N;h&&(m(!1),(N=g.current)==null||N.reset())}function B(N){const Y=dY({media:N});switch(Y.value.__TYPE__){case"ImageLink":return r({__TYPE__:Y.__TYPE__,key:Y.key,value:{...Y.value,...a&&{text:a},...u&&{variant:u}}});case"FileLink":return r({__TYPE__:Y.__TYPE__,key:Y.key,value:{...Y.value,...a&&{text:a},...u&&{variant:u}}})}}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:u,onVariantChange:w}}function Uc(e){return e?e.key:crypto.randomUUID()}const CBe={AnyLink:"any",DocumentLink:"document",ExternalLink:"web",FileLink:"media",ImageLink:"media",MediaLink:"media"},VL={any:"AnyLink",document:"DocumentLink",web:"ExternalLink",media:"FileLink"};function SBe(e){const t=we();t.searchDocuments||Mt("searchDocuments");const{coreApiBaseUrl:n,authStrategy:r}=t;return et.useRequest(zm,[n,r,e]).title}et.cache.registerFetcherConfig(zm,{concurrency:50});function dY(e){var i,o,a,s,l,u;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:((l=t.height)==null?void 0:l.toString())??`${Es}`,width:((u=t.width)==null?void 0:u.toString())??`${Es}`}}}const wBe=()=>{const e=aUe(),{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 _Be(e){const{open:t,onOpenChange:n,showNewTabButton:r}=e,{url:i,setUrl:o,openInNewTab:a,setOpenInNewTab:s,disabled:l,onUpdate:u}=xBe(e);return d.jsxs(A.Dialog,{open:t,onOpenChange:n,size:"small",noDescription:!0,children:[d.jsx(A.DialogHeader,{title:"Set Link URL"}),d.jsxs(A.DialogContent,{padding:16,children:[d.jsx(A.FormInput,{value:i,onValueChange:o,placeholder:"Paste URL",icon:"public"}),r&&d.jsx(A.InlineLabel,{value:"Open in a new tab",children:d.jsx(A.Checkbox,{checked:a,onCheckedChange:s})})]}),d.jsxs(A.DialogActions,{children:[d.jsx(A.DialogCancelButton,{}),d.jsx(A.DialogActionButton,{onClick:u,disabled:l,children:"Update"})]})]})}function xBe(e){const{url:t,openInNewTab:n,onUpdate:r,open:i}=e,[o,a]=I.useState(t),[s,l]=I.useState(n);ze.useOnChange(i,()=>{i&&(a(t),l(n))});const u=!o||o===t&&s===n;function c(){r(o,{newTab:s})}return{url:o,setUrl:a,openInNewTab:s,disabled:u,setOpenInNewTab:l,onUpdate:c}}function oF(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}),[l,u]=I.useState(),{contentType:c,fieldValue:f,errorBoundaryRef:p,onDocumentSelected:h,onError:m,onMediaSelected:g,onValueChange:y,selectType:C,onTypeChange:_,isTypeSelectEnabled:b,displayTextEnabled:v,...S}=bBe({content:t,field:n,onContentChange:i}),w=c==="DocumentLink"&&f!=="",E=c==="ExternalLink"&&ri.toURL(f),R=!!((Y=n.config)!=null&&Y.allowTargetBlank);function O(){switch(c){case"DocumentLink":return u("document");case"ExternalLink":return u("web");case"FileLink":case"ImageLink":case"MediaLink":return u("media");default:return u(void 0)}}const $={...S,id:r,onFocus:()=>s.set(!0),onBlur:()=>s.set(!1),onOpenLinkModal:O,onUnlink:()=>{b?_(void 0):y("")},onSelectValueChange:W=>{_(W),u(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),u(void 0)}function H(W,re){y(W,re),u(void 0)}function z(W){g(W),u(void 0)}function N(W){h(W),u(void 0)}return d.jsxs(d.Fragment,{children:[d.jsxs(A.Popover,{align:"start",sideOffset:-3,focusOnEnter:!1,open:s.debouncedValue,anchor:d.jsxs(A.Field,{variant:TBe(o),color:a,children:[w?d.jsx(RBe,{documentId:f,displayTextEnabled:v}):d.jsx(A.FieldIcon,{name:id({selectType:C,displayTextEnabled:v})}),o!=="compact"&&d.jsx(A.FieldLabel,{htmlFor:r,children:xr(n)}),d.jsx(A.FieldControl,{children:w&&B?d.jsx(kBe,{errorBoundaryRef:p,onError:m,fallback:d.jsx(i_,{...$,value:"..."}),renderError:()=>IBe($),children:d.jsx(EBe,{...$,documentId:f})}):d.jsx(i_,{...$})})]}),children:[E&&d.jsx(Su,{url:E,title:ri.getUrlTitle(E)??"",subTitle:E.toString()}),t&&fe.FilledImageLinkContent.is(t.value)&&d.jsx(cY,{url:t.value.url,title:t.value.name,subTitle:`${t.value.width} x ${t.value.height} pixels`})]}),d.jsx(_Be,{open:l==="web",onOpenChange:K,onUpdate:H,url:f,openInNewTab:S.isTargetNewTab,showNewTabButton:!!((ee=n.config)!=null&&ee.allowTargetBlank)}),d.jsx(iF,{open:l==="media",onOpenChange:K,onMediaSelected:z,assetType:"all"}),d.jsx(aY,{open:l==="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 TBe(e){switch(e){case"compact":return"compact";case"normal":return"normal";default:return}}function IBe(e){return d.jsx(i_,{...e})}function i_(e){const{id:t,value:n,onOpenLinkModal:r,onBlur:i,isTypeSelectEnabled:o,selectType:a,onSelectValueChange:s,onUnlink:l,isTargetNewTab:u,allowTargetBlank:c,displayTextEnabled:f,displayText:p,onFocus:h,onClick:m,onKeyDown:g,appearance:y,placeholder:C,variants:_,variant:b,onVariantChange:v,onDisplayTextChange:S,onValueChange:w}=e;return d.jsx(A.Box,{padding:{block:4},width:"100%",children:d.jsx(Tl,{id:t,textOverflow:"ellipsis",variant:f?"normal":"link",readOnly:!f,placeholder:f?"Add your display text":C,padding:fY(y),value:f?p:n,cursor:pY({value:n,displayTextEnabled:f,isTypeSelectEnabled:o}),onBlur:i,onFocus:h,onClick:m,onKeyDown:g,onValueChange:f?S:w,endAdornment:d.jsx(uY,{hasLink:!!(n&&a),onUnlink:l,selectEnabled:o,selectedType:a,value:n,onOpenLinkModal:r,onValueChange:s,openInNewTab:u,condensedButtons:y==="condensedButtons",showNewTabButton:c&&a==="web",displayTextEnabled:f,variants:_,variant:b,onVariantChange:v})})})}function EBe(e){const{id:t,documentId:n,onOpenLinkModal:r,isTypeSelectEnabled:i,selectType:o,displayTextEnabled:a,onSelectValueChange:s,onUnlink:l,onFocus:u,onClick:c,onKeyDown:f,appearance:p,variants:h,variant:m,displayText:g,onVariantChange:y,onDisplayTextChange:C}=e,_=SBe(n),b=hY(n);return d.jsx(Tl,{id:t,textOverflow:"ellipsis",padding:fY(p),placeholder:a?"Add your display text":void 0,readOnly:!a,value:a?g:_,variant:a?"normal":"link",cursor:pY({value:_,displayTextEnabled:a,isTypeSelectEnabled:i}),onFocus:u,onClick:c,onKeyDown:f,onValueChange:a?C:void 0,endAdornment:d.jsxs(A.Box,{gap:4,children:[b&&d.jsx(A.Badge,{title:"Broken Link",color:"tomato"}),d.jsx(uY,{hasLink:!0,onUnlink:l,selectEnabled:i,selectedType:o,value:_,onOpenLinkModal:r,condensedButtons:p==="condensedButtons",onValueChange:s,displayTextEnabled:a,variants:h,variant:m,onVariantChange:y})]})})}function RBe(e){const{documentId:t,displayTextEnabled:n}=e;return d.jsx(A.ErrorBoundary,{renderError:()=>d.jsx(A.FieldIcon,{name:"warning"}),children:d.jsx(I.Suspense,{fallback:d.jsx(A.FieldIcon,{name:id({selectType:"document",displayTextEnabled:n})}),children:d.jsx($Be,{documentId:t,displayTextEnabled:n})})})}function $Be(e){const{displayTextEnabled:t,documentId:n}=e;return hY(n)?d.jsx(A.FieldIcon,{name:"linkOff"}):d.jsx(A.FieldIcon,{name:id({selectType:"document",displayTextEnabled:t})})}function fY(e){switch(e){case"compact":return{input:{inline:4}};default:return}}function kBe(e){const{errorBoundaryRef:t,onError:n,children:r,fallback:i,renderError:o}=e;return d.jsx(A.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 pY(e){const{value:t,displayTextEnabled:n,isTypeSelectEnabled:r}=e;return n?"text":r&&!t?"default":"pointer"}function OBe(e){const{onContentChange:t,...n}=e;function r(i){const o=fe.FilledLinkContent.is(i)?i:void 0;t(o)}return d.jsx(oF,{...n,onContentChange:r})}function hY(e){const t=we();t.uidField||Mt("uidField");const{coreApiBaseUrl:n,authStrategy:r}=t,{data:i}=GM({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 MBe(e){const{onDelete:t,isDeleteEnabled:n,onMoveUp:r,onMoveDown:i,isMoveUpEnabled:o,isMoveDownEnabled:a}=e;return d.jsxs(A.DropdownMenu,{children:[d.jsx(A.DropdownMenuTrigger,{children:d.jsx(A.IconButton,{hiddenLabel:"Link actions",icon:"moreVert",size:"small",variant:"solid"})}),d.jsxs(A.DropdownMenuContent,{children:[d.jsx(A.DropdownMenuLabel,{children:d.jsx(A.Text,{variant:"small",color:"grey11",children:"Item options"})}),d.jsx(A.DropdownMenuItem,{onSelect:r,startIcon:d.jsx(A.Icon,{name:"arrowUpward"}),disabled:!o,children:"Move up"}),d.jsx(A.DropdownMenuItem,{onSelect:i,startIcon:d.jsx(A.Icon,{name:"arrowDownward"}),disabled:!a,children:"Move down"}),d.jsx(A.DropdownMenuItem,{color:"tomato",onSelect:t,startIcon:d.jsx(A.Icon,{name:"delete",color:"tomato9"}),disabled:!n,children:"Delete"})]})]})}function FBe(e){const{field:t,content:n,onContentChange:r}=e,{config:i}=t,o=I.useMemo(()=>FS({config:i}),[i]),a=n!=null&&n.value.length?n.value:[o];function s(p){const h=_t.insertAtIndex(a,p,FS({config:i}));r(Cp(h))}function l(p,h){var y;const m=[...a],g=FS({config:i,key:(y=m[h])==null?void 0:y.key});m[h]=p??g,r(Cp(m))}function u(p){r(Cp(p))}function c(p){const h=_t.removeIndex(a,p);r(Cp(h))}function f(p,h){const m=_t.move(a,h,h+jBe(p));r(Cp(m))}return{links:a,updateLink:l,updateLinks:u,addLink:s,deleteLink:c,moveLink:f}}function jBe(e){switch(e){case"up":return-1;case"down":return 1}}function FS(e){const{config:t,key:n=crypto.randomUUID()}=e,r=LBe(t==null?void 0:t.select);return t!=null&&t.allowText&&(r.text=""),{__TYPE__:"LinkContent",key:n,value:r}}function LBe(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 DBe(e){const{id:t,field:n}=e,r=FBe(e),[i,o]=I.useState(!1),{links:a}=r;return d.jsx(oUe,{children:d.jsxs(A.FieldSet,{id:t,legend:UBe(n.config),variant:"compact",selected:i,children:[d.jsx(BBe,{field:n,items:a,onItemDelete:r.deleteLink,onItemChange:r.updateLink,onItemMove:r.moveLink,onItemAdd:r.addLink,onItemReorder:r.updateLinks,onDragStatusChange:o}),d.jsx(A.Button,{startIcon:"add",color:"grey",onClick:()=>r.addLink(a.length),sx:{marginInline:4,marginBlock:4},children:"Add"})]})})}function UBe(e){return e!=null&&e.label?`Multiple • ${e.label}`:"Multiple"}function BBe(e){const{field:t,items:n,onItemChange:r,onItemDelete:i,onItemMove:o}=e,a=n.length>1,s=PBe(e);return d.jsx(A.AnimatedList,{items:n,getItemKey:l=>l.key,ariaLabel:"Link list",dnd:s,children:(l,u)=>d.jsxs(A.Draggable,{disabled:!a,children:[d.jsx(oF,{appearance:"compact",content:l,field:t,onContentChange:c=>r(c,u),backgroundColor:"transparent"}),d.jsx(MBe,{onDelete:()=>i(u),isDeleteEnabled:n.length>1,onMoveUp:()=>o("up",u),isMoveUpEnabled:u>0,onMoveDown:()=>o("down",u),isMoveDownEnabled:u<n.length-1})]})})}function PBe(e){const{onDragStatusChange:t,onItemReorder:n,onItemAdd:r}=e,{scrollOffsetTop:i}=we(),o=ze.useStableCallback(r);return{renderDropIndicator:s=>d.jsx(WBe,{...s,onItemAdd:o}),scrollOffsetTop:i,onDragChange:t,onReorder:n}}function WBe(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(NBe,{index:n,isDropTarget:t,onItemAdd:o})}function NBe(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(A.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(A.AnimatedElement,{enterDuration:150,animation:{name:"expand-vertical"},children:t&&d.jsx(A.Box,{children:d.jsx(A.Line,{color:"purple",thickness:2,sx:{width:"100%",marginBottom:n==="before"?4:void 0,marginTop:n==="after"?4:void 0}},"line")})})}function KBe(e){const{linkTo:t,onLinkToChange:n}=e,r=qBe(t);return d.jsx(OBe,{content:r,onContentChange:i=>n(VBe(i)),field:{type:"Link",config:{label:"Link",allowTargetBlank:!0,allowText:!1}},appearance:"condensedButtons"})}function qBe(e){const[t]=I.useState(()=>crypto.randomUUID());if(e)return{__TYPE__:"LinkContent",key:t,value:e}}function VBe(e){return e==null?void 0:e.value}function AY(e){var b,v;const{allContentViews:t,content:n,contentView:r,fieldLabel:i,imageLabel:o,initialImages:a,isUpdating:s,page:l=0,readOnly:u,thumbnailName:c,onClear:f,onContentChange:p,onCropperDialogClose:h,onPageChange:m,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&&!u?"visible":"hidden",_=!fe.isImageContent(n);return d.jsxs(A.Box,{display:"flex",gap:12,padding:{inline:12},children:[d.jsx(A.Box,{children:d.jsx(A.Carousel,{getItemSource:V2e,items:t,onPageChange:m,page:l,buttonSize:"small",renderPrevTooltip:S=>d.jsx(A.Tooltip,{content:"Previous",children:S}),renderNextTooltip:S=>d.jsx(A.Tooltip,{content:"Next",children:S}),style:_?{width:181,height:142}:{width:123,height:93},children:S=>(S==null?void 0:S.url)&&d.jsx(A.CarouselItem,{"aria-label":"Image Field Item",src:jH(S.url),alt:S.alt??void 0,isUpdating:s,disableAnimation:_},`${c}_${S.url}`)})}),d.jsxs(A.Box,{width:"100%",display:"flex",flexDirection:"column",gap:_?16:12,children:[d.jsx(WUe,{fieldLabel:i,imageLabel:o,initialImages:a,page:l,displaySeparator:!_,isSVGContentView:y,visibility:C,onClear:f,onCropperDialogClose:h,onMediaDialogOpenChange:g}),d.jsx(PUe,{readOnly:u||!r,altText:(r==null?void 0:r.alt)??"",onValueChange:S=>{r&&p(W2e(c,n,r,S))}}),_&&d.jsx(KBe,{linkTo:n.linkTo,onLinkToChange:S=>{p({...n,linkTo:S})}})]})]})}function mY(e){const{onMediaSelected:t}=e,n=we(),{showAlert:r}=A.useAlert(),{mutate:i,isPending:o}=ui.useMutation({mutationFn:a=>bH({file:a,config:n}),onSuccess:a=>{t(a)},onError:()=>{r({title:"Error uploading image",subtitle:"Please try again"})}});return{uploadImage:i,isUploadingImage:o}}function zBe(e){const{content:t,onContentChange:n,field:r}=e,[i,o]=I.useState(0),[a,s]=I.useTransition(),l=B2e(r),u=l[i],c=t?P2e(r,t):void 0,f=c==null?void 0:c[i];function p(_){if(!u)return;const b=z2e(u.name,r,t,_);b!==t&&s(()=>n(b))}function h(_){s(()=>o(_))}function m({option:_,croppedImages:b}){if(o(_),!t)return;const v=Object.entries(b).reduce((S,[w,T])=>FUe({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}=mY({onMediaSelected:p});return{onCropperDialogClose:m,onPageChange:h,onMediaSelected:p,isUpdating:a,page:i,thumbnail:u,allThumbnails:l,allContentViews:c,contentView:f,onClear:g,uploadImage:y,isUploadingImage:C}}function QBe(e){const{content:t,field:n,readOnly:r,onContentChange:i}=e,o=t&&t.origin.url.length>0,{onCropperDialogClose:a,onPageChange:s,isUpdating:l,page:u,onMediaSelected:c,thumbnail:f,allThumbnails:p,allContentViews:h,contentView:m,onClear:g,uploadImage:y,isUploadingImage:C}=zBe({field:n,content:t,onContentChange:i}),[_,b]=I.useState(!1),v=xr(n),S=p.map((R,O)=>{const $=h==null?void 0:h[O];return{thumbnail:R,contentView:$,labels:e_(R,t,$)}}),w=f&&o?e_(f,t,m).filter(Qi.isDefined):[],T=f&&t&&o&&h,E=C||l;return d.jsx(XH,{isMediaDialogOpen:_,onMediaSelected:c,onMediaDialogOpenChange:b,children:d.jsx(I.Suspense,{fallback:d.jsx("div",{style:{height:95}}),children:T?d.jsx(AY,{allContentViews:h,content:t,contentView:m,fieldLabel:v,imageLabel:w,initialImages:S,isUpdating:E,page:u,readOnly:r,thumbnailName:f.name,onClear:g,onContentChange:i,onCropperDialogClose:a,onMediaDialogOpenChange:b,onPageChange:s}):d.jsx(eY,{uploadImage:y,isUploading:C,disabled:r||_,children:d.jsx(GH,{fieldLabel:v,isUpdating:E,readOnly:r,onMediaDialogOpenChange:b})})})})}function HBe(e){var y,C;const{searchTerm:t,catalogId:n}=e,r=we();r.integrationFields||Mt("integrationFields");const{integrationFieldsApiBaseUrl:i,repository:o,authStrategy:a}=r,[s,l]=I.useState(1),[u,c]=I.useState([]),[f,p]=I.useState(""),h=et.useRequest(YBe,[i,a,o,n,t,t===f?s:1]);t!==f?(p(t),l(1),c(h.items)):h.items.length>0&&((y=_t.last(u))==null?void 0:y.id)!==((C=_t.last(h.items))==null?void 0:C.id)&&c(_=>_.concat(h.items));const m=s<h.totalPages;function g(){m&&l(_=>_+1)}return{items:u,response:h,fetchNextPage:g,hasNextPage:m}}function YBe(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:GBe})}const gY=k.object({id:k.string(),title:k.string(),imageURL:k.string().optional(),description:k.string().optional()}),GBe=k.object({items:k.array(gY),totalPages:k.number(),page:k.number()});function vY(e){const{itemId:t,catalogId:n}=e,r=we();r.integrationFields||Mt("integrationFields");const{integrationFieldsApiBaseUrl:i,repository:o,authStrategy:a}=r,l=et.useRequest(JBe,[i,a,o,n,t]).items[0];if(!l)throw new Error("Item not found");return{item:l}}function JBe(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:ZBe})}const ZBe=k.object({items:k.array(gY)});function aF(e){const{item:t,onClick:n,catalogId:r}=e;return d.jsxs(A.PreviewCard,{variant:"large",onClick:n,children:[d.jsx(XBe,{src:t.imageURL??"",alt:t.title}),d.jsxs(A.PreviewContent,{children:[d.jsx(A.Badge,{title:`Catalog: ${r}`,icon:"multipleStop",size:"medium"}),d.jsx(A.Text,{variant:"bold",color:"grey12",sx:{marginTop:4},children:t.title}),d.jsx(A.Text,{variant:"small",color:"grey11",children:t.description??t.id})]})]})}const Sg=76;function XBe(e){const{src:t,alt:n}=e;return t?d.jsx(A.PreviewImage,{src:t,alt:n,width:Sg,height:Sg,framed:!0}):d.jsxs(A.Box,{borderRadius:6,backgroundColor:"grey2",height:Sg,width:Sg,flexDirection:"column",alignItems:"center",justifyContent:"center",border:!0,padding:{inline:4,block:8},children:[d.jsx(A.Icon,{name:"hideImage",size:"large",color:"grey11"}),d.jsx(A.Text,{color:"grey11",variant:"small",noSelect:!0,align:"center",children:"No preview image"})]})}function qc(){return d.jsxs(A.PreviewCard,{variant:"large",children:[d.jsx(A.Skeleton,{height:76,width:76}),d.jsxs(A.PreviewContent,{children:[d.jsx(A.Skeleton,{height:24,width:168}),d.jsx(A.Skeleton,{height:24,width:240,sx:{marginTop:4}}),d.jsx(A.Skeleton,{height:16,width:144})]})]})}function ePe(e){const{open:t,onOpenChange:n,catalogId:r,onSelectItem:i}=e,o=ze.useDebounceState({initialState:""}),a=we();return d.jsx(A.Dialog,{open:t,onOpenChange:n,hasClose:!1,size:{width:612,height:724},noDescription:!0,children:d.jsx(A.DialogContent,{children:d.jsxs(A.Box,{flexDirection:"column",height:"100%",children:[d.jsxs(A.Box,{padding:{top:16,inline:16},flexDirection:"column",gap:8,children:[d.jsx(A.FormSearchInput,{value:o.value,onValueChange:o.set,placeholder:"Search in your catalog"}),d.jsx(A.DialogTitle,{asChild:!0,children:d.jsx(A.Text,{variant:"smallBold",color:"grey11",children:"Select an item"})})]}),a.integrationFields?d.jsx(A.ErrorBoundary,{renderError:()=>d.jsx(o_,{message:"There was an error while fetching your catalog items."}),children:d.jsx(I.Suspense,{fallback:d.jsxs(A.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(tPe,{searchTerm:o.debouncedValue,catalogId:r,onItemClick:i})})}):d.jsx(o_,{message:"Slice Machine does not yet support mock data for integration field in the simulator."})]})})})}function tPe(e){const{catalogId:t,searchTerm:n,onItemClick:r}=e,[i,o]=I.useTransition(),{items:a,hasNextPage:s,fetchNextPage:l}=HBe({catalogId:t,searchTerm:n});return d.jsx(d.Fragment,{children:d.jsxs(A.ScrollArea,{onScrollToBottom:()=>s&&o(l),style:{flexGrow:1,paddingTop:A.theme.space[10],paddingBottom:A.theme.space[16],paddingInline:A.theme.space[16],display:"flex",flexDirection:"column",gap:A.theme.space[12]},threshold:252,children:[a.length===0?d.jsx(o_,{}):a.map(u=>d.jsx(aF,{item:u,catalogId:t,onClick:()=>r(u)},u.id)),d.jsx(A.AnimatedElement,{animation:{name:"fade"},children:i&&d.jsx(A.Text,{color:"grey11",align:"center",sx:{marginBlock:8},children:"Loading more results ..."})})]})})}function o_(e){const{message:t="We can't find any items matching your search"}=e,n="Oops!";return d.jsx(A.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:d.jsxs(A.BlankSlate,{children:[d.jsx(A.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),d.jsx(A.BlankSlateTitle,{size:"big",children:n}),d.jsx(A.BlankSlateDescription,{width:360,children:t})]})})}function nPe(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(A.ErrorBoundary,{renderError:()=>d.jsx(Vc,{...e,value:t}),children:d.jsx(I.Suspense,{fallback:d.jsx(Vc,{...e,value:t}),children:d.jsx(oPe,{...e,itemId:t})},t)},t):t&&!r.integrationFields?d.jsx(Vc,{...e,value:t}):d.jsx(Vc,{...e,value:""})}function rPe(e){const{catalogId:t,itemId:n,item:r}=e,i=we();return n&&r&&r.id===n?d.jsx(A.FieldFooter,{children:d.jsx(aF,{catalogId:t,item:r})}):n&&i.integrationFields?d.jsx(A.ErrorBoundary,{renderError:()=>null,children:d.jsx(A.FieldFooter,{children:d.jsx(I.Suspense,{fallback:d.jsx(qc,{}),children:d.jsx(iPe,{catalogId:t,itemId:n})},n)})},n):null}function iPe(e){const{itemId:t,catalogId:n}=e,{item:r}=vY({catalogId:n,itemId:t});return d.jsx(aF,{catalogId:n,item:r})}function Vc(e){const{id:t,field:n,readOnly:r,value:i,onFocus:o,onClearItem:a}=e;return d.jsx(Tl,{id:t,placeholder:$c(n),readOnly:!0,variant:"link",value:i,...!r&&{cursor:"pointer",onFocus:o},endAdornment:d.jsx(A.Button,{startIcon:"close",color:"grey",size:"small",disabled:!i,onClick:a})})}function oPe(e){const{itemId:t,catalogId:n}=e,{item:r}=vY({catalogId:n,itemId:t});return d.jsx(Vc,{...e,value:r.title})}function aPe(e){var h;const{id:t,field:n,content:r,readOnly:i,onContentChange:o}=e,[a,s]=I.useState(!1),[l,u]=I.useState(),c=(h=n.config)==null?void 0:h.catalog;if(!c)return null;function f(m){o({value:m.id,__TYPE__:"IntegrationFieldsContent"}),u(m),s(!1)}function p(){o(void 0),u(void 0)}return d.jsxs(d.Fragment,{children:[d.jsxs(A.Field,{footer:d.jsx(rPe,{catalogId:c,item:l,itemId:r==null?void 0:r.value}),children:[d.jsx(A.FieldIcon,{name:"multipleStop"}),d.jsx(A.FieldLabel,{htmlFor:t,children:xr(n)}),d.jsx(A.FieldControl,{children:d.jsx(nPe,{id:t,field:n,readOnly:i,catalogId:c,item:l,itemId:r==null?void 0:r.value,onFocus:()=>s(!0),onClearItem:p})})]}),d.jsx(ePe,{open:a,onOpenChange:s,catalogId:c,onSelectItem:f})]})}function yY(e){const{content:t,field:n,id:r,onContentChange:i,readOnly:o,endAdornment:a,placeholder:s}=e;return d.jsxs(A.Field,{children:[d.jsx(A.FieldIcon,{name:"notes"}),d.jsx(A.FieldLabel,{htmlFor:r,children:xr(n)}),d.jsxs(A.FieldControl,{children:[d.jsx(A.TextArea,{id:r,placeholder:s||$c(n),readOnly:o,paddingLeft:4,paddingRight:12,sx:{flexGrow:1},value:(t==null?void 0:t.value)??"",onChange:l=>{i(sPe(l))}}),a]})]})}function sPe(e){return e.length===0?void 0:{__TYPE__:"FieldContent",type:"Text",value:e}}function lPe(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(DBe,{...a,field:r,content:yQ(t)}):d.jsx(oF,{...a,field:r,content:bQ(t)})}const uPe=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var s,l;const o=Number(e==null?void 0:e.value),a=Number.isFinite(o)?o:void 0;return d.jsxs(A.Field,{children:[d.jsx(A.FieldIcon,{name:"pin"}),d.jsx(A.FieldLabel,{htmlFor:n,children:xr(t)}),d.jsx(A.FieldControl,{children:d.jsx(A.NumberInput,{id:n,value:a,min:(s=t.config)==null?void 0:s.min,max:(l=t.config)==null?void 0:l.max,padding:zH,placeholder:$c(t),readOnly:i,onValueChange:u=>r(cPe(u))})})]})};function cPe(e){return e===void 0?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(e)}}function En(e){this.content=e}En.prototype={constructor:En,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 En(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 En(n)},addToStart:function(e,t){return new En([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new En(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 En(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=En.from(e),e.size?new En(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=En.from(e),e.size?new En(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=En.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}};En.from=function(e){if(e instanceof En)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new En(t)};function bY(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=bY(i.content,o.content,n+1);if(a!=null)return a}n+=i.nodeSize}}function CY(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),l=a.nodeSize;if(a==s){n-=l,r-=l;continue}if(!a.sameMarkup(s))return{a:n,b:r};if(a.isText&&a.text!=s.text){let u=0,c=Math.min(a.text.length,s.text.length);for(;u<c&&a.text[a.text.length-u-1]==s.text[s.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(a.content.size||s.content.size){let u=CY(a.content,s.content,n-1,r-1);if(u)return u}n-=l,r-=l}}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 l=this.content[a],u=s+l.nodeSize;if(u>t&&r(l,i+s,o||null,a)!==!1&&l.content.size){let c=s+1;l.nodesBetween(Math.max(0,t-c),Math.min(l.content.size,n-c),r,i+c)}s=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let o="",a=!0;return this.nodesBetween(t,n,(s,l)=>{let u=s.isText?s.text.slice(Math.max(t,l)-l,n-l):s.isLeaf?i?typeof i=="function"?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&u||s.isTextblock)&&r&&(a?a=!1:o+=r),o+=u},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],l=a+s.nodeSize;l>t&&((a<t||l>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=l}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 bY(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return CY(this,t,n,r)}findIndex(t,n=-1){if(t==0)return wg(0,t);if(t==this.size)return wg(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?wg(r+1,a):wg(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 jS={index:0,offset:0};function wg(e,t){return jS.index=e,jS.offset=t,jS}function jv(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(!jv(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!jv(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let wt=class a_{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&&jv(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 a_.none;if(t instanceof a_)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};wt.none=[];class wu 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=wY(this.content,t+this.openStart,n);return r&&new V(r,this.openStart,this.openEnd)}removeBetween(t,n){return new V(SY(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 SY(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(SY(o.content,t-i-1,n-i-1)))}function wY(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=wY(a.content,t-o-1,n);return s&&e.replaceChild(i,a.copy(s))}function dPe(e,t,n){if(n.openStart>e.depth)throw new wu("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new wu("Inconsistent open depths");return _Y(e,t,n,0)}function _Y(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=_Y(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 Xl(a,s.cut(0,e.parentOffset).append(n.content).append(s.cut(t.parentOffset)))}else{let{start:a,end:s}=fPe(n,e);return Xl(o,TY(e,a,s,t,r))}else return Xl(o,Lv(e,t,r))}function xY(e,t){if(!t.type.compatibleContent(e.type))throw new wu("Cannot join "+t.type.name+" onto "+e.type.name)}function s_(e,t,n){let r=e.node(n);return xY(r,t.node(n)),r}function Zl(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&&(Zl(e.nodeAfter,r),o++));for(let s=o;s<a;s++)Zl(i.child(s),r);t&&t.depth==n&&t.textOffset&&Zl(t.nodeBefore,r)}function Xl(e,t){return e.type.checkContent(t),e.copy(t)}function TY(e,t,n,r,i){let o=e.depth>i&&s_(e,t,i+1),a=r.depth>i&&s_(n,r,i+1),s=[];return zp(null,e,i,s),o&&a&&t.index(i)==n.index(i)?(xY(o,a),Zl(Xl(o,TY(e,t,n,r,i+1)),s)):(o&&Zl(Xl(o,Lv(e,t,i+1)),s),zp(t,n,i,s),a&&Zl(Xl(a,Lv(n,r,i+1)),s)),zp(r,null,i,s),new q(s)}function Lv(e,t,n){let r=[];if(zp(null,e,n,r),e.depth>n){let i=s_(e,t,n+1);Zl(Xl(i,Lv(e,t,n+1)),r)}return zp(t,null,n,r),new q(r)}function fPe(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 wt.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 Dv(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:l}=a.content.findIndex(o),u=o-l;if(r.push(a,s,i+l),!u||(a=a.child(s),a.isText))break;o=u-1,i+=l+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 pPe);let i=r.elts[r.i]=jh.resolve(t,n);return r.i=(r.i+1)%hPe,i}}class pPe{constructor(){this.elts=[],this.i=0}}const hPe=12,QL=new WeakMap;class Dv{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 APe=Object.create(null);let eu=class l_{constructor(t,n,r,i=wt.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&&jv(this.attrs,n||t.defaultAttrs||APe)&&wt.sameSet(this.marks,r||wt.none)}copy(t=null){return t==this.content?this:new l_(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new l_(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),u=i.node(a).content.cut(i.pos-s,o.pos-s);return new V(u,i.depth-a,o.depth-a)}replace(t,n,r){return dPe(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()+")"),IY(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 l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).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=wt.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(!wt.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}};eu.prototype.text=void 0;class Uv extends eu{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):IY(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 Uv(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Uv(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 IY(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class _u{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new mPe(t,n);if(r.next==null)return _u.empty;let i=EY(r);r.next&&r.err("Unexpected trailing text");let o=wPe(SPe(i));return _Pe(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 l=a.matchFragment(t,r);if(l&&(!n||l.validEnd))return q.from(s.map(u=>u.createAndFill()));for(let u=0;u<a.next.length;u++){let{type:c,next:f}=a.next[u];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:l}=o.next[a];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in n)&&(!i.type||l.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
+ `)}}_u.empty=new _u(!0);class mPe{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 EY(e){let t=[];do t.push(gPe(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function gPe(e){let t=[];do t.push(vPe(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function vPe(e){let t=CPe(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=yPe(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 yPe(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 bPe(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 CPe(e){if(e.eat("(")){let t=EY(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=bPe(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 SPe(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(a,s,l){let u={term:l,to:s};return t[a].push(u),u}function i(a,s){a.forEach(l=>l.to=s)}function o(a,s){if(a.type=="choice")return a.exprs.reduce((l,u)=>l.concat(o(u,s)),[]);if(a.type=="seq")for(let l=0;;l++){let u=o(a.exprs[l],s);if(l==a.exprs.length-1)return u;i(u,s=n())}else if(a.type=="star"){let l=n();return r(s,l),i(o(a.expr,l),l),[r(l)]}else if(a.type=="plus"){let l=n();return i(o(a.expr,s),l),i(o(a.expr,l),l),[r(l)]}else{if(a.type=="opt")return[r(s)].concat(o(a.expr,s));if(a.type=="range"){let l=s;for(let u=0;u<a.min;u++){let c=n();i(o(a.expr,l),c),l=c}if(a.max==-1)i(o(a.expr,l),l);else for(let u=a.min;u<a.max;u++){let c=n();r(l,c),i(o(a.expr,l),c),l=c}return[r(l)]}else{if(a.type=="name")return[r(s,void 0,a.value)];throw new Error("Unknown expr type")}}}}function RY(e,t){return t-e}function YL(e,t){let n=[];return r(t),n.sort(RY);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:l}=o[a];!s&&n.indexOf(l)==-1&&r(l)}}}function wPe(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:l})=>{if(!s)return;let u;for(let c=0;c<i.length;c++)i[c][0]==s&&(u=i[c][1]);YL(e,l).forEach(c=>{u||i.push([s,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let o=t[r.join(",")]=new _u(r.indexOf(e.length-1)>-1);for(let a=0;a<i.length;a++){let s=i[a][1].sort(RY);o.next.push({type:i[a][0],next:t[s.join(",")]||n(s)})}return o}}function _Pe(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:l,next:u}=i.next[s];a.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),r.indexOf(u)==-1&&r.push(u)}o&&t.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function $Y(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 kY(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 OY(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 MY(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new TPe(e,r,t[r]);return n}let GL=class FY{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=MY(t,r.attrs),this.defaultAttrs=$Y(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==_u.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:kY(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new eu(this,this.computeAttrs(t),q.from(n),wt.setFrom(r))}createChecked(t=null,n,r){return n=q.from(n),this.checkContent(n),new eu(this,this.computeAttrs(t),n,wt.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 eu(this,t,n.append(o),wt.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){OY(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:wt.none:t}static compile(t,n){let r=Object.create(null);t.forEach((o,a)=>r[o]=new FY(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 xPe(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 TPe{constructor(t,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?xPe(t,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class rC{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=MY(t,i.attrs),this.excluded=null;let o=$Y(this.attrs);this.instance=o?new wt(this,o):null}create(t=null){return!t&&this.instance?this.instance:new wt(this,kY(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((o,a)=>r[o]=new rC(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){OY(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class jY{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=En.from(t.nodes),n.marks=En.from(t.marks||{}),this.nodes=GL.compile(this.spec.nodes,this),this.marks=rC.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]=_u.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 Uv(r,r.defaultAttrs,t,wt.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return eu.fromJSON(this,t)}markFromJSON(t){return wt.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 l=e.marks[s];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(a=l)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}function IPe(e){return e.tag!=null}function EPe(e){return e.style!=null}class tu{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(IPe(i))this.tags.push(i);else if(EPe(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,wt.none,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new XL(this,n,!0);return r.addAll(t,wt.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(kPe(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 l=a.getAttrs(n);if(l===!1)continue;a.attrs=l||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 tu(t,tu.schemaRules(t)))}}const LY={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},RPe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},DY={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 _g{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=wt.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&&!LY.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 _g(i.type,i.attrs,wt.none,!0,n.topMatch||i.type.contentMatch,a):r?o=new _g(null,null,wt.none,!0,null,a):o=new _g(t.schema.topNodeType,null,wt.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;DY.hasOwnProperty(a)&&this.parser.normalizeLists&&$Pe(t);let l=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(s=this.parser.matchTag(t,this,r));e:if(l?l.ignore:RPe.hasOwnProperty(a))this.findInside(t),this.ignoreFallback(t,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(t=l.skip);let u,c=this.needsBlock;if(LY.hasOwnProperty(a))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),u=!0,o.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,n);break e}let f=l&&l.skip?n:this.readStyles(t,n);f&&this.addAll(t,f),u&&this.sync(o),this.needsBlock=c}else{let u=this.readStyles(t,n);u&&this.addElementByRule(t,l,u,l.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 l=this.parser.matchStyle(o,a,this,s);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(u=>!l.clearMark(u)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)s=l;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 l=this.enter(a,n.attrs||null,r,n.preserveWhitespace);l&&(o=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.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(l=>this.insertNode(l,r));else{let l=t;typeof n.contentElement=="string"?l=t.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(t):n.contentElement&&(l=n.contentElement),this.findAround(t,l,!0),this.addAll(l,r),this.findAround(t,l,!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=wt.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 l=wt.none;return r=r.filter(u=>(a.type?a.type.allowsMarkType(u.type):t2(u.type,t))?(l=u.addToSet(l),!1):!0),this.nodes.push(new _g(t,n,l,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,l)=>{for(;s>=0;s--){let u=n[s];if(u==""){if(s==n.length-1||s==0)continue;for(;l>=o;l--)if(a(s-1,l))return!0;return!1}else{let c=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;l--}}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 $Pe(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&DY.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function kPe(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 l=0;l<s.edgeCount;l++){let{type:u,next:c}=s.edge(l);if(u==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=LS(n).createDocumentFragment());let i=r,o=[];return t.forEach(a=>{if(o.length||a.marks.length){let s=0,l=0;for(;s<o.length&&l<a.marks.length;){let u=a.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(o[s][0])||u.type.spec.spanning===!1)break;s++,l++}for(;s<o.length;)i=o.pop()[1];for(;l<a.marks.length;){let u=a.marks[l++],c=this.serializeMark(u,a.isInline,n);c&&(o.push([u,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}=Pg(LS(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&&Pg(LS(r),i(t,n),null,t.attrs)}static renderSpec(t,n,r=null,i){return Pg(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 LS(e){return e.document||window.document}const r2=new WeakMap;function OPe(e){let t=r2.get(e);return t===void 0&&r2.set(e,t=MPe(e)),t}function MPe(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 Pg(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=OPe(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,l=n?e.createElementNS(n,i):e.createElement(i),u=t[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let f in u)if(u[f]!=null){let p=f.indexOf(" ");p>0?l.setAttributeNS(f.slice(0,p),f.slice(p+1),u[f]):l.setAttribute(f,u[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:l,contentDOM:l}}else{let{dom:h,contentDOM:m}=Pg(e,p,n,r);if(l.appendChild(h),m){if(s)throw new RangeError("Multiple content holes");s=m}}}return{dom:l,contentDOM:s}}const UY=65535,BY=Math.pow(2,16);function FPe(e,t){return e+t*BY}function i2(e){return e&UY}function jPe(e){return(e-(e&UY))/BY}const PY=1,WY=2,Wg=4,NY=8;let c_=class{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&NY)>0}get deletedBefore(){return(this.delInfo&(PY|Wg))>0}get deletedAfter(){return(this.delInfo&(WY|Wg))>0}get deletedAcross(){return(this.delInfo&Wg)>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+jPe(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 l=this.ranges[s]-(this.inverted?i:0);if(l>t)break;let u=this.ranges[s+o],c=this.ranges[s+a],f=l+u;if(t<=f){let p=u?t==l?-1:t==f?1:n:n,h=l+i+(p<0?0:c);if(r)return h;let m=t==(n<0?l:f)?null:FPe(s/3,t-l),g=t==l?WY:t==f?PY:Wg;return(n<0?t!=l:t!=f)&&(g|=NY),new c_(h,g,m)}i+=c-u}return r?t+i:new c_(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 l=this.ranges[s]-(this.inverted?r:0);if(l>t)break;let u=this.ranges[s+o],c=l+u;if(t<=c&&s==i*3)return!0;r+=this.ranges[s+a]-u}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),l=a+(this.inverted?0:o),u=this.ranges[i+n],c=this.ranges[i+r];t(s,s+u,l,l+c),o+=c-u}}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 LPe=class Ng{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 Ng(this.maps,this.mirror,t,n)}copy(){return new Ng(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 Ng;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 l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,t=this.maps[l].recover(s.recover);continue}}i|=s.delInfo,t=s.pos}return r?t:new c_(t,i,null)}};const DS=Object.create(null);let zr=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=DS[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 DS)throw new RangeError("Duplicate use of step JSON ID "+t);return DS[t]=n,n.prototype.jsonID=t,n}},kr=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 wu)return Rp.fail(o.message);throw o}}};function sF(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(sF(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return q.fromArray(r)}let KY=class $p extends zr{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(sF(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 kr.fromReplace(t,this.from,this.to,o)}invert(){return new qY(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))}};zr.jsonID("addMark",KY);let qY=class kp extends zr{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(sF(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return kr.fromReplace(t,this.from,this.to,r)}invert(){return new KY(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))}};zr.jsonID("removeMark",qY);let VY=class Op extends zr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return kr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return kr.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 zY(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))}};zr.jsonID("addNodeMark",VY);let zY=class d_ extends zr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return kr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return kr.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 VY(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new d_(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 d_(n.pos,t.markFromJSON(n.mark))}};zr.jsonID("removeNodeMark",zY);let QY=class Dl extends zr{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&f_(t,this.from,this.to)?kr.fail("Structure replace would overwrite content"):kr.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 Dl(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 Dl(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof Dl)||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 Dl(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 Dl(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 Dl(n.from,n.to,V.fromJSON(t,n.slice),!!n.structure)}};zr.jsonID("replace",QY);let pp=class Kg extends zr{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&&(f_(t,this.from,this.gapFrom)||f_(t,this.gapTo,this.to)))return kr.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return kr.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?kr.fromReplace(t,this.from,this.to,r):kr.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 Kg(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 Kg(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 Kg(n.from,n.to,n.gapFrom,n.gapTo,V.fromJSON(t,n.slice),n.insert,!!n.structure)}};zr.jsonID("replaceAround",pp);function f_(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 DPe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function UPe(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||!DPe(i,o,a))break}return null}function BPe(e,t,n=null,r=e){let i=PPe(e,t),o=i&&WPe(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 PPe(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 WPe(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 l=(a.length?a[a.length-1]:t).contentMatch;for(let u=r;l&&u<i;u++)l=l.matchType(n.child(u).type);return!l||!l.validEnd?null:a}function NPe(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 u=i.depth-1,c=n-2;u>o;u--,c--){let f=i.node(u),p=i.index(u);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(p,f.childCount),m=r&&r[c+1];m&&(h=h.replaceChild(0,m.type.create(m.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),l=r&&r[0];return i.node(o).canReplaceWith(s,s,l?l.type:i.node(o+1).type)}function KPe(e,t){let n=e.resolve(t),r=n.index();return qPe(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function qPe(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function VPe(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,l=r.index(a)+(s>0?1:0),u=r.node(a),c=!1;if(o==1)c=u.canReplace(l,l,i);else{let f=u.contentMatchAt(l).findWrapping(i.firstChild.type);c=f&&u.canReplaceWith(l,l,f[0])}if(c)return s==0?r.pos:s<0?r.before(a+1):r.after(a+1)}return null}let zPe=class qg extends zr{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 kr.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 kr.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 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)}};zr.jsonID("attr",zPe);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 US=Object.create(null);class je{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new HY(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:l,$to:u}=a[s],c=t.mapping.slice(o);t.replaceRange(c.map(l.pos),c.map(u.pos),s?V.empty:n),s==0&&l2(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],l=t.mapping.slice(r),u=l.map(a.pos),c=l.map(s.pos);o?t.deleteRange(u,c):(t.replaceRangeWith(u,c,n),l2(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=US[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 US)throw new RangeError("Duplicate use of selection JSON ID "+t);return US[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Oe.between(this.$anchor,this.$head).getBookmark()}}je.prototype.visible=!0;class HY{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 iC(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 iC{constructor(t,n){this.anchor=t,this.head=n}map(t){return new iC(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 lF(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 lF{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new iC(r,r):new lF(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 QPe}}je.jsonID("all",xi);const QPe={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 l=Qc(e,s,n+i,i<0?s.childCount:0,i,o);if(l)return l}n+=s.nodeSize*i}return null}function l2(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof QY||i instanceof pp))return;let o=e.mapping.maps[r],a;o.forEach((s,l,u,c)=>{a==null&&(a=c)}),e.setSelection(je.near(e.doc.resolve(a),n))}function u2(e,t){return!t||!e?e:e.bind(t)}class xg{constructor(t,n,r){this.name=t,this.init=u2(n.init,r),this.apply=u2(n.apply,r)}}new xg("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new xg("selection",{init(e,t){return e.selection||je.atStart(t.doc)},apply(e){return e.selection}}),new xg("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new xg("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}});function YY(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=YY(i,t,{})),n[r]=i}return n}class Sn{constructor(t){this.spec=t,this.props={},t.props&&YY(t.props,this,this.props),this.key=t.key?t.key.key:GY("plugin")}getState(t){return t[this.key]}}const BS=Object.create(null);function GY(e){return e in BS?e+"$"+ ++BS[e]:(BS[e]=0,e+"$")}class qn{constructor(t="key"){this.key=GY(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},JY=function(e,t,n,r){return n&&(c2(e,t,n,r,-1)||c2(e,t,n,r,1))},HPe=/^(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:Bv(e))){let o=e.parentNode;if(!o||o.nodeType!=1||uF(e)||HPe.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?Bv(e):0}else return!1}}function Bv(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function YPe(e,t,n){for(let r=t==0,i=t==Bv(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==Bv(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 ZY=function(e){return e.focusNode&&JY(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function XY(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,Il=Do&&Do.userAgent||"",p_=/Edge\/(\d+)/.exec(Il),eG=/MSIE \d/.exec(Il),h_=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Il),Gm=!!(eG||h_||p_),tG=eG?document.documentMode:h_?+h_[1]:p_?+p_[1]:0,oC=!Gm&&/gecko\/(\d+)/i.test(Il);oC&&+(/Firefox\/(\d+)/.exec(Il)||[0,0])[1];const A_=!Gm&&/Chrome\/(\d+)/.exec(Il),El=!!A_,nG=A_?+A_[1]:0,Oc=!Gm&&!!Do&&/Apple Computer/.test(Do.vendor),cF=Oc&&(/Mobile\/\w+/.test(Il)||!!Do&&Do.maxTouchPoints>2),Ci=cF||(Do?/Mac/.test(Do.platform):!1),GPe=Do?/Win/.test(Do.platform):!1,Jm=/Android \d/.test(Il),dF=!!d2&&"webkitFontSmoothing"in d2.documentElement.style,JPe=dF?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function ZPe(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),l,u;if(ZY(n)){for(l=a;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&xe.isSelectable(f)&&i.parent&&!(f.isInline&&YPe(n.focusNode,n.focusOffset,i.dom))){let p=i.posBefore;u=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 m=n.getRangeAt(h);f=Math.min(f,e.docView.posFromDOM(m.startContainer,m.startOffset,1)),p=Math.max(p,e.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(f<0)return null;[l,a]=p==e.state.selection.anchor?[p,f]:[f,p],s=r.resolve(a)}else l=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let c=r.resolve(l);if(!u){let f=t=="pointer"||e.state.selection.head<s.pos&&!o?1:-1;u=iG(e,c,s,f)}return u}function rG(e){return e.editable?e.hasFocus():nWe(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function fF(e,t=!1){let n=e.state.selection;if(tWe(e,n),!!rG(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&El){let r=e.domSelectionRange(),i=e.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&JY(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)eWe(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&&XPe(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const f2=Oc||El&&nG<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 PS(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return PS(i);if(o)return PS(o)}}function PS(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 XPe(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(()=>{(!rG(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function eWe(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&&tG<=11&&(r.disabled=!0,r.disabled=!1)}function tWe(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 iG(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||Oe.between(t,n,r)}function nWe(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 m_(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=m_(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)):dF?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=m_(e.state,t);return i?ys(e,i):!1}}}function Pv(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?rWe(e):iWe(e)}function rWe(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,a=!1;for(oC&&n.nodeType==1&&r<Pv(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(oG(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=Pv(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}a?g_(e,n,r):i&&g_(e,i,o)}function iWe(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=Pv(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(oG(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=Pv(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}}o&&g_(e,o,a)}function oG(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function oWe(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 aWe(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 g_(e,t,n){if(t.nodeType!=3){let o,a;(a=oWe(t,n))?(t=a,n=0):(o=aWe(t,n))&&(t=o,n=o.nodeValue.length)}let r=e.domSelection();if(!r)return;if(ZY(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&&fF(e)},50)}function g2(e,t){let n=e.state.doc.resolve(t);if(!(El||GPe)&&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=m_(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 sWe(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 lWe(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function uWe(e,t){let n=t.keyCode,r=lWe(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 sWe(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 aG(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=fG(),l=s.createElement("div");l.appendChild(a.serializeFragment(r,{document:s}));let u=l.firstChild,c,f=0;for(;u&&u.nodeType==1&&(c=dG[u.nodeName.toLowerCase()]);){for(let h=c.length-1;h>=0;h--){let m=s.createElement(c[h]);for(;l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),f++}u=l.firstChild}u&&u.nodeType==1&&u.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:l,text:p,slice:t}}function sG(e,t,n,r,i){let o=i.parent.type.spec.code,a,s;if(!n&&!t)return null;let l=t&&(r||o||!n);if(l){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,m=Ym.fromSchema(h);a=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(g=>{let y=a.appendChild(document.createElement("p"));g&&y.appendChild(m.serializeNode(h.text(g,p)))})}}else e.someProp("transformPastedHTML",f=>{n=f(n,e)}),a=pWe(n),dF&&hWe(a);let u=a&&a.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.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")||tu.fromSchema(e.state.schema)).parseSlice(a,{preserveWhitespace:!!(l||c),context:i,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!cWe.test(p.parentNode.nodeName)?{ignore:!0}:null}})),c)s=AWe(C2(s,+c[1],+c[2]),c[4]);else if(s=V.maxOpen(dWe(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 cWe=/^(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 dWe(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 l=i.findWrapping(s.type),u;if(!l)return a=null;if(u=a.length&&o.length&&uG(l,o,s,a[a.length-1],0))a[a.length-1]=u;else{a.length&&(a[a.length-1]=cG(a[a.length-1],o.length));let c=lG(s,l);a.push(c),i=i.matchType(c.type),o=l}}),a)return q.from(a)}return e}function lG(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,q.from(e));return e}function uG(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=uG(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(lG(n,e,i+1))))}}function cG(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,cG(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(q.empty,!0);return e.copy(n.append(r))}function v_(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=v_(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(v_(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new V(v_(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const dG={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 fG(){return S2||(S2=document.implementation.createHTMLDocument("title"))}let WS=null;function fWe(e){let t=window.trustedTypes;return t?(WS||(WS=t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),WS.createHTML(e)):e}function pWe(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=fG().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&dG[r[1].toLowerCase()])&&(e=i.map(o=>"<"+o+">").join("")+e+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=fWe(e),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function hWe(e){let t=e.querySelectorAll(El?"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 AWe(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 l=n.nodes[r[s]];if(!l||l.hasRequiredAttrs())break;i=q.from(l.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,!hG(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Jm&&El&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),cF&&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,XY(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||uWe(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(hG(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 aC(e){return{left:e.clientX,top:e.clientY}}function mWe(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function pF(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 gWe(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 vWe(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 yWe(e,t,n,r,i){return pF(e,"handleClickOn",t,n,r)||e.someProp("handleClick",o=>o(e,t,r))||(i?vWe(e,n):gWe(e,n))}function bWe(e,t,n,r){return pF(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",i=>i(e,t,r))}function CWe(e,t,n,r){return pF(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",i=>i(e,t,r))||SWe(e,n,r)}function SWe(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 hF(e){return Wv(e)}const pG=Ci?"metaKey":"ctrlKey";yo.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=hF(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&mWe(n,e.input.lastClick)&&!n[pG]&&(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(aC(n));a&&(o=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new wWe(e,a,n,!!r)):(o=="doubleClick"?bWe:CWe)(e,a.pos,a.inside,n)?n.preventDefault():Rs(e,"pointer"))};class wWe{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[pG],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,l=s?t.docView.nearestDesc(s,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:u}=t.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||u instanceof xe&&u.from<=a&&u.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&oC&&!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(()=>fF(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(aC(t))),this.updateAllowDefault(t),this.allowDefault||!n?Rs(this.view,"pointer"):yWe(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||Oc&&this.mightDrag&&!this.mightDrag.node.isAtom||El&&!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(),hF(e),Rs(e,"pointer")};yo.touchmove=e=>{e.input.lastTouch=Date.now(),Rs(e,"pointer")};yo.contextmenu=e=>hF(e);function hG(e,t){return e.composing?!0:Oc&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const _We=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(),Wv(e,!0),e.markCursor=null;else if(Wv(e,!t.selection.empty),oC&&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}AG(e,_We)};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++,AG(e,20))};function AG(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Wv(e),t))}function xWe(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=TWe());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function TWe(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Wv(e,t=!1){if(!(Jm&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),xWe(e),t||e.docView&&e.docView.dirty){let n=ZPe(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 IWe(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&&tG<15||cF&&JPe<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:l}=aG(e,a);o?(n.preventDefault(),o.clearData(),o.setData("text/html",s.innerHTML),o.setData("text/plain",l)):IWe(e,s),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function EWe(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function RWe(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?y_(e,r.value,null,i,t):y_(e,r.textContent,r.innerHTML,i,t)},50)}function y_(e,t,n,r,i){let o=sG(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",l=>l(e,i,o||V.empty)))return!0;if(!o)return!1;let a=EWe(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 mG(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&&y_(e,mG(r),r.getData("text/html"),i,n)?n.preventDefault():RWe(e,n)};class $We{constructor(t,n,r){this.slice=t,this.move=n,this.node=r}}const gG=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(aC(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:l,text:u,slice:c}=aG(e,s);(!n.dataTransfer.files.length||!El||nG>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Uh?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Uh||n.dataTransfer.setData("text/plain",u),e.dragging=new $We(c,!n[gG],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(aC(n));if(!i)return;let o=e.state.doc.resolve(i.pos),a=r&&r.slice;a?e.someProp("transformPasted",m=>{a=m(a,e)}):a=sG(e,mG(n.dataTransfer),Uh?null:n.dataTransfer.getData("text/html"),!1,o);let s=!!(r&&!n[gG]);if(e.someProp("handleDrop",m=>m(e,n,a||V.empty,s))){n.preventDefault();return}if(!a)return;n.preventDefault();let l=a?VPe(e.state.doc,o.pos,a):o.pos;l==null&&(l=o.pos);let u=e.state.tr;if(s){let{node:m}=r;m?m.replace(u):u.deleteSelection()}let c=u.mapping.map(l),f=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,p=u.doc;if(f?u.replaceRangeWith(c,c,a.content.firstChild):u.replaceRange(c,c,a),u.doc.eq(p))return;let h=u.doc.resolve(c);if(f&&xe.isSelectable(a.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(a.content.firstChild))u.setSelection(new xe(h));else{let m=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach((g,y,C,_)=>m=_),u.setSelection(iG(e,h,u.doc.resolve(m)))}e.focus(),e.dispatch(u.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())&&fF(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(El&&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,XY(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 Nv{constructor(t,n){this.toDOM=t,this.spec=n||nu,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 fr(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof Nv&&(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||nu}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 fr(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 kWe=class vG{constructor(t,n){this.attrs=t,this.spec=n||nu}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 fr(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 vG&&Bh(this.attrs,t.attrs)&&Bh(this.spec,t.spec)}destroy(){}};class fr{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new fr(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 fr(t,t,new Nv(n,r))}static inline(t,n,r,i){return new fr(t,n,new Fs(r,i))}static node(t,n,r,i){return new fr(t,n,new kWe(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Fs}get widget(){return this.type instanceof Nv}}const Hc=[],nu={};class Ot{constructor(t,n){this.local=t.length?t:Hc,this.children=n.length?n:Hc}static create(t,n){return n.length?Kv(n,t,0,nu):lr}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==lr||t.maps.length==0?this:this.mapInner(t,n,0,0,r||nu)}mapInner(t,n,r,i,o){let a;for(let s=0;s<this.local.length;s++){let l=this.local[s].map(t,r,i);l&&l.type.valid(n,l)?(a||(a=[])).push(l):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?OWe(this.children,a||[],t,n,r,i,o):a?new Ot(a.sort(ru),Hc):lr}add(t,n){return n.length?this==lr?Ot.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,o=0;t.forEach((s,l)=>{let u=l+r,c;if(c=bG(n,s,u)){for(i||(i=this.children.slice());o<i.length&&i[o]<l;)o+=3;i[o]==l?i[o+2]=i[o+2].addInner(s,c,u+1):i.splice(o,0,l,l+s.nodeSize,Kv(c,s,u+1,nu)),o+=3}});let a=yG(o?CG(n):n,-r);for(let s=0;s<a.length;s++)a[s].type.valid(t,a[s])||a.splice(s--,1);return new Ot(a.length?this.local.concat(a).sort(ru):this.local,i||this.children)}remove(t){return t.length==0||this==lr?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,l=r[o+1]+n;for(let c=0,f;c<t.length;c++)(f=t[c])&&f.from>s&&f.to<l&&(t[c]=null,(a||(a=[])).push(f));if(!a)continue;r==this.children&&(r=this.children.slice());let u=r[o+2].removeInner(a,s+1);u!=lr?r[o+2]=u:(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 Ot(i,r):lr}forChild(t,n){if(this==lr)return this;if(n.isLeaf)return Ot.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 l=this.local[s];if(l.from<a&&l.to>o&&l.type instanceof Fs){let u=Math.max(o,l.from)-o,c=Math.min(a,l.to)-o;u<c&&(i||(i=[])).push(l.copy(u,c))}}if(i){let s=new Ot(i.sort(ru),Hc);return r?new Kl([s,r]):s}return r||lr}eq(t){if(this==t)return!0;if(!(t instanceof Ot)||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 AF(this.localsInner(t))}localsInner(t){if(this==lr)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)}}Ot.empty=new Ot([],[]);Ot.removeOverlap=AF;const lr=Ot.empty;class Kl{constructor(t){this.members=t}map(t,n){const r=this.members.map(i=>i.map(t,n,nu));return Kl.from(r)}forChild(t,n){if(n.isLeaf)return Ot.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(t,n);o!=lr&&(o instanceof Kl?r=r.concat(o.members):r.push(o))}return Kl.from(r)}eq(t){if(!(t instanceof Kl)||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?AF(r?n:n.sort(ru)):Hc}static from(t){switch(t.length){case 0:return lr;case 1:return t[0];default:return new Kl(t.every(n=>n instanceof Ot)?t:t.reduce((n,r)=>n.concat(r instanceof Ot?r:r.members),[]))}}forEachSet(t){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(t)}}function OWe(e,t,n,r,i,o,a){let s=e.slice();for(let u=0,c=o;u<n.maps.length;u++){let f=0;n.maps[u].forEach((p,h,m,g)=>{let y=g-m-(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[u].map(c,-1)}let l=!1;for(let u=0;u<s.length;u+=3)if(s[u+1]<0){if(s[u+1]==-2){l=!0,s[u+1]=-1;continue}let c=n.map(e[u]+o),f=c-i;if(f<0||f>=r.content.size){l=!0;continue}let p=n.map(e[u+1]+o,-1),h=p-i,{index:m,offset:g}=r.content.findIndex(f),y=r.maybeChild(m);if(y&&g==f&&g+y.nodeSize==h){let C=s[u+2].mapInner(n,y,c+1,e[u]+o+1,a);C!=lr?(s[u]=f,s[u+1]=h,s[u+2]=C):(s[u+1]=-2,l=!0)}else l=!0}if(l){let u=MWe(s,e,t,n,i,o,a),c=Kv(u,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 Ot(t.sort(ru),s)}function yG(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 fr(i.from+t,i.to+t,i.type))}return n}function MWe(e,t,n,r,i,o,a){function s(l,u){for(let c=0;c<l.local.length;c++){let f=l.local[c].map(r,i,u);f?n.push(f):a.onRemove&&a.onRemove(l.local[c].spec)}for(let c=0;c<l.children.length;c+=3)s(l.children[c+2],l.children[c]+u+1)}for(let l=0;l<e.length;l+=3)e[l+1]==-1&&s(e[l+2],t[l]+o+1);return n}function bG(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 CG(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Kv(e,t,n,r){let i=[],o=!1;t.forEach((s,l)=>{let u=bG(e,s,l+n);if(u){o=!0;let c=Kv(u,s,n+l+1,r);c!=lr&&i.push(l,l+s.nodeSize,c)}});let a=yG(o?CG(e):e,-n).sort(ru);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 Ot(a,i):lr}function ru(e,t){return e.from-t.from||e.to-t.to}function AF(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&&ru(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:"'"},qv={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},FWe=typeof navigator<"u"&&/Mac/.test(navigator.platform),jWe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var $n=0;$n<10;$n++)zs[48+$n]=zs[96+$n]=String($n);for(var $n=1;$n<=24;$n++)zs[$n+111]="F"+$n;for(var $n=65;$n<=90;$n++)zs[$n]=String.fromCharCode($n+32),qv[$n]=String.fromCharCode($n);for(var NS in zs)qv.hasOwnProperty(NS)||(qv[NS]=zs[NS]);function LWe(e){var t=FWe&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||jWe&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?qv: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 DWe=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function UWe(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 l=t[s];if(/^(cmd|meta|m)$/i.test(l))a=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))DWe?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),a&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function BWe(e){let t=Object.create(null);for(let n in e)t[UWe(n)]=e[n];return t}function KS(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 PWe(e){return new Sn({props:{handleKeyDown:SG(e)}})}function SG(e){let t=BWe(e);return function(n,r){let i=LWe(r),o,a=t[KS(i,r)];if(a&&a(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let s=t[KS(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[KS(o,r)];if(s&&s(n.state,n.dispatch,n))return!0}}return!1}}const wG=65535,_G=Math.pow(2,16);function WWe(e,t){return e+t*_G}function _2(e){return e&wG}function NWe(e){return(e-(e&wG))/_G}const xG=1,TG=2,Vg=4,IG=8;let x2=class{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&IG)>0}get deletedBefore(){return(this.delInfo&(xG|Vg))>0}get deletedAfter(){return(this.delInfo&(TG|Vg))>0}get deletedAcross(){return(this.delInfo&Vg)>0}},xu=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+NWe(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 l=this.ranges[s]-(this.inverted?i:0);if(l>t)break;let u=this.ranges[s+o],c=this.ranges[s+a],f=l+u;if(t<=f){let p=u?t==l?-1:t==f?1:n:n,h=l+i+(p<0?0:c);if(r)return h;let m=t==(n<0?l:f)?null:WWe(s/3,t-l),g=t==l?TG:t==f?xG:Vg;return(n<0?t!=l:t!=f)&&(g|=IG),new x2(h,g,m)}i+=c-u}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 l=this.ranges[s]-(this.inverted?r:0);if(l>t)break;let u=this.ranges[s+o],c=l+u;if(t<=c&&s==i*3)return!0;r+=this.ranges[s+a]-u}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),l=a+(this.inverted?0:o),u=this.ranges[i+n],c=this.ranges[i+r];t(s,s+u,l,l+c),o+=c-u}}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])}};xu.empty=new xu([]);const qS=Object.create(null);let ir=class{getMap(){return xu.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 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 wu)return Mp.fail(o.message);throw o}}};function mF(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(mF(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return q.fromArray(r)}let EG=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(mF(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 RG(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",EG);let RG=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(mF(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 EG(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",RG);let $G=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 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 Lp(this.pos,n.marks[i]);return new Lp(this.pos,this.mark)}}return new kG(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",$G);let kG=class b_ extends ir{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 $G(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new b_(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 b_(n.pos,t.markFromJSON(n.mark))}};ir.jsonID("removeNodeMark",kG);let OG=class Ul 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&&C_(t,this.from,this.to)?pr.fail("Structure replace would overwrite content"):pr.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new xu([this.from,this.to-this.from,this.slice.size])}invert(t){return new Ul(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 Ul(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof Ul)||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 Ul(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 Ul(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 Ul(n.from,n.to,V.fromJSON(t,n.slice),!!n.structure)}};ir.jsonID("replace",OG);let MG=class zg 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&&(C_(t,this.from,this.gapFrom)||C_(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 xu([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 zg(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 zg(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 zg(n.from,n.to,n.gapFrom,n.gapTo,V.fromJSON(t,n.slice),n.insert,!!n.structure)}};ir.jsonID("replaceAround",MG);function C_(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 KWe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function qWe(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||!KWe(i,o,a))break}return null}function VWe(e,t,n=null,r=e){let i=zWe(e,t),o=i&&QWe(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 zWe(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 QWe(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 l=(a.length?a[a.length-1]:t).contentMatch;for(let u=r;l&&u<i;u++)l=l.matchType(n.child(u).type);return!l||!l.validEnd?null:a}function Qg(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 u=i.depth-1,c=n-2;u>o;u--,c--){let f=i.node(u),p=i.index(u);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(p,f.childCount),m=r&&r[c+1];m&&(h=h.replaceChild(0,m.type.create(m.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),l=r&&r[0];return i.node(o).canReplaceWith(s,s,l?l.type:i.node(o+1).type)}function gF(e,t){let n=e.resolve(t),r=n.index();return FG(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function HWe(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 FG(e,t){return!!(e&&t&&!e.isLeaf&&HWe(e,t))}function jG(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&&FG(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 YWe=class Hg 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 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 xu.empty}invert(t){return new Hg(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 Hg(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 Hg(n.pos,n.attr,n.value)}};ir.jsonID("attr",YWe);let GWe=class S_ 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 pr.ok(r)}getMap(){return xu.empty}invert(t){return new S_(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 S_(n.attr,n.value)}};ir.jsonID("docAttr",GWe);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 LG=65535,DG=Math.pow(2,16);function JWe(e,t){return e+t*DG}function I2(e){return e&LG}function ZWe(e){return(e-(e&LG))/DG}const UG=1,BG=2,Yg=4,PG=8;let E2=class{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&PG)>0}get deletedBefore(){return(this.delInfo&(UG|Yg))>0}get deletedAfter(){return(this.delInfo&(BG|Yg))>0}get deletedAcross(){return(this.delInfo&Yg)>0}},Tu=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+ZWe(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 l=this.ranges[s]-(this.inverted?i:0);if(l>t)break;let u=this.ranges[s+o],c=this.ranges[s+a],f=l+u;if(t<=f){let p=u?t==l?-1:t==f?1:n:n,h=l+i+(p<0?0:c);if(r)return h;let m=t==(n<0?l:f)?null:JWe(s/3,t-l),g=t==l?BG:t==f?UG:Yg;return(n<0?t!=l:t!=f)&&(g|=PG),new E2(h,g,m)}i+=c-u}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 l=this.ranges[s]-(this.inverted?r:0);if(l>t)break;let u=this.ranges[s+o],c=l+u;if(t<=c&&s==i*3)return!0;r+=this.ranges[s+a]-u}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),l=a+(this.inverted?0:o),u=this.ranges[i+n],c=this.ranges[i+r];t(s,s+u,l,l+c),o+=c-u}}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])}};Tu.empty=new Tu([]);const VS=Object.create(null);let or=class{getMap(){return Tu.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=VS[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 VS)throw new RangeError("Duplicate use of step JSON ID "+t);return VS[t]=n,n.prototype.jsonID=t,n}},hr=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 wu)return Dp.fail(o.message);throw o}}};function vF(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(vF(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return q.fromArray(r)}let WG=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(vF(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 hr.fromReplace(t,this.from,this.to,o)}invert(){return new NG(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",WG);let NG=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(vF(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return hr.fromReplace(t,this.from,this.to,r)}invert(){return new WG(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",NG);let KG=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 hr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return hr.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 qG(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",KG);let qG=class w_ extends or{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return hr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return hr.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 KG(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new w_(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 w_(n.pos,t.markFromJSON(n.mark))}};or.jsonID("removeNodeMark",qG);let sC=class Bl 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&&__(t,this.from,this.to)?hr.fail("Structure replace would overwrite content"):hr.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Tu([this.from,this.to-this.from,this.slice.size])}invert(t){return new Bl(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 Bl(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof Bl)||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 Bl(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 Bl(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 Bl(n.from,n.to,V.fromJSON(t,n.slice),!!n.structure)}};or.jsonID("replace",sC);let Vv=class Gg 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&&(__(t,this.from,this.gapFrom)||__(t,this.gapTo,this.to)))return hr.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return hr.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?hr.fromReplace(t,this.from,this.to,r):hr.fail("Content does not fit in gap")}getMap(){return new Tu([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 Gg(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 Gg(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 Gg(n.from,n.to,n.gapFrom,n.gapTo,V.fromJSON(t,n.slice),n.insert,!!n.structure)}};or.jsonID("replaceAround",Vv);function __(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 XWe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function lC(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||!XWe(i,o,a))break}return null}function eNe(e,t,n=null,r=e){let i=tNe(e,t),o=i&&nNe(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 tNe(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 nNe(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 l=(a.length?a[a.length-1]:t).contentMatch;for(let u=r;l&&u<i;u++)l=l.matchType(n.child(u).type);return!l||!l.validEnd?null:a}function rNe(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 u=i.depth-1,c=n-2;u>o;u--,c--){let f=i.node(u),p=i.index(u);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(p,f.childCount),m=r&&r[c+1];m&&(h=h.replaceChild(0,m.type.create(m.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),l=r&&r[0];return i.node(o).canReplaceWith(s,s,l?l.type:i.node(o+1).type)}function uC(e,t){let n=e.resolve(t),r=n.index();return VG(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function iNe(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 VG(e,t){return!!(e&&t&&!e.isLeaf&&iNe(e,t))}function zG(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&&VG(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 yF(e,t,n=t,r=V.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return oNe(i,o,r)?new sC(t,n,r):new aNe(i,o,r).fit()}function oNe(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}let aNe=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 u=this.findFittable();u?this.placeNodes(u):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 l=new V(o,a,s);return t>-1?new Vv(r.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new sC(r.pos,i.pos,l):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=zS(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:l,match:u}=this.frontier[s],c,f=null;if(n==1&&(a?u.matchType(a.type)||(f=u.fillBefore(q.from(a),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:s,parent:o,inject:f};if(n==2&&a&&(c=u.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:s,parent:o,wrap:c};if(o&&u.matchType(o.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=zS(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=zS(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,l=a.openStart-t,u=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(;u<s.childCount;){let g=s.child(u),y=f.matchType(g.type);if(!y)break;u++,(u>1||l==0||g.content.size)&&(f=y,c.push(QG(g.mark(p.allowedMarks(g.marks)),u==1?l:0,u==s.childCount?h:-1)))}let m=u==s.childCount;m||(h=-1),this.placed=Np(this.placed,n,q.from(c)),this.frontier[n].match=f,m&&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=m?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,u),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!QS(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=QS(t,n,i,r,o);if(a){for(let s=n-1;s>=0;s--){let{match:l,type:u}=this.frontier[s],c=QS(t,s,u,l,!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 zS(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function QG(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,QG(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 QS(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&&!sNe(n,o.content,a)?s:null}function sNe(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}let lNe=class Jg 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 hr.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 hr.fromReplace(t,this.pos,this.pos+1,new V(q.from(i),0,n.isLeaf?0:1))}getMap(){return Tu.empty}invert(t){return new Jg(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 Jg(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 Jg(n.pos,n.attr,n.value)}};or.jsonID("attr",lNe);let uNe=class x_ 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 hr.ok(r)}getMap(){return Tu.empty}invert(t){return new x_(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 x_(n.attr,n.value)}};or.jsonID("docAttr",uNe);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 cNe=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function HG(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const dNe=(e,t,n)=>{let r=HG(e,n);if(!r)return!1;let i=bF(r);if(!i){let a=r.blockRange(),s=a&&lC(a);return s==null?!1:(t&&t(e.tr.lift(a,s).scrollIntoView()),!0)}let o=i.nodeBefore;if(ZG(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=yF(e.doc,r.before(a),r.after(a),V.empty);if(s&&s.slice.size<s.to-s.from){if(t){let l=e.tr.step(s);l.setSelection($d(o,"end")?je.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):xe.create(l.doc,i.pos-o.nodeSize)),t(l.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},fNe=(e,t,n)=>{let r=HG(e,n);if(!r)return!1;let i=bF(r);return i?YG(e,i,t):!1},pNe=(e,t,n)=>{let r=GG(e,n);if(!r)return!1;let i=CF(r);return i?YG(e,i,t):!1};function YG(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,l=t.pos+1;for(;!s.isTextblock;l++){if(s.type.spec.isolating)return!1;let c=s.firstChild;if(!c)return!1;s=c}let u=yF(e.doc,o,l,V.empty);if(!u||u.from!=o||u instanceof sC&&u.slice.size>=l-o)return!1;if(n){let c=e.tr.step(u);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 hNe=(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=bF(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 bF(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 GG(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const ANe=(e,t,n)=>{let r=GG(e,n);if(!r)return!1;let i=CF(r);if(!i)return!1;let o=i.nodeAfter;if(ZG(e,i,t,1))return!0;if(r.parent.content.size==0&&($d(o,"start")||xe.isSelectable(o))){let a=yF(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},mNe=(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=CF(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 CF(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 gNe=(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=zG(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},vNe=(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=zG(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},yNe=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&lC(i);return o==null?!1:(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)},bNe=(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 JG(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 CNe=(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=JG(i.contentMatchAt(o));if(!a||!i.canReplaceWith(o,o,a))return!1;if(t){let s=n.after(),l=e.tr.replaceWith(s,s,a.createAndFill());l.setSelection(je.near(l.doc.resolve(s),1)),t(l.scrollIntoView())}return!0},SNe=(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=JG(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},wNe=(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(rNe(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&lC(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},_Ne=(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 xNe(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 ZG(e,t,n,r){let i=t.nodeBefore,o=t.nodeAfter,a,s,l=i.type.spec.isolating||o.type.spec.isolating;if(!l&&xNe(e,t,n))return!0;let u=!l&&t.parent.canReplace(t.index(),t.index()+1);if(u&&(a=(s=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&s.matchType(a[0]||o.type).validEnd){if(n){let h=t.pos+o.nodeSize,m=q.empty;for(let C=a.length-1;C>=0;C--)m=q.from(a[C].create(null,m));m=q.from(i.copy(m));let g=e.tr.step(new Vv(t.pos-1,h,t.pos,h,new V(m,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&&l?null:je.findFrom(t,1),f=c&&c.$from.blockRange(c.$to),p=f&&lC(f);if(p!=null&&p>=t.depth)return n&&n(e.tr.lift(f,p).scrollIntoView()),!0;if(u&&$d(o,"start",!0)&&$d(i,"end")){let h=i,m=[];for(;m.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=m.length-1;b>=0;b--)C=q.from(m[b].copy(C));let _=e.tr.step(new Vv(t.pos-m.length,t.pos+o.nodeSize,t.pos+y,t.pos+o.nodeSize-y,new V(C,m.length,0),0,!0));n(_.scrollIntoView())}return!0}}return!1}function XG(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 TNe=XG(-1),INe=XG(1);function ENe(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),s=a&&eNe(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,(l,u)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(e,t)))if(l.type==e)i=!0;else{let c=n.doc.resolve(u),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:l}}=n.selection.ranges[a];o.setBlockType(s,l,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 RNe(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),s=!1,l=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);l=new Dv(c,c,a.depth),a.endIndex<a.parent.childCount&&(a=new Dv(i,n.doc.resolve(o.end(a.depth)),a.depth)),s=!0}let u=BPe(l,e,t,a);return u?(r&&r($Ne(n.tr,a,u,s,e).scrollIntoView()),!0):!1}}function $Ne(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,l=t.start+n.length-(r?2:0),u=t.parent;for(let c=t.startIndex,f=t.endIndex,p=!0;c<f;c++,p=!1)!p&&NPe(e.doc,l,s)&&(e.split(l,s),l+=2*s),l+=u.child(c).nodeSize;return e}function kNe(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?ONe(t,n,e,o):MNe(t,n,o):!0:!1}}function ONe(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 Dv(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const s=UPe(r);if(s==null)return!1;i.lift(r,s);let l=i.mapping.map(o,-1)-1;return KPe(i.doc,l)&&i.join(l),t(i.scrollIntoView()),!0}function MNe(e,t,n){let r=e.tr,i=n.parent;for(let h=n.end,m=n.endIndex-1,g=n.startIndex;m>g;m--)h-=i.child(m).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,l=n.endIndex==i.childCount,u=o.node(-1),c=o.index(-1);if(!u.canReplace(c+(s?0:1),c+1,a.content.append(l?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+(l?1:0),f+1,p-1,new V((s?q.empty:q.from(i.copy(q.empty))).append(l?q.empty:q.from(i.copy(q.empty))),s?0:1,l?0:1),s?0:1)),t(r.scrollIntoView()),!0}function FNe(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,u=>u.childCount>0&&u.firstChild.type==e);if(!o)return!1;let a=o.startIndex;if(a==0)return!1;let s=o.parent,l=s.child(a-1);if(l.type!=e)return!1;if(n){let u=l.lastChild&&l.lastChild.type==s.type,c=q.from(u?e.create():null),f=new V(q.from(e.create(null,q.from(s.type.create(null,c)))),u?3:1,0),p=o.start,h=o.end;n(t.tr.step(new pp(p-(u?3:1),h,p,h,f,1,!0)).scrollIntoView())}return!0}}function cC(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 SF{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,l])=>[s,(...c)=>{const f=l(...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=[],l=!!t,u=t||o.tr,c=()=>(!l&&n&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(u),s.every(p=>p===!0)),f={...Object.fromEntries(Object.entries(r).map(([p,h])=>[p,(...g)=>{const y=this.buildProps(u,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(([l,u])=>[l,(...c)=>u(...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:cC({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(([l,u])=>[l,(...c)=>u(...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 dC(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 eJ(e){const t=[],{nodeExtensions:n,markExtensions:r}=dC(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},l=de(a,"addGlobalAttributes",s);if(!l)return;l().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},l=de(a,"addAttributes",s);if(!l)return;const u=l();Object.entries(u).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 sn(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 xt(...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(" "):[],l=r[i]?r[i].split(" "):[],u=s.filter(c=>!l.includes(c));r[i]=[...l,...u].join(" ")}else if(i==="style"){const s=o?o.split(";").map(c=>c.trim()).filter(Boolean):[],l=r[i]?r[i].split(";").map(c=>c.trim()).filter(Boolean):[],u=new Map;l.forEach(c=>{const[f,p]=c.split(":").map(h=>h.trim());u.set(f,p)}),s.forEach(c=>{const[f,p]=c.split(":").map(h=>h.trim());u.set(f,p)}),r[i]=Array.from(u.entries()).map(([c,f])=>`${c}: ${f}`).join("; ")}else r[i]=o}),r},{})}function zv(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)=>xt(n,r),{})}function jNe(e){return typeof e=="function"}function We(e,t=void 0,...n){return jNe(e)?t?e.bind(t)(...n):e(...n):e}function LNe(e={}){return Object.keys(e).length===0&&e.constructor===Object}function DNe(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):DNe(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"&&LNe(n)?!1:n!=null))}function tJ(e,t){var n;const r=eJ(e),{nodeExtensions:i,markExtensions:o}=dC(e),a=(n=i.find(u=>de(u,"topNode")))===null||n===void 0?void 0:n.name,s=Object.fromEntries(i.map(u=>{const c=r.filter(C=>C.type===u.name),f={name:u.name,options:u.options,storage:u.storage,editor:t},p=e.reduce((C,_)=>{const b=de(_,"extendNodeSchema",f);return{...C,...b?b(u):{}}},{}),h=O2({...p,content:We(de(u,"content",f)),marks:We(de(u,"marks",f)),group:We(de(u,"group",f)),inline:We(de(u,"inline",f)),atom:We(de(u,"atom",f)),selectable:We(de(u,"selectable",f)),draggable:We(de(u,"draggable",f)),code:We(de(u,"code",f)),whitespace:We(de(u,"whitespace",f)),linebreakReplacement:We(de(u,"linebreakReplacement",f)),defining:We(de(u,"defining",f)),isolating:We(de(u,"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}]}))}),m=We(de(u,"parseHTML",f));m&&(h.parseDOM=m.map(C=>k2(C,c)));const g=de(u,"renderHTML",f);g&&(h.toDOM=C=>g({node:C,HTMLAttributes:zv(C,c)}));const y=de(u,"renderText",f);return y&&(h.toText=y),[u.name,h]})),l=Object.fromEntries(o.map(u=>{const c=r.filter(y=>y.type===u.name),f={name:u.name,options:u.options,storage:u.storage,editor:t},p=e.reduce((y,C)=>{const _=de(C,"extendMarkSchema",f);return{...y,..._?_(u):{}}},{}),h=O2({...p,inclusive:We(de(u,"inclusive",f)),excludes:We(de(u,"excludes",f)),group:We(de(u,"group",f)),spanning:We(de(u,"spanning",f)),code:We(de(u,"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}]}))}),m=We(de(u,"parseHTML",f));m&&(h.parseDOM=m.map(y=>k2(y,c)));const g=de(u,"renderHTML",f);return g&&(h.toDOM=y=>g({mark:y,HTMLAttributes:zv(y,c)})),[u.name,h]}));return new jY({topNode:a,nodes:s,marks:l})}function HS(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 nJ(e,t){const n=Ym.fromSchema(t).serializeFragment(e),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}const UNe=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(i,o,a,s)=>{var l,u;const c=((u=(l=i.type.spec).toText)===null||u===void 0?void 0:u.call(l,{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 wF(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class _F{constructor(t){this.find=t.find,this.handler=t.handler}}const BNe=(e,t)=>{if(wF(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 Tg(e){var t;const{editor:n,from:r,to:i,text:o,rules:a,plugin:s}=e,{view:l}=n;if(l.composing)return!1;const u=l.state.doc.resolve(r);if(u.parent.type.spec.code||!((t=u.nodeBefore||u.nodeAfter)===null||t===void 0)&&t.marks.find(p=>p.type.spec.code))return!1;let c=!1;const f=UNe(u)+o;return a.forEach(p=>{if(c)return;const h=BNe(f,p.find);if(!h)return;const m=l.state.tr,g=cC({state:l.state,transaction:m}),y={from:r-(h[0].length-o.length),to:i},{commands:C,chain:_,can:b}=new SF({editor:n,state:g});p.handler({state:g,range:y,match:h,commands:C,chain:_,can:b})===null||!m.steps.length||(m.setMeta(s,{transform:m,from:r,to:i,text:o}),l.dispatch(m),c=!0)}),c}function PNe(e){const{editor:t,rules:n}=e,r=new Sn({state:{init(){return null},apply(i,o,a){const s=i.getMeta(r);if(s)return s;const l=i.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:c}=l;typeof c=="string"?c=c:c=nJ(q.from(c),a.schema);const{from:f}=l,p=f+c.length;Tg({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 Tg({editor:t,from:o,to:a,text:s,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Tg({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?Tg({editor:t,from:a.pos,to:a.pos,text:`
78
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function WNe(e){return Object.prototype.toString.call(e).slice(8,-1)}function Ig(e){return WNe(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function fC(e,t){const n={...e};return Ig(e)&&Ig(t)&&Object.keys(t).forEach(r=>{Ig(t[r])&&Ig(e[r])?n[r]=fC(e[r],t[r]):n[r]=t[r]}),n}let Zm=class T_{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 T_(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>fC(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new T_(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(u=>(u==null?void 0:u.type.name)===n.name))return!1;const l=a.find(u=>(u==null?void 0:u.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}};function NNe(e){return typeof e=="number"}class KNe{constructor(t){this.find=t.find,this.handler=t.handler}}const qNe=(e,t,n)=>{if(wF(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 VNe(e){const{editor:t,state:n,from:r,to:i,rule:o,pasteEvent:a,dropEvent:s}=e,{commands:l,chain:u,can:c}=new SF({editor:t,state:n}),f=[];return n.doc.nodesBetween(r,i,(h,m)=>{if(!h.isTextblock||h.type.spec.code)return;const g=Math.max(r,m),y=Math.min(i,m+h.content.size),C=h.textBetween(g-m,y-m,void 0,"");qNe(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:l,chain:u,can:c,pasteEvent:a,dropEvent:s});f.push(T)})}),f.every(h=>h!==null)}let Eg=null;const zNe=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 QNe(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 l=({state:c,from:f,to:p,rule:h,pasteEvt:m})=>{const g=c.tr,y=cC({state:c,transaction:g});if(!(!VNe({editor:t,state:y,from:Math.max(f-1,0),to:p.b-1,rule:h,pasteEvent:m,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 Sn({view(f){const p=m=>{var g;r=!((g=f.dom.parentElement)===null||g===void 0)&&g.contains(m.target)?f.dom.parentElement:null,r&&(Eg=t)},h=()=>{Eg&&(Eg=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=Eg;h&&setTimeout(()=>{const m=h.state.selection;m&&h.commands.deleteRange({from:m.from,to:m.to})},10)}return!1},paste:(f,p)=>{var h;const m=(h=p.clipboardData)===null||h===void 0?void 0:h.getData("text/html");return a=p,i=!!(m!=null&&m.includes("data-pm-slice")),!1}}},appendTransaction:(f,p,h)=>{const m=f[0],g=m.getMeta("uiEvent")==="paste"&&!i,y=m.getMeta("uiEvent")==="drop"&&!o,C=m.getMeta("applyPasteRules"),_=!!C;if(!g&&!y&&!_)return;if(_){let{text:S}=C;typeof S=="string"?S=S:S=nJ(q.from(S),h.schema);const{from:w}=C,T=w+S.length,E=zNe(S);return l({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(!(!NNe(b)||!v||b===v.b))return l({rule:c,state:h,from:b,to:v,pasteEvt:a})}}))}function HNe(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=tJ(this.extensions,n),this.setupExtensions()}static resolve(t){const n=td.sort(td.flatten(t)),r=HNe(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:HS(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:HS(a.name,this.schema)},l=[],u=de(a,"addKeyboardShortcuts",s);let c={};if(a.type==="mark"&&de(a,"exitable",s)&&(c.ArrowRight=()=>Zm.handleExit({editor:t,mark:a})),u){const g=Object.fromEntries(Object.entries(u()).map(([y,C])=>[y,()=>C({editor:t})]));c={...c,...g}}const f=PWe(c);l.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 m=de(a,"addProseMirrorPlugins",s);if(m){const g=m();l.push(...g)}return l}).flat();return[PNe({editor:t,rules:r}),...QNe({editor:t,rules:i}),...o]}get attributes(){return eJ(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:n}=dC(this.extensions);return Object.fromEntries(n.filter(r=>!!de(r,"addNodeView")).map(r=>{const i=this.attributes.filter(l=>l.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:t,type:sn(r.name,this.schema)},a=de(r,"addNodeView",o);if(!a)return[];const s=(l,u,c,f,p)=>{const h=zv(l,i);return a()({node:l,view:u,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:HS(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),l=de(t,"onTransaction",r),u=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),l&&this.editor.on("transaction",l),u&&this.editor.on("focus",u),c&&this.editor.on("blur",c),f&&this.editor.on("destroy",f)})}}class jn{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 jn(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>fC(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new jn({...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 YNe(e,t,n){const{from:r,to:i}=t,{blockSeparator:o=`
79
+
80
+ `,textSerializers:a={}}=n||{};let s="";return e.nodesBetween(r,i,(l,u,c,f)=>{var p;l.isBlock&&u>r&&(s+=o);const h=a==null?void 0:a[l.type.name];if(h)return c&&(s+=h({node:l,pos:u,parent:c,index:f,range:t})),!1;l.isText&&(s+=(p=l==null?void 0:l.text)===null||p===void 0?void 0:p.slice(Math.max(r,u)-u,i-u))}),s}function GNe(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}jn.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Sn({key:new qn("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)),l=GNe(n);return YNe(r,{from:a,to:s},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}});const JNe=()=>({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),ZNe=(e=!1)=>({commands:t})=>t.setContent("",e),XNe=()=>({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,l)=>{if(s.type.isText)return;const{doc:u,mapping:c}=t,f=u.resolve(c.map(l)),p=u.resolve(c.map(l+s.nodeSize)),h=f.blockRange(p);if(!h)return;const m=qWe(h);if(s.type.isTextblock){const{defaultType:g}=f.parent.contentMatchAt(f.index());t.setNodeMarkup(h.start,g)}(m||m===0)&&t.lift(h,m)})}),!0},eKe=e=>t=>e(t),tKe=()=>({state:e,dispatch:t})=>SNe(e,t),nKe=(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},rKe=()=>({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),l=i.after(o);e.delete(s,l).scrollIntoView()}return!0}return!1},iKe=e=>({tr:t,state:n,dispatch:r})=>{const i=sn(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 l=o.before(a),u=o.after(a);t.delete(l,u).scrollIntoView()}return!0}return!1},oKe=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},aKe=()=>({state:e,dispatch:t})=>cNe(e,t),sKe=()=>({commands:e})=>e.keyboardShortcut("Enter"),lKe=()=>({state:e,dispatch:t})=>CNe(e,t);function Qv(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:wF(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function rJ(e,t,n={}){return e.find(r=>r.type===t&&Qv(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function F2(e,t,n={}){return!!rJ(e,t,n)}function xF(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),!rJ([...i.node.marks],t,n)))return;let a=i.index,s=e.start()+i.offset,l=a+1,u=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(;l<e.parent.childCount&&F2([...e.parent.child(l).marks],t,n);)u+=e.parent.child(l).nodeSize,l+=1;return{from:s,to:u}}function Rl(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 uKe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=Rl(e,r.schema),{doc:a,selection:s}=n,{$from:l,from:u,to:c}=s;if(i){const f=xF(l,o,t);if(f&&f.from<=u&&f.to>=c){const p=Oe.create(a,f.from,f.to);n.setSelection(p)}}return!0},cKe=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 TF(e){return e instanceof Oe}function ya(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function dKe(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 iJ(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function pC(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const fKe=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const a=()=>{(pC()||iJ())&&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&&!TF(n.state.selection))return a(),!0;const s=dKe(i.doc,e)||n.state.selection,l=n.state.selection.eq(s);return o&&(l||i.setSelection(s),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},pKe=(e,t)=>n=>e.every((r,i)=>t(r,{...n,index:i})),hKe=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),oJ=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&&oJ(r)}return e};function Rg(e){const t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,"text/html").body;return oJ(n)}function Hv(e,t,n){if(e instanceof eu||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),Hv("",t,n)}if(i){if(n.errorOnInvalidContent){let a=!1,s="";const l=new jY({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:u=>(a=!0,s=typeof u=="string"?u:u.outerHTML,null)}]}})});if(n.slice?tu.fromSchema(l).parseSlice(Rg(e),n.parseOptions):tu.fromSchema(l).parse(Rg(e),n.parseOptions),n.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${s}`)})}const o=tu.fromSchema(t);return n.slice?o.parseSlice(Rg(e),n.parseOptions).content:o.parse(Rg(e),n.parseOptions)}return Hv("",t,n)}function AKe(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof OG||i instanceof MG))return;const o=e.mapping.maps[r];let a=0;o.forEach((s,l,u,c)=>{a===0&&(a=c)}),e.setSelection(je.near(e.doc.resolve(a),n))}const mKe=e=>!("type"in e),gKe=(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=Hv(t,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(a=n.errorOnInvalidContent)!==null&&a!==void 0?a:o.options.enableContentCheck})}catch(m){return o.emit("contentError",{editor:o,error:m,disableCollaboration:()=>{o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}}),!1}let{from:l,to:u}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},c=!0,f=!0;if((mKe(s)?s:[s]).forEach(m=>{m.check(),c=c?m.isText&&m.marks.length===0:!1,f=f?m.isBlock:!1}),l===u&&f){const{parent:m}=r.doc.resolve(l);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(l-=1,u+=1)}let h;if(c){if(Array.isArray(t))h=t.map(m=>m.text||"").join("");else if(t instanceof q){let m="";t.forEach(g=>{g.text&&(m+=g.text)}),h=m}else typeof t=="object"&&t&&t.text?h=t.text:h=t;r.insertText(h,l,u)}else h=s,r.replaceWith(l,u,h);n.updateSelection&&AKe(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:l,text:h}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:l,text:h})}return!0},vKe=()=>({state:e,dispatch:t})=>gNe(e,t),yKe=()=>({state:e,dispatch:t})=>vNe(e,t),bKe=()=>({state:e,dispatch:t})=>dNe(e,t),CKe=()=>({state:e,dispatch:t})=>ANe(e,t),SKe=()=>({state:e,dispatch:t,tr:n})=>{try{const r=jG(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},wKe=()=>({state:e,dispatch:t,tr:n})=>{try{const r=jG(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},_Ke=()=>({state:e,dispatch:t})=>fNe(e,t),xKe=()=>({state:e,dispatch:t})=>pNe(e,t);function aJ(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function TKe(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 l=t[s];if(/^(cmd|meta|m)$/i.test(l))a=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))pC()||aJ()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),a&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}const IKe=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const o=TKe(e).split(/-(?!$)/),a=o.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),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}),l=t.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,s))});return l==null||l.steps.forEach(u=>{const c=u.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?sn(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(f,p)=>{if(f.isText)return;const h=Math.max(r,p),m=Math.min(i,p+f.nodeSize);s.push({node:f,from:h,to:m})});const l=i-r,u=s.filter(f=>a?a.name===f.node.type.name:!0).filter(f=>Qv(f.node.attrs,n,{strict:!1}));return o?!!u.length:u.reduce((f,p)=>f+p.to-p.from,0)>=l}const EKe=(e,t={})=>({state:n,dispatch:r})=>{const i=sn(e,n.schema);return kd(n,i,t)?yNe(n,r):!1},RKe=()=>({state:e,dispatch:t})=>wNe(e,t),$Ke=e=>({state:t,dispatch:n})=>{const r=sn(e,t.schema);return kNe(r)(t,n)},kKe=()=>({state:e,dispatch:t})=>bNe(e,t);function sJ(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 OKe=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null;const s=sJ(typeof e=="string"?e:e.name,r.schema);return s?(s==="node"&&(o=sn(e,r.schema)),s==="mark"&&(a=Rl(e,r.schema)),i&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(u,c)=>{o&&o===u.type&&n.setNodeMarkup(c,void 0,j2(u.attrs,t)),a&&u.marks.length&&u.marks.forEach(f=>{a===f.type&&n.addMark(c,c+u.nodeSize,a.create(j2(f.attrs,t)))})})}),!0):!1},MKe=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),FKe=()=>({tr:e,dispatch:t})=>{if(t){const n=new xi(e.doc);e.setSelection(n)}return!0},jKe=()=>({state:e,dispatch:t})=>hNe(e,t),LKe=()=>({state:e,dispatch:t})=>mNe(e,t),DKe=()=>({state:e,dispatch:t})=>_Ne(e,t),UKe=()=>({state:e,dispatch:t})=>INe(e,t),BKe=()=>({state:e,dispatch:t})=>TNe(e,t);function PKe(e,t,n={},r={}){return Hv(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const WKe=(e,t=!1,n={},r={})=>({editor:i,tr:o,dispatch:a,commands:s})=>{var l,u;const{doc:c}=o;if(n.preserveWhitespace!=="full"){const f=PKe(e,i.schema,n,{errorOnInvalidContent:(l=r.errorOnInvalidContent)!==null&&l!==void 0?l: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:(u=r.errorOnInvalidContent)!==null&&u!==void 0?u:i.options.enableContentCheck})};function NKe(e,t){const n=Rl(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,l=>{a.push(...l.marks)});const s=a.find(l=>l.type.name===n.name);return s?{...s.attrs}:{}}function KKe(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 lJ(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 Xm(e){return t=>lJ(t.$from,e)}function qKe(e,t){const n=td.resolve(e);return tJ(n,t)}function uJ(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(i=>{const o=n.resolve(e),a=xF(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 VKe=(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 Zg(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 zKe(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?Rl(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>Qv(f.attrs,n,{strict:!1}));let a=0;const s=[];if(i.forEach(({$from:f,$to:p})=>{const h=f.pos,m=p.pos;e.doc.nodesBetween(h,m,(g,y)=>{if(!g.isText&&!g.marks.length)return;const C=Math.max(h,y),_=Math.min(m,y+g.nodeSize),b=_-C;a+=b,s.push(...g.marks.map(v=>({mark:v,from:C,to:_})))})}),a===0)return!1;const l=s.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>Qv(f.mark.attrs,n,{strict:!1})).reduce((f,p)=>f+p.to-p.from,0),u=s.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,p)=>f+p.to-p.from,0);return(l>0?l+u:l)>=a}const QKe=(e,t)=>{const{$from:n,$to:r,$anchor:i}=e.selection;if(t){const o=Xm(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)},HKe=e=>{const{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function L2(e,t){const{nodeExtensions:n}=dC(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 IF(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&&(IF(o,{ignoreWhitespace:n,checkChildren:t})||(i=!1))}),i}return!1}function YKe(e){return e instanceof xe}function GKe(e,t,n){const i=e.state.doc.content.size,o=ya(t,0,i),a=ya(n,0,i),s=e.coordsAtPos(o),l=e.coordsAtPos(a,-1),u=Math.min(s.top,l.top),c=Math.max(s.bottom,l.bottom),f=Math.min(s.left,l.left),p=Math.max(s.right,l.right),h=p-f,m=c-u,C={top:u,bottom:c,left:f,right:p,width:h,height:m,x:f,y:u};return{...C,toJSON:()=>C}}function JKe(e,t,n){var r;const{selection:i}=t;let o=null;if(TF(i)&&(o=i.$cursor),o){const s=(r=e.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(s)||!s.some(l=>l.type.excludes(n))}const{ranges:a}=i;return a.some(({$from:s,$to:l})=>{let u=s.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(s.pos,l.pos,(c,f,p)=>{if(u)return!1;if(c.isInline){const h=!p||p.type.allowsMarkType(n),m=!!n.isInSet(c.marks)||!c.marks.some(g=>g.type.excludes(n));u=h&&m}return!u}),u})}const ZKe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:a,ranges:s}=o,l=Rl(e,r.schema);if(i)if(a){const u=NKe(r,l);n.addStoredMark(l.create({...u,...t}))}else s.forEach(u=>{const c=u.$from.pos,f=u.$to.pos;r.doc.nodesBetween(c,f,(p,h)=>{const m=Math.max(h,c),g=Math.min(h+p.nodeSize,f);p.marks.find(C=>C.type===l)?p.marks.forEach(C=>{l===C.type&&n.addMark(m,g,l.create({...C.attrs,...t}))}):n.addMark(m,g,l.create(t))})});return JKe(r,n,l)},XKe=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),e3e=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const o=sn(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)},t3e=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},n3e=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,l=ya(i,a,s),u=ya(o,a,s),c=Oe.create(r,l,u);t.setSelection(c)}return!0},r3e=e=>({state:t,dispatch:n})=>{const r=sn(e,t.schema);return FNe(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 i3e=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:a}=t,{$from:s,$to:l}=o,u=i.extensionManager.attributes,c=Zg(u,s.node().type.name,s.node().attrs);if(o instanceof xe&&o.node.isBlock)return!s.parentOffset||!Qg(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=l.parentOffset===l.parent.content.size,p=s.depth===0?void 0:KKe(s.node(-1).contentMatchAt(s.indexAfter(-1)));let h=f&&p?[{type:p,attrs:c}]:void 0,m=Qg(t.doc,t.mapping.map(s.pos),1,h);if(!h&&!m&&Qg(t.doc,t.mapping.map(s.pos),1,p?[{type:p}]:void 0)&&(m=!0,h=p?[{type:p,attrs:c}]:void 0),r){if(m&&(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 m},o3e=(e,t={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var a;const s=sn(e,r.schema),{$from:l,$to:u}=r.selection,c=r.selection.node;if(c&&c.isBlock||l.depth<2||!l.sameParent(u))return!1;const f=l.node(-1);if(f.type!==s)return!1;const p=o.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==s||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let C=q.empty;const _=l.index(-1)?1:l.index(-2)?2:3;for(let E=l.depth-_;E>=l.depth-3;E-=1)C=q.from(l.node(E).copy(C));const b=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,v={...Zg(p,l.node().type.name,l.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=l.before(l.depth-(_-1));n.replace(w,l.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=u.pos===l.end()?f.contentMatchAt(0).defaultType:null,m={...Zg(p,f.type.name,f.attrs),...t},g={...Zg(p,l.node().type.name,l.node().attrs),...t};n.delete(l.pos,u.pos);const y=h?[{type:s,attrs:m},{type:h,attrs:g}]:[{type:s,attrs:m}];if(!Qg(n.doc,l.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(l.pos,2,y).scrollIntoView(),!v||!i)return!0;const S=v.filter(w=>b.includes(w.type.name));n.ensureMarks(S)}return!0},YS=(e,t)=>{const n=Xm(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)&&gF(e.doc,n.pos)&&e.join(n.pos),!0},GS=(e,t)=>{const n=Xm(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)&&gF(e.doc,r)&&e.join(r),!0},a3e=(e,t,n,r={})=>({editor:i,tr:o,state:a,dispatch:s,chain:l,commands:u,can:c})=>{const{extensions:f,splittableMarks:p}=i.extensionManager,h=sn(e,a.schema),m=sn(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=Xm(w=>L2(w.type.name,f))(g);if(b.depth>=1&&S&&b.depth-S.depth<=1){if(S.node.type===h)return u.liftListItem(m);if(L2(S.node.type.name,f)&&h.validContent(S.node.content)&&s)return l().command(()=>(o.setNodeMarkup(S.pos,h),!0)).command(()=>YS(o,h)).command(()=>GS(o,h)).run()}return!n||!v||!s?l().command(()=>c().wrapInList(h,r)?!0:u.clearNodes()).wrapInList(h,r).command(()=>YS(o,h)).command(()=>GS(o,h)).run():l().command(()=>{const w=c().wrapInList(h,r),T=v.filter(E=>p.includes(E.type.name));return o.ensureMarks(T),w?!0:u.clearNodes()}).wrapInList(h,r).command(()=>YS(o,h)).command(()=>GS(o,h)).run()},s3e=(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,a=Rl(e,r.schema);return zKe(r,a,t)?i.unsetMark(a,{extendEmptyMarkRange:o}):i.setMark(a,t)},l3e=(e,t,n={})=>({state:r,commands:i})=>{const o=sn(e,r.schema),a=sn(t,r.schema),s=kd(r,o,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),s?i.setNode(a,l):i.setNode(o,{...l,...n})},u3e=(e,t={})=>({state:n,commands:r})=>{const i=sn(e,n.schema);return kd(n,i,t)?r.lift(i):r.wrapIn(i,t)},c3e=()=>({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 l=s.steps.length-1;l>=0;l-=1)a.step(s.steps[l].invert(s.docs[l]));if(o.text){const l=a.doc.resolve(o.from).marks();a.replaceWith(o.from,o.to,e.schema.text(o.text,l))}else a.delete(o.from,o.to)}return!0}}return!1},d3e=()=>({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},f3e=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:a=!1}=t,{selection:s}=n,l=Rl(e,r.schema),{$from:u,empty:c,ranges:f}=s;if(!i)return!0;if(c&&a){let{from:p,to:h}=s;const m=(o=u.marks().find(y=>y.type===l))===null||o===void 0?void 0:o.attrs,g=xF(u,l,m);g&&(p=g.from,h=g.to),n.removeMark(p,h,l)}else f.forEach(p=>{n.removeMark(p.$from.pos,p.$to.pos,l)});return n.removeStoredMark(l),!0},p3e=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null;const s=sJ(typeof e=="string"?e:e.name,r.schema);return s?(s==="node"&&(o=sn(e,r.schema)),s==="mark"&&(a=Rl(e,r.schema)),i&&n.selection.ranges.forEach(l=>{const u=l.$from.pos,c=l.$to.pos;let f,p,h,m;n.selection.empty?r.doc.nodesBetween(u,c,(g,y)=>{o&&o===g.type&&(h=Math.max(y,u),m=Math.min(y+g.nodeSize,c),f=y,p=g)}):r.doc.nodesBetween(u,c,(g,y)=>{y<u&&o&&o===g.type&&(h=Math.max(y,u),m=Math.min(y+g.nodeSize,c),f=y,p=g),y>=u&&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,u),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,m,a.create({...g.attrs,...t}))}))}),!0):!1},h3e=(e,t={})=>({state:n,dispatch:r})=>{const i=sn(e,n.schema);return ENe(i,t)(n,r)},A3e=(e,t={})=>({state:n,dispatch:r})=>{const i=sn(e,n.schema);return RNe(i,t)(n,r)};var m3e=Object.freeze({__proto__:null,blur:JNe,clearContent:ZNe,clearNodes:XNe,command:eKe,createParagraphNear:tKe,cut:nKe,deleteCurrentNode:rKe,deleteNode:iKe,deleteRange:oKe,deleteSelection:aKe,enter:sKe,exitCode:lKe,extendMarkRange:uKe,first:cKe,focus:fKe,forEach:pKe,insertContent:hKe,insertContentAt:gKe,joinBackward:bKe,joinDown:yKe,joinForward:CKe,joinItemBackward:SKe,joinItemForward:wKe,joinTextblockBackward:_Ke,joinTextblockForward:xKe,joinUp:vKe,keyboardShortcut:IKe,lift:EKe,liftEmptyBlock:RKe,liftListItem:$Ke,newlineInCode:kKe,resetAttributes:OKe,scrollIntoView:MKe,selectAll:FKe,selectNodeBackward:jKe,selectNodeForward:LKe,selectParentNode:DKe,selectTextblockEnd:UKe,selectTextblockStart:BKe,setContent:WKe,setMark:ZKe,setMeta:XKe,setNode:e3e,setNodeSelection:t3e,setTextSelection:n3e,sinkListItem:r3e,splitBlock:i3e,splitListItem:o3e,toggleList:a3e,toggleMark:s3e,toggleNode:l3e,toggleWrap:u3e,undoInputRule:c3e,unsetAllMarks:d3e,unsetMark:f3e,updateAttributes:p3e,wrapIn:h3e,wrapInList:A3e});jn.create({name:"commands",addCommands(){return{...m3e}}});jn.create({name:"drop",addProseMirrorPlugins(){return[new Sn({key:new qn("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}});jn.create({name:"editable",addProseMirrorPlugins(){return[new Sn({key:new qn("editable"),props:{editable:()=>this.editor.options.editable}})]}});jn.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Sn({key:new qn("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}}}})]}});jn.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:s})=>{const{selection:l,doc:u}=s,{empty:c,$anchor:f}=l,{pos:p,parent:h}=f,m=f.parent.isTextblock&&p>0?s.doc.resolve(p-1):f,g=m.parent.type.spec.isolating,y=f.pos-f.parentOffset,C=g&&m.parent.childCount===1?y===f.pos:je.atStart(u).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 pC()||aJ()?o:i},addProseMirrorPlugins(){return[new Sn({key:new qn("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,l=je.atStart(t.doc).from,u=je.atEnd(t.doc).to;if(o||!(a===l&&s===u)||!IF(n.doc))return;const p=n.tr,h=cC({state:n,transaction:p}),{commands:m}=new SF({editor:this.editor,state:h});if(m.clearNodes(),!!p.steps.length)return p}})]}});jn.create({name:"paste",addProseMirrorPlugins(){return[new Sn({key:new qn("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}});jn.create({name:"tabindex",addProseMirrorPlugins(){return[new Sn({key:new qn("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});function Yv(e){return new _F({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 l=s.search(/\S/),u=n.from+s.indexOf(a),c=u+a.length;if(uJ(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>u).length)return null;c<n.to&&o.delete(c,n.to),u>n.from&&o.delete(n.from+l,u);const p=n.from+l+a.length;o.addMark(n.from+l,p,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function I_(e){return new _F({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 Gv(e){return new _F({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),l=a.doc.resolve(n.from).blockRange(),u=l&&VWe(l,e.type,o);if(!u)return null;if(a.wrap(l,u),e.keepMarks&&e.editor){const{selection:f,storedMarks:p}=t,{splittableMarks:h}=e.editor.extensionManager,m=p||f.$to.parentOffset&&f.$from.marks();if(m){const g=m.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&&gF(a.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,c))&&a.join(n.from-1)}})}class mn{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 mn(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>fC(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new mn(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 g3e{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,l;const{view:u}=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}(l=t.dataTransfer)===null||l===void 0||l.setDragImage(this.dom,p,h);const m=this.getPos();if(typeof m!="number")return;const g=xe.create(u.state.doc,m),y=u.state.tr.setSelection(g);u.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:l}=this.editor,{isDragging:u}=this,c=!!this.node.type.spec.draggable,f=xe.isSelectable(this.node),p=t.type==="copy",h=t.type==="paste",m=t.type==="cut",g=t.type==="mousedown";if(!c&&f&&o&&t.target===this.dom&&t.preventDefault(),c&&o&&!u&&t.target===this.dom)return t.preventDefault(),!1;if(c&&l&&!u&&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!(u||a||p||h||m||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"&&(pC()||iJ())&&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 Jv(e){return new KNe({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],l=r[0];let u=n.to;if(s){const c=l.search(/\S/),f=n.from+l.indexOf(s),p=f+s.length;if(uJ(n.from,n.to,t.doc).filter(m=>m.mark.type.excluded.find(y=>y===e.type&&y!==m.mark.type)).filter(m=>m.to>f).length)return null;p<n.to&&a.delete(p,n.to),f>n.from&&a.delete(n.from+c,f),u=n.from+c+s.length,a.addMark(n.from+c,u,e.type.create(o||{})),a.removeStoredMark(e.type)}}})}function v3e(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var Zv=200,pn=function(){};pn.prototype.append=function(t){return t.length?(t=pn.from(t),!this.length&&t||t.length<Zv&&this.leafAppend(t)||this.length<Zv&&t.leafPrepend(this)||this.appendInner(t)):this};pn.prototype.prepend=function(t){return t.length?pn.from(t).append(this):this};pn.prototype.appendInner=function(t){return new y3e(this,t)};pn.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?pn.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};pn.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};pn.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)};pn.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};pn.from=function(t){return t instanceof pn?t:t&&t.length?new cJ(t):pn.empty};var cJ=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 l=o;l<a;l++)if(i(this.values[l],s+l)===!1)return!1},t.prototype.forEachInvertedInner=function(i,o,a,s){for(var l=o-1;l>=a;l--)if(i(this.values[l],s+l)===!1)return!1},t.prototype.leafAppend=function(i){if(this.length+i.length<=Zv)return new t(this.values.concat(i.flatten()))},t.prototype.leafPrepend=function(i){if(this.length+i.length<=Zv)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}(pn);pn.empty=new cJ([]);var y3e=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}(pn);const b3e=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,l,u=[],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)),m;h&&a.maybeStep(h).doc&&(m=a.mapping.maps[a.mapping.maps.length-1],u.push(new wo(m,void 0,void 0,u.length+c.length))),o--,m&&i.appendMap(m,o)}else a.maybeStep(f.step);if(f.selection)return s=i?f.selection.map(i.slice(o)):f.selection,l=new qi(this.items.slice(0,r).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:a,selection:s}}addTransform(t,n,r,i){let o=[],a=this.eventCount,s=this.items,l=!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=l&&l.merge(p))&&(p=h,c?o.pop():s=s.slice(0,s.length-1)),o.push(p),n&&(a++,n=void 0),i||(l=p)}let u=a-r.depth;return u>S3e&&(s=C3e(s,u),a-=u),new qi(s.append(o),a)}remapping(t,n){let r=new LPe;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 l=n;this.items.forEach(p=>{let h=o.getMirror(--l);if(h==null)return;a=Math.min(a,h);let m=o.maps[h];if(p.step){let g=t.steps[h].invert(t.docs[h]),y=p.selection&&p.selection.map(o.slice(l+1,h));y&&s++,r.push(new wo(m,g,y))}else r.push(new wo(m))},i);let u=[];for(let p=n;p<a;p++)u.push(new wo(o.maps[p]));let c=this.items.slice(0,i).append(u).append(r),f=new qi(c,s);return f.emptyItemCount()>b3e&&(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 l=a.step.map(n.slice(r)),u=l&&l.getMap();if(r--,u&&n.appendMap(u,r),l){let c=a.selection&&a.selection.map(n.slice(r));c&&o++;let f=new wo(u.invert(),l,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(pn.from(i.reverse()),o)}}qi.empty=new qi(pn.empty,0);function C3e(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 S3e=20;function w3e(e,t,n,r){let i=n.getMeta(iu),o;if(i)return i.historyState;n.getMeta(T3e)&&(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(iu))return a.getMeta(iu).redo?new bs(e.done.addTransform(n,void 0,r,Xg(t)),e.undone,U2(n.mapping.maps),e.prevTime,e.prevComposition):new bs(e.done,e.undone.addTransform(n,void 0,r,Xg(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let s=n.getMeta("composition"),l=e.prevTime==0||!a&&e.prevComposition!=s&&(e.prevTime<(n.time||0)-r.newGroupDelay||!_3e(n,e.prevRanges)),u=a?JS(e.prevRanges,n.mapping):U2(n.mapping.maps);return new bs(e.done.addTransform(n,l?t.selection.getBookmark():void 0,r,Xg(t)),qi.empty,u,n.time,s??e.prevComposition)}else return(o=n.getMeta("rebased"))?new bs(e.done.rebased(n,o),e.undone.rebased(n,o),JS(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new bs(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),JS(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function _3e(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 JS(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 x3e(e,t,n){let r=Xg(t),i=iu.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),l=new bs(n?s:o.remaining,n?o.remaining:s,null,0,-1);return o.transform.setSelection(a).setMeta(iu,{redo:n,historyState:l})}let ZS=!1,B2=null;function Xg(e){let t=e.plugins;if(B2!=t){ZS=!1,B2=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){ZS=!0;break}}return ZS}const iu=new qn("history"),T3e=new qn("closeHistory");function I3e(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Sn({key:iu,state:{init(){return new bs(qi.empty,qi.empty,null,0,-1)},apply(t,n,r){return w3e(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,i=r=="historyUndo"?fJ:r=="historyRedo"?pJ:null;return i?(n.preventDefault(),i(t.state,t.dispatch)):!1}}}})}function dJ(e,t){return(n,r)=>{let i=iu.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let o=x3e(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}const fJ=dJ(!1,!0),pJ=dJ(!0,!0),E3e=jn.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>fJ(e,t),redo:()=>({state:e,dispatch:t})=>pJ(e,t)}},addProseMirrorPlugins(){return[I3e(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=sn(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}},hJ=(e,t)=>{const n=hC(e,t);if(!n)return!1;const[,r]=VKe(t,e,n.$pos.pos+4);return r},R3e=(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))},$3e=(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)},k3e=(e,t,n)=>{if(!n)return!1;const r=sn(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)&&R3e(e.state,t,n)){const{$anchor:s}=e.state.selection,l=e.state.doc.resolve(s.before()-1),u=[];l.node().descendants((p,h)=>{p.type.name===t&&u.push({node:p,pos:h})});const c=u.at(-1);if(!c)return!1;const f=e.state.doc.resolve(l.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)||!HKe(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=k3e(t,e.state,o);return $3e(t,e.state)&&!a?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},O3e=(e,t)=>{const n=hJ(e,t),r=hC(e,t);return!r||!n?!1:n>r.depth},M3e=(e,t)=>{const n=hJ(e,t),r=hC(e,t);return!r||!n?!1:n<r.depth},W2=(e,t)=>{if(!kd(e.state,t)||!QKe(e.state,t))return!1;const{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:O3e(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():M3e(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},F3e=jn.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 Or="top",Ii="bottom",Ei="right",Mr="left",EF="auto",eg=[Or,Ii,Ei,Mr],Od="start",Nh="end",j3e="clippingParents",AJ="viewport",Sp="popper",L3e="reference",N2=eg.reduce(function(e,t){return e.concat([t+"-"+Od,t+"-"+Nh])},[]),mJ=[].concat(eg,[EF]).reduce(function(e,t){return e.concat([t,t+"-"+Od,t+"-"+Nh])},[]),D3e="beforeRead",U3e="read",B3e="afterRead",P3e="beforeMain",W3e="main",N3e="afterMain",K3e="beforeWrite",q3e="write",V3e="afterWrite",z3e=[D3e,U3e,B3e,P3e,W3e,N3e,K3e,q3e,V3e];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 Iu(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 RF(e){if(typeof ShadowRoot>"u")return!1;var t=si(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Q3e(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 H3e(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(l,u){return l[u]="",l},{});!Ti(i)||!Uo(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const gJ={name:"applyStyles",enabled:!0,phase:"write",fn:Q3e,effect:H3e,requires:["computeStyles"]};function Eo(e){return e.split("-")[0]}var ou=Math.max,Xv=Math.min,Md=Math.round;function E_(){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 vJ(){return!/^((?!chrome|android).)*safari/i.test(E_())}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=Iu(e)?si(e):window,s=a.visualViewport,l=!vJ()&&n,u=(r.left+(l&&s?s.offsetLeft:0))/i,c=(r.top+(l&&s?s.offsetTop:0))/o,f=r.width/i,p=r.height/o;return{width:f,height:p,top:c,right:u+f,bottom:c+p,left:u,x:u,y:c}}function $F(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 yJ(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&RF(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 Y3e(e){return["table","td","th"].indexOf(Uo(e))>=0}function $l(e){return((Iu(e)?e.ownerDocument:e.document)||window.document).documentElement}function AC(e){return Uo(e)==="html"?e:e.assignedSlot||e.parentNode||(RF(e)?e.host:null)||$l(e)}function K2(e){return!Ti(e)||Ta(e).position==="fixed"?null:e.offsetParent}function G3e(e){var t=/firefox/i.test(E_()),n=/Trident/i.test(E_());if(n&&Ti(e)){var r=Ta(e);if(r.position==="fixed")return null}var i=AC(e);for(RF(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 tg(e){for(var t=si(e),n=K2(e);n&&Y3e(n)&&Ta(n).position==="static";)n=K2(n);return n&&(Uo(n)==="html"||Uo(n)==="body"&&Ta(n).position==="static")?t:n||G3e(e)||t}function kF(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Yp(e,t,n){return ou(e,Xv(t,n))}function J3e(e,t,n){var r=Yp(e,t,n);return r>n?n:r}function bJ(){return{top:0,right:0,bottom:0,left:0}}function CJ(e){return Object.assign({},bJ(),e)}function SJ(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var Z3e=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,CJ(typeof t!="number"?t:SJ(t,eg))};function X3e(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Eo(n.placement),l=kF(s),u=[Mr,Ei].indexOf(s)>=0,c=u?"height":"width";if(!(!o||!a)){var f=Z3e(i.padding,n),p=$F(o),h=l==="y"?Or:Mr,m=l==="y"?Ii:Ei,g=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],y=a[l]-n.rects.reference[l],C=tg(o),_=C?l==="y"?C.clientHeight||0:C.clientWidth||0:0,b=g/2-y/2,v=f[h],S=_-p[c]-f[m],w=_/2-p[c]/2+b,T=Yp(v,w,S),E=l;n.modifiersData[r]=(t={},t[E]=T,t.centerOffset=T-w,t)}}function e5e(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)||yJ(t.elements.popper,i)&&(t.elements.arrow=i))}const t5e={name:"arrow",enabled:!0,phase:"main",fn:X3e,effect:e5e,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function jd(e){return e.split("-")[1]}var n5e={top:"auto",right:"auto",bottom:"auto",left:"auto"};function r5e(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,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,f=e.isFixed,p=a.x,h=p===void 0?0:p,m=a.y,g=m===void 0?0:m,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=Mr,v=Or,S=window;if(u){var w=tg(n),T="clientHeight",E="clientWidth";if(w===si(n)&&(w=$l(n),Ta(w).position!=="static"&&s==="absolute"&&(T="scrollHeight",E="scrollWidth")),w=w,i===Or||(i===Mr||i===Ei)&&o===Nh){v=Ii;var R=f&&w===S&&S.visualViewport?S.visualViewport.height:w[T];g-=R-r.height,g*=l?1:-1}if(i===Mr||(i===Or||i===Ii)&&o===Nh){b=Ei;var O=f&&w===S&&S.visualViewport?S.visualViewport.width:w[E];h-=O-r.width,h*=l?1:-1}}var $=Object.assign({position:s},u&&n5e),B=c===!0?r5e({x:h,y:g},si(n)):{x:h,y:g};if(h=B.x,g=B.y,l){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 i5e(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,l=s===void 0?!0:s,u={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({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,q2(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const o5e={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:i5e,data:{}};var $g={passive:!0};function a5e(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,l=si(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach(function(c){c.addEventListener("scroll",n.update,$g)}),s&&l.addEventListener("resize",n.update,$g),function(){o&&u.forEach(function(c){c.removeEventListener("scroll",n.update,$g)}),s&&l.removeEventListener("resize",n.update,$g)}}const s5e={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:a5e,data:{}};var l5e={left:"right",right:"left",bottom:"top",top:"bottom"};function ev(e){return e.replace(/left|right|bottom|top/g,function(t){return l5e[t]})}var u5e={start:"end",end:"start"};function V2(e){return e.replace(/start|end/g,function(t){return u5e[t]})}function OF(e){var t=si(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function MF(e){return Fd($l(e)).left+OF(e).scrollLeft}function c5e(e,t){var n=si(e),r=$l(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var u=vJ();(u||!u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+MF(e),y:l}}function d5e(e){var t,n=$l(e),r=OF(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=ou(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=ou(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+MF(e),l=-r.scrollTop;return Ta(i||n).direction==="rtl"&&(s+=ou(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function FF(e){var t=Ta(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function wJ(e){return["html","body","#document"].indexOf(Uo(e))>=0?e.ownerDocument.body:Ti(e)&&FF(e)?e:wJ(AC(e))}function Gp(e,t){var n;t===void 0&&(t=[]);var r=wJ(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=si(r),a=i?[o].concat(o.visualViewport||[],FF(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(Gp(AC(a)))}function R_(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function f5e(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===AJ?R_(c5e(e,n)):Iu(t)?f5e(t,n):R_(d5e($l(e)))}function p5e(e){var t=Gp(AC(e)),n=["absolute","fixed"].indexOf(Ta(e).position)>=0,r=n&&Ti(e)?tg(e):e;return Iu(r)?t.filter(function(i){return Iu(i)&&yJ(i,r)&&Uo(i)!=="body"}):[]}function h5e(e,t,n,r){var i=t==="clippingParents"?p5e(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(l,u){var c=z2(e,u,r);return l.top=ou(c.top,l.top),l.right=Xv(c.right,l.right),l.bottom=Xv(c.bottom,l.bottom),l.left=ou(c.left,l.left),l},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 _J(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,l;switch(i){case Or:l={x:a,y:t.y-n.height};break;case Ii:l={x:a,y:t.y+t.height};break;case Ei:l={x:t.x+t.width,y:s};break;case Mr:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var u=i?kF(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(o){case Od:l[u]=l[u]-(t[c]/2-n[c]/2);break;case Nh:l[u]=l[u]+(t[c]/2-n[c]/2);break}}return l}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,l=s===void 0?j3e:s,u=n.rootBoundary,c=u===void 0?AJ:u,f=n.elementContext,p=f===void 0?Sp:f,h=n.altBoundary,m=h===void 0?!1:h,g=n.padding,y=g===void 0?0:g,C=CJ(typeof y!="number"?y:SJ(y,eg)),_=p===Sp?L3e:Sp,b=e.rects.popper,v=e.elements[m?_:p],S=h5e(Iu(v)?v:v.contextElement||$l(e.elements.popper),l,c,a),w=Fd(e.elements.reference),T=_J({reference:w,element:b,strategy:"absolute",placement:i}),E=R_(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=[Or,Ii].indexOf(K)>=0?"y":"x";O[K]+=B[z]*H})}return O}function A5e(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?mJ:l,c=jd(r),f=c?s?N2:N2.filter(function(m){return jd(m)===c}):eg,p=f.filter(function(m){return u.indexOf(m)>=0});p.length===0&&(p=f);var h=p.reduce(function(m,g){return m[g]=Kh(e,{placement:g,boundary:i,rootBoundary:o,padding:a})[Eo(g)],m},{});return Object.keys(h).sort(function(m,g){return h[m]-h[g]})}function m5e(e){if(Eo(e)===EF)return[];var t=ev(e);return[V2(e),t,V2(t)]}function g5e(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,l=n.fallbackPlacements,u=n.padding,c=n.boundary,f=n.rootBoundary,p=n.altBoundary,h=n.flipVariations,m=h===void 0?!0:h,g=n.allowedAutoPlacements,y=t.options.placement,C=Eo(y),_=C===y,b=l||(_||!m?[ev(y)]:m5e(y)),v=[y].concat(b).reduce(function(Ce,P){return Ce.concat(Eo(P)===EF?A5e(t,{placement:P,boundary:c,rootBoundary:f,padding:u,flipVariations:m,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=[Or,Ii].indexOf(B)>=0,z=H?"width":"height",N=Kh(t,{placement:$,boundary:c,rootBoundary:f,altBoundary:p,padding:u}),Y=H?K?Ei:Mr:K?Ii:Or;S[z]>w[z]&&(Y=ev(Y));var ee=ev(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=m?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 v5e={name:"flip",enabled:!0,phase:"main",fn:g5e,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[Or,Ei,Ii,Mr].some(function(t){return e[t]>=0})}function y5e(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}),l=Q2(a,r),u=Q2(s,i,o),c=H2(l),f=H2(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":f})}const b5e={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:y5e};function C5e(e,t,n){var r=Eo(e),i=[Mr,Or].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,[Mr,Ei].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function S5e(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=mJ.reduce(function(c,f){return c[f]=C5e(f,t.rects,o),c},{}),s=a[t.placement],l=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}const w5e={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:S5e};function _5e(e){var t=e.state,n=e.name;t.modifiersData[n]=_J({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const x5e={name:"popperOffsets",enabled:!0,phase:"read",fn:_5e,data:{}};function T5e(e){return e==="x"?"y":"x"}function I5e(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,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,f=n.padding,p=n.tether,h=p===void 0?!0:p,m=n.tetherOffset,g=m===void 0?0:m,y=Kh(t,{boundary:l,rootBoundary:u,padding:f,altBoundary:c}),C=Eo(t.placement),_=jd(t.placement),b=!_,v=kF(C),S=T5e(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"?Or:Mr,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?$F(Ie):{width:0,height:0},P=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:bJ(),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,on=t.elements.arrow&&tg(t.elements.arrow),Yt=on?v==="y"?on.clientTop||0:on.clientLeft||0:0,_e=(K=$==null?void 0:$[v])!=null?K:0,Ze=Y+De-_e-Yt,ht=Y+mt-_e,tt=Yp(h?Xv(ee,Ze):ee,Y,h?ou(F,ht):F);w[v]=tt,B[v]=tt-Y}if(s){var ut,Gt=v==="x"?Or:Mr,wn=v==="x"?Ii:Ei,Jt=w[S],Rt=S==="y"?"height":"width",Tr=Jt+y[Gt],Pt=Jt-y[wn],Zt=[Or,Mr].indexOf(C)!==-1,an=(ut=$==null?void 0:$[S])!=null?ut:0,Ir=Zt?Tr:Jt-T[Rt]-E[Rt]-an+O.altAxis,Er=Zt?Jt+T[Rt]+E[Rt]-an-O.altAxis:Pt,Me=h&&Zt?J3e(Ir,Jt,Er):Yp(h?Ir:Tr,Jt,h?Er:Pt);w[S]=Me,B[S]=Me-Jt}t.modifiersData[r]=B}}const E5e={name:"preventOverflow",enabled:!0,phase:"main",fn:I5e,requiresIfExists:["offset"]};function R5e(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function $5e(e){return e===si(e)||!Ti(e)?OF(e):R5e(e)}function k5e(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 O5e(e,t,n){n===void 0&&(n=!1);var r=Ti(t),i=Ti(t)&&k5e(t),o=$l(t),a=Fd(e,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Uo(t)!=="body"||FF(o))&&(s=$5e(t)),Ti(t)?(l=Fd(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=MF(o))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function M5e(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 l=t.get(s);l&&i(l)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function F5e(e){var t=M5e(e);return z3e.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function j5e(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function L5e(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 D5e(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,l,u){u===void 0&&(u=o);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},Y2,o),modifiersData:{},elements:{reference:s,popper:l},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:Iu(s)?Gp(s):s.contextElement?Gp(s.contextElement):[],popper:Gp(l)};var b=F5e(L5e([].concat(r,c.options.modifiers)));return c.orderedModifiers=b.filter(function(v){return v.enabled}),m(),h.update()},forceUpdate:function(){if(!p){var C=c.elements,_=C.reference,b=C.popper;if(G2(_,b)){c.rects={reference:O5e(_,tg(b),c.options.strategy==="fixed"),popper:$F(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:j5e(function(){return new Promise(function(y){h.forceUpdate(),y(c)})}),destroy:function(){g(),p=!0}};if(!G2(s,l))return h;h.setOptions(u).then(function(y){!p&&u.onFirstUpdate&&u.onFirstUpdate(y)});function m(){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 U5e=[s5e,x5e,o5e,gJ,w5e,v5e,E5e,t5e,b5e],B5e=D5e({defaultModifiers:U5e}),P5e="tippy-box",xJ="tippy-content",W5e="tippy-backdrop",TJ="tippy-arrow",IJ="tippy-svg-arrow",Pl={passive:!0,capture:!0},EJ=function(){return document.body};function N5e(e,t){return{}.hasOwnProperty.call(e,t)}function XS(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function jF(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function RJ(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 K5e(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function q5e(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 V5e(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function z5e(e){return e.split("-")[0]}function ey(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 jF(e,t)})}function Q5e(e){return jF(e,"NodeList")}function H5e(e){return jF(e,"MouseEvent")}function Y5e(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function G5e(e){return qh(e)?[e]:Q5e(e)?ey(e):Array.isArray(e)?e:ey(document.querySelectorAll(e))}function ew(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 J5e(e){var t,n=Jc(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function Z5e(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,a=i.popperState,s=i.props,l=s.interactiveBorder,u=z5e(a.placement),c=a.modifiersData.offset;if(!c)return!0;var f=u==="bottom"?c.top.y:0,p=u==="top"?c.bottom.y:0,h=u==="right"?c.left.x:0,m=u==="left"?c.right.x:0,g=o.top-r+f>l,y=r-o.bottom-p>l,C=o.left-n+h>l,_=n-o.right-m>l;return g||y||C||_})}function tw(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 X5e(){_o.isTouch||(_o.isTouch=!0,window.performance&&document.addEventListener("mousemove",$J))}function $J(){var e=performance.now();e-nD<20&&(_o.isTouch=!1,document.removeEventListener("mousemove",$J)),nD=e}function e6e(){var e=document.activeElement;if(Y5e(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function t6e(){document.addEventListener("touchstart",X5e,Pl),window.addEventListener("blur",e6e)}var n6e=typeof window<"u"&&typeof document<"u",r6e=n6e?!!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 i6e(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 kJ(e){return[i6e(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var Vh;process.env.NODE_ENV!=="production"&&o6e();function o6e(){Vh=new Set}function Aa(e,t){if(e&&!Vh.has(t)){var n;Vh.add(t),(n=console).warn.apply(n,kJ(t))}}function $_(e,t){if(e&&!Vh.has(t)){var n;Vh.add(t),(n=console).error.apply(n,kJ(t))}}function a6e(e){var t=!e,n=Object.prototype.toString.call(e)==="[object Object]"&&!e.addEventListener;$_(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),$_(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var OJ={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},s6e={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Zr=Object.assign({appendTo:EJ,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},OJ,s6e),l6e=Object.keys(Zr),u6e=function(t){process.env.NODE_ENV!=="production"&&FJ(t,[]);var n=Object.keys(t);n.forEach(function(r){Zr[r]=t[r]})};function MJ(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=Zr[o])!=null?s:a}return r},{});return Object.assign({},e,n)}function c6e(e,t){var n=t?Object.keys(MJ(Object.assign({},Zr,{plugins:t}))):l6e,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:RJ(t.content,[e])},t.ignoreAttributes?{}:c6e(e,t.plugins));return n.aria=Object.assign({},Zr.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 FJ(e,t){e===void 0&&(e={}),t===void 0&&(t=[]);var n=Object.keys(e);n.forEach(function(r){var i=K5e(Zr,Object.keys(OJ)),o=!N5e(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 d6e=function(){return"innerHTML"};function k_(e,t){e[d6e()]=t}function oD(e){var t=Jp();return e===!0?t.className=TJ:(t.className=IJ,qh(e)?t.appendChild(e):k_(t,e)),t}function aD(e,t){qh(t.content)?(k_(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?k_(e,t.content):e.textContent=t.content)}function O_(e){var t=e.firstElementChild,n=ey(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(xJ)}),arrow:n.find(function(r){return r.classList.contains(TJ)||r.classList.contains(IJ)}),backdrop:n.find(function(r){return r.classList.contains(W5e)})}}function jJ(e){var t=Jp(),n=Jp();n.className=P5e,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Jp();r.className=xJ,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=O_(t),l=s.box,u=s.content,c=s.arrow;a.theme?l.setAttribute("data-theme",a.theme):l.removeAttribute("data-theme"),typeof a.animation=="string"?l.setAttribute("data-animation",a.animation):l.removeAttribute("data-animation"),a.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof a.maxWidth=="number"?a.maxWidth+"px":a.maxWidth,a.role?l.setAttribute("role",a.role):l.removeAttribute("role"),(o.content!==a.content||o.allowHTML!==a.allowHTML)&&aD(u,e.props),a.arrow?c?o.arrow!==a.arrow&&(l.removeChild(c),l.appendChild(oD(a.arrow))):l.appendChild(oD(a.arrow)):c&&l.removeChild(c)}return{popper:t,onUpdate:i}}jJ.$$tippy=!0;var f6e=1,kg=[],nw=[];function p6e(e,t){var n=iD(e,Object.assign({},Zr,MJ(X2(t)))),r,i,o,a=!1,s=!1,l=!1,u=!1,c,f,p,h=[],m=J2(Ze,n.interactiveDebounce),g,y=f6e++,C=null,_=V5e(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:Ir,setProps:Er,setContent:Me,show:$e,hide:D,hideWithInteractivity:L,enable:Zt,disable:an,unmount:U,destroy:ce};if(!n.render)return process.env.NODE_ENV!=="production"&&$_(!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 on(),M(),Y(),ee("onCreate",[v]),n.showOnCreate&&Tr(),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",m)}),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?J5e(j):document}function z(){return O_(w)}function N(j){return v.state.isMounted&&!v.state.isVisible||_o.isTouch||c&&c.type==="focus"?0:XS(v.props.delay,j?0:1,Zr.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 le;(le=v.props)[j].apply(le,te)}}function F(){var j=v.props.aria;if(j.content){var te="aria-"+j.content,pe=w.id,le=Jc(v.props.triggerTarget||e);le.forEach(function(be){var ot=be.getAttribute(te);if(v.state.isVisible)be.setAttribute(te,ot?ot+" "+pe:pe);else{var _n=ot&&ot.replace(pe,"").trim();_n?be.setAttribute(te,_n):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",m),kg=kg.filter(function(j){return j!==m})}function re(j){if(!(_o.isTouch&&(l||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(){l=!0}function Ce(){l=!1}function P(){var j=H();j.addEventListener("mousedown",re,!0),j.addEventListener("touchend",re,Pl),j.addEventListener("touchstart",Ce,Pl),j.addEventListener("touchmove",Ie,Pl)}function ae(){var j=H();j.removeEventListener("mousedown",re,!0),j.removeEventListener("touchend",re,Pl),j.removeEventListener("touchstart",Ce,Pl),j.removeEventListener("touchmove",Ie,Pl)}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 le(be){be.target===pe&&(tw(pe,"remove",le),te())}if(j===0)return te();tw(pe,"remove",f),tw(pe,"add",le),f=le}function mt(j,te,pe){pe===void 0&&(pe=!1);var le=Jc(v.props.triggerTarget||e);le.forEach(function(be){be.addEventListener(j,te,pe),h.push({node:be,eventType:j,handler:te,options:pe})})}function on(){$()&&(mt("touchstart",_e,{passive:!0}),mt("touchend",ht,{passive:!0})),q5e(v.props.trigger).forEach(function(j){if(j!=="manual")switch(mt(j,_e),j){case"mouseenter":mt("mouseleave",ht);break;case"focus":mt(r6e?"focusout":"blur",tt);break;case"focusin":mt("focusout",tt);break}})}function Yt(){h.forEach(function(j){var te=j.node,pe=j.eventType,le=j.handler,be=j.options;te.removeEventListener(pe,le,be)}),h=[]}function _e(j){var te,pe=!1;if(!(!v.state.isEnabled||ut(j)||s)){var le=((te=c)==null?void 0:te.type)==="focus";c=j,g=j.currentTarget,M(),!v.state.isVisible&&H5e(j)&&kg.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:Tr(j),j.type==="click"&&(a=!pe),pe&&!le&&Pt(j)}}function Ze(j){var te=j.target,pe=K().contains(te)||w.contains(te);if(!(j.type==="mousemove"&&pe)){var le=Rt().concat(w).map(function(be){var ot,_n=be._tippy,bo=(ot=_n.popperInstance)==null?void 0:ot.state;return bo?{popperRect:be.getBoundingClientRect(),popperState:bo,props:n}:null}).filter(Boolean);Z5e(le,j)&&(W(),Pt(j))}}function ht(j){var te=ut(j)||v.props.trigger.indexOf("click")>=0&&a;if(!te){if(v.props.interactive){v.hideWithInteractivity(j);return}Pt(j)}}function tt(j){v.props.trigger.indexOf("focusin")<0&&j.target!==K()||v.props.interactive&&j.relatedTarget&&w.contains(j.relatedTarget)||Pt(j)}function ut(j){return _o.isTouch?$()!==j.type.indexOf("touch")>=0:!1}function Gt(){wn();var j=v.props,te=j.popperOptions,pe=j.placement,le=j.offset,be=j.getReferenceClientRect,ot=j.moveTransition,_n=B()?O_(w).arrow:null,bo=be?{getBoundingClientRect:be,contextElement:be.contextElement||K()}:e,kl={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(xn){var As=xn.state;if(B()){var IC=z(),Ap=IC.box;["placement","reference-hidden","escaped"].forEach(function(Ol){Ol==="placement"?Ap.setAttribute("data-placement",As.placement):As.attributes.popper["data-popper-"+Ol]?Ap.setAttribute("data-"+Ol,""):Ap.removeAttribute("data-"+Ol)}),As.attributes.popper={}}}},aa=[{name:"offset",options:{offset:le}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ot}},kl];B()&&_n&&aa.push({name:"arrow",options:{element:_n,padding:3}}),aa.push.apply(aa,(te==null?void 0:te.modifiers)||[]),v.popperInstance=B5e(bo,w,Object.assign({},te,{placement:pe,onFirstUpdate:p,modifiers:aa}))}function wn(){v.popperInstance&&(v.popperInstance.destroy(),v.popperInstance=null)}function Jt(){var j=v.props.appendTo,te,pe=K();v.props.interactive&&j===EJ||j==="parent"?te=pe.parentNode:te=RJ(j,[pe]),te.contains(w)||te.appendChild(w),v.state.isMounted=!0,Gt(),process.env.NODE_ENV!=="production"&&Aa(v.props.interactive&&j===Zr.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 Rt(){return ey(w.querySelectorAll("[data-tippy-root]"))}function Tr(j){v.clearDelayTimeouts(),j&&ee("onTrigger",[v,j]),P();var te=N(!0),pe=O(),le=pe[0],be=pe[1];_o.isTouch&&le==="hold"&&be&&(te=be),te?r=setTimeout(function(){v.show()},te):v.show()}function Pt(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 Zt(){v.state.isEnabled=!0}function an(){v.hide(),v.state.isEnabled=!1}function Ir(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function Er(j){if(process.env.NODE_ENV!=="production"&&Aa(v.state.isDestroyed,Pc("setProps")),!v.state.isDestroyed){ee("onBeforeUpdate",[v,j]),Yt();var te=v.props,pe=iD(e,Object.assign({},te,X2(j),{ignoreAttributes:!0}));v.props=pe,on(),te.interactiveDebounce!==pe.interactiveDebounce&&(W(),m=J2(Ze,pe.interactiveDebounce)),te.triggerTarget&&!pe.triggerTarget?Jc(te.triggerTarget).forEach(function(le){le.removeAttribute("aria-expanded")}):pe.triggerTarget&&e.removeAttribute("aria-expanded"),M(),Y(),T&&T(te,pe),v.popperInstance&&(Gt(),Rt().forEach(function(le){requestAnimationFrame(le._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,le=_o.isTouch&&!v.props.touch,be=XS(v.props.duration,0,Zr.duration);if(!(j||te||pe||le)&&!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(),_n=ot.box,bo=ot.content;ew([_n,bo],0)}p=function(){var aa;if(!(!v.state.isVisible||u)){if(u=!0,w.offsetHeight,w.style.transition=v.props.moveTransition,B()&&v.props.animation){var sa=z(),xn=sa.box,As=sa.content;ew([xn,As],be),eD([xn,As],"visible")}F(),M(),Z2(nw,v),(aa=v.popperInstance)==null||aa.forceUpdate(),ee("onMount",[v]),v.props.animation&&B()&&ve(be,function(){v.state.isShown=!0,ee("onShown",[v])})}},Jt()}}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,le=XS(v.props.duration,1,Zr.duration);if(!(j||te||pe)&&(ee("onHide",[v],!1),v.props.onHide(v)!==!1)){if(v.state.isVisible=!1,v.state.isShown=!1,u=!1,a=!1,B()&&(w.style.visibility="hidden"),W(),ae(),Y(!0),B()){var be=z(),ot=be.box,_n=be.content;v.props.animation&&(ew([ot,_n],le),eD([ot,_n],"hidden"))}F(),M(),v.props.animation?B()&&Ge(le,v.unmount):v.unmount()}}function L(j){process.env.NODE_ENV!=="production"&&Aa(v.state.isDestroyed,Pc("hideWithInteractivity")),H().addEventListener("mousemove",m),Z2(kg,m),m(j)}function U(){process.env.NODE_ENV!=="production"&&Aa(v.state.isDestroyed,Pc("unmount")),v.state.isVisible&&v.hide(),v.state.isMounted&&(wn(),Rt().forEach(function(j){j._tippy.unmount()}),w.parentNode&&w.parentNode.removeChild(w),nw=nw.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(),Yt(),delete e._tippy,v.state.isDestroyed=!0,ee("onDestroy",[v]))}}function ng(e,t){t===void 0&&(t={});var n=Zr.plugins.concat(t.plugins||[]);process.env.NODE_ENV!=="production"&&(a6e(e),FJ(t,n)),t6e();var r=Object.assign({},t,{plugins:n}),i=G5e(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(l,u){var c=u&&p6e(u,r);return c&&l.push(c),l},[]);return qh(e)?s[0]:s}ng.defaultProps=Zr;ng.setDefaultProps=u6e;ng.currentInput=_o;Object.assign({},gJ,{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)}});ng.setDefaultProps({render:jJ});class h6e{constructor({editor:t,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:a}){this.preventHide=!1,this.shouldShow=({view:s,state:l,from:u,to:c})=>{const{doc:f,selection:p}=l,{empty:h}=p,m=!f.textBetween(u,c).length&&TF(l.selection),g=this.element.contains(document.activeElement);return!(!(s.hasFocus()||g)||h||m||!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 l;if(this.preventHide){this.preventHide=!1;return}s!=null&&s.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.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,l)=>{const u=!(l!=null&&l.selection.eq(s.state.selection)),c=!(l!=null&&l.doc.eq(s.state.doc));!u&&!c||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(s,u,c,l)},this.updateDelay))},this.updateHandler=(s,l,u,c)=>{var f,p,h;const{state:m,composing:g}=s,{selection:y}=m;if(g||!l&&!u)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:m,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(YKe(m.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 GKe(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=ng(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 LJ=e=>new Sn({key:typeof e.pluginKey=="string"?new qn(e.pluginKey):e.pluginKey,view:t=>new h6e({view:t,...e})});jn.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[LJ({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});var M_={exports:{}},rw={};/**
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 A6e(){if(sD)return rw;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(),m=r({inst:{value:h,getSnapshot:p}}),g=m[0].inst,y=m[1];return o(function(){g.value=h,g.getSnapshot=p,l(g)&&y({inst:g})},[f,h,p]),i(function(){return l(g)&&y({inst:g}),f(function(){l(g)&&y({inst:g})})},[f]),a(h),h}function l(f){var p=f.getSnapshot;f=f.value;try{var h=p();return!n(f,h)}catch{return!0}}function u(f,p){return p()}var c=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:s;return rw.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:c,rw}var iw={};/**
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 lD;function m6e(){return lD||(lD=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,l=e.useLayoutEffect,u=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 l(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]),u(w),w}function h(b){var v=b.getSnapshot,S=b.value;try{var w=v();return!o(S,w)}catch{return!0}}function m(b,v,S){return v()}var g=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",y=!g,C=y?m:p,_=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:C;iw.useSyncExternalStore=_,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),iw}process.env.NODE_ENV==="production"?M_.exports=A6e():M_.exports=m6e();var LF=M_.exports;const g6e=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},v6e=({contentComponent:e})=>{const t=LF.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return I.createElement(I.Fragment,null,Object.values(t))};function y6e(){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]:ox.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 b6e 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=y6e(),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:g6e(n,this.editorContentRef),...r}),(t==null?void 0:t.contentComponent)&&I.createElement(v6e,{contentComponent:t.contentComponent}))}}const C6e=I.forwardRef((e,t)=>{const n=I.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return I.createElement(b6e,{key:n,innerRef:t,...e})}),S6e=I.memo(C6e);var ow={};/**
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 uD;function w6e(){if(uD)return ow;uD=1;var e=I,t=LF;function n(u,c){return u===c&&(u!==0||1/u===1/c)||u!==u&&c!==c}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,s=e.useMemo,l=e.useDebugValue;return ow.useSyncExternalStoreWithSelector=function(u,c,f,p,h){var m=o(null);if(m.current===null){var g={hasValue:!1,value:null};m.current=g}else g=m.current;m=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(u,m[0],m[1]);return a(function(){g.hasValue=!0,g.value=y},[y]),l(y),y},ow}var aw={};/**
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 _6e(){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=LF;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,l=e.useDebugValue;function u(c,f,p,h,m){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(m!==void 0&&y.hasValue){var H=y.value;if(m(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 m!==void 0&&m(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,m]),_=C[0],b=C[1],v=i(c,_,b);return a(function(){y.hasValue=!0,y.value=v},[v]),l(v),v}aw.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),aw}process.env.NODE_ENV==="production"?w6e():_6e();process.env.NODE_ENV;const DJ=I.createContext({editor:null});DJ.Consumer;const x6e=()=>I.useContext(DJ),sw=e=>{const[t,n]=I.useState(null),{editor:r}=x6e();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:l,shouldShow:u=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=LJ({updateDelay:l,editor:c,element:t,pluginKey:o,shouldShow:u,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)},UJ=I.createContext({onDragStart:void 0}),T6e=()=>I.useContext(UJ),BJ=I.forwardRef((e,t)=>{const{onDragStart:n}=T6e(),r=e.as||"div";return I.createElement(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});function I6e(e){return!!(typeof e=="function"&&e.prototype&&e.prototype.isReactComponent)}function E6e(e){var t;return typeof e=="object"&&((t=e.$$typeof)===null||t===void 0?void 0:t.toString())==="Symbol(react.forward_ref)"}class PJ{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?ox.flushSync(()=>{this.render()}):this.render()}render(){var t;const n=this.component,r=this.props,i=this.editor;(I6e(n)||E6e(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 R6e extends g3e{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:(u={})=>this.updateAttributes(u),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const u=c=>c.charAt(0).toUpperCase()+c.substring(1);this.component.displayName=u(this.extension.name)}const i={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:u=>{u&&this.contentDOMElement&&u.firstChild!==this.contentDOMElement&&u.appendChild(this.contentDOMElement)}},o=this.component,a=I.memo(u=>I.createElement(UJ.Provider,{value:i},I.createElement(o,u)));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:l=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new PJ(a,{editor:this.editor,props:t,as:s,className:`node-${this.node.type.name} ${l}`.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=zv(this.node,n);t=this.options.attrs({node:this.node,HTMLAttributes:r})}else t=this.options.attrs;this.renderer.updateAttributes(t)}}}function WJ(e,t){return n=>n.editor.contentComponent?new R6e(e,n,t):{}}function NJ(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=NJ(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function KJ(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=NJ(e))&&(r&&(r+=" "),r+=t);return r}function $6e(e){return e.type==="table"}const au={...he.RichTextNodeType,table:"table"};function k6e(e){return!!(e&&e.has(au.table))}const O6e=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,M6e=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,F6e=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,j6e=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,L6e=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",xt(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[Yv({find:O6e,type:this.type}),Yv({find:F6e,type:this.type})]},addPasteRules(){return[Jv({find:M6e,type:this.type}),Jv({find:j6e,type:this.type})]}});var Mc=(e=>(e.Document="document",e.Mark="mark",e.Node="node",e))(Mc||{}),Hl=(e=>(e.Text="text",e.Embed="embed",e.Image="image",e.Table="table",e))(Hl||{});class D6e{constructor(t,n,r){$t(this,"extType","document");this.name=t,this.component=n,this.converter=r}}class rg{constructor(t,n,r,i,o,a=!1){$t(this,"extType","node");$t(this,"nodeType","text");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i,this.placeholder=o,this.lockedFormat=a}}function qJ(e){return e instanceof rg}class U6e{constructor(t,n,r,i){$t(this,"extType","node");$t(this,"nodeType","embed");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}class B6e{constructor(t,n,r,i){$t(this,"extType","node");$t(this,"nodeType","image");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}class P6e extends rg{constructor(t,n,r,i,o){super(t,"heading",n,i,o),this.levels=r}}class DF extends rg{constructor(t,n,r,i){super(t,n,r,i)}}class W6e{constructor(t,n,r,i){$t(this,"extType","node");$t(this,"nodeType","table");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}function N6e(e){return e instanceof DF}const VJ=mn.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",xt(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,l=o||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:u,dispatch:c})=>{if(c&&l&&a){const f=l.filter(p=>s.includes(p.type.name));u.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===VJ.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 K6e(e){if(!e||!(e!=null&&e.single)&&!(e!=null&&e.multi))return dD();const t=q6e(e);if(!t.size)return dD();const n=V6e(t),r=z6e(n,e);return{nodeTypes:t,extensions:r}}function q6e(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 V6e(e){return iX(e).filter(n=>ti.some(e,r=>n.richTextNodeTypes.includes(r)))}function z6e(e,t){var r;const n=new Set(e);return ti.some(n,N6e)&&n.add(Fr),ti.some(n,qJ)||n.add(Fr),(r=t==null?void 0:t.labels)!=null&&r.length&&n.add(VF),[...n]}function dD(){return{extensions:iX(),nodeTypes:new Set(Pd.keys(he.RichTextNodeTypeCodec.keys))}}class Q6e{constructor(t,n,r){$t(this,"extType",Mc.Mark);$t(this,"richTextNodeTypes",[he.RichTextNodeType.strong]);this.name=t,this.component=n,this.converter=r}}const zJ="bold",QJ=L6e.extend({name:zJ}),H6e={fromPrismic(e){return function(){var t;return(t=e.marks[QJ.name])==null?void 0:t.create()}},toPrismic(){}},Y6e=new Q6e(zJ,QJ,H6e),UF=Y6e,G6e="listItem",fD="textStyle",pD=/^\s*([-+*])\s$/,J6e=mn.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",xt(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(G6e,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=Gv({find:pD,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Gv({find:pD,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(fD),editor:this.editor})),[e]}}),Z6e=mn.create({name:"doc",topNode:!0,content:"block+"}),X6e=mn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",xt(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)}}}),HJ=X6e.extend({name:"listItem",content:"paragraph*",addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name)}}}),e4e={fromPrismic(e){return function(t){var r;const n=Fr.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[HJ.name])==null?void 0:r.create({},n)}},toPrismic(e,t){return Qs.children.reduce(e,(n,r)=>{const i=Fr.converter.toPrismic(r),o=(()=>i instanceof Array?i.map(a=>({...a,type:t})):i?[{...i,type:t}]:[])();return[...n,...o]},[])}},Ld={component:HJ,converter:e4e,placeholder:"List"};function t4e(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 n4e=e=>{const t=r4e(e),n=[];for(let r=0;r<t.length;r++)n.push(YJ(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}),lw=e=>Zp({type:Zc.span,text:e,spans:[]}),r4e=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},YJ=e=>{if("text"in e)return Zp(e,GJ(e.spans,e));if("items"in e){const t=[];for(let n=0;n<e.items.length;n++)t.push(YJ(e.items[n]));return Zp(e,t)}return Zp(e)},GJ=(e,t,n)=>{if(!e.length)return[lw(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,l=a.start-s,u=a.end-s,c=t.text.slice(l,u),f=[];for(let h=o;h<r.length;h++){const m=r[h];m!==a&&m.start>=a.start&&m.end<=a.end&&(f.push(m),r.splice(h,1),h--)}o===0&&l>0&&i.push(lw(t.text.slice(0,l)));const p={...a,text:c};i.push(Zp(p,GJ(f,{...t,text:c},a))),u<t.text.length&&i.push(lw(t.text.slice(u,r[o+1]?r[o+1].start-s:void 0)))}return i},i4e=(e,t)=>JJ(n4e(e).children,t),JJ=(e,t)=>{const n=[];for(let r=0;r<e.length;r++){const i=e[r],o=t(i.type,i.node,i.text,JJ(i.children,t),i.key);o!=null&&n.push(o)}return n},o4e=mn.create({name:"text",group:"inline"});function a4e(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 s4e(e){const t=a4e(e),n=Object.entries(t).map(([r,i])=>hD(i).reduce((a,s)=>{if(!a.length)return[s];const l=a.length-1,u=a[l];return u?u.end<s.start?[...a,s]:u.end>=s.end?a:[...a.slice(0,l),{...u,end:s.end}]:a},[])).flat();return hD(n)}const ty=VJ.extend({name:"hard_break"}),ny=`
134
+ `,ZJ={fromPrismic(e){return function(t){var n;if(t===ny)return(n=e.nodes[ty.name])==null?void 0:n.create({})}},toPrismic(e){if(e.type.name===ty.name)return ny}},uw={isEmptyLine(e){return e.length===0},isFirst(e){return e===0}};function l4e(e,t){return function(n){const r=ZJ.fromPrismic(e)(ny);if(!r)return[n(t)];const i=t.split(ny);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 u4e={name:ty.name,component:ty,converter:ZJ,splitTextToNodes:l4e},ry=u4e,XJ={fromPrismic(e){return t=>{switch(t.type){case"hyperlink":return IZ.converter.fromPrismic(e)(t);case"em":return qF.converter.fromPrismic(e)(t);case"strong":return UF.converter.fromPrismic(e)(t);case"label":return VF.converter.fromPrismic(e)(t);case"list-item":return}}},toPrismic(e,t,n){const r=rX.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)}}}},c4e={strong:"bold",label:"label",em:"em",hyperlink:"hyperlink","list-item":void 0},AD=o4e.extend({name:"text"}),d4e={fromPrismic(e){return function(t,n,r=!1){const i={type:t,text:n.content.text,spans:n.content.spans||[]};return i4e([i],f4e(e,r)).flat()}},toPrismic(e,t,n){const r=Qs.children.reduce(e,(i,o)=>{const a=(()=>o.type.name===ry.name?ry.converter.toPrismic(o):o.textContent)(),s=a?i.text+a:i.text,l=i.text.length,u=s.length,c=(()=>o.marks.length?Qs.marks.map(o,p=>XJ.toPrismic(p,l,u)):void 0)();return{...i,text:s,spans:c?[...i.spans,...c]:i.spans}},{text:"",spans:[]});return{type:t,content:{text:r.text,spans:[...s4e(r.spans)].sort((i,o)=>i.type.localeCompare(o.type))},...n}}};function f4e(e,t=!1){return(n,r,i,o)=>{if(n==="span"&&i&&i.length)return t?[e.text(i)]:ry.splitTextToNodes(e,i)(l=>e.text(l));const a=XJ.fromPrismic(e)(r);return a?p4e(a,o):o.flat()}}function p4e(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 h4e={name:AD.name,component:AD,converter:d4e},Eu=h4e,BF="document";function A4e(e){return Z6e.extend({name:BF,content:e?"block+":"block"})}function m4e(e){return{fromPrismic(t,n,r){var o;const i=r.value.reduce((a,s)=>{const{extension:l,block:u}=b4e(e,s,t,n),c=v4e({extension:l,block:u,schema:t}),f=a.slice(0,a.length-1),p=_t.last(a),h=y4e({node:c,previousNode:p});return h.updatedNode?[...h.merged?f:a,h.updatedNode]:a},[]);return(o=t.nodes[BF])==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 g4e=new D6e(BF,A4e,m4e),F_=g4e;function v4e(e){const{extension:t,block:n,schema:r}=e;if(t)switch(t.nodeType){case Hl.Embed:return fe.EmbedBlock.is(n)?t.converter.fromPrismic(r)(n):void 0;case Hl.Text:return fe.TextBlock.is(n)?t.converter.fromPrismic(r)(n):void 0;case Hl.Image:return fe.ImageBlock.is(n)?t.converter.fromPrismic(r)(n):void 0;case Hl.Table:return $6e(n)?t.converter.fromPrismic(r)(n):void 0}}function y4e(e){const{node:t,previousNode:n}=e;return!t||!n?{merged:!1,updatedNode:t}:t.type.name===n.type.name&&(t.type.name===ly.name||t.type.name===cy.name)?{merged:!0,updatedNode:t4e(n,t)}:{merged:!1,updatedNode:t}}function b4e(e,t,n,r){var s;const i=e.find(l=>l.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(l=>qJ(l)&&l.name in n.nodes),a=(s=t.content.spans)==null?void 0:s.filter(l=>{const u=c4e[l.type];return u&&u in n.marks});return{extension:o,block:{...t,content:{text:t.content.text,spans:a}}}}const C4e=jn.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Sn({key:new qn("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 l=r>=s&&r<=s+a.nodeSize,u=!a.isLeaf&&IF(a);if((l||!this.options.showOnlyCurrent)&&u){const c=[this.options.emptyNodeClass];o&&c.push(this.options.emptyEditorClass);const f=fr.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:l}):this.options.placeholder});i.push(f)}return this.options.includeChildren}),Ot.create(e,i)}}})]}}),S4e=mn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",xt(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),tv="ltr",Yl="rtl",ga="dir",mD=he.RichTextNodeType.rtl,w4e=jn.create({name:"textDirection",addOptions(){return{supportedExtensionNames:[]}},addGlobalAttributes(){return[{types:this.options.supportedExtensionNames,attributes:{[ga]:{default:tv,parseHTML:e=>e.getAttribute(ga),renderHTML:e=>({[ga]:j_(e[ga])})}}}]},addCommands(){return{setDirection:e=>({commands:t})=>{switch(e){case tv:return t.setLeftToRight();case Yl:return t.setRightToLeft()}},toggleDirection:e=>({commands:t})=>{const n=e===Yl?tv:Yl;return t.setDirection(n)},setRightToLeft:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.updateAttributes(t,{[ga]:Yl})),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 j_(e[ga])},fromPrismic(e){return{[ga]:j_(e.direction)}},toPrismic(e){return{direction:this.parseNodeAttrsDirection(e.attrs)}}};function j_(e){return e===Yl?Yl:tv}const iy=S4e.extend({name:"paragraph",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",xt(this.options.HTMLAttributes,e),0]}}),_4e={fromPrismic(e){return function(t){var r;const n=Eu.converter.fromPrismic(e)(iy.name,t);return(r=e.nodes[iy.name])==null?void 0:r.create(Ia.fromPrismic(t),n)}},toPrismic(e){return Eu.converter.toPrismic(e,he.RichTextNodeType.paragraph,Ia.toPrismic(e))}},x4e=new rg([he.RichTextNodeType.paragraph],iy.name,iy,_4e,"Type '/' for commands"),Fr=x4e,T4e=e=>C4e.configure({includeChildren:!0,placeholder:t=>I4e(t,e),showOnlyCurrent:!1,showOnlyWhenEditable:!1});function I4e(e,t){const{editor:n,hasAnchor:r,pos:i,node:o}=e,{placeholderByNodeType:a,unfocusedPlaceholder:s,nodeExtensions:l}=t,u=!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!==Fr.name,p=n.isFocused&&r||f||u,h=l.filter(_=>_!==Fr).length>1;function m(_){return _===Fr.placeholder?c&&p&&h:c&&p}function g(){if(u)return Ld.placeholder;const _=a[o.type.name];return typeof _=="string"?_:_==null?void 0:_(o.attrs)}const y=g();return m(y)&&y||""}function gC(e){return e.split("-")[1]}function eZ(e){return e==="y"?"height":"width"}function js(e){return e.split("-")[0]}function ig(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=ig(t),l=eZ(s),u=r[l]/2-i[l]/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]-=u*(n&&c?-1:1);break;case"end":f[s]+=u*(n&&c?-1:1)}return f}const E4e=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=gD(u,r,l),p=r,h={},m=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:u,platform:a,elements:{reference:e,floating:t}});c=_??c,f=b??f,h={...h,[y]:{...h[y],...v}},S&&m<=50&&(m++,typeof S=="object"&&(S.placement&&(p=S.placement),S.rects&&(u=S.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):S.rects),{x:c,y:f}=gD(u,p,l)),g=-1)}return{x:c,y:f,placement:p,strategy:i,middlewareData:h}};function R4e(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 L_(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function tZ(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=t,m=R4e(h),g=s[p?f==="floating"?"reference":"floating":f],y=L_(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:u,rootBoundary:c,strategy:l})),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=L_(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:C,offsetParent:_,strategy:l}):C);return{top:(y.top-v.top+m.top)/b.y,bottom:(v.bottom-y.bottom+m.bottom)/b.y,left:(y.left-v.left+m.left)/b.x,right:(v.right-y.right+m.right)/b.x}}const $4e=Math.min,k4e=Math.max;function vD(e,t,n){return k4e(e,$4e(t,n))}const O4e=["top","right","bottom","left"];O4e.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const M4e={left:"right",right:"left",bottom:"top",top:"bottom"};function oy(e){return e.replace(/left|right|bottom|top/g,t=>M4e[t])}function F4e(e,t,n){n===void 0&&(n=!1);const r=gC(e),i=ig(e),o=eZ(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=oy(a)),{main:a,cross:oy(a)}}const j4e={start:"end",end:"start"};function cw(e){return e.replace(/start|end/g,t=>j4e[t])}const L4e=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:l}=t,{mainAxis:u=!0,crossAxis:c=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=e,y=js(r),C=js(a)===a,_=await(s.isRTL==null?void 0:s.isRTL(l.floating)),b=f||(C||!m?[oy(a)]:function($){const B=oy($);return[cw($),B,cw(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(cw)))),N}(a,m,h,_));const v=[a,...b],S=await tZ(t,g),w=[];let T=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&w.push(S[y]),c){const{main:$,cross:B}=F4e(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{}}}},D4e=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:l,elements:u}=o,c=await(l.isRTL==null?void 0:l.isRTL(u.floating)),f=js(s),p=gC(s),h=ig(s)==="x",m=["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*m}:{x:C*m,y:_*g}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function nZ(e){return e==="x"?"y":"x"}const U4e=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:_}}},...l}=e,u={x:n,y:r},c=await tZ(t,l),f=ig(js(i)),p=nZ(f);let h=u[f],m=u[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";m=vD(m+c[p==="y"?"top":"left"],m,m-c[y])}const g=s.fn({...t,[f]:h,[p]:m});return{...g,data:{x:g.x-n,y:g.y-r}}}}},B4e=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:l=!0,crossAxis:u=!0}=e,c={x:n,y:r},f=ig(i),p=nZ(f);let h=c[f],m=c[p];const g=typeof s=="function"?s(t):s,y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){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(u){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);m<S?m=S:m>w&&(m=w)}return{[f]:h,[p]:m}}}};function ni(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ro(e){return ni(e).getComputedStyle(e)}const yD=Math.min,Xp=Math.max,ay=Math.round;function rZ(e){const t=Ro(e);let n=parseFloat(t.width),r=parseFloat(t.height);const i=e.offsetWidth,o=e.offsetHeight,a=ay(n)!==i||ay(r)!==o;return a&&(n=i,r=o),{width:n,height:r,fallback:a}}function Hs(e){return oZ(e)?(e.nodeName||"").toLowerCase():""}let Og;function iZ(){if(Og)return Og;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(Og=e.brands.map(t=>t.brand+"/"+t.version).join(" "),Og):navigator.userAgent}function $o(e){return e instanceof ni(e).HTMLElement}function Yi(e){return e instanceof ni(e).Element}function oZ(e){return e instanceof ni(e).Node}function bD(e){return typeof ShadowRoot>"u"?!1:e instanceof ni(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 P4e(e){return["table","td","th"].includes(Hs(e))}function D_(e){const t=/firefox/i.test(iZ()),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 U_(){return/^((?!chrome|android).)*safari/i.test(iZ())}function PF(e){return["html","body","#document"].includes(Hs(e))}function aZ(e){return Yi(e)?e:e.contextElement}const sZ={x:1,y:1};function ad(e){const t=aZ(e);if(!$o(t))return sZ;const n=t.getBoundingClientRect(),{width:r,height:i,fallback:o}=rZ(t);let a=(o?ay(n.width):n.width)/r,s=(o?ay(n.height):n.height)/i;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}function Ru(e,t,n,r){var i,o;t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),s=aZ(e);let l=sZ;t&&(r?Yi(r)&&(l=ad(r)):l=ad(e));const u=s?ni(s):window,c=U_()&&n;let f=(a.left+(c&&((i=u.visualViewport)==null?void 0:i.offsetLeft)||0))/l.x,p=(a.top+(c&&((o=u.visualViewport)==null?void 0:o.offsetTop)||0))/l.y,h=a.width/l.x,m=a.height/l.y;if(s){const g=ni(s),y=r&&Yi(r)?ni(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,m*=_.y,f+=b.x,p+=b.y,C=ni(C).frameElement}}return{width:h,height:m,top:p,right:f+h,bottom:p+m,left:f,x:f,y:p}}function Ls(e){return((oZ(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 lZ(e){return Ru(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 uZ(e){const t=zh(e);return PF(t)?t.ownerDocument.body:$o(t)&&vC(t)?t:uZ(t)}function su(e,t){var n;t===void 0&&(t=[]);const r=uZ(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=ni(r);return i?t.concat(o,o.visualViewport||[],vC(r)?r:[]):t.concat(r,su(r))}function CD(e,t,n){let r;if(t==="viewport")r=function(a,s){const l=ni(a),u=Ls(a),c=l.visualViewport;let f=u.clientWidth,p=u.clientHeight,h=0,m=0;if(c){f=c.width,p=c.height;const g=U_();(!g||g&&s==="fixed")&&(h=c.offsetLeft,m=c.offsetTop)}return{width:f,height:p,x:h,y:m}}(e,n);else if(t==="document")r=function(a){const s=Ls(a),l=yC(a),u=a.ownerDocument.body,c=Xp(s.scrollWidth,s.clientWidth,u.scrollWidth,u.clientWidth),f=Xp(s.scrollHeight,s.clientHeight,u.scrollHeight,u.clientHeight);let p=-l.scrollLeft+lZ(a);const h=-l.scrollTop;return Ro(u).direction==="rtl"&&(p+=Xp(s.clientWidth,u.clientWidth)-c),{width:c,height:f,x:p,y:h}}(Ls(e));else if(Yi(t))r=function(a,s){const l=Ru(a,!0,s==="fixed"),u=l.top+a.clientTop,c=l.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:u*f.y}}(t,n);else{const a={...t};if(U_()){var i,o;const s=ni(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 L_(r)}function SD(e,t){return $o(e)&&Ro(e).position!=="fixed"?t?t(e):e.offsetParent:null}function wD(e,t){const n=ni(e);let r=SD(e,t);for(;r&&P4e(r)&&Ro(r).position==="static";)r=SD(r,t);return r&&(Hs(r)==="html"||Hs(r)==="body"&&Ro(r).position==="static"&&!D_(r))?n:r||function(i){let o=zh(i);for(;$o(o)&&!PF(o);){if(D_(o))return o;o=zh(o)}return null}(e)||n}function W4e(e,t,n){const r=$o(t),i=Ls(t),o=Ru(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 l=Ru(t,!0);s.x=l.x+t.clientLeft,s.y=l.y+t.clientTop}else i&&(s.x=lZ(i));return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}const N4e={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=n==="clippingAncestors"?function(u,c){const f=c.get(u);if(f)return f;let p=su(u).filter(y=>Yi(y)&&Hs(y)!=="body"),h=null;const m=Ro(u).position==="fixed";let g=m?zh(u):u;for(;Yi(g)&&!PF(g);){const y=Ro(g),C=D_(g);y.position==="fixed"?h=null:(m?C||h:C||y.position!=="static"||!h||!["absolute","fixed"].includes(h.position))?h=y:p=p.filter(_=>_!==g),g=zh(g)}return c.set(u,p),p}(t,this._c):[].concat(n),a=[...o,r],s=a[0],l=a.reduce((u,c)=>{const f=CD(t,c,i);return u.top=Xp(f.top,u.top),u.right=yD(f.right,u.right),u.bottom=yD(f.bottom,u.bottom),u.left=Xp(f.left,u.left),u},CD(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.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 l={x:0,y:0};if((i||!i&&r!=="fixed")&&((Hs(n)!=="body"||vC(o))&&(a=yC(n)),$o(n))){const u=Ru(n);s=ad(n),l.x=u.x+n.clientLeft,l.y=u.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-a.scrollLeft*s.x+l.x,y:t.y*s.y-a.scrollTop*s.y+l.y}},isElement:Yi,getDimensions:function(e){return $o(e)?rZ(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:W4e(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 K4e(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:s=!1}=r,l=i&&!s,u=l||o?[...Yi(e)?su(e):e.contextElement?su(e.contextElement):[],...su(t)]:[];u.forEach(h=>{l&&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?Ru(e):null;return s&&function h(){const m=Ru(e);!p||m.x===p.x&&m.y===p.y&&m.width===p.width&&m.height===p.height||n(),p=m,c=requestAnimationFrame(h)}(),n(),()=>{var h;u.forEach(m=>{l&&m.removeEventListener("scroll",n),o&&m.removeEventListener("resize",n)}),(h=f)==null||h.disconnect(),f=null,s&&cancelAnimationFrame(c)}}const q4e=(e,t,n)=>{const r=new Map,i={platform:N4e,...n},o={...i.platform,_c:r};return E4e(e,t,{...i,platform:o})};var nv=typeof document<"u"?I.useLayoutEffect:I.useEffect;function sy(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(!sy(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)&&!sy(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function _D(e){const t=Fe.useRef(e);return nv(()=>{t.current=e}),t}function V4e(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,whileElementsMounted:o,open:a}=e,[s,l]=Fe.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[u,c]=Fe.useState(r);sy(u,r)||c(r);const f=Fe.useRef(null),p=Fe.useRef(null),h=Fe.useRef(s),m=_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:u};g.current&&(O.platform=g.current),q4e(f.current,p.current,O).then($=>{const B={...$,isPositioned:!0};T.current&&!sy(h.current,B)&&(h.current=B,SX.flushSync(()=>{l(B)}))})},[u,t,n,g]);nv(()=>{a===!1&&h.current.isPositioned&&(h.current.isPositioned=!1,l(O=>({...O,isPositioned:!1})))},[a]);const T=Fe.useRef(!1);nv(()=>(T.current=!0,()=>{T.current=!1}),[]),nv(()=>{if(y&&_){if(m.current)return m.current(y,_,w);w()}},[y,_,w,m]);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 z4e(){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 dw=!1,Q4e=0;const xD=()=>"floating-ui-"+Q4e++;function H4e(){const[e,t]=Fe.useState(()=>dw?xD():void 0);return $s(()=>{e==null&&t(xD())},[]),Fe.useEffect(()=>{dw||(dw=!0)},[]),e}const TD=Fe["useId".toString()],ID=TD??H4e,Y4e=Fe.createContext(null),G4e=Fe.createContext(null),cZ=()=>{var e,t;return(e=(t=Fe.useContext(Y4e))==null?void 0:t.id)!=null?e:null},WF=()=>Fe.useContext(G4e);function NF(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function dZ(e){var t;return(t=NF(e).defaultView)!=null?t:window}function rv(e){return e?e instanceof dZ(e).Element:!1}function J4e(e){return e?e instanceof dZ(e).HTMLElement:!1}const ED=Fe["useInsertionEffect".toString()];function B_(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[l,u]=Fe.useState(null),c=WF(),f=Fe.useRef(null),p=Fe.useRef({}),h=Fe.useState(()=>z4e())[0],m=V4e({placement:i,middleware:o,strategy:a,whileElementsMounted:r}),g=B_(n),y=Fe.useMemo(()=>({...m.refs,domReference:f}),[m.refs]),C=Fe.useMemo(()=>({...m,refs:y,dataRef:p,nodeId:s,events:h,open:t,onOpenChange:g,_:{domReference:l}}),[m,s,h,t,g,y,l]);$s(()=>{const v=c==null?void 0:c.nodesRef.current.find(S=>S.id===s);v&&(v.context=C)});const{reference:_}=m,b=Fe.useCallback(v=>{(rv(v)||v===null)&&(C.refs.domReference.current=v,u(v)),_(v)},[_,C.refs]);return Fe.useMemo(()=>({...m,context:C,refs:y,reference:b}),[m,y,C,b])}function fw(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,l]=a;if(s.indexOf("on")===0){if(r.has(s)||r.set(s,[]),typeof l=="function"){var u;(u=r.get(s))==null||u.push(l),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(m=>m(...p))}}}else i[s]=l}),i),{})}}const X4e=function(e){return e===void 0&&(e=[]),{getReferenceProps:t=>fw(t,e,"reference"),getFloatingProps:t=>fw(t,e,"floating"),getItemProps:t=>fw(t,e,"item")}};function pw(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(l=>{var u;return a.parentId===l.id&&((u=a.context)==null?void 0:u.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 e9e(e){return"composedPath"in e?e.composedPath()[0]:e.target}function vs(e){e.preventDefault(),e.stopPropagation()}function t9e(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 n9e=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 hw(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 r9e=function(e,t){let{open:n,onOpenChange:r,refs:i,events:o,nodeId:a}=e,{enabled:s=!0,escapeKey:l=!0,outsidePointerDown:u=!0,referencePointerDown:c=!1,ancestorScroll:f=!1,bubbles:p=!0}=t===void 0?{}:t;const h=WF(),m=cZ()!=null,g=Fe.useRef(!1);return Fe.useEffect(()=>{if(!n||!s)return;function y(S){if(S.key==="Escape"){if(!p&&h&&pw(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=e9e(S);if(rv(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&&pw(h.nodesRef.current,a).some(O=>{var $;return hw(S,($=O.context)==null?void 0:$.refs.floating.current)});hw(S,i.floating.current)||hw(S,i.domReference.current)||R||!p&&h&&pw(h.nodesRef.current,a).length>0||(o.emit("dismiss",m?{preventScroll:!0}:!1),r(!1))}function _(){r(!1)}const b=NF(i.floating.current);l&&b.addEventListener("keydown",y),u&&b.addEventListener("pointerdown",C);const v=(f?[...rv(i.reference.current)?su(i.reference.current):[],...rv(i.floating.current)?su(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})),()=>{l&&b.removeEventListener("keydown",y),u&&b.removeEventListener("pointerdown",C),v.forEach(S=>S.removeEventListener("scroll",_))}},[l,u,o,h,a,n,r,f,s,p,i,m]),s?{reference:{onPointerDown(){c&&(o.emit("dismiss"),r(!1))}},floating:{onPointerDownCapture(){g.current=!0}}}:{}},KF="ArrowUp",bC="ArrowDown",Dd="ArrowLeft",og="ArrowRight";function Mg(e,t,n){return Math.floor(e/t)!==n}function wp(e,t){return t<0||t>=e.current.length}function Gn(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 l,u;s=s+(r?-o:o)}while(s>=0&&s<=a.length-1&&(i?i.includes(s):a[s]==null||(l=a[s])!=null&&l.hasAttribute("disabled")||((u=a[s])==null?void 0:u.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===KF||e===bC,e===Dd||e===og)}function Aw(e,t,n){return CC(t,e===bC,n?e===Dd:e===og)||e==="Enter"||e==" "||e===""}function i9e(e,t,n){return CC(t,n?e===Dd:e===og,e===bC)}function o9e(e,t,n){return CC(t,n?e===og:e===Dd,e===KF)}function mw(e,t){return Gn(e,{disabledIndices:t})}function OD(e,t){return Gn(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}const a9e=function(e,t){let{open:n,onOpenChange:r,refs:i}=e,{listRef:o,activeIndex:a,onNavigate:s=()=>{},enabled:l=!0,selectedIndex:u=null,allowEscape:c=!1,loop:f=!1,nested:p=!1,rtl:h=!1,virtual:m=!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(" ")),m||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=cZ(),w=WF(),T=$D(n),E=B_(s),R=B_($D(s)),O=Fe.useRef(g),$=Fe.useRef(u??-1),B=Fe.useRef(null),K=t9e(_),H=Fe.useRef(!1),z=Fe.useRef(-1),[N,Y]=Fe.useState(),ee=Fe.useCallback((M,W)=>{z.current=requestAnimationFrame(()=>{if(m){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})}})},[m]);$s(()=>{l&&(!T&&n&&O.current&&u!=null&&E(u),T&&!n&&(cancelAnimationFrame(z.current),$.current=-1,R(null)))},[n,T,u,o,ee,l,E,R]),$s(()=>{if(l&&n)if(a==null){if(u!=null)return;T&&($.current=-1,ee(o,$)),!T&&O.current&&(B.current!=null||O.current===!0&&B.current==null)&&($.current=B.current==null||Aw(B.current,b,h)||p?mw(o,K.current):OD(o,K.current),E($.current),ee(o,$))}else wp(o,a)||($.current=a,ee(o,$))},[n,T,a,u,p,o,E,ee,l,c,b,h,m,K]),$s(()=>{if(l&&!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(NF(re)))&&re.focus({preventScroll:!0})}},[l,n,T,w,S]),$s(()=>{B.current=null});function F(M){if(H.current=!0,p&&o9e(M.key,b,h)){vs(M),r(!1),J4e(i.domReference.current)&&i.domReference.current.focus();return}const W=$.current,re=mw(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===KF){if(vs(M),Ce===-1)$.current=Ie;else if($.current=Gn(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=Gn(o,{startingIndex:Ce,amount:v,disabledIndices:_}),f&&Ce+v>Ie&&($.current=Gn(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===og&&(vs(M),Ce%v!==v-1?($.current=Gn(o,{startingIndex:Ce,disabledIndices:_}),f&&Mg($.current,v,P)&&($.current=Gn(o,{startingIndex:Ce-Ce%v-1,disabledIndices:_}))):f&&($.current=Gn(o,{startingIndex:Ce-Ce%v-1,disabledIndices:_})),Mg($.current,v,P)&&($.current=Ce)),M.key===Dd&&(vs(M),Ce%v!==0?($.current=Gn(o,{startingIndex:Ce,disabledIndices:_,decrement:!0}),f&&Mg($.current,v,P)&&($.current=Gn(o,{startingIndex:Ce+(v-Ce%v),decrement:!0,disabledIndices:_}))):f&&($.current=Gn(o,{startingIndex:Ce+(v-Ce%v),decrement:!0,disabledIndices:_})),Mg($.current,v,P)&&($.current=Ce));const ae=Math.floor(Ie/v)===P;wp(o,$.current)&&(f&&ae?$.current=M.key===Dd?Ie:Gn(o,{startingIndex:Ce-Ce%v-1,disabledIndices:_}):$.current=Ce),E($.current);return}}if(kD(M.key,b)){if(vs(M),n&&!m&&RD(M.currentTarget.ownerDocument)===M.currentTarget){$.current=Aw(M.key,b,h)?re:Ie,E($.current);return}Aw(M.key,b,h)?f?$.current=W>=Ie?c&&W!==o.current.length?-1:re:Gn(o,{startingIndex:W,disabledIndices:_}):$.current=Math.min(Ie,Gn(o,{startingIndex:W,disabledIndices:_})):f?$.current=W<=re?c&&W!==-1?o.current.length:Ie:Gn(o,{startingIndex:W,decrement:!0,disabledIndices:_}):$.current=Math.max(re,Gn(o,{startingIndex:W,decrement:!0,disabledIndices:_})),wp(o,$.current)?E(null):E($.current)}}return l?{reference:{...m&&n&&a!=null&&{"aria-activedescendant":N},onKeyDown(M){if(H.current=!0,m&&n)return F(M);if((M.key.indexOf("Arrow")===0||M.key==="Enter"||M.key===" "||M.key==="")&&(B.current=M.key),p){i9e(M.key,b,h)&&(vs(M),n?($.current=mw(o,_),E($.current)):r(!0));return}kD(M.key,b)&&(u!=null&&($.current=u),vs(M),!n&&C?r(!0):F(M),n&&E($.current))}},floating:{"aria-orientation":b==="both"?void 0:b,...m&&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),!m)){var M;(M=i.floating.current)==null||M.focus({preventScroll:!0})}}}}}:{}};function s9e(e){var t;const{char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:o,startOfLine:a,$position:s}=e,l=r&&!i,u=v3e(n),c=new RegExp(`\\s${u}$`),f=a?"^":"",p=i?"":u,h=l?new RegExp(`${f}${u}.*?(?=\\s${p}|$)`,"gm"):new RegExp(`${f}(?:^)?${u}[^\\s${p}]*`,"gm"),m=((t=s.nodeBefore)===null||t===void 0?void 0:t.isText)&&s.nodeBefore.text;if(!m)return null;const g=s.pos-m.length,y=Array.from(m.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 l&&c.test(m.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 l9e=new qn("suggestion");function u9e({pluginKey:e=l9e,editor:t,char:n="@",allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:o=[" "],startOfLine:a=!1,decorationTag:s="span",decorationClass:l="suggestion",command:u=()=>null,items:c=()=>[],render:f=()=>({}),allow:p=()=>!0,findSuggestionMatch:h=s9e}){let m;const g=f==null?void 0:f(),y=new Sn({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}"]`);m={editor:t,range:F.range,query:F.query,text:F.text,items:[],command:W=>u({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,m)),Y&&((w=g==null?void 0:g.onBeforeUpdate)===null||w===void 0||w.call(g,m)),(Y||N)&&(m.items=await c({editor:t,query:F.query})),ee&&((T=g==null?void 0:g.onExit)===null||T===void 0||T.call(g,m)),Y&&((E=g==null?void 0:g.onUpdate)===null||E===void 0||E.call(g,m)),N&&((R=g==null?void 0:g.onStart)===null||R===void 0||R.call(g,m))},destroy:()=>{var C;m&&((C=g==null?void 0:g.onExit)===null||C===void 0||C.call(g,m))}}},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 _?Ot.create(C.doc,[fr.inline(b.from,b.to,{nodeName:s,class:l,"data-decoration-id":v})]):null}}});return y}const fZ=["ArrowDown","ArrowUp","End","Home"],pZ=["Enter"],c9e=["Escape",...fZ,...pZ],d9e=jn.create({name:"slash-commands",addOptions(){return{nodeTypes:[]}},addProseMirrorPlugins(){const e=sv(oX,this.options.nodeTypes);return e.length>1?[u9e({allowSpaces:!0,char:"/",editor:this.editor,startOfLine:!0,allow:({state:t})=>{const n=t.selection.$from;return n.parent.type.name===Fr.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 PJ(f9e,{editor:n.editor,props:n}),document.body.appendChild(t.element)},onUpdate:n=>{t==null||t.updateProps(n)},onKeyDown:({event:n})=>{var r;return!!(c9e.includes(n.key)&&((r=t==null?void 0:t.ref)!=null&&r.handleKeyDown(n)))},onExit:()=>{t==null||t.destroy(),t==null||t.element.remove()}}}})]:[]}}),f9e=I.forwardRef(function(t,n){const{command:r,decorationNode:i,editor:o,items:a}=t,[s,l]=I.useState(!0),{context:u,floating:c,reference:f,x:p,y:h}=Z4e({middleware:[D4e(0),L4e(),U4e({limiter:B4e()})],onOpenChange:l,open:s,placement:"top-start",strategy:"fixed",whileElementsMounted:K4e});I.useLayoutEffect(()=>{f(i)},[f,i]),I.useEffect(()=>{let T;const E=()=>{T=window.setTimeout(()=>{l(!0)})},R=()=>{l(!1)};return o.on("focus",E).on("blur",R),()=>{o.off("focus",E).off("blur",R),clearTimeout(T)}},[o]);const[m,g]=I.useState(0),y=I.useRef([]);ze.useOnChange(a,()=>{g(0),y.current=[]});const{getFloatingProps:C,getItemProps:_,getReferenceProps:b}=X4e([r9e(u,{outsidePointerDown:!1}),a9e(u,{activeIndex:m,listRef:y,onNavigate:T=>{g(E=>T??E)},openOnArrowKeyDown:!1,virtual:!0}),n9e(u,{role:"menu"})]),S=b().onKeyDown;I.useImperativeHandle(n,()=>({handleKeyDown:T=>{if(s){if(fZ.includes(T.key)&&S(T),pZ.includes(T.key)){const E=a[m];E!==void 0&&r(E)}return!0}else return!1}}),[m,r,a,S,s]);const w=p!==null&&h!==null;return s?d.jsxs(A.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===m,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:l=!1,...u}=t;return d.jsx("div",{...u,role:"button",style:{cursor:i?"default":"pointer"},ref:n,children:d.jsxs(A.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(A.Text,{color:"grey12",component:"span",children:r}),o&&d.jsx(A.Text,{color:"inherit",component:"span",variant:"small",children:o})]})})});function p9e(e,t){var l,u;const n=t.map(c=>c.richTextNodeTypes).flat(),i={placeholderByNodeType:h9e(t),unfocusedPlaceholder:(l=e.config)==null?void 0:l.placeholder,nodeExtensions:t},o=n.includes(au.orderedList)||n.includes(au.list),a=!n.includes(au.table);return[F_.component(((u=e.config)==null?void 0:u.single)===void 0),Eu.component,ry.component,a?T4e(i):void 0,o?Ld.component:void 0,d9e.configure({nodeTypes:n})].filter(Qi.isDefined)}function h9e(e){return e.reduce((t,n)=>(n.nodeType===Hl.Text&&(t[n.name]=n.placeholder),t),{})}const P_=J6e.extend({name:"bulletList",parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",xt(this.options.HTMLAttributes,e),0]}}).configure({itemTypeName:"listItem"}),A9e={fromPrismic(e){return function(t){var r;const n=Ld.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[P_.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()}},m9e=new DF([he.RichTextNodeType.list],P_.name,P_,A9e),ly=m9e,g9e=/^```([a-z]+)?[\s\n]$/,v9e=/^~~~([a-z]+)?[\s\n]$/,y9e=mn.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",xt(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:u})=>(u.setSelection(je.near(r.resolve(s))),!0)):e.commands.exitCode()}}},addInputRules(){return[I_({find:g9e,type:this.type,getAttributes:e=>({language:e[1]})}),I_({find:v9e,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Sn({key:new qn("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,l=s.text(n.replace(/\r\n?/g,`
137
+ `));return a.replaceSelectionWith(this.type.create({language:o},l)),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=y9e.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",xt(this.options.HTMLAttributes),["code",e,0]]}}).configure({exitOnTripleEnter:!1}),b9e={fromPrismic(e){return function(t){var r;const n=Eu.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 Eu.converter.toPrismic(e,he.RichTextNodeType.preformatted,Ia.toPrismic(e))}},C9e=new rg([he.RichTextNodeType.preformatted],uy.name,uy,b9e,"",!0),hZ=C9e;function AZ(e){const{editor:t,getPos:n,node:r}=e,[i,o]=I.useState(!1);return I.useEffect(()=>{function a(){const{from:l,to:u}=t.state.selection,c=n(),f=n()+r.nodeSize,p=l<=c&&u>=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 S9e(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 l(c){a.set(c),ri.toURL(c)||s(void 0)}const{onKeyDown:u}=w9e(e,a.value,t,n);return{inputRef:t,containerRef:n,onKeyDown:u,url:a.value,urlChanged:l,onContentChange:s,debouncedUrl:a.debouncedValue,content:e.node.attrs.content}}function w9e(e,t,n,r){const{editor:i,getPos:o,node:a}=e,[s,l]=I.useState(!0);I.useEffect(()=>{!s||!e.editor.isFocused||A.handleEditorFlushSyncError(()=>{var c;return(c=n.current)==null?void 0:c.focus()})},[n,s,e.editor.isFocused]);function u(c){const f=o(),p=o()+a.nodeSize;c.code==="Enter"&&(l(!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"&&(l(!1),i.chain().focus(f-1).run()),c.code==="ArrowDown"&&(l(!1),i.chain().focus(p+1).run())}return{containerRef:r,inputRef:n,onKeyDown:u}}function _9e(e){const t=I.useRef(null),n=I.useRef(null),{onKeyDown:r,url:i,urlChanged:o,onContentChange:a,debouncedUrl:s,content:l}=S9e(e,t,n),{selected:u}=AZ(e);return d.jsx(BJ,{className:"custom-embed",children:d.jsxs("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:[d.jsxs(A.Box,{flexGrow:1,alignItems:"center",children:[d.jsx(A.Icon,{size:"small",name:"cloud",color:"grey11"}),d.jsx(A.Box,{flexGrow:1,height:40,ref:n,children:d.jsx(Tl,{id:"id",ref:t,value:i,variant:ri.toURL(i)?"link":"normal",placeholder:"Paste your link here",onValueChange:o,onKeyDown:r})})]}),ri.toURL(i)&&d.jsx(QH,{selected:u,debouncedUrl:s,onContentChange:a,content:l})]})})}const W_=mn.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 WJ(_9e)}}),x9e={fromPrismic(e){return function(t){var n;return(n=e.nodes[W_.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}}}},mZ=new U6e([he.RichTextNodeType.embed],W_.name,W_,x9e),T9e=mn.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]}`,xt(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=>I_({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),N_="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 gZ=[1,2,3,4,5,6];function vZ(e,t=gZ){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 yZ(e,t){const n=e.level;if(t.includes(n))return{fullName:SC(n),level:n}}const I9e=e=>{const t=e[0]??1;return{fromPrismic(n){return function(r){var a;const i=Eu.converter.fromPrismic(n)(N_,r),o=vZ(r.type,e)||FD(t);return(a=n.nodes[N_])==null?void 0:a.create({level:o.level,...Ia.fromPrismic(r)},i)}},toPrismic(n){const{fullName:r}=yZ(n.attrs,e)||FD(t);return Eu.converter.toPrismic(n,r,Ia.toPrismic(n))}}};function E9e(e){return e?e.size?Array.from(e.values()).reduce((n,r)=>{const i=vZ(r);return i?[...n,i.level]:n},[]).sort((n,r)=>n-r):[]:gZ}function R9e(e){return T9e.extend({name:"heading"}).configure({levels:e})}const Wl={name:N_,build:e=>{const t=E9e(e);if(!t)return;const n=t.map(r=>SC(r));return new P6e(n,R9e(t),t,I9e(t),r=>{const i=yZ(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,l]=I.useTransition();function u(g){l(()=>i({content:g}))}function c(g){const y=Bg(g),C=r()+a.nodeSize;u({...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=nY({content:t,croppedImage:y});C!==t&&u(C)}function p(){const g=r(),y=r()+a.nodeSize;o.chain().deleteRange({from:g,to:y}).focus(y).run()}const{uploadImage:h,isUploadingImage:m}=mY({onMediaSelected:c});return{onMediaSelected:c,onCropperDialogClose:f,isUpdating:s,updateContent:u,onClear:p,uploadImage:h,isUploadingImage:m}}function k9e(e){const{node:t}=e,n=t.attrs.content,{selected:r}=AZ(e),i=I.useRef(null),o={width:void 0,height:void 0,name:fp},{onMediaSelected:a,onCropperDialogClose:s,isUpdating:l,updateContent:u,onClear:c,uploadImage:f,isUploadingImage:p}=$9e({content:n,thumbnail:o,imageViewProps:e}),[h,m]=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:e_(o,n,n)};I.useLayoutEffect(()=>{var S;const v=(S=i==null?void 0:i.current)==null?void 0:S.closest(`.${bZ}`);yX.isHTMLElement(v)&&v.style.removeProperty("min-height")},[]);const b=p||l;return d.jsx(BJ,{children:d.jsx(XH,{ref:i,isMediaDialogOpen:h,selected:r,onMediaSelected:a,onMediaDialogOpenChange:m,children:d.jsx(I.Suspense,{fallback:F9e,children:n!=null&&n.url?d.jsx(AY,{allContentViews:[n],content:n,contentView:n,fieldLabel:g,imageLabel:C,initialImages:[_],isUpdating:b,readOnly:!1,thumbnailName:o.name,onClear:c,onContentChange:u,onCropperDialogClose:s,onMediaDialogOpenChange:m}):d.jsx(eY,{uploadImage:f,isUploading:p,disabled:h,children:d.jsx(GH,{fieldLabel:g,isUpdating:b,readOnly:!1,onMediaDialogOpenChange:m})})})})})}const bZ="imageViewNodeWrapper",CZ=144,O9e=94;function M9e(e){return(e?O9e:CZ)+12+12+1+1}const F9e=d.jsx("div",{style:{height:CZ}}),K_=mn.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 WJ(k9e,{attrs:{style:`min-height: ${M9e(n)}px`,class:bZ}})(t)}}}),j9e={fromPrismic(e){return function(t){var n;return(n=e.nodes[K_.name])==null?void 0:n.create({content:t.data})}},toPrismic(e){if(e.attrs.content!==void 0)return{type:"image",data:{...e.attrs.content}}}},SZ=new B6e([he.RichTextNodeType.image],K_.name,K_,j9e),L9e=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,D9e=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,U9e=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,B9e=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,P9e=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",xt(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[Yv({find:L9e,type:this.type}),Yv({find:U9e,type:this.type})]},addPasteRules(){return[Jv({find:D9e,type:this.type}),Jv({find:B9e,type:this.type})]}});class W9e{constructor(t,n,r){$t(this,"extType",Mc.Mark);$t(this,"richTextNodeTypes",[he.RichTextNodeType.em]);this.name=t,this.component=n,this.converter=r}}const wZ="em",_Z=P9e.extend({name:wZ}),N9e={fromPrismic(e){return function(){var t;return(t=e.marks[_Z.name])==null?void 0:t.create()}},toPrismic(){}},K9e=new W9e(wZ,_Z,N9e),qF=K9e;class q9e{constructor(t,n,r){$t(this,"extType",Mc.Mark);$t(this,"richTextNodeTypes",[]);this.name=t,this.component=n,this.converter=r}}const xZ="label",q_=Zm.create({name:xZ,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",xt(this.options.htmlAttributes,e),0]}}),V9e={fromPrismic(e){return function(t){var i;const n=t.data,r={type:q_.name,label:n};return(i=e.marks[q_.name])==null?void 0:i.create(r)}},toPrismic(e){return e.attrs.label}},VF=new q9e(xZ,q_,V9e);class z9e{constructor(t,n,r){$t(this,"extType",Mc.Mark);$t(this,"richTextNodeTypes",[he.RichTextNodeType.hyperlink]);this.name=t,this.component=n,this.converter=r}}const TZ="hyperlink",pa=Zm.create({name:TZ,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",xt(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=V_(dY({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()}}}),Q9e={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:V_(n)};return(i=e.marks[pa.name])==null?void 0:i.create(s)}if(n.__TYPE__==="FileLink"){const s={type:pa.name,media:V_(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?EZ(e.attrs.media):e.attrs.id?{__TYPE__:"DocumentLink",id:e.attrs.id}:{__TYPE__:"ExternalLink",url:e.attrs.href,target:e.attrs.target}}},IZ=new z9e(TZ,pa,Q9e);function V_(e){return JSON.stringify(e)}function EZ(e){return JSON.parse(e)}const H9e="listItem",jD="textStyle",LD=/^(\d+)\.\s$/,Y9e=mn.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",xt(this.options.HTMLAttributes,n),0]:["ol",xt(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(H9e,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=Gv({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=Gv({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]}}),z_=Y9e.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",xt(this.options.HTMLAttributes,n),0]:["ol",xt(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"}),G9e={fromPrismic(e){return function(t){var r;const n=Ld.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[z_.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()}},J9e=new DF([he.RichTextNodeType.orderedList],z_.name,z_,G9e),cy=J9e,RZ=65535,$Z=Math.pow(2,16);function Z9e(e,t){return e+t*$Z}function DD(e){return e&RZ}function X9e(e){return(e-(e&RZ))/$Z}const kZ=1,OZ=2,iv=4,MZ=8;class Q_{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&MZ)>0}get deletedBefore(){return(this.delInfo&(kZ|iv))>0}get deletedAfter(){return(this.delInfo&(OZ|iv))>0}get deletedAcross(){return(this.delInfo&iv)>0}}class Xr{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Xr.empty)return Xr.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+X9e(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 l=this.ranges[s]-(this.inverted?i:0);if(l>t)break;let u=this.ranges[s+o],c=this.ranges[s+a],f=l+u;if(t<=f){let p=u?t==l?-1:t==f?1:n:n,h=l+i+(p<0?0:c);if(r)return h;let m=t==(n<0?l:f)?null:Z9e(s/3,t-l),g=t==l?OZ:t==f?kZ:iv;return(n<0?t!=l:t!=f)&&(g|=MZ),new Q_(h,g,m)}i+=c-u}return r?t+i:new Q_(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 l=this.ranges[s]-(this.inverted?r:0);if(l>t)break;let u=this.ranges[s+o],c=l+u;if(t<=c&&s==i*3)return!0;r+=this.ranges[s+a]-u}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),l=a+(this.inverted?0:o),u=this.ranges[i+n],c=this.ranges[i+r];t(s,s+u,l,l+c),o+=c-u}}invert(){return new Xr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Xr.empty:new Xr(t<0?[0,-t,0]:[0,0,t])}}Xr.empty=new Xr([]);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 l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,t=this.maps[l].recover(s.recover);continue}}i|=s.delInfo,t=s.pos}return r?t:new Q_(t,i,null)}}const gw=Object.create(null);class ar{getMap(){return Xr.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=gw[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 gw)throw new RangeError("Duplicate use of step JSON ID "+t);return gw[t]=n,n.prototype.jsonID=t,n}}class en{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new en(t,null)}static fail(t){return new en(null,t)}static fromReplace(t,n,r,i){try{return en.ok(t.replace(n,r,i))}catch(o){if(o instanceof wu)return en.fail(o.message);throw o}}}function zF(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(zF(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(zF(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 en.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(zF(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return en.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 en.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return en.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 en.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return en.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 ur 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&&H_(t,this.from,this.to)?en.fail("Structure replace would overwrite content"):en.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Xr([this.from,this.to-this.from,this.slice.size])}invert(t){return new ur(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 ur(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof ur)||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 ur(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 ur(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 ur(n.from,n.to,V.fromJSON(t,n.slice),!!n.structure)}}ar.jsonID("replace",ur);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&&(H_(t,this.from,this.gapFrom)||H_(t,this.gapTo,this.to)))return en.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return en.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?en.fromReplace(t,this.from,this.to,r):en.fail("Content does not fit in gap")}getMap(){return new Xr([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 H_(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 e8e(e,t,n,r){let i=[],o=[],a,s;e.doc.nodesBetween(t,n,(l,u,c)=>{if(!l.isInline)return;let f=l.marks;if(!r.isInSet(f)&&c.type.allowsMarkType(r.type)){let p=Math.max(u,t),h=Math.min(u+l.nodeSize,n),m=r.addToSet(f);for(let g=0;g<f.length;g++)f[g].isInSet(m)||(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(l=>e.step(l)),o.forEach(l=>e.step(l))}function t8e(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,(a,s)=>{if(!a.isInline)return;o++;let l=null;if(r instanceof rC){let u=a.marks,c;for(;c=r.isInSet(u);)(l||(l=[])).push(c),u=c.removeFromSet(u)}else r?r.isInSet(a.marks)&&(l=[r]):l=a.marks;if(l&&l.length){let u=Math.min(s+a.nodeSize,n);for(let c=0;c<l.length;c++){let f=l[c],p;for(let h=0;h<i.length;h++){let m=i[h];m.step==o-1&&f.eq(i[h].style)&&(p=m)}p?(p.to=u,p.step=o):i.push({style:f,from:Math.max(s,t),to:u,step:o})}}}),i.forEach(a=>e.step(new To(a.from,a.to,a.style)))}function QF(e,t,n,r=n.contentMatch,i=!0){let o=e.doc.nodeAt(t),a=[],s=t+1;for(let l=0;l<o.childCount;l++){let u=o.child(l),c=s+u.nodeSize,f=r.matchType(u.type);if(!f)a.push(new ur(s,c,V.empty));else{r=f;for(let p=0;p<u.marks.length;p++)n.allowsMarkType(u.marks[p].type)||e.step(new To(s,c,u.marks[p]));if(i&&u.isText&&n.whitespace!="pre"){let p,h=/\r?\n|\r/g,m;for(;p=h.exec(u.text);)m||(m=new V(q.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),a.push(new ur(s+p.index,s+p.index+p[0].length,m))}}s=c}if(!r.validEnd){let l=r.fillBefore(q.empty,!0);e.replace(s,s,new V(l,0,0))}for(let l=a.length-1;l>=0;l--)e.step(a[l])}function n8e(e,t,n){let{$from:r,$to:i,depth:o}=t,a=r.before(o+1),s=i.after(o+1),l=a,u=s,c=q.empty,f=0;for(let m=o,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,c=q.from(r.node(m).copy(c)),f++):l--;let p=q.empty,h=0;for(let m=o,g=!1;m>n;m--)g||i.after(m+1)<i.end(m)?(g=!0,p=q.from(i.node(m).copy(p)),h++):u++;e.step(new ko(l,u,a,s,new V(c.append(p),f,h),c.size-f,!0))}function r8e(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 i8e(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 l=typeof i=="function"?i(a):i;if(a.isTextblock&&!a.hasMarkup(r,l)&&o8e(e.doc,e.mapping.slice(o).map(s),r)){let u=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!m?u=!1:!h&&m&&(u=!0)}u===!1&&jZ(e,a,s,o),QF(e,e.mapping.slice(o).map(s,1),r,void 0,u===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(l,null,a.marks)),0,0),1,!0)),u===!0&&FZ(e,a,s,o),!1}})}function FZ(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 l=e.mapping.slice(r).map(n+1+o+a.index);e.replaceWith(l,l+1,t.type.schema.linebreakReplacement.create())}}})}function jZ(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 o8e(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function a8e(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 s8e(e,t,n=1,r){let i=e.doc.resolve(t),o=q.empty,a=q.empty;for(let s=i.depth,l=i.depth-n,u=n-1;s>l;s--,u--){o=q.from(i.node(s).copy(o));let c=r&&r[u];a=q.from(c?c.type.create(c.attrs,a):i.node(s).copy(a))}e.step(new ur(t,t,new V(o.append(a),n,n),!0))}function l8e(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);jZ(e,c.node(),c.before(),s)}a.inlineContent&&QF(e,t+n-1,a,o.node().contentMatchAt(o.index()),r==null);let l=e.mapping.slice(s),u=l.map(t-n);if(e.step(new ur(u,l.map(t+n,-1),V.empty,!0)),r===!0){let c=e.doc.resolve(u);FZ(e,c.node(),c.before(),e.steps.length)}return e}function u8e(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 c8e(e,t,n=t,r=V.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return LZ(i,o,r)?new ur(t,n,r):new d8e(i,o,r).fit()}function LZ(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class d8e{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 u=this.findFittable();u?this.placeNodes(u):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 l=new V(o,a,s);return t>-1?new ko(r.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new ur(r.pos,i.pos,l):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=vw(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:l,match:u}=this.frontier[s],c,f=null;if(n==1&&(a?u.matchType(a.type)||(f=u.fillBefore(q.from(a),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:s,parent:o,inject:f};if(n==2&&a&&(c=u.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:s,parent:o,wrap:c};if(o&&u.matchType(o.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=vw(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=vw(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,l=a.openStart-t,u=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(;u<s.childCount;){let g=s.child(u),y=f.matchType(g.type);if(!y)break;u++,(u>1||l==0||g.content.size)&&(f=y,c.push(DZ(g.mark(p.allowedMarks(g.marks)),u==1?l:0,u==s.childCount?h:-1)))}let m=u==s.childCount;m||(h=-1),this.placed=qp(this.placed,n,q.from(c)),this.frontier[n].match=f,m&&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=m?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,u),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!yw(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=yw(t,n,i,r,o);if(a){for(let s=n-1;s>=0;s--){let{match:l,type:u}=this.frontier[s],c=yw(t,s,u,l,!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 vw(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function DZ(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,DZ(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 yw(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&&!f8e(n,o.content,a)?s:null}function f8e(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function p8e(e){return e.spec.defining||e.spec.definingForContent}function h8e(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(LZ(i,o,r))return e.step(new ur(t,n,r));let a=BZ(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 m=i.node(p).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;a.indexOf(p)>-1?s=p:i.before(p)==h&&a.splice(1,0,-p)}let l=a.indexOf(s),u=[],c=r.openStart;for(let p=r.content,h=0;;h++){let m=p.firstChild;if(u.push(m),h==r.openStart)break;p=m.content}for(let p=c-1;p>=0;p--){let h=u[p],m=p8e(h.type);if(m&&!h.sameMarkup(i.node(Math.abs(s)-1)))c=p;else if(m||!h.type.isTextblock)break}for(let p=r.openStart;p>=0;p--){let h=(p+c+1)%(r.openStart+1),m=u[h];if(m)for(let g=0;g<a.length;g++){let y=a[(g+l)%a.length],C=!0;y<0&&(C=!1,y=-y);let _=i.node(y-1),b=i.index(y-1);if(_.canReplaceWith(b,b,m.type,m.marks))return e.replace(i.before(y),C?o.after(y):n,new V(UZ(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 UZ(e,t,n,r,i){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(UZ(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 A8e(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=u8e(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new V(q.from(r),0,0))}function m8e(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=BZ(r,i);for(let a=0;a<o.length;a++){let s=o[a],l=a==o.length-1;if(l&&s==0||r.node(s).type.contentMatch.validEnd)return e.delete(r.start(s),i.end(s));if(s>0&&(l||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 BZ(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 en.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 en.fromReplace(t,this.pos,this.pos+1,new V(q.from(i),0,n.isLeaf?0:1))}getMap(){return Xr.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 en.ok(r)}getMap(){return Xr.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 g8e{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=c8e(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 h8e(this,t,n,r),this}replaceRangeWith(t,n,r){return A8e(this,t,n,r),this}deleteRange(t,n){return m8e(this,t,n),this}lift(t,n){return n8e(this,t,n),this}join(t,n=1){return l8e(this,t,n),this}wrap(t,n){return r8e(this,t,n),this}setBlockType(t,n=t,r,i=null){return i8e(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i){return a8e(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 wt)){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 s8e(this,t,n,r),this}addMark(t,n,r){return e8e(this,t,n,r),this}removeMark(t,n,r){return t8e(this,t,n,r),this}clearIncompatible(t,n,r){return QF(this,t,n,r),this}}var Y_,G_;if(typeof WeakMap<"u"){let e=new WeakMap;Y_=t=>e.get(t),G_=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;Y_=r=>{for(let i=0;i<e.length;i+=2)if(e[i]==r)return e[i+1]},G_=(r,i)=>(n==10&&(n=0),e[n++]=r,e[n++]=i)}var St=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:l,bottom:u}=this.findCell(t);return{left:Math.min(n,a),top:Math.min(i,l),right:Math.max(r,s),bottom:Math.max(o,u)}}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 Y_(e)||G_(e,v8e(e))}};function v8e(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=y8e(e),n=e.childCount,r=[];let i=0,o=null;const a=[];for(let u=0,c=t*n;u<c;u++)r[u]=0;for(let u=0,c=0;u<n;u++){const f=e.child(u);c++;for(let m=0;;m++){for(;i<r.length&&r[i]!=0;)i++;if(m==f.childCount)break;const g=f.child(m),{colspan:y,rowspan:C,colwidth:_}=g.attrs;for(let b=0;b<C;b++){if(b+u>=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:u,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=(u+1)*t;let h=0;for(;i<p;)r[i++]==0&&h++;h&&(o||(o=[])).push({type:"missing",row:u,n:h}),c++}(t===0||n===0)&&(o||(o=[])).push({type:"zero_sized"});const s=new St(t,n,r,o);let l=!1;for(let u=0;!l&&u<a.length;u+=2)a[u]!=null&&a[u+1]<n&&(l=!0);return l&&b8e(s,a,e),s}function y8e(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 l=0;l<s.childCount;l++){const u=s.child(l);a+u.attrs.rowspan>r&&(o+=u.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 b8e(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 l=a.attrs;for(let u=0;u<l.colspan;u++){const c=(i+u)%e.width,f=t[c*2];f!=null&&(!l.colwidth||l.colwidth[u]!=f)&&((s||(s=C8e(l)))[u]=f)}s&&e.problems.unshift({type:"colwidth mismatch",pos:o,colwidth:s})}}function C8e(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function er(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 qn("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 S8e(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 li(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)||w8e(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function w8e(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 J_(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function _8e(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function HF(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function PZ(e,t,n){const r=e.node(-1),i=St.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 $u(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 WZ(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 x8e(e,t,n){const r=er(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 dt=class ha extends je{constructor(t,n=t){const r=t.node(-1),i=St.get(r),o=t.start(-1),a=i.rectBetween(t.pos-o,n.pos-o),s=t.node(0),l=i.cellsInRect(a).filter(c=>c!=n.pos-o);l.unshift(n.pos-o);const u=l.map(c=>{const f=r.nodeAt(c);if(!f)throw RangeError(`No cell with offset ${c} found`);const p=o+c+1;return new HY(s.resolve(p),s.resolve(p+f.content.size))});super(u[0].$from,u[0].$to,u),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(J_(r)&&J_(i)&&HF(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=St.get(t),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),o={},a=[];for(let l=i.top;l<i.bottom;l++){const u=[];for(let c=l*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 m=t.nodeAt(p);if(!m)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=m.attrs;if(g>0&&(C=$u(C,0,g)),y>0&&(C=$u(C,C.colspan-y,y)),h.left<i.left){if(m=m.type.createAndFill(C),!m)throw RangeError(`Could not create cell with attrs ${JSON.stringify(C)}`)}else m=m.type.create(C,m.content)}if(h.top<i.top||h.bottom>i.bottom){const C={...m.attrs,rowspan:Math.min(h.bottom,i.bottom)-Math.max(h.top,i.top)};h.top<i.top?m=m.type.createAndFill(C):m=m.type.create(C,m.content)}u.push(m)}a.push(t.child(l).copy(q.from(u)))}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:l}=i[a],u=t.mapping.slice(r);t.replace(u.map(s.pos),u.map(l.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=St.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=St.get(r),o=t.start(-1),a=i.findCell(t.pos-o),s=i.findCell(n.pos-o),l=t.node(0);return a.top<=s.top?(a.top>0&&(t=l.resolve(o+i.map[a.left])),s.bottom<i.height&&(n=l.resolve(o+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=l.resolve(o+i.map[s.left])),a.bottom<i.height&&(t=l.resolve(o+i.map[i.width*(i.height-1)+a.right-1]))),new ha(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=St.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=St.get(r),o=t.start(-1),a=i.findCell(t.pos-o),s=i.findCell(n.pos-o),l=t.node(0);return a.left<=s.left?(a.left>0&&(t=l.resolve(o+i.map[a.top*i.width])),s.right<i.width&&(n=l.resolve(o+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=l.resolve(o+i.map[s.top*i.width])),a.right<i.width&&(t=l.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 T8e(this.$anchorCell.pos,this.$headCell.pos)}};dt.prototype.visible=!1;je.jsonID("cell",dt);var T8e=class NZ{constructor(t,n){this.anchor=t,this.head=n}map(t){return new NZ(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&&HF(n,r)?new dt(n,r):je.near(r,1)}};function I8e(e){if(!(e.selection instanceof dt))return null;const t=[];return e.selection.forEachCell((n,r)=>{t.push(fr.node(r,r+n.nodeSize,{class:"selectedCell"}))}),Ot.create(e.doc,t)}function E8e({$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 R8e({$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=dt.create(i,r.from);else if(a=="row"){const s=i.resolve(r.from+1);o=dt.rowSelection(s,s)}else if(!n){const s=St.get(r.node),l=r.from+1,u=l+s.map[s.width*s.height-1];o=dt.create(i,l+1,u)}}else r instanceof Oe&&E8e(r)?o=Oe.create(i,r.from):r instanceof Oe&&R8e(r)&&(o=Oe.create(i,r.$from.start(),r.$from.end()));return o&&(t||(t=e.tr)).setSelection(o),t}var k8e=new qn("fix-tables");function KZ(e,t,n,r){const i=e.childCount,o=t.childCount;e:for(let a=0,s=0;a<o;a++){const l=t.child(a);for(let u=s,c=Math.min(i,a+3);u<c;u++)if(e.child(u)==l){s=u+1,n+=l.nodeSize;continue e}r(l,n),s<i&&e.child(s).sameMarkup(l)?KZ(e.child(s),l,n+1,r):l.nodesBetween(0,l.content.size,r,n+1),n+=l.nodeSize}}function qZ(e,t){let n;const r=(i,o)=>{i.type.spec.tableRole=="table"&&(n=O8e(e,i,o,n))};return t?t.doc!=e.doc&&KZ(t.doc,e.doc,0,r):e.doc.descendants(r),n}function O8e(e,t,n,r){const i=St.get(t);if(!i.problems)return r;r||(r=e.tr);const o=[];for(let l=0;l<i.height;l++)o.push(0);for(let l=0;l<i.problems.length;l++){const u=i.problems[l];if(u.type=="collision"){const c=t.nodeAt(u.pos);if(!c)continue;const f=c.attrs;for(let p=0;p<f.rowspan;p++)o[u.row+p]+=u.n;r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,$u(f,f.colspan-u.n,u.n))}else if(u.type=="missing")o[u.row]+=u.n;else if(u.type=="overlong_rowspan"){const c=t.nodeAt(u.pos);if(!c)continue;r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,{...c.attrs,rowspan:c.attrs.rowspan-u.n})}else if(u.type=="colwidth mismatch"){const c=t.nodeAt(u.pos);if(!c)continue;r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,{...c.attrs,colwidth:u.colwidth})}else if(u.type=="zero_sized"){const c=r.mapping.map(n);r.delete(c,c+t.nodeSize)}}let a,s;for(let l=0;l<o.length;l++)o[l]&&(a==null&&(a=l),s=l);for(let l=0,u=n+1;l<i.height;l++){const c=t.child(l),f=u+c.nodeSize,p=o[l];if(p>0){let h="cell";c.firstChild&&(h=c.firstChild.type.spec.tableRole);const m=[];for(let y=0;y<p;y++){const C=er(e.schema)[h].createAndFill();C&&m.push(C)}const g=(l==0||a==l-1)&&s==l?u+1:f-1;r.insert(r.mapping.map(g),m)}u=f}return r.setMeta(k8e,{fixTables:!0})}function Ri(e){const t=e.selection,n=wC(e),r=n.node(-1),i=n.start(-1),o=St.get(r);return{...t instanceof dt?o.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):o.findCell(n.pos-i),tableStart:i,map:o,table:r}}function YF(e,{map:t,tableStart:n,table:r},i){let o=i>0?-1:0;x8e(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 l=t.map[s],u=r.nodeAt(l);e.setNodeMarkup(e.mapping.map(n+l),null,WZ(u.attrs,i-t.colCount(l))),a+=u.attrs.rowspan-1}else{const l=o==null?er(r.type.schema).cell:r.nodeAt(t.map[s+o]).type,u=t.positionAt(a,i,r);e.insert(e.mapping.map(n+u),l.createAndFill())}}return e}function M8e(e,t){if(!li(e))return!1;if(t){const n=Ri(e);t(YF(e.tr,n,n.left))}return!0}function F8e(e,t){if(!li(e))return!1;if(t){const n=Ri(e);t(YF(e.tr,n,n.right))}return!0}function j8e(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,l=t.map[s],u=n.nodeAt(l),c=u.attrs;if(i>0&&t.map[s-1]==l||i<t.width-1&&t.map[s+1]==l)e.setNodeMarkup(e.mapping.slice(o).map(r+l),null,$u(c,i-t.colCount(l)));else{const f=e.mapping.slice(o).map(r+l);e.delete(f,f+u.nodeSize)}a+=c.rowspan}}function L8e(e,t){if(!li(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;j8e(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=St.get(o)}t(r)}return!0}function D8e(e,t,n){var r;const i=er(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 GF(e,{map:t,tableStart:n,table:r},i){var o;let a=n;for(let u=0;u<i;u++)a+=r.child(u).nodeSize;const s=[];let l=i>0?-1:0;D8e(t,r,i+l)&&(l=i==0||i==t.height?null:0);for(let u=0,c=t.width*i;u<t.width;u++,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}),u+=p.colspan-1}else{const f=l==null?er(r.type.schema).cell:(o=r.nodeAt(t.map[c+l*t.width]))==null?void 0:o.type,p=f==null?void 0:f.createAndFill();p&&s.push(p)}return e.insert(a,er(r.type.schema).row.create(null,s)),e}function U8e(e,t){if(!li(e))return!1;if(t){const n=Ri(e);t(GF(e.tr,n,n.top))}return!0}function B8e(e,t){if(!li(e))return!1;if(t){const n=Ri(e);t(GF(e.tr,n,n.bottom))}return!0}function P8e(e,{map:t,table:n,tableStart:r},i){let o=0;for(let u=0;u<i;u++)o+=n.child(u).nodeSize;const a=o+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(o+r,a+r);const l=new Set;for(let u=0,c=i*t.width;u<t.width;u++,c++){const f=t.map[c];if(!l.has(f)){if(l.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}),u+=p.colspan-1}else if(i<t.height&&f==t.map[c+t.width]){const p=n.nodeAt(f),h=p.attrs,m=p.type.create({...h,rowspan:p.attrs.rowspan-1},p.content),g=t.positionAt(i+1,u,n);e.insert(e.mapping.slice(s).map(r+g),m),u+=h.colspan-1}}}}function W8e(e,t){if(!li(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;P8e(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=St.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 N8e({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 l=r.top;l<r.bottom;l++){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 l=r.left;l<r.right;l++){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 dt)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=Ri(e),{map:i}=r;if(N8e(i,r))return!1;if(t){const o=e.tr,a={};let s=q.empty,l,u;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,l==null)l=p,u=h;else{UD(h)||(s=s.append(h.content));const m=o.mapping.map(p+r.tableStart);o.delete(m,m+h.nodeSize)}}if(l==null||u==null)return!0;if(o.setNodeMarkup(l+r.tableStart,null,{...WZ(u.attrs,u.attrs.colspan,r.right-r.left-u.attrs.colspan),rowspan:r.bottom-r.top}),s.size){const c=l+1+u.content.size,f=UD(u)?l+1:c;o.replaceWith(f+r.tableStart,c+r.tableStart,s)}o.setSelection(new dt(o.doc.resolve(l+r.tableStart))),t(o)}return!0}function PD(e,t){const n=er(e.schema);return K8e(({node:r})=>n[r.type.spec.tableRole])(e,t)}function K8e(e){return(t,n)=>{var r;const i=t.selection;let o,a;if(i instanceof dt){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;o=i.$anchorCell.nodeAfter,a=i.$anchorCell.pos}else{if(o=S8e(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 l=[],u=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++)l.push(u?{...s,colwidth:u&&u[h]?[u[h]]:null}:s);let p;for(let h=c.top;h<c.bottom;h++){let m=c.map.positionAt(h,c.left,c.table);h==c.top&&(m+=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(m+c.tableStart,1),e({node:o,row:h,col:g}).createAndFill(l[y]))}f.setNodeMarkup(a,e({node:o,row:c.top,col:c.left}),l[0]),i instanceof dt&&f.setSelection(new dt(f.doc.resolve(i.$anchorCell.pos),p?f.doc.resolve(p):void 0)),n(f)}return!0}}function q8e(e,t){return function(n,r){if(!li(n))return!1;const i=wC(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){const o=n.tr;n.selection instanceof dt?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 V8e(e){return function(t,n){if(!li(t))return!1;if(n){const r=er(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(l=>i.table.nodeAt(l));for(let l=0;l<a.length;l++)s[l].type==r.header_cell&&o.setNodeMarkup(i.tableStart+a[l],r.cell,s[l].attrs);if(o.steps.length==0)for(let l=0;l<a.length;l++)o.setNodeMarkup(i.tableStart+a[l],r.header_cell,s[l].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?V8e(e):function(n,r){if(!li(n))return!1;if(r){const i=er(n.schema),o=Ri(n),a=n.tr,s=WD("row",o,i),l=WD("column",o,i),c=(e==="column"?s:e==="row"?l:!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"?l?i.cell:i.header_cell:e=="row"?s?i.cell:i.header_cell:i.cell;o.map.cellsInRect(f).forEach(h=>{const m=h+o.tableStart,g=a.doc.nodeAt(m);g&&a.setNodeMarkup(m,p,g.attrs)}),r(a)}return!0}}Hh("row",{useDeprecatedLogic:!0});Hh("column",{useDeprecatedLogic:!0});var z8e=Hh("cell",{useDeprecatedLogic:!0});function Q8e(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(!li(t))return!1;const r=Q8e(wC(t),e);if(r==null)return!1;if(n){const i=t.doc.resolve(r);n(t.tr.setSelection(Oe.between(i,_8e(i))).scrollIntoView())}return!0}}function H8e(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 Fg(e,t){const n=e.selection;if(!(n instanceof dt))return!1;if(t){const r=e.tr,i=er(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 Y8e(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 l=0;l<t.childCount;l++){let u=t.child(l).content;const c=l?0:Math.max(0,n-1),f=l<t.childCount-1?0:Math.max(0,r-1);(c||f)&&(u=Z_(er(a).row,new V(u,c,f)).content),s.push(u)}else if(o=="cell"||o=="header_cell")s.push(n||r?Z_(er(a).row,new V(t,n,r)).content:t);else return null;return G8e(a,s)}function G8e(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:l}=o.child(a).attrs;for(let u=i;u<i+s;u++)n[u]=(n[u]||0)+l}}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=er(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 Z_(e,t){const n=e.createAndFill();return new g8e(n).replace(0,n.content.size,t).doc}function J8e({width:e,height:t,rows:n},r,i){if(e!=r){const o=[],a=[];for(let s=0;s<n.length;s++){const l=n[s],u=[];for(let c=o[s]||0,f=0;c<r;f++){let p=l.child(f%l.childCount);c+p.attrs.colspan>r&&(p=p.type.createChecked($u(p.attrs,p.attrs.colspan,c+p.attrs.colspan-r),p.content)),u.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(u))}n=a,e=r}if(t!=i){const o=[];for(let a=0,s=0;a<i;a++,s++){const l=[],u=n[s%t];for(let c=0;c<u.childCount;c++){let f=u.child(c);a+f.attrs.rowspan>i&&(f=f.type.create({...f.attrs,rowspan:Math.max(1,i-f.attrs.rowspan)},f.content)),l.push(f)}o.push(q.from(l))}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,l=er(s);let u,c;if(i>t.width)for(let f=0,p=0;f<t.height;f++){const h=n.child(f);p+=h.nodeSize;const m=[];let g;h.lastChild==null||h.lastChild.type==l.cell?g=u||(u=l.cell.createAndFill()):g=c||(c=l.header_cell.createAndFill());for(let y=t.width;y<i;y++)m.push(g);e.insert(e.mapping.slice(a).map(p-1+r),m)}if(o>t.height){const f=[];for(let m=0,g=(t.height-1)*t.width;m<Math.max(t.width,i);m++){const y=m>=t.width?!1:n.nodeAt(t.map[g+m]).type==l.header_cell;f.push(y?c||(c=l.header_cell.createAndFill()):u||(u=l.cell.createAndFill()))}const p=l.row.create(null,q.from(f)),h=[];for(let m=t.height;m<o;m++)h.push(p);e.insert(e.mapping.slice(a).map(r+n.nodeSize-2),h)}return!!(u||c)}function KD(e,t,n,r,i,o,a,s){if(a==0||a==t.height)return!1;let l=!1;for(let u=i;u<o;u++){const c=a*t.width+u,f=t.map[c];if(t.map[c-t.width]==f){l=!0;const p=n.nodeAt(f),{top:h,left:m}=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,m,n)),p.type.createAndFill({...p.attrs,rowspan:h+p.attrs.rowspan-a})),u+=p.attrs.colspan-1}}return l}function qD(e,t,n,r,i,o,a,s){if(a==0||a==t.width)return!1;let l=!1;for(let u=i;u<o;u++){const c=u*t.width+a,f=t.map[c];if(t.map[c-1]==f){l=!0;const p=n.nodeAt(f),h=t.colCount(f),m=e.mapping.slice(s).map(f+r);e.setNodeMarkup(m,null,$u(p.attrs,a-h,p.attrs.colspan-(a-h))),e.insert(m+p.nodeSize,p.type.createAndFill($u(p.attrs,0,a-h))),u+=p.attrs.rowspan-1}}return l}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=St.get(o);const{top:s,left:l}=r,u=l+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=St.get(o),p=f.mapping.maps.length}Z8e(f,a,o,n,u,c,p)&&h(),KD(f,a,o,n,l,u,s,p)&&h(),KD(f,a,o,n,l,u,c,p)&&h(),qD(f,a,o,n,s,c,l,p)&&h(),qD(f,a,o,n,s,c,u,p)&&h();for(let m=s;m<c;m++){const g=a.positionAt(m,l,o),y=a.positionAt(m,u,o);f.replace(f.mapping.slice(p).map(g+n),f.mapping.slice(p).map(y+n),new V(i.rows[m-s],0,0))}h(),f.setSelection(new dt(f.doc.resolve(n+a.positionAt(s,l,o)),f.doc.resolve(n+a.positionAt(c-1,u-1,o)))),t(f)}var X8e=SG({ArrowLeft:jg("horiz",-1),ArrowRight:jg("horiz",1),ArrowUp:jg("vert",-1),ArrowDown:jg("vert",1),"Shift-ArrowLeft":Lg("horiz",-1),"Shift-ArrowRight":Lg("horiz",1),"Shift-ArrowUp":Lg("vert",-1),"Shift-ArrowDown":Lg("vert",1),Backspace:Fg,"Mod-Backspace":Fg,Delete:Fg,"Mod-Delete":Fg});function ov(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function jg(e,t){return(n,r,i)=>{if(!i)return!1;const o=n.selection;if(o instanceof dt)return ov(n,r,je.near(o.$headCell,t));if(e!="horiz"&&!o.empty)return!1;const a=VZ(i,e,t);if(a==null)return!1;if(e=="horiz")return ov(n,r,je.near(n.doc.resolve(o.head+t),t));{const s=n.doc.resolve(a),l=PZ(s,e,t);let u;return l?u=je.near(l,1):t<0?u=je.near(n.doc.resolve(s.before(-1)),-1):u=je.near(n.doc.resolve(s.after(-1)),1),ov(n,r,u)}}}function Lg(e,t){return(n,r,i)=>{if(!i)return!1;const o=n.selection;let a;if(o instanceof dt)a=o;else{const l=VZ(i,e,t);if(l==null)return!1;a=new dt(n.doc.resolve(l))}const s=PZ(a.$headCell,e,t);return s?ov(n,r,new dt(a.$anchorCell,s)):!1}}function eqe(e,t){const n=e.state.doc,r=hp(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new dt(r))),!0):!1}function tqe(e,t,n){if(!li(e.state))return!1;let r=Y8e(n);const i=e.state.selection;if(i instanceof dt){r||(r={width:1,height:1,rows:[q.from(Z_(er(e.state.schema).cell,n))]});const o=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),s=St.get(o).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=J8e(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,St.get(o.node(-1)).findCell(o.pos-a),r),!0}else return!1}function nqe(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 dt)o(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&r&&(i=hp(e.state.selection.$anchor))!=null&&((n=bw(e,t))==null?void 0:n.pos)!=i.pos)o(i,t),t.preventDefault();else if(!r)return;function o(l,u){let c=bw(e,u);const f=xs.getState(e.state)==null;if(!c||!HF(l,c))if(f)c=l;else return;const p=new dt(l,c);if(f||!e.state.selection.eq(p)){const h=e.state.tr.setSelection(p);f&&h.setMeta(xs,l.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(l){const u=l,c=xs.getState(e.state);let f;if(c!=null)f=e.state.doc.resolve(c);else if(zD(e,u.target)!=r&&(f=bw(e,t),!f))return a();f&&o(f,u)}e.root.addEventListener("mouseup",a),e.root.addEventListener("dragstart",a),e.root.addEventListener("mousemove",s)}function VZ(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),l=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(l)?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 bw(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});return n&&n?hp(e.state.doc.resolve(n.pos)):null}var zZ=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")),X_(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,X_(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function X_(e,t,n,r,i,o){var a;let s=0,l=!0,u=t.firstChild;const c=e.firstChild;if(c){for(let f=0,p=0;f<c.childCount;f++){const{colspan:h,colwidth:m}=c.child(f).attrs;for(let g=0;g<h;g++,p++){const y=i==p?o:m&&m[g],C=y?y+"px":"";if(s+=y||r,y||(l=!1),u)u.style.width!=C&&(u.style.width=C),u=u.nextSibling;else{const _=document.createElement("col");_.style.width=C,t.appendChild(_)}}}for(;u;){const f=u.nextSibling;(a=u.parentNode)==null||a.removeChild(u),u=f}l?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}}var ei=new qn("tableColumnResizing");function rqe({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=zZ,lastColumnResizable:i=!0}={}){const o=new Sn({key:ei,state:{init(a,s){var l,u;const c=(u=(l=o.spec)==null?void 0:l.props)==null?void 0:u.nodeViews,f=er(s.schema).table.name;return r&&c&&(c[f]=(p,h)=>new r(p,n,h)),new iqe(-1,!1)},apply(a,s){return s.apply(a)}},props:{attributes:a=>{const s=ei.getState(a);return s&&s.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(a,s)=>{oqe(a,s,e,i)},mouseleave:a=>{aqe(a)},mousedown:(a,s)=>{sqe(a,s,t,n)}},decorations:a=>{const s=ei.getState(a);if(s&&s.activeHandle>-1)return fqe(a,s.activeHandle)},nodeViews:{}}});return o}var iqe=class av{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,r=t.getMeta(ei);if(r&&r.setHandle!=null)return new av(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new av(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let i=t.mapping.map(n.activeHandle,-1);return J_(t.doc.resolve(i))||(i=-1),new av(i,n.dragging)}return n}};function oqe(e,t,n,r){if(!e.editable)return;const i=ei.getState(e.state);if(i&&!i.dragging){const o=uqe(t.target);let a=-1;if(o){const{left:s,right:l}=o.getBoundingClientRect();t.clientX-s<=n?a=QD(e,t,"left",n):l-t.clientX<=n&&(a=QD(e,t,"right",n))}if(a!=i.activeHandle){if(!r&&a!==-1){const s=e.state.doc.resolve(a),l=s.node(-1),u=St.get(l),c=s.start(-1);if(u.colCount(s.pos-c)+s.nodeAfter.attrs.colspan-1==u.width-1)return}QZ(e,a)}}}function aqe(e){if(!e.editable)return;const t=ei.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&QZ(e,-1)}function sqe(e,t,n,r){var i;if(!e.editable)return!1;const o=(i=e.dom.ownerDocument.defaultView)!=null?i:window,a=ei.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;const s=e.state.doc.nodeAt(a.activeHandle),l=lqe(e,a.activeHandle,s.attrs);e.dispatch(e.state.tr.setMeta(ei,{setDragging:{startX:t.clientX,startWidth:l}}));function u(f){o.removeEventListener("mouseup",u),o.removeEventListener("mousemove",c);const p=ei.getState(e.state);p!=null&&p.dragging&&(cqe(e,p.activeHandle,HD(p.dragging,f,n)),e.dispatch(e.state.tr.setMeta(ei,{setDragging:null})))}function c(f){if(!f.which)return u(f);const p=ei.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,l,r),o.addEventListener("mouseup",u),o.addEventListener("mousemove",c),t.preventDefault(),!0}function lqe(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,l=n;if(r)for(let u=0;u<n;u++)r[u]&&(s-=r[u],l--);return s/l}function uqe(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 l=St.get(s.node(-1)),u=s.start(-1),c=l.map.indexOf(s.pos-u);return c%l.width==0?-1:u+l.map[c-1]}function HD(e,t,n){const r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function QZ(e,t){e.dispatch(e.state.tr.setMeta(ei,{setHandle:t}))}function cqe(e,t,n){const r=e.state.doc.resolve(t),i=r.node(-1),o=St.get(i),a=r.start(-1),s=o.colCount(r.pos-a)+r.nodeAfter.attrs.colspan-1,l=e.state.tr;for(let u=0;u<o.height;u++){const c=u*o.width+s;if(u&&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 m=p.colwidth?p.colwidth.slice():dqe(p.colspan);m[h]=n,l.setNodeMarkup(a+f,null,{...p,colwidth:m})}l.docChanged&&e.dispatch(l)}function YD(e,t,n,r){const i=e.state.doc.resolve(t),o=i.node(-1),a=i.start(-1),s=St.get(o).colCount(i.pos-a)+i.nodeAfter.attrs.colspan-1;let l=e.domAtPos(i.start(-1)).node;for(;l&&l.nodeName!="TABLE";)l=l.parentNode;l&&X_(o,l.firstChild,l,r,s,n)}function dqe(e){return Array(e).fill(0)}function fqe(e,t){var n;const r=[],i=e.doc.resolve(t),o=i.node(-1);if(!o)return Ot.empty;const a=St.get(o),s=i.start(-1),l=a.colCount(i.pos-s)+i.nodeAfter.attrs.colspan-1;for(let u=0;u<a.height;u++){const c=l+u*a.width;if((l==a.width-1||a.map[c]!=a.map[c+1])&&(u==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=ei.getState(e))!=null&&n.dragging&&r.push(fr.node(s+f,s+f+o.nodeAt(f).nodeSize,{class:"column-resize-dragging"})),r.push(fr.widget(p,h))}}return Ot.create(e.doc,r)}function pqe({allowTableNodeSelection:e=!1}={}){return new Sn({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:I8e,handleDOMEvents:{mousedown:nqe},createSelectionBetween(t){return xs.getState(t.state)!=null?t.state.selection:null},handleTripleClick:eqe,handleKeyDown:X8e,handlePaste:tqe},appendTransaction(t,n,r){return $8e(r,qZ(r,n),e)}})}function ex(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,l=!0,u=t.firstChild;const c=e.firstChild;if(c!==null)for(let f=0,p=0;f<c.childCount;f+=1){const{colspan:h,colwidth:m}=c.child(f).attrs;for(let g=0;g<h;g+=1,p+=1){const y=i===p?o:m&&m[g],C=y?`${y}px`:"";if(s+=y||r,y||(l=!1),u){if(u.style.width!==C){const[_,b]=ex(r,y);u.style.setProperty(_,b)}u=u.nextSibling}else{const _=document.createElement("col"),[b,v]=ex(r,y);_.style.setProperty(b,v),t.appendChild(_)}}}for(;u;){const f=u.nextSibling;(a=u.parentNode)===null||a===void 0||a.removeChild(u),u=f}l?(n.style.width=`${s}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${s}px`)}let hqe=class{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 Aqe(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:m}=s.child(f).attrs;for(let g=0;g<h;g+=1,p+=1){const y=n===p?r:m&&m[g];i+=y||t,y||(o=!1);const[C,_]=ex(t,y);a.push(["col",{style:`${C}: ${_}`}])}}const l=o?`${i}px`:"",u=o?"":`${i}px`;return{colgroup:["colgroup",{},...a],tableWidth:l,tableMinWidth:u}}function JD(e,t){return t?e.createChecked(null,t):e.createAndFill()}function mqe(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 gqe(e,t,n,r,i){const o=mqe(e),a=[],s=[];for(let u=0;u<n;u+=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 l=[];for(let u=0;u<t;u+=1)l.push(o.row.createChecked(null,r&&u===0?a:s));return o.table.createChecked(null,l)}function vqe(e){return e instanceof dt}const Dg=({editor:e})=>{const{selection:t}=e.state;if(!vqe(t))return!1;let n=0;const r=lJ(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},yqe=mn.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:hqe,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}=Aqe(e,this.options.cellMinWidth);return["table",xt(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=gqe(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})=>M8e(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>F8e(e,t),deleteColumn:()=>({state:e,dispatch:t})=>L8e(e,t),addRowBefore:()=>({state:e,dispatch:t})=>U8e(e,t),addRowAfter:()=>({state:e,dispatch:t})=>B8e(e,t),deleteRow:()=>({state:e,dispatch:t})=>W8e(e,t),deleteTable:()=>({state:e,dispatch:t})=>H8e(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})=>z8e(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>BD(e,t)?!0:PD(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>q8e(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&&qZ(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){const r=dt.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:Dg,"Mod-Backspace":Dg,Delete:Dg,"Mod-Delete":Dg}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[rqe({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],pqe({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){const t={name:e.name,options:e.options,storage:e.storage};return{tableRole:We(de(e,"tableRole",t))}}}),bqe=mn.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",xt(this.options.HTMLAttributes,e),0]}});function _C(e,t){const n=e.nodes[t];if(!n)throw new Error(`Unwanted state: ${t} not found in schema.`);return n}function JF(e){return Xm(t=>t.type.spec.tableRole&&t.type.spec.tableRole==="table")(e)}function HZ(e,t){switch(t.type){case"hyperlink":case"paragraph":case"strong":case"em":return Fr.converter.fromPrismic(e)(t);default:return}}function YZ(e){const{title:t,className:n,onClick:r,tabIndex:i,onMouseDown:o,...a}=e,s=document.createElement("button");return s.className=n,s.setAttribute("type","button"),s.setAttribute("title",t),s.setAttribute("aria-label",t),s.setAttribute("tabIndex","0"),o&&s.addEventListener("mousedown",l=>{const u=l.currentTarget;o(l,u)}),s.addEventListener("click",l=>{const u=l.currentTarget;r(l,u)}),Object.entries(a).forEach(([l,u])=>{s.setAttribute(l,u.toString())}),s}function GZ(e){const t=document.createElement("div");return t.innerHTML=e,t.firstChild?t.firstChild:null}class xC extends CustomEvent{constructor({name:t,detail:n}){super(t,{detail:n})}static dispatch(t,n){const{editor:r,...i}=n;r.view.dom.dispatchEvent(new xC({name:t,detail:i}))}static listen(t,n){const{editor:r,callback:i}=n,o=new AbortController;return r.view.dom.addEventListener(t,a=>{const{detail:s}=a;s&&i(s)},{signal:o.signal}),()=>o.abort()}}const JZ="data-prismic-table-handle";function Cqe(e){return t=>{const n=JF(t);if(n){const r=St.get(n.node);return(Array.isArray(e)?e:Array.from([e])).reduce((o,a)=>{if(a>=0&&a<=r.width-1){const s=r.cellsInRect({left:a,right:a+1,top:0,bottom:r.height});return o.concat(s.flatMap(l=>{const u=n.node.nodeAt(l),c=l+n.start;return{pos:c,start:c+1,node:u}}))}return o},[])}return null}}function Sqe(e,t){const{index:n,tr:r}=t,i=JF(r.selection);if(!i)return r;const o=St.get(i.node),a=e==="row";if(n<0||n>=(a?o.height:o.width))return r;const s=a?0:n,l=a?n:0,u=a?o.width:n+1,c=a?n+1:o.height,f=o.map[l*o.width+s],p=o.map[(c-1)*o.width+(u-1)];if(!f||!p)return r;const h=i.start+f,m=i.start+p,g=r.doc.resolve(h),y=r.doc.resolve(m);return r.setSelection(new dt(y,g))}function wqe(e){const{element:t,type:n}=e,r=t.querySelector(`[${JZ}="${n}"]`);if(!r)throw new Error(`No ${n} handle found`);return r}function _qe(e,t){const{editor:n,rowIndex:r,columnIndex:i}=t,o=YZ({title:`Select ${e} & show options`,className:KJ(A.tableFieldStyles.tableHandle,A.tableFieldStyles[`table${Ar.capitalize(e)}Handle`]),[JZ]:e,"aria-expanded":!1,onMouseDown:s=>{s.preventDefault(),s.stopImmediatePropagation();const l=e==="row"?r:i;n.view.dispatch(Sqe(e,{index:l,tr:n.state.tr}))},onClick:(s,l)=>{s.preventDefault(),s.stopImmediatePropagation(),xC.dispatch("handleClick",{type:e,editor:n,referenceElement:l})}}),a=GZ(A.rawDragIndicatorIcon);return a&&o.appendChild(a),o}class xqe{constructor(t){$t(this,"abortController",new AbortController);$t(this,"currentRowHandle",null);$t(this,"showCurrentHandles",t=>{try{const n=t.target;this.hidePreviousHandles();const r=this.closest("cell",n),i=this.getRowHandle(r);this.displayHandle(i),this.currentRowHandle=i}catch{}});$t(this,"hidePreviousHandles",()=>{this.currentRowHandle&&this.hideHandle(this.currentRowHandle)});$t(this,"tagNames",{cell:["TD","TH"],row:["TR"],table:["TABLE"]});this.view=t,this.update(this.view)}update(t){this.attachEventListeners(t.dom)}destroy(){this.abortController.abort()}attachEventListeners(t){this.abortController.signal.aborted||this.abortController.abort(),this.abortController=new AbortController;const{signal:n}=this.abortController;t.querySelectorAll("table").forEach(r=>{r.addEventListener("mouseover",this.showCurrentHandles,{signal:n}),r.addEventListener("mouseleave",this.hidePreviousHandles,{signal:n})})}closest(t,n){const r=this.tagNames[t];for(const i of r){const o=n.closest(i);if(o)return o}throw new Error(`Failed to find closest ${t}`)}getRowHandle(t){const n=this.closest("row",t),r=wqe({element:n,type:"row"});if(!r)throw new Error("No row handle found");return r}displayHandle(t){t.classList.add(A.tableFieldStyles.tableHandleVisible)}hideHandle(t){t.classList.remove(A.tableFieldStyles.tableHandleVisible)}}function ZZ(){return new Sn({key:new qn("tableCellHandles"),view:e=>new xqe(e),state:{init:(e,t)=>ZD.bind(this)(t),apply:(e,t,n,r)=>e.docChanged?ZD.bind(this)(r):t.map(e.mapping,e.doc)},props:{decorations(e){return this.getState(e)}}})}function ZD(e){const{editor:t}=this,n=[],r=Cqe(0)(e.selection);return r&&r.forEach(({pos:i},o)=>{n.push(fr.widget(i+1,()=>_qe("row",{editor:t,columnIndex:0,rowIndex:o})))}),Ot.create(e.doc,n)}const XZ=bqe.extend({name:"tableCell",renderHTML({HTMLAttributes:e}){return["td",xt(this.options.HTMLAttributes,e),["div",{class:A.tableFieldStyles.tableCell},0]]},addProseMirrorPlugins(){return[ZZ.bind(this)()]}}),XD={fromPrismic(e){return function(t){return _C(e,XZ.name).create({colspan:1,rowspan:1,colwidth:null},t.content.value.flatMap(r=>HZ(e,r)??[]))}},toPrismic(e){const t=[];return e.content.forEach(n=>{const r=Fr.converter.toPrismic(n);fe.TextBlock.is(r)&&t.push(r)}),{type:"tableCell",content:{__TYPE__:"StructuredTextContent",value:t}}}},Tqe=mn.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",xt(this.options.HTMLAttributes,e),0]}}),eX=Tqe.extend({name:"tableHeader",renderHTML({HTMLAttributes:e}){return["th",xt(this.options.HTMLAttributes,e),["div",{class:A.tableFieldStyles.tableCell},0]]},addProseMirrorPlugins(){return[ZZ.bind(this)()]}}),eU={fromPrismic(e){return function(t){return _C(e,eX.name).create({colspan:1,rowspan:1,colwidth:null},t.content.value.flatMap(r=>HZ(e,r)??[]))}},toPrismic(e){const t=[];return e.content.forEach(n=>{const r=Fr.converter.toPrismic(n);fe.TextBlock.is(r)&&t.push(r)}),{type:"tableHeader",content:{__TYPE__:"StructuredTextContent",value:t}}}},tX=mn.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:e}){return["tr",xt(this.options.HTMLAttributes,e),0]}}),Iqe=tX.extend({name:"tableRow"}),tU={fromPrismic(e){return function(t){return _C(e,tX.name).create({},t.content.map(r=>{switch(r.type){case"tableHeader":return eU.fromPrismic(e)(r);case"tableCell":return XD.fromPrismic(e)(r)}}))}},toPrismic(e){const t=[];return e.content.forEach(n=>{switch(n.type.name){case"tableHeader":{t.push(eU.toPrismic(n));break}case"tableCell":{t.push(XD.toPrismic(n));break}}}),{type:"tableRow",content:t}}};class Eqe extends zZ{constructor(t,n){const{node:r,editor:i}=t,{defaultCellMinWidth:o}=n;super(r,o);const a=document.createElement("div");a.classList.add(A.tableFieldStyles.tableWithControls);const s=document.createElement("div");s.classList.add(A.tableFieldStyles.tableOuterWrapper),s.appendChild(this.dom);const l=nU("row",{editor:i});s.appendChild(l),a.appendChild(s);const u=nU("column",{editor:i,onAfterCommand:()=>{a.scrollLeft=a.scrollWidth}});a.appendChild(u),this.dom=a}ignoreMutation(t){return t.target.closest(`.${A.tableFieldStyles.tableOuterWrapper}`)?super.ignoreMutation(t):!0}}function nU(e,t){const{editor:n,onAfterCommand:r}=t,i=Ar.capitalize(e),o=YZ({title:`Add ${e}`,className:A.tableFieldStyles[`addTable${i}Button`],onClick:()=>{n.commands[`add${i}ToEnd`](),r==null||r()}}),a=GZ(A.rawAddIcon);return a&&o.appendChild(a),o}const tx=yqe.extend({name:"table",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),defaultCellMinWidth:120}},addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),addRowToEnd:()=>({dispatch:t,state:n})=>{if(!li(n))return!1;if(t){const r=Ri(n),i=r.map.height;t(GF(n.tr,r,i))}return!0},addColumnToEnd:()=>({dispatch:t,state:n})=>{if(!li(n))return!1;if(t){const r=Ri(n),i=r.map.width;t(YF(n.tr,r,i))}return!0}}},addNodeView(){return e=>new Eqe(e,this.options)}}),Rqe={fromPrismic(e){return function(t){return _C(e,tx.name).create({},t.content.map(tU.fromPrismic(e)))}},toPrismic(e){var n;const t=((n=e.content.firstChild)==null?void 0:n.type.name)===tx.name?e.content.firstChild:e;return{type:"table",content:Qs.children.map(t,r=>tU.toPrismic(r))}}},$qe=new W6e([au.table],au.table,[tx,Iqe,eX,XZ],Rqe),nX=[UF,qF,IZ],rX=[...nX,VF];function iX(e){return k6e(e)?[...nX,Fr,$qe].filter(Qi.isDefined):[Fr,ly,cy,Wl.build(e),hZ,mZ,SZ,...rX].filter(Qi.isDefined)}const oX=[{nodeType:he.RichTextNodeType.paragraph,icon:"textFields",isActive:e=>e.isActive(Fr.name)&&!e.isActive(ly.name)&&!e.isActive(cy.name),runCommands:Wt((e,t)=>e.clearNodes().setDirection(Ki(t))),shortText:"par",text:"Paragraph"},{nodeType:he.RichTextNodeType.heading1,icon:"looks1",isActive:e=>e.isActive(Wl.name,{level:1}),runCommands:Wt((e,t)=>e.setHeading({level:1}).setDirection(Ki(t))),shortText:"h1",text:"Heading 1"},{nodeType:he.RichTextNodeType.heading2,icon:"looks2",isActive:e=>e.isActive(Wl.name,{level:2}),runCommands:Wt((e,t)=>e.setHeading({level:2}).setDirection(Ki(t))),shortText:"h2",text:"Heading 2"},{nodeType:he.RichTextNodeType.heading3,icon:"looks3",isActive:e=>e.isActive(Wl.name,{level:3}),runCommands:Wt((e,t)=>e.setHeading({level:3}).setDirection(Ki(t))),shortText:"h3",text:"Heading 3"},{nodeType:he.RichTextNodeType.heading4,icon:"looks4",isActive:e=>e.isActive(Wl.name,{level:4}),runCommands:Wt((e,t)=>e.setHeading({level:4}).setDirection(Ki(t))),shortText:"h4",text:"Heading 4"},{nodeType:he.RichTextNodeType.heading5,icon:"looks5",isActive:e=>e.isActive(Wl.name,{level:5}),runCommands:Wt((e,t)=>e.setHeading({level:5}).setDirection(Ki(t))),shortText:"h5",text:"Heading 5"},{nodeType:he.RichTextNodeType.heading6,icon:"looks6",isActive:e=>e.isActive(Wl.name,{level:6}),runCommands:Wt((e,t)=>e.setHeading({level:6}).setDirection(Ki(t))),shortText:"h6",text:"Heading 6"},{nodeType:he.RichTextNodeType.list,icon:"formatListBulleted",isActive:e=>e.isActive(ly.name),runCommands:Wt((e,t)=>e.toggleBulletList().setDirection(Ki(t))),shortText:"bull",text:"Bulleted list"},{nodeType:he.RichTextNodeType.orderedList,icon:"formatListNumbered",isActive:e=>e.isActive(cy.name),runCommands:Wt((e,t)=>e.toggleOrderedList().setDirection(Ki(t))),shortText:"num",text:"Numbered list"},{nodeType:he.RichTextNodeType.preformatted,icon:"dataObject",isActive:e=>e.isActive(hZ.name),runCommands:Wt((e,t)=>e.setCodeBlock().setDirection(Ki(t))),shortText:"code",text:"Code"},{nodeType:he.RichTextNodeType.embed,icon:"cloud",isActive:e=>e.isActive(mZ.name),runCommands:Wt(e=>e.setEmbed()),shortText:"emb",text:"Embed"},{nodeType:he.RichTextNodeType.image,icon:"image",isActive:e=>e.isActive(SZ.name),runCommands:Wt(e=>e.setImage()),shortText:"img",text:"Image"}],kqe=[{nodeType:he.RichTextNodeType.strong,icon:"formatBold",isActive:e=>e.isActive(UF.name),runCommands:Wt(e=>e.toggleBold())},{nodeType:he.RichTextNodeType.em,icon:"formatItalic",isActive:e=>e.isActive(qF.name),runCommands:Wt(e=>e.toggleItalic())}],Oqe=[{nodeType:he.RichTextNodeType.rtl,icon:"formatTextDirectionRToL",isActive:e=>e.isActive({[ga]:Yl}),runCommands:Wt((e,t)=>e.toggleDirection(Ki(t)))}];function Wt(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?Mqe(t,r,e):e(r,t).run()}}function Ki(e){const t=e.state.selection.$from.parent.attrs;return Ia.parseNodeAttrsDirection(t)}function sv(e,t){return e.filter(n=>t.includes(n.nodeType))}function Mqe(e,t,n){try{return n(t,e).run()}catch{return!1}}function Fqe(e){const{items:t,editor:n}=e;return t.length===0?null:d.jsxs(d.Fragment,{children:[t.map(r=>d.jsx(A.ToolbarToggleButton,{disabled:!r.runCommands(n,{can:!0}),onPressedChange:()=>{r.runCommands(n)},pressed:r.isActive(n),startIcon:r.icon},r.nodeType)),d.jsx(A.ToolbarSeparator,{})]})}function jqe(e){const{labels:t,editor:n}=e,r=n.getAttributes("label").label;return d.jsxs(d.Fragment,{children:[d.jsxs(A.DropdownMenu,{children:[d.jsx(A.DropdownMenuTrigger,{disabled:t.length===0,children:d.jsx(A.Button,{endIcon:"arrowDropDown",size:"small",color:"grey",children:rU(r??"Labels")})}),d.jsx(A.DropdownMenuContent,{align:"start",asPortal:!1,maxHeight:256,avoidCollisions:!1,children:t.map((i,o)=>{const a=r===i;return d.jsx(A.DropdownMenuItem,{onSelect:()=>a?n.commands.unsetLabel():Lqe(n,i),endIcon:a&&d.jsx(A.Icon,{name:"check",size:"extraSmall"}),children:rU(i)},`${i}-${o}`)})})]}),d.jsx(A.ToolbarSeparator,{})]})}function Lqe(e,t){Wt(r=>r.setLabel({label:t}))(e)}function rU(e){return Ar.overflow(e,20)}function Dqe(e){const{editor:t}=e,n=t.getAttributes("label");if(!n.label)return null;const r=n.label;return d.jsx(A.Box,{backgroundColor:"purple9",padding:{block:2,inline:4},alignItems:"center",borderRadius:{topLeft:2,topRight:2,bottomRight:2},maxWidth:125,children:d.jsx(A.Text,{color:"white",variant:"small",noWrap:!0,children:r})})}function Uqe(e){const{disabled:t,showWebLinkModal:n,showDocumentsLinkModal:r,showMediaLinkModal:i}=Bqe(e);return d.jsxs(d.Fragment,{children:[d.jsxs(A.ToolbarButtonGroup,{density:"compact",children:[d.jsx(A.ToolbarButton,{disabled:t,startIcon:"link",onClick:n},he.RichTextNodeType.hyperlink),d.jsxs(A.DropdownMenu,{children:[d.jsx(A.DropdownMenuTrigger,{children:d.jsx(A.ToolbarButton,{startIcon:"arrowDropDown"})}),d.jsxs(A.DropdownMenuContent,{align:"end",asPortal:!1,children:[d.jsx(A.DropdownMenuItem,{startIcon:d.jsx(A.Icon,{name:"public"}),onSelect:n,children:"Link to web page"}),d.jsx(A.DropdownMenuItem,{startIcon:d.jsx(A.Icon,{name:"description"}),onSelect:r,children:"Link to document"}),d.jsx(A.DropdownMenuItem,{startIcon:d.jsx(A.Icon,{name:"image"}),onSelect:i,children:"Link to media"})]})]})]}),d.jsx(A.ToolbarSeparator,{})]})}function Bqe(e){const{editor:t,setModal:n}=e;function r(){n("webLink")}function i(){n("documentLink")}function o(){n("mediaLink")}return{disabled:!Wt(s=>s.setWebLink({href:""}))(t,{can:!0}),showWebLinkModal:r,showDocumentsLinkModal:i,showMediaLinkModal:o}}function Pqe(e){const{docId:t,onEdit:n,onUnlink:r}=e,i=Wqe(t),o=we();if(!i)return null;const a=i.versions[0],s=qM({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}),l=(a==null?void 0:a.preview_summary)??"",u=(a==null?void 0:a.custom_type_label)??"";return d.jsx(Su,{url:s,title:i.title,subTitle:u,description:l,onEdit:n,onUnlink:r,largeIconName:"description"})}function Wqe(e){const t=we();t.searchDocuments||Mt("searchDocuments");const{coreApiBaseUrl:n,authStrategy:r}=t;return et.useRequest(zm,[n,r,e])}function Nqe(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(Kqe,{docId:i,...e})}if(r.href){const i=r.href;return d.jsx(qqe,{url:i,...e})}if(r.media){const i=EZ(r.media);return d.jsx(Vqe,{media:i,...e})}return null}function Kqe(e){const{editor:t,onEditDocumentLink:n,docId:r}=e;return d.jsx(A.ErrorBoundary,{renderError:()=>d.jsx(Su,{title:"Failed to Load Linked Document Data",error:!0,onEdit:n,onUnlink:()=>lu(t)}),children:d.jsx(I.Suspense,{fallback:d.jsx(Su,{loading:!0,onEdit:n,onUnlink:()=>lu(t)}),children:d.jsx(Pqe,{docId:r,onEdit:n,onUnlink:()=>lu(t)})})})}function qqe(e){const{url:t,editor:n,onEditWebLink:r}=e,i=ri.toURL(t);return i?d.jsx(Su,{url:t,title:ri.getUrlTitle(i),subTitle:t,onEdit:r,onUnlink:()=>lu(n)}):d.jsx(Su,{url:t,subTitle:t,onEdit:r,onUnlink:()=>lu(n)})}function Vqe(e){const{media:t,editor:n,onEditMediaLink:r}=e;return fe.FilledImageLinkContent.is(t)?d.jsx(cY,{url:t.url,title:t.name,subTitle:`${t.width} x ${t.height} pixels`,onEdit:r,onUnlink:()=>lu(n)}):fe.FilledFileLinkContent.is(t)?d.jsx(Su,{url:t.url,title:t.name,subTitle:zqe({filename:t.name}),largeIconName:"insertDriveFile",onEdit:r,onUnlink:()=>lu(n)}):null}function lu(e){Wt(n=>n.unsetLink())(e)}function zqe(e){const{filename:t}=e,n=t.split(".").pop();return n?n.toLowerCase():""}function Qqe(e){const{open:t}=e,{onOpenChange:n,onSelectDocument:r}=Hqe(e);return d.jsx(aY,{open:t,onOpenChange:n,onSelectDocument:r})}function Hqe(e){const{editor:t,setOpen:n}=e;function r(o){Wt(s=>s.extendMarkRange(he.RichTextNodeType.hyperlink).setDocumentLink({id:o}))(t),n(!1)}function i(o){n(o)}return{onSelectDocument:r,onOpenChange:i}}function Yqe(e){const{open:t}=e,{onOpenChange:n,onMediaSelected:r}=Gqe(e);return d.jsx(iF,{open:t,onOpenChange:n,onMediaSelected:r,assetType:"all"})}function Gqe(e){const{editor:t,setOpen:n}=e;function r(i){Wt(a=>a.extendMarkRange(he.RichTextNodeType.hyperlink).setMediaLink({media:i}))(t),n(!1)}return{onMediaSelected:r,onOpenChange:n}}function Jqe(e){const{open:t,setOpen:n}=e,{url:r,setUrl:i,openInNewTab:o,setOpenInNewTab:a,disabled:s,onUpdate:l}=Zqe(e);return d.jsxs(A.Dialog,{open:t,onOpenChange:n,size:"small",noDescription:!0,children:[d.jsx(A.DialogHeader,{title:"Set Link URL"}),d.jsxs(A.DialogContent,{padding:16,children:[d.jsx(A.FormInput,{value:r,onValueChange:i,placeholder:"Paste URL",icon:"public"}),r&&d.jsx(A.InlineLabel,{value:"Open in new tab",children:d.jsx(A.Checkbox,{checked:o,onCheckedChange:a})})]}),d.jsxs(A.DialogActions,{children:[d.jsx(A.DialogCancelButton,{}),d.jsx(A.DialogActionButton,{onClick:l,disabled:s,children:"Update"})]})]})}function Zqe(e){const{editor:t,open:n,setOpen:r}=e,i=Xqe(t),[o,a]=I.useState(i.url),[s,l]=I.useState(i.openInNewTab);ze.useOnChange(n,()=>{n&&(a(i.url),l(i.openInNewTab))});const u=!o||o===i.url&&s===i.openInNewTab;function c(){const f=s?"_blank":"_self";Wt(p=>p.extendMarkRange(he.RichTextNodeType.hyperlink).setWebLink({href:o,target:f}))(t),r(!1)}return{url:o,setUrl:a,openInNewTab:s,disabled:u,setOpenInNewTab:l,onUpdate:c}}function Xqe(e){const t=e.getAttributes(he.RichTextNodeType.hyperlink);return{url:t.href??"",openInNewTab:t.target==="_blank"}}function e7e(e){const{items:t,editor:n}=e;return t.length===0?null:d.jsxs(d.Fragment,{children:[d.jsx(A.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(A.ToolbarToggleButtonGroupItem,{disabled:!r.runCommands(n,{can:!0}),startIcon:r.icon,value:r.nodeType},r.nodeType))},"mark"),d.jsx(A.ToolbarSeparator,{})]})}function t7e(e){var r;const{items:t,editor:n}=e;return t.length===0?null:d.jsxs(d.Fragment,{children:[d.jsxs(A.DropdownMenu,{children:[d.jsx(A.DropdownMenuTrigger,{disabled:t.length===1,children:d.jsx(A.Button,{endIcon:"arrowDropDown",size:"small",color:"grey",children:((r=t.find(i=>i.isActive(n)))==null?void 0:r.text)??""})}),d.jsx(A.DropdownMenuContent,{align:"start",asPortal:!1,maxHeight:256,avoidCollisions:!1,children:t.map(i=>d.jsx(A.DropdownMenuItem,{onSelect:()=>{i.runCommands(n)},children:i.text},i.nodeType))})]}),d.jsx(A.ToolbarSeparator,{})]})}function Cw(e){return{duration:100,hideOnClick:!0,offset:e,placement:"top-start",appendTo:document.querySelector("body > div")??"parent"}}function n7e(e){const{editor:t,nodeTypes:n,labels:r,hideDisabledOptions:i=!1}=e,[o,a]=I.useState(),s=n.includes(he.RichTextNodeType.hyperlink),l=!o,{shouldShowBubbleMenu:u,shouldshowPopover:c}=i7e({editor:t}),[f,p]=I.useState(!0);I.useEffect(()=>{p(!1)},[]);function h(y){a(y?"webLink":void 0)}function m(y){a(y?"documentLink":void 0)}function g(y){a(y?"mediaLink":void 0)}return f?null:d.jsxs(d.Fragment,{children:[d.jsx(sw,{editor:t,tippyOptions:Cw([-48,0]),shouldShow:u,children:l&&d.jsx(r7e,{editor:t,nodeTypes:n,labels:r,setModal:a,hideDisabledOptions:i})}),d.jsx(sw,{editor:t,tippyOptions:Cw([-48,0]),shouldShow:y=>c(y,"hyperlink"),children:l&&d.jsx(Nqe,{editor:t,onEditWebLink:()=>a("webLink"),onEditDocumentLink:()=>a("documentLink"),onEditMediaLink:()=>a("mediaLink")})}),d.jsx(sw,{editor:t,tippyOptions:Cw([0,0]),shouldShow:y=>c(y,"label"),children:d.jsx(Dqe,{editor:t})}),s&&d.jsxs(d.Fragment,{children:[d.jsx(Jqe,{open:o==="webLink",setOpen:h,editor:t}),d.jsx(Qqe,{open:o==="documentLink",setOpen:m,editor:t}),d.jsx(Yqe,{open:o==="mediaLink",setOpen:g,editor:t})]})]})}function r7e(e){const{editor:t,nodeTypes:n,labels:r,setModal:i,hideDisabledOptions:o}=e,a=n.includes("hyperlink"),s=r.length>0,l=sv(oX,n),u=sv(kqe,n),c=sv(Oqe,n),f=o&&l.length===1?0:l.length,p=f+u.length+c.length+Number(a);return p===0?null:d.jsxs(A.Toolbar,{children:[f>0&&d.jsx(t7e,{items:l,editor:t}),s&&d.jsx(jqe,{labels:r,editor:t}),d.jsx(e7e,{items:u,editor:t}),a&&d.jsx(Uqe,{editor:t,setModal:i}),d.jsx(Fqe,{items:c,editor:t}),p>1&&d.jsx(A.ToolbarButton,{onClick:()=>{t.chain().focus().clearNodes().unsetAllMarks().run()},startIcon:"formatClear"},"clear")]})}function i7e(e){const{editor:t}=e;function n(i){const{view:o,state:a,from:s,to:l}=i;if(!o.hasFocus())return!1;const{doc:u,selection:c}=a;return!(t.isActive(he.RichTextNodeType.preformatted)||c.empty||u.textBetween(s,l).length===0)}function r(i,o){const{view:a,state:s,from:l,to:u}=i,c=a.state.doc.nodeAt(l),{doc:f,selection:p}=s;return!p.empty||f.textBetween(l,u).length>0?!1:!!(c!=null&&c.marks.some(m=>m.type.name===o))}return{shouldShowBubbleMenu:n,shouldshowPopover:r}}const o7e=["id","data-state","aria-expanded","aria-controls","aria-haspopup"],a7e=I.forwardRef(function(t,n){const{anchorElement:r,...i}=t;I.useEffect(()=>{if(r)for(const[a,s]of Object.entries(i))s7e(a,s)&&l7e(r,a,s)},[i,r]);function o(){!r||typeof n!="function"||n(r)}return d.jsx("div",{ref:o,style:{display:"none"}})});function s7e(e,t){return o7e.includes(e)?typeof t=="boolean"||typeof t=="number"||typeof t=="string":!1}function l7e(e,t,n){n!=null&&n!==""?e.setAttribute(t,n.toString()):e.removeAttribute(t)}function u7e(e){const{editor:t,open:n,onOpenChange:r,triggerElement:i}=e;function o(){t.commands.deleteRow(),r==null||r(!1)}const a=c7e(t);return d.jsxs(A.DropdownMenu,{open:n,onOpenChange:r,modal:!0,children:[d.jsx(A.DropdownMenuTrigger,{children:d.jsx(a7e,{anchorElement:i})}),d.jsxs(A.DropdownMenuContent,{align:"start",side:"right",sideOffset:4,children:[d.jsx(A.DropdownMenuLabel,{children:d.jsx(A.Text,{color:"grey11",variant:"small",children:"Row options"})}),d.jsx(A.DropdownMenuItem,{startIcon:d.jsx(A.Icon,{name:"delete"}),onSelect:o,disabled:!a,children:"Delete Row"})]})]})}function c7e(e){const{selection:t}=e.state,n=JF(t);return!n||n.node.type.name!=="table"?!1:n.node.children.length>1}function d7e(e){return d.jsx(f7e,{...e})}function f7e(e){const{editor:t}=e,{triggerElement:n,open:r,onOpenChange:i}=p7e("row",t);return d.jsx(u7e,{open:r,editor:t,triggerElement:n,onOpenChange:i})}function p7e(e,t){const[n,r]=I.useState(),[i,o]=I.useState(!1);return I.useEffect(()=>xC.listen("handleClick",{editor:t,callback:a=>{a.type===e&&(r(a.referenceElement),setTimeout(()=>o(!0),0))}}),[t,e]),{open:i,onOpenChange:o,triggerElement:n}}function aX(e){const{content:t,field:n,id:r,readOnly:i,padding:o="normal",scroll:a="hidden",shouldReturnEmptyContent:s=!1}=e,l=h7e(n),u=t&&F_.converter(l.nodeExtensions).fromPrismic(l.schema,l.nodeTypes,t),c=ze.useStableCallback(e.onContentChange),f=A.useEditor({content:u==null?void 0:u.toJSON(),editable:!i,editorProps:{attributes:{class:KJ(o==="zero"?A.contentEditableNoPaddingClass:A.contentEditableClass,A.contentEditableMultilinePlaceholderClass),id:r,tabIndex:"0"}},extensions:l.allComponents,injectCSS:!1,onUpdate({editor:p}){if(p.isEmpty&&!s)return c(void 0);const h=F_.converter(l.nodeExtensions).toPrismic(p.state.doc);c(h)}},[l,i]);return d.jsxs(A.Field,{display:a==="x-auto"?"grid":"flex",children:[d.jsx(A.FieldLabel,{htmlFor:r,children:xr(n)}),d.jsxs(A.FieldControl,{children:[f.isEditable&&d.jsx(n7e,{editor:f,nodeTypes:l.names,labels:l.labels,hideDisabledOptions:!0}),f.isEditable&&l.names.includes("table")&&d.jsx(d7e,{editor:f}),d.jsx(S6e,{editor:f,style:{width:"100%"}})]})]})}function h7e(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 m;const{extensions:i,nodeTypes:o}=K6e(e.config),a=i.filter(A7e),s=i.flatMap(g=>g.richTextNodeTypes);o.has(mD)&&s.push(mD);const l=i.flatMap(g=>g.component),u=i.filter(m7e).map(g=>g.name),c=[...l,...p9e(e,a),w4e.configure({supportedExtensionNames:u}),F3e,E3e],f=c.map(g=>g.name),p=qKe(c),h=g7e((m=e.config)==null?void 0:m.labels);return{allComponents:c,extensionNames:f,nodeTypes:o,nodeExtensions:a,names:s,schema:p,labels:h}},[t])}function A7e(e){return e.extType===Mc.Node}function m7e(e){return!(e.extType!==Mc.Node||e.nodeType!==Hl.Text||e.lockedFormat)}function g7e(e){return Array.from(e??[])}function v7e(e){const{content:t,field:n,id:r,readOnly:i,onContentChange:o}=e,{placeholder:a,options:s}=n.config??{},l=!!(s!=null&&s.includes("")),u=C7e(n),c=y7e({content:t,placeholder:a,defaultValue:u,canHaveEmptyValue:l}),f=a&&u===void 0||a===void 0&&!l;return d.jsxs(A.Field,{children:[d.jsx(A.FieldIcon,{name:"arrowDropDownCircle"}),d.jsx(A.FieldLabel,{htmlFor:r,children:xr(n)}),d.jsx(A.FieldControl,{children:d.jsxs(A.Select,{id:r,size:"large",color:"grey",value:c,disabled:i,renderTrigger:()=>d.jsx(A.SelectGhostTrigger,{id:r}),onValueChange:p=>{o(b7e({value:p,placeholder:a}))},children:[f&&d.jsx(A.SelectItem,{value:a||dy,children:a||""}),s==null?void 0:s.map(p=>d.jsx(A.SelectItem,{value:p||dy,children:p},p))]})})]})}function y7e(e){const{content:t,placeholder:n,defaultValue:r,canHaveEmptyValue:i}=e;let{value:o}=t??{};return o===""&&i?dy:(o===""&&(o=void 0),o??r??n??"")}function b7e(e){const{placeholder:t}=e;let{value:n}=e;if(n!==t)return n===dy&&(n=""),{__TYPE__:"FieldContent",type:"Select",value:n}}function C7e(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 dy=" ",iU=sX(2,3),S7e={__TYPE__:"TableContent",content:sX(1,1)};function w7e(e){const{field:t,content:n,onContentChange:r,...i}=e;function o(a){if(!a)return r(S7e);e.onContentChange(T7e(a))}return d.jsx(aX,{...i,field:I7e(t),content:_7e(n),onContentChange:o,shouldReturnEmptyContent:!0,scroll:"x-auto",padding:"zero"})}function sX(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 _7e(e){return{__TYPE__:"StructuredTextContent",value:[{type:"table",content:x7e(e)}]}}function x7e(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)))?iU:t.right.content}function T7e(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,au.table].join(",")}}}function E7e(e){const{id:t,readOnly:n,field:r,content:i,onContentChange:o}=e,a=i!=null&&i.value?ix.dateFromISOString(i.value):void 0;return d.jsxs(A.Field,{children:[d.jsx(A.FieldIcon,{name:"event"}),d.jsx(A.FieldLabel,{id:t,children:xr(r)}),d.jsx(A.FieldControl,{children:d.jsx(A.Box,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:d.jsx(A.DateInput,{mode:"date-time","aria-labelledby":t,disabled:n,value:a,onValueChange:s=>o(R7e(s))})})})]})}function R7e(e){if(e)return{__TYPE__:"FieldContent",type:"Timestamp",value:$7e(e)}}function $7e(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 TC(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(lUe,{...a,field:i,content:fe.isBooleanContent(r)?r:void 0}):i.type==="Date"?d.jsx(fUe,{...a,field:i,content:fe.isDateContent(r)?r:void 0}):i.type==="Timestamp"?d.jsx(E7e,{...a,field:i,content:fe.isTimestampContent(r)?r:void 0}):i.type==="Image"?d.jsx(QBe,{...a,field:i,content:fe.isImageContent(r)?r:void 0}):i.type==="Link"?d.jsx(lPe,{...a,field:i,content:r}):i.type==="Number"?d.jsx(uPe,{...a,field:i,content:fe.isNumberContent(r)?r:void 0}):i.type==="StructuredText"?d.jsx(aX,{...a,field:i,content:fe.isRichTextContent(r)?r:void 0}):i.type==="Select"?d.jsx(v7e,{...a,field:i,content:fe.isSelectContent(r)?r:void 0}):i.type==="Text"?d.jsx(yY,{...a,field:i,content:fe.isTextContent(r)?r:void 0}):i.type==="Embed"?d.jsx(wUe,{...a,field:i,content:fe.isEmbedContent(r)?r:void 0}):i.type==="Color"?d.jsx(cUe,{...a,field:i,content:fe.isColorContent(r)?r:void 0}):i.type==="GeoPoint"?d.jsx(_Ue,{...a,field:i,content:fe.isGeoPointContent(r)?r:void 0}):i.type==="IntegrationFields"?d.jsx(aPe,{...a,field:i,content:fe.isIntegrationFieldContent(r)?r:void 0}):i.type==="Table"?d.jsx(w7e,{...a,field:i,content:fe.isTableContent(r)?r:void 0}):null},[r,t,i,o,n])}function k7e(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,l])=>{const u=t[s];return d.jsx(TC,{id:`${n}.${s}`,readOnly:o,nestableWidget:l,content:fe.isNestableContent(u)?u:void 0,onContentChange:c=>{i(O7e(t,s,c))}},s)})})}function O7e(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(iUe,{children:d.jsx(XF,{...i,title:nx(t),addItemButtonTitle:`Add item in "${nx(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 nx(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}function lX(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(TC,{...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:l}=e,u=Object.entries(l);let c=i??[j7e];!s&&c.length>1&&(c=c.slice(0,1));const{scrollOffsetTop:f}=we(),p=I.useRef(new WeakMap);M7e(p.current,c);function h(_){return p.current.get(_)??"!bugged!"}function m(_){const b=rx();o(_t.insertAtIndex(c,_,b))}function g(_){const{index:b,offset:v}=_;o(_t.move(c,b,b+v))}function y(_){o(_t.removeIndex(c,_))}function C(_,b,v,S){const w=D7e(_,[v,S]),T=L7e(c,[b,w]);F7e(p.current,_,w),o(T)}return Object.keys(l).length===0?null:d.jsx(A.Group,{title:n??"Repeatable zone",addItemButtonTitle:r??"Add item in repeatable zone",items:c,maxItems:s?void 0:1,getItemKey:h,onAddItem:m,dnd:{scrollOffsetTop:f,onReorder:o,renderDragPreview:({index:_})=>d.jsx(U7e,{title:n??"Repeatable zone",index:_}),renderDropIndicator:B7e},children:(_,b)=>{const v=new Map(_.value),S=h(_);return d.jsx(A.LazyRender,{keepLoaded:!0,loadWhenSearching:!0,children:d.jsx(A.GroupItem,{index:b,title:`${b+1} • Item`,onMove:g,onDelete:y,children:u.map(([w,T])=>d.jsx(lX,{id:`${t}[${S}].${w}`,content:v.get(w),widget:T,onContentChange:E=>C(_,b,w,E),readOnly:a},w))})})}})}function M7e(e,t){t.forEach(n=>{e.has(n)||e.set(n,bX.uniqueNumber())})}function F7e(e,t,n){const r=e.get(t);r!==void 0&&e.set(n,r)}const j7e={__TYPE__:"GroupItemContent",value:[]};function L7e(e,t){const[n,r]=t;return r?e.map((i,o)=>o===n?r:i):e.filter((i,o)=>o!==n)}function D7e(e,t){const[n,r]=t;if(!r){const o=e.value.filter(([a])=>a!==n);return rx(o)}const i=Array.from(new Map(e.value).set(n,r));return rx(i)}function rx(e=[]){return{__TYPE__:"GroupItemContent",value:e}}function U7e(e){const{title:t,index:n}=e;return d.jsxs(A.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(A.Text,{variant:"smallBold",color:"grey11",children:t??"Repeatable zone"}),d.jsxs(A.Text,{variant:"small",color:"grey11",children:[n+1," • Item"]})]}),d.jsx(A.Icon,{name:"dragIndicator",size:"small",color:"grey8"})]})}function B7e(e){const{isDropTarget:t,itemIndex:n,position:r}=e,i=t?d.jsx(A.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(A.AnimatedElement,{enterDuration:150,children:i})}function P7e(e){const{compositeSlice:t,content:n,onContentChange:r,sliceKey:i,id:o,readOnly:a,header:s}=e,l=nC();function u(){i&&l.update({id:i,requestedFrom:"sliceFieldSet"})}return d.jsxs(A.FieldSet,{id:i&&tC("sliceFieldSet",i),selected:i?l.isSelected(i):!1,onFocus:u,legend:W7e(t),header:s,children:[d.jsx(k7e,{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 W7e(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}const uX={__TYPE__:"ImageContent",edit:{background:"",crop:{x:0,y:0},zoom:0},height:0,width:0,origin:{height:0,width:0,id:"",url:""},url:""};function N7e(e){const{field:t}=e;if(t.type==="Image")return uX}function K7e(e){const{content:t,legacySlice:n,sliceKey:r,id:i,readOnly:o,onContentChange:a,header:s}=e,l=nC();function u(){r&&l.update({id:r,requestedFrom:"sliceFieldSet"})}const c=n.type==="Group"?nx(n):xr(n);return d.jsx(A.FieldSet,{id:r&&tC("sliceFieldSet",r),selected:r?l.isSelected(r):!1,onFocus:u,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(TC,{id:i,readOnly:o,nestableWidget:n,content:fe.isNestableContent(t)?t:void 0,onContentChange:f=>{const p=N7e({field:n});!f&&p&&a(p),f&&a(f)}})})}function q7e(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,l])=>{const u=t[s];return d.jsx(lX,{id:`${n}.${s}`,readOnly:o,widget:l,content:fe.isSlicePrimaryContent(u)?u:void 0,onContentChange:c=>{i(V7e(t,s,c))}},s)})})}function V7e(e,t,n){return n?{...e,[t]:n}:Pd.removeKey(e,t)}function cX(e){const{config:t,content:n,sliceKey:r,readOnly:i=!1,sharedSlice:o,onContentChange:a,...s}=e,l=z7e(o,n.variation),u=I.useId(),f={id:s.id??u,readOnly:i},p=nC();function h(){r&&p.update({id:r,requestedFrom:"sliceFieldSet"})}return l===void 0?null:d.jsx(py.Provider,{value:t,children:d.jsx(rUe,{children:d.jsxs(A.FieldSet,{id:r&&tC("sliceFieldSet",r),selected:r?p.isSelected(r):!1,onFocus:h,legend:Q7e(o,l),children:[d.jsx(A.LazyRender,{heightEstimate:400,gap:16,keepLoaded:!0,loadWhenSearching:!0,children:d.jsx(q7e,{...f,slicePrimaryZone:l.primary??{},content:n.primary,onContentChange:m=>{a({...n,primary:m})}})}),d.jsx(XF,{...f,repeatableZone:l.items??{},content:n.items,onContentChange:m=>{a({...n,items:m})}})]})})})}function z7e(e,t){return I.useMemo(()=>e.variations.find(n=>n.id===t),[e,t])}function Q7e(e,t){return[e.name,t.name].join(" • ")}function oU(e){var l,u;const{sliceZone:t,onChange:n,slices:r,sliceContent:i}=e,o=(u=(l=t.config)==null?void 0:l.labels)==null?void 0:u[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(A.Text,{component:"span",variant:"smallBold",children:"•"}),d.jsxs(A.DropdownMenu,{children:[d.jsx(A.DropdownMenuTrigger,{children:d.jsx(A.Button,{color:"grey",size:"small",endIcon:"arrowDropDown",invisible:!0,children:(a==null?void 0:a.display)??"Slice variation"})}),d.jsxs(A.DropdownMenuContent,{align:"start",maxHeight:256,children:[d.jsx(A.DropdownMenuItem,{onSelect:()=>s(void 0),endIcon:i.maybeLabel===void 0?d.jsx(A.Icon,{name:"check"}):void 0,children:"..."}),o==null?void 0:o.map(c=>d.jsx(A.DropdownMenuItem,{onSelect:()=>s(c.name),endIcon:c.name===i.maybeLabel?d.jsx(A.Icon,{name:"check"}):void 0,children:c.display??"[Missing display value]"},c.name))]})]})]})}function H7e(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,l)=>{var p,h;const u=(h=(p=o.config)==null?void 0:p.choices)==null?void 0:h[s.name];if(u===void 0)return null;const c=s.widget,f={id:`${n}[${s.key}]`,key:s.key,sliceKey:s.key,onContentChange:m=>{const g={...s,widget:m},y=Y7e(t,[l,g]);r(y)},readOnly:i};return u.type==="SharedSlice"?fe.isSharedSliceContent(c)?d.jsx(cX,{...f,config:a,sharedSlice:u,content:c}):null:u.type==="Slice"?fe.isCompositeSliceContent(c)?d.jsx(P7e,{...f,compositeSlice:u,content:c,header:d.jsx(oU,{sliceContent:s,sliceZone:o,slices:t,onChange:r})}):null:fe.isSimpleSliceContent(c)?d.jsx(K7e,{...f,legacySlice:u,content:c,header:d.jsx(oU,{sliceContent:s,sliceZone:o,slices:t,onChange:r})}):null})})}function Y7e(e,[t,n]){return{__TYPE__:"SliceContentType",value:e.value.map((r,i)=>i===t?n:r)}}function G7e(e){const{content:t,metadataFieldType:n,documentId:r,documentContent:i,documentCustomType:o,documentLocale:a,...s}=e,{showAlert:l}=A.useAlert(),[u,c]=I.useState(!1),f=we(),p=I.useMemo(()=>jQ(i,o),[i,o]),h=LQ(p);async function m(){if(!f.aiSeoMetadataEnabled)return;const{trackMetadataGeneration:g,authStrategy:y,documentBaseUrl:C,repository:_}=f;c(!0);try{const b=await FQ(_,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{l({id:n,title:"Error",subtitle:`Failed to generate SEO metadata for ${aU[n]}`})}c(!1)}return d.jsx(yY,{...s,content:t,placeholder:`${aU[n]}..`,endAdornment:d.jsxs(d.Fragment,{children:[d.jsx(PH,{type:n,value:(t==null?void 0:t.value)||""}),d.jsx(A.Tooltip,{content:h?"Generate SEO metadata from your page content.":"Your page content is too short to generate SEO metadata.",children:d.jsx(A.Button,{disabled:!h,onClick:m,size:"small",color:"grey",startIcon:"autoFixHigh",loading:u,sx:{alignSelf:"center",marginInline:8},children:"Generate"})})]})})}const aU={[oa]:"Meta title",[hs]:"Meta description"};function J7e(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(NH);function s(u){a();const c=Ar.slugify(u);i(eVe(c)),o.set(c)}function l(u){s(u.clipboardData.getData("Text").trim()),u.preventDefault()}return d.jsxs(A.Field,{children:[d.jsx(A.FieldIcon,{name:"tag"}),d.jsx(A.FieldLabel,{htmlFor:t,children:xr(n)}),d.jsx(A.FieldControl,{children:d.jsx(Tl,{id:t,variant:"success",placeholder:$c(n,"Enter a unique identifier"),value:o.value,onPaste:l,onValueChange:s,endAdornment:d.jsx(A.AnimatedElement,{enterDuration:150,children:d.jsx(Z7e,{uid:o.debouncedValue})})})})]})}function Z7e(e){const{uid:t}=e,n=we();return t?n.uidField?d.jsx(A.ErrorBoundary,{children:d.jsx(I.Suspense,{children:d.jsx(X7e,{uid:t})})}):null:d.jsx(A.Badge,{color:"tomato",title:"Required",size:"medium"})}function X7e(e){const t=tVe(e),n=we();if(!t.documentId)return null;const r=qM({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(A.Badge,{color:"tomato",size:"medium",title:d.jsxs(A.Text,{color:"tomato11",variant:"small",children:["Value already used in"," ",d.jsx(A.Text,{color:"tomato11",variant:"small",underline:!0,children:"another document"})]})})})}function eVe(e){return e===""?void 0:{__TYPE__:"UIDContent",value:e}}function tVe(e){var p,h,m,g;const{uid:t}=e,n=we();n.uidField||Mt("uidField");const{coreApiBaseUrl:r,authStrategy:i,customTypeId:o,localeId:a,documentId:s}=n,{data:l}=GM({baseUrl:r,authStrategy:i,uids:[t]}),u=l.results,f=qH({customTypeId:o,languageId:a,documentsWithUid:u,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:((m=f.versions[0])==null?void 0:m.status)==="release"?(g=f.versions[0])==null?void 0:g.release_id:void 0}:{}}function nVe(e){const{id:t,readOnly:n,staticZone:r,content:i,onContentChange:o,documentId:a,documentContent:s,documentCustomType:l,documentLocale:u}=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=iVe(f),m=Mv(i[oa])||"Meta title..",g=Mv(i[hs])||"Meta description..";return d.jsxs(A.FieldSet,{legend:"Page data",children:[h&&d.jsx(WH,{title:m,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(J7e,{..._,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&&rVe(y)&&C.type==="Text"?I.createElement(G7e,{..._,content:fe.isTextContent(b)?b:void 0,field:C,key:y,metadataFieldType:y,documentId:a,documentContent:s,documentCustomType:l,documentLocale:u}):I.createElement(TC,{..._,content:fe.isNestableContent(b)?b:void 0,key:y,nestableWidget:C})})]})}function rVe(e){return e===oa||e===hs}const iVe=e=>{var t,n;return((t=e[0])==null?void 0:t[0])===oa&&((n=e[1])==null?void 0:n[0])===hs};function oVe(e){const{id:t,readOnly:n,section:r,content:i,onContentChange:o,documentId:a,documentContent:s,documentCustomType:l,documentLocale:u}=e,[c,f]=sVe(r),[p,h]=lVe(i);return d.jsxs("div",{style:{display:"flex",flexDirection:"column",position:"relative",zIndex:0},children:[d.jsx(nVe,{id:t,readOnly:n,staticZone:c,documentId:a,content:p,onContentChange:m=>o({...h,...m}),documentContent:s,documentCustomType:l,documentLocale:u}),f.map(([m,g])=>{const y=h[m];return d.jsx(H7e,{id:`${t}.${m}`,readOnly:n,sliceZone:g,content:y,onContentChange:C=>o({...p,...h,[m]:C})},m)})]})}function aVe(e){return e.type==="Choice"||e.type==="Slices"}function sVe(e){return Object.entries(e).reduce(([t,n],[r,i])=>(aVe(i)?n.push([r,i]):Object.assign(t,{[r]:i}),[t,n]),[{},[]])}function lVe(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 uVe(e){const{config:t,readOnly:n=!1,customType:r,sectionName:i,documentId:o,content:a,locale:s,onContentChange:l}=e,u=I.useId();if(Pd.isEmpty(r.json))return null;const c=cVe(r,i),[f,p]=dVe(c,a);return d.jsx(py.Provider,{value:t,children:d.jsx(nUe,{customTypeFormat:r.format,children:d.jsx(oVe,{id:u,readOnly:n,section:c,documentId:o,content:f,onContentChange:h=>l({...p,...h}),documentContent:a,documentCustomType:r,documentLocale:s})})})}function cVe(e,t){const n=e.json[t];if(n===void 0)throw new Error(`Cannot find a section with name '${t}'.`);return n}function dVe(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=lte;exports.DeferredCodeBlock=lv;exports.DocumentEditor=uVe;exports.EditorConfigContext=py;exports.EditorErrorBoundary=lje;exports.MediaLibrary=BH;exports.MetadataBadge=PH;exports.MetadataPreview=WH;exports.OnboardingGuide=QDe;exports.OnboardingStepId=DLe;exports.SelectionManagerProvider=_Q;exports.SharedSliceEditor=cX;exports.SliceSelectionContext=VH;exports.TeamSpace=X1;exports.UIDContext=NH;exports.createSearchParams=zQ;exports.createTeamSpace=t2e;exports.defaultGroupContentWithOneItem=CQ;exports.defaultImageContentWidget=uX;exports.deleteTeamSpace=r2e;exports.documentKeys=xo;exports.documentMetaSchema=HM;exports.documentSchema=TLe;exports.documentStatus=SQ;exports.extractTextFromField=Mv;exports.fetchCustomTypes=ALe;exports.frameworkCreateProjectCodeSnippet=uU;exports.frameworkLabels=lU;exports.generateSEOMetadata=FQ;exports.getConflictingUidDocuments=qH;exports.getCustomTypesOptions=Vm;exports.getDocumentById=zm;exports.getDocumentList=YM;exports.getDocumentListOptions=QQ;exports.getOnboarding=ULe;exports.getPageTextContent=jQ;exports.getProfile=lH;exports.getRepository=Z1;exports.getRepositoryTags=XQ;exports.getRepositoryV2=LLe;exports.getRoleLabel=KLe;exports.getRoles=iH;exports.getRolesOptions=GLe;exports.getSliceSelectionDOMId=tC;exports.getTeamSpaces=oH;exports.getTeamSpacesOptions=XLe;exports.hasUIDField=KH;exports.invalidateCustomTypes=gLe;exports.invalidateDocumentListData=RLe;exports.isAdminRole=WLe;exports.isDocumentSearchVersion=Zw;exports.isDocumentVersion=NQ;exports.isMissingUID=XDe;exports.isPageContentRelevantForAISeo=LQ;exports.isValidSimulatorURL=ZQ;exports.languageSchema=QM;exports.makeSearchFullTextDocumentsQueryString=VQ;exports.metaDescriptionConfig=Mh;exports.metaDescriptionProperty=hs;exports.metaTitleConfig=Oh;exports.metaTitleProperty=oa;exports.onboardingStateSchema=tH;exports.onboardingToggleResultSchema=rH;exports.onboardingToggleStepResultSchema=nH;exports.prefetchCustomTypes=hLe;exports.prefetchStaticCustomType=CLe;exports.prepareDocumentForSave=ije;exports.profileResponse=sH;exports.repositoryFramework=J1;exports.repositorySchemaV2=eH;exports.roleMap=a2e;exports.searchDocumentStatus=Qw;exports.searchDocuments=HQ;exports.searchDocumentsQueryOptions=YQ;exports.searchFullTextDocuments=qQ;exports.sliceItemContentSchema=ILe;exports.suppressErrors=aee;exports.throwConfigError=Mt;exports.toggleOnboarding=PLe;exports.toggleOnboardingStep=BLe;exports.updateDocumentListData=ELe;exports.updateRoles=JLe;exports.updateTeamSpace=n2e;exports.useCustomType=mLe;exports.useCustomTypes=zM;exports.useDocumentList=GM;exports.useInvalidateTeamSpaces=e2e;exports.useProfile=XM;exports.useSelectionManager=xl;exports.useSliceSelection=nC;exports.useStaticCustomType=bLe;