HEX
Server: nginx/1.28.1
System: Linux VM-0-12-opencloudos 6.6.117-45.oc9.x86_64 #1 SMP Thu Dec 4 10:26:39 CST 2025 x86_64
User: www (1000)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/www.waciwang.com/wp-content/plugins/gutenberg/build/scripts/rich-text/index.min.js
"use strict";var wp;(wp||={}).richText=(()=>{var gr=Object.create;var dt=Object.defineProperty;var yr=Object.getOwnPropertyDescriptor;var vr=Object.getOwnPropertyNames;var Er=Object.getPrototypeOf,wr=Object.prototype.hasOwnProperty;var U=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),St=(e,t)=>{for(var r in t)dt(e,r,{get:t[r],enumerable:!0})},Xt=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of vr(t))!wr.call(e,o)&&o!==r&&dt(e,o,{get:()=>t[o],enumerable:!(n=yr(t,o))||n.enumerable});return e};var g=(e,t,r)=>(r=e!=null?gr(Er(e)):{},Xt(t||!e||!e.__esModule?dt(r,"default",{value:e,enumerable:!0}):r,e)),br=e=>Xt(dt({},"__esModule",{value:!0}),e);var W=U((hn,Jt)=>{Jt.exports=window.wp.data});var te=U((An,It)=>{It.exports=window.wp.escapeHtml});var Ee=U((Lo,ve)=>{ve.exports=window.wp.a11y});var be=U((Co,we)=>{we.exports=window.wp.i18n});var tt=U((Ho,Fe)=>{Fe.exports=window.wp.element});var Ae=U((ko,Ne)=>{Ne.exports=window.wp.deprecated});var Ft=U((Vo,_e)=>{_e.exports=window.wp.compose});var Oe=U((Bo,Se)=>{Se.exports=window.wp.dom});var zt=U((Qo,Qe)=>{Qe.exports=window.wp.keycodes});var pn={};St(pn,{RichTextData:()=>V,__experimentalRichText:()=>lr,__unstableCreateElement:()=>P,__unstableToDom:()=>Bt,__unstableUseRichText:()=>mr,applyFormat:()=>gt,concat:()=>ce,create:()=>L,getActiveFormat:()=>nt,getActiveFormats:()=>X,getActiveObject:()=>ae,getTextContent:()=>rt,insert:()=>st,insertObject:()=>pe,isCollapsed:()=>ot,isEmpty:()=>ue,join:()=>fe,registerFormatType:()=>me,remove:()=>wt,removeFormat:()=>Et,replace:()=>le,slice:()=>bt,split:()=>de,store:()=>A,toHTMLString:()=>J,toggleFormat:()=>xe,unregisterFormatType:()=>Te,useAnchor:()=>He,useAnchorRef:()=>Re});var ht=g(W(),1);var Zt=g(W(),1);function xr(e={},t){switch(t.type){case"ADD_FORMAT_TYPES":return{...e,...t.formatTypes.reduce((r,n)=>({...r,[n.name]:n}),{})};case"REMOVE_FORMAT_TYPES":return Object.fromEntries(Object.entries(e).filter(([r])=>!t.names.includes(r)))}return e}var Gt=(0,Zt.combineReducers)({formatTypes:xr});var Dt={};St(Dt,{getFormatType:()=>Tr,getFormatTypeForBareElement:()=>Fr,getFormatTypeForClassName:()=>Nr,getFormatTypes:()=>Ot});var Yt=g(W(),1),Ot=(0,Yt.createSelector)(e=>Object.values(e.formatTypes),e=>[e.formatTypes]);function Tr(e,t){return e.formatTypes[t]}function Fr(e,t){let r=Ot(e);return r.find(({className:n,tagName:o})=>n===null&&t===o)||r.find(({className:n,tagName:o})=>n===null&&o==="*")}function Nr(e,t){return Ot(e).find(({className:r})=>r===null?!1:` ${t} `.indexOf(` ${r} `)>=0)}var Mt={};St(Mt,{addFormatTypes:()=>Ar,removeFormatTypes:()=>Lr});function Ar(e){return{type:"ADD_FORMAT_TYPES",formatTypes:Array.isArray(e)?e:[e]}}function Lr(e){return{type:"REMOVE_FORMAT_TYPES",names:Array.isArray(e)?e:[e]}}var Cr="core/rich-text",A=(0,ht.createReduxStore)(Cr,{reducer:Gt,selectors:Dt,actions:Mt});(0,ht.register)(A);function Q(e,t){if(e===t)return!0;if(!e||!t||e.type!==t.type)return!1;let r=e.attributes,n=t.attributes;if(r===n)return!0;if(!r||!n)return!1;let o=Object.keys(r),c=Object.keys(n);if(o.length!==c.length)return!1;let i=o.length;for(let s=0;s<i;s++){let a=o[s];if(r[a]!==n[a])return!1}return!0}function _(e){let t=e.formats.slice();return t.forEach((r,n)=>{let o=t[n-1];if(o){let c=r.slice();c.forEach((i,s)=>{let a=o[s];Q(i,a)&&(c[s]=a)}),t[n]=c}}),{...e,formats:t}}function Qt(e,t,r){return e=e.slice(),e[t]=r,e}function gt(e,t,r=e.start,n=e.end){let{formats:o,activeFormats:c}=e,i=o.slice();if(r===n){let s=i[r]?.find(({type:a})=>a===t.type);if(s){let a=i[r].indexOf(s);for(;i[r]&&i[r][a]===s;)i[r]=Qt(i[r],a,t),r--;for(n++;i[n]&&i[n][a]===s;)i[n]=Qt(i[n],a,t),n++}}else{let s=1/0;for(let a=r;a<n;a++)if(i[a]){i[a]=i[a].filter(({type:f})=>f!==t.type);let u=i[a].length;u<s&&(s=u)}else i[a]=[],s=0;for(let a=r;a<n;a++)i[a].splice(s,0,t)}return _({...e,formats:i,activeFormats:[...c?.filter(({type:s})=>s!==t.type)||[],t]})}var kt=g(W(),1);function P({implementation:e},t){return P.body||(P.body=e.createHTMLDocument("").body),P.body.innerHTML=t,P.body}var C="\uFFFC",ft="\uFEFF";var et=g(te(),1);function X(e,t=[]){let{formats:r,start:n,end:o,activeFormats:c}=e;if(n===void 0)return t;if(n===o){if(c)return c;let u=r[n-1]||t,f=r[n]||t;return u.length<f.length?u:f}if(!r[n])return t;let i=r.slice(n,o),s=[...i[0]],a=i.length;for(;a--;){let u=i[a];if(!u)return t;let f=s.length;for(;f--;){let m=s[f];u.find(p=>Q(m,p))||s.splice(f,1)}if(s.length===0)return t}return s||t}var ee=g(W(),1);function Ht(e){return(0,ee.select)(A).getFormatType(e)}function re(e,t){if(t)return e;let r={};for(let n in e){let o=n;n.startsWith("data-disable-rich-text-")&&(o=n.slice(23)),r[o]=e[n]}return r}function yt({type:e,tagName:t,attributes:r,unregisteredAttributes:n,object:o,boundaryClass:c,isEditableTree:i}){let s=Ht(e),a={};if(c&&i&&(a["data-rich-text-format-boundary"]="true"),!s)return r&&(a={...r,...a}),{type:e,attributes:re(a,i),object:o};a={...n,...a};for(let u in r){let f=s.attributes?s.attributes[u]:!1;f?a[f]=r[u]:a[u]=r[u]}return s.className&&(a.class?a.class=`${s.className} ${a.class}`:a.class=s.className),{type:t||s.tagName,object:s.object,attributes:re(a,i)}}function Rr(e,t,r){do if(e[r]!==t[r])return!1;while(r--);return!0}function vt({value:e,preserveWhiteSpace:t,createEmpty:r,append:n,getLastChild:o,getParent:c,isText:i,getText:s,remove:a,appendText:u,onStartIndex:f,onEndIndex:m,isEditableTree:p,placeholder:T}){let{formats:E,replacements:v,text:y,start:w,end:b}=e,d=E.length+1,R=r(),k=X(e),B=k[k.length-1],j,q;n(R,"");for(let x=0;x<d;x++){let h=y.charAt(x),N=p&&(!q||q===`
`),O=E[x],l=o(R);if(O&&O.forEach((D,$)=>{if(l&&j&&Rr(O,j,$)){l=o(l);return}let{type:G,tagName:Y,attributes:_t,unregisteredAttributes:pt}=D,pr=p&&D===B,dr=c(l),hr=n(dr,yt({type:G,tagName:Y,attributes:_t,unregisteredAttributes:pt,boundaryClass:pr,isEditableTree:p}));i(l)&&s(l).length===0&&a(l),l=n(hr,"")}),x===0&&(f&&w===0&&f(R,l),m&&b===0&&m(R,l)),h===C){let D=v[x];if(!D)continue;let{type:$,attributes:G,innerHTML:Y}=D,_t=Ht($);if(p&&$==="#comment")l=n(c(l),{type:"span",attributes:{contenteditable:"false","data-rich-text-comment":G["data-rich-text-comment"]}}),n(n(l,{type:"span"}),G["data-rich-text-comment"].trim());else if(!p&&$==="script")l=n(c(l),yt({type:"script",isEditableTree:p})),n(l,{html:decodeURIComponent(G["data-rich-text-script"])});else if(_t?.contentEditable===!1){if(Y||p){if(l=c(l),p){let pt={contenteditable:"false","data-rich-text-bogus":!0};w===x&&b===x+1&&(pt["data-rich-text-format-boundary"]=!0),l=n(l,{type:"span",attributes:pt}),p&&x+1===y.length&&n(c(l),ft)}l=n(l,yt({...D,isEditableTree:p})),Y&&n(l,{html:Y})}}else l=n(c(l),yt({...D,object:!0,isEditableTree:p}));l=n(c(l),"")}else!t&&h===`
`?(l=n(c(l),{type:"br",attributes:p?{"data-rich-text-line-break":"true"}:void 0,object:!0}),l=n(c(l),"")):i(l)?u(l,h):l=n(c(l),h);f&&w===x+1&&f(R,l),m&&b===x+1&&m(R,l),N&&x===y.length&&(n(c(l),ft),T&&y.length===0&&n(c(l),{type:"span",attributes:{"data-rich-text-placeholder":T,style:"pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;"}})),j=O,q=h}return R}function J({value:e,preserveWhiteSpace:t}){let r=vt({value:e,preserveWhiteSpace:t,createEmpty:_r,append:Or,getLastChild:Sr,getParent:Mr,isText:Hr,getText:kr,remove:$r,appendText:Dr});return ne(r.children)}function _r(){return{}}function Sr({children:e}){return e&&e[e.length-1]}function Or(e,t){return typeof t=="string"&&(t={text:t}),t.parent=e,e.children=e.children||[],e.children.push(t),t}function Dr(e,t){e.text+=t}function Mr({parent:e}){return e}function Hr({text:e}){return typeof e=="string"}function kr({text:e}){return e}function $r(e){let t=e.parent.children.indexOf(e);return t!==-1&&e.parent.children.splice(t,1),e}function Pr({type:e,attributes:t,object:r,children:n}){if(e==="#comment")return`<!--${t["data-rich-text-comment"]}-->`;let o="";for(let c in t)(0,et.isValidAttributeName)(c)&&(o+=` ${c}="${(0,et.escapeAttribute)(t[c])}"`);return r?`<${e}${o}>`:`<${e}${o}>${ne(n)}</${e}>`}function ne(e=[]){return e.map(t=>t.html!==void 0?t.html:t.text===void 0?Pr(t):(0,et.escapeEditableHTML)(t.text)).join("")}function rt({text:e}){return e.replace(C,"")}function I(){return{formats:[],replacements:[],text:""}}function Vr({tagName:e,attributes:t}){let r;if(t&&t.class&&(r=(0,kt.select)(A).getFormatTypeForClassName(t.class),r&&(t.class=` ${t.class} `.replace(` ${r.className} `," ").trim(),t.class||delete t.class)),r||(r=(0,kt.select)(A).getFormatTypeForBareElement(e)),!r)return t?{type:e,attributes:t}:{type:e};if(r.__experimentalCreatePrepareEditableTree&&!r.__experimentalCreateOnChangeEditableValue)return null;if(!t)return{formatType:r,type:r.name,tagName:e};let n={},o={},c={...t};for(let i in r.attributes){let s=r.attributes[i];n[i]=c[s],delete c[s],typeof n[i]>"u"&&delete n[i]}for(let i in c)o[i]=t[i];return r.contentEditable===!1&&delete o.contenteditable,{formatType:r,type:r.name,tagName:e,attributes:n,unregisteredAttributes:o}}var V=class mt{#t;static empty(){return new mt}static fromPlainText(t){return new mt(L({text:t}))}static fromHTMLString(t){return new mt(L({html:t}))}static fromHTMLElement(t,r={}){let{preserveWhiteSpace:n=!1}=r,o=n?t:ie(t),c=new mt(L({element:o}));return Object.defineProperty(c,"originalHTML",{value:t.innerHTML}),c}constructor(t=I()){this.#t=t}toPlainText(){return rt(this.#t)}toHTMLString({preserveWhiteSpace:t}={}){return this.originalHTML||J({value:this.#t,preserveWhiteSpace:t})}valueOf(){return this.toHTMLString()}toString(){return this.toHTMLString()}toJSON(){return this.toHTMLString()}get length(){return this.text.length}get formats(){return this.#t.formats}get replacements(){return this.#t.replacements}get text(){return this.#t.text}};for(let e of Object.getOwnPropertyNames(String.prototype))V.prototype.hasOwnProperty(e)||Object.defineProperty(V.prototype,e,{value(...t){return this.toHTMLString()[e](...t)}});function L({element:e,text:t,html:r,range:n,__unstableIsEditableTree:o}={}){return r instanceof V?{text:r.text,formats:r.formats,replacements:r.replacements}:typeof t=="string"&&t.length>0?{formats:Array(t.length),replacements:Array(t.length),text:t}:(typeof r=="string"&&r.length>0&&(e=P(document,r)),typeof e!="object"?I():se({element:e,range:n,isEditableTree:o}))}function Z(e,t,r,n){if(!r)return;let{parentNode:o}=t,{startContainer:c,startOffset:i,endContainer:s,endOffset:a}=r,u=e.text.length;n.start!==void 0?e.start=u+n.start:t===c&&t.nodeType===t.TEXT_NODE?e.start=u+i:o===c&&t===c.childNodes[i]?e.start=u:o===c&&t===c.childNodes[i-1]?e.start=u+n.text.length:t===c&&(e.start=u),n.end!==void 0?e.end=u+n.end:t===s&&t.nodeType===t.TEXT_NODE?e.end=u+a:o===s&&t===s.childNodes[a-1]?e.end=u+n.text.length:o===s&&t===s.childNodes[a]?e.end=u:t===s&&(e.end=u+a)}function Br(e,t,r){if(!t)return;let{startContainer:n,endContainer:o}=t,{startOffset:c,endOffset:i}=t;return e===n&&(c=r(e.nodeValue.slice(0,c)).length),e===o&&(i=r(e.nodeValue.slice(0,i)).length),{startContainer:n,startOffset:c,endContainer:o,endOffset:i}}function ie(e,t=!0){let r=e.cloneNode(!0);return r.normalize(),Array.from(r.childNodes).forEach((n,o,c)=>{if(n.nodeType===n.TEXT_NODE){let i=n.nodeValue;/[\n\t\r\f]/.test(i)&&(i=i.replace(/[\n\t\r\f]+/g," ")),i.indexOf("  ")!==-1&&(i=i.replace(/ {2,}/g," ")),o===0&&i.startsWith(" ")?i=i.slice(1):t&&o===c.length-1&&i.endsWith(" ")&&(i=i.slice(0,-1)),n.nodeValue=i}else n.nodeType===n.ELEMENT_NODE&&n.replaceWith(ie(n,!1))}),r}var jr="\r";function oe(e){return e.replace(new RegExp(`[${ft}${C}${jr}]`,"gu"),"")}function se({element:e,range:t,isEditableTree:r}){let n=I();if(!e)return n;if(!e.hasChildNodes())return Z(n,e,t,I()),n;let o=e.childNodes.length;for(let i=0;i<o;i++){let s=e.childNodes[i],a=s.nodeName.toLowerCase();if(s.nodeType===s.TEXT_NODE){let m=oe(s.nodeValue);t=Br(s,t,oe),Z(n,s,t,{text:m}),n.formats.length+=m.length,n.replacements.length+=m.length,n.text+=m;continue}if(s.nodeType===s.COMMENT_NODE||s.nodeType===s.ELEMENT_NODE&&s.tagName==="SPAN"&&s.hasAttribute("data-rich-text-comment")){let m={formats:[,],replacements:[{type:"#comment",attributes:{"data-rich-text-comment":s.nodeType===s.COMMENT_NODE?s.nodeValue:s.getAttribute("data-rich-text-comment")}}],text:C};Z(n,s,t,m),K(n,m);continue}if(s.nodeType!==s.ELEMENT_NODE)continue;if(r&&a==="br"&&!s.getAttribute("data-rich-text-line-break")){Z(n,s,t,I());continue}if(a==="script"){let m={formats:[,],replacements:[{type:a,attributes:{"data-rich-text-script":s.getAttribute("data-rich-text-script")||encodeURIComponent(s.innerHTML)}}],text:C};Z(n,s,t,m),K(n,m);continue}if(a==="br"){Z(n,s,t,I()),K(n,L({text:`
`}));continue}let u=Vr({tagName:a,attributes:qr({element:s})});if(u?.formatType?.contentEditable===!1){delete u.formatType,Z(n,s,t,I()),K(n,{formats:[,],replacements:[{...u,innerHTML:s.innerHTML}],text:C});continue}u&&delete u.formatType;let f=se({element:s,range:t,isEditableTree:r});if(Z(n,s,t,f),!u||s.getAttribute("data-rich-text-placeholder")||s.getAttribute("data-rich-text-bogus"))K(n,f);else if(f.text.length===0)u.attributes&&K(n,{formats:[,],replacements:[u],text:C});else{let m=function(p){if(m.formats===p)return m.newFormats;let T=p?[u,...p]:[u];return m.formats=p,m.newFormats=T,T};var c=m;m.newFormats=[u],K(n,{...f,formats:Array.from(f.formats,m)})}}return n}function qr({element:e}){if(!e.hasAttributes())return;let t=e.attributes.length,r;for(let n=0;n<t;n++){let{name:o,value:c}=e.attributes[n];if(o.indexOf("data-rich-text-")===0)continue;let i=/^on/i.test(o)?"data-disable-rich-text-"+o:o;r=r||{},r[i]=c}return r}function K(e,t){return e.formats=e.formats.concat(t.formats),e.replacements=e.replacements.concat(t.replacements),e.text+=t.text,e}function ce(...e){return _(e.reduce(K,L()))}function nt(e,t){return X(e).find(({type:r})=>r===t)}function ae({start:e,end:t,replacements:r,text:n}){if(!(e+1!==t||n[e]!==C))return r[e]}function ot({start:e,end:t}){if(!(e===void 0||t===void 0))return e===t}function ue({text:e}){return e.length===0}function fe(e,t=""){return typeof t=="string"&&(t=L({text:t})),_(e.reduce((r,{formats:n,replacements:o,text:c})=>({formats:r.formats.concat(t.formats,n),replacements:r.replacements.concat(t.replacements,o),text:r.text+t.text+c})))}var it=g(W(),1);function me(e,t){if(t={name:e,...t},typeof t.name!="string"){window.console.error("Format names must be strings.");return}if(!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(t.name)){window.console.error("Format names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-format");return}if((0,it.select)(A).getFormatType(t.name)){window.console.error('Format "'+t.name+'" is already registered.');return}if(typeof t.tagName!="string"||t.tagName===""){window.console.error("Format tag names must be a string.");return}if((typeof t.className!="string"||t.className==="")&&t.className!==null){window.console.error("Format class names must be a string, or null to handle bare elements.");return}if(!/^[_a-zA-Z]+[a-zA-Z0-9_-]*$/.test(t.className)){window.console.error("A class name must begin with a letter, followed by any number of hyphens, underscores, letters, or numbers.");return}if(t.className===null){let r=(0,it.select)(A).getFormatTypeForBareElement(t.tagName);if(r&&r.name!=="core/unknown"){window.console.error(`Format "${r.name}" is already registered to handle bare tag name "${t.tagName}".`);return}}else{let r=(0,it.select)(A).getFormatTypeForClassName(t.className);if(r){window.console.error(`Format "${r.name}" is already registered to handle class name "${t.className}".`);return}}if(!("title"in t)||t.title===""){window.console.error('The format "'+t.name+'" must have a title.');return}if("keywords"in t&&t.keywords.length>3){window.console.error('The format "'+t.name+'" can have a maximum of 3 keywords.');return}if(typeof t.title!="string"){window.console.error("Format titles must be strings.");return}return(0,it.dispatch)(A).addFormatTypes(t),t}function Et(e,t,r=e.start,n=e.end){let{formats:o,activeFormats:c}=e,i=o.slice();if(r===n){let s=i[r]?.find(({type:a})=>a===t);if(s){for(;i[r]?.find(a=>a===s);)$t(i,r,t),r--;for(n++;i[n]?.find(a=>a===s);)$t(i,n,t),n++}}else for(let s=r;s<n;s++)i[s]&&$t(i,s,t);return _({...e,formats:i,activeFormats:c?.filter(({type:s})=>s!==t)||[]})}function $t(e,t,r){let n=e[t].filter(({type:o})=>o!==r);n.length?e[t]=n:delete e[t]}function st(e,t,r=e.start,n=e.end){let{formats:o,replacements:c,text:i}=e;typeof t=="string"&&(t=L({text:t}));let s=r+t.text.length;return _({formats:o.slice(0,r).concat(t.formats,o.slice(n)),replacements:c.slice(0,r).concat(t.replacements,c.slice(n)),text:i.slice(0,r)+t.text+i.slice(n),start:s,end:s})}function wt(e,t,r){return st(e,L(),t,r)}function le({formats:e,replacements:t,text:r,start:n,end:o},c,i){return r=r.replace(c,(s,...a)=>{let u=a[a.length-2],f=i,m,p;return typeof f=="function"&&(f=i(s,...a)),typeof f=="object"?(m=f.formats,p=f.replacements,f=f.text):(m=Array(f.length),p=Array(f.length),e[u]&&(m=m.fill(e[u]))),e=e.slice(0,u).concat(m,e.slice(u+s.length)),t=t.slice(0,u).concat(p,t.slice(u+s.length)),n&&(n=o=u+f.length),f}),_({formats:e,replacements:t,text:r,start:n,end:o})}function pe(e,t,r,n){return st(e,{formats:[,],replacements:[t],text:C},r,n)}function bt(e,t=e.start,r=e.end){let{formats:n,replacements:o,text:c}=e;return t===void 0||r===void 0?{...e}:{formats:n.slice(t,r),replacements:o.slice(t,r),text:c.slice(t,r)}}function de({formats:e,replacements:t,text:r,start:n,end:o},c){if(typeof c!="string")return Ur(...arguments);let i=0;return r.split(c).map(s=>{let a=i,u={formats:e.slice(a,a+s.length),replacements:t.slice(a,a+s.length),text:s};return i+=c.length+s.length,n!==void 0&&o!==void 0&&(n>=a&&n<i?u.start=n-a:n<a&&o>a&&(u.start=0),o>=a&&o<i?u.end=o-a:n<i&&o>i&&(u.end=s.length)),u})}function Ur({formats:e,replacements:t,text:r,start:n,end:o},c=n,i=o){if(n===void 0||o===void 0)return;let s={formats:e.slice(0,c),replacements:t.slice(0,c),text:r.slice(0,c)},a={formats:e.slice(i),replacements:t.slice(i),text:r.slice(i),start:0,end:0};return[s,a]}function xt(e,t){return e===t||e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset}var Pt="http://www.w3.org/1998/Math/MathML";function Vt(e,t,r){let n=e.parentNode,o=0;for(;e=e.previousSibling;)o++;return r=[o,...r],n!==t&&(r=Vt(n,t,r)),r}function he(e,t){for(t=[...t];e&&t.length>1;)e=e.childNodes[t.shift()];return{node:e,offset:t[0]}}function Wr(e,t){if(t.html!==void 0)return e.innerHTML+=t.html;typeof t=="string"&&(t=e.ownerDocument.createTextNode(t));let{type:r,attributes:n}=t;if(r)if(r==="#comment")t=e.ownerDocument.createComment(n["data-rich-text-comment"]);else{let o=e.namespaceURI;r==="math"?t=e.ownerDocument.createElementNS(Pt,r):o===Pt?e.tagName==="MTEXT"?t=e.ownerDocument.createElement(r):t=e.ownerDocument.createElementNS(Pt,r):t=e.ownerDocument.createElement(r);for(let c in n)t.setAttribute(c,n[c])}return e.appendChild(t)}function Kr(e,t){e.appendData(t)}function zr({lastChild:e}){return e}function Xr({parentNode:e}){return e}function Jr(e){return e.nodeType===e.TEXT_NODE}function Zr({nodeValue:e}){return e}function Gr(e){return e.parentNode.removeChild(e)}function Bt({value:e,prepareEditableTree:t,isEditableTree:r=!0,placeholder:n,doc:o=document}){let c=[],i=[];return t&&(e={...e,formats:t(e)}),{body:vt({value:e,createEmpty:()=>P(o,""),append:Wr,getLastChild:zr,getParent:Xr,isText:Jr,getText:Zr,remove:Gr,appendText:Kr,onStartIndex(u,f){c=Vt(f,u,[f.nodeValue.length])},onEndIndex(u,f){i=Vt(f,u,[f.nodeValue.length])},isEditableTree:r,placeholder:n}),selection:{startPath:c,endPath:i}}}function ge({value:e,current:t,prepareEditableTree:r,__unstableDomOnly:n,placeholder:o}){let{body:c,selection:i}=Bt({value:e,prepareEditableTree:r,placeholder:o,doc:t.ownerDocument});ye(c,t),e.start!==void 0&&!n&&Yr(i,t)}function ye(e,t){let r=0,n;for(;n=e.firstChild;){let o=t.childNodes[r];if(!o)t.appendChild(n);else if(o.isEqualNode(n))e.removeChild(n);else if(o.nodeName!==n.nodeName||o.nodeType===o.TEXT_NODE&&o.data!==n.data)t.replaceChild(n,o);else{let c=o.attributes,i=n.attributes;if(c){let s=c.length;for(;s--;){let{name:a}=c[s];n.getAttribute(a)||o.removeAttribute(a)}}if(i)for(let s=0;s<i.length;s++){let{name:a,value:u}=i[s];o.getAttribute(a)!==u&&o.setAttribute(a,u)}ye(n,o),e.removeChild(n)}r++}for(;t.childNodes[r];)t.removeChild(t.childNodes[r])}function Yr({startPath:e,endPath:t},r){let{node:n,offset:o}=he(r,e),{node:c,offset:i}=he(r,t),{ownerDocument:s}=r,{defaultView:a}=s,u=a.getSelection(),f=s.createRange();f.setStart(n,o),f.setEnd(c,i);let{activeElement:m}=s;if(u.rangeCount>0){if(xt(f,u.getRangeAt(0)))return;u.removeAllRanges()}u.addRange(f),m!==s.activeElement&&m instanceof a.HTMLElement&&m.focus()}var jt=g(Ee(),1),ct=g(be(),1);function xe(e,t){return nt(e,t.type)?(t.title&&(0,jt.speak)((0,ct.sprintf)((0,ct.__)("%s removed."),t.title),"assertive"),Et(e,t.type)):(t.title&&(0,jt.speak)((0,ct.sprintf)((0,ct.__)("%s applied."),t.title),"assertive"),gt(e,t))}var Tt=g(W(),1);function Te(e){let t=(0,Tt.select)(A).getFormatType(e);if(!t){window.console.error(`Format ${e} is not registered.`);return}return(0,Tt.dispatch)(A).removeFormatTypes(e),t}var Le=g(tt(),1),Ce=g(Ae(),1);function Re({ref:e,value:t,settings:r={}}){(0,Ce.default)("`useAnchorRef` hook",{since:"6.1",alternative:"`useAnchor` hook"});let{tagName:n,className:o,name:c}=r,i=c?nt(t,c):void 0;return(0,Le.useMemo)(()=>{if(!e.current)return;let{ownerDocument:{defaultView:s}}=e.current,a=s.getSelection();if(!a.rangeCount)return;let u=a.getRangeAt(0);if(!i)return u;let f=u.startContainer;for(f=f.nextElementSibling||f;f.nodeType!==f.ELEMENT_NODE;)f=f.parentNode;return f.closest(n+(o?"."+o:""))},[i,t.start,t.end,n,o])}var De=g(Ft(),1),Nt=g(tt(),1),Me=g(Oe(),1);function Qr(e,t,r,n){let o=e.startContainer;if(o.nodeType===o.TEXT_NODE&&e.startOffset===o.length&&o.nextSibling)for(o=o.nextSibling;o.firstChild;)o=o.firstChild;if(o.nodeType!==o.ELEMENT_NODE&&(o=o.parentElement),!o||o===t||!t.contains(o))return;let c=r+(n?"."+n:"");for(;o!==t;){if(o.matches(c))return o;o=o.parentElement}}function Ir(e,t){return{contextElement:t,getBoundingClientRect(){return t.contains(e.startContainer)?(0,Me.getRectangleFromRange)(e):t.getBoundingClientRect()}}}function qt(e,t,r){if(!e)return;let{ownerDocument:n}=e,{defaultView:o}=n,c=o.getSelection();if(!c||!c.rangeCount)return;let i=c.getRangeAt(0);if(!i||!i.startContainer)return;let s=Qr(i,e,t,r);return s||Ir(i,e)}function He({editableContentElement:e,settings:t={}}){let{tagName:r,className:n,isActive:o}=t,[c,i]=(0,Nt.useState)(()=>qt(e,r,n)),s=(0,De.usePrevious)(o);return(0,Nt.useLayoutEffect)(()=>{if(!e)return;function a(){i(qt(e,r,n))}function u(){m.addEventListener("selectionchange",a)}function f(){m.removeEventListener("selectionchange",a)}let{ownerDocument:m}=e;return(e===m.activeElement||!s&&o||s&&!o)&&(i(qt(e,r,n)),u()),e.addEventListener("focusin",u),e.addEventListener("focusout",f),()=>{f(),e.removeEventListener("focusin",u),e.removeEventListener("focusout",f)}},[e,r,n,o,s]),c}var H=g(tt(),1),Rt=g(Ft(),1),fr=g(W(),1);var ke=g(tt(),1),tn="pre-wrap",en="1px";function $e(){return(0,ke.useCallback)(e=>{e&&(e.style.whiteSpace=tn,e.style.minWidth=en)},[])}var rn={grad:.9,turn:360,rad:360/(2*Math.PI)},z=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},F=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=Math.pow(10,t)),Math.round(r*e)/r+0},S=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=1),e>r?r:e>t?e:t},ze=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Pe=function(e){return{r:S(e.r,0,255),g:S(e.g,0,255),b:S(e.b,0,255),a:S(e.a)}},Ut=function(e){return{r:F(e.r),g:F(e.g),b:F(e.b),a:F(e.a,3)}},nn=/^#([0-9a-f]{3,8})$/i,At=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Xe=function(e){var t=e.r,r=e.g,n=e.b,o=e.a,c=Math.max(t,r,n),i=c-Math.min(t,r,n),s=i?c===t?(r-n)/i:c===r?2+(n-t)/i:4+(t-r)/i:0;return{h:60*(s<0?s+6:s),s:c?i/c*100:0,v:c/255*100,a:o}},Je=function(e){var t=e.h,r=e.s,n=e.v,o=e.a;t=t/360*6,r/=100,n/=100;var c=Math.floor(t),i=n*(1-r),s=n*(1-(t-c)*r),a=n*(1-(1-t+c)*r),u=c%6;return{r:255*[n,s,i,i,a,n][u],g:255*[a,n,n,s,i,i][u],b:255*[i,i,a,n,n,s][u],a:o}},Ve=function(e){return{h:ze(e.h),s:S(e.s,0,100),l:S(e.l,0,100),a:S(e.a)}},Be=function(e){return{h:F(e.h),s:F(e.s),l:F(e.l),a:F(e.a,3)}},je=function(e){return Je((r=(t=e).s,{h:t.h,s:(r*=((n=t.l)<50?n:100-n)/100)>0?2*r/(n+r)*100:0,v:n+r,a:t.a}));var t,r,n},lt=function(e){return{h:(t=Xe(e)).h,s:(o=(200-(r=t.s))*(n=t.v)/100)>0&&o<200?r*n/100/(o<=100?o:200-o)*100:0,l:o/2,a:t.a};var t,r,n,o},on=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,sn=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,cn=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,an=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,qe={string:[[function(e){var t=nn.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?F(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?F(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=cn.exec(e)||an.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Pe({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=on.exec(e)||sn.exec(e);if(!t)return null;var r,n,o=Ve({h:(r=t[1],n=t[2],n===void 0&&(n="deg"),Number(r)*(rn[n]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return je(o)},"hsl"]],object:[[function(e){var t=e.r,r=e.g,n=e.b,o=e.a,c=o===void 0?1:o;return z(t)&&z(r)&&z(n)?Pe({r:Number(t),g:Number(r),b:Number(n),a:Number(c)}):null},"rgb"],[function(e){var t=e.h,r=e.s,n=e.l,o=e.a,c=o===void 0?1:o;if(!z(t)||!z(r)||!z(n))return null;var i=Ve({h:Number(t),s:Number(r),l:Number(n),a:Number(c)});return je(i)},"hsl"],[function(e){var t=e.h,r=e.s,n=e.v,o=e.a,c=o===void 0?1:o;if(!z(t)||!z(r)||!z(n))return null;var i=(function(s){return{h:ze(s.h),s:S(s.s,0,100),v:S(s.v,0,100),a:S(s.a)}})({h:Number(t),s:Number(r),v:Number(n),a:Number(c)});return Je(i)},"hsv"]]},Ue=function(e,t){for(var r=0;r<t.length;r++){var n=t[r][0](e);if(n)return[n,t[r][1]]}return[null,void 0]},un=function(e){return typeof e=="string"?Ue(e.trim(),qe.string):typeof e=="object"&&e!==null?Ue(e,qe.object):[null,void 0]};var Wt=function(e,t){var r=lt(e);return{h:r.h,s:S(r.s+100*t,0,100),l:r.l,a:r.a}},Kt=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},We=function(e,t){var r=lt(e);return{h:r.h,s:r.s,l:S(r.l+100*t,0,100),a:r.a}},Ke=(function(){function e(t){this.parsed=un(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return this.parsed!==null},e.prototype.brightness=function(){return F(Kt(this.rgba),2)},e.prototype.isDark=function(){return Kt(this.rgba)<.5},e.prototype.isLight=function(){return Kt(this.rgba)>=.5},e.prototype.toHex=function(){return t=Ut(this.rgba),r=t.r,n=t.g,o=t.b,i=(c=t.a)<1?At(F(255*c)):"","#"+At(r)+At(n)+At(o)+i;var t,r,n,o,c,i},e.prototype.toRgb=function(){return Ut(this.rgba)},e.prototype.toRgbString=function(){return t=Ut(this.rgba),r=t.r,n=t.g,o=t.b,(c=t.a)<1?"rgba("+r+", "+n+", "+o+", "+c+")":"rgb("+r+", "+n+", "+o+")";var t,r,n,o,c},e.prototype.toHsl=function(){return Be(lt(this.rgba))},e.prototype.toHslString=function(){return t=Be(lt(this.rgba)),r=t.h,n=t.s,o=t.l,(c=t.a)<1?"hsla("+r+", "+n+"%, "+o+"%, "+c+")":"hsl("+r+", "+n+"%, "+o+"%)";var t,r,n,o,c},e.prototype.toHsv=function(){return t=Xe(this.rgba),{h:F(t.h),s:F(t.s),v:F(t.v),a:F(t.a,3)};var t},e.prototype.invert=function(){return M({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),M(Wt(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),M(Wt(this.rgba,-t))},e.prototype.grayscale=function(){return M(Wt(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),M(We(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),M(We(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?M({r:(r=this.rgba).r,g:r.g,b:r.b,a:t}):F(this.rgba.a,3);var r},e.prototype.hue=function(t){var r=lt(this.rgba);return typeof t=="number"?M({h:t,s:r.s,l:r.l,a:r.a}):F(r.h)},e.prototype.isEqual=function(t){return this.toHex()===M(t).toHex()},e})(),M=function(e){return e instanceof Ke?e:new Ke(e)};var Lt=g(tt(),1);function Ze({record:e}){let t=(0,Lt.useRef)(),{activeFormats:r=[],replacements:n,start:o}=e.current,c=n[o];return(0,Lt.useEffect)(()=>{if((!r||!r.length)&&!c)return;let i="*[data-rich-text-format-boundary]",s=t.current.querySelector(i);if(!s)return;let{ownerDocument:a}=s,{defaultView:u}=a,f=u.getComputedStyle(s),m=M(f.color).alpha(.2).toRgbString(),p=`.rich-text:focus ${i}`,T=`background-color: ${m}`,E=`${p} {${T}}`,v="rich-text-boundary-style",y=a.getElementById(v);y||(y=a.createElement("style"),y.id=v,a.head.appendChild(y)),y.innerHTML!==E&&(y.innerHTML=E)},[r,c]),t}var ut=g(tt(),1),ar=g(Ft(),1);var Ge=e=>t=>{function r(o){let{record:c}=e.current,{ownerDocument:i}=t;if(ot(c.current)||!t.contains(i.activeElement))return;let s=bt(c.current),a=rt(s),u=J({value:s});o.clipboardData.setData("text/plain",a),o.clipboardData.setData("text/html",u),o.clipboardData.setData("rich-text","true"),o.preventDefault(),o.type==="cut"&&i.execCommand("delete")}let{defaultView:n}=t.ownerDocument;return n.addEventListener("copy",r),n.addEventListener("cut",r),()=>{n.removeEventListener("copy",r),n.removeEventListener("cut",r)}};var Ye=()=>e=>{function t(n){let{target:o}=n;if(o===e||o.textContent&&o.isContentEditable)return;let{ownerDocument:c}=o,{defaultView:i}=c,s=i.getSelection();if(s.containsNode(o))return;let a=c.createRange(),u=o.isContentEditable?o:o.closest("[contenteditable]");a.selectNode(u),s.removeAllRanges(),s.addRange(a),n.preventDefault()}function r(n){n.relatedTarget&&!e.contains(n.relatedTarget)&&n.relatedTarget.tagName==="A"&&t(n)}return e.addEventListener("click",t),e.addEventListener("focusin",r),()=>{e.removeEventListener("click",t),e.removeEventListener("focusin",r)}};var at=g(zt(),1);var Ie=[],tr=e=>t=>{function r(n){let{keyCode:o,shiftKey:c,altKey:i,metaKey:s,ctrlKey:a}=n;if(c||i||s||a||o!==at.LEFT&&o!==at.RIGHT)return;let{record:u,applyRecord:f,forceRender:m}=e.current,{text:p,formats:T,start:E,end:v,activeFormats:y=[]}=u.current,w=ot(u.current),{ownerDocument:b}=t,{defaultView:d}=b,{direction:R}=d.getComputedStyle(t),k=R==="rtl"?at.RIGHT:at.LEFT,B=n.keyCode===k;if(w&&y.length===0&&(E===0&&B||v===p.length&&!B)||!w)return;let j=T[E-1]||Ie,q=T[E]||Ie,x=B?j:q,h=y.every((G,Y)=>G===x[Y]),N=y.length;if(h?N<x.length&&N++:N--,N===y.length){u.current._newActiveFormats=x;return}n.preventDefault();let D=(h?x:B?q:j).slice(0,N),$={...u.current,activeFormats:D};u.current=$,f($),m()}return t.addEventListener("keydown",r),()=>{t.removeEventListener("keydown",r)}};var Ct=g(zt(),1);var er=e=>t=>{function r(n){let{keyCode:o}=n,{createRecord:c,handleChange:i}=e.current;if(n.defaultPrevented||o!==Ct.DELETE&&o!==Ct.BACKSPACE)return;let s=c(),{start:a,end:u,text:f}=s;a===0&&u!==0&&u===f.length&&(i(wt(s)),n.preventDefault())}return t.addEventListener("keydown",r),()=>{t.removeEventListener("keydown",r)}};function rr({value:e,start:t,end:r,formats:n}){let o=Math.min(t,r),c=Math.max(t,r),i=e.formats[o-1]||[],s=e.formats[c]||[];for(e.activeFormats=n.map((a,u)=>{if(i[u]){if(Q(a,i[u]))return i[u]}else if(s[u]&&Q(a,s[u]))return s[u];return a});--r>=t;)e.activeFormats.length>0?e.formats[r]=e.activeFormats:delete e.formats[r];return e}var fn=new Set(["insertParagraph","insertOrderedList","insertUnorderedList","insertHorizontalRule","insertLink"]),nr=[],or="data-rich-text-placeholder";function mn(e){let t=e.getSelection(),{anchorNode:r,anchorOffset:n}=t;if(r.nodeType!==r.ELEMENT_NODE)return;let o=r.childNodes[n];!o||o.nodeType!==o.ELEMENT_NODE||!o.hasAttribute(or)||t.collapseToStart()}var ir=e=>t=>{let{ownerDocument:r}=t,{defaultView:n}=r,o=!1;function c(f){if(o)return;let m;f&&(m=f.inputType);let{record:p,applyRecord:T,createRecord:E,handleChange:v}=e.current;if(m&&(m.indexOf("format")===0||fn.has(m))){T(p.current);return}let y=E(),{start:w,activeFormats:b=[]}=p.current,d=rr({value:y,start:w,end:y.start,formats:b});v(d)}function i(){let{record:f,applyRecord:m,createRecord:p,onSelectionChange:T}=e.current;if(t.contentEditable!=="true")return;if(r.activeElement!==t){r.removeEventListener("selectionchange",i);return}if(o)return;let{start:E,end:v,text:y}=p(),w=f.current;if(y!==w.text){c();return}if(E===w.start&&v===w.end){w.text.length===0&&E===0&&mn(n);return}let b={...w,start:E,end:v,activeFormats:w._newActiveFormats,_newActiveFormats:void 0},d=X(b,nr);b.activeFormats=d,f.current=b,m(b,{domOnly:!0}),T(E,v)}function s(){o=!0,r.removeEventListener("selectionchange",i),t.querySelector(`[${or}]`)?.remove()}function a(){o=!1,c({inputType:"insertText"}),r.addEventListener("selectionchange",i)}function u(){let{record:f,isSelected:m,onSelectionChange:p,applyRecord:T}=e.current;t.parentElement.closest('[contenteditable="true"]')||(m?T(f.current,{domOnly:!0}):f.current={...f.current,start:void 0,end:void 0,activeFormats:nr},p(f.current.start,f.current.end),window.queueMicrotask(i),r.addEventListener("selectionchange",i))}return t.addEventListener("input",c),t.addEventListener("compositionstart",s),t.addEventListener("compositionend",a),t.addEventListener("focus",u),()=>{t.removeEventListener("input",c),t.removeEventListener("compositionstart",s),t.removeEventListener("compositionend",a),t.removeEventListener("focus",u)}};var sr=()=>e=>{let{ownerDocument:t}=e,{defaultView:r}=t,n=r?.getSelection(),o;function c(){return n.rangeCount?n.getRangeAt(0):null}function i(s){let a=s.type==="keydown"?"keyup":"pointerup";function u(){t.removeEventListener(a,f),t.removeEventListener("selectionchange",u),t.removeEventListener("input",u)}function f(){u(),!xt(o,c())&&t.dispatchEvent(new Event("selectionchange"))}t.addEventListener(a,f),t.addEventListener("selectionchange",u),t.addEventListener("input",u),o=c()}return e.addEventListener("pointerdown",i),e.addEventListener("keydown",i),()=>{e.removeEventListener("pointerdown",i),e.removeEventListener("keydown",i)}};function cr(){return e=>{let{ownerDocument:t}=e,{defaultView:r}=t,n=null;function o(i){i.defaultPrevented||i.target!==e&&i.target.contains(e)&&(n=e.getAttribute("contenteditable"),e.setAttribute("contenteditable","false"),r.getSelection().removeAllRanges())}function c(){n!==null&&(e.setAttribute("contenteditable",n),n=null)}return r.addEventListener("pointerdown",o),r.addEventListener("pointerup",c),()=>{r.removeEventListener("pointerdown",o),r.removeEventListener("pointerup",c)}}}var ln=[Ge,Ye,tr,er,ir,sr,cr];function ur(e){let t=(0,ut.useRef)(e);(0,ut.useInsertionEffect)(()=>{t.current=e});let r=(0,ut.useMemo)(()=>ln.map(n=>n(t)),[t]);return(0,ar.useRefEffect)(n=>{let o=r.map(c=>c(n));return()=>{o.forEach(c=>c())}},[r])}function mr({value:e="",selectionStart:t,selectionEnd:r,placeholder:n,onSelectionChange:o,preserveWhiteSpace:c,onChange:i,__unstableDisableFormats:s,__unstableIsSelected:a,__unstableDependencies:u=[],__unstableAfterParse:f,__unstableBeforeSerialize:m,__unstableAddInvisibleFormats:p}){let T=(0,fr.useRegistry)(),[,E]=(0,H.useReducer)(()=>({})),v=(0,H.useRef)();function y(){let{ownerDocument:{defaultView:h}}=v.current,N=h.getSelection(),O=N.rangeCount>0?N.getRangeAt(0):null;return L({element:v.current,range:O,__unstableIsEditableTree:!0})}function w(h,{domOnly:N}={}){ge({value:h,current:v.current,prepareEditableTree:p,__unstableDomOnly:N,placeholder:n})}let b=(0,H.useRef)(e),d=(0,H.useRef)();function R(){let h=d.current?.activeFormats;b.current=e,d.current=e,e instanceof V||(d.current=e?V.fromHTMLString(e,{preserveWhiteSpace:c}):V.empty()),d.current={text:d.current.text,formats:d.current.formats,replacements:d.current.replacements,activeFormats:h},s&&(d.current.formats=Array(e.length),d.current.replacements=Array(e.length)),f&&(d.current.formats=f(d.current)),d.current.start=t,d.current.end=r}let k=(0,H.useRef)(!1);d.current?(t!==d.current.start||r!==d.current.end)&&(k.current=a,d.current={...d.current,start:t,end:r,activeFormats:void 0}):(k.current=a,R());function B(h){if(d.current=h,w(h),s)b.current=h.text;else{let $=m?m(h):h.formats;h={...h,formats:$},typeof e=="string"?b.current=J({value:h,preserveWhiteSpace:c}):b.current=new V(h)}let{start:N,end:O,formats:l,text:D}=d.current;T.batch(()=>{o(N,O),i(b.current,{__unstableFormats:l,__unstableText:D})}),E()}function j(){let h=b.current;R();let N=h&&typeof h=="string"&&typeof e=="string"&&h.length!==e.length,O=v.current?.contains(v.current.ownerDocument.activeElement),l=N&&!O;w(d.current,{domOnly:l})}let q=(0,H.useRef)(!1);(0,H.useLayoutEffect)(()=>{q.current&&e!==b.current&&(j(),E())},[e]),(0,H.useLayoutEffect)(()=>{k.current&&(v.current.ownerDocument.activeElement!==v.current&&v.current.focus(),w(d.current),k.current=!1)},[k.current]);let x=(0,Rt.useMergeRefs)([v,$e(),Ze({record:d}),ur({record:d,handleChange:B,applyRecord:w,createRecord:y,isSelected:a,onSelectionChange:o,forceRender:E}),(0,Rt.useRefEffect)(()=>{j(),q.current=!0},[n,...u])]);return{value:d.current,getValue:()=>d.current,onChange:B,ref:x}}function lr(){}return br(pn);})();
//# sourceMappingURL=index.min.js.map