1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,597729,e=>{"use strict";let t={images:["image/jpeg","image/jpg","image/png","image/gif","image/webp","image/avif","image/bmp","image/tiff"],videos:["video/mp4","video/mpeg","video/webm","video/ogg","video/quicktime","video/x-msvideo"],audio:["audio/mpeg","audio/mp3","audio/wav","audio/ogg","audio/webm","audio/aac"],documents:["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","text/plain","text/csv"],icons:["image/svg+xml"]};e.s(["ALLOWED_MIME_TYPES",0,t,"ASSET_CATEGORIES",0,{IMAGES:"images",VIDEOS:"videos",AUDIO:"audio",DOCUMENTS:"documents",ICONS:"icons"},"DEFAULT_ASSETS",0,{IMAGE:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNjAwIDkwMCI+PHJlY3Qgd2lkdGg9IjE2MDAiIGhlaWdodD0iOTAwIiBmaWxsPSIjMmYzNDM3Ii8+PHBvbHlnb24gcG9pbnRzPSIwLDkwMCA2MDAsMzAwIDEyMDAsOTAwIiBmaWxsPSIjNGI1MDUyIiBvcGFjaXR5PSIuNiIvPjxwb2x5Z29uIHBvaW50cz0iNzAwLDkwMCAxMTUwLDQ1MCAxNjAwLDkwMCIgZmlsbD0iIzVhNWY2MSIgb3BhY2l0eT0iLjUiLz48L3N2Zz4=",ICON:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z" /></svg>',VIDEO:"",AUDIO:""},"getAcceptString",0,function(e){return e?t[e].join(","):Object.values(t).flat().join(",")}])},627419,717278,901205,e=>{"use strict";e.s(["buildImageSizes",()=>$,"buildSvgDataUrl",()=>g,"formatFileSize",()=>C,"generateImageSrcset",()=>D,"getAssetCategoryFromMimeType",()=>k,"getAssetIcon",()=>w,"getAssetProxyUrl",()=>M,"getEditorImageUrl",()=>A,"getFileExtension",()=>_,"getOptimizedImageUrl",()=>N,"getSvgAspectRatioStyle",()=>y,"getSvgIntrinsicSize",()=>b,"isAssetOfType",()=>v,"matchesCategoryFilter",()=>S,"normalizeCategoryFilter",()=>T,"parseImageDimension",()=>I],627419);var t=e.i(597729);e.i(61640),e.i(13532);var n=e.i(672101),r=e.i(963545);e.i(647163),e.s(["buildAssetFolderPath",()=>u,"flattenAssetFolderTree",()=>h,"hasChildFolders",()=>f,"isDescendantAssetFolder",()=>p,"rebuildAssetFolderTree",()=>m],901205),e.s(["buildPath",()=>c,"flattenTree",()=>function e(t,n=null,r=0,o=new Set,l="desktop"){let a=[];return(function(e,t){return"desktop"===t?e:"desktop"!==t&&e.some(e=>{let n=Array.isArray(e.classes)?e.classes.join(" "):e.classes||"";return"mobile"===t&&/max-md:order-\d+/.test(n)||/max-lg:order-\d+/.test(n)})?[...e].sort((e,n)=>{let r=s(e,t),i=s(n,t);return null!==r&&null!==i?r-i:null!==r&&null===i?r-0:null===r&&null!==i?0-i:0}):e})(t,l).forEach((t,s)=>{let d=o.has(t.id);a.push({id:t.id,layer:t,depth:r,parentId:n,index:s,collapsed:d,canHaveChildren:(0,i.canHaveChildren)(t)});let c=(0,i.canHaveChildren)(t);t.children&&t.children.length>0&&!d&&c&&a.push(...e(t.children,t.id,r+1,o,l))}),a},"flattenTreeByParentRef",()=>l,"hasChildren",()=>a,"isDescendant",()=>d],717278);var i=e.i(885392),o=e.i(284510);function s(e,t){if("desktop"===t)return null;let n=Array.isArray(e.classes)?e.classes.join(" "):e.classes||"";if("mobile"===t){let e=n.match(/max-md:order-(\d+)/);if(e)return parseInt(e[1],10);let t=n.match(/max-lg:order-(\d+)/);return t?parseInt(t[1],10):null}let r=(0,o.getBreakpointPrefix)(t),i=RegExp(`${r.replace(":","\\:")}order-(\\d+)`),s=n.match(i);return s?parseInt(s[1],10):null}function l(e,t,n,r,i=null,o=new Set,s=0){let a=(i,l=s)=>{let d=e.filter(e=>n(e)===i).sort((e,t)=>r(e)-r(t)),c=[];return d.forEach((e,n)=>{let r=t(e);c.push({id:r,data:e,depth:l,parentId:i,index:n}),o.has(r)||c.push(...a(r,l+1))}),c};return a(i,s)}function a(e,t,n){return t.some(t=>n(t)===e)}function d(e,t,n,r,i){let o=n.find(t=>r(t)===e);if(!o)return!1;let s=i(o);return!!s&&(s===t||d(s,t,n,r,i))}function c(e,t,n,r,i,o=!1){let s=r(e),l=i(e);if(!s)return o?[l]:l;let a=t.find(e=>n(e)===s);return a?o?[...c(a,t,n,r,i,!0),l]:`${c(a,t,n,r,i)} / ${l}`:o?[l]:l}function u(e,t,n=!1){return c(e,t,e=>e.id,e=>e.asset_folder_id,e=>e.name,n)}function p(e,t,n){return d(e,t,n,e=>e.id,e=>e.asset_folder_id)}function h(e,t=null,n=new Set,r=0){return l(e,e=>e.id,e=>e.asset_folder_id,e=>e.order,t,n,r)}function f(e,t){return"root"===e?t.some(e=>null===e.asset_folder_id):a(e,t,e=>e.asset_folder_id)}function m(e,t,n,r){let i=e.map(e=>({...e,data:{...e.data}})),o=i.find(e=>e.id===t);if(!o)return console.error("â REBUILD ERROR: Moved node not found!"),[];o.parentId=n,o.index=r;let s=new Map;
1i.forEach(e=>{let t=e.parentId;s.has(t)||s.set(t,[]),s.get(t).push(e)}),s.forEach(e=>{e.sort((e,t)=>e.index-t.index);let n=e.find(e=>e.id===t);if(n){let i=e.findIndex(e=>e.id===t);e.splice(i,1);let o=0;for(let t=0;t<e.length;t++)if(e[t].index<r)o=t+1;else break;e.splice(o,0,n)}e.forEach((e,t)=>{e.index=t})});let l=(e,t=new Set)=>{if(t.has(e))return console.error("â Circular dependency detected in folder tree!"),0;t.add(e);let n=i.find(t=>t.id===e);return n&&n.parentId?1+l(n.parentId,t):0};return i.map(e=>({...e.data,asset_folder_id:e.parentId,order:e.index,depth:l(e.id)}))}function g(e,t,n){let r=e;return t&&n&&(r=r.replace(/<svg\b([^>]*)>/i,(e,r)=>{let i=/\swidth\s*=/i.test(r),o=/\sheight\s*=/i.test(r);if(i&&o)return e;let s=`${!i?` width="${t}"`:""}${!o?` height="${n}"`:""}`;return`<svg${s}${r}>`})),`data:image/svg+xml,${encodeURIComponent(r)}`}function y(e){if(!e)return null;let t=e.match(/viewBox\s*=\s*["']\s*[\d.+-]+\s+[\d.+-]+\s+([\d.+-]+)\s+([\d.+-]+)\s*["']/i);if(t){let e=parseFloat(t[1]),n=parseFloat(t[2]);if(Number.isFinite(e)&&Number.isFinite(n)&&e>0&&n>0)return`${e} / ${n}`}let n=e.match(/<svg\b([^>]*)>/i);if(n){let e=n[1],t=e.match(/\bwidth\s*=\s*["']?\s*([\d.]+)/i),r=e.match(/\bheight\s*=\s*["']?\s*([\d.]+)/i);if(t&&r){let e=parseFloat(t[1]),n=parseFloat(r[1]);if(Number.isFinite(e)&&Number.isFinite(n)&&e>0&&n>0)return`${e} / ${n}`}}return null}function b(e){if(!e)return null;let t=e.match(/<svg\b([^>]*)>/i);if(t){let e=t[1],n=e.match(/\bwidth\s*=\s*["']?\s*([\d.]+)\s*(px)?["'\s>]/i),r=e.match(/\bheight\s*=\s*["']?\s*([\d.]+)\s*(px)?["'\s>]/i);if(n&&r){let e=Math.round(parseFloat(n[1])),t=Math.round(parseFloat(r[1]));if(Number.isFinite(e)&&Number.isFinite(t)&&e>0&&t>0)return{width:e,height:t}}}let n=e.match(/viewBox\s*=\s*["']\s*[\d.+-]+\s+[\d.+-]+\s+([\d.+-]+)\s+([\d.+-]+)\s*["']/i);if(n){let e=Math.round(parseFloat(n[1])),t=Math.round(parseFloat(n[2]));if(Number.isFinite(e)&&Number.isFinite(t)&&e>0&&t>0)return{width:e,height:t}}return null}function v(e,n){return!!e&&t.ALLOWED_MIME_TYPES[n].includes(e)}let x={icons:"icon",images:"image",videos:"video",audio:"audio",documents:"file-text"};function w(e){if(!e)return"file-text";let t=k(e);return t?x[t]:"file-text"}function k(e){return e?t.ALLOWED_MIME_TYPES.icons.includes(e)?t.ASSET_CATEGORIES.ICONS:e.startsWith("image/")?t.ASSET_CATEGORIES.IMAGES:e.startsWith("video/")?t.ASSET_CATEGORIES.VIDEOS:e.startsWith("audio/")?t.ASSET_CATEGORIES.AUDIO:t.ALLOWED_MIME_TYPES.documents.includes(e)?t.ASSET_CATEGORIES.DOCUMENTS:null:null}function S(e,t){if("all"===t||null===t)return!0;let n=k(e);return!!n&&("string"==typeof t?n===t:t.includes(n))}function T(e){return"all"===e||null===e?null:"string"==typeof e?[e]:e}function C(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return`${Math.round(e/Math.pow(1024,t))} ${["B","KB","MB","GB"][t]}`}function _(e){let t=e.split("/");return t[1]?.toUpperCase()||"FILE"}function M(e){if(!e.storage_path)return null;let t=(0,n.uuidToBase62)(e.id),i=e.filename.replace(/\.[^/.]+$/,""),o=(0,r.sanitizeSlug)(i)||"file",s=(0,n.mimeToExtension)(e.mime_type);return`/a/${t}/${o}.${s}`}function A(e,t=1920,n=80){var r;let i=e.public_url??null;if(!((r=e.mime_type)&&r.startsWith("image/")&&"image/svg+xml"!==r&&"image/gif"!==r&&1)||!e.storage_path)return i;let o=M(e);return o?`${o}?width=${t}&quality=${n}`:i}function E(e){return e.startsWith("/a/")}function O(e){if(e.split("?")[0].split("#")[0].toLowerCase().endsWith(".gif"))return!1;if(E(e))return!0;try{let t=new URL(e);return t.hostname.includes("supabase")||t.pathname.includes("/storage/v1/object/public/")}catch{return!1}}function N(e,t=200,n=80){if(!O(e))return e;try{if(E(e)){let r=new URL(e,"http://localhost");return r.searchParams.set("width",t.toString()),r.searchParams.set("quality",n.toString()),`${r.pathname}${r.search}`}let r=new URL(e);return r.searchParams.set("width",t.toString()),r.searchParams.set("quality",n.toString()),r.toString()}catch{return e}}function D(e,t=[320,480,640,750,828,1080,1280,1536,1920],n=85,r){if(!O(e))return"";let i=t;r&&r>0&&r<t[t.length-1]&&(i=t.filter(e=>e<r)).push(r);try{if(E(e)){let t=e.split("?")[0];return i.map(e=>`${t}?width=${e}&quality=${n} ${e}w`).join(", ")}return i.map(t=>{let r=new URL(e);return r.searchParams.set("width",t.toString()),r.searchParams.set("qual
1ity",n.toString()),r.searchParams.set("resize","cover"),`${r.toString()} ${t}w`}).join(", ")}catch{return""}}function I(e){if(null==e)return null;let t=String(e).trim();if(!/^\d+(\.\d+)?(px)?$/i.test(t))return null;let n=parseFloat(t.replace(/px$/i,""));return n>0?n:null}function $(e){return e?`(max-width: 768px) 100vw, ${e}px`:"100vw"}},284510,e=>{"use strict";let t=[{value:"mobile",label:"Mobile",prefix:"max-md:",maxWidth:767},{value:"tablet",label:"Tablet",prefix:"max-lg:",maxWidth:1023},{value:"desktop",label:"Desktop",prefix:"",maxWidth:null}],n=t.map(e=>e.value);e.s(["BREAKPOINTS",0,t,"BREAKPOINT_VALUES",0,n,"getBreakpointPrefix",0,function(e){let n=t.find(t=>t.value===e);return n?.prefix??""},"getCurrentBreakpoint",0,function(){let e=window.innerWidth;return e<768?"mobile":e<1024?"tablet":"desktop"}])},347802,e=>{"use strict";e.s(["buildFieldVariablePath",()=>l,"convertContentToValue",()=>g,"formatFieldValue",()=>s,"getVariableLabel",()=>d,"normalizeInlineVariableFormats",()=>h,"parseValueToContent",()=>m,"resolveFieldFromSources",()=>a]);var t=e.i(692326),n=e.i(137619),r=e.i(970190),i=e.i(495398),o=e.i(302427);function s(e,o,l="UTC",a){if(null==e)return"";if("rich_text"===o){if("object"==typeof e)return(0,r.extractPlainTextFromTiptap)(e);if("string"==typeof e)try{let t=JSON.parse(e);return(0,r.extractPlainTextFromTiptap)(t)}catch{return e}return""}if((0,t.isDateFieldType)(o)&&"string"==typeof e)return a?(0,i.formatDateWithPreset)(e,a,l):"date_only"===o?(0,n.formatDateOnly)(e):(0,n.formatDateInTimezone)(e,l,"display");if("number"===o&&a){let t="number"==typeof e?e:parseFloat(String(e));if(!isNaN(t))return(0,i.formatNumberWithPreset)(t,a)}return"object"==typeof e?JSON.stringify(e):String(e)}function l(e,t){return t&&t.length>0?[e,...t].join("."):e}function a(e,t,n,r,i,o,s){return"global"===t?s?.[e]??n?.[e]??r?.[e]??void 0:"page"===t?r?.[e]:i&&o?.[i]?o[i][e]:"collection"===t?n?.[e]:n?.[e]??r?.[e]}function d(e,t,n){if("field"===e.type&&e.data?.field_id){let r=t?.find(t=>t.id===e.data.field_id),i=e.data.relationships||[];if(i.length>0&&n){let e=r?.name||"[Deleted]",t=r?.reference_collection_id?n[r.reference_collection_id]:[],o="";for(let r=0;r<i.length;r++){let s=i[r],l=t?.find(e=>e.id===s);r===i.length-1?o=l?.name||"[Deleted]":(e=l?.name||"[Deleted]",t=l?.reference_collection_id?n[l.reference_collection_id]:[])}return`${e} ${o}`}return r?.name||"[Deleted Field]"}return"pagination"===e.type&&e.data?.key?o.PAGINATION_VARIABLE_LABELS[e.data.key]||"Pagination":e.type}function c(e,t){let n=e.match(RegExp(`${t}=["']([^"']*)["']`));return n?n[1]:null}function u(e,t,n="text"){return`<ycode-inline-variable>${JSON.stringify({type:"field",data:{field_id:e,field_type:n},label:t})}</ycode-inline-variable>`}function p(e,t,n){let r,i=/<ycode-inline-variable[^>]*>[\s\S]*?<\/ycode-inline-variable>/g,o=[],s=0;for(;null!==(r=i.exec(e));)r.index>s&&o.push({text:e.slice(s,r.index),isCanonical:!1}),o.push({text:r[0],isCanonical:!0}),s=i.lastIndex;return s<e.length&&o.push({text:e.slice(s),isCanonical:!1}),o.map(e=>e.isCanonical?e.text:e.text.replace(t,n)).join("")}function h(e){return e=p(e=e.replace(/<ycode-inline-variable\b([^>]*?)\/>/g,"<ycode-inline-variable$1></ycode-inline-variable>"),/<span\b([^>]*\by_dynamic_variable=["']true["'][^>]*)>([\s\S]*?)<\/span>/g,(e,t)=>{let n=c(t,"y_fieldname")||c(t,"y_variable")||"",r=c(t,"y_fieldtype")||"text",i=c(t,"y_name")||n||"variable";return u(n,i,r)}),e=p(e,/<span\b([^>]*\by_variable=["']([^"']+)["'][^>]*)>([\s\S]*?)<\/span>/g,(e,t,n)=>{let r=c(t,"y_name")||c(t,"y_fieldname")||(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(n)?n:"Variable");return u(n,r,c(t,"y_fieldtype")||"text")}),e=function(e,t){let n,r=/<ycode-inline-variable[^>]*>[\s\S]*?<\/ycode-inline-variable>/g,i=[],o=0;for(;null!==(n=r.exec(e));)n.index>o&&i.push(t(e.slice(o,n.index))),i.push(n[0]),o=r.lastIndex;return o<e.length&&i.push(t(e.slice(o))),i.join("")}(e=p(e,/<span\b[^>]*\bdata-variable=["']([^"']*)["'][^>]*>([\s\S]*?)<\/span>/g,(e,t,n)=>{let r=t.replace(/"/g,'"').replace(/&/g,"&");try{let e=JSON.parse(r);if(e?.type&&e?.data)return!e.label&&n&&(e.label=n.trim()),`<ycode
1-inline-variable>${JSON.stringify(e)}</ycode-inline-variable>`}catch{}return e}),f)}function f(e){if(!e.includes('{"type":"'))return e;let t="",n=0;for(;n<e.length;)if("{"===e[n]&&e.startsWith('{"type":"',n)){let r=0,i=!1;for(let o=n;o<e.length;o++)if("{"===e[o])r++;else if("}"===e[o]&&0==--r){let r=e.slice(n,o+1);try{let e=JSON.parse(r);if(e?.type&&e?.data&&(e.data.field_id||e.data.fieldId)){let r=e.data.field_id||e.data.fieldId,s=e.data.field_type||e.data.fieldType||"text",l=e.label||r||"variable";t+=u(r,l,s),n=o+1,i=!0}}catch{}break}!i&&(t+=e[n],n++)}else t+=e[n],n++;return t}function m(e,t,n,r){let i;e=h(e);let o=[],s=/<ycode-inline-variable(?:\s+id="([^"]+)")?>([\s\S]*?)<\/ycode-inline-variable>/g,l=0;for(;null!==(i=s.exec(e));){if(i.index>l){let t=e.slice(l,i.index);t&&o.push({type:"text",text:t})}let a=i[1],c=i[2].trim(),u=null,p="variable";if(a&&n&&n[a])p=d(u=n[a],t,r);else if(c)try{let e=JSON.parse(c);if(e.type&&e.data){u=e;let n=d(e,t,r);p=e.label&&("field"===n||"[Deleted Field]"===n)?e.label:n}}catch{}u&&o.push({type:"dynamicVariable",attrs:{variable:u,label:p}}),l=s.lastIndex}if(l<e.length){let t=e.slice(l);t&&o.push({type:"text",text:t})}return{type:"doc",content:[{type:"paragraph",content:o.length>0?o:void 0}]}}function g(e){let t="";if(e?.content){for(let n of e.content)if(n.content)for(let e of n.content)"text"===e.type?t+=e.text:"dynamicVariable"===e.type&&e.attrs.variable&&(t+=`<ycode-inline-variable>${JSON.stringify(e.attrs.variable)}</ycode-inline-variable>`)}return t}},692326,e=>{"use strict";e.s(["ASSET_FIELD_TYPES",()=>U,"AUDIO_FIELD_TYPES",()=>K,"COLOR_FIELD_TYPES",()=>J,"COMPARE_OPERATORS",()=>x,"DATE_PRESET_OPTIONS",()=>_,"DISPLAYABLE_FIELD_TYPES",()=>a,"FIELD_TYPES",()=>o,"FIELD_TYPES_BY_CATEGORY",()=>s,"IMAGE_FIELD_TYPES",()=>q,"LINK_FIELD_TYPES",()=>H,"MULTI_ASSET_COLLECTION_ID",()=>el,"MULTI_ASSET_VIRTUAL_FIELDS",()=>ed,"PAGE_COLLECTION_OPERATORS",()=>b,"REF_COLLECTION_PREFIX",()=>em,"REF_PAGE_PREFIX",()=>ef,"RICH_TEXT_FIELD_TYPES",()=>Z,"RICH_TEXT_ONLY_FIELD_TYPES",()=>Q,"SELF_OPERATORS",()=>v,"SIMPLE_TEXT_FIELD_TYPES",()=>X,"VIDEO_FIELD_TYPES",()=>G,"VIDEO_ID_FIELD_TYPES",()=>Y,"buildFieldGroupsForLayer",()=>ey,"buildGlobalsMetaMap",()=>B,"buildGlobalsValueMap",()=>W,"buildMultiAssetVirtualFields",()=>ec,"buildReferenceItemOptions",()=>eg,"buildStatusValue",()=>P,"compareDateFilter",()=>$,"filterFieldGroupsByType",()=>ep,"findDisplayField",()=>L,"findStatusFieldId",()=>R,"flattenFieldGroups",()=>eh,"getAssetFieldLabel",()=>eo,"getAssetFieldTypeLabel",()=>es,"getFieldIcon",()=>c,"getFieldTypeLabel",()=>u,"getFileManagerCategory",()=>er,"getItemDisplayName",()=>F,"getOperatorsForFieldType",()=>w,"getStatusFlagsFromAction",()=>z,"hasBoundCollectionSource",()=>ea,"hasDynamicDateRule",()=>O,"isAssetFieldType",()=>ee,"isDateFieldType",()=>i,"isDateOnlyString",()=>D,"isDatePreset",()=>M,"isMultipleAssetField",()=>et,"isValidAssetForField",()=>ei,"isVirtualAssetField",()=>eu,"mergeGlobalsIntoFieldData",()=>V,"operatorRequiresItemSelection",()=>S,"operatorRequiresSecondValue",()=>C,"operatorRequiresValue",()=>k,"parseItemIdList",()=>T,"resolveDateFilterValue",()=>E,"supportsDefaultValue",()=>l]);var t=e.i(627419),n=e.i(597729),r=e.i(885392);function i(e){return"date"===e||"date_only"===e}let o=[{value:"text",label:"Text",icon:"text",category:"basic",hasDefault:!0},{value:"rich_text",label:"Rich text",icon:"rich-text",category:"basic",hasDefault:!0},{value:"number",label:"Number",icon:"hash",category:"basic",hasDefault:!0},{value:"boolean",label:"Boolean",icon:"check",category:"basic",hasDefault:!0},{value:"date",label:"Date & Time",icon:"calendar",category:"basic",hasDefault:!0},{value:"date_only",label:"Date",icon:"calendar",category:"basic",hasDefault:!0},{value:"color",label:"Color",icon:"droplet",category:"basic",hasDefault:!0},{value:"option",label:"Option",icon:"select",category:"basic",hasDefault:!0},{value:"email",label:"Email",icon:"email",category:"contact",hasDefault:!0},{value:"phone",label:"Phone",icon:"phone",category:"contact",hasDefault:!0},{value:"link",label:"Link",icon:"link",category:"contact",hasDefault:!0},{value:"image",label:"Image",icon:"image",category:"asset",hasDefault:!0},{value:"audio",label:"Audio",icon:"audio",category:"asset",hasDefault:!0},{value:"video",label:"Video",icon:"video",category:"asset",hasDefault:!0},{value:"document",label:"Document",icon:"file-text",category:"asset",hasDefault:!0},{value:"reference",label:"Reference",icon:"database",category:"relation",hasDefault:!1},{value:"multi_reference",label:"Multi-reference",icon:"database",category:"relation",hasDefault:!1},{value:"count",label:"Count",icon:"hash",category:"relation",hasDefault:!1}],s=[{id:"basic",label:"Basic"},{id:"contact",label:"Contact"},{id:"asset",label:"Assets"},{id:"relation",label:"Relations"}].map(e=>({...e,types:o.filter(t=>t.category===e.id)}
1));function l(e){return o.some(t=>t.value===e&&t.hasDefault)}[...o.map(e=>e.value)];let a=o.filter(e=>"multi_reference"!==e.value).map(e=>e.value),d=Object.fromEntries(o.map(e=>[e.value,e]));function c(e,t="text"){return e?d[e]?.icon??t:t}function u(e){return d[e]?.label??e}let p=[{value:"is",label:"is"},{value:"is_not",label:"is not"},{value:"contains",label:"contains"},{value:"does_not_contain",label:"does not contain"},{value:"is_present",label:"is present"},{value:"is_empty",label:"is empty"}],h=[{value:"is",label:"is"},{value:"is_not",label:"is not"},{value:"lt",label:"is less than"},{value:"lte",label:"is less than or equal to"},{value:"gt",label:"is more than"},{value:"gte",label:"is more than or equal to"}],f=[{value:"is",label:"is"},{value:"is_before",label:"is before"},{value:"is_after",label:"is after"},{value:"is_between",label:"is between"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],m=[{value:"is",label:"is"}],g=[{value:"is_one_of",label:"is one of"},{value:"is_not_one_of",label:"is not one of"},{value:"exists",label:"exists"},{value:"does_not_exist",label:"does not exist"}],y=[{value:"is_one_of",label:"is one of"},{value:"is_not_one_of",label:"is not one of"},{value:"contains_all_of",label:"contains all of"},{value:"contains_exactly",label:"contains exactly"},{value:"item_count",label:"item count"},{value:"has_items",label:"has items"},{value:"has_no_items",label:"has no items"}],b=[{value:"item_count",label:"item count"},{value:"has_items",label:"has items"},{value:"has_no_items",label:"has no items"}],v=[{value:"is_one_of",label:"is one of"},{value:"is_not_one_of",label:"is not one of"}],x=[{value:"eq",label:"equals"},{value:"lt",label:"less than"},{value:"lte",label:"less than or equal"},{value:"gt",label:"greater than"},{value:"gte",label:"greater than or equal"}];function w(e){switch(e){case"number":case"count":return h;case"date":case"date_only":return f;case"boolean":return m;case"reference":case"image":case"audio":case"video":case"document":return g;case"multi_reference":return y;default:return p}}function k(e){return!["is_present","is_empty","is_not_empty","has_items","has_no_items","exists","does_not_exist"].includes(e)}function S(e){return["is_one_of","is_not_one_of","contains_all_of","contains_exactly"].includes(e)}function T(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>"string"==typeof e):[]}catch{return[]}}function C(e){return"is_between"===e}let _=[{value:"$today",label:"Today"},{value:"$this_week",label:"This week"},{value:"$this_month",label:"This month"},{value:"$this_year",label:"This year"},{value:"$past_week",label:"In the past week"},{value:"$past_month",label:"In the past month"},{value:"$past_year",label:"In the past year"}];function M(e){return!!e&&e.startsWith("$")}function A(e,t,n,r,i,o,s,l="UTC"){let a=Date.UTC(e,t-1,n,r,i,o,s);try{let e=new Intl.DateTimeFormat("en-US",{timeZone:l,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).formatToParts(new Date(a)),t=t=>Number(e.find(e=>e.type===t)?.value),n=Date.UTC(t("year"),t("month")-1,t("day"),t("hour"),t("minute"),t("second"));return a-(n-a)}catch{return a}}function E(e,t,n,r="UTC"){if(!t)return null;if(!M(t))return{operator:e,value:t,value2:n};let i=function(e,t="UTC"){let{year:n,month:r,day:i}=function(e,t="UTC"){try{let n=new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(e),r=e=>Number(n.find(t=>t.type===e)?.value);return{year:r("year"),month:r("month"),day:r("day")}}catch{return{year:e.getUTCFullYear(),month:e.getUTCMonth()+1,day:e.getUTCDate()}}}(new Date,t),o=r-1,s=(e,t,n)=>new Date(Date.UTC(e,t,n)).toISOString().slice(0,10);switch(e){case"$today":return{start:s(n,o,i),end:s(n,o,i)};case"$this_week":{let e=(new Date(Date.UTC(n,o,i)).getUTCDay()+6)%7;return{start:s(n,o,i-e),end:s(n,o,i-e+6)}}case"$this_month":return{start:s(n,o,1),end:s(n,o+1,0)};case"$this_year":return{start:s(n,0,1),end:s(n,11,31)};case"$past_week":return{start:s(n,o,i-7),end:s(n,o,i)};case"$past_month":return{start:s(n,o-1,i),end:s(n,o,i)};case"$past_year":return{start:s(n-1,o,i),end:s(n,o,i)};default:return null}}(t,r);if(!i)return{operator:e,value:t,value2:n};switch(e){case"is":case"is_between":default:return{operator:"is_between",value:i.start,value2:i.end};case"is_before":return{operator:"is_before",value:i.start};case"is_after":return{operator:"is_after",value:i.end}}}function O(e){if(!e?.groups)return!1;for(let t of e.groups)if(t.conditions){for(let e of t.conditions)if("collection_field"===e.source&&e.fieldType&&i(e.fieldType)&&M(e.value))return!0}return!1}let N=/^\d{4}-\d{2}-\d{2}$/;function D(e){return!!e&&N.test(e)}function I(e,t="UTC",n=!1){if(!e)return null;if(D(e)){if(n){let t=Date.parse(`${e}T00:00:00.000Z`),n=Date.parse(`${e}T23:59:59.999Z`);return isNaN(t)||isNaN(n)?null:{start:t,end:n}}let[r,i,o]=e.split("-").map(Number),s=A(r,i,o,0,0,0,0,t),l=A(r,i,o,23,59,59,999,t);return isNaN(s)||isNaN(l)?null:{start:s,end:l}}let r=Date.parse(e);return isNaN(r)?null:{start:r,end:r}}function $(e,t,n,r,i="UTC",o=!1){let s=Date.parse(e);if(isNaN(s))return!1;let l=I(n,i,o);if(!l)return!1;switch(t){case"is":return s>=l.start&&s<=l.end;case"is_before":return s<l.start;case"is_after":return s>l.end;case"is_between":{let e=I(r,i,o);if(!e)return!1;return s>=l.start&&s<=e.end}}}function R(e){return e.find(e=>"status"===e.type&&e.is_computed)?.id??null}function P(e,t,n=!1){return JSON.stringify({is_publishable:e,is_published:t,is_modified:n})}function z(e){return{isPublishable:"draft"!==e,isPublished:"publish"===e}}function L(e){let t=e.find(e=>"title"===e.key);if(t)return t;let n=e.find(e=>"name"===e.key);if(n)return n;let r=e.find(e=>("text"===e.type||"email"===e.type||"phone"===e.type)&&e.fillable);return r||(e[0]??null)}function F(e,t){return t&&e.values[t.id]||"Untitled"}function j(e){return{id:e.id,name:e.name,key:e.key,type:e.type,default:null,fillable:!0,order:e.order,collection_id:"__globals__",reference_collection_id:null,created_at:e.created_at,updated_at:e.updated_at,deleted_at:null,hidden:!1,is_computed:!1,data:e.data??{},is_published:e.is_published}}function W(e){return Object.fromEntries(e.map(e=>[e.id,e.value??""]))}function B(e){return Object.fromEntries(e.map(e=>[e.id,{type:e.type,name:e.name}]))}function V(e,t){return t&&0!==Object.keys(t).length?e&&0!==Object.keys(e).length?{...t,...e}:t:e}let H=["link","email","phone","image","audio","video","document"],U=["image","audio","video","document"],J=["color"],q=["image","link"],K=["audio"],G=["video"],Y=["text"],X=["text","number","date","date_only","email","phone","option","count"],Z=[...X,"rich_text"],Q=["rich_text"];function ee(e){return null!=e&&U.includes(e)}function et(e){return ee(e.type)&&e.data?.multiple===!0}function en(e){switch(e){case"image":return n.ASSET_CATEGORIES.IMAGES;case"audio":return n.ASSET_CATEGORIES.AUDIO;case"video":return n.ASSET_CATEGORIES.VIDEOS;default:return n.ASSET_CATEGORIES.DOCUMENTS}}function er(e){return"image"===e?[n.ASSET_CATEGORIES.IMAGES,n.ASSET_CATEGORIES.ICONS]:en(e)}function ei(e,r){if("image"===r)return!!(e.mime_type&&((0,t.isAssetOfType)(e.mime_type,n.ASSET_CATEGORIES.IMAGES)||(0,t.isAssetOfType)(e.mime_type,n.ASSET_CATEGORIES.ICONS)));let i=en(r);return!!(e.mime_type&&(0,t.isAssetOfType)(e.mime_type,i))}function eo(e){switch(e){case"image":return"an image";case"audio":return"an audio";case"video":return"a video";case"document":return"a document";default:return"a file"}}function es(e){switch(e){case"image":return"image";case"audio":return"audio";case"video":return"video";case"document":return"document";default:return"file"}}let el="__multi_asset__";
1function ea(e){return!!e&&(e.source_field_type?!!e.source_field_id:!!e.id)}let ed={FILENAME:"__asset_filename",URL:"__asset_url",FILE_SIZE:"__asset_file_size",MIME_TYPE:"__asset_mime_type",WIDTH:"__asset_width",HEIGHT:"__asset_height"};function ec(){let e={collection_id:"__virtual__",order:0,hidden:!1,is_computed:!1,is_published:!0,created_at:"",updated_at:"",deleted_at:null};return[{...e,id:ed.URL,name:"File URL",type:"image",key:null,default:null,reference_collection_id:null,data:{},fillable:!1},{...e,id:ed.FILENAME,name:"File name",type:"text",key:null,default:null,reference_collection_id:null,data:{},fillable:!1},{...e,id:ed.FILE_SIZE,name:"File size",type:"text",key:null,default:null,reference_collection_id:null,data:{},fillable:!1},{...e,id:ed.MIME_TYPE,name:"MIME type",type:"text",key:null,default:null,reference_collection_id:null,data:{},fillable:!1},{...e,id:ed.WIDTH,name:"Width",type:"text",key:null,default:null,reference_collection_id:null,data:{},fillable:!1},{...e,id:ed.HEIGHT,name:"Height",type:"text",key:null,default:null,reference_collection_id:null,data:{},fillable:!1}]}function eu(e){return e.startsWith("__asset_")}function ep(e,t,n){return e&&0!==e.length?e.map(e=>{let r=e.fields.filter(e=>"reference"===e.type&&e.reference_collection_id?!n?.allFields||function e(t,n,r,i=new Set){return!(!t.reference_collection_id||i.has(t.reference_collection_id))&&(i.add(t.reference_collection_id),(r[t.reference_collection_id]||[]).some(t=>"multi_reference"!==t.type&&(!!n.includes(t.type)||"reference"===t.type&&e(t,n,r,i))))}(e,t,n.allFields):!(!t.includes(e.type)||n?.excludeMultipleAsset&&et(e)));return r.sort((e,t)=>("reference"===e.type)-("reference"===t.type)),{...e,fields:r}}).filter(e=>e.fields.length>0):[]}function eh(e){return e?.flatMap(e=>e.fields)||[]}let ef="ref-page:",em="ref-collection:";function eg(e,t,n){if(!e||!t||!n)return[];let r=[];for(let e of n){let n="page"===e.source?ef:em;for(let i of e.fields)"reference"===i.type&&i.reference_collection_id===t&&r.push({value:`${n}${i.id}`,label:`${i.name} - Reference field`})}return r}function ey(e,t,n,i,o,s){let l=(0,r.findAllParentCollectionLayers)(t,e),a=l[0]||null,d=a?(0,r.getCollectionVariable)(a):null,c=d?.source_field_type==="multi_asset"&&d.source_field_id?{sourceFieldId:d.source_field_id,source:d.source_field_source||"collection"}:null;return function(e){let{parentCollectionLayers:t,page:n,fieldsByCollectionId:r,collections:i,multiAssetContext:o,globals:s}=e,l=[],a=new Set;o&&l.push({fields:ec(),label:"File fields",source:"collection"});for(let e=0;e<t.length;e++){let{layerId:n,collectionId:o}=t[e];if(o===el||a.has(o))continue;let s=r[o]||[],d=i.find(e=>e.id===o);if(s.length>0){let t=0===e;l.push({fields:s,label:d?.name??"Collection",detail:t?"Collection fields":"Parent fields",source:"collection",layerId:n}),a.add(o)}}if(n?.is_dynamic&&n?.settings?.cms?.collection_id){let e=n.settings.cms.collection_id,t=r[e]||[],o=i.find(t=>t.id===e);t.length>0&&l.push({fields:t,label:o?.name??"Collection",detail:"Page fields",source:"page"})}return s&&s.length>0&&l.push({fields:s.map(j),label:"Global variables",detail:"Globals",source:"global"}),l.length>0?l:void 0}({parentCollectionLayers:l.map(e=>({layerId:e.id,collectionId:(0,r.getCollectionVariable)(e)?.id})).filter(e=>!!e.collectionId),page:n,fieldsByCollectionId:i,collections:o,multiAssetContext:c,globals:s})}},965426,e=>{"use strict";e.s(["castValue",()=>l,"getInverseReferenceFields",()=>d,"getSortParams",()=>o,"isTruthyBooleanValue",()=>r,"normalizeBooleanValue",()=>n,"parseMultiReferenceValue",()=>i,"remapLayerIdsForCollectionItem",()=>c,"resolveReferenceFieldsSync",()=>function e(t,n,r,i,o=new Set,s){let l={...t};for(let a of n.filter(e=>"reference"===e.type&&e.reference_collection_id)){let n=t[a.id];if(!n||!a.reference_collection_id)continue;let d=`${a.id}:${n}`;if(o.has(d))continue;o.add(d);let c=(r[a.reference_collection_id]||[]).find(e=>e.id===n);if(!c)continue;let u=i[a.reference_collection_id]||[],p=s?s(c.id,c.values,u):c.values;for(let e of u){let t=p[e.id];void 0!==t&&(l[`${a.id}.${e.id}`]=t)}for(let[t,n]of Object.entries(e(p,u,r,i,o,s)))t.includes(".")&&(l[`${a.id}.${t}`]=n)}return l},"slugify",()=>a,"sortCollectionsByOrder",()=>s]);var t=e.i(963545);function n(e){let t=Number(e);return"true"===e||"yes"===e||"1"===e||1===t||"boolean"==typeof e&&e?"true":"false"}function r(e){let t=Number(e);return"true"===e||"yes"===e||"1"===e||1===t}function i(e){if(!e)return[];if(Array.isArray(e))return e;if("string"==typeof e)try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{}return[]}function o(e){return e&&"manual"!==e.direction?{sortBy:e.field,sortOrder:e.direction}:{sortBy:"manual",sortOrder:void 0}}function s(e){return[...e].sort((e,t)=>
1{if(e.order!==t.order)return e.order-t.order;let n=e.name.localeCompare(t.name);return 0!==n?n:new Date(e.created_at).getTime()-new Date(t.created_at).getTime()})}function l(e,t){if(null==e||""===e)return null;switch(t){case"number":{let t=parseFloat(e);return isNaN(t)?null:t}case"boolean":return"true"===e||"1"===e||"yes"===e;case"date":case"date_only":case"reference":case"link":case"color":return e;case"rich_text":try{return JSON.parse(e)}catch{return e}default:if(e.startsWith("{")||e.startsWith("["))try{return JSON.parse(e)}catch{}return e}}function a(e){return(0,t.sanitizeSlug)(e)}function d(e,t,n){let r=[],i=new Map(n.map(e=>[e.id,e]));for(let[n,o]of Object.entries(t)){if(n===e)continue;let t=i.get(n);if(t)for(let n of o)("reference"===n.type||"multi_reference"===n.type)&&n.reference_collection_id===e&&r.push({field:n,collection:t})}return r}function c(e,t){let n=new Set,r=e=>{n.add(e.id),e.children?.forEach(r)};r(e);let i=e=>{let r={...e,id:`${e.id}${t}`,_originalLayerId:e._originalLayerId||e.id};return e.interactions?.length&&(r.interactions=e.interactions.map(e=>({...e,id:`${e.id}${t}`,tweens:e.tweens.map(e=>({...e,layer_id:n.has(e.layer_id)?`${e.layer_id}${t}`:e.layer_id}))}))),e.children&&(r.children=e.children.map(i)),r};return i(e)}},897742,e=>{"use strict";e.s(["collectVariantVariableOptions",0,function(e,t,n){if(!e||!n)return[];let r=new Set,i=[],o=e=>{for(let s of e){if(s.componentVariantVariableId===n&&s.componentId){let e=t.find(e=>e.id===s.componentId);if(e?.variants&&e.variants.length>0)for(let t of e.variants){let n=`${e.id}::${t.id}`;r.has(n)||(r.add(n),i.push({variant_id:t.id,variant_name:t.name,component_id:e.id,component_name:e.name}))}}s.children?.length&&o(s.children)}};for(let t of e.variants&&e.variants.length>0?e.variants:[{id:"legacy",name:"Default",layers:e.layers??[]}])Array.isArray(t.layers)&&o(t.layers);return i},"getComponentVariantLayers",0,function(e,t){let n=e.variants;return n&&n.length>0?((t?n.find(e=>e.id===t):void 0)??n[0]).layers??[]:e.layers??[]}])},672101,e=>{"use strict";e.s(["mimeToExtension",0,function(e){return({"image/jpeg":"jpg","image/jpg":"jpg","image/png":"png","image/gif":"gif","image/webp":"webp","image/avif":"avif","image/bmp":"bmp","image/tiff":"tiff","image/svg+xml":"svg","video/mp4":"mp4","video/mpeg":"mpeg","video/webm":"webm","video/ogg":"ogv","video/quicktime":"mov","audio/mpeg":"mp3","audio/mp3":"mp3","audio/wav":"wav","audio/ogg":"ogg","audio/webm":"weba","audio/aac":"aac","application/pdf":"pdf"})[e]||e.split("/").pop()||"bin"},"uuidToBase62",0,function(e){let t=BigInt("0x"+e.replace(/-/g,"")),n=BigInt(0),r=BigInt(62);if(t===n)return"0".padStart(22,"0");let i=[];for(;t>n;)i.unshift("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[Number(t%r)]),t/=r;return i.join("").padStart(22,"0")}])},137619,e=>{"use strict";function t(e,n="UTC",r="display"){if(!e)return"";let i="string"==typeof e?new Date(e):e;if(isNaN(i.getTime()))return"";try{if("display"===r)return new Intl.DateTimeFormat("en-US",{timeZone:n,month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).format(i);if("datetime-local"===r){let e=new Intl.DateTimeFormat("en-CA",{timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).formatToParts(i),t=t=>e.find(e=>e.type===t)?.value||"";return`${t("year")}-${t("month")}-${t("day")}T${t("hour")}:${t("minute")}`}if("date"===r){let e=new Intl.DateTimeFormat("en-CA",{timeZone:n,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(i),t=t=>e.find(e=>e.type===t)?.value||"";return`${t("year")}-${t("month")}-${t("day")}`}}catch{}return""}function n(e,t="UTC"){if(!e)return"";try{let n=e.includes("T")?e:`${e}T00:00`,r=new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),[i,o]=n.split("T"),[s,l,a]=i.split("-").map(Number),[d,c]=o.split(":").map(Number),u=new Date(Date.UTC(s,l-1,a,d,c,0)),p=r.formatToParts(u),h=e=>Number(p.find(t=>t.type===e)?.value||0),f=h("year"),m=h("month"),g=h("day"),y=h("hour"),b=h("minute"),v=60*u.getUTCHours()+u.getUTCMinutes(),x=new Date(Date.UTC(f,m-1,g,y,b,0)),w=60*x.getUTCHours()+x.getUTCMinutes()-v,k=x.getUTCDate()-u.getUTCDate();0!==k&&(w+=24*k*60);let S=new Date(Date.UTC(s,l-1,a,d,c,0));return S.setUTCMinutes(S.getUTCMinutes()-w),S.toISOString()}catch{return""}}function r(e){if(!e)return e;let t=e.includes("T")?e.slice(e.indexOf("T")):"",n=(e.includes("T")?e.slice(0,e.indexOf("T")):e).split("-");if(n.length<3)return e;let[r]=n,[,i,o]=n;r.length>4&&(r=`000${r.slice(-1)}`.slice(-4));let s=Math.min(Math.max(parseInt(i,10)||1,1),12),l=new Date(parseInt(r,10)||1,s,0
1).getDate(),a=Math.min(Math.max(parseInt(o,10)||1,1),l);return`${r}-${String(s).padStart(2,"0")}-${String(a).padStart(2,"0")}`+t}function i(e){let[t,n,r]=e.slice(0,10).split("-").map(Number);if(!t||!n||!r)return e;let i=new Date(t,n-1,r);return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(i)}e.s(["clampDateInputValue",()=>r,"formatDateInTimezone",()=>t,"formatDateOnly",()=>i,"localDatetimeToUTC",()=>n]),e.i(692326)},365520,e=>{"use strict";e.s(["resolveInlineVariablesFromData",()=>r]);var t=e.i(347802);let n=/<ycode-inline-variable>([\s\S]*?)<\/ycode-inline-variable>/g;function r(e,i,o,s="UTC",l){if(!e)return"";let a=(0,t.normalizeInlineVariableFormats)(e);return i||o?a.replace(n,(e,n)=>{try{let e=JSON.parse(n.trim());if("field"===e.type&&e.data?.field_id){let n=e.data.relationships||[],r=n.length>0?[e.data.field_id,...n].join("."):e.data.field_id,a=(0,t.resolveFieldFromSources)(r,e.data.source,i,o,e.data.collection_layer_id,l);return(0,t.formatFieldValue)(a,e.data.field_type,s,e.data.format)}}catch{}return e}):a.replace(n,"")}},885392,551080,e=>{"use strict";e.s(["LINK_NESTING_ERROR",()=>es,"addChildToLayerTree",()=>function e(t,n,r){return t.map(t=>t.id===n?{...t,children:[...t.children||[],r]}:t.children&&t.children.length>0?{...t,children:e(t.children,n,r)}:t)},"applyCustomAttributes",()=>m,"assignOrderClassToNewLayer",()=>ek,"canAddChild",()=>eo,"canConvertToCollection",()=>E,"canCopyLayer",()=>w,"canDeleteLayer",()=>k,"canHaveChildren",()=>ea,"canLayerHaveLink",()=>ei,"canMoveLayer",()=>C,"canPasteIntoParent",()=>el,"cleanLayersForComponentCreation",()=>eN,"collectAllSettingsIds",()=>R,"containsLayerId",()=>function e(t,n){return t.id===n||(t.children?.some(t=>e(t,n))??!1)},"createComponentViaApi",()=>eS,"evaluateVisibility",()=>ex,"extractBlockText",()=>function e(t){return t?"string"==typeof t?t:t.text?t.text:Array.isArray(t)?t.map(e).join(""):t.content?e(t.content):"":""},"filterDisabledSliderLayers",()=>function e(t,n){let r=n?.slider;return(r?t.filter(e=>("slideNavigationWrapper"!==e.name||!!r.navigation)&&("slidePaginationWrapper"!==e.name||!!r.pagination)):t).map(t=>{if(!t.children?.length)return t;let r="slider"===t.name?t.settings:n,i=e(t.children,r),o=r?.slider;if("slidePaginationWrapper"===t.name&&o){let e="fraction"===o.paginationType;i=i.filter(t=>("slideBullets"!==t.name||!e)&&("slideFraction"!==t.name||!!e))}return i===t.children?t:{...t,children:i}})},"findAddedLayerIds",()=>$,"findAllCollectionLayers",()=>ev,"findAllParentCollectionLayers",()=>L,"findAncestor",()=>S,"findAncestorByName",()=>T,"findLayerById",()=>I,"findLayerWithParent",()=>function e(t,n,r=null){for(let i of t){if(i.id===n)return{layer:i,parent:r};if(i.children){let t=e(i.children,n,i);if(t)return t}}return null},"findLayersWithAnchorId",()=>ej,"findParentAndIndex",()=>function e(t,n,r=null){for(let i=0;i<t.length;i++){if(t[i].id===n)return{parent:r,index:i};if(t[i].children&&t[i].children.length>0){let r=e(t[i].children,n,t[i]);if(r)return r}}return null},"findParentCollectionLayer",()=>z,"generateUniqueSettingsId",()=>P,"getClassesString",()=>ee,"getCollectionVariable",()=>_,"getLayerCmsFieldBinding",()=>eg,"getLayerHtmlTag",()=>em,"getLayerIndexes",()=>y,"getLayoutTypeForBreakpoint",()=>ep,"getLayoutTypeName",()=>eh,"getRichTextSublayers",()=>q,"getSiblingIds",()=>ec,"getText",()=>et,"getTextHeadingConversion",()=>B,"getTextStyleSublayers",()=>X,"hasRichTextContent",()=>J,"indexedFindLayerById",()=>b,"indexedFindLayerWithParent",()=>v,"indexedFindParentCollectionLayer",()=>x,"insertLayerAfter",()=>function e(t,n,r,i){if(null===n){let e=[...t];return e.splice(r+1,0,i),e}return t.map(t=>{if(t.id===n.id){let e=[...t.children||[]];return e.splice(r+1,0,i),{...t,children:e}}return t.children&&t.children.length>0?{...t,children:e(t.children,n,r,i)}:t})},"isExcludedFromCollection",()=>A,"isHeadingLayer",()=>Q,"isInputInsideFilter",()=>N,"isRichTextLayer",()=>V,"isTextContentLayer",()=>j,"isTextEditable",()=>F,"regenerateIdsWithInteractionRemapping",()=>eb,"regenerateInteractionIds",()=>ey,"removeLayerById",()=>function e(t,n){return t.filter(e=>e.id!==n).map(t=>t.children?{...t,children:e(t.children,n)}:t)},"removeRichTextSublayer",()=>Z,"reorderSiblings",()=>ed,"replaceLayerWithComponentInstance",()=>function e(t,n,r){return t.map(t=>{if(t.id===n){let{customName:e,...n}=t;return{...n,componentId:r,children:[]}}return t.children?{...t,children:e(t.children,n,r)}:t})},"resetBindingsAfterMove",()=>eO,"resetBindingsForDeletedCollection",()=>function e(t,n){return t.map(t=>{let r=t,i=!1,o=_(t);if(o?.id===n&&(r={...r,variables:{...r.variables,collection:{id:""}}},i=!0),r.variables){var s;let e=(s=r.variables,null);e&&(r={...r,variables:e},i=!0)}if(t.children&&t.children.length>0){let o=e(i?r.children||[]:t.children,n);o!==t.children&&(r={...r,children:o},i=!0)}return i?r:t})},"resetBindingsForDeletedField",()=>function e(t,n){return t.map(t=>{let r=t,i=!1;if(r.variables){let e=function(e,t){let n=!1,r={...e},i=e=>
1!!(e.data?.field_id===t||e.data?.relationships?.includes(t));if(r.image?.src&&"field"===r.image.src.type&&i(r.image.src)&&(r.image={...r.image,src:{type:"asset",data:{asset_id:null}}},n=!0),r.audio?.src&&"field"===r.audio.src.type&&i(r.audio.src)&&(r.audio={...r.audio,src:{type:"asset",data:{asset_id:null}}},n=!0),r.video?.src&&"field"===r.video.src.type&&i(r.video.src)&&(r.video={...r.video,src:void 0},n=!0),r.video?.poster&&"field"===r.video.poster.type&&i(r.video.poster)&&(r.video={...r.video,poster:void 0},n=!0),r.link?.field&&i(r.link.field)&&(r.link={...r.link,type:"url",field:void 0},n=!0),r.text){if("dynamic_text"===r.text.type&&"string"==typeof r.text.data?.content){let e=eL(r.text.data.content,t);null!==e&&(r.text={...r.text,data:{content:e}},n=!0)}if("dynamic_rich_text"===r.text.type&&"object"==typeof r.text.data?.content){let e=function(e,t){if(!e||"object"!=typeof e)return null;let n=!1;if(!e.content||!Array.isArray(e.content))return null;let r=e.content.map(e=>{if(!e.content||!Array.isArray(e.content))return e;let r=e.content.filter(e=>{if("dynamicVariable"===e.type&&e.attrs?.variable){let r=e.attrs.variable;if("field"===r.type&&r.data&&(r.data.field_id===t||r.data.relationships?.includes(t)))return n=!0,!1}return!0});return r.length!==e.content.length?{...e,content:r}:e});return n?{...e,content:r}:null}(r.text.data.content,t);null!==e&&(r.text={...r.text,data:{content:e}},n=!0)}}for(let e of["url","email","phone"]){let i=r.link?.[e];if(i?.type==="dynamic_text"&&"string"==typeof i.data?.content){let o=eL(i.data.content,t);null!==o&&(r.link={...r.link,[e]:{...i,data:{content:o}}},n=!0)}}if(r.image?.alt?.type==="dynamic_text"&&"string"==typeof r.image.alt.data?.content){let e=eL(r.image.alt.data.content,t);null!==e&&(r.image={...r.image,alt:{...r.image.alt,data:{content:e}}},n=!0)}if(r.design){let e=!1,i={...r.design};for(let n of["backgroundColor","color","borderColor","divideColor","outlineColor","textDecorationColor"]){let r=i[n];if(r){let o=function(e,t){let n=!1,r={...e};if(r.field?.type==="field"&&(r.field.data?.field_id===t||r.field.data?.relationships?.includes(t))&&(r.field=void 0,n=!0),r.linear?.stops){let e=r.linear.stops.map(e=>{if(e.field?.type==="field"&&(e.field.data?.field_id===t||e.field.data?.relationships?.includes(t))){n=!0;let{field:t,...r}=e;return r}return e});n&&(r.linear={...r.linear,stops:e})}if(r.radial?.stops){let e=!1,i=r.radial.stops.map(n=>{if(n.field?.type==="field"&&(n.field.data?.field_id===t||n.field.data?.relationships?.includes(t))){e=!0;let{field:t,...r}=n;return r}return n});e&&(r.radial={...r.radial,stops:i},n=!0)}return n?r:e}(r,t);o!==r&&(i[n]=o,e=!0)}}e&&(r.design=i,n=!0)}if(r.conditionalVisibility?.groups){let e=!1,i=r.conditionalVisibility.groups.map(n=>{let r=n.conditions.filter(n=>"collection_field"!==n.source||n.fieldId!==t||(e=!0,!1));return e?{...n,conditions:r}:n});e&&(r.conditionalVisibility={groups:i},n=!0)}if(r.collection?.filters?.groups){let e=!1,i=r.collection.filters.groups.map(n=>{let r=n.conditions.filter(n=>n.fieldId!==t||(e=!0,!1));return e?{...n,conditions:r}:n});e&&(r.collection={...r.collection,filters:{groups:i}},n=!0)}return n?r:null}(r.variables,n);e&&(r={...r,variables:e},i=!0)}if(t.children&&t.children.length>0){let o=e(i?r.children||[]:t.children,n);o!==t.children&&(r={...r,children:o},i=!0)}return i?r:t})},"resetBindingsOnCollectionSourceChange",()=>e$,"resolveFieldValue",()=>eu,"resolveFilterInputId",()=>D,"serializeLayers",()=>ew,"stripUIProperties",()=>function e(t){return t.map(t=>{let{open:n,...r}=t;return t.children&&t.children.length>0?{...r,children:e(t.children)}:r})},"updateLayerProps",()=>function e(t,n,r){return t.map(t=>t.id===n?{...t,...r}:t.children&&t.children.length>0?{...t,children:e(t.children,n,r)}:t)}],885392);var t=e.i(647163);e.i(365520);var n=e.i(49026),r=e.i(970190),i=e.i(13532),o=e.i(897742),s=e.i(347802),l=e.i(692326),a=e.i(965426),d=e.i(584424),c=e.i(271944),u=e.i(896126);e.i(271645);let p={class:"className",for:"htmlFor",autofocus:"autoFocus",crossorigin:"crossOrigin",charset:"charSet","http-equiv":"httpEquiv",tabindex:"tabIndex",nomodule:"noModule",referrerpolicy:"referrerPolicy",fetchpriority:"fetchPriority"},h=/<style[^>]*>([\s\S]*?)<\/style\s*>/gi;e.s(["HTML_TO_REACT_ATTRS",0,p,"extractStyleBlockContents",0,function(e){let t;if(!e)return"";let n=[];for(h.lastIndex=0;null!==(t=h.exec(e));){let e=t[1].trim();e&&n.push(e)}return n.join("\n")}],551080);let f=u.layerHasLink;function m(e,t){for(let[n,r]of Object.entries(t)){let t=p[n.toLowerCase()]||n;if("style"===t&&"string"==typeof r){let t="object"==typeof e.style&&e.style?e.style:{};e.style={...t,...function(e){let t={};for(let n of e.split(";")){let e=n.trim();if(!e)continue;let r=e.indexOf(":");if(-1===r)continue;let i=e.slice(0,r).trim(),o=e.slice(r+1).trim();
1i&&o&&(t[i.startsWith("--")?i:i.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())]=o)}return t}(r)};continue}e[t]=r}}let g=new WeakMap;function y(e){let t=g.get(e);if(!t){let n,r,i;n=new Map,r=new Map,(i=(e,t)=>{for(let o of e)n.set(o.id,o),t&&r.set(o.id,t),o.children&&i(o.children,o.id)})(e,null),t={layerMap:n,parentMap:r},g.set(e,t)}return t}function b(e,t){return e.layerMap.get(t)??null}function v(e,t){let n=e.layerMap.get(t);if(!n)return null;let r=e.parentMap.get(t);return{layer:n,parent:r?e.layerMap.get(r)??null:null}}function x(e,t){let n=e.parentMap.get(t);for(;n;){let t=e.layerMap.get(n);if(t&&_(t))return t;n=e.parentMap.get(n)}return null}function w(e){return e.restrictions?.copy!==!1}function k(e){return e.restrictions?.delete!==!1}function S(e,t,n){let r=new Map,i=new Map,o=(e,t=null)=>{for(let n of e)r.set(n.id,n),t&&i.set(n.id,t),n.children&&o(n.children,n.id)};if(o(e),!r.get(t))return null;let s=i.get(t);for(;s;){let e=r.get(s);if(e&&n(e))return e;s=i.get(s)}return null}function T(e,t,n){return S(e,t,e=>e.name===n)}function C(e,t,n){let r=I(e,t);if(!r)return!1;if(null!==n){let t=I(e,n);if(t&&!eo(t,r)||S(e,n,e=>(0,u.layerHasLink)(e))&&(0,u.hasLinkInTree)(r))return!1}if(!r.restrictions?.ancestor)return!0;let i=r.restrictions.ancestor,o=T(e,t,i);if(null===n)return!o;let s=I(e,n);if(!s)return!1;if(s.name===i)return!0;let l=T(e,n,i);return o?.id===l?.id}function _(e){return e.variables?.collection??null}let M=["body","form","filter","icon","htmlEmbed","lightbox","slider","slides","slideNavigationWrapper","slideButtonPrev","slideButtonNext","slidePaginationWrapper","slideBullets","slideFraction"];function A(e){return M.includes(e.name)}function E(e){return!(e.componentId||_(e)||A(e))&&ea(e)}let O=["input","select","textarea","checkbox","radio"];function N(e,t){let n=(t,r)=>{for(let i of t){if(i.id===e){if(O.includes(i.name))return r.some(e=>"filter"===e.name);if(r.some(e=>"filter"===e.name)){if(i.children?.some(e=>O.includes(e.name)))return!0;let e=r[r.length-1];if(e?.children?.some(e=>O.includes(e.name)))return!0}break}if(i.children&&n(i.children,[...r,i]))return!0}return!1};return n(t,[])}function D(e,t){let n=I(t,e);if(!n||O.includes(n.name))return e;if(n.children){let e=n.children.find(e=>O.includes(e.name));if(e)return e.id}let r=t=>{for(let n of t){if(n.children?.some(t=>t.id===e))return n;if(n.children){let e=r(n.children);if(e)return e}}return null},i=r(t);if(i?.children){let e=i.children.find(e=>O.includes(e.name));if(e)return e.id}return e}function I(e,t){for(let n of e){if(n.id===t)return n;if(n.children){let e=I(n.children,t);if(e)return e}}return null}function $(e,t){let n=function e(t,n=new Set){for(let r of t)n.add(r.id),r.children&&e(r.children,n);return n}(e),r=[],i=e=>{for(let t of e)n.has(t.id)||r.push(t.id),t.children&&i(t.children)};return i(t),r}function R(e){let t=new Set,n=e=>{for(let r of e)r.settings?.id&&t.add(r.settings.id),r.attributes?.id&&t.add(r.attributes.id),r.children&&n(r.children)};return n(e),t}function P(e,t){if(!t.has(e))return e;let n=2;for(;t.has(`${e}-${n}`);)n++;return`${e}-${n}`}function z(e,t){let n=(e,t,r=null)=>{for(let i of e){if(i.id===t)return{layer:i,parent:r};if(i.children){let e=n(i.children,t,i);if(e)return e}}return null},r=n(e,t);if(!r)return null;let i=r.parent;for(;i;){if(_(i))return i;let t=n(e,i.id);i=t?t.parent:null}return null}function L(e,t){let n=[],r=(e,t,n=null)=>{for(let i of e){if(i.id===t)return{layer:i,parent:n};if(i.children){let e=r(i.children,t,i);if(e)return e}}return null},i=r(e,t);if(!i)return n;let o=i.parent;for(;o;){_(o)&&n.push(o);let t=r(e,o.id);o=t?t.parent:null}return n}function F(e){return e.restrictions?.editText??!1}function j(e){return!!e&&("heading"===e.name||"text"===e.name)}let W=new Set(["Text","Heading"]);function B(e){if(!e)return null;let t=!!e.customName&&W.has(e.customName);if(Q(e))return{name:"text",settings:{...e.settings,tag:"p"},...t?{customName:void 0}:{}};if("text"===e.name){let n=e.settings?.tag;if(!n||"p"===n)return{name:"heading",settings:{...e.settings,tag:"h2"},...t?{customName:void 0}:{}}}return null}function V(e){return!!e&&"richText"===e.name}let H={paragraph:"paragraph",heading:"heading",bulletList:"listUnordered",orderedList:"listOrdered",blockquote:"quote",richTextComponent:"
1component",richTextImage:"image",horizontalRule:"separator",table:"table"};function U(e){let t={richTextLink:"link"},n=new Set;return!function e(r){r.marks&&Array.isArray(r.marks)&&r.marks.forEach(e=>{e.type&&n.add(t[e.type]||e.type)}),r.content&&Array.isArray(r.content)&&r.content.forEach(e)}(e),Array.from(n)}function J(e){if(!V(e))return!1;let t=e.variables?.text;if(t?.type!=="dynamic_rich_text")return!1;let n=t.data?.content;return!!n?.content&&!!Array.isArray(n.content)&&(!!(0,r.getCmsFieldBinding)(n)||n.content.some(e=>"paragraph"!==e.type||e.content?.length))}function q(e,t){var i;let o,s=e.variables?.text;if(s?.type!=="dynamic_rich_text")return[];let l=s.data?.content;return l?.content&&Array.isArray(l.content)?(0,r.getCmsFieldBinding)(l)?(i=e,o={...n.DEFAULT_TEXT_STYLES,...i.textStyles},K.map(e=>({type:e,label:o[e]?.label||e,icon:G[e]||H[e]||"box",kind:"style",styleKey:e}))):function(e,t){let r=new Set,i=[],o={...n.DEFAULT_TEXT_STYLES,...t.textStyles};for(let t of e.content.filter(e=>"paragraph"!==e.type||e.content?.length)){let e=function(e){switch(e.type){case"paragraph":return"paragraph";case"heading":return`h${e.attrs?.level||1}`;case"bulletList":return"bulletList";case"orderedList":return"orderedList";case"blockquote":return"blockquote";case"richTextImage":return"richTextImage";case"horizontalRule":return"horizontalRule";case"table":return"table";default:return null}}(t);if(e&&!r.has(e)&&(r.add(e),i.push({type:t.type,label:o[e]?.label||e,icon:G[e]||H[t.type]||"box",kind:"style",styleKey:e})),("bulletList"===t.type||"orderedList"===t.type)&&!r.has("listItem")&&t.content?.some(e=>"listItem"===e.type)&&(r.add("listItem"),i.push({type:"listItem",label:o.listItem?.label||"List Item",icon:G.listItem||"text",kind:"style",styleKey:"listItem"})),"table"===t.type&&Array.isArray(t.content)){for(let e of t.content)if("tableRow"===e.type&&(r.has("tableRow")||(r.add("tableRow"),i.push({type:"tableRow",label:o.tableRow?.label||"Table Row",icon:"table-row",kind:"style",styleKey:"tableRow"})),Array.isArray(e.content)))for(let t of e.content){let e="tableHeader"===t.type?"tableHeader":"tableCell";r.has(e)||(r.add(e),i.push({type:t.type,label:o[e]?.label||e,icon:"table-cell",kind:"style",styleKey:e}))}}}let s=U(e);return Y.filter(e=>s.includes(e)).forEach(e=>{i.push({type:e,label:o[e]?.label||e,icon:G[e]||"type",kind:"style",styleKey:e})}),i.sort((e,t)=>{let n=K.indexOf(e.styleKey),r=K.indexOf(t.styleKey);return(-1===n?999:n)-(-1===r?999:r)})}(l,e):[]}let K=["paragraph","h1","h2","h3","h4","h5","h6","link","bold","italic","underline","strike","superscript","subscript","bulletList","orderedList","listItem","blockquote","table","tableRow","tableHeader","tableCell","richTextImage","horizontalRule"],G={paragraph:"paragraph",h1:"heading",h2:"heading",h3:"heading",h4:"heading",h5:"heading",h6:"heading",bold:"bold",italic:"italic",underline:"underline",strike:"strikethrough",superscript:"superscript",subscript:"subscript",link:"link",bulletList:"listUnordered",orderedList:"listOrdered",listItem:"text",blockquote:"quote",richTextImage:"image",horizontalRule:"separator",table:"table",tableHeader:"table-cell",tableCell:"table-cell",tableRow:"table-row"},Y=["bold","italic","underline","strike","superscript","subscript","link"];function X(e){if(!j(e)&&!V(e))return[];let t=e.variables?.text,r=t?.type==="dynamic_rich_text"?t.data?.content:null,i=r?U(r):[],o={...n.DEFAULT_TEXT_STYLES,...e.textStyles};return Y.filter(e=>i.includes(e)).map(e=>({type:e,label:o[e]?.label||e,icon:G[e]||"type",kind:"style",styleKey:e}))}function Z(e,t){let n=e.variables?.text;if(n?.type!=="dynamic_rich_text")return null;let r=n.data?.content;if(!r?.content||!Array.isArray(r.content))return null;let i=[];r.content.forEach((e,t)=>{("paragraph"!==e.type||e.content?.length)&&i.push(t)});let o=i[t];if(void 0===o)return null;let s=[...r.content];return(s.splice(o,1),0===s.length)?null:{variables:{...e.variables,text:{...n,data:{...n.data,content:{...r,content:s}}}}}}function Q(e){return!!e&&("heading"===e.name||"text"===e.name&&["h1","h2","h3","h4","h5","h6"].includes(e.settings?.tag||""))}function ee(e){return Array.isArray(e.classes)?e.classes.join(" "):e.classes||""}function et(e){let t=e.variables?.text;if(t&&"dynamic_text"===t.type)return t.data.content}function en(e){return"body"===e.id?"Body":e.customName||e.name}let er=new Set(["htmlEmbed","map"]);function ei(e,t,n="layer"){if("layer"===n){if(er.has(e.name))return{canHaveLinks:!1,issue:{type:"unsupported"}};if((0,u.hasRichTextLinks)(e))return{canHaveLinks:!1,issue:{type:"richText"}};let n=S(t,e.id,e=>f(e));return n?{canHaveLinks:!1,issue:{type:"ancestor",layerName:en(n)}}:e.children&&e.children.length>0&&e.children.some(e=>(0,u.hasLinkInTree)(e))?{canHaveLinks:!1,issue:{type:"child"}}:{canHaveLinks:!0}}if(f(e))return{canHaveLinks:!1,issue:{type:"self",layerName:en(e)}};let r=S(t,e.id,e=>f(e));return r?{canHaveLinks:!1,issue:{type:"ancestor",layerName:en(r)}}:e.children&&e.children.length>0&&e.children.some(e=>(0,u.hasLinkInTree)(e))?{canHaveLinks:!1,issue:{type:"child"}}:{canHaveLinks:!0}}function eo(e,t){return!((0,u.layerHasLink)(e)&&(0,u.hasLinkInTree)(t)||(0,u.layerHasLink)(t)&&(0,u.layerHasLink)(e))}let es={title:"Links cannot be nested",description:"The pasted layer contains a link and cannot be placed inside a link."};function el(e,t,n){let r=I(e,t);return!r||!(!eo(r,n)||S(e,t,e=>(0,u.layerHasLink)(e))&&(0,u.hasLinkInTree)(n))}function ea(e,t){return!e.componentId&&("section"!==e.name||"section"!==t)&&!["icon","image","audio","video","iframe","heading","text","richText","span","label","hr","
1input","textarea","select","checkbox","radio","htmlEmbed","map"].includes(e.name??"")}function ed(e,t,n,r){if(t===n)return e;let i=(e,t,n=null)=>{for(let r=0;r<e.length;r++){if(e[r].id===t)return{parent:n,index:r};if(e[r].children){let n=i(e[r].children,t,e[r]);if(n)return n}}return null},o=i(e,t),s=i(e,n);if(!o||!s)return console.warn("[reorderSiblings] Could not find one or both layers"),e;let l=o.parent?.id??null;if(l!==(s.parent?.id??null))return console.warn("[reorderSiblings] Layers have different parents - cannot reorder"),e;let a=e=>({...e,children:e.children?e.children.map(a):void 0}),d=e.map(a),c=l?I(d,l):null,u=c?c.children:d;if(!u)return console.warn("[reorderSiblings] Parent has no children array"),e;let p=u.findIndex(e=>e.id===t),h=u.findIndex(e=>e.id===n);if(-1===p||-1===h)return console.warn("[reorderSiblings] Could not find indices in children array"),e;let[f]=u.splice(p,1),m=h;return m=Math.max(0,Math.min(m=p<h?"above"===r?h-1:h:"above"===r?h:h+1,u.length)),u.splice(m,0,f),d}function ec(e,t){let n=(e,t,r=null)=>{for(let i of e){if(i.id===t)return(r?.children??e).filter(e=>e.id!==t).map(e=>e.id);if(i.children){let e=n(i.children,t,i);if(e)return e}}return null};return n(e,t)??[]}function eu(e,t,n,r,i){let{field_id:o,source:l,collection_layer_id:a,relationships:d=[]}=e.data;if(!o)return;let c=d.length>0?[o,...d].join("."):o;return(0,s.resolveFieldFromSources)(c,l,t,n,a,r,i)}function ep(e,t="desktop"){let n=Array.isArray(e.classes)?e.classes:(e.classes||"").split(" ").filter(Boolean);if(0===n.length){let t=e.design?.layout;if(!t?.isActive)return null;let n=t.display,r=t.flexDirection;return"hidden"===n?"hidden":"grid"===n||"Grid"===n?"grid":"flex"===n||"Flex"===n?"column"===r||"column-reverse"===r?"rows":"columns":null}let{value:r}=(0,d.getInheritedValue)(n,"display",t),{value:i}=(0,d.getInheritedValue)(n,"flexDirection",t),o=r||"",s=i||"";return"hidden"===o?"hidden":"grid"===o?"grid":"flex"===o||"inline-flex"===o?"flex-col"===s||"flex-col-reverse"===s?"rows":"columns":null}function eh(e){switch(e){case"columns":return"Columns";case"rows":return"Rows";case"grid":return"Grid";case"hidden":return"Hidden";default:return null}}let ef={text:"p",heading:"h2",richText:"div",span:"span",label:"label",image:"img",icon:"span",video:"video",audio:"audio",table:"table",thead:"thead",tbody:"tbody",tr:"tr",td:"td",th:"th",htmlEmbed:"div",map:"div",slider:"div",slides:"div",slide:"div",slideNavigationWrapper:"div",slideButtonPrev:"div",slideButtonNext:"div",slidePaginationWrapper:"div",slideBullets:"div",slideBullet:"div",slideFraction:"div",lightbox:"div",localeSelector:"div",filter:"div",checkbox:"input",radio:"input"};function em(e){return"body"===e.id||"body"===e.name?"div":e.settings?.tag?e.settings.tag:ef[e.name]||e.name||"div"}function eg(e){let t=e.variables;if(!t)return null;let n=e=>e&&"object"==typeof e&&"field"===e.type&&e.data?.field_id?{field_id:e.data.field_id,source:e.data.source,collection_layer_id:e.data.collection_layer_id}:null;for(let e of[t.image?.src,t.audio?.src,t.video?.src,t.video?.poster,t.backgroundImage?.src,t.link?.field]){let t=n(e);if(t)return t}if(t.text?.type==="dynamic_rich_text"){let e=(0,r.getCmsFieldBinding)(t.text.data.content);if(e)return e}if(t.text?.type==="dynamic_text"){let e=t.text.data.content.match(/<ycode-inline-variable>([\s\S]*?)<\/ycode-inline-variable>/);if(e)try{let t=JSON.parse(e[1]),r=n(t);if(r)return r}catch{}}if(t.design){for(let e of Object.values(t.design))if(e&&"object"==typeof e&&"field"in e){let t=n(e.field);if(t)return t}}return null}function ey(e,n){return e&&0!==e.length?e.map(e=>({...e,id:(0,t.generateId)("int"),tweens:e.tweens.map(e=>({...e,id:(0,t.generateId)("twn"),layer_id:n?.has(e.layer_id)?n.get(e.layer_id):e.layer_id}))})):e}function eb(e){let n=new Map,r=e=>{let i=(0,t.generateId)("lyr");return n.set(e.id,i),{...e,id:i,children:e.children?.map(r)}},i=r(e),o=e=>{let t=e;return e.interactions&&e.interactions.length>0&&(t={...t,interactions:ey(e.interactions,n)}),t.children&&(t={...t,children:t.children.map(o)}),t};return o(i)}function ev(e,t=!0){let n=[],r=(e,i=!1)=>{for(let o of e){let e=_(o);e?(t&&i||n.push({layerId:o.id,layerName:o.customName||"Collection",collectionId:e.id}),o.children&&r(o.children,!0)):o.children&&r(o.children,i)}};return r(e),n}function ex(e,t){if(!e||!e.groups||0===e.groups.length)return!0;for(let n of e.groups){if(!n.conditions||0===n.conditions.length)continue;let e=!1;
1for(let r of n.conditions)if(function(e,t){let{collectionLayerData:n,pageCollectionData:r,pageCollectionCounts:i,currentItemId:o,pageCollectionItemId:d}=t,c=t.timezone||"UTC";if("self"===e.source){if(!o)return!0;let t=new Set;for(let n of(0,l.parseItemIdList)(e.value))t.add(n);e.includesCurrentPageItem&&d&&t.add(d);let n=t.has(o);return"is_not_one_of"===e.operator?!n:n}if("page_collection"===e.source){let t=i?.[e.collectionLayerId||""]??0;switch(e.operator){case"has_items":return t>0;case"has_no_items":return 0===t;case"item_count":{let n=e.compareValue??0;switch(e.compareOperator??"eq"){case"eq":default:return t===n;case"lt":return t<n;case"lte":return t<=n;case"gt":return t>n;case"gte":return t>=n}}default:return!0}}if("collection_field"===e.source){let t=e.fieldId;if(!t)return!0;let i=(0,s.resolveFieldFromSources)(t,void 0,n,r),o=Array.isArray(i)?JSON.stringify(i):String(i??""),u=e.fieldType||"text",p="date_only"===u,h=String(e.value??"");if("current_page"===e.valueMode){let t="reference"===u||"multi_reference"===u||["is_one_of","is_not_one_of","contains_all_of","contains_exactly"].includes(e.operator);if(t&&!d||!t&&!r)return!0;if(t){let t=(0,l.parseItemIdList)(e.value);d&&!t.includes(d)&&t.push(d),h=JSON.stringify(t)}else e.currentPageFieldId&&(h=String(r?.[e.currentPageFieldId]??""))}let f=e.value2,m=e.operator;if("current_page"===e.valueMode&&"contains_exactly"===m&&(m="contains_all_of"),(0,l.isDateFieldType)(u)&&(0,l.isDatePreset)(h)){let e=(0,l.resolveDateFilterValue)(m,h,f,c);e&&(m=e.operator,h=e.value,f=e.value2)}let g=null!=i&&""!==i;switch(m){case"is":if("boolean"===u)return(0,a.normalizeBooleanValue)(o)===(0,a.normalizeBooleanValue)(h);if("number"===u)return parseFloat(o)===parseFloat(h);if((0,l.isDateFieldType)(u))return(0,l.compareDateFilter)(o,"is",h,void 0,c,p);return o===h;case"is_not":if("boolean"===u)return(0,a.normalizeBooleanValue)(o)!==(0,a.normalizeBooleanValue)(h);if("number"===u)return parseFloat(o)!==parseFloat(h);if((0,l.isDateFieldType)(u))return!(0,l.compareDateFilter)(o,"is",h,void 0,c,p);return o!==h;case"contains":return o.toLowerCase().includes(h.toLowerCase());case"does_not_contain":return!o.toLowerCase().includes(h.toLowerCase());case"is_present":case"is_not_empty":case"exists":return g;case"is_empty":case"does_not_exist":return!g;case"lt":return parseFloat(o)<parseFloat(h);case"lte":return parseFloat(o)<=parseFloat(h);case"gt":return parseFloat(o)>parseFloat(h);case"gte":return parseFloat(o)>=parseFloat(h);case"is_before":return(0,l.compareDateFilter)(o,"is_before",h,void 0,c,p);case"is_after":return(0,l.compareDateFilter)(o,"is_after",h,void 0,c,p);case"is_between":return(0,l.compareDateFilter)(o,"is_between",h,f,c,p);case"is_one_of":try{let e=JSON.parse(h||"[]");if(!Array.isArray(e))return!1;let t=(0,a.parseMultiReferenceValue)(o);if(t.length>0)return t.some(t=>e.includes(t));return e.includes(o)}catch{return!1}case"is_not_one_of":try{let e=JSON.parse(h||"[]");if(!Array.isArray(e))return!0;let t=(0,a.parseMultiReferenceValue)(o);if(t.length>0)return!t.some(t=>e.includes(t));return!e.includes(o)}catch{break}case"contains_all_of":try{let e=JSON.parse(h||"[]");if(!Array.isArray(e))return!1;let t=(0,a.parseMultiReferenceValue)(o);return e.every(e=>t.includes(e))}catch{return!1}case"contains_exactly":try{let e=JSON.parse(h||"[]");if(!Array.isArray(e))return!1;let t=(0,a.parseMultiReferenceValue)(o);return e.length===t.length&&e.every(e=>t.includes(e))}catch{return!1}case"has_items":if("collection_field"===e.source)return(0,a.parseMultiReferenceValue)(o).length>0||g;break;case"has_no_items":if("collection_field"===e.source){let e=(0,a.parseMultiReferenceValue)(o);if(Array.isArray(o)||"string"==typeof o&&o.startsWith("["))return 0===e.length;return!g}break;case"item_count":if("collection_field"===e.source&&"multi_reference"===e.fieldType){let t=0;try{let e=JSON.parse(o||"[]");t=Array.isArray(e)?e.length:0}catch{t=0}let n=e.compareValue??0;switch(e.compareOperator??"eq"){case"eq":default:return t===n;case"lt":return t<n;case"lte":return t<=n;case"gt":return t>n;case"gte":return t>=n}}}}return!0}(r,t)){e=!0;break}if(!e)return!1}return!0}function ew(e,t=[],n){let r=function e(t,n={},r=null){return t.forEach(t=>{let i=t.componentId?t.id:r;i&&(n[t.id]=i),t.children&&t.children.length>0&&e(t.children,n,i)}),n}(e);return{layers:JSON.parse(JSON.stringify(function e(t,n,r,s,l){let a=r?.length?(0,i.applyComponentOverrides)(t,s,r):t,d=l??new Set;return a.map(t=>
1{if(t.componentId){if(d.has(t.componentId))return console.warn("[resolveComponentsInLayers] Circular component reference detected, skipping:",t.componentId),{...t,children:[]};let r=n.find(e=>e.id===t.componentId),s=r?(0,o.getComponentVariantLayers)(r,t.componentVariantId):[];if(r&&s.length>0){var l,a,c,u;let o,p,h,f=new Set(d);f.add(t.componentId);let m=s[0],g=e(m.children?(l=m.children,a=t.id,c=m.id,o=new Map,c&&c!==a&&o.set(c,a),(p=e=>{for(let t of e){let e=`${a}_${t.id}`;o.set(t.id,e),t.children&&p(t.children)}})(l),h=e=>{let t=o.get(e.id)||e.id,n={...e,id:t,_originalLayerId:e._originalLayerId||e.id};return e.interactions&&e.interactions.length>0&&(n.interactions=e.interactions.map(e=>({...e,id:`${a}_${e.id}`,tweens:e.tweens.map(e=>({...e,layer_id:o.get(e.layer_id)||e.layer_id}))}))),e.children&&e.children.length>0&&(n.children=e.children.map(h)),n},l.map(h)):[],n,r.variables,t.componentOverrides,f),y=new Map;if(m.id!==t.id&&y.set(m.id,t.id),m.children){let e=n=>{for(let r of n)y.set(r.id,`${t.id}_${r.id}`),r.children&&e(r.children)};e(m.children)}let b=y.size>0?(u=m.interactions,u?u.map(e=>({...e,tweens:e.tweens.map(e=>({...e,layer_id:y.get(e.layer_id)||e.layer_id}))})):u):m.interactions,v=(0,i.applyComponentOverrides)(g,t.componentOverrides,r.variables).map(e=>(function e(t,n){return{...t,_masterComponentId:n,children:t.children?t.children.map(t=>e(t,n)):t.children}})(e,r.id));return{...t,...m,id:t.id,componentId:t.componentId,componentOverrides:t.componentOverrides,interactions:b,children:v,_masterComponentId:r.id,_originalLayerId:m.id}}}return t.children&&t.children.length>0?{...t,children:e(t.children,n,r,s,d)}:t})}(e,t,n))),componentMap:r}}function ek(e,t,n,r){let i=[{name:"tablet",prefix:"max-lg:"},{name:"mobile",prefix:"max-md:"}],o=e=>e?Array.isArray(e)?e.join(" "):e:"",s=(e,t)=>{let n=o(e);return RegExp(`${t.replace(":","\\:")}order-\\d+`).test(n)},l=(e,t)=>{let n=o(e),r=RegExp(`${t.replace(":","\\:")}order-(\\d+)`),i=n.match(r);return i?parseInt(i[1],10):null};return function e(r){return r.map(r=>{if(r.id===t&&r.children&&r.children.length>0){let e=r.children.filter(e=>e.id!==n);if(!r.children.find(e=>e.id===n))return r;let t=[];for(let n of i)if(e.some(e=>s(e.classes,n.prefix))){let r=-1;e.forEach(e=>{let t=l(e.classes,n.prefix);null!==t&&t>r&&(r=t)});let i=r+1;t.push(`${n.prefix}order-${i}`)}if(0===t.length)return r;let a=r.children.map(e=>{if(e.id===n){let n=o(e.classes),r=t.join(" ");return{...e,classes:n?`${n} ${r}`:r}}return e});return{...r,children:a}}return r.children?{...r,children:e(r.children)}:r})}(e)}async function eS(e,t){try{let n=await fetch("/ycode/api/components",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,layers:t.map(e=>(0,c.default)(e))})});if(!n.ok){let e=await n.text(),t=`HTTP ${n.status}: ${n.statusText}`;try{t=JSON.parse(e).error||t}catch{t=e||t}return console.error("Failed to create component:",t),null}let r=await n.json();if(r.error||!r.data)return console.error("Failed to create component:",r.error),null;return r.data}catch(e){return console.error("Failed to create component:",e),null}}let eT=/<ycode-inline-variable>([\s\S]*?)<\/ycode-inline-variable>/g;function eC(e,t){let n=new Map;for(let r of L(e,t)){let e=_(r);e?.id&&n.set(r.id,e.id)}return n}function e_(e){return e.data?.source==="collection"||!!e.data?.collection_layer_id}function eM(e,t){return!e_(e)||(e.data?.collection_layer_id?t.has(e.data.collection_layer_id):t.size>0)}function eA(e,t){if(!e)return null;let n=!1,r=e.replace(eT,(e,r)=>{try{let e=JSON.parse(r.trim());if("field"===e.type&&e.data&&e_(e)&&!eM(e,t))return n=!0,""}catch{}return e});return n?r:null}function eE(e,t,n){return t.map(t=>{let r=n?new Map(n):eC(e,t.id),i=_(t),o=new Map(r);i?.id&&o.set(t.id,i.id);let s=function(e,t){if(!e)return null;let n=!1,r={...e};if(r.conditionalVisibility?.groups){let e=r.conditionalVisibility.groups.map(e=>{let r=e.conditions.filter(e=>"page_collection"!==e.source||!e.collectionLayerId||t.has(e.collectionLayerId));return r.length!==e.conditions.length?(n=!0,{...e,conditions:r}):e});n&&(r.conditionalVisibility={groups:e})}if(r.text){if("dynamic_text"===r.text.type&&"string"==typeof r.text.data?.content){let e=eA(r.text.data.content,t);null!==e&&(r.text={...r.text,data:{content:e}},n=!0)}if("dynamic_rich_text"===r.text.type&&"object"==typeof r.text.data?.content){let e=function(e,t){if(!e||"object"!=typeof e)return null;let n=!1;if(!e.content||!Array.isArray(e.content))return null;let r=e.content.map(e=>{if(!e.content||!Array.isArray(e.content))return e;let r=e.content.filter(e=>{if("dynamicVariable"===e.type&&e.attrs?.variable){let r=e.attrs.variable;if("field"===r.type&&e_(r)&&!eM(r,t))return n=!0,!1}return!0});return r.length!==e.content.length?{...e,content:r}:e});return n?{...e,content:r}:null}(r.text.data.content,t);null!==e&&(r.text={...r.text,data:{content:e}},n=!0)}}if(r.image){let e=r.image.src;if(e&&"field"===e.type&&e_(e)&&!eM(e,t)&&(r.image={...r.image,src:{type:"asset",data:{asset_id:null}}},n=!0),r.image.alt?.type==="dynamic_text"&&"string"==typeof r.image.alt.data?.content){let e=eA(r.image.alt.data.content,t);null!==e&&(r.image={...r.image,alt:{...r.image.alt,data:{content:e}}},n=!0)}}if(r.audio?.src){let e=r.audio.src;"field"===e.type&&e_(e)&&!eM(e,t)&&(r.audio={...r.audio,src:{type:"asset",data:{asset_id:null}}},n=!0)}if(r.video?.src){let e=r.video.src;"field"===e.type&&e_(e)&&!eM(e,t)&&(r.video={...r.video,src:void 0},n=!0)}if(r.video?.poster){let e=r.video.poster;"field"===e.type&&e_(e)&&!eM(e,t)&&(r.video={...r.video,poster:void 0},n=!0)}if(r.iframe?.src?.type==="dynamic_text"&&"string"==typeof r.iframe.
1src.data?.content){let e=eA(r.iframe.src.data.content,t);null!==e&&(r.iframe={...r.iframe,src:{...r.iframe.src,data:{content:e}}},n=!0)}if(r.link){if(r.link.url?.type==="dynamic_text"&&"string"==typeof r.link.url.data?.content){let e=eA(r.link.url.data.content,t);null!==e&&(r.link={...r.link,url:{...r.link.url,data:{content:e}}},n=!0)}if(r.link.field&&e_(r.link.field)&&!eM(r.link.field,t)&&(r.link={...r.link,type:"url",field:void 0},n=!0),r.link.email?.type==="dynamic_text"&&"string"==typeof r.link.email.data?.content){let e=eA(r.link.email.data.content,t);null!==e&&(r.link={...r.link,email:{...r.link.email,data:{content:e}}},n=!0)}if(r.link.phone?.type==="dynamic_text"&&"string"==typeof r.link.phone.data?.content){let e=eA(r.link.phone.data.content,t);null!==e&&(r.link={...r.link,phone:{...r.link.phone,data:{content:e}}},n=!0)}}if(r.design){let e=!1,i={...r.design};for(let n of["backgroundColor","color","borderColor","divideColor","outlineColor","textDecorationColor"]){let r=i[n];if(r){let o=function(e,t){let n=!1,r={...e};if(r.field&&e_(r.field)&&!eM(r.field,t)&&(r.field=void 0,n=!0),r.linear?.stops){let e=r.linear.stops.map(e=>{if(e.field&&e_(e.field)&&!eM(e.field,t)){n=!0;let{field:t,...r}=e;return r}return e});n&&(r.linear={...r.linear,stops:e})}if(r.radial?.stops){let e=!1,i=r.radial.stops.map(n=>{if(n.field&&e_(n.field)&&!eM(n.field,t)){e=!0;let{field:t,...r}=n;return r}return n});e&&(r.radial={...r.radial,stops:i},n=!0)}return n?r:e}(r,t);o!==r&&(i[n]=o,e=!0)}}e&&(r.design=i,n=!0)}return n?r:null}(t.variables,r),l=t.children;return(t.children&&t.children.length>0&&(l=eE(e,t.children,o)),s||l!==t.children)?{...t,variables:s||t.variables,children:l}:t})}function eO(e,t){let n=I(e,t);if(!n)return e;let r=eC(e,t),i=eE(e,[n],r)[0];return i===n?e:eF(e,t,i)}function eN(e){let t=function e(t){return t.map(t=>{let n=!1,r=t;if(r.variables){let e=function(e){let t=!1,n={...e};if(n.collection?.source_field_source==="page"&&(n.collection={id:"",source_field_id:void 0,source_field_type:void 0,source_field_source:void 0},t=!0),n.conditionalVisibility?.groups){let e=!1,r=n.conditionalVisibility.groups.map(t=>{let n=t.conditions.filter(t=>"page_collection"!==t.source||(e=!0,!1));return n.length!==t.conditions.length?{...t,conditions:n}:t});e&&(n.conditionalVisibility={groups:r},t=!0)}if(n.text){if("dynamic_text"===n.text.type&&"string"==typeof n.text.data?.content){let e=eI(n.text.data.content);null!==e&&(n.text={...n.text,data:{content:e}},t=!0)}if("dynamic_rich_text"===n.text.type&&"object"==typeof n.text.data?.content){let e=function(e){if(!e||"object"!=typeof e||!e.content||!Array.isArray(e.content))return null;let t=!1,n=e.content.map(e=>{if(!e.content||!Array.isArray(e.content))return e;let n=e.content.filter(e=>{if("dynamicVariable"===e.type&&e.attrs?.variable){let n=e.attrs.variable;if("field"===n.type&&eD(n))return t=!0,!1}return!0});return n.length!==e.content.length?{...e,content:n}:e});return t?{...e,content:n}:null}(n.text.data.content);null!==e&&(n.text={...n.text,data:{content:e}},t=!0)}}if(n.image?.src&&"field"===n.image.src.type&&eD(n.image.src)&&(n.image={...n.image,src:{type:"asset",data:{asset_id:null}}},t=!0),n.image?.alt?.type==="dynamic_text"&&"string"==typeof n.image.alt.data?.content){let e=eI(n.image.alt.data.content);null!==e&&(n.image={...n.image,alt:{...n.image.alt,data:{content:e}}},t=!0)}if(n.audio?.src?.type==="field"&&eD(n.audio.src)&&(n.audio={...n.audio,src:{type:"asset",data:{asset_id:null}}},t=!0),n.video?.src?.type==="field"&&eD(n.video.src)&&(n.video={...n.video,src:void 0},t=!0),n.video?.poster?.type==="field"&&eD(n.video.poster)&&(n.video={...n.video,poster:void 0},t=!0),n.iframe?.src?.type==="dynamic_text"&&"string"==typeof n.iframe.src.data?.content){let e=eI(n.iframe.src.data.content);null!==e&&(n.iframe={...n.iframe,src:{...n.iframe.src,data:{content:e}}},t=!0)}if(n.link){let e=!1,r={...n.link};if(r.field&&eD(r.field)&&(r.type="url",r.field=void 0,e=!0),r.url?.type==="dynamic_text"&&"string"==typeof r.url.data?.content){let t=eI(r.url.data.content);null!==t&&(r.url={...r.url,data:{content:t}},e=!0)}if(r.email?.type==="dynamic_text"&&"string"==typeof r.email.data?.content){let t=eI(r.email.data.content);null!==t&&(r.email={...r.email,data:{content:t}},e=!0)}
1if(r.phone?.type==="dynamic_text"&&"string"==typeof r.phone.data?.content){let t=eI(r.phone.data.content);null!==t&&(r.phone={...r.phone,data:{content:t}},e=!0)}e&&(n.link=r,t=!0)}if(n.design){let e=!1,r={...n.design};for(let t of["backgroundColor","color","borderColor","divideColor","outlineColor","textDecorationColor"]){let n=r[t];if(n){let i=function(e){let t=!1,n={...e};if(n.field&&eD(n.field)&&(n.field=void 0,t=!0),n.linear?.stops){let e=n.linear.stops.map(e=>{if(e.field&&eD(e.field)){t=!0;let{field:n,...r}=e;return r}return e});t&&(n.linear={...n.linear,stops:e})}if(n.radial?.stops){let e=!1,r=n.radial.stops.map(t=>{if(t.field&&eD(t.field)){e=!0;let{field:n,...r}=t;return r}return t});e&&(n.radial={...n.radial,stops:r},t=!0)}return t?n:e}(n);i!==n&&(r[t]=i,e=!0)}}e&&(n.design=r,t=!0)}return t?n:null}(r.variables);e&&(r={...r,variables:e},n=!0)}if(t.children&&t.children.length>0){let i=e(n?r.children||[]:t.children);i!==t.children&&(r={...r,children:i},n=!0)}return n?r:t})}(e);return eE(t=function e(t,n){return t.map(t=>{let r=!1,i=t,o=_(t);if(o?.source_field_id&&"collection"===o.source_field_source&&0===L(n,t.id).length&&(i={...i,variables:{...i.variables,collection:{id:"",source_field_id:void 0,source_field_type:void 0,source_field_source:void 0}}},r=!0),t.children&&t.children.length>0){let o=e(r?i.children||[]:t.children,n);o!==t.children&&(i={...i,children:o},r=!0)}return r?i:t})}(t,t),t,new Map)}function eD(e){return e.data?.source==="page"}function eI(e){if(!e)return null;let t=!1,n=e.replace(eT,(e,n)=>{try{let e=JSON.parse(n.trim());if("field"===e.type&&eD(e))return t=!0,""}catch{}return e});return t?n:null}function e$(e,t){let n=I(e,t);if(!n)return e;let r=eR(n),i=r!==n;if(r.children&&r.children.length>0){let e=function e(t,n){let r=!1,i=t.map(t=>{let i=!1,o=t,s=_(t);if(s?.source_field_id){if(o={...o,variables:{...o.variables,collection:{id:"",source_field_id:void 0,source_field_type:void 0,source_field_source:void 0}}},i=!0,(o=eR(o)).children&&o.children.length>0){let n=e(o.children,t.id);n!==o.children&&(o={...o,children:n})}return r=!0,o}if(o.variables){let e=function(e,t){let n=!1,r={...e};if(r.conditionalVisibility?.groups){let e=!1,i=r.conditionalVisibility.groups.map(n=>{let r=n.conditions.filter(n=>"page_collection"!==n.source||n.collectionLayerId!==t||(e=!0,!1));return e?{...n,conditions:r}:n});e&&(r.conditionalVisibility={groups:i},n=!0)}if(r.text){if("dynamic_text"===r.text.type&&"string"==typeof r.text.data?.content){let e=ez(r.text.data.content,t);null!==e&&(r.text={...r.text,data:{content:e}},n=!0)}if("dynamic_rich_text"===r.text.type&&"object"==typeof r.text.data?.content){let e=function(e,t){if(!e||"object"!=typeof e||!e.content||!Array.isArray(e.content))return null;let n=!1,r=e.content.map(e=>{if(!e.content||!Array.isArray(e.content))return e;let r=e.content.filter(e=>{if("dynamicVariable"===e.type&&e.attrs?.variable){let r=e.attrs.variable;if("field"===r.type&&eP(r,t))return n=!0,!1}return!0});return r.length!==e.content.length?{...e,content:r}:e});return n?{...e,content:r}:null}(r.text.data.content,t);null!==e&&(r.text={...r.text,data:{content:e}},n=!0)}}if(r.image&&(r.image.src?.type==="field"&&eP(r.image.src,t)&&(r.image={...r.image,src:{type:"asset",data:{asset_id:null}}},n=!0),r.image.alt?.type==="dynamic_text"&&"string"==typeof r.image.alt.data?.content)){let e=ez(r.image.alt.data.content,t);null!==e&&(r.image={...r.image,alt:{...r.image.alt,data:{content:e}}},n=!0)}if(r.audio?.src?.type==="field"&&eP(r.audio.src,t)&&(r.audio={...r.audio,src:{type:"asset",data:{asset_id:null}}},n=!0),r.video?.src?.type==="field"&&eP(r.video.src,t)&&(r.video={...r.video,src:void 0},n=!0),r.video?.poster?.type==="field"&&eP(r.video.poster,t)&&(r.video={...r.video,poster:void 0},n=!0),r.iframe?.src?.type==="dynamic_text"&&"string"==typeof r.iframe.src.data?.content){let e=ez(r.iframe.src.data.content,t);null!==e&&(r.iframe={...r.iframe,src:{...r.iframe.src,data:{content:e}}},n=!0)}if(r.link){r.link.field&&eP(r.link.field,t)&&(r.link={...r.link,type:"url",field:void 0},n=!0);let e=r.link;for(let i of["url","email","phone"]){let o=e[i];if(o?.type==="dynamic_text"&&"string"==typeof o.data?.content){let e=ez(o.data.content,t);null!==e&&(r.link={...r.link,[i]:{...o,data:{content:e}}},n=!0)}}}if(r.design){let e=!1,i={...r.design};for(let n of["backgroundColor","color","borderColor","divideColor","outlineColor","textDecorationColor"]){let r=i[n];if(r){let o=function(e,t){let n=!1,r={...e};if(r.field?.type==="field"&&eP(r.field,t)&&(r.field=void 0,n=!0),r.linear?.stops){let e=r.linear.stops.map(e=>{if(e.field?.type==="field"&&eP(e.field,t)){n=!0;let{field:t,...r}=e;return r}return e});n&&(r.linear={...r.linear,stops:e})}if(r.radial?.stops){let e=!1,i=r.radial.stops.map(n=>{if(n.field?.type==="field"&&eP(n.field,t)){e=!0;let{field:t,...r}=n;return r}return n});e&&(r.radial={...r.radial,stops:i},n=!0)}return n?r:e}(r,t);o!==r&&(i[n]=o,e=!0)}}e&&(r.design=i,n=!0)}return n?r:null}(o.variables,n);e&&(o={...o,variables:e},i=!0)}if(t.children&&t.children.length>0){let r=e(i?o.children||[]:t.children,n);r!==t.children&&(o={...o,children:r},i=!0)}return i&&(r=!0),i?o:t});return r?i:t}(r.children,t);e!==r.children&&(r={...r,children:e},i=!0)}return i?eF(e,t,r):e}function eR(e){let t=e;if(t.variables?.collection){let e=t.variables.collection,n=e.filters?.groups?.length,r=e.sort_by&&"none"!==e.sort_by&&"manual"!==e.sort_by&&"random"!==e.sort_by;(n||r)&&(t={...t,variables:{...t.variables,collection:{...e,filters:void 0,sort_by:void 0,sort_order:void 0}}})}if(t.variables?.conditionalVisibility?.groups){let e=!1,n=t.variables.conditionalVisibility.groups.map(t=>{let n=t.conditions.filter(t=>"collection_field"!==t.source||(e=!0,!1));return e?{...t,conditions:n}:t});e&&(t={...t,variables:{...t.variables,conditionalVisibility:{groups:n}}})}return t}function eP(e,t){return!!e_(e)&&!(e.data?.collection_layer_id!==t&&(e.data?.source!=="collection"||e.data?.collection_layer_id))}function ez(e,t){if(!e)return null;let n=!1,r=e.replace(eT,(e,r)=>{try{let e=JSON.parse(r.trim());if("field"===e.type&&e.data&&eP(e,t))return n=!0,""}catch{}return e});return n?r:null}function eL(e,t){if(!e)return null;let n=!1,r=e.replace(eT,(e,r)=>{try{let e=JSON.parse(r.trim());if("field"===e.type&&e.data&&(e.data.field_id===t||e.data.relationships?.includes(t)))return n=!0,""}catch{}return e});return n?r:null}function eF(e,t,n){return e.map(e=>{if(e.id===t)return n;if(e.children){let r=eF(e.children,t,n);if(r!==e.children)return{...e,children:r}}return e})}function ej(e){let t=[],n=new Set,r=[...e];for(;r.length>0;){let e=r.pop(),i=e.settings?.id||e.attributes?.id;i&&!n.has(i)&&(n.add(i),t.push({layer:e,id:i})),e.children&&r.push(...e.children)}return t}},896126,e=>{"use strict";e.s(["COLLECTION_ITEM_KEYWORDS",()=>l,"extractCrossCollectionItemIds",()=>p,"generateLinkHref",()=>f,"hasLinkInTree",()=>function e(t){return!!(o(t)||s(t))||!!t.children&&t.children.some(t=>e(t))},"hasRichTextLinks",()=>s,"isLinkAtCollectionBoundary",()=>b,"isLinkToCurrentPage",()=>g,"isValidLinkSettings",()=>i,"layerHasLink",()=>o,"parseCollectionLinkValue",()=>
1u,"resolveCollectionLinkValue",()=>h,"resolveLinkAttrs",()=>y]);var t=e.i(963545),n=e.i(692326),r=e.i(365520);function i(e){if(!e||!e.type)return!1;switch(e.type){case"url":return!!e.url?.data?.content;case"email":return!!e.email?.data?.content;case"phone":return!!e.phone?.data?.content;case"asset":return!!e.asset?.id;case"page":return!!e.page?.id;case"field":return!!e.field?.data?.field_id;default:return!1}}function o(e){return!!(e.variables?.link&&e.variables.link.type)}function s(e){let t=e.variables?.text;if(!t||"dynamic_rich_text"!==t.type)return!1;let n=t.data?.content;if(!n||"object"!=typeof n)return!1;let r=e=>!!(e.marks&&Array.isArray(e.marks)&&e.marks.some(e=>"richTextLink"===e.type))||!!(e.content&&Array.isArray(e.content))&&e.content.some(e=>r(e));return r(n)}let l={CURRENT_PAGE:"current-page",CURRENT_COLLECTION:"current-collection",NEXT_ITEM:"next-item",PREVIOUS_ITEM:"previous-item"},a=new Set(Object.values(l));function d(e){return!!e&&a.has(e)}function c(e,t,r){if(e.startsWith(n.REF_PAGE_PREFIX)){let r=e.slice(n.REF_PAGE_PREFIX.length);return t?.[r]}if(e.startsWith(n.REF_COLLECTION_PREFIX)){let t=e.slice(n.REF_COLLECTION_PREFIX.length);return r?.[t]}}function u(e){if(!e)return null;if("object"==typeof e&&"type"in e)return"url"===e.type||"page"===e.type||"asset"===e.type?e:null;if("string"==typeof e){if(!e.startsWith("{"))return null;try{let t=JSON.parse(e);if(t&&"object"==typeof t&&"type"in t&&("url"===t.type||"page"===t.type||"asset"===t.type))return t}catch{}}return null}function p(e,t,r){let i=new Set;for(let o of e)for(let e of t){let t=o.values[e];if(!t)continue;let s=u(t);if(s?.type!=="page"||!s.page?.collection_item_id)continue;let l=s.page.collection_item_id;!(d(l)||l.startsWith(n.REF_PAGE_PREFIX)||l.startsWith(n.REF_COLLECTION_PREFIX))&&(r?.[l]||i.add(l))}return Array.from(i)}function h(e,n){let{pages:r,folders:i,collectionItemSlugs:o,isPreview:s,locale:l,translations:a,getAsset:d,resolvedAssets:c}=n;if("url"===e.type)return e.url||null;if("asset"===e.type){if(!e.asset?.id)return null;if(c?.[e.asset.id]){let t=c[e.asset.id];return t.url.startsWith("<")?"#no-svg-url":t.url}if(d){let t=d(e.asset.id);return t&&!t.public_url&&t.content?"#no-svg-url":t?.public_url||null}return null}if("page"===e.type){let n;if(!e.page?.id||!r||!i)return null;let d=r.find(t=>t.id===e.page?.id);if(!d)return null;if(d.is_dynamic&&e.page.collection_item_id&&o){let r=o[e.page.collection_item_id];if(!r)return null;n=(0,t.buildLocalizedDynamicPageUrl)(d,i,r,l,a||void 0)}else n=(0,t.buildLocalizedSlugPath)(d,i,"page",l,a||void 0);return s&&n&&(n=`/ycode/preview${n}`),n&&e.page.anchor_layer_id&&(n=`${n}#${e.page.anchor_layer_id}`),n||null}return null}function f(e,i){if(!e||!e.type)return null;let{pages:o,folders:s,collectionItemSlugs:a,collectionItemId:d,pageCollectionItemId:p,collectionItemData:f,pageCollectionItemData:m,isPreview:g,locale:y,translations:b,getAsset:v,anchorMap:x,pageCollectionSortedItemIds:w}=i,k="";switch(e.type){case"url":{let t=e.url?.data?.content||"",n=(0,r.resolveInlineVariablesFromData)(t,f,m)||"",o=u(n);k=o?h(o,i)||"":n;break}case"email":{let t=e.email?.data?.content||"",n=(0,r.resolveInlineVariablesFromData)(t,f,m);k=n?`mailto:${n}`:"";break}case"phone":{let t=e.phone?.data?.content||"",n=(0,r.resolveInlineVariablesFromData)(t,f,m);k=n?`tel:${n}`:"";break}case"asset":if(e.asset?.id&&v){let t=v(e.asset.id);k=t&&!t.public_url&&t.content?"#no-svg-url":t?.public_url||""}break;case"page":if(e.page?.id&&o&&s){let r=o.find(t=>t.id===e.page?.id);if(r){if(r.is_dynamic&&e.page.collection_item_id&&a){let i,o=e.page.collection_item_id;switch(o){case l.CURRENT_PAGE:i=p?a[p]:void 0;break;case l.CURRENT_COLLECTION:i=d?a[d]:void 0;break;case l.NEXT_ITEM:case l.PREVIOUS_ITEM:if(w&&p){let e=w.indexOf(p);if(-1!==e){let t=e+(o===l.NEXT_ITEM?1:-1);t>=0&&t<w.length&&(i=a[w[t]])}}break;default:if(o.startsWith(n.REF_PAGE_PREFIX)||o.startsWith(n.REF_COLLECTION_PREFIX)){let e=c(o,m,f);i=e?a[e]:void 0}else i=a[o]}k=i?(0,t.buildLocalizedDynamicPageUrl)(r,s,i,y,b||void 0):""}else k=(0,t.buildLocalizedSlugPath)(r,s,"page",y,b||void 0);g&&k&&(k=`/ycode/preview${k}`)}}break;
1case"field":{let t=e.field?.data?.field_id;if(!t)break;let r=e.field?.data?._resolvedValue;if(!r){let n,o=e.field?.data?.source,s=e.field?.data?.collection_layer_id,{layerDataMap:l}=i;if(n=s&&l?.[s]?l[s]:"page"===o?m:"collection"===o?f:f||m){let i=e.field?.data?.relationships||[];r=i.length>0?n[[t,...i].join(".")]:n[t]}}r&&(k=function(e){var t;let{fieldId:r,rawValue:i,fieldType:o,context:s,assetMap:l}=e,{getAsset:a,resolvedAssets:d}=s,c=u(i);if(c)return h(c,s)||"";if("email"===o||"string"==typeof(t=i)&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t.trim()))return`mailto:${i}`;if("phone"===o||function(e){if("string"!=typeof e)return!1;let t=e.trim(),n=(t.match(/\d/g)||[]).length;return/^[\d\s\-()+.]*$/.test(t)&&n>=7}(i))return`tel:${i}`;if((0,n.isVirtualAssetField)(r))return i;if((0,n.isAssetFieldType)(o)){if(l){let e=l[i];return e&&!e.public_url&&e.content?"#no-svg-url":e?.public_url||i}if(d?.[i])return d[i].url.startsWith("<")?"#no-svg-url":d[i].url;if(a){let e=a(i);return e&&!e.public_url&&e.content?"#no-svg-url":e?.public_url||""}}return i}({fieldId:t,rawValue:r,fieldType:e.field?.data?.field_type,context:i}))}}if(e.anchor_layer_id){let t=x?.[e.anchor_layer_id]||e.anchor_layer_id;k=k?`${k}#${t}`:`#${t}`}return k||null}function m(e){let t=e.trim();if(!t||/^(mailto:|tel:|javascript:)/i.test(t))return null;if(/^[a-z][a-z0-9+.-]*:\/\//i.test(t))try{t=new URL(t).pathname}catch{return null}return(t=(t=t.split("#")[0].split("?")[0]).replace(/^\/ycode\/preview/,"")).length>1&&(t=t.replace(/\/+$/,"")),""===t&&(t="/"),t}function g(e,t,r){if(!e||!t.pageId)return!1;if("page"===e.type){let r=e.page?.id;if(!r||r!==t.pageId)return!1;let i=t.pages?.find(e=>e.id===r),o=e.page?.collection_item_id;if(!i?.is_dynamic||!o)return!0;if(!t.pageCollectionItemId)return!1;let s=function(e,t){if(e){if(d(e))switch(e){case l.CURRENT_PAGE:return t.pageCollectionItemId;case l.CURRENT_COLLECTION:return t.collectionItemId;default:return}return e.startsWith(n.REF_PAGE_PREFIX)||e.startsWith(n.REF_COLLECTION_PREFIX)?c(e,t.pageCollectionItemData,t.collectionItemData):e}}(o,t);return!!s&&s===t.pageCollectionItemId}let i=r??f(e,t);if(!i)return!1;let o=m(i);if(!o)return!1;let s=function(e){if(!e.pageId)return null;let t=f({type:"page",page:{id:e.pageId,collection_item_id:(e.pageCollectionItemId??null)||null},anchor_layer_id:null},e);return t?m(t):null}(t);return!!s&&o===s}function y(e,t){let n=f(e,t);if(!n)return null;let r=e.target||"_self",i=e.rel||("_blank"===r?"noopener noreferrer":void 0);return{href:n,target:r,...i&&{rel:i},...e.download&&{download:e.download}}}function b(e,t){if(!e||"page"!==e.type)return!1;let n=e.page?.collection_item_id;if(n!==l.NEXT_ITEM&&n!==l.PREVIOUS_ITEM)return!1;let r=t.pageCollectionSortedItemIds,i=t.pageCollectionItemId;if(!r||!i)return!1;let o=r.indexOf(i);if(-1===o)return!1;let s=o+(n===l.NEXT_ITEM?1:-1);return s<0||s>=r.length}},618930,e=>{"use strict";function t(e,t,n){let r=n?`component:${n}`:`page:${e}`;return`${r}:${t}`}function n(e,t){if(e)return e[t]}function r(e,t){if(e){if(t?.includeIncomplete){let t=e.content_value;return t&&""!==t.trim()?t:void 0}if(e&&e.is_completed&&e.content_value&&""!==e.content_value.trim())return e.content_value}}e.s(["buildLayerTranslationKey",0,t,"getTranslatableKey",0,function(e){return`${e.source_type}:${e.source_id}:${e.content_key}`},"getTranslatedAssetId",0,function(e,i,o,s,l){if(!e||!o||!s)return e;let a=r(n(o,t(s,i,l)));return a||e},"getTranslatedText",0,function(e,i,o,s,l){if(!e||!o||!s)return e;let a=r(n(o,t(s,i,l)));return a||e},"getTranslationByKey",0,n,"getTranslationValue",0,r])},963545,e=>{"use strict";e.s(["buildFolderPath",()=>function e(t,n,r=!1){if(!t.page_folder_id)return r?[t.name]:t.name;let i=n.find(e=>e.id===t.page_folder_id);return i?r?[...e(i,n,!0),t.name]:`${e(i,n)} / ${t.name}`:r?[t.name]:t.name},"buildLocalizedDynamicPageUrl",()=>p,"buildLocalizedSlugPath",()=>u,"buildPageTree",()=>y,"buildPreviewAuthRevision",()=>r,"buildSlugPath",()=>d,"calculateNextOrder",()=>M,"checkDuplicateFolderSlug",()=>O,"checkDuplicatePageSlug",()=>E,"filterPageTree",()=>b,"findHomepage",()=>s,"findNextSelection",()=>A,"flattenPageTree",()=>function e(t,n=null,r=0,i=new Set){let o=[];return t.forEach((t,s)=>{let l=i.has(t.id);o.push({id:t.id,type:t.type,data:t.data,depth:r,parentId:n,index:s,collapsed:l}),t.children&&t.children.length>0&&!l&&o.push(...e(t.children,t.id,r+1,i))}),o},"folderHasIndexPage",()=>h,"generateSlug",()=>k,"generateUniqueFolderSlug",()=>T,"generateUniqueSlug",()=>S,"getDescendantFolderIds",()=>f,"getNextNumberFromNames",()=>C,"getNodeIcon",()=>m,"getPageIcon",()=>g,"getParentContextFromSelection",()=>_,"isDescendantFolder",()=>function e(t,n,r){let i=r.find(e=>e.id===t);return!!i&&!!i.page_folder_id&&(i.page_folder_id===n||e(i.page_folder_id,n,r))},"isHomepage",()=>l,"isReservedRootSlug",()=>o,"rebuildPageTree",()=>v,"sanitizeSlug",()=>w],963545);var t=e.i(618930),n=e.i(49026);function r(e,t){if(!e)return"";let n=[e.updated_at,String(e.settings?.auth?.enabled??!1),e.settings?.auth?.password??""],r=e.page_folder_id;for(;r;){let e=t.find(e=>e.id===r);if(!e)break;n.push(e.updated_at,String(e.settings?.auth?.enabled??!1),e.settings?.auth?.password??""),r=e.page_folder_id}return n.join("|")}let i=["ycode"];function o(e){return i.includes(e.toLowerCase().trim())}function s(e){return e.find(l)||null}function l(e){return e.is_index&&null===e.page_folder_id}function a(e){return(e??"").replace(/^\/+|\/+$/g,"")}function d(e,t,n,r="{slug}"){if(!e)return"/";let i=[],o=e.page_folder_id;for(;o;){let e=t.find(e=>e.id===o);if(!e)break;i.unshift(e.slug),o=e.page_folder_id}return"folder"===n?i.push(e.slug):"page"===n&&(e.is_dynamic?i.push(r):!e.is_index&&e.slug&&i.push(e.slug)),"/"+i.map(a).filter(
1Boolean).join("/")}function c(e,n,r,i){if(!i)return r;let o=i[(0,t.getTranslatableKey)({source_type:n,source_id:e,content_key:"slug"})];return o?.content_value||r}function u(e,t,n,r,i,o="{slug}"){if(!e)return"/";if(!r||r.is_default)return d(e,t,n,o);let s=[],l=e.page_folder_id;for(;l;){let e=t.find(e=>e.id===l);if(!e)break;let n=c(e.id,"folder",e.slug,i);s.unshift(n),l=e.page_folder_id}if("folder"===n){let t=c(e.id,"folder",e.slug,i);s.push(t)}else if("page"===n){if(e.is_dynamic)s.push(o);else if(!e.is_index&&e.slug){let t=c(e.id,"page",e.slug,i);s.push(t)}}let p=s.map(a).filter(Boolean);return p.length>0?`/${r.code}/${p.join("/")}`:`/${r.code}`}function p(e,t,n,r,i){let o=u(e,t,"page",r,i,"{slug}");return null===n?o:o.replace(/\{slug\}/g,n)}function h(e,t,n){return t.some(t=>t.id!==n&&t.is_index&&t.page_folder_id===e)}function f(e,t){let n=new Map;for(let e of t){let t=e.page_folder_id||"root";n.has(t)||n.set(t,[]),n.get(t).push(e.id)}let r=e=>{let t=n.get(e)||[],i=[...t];for(let e of t)i.push(...r(e));return i};return r(e)}function m(e){return"folder"===e.type?"folder":g(e.data)}function g(e){return e.is_index?"homepage":e.is_dynamic?"dynamicPage":"page"}function y(e,t){let n=new Map;t.forEach(e=>{n.set(e.id,{id:e.id,type:"folder",data:e,children:[]})});let r=[];t.forEach(e=>{let t=n.get(e.id);if(null===e.page_folder_id)r.push(t);else{let r=n.get(e.page_folder_id);r&&(r.children=r.children||[],r.children.push(t))}}),e.forEach(e=>{let t={id:e.id,type:"page",data:e};if(null===e.page_folder_id)r.push(t);else{let i=n.get(e.page_folder_id);i?(i.children=i.children||[],i.children.push(t)):r.push(t)}});let i=e=>{e.sort((e,t)=>(e.type,(e.data.order??0)-(t.type,t.data.order??0))),e.forEach(e=>{e.children&&i(e.children)})};return i(r),r}function b(e,t){let n=t.trim().toLowerCase();if(!n)return e;let r=e=>{let t=[];for(let i of e){if((i.type,i.data.name).toLowerCase().includes(n)){t.push(i);continue}if(i.children&&i.children.length>0){let e=r(i.children);e.length>0&&t.push({...i,children:e})}}return t};return r(e)}function v(e,t,n,r){let i=e.map(e=>({...e,data:{...e.data}})),o=i.find(e=>e.id===t);if(!o)return console.error("â REBUILD ERROR: Moved node not found!"),[];o.parentId=n,o.index=r;let s=new Map;return i.forEach(e=>{let t=e.parentId;s.has(t)||s.set(t,[]),s.get(t).push(e)}),s.forEach((e,n)=>{e.sort((e,t)=>e.index-t.index);let i=e.find(e=>e.id===t);if(i){let n=e.findIndex(e=>e.id===t);e.splice(n,1);let o=0;for(let t=0;t<e.length;t++)if(e[t].index<r)o=t+1;else break;e.splice(o,0,i)}e.forEach((e,t)=>{e.index=t})}),(s.get(null)||[]).map(e=>(function e(t){let n=i.find(e=>e.id===t),r=s.get(t)||[],o={id:n.id,type:n.type,data:n.data};return r.length>0&&(o.children=r.map(t=>e(t.id))),o})(e.id))}let x={Ä
:"a",Ä:"c",Ä:"e",Ä:"e",į:"i",Å¡:"s",ų:"u",Å«:"u",ž:"z",Ä:"A",Ä:"C",Ä:"E",Ä:"E",Ä®:"I",Å :"S",Ų:"U",Ū:"U",Ž:"Z",а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",Ñ:"yo",ж:"zh",з:"z",и:"i",й:"y",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",Ñ:"r",Ñ:"s",Ñ:"t",Ñ:"u",Ñ:"f",Ñ
:"h",Ñ:"ts",Ñ:"ch",Ñ:"sh",Ñ:"shch",Ñ:"",Ñ:"y",Ñ:"",Ñ:"e",Ñ:"yu",Ñ:"ya",Ð:"A",Ð:"B",Ð:"V",Ð:"G",Ð:"D",Ð:"E",Ð:"Yo",Ð:"Zh",Ð:"Z",Ð:"I",Ð:"Y",Ð:"K",Ð:"L",Ð:"M",Ð:"N",Ð:"O",Ð:"P",Ð :"R",С:"S",Т:"T",У:"U",Ф:"F",Ð¥:"H",Ц:"Ts",Ч:"Ch",Ш:"Sh",Щ:"Shch",Ъ:"",Ы:"Y",Ь:"",Ð:"E",Ю:"Yu",Я:"Ya",Ä:"c",Å:"l",Å:"n",ó:"o",Å:"s",ź:"z",ż:"z",Ä:"C",Å:"L",Å:"N",Ã:"O",Å:"S",Ź:"Z",Å»:"Z",ä:"ae",ö:"oe",ü:"ue",Ã:"ss",Ã:"Ae",Ã:"Oe",Ã:"Ue",à :"a",â:"a",é:"e",è:"e",ê:"e",ë:"e",î:"i",ï:"i",ô:"o",ù:"u",û:"u",ÿ:"y",ç:"c",Ã:"A",Ã:"A",Ã:"E",Ã:"E",Ã:"E",Ã:"E",Ã:"I",Ã:"I",Ã:"O",Ã:"U",Ã:"U",Ÿ:"Y",Ã:"C",á:"a",Ã:"i",ú:"u",ñ:"n",Ã:"A",Ã:"I",Ã:"U",Ã:"N",ã:"a",õ:"o",Ã:"A",Ã:"O",Ä:"e",Å:"r",Å¥:"t",ů:"u",ý:"y",Ä:"E",Å:"R",Ť:"T",Å®:"U",Ã:"Y",Ä:"a",È:"s",È:"t",Ä:"A",È:"S",È:"T",Ä:"g",ı:"i",Å:"s",Ä:"G",İ:"I",Å:"S",α:"a",β:"b",γ:"g",δ:"d",ε:"e",ζ:"z",η:"i",θ:"th",ι:"i",κ:"k",λ:"l",μ:"m",ν:"n",ξ:"x",ο:"o",Ï:"p",Ï:"r",Ï:"s",Ï:"s",Ï:"t",Ï
:"y",Ï:"f",Ï:"ch",Ï:"ps",Ï:"o",Î:"A",Î:"B",Î:"G",Î:"D",Î:"E",Î:"Z",Î:"I",Î:"Th",Î:"I",Î:"K",Î:"L",Î:"M",Î:"N",Î:"X",Î:"O",Î :"P",Ρ:"R",Σ:"S",Τ:"T",Î¥:"Y",Φ:"F",Χ:"Ch",Ψ:"Ps",Ω:"O",Ã¥:"a",æ:"ae",ø:"o",Ã
:"A",Ã:"Ae",Ã:"O",Ä:"a",Ä:"e",Ä£:"g",Ä«:"i",Ä·:"k",ļ:"l",Å:"n",Ä:"A",Ä:"E",Ä¢:"G",Ī:"I",Ķ:"K",Ä»:"L",Å
:"N",Ñ:"ye",Ñ:"i",Ñ:"yi",Ò:"g",Ð:"Ye",Ð:"I",Ð:"Yi",Ò:"G",Ñ:"dj",Ñ:"j",Ñ:"lj",Ñ:"nj",Ñ:"c",Ñ:"dz",Ð:"Dj",Ð:"J",Ð:"Lj",Ð:"Nj",Ð:"C",Ð:"Dz"};function w(e,t=!1){let n=function(e){let t="";for(let n=0;n<e.length;n++){let r=e[n],i=x[r];void 0!==i?t+=i:t+=r}return t}(e);return n=(n=n.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-")).replace(/^-+/,""),t||(n=n.replace(/-+$/,"")),n}function k(e){return w(e)}function S(e,t,n=null,r=!1,i){let s=w(e);if(!s)return"";let l=t.filter(e=>e.id!==i&&e.page_folder_id===n&&e.is_published===r&&null===e.error_page).map(e=>e.slug.toLowerCase()),a=null===n&&o(s);if(!l.includes(s)&&!a)return s;let d=2,c=`${s}-${d}`;for(;l.includes(c);)d++,c=`${s}-${d}`;return c}function T(e,t,n=null,r){let i=w(e);if(!i)return"";let s=t.filter(e=>e.id!==r&&e.page_folder_id===n).map(e=>e.slug.toLowerCase()),l=null===n&&o(i);if(!s.includes(i)&&!l)return i;let a=2,d=`${i}-${a}
1`;for(;s.includes(d);)a++,d=`${i}-${a}`;return d}function C(e,t){let n=e.map(e=>{let n=e.name.match(RegExp(`^${t}\\s+(\\d+)$`,"i"));return n?parseInt(n[1],10):0}).filter(e=>e>0);return 0===n.length?1:Math.max(...n)+1}function _(e,t,n){let r=null,i=0;if(e){let o=n.find(t=>t.id===e);if(o)r=o.id,i=o.depth+1;else{let n=t.find(t=>t.id===e);n&&(r=n.page_folder_id,i=n.depth)}}return{parentFolderId:r,newDepth:i}}function M(e,t,n,r,i){if(i){let r=n.find(e=>e.id===i);if(r&&r.page_folder_id===e&&r.depth===t&&null===r.deleted_at)return(r.order||0)+1}let o=n.filter(n=>n.page_folder_id===e&&n.depth===t&&null===n.error_page&&null===n.deleted_at),s=r.filter(n=>n.page_folder_id===e&&n.depth===t&&null===n.deleted_at),l=[...o.map(e=>({order:e.order||0})),...s.map(e=>({order:e.order||0}))];return 0===l.length?0:Math.max(...l.map(e=>e.order))+1}function A(e,t,n,r){let i="folder"===t?r.find(t=>t.id===e):n.find(t=>t.id===e);if(!i)return null;let o=i.page_folder_id,s=i.depth,l=i.order||0,a=n.filter(t=>t.id!==e&&t.page_folder_id===o&&t.depth===s&&null===t.error_page),d=r.filter(t=>t.id!==e&&t.page_folder_id===o&&t.depth===s),c=[...a.map(e=>({id:e.id,order:e.order||0,type:"page"})),...d.map(e=>({id:e.id,order:e.order||0,type:"folder"}))].sort((e,t)=>e.order-t.order);if(c.length>0){let e=c.find(e=>e.order>l);return e?e.id:c[c.length-1].id}return o}function E(e,t,n,r,i){let s=e.trim();return null===n&&o(s)?{isValid:!1,error:`Slug "${s}" cannot be used inside the root folder.`}:t.find(e=>e.id!==i&&e.slug===s&&e.is_published===r&&e.page_folder_id===n)?{isValid:!1,error:"This slug is already used by another page in this folder"}:{isValid:!0}}function O(e,t,n,r){let i=e.trim();return null===n&&o(i)?{isValid:!1,error:`Slug "${i}" cannot be used inside the root folder.`}:t.find(e=>e.id!==r&&e.slug===i&&e.page_folder_id===n)?{isValid:!1,error:"This slug is already used by another folder in the same location"}:{isValid:!0}}JSON.stringify([{id:"body",name:"body",classes:"",children:[{id:"layer-1762789137823-g2cdo46ld",name:"section",design:{layout:{display:"Flex",isActive:!0,flexDirection:"column",alignItems:"center",justifyContent:"center"},sizing:{isActive:!0,minHeight:"100vh"},spacing:{isActive:!0,paddingTop:"4rem",paddingBottom:"4rem",paddingLeft:"1rem",paddingRight:"1rem"}},classes:"flex flex-col items-center justify-center min-h-[100vh] px-[1rem] py-[4rem]",children:[{id:"layer-1762789141753-zpz5jyobc",name:"div",design:{layout:{isActive:!0,display:"Flex",flexDirection:"column",alignItems:"center",gap:"16"},sizing:{isActive:!0,width:"100%",maxWidth:"32rem"},typography:{isActive:!0,textAlign:"center"}},classes:"w-full max-w-[32rem] flex flex-col items-center text-center gap-[16px]",children:[{id:"layer-1762789150900-pw-icon",name:"icon",settings:{tag:"div"},design:{sizing:{isActive:!0,width:"32",height:"32"},typography:{isActive:!0,color:"#9ca3af"}},classes:"text-[#9ca3af] w-[32px] h-[32px]",children:[],customName:"Lock icon",variables:{icon:{src:{type:"static_text",data:{content:'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>'}}}}},{id:"layer-1762789150930-pw-text-block",name:"div",design:{layout:{isActive:!0,display:"Flex",flexDirection:"column",gap:"0.5rem",alignItems:"center"},sizing:{isActive:!0,width:"100%"}},classes:"w-full flex flex-col items-center gap-[0.5rem]",children:[{id:"layer-1762789150944-5qezgblbe",name:"heading",settings:{tag:"h1"},design:{typography:{isActive:!0,color:"#111827",fontSize:"30",fontWeight:"700"}},classes:"font-[700] text-[#111827] text-[30px]",children:[],customName:"Heading",restrictions:{editText:!0},variables:{text:{type:"dynamic_rich_text",data:{content:(0,n.getTiptapTextContent)("Password protected")}}}},{id:"layer-1762789197005-7z2wy597y",name:"text",settings:{tag:"p"},design:{typography:{isActive:!0,fontSize:"12",color:"#111827"}},classes:"text-[12px] text-[#111827]",children:[],customName:"Subtitle",restrictions:{editText:!0},variables:{text:{type:"dynamic_rich_text",data:{content:(0,n.getTiptapTextContent)("To access this page, please enter the required password below.")}}}}],customName:"Text block"},{id:"layer-1762789200000-pw-form",name:"form",settings:{id:"password-protected-form",form:{form_type:"password_protected"}},attributes:{method:"POST",action:""},design:{layout:{isActive:!0,display:"Flex",flexDirection:"column",gap:"16"},sizing:{isActive:!0,width:"100%"},spacing:{isActive:!0,marginTop:"1rem"}},classes:"w-full flex flex-col mt-[1rem] gap-[16px]",restrictions:{copy:!1,delete:!1},customName:"Password form",children:[{id:"layer-1762789200002-pw-error",name:"div",alertType:"error",hiddenGenerated:!0,design:{backgrounds:{isActive:!0,backgroundColor:"#fee2e2"},borders:{isActive:!0,borderRadius:"0.75rem"},layout:{isActive:!0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},sizing:{isActive:!0,height:"38"},spacing:{isActive:!0,paddingTop:"1rem",paddingBottom:"1rem",paddingLeft:"16",paddingRight:"16"},typography:{isActive:!0,fontSize:"14px",color:"#991b1b",fontWeight:"500"}},classes:"bg-[#fee2e2] text-[#991b1b] text-[14px] font-[500] rounded-[0.75rem] pr-[16px] pl-[16px] h-[38px] justify-center items-center flex flex-col",restrictions:{copy:!1,delete:!1},customName:"Error alert",children:[{id:"layer-1762789200003-pw-error-text",name:"text",settings:{tag:"span"},classes:"",design:{},children:[],customName:"Message",restrictions:{editText:!0},variables:{text:{type:"dynamic_rich_text",data:{content:(0,n.getTiptapTextContent)("Incorrect password. Please try again.")}}}}]},{id:"layer-1762789200010-pw-row",name:"div",design:{layout:{isActive:!0,display:"Flex",flexDirection:"row",gap:"12",alignItems:"stretch"},sizing:{isActive:!0,width:"100%"}},classes:"w-full flex flex-row items-stretch gap-[12px]",restrictions:{copy:!1,delete:!1}
1,customName:"Row",children:[{id:"layer-1762789200001-pw-input",name:"input",attributes:{type:"password",name:"password",placeholder:"",required:!0,autoComplete:"current-password"},settings:{id:"password"},design:{sizing:{isActive:!0,width:"100%",height:"38px"},spacing:{isActive:!0,paddingLeft:"1rem",paddingRight:"1rem"},borders:{isActive:!0,borderWidth:"1px",borderColor:"rgba(115, 115, 115, 0.15)",borderRadius:"0.75rem"},typography:{isActive:!0,fontSize:"14px",color:"#171717",lineHeight:"24px",letterSpacing:"0px",placeholderColor:"#a8a8a8"},backgrounds:{isActive:!0,backgroundColor:"rgba(212, 212, 212, 0.1)"}},classes:"w-[100%] h-[38px] pl-[16px] pr-[16px] text-[14px] leading-[24px] tracking-[0px] text-[#171717] bg-[#d4d4d4]/10 border border-solid border-[#737373]/[0.15] rounded-[12px] placeholder:text-[#a8a8a8] focus:outline-none focus:border-[#737373]/20 disabled:opacity-50 cursor-text",children:[],restrictions:{copy:!1,delete:!1},customName:"Password input"},{id:"layer-1762789200004-pw-submit",name:"button",attributes:{type:"submit"},design:{spacing:{isActive:!0,paddingLeft:"16",paddingRight:"16"},backgrounds:{isActive:!0,backgroundColor:"#171717"},typography:{isActive:!0,color:"#ffffff",fontSize:"14px"}},classes:"flex flex-row items-center justify-center text-[#FFFFFF] pr-[16px] pl-[16px] h-[38px] text-[14px] rounded-[12px] bg-[#171717] cursor-pointer",restrictions:{copy:!1,delete:!1},customName:"Submit button",children:[{id:"layer-1762789200005-pw-submit-text",name:"text",settings:{tag:"span"},classes:"",design:{},children:[],customName:"Label",restrictions:{editText:!0},variables:{text:{type:"dynamic_rich_text",data:{content:(0,n.getTiptapTextContent)("Submit")}}}}]}]}]}],customName:"Container"}],customName:"Section"}]}]),JSON.stringify([{id:"body",name:"body",classes:"",children:[{id:"layer-1762789137823-g2cdo46ld",name:"section",design:{layout:{display:"Flex",isActive:!0,flexDirection:"column"},sizing:{height:"100vh",isActive:!0},spacing:{isActive:!0,paddingTop:"3rem",paddingBottom:"3rem"}},classes:"flex flex-col gap-[1rem] py-[3rem] h-[100vh]",children:[{id:"layer-1762789141753-zpz5jyobc",name:"div",design:{sizing:{height:"100vh",isActive:!0,maxWidth:"80rem"},spacing:{isActive:!0,marginLeft:"auto",marginRight:"auto",paddingLeft:"1rem",paddingRight:"1rem"}},classes:"max-w-[80rem] mx-auto px-[1rem] h-[100vh]",children:[{id:"layer-1762789168560-icft8ynp5",name:"div",design:{layout:{gap:"6",display:"flex",isActive:!0,alignItems:"center",flexDirection:"column",justifyContent:"center"},sizing:{height:"100%",isActive:!0},typography:{isActive:!0,textAlign:"center"}},classes:"items-center text-center h-full flex flex-col justify-center gap-[6px]",children:[{id:"layer-1762789150944-5qezgblbe",name:"heading",settings:{tag:"h1"},design:{typography:{color:"#111827",fontSize:"30",isActive:!0,fontWeight:"700"}},classes:"font-[700] text-[#111827] text-[30px]",children:[],customName:"Heading",restrictions:{editText:!0},variables:{text:{type:"dynamic_rich_text",data:{content:(0,n.getTiptapTextContent)("404")}}}},{id:"layer-1762789197005-7z2wy597y",name:"text",settings:{tag:"p"},design:{typography:{fontSize:"12",color:"#111827",isActive:!0}},classes:"text-[12px] text-[#111827]",children:[],customName:"Text",restrictions:{editText:!0},variables:{text:{type:"dynamic_rich_text",data:{content:(0,n.getTiptapTextContent)("Page not found")}}}},{id:"layer-1762789197006-7z2wy597z",name:"text",settings:{tag:"p"},design:{typography:{fontSize:"12",color:"#111827",isActive:!0}},classes:"text-[12px] text-[#111827]",children:[],customName:"Text",restrictions:{editText:!0},variables:{text:{type:"dynamic_rich_text",data:{content:(0,n.getTiptapTextContent)("The page you are looking for does not exist.")}}}}],customName:"Container"}],customName:"Container"}],customName:"Section"}]}]),JSON.stringify([{id:"body",name:"body",classes:"",children:[{id:"layer-1762789137823-g2cdo46ld",name:"section",design:{layout:{display:"Flex",isActive:!0,flexDirection:"column"},sizing:{height:"100vh",isActive:!0},spacing:{isActive:!0,paddingTop:"3rem",paddingBottom:"3rem"}},classes:"flex flex-col gap-[1rem] py-[3rem] h-[100vh]",children:[{id:"layer-1762789141753-zpz5jyobc",name:"div",design:{sizing:{height:"100vh",isActive:!0,maxWidth:"80rem"},spacing:{isActive:!0,marginLeft:"auto",marginRight:"auto",paddingLeft:"1rem",paddingRight:"1rem"}},classes:"max-w-[80rem] mx-auto px-[1rem] h-[100vh]",children:[{id:"layer-1762789168560-icft8ynp5",name:"div",design:{layout:{gap:"6",display:"flex",isActive:!0,alignItems:"center",flexDirection:"column",justifyContent:"center"},sizing:{height:"100%",isActive:!0},typography:{isActive:!0,textAlign:"center"}},classes:"items-center text-center h-full flex flex-col justify-center gap-[6px]",children:[{id:"layer-1762789150944-5qezgblbe",name:"heading",settings:{tag:"h1"},design:{typography:{color:"#111827",fontSize:"30",isActive:!0,fontWeight:"700"}},classes:"font-[700] text-[#111827] text-[30px]",children:[],customName:"Heading",restrictions:{editText:!0},variables:{text:{type:"dynamic_rich_text",data:{content:(0,n.getTiptapTextContent)("500")}}}},{id:"layer-1762789197005-7z2wy597y",name:"text",settings:{tag:"p"},design:{typography:{fontSize:"12",color:"#111827",isActive:!0}},classes:"text-[12px] text-[#111827]",children:[],customName:"Text",restrictions:{editText:!0},variables:{text:{type:"dynamic_rich_text",data:{content:(0,n.getTiptapTextContent)("Server error")}}}},{id:"layer-1762789197006-7z2wy597z",name:"text",settings:{tag:"p"},design:{typography:{fontSize:"12",color:"#111827",isActive:!0}},classes:"text-[12px] text-[#111827]",children:[],customName:"Text",restrictions:{editText:!0},variables:{text:{type:"dynamic_rich_text",data:{content:(0,n.getTiptapTextContent)("An unexpected error occurred. Please try again later.")}}}}],customName:"Container"}],customName:"Container"}],customName:"Section"}]}])},302427,e=>{"use strict";let t={shown:"Shown items",total:"Total items",current:"Current page",pages:"Total pages"},n=/<ycode-inline-variable>([\s\S]*?)<\/ycode-inline-variable>/g;function r(e){return{type:"dynamicVariable",attrs:{variable:{type:"pagination",data:{key:e}},label:t[e]}}}function i(e){return{type:"doc",content:[{type:"paragraph",content:e.map(e=>"text"in e?{type:"text",text:e.text}:e)}]}}function o(e,t){return e?e.replace(n,(e,n)=>{try{let e=JSON.parse(String(n).trim());if(e?.type==="pagination"&&e?.data?.key in t)return String(t[e.data.key])}catch{}return e}):e}e.s(["PAGINATION_VARIABLE_LABELS",0,t,"defaultPaginationCountDoc",0,function(){return i([{text:"Showing "},r("shown"),{text:" of "},r("total")])},"defaultPaginationInfoDoc",0,function(){return i([{text:"Page "},r("current"),{text:" of "},r("pages")])},"getPaginationLayerKind",0,function(e){return e?e.endsWith("-pagination-count")?"count":e.endsWith("-pagination-info")?"info":null:null},"hasPaginationVariables",0,function(e){return!!e&&("dynamic_text"===e.type&&"string"==typeof e.data.content?e.data.content.includes('"type":"pagination"'):"dynamic_rich_text"===e.type&&JSON.stringify(e.data.content||{}).includes('"type":"pagination"'))},"paginationTextVariableToTemplate",0,function(e){if(!e)return"";if("dynamic_text"===e.type&&"string"==typeof e.data.content)return e.data.content;if("dynamic_rich_text"===e.type&&e.data.content&&"object"==typeof e.data.content){let t="",n=e=>{Array.isArray(e)?e.forEach(n):e&&"object"==typeof e&&("text"===e.type?t+=e.text||"":"dynamicVariable"===e.type&&e.attrs?.variable?t+=`<ycode-inline-variable>${JSON.stringify(e.attrs.variable)}</ycode-inline-variable>`:Array.isArray(e.content)&&e.content.forEach(n))};return n(e.data.content.content),t}return""},"resolvePaginationString",0,o,"resolvePaginationTextVariable",0,function(e,t){if("dynamic_text"===e.type&&"string"==typeof e.data.content)return{...e,data:{...e.data,content:o(e.data.content,t)}};if("dynamic_rich_text"===e.type&&e.data.content&&"object"==typeof e.data.content){var n;let r;return{...e,data:{...e.data,content:(n=e.data.content,(r=e=>{if(Array.isArray(e))return e.map(r);if(e&&"object"==typeof e){if("dynamicVariable"===e.type&&e.attrs?.variable?.type==="pagination"&&e.attrs.variable.data?.key in t)return{type:"text",text:String(t[e.attrs.variable.data.key])};let n={...e};return Array.isArray(e.content)&&(n.content=e.content.map(r)),n}return e})(n))}}}return e}])},13532,e=>{"use strict";e.s(["applyComponentOverrides",()=>
1a,"resolveComponents",()=>function e(n,r,i,s,l){let d=i?.length?a(n,s,i):n,c=l??new Set;return d.map(n=>{if(n.componentId){if(c.has(n.componentId))return console.warn("[resolveComponents] Circular component reference detected, skipping:",n.componentId),{...n,children:[]};let i=r.find(e=>e.id===n.componentId),s=i?(0,t.getComponentVariantLayers)(i,n.componentVariantId):[];if(i&&s.length){let t=new Set(c);t.add(n.componentId);let l=s[0],d=a(l.children?e(l.children,r,i.variables,n.componentOverrides,t):[],n.componentOverrides,i.variables),[u]=a([{...l,children:void 0}],n.componentOverrides,i.variables),p=d.length?function e(t,n){return t.map(t=>({...t,_masterComponentId:n,children:t.children?e(t.children,n):void 0}))}(d,i.id):[],h=p.length?o(p,n.id,l.id):[],f=u.interactions;return f?.length&&(f=f.map(e=>({...e,id:`${n.id}-${e.id}`,tweens:e.tweens.map(e=>({...e,layer_id:e.layer_id===l.id?n.id:`${n.id}-${e.layer_id}`}))}))),{...n,...u,id:n.id,componentId:n.componentId,_masterComponentId:i.id,_originalLayerId:l.id,children:h,interactions:f}}console.warn("[resolveComponents] Component not found or has no layers:",n.componentId)}return n.children?.length?{...n,children:e(n.children,r,i,s,c)}:n})},"resolveVariableLinks",()=>l,"transformLayerIdsForInstance",()=>o]);var t=e.i(897742),n=e.i(61640);function r(e,t){if(e?.type!=="field"||!e?.data?.collection_layer_id)return e;let n=t.get(e.data.collection_layer_id);return n?{...e,data:{...e.data,collection_layer_id:n}}:e}function i(e,t){return"string"==typeof e?e.replace(/<ycode-inline-variable>([\s\S]*?)<\/ycode-inline-variable>/g,(e,n)=>{try{let e=JSON.parse(n.trim()),r=e?.data?.collection_layer_id;if(r&&t.has(r))return e.data.collection_layer_id=t.get(r),`<ycode-inline-variable>${JSON.stringify(e)}</ycode-inline-variable>`}catch{}return e}):e&&"object"==typeof e?function e(t,n){if(!t||"object"!=typeof t)return t;let r=!1,i=t;if(t.attrs?.variable?.data?.collection_layer_id){let e=t.attrs.variable.data.collection_layer_id,o=n.get(e);o&&(i={...t,attrs:{...t.attrs,variable:{...t.attrs.variable,data:{...t.attrs.variable.data,collection_layer_id:o}}}},r=!0)}if(Array.isArray(t.content)){let o=t.content.map(t=>e(t,n));o.some((e,n)=>e!==t.content[n])&&(i={...r?i:t,content:o})}return i}(e,t):e}function o(e,t,n){let o=new Map;n&&n!==t&&o.set(n,t);let s=e=>{for(let n of e){let e=`${t}-${n.id}`;o.set(n.id,e),n.children&&s(n.children)}};s(e);let l=e=>{let n=o.get(e.id)||e.id,s={...e,id:n,_originalLayerId:e._originalLayerId||e.id};return e.interactions&&e.interactions.length>0&&(s.interactions=e.interactions.map(e=>({...e,id:`${t}-${e.id}`,tweens:e.tweens.map(e=>({...e,layer_id:o.get(e.layer_id)||e.layer_id}))}))),e.variables&&(s.variables=function(e,t){let n=!1,o={...e};if(e.text){let r=e.text;if("dynamic_text"===r.type&&"string"==typeof r.data?.content&&r.data.content.includes("collection_layer_id")){let e=i(r.data.content,t);e!==r.data.content&&(o.text={...r,data:{...r.data,content:e}},n=!0)}else if("dynamic_rich_text"===r.type&&r.data?.content){let e=i(r.data.content,t);e!==r.data.content&&(o.text={...r,data:{...r.data,content:e}},n=!0)}}if(e.image?.src){let i=r(e.image.src,t);i!==e.image.src&&(o.image={...e.image,src:i},n=!0)}if(e.audio?.src){let i=r(e.audio.src,t);i!==e.audio.src&&(o.audio={...e.audio,src:i},n=!0)}if(e.video){let i=!1,s={...e.video};if(e.video.src){let n=r(e.video.src,t);n!==e.video.src&&(s.src=n,i=!0)}if(e.video.poster){let n=r(e.video.poster,t);n!==e.video.poster&&(s.poster=n,i=!0)}i&&(o.video=s,n=!0)}if(e.backgroundImage?.src){let i=r(e.backgroundImage.src,t);i!==e.backgroundImage.src&&(o.backgroundImage={...e.backgroundImage,src:i},n=!0)}if(e.link?.field){let i=r(e.link.field,t);i!==e.link.field&&(o.link={...e.link,field:i},n=!0)}if(e.design){let i=!1,s={...e.design};for(let n of["backgroundColor","color","borderColor","divideColor","outlineColor","textDecorationColor"])if(e.design[n]){let o=function(e,t){if(!e||"color"!==e.type)return e;let n=!1,i={...e};if(e.field){let o=r(e.field,t);o!==e.field&&(i.field=o,n=!0)}for(let o of["linear","radial"])if(e[o]?.stops?.length){let s=e[o].stops.map(e=>{if(!e.field)return e;let i=r(e.field,t);return i!==e.field?(n=!0,{...e,field:i}):e});n&&(i[o]={...e[o],stops:s})}return n?i:e}(e.design[n],t);o!==e.design[n]&&(s[n]=o,i=!0)}i&&(o.design=s,n=!0)}if(e.conditionalVisibility?.groups?.length){let r=e.conditionalVisibility.groups,i=r.map(e=>{if(!Array.isArray(e?.conditions))return e;let n=e.conditions.map(e=>{let n=e?.collectionLayerId?t.get(e.collectionLayerId):void 0;return n&&n!==e.collectionLayerId?{...e,collectionLayerId:n}:e});return n.some((t,n)=>t!==e.conditions[n])?{...e,conditions:n}:e});i.some((e,t)=>e!==r[t])&&(o.conditionalVisibility={...e.conditionalVisibility,groups:i},n=!0)}return n?o:e}(e.variables,o)),e.children&&(s.children=e.children.map(l)),s};return e.map(l)}let s=["text","rich_text","image","link","audio","video","icon","variant"];function l(e,t,n){let r=e?.variableLinks;if(!r||0===Object.keys(r).length)return e;let i={...e};for(let[e,o]of Object.entries(r)){let r,l,a=n?.find(e=>e.id===o);if(a){let e=a.type||"text";r=e,l=t?.[e]?.[o]??a.default_value}else{let e=function(e,t){if(e)for(let n of s){let r=e[n];if(r?.[t]!==void 0)return{category:n,value:r[t]}}}(t,o);e&&(r=e.category,l=e.value)}r&&void 0!==l&&(i[r]={...i[r]??{},[e]:l})}return i}function a(e,t,r){return e.map(e=>{let i={...e};if(e.componentVariantVariableId){let n=e.componentVariantVariableId,o=r?.find(e=>e.id===n),s=t?.variant?.[n]??o?.default_value;s&&"object"==typeof s&&"variant_id"in s&&s.variant_id&&(i={...i,componentVariantId:s.variant_id})}let o=e.variables?.text?.id;if(o){let e=r?.find(e=>e.id===o),s=e?.type==="rich_text"?"rich_text":"text",l=t?.[s]?.[o],a=(0,n.normalizeComponentVariableValue)(l??e?.default_value);a&&"type"in a&&(i={...i,variables:{...i.variables,text:a},...void 0!==l?{_textFromOverride:!0}:{}})}let s=e.variables?.image?.src?.id;if(s){let e=t?.image?.[s],n=r?.find(e=>e.id===s),o=e??n?.default_value;o&&(i={...i,variables:{...i.variables,image:{...i.variables?.image,src:o.src?{...o.src,id:s}:i.variables?.image?.src,alt:o.alt??i.variables?.image?.alt}},attributes:{...i.attributes,...o.width&&{width:o.width},...o.height&&{height:o.height},...o.loading&&{loading:o.loading}},...void 0!==e?{_imageFromOverride:!0}:{}})}let d=e.variables?.link?.variable_id;if(d){let e=t?.link?.[d],n=r?.find(e=>e.id===d);if(void 0!==e||n){let t=void 0!==e?e:n?.default_value;if(t)i={...i,variables:{...i.variables,link:{...t,variable_id:d}}};else{let{link:e,...t}=i.variables??{};i={...i,variables:t}}}}let c=e.variables?.audio?.src?.id;if(c){let e=t?.audio?.[c],n=r?.find(e=>e.id===c),o=e??n?.default_value;if(o){let e={};void 0!==o.controls&&(e.controls=o.controls),void 0!==o.loop&&(e.loop=o.loop),void 0!==o.muted&&(e.muted=o.muted),void 0!==o.volume&&(e.volume=String(o.volume)),i={...i,variables:{...i.variables,audio:{...i.variables?.audio,src:o.src?{...o.src,id:c}:i.variables?.audio?.src}},...Object.keys(e).length>0&&{attributes:{...i.attributes,...e}}}}}let u=e.variables?.video?.src?.id;if(u){let e=t?.video?.[u],n=r?.find(e=>e.id===u),o=e??n?.default_value;if(o){let e={};void 0!==o.controls&&(e.controls=o.controls),void 0!==o.loop&&(e.loop=o.loop),void 0!==o.muted&&(e.muted=o.muted),void 0!==o.autoplay&&(e.autoplay=o.autoplay),void 0!==o.youtubePrivacyMode&&(e.youtubePrivacyMode=o.youtubePrivacyMode),i={...i,variables:{...i.variables,video:{...i.variables?.video,src:o.src?{...o.src,id:u}:i.variables?.video?.src,poster:o.poster??i.variables?.video?.poster}},...Object.keys(e).length>0&&{attributes:{...i.attributes,...e}}}}}let p=e.variables?.icon?.src?.id;if(p){let e=t?.icon?.[p],n=r?.find(e=>e.id===p),o=e??n?.default_value;o&&(i={...i,variables:{...i.variables,icon:{...i.variables?.icon,src:o.src?{...o.src,id:p}:i.variables?.icon?.src}}})}return i.componentOverrides?.variableLinks&&(i={...i,componentOverrides:l(i.componentOverrides,t,r)}),i.children&&(i.children=a(i.children,t,r)),i})}},584424,e=>{"use strict";var t=e.i(647163),n=e.i(284510);
1function r(e,t){return[e,t].filter(Boolean).join(", ")}let i="--bg-img(?:-[\\w]+)*",o=RegExp("^(?:bg-\\[image:var\\("+i+"\\)\\]|bg-\\("+i+"\\))$"),s="bg-[image:var(";function l(e){return s+e+")]"}function a(e){return e.startsWith(s)?e.slice(s.length,-2):e.startsWith("bg-(--bg-img")?e.slice(3,-1):null}function d(e){return!!(/^color:var\(--/.test(e)||/^var\(--/.test(e)||/^#?[0-9A-Fa-f]{3}$/.test(e)||/^#?[0-9A-Fa-f]{6}$/.test(e)||/^#?[0-9A-Fa-f]{8}$/.test(e)||/^rgba?\s*\(/i.test(e)||/^hsla?\s*\(/i.test(e))||!!["transparent","currentcolor","inherit","black","white","red","green","blue","yellow","purple","pink","gray","grey","orange","cyan","magenta","indigo","violet","brown","lime","teal","navy","maroon","olive"].includes(e.toLowerCase())||!/^-?\d*\.?\d+(px|rem|em|%|vh|vw|vmin|vmax|ch|ex|cm|mm|in|pt|pc)$/i.test(e)&&(/^-?\d*\.?\d+$/.test(e),!1)}function c(e,t,n=[]){return n.includes(e)?`${t}-${e}`:e.endsWith("px")?`${t}-[${e}]`:/^-?\d*\.?\d+$/.test(e)?`${t}-[${e}px]`:e.match(/^-/)||e.match(/^\.?\d/)?`${t}-[${e}]`:`${t}-${e}`}function u(e,t){return e.startsWith("-")?`-${t}-[${e.slice(1)}]`:`${t}-[${e}]`}function p(e){let t=e.startsWith("-")?e.slice(1):e;return/^\d*\.?\d+$/.test(t)?`${e}deg`:e}function h(e){return e.endsWith("deg")?e.slice(0,-3):e}function f(e){let t=e.startsWith("-")?e.slice(1):e;return/^\d*\.?\d+$/.test(t)?`${e}px`:e}function m(e){return e.replace(/^span\s+/i,"").trim()}let g=new Set(["block","inline-block","inline","flex","inline-flex","grid","inline-grid","hidden"]),y={display:/^(block|inline-block|inline|flex|inline-flex|grid|inline-grid|hidden)$/,flexDirection:/^flex-(row|row-reverse|col|col-reverse)$/,flexWrap:/^flex-(wrap|wrap-reverse|nowrap)$/,justifyContent:/^justify-(start|end|center|between|around|evenly|stretch)$/,alignItems:/^items-(start|end|center|baseline|stretch)$/,alignSelf:/^self-(auto|start|end|center|baseline|stretch)$/,alignContent:/^content-(start|end|center|between|around|evenly|stretch)$/,gap:/^gap-(\[.+\]|\d+|px|0\.5|1\.5|2\.5|3\.5)$/,columnGap:/^gap-x-(\[.+\]|\d+|px|0\.5|1\.5|2\.5|3\.5)$/,rowGap:/^gap-y-(\[.+\]|\d+|px|0\.5|1\.5|2\.5|3\.5)$/,gridTemplateColumns:/^grid-cols-(\[.+\]|\d+|none|subgrid)$/,gridTemplateRows:/^grid-rows-(\[.+\]|\d+|none|subgrid)$/,padding:/^p-(\[.+\]|\d+|px|0\.5|1\.5|2\.5|3\.5)$/,paddingX:/^px-(\[.+\]|\d+|px|0\.5|1\.5|2\.5|3\.5)$/,paddingY:/^py-(\[.+\]|\d+|px|0\.5|1\.5|2\.5|3\.5)$/,paddingTop:/^pt-(\[.+\]|\d+|px|0\.5|1\.5|2\.5|3\.5)$/,paddingRight:/^pr-(\[.+\]|\d+|px|0\.5|1\.5|2\.5|3\.5)$/,paddingBottom:/^pb-(\[.+\]|\d+|px|0\.5|1\.5|2\.5|3\.5)$/,paddingLeft:/^pl-(\[.+\]|\d+|px|0\.5|1\.5|2\.5|3\.5)$/,margin:/^m-(\[.+\]|\d+|px|auto|0\.5|1\.5|2\.5|3\.5)$/,marginX:/^mx-(\[.+\]|\d+|px|auto|0\.5|1\.5|2\.5|3\.5)$/,marginY:/^my-(\[.+\]|\d+|px|auto|0\.5|1\.5|2\.5|3\.5)$/,marginTop:/^mt-(\[.+\]|\d+|px|auto|0\.5|1\.5|2\.5|3\.5)$/,marginRight:/^mr-(\[.+\]|\d+|px|auto|0\.5|1\.5|2\.5|3\.5)$/,marginBottom:/^mb-(\[.+\]|\d+|px|auto|0\.5|1\.5|2\.5|3\.5)$/,marginLeft:/^ml-(\[.+\]|\d+|px|auto|0\.5|1\.5|2\.5|3\.5)$/,width:/^w-.+$/,height:/^h-.+$/,minWidth:/^min-w-.+$/,minHeight:/^min-h-.+$/,maxWidth:/^max-w-.+$/,maxHeight:/^max-h-.+$/,overflow:/^(truncate|overflow-(visible|hidden|clip|scroll|auto|x-visible|x-hidden|x-clip|x-scroll|x-auto|y-visible|y-hidden|y-clip|y-scroll|y-auto))$/,aspectRatio:/^aspect-(\[.+\]|auto|square|video)$/,objectFit:/^object-(contain|cover|fill|none|scale-down)$/,objectPosition:/^object-(left-top|right-top|left-bottom|right-bottom|top|bottom|left|right|center|\[.+\])$/,gridColumnSpan:/^col-span-(1|2|3|4|5|6|7|8|9|10|11|12|auto|full)$/,gridRowSpan:/^row-span-(1|2|3|4|5|6|7|8|9|10|11|12|auto|full)$/,fontFamily:/^font-(sans|serif|mono|\[.+\])$/,fontSize:/^text-(?!(?:left|center|right|justify|start|end|wrap|nowrap|balance|pretty|shadow)(?:-|\s|$)).+$/,fontWeight:/^font-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black|\[.+\])$/,lineHeight:/^leading-(none|tight|snug|normal|relaxed|loose|\d+|\[.+\])$/,letterSpacing:/^tracking-(tighter|tight|normal|wide|wider|widest|\[.+\]|.+)$/,textAlign:/^text-(left|center|right|justify|start|end)$/,textWrap:/^text-(wrap|nowrap|balance|pretty
1)$/,fontVariantNumeric:/^(normal-nums|ordinal|slashed-zero|lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions)$/,textTransform:/^(uppercase|lowercase|capitalize|normal-case)$/,textDecoration:/^(underline|overline|line-through|no-underline)$/,textDecorationColor:/^decoration-\[.+\](\/\d+)?$/,textDecorationThickness:/^decoration-(\d+|auto|from-font|\[(?!#|rgb|hsl).+\])$/,underlineOffset:/^underline-offset-.+$/,lineClamp:/^line-clamp-(none|\d+|\[.+\])$/,color:/^text-(?!(?:xs|sm|base|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl|8xl|9xl|left|center|right|justify|start|end|wrap|nowrap|balance|pretty|shadow)(?:-|\s|$)).+(\/\d+)?$/,placeholderColor:/^placeholder:text-.+(\/\d+)?$/,textShadow:/^text-shadow(-none|-2xs|-xs|-sm|-md|-lg|-\[.+\])?$/,backgroundColor:/^bg-(?!(?:auto|cover|contain|bottom|center|left|left-bottom|left-top|right|right-bottom|right-top|top|repeat|no-repeat|repeat-x|repeat-y|repeat-round|repeat-space|none|gradient-to-t|gradient-to-tr|gradient-to-r|gradient-to-br|gradient-to-b|gradient-to-bl|gradient-to-l|gradient-to-tl)$)((\w+)(-\d+)?|\[.+\](?:\/\d+)?)$/,backgroundSize:/^bg-(auto|cover|contain|\[.+\])$/,backgroundPosition:/^bg-(bottom|center|left|left-bottom|left-top|right|right-bottom|right-top|top|\[.+\])$/,backgroundRepeat:/^bg-(repeat|no-repeat|repeat-x|repeat-y|repeat-round|repeat-space)$/,backgroundImage:/^bg-(none|gradient-to-t|gradient-to-tr|gradient-to-r|gradient-to-br|gradient-to-b|gradient-to-bl|gradient-to-l|gradient-to-tl|\[.+\])$/,backgroundClip:/^bg-clip-(text|border|padding|content)$/,borderWidth:/^border(-\d+|-\[(?!#|rgb|color:var|var\().+\])?$/,borderTopWidth:/^border-t(-\d+|-\[(?!#|rgb|color:var|var\().+\])?$/,borderRightWidth:/^border-r(-\d+|-\[(?!#|rgb|color:var|var\().+\])?$/,borderBottomWidth:/^border-b(-\d+|-\[(?!#|rgb|color:var|var\().+\])?$/,borderLeftWidth:/^border-l(-\d+|-\[(?!#|rgb|color:var|var\().+\])?$/,borderStyle:/^border-(solid|dashed|dotted|double|hidden|none)$/,borderColor:/^border-(?!(?:solid|dashed|dotted|double|hidden|none|collapse|separate)$)(?!t-|r-|b-|l-|x-|y-|spacing)((\w+)(-\d+)?|\[(?:#|rgb|color:var|var\().+\])(\/\d+)?$/,borderRadius:/^rounded(-none|-sm|-md|-lg|-xl|-2xl|-3xl|-full|-\[.+\])?$/,borderTopLeftRadius:/^rounded-tl(-none|-sm|-md|-lg|-xl|-2xl|-3xl|-full|-\[.+\])?$/,borderTopRightRadius:/^rounded-tr(-none|-sm|-md|-lg|-xl|-2xl|-3xl|-full|-\[.+\])?$/,borderBottomRightRadius:/^rounded-br(-none|-sm|-md|-lg|-xl|-2xl|-3xl|-full|-\[.+\])?$/,borderBottomLeftRadius:/^rounded-bl(-none|-sm|-md|-lg|-xl|-2xl|-3xl|-full|-\[.+\])?$/,divideX:/^divide-x(-\d+|-\[(?!#|rgb|color:var|var\().+\])?$/,divideY:/^divide-y(-\d+|-\[(?!#|rgb|color:var|var\().+\])?$/,divideStyle:/^divide-(solid|dashed|dotted|double|none)$/,divideColor:/^divide-((\w+)(-\d+)?|\[(?:#|rgb|color:var|var\().+\])(\/\d+)?$/,outlineWidth:/^outline(-\d+|-\[(?!#|rgb|color:var|var\().+\])?$/,outlineColor:/^outline-((\w+)(-\d+)?|\[(?:#|rgb|color:var|var\().+\])(\/\d+)?$/,outlineOffset:/^outline-offset-(\d+|-?\[.+\])$/,opacity:/^opacity-(\d+|\[.+\])$/,boxShadow:/^shadow(-none|-sm|-md|-lg|-xl|-2xl|-inner|-\[.+\])?$/,blur:/^blur(-none|-sm|-md|-lg|-xl|-2xl|-3xl|-\[.+\])?$/,backdropBlur:/^backdrop-blur(-none|-sm|-md|-lg|-xl|-2xl|-3xl|-\[.+\])?$/,mixBlendMode:/^mix-blend-(normal|multiply|screen|overlay|darken|lighten|color-dodge|color-burn|hard-light|soft-light|difference|exclusion|hue|saturation|color|luminosity)$/,cursor:/^cursor-.+$/,position:/^(static|fixed|absolute|relative|sticky)$/,top:/^top-(\[.+\]|\d+|px|auto|0\.5|1\.5|2\.5|3\.5)$/,right:/^right-(\[.+\]|\d+|px|auto|0\.5|1\.5|2\.5|3\.5)$/,bottom:/^bottom-(\[.+\]|\d+|px|auto|0\.5|1\.5|2\.5|3\.5)$/,left:/^left-(\[.+\]|\d+|px|auto|0\.5|1\.5|2\.5|3\.5)$/,zIndex:/^z-(\[.+\]|\d+|auto)$/,scale:/^scale-(\[.+\]|\d+)$/,rotate:/^-?rotate-(\[.+\]|\d+)$/,translateX:/^-?translate-x-(\[.+\]|\d+\/\d+|\d+|px|full)$/,translateY:/^-?translate-y-(\[.+\]|\d+\/\d+|\d+|px|full)$/,skewX:/^-?skew-x-(\[.+\]|\d+)$/,skewY:/^-?skew-y-(\[.+\]|\d+)$/,transformOrigin:/^origin-(center|top|top-right|right|bottom-right|bottom|bottom-left|left|top-left)$/,transitionProperty:/^transition(-all|-colors|-opacity|-shadow|-transform|-none)?$/,duration:/^duration-(\[.+\]|\d+)$/,easing:/^ease-(linear|in|out|in-out)$/,delay:/^delay-(\[.+\]|\d+)$/},b={padding:["paddingX","paddingY","paddingTop","paddingRight","paddingBottom","paddingLeft"],margin:["marginX","marginY","marginTop","marginRight","marginBottom","marginLeft"],paddingX:["paddingLeft","paddingRight"],paddingY:["paddingTop","paddingBottom"],marginX:["marginLeft","marginRight"],marginY:["marginTop","marginBottom"]},v={paddingTop:["paddingY","padding"],paddingBottom:["paddingY","padding"],paddingLeft:["paddingX","padding"],paddingRight:["paddingX","padding"],marginTop:["marginY","margin"],marginBottom:["marginY","margin"],marginLeft:["marginX","margin"],marginRight:["marginX","margin"]},x={paddingX:["paddingLeft","paddingRight"],paddingY:["paddingTop","paddingBottom"],padding:["paddingTop","paddingRight","paddingBottom","paddingLeft"],marginX:["marginLeft","marginRight"],marginY:["marginTop","marginBottom"],margin:["marginTop","marginRight","marginBottom","marginLeft"]},w={paddingTop:"paddingY",paddingBottom:"paddingY",paddingLeft:"paddingX",paddingRight:"paddingX",marginTop:"marginY",marginBottom:"marginY",marginLeft:"marginX",marginRight:"marginX"},k=new Set(["padding","margin"]),S=new Set([...Object.keys(x),...Object.keys(w)]);function T(e){for(let t of S)if(y[t].test(e))return t;return null}function C(e){let t=new Map;
1return e.forEach(e=>{let{breakpoint:n,uiState:r,baseClass:i}=$(e),o=T(i);if(!o)return;let s=`${n}|${r}`;t.has(s)||t.set(s,new Set),t.get(s).add(o)}),e.filter(e=>{let n,{breakpoint:r,uiState:i,baseClass:o}=$(e),s=T(o);if(!s||!x[s])return!0;let l=t.get(`${r}|${i}`);return!l||(n=k.has(s),!x[s].every(e=>l.has(e)||n&&l.has(w[e])))})}function _(e){return y[e]||null}function M(e){let t=e.match(/\[([^\]]+)\]/);return t?t[1]:null}function A(e){let t=e.match(/\[([^\]]+)\](?:\/(\d+))?/);if(!t)return null;let n=t[1],r=t[2];return r?`${n}/${r}`:n}function E(e,t){let n=_(t);return n?e.filter(e=>{let r=e.replace(/^(max-lg:|max-md:|lg:|md:)?(hover:|focus:|active:|disabled:|visited:|current:)?/,"");if("color"===t){if(r.startsWith("bg-[")){let e=M(r);if(e&&e.includes("gradient("))return!1}if("bg-clip-text"===r||"text-transparent"===r)return!1}if(!n.test(r))return!0;if(r.startsWith("text-[")){let e=M(r);if(e){let n=d(e);if("fontSize"===t&&n||"color"===t&&!n)return!0}}if(r.startsWith("font-[")){let e=M(r);if(e){let n=/^\d/.test(e);if("fontWeight"===t&&!n||"fontFamily"===t&&n)return!0}}if(o.test(r))return"backgroundColor"===t||"backgroundImage"!==t;if(r.startsWith("bg-[")){let e=M(r);if(e){let n=R(e);if("backgroundColor"===t&&n||"backgroundImage"===t&&!n)return!0}}return!1}):e}function O(e){let t=e.replace(/^(max-lg:|max-md:|lg:|md:)?(hover:|focus:|active:|disabled:|visited:|current:)?/,"");return/^(text|bg|border|ring|outline|decoration|shadow|from|via|to|caret|accent|divide|placeholder)-(slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)(-\d+)?$/.test(t)}function N(e,t,n){if(!n)return null;if("layout"===e)switch(t){case"display":{let e="none"===n.toLowerCase()?"hidden":n.toLowerCase();return g.has(e)?e:null}case"flexDirection":if("row"===n)return"flex-row";if("column"===n)return"flex-col";if("row-reverse"===n)return"flex-row-reverse";if("column-reverse"===n)return"flex-col-reverse";return`flex-${n}`;case"flexWrap":if("wrap"===n)return"flex-wrap";if("nowrap"===n)return"flex-nowrap";if("wrap-reverse"===n)return"flex-wrap-reverse";return null;case"justifyContent":return`justify-${({"flex-start":"start","flex-end":"end","space-between":"between","space-around":"around","space-evenly":"evenly"})[n]||n}`;case"alignItems":return`items-${({"flex-start":"start","flex-end":"end"})[n]||n}`;case"alignSelf":return`self-${({"flex-start":"start","flex-end":"end"})[n]||n}`;case"alignContent":return`content-${({"flex-start":"start","flex-end":"end","space-between":"between","space-around":"around","space-evenly":"evenly"})[n]||n}`;case"gap":return c(n,"gap");case"columnGap":return c(n,"gap-x");case"rowGap":return c(n,"gap-y");case"gridTemplateColumns":return`grid-cols-[${n.replace(/\s+/g,"_")}]`;case"gridTemplateRows":return`grid-rows-[${n.replace(/\s+/g,"_")}]`}if("typography"===e)switch(t){case"fontSize":return c(n,"text");case"fontWeight":return n.match(/^\d/)?`font-[${n}]`:`font-${n}`;case"fontFamily":if(["sans","serif","mono"].includes(n))return`font-${n}`;return`font-[${n.replace(/\s+/g,"_")}]`;case"lineHeight":return n.match(/^\.?\d/)?`leading-[${n}]`:`leading-${n}`;case"letterSpacing":if(n.match(/^-?\.?\d/))return/[a-z%]$/i.test(n)?`tracking-[${n}]`:`tracking-[${n}em]`;return`tracking-${n}`;case"textAlign":case"textWrap":return`text-${n}`;case"fontVariantNumeric":return"normal"===n?"normal-nums":n;case"textTransform":if("none"===n)return"normal-case";return n;case"textDecoration":if("none"===n)return"no-underline";return n;case"textDecorationColor":if(n.startsWith("color:var("))return`decoration-[${n}]`;if(n.startsWith("var("))return`decoration-[color:${n}]`;if(n.match(/^#|^rgb|^hsl/)){let e=n.split("/");if(2===e.length)return`decoration-[${e[0]}]/${e[1]}`;return`decoration-[${n}]`}return`decoration-${n}`;case"textDecorationThickness":return c(n,"decoration");case"underlineOffset":return c(n,"underline-offset");case"lineClamp":if("none"===n)return"line-clamp-none";if(/^\d+$/.test(n))return`line-clamp-${n}`;return`line-clamp-[${n}]`;case"textShadow":if("none"===n)return"text-shadow-none";if(["2xs","xs","sm","md","lg"].includes(n))return`text-shadow-${n}`;return`text-shadow-[${n.replace(/\s+/g,"_")}]`;case"color":if(n.includes("gradient("))return`bg-[${n}] bg-clip-text text-transparent`;if(n.startsWith("color:var("))return`text-[${n}]`;if(n.startsWith("var("))return`text-[color:${n}]`;if(n.match(/^#|^rgb/)){let e=n.split("/");if(2===e.length)return`text-[${e[0]}]/${e[1]}`;return`text-[${n}]`}return`text-${n}`;case"placeholderColor":if(n.startsWith("color:var("))return`placeholder:text-[${n}]`;if(n.startsWith("var("))return`placeholder:text-[color:${n}]`;if(n.match(/^#|^rgb/)){let e=n.split("/");if(2===e.length)return`placeholder:text-[${e[0]}]/${e[1]}`;return`placeholder:text-[${n}]`}return`placeholder:text-${n}`}if("spacing"===e){let e={padding:"p",paddingTop:"pt",paddingRight:"pr",paddingBottom:"pb",paddingLeft:"pl",margin:"m",marginTop:"mt",marginRight:"mr",marginBottom:"mb",marginLeft:"ml"}[t];if(e)return t.startsWith("margin")?c(n,e,["auto"]):c(n,e)}if("sizing"===e){let e={width:"w",height:"h",minWidth:"min-w",minHeight:"min-h",maxWidth:"max-w",maxHeight:"max-h"}[t];if(e){if("100%"===n)return`${e}-full`;let t=n.match(/^(\d+)\/([1-9]\d*)$/);return t?t[1]===t[2]?`${e}-full`:`${e}-${n}`:c(n,e,["auto","full","screen","min","max","fit","none"])}if("overflow"===t)return"ellipsis"===n?"truncate":`overflow-${n}`;if("aspectRatio"===t)return`aspect-${n}`;if("objectFit"===t||"objectPosition"===t)return`object-${n}`;if("gridColumnSpan"===t){let e=m(n);
1return"full"===e?"col-span-full":`col-span-${e}`}if("gridRowSpan"===t){let e=m(n);return"full"===e?"row-span-full":`row-span-${e}`}}if("borders"===e)switch(t){case"borderWidth":if("1px"===n)return"border";return c(n,"border");case"borderTopWidth":if("1px"===n)return"border-t";return c(n,"border-t");case"borderRightWidth":if("1px"===n)return"border-r";return c(n,"border-r");case"borderBottomWidth":if("1px"===n)return"border-b";return c(n,"border-b");case"borderLeftWidth":if("1px"===n)return"border-l";return c(n,"border-l");case"borderStyle":return`border-${n}`;case"borderColor":if(n.startsWith("color:var("))return`border-[${n}]`;if(n.startsWith("var("))return`border-[color:${n}]`;if(n.match(/^#|^rgb/)){let e=n.split("/");if(2===e.length)return`border-[${e[0]}]/${e[1]}`;return`border-[${n}]`}return`border-${n}`;case"borderRadius":return c(n,"rounded");case"borderTopLeftRadius":return c(n,"rounded-tl");case"borderTopRightRadius":return c(n,"rounded-tr");case"borderBottomRightRadius":return c(n,"rounded-br");case"borderBottomLeftRadius":return c(n,"rounded-bl");case"divideX":if("1px"===n)return"divide-x";return c(n,"divide-x");case"divideY":if("1px"===n)return"divide-y";return c(n,"divide-y");case"divideStyle":return`divide-${n}`;case"divideColor":if(n.startsWith("color:var("))return`divide-[${n}]`;if(n.startsWith("var("))return`divide-[color:${n}]`;if(n.match(/^#|^rgb/)){let e=n.split("/");if(2===e.length)return`divide-[${e[0]}]/${e[1]}`;return`divide-[${n}]`}return`divide-${n}`;case"outlineWidth":return c(n,"outline");case"outlineColor":if(n.startsWith("color:var("))return`outline-[${n}]`;if(n.startsWith("var("))return`outline-[color:${n}]`;if(n.match(/^#|^rgb/)){let e=n.split("/");if(2===e.length)return`outline-[${e[0]}]/${e[1]}`;return`outline-[${n}]`}return`outline-${n}`;case"outlineOffset":return c(n,"outline-offset")}if("backgrounds"===e)switch(t){case"backgroundColor":if(n.startsWith("color:var("))return`bg-[${n}]`;if(n.startsWith("var("))return`bg-[color:${n}]`;if(n.match(/^#|^rgb|gradient\(/)){let e=n.split("/");if(2===e.length&&!n.includes("gradient("))return`bg-[${e[0]}]/${e[1]}`;return`bg-[${n}]`}return`bg-${n}`;case"backgroundImage":if(n.startsWith("--bg-img"))return l(n);if(n.startsWith("url("))return`bg-[${n}]`;return`bg-${n}`;case"backgroundSize":case"backgroundPosition":return`bg-${n}`;case"backgroundRepeat":if("no-repeat"===n)return"bg-no-repeat";return`bg-${n}`;case"backgroundClip":return`bg-clip-${n}`}if("effects"===e)switch(t){case"opacity":{let e=n.includes(".")?Math.round(100*parseFloat(n)).toString():n;return`opacity-[${e}%]`}case"boxShadow":if("none"===n)return"shadow-none";if(["sm","md","lg","xl","2xl","inner"].includes(n))return`shadow-${n}`;return`shadow-[${n.replace(/\s+/g,"_")}]`;case"blur":if("none"===n)return"blur-none";if(["sm","md","lg","xl","2xl","3xl"].includes(n))return`blur-${n}`;return`blur-[${n}]`;case"backdropBlur":if("none"===n)return"backdrop-blur-none";if(["sm","md","lg","xl","2xl","3xl"].includes(n))return`backdrop-blur-${n}`;return`backdrop-blur-[${n}]`;case"mixBlendMode":if("normal"===n)return"";return`mix-blend-${n}`;case"cursor":return`cursor-${n}`}if("positioning"===e)switch(t){case"position":return n;case"top":case"right":case"bottom":case"left":return c(n,t,["auto"]);case"zIndex":if("auto"===n)return"z-auto";return n.match(/^\d/)?`z-[${n}]`:`z-${n}`}if("transforms"===e)switch(t){case"scale":if(!isNaN(parseFloat(n)))return`scale-[${n}]`;return`scale-${n}`;case"rotate":return u(p(n),"rotate");case"translateX":if("full"===n)return"translate-x-full";return u(f(n),"translate-x");case"translateY":if("full"===n)return"translate-y-full";return u(f(n),"translate-y");case"skewX":return u(p(n),"skew-x");case"skewY":return u(p(n),"skew-y");case"transformOrigin":return`origin-${n}`}if("transitions"===e)switch(t){case"transitionProperty":if("none"===n)return"transition-none";if("all"===n)return"transition-all";if(["colors","opacity","shadow","transform"].includes(n))return`transition-${n}`;return"transition";case"duration":case"delay":{let e="duration"===t?"duration":"delay",r=n.replace(/^-/,"");if(/^\d*\.?\d+$/.test(r))return`${e}-[${n}ms]`;return`${e}-[${n}]`}case"easing":return`ease-${n}`}return null}function D(e){let t=[],n=e.replace(/^(max-lg:|max-md:|lg:|md:)?(hover:|focus:|active:|disabled:|visited:|current:)?/,"");if(n.startsWith("bg-clip-"))return t.push("backgroundClip"),"bg-clip-text"===n&&t.push("color"),t;if(n.startsWith("text-shadow"))return t.push("textShadow"),t;if("text-transparent"===n)return t.push("color"),t;
1if(O(n)){if(n.startsWith("text-"))return t.push("color"),t;if(n.startsWith("bg-"))return t.push("backgroundColor"),t;if(n.startsWith("border-"))return t.push("borderColor"),t}if(n.startsWith("text-[")){let e=M(n);if(e)return d(e)?t.push("color"):t.push("fontSize"),t}if(n.startsWith("font-[")){let e=M(n);if(e)return t.push(/^\d/.test(e)?"fontWeight":"fontFamily"),t}if(o.test(n))return t.push("backgroundImage"),t;if(n.startsWith("bg-[")){let e=M(n);if(e){let n=R(e);return e.includes("gradient(")?t.push("backgroundColor"):n?t.push("backgroundImage"):t.push("backgroundColor"),t}}for(let[n,r]of Object.entries(y))r.test(e)&&t.push(n);return t}let I={neutral:{prefix:""},hover:{prefix:"hover:"},focus:{prefix:"focus:"},active:{prefix:"active:"},disabled:{prefix:"disabled:"},current:{prefix:"current:"}};function $(e){let t=e,n="desktop",r="neutral";return t.startsWith("max-md:")?(n="mobile",t=t.slice(7)):t.startsWith("max-lg:")?(n="tablet",t=t.slice(7)):t.startsWith("lg:")?(n="desktop",t=t.slice(3)):t.startsWith("md:")&&(n="tablet",t=t.slice(3)),t.startsWith("hover:")?(r="hover",t=t.slice(6)):t.startsWith("focus:")?(r="focus",t=t.slice(6)):t.startsWith("active:")?(r="active",t=t.slice(7)):t.startsWith("disabled:")?(r="disabled",t=t.slice(9)):t.startsWith("current:")?(r="current",t=t.slice(8)):t.startsWith("visited:")&&(r="current",t=t.slice(8)),{breakpoint:n,uiState:r,baseClass:t}}function R(e){return!!(e.startsWith("url(")||e.includes("http://")||e.includes("https://")||e.includes("data:")||e.includes("gradient(")||e.includes("linear-gradient")||e.includes("radial-gradient")||e.includes("conic-gradient"))||(d(e),!1)}function P(e,t,n){let r=e.replace(/^(max-lg:|max-md:|lg:|md:)?(hover:|focus:|active:|disabled:|visited:|current:)?/,"");if(r.startsWith("text-shadow"))return"textShadow"===t;if("color"===t){if(r.startsWith("bg-[")){let e=M(r);if(e&&e.includes("gradient("))return!0}if("bg-clip-text"===r)return!1;if("text-transparent"===r)return!0}if("fontSize"===t){if("text-transparent"===r||"bg-clip-text"===r)return!1;if(r.startsWith("bg-[")){let e=M(r);if(e&&e.includes("gradient("))return!1}}if(!n.test(r))return!1;if(r.startsWith("font-[")){let e=M(r);if(e){let n=/^\d/.test(e);if("fontWeight"===t&&!n||"fontFamily"===t&&n)return!1}}if(r.startsWith("text-[")){let e=M(r);if(e){let n=d(e);if("fontSize"===t&&n||"color"===t&&!n)return!1}}if(o.test(r))return"backgroundImage"===t;if(r.startsWith("bg-[")){let e=M(r);if(e){let n=R(e),r=e.includes("gradient(")||e.includes("linear-gradient")||e.includes("radial-gradient")||e.includes("conic-gradient");if("color"===t&&r)return!0;if("backgroundColor"===t)return!n||!!r;if("backgroundImage"===t)return!r&&!!n;if(("backgroundSize"===t||"backgroundPosition"===t||"backgroundRepeat"===t)&&n)return!1}}return!0}e.s(["buildBgImgClass",0,l,"buildBgImgVarName",0,function(e,t){let n=["--bg-img"];return"desktop"!==e&&n.push(e),"neutral"!==t&&n.push(t),n.join("-")},"classesToDesign",0,function(e){let t=Array.isArray(e)?e:e.split(" ").filter(Boolean),n={layout:{},typography:{},spacing:{},sizing:{},borders:{},backgrounds:{},effects:{},positioning:{},transforms:{},transitions:{}},r=t.includes("bg-clip-text"),i=t.includes("text-transparent"),s=t.find(e=>e.startsWith("bg-[")&&M(e)?.includes("gradient("));if(r&&i&&s){let e=M(s);e&&(n.typography.color=e.replace(/_/g," "))}return t.forEach(e=>{if(e.match(/^(hover|focus|active|disabled|visited|current):/)||e.match(/^(max-lg|max-md|lg|md):(hover|focus|active|disabled|visited|current):/))return;if("block"===(e=e.replace(/^(max-lg|max-md|lg|md):/,""))&&(n.layout.display="block"),"inline-block"===e&&(n.layout.display="inline-block"),"inline"===e&&(n.layout.display="inline"),"flex"===e&&(n.layout.display="flex"),"inline-flex"===e&&(n.layout.display="inline-flex"),"grid"===e&&(n.layout.display="grid"),"inline-grid"===e&&(n.layout.display="inline-grid"),"hidden"===e&&(n.layout.display="hidden"),"flex-row"===e&&(n.layout.flexDirection="row"),"flex-row-reverse"===e&&(n.layout.flexDirection="row-reverse"),"flex-col"===e&&(n.layout.flexDirection="column"),"flex-col-reverse"===e&&(n.layout.flexDirection="column-reverse"),e.startsWith("justify-")){let t=e.replace("justify-","");["start","end","center","between","around","evenly","stretch"].includes(t)&&(n.layout.justifyContent=t)}if(e.startsWith("items-")){let t=e.replace("items-","");["start","end","center","baseline","stretch"].includes(t)&&(n.layout.alignItems=t)}if(e.startsWith("self-")){let t=e.replace("self-","");["auto","start","end","center","baseline","stretch"].includes(t)&&(n.layout.alignSelf=t)}if(e.startsWith("gap-[")){let t=M(e);t&&(n.layout.gap=t)}if(e.startsWith("grid-cols-[")){let t=M(e);t&&(n.layout.gridTemplateColumns=t.replace(/_/g," "))}if(e.startsWith("grid-rows-[")){let t=M(e);t&&(n.layout.gridTemplateRows=t.replace(/_/g," "))}if(e.startsWith("text-[")){let t=A(e);if(t&&d(t.split("/")[0])){n.typography.color=t;return}}if(e.startsWith("text-[")){let t=M(e);t&&(n.typography.fontSize=t)}if(e.startsWith("font-[")&&!e.includes("sans")&&!e.includes("serif")&&!e.includes("mono")){let t=M(e);t&&(n.typography.fontWeight=t)}if("font-thin"===e&&(n.typography.fontWeight="100"),"font-extralight"===e&&(n.typography.fontWeight="200"),"font-light"===e&&(n.typography.fontWeight="300"),"font-normal"===e&&(n.typography.fontWeight="400"),"font-medium"===e&&(n.typography.fontWeight="500"),"font-semibold"===e&&(n.typography.fontWeight="600"),"font-bold"===e&&(n.typography.fontWeight="700"),"font-extrabold"===e&&(n.typography.fontWeight="800"),"font-black"===e&&(n.typography.fontWeight="900"),e.startsWith("font-[")&&!e.match(/^font-\[\d/)){let t=M(e);t&&(n.typography.fontFamily=t.replace(/_/g," "))}if("font-sans"===e&&(n.typography.fontFamily="sans"),"font-serif"===e&&(n.typography.fontFamily="serif"),"font-mono"===e&&(n.typography.fontFamily="mono"),"text-left"===e&&(n.typography.textAlign="left"),"text-center"===e&&(n.typography.textAlign="center"),"text-right"===e&&(n.typography.textAlign="right"),"text-justify"===e&&(n.typography.textAlign="justify"),"text-wrap"===e&&(n.typography.textWrap="wrap"),"text-nowrap"===e&&(n.typography.textWrap="nowrap"),"text-balance"===e&&(n.typography.textWrap="balance"),"text-pretty"===e&&(n.typography.textWrap="pretty"),y.fontVariantNumeric.test(e)&&(n.typography.fontVariantNumeric="normal-nums"===e?"normal":e),"uppercase"===e&&(n.typography.textTransform="uppercase"),"lowercase"===e&&(n.typography.textTransform="lowercase"),"capitalize"===e&&(n.typography.textTransform="capitalize"),"normal-case"===e&&(n.typography.textTransform="none"),"underline"===e&&(n.typography.textDecoration="underline"),"line-through"===e&&(n.typography.textDecoration="line-through"),"no-underline"===e&&(n.typography.textDecoration="none"),e.startsWith("decoration-[")){let t=A(e);t&&d(t.split("/")[0])&&(n.typography.textDecorationColor=t)}if(e.startsWith("decoration-[")){let t=M(e);t&&!d(t)&&(n.typography.textDecorationThickness=t)}if(e.startsWith("underline-offset-[")){let t=M(e);t&&(n.typography.underlineOffset=t)}if("line-clamp-none"===e)n.typography.lineClamp="none";else if(/^line-clamp-\d+$/.test(e))n.typography.lineClamp=e.slice(11);else if(e.startsWith("line-clamp-[")){let t=M(e);t&&(n.typography.lineClamp=t)}if(e.startsWith("text-shadow-[")){let t=M(e);t&&(n.typography.textShadow=t)}else if("text-shadow-none"===e)n.typography.textShadow="none";else if(e.match(/^text-shadow-(2xs|xs|sm|md|lg)$/)){let t=e.match(/^text-shadow-(.+)$/);t&&(n.typography.textShadow=t[1])}if(e.startsWith("leading-[")){let t=M(e);t&&(n.typography.lineHeight=t)}if(e.startsWith("tracking-[")){let t=M(e);t&&(n.typography.letterSpacing=t)}if(e.startsWith("placeholder:text-[")){let t=A(e);t&&(n.typography.placeholderColor=t)}if(e.startsWith("p-[")){let t=M(e);t&&(n.spacing.padding=t)}else if(e.startsWith("pt-[")){let t=M(e);t&&(n.spacing.paddingTop=t)}else if(e.startsWith("pr-[")){let t=M(e);t&&(n.spacing.paddingRight=t)}else if(e.startsWith("pb-[")){let t=M(e);t&&(n.spacing.paddingBottom=t)}else if(e.startsWith("pl-[")){let t=M(e);t&&(n.spacing.paddingLeft=t)}if(e.startsWith("m-[")){let t=M(e);t&&(n.spacing.margin=t)}else if(e.startsWith("mt-[")){let t=M(e);t&&(n.spacing.marginTop=t)}else if(e.startsWith("mr-[")){let t=M(e);t&&(n.spacing.marginRight=t)}else if(e.startsWith("mb-[")){let t=M(e);t&&(n.spacing.marginBottom=t)}else if(e.startsWith("ml-[")){let t=M(e);t&&(n.spacing.marginLeft=t)}if(e.startsWith("w-"))if(e.startsWith("w-[")){let t=M(e);t&&(n.sizing.width=t)}else if("w-full"===e)n.sizing.width="100%";else{let t=e.slice(2);t&&(n.sizing.width=t)}if(e.startsWith("h-"))if(e.startsWith("h-[")){let t=M(e);t&&(n.sizing.height=t)}else if("h-full"===e)n.sizing.height="100%";else{let t=e.slice(2);t&&(n.sizing.height=t)}if(e.startsWith("min-w-"))if(e.startsWith("min-w-[")){let t=M(e);t&&(n.sizing.minWidth=t)}else{let t=e.slice(6);"full"===t?n.sizing.minWidth="100%":t&&(n.sizing.minWidth=t)}if(e.startsWith("min-h-"))if(e.startsWith("min-h-[")){let t=M(e);t&&(n.sizing.minHeight=t)}else{let t=e.slice(6);"full"===t?n.sizing.minHeight="100%":t&&(n.sizing.minHeight=t)}if(e.startsWith("max-w-"))if(e.startsWith("max-w-[")){let t=M(e);t&&(n.sizing.maxWidth=t)}else{let t=e.slice(6);"full"===t?n.sizing.maxWidth="100%":t&&(n.sizing.maxWidth=t)}if(e.startsWith("max-h-"))if(e.startsWith("max-h-[")){let t=M(e);t&&(n.sizing.maxHeight=t)}else{let t=e.slice(6);"full"===t?n.sizing.maxHeight="100%":t&&(n.sizing.maxHeight=t)}if(e.startsWith("aspect-"))if(e.startsWith("aspect-[")){let t=M(e);t&&(n.sizing.aspectRatio=`[${t}]`)}
1else"aspect-square"===e?n.sizing.aspectRatio="[1/1]":"aspect-video"===e?n.sizing.aspectRatio="[16/9]":"aspect-auto"===e&&(n.sizing.aspectRatio=null);if(e.startsWith("object-")){let t=e.match(/^object-(contain|cover|fill|none|scale-down)$/);t&&(n.sizing.objectFit=t[1]);let r=e.match(/^object-(left-top|right-top|left-bottom|right-bottom|top|bottom|left|right|center|\[.+\])$/);r&&(n.sizing.objectPosition=r[1])}if(e.startsWith("col-span-")){let t=e.match(/^col-span-(1|2|3|4|5|6|7|8|9|10|11|12|auto|full)$/);t&&(n.sizing.gridColumnSpan=t[1])}if(e.startsWith("row-span-")){let t=e.match(/^row-span-(1|2|3|4|5|6|7|8|9|10|11|12|auto|full)$/);t&&(n.sizing.gridRowSpan=t[1])}if("truncate"===e)n.sizing.overflow="ellipsis";else if(e.startsWith("overflow-")){let t=e.match(/^overflow-(visible|hidden|clip|scroll|auto|x-visible|x-hidden|x-clip|x-scroll|x-auto|y-visible|y-hidden|y-clip|y-scroll|y-auto)$/);t&&(n.sizing.overflow=t[1])}if(e.startsWith("rounded-[")){let t=M(e);t&&(n.borders.borderRadius=t)}else if(e.startsWith("rounded-tl-[")){let t=M(e);t&&(n.borders.borderTopLeftRadius=t)}else if(e.startsWith("rounded-tr-[")){let t=M(e);t&&(n.borders.borderTopRightRadius=t)}else if(e.startsWith("rounded-br-[")){let t=M(e);t&&(n.borders.borderBottomRightRadius=t)}else if(e.startsWith("rounded-bl-[")){let t=M(e);t&&(n.borders.borderBottomLeftRadius=t)}if(e.startsWith("border-[")&&!e.includes("#")&&!e.includes("rgb")&&!e.includes("var(")){let t=M(e);t&&(n.borders.borderWidth=t)}if("border-solid"===e&&(n.borders.borderStyle="solid"),"border-dashed"===e&&(n.borders.borderStyle="dashed"),"border-dotted"===e&&(n.borders.borderStyle="dotted"),"border-double"===e&&(n.borders.borderStyle="double"),"border-none"===e&&(n.borders.borderStyle="none"),e.startsWith("border-[#")||e.startsWith("border-[rgb")||e.startsWith("border-[color:var(")||e.startsWith("border-[var(")){let t=A(e);t&&(n.borders.borderColor=t)}if(!e.startsWith("divide-x-[")||e.includes("#")||e.includes("rgb"))"divide-x"===e&&(n.borders.divideX="1px");else{let t=M(e);t&&(n.borders.divideX=t)}if(!e.startsWith("divide-y-[")||e.includes("#")||e.includes("rgb"))"divide-y"===e&&(n.borders.divideY="1px");else{let t=M(e);t&&(n.borders.divideY=t)}if("divide-solid"===e&&(n.borders.divideStyle="solid"),"divide-dashed"===e&&(n.borders.divideStyle="dashed"),"divide-dotted"===e&&(n.borders.divideStyle="dotted"),"divide-double"===e&&(n.borders.divideStyle="double"),"divide-none"===e&&(n.borders.divideStyle="none"),e.startsWith("divide-[#")||e.startsWith("divide-[rgb")||e.startsWith("divide-[color:var(")||e.startsWith("divide-[var(")){let t=A(e);t&&(n.borders.divideColor=t)}if(!e.startsWith("outline-[")||e.includes("#")||e.includes("rgb")||e.includes("var("))e.match(/^outline-\d+$/)&&(n.borders.outlineWidth=e.replace("outline-","")+"px");else{let t=M(e);t&&(n.borders.outlineWidth=t)}if(e.startsWith("outline-[#")||e.startsWith("outline-[rgb")||e.startsWith("outline-[color:var(")||e.startsWith("outline-[var(")){let t=A(e);t&&(n.borders.outlineColor=t)}if(e.startsWith("outline-offset-")){let t=M(e)||e.replace("outline-offset-","")+"px";n.borders.outlineOffset=t}if(e.startsWith("bg-[#")||e.startsWith("bg-[rgb")||e.startsWith("bg-[color:var(")||e.startsWith("bg-[var(")){let t=A(e);t&&(n.backgrounds.backgroundColor=t)}if(e.startsWith("bg-[")&&!r){let t=M(e);t&&t.includes("gradient(")&&(n.backgrounds.backgroundColor=t)}if(o.test(e)){let t=a(e);t&&(n.backgrounds.backgroundImage=t)}if(e.startsWith("bg-clip-")&&!(r&&i&&s)){let t=e.replace("bg-clip-","");n.backgrounds.backgroundClip=t}if(e.startsWith("opacity-[")){let t=M(e);t&&(n.effects.opacity=t)}if(e.startsWith("shadow-[")){let t=M(e);t&&(n.effects.boxShadow=t)}if(e.startsWith("blur-[")){let t=M(e);t&&(n.effects.blur=t)}else if("blur-none"===e)n.effects.blur="none";else if(e.match(/^blur-(sm|md|lg|xl|2xl|3xl)$/)){let t=e.match(/^blur-(.+)$/);t&&(n.effects.blur=t[1])}if(e.startsWith("backdrop-blur-[")){let t=M(e);t&&(n.effects.backdropBlur=t)}else if("backdrop-blur-none"===e)n.effects.backdropBlur="none";else if(e.match(/^backdrop-blur-(sm|md|lg|xl|2xl|3xl)$/)){let t=e.match(/^backdrop-blur-(.+)$/);t&&(n.effects.backdropBlur=t[1])}if(e.startsWith("mix-blend-")){let t=e.match(/^mix-blend-(.+)$/);t&&(n.effects.mixBlendMode=t[1])}if(e.startsWith("cursor-")){let t=e.slice(7);t&&(n.effects.cursor=t)}if("static"===e&&(n.positioning.position="static"),"relative"===e&&(n.positioning.position="relative"),"absolute"===e&&(n.positioning.position="absolute"),"fixed"===e&&(n.positioning.position="fixed"),"sticky"===e&&(n.positioning.position="sticky"),e.startsWith("top-[")){let t=M(e);t&&(n.positioning.top=t)}if(e.startsWith("right-[")){let t=M(e);t&&(n.positioning.right=t)}if(e.startsWith("bottom-[")){let t=M(e);t&&(n.positioning.bottom=t)}if(e.startsWith("left-[")){let t=M(e);t&&(n.positioning.left=t)}if(e.startsWith("z-[")){let t=M(e);t&&(n.positioning.zIndex=t)}if(e.startsWith("scale-[")){let t=M(e);t&&(n.transforms.scale=t)}else if(e.match(/^scale-\d+$/)){let t=e.match(/^scale-(\d+)$/);t&&(n.transforms.scale=t[1])}if(e.startsWith("rotate-[")||e.startsWith("-rotate-[")){let t=M(e);if(t){let r=e.startsWith("-")?"-":"";n.transforms.rotate=h(`${r}${t}`)}}else if(e.match(/^-?rotate-\d+$/)){let t=e.match(/^(-?)rotate-(\d+)$/);t&&(n.transforms.rotate=`${t[1]}${t[2]}`)}for(let t of["x","y"]){let r="x"===t?"translateX":"translateY",i=`translate-${t}`;if(e.startsWith(`${i}-[`)||e.startsWith(`-${i}-[`)){let t=M(e);if(t){let i=e.startsWith("-")?"-":"",o=t.endsWith("px")?t.slice(0,-2):t;n.transforms[r]=`${i}${o}`}}else e===`${i}-full`?n.transforms[r]="full":e===`-${i}-full`&&(n.transforms[r]="-full")}for(let t of["x","y"]){let r="x"===t?"skewX":"skewY",i=`skew-${t}`;if(e.startsWith(`${i}-[`)||e.startsWith(`-${i}-[`)){let t=M(e);if(t){let i=e.startsWith("-")?"-":"";n.transforms[r]=h(`${i}${t}`)}}else if(e.match(RegExp(`^-?${i}-\\d+$`))){let t=e.match(RegExp(`^(-?)${i}-(\\d+)$`));t&&(n.transforms[r]=`${t[1]}${t[2]}`)}}if(e.startsWith("origin-")){let t=e.replace("origin-","");["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left"].includes(t)&&(n.transforms.transformOrigin=t)}let t={transition:"default","transition-all":"all","transition-colors":"colors","transition-opacity":"opacity","transition-shadow":"shadow","transition-transform":"transform","transition-none":"none"};t[e]&&(n.transitions.transitionProperty=t[e]);let l={"ease-linear":"linear","ease-in":"in","ease-out":"out","ease-in-out":"in-out"};for(let[t,r]of(l[e]&&(n.transitions.easing=l[e]),[["duration","duration"],["delay","delay"]]))if(e.startsWith(`${t}-[`)){let t=M(e);t&&(t.endsWith("ms")?n.transitions[r]=t.slice(0,-2):t.endsWith("s")?n.transitions[r]=String(1e3*parseFloat(t)):n.transitions[r]=t)}else if(e.match(RegExp(`^${t}-\\d+$`))){let i=e.match(RegExp(`^${t}-(\\d+)$`));i&&(n.transitions[r]=i[1])}}),n},"combineBgValues",0,r,"designToClassString",0,function(e){return(0,t.cn)(function(e){if(!e)return[];let t=[];return Object.entries(e).forEach(([e,n])=>
1{n&&"object"==typeof n&&Object.entries(n).forEach(([n,r])=>{if("isActive"===n||!r)return;let i=N(e,n,r);if(i){let e=function(e){let t=[],n="",r=0;for(let i of e)"["===i&&r++,"]"===i&&r--," "===i&&0===r?(n&&t.push(n),n=""):n+=i;return n&&t.push(n),t}(i);t.push(...e)}})}),t}(e))},"extractBgImgVarName",0,a,"getAffectedProperties",0,D,"getInheritedValue",0,function e(t,r,i,o="neutral"){let s=_(r);if(!s)return{value:null,source:null};let l=null,a=null;for(let e of"mobile"===i?["desktop","tablet","mobile"]:"tablet"===i?["desktop","tablet"]:["desktop"]){let i=(0,n.getBreakpointPrefix)(e),d=I[o].prefix;if("neutral"!==o){let n=i+d,o=t.find(e=>!!(i?e.startsWith(n):e.startsWith(d))&&P(e.slice(n.length),r,s));o&&(l=o.slice(n.length),a=e)}let c=t.find(e=>{if(i){if(!e.startsWith(i))return!1;let t=e.slice(i.length);return!t.match(/^(hover|focus|active|disabled|visited|current):/)&&P(t,r,s)}return!e.match(/^(max-lg|max-md|hover|focus|active|disabled|visited|current):/)&&P(e,r,s)});if(c){let t=i?c.slice(i.length):c;"neutral"===o?(l=t,a=e):l||(l=t,a=e)}}if(null===l)for(let n of v[r]??[]){let r=e(t,n,i,o);if(null!==r.value)return r}return{value:l,source:a}},"mergeDesign",0,function(e,t){return t?{layout:{...e?.layout||{},...t.layout||{}},typography:{...e?.typography||{},...t.typography||{}},spacing:{...e?.spacing||{},...t.spacing||{}},sizing:{...e?.sizing||{},...t.sizing||{}},borders:{...e?.borders||{},...t.borders||{}},backgrounds:{...e?.backgrounds||{},...t.backgrounds||{}},effects:{...e?.effects||{},...t.effects||{}},positioning:{...e?.positioning||{},...t.positioning||{}}}:e||{}},"mergeStaticBgVars",0,function(e,t){let n={};for(let i of new Set([...Object.keys(e||{}),...Object.keys(t||{})])){let o=r(e?.[i],t?.[i]);o&&(n[i]=o)}return n},"propertyToClass",0,N,"removeConflictingClasses",0,E,"removeConflictsForClass",0,function(e,t){let n=D(t),r=e;return n.forEach(e=>{r=E(r,e),b[e]?.forEach(e=>{r=E(r,e)})}),O(t)&&n.forEach(e=>{r=r.filter(t=>!function(e,t){let n=e.replace(/^(max-lg:|max-md:|lg:|md:)?(hover:|focus:|active:|disabled:|visited:|current:)?/,"");if("color"===t&&n.startsWith("text-[")||"backgroundColor"===t&&n.startsWith("bg-[")||"borderColor"===t&&n.startsWith("border-[")){let e=M(n);return!!e&&d(e)}return!1}(t,e))}),r},"removeRedundantSpacingShorthands",0,C,"replaceConflictingClasses",0,function(e,t,n){let r=E(e,t);return n?[...r,n]:r},"setBreakpointClass",0,function(e,t,r,i,o="neutral"){let s=_(t);if(!s)return e;let l=(0,n.getBreakpointPrefix)(i)+I[o].prefix,a=e.filter(e=>{let n=$(e);return n.breakpoint!==i||n.uiState!==o||!P(n.baseClass,t,s)});if("color"===t&&r){let e=r.split(" ")[0];r.includes("bg-clip-text")||"text-transparent"===e||(a=a.filter(e=>{let t=$(e);return t.breakpoint!==i||t.uiState!==o||"bg-clip-text"!==t.baseClass}))}return(r&&r.split(" ").filter(Boolean).forEach(e=>{a.push(l+e)}),S.has(t))?C(a):a}])},49026,18521,e=>{"use strict";e.s(["DEFAULT_TEXT_STYLES",()=>p,"flattenTiptapParagraphs",()=>y,"getTextStyle",()=>h,"getTextStyleClasses",()=>f,"getTiptapTextContent",()=>m,"hasBlockElementsWithInlineVariables",()=>S,"renderRichText",()=>T,"stringToTiptapContent",()=>C],49026);var t=e.i(271645),n=e.i(647163),r=e.i(347802),i=e.i(896126),o=e.i(970190),s=e.i(13532),l=e.i(495398);e.s(["RichTextLink",()=>d,"getLinkSettingsFromMark",()=>c],18521);var a=e.i(10552);let d=a.Mark.create({name:"richTextLink",priority:1e3,keepOnSplit:!1,inclusive:!1,addOptions:()=>({HTMLAttributes:{}}),addAttributes:()=>({type:{default:"url",parseHTML:e=>e.getAttribute("data-link-type")||"url",renderHTML:e=>({"data-link-type":e.type})},url:{default:null,parseHTML:e=>{let t=e.getAttribute("data-link-url");if(!t)return null;try{return JSON.parse(t)}catch{return{type:"dynamic_text",data:{content:t}}}},renderHTML:e=>e.url?{"data-link-url":JSON.stringify(e.url)}:{}},email:{default:null,parseHTML:e=>{let t=e.getAttribute("data-link-email");if(!t)return null;try{return JSON.parse(t)}catch{return null}},renderHTML:e=>e.email?{"data-link-email":JSON.stringify(e.email)}:{}},phone:{default:null,parseHTML:e=>{let t=e.getAttribute("data-link-phone");if(!t)return null;try{return JSON.parse(t)}catch{return null}},renderHTML:e=>
1e.phone?{"data-link-phone":JSON.stringify(e.phone)}:{}},asset:{default:null,parseHTML:e=>{let t=e.getAttribute("data-link-asset");if(!t)return null;try{return JSON.parse(t)}catch{return null}},renderHTML:e=>e.asset?{"data-link-asset":JSON.stringify(e.asset)}:{}},page:{default:null,parseHTML:e=>{let t=e.getAttribute("data-link-page");if(!t)return null;try{return JSON.parse(t)}catch{return null}},renderHTML:e=>e.page?{"data-link-page":JSON.stringify(e.page)}:{}},field:{default:null,parseHTML:e=>{let t=e.getAttribute("data-link-field");if(!t)return null;try{return JSON.parse(t)}catch{return null}},renderHTML:e=>e.field?{"data-link-field":JSON.stringify(e.field)}:{}},anchor_layer_id:{default:null,parseHTML:e=>e.getAttribute("data-link-anchor")||null,renderHTML:e=>e.anchor_layer_id?{"data-link-anchor":e.anchor_layer_id}:{}},target:{default:null,parseHTML:e=>e.getAttribute("target")||null,renderHTML:e=>e.target?{target:e.target}:{}},download:{default:!1,parseHTML:e=>e.hasAttribute("download"),renderHTML:e=>e.download?{download:""}:{}},rel:{default:null,parseHTML:e=>e.getAttribute("rel")||null,renderHTML:e=>e.rel?{rel:e.rel}:{}}}),parseHTML:()=>[{tag:"a[data-link-type]"},{tag:"a[href]",getAttrs:e=>{let t=e.getAttribute("href");return!!t&&(t.startsWith("mailto:")?{type:"email",email:{type:"dynamic_text",data:{content:t.replace("mailto:","")}}}:t.startsWith("tel:")?{type:"phone",phone:{type:"dynamic_text",data:{content:t.replace("tel:","")}}}:{type:"url",url:{type:"dynamic_text",data:{content:t}}})}}],renderHTML({HTMLAttributes:e,mark:t}){let n="#";switch(t.attrs.type){case"url":t.attrs.url?.data?.content&&(n=t.attrs.url.data.content);break;case"email":t.attrs.email?.data?.content&&(n=`mailto:${t.attrs.email.data.content}`);break;case"phone":t.attrs.phone?.data?.content&&(n=`tel:${t.attrs.phone.data.content}`);break;case"asset":case"page":case"field":n="#"}let r=t.attrs.rel||("_blank"===t.attrs.target?"noopener noreferrer":null),i=this.options.HTMLAttributes?.class||p.link?.classes||"";return["a",(0,a.mergeAttributes)(this.options.HTMLAttributes,e,{href:n,...r?{rel:r}:{},class:`${i} cursor-pointer`}),0]},addCommands(){return{setRichTextLink:e=>({commands:t})=>t.setMark(this.name,e),toggleRichTextLink:e=>({commands:t})=>t.toggleMark(this.name,e),unsetRichTextLink:()=>({commands:e})=>e.unsetMark(this.name,{extendEmptyMarkRange:!0}),updateRichTextLink:e=>({commands:t,editor:n})=>{let r={...n.getAttributes(this.name),...e};return t.setMark(this.name,r)}}}});function c(e){let t=!e.url&&"string"==typeof e.href&&e.href?{type:"dynamic_text",data:{content:e.href}}:void 0;return{type:e.type||e.linkType||"url",url:e.url||t||void 0,email:e.email||void 0,phone:e.phone||void 0,asset:e.asset||void 0,page:e.page||void 0,field:e.field||void 0,anchor_layer_id:e.anchor_layer_id||void 0,target:e.target||void 0,download:e.download||!1,rel:e.rel||void 0}}var u=e.i(199256);let p={h1:{label:"Heading 1",classes:"text-[30px] font-semibold",design:{typography:{fontSize:"30px",fontWeight:"semibold"}}},h2:{label:"Heading 2",classes:"text-[24px] font-semibold",design:{typography:{fontSize:"24px",fontWeight:"semibold"}}},h3:{label:"Heading 3",classes:"text-[20px] font-semibold",design:{typography:{fontSize:"20px",fontWeight:"semibold"}}},h4:{label:"Heading 4",classes:"text-[18px] font-semibold",design:{typography:{fontSize:"18px",fontWeight:"semibold"}}},h5:{label:"Heading 5",classes:"text-[16px] font-semibold",design:{typography:{fontSize:"16px",fontWeight:"semibold"}}},h6:{label:"Heading 6",classes:"text-[14px] font-semibold",design:{typography:{fontSize:"14px",fontWeight:"semibold"}}},paragraph:{label:"Paragraph",classes:"",design:{}},bold:{label:"Bold",classes:"font-bold",design:{typography:{fontWeight:"bold"}}},italic:{label:"Italic",classes:"italic",design:{typography:{fontStyle:"italic"}}},underline:{label:"Underline",classes:"underline",design:{typography:{textDecoration:"underline"}}},strike:{label:"Strikethrough",classes:"line-through",design:{typography:{textDecoration:"line-through"}}},subscript:{label:"Subscript",classes:"align-sub",design:{typography:{verticalAlign:"sub"}}},superscript:{label:"Superscript",classes:"align-super",design:{typography:{verticalAlign:"super"}}},code:{label:"Code",classes:"font-mono bg-muted px-[4px] py-[2px] rounded text-[14px]",design:{typography:{fontFamily:"mono",fontSize:"14px"},backgrounds:{backgroundColor:"muted"},spacing:{paddingLeft:"4px",paddingRight:"4px",paddingTop:"2px",paddingBottom:"2px"}
1,borders:{borderRadius:"rounded"}}},link:{label:"Link",classes:"text-[#1c70d7] underline underline-offset-2",design:{typography:{textDecoration:"underline",color:"#1c70d7"}}},bulletList:{label:"Bullet list",classes:"ml-[8px] pl-[16px] list-disc",design:{spacing:{marginLeft:"8px",paddingLeft:"16px"}}},orderedList:{label:"Ordered list",classes:"ml-[8px] pl-[20px] list-decimal",design:{spacing:{marginLeft:"8px",paddingLeft:"20px"}}},listItem:{label:"List Item",classes:""},blockquote:{label:"Blockquote",classes:"border-l-[3px] border-current/20 pl-[16px]",design:{borders:{borderLeftWidth:"3px"},spacing:{paddingLeft:"16px"}}},richTextImage:{label:"Image",classes:"block max-w-full h-auto rounded-[4px]",design:{layout:{display:"block"},sizing:{maxWidth:"100%",height:"auto"},borders:{borderRadius:"4px"}}},horizontalRule:{label:"Separator",classes:"border-t-[1px] border-[#aeaeae]",design:{borders:{borderTopWidth:"1px",borderColor:"#aeaeae"}}},table:{label:"Table",classes:"w-full border-separate border-spacing-0 mt-[20px] mb-[20px] border-solid border-[1px] border-[#000000]/10 rounded-[10px] overflow-hidden",design:{sizing:{width:"100%"},spacing:{marginTop:"20",marginBottom:"20",isActive:!0},borders:{isActive:!0,borderColor:"#000000/10",borderStyle:"solid",borderWidth:"1",borderRadius:"10"}}},tableHeader:{label:"Table header cell",classes:"text-left font-[500] pt-[12px] pr-[12px] pb-[12px] pl-[12px] bg-[#000000]/5",design:{borders:{isActive:!0,borderWidthMode:"all"},spacing:{paddingLeft:"12",paddingRight:"12",paddingTop:"12",paddingBottom:"12",isActive:!0},typography:{textAlign:"left",fontWeight:"500",isActive:!0},backgrounds:{isActive:!0,backgroundColor:"#000000/5"}}},tableCell:{label:"Table cell",classes:"pt-[12px] pr-[12px] pb-[12px] pl-[12px]",design:{borders:{isActive:!0,borderWidthMode:"individual",borderRadiusMode:"individual"},spacing:{paddingLeft:"12",paddingRight:"12",paddingTop:"12",paddingBottom:"12",isActive:!0},typography:{textAlign:"left",verticalAlign:"top",isActive:!0},backgrounds:{isActive:!0}}},tableRow:{label:"Table row",classes:"",design:{borders:{isActive:!0},backgrounds:{isActive:!0}}}};function h(e,t){return e?.[t]??p[t]}function f(e,t){return e?.[t]?.classes??p[t]?.classes??""}function m(e){return{type:"doc",content:[{type:"paragraph",content:e?[{type:"text",text:e}]:[]}]}}function g(e,t,n,r,o){if(!e)return null;let s=e.link;if(!s?.type)return null;if(t)return"#";let l={...n,collectionItemData:r,pageCollectionItemData:o};return(0,i.generateLinkHref)(s,l)||null}function y(e){if(!e||"object"!=typeof e||"doc"!==e.type)return e;let t=e.content;if(!Array.isArray(t)||0===t.length)return e;let n=new Set(["paragraph","heading"]);if(!t.every(e=>n.has(e?.type))||1===t.length&&"paragraph"===t[0].type)return e;let r=[];return t.forEach((e,t)=>{t>0&&r.length>0&&r.push({type:"hardBreak"}),e.content&&Array.isArray(e.content)&&r.push(...e.content)}),{type:"doc",content:[{type:"paragraph",content:r}]}}function b(e,r,o,s=!1,l,a,d,u){let h=e.text||"",m=e=>f(o,e);if(e.marks&&Array.isArray(e.marks))for(let u=e.marks.length-1;u>=0;u--){let f=e.marks[u],g=(e,t)=>{let n={key:`${r}-${e}`,className:t};return s&&(n["data-style"]=e),n};switch(f.type){case"bold":h=t.default.createElement("strong",g("bold",m("bold")),h);break;case"italic":h=t.default.createElement("em",g("italic",m("italic")),h);break;case"underline":h=t.default.createElement("u",g("underline",m("underline")),h);break;case"strike":h=t.default.createElement("s",g("strike",m("strike")),h);break;case"subscript":h=t.default.createElement("sub",g("subscript",m("subscript")),h);break;case"superscript":h=t.default.createElement("sup",g("superscript",m("superscript")),h);break;case"dynamicStyle":{let e=f.attrs?.styleKeys||[];0===e.length&&f.attrs?.styleKey&&e.push(f.attrs.styleKey);let i={...p,...o},l=e.map(e=>i[e]?.classes||"").filter(Boolean),a=(0,n.cn)(...l),d=e[e.length-1],c={key:`${r}-${d||"dynamicStyle"}`,className:a};s&&(c["data-style-keys"]=JSON.stringify(e),c["data-style-key"]=d),h=t.default.createElement("span",c,h);break}case"richTextLink":{let e={key:`${r}-richTextLink`,href:s?"#":(()=>
1{let e={...d,collectionItemData:l,pageCollectionItemData:a};return(0,i.generateLinkHref)(c(f.attrs||{}),e)||"#"})(),className:m("link")};f.attrs?.target&&(e.target=f.attrs.target),(f.attrs?.rel||f.attrs?.target==="_blank")&&(e.rel=f.attrs.rel||"noopener noreferrer"),f.attrs?.download&&(e.download=!0),s&&(e.onClick=e=>e.preventDefault(),e["data-style"]="link"),h=t.default.createElement("a",e,h)}}}return h}function v(e,n,i,o,s=!1,l,a="UTC",d,c,h,m,y=!0){return e.flatMap((e,v)=>{let S=`node-${v}`;if("text"===e.type)return[b(e,S,o,s,n,i,l,d)];if("dynamicVariable"===e.type){let{fieldType:u,rawValue:p,format:f}=function(e,t,n,i){if(e.attrs?.variable?.type==="field"&&e.attrs.variable.data?.field_id){let{field_id:o,field_type:s,relationships:l=[],source:a,collection_layer_id:d,format:c}=e.attrs.variable.data,u=l.length>0?[o,...l].join("."):o;return{fieldType:s||null,rawValue:(0,r.resolveFieldFromSources)(u,a,t,n,d,i),format:c}}return{fieldType:null,rawValue:void 0}}(e,n,i,d);if("rich_text"===u&&p){let e=p;if("string"==typeof p)try{e=JSON.parse(p)}catch{e=null}if(e&&"object"==typeof e)return function(e,n,r,i,o,s=!1,l,a="UTC",d,c,u,p,h=!0){if(!e)return[];let f=e;if("string"==typeof e)try{f=JSON.parse(e)}catch{return[t.default.createElement("span",{key:n},e)]}return"object"!=typeof f?[]:"doc"===f.type&&Array.isArray(f.content)?f.content.map((e,t)=>w(e,t,r,i,o,h,s,l,a,d,c,u,p)).filter(Boolean):[]}(e,S,n,i,o,s,l,a,d,c,h,m,y)}return[b({type:"text",text:(0,r.formatFieldValue)(p,u,a,f),marks:e.marks||[]},S,o,s,n,i,void 0,d)]}if("richTextComponent"===e.type&&e.attrs?.componentId){let t=x(e,S,c,h,m);return t?[t]:[]}if("richTextHtmlEmbed"===e.type){let n=e.attrs?.code||"";return n?[t.default.createElement(u.default,{key:S,code:n})]:[]}if("richTextImage"===e.type||"image"===e.type){let r={key:S,src:e.attrs?.src||"",alt:e.attrs?.alt||"",className:f(o,"richTextImage")};e.attrs?.assetId&&(r["data-asset-id"]=e.attrs.assetId);let a=t.default.createElement("img",r),d=g(e.attrs,s,l,n,i);if(d){let n=e.attrs?.link?.target||void 0;return[t.default.createElement("a",{key:S,href:d,target:n,rel:"_blank"===n?"noopener noreferrer":void 0},a)]}return[a]}if("hardBreak"===e.type)return[t.default.createElement("br",{key:S})];if("bulletList"===e.type||"orderedList"===e.type){let r=o?.[e.type]?.classes??p[e.type]?.classes??"",u="bulletList"===e.type?"ul":"ol",f={key:S,className:r};s&&(f["data-style"]=e.type);let g=e.content?.map((e,t)=>k(e,`${S}-${t}`,n,i,o,s,l,a,d,c,h,m,t))||[];return[t.default.createElement(u,f,...g)]}return[]}).filter(Boolean)}function x(e,n,r,i,o){let l=e.attrs.componentId,a=e.attrs.componentOverrides??void 0;if(o?.has(l))return null;let d=r?.find(e=>e.id===l),c=new Set(o);if(c.add(l),e.attrs._resolvedLayers){let r=d??{id:l,name:""};return i?i(r,e.attrs._resolvedLayers,a,n,c):t.default.createElement("span",{key:n,"data-component-id":l},`[${r.name}]`)}if(!d)return t.default.createElement("span",{key:n,className:"text-xs text-muted-foreground"},"[missing component]");if(!i)return t.default.createElement("span",{key:n,"data-component-id":l},`[${d.name}]`);if(!d.layers?.length)return t.default.createElement("span",{key:n,className:"text-xs text-muted-foreground"},"[missing component]");let u=(0,s.applyComponentOverrides)(d.layers,a,d.variables),p=r?.length?(0,s.resolveComponents)(u,r,d.variables,a):u;return i(d,p,a,n,c)}function w(e,n,r,i,o,s=!1,l=!1,a,d="UTC",c,p,h,m){let y=`block-${n}`;if("paragraph"===e.type){let n={key:y,className:f(o,"paragraph")};if(l&&(n["data-style"]="paragraph"),!e.content||0===e.content.length)return t.default.createElement(s?"span":"p",n,"Â ");let u=e.content?.some(e=>"dynamicVariable"===e.type&&e.attrs?.variable?.data?.field_type==="rich_text"||"richTextComponent"===e.type);return t.default.createElement(u?"div":s?"span":"p",n,...v(e.content,r,i,o,l,a,d,c,p,h,m,s))}if("heading"===e.type){let n=e.attrs?.level||1,u=`h${n}`,g=f(o,u),b=s?"span":u;if(!e.content||0===e.content.length)return t.default.createElement(b,{key:y,className:g},"Â ");let x={key:y,className:g};return l&&(x["data-style"]=u),t.default.createElement(b,x,...v(e.content,r,i,o,l,a,d,c,p,h,m,s))}if("bulletList"===e.type){let n={key:y,className:f(o,"bulletList")};return l&&(n["data-style"]="bulletList"),t.default.createElement("ul",n,e.content?.map((e,t)=>k(e,`${y}-${t}`,r,i,o,l,a,d,c,p,h,m,t)))}if("orderedList"===e.type){let n={key:y,className:f(o,"orderedList")};return l&&(n["data-style"]="orderedList"),t.default.createElement("ol",n,e.content?.map((e,t)=>k(e,`${y}-${t}`,r,i,o,l,a,d,c,p,h,m,t)))}if("blockquote"===e.type){let n={key:y,className:f(o,"blockquote")};return l&&(n["data-style"]="blockquote"),t.default.createElement("blockquote",n,e.content?.map((e,t)=>w(e,t,r,i,o,s,l,a,d,c,p,h,m)))}if("richTextImage"===e.type||"image"===e.type){let n={key:y,src:e.attrs?.src||"",alt:e.attrs?.alt||"",className:f(o,"richTextImage")};l&&(n["data-style"]="richTextImage"),e.attrs?.assetId&&(n["data-asset-id"]=e.attrs.assetId);let s=t.default.createElement("img",n),d=g(e.attrs,l,a,r,i);if(d){let n=e.attrs?.link?.target||void 0;return t.default.createElement("a",{key:y,href:d,target:n,rel:"_blank"===n?"noopener noreferrer":void 0},s)}return s}if("horizontalRule"===e.type){let e={key:y,className:f(o,"horizontalRule")};return l&&(e["data-style"]="horizontalRule"),t.default.createElement("hr",e)}if("richTextComponent"===e.type&&e.attrs?.componentId)return x(e,y,p,h,m);if("table"===e.type){let n=(e.content||[]).map((e,n)=>(function e(n,r,i,o,s,l=!1,a,d="UTC",c,u,p,h,m=0,g=0){if(!n)return null;let y="tableRow"===n.type?m:g,b=(n.content||[]).map((t,n)=>"tableRow"===t.type||"tableCell"===t.type||"tableHeader"===t.type?e(t,`${r}-${n}`,i,o,s,l,a,d,c,u,p,h,n,y):w(t,n,i,o,s,!1,l,a,d,c,u,p,h)),v={tableRow:"tr",tableCell:"td",tableHeader:"th"}[n.type]||"div",x={tableRow:"tableRow",tableCell:"tableCell",tableHeader:"tableHeader"}[n.type],k=x?f(s,x):"";if("tableCell"===n.type||"tableHeader"===n.type){let e=[];
1if(g>0&&e.push("border-t-[1px]"),m>0&&e.push("border-l-[1px]"),e.length>0){let t=`${e.join(" ")} border-solid border-[#000000]/10`;k=k?`${k} ${t}`:t}}let S={key:r};return k&&(S.className=k),l&&x&&(S["data-style"]=x),("tableCell"===n.type||"tableHeader"===n.type)&&n.attrs&&(n.attrs.colspan&&n.attrs.colspan>1&&(S.colSpan=n.attrs.colspan),n.attrs.rowspan&&n.attrs.rowspan>1&&(S.rowSpan=n.attrs.rowspan)),t.default.createElement(v,S,b)})(e,`${y}-row-${n}`,r,i,o,l,a,d,c,p,h,m,n)),s={key:`${y}-tbody`},u=f(o,"table"),g={key:`${y}-table`};return u&&(g.className=u),l&&(g["data-style"]="table"),t.default.createElement("div",{key:y,className:"overflow-x-auto max-w-full"},t.default.createElement("table",g,t.default.createElement("tbody",s,n)))}if("richTextHtmlEmbed"===e.type){let n=e.attrs?.code||"";return n?t.default.createElement(u.default,{key:y,code:n}):null}return null}function k(e,n,r,i,o,s=!1,l,a="UTC",d,c,u,p,h){if("listItem"!==e.type)return null;let m=e.content?.flatMap((e,t)=>"paragraph"===e.type?v(e.content||[],r,i,o,s,l,a,d,c,u,p):w(e,t,r,i,o,!1,s,l,a,d,c,u,p)),g={key:n,className:f(o,"listItem")};return s&&(g["data-style"]="listItem",void 0!==h&&(g["data-list-item-index"]=h)),t.default.createElement("li",g,m)}function S(e,t,n){let r=e.data.content;return(0,o.hasBlockElementsWithResolver)(r,(e,r,i)=>{let o=r&&r.length>0?[e,...r].join("."):e;return"page"===i?n?.[o]:t?.[o]??n?.[o]})}function T(e,n,r,i,o=!1,s=!1,a,d="UTC",c,u,h,f,m=!1,g){let y=function e(t,n){if(!n||!t||"object"!=typeof t)return t;let r=t;if("dynamicVariable"===t.type&&t.attrs?.variable?.type==="field"&&t.attrs.variable.data?.source==="global"&&t.attrs.variable.data?.field_id){let e=t.attrs.variable,i=n[e.data.field_id];if(i){let n=e.data.format,o=(0,l.isFormatValidForFieldType)(n,i.type)?n:(0,l.getDefaultFormatId)(i.type),s={...e,data:{...e.data,field_type:i.type,format:o}};r={...t,attrs:{...t.attrs,label:i.name,variable:s}}}}if(Array.isArray(r.content)){let i=r!==t,o=r.content.map(t=>{let r=e(t,n);return r!==t&&(i=!0),r});if(i)return{...r,content:o}}return r}(e.data.content,g);if(!y||"object"!=typeof y||!("type"in y)||"doc"!==y.type||!y.content||!Array.isArray(y.content))return null;if(1===y.content.length&&"paragraph"===y.content[0].type){let e=y.content[0];if(e.content?.length===1&&"dynamicVariable"===e.content[0].type&&e.content[0].attrs?.variable?.data?.field_type==="rich_text"){let t=!!m||o,l=v(e.content,n,r,i,s,a,d,c,u,h,f,t);return Array.isArray(l)?l:[l]}if(!e.content||0===e.content.length){if(s&&!m){let e=i?.paragraph?.classes??p.paragraph?.classes??"";return t.default.createElement("span",{"data-style":"paragraph","data-block-index":0,className:e},"Â ")}return null}let l=v(e.content,n,r,i,s,a,d,c,u,h,f,o);if(!m){let e=o?"span":"p",n=i?.paragraph?.classes??p.paragraph?.classes??"",r=Array.isArray(l)?l:[l],a={className:n||void 0};return s&&(a["data-style"]="paragraph",a["data-block-index"]=0),t.default.createElement(e,a,...r)}return l}let b=0;return y.content.map((e,l)=>{let p=w(e,l,n,r,i,o,s,a,d,c,u,h,f),m="paragraph"!==e.type||e.content?.length,g=t.default.isValidElement(p)&&p.type===t.default.Fragment;return p&&m&&s&&!g?t.default.cloneElement(p,{"data-block-index":b++}):p})}function C(e){let t,n=[],r=/<ycode-inline-variable>([\s\S]*?)<\/ycode-inline-variable>/g,i=0;for(;null!==(t=r.exec(e));){if(t.index>i){let r=e.slice(i,t.index);r&&n.push({type:"text",text:r})}let o=t[1].trim();try{let e=JSON.parse(o);n.push({type:"dynamicVariable",attrs:{variable:e,label:e.data?.field_id||e.type||"variable"}})}catch{}i=r.lastIndex}if(i<e.length){let t=e.slice(i);t&&n.push({type:"text",text:t})}return{type:"doc",content:[{type:"paragraph",content:n.length>0?n:void 0}]}}},970190,e=>{"use strict";function t(e){if(!e||"object"!=typeof e)return null;if("dynamicVariable"===e.type){let t=e.attrs?.variable;if(t?.type==="field"&&t.data?.field_id)return{field_id:t.data.field_id,label:e.attrs?.label,source:t.data.source,collection_layer_id:t.data.collection_layer_id,field_type:t.data.field_type??null,format:t.data.format}}if(Array.isArray(e.content))for(let n of e.content){let e=t(n);if(e)return e}return null}e.s(["extractMultilinePlainTextFromTiptap",0,function(e){if(!e||"object"!=typeof e)return"";let t=new Set(["paragraph","heading","blockquote","codeBlock","listItem","horizontalRule","richTextHtmlEmbed","richTextImage","richTextComponent"]),n=[],r=(e,t)=>{if(e){if("text"===e.type&&e.text){t.text+=e.text;return}if("dynamicVariable"===e.type&&e.attrs?.label){t.text+=`[${e.attrs.label}]`;return}if("hardBreak"===e.type){t.text+="\n";return}
1Array.isArray(e.content)&&e.content.forEach(e=>r(e,t))}},i=e=>{if(e){if("horizontalRule"===e.type)return void n.push("");if(t.has(e.type)){let o={text:""};Array.isArray(e.content)&&e.content.forEach(e=>{t.has(e?.type)?i(e):r(e,o)}),o.text&&n.push(o.text);return}Array.isArray(e.content)&&e.content.forEach(i)}};return"doc"===e.type&&Array.isArray(e.content)?e.content.forEach(i):Array.isArray(e)?e.forEach(i):i(e),n.join("\n").replace(/\n{3,}/g,"\n\n").trim()},"extractPlainTextFromTiptap",0,function(e){if(!e||"object"!=typeof e)return"";let t="",n=e=>{"text"===e.type&&e.text?t+=e.text:"dynamicVariable"===e.type&&e.attrs?.label?t+=`[${e.attrs.label}]`:("paragraph"===e.type&&t.length>0&&!t.endsWith(" ")&&(t+=" "),Array.isArray(e.content)&&e.content.forEach(n))};return"doc"===e.type&&Array.isArray(e.content)?e.content.forEach(n):Array.isArray(e)?e.forEach(n):n(e),t.trim()},"getCmsFieldBinding",0,t,"getRichTextValue",0,function(e){let t=e?.text;if(t?.type==="dynamic_rich_text")return t.data.content;if(t?.type==="dynamic_text"){let e=t.data.content;return"string"==typeof e?{type:"doc",content:[{type:"paragraph",content:e?[{type:"text",text:e}]:[]}]}:e}return{type:"doc",content:[{type:"paragraph"}]}},"getSoleCmsFieldBinding",0,function(e){if(!e||"doc"!==e.type)return null;let n=e.content;if(!Array.isArray(n)||1!==n.length)return null;let r=n[0];if("paragraph"!==r.type)return null;let i=r.content;return Array.isArray(i)&&1===i.length&&"dynamicVariable"===i[0].type?t(i[0]):null},"hasAnyTextOrVariable",0,function(e){if(!e?.content||!Array.isArray(e.content))return!1;let t=e=>e.some(e=>!!e&&"object"==typeof e&&("text"===e.type&&"string"==typeof e.text&&e.text.length>0||"dynamicVariable"===e.type||!!Array.isArray(e.content)&&t(e.content)));return t(e.content)},"hasBlockElementsWithResolver",0,function(e,t){if(!e||"object"!=typeof e)return!1;if(e&&"object"==typeof e&&"doc"===e.type&&Array.isArray(e.content)&&e.content.some(e=>"bulletList"===e.type||"orderedList"===e.type||"richTextComponent"===e.type||"horizontalRule"===e.type||"table"===e.type))return!0;if("doc"!==e.type||!Array.isArray(e.content))return!1;let n=e=>{if("dynamicVariable"===e.type){let t=e.attrs?.variable;if(t?.type==="field"&&t.data?.field_type==="rich_text")return!0}return!!Array.isArray(e.content)&&e.content.some(n)};return e.content.some(n)},"hasComponentOrVariable",0,function e(t){return!!t&&"object"==typeof t&&("richTextComponent"===t.type||"dynamicVariable"===t.type||!!Array.isArray(t.content)&&t.content.some(e))},"hasLinkOrComponent",0,function e(t){return!!t&&"object"==typeof t&&(!!("richTextComponent"===t.type||t.marks?.some(e=>"richTextLink"===e.type))||!!Array.isArray(t.content)&&t.content.some(e))},"hasVariableNode",0,function(e){if(!e?.content||!Array.isArray(e.content))return!1;let t=e=>e.some(e=>!!e&&"object"==typeof e&&("dynamicVariable"===e.type||!!Array.isArray(e.content)&&t(e.content)));return t(e.content)},"tiptapDocHasFormatting",0,function(e){if(!e||"object"!=typeof e||!Array.isArray(e.content))return!1;let t=e.content;if(t.length>1)return!0;let n=new Set(["heading","bulletList","orderedList","listItem","blockquote","codeBlock","horizontalRule","image","table","tableRow","tableCell","tableHeader","iframe","youtube","richTextComponent"]),r=e=>e.some(e=>!!e&&"object"==typeof e&&(!!(e.type&&n.has(e.type)||"hardBreak"===e.type||"text"===e.type&&Array.isArray(e.marks)&&e.marks.length>0)||!!Array.isArray(e.content)&&e.content.length>0&&r(e.content)));return r(t)},"tiptapDocToCanonicalString",0,function(e){if(!e?.content||!Array.isArray(e.content))return"";let t=e=>{if(!e||"object"!=typeof e)return"";if("text"===e.type)return"string"==typeof e.text?e.text:"";if("hardBreak"===e.type)return"\n";if("dynamicVariable"===e.type){let t=e.attrs?.variable;return t?`<ycode-inline-variable>${JSON.stringify(t)}</ycode-inline-variable>`:""}return Array.isArray(e.content)?e.content.map(t).join(""):""};return e.content.map(t).map(e=>e.replace(/[ \t]+/g," ")).filter(e=>e.length>0).join("\n")}])},495398,e=>{"use strict";e.s(["buildFieldVariableData",()=>h,"formatDateWithPreset",()=>f,"formatNumberWithPreset",()=>m,"getDateFormatPreview",()=>y,"getDefaultFormatId",()=>p,"getFormatSectionsForFieldType",()=>u,"getNumberFormatPreview",()=>b,"isFormatValidForFieldType",()=>c,"isFormattableFieldType",()=>d]);var t=e.i(692326);let n=[{title:"Date and time",presets:[{id:"datetime-long",label:"March 26, 2026, 9:38 AM",options:{month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0}},{id:"datetime-short",label:"Mar 26, 2026, 9:38 AM",options:{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0}},{id:"datetime-24h",label:"Mar 26, 2026, 09:38",options:{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}}]},{title:"Date",presets:[{id:"date-long",label:"March 26, 2026",options:{month:"long",day:"numeric",year:"numeric"}},{id:"date-short",label:"Mar 26, 2026",options:{month:"short",day:"numeric",year:"numeric"}},{id:"date-full",label:"Thursday, March 26, 2026",options:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},{id:"date-short-weekday",label:"Thu, Mar 26, 2026",options:{weekday:"short",month:"short",day:"numeric",year:"numeric"}},{id:"date-us",label:"3/26/2026",options:{month:"numeric",day:"numeric",year:"numeric"},locale:"en-US"},{id:"date-eu",label:"26/03/2026",options:{day:"2-digit",month:"2-digit",year:"numeric"},locale:"en-GB"},{id:"date-eu-dot",label:"26.03.2026",options:{day:"2-digit",month:"2-digit",year:"numeric"},locale:"de-DE"},{id:"date-iso",label:"2026-03-26",options:{year:"numeric",month:"2-digit",day:"2-digit"},locale:"sv-SE"},{id:"date-month-year",label:"March 2026",options:{month:"long",year:"numeric"}},{id:"date-short-month-year",label:"Mar 2026",options:{month:"short",year:"numeric"}},{id:"date-day-month",label:"26 Mar",options:{day:"numeric",month:"short"}}]},{title:"Date parts",presets:[{id:"part-weekday-long",label:"Tuesday",detail
1:"Day name",options:{weekday:"long"}},{id:"part-weekday-short",label:"Tue",detail:"Day name (short)",options:{weekday:"short"}},{id:"part-month-long",label:"April",detail:"Month name",options:{month:"long"}},{id:"part-month-short",label:"Apr",detail:"Month name (short)",options:{month:"short"}},{id:"part-day",label:"7",detail:"Day",options:{day:"numeric"}},{id:"part-day-padded",label:"07",detail:"Day (zero-padded)",options:{day:"2-digit"}},{id:"part-year",label:"2026",detail:"Year",options:{year:"numeric"}},{id:"part-year-short",label:"26",detail:"Year (short)",options:{year:"2-digit"}}]},{title:"Time",presets:[{id:"time-12h",label:"9:38 AM",options:{hour:"numeric",minute:"2-digit",hour12:!0}},{id:"time-24h",label:"09:38",options:{hour:"2-digit",minute:"2-digit",hour12:!1}}]},{title:"Time parts",presets:[{id:"part-hour-12",label:"9",detail:"Hour (12h)",options:{hour:"numeric",hour12:!0},extractPart:"hour"},{id:"part-hour-12-padded",label:"09",detail:"Hour (12h, zero-padded)",options:{hour:"2-digit",hour12:!0},extractPart:"hour"},{id:"part-hour-24-short",label:"9",detail:"Hour (24h)",options:{hour:"numeric",hour12:!1},extractPart:"hour",stripLeadingZero:!0},{id:"part-hour-24",label:"09",detail:"Hour (24h, zero-padded)",options:{hour:"2-digit",hour12:!1},extractPart:"hour"},{id:"part-ampm",label:"AM",detail:"AM / PM",options:{hour:"numeric",hour12:!0},extractPart:"dayPeriod"},{id:"part-minute",label:"8",detail:"Minute",options:{hour:"numeric",minute:"numeric",hour12:!1},extractPart:"minute",stripLeadingZero:!0},{id:"part-minute-padded",label:"08",detail:"Minute (zero-padded)",options:{hour:"numeric",minute:"2-digit",hour12:!1},extractPart:"minute"}]}],r=n.filter(e=>"Date"===e.title||"Date parts"===e.title),i=n.flatMap(e=>e.presets),o=[{title:"Standard",presets:[{id:"number-integer",label:"12,345",options:{maximumFractionDigits:0,useGrouping:!0},sample:12345},{id:"number-decimal",label:"12,345.00",options:{minimumFractionDigits:2,maximumFractionDigits:2,useGrouping:!0},sample:12345},{id:"number-single-decimal",label:"12,345.0",options:{minimumFractionDigits:1,maximumFractionDigits:1,useGrouping:!0},sample:12345},{id:"number-plain",label:"12345",options:{maximumFractionDigits:0,useGrouping:!1},sample:12345},{id:"number-plain-decimal",label:"12345.00",options:{minimumFractionDigits:2,maximumFractionDigits:2,useGrouping:!1},sample:12345},{id:"number-compact",label:"12K",options:{notation:"compact",maximumFractionDigits:1},sample:12345}]},{title:"Percent",presets:[{id:"number-percent",label:"12%",options:{style:"percent",maximumFractionDigits:0},sample:.12},{id:"number-percent-decimal",label:"12.35%",options:{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2},sample:.1235}]}],s=o.flatMap(e=>e.presets),l=new Map(i.map(e=>[e.id,e])),a=new Map(s.map(e=>[e.id,e]));function d(e){return(0,t.isDateFieldType)(e)||"number"===e}function c(e,n){return!e||((0,t.isDateFieldType)(n)?l.has(e):"number"===n&&a.has(e))}function u(e){return"date"===e?n:"date_only"===e?r:"number"===e?o:[]}function p(e){return(0,t.isDateFieldType)(e)?"date-long":"number"===e?"number-integer":void 0}function h(e,t,n,r,i){let o=p(n);return{type:"field",data:{field_id:e,field_type:n,relationships:t,...o&&{format:o},...r&&{source:r},...i&&{collection_layer_id:i},..."global"===r&&{global_id:e}}}}function f(e,n,r="UTC"){let i="string"==typeof e?new Date(e):e;if(isNaN(i.getTime()))return"";let o="string"==typeof e&&(0,t.isDateOnlyString)(e)?"UTC":r,s=n?l.get(n):l.get("date-long");if(!s)return new Intl.DateTimeFormat("en-US",{timeZone:o,month:"long",day:"numeric",year:"numeric"}).format(i);try{let e=new Intl.DateTimeFormat(s.locale||"en-US",{timeZone:o,...s.options}),t=s.extractPart?e.formatToParts(i).find(e=>e.type===s.extractPart)?.value??"":e.format(i);return s.stripLeadingZero?t.replace(/^0/,""):t}catch{return""}}function m(e,t){let n=t?a.get(t):void 0;if(!n)return String(e);try{return new Intl.NumberFormat(n.locale||"en-US",n.options).format(e)}catch{return String(e)}}let g=new Date(2026,3,7,9,8);function y(e){try{let t=new Intl.DateTimeFormat(e.locale||"en-US",{...e.options}),n=e.extractPart?t.formatToParts(g).find(t=>t.type===e.extractPart)?.value??"":t.format(g);return e.stripLeadingZero?n.replace(/^0/,""):n}catch{return e.label}}function b(e){try{return new Intl.NumberFormat(e.locale||"en-US",e.options).format(e.sample)}catch{return e.label}}},61640,e=>{"use strict";e.s(["EMPTY_OVERRIDES",()=>l,"createAssetVariable",()=>u,"createDynamicRichTextVariable",()=>d,"createDynamicRichTextVariableFromPlainText",()=>c,"createDynamicTextVariable",()=>a,"createTextComponentVariableValue",()=>p,"extractTiptapFromComponentVariable",()=>f,"getAssetId",()=>y,"getDynamicTextContent",()=>g,"getIframeUrlFromVariable",()=>_,"getImageUrlFromVariable",()=>T,"getStaticTextContent",()=>b,"getVideoUrlFromVariable",()=>C,"isAssetVariable",()=>x,"isDynamicTextVariable",()=>w,"isFieldVariable",()=>v,"isStaticTextVariable",()=>k,"normalizeComponentVariableValue",()=>h,"resolveDesignStyles",()=>
1A,"tiptapEqual",()=>function e(t,n){let r=m(t),i=m(n);if(r&&i)return!0;if(r!==i||typeof t!=typeof n)return!1;if("object"!=typeof t)return t===n;if(Array.isArray(t))return!!Array.isArray(n)&&t.length===n.length&&t.every((t,r)=>e(t,n[r]));let o=Object.keys(t).filter(e=>!m(t[e])),s=Object.keys(n).filter(e=>!m(n[e]));return o.length===s.length&&o.every(r=>e(t[r],n[r]))}]);var t=e.i(365520),n=e.i(347802),r=e.i(597729),i=e.i(627419),o=e.i(896126),s=e.i(49026);let l={text:{},rich_text:{},image:{},link:{},audio:{},video:{},icon:{},variant:{},variableLinks:{}};function a(e){return{type:"dynamic_text",data:{content:e}}}function d(e){try{let t=JSON.parse(e);return{type:"dynamic_rich_text",data:{content:t}}}catch(t){return console.error("Failed to parse rich text JSON:",t),{type:"dynamic_rich_text",data:{content:(0,s.stringToTiptapContent)(e)}}}}function c(e){return{type:"dynamic_rich_text",data:{content:(0,s.stringToTiptapContent)(e)}}}function u(e){return{type:"asset",data:{asset_id:e}}}function p(e){return{type:"dynamic_ric
1h_text",data:{content:e}}}function h(e){return"string"==typeof e?{type:"dynamic_text",data:{content:e}}:"object"==typeof e&&null!==e?e:void 0}function f(e){let t={type:"doc",content:[{type:"paragraph"}]},n=h(e);return n?"type"in n&&"dynamic_rich_text"===n.type?n.data.content:"type"in n&&"dynamic_text"===n.type?(0,s.stringToTiptapContent)(n.data.content):t:t}function m(e){return!(!(null==e||Array.isArray(e)&&0===e.length)&&("object"!=typeof e||Array.isArray(e)||0!==Object.keys(e).length))}function g(e){return e?.data?.content||""}function y(e){return e?.data?.asset_id||""}function b(e){return e?.data?.content||""}function v(e){return e&&"object"==typeof e&&"field"===e.type&&e.data?.field_id}function x(e){return e&&"object"==typeof e&&"asset"===e.type&&void 0!==e.data}function w(e){return e&&"object"==typeof e&&"dynamic_text"===e.type&&e.data?.content!==void 0}function k(e){return e&&"object"==typeof e&&"static_text"===e.type&&e.data?.content!==void 0}function S(e){let t=(0,o.parseCollectionLinkValue)(e);return t?"url"===t.type?t.url||"":"asset"===t.type&&t.asset?.id||"":e}function T(e,o,s,l,a=!0){if(e){if(x(e)){if(!e.data.asset_id)return a?r.DEFAULT_ASSETS.IMAGE:void 0;if(!o)return;let t=o(e.data.asset_id);return t?.public_url?t.public_url:t?.content?(0,i.buildSvgDataUrl)(t.content,t.width,t.height):void 0}if(v(e)){let t=e.data.field_id;if(!t)return;let d=(0,n.buildFieldVariablePath)(t,e.data.relationships),c=(0,n.resolveFieldFromSources)(d,e.data.source,s,l);if(!c)return a?r.DEFAULT_ASSETS.IMAGE:void 0;let u=S(c);if(!u)return a?r.DEFAULT_ASSETS.IMAGE:void 0;if(o){let e=o(u);if(e?.public_url)return e.public_url;if(e?.content)return(0,i.buildSvgDataUrl)(e.content,e.width,e.height)}return u}if(w(e)){let n=e.data.content;return n.includes("<ycode-inline-variable>")?(0,t.resolveInlineVariablesFromData)(n,s,l):n}}}function C(e,i,o,s,l=!1){if(e&&"video"!==e.type){if(x(e)){if(!e.data.asset_id)return l?r.DEFAULT_ASSETS.VIDEO:void 0;if(!i)return;let t=i(e.data.asset_id);return t?.public_url||void 0}if(v(e)){let t=e.data.field_id;if(!t)return;let a=(0,n.buildFieldVariablePath)(t,e.data.relationships),d=(0,n.resolveFieldFromSources)(a,e.data.source,o,s);if(!d)return l?r.DEFAULT_ASSETS.VIDEO:void 0;let c=S(d);if(!c)return l?r.DEFAULT_ASSETS.VIDEO:void 0;if(i){let e=i(c);if(e?.public_url)return e.public_url}return c}if(w(e)){let n=e.data.content;return n.includes("<ycode-inline-variable>")?(0,t.resolveInlineVariablesFromData)(n,o,s):n}}}function _(e){if(e&&w(e))return e.data.content}let M={backgroundColor:"backgroundColor",color:"color",borderColor:"borderColor",divideColor:"--tw-divide-color",outlineColor:"outlineColor",textDecorationColor:"textDecorationColor"};function A(e,t){if(!e)return;let n={};for(let[r,i]of Object.entries(e)){if(!i)continue;let e=function(e,t){if("solid"===e.mode)return e.field?t(e.field)??null:null;let n="linear"===e.mode?e.linear:e.radial,r=n?.stops;if(!r||0===r.length)return null;let i=r.map(e=>{let n=function(e){let t=e.match(/^#([0-9a-fA-F]{6})\/(\d+)$/);if(!t)return e;let n=parseInt(t[1].slice(0,2),16),r=parseInt(t[1].slice(2,4),16),i=parseInt(t[1].slice(4,6),16),o=parseInt(t[2],10)/100;return`rgba(${n},${r},${i},${o})`}(e.color),r=e.field&&t(e.field)||n;return`${r} ${e.position}%`});if("linear"===e.mode){let e=n&&"angle"in n?n.angle??90:90;return`linear-gradient(${e}deg, ${i.join(", ")})`}return`radial-gradient(circle, ${i.join(", ")})`}(i,t),o=M[r];e&&o&&(n["backgroundColor"===o&&e.includes("gradient")?"background":o]=e)}return Object.keys(n).length>0?n:void 0}},10552,428762,674729,827121,571141,929987,e=>{"use strict";function t(e){this.content=e}t.prototype={constructor:t,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 -1==t?void 0:this.content[t+1]},update:function(e,n,r){var i=r&&r!=e?this.remove(r):this,o=i.find(e),s=i.content.slice();return -1==o?s.push(r||e,n):(s[o+1]=n,r&&(s[o]=r)),new t(s)},remove:function(e){var n=this.find(e);if(-1==n)return this;var r=this.content.slice();return r.splice(n,2),new t(r)},addToStart:function(e,n){return new t([e,n].concat(this.remove(e).content))},addToEnd:function(e,n){var r=this.remove(e).content.slice();return r.push(e,n),new t(r)},addBefore:function(e,n,r){var i=this.remove(n),o=i.content.slice(),s=i.find(e);return o.splice(-1==s?o.length:s,0,n,r),new t(o)}
vendor: 5,097 bytes, line 1
1,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=t.from(e)).size?new t(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=t.from(e)).size?new t(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var n=this;e=t.from(e);for(var r=0;r<e.content.length;r+=2)n=n.remove(e.content[r]);return n},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},t.from=function(e){if(e instanceof t)return e;var n=[];if(e)for(var r in e)n.push(r,e[r]);return new t(n)};class n{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let o=0,s=0;s<t;o++){let l=this.content[o],a=s+l.nodeSize;if(a>e&&!1!==n(l,r+s,i||null,o)&&l.content.size){let i=s+1;l.nodesBetween(Math.max(0,e-i),Math.min(l.content.size,t-i),n,r+i)}s=a}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i="",o=!0;return this.nodesBetween(e,t,(s,l)=>{let a=s.isText?s.text.slice(Math.max(e,l)-l,t-l):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&a||s.isTextblock)&&n&&(o?o=!1:i+=n),i+=a},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new n(i,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let r=[],i=0;if(t>e)for(let n=0,o=0;o<t;n++){let s=this.content[n],l=o+s.nodeSize;l>e&&((o<e||l>t)&&(s=s.isText?s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),r.push(s),i+=s.nodeSize),o=l}return new n(r,i)}cutByIndex(e,t){return e==t?n.empty:0==e&&t==this.content.length?this:new n(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new n(i,o)}addToStart(e){return new n([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new n(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))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(e){let t=this.content[e];if(!t)throw RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return function e(t,n,r){for(let i=0;;i++){if(i==t.childCount||i==n.childCount)return t.childCount==n.childCount?null:r;let o=t.child(i),s=n.child(i);if(o==s){r+=o.nodeSize;continue}if(!o.sameMarkup(s))return r;if(o.isText&&o.text!=s.text){for(let e=0;o.text[e]==s.text[e];e++)r++;return r}if(o.content.size||s.content.size){let t=e(o.content,s.content,r+1);if(null!=t)return t}r+=o.nodeSize}}(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return function e(t,n,r,i){for(let o=t.childCount,s=n.childCount;;){if(0==o||0==s)return o==s?null:{a:r,b:i};let l=t.child(--o),a=n.child(--s),d=l.nodeSize;if(l==a){r-=d,i-=d;continue}if(!l.sameMarkup(a))return{a:r,b:i};if(l.isText&&l.text!=a.text){let e=0,t=Math.min(l.text.length,a.text.length);for(;e<t&&l.text[l.text.length-e-1]==a.text[a.text.length-e-1];)e++,r--,i--;return{a:r,b:i}}if(l.content.size||a.content.size){let t=e(l.content,a.content,r-1,i-1);if(t)return t}r-=d,i-=d}}(this,e,t,n)}findIndex(e){if(0==e)return i(0,e);if(e==this.size)return i(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=n+this.child(t).nodeSize;if(r>=e){if(r==e)return i(t+1,r);return i(t,n)}n=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return n.empty;if(!Array.isArray(t))throw RangeError("Invalid input for Fragment.fromJSON");return new n(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return n.empty;let t,r=0;for(let n=0;n<e.length;n++){let i=e[n];r+=i.nodeSize,n&&i.isText&&e[n-1].sameMarkup(i)?(t||(t=e.slice(0,n)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new n(t||e,r)}static from(e){if(!e)return n.empty;if(e instanceof n)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new n([e],e.nodeSize);throw RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}n.empty=new n([],0);let r={index:0,offset:0};function i(e,t){return r.index=e,r.offset=t,r}function o(e,t){if(e===t)return!0;
vendor: 6,822 bytes, line 1
1if(!(e&&"object"==typeof e)||!(t&&"object"==typeof t))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 n=0;n<e.length;n++)if(!o(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!o(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class s{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&o(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return s.none;if(e instanceof s)return[e];let t=e.slice();return t.sort((e,t)=>e.type.rank-t.type.rank),t}}s.none=[];class l extends Error{}class a{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=function e(t,n,r,i){let{index:o,offset:s}=t.findIndex(n),l=t.maybeChild(o);if(s==n||l.isText)return i&&!i.canReplace(o,o,r)?null:t.cut(0,n).append(r).append(t.cut(n));let a=e(l.content,n-s-1,r,l);return a&&t.replaceChild(o,l.copy(a))}(this.content,e+this.openStart,t);return n&&new a(n,this.openStart,this.openEnd)}removeBetween(e,t){return new a(function e(t,n,r){let{index:i,offset:o}=t.findIndex(n),s=t.maybeChild(i),{index:l,offset:a}=t.findIndex(r);if(o==n||s.isText){if(a!=r&&!t.child(l).isText)throw RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(r))}if(i!=l)throw RangeError("Removing non-flat range");return t.replaceChild(i,s.copy(e(s.content,n-o-1,r-o-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return a.empty;let r=t.openStart||0,i=t.openEnd||0;if("number"!=typeof r||"number"!=typeof i)throw RangeError("Invalid input for Slice.fromJSON");return new a(n.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new a(e,n,r)}}function d(e,t){if(!t.type.compatibleContent(e.type))throw new l("Cannot join "+t.type.name+" onto "+e.type.name)}function c(e,t,n){let r=e.node(n);return d(r,t.node(n)),r}function u(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 p(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(u(e.nodeAfter,r),o++));for(let e=o;e<s;e++)u(i.child(e),r);t&&t.depth==n&&t.textOffset&&u(t.nodeBefore,r)}function h(e,t){return e.type.checkContent(t),e.copy(t)}function f(e,t,r){let i=[];return p(null,e,r,i),e.depth>r&&u(h(c(e,t,r+1),f(e,t,r+1)),i),p(t,null,r,i),new n(i)}a.empty=new a(n.empty,0,0);class m{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return s.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||r&&i[o].isInSet(r.marks)||(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new v(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let t=e;;){let{index:e,offset:o}=t.content.findIndex(i),s=i-o;if(n.push(t,e,r+o),!s||(t=t.child(e)).isText)break;
1i=s-1,r+=o+1}return new m(t,n,i)}static resolveCached(e,t){let n=b.get(e);if(n)for(let e=0;e<n.elts.length;e++){let r=n.elts[e];if(r.pos==t)return r}else b.set(e,n=new g);let r=n.elts[n.i]=m.resolve(e,t);return n.i=(n.i+1)%y,r}}class g{constructor(){this.elts=[],this.i=0}}let y=12,b=new WeakMap;class v{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}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)}}let x=Object.create(null);class w{constructor(e,t,r,i=s.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||n.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&o(this.attrs,t||e.defaultAttrs||x)&&s.sameSet(this.marks,n||s.none)}copy(e=null){return e==this.content?this:new w(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new w(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return a.empty;let r=this.resolve(e),i=this.resolve(t),o=n?0:r.sharedDepth(t),s=r.start(o);return new a(r.node(o).content.cut(r.pos-s,i.pos-s),r.depth-o,i.depth-o)}replace(e,t,r){var i=this.resolve(e),o=this.resolve(t);if(r.openStart>i.depth)throw new l("Inserted content deeper than insertion position");if(i.depth-r.openStart!=o.depth-r.openEnd)throw new l("Inconsistent open depths");return function e(t,r,i,o){let s=t.index(o),l=t.node(o);if(s==r.index(o)&&o<t.depth-i.openStart){let n=e(t,r,i,o+1);return l.copy(l.content.replaceChild(s,n))}if(!i.content.size)return h(l,f(t,r,o));if(i.openStart||i.openEnd||t.depth!=o||r.depth!=o){let{start:e,end:s}=function(e,t){let r=t.depth-e.openStart,i=t.node(r).copy(e.content);for(let e=r-1;e>=0;e--)i=t.node(e).copy(n.from(i));return{start:i.resolveNoCache(e.openStart+r),end:i.resolveNoCache(i.content.size-e.openEnd-r)}}(i,t);return h(l,function e(t,r,i,o,s){let l=t.depth>s&&c(t,r,s+1),a=o.depth>s&&c(i,o,s+1),m=[];return p(null,t,s,m),l&&a&&r.index(s)==i.index(s)?(d(l,a),u(h(l,e(t,r,i,o,s+1)),m)):(l&&u(h(l,f(t,r,s+1)),m),p(r,i,s,m),a&&u(h(a,f(i,o,s+1)),m)),p(o,null,s,m),new n(m)}(t,e,s,r,o))}{let e=t.parent,n=e.content;return h(e,n.cut(0,t.parentOffset).append(i.content).append(n.cut(r.parentOffset)))}}(i,o,r,0)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(!(t=t.maybeChild(n)))return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return m.resolveCached(this,e)}resolveNoCache(e){return m.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}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}
1toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),S(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=n.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let e=i;e<o;e++)if(!this.type.allowsMarks(r.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),o=i&&i.matchFragment(this.content,t);return!!o&&o.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=s.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!s.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){let r;if(!t)throw RangeError("Invalid input for Node.fromJSON");if(t.marks){if(!Array.isArray(t.marks))throw RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=n.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,i,r);return o.type.checkAttrs(o.attrs),o}}w.prototype.text=void 0;class k extends w{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):S(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new k(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new k(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function S(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class T{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){var n;let r,i=new C(e,t);if(null==i.next)return T.empty;let o=function e(t){let n=[];do n.push(function(t){let n=[];do n.push(function(t){let n=function(t){if(t.eat("(")){let n=e(t);return t.eat(")")||t.err("Missing closing paren"),n}if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=(function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return 0==i.length&&e.err("No node type or group '"+t+"' found"),i})(t,t.next).map(e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}}(t);for(;;)if(t.eat("+"))n={type:"plus",expr:n};else if(t.eat("*"))n={type:"star",expr:n};else if(t.eat("?"))n={type:"opt",expr:n};else if(t.eat("{"))n=function(e,t){let n=_(e),r=n;return e.eat(",")&&(r="}"!=e.next?_(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}(t,n);else break;return n}(t));while(t.next&&")"!=t.next&&"|"!=t.next)return 1==n.length?n[0]:{type:"seq",exprs:n}}(t));while(t.eat("|"))return 1==n.length?n[0]:{type:"choice",exprs:n}}(i);i.next&&i.err("Unexpected trailing text");let s=(n=function(e){let t=[[]];return i(function e(t,o){if("choice"==t.type)return t.exprs.reduce((t,n)=>t.concat(e(n,o)),[]);if("seq"==t.type)for(let r=0;;r++){let s=e(t.exprs[r],o);if(r==t.exprs.length-1)return s;i(s,o=n())}else if("star"==t.type){let s=n();return r(o,s),i(e(t.expr,s),s),[r(s)]}else if("plus"==t.type){let s=n();return i(e(t.expr,o),s),i(e(t.expr,s),s),[r(s)]}else if("opt"==t.type)return[r(o)].concat(e(t.expr,o));else if("range"==t.type){let s=o;for(let r=0;r<t.min;r++){let r=n();i(e(t.expr,s),r),s=r}if(-1==t.max)i(e(t.expr,s),s);else for(let o=t.min;o<t.max;o++){let o=n();r(s,o),i(e(t.expr,s),o),s=o}return[r(s)]}else if("name"==t.type)return[r(o,void 0,t.value)];else throw Error("Unknown expr type")}(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}
vendor: 5,547 bytes, line 1
1function i(e,t){e.forEach(e=>e.to=t)}}(o),r=Object.create(null),function e(t){let i=[];t.forEach(e=>{n[e].forEach(({term:e,to:t})=>{let r;if(e){for(let t=0;t<i.length;t++)i[t][0]==e&&(r=i[t][1]);A(n,t).forEach(t=>{r||i.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)})}})});let o=r[t.join(",")]=new T(t.indexOf(n.length-1)>-1);for(let t=0;t<i.length;t++){let n=i[t][1].sort(M);o.next.push({type:i[t][0],next:r[n.join(",")]||e(n)})}return o}(A(n,0)));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,o=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];o.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),-1==r.indexOf(s)&&r.push(s)}i&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(s,i),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];return function o(s,l){let a=s.matchFragment(e,r);if(a&&(!t||a.validEnd))return n.from(l.map(e=>e.createAndFill()));for(let e=0;e<s.next.length;e++){let{type:t,next:n}=s.next[e];if(!(t.isText||t.hasRequiredAttrs())&&-1==i.indexOf(n)){i.push(n);let e=o(n,l.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:o,next:s}=i.next[e];o.isLeaf||o.hasRequiredAttrs()||o.name in t||r.type&&!s.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),t[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return!function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)r+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return r}).join("\n")}}T.empty=new T(!0);class C{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.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(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+" (in content expression '"+this.string+"')")}}function _(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function M(e,t){return t-e}function A(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e<i.length;e++){let{term:r,to:o}=i[e];r||-1!=n.indexOf(o)||t(o)}}(t),n.sort(M)}function E(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 O(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(void 0===i){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function N(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function D(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new $(e,r,t[r]);return n}class I{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=D(e,n.attrs),this.defaultAttrs=E(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==T.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:O(this.attrs,e)}create(e=null,t,r){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new w(this,this.computeAttrs(e),n.from(t),s.setFrom(r))}createChecked(e=null,t,r){return t=n.from(t),this.checkContent(t),new w(this,this.computeAttrs(e),t,s.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),(t=n.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(n.empty,!0);return o?new w(this,e,t.append(o),s.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);
1if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){N(this.attrs,e,"node",this.name)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){let t;if(null==this.markSet)return e;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:s.none:e}static compile(e,t){let n=Object.create(null);e.forEach((e,r)=>n[e]=new I(e,t,r));let r=t.spec.topNode||"doc";if(!n[r])throw RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw RangeError("Every schema needs a 'text' type");for(let e in n.text.attrs)throw RangeError("The text node type should not have attributes");return n}}class ${constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(e,t,n){let r=n.split("|");return n=>{let i=null===n?"null":typeof n;if(0>r.indexOf(i))throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class R{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=D(e,r.attrs),this.excluded=null;let i=E(this.attrs);this.instance=i?new s(this,i):null}create(e=null){return!e&&this.instance?this.instance:new s(this,O(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach((e,i)=>n[e]=new R(e,r++,t,i)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){N(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class P{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let t in e)n[t]=e[t];n.nodes=t.from(e.nodes),n.marks=t.from(e.marks||{}),this.nodes=I.compile(this.spec.nodes,this),this.marks=R.compile(this.spec.marks,this);let r=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+" can not be both a node and a mark");let t=this.nodes[e],n=t.spec.content||"",i=t.spec.marks;if(t.contentMatch=r[n]||(r[n]=T.parse(n,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError("Multiple linebreak nodes defined");if(!t.isInline||!t.isLeaf)throw RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=t}t.markSet="_"==i?null:i?z(this,i.split(" ")):""!=i&&t.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:z(this,n.split(" "))}this.nodeFromJSON=e=>w.fromJSON(this,e),this.markFromJSON=e=>s.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else if(e instanceof I){if(e.schema!=this)throw RangeError("Node type from different schema used ("+e.name+")")}else throw RangeError("Invalid node type: "+e);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new k(n,n.defaultAttrs,e,s.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError("Unknown node type: "+e);return t}}function z(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],s=o;if(o)n.push(o);else for(let t in e.marks){let r=e.marks[t];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=r)}if(!s)throw SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class L{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];
1t.forEach(e=>{if(null!=e.tag)this.tags.push(e);else if(null!=e.style){let t=/[^=]*/.exec(e.style)[0];0>n.indexOf(t)&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new H(this,t,!1);return n.addAll(e,s.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new H(this,t,!0);return n.addAll(e,s.none,t.from,t.to),a.maxOpen(n.finish())}matchTag(e,t,n){for(let o=n?this.tags.indexOf(n)+1:0;o<this.tags.length;o++){var r,i;let n=this.tags[o];if(r=e,i=n.tag,(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,i)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],o=r.style;if(0==o.indexOf(e)&&(!r.context||n.matchesContext(r.context))&&(!(o.length>e.length)||61==o.charCodeAt(e.length)&&o.slice(e.length+1)==t)){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=U(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=U(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new L(e,L.schemaRules(e)))}}let F={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},j={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},W={ol:!0,ul:!0};function B(e,t,n){return null!=t?!!t|2*("full"===t):e&&"pre"==e.whitespace?3:-5&n}class V{constructor(e,t,n,r,i,o){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=o,this.content=[],this.activeMarks=s.none,this.match=i||(4&o?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(n.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e=this.content[this.content.length-1],t;e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))&&(e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=e.withText(e.text.slice(0,e.text.length-t[0].length)))}let t=n.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(n.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!F.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class H{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,o=B(null,t.preserveWhitespace,0)|4*!!n;i=r?new V(r.type,r.attrs,s.none,!0,t.topMatch||r.type.contentMatch,o):n?new V(null,null,s.none,!0,null,o):new V(e.schema.topNodeType,null,s.none,!0,null,o),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=2&r.options?"full":this.localPreserveWS||(1&r.options)>0,{schema:o}=this.parser;if("full"===i||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(i)if("full"===i)n=n.replace(/\r\n?/g,"\n");else if(o.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(o.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(o.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(o.text(e[n]),t,!/\S/.test(e[n]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&"BR"==i.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(o.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),s;W.hasOwnProperty(o)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&W.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(s=this.parser.matchTag(e,this,n));e:if(l?l.ignore:j.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let n,r=this.needsBlock;if(F.hasOwnProperty(o))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let s=l&&l.skip?t:this.readStyles(e,t);s&&this.addAll(e,s),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,l,n,!1===l.consuming?s:void 0)}this.localPreserveWS=r}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),!1===n.consuming)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,o;
vendor: 4,107 bytes, line 1
1if(t.node)if((o=this.parser.schema.nodes[t.node]).isLeaf)this.insertNode(o.create(t.attrs),n,"BR"==e.nodeName)||this.leafFallback(e,n);else{let e=this.enter(o,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;"string"==typeof t.contentElement?r=e.querySelector(t.contentElement):"function"==typeof t.contentElement?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(s)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=null==r?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,o=0;t>=0;t--){let s=this.nodes[t],l=s.findWrapping(e);if(l&&(!r||r.length>l.length+o)&&(r=l,i=s,!l.length))break;if(s.solid){if(n)break;o+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&(t.match=t.match.matchType(e.type));let n=s.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):J(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&(i=this.enterInner(e,t,n,!0,r)),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=B(e,i,o.options);4&o.options&&0==o.content.length&&(l|=4);let a=s.none;return n=n.filter(t=>(o.type?!o.type.allowsMarkType(t.type):!J(t.type,e))||(a=t.addToSet(a),!1)),this.nodes.push(new V(e,t,a,r,null,l)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));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(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=1);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,o=(e,s)=>{for(;e>=0;e--){let l=t[e];if(""==l){if(e==t.length-1||0==e)continue;for(;s>=i;s--)if(o(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!e||e.name!=l&&!e.isInGroup(l))return!1;s--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];
1if(t.isTextblock&&t.defaultAttrs)return t}}}function U(e){let t={};for(let n in e)t[n]=e[n];return t}function J(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=e=>{o.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||0>o.indexOf(i)&&s(i))return!0}};if(s(i.contentMatch))return!0}}class q{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=G(t).createDocumentFragment());let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,o=0;for(;n<i.length&&o<e.marks.length;){let t=e.marks[o];if(!this.marks[t.type.name]){o++;continue}if(!t.eq(i[n][0])||!1===t.type.spec.spanning)break;n++,o++}for(;n<i.length;)r=i.pop()[1];for(;o<e.marks.length;){let n=e.marks[o++],s=this.serializeMark(n,e.isInline,t);s&&(i.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=X(G(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&X(G(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return X(e,t,n,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new q(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=K(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return K(e.marks)}}function K(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function G(e){return e.document||window.document}let Y=new WeakMap;function X(e,t,n,r){let i,o,s;if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let l=t[0],a;if("string"!=typeof l)throw RangeError("Invalid array passed to renderSpec");if(r&&(void 0===(o=Y.get(r))&&Y.set(r,(s=null,!function e(t){if(t&&"object"==typeof t)if(Array.isArray(t))if("string"==typeof t[0])s||(s=[]),s.push(t);else for(let n=0;n<t.length;n++)e(t[n]);else for(let n in t)e(t[n])}(r),o=s)),a=o)&&a.indexOf(t)>-1)throw RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let d=l.indexOf(" ");d>0&&(n=l.slice(0,d),l=l.slice(d+1));let c=n?e.createElementNS(n,l):e.createElement(l),u=t[1],p=1;if(u&&"object"==typeof u&&null==u.nodeType&&!Array.isArray(u)){for(let e in p=2,u)if(null!=u[e]){let t=e.indexOf(" ");t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),u[e]):"style"==e&&c.style?c.style.cssText=u[e]:c.setAttribute(e,u[e])}}for(let o=p;o<t.length;o++){let s=t[o];if(0===s){if(o<t.length-1||o>p)throw RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}{let{dom:t,contentDOM:o}=X(e,s,n,r);if(c.appendChild(t),o){if(i)throw RangeError("Multiple content holes");i=o}}}return{dom:c,contentDOM:i}}e.s(["DOMParser",0,L,"DOMSerializer",0,q,"Fragment",0,n,"Mark",0,s,"MarkType",0,R,"Node",0,w,"NodeRange",0,v,"ReplaceError",0,l,"Schema",0,P,"Slice",0,a],428762);class Z{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class Q{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Q.empty)return Q.empty}recover(e){let t=0,n=65535&e;if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+(e-(65535&e))/65536}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,o=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>e)break;let a=this.ranges[s+i],d=this.ranges[s+o],c=l+a;if(e<=c){let i=a?e==l?-1:e==c?1:t:t,o=l+r+(i<0?0:d);if(n)return o;
vendor: 4,143 bytes, line 1
1let u=e==(t<0?l:c)?null:s/3+(e-l)*65536,p=e==l?2:e==c?1:4;return(t<0?e!=l:e!=c)&&(p|=8),new Z(o,p,u)}r+=d-a}return n?e+r:new Z(e+r,0,null)}touches(e,t){let n=0,r=65535&t,i=this.inverted?2:1,o=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let s=this.ranges[t]-(this.inverted?n:0);if(s>e)break;let l=this.ranges[t+i];if(e<=s+l&&t==3*r)return!0;n+=this.ranges[t+o]-l}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],s=o-(this.inverted?i:0),l=o+(this.inverted?0:i),a=this.ranges[r+t],d=this.ranges[r+n];e(s,s+a,l,l+d),i+=d-a}}invert(){return new Q(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?Q.empty:new Q(e<0?[0,-e,0]:[0,0,e])}}Q.empty=new Q([]);class ee{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new ee(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),null!=t&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new ee;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(null!=i.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new Z(e,r,null)}}let et=Object.create(null);class en{getMap(){return Q.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError("Invalid input for Step.fromJSON");let n=et[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in et)throw RangeError("Duplicate use of step JSON ID "+e);return et[e]=t,t.prototype.jsonID=e,t}}class er{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new er(e,null)}static fail(e){return new er(null,e)}static fromReplace(e,t,n,r){try{return er.ok(e.replace(t,n,r))}catch(e){if(e instanceof l)return er.fail(e.message);throw e}}}function ei(e,t,r){let i=[];for(let n=0;n<e.childCount;n++){let o=e.child(n);o.content.size&&(o=o.copy(ei(o.content,t,o))),o.isInline&&(o=t(o,r,n)),i.push(o)}return n.fromArray(i)}class eo extends en{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new a(ei(t.content,(e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,r),t.openStart,t.openEnd);return er.fromReplace(e,this.from,this.to,i)}invert(){return new es(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new eo(t.pos,n.pos,this.mark)}merge(e){return e instanceof eo&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new eo(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new eo(t.from,t.to,e.markFromJSON(t.mark))}}en.jsonID("addMark",eo);class es extends en{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}
vendor: 17,241 bytes, line 1
1apply(e){let t=e.slice(this.from,this.to),n=new a(ei(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return er.fromReplace(e,this.from,this.to,n)}invert(){return new eo(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new es(t.pos,n.pos,this.mark)}merge(e){return e instanceof es&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new es(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new es(t.from,t.to,e.markFromJSON(t.mark))}}en.jsonID("removeMark",es);class el extends en{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return er.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return er.fromReplace(e,this.pos,this.pos+1,new a(n.from(r),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new el(this.pos,t.marks[n]);return new el(this.pos,this.mark)}}return new ea(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new el(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new el(t.pos,e.markFromJSON(t.mark))}}en.jsonID("addNodeMark",el);class ea extends en{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return er.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return er.fromReplace(e,this.pos,this.pos+1,new a(n.from(r),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new el(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ea(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new ea(t.pos,e.markFromJSON(t.mark))}}en.jsonID("removeNodeMark",ea);class ed extends en{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&eu(e,this.from,this.to)?er.fail("Structure replace would overwrite content"):er.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Q([this.from,this.to-this.from,this.slice.size])}invert(e){return new ed(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new ed(t.pos,Math.max(t.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof ed)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart)if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;else{let t=this.slice.size+e.slice.size==0?a.empty:new a(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ed(e.from,this.to,t,this.structure)}{let t=this.slice.size+e.slice.size==0?a.empty:new a(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ed(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new ed(t.from,t.to,a.fromJSON(e,t.slice),!!t.structure)}}en.jsonID("replace",ed);class ec extends en{constructor(e,t,n,r,i,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(e){if(this.structure&&(eu(e,this.from,this.gapFrom)||eu(e,this.gapTo,this.to)))return er.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return er.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?er.fromReplace(e,this.from,this.to,n):er.fail("Content does not fit in gap")}getMap(){return new Q([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new ec(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||i>n.pos?null:new ec(t.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ec(t.from,t.to,t.gapFrom,t.gapTo,a.fromJSON(e,t.slice),t.insert,!!t.structure)}}function eu(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 e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function ep(e,t,r,i=r.contentMatch,o=!0){let s=e.doc.nodeAt(t),l=[],d=t+1;for(let t=0;t<s.childCount;t++){let c=s.child(t),u=d+c.nodeSize,p=i.matchType(c.type);if(p){i=p;for(let t=0;t<c.marks.length;t++)r.allowsMarkType(c.marks[t].type)||e.step(new es(d,u,c.marks[t]));if(o&&c.isText&&"pre"!=r.whitespace){let e,t=/\r?\n|\r/g,i;for(;e=t.exec(c.text);)i||(i=new a(n.from(r.schema.text(" ",r.allowedMarks(c.marks))),0,0)),l.push(new ed(d+e.index,d+e.index+e[0].length,i))}}else l.push(new ed(d,u,a.empty));d=u}if(!i.validEnd){let t=i.fillBefore(n.empty,!0);e.replace(d,d,new a(t,0,0))}for(let t=l.length-1;t>=0;t--)e.step(l[t])}function eh(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let o=e.$from.node(n),s=e.$from.index(n)+r,l=e.$to.indexAfter(n)-i;if(n<e.depth&&o.canReplace(s,l,t))return n;if(0==n||o.type.spec.isolating||!((0==s||o.canReplace(s,o.childCount))&&(l==o.childCount||o.canReplace(0,l))))break;s&&(r=1),l<o.childCount&&(i=1)}return null}function ef(e,t,n=null,r=e){let i=function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let s=o.length?o[0]:t;return n.canReplaceWith(r,i,s)?o:null}(e,t),o=i&&function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),s=t.contentMatch.findWrapping(o.type);if(!s)return null;let l=(s.length?s[s.length-1]:t).contentMatch;for(let e=r;l&&e<i;e++)l=l.matchType(n.child(e).type);return l&&l.validEnd?s:null}(r,t);return o?i.map(em).concat({type:t,attrs:n}).concat(o.map(em)):null}function em(e){return{type:e,attrs:null}}function eg(e,t,n,r){t.forEach((i,o)=>{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let i=e.mapping.slice(r).map(n+1+o+s.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function ey(e,t,n,r){t.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+o);e.replaceWith(i,i+1,t.type.schema.text("\n"))}})}function eb(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>o;e--,t--){let n=i.node(e),o=i.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(o,n.childCount),l=r&&r[t+1];l&&(s=s.replaceChild(0,l.type.create(l.attrs)));let a=r&&r[t]||n;if(!n.canReplace(o+1,n.childCount)||!a.type.validContent(s))return!1}let l=i.indexAfter(o),a=r&&r[0];return i.node(o).canReplaceWith(l,l,a?a.type:i.node(o+1).type)}function ev(e,t){let n=e.resolve(t),r=n.index();return ex(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function ex(e,t){return!!(e&&t&&!e.isLeaf&&function(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),s=o.type==r?e.type.schema.nodes.text:o.type;if(!(n=n.matchType(s))||!e.type.allowsMarks(o.marks))return!1}return n.validEnd}(e,t))}function ew(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,o,s=r.index(e);if(e==r.depth?(i=r.nodeBefore,o=r.nodeAfter):n>0?(i=r.node(e+1),s++,o=r.node(e).maybeChild(s)):(i=r.node(e).maybeChild(s-1),o=r.node(e+1)),i&&!i.isTextblock&&ex(i,o)&&r.node(e).canReplace(s,s+1))return t;if(0==e)break;t=n<0?r.before(e):r.after(e)}}function ek(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,o=r.index(t)+ +(n>0),s=r.node(t),l=!1;if(1==e)l=s.canReplace(o,o,i);else{let e=s.contentMatchAt(o).findWrapping(i.firstChild.type);l=e&&s.canReplaceWith(o,o,e[0])}if(l)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function eS(e,t,n=t,r=a.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return eT(i,o,r)?new ed(t,n,r):new eC(i,o,r).fit()}function eT(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}en.jsonID("replaceAround",ec);class eC{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=n.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=n.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,o=n.depth,s=r.depth;for(;o&&s&&1==i.childCount;)i=i.firstChild.content,o--,s--;let l=new a(i,o,s);return e>-1?new ec(n.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||n.pos!=this.$to.pos?new ed(n.pos,r.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let r=1==t?e:this.unplaced.openStart;r>=0;r--){let e=null,i=(r?(e=eA(this.unplaced.content,r-1).firstChild).content:this.unplaced.content).firstChild;for(let o=this.depth;o>=0;o--){let{type:s,match:l}=this.frontier[o],a,d=null;if(1==t&&(i?l.matchType(i.type)||(d=l.fillBefore(n.from(i),!1)):e&&s.compatibleContent(e.type)))return{sliceDepth:r,frontierDepth:o,parent:e,inject:d};if(2==t&&i&&(a=l.findWrapping(i.type)))return{sliceDepth:r,frontierDepth:o,parent:e,wrap:a};if(e&&l.matchType(e.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=eA(e,t);return!!r.childCount&&!r.firstChild.isLeaf&&(this.unplaced=new a(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=eA(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new a(e_(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new a(e_(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let e=0;e<o.length;e++)this.openFrontierNode(o[e]);let s=this.unplaced,l=r?r.content:s.content,d=s.openStart-e,c=0,u=[],{match:p,type:h}=this.frontier[t];if(i){for(let e=0;e<i.childCount;e++)u.push(i.child(e));p=p.matchFragment(i)}let f=l.size+e-(s.content.size-s.openEnd);for(;c<l.childCount;){let e=l.child(c),t=p.matchType(e.type);if(!t)break;(++c>1||0==d||e.content.size)&&(p=t,u.push(function e(t,r,i){if(r<=0)return t;let o=t.content;return r>1&&(o=o.replaceChild(0,e(o.firstChild,r-1,1==o.childCount?i-1:0))),r>0&&(o=t.type.contentMatch.fillBefore(o).append(o),i<=0&&(o=o.append(t.type.contentMatch.matchFragment(o).fillBefore(n.empty,!0)))),t.copy(o)}(e.mark(h.allowedMarks(e.marks)),1==c?d:0,c==l.childCount?f:-1)))}let m=c==l.childCount;m||(f=-1),this.placed=eM(this.placed,t,n.from(u)),this.frontier[t].match=p,m&&f<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=l;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=m?0==e?a.empty:new a(e_(s.content,e-1,1),e-1,f<0?s.openEnd:e-1):new a(e_(s.content,e,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!eE(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return -1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){t:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=eE(e,t,r,n,i);if(o){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=eE(e,n,r,t,!0);if(!i||i.childCount)continue t}return{depth:t,fit:o,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=eM(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=eM(this.placed,this.depth,n.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(n.empty,!0);e.childCount&&(this.placed=eM(this.placed,this.frontier.length,e))}}function e_(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(e_(e.firstChild.content,t-1,n)))}function eM(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(eM(e.lastChild.content,t-1,n)))}function eA(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function eE(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,o.content,s)?l:null}function eO(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<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;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}class eN extends en{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return er.fail("No node at attribute step's position");let r=Object.create(null);for(let e in t.attrs)r[e]=t.attrs[e];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return er.fromReplace(e,this.pos,this.pos+1,new a(n.from(i),0,+!t.isLeaf))}getMap(){return Q.empty}invert(e){return new eN(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new eN(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new eN(t.pos,t.attr,t.value)}}en.jsonID("attr",eN);class eD extends en{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return er.ok(n)}getMap(){return Q.empty}invert(e){return new eD(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new eD(t.attr,t.value)}}en.jsonID("docAttr",eD);
1let eI=class extends Error{};(eI=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype),eI.prototype.constructor=eI,eI.prototype.name="TransformError";class e${constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ee}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new eI(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,o)=>{e=Math.min(e,i),t=Math.max(t,o)})}return 1e9==e?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=a.empty){let r=eS(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,r){return this.replace(e,t,new a(n.from(r),0,0))}delete(e,t){return this.replace(e,t,a.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return!function(e,t,r,i){if(!i.size)return e.deleteRange(t,r);let o=e.doc.resolve(t),s=e.doc.resolve(r);if(eT(o,s,i))return e.step(new ed(t,r,i));let l=eO(o,s);0==l[l.length-1]&&l.pop();let d=-(o.depth+1);l.unshift(d);for(let e=o.depth,t=o.pos-1;e>0;e--,t--){let n=o.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;l.indexOf(e)>-1?d=e:o.before(e)==t&&l.splice(1,0,-e)}let c=l.indexOf(d),u=[],p=i.openStart;for(let e=i.content,t=0;;t++){let n=e.firstChild;if(u.push(n),t==i.openStart)break;e=n.content}for(let e=p-1;e>=0;e--){var h;let t=u[e],n=(h=t.type).spec.defining||h.spec.definingForContent;if(n&&!t.sameMarkup(o.node(Math.abs(d)-1)))p=e;else if(n||!t.type.isTextblock)break}for(let t=i.openStart;t>=0;t--){let d=(t+p+1)%(i.openStart+1),h=u[d];if(h)for(let t=0;t<l.length;t++){let u=l[(t+c)%l.length],p=!0;u<0&&(p=!1,u=-u);let f=o.node(u-1),m=o.index(u-1);if(f.canReplaceWith(m,m,h.type,h.marks))return e.replace(o.before(u),p?s.after(u):r,new a(function e(t,r,i,o,s){if(r<i){let n=t.firstChild;t=t.replaceChild(0,n.copy(e(n.content,r+1,i,o,n)))}if(r>o){let e=s.contentMatchAt(0),r=e.fillBefore(t).append(t);t=r.append(e.matchFragment(r).fillBefore(n.empty,!0))}return t}(i.content,0,i.openStart,d),d,i.openEnd))}}let f=e.steps.length;for(let n=l.length-1;n>=0&&(e.replace(t,r,i),!(e.steps.length>f));n--){let e=l[n];e<0||(t=o.before(e),r=s.after(e))}}(this,e,t,r),this}replaceRangeWith(e,t,r){var i=e,o=t;if(!r.isInline&&i==o&&this.doc.resolve(i).parent.content.size){let e=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)break}return null}(this.doc,i,r.type);null!=e&&(i=o=e)}return this.replaceRange(i,o,new a(n.from(r),0,0)),this}deleteRange(e,t){return!function(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=eO(r,i);for(let t=0;t<o.length;t++){let n=o[t],s=t==o.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(t-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o&&r.start(o-1)==i.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),i.index(o-1)))return e.delete(r.before(o),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return!function(e,t,r){let{$from:i,$to:o,depth:s}=t,l=i.before(s+1),d=o.after(s+1),c=l,u=d,p=n.empty,h=0;for(let e=s,t=!1;e>r;e--)t||i.index(e)>0?(t=!0,p=n.from(i.node(e).copy(p)),h++):c--;let f=n.empty,m=0;for(let e=s,t=!1;e>r;e--)t||o.after(e+1)<o.end(e)?(t=!0,f=n.from(o.node(e).copy(f)),m++):u++;e.step(new ec(c,u,l,d,new a(p.append(f),h,m),p.size-h,!0))}(this,e,t),this}join(e,t=1){return!function(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,o=e.doc.resolve(t-n),s=o.node().type;if(i&&s.inlineContent){let e="pre"==s.whitespace,t=!!s.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let l=e.steps.length;if(!1===r){let r=e.doc.resolve(t+n);ey(e,r.node(),r.before(),l)}s.inlineContent&&ep(e,t+n-1,s,o.node().contentMatchAt(o.index()),null==r);let d=e.mapping.slice(l),c=d.map(t-n);if(e.step(new ed(c,d.map(t+n,-1),a.empty,!0)),!0===r){let t=e.doc.resolve(c);eg(e,t.node(),t.before(),e.steps.length)}}(this,e,t),this}wrap(e,t){return!function(e,t,r){let i=n.empty;for(let e=r.length-1;e>=0;e--){if(i.size){let t=r[e].type.contentMatch.matchFragment(i);if(!t||!t.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=n.from(r[e].type.create(r[e].attrs,i))}let o=t.start,s=t.end;e.step(new ec(o,s,o,s,new a(i,0,0),r.length,!0))}(this,e,t),this}setBlockType(e,t=e,r,i=null){var o=this;if(!r.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let s=o.steps.length;return o.doc.nodesBetween(e,t,(e,t)=>{var l,d,c;let u,p,h="function"==typeof i?i(e):i;if(e.isTextblock&&!e.hasMarkup(r,h)&&(l=o.doc,d=o.mapping.slice(s).map(t),c=r,p=(u=l.resolve(d)).index(),u.parent.canReplaceWith(p,p+1,c))){let i=null;if(r.schema.linebreakReplacement){let e="pre"==r.whitespace,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}!1===i&&ey(o,e,t,s),ep(o,o.mapping.slice(s).map(t,1),r,void 0,null===i);let l=o.mapping.slice(s),d=l.map(t,1),c=l.map(t+e.nodeSize,1);return o.step(new ec(d,c,d+1,c-1,new a(n.from(r.create(h,null,e.marks)),0,0),1,!0)),!0===i&&eg(o,e,t,s),!1}}),this}setNodeMarkup(e,t,r=null,i){return!function(e,t,r,i,o){let s=e.doc.nodeAt(t);if(!s)throw RangeError("No node at given position");r||(r=s.type);let l=r.create(i,null,o||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,l);if(!r.validContent(s.content))throw RangeError("Invalid content for node type "+r.name);e.step(new ec(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new a(n.from(l),0,0),1,!0))}(this,e,t,r,i),this}
1setNodeAttribute(e,t,n){return this.step(new eN(e,t,n)),this}setDocAttribute(e,t){return this.step(new eD(e,t)),this}addNodeMark(e,t){return this.step(new el(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError("No node at position "+e);if(t instanceof s)t.isInSet(n.marks)&&this.step(new ea(e,t));else{let r=n.marks,i,o=[];for(;i=t.isInSet(r);)o.push(new ea(e,i)),r=i.removeFromSet(r);for(let e=o.length-1;e>=0;e--)this.step(o[e])}return this}split(e,t=1,r){return!function(e,t,r=1,i){let o=e.doc.resolve(t),s=n.empty,l=n.empty;for(let e=o.depth,t=o.depth-r,a=r-1;e>t;e--,a--){s=n.from(o.node(e).copy(s));let t=i&&i[a];l=n.from(t?t.type.create(t.attrs,l):o.node(e).copy(l))}e.step(new ed(t,t,new a(s.append(l),r,r),!0))}(this,e,t,r),this}addMark(e,t,n){var r;let i,o,s,l;return r=this,s=[],l=[],r.doc.nodesBetween(e,t,(r,a,d)=>{if(!r.isInline)return;let c=r.marks;if(!n.isInSet(c)&&d.type.allowsMarkType(n.type)){let d=Math.max(a,e),u=Math.min(a+r.nodeSize,t),p=n.addToSet(c);for(let e=0;e<c.length;e++)c[e].isInSet(p)||(i&&i.to==d&&i.mark.eq(c[e])?i.to=u:s.push(i=new es(d,u,c[e])));o&&o.to==d?o.to=u:l.push(o=new eo(d,u,n))}}),s.forEach(e=>r.step(e)),l.forEach(e=>r.step(e)),this}removeMark(e,t,n){var r;let i,o;return r=this,i=[],o=0,r.doc.nodesBetween(e,t,(r,s)=>{if(!r.isInline)return;o++;let l=null;if(n instanceof R){let e=r.marks,t;for(;t=n.isInSet(e);)(l||(l=[])).push(t),e=t.removeFromSet(e)}else n?n.isInSet(r.marks)&&(l=[n]):l=r.marks;if(l&&l.length){let n=Math.min(s+r.nodeSize,t);for(let t=0;t<l.length;t++){let r=l[t],a;for(let e=0;e<i.length;e++){let t=i[e];t.step==o-1&&r.eq(i[e].style)&&(a=t)}a?(a.to=n,a.step=o):i.push({style:r,from:Math.max(s,e),to:n,step:o})}}}
1),i.forEach(e=>r.step(new es(e.from,e.to,e.style))),this}clearIncompatible(e,t,n){return ep(this,e,t,n),this}}e.s(["Mapping",0,ee,"RemoveMarkStep",0,es,"ReplaceAroundStep",0,ec,"ReplaceStep",0,ed,"Transform",0,e$,"canJoin",0,ev,"canSplit",0,eb,"dropPoint",0,ek,"findWrapping",0,ef,"joinPoint",0,ew,"liftTarget",0,eh,"replaceStep",0,eS],674729);let eR=Object.create(null);class eP{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new ez(e.min(t),e.max(t))]}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 e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=a.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:l,$to:d}=o[s],c=e.mapping.slice(i);e.replaceRange(c.map(l.pos),c.map(d.pos),s?a.empty:t),0==s&&eq(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:s}=r[i],l=e.mapping.slice(n),a=l.map(o.pos),d=l.map(s.pos);i?e.deleteRange(a,d):(e.replaceRangeWith(a,d,t),eq(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new ej(e):eJ(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?eJ(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):eJ(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}
vendor: 6,439 bytes, line 1
1static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new eH(e.node(0))}static atStart(e){return eJ(e,e,0,0,1)||new eH(e)}static atEnd(e){return eJ(e,e,e.content.size,e.childCount,-1)||new eH(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError("Invalid input for Selection.fromJSON");let n=eR[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in eR)throw RangeError("Duplicate use of selection JSON ID "+e);return eR[e]=t,t.prototype.jsonID=e,t}getBookmark(){return ej.between(this.$anchor,this.$head).getBookmark()}}eP.prototype.visible=!0;class ez{constructor(e,t){this.$from=e,this.$to=t}}let eL=!1;function eF(e){eL||e.parent.inlineContent||(eL=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class ej extends eP{constructor(e,t=e){eF(e),eF(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return eP.near(n);let r=e.resolve(t.map(this.anchor));return new ej(r.parent.inlineContent?r:n,n)}replace(e,t=a.empty){if(super.replace(e,t),t==a.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof ej&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new eW(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new ej(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if((!n||r)&&(n=r>=0?1:-1),!t.parent.inlineContent){let e=eP.findFrom(t,n,!0)||eP.findFrom(t,-n,!0);if(!e)return eP.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r?e=t:(e=(eP.findFrom(e,-n,!0)||eP.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0&&(e=t)),new ej(e,t)}}eP.jsonID("text",ej);class eW{constructor(e,t){this.anchor=e,this.head=t}map(e){return new eW(e.map(this.anchor),e.map(this.head))}resolve(e){return ej.between(e.resolve(this.anchor),e.resolve(this.head))}}class eB extends eP{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),i=e.resolve(r);return n?eP.near(i):new eB(i)}content(){return new a(n.from(this.node),0,0)}eq(e){return e instanceof eB&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new eV(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new eB(e.resolve(t.anchor))}static create(e,t){return new eB(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}eB.prototype.visible=!1,eP.jsonID("node",eB);class eV{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new eW(n,n):new eV(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&eB.isSelectable(n)?new eB(t):eP.near(t)}}class eH extends eP{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=a.empty){if(t==a.empty){e.delete(0,e.doc.content.size);let t=eP.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new eH(e)}map(e){return new eH(e)}eq(e){return e instanceof eH}getBookmark(){return eU}}eP.jsonID("all",eH);let eU={map(){return this},resolve:e=>new eH(e)};function eJ(e,t,n,r,i,o=!1){if(t.inlineContent)return ej.create(e,n);for(let s=r-(i>0?0:1);i>0?s<t.childCount:s>=0;s+=i){let r=t.child(s);if(r.isAtom){if(!o&&eB.isSelectable(r))return eB.create(e,n-(i<0?r.nodeSize:0))}else{let t=eJ(e,r,n+i,i<0?r.childCount:0,i,o);if(t)return t}n+=r.nodeSize*i}return null}function eq(e,t,n){let r,i=e.steps.length-1;if(i<t)return;let o=e.steps[i];(o instanceof ed||o instanceof ec)&&(e.mapping.maps[i].forEach((e,t,n,i)=>{null==r&&(r=i)}),e.setSelection(eP.near(e.doc.resolve(r),n)))}class eK extends e${constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(1|this.updated)&-3,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return s.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||s.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.selection.to!=t+e.length||this.setSelection(eP.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function eG(e,t){return t&&e?e.bind(t):e}
1class eY{constructor(e,t,n){this.name=e,this.init=eG(t.init,n),this.apply=eG(t.apply,n)}}let eX=[new eY("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new eY("selection",{init:(e,t)=>e.selection||eP.atStart(t.doc),apply:e=>e.selection}),new eY("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new eY("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class eZ{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=eX.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new eY(e.key,e.spec.state,e))})}}class eQ{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let s=this.config.plugins[o];if(s.spec.appendTransaction){let l=r?r[o].n:0,a=r?r[o].state:this,d=l<t.length&&s.spec.appendTransaction.call(s,l?t.slice(l):t,a,n);if(d&&n.filterTransaction(d,o)){if(d.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<o?{state:n,n:t.length}:{state:this,n:0})}t.push(d),n=n.applyInner(d),i=!0}r&&(r[o]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");let t=new eQ(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];t[i.name]=i.apply(e,this[i.name],this,t)}return t}get tr(){return new eK(this)}static create(e){let t=new eZ(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new eQ(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new eZ(this.schema,e.plugins),n=t.fields,r=new eQ(t);for(let t=0;t<n.length;t++){let i=n[t].name;r[i]=this.hasOwnProperty(i)?this[i]:n[t].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw RangeError("Required config field 'schema' missing");let r=new eZ(e.schema,e.plugins),i=new eQ(r);return r.fields.forEach(r=>{if("doc"==r.name)i.doc=w.fromJSON(e.schema,t.doc);else if("selection"==r.name)i.selection=eP.fromJSON(i.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let o in n){let s=n[o],l=s.spec.state;if(s.key==r.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(t,o)){i[r.name]=l.fromJSON.call(s,e,t[o],i);return}}i[r.name]=r.init(e,i)}}),i}}class e0{constructor(e){this.spec=e,this.props={},e.props&&function e(t,n,r){for(let i in t){let o=t[i];o instanceof Function?o=o.bind(n):"handleDOMEvents"==i&&(o=e(o,n,{})),r[i]=o}return r}(e.props,this,this.props),this.key=e.key?e.key.key:e2("plugin")}getState(e){return e[this.key]}}let e1=Object.create(null);function e2(e){return e in e1?e+"$"+ ++e1[e]:(e1[e]=0,e+"$")}class e3{constructor(e="key"){this.key=e2(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}e.s(["AllSelection",0,eH,"EditorState",0,eQ,"NodeSelection",0,eB,"Plugin",0,e0,"PluginKey",0,e3,"Selection",0,eP,"SelectionRange",0,ez,"TextSelection",0,ej],827121);let e6=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function e5(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("backward",e):!(n.parentOffset>0))?n:null}
1let e9=(e,t,n)=>{let r=e5(e,n);if(!r)return!1;let i=te(r);if(!i){let n=r.blockRange(),i=n&&eh(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let o=i.nodeBefore;if(tc(e,i,t,-1))return!0;if(0==r.parent.content.size&&(e4(o,"end")||eB.isSelectable(o)))for(let n=r.depth;;n--){let s=eS(e.doc,r.before(n),r.after(n),a.empty);if(s&&s.slice.size<s.to-s.from){if(t){let n=e.tr.step(s);n.setSelection(e4(o,"end")?eP.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):eB.create(n.doc,i.pos-o.nodeSize)),t(n.scrollIntoView())}return!0}if(1==n||r.node(n-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)};function e7(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let o=t.nodeAfter,s=t.pos+1;for(;!o.isTextblock;s++){if(o.type.spec.isolating)return!1;let e=o.firstChild;if(!e)return!1;o=e}let l=eS(e.doc,i,s,a.empty);if(!l||l.from!=i||l instanceof ed&&l.slice.size>=s-i)return!1;if(n){let t=e.tr.step(l);t.setSelection(ej.create(t.doc,i)),n(t.scrollIntoView())}return!0}function e4(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)break}return!1}let e8=(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=te(r)}let s=o&&o.nodeBefore;return!!s&&!!eB.isSelectable(s)&&(t&&t(e.tr.setSelection(eB.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function te(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 tt(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("forward",e):!(n.parentOffset<n.parent.content.size))?n:null}let tn=(e,t,n)=>{let r=tt(e,n);if(!r)return!1;let i=ti(r);if(!i)return!1;let o=i.nodeAfter;if(tc(e,i,t,1))return!0;if(0==r.parent.content.size&&(e4(o,"start")||eB.isSelectable(o))){let n=eS(e.doc,r.before(),r.after(),a.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(e4(o,"start")?eP.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):eB.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return!!o.isAtom&&i.depth==r.depth-1&&(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0)},tr=(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=ti(r)}let s=o&&o.nodeAfter;return!!s&&!!eB.isSelectable(s)&&(t&&t(e.tr.setSelection(eB.create(e.doc,o.pos)).scrollIntoView()),!0)};function ti(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}let to=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!!n.parent.type.spec.code&&!!n.sameParent(r)&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)};function ts(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}let tl=(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),s=ts(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,s.createAndFill());i.setSelection(eP.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},ta=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof eH||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=ts(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,s=e.tr.insert(n,o.createAndFill());s.setSelection(ej.create(s.doc,n+1)),t(s.scrollIntoView())}return!0},td=(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 r=n.before();if(eb(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&eh(r);return null!=i&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function tc(e,t,r,i){let o,s,l,d=t.nodeBefore,c=t.nodeAfter,u,p,h=d.type.spec.isolating||c.type.spec.isolating;if(!h&&(o=t.nodeBefore,s=t.nodeAfter,l=t.index(),o&&s&&o.type.compatibleContent(s.type)&&(!o.content.size&&t.parent.canReplace(l-1,l)?(r&&r(e.tr.delete(t.pos-o.nodeSize,t.pos).scrollIntoView()),!0):!!t.parent.canReplace(l,l+1)&&!!(s.isTextblock||ev(e.doc,t.pos))&&(r&&r(e.tr.join(t.pos).scrollIntoView()),!0))))return!0;let f=!h&&t.parent.canReplace(t.index(),t.index()+1);if(f&&(u=(p=d.contentMatchAt(d.childCount)).findWrapping(c.type))&&p.matchType(u[0]||c.type).validEnd){if(r){let i=t.pos+c.nodeSize,o=n.empty;for(let e=u.length-1;e>=0;e--)o=n.from(u[e].create(null,o));o=n.from(d.copy(o));let s=e.tr.step(new ec(t.pos-1,i,t.pos,i,new a(o,1,0),u.length,!0)),l=s.doc.resolve(i+2*u.length);l.nodeAfter&&l.nodeAfter.type==d.type&&ev(s.doc,l.pos)&&s.join(l.pos),r(s.scrollIntoView())}return!0}let m=c.type.spec.isolating||i>0&&h?null:eP.findFrom(t,1),g=m&&m.$from.blockRange(m.$to),y=g&&eh(g);if(null!=y&&y>=t.depth)return r&&r(e.tr.lift(g,y).scrollIntoView()),!0;if(f&&e4(c,"start",!0)&&e4(d,"end")){let i=d,o=[];for(;o.push(i),!i.isTextblock;)i=i.lastChild;let s=c,l=1;for(;!s.isTextblock;s=s.firstChild)l++;if(i.canReplace(i.childCount,i.childCount,s.content)){if(r){let i=n.empty;for(let e=o.length-1;e>=0;e--)i=n.from(o[e].copy(i));r(e.tr.step(new ec(t.pos-o.length,t.pos+c.nodeSize,t.pos+l,t.pos+c.nodeSize-l,new a(i,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function tu(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(ej.create(t.doc,e<0?i.start(o):i.end(o)))),!0)}}let tp=tu(-1),th=tu(1);function tf(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:o},$to:{pos:s}}=n.selection.ranges[r];n.doc.nodesBetween(o,s,(r,o)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(o),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:o},$to:{pos:s}}=n.selection.ranges[r];i.setBlockType(o,s,e,t)}r(i.scrollIntoView())}return!0}}function tm(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}let tg=tm(e6,e9,e8),ty=tm(e6,tn,tr),tb={Enter:tm(to,ta,td,(e,t)=>{let{$from:n,$to:r}=e.selection;if(e.selection instanceof eB&&e.selection.node.isBlock)return!!n.parentOffset&&!!eb(e.doc,n.pos)&&(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let i=[],o,s,l=!1,a=!1;for(let e=n.depth;;e--){if(n.node(e).isBlock){let t;l=n.end(e)==n.pos+(n.depth-e),a=n.start(e)==n.pos-(n.depth-e),s=ts(n.node(e-1).contentMatchAt(n.indexAfter(e-1)));i.unshift(t||(l&&s?{type:s}:null)),o=e;break}if(1==e)return!1;i.unshift(null)}let d=e.tr;(e.selection instanceof ej||e.selection instanceof eH)&&d.deleteSelection();let c=d.mapping.map(n.pos),u=eb(d.doc,c,i.length,i);if(u||(i[0]=s?{type:s}:null,u=eb(d.doc,c,i.length,i)),!u)return!1;if(d.split(c,i.length,i),!l&&a&&n.node(o).type!=s){let e=d.mapping.map(n.before(o)),t=d.doc.resolve(e);s&&n.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&d.setNodeMarkup(d.mapping.map(n.before(o)),s)}return t&&t(d.scrollIntoView()),!0}),"Mod-Enter":tl,Backspace:tg,"Mod-Backspace":tg,"Shift-Backspace":tg,Delete:ty,"Mod-Delete":ty,"Mod-a":(e,t)=>
1(t&&t(e.tr.setSelection(new eH(e.doc))),!0)},tv={"Ctrl-h":tb.Backspace,"Alt-Backspace":tb["Mod-Backspace"],"Ctrl-d":tb.Delete,"Ctrl-Alt-Backspace":tb["Mod-Delete"],"Alt-Delete":tb["Mod-Delete"],"Alt-d":tb["Mod-Delete"],"Ctrl-a":tp,"Ctrl-e":th};for(let e in tb)tv[e]=tb[e];"u">typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"u">typeof os&&os.platform&&os.platform();let tx=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},tw=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},tk=null,tS=function(e,t,n){let r=tk||(tk=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},tT=function(){tk=null},tC=function(e,t,n,r){return n&&(tM(e,t,n,r,-1)||tM(e,t,n,r,1))},t_=/^(img|br|input|textarea|hr)$/i;function tM(e,t,n,r,i){for(var o;;){if(e==n&&t==r)return!0;if(t==(i<0?0:tA(e))){let n=e.parentNode;if(!n||1!=n.nodeType||tE(e)||t_.test(e.nodeName)||"false"==e.contentEditable)return!1;t=tx(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;let n=e.childNodes[t+(i<0?-1:0)];if(1==n.nodeType&&"false"==n.contentEditable)if(null==(o=n.pmViewDesc)||!o.ignoreForSelection)return!1;else t+=i;else e=n,t=i<0?tA(e):0}}}function tA(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function tE(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)}let tO=function(e){return e.focusNode&&tC(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function tN(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}let tD="u">typeof navigator?navigator:null,tI="u">typeof document?document:null,t$=tD&&tD.userAgent||"",tR=/Edge\/(\d+)/.exec(t$),tP=/MSIE \d/.exec(t$),tz=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t$),tL=!!(tP||tz||tR),tF=tP?document.documentMode:tz?+tz[1]:tR?+tR[1]:0,tj=!tL&&/gecko\/(\d+)/i.test(t$);tj&&(/Firefox\/(\d+)/.exec(t$)||[0,0])[1];let tW=!tL&&/Chrome\/(\d+)/.exec(t$),tB=!!tW,tV=tW?+tW[1]:0,tH=!tL&&!!tD&&/Apple Computer/.test(tD.vendor),tU=tH&&(/Mobile\/\w+/.test(t$)||!!tD&&tD.maxTouchPoints>2),tJ=tU||!!tD&&/Mac/.test(tD.platform),tq=!!tD&&/Win/.test(tD.platform),tK=/Android \d/.test(t$),tG=!!tI&&"webkitFontSmoothing"in tI.documentElement.style,tY=tG?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function tX(e,t){return"number"==typeof e?e:e[t]}function tZ(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;){if(1!=s.nodeType){s=tw(s);continue}let e=s,n=e==o.body,l=n?function(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}(o):function(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}(e),a=0,d=0;if(t.top<l.top+tX(r,"top")?d=-(l.top-t.top+tX(i,"top")):t.bottom>l.bottom-tX(r,"bottom")&&(d=t.bottom-t.top>l.bottom-l.top?t.top+tX(i,"top")-l.top:t.bottom-l.bottom+tX(i,"bottom")),t.left<l.left+tX(r,"left")?a=-(l.left-t.left+tX(i,"left")):t.right>l.right-tX(r,"right")&&(a=t.right-l.right+tX(i,"right")),a||d)if(n)o.defaultView.scrollBy(a,d);else{let n=e.scrollLeft,r=e.scrollTop;d&&(e.scrollTop+=d),a&&(e.scrollLeft+=a);let i=e.scrollLeft-n,o=e.scrollTop-r;t={left:t.left-i,top:t.top-o,right:t.right-i,bottom:t.bottom-o}}let c=n?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(c))break;s="absolute"==c?s.offsetParent:tw(s)}}function tQ(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=tw(r));return t}function t0(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let t1=null;function t2(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function t3(e){return e.top<e.bottom||e.left<e.right}function t6(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(t3(e))return e}return Array.prototype.find.call(n,t3)||e.getBoundingClientRect()}let t5=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function t9(e,t,n){let{node:r,offset:i,atom:o}=e.docView.domFromPos(t,n<0?-1:1),s=tG||tj;if(3==r.nodeType)if(s&&(t5.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=t6(tS(r,i,i),n);if(tj&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=t6(tS(r,i-1,i-1),-1);if(t.top==e.top){let n=t6(tS(r,i,i+1),-1);if(n.top!=e.top)return t7(n,n.left<t.left)}}return e}else{let e=i,t=i,o=n<0?1:-1;return n<0&&!i?(t++,o=-1):n>=0&&i==r.nodeValue.length?(e--,o=1):n<0?e--:t++,t7(t6(tS(r,e,t),o),o<0)}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(null==o&&i&&(n<0||i==tA(r))){let e=r.childNodes[i-1];if(1==e.nodeType)return t4(e.getBoundingClientRect(),!1)}if(null==o&&i<tA(r)){let e=r.childNodes[i];if(1==e.nodeType)return t4(e.getBoundingClientRect(),!0)}return t4(r.getBoundingClientRect(),n>=0)}if(null==o&&i&&(n<0||i==tA(r))){let e=r.childNodes[i-1],t=3==e.nodeType?tS(e,tA(e)-!s):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return t7(t6(t,1),!1)}if(null==o&&i<tA(r)){let e=r.childNodes[i];for(;
vendor: 8,452 bytes, line 1
1e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?tS(e,0,+!s):1==e.nodeType?e:null:null;if(t)return t7(t6(t,-1),!0)}return t7(t6(3==r.nodeType?tS(r):r,-n),n>=0)}function t7(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function t4(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function t8(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}let ne=/[\u0590-\u08ac]/,nt=null,nn=null,nr=!1;class ni{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){let r;if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode))if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}else{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}if(e==this.dom&&this.contentDOM)r=t>tx(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),o;if(i&&(!t||i.node))if(!n||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==e.nodeType?e:e.parentNode):o==e))return i;else n=!1}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return -1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],o=t+i.size;if(o>e||i instanceof nu){r=e-t;break}t=o}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof no&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;(e=n?this.children[n-1]:null)&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?tx(e.dom)+1:0}}{let e,r=!0;for(;(e=n<this.children.length?this.children[n]:null)&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?tx(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let o=n,s=0;;s++){let n=this.children[s],l=o+n.size;if(-1==r&&e<=l){let i=o+n.border;if(e>=i&&t<=l-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=o;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=tx(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(l>t||s==this.children.length-1)){t=l;for(let e=s+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=tx(n.dom);break}t+=n.size}-1==i&&(i=this.contentDOM.childNodes.length);break}o=l}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),o=Math.max(e,t);for(let s=0,l=0;s<this.children.length;s++){let a=this.children[s],d=l+a.size;if(i>l&&o<d)return a.setSelection(e-l-a.border,t-l-a.border,n,r);l=d}let s=this.domFromPos(e,e?-1:1),l=t==e?s:this.domFromPos(t,t?-1:1),a=n.root.getSelection(),d=n.domSelectionRange(),c=!1;if((tj||tH)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if((c=!!(t&&"\n"==e.nodeValue[t-1]))&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){"BR"==n.nodeName&&(s=l={node:n.parentNode,offset:tx(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];c=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(tj&&d.focusNode&&d.focusNode!=l.node&&1==d.focusNode.nodeType){let e=d.focusNode.childNodes[d.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||c&&tH)&&tC(s.node,s.offset,d.anchorNode,d.anchorOffset)&&tC(l.node,l.offset,d.focusNode,d.focusOffset))return;let u=!1;if((a.extend||e==t)&&!(c&&tj)){a.collapse(s.node,s.offset);try{e!=t&&a.extend(l.node,l.offset),u=!0}catch(e){}}if(!u){if(e>t){let e=s;s=l,l=e}let n=document.createRange();n.setEnd(l.node,l.offset),n.setStart(s.node,s.offset),a.removeAllRanges(),a.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],o=n+i.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let r=n+i.border,s=o-i.border;if(e>=r&&t<=s){this.dirty=e==n||t==o?2:1,e==r&&t==s&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=3:i.markDirty(e-r,t-r);return}i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=o}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class no extends ni{constructor(e,t,n,r){let i,o=t.type.toDOM;if("function"==typeof o&&(o=o(n,()=>i?i.parent?i.parent.posBeforeChild(i):void 0:r)),!t.type.spec.raw){if(1!=o.nodeType){let e=document.createElement("span");e.appendChild(o),o=e}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class ns extends ni{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class nl extends ni{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}
1static create(e,t,n,r){let i=r.nodeViews[t.type.name],o=i&&i(t,r,n);return o&&o.dom||(o=q.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new nl(e,t,o.dom,o.contentDOM||o.dom,o)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let r=nl.create(this.parent,this.mark,!0,n),i=this.children,o=this.size;t<o&&(i=nk(i,t,o,n)),e>0&&(i=nk(i,0,e,n));for(let e=0;e<i.length;e++)i[e].parent=r;return r.children=i,r}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class na extends ni{constructor(e,t,n,r,i,o,s,l,a){super(e,[],i,o),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s}static create(e,t,n,r,i,o){let s=i.nodeViews[t.type.name],l,a=s&&s(t,i,()=>l?l.parent?l.parent.posBeforeChild(l):void 0:o,n,r),d=a&&a.dom,c=a&&a.contentDOM;if(t.isText)if(d){if(3!=d.nodeType)throw RangeError("Text must be rendered as a DOM text node")}else d=document.createTextNode(t.text);else if(!d){let e=q.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:d,contentDOM:c}=e)}c||t.isText||"BR"==d.nodeName||(d.hasAttribute("contenteditable")||(d.contentEditable="false"),t.type.spec.draggable&&(d.draggable=!0));let u=d;return(d=ny(d,n,t),a)?l=new np(e,t,n,r,d,c||null,u,a,i,o+1):t.isText?new nc(e,t,n,r,d,u,i):new na(e,t,n,r,d,c||null,u,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>n.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&nb(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,o=i&&i.pos>-1?i:null,l=i&&i.pos<0,a=new nx(this,o&&o.node,e);(function(e,t,n,r){let i=t.locals(e),o=0;if(0==i.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,i,t.forChild(o,s),n),o+=s.nodeSize}return}let s=0,l=[],a=null;for(let d=0;;){let c,u,p,h;for(;s<i.length&&i[s].to==o;){let e=i[s++];e.widget&&(c?(u||(u=[c])).push(e):c=e)}if(c)if(u){u.sort(nw);for(let e=0;e<u.length;e++)n(u[e],d,!!a)}else n(c,d,!!a);if(a)h=-1,p=a,a=null;else if(d<e.childCount)h=d,p=e.child(d++);else break;for(let e=0;e<l.length;e++)l[e].to<=o&&l.splice(e--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)l.push(i[s++]);let f=o+p.nodeSize;if(p.isText){let e=f;s<i.length&&i[s].from<e&&(e=i[s].from);for(let t=0;t<l.length;t++)l[t].to<e&&(e=l[t].to);e<f&&(a=p.cut(e-o),p=p.cut(0,e-o),f=e,h=-1)}else for(;s<i.length&&i[s].to<f;)s++;let m=p.isInline&&!p.isLeaf?l.filter(e=>!e.inline):l.slice();r(p,m,t.forChild(o,p),h),o=f}})(this.node,this.innerDeco,(t,i,o)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!o&&a.syncToMarks(i==this.node.childCount?s.none:this.node.child(i).marks,n,e,i),a.placeWidget(t,e,r)},(t,o,s,d)=>{let c;a.syncToMarks(t.marks,n,e,d),a.findNodeMatch(t,o,s,d)||l&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(c=a.findIndexWithChild(i.node))>-1&&a.updateNodeAt(t,o,s,c,e)||a.updateNextNode(t,o,s,e,d,r)||a.addNode(t,o,s,e,r),r+=t.nodeSize}),a.syncToMarks([],n,e,0),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(o&&this.protectLocalComposition(e,o),function e(t,n,r){let i=t.firstChild,o=!1;for(let s=0;s<n.length;s++){let l=n[s],a=l.dom;if(a.parentNode==t){for(;a!=i;)i=nv(i),o=!0;i=i.nextSibling}else o=!0,t.insertBefore(a,i);if(l instanceof nl){let n=i?i.previousSibling:t.lastChild;e(l.contentDOM,l.children,r),i=n?n.nextSibling:t.firstChild}}for(;i;)i=nv(i),o=!0;o&&r.trackWrites==t&&(r.trackWrites=null)}(this.contentDOM,this.children,e),tU&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof ej)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(!this.node.inlineContent)return{node:i,pos:-1,text:""};{let e=i.nodeValue,o=function(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let s=e.child(i++),l=o;if(o+=s.nodeSize,!s.isText)continue;let a=s.text;for(;i<e.childCount;){let t=e.child(i++);if(o+=t.nodeSize,!t.isText)break;a+=t.text}
1if(o>=n){if(o>=r&&a.slice(r-t.length-l,r-l)==t)return r-t.length;let e=l<r?a.lastIndexOf(t,r-l-1):-1;if(e>=0&&e+t.length+l>=n)return l+e;if(n==r&&a.length>=r+t.length-l&&a.slice(r-l,r-l+t.length)==t)return r}}return -1}(this.node.content,e,n-t,r-t);return o<0?null:{node:i,pos:o,text:e}}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new ns(this,i,t,r);e.input.compositionNodes.push(o),this.children=nk(this.children,n,n+r.length,e,o)}update(e,t,n,r){return 3!=this.dirty&&!!e.sameMarkup(this.node)&&(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(nb(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=ng(this.dom,this.nodeDOM,nm(this.outerDeco,this.node,t),nm(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function nd(e,t,n,r,i){ny(r,t,e);let o=new na(void 0,e,t,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class nc extends na{constructor(e,t,n,r,i,o,s){super(e,t,n,r,i,null,o,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return 3!=this.dirty&&(0==this.dirty||!!this.inParent())&&!!e.sameMarkup(this.node)&&(this.updateOuterDeco(t),(0!=this.dirty||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),i=document.createTextNode(r.text);return new nc(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(0==e||t==this.nodeDOM.nodeValue.length)&&(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class nu extends ni{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class np extends na{constructor(e,t,n,r,i,o,s,l,a,d){super(e,t,n,r,i,o,s,a,d),this.spec=l}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return(!!this.contentDOM||!!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}let nh=function(e){e&&(this.nodeName=e)};nh.prototype=Object.create(null);let nf=[new nh];function nm(e,t,n){if(0==e.length)return nf;let r=n?nf[0]:new nh,i=[r];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s)for(let e in s.nodeName&&i.push(r=new nh(s.nodeName)),s){let o=s[e];null!=o&&(n&&1==i.length&&i.push(r=new nh(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+o:"style"==e?r.style=(r.style?r.style+";":"")+o:"nodeName"!=e&&(r[e]=o))}}return i}function ng(e,t,n,r){if(n==nf&&r==nf)return t;let i=t;for(let t=0;t<r.length;t++){let o=r[t],s=n[t];if(t){let t;s&&s.nodeName==o.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==o.nodeName||((t=document.createElement(o.nodeName)).pmIsDeco=!0,t.appendChild(i),s=nf[0]),i=t}!function(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);
1if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==i.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)-1==r.indexOf(i[t])&&e.classList.add(i[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}(i,s||nf[0],o)}return i}function ny(e,t,n){return ng(e,e,nf,nm(t,n,1!=e.nodeType))}function nb(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function nv(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class nx{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,i=e.childCount,o=new Map,s=[];n:for(;i>0;){let l;for(;;)if(r){let e=n.children[r-1];if(e instanceof nl)n=e,r=e.children.length;else{l=e,r--;break}}else if(n==t)break n;else r=n.parent.children.indexOf(n),n=n.parent;let a=l.node;if(a){if(a!=e.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&!1!==e[i].type.spec.spanning;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let i=-1,s=this.top.children.length;r<this.preMatch.index&&(s=Math.min(this.index+3,s));for(let t=this.index;t<s;t++){let n=this.top.children[t];if(n.matchesMark(e[o])&&!this.isLocked(n.dom)){i=t;break}}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=nl.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,n,r){let i=-1,o;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))i=this.top.children.indexOf(o,this.index);else for(let r=this.index,o=Math.min(this.top.children.length,r+5);r<o;r++){let o=this.top.children[r];if(o.matchesNode(e,t,n)&&!this.preMatch.matched.has(o)){i=r;break}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let o=this.top.children[r];return 3==o.dirty&&o.dom==o.contentDOM&&(o.dirty=2),!!o.update(e,t,n,i)&&(this.destroyBetween(this.index,r),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return -1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return -1}e=t}}updateNextNode(e,t,n,r,i,o){for(let s=this.index;s<this.top.children.length;s++){let l=this.top.children[s];if(l instanceof na){let a=this.preMatch.matched.get(l);if(null!=a&&a!=i)return!1;let d=l.dom,c,u=this.isLocked(d)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&3!=l.dirty&&nb(t,l.outerDeco));if(!u&&l.update(e,t,n,r))return this.destroyBetween(this.index,s),l.dom!=d&&(this.changed=!0),this.index++,!0;if(!u&&(c=this.recreateWrapper(l,e,t,n,r,o)))return this.destroyBetween(this.index,s),this.top.children[this.index]=c,c.contentDOM&&(c.dirty=2,c.updateChildren(r,o+1),c.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,o){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!nb(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let s=na.create(this.top,t,n,r,i,o);if(s.contentDOM)for(let t of(s.children=e.children,e.children=[],s.children))t.parent=s;return e.destroy(),s}addNode(e,t,n,r,i){let o=na.create(this.top,e,t,n,r,i);o.contentDOM&&o.updateChildren(r,i+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new no(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof nl;)e=(t=e).children[t.children.length-1];(!e||!(e instanceof nc)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((tH||tB)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new nu(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}
1isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function nw(e,t){return e.type.side-t.type.side}function nk(e,t,n,r,i){let o=[];for(let s=0,l=0;s<e.length;s++){let a=e[s],d=l,c=l+=a.size;d>=n||c<=t?o.push(a):(d<t&&o.push(a.slice(0,t-d,r)),i&&(o.push(i),i=void 0),c>n&&o.push(a.slice(n-d,a.size,r)))}return o}function nS(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&&0==i.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l=r.resolve(s),a,d;if(tO(n)){for(a=s;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&eB.isSelectable(e)&&i.parent&&!(e.isInline&&function(e,t,n){for(let r=0==t,i=t==tA(e);r||i;){if(e==n)return!0;let t=tx(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==tA(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;d=new eB(s==e?l:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=s,i=s;for(let r=0;r<n.rangeCount;r++){let o=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(o.startContainer,o.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(o.endContainer,o.endOffset,-1))}if(t<0)return null;[a,s]=i==e.state.selection.anchor?[i,t]:[t,i],l=r.resolve(s)}else a=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(a<0)return null}let c=r.resolve(a);if(!d){let n="pointer"==t||e.state.selection.head<l.pos&&!o?1:-1;d=nD(e,c,l,n)}return d}function nT(e){return e.editable?e.hasFocus():n$(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function nC(e,t=!1){let n=e.state.selection;if(nO(e,n),nT(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&tB){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&tC(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r="IMG"==n.nodeName;r?t.collapse(n.parentNode,tx(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&tL&&tF<=11&&(n.disabled=!0,n.disabled=!1)}(e);else{var r;let i,o,s,l,{anchor:a,head:d}=n,c,u;n_&&!(n instanceof ej)&&(n.$from.parent.inlineContent||(c=nM(e,n.from)),n.empty||n.$from.parent.inlineContent||(u=nM(e,n.to))),e.docView.setSelection(a,d,e,t),n_&&(c&&nE(c),u&&nE(u)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&((i=(r=e).dom.ownerDocument).removeEventListener("selectionchange",r.input.hideSelectionGuard),s=(o=r.domSelectionRange()).anchorNode,l=o.anchorOffset,i.addEventListener("selectionchange",r.input.hideSelectionGuard=()=>{(o.anchorNode!=s||o.anchorOffset!=l)&&(i.removeEventListener("selectionchange",r.input.hideSelectionGuard),setTimeout(()=>{(!nT(r)||r.state.selection.visible)&&r.dom.classList.remove("ProseMirror-hideselection")},20))})))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}let n_=tH||tB&&tV<63;function nM(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(tH&&i&&"false"==i.contentEditable)return nA(i);if((!i||"false"==i.contentEditable)&&(!o||"false"==o.contentEditable)){if(i)return nA(i);else if(o)return nA(o)}}function nA(e){return e.contentEditable="true",tH&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function nE(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function nO(e,t){if(t instanceof eB){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(nN(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else nN(e)}function nN(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function nD(e,t,n,r){return e.someProp("createSelectionBetween",r=>r(e,t,n))||ej.between(t,n,r)}function nI(e){return(!e.editable||!!e.hasFocus())&&n$(e)}function n$(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focu
1sNode.parentNode:t.focusNode))}catch(e){return!1}}function nR(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&&eP.findFrom(o,t)}function nP(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function nz(e,t,n){let r=e.state.selection;if(r instanceof ej){if(n.indexOf("s")>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return nP(e,new ej(r.$anchor,o))}else if(!r.empty)return!1;else if(e.endOfTextblock(t>0?"forward":"backward")){let n=nR(e.state,t);return!!n&&n instanceof eB&&nP(e,n)}else if(!(tJ&&n.indexOf("m")>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,o;if(!i||i.isText)return!1;let s=t<0?n.pos-i.nodeSize:n.pos;return!!(i.isAtom||(o=e.docView.descAt(s))&&!o.contentDOM)&&(eB.isSelectable(i)?nP(e,new eB(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):!!tG&&nP(e,new ej(e.state.doc.resolve(t<0?s:s+i.nodeSize))))}}else{if(r instanceof eB&&r.node.isInline)return nP(e,new ej(t>0?r.$to:r.$from));let n=nR(e.state,t);return!!n&&nP(e,n)}}function nL(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function nF(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function nj(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(tj&&1==n.nodeType&&r<nL(n)&&nF(n.childNodes[r],-1)&&(s=!0);;)if(r>0)if(1!=n.nodeType)break;else{let e=n.childNodes[r-1];if(nF(e,-1))i=n,o=--r;else if(3==e.nodeType)r=(n=e).nodeValue.length;else break}else if(nW(n))break;else{let t=n.previousSibling;for(;t&&nF(t,-1);)i=n.parentNode,o=tx(t),t=t.previousSibling;if(t)r=nL(n=t);else{if((n=n.parentNode)==e.dom)break;r=0}}s?nB(e,n,r):i&&nB(e,i,o)}(e):function(e){let t,n,r=e.domSelectionRange(),i=r.focusNode,o=r.focusOffset;if(!i)return;let s=nL(i);for(;;)if(o<s){if(1!=i.nodeType)break;if(nF(i.childNodes[o],1))t=i,n=++o;else break}else if(nW(i))break;else{let r=i.nextSibling;for(;r&&nF(r,1);)t=r.parentNode,n=tx(r)+1,r=r.nextSibling;if(r)o=0,s=nL(i=r);else{if((i=i.parentNode)==e.dom)break;o=s=0}}t&&nB(e,t,n)}(e)}function nW(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function nB(e,t,n){if(3!=t.nodeType){let e,r;(r=function(e,t){for(;e&&t==e.childNodes.length&&!tE(e);)t=tx(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=r,n=0):(e=function(e,t){for(;e&&!t&&!tE(e);)t=tx(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(tO(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&nC(e)},50)}function nV(e,t){let n=e.state.doc.resolve(t);if(!(tB||tq)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function nH(e,t,n){let r=e.state.selection;if(r instanceof ej&&!r.empty||n.indexOf("s")>-1||tJ&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=nR(e.state,t);if(n&&n instanceof eB)return nP(e,n)}if(!i.parent.inlineContent){let n=t<0?i:o,s=r instanceof eH?eP.near(n,t):eP.findFrom(n,t);return!!s&&nP(e,s)}return!1}function nU(e,t){if(!(e.state.selection instanceof ej))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 r=e.state.tr;return t<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),e.dispatch(r),!0}return!1}function nJ(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function nq(e,t){e.someProp("transformCopied",n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let e=r.firstChild;
1n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||q.fromSchema(e.state.schema),l=n1(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let d=a.firstChild,c,u=0;for(;d&&1==d.nodeType&&(c=nQ[d.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=l.createElement(c[e]);for(;a.firstChild;)t.appendChild(a.firstChild);a.appendChild(t),u++}d=a.firstChild}return d&&1==d.nodeType&&d.setAttribute("data-pm-slice",`${i} ${o}${u?` -${u}`:""} ${JSON.stringify(n)}`),{dom:a,text:e.someProp("clipboardTextSerializer",n=>n(t,e))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function nK(e,t,r,i,o){let s,l,d=o.parent.type.spec.code;if(!r&&!t)return null;let c=!!t&&(i||d||!r);if(c){if(e.someProp("transformPastedText",n=>{t=n(t,d||i,e)}),d)return l=new a(n.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",t=>{l=t(l,e,!0)}),l;let r=e.someProp("clipboardTextParser",n=>n(t,o,i,e));if(r)l=r;else{let n=o.marks(),{schema:r}=e.state,i=q.fromSchema(r);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=s.appendChild(document.createElement("p"));e&&t.appendChild(i.serializeNode(r.text(e,n)))})}}else e.someProp("transformPastedHTML",t=>{r=t(r,e)}),s=function(e){var t;let n,r=/^(\s*<meta [^>]*>)*/.exec(e);r&&(e=e.slice(r[0].length));let i=n1().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e),s;if((s=o&&nQ[o[1].toLowerCase()])&&(e=s.map(e=>"<"+e+">").join("")+e+s.map(e=>"</"+e+">").reverse().join("")),i.innerHTML=(t=e,(n=window.trustedTypes)?(n2||(n2=n.defaultPolicy||n.createPolicy("ProseMirrorClipboard",{createHTML:e=>e})),n2.createHTML(t)):t),s)for(let e=0;e<s.length;e++)i=i.querySelector(s[e])||i;return i}(r),tG&&function(e){let t=e.querySelectorAll(tB?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&"Â "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(s);let u=s&&s.querySelector("[data-pm-slice]"),p=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(p&&p[3])for(let e=+p[3];e>0;e--){let e=s.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;s=e}if(l||(l=(e.someProp("clipboardParser")||e.someProp("domParser")||L.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(c||p),context:o,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||nG.test(e.parentNode.nodeName)?null:{ignore:!0}})),p)l=function(e,t){if(!e.size)return e;let r=e.content.firstChild.type.schema,i;try{i=JSON.parse(t)}catch(t){return e}let{content:o,openStart:s,openEnd:l}=e;for(let e=i.length-2;e>=0;e-=2){let t=r.nodes[i[e]];if(!t||t.hasRequiredAttrs())break;o=n.from(t.create(i[e+1],o)),s++,l++}return new a(o,s,l)}
1(nZ(l,+p[1],+p[2]),p[4]);else if((l=a.maxOpen(function(e,t){if(e.childCount<2)return e;for(let r=t.depth;r>=0;r--){let i=t.node(r).contentMatchAt(t.index(r)),o,s=[];if(e.forEach(e=>{if(!s)return;let t=i.findWrapping(e.type),r;if(!t)return s=null;if(r=s.length&&o.length&&function e(t,r,i,o,s){if(s<t.length&&s<r.length&&t[s]==r[s]){let l=e(t,r,i,o.lastChild,s+1);if(l)return o.copy(o.content.replaceChild(o.childCount-1,l));if(o.contentMatchAt(o.childCount).matchType(s==t.length-1?i.type:t[s+1]))return o.copy(o.content.append(n.from(nY(i,t,s+1))))}}(t,o,e,s[s.length-1],0))s[s.length-1]=r;else{s.length&&(s[s.length-1]=function e(t,r){if(0==r)return t;let i=t.content.replaceChild(t.childCount-1,e(t.lastChild,r-1)),o=t.contentMatchAt(t.childCount).fillBefore(n.empty,!0);return t.copy(i.append(o))}(s[s.length-1],o.length));let r=nY(e,t);s.push(r),i=i.matchType(r.type),o=t}}),s)return n.from(s)}return e}(l.content,o),!0)).openStart||l.openEnd){let e=0,t=0;for(let t=l.content.firstChild;e<l.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=l.content.lastChild;t<l.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);l=nZ(l,e,t)}return e.someProp("transformPasted",t=>{l=t(l,e,c)}),l}let nG=/^(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 nY(e,t,r=0){for(let i=t.length-1;i>=r;i--)e=t[i].create(null,n.from(e));return e}function nX(e,t,r,i,o,s){let l=t<0?e.firstChild:e.lastChild,a=l.content;return e.childCount>1&&(s=0),o<i-1&&(a=nX(a,t,r,i,o+1,s)),o>=r&&(a=t<0?l.contentMatchAt(0).fillBefore(a,s<=o).append(a):a.append(l.contentMatchAt(l.childCount).fillBefore(n.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,l.copy(a))}function nZ(e,t,n){return t<e.openStart&&(e=new a(nX(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new a(nX(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}let nQ={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},n0=null;function n1(){return n0||(n0=document.implementation.createHTMLDocument("title"))}let n2=null,n3={},n6={},n5={touchstart:!0,touchmove:!0};class n9{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function n7(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function n4(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>n8(e,t))})}function n8(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)})}function re(e){return{left:e.clientX,top:e.clientY}}function rt(e,t,n,r,i){if(-1==r)return!1;let o=e.state.doc.resolve(r);for(let r=o.depth+1;r>0;r--)if(e.someProp(t,t=>r>o.depth?t(e,n,o.nodeAfter,o.before(r),i,!0):t(e,n,o.node(r),o.before(r),i,!1)))return!0;return!1}function rn(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}n6.keydown=(e,t)=>{if((e.input.shiftKey=16==t.keyCode||t.shiftKey,!ro(e,t))&&(e.input.lastKeyCode=t.keyCode,e.input.lastKeyCodeTime=Date.now(),!tK||!tB||13!=t.keyCode))if(229!=t.keyCode&&e.domObserver.forceFlush(),!tU||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)e.someProp("handleKeyDown",n=>n(e,t))||function(e,t){let n,r=t.keyCode,i=(n="",t.ctrlKey&&(n+="c"),t.metaKey&&(n+="m"),t.altKey&&(n+="a"),t.shiftKey&&(n+="s"),n);if(8==r||tJ&&72==r&&"c"==i)return nU(e,-1)||nj(e,-1);if(46==r&&!t.shiftKey||tJ&&68==r&&"c"==i)return nU(e,1)||nj(e,1);if(13==r||27==r)return!0;
1if(37==r||tJ&&66==r&&"c"==i){let t=37==r?"ltr"==nV(e,e.state.selection.from)?-1:1:-1;return nz(e,t,i)||nj(e,t)}if(39==r||tJ&&70==r&&"c"==i){let t=39==r?"ltr"==nV(e,e.state.selection.from)?1:-1:1;return nz(e,t,i)||nj(e,t)}else if(38==r||tJ&&80==r&&"c"==i)return nH(e,-1,i)||nj(e,-1);else if(40==r||tJ&&78==r&&"c"==i)return function(e){if(!tH||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;nJ(e,n,"true"),setTimeout(()=>nJ(e,n,"false"),20)}return!1}(e)||nH(e,1,i)||nj(e,1);else if(i==(tJ?"m":"c")&&(66==r||73==r||89==r||90==r))return!0;return!1}(e,t)?t.preventDefault():n7(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",t=>t(e,tN(13,"Enter"))),e.input.lastIOSEnter=0)},200)}},n6.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},n6.keypress=(e,t)=>{if(ro(e,t)||!t.charCode||t.ctrlKey&&!t.altKey||tJ&&t.metaKey)return;if(e.someProp("handleKeyPress",n=>n(e,t)))return void t.preventDefault();let n=e.state.selection;if(!(n instanceof ej)||!n.$from.sameParent(n.$to)){let r=String.fromCharCode(t.charCode),i=()=>e.state.tr.insertText(r).scrollIntoView();/[\r\n]/.test(r)||e.someProp("handleTextInput",t=>t(e,n.$from.pos,n.$to.pos,r,i))||e.dispatch(i()),t.preventDefault()}};let rr=tJ?"metaKey":"ctrlKey";n3.mousedown=(e,t)=>{var n;let r,i;e.input.shiftKey=t.shiftKey;let o=rd(e),s=Date.now(),l="singleClick";s-e.input.lastClick.time<500&&(r=(n=e.input.lastClick).x-t.clientX)*r+(i=n.y-t.clientY)*i<100&&!t[rr]&&e.input.lastClick.button==t.button&&("singleClick"==e.input.lastClick.type?l="doubleClick":"doubleClick"==e.input.lastClick.type&&(l="tripleClick")),e.input.lastClick={time:s,x:t.clientX,y:t.clientY,type:l,button:t.button};let a=e.posAtCoords(re(t));a&&("singleClick"==l?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new ri(e,a,t,!!o)):("doubleClick"==l?function(e,t,n,r){return rt(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",n=>n(e,t,r))}:function(e,t,n,r){return rt(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",n=>n(e,t,r))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(rn(e,ej.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),o=i.before(t);if(n.inlineContent)rn(e,ej.create(r,o+1,o+1+n.content.size),"pointer");else{if(!eB.isSelectable(n))continue;rn(e,eB.create(r,o),"pointer")}return!0}}(e,n,r)})(e,a.pos,a.inside,t)?t.preventDefault():n7(e,"pointer"))};class ri{constructor(e,t,n,r){let i,o;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[rr],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,o=n.depth?n.before():0}const s=r?null:n.target,l=s?e.docView.nearestDesc(s,!0):null;this.target=l&&1==l.nodeDOM.nodeType?l.nodeDOM:null;let{selection:a}=e.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||a instanceof eB&&a.from<=o&&a.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&tj&&!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()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),n7(e,"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(()=>nC(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;if(this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(re(e))),this.updateAllowDefault(e),this.allowDefault||!t)n7(this.view,"pointer");else{var n,r,i,o;(n=this.view,r=t.pos,i=t.inside,o=this.selectNode,rt(n,"handleClickOn",r,i,e)||n.someProp("handleClick",t=>t(n,r,e))||(o?function(e,t){if(-1==t)return!1;let n=e.state.selection,r,i;n instanceof eB&&(r=n.node);let o=e.state.doc.resolve(t);for(let e=o.depth+1;e>0;e--){let t=e>o.depth?o.nodeAfter:o.node(e);if(eB.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?o.before(n.$from.depth):o.before(e);break}}
1return null!=i&&(rn(e,eB.create(e.state.doc,i),"pointer"),!0)}(n,i):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&eB.isSelectable(r))&&(rn(e,new eB(n),"pointer"),!0)}(n,i)))?e.preventDefault():0==e.button&&(this.flushed||tH&&this.mightDrag&&!this.mightDrag.node.isAtom||tB&&!this.view.state.selection.visible&&2>=Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to)))?(rn(this.view,eP.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):n7(this.view,"pointer")}}move(e){this.updateAllowDefault(e),n7(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function ro(e,t){return!!e.composing||!!(tH&&500>Math.abs(t.timeStamp-e.input.compositionEndedAt))&&(e.input.compositionEndedAt=-2e8,!0)}n3.touchstart=e=>{e.input.lastTouch=Date.now(),rd(e),n7(e,"pointer")},n3.touchmove=e=>{e.input.lastTouch=Date.now(),n7(e,"pointer")},n3.contextmenu=e=>rd(e);let rs=tK?5e3:-1;function rl(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>rd(e),t))}function ra(e){let t;for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=((t=document.createEvent("Event")).initEvent("event",!0,!0),t.timeStamp));e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function rd(e,t=!1){if(!tK||!(e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),ra(e),t||e.docView&&e.docView.dirty){let n=nS(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}n6.compositionstart=n6.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof ej&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)||tB&&tq&&function(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||1!=t.nodeType||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return 1==r.nodeType&&"false"==r.contentEditable}(e)))e.markCursor=e.state.storedMarks||n.marks(),rd(e,!0),e.markCursor=null;else if(rd(e,!t.selection.empty),tj&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}rl(e,rs)},n6.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.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,rl(e,20))};let rc=tL&&tF<15||tU&&tY<604;function ru(e,t,n,r,i){let o=nK(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,i,o||a.empty)))return!0;if(!o)return!1;let s=0==o.openStart&&0==o.openEnd&&1==o.content.childCount?o.content.firstChild:null,l=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(o);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function rp(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," "):""}n3.copy=n6.cut=(e,t)=>{let n=e.state.selection,r="cut"==t.type;if(n.empty)return;let i=rc?null:t.clipboardData,{dom:o,text:s}=nq(e,n.content());i?(t.preventDefault(),i.clearData(),i.setData("text/html",o.innerHTML),i.setData("text/plain",s)):function(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)}(e,o),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},n6.paste=(e,t)=>
vendor: 10,721 bytes, line 1
1{if(e.composing&&!tK)return;let n=rc?null:t.clipboardData,r=e.input.shiftKey&&45!=e.input.lastKeyCode;n&&ru(e,rp(n),n.getData("text/html"),r,t)?t.preventDefault():function(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&&45!=e.input.lastKeyCode;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ru(e,r.value,null,i,t):ru(e,r.textContent,r.innerHTML,i,t)},50)}(e,t)};class rh{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}let rf=tJ?"altKey":"ctrlKey";function rm(e,t){let n=e.someProp("dragCopies",e=>!e(t));return null!=n?n:!t[rf]}for(let e in n3.dragstart=(e,t)=>{let n,r=e.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(re(t));if(o&&o.pos>=i.from&&o.pos<=(i instanceof eB?i.to-1:i.to));else if(r&&r.mightDrag)n=eB.create(e.state.doc,r.mightDrag.pos);else if(t.target&&1==t.target.nodeType){let r=e.docView.nearestDesc(t.target,!0);r&&r.node.type.spec.draggable&&r!=e.docView&&(n=eB.create(e.state.doc,r.posBefore))}let s=(n||e.state.selection).content(),{dom:l,text:a,slice:d}=nq(e,s);t.dataTransfer.files.length&&tB&&!(tV>120)||t.dataTransfer.clearData(),t.dataTransfer.setData(rc?"Text":"text/html",l.innerHTML),t.dataTransfer.effectAllowed="copyMove",rc||t.dataTransfer.setData("text/plain",a),e.dragging=new rh(d,rm(e,t),n)},n3.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},n6.dragover=n6.dragenter=(e,t)=>t.preventDefault(),n6.drop=(e,t)=>{try{!function(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(re(t));if(!r)return;let i=e.state.doc.resolve(r.pos),o=n&&n.slice;o?e.someProp("transformPasted",t=>{o=t(o,e,!1)}):o=nK(e,rp(t.dataTransfer),rc?null:t.dataTransfer.getData("text/html"),!1,i);let s=!!(n&&rm(e,t));if(e.someProp("handleDrop",n=>n(e,t,o||a.empty,s)))return t.preventDefault();if(!o)return;t.preventDefault();let l=o?ek(e.state.doc,i.pos,o):i.pos;null==l&&(l=i.pos);let d=e.state.tr;if(s){let{node:e}=n;e?e.replace(d):d.deleteSelection()}let c=d.mapping.map(l),u=0==o.openStart&&0==o.openEnd&&1==o.content.childCount,p=d.doc;if(u?d.replaceRangeWith(c,c,o.content.firstChild):d.replaceRange(c,c,o),d.doc.eq(p))return;let h=d.doc.resolve(c);if(u&&eB.isSelectable(o.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(o.content.firstChild))d.setSelection(new eB(h));else{let t=d.mapping.map(l);d.mapping.maps[d.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),d.setSelection(nD(e,h,d.doc.resolve(t)))}e.focus(),e.dispatch(d.setMeta("uiEvent","drop"))}(e,t,e.dragging)}finally{e.dragging=null}},n3.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())&&nC(e)},20))},n3.blur=(e,t)=>{e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),t.relatedTarget&&e.dom.contains(t.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},n3.beforeinput=(e,t)=>{if(tB&&tK&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",t=>t(e,tN(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}},n6)n3[e]=n6[e];function rg(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 ry{constructor(e,t){this.toDOM=e,this.spec=t||rk,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:o}=e.mapResult(t.from+r,this.side<0?-1:1);return o?null:new rx(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof ry&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&rg(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class rb{constructor(e,t){this.attrs=e,this.spec=t||rk}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new rx(i,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof rb&&rg(this.attrs,e.attrs)&&rg(this.spec,e.spec)}static is(e){return e.type instanceof rb}destroy(){}}class rv{constructor(e,t){this.attrs=e,this.spec=t||rk}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let o=e.mapResult(t.to+r,-1);return o.deleted||o.pos<=i.pos?null:new rx(i.pos-n,o.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(e){return this==e||e instanceof rv&&rg(this.attrs,e.attrs)&&rg(this.spec,e.spec)}destroy(){}}class rx{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new rx(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new rx(e,e,new ry(t,n))}static inline(e,t,n,r){return new rx(e,t,new rb(n,r))}static node(e,t,n,r){return new rx(e,t,new rv(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof rb}get widget(){return this.type instanceof ry}}let rw=[],rk={};class rS{constructor(e,t){this.local=e.length?e:rw,this.children=t.length?t:rw}static create(e,t){return t.length?rE(t,e,0,rk):rT}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,i){for(let o=0;o<this.local.length;o++){let s=this.local[o];s.from<=t&&s.to>=e&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,r+s,i)}}map(e,t,n){return this==rT||0==e.maps.length?this:this.mapInner(e,t,0,0,n||rk)}mapInner(e,t,n,r,i){let o;for(let s=0;s<this.local.length;s++){let l=this.local[s].map(e,n,r);l&&l.type.valid(t,l)?(o||(o=[])).push(l):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,i,o,s){let l=e.slice();for(let e=0,t=o;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,o)=>{let s=o-i-(n-e);for(let i=0;i<l.length;i+=3){let o=l[i+1];if(o<0||e>o+t-r)continue;let a=l[i]+t-r;n>=a?l[i+1]=e<=a?-2:-1:e>=t&&s&&(l[i]+=s,l[i+1]+=s)}r+=s}),t=n.maps[e].map(t,-1)}let a=!1;for(let t=0;t<l.length;t+=3)if(l[t+1]<0){if(-2==l[t+1]){a=!0,l[t+1]=-1;continue}let d=n.map(e[t]+o),c=d-i;if(c<0||c>=r.content.size){a=!0;continue}let u=n.map(e[t+1]+o,-1)-i,{index:p,offset:h}=r.content.findIndex(c),f=r.maybeChild(p);if(f&&h==c&&h+f.nodeSize==u){let r=l[t+2].mapInner(n,f,d+1,e[t]+o+1,s);r!=rT?(l[t]=c,l[t+1]=u,l[t+2]=r):(l[t+1]=-2,a=!0)}else a=!0}if(a){let a=rE(function(e,t,n,r,i,o,s){for(let l=0;l<e.length;l+=3)-1==e[l+1]&&function e(t,o){for(let e=0;e<t.local.length;e++){let l=t.local[e].map(r,i,o);l?n.push(l):s.onRemove&&s.onRemove(t.local[e].spec)}for(let n=0;n<t.children.length;n+=3)e(t.children[n+2],t.children[n]+o+1)}(e[l+2],t[l]+o+1);return n}(l,e,t,n,i,o,s),r,0,s);t=a.local;for(let e=0;e<l.length;e+=3)l[e+1]<0&&(l.splice(e,3),e-=3);for(let e=0,t=0;e<a.children.length;e+=3){let n=a.children[e];for(;t<l.length&&l[t]<n;)t+=3;l.splice(t,0,a.children[e],a.children[e+1],a.children[e+2])}}return new rS(t.sort(rO),l)}(this.children,o||[],e,t,n,r,i):o?new rS(o.sort(rO),rw):rT}add(e,t){return t.length?this==rT?rS.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,i=0;e.forEach((e,o)=>{let s=o+n,l;if(l=rM(t,e,s)){for(r||(r=this.children.slice());i<r.length&&r[i]<o;)i+=3;r[i]==o?r[i+2]=r[i+2].addInner(e,l,s+1):r.splice(i,0,o,o+e.nodeSize,rE(l,e,s+1,rk)),i+=3}});let o=r_(i?rA(t):t,-n);for(let t=0;t<o.length;t++)o[t].type.valid(e,o[t])||o.splice(t--,1);return new rS(o.length?this.local.concat(o).sort(rO):this.local,r||this.children)}remove(e){return 0==e.length||this==rT?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let i,o=n[r]+t,s=n[r+1]+t;for(let t=0,n;t<e.length;t++)(n=e[t])&&n.from>o&&n.to<s&&(e[t]=null,(i||(i=[])).push(n));if(!i)continue;n==this.children&&(n=this.children.slice());let l=n[r+2].removeInner(i,o+1);l!=rT?n[r+2]=l:(n.splice(r,3),r-=3)}if(r.length){for(let n=0,i;n<e.length;n++)if(i=e[n])for(let e=0;e<r.length;e++)r[e].eq(i,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1))}return n==this.children&&r==this.local?this:r.length||n.length?new rS(r,n):rT}forChild(e,t){let n,r;if(this==rT)return this;if(t.isLeaf)return rS.empty;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let i=e+1,o=i+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>i&&t.type instanceof rb){let e=Math.max(i,t.from)-i,n=Math.min(o,t.to)-i;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new rS(r.sort(rO),rw);return n?new rC([e,n]):e}return n||rT}eq(e){if(this==e)return!0;if(!(e instanceof rS)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return rN(this.localsInner(e))}localsInner(e){if(this==rT)return rw;if(e.inlineContent||!this.local.some(rb.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof rb||t.push(this.local[e]);return t}forEachSet(e){e(this)}}rS.empty=new rS([],[]),rS.removeOverlap=rN;let rT=rS.empty;class rC{constructor(e){this.members=e}map(e,t){let n=this.members.map(n=>n.map(e,t,rk));return rC.from(n)}forChild(e,t){if(t.isLeaf)return rS.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=rT&&(i instanceof rC?n=n.concat(i.members):n.push(i))}return rC.from(n)}eq(e){if(!(e instanceof rC)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<i.length;e++)t.push(i[e])}else t=i}return t?rN(n?t:t.sort(rO)):rw}static from(e){switch(e.length){case 0:return rT;case 1:return e[0];default:return new rC(e.every(e=>e instanceof rS)?e:e.reduce((e,t)=>
1e.concat(t instanceof rS?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function r_(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 rx(i.from+t,i.to+t,i.type))}return n}function rM(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,o;t<e.length;t++)(o=e[t])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),e[t]=null);return i}function rA(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function rE(e,t,n,r){let i=[],o=!1;t.forEach((t,s)=>{let l=rM(e,t,s+n);if(l){o=!0;let e=rE(l,t,n+s+1,r);e!=rT&&i.push(s,s+t.nodeSize,e)}});let s=r_(o?rA(e):e,-n).sort(rO);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(r.onRemove&&r.onRemove(s[e].spec),s.splice(e--,1));return s.length||i.length?new rS(s,i):rT}function rO(e,t){return e.from-t.from||e.to-t.to}function rN(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),rD(t,i+1,o.copy(r.to,o.to)));continue}o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),rD(t,i,r.copy(o.from,r.to)));break}}return t}function rD(e,t,n){for(;t<e.length&&rO(n,e[t])>0;)t++;e.splice(t,0,n)}function rI(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=rT&&t.push(r)}),e.cursorWrapper&&t.push(rS.create(e.state.doc,[e.cursorWrapper.deco])),rC.from(t)}let r$={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},rR=tL&&tF<=11;class rP{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class rz{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new rP,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);tL&&tF<=11&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():tH&&e.composing&&t.some(e=>"childList"==e.type&&"TR"==e.target.nodeName)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),rR&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,r$)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(nI(this.view)){if(this.suppressingSelectionUpdates)return nC(this.view);if(tL&&tF<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&tC(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=tw(n))t.add(n);for(let r=e.anchorNode;r;r=tw(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:"selection",target:3==n.nodeType?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){var e;let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&nI(t)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,a=[];if(t.editable)for(let e=0;e<n.length;e++){let t=this.registerMutation(n[e],a);t&&(o=o<0?t.from:Math.min(t.from,o),s=s<0?t.to:Math.max(t.to,s),t.typeOver&&(l=!0))}if(tj&&a.length){let e=a.filter(e=>"BR"==e.nodeName);if(2==e.length){let[t,n]=e;t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of e){let e=r.parentNode;e&&"LI"==e.nodeName&&(!n||function(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}(t,n)!=e)&&r.remove()}}}else if((tB||tH)&&a.some(e=>"BR"==e.nodeName)&&(8==t.input.lastKeyCode||46==t.input.lastKeyCode)){for(let e of a)if("BR"==e.nodeName&&e.parentNode){let t=e.nextSibling;t&&1==t.nodeType&&"false"==t.contentEditable&&e.parentNode.removeChild(e)}}let d=null;o<0&&i&&t.input.lastFocus>
1Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&tO(r)&&(d=nS(t))&&d.eq(eP.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,nC(t),this.currentSelection.set(r),t.scrollToSelection()):(o>-1||i)&&(o>-1&&(t.docView.markDirty(o,s),e=t,!rL.has(e)&&(rL.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))&&(e.requiresGeckoHackNode=tj,rF||(console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),rF=!0))),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,function(e,t){var n;let{focusNode:r,focusOffset:i}=e.domSelectionRange();for(let o of t)if((null==(n=o.parentNode)?void 0:n.nodeName)=="TR"){let t=o.nextSibling;for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.nextSibling;if(t){let n=t;for(;;){let e=n.firstChild;if(!e||1!=e.nodeType||"false"==e.contentEditable||/^(BR|IMG)$/.test(e.nodeName))break;n=e}n.insertBefore(o,n.firstChild),r==o&&e.domSelection().collapse(o,i)}else o.parentNode.removeChild(o)}}(t,a)),this.handleDOMChange(o,s,l,a),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||nC(t),this.currentSelection.set(r))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),3==r.nodeType&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(tL&&tF<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:o}=e.addedNodes[t];(!n||0>Array.prototype.indexOf.call(e.addedNodes,n))&&(r=n),(!o||0>Array.prototype.indexOf.call(e.addedNodes,o))&&(i=o)}let o=r&&r.parentNode==e.target?tx(r)+1:0,s=n.localPosFromDOM(e.target,o,-1),l=i&&i.parentNode==e.target?tx(i):e.target.childNodes.length;return{from:s,to:n.localPosFromDOM(e.target,l,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let rL=new WeakMap,rF=!1;function rj(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,o=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return tC(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function rW(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(tH&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}else if(e.parentNode.lastChild==e||tH&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}let rB=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function rV(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:nD(e,t.resolve(n.anchor),t.resolve(n.head))}function rH(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function rU(e){if(2!=e.length)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class rJ{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new n9,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(rX),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=rG(this),rK(this),this.nodeViews=rY(this),this.docView=nd(this.state.doc,rq(this),rI(this),this.dom,this),this.domObserver=new rz(this,(e,t,r,i
vendor: 4,316 bytes, line 1
1)=>(function(e,t,r,i,o){let s,l,a,d=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=nS(e,t);if(n&&!e.state.selection.eq(n)){if(tB&&tK&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",t=>t(e,tN(13,"Enter"))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),d&&r.setMeta("composition",d),e.dispatch(r)}return}let c=e.state.doc.resolve(t),u=c.sharedDepth(r);t=c.before(u+1),r=e.state.doc.resolve(r).after(u+1);let p=e.state.selection,h=function(e,t,n){let r,{node:i,fromOffset:o,toOffset:s,from:l,to:a}=e.docView.parseRange(t,n),d=e.domSelectionRange(),c=d.anchorNode;if(c&&e.dom.contains(1==c.nodeType?c:c.parentNode)&&(r=[{node:c,offset:d.anchorOffset}],tO(d)||r.push({node:d.focusNode,offset:d.focusOffset})),tB&&8===e.input.lastKeyCode)for(let e=s;e>o;e--){let t=i.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){s=e;break}if(!n||n.size)break}let u=e.state.doc,p=e.someProp("domParser")||L.fromSchema(e.state.schema),h=u.resolve(l),f=null,m=p.parse(i,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:o,to:s,preserveWhitespace:"pre"!=h.parent.type.whitespace||"full",findPositions:r,ruleFromNode:rW,context:h});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),f={anchor:e+l,head:t+l}}return{doc:m,sel:f,from:l,to:a}}(e,t,r),f=e.state.doc,m=f.slice(h.from,h.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(s=e.state.selection.to,l="end"):(s=e.state.selection.from,l="start"),e.input.lastKeyCode=null;let g=function(e,t,n,r,i){let o=e.findDiffStart(t,n);if(null==o)return null;let{a:s,b:l}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==i){let e=Math.max(0,o-Math.min(s,l));r-=s+e-o}if(s<o&&e.size<t.size){let e=r<=o&&r>=s?o-r:0;(o-=e)&&o<t.size&&rU(t.textBetween(o-1,o+1))&&(o+=e?1:-1),l=o+(l-s),s=o}else if(l<o){let t=r<=o&&r>=l?o-r:0;(o-=t)&&o<e.size&&rU(e.textBetween(o-1,o+1))&&(o+=t?1:-1),s=o+(s-l),l=o}return{start:o,endA:s,endB:l}}(m.content,h.doc.content,h.from,s,l);if(g&&e.input.domChangeCount++,(tU&&e.input.lastIOSEnter>Date.now()-225||tK)&&o.some(e=>1==e.nodeType&&!rB.test(e.nodeName))&&(!g||g.endA>=g.endB)&&e.someProp("handleKeyDown",t=>t(e,tN(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!g)if(i&&p instanceof ej&&!p.empty&&p.$head.sameParent(p.$anchor)&&!e.composing&&!(h.sel&&h.sel.anchor!=h.sel.head))g={start:p.from,endA:p.to,endB:p.to};else{if(h.sel){let t=rV(e,e.state.doc,h.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);d&&n.setMeta("composition",d),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&g.start==g.endB&&e.state.selection instanceof ej&&(g.start>e.state.selection.from&&g.start<=e.state.selection.from+2&&e.state.selection.from>=h.from?g.start=e.state.selection.from:g.endA<e.state.selection.to&&g.endA>=e.state.selection.to-2&&e.state.selection.to<=h.to&&(g.endB+=e.state.selection.to-g.endA,g.endA=e.state.selection.to)),tL&&tF<=11&&g.endB==g.start+1&&g.endA==g.start&&g.start>h.from&&" Â "==h.doc.textBetween(g.start-h.from-1,g.start-h.from+1)&&(g.start--,g.endA--,g.endB--);let y=h.doc.resolveNoCache(g.start-h.from),b=h.doc.resolveNoCache(g.endB-h.from),v=f.resolve(g.start),x=y.sameParent(b)&&y.parent.inlineContent&&v.end()>=g.endA;if((tU&&e.input.lastIOSEnter>Date.now()-225&&(!x||o.some(e=>"DIV"==e.nodeName||"P"==e.nodeName))||!x&&y.pos<h.doc.content.size&&(!y.sameParent(b)||!y.parent.inlineContent)&&y.pos<b.pos&&!/\S/.test(h.doc.textBetween(y.pos,b.pos,"","")))&&e.someProp("handleKeyDown",t=>t(e,tN(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>g.start&&function(e,t,n,r,i){if(n-t<=i.pos-r.pos||rH(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(!r.parent.isTextblock){let e=o.nodeAfter;return null!=e&&n==t+e.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=e.resolve(rH(o,!0,!0));return!(!s.parent.isTextblock||s.pos>n||rH(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(f,g.start,g.endA,y,b)&&e.someProp("handleKeyDown",t=>t(e,tN(8,"Backspace")))){tK&&tB&&e.domObserver.suppressSelectionUpdates();return}
vendor: 5,054 bytes, line 1
1tB&&g.endB==g.start&&(e.input.lastChromeDelete=Date.now()),tK&&!x&&y.start()!=b.start()&&0==b.parentOffset&&y.depth==b.depth&&h.sel&&h.sel.anchor==h.sel.head&&h.sel.head==g.endA&&(g.endB-=2,b=h.doc.resolveNoCache(g.endB-h.from),setTimeout(()=>{e.someProp("handleKeyDown",function(t){return t(e,tN(13,"Enter"))})},20));let w=g.start,k=g.endA,S=t=>{let n=t||e.state.tr.replace(w,k,h.doc.slice(g.start-h.from,g.endB-h.from));if(h.sel){let t=rV(e,n.doc,h.sel);t&&!(tB&&e.composing&&t.empty&&(g.start!=g.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==w||t.head==n.mapping.map(k)-1)||tL&&t.empty&&t.head==w)&&n.setSelection(t)}return d&&n.setMeta("composition",d),n.scrollIntoView()};if(x)if(y.pos==b.pos){tL&&tF<=11&&0==y.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>nC(e),20));let t=S(e.state.tr.delete(w,k)),n=f.resolve(g.start).marksAcross(f.resolve(g.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(g.endA==g.endB&&(a=function(e,t){let r=e.firstChild.marks,i=t.firstChild.marks,o=r,s=i,l,a,d;for(let e=0;e<i.length;e++)o=i[e].removeFromSet(o);for(let e=0;e<r.length;e++)s=r[e].removeFromSet(s);if(1==o.length&&0==s.length)a=o[0],l="add",d=e=>e.mark(a.addToSet(e.marks));else{if(0!=o.length||1!=s.length)return null;a=s[0],l="remove",d=e=>e.mark(a.removeFromSet(e.marks))}let c=[];for(let e=0;e<t.childCount;e++)c.push(d(t.child(e)));if(n.from(c).eq(e))return{mark:a,type:l}}(y.parent.content.cut(y.parentOffset,b.parentOffset),v.parent.content.cut(v.parentOffset,g.endA-v.start())))){let t=S(e.state.tr);"add"==a.type?t.addMark(w,k,a.mark):t.removeMark(w,k,a.mark),e.dispatch(t)}else if(y.parent.child(y.index()).isText&&y.index()==b.index()-!b.textOffset){let t=y.parent.textBetween(y.parentOffset,b.parentOffset),n=()=>S(e.state.tr.insertText(t,w,k));e.someProp("handleTextInput",r=>r(e,w,k,t,n))||e.dispatch(n())}else e.dispatch(S());else e.dispatch(S())})(this,e,t,r,i)),this.domObserver.start(),function(e){for(let t in n3){let n=n3[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}(e,t)||n8(e,t)||!e.editable&&t.type in n6||n(e,t)},n5[t]?{passive:!0}:void 0)}tH&&e.dom.addEventListener("input",()=>null),n4(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;for(let t in this._props={},e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&n4(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(rX),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];for(let n in t.state=this.state,e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n,r,i;let o=this.state,s=!1,l=!1;e.storedMarks&&this.composing&&(ra(this),l=!0),this.state=e;let a=o.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=rY(this);(function(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,s=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&n4(this),this.editable=rG(this),rK(this);let d=rI(this),c=rq(this),u=o.plugins==e.plugins||o.doc.eq(e.doc)?e.scrollToSelection>o.scrollToSelection?"to selection":"preserve":"reset",p=s||!this.docView.matchesNode(e.doc,c,d);(p||!e.selection.eq(o.selection))&&(l=!0);let h="preserve"==u&&l&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let o=(r.left+r.right)/2,s=i+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(o,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let l=r.getBoundingClientRect();if(l.top>=i-20){t=r,n=l.top;break}}return{refDOM:t,refTop:n,stack:tQ(e.dom)}}(this);if(l){let t,n,l;this.domObserver.stop();let a=p&&(tL||tB)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&(r=o.selection,i=e.selection,l=Math.min(r.$anchor.sharedDepth(r.head),i.$anchor.sharedDepth(i.head)),r.$anchor.start(l)!=i.$anchor.start(l));if(p){let t=tB?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=function(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=tA(e=e.childNodes[t-1])}else{if(!e.parentNode||tE(e))return null;t=tx(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),r=function(e,t){for(;;){if(3==e.nodeType&&t<e.nodeValue.length)return e;if(1==e.nodeType&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||tE(e))return null;t=tx(e)+1,e=e.parentNode}}}(t.focusNode,t.focusOffset);
1if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r}}return n||r}(this)),(s||!this.docView.update(e.doc,c,d,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=nd(e.doc,c,d,this.dom,this)),!t||this.trackWrites&&this.dom.contains(this.trackWrites)||(a=!0)}a||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(t=this.docView.domFromPos(this.state.selection.anchor,0),n=this.domSelectionRange(),tC(t.node,t.offset,n.anchorNode,n.anchorOffset)))?nC(this,a):(nO(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),(null==(n=this.dragging)?void 0:n.node)&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),"reset"==u?this.dom.scrollTop=0:"to selection"==u?this.scrollToSelection():h&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;t0(n,0==r?0:r-t)}(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(1==e.nodeType?e:e.parentNode))if(this.someProp("handleScrollToSelection",e=>e(this)));else if(this.state.selection instanceof eB){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&tZ(this,t.getBoundingClientRect(),e)}else tZ(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}updateDraggedNode(e,t){let n=e.node,r=-1;if(this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new rh(e.slice,e.move,r<0?void 0:eB.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(null!=n&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(null!=i&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let o=i[n].props[e];if(null!=o&&(r=t?t(o):o))return r}}hasFocus(){if(tL){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(t1)return e.focus(t1);let t=tQ(e);e.focus(null==t1?{get preventScroll(){return t1={preventScroll:!0},!0}}:void 0),t1||(t1=!1,t0(t,0))}(this.dom),nC(this),this.domObserver.start()}get root(){let e=this._root;if(null==e){for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return function(e,t){var n;let r,i,o=e.dom.ownerDocument,s,l=0,a=function(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(tA(r.offsetNode),r.offset)}}catch(e){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(tA(r.startContainer),r.startOffset)}}}(o,t.left,t.top);a&&({node:s,offset:l}=a);let d=(e.root.elementFromPoint?e.root:o).elementFromPoint(t.left,t.top);if(!d||!e.dom.contains(1!=d.nodeType?d.parentNode:d)){let n=e.dom.getBoundingClientRect();if(!t2(t,n)||!(d=function e(t,n,r){let i=t.childNodes.length;if(i&&r.top<r.bottom)for(let o=Math.max(0,Math.min(i-1,Math.floor(i*(n.top-r.top)/(r.bottom-r.top))-2)),s=o;;){let r=t.childNodes[s];if(1==r.nodeType){let t=r.getClientRects();for(let i=0;i<t.length;i++){let o=t[i];if(t2(n,o))return e(r,n,o)}}if((s=(s+1)%i)==o)break}return t}(e.dom,t,n)))return null}if(tH)for(let e=d;s&&e;e=tw(e))e.draggable&&(s=void 0);if(d=(r=(n=d).parentNode)&&/^li$/i.test(r.nodeName)&&t.left<n.getBoundingClientRect().left?r:n,s){let n;if(tj&&1==s.nodeType&&(l=Math.min(l,s.childNodes.length))<s.childNodes.length){let e=s.childNodes[l],n;"IMG"==e.nodeName&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&l++}tG&&l&&1==s.nodeType&&1==(n=s.childNodes[l-1]).nodeType&&"false"==n.contentEditable&&n.getBoundingClientRect().top>=t.top&&l--,s==e.dom&&l==s.childNodes.length-1&&1==s.lastChild.nodeType&&t.top>
1s.lastChild.getBoundingClientRect().bottom?i=e.state.doc.content.size:(0==l||1!=s.nodeType||"BR"!=s.childNodes[l-1].nodeName)&&(i=function(e,t,n,r){let i=-1;for(let n=t,o=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),s;if(!t)return null;if(1==t.dom.nodeType&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((s=t.dom.getBoundingClientRect()).width||s.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!o&&s.left>r.left||s.top>r.top?i=t.posBefore:(!o&&s.right<r.left||s.bottom<r.top)&&(i=t.posAfter),o=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(s.top+s.bottom)/2:r.left<(s.left+s.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}(e,s,l,t))}null==i&&(i=function(e,t,n){let{node:r,offset:i}=function e(t,n){let r,i,o,s=2e8,l,a=0,d=n.top,c=n.top;for(let e=t.firstChild,u=0;e;e=e.nextSibling,u++){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=tS(e).getClientRects()}for(let p=0;p<t.length;p++){let h=t[p];if(h.top<=d&&h.bottom>=c){d=Math.max(h.bottom,d),c=Math.min(h.top,c);let t=h.left>n.left?h.left-n.left:h.right<n.left?n.left-h.right:0;if(t<s){o=e,s=t,l=t&&3==o.nodeType?{left:h.right<n.left?h.right:h.left,top:n.top}:n,1==e.nodeType&&t&&(a=u+ +(n.left>=(h.left+h.right)/2));continue}}else h.top>n.top&&!r&&h.left<=n.left&&h.right>=n.left&&(r=e,i={left:Math.max(h.left,Math.min(h.right,n.left)),top:h.top});!o&&(n.left>=h.right&&n.top>=h.top||n.left>=h.left&&n.top>=h.bottom)&&(a=u+1)}}return(!o&&r&&(o=r,l=i,s=0),o&&3==o.nodeType)?function(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);let n=t6(r,1);if(n.top!=n.bottom&&t2(t,n)){i={node:e,offset:o+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}(o,l):!o||s&&1==o.nodeType?{node:t,offset:a}:e(o,l)}(t,n),o=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();o=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}(e,d,t));let c=e.docView.nearestDesc(d,!0);return{pos:i,inside:c?c.posAtStart-c.border:-1}}(this,e)}coordsAtPos(e,t=1){return t9(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return function(e,t,n){let r,i;return nt==t&&nn==n?nr:(nt=t,nn=n,nr="up"==n||"down"==n?(r=t.selection,i="up"==n?r.$from:r.$to,t8(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=t9(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=tS(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&("up"==n?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=i==r.parent.content.size,s=e.domSelection();return s?ne.test(r.parent.textContent)&&s.modify?t8(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:o,anchorOffset:l}=e.domSelectionRange(),a=s.caretBidiLevel;s.modify("move",n,"character");let d=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:c,focusOffset:u}=e.domSelectionRange(),p=c&&!d.contains(1==c.nodeType?c:c.parentNode)||t==c&&i==u;try{s.collapse(o,l),t&&(t!=o||i!=l)&&s.extend&&s.extend(t,i)}catch(e){}return null!=a&&(s.caretBidiLevel=a),p}):"left"==n||"backward"==n?!i:o:r.pos==r.start()||r.pos==r.end()}(e,t,n))}(this,t||this.state,e)}pasteHTML(e,t){return ru(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return ru(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return nq(this,e)}destroy(){if(this.docView){for(let e in this.domObserver.stop(),this.input.eventHandlers)this.dom.removeEventListener(e,this.input.eventHandlers[e]);clearTimeout(this.input.composingTimeout),clearTimeout(this.input.lastIOSEnterFallbackTimeout),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],rI(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,tT()}}get isDestroyed(){return null==this.docView}dispatchEvent(e){!n8(this,e)&&n3[e.type]&&(this.editable||!(e.type in n6))&&n3[e.type](this,e)}domSelectionRange(){let e=this.domSelection();return e?tH&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){let n;if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return rj(e,n)}function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?rj(e,n):null}
1(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function rq(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))}),t.translate||(t.translate="no"),[rx.node(0,e.state.doc.content.size,t)]}function rK(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:rx.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function rG(e){return!e.someProp("editable",t=>!1===t(e.state))}function rY(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function rX(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError("Plugins passed directly to the view must not have a state component")}rJ.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))},e.s(["Decoration",0,rx,"DecorationSet",0,rS,"EditorView",0,rJ],571141);for(var rZ={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:"'"},rQ={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},r0="u">typeof navigator&&/Mac/.test(navigator.platform),r1="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),r2=0;r2<10;r2++)rZ[48+r2]=rZ[96+r2]=String(r2);for(var r2=1;r2<=24;r2++)rZ[r2+111]="F"+r2;for(var r2=65;r2<=90;r2++)rZ[r2]=String.fromCharCode(r2+32),rQ[r2]=String.fromCharCode(r2);for(var r3 in rZ)rQ.hasOwnProperty(r3)||(rQ[r3]=rZ[r3]);let r6="u">typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),r5="u">typeof navigator&&/Win/.test(navigator.platform);function r9(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 r7(e){return new e0({props:{handleKeyDown:r4(e)}})}function r4(e){let t=function(e){let t=Object.create(null);for(let n in e)t[function(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let e=0;e<o.length-1;e++){let s=o[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else if(/^mod$/i.test(s))r6?i=!0:n=!0;else throw Error("Unrecognized modifier name: "+s)}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}(n)]=e[n];return t}(e);return function(e,n){var r;let i=("Esc"==(r=!(r0&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||r1&&n.shiftKey&&n.key&&1==n.key.length||"Unidentified"==n.key)&&n.key||(n.shiftKey?rQ:rZ)[n.keyCode]||n.key||"Unidentified")&&(r="Escape"),"Del"==r&&(r="Delete"),"Left"==r&&(r="ArrowLeft"),"Up"==r&&(r="ArrowUp"),"Right"==r&&(r="ArrowRight"),"Down"==r&&(r="ArrowDown"),r),o,s=t[r9(i,n)];if(s&&s(e.state,e.dispatch,e))return!0;if(1==i.length&&" "!=i){if(n.shiftKey){let r=t[r9(i,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(r5&&n.ctrlKey&&n.altKey)&&(o=rZ[n.keyCode])&&o!=i){let r=t[r9(o,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}e.s(["keydownHandler",0,r4,"keymap",0,r7],929987);var r8=Object.defineProperty,ie=(e,t)=>{for(var n in t)r8(e,n,{get:t[n],enumerable:!0})};function it(e){let{state:t,transaction:n}=e,{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}}}var ir=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,o=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(o);return i.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s=[],l=!!e,a=e||i.tr,d=()=>(l||!t||a.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(a),s.every(e=>!0===e)),c={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(a,t),i=n(...e)(r);return s.push(i),c}])),run:d};return c}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s={tr:e,editor:r,view:o,state:it({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(s)]))}};return s}},ii={};ie(ii,{blur:()=>io,clearContent:()=>is,clearNodes:()=>il,command:()=>ia,createParagraphNear:()=>id,cut:()=>ic,deleteCurrentNode:()=>iu,deleteNode:()=>ih,deleteRange:()=>im,deleteSelection:()=>ig,enter:()=>iy,exitCode:()=>ib,extendMarkRange:()=>iC,first:()=>i_,focus:()=>
1iD,forEach:()=>iI,insertContent:()=>i$,insertContentAt:()=>iL,joinBackward:()=>iW,joinDown:()=>ij,joinForward:()=>iB,joinItemBackward:()=>iV,joinItemForward:()=>iH,joinTextblockBackward:()=>iU,joinTextblockForward:()=>iJ,joinUp:()=>iF,keyboardShortcut:()=>iK,lift:()=>iY,liftEmptyBlock:()=>iX,liftListItem:()=>iZ,newlineInCode:()=>iQ,resetAttributes:()=>i2,scrollIntoView:()=>i3,selectAll:()=>i6,selectNodeBackward:()=>i5,selectNodeForward:()=>i9,selectParentNode:()=>i7,selectTextblockEnd:()=>i4,selectTextblockStart:()=>i8,setContent:()=>ot,setMark:()=>oz,setMeta:()=>oL,setNode:()=>oF,setNodeSelection:()=>oj,setTextDirection:()=>oW,setTextSelection:()=>oB,sinkListItem:()=>oV,splitBlock:()=>oU,splitListItem:()=>oJ,toggleList:()=>oG,toggleMark:()=>oY,toggleNode:()=>oX,toggleWrap:()=>oZ,undoInputRule:()=>oQ,unsetAllMarks:()=>o0,unsetMark:()=>o1,unsetTextDirection:()=>o2,updateAttributes:()=>o3,wrapIn:()=>o6,wrapInList:()=>o5});var io=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),null==(n=null==window?void 0:window.getSelection())||n.removeAllRanges())}),!0),is=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),il=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return!n||(i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,o=r.resolve(i.map(n)),s=r.resolve(i.map(n+e.nodeSize)),l=o.blockRange(s);if(!l)return;let a=eh(l);if(e.type.isTextblock){let{defaultType:e}=o.parent.contentMatchAt(o.index());t.setNodeMarkup(l.start,e)}(a||0===a)&&t.lift(l,a)})}),!0)},ia=e=>t=>e(t),id=()=>({state:e,dispatch:t})=>ta(e,t),ic=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,o=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let s=r.mapping.map(t);return r.insert(s,o.content),r.setSelection(new ej(r.doc.resolve(Math.max(s-1,0)))),!0},iu=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;n-=1)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function ip(e,t){if("string"==typeof e){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}var ih=e=>({tr:t,state:n,dispatch:r})=>{let i=ip(e,n.schema),o=t.selection.$anchor;for(let e=o.depth;e>0;e-=1)if(o.node(e).type===i){if(r){let n=o.before(e),r=o.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},im=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},ig=()=>({state:e,dispatch:t})=>e6(e,t),iy=()=>({commands:e})=>e.keyboardShortcut("Enter"),ib=()=>({state:e,dispatch:t})=>tl(e,t);function iv(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function ix(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:iv(t[r])?t[r].test(e[r]):t[r]===e[r])}function iw(e,t,n={}){return e.find(e=>e.type===t&&ix(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function ik(e,t,n={}){return!!iw(e,t,n)}function iS(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(r.node&&r.node.marks.some(e=>e.type===t)||(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){let e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!iw([...r.node.marks],t,n))return;let i=r.index,o=e.start()+r.offset,s=i+1,l=o+r.node.nodeSize;for(;i>0&&ik([...e.parent.child(i-1).marks],t,n);)i-=1,o-=e.parent.child(i).nodeSize;for(;s<e.parent.childCount&&ik([...e.parent.child(s).marks],t,n);)l+=e.parent.child(s).nodeSize,s+=1;return{from:o,to:l}}function iT(e,t){if("string"==typeof e){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}var iC=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=iT(e,r.schema),{doc:s,selection:l}=n,{$from:a,from:d,to:c}=l;if(i){let e=iS(a,o,t);if(e&&e.from<=d&&e.to>=c){let t=ej.create(s,e.from,e.to);n.setSelection(t)}}return!0},i_=e=>t=>{let n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function iM(e){return e instanceof ej}function iA(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function iE(e,t=null){if(!t)return null;let n=eP.atStart(e),r=eP.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;let i=n.from,o=r.to;return"all"===t?ej.create(e,iA(0,i,o),iA(e.content.size,i,o)):ej.create(e,iA(t,i,o),iA(t,i,o))}function iO(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function iN(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var iD=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};let s=()=>{(iN()||iO())&&r.dom.focus(),"u">typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!iN()&&!iO()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{!n.isDestroyed&&(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&null===e||!1===e)return!0}catch{return!1}if(o&&null===e&&!iM(n.state.selection))return s(),!0;let l=iE(i.doc,e)||n.state.selection,a=n.state.selection.eq(l);return o&&(a||i.setSelection(l),a&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},iI=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),i$=(e,t)=>
1({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),iR=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){let r=t[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):1===r.nodeType&&iR(r)}return e};function iP(e){if("u"<typeof window)throw Error("[tiptap error]: there is no window object available, so this function cannot be used");let t=`<body>${e}</body>`;return iR(new window.DOMParser().parseFromString(t,"text/html").body)}function iz(e,t,r){if(e instanceof w||e instanceof n)return e;r={slice:!0,parseOptions:{},...r};let i="object"==typeof e&&null!==e,o="string"==typeof e;if(i)try{if(Array.isArray(e)&&e.length>0)return n.fromArray(e.map(e=>t.nodeFromJSON(e)));let i=t.nodeFromJSON(e);return r.errorOnInvalidContent&&i.check(),i}catch(n){if(r.errorOnInvalidContent)throw Error("[tiptap error]: Invalid JSON content",{cause:n});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",n),iz("",t,r)}if(o){if(r.errorOnInvalidContent){let n=!1,i="",o=new P({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:e=>(n=!0,i="string"==typeof e?e:e.outerHTML,null)}]}})});if(r.slice?L.fromSchema(o).parseSlice(iP(e),r.parseOptions):L.fromSchema(o).parse(iP(e),r.parseOptions),r.errorOnInvalidContent&&n)throw Error("[tiptap error]: Invalid HTML content",{cause:Error(`Invalid element found: ${i}`)})}let n=L.fromSchema(t);return r.slice?n.parseSlice(iP(e),r.parseOptions).content:n.parse(iP(e),r.parseOptions)}return iz("",t,r)}var iL=(e,t,r)=>({tr:i,dispatch:o,editor:s})=>{var l;if(o){let o,a;r={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...r};let d=e=>{s.emit("contentError",{editor:s,error:e,disableCollaboration:()=>{"collaboration"in s.storage&&"object"==typeof s.storage.collaboration&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...r.parseOptions};if(!r.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{iz(t,s.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(e){d(e)}try{o=iz(t,s.schema,{parseOptions:c,errorOnInvalidContent:null!=(l=r.errorOnInvalidContent)?l:s.options.enableContentCheck})}catch(e){return d(e),!1}let{from:u,to:p}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},h=!0,f=!0;if((!("type"in o)?o:[o]).forEach(e=>{e.check(),h=!!h&&e.isText&&0===e.marks.length,f=!!f&&e.isBlock}),u===p&&f){let{parent:e}=i.doc.resolve(u);!e.isTextblock||e.type.spec.code||e.childCount||(u-=1,p+=1)}if(h){if(Array.isArray(t))a=t.map(e=>e.text||"").join("");else if(t instanceof n){let e="";t.forEach(t=>{t.text&&(e+=t.text)}),a=e}else a="object"==typeof t&&t&&t.text?t.text:t;i.insertText(a,u,p)}else{a=o;let e=i.doc.resolve(u),t=e.node(),n=0===e.parentOffset,r=t.isText||t.isTextblock,s=t.content.size>0;n&&r&&s&&f&&(u=Math.max(0,u-1)),i.replaceWith(u,p,a)}r.updateSelection&&function(e,t){let n=e.steps.length-1;if(n<t)return;let r=e.steps[n];if(!(r instanceof ed||r instanceof ec))return;let i=e.mapping.maps[n],o=0;i.forEach((e,t,n,r)=>{0===o&&(o=r)}),e.setSelection(eP.near(e.doc.resolve(o),-1))}(i,i.steps.length-1),r.applyInputRules&&i.setMeta("applyInputRules",{from:u,text:a}),r.applyPasteRules&&i.setMeta("applyPasteRules",{from:u,text:a})}return!0},iF=()=>({state:e,dispatch:t})=>((e,t)=>{let n=e.selection,r=n instanceof eB,i;if(r){if(n.node.isTextblock||!ev(e.doc,n.from))return!1;i=n.from}else if(null==(i=ew(e.doc,n.from,-1)))return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(eB.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0})(e,t),ij=()=>({state:e,dispatch:t})=>((e,t)=>{let n=e.selection,r;if(n instanceof eB){if(n.node.isTextblock||!ev(e.doc,n.to))return!1;r=n.to}else if(null==(r=ew(e.doc,n.to,1)))return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0})(e,t),iW=()=>({state:e,dispatch:t})=>e9(e,t),iB=()=>({state:e,dispatch:t})=>tn(e,t),iV=()=>({state:e,dispatch:t,tr:n})=>{try{let r=ew(e.doc,e.selection.$from.pos,-1);if(null==r)return!1;return n.join(r,2),t&&t(n),!0}catch{return!1}},iH=()=>({state:e,dispatch:t,tr:n})=>{try{let r=ew(e.doc,e.selection.$from.pos,1);if(null==r)return!1;return n.join(r,2),t&&t(n),!0}catch{return!1}},iU=()=>({state:e,dispatch:t})=>((e,t)=>{let n=e5(e,void 0);if(!n)return!1;let r=te(n);return!!r&&e7(e,r,t)})(e,t),iJ=()=>({state:e,dispatch:t})=>((e,t)=>{let n=tt(e,void 0);if(!n)return!1;let r=ti(n);return!!r&&e7(e,r,t)})(e,t);function iq(){return"u">typeof navigator&&/Mac/.test(navigator.platform)}var iK=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let o=(function(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"===s&&(s=" ");for(let e=0;e<o.length-1;e+=1){let s=o[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else if(/^mod$/i.test(s))iN()||iq()?i=!0:n=!0;else throw Error(`Unrecognized modifier name: ${s}`)}return t&&(s=`Alt-${s}`),n&&(s=`Ctrl-${s}`),i&&(s=`Meta-${s}`),r&&(s=`Shift-${s}`),s})(e).split(/-(?!$)/),s=o.find(e=>!["Alt","Ctrl","Meta","Shift"].includes(e)),l=new KeyboardEvent("keydown",{key:"Space"
1===s?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),a=t.captureTransaction(()=>{n.someProp("handleKeyDown",e=>e(n,l))});return null==a||a.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0};function iG(e,t,n={}){let{from:r,to:i,empty:o}=e.selection,s=t?ip(t,e.schema):null,l=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);l.push({node:e,from:n,to:o})});let a=i-r,d=l.filter(e=>!s||s.name===e.node.type.name).filter(e=>ix(e.node.attrs,n,{strict:!1}));return o?!!d.length:d.reduce((e,t)=>e+t.to-t.from,0)>=a}var iY=(e,t={})=>({state:n,dispatch:r})=>{let i=ip(e,n.schema);return!!iG(n,i,t)&&((e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&eh(i);return null!=o&&(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)})(n,r)},iX=()=>({state:e,dispatch:t})=>td(e,t),iZ=e=>({state:t,dispatch:r})=>{var i;return(i=ip(e,t.schema),function(e,t){let{$from:r,$to:o}=e.selection,s=r.blockRange(o,e=>e.childCount>0&&e.firstChild.type==i);return!!s&&(!t||(r.node(s.depth-1).type==i?function(e,t,r,i){let o=e.tr,s=i.end,l=i.$to.end(i.depth);s<l&&(o.step(new ec(s-1,l,s,l,new a(n.from(r.create(null,i.parent.copy())),1,0),1,!0)),i=new v(o.doc.resolve(i.$from.pos),o.doc.resolve(l),i.depth));let d=eh(i);if(null==d)return!1;o.lift(i,d);let c=o.doc.resolve(o.mapping.map(s,-1)-1);return ev(o.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&o.join(c.pos),t(o.scrollIntoView()),!0}(e,t,i,s):function(e,t,r){let i=e.tr,o=r.parent;for(let e=r.end,t=r.endIndex-1,n=r.startIndex;t>n;t--)e-=o.child(t).nodeSize,i.delete(e-1,e+1);let s=i.doc.resolve(r.start),l=s.nodeAfter;if(i.mapping.map(r.end)!=r.start+s.nodeAfter.nodeSize)return!1;let d=0==r.startIndex,c=r.endIndex==o.childCount,u=s.node(-1),p=s.index(-1);if(!u.canReplace(p+ +!d,p+1,l.content.append(c?n.empty:n.from(o))))return!1;let h=s.pos,f=h+l.nodeSize;
1return i.step(new ec(h-!!d,f+ +!!c,h+1,f-1,new a((d?n.empty:n.from(o.copy(n.empty))).append(c?n.empty:n.from(o.copy(n.empty))),+!d,+!c),+!d)),t(i.scrollIntoView()),!0}(e,t,s)))})(t,r)},iQ=()=>({state:e,dispatch:t})=>to(e,t);function i0(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function i1(e,t){let n="string"==typeof t?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var i2=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,l=i0("string"==typeof e?e:e.name,r.schema);if(!l)return!1;"node"===l&&(o=ip(e,r.schema)),"mark"===l&&(s=iT(e,r.schema));let a=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{o&&o===e.type&&(a=!0,i&&n.setNodeMarkup(r,void 0,i1(e.attrs,t))),s&&e.marks.length&&e.marks.forEach(o=>{s===o.type&&(a=!0,i&&n.addMark(r,r+e.nodeSize,s.create(i1(o.attrs,t))))})})}),a},i3=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),i6=()=>({tr:e,dispatch:t})=>{if(t){let t=new eH(e.doc);e.setSelection(t)}return!0},i5=()=>({state:e,dispatch:t})=>e8(e,t),i9=()=>({state:e,dispatch:t})=>tr(e,t),i7=()=>({state:e,dispatch:t})=>((e,t)=>{let{$from:n,to:r}=e.selection,i,o=n.sharedDepth(r);return 0!=o&&(i=n.before(o),t&&t(e.tr.setSelection(eB.create(e.doc,i))),!0)})(e,t),i4=()=>({state:e,dispatch:t})=>th(e,t),i8=()=>({state:e,dispatch:t})=>tp(e,t);function oe(e,t,n={},r={}){return iz(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var ot=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:o,dispatch:s,commands:l})=>{let{doc:a}=o;if("full"!==r.preserveWhitespace){let l=oe(e,i.schema,r,{errorOnInvalidContent:null!=t?t:i.options.enableContentCheck});return s&&o.replaceWith(0,a.content.size,l).setMeta("preventUpdate",!n),!0}return s&&o.setMeta("preventUpdate",!n),l.insertContentAt({from:0,to:a.content.size},e,{parseOptions:r,errorOnInvalidContent:null!=t?t:i.options.enableContentCheck})};function on(e,t){let n=iT(t,e.schema),{from:r,to:i,empty:o}=e.selection,s=[];o?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{s.push(...e.marks)});let l=s.find(e=>e.type.name===n.name);return l?{...l.attrs}:{}}function or(e,t){let n=new e$(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function oi(e,t){for(let n=e.depth;n>0;n-=1){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function oo(e){return t=>oi(t.$from,e)}function ol(e,t,n){return void 0===e.config[t]&&e.parent?ol(e.parent,t,n):"function"==typeof e.config[t]?e.config[t].bind({...n,parent:e.parent?ol(e.parent,t,n):null}):e.config[t]}function oa(e){return e.map(e=>{let t={name:e.name,options:e.options,storage:e.storage},n=ol(e,"addExtensions",t);return n?[e,...oa(n())]:e}).flat(10)}function od(e,t){let n=q.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function oc(e){return"function"==typeof e}function ou(e,t,...n){return oc(e)?t?e.bind(t)(...n):e(...n):e}function op(e){let t=e.filter(e=>"extension"===e.type);return{baseExtensions:t,nodeExtensions:e.filter(e=>"node"===e.type),markExtensions:e.filter(e=>"mark"===e.type)}}function oh(e){let t=[],{nodeExtensions:n,markExtensions:r}=op(e),i=[...n,...r],o={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},s=n.filter(e=>"text"!==e.name).map(e=>e.name),l=r.map(e=>e.name),a=[...s,...l];return e.forEach(e=>{let n={name:e.name,options:e.options,storage:e.storage,extensions:i},r=ol(e,"addGlobalAttributes",n);r&&r().forEach(e=>{(Array.isArray(e.types)?e.types:"*"===e.types?a:"nodes"===e.types?s:"marks"===e.types?l:[]).forEac
1h(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...o,...r}})})})})}),i.forEach(e=>{let n={name:e.name,options:e.options,storage:e.storage},r=ol(e,"addAttributes",n);r&&Object.entries(r()).forEach(([n,r])=>{let i={...o,...r};"function"==typeof(null==i?void 0:i.default)&&(i.default=i.default()),(null==i?void 0:i.isRequired)&&(null==i?void 0:i.default)===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function of(e){let t=[],n=function(e){let t=[],n="",r=!1,i=!1,o=0,s=e.length;for(let l=0;l<s;l+=1){let s=e[l];if("'"===s&&!i){r=!r,n+=s;continue}if('"'===s&&!r){i=!i,n+=s;continue}if(!r&&!i){if("("===s){o+=1,n+=s;continue}if(")"===s&&o>0){o-=1,n+=s;continue}if(";"===s&&0===o){t.push(n),n="";continue}}n+=s}return n&&t.push(n),t}(e||""),r=n.length;for(let e=0;e<r;e+=1){let r=n[e],i=r.indexOf(":");if(-1===i)continue;let o=r.slice(0,i).trim(),s=r.slice(i+1).trim();o&&s&&t.push([o,s])}return t}function om(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if("class"===e){let r=t?String(t).split(" "):[],i=n[e]?n[e].split(" "):[],o=r.filter(e=>!i.includes(e));n[e]=[...i,...o].join(" ")}else if("style"===e){let r=new Map([...of(n[e]),...of(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join("; ")}else n[e]=t}),n},{})}function og(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>om(e,t),{})}function oy(e,t){return"style"in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;let i=t.reduce((e,t)=>{var r;let i=t.attribute.parseHTML?t.attribute.parseHTML(n):"string"!=typeof(r=n.getAttribute(t.name))?r:r.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(r):"true"===r||"false"!==r&&r;return null==i?e:{...e,[t.name]:i}},{});return{...r,...i}}}}function ob(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>!("attrs"===e&&function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t))}function ov(e){var t,n;let r={};return!(null==(t=null==e?void 0:e.attribute)?void 0:t.isRequired)&&"default"in((null==e?void 0:e.attribute)||{})&&(r.default=e.attribute.default),(null==(n=null==e?void 0:e.attribute)?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function ox(e){return e.sort((e,t)=>{let n=ol(e,"priority")||100,r=ol(t,"priority")||100;return n>r?-1:+(n<r)})}function ow(e){var t;let n=ox(oa(e)),r=Array.from(new Set((t=n.map(e=>e.name)).filter((e,n)=>t.indexOf(e)!==n)));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(e=>`'${e}'`).join(", ")}]. This can lead to issues.`),n}function ok(e,t,n){let{from:r,to:i}=t,{blockSeparator:o="\n\n",textSerializers:s={}}=n||{},l="";return e.nodesBetween(r,i,(e,n,a,d)=>{var c;e.isBlock&&n>r&&(l+=o);let u=null==s?void 0:s[e.type.name];if(u)return a&&(l+=u({node:e,pos:n,parent:a,index:d,range:t})),!1;e.isText&&(l+=null==(c=null==e?void 0:e.text)?void 0:c.slice(Math.max(r,n)-n,i-n))}),l}function oS(e,t){let n={from:0,to:e.content.size};return ok(e,n,t)}function oT(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function oC(e,t){let n=i0("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){let n=ip(t,e.schema),{from:r,to:i}=e.selection,o=[];e.doc.nodesBetween(r,i,e=>{o.push(e)});let s=o.reverse().find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}(e,t):"mark"===n?on(e,t):{}}function o_(e){let t,{mapping:n,steps:r}=e,i=[];return n.maps.forEach((e,t)=>{let o=[];if(e.ranges.length)e.forEach((e,t)=>{o.push({from:e,to:t})});else{let{from:e,to:n}=r[t];if(void 0===e||void 0===n)return;o.push({from:e,to:n})}o.forEach(({from:e,to:r})=>{let o=n.slice(t).map(e,-1),s=n.slice(t).map(r),l=n.invert().map(o,-1),a=n.invert().map(s);i.push({oldRange:{from:l,to:a},newRange:{from:o,to:s}})})}),1===(t=function(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)})}
1(i)).length?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function oM(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=iS(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{e&&(null==e?void 0:e.nodeSize)!==void 0&&r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}function oA(e,t){return t.nodes[e]||t.marks[e]||null}function oE(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return!!r&&r.attribute.keepOnSplit}))}function oO(e,t,n={}){let{empty:r,ranges:i}=e.selection,o=t?iT(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!o||o.name===e.type.name).find(e=>ix(e.attrs,n,{strict:!1}));let s=0,l=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(o&&e.inlineContent&&!e.type.allowsMarkType(o))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s+=a-n,l.push(...e.marks.map(e=>({mark:e,from:n,to:a})))})}),0===s)return!1;let a=l.filter(e=>!o||o.name===e.mark.type.name).filter(e=>ix(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),d=l.filter(e=>!o||e.mark.type!==o&&e.mark.type.excludes(o)).reduce((e,t)=>e+t.to-t.from,0);return(a>0?a+d:a)>=s}function oN(e,t){return Array.isArray(t)?t.some(t=>("string"==typeof t?t:t.name)===e.name):t}function oD(e,t){let{nodeExtensions:n}=op(t),r=n.find(t=>t.name===e);if(!r)return!1;let i={name:r.name,options:r.options,storage:r.storage},o=ou(ol(r,"group",i));return"string"==typeof o&&o.split(" ").includes("list")}function oI(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if("hardBreak"===e.type.name)return!0;if(e.isText)return!/\S/.test(null!=(r=e.text)?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(0===e.content.childCount)return!0;if(t){let r=!0;return e.content.forEach(e=>{!1!==r&&(oI(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}var o$=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function oR(e,t){let n=t.mapping.mapResult(e.position);return{position:new o$(n.pos),mapResult:n}}function oP(e){return new o$(e)}var oz=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:o}=n,{empty:s,ranges:l}=o,a=iT(e,r.schema);if(i)if(s){let e=on(r,a);n.addStoredMark(a.create({...e,...t}))}else l.forEach(e=>{let i=e.$from.pos,o=e.$to.pos;r.doc.nodesBetween(i,o,(e,r)=>{let s=Math.max(r,i),l=Math.min(r+e.nodeSize,o);e.marks.find(e=>e.type===a)?e.marks.forEach(e=>{a===e.type&&n.addMark(s,l,a.create({...e.attrs,...t}))}):n.addMark(s,l,a.create(t))})});return function(e,t,n){var r;let{selection:i}=t,o=null;
1if(iM(i)&&(o=i.$cursor),o){let t=null!=(r=e.storedMarks)?r:o.marks();return o.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:s}=i;return s.some(({$from:t,$to:r})=>{let i=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),o=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&o}return!i}),i})}(r,n,a)},oL=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),oF=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let o,s=ip(e,n.schema);return(n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),s.isTextblock)?i().command(({commands:e})=>!!tf(s,{...o,...t})(n)||e.clearNodes()).command(({state:e})=>tf(s,{...o,...t})(e,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},oj=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=iA(e,0,n.content.size),i=eB.create(n,r);t.setSelection(i)}return!0},oW=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o,s,{selection:l}=r;return"number"==typeof t?(o=t,s=t):t&&"from"in t&&"to"in t?(o=t.from,s=t.to):(o=l.from,s=l.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},oB=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}="number"==typeof e?{from:e,to:e}:e,o=ej.atStart(n).from,s=ej.atEnd(n).to,l=iA(r,o,s),a=iA(i,o,s),d=ej.create(n,l,a);t.setSelection(d)}return!0},oV=e=>({state:t,dispatch:r})=>{var i;return(i=ip(e,t.schema),function(e,t){let{$from:r,$to:o}=e.selection,s=r.blockRange(o,e=>e.childCount>0&&e.firstChild.type==i);if(!s)return!1;let l=s.startIndex;if(0==l)return!1;let d=s.parent,c=d.child(l-1);if(c.type!=i)return!1;if(t){let r=c.lastChild&&c.lastChild.type==d.type,o=n.from(r?i.create():null),l=new a(n.from(i.create(null,n.from(d.type.create(null,o)))),r?3:1,0),u=s.start,p=s.end;t(e.tr.step(new ec(u-(r?3:1),p,u,p,l,1,!0)).scrollIntoView())}return!0})(t,r)};function oH(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>null==t?void 0:t.includes(e.type.name));e.tr.ensureMarks(r)}}var oU=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:o,doc:s}=t,{$from:l,$to:a}=o,d=oE(i.extensionManager.attributes,l.node().type.name,l.node().attrs);if(o instanceof eB&&o.node.isBlock)return!!l.parentOffset&&!!eb(s,l.pos)&&(r&&(e&&oH(n,i.extensionManager.splittableMarks),t.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;let c=a.parentOffset===a.parent.content.size,u=0===l.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(l.node(-1).contentMatchAt(l.indexAfter(-1))),p=c&&u?[{type:u,attrs:d}]:void 0,h=eb(t.doc,t.mapping.map(l.pos),1,p);if(!p&&!h&&eb(t.doc,t.mapping.map(l.pos),1,u?[{type:u}]:void 0)&&(h=!0,p=u?[{type:u,attrs:d}]:void 0),r){if(h&&(o instanceof ej&&t.deleteSelection(),t.split(t.mapping.map(l.pos),1,p),u&&!c&&!l.parentOffset&&l.parent.type!==u)){let e=t.mapping.map(l.before()),n=t.doc.resolve(e);l.node(-1).canReplaceWith(n.index(),n.index()+1,u)&&t.setNodeMarkup(t.mapping.map(l.before()),u)}e&&oH(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return h},oJ=(e,t={})=>({tr:r,state:i,dispatch:o,editor:s})=>{var l;let d=ip(e,i.schema),{$from:c,$to:u}=i.selection,p=i.selection.node;if(p&&p.isBlock||c.depth<2||!c.sameParent(u))return!1;let h=c.node(-1);if(h.type!==d)return!1;let f=s.extensionManager.attributes;if(0===c.parent.content.size&&c.node(-1).childCount===c.indexAfter(-1)){if(2===c.depth||c.node(-3).type!==d||c.index(-2)!==c.node(-2).childCount-1)return!1;if(o){let e=n.empty,i=c.index(-1)?1:c.index(-2)?2:3;for(let t=c.depth-i;t>=c.depth-3;t-=1)e=n.from(c.node(t).copy(e));let o=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,s={...oE(f,c.node().type.name,c.node().attrs),...t},u=(null==(l=d.contentMatch.defaultType)?void 0:l.createAndFill(s))||void 0;e=e.append(n.from(d.createAndFill(null,u)||void 0));let p=c.before(c.depth-(i-1));r.replace(p,c.after(-o),new a(e,4-i,0));let h=-1;r.doc.nodesBetween(p,r.doc.content.size,(e,t)=>{if(h>-1)return!1;e.isTextblock&&0===e.content.size&&(h=t+1)}),h>-1&&r.setSelection(ej.near(r.doc.resolve(h))),r.scrollIntoView()}return!0}let m=u.pos===c.end()?h.contentMatchAt(0).defaultType:null,g={...oE(f,h.type.name,h.attrs),...t},y={...oE(f,c.node().type.name,c.node().attrs),...t};r.delete(c.pos,u.pos);let b=m?[{type:d,attrs:g},{type:m,attrs:y}]:[{type:d,attrs:g}];if(!eb(r.doc,c.pos,2))return!1;if(o){let{selection:e,storedMarks:t}=i,{splittableMarks:n}=s.extensionManager,l=t||e.$to.parentOffset&&e.$from.marks();if(r.split(c.pos,2,b).scrollIntoView(),!l||!o)return!0;let a=l.filter(e=>
1n.includes(e.type.name));r.ensureMarks(a)}return!0},oq=(e,t)=>{let n=oo(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===(null==i?void 0:i.type)&&ev(e.doc,n.pos))||(e.join(n.pos),!0)},oK=(e,t)=>{let n=oo(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===(null==i?void 0:i.type)&&ev(e.doc,r))||(e.join(r),!0)},oG=(e,t,n,r={})=>({editor:i,tr:o,state:s,dispatch:l,chain:a,commands:d,can:c})=>{let{extensions:u,splittableMarks:p}=i.extensionManager,h=ip(e,s.schema),f=ip(t,s.schema),{selection:m,storedMarks:g}=s,{$from:y,$to:b}=m,v=y.blockRange(b),x=g||m.$to.parentOffset&&m.$from.marks();if(!v)return!1;let w=oo(e=>oD(e.type.name,u))(m),k=0===m.from&&m.to===s.doc.content.size,S=s.doc.content.content,T=1===S.length?S[0]:null,C=k&&T&&oD(T.type.name,u)?{node:T,pos:0,depth:0}:null,_=null!=w?w:C,M=!!w&&v.depth>=1&&v.depth-w.depth<=1,A=!!C;if((M||A)&&_){if(_.node.type===h)return k&&A?a().command(({tr:e,dispatch:t})=>{let n=function(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=n.nodeSize-1;return ej.create(t,1,r)}(e);return!!n&&(e.setSelection(n),t&&t(e),!0)}).liftListItem(f).run():d.liftListItem(f);if(oD(_.node.type.name,u)&&h.validContent(_.node.content))return a().command(()=>(o.setNodeMarkup(_.pos,h),!0)).command(()=>oq(o,h)).command(()=>oK(o,h)).run()}return n&&x&&l?a().command(()=>{let e=c().wrapInList(h,r),t=x.filter(e=>p.includes(e.type.name));return o.ensureMarks(t),!!e||d.clearNodes()}).wrapInList(h,r).command(()=>oq(o,h)).command(()=>oK(o,h)).run():a().command(()=>!!c().wrapInList(h,r)||d.clearNodes()).wrapInList(h,r).command(()=>oq(o,h)).command(()=>oK(o,h)).run()},oY=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:o=!1}=n,s=iT(e,r.schema);return oO(r,s,t)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,t)},oX=(e,t,n={})=>({state:r,commands:i})=>{let o,s=ip(e,r.schema),l=ip(t,r.schema),a=iG(r,s,n);return(r.selection.$anchor.sameParent(r.selection.$head)&&(o=r.selection.$anchor.parent.attrs),a)?i.setNode(l,o):i.setNode(s,{...o,...n})},oZ=(e,t={})=>({state:n,commands:r})=>{let i=ip(e,n.schema);return iG(n,i,t)?r.lift(i):r.wrapIn(i,t)},oQ=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i,o=n[r];if(o.spec.isInputRules&&(i=o.getState(e))){if(t){let t=e.tr,n=i.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(i.text){let n=t.doc.resolve(i.from).marks();t.replaceWith(i.from,i.to,e.schema.text(i.text,n))}else t.delete(i.from,i.to)}return!0}}return!1},o0=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{empty:r,ranges:i}=n;
1return!!r||(t&&i.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0)},o1=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;let{extendEmptyMarkRange:s=!1}=t,{selection:l}=n,a=iT(e,r.schema),{$from:d,empty:c,ranges:u}=l;if(!i)return!0;if(c&&s){let{from:e,to:t}=l,r=null==(o=d.marks().find(e=>e.type===a))?void 0:o.attrs,i=iS(d,a,r);i&&(e=i.from,t=i.to),n.removeMark(e,t,a)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,a)});return n.removeStoredMark(a),!0},o2=e=>({tr:t,state:n,dispatch:r})=>{let i,o,{selection:s}=n;return"number"==typeof e?(i=e,o=e):e&&"from"in e&&"to"in e?(i=e.from,o=e.to):(i=s.from,o=s.to),r&&t.doc.nodesBetween(i,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},o3=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,l=i0("string"==typeof e?e:e.name,r.schema);if(!l)return!1;"node"===l&&(o=ip(e,r.schema)),"mark"===l&&(s=iT(e,r.schema));let a=!1;return n.selection.ranges.forEach(e=>{let l,d,c,u,p=e.$from.pos,h=e.$to.pos;n.selection.empty?r.doc.nodesBetween(p,h,(e,t)=>{o&&o===e.type&&(a=!0,c=Math.max(t,p),u=Math.min(t+e.nodeSize,h),l=t,d=e)}):r.doc.nodesBetween(p,h,(e,r)=>{r<p&&o&&o===e.type&&(a=!0,c=Math.max(r,p),u=Math.min(r+e.nodeSize,h),l=r,d=e),r>=p&&r<=h&&(o&&o===e.type&&(a=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),s&&e.marks.length&&e.marks.forEach(o=>{if(s===o.type&&(a=!0,i)){let i=Math.max(r,p),l=Math.min(r+e.nodeSize,h);n.addMark(i,l,s.create({...o.attrs,...t}))}}))}),d&&(void 0!==l&&i&&n.setNodeMarkup(l,void 0,{...d.attrs,...t}),s&&d.marks.length&&d.marks.forEach(e=>{s===e.type&&i&&n.addMark(c,u,s.create({...e.attrs,...t}))}))}),a},o6=(e,t={})=>({state:n,dispatch:r})=>(function(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=s&&ef(s,e,t);return!!l&&(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0)}})(ip(e,n.schema),t)(n,r),o5=(e,t={})=>({state:r,dispatch:i})=>(function(e,t=null){return function(r,i){let{$from:o,$to:s}=r.selection,l=o.blockRange(s);if(!l)return!1;let d=i?r.tr:null;return!!function(e,t,r,i=null){let o=!1,s=t,l=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(r)&&0==t.startIndex){if(0==t.$from.index(t.depth-1))return!1;let e=l.resolve(t.start-2);s=new v(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new v(t.$from,l.resolve(t.$to.end(t.depth)),t.depth)),o=!0}let d=ef(s,r,i,t);return!!d&&(e&&function(e,t,r,i,o){let s=n.empty;for(let e=r.length-1;e>=0;e--)s=n.from(r[e].type.create(r[e].attrs,s));e.step(new ec(t.start-2*!!i,t.end,t.start,t.end,new a(s,0,0),r.length,!0));let l=0;for(let e=0;e<r.length;e++)r[e].type==o&&(l=e+1);let d=r.length-l,c=t.start+r.length-2*!!i,u=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&eb(e.doc,c,d)&&(e.split(c,d),c+=2*d),c+=u.child(n).nodeSize}(e,t,d,o,r),!0)}(d,l,e,t)&&(i&&i(d.scrollIntoView()),!0)}})(ip(e,r.schema),t)(r,i),o9=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},o7=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=null==(t=e.undoable)||t}};function o4(e){var t;let{editor:n,from:r,to:i,text:o,rules:s,plugin:l}=e,{view:a}=n;if(a.composing)return!1;let d=a.state.doc.resolve(r);if(d.parent.type.spec.code||(null==(t=d.nodeBefore||d.nodeAfter)?void 0:t.marks.find(e=>e.type.spec.code)))return!1;let c=!1,u=((e,t=500)=>{let n="",r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,o)=>{var s,l;let a=(null==(l=(s=e.type.spec).toText)?void 0:l.call(s,{node:e,pos:t,parent:i,index:o}))||e.textContent||"%leaf%";n+=e.isAtom&&!e.isText?a:a.slice(0,Math.max(0,r-t))}),n})(d)+o;return s.forEach(e=>{if(c)return;let t=((e,t)=>{if(iv(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];
1return 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})(u,e.find);if(!t)return;let s=a.state.tr,d=it({state:a.state,transaction:s}),p={from:r-(t[0].length-o.length),to:i},{commands:h,chain:f,can:m}=new ir({editor:n,state:d});null!==e.handler({state:d,range:p,match:t,commands:h,chain:f,can:m})&&s.steps.length&&(e.undoable&&s.setMeta(l,{transform:s,from:r,to:i,text:o}),a.dispatch(s),c=!0)}),c}function o8(e){return"Object"===Object.prototype.toString.call(e).slice(8,-1)&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}var se=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...ou(ol(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...ou(ol(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>(function e(t,n){let r={...t};return o8(t)&&o8(n)&&Object.keys(n).forEach(i=>{o8(n[i])&&o8(t[i])?r[i]=e(t[i],n[i]):r[i]=n[i]}),r})(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},st=class e extends se{constructor(){super(...arguments),this.type="mark"}static create(t={}){return new e("function"==typeof t?t():t)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>(null==e?void 0:e.type.name)===t.name))return!1;let o=i.find(e=>(null==e?void 0:e.type.name)===t.name);return o&&n.removeStoredMark(o),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}},sn=class{constructor(e){this.find=e.find,this.handler=e.handler}},sr=null,si=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=ow(e),this.schema=function(e,t){var n;let r=oh(e),{nodeExtensions:i,markExtensions:o}=op(e),s=null==(n=i.find(e=>ol(e,"topNode")))?void 0:n.name;return new P({topNode:s,nodes:Object.fromEntries(i.map(n=>{let i=r.filter(e=>e.type===n.name),o={name:n.name,options:n.options,storage:n.storage,editor:t},s=ob({...e.reduce((e,t)=>{let r=ol(t,"extendNodeSchema",o);return{...e,...r?r(n):{}}},{}),content:ou(ol(n,"content",o)),marks:ou(ol(n,"marks",o)),group:ou(ol(n,"group",o)),inline:ou(ol(n,"inline",o)),atom:ou(ol(n,"atom",o)),selectable:ou(ol(n,"selectable",o)),draggable:ou(ol(n,"draggable",o)),code:ou(ol(n,"code",o)),whitespace:ou(ol(n,"whitespace",o)),linebreakReplacement:ou(ol(n,"linebreakReplacement",o)),defining:ou(ol(n,"defining",o)),isolating:ou(ol(n,"isolating",o)),attrs:Object.fromEntries(i.map(ov))}),l=ou(ol(n,"parseHTML",o));l&&(s.parseDOM=l.map(e=>oy(e,i)));let a=ol(n,"renderHTML",o);a&&(s.toDOM=e=>a({node:e,HTMLAttributes:og(e,i)}));let d=ol(n,"renderText",o);return d&&(s.toText=d),[n.name,s]})),marks:Object.fromEntries(o.map(n=>{let i=r.filter(e=>e.type===n.name),o={name:n.name,options:n.options,storage:n.storage,editor:t},s=ob({...e.reduce((e,t)=>{let r=ol(t,"extendMarkSchema",o);return{...e,...r?r(n):{}}},{}),inclusive:ou(ol(n,"inclusive",o)),excludes:ou(ol(n,"excludes",o)),group:ou(ol(n,"group",o)),spanning:ou(ol(n,"spanning",o)),code:ou(ol(n,"code",o)),attrs:Object.fromEntries(i.map(ov))}),l=ou(ol(n,"parseHTML",o));l&&(s.parseDOM=l.map(e=>oy(e,i)));let a=ol(n,"renderHTML",o);return a&&(s.toDOM=e=>a({mark:e,HTMLAttributes:og(e,i)})),[n.name,s]}))})}(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:oA(t.name,this.schema)},r=ol(t,"addCommands",n);return r?{...e,...r()}:e},{})}get plugins(){let{editor:e}=this;return ox([...this.extensions].reverse()).flatMap(t=>{let r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:oA(t.name,this.schema)},i=[],o=ol(t,"addKeyboardShortcuts",r),s={};if("mark"===t.type&&ol(t,"exitable",r)&&(s.ArrowRight=()=>st.handleExit({editor:e,mark:t})),o){let t=Object.fromEntries(Object.entries(o()).map(([t,n])=>[t,()=>n({editor:e})]));s={...s,...t}}let l=r7(s);i.push(l);let a=ol(t,"addInputRules",r);
1if(oN(t,e.options.enableInputRules)&&a){let t=a();if(t&&t.length){let r=function(e){let{editor:t,rules:r}=e,i=new e0({state:{init:()=>null,apply(e,o,s){let l=e.getMeta(i);if(l)return l;let a=e.getMeta("applyInputRules");return a&&setTimeout(()=>{let{text:e}=a;"string"==typeof e||(e=od(n.from(e),s.schema));let{from:o}=a,l=o+e.length;o4({editor:t,from:o,to:l,text:e,rules:r,plugin:i})}),e.selectionSet||e.docChanged?null:o}},props:{handleTextInput:(e,n,o,s)=>o4({editor:t,from:n,to:o,text:s,rules:r,plugin:i}),handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:n}=e.state.selection;n&&o4({editor:t,from:n.pos,to:n.pos,text:"",rules:r,plugin:i})}),!1)},handleKeyDown(e,n){if("Enter"!==n.key)return!1;let{$cursor:o}=e.state.selection;return!!o&&o4({editor:t,from:o.pos,to:o.pos,text:"\n",rules:r,plugin:i})}},isInputRules:!0});return i}({editor:e,rules:t}),o=Array.isArray(r)?r:[r];i.push(...o)}}let d=ol(t,"addPasteRules",r);if(oN(t,e.options.enablePasteRules)&&d){let t=d();if(t&&t.length){let r=function(e){let t,{editor:r,rules:i}=e,o=null,s=!1,l=!1,a="u">typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{t="u">typeof DragEvent?new DragEvent("drop"):null}catch{t=null}let d=({state:e,from:n,to:i,rule:o,pasteEvt:s})=>{let l=e.tr;if(function(e){let{editor:t,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=e,{commands:a,chain:d,can:c}=new ir({editor:t,state:n}),u=[];return n.doc.nodesBetween(r,i,(e,t)=>{var p,h,f,m,g;if((null==(h=null==(p=e.type)?void 0:p.spec)?void 0:h.code)||!(e.isText||e.isTextblock||e.isInline))return;let y=null!=(g=null!=(m=null==(f=e.content)?void 0:f.size)?m:e.nodeSize)?g:0,b=Math.max(r,t),v=Math.min(i,t+y);b>=v||((e,t,n)=>{if(iv(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(t.replaceWith)),n}):[]})(e.isText?e.text||"":e.textBetween(b-t,v-t,void 0,""),o.find,s).forEach(e=>{if(void 0===e.index)return;let t=b+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},p=o.handler({state:n,range:i,match:e,commands:a,chain:d,can:c,pasteEvent:s,dropEvent:l});u.push(p)})}),u.every(e=>null!==e)}({editor:r,state:it({state:e,transaction:l}),from:Math.max(n-1,0),to:i.b-1,rule:o,pasteEvent:s,dropEvent:t})&&l.steps.length){try{t="u">typeof DragEvent?new DragEvent("drop"):null}catch{t=null}return a="u">typeof ClipboardEvent?new ClipboardEvent("paste"):null,l}};return i.map(e=>new e0({view(e){let t=t=>{var n;(o=(null==(n=e.dom.parentElement)?void 0:n.contains(t.target))?e.dom.parentElement:null)&&(sr=r)},n=()=>{sr&&(sr=null)};return window.addEventListener("dragstart",t),window.addEventListener("dragend",n),{destroy(){window.removeEventListener("dragstart",t),window.removeEventListener("dragend",n)}}},props:{handleDOMEvents:{drop:(e,n)=>{if(l=o===e.dom.parentElement,t=n,!l){let e=sr;(null==e?void 0:e.isEditable)&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{var n;let r=null==(n=t.clipboardData)?void 0:n.getData("text/html");return a=t,s=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(t,r,i)=>{let o=t[0],c="paste"===o.getMeta("uiEvent")&&!s,u="drop"===o.getMeta("uiEvent")&&!l,p=o.getMeta("applyPasteRules"),h=!!p;if(!c&&!u&&!h)return;if(h){var f,m;let t,{text:r}=p;"string"==typeof r||(r=od(n.from(r),i.schema));let{from:o}=p,s=o+r.length;return d({rule:e,state:i,from:o,to:{b:s},pasteEvt:(f=r,null==(m=(t=new ClipboardEvent("paste",{clipboardData:new DataTransfer})).clipboardData)||m.setData("text/html",f),t)})}let g=r.doc.content.findDiffStart(i.doc.content),y=r.doc.content.findDiffEnd(i.doc.content);if("number"==typeof g&&y&&g!==y.b)return d({rule:e,state:i,from:g,to:y,pasteEvt:a})}}))}({editor:e,rules:t});i.push(...r)}}let c=ol(t,"addProseMirrorPlugins",r);if(c){let e=c();i.push(...e)}return i})}get attributes(){return oh(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=op(this.extensions);return Object.fromEntries(t.filter(e=>!!ol(e,"addNodeView")).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:ip(t.name,this.schema)},i=ol(t,"addNodeView",r);
1if(!i)return[];let o=i();return o?[t.name,(r,i,s,l,a)=>{let d=og(r,n);return o({node:r,view:i,getPos:s,decorations:l,innerDecorations:a,editor:e,extension:t,HTMLAttributes:d})}]:[]}))}dispatchTransaction(e){let{editor:t}=this;return ox([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:oA(n.name,this.schema)},i=ol(n,"dispatchTransaction",r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return ox([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:oA(n.name,this.schema)},i=ol(n,"transformPastedHTML",r);return i?(t,n)=>{let o=e(t,n);return i.call(r,o)}:e},e||(e=>e))}get markViews(){let{editor:e}=this,{markExtensions:t}=op(this.extensions);return Object.fromEntries(t.filter(e=>!!ol(e,"addMarkView")).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:iT(t.name,this.schema)},i=ol(t,"addMarkView",r);return i?[t.name,(r,o,s)=>{let l=og(r,n);return i()({mark:r,view:o,inline:s,editor:e,extension:t,HTMLAttributes:l,updateAttributes:t=>{sO(r,e,t)}})}]:[]}))}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{var t;let n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:oA(e.name,this.schema)};"mark"===e.type&&(null==(t=ou(ol(e,"keepOnSplit",n)))||t)&&this.splittableMarks.push(e.name);let r=ol(e,"onBeforeCreate",n),i=ol(e,"onCreate",n),o=ol(e,"onUpdate",n),s=ol(e,"onSelectionUpdate",n),l=ol(e,"onTransaction",n),a=ol(e,"onFocus",n),d=ol(e,"onBlur",n),c=ol(e,"onDestroy",n);r&&this.editor.on("beforeCreate",r),i&&this.editor.on("create",i),o&&this.editor.on("update",o),s&&this.editor.on("selectionUpdate",s),l&&this.editor.on("transaction",l),a&&this.editor.on("focus",a),d&&this.editor.on("blur",d),c&&this.editor.on("destroy",c)})}};si.resolve=ow,si.sort=ox,si.flatten=oa,ie({},{ClipboardTextSerializer:()=>ss,Commands:()=>sl,Delete:()=>sa,Drop:()=>sd,Editable:()=>sc,FocusEvents:()=>sp,Keymap:()=>sh,Paste:()=>sf,Tabindex:()=>sm,TextDirection:()=>sg,focusEventsPluginKey:()=>su});var so=class e extends se{constructor(){super(...arguments),this.type="extension"}static create(t={}){return new e("function"==typeof t?t():t)}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}},ss=so.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new e0({key:new e3("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,s=Math.min(...o.map(e=>e.$from.pos)),l=Math.max(...o.map(e=>e.$to.pos)),a=oT(n);return ok(r,{from:s,to:l},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}}),sl=so.create({name:"commands",addCommands:()=>({...ii})}),sa=so.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,i;let o=()=>{var n,r,i,o;if(null!=(o=null==(i=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.filterTransaction)?void 0:i.call(r,e))?o:e.getMeta("y-sync$"))return;let s=or(e.before,[e,...t]);o_(s).forEach(t=>{s.mapping.mapResult(t.oldRange.from).deletedAfter&&s.mapping.mapResult(t.oldRange.to).deletedBefore&&s.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,r)=>{let i=r+n.nodeSize-2,o=t.oldRange.from<=r&&i<=t.oldRange.to;this.editor.emit("delete",{type:"node",node:n,from:r,to:i,newFrom:s.mapping.map(r),newTo:s.mapping.map(i),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:s})})});let l=s.mapping;s.steps.forEach((t,n)=>{var r,i;if(t instanceof es){let o=l.slice(n).map(t.from,-1),a=l.slice(n).map(t.to),d=l.invert().map(o,-1),c=l.invert().map(a),u=o>0&&(null==(r=s.doc.nodeAt(o-1))?void 0:r.marks.some(e=>e.eq(t.mark))),p=null==(i=s.doc.nodeAt(a))?void 0:i.marks.some(e=>e.eq(t.mark));this.editor.emit("delete",{type:"mark",mark:t.mark,from:t.from,to:t.to,deletedRange:{from:d,to:c},newRange:{from:o,to:a},partial:!!(p||u),editor:this.editor,transaction:e,combinedTransform:s})}})};null==(i=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.async)||i?setTimeout(o,0):o()}}),sd=so.create({name:"drop",addProseMirrorPlugins(){return[new e0({key:new e3("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),sc=so.create({name:"editable",addProseMirrorPlugins(){return[new e0({key:new e3("editable"),props:{editable:()=>this.editor.options.editable}})]}}),su=new e3("focusEvents"),sp=so.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:e}=this;
1return[new e0({key:su,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),sh=so.create({name:"keymap",addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:o}=n,{pos:s,parent:l}=o,a=o.parent.isTextblock&&s>0?t.doc.resolve(s-1):o,d=a.parent.type.spec.isolating,c=o.pos-o.parentOffset,u=d&&1===a.parent.childCount?c===o.pos:eP.atStart(r).from===s;return!!i&&!!l.type.isTextblock&&!l.textContent.length&&!!u&&(!u||"paragraph"!==o.parent.type.name)&&e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.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()},r={...n},i={...n,"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 iN()||iq()?i:r},addProseMirrorPlugins(){return[new e0({key:new e3("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta("composition")))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta("preventClearDocument"));if(!r||i)return;let{empty:o,from:s,to:l}=t.selection,a=eP.atStart(t.doc).from,d=eP.atEnd(t.doc).to;if(o||s!==a||l!==d||!oI(n.doc))return;let c=n.tr,u=it({state:n,transaction:c}),{commands:p}=new ir({editor:this.editor,state:u});if(p.clearNodes(),c.steps.length)return c}})]}}),sf=so.create({name:"paste",addProseMirrorPlugins(){return[new e0({key:new e3("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),sm=so.create({name:"tabindex",addProseMirrorPlugins(){return[new e0({key:new e3("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),sg=so.create({name:"textDirection",addOptions:()=>({direction:void 0}),addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=op(this.extensions);return[{types:e.filter(e=>"text"!==e.name).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute("dir");return t&&("ltr"===t||"rtl"===t||"auto"===t)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new e0({key:new e3("textDirection"),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),sy=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return null!=(e=this.actualDepth)?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(0===this.content.size)return void console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+ +!this.node.isText}get parent(){if(0===this.depth)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1);return new e(this.resolvedPos.doc.resolve(t),this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=n.isInline,l=this.pos+r+ +!o;if(l<0||l>this.resolvedPos.doc.nodeSize-2)return;let a=this.resolvedPos.doc.resolve(l);if(!i&&!s&&a.depth<=this.depth)return;let d=new e(a,this.editor,i,i||s?n:null);i&&(d.actualDepth=this.depth+1),t.push(d)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;
1){if(r.node.type.name===e)if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==t[i])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||0===this.children.length)return r;let i=Object.keys(t);return this.children.forEach(o=>{n&&r.length>0||(o.node.type.name===e&&i.every(e=>t[e]===o.node.attrs[e])&&r.push(o),n&&r.length>0||(r=r.concat(o.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},sb=`.ProseMirror { 2 position: relative; 3} 4 5.ProseMirror { 6 word-wrap: break-word; 7 white-space: pre-wrap; 8 white-space: break-spaces; 9 -webkit-font-variant-ligatures: none; 10 font-variant-ligatures: none; 11 font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */ 12} 13 14.ProseMirror [contenteditable="false"] { 15 white-space: normal; 16} 17 18.ProseMirror [contenteditable="false"] [contenteditable="true"] { 19 white-space: pre-wrap; 20} 21 22.ProseMirror pre { 23 white-space: pre-wrap; 24} 25 26img.ProseMirror-separator { 27 display: inline !important; 28 border: none !important; 29 margin: 0 !important; 30 width: 0 !important; 31 height: 0 !important; 32} 33 34.ProseMirror-gapcursor { 35 display: none; 36 pointer-events: none; 37 position: absolute; 38 margin: 0; 39} 40 41.ProseMirror-gapcursor:after { 42 content: ""; 43 display: block; 44 position: absolute; 45 top: -2px; 46 width: 20px; 47 border-top: 1px solid black; 48 animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite; 49} 50 51@keyframes ProseMirror-cursor-blink { 52 to { 53 visibility: hidden; 54 } 55} 56 57.ProseMirror-hideselection *::selection { 58 background: transparent; 59} 60 61.ProseMirror-hideselection *::-moz-selection { 62 background: transparent; 63} 64 65.ProseMirror-hideselection * { 66 caret-color: transparent; 67} 68 69.ProseMirror-focused .ProseMirror-gapcursor { 70 display: block; 71}`,sv=class extends o9{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:"u">typeof document?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:oR,createMappablePosition:oP},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on("paste",({event:e,slice:t})=>this.options.onPaste(e,t)),this.on("delete",this.options.onDelete);const t=this.createDoc(),n=iE(t,this.options.autofocus);this.editorState=eQ.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if("u"<typeof document)throw Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");
71this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(!1!==this.options.autofocus&&null!==this.options.autofocus&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){let e=this.editorView.dom;(null==e?void 0:e.editor)&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{"function"==typeof this.css.remove?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&"u">typeof document&&(this.css=function(e,t){let n=document.querySelector("style[data-tiptap-style]");if(null!==n)return n;let r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.setAttribute("data-tiptap-style",""),r.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(r),r}(sb,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if("state"===t)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=oc(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t="string"==typeof e?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;let n=[...this.options.enableCoreExtensions?[sc,ss.configure({blockSeparator:null==(t=null==(e=this.options.coreExtensionOptions)?void 0:e.clipboardTextSerializer)?void 0:t.blockSeparator}),sl,sp,sh,sm,sd,sf,sa,sg.configure({direction:this.options.textDirection})].filter(e=>"object"!=typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[e.name]):[],...this.options.extensions].filter(e=>["extension","node","mark"].includes(null==e?void 0:e.type));this.extensionManager=new si(n,this)}createCommandManager(){this.commandManager=new ir({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=oe(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&"object"==typeof this.storage.collaboration&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>"collaboration"!==e.name),this.createExtensionManager()}}),e=oe(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,o=t.transformPastedHTML,s=this.extensionManager.transformPastedHTML(o);this.editorView=new rJ(e,{...t,attributes:{role:"textbox",...null==t?void 0:t.attributes},dispatchTransaction:i,transformPastedHTML:s,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let l=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(l),this.prependClass(),this.injectCSS(),this.view.dom.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}
71e.steps.forEach(e=>{var t;return null==(t=this.capturedTransaction)?void 0:t.step(e)});return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),o=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});let s=n.findLast(e=>e.getMeta("focus")||e.getMeta("blur")),l=null==s?void 0:s.getMeta("focus"),a=null==s?void 0:s.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:s}),a&&this.emit("blur",{editor:this,event:a.event,transaction:s}),e.getMeta("preventUpdate")||!n.some(e=>e.docChanged)||o.doc.eq(t.doc)||this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return oC(this.state,e)}isActive(e,t){let n="string"==typeof e?e:null,r="string"==typeof e?t:e;return function(e,t,n={}){if(!t)return iG(e,null,n)||oO(e,null,n);let r=i0(t,e.schema);return"node"===r?iG(e,t,n):"mark"===r&&oO(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return od(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t="\n\n",textSerializers:n={}}=e||{};return oS(this.state.doc,{blockSeparator:t,textSerializers:{...oT(this.schema),...n}})}get isEmpty(){return oI(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var e,t;return null==(t=null==(e=this.editorView)?void 0:e.isDestroyed)||t}$node(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelectorAll(e,t))||null}$pos(e){return new sy(this.state.doc.resolve(e),this)}get $doc(){return this.$pos(0)}},sx=class{constructor(e){var t,n,r,i,o,s;this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.clientX-this.startX,n=e.clientY-this.startY;this.handleResize(t,n)},this.handleTouchMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.touches[0];if(!t)return;let n=t.clientX-this.startX,r=t.clientY-this.startY;this.handleResize(n,r)},this.handleMouseUp=()=>{if(!this.isResizing)return;let e=this.element.offsetWidth,t=this.element.offsetHeight;this.onCommit(e,t),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=e=>{"Shift"===e.key&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=e=>{"Shift"===e.key&&(this.isShiftKeyPressed=!1)},this.node=e.node,this.editor=e.editor,this.element=e.element,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,(null==(t=e.options)?void 0:t.min)&&(this.minSize={...this.minSize,...e.options.min}),(null==(n=e.options)?void 0:n.max)&&(this.maxSize=e.options.max),(null==(r=null==e?void 0:e.options)?void 0:r.directions)&&(this.directions=e.options.directions),(null==(i=e.options)?void 0:i.preserveAspectRatio)&&(this.preserveAspectRatio=e.options.preserveAspectRatio),(null==(o=e.options)?void 0:o.className)&&(this.classNames={container:e.options.className.container||"",wrapper:e.options.className.wrapper||"",handle:e.options.className.handle||"",resizing:e.options.className.resizing||""}),(null==(s=e.options)?void 0:s.createCustomHandle)&&(this.createCustomHandle=e.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){var e;return null!=(e=this.contentElement)?e:null}handleEditorUpdate(){let e=this.editor.isEditable;e!==this.lastEditableState&&(this.lastEditableState=e,e?e&&0===this.handleMap.size&&this.attachHandles():this.removeHandles())}update(e,t,n){return e.type===this.node.type&&(this.node=e,!this.onUpdate||this.onUpdate(e,t,n))}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){let e=document.createElement("div");return e.dataset.resizeContainer="",e.dataset.node=this.node.type.n
71ame,e.style.display=this.node.type.isInline?"inline-flex":"flex",this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}createWrapper(){let e=document.createElement("div");return e.style.position="relative",e.style.display="block",e.dataset.resizeWrapper="",this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}createHandle(e){let t=document.createElement("div");return t.dataset.resizeHandle=e,t.style.position="absolute",this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(e,t){let n=t.includes("top"),r=t.includes("bottom"),i=t.includes("left"),o=t.includes("right");n&&(e.style.top="0"),r&&(e.style.bottom="0"),i&&(e.style.left="0"),o&&(e.style.right="0"),("top"===t||"bottom"===t)&&(e.style.left="0",e.style.right="0"),("left"===t||"right"===t)&&(e.style.top="0",e.style.bottom="0")}attachHandles(){this.directions.forEach(e=>{let t;(t=this.createCustomHandle?this.createCustomHandle(e):this.createHandle(e))instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${e}") did not return an HTMLElement. Falling back to default handle.`),t=this.createHandle(e)),this.createCustomHandle||this.positionHandle(t,e),t.addEventListener("mousedown",t=>this.handleResizeStart(t,e)),t.addEventListener("touchstart",t=>this.handleResizeStart(t,e)),this.handleMap.set(e,t),this.wrapper.appendChild(t)})}removeHandles(){this.handleMap.forEach(e=>e.remove()),this.handleMap.clear()}applyInitialSize(){let e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width=`${e}px`,this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,"touches"in e?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(e,t){if(!this.activeHandle)return;let n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:i}=this.calculateNewDimensions(this.activeHandle,e,t),o=this.applyConstraints(r,i,n);this.element.style.width=`${o.width}px`,this.element.style.height=`${o.height}px`,this.onResize&&this.onResize(o.width,o.height)}calculateNewDimensions(e,t,n){let r=this.startWidth,i=this.startHeight,o=e.includes("right"),s=e.includes("left"),l=e.includes("bottom"),a=e.includes("top");return(o?r=this.startWidth+t:s&&(r=this.startWidth-t),l?i=this.startHeight+n:a&&(i=this.startHeight-n),("right"===e||"left"===e)&&(r=this.startWidth+(o?t:-t)),("top"===e||"bottom"===e)&&(i=this.startHeight+(l?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed)?this.applyAspectRatio(r,i,e):{width:r,height:i}}applyConstraints(e,t,n){var r,i,o,s;if(!n){let n=Math.max(this.minSize.width,e),o=Math.max(this.minSize.height,t);return(null==(r=this.maxSize)?void 0:r.width)&&(n=Math.min(this.maxSize.width,n)),(null==(i=this.maxSize)?void 0:i.height)&&(o=Math.min(this.maxSize.height,o)),{width:n,height:o}}let l=e,a=t;return l<this.minSize.width&&(a=(l=this.minSize.width)/this.aspectRatio),a<this.minSize.height&&(l=(a=this.minSize.height)*this.aspectRatio),(null==(o=this.maxSize)?void 0:o.width)&&l>this.maxSize.width&&(a=(l=this.maxSize.width)/this.aspectRatio),(null==(s=this.maxSize)?void 0:s.height)&&a>this.maxSize.height&&(l=(a=this.maxSize.height)*this.aspectRatio),{width:l,height:a}}applyAspectRatio(e,t,n){return"left"===n||"right"===n?{width:e,height:e/this.aspectRatio}:"top"===n||"bottom"===n?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}};function sw(e){if(!(null==e?void 0:e.trim()))return{};let t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),`__QUOTED_${n.length-1}
71__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);i&&(t.class=i.map(e=>e.trim().slice(1)).join(" "));let o=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);o&&(t.id=o[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,e,r])=>{var i;let o=n[parseInt((null==(i=r.match(/__QUOTED_(\d+)__/))?void 0:i[1])||"0",10)];o&&(t[e]=o.slice(1,-1))});let s=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return s&&s.split(/\s+/).filter(Boolean).forEach(e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function sk(e){if(!e||0===Object.keys(e).length)return"";let t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{"class"!==e&&"id"!==e&&(!0===n?t.push(e):!1!==n&&null!=n&&t.push(`${e}="${String(n)}"`))}),t.join(" ")}function sS(e){let{nodeName:t,name:n,parseAttributes:r=sw,serializeAttributes:i=sk,defaultAttributes:o={},requiredAttributes:s=[],allowedAttributes:l}=e,a=n||t;return{parseMarkdown:(e,n)=>{let r={...o,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:"block",start(e){var t;let n=RegExp(`^:::${a}(?:\\s|$)`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,i){let o=RegExp(`^:::${a}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),l=e.match(o);if(!l)return;let d=r(l[1]||"");if(!s.find(e=>!(e in d)))return{type:t,raw:l[0],attributes:d}}},renderMarkdown:e=>{let t=i((e=>{if(!l)return e;let t={};return l.forEach(n=>{n in e&&(t[n]=e[n])}),t})(e.attrs||{})),n=t?` {${t}}`:"";return`:::${a}${n} :::`}}}function sT(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=sw,serializeAttributes:o=sk,defaultAttributes:s={},content:l="block",allowedAttributes:a}=e,d=n||t;return{parseMarkdown:(e,n)=>{let i;if(r){let t=r(e);i="string"==typeof t?[{type:"text",text:t}]:t}else i="block"===l?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);let o={...s,...e.attributes};return n.createNode(t,o,i)},markdownTokenizer:{name:t,level:"block",start(e){var t;let n=RegExp(`^:::${d}`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,r){var o;let s=RegExp(`^:::${d}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),a=e.match(s);if(!a)return;let[c,u=""]=a,p=i(u),h=1,f=c.length,m="",g=/^:::([\w-]*)(\s.*)?/gm,y=e.slice(f);for(g.lastIndex=0;;){let n=g.exec(y);if(null===n)break;let i=n.index,s=n[1];if(null==(o=n[2])||!o.endsWith(":::")){if(s)h+=1;else if(0==(h-=1)){let o=y.slice(0,i);m=o.trim();let s=e.slice(0,f+i+n[0].length),a=[];if(m)if("block"===l)for((a=r.blockTokens(o)).forEach(e=>{e.text&&(!e.tokens||0===e.tokens.length)&&(e.tokens=r.inlineTokens(e.text))});a.length>0;){let e=a[a.length-1];if("paragraph"!==e.type||e.text&&""!==e.text.trim())break;a.pop()}else a=r.inlineTokens(m);return{type:t,raw:s,attributes:p,content:m,tokens:a}}}}}},renderMarkdown:(e,t)=>{let n=o((e=>{if(!a)return e;let t={};return a.forEach(n=>{n in e&&(t[n]=e[n])}),t})(e.attrs||{})),r=n?` {${n}}`:"",i=t.renderChildren(e.content||[],"\n\n");return`:::${d}${r} 72 73${i} 74 75:::`}}}function sC(e){if(!e.trim())return{};let t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;null!==r;){let[,i,o,s]=r;t[i]=o||s,r=n.exec(e)}return t}function s_(e){return Object.entries(e).filter(([,e])=>null!=e).map(([e,t])=>`${e}="${t}"`).join(" ")}function sM(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=sC,serializeAttributes:o=s_,defaultAttributes:s={},selfClosing:l=!1,allowedAttributes:a}=e,d=n||t,c=d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(e,n)=>{let i={...s,...e.attributes};if(l)return n.createNode(t,i);let o=r?r(e):e.content||"";return o?n.createNode(t,i,[n.createTextNode(o)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:"inline",start(e){let t=l?RegExp(`\\[${c}\\s*[^\\]]*\\]`):RegExp(`\\[${c}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${c}\\]`),n=e.match(t),r=null==n?void 0:n.index;return void 0!==r?r:-1},tokenize(e,n,r){let o=l?RegExp(`^\\[${c}\\s*([^\\]]*)\\]`):RegExp(`^\\[${c}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${c}\\]`),s=e.match(o);if(!s)return;let a="",d="";if(l){let[,e]=s;d=e}else{let[,e,t]=s;d=e,a=t||""}let u=i(d.trim());return{type:t,raw:s[0],content:a.trim(),attributes:u}}},renderMarkdown:e=>{let t="";r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>"text"===e.type).map(e=>e.text).join(""));let n=o((e=>{if(!a)return e;let t={};return a.forEach(n=>{let r="string"==typeof n?n:n.name,i="string"==typeof n?void 0:n.skipIfDefault;if(r in e){let n=e[r];if(void 0!==i&&n===i)return;t[r]=n}}),t})(e.attrs||{})),i=n?` ${n}`:"";return l?`[${d}${i}]`:`[${d}${i}]${t}[/${d}]`}}}function sA(e,t,n){var r,i,o,s;let l=e.split("\n"),a=[],d="",c=0,u=t.baseIndentSize||2;for(;c<l.length;
75){let e,p=l[c],h=p.match(t.itemPattern);if(!h)if(a.length>0)break;else{if(""!==p.trim())return;c+=1,d=`${d}${p} 76`;continue}let f=t.extractItemData(h),{indentLevel:m,mainContent:g}=f;d=`${d}${p} 77`;let y=[g];for(c+=1;c<l.length;){let e=l[c];if(""===e.trim()){let t=l.slice(c+1).findIndex(e=>""!==e.trim());if(-1===t)break;if(((null==(i=null==(r=l[c+1+t].match(/^(\s*)/))?void 0:r[1])?void 0:i.length)||0)>m){y.push(e),d=`${d}${e} 78`,c+=1;continue}break}if(((null==(s=null==(o=e.match(/^(\s*)/))?void 0:o[1])?void 0:s.length)||0)>m)y.push(e),d=`${d}${e} 79`,c+=1;else break}let b=y.slice(1);if(b.length>0){let r=b.map(e=>e.slice(m+u)).join("\n");r.trim()&&(e=t.customNestedParser?t.customNestedParser(r):n.blockTokens(r))}let v=t.createToken(f,e);a.push(v)}if(0!==a.length)return{items:a,raw:d}}function sE(e,t,n,r){if(!e||!Array.isArray(e.content))return"";let i="function"==typeof n?n(r):n,[o,...s]=e.content,l=t.renderChildren([o]),a=`${i}${l}`;return s&&s.length>0&&s.forEach((e,n)=>{var r,i;let o=null!=(i=null==(r=t.renderChild)?void 0:r.call(t,e,n+1))?i:t.renderChildren([e]);if(null!=o){let n=o.split("\n").map(e=>e?t.indent(e):t.indent("")).join("\n");a+="paragraph"===e.type?` 80 81${n}`:` 82${n}`}}),a}function sO(e,t,n={}){let{state:r}=t,{doc:i,tr:o}=r;i.descendants((t,r)=>{let i=o.mapping.map(r),s=o.mapping.map(r)+t.nodeSize,l=null;if(t.marks.forEach(t=>{if(t!==e)return!1;l=t}),!l)return;let a=!1;if(Object.keys(n).forEach(e=>{n[e]!==l.attrs[e]&&(a=!0)}),a){let t=e.type.create({...e.attrs,...n});o.removeMark(i,s,e.type),o.addMark(i,s,t)}}),o.docChanged&&t.view.dispatch(o)}ie({},{createAtomBlockMarkdownSpec:()=>sS,createBlockMarkdownSpec:()=>sT,createInlineMarkdownSpec:()=>sM,parseAttributes:()=>sw,parseIndentedBlocks:()=>sA,renderNestedMarkdownContent:()=>sE,serializeAttributes:()=>sk});var sN=class{constructor(e,t,n){this.component=e,this.editor=t.editor,this.options={...n},this.mark=t.mark,this.HTMLAttributes=t.HTMLAttributes}get dom(){return this.editor.view.dom}get contentDOM(){return null}updateAttributes(e,t){sO(t||this.mark,this.editor,e)}ignoreMutation(e){return!this.dom||!this.contentDOM||("function"==typeof this.options.ignoreMutation?this.options.ignoreMutation({mutation:e}):!("selection"===e.type||this.dom.contains(e.target)&&"childList"===e.type&&(iN()||iO())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable))&&(this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)))}},sD=class e extends se{constructor(){super(...arguments),this.type="node"}static create(t={}){return new e("function"==typeof t?t():t)}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}},sI=class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,r,i,o,s,l;let{view:a}=this.editor,d=e.target,c=3===d.nodeType?null==(t=d.parentElement)?void 0:t.closest("[data-drag-handle]"):d.closest("[data-drag-handle]");if(!this.dom||(null==(n=this.contentDOM)?void 0:n.contains(d))||!c)return;let u=0,p=0;if(this.dom!==c){let t=this.dom.getBoundingClientRect(),n=c.getBoundingClientRect(),l=null!=(i=e.offsetX)?i:null==(r=e.nativeEvent)?void 0:r.offsetX,a=null!=(s=e.offsetY)?s:null==(o=e.nativeEvent)?void 0:o.offsetY;u=n.x-t.x+l,p=n.y-t.y+a}let h=this.dom.cloneNode(!0);try{let e=this.dom.getBoundingClientRect();h.style.width=`${Math.round(e.width)}px`,h.style.height=`${Math.round(e.height)}px`,h.style.boxSizing="border-box",h.style.pointerEvents="none"}catch{}let f=null;try{(f=document.createElement("div")).style.position="absolute",f.style.top="-9999px",f.style.left="-9999px",f.style.pointerEvents="none",f.appendChild(h),document.body.appendChild(f),null==(l=e.dataTransfer)||l.setDragImage(h,u,p)}finally{f&&setTimeout(()=>{try{null==f||f.remove()}catch{}},0)}let m=this.getPos();if("number"!=typeof m)return;let g=eB.create(a.state.doc,m),y=a.state.tr.setSelection(g);a.dispatch(y)}stopEvent(e){var t;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:e});let n=e.target;if(!(this.dom.contains(n)&&!(null==(t=this.contentDOM)?void 0:t.contains(n))))return!1;let r=e.type.startsWith("drag"),i="dragover"===e.type||"dragenter"===e.type,o="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!o&&!r)return!0;let{isEditable:s}=this.editor,{isDragging:l}=this,a=!!this.node.type.spec.draggable,d=eB.isSelectable(this.node),c="copy"===e.type,u="paste"===e.type,p="cut"
82===e.type,h="mousedown"===e.type;if(!a&&d&&r&&e.target===this.dom&&e.preventDefault(),a&&r&&!l&&e.target===this.dom)return e.preventDefault(),!1;if(a&&s&&!l&&h){let e=n.closest("[data-drag-handle]");e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!l&&!i&&!o&&!c&&!u&&!p&&(!h||!d)&&!0}ignoreMutation(e){return!this.dom||!this.contentDOM||("function"==typeof this.options.ignoreMutation?this.options.ignoreMutation({mutation:e}):!!this.node.isLeaf||!!this.node.isAtom||!("selection"===e.type||this.dom.contains(e.target)&&"childList"===e.type&&(iN()||iO())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable))&&(this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)))}updateAttributes(e){this.editor.commands.command(({tr:t})=>{let n=this.getPos();return"number"==typeof n&&(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){let e=this.getPos();if("number"!=typeof e)return;let t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}};e.s(["Editor",0,sv,"Extension",0,so,"Mark",0,st,"MarkView",0,sN,"Node",0,sD,"NodeView",0,sI,"ResizableNodeView",0,sx,"callOrReturn",0,ou,"canInsertNode",0,function(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof eB){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;i-=1}return!1},"combineTransactionSteps",0,or,"findChildrenInRange",0,function(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r},"findParentNodeClosestToPos",0,oi,"getAttributes",0,oC,"getChangedRanges",0,o_,"getExtensionField",0,ol,"getMarksBetween",0,oM,"getNodeAtPosition",0,(e,t,n,r=20)=>{let i=e.doc.resolve(n),o=r,s=null;for(;o>0&&null===s;){let e=i.node(o);(null==e?void 0:e.type.name)===t?s=e:o-=1}return[s,o]},"getNodeType",0,ip,"getRenderedAttributes",0,og,"getText",0,oS,"getTextSerializersFromSchema",0,oT,"isAtEndOfNode",0,(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=oo(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2)&&n.pos===r.pos},"isAtStartOfNode",0,e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0)&&t.pos===n.pos},"isNodeActive",0,iG,"isNodeEmpty",0,oI,"isNodeSelection",0,function(e){return e instanceof eB},"isTextSelection",0,iM,"markInputRule",0,function(e){return new o7({find:e.find,handler:({state:t,range:n,match:r})=>{let i=ou(e.getAttributes,void 0,r);if(!1===i||null===i)return null;let{tr:o}=t,s=r[r.length-1],l=r[0];if(s){let r=l.search(/\S/),a=n.from+l.indexOf(s),d=a+s.length;if(oM(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>a).length)return null;
82d<n.to&&o.delete(d,n.to),a>n.from&&o.delete(n.from+r,a);let c=n.from+r+s.length;o.addMark(n.from+r,c,e.type.create(i||{})),o.removeStoredMark(e.type)}},undoable:e.undoable})},"markPasteRule",0,function(e){return new sn({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let o=ou(e.getAttributes,void 0,r,i);if(!1===o||null===o)return null;let{tr:s}=t,l=r[r.length-1],a=r[0],d=n.to;if(l){let i=a.search(/\S/),c=n.from+a.indexOf(l),u=c+l.length;if(oM(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;u<n.to&&s.delete(u,n.to),c>n.from&&s.delete(n.from+i,c),d=n.from+i+l.length,s.addMark(n.from+i,d,e.type.create(o||{})),void 0!==r.index&&void 0!==r.input&&r.index+r[0].length>=r.input.length||s.removeStoredMark(e.type)}}})},"mergeAttributes",0,om,"nodeInputRule",0,function(e){return new o7({find:e.find,handler:({state:t,range:n,match:r})=>{let i=ou(e.getAttributes,void 0,r)||{},{tr:o}=t,s=n.from,l=n.to,a=e.type.create(i);if(r[1]){let e=s+r[0].lastIndexOf(r[1]);e>l?e=l:l=e+r[1].length;let t=r[0][r[0].length-1];o.insertText(t,s+r[0].length-1),o.replaceWith(e,l,a)}else if(r[0]){let t=e.type.isInline?s:s-1;o.insert(t,e.type.create(i)).delete(o.mapping.map(s),o.mapping.map(l))}o.scrollIntoView()},undoable:e.undoable})},"parseIndentedBlocks",0,sA,"posToDOMRect",0,function(e,t,n){let r=e.state.doc.content.size,i=iA(t,0,r),o=iA(n,0,r),s=e.coordsAtPos(i),l=e.coordsAtPos(o,-1),a=Math.min(s.top,l.top),d=Math.max(s.bottom,l.bottom),c=Math.min(s.left,l.left),u=Math.max(s.right,l.right),p={top:a,bottom:d,left:c,right:u,width:u-c,height:d-a,x:c,y:a};return{...p,toJSON:()=>p}},"renderNestedMarkdownContent",0,sE,"textblockTypeInputRule",0,function(e){return new o7({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),o=ou(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)},undoable:e.undoable})},"wrappingInputRule",0,function(e){return new o7({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let o=ou(e.getAttributes,void 0,r)||{},s=t.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),a=l&&ef(l,e.type,o);if(!a)return null;if(s.wrap(l,a),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,o=r||n.$to.parentOffset&&n.$from.marks();if(o){let e=o.filter(e=>i.includes(e.type.name));s.ensureMarks(e)}}if(e.keepAttributes){let t="bulletList"===e.type.name||"orderedList"===e.type.name?"listItem":"taskList";i().updateAttributes(t,o).run()}let d=s.doc.resolve(n.from-1).nodeBefore;d&&d.type===e.type&&ev(s.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,d))&&s.join(n.from-1)},undoable:e.undoable})}],10552)},665742,(e,t,n)=>{t.exports=function(){this.__data__=[],this.size=0}},40746,(e,t,n)=>{t.exports=function(e,t){return e===t||e!=e&&t!=t}},134314,(e,t,n)=>{var r=e.r(40746);t.exports=function(e,t){for(var n=e.length;n--;
82)if(r(e[n][0],t))return n;return -1}},419206,(e,t,n)=>{var r=e.r(134314),i=Array.prototype.splice;t.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():i.call(t,n,1),--this.size,!0)}},467763,(e,t,n)=>{var r=e.r(134314);t.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},523407,(e,t,n)=>{var r=e.r(134314);t.exports=function(e){return r(this.__data__,e)>-1}},553833,(e,t,n)=>{var r=e.r(134314);t.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},729039,(e,t,n)=>{var r=e.r(665742),i=e.r(419206),o=e.r(467763),s=e.r(523407),l=e.r(553833);function a(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}a.prototype.clear=r,a.prototype.delete=i,a.prototype.get=o,a.prototype.has=s,a.prototype.set=l,t.exports=a},405400,(e,t,n)=>{var r=e.r(729039);t.exports=function(){this.__data__=new r,this.size=0}},986238,(e,t,n)=>{t.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},957831,(e,t,n)=>{t.exports=function(e){return this.__data__.get(e)}},977802,(e,t,n)=>{t.exports=function(e){return this.__data__.has(e)}},100236,(e,t,n)=>{t.exports=e.g&&e.g.Object===Object&&e.g},139088,(e,t,n)=>{var r=e.r(100236),i="object"==typeof self&&self&&self.Object===Object&&self;t.exports=r||i||Function("return this")()},630353,(e,t,n)=>{t.exports=e.r(139088).Symbol},243436,(e,t,n)=>{var r=e.r(630353),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,l=r?r.toStringTag:void 0;t.exports=function(e){var t=o.call(e,l),n=e[l];try{e[l]=void 0;var r=!0}catch(e){}var i=s.call(e);return r&&(t?e[l]=n:delete e[l]),i}},223243,(e,t,n)=>{var r=Object.prototype.toString;t.exports=function(e){return r.call(e)}},377684,(e,t,n)=>{var r=e.r(630353),i=e.r(243436),o=e.r(223243),s=r?r.toStringTag:void 0;t.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?i(e):o(e)}},12447,(e,t,n)=>{t.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},771223,(e,t,n)=>{var r=e.r(377684),i=e.r(12447);t.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},853789,(e,t,n)=>{t.exports=e.r(139088)["__core-js_shared__"]},269553,(e,t,n)=>{var r,i=e.r(853789),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(e){return!!o&&o in e}},776366,(e,t,n)=>{var r=Function.prototype.toString;t.exports=function(e){if(null!=e){try{return r.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},54368,(e,t,n)=>{var r=e.r(771223),i=e.r(269553),o=e.r(12447),s=e.r(776366),l=/^\[object .+?Constructor\]$/,a=Object.prototype,d=Function.prototype.toString,c=a.hasOwnProperty,u=RegExp("^"+d.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(e){return!(!o(e)||i(e))&&(r(e)?u:l).test(s(e))}},263958,(e,t,n)=>{t.exports=function(e,t){return null==e?void 0:e[t]}},841920,(e,t,n)=>{var r=e.r(54368),i=e.r(263958);t.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},687362,(e,t,n)=>{t.exports=e.r(841920)(e.r(139088),"Map")},932760,(e,t,n)=>{t.exports=e.r(841920)(Object,"create")},150514,(e,t,n)=>{var r=e.r(932760);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},197617,(e,t,n)=>{t.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=!!t,t}},757412,(e,t,n)=>{var r=e.r(932760),i=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},623592,(e,t,n)=>{var r=e.r(932760),i=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},239004,(e,t,n)=>{var r=e.r(932760);t.exports=function(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},734421,(e,t,n)=>{var r=e.r(150514),i=e.r(197617),o=e.r(757412),s=e.r(623592),l=e.r(239004);function a(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}a.prototype.clear=r,a.prototype.delete=i,a.prototype.get=o,a.prototype.has=s,a.prototype.set=l,t.exports=a},848994,(e,t,n)=>{var r=e.r(734421),i=e.r(729039),o=e.r(687362);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},224053,(e,t,n)=>{t.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},487994,(e,t,n)=>{var r=e.r(224053);t.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},996768,(e,t,n)=>{var r=e.r(487994);t.exports=function(e){var t=r(this,e).delete(e);return this.size-=!!t,t}},929932,(e,t,n)=>{var r=e.r(487994);t.exports=function(e){return r(this,e).get(e)}},892647,(e,t,n)=>{var r=e.r(487994);t.exports=function(e){return r(this,e).has(e)}},446644,(e,t,n)=>{var r=e.r(487994);t.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=+(n.size!=i),this}},587547,(e,t,n)=>{var r=e.r(848994),i=e.r(996768),o=e.r(929932),s=e.r(892647),l=e.r(446644);function a(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}a.prototype.clear=r,a.prototype.delete=i,a.prototype.get=o,a.prototype.has=s,a.prototype.set=l,t.exports=a},320517,(e,t,n)=>{var r=e.r(729039),i=e.r(687362),o=e.r(587547);t.exports=function(e,t){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!i||s.length<199)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(s)}return n.set(e,t),this.size=n.size,this}},901551,(e,t,n)=>{var r=e.r(729039),i=e.r(405400),o=e.r(986238),s=e.r(957831),l=e.r(977802),a=e.r(320517);function d(e){var t=this.__data__=new r(e);this.size=t.size}d.prototype.clear=i,d.prototype.delete=o,d.prototype.get=s,d.prototype.has=l,d.prototype.set=a,t.exports=d},212895,(e,t,n)=>{t.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;
82++n<r&&!1!==t(e[n],n,e););return e}},524251,(e,t,n)=>{var r=e.r(841920);t.exports=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}()},674548,(e,t,n)=>{var r=e.r(524251);t.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},4300,(e,t,n)=>{var r=e.r(674548),i=e.r(40746),o=Object.prototype.hasOwnProperty;t.exports=function(e,t,n){var s=e[t];o.call(e,t)&&i(s,n)&&(void 0!==n||t in e)||r(e,t,n)}},372351,(e,t,n)=>{var r=e.r(4300),i=e.r(674548);t.exports=function(e,t,n,o){var s=!n;n||(n={});for(var l=-1,a=t.length;++l<a;){var d=t[l],c=o?o(n[d],e[d],d,n,e):void 0;void 0===c&&(c=e[d]),s?i(n,d,c):r(n,d,c)}return n}},855803,(e,t,n)=>{t.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},877289,(e,t,n)=>{t.exports=function(e){return null!=e&&"object"==typeof e}},566645,(e,t,n)=>{var r=e.r(377684),i=e.r(877289);t.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},473250,(e,t,n)=>{var r=e.r(566645),i=e.r(877289),o=Object.prototype,s=o.hasOwnProperty,l=o.propertyIsEnumerable;t.exports=r(function(){return arguments}())?r:function(e){return i(e)&&s.call(e,"callee")&&!l.call(e,"callee")}},45350,(e,t,n)=>{t.exports=Array.isArray},24013,(e,t,n)=>{t.exports=function(){return!1}},356956,(e,t,n)=>{var r=e.r(139088),i=e.r(24013),o=n&&!n.nodeType&&n,s=o&&t&&!t.nodeType&&t,l=s&&s.exports===o?r.Buffer:void 0;t.exports=(l?l.isBuffer:void 0)||i},66397,(e,t,n)=>{var r=/^(?:0|[1-9]\d*)$/;t.exports=function(e,t){var n=typeof e;return!!(t=null==t?0x1fffffffffffff:t)&&("number"==n||"symbol"!=n&&r.test(e))&&e>-1&&e%1==0&&e<t}},98376,(e,t,n)=>{t.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff}},476602,(e,t,n)=>{var r=e.r(377684),i=e.r(98376),o=e.r(877289),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,t.exports=function(e){return o(e)&&i(e.length)&&!!s[r(e)]}},233999,(e,t,n)=>{t.exports=function(e){return function(t){return e(t)}}},180156,(e,t,n)=>{var r=e.r(100236),i=n&&!n.nodeType&&n,o=i&&t&&!t.nodeType&&t,s=o&&o.exports===i&&r.process;t.exports=function(){try{var e=o&&o.require&&o.require("util").types;if(e)return e;return s&&s.binding&&s.binding("util")}catch(e){}}()},3023,(e,t,n)=>{var r=e.r(476602),i=e.r(233999),o=e.r(180156),s=o&&o.isTypedArray;t.exports=s?i(s):r},458877,(e,t,n)=>{var r=e.r(855803),i=e.r(473250),o=e.r(45350),s=e.r(356956),l=e.r(66397),a=e.r(3023),d=Object.prototype.hasOwnProperty;t.exports=function(e,t){var n=o(e),c=!n&&i(e),u=!n&&!c&&s(e),p=!n&&!c&&!u&&a(e),h=n||c||u||p,f=h?r(e.length,String):[],m=f.length;for(var g in e)(t||d.call(e,g))&&!(h&&("length"==g||u&&("offset"==g||"parent"==g)||p&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||l(g,m)))&&f.push(g);return f}},763996,(e,t,n)=>{var r=Object.prototype;t.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||r)}},825717,(e,t,n)=>{t.exports=function(e,t){return function(n){return e(t(n))}}},942369,(e,t,n)=>{t.exports=e.r(825717)(Object.keys,Object)},848477,(e,t,n)=>{var r=e.r(763996),i=e.r(942369),o=Object.prototype.hasOwnProperty;t.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},351095,(e,t,n)=>{var r=e.r(771223),i=e.r(98376);t.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},33679,(e,t,n)=>{var r=e.r(458877),i=e.r(848477),o=e.r(351095);t.exports=function(e){return o(e)?r(e):i(e)}},860196,(e,t,n)=>{var r=e.r(372351),i=e.r(33679);t.exports=function(e,t){return e&&r(t,i(t),e)}},513730,(e,t,n)=>{t.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},385689,(e,t,n)=>{var r=e.r(12447),i=e.r(763996),o=e.r(513730),s=Object.prototype.hasOwnProperty;t.exports=function(e){if(!r(e))return o(e);var t=i(e),n=[];for(var l in e)"constructor"==l&&(t||!s.call(e,l))||n.push(l);return n}},689695,(e,t,n)=>{var r=e.r(458877),i=e.r(385689),o=e.r(351095);t.exports=function(e){return o(e)?r(e,!0):i(e)}},52624,(e,t,n)=>{var r=e.r(372351),i=e.r(689695);t.exports=function(e,t){return e&&r(t,i(t),e)}},622781,(e,t,n)=>{var r=e.r(139088),i=n&&!n.nodeType&&n,o=i&&t&&!t.nodeType&&t,s=o&&o.exports===i?r.Buffer:void 0,l=s?s.allocUnsafe:void 0;t.exports=function(e,t){if(t)return e.slice();var n=e.length,r=l?l(n):new e.constructor(n);return e.copy(r),r}},776736,(e,t,n)=>{t.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},536100,(e,t,n)=>{t.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}},45159,(e,t,n)=>{t.exports=function(){return[]}},717332,(e,t,n)=>{var r=e.r(536100),i=e.r(45159),o=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols;t.exports=s?function(e){return null==e?[]:r(s(e=Object(e)),function(t){return o.call(e,t)})}:i},174071,(e,t,n)=>{var r=e.r(372351),i=e.r(717332);t.exports=function(e,t){return r(e,i(e),t)}},169102,(e,t,n)=>{t.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}},962413,(e,t,n)=>{t.exports=e.r(825717)(Object.getPrototypeOf,Object)},233648,(e,t,n)=>{var r=e.r(169102),i=e.r(962413),o=e.r(717332),s=e.r(45159);t.exports=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,o(e)),e=i(e);return t}:s},345001,(e,t,n)=>{var r=e.r(372351),i=e.r(233648);t.exports=function(e,t){return r(e,i(e),t)}},823403,(e,t,n)=>{var r=e.r(169102),i=e.r(45350);t.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},413370,(e,t,n)=>{var r=e.r(823403),i=e.r(717332),o=e.r(33679);t.exports=function(e){return r(e,o,i)}},807889,(e,t,n)=>{var r=e.r(823403),i=e.r(233648),o=e.r(689695);t.exports=function(e){return r(e,o,i)}},801419,(e,t,n)=>{t.exports=e.r(841920)(e.r(139088),"DataView")},717074,(e,t,n)=>{t.exports=e.r(841920)(e.r(139088),"Promise")},106966,(e,t,n)=>{t.exports=e.r(841920)(e.r(139088),"Set")},573895,(e,t,n)=>{t.exports=e.r(841920)(e.r(139088),"WeakMap")},367426,(e,t,n)=>{var r=e.r(801419),i=e.r(687362),o=e.r(717074),s=e.r(106966),l=e.r(573895),a=e.r(377684),d=e.r(776366),c="[object Map]",u="[object Promise]",p="[object Set]",h="[object WeakMap]",f="[object DataView]",m=d(r),g=d(i),y=d(o),b=d(s),v=d(l),x=a;(r&&x(new r(new ArrayBuffer(1)))!=f||i&&x(new i)!=c||o&&x(o.resolve())!=u||s&&x(new s)!=p||l&&x(new l)!=h)&&(x=function(e){var t=a(e),n="[object Object]"==t?e.constructor:void 0,r=n?d(n):"";if(r)switch(r){case m:return f;case g:return c;case y:return u;case b:return p;case v:return h}return t}),t.exports=x},153265,(e,t,n)=>{var r=Object.prototype.hasOwnProperty;t.exports=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&r.call(e,"index")&&(n.index=e.index,n.input=e.input),n}},263750,(e,t,n)=>{t.exports=e.r(139088).Uint8Array},425393,(e,t,n)=>{var r=e.r(263750);t.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},664146,(e,t,n)=>{var r=e.r(425393);t.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},984046,(e,t,n)=>
82{var r=/\w*$/;t.exports=function(e){var t=new e.constructor(e.source,r.exec(e));return t.lastIndex=e.lastIndex,t}},298430,(e,t,n)=>{var r=e.r(630353),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;t.exports=function(e){return o?Object(o.call(e)):{}}},514712,(e,t,n)=>{var r=e.r(425393);t.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},749769,(e,t,n)=>{var r=e.r(425393),i=e.r(664146),o=e.r(984046),s=e.r(298430),l=e.r(514712);t.exports=function(e,t,n){var a=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new a(+e);case"[object DataView]":return i(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return l(e,n);case"[object Map]":case"[object Set]":return new a;case"[object Number]":case"[object String]":return new a(e);case"[object RegExp]":return o(e);case"[object Symbol]":return s(e)}}},646352,(e,t,n)=>{var r=e.r(12447),i=Object.create;t.exports=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}()},992433,(e,t,n)=>{var r=e.r(646352),i=e.r(962413),o=e.r(763996);t.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:r(i(e))}},181198,(e,t,n)=>{var r=e.r(367426),i=e.r(877289);t.exports=function(e){return i(e)&&"[object Map]"==r(e)}},954284,(e,t,n)=>{var r=e.r(181198),i=e.r(233999),o=e.r(180156),s=o&&o.isMap;t.exports=s?i(s):r},936206,(e,t,n)=>{var r=e.r(367426),i=e.r(877289);t.exports=function(e){return i(e)&&"[object Set]"==r(e)}},240158,(e,t,n)=>{var r=e.r(936206),i=e.r(233999),o=e.r(180156),s=o&&o.isSet;t.exports=s?i(s):r},64324,(e,t,n)=>{var r=e.r(901551),i=e.r(212895),o=e.r(4300),s=e.r(860196),l=e.r(52624),a=e.r(622781),d=e.r(776736),c=e.r(174071),u=e.r(345001),p=e.r(413370),h=e.r(807889),f=e.r(367426),m=e.r(153265),g=e.r(749769),y=e.r(992433),b=e.r(45350),v=e.r(356956),x=e.r(954284),w=e.r(12447),k=e.r(240158),S=e.r(33679),T=e.r(689695),C="[object Arguments]",_="[object Function]",M="[object Object]",A={};A[C]=A["[object Array]"]=A["[object ArrayBuffer]"]=A["[object DataView]"]=A["[object Boolean]"]=A["[object Date]"]=A["[object Float32Array]"]=A["[object Float64Array]"]=A["[object Int8Array]"]=A["[object Int16Array]"]=A["[object Int32Array]"]=A["[object Map]"]=A["[object Number]"]=A[M]=A["[object RegExp]"]=A["[object Set]"]=A["[object String]"]=A["[object Symbol]"]=A["[object Uint8Array]"]=A["[object Uint8ClampedArray]"]=A["[object Uint16Array]"]=A["[object Uint32Array]"]=!0,A["[object Error]"]=A[_]=A["[object WeakMap]"]=!1,t.exports=function e(t,n,E,O,N,D){var I,$=1&n,R=2&n,P=4&n;if(E&&(I=N?E(t,O,N,D):E(t)),void 0!==I)return I;if(!w(t))return t;var z=b(t);if(z){if(I=m(t),!$)return d(t,I)}else{var L=f(t),F=L==_||"[object GeneratorFunction]"==L;if(v(t))return a(t,$);if(L==M||L==C||F&&!N){if(I=R||F?{}:y(t),!$)return R?u(t,l(I,t)):c(t,s(I,t))}else{if(!A[L])return N?t:{};I=g(t,L,$)}}D||(D=new r);var j=D.get(t);if(j)return j;D.set(t,I),k(t)?t.forEach(function(r){I.add(e(r,n,E,r,t,D))}):x(t)&&t.forEach(function(r,i){I.set(i,e(r,n,E,i,t,D))});var W=P?R?h:p:R?T:S,B=z?void 0:W(t);return i(B||t,function(r,i){B&&(r=t[i=r]),o(I,i,e(r,n,E,i,t,D))}),I}},271944,(e,t,n)=>{var r=e.r(64324);t.exports=function(e){return r(e,5)}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.