@yoopta/accordion 4.7.0 → 4.7.1-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/index.d.ts +18 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/plugin/index.d.ts +2 -2
- package/dist/plugin/index.d.ts.map +1 -1
- package/dist/renders/AccordionItemContent.d.ts.map +1 -1
- package/dist/types.d.ts +6 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { YooEditor, YooptaBlockPath } from '@yoopta/editor';
|
|
2
|
+
import { AccordionListElement, AccordionListItemProps } from '../types';
|
|
3
|
+
type AccordionElementOptions = {
|
|
4
|
+
items?: number;
|
|
5
|
+
props: AccordionListItemProps;
|
|
6
|
+
};
|
|
7
|
+
type InsertAccordionOptions = AccordionElementOptions & {
|
|
8
|
+
at?: YooptaBlockPath;
|
|
9
|
+
focus?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type AccordionCommands = {
|
|
12
|
+
buildAccordionElements: (editor: YooEditor, options?: Partial<AccordionElementOptions>) => AccordionListElement;
|
|
13
|
+
insertAccordion: (editor: YooEditor, options?: Partial<InsertAccordionOptions>) => void;
|
|
14
|
+
deleteAccordion: (editor: YooEditor, blockId: string) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare const AccordionCommands: AccordionCommands;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgD,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC1G,OAAO,EACL,oBAAoB,EAEpB,sBAAsB,EAGvB,MAAM,UAAU,CAAC;AAElB,KAAK,uBAAuB,GAAG;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,sBAAsB,CAAC;CAC/B,CAAC;AAEF,KAAK,sBAAsB,GAAG,uBAAuB,GAAG;IACtD,EAAE,CAAC,EAAE,eAAe,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,sBAAsB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,uBAAuB,CAAC,KAAK,oBAAoB,CAAC;IAChH,eAAe,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,KAAK,IAAI,CAAC;IACxF,eAAe,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/D,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,iBAwC/B,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ declare module 'slate' {
|
|
|
6
6
|
Element: AccordionListElement | AccordionItemElement | AccordionListItemHeadingElement | AccordionListItemContentElement;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
+
export { AccordionCommands } from './commands';
|
|
9
10
|
export default Accordion;
|
|
10
11
|
export { AccordionItemElement, AccordionListItemProps };
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,+BAA+B,EAC/B,+BAA+B,EAC/B,sBAAsB,EACvB,MAAM,SAAS,CAAC;AACjB,OAAO,cAAc,CAAC;AAEtB,OAAO,QAAQ,OAAO,CAAC;IACrB,UAAU,WAAW;QACnB,OAAO,EACH,oBAAoB,GACpB,oBAAoB,GACpB,+BAA+B,GAC/B,+BAA+B,CAAC;KACrC;CACF;AAED,eAAe,SAAS,CAAC;AACzB,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,+BAA+B,EAC/B,+BAA+B,EAC/B,sBAAsB,EACvB,MAAM,SAAS,CAAC;AACjB,OAAO,cAAc,CAAC;AAEtB,OAAO,QAAQ,OAAO,CAAC;IACrB,UAAU,WAAW;QACnB,OAAO,EACH,oBAAoB,GACpB,oBAAoB,GACpB,+BAA+B,GAC/B,+BAA+B,CAAC;KACrC;CACF;AAED,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,eAAe,SAAS,CAAC;AACzB,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{useYooptaEditor as n,useYooptaReadOnly as o,Elements as i,Blocks as a,
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{useYooptaEditor as n,useYooptaReadOnly as o,Elements as i,Blocks as a,generateId as s,buildBlockData as c,YooptaPlugin as l,buildBlockElementsStructure as d}from"@yoopta/editor";import{forwardRef as p,createElement as f}from"react";function u(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}"function"==typeof SuppressedError&&SuppressedError;const h=(...e)=>e.filter(((e,t,r)=>Boolean(e)&&r.indexOf(e)===t)).join(" ")
|
|
2
2
|
/**
|
|
3
3
|
* @license lucide-react v0.378.0 - ISC
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the ISC license.
|
|
6
6
|
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/;var
|
|
7
|
+
*/;var y={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};
|
|
8
8
|
/**
|
|
9
9
|
* @license lucide-react v0.378.0 - ISC
|
|
10
10
|
*
|
|
11
11
|
* This source code is licensed under the ISC license.
|
|
12
12
|
* See the LICENSE file in the root directory of this source tree.
|
|
13
|
-
*/const
|
|
13
|
+
*/const v=p((({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:i,iconNode:a,...s},c)=>f("svg",{ref:c,...y,width:t,height:t,stroke:e,strokeWidth:n?24*Number(r)/Number(t):r,className:h("lucide",o),...s},[...a.map((([e,t])=>f(e,t))),...Array.isArray(i)?i:[i]]))),g=(e,t)=>{const r=p((({className:r,...n},o)=>{return f(v,{ref:o,iconNode:t,className:h(`lucide-${i=e,i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,r),...n});var i}));return r.displayName=`${e}`,r},m=g("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),b=g("ListCollapse",[["path",{d:"m3 10 2.5-2.5L3 5",key:"i6eama"}],["path",{d:"m3 19 2.5-2.5L3 14",key:"w2gmor"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}]]),w=g("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),_=g("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);
|
|
14
14
|
/**
|
|
15
15
|
* @license lucide-react v0.378.0 - ISC
|
|
16
16
|
*
|
|
@@ -23,4 +23,4 @@ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{useYoopta
|
|
|
23
23
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
24
24
|
* Released under the MIT License.
|
|
25
25
|
*/
|
|
26
|
-
function w(e){return"[object Object]"===Object.prototype.toString.call(e)}function _(e){var t,r;return!1!==w(e)&&(void 0===(t=e.constructor)||!1!==w(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf"))}var O=Symbol.for("immer-nothing"),x=Symbol.for("immer-draftable"),P=Symbol.for("immer-state");function E(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var j=Object.getPrototypeOf;function k(e){return!!e&&!!e[P]}function S(e){return!!e&&(A(e)||Array.isArray(e)||!!e[x]||!!e.constructor?.[x]||D(e)||B(e))}var N=Object.prototype.constructor.toString();function A(e){if(!e||"object"!=typeof e)return!1;const t=j(e);if(null===t)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===N}function C(e,t){0===z(e)?Reflect.ownKeys(e).forEach((r=>{t(r,e[r],e)})):e.forEach(((r,n)=>t(n,r,e)))}function z(e){const t=e[P];return t?t.type_:Array.isArray(e)?1:D(e)?2:B(e)?3:0}function T(e,t){return 2===z(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function R(e,t,r){const n=z(e);2===n?e.set(t,r):3===n?e.add(r):e[t]=r}function D(e){return e instanceof Map}function B(e){return e instanceof Set}function q(e){return e.copy_||e.base_}function L(e,t){if(D(e))return new Map(e);if(B(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&A(e)){if(!j(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const r=Object.getOwnPropertyDescriptors(e);delete r[P];let n=Reflect.ownKeys(r);for(let t=0;t<n.length;t++){const o=n[t],i=r[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(r[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(j(e),r)}function M(e,t=!1){return W(e)||k(e)||!S(e)||(z(e)>1&&(e.set=e.add=e.clear=e.delete=F),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>M(t,!0)))),e}function F(){E(2)}function W(e){return Object.isFrozen(e)}var I,V={};function $(e){const t=V[e];return t||E(0),t}function K(){return I}function J(e,t){t&&($("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Z(e){U(e),e.drafts_.forEach(Y),e.drafts_=null}function U(e){e===I&&(I=e.parent_)}function X(e){return I={drafts_:[],parent_:I,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Y(e){const t=e[P];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function H(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return void 0!==e&&e!==r?(r[P].modified_&&(Z(t),E(4)),S(e)&&(e=G(t,e),t.parent_||ee(t,e)),t.patches_&&$("Patches").generateReplacementPatches_(r[P].base_,e,t.patches_,t.inversePatches_)):e=G(t,r,[]),Z(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==O?e:void 0}function G(e,t,r){if(W(t))return t;const n=t[P];if(!n)return C(t,((o,i)=>Q(e,n,t,o,i,r))),t;if(n.scope_!==e)return t;if(!n.modified_)return ee(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;const t=n.copy_;let o=t,i=!1;3===n.type_&&(o=new Set(t),t.clear(),i=!0),C(o,((o,a)=>Q(e,n,t,o,a,r,i))),ee(e,t,!1),r&&e.patches_&&$("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function Q(e,t,r,n,o,i,a){if(k(o)){const a=G(e,o,i&&t&&3!==t.type_&&!T(t.assigned_,n)?i.concat(n):void 0);if(R(r,n,a),!k(a))return;e.canAutoFreeze_=!1}else a&&r.add(o);if(S(o)&&!W(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;G(e,o),t&&t.scope_.parent_||"symbol"==typeof n||!Object.prototype.propertyIsEnumerable.call(r,n)||ee(e,o)}}function ee(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&M(t,r)}var te={get(e,t){if(t===P)return e;const r=q(e);if(!T(r,t))return function(e,t,r){const n=oe(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}(e,r,t);const n=r[t];return e.finalized_||!S(n)?n:n===ne(e.base_,t)?(ae(e),e.copy_[t]=se(n,e)):n},has:(e,t)=>t in q(e),ownKeys:e=>Reflect.ownKeys(q(e)),set(e,t,r){const n=oe(q(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const n=ne(q(e),t),a=n?.[P];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(((o=r)===(i=n)?0!==o||1/o==1/i:o!=o&&i!=i)&&(void 0!==r||T(e.base_,t)))return!0;ae(e),ie(e)}var o,i;return e.copy_[t]===r&&(void 0!==r||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==ne(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,ae(e),ie(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const r=q(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:n.enumerable,value:r[t]}:n},defineProperty(){E(11)},getPrototypeOf:e=>j(e.base_),setPrototypeOf(){E(12)}},re={};function ne(e,t){const r=e[P];return(r?q(r):e)[t]}function oe(e,t){if(!(t in e))return;let r=j(e);for(;r;){const e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=j(r)}}function ie(e){e.modified_||(e.modified_=!0,e.parent_&&ie(e.parent_))}function ae(e){e.copy_||(e.copy_=L(e.base_,e.scope_.immer_.useStrictShallowCopy_))}C(te,((e,t)=>{re[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),re.deleteProperty=function(e,t){return re.set.call(this,e,t,void 0)},re.set=function(e,t,r){return te.set.call(this,e[0],t,r,e[0])};function se(e,t){const r=D(e)?$("MapSet").proxyMap_(e,t):B(e)?$("MapSet").proxySet_(e,t):function(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:K(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=n,i=te;r&&(o=[n],i=re);const{revoke:a,proxy:s}=Proxy.revocable(o,i);return n.draft_=s,n.revoke_=a,s}(e,t);return(t?t.scope_:K()).drafts_.push(r),r}function ce(e){if(!S(e)||W(e))return e;const t=e[P];let r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=L(e,t.scope_.immer_.useStrictShallowCopy_)}else r=L(e,!0);return C(r,((e,t)=>{R(r,e,ce(t))})),t&&(t.finalized_=!1),r}var le=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,r)=>{if("function"==typeof e&&"function"!=typeof t){const r=t;t=e;const n=this;return function(e=r,...o){return n.produce(e,(e=>t.call(this,e,...o)))}}let n;if("function"!=typeof t&&E(6),void 0!==r&&"function"!=typeof r&&E(7),S(e)){const o=X(this),i=se(e,void 0);let a=!0;try{n=t(i),a=!1}finally{a?Z(o):U(o)}return J(o,r),H(n,o)}if(!e||"object"!=typeof e){if(n=t(e),void 0===n&&(n=e),n===O&&(n=void 0),this.autoFreeze_&&M(n,!0),r){const t=[],o=[];$("Patches").generateReplacementPatches_(e,n,t,o),r(t,o)}return n}E(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...r)=>this.produceWithPatches(t,(t=>e(t,...r)));let r,n;return[this.produce(e,t,((e,t)=>{r=e,n=t})),r,n]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){S(e)||E(8),k(e)&&(e=function(e){k(e)||E(10);return ce(e)}(e));const t=X(this),r=se(e,void 0);return r[P].isManual_=!0,U(t),r}finishDraft(e,t){const r=e&&e[P];r&&r.isManual_||E(9);const{scope_:n}=r;return J(n,t),H(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));const n=$("Patches").applyPatches_;return k(e)?n(e,t):this.produce(e,(e=>n(e,t)))}},de=le.produce;le.produceWithPatches.bind(le),le.setAutoFreeze.bind(le),le.setUseStrictShallowCopy.bind(le),le.applyPatches.bind(le);var pe=le.createDraft.bind(le),fe=le.finishDraft.bind(le),ue={ancestors(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:r=!1}=t,n=ue.levels(e,t);return n=r?n.slice(1):n.slice(0,-1)},common(e,t){for(var r=[],n=0;n<e.length&&n<t.length;n++){var o=e[n];if(o!==t[n])break;r.push(o)}return r},compare(e,t){for(var r=Math.min(e.length,t.length),n=0;n<r;n++){if(e[n]<t[n])return-1;if(e[n]>t[n])return 1}return 0},endsAfter(e,t){var r=e.length-1,n=e.slice(0,r),o=t.slice(0,r),i=e[r],a=t[r];return ue.equals(n,o)&&i>a},endsAt(e,t){var r=e.length,n=e.slice(0,r),o=t.slice(0,r);return ue.equals(n,o)},endsBefore(e,t){var r=e.length-1,n=e.slice(0,r),o=t.slice(0,r),i=e[r],a=t[r];return ue.equals(n,o)&&i<a},equals:(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r])),hasPrevious:e=>e[e.length-1]>0,isAfter:(e,t)=>1===ue.compare(e,t),isAncestor:(e,t)=>e.length<t.length&&0===ue.compare(e,t),isBefore:(e,t)=>-1===ue.compare(e,t),isChild:(e,t)=>e.length===t.length+1&&0===ue.compare(e,t),isCommon:(e,t)=>e.length<=t.length&&0===ue.compare(e,t),isDescendant:(e,t)=>e.length>t.length&&0===ue.compare(e,t),isParent:(e,t)=>e.length+1===t.length&&0===ue.compare(e,t),isPath:e=>Array.isArray(e)&&(0===e.length||"number"==typeof e[0]),isSibling(e,t){if(e.length!==t.length)return!1;var r=e.slice(0,-1),n=t.slice(0,-1);return e[e.length-1]!==t[t.length-1]&&ue.equals(r,n)},levels(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:r=!1}=t,n=[],o=0;o<=e.length;o++)n.push(e.slice(0,o));return r&&n.reverse(),n},next(e){if(0===e.length)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."));var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},operationCanTransformPath(e){switch(e.type){case"insert_node":case"remove_node":case"merge_node":case"split_node":case"move_node":return!0;default:return!1}},parent(e){if(0===e.length)throw new Error("Cannot get the parent path of the root path [".concat(e,"]."));return e.slice(0,-1)},previous(e){if(0===e.length)throw new Error("Cannot get the previous path of a root path [".concat(e,"], because it has no previous index."));var t=e[e.length-1];if(t<=0)throw new Error("Cannot get the previous path of a first child path [".concat(e,"] because it would result in a negative index."));return e.slice(0,-1).concat(t-1)},relative(e,t){if(!ue.isAncestor(t,e)&&!ue.equals(e,t))throw new Error("Cannot get the relative path of [".concat(e,"] inside ancestor [").concat(t,"], because it is not above or equal to the path."));return e.slice(t.length)},transform(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return null;var n=[...e],{affinity:o="forward"}=r;if(0===e.length)return n;switch(t.type){case"insert_node":var{path:i}=t;(ue.equals(i,n)||ue.endsBefore(i,n)||ue.isAncestor(i,n))&&(n[i.length-1]+=1);break;case"remove_node":var{path:a}=t;if(ue.equals(a,n)||ue.isAncestor(a,n))return null;ue.endsBefore(a,n)&&(n[a.length-1]-=1);break;case"merge_node":var{path:s,position:c}=t;ue.equals(s,n)||ue.endsBefore(s,n)?n[s.length-1]-=1:ue.isAncestor(s,n)&&(n[s.length-1]-=1,n[s.length]+=c);break;case"split_node":var{path:l,position:d}=t;if(ue.equals(l,n)){if("forward"===o)n[n.length-1]+=1;else if("backward"!==o)return null}else ue.endsBefore(l,n)?n[l.length-1]+=1:ue.isAncestor(l,n)&&e[l.length]>=d&&(n[l.length-1]+=1,n[l.length]-=d);break;case"move_node":var{path:p,newPath:f}=t;if(ue.equals(p,f))return n;if(ue.isAncestor(p,n)||ue.equals(p,n)){var u=f.slice();return ue.endsBefore(p,f)&&p.length<f.length&&(u[p.length-1]-=1),u.concat(n.slice(p.length))}ue.isSibling(p,f)&&(ue.isAncestor(f,n)||ue.equals(f,n))?ue.endsBefore(p,n)?n[p.length-1]-=1:n[p.length-1]+=1:ue.endsBefore(f,n)||ue.equals(f,n)||ue.isAncestor(f,n)?(ue.endsBefore(p,n)&&(n[p.length-1]-=1),n[f.length-1]+=1):ue.endsBefore(p,n)&&(ue.equals(f,n)&&(n[f.length-1]+=1),n[p.length-1]-=1)}return n}};function he(e){return he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},he(e)}function ye(e){var t=function(e,t){if("object"!==he(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==he(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===he(t)?t:String(t)}function ve(e,t,r){return(t=ye(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ge(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function me(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ge(Object(r),!0).forEach((function(t){ve(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ge(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var be={transform(e,t){e.children=pe(e.children);var r=e.selection&&pe(e.selection);try{r=((e,t,r)=>{switch(r.type){case"insert_node":var{path:n,node:o}=r,i=ze.parent(e,n),a=n[n.length-1];if(a>i.children.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(n,"] because the destination is past the end of the node."));if(i.children.splice(a,0,o),t)for(var[s,c]of je.points(t))t[c]=Fe.transform(s,r);break;case"insert_text":var{path:l,offset:d,text:p}=r;if(0===p.length)break;var f=ze.leaf(e,l),u=f.text.slice(0,d),h=f.text.slice(d);if(f.text=u+p+h,t)for(var[y,v]of je.points(t))t[v]=Fe.transform(y,r);break;case"merge_node":var{path:g}=r,m=ze.get(e,g),b=ue.previous(g),w=ze.get(e,b),_=ze.parent(e,g),O=g[g.length-1];if(Ue.isText(m)&&Ue.isText(w))w.text+=m.text;else{if(Ue.isText(m)||Ue.isText(w))throw new Error('Cannot apply a "merge_node" operation at path ['.concat(g,"] to nodes of different interfaces: ").concat(Ie.stringify(m)," ").concat(Ie.stringify(w)));w.children.push(...m.children)}if(_.children.splice(O,1),t)for(var[x,P]of je.points(t))t[P]=Fe.transform(x,r);break;case"move_node":var{path:E,newPath:j}=r;if(ue.isAncestor(E,j))throw new Error("Cannot move a path [".concat(E,"] to new path [").concat(j,"] because the destination is inside itself."));var k=ze.get(e,E),S=ze.parent(e,E),N=E[E.length-1];S.children.splice(N,1);var A=ue.transform(E,r),C=ze.get(e,ue.parent(A)),z=A[A.length-1];if(C.children.splice(z,0,k),t)for(var[T,R]of je.points(t))t[R]=Fe.transform(T,r);break;case"remove_node":var{path:D}=r,B=D[D.length-1];if(ze.parent(e,D).children.splice(B,1),t)for(var[q,L]of je.points(t)){var M=Fe.transform(q,r);if(null!=t&&null!=M)t[L]=M;else{var F=void 0,W=void 0;for(var[I,V]of ze.texts(e)){if(-1!==ue.compare(V,D)){W=[I,V];break}F=[I,V]}var $=!1;F&&W&&($=ue.equals(W[1],D)?!ue.hasPrevious(W[1]):ue.common(F[1],D).length<ue.common(W[1],D).length),F&&!$?(q.path=F[1],q.offset=F[0].text.length):W?(q.path=W[1],q.offset=0):t=null}}break;case"remove_text":var{path:K,offset:J,text:Z}=r;if(0===Z.length)break;var U=ze.leaf(e,K),X=U.text.slice(0,J),Y=U.text.slice(J+Z.length);if(U.text=X+Y,t)for(var[H,G]of je.points(t))t[G]=Fe.transform(H,r);break;case"set_node":var{path:Q,properties:ee,newProperties:te}=r;if(0===Q.length)throw new Error("Cannot set properties on the root node!");var re=ze.get(e,Q);for(var ne in te){if("children"===ne||"text"===ne)throw new Error('Cannot set the "'.concat(ne,'" property of nodes!'));var oe=te[ne];null==oe?delete re[ne]:re[ne]=oe}for(var ie in ee)te.hasOwnProperty(ie)||delete re[ie];break;case"set_selection":var{newProperties:ae}=r;if(null==ae)t=ae;else{if(null==t){if(!je.isRange(ae))throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(Ie.stringify(ae)," when there is no current selection."));t=me({},ae)}for(var se in ae){var ce=ae[se];if(null==ce){if("anchor"===se||"focus"===se)throw new Error('Cannot remove the "'.concat(se,'" selection property'));delete t[se]}else t[se]=ce}}break;case"split_node":var{path:le,position:de,properties:pe}=r;if(0===le.length)throw new Error('Cannot apply a "split_node" operation at path ['.concat(le,"] because the root node cannot be split."));var fe,he=ze.get(e,le),ye=ze.parent(e,le),ve=le[le.length-1];if(Ue.isText(he)){var ge=he.text.slice(0,de),be=he.text.slice(de);he.text=ge,fe=me(me({},pe),{},{text:be})}else{var we=he.children.slice(0,de),_e=he.children.slice(de);he.children=we,fe=me(me({},pe),{},{children:_e})}if(ye.children.splice(ve+1,0,fe),t)for(var[Oe,xe]of je.points(t))t[xe]=Fe.transform(Oe,r)}return t})(e,r,t)}finally{e.children=fe(e.children),e.selection=r?k(r)?fe(r):r:null}}},we={insertNodes(e,t,r){e.insertNodes(t,r)},liftNodes(e,t){e.liftNodes(t)},mergeNodes(e,t){e.mergeNodes(t)},moveNodes(e,t){e.moveNodes(t)},removeNodes(e,t){e.removeNodes(t)},setNodes(e,t,r){e.setNodes(t,r)},splitNodes(e,t){e.splitNodes(t)},unsetNodes(e,t,r){e.unsetNodes(t,r)},unwrapNodes(e,t){e.unwrapNodes(t)},wrapNodes(e,t,r){e.wrapNodes(t,r)}},_e={collapse(e,t){e.collapse(t)},deselect(e){e.deselect()},move(e,t){e.move(t)},select(e,t){e.select(t)},setPoint(e,t,r){e.setPoint(t,r)},setSelection(e,t){e.setSelection(t)}},Oe=(e,t)=>{for(var r in e){var n=e[r],o=t[r];if(_(n)&&_(o)){if(!Oe(n,o))return!1}else if(Array.isArray(n)&&Array.isArray(o)){if(n.length!==o.length)return!1;for(var i=0;i<n.length;i++)if(n[i]!==o[i])return!1}else if(n!==o)return!1}for(var a in t)if(void 0===e[a]&&void 0!==t[a])return!1;return!0};function xe(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var Pe=["anchor","focus"];function Ee(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var je={edges(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:r=!1}=t,{anchor:n,focus:o}=e;return je.isBackward(e)===r?[n,o]:[o,n]},end(e){var[,t]=je.edges(e);return t},equals:(e,t)=>Fe.equals(e.anchor,t.anchor)&&Fe.equals(e.focus,t.focus),includes(e,t){if(je.isRange(t)){if(je.includes(e,t.anchor)||je.includes(e,t.focus))return!0;var[r,n]=je.edges(e),[o,i]=je.edges(t);return Fe.isBefore(r,o)&&Fe.isAfter(n,i)}var[a,s]=je.edges(e),c=!1,l=!1;return Fe.isPoint(t)?(c=Fe.compare(t,a)>=0,l=Fe.compare(t,s)<=0):(c=ue.compare(t,a.path)>=0,l=ue.compare(t,s.path)<=0),c&&l},intersection(e,t){var r=xe(e,Pe),[n,o]=je.edges(e),[i,a]=je.edges(t),s=Fe.isBefore(n,i)?i:n,c=Fe.isBefore(o,a)?o:a;return Fe.isBefore(c,s)?null:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ee(Object(r),!0).forEach((function(t){ve(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ee(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({anchor:s,focus:c},r)},isBackward(e){var{anchor:t,focus:r}=e;return Fe.isAfter(t,r)},isCollapsed(e){var{anchor:t,focus:r}=e;return Fe.equals(t,r)},isExpanded:e=>!je.isCollapsed(e),isForward:e=>!je.isBackward(e),isRange:e=>_(e)&&Fe.isPoint(e.anchor)&&Fe.isPoint(e.focus),*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=je.edges(e);return t},transform(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return de(e,(e=>{if(null===e)return null;var n,o,{affinity:i="inward"}=r;if("inward"===i){var a=je.isCollapsed(e);je.isForward(e)?(n="forward",o=a?n:"backward"):(n="backward",o=a?n:"forward")}else"outward"===i?je.isForward(e)?(n="backward",o="forward"):(n="forward",o="backward"):(n=i,o=i);var s=Fe.transform(e.anchor,t,{affinity:n}),c=Fe.transform(e.focus,t,{affinity:o});if(!s||!c)return null;e.anchor=s,e.focus=c}))}},ke=e=>_(e)&&ze.isNodeList(e.children)&&!qe.isEditor(e),Se={isAncestor:e=>_(e)&&ze.isNodeList(e.children),isElement:ke,isElementList:e=>Array.isArray(e)&&e.every((e=>Se.isElement(e))),isElementProps:e=>void 0!==e.children,isElementType:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"type";return ke(e)&&e[r]===t},matches(e,t){for(var r in t)if("children"!==r&&e[r]!==t[r])return!1;return!0}},Ne=["children"],Ae=["text"],Ce=new WeakMap,ze={ancestor(e,t){var r=ze.get(e,t);if(Ue.isText(r))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(Ie.stringify(r)));return r},ancestors(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var n of ue.ancestors(t,r)){var o=[ze.ancestor(e,n),n];yield o}}()},child(e,t){if(Ue.isText(e))throw new Error("Cannot get the child of a text node: ".concat(Ie.stringify(e)));var r=e.children[t];if(null==r)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(Ie.stringify(e)));return r},children(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var{reverse:n=!1}=r,o=ze.ancestor(e,t),{children:i}=o,a=n?i.length-1:0;n?a>=0:a<i.length;){var s=ze.child(o,a),c=t.concat(a);yield[s,c],a=n?a-1:a+1}}()},common(e,t,r){var n=ue.common(t,r);return[ze.get(e,n),n]},descendant(e,t){var r=ze.get(e,t);if(qe.isEditor(r))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(Ie.stringify(r)));return r},descendants(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[r,n]of ze.nodes(e,t))0!==n.length&&(yield[r,n])}()},elements(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[r,n]of ze.nodes(e,t))Se.isElement(r)&&(yield[r,n])}()},extractProps:e=>Se.isAncestor(e)?xe(e,Ne):xe(e,Ae),first(e,t){for(var r=t.slice(),n=ze.get(e,r);n&&!Ue.isText(n)&&0!==n.children.length;)n=n.children[0],r.push(0);return[n,r]},fragment(e,t){if(Ue.isText(e))throw new Error("Cannot get a fragment starting from a root text node: ".concat(Ie.stringify(e)));return de({children:e.children},(e=>{var[r,n]=je.edges(t),o=ze.nodes(e,{reverse:!0,pass:e=>{var[,r]=e;return!je.includes(t,r)}});for(var[,i]of o){if(!je.includes(t,i)){var a=ze.parent(e,i),s=i[i.length-1];a.children.splice(s,1)}if(ue.equals(i,n.path)){var c=ze.leaf(e,i);c.text=c.text.slice(0,n.offset)}if(ue.equals(i,r.path)){var l=ze.leaf(e,i);l.text=l.text.slice(r.offset)}}qe.isEditor(e)&&(e.selection=null)})).children},get(e,t){for(var r=e,n=0;n<t.length;n++){var o=t[n];if(Ue.isText(r)||!r.children[o])throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat(Ie.stringify(e)));r=r.children[o]}return r},has(e,t){for(var r=e,n=0;n<t.length;n++){var o=t[n];if(Ue.isText(r)||!r.children[o])return!1;r=r.children[o]}return!0},isNode:e=>Ue.isText(e)||Se.isElement(e)||qe.isEditor(e),isNodeList(e){if(!Array.isArray(e))return!1;var t=Ce.get(e);if(void 0!==t)return t;var r=e.every((e=>ze.isNode(e)));return Ce.set(e,r),r},last(e,t){for(var r=t.slice(),n=ze.get(e,r);n&&!Ue.isText(n)&&0!==n.children.length;){var o=n.children.length-1;n=n.children[o],r.push(o)}return[n,r]},leaf(e,t){var r=ze.get(e,t);if(!Ue.isText(r))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(Ie.stringify(r)));return r},levels(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var n of ue.levels(t,r)){var o=ze.get(e,n);yield[o,n]}}()},matches:(e,t)=>Se.isElement(e)&&Se.isElementProps(t)&&Se.matches(e,t)||Ue.isText(e)&&Ue.isTextProps(t)&&Ue.matches(e,t),nodes(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var{pass:r,reverse:n=!1}=t,{from:o=[],to:i}=t,a=new Set,s=[],c=e;!i||!(n?ue.isBefore(s,i):ue.isAfter(s,i));)if(a.has(c)||(yield[c,s]),a.has(c)||Ue.isText(c)||0===c.children.length||null!=r&&!1!==r([c,s])){if(0===s.length)break;if(!n){var l=ue.next(s);if(ze.has(e,l)){s=l,c=ze.get(e,s);continue}}if(n&&0!==s[s.length-1])s=ue.previous(s),c=ze.get(e,s);else s=ue.parent(s),c=ze.get(e,s),a.add(c)}else{a.add(c);var d=n?c.children.length-1:0;ue.isAncestor(s,o)&&(d=o[s.length]),s=s.concat(d),c=ze.get(e,s)}}()},parent(e,t){var r=ue.parent(t),n=ze.get(e,r);if(Ue.isText(n))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return n},string:e=>Ue.isText(e)?e.text:e.children.map(ze.string).join(""),texts(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[r,n]of ze.nodes(e,t))Ue.isText(r)&&(yield[r,n])}()}};function Te(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Re(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Te(Object(r),!0).forEach((function(t){ve(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Te(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var De={isNodeOperation:e=>De.isOperation(e)&&e.type.endsWith("_node"),isOperation(e){if(!_(e))return!1;switch(e.type){case"insert_node":case"remove_node":return ue.isPath(e.path)&&ze.isNode(e.node);case"insert_text":case"remove_text":return"number"==typeof e.offset&&"string"==typeof e.text&&ue.isPath(e.path);case"merge_node":return"number"==typeof e.position&&ue.isPath(e.path)&&_(e.properties);case"move_node":return ue.isPath(e.path)&&ue.isPath(e.newPath);case"set_node":return ue.isPath(e.path)&&_(e.properties)&&_(e.newProperties);case"set_selection":return null===e.properties&&je.isRange(e.newProperties)||null===e.newProperties&&je.isRange(e.properties)||_(e.properties)&&_(e.newProperties);case"split_node":return ue.isPath(e.path)&&"number"==typeof e.position&&_(e.properties);default:return!1}},isOperationList:e=>Array.isArray(e)&&e.every((e=>De.isOperation(e))),isSelectionOperation:e=>De.isOperation(e)&&e.type.endsWith("_selection"),isTextOperation:e=>De.isOperation(e)&&e.type.endsWith("_text"),inverse(e){switch(e.type){case"insert_node":return Re(Re({},e),{},{type:"remove_node"});case"insert_text":return Re(Re({},e),{},{type:"remove_text"});case"merge_node":return Re(Re({},e),{},{type:"split_node",path:ue.previous(e.path)});case"move_node":var{newPath:t,path:r}=e;if(ue.equals(t,r))return e;if(ue.isSibling(r,t))return Re(Re({},e),{},{path:t,newPath:r});var n=ue.transform(r,e),o=ue.transform(ue.next(r),e);return Re(Re({},e),{},{path:n,newPath:o});case"remove_node":return Re(Re({},e),{},{type:"insert_node"});case"remove_text":return Re(Re({},e),{},{type:"insert_text"});case"set_node":var{properties:i,newProperties:a}=e;return Re(Re({},e),{},{properties:a,newProperties:i});case"set_selection":var{properties:s,newProperties:c}=e;return Re(Re({},e),{},null==s?{properties:c,newProperties:null}:null==c?{properties:null,newProperties:s}:{properties:c,newProperties:s});case"split_node":return Re(Re({},e),{},{type:"merge_node",path:ue.next(e.path)})}}},Be=new WeakMap,qe={above:(e,t)=>e.above(t),addMark(e,t,r){e.addMark(t,r)},after:(e,t,r)=>e.after(t,r),before:(e,t,r)=>e.before(t,r),deleteBackward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:r="character"}=t;e.deleteBackward(r)},deleteForward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:r="character"}=t;e.deleteForward(r)},deleteFragment(e,t){e.deleteFragment(t)},edges:(e,t)=>e.edges(t),elementReadOnly(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.elementReadOnly(t)},end:(e,t)=>e.end(t),first:(e,t)=>e.first(t),fragment:(e,t)=>e.fragment(t),hasBlocks:(e,t)=>e.hasBlocks(t),hasInlines:(e,t)=>e.hasInlines(t),hasPath:(e,t)=>e.hasPath(t),hasTexts:(e,t)=>e.hasTexts(t),insertBreak(e){e.insertBreak()},insertFragment(e,t,r){e.insertFragment(t,r)},insertNode(e,t){e.insertNode(t)},insertSoftBreak(e){e.insertSoftBreak()},insertText(e,t){e.insertText(t)},isBlock:(e,t)=>e.isBlock(t),isEdge:(e,t,r)=>e.isEdge(t,r),isEditor:e=>(e=>{var t=Be.get(e);if(void 0!==t)return t;if(!_(e))return!1;var r="function"==typeof e.addMark&&"function"==typeof e.apply&&"function"==typeof e.deleteFragment&&"function"==typeof e.insertBreak&&"function"==typeof e.insertSoftBreak&&"function"==typeof e.insertFragment&&"function"==typeof e.insertNode&&"function"==typeof e.insertText&&"function"==typeof e.isElementReadOnly&&"function"==typeof e.isInline&&"function"==typeof e.isSelectable&&"function"==typeof e.isVoid&&"function"==typeof e.normalizeNode&&"function"==typeof e.onChange&&"function"==typeof e.removeMark&&"function"==typeof e.getDirtyPaths&&(null===e.marks||_(e.marks))&&(null===e.selection||je.isRange(e.selection))&&ze.isNodeList(e.children)&&De.isOperationList(e.operations);return Be.set(e,r),r})(e),isElementReadOnly:(e,t)=>e.isElementReadOnly(t),isEmpty:(e,t)=>e.isEmpty(t),isEnd:(e,t,r)=>e.isEnd(t,r),isInline:(e,t)=>e.isInline(t),isNormalizing:e=>e.isNormalizing(),isSelectable:(e,t)=>e.isSelectable(t),isStart:(e,t,r)=>e.isStart(t,r),isVoid:(e,t)=>e.isVoid(t),last:(e,t)=>e.last(t),leaf:(e,t,r)=>e.leaf(t,r),levels:(e,t)=>e.levels(t),marks:e=>e.getMarks(),next:(e,t)=>e.next(t),node:(e,t,r)=>e.node(t,r),nodes:(e,t)=>e.nodes(t),normalize(e,t){e.normalize(t)},parent:(e,t,r)=>e.parent(t,r),path:(e,t,r)=>e.path(t,r),pathRef:(e,t,r)=>e.pathRef(t,r),pathRefs:e=>e.pathRefs(),point:(e,t,r)=>e.point(t,r),pointRef:(e,t,r)=>e.pointRef(t,r),pointRefs:e=>e.pointRefs(),positions:(e,t)=>e.positions(t),previous:(e,t)=>e.previous(t),range:(e,t,r)=>e.range(t,r),rangeRef:(e,t,r)=>e.rangeRef(t,r),rangeRefs:e=>e.rangeRefs(),removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){e.setNormalizing(t)},start:(e,t)=>e.start(t),string:(e,t,r)=>e.string(t,r),unhangRange:(e,t,r)=>e.unhangRange(t,r),void:(e,t)=>e.void(t),withoutNormalizing(e,t){e.withoutNormalizing(t)}};function Le(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Me(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Le(Object(r),!0).forEach((function(t){ve(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Le(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Fe={compare(e,t){var r=ue.compare(e.path,t.path);return 0===r?e.offset<t.offset?-1:e.offset>t.offset?1:0:r},isAfter:(e,t)=>1===Fe.compare(e,t),isBefore:(e,t)=>-1===Fe.compare(e,t),equals:(e,t)=>e.offset===t.offset&&ue.equals(e.path,t.path),isPoint:e=>_(e)&&"number"==typeof e.offset&&ue.isPath(e.path),transform(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return de(e,(e=>{if(null===e)return null;var{affinity:n="forward"}=r,{path:o,offset:i}=e;switch(t.type){case"insert_node":case"move_node":e.path=ue.transform(o,t,r);break;case"insert_text":ue.equals(t.path,o)&&(t.offset<i||t.offset===i&&"forward"===n)&&(e.offset+=t.text.length);break;case"merge_node":ue.equals(t.path,o)&&(e.offset+=t.position),e.path=ue.transform(o,t,r);break;case"remove_text":ue.equals(t.path,o)&&t.offset<=i&&(e.offset-=Math.min(i-t.offset,t.text.length));break;case"remove_node":if(ue.equals(t.path,o)||ue.isAncestor(t.path,o))return null;e.path=ue.transform(o,t,r);break;case"split_node":if(ue.equals(t.path,o)){if(t.position===i&&null==n)return null;(t.position<i||t.position===i&&"forward"===n)&&(e.offset-=t.position,e.path=ue.transform(o,t,Me(Me({},r),{},{affinity:"forward"})))}else e.path=ue.transform(o,t,r)}}))}},We=void 0,Ie={setScrubber(e){We=e},stringify:e=>JSON.stringify(e,We)},Ve=["text"],$e=["anchor","focus"];function Ke(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Je(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ke(Object(r),!0).forEach((function(t){ve(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ke(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ze,Ue={equals(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{loose:n=!1}=r;function o(e){return xe(e,Ve)}return Oe(n?o(e):e,n?o(t):t)},isText:e=>_(e)&&"string"==typeof e.text,isTextList:e=>Array.isArray(e)&&e.every((e=>Ue.isText(e))),isTextProps:e=>void 0!==e.text,matches(e,t){for(var r in t)if("text"!==r&&(!e.hasOwnProperty(r)||e[r]!==t[r]))return!1;return!0},decorations(e,t){var r=[Je({},e)];for(var n of t){var o=xe(n,$e),[i,a]=je.edges(n),s=[],c=0,l=i.offset,d=a.offset;for(var p of r){var{length:f}=p.text,u=c;if(c+=f,l<=u&&c<=d)Object.assign(p,o),s.push(p);else if(l!==d&&(l===c||d===u)||l>c||d<u||d===u&&0!==u)s.push(p);else{var h=p,y=void 0,v=void 0;if(d<c){var g=d-u;v=Je(Je({},h),{},{text:h.text.slice(g)}),h=Je(Je({},h),{},{text:h.text.slice(0,g)})}if(l>u){var m=l-u;y=Je(Je({},h),{},{text:h.text.slice(0,m)}),h=Je(Je({},h),{},{text:h.text.slice(m)})}Object.assign(h,o),y&&s.push(y),s.push(h),v&&s.push(v)}}r=s}return r}},Xe=e=>e.selection?e.selection:e.children.length>0?qe.end(e,[]):[0];!function(e){e[e.None=0]="None",e[e.Extend=1]="Extend",e[e.ZWJ=2]="ZWJ",e[e.RI=4]="RI",e[e.Prepend=8]="Prepend",e[e.SpacingMark=16]="SpacingMark",e[e.L=32]="L",e[e.V=64]="V",e[e.T=128]="T",e[e.LV=256]="LV",e[e.LVT=512]="LVT",e[e.ExtPict=1024]="ExtPict",e[e.Any=2048]="Any"}(Ze||(Ze={})),Ze.L,Ze.L,Ze.V,Ze.LV,Ze.LVT,Ze.LV,Ze.V,Ze.V,Ze.T,Ze.LVT,Ze.T,Ze.T,Ze.Any,Ze.Extend,Ze.ZWJ,Ze.Any,Ze.SpacingMark,Ze.Prepend,Ze.Any,Ze.ZWJ,Ze.ExtPict,Ze.RI,Ze.RI;var Ye={delete(e,t){e.delete(t)},insertFragment(e,t,r){e.insertFragment(t,r)},insertText(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};qe.withoutNormalizing(e,(()=>{var{voids:n=!1}=r,{at:o=Xe(e)}=r;if(ue.isPath(o)&&(o=qe.range(e,o)),je.isRange(o))if(je.isCollapsed(o))o=o.anchor;else{var i=je.end(o);if(!n&&qe.void(e,{at:i}))return;var a=je.start(o),s=qe.pointRef(e,a),c=qe.pointRef(e,i);Qe.delete(e,{at:o,voids:n});var l=s.unref(),d=c.unref();o=l||d,Qe.setSelection(e,{anchor:o,focus:o})}if(!(!n&&qe.void(e,{at:o})||qe.elementReadOnly(e,{at:o}))){var{path:p,offset:f}=o;t.length>0&&e.apply({type:"insert_text",path:p,offset:f,text:t})}}))}};function He(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ge(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?He(Object(r),!0).forEach((function(t){ve(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):He(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Qe=Ge(Ge(Ge(Ge({},be),we),_e),Ye);const et="accordion-list-item",tt="accordion-list-item-heading",rt="accordion-list-item-content",nt=new s({type:"Accordion",elements:{"accordion-list":{asRoot:!0,render:t=>{var{extendRender:r}=t,n=p(t,["extendRender"]);const{attributes:o,children:i}=n;return r?r(n):e("div",Object.assign({},o,{children:i}))},children:["accordion-list-item"]},"accordion-list-item":{render:t=>{var{extendRender:r}=t,n=p(t,["extendRender"]);const{attributes:o,children:i}=n;return r?r(n):e("div",Object.assign({},o,{className:"yoo-accordion-border-b"},{children:i}))},children:["accordion-list-item-heading","accordion-list-item-content"],props:{isExpanded:!0}},"accordion-list-item-heading":{render:s=>{var c,{extendRender:l}=s,d=p(s,["extendRender"]);const{attributes:f,children:u,blockId:h,element:y}=d,g=n(),w=o(),_=e=>{var t;e.stopPropagation();const r=i.getParentElementPath(g,h,y),n=i.getElement(g,h,{path:r,type:"accordion-list-item"});n&&i.updateElement(g,h,{type:"accordion-list-item",props:{isExpanded:!(null===(t=n.props)||void 0===t?void 0:t.isExpanded)}},{path:r})},O=i.getParentElementPath(g,h,y),x=i.getElement(g,h,{path:O,type:"accordion-list-item"}),P=null===(c=null==x?void 0:x.props)||void 0===c?void 0:c.isExpanded;return l?l(d):t("div",Object.assign({},f,{onClick:w?_:void 0,className:"yoopta-accordion-list-item-heading yoo-accordion-group"},{children:[e("span",Object.assign({className:"yoo-accordion-break-words hover:yoo-accordion-underline"},{children:u})),t("div",Object.assign({className:"yoo-accordion-absolute yoo-accordion-right-[14px] yoo-accordion-z-10 yoo-accordion-top-1/2 -yoo-accordion-translate-y-1/2 yoo-accordion-flex yoo-accordion-gap-1 yoo-accordion-select-none"},{children:[!w&&t(r,{children:[e("button",Object.assign({type:"button",contentEditable:!1,onClick:e=>{e.preventDefault(),e.stopPropagation();const t=i.getParentElementPath(g,h,y),r=i.getElementChildren(g,h,{path:t,type:"accordion-list"});1!==(null==r?void 0:r.length)?t&&i.deleteElement(g,h,{type:"accordion-list-item",path:t}):a.deleteBlock(g,{blockId:h})},className:"yoopta-button yoo-accordion-opacity-0 group-hover:yoo-accordion-opacity-100 yoo-accordion-transition-opacity"},{children:e(b,{strokeWidth:1,size:16,color:"#000"})})),e("button",Object.assign({type:"button",contentEditable:!1,onClick:e=>{e.preventDefault(),e.stopPropagation();const t=i.getParentElementPath(g,h,y),r=ue.next(t);i.createElement(g,h,{type:"accordion-list-item",props:{isExpanded:!0}},{path:r,focus:!0})},className:"yoopta-button yoo-accordion-mr-2 yoo-accordion-opacity-0 group-hover:yoo-accordion-opacity-100 yoo-accordion-transition-opacity"},{children:e(m,{strokeWidth:1,size:20,color:"#000"})}))]}),e("button",Object.assign({type:"button",contentEditable:!1,onClick:_,className:"yoopta-button"},{children:e(v,{strokeWidth:1,size:20,color:"#000",style:{transform:P?"rotate(180deg)":"rotate(0deg)"},className:"yoo-accordion-transition-transform yoo-accordion-duration-200"})}))]}))]}))}},"accordion-list-item-content":{render:t=>{var r,{extendRender:o}=t,a=p(t,["extendRender"]);const{attributes:s,children:c,blockId:l,element:d}=a,f=n(),u=i.getParentElementPath(f,l,d),h=i.getElement(f,l,{path:u,type:"accordion-list-item"}),y=null===(r=null==h?void 0:h.props)||void 0===r?void 0:r.isExpanded;return o?o(a):e("div",Object.assign({"data-state":y?"open":"closed",className:"yoopta-accordion-list-item-content data-[state=closed]:yoo-accordion-hidden data-[state=closed]:yoo-accordion-animate-accordion-up data-[state=open]:yoo-accordion-animate-accordion-down"},s,{children:e("div",Object.assign({className:"yoo-accordion-pb-4 yoo-accordion-pt-0"},{children:c}))}))}}},events:{onKeyDown:(e,t,{hotkeys:r,currentBlock:n})=>o=>{if(r.isBackspace(o)){if(!t.selection)return;const r=i.getElementChildren(e,n.id,{type:"accordion-list"}),s=i.getElementEntry(e,n.id,{path:t.selection,type:"accordion-list-item"}),c=(null==s?void 0:s[1])||t.selection.anchor.path,l=i.getElement(e,n.id),d=i.isElementEmpty(e,n.id,{type:"accordion-list-item-heading",path:c});if(i.isElementEmpty(e,n.id,{type:"accordion-list-item-content",path:c})&&(null==l?void 0:l.type)===rt)return void o.preventDefault();if(d&&(null==l?void 0:l.type)===tt){if(o.preventDefault(),1===(null==r?void 0:r.length))return void a.deleteBlock(e,{blockId:n.id});if(s){const[,t]=s;i.deleteElement(e,n.id,{type:"accordion-list-item",path:t})}}}if(r.isSelect(o))return o.preventDefault(),void(t.selection&&Qe.select(t,t.selection.anchor.path.slice(0,-1)));if(r.isEnter(o)){o.preventDefault();const t=i.getElement(e,n.id),r=i.getElementEntry(e,n.id,{type:"accordion-list-item"});if((null==t?void 0:t.type)===tt&&r){const[t,o]=r;return void i.updateElement(e,n.id,{type:et,props:{isExpanded:!(null==t?void 0:t.props.isExpanded)}},{path:o})}i.createElement(e,n.id,{type:"accordion-list-item",props:{isExpanded:!0}},{path:"next",focus:!0,split:!1})}}},options:{display:{title:"Accordion",description:"Create collapses",icon:e(g,{size:24})},shortcuts:["accordion"]},parsers:{html:{deserialize:{nodeNames:["DETAILS"],parse:(e,t)=>{if("DETAILS"===e.nodeName){const r=e.querySelector("summary"),n=e.querySelector("p");return c(t,"Accordion",{[tt]:(null==r?void 0:r.textContent)||"",[rt]:(null==n?void 0:n.textContent)||""})}}},serialize:(e,t,r)=>{const{align:n="left",depth:o=0}=r||{};return`<div>${e.children.map((e=>`<details data-meta-align="${n}" data-meta-depth="${o}">${e.children.map((e=>"accordion-list-item-heading"===e.type?`<summary>${e.children.map((e=>e.text)).join("")}</summary>`:`<p>${e.children.map((e=>e.text)).join("")}</p>`)).join("")}</details>`)).join("")}</div>`}}}});!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".yoo-accordion-absolute{position:absolute}.yoo-accordion-right-\\[14px\\]{right:14px}.yoo-accordion-top-1\\/2{top:50%}.yoo-accordion-z-10{z-index:10}.yoo-accordion-mr-2{margin-right:.5rem}.yoo-accordion-flex{display:flex}.-yoo-accordion-translate-y-1\\/2{--tw-translate-y:-50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.yoo-accordion-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.yoo-accordion-gap-1{gap:.25rem}.yoo-accordion-break-words{overflow-wrap:break-word}.yoo-accordion-border-b{border-bottom-width:1px}.yoo-accordion-pb-4{padding-bottom:1rem}.yoo-accordion-pt-0{padding-top:0}.yoo-accordion-opacity-0{opacity:0}.yoo-accordion-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-accordion-transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-accordion-duration-200{transition-duration:.2s}.yoopta-accordion-list{margin:.5rem 0;padding:0}.yoopta-accordion-list-item{--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(48 48 48/var(--tw-bg-opacity));border-color:rgb(82 82 82/var(--tw-border-opacity));border-radius:0;border-width:1px;position:relative;width:100%}.yoopta-accordion-list-item-heading{align-items:center;border-radius:0;border-width:0;cursor:pointer;font-size:1rem;font-weight:500;line-height:1.5rem;margin-bottom:0;padding-bottom:1rem;padding-right:2rem;padding-top:1rem;position:relative;width:100%}.yoopta-accordion-list-item-content{font-size:.875rem;line-height:1.25rem;overflow:hidden}.hover\\:yoo-accordion-underline:hover{text-decoration-line:underline}.yoo-accordion-group:hover .group-hover\\:yoo-accordion-opacity-100{opacity:1}.data-\\[state\\=closed\\]\\:yoo-accordion-hidden[data-state=closed]{display:none}");export{nt as default};
|
|
26
|
+
function O(e){return"[object Object]"===Object.prototype.toString.call(e)}function x(e){var t,r;return!1!==O(e)&&(void 0===(t=e.constructor)||!1!==O(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf"))}var P=Symbol.for("immer-nothing"),E=Symbol.for("immer-draftable"),k=Symbol.for("immer-state");function j(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var S=Object.getPrototypeOf;function N(e){return!!e&&!!e[k]}function A(e){return!!e&&(z(e)||Array.isArray(e)||!!e[E]||!!e.constructor?.[E]||q(e)||L(e))}var C=Object.prototype.constructor.toString();function z(e){if(!e||"object"!=typeof e)return!1;const t=S(e);if(null===t)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===C}function T(e,t){0===R(e)?Reflect.ownKeys(e).forEach((r=>{t(r,e[r],e)})):e.forEach(((r,n)=>t(n,r,e)))}function R(e){const t=e[k];return t?t.type_:Array.isArray(e)?1:q(e)?2:L(e)?3:0}function D(e,t){return 2===R(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function B(e,t,r){const n=R(e);2===n?e.set(t,r):3===n?e.add(r):e[t]=r}function q(e){return e instanceof Map}function L(e){return e instanceof Set}function M(e){return e.copy_||e.base_}function F(e,t){if(q(e))return new Map(e);if(L(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&z(e)){if(!S(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const r=Object.getOwnPropertyDescriptors(e);delete r[k];let n=Reflect.ownKeys(r);for(let t=0;t<n.length;t++){const o=n[t],i=r[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(r[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(S(e),r)}function I(e,t=!1){return V(e)||N(e)||!A(e)||(R(e)>1&&(e.set=e.add=e.clear=e.delete=W),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>I(t,!0)))),e}function W(){j(2)}function V(e){return Object.isFrozen(e)}var $,K={};function J(e){const t=K[e];return t||j(0),t}function Z(){return $}function U(e,t){t&&(J("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function X(e){Y(e),e.drafts_.forEach(G),e.drafts_=null}function Y(e){e===$&&($=e.parent_)}function H(e){return $={drafts_:[],parent_:$,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function G(e){const t=e[k];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Q(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return void 0!==e&&e!==r?(r[k].modified_&&(X(t),j(4)),A(e)&&(e=ee(t,e),t.parent_||re(t,e)),t.patches_&&J("Patches").generateReplacementPatches_(r[k].base_,e,t.patches_,t.inversePatches_)):e=ee(t,r,[]),X(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==P?e:void 0}function ee(e,t,r){if(V(t))return t;const n=t[k];if(!n)return T(t,((o,i)=>te(e,n,t,o,i,r))),t;if(n.scope_!==e)return t;if(!n.modified_)return re(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;const t=n.copy_;let o=t,i=!1;3===n.type_&&(o=new Set(t),t.clear(),i=!0),T(o,((o,a)=>te(e,n,t,o,a,r,i))),re(e,t,!1),r&&e.patches_&&J("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function te(e,t,r,n,o,i,a){if(N(o)){const a=ee(e,o,i&&t&&3!==t.type_&&!D(t.assigned_,n)?i.concat(n):void 0);if(B(r,n,a),!N(a))return;e.canAutoFreeze_=!1}else a&&r.add(o);if(A(o)&&!V(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;ee(e,o),t&&t.scope_.parent_||"symbol"==typeof n||!Object.prototype.propertyIsEnumerable.call(r,n)||re(e,o)}}function re(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&I(t,r)}var ne={get(e,t){if(t===k)return e;const r=M(e);if(!D(r,t))return function(e,t,r){const n=ae(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}(e,r,t);const n=r[t];return e.finalized_||!A(n)?n:n===ie(e.base_,t)?(ce(e),e.copy_[t]=le(n,e)):n},has:(e,t)=>t in M(e),ownKeys:e=>Reflect.ownKeys(M(e)),set(e,t,r){const n=ae(M(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const n=ie(M(e),t),a=n?.[k];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(((o=r)===(i=n)?0!==o||1/o==1/i:o!=o&&i!=i)&&(void 0!==r||D(e.base_,t)))return!0;ce(e),se(e)}var o,i;return e.copy_[t]===r&&(void 0!==r||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==ie(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,ce(e),se(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const r=M(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:n.enumerable,value:r[t]}:n},defineProperty(){j(11)},getPrototypeOf:e=>S(e.base_),setPrototypeOf(){j(12)}},oe={};function ie(e,t){const r=e[k];return(r?M(r):e)[t]}function ae(e,t){if(!(t in e))return;let r=S(e);for(;r;){const e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=S(r)}}function se(e){e.modified_||(e.modified_=!0,e.parent_&&se(e.parent_))}function ce(e){e.copy_||(e.copy_=F(e.base_,e.scope_.immer_.useStrictShallowCopy_))}T(ne,((e,t)=>{oe[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),oe.deleteProperty=function(e,t){return oe.set.call(this,e,t,void 0)},oe.set=function(e,t,r){return ne.set.call(this,e[0],t,r,e[0])};function le(e,t){const r=q(e)?J("MapSet").proxyMap_(e,t):L(e)?J("MapSet").proxySet_(e,t):function(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Z(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=n,i=ne;r&&(o=[n],i=oe);const{revoke:a,proxy:s}=Proxy.revocable(o,i);return n.draft_=s,n.revoke_=a,s}(e,t);return(t?t.scope_:Z()).drafts_.push(r),r}function de(e){if(!A(e)||V(e))return e;const t=e[k];let r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=F(e,t.scope_.immer_.useStrictShallowCopy_)}else r=F(e,!0);return T(r,((e,t)=>{B(r,e,de(t))})),t&&(t.finalized_=!1),r}var pe=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,r)=>{if("function"==typeof e&&"function"!=typeof t){const r=t;t=e;const n=this;return function(e=r,...o){return n.produce(e,(e=>t.call(this,e,...o)))}}let n;if("function"!=typeof t&&j(6),void 0!==r&&"function"!=typeof r&&j(7),A(e)){const o=H(this),i=le(e,void 0);let a=!0;try{n=t(i),a=!1}finally{a?X(o):Y(o)}return U(o,r),Q(n,o)}if(!e||"object"!=typeof e){if(n=t(e),void 0===n&&(n=e),n===P&&(n=void 0),this.autoFreeze_&&I(n,!0),r){const t=[],o=[];J("Patches").generateReplacementPatches_(e,n,t,o),r(t,o)}return n}j(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...r)=>this.produceWithPatches(t,(t=>e(t,...r)));let r,n;return[this.produce(e,t,((e,t)=>{r=e,n=t})),r,n]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){A(e)||j(8),N(e)&&(e=function(e){N(e)||j(10);return de(e)}(e));const t=H(this),r=le(e,void 0);return r[k].isManual_=!0,Y(t),r}finishDraft(e,t){const r=e&&e[k];r&&r.isManual_||j(9);const{scope_:n}=r;return U(n,t),Q(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));const n=J("Patches").applyPatches_;return N(e)?n(e,t):this.produce(e,(e=>n(e,t)))}},fe=pe.produce;pe.produceWithPatches.bind(pe),pe.setAutoFreeze.bind(pe),pe.setUseStrictShallowCopy.bind(pe),pe.applyPatches.bind(pe);var ue=pe.createDraft.bind(pe),he=pe.finishDraft.bind(pe),ye={ancestors(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:r=!1}=t,n=ye.levels(e,t);return n=r?n.slice(1):n.slice(0,-1)},common(e,t){for(var r=[],n=0;n<e.length&&n<t.length;n++){var o=e[n];if(o!==t[n])break;r.push(o)}return r},compare(e,t){for(var r=Math.min(e.length,t.length),n=0;n<r;n++){if(e[n]<t[n])return-1;if(e[n]>t[n])return 1}return 0},endsAfter(e,t){var r=e.length-1,n=e.slice(0,r),o=t.slice(0,r),i=e[r],a=t[r];return ye.equals(n,o)&&i>a},endsAt(e,t){var r=e.length,n=e.slice(0,r),o=t.slice(0,r);return ye.equals(n,o)},endsBefore(e,t){var r=e.length-1,n=e.slice(0,r),o=t.slice(0,r),i=e[r],a=t[r];return ye.equals(n,o)&&i<a},equals:(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r])),hasPrevious:e=>e[e.length-1]>0,isAfter:(e,t)=>1===ye.compare(e,t),isAncestor:(e,t)=>e.length<t.length&&0===ye.compare(e,t),isBefore:(e,t)=>-1===ye.compare(e,t),isChild:(e,t)=>e.length===t.length+1&&0===ye.compare(e,t),isCommon:(e,t)=>e.length<=t.length&&0===ye.compare(e,t),isDescendant:(e,t)=>e.length>t.length&&0===ye.compare(e,t),isParent:(e,t)=>e.length+1===t.length&&0===ye.compare(e,t),isPath:e=>Array.isArray(e)&&(0===e.length||"number"==typeof e[0]),isSibling(e,t){if(e.length!==t.length)return!1;var r=e.slice(0,-1),n=t.slice(0,-1);return e[e.length-1]!==t[t.length-1]&&ye.equals(r,n)},levels(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:r=!1}=t,n=[],o=0;o<=e.length;o++)n.push(e.slice(0,o));return r&&n.reverse(),n},next(e){if(0===e.length)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."));var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},operationCanTransformPath(e){switch(e.type){case"insert_node":case"remove_node":case"merge_node":case"split_node":case"move_node":return!0;default:return!1}},parent(e){if(0===e.length)throw new Error("Cannot get the parent path of the root path [".concat(e,"]."));return e.slice(0,-1)},previous(e){if(0===e.length)throw new Error("Cannot get the previous path of a root path [".concat(e,"], because it has no previous index."));var t=e[e.length-1];if(t<=0)throw new Error("Cannot get the previous path of a first child path [".concat(e,"] because it would result in a negative index."));return e.slice(0,-1).concat(t-1)},relative(e,t){if(!ye.isAncestor(t,e)&&!ye.equals(e,t))throw new Error("Cannot get the relative path of [".concat(e,"] inside ancestor [").concat(t,"], because it is not above or equal to the path."));return e.slice(t.length)},transform(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return null;var n=[...e],{affinity:o="forward"}=r;if(0===e.length)return n;switch(t.type){case"insert_node":var{path:i}=t;(ye.equals(i,n)||ye.endsBefore(i,n)||ye.isAncestor(i,n))&&(n[i.length-1]+=1);break;case"remove_node":var{path:a}=t;if(ye.equals(a,n)||ye.isAncestor(a,n))return null;ye.endsBefore(a,n)&&(n[a.length-1]-=1);break;case"merge_node":var{path:s,position:c}=t;ye.equals(s,n)||ye.endsBefore(s,n)?n[s.length-1]-=1:ye.isAncestor(s,n)&&(n[s.length-1]-=1,n[s.length]+=c);break;case"split_node":var{path:l,position:d}=t;if(ye.equals(l,n)){if("forward"===o)n[n.length-1]+=1;else if("backward"!==o)return null}else ye.endsBefore(l,n)?n[l.length-1]+=1:ye.isAncestor(l,n)&&e[l.length]>=d&&(n[l.length-1]+=1,n[l.length]-=d);break;case"move_node":var{path:p,newPath:f}=t;if(ye.equals(p,f))return n;if(ye.isAncestor(p,n)||ye.equals(p,n)){var u=f.slice();return ye.endsBefore(p,f)&&p.length<f.length&&(u[p.length-1]-=1),u.concat(n.slice(p.length))}ye.isSibling(p,f)&&(ye.isAncestor(f,n)||ye.equals(f,n))?ye.endsBefore(p,n)?n[p.length-1]-=1:n[p.length-1]+=1:ye.endsBefore(f,n)||ye.equals(f,n)||ye.isAncestor(f,n)?(ye.endsBefore(p,n)&&(n[p.length-1]-=1),n[f.length-1]+=1):ye.endsBefore(p,n)&&(ye.equals(f,n)&&(n[f.length-1]+=1),n[p.length-1]-=1)}return n}};function ve(e){return ve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ve(e)}function ge(e){var t=function(e,t){if("object"!==ve(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==ve(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ve(t)?t:String(t)}function me(e,t,r){return(t=ge(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function be(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function we(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?be(Object(r),!0).forEach((function(t){me(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):be(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var _e={transform(e,t){e.children=ue(e.children);var r=e.selection&&ue(e.selection);try{r=((e,t,r)=>{switch(r.type){case"insert_node":var{path:n,node:o}=r,i=Re.parent(e,n),a=n[n.length-1];if(a>i.children.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(n,"] because the destination is past the end of the node."));if(i.children.splice(a,0,o),t)for(var[s,c]of Se.points(t))t[c]=We.transform(s,r);break;case"insert_text":var{path:l,offset:d,text:p}=r;if(0===p.length)break;var f=Re.leaf(e,l),u=f.text.slice(0,d),h=f.text.slice(d);if(f.text=u+p+h,t)for(var[y,v]of Se.points(t))t[v]=We.transform(y,r);break;case"merge_node":var{path:g}=r,m=Re.get(e,g),b=ye.previous(g),w=Re.get(e,b),_=Re.parent(e,g),O=g[g.length-1];if(Ye.isText(m)&&Ye.isText(w))w.text+=m.text;else{if(Ye.isText(m)||Ye.isText(w))throw new Error('Cannot apply a "merge_node" operation at path ['.concat(g,"] to nodes of different interfaces: ").concat($e.stringify(m)," ").concat($e.stringify(w)));w.children.push(...m.children)}if(_.children.splice(O,1),t)for(var[x,P]of Se.points(t))t[P]=We.transform(x,r);break;case"move_node":var{path:E,newPath:k}=r;if(ye.isAncestor(E,k))throw new Error("Cannot move a path [".concat(E,"] to new path [").concat(k,"] because the destination is inside itself."));var j=Re.get(e,E),S=Re.parent(e,E),N=E[E.length-1];S.children.splice(N,1);var A=ye.transform(E,r),C=Re.get(e,ye.parent(A)),z=A[A.length-1];if(C.children.splice(z,0,j),t)for(var[T,R]of Se.points(t))t[R]=We.transform(T,r);break;case"remove_node":var{path:D}=r,B=D[D.length-1];if(Re.parent(e,D).children.splice(B,1),t)for(var[q,L]of Se.points(t)){var M=We.transform(q,r);if(null!=t&&null!=M)t[L]=M;else{var F=void 0,I=void 0;for(var[W,V]of Re.texts(e)){if(-1!==ye.compare(V,D)){I=[W,V];break}F=[W,V]}var $=!1;F&&I&&($=ye.equals(I[1],D)?!ye.hasPrevious(I[1]):ye.common(F[1],D).length<ye.common(I[1],D).length),F&&!$?(q.path=F[1],q.offset=F[0].text.length):I?(q.path=I[1],q.offset=0):t=null}}break;case"remove_text":var{path:K,offset:J,text:Z}=r;if(0===Z.length)break;var U=Re.leaf(e,K),X=U.text.slice(0,J),Y=U.text.slice(J+Z.length);if(U.text=X+Y,t)for(var[H,G]of Se.points(t))t[G]=We.transform(H,r);break;case"set_node":var{path:Q,properties:ee,newProperties:te}=r;if(0===Q.length)throw new Error("Cannot set properties on the root node!");var re=Re.get(e,Q);for(var ne in te){if("children"===ne||"text"===ne)throw new Error('Cannot set the "'.concat(ne,'" property of nodes!'));var oe=te[ne];null==oe?delete re[ne]:re[ne]=oe}for(var ie in ee)te.hasOwnProperty(ie)||delete re[ie];break;case"set_selection":var{newProperties:ae}=r;if(null==ae)t=ae;else{if(null==t){if(!Se.isRange(ae))throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat($e.stringify(ae)," when there is no current selection."));t=we({},ae)}for(var se in ae){var ce=ae[se];if(null==ce){if("anchor"===se||"focus"===se)throw new Error('Cannot remove the "'.concat(se,'" selection property'));delete t[se]}else t[se]=ce}}break;case"split_node":var{path:le,position:de,properties:pe}=r;if(0===le.length)throw new Error('Cannot apply a "split_node" operation at path ['.concat(le,"] because the root node cannot be split."));var fe,ue=Re.get(e,le),he=Re.parent(e,le),ve=le[le.length-1];if(Ye.isText(ue)){var ge=ue.text.slice(0,de),me=ue.text.slice(de);ue.text=ge,fe=we(we({},pe),{},{text:me})}else{var be=ue.children.slice(0,de),_e=ue.children.slice(de);ue.children=be,fe=we(we({},pe),{},{children:_e})}if(he.children.splice(ve+1,0,fe),t)for(var[Oe,xe]of Se.points(t))t[xe]=We.transform(Oe,r)}return t})(e,r,t)}finally{e.children=he(e.children),e.selection=r?N(r)?he(r):r:null}}},Oe={insertNodes(e,t,r){e.insertNodes(t,r)},liftNodes(e,t){e.liftNodes(t)},mergeNodes(e,t){e.mergeNodes(t)},moveNodes(e,t){e.moveNodes(t)},removeNodes(e,t){e.removeNodes(t)},setNodes(e,t,r){e.setNodes(t,r)},splitNodes(e,t){e.splitNodes(t)},unsetNodes(e,t,r){e.unsetNodes(t,r)},unwrapNodes(e,t){e.unwrapNodes(t)},wrapNodes(e,t,r){e.wrapNodes(t,r)}},xe={collapse(e,t){e.collapse(t)},deselect(e){e.deselect()},move(e,t){e.move(t)},select(e,t){e.select(t)},setPoint(e,t,r){e.setPoint(t,r)},setSelection(e,t){e.setSelection(t)}},Pe=(e,t)=>{for(var r in e){var n=e[r],o=t[r];if(x(n)&&x(o)){if(!Pe(n,o))return!1}else if(Array.isArray(n)&&Array.isArray(o)){if(n.length!==o.length)return!1;for(var i=0;i<n.length;i++)if(n[i]!==o[i])return!1}else if(n!==o)return!1}for(var a in t)if(void 0===e[a]&&void 0!==t[a])return!1;return!0};function Ee(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var ke=["anchor","focus"];function je(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var Se={edges(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:r=!1}=t,{anchor:n,focus:o}=e;return Se.isBackward(e)===r?[n,o]:[o,n]},end(e){var[,t]=Se.edges(e);return t},equals:(e,t)=>We.equals(e.anchor,t.anchor)&&We.equals(e.focus,t.focus),includes(e,t){if(Se.isRange(t)){if(Se.includes(e,t.anchor)||Se.includes(e,t.focus))return!0;var[r,n]=Se.edges(e),[o,i]=Se.edges(t);return We.isBefore(r,o)&&We.isAfter(n,i)}var[a,s]=Se.edges(e),c=!1,l=!1;return We.isPoint(t)?(c=We.compare(t,a)>=0,l=We.compare(t,s)<=0):(c=ye.compare(t,a.path)>=0,l=ye.compare(t,s.path)<=0),c&&l},intersection(e,t){var r=Ee(e,ke),[n,o]=Se.edges(e),[i,a]=Se.edges(t),s=We.isBefore(n,i)?i:n,c=We.isBefore(o,a)?o:a;return We.isBefore(c,s)?null:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?je(Object(r),!0).forEach((function(t){me(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):je(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({anchor:s,focus:c},r)},isBackward(e){var{anchor:t,focus:r}=e;return We.isAfter(t,r)},isCollapsed(e){var{anchor:t,focus:r}=e;return We.equals(t,r)},isExpanded:e=>!Se.isCollapsed(e),isForward:e=>!Se.isBackward(e),isRange:e=>x(e)&&We.isPoint(e.anchor)&&We.isPoint(e.focus),*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=Se.edges(e);return t},transform(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return fe(e,(e=>{if(null===e)return null;var n,o,{affinity:i="inward"}=r;if("inward"===i){var a=Se.isCollapsed(e);Se.isForward(e)?(n="forward",o=a?n:"backward"):(n="backward",o=a?n:"forward")}else"outward"===i?Se.isForward(e)?(n="backward",o="forward"):(n="forward",o="backward"):(n=i,o=i);var s=We.transform(e.anchor,t,{affinity:n}),c=We.transform(e.focus,t,{affinity:o});if(!s||!c)return null;e.anchor=s,e.focus=c}))}},Ne=e=>x(e)&&Re.isNodeList(e.children)&&!Me.isEditor(e),Ae={isAncestor:e=>x(e)&&Re.isNodeList(e.children),isElement:Ne,isElementList:e=>Array.isArray(e)&&e.every((e=>Ae.isElement(e))),isElementProps:e=>void 0!==e.children,isElementType:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"type";return Ne(e)&&e[r]===t},matches(e,t){for(var r in t)if("children"!==r&&e[r]!==t[r])return!1;return!0}},Ce=["children"],ze=["text"],Te=new WeakMap,Re={ancestor(e,t){var r=Re.get(e,t);if(Ye.isText(r))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat($e.stringify(r)));return r},ancestors(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var n of ye.ancestors(t,r)){var o=[Re.ancestor(e,n),n];yield o}}()},child(e,t){if(Ye.isText(e))throw new Error("Cannot get the child of a text node: ".concat($e.stringify(e)));var r=e.children[t];if(null==r)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat($e.stringify(e)));return r},children(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var{reverse:n=!1}=r,o=Re.ancestor(e,t),{children:i}=o,a=n?i.length-1:0;n?a>=0:a<i.length;){var s=Re.child(o,a),c=t.concat(a);yield[s,c],a=n?a-1:a+1}}()},common(e,t,r){var n=ye.common(t,r);return[Re.get(e,n),n]},descendant(e,t){var r=Re.get(e,t);if(Me.isEditor(r))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat($e.stringify(r)));return r},descendants(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[r,n]of Re.nodes(e,t))0!==n.length&&(yield[r,n])}()},elements(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[r,n]of Re.nodes(e,t))Ae.isElement(r)&&(yield[r,n])}()},extractProps:e=>Ae.isAncestor(e)?Ee(e,Ce):Ee(e,ze),first(e,t){for(var r=t.slice(),n=Re.get(e,r);n&&!Ye.isText(n)&&0!==n.children.length;)n=n.children[0],r.push(0);return[n,r]},fragment(e,t){if(Ye.isText(e))throw new Error("Cannot get a fragment starting from a root text node: ".concat($e.stringify(e)));return fe({children:e.children},(e=>{var[r,n]=Se.edges(t),o=Re.nodes(e,{reverse:!0,pass:e=>{var[,r]=e;return!Se.includes(t,r)}});for(var[,i]of o){if(!Se.includes(t,i)){var a=Re.parent(e,i),s=i[i.length-1];a.children.splice(s,1)}if(ye.equals(i,n.path)){var c=Re.leaf(e,i);c.text=c.text.slice(0,n.offset)}if(ye.equals(i,r.path)){var l=Re.leaf(e,i);l.text=l.text.slice(r.offset)}}Me.isEditor(e)&&(e.selection=null)})).children},get(e,t){for(var r=e,n=0;n<t.length;n++){var o=t[n];if(Ye.isText(r)||!r.children[o])throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat($e.stringify(e)));r=r.children[o]}return r},has(e,t){for(var r=e,n=0;n<t.length;n++){var o=t[n];if(Ye.isText(r)||!r.children[o])return!1;r=r.children[o]}return!0},isNode:e=>Ye.isText(e)||Ae.isElement(e)||Me.isEditor(e),isNodeList(e){if(!Array.isArray(e))return!1;var t=Te.get(e);if(void 0!==t)return t;var r=e.every((e=>Re.isNode(e)));return Te.set(e,r),r},last(e,t){for(var r=t.slice(),n=Re.get(e,r);n&&!Ye.isText(n)&&0!==n.children.length;){var o=n.children.length-1;n=n.children[o],r.push(o)}return[n,r]},leaf(e,t){var r=Re.get(e,t);if(!Ye.isText(r))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat($e.stringify(r)));return r},levels(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var n of ye.levels(t,r)){var o=Re.get(e,n);yield[o,n]}}()},matches:(e,t)=>Ae.isElement(e)&&Ae.isElementProps(t)&&Ae.matches(e,t)||Ye.isText(e)&&Ye.isTextProps(t)&&Ye.matches(e,t),nodes(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var{pass:r,reverse:n=!1}=t,{from:o=[],to:i}=t,a=new Set,s=[],c=e;!i||!(n?ye.isBefore(s,i):ye.isAfter(s,i));)if(a.has(c)||(yield[c,s]),a.has(c)||Ye.isText(c)||0===c.children.length||null!=r&&!1!==r([c,s])){if(0===s.length)break;if(!n){var l=ye.next(s);if(Re.has(e,l)){s=l,c=Re.get(e,s);continue}}if(n&&0!==s[s.length-1])s=ye.previous(s),c=Re.get(e,s);else s=ye.parent(s),c=Re.get(e,s),a.add(c)}else{a.add(c);var d=n?c.children.length-1:0;ye.isAncestor(s,o)&&(d=o[s.length]),s=s.concat(d),c=Re.get(e,s)}}()},parent(e,t){var r=ye.parent(t),n=Re.get(e,r);if(Ye.isText(n))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return n},string:e=>Ye.isText(e)?e.text:e.children.map(Re.string).join(""),texts(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[r,n]of Re.nodes(e,t))Ye.isText(r)&&(yield[r,n])}()}};function De(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Be(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?De(Object(r),!0).forEach((function(t){me(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):De(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var qe={isNodeOperation:e=>qe.isOperation(e)&&e.type.endsWith("_node"),isOperation(e){if(!x(e))return!1;switch(e.type){case"insert_node":case"remove_node":return ye.isPath(e.path)&&Re.isNode(e.node);case"insert_text":case"remove_text":return"number"==typeof e.offset&&"string"==typeof e.text&&ye.isPath(e.path);case"merge_node":return"number"==typeof e.position&&ye.isPath(e.path)&&x(e.properties);case"move_node":return ye.isPath(e.path)&&ye.isPath(e.newPath);case"set_node":return ye.isPath(e.path)&&x(e.properties)&&x(e.newProperties);case"set_selection":return null===e.properties&&Se.isRange(e.newProperties)||null===e.newProperties&&Se.isRange(e.properties)||x(e.properties)&&x(e.newProperties);case"split_node":return ye.isPath(e.path)&&"number"==typeof e.position&&x(e.properties);default:return!1}},isOperationList:e=>Array.isArray(e)&&e.every((e=>qe.isOperation(e))),isSelectionOperation:e=>qe.isOperation(e)&&e.type.endsWith("_selection"),isTextOperation:e=>qe.isOperation(e)&&e.type.endsWith("_text"),inverse(e){switch(e.type){case"insert_node":return Be(Be({},e),{},{type:"remove_node"});case"insert_text":return Be(Be({},e),{},{type:"remove_text"});case"merge_node":return Be(Be({},e),{},{type:"split_node",path:ye.previous(e.path)});case"move_node":var{newPath:t,path:r}=e;if(ye.equals(t,r))return e;if(ye.isSibling(r,t))return Be(Be({},e),{},{path:t,newPath:r});var n=ye.transform(r,e),o=ye.transform(ye.next(r),e);return Be(Be({},e),{},{path:n,newPath:o});case"remove_node":return Be(Be({},e),{},{type:"insert_node"});case"remove_text":return Be(Be({},e),{},{type:"insert_text"});case"set_node":var{properties:i,newProperties:a}=e;return Be(Be({},e),{},{properties:a,newProperties:i});case"set_selection":var{properties:s,newProperties:c}=e;return Be(Be({},e),{},null==s?{properties:c,newProperties:null}:null==c?{properties:null,newProperties:s}:{properties:c,newProperties:s});case"split_node":return Be(Be({},e),{},{type:"merge_node",path:ye.next(e.path)})}}},Le=new WeakMap,Me={above:(e,t)=>e.above(t),addMark(e,t,r){e.addMark(t,r)},after:(e,t,r)=>e.after(t,r),before:(e,t,r)=>e.before(t,r),deleteBackward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:r="character"}=t;e.deleteBackward(r)},deleteForward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:r="character"}=t;e.deleteForward(r)},deleteFragment(e,t){e.deleteFragment(t)},edges:(e,t)=>e.edges(t),elementReadOnly(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.elementReadOnly(t)},end:(e,t)=>e.end(t),first:(e,t)=>e.first(t),fragment:(e,t)=>e.fragment(t),hasBlocks:(e,t)=>e.hasBlocks(t),hasInlines:(e,t)=>e.hasInlines(t),hasPath:(e,t)=>e.hasPath(t),hasTexts:(e,t)=>e.hasTexts(t),insertBreak(e){e.insertBreak()},insertFragment(e,t,r){e.insertFragment(t,r)},insertNode(e,t){e.insertNode(t)},insertSoftBreak(e){e.insertSoftBreak()},insertText(e,t){e.insertText(t)},isBlock:(e,t)=>e.isBlock(t),isEdge:(e,t,r)=>e.isEdge(t,r),isEditor:e=>(e=>{var t=Le.get(e);if(void 0!==t)return t;if(!x(e))return!1;var r="function"==typeof e.addMark&&"function"==typeof e.apply&&"function"==typeof e.deleteFragment&&"function"==typeof e.insertBreak&&"function"==typeof e.insertSoftBreak&&"function"==typeof e.insertFragment&&"function"==typeof e.insertNode&&"function"==typeof e.insertText&&"function"==typeof e.isElementReadOnly&&"function"==typeof e.isInline&&"function"==typeof e.isSelectable&&"function"==typeof e.isVoid&&"function"==typeof e.normalizeNode&&"function"==typeof e.onChange&&"function"==typeof e.removeMark&&"function"==typeof e.getDirtyPaths&&(null===e.marks||x(e.marks))&&(null===e.selection||Se.isRange(e.selection))&&Re.isNodeList(e.children)&&qe.isOperationList(e.operations);return Le.set(e,r),r})(e),isElementReadOnly:(e,t)=>e.isElementReadOnly(t),isEmpty:(e,t)=>e.isEmpty(t),isEnd:(e,t,r)=>e.isEnd(t,r),isInline:(e,t)=>e.isInline(t),isNormalizing:e=>e.isNormalizing(),isSelectable:(e,t)=>e.isSelectable(t),isStart:(e,t,r)=>e.isStart(t,r),isVoid:(e,t)=>e.isVoid(t),last:(e,t)=>e.last(t),leaf:(e,t,r)=>e.leaf(t,r),levels:(e,t)=>e.levels(t),marks:e=>e.getMarks(),next:(e,t)=>e.next(t),node:(e,t,r)=>e.node(t,r),nodes:(e,t)=>e.nodes(t),normalize(e,t){e.normalize(t)},parent:(e,t,r)=>e.parent(t,r),path:(e,t,r)=>e.path(t,r),pathRef:(e,t,r)=>e.pathRef(t,r),pathRefs:e=>e.pathRefs(),point:(e,t,r)=>e.point(t,r),pointRef:(e,t,r)=>e.pointRef(t,r),pointRefs:e=>e.pointRefs(),positions:(e,t)=>e.positions(t),previous:(e,t)=>e.previous(t),range:(e,t,r)=>e.range(t,r),rangeRef:(e,t,r)=>e.rangeRef(t,r),rangeRefs:e=>e.rangeRefs(),removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){e.setNormalizing(t)},start:(e,t)=>e.start(t),string:(e,t,r)=>e.string(t,r),unhangRange:(e,t,r)=>e.unhangRange(t,r),void:(e,t)=>e.void(t),withoutNormalizing(e,t){e.withoutNormalizing(t)}};function Fe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ie(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Fe(Object(r),!0).forEach((function(t){me(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var We={compare(e,t){var r=ye.compare(e.path,t.path);return 0===r?e.offset<t.offset?-1:e.offset>t.offset?1:0:r},isAfter:(e,t)=>1===We.compare(e,t),isBefore:(e,t)=>-1===We.compare(e,t),equals:(e,t)=>e.offset===t.offset&&ye.equals(e.path,t.path),isPoint:e=>x(e)&&"number"==typeof e.offset&&ye.isPath(e.path),transform(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return fe(e,(e=>{if(null===e)return null;var{affinity:n="forward"}=r,{path:o,offset:i}=e;switch(t.type){case"insert_node":case"move_node":e.path=ye.transform(o,t,r);break;case"insert_text":ye.equals(t.path,o)&&(t.offset<i||t.offset===i&&"forward"===n)&&(e.offset+=t.text.length);break;case"merge_node":ye.equals(t.path,o)&&(e.offset+=t.position),e.path=ye.transform(o,t,r);break;case"remove_text":ye.equals(t.path,o)&&t.offset<=i&&(e.offset-=Math.min(i-t.offset,t.text.length));break;case"remove_node":if(ye.equals(t.path,o)||ye.isAncestor(t.path,o))return null;e.path=ye.transform(o,t,r);break;case"split_node":if(ye.equals(t.path,o)){if(t.position===i&&null==n)return null;(t.position<i||t.position===i&&"forward"===n)&&(e.offset-=t.position,e.path=ye.transform(o,t,Ie(Ie({},r),{},{affinity:"forward"})))}else e.path=ye.transform(o,t,r)}}))}},Ve=void 0,$e={setScrubber(e){Ve=e},stringify:e=>JSON.stringify(e,Ve)},Ke=["text"],Je=["anchor","focus"];function Ze(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ue(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ze(Object(r),!0).forEach((function(t){me(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ze(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Xe,Ye={equals(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{loose:n=!1}=r;function o(e){return Ee(e,Ke)}return Pe(n?o(e):e,n?o(t):t)},isText:e=>x(e)&&"string"==typeof e.text,isTextList:e=>Array.isArray(e)&&e.every((e=>Ye.isText(e))),isTextProps:e=>void 0!==e.text,matches(e,t){for(var r in t)if("text"!==r&&(!e.hasOwnProperty(r)||e[r]!==t[r]))return!1;return!0},decorations(e,t){var r=[Ue({},e)];for(var n of t){var o=Ee(n,Je),[i,a]=Se.edges(n),s=[],c=0,l=i.offset,d=a.offset;for(var p of r){var{length:f}=p.text,u=c;if(c+=f,l<=u&&c<=d)Object.assign(p,o),s.push(p);else if(l!==d&&(l===c||d===u)||l>c||d<u||d===u&&0!==u)s.push(p);else{var h=p,y=void 0,v=void 0;if(d<c){var g=d-u;v=Ue(Ue({},h),{},{text:h.text.slice(g)}),h=Ue(Ue({},h),{},{text:h.text.slice(0,g)})}if(l>u){var m=l-u;y=Ue(Ue({},h),{},{text:h.text.slice(0,m)}),h=Ue(Ue({},h),{},{text:h.text.slice(m)})}Object.assign(h,o),y&&s.push(y),s.push(h),v&&s.push(v)}}r=s}return r}},He=e=>e.selection?e.selection:e.children.length>0?Me.end(e,[]):[0];!function(e){e[e.None=0]="None",e[e.Extend=1]="Extend",e[e.ZWJ=2]="ZWJ",e[e.RI=4]="RI",e[e.Prepend=8]="Prepend",e[e.SpacingMark=16]="SpacingMark",e[e.L=32]="L",e[e.V=64]="V",e[e.T=128]="T",e[e.LV=256]="LV",e[e.LVT=512]="LVT",e[e.ExtPict=1024]="ExtPict",e[e.Any=2048]="Any"}(Xe||(Xe={})),Xe.L,Xe.L,Xe.V,Xe.LV,Xe.LVT,Xe.LV,Xe.V,Xe.V,Xe.T,Xe.LVT,Xe.T,Xe.T,Xe.Any,Xe.Extend,Xe.ZWJ,Xe.Any,Xe.SpacingMark,Xe.Prepend,Xe.Any,Xe.ZWJ,Xe.ExtPict,Xe.RI,Xe.RI;var Ge={delete(e,t){e.delete(t)},insertFragment(e,t,r){e.insertFragment(t,r)},insertText(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Me.withoutNormalizing(e,(()=>{var{voids:n=!1}=r,{at:o=He(e)}=r;if(ye.isPath(o)&&(o=Me.range(e,o)),Se.isRange(o))if(Se.isCollapsed(o))o=o.anchor;else{var i=Se.end(o);if(!n&&Me.void(e,{at:i}))return;var a=Se.start(o),s=Me.pointRef(e,a),c=Me.pointRef(e,i);tt.delete(e,{at:o,voids:n});var l=s.unref(),d=c.unref();o=l||d,tt.setSelection(e,{anchor:o,focus:o})}if(!(!n&&Me.void(e,{at:o})||Me.elementReadOnly(e,{at:o}))){var{path:p,offset:f}=o;t.length>0&&e.apply({type:"insert_text",path:p,offset:f,text:t})}}))}};function Qe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function et(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qe(Object(r),!0).forEach((function(t){me(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var tt=et(et(et(et({},_e),Oe),xe),Ge);const rt={buildAccordionElements:(e,t={})=>{const{props:r={isExpanded:!1},items:n=1}=t,o={id:s(),type:"accordion-list",children:[]};for(let e=0;e<n;e++){const e={id:s(),type:"accordion-list-item-heading",children:[{text:""}]},t={id:s(),type:"accordion-list-item-content",children:[{text:""}]},n={id:s(),type:"accordion-list-item",children:[e,t],props:r};o.children.push(n)}return o},insertAccordion:(e,t={})=>{const{at:r,focus:n,props:o,items:i}=t,s=rt.buildAccordionElements(e,{props:o,items:i});a.insertBlock(e,c({value:[s],type:"Accordion"}),{focus:n,at:r})},deleteAccordion:(e,t)=>{a.deleteBlock(e,{blockId:t})}},nt="accordion-list-item",ot="accordion-list-item-heading",it="accordion-list-item-content",at=new l({type:"Accordion",elements:{"accordion-list":{asRoot:!0,render:t=>{var{extendRender:r}=t,n=u(t,["extendRender"]);const{attributes:o,children:i}=n;return r?r(n):e("div",Object.assign({},o,{children:i}))},children:["accordion-list-item"]},"accordion-list-item":{render:t=>{var{extendRender:r}=t,n=u(t,["extendRender"]);const{attributes:o,children:i}=n;return r?r(n):e("div",Object.assign({},o,{className:"yoo-accordion-border-b"},{children:i}))},children:["accordion-list-item-heading","accordion-list-item-content"],props:{isExpanded:!0}},"accordion-list-item-heading":{render:s=>{var c,{extendRender:l}=s,d=u(s,["extendRender"]);const{attributes:p,children:f,blockId:h,element:y}=d,v=n(),g=o(),b=e=>{var t;e.stopPropagation();const r=i.getParentElementPath(v,h,y),n=i.getElement(v,h,{path:r,type:"accordion-list-item"});n&&i.updateElement(v,h,{type:"accordion-list-item",props:{isExpanded:!(null===(t=n.props)||void 0===t?void 0:t.isExpanded)}},{path:r})},O=i.getParentElementPath(v,h,y),x=i.getElement(v,h,{path:O,type:"accordion-list-item"}),P=null===(c=null==x?void 0:x.props)||void 0===c?void 0:c.isExpanded;return l?l(d):t("div",Object.assign({},p,{onClick:g?b:void 0,className:"yoopta-accordion-list-item-heading yoo-accordion-group"},{children:[e("span",Object.assign({className:"yoo-accordion-break-words hover:yoo-accordion-underline"},{children:f})),t("div",Object.assign({className:"yoo-accordion-absolute yoo-accordion-right-[14px] yoo-accordion-z-10 yoo-accordion-top-1/2 -yoo-accordion-translate-y-1/2 yoo-accordion-flex yoo-accordion-gap-1 yoo-accordion-select-none"},{children:[!g&&t(r,{children:[e("button",Object.assign({type:"button",contentEditable:!1,onClick:e=>{e.preventDefault(),e.stopPropagation();const t=i.getParentElementPath(v,h,y),r=i.getElementChildren(v,h,{path:t,type:"accordion-list"});1!==(null==r?void 0:r.length)?t&&i.deleteElement(v,h,{type:"accordion-list-item",path:t}):a.deleteBlock(v,{blockId:h})},className:"yoopta-button yoo-accordion-opacity-0 group-hover:yoo-accordion-opacity-100 yoo-accordion-transition-opacity"},{children:e(_,{strokeWidth:1,size:16,color:"#000"})})),e("button",Object.assign({type:"button",contentEditable:!1,onClick:e=>{e.preventDefault(),e.stopPropagation();const t=i.getParentElementPath(v,h,y),r=ye.next(t);i.createElement(v,h,{type:"accordion-list-item",props:{isExpanded:!0}},{path:r,focus:!0})},className:"yoopta-button yoo-accordion-mr-2 yoo-accordion-opacity-0 group-hover:yoo-accordion-opacity-100 yoo-accordion-transition-opacity"},{children:e(w,{strokeWidth:1,size:20,color:"#000"})}))]}),e("button",Object.assign({type:"button",contentEditable:!1,onClick:b,className:"yoopta-button"},{children:e(m,{strokeWidth:1,size:20,color:"#000",style:{transform:P?"rotate(180deg)":"rotate(0deg)"},className:"yoo-accordion-transition-transform yoo-accordion-duration-200"})}))]}))]}))}},"accordion-list-item-content":{render:t=>{var r,{extendRender:o}=t,a=u(t,["extendRender"]);const{attributes:s,children:c,blockId:l,element:d}=a,p=n(),f=i.getParentElementPath(p,l,d),h=i.getElement(p,l,{path:f,type:"accordion-list-item"}),y=null===(r=null==h?void 0:h.props)||void 0===r?void 0:r.isExpanded;return o?o(a):e("div",Object.assign({"data-state":y?"open":"closed",className:"yoopta-accordion-list-item-content data-[state=closed]:yoo-accordion-hidden data-[state=closed]:yoo-accordion-animate-accordion-up data-[state=open]:yoo-accordion-animate-accordion-down"},s,{children:e("div",Object.assign({className:"yoo-accordion-pb-4 yoo-accordion-pt-0"},{children:c}))}))}}},commands:rt,events:{onKeyDown:(e,t,{hotkeys:r,currentBlock:n})=>o=>{var s;if(r.isBackspace(o)){if(!t.selection)return;const r=i.getElementChildren(e,n.id,{type:"accordion-list"}),s=i.getElementEntry(e,n.id,{path:t.selection,type:"accordion-list-item"}),c=(null==s?void 0:s[1])||t.selection.anchor.path,l=i.getElement(e,n.id),d=i.isElementEmpty(e,n.id,{type:"accordion-list-item-heading",path:c});if(i.isElementEmpty(e,n.id,{type:"accordion-list-item-content",path:c})&&(null==l?void 0:l.type)===it)return void o.preventDefault();if(d&&(null==l?void 0:l.type)===ot){if(o.preventDefault(),1===(null==r?void 0:r.length))return void a.deleteBlock(e,{blockId:n.id});if(s){const[,t]=s;i.deleteElement(e,n.id,{type:"accordion-list-item",path:t})}}}if(r.isSelect(o))return o.preventDefault(),void(t.selection&&tt.select(t,t.selection.anchor.path.slice(0,-1)));if(r.isEnter(o)){o.preventDefault();const t=i.getElement(e,n.id),r=i.getElementEntry(e,n.id,{type:"accordion-list-item"});if((null==t?void 0:t.type)===ot&&r){const[t,o]=r;return void i.updateElement(e,n.id,{type:nt,props:{isExpanded:!(null===(s=null==t?void 0:t.props)||void 0===s?void 0:s.isExpanded)}},{path:o})}i.createElement(e,n.id,{type:"accordion-list-item",props:{isExpanded:!0}},{path:"next",focus:!0,split:!1})}}},options:{display:{title:"Accordion",description:"Create collapses",icon:e(b,{size:24})},shortcuts:["accordion"]},parsers:{html:{deserialize:{nodeNames:["DETAILS"],parse:(e,t)=>{if("DETAILS"===e.nodeName){const r=e.querySelector("summary"),n=e.querySelector("p");return d(t,"Accordion",{[ot]:(null==r?void 0:r.textContent)||"",[it]:(null==n?void 0:n.textContent)||""})}}},serialize:(e,t,r)=>{const{align:n="left",depth:o=0}=r||{};return`<div>${e.children.map((e=>`<details data-meta-align="${n}" data-meta-depth="${o}">${e.children.map((e=>"accordion-list-item-heading"===e.type?`<summary>${e.children.map((e=>e.text)).join("")}</summary>`:`<p>${e.children.map((e=>e.text)).join("")}</p>`)).join("")}</details>`)).join("")}</div>`}}}});!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".yoo-accordion-absolute{position:absolute}.yoo-accordion-right-\\[14px\\]{right:14px}.yoo-accordion-top-1\\/2{top:50%}.yoo-accordion-z-10{z-index:10}.yoo-accordion-mr-2{margin-right:.5rem}.yoo-accordion-flex{display:flex}.-yoo-accordion-translate-y-1\\/2{--tw-translate-y:-50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.yoo-accordion-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.yoo-accordion-gap-1{gap:.25rem}.yoo-accordion-break-words{overflow-wrap:break-word}.yoo-accordion-border-b{border-bottom-width:1px}.yoo-accordion-pb-4{padding-bottom:1rem}.yoo-accordion-pt-0{padding-top:0}.yoo-accordion-opacity-0{opacity:0}.yoo-accordion-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-accordion-transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-accordion-duration-200{transition-duration:.2s}.yoopta-accordion-list{margin:.5rem 0;padding:0}.yoopta-accordion-list-item{--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(48 48 48/var(--tw-bg-opacity));border-color:rgb(82 82 82/var(--tw-border-opacity));border-radius:0;border-width:1px;position:relative;width:100%}.yoopta-accordion-list-item-heading{align-items:center;border-radius:0;border-width:0;cursor:pointer;font-size:1rem;font-weight:500;line-height:1.5rem;margin-bottom:0;padding-bottom:1rem;padding-right:2rem;padding-top:1rem;position:relative;width:100%}.yoopta-accordion-list-item-content{font-size:.875rem;line-height:1.25rem;overflow:hidden}.hover\\:yoo-accordion-underline:hover{text-decoration-line:underline}.yoo-accordion-group:hover .group-hover\\:yoo-accordion-opacity-100{opacity:1}.data-\\[state\\=closed\\]\\:yoo-accordion-hidden[data-state=closed]{display:none}");export{rt as AccordionCommands,at as default};
|
package/dist/plugin/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { YooptaPlugin } from '@yoopta/editor';
|
|
2
|
-
import {
|
|
3
|
-
declare const Accordion: YooptaPlugin<
|
|
2
|
+
import { AccordionElementMap } from '../types';
|
|
3
|
+
declare const Accordion: YooptaPlugin<AccordionElementMap, Record<string, unknown>>;
|
|
4
4
|
export { Accordion };
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAA+B,MAAM,gBAAgB,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAgB/C,QAAA,MAAM,SAAS,4DA6Jb,CAAC;AAEH,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionItemContent.d.ts","sourceRoot":"","sources":["../../src/renders/AccordionItemContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAY,wBAAwB,EAAmB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"AccordionItemContent.d.ts","sourceRoot":"","sources":["../../src/renders/AccordionItemContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAY,wBAAwB,EAAmB,MAAM,gBAAgB,CAAC;AAErF,eAAO,MAAM,oBAAoB,+BAAgC,wBAAwB,gBAuBxF,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -7,4 +7,10 @@ export type AccordionItemElement = SlateElement<'accordion-list-item', Accordion
|
|
|
7
7
|
export type AccordionListElement = SlateElement<'accordion-list'>;
|
|
8
8
|
export type AccordionListItemHeadingElement = SlateElement<'accordion-list-item-heading'>;
|
|
9
9
|
export type AccordionListItemContentElement = SlateElement<'accordion-list-item-content'>;
|
|
10
|
+
export type AccordionElementMap = {
|
|
11
|
+
'accordion-list': AccordionListElement;
|
|
12
|
+
'accordion-list-item': AccordionItemElement;
|
|
13
|
+
'accordion-list-item-heading': AccordionListItemHeadingElement;
|
|
14
|
+
'accordion-list-item-content': AccordionListItemContentElement;
|
|
15
|
+
};
|
|
10
16
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,MAAM,oBAAoB,GAC5B,gBAAgB,GAChB,qBAAqB,GACrB,6BAA6B,GAC7B,6BAA6B,CAAC;AAElC,MAAM,MAAM,sBAAsB,GAAG;IACnC,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,YAAY,CAAC,qBAAqB,EAAE,sBAAsB,CAAC,CAAC;AAC/F,MAAM,MAAM,oBAAoB,GAAG,YAAY,CAAC,gBAAgB,CAAC,CAAC;AAClE,MAAM,MAAM,+BAA+B,GAAG,YAAY,CAAC,6BAA6B,CAAC,CAAC;AAC1F,MAAM,MAAM,+BAA+B,GAAG,YAAY,CAAC,6BAA6B,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,MAAM,oBAAoB,GAC5B,gBAAgB,GAChB,qBAAqB,GACrB,6BAA6B,GAC7B,6BAA6B,CAAC;AAElC,MAAM,MAAM,sBAAsB,GAAG;IACnC,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,YAAY,CAAC,qBAAqB,EAAE,sBAAsB,CAAC,CAAC;AAC/F,MAAM,MAAM,oBAAoB,GAAG,YAAY,CAAC,gBAAgB,CAAC,CAAC;AAClE,MAAM,MAAM,+BAA+B,GAAG,YAAY,CAAC,6BAA6B,CAAC,CAAC;AAC1F,MAAM,MAAM,+BAA+B,GAAG,YAAY,CAAC,6BAA6B,CAAC,CAAC;AAE1F,MAAM,MAAM,mBAAmB,GAAG;IAChC,gBAAgB,EAAE,oBAAoB,CAAC;IACvC,qBAAqB,EAAE,oBAAoB,CAAC;IAC5C,6BAA6B,EAAE,+BAA+B,CAAC;IAC/D,6BAA6B,EAAE,+BAA+B,CAAC;CAChE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yoopta/accordion",
|
|
3
|
-
"version": "4.7.0",
|
|
3
|
+
"version": "4.7.1-rc.0",
|
|
4
4
|
"description": "Accordion plugin for Yoopta Editor",
|
|
5
5
|
"author": "Darginec05 <devopsbanda@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/Darginec05/Editor-Yoopta#readme",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"bugs": {
|
|
38
38
|
"url": "https://github.com/Darginec05/Editor-Yoopta/issues"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "63bfe2afb5f9d7b3a8c49584d0ac8bdc5b2dcf1f"
|
|
41
41
|
}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/renders/AccordionList.tsx","../src/renders/AccordionListItem.tsx","../../../../node_modules/shared/src/utils.ts","../../../../node_modules/lucide-react/src/defaultAttributes.ts","../../../../node_modules/lucide-react/src/Icon.ts","../../../../node_modules/lucide-react/src/createLucideIcon.ts","../../../../node_modules/lucide-react/src/icons/chevron-up.ts","../../../../node_modules/lucide-react/src/icons/list-collapse.ts","../../../../node_modules/lucide-react/src/icons/plus.ts","../../../../node_modules/lucide-react/src/icons/trash.ts","../../../../node_modules/is-plain-object/dist/is-plain-object.mjs","../../../../node_modules/immer/src/utils/env.ts","../../../../node_modules/immer/src/utils/errors.ts","../../../../node_modules/immer/src/utils/common.ts","../../../../node_modules/immer/src/utils/plugins.ts","../../../../node_modules/immer/src/core/scope.ts","../../../../node_modules/immer/src/core/finalize.ts","../../../../node_modules/immer/src/core/proxy.ts","../../../../node_modules/immer/src/core/immerClass.ts","../../../../node_modules/immer/src/core/current.ts","../../../../node_modules/immer/src/immer.ts","../../../../node_modules/slate/src/interfaces/path.ts","../../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/esm/typeof.js","../../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/esm/defineProperty.js","../../../../node_modules/slate/src/interfaces/transforms/general.ts","../../../../node_modules/slate/src/interfaces/transforms/node.ts","../../../../node_modules/slate/src/interfaces/transforms/selection.ts","../../../../node_modules/slate/src/utils/deep-equal.ts","../../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../../../../../../../.yarn/berry/cache/@babel-runtime-npm-7.23.2-d013d6cf7e-10.zip/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","../../../../node_modules/slate/src/interfaces/range.ts","../../../../node_modules/slate/src/interfaces/element.ts","../../../../node_modules/slate/src/interfaces/node.ts","../../../../node_modules/slate/src/interfaces/operation.ts","../../../../node_modules/slate/src/editor/is-editor.ts","../../../../node_modules/slate/src/interfaces/editor.ts","../../../../node_modules/slate/src/interfaces/point.ts","../../../../node_modules/slate/src/interfaces/scrubber.ts","../../../../node_modules/slate/src/interfaces/text.ts","../../../../node_modules/slate/src/utils/get-default-insert-location.ts","../../../../node_modules/slate/src/utils/string.ts","../../../../node_modules/slate/src/interfaces/transforms/text.ts","../../../../node_modules/slate/src/interfaces/transforms/index.ts","../src/renders/AccordionItemHeading.tsx","../src/renders/AccordionItemContent.tsx","../src/plugin/index.tsx","../../../../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["import { PluginElementRenderProps } from '@yoopta/editor';\n\nexport const AccordionList = ({ extendRender, ...props }: PluginElementRenderProps) => {\n const { attributes, children } = props;\n\n if (extendRender) return extendRender(props);\n\n return <div {...attributes}>{children}</div>;\n};\n","import { PluginElementRenderProps } from '@yoopta/editor';\n\nexport const AccordionListItem = ({ extendRender, ...props }: PluginElementRenderProps) => {\n const { attributes, children } = props;\n\n if (extendRender) return extendRender(props);\n\n return (\n <div {...attributes} className=\"yoo-accordion-border-b\">\n {children}\n </div>\n );\n};\n","import { CamelToPascal } from './utility-types';\n\n/**\n * Converts string to kebab case\n *\n * @param {string} string\n * @returns {string} A kebabized string\n */\nexport const toKebabCase = (string: string) =>\n string.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n\n/**\n * Converts string to pascal case\n *\n * @param {string} string\n * @returns {string} A pascalized string\n */\nexport const toPascalCase = <T extends string>(string: T): CamelToPascal<T> => {\n const camelCase = string.replace(/^([A-Z])|[\\s-_]+(\\w)/g, (match, p1, p2) =>\n p2 ? p2.toUpperCase() : p1.toLowerCase(),\n );\n\n return (camelCase.charAt(0).toUpperCase() + camelCase.slice(1)) as CamelToPascal<T>;\n};\n\n/**\n * Merges classes into a single string\n *\n * @param {array} classes\n * @returns {string} A string of classes\n */\nexport const mergeClasses = <ClassType = string | undefined | null>(...classes: ClassType[]) =>\n classes\n .filter((className, index, array) => {\n return Boolean(className) && array.indexOf(className) === index;\n })\n .join(' ');\n","export default {\n xmlns: 'http://www.w3.org/2000/svg',\n width: 24,\n height: 24,\n viewBox: '0 0 24 24',\n fill: 'none',\n stroke: 'currentColor',\n strokeWidth: 2,\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n};\n","import { createElement, forwardRef } from 'react';\nimport defaultAttributes from './defaultAttributes';\nimport { IconNode, LucideProps } from './types';\nimport { mergeClasses } from '@lucide/shared';\n\ninterface IconComponentProps extends LucideProps {\n iconNode: IconNode;\n}\n\n/**\n * Lucide icon component\n *\n * @component Icon\n * @param {object} props\n * @param {string} props.color - The color of the icon\n * @param {number} props.size - The size of the icon\n * @param {number} props.strokeWidth - The stroke width of the icon\n * @param {boolean} props.absoluteStrokeWidth - Whether to use absolute stroke width\n * @param {string} props.className - The class name of the icon\n * @param {IconNode} props.children - The children of the icon\n * @param {IconNode} props.iconNode - The icon node of the icon\n *\n * @returns {ForwardRefExoticComponent} LucideIcon\n */\nconst Icon = forwardRef<SVGSVGElement, IconComponentProps>(\n (\n {\n color = 'currentColor',\n size = 24,\n strokeWidth = 2,\n absoluteStrokeWidth,\n className = '',\n children,\n iconNode,\n ...rest\n },\n ref,\n ) => {\n return createElement(\n 'svg',\n {\n ref,\n ...defaultAttributes,\n width: size,\n height: size,\n stroke: color,\n strokeWidth: absoluteStrokeWidth ? (Number(strokeWidth) * 24) / Number(size) : strokeWidth,\n className: mergeClasses('lucide', className),\n ...rest,\n },\n [\n ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n ...(Array.isArray(children) ? children : [children]),\n ],\n );\n },\n);\n\nexport default Icon;\n","import { createElement, forwardRef } from 'react';\nimport { mergeClasses, toKebabCase } from '@lucide/shared';\nimport { IconNode, LucideProps } from './types';\nimport Icon from './Icon';\n\n/**\n * Create a Lucide icon component\n * @param {string} iconName\n * @param {array} iconNode\n * @returns {ForwardRefExoticComponent} LucideIcon\n */\nconst createLucideIcon = (iconName: string, iconNode: IconNode) => {\n const Component = forwardRef<SVGSVGElement, LucideProps>(({ className, ...props }, ref) =>\n createElement(Icon, {\n ref,\n iconNode,\n className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className),\n ...props,\n }),\n );\n\n Component.displayName = `${iconName}`;\n\n return Component;\n};\n\nexport default createLucideIcon;\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ChevronUp\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/chevron-up\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ChevronUp = createLucideIcon('ChevronUp', [['path', { d: 'm18 15-6-6-6 6', key: '153udz' }]]);\n\nexport default ChevronUp;\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ListCollapse\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/list-collapse\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ListCollapse = createLucideIcon('ListCollapse', [\n ['path', { d: 'm3 10 2.5-2.5L3 5', key: 'i6eama' }],\n ['path', { d: 'm3 19 2.5-2.5L3 14', key: 'w2gmor' }],\n ['path', { d: 'M10 6h11', key: 'c7qv1k' }],\n ['path', { d: 'M10 12h11', key: '6m4ad9' }],\n ['path', { d: 'M10 18h11', key: '11hvi2' }],\n]);\n\nexport default ListCollapse;\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Plus\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/plus\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Plus = createLucideIcon('Plus', [\n ['path', { d: 'M5 12h14', key: '1ays0h' }],\n ['path', { d: 'M12 5v14', key: 's699le' }],\n]);\n\nexport default Plus;\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Trash\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/trash\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Trash = createLucideIcon('Trash', [\n ['path', { d: 'M3 6h18', key: 'd0wm0j' }],\n ['path', { d: 'M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6', key: '4alrt4' }],\n ['path', { d: 'M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2', key: 'v07s0e' }],\n]);\n\nexport default Trash;\n","/*!\n * is-plain-object <https://github.com/jonschlinkert/is-plain-object>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\n\nfunction isObject(o) {\n return Object.prototype.toString.call(o) === '[object Object]';\n}\n\nfunction isPlainObject(o) {\n var ctor,prot;\n\n if (isObject(o) === false) return false;\n\n // If has modified constructor\n ctor = o.constructor;\n if (ctor === undefined) return true;\n\n // If has modified prototype\n prot = ctor.prototype;\n if (isObject(prot) === false) return false;\n\n // If constructor does not have an Object-specific method\n if (prot.hasOwnProperty('isPrototypeOf') === false) {\n return false;\n }\n\n // Most likely a plain Object\n return true;\n}\n\nexport { isPlainObject };\n","// Should be no imports here!\n\n/**\n * The sentinel value returned by producers to replace the draft with undefined.\n */\nexport const NOTHING: unique symbol = Symbol.for(\"immer-nothing\")\n\n/**\n * To let Immer treat your class instances as plain immutable objects\n * (albeit with a custom prototype), you must define either an instance property\n * or a static property on each of your custom classes.\n *\n * Otherwise, your class instance will never be drafted, which means it won't be\n * safe to mutate in a produce callback.\n */\nexport const DRAFTABLE: unique symbol = Symbol.for(\"immer-draftable\")\n\nexport const DRAFT_STATE: unique symbol = Symbol.for(\"immer-state\")\n","export const errors =\n\tprocess.env.NODE_ENV !== \"production\"\n\t\t? [\n\t\t\t\t// All error codes, starting by 0:\n\t\t\t\tfunction(plugin: string) {\n\t\t\t\t\treturn `The plugin for '${plugin}' has not been loaded into Immer. To enable the plugin, import and call \\`enable${plugin}()\\` when initializing your application.`\n\t\t\t\t},\n\t\t\t\tfunction(thing: string) {\n\t\t\t\t\treturn `produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${thing}'`\n\t\t\t\t},\n\t\t\t\t\"This object has been frozen and should not be mutated\",\n\t\t\t\tfunction(data: any) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t\"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? \" +\n\t\t\t\t\t\tdata\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t\t\"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.\",\n\t\t\t\t\"Immer forbids circular references\",\n\t\t\t\t\"The first or second argument to `produce` must be a function\",\n\t\t\t\t\"The third argument to `produce` must be a function or undefined\",\n\t\t\t\t\"First argument to `createDraft` must be a plain object, an array, or an immerable object\",\n\t\t\t\t\"First argument to `finishDraft` must be a draft returned by `createDraft`\",\n\t\t\t\tfunction(thing: string) {\n\t\t\t\t\treturn `'current' expects a draft, got: ${thing}`\n\t\t\t\t},\n\t\t\t\t\"Object.defineProperty() cannot be used on an Immer draft\",\n\t\t\t\t\"Object.setPrototypeOf() cannot be used on an Immer draft\",\n\t\t\t\t\"Immer only supports deleting array indices\",\n\t\t\t\t\"Immer only supports setting array indices and the 'length' property\",\n\t\t\t\tfunction(thing: string) {\n\t\t\t\t\treturn `'original' expects a draft, got: ${thing}`\n\t\t\t\t}\n\t\t\t\t// Note: if more errors are added, the errorOffset in Patches.ts should be increased\n\t\t\t\t// See Patches.ts for additional errors\n\t\t ]\n\t\t: []\n\nexport function die(error: number, ...args: any[]): never {\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tconst e = errors[error]\n\t\tconst msg = typeof e === \"function\" ? e.apply(null, args as any) : e\n\t\tthrow new Error(`[Immer] ${msg}`)\n\t}\n\tthrow new Error(\n\t\t`[Immer] minified error nr: ${error}. Full error at: https://bit.ly/3cXEKWf`\n\t)\n}\n","import {\n\tDRAFT_STATE,\n\tDRAFTABLE,\n\tObjectish,\n\tDrafted,\n\tAnyObject,\n\tAnyMap,\n\tAnySet,\n\tImmerState,\n\tArchType,\n\tdie\n} from \"../internal\"\n\nexport const getPrototypeOf = Object.getPrototypeOf\n\n/** Returns true if the given value is an Immer draft */\n/*#__PURE__*/\nexport function isDraft(value: any): boolean {\n\treturn !!value && !!value[DRAFT_STATE]\n}\n\n/** Returns true if the given value can be drafted by Immer */\n/*#__PURE__*/\nexport function isDraftable(value: any): boolean {\n\tif (!value) return false\n\treturn (\n\t\tisPlainObject(value) ||\n\t\tArray.isArray(value) ||\n\t\t!!value[DRAFTABLE] ||\n\t\t!!value.constructor?.[DRAFTABLE] ||\n\t\tisMap(value) ||\n\t\tisSet(value)\n\t)\n}\n\nconst objectCtorString = Object.prototype.constructor.toString()\n/*#__PURE__*/\nexport function isPlainObject(value: any): boolean {\n\tif (!value || typeof value !== \"object\") return false\n\tconst proto = getPrototypeOf(value)\n\tif (proto === null) {\n\t\treturn true\n\t}\n\tconst Ctor =\n\t\tObject.hasOwnProperty.call(proto, \"constructor\") && proto.constructor\n\n\tif (Ctor === Object) return true\n\n\treturn (\n\t\ttypeof Ctor == \"function\" &&\n\t\tFunction.toString.call(Ctor) === objectCtorString\n\t)\n}\n\n/** Get the underlying object that is represented by the given draft */\n/*#__PURE__*/\nexport function original<T>(value: T): T | undefined\nexport function original(value: Drafted<any>): any {\n\tif (!isDraft(value)) die(15, value)\n\treturn value[DRAFT_STATE].base_\n}\n\n/**\n * Each iterates a map, set or array.\n * Or, if any other kind of of object all it's own properties.\n * Regardless whether they are enumerable or symbols\n */\nexport function each<T extends Objectish>(\n\tobj: T,\n\titer: (key: string | number, value: any, source: T) => void\n): void\nexport function each(obj: any, iter: any) {\n\tif (getArchtype(obj) === ArchType.Object) {\n\t\tReflect.ownKeys(obj).forEach(key => {\n\t\t\titer(key, obj[key], obj)\n\t\t})\n\t} else {\n\t\tobj.forEach((entry: any, index: any) => iter(index, entry, obj))\n\t}\n}\n\n/*#__PURE__*/\nexport function getArchtype(thing: any): ArchType {\n\tconst state: undefined | ImmerState = thing[DRAFT_STATE]\n\treturn state\n\t\t? state.type_\n\t\t: Array.isArray(thing)\n\t\t? ArchType.Array\n\t\t: isMap(thing)\n\t\t? ArchType.Map\n\t\t: isSet(thing)\n\t\t? ArchType.Set\n\t\t: ArchType.Object\n}\n\n/*#__PURE__*/\nexport function has(thing: any, prop: PropertyKey): boolean {\n\treturn getArchtype(thing) === ArchType.Map\n\t\t? thing.has(prop)\n\t\t: Object.prototype.hasOwnProperty.call(thing, prop)\n}\n\n/*#__PURE__*/\nexport function get(thing: AnyMap | AnyObject, prop: PropertyKey): any {\n\t// @ts-ignore\n\treturn getArchtype(thing) === ArchType.Map ? thing.get(prop) : thing[prop]\n}\n\n/*#__PURE__*/\nexport function set(thing: any, propOrOldValue: PropertyKey, value: any) {\n\tconst t = getArchtype(thing)\n\tif (t === ArchType.Map) thing.set(propOrOldValue, value)\n\telse if (t === ArchType.Set) {\n\t\tthing.add(value)\n\t} else thing[propOrOldValue] = value\n}\n\n/*#__PURE__*/\nexport function is(x: any, y: any): boolean {\n\t// From: https://github.com/facebook/fbjs/blob/c69904a511b900266935168223063dd8772dfc40/packages/fbjs/src/core/shallowEqual.js\n\tif (x === y) {\n\t\treturn x !== 0 || 1 / x === 1 / y\n\t} else {\n\t\treturn x !== x && y !== y\n\t}\n}\n\n/*#__PURE__*/\nexport function isMap(target: any): target is AnyMap {\n\treturn target instanceof Map\n}\n\n/*#__PURE__*/\nexport function isSet(target: any): target is AnySet {\n\treturn target instanceof Set\n}\n/*#__PURE__*/\nexport function latest(state: ImmerState): any {\n\treturn state.copy_ || state.base_\n}\n\n/*#__PURE__*/\nexport function shallowCopy(base: any, strict: boolean) {\n\tif (isMap(base)) {\n\t\treturn new Map(base)\n\t}\n\tif (isSet(base)) {\n\t\treturn new Set(base)\n\t}\n\tif (Array.isArray(base)) return Array.prototype.slice.call(base)\n\n\tif (!strict && isPlainObject(base)) {\n\t\tif (!getPrototypeOf(base)) {\n\t\t\tconst obj = Object.create(null)\n\t\t\treturn Object.assign(obj, base)\n\t\t}\n\t\treturn {...base}\n\t}\n\n\tconst descriptors = Object.getOwnPropertyDescriptors(base)\n\tdelete descriptors[DRAFT_STATE as any]\n\tlet keys = Reflect.ownKeys(descriptors)\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tconst key: any = keys[i]\n\t\tconst desc = descriptors[key]\n\t\tif (desc.writable === false) {\n\t\t\tdesc.writable = true\n\t\t\tdesc.configurable = true\n\t\t}\n\t\t// like object.assign, we will read any _own_, get/set accessors. This helps in dealing\n\t\t// with libraries that trap values, like mobx or vue\n\t\t// unlike object.assign, non-enumerables will be copied as well\n\t\tif (desc.get || desc.set)\n\t\t\tdescriptors[key] = {\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true, // could live with !!desc.set as well here...\n\t\t\t\tenumerable: desc.enumerable,\n\t\t\t\tvalue: base[key]\n\t\t\t}\n\t}\n\treturn Object.create(getPrototypeOf(base), descriptors)\n}\n\n/**\n * Freezes draftable objects. Returns the original object.\n * By default freezes shallowly, but if the second argument is `true` it will freeze recursively.\n *\n * @param obj\n * @param deep\n */\nexport function freeze<T>(obj: T, deep?: boolean): T\nexport function freeze<T>(obj: any, deep: boolean = false): T {\n\tif (isFrozen(obj) || isDraft(obj) || !isDraftable(obj)) return obj\n\tif (getArchtype(obj) > 1 /* Map or Set */) {\n\t\tobj.set = obj.add = obj.clear = obj.delete = dontMutateFrozenCollections as any\n\t}\n\tObject.freeze(obj)\n\tif (deep)\n\t\t// See #590, don't recurse into non-enumerable / Symbol properties when freezing\n\t\t// So use Object.entries (only string-like, enumerables) instead of each()\n\t\tObject.entries(obj).forEach(([key, value]) => freeze(value, true))\n\treturn obj\n}\n\nfunction dontMutateFrozenCollections() {\n\tdie(2)\n}\n\nexport function isFrozen(obj: any): boolean {\n\treturn Object.isFrozen(obj)\n}\n","import {\n\tImmerState,\n\tPatch,\n\tDrafted,\n\tImmerBaseState,\n\tAnyMap,\n\tAnySet,\n\tArchType,\n\tdie\n} from \"../internal\"\n\n/** Plugin utilities */\nconst plugins: {\n\tPatches?: {\n\t\tgeneratePatches_(\n\t\t\tstate: ImmerState,\n\t\t\tbasePath: PatchPath,\n\t\t\tpatches: Patch[],\n\t\t\tinversePatches: Patch[]\n\t\t): void\n\t\tgenerateReplacementPatches_(\n\t\t\tbase: any,\n\t\t\treplacement: any,\n\t\t\tpatches: Patch[],\n\t\t\tinversePatches: Patch[]\n\t\t): void\n\t\tapplyPatches_<T>(draft: T, patches: Patch[]): T\n\t}\n\tMapSet?: {\n\t\tproxyMap_<T extends AnyMap>(target: T, parent?: ImmerState): T\n\t\tproxySet_<T extends AnySet>(target: T, parent?: ImmerState): T\n\t}\n} = {}\n\ntype Plugins = typeof plugins\n\nexport function getPlugin<K extends keyof Plugins>(\n\tpluginKey: K\n): Exclude<Plugins[K], undefined> {\n\tconst plugin = plugins[pluginKey]\n\tif (!plugin) {\n\t\tdie(0, pluginKey)\n\t}\n\t// @ts-ignore\n\treturn plugin\n}\n\nexport function loadPlugin<K extends keyof Plugins>(\n\tpluginKey: K,\n\timplementation: Plugins[K]\n): void {\n\tif (!plugins[pluginKey]) plugins[pluginKey] = implementation\n}\n/** Map / Set plugin */\n\nexport interface MapState extends ImmerBaseState {\n\ttype_: ArchType.Map\n\tcopy_: AnyMap | undefined\n\tassigned_: Map<any, boolean> | undefined\n\tbase_: AnyMap\n\trevoked_: boolean\n\tdraft_: Drafted<AnyMap, MapState>\n}\n\nexport interface SetState extends ImmerBaseState {\n\ttype_: ArchType.Set\n\tcopy_: AnySet | undefined\n\tbase_: AnySet\n\tdrafts_: Map<any, Drafted> // maps the original value to the draft value in the new set\n\trevoked_: boolean\n\tdraft_: Drafted<AnySet, SetState>\n}\n\n/** Patches plugin */\n\nexport type PatchPath = (string | number)[]\n","import {\n\tPatch,\n\tPatchListener,\n\tDrafted,\n\tImmer,\n\tDRAFT_STATE,\n\tImmerState,\n\tArchType,\n\tgetPlugin\n} from \"../internal\"\n\n/** Each scope represents a `produce` call. */\n\nexport interface ImmerScope {\n\tpatches_?: Patch[]\n\tinversePatches_?: Patch[]\n\tcanAutoFreeze_: boolean\n\tdrafts_: any[]\n\tparent_?: ImmerScope\n\tpatchListener_?: PatchListener\n\timmer_: Immer\n\tunfinalizedDrafts_: number\n}\n\nlet currentScope: ImmerScope | undefined\n\nexport function getCurrentScope() {\n\treturn currentScope!\n}\n\nfunction createScope(\n\tparent_: ImmerScope | undefined,\n\timmer_: Immer\n): ImmerScope {\n\treturn {\n\t\tdrafts_: [],\n\t\tparent_,\n\t\timmer_,\n\t\t// Whenever the modified draft contains a draft from another scope, we\n\t\t// need to prevent auto-freezing so the unowned draft can be finalized.\n\t\tcanAutoFreeze_: true,\n\t\tunfinalizedDrafts_: 0\n\t}\n}\n\nexport function usePatchesInScope(\n\tscope: ImmerScope,\n\tpatchListener?: PatchListener\n) {\n\tif (patchListener) {\n\t\tgetPlugin(\"Patches\") // assert we have the plugin\n\t\tscope.patches_ = []\n\t\tscope.inversePatches_ = []\n\t\tscope.patchListener_ = patchListener\n\t}\n}\n\nexport function revokeScope(scope: ImmerScope) {\n\tleaveScope(scope)\n\tscope.drafts_.forEach(revokeDraft)\n\t// @ts-ignore\n\tscope.drafts_ = null\n}\n\nexport function leaveScope(scope: ImmerScope) {\n\tif (scope === currentScope) {\n\t\tcurrentScope = scope.parent_\n\t}\n}\n\nexport function enterScope(immer: Immer) {\n\treturn (currentScope = createScope(currentScope, immer))\n}\n\nfunction revokeDraft(draft: Drafted) {\n\tconst state: ImmerState = draft[DRAFT_STATE]\n\tif (state.type_ === ArchType.Object || state.type_ === ArchType.Array)\n\t\tstate.revoke_()\n\telse state.revoked_ = true\n}\n","import {\n\tImmerScope,\n\tDRAFT_STATE,\n\tisDraftable,\n\tNOTHING,\n\tPatchPath,\n\teach,\n\thas,\n\tfreeze,\n\tImmerState,\n\tisDraft,\n\tSetState,\n\tset,\n\tArchType,\n\tgetPlugin,\n\tdie,\n\trevokeScope,\n\tisFrozen\n} from \"../internal\"\n\nexport function processResult(result: any, scope: ImmerScope) {\n\tscope.unfinalizedDrafts_ = scope.drafts_.length\n\tconst baseDraft = scope.drafts_![0]\n\tconst isReplaced = result !== undefined && result !== baseDraft\n\tif (isReplaced) {\n\t\tif (baseDraft[DRAFT_STATE].modified_) {\n\t\t\trevokeScope(scope)\n\t\t\tdie(4)\n\t\t}\n\t\tif (isDraftable(result)) {\n\t\t\t// Finalize the result in case it contains (or is) a subset of the draft.\n\t\t\tresult = finalize(scope, result)\n\t\t\tif (!scope.parent_) maybeFreeze(scope, result)\n\t\t}\n\t\tif (scope.patches_) {\n\t\t\tgetPlugin(\"Patches\").generateReplacementPatches_(\n\t\t\t\tbaseDraft[DRAFT_STATE].base_,\n\t\t\t\tresult,\n\t\t\t\tscope.patches_,\n\t\t\t\tscope.inversePatches_!\n\t\t\t)\n\t\t}\n\t} else {\n\t\t// Finalize the base draft.\n\t\tresult = finalize(scope, baseDraft, [])\n\t}\n\trevokeScope(scope)\n\tif (scope.patches_) {\n\t\tscope.patchListener_!(scope.patches_, scope.inversePatches_!)\n\t}\n\treturn result !== NOTHING ? result : undefined\n}\n\nfunction finalize(rootScope: ImmerScope, value: any, path?: PatchPath) {\n\t// Don't recurse in tho recursive data structures\n\tif (isFrozen(value)) return value\n\n\tconst state: ImmerState = value[DRAFT_STATE]\n\t// A plain object, might need freezing, might contain drafts\n\tif (!state) {\n\t\teach(value, (key, childValue) =>\n\t\t\tfinalizeProperty(rootScope, state, value, key, childValue, path)\n\t\t)\n\t\treturn value\n\t}\n\t// Never finalize drafts owned by another scope.\n\tif (state.scope_ !== rootScope) return value\n\t// Unmodified draft, return the (frozen) original\n\tif (!state.modified_) {\n\t\tmaybeFreeze(rootScope, state.base_, true)\n\t\treturn state.base_\n\t}\n\t// Not finalized yet, let's do that now\n\tif (!state.finalized_) {\n\t\tstate.finalized_ = true\n\t\tstate.scope_.unfinalizedDrafts_--\n\t\tconst result = state.copy_\n\t\t// Finalize all children of the copy\n\t\t// For sets we clone before iterating, otherwise we can get in endless loop due to modifying during iteration, see #628\n\t\t// To preserve insertion order in all cases we then clear the set\n\t\t// And we let finalizeProperty know it needs to re-add non-draft children back to the target\n\t\tlet resultEach = result\n\t\tlet isSet = false\n\t\tif (state.type_ === ArchType.Set) {\n\t\t\tresultEach = new Set(result)\n\t\t\tresult.clear()\n\t\t\tisSet = true\n\t\t}\n\t\teach(resultEach, (key, childValue) =>\n\t\t\tfinalizeProperty(rootScope, state, result, key, childValue, path, isSet)\n\t\t)\n\t\t// everything inside is frozen, we can freeze here\n\t\tmaybeFreeze(rootScope, result, false)\n\t\t// first time finalizing, let's create those patches\n\t\tif (path && rootScope.patches_) {\n\t\t\tgetPlugin(\"Patches\").generatePatches_(\n\t\t\t\tstate,\n\t\t\t\tpath,\n\t\t\t\trootScope.patches_,\n\t\t\t\trootScope.inversePatches_!\n\t\t\t)\n\t\t}\n\t}\n\treturn state.copy_\n}\n\nfunction finalizeProperty(\n\trootScope: ImmerScope,\n\tparentState: undefined | ImmerState,\n\ttargetObject: any,\n\tprop: string | number,\n\tchildValue: any,\n\trootPath?: PatchPath,\n\ttargetIsSet?: boolean\n) {\n\tif (process.env.NODE_ENV !== \"production\" && childValue === targetObject)\n\t\tdie(5)\n\tif (isDraft(childValue)) {\n\t\tconst path =\n\t\t\trootPath &&\n\t\t\tparentState &&\n\t\t\tparentState!.type_ !== ArchType.Set && // Set objects are atomic since they have no keys.\n\t\t\t!has((parentState as Exclude<ImmerState, SetState>).assigned_!, prop) // Skip deep patches for assigned keys.\n\t\t\t\t? rootPath!.concat(prop)\n\t\t\t\t: undefined\n\t\t// Drafts owned by `scope` are finalized here.\n\t\tconst res = finalize(rootScope, childValue, path)\n\t\tset(targetObject, prop, res)\n\t\t// Drafts from another scope must prevented to be frozen\n\t\t// if we got a draft back from finalize, we're in a nested produce and shouldn't freeze\n\t\tif (isDraft(res)) {\n\t\t\trootScope.canAutoFreeze_ = false\n\t\t} else return\n\t} else if (targetIsSet) {\n\t\ttargetObject.add(childValue)\n\t}\n\t// Search new objects for unfinalized drafts. Frozen objects should never contain drafts.\n\tif (isDraftable(childValue) && !isFrozen(childValue)) {\n\t\tif (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) {\n\t\t\t// optimization: if an object is not a draft, and we don't have to\n\t\t\t// deepfreeze everything, and we are sure that no drafts are left in the remaining object\n\t\t\t// cause we saw and finalized all drafts already; we can stop visiting the rest of the tree.\n\t\t\t// This benefits especially adding large data tree's without further processing.\n\t\t\t// See add-data.js perf test\n\t\t\treturn\n\t\t}\n\t\tfinalize(rootScope, childValue)\n\t\t// Immer deep freezes plain objects, so if there is no parent state, we freeze as well\n\t\t// Per #590, we never freeze symbolic properties. Just to make sure don't accidentally interfere\n\t\t// with other frameworks.\n\t\tif (\n\t\t\t(!parentState || !parentState.scope_.parent_) &&\n\t\t\ttypeof prop !== \"symbol\" &&\n\t\t\tObject.prototype.propertyIsEnumerable.call(targetObject, prop)\n\t\t)\n\t\t\tmaybeFreeze(rootScope, childValue)\n\t}\n}\n\nfunction maybeFreeze(scope: ImmerScope, value: any, deep = false) {\n\t// we never freeze for a non-root scope; as it would prevent pruning for drafts inside wrapping objects\n\tif (!scope.parent_ && scope.immer_.autoFreeze_ && scope.canAutoFreeze_) {\n\t\tfreeze(value, deep)\n\t}\n}\n","import {\n\teach,\n\thas,\n\tis,\n\tisDraftable,\n\tshallowCopy,\n\tlatest,\n\tImmerBaseState,\n\tImmerState,\n\tDrafted,\n\tAnyObject,\n\tAnyArray,\n\tObjectish,\n\tgetCurrentScope,\n\tgetPrototypeOf,\n\tDRAFT_STATE,\n\tdie,\n\tcreateProxy,\n\tArchType,\n\tImmerScope\n} from \"../internal\"\n\ninterface ProxyBaseState extends ImmerBaseState {\n\tassigned_: {\n\t\t[property: string]: boolean\n\t}\n\tparent_?: ImmerState\n\trevoke_(): void\n}\n\nexport interface ProxyObjectState extends ProxyBaseState {\n\ttype_: ArchType.Object\n\tbase_: any\n\tcopy_: any\n\tdraft_: Drafted<AnyObject, ProxyObjectState>\n}\n\nexport interface ProxyArrayState extends ProxyBaseState {\n\ttype_: ArchType.Array\n\tbase_: AnyArray\n\tcopy_: AnyArray | null\n\tdraft_: Drafted<AnyArray, ProxyArrayState>\n}\n\ntype ProxyState = ProxyObjectState | ProxyArrayState\n\n/**\n * Returns a new draft of the `base` object.\n *\n * The second argument is the parent draft-state (used internally).\n */\nexport function createProxyProxy<T extends Objectish>(\n\tbase: T,\n\tparent?: ImmerState\n): Drafted<T, ProxyState> {\n\tconst isArray = Array.isArray(base)\n\tconst state: ProxyState = {\n\t\ttype_: isArray ? ArchType.Array : (ArchType.Object as any),\n\t\t// Track which produce call this is associated with.\n\t\tscope_: parent ? parent.scope_ : getCurrentScope()!,\n\t\t// True for both shallow and deep changes.\n\t\tmodified_: false,\n\t\t// Used during finalization.\n\t\tfinalized_: false,\n\t\t// Track which properties have been assigned (true) or deleted (false).\n\t\tassigned_: {},\n\t\t// The parent draft state.\n\t\tparent_: parent,\n\t\t// The base state.\n\t\tbase_: base,\n\t\t// The base proxy.\n\t\tdraft_: null as any, // set below\n\t\t// The base copy with any updated values.\n\t\tcopy_: null,\n\t\t// Called by the `produce` function.\n\t\trevoke_: null as any,\n\t\tisManual_: false\n\t}\n\n\t// the traps must target something, a bit like the 'real' base.\n\t// but also, we need to be able to determine from the target what the relevant state is\n\t// (to avoid creating traps per instance to capture the state in closure,\n\t// and to avoid creating weird hidden properties as well)\n\t// So the trick is to use 'state' as the actual 'target'! (and make sure we intercept everything)\n\t// Note that in the case of an array, we put the state in an array to have better Reflect defaults ootb\n\tlet target: T = state as any\n\tlet traps: ProxyHandler<object | Array<any>> = objectTraps\n\tif (isArray) {\n\t\ttarget = [state] as any\n\t\ttraps = arrayTraps\n\t}\n\n\tconst {revoke, proxy} = Proxy.revocable(target, traps)\n\tstate.draft_ = proxy as any\n\tstate.revoke_ = revoke\n\treturn proxy as any\n}\n\n/**\n * Object drafts\n */\nexport const objectTraps: ProxyHandler<ProxyState> = {\n\tget(state, prop) {\n\t\tif (prop === DRAFT_STATE) return state\n\n\t\tconst source = latest(state)\n\t\tif (!has(source, prop)) {\n\t\t\t// non-existing or non-own property...\n\t\t\treturn readPropFromProto(state, source, prop)\n\t\t}\n\t\tconst value = source[prop]\n\t\tif (state.finalized_ || !isDraftable(value)) {\n\t\t\treturn value\n\t\t}\n\t\t// Check for existing draft in modified state.\n\t\t// Assigned values are never drafted. This catches any drafts we created, too.\n\t\tif (value === peek(state.base_, prop)) {\n\t\t\tprepareCopy(state)\n\t\t\treturn (state.copy_![prop as any] = createProxy(value, state))\n\t\t}\n\t\treturn value\n\t},\n\thas(state, prop) {\n\t\treturn prop in latest(state)\n\t},\n\townKeys(state) {\n\t\treturn Reflect.ownKeys(latest(state))\n\t},\n\tset(\n\t\tstate: ProxyObjectState,\n\t\tprop: string /* strictly not, but helps TS */,\n\t\tvalue\n\t) {\n\t\tconst desc = getDescriptorFromProto(latest(state), prop)\n\t\tif (desc?.set) {\n\t\t\t// special case: if this write is captured by a setter, we have\n\t\t\t// to trigger it with the correct context\n\t\t\tdesc.set.call(state.draft_, value)\n\t\t\treturn true\n\t\t}\n\t\tif (!state.modified_) {\n\t\t\t// the last check is because we need to be able to distinguish setting a non-existing to undefined (which is a change)\n\t\t\t// from setting an existing property with value undefined to undefined (which is not a change)\n\t\t\tconst current = peek(latest(state), prop)\n\t\t\t// special case, if we assigning the original value to a draft, we can ignore the assignment\n\t\t\tconst currentState: ProxyObjectState = current?.[DRAFT_STATE]\n\t\t\tif (currentState && currentState.base_ === value) {\n\t\t\t\tstate.copy_![prop] = value\n\t\t\t\tstate.assigned_[prop] = false\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif (is(value, current) && (value !== undefined || has(state.base_, prop)))\n\t\t\t\treturn true\n\t\t\tprepareCopy(state)\n\t\t\tmarkChanged(state)\n\t\t}\n\n\t\tif (\n\t\t\t(state.copy_![prop] === value &&\n\t\t\t\t// special case: handle new props with value 'undefined'\n\t\t\t\t(value !== undefined || prop in state.copy_)) ||\n\t\t\t// special case: NaN\n\t\t\t(Number.isNaN(value) && Number.isNaN(state.copy_![prop]))\n\t\t)\n\t\t\treturn true\n\n\t\t// @ts-ignore\n\t\tstate.copy_![prop] = value\n\t\tstate.assigned_[prop] = true\n\t\treturn true\n\t},\n\tdeleteProperty(state, prop: string) {\n\t\t// The `undefined` check is a fast path for pre-existing keys.\n\t\tif (peek(state.base_, prop) !== undefined || prop in state.base_) {\n\t\t\tstate.assigned_[prop] = false\n\t\t\tprepareCopy(state)\n\t\t\tmarkChanged(state)\n\t\t} else {\n\t\t\t// if an originally not assigned property was deleted\n\t\t\tdelete state.assigned_[prop]\n\t\t}\n\t\tif (state.copy_) {\n\t\t\tdelete state.copy_[prop]\n\t\t}\n\t\treturn true\n\t},\n\t// Note: We never coerce `desc.value` into an Immer draft, because we can't make\n\t// the same guarantee in ES5 mode.\n\tgetOwnPropertyDescriptor(state, prop) {\n\t\tconst owner = latest(state)\n\t\tconst desc = Reflect.getOwnPropertyDescriptor(owner, prop)\n\t\tif (!desc) return desc\n\t\treturn {\n\t\t\twritable: true,\n\t\t\tconfigurable: state.type_ !== ArchType.Array || prop !== \"length\",\n\t\t\tenumerable: desc.enumerable,\n\t\t\tvalue: owner[prop]\n\t\t}\n\t},\n\tdefineProperty() {\n\t\tdie(11)\n\t},\n\tgetPrototypeOf(state) {\n\t\treturn getPrototypeOf(state.base_)\n\t},\n\tsetPrototypeOf() {\n\t\tdie(12)\n\t}\n}\n\n/**\n * Array drafts\n */\n\nconst arrayTraps: ProxyHandler<[ProxyArrayState]> = {}\neach(objectTraps, (key, fn) => {\n\t// @ts-ignore\n\tarrayTraps[key] = function() {\n\t\targuments[0] = arguments[0][0]\n\t\treturn fn.apply(this, arguments)\n\t}\n})\narrayTraps.deleteProperty = function(state, prop) {\n\tif (process.env.NODE_ENV !== \"production\" && isNaN(parseInt(prop as any)))\n\t\tdie(13)\n\t// @ts-ignore\n\treturn arrayTraps.set!.call(this, state, prop, undefined)\n}\narrayTraps.set = function(state, prop, value) {\n\tif (\n\t\tprocess.env.NODE_ENV !== \"production\" &&\n\t\tprop !== \"length\" &&\n\t\tisNaN(parseInt(prop as any))\n\t)\n\t\tdie(14)\n\treturn objectTraps.set!.call(this, state[0], prop, value, state[0])\n}\n\n// Access a property without creating an Immer draft.\nfunction peek(draft: Drafted, prop: PropertyKey) {\n\tconst state = draft[DRAFT_STATE]\n\tconst source = state ? latest(state) : draft\n\treturn source[prop]\n}\n\nfunction readPropFromProto(state: ImmerState, source: any, prop: PropertyKey) {\n\tconst desc = getDescriptorFromProto(source, prop)\n\treturn desc\n\t\t? `value` in desc\n\t\t\t? desc.value\n\t\t\t: // This is a very special case, if the prop is a getter defined by the\n\t\t\t // prototype, we should invoke it with the draft as context!\n\t\t\t desc.get?.call(state.draft_)\n\t\t: undefined\n}\n\nfunction getDescriptorFromProto(\n\tsource: any,\n\tprop: PropertyKey\n): PropertyDescriptor | undefined {\n\t// 'in' checks proto!\n\tif (!(prop in source)) return undefined\n\tlet proto = getPrototypeOf(source)\n\twhile (proto) {\n\t\tconst desc = Object.getOwnPropertyDescriptor(proto, prop)\n\t\tif (desc) return desc\n\t\tproto = getPrototypeOf(proto)\n\t}\n\treturn undefined\n}\n\nexport function markChanged(state: ImmerState) {\n\tif (!state.modified_) {\n\t\tstate.modified_ = true\n\t\tif (state.parent_) {\n\t\t\tmarkChanged(state.parent_)\n\t\t}\n\t}\n}\n\nexport function prepareCopy(state: {\n\tbase_: any\n\tcopy_: any\n\tscope_: ImmerScope\n}) {\n\tif (!state.copy_) {\n\t\tstate.copy_ = shallowCopy(\n\t\t\tstate.base_,\n\t\t\tstate.scope_.immer_.useStrictShallowCopy_\n\t\t)\n\t}\n}\n","import {\n\tIProduceWithPatches,\n\tIProduce,\n\tImmerState,\n\tDrafted,\n\tisDraftable,\n\tprocessResult,\n\tPatch,\n\tObjectish,\n\tDRAFT_STATE,\n\tDraft,\n\tPatchListener,\n\tisDraft,\n\tisMap,\n\tisSet,\n\tcreateProxyProxy,\n\tgetPlugin,\n\tdie,\n\tenterScope,\n\trevokeScope,\n\tleaveScope,\n\tusePatchesInScope,\n\tgetCurrentScope,\n\tNOTHING,\n\tfreeze,\n\tcurrent\n} from \"../internal\"\n\ninterface ProducersFns {\n\tproduce: IProduce\n\tproduceWithPatches: IProduceWithPatches\n}\n\nexport class Immer implements ProducersFns {\n\tautoFreeze_: boolean = true\n\tuseStrictShallowCopy_: boolean = false\n\n\tconstructor(config?: {autoFreeze?: boolean; useStrictShallowCopy?: boolean}) {\n\t\tif (typeof config?.autoFreeze === \"boolean\")\n\t\t\tthis.setAutoFreeze(config!.autoFreeze)\n\t\tif (typeof config?.useStrictShallowCopy === \"boolean\")\n\t\t\tthis.setUseStrictShallowCopy(config!.useStrictShallowCopy)\n\t}\n\n\t/**\n\t * The `produce` function takes a value and a \"recipe function\" (whose\n\t * return value often depends on the base state). The recipe function is\n\t * free to mutate its first argument however it wants. All mutations are\n\t * only ever applied to a __copy__ of the base state.\n\t *\n\t * Pass only a function to create a \"curried producer\" which relieves you\n\t * from passing the recipe function every time.\n\t *\n\t * Only plain objects and arrays are made mutable. All other objects are\n\t * considered uncopyable.\n\t *\n\t * Note: This function is __bound__ to its `Immer` instance.\n\t *\n\t * @param {any} base - the initial state\n\t * @param {Function} recipe - function that receives a proxy of the base state as first argument and which can be freely modified\n\t * @param {Function} patchListener - optional function that will be called with all the patches produced here\n\t * @returns {any} a new state, or the initial state if nothing was modified\n\t */\n\tproduce: IProduce = (base: any, recipe?: any, patchListener?: any) => {\n\t\t// curried invocation\n\t\tif (typeof base === \"function\" && typeof recipe !== \"function\") {\n\t\t\tconst defaultBase = recipe\n\t\t\trecipe = base\n\n\t\t\tconst self = this\n\t\t\treturn function curriedProduce(\n\t\t\t\tthis: any,\n\t\t\t\tbase = defaultBase,\n\t\t\t\t...args: any[]\n\t\t\t) {\n\t\t\t\treturn self.produce(base, (draft: Drafted) => recipe.call(this, draft, ...args)) // prettier-ignore\n\t\t\t}\n\t\t}\n\n\t\tif (typeof recipe !== \"function\") die(6)\n\t\tif (patchListener !== undefined && typeof patchListener !== \"function\")\n\t\t\tdie(7)\n\n\t\tlet result\n\n\t\t// Only plain objects, arrays, and \"immerable classes\" are drafted.\n\t\tif (isDraftable(base)) {\n\t\t\tconst scope = enterScope(this)\n\t\t\tconst proxy = createProxy(base, undefined)\n\t\t\tlet hasError = true\n\t\t\ttry {\n\t\t\t\tresult = recipe(proxy)\n\t\t\t\thasError = false\n\t\t\t} finally {\n\t\t\t\t// finally instead of catch + rethrow better preserves original stack\n\t\t\t\tif (hasError) revokeScope(scope)\n\t\t\t\telse leaveScope(scope)\n\t\t\t}\n\t\t\tusePatchesInScope(scope, patchListener)\n\t\t\treturn processResult(result, scope)\n\t\t} else if (!base || typeof base !== \"object\") {\n\t\t\tresult = recipe(base)\n\t\t\tif (result === undefined) result = base\n\t\t\tif (result === NOTHING) result = undefined\n\t\t\tif (this.autoFreeze_) freeze(result, true)\n\t\t\tif (patchListener) {\n\t\t\t\tconst p: Patch[] = []\n\t\t\t\tconst ip: Patch[] = []\n\t\t\t\tgetPlugin(\"Patches\").generateReplacementPatches_(base, result, p, ip)\n\t\t\t\tpatchListener(p, ip)\n\t\t\t}\n\t\t\treturn result\n\t\t} else die(1, base)\n\t}\n\n\tproduceWithPatches: IProduceWithPatches = (base: any, recipe?: any): any => {\n\t\t// curried invocation\n\t\tif (typeof base === \"function\") {\n\t\t\treturn (state: any, ...args: any[]) =>\n\t\t\t\tthis.produceWithPatches(state, (draft: any) => base(draft, ...args))\n\t\t}\n\n\t\tlet patches: Patch[], inversePatches: Patch[]\n\t\tconst result = this.produce(base, recipe, (p: Patch[], ip: Patch[]) => {\n\t\t\tpatches = p\n\t\t\tinversePatches = ip\n\t\t})\n\t\treturn [result, patches!, inversePatches!]\n\t}\n\n\tcreateDraft<T extends Objectish>(base: T): Draft<T> {\n\t\tif (!isDraftable(base)) die(8)\n\t\tif (isDraft(base)) base = current(base)\n\t\tconst scope = enterScope(this)\n\t\tconst proxy = createProxy(base, undefined)\n\t\tproxy[DRAFT_STATE].isManual_ = true\n\t\tleaveScope(scope)\n\t\treturn proxy as any\n\t}\n\n\tfinishDraft<D extends Draft<any>>(\n\t\tdraft: D,\n\t\tpatchListener?: PatchListener\n\t): D extends Draft<infer T> ? T : never {\n\t\tconst state: ImmerState = draft && (draft as any)[DRAFT_STATE]\n\t\tif (!state || !state.isManual_) die(9)\n\t\tconst {scope_: scope} = state\n\t\tusePatchesInScope(scope, patchListener)\n\t\treturn processResult(undefined, scope)\n\t}\n\n\t/**\n\t * Pass true to automatically freeze all copies created by Immer.\n\t *\n\t * By default, auto-freezing is enabled.\n\t */\n\tsetAutoFreeze(value: boolean) {\n\t\tthis.autoFreeze_ = value\n\t}\n\n\t/**\n\t * Pass true to enable strict shallow copy.\n\t *\n\t * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.\n\t */\n\tsetUseStrictShallowCopy(value: boolean) {\n\t\tthis.useStrictShallowCopy_ = value\n\t}\n\n\tapplyPatches<T extends Objectish>(base: T, patches: Patch[]): T {\n\t\t// If a patch replaces the entire state, take that replacement as base\n\t\t// before applying patches\n\t\tlet i: number\n\t\tfor (i = patches.length - 1; i >= 0; i--) {\n\t\t\tconst patch = patches[i]\n\t\t\tif (patch.path.length === 0 && patch.op === \"replace\") {\n\t\t\t\tbase = patch.value\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\t// If there was a patch that replaced the entire state, start from the\n\t\t// patch after that.\n\t\tif (i > -1) {\n\t\t\tpatches = patches.slice(i + 1)\n\t\t}\n\n\t\tconst applyPatchesImpl = getPlugin(\"Patches\").applyPatches_\n\t\tif (isDraft(base)) {\n\t\t\t// N.B: never hits if some patch a replacement, patches are never drafts\n\t\t\treturn applyPatchesImpl(base, patches)\n\t\t}\n\t\t// Otherwise, produce a copy of the base state.\n\t\treturn this.produce(base, (draft: Drafted) =>\n\t\t\tapplyPatchesImpl(draft, patches)\n\t\t)\n\t}\n}\n\nexport function createProxy<T extends Objectish>(\n\tvalue: T,\n\tparent?: ImmerState\n): Drafted<T, ImmerState> {\n\t// precondition: createProxy should be guarded by isDraftable, so we know we can safely draft\n\tconst draft: Drafted = isMap(value)\n\t\t? getPlugin(\"MapSet\").proxyMap_(value, parent)\n\t\t: isSet(value)\n\t\t? getPlugin(\"MapSet\").proxySet_(value, parent)\n\t\t: createProxyProxy(value, parent)\n\n\tconst scope = parent ? parent.scope_ : getCurrentScope()\n\tscope.drafts_.push(draft)\n\treturn draft\n}\n","import {\n\tdie,\n\tisDraft,\n\tshallowCopy,\n\teach,\n\tDRAFT_STATE,\n\tset,\n\tImmerState,\n\tisDraftable,\n\tisFrozen\n} from \"../internal\"\n\n/** Takes a snapshot of the current state of a draft and finalizes it (but without freezing). This is a great utility to print the current state during debugging (no Proxies in the way). The output of current can also be safely leaked outside the producer. */\nexport function current<T>(value: T): T\nexport function current(value: any): any {\n\tif (!isDraft(value)) die(10, value)\n\treturn currentImpl(value)\n}\n\nfunction currentImpl(value: any): any {\n\tif (!isDraftable(value) || isFrozen(value)) return value\n\tconst state: ImmerState | undefined = value[DRAFT_STATE]\n\tlet copy: any\n\tif (state) {\n\t\tif (!state.modified_) return state.base_\n\t\t// Optimization: avoid generating new drafts during copying\n\t\tstate.finalized_ = true\n\t\tcopy = shallowCopy(value, state.scope_.immer_.useStrictShallowCopy_)\n\t} else {\n\t\tcopy = shallowCopy(value, true)\n\t}\n\t// recurse\n\teach(copy, (key, childValue) => {\n\t\tset(copy, key, currentImpl(childValue))\n\t})\n\tif (state) {\n\t\tstate.finalized_ = false\n\t}\n\treturn copy\n}\n","import {\n\tIProduce,\n\tIProduceWithPatches,\n\tImmer,\n\tDraft,\n\tImmutable\n} from \"./internal\"\n\nexport {\n\tDraft,\n\tImmutable,\n\tPatch,\n\tPatchListener,\n\toriginal,\n\tcurrent,\n\tisDraft,\n\tisDraftable,\n\tNOTHING as nothing,\n\tDRAFTABLE as immerable,\n\tfreeze,\n\tObjectish\n} from \"./internal\"\n\nconst immer = new Immer()\n\n/**\n * The `produce` function takes a value and a \"recipe function\" (whose\n * return value often depends on the base state). The recipe function is\n * free to mutate its first argument however it wants. All mutations are\n * only ever applied to a __copy__ of the base state.\n *\n * Pass only a function to create a \"curried producer\" which relieves you\n * from passing the recipe function every time.\n *\n * Only plain objects and arrays are made mutable. All other objects are\n * considered uncopyable.\n *\n * Note: This function is __bound__ to its `Immer` instance.\n *\n * @param {any} base - the initial state\n * @param {Function} producer - function that receives a proxy of the base state as first argument and which can be freely modified\n * @param {Function} patchListener - optional function that will be called with all the patches produced here\n * @returns {any} a new state, or the initial state if nothing was modified\n */\nexport const produce: IProduce = immer.produce\n\n/**\n * Like `produce`, but `produceWithPatches` always returns a tuple\n * [nextState, patches, inversePatches] (instead of just the next state)\n */\nexport const produceWithPatches: IProduceWithPatches = immer.produceWithPatches.bind(\n\timmer\n)\n\n/**\n * Pass true to automatically freeze all copies created by Immer.\n *\n * Always freeze by default, even in production mode\n */\nexport const setAutoFreeze = immer.setAutoFreeze.bind(immer)\n\n/**\n * Pass true to enable strict shallow copy.\n *\n * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.\n */\nexport const setUseStrictShallowCopy = immer.setUseStrictShallowCopy.bind(immer)\n\n/**\n * Apply an array of Immer patches to the first argument.\n *\n * This function is a producer, which means copy-on-write is in effect.\n */\nexport const applyPatches = immer.applyPatches.bind(immer)\n\n/**\n * Create an Immer draft from the given base state, which may be a draft itself.\n * The draft can be modified until you finalize it with the `finishDraft` function.\n */\nexport const createDraft = immer.createDraft.bind(immer)\n\n/**\n * Finalize an Immer draft from a `createDraft` call, returning the base state\n * (if no changes were made) or a modified copy. The draft must *not* be\n * mutated afterwards.\n *\n * Pass a function as the 2nd argument to generate Immer patches based on the\n * changes that were made.\n */\nexport const finishDraft = immer.finishDraft.bind(immer)\n\n/**\n * This function is actually a no-op, but can be used to cast an immutable type\n * to an draft type and make TypeScript happy\n *\n * @param value\n */\nexport function castDraft<T>(value: T): Draft<T> {\n\treturn value as any\n}\n\n/**\n * This function is actually a no-op, but can be used to cast a mutable type\n * to an immutable type and make TypeScript happy\n * @param value\n */\nexport function castImmutable<T>(value: T): Immutable<T> {\n\treturn value as any\n}\n\nexport {Immer}\n\nexport {enablePatches} from \"./plugins/patches\"\nexport {enableMapSet} from \"./plugins/mapset\"\n","import {\n InsertNodeOperation,\n MergeNodeOperation,\n MoveNodeOperation,\n Operation,\n RemoveNodeOperation,\n SplitNodeOperation,\n} from '..'\nimport { TextDirection } from '../types/types'\n\n/**\n * `Path` arrays are a list of indexes that describe a node's exact position in\n * a Slate node tree. Although they are usually relative to the root `Editor`\n * object, they can be relative to any `Node` object.\n */\n\nexport type Path = number[]\n\nexport interface PathAncestorsOptions {\n reverse?: boolean\n}\n\nexport interface PathLevelsOptions {\n reverse?: boolean\n}\n\nexport interface PathTransformOptions {\n affinity?: TextDirection | null\n}\n\nexport interface PathInterface {\n /**\n * Get a list of ancestor paths for a given path.\n *\n * The paths are sorted from shallowest to deepest ancestor. However, if the\n * `reverse: true` option is passed, they are reversed.\n */\n ancestors: (path: Path, options?: PathAncestorsOptions) => Path[]\n\n /**\n * Get the common ancestor path of two paths.\n */\n common: (path: Path, another: Path) => Path\n\n /**\n * Compare a path to another, returning an integer indicating whether the path\n * was before, at, or after the other.\n *\n * Note: Two paths of unequal length can still receive a `0` result if one is\n * directly above or below the other. If you want exact matching, use\n * [[Path.equals]] instead.\n */\n compare: (path: Path, another: Path) => -1 | 0 | 1\n\n /**\n * Check if a path ends after one of the indexes in another.\n */\n endsAfter: (path: Path, another: Path) => boolean\n\n /**\n * Check if a path ends at one of the indexes in another.\n */\n endsAt: (path: Path, another: Path) => boolean\n\n /**\n * Check if a path ends before one of the indexes in another.\n */\n endsBefore: (path: Path, another: Path) => boolean\n\n /**\n * Check if a path is exactly equal to another.\n */\n equals: (path: Path, another: Path) => boolean\n\n /**\n * Check if the path of previous sibling node exists\n */\n hasPrevious: (path: Path) => boolean\n\n /**\n * Check if a path is after another.\n */\n isAfter: (path: Path, another: Path) => boolean\n\n /**\n * Check if a path is an ancestor of another.\n */\n isAncestor: (path: Path, another: Path) => boolean\n\n /**\n * Check if a path is before another.\n */\n isBefore: (path: Path, another: Path) => boolean\n\n /**\n * Check if a path is a child of another.\n */\n isChild: (path: Path, another: Path) => boolean\n\n /**\n * Check if a path is equal to or an ancestor of another.\n */\n isCommon: (path: Path, another: Path) => boolean\n\n /**\n * Check if a path is a descendant of another.\n */\n isDescendant: (path: Path, another: Path) => boolean\n\n /**\n * Check if a path is the parent of another.\n */\n isParent: (path: Path, another: Path) => boolean\n\n /**\n * Check is a value implements the `Path` interface.\n */\n isPath: (value: any) => value is Path\n\n /**\n * Check if a path is a sibling of another.\n */\n isSibling: (path: Path, another: Path) => boolean\n\n /**\n * Get a list of paths at every level down to a path. Note: this is the same\n * as `Path.ancestors`, but including the path itself.\n *\n * The paths are sorted from shallowest to deepest. However, if the `reverse:\n * true` option is passed, they are reversed.\n */\n levels: (path: Path, options?: PathLevelsOptions) => Path[]\n\n /**\n * Given a path, get the path to the next sibling node.\n */\n next: (path: Path) => Path\n\n /**\n * Returns whether this operation can affect paths or not. Used as an\n * optimization when updating dirty paths during normalization\n *\n * NOTE: This *must* be kept in sync with the implementation of 'transform'\n * below\n */\n operationCanTransformPath: (\n operation: Operation\n ) => operation is\n | InsertNodeOperation\n | RemoveNodeOperation\n | MergeNodeOperation\n | SplitNodeOperation\n | MoveNodeOperation\n\n /**\n * Given a path, return a new path referring to the parent node above it.\n */\n parent: (path: Path) => Path\n\n /**\n * Given a path, get the path to the previous sibling node.\n */\n previous: (path: Path) => Path\n\n /**\n * Get a path relative to an ancestor.\n */\n relative: (path: Path, ancestor: Path) => Path\n\n /**\n * Transform a path by an operation.\n */\n transform: (\n path: Path,\n operation: Operation,\n options?: PathTransformOptions\n ) => Path | null\n}\n\n// eslint-disable-next-line no-redeclare\nexport const Path: PathInterface = {\n ancestors(path: Path, options: PathAncestorsOptions = {}): Path[] {\n const { reverse = false } = options\n let paths = Path.levels(path, options)\n\n if (reverse) {\n paths = paths.slice(1)\n } else {\n paths = paths.slice(0, -1)\n }\n\n return paths\n },\n\n common(path: Path, another: Path): Path {\n const common: Path = []\n\n for (let i = 0; i < path.length && i < another.length; i++) {\n const av = path[i]\n const bv = another[i]\n\n if (av !== bv) {\n break\n }\n\n common.push(av)\n }\n\n return common\n },\n\n compare(path: Path, another: Path): -1 | 0 | 1 {\n const min = Math.min(path.length, another.length)\n\n for (let i = 0; i < min; i++) {\n if (path[i] < another[i]) return -1\n if (path[i] > another[i]) return 1\n }\n\n return 0\n },\n\n endsAfter(path: Path, another: Path): boolean {\n const i = path.length - 1\n const as = path.slice(0, i)\n const bs = another.slice(0, i)\n const av = path[i]\n const bv = another[i]\n return Path.equals(as, bs) && av > bv\n },\n\n endsAt(path: Path, another: Path): boolean {\n const i = path.length\n const as = path.slice(0, i)\n const bs = another.slice(0, i)\n return Path.equals(as, bs)\n },\n\n endsBefore(path: Path, another: Path): boolean {\n const i = path.length - 1\n const as = path.slice(0, i)\n const bs = another.slice(0, i)\n const av = path[i]\n const bv = another[i]\n return Path.equals(as, bs) && av < bv\n },\n\n equals(path: Path, another: Path): boolean {\n return (\n path.length === another.length && path.every((n, i) => n === another[i])\n )\n },\n\n hasPrevious(path: Path): boolean {\n return path[path.length - 1] > 0\n },\n\n isAfter(path: Path, another: Path): boolean {\n return Path.compare(path, another) === 1\n },\n\n isAncestor(path: Path, another: Path): boolean {\n return path.length < another.length && Path.compare(path, another) === 0\n },\n\n isBefore(path: Path, another: Path): boolean {\n return Path.compare(path, another) === -1\n },\n\n isChild(path: Path, another: Path): boolean {\n return (\n path.length === another.length + 1 && Path.compare(path, another) === 0\n )\n },\n\n isCommon(path: Path, another: Path): boolean {\n return path.length <= another.length && Path.compare(path, another) === 0\n },\n\n isDescendant(path: Path, another: Path): boolean {\n return path.length > another.length && Path.compare(path, another) === 0\n },\n\n isParent(path: Path, another: Path): boolean {\n return (\n path.length + 1 === another.length && Path.compare(path, another) === 0\n )\n },\n\n isPath(value: any): value is Path {\n return (\n Array.isArray(value) &&\n (value.length === 0 || typeof value[0] === 'number')\n )\n },\n\n isSibling(path: Path, another: Path): boolean {\n if (path.length !== another.length) {\n return false\n }\n\n const as = path.slice(0, -1)\n const bs = another.slice(0, -1)\n const al = path[path.length - 1]\n const bl = another[another.length - 1]\n return al !== bl && Path.equals(as, bs)\n },\n\n levels(path: Path, options: PathLevelsOptions = {}): Path[] {\n const { reverse = false } = options\n const list: Path[] = []\n\n for (let i = 0; i <= path.length; i++) {\n list.push(path.slice(0, i))\n }\n\n if (reverse) {\n list.reverse()\n }\n\n return list\n },\n\n next(path: Path): Path {\n if (path.length === 0) {\n throw new Error(\n `Cannot get the next path of a root path [${path}], because it has no next index.`\n )\n }\n\n const last = path[path.length - 1]\n return path.slice(0, -1).concat(last + 1)\n },\n\n operationCanTransformPath(\n operation: Operation\n ): operation is\n | InsertNodeOperation\n | RemoveNodeOperation\n | MergeNodeOperation\n | SplitNodeOperation\n | MoveNodeOperation {\n switch (operation.type) {\n case 'insert_node':\n case 'remove_node':\n case 'merge_node':\n case 'split_node':\n case 'move_node':\n return true\n default:\n return false\n }\n },\n\n parent(path: Path): Path {\n if (path.length === 0) {\n throw new Error(`Cannot get the parent path of the root path [${path}].`)\n }\n\n return path.slice(0, -1)\n },\n\n previous(path: Path): Path {\n if (path.length === 0) {\n throw new Error(\n `Cannot get the previous path of a root path [${path}], because it has no previous index.`\n )\n }\n\n const last = path[path.length - 1]\n\n if (last <= 0) {\n throw new Error(\n `Cannot get the previous path of a first child path [${path}] because it would result in a negative index.`\n )\n }\n\n return path.slice(0, -1).concat(last - 1)\n },\n\n relative(path: Path, ancestor: Path): Path {\n if (!Path.isAncestor(ancestor, path) && !Path.equals(path, ancestor)) {\n throw new Error(\n `Cannot get the relative path of [${path}] inside ancestor [${ancestor}], because it is not above or equal to the path.`\n )\n }\n\n return path.slice(ancestor.length)\n },\n\n transform(\n path: Path | null,\n operation: Operation,\n options: PathTransformOptions = {}\n ): Path | null {\n if (!path) return null\n\n // PERF: use destructing instead of immer\n const p = [...path]\n const { affinity = 'forward' } = options\n\n // PERF: Exit early if the operation is guaranteed not to have an effect.\n if (path.length === 0) {\n return p\n }\n\n switch (operation.type) {\n case 'insert_node': {\n const { path: op } = operation\n\n if (\n Path.equals(op, p) ||\n Path.endsBefore(op, p) ||\n Path.isAncestor(op, p)\n ) {\n p[op.length - 1] += 1\n }\n\n break\n }\n\n case 'remove_node': {\n const { path: op } = operation\n\n if (Path.equals(op, p) || Path.isAncestor(op, p)) {\n return null\n } else if (Path.endsBefore(op, p)) {\n p[op.length - 1] -= 1\n }\n\n break\n }\n\n case 'merge_node': {\n const { path: op, position } = operation\n\n if (Path.equals(op, p) || Path.endsBefore(op, p)) {\n p[op.length - 1] -= 1\n } else if (Path.isAncestor(op, p)) {\n p[op.length - 1] -= 1\n p[op.length] += position\n }\n\n break\n }\n\n case 'split_node': {\n const { path: op, position } = operation\n\n if (Path.equals(op, p)) {\n if (affinity === 'forward') {\n p[p.length - 1] += 1\n } else if (affinity === 'backward') {\n // Nothing, because it still refers to the right path.\n } else {\n return null\n }\n } else if (Path.endsBefore(op, p)) {\n p[op.length - 1] += 1\n } else if (Path.isAncestor(op, p) && path[op.length] >= position) {\n p[op.length - 1] += 1\n p[op.length] -= position\n }\n\n break\n }\n\n case 'move_node': {\n const { path: op, newPath: onp } = operation\n\n // If the old and new path are the same, it's a no-op.\n if (Path.equals(op, onp)) {\n return p\n }\n\n if (Path.isAncestor(op, p) || Path.equals(op, p)) {\n const copy = onp.slice()\n\n if (Path.endsBefore(op, onp) && op.length < onp.length) {\n copy[op.length - 1] -= 1\n }\n\n return copy.concat(p.slice(op.length))\n } else if (\n Path.isSibling(op, onp) &&\n (Path.isAncestor(onp, p) || Path.equals(onp, p))\n ) {\n if (Path.endsBefore(op, p)) {\n p[op.length - 1] -= 1\n } else {\n p[op.length - 1] += 1\n }\n } else if (\n Path.endsBefore(onp, p) ||\n Path.equals(onp, p) ||\n Path.isAncestor(onp, p)\n ) {\n if (Path.endsBefore(op, p)) {\n p[op.length - 1] -= 1\n }\n\n p[onp.length - 1] += 1\n } else if (Path.endsBefore(op, p)) {\n if (Path.equals(onp, p)) {\n p[onp.length - 1] += 1\n }\n\n p[op.length - 1] -= 1\n }\n\n break\n }\n }\n\n return p\n },\n}\n","export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import { createDraft, finishDraft, isDraft } from 'immer'\nimport {\n Ancestor,\n Descendant,\n Editor,\n Element,\n Node,\n NodeEntry,\n Operation,\n Path,\n Point,\n Range,\n Scrubber,\n Selection,\n Text,\n} from '../../index'\n\nexport interface GeneralTransforms {\n /**\n * Transform the editor by an operation.\n */\n transform: (editor: Editor, op: Operation) => void\n}\n\nconst applyToDraft = (editor: Editor, selection: Selection, op: Operation) => {\n switch (op.type) {\n case 'insert_node': {\n const { path, node } = op\n const parent = Node.parent(editor, path)\n const index = path[path.length - 1]\n\n if (index > parent.children.length) {\n throw new Error(\n `Cannot apply an \"insert_node\" operation at path [${path}] because the destination is past the end of the node.`\n )\n }\n\n parent.children.splice(index, 0, node)\n\n if (selection) {\n for (const [point, key] of Range.points(selection)) {\n selection[key] = Point.transform(point, op)!\n }\n }\n\n break\n }\n\n case 'insert_text': {\n const { path, offset, text } = op\n if (text.length === 0) break\n const node = Node.leaf(editor, path)\n const before = node.text.slice(0, offset)\n const after = node.text.slice(offset)\n node.text = before + text + after\n\n if (selection) {\n for (const [point, key] of Range.points(selection)) {\n selection[key] = Point.transform(point, op)!\n }\n }\n\n break\n }\n\n case 'merge_node': {\n const { path } = op\n const node = Node.get(editor, path)\n const prevPath = Path.previous(path)\n const prev = Node.get(editor, prevPath)\n const parent = Node.parent(editor, path)\n const index = path[path.length - 1]\n\n if (Text.isText(node) && Text.isText(prev)) {\n prev.text += node.text\n } else if (!Text.isText(node) && !Text.isText(prev)) {\n prev.children.push(...node.children)\n } else {\n throw new Error(\n `Cannot apply a \"merge_node\" operation at path [${path}] to nodes of different interfaces: ${Scrubber.stringify(\n node\n )} ${Scrubber.stringify(prev)}`\n )\n }\n\n parent.children.splice(index, 1)\n\n if (selection) {\n for (const [point, key] of Range.points(selection)) {\n selection[key] = Point.transform(point, op)!\n }\n }\n\n break\n }\n\n case 'move_node': {\n const { path, newPath } = op\n\n if (Path.isAncestor(path, newPath)) {\n throw new Error(\n `Cannot move a path [${path}] to new path [${newPath}] because the destination is inside itself.`\n )\n }\n\n const node = Node.get(editor, path)\n const parent = Node.parent(editor, path)\n const index = path[path.length - 1]\n\n // This is tricky, but since the `path` and `newPath` both refer to\n // the same snapshot in time, there's a mismatch. After either\n // removing the original position, the second step's path can be out\n // of date. So instead of using the `op.newPath` directly, we\n // transform `op.path` to ascertain what the `newPath` would be after\n // the operation was applied.\n parent.children.splice(index, 1)\n const truePath = Path.transform(path, op)!\n const newParent = Node.get(editor, Path.parent(truePath)) as Ancestor\n const newIndex = truePath[truePath.length - 1]\n\n newParent.children.splice(newIndex, 0, node)\n\n if (selection) {\n for (const [point, key] of Range.points(selection)) {\n selection[key] = Point.transform(point, op)!\n }\n }\n\n break\n }\n\n case 'remove_node': {\n const { path } = op\n const index = path[path.length - 1]\n const parent = Node.parent(editor, path)\n parent.children.splice(index, 1)\n\n // Transform all the points in the value, but if the point was in the\n // node that was removed we need to update the range or remove it.\n if (selection) {\n for (const [point, key] of Range.points(selection)) {\n const result = Point.transform(point, op)\n\n if (selection != null && result != null) {\n selection[key] = result\n } else {\n let prev: NodeEntry<Text> | undefined\n let next: NodeEntry<Text> | undefined\n\n for (const [n, p] of Node.texts(editor)) {\n if (Path.compare(p, path) === -1) {\n prev = [n, p]\n } else {\n next = [n, p]\n break\n }\n }\n\n let preferNext = false\n if (prev && next) {\n if (Path.equals(next[1], path)) {\n preferNext = !Path.hasPrevious(next[1])\n } else {\n preferNext =\n Path.common(prev[1], path).length <\n Path.common(next[1], path).length\n }\n }\n\n if (prev && !preferNext) {\n point.path = prev[1]\n point.offset = prev[0].text.length\n } else if (next) {\n point.path = next[1]\n point.offset = 0\n } else {\n selection = null\n }\n }\n }\n }\n\n break\n }\n\n case 'remove_text': {\n const { path, offset, text } = op\n if (text.length === 0) break\n const node = Node.leaf(editor, path)\n const before = node.text.slice(0, offset)\n const after = node.text.slice(offset + text.length)\n node.text = before + after\n\n if (selection) {\n for (const [point, key] of Range.points(selection)) {\n selection[key] = Point.transform(point, op)!\n }\n }\n\n break\n }\n\n case 'set_node': {\n const { path, properties, newProperties } = op\n\n if (path.length === 0) {\n throw new Error(`Cannot set properties on the root node!`)\n }\n\n const node = Node.get(editor, path)\n\n for (const key in newProperties) {\n if (key === 'children' || key === 'text') {\n throw new Error(`Cannot set the \"${key}\" property of nodes!`)\n }\n\n const value = newProperties[<keyof Node>key]\n\n if (value == null) {\n delete node[<keyof Node>key]\n } else {\n node[<keyof Node>key] = value\n }\n }\n\n // properties that were previously defined, but are now missing, must be deleted\n for (const key in properties) {\n if (!newProperties.hasOwnProperty(key)) {\n delete node[<keyof Node>key]\n }\n }\n\n break\n }\n\n case 'set_selection': {\n const { newProperties } = op\n\n if (newProperties == null) {\n selection = newProperties\n } else {\n if (selection == null) {\n if (!Range.isRange(newProperties)) {\n throw new Error(\n `Cannot apply an incomplete \"set_selection\" operation properties ${Scrubber.stringify(\n newProperties\n )} when there is no current selection.`\n )\n }\n\n selection = { ...newProperties }\n }\n\n for (const key in newProperties) {\n const value = newProperties[<keyof Range>key]\n\n if (value == null) {\n if (key === 'anchor' || key === 'focus') {\n throw new Error(`Cannot remove the \"${key}\" selection property`)\n }\n\n delete selection[<keyof Range>key]\n } else {\n selection[<keyof Range>key] = value\n }\n }\n }\n\n break\n }\n\n case 'split_node': {\n const { path, position, properties } = op\n\n if (path.length === 0) {\n throw new Error(\n `Cannot apply a \"split_node\" operation at path [${path}] because the root node cannot be split.`\n )\n }\n\n const node = Node.get(editor, path)\n const parent = Node.parent(editor, path)\n const index = path[path.length - 1]\n let newNode: Descendant\n\n if (Text.isText(node)) {\n const before = node.text.slice(0, position)\n const after = node.text.slice(position)\n node.text = before\n newNode = {\n ...(properties as Partial<Text>),\n text: after,\n }\n } else {\n const before = node.children.slice(0, position)\n const after = node.children.slice(position)\n node.children = before\n\n newNode = {\n ...(properties as Partial<Element>),\n children: after,\n }\n }\n\n parent.children.splice(index + 1, 0, newNode)\n\n if (selection) {\n for (const [point, key] of Range.points(selection)) {\n selection[key] = Point.transform(point, op)!\n }\n }\n\n break\n }\n }\n return selection\n}\n\n// eslint-disable-next-line no-redeclare\nexport const GeneralTransforms: GeneralTransforms = {\n transform(editor: Editor, op: Operation): void {\n editor.children = createDraft(editor.children)\n let selection = editor.selection && createDraft(editor.selection)\n\n try {\n selection = applyToDraft(editor, selection, op)\n } finally {\n editor.children = finishDraft(editor.children)\n\n if (selection) {\n editor.selection = isDraft(selection)\n ? (finishDraft(selection) as Range)\n : selection\n } else {\n editor.selection = null\n }\n }\n },\n}\n","import { Editor, Element, Location, Node, Path } from '../../index'\nimport { NodeMatch, PropsCompare, PropsMerge } from '../editor'\nimport { MaximizeMode, RangeMode } from '../../types/types'\n\nexport interface NodeInsertNodesOptions<T extends Node> {\n at?: Location\n match?: NodeMatch<T>\n mode?: RangeMode\n hanging?: boolean\n select?: boolean\n voids?: boolean\n batchDirty?: boolean\n}\n\nexport interface NodeTransforms {\n /**\n * Insert nodes in the editor\n * at the specified location or (if not defined) the current selection or (if not defined) the end of the document.\n */\n insertNodes: <T extends Node>(\n editor: Editor,\n nodes: Node | Node[],\n options?: NodeInsertNodesOptions<T>\n ) => void\n\n /**\n * Lift nodes at a specific location upwards in the document tree, splitting\n * their parent in two if necessary.\n */\n liftNodes: <T extends Node>(\n editor: Editor,\n options?: {\n at?: Location\n match?: NodeMatch<T>\n mode?: MaximizeMode\n voids?: boolean\n }\n ) => void\n\n /**\n * Merge a node at a location with the previous node of the same depth,\n * removing any empty containing nodes after the merge if necessary.\n */\n mergeNodes: <T extends Node>(\n editor: Editor,\n options?: {\n at?: Location\n match?: NodeMatch<T>\n mode?: RangeMode\n hanging?: boolean\n voids?: boolean\n }\n ) => void\n\n /**\n * Move the nodes at a location to a new location.\n */\n moveNodes: <T extends Node>(\n editor: Editor,\n options: {\n at?: Location\n match?: NodeMatch<T>\n mode?: MaximizeMode\n to: Path\n voids?: boolean\n }\n ) => void\n\n /**\n * Remove the nodes at a specific location in the document.\n */\n removeNodes: <T extends Node>(\n editor: Editor,\n options?: {\n at?: Location\n match?: NodeMatch<T>\n mode?: RangeMode\n hanging?: boolean\n voids?: boolean\n }\n ) => void\n\n /**\n * Set new properties on the nodes at a location.\n */\n setNodes: <T extends Node>(\n editor: Editor,\n props: Partial<T>,\n options?: {\n at?: Location\n match?: NodeMatch<T>\n mode?: MaximizeMode\n hanging?: boolean\n split?: boolean\n voids?: boolean\n compare?: PropsCompare\n merge?: PropsMerge\n }\n ) => void\n\n /**\n * Split the nodes at a specific location.\n */\n splitNodes: <T extends Node>(\n editor: Editor,\n options?: {\n at?: Location\n match?: NodeMatch<T>\n mode?: RangeMode\n always?: boolean\n height?: number\n voids?: boolean\n }\n ) => void\n\n /**\n * Unset properties on the nodes at a location.\n */\n unsetNodes: <T extends Node>(\n editor: Editor,\n props: string | string[],\n options?: {\n at?: Location\n match?: NodeMatch<T>\n mode?: MaximizeMode\n hanging?: boolean\n split?: boolean\n voids?: boolean\n }\n ) => void\n\n /**\n * Unwrap the nodes at a location from a parent node, splitting the parent if\n * necessary to ensure that only the content in the range is unwrapped.\n */\n unwrapNodes: <T extends Node>(\n editor: Editor,\n options?: {\n at?: Location\n match?: NodeMatch<T>\n mode?: MaximizeMode\n split?: boolean\n voids?: boolean\n }\n ) => void\n\n /**\n * Wrap the nodes at a location in a new container node, splitting the edges\n * of the range first to ensure that only the content in the range is wrapped.\n */\n wrapNodes: <T extends Node>(\n editor: Editor,\n element: Element,\n options?: {\n at?: Location\n match?: NodeMatch<T>\n mode?: MaximizeMode\n split?: boolean\n voids?: boolean\n }\n ) => void\n}\n\n// eslint-disable-next-line no-redeclare\nexport const NodeTransforms: NodeTransforms = {\n insertNodes(editor, nodes, options) {\n editor.insertNodes(nodes, options)\n },\n liftNodes(editor, options) {\n editor.liftNodes(options)\n },\n mergeNodes(editor, options) {\n editor.mergeNodes(options)\n },\n moveNodes(editor, options) {\n editor.moveNodes(options)\n },\n removeNodes(editor, options) {\n editor.removeNodes(options)\n },\n setNodes(editor, props, options) {\n editor.setNodes(props, options)\n },\n splitNodes(editor, options) {\n editor.splitNodes(options)\n },\n unsetNodes(editor, props, options) {\n editor.unsetNodes(props, options)\n },\n unwrapNodes(editor, options) {\n editor.unwrapNodes(options)\n },\n wrapNodes(editor, element, options) {\n editor.wrapNodes(element, options)\n },\n}\n","import { Editor, Location, Point, Range } from '../../index'\nimport { MoveUnit, SelectionEdge } from '../../types/types'\n\nexport interface SelectionCollapseOptions {\n edge?: SelectionEdge\n}\n\nexport interface SelectionMoveOptions {\n distance?: number\n unit?: MoveUnit\n reverse?: boolean\n edge?: SelectionEdge\n}\n\nexport interface SelectionSetPointOptions {\n edge?: SelectionEdge\n}\n\nexport interface SelectionTransforms {\n /**\n * Collapse the selection.\n */\n collapse: (editor: Editor, options?: SelectionCollapseOptions) => void\n\n /**\n * Unset the selection.\n */\n deselect: (editor: Editor) => void\n\n /**\n * Move the selection's point forward or backward.\n */\n move: (editor: Editor, options?: SelectionMoveOptions) => void\n\n /**\n * Set the selection to a new value.\n */\n select: (editor: Editor, target: Location) => void\n\n /**\n * Set new properties on one of the selection's points.\n */\n setPoint: (\n editor: Editor,\n props: Partial<Point>,\n options?: SelectionSetPointOptions\n ) => void\n\n /**\n * Set new properties on the selection.\n */\n setSelection: (editor: Editor, props: Partial<Range>) => void\n}\n\n// eslint-disable-next-line no-redeclare\nexport const SelectionTransforms: SelectionTransforms = {\n collapse(editor, options) {\n editor.collapse(options)\n },\n deselect(editor) {\n editor.deselect()\n },\n move(editor, options) {\n editor.move(options)\n },\n select(editor, target) {\n editor.select(target)\n },\n setPoint(editor, props, options) {\n editor.setPoint(props, options)\n },\n setSelection(editor, props) {\n editor.setSelection(props)\n },\n}\n","import { isPlainObject } from 'is-plain-object'\n\n/*\n Custom deep equal comparison for Slate nodes.\n\n We don't need general purpose deep equality;\n Slate only supports plain values, Arrays, and nested objects.\n Complex values nested inside Arrays are not supported.\n\n Slate objects are designed to be serialised, so\n missing keys are deliberately normalised to undefined.\n */\nexport const isDeepEqual = (\n node: Record<string, any>,\n another: Record<string, any>\n): boolean => {\n for (const key in node) {\n const a = node[key]\n const b = another[key]\n if (isPlainObject(a) && isPlainObject(b)) {\n if (!isDeepEqual(a, b)) return false\n } else if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) return false\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false\n }\n } else if (a !== b) {\n return false\n }\n }\n\n /*\n Deep object equality is only necessary in one direction; in the reverse direction\n we are only looking for keys that are missing.\n As above, undefined keys are normalised to missing.\n */\n\n for (const key in another) {\n if (node[key] === undefined && another[key] !== undefined) {\n return false\n }\n }\n\n return true\n}\n","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose.js\";\nexport default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}","import { produce } from 'immer'\nimport { isPlainObject } from 'is-plain-object'\nimport { ExtendedType, Operation, Path, Point, PointEntry } from '..'\nimport { RangeDirection } from '../types/types'\n\n/**\n * `Range` objects are a set of points that refer to a specific span of a Slate\n * document. They can define a span inside a single node or a can span across\n * multiple nodes.\n */\n\nexport interface BaseRange {\n anchor: Point\n focus: Point\n}\n\nexport type Range = ExtendedType<'Range', BaseRange>\n\nexport interface RangeEdgesOptions {\n reverse?: boolean\n}\n\nexport interface RangeTransformOptions {\n affinity?: RangeDirection | null\n}\n\nexport interface RangeInterface {\n /**\n * Get the start and end points of a range, in the order in which they appear\n * in the document.\n */\n edges: (range: Range, options?: RangeEdgesOptions) => [Point, Point]\n\n /**\n * Get the end point of a range.\n */\n end: (range: Range) => Point\n\n /**\n * Check if a range is exactly equal to another.\n */\n equals: (range: Range, another: Range) => boolean\n\n /**\n * Check if a range includes a path, a point or part of another range.\n */\n includes: (range: Range, target: Path | Point | Range) => boolean\n\n /**\n * Get the intersection of a range with another.\n */\n intersection: (range: Range, another: Range) => Range | null\n\n /**\n * Check if a range is backward, meaning that its anchor point appears in the\n * document _after_ its focus point.\n */\n isBackward: (range: Range) => boolean\n\n /**\n * Check if a range is collapsed, meaning that both its anchor and focus\n * points refer to the exact same position in the document.\n */\n isCollapsed: (range: Range) => boolean\n\n /**\n * Check if a range is expanded.\n *\n * This is the opposite of [[Range.isCollapsed]] and is provided for legibility.\n */\n isExpanded: (range: Range) => boolean\n\n /**\n * Check if a range is forward.\n *\n * This is the opposite of [[Range.isBackward]] and is provided for legibility.\n */\n isForward: (range: Range) => boolean\n\n /**\n * Check if a value implements the [[Range]] interface.\n */\n isRange: (value: any) => value is Range\n\n /**\n * Iterate through all of the point entries in a range.\n */\n points: (range: Range) => Generator<PointEntry, void, undefined>\n\n /**\n * Get the start point of a range.\n */\n start: (range: Range) => Point\n\n /**\n * Transform a range by an operation.\n */\n transform: (\n range: Range,\n op: Operation,\n options?: RangeTransformOptions\n ) => Range | null\n}\n\n// eslint-disable-next-line no-redeclare\nexport const Range: RangeInterface = {\n edges(range: Range, options: RangeEdgesOptions = {}): [Point, Point] {\n const { reverse = false } = options\n const { anchor, focus } = range\n return Range.isBackward(range) === reverse\n ? [anchor, focus]\n : [focus, anchor]\n },\n\n end(range: Range): Point {\n const [, end] = Range.edges(range)\n return end\n },\n\n equals(range: Range, another: Range): boolean {\n return (\n Point.equals(range.anchor, another.anchor) &&\n Point.equals(range.focus, another.focus)\n )\n },\n\n includes(range: Range, target: Path | Point | Range): boolean {\n if (Range.isRange(target)) {\n if (\n Range.includes(range, target.anchor) ||\n Range.includes(range, target.focus)\n ) {\n return true\n }\n\n const [rs, re] = Range.edges(range)\n const [ts, te] = Range.edges(target)\n return Point.isBefore(rs, ts) && Point.isAfter(re, te)\n }\n\n const [start, end] = Range.edges(range)\n let isAfterStart = false\n let isBeforeEnd = false\n\n if (Point.isPoint(target)) {\n isAfterStart = Point.compare(target, start) >= 0\n isBeforeEnd = Point.compare(target, end) <= 0\n } else {\n isAfterStart = Path.compare(target, start.path) >= 0\n isBeforeEnd = Path.compare(target, end.path) <= 0\n }\n\n return isAfterStart && isBeforeEnd\n },\n\n intersection(range: Range, another: Range): Range | null {\n const { anchor, focus, ...rest } = range\n const [s1, e1] = Range.edges(range)\n const [s2, e2] = Range.edges(another)\n const start = Point.isBefore(s1, s2) ? s2 : s1\n const end = Point.isBefore(e1, e2) ? e1 : e2\n\n if (Point.isBefore(end, start)) {\n return null\n } else {\n return { anchor: start, focus: end, ...rest }\n }\n },\n\n isBackward(range: Range): boolean {\n const { anchor, focus } = range\n return Point.isAfter(anchor, focus)\n },\n\n isCollapsed(range: Range): boolean {\n const { anchor, focus } = range\n return Point.equals(anchor, focus)\n },\n\n isExpanded(range: Range): boolean {\n return !Range.isCollapsed(range)\n },\n\n isForward(range: Range): boolean {\n return !Range.isBackward(range)\n },\n\n isRange(value: any): value is Range {\n return (\n isPlainObject(value) &&\n Point.isPoint(value.anchor) &&\n Point.isPoint(value.focus)\n )\n },\n\n *points(range: Range): Generator<PointEntry, void, undefined> {\n yield [range.anchor, 'anchor']\n yield [range.focus, 'focus']\n },\n\n start(range: Range): Point {\n const [start] = Range.edges(range)\n return start\n },\n\n transform(\n range: Range | null,\n op: Operation,\n options: RangeTransformOptions = {}\n ): Range | null {\n return produce(range, r => {\n if (r === null) {\n return null\n }\n const { affinity = 'inward' } = options\n let affinityAnchor: 'forward' | 'backward' | null\n let affinityFocus: 'forward' | 'backward' | null\n\n if (affinity === 'inward') {\n // If the range is collapsed, make sure to use the same affinity to\n // avoid the two points passing each other and expanding in the opposite\n // direction\n const isCollapsed = Range.isCollapsed(r)\n if (Range.isForward(r)) {\n affinityAnchor = 'forward'\n affinityFocus = isCollapsed ? affinityAnchor : 'backward'\n } else {\n affinityAnchor = 'backward'\n affinityFocus = isCollapsed ? affinityAnchor : 'forward'\n }\n } else if (affinity === 'outward') {\n if (Range.isForward(r)) {\n affinityAnchor = 'backward'\n affinityFocus = 'forward'\n } else {\n affinityAnchor = 'forward'\n affinityFocus = 'backward'\n }\n } else {\n affinityAnchor = affinity\n affinityFocus = affinity\n }\n const anchor = Point.transform(r.anchor, op, { affinity: affinityAnchor })\n const focus = Point.transform(r.focus, op, { affinity: affinityFocus })\n\n if (!anchor || !focus) {\n return null\n }\n\n r.anchor = anchor\n r.focus = focus\n })\n },\n}\n","import { isPlainObject } from 'is-plain-object'\nimport { Ancestor, Descendant, Editor, ExtendedType, Node, Path } from '..'\n\n/**\n * `Element` objects are a type of node in a Slate document that contain other\n * element nodes or text nodes. They can be either \"blocks\" or \"inlines\"\n * depending on the Slate editor's configuration.\n */\n\nexport interface BaseElement {\n children: Descendant[]\n}\n\nexport type Element = ExtendedType<'Element', BaseElement>\n\nexport interface ElementInterface {\n /**\n * Check if a value implements the 'Ancestor' interface.\n */\n isAncestor: (value: any) => value is Ancestor\n\n /**\n * Check if a value implements the `Element` interface.\n */\n isElement: (value: any) => value is Element\n\n /**\n * Check if a value is an array of `Element` objects.\n */\n isElementList: (value: any) => value is Element[]\n\n /**\n * Check if a set of props is a partial of Element.\n */\n isElementProps: (props: any) => props is Partial<Element>\n\n /**\n * Check if a value implements the `Element` interface and has elementKey with selected value.\n * Default it check to `type` key value\n */\n isElementType: <T extends Element>(\n value: any,\n elementVal: string,\n elementKey?: string\n ) => value is T\n\n /**\n * Check if an element matches set of properties.\n *\n * Note: this checks custom properties, and it does not ensure that any\n * children are equivalent.\n */\n matches: (element: Element, props: Partial<Element>) => boolean\n}\n\n/**\n * Shared the function with isElementType utility\n */\nconst isElement = (value: any): value is Element => {\n return (\n isPlainObject(value) &&\n Node.isNodeList(value.children) &&\n !Editor.isEditor(value)\n )\n}\n\n// eslint-disable-next-line no-redeclare\nexport const Element: ElementInterface = {\n isAncestor(value: any): value is Ancestor {\n return isPlainObject(value) && Node.isNodeList(value.children)\n },\n\n isElement,\n\n isElementList(value: any): value is Element[] {\n return Array.isArray(value) && value.every(val => Element.isElement(val))\n },\n\n isElementProps(props: any): props is Partial<Element> {\n return (props as Partial<Element>).children !== undefined\n },\n\n isElementType: <T extends Element>(\n value: any,\n elementVal: string,\n elementKey: string = 'type'\n ): value is T => {\n return (\n isElement(value) && value[<keyof Descendant>elementKey] === elementVal\n )\n },\n\n matches(element: Element, props: Partial<Element>): boolean {\n for (const key in props) {\n if (key === 'children') {\n continue\n }\n\n if (element[<keyof Descendant>key] !== props[<keyof Descendant>key]) {\n return false\n }\n }\n\n return true\n },\n}\n\n/**\n * `ElementEntry` objects refer to an `Element` and the `Path` where it can be\n * found inside a root node.\n */\nexport type ElementEntry = [Element, Path]\n","import { produce } from 'immer'\nimport { Editor, Path, Range, Scrubber, Text } from '..'\nimport { Element, ElementEntry } from './element'\n\n/**\n * The `Node` union type represents all of the different types of nodes that\n * occur in a Slate document tree.\n */\n\nexport type BaseNode = Editor | Element | Text\nexport type Node = Editor | Element | Text\n\nexport interface NodeAncestorsOptions {\n reverse?: boolean\n}\n\nexport interface NodeChildrenOptions {\n reverse?: boolean\n}\n\nexport interface NodeDescendantsOptions {\n from?: Path\n to?: Path\n reverse?: boolean\n pass?: (node: NodeEntry) => boolean\n}\n\nexport interface NodeElementsOptions {\n from?: Path\n to?: Path\n reverse?: boolean\n pass?: (node: NodeEntry) => boolean\n}\n\nexport interface NodeLevelsOptions {\n reverse?: boolean\n}\n\nexport interface NodeNodesOptions {\n from?: Path\n to?: Path\n reverse?: boolean\n pass?: (entry: NodeEntry) => boolean\n}\n\nexport interface NodeTextsOptions {\n from?: Path\n to?: Path\n reverse?: boolean\n pass?: (node: NodeEntry) => boolean\n}\n\nexport interface NodeInterface {\n /**\n * Get the node at a specific path, asserting that it's an ancestor node.\n */\n ancestor: (root: Node, path: Path) => Ancestor\n\n /**\n * Return a generator of all the ancestor nodes above a specific path.\n *\n * By default the order is top-down, from highest to lowest ancestor in\n * the tree, but you can pass the `reverse: true` option to go bottom-up.\n */\n ancestors: (\n root: Node,\n path: Path,\n options?: NodeAncestorsOptions\n ) => Generator<NodeEntry<Ancestor>, void, undefined>\n\n /**\n * Get the child of a node at a specific index.\n */\n child: (root: Node, index: number) => Descendant\n\n /**\n * Iterate over the children of a node at a specific path.\n */\n children: (\n root: Node,\n path: Path,\n options?: NodeChildrenOptions\n ) => Generator<NodeEntry<Descendant>, void, undefined>\n\n /**\n * Get an entry for the common ancesetor node of two paths.\n */\n common: (root: Node, path: Path, another: Path) => NodeEntry\n\n /**\n * Get the node at a specific path, asserting that it's a descendant node.\n */\n descendant: (root: Node, path: Path) => Descendant\n\n /**\n * Return a generator of all the descendant node entries inside a root node.\n */\n descendants: (\n root: Node,\n options?: NodeDescendantsOptions\n ) => Generator<NodeEntry<Descendant>, void, undefined>\n\n /**\n * Return a generator of all the element nodes inside a root node. Each iteration\n * will return an `ElementEntry` tuple consisting of `[Element, Path]`. If the\n * root node is an element it will be included in the iteration as well.\n */\n elements: (\n root: Node,\n options?: NodeElementsOptions\n ) => Generator<ElementEntry, void, undefined>\n\n /**\n * Extract props from a Node.\n */\n extractProps: (node: Node) => NodeProps\n\n /**\n * Get the first node entry in a root node from a path.\n */\n first: (root: Node, path: Path) => NodeEntry\n\n /**\n * Get the sliced fragment represented by a range inside a root node.\n */\n fragment: (root: Node, range: Range) => Descendant[]\n\n /**\n * Get the descendant node referred to by a specific path. If the path is an\n * empty array, it refers to the root node itself.\n */\n get: (root: Node, path: Path) => Node\n\n /**\n * Check if a descendant node exists at a specific path.\n */\n has: (root: Node, path: Path) => boolean\n\n /**\n * Check if a value implements the `Node` interface.\n */\n isNode: (value: any) => value is Node\n\n /**\n * Check if a value is a list of `Node` objects.\n */\n isNodeList: (value: any) => value is Node[]\n\n /**\n * Get the last node entry in a root node from a path.\n */\n last: (root: Node, path: Path) => NodeEntry\n\n /**\n * Get the node at a specific path, ensuring it's a leaf text node.\n */\n leaf: (root: Node, path: Path) => Text\n\n /**\n * Return a generator of the in a branch of the tree, from a specific path.\n *\n * By default the order is top-down, from highest to lowest node in the tree,\n * but you can pass the `reverse: true` option to go bottom-up.\n */\n levels: (\n root: Node,\n path: Path,\n options?: NodeLevelsOptions\n ) => Generator<NodeEntry, void, undefined>\n\n /**\n * Check if a node matches a set of props.\n */\n matches: (node: Node, props: Partial<Node>) => boolean\n\n /**\n * Return a generator of all the node entries of a root node. Each entry is\n * returned as a `[Node, Path]` tuple, with the path referring to the node's\n * position inside the root node.\n */\n nodes: (\n root: Node,\n options?: NodeNodesOptions\n ) => Generator<NodeEntry, void, undefined>\n\n /**\n * Get the parent of a node at a specific path.\n */\n parent: (root: Node, path: Path) => Ancestor\n\n /**\n * Get the concatenated text string of a node's content.\n *\n * Note that this will not include spaces or line breaks between block nodes.\n * It is not a user-facing string, but a string for performing offset-related\n * computations for a node.\n */\n string: (node: Node) => string\n\n /**\n * Return a generator of all leaf text nodes in a root node.\n */\n texts: (\n root: Node,\n options?: NodeTextsOptions\n ) => Generator<NodeEntry<Text>, void, undefined>\n}\n\nconst IS_NODE_LIST_CACHE = new WeakMap<any[], boolean>()\n\n// eslint-disable-next-line no-redeclare\nexport const Node: NodeInterface = {\n ancestor(root: Node, path: Path): Ancestor {\n const node = Node.get(root, path)\n\n if (Text.isText(node)) {\n throw new Error(\n `Cannot get the ancestor node at path [${path}] because it refers to a text node instead: ${Scrubber.stringify(\n node\n )}`\n )\n }\n\n return node\n },\n\n *ancestors(\n root: Node,\n path: Path,\n options: NodeAncestorsOptions = {}\n ): Generator<NodeEntry<Ancestor>, void, undefined> {\n for (const p of Path.ancestors(path, options)) {\n const n = Node.ancestor(root, p)\n const entry: NodeEntry<Ancestor> = [n, p]\n yield entry\n }\n },\n\n child(root: Node, index: number): Descendant {\n if (Text.isText(root)) {\n throw new Error(\n `Cannot get the child of a text node: ${Scrubber.stringify(root)}`\n )\n }\n\n const c = root.children[index] as Descendant\n\n if (c == null) {\n throw new Error(\n `Cannot get child at index \\`${index}\\` in node: ${Scrubber.stringify(\n root\n )}`\n )\n }\n\n return c\n },\n\n *children(\n root: Node,\n path: Path,\n options: NodeChildrenOptions = {}\n ): Generator<NodeEntry<Descendant>, void, undefined> {\n const { reverse = false } = options\n const ancestor = Node.ancestor(root, path)\n const { children } = ancestor\n let index = reverse ? children.length - 1 : 0\n\n while (reverse ? index >= 0 : index < children.length) {\n const child = Node.child(ancestor, index)\n const childPath = path.concat(index)\n yield [child, childPath]\n index = reverse ? index - 1 : index + 1\n }\n },\n\n common(root: Node, path: Path, another: Path): NodeEntry {\n const p = Path.common(path, another)\n const n = Node.get(root, p)\n return [n, p]\n },\n\n descendant(root: Node, path: Path): Descendant {\n const node = Node.get(root, path)\n\n if (Editor.isEditor(node)) {\n throw new Error(\n `Cannot get the descendant node at path [${path}] because it refers to the root editor node instead: ${Scrubber.stringify(\n node\n )}`\n )\n }\n\n return node\n },\n\n *descendants(\n root: Node,\n options: NodeDescendantsOptions = {}\n ): Generator<NodeEntry<Descendant>, void, undefined> {\n for (const [node, path] of Node.nodes(root, options)) {\n if (path.length !== 0) {\n // NOTE: we have to coerce here because checking the path's length does\n // guarantee that `node` is not a `Editor`, but TypeScript doesn't know.\n yield [node, path] as NodeEntry<Descendant>\n }\n }\n },\n\n *elements(\n root: Node,\n options: NodeElementsOptions = {}\n ): Generator<ElementEntry, void, undefined> {\n for (const [node, path] of Node.nodes(root, options)) {\n if (Element.isElement(node)) {\n yield [node, path]\n }\n }\n },\n\n extractProps(node: Node): NodeProps {\n if (Element.isAncestor(node)) {\n const { children, ...properties } = node\n\n return properties\n } else {\n const { text, ...properties } = node\n\n return properties\n }\n },\n\n first(root: Node, path: Path): NodeEntry {\n const p = path.slice()\n let n = Node.get(root, p)\n\n while (n) {\n if (Text.isText(n) || n.children.length === 0) {\n break\n } else {\n n = n.children[0]\n p.push(0)\n }\n }\n\n return [n, p]\n },\n\n fragment(root: Node, range: Range): Descendant[] {\n if (Text.isText(root)) {\n throw new Error(\n `Cannot get a fragment starting from a root text node: ${Scrubber.stringify(\n root\n )}`\n )\n }\n\n const newRoot = produce({ children: root.children }, r => {\n const [start, end] = Range.edges(range)\n const nodeEntries = Node.nodes(r, {\n reverse: true,\n pass: ([, path]) => !Range.includes(range, path),\n })\n\n for (const [, path] of nodeEntries) {\n if (!Range.includes(range, path)) {\n const parent = Node.parent(r, path)\n const index = path[path.length - 1]\n parent.children.splice(index, 1)\n }\n\n if (Path.equals(path, end.path)) {\n const leaf = Node.leaf(r, path)\n leaf.text = leaf.text.slice(0, end.offset)\n }\n\n if (Path.equals(path, start.path)) {\n const leaf = Node.leaf(r, path)\n leaf.text = leaf.text.slice(start.offset)\n }\n }\n\n if (Editor.isEditor(r)) {\n r.selection = null\n }\n })\n\n return newRoot.children\n },\n\n get(root: Node, path: Path): Node {\n let node = root\n\n for (let i = 0; i < path.length; i++) {\n const p = path[i]\n\n if (Text.isText(node) || !node.children[p]) {\n throw new Error(\n `Cannot find a descendant at path [${path}] in node: ${Scrubber.stringify(\n root\n )}`\n )\n }\n\n node = node.children[p]\n }\n\n return node\n },\n\n has(root: Node, path: Path): boolean {\n let node = root\n\n for (let i = 0; i < path.length; i++) {\n const p = path[i]\n\n if (Text.isText(node) || !node.children[p]) {\n return false\n }\n\n node = node.children[p]\n }\n\n return true\n },\n\n isNode(value: any): value is Node {\n return (\n Text.isText(value) || Element.isElement(value) || Editor.isEditor(value)\n )\n },\n\n isNodeList(value: any): value is Node[] {\n if (!Array.isArray(value)) {\n return false\n }\n const cachedResult = IS_NODE_LIST_CACHE.get(value)\n if (cachedResult !== undefined) {\n return cachedResult\n }\n const isNodeList = value.every(val => Node.isNode(val))\n IS_NODE_LIST_CACHE.set(value, isNodeList)\n return isNodeList\n },\n\n last(root: Node, path: Path): NodeEntry {\n const p = path.slice()\n let n = Node.get(root, p)\n\n while (n) {\n if (Text.isText(n) || n.children.length === 0) {\n break\n } else {\n const i = n.children.length - 1\n n = n.children[i]\n p.push(i)\n }\n }\n\n return [n, p]\n },\n\n leaf(root: Node, path: Path): Text {\n const node = Node.get(root, path)\n\n if (!Text.isText(node)) {\n throw new Error(\n `Cannot get the leaf node at path [${path}] because it refers to a non-leaf node: ${Scrubber.stringify(\n node\n )}`\n )\n }\n\n return node\n },\n\n *levels(\n root: Node,\n path: Path,\n options: NodeLevelsOptions = {}\n ): Generator<NodeEntry, void, undefined> {\n for (const p of Path.levels(path, options)) {\n const n = Node.get(root, p)\n yield [n, p]\n }\n },\n\n matches(node: Node, props: Partial<Node>): boolean {\n return (\n (Element.isElement(node) &&\n Element.isElementProps(props) &&\n Element.matches(node, props)) ||\n (Text.isText(node) &&\n Text.isTextProps(props) &&\n Text.matches(node, props))\n )\n },\n\n *nodes(\n root: Node,\n options: NodeNodesOptions = {}\n ): Generator<NodeEntry, void, undefined> {\n const { pass, reverse = false } = options\n const { from = [], to } = options\n const visited = new Set()\n let p: Path = []\n let n = root\n\n while (true) {\n if (to && (reverse ? Path.isBefore(p, to) : Path.isAfter(p, to))) {\n break\n }\n\n if (!visited.has(n)) {\n yield [n, p]\n }\n\n // If we're allowed to go downward and we haven't descended yet, do.\n if (\n !visited.has(n) &&\n !Text.isText(n) &&\n n.children.length !== 0 &&\n (pass == null || pass([n, p]) === false)\n ) {\n visited.add(n)\n let nextIndex = reverse ? n.children.length - 1 : 0\n\n if (Path.isAncestor(p, from)) {\n nextIndex = from[p.length]\n }\n\n p = p.concat(nextIndex)\n n = Node.get(root, p)\n continue\n }\n\n // If we're at the root and we can't go down, we're done.\n if (p.length === 0) {\n break\n }\n\n // If we're going forward...\n if (!reverse) {\n const newPath = Path.next(p)\n\n if (Node.has(root, newPath)) {\n p = newPath\n n = Node.get(root, p)\n continue\n }\n }\n\n // If we're going backward...\n if (reverse && p[p.length - 1] !== 0) {\n const newPath = Path.previous(p)\n p = newPath\n n = Node.get(root, p)\n continue\n }\n\n // Otherwise we're going upward...\n p = Path.parent(p)\n n = Node.get(root, p)\n visited.add(n)\n }\n },\n\n parent(root: Node, path: Path): Ancestor {\n const parentPath = Path.parent(path)\n const p = Node.get(root, parentPath)\n\n if (Text.isText(p)) {\n throw new Error(\n `Cannot get the parent of path [${path}] because it does not exist in the root.`\n )\n }\n\n return p\n },\n\n string(node: Node): string {\n if (Text.isText(node)) {\n return node.text\n } else {\n return node.children.map(Node.string).join('')\n }\n },\n\n *texts(\n root: Node,\n options: NodeTextsOptions = {}\n ): Generator<NodeEntry<Text>, void, undefined> {\n for (const [node, path] of Node.nodes(root, options)) {\n if (Text.isText(node)) {\n yield [node, path]\n }\n }\n },\n}\n\n/**\n * The `Descendant` union type represents nodes that are descendants in the\n * tree. It is returned as a convenience in certain cases to narrow a value\n * further than the more generic `Node` union.\n */\n\nexport type Descendant = Element | Text\n\n/**\n * The `Ancestor` union type represents nodes that are ancestors in the tree.\n * It is returned as a convenience in certain cases to narrow a value further\n * than the more generic `Node` union.\n */\n\nexport type Ancestor = Editor | Element\n\n/**\n * `NodeEntry` objects are returned when iterating over the nodes in a Slate\n * document tree. They consist of the node and its `Path` relative to the root\n * node in the document.\n */\n\nexport type NodeEntry<T extends Node = Node> = [T, Path]\n\n/**\n * Convenience type for returning the props of a node.\n */\nexport type NodeProps =\n | Omit<Editor, 'children'>\n | Omit<Element, 'children'>\n | Omit<Text, 'text'>\n","import { ExtendedType, Node, Path, Range } from '..'\nimport { isPlainObject } from 'is-plain-object'\n\nexport type BaseInsertNodeOperation = {\n type: 'insert_node'\n path: Path\n node: Node\n}\n\nexport type InsertNodeOperation = ExtendedType<\n 'InsertNodeOperation',\n BaseInsertNodeOperation\n>\n\nexport type BaseInsertTextOperation = {\n type: 'insert_text'\n path: Path\n offset: number\n text: string\n}\n\nexport type InsertTextOperation = ExtendedType<\n 'InsertTextOperation',\n BaseInsertTextOperation\n>\n\nexport type BaseMergeNodeOperation = {\n type: 'merge_node'\n path: Path\n position: number\n properties: Partial<Node>\n}\n\nexport type MergeNodeOperation = ExtendedType<\n 'MergeNodeOperation',\n BaseMergeNodeOperation\n>\n\nexport type BaseMoveNodeOperation = {\n type: 'move_node'\n path: Path\n newPath: Path\n}\n\nexport type MoveNodeOperation = ExtendedType<\n 'MoveNodeOperation',\n BaseMoveNodeOperation\n>\n\nexport type BaseRemoveNodeOperation = {\n type: 'remove_node'\n path: Path\n node: Node\n}\n\nexport type RemoveNodeOperation = ExtendedType<\n 'RemoveNodeOperation',\n BaseRemoveNodeOperation\n>\n\nexport type BaseRemoveTextOperation = {\n type: 'remove_text'\n path: Path\n offset: number\n text: string\n}\n\nexport type RemoveTextOperation = ExtendedType<\n 'RemoveTextOperation',\n BaseRemoveTextOperation\n>\n\nexport type BaseSetNodeOperation = {\n type: 'set_node'\n path: Path\n properties: Partial<Node>\n newProperties: Partial<Node>\n}\n\nexport type SetNodeOperation = ExtendedType<\n 'SetNodeOperation',\n BaseSetNodeOperation\n>\n\nexport type BaseSetSelectionOperation =\n | {\n type: 'set_selection'\n properties: null\n newProperties: Range\n }\n | {\n type: 'set_selection'\n properties: Partial<Range>\n newProperties: Partial<Range>\n }\n | {\n type: 'set_selection'\n properties: Range\n newProperties: null\n }\n\nexport type SetSelectionOperation = ExtendedType<\n 'SetSelectionOperation',\n BaseSetSelectionOperation\n>\n\nexport type BaseSplitNodeOperation = {\n type: 'split_node'\n path: Path\n position: number\n properties: Partial<Node>\n}\n\nexport type SplitNodeOperation = ExtendedType<\n 'SplitNodeOperation',\n BaseSplitNodeOperation\n>\n\nexport type NodeOperation =\n | InsertNodeOperation\n | MergeNodeOperation\n | MoveNodeOperation\n | RemoveNodeOperation\n | SetNodeOperation\n | SplitNodeOperation\n\nexport type SelectionOperation = SetSelectionOperation\n\nexport type TextOperation = InsertTextOperation | RemoveTextOperation\n\n/**\n * `Operation` objects define the low-level instructions that Slate editors use\n * to apply changes to their internal state. Representing all changes as\n * operations is what allows Slate editors to easily implement history,\n * collaboration, and other features.\n */\n\nexport type BaseOperation = NodeOperation | SelectionOperation | TextOperation\nexport type Operation = ExtendedType<'Operation', BaseOperation>\n\nexport interface OperationInterface {\n /**\n * Check if a value is a `NodeOperation` object.\n */\n isNodeOperation: (value: any) => value is NodeOperation\n\n /**\n * Check if a value is an `Operation` object.\n */\n isOperation: (value: any) => value is Operation\n\n /**\n * Check if a value is a list of `Operation` objects.\n */\n isOperationList: (value: any) => value is Operation[]\n\n /**\n * Check if a value is a `SelectionOperation` object.\n */\n isSelectionOperation: (value: any) => value is SelectionOperation\n\n /**\n * Check if a value is a `TextOperation` object.\n */\n isTextOperation: (value: any) => value is TextOperation\n\n /**\n * Invert an operation, returning a new operation that will exactly undo the\n * original when applied.\n */\n inverse: (op: Operation) => Operation\n}\n\n// eslint-disable-next-line no-redeclare\nexport const Operation: OperationInterface = {\n isNodeOperation(value: any): value is NodeOperation {\n return Operation.isOperation(value) && value.type.endsWith('_node')\n },\n\n isOperation(value: any): value is Operation {\n if (!isPlainObject(value)) {\n return false\n }\n\n switch (value.type) {\n case 'insert_node':\n return Path.isPath(value.path) && Node.isNode(value.node)\n case 'insert_text':\n return (\n typeof value.offset === 'number' &&\n typeof value.text === 'string' &&\n Path.isPath(value.path)\n )\n case 'merge_node':\n return (\n typeof value.position === 'number' &&\n Path.isPath(value.path) &&\n isPlainObject(value.properties)\n )\n case 'move_node':\n return Path.isPath(value.path) && Path.isPath(value.newPath)\n case 'remove_node':\n return Path.isPath(value.path) && Node.isNode(value.node)\n case 'remove_text':\n return (\n typeof value.offset === 'number' &&\n typeof value.text === 'string' &&\n Path.isPath(value.path)\n )\n case 'set_node':\n return (\n Path.isPath(value.path) &&\n isPlainObject(value.properties) &&\n isPlainObject(value.newProperties)\n )\n case 'set_selection':\n return (\n (value.properties === null && Range.isRange(value.newProperties)) ||\n (value.newProperties === null && Range.isRange(value.properties)) ||\n (isPlainObject(value.properties) &&\n isPlainObject(value.newProperties))\n )\n case 'split_node':\n return (\n Path.isPath(value.path) &&\n typeof value.position === 'number' &&\n isPlainObject(value.properties)\n )\n default:\n return false\n }\n },\n\n isOperationList(value: any): value is Operation[] {\n return (\n Array.isArray(value) && value.every(val => Operation.isOperation(val))\n )\n },\n\n isSelectionOperation(value: any): value is SelectionOperation {\n return Operation.isOperation(value) && value.type.endsWith('_selection')\n },\n\n isTextOperation(value: any): value is TextOperation {\n return Operation.isOperation(value) && value.type.endsWith('_text')\n },\n\n inverse(op: Operation): Operation {\n switch (op.type) {\n case 'insert_node': {\n return { ...op, type: 'remove_node' }\n }\n\n case 'insert_text': {\n return { ...op, type: 'remove_text' }\n }\n\n case 'merge_node': {\n return { ...op, type: 'split_node', path: Path.previous(op.path) }\n }\n\n case 'move_node': {\n const { newPath, path } = op\n\n // PERF: in this case the move operation is a no-op anyways.\n if (Path.equals(newPath, path)) {\n return op\n }\n\n // If the move happens completely within a single parent the path and\n // newPath are stable with respect to each other.\n if (Path.isSibling(path, newPath)) {\n return { ...op, path: newPath, newPath: path }\n }\n\n // If the move does not happen within a single parent it is possible\n // for the move to impact the true path to the location where the node\n // was removed from and where it was inserted. We have to adjust for this\n // and find the original path. We can accomplish this (only in non-sibling)\n // moves by looking at the impact of the move operation on the node\n // after the original move path.\n const inversePath = Path.transform(path, op)!\n const inverseNewPath = Path.transform(Path.next(path), op)!\n return { ...op, path: inversePath, newPath: inverseNewPath }\n }\n\n case 'remove_node': {\n return { ...op, type: 'insert_node' }\n }\n\n case 'remove_text': {\n return { ...op, type: 'insert_text' }\n }\n\n case 'set_node': {\n const { properties, newProperties } = op\n return { ...op, properties: newProperties, newProperties: properties }\n }\n\n case 'set_selection': {\n const { properties, newProperties } = op\n\n if (properties == null) {\n return {\n ...op,\n properties: newProperties as Range,\n newProperties: null,\n }\n } else if (newProperties == null) {\n return {\n ...op,\n properties: null,\n newProperties: properties as Range,\n }\n } else {\n return { ...op, properties: newProperties, newProperties: properties }\n }\n }\n\n case 'split_node': {\n return { ...op, type: 'merge_node', path: Path.next(op.path) }\n }\n }\n },\n}\n","import { Editor, EditorInterface } from '../interfaces/editor'\nimport { isPlainObject } from 'is-plain-object'\nimport { Range } from '../interfaces/range'\nimport { Node } from '../interfaces/node'\nimport { Operation } from '../interfaces/operation'\n\nconst IS_EDITOR_CACHE = new WeakMap<object, boolean>()\n\nexport const isEditor: EditorInterface['isEditor'] = (\n value: any\n): value is Editor => {\n const cachedIsEditor = IS_EDITOR_CACHE.get(value)\n if (cachedIsEditor !== undefined) {\n return cachedIsEditor\n }\n\n if (!isPlainObject(value)) {\n return false\n }\n\n const isEditor =\n typeof value.addMark === 'function' &&\n typeof value.apply === 'function' &&\n typeof value.deleteFragment === 'function' &&\n typeof value.insertBreak === 'function' &&\n typeof value.insertSoftBreak === 'function' &&\n typeof value.insertFragment === 'function' &&\n typeof value.insertNode === 'function' &&\n typeof value.insertText === 'function' &&\n typeof value.isElementReadOnly === 'function' &&\n typeof value.isInline === 'function' &&\n typeof value.isSelectable === 'function' &&\n typeof value.isVoid === 'function' &&\n typeof value.normalizeNode === 'function' &&\n typeof value.onChange === 'function' &&\n typeof value.removeMark === 'function' &&\n typeof value.getDirtyPaths === 'function' &&\n (value.marks === null || isPlainObject(value.marks)) &&\n (value.selection === null || Range.isRange(value.selection)) &&\n Node.isNodeList(value.children) &&\n Operation.isOperationList(value.operations)\n IS_EDITOR_CACHE.set(value, isEditor)\n return isEditor\n}\n","import {\n Ancestor,\n Descendant,\n Element,\n ExtendedType,\n Location,\n Node,\n NodeEntry,\n Operation,\n Path,\n PathRef,\n Point,\n PointRef,\n Range,\n RangeRef,\n Span,\n Text,\n Transforms,\n} from '..'\nimport {\n LeafEdge,\n MaximizeMode,\n RangeDirection,\n SelectionMode,\n TextDirection,\n TextUnit,\n TextUnitAdjustment,\n} from '../types/types'\nimport { OmitFirstArg } from '../utils/types'\nimport { isEditor } from '../editor/is-editor'\nimport {\n TextInsertFragmentOptions,\n TextInsertTextOptions,\n} from './transforms/text'\nimport { NodeInsertNodesOptions } from './transforms/node'\n\n/**\n * The `Editor` interface stores all the state of a Slate editor. It is extended\n * by plugins that wish to add their own helpers and implement new behaviors.\n */\nexport interface BaseEditor {\n // Core state.\n\n children: Descendant[]\n selection: Selection\n operations: Operation[]\n marks: EditorMarks | null\n\n // Overrideable core methods.\n\n apply: (operation: Operation) => void\n getDirtyPaths: (operation: Operation) => Path[]\n getFragment: () => Descendant[]\n isElementReadOnly: (element: Element) => boolean\n isSelectable: (element: Element) => boolean\n markableVoid: (element: Element) => boolean\n normalizeNode: (entry: NodeEntry, options?: { operation?: Operation }) => void\n onChange: (options?: { operation?: Operation }) => void\n shouldNormalize: ({\n iteration,\n dirtyPaths,\n operation,\n }: {\n iteration: number\n initialDirtyPathsLength: number\n dirtyPaths: Path[]\n operation?: Operation\n }) => boolean\n\n // Overrideable core transforms.\n\n addMark: OmitFirstArg<typeof Editor.addMark>\n collapse: OmitFirstArg<typeof Transforms.collapse>\n delete: OmitFirstArg<typeof Transforms.delete>\n deleteBackward: (unit: TextUnit) => void\n deleteForward: (unit: TextUnit) => void\n deleteFragment: OmitFirstArg<typeof Editor.deleteFragment>\n deselect: OmitFirstArg<typeof Transforms.deselect>\n insertBreak: OmitFirstArg<typeof Editor.insertBreak>\n insertFragment: OmitFirstArg<typeof Transforms.insertFragment>\n insertNode: OmitFirstArg<typeof Editor.insertNode>\n insertNodes: OmitFirstArg<typeof Transforms.insertNodes>\n insertSoftBreak: OmitFirstArg<typeof Editor.insertSoftBreak>\n insertText: OmitFirstArg<typeof Transforms.insertText>\n liftNodes: OmitFirstArg<typeof Transforms.liftNodes>\n mergeNodes: OmitFirstArg<typeof Transforms.mergeNodes>\n move: OmitFirstArg<typeof Transforms.move>\n moveNodes: OmitFirstArg<typeof Transforms.moveNodes>\n normalize: OmitFirstArg<typeof Editor.normalize>\n removeMark: OmitFirstArg<typeof Editor.removeMark>\n removeNodes: OmitFirstArg<typeof Transforms.removeNodes>\n select: OmitFirstArg<typeof Transforms.select>\n setNodes: <T extends Node>(\n props: Partial<T>,\n options?: {\n at?: Location\n match?: NodeMatch<T>\n mode?: MaximizeMode\n hanging?: boolean\n split?: boolean\n voids?: boolean\n compare?: PropsCompare\n merge?: PropsMerge\n }\n ) => void\n setNormalizing: OmitFirstArg<typeof Editor.setNormalizing>\n setPoint: OmitFirstArg<typeof Transforms.setPoint>\n setSelection: OmitFirstArg<typeof Transforms.setSelection>\n splitNodes: OmitFirstArg<typeof Transforms.splitNodes>\n unsetNodes: OmitFirstArg<typeof Transforms.unsetNodes>\n unwrapNodes: OmitFirstArg<typeof Transforms.unwrapNodes>\n withoutNormalizing: OmitFirstArg<typeof Editor.withoutNormalizing>\n wrapNodes: OmitFirstArg<typeof Transforms.wrapNodes>\n\n // Overrideable core queries.\n\n above: <T extends Ancestor>(\n options?: EditorAboveOptions<T>\n ) => NodeEntry<T> | undefined\n after: OmitFirstArg<typeof Editor.after>\n before: OmitFirstArg<typeof Editor.before>\n edges: OmitFirstArg<typeof Editor.edges>\n elementReadOnly: OmitFirstArg<typeof Editor.elementReadOnly>\n end: OmitFirstArg<typeof Editor.end>\n first: OmitFirstArg<typeof Editor.first>\n fragment: OmitFirstArg<typeof Editor.fragment>\n getMarks: OmitFirstArg<typeof Editor.marks>\n hasBlocks: OmitFirstArg<typeof Editor.hasBlocks>\n hasInlines: OmitFirstArg<typeof Editor.hasInlines>\n hasPath: OmitFirstArg<typeof Editor.hasPath>\n hasTexts: OmitFirstArg<typeof Editor.hasTexts>\n isBlock: OmitFirstArg<typeof Editor.isBlock>\n isEdge: OmitFirstArg<typeof Editor.isEdge>\n isEmpty: OmitFirstArg<typeof Editor.isEmpty>\n isEnd: OmitFirstArg<typeof Editor.isEnd>\n isInline: OmitFirstArg<typeof Editor.isInline>\n isNormalizing: OmitFirstArg<typeof Editor.isNormalizing>\n isStart: OmitFirstArg<typeof Editor.isStart>\n isVoid: OmitFirstArg<typeof Editor.isVoid>\n last: OmitFirstArg<typeof Editor.last>\n leaf: OmitFirstArg<typeof Editor.leaf>\n levels: <T extends Node>(\n options?: EditorLevelsOptions<T>\n ) => Generator<NodeEntry<T>, void, undefined>\n next: <T extends Descendant>(\n options?: EditorNextOptions<T>\n ) => NodeEntry<T> | undefined\n node: OmitFirstArg<typeof Editor.node>\n nodes: <T extends Node>(\n options?: EditorNodesOptions<T>\n ) => Generator<NodeEntry<T>, void, undefined>\n parent: OmitFirstArg<typeof Editor.parent>\n path: OmitFirstArg<typeof Editor.path>\n pathRef: OmitFirstArg<typeof Editor.pathRef>\n pathRefs: OmitFirstArg<typeof Editor.pathRefs>\n point: OmitFirstArg<typeof Editor.point>\n pointRef: OmitFirstArg<typeof Editor.pointRef>\n pointRefs: OmitFirstArg<typeof Editor.pointRefs>\n positions: OmitFirstArg<typeof Editor.positions>\n previous: <T extends Node>(\n options?: EditorPreviousOptions<T>\n ) => NodeEntry<T> | undefined\n range: OmitFirstArg<typeof Editor.range>\n rangeRef: OmitFirstArg<typeof Editor.rangeRef>\n rangeRefs: OmitFirstArg<typeof Editor.rangeRefs>\n start: OmitFirstArg<typeof Editor.start>\n string: OmitFirstArg<typeof Editor.string>\n unhangRange: OmitFirstArg<typeof Editor.unhangRange>\n void: OmitFirstArg<typeof Editor.void>\n}\n\nexport type Editor = ExtendedType<'Editor', BaseEditor>\n\nexport type BaseSelection = Range | null\n\nexport type Selection = ExtendedType<'Selection', BaseSelection>\n\nexport type EditorMarks = Omit<Text, 'text'>\n\nexport interface EditorAboveOptions<T extends Ancestor> {\n at?: Location\n match?: NodeMatch<T>\n mode?: MaximizeMode\n voids?: boolean\n}\n\nexport interface EditorAfterOptions {\n distance?: number\n unit?: TextUnitAdjustment\n voids?: boolean\n}\n\nexport interface EditorBeforeOptions {\n distance?: number\n unit?: TextUnitAdjustment\n voids?: boolean\n}\n\nexport interface EditorDirectedDeletionOptions {\n unit?: TextUnit\n}\n\nexport interface EditorElementReadOnlyOptions {\n at?: Location\n mode?: MaximizeMode\n voids?: boolean\n}\n\nexport interface EditorFragmentDeletionOptions {\n direction?: TextDirection\n}\n\nexport interface EditorLeafOptions {\n depth?: number\n edge?: LeafEdge\n}\n\nexport interface EditorLevelsOptions<T extends Node> {\n at?: Location\n match?: NodeMatch<T>\n reverse?: boolean\n voids?: boolean\n}\n\nexport interface EditorNextOptions<T extends Descendant> {\n at?: Location\n match?: NodeMatch<T>\n mode?: SelectionMode\n voids?: boolean\n}\n\nexport interface EditorNodeOptions {\n depth?: number\n edge?: LeafEdge\n}\n\nexport interface EditorNodesOptions<T extends Node> {\n at?: Location | Span\n match?: NodeMatch<T>\n mode?: SelectionMode\n universal?: boolean\n reverse?: boolean\n voids?: boolean\n ignoreNonSelectable?: boolean\n}\n\nexport interface EditorNormalizeOptions {\n force?: boolean\n operation?: Operation\n}\n\nexport interface EditorParentOptions {\n depth?: number\n edge?: LeafEdge\n}\n\nexport interface EditorPathOptions {\n depth?: number\n edge?: LeafEdge\n}\n\nexport interface EditorPathRefOptions {\n affinity?: TextDirection | null\n}\n\nexport interface EditorPointOptions {\n edge?: LeafEdge\n}\n\nexport interface EditorPointRefOptions {\n affinity?: TextDirection | null\n}\n\nexport interface EditorPositionsOptions {\n at?: Location\n unit?: TextUnitAdjustment\n reverse?: boolean\n voids?: boolean\n ignoreNonSelectable?: boolean\n}\n\nexport interface EditorPreviousOptions<T extends Node> {\n at?: Location\n match?: NodeMatch<T>\n mode?: SelectionMode\n voids?: boolean\n}\n\nexport interface EditorRangeRefOptions {\n affinity?: RangeDirection | null\n}\n\nexport interface EditorStringOptions {\n voids?: boolean\n}\n\nexport interface EditorUnhangRangeOptions {\n voids?: boolean\n}\n\nexport interface EditorVoidOptions {\n at?: Location\n mode?: MaximizeMode\n voids?: boolean\n}\n\nexport interface EditorInterface {\n /**\n * Get the ancestor above a location in the document.\n */\n above: <T extends Ancestor>(\n editor: Editor,\n options?: EditorAboveOptions<T>\n ) => NodeEntry<T> | undefined\n\n /**\n * Add a custom property to the leaf text nodes in the current selection.\n *\n * If the selection is currently collapsed, the marks will be added to the\n * `editor.marks` property instead, and applied when text is inserted next.\n */\n addMark: (editor: Editor, key: string, value: any) => void\n\n /**\n * Get the point after a location.\n */\n after: (\n editor: Editor,\n at: Location,\n options?: EditorAfterOptions\n ) => Point | undefined\n\n /**\n * Get the point before a location.\n */\n before: (\n editor: Editor,\n at: Location,\n options?: EditorBeforeOptions\n ) => Point | undefined\n\n /**\n * Delete content in the editor backward from the current selection.\n */\n deleteBackward: (\n editor: Editor,\n options?: EditorDirectedDeletionOptions\n ) => void\n\n /**\n * Delete content in the editor forward from the current selection.\n */\n deleteForward: (\n editor: Editor,\n options?: EditorDirectedDeletionOptions\n ) => void\n\n /**\n * Delete the content in the current selection.\n */\n deleteFragment: (\n editor: Editor,\n options?: EditorFragmentDeletionOptions\n ) => void\n\n /**\n * Get the start and end points of a location.\n */\n edges: (editor: Editor, at: Location) => [Point, Point]\n\n /**\n * Match a read-only element in the current branch of the editor.\n */\n elementReadOnly: (\n editor: Editor,\n options?: EditorElementReadOnlyOptions\n ) => NodeEntry<Element> | undefined\n\n /**\n * Get the end point of a location.\n */\n end: (editor: Editor, at: Location) => Point\n\n /**\n * Get the first node at a location.\n */\n first: (editor: Editor, at: Location) => NodeEntry\n\n /**\n * Get the fragment at a location.\n */\n fragment: (editor: Editor, at: Location) => Descendant[]\n\n /**\n * Check if a node has block children.\n */\n hasBlocks: (editor: Editor, element: Element) => boolean\n\n /**\n * Check if a node has inline and text children.\n */\n hasInlines: (editor: Editor, element: Element) => boolean\n\n hasPath: (editor: Editor, path: Path) => boolean\n\n /**\n * Check if a node has text children.\n */\n hasTexts: (editor: Editor, element: Element) => boolean\n\n /**\n * Insert a block break at the current selection.\n *\n * If the selection is currently expanded, it will be deleted first.\n */\n insertBreak: (editor: Editor) => void\n\n /**\n * Inserts a fragment\n * at the specified location or (if not defined) the current selection or (if not defined) the end of the document.\n */\n insertFragment: (\n editor: Editor,\n fragment: Node[],\n options?: TextInsertFragmentOptions\n ) => void\n\n /**\n * Atomically inserts `nodes`\n * at the specified location or (if not defined) the current selection or (if not defined) the end of the document.\n */\n insertNode: <T extends Node>(\n editor: Editor,\n node: Node,\n options?: NodeInsertNodesOptions<T>\n ) => void\n\n /**\n * Insert a soft break at the current selection.\n *\n * If the selection is currently expanded, it will be deleted first.\n */\n insertSoftBreak: (editor: Editor) => void\n\n /**\n * Insert a string of text\n * at the specified location or (if not defined) the current selection or (if not defined) the end of the document.\n */\n insertText: (\n editor: Editor,\n text: string,\n options?: TextInsertTextOptions\n ) => void\n\n /**\n * Check if a value is a block `Element` object.\n */\n isBlock: (editor: Editor, value: Element) => boolean\n\n /**\n * Check if a point is an edge of a location.\n */\n isEdge: (editor: Editor, point: Point, at: Location) => boolean\n\n /**\n * Check if a value is an `Editor` object.\n */\n isEditor: (value: any) => value is Editor\n\n /**\n * Check if a value is a read-only `Element` object.\n */\n isElementReadOnly: (editor: Editor, element: Element) => boolean\n\n /**\n * Check if an element is empty, accounting for void nodes.\n */\n isEmpty: (editor: Editor, element: Element) => boolean\n\n /**\n * Check if a point is the end point of a location.\n */\n isEnd: (editor: Editor, point: Point, at: Location) => boolean\n\n /**\n * Check if a value is an inline `Element` object.\n */\n isInline: (editor: Editor, value: Element) => boolean\n\n /**\n * Check if the editor is currently normalizing after each operation.\n */\n isNormalizing: (editor: Editor) => boolean\n\n /**\n * Check if a value is a selectable `Element` object.\n */\n isSelectable: (editor: Editor, element: Element) => boolean\n\n /**\n * Check if a point is the start point of a location.\n */\n isStart: (editor: Editor, point: Point, at: Location) => boolean\n\n /**\n * Check if a value is a void `Element` object.\n */\n isVoid: (editor: Editor, value: Element) => boolean\n\n /**\n * Get the last node at a location.\n */\n last: (editor: Editor, at: Location) => NodeEntry\n\n /**\n * Get the leaf text node at a location.\n */\n leaf: (\n editor: Editor,\n at: Location,\n options?: EditorLeafOptions\n ) => NodeEntry<Text>\n\n /**\n * Iterate through all of the levels at a location.\n */\n levels: <T extends Node>(\n editor: Editor,\n options?: EditorLevelsOptions<T>\n ) => Generator<NodeEntry<T>, void, undefined>\n\n /**\n * Get the marks that would be added to text at the current selection.\n */\n marks: (editor: Editor) => Omit<Text, 'text'> | null\n\n /**\n * Get the matching node in the branch of the document after a location.\n */\n next: <T extends Descendant>(\n editor: Editor,\n options?: EditorNextOptions<T>\n ) => NodeEntry<T> | undefined\n\n /**\n * Get the node at a location.\n */\n node: (editor: Editor, at: Location, options?: EditorNodeOptions) => NodeEntry\n\n /**\n * Iterate through all of the nodes in the Editor.\n */\n nodes: <T extends Node>(\n editor: Editor,\n options?: EditorNodesOptions<T>\n ) => Generator<NodeEntry<T>, void, undefined>\n\n /**\n * Normalize any dirty objects in the editor.\n */\n normalize: (editor: Editor, options?: EditorNormalizeOptions) => void\n\n /**\n * Get the parent node of a location.\n */\n parent: (\n editor: Editor,\n at: Location,\n options?: EditorParentOptions\n ) => NodeEntry<Ancestor>\n\n /**\n * Get the path of a location.\n */\n path: (editor: Editor, at: Location, options?: EditorPathOptions) => Path\n\n /**\n * Create a mutable ref for a `Path` object, which will stay in sync as new\n * operations are applied to the editor.\n */\n pathRef: (\n editor: Editor,\n path: Path,\n options?: EditorPathRefOptions\n ) => PathRef\n\n /**\n * Get the set of currently tracked path refs of the editor.\n */\n pathRefs: (editor: Editor) => Set<PathRef>\n\n /**\n * Get the start or end point of a location.\n */\n point: (editor: Editor, at: Location, options?: EditorPointOptions) => Point\n\n /**\n * Create a mutable ref for a `Point` object, which will stay in sync as new\n * operations are applied to the editor.\n */\n pointRef: (\n editor: Editor,\n point: Point,\n options?: EditorPointRefOptions\n ) => PointRef\n\n /**\n * Get the set of currently tracked point refs of the editor.\n */\n pointRefs: (editor: Editor) => Set<PointRef>\n\n /**\n * Return all the positions in `at` range where a `Point` can be placed.\n *\n * By default, moves forward by individual offsets at a time, but\n * the `unit` option can be used to to move by character, word, line, or block.\n *\n * The `reverse` option can be used to change iteration direction.\n *\n * Note: By default void nodes are treated as a single point and iteration\n * will not happen inside their content unless you pass in true for the\n * `voids` option, then iteration will occur.\n */\n positions: (\n editor: Editor,\n options?: EditorPositionsOptions\n ) => Generator<Point, void, undefined>\n\n /**\n * Get the matching node in the branch of the document before a location.\n */\n previous: <T extends Node>(\n editor: Editor,\n options?: EditorPreviousOptions<T>\n ) => NodeEntry<T> | undefined\n\n /**\n * Get a range of a location.\n */\n range: (editor: Editor, at: Location, to?: Location) => Range\n\n /**\n * Create a mutable ref for a `Range` object, which will stay in sync as new\n * operations are applied to the editor.\n */\n rangeRef: (\n editor: Editor,\n range: Range,\n options?: EditorRangeRefOptions\n ) => RangeRef\n\n /**\n * Get the set of currently tracked range refs of the editor.\n */\n rangeRefs: (editor: Editor) => Set<RangeRef>\n\n /**\n * Remove a custom property from all of the leaf text nodes in the current\n * selection.\n *\n * If the selection is currently collapsed, the removal will be stored on\n * `editor.marks` and applied to the text inserted next.\n */\n removeMark: (editor: Editor, key: string) => void\n\n /**\n * Manually set if the editor should currently be normalizing.\n *\n * Note: Using this incorrectly can leave the editor in an invalid state.\n *\n */\n setNormalizing: (editor: Editor, isNormalizing: boolean) => void\n\n /**\n * Get the start point of a location.\n */\n start: (editor: Editor, at: Location) => Point\n\n /**\n * Get the text string content of a location.\n *\n * Note: by default the text of void nodes is considered to be an empty\n * string, regardless of content, unless you pass in true for the voids option\n */\n string: (\n editor: Editor,\n at: Location,\n options?: EditorStringOptions\n ) => string\n\n /**\n * Convert a range into a non-hanging one.\n */\n unhangRange: (\n editor: Editor,\n range: Range,\n options?: EditorUnhangRangeOptions\n ) => Range\n\n /**\n * Match a void node in the current branch of the editor.\n */\n void: (\n editor: Editor,\n options?: EditorVoidOptions\n ) => NodeEntry<Element> | undefined\n\n /**\n * Call a function, deferring normalization until after it completes.\n */\n withoutNormalizing: (editor: Editor, fn: () => void) => void\n}\n\n// eslint-disable-next-line no-redeclare\nexport const Editor: EditorInterface = {\n above(editor, options) {\n return editor.above(options)\n },\n\n addMark(editor, key, value) {\n editor.addMark(key, value)\n },\n\n after(editor, at, options) {\n return editor.after(at, options)\n },\n\n before(editor, at, options) {\n return editor.before(at, options)\n },\n\n deleteBackward(editor, options = {}) {\n const { unit = 'character' } = options\n editor.deleteBackward(unit)\n },\n\n deleteForward(editor, options = {}) {\n const { unit = 'character' } = options\n editor.deleteForward(unit)\n },\n\n deleteFragment(editor, options) {\n editor.deleteFragment(options)\n },\n\n edges(editor, at) {\n return editor.edges(at)\n },\n\n elementReadOnly(editor: Editor, options: EditorElementReadOnlyOptions = {}) {\n return editor.elementReadOnly(options)\n },\n\n end(editor, at) {\n return editor.end(at)\n },\n\n first(editor, at) {\n return editor.first(at)\n },\n\n fragment(editor, at) {\n return editor.fragment(at)\n },\n\n hasBlocks(editor, element) {\n return editor.hasBlocks(element)\n },\n\n hasInlines(editor, element) {\n return editor.hasInlines(element)\n },\n\n hasPath(editor, path) {\n return editor.hasPath(path)\n },\n\n hasTexts(editor, element) {\n return editor.hasTexts(element)\n },\n\n insertBreak(editor) {\n editor.insertBreak()\n },\n\n insertFragment(editor, fragment, options) {\n editor.insertFragment(fragment, options)\n },\n\n insertNode(editor, node) {\n editor.insertNode(node)\n },\n\n insertSoftBreak(editor) {\n editor.insertSoftBreak()\n },\n\n insertText(editor, text) {\n editor.insertText(text)\n },\n\n isBlock(editor, value) {\n return editor.isBlock(value)\n },\n\n isEdge(editor, point, at) {\n return editor.isEdge(point, at)\n },\n\n isEditor(value: any): value is Editor {\n return isEditor(value)\n },\n\n isElementReadOnly(editor, element) {\n return editor.isElementReadOnly(element)\n },\n\n isEmpty(editor, element) {\n return editor.isEmpty(element)\n },\n\n isEnd(editor, point, at) {\n return editor.isEnd(point, at)\n },\n\n isInline(editor, value) {\n return editor.isInline(value)\n },\n\n isNormalizing(editor) {\n return editor.isNormalizing()\n },\n\n isSelectable(editor: Editor, value: Element) {\n return editor.isSelectable(value)\n },\n\n isStart(editor, point, at) {\n return editor.isStart(point, at)\n },\n\n isVoid(editor, value) {\n return editor.isVoid(value)\n },\n\n last(editor, at) {\n return editor.last(at)\n },\n\n leaf(editor, at, options) {\n return editor.leaf(at, options)\n },\n\n levels(editor, options) {\n return editor.levels(options)\n },\n\n marks(editor) {\n return editor.getMarks()\n },\n\n next<T extends Descendant>(\n editor: Editor,\n options?: EditorNextOptions<T>\n ): NodeEntry<T> | undefined {\n return editor.next(options)\n },\n\n node(editor, at, options) {\n return editor.node(at, options)\n },\n\n nodes(editor, options) {\n return editor.nodes(options)\n },\n\n normalize(editor, options) {\n editor.normalize(options)\n },\n\n parent(editor, at, options) {\n return editor.parent(at, options)\n },\n\n path(editor, at, options) {\n return editor.path(at, options)\n },\n\n pathRef(editor, path, options) {\n return editor.pathRef(path, options)\n },\n\n pathRefs(editor) {\n return editor.pathRefs()\n },\n\n point(editor, at, options) {\n return editor.point(at, options)\n },\n\n pointRef(editor, point, options) {\n return editor.pointRef(point, options)\n },\n\n pointRefs(editor) {\n return editor.pointRefs()\n },\n\n positions(editor, options) {\n return editor.positions(options)\n },\n\n previous(editor, options) {\n return editor.previous(options)\n },\n\n range(editor, at, to) {\n return editor.range(at, to)\n },\n\n rangeRef(editor, range, options) {\n return editor.rangeRef(range, options)\n },\n\n rangeRefs(editor) {\n return editor.rangeRefs()\n },\n\n removeMark(editor, key) {\n editor.removeMark(key)\n },\n\n setNormalizing(editor, isNormalizing) {\n editor.setNormalizing(isNormalizing)\n },\n\n start(editor, at) {\n return editor.start(at)\n },\n\n string(editor, at, options) {\n return editor.string(at, options)\n },\n\n unhangRange(editor, range, options) {\n return editor.unhangRange(range, options)\n },\n\n void(editor, options) {\n return editor.void(options)\n },\n\n withoutNormalizing(editor, fn: () => void) {\n editor.withoutNormalizing(fn)\n },\n}\n\n/**\n * A helper type for narrowing matched nodes with a predicate.\n */\n\nexport type NodeMatch<T extends Node> =\n | ((node: Node, path: Path) => node is T)\n | ((node: Node, path: Path) => boolean)\n\nexport type PropsCompare = (prop: Partial<Node>, node: Partial<Node>) => boolean\nexport type PropsMerge = (prop: Partial<Node>, node: Partial<Node>) => object\n","import { isPlainObject } from 'is-plain-object'\nimport { produce } from 'immer'\nimport { ExtendedType, Operation, Path } from '..'\nimport { TextDirection } from '../types/types'\n\n/**\n * `Point` objects refer to a specific location in a text node in a Slate\n * document. Its path refers to the location of the node in the tree, and its\n * offset refers to the distance into the node's string of text. Points can\n * only refer to `Text` nodes.\n */\n\nexport interface BasePoint {\n path: Path\n offset: number\n}\n\nexport type Point = ExtendedType<'Point', BasePoint>\n\nexport interface PointTransformOptions {\n affinity?: TextDirection | null\n}\n\nexport interface PointInterface {\n /**\n * Compare a point to another, returning an integer indicating whether the\n * point was before, at, or after the other.\n */\n compare: (point: Point, another: Point) => -1 | 0 | 1\n\n /**\n * Check if a point is after another.\n */\n isAfter: (point: Point, another: Point) => boolean\n\n /**\n * Check if a point is before another.\n */\n isBefore: (point: Point, another: Point) => boolean\n\n /**\n * Check if a point is exactly equal to another.\n */\n equals: (point: Point, another: Point) => boolean\n\n /**\n * Check if a value implements the `Point` interface.\n */\n isPoint: (value: any) => value is Point\n\n /**\n * Transform a point by an operation.\n */\n transform: (\n point: Point,\n op: Operation,\n options?: PointTransformOptions\n ) => Point | null\n}\n\n// eslint-disable-next-line no-redeclare\nexport const Point: PointInterface = {\n compare(point: Point, another: Point): -1 | 0 | 1 {\n const result = Path.compare(point.path, another.path)\n\n if (result === 0) {\n if (point.offset < another.offset) return -1\n if (point.offset > another.offset) return 1\n return 0\n }\n\n return result\n },\n\n isAfter(point: Point, another: Point): boolean {\n return Point.compare(point, another) === 1\n },\n\n isBefore(point: Point, another: Point): boolean {\n return Point.compare(point, another) === -1\n },\n\n equals(point: Point, another: Point): boolean {\n // PERF: ensure the offsets are equal first since they are cheaper to check.\n return (\n point.offset === another.offset && Path.equals(point.path, another.path)\n )\n },\n\n isPoint(value: any): value is Point {\n return (\n isPlainObject(value) &&\n typeof value.offset === 'number' &&\n Path.isPath(value.path)\n )\n },\n\n transform(\n point: Point | null,\n op: Operation,\n options: PointTransformOptions = {}\n ): Point | null {\n return produce(point, p => {\n if (p === null) {\n return null\n }\n const { affinity = 'forward' } = options\n const { path, offset } = p\n\n switch (op.type) {\n case 'insert_node':\n case 'move_node': {\n p.path = Path.transform(path, op, options)!\n break\n }\n\n case 'insert_text': {\n if (\n Path.equals(op.path, path) &&\n (op.offset < offset ||\n (op.offset === offset && affinity === 'forward'))\n ) {\n p.offset += op.text.length\n }\n\n break\n }\n\n case 'merge_node': {\n if (Path.equals(op.path, path)) {\n p.offset += op.position\n }\n\n p.path = Path.transform(path, op, options)!\n break\n }\n\n case 'remove_text': {\n if (Path.equals(op.path, path) && op.offset <= offset) {\n p.offset -= Math.min(offset - op.offset, op.text.length)\n }\n\n break\n }\n\n case 'remove_node': {\n if (Path.equals(op.path, path) || Path.isAncestor(op.path, path)) {\n return null\n }\n\n p.path = Path.transform(path, op, options)!\n break\n }\n\n case 'split_node': {\n if (Path.equals(op.path, path)) {\n if (op.position === offset && affinity == null) {\n return null\n } else if (\n op.position < offset ||\n (op.position === offset && affinity === 'forward')\n ) {\n p.offset -= op.position\n\n p.path = Path.transform(path, op, {\n ...options,\n affinity: 'forward',\n })!\n }\n } else {\n p.path = Path.transform(path, op, options)!\n }\n\n break\n }\n }\n })\n },\n}\n\n/**\n * `PointEntry` objects are returned when iterating over `Point` objects that\n * belong to a range.\n */\n\nexport type PointEntry = [Point, 'anchor' | 'focus']\n","export type Scrubber = (key: string, value: unknown) => unknown\n\nexport interface ScrubberInterface {\n setScrubber(scrubber: Scrubber | undefined): void\n stringify(value: any): string\n}\n\nlet _scrubber: Scrubber | undefined = undefined\n\n/**\n * This interface implements a stringify() function, which is used by Slate\n * internally when generating exceptions containing end user data. Developers\n * using Slate may call Scrubber.setScrubber() to alter the behavior of this\n * stringify() function.\n *\n * For example, to prevent the cleartext logging of 'text' fields within Nodes:\n *\n * import { Scrubber } from 'slate';\n * Scrubber.setScrubber((key, val) => {\n * if (key === 'text') return '...scrubbed...'\n * return val\n * });\n *\n */\n// eslint-disable-next-line no-redeclare\nexport const Scrubber: ScrubberInterface = {\n setScrubber(scrubber: Scrubber | undefined): void {\n _scrubber = scrubber\n },\n\n stringify(value: any): string {\n return JSON.stringify(value, _scrubber)\n },\n}\n","import { isPlainObject } from 'is-plain-object'\nimport { Range } from '..'\nimport { ExtendedType } from '../types/custom-types'\nimport { isDeepEqual } from '../utils/deep-equal'\n\n/**\n * `Text` objects represent the nodes that contain the actual text content of a\n * Slate document along with any formatting properties. They are always leaf\n * nodes in the document tree as they cannot contain any children.\n */\n\nexport interface BaseText {\n text: string\n}\n\nexport type Text = ExtendedType<'Text', BaseText>\n\nexport interface TextEqualsOptions {\n loose?: boolean\n}\n\nexport interface TextInterface {\n /**\n * Check if two text nodes are equal.\n *\n * When loose is set, the text is not compared. This is\n * used to check whether sibling text nodes can be merged.\n */\n equals: (text: Text, another: Text, options?: TextEqualsOptions) => boolean\n\n /**\n * Check if a value implements the `Text` interface.\n */\n isText: (value: any) => value is Text\n\n /**\n * Check if a value is a list of `Text` objects.\n */\n isTextList: (value: any) => value is Text[]\n\n /**\n * Check if some props are a partial of Text.\n */\n isTextProps: (props: any) => props is Partial<Text>\n\n /**\n * Check if an text matches set of properties.\n *\n * Note: this is for matching custom properties, and it does not ensure that\n * the `text` property are two nodes equal.\n */\n matches: (text: Text, props: Partial<Text>) => boolean\n\n /**\n * Get the leaves for a text node given decorations.\n */\n decorations: (node: Text, decorations: Range[]) => Text[]\n}\n\n// eslint-disable-next-line no-redeclare\nexport const Text: TextInterface = {\n equals(text: Text, another: Text, options: TextEqualsOptions = {}): boolean {\n const { loose = false } = options\n\n function omitText(obj: Record<any, any>) {\n const { text, ...rest } = obj\n\n return rest\n }\n\n return isDeepEqual(\n loose ? omitText(text) : text,\n loose ? omitText(another) : another\n )\n },\n\n isText(value: any): value is Text {\n return isPlainObject(value) && typeof value.text === 'string'\n },\n\n isTextList(value: any): value is Text[] {\n return Array.isArray(value) && value.every(val => Text.isText(val))\n },\n\n isTextProps(props: any): props is Partial<Text> {\n return (props as Partial<Text>).text !== undefined\n },\n\n matches(text: Text, props: Partial<Text>): boolean {\n for (const key in props) {\n if (key === 'text') {\n continue\n }\n\n if (\n !text.hasOwnProperty(key) ||\n text[<keyof Text>key] !== props[<keyof Text>key]\n ) {\n return false\n }\n }\n\n return true\n },\n\n decorations(node: Text, decorations: Range[]): Text[] {\n let leaves: Text[] = [{ ...node }]\n\n for (const dec of decorations) {\n const { anchor, focus, ...rest } = dec\n const [start, end] = Range.edges(dec)\n const next = []\n let leafEnd = 0\n const decorationStart = start.offset\n const decorationEnd = end.offset\n\n for (const leaf of leaves) {\n const { length } = leaf.text\n const leafStart = leafEnd\n leafEnd += length\n\n // If the range encompasses the entire leaf, add the range.\n if (decorationStart <= leafStart && leafEnd <= decorationEnd) {\n Object.assign(leaf, rest)\n next.push(leaf)\n continue\n }\n\n // If the range expanded and match the leaf, or starts after, or ends before it, continue.\n if (\n (decorationStart !== decorationEnd &&\n (decorationStart === leafEnd || decorationEnd === leafStart)) ||\n decorationStart > leafEnd ||\n decorationEnd < leafStart ||\n (decorationEnd === leafStart && leafStart !== 0)\n ) {\n next.push(leaf)\n continue\n }\n\n // Otherwise we need to split the leaf, at the start, end, or both,\n // and add the range to the middle intersecting section. Do the end\n // split first since we don't need to update the offset that way.\n let middle = leaf\n let before\n let after\n\n if (decorationEnd < leafEnd) {\n const off = decorationEnd - leafStart\n after = { ...middle, text: middle.text.slice(off) }\n middle = { ...middle, text: middle.text.slice(0, off) }\n }\n\n if (decorationStart > leafStart) {\n const off = decorationStart - leafStart\n before = { ...middle, text: middle.text.slice(0, off) }\n middle = { ...middle, text: middle.text.slice(off) }\n }\n\n Object.assign(middle, rest)\n\n if (before) {\n next.push(before)\n }\n\n next.push(middle)\n\n if (after) {\n next.push(after)\n }\n }\n\n leaves = next\n }\n\n return leaves\n },\n}\n","import { Editor, Location } from '../interfaces'\n\n/**\n * Get the default location to insert content into the editor.\n * By default, use the selection as the target location. But if there is\n * no selection, insert at the end of the document since that is such a\n * common use case when inserting from a non-selected state.\n */\nexport const getDefaultInsertLocation = (editor: Editor): Location => {\n if (editor.selection) {\n return editor.selection\n } else if (editor.children.length > 0) {\n return Editor.end(editor, [])\n } else {\n return [0]\n }\n}\n","// Character (grapheme cluster) boundaries are determined according to\n// the default grapheme cluster boundary specification, extended grapheme clusters variant[1].\n//\n// References:\n//\n// [1] https://www.unicode.org/reports/tr29/#Default_Grapheme_Cluster_Table\n// [2] https://www.unicode.org/Public/UCD/latest/ucd/auxiliary/GraphemeBreakProperty.txt\n// [3] https://www.unicode.org/Public/UCD/latest/ucd/auxiliary/GraphemeBreakTest.html\n// [4] https://www.unicode.org/Public/UCD/latest/ucd/auxiliary/GraphemeBreakTest.txt\n\n/**\n * Get the distance to the end of the first character in a string of text.\n */\n\nexport const getCharacterDistance = (str: string, isRTL = false): number => {\n const isLTR = !isRTL\n const codepoints = isRTL ? codepointsIteratorRTL(str) : str\n\n let left: CodepointType = CodepointType.None\n let right: CodepointType = CodepointType.None\n let distance = 0\n // Evaluation of these conditions are deferred.\n let gb11: boolean | null = null // Is GB11 applicable?\n let gb12Or13: boolean | null = null // Is GB12 or GB13 applicable?\n\n for (const char of codepoints) {\n const code = char.codePointAt(0)\n if (!code) break\n\n const type = getCodepointType(char, code)\n ;[left, right] = isLTR ? [right, type] : [type, left]\n\n if (\n intersects(left, CodepointType.ZWJ) &&\n intersects(right, CodepointType.ExtPict)\n ) {\n if (isLTR) {\n gb11 = endsWithEmojiZWJ(str.substring(0, distance))\n } else {\n gb11 = endsWithEmojiZWJ(str.substring(0, str.length - distance))\n }\n if (!gb11) break\n }\n\n if (\n intersects(left, CodepointType.RI) &&\n intersects(right, CodepointType.RI)\n ) {\n if (gb12Or13 !== null) {\n gb12Or13 = !gb12Or13\n } else {\n if (isLTR) {\n gb12Or13 = true\n } else {\n gb12Or13 = endsWithOddNumberOfRIs(\n str.substring(0, str.length - distance)\n )\n }\n }\n if (!gb12Or13) break\n }\n\n if (\n left !== CodepointType.None &&\n right !== CodepointType.None &&\n isBoundaryPair(left, right)\n ) {\n break\n }\n\n distance += char.length\n }\n\n return distance || 1\n}\n\nconst SPACE = /\\s/\nconst PUNCTUATION =\n /[\\u002B\\u0021-\\u0023\\u0025-\\u002A\\u002C-\\u002F\\u003A\\u003B\\u003F\\u0040\\u005B-\\u005D\\u005F\\u007B\\u007D\\u00A1\\u00A7\\u00AB\\u00B6\\u00B7\\u00BB\\u00BF\\u037E\\u0387\\u055A-\\u055F\\u0589\\u058A\\u05BE\\u05C0\\u05C3\\u05C6\\u05F3\\u05F4\\u0609\\u060A\\u060C\\u060D\\u061B\\u061E\\u061F\\u066A-\\u066D\\u06D4\\u0700-\\u070D\\u07F7-\\u07F9\\u0830-\\u083E\\u085E\\u0964\\u0965\\u0970\\u0AF0\\u0DF4\\u0E4F\\u0E5A\\u0E5B\\u0F04-\\u0F12\\u0F14\\u0F3A-\\u0F3D\\u0F85\\u0FD0-\\u0FD4\\u0FD9\\u0FDA\\u104A-\\u104F\\u10FB\\u1360-\\u1368\\u1400\\u166D\\u166E\\u169B\\u169C\\u16EB-\\u16ED\\u1735\\u1736\\u17D4-\\u17D6\\u17D8-\\u17DA\\u1800-\\u180A\\u1944\\u1945\\u1A1E\\u1A1F\\u1AA0-\\u1AA6\\u1AA8-\\u1AAD\\u1B5A-\\u1B60\\u1BFC-\\u1BFF\\u1C3B-\\u1C3F\\u1C7E\\u1C7F\\u1CC0-\\u1CC7\\u1CD3\\u2010-\\u2027\\u2030-\\u2043\\u2045-\\u2051\\u2053-\\u205E\\u207D\\u207E\\u208D\\u208E\\u2329\\u232A\\u2768-\\u2775\\u27C5\\u27C6\\u27E6-\\u27EF\\u2983-\\u2998\\u29D8-\\u29DB\\u29FC\\u29FD\\u2CF9-\\u2CFC\\u2CFE\\u2CFF\\u2D70\\u2E00-\\u2E2E\\u2E30-\\u2E3B\\u3001-\\u3003\\u3008-\\u3011\\u3014-\\u301F\\u3030\\u303D\\u30A0\\u30FB\\uA4FE\\uA4FF\\uA60D-\\uA60F\\uA673\\uA67E\\uA6F2-\\uA6F7\\uA874-\\uA877\\uA8CE\\uA8CF\\uA8F8-\\uA8FA\\uA92E\\uA92F\\uA95F\\uA9C1-\\uA9CD\\uA9DE\\uA9DF\\uAA5C-\\uAA5F\\uAADE\\uAADF\\uAAF0\\uAAF1\\uABEB\\uFD3E\\uFD3F\\uFE10-\\uFE19\\uFE30-\\uFE52\\uFE54-\\uFE61\\uFE63\\uFE68\\uFE6A\\uFE6B\\uFF01-\\uFF03\\uFF05-\\uFF0A\\uFF0C-\\uFF0F\\uFF1A\\uFF1B\\uFF1F\\uFF20\\uFF3B-\\uFF3D\\uFF3F\\uFF5B\\uFF5D\\uFF5F-\\uFF65]/\nconst CHAMELEON = /['\\u2018\\u2019]/\n\n/**\n * Get the distance to the end of the first word in a string of text.\n */\n\nexport const getWordDistance = (text: string, isRTL = false): number => {\n let dist = 0\n let started = false\n\n while (text.length > 0) {\n const charDist = getCharacterDistance(text, isRTL)\n const [char, remaining] = splitByCharacterDistance(text, charDist, isRTL)\n\n if (isWordCharacter(char, remaining, isRTL)) {\n started = true\n dist += charDist\n } else if (!started) {\n dist += charDist\n } else {\n break\n }\n\n text = remaining\n }\n\n return dist\n}\n\n/**\n * Split a string in two parts at a given distance starting from the end when\n * `isRTL` is set to `true`.\n */\n\nexport const splitByCharacterDistance = (\n str: string,\n dist: number,\n isRTL?: boolean\n): [string, string] => {\n if (isRTL) {\n const at = str.length - dist\n return [str.slice(at, str.length), str.slice(0, at)]\n }\n\n return [str.slice(0, dist), str.slice(dist)]\n}\n\n/**\n * Check if a character is a word character. The `remaining` argument is used\n * because sometimes you must read subsequent characters to truly determine it.\n */\n\nconst isWordCharacter = (\n char: string,\n remaining: string,\n isRTL = false\n): boolean => {\n if (SPACE.test(char)) {\n return false\n }\n\n // Chameleons count as word characters as long as they're in a word, so\n // recurse to see if the next one is a word character or not.\n if (CHAMELEON.test(char)) {\n const charDist = getCharacterDistance(remaining, isRTL)\n const [nextChar, nextRemaining] = splitByCharacterDistance(\n remaining,\n charDist,\n isRTL\n )\n\n if (isWordCharacter(nextChar, nextRemaining, isRTL)) {\n return true\n }\n }\n\n if (PUNCTUATION.test(char)) {\n return false\n }\n\n return true\n}\n\n/**\n * Iterate on codepoints from right to left.\n */\n\nexport const codepointsIteratorRTL = function* (str: string) {\n const end = str.length - 1\n\n for (let i = 0; i < str.length; i++) {\n const char1 = str.charAt(end - i)\n\n if (isLowSurrogate(char1.charCodeAt(0))) {\n const char2 = str.charAt(end - i - 1)\n if (isHighSurrogate(char2.charCodeAt(0))) {\n yield char2 + char1\n\n i++\n continue\n }\n }\n\n yield char1\n }\n}\n\n/**\n * Is `charCode` a high surrogate.\n *\n * https://en.wikipedia.org/wiki/Universal_Character_Set_characters#Surrogates\n */\n\nconst isHighSurrogate = (charCode: number) => {\n return charCode >= 0xd800 && charCode <= 0xdbff\n}\n\n/**\n * Is `charCode` a low surrogate.\n *\n * https://en.wikipedia.org/wiki/Universal_Character_Set_characters#Surrogates\n */\n\nconst isLowSurrogate = (charCode: number) => {\n return charCode >= 0xdc00 && charCode <= 0xdfff\n}\n\nenum CodepointType {\n None = 0,\n Extend = 1 << 0,\n ZWJ = 1 << 1,\n RI = 1 << 2,\n Prepend = 1 << 3,\n SpacingMark = 1 << 4,\n L = 1 << 5,\n V = 1 << 6,\n T = 1 << 7,\n LV = 1 << 8,\n LVT = 1 << 9,\n ExtPict = 1 << 10,\n Any = 1 << 11,\n}\n\nconst reExtend = /^[\\p{Gr_Ext}\\p{EMod}]$/u\nconst rePrepend =\n /^[\\u0600-\\u0605\\u06DD\\u070F\\u0890-\\u0891\\u08E2\\u0D4E\\u{110BD}\\u{110CD}\\u{111C2}-\\u{111C3}\\u{1193F}\\u{11941}\\u{11A3A}\\u{11A84}-\\u{11A89}\\u{11D46}]$/u\nconst reSpacingMark =\n /^[\\u0903\\u093B\\u093E-\\u0940\\u0949-\\u094C\\u094E-\\u094F\\u0982-\\u0983\\u09BF-\\u09C0\\u09C7-\\u09C8\\u09CB-\\u09CC\\u0A03\\u0A3E-\\u0A40\\u0A83\\u0ABE-\\u0AC0\\u0AC9\\u0ACB-\\u0ACC\\u0B02-\\u0B03\\u0B40\\u0B47-\\u0B48\\u0B4B-\\u0B4C\\u0BBF\\u0BC1-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCC\\u0C01-\\u0C03\\u0C41-\\u0C44\\u0C82-\\u0C83\\u0CBE\\u0CC0-\\u0CC1\\u0CC3-\\u0CC4\\u0CC7-\\u0CC8\\u0CCA-\\u0CCB\\u0D02-\\u0D03\\u0D3F-\\u0D40\\u0D46-\\u0D48\\u0D4A-\\u0D4C\\u0D82-\\u0D83\\u0DD0-\\u0DD1\\u0DD8-\\u0DDE\\u0DF2-\\u0DF3\\u0E33\\u0EB3\\u0F3E-\\u0F3F\\u0F7F\\u1031\\u103B-\\u103C\\u1056-\\u1057\\u1084\\u1715\\u1734\\u17B6\\u17BE-\\u17C5\\u17C7-\\u17C8\\u1923-\\u1926\\u1929-\\u192B\\u1930-\\u1931\\u1933-\\u1938\\u1A19-\\u1A1A\\u1A55\\u1A57\\u1A6D-\\u1A72\\u1B04\\u1B3B\\u1B3D-\\u1B41\\u1B43-\\u1B44\\u1B82\\u1BA1\\u1BA6-\\u1BA7\\u1BAA\\u1BE7\\u1BEA-\\u1BEC\\u1BEE\\u1BF2-\\u1BF3\\u1C24-\\u1C2B\\u1C34-\\u1C35\\u1CE1\\u1CF7\\uA823-\\uA824\\uA827\\uA880-\\uA881\\uA8B4-\\uA8C3\\uA952-\\uA953\\uA983\\uA9B4-\\uA9B5\\uA9BA-\\uA9BB\\uA9BE-\\uA9C0\\uAA2F-\\uAA30\\uAA33-\\uAA34\\uAA4D\\uAAEB\\uAAEE-\\uAAEF\\uAAF5\\uABE3-\\uABE4\\uABE6-\\uABE7\\uABE9-\\uABEA\\uABEC\\u{11000}\\u{11002}\\u{11082}\\u{110B0}-\\u{110B2}\\u{110B7}-\\u{110B8}\\u{1112C}\\u{11145}-\\u{11146}\\u{11182}\\u{111B3}-\\u{111B5}\\u{111BF}-\\u{111C0}\\u{111CE}\\u{1122C}-\\u{1122E}\\u{11232}-\\u{11233}\\u{11235}\\u{112E0}-\\u{112E2}\\u{11302}-\\u{11303}\\u{1133F}\\u{11341}-\\u{11344}\\u{11347}-\\u{11348}\\u{1134B}-\\u{1134D}\\u{11362}-\\u{11363}\\u{11435}-\\u{11437}\\u{11440}-\\u{11441}\\u{11445}\\u{114B1}-\\u{114B2}\\u{114B9}\\u{114BB}-\\u{114BC}\\u{114BE}\\u{114C1}\\u{115B0}-\\u{115B1}\\u{115B8}-\\u{115BB}\\u{115BE}\\u{11630}-\\u{11632}\\u{1163B}-\\u{1163C}\\u{1163E}\\u{116AC}\\u{116AE}-\\u{116AF}\\u{116B6}\\u{11726}\\u{1182C}-\\u{1182E}\\u{11838}\\u{11931}-\\u{11935}\\u{11937}-\\u{11938}\\u{1193D}\\u{11940}\\u{11942}\\u{119D1}-\\u{119D3}\\u{119DC}-\\u{119DF}\\u{119E4}\\u{11A39}\\u{11A57}-\\u{11A58}\\u{11A97}\\u{11C2F}\\u{11C3E}\\u{11CA9}\\u{11CB1}\\u{11CB4}\\u{11D8A}-\\u{11D8E}\\u{11D93}-\\u{11D94}\\u{11D96}\\u{11EF5}-\\u{11EF6}\\u{16F51}-\\u{16F87}\\u{16FF0}-\\u{16FF1}\\u{1D166}\\u{1D16D}]$/u\nconst reL = /^[\\u1100-\\u115F\\uA960-\\uA97C]$/u\nconst reV = /^[\\u1160-\\u11A7\\uD7B0-\\uD7C6]$/u\nconst reT = /^[\\u11A8-\\u11FF\\uD7CB-\\uD7FB]$/u\nconst reLV =\n /^[\\uAC00\\uAC1C\\uAC38\\uAC54\\uAC70\\uAC8C\\uACA8\\uACC4\\uACE0\\uACFC\\uAD18\\uAD34\\uAD50\\uAD6C\\uAD88\\uADA4\\uADC0\\uADDC\\uADF8\\uAE14\\uAE30\\uAE4C\\uAE68\\uAE84\\uAEA0\\uAEBC\\uAED8\\uAEF4\\uAF10\\uAF2C\\uAF48\\uAF64\\uAF80\\uAF9C\\uAFB8\\uAFD4\\uAFF0\\uB00C\\uB028\\uB044\\uB060\\uB07C\\uB098\\uB0B4\\uB0D0\\uB0EC\\uB108\\uB124\\uB140\\uB15C\\uB178\\uB194\\uB1B0\\uB1CC\\uB1E8\\uB204\\uB220\\uB23C\\uB258\\uB274\\uB290\\uB2AC\\uB2C8\\uB2E4\\uB300\\uB31C\\uB338\\uB354\\uB370\\uB38C\\uB3A8\\uB3C4\\uB3E0\\uB3FC\\uB418\\uB434\\uB450\\uB46C\\uB488\\uB4A4\\uB4C0\\uB4DC\\uB4F8\\uB514\\uB530\\uB54C\\uB568\\uB584\\uB5A0\\uB5BC\\uB5D8\\uB5F4\\uB610\\uB62C\\uB648\\uB664\\uB680\\uB69C\\uB6B8\\uB6D4\\uB6F0\\uB70C\\uB728\\uB744\\uB760\\uB77C\\uB798\\uB7B4\\uB7D0\\uB7EC\\uB808\\uB824\\uB840\\uB85C\\uB878\\uB894\\uB8B0\\uB8CC\\uB8E8\\uB904\\uB920\\uB93C\\uB958\\uB974\\uB990\\uB9AC\\uB9C8\\uB9E4\\uBA00\\uBA1C\\uBA38\\uBA54\\uBA70\\uBA8C\\uBAA8\\uBAC4\\uBAE0\\uBAFC\\uBB18\\uBB34\\uBB50\\uBB6C\\uBB88\\uBBA4\\uBBC0\\uBBDC\\uBBF8\\uBC14\\uBC30\\uBC4C\\uBC68\\uBC84\\uBCA0\\uBCBC\\uBCD8\\uBCF4\\uBD10\\uBD2C\\uBD48\\uBD64\\uBD80\\uBD9C\\uBDB8\\uBDD4\\uBDF0\\uBE0C\\uBE28\\uBE44\\uBE60\\uBE7C\\uBE98\\uBEB4\\uBED0\\uBEEC\\uBF08\\uBF24\\uBF40\\uBF5C\\uBF78\\uBF94\\uBFB0\\uBFCC\\uBFE8\\uC004\\uC020\\uC03C\\uC058\\uC074\\uC090\\uC0AC\\uC0C8\\uC0E4\\uC100\\uC11C\\uC138\\uC154\\uC170\\uC18C\\uC1A8\\uC1C4\\uC1E0\\uC1FC\\uC218\\uC234\\uC250\\uC26C\\uC288\\uC2A4\\uC2C0\\uC2DC\\uC2F8\\uC314\\uC330\\uC34C\\uC368\\uC384\\uC3A0\\uC3BC\\uC3D8\\uC3F4\\uC410\\uC42C\\uC448\\uC464\\uC480\\uC49C\\uC4B8\\uC4D4\\uC4F0\\uC50C\\uC528\\uC544\\uC560\\uC57C\\uC598\\uC5B4\\uC5D0\\uC5EC\\uC608\\uC624\\uC640\\uC65C\\uC678\\uC694\\uC6B0\\uC6CC\\uC6E8\\uC704\\uC720\\uC73C\\uC758\\uC774\\uC790\\uC7AC\\uC7C8\\uC7E4\\uC800\\uC81C\\uC838\\uC854\\uC870\\uC88C\\uC8A8\\uC8C4\\uC8E0\\uC8FC\\uC918\\uC934\\uC950\\uC96C\\uC988\\uC9A4\\uC9C0\\uC9DC\\uC9F8\\uCA14\\uCA30\\uCA4C\\uCA68\\uCA84\\uCAA0\\uCABC\\uCAD8\\uCAF4\\uCB10\\uCB2C\\uCB48\\uCB64\\uCB80\\uCB9C\\uCBB8\\uCBD4\\uCBF0\\uCC0C\\uCC28\\uCC44\\uCC60\\uCC7C\\uCC98\\uCCB4\\uCCD0\\uCCEC\\uCD08\\uCD24\\uCD40\\uCD5C\\uCD78\\uCD94\\uCDB0\\uCDCC\\uCDE8\\uCE04\\uCE20\\uCE3C\\uCE58\\uCE74\\uCE90\\uCEAC\\uCEC8\\uCEE4\\uCF00\\uCF1C\\uCF38\\uCF54\\uCF70\\uCF8C\\uCFA8\\uCFC4\\uCFE0\\uCFFC\\uD018\\uD034\\uD050\\uD06C\\uD088\\uD0A4\\uD0C0\\uD0DC\\uD0F8\\uD114\\uD130\\uD14C\\uD168\\uD184\\uD1A0\\uD1BC\\uD1D8\\uD1F4\\uD210\\uD22C\\uD248\\uD264\\uD280\\uD29C\\uD2B8\\uD2D4\\uD2F0\\uD30C\\uD328\\uD344\\uD360\\uD37C\\uD398\\uD3B4\\uD3D0\\uD3EC\\uD408\\uD424\\uD440\\uD45C\\uD478\\uD494\\uD4B0\\uD4CC\\uD4E8\\uD504\\uD520\\uD53C\\uD558\\uD574\\uD590\\uD5AC\\uD5C8\\uD5E4\\uD600\\uD61C\\uD638\\uD654\\uD670\\uD68C\\uD6A8\\uD6C4\\uD6E0\\uD6FC\\uD718\\uD734\\uD750\\uD76C\\uD788]$/u\nconst reLVT =\n /^[\\uAC01-\\uAC1B\\uAC1D-\\uAC37\\uAC39-\\uAC53\\uAC55-\\uAC6F\\uAC71-\\uAC8B\\uAC8D-\\uACA7\\uACA9-\\uACC3\\uACC5-\\uACDF\\uACE1-\\uACFB\\uACFD-\\uAD17\\uAD19-\\uAD33\\uAD35-\\uAD4F\\uAD51-\\uAD6B\\uAD6D-\\uAD87\\uAD89-\\uADA3\\uADA5-\\uADBF\\uADC1-\\uADDB\\uADDD-\\uADF7\\uADF9-\\uAE13\\uAE15-\\uAE2F\\uAE31-\\uAE4B\\uAE4D-\\uAE67\\uAE69-\\uAE83\\uAE85-\\uAE9F\\uAEA1-\\uAEBB\\uAEBD-\\uAED7\\uAED9-\\uAEF3\\uAEF5-\\uAF0F\\uAF11-\\uAF2B\\uAF2D-\\uAF47\\uAF49-\\uAF63\\uAF65-\\uAF7F\\uAF81-\\uAF9B\\uAF9D-\\uAFB7\\uAFB9-\\uAFD3\\uAFD5-\\uAFEF\\uAFF1-\\uB00B\\uB00D-\\uB027\\uB029-\\uB043\\uB045-\\uB05F\\uB061-\\uB07B\\uB07D-\\uB097\\uB099-\\uB0B3\\uB0B5-\\uB0CF\\uB0D1-\\uB0EB\\uB0ED-\\uB107\\uB109-\\uB123\\uB125-\\uB13F\\uB141-\\uB15B\\uB15D-\\uB177\\uB179-\\uB193\\uB195-\\uB1AF\\uB1B1-\\uB1CB\\uB1CD-\\uB1E7\\uB1E9-\\uB203\\uB205-\\uB21F\\uB221-\\uB23B\\uB23D-\\uB257\\uB259-\\uB273\\uB275-\\uB28F\\uB291-\\uB2AB\\uB2AD-\\uB2C7\\uB2C9-\\uB2E3\\uB2E5-\\uB2FF\\uB301-\\uB31B\\uB31D-\\uB337\\uB339-\\uB353\\uB355-\\uB36F\\uB371-\\uB38B\\uB38D-\\uB3A7\\uB3A9-\\uB3C3\\uB3C5-\\uB3DF\\uB3E1-\\uB3FB\\uB3FD-\\uB417\\uB419-\\uB433\\uB435-\\uB44F\\uB451-\\uB46B\\uB46D-\\uB487\\uB489-\\uB4A3\\uB4A5-\\uB4BF\\uB4C1-\\uB4DB\\uB4DD-\\uB4F7\\uB4F9-\\uB513\\uB515-\\uB52F\\uB531-\\uB54B\\uB54D-\\uB567\\uB569-\\uB583\\uB585-\\uB59F\\uB5A1-\\uB5BB\\uB5BD-\\uB5D7\\uB5D9-\\uB5F3\\uB5F5-\\uB60F\\uB611-\\uB62B\\uB62D-\\uB647\\uB649-\\uB663\\uB665-\\uB67F\\uB681-\\uB69B\\uB69D-\\uB6B7\\uB6B9-\\uB6D3\\uB6D5-\\uB6EF\\uB6F1-\\uB70B\\uB70D-\\uB727\\uB729-\\uB743\\uB745-\\uB75F\\uB761-\\uB77B\\uB77D-\\uB797\\uB799-\\uB7B3\\uB7B5-\\uB7CF\\uB7D1-\\uB7EB\\uB7ED-\\uB807\\uB809-\\uB823\\uB825-\\uB83F\\uB841-\\uB85B\\uB85D-\\uB877\\uB879-\\uB893\\uB895-\\uB8AF\\uB8B1-\\uB8CB\\uB8CD-\\uB8E7\\uB8E9-\\uB903\\uB905-\\uB91F\\uB921-\\uB93B\\uB93D-\\uB957\\uB959-\\uB973\\uB975-\\uB98F\\uB991-\\uB9AB\\uB9AD-\\uB9C7\\uB9C9-\\uB9E3\\uB9E5-\\uB9FF\\uBA01-\\uBA1B\\uBA1D-\\uBA37\\uBA39-\\uBA53\\uBA55-\\uBA6F\\uBA71-\\uBA8B\\uBA8D-\\uBAA7\\uBAA9-\\uBAC3\\uBAC5-\\uBADF\\uBAE1-\\uBAFB\\uBAFD-\\uBB17\\uBB19-\\uBB33\\uBB35-\\uBB4F\\uBB51-\\uBB6B\\uBB6D-\\uBB87\\uBB89-\\uBBA3\\uBBA5-\\uBBBF\\uBBC1-\\uBBDB\\uBBDD-\\uBBF7\\uBBF9-\\uBC13\\uBC15-\\uBC2F\\uBC31-\\uBC4B\\uBC4D-\\uBC67\\uBC69-\\uBC83\\uBC85-\\uBC9F\\uBCA1-\\uBCBB\\uBCBD-\\uBCD7\\uBCD9-\\uBCF3\\uBCF5-\\uBD0F\\uBD11-\\uBD2B\\uBD2D-\\uBD47\\uBD49-\\uBD63\\uBD65-\\uBD7F\\uBD81-\\uBD9B\\uBD9D-\\uBDB7\\uBDB9-\\uBDD3\\uBDD5-\\uBDEF\\uBDF1-\\uBE0B\\uBE0D-\\uBE27\\uBE29-\\uBE43\\uBE45-\\uBE5F\\uBE61-\\uBE7B\\uBE7D-\\uBE97\\uBE99-\\uBEB3\\uBEB5-\\uBECF\\uBED1-\\uBEEB\\uBEED-\\uBF07\\uBF09-\\uBF23\\uBF25-\\uBF3F\\uBF41-\\uBF5B\\uBF5D-\\uBF77\\uBF79-\\uBF93\\uBF95-\\uBFAF\\uBFB1-\\uBFCB\\uBFCD-\\uBFE7\\uBFE9-\\uC003\\uC005-\\uC01F\\uC021-\\uC03B\\uC03D-\\uC057\\uC059-\\uC073\\uC075-\\uC08F\\uC091-\\uC0AB\\uC0AD-\\uC0C7\\uC0C9-\\uC0E3\\uC0E5-\\uC0FF\\uC101-\\uC11B\\uC11D-\\uC137\\uC139-\\uC153\\uC155-\\uC16F\\uC171-\\uC18B\\uC18D-\\uC1A7\\uC1A9-\\uC1C3\\uC1C5-\\uC1DF\\uC1E1-\\uC1FB\\uC1FD-\\uC217\\uC219-\\uC233\\uC235-\\uC24F\\uC251-\\uC26B\\uC26D-\\uC287\\uC289-\\uC2A3\\uC2A5-\\uC2BF\\uC2C1-\\uC2DB\\uC2DD-\\uC2F7\\uC2F9-\\uC313\\uC315-\\uC32F\\uC331-\\uC34B\\uC34D-\\uC367\\uC369-\\uC383\\uC385-\\uC39F\\uC3A1-\\uC3BB\\uC3BD-\\uC3D7\\uC3D9-\\uC3F3\\uC3F5-\\uC40F\\uC411-\\uC42B\\uC42D-\\uC447\\uC449-\\uC463\\uC465-\\uC47F\\uC481-\\uC49B\\uC49D-\\uC4B7\\uC4B9-\\uC4D3\\uC4D5-\\uC4EF\\uC4F1-\\uC50B\\uC50D-\\uC527\\uC529-\\uC543\\uC545-\\uC55F\\uC561-\\uC57B\\uC57D-\\uC597\\uC599-\\uC5B3\\uC5B5-\\uC5CF\\uC5D1-\\uC5EB\\uC5ED-\\uC607\\uC609-\\uC623\\uC625-\\uC63F\\uC641-\\uC65B\\uC65D-\\uC677\\uC679-\\uC693\\uC695-\\uC6AF\\uC6B1-\\uC6CB\\uC6CD-\\uC6E7\\uC6E9-\\uC703\\uC705-\\uC71F\\uC721-\\uC73B\\uC73D-\\uC757\\uC759-\\uC773\\uC775-\\uC78F\\uC791-\\uC7AB\\uC7AD-\\uC7C7\\uC7C9-\\uC7E3\\uC7E5-\\uC7FF\\uC801-\\uC81B\\uC81D-\\uC837\\uC839-\\uC853\\uC855-\\uC86F\\uC871-\\uC88B\\uC88D-\\uC8A7\\uC8A9-\\uC8C3\\uC8C5-\\uC8DF\\uC8E1-\\uC8FB\\uC8FD-\\uC917\\uC919-\\uC933\\uC935-\\uC94F\\uC951-\\uC96B\\uC96D-\\uC987\\uC989-\\uC9A3\\uC9A5-\\uC9BF\\uC9C1-\\uC9DB\\uC9DD-\\uC9F7\\uC9F9-\\uCA13\\uCA15-\\uCA2F\\uCA31-\\uCA4B\\uCA4D-\\uCA67\\uCA69-\\uCA83\\uCA85-\\uCA9F\\uCAA1-\\uCABB\\uCABD-\\uCAD7\\uCAD9-\\uCAF3\\uCAF5-\\uCB0F\\uCB11-\\uCB2B\\uCB2D-\\uCB47\\uCB49-\\uCB63\\uCB65-\\uCB7F\\uCB81-\\uCB9B\\uCB9D-\\uCBB7\\uCBB9-\\uCBD3\\uCBD5-\\uCBEF\\uCBF1-\\uCC0B\\uCC0D-\\uCC27\\uCC29-\\uCC43\\uCC45-\\uCC5F\\uCC61-\\uCC7B\\uCC7D-\\uCC97\\uCC99-\\uCCB3\\uCCB5-\\uCCCF\\uCCD1-\\uCCEB\\uCCED-\\uCD07\\uCD09-\\uCD23\\uCD25-\\uCD3F\\uCD41-\\uCD5B\\uCD5D-\\uCD77\\uCD79-\\uCD93\\uCD95-\\uCDAF\\uCDB1-\\uCDCB\\uCDCD-\\uCDE7\\uCDE9-\\uCE03\\uCE05-\\uCE1F\\uCE21-\\uCE3B\\uCE3D-\\uCE57\\uCE59-\\uCE73\\uCE75-\\uCE8F\\uCE91-\\uCEAB\\uCEAD-\\uCEC7\\uCEC9-\\uCEE3\\uCEE5-\\uCEFF\\uCF01-\\uCF1B\\uCF1D-\\uCF37\\uCF39-\\uCF53\\uCF55-\\uCF6F\\uCF71-\\uCF8B\\uCF8D-\\uCFA7\\uCFA9-\\uCFC3\\uCFC5-\\uCFDF\\uCFE1-\\uCFFB\\uCFFD-\\uD017\\uD019-\\uD033\\uD035-\\uD04F\\uD051-\\uD06B\\uD06D-\\uD087\\uD089-\\uD0A3\\uD0A5-\\uD0BF\\uD0C1-\\uD0DB\\uD0DD-\\uD0F7\\uD0F9-\\uD113\\uD115-\\uD12F\\uD131-\\uD14B\\uD14D-\\uD167\\uD169-\\uD183\\uD185-\\uD19F\\uD1A1-\\uD1BB\\uD1BD-\\uD1D7\\uD1D9-\\uD1F3\\uD1F5-\\uD20F\\uD211-\\uD22B\\uD22D-\\uD247\\uD249-\\uD263\\uD265-\\uD27F\\uD281-\\uD29B\\uD29D-\\uD2B7\\uD2B9-\\uD2D3\\uD2D5-\\uD2EF\\uD2F1-\\uD30B\\uD30D-\\uD327\\uD329-\\uD343\\uD345-\\uD35F\\uD361-\\uD37B\\uD37D-\\uD397\\uD399-\\uD3B3\\uD3B5-\\uD3CF\\uD3D1-\\uD3EB\\uD3ED-\\uD407\\uD409-\\uD423\\uD425-\\uD43F\\uD441-\\uD45B\\uD45D-\\uD477\\uD479-\\uD493\\uD495-\\uD4AF\\uD4B1-\\uD4CB\\uD4CD-\\uD4E7\\uD4E9-\\uD503\\uD505-\\uD51F\\uD521-\\uD53B\\uD53D-\\uD557\\uD559-\\uD573\\uD575-\\uD58F\\uD591-\\uD5AB\\uD5AD-\\uD5C7\\uD5C9-\\uD5E3\\uD5E5-\\uD5FF\\uD601-\\uD61B\\uD61D-\\uD637\\uD639-\\uD653\\uD655-\\uD66F\\uD671-\\uD68B\\uD68D-\\uD6A7\\uD6A9-\\uD6C3\\uD6C5-\\uD6DF\\uD6E1-\\uD6FB\\uD6FD-\\uD717\\uD719-\\uD733\\uD735-\\uD74F\\uD751-\\uD76B\\uD76D-\\uD787\\uD789-\\uD7A3]$/u\nconst reExtPict = /^\\p{ExtPict}$/u\n\nconst getCodepointType = (char: string, code: number): CodepointType => {\n let type = CodepointType.Any\n if (char.search(reExtend) !== -1) {\n type |= CodepointType.Extend\n }\n if (code === 0x200d) {\n type |= CodepointType.ZWJ\n }\n if (code >= 0x1f1e6 && code <= 0x1f1ff) {\n type |= CodepointType.RI\n }\n if (char.search(rePrepend) !== -1) {\n type |= CodepointType.Prepend\n }\n if (char.search(reSpacingMark) !== -1) {\n type |= CodepointType.SpacingMark\n }\n if (char.search(reL) !== -1) {\n type |= CodepointType.L\n }\n if (char.search(reV) !== -1) {\n type |= CodepointType.V\n }\n if (char.search(reT) !== -1) {\n type |= CodepointType.T\n }\n if (char.search(reLV) !== -1) {\n type |= CodepointType.LV\n }\n if (char.search(reLVT) !== -1) {\n type |= CodepointType.LVT\n }\n if (char.search(reExtPict) !== -1) {\n type |= CodepointType.ExtPict\n }\n\n return type\n}\n\nfunction intersects(x: CodepointType, y: CodepointType) {\n return (x & y) !== 0\n}\n\nconst NonBoundaryPairs: [CodepointType, CodepointType][] = [\n // GB6\n [\n CodepointType.L,\n CodepointType.L | CodepointType.V | CodepointType.LV | CodepointType.LVT,\n ],\n // GB7\n [CodepointType.LV | CodepointType.V, CodepointType.V | CodepointType.T],\n // GB8\n [CodepointType.LVT | CodepointType.T, CodepointType.T],\n // GB9\n [CodepointType.Any, CodepointType.Extend | CodepointType.ZWJ],\n // GB9a\n [CodepointType.Any, CodepointType.SpacingMark],\n // GB9b\n [CodepointType.Prepend, CodepointType.Any],\n // GB11\n [CodepointType.ZWJ, CodepointType.ExtPict],\n // GB12 and GB13\n [CodepointType.RI, CodepointType.RI],\n]\n\nfunction isBoundaryPair(left: CodepointType, right: CodepointType) {\n return (\n NonBoundaryPairs.findIndex(\n r => intersects(left, r[0]) && intersects(right, r[1])\n ) === -1\n )\n}\n\nconst endingEmojiZWJ = /\\p{ExtPict}[\\p{Gr_Ext}\\p{EMod}]*\\u200D$/u\nconst endsWithEmojiZWJ = (str: string): boolean => {\n return str.search(endingEmojiZWJ) !== -1\n}\n\nconst endingRIs = /\\p{RI}+$/gu\nconst endsWithOddNumberOfRIs = (str: string): boolean => {\n const match = str.match(endingRIs)\n if (match === null) {\n return false\n } else {\n // A RI is represented by a surrogate pair.\n const numRIs = match[0].length / 2\n return numRIs % 2 === 1\n }\n}\n","import { Editor, Location, Node, Path, Range, Transforms } from '../../index'\nimport { TextUnit } from '../../types/types'\nimport { getDefaultInsertLocation } from '../../utils'\n\nexport interface TextDeleteOptions {\n at?: Location\n distance?: number\n unit?: TextUnit\n reverse?: boolean\n hanging?: boolean\n voids?: boolean\n}\n\nexport interface TextInsertFragmentOptions {\n at?: Location\n hanging?: boolean\n voids?: boolean\n batchDirty?: boolean\n}\n\nexport interface TextInsertTextOptions {\n at?: Location\n voids?: boolean\n}\n\nexport interface TextTransforms {\n /**\n * Delete content in the editor.\n */\n delete: (editor: Editor, options?: TextDeleteOptions) => void\n\n /**\n * Insert a fragment in the editor\n * at the specified location or (if not defined) the current selection or (if not defined) the end of the document.\n */\n insertFragment: (\n editor: Editor,\n fragment: Node[],\n options?: TextInsertFragmentOptions\n ) => void\n\n /**\n * Insert a string of text in the editor\n * at the specified location or (if not defined) the current selection or (if not defined) the end of the document.\n */\n insertText: (\n editor: Editor,\n text: string,\n options?: TextInsertTextOptions\n ) => void\n}\n\n// eslint-disable-next-line no-redeclare\nexport const TextTransforms: TextTransforms = {\n delete(editor, options) {\n editor.delete(options)\n },\n insertFragment(editor, fragment, options) {\n editor.insertFragment(fragment, options)\n },\n insertText(\n editor: Editor,\n text: string,\n options: TextInsertTextOptions = {}\n ): void {\n Editor.withoutNormalizing(editor, () => {\n const { voids = false } = options\n let { at = getDefaultInsertLocation(editor) } = options\n\n if (Path.isPath(at)) {\n at = Editor.range(editor, at)\n }\n\n if (Range.isRange(at)) {\n if (Range.isCollapsed(at)) {\n at = at.anchor\n } else {\n const end = Range.end(at)\n if (!voids && Editor.void(editor, { at: end })) {\n return\n }\n const start = Range.start(at)\n const startRef = Editor.pointRef(editor, start)\n const endRef = Editor.pointRef(editor, end)\n Transforms.delete(editor, { at, voids })\n const startPoint = startRef.unref()\n const endPoint = endRef.unref()\n\n at = startPoint || endPoint!\n Transforms.setSelection(editor, { anchor: at, focus: at })\n }\n }\n\n if (\n (!voids && Editor.void(editor, { at })) ||\n Editor.elementReadOnly(editor, { at })\n ) {\n return\n }\n\n const { path, offset } = at\n if (text.length > 0)\n editor.apply({ type: 'insert_text', path, offset, text })\n })\n },\n}\n","import { GeneralTransforms } from './general'\nimport { NodeTransforms } from './node'\nimport { SelectionTransforms } from './selection'\nimport { TextTransforms } from './text'\n\nexport const Transforms: GeneralTransforms &\n NodeTransforms &\n SelectionTransforms &\n TextTransforms = {\n ...GeneralTransforms,\n ...NodeTransforms,\n ...SelectionTransforms,\n ...TextTransforms,\n}\n","import { PluginElementRenderProps, useYooptaEditor, useYooptaReadOnly, Elements, Blocks } from '@yoopta/editor';\nimport { ChevronUp, Plus, TrashIcon } from 'lucide-react';\nimport { Path } from 'slate';\nimport { MouseEvent } from 'react';\n\nexport const AccordionItemHeading = ({ extendRender, ...props }: PluginElementRenderProps) => {\n const { attributes, children, blockId, element } = props;\n const editor = useYooptaEditor();\n const isReadOnly = useYooptaReadOnly();\n\n const onToggleExpand = (event: MouseEvent) => {\n event.stopPropagation();\n\n const parentPath = Elements.getParentElementPath(editor, blockId, element)!;\n const listItemElement = Elements.getElement(editor, blockId, {\n path: parentPath,\n type: 'accordion-list-item',\n });\n\n if (listItemElement) {\n Elements.updateElement(\n editor,\n blockId,\n { type: 'accordion-list-item', props: { isExpanded: !listItemElement.props?.isExpanded } },\n { path: parentPath },\n );\n }\n };\n\n const onAddAccordionItem = (e: MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n\n const parentPath = Elements.getParentElementPath(editor, blockId, element)!;\n const listItemPath = parentPath;\n const nextListItemPath = Path.next(listItemPath);\n\n Elements.createElement(\n editor,\n blockId,\n { type: 'accordion-list-item', props: { isExpanded: true } },\n { path: nextListItemPath, focus: true },\n );\n };\n\n const onDeleteAccordionItem = (e: MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n\n const parentPath = Elements.getParentElementPath(editor, blockId, element);\n\n const accordionListItems = Elements.getElementChildren(editor, blockId, {\n path: parentPath,\n type: 'accordion-list',\n });\n\n if (accordionListItems?.length === 1) {\n Blocks.deleteBlock(editor, { blockId });\n return;\n }\n\n if (parentPath) {\n Elements.deleteElement(editor, blockId, { type: 'accordion-list-item', path: parentPath });\n }\n };\n\n const parentPath = Elements.getParentElementPath(editor, blockId, element);\n const nodeEl = Elements.getElement(editor, blockId, { path: parentPath, type: 'accordion-list-item' });\n const isExpanded = nodeEl?.props?.isExpanded;\n\n if (extendRender) return extendRender(props);\n\n return (\n <div\n {...attributes}\n onClick={isReadOnly ? onToggleExpand : undefined}\n className=\"yoopta-accordion-list-item-heading yoo-accordion-group\"\n >\n <span className=\"yoo-accordion-break-words hover:yoo-accordion-underline\">{children}</span>\n <div className=\"yoo-accordion-absolute yoo-accordion-right-[14px] yoo-accordion-z-10 yoo-accordion-top-1/2 -yoo-accordion-translate-y-1/2 yoo-accordion-flex yoo-accordion-gap-1 yoo-accordion-select-none\">\n {!isReadOnly && (\n <>\n <button\n type=\"button\"\n contentEditable={false}\n onClick={onDeleteAccordionItem}\n className=\"yoopta-button yoo-accordion-opacity-0 group-hover:yoo-accordion-opacity-100 yoo-accordion-transition-opacity\"\n >\n <TrashIcon strokeWidth={1} size={16} color=\"#000\" />\n </button>\n <button\n type=\"button\"\n contentEditable={false}\n onClick={onAddAccordionItem}\n className=\"yoopta-button yoo-accordion-mr-2 yoo-accordion-opacity-0 group-hover:yoo-accordion-opacity-100 yoo-accordion-transition-opacity\"\n >\n <Plus strokeWidth={1} size={20} color=\"#000\" />\n </button>\n </>\n )}\n <button type=\"button\" contentEditable={false} onClick={onToggleExpand} className=\"yoopta-button\">\n <ChevronUp\n strokeWidth={1}\n size={20}\n color=\"#000\"\n style={{ transform: isExpanded ? 'rotate(180deg)' : 'rotate(0deg)' }}\n className=\"yoo-accordion-transition-transform yoo-accordion-duration-200\"\n />\n </button>\n </div>\n </div>\n );\n};\n","import { Elements, PluginElementRenderProps, useYooptaEditor } from '@yoopta/editor';\nimport { Path } from 'slate';\n\nexport const AccordionItemContent = ({ extendRender, ...props }: PluginElementRenderProps) => {\n const { attributes, children, blockId, element } = props;\n const editor = useYooptaEditor();\n\n const parentPath = Elements.getParentElementPath(editor, blockId, element);\n const parentListItem = Elements.getElement(editor, blockId, {\n path: parentPath,\n type: 'accordion-list-item',\n });\n\n const isExpanded = parentListItem?.props?.isExpanded;\n\n if (extendRender) return extendRender(props);\n\n return (\n <div\n data-state={isExpanded ? 'open' : 'closed'}\n className=\"yoopta-accordion-list-item-content data-[state=closed]:yoo-accordion-hidden data-[state=closed]:yoo-accordion-animate-accordion-up data-[state=open]:yoo-accordion-animate-accordion-down\"\n {...attributes}\n >\n <div className=\"yoo-accordion-pb-4 yoo-accordion-pt-0\">{children}</div>\n </div>\n );\n};\n","import {\n Blocks,\n Elements,\n YooptaPlugin,\n SlateEditor,\n generateId,\n buildBlockElementsStructure,\n SlateElement,\n} from '@yoopta/editor';\nimport { AccordionElementKeys, AccordionListItemProps } from '../types';\nimport { AccordionList } from '../renders/AccordionList';\nimport { AccordionListItem } from '../renders/AccordionListItem';\nimport { AccordionItemHeading } from '../renders/AccordionItemHeading';\nimport { AccordionItemContent } from '../renders/AccordionItemContent';\nimport { Transforms } from 'slate';\nimport { ListCollapse } from 'lucide-react';\n\nconst ACCORDION_ELEMENTS = {\n AccordionList: 'accordion-list',\n AccordionListItem: 'accordion-list-item',\n AccordionListItemHeading: 'accordion-list-item-heading',\n AccordionListItemContent: 'accordion-list-item-content',\n};\n\nconst Accordion = new YooptaPlugin<AccordionElementKeys, AccordionListItemProps>({\n type: 'Accordion',\n elements: {\n 'accordion-list': {\n asRoot: true,\n render: AccordionList,\n children: ['accordion-list-item'],\n },\n 'accordion-list-item': {\n render: AccordionListItem,\n children: ['accordion-list-item-heading', 'accordion-list-item-content'],\n props: { isExpanded: true },\n },\n 'accordion-list-item-heading': {\n render: AccordionItemHeading,\n },\n 'accordion-list-item-content': {\n render: AccordionItemContent,\n },\n },\n events: {\n onKeyDown(editor, slate, { hotkeys, currentBlock }) {\n return (event) => {\n if (hotkeys.isBackspace(event)) {\n if (!slate.selection) return;\n\n const listItems = Elements.getElementChildren(editor, currentBlock.id, { type: 'accordion-list' });\n const accordionListItemEntry = Elements.getElementEntry(editor, currentBlock.id, {\n path: slate.selection,\n type: 'accordion-list-item',\n });\n\n const listItemChildPath = accordionListItemEntry?.[1] || slate.selection.anchor.path;\n const currentElement = Elements.getElement(editor, currentBlock.id);\n\n const isHeadingEmpty = Elements.isElementEmpty(editor, currentBlock.id, {\n type: 'accordion-list-item-heading',\n path: listItemChildPath,\n });\n\n const isContentEmpty = Elements.isElementEmpty(editor, currentBlock.id, {\n type: 'accordion-list-item-content',\n path: listItemChildPath,\n });\n\n if (isContentEmpty && currentElement?.type === ACCORDION_ELEMENTS.AccordionListItemContent) {\n event.preventDefault();\n return;\n }\n\n if (isHeadingEmpty && currentElement?.type === ACCORDION_ELEMENTS.AccordionListItemHeading) {\n event.preventDefault();\n\n if (listItems?.length === 1) {\n Blocks.deleteBlock(editor, { blockId: currentBlock.id });\n return;\n }\n\n if (accordionListItemEntry) {\n const [, listItemPath] = accordionListItemEntry;\n\n Elements.deleteElement(editor, currentBlock.id, {\n type: 'accordion-list-item',\n path: listItemPath,\n });\n }\n }\n }\n\n if (hotkeys.isSelect(event)) {\n event.preventDefault();\n\n if (slate.selection) {\n Transforms.select(slate, slate.selection.anchor.path.slice(0, -1));\n }\n\n return;\n }\n\n if (hotkeys.isEnter(event)) {\n event.preventDefault();\n\n const currentElement = Elements.getElement(editor, currentBlock.id);\n const listItemEntry = Elements.getElementEntry(editor, currentBlock.id, { type: 'accordion-list-item' });\n\n if (currentElement?.type === ACCORDION_ELEMENTS.AccordionListItemHeading && listItemEntry) {\n const [listItem, listItemPath] = listItemEntry;\n\n Elements.updateElement(\n editor,\n currentBlock.id,\n {\n type: ACCORDION_ELEMENTS.AccordionListItem,\n props: {\n isExpanded: !listItem?.props.isExpanded,\n },\n },\n { path: listItemPath },\n );\n\n return;\n }\n\n Elements.createElement(\n editor,\n currentBlock.id,\n { type: 'accordion-list-item', props: { isExpanded: true } },\n { path: 'next', focus: true, split: false },\n );\n }\n };\n },\n },\n options: {\n display: {\n title: 'Accordion',\n description: 'Create collapses',\n icon: <ListCollapse size={24} />,\n },\n shortcuts: ['accordion'],\n },\n parsers: {\n html: {\n deserialize: {\n nodeNames: ['DETAILS'],\n parse: (el, editor) => {\n if (el.nodeName === 'DETAILS') {\n const summary = el.querySelector('summary');\n const p = el.querySelector('p');\n const elementsStructure = buildBlockElementsStructure(editor, 'Accordion', {\n [ACCORDION_ELEMENTS.AccordionListItemHeading]: summary?.textContent || '',\n [ACCORDION_ELEMENTS.AccordionListItemContent]: p?.textContent || '',\n });\n\n return elementsStructure;\n }\n },\n },\n serialize: (element, text, blockMeta) => {\n const { align = 'left', depth = 0 } = blockMeta || {};\n\n return `<div>${element.children\n .map((listItem) => {\n return `<details data-meta-align=\"${align}\" data-meta-depth=\"${depth}\">${listItem.children\n .map((item) => {\n if (item.type === 'accordion-list-item-heading') {\n return `<summary>${item.children.map((item) => item.text).join('')}</summary>`;\n }\n return `<p>${item.children.map((item) => item.text).join('')}</p>`;\n })\n .join('')}</details>`;\n })\n .join('')}</div>`;\n },\n },\n },\n});\n\nexport { Accordion };\n","function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n"],"names":["_jsx","isPlainObject","immer","isSet","current","Immer","base","Path","ancestors","path","options","arguments","length","undefined","reverse","paths","levels","slice","common","another","i","av","bv","push","compare","min","Math","endsAfter","as","bs","equals","endsAt","endsBefore","every","n","hasPrevious","isAfter","isAncestor","isBefore","isChild","isCommon","isDescendant","isParent","isPath","value","Array","isArray","isSibling","al","bl","list","next","Error","concat","last","operationCanTransformPath","operation","type","parent","previous","relative","ancestor","transform","p","affinity","op","position","newPath","onp","copy","toPrimitive","toPropertyKey","applyToDraft","editor","selection","node","Node","index","children","splice","point","key","Range","points","Point","offset","text","leaf","before","after","get","prevPath","prev","Text","isText","Scrubber","stringify","truePath","newParent","newIndex","result","texts","preferNext","properties","newProperties","hasOwnProperty","isRange","_objectSpread","newNode","GeneralTransforms","createDraft","finishDraft","isDraft","NodeTransforms","insertNodes","nodes","liftNodes","mergeNodes","moveNodes","removeNodes","setNodes","props","splitNodes","unsetNodes","unwrapNodes","wrapNodes","element","SelectionTransforms","collapse","deselect","move","select","target","setPoint","setSelection","isDeepEqual","a","b","objectWithoutPropertiesLoose","edges","range","anchor","focus","isBackward","end","includes","rs","re","ts","te","start","isAfterStart","isBeforeEnd","isPoint","intersection","rest","_objectWithoutProperties","_excluded","s1","e1","s2","e2","isCollapsed","isExpanded","isForward","produce","r","affinityAnchor","affinityFocus","isElement","isNodeList","Editor","isEditor","Element","isElementList","val","isElementProps","isElementType","elementVal","elementKey","matches","IS_NODE_LIST_CACHE","WeakMap","root","entry","child","c","childPath","descendant","descendants","elements","extractProps","_excluded2","first","fragment","newRoot","nodeEntries","pass","_ref","has","isNode","cachedResult","set","isTextProps","from","to","visited","Set","add","nextIndex","parentPath","string","map","join","Operation","isNodeOperation","isOperation","endsWith","isOperationList","isSelectionOperation","isTextOperation","inverse","inversePath","inverseNewPath","IS_EDITOR_CACHE","cachedIsEditor","addMark","apply","deleteFragment","insertBreak","insertSoftBreak","insertFragment","insertNode","insertText","isElementReadOnly","isInline","isSelectable","isVoid","normalizeNode","onChange","removeMark","getDirtyPaths","marks","operations","above","at","deleteBackward","unit","deleteForward","elementReadOnly","hasBlocks","hasInlines","hasPath","hasTexts","isBlock","isEdge","isEmpty","isEnd","isNormalizing","isStart","getMarks","normalize","pathRef","pathRefs","pointRef","pointRefs","positions","rangeRef","rangeRefs","setNormalizing","unhangRange","void","withoutNormalizing","fn","_scrubber","setScrubber","scrubber","JSON","loose","omitText","obj","isTextList","decorations","leaves","dec","leafEnd","decorationStart","decorationEnd","leafStart","Object","assign","middle","off","getDefaultInsertLocation","CodepointType","L","V","LV","LVT","T","Any","Extend","ZWJ","SpacingMark","Prepend","ExtPict","RI","TextTransforms","delete","voids","startRef","endRef","Transforms","startPoint","unref","endPoint","_jsxs","TrashIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,MAAM,aAAa,GAAG,CAAC,EAAoD,KAAI;AAAxD,IAAA,IAAA,EAAE,YAAY,EAAsC,GAAA,EAAA,EAAjC,KAAK,GAAA,MAAA,CAAA,EAAA,EAAxB,gBAA0B,CAAF,CAAA;AACpD,IAAA,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;AAEvC,IAAA,IAAI,YAAY;AAAE,QAAA,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC;AAE7C,IAAA,OAAOA,GAAS,CAAA,KAAA,EAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,UAAU,EAAG,EAAA,QAAA,EAAA,QAA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