"use strict";(self["webpackChunkyos_manage"]=self["webpackChunkyos_manage"]||[]).push([[1611],{34002:function(e,t,n){n.d(t,{Z:function(){return l}});var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{display:"inline"}},[n("el-popconfirm",{attrs:{title:"确定删除当前通告吗?"},on:{confirm:function(t){return e.deleteRow()}}},[n("el-button",{attrs:{slot:"reference",size:"small",type:"primary",plain:""},slot:"reference"},[e._v("删 除")])],1)],1)},o=[],i={props:["data"],methods:{deleteRow(){this.$api.requested({id:20221101095103,method:"delete",content:{sat_noticeids:[this.$route.query.id]}}).then((e=>{this.tool.showMessage(e,(()=>{this.$emit("onSuccess")}))}))}}},a=i,u=n(43736),s=(0,u.Z)(a,r,o,!1,null,null,null),l=s.exports},31611:function(e,t,n){n.r(t),n.d(t,{default:function(){return m}});var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"inline-16"},[n("el-button",{attrs:{size:"small",type:"text"},on:{click:function(t){return e.onshow(e.drawer=!0)}}},[e._v("详情")]),n("el-drawer",{attrs:{title:"编辑",visible:e.drawer,"with-header":!1,direction:"rtl",size:"90%","append-to-body":""},on:{"update:visible":function(t){e.drawer=t},close:function(t){e.drawer=!1}}},[n("div",{staticClass:"detail__panel"},[n("div",{staticClass:"container normal-panel normal-margin sticky"},[e.edit?n("el-button",{staticClass:"inline-16",attrs:{disabled:"发布"==e.form.status,type:"primary",size:"small"},on:{click:function(t){return e.onEdit()}}},[e._v("编 辑")]):e._e(),e.save?n("p",{staticClass:"inline-16"},[e._v("编辑")]):e._e(),e.tool.checkAuth(e.$route.name,"update")&&e.status?n("release",{staticClass:"inline-16",attrs:{data:e.form},on:{onSuccess:e.onSuccess}}):e._e(),e.tool.checkAuth(e.$route.name,"update")&&e.status?n("topping",{staticClass:"inline-16",attrs:{data:e.form},on:{onSuccess:e.onSuccess}}):e._e(),e.tool.checkAuth(e.$route.name,"delete")&&"新建"==e.form.status?n("Del",{attrs:{data:{sat_noticeid:e.$route.query.id}},on:{onSuccess:function(t){e.drawer=!1,e.$router.push({path:"/notice_mag_list"})}}}):e._e()],1),n("div",{staticStyle:{"overflow-x":"hidden"}},[n("el-row",{attrs:{gutter:16}},[n("el-col",{attrs:{span:13}},[n("div",{staticClass:"container normal-panel normal-margin"},[n("p",{staticClass:"normal-title normal-margin"},[e._v("通告设置")]),n("el-row",{attrs:{gutter:16}},[n("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"80px","label-position":"right",size:"small",disabled:e.edit}},[n("el-col",{attrs:{span:24}},[n("el-form-item",{attrs:{label:"标题",prop:"title"}},[n("el-input",{model:{value:e.form.title,callback:function(t){e.$set(e.form,"title",t)},expression:"form.title"}})],1)],1),n("el-col",{attrs:{span:24}},[n("el-form-item",{attrs:{label:"导语",prop:"summary"}},[n("el-input",{model:{value:e.form.summary,callback:function(t){e.$set(e.form,"summary",t)},expression:"form.summary"}})],1)],1),n("el-col",{attrs:{span:8}},[n("el-form-item",{attrs:{label:"板块",prop:"sat_notice_classid"}},[n("el-select",{attrs:{placeholder:"请选择"},model:{value:e.form.sat_notice_classid,callback:function(t){e.$set(e.form,"sat_notice_classid",t)},expression:"form.sat_notice_classid"}},e._l(e.options,(function(e){return n("el-option",{key:e.sat_notice_classid,attrs:{label:e.classname,value:e.sat_notice_classid}})})),1)],1)],1),n("el-col",{attrs:{span:8}},[n("el-form-item",{attrs:{label:"生效日期",prop:"begdate"}},[n("el-date-picker",{staticStyle:{width:"100%"},attrs:{"value-format":"yyyy-MM-dd",type:"date",placeholder:"生效日期"},model:{value:e.form.begdate,callback:function(t){e.$set(e.form,"begdate",t)},expression:"form.begdate"}})],1)],1),n("el-col",{attrs:{span:8}},[n("el-form-item",{attrs:{label:"截止日期",prop:"enddate"}},[n("el-date-picker",{staticStyle:{width:"100%"},attrs:{"value-format":"yyyy-MM-dd",type:"date",placeholder:"截止日期"},model:{value:e.form.enddate,callback:function(t){e.$set(e.form,"enddate",t)},expression:"form.enddate"}})],1)],1),n("el-col",{attrs:{span:24}},[n("el-form-item",{attrs:{label:"是否置顶"}},[n("el-radio-group",{model:{value:e.form.isontop,callback:function(t){e.$set(e.form,"isontop",t)},expression:"form.isontop"}},[n("el-radio",{attrs:{label:1}},[e._v("置顶")]),n("el-radio",{attrs:{label:0}},[e._v("不置顶")])],1)],1)],1),n("el-col",{attrs:{span:24}},[n("el-form-item",{attrs:{label:"通告封面"}},[e.form.cover?n("previewImage",{staticStyle:{width:"256px"},attrs:{image:e.image,deletebtn:!0},on:{onSuccess:e.clearCover}}):n("upload",{attrs:{btntype:"image",folderid:e.folderid,accept:".JPG,.PNG",bindData:{ownertable:"sat_notice",ownerid:e.form.sat_noticeid,usetype:"cover"}},on:{onSuccess:e.onCoverSubmit}}),n("p",{staticClass:"info"},[e._v("注:建议上传图片大小130x80像素,大小不超过2M,格式为JPG/PNG")])],1)],1)],1)],1)],1),n("div",{staticClass:"container normal-panel normal-margin"},[n("attachmentList",{attrs:{attinfos:e.attinfo_video,onlyread:e.store.state.pageOnlyRead},on:{onSuccess:e.queryNoticeMain}},[n("p",{attrs:{slot:"title"},slot:"title"},[e._v("视频附件")]),n("upload",{attrs:{slot:"upload",accept:".mp4,.ogg,.webm",folderid:e.folderid,bindData:{ownertable:"sat_notice",ownerid:e.form.sat_noticeid,usetype:"default"}},on:{onSuccess:e.onUploadSuccess},slot:"upload"})],1)],1),n("div",{staticClass:"container normal-panel normal-margin"},[n("attachmentList",{attrs:{attinfos:e.attinfo_attachment,onlyread:e.store.state.pageOnlyRead},on:{onSuccess:e.queryNoticeMain}},[n("upload",{attrs:{slot:"upload",folderid:e.folderid,bindData:{ownertable:"sat_notice",ownerid:e.form.sat_noticeid,usetype:"default"}},on:{onSuccess:e.onUploadSuccess},slot:"upload"})],1)],1),n("div",{staticClass:"container normal-panel normal-margin"},[n("myEditor",{ref:"editor",attrs:{content:e.form.content,id:e.form.sat_noticeid,disabled:!e.save}})],1)]),n("el-col",{attrs:{span:11}},[n("div",{staticClass:"container normal-panel normal-margin"},[n("scopeOfauth",{attrs:{defaultData:e.defaultData,disabled:"发布"==e.form.status,appidname:"sat_noticeid",obiectName:"sat_notice",dataid:e.id},on:{onChecked:e.onChecked}})],1)])],1)],1)]),n("div",{directives:[{name:"show",rawName:"v-show",value:e.save,expression:"save"}],staticClass:"fixed__btn__panel"},[n("el-button",{staticClass:"normal-btn-width",attrs:{size:"small"},on:{click:e.onClose}},[e._v("取 消")]),n("el-button",{staticClass:"normal-btn-width",attrs:{size:"small",type:"warning"},on:{click:e.onSubmit}},[e._v("保 存")])],1)])],1)},o=[],i=(n(21703),n(33028)),a=n(39115),u=n(83628),s=n(69813),l=n(67538),c=n(24239),f=n(34488),d=n(1039),p=n(34002),h={components:{upload:i.Z,previewImage:a.Z,attachmentList:u.Z,scopeOfauth:s.Z,myEditor:l.Z,release:f.Z,topping:d.Z,Del:p.Z},props:["id"],data(){var e=(e,t,n)=>{this.form.enddate&&(new Date(t).getTime()>new Date(this.form.enddate).getTime()?n(new Error("生效日期不能大于截止日期")):n())},t=(e,t,n)=>{this.form.begdate&&(new Date(t).getTime(){if(!e)return!1;this.form.content=this.$refs.editor.html;const t=await this.$api.requested({id:"20221101094803",method:"insertormodify_notice",content:this.form});this.tool.showMessage(t,(()=>{this.edit=!0,this.save=!1,this.insertCoursewareauth(),this.queryNoticeMain(),this.$emit("updateSuccess")}))}))},async queryNoticeMain(){const e=await this.$api.requested({id:"20221101095003",content:{sat_noticeid:this.id}});this.attinfo_video=e.data.attinfos.filter((e=>{if("mp4"===e.postfix||"ogg"===e.postfix||"webm"===e.postfix)return e})),this.attinfo_attachment=e.data.attinfos.filter((e=>{if("mp4"!==e.postfix&&"ogg"!==e.postfix&&"webm"!==e.postfix)return e})),this.form=Object.assign({},this.form,e.data),"新建"!==this.form.status?this.$store.dispatch("pageOnlyRead",!0):this.$store.dispatch("pageOnlyRead",!1),this.save?this.$store.dispatch("pageOnlyRead",!1):this.$store.dispatch("pageOnlyRead",!0),this.queryFileLink(),this.queryNoticeClass(),console.log("获取通告详细数据"),console.log(this.form),this.status=!0},async queryNoticeClass(){const e=await this.$api.requested({id:"20221101094603",content:{pageNumber:1,pageSize:1e3,where:{condition:""}}});console.log("板块"),console.log(e),this.options=e.data,this.form.sat_notice_classid=e.data[0].sat_notice_classid},async queryFileLink(){this.dialogEditVisible=!0;const e=await this.$api.requested({classname:"system.attachment.Attachment",method:"queryFileLink",content:{ownertable:"sat_notice",ownerid:this.form.sat_noticeid,usetype:"cover"}});console.log("封面信息"),console.log(e),this.image=e.data[0],console.log("获取封面"),console.log(this.image)},onCoverSubmit(e){this.form.cover=JSON.parse(e.attinfos).data[0].url,this.image=JSON.parse(e.attinfos).data[0]},clearCover(){this.form.cover=null,this.image={}},onChecked(e){this.authData=e},async insertCoursewareauth(){const e=await this.$api.requested({id:20221101142003,content:this.authData});console.log("新增"),0===e.code&&this.$notify({title:"失败",message:e.data,type:"error"})},async query_auth(){const e=await this.$api.requested({id:20221101142303,content:{sat_noticeid:this.id}});console.log("查询授权"),this.defaultData=e.data},onshow(){this.$router.replace({path:"notice_mag_list",query:{id:this.id}}),this.queryNoticeMain(),this.query_auth(),this.edit=!0,this.save=!1},onEdit(){this.edit=!1,this.save=!0},handleCommand(e){console.log(e),"analysis"===e&&this.dataAnalysis()},dataAnalysis(){console.log("数据分析"),this.$router.push({path:"notice_analysis",query:{id:this.id}})},onSuccess(){this.drawer=!1,this.$emit("updateSuccess")},onClose(){this.save=!1,this.edit=!0}},mounted(){this.status=!1}},g=h,v=n(43736),y=(0,v.Z)(g,r,o,!1,null,null,null),m=y.exports},34488:function(e,t,n){n.d(t,{Z:function(){return l}});var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[e.release?n("el-button",{attrs:{type:"primary",plain:"",size:"small"},on:{click:e.open}},[e._v("发布")]):e._e(),e.unRelease?n("el-button",{attrs:{type:"primary",plain:"",size:"small"},on:{click:e.unOpen}},[e._v("取消发布")]):e._e()],1)},o=[],i={props:["data"],data(){return{release:!1,unRelease:!1}},methods:{async releaseNotice(){const e=await this.$api.requested({id:"20221101095203",content:{sat_noticeids:[this.$route.query.id]}});console.log(e),1===e.code?(this.$notify({title:"成功",message:"发布"===this.data.status?"下架成功":"发布成功",type:"success"}),this.$emit("onSuccess"),this.release=!1,this.unRelease=!0):this.$notify({title:"失败",message:e.data,type:"error"})},async unReleaseNotice(){const e=await this.$api.requested({id:"20221101095303",content:{sat_noticeids:[this.data.sat_noticeid]}});console.log(e),1===e.code?(this.$notify({title:"成功",message:"发布"===this.data.status?"下架成功":"发布成功",type:"success"}),this.$emit("onSuccess"),this.release=!0,this.unRelease=!1):this.$notify({title:"失败",message:e.data,type:"error"})},open(){this.$confirm("确定发布此通告吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{this.releaseNotice()})).catch((()=>{this.$message({type:"info",message:"已取消发布"})}))},unOpen(){this.$confirm("确定取消发布此通告吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{this.unReleaseNotice()})).catch((()=>{this.$message({type:"info",message:"已取消操作"})}))}},watch:{data(e){"新建"===this.data.status?(this.release=!0,this.unRelease=!1):(this.release=!1,this.unRelease=!0)}},mounted(){"新建"===this.data.status?(this.release=!0,this.unRelease=!1):(this.release=!1,this.unRelease=!0)}},a=i,u=n(43736),s=(0,u.Z)(a,r,o,!1,null,null,null),l=s.exports},1039:function(e,t,n){n.d(t,{Z:function(){return l}});var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[e.top?n("el-button",{attrs:{type:"primary",size:"small",plain:""},on:{click:e.open}},[e._v("置顶")]):e._e(),e.unTop?n("el-button",{attrs:{type:"primary",size:"small",plain:""},on:{click:e.unOpen}},[e._v("取消置顶")]):e._e()],1)},o=[],i={props:["data"],data(){return{top:!1,unTop:!1}},methods:{async releaseNotice(){const e=await this.$api.requested({id:"20221101095403",content:{sat_noticeid:this.data.sat_noticeid}});this.tool.showMessage(e,(()=>{this.unTop=!0,this.top=!1,this.$emit("onSuccess")}))},async unReleaseNotice(){const e=await this.$api.requested({id:"20221101095503",content:{sat_noticeid:this.data.sat_noticeid}});this.tool.showMessage(e,(()=>{this.top=!0,this.unTop=!1,this.$emit("onSuccess")}))},open(){this.$confirm("确定置顶此通告吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{this.releaseNotice()})).catch((()=>{this.$message({type:"info",message:"已取消发布"})}))},unOpen(){this.$confirm("确定取消置顶此通告吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{this.unReleaseNotice()})).catch((()=>{this.$message({type:"info",message:"已取消操作"})}))}},mounted(){console.log("输出置顶情况123"),console.log(this.data.isontop),0===this.data.isontop?(this.top=!0,this.unTop=!1):(this.top=!1,this.unTop=!0)}},a=i,u=n(43736),s=(0,u.Z)(a,r,o,!1,null,null,null),l=s.exports},67538:function(e,t,n){n.d(t,{Z:function(){return sle}});var r,o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{border:"1px solid #ccc"}},[n("Toolbar",{staticStyle:{"border-bottom":"1px solid #ccc"},attrs:{editor:e.editor,defaultConfig:e.toolbarConfig,mode:e.mode}}),n("Editor",{staticStyle:{height:"500px","overflow-y":"hidden"},attrs:{defaultConfig:e.editorConfig,mode:e.mode},on:{onCreated:e.onCreated},model:{value:e.html,callback:function(t){e.html=t},expression:"html"}})],1)},i=[],a=n(20144);if("undefined"===typeof n.g){if("ActiveXObject"in window){var u="抱歉,wangEditor V5+ 版本开始,不在支持 IE 浏览器";u+="\n Sorry, wangEditor V5+ versions do not support IE browser.",console.error(u)}s(),l()}else n.g&&(null===(r=n.g.navigator)||void 0===r?void 0:r.userAgent.match("QQBrowser"))&&(s(),l());function s(){"undefined"===typeof globalThis&&(window.globalThis=window)}function l(){"undefined"===typeof AggregateError&&(window.AggregateError=function(e,t){var n=new Error(t);return n.errors=e,n})}if("object"===typeof n.g){var c=Object.getOwnPropertyDescriptor(n.g,"window");n.g.window&&!c.set||(n.g.window=n.g,n.g.requestAnimationFrame=function(){},n.g.navigator={userAgent:""},n.g.location={hostname:"0.0.0.0",port:0,protocol:"http:"},n.g.btoa=function(){},n.g.crypto={getRandomValues:function(e){return nodeCrypto.randomFillSync(e)}})} /*! * is-plain-object * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */function f(e){return"[object Object]"===Object.prototype.toString.call(e)}function d(e){var t,n;return!1!==f(e)&&(t=e.constructor,void 0===t||(n=t.prototype,!1!==f(n)&&!1!==n.hasOwnProperty("isPrototypeOf")))}function p(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:D(e)?2:C(e)?3:0}function m(e,t){return 2===y(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function b(e,t){return 2===y(e)?e.get(t):e[t]}function w(e,t,n){var r=y(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n}function E(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function D(e){return X&&e instanceof Map}function C(e){return Z&&e instanceof Set}function x(e){return e.o||e.t}function S(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=ie(e);delete t[te];for(var n=oe(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=O),Object.freeze(e),t&&v(e,(function(e,t){return A(t,!0)}),!0)),e}function O(){p(2)}function k(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function B(e){var t=ae[e];return t||p(18,e),t}function F(){return K||p(0),K}function _(e,t){t&&(B("Patches"),e.u=[],e.s=[],e.v=t)}function T(e){P(e),e.p.forEach(N),e.p=null}function P(e){e===K&&(K=e.l)}function j(e){return K={p:[],l:K,h:e,m:!0,_:0}}function N(e){var t=e[te];0===t.i||1===t.i?t.j():t.O=!0}function I(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.g||B("ES5").S(t,e,r),r?(n[te].P&&(T(t),p(4)),g(e)&&(e=R(t,e),t.l||M(t,e)),t.u&&B("Patches").M(n[te],e,t.u,t.s)):e=R(t,n,[]),T(t),t.u&&t.v(t.u,t.s),e!==Q?e:void 0}function R(e,t,n){if(k(t))return t;var r=t[te];if(!r)return v(t,(function(o,i){return L(e,r,t,o,i,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return M(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=4===r.i||5===r.i?r.o=S(r.k):r.o;v(3===r.i?new Set(o):o,(function(t,i){return L(e,r,o,t,i,n)})),M(e,o,!1),n&&e.u&&B("Patches").R(r,n,e.u,e.s)}return r.o}function L(e,t,n,r,o,i){if(o===n&&p(5),h(o)){var a=R(e,o,i&&t&&3!==t.i&&!m(t.D,r)?i.concat(r):void 0);if(w(n,r,a),!h(a))return;e.m=!1}if(g(o)&&!k(o)){if(!e.h.F&&e._<1)return;R(e,o),t&&t.A.l||M(e,o)}}function M(e,t,n){void 0===n&&(n=!1),e.h.F&&e.m&&A(t,n)}function z(e,t){var n=e[te];return(n?x(n):e)[t]}function $(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function H(e){e.P||(e.P=!0,e.l&&H(e.l))}function U(e){e.o||(e.o=S(e.t))}function V(e,t,n){var r=D(t)?B("MapSet").N(t,n):C(t)?B("MapSet").T(t,n):e.g?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:F(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=r,i=ue;n&&(o=[r],i=se);var a=Proxy.revocable(o,i),u=a.revoke,s=a.proxy;return r.k=s,r.j=u,s}(t,n):B("ES5").J(t,n);return(n?n.A:F()).p.push(r),r}function W(e){return h(e)||p(22,e),function e(t){if(!g(t))return t;var n,r=t[te],o=y(t);if(r){if(!r.P&&(r.i<4||!B("ES5").K(r)))return r.t;r.I=!0,n=q(t,o),r.I=!1}else n=q(t,o);return v(n,(function(t,o){r&&b(r.t,t)===o||w(n,t,e(o))})),3===o?new Set(n):n}(e)}function q(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return S(e)}var G,K,Y="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,Z="undefined"!=typeof Set,J="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Q=Y?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),ee=Y?Symbol.for("immer-draftable"):"__$immer_draftable",te=Y?Symbol.for("immer-state"):"__$immer_state",ne={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(e){return"Cannot apply patch, path doesn't resolve: "+e},16:'Sets cannot have "replace" patches.',17:function(e){return"Unsupported patch operation: "+e},18:function(e){return"The plugin for '"+e+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+e+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(e){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+e+"'"},22:function(e){return"'current' expects a draft, got: "+e},23:function(e){return"'original' expects a draft, got: "+e},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},re=""+Object.prototype.constructor,oe="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,ie=Object.getOwnPropertyDescriptors||function(e){var t={};return oe(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},ae={},ue={get:function(e,t){if(t===te)return e;var n=x(e);if(!m(n,t))return function(e,t,n){var r,o=$(t,n);return o?"value"in o?o.value:null===(r=o.get)||void 0===r?void 0:r.call(e.k):void 0}(e,n,t);var r=n[t];return e.I||!g(r)?r:r===z(e.t,t)?(U(e),e.o[t]=V(e.A.h,r,e)):r},has:function(e,t){return t in x(e)},ownKeys:function(e){return Reflect.ownKeys(x(e))},set:function(e,t,n){var r=$(x(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=z(x(e),t),i=null==o?void 0:o[te];if(i&&i.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(E(n,o)&&(void 0!==n||m(e.t,t)))return!0;U(e),H(e)}return e.o[t]===n&&"number"!=typeof n&&(void 0!==n||t in e.o)||(e.o[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==z(e.t,t)||t in e.t?(e.D[t]=!1,U(e),H(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=x(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){p(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){p(12)}},se={};v(ue,(function(e,t){se[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),se.deleteProperty=function(e,t){return isNaN(parseInt(t))&&p(13),ue.deleteProperty.call(this,e[0],t)},se.set=function(e,t,n){return"length"!==t&&isNaN(parseInt(t))&&p(14),ue.set.call(this,e[0],t,n,e[0])};var le=function(){function e(e){var t=this;this.g=J,this.F=!0,this.produce=function(e,n,r){if("function"==typeof e&&"function"!=typeof n){var o=n;n=e;var i=t;return function(e){var t=this;void 0===e&&(e=o);for(var r=arguments.length,a=Array(r>1?r-1:0),u=1;u1?r-1:0),i=1;i=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));var o=B("Patches").$;return h(e)?o(e,t):this.produce(e,(function(e){return o(e,t)}))},e}(),ce=new le,fe=ce.produce;ce.produceWithPatches.bind(ce),ce.setAutoFreeze.bind(ce),ce.setUseProxies.bind(ce),ce.applyPatches.bind(ce);var de=ce.createDraft.bind(ce),pe=ce.finishDraft.bind(ce);function he(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ge=new WeakMap,ve=new WeakMap,ye=new WeakMap,me=new WeakMap,be=new WeakMap,we=new WeakMap;function Ee(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function De(e){for(var t=1;t{var e={children:[],operations:[],selection:null,marks:null,isInline:()=>!1,isVoid:()=>!1,onChange:()=>{},apply:t=>{for(var n of st.pathRefs(e))mt.transform(n,t);for(var r of st.pointRefs(e))Dt.transform(r,t);for(var o of st.rangeRefs(e))Ot.transform(o,t);var i=new Set,a=[],u=e=>{if(e){var t=e.join(",");i.has(t)||(i.add(t),a.push(e))}},s=ge.get(e)||[],l=xe(t);for(var c of s){var f=yt.transform(c,t);u(f)}for(var d of l)u(d);ge.set(e,a),Jt.transform(e,t),e.operations.push(t),st.normalize(e),"set_selection"===t.type&&(e.marks=null),ve.get(e)||(ve.set(e,!0),Promise.resolve().then((()=>{ve.set(e,!1),e.onChange(),e.operations=[]})))},addMark:(t,n)=>{var{selection:r}=e;if(r)if(At.isExpanded(r))Jt.setNodes(e,{[t]:n},{match:Pt.isText,split:!0});else{var o=De(De({},st.marks(e)||{}),{},{[t]:n});e.marks=o,ve.get(e)||e.onChange()}},deleteBackward:t=>{var{selection:n}=e;n&&At.isCollapsed(n)&&Jt.delete(e,{unit:t,reverse:!0})},deleteForward:t=>{var{selection:n}=e;n&&At.isCollapsed(n)&&Jt.delete(e,{unit:t})},deleteFragment:t=>{var{selection:n}=e;n&&At.isExpanded(n)&&Jt.delete(e,{reverse:"backward"===t})},getFragment:()=>{var{selection:t}=e;return t?pt.fragment(e,t):[]},insertBreak:()=>{Jt.splitNodes(e,{always:!0})},insertFragment:t=>{Jt.insertFragment(e,t)},insertNode:t=>{Jt.insertNodes(e,t)},insertText:t=>{var{selection:n,marks:r}=e;if(n){if(r){var o=De({text:t},r);Jt.insertNodes(e,o)}else Jt.insertText(e,t);e.marks=null}},normalizeNode:t=>{var[n,r]=t;if(!Pt.isText(n))if(nt.isElement(n)&&0===n.children.length){var o={text:""};Jt.insertNodes(e,o,{at:r.concat(0),voids:!0})}else for(var i=!st.isEditor(n)&&(nt.isElement(n)&&(e.isInline(n)||0===n.children.length||Pt.isText(n.children[0])||e.isInline(n.children[0]))),a=0,u=0;u{var{selection:n}=e;if(n)if(At.isExpanded(n))Jt.unsetNodes(e,t,{match:Pt.isText,split:!0});else{var r=De({},st.marks(e)||{});delete r[t],e.marks=r,ve.get(e)||e.onChange()}}};return e},xe=e=>{switch(e.type){case"insert_text":case"remove_text":case"set_node":var{path:t}=e;return yt.levels(t);case"insert_node":var{node:n,path:r}=e,o=yt.levels(r),i=Pt.isText(n)?[]:Array.from(pt.nodes(n),(e=>{var[,t]=e;return r.concat(t)}));return[...o,...i];case"merge_node":var{path:a}=e,u=yt.ancestors(a),s=yt.previous(a);return[...u,s];case"move_node":var{path:l,newPath:c}=e;if(yt.equals(l,c))return[];var f=[],d=[];for(var p of yt.ancestors(l)){var h=yt.transform(p,e);f.push(h)}for(var g of yt.ancestors(c)){var v=yt.transform(g,e);d.push(v)}var y=d[d.length-1],m=c[c.length-1],b=y.concat(m);return[...f,...d,b];case"remove_node":var{path:w}=e,E=yt.ancestors(w);return[...E];case"split_node":var{path:D}=e,C=yt.levels(D),x=yt.next(D);return[...C,x];default:return[]}};function Se(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}function Ae(e,t){if(null==e)return{};var n,r,o=Se(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Oe,ke=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!t,r=t?Ne(e):e,o=Oe.None,i=Oe.None,a=0,u=null,s=null;for(var l of r){var c=l.codePointAt(0);if(!c)break;var f=Ge(l,c);if([o,i]=n?[i,f]:[f,o],Ke(o,Oe.ZWJ)&&Ke(i,Oe.ExtPict)&&(u=Je(n?e.substring(0,a):e.substring(0,e.length-a)),!u))break;if(Ke(o,Oe.RI)&&Ke(i,Oe.RI)&&(s=null!==s?!s:!!n||et(e.substring(0,e.length-a)),!s))break;if(o!==Oe.None&&i!==Oe.None&&Xe(o,i))break;a+=l.length}return a||1},Be=/\s/,Fe=/[\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]/,_e=/['\u2018\u2019]/,Te=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=0,r=!1;while(e.length>0){var o=ke(e,t),[i,a]=Pe(e,o,t);if(je(i,a,t))r=!0,n+=o;else{if(r)break;n+=o}e=a}return n},Pe=(e,t,n)=>{if(n){var r=e.length-t;return[e.slice(r,e.length),e.slice(0,r)]}return[e.slice(0,t),e.slice(t)]},je=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Be.test(t))return!1;if(_e.test(t)){var o=ke(n,r),[i,a]=Pe(n,o,r);if(e(i,a,r))return!0}return!Fe.test(t)},Ne=function*(e){for(var t=e.length-1,n=0;ne>=55296&&e<=56319,Re=e=>e>=56320&&e<=57343;(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"})(Oe||(Oe={}));var Le=/^(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1AC0\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])$/,Me=/^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/,ze=/^(?:[\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]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDDCE\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB1\uDCB2\uDCB9\uDCBB\uDCBC\uDCBE\uDCC1\uDDB0\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDD31-\uDD35\uDD37\uDD38\uDD3D\uDD40\uDD42\uDDD1-\uDDD3\uDDDC-\uDDDF\uDDE4\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF87\uDFF0\uDFF1]|\uD834[\uDD66\uDD6D])$/,$e=/^[\u1100-\u115F\uA960-\uA97C]$/,He=/^[\u1160-\u11A7\uD7B0-\uD7C6]$/,Ue=/^[\u11A8-\u11FF\uD7CB-\uD7FB]$/,Ve=/^[\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]$/,We=/^[\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]$/,qe=/^(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])$/,Ge=(e,t)=>{var n=Oe.Any;return-1!==e.search(Le)&&(n|=Oe.Extend),8205===t&&(n|=Oe.ZWJ),t>=127462&&t<=127487&&(n|=Oe.RI),-1!==e.search(Me)&&(n|=Oe.Prepend),-1!==e.search(ze)&&(n|=Oe.SpacingMark),-1!==e.search($e)&&(n|=Oe.L),-1!==e.search(He)&&(n|=Oe.V),-1!==e.search(Ue)&&(n|=Oe.T),-1!==e.search(Ve)&&(n|=Oe.LV),-1!==e.search(We)&&(n|=Oe.LVT),-1!==e.search(qe)&&(n|=Oe.ExtPict),n};function Ke(e,t){return 0!==(e&t)}var Ye=[[Oe.L,Oe.L|Oe.V|Oe.LV|Oe.LVT],[Oe.LV|Oe.V,Oe.V|Oe.T],[Oe.LVT|Oe.T,Oe.T],[Oe.Any,Oe.Extend|Oe.ZWJ],[Oe.Any,Oe.SpacingMark],[Oe.Prepend,Oe.Any],[Oe.ZWJ,Oe.ExtPict],[Oe.RI,Oe.RI]];function Xe(e,t){return-1===Ye.findIndex((n=>Ke(e,n[0])&&Ke(t,n[1])))}var Ze=/(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1AC0\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])*\u200D$/,Je=e=>-1!==e.search(Ze),Qe=/(?:\uD83C[\uDDE6-\uDDFF])+$/g,et=e=>{var t=e.match(Qe);if(null===t)return!1;var n=t[0].length/2;return n%2===1},tt=e=>d(e)&&pt.isNodeList(e.children)&&!st.isEditor(e),nt={isAncestor(e){return d(e)&&pt.isNodeList(e.children)},isElement:tt,isElementList(e){return Array.isArray(e)&&e.every((e=>nt.isElement(e)))},isElementProps(e){return void 0!==e.children},isElementType:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"type";return tt(e)&&e[n]===t},matches(e,t){for(var n in t)if("children"!==n&&e[n]!==t[n])return!1;return!0}},rt=["text"],ot=["text"];function it(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function at(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},{voids:n=!1,mode:r="lowest",at:o=e.selection,match:i}=t;if(o){var a=st.path(e,o),u="lowest"===r;for(var[s,l]of st.levels(e,{at:a,voids:n,match:i,reverse:u}))if(!Pt.isText(s)&&!yt.equals(a,l))return[s,l]}},addMark(e,t,n){e.addMark(t,n)},after(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=st.point(e,t,{edge:"end"}),i=st.end(e,[]),a={anchor:o,focus:i},{distance:u=1}=r,s=0;for(var l of st.positions(e,at(at({},r),{},{at:a}))){if(s>u)break;0!==s&&(n=l),s++}return n},before(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=st.start(e,[]),i=st.point(e,t,{edge:"start"}),a={anchor:o,focus:i},{distance:u=1}=r,s=0;for(var l of st.positions(e,at(at({},r),{},{at:a,reverse:!0}))){if(s>u)break;0!==s&&(n=l),s++}return n},deleteBackward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:n="character"}=t;e.deleteBackward(n)},deleteForward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:n="character"}=t;e.deleteForward(n)},deleteFragment(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{direction:n="forward"}=t;e.deleteFragment(n)},edges(e,t){return[st.start(e,t),st.end(e,t)]},end(e,t){return st.point(e,t,{edge:"end"})},first(e,t){var n=st.path(e,t,{edge:"start"});return st.node(e,n)},fragment(e,t){var n=st.range(e,t),r=pt.fragment(e,n);return r},hasBlocks(e,t){return t.children.some((t=>st.isBlock(e,t)))},hasInlines(e,t){return t.children.some((t=>Pt.isText(t)||st.isInline(e,t)))},hasTexts(e,t){return t.children.every((e=>Pt.isText(e)))},insertBreak(e){e.insertBreak()},insertFragment(e,t){e.insertFragment(t)},insertNode(e,t){e.insertNode(t)},insertText(e,t){e.insertText(t)},isBlock(e,t){return nt.isElement(t)&&!e.isInline(t)},isEditor(e){if(!d(e))return!1;var t=ut.get(e);if(void 0!==t)return t;var n="function"===typeof e.addMark&&"function"===typeof e.apply&&"function"===typeof e.deleteBackward&&"function"===typeof e.deleteForward&&"function"===typeof e.deleteFragment&&"function"===typeof e.insertBreak&&"function"===typeof e.insertFragment&&"function"===typeof e.insertNode&&"function"===typeof e.insertText&&"function"===typeof e.isInline&&"function"===typeof e.isVoid&&"function"===typeof e.normalizeNode&&"function"===typeof e.onChange&&"function"===typeof e.removeMark&&(null===e.marks||d(e.marks))&&(null===e.selection||At.isRange(e.selection))&&pt.isNodeList(e.children)&&vt.isOperationList(e.operations);return ut.set(e,n),n},isEnd(e,t,n){var r=st.end(e,n);return Et.equals(t,r)},isEdge(e,t,n){return st.isStart(e,t,n)||st.isEnd(e,t,n)},isEmpty(e,t){var{children:n}=t,[r]=n;return 0===n.length||1===n.length&&Pt.isText(r)&&""===r.text&&!e.isVoid(t)},isInline(e,t){return nt.isElement(t)&&e.isInline(t)},isNormalizing(e){var t=ye.get(e);return void 0===t||t},isStart(e,t,n){if(0!==t.offset)return!1;var r=st.start(e,n);return Et.equals(t,r)},isVoid(e,t){return nt.isElement(t)&&e.isVoid(t)},last(e,t){var n=st.path(e,t,{edge:"end"});return st.node(e,n)},leaf(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=st.path(e,t,n),o=pt.leaf(e,r);return[o,r]},*levels(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{at:n=e.selection,reverse:r=!1,voids:o=!1}=t,{match:i}=t;if(null==i&&(i=()=>!0),n){var a=[],u=st.path(e,n);for(var[s,l]of pt.levels(e,u))if(i(s,l)&&(a.push([s,l]),!o&&st.isVoid(e,s)))break;r&&a.reverse(),yield*a}},marks(e){var{marks:t,selection:n}=e;if(!n)return null;if(t)return t;if(At.isExpanded(n)){var[r]=st.nodes(e,{match:Pt.isText});if(r){var[o]=r,i=Ae(o,rt);return i}return{}}var{anchor:a}=n,{path:u}=a,[s]=st.leaf(e,u);if(0===a.offset){var l=st.previous(e,{at:u,match:Pt.isText}),c=st.above(e,{match:t=>st.isBlock(e,t)});if(l&&c){var[f,d]=l,[,p]=c;yt.isAncestor(p,d)&&(s=f)}}var h=Ae(s,ot);return h},next(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{mode:n="lowest",voids:r=!1}=t,{match:o,at:i=e.selection}=t;if(i){var a=st.after(e,i,{voids:r});if(a){var[,u]=st.last(e,[]),s=[a.path,u];if(yt.isPath(i)&&0===i.length)throw new Error("Cannot get the next node from the root node!");if(null==o)if(yt.isPath(i)){var[l]=st.parent(e,i);o=e=>l.children.includes(e)}else o=()=>!0;var[c]=st.nodes(e,{at:s,match:o,mode:n,voids:r});return c}}},node(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=st.path(e,t,n),o=pt.get(e,r);return[o,r]},*nodes(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{at:n=e.selection,mode:r="all",universal:o=!1,reverse:i=!1,voids:a=!1}=t,{match:u}=t;if(u||(u=()=>!0),n){var s,l;if(lt.isSpan(n))s=n[0],l=n[1];else{var c=st.path(e,n,{edge:"start"}),f=st.path(e,n,{edge:"end"});s=i?f:c,l=i?c:f}var d,p=pt.nodes(e,{reverse:i,from:s,to:l,pass:t=>{var[n]=t;return!a&&st.isVoid(e,n)}}),h=[];for(var[g,v]of p){var y=d&&0===yt.compare(v,d[1]);if("highest"!==r||!y)if(u(g,v))if("lowest"===r&&y)d=[g,v];else{var m="lowest"===r?d:[g,v];m&&(o?h.push(m):yield m),d=[g,v]}else if(o&&!y&&Pt.isText(g))return}"lowest"===r&&d&&(o?h.push(d):yield d),o&&(yield*h)}},normalize(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{force:n=!1}=t,r=e=>ge.get(e)||[];if(st.isNormalizing(e)){if(n){var o=Array.from(pt.nodes(e),(e=>{var[,t]=e;return t}));ge.set(e,o)}0!==r(e).length&&st.withoutNormalizing(e,(()=>{for(var t of r(e))if(pt.has(e,t)){var n=st.node(e,t),[o,i]=n;nt.isElement(o)&&0===o.children.length&&e.normalizeNode(n)}var a=42*r(e).length,u=0;while(0!==r(e).length){if(u>a)throw new Error("\n Could not completely normalize the editor after ".concat(a," iterations! This is usually due to incorrect normalization logic that leaves a node in an invalid state.\n "));var s=r(e).pop();if(pt.has(e,s)){var l=st.node(e,s);e.normalizeNode(l)}u++}}))}},parent(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=st.path(e,t,n),o=yt.parent(r),i=st.node(e,o);return i},path(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{depth:r,edge:o}=n;if(yt.isPath(t))if("start"===o){var[,i]=pt.first(e,t);t=i}else if("end"===o){var[,a]=pt.last(e,t);t=a}return At.isRange(t)&&(t="start"===o?At.start(t):"end"===o?At.end(t):yt.common(t.anchor.path,t.focus.path)),Et.isPoint(t)&&(t=t.path),null!=r&&(t=t.slice(0,r)),t},hasPath(e,t){return pt.has(e,t)},pathRef(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{affinity:r="forward"}=n,o={current:t,affinity:r,unref(){var{current:t}=o,n=st.pathRefs(e);return n.delete(o),o.current=null,t}},i=st.pathRefs(e);return i.add(o),o},pathRefs(e){var t=me.get(e);return t||(t=new Set,me.set(e,t)),t},point(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{edge:r="start"}=n;if(yt.isPath(t)){var o;if("end"===r){var[,i]=pt.last(e,t);o=i}else{var[,a]=pt.first(e,t);o=a}var u=pt.get(e,o);if(!Pt.isText(u))throw new Error("Cannot get the ".concat(r," point in the node at path [").concat(t,"] because it has no ").concat(r," text node."));return{path:o,offset:"end"===r?u.text.length:0}}if(At.isRange(t)){var[s,l]=At.edges(t);return"start"===r?s:l}return t},pointRef(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{affinity:r="forward"}=n,o={current:t,affinity:r,unref(){var{current:t}=o,n=st.pointRefs(e);return n.delete(o),o.current=null,t}},i=st.pointRefs(e);return i.add(o),o},pointRefs(e){var t=be.get(e);return t||(t=new Set,be.set(e,t)),t},*positions(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{at:n=e.selection,unit:r="offset",reverse:o=!1,voids:i=!1}=t;if(n){var a=st.range(e,n),[u,s]=At.edges(a),l=o?s:u,c=!1,f="",d=0,p=0,h=0;for(var[g,v]of st.nodes(e,{at:n,reverse:o,voids:i})){if(nt.isElement(g)){if(!i&&e.isVoid(g)){yield st.start(e,v);continue}if(e.isInline(g))continue;if(st.hasInlines(e,g)){var y=yt.isAncestor(v,s.path)?s:st.end(e,v),m=yt.isAncestor(v,u.path)?u:st.start(e,v);f=st.string(e,{anchor:m,focus:y},{voids:i}),c=!0}}if(Pt.isText(g)){var b=yt.equals(v,l.path);b?(p=o?l.offset:g.text.length-l.offset,h=l.offset):(p=g.text.length,h=o?p:0),(b||c||"offset"===r)&&(yield{path:v,offset:h},c=!1);while(1){if(0===d){if(""===f)break;d=w(f,r,o),f=Pe(f,d,o)[1]}if(h=o?h-d:h+d,p-=d,p<0){d=-p;break}d=0,yield{path:v,offset:h}}}}}function w(e,t,n){return"character"===t?ke(e,n):"word"===t?Te(e,n):"line"===t||"block"===t?e.length:1}},previous(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{mode:n="lowest",voids:r=!1}=t,{match:o,at:i=e.selection}=t;if(i){var a=st.before(e,i,{voids:r});if(a){var[,u]=st.first(e,[]),s=[a.path,u];if(yt.isPath(i)&&0===i.length)throw new Error("Cannot get the previous node from the root node!");if(null==o)if(yt.isPath(i)){var[l]=st.parent(e,i);o=e=>l.children.includes(e)}else o=()=>!0;var[c]=st.nodes(e,{reverse:!0,at:s,match:o,mode:n,voids:r});return c}}},range(e,t,n){if(At.isRange(t)&&!n)return t;var r=st.start(e,t),o=st.end(e,n||t);return{anchor:r,focus:o}},rangeRef(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{affinity:r="forward"}=n,o={current:t,affinity:r,unref(){var{current:t}=o,n=st.rangeRefs(e);return n.delete(o),o.current=null,t}},i=st.rangeRefs(e);return i.add(o),o},rangeRefs(e){var t=we.get(e);return t||(t=new Set,we.set(e,t)),t},removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){ye.set(e,t)},start(e,t){return st.point(e,t,{edge:"start"})},string(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{voids:r=!1}=n,o=st.range(e,t),[i,a]=At.edges(o),u="";for(var[s,l]of st.nodes(e,{at:o,match:Pt.isText,voids:r})){var c=s.text;yt.equals(l,a.path)&&(c=c.slice(0,a.offset)),yt.equals(l,i.path)&&(c=c.slice(i.offset)),u+=c}return u},unhangRange(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{voids:r=!1}=n,[o,i]=At.edges(t);if(0!==o.offset||0!==i.offset||At.isCollapsed(t))return t;var a=st.above(e,{at:i,match:t=>st.isBlock(e,t)}),u=a?a[1]:[],s=st.start(e,[]),l={anchor:s,focus:i},c=!0;for(var[f,d]of st.nodes(e,{at:l,match:Pt.isText,reverse:!0,voids:r}))if(c)c=!1;else if(""!==f.text||yt.isBefore(d,u)){i={path:d,offset:f.text.length};break}return{anchor:o,focus:i}},void(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return st.above(e,at(at({},t),{},{match:t=>st.isVoid(e,t)}))},withoutNormalizing(e,t){var n=st.isNormalizing(e);st.setNormalizing(e,!1);try{t()}finally{st.setNormalizing(e,n)}st.normalize(e)}},lt={isSpan(e){return Array.isArray(e)&&2===e.length&&e.every(yt.isPath)}},ct=["children"],ft=["text"],dt=new WeakMap,pt={ancestor(e,t){var n=pt.get(e,t);if(Pt.isText(n))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(n));return n},*ancestors(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(var r of yt.ancestors(t,n)){var o=pt.ancestor(e,r),i=[o,r];yield i}},child(e,t){if(Pt.isText(e))throw new Error("Cannot get the child of a text node: ".concat(JSON.stringify(e)));var n=e.children[t];if(null==n)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(JSON.stringify(e)));return n},*children(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{reverse:r=!1}=n,o=pt.ancestor(e,t),{children:i}=o,a=r?i.length-1:0;while(r?a>=0:a1&&void 0!==arguments[1]?arguments[1]:{};for(var[n,r]of pt.nodes(e,t))0!==r.length&&(yield[n,r])},*elements(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var[n,r]of pt.nodes(e,t))nt.isElement(n)&&(yield[n,r])},extractProps(e){if(nt.isAncestor(e)){var t=Ae(e,ct);return t}t=Ae(e,ft);return t},first(e,t){var n=t.slice(),r=pt.get(e,n);while(r){if(Pt.isText(r)||0===r.children.length)break;r=r.children[0],n.push(0)}return[r,n]},fragment(e,t){if(Pt.isText(e))throw new Error("Cannot get a fragment starting from a root text node: ".concat(JSON.stringify(e)));var n=fe({children:e.children},(e=>{var[n,r]=At.edges(t),o=pt.nodes(e,{reverse:!0,pass:e=>{var[,n]=e;return!At.includes(t,n)}});for(var[,i]of o){if(!At.includes(t,i)){var a=pt.parent(e,i),u=i[i.length-1];a.children.splice(u,1)}if(yt.equals(i,r.path)){var s=pt.leaf(e,i);s.text=s.text.slice(0,r.offset)}if(yt.equals(i,n.path)){var l=pt.leaf(e,i);l.text=l.text.slice(n.offset)}}st.isEditor(e)&&(e.selection=null)}));return n.children},get(e,t){for(var n=e,r=0;rpt.isNode(e)));return dt.set(e,n),n},last(e,t){var n=t.slice(),r=pt.get(e,n);while(r){if(Pt.isText(r)||0===r.children.length)break;var o=r.children.length-1;r=r.children[o],n.push(o)}return[r,n]},leaf(e,t){var n=pt.get(e,t);if(!Pt.isText(n))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(n));return n},*levels(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(var r of yt.levels(t,n)){var o=pt.get(e,r);yield[o,r]}},matches(e,t){return nt.isElement(e)&&nt.isElementProps(t)&&nt.matches(e,t)||Pt.isText(e)&&Pt.isTextProps(t)&&Pt.matches(e,t)},*nodes(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{pass:n,reverse:r=!1}=t,{from:o=[],to:i}=t,a=new Set,u=[],s=e;while(1){if(i&&(r?yt.isBefore(u,i):yt.isAfter(u,i)))break;if(a.has(s)||(yield[s,u]),a.has(s)||Pt.isText(s)||0===s.children.length||null!=n&&!1!==n([s,u])){if(0===u.length)break;if(!r){var l=yt.next(u);if(pt.has(e,l)){u=l,s=pt.get(e,u);continue}}if(r&&0!==u[u.length-1]){var c=yt.previous(u);u=c,s=pt.get(e,u)}else u=yt.parent(u),s=pt.get(e,u),a.add(s)}else{a.add(s);var f=r?s.children.length-1:0;yt.isAncestor(u,o)&&(f=o[u.length]),u=u.concat(f),s=pt.get(e,u)}}},parent(e,t){var n=yt.parent(t),r=pt.get(e,n);if(Pt.isText(r))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return r},string(e){return Pt.isText(e)?e.text:e.children.map(pt.string).join("")},*texts(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var[n,r]of pt.nodes(e,t))Pt.isText(n)&&(yield[n,r])}};function ht(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gt(e){for(var t=1;tvt.isOperation(e)))},isSelectionOperation(e){return vt.isOperation(e)&&e.type.endsWith("_selection")},isTextOperation(e){return vt.isOperation(e)&&e.type.endsWith("_text")},inverse(e){switch(e.type){case"insert_node":return gt(gt({},e),{},{type:"remove_node"});case"insert_text":return gt(gt({},e),{},{type:"remove_text"});case"merge_node":return gt(gt({},e),{},{type:"split_node",path:yt.previous(e.path)});case"move_node":var{newPath:t,path:n}=e;if(yt.equals(t,n))return e;if(yt.isSibling(n,t))return gt(gt({},e),{},{path:t,newPath:n});var r=yt.transform(n,e),o=yt.transform(yt.next(n),e);return gt(gt({},e),{},{path:r,newPath:o});case"remove_node":return gt(gt({},e),{},{type:"insert_node"});case"remove_text":return gt(gt({},e),{},{type:"insert_text"});case"set_node":var{properties:i,newProperties:a}=e;return gt(gt({},e),{},{properties:a,newProperties:i});case"set_selection":var{properties:u,newProperties:s}=e;return gt(gt({},e),{},null==u?{properties:s,newProperties:null}:null==s?{properties:null,newProperties:u}:{properties:s,newProperties:u});case"split_node":return gt(gt({},e),{},{type:"merge_node",path:yt.next(e.path)})}}},yt={ancestors(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,r=yt.levels(e,t);return r=n?r.slice(1):r.slice(0,-1),r},common(e,t){for(var n=[],r=0;rt[r])return 1}return 0},endsAfter(e,t){var n=e.length-1,r=e.slice(0,n),o=t.slice(0,n),i=e[n],a=t[n];return yt.equals(r,o)&&i>a},endsAt(e,t){var n=e.length,r=e.slice(0,n),o=t.slice(0,n);return yt.equals(r,o)},endsBefore(e,t){var n=e.length-1,r=e.slice(0,n),o=t.slice(0,n),i=e[n],a=t[n];return yt.equals(r,o)&&ie===t[n]))},hasPrevious(e){return e[e.length-1]>0},isAfter(e,t){return 1===yt.compare(e,t)},isAncestor(e,t){return e.lengtht.length&&0===yt.compare(e,t)},isParent(e,t){return e.length+1===t.length&&0===yt.compare(e,t)},isPath(e){return Array.isArray(e)&&(0===e.length||"number"===typeof e[0])},isSibling(e,t){if(e.length!==t.length)return!1;var n=e.slice(0,-1),r=t.slice(0,-1),o=e[e.length-1],i=t[t.length-1];return o!==i&&yt.equals(n,r)},levels(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,r=[],o=0;o<=e.length;o++)r.push(e.slice(0,o));return n&&r.reverse(),r},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)},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(!yt.isAncestor(t,e)&&!yt.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 n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return fe(e,(r=>{var{affinity:o="forward"}=n;if(e&&0!==(null===e||void 0===e?void 0:e.length)){if(null===r)return null;switch(t.type){case"insert_node":var{path:i}=t;(yt.equals(i,r)||yt.endsBefore(i,r)||yt.isAncestor(i,r))&&(r[i.length-1]+=1);break;case"remove_node":var{path:a}=t;if(yt.equals(a,r)||yt.isAncestor(a,r))return null;yt.endsBefore(a,r)&&(r[a.length-1]-=1);break;case"merge_node":var{path:u,position:s}=t;yt.equals(u,r)||yt.endsBefore(u,r)?r[u.length-1]-=1:yt.isAncestor(u,r)&&(r[u.length-1]-=1,r[u.length]+=s);break;case"split_node":var{path:l,position:c}=t;if(yt.equals(l,r)){if("forward"===o)r[r.length-1]+=1;else if("backward"!==o)return null}else yt.endsBefore(l,r)?r[l.length-1]+=1:yt.isAncestor(l,r)&&e[l.length]>=c&&(r[l.length-1]+=1,r[l.length]-=c);break;case"move_node":var{path:f,newPath:d}=t;if(yt.equals(f,d))return;if(yt.isAncestor(f,r)||yt.equals(f,r)){var p=d.slice();return yt.endsBefore(f,d)&&f.lengtht.offset?1:0:n},isAfter(e,t){return 1===Et.compare(e,t)},isBefore(e,t){return-1===Et.compare(e,t)},equals(e,t){return e.offset===t.offset&&yt.equals(e.path,t.path)},isPoint(e){return d(e)&&"number"===typeof e.offset&&yt.isPath(e.path)},transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return fe(e,(e=>{if(null===e)return null;var{affinity:r="forward"}=n,{path:o,offset:i}=e;switch(t.type){case"insert_node":case"move_node":e.path=yt.transform(o,t,n);break;case"insert_text":yt.equals(t.path,o)&&t.offset<=i&&(e.offset+=t.text.length);break;case"merge_node":yt.equals(t.path,o)&&(e.offset+=t.position),e.path=yt.transform(o,t,n);break;case"remove_text":yt.equals(t.path,o)&&t.offset<=i&&(e.offset-=Math.min(i-t.offset,t.text.length));break;case"remove_node":if(yt.equals(t.path,o)||yt.isAncestor(t.path,o))return null;e.path=yt.transform(o,t,n);break;case"split_node":if(yt.equals(t.path,o)){if(t.position===i&&null==r)return null;(t.position1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,{anchor:r,focus:o}=e;return At.isBackward(e)===n?[r,o]:[o,r]},end(e){var[,t]=At.edges(e);return t},equals(e,t){return Et.equals(e.anchor,t.anchor)&&Et.equals(e.focus,t.focus)},includes(e,t){if(At.isRange(t)){if(At.includes(e,t.anchor)||At.includes(e,t.focus))return!0;var[n,r]=At.edges(e),[o,i]=At.edges(t);return Et.isBefore(n,o)&&Et.isAfter(r,i)}var[a,u]=At.edges(e),s=!1,l=!1;return Et.isPoint(t)?(s=Et.compare(t,a)>=0,l=Et.compare(t,u)<=0):(s=yt.compare(t,a.path)>=0,l=yt.compare(t,u.path)<=0),s&&l},intersection(e,t){var n=Ae(e,Ct),[r,o]=At.edges(e),[i,a]=At.edges(t),u=Et.isBefore(r,i)?i:r,s=Et.isBefore(o,a)?o:a;return Et.isBefore(s,u)?null:St({anchor:u,focus:s},n)},isBackward(e){var{anchor:t,focus:n}=e;return Et.isAfter(t,n)},isCollapsed(e){var{anchor:t,focus:n}=e;return Et.equals(t,n)},isExpanded(e){return!At.isCollapsed(e)},isForward(e){return!At.isBackward(e)},isRange(e){return d(e)&&Et.isPoint(e.anchor)&&Et.isPoint(e.focus)},*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=At.edges(e);return t},transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return fe(e,(e=>{if(null===e)return null;var r,o,{affinity:i="inward"}=n;if("inward"===i){var a=At.isCollapsed(e);At.isForward(e)?(r="forward",o=a?r:"backward"):(r="backward",o=a?r:"forward")}else"outward"===i?At.isForward(e)?(r="backward",o="forward"):(r="forward",o="backward"):(r=i,o=i);var u=Et.transform(e.anchor,t,{affinity:r}),s=Et.transform(e.focus,t,{affinity:o});if(!u||!s)return null;e.anchor=u,e.focus=s}))}},Ot={transform(e,t){var{current:n,affinity:r}=e;if(null!=n){var o=At.transform(n,t,{affinity:r});e.current=o,null==o&&e.unref()}}},kt=(e,t)=>{for(var n in e){var r=e[n],o=t[n];if(d(r)&&d(o)){if(!kt(r,o))return!1}else if(Array.isArray(r)&&Array.isArray(o)){if(r.length!==o.length)return!1;for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:{},{loose:r=!1}=n;function o(e){var t=Ae(e,Bt);return t}return kt(r?o(e):e,r?o(t):t)},isText(e){return d(e)&&"string"===typeof e.text},isTextList(e){return Array.isArray(e)&&e.every((e=>Pt.isText(e)))},isTextProps(e){return void 0!==e.text},matches(e,t){for(var n in t)if("text"!==n&&(!e.hasOwnProperty(n)||e[n]!==t[n]))return!1;return!0},decorations(e,t){var n=[Tt({},e)];for(var r of t){var o=Ae(r,Ft),[i,a]=At.edges(r),u=[],s=0;for(var l of n){var{length:c}=l.text,f=s;if(s+=c,i.offset<=f&&a.offset>=s)Object.assign(l,o),u.push(l);else if(i.offset!==a.offset&&(i.offset===s||a.offset===f)||i.offset>s||a.offsetf){var v=i.offset-f;p=Tt(Tt({},d),{},{text:d.text.slice(0,v)}),d=Tt(Tt({},d),{},{text:d.text.slice(v)})}Object.assign(d,o),p&&u.push(p),u.push(d),h&&u.push(h)}}n=u}return n}};function jt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nt(e){for(var t=1;t{switch(n.type){case"insert_node":var{path:r,node:o}=n,i=pt.parent(e,r),a=r[r.length-1];if(a>i.children.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(r,"] because the destination is past the end of the node."));if(i.children.splice(a,0,o),t)for(var[u,s]of At.points(t))t[s]=Et.transform(u,n);break;case"insert_text":var{path:l,offset:c,text:f}=n;if(0===f.length)break;var d=pt.leaf(e,l),p=d.text.slice(0,c),h=d.text.slice(c);if(d.text=p+f+h,t)for(var[g,v]of At.points(t))t[v]=Et.transform(g,n);break;case"merge_node":var{path:y}=n,m=pt.get(e,y),b=yt.previous(y),w=pt.get(e,b),E=pt.parent(e,y),D=y[y.length-1];if(Pt.isText(m)&&Pt.isText(w))w.text+=m.text;else{if(Pt.isText(m)||Pt.isText(w))throw new Error('Cannot apply a "merge_node" operation at path ['.concat(y,"] to nodes of different interfaces: ").concat(m," ").concat(w));w.children.push(...m.children)}if(E.children.splice(D,1),t)for(var[C,x]of At.points(t))t[x]=Et.transform(C,n);break;case"move_node":var{path:S,newPath:A}=n;if(yt.isAncestor(S,A))throw new Error("Cannot move a path [".concat(S,"] to new path [").concat(A,"] because the destination is inside itself."));var O=pt.get(e,S),k=pt.parent(e,S),B=S[S.length-1];k.children.splice(B,1);var F=yt.transform(S,n),_=pt.get(e,yt.parent(F)),T=F[F.length-1];if(_.children.splice(T,0,O),t)for(var[P,j]of At.points(t))t[j]=Et.transform(P,n);break;case"remove_node":var{path:N}=n,I=N[N.length-1],R=pt.parent(e,N);if(R.children.splice(I,1),t)for(var[L,M]of At.points(t)){var z=Et.transform(L,n);if(null!=t&&null!=z)t[M]=z;else{var $=void 0,H=void 0;for(var[U,V]of pt.texts(e)){if(-1!==yt.compare(V,N)){H=[U,V];break}$=[U,V]}var W=!1;$&&H&&(W=yt.equals(H[1],N)?!yt.hasPrevious(H[1]):yt.common($[1],N).length2&&void 0!==arguments[2]?arguments[2]:{};st.withoutNormalizing(e,(()=>{var{hanging:r=!1,voids:o=!1,mode:i="lowest"}=n,{at:a,match:u,select:s}=n;if(pt.isNode(t)&&(t=[t]),0!==t.length){var[l]=t;if(a||(a=e.selection?e.selection:e.children.length>0?st.end(e,[]):[0],s=!0),null==s&&(s=!1),At.isRange(a))if(r||(a=st.unhangRange(e,a)),At.isCollapsed(a))a=a.anchor;else{var[,c]=At.edges(a),f=st.pointRef(e,c);Jt.delete(e,{at:a}),a=f.unref()}if(Et.isPoint(a)){null==u&&(u=Pt.isText(l)?e=>Pt.isText(e):e.isInline(l)?t=>Pt.isText(t)||st.isInline(e,t):t=>st.isBlock(e,t));var[d]=st.nodes(e,{at:a.path,match:u,mode:i,voids:o});if(!d)return;var[,p]=d,h=st.pathRef(e,p),g=st.isEnd(e,a,p);Jt.splitNodes(e,{at:a,match:u,mode:i,voids:o});var v=h.unref();a=g?yt.next(v):v}var y=yt.parent(a),m=a[a.length-1];if(o||!st.void(e,{at:y})){for(var b of t){var w=y.concat(m);m++,e.apply({type:"insert_node",path:w,node:b}),a=yt.next(a)}if(a=yt.previous(a),s){var E=st.end(e,a);E&&Jt.select(e,E)}}}}))},liftNodes(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};st.withoutNormalizing(e,(()=>{var{at:n=e.selection,mode:r="lowest",voids:o=!1}=t,{match:i}=t;if(null==i&&(i=yt.isPath(n)?Wt(e,n):t=>st.isBlock(e,t)),n){var a=st.nodes(e,{at:n,match:i,mode:r,voids:o}),u=Array.from(a,(t=>{var[,n]=t;return st.pathRef(e,n)}));for(var s of u){var l=s.unref();if(l.length<2)throw new Error("Cannot lift node at a path [".concat(l,"] because it has a depth of less than `2`."));var c=st.node(e,yt.parent(l)),[f,d]=c,p=l[l.length-1],{length:h}=f.children;if(1===h){var g=yt.next(d);Jt.moveNodes(e,{at:l,to:g,voids:o}),Jt.removeNodes(e,{at:d,voids:o})}else if(0===p)Jt.moveNodes(e,{at:l,to:d,voids:o});else if(p===h-1){var v=yt.next(d);Jt.moveNodes(e,{at:l,to:v,voids:o})}else{var y=yt.next(l),m=yt.next(d);Jt.splitNodes(e,{at:y,voids:o}),Jt.moveNodes(e,{at:l,to:m,voids:o})}}}}))},mergeNodes(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};st.withoutNormalizing(e,(()=>{var{match:n,at:r=e.selection}=t,{hanging:o=!1,voids:i=!1,mode:a="lowest"}=t;if(r){if(null==n)if(yt.isPath(r)){var[u]=st.parent(e,r);n=e=>u.children.includes(e)}else n=t=>st.isBlock(e,t);if(!o&&At.isRange(r)&&(r=st.unhangRange(e,r)),At.isRange(r))if(At.isCollapsed(r))r=r.anchor;else{var[,s]=At.edges(r),l=st.pointRef(e,s);Jt.delete(e,{at:r}),r=l.unref(),null==t.at&&Jt.select(e,r)}var[c]=st.nodes(e,{at:r,match:n,voids:i,mode:a}),f=st.previous(e,{at:r,match:n,voids:i,mode:a});if(c&&f){var[d,p]=c,[h,g]=f;if(0!==p.length&&0!==g.length){var v,y,m=yt.next(g),b=yt.common(p,g),w=yt.isSibling(p,g),E=Array.from(st.levels(e,{at:p}),(e=>{var[t]=e;return t})).slice(b.length).slice(0,-1),D=st.above(e,{at:p,mode:"highest",match:t=>E.includes(t)&&Ut(e,t)}),C=D&&st.pathRef(e,D[1]);if(Pt.isText(d)&&Pt.isText(h)){var x=Ae(d,Lt);y=h.text.length,v=x}else{if(!nt.isElement(d)||!nt.isElement(h))throw new Error("Cannot merge the node at path [".concat(p,"] with the previous sibling because it is not the same kind: ").concat(JSON.stringify(d)," ").concat(JSON.stringify(h)));x=Ae(d,Mt);y=h.children.length,v=x}w||Jt.moveNodes(e,{at:p,to:m,voids:i}),C&&Jt.removeNodes(e,{at:C.current,voids:i}),nt.isElement(h)&&st.isEmpty(e,h)||Pt.isText(h)&&""===h.text&&0!==g[g.length-1]?Jt.removeNodes(e,{at:g,voids:i}):e.apply({type:"merge_node",path:m,position:y,properties:v}),C&&C.unref()}}}}))},moveNodes(e,t){st.withoutNormalizing(e,(()=>{var{to:n,at:r=e.selection,mode:o="lowest",voids:i=!1}=t,{match:a}=t;if(r){null==a&&(a=yt.isPath(r)?Wt(e,r):t=>st.isBlock(e,t));var u=st.pathRef(e,n),s=st.nodes(e,{at:r,match:a,mode:o,voids:i}),l=Array.from(s,(t=>{var[,n]=t;return st.pathRef(e,n)}));for(var c of l){var f=c.unref(),d=u.current;0!==f.length&&e.apply({type:"move_node",path:f,newPath:d}),u.current&&yt.isSibling(d,f)&&yt.isAfter(d,f)&&(u.current=yt.next(u.current))}u.unref()}}))},removeNodes(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};st.withoutNormalizing(e,(()=>{var{hanging:n=!1,voids:r=!1,mode:o="lowest"}=t,{at:i=e.selection,match:a}=t;if(i){null==a&&(a=yt.isPath(i)?Wt(e,i):t=>st.isBlock(e,t)),!n&&At.isRange(i)&&(i=st.unhangRange(e,i));var u=st.nodes(e,{at:i,match:a,mode:o,voids:r}),s=Array.from(u,(t=>{var[,n]=t;return st.pathRef(e,n)}));for(var l of s){var c=l.unref();if(c){var[f]=st.node(e,c);e.apply({type:"remove_node",path:c,node:f})}}}}))},setNodes(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};st.withoutNormalizing(e,(()=>{var{match:r,at:o=e.selection}=n,{hanging:i=!1,mode:a="lowest",split:u=!1,voids:s=!1}=n;if(o){if(null==r&&(r=yt.isPath(o)?Wt(e,o):t=>st.isBlock(e,t)),!i&&At.isRange(o)&&(o=st.unhangRange(e,o)),u&&At.isRange(o)){if(At.isCollapsed(o)&&st.leaf(e,o.anchor)[0].text.length>0)return;var l=st.rangeRef(e,o,{affinity:"inward"}),[c,f]=At.edges(o),d="lowest"===a?"lowest":"highest",p=st.isEnd(e,f,f.path);Jt.splitNodes(e,{at:f,match:r,mode:d,voids:s,always:!p});var h=st.isStart(e,c,c.path);Jt.splitNodes(e,{at:c,match:r,mode:d,voids:s,always:!h}),o=l.unref(),null==n.at&&Jt.select(e,o)}for(var[g,v]of st.nodes(e,{at:o,match:r,mode:a,voids:s})){var y={},m={};if(0!==v.length){var b=!1;for(var w in t)"children"!==w&&"text"!==w&&t[w]!==g[w]&&(b=!0,g.hasOwnProperty(w)&&(y[w]=g[w]),null!=t[w]&&(m[w]=t[w]));b&&e.apply({type:"set_node",path:v,properties:y,newProperties:m})}}}}))},splitNodes(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};st.withoutNormalizing(e,(()=>{var{mode:n="lowest",voids:r=!1}=t,{match:o,at:i=e.selection,height:a=0,always:u=!1}=t;if(null==o&&(o=t=>st.isBlock(e,t)),At.isRange(i)&&(i=Vt(e,i)),yt.isPath(i)){var s=i,l=st.point(e,s),[c]=st.parent(e,s);o=e=>e===c,a=l.path.length-s.length+1,i=l,u=!0}if(i){var f=st.pointRef(e,i,{affinity:"backward"}),[d]=st.nodes(e,{at:i,match:o,mode:n,voids:r});if(d){var p=st.void(e,{at:i,mode:"highest"}),h=0;if(!r&&p){var[g,v]=p;if(nt.isElement(g)&&e.isInline(g)){var y=st.after(e,v);if(!y){var m={text:""},b=yt.next(v);Jt.insertNodes(e,m,{at:b,voids:r}),y=st.point(e,b)}i=y,u=!0}var w=i.path.length-v.length;a=w+1,u=!0}var E=st.pointRef(e,i),D=i.path.length-a,[,C]=d,x=i.path.slice(0,D),S=0===a?i.offset:i.path[D]+h;for(var[A,O]of st.levels(e,{at:x,reverse:!0,voids:r})){var k=!1;if(O.length2&&void 0!==arguments[2]?arguments[2]:{};Array.isArray(t)||(t=[t]);var r={};for(var o of t)r[o]=null;Jt.setNodes(e,r,n)},unwrapNodes(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};st.withoutNormalizing(e,(()=>{var{mode:n="lowest",split:r=!1,voids:o=!1}=t,{at:i=e.selection,match:a}=t;if(i){null==a&&(a=yt.isPath(i)?Wt(e,i):t=>st.isBlock(e,t)),yt.isPath(i)&&(i=st.range(e,i));var u=At.isRange(i)?st.rangeRef(e,i):null,s=st.nodes(e,{at:i,match:a,mode:n,voids:o}),l=Array.from(s,(t=>{var[,n]=t;return st.pathRef(e,n)})).reverse(),c=function(t){var n=t.unref(),[i]=st.node(e,n),a=st.range(e,n);r&&u&&(a=At.intersection(u.current,a)),Jt.liftNodes(e,{at:a,match:e=>nt.isAncestor(i)&&i.children.includes(e),voids:o})};for(var f of l)c(f);u&&u.unref()}}))},wrapNodes(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};st.withoutNormalizing(e,(()=>{var{mode:r="lowest",split:o=!1,voids:i=!1}=n,{match:a,at:u=e.selection}=n;if(u){if(null==a&&(a=yt.isPath(u)?Wt(e,u):e.isInline(t)?t=>st.isInline(e,t)||Pt.isText(t):t=>st.isBlock(e,t)),o&&At.isRange(u)){var[s,l]=At.edges(u),c=st.rangeRef(e,u,{affinity:"inward"});Jt.splitNodes(e,{at:l,match:a,voids:i}),Jt.splitNodes(e,{at:s,match:a,voids:i}),u=c.unref(),null==n.at&&Jt.select(e,u)}var f=Array.from(st.nodes(e,{at:u,match:e.isInline(t)?t=>st.isBlock(e,t):e=>st.isEditor(e),mode:"lowest",voids:i}));for(var[,d]of f){var p=At.isRange(u)?At.intersection(u,st.range(e,d)):u;if(p){var h=Array.from(st.nodes(e,{at:p,match:a,mode:r,voids:i}));if(h.length>0){var g=function(){var[n]=h,r=h[h.length-1],[,o]=n,[,a]=r;if(0===o.length&&0===a.length)return"continue";var u=yt.equals(o,a)?yt.parent(o):yt.common(o,a),s=st.range(e,o,a),l=st.node(e,u),[c]=l,f=u.length+1,d=yt.next(a.slice(0,f)),p=$t($t({},t),{},{children:[]});Jt.insertNodes(e,p,{at:d,voids:i}),Jt.moveNodes(e,{at:s,match:e=>nt.isAncestor(c)&&c.children.includes(e),to:d.concat(0),voids:i})}();if("continue"===g)continue}}}}}))}},Ut=(e,t)=>{if(nt.isElement(t)){var n=t;return!!st.isVoid(e,t)||1===n.children.length&&Ut(e,n.children[0])}return!st.isEditor(t)},Vt=(e,t)=>{if(At.isCollapsed(t))return t.anchor;var[,n]=At.edges(t),r=st.pointRef(e,n);return Jt.delete(e,{at:t}),r.unref()},Wt=(e,t)=>{var[n]=st.node(e,t);return e=>e===n};function qt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Gt(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},{edge:n="anchor"}=t,{selection:r}=e;if(r)if("anchor"===n)Jt.select(e,r.anchor);else if("focus"===n)Jt.select(e,r.focus);else if("start"===n){var[o]=At.edges(r);Jt.select(e,o)}else if("end"===n){var[,i]=At.edges(r);Jt.select(e,i)}},deselect(e){var{selection:t}=e;t&&e.apply({type:"set_selection",properties:t,newProperties:null})},move(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{selection:n}=e,{distance:r=1,unit:o="character",reverse:i=!1}=t,{edge:a=null}=t;if(n){"start"===a&&(a=At.isBackward(n)?"focus":"anchor"),"end"===a&&(a=At.isBackward(n)?"anchor":"focus");var{anchor:u,focus:s}=n,l={distance:r,unit:o},c={};if(null==a||"anchor"===a){var f=i?st.before(e,u,l):st.after(e,u,l);f&&(c.anchor=f)}if(null==a||"focus"===a){var d=i?st.before(e,s,l):st.after(e,s,l);d&&(c.focus=d)}Jt.setSelection(e,c)}},select(e,t){var{selection:n}=e;if(t=st.range(e,t),n)Jt.setSelection(e,t);else{if(!At.isRange(t))throw new Error("When setting the selection and the current selection is `null` you must provide at least an `anchor` and `focus`, but you passed: ".concat(JSON.stringify(t)));e.apply({type:"set_selection",properties:n,newProperties:t})}},setPoint(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{selection:r}=e,{edge:o="both"}=n;if(r){"start"===o&&(o=At.isBackward(r)?"focus":"anchor"),"end"===o&&(o=At.isBackward(r)?"anchor":"focus");var{anchor:i,focus:a}=r,u="anchor"===o?i:a;Jt.setSelection(e,{["anchor"===o?"anchor":"focus"]:Gt(Gt({},u),t)})}},setSelection(e,t){var{selection:n}=e,r={},o={};if(n){for(var i in t)("anchor"===i&&null!=t.anchor&&!Et.equals(t.anchor,n.anchor)||"focus"===i&&null!=t.focus&&!Et.equals(t.focus,n.focus)||"anchor"!==i&&"focus"!==i&&t[i]!==n[i])&&(r[i]=n[i],o[i]=t[i]);Object.keys(r).length>0&&e.apply({type:"set_selection",properties:r,newProperties:o})}}},Yt={delete(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};st.withoutNormalizing(e,(()=>{var{reverse:n=!1,unit:r="character",distance:o=1,voids:i=!1}=t,{at:a=e.selection,hanging:u=!1}=t;if(a){if(At.isRange(a)&&At.isCollapsed(a)&&(a=a.anchor),Et.isPoint(a)){var s=st.void(e,{at:a,mode:"highest"});if(!i&&s){var[,l]=s;a=l}else{var c={unit:r,distance:o},f=n?st.before(e,a,c)||st.start(e,[]):st.after(e,a,c)||st.end(e,[]);a={anchor:a,focus:f},u=!0}}if(yt.isPath(a))Jt.removeNodes(e,{at:a,voids:i});else if(!At.isCollapsed(a)){if(!u){var[,d]=At.edges(a),p=st.end(e,[]);Et.equals(d,p)||(a=st.unhangRange(e,a,{voids:i}))}var[h,g]=At.edges(a),v=st.above(e,{match:t=>st.isBlock(e,t),at:h,voids:i}),y=st.above(e,{match:t=>st.isBlock(e,t),at:g,voids:i}),m=v&&y&&!yt.equals(v[1],y[1]),b=yt.equals(h.path,g.path),w=i?null:st.void(e,{at:h,mode:"highest"}),E=i?null:st.void(e,{at:g,mode:"highest"});if(w){var D=st.before(e,h);D&&v&&yt.isAncestor(v[1],D.path)&&(h=D)}if(E){var C=st.after(e,g);C&&y&&yt.isAncestor(y[1],C.path)&&(g=C)}var x,S=[];for(var A of st.nodes(e,{at:a,voids:i})){var[O,k]=A;x&&0===yt.compare(k,x)||(!i&&st.isVoid(e,O)||!yt.isCommon(k,h.path)&&!yt.isCommon(k,g.path))&&(S.push(A),x=k)}var B=Array.from(S,(t=>{var[,n]=t;return st.pathRef(e,n)})),F=st.pointRef(e,h),_=st.pointRef(e,g);if(!b&&!w){var T=F.current,[P]=st.leaf(e,T),{path:j}=T,{offset:N}=h,I=P.text.slice(N);I.length>0&&e.apply({type:"remove_text",path:j,offset:N,text:I})}for(var R of B){var L=R.unref();Jt.removeNodes(e,{at:L,voids:i})}if(!E){var M=_.current,[z]=st.leaf(e,M),{path:$}=M,H=b?h.offset:0,U=z.text.slice(H,g.offset);U.length>0&&e.apply({type:"remove_text",path:$,offset:H,text:U})}!b&&m&&_.current&&F.current&&Jt.mergeNodes(e,{at:_.current,hanging:!0,voids:i});var V=n?F.unref()||_.unref():_.unref()||F.unref();null==t.at&&V&&Jt.select(e,V)}}}))},insertFragment(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};st.withoutNormalizing(e,(()=>{var{hanging:r=!1,voids:o=!1}=n,{at:i=e.selection}=n;if(t.length&&i){if(At.isRange(i))if(r||(i=st.unhangRange(e,i)),At.isCollapsed(i))i=i.anchor;else{var[,a]=At.edges(i);if(!o&&st.void(e,{at:a}))return;var u=st.pointRef(e,a);Jt.delete(e,{at:i}),i=u.unref()}else yt.isPath(i)&&(i=st.start(e,i));if(o||!st.void(e,{at:i})){var s=st.above(e,{at:i,match:t=>st.isInline(e,t),mode:"highest",voids:o});if(s){var[,l]=s;if(st.isEnd(e,i,l)){var c=st.after(e,l);i=c}else if(st.isStart(e,i,l)){var f=st.before(e,l);i=f}}var d=st.above(e,{match:t=>st.isBlock(e,t),at:i,voids:o}),[,p]=d,h=st.isStart(e,i,p),g=st.isEnd(e,i,p),v=h&&g,y=!h||h&&g,m=!g,[,b]=pt.first({children:t},[]),[,w]=pt.last({children:t},[]),E=[],D=t=>{var[n,r]=t,o=0===r.length;return!o&&(!!v||!(y&&yt.isAncestor(r,b)&&nt.isElement(n)&&!e.isVoid(n)&&!e.isInline(n))&&!(m&&yt.isAncestor(r,w)&&nt.isElement(n)&&!e.isVoid(n)&&!e.isInline(n)))};for(var C of pt.nodes({children:t},{pass:D}))D(C)&&E.push(C);var x=[],S=[],A=[],O=!0,k=!1;for(var[B]of E)nt.isElement(B)&&!e.isInline(B)?(O=!1,k=!0,S.push(B)):O?x.push(B):A.push(B);var[F]=st.nodes(e,{at:i,match:t=>Pt.isText(t)||st.isInline(e,t),mode:"highest",voids:o}),[,_]=F,T=st.isStart(e,i,_),P=st.isEnd(e,i,_),j=st.pathRef(e,g?yt.next(p):p),N=st.pathRef(e,P?yt.next(_):_),I=st.pathRef(e,p);Jt.splitNodes(e,{at:i,match:t=>k?st.isBlock(e,t):Pt.isText(t)||st.isInline(e,t),mode:k?"lowest":"highest",voids:o});var R=st.pathRef(e,!T||T&&P?yt.next(_):_);if(Jt.insertNodes(e,x,{at:R.current,match:t=>Pt.isText(t)||st.isInline(e,t),mode:"highest",voids:o}),v&&S.length&&Jt.delete(e,{at:I.unref(),voids:o}),Jt.insertNodes(e,S,{at:j.current,match:t=>st.isBlock(e,t),mode:"lowest",voids:o}),Jt.insertNodes(e,A,{at:N.current,match:t=>Pt.isText(t)||st.isInline(e,t),mode:"highest",voids:o}),!n.at){var L;L=A.length>0?yt.previous(N.current):S.length>0?yt.previous(j.current):yt.previous(R.current);var M=st.end(e,L);Jt.select(e,M)}R.unref(),j.unref(),N.unref()}}}))},insertText(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};st.withoutNormalizing(e,(()=>{var{voids:r=!1}=n,{at:o=e.selection}=n;if(o){if(yt.isPath(o)&&(o=st.range(e,o)),At.isRange(o))if(At.isCollapsed(o))o=o.anchor;else{var i=At.end(o);if(!r&&st.void(e,{at:i}))return;var a=st.pointRef(e,i);Jt.delete(e,{at:o,voids:r}),o=a.unref(),Jt.setSelection(e,{anchor:o,focus:o})}if(r||!st.void(e,{at:o})){var{path:u,offset:s}=o;t.length>0&&e.apply({type:"insert_text",path:u,offset:s,text:t})}}}))}};function Xt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Zt(e){for(var t=1;t-1&&e%1==0&&e-1&&e%1==0&&e<=tn}function Ir(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Rr(e){return!!e&&"object"==typeof e}function Lr(e){return"string"==typeof e||!_r(e)&&Rr(e)&&rr.call(e)==cn}function Mr(e){if(!e)return[];if(Tr(e))return Lr(e)?Yn(e):Cr(e);if(ar&&e[ar])return Wn(e[ar]());var t=Sr(e),n=t==an?qn:t==ln?Kn:$r;return n(e)}function zr(e){return Tr(e)?br(e):Dr(e)}function $r(e){return e?$n(e,zr(e)):[]}var Hr=Mr;function Ur(e){return null!==e&&"object"===typeof e&&"constructor"in e&&e.constructor===Object}function Vr(e,t){void 0===e&&(e={}),void 0===t&&(t={}),Object.keys(t).forEach((function(n){"undefined"===typeof e[n]?e[n]=t[n]:Ur(t[n])&&Ur(e[n])&&Object.keys(t[n]).length>0&&Vr(e[n],t[n])}))}var Wr={body:{},addEventListener:function(){},removeEventListener:function(){},activeElement:{blur:function(){},nodeName:""},querySelector:function(){return null},querySelectorAll:function(){return[]},getElementById:function(){return null},createEvent:function(){return{initEvent:function(){}}},createElement:function(){return{children:[],childNodes:[],style:{},setAttribute:function(){},getElementsByTagName:function(){return[]}}},createElementNS:function(){return{}},importNode:function(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function qr(){var e="undefined"!==typeof document?document:{};return Vr(e,Wr),e}var Gr={document:Wr,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState:function(){},pushState:function(){},go:function(){},back:function(){}},CustomEvent:function(){return this},addEventListener:function(){},removeEventListener:function(){},getComputedStyle:function(){return{getPropertyValue:function(){return""}}},Image:function(){},Date:function(){},screen:{},setTimeout:function(){},clearTimeout:function(){},matchMedia:function(){return{}},requestAnimationFrame:function(e){return"undefined"===typeof setTimeout?(e(),null):setTimeout(e,0)},cancelAnimationFrame:function(e){"undefined"!==typeof setTimeout&&clearTimeout(e)}};function Kr(){var e="undefined"!==typeof window?window:{};return Vr(e,Gr),e}function Yr(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function Xr(e){return Xr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Xr(e)}function Zr(e,t){return Zr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Zr(e,t)}function Jr(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function Qr(e,t,n){return Qr=Jr()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=Function.bind.apply(e,r),i=new o;return n&&Zr(i,n.prototype),i},Qr.apply(null,arguments)}function eo(e){return-1!==Function.toString.call(e).indexOf("[native code]")}function to(e){var t="function"===typeof Map?new Map:void 0;return to=function(e){if(null===e||!eo(e))return e;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return Qr(e,arguments,Xr(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Zr(n,e)},to(e)}function no(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ro(e){var t=e.__proto__;Object.defineProperty(e,"__proto__",{get:function(){return t},set:function(e){t.__proto__=e}})}var oo=function(e){function t(t){var n;return n=e.call.apply(e,[this].concat(t))||this,ro(no(n)),n}return Yr(t,e),t}(to(Array));function io(e){void 0===e&&(e=[]);var t=[];return e.forEach((function(e){Array.isArray(e)?t.push.apply(t,io(e)):t.push(e)})),t}function ao(e,t){return Array.prototype.filter.call(e,t)}function uo(e){for(var t=[],n=0;n=0&&i.indexOf(">")>=0){var a="div";0===i.indexOf("0})).length>0}function go(e,t){if(1===arguments.length&&"string"===typeof e)return this[0]?this[0].getAttribute(e):void 0;for(var n=0;n=0&&(t[so(o.name.split("data-")[1])]=o.value)}for(var i in t)"false"===t[i]?t[i]=!1:"true"===t[i]?t[i]=!0:parseFloat(t[i])===1*t[i]&&(t[i]*=1);return t}}function mo(e){if("undefined"===typeof e){var t=this[0];if(!t)return;if(t.multiple&&"select"===t.nodeName.toLowerCase()){for(var n=[],r=0;r=0;else i.value=e}return this}function bo(){for(var e=arguments.length,t=new Array(e),n=0;n=0;p-=1){var h=d[p];i&&h.listener===i||i&&h.listener&&h.listener.dom7proxy&&h.listener.dom7proxy===i?(f.removeEventListener(l,h.proxyListener,a),d.splice(p,1)):i||(f.removeEventListener(l,h.proxyListener,a),d.splice(p,1))}}return this}function Eo(){var e=Kr();return this[0]===e?e.innerWidth:this.length>0?parseFloat(this.css("width")):null}function Do(){var e=Kr();return this[0]===e?e.innerHeight:this.length>0?parseFloat(this.css("height")):null}function Co(){if(this.length>0){var e=Kr(),t=qr(),n=this[0],r=n.getBoundingClientRect(),o=t.body,i=n.clientTop||o.clientTop||0,a=n.clientLeft||o.clientLeft||0,u=n===e?e.scrollY:n.scrollTop,s=n===e?e.scrollX:n.scrollLeft;return{top:r.top+u-i,left:r.left+s-a}}return null}function xo(){for(var e=0;e=0;n-=1)this[t].insertBefore(o.childNodes[n],this[t].childNodes[0])}else if(e instanceof oo)for(n=0;n-1&&e%1==0&&e-1&&e%1==0&&e<=Vo}function bi(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function wi(e){return!!e&&"object"==typeof e}function Ei(e){return gi(e)?ri(e):ui(e)}function Di(e){return e}var Ci=di;if("undefined"!==typeof navigator&&"ReactNative"===navigator.product&&"undefined"===typeof crypto)throw new Error("React Native does not have a built-in secure random generator. If you don’t need unpredictable IDs use `nanoid/non-secure`. For secure IDs, import `react-native-get-random-values` before Nano ID.");if("undefined"!==typeof msCrypto&&"undefined"===typeof crypto)throw new Error("Import file with `if (!window.crypto) window.crypto = window.msCrypto` before importing Nano ID to fix IE 11 support");if("undefined"===typeof crypto)throw new Error("Your browser does not have secure random generator. If you don’t need unpredictable IDs, you can use nanoid/non-secure.");let xi=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));while(e--){let r=63&n[e];t+=r<36?r.toString(36):r<62?(r-26).toString(36).toUpperCase():r<63?"_":"-"}return t};var Si="Expected a function",Ai=NaN,Oi="[object Symbol]",ki=/^\s+|\s+$/g,Bi=/^[-+]0x[0-9a-f]+$/i,Fi=/^0b[01]+$/i,_i=/^0o[0-7]+$/i,Ti=parseInt,Pi="object"==typeof Qt&&Qt&&Qt.Object===Object&&Qt,ji="object"==typeof self&&self&&self.Object===Object&&self,Ni=Pi||ji||Function("return this")(),Ii=Object.prototype,Ri=Ii.toString,Li=Math.max,Mi=Math.min,zi=function(){return Ni.Date.now()};function $i(e,t,n){var r,o,i,a,u,s,l=0,c=!1,f=!1,d=!0;if("function"!=typeof e)throw new TypeError(Si);function p(t){var n=r,i=o;return r=o=void 0,l=t,a=e.apply(i,n),a}function h(e){return l=e,u=setTimeout(y,t),c?p(e):a}function g(e){var n=e-s,r=e-l,o=t-n;return f?Mi(o,i-r):o}function v(e){var n=e-s,r=e-l;return void 0===s||n>=t||n<0||f&&r>=i}function y(){var e=zi();if(v(e))return m(e);u=setTimeout(y,g(e))}function m(e){return u=void 0,d&&r?p(e):(r=o=void 0,a)}function b(){void 0!==u&&clearTimeout(u),l=0,r=s=o=u=void 0}function w(){return void 0===u?a:m(zi())}function E(){var e=zi(),n=v(e);if(r=arguments,o=this,s=e,n){if(void 0===u)return h(s);if(f)return u=setTimeout(y,t),p(s)}return void 0===u&&(u=setTimeout(y,t)),a}return t=qi(t)||0,Ui(n)&&(c=!!n.leading,f="maxWait"in n,i=f?Li(qi(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d),E.cancel=b,E.flush=w,E}function Hi(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new TypeError(Si);return Ui(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),$i(e,t,{leading:r,maxWait:t,trailing:o})}function Ui(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Vi(e){return!!e&&"object"==typeof e}function Wi(e){return"symbol"==typeof e||Vi(e)&&Ri.call(e)==Oi}function qi(e){if("number"==typeof e)return e;if(Wi(e))return Ai;if(Ui(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ui(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(ki,"");var n=Fi.test(e);return n||_i.test(e)?Ti(e.slice(2),n?2:8):Bi.test(e)?Ai:+e}var Gi=Hi;function Ki(e,t){return document.createElement(e,t)}function Yi(e,t,n){return document.createElementNS(e,t,n)}function Xi(e){return document.createTextNode(e)}function Zi(e){return document.createComment(e)}function Ji(e,t,n){e.insertBefore(t,n)}function Qi(e,t){e.removeChild(t)}function ea(e,t){e.appendChild(t)}function ta(e){return e.parentNode}function na(e){return e.nextSibling}function ra(e){return e.tagName}function oa(e,t){e.textContent=t}function ia(e){return e.textContent}function aa(e){return 1===e.nodeType}function ua(e){return 3===e.nodeType}function sa(e){return 8===e.nodeType}const la={createElement:Ki,createElementNS:Yi,createTextNode:Xi,createComment:Zi,insertBefore:Ji,removeChild:Qi,appendChild:ea,parentNode:ta,nextSibling:na,tagName:ra,setTextContent:oa,getTextContent:ia,isElement:aa,isText:ua,isComment:sa};function ca(e,t,n,r,o){const i=void 0===t?void 0:t.key;return{sel:e,data:t,children:n,text:r,elm:o,key:i}}const fa=Array.isArray;function da(e){return"string"===typeof e||"number"===typeof e||e instanceof String||e instanceof Number}function pa(e){return void 0===e}function ha(e){return void 0!==e}const ga=ca("",{},[],void 0,void 0);function va(e,t){var n,r;const o=e.key===t.key,i=(null===(n=e.data)||void 0===n?void 0:n.is)===(null===(r=t.data)||void 0===r?void 0:r.is),a=e.sel===t.sel;return a&&o&&i}function ya(e){return void 0!==e.sel}function ma(e,t,n){var r;const o={};for(let i=t;i<=n;++i){const t=null===(r=e[i])||void 0===r?void 0:r.key;void 0!==t&&(o[t]=i)}return o}const ba=["create","update","remove","destroy","pre","post"];function wa(e,t){const n={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},r=void 0!==t?t:la;for(const d of ba)for(const t of e){const e=t[d];void 0!==e&&n[d].push(e)}function o(e){const t=e.id?"#"+e.id:"",n=e.getAttribute("class"),o=n?"."+n.split(" ").join("."):"";return ca(r.tagName(e).toLowerCase()+t+o,{},[],void 0,e)}function i(e,t){return function(){if(0===--t){const t=r.parentNode(e);r.removeChild(t,e)}}}function a(e,t){var o,i;let u,s=e.data;if(void 0!==s){const t=null===(o=s.hook)||void 0===o?void 0:o.init;ha(t)&&(t(e),s=e.data)}const l=e.children,c=e.sel;if("!"===c)pa(e.text)&&(e.text=""),e.elm=r.createComment(e.text);else if(void 0!==c){const o=c.indexOf("#"),f=c.indexOf(".",o),d=o>0?o:c.length,p=f>0?f:c.length,h=-1!==o||-1!==f?c.slice(0,Math.min(d,p)):c,g=e.elm=ha(s)&&ha(u=s.ns)?r.createElementNS(u,h,s):r.createElement(h,s);for(d0&&g.setAttribute("class",c.slice(p+1).replace(/\./g," ")),u=0;ug?(d=null==n[m+1]?null:n[m+1].elm,u(e,d,n,h,m,o)):l(e,t,p,g))}function f(e,t,o){var i,a,s,f,d;const p=null===(i=t.data)||void 0===i?void 0:i.hook;null===(a=null===p||void 0===p?void 0:p.prepatch)||void 0===a||a.call(p,e,t);const h=t.elm=e.elm,g=e.children,v=t.children;if(e!==t){if(void 0!==t.data){for(let r=0;ro?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;var i=Array(o);while(++r=r?e:os(e,t,n)}function us(e){return function(t){t=fs(t);var n=Ku(t)?Xu(t):void 0,r=n?n[0]:t.charAt(0),o=n?as(n,1).join(""):t.slice(1);return r[e]()+o}}function ss(e){return function(t){return Uu(vs(hs(t).replace(Pu,"")),e,"")}}function ls(e){return!!e&&"object"==typeof e}function cs(e){return"symbol"==typeof e||ls(e)&&es.call(e)==Ga}function fs(e){return null==e?"":is(e)}var ds=ss((function(e,t,n){return t=t.toLowerCase(),e+(n?ps(t):t)}));function ps(e){return gs(fs(e).toLowerCase())}function hs(e){return e=fs(e),e&&e.replace(Ya,Gu).replace(ju,"")}var gs=us("toUpperCase");function vs(e,t,n){return e=fs(e),t=n?void 0:t,void 0===t?Yu(e)?Ju(e):Wu(e):e.match(t)||[]}for(var ys=ds,ms="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),bs={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},ws={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:ms?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},Es={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},Ds=1;Ds<20;Ds++)Es["f"+Ds]=111+Ds;function Cs(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map((function(e){return Ss(e,t)})),o=function(e){return r.some((function(t){return As(t,e)}))},i=null==n?o:o(n);return i}function xs(e,t){return Cs(e,{byKey:!0},t)}function Ss(e,t){var n=t&&t.byKey,r={};e=e.replace("++","+add");var o=e.split("+"),i=o.length;for(var a in bs)r[bs[a]]=!1;var u=!0,s=!1,l=void 0;try{for(var c,f=o[Symbol.iterator]();!(u=(c=f.next()).done);u=!0){var d=c.value,p=d.endsWith("?")&&d.length>1;p&&(d=d.slice(0,-1));var h=ks(d),g=bs[h];if(d.length>1&&!g&&!ws[d]&&!Es[h])throw new TypeError('Unknown modifier: "'+d+'"');1!==i&&g||(n?r.key=h:r.which=Os(d)),g&&(r[g]=!p||null)}}catch(v){s=!0,l=v}finally{try{!u&&f.return&&f.return()}finally{if(s)throw l}}return r}function As(e,t){for(var n in e){var r=e[n],o=void 0;if(null!=r&&(o="key"===n&&null!=t.key?t.key.toLowerCase():"which"===n?91===r&&93===t.which?91:t.which:t[n],(null!=o||!1!==r)&&o!==r))return!1}return!0}function Os(e){e=ks(e);var t=Es[e]||e.toUpperCase().charCodeAt(0);return t}function ks(e){return e=e.toLowerCase(),e=ws[e]||e,e}var Bs=Cs,Fs=xs,_s="Expected a function",Ts=NaN,Ps="[object Symbol]",js=/^\s+|\s+$/g,Ns=/^[-+]0x[0-9a-f]+$/i,Is=/^0b[01]+$/i,Rs=/^0o[0-7]+$/i,Ls=parseInt,Ms="object"==typeof Qt&&Qt&&Qt.Object===Object&&Qt,zs="object"==typeof self&&self&&self.Object===Object&&self,$s=Ms||zs||Function("return this")(),Hs=Object.prototype,Us=Hs.toString,Vs=Math.max,Ws=Math.min,qs=function(){return $s.Date.now()};function Gs(e,t,n){var r,o,i,a,u,s,l=0,c=!1,f=!1,d=!0;if("function"!=typeof e)throw new TypeError(_s);function p(t){var n=r,i=o;return r=o=void 0,l=t,a=e.apply(i,n),a}function h(e){return l=e,u=setTimeout(y,t),c?p(e):a}function g(e){var n=e-s,r=e-l,o=t-n;return f?Ws(o,i-r):o}function v(e){var n=e-s,r=e-l;return void 0===s||n>=t||n<0||f&&r>=i}function y(){var e=qs();if(v(e))return m(e);u=setTimeout(y,g(e))}function m(e){return u=void 0,d&&r?p(e):(r=o=void 0,a)}function b(){void 0!==u&&clearTimeout(u),l=0,r=s=o=u=void 0}function w(){return void 0===u?a:m(qs())}function E(){var e=qs(),n=v(e);if(r=arguments,o=this,s=e,n){if(void 0===u)return h(s);if(f)return u=setTimeout(y,t),p(s)}return void 0===u&&(u=setTimeout(y,t)),a}return t=Zs(t)||0,Ks(n)&&(c=!!n.leading,f="maxWait"in n,i=f?Vs(Zs(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d),E.cancel=b,E.flush=w,E}function Ks(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ys(e){return!!e&&"object"==typeof e}function Xs(e){return"symbol"==typeof e||Ys(e)&&Us.call(e)==Ps}function Zs(e){if("number"==typeof e)return e;if(Xs(e))return Ts;if(Ks(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ks(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(js,"");var n=Is.test(e);return n||Rs.test(e)?Ls(e.slice(2),n?2:8):Ns.test(e)?Ts:+e}var Js,Qs=Gs,el=en((function(e,t){var n=200,r="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",a="[object Array]",u="[object Boolean]",s="[object Date]",l="[object Error]",c="[object Function]",f="[object GeneratorFunction]",d="[object Map]",p="[object Number]",h="[object Object]",g="[object Promise]",v="[object RegExp]",y="[object Set]",m="[object String]",b="[object Symbol]",w="[object WeakMap]",E="[object ArrayBuffer]",D="[object DataView]",C="[object Float32Array]",x="[object Float64Array]",S="[object Int8Array]",A="[object Int16Array]",O="[object Int32Array]",k="[object Uint8Array]",B="[object Uint8ClampedArray]",F="[object Uint16Array]",_="[object Uint32Array]",T=/[\\^$.*+?()[\]{}|]/g,P=/\w*$/,j=/^\[object .+?Constructor\]$/,N=/^(?:0|[1-9]\d*)$/,I={};I[i]=I[a]=I[E]=I[D]=I[u]=I[s]=I[C]=I[x]=I[S]=I[A]=I[O]=I[d]=I[p]=I[h]=I[v]=I[y]=I[m]=I[b]=I[k]=I[B]=I[F]=I[_]=!0,I[l]=I[c]=I[w]=!1;var R="object"==typeof Qt&&Qt&&Qt.Object===Object&&Qt,L="object"==typeof self&&self&&self.Object===Object&&self,M=R||L||Function("return this")(),z=t&&!t.nodeType&&t,$=z&&e&&!e.nodeType&&e,H=$&&$.exports===z;function U(e,t){return e.set(t[0],t[1]),e}function V(e,t){return e.add(t),e}function W(e,t){var n=-1,r=e?e.length:0;while(++n-1}function Ue(e,t){var n=this.__data__,r=ot(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}function Ve(e){var t=-1,n=e?e.length:0;this.clear();while(++t-1&&e%1==0&&e-1&&e%1==0&&e<=o}function Wt(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function qt(e){return!!e&&"object"==typeof e}function Gt(e){return zt(e)?nt(e):ft(e)}function Kt(){return[]}function Yt(){return!1}e.exports=It})),tl=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function nl(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var rl=0;function ol(e){return"__private_"+rl+++"_"+e}function il(e,t,n){const r=[];return e.forEach((e=>"string"!==typeof e?r.push(e):t[Symbol.split](e).forEach(((e,t,o)=>{""!==e&&r.push(e),tcrypto.getRandomValues(new Uint8Array(e)),hl=(e,t,n)=>{let r=(2<{let i="";while(1){let a=n(o),u=o;while(u--)if(i+=e[a[u]&r]||"",i.length===t)return i}}},gl=(e,t)=>hl(e,t,pl),vl=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));while(e--){let r=63&n[e];t+=r<36?r.toString(36):r<62?(r-26).toString(36).toUpperCase():r<63?"_":"-"}return t};var yl={nanoid:vl,customAlphabet:gl,customRandom:hl,urlAlphabet:dl,random:pl},ml=function(e){if("number"!==typeof e||isNaN(e))throw new TypeError("Expected a number, got "+typeof e);var t=e<0,n=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t&&(e=-e),e<1)return(t?"-":"")+e+" B";var r=Math.min(Math.floor(Math.log(e)/Math.log(1024)),n.length-1);e=Number(e/Math.pow(1024,r));var o=n[r];return e>=10||e%1===0?(t?"-":"")+e.toFixed(0)+" "+o:(t?"-":"")+e.toFixed(1)+" "+o};function bl(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}bl.prototype.match=function(e){var t,n,r=!0,o=this.parts,i=o.length;if("string"==typeof e||e instanceof String)if(this.hasWild||this.text==e){for(n=(e||"").split(this.separator),t=0;r&&t=2}return t?n(t.split(";")[0]):n};function Cl(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var xl=0;function Sl(e){return"__private_"+xl+++"_"+e}var Al=Sl("publish");class Ol{constructor(){Object.defineProperty(this,Al,{value:kl}),this.state={},this.callbacks=[]}getState(){return this.state}setState(e){const t={...this.state},n={...this.state,...e};this.state=n,Cl(this,Al)[Al](t,n,e)}subscribe(e){return this.callbacks.push(e),()=>{this.callbacks.splice(this.callbacks.indexOf(e),1)}}}function kl(){for(var e=arguments.length,t=new Array(e),n=0;n{e(...t)}))}Ol.VERSION="2.0.3";var Bl=function(){return new Ol},Fl=function(e){const t=e.lastIndexOf(".");return-1===t||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}},_l={md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"},Tl=function(e){var t;if(e.type)return e.type;const n=e.name?null==(t=Fl(e.name).extension)?void 0:t.toLowerCase():null;return n&&n in _l?_l[n]:"application/octet-stream"};function Pl(e){return e.charCodeAt(0).toString(32)}function jl(e){let t="";return e.replace(/[^A-Z0-9]/gi,(e=>(t+=`-${Pl(e)}`,"/")))+t}var Nl=function(e){let t="uppy";return"string"===typeof e.name&&(t+=`-${jl(e.name.toLowerCase())}`),void 0!==e.type&&(t+=`-${e.type}`),e.meta&&"string"===typeof e.meta.relativePath&&(t+=`-${jl(e.meta.relativePath.toLowerCase())}`),void 0!==e.data.size&&(t+=`-${e.data.size}`),void 0!==e.data.lastModified&&(t+=`-${e.data.lastModified}`),t},Il=function(e){if(null==e&&(e="undefined"!==typeof navigator?navigator.userAgent:null),!e)return!0;const t=/Edge\/(\d+\.\d+)/.exec(e);if(!t)return!0;const n=t[1];let[r,o]=n.split(".");return r=parseInt(r,10),o=parseInt(o,10),r<15||15===r&&o<15063||(r>18||18===r&&o>=18218)},Rl=function(e,t){return t.name?t.name:"image"===e.split("/")[0]?`${e.split("/")[0]}.${e.split("/")[1]}`:"noname"};function Ll(e){return e<10?`0${e}`:e.toString()}var Ml=function(){const e=new Date,t=Ll(e.getHours()),n=Ll(e.getMinutes()),r=Ll(e.getSeconds());return`${t}:${n}:${r}`};const zl={debug:()=>{},warn:()=>{},error:function(){for(var e=arguments.length,t=new Array(e),n=0;ne,onBeforeUpload:e=>e,store:Bl(),logger:Zl,infoTimeout:5e3};if(this.opts={...t,...e,restrictions:{...t.restrictions,...e&&e.restrictions}},e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=Jl),this.log(`Using Core v${this.constructor.VERSION}`),this.opts.restrictions.allowedFileTypes&&null!==this.opts.restrictions.allowedFileTypes&&!Array.isArray(this.opts.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");this.i18nInit(),this.calculateProgress=Gi(this.calculateProgress.bind(this),500,{leading:!0,trailing:!0}),this.store=this.opts.store,this.setState({plugins:{},files:{},currentUploads:{},allowNewUpload:!0,capabilities:{uploadProgress:Il(),individualCancellation:!0,resumableUploads:!1},totalProgress:0,meta:{...this.opts.meta},info:[],recoveredState:null}),Gl(this,nc)[nc]=this.store.subscribe(((e,t,n)=>{this.emit("state-update",e,t,n),this.updateAll(t)})),this.opts.debug&&"undefined"!==typeof window&&(window[this.opts.id]=this),Gl(this,gc)[gc]()}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{t.update(e)}))}setState(e){this.store.setState(e)}getState(){return this.store.getState()}get state(){return this.getState()}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can’t set state for ${e} (the file could have been removed)`);this.setState({files:{...this.getState().files,[e]:{...this.getState().files[e],...t}}})}i18nInit(){const e=new ul([this.defaultLocale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.locale=e.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e&&e.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins((e=>{e.setOptions()})),this.setState()}resetProgress(){const e={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},n={};Object.keys(t).forEach((r=>{const o={...t[r]};o.progress={...o.progress,...e},n[r]=o})),this.setState({files:n,totalProgress:0}),this.emit("reset-progress")}addPreProcessor(e){Gl(this,oc)[oc].add(e)}removePreProcessor(e){return Gl(this,oc)[oc].delete(e)}addPostProcessor(e){Gl(this,ac)[ac].add(e)}removePostProcessor(e){return Gl(this,ac)[ac].delete(e)}addUploader(e){Gl(this,ic)[ic].add(e)}removeUploader(e){return Gl(this,ic)[ic].delete(e)}setMeta(e){const t={...this.getState().meta,...e},n={...this.getState().files};Object.keys(n).forEach((t=>{n[t]={...n[t],meta:{...n[t].meta,...e}}})),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:n})}setFileMeta(e,t){const n={...this.getState().files};if(!n[e])return void this.log("Was trying to set metadata for a file that has been removed: ",e);const r={...n[e].meta,...t};n[e]={...n[e],meta:r},this.setState({files:n})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getObjectOfFilesPerState(){const{files:e,totalProgress:t,error:n}=this.getState(),r=Object.values(e),o=r.filter((e=>{let{progress:t}=e;return!t.uploadComplete&&t.uploadStarted})),i=r.filter((e=>!e.progress.uploadStarted)),a=r.filter((e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess)),u=r.filter((e=>e.progress.uploadStarted)),s=r.filter((e=>e.isPaused)),l=r.filter((e=>e.progress.uploadComplete)),c=r.filter((e=>e.error)),f=o.filter((e=>!e.isPaused)),d=r.filter((e=>e.progress.preprocess||e.progress.postprocess));return{newFiles:i,startedFiles:a,uploadStartedFiles:u,pausedFiles:s,completeFiles:l,erroredFiles:c,inProgressFiles:o,inProgressNotPausedFiles:f,processingFiles:d,isUploadStarted:u.length>0,isAllComplete:100===t&&l.length===r.length&&0===d.length,isAllErrored:!!n&&c.length===r.length,isAllPaused:0!==o.length&&s.length===o.length,isUploadInProgress:o.length>0,isSomeGhost:r.some((e=>e.isGhost))}}validateRestrictions(e,t){try{return Gl(this,uc)[uc](e,t),{result:!0}}catch(n){return{result:!1,reason:n.message}}}checkIfFileAlreadyExists(e){const{files:t}=this.getState();return!(!t[e]||t[e].isGhost)}addFile(e){Gl(this,dc)[dc](e);const{files:t}=this.getState();let n=Gl(this,pc)[pc](t,e);return t[n.id]&&t[n.id].isGhost&&(n={...t[n.id],data:e.data,isGhost:!1},this.log(`Replaced the blob in the restored ghost file: ${n.name}, ${n.id}`)),this.setState({files:{...t,[n.id]:n}}),this.emit("file-added",n),this.emit("files-added",[n]),this.log(`Added file: ${n.name}, ${n.id}, mime type: ${n.type}`),Gl(this,hc)[hc](),n.id}addFiles(e){Gl(this,dc)[dc]();const t={...this.getState().files},n=[],r=[];for(let i=0;i{this.emit("file-added",e)})),this.emit("files-added",n),n.length>5?this.log(`Added batch of ${n.length} files`):Object.keys(n).forEach((e=>{this.log(`Added file: ${n[e].name}\n id: ${n[e].id}\n type: ${n[e].type}`)})),n.length>0&&Gl(this,hc)[hc](),r.length>0){let e="Multiple errors occurred while adding files:\n";if(r.forEach((t=>{e+=`\n * ${t.message}`})),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:r.length}),details:e},"error",this.opts.infoTimeout),"function"===typeof AggregateError)throw new AggregateError(r,e);{const t=new Error(e);throw t.errors=r,t}}}removeFiles(e,t){const{files:n,currentUploads:r}=this.getState(),o={...n},i={...r},a=Object.create(null);function u(e){return void 0===a[e]}e.forEach((e=>{n[e]&&(a[e]=n[e],delete o[e])})),Object.keys(i).forEach((e=>{const t=r[e].fileIDs.filter(u);0!==t.length?i[e]={...r[e],fileIDs:t}:delete i[e]}));const s={currentUploads:i,files:o};0===Object.keys(o).length&&(s.allowNewUpload=!0,s.error=null,s.recoveredState=null),this.setState(s),this.calculateTotalProgress();const l=Object.keys(a);l.forEach((e=>{this.emit("file-removed",a[e],t)})),l.length>5?this.log(`Removed ${l.length} files`):this.log(`Removed files: ${l.join(", ")}`)}removeFile(e,t){void 0===t&&(t=null),this.removeFiles([e],t)}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).uploadComplete)return;const t=this.getFile(e).isPaused||!1,n=!t;return this.setFileState(e,{isPaused:n}),this.emit("upload-pause",e,n),n}pauseAll(){const e={...this.getState().files},t=Object.keys(e).filter((t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted));t.forEach((t=>{const n={...e[t],isPaused:!0};e[t]=n})),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files},t=Object.keys(e).filter((t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted));t.forEach((t=>{const n={...e[t],isPaused:!1,error:null};e[t]=n})),this.setState({files:e}),this.emit("resume-all")}retryAll(){const e={...this.getState().files},t=Object.keys(e).filter((t=>e[t].error));if(t.forEach((t=>{const n={...e[t],isPaused:!1,error:null};e[t]=n})),this.setState({files:e,error:null}),this.emit("retry-all",t),0===t.length)return Promise.resolve({successful:[],failed:[]});const n=Gl(this,yc)[yc](t,{forceAllowNewUpload:!0});return Gl(this,wc)[wc](n)}cancelAll(){this.emit("cancel-all");const{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t,"cancel-all"),this.setState({totalProgress:0,error:null,recoveredState:null})}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",e);const t=Gl(this,yc)[yc]([e],{forceAllowNewUpload:!0});return Gl(this,wc)[wc](t)}reset(){this.cancelAll()}logout(){this.iteratePlugins((e=>{e.provider&&e.provider.logout&&e.provider.logout()}))}calculateProgress(e,t){if(!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${e.id}`);const n=Number.isFinite(t.bytesTotal)&&t.bytesTotal>0;this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,bytesUploaded:t.bytesUploaded,bytesTotal:t.bytesTotal,percentage:n?Math.round(t.bytesUploaded/t.bytesTotal*100):0}}),this.calculateTotalProgress()}calculateTotalProgress(){const e=this.getFiles(),t=e.filter((e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess));if(0===t.length)return this.emit("progress",0),void this.setState({totalProgress:0});const n=t.filter((e=>null!=e.progress.bytesTotal)),r=t.filter((e=>null==e.progress.bytesTotal));if(0===n.length){const e=100*t.length,n=r.reduce(((e,t)=>e+t.progress.percentage),0),o=Math.round(n/e*100);return void this.setState({totalProgress:o})}let o=n.reduce(((e,t)=>e+t.progress.bytesTotal),0);const i=o/n.length;o+=i*r.length;let a=0;n.forEach((e=>{a+=e.progress.bytesUploaded})),r.forEach((e=>{a+=i*(e.progress.percentage||0)/100}));let u=0===o?0:Math.round(a/o*100);u>100&&(u=100),this.setState({totalProgress:u}),this.emit("progress",u)}updateOnlineStatus(){const e="undefined"===typeof window.navigator.onLine||window.navigator.onLine;e?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(e,t){if("function"!==typeof e){const t=`Expected a plugin class, but got ${null===e?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(t)}const n=new e(this,t),r=n.id;if(!r)throw new Error("Your plugin must have an id");if(!n.type)throw new Error("Your plugin must have a type");const o=this.getPlugin(r);if(o){const e=`Already found a plugin named '${o.id}'. Tried to use: '${r}'.\nUppy plugins must have unique \`id\` options. See https://uppy.io/docs/plugins/#id.`;throw new Error(e)}return e.VERSION&&this.log(`Using ${r} v${e.VERSION}`),n.type in Gl(this,tc)[tc]?Gl(this,tc)[tc][n.type].push(n):Gl(this,tc)[tc][n.type]=[n],n.install(),this}getPlugin(e){for(const t of Object.values(Gl(this,tc)[tc])){const n=t.find((t=>t.id===e));if(null!=n)return n}}[Wl](e){return Gl(this,tc)[tc][e]}iteratePlugins(e){Object.values(Gl(this,tc)[tc]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const t=Gl(this,tc)[tc][e.type],n=t.findIndex((t=>t.id===e.id));-1!==n&&t.splice(n,1);const r=this.getState(),o={plugins:{...r.plugins,[e.id]:void 0}};this.setState(o)}close(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.reset(),Gl(this,nc)[nc](),this.iteratePlugins((e=>{this.removePlugin(e)})),"undefined"!==typeof window&&window.removeEventListener&&(window.removeEventListener("online",Gl(this,vc)[vc]),window.removeEventListener("offline",Gl(this,vc)[vc]))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,n){void 0===t&&(t="info"),void 0===n&&(n=3e3);const r="object"===typeof e;this.setState({info:[...this.getState().info,{type:t,message:r?e.message:e,details:r?e.details:null}]}),setTimeout((()=>this.hideInfo()),n),this.emit("info-visible")}log(e,t){const{logger:n}=this.opts;switch(t){case"error":n.error(e);break;case"warning":n.warn(e);break;default:n.debug(e);break}}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?Gl(this,wc)[wc](e):(Gl(this,bc)[bc](e),Promise.reject(new Error("Nonexistent upload")))}[ql](){return Gl(this,yc)[yc](...arguments)}addResultData(e,t){if(!Gl(this,mc)[mc](e))return void this.log(`Not setting result for an upload that has been removed: ${e}`);const{currentUploads:n}=this.getState(),r={...n[e],result:{...n[e].result,...t}};this.setState({currentUploads:{...n,[e]:r}})}upload(){var e;null!=(e=Gl(this,tc)[tc].uploader)&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState();const n=this.opts.onBeforeUpload(t);return!1===n?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(n&&"object"===typeof n&&(t=n,this.setState({files:t})),Promise.resolve().then((()=>{Gl(this,sc)[sc](t),Gl(this,cc)[cc](t)})).catch((e=>{Gl(this,fc)[fc](e)})).then((()=>{const{currentUploads:e}=this.getState(),n=Object.values(e).flatMap((e=>e.fileIDs)),r=[];Object.keys(t).forEach((e=>{const t=this.getFile(e);t.progress.uploadStarted||-1!==n.indexOf(e)||r.push(t.id)}));const o=Gl(this,yc)[yc](r);return Gl(this,wc)[wc](o)})).catch((e=>{Gl(this,fc)[fc](e,{showInformer:!1})})))}}function Dc(e,t){void 0===t&&(t=this.getFiles());const{maxFileSize:n,minFileSize:r,maxTotalFileSize:o,maxNumberOfFiles:i,allowedFileTypes:a}=this.opts.restrictions;if(i&&t.length+1>i)throw new Ql(`${this.i18n("youCanOnlyUploadX",{smart_count:i})}`);if(a){const t=a.some((t=>t.indexOf("/")>-1?!!e.type&&Dl(e.type.replace(/;.*?$/,""),t):!("."!==t[0]||!e.extension)&&e.extension.toLowerCase()===t.substr(1).toLowerCase()));if(!t){const e=a.join(", ");throw new Ql(this.i18n("youCanOnlyUploadFileTypes",{types:e}))}}if(o&&null!=e.size){let n=0;if(n+=e.size,t.forEach((e=>{n+=e.size})),n>o)throw new Ql(this.i18n("exceedsSize",{size:ml(o),file:e.name}))}if(n&&null!=e.size&&e.size>n)throw new Ql(this.i18n("exceedsSize",{size:ml(n),file:e.name}));if(r&&null!=e.size&&e.size{const t=this.getFile(e);return Gl(this,lc)[lc](t)}));if(t.length)throw new ec(t,`${this.i18n("missingRequiredMetaField")}`)}function Ac(e,t){let{showInformer:n=!0,file:r=null,throwErr:o=!0}=void 0===t?{}:t;const i="object"===typeof e?e.message:e,a="object"===typeof e&&e.details?e.details:"";let u=i;if(a&&(u+=` ${a}`),e.isRestriction?(this.log(u),this.emit("restriction-failed",r,e)):this.log(u,"error"),n&&this.info({message:i,details:a},"error",this.opts.infoTimeout),o)throw"object"===typeof e?e:new Error(e)}function Oc(e){const{allowNewUpload:t}=this.getState();!1===t&&Gl(this,fc)[fc](new Ql(this.i18n("noMoreFilesAllowed")),{file:e})}function kc(e,t){const n=Tl(t),r=Rl(n,t),o=Fl(r).extension,i=Boolean(t.isRemote),a=Nl({...t,type:n});if(this.checkIfFileAlreadyExists(a)){const e=new Ql(this.i18n("noDuplicates",{fileName:r}));Gl(this,fc)[fc](e,{file:t})}const u=t.meta||{};u.name=r,u.type=n;const s=Number.isFinite(t.data.size)?t.data.size:null;let l={source:t.source||"",id:a,name:r,extension:o||"",meta:{...this.getState().meta,...u},type:n,data:t.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:s,uploadComplete:!1,uploadStarted:null},size:s,isRemote:i,remote:t.remote||"",preview:t.preview};const c=this.opts.onBeforeFileAdded(l,e);!1===c?Gl(this,fc)[fc](new Ql("Cannot add the file because onBeforeFileAdded returned false."),{showInformer:!1,fileDescriptor:t}):"object"===typeof c&&null!==c&&(l=c);try{const t=Object.keys(e).map((t=>e[t]));Gl(this,uc)[uc](l,t)}catch(f){Gl(this,fc)[fc](f,{file:l})}return l}function Bc(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout((()=>{this.scheduledAutoProceed=null,this.upload().catch((e=>{e.isRestriction||this.log(e.stack||e.message||e)}))}),4))}function Fc(){const e=(e,t,n)=>{let r=e.message||"Unknown error";e.details&&(r+=` ${e.details}`),this.setState({error:r}),null!=t&&t.id in this.getState().files&&this.setFileState(t.id,{error:r,response:n})};this.on("error",e),this.on("upload-error",((t,n,r)=>{if(e(n,t,r),"object"===typeof n&&n.message){const e=new Error(n.message);e.details=n.message,n.details&&(e.details+=` ${n.details}`),e.message=this.i18n("failedToUpload",{file:t.name}),Gl(this,fc)[fc](e,{throwErr:!1})}else Gl(this,fc)[fc](n,{throwErr:!1})})),this.on("upload",(()=>{this.setState({error:null})})),this.on("upload-started",(e=>{this.getFile(e.id)?this.setFileState(e.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:e.size}}):this.log(`Not setting progress for a file that has been removed: ${e.id}`)})),this.on("upload-progress",this.calculateProgress),this.on("upload-success",((e,t)=>{if(!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${e.id}`);const n=this.getFile(e.id).progress;this.setFileState(e.id,{progress:{...n,postprocess:Gl(this,ac)[ac].size>0?{mode:"indeterminate"}:null,uploadComplete:!0,percentage:100,bytesUploaded:n.bytesTotal},response:t,uploadURL:t.uploadURL,isPaused:!1}),null==e.size&&this.setFileState(e.id,{size:t.bytesUploaded||n.bytesTotal}),this.calculateTotalProgress()})),this.on("preprocess-progress",((e,t)=>{this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,preprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${e.id}`)})),this.on("preprocess-complete",(e=>{if(!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${e.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.preprocess,this.setState({files:t})})),this.on("postprocess-progress",((e,t)=>{this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getState().files[e.id].progress,postprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${e.id}`)})),this.on("postprocess-complete",(e=>{if(!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${e.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.postprocess,this.setState({files:t})})),this.on("restored",(()=>{this.calculateTotalProgress()})),this.on("dashboard:file-edit-complete",(e=>{e&&Gl(this,lc)[lc](e)})),"undefined"!==typeof window&&window.addEventListener&&(window.addEventListener("online",Gl(this,vc)[vc]),window.addEventListener("offline",Gl(this,vc)[vc]),setTimeout(Gl(this,vc)[vc],3e3))}function _c(e,t){void 0===t&&(t={});const{forceAllowNewUpload:n=!1}=t,{allowNewUpload:r,currentUploads:o}=this.getState();if(!r&&!n)throw new Error("Cannot create a new upload: already uploading.");const i=Xl();return this.emit("upload",{id:i,fileIDs:e}),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploadBatches&&!1!==this.opts.allowMultipleUploads,currentUploads:{...o,[i]:{fileIDs:e,step:0,result:{}}}}),i}function Tc(e){const{currentUploads:t}=this.getState();return t[e]}function Pc(e){const t={...this.getState().currentUploads};delete t[e],this.setState({currentUploads:t})}async function jc(e){let{currentUploads:t}=this.getState(),n=t[e];const r=n.step||0,o=[...Gl(this,oc)[oc],...Gl(this,ic)[ic],...Gl(this,ac)[ac]];try{for(let i=r;i{const t=this.getFile(e);t&&t.progress.postprocess&&this.emit("postprocess-complete",t)}));const r=n.fileIDs.map((e=>this.getFile(e))),o=r.filter((e=>!e.error)),i=r.filter((e=>e.error));await this.addResultData(e,{successful:o,failed:i,uploadID:e}),t=this.getState().currentUploads,n=t[e]}let i;return n&&(i=n.result,this.emit("complete",i),Gl(this,bc)[bc](e)),null==i&&this.log(`Not setting result for an upload that has been removed: ${e}`),i}Ec.VERSION="2.1.3";var Nc=Ec,Ic=en((function(e,t){var n,r,o,i,a,u,s,l,c={},f=[],d=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function p(e,t){for(var n in t)e[n]=t[n];return e}function h(e){var t=e.parentNode;t&&t.removeChild(e)}function g(e,t,r){var o,i,a,u={};for(a in t)"key"==a?o=t[a]:"ref"==a?i=t[a]:u[a]=t[a];if(arguments.length>2&&(u.children=arguments.length>3?n.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===u[a]&&(u[a]=e.defaultProps[a]);return v(e,u,o,i,null)}function v(e,t,n,i,a){var u={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==a?++o:a};return null==a&&null!=r.vnode&&r.vnode(u),u}function y(e){return e.children}function m(e,t){this.props=e,this.context=t}function b(e,t){if(null==t)return e.__?b(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t0?v(g.type,g.props,g.key,null,g.__v):g)){if(g.__=n,g.__b=n.__b+1,null===(h=D[d])||h&&g.key==h.key&&g.type===h.type)D[d]=void 0;else for(p=0;p2&&(u.children=arguments.length>3?n.call(arguments,2):r),v(e.type,u,o||e.key,i||e.ref,null)},t.createContext=function(e,t){var n={__c:t="__cC"+l++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(E)},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n},t.createElement=g,t.createRef=function(){return{current:null}},t.h=g,t.hydrate=function e(t,n){R(t,n,e)},t.isValidElement=i,t.options=r,t.render=R,t.toChildArray=function e(t,n){return n=n||[],null==t||"boolean"==typeof t||(Array.isArray(t)?t.some((function(t){e(t,n)})):n.push(t)),n}})),Rc=function(e){return(null==e?void 0:e.nodeType)===Node.ELEMENT_NODE},Lc=function(e,t){return void 0===t&&(t=document),"string"===typeof e?t.querySelector(e):Rc(e)?e:null},Mc=class{constructor(e,t){void 0===t&&(t={}),this.uppy=e,this.opts=t}getPluginState(){const{plugins:e}=this.uppy.getState();return e[this.id]||{}}setPluginState(e){const{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(),this.i18nInit()}i18nInit(){const e=new ul([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState()}addTarget(){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}render(){throw new Error("Extend the render method to add your plugin to a DOM element")}update(){}afterUpdate(){}};function zc(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var $c=0;function Hc(e){return"__private_"+$c+++"_"+e}const{render:Uc}=Ic;function Vc(e){let t=null,n=null;return function(){for(var r=arguments.length,o=new Array(r),i=0;i(t=null,e(...n))))),t}}var Wc=Hc("updateUI");class qc extends Mc{constructor(){super(...arguments),Object.defineProperty(this,Wc,{writable:!0,value:void 0})}mount(e,t){const n=t.id,r=Lc(e);if(r){this.isTargetDOMEl=!0;const t=document.createDocumentFragment();return zc(this,Wc)[Wc]=Vc((e=>{this.uppy.getPlugin(this.id)&&(Uc(this.render(e),t),this.afterUpdate())})),this.uppy.log(`Installing ${n} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(r.innerHTML=""),Uc(this.render(this.uppy.getState()),t),this.el=t.firstElementChild,r.appendChild(t),this.onMount(),this.el}let o;if("object"===typeof e&&e instanceof qc)o=e;else if("function"===typeof e){const t=e;this.uppy.iteratePlugins((e=>{if(e instanceof t)return o=e,!1}))}if(o)return this.uppy.log(`Installing ${n} to ${o.id}`),this.parent=o,this.el=o.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${n}`);let i=`Invalid target option given to ${n}.`;throw i+="function"===typeof e?" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":"If you meant to target an HTML element, please make sure that the element exists. Check that the